[FFmpeg-cvslog] Merge commit 'c5fd4b50610f62cbb3baa4f4108139363128dea1'

Clément Bœsch git at videolan.org
Mon Jun 27 19:40:47 CEST 2016


ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Mon Jun 27 19:39:46 2016 +0200| [da7c918e80ed3aa48bfbdb05fc0d554df40c64d3] | committer: Clément Bœsch

Merge commit 'c5fd4b50610f62cbb3baa4f4108139363128dea1'

* commit 'c5fd4b50610f62cbb3baa4f4108139363128dea1':
  build: Simplify postprocessing of linker version script files

Merged-by: Clément Bœsch <u at pkh.me>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=da7c918e80ed3aa48bfbdb05fc0d554df40c64d3
---

 common.mak  |    5 +----
 configure   |   17 +++++++++--------
 library.mak |    3 +++
 3 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/common.mak b/common.mak
index fbe57d5..7815c3f 100644
--- a/common.mak
+++ b/common.mak
@@ -83,9 +83,6 @@ COMPILE_HOSTC = $(call COMPILE,HOSTCC)
 %.h.c:
 	$(Q)echo '#include "$*.h"' >$@
 
-%.ver: %.v
-	$(M)sed 's/MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^ > $@
-
 %.c %.h %.ver: TAG = GEN
 
 # Dummy rule to stop make trying to rebuild removed or renamed headers
@@ -150,7 +147,7 @@ $(TOOLOBJS): | tools
 
 OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(SLIBOBJS) $(TESTOBJS))
 
-CLEANSUFFIXES     = *.d *.o *~ *.h.c *.map *.ver *.ver-sol2 *.ho *.gcno *.gcda *$(DEFAULT_YASMD).asm
+CLEANSUFFIXES     = *.d *.o *~ *.h.c *.gcda *.gcno *.map *.ver *.ho *$(DEFAULT_YASMD).asm
 DISTCLEANSUFFIXES = *.pc
 LIBSUFFIXES       = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a
 
diff --git a/configure b/configure
index 76d2d27..99cf017 100755
--- a/configure
+++ b/configure
@@ -3148,6 +3148,7 @@ objformat="elf"
 pkg_config_default=pkg-config
 ranlib_default="ranlib"
 strip_default="strip"
+version_script='--version-script'
 yasmexe_default="yasm"
 windres_default="windres"
 
@@ -3209,6 +3210,7 @@ SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
 LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
 SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
 SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
+VERSION_SCRIPT_POSTPROCESS_CMD="cat"
 
 asflags_filter=echo
 cflags_filter=echo
@@ -4627,7 +4629,8 @@ case $target_os in
             echo "hwcap_1 = OVERRIDE;" > mapfile &&
             add_ldflags -Wl,-M,mapfile
         nm_default='nm -P -g'
-        SLIB_CREATE_DEF_CMD='$(Q)perl $(SRC_PATH)/compat/solaris/make_sunver.pl $$(filter %.ver,$$^) $(OBJS) | grep -v @ > $(SUBDIR)lib$(NAME).ver-sol2'
+        version_script='-M'
+        VERSION_SCRIPT_POSTPROCESS_CMD='perl $(SRC_PATH)/compat/solaris/make_sunver.pl - $(OBJS)'
         ;;
     netbsd)
         disable symver
@@ -6043,13 +6046,9 @@ enabled xmm_clobber_test &&
     disable xmm_clobber_test
 
 echo "X { local: *; };" > $TMPV
-if test_ldflags -Wl,--version-script,$TMPV; then
-    append SHFLAGS '-Wl,--version-script,\$(SUBDIR)lib\$(NAME).ver'
-elif test_ldflags -Wl,-M,$TMPV; then
-    append SHFLAGS '-Wl,-M,\$(SUBDIR)lib\$(NAME).ver-sol2'
-fi
-
-check_cc <<EOF && enable symver_asm_label
+if test_ldflags -Wl,${version_script},$TMPV; then
+    append SHFLAGS '-Wl,${version_script},\$(SUBDIR)lib\$(NAME).ver'
+    check_cc <<EOF && enable symver_asm_label
 void ff_foo(void) __asm__ ("av_foo at VERSION");
 void ff_foo(void) { ${inline_asm+__asm__($quotes);} }
 EOF
@@ -6057,6 +6056,7 @@ EOF
 __asm__(".symver ff_foo,av_foo at VERSION");
 void ff_foo(void) {}
 EOF
