diff options
author | Janne Grunau <janne-libav@jannau.net> | 2017-06-20 19:25:43 +0200 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2017-06-22 13:54:34 +0200 |
commit | 857e26b655a769e5a56bada1a0d9adb44cc176b7 (patch) | |
tree | 5e5f0ed05f5d241ab4c50bc86df61a4850edd99c | |
parent | 333a34da3a6d13155de480e7d16ec5fec7f4cd6c (diff) | |
download | ffmpeg-857e26b655a769e5a56bada1a0d9adb44cc176b7.tar.gz |
build: Add an option for passing linker flags to the shared library build
Also employ this mechanism to pass $libdir to the runtime library search
path if rpath is enabled. This fixes underlinking of some test binaries
on some systems.
-rw-r--r-- | avbuild/library.mak | 2 | ||||
-rwxr-xr-x | configure | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/avbuild/library.mak b/avbuild/library.mak index 2095f61d80..30757546fd 100644 --- a/avbuild/library.mak +++ b/avbuild/library.mak @@ -48,7 +48,7 @@ $(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR) $(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SUBDIR)lib$(NAME).ver $(DEP_LIBS) $(SLIB_CREATE_DEF_CMD) - $$(LD) $(SHFLAGS) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS) + $$(LD) $(SHFLAGS) $(LDFLAGS) $(LDSOFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS) $(SLIB_EXTRA_CMD) clean:: @@ -283,6 +283,7 @@ Toolchain options: --extra-objcflags=FLAGS add FLAGS to OBJCFLAGS [$CFLAGS] --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS] --extra-ldexeflags=ELDFLAGS add ELDFLAGS to LDEXEFLAGS [$LDEXEFLAGS] + --extra-ldsoflags=ELDFLAGS add ELDFLAGS to LDSOFLAGS [$LDSOFLAGS] --extra-libs=ELIBS add ELIBS [$ELIBS] --extra-version=STRING version string suffix [] --optflags=OPTFLAGS override optimization-related compiler flags @@ -740,6 +741,10 @@ add_ldexeflags(){ append LDEXEFLAGS $($ldflags_filter "$@") } +add_ldsoflags(){ + append LDSOFLAGS $($ldflags_filter "$@") +} + add_stripflags(){ append STRIPFLAGS "$@" } @@ -2802,6 +2807,9 @@ for opt do --extra-ldexeflags=*) add_ldexeflags $optval ;; + --extra-ldsoflags=*) + add_ldsoflags $optval + ;; --extra-libs=*) add_extralibs $optval ;; @@ -4950,7 +4958,7 @@ EOF # add some linker flags check_ldflags -Wl,--warn-common check_ldflags -Wl,-rpath-link=libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample -enabled rpath && add_ldexeflags -Wl,-rpath,$libdir +enabled rpath && add_ldexeflags -Wl,-rpath,$libdir && add_ldsoflags -Wl,-rpath,$libdir test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic # add some strip flags @@ -5410,6 +5418,7 @@ LD_PATH=$LD_PATH DLLTOOL=$dlltool LDFLAGS=$LDFLAGS LDEXEFLAGS=$LDEXEFLAGS +LDSOFLAGS=$LDSOFLAGS SHFLAGS=$(echo $($ldflags_filter $SHFLAGS)) STRIPFLAGS=$STRIPFLAGS X86ASMFLAGS=$X86ASMFLAGS |