[vlc-commits] [Git][videolan/vlc][master] 2 commits: configure: keep the protobuf version used to build

Steve Lhomme (@robUx4) gitlab at videolan.org
Mon Nov 7 08:53:56 UTC 2022



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
f17d66eb by Steve Lhomme at 2022-11-07T08:18:49+00:00
configure: keep the protobuf version used to build

- - - - -
24294e0c by Steve Lhomme at 2022-11-07T08:18:49+00:00
sout: chromecast: use a compiled .proto header based on protobuf lib version

This is allows switching to branches with a different protoc and automatically
rebuild what's needed. The proper dependencies should be updated.

- - - - -


2 changed files:

- configure.ac
- modules/stream_out/Makefile.am


Changes:

=====================================
configure.ac
=====================================
@@ -3862,11 +3862,11 @@ AS_IF([test -n "$PKG_CONFIG"],[
     AC_CHECK_TOOL(PROTOC, protoc, no)
     AS_IF([test "${PROTOC}" != "no"], [
         dnl silently checks the protoc version matches the protobuf library
-        protoc_ver="$(eval ${PROTOC} --version 2>/dev/null | head -1 | sed s/'.* '// | cut -d '.' -f -2)"
-        protoc_ver_next="${protoc_ver%.*}.$((${protoc_ver##*.}+1))"
-        AC_MSG_CHECKING([protobuf-lite matches ${PROTOC} version ${protoc_ver}])
+        PROTOBUF_VERSION="$(eval ${PROTOC} --version 2>/dev/null | head -1 | sed s/'.* '// | cut -d '.' -f -2)"
+        protoc_ver_next="${PROTOBUF_VERSION%.*}.$((${PROTOBUF_VERSION##*.}+1))"
+        AC_MSG_CHECKING([protobuf-lite matches ${PROTOC} version ${PROTOBUF_VERSION}])
         AS_IF([test -n "$PKG_CONFIG"],[
-            ($PKG_CONFIG --exists --print-errors "protobuf-lite >= ${protoc_ver} protobuf-lite < ${protoc_ver_next}") 2>&5
+            ($PKG_CONFIG --exists --print-errors "protobuf-lite >= ${PROTOBUF_VERSION} protobuf-lite < ${protoc_ver_next}") 2>&5
             ac_status=$?
             AS_IF([test $ac_status = 0],[
                 protoc_matching=yes
@@ -3888,10 +3888,10 @@ AS_IF([test -n "$PKG_CONFIG"],[
 
         AS_IF([test "${PROTOC}" != "no"], [
             dnl silently checks the protoc version matches the protobuf library
-            protoc_ver="$(eval ${PROTOC} --version 2>/dev/null | head -1 | sed s/'.* '// | cut -d '.' -f -2)"
-            protoc_ver_next="${protoc_ver%.*}.$((${protoc_ver##*.}+1))"
-            AC_MSG_CHECKING([protobuf-lite matches ${PROTOC} version ${protoc_ver}])
-            ($PKG_CONFIG --exists --print-errors "protobuf-lite >= ${protoc_ver} protobuf-lite < ${protoc_ver_next}") 2>&5
+            PROTOBUF_VERSION="$(eval ${PROTOC} --version 2>/dev/null | head -1 | sed s/'.* '// | cut -d '.' -f -2)"
+            protoc_ver_next="${PROTOBUF_VERSION%.*}.$((${PROTOBUF_VERSION##*.}+1))"
+            AC_MSG_CHECKING([protobuf-lite matches ${PROTOC} version ${PROTOBUF_VERSION}])
+            ($PKG_CONFIG --exists --print-errors "protobuf-lite >= ${PROTOBUF_VERSION} protobuf-lite < ${protoc_ver_next}") 2>&5
             ac_status=$?
             AS_IF([test $ac_status = 0],[
                 protoc_matching=yes
@@ -3905,6 +3905,7 @@ AS_IF([test -n "$PKG_CONFIG"],[
         ])
     ])
 ])
+AC_SUBST([PROTOBUF_VERSION])
 AM_CONDITIONAL([BUILD_CHROMECAST], [test "${enable_chromecast}" != "no" -a "${protoc_matching}" = yes])
 
 dnl


=====================================
modules/stream_out/Makefile.am
=====================================
@@ -113,12 +113,16 @@ sout_LTLIBRARIES += $(LTLIBstream_out_chromaprint)
 # Chromecast plugin
 SUFFIXES += .proto .pb.cc
 
-%.pb.h %.pb.cc: %.proto
-	$(PROTOC) --cpp_out=. -I$(srcdir) $<
+.chromecast_proto: stream_out/chromecast/cast_channel.proto
+	mkdir -p stream_out/chromecast/@PROTOBUF_VERSION@
+	$(PROTOC) --cpp_out=stream_out/chromecast/@PROTOBUF_VERSION@ -I$(srcdir)/stream_out/chromecast $<
+	touch $@
+
+stream_out/chromecast/@PROTOBUF_VERSION@/cast_channel.pb.h stream_out/chromecast/@PROTOBUF_VERSION@/cast_channel.pb.cc: .chromecast_proto
 
 libdemux_chromecast_plugin_la_SOURCES = stream_out/chromecast/chromecast_demux.cpp stream_out/chromecast/chromecast.h \
                                         stream_out/chromecast/chromecast_common.h
-libdemux_chromecast_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -Istream_out/chromecast
+libdemux_chromecast_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -Istream_out/chromecast/@PROTOBUF_VERSION@
 
 libstream_out_chromecast_plugin_la_SOURCES = stream_out/chromecast/cast.cpp stream_out/chromecast/chromecast.h \
                                              stream_out/chromecast/cast_channel.proto \
@@ -126,14 +130,15 @@ libstream_out_chromecast_plugin_la_SOURCES = stream_out/chromecast/cast.cpp stre
                                              stream_out/renderer_common.cpp \
                                              stream_out/chromecast/chromecast_common.h stream_out/chromecast/chromecast_ctrl.cpp \
                                              misc/webservices/json.h misc/webservices/json.c stream_out/chromecast/chromecast_communication.cpp
-nodist_libstream_out_chromecast_plugin_la_SOURCES = stream_out/chromecast/cast_channel.pb.cc
-libstream_out_chromecast_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -Istream_out/chromecast $(CHROMECAST_CFLAGS)
+nodist_libstream_out_chromecast_plugin_la_SOURCES = stream_out/chromecast/@PROTOBUF_VERSION@/cast_channel.pb.cc
+libstream_out_chromecast_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -Istream_out/chromecast/@PROTOBUF_VERSION@ $(CHROMECAST_CFLAGS)
 libstream_out_chromecast_plugin_la_LIBADD = $(CHROMECAST_LIBS) $(SOCKET_LIBS)
 CLEANFILES += $(nodist_libstream_out_chromecast_plugin_la_SOURCES)
 
 if ENABLE_SOUT
 if BUILD_CHROMECAST
-BUILT_SOURCES += stream_out/chromecast/cast_channel.pb.h
+BUILT_SOURCES += stream_out/chromecast/@PROTOBUF_VERSION@/cast_channel.pb.cc \
+                 stream_out/chromecast/@PROTOBUF_VERSION@/cast_channel.pb.h
 sout_LTLIBRARIES += libstream_out_chromecast_plugin.la
 demux_LTLIBRARIES += libdemux_chromecast_plugin.la
 endif



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/959a0e2be7dff078419076a427d71a4641c890e6...24294e0c2954483948197bad66fc9a079a9a470b

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/959a0e2be7dff078419076a427d71a4641c890e6...24294e0c2954483948197bad66fc9a079a9a470b
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list