+fi
 
 if [ -z "$optflags" ]; then
     if enabled small; then
@@ -6588,6 +6588,7 @@ SLIB_INSTALL_NAME=${SLIB_INSTALL_NAME}
 SLIB_INSTALL_LINKS=${SLIB_INSTALL_LINKS}
 SLIB_INSTALL_EXTRA_LIB=${SLIB_INSTALL_EXTRA_LIB}
 SLIB_INSTALL_EXTRA_SHLIB=${SLIB_INSTALL_EXTRA_SHLIB}
+VERSION_SCRIPT_POSTPROCESS_CMD=${VERSION_SCRIPT_POSTPROCESS_CMD}
 SAMPLES:=${samples:-\$(FATE_SAMPLES)}
 NOREDZONE_FLAGS=$noredzone_flags
 EOF
diff --git a/library.mak b/library.mak
index ae2d3f2..d8c2b63 100644
--- a/library.mak
+++ b/library.mak
@@ -40,6 +40,9 @@ $(TESTPROGS): THISLIB = $(SUBDIR)$(LIBNAME)
 $(TESTPROGS) $(TOOLS): %$(EXESUF): %.o $(EXEOBJS)
 	$$(LD) $(LDFLAGS) $(LDEXEFLAGS) $$(LD_O) $$(filter %.o,$$^) $$(THISLIB) $(FFEXTRALIBS) $$(ELIBS)
 
+$(SUBDIR)lib$(NAME).ver: $(SUBDIR)lib$(NAME).v $(OBJS)
+	$$(M)sed 's/MAJOR/$(lib$(NAME)_VERSION_MAJOR)/' $$< | $(VERSION_SCRIPT_POSTPROCESS_CMD) > $$@
+
 $(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
 	$(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME)
 


======================================================================

diff --cc common.mak
index fbe57d5,8f6a61f..7815c3f
--- a/common.mak
+++ b/common.mak
@@@ -5,101 -5,6 +5,98 @@@
  # first so "all" becomes default target
  all: all-yes
  
 +DEFAULT_YASMD=.dbg
 +
 +ifeq ($(DBG),1)
 +YASMD=$(DEFAULT_YASMD)
 +else
 +YASMD=
 +endif
 +
 +ifndef SUBDIR
 +
 +ifndef V
 +Q      = @
 +ECHO   = printf "$(1)\t%s\n" $(2)
 +BRIEF  = CC CXX OBJCC HOSTCC HOSTLD AS YASM AR LD STRIP CP WINDRES
 +SILENT = DEPCC DEPHOSTCC DEPAS DEPYASM RANLIB RM
 +
 +MSG    = $@
 +M      = @$(call ECHO,$(TAG),$@);
 +$(foreach VAR,$(BRIEF), \
 +    $(eval override $(VAR) = @$$(call ECHO,$(VAR),$$(MSG)); $($(VAR))))
 +$(foreach VAR,$(SILENT),$(eval override $(VAR) = @$($(VAR))))
 +$(eval INSTALL = @$(call ECHO,INSTALL,$$(^:$(SRC_DIR)/%=%)); $(INSTALL))
 +endif
 +
 +ALLFFLIBS = avcodec avdevice avfilter avformat avresample avutil postproc swscale swresample
 +
 +# NASM requires -I path terminated with /
 +IFLAGS     := -I. -I$(SRC_LINK)/
 +CPPFLAGS   := $(IFLAGS) $(CPPFLAGS)
 +CFLAGS     += $(ECFLAGS)
 +CCFLAGS     = $(CPPFLAGS) $(CFLAGS)
 +OBJCFLAGS  += $(EOBJCFLAGS)
 +OBJCCFLAGS  = $(CPPFLAGS) $(CFLAGS) $(OBJCFLAGS)
 +ASFLAGS    := $(CPPFLAGS) $(ASFLAGS)
 +CXXFLAGS   := $(CPPFLAGS) $(CFLAGS) $(CXXFLAGS)
 +YASMFLAGS  += $(IFLAGS:%=%/) -Pconfig.asm
 +
 +HOSTCCFLAGS = $(IFLAGS) $(HOSTCPPFLAGS) $(HOSTCFLAGS)
 +LDFLAGS    := $(ALLFFLIBS:%=$(LD_PATH)lib%) $(LDFLAGS)
 +
 +define COMPILE
 +       $(call $(1)DEP,$(1))
 +       $($(1)) $($(1)FLAGS) $($(1)_DEPFLAGS) $($(1)_C) $($(1)_O) $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<)
 +endef
 +
 +COMPILE_C = $(call COMPILE,CC)
 +COMPILE_CXX = $(call COMPILE,CXX)
 +COMPILE_S = $(call COMPILE,AS)
 +COMPILE_M = $(call COMPILE,OBJCC)
 +COMPILE_HOSTC = $(call COMPILE,HOSTCC)
 +
 +%.o: %.c
 +	$(COMPILE_C)
 +
 +%.o: %.cpp
 +	$(COMPILE_CXX)
 +
 +%.o: %.m
 +	$(COMPILE_M)
 +
 +%.s: %.c
 +	$(CC) $(CCFLAGS) -S -o $@ $<
 +
 +%.o: %.S
 +	$(COMPILE_S)
 +
 +%_host.o: %.c
 +	$(COMPILE_HOSTC)
 +
 +%.o: %.rc
 +	$(WINDRES) $(IFLAGS) --preprocessor "$(DEPWINDRES) -E -xc-header -DRC_INVOKED $(CC_DEPFLAGS)" -o $@ $<
 +
 +%.i: %.c
 +	$(CC) $(CCFLAGS) $(CC_E) $<
 +
 +%.h.c:
 +	$(Q)echo '#include "$*.h"' >$@
 +
- %.ver: %.v
- 	$(M)sed 's/MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^ > $@
- 
 +%.c %.h %.ver: TAG = GEN
 +
 +# Dummy rule to stop make trying to rebuild removed or renamed headers
 +%.h:
 +	@:
 +
 +# Disable suffix rules.  Most of the builtin rules are suffix rules,
 +# so this saves some time on slow systems.
 +.SUFFIXES:
 +
 +# Do not delete intermediate files from chains of implicit rules
 +$(OBJS):
 +endif
 +
  include $(SRC_PATH)/arch.mak
  
  OBJS      += $(OBJS-yes)
@@@ -148,9 -50,9 +145,9 @@@ $(SLIBOBJS): | $(sort $(dir $(SLIBOBJS)
  $(TESTOBJS): | $(sort $(dir $(TESTOBJS)))
  $(TOOLOBJS): | tools
  
 -OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(TESTOBJS))
 +OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(SLIBOBJS) $(TESTOBJS))
  
- CLEANSUFFIXES     = *.d *.o *~ *.h.c *.map *.ver *.ver-sol2 *.ho *.gcno *.gcda *$(DEFAULT_YASMD).asm
 -CLEANSUFFIXES     = *.d *.o *~ *.h.c *.gcda *.gcno *.map *.ver
++CLEANSUFFIXES     = *.d *.o *~ *.h.c *.gcda *.gcno *.map *.ver *.ho *$(DEFAULT_YASMD).asm
  DISTCLEANSUFFIXES = *.pc
  LIBSUFFIXES       = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a
  
diff --cc configure
index 76d2d27,1b5e017..99cf017
--- a/configure
+++ b/configure
@@@ -3146,10 -2463,15 +3146,11 @@@ ln_s_default="ln -s -f
  nm_default="nm -g"
  objformat="elf"
  pkg_config_default=pkg-config
 -ranlib="ranlib"
 -strip="strip"
 +ranlib_default="ranlib"
 +strip_default="strip"
+ version_script='--version-script'
 -yasmexe="yasm"
 -
 -# machine
 -arch_default=$(uname -m)
 -cpu="generic"
 -intrinsics="none"
 +yasmexe_default="yasm"
 +windres_default="windres"
  
  # OS
  target_os_default=$(tolower $(uname -s))
@@@ -6588,8 -5243,8 +6588,9 @@@ SLIB_INSTALL_NAME=${SLIB_INSTALL_NAME
  SLIB_INSTALL_LINKS=${SLIB_INSTALL_LINKS}
  SLIB_INSTALL_EXTRA_LIB=${SLIB_INSTALL_EXTRA_LIB}
  SLIB_INSTALL_EXTRA_SHLIB=${SLIB_INSTALL_EXTRA_SHLIB}
+ VERSION_SCRIPT_POSTPROCESS_CMD=${VERSION_SCRIPT_POSTPROCESS_CMD}
 -SAMPLES:=${samples:-\$(LIBAV_SAMPLES)}
 +SAMPLES:=${samples:-\$(FATE_SAMPLES)}
 +NOREDZONE_FLAGS=$noredzone_flags
  EOF
  
  get_version(){



More information about the ffmpeg-cvslog mailing list