Create shared libraries using versioned filenames and add -rpath-link
authorMåns Rullgård <mans@mansr.com>
Thu, 11 May 2006 20:36:00 +0000 (20:36 +0000)
committerMåns Rullgård <mans@mansr.com>
Thu, 11 May 2006 20:36:00 +0000 (20:36 +0000)
to LDFLAGS so linker finds them when using --as-needed (which is default
in some installations).  Using --as-needed is generally a good thing, so
add that explicitly as well.

Originally committed as revision 5362 to svn://svn.ffmpeg.org/ffmpeg/trunk

common.mak
configure

index 24ccaedb8236eb4ee113316de0353d9c84cd3628..94272c58131de673bdbdabcaf17d0db12d7671d4 100644 (file)
@@ -31,7 +31,10 @@ $(LIB): $(STATIC_OBJS)
        $(AR) rc $@ $^ $(EXTRAOBJS)
        $(RANLIB) $@
 
-$(SLIBNAME): $(SHARED_OBJS)
+$(SLIBNAME): $(SLIBNAME_WITH_MAJOR)
+       ln -sf $^ $@
+
+$(SLIBNAME_WITH_MAJOR): $(SHARED_OBJS)
        $(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $^ $(EXTRALIBS) $(EXTRAOBJS)
 ifeq ($(CONFIG_WIN32),yes)
        -lib /machine:i386 /def:$(@:.dll=.def)
index 4ff62c7f9722e079b6629df71bd325805dae4615..f2b8bacd7bd36c06c908e128454ce5c44bfba27c 100755 (executable)
--- a/configure
+++ b/configure
@@ -228,7 +228,7 @@ vhook="default"
 dlfcn="no"
 dlopen="no"
 mpegaudio_hp="yes"
-SHFLAGS='-shared -Wl,-soname,$@.$(LIBMAJOR)'
+SHFLAGS='-shared -Wl,-soname,$@'
 netserver="no"
 need_inet_aton="no"
 protocols="yes"
@@ -383,7 +383,7 @@ cygwin="yes"
 EXESUF=".exe"
 ;;
 Linux)
-LDFLAGS="$LDFLAGS -rdynamic"
+LDFLAGS="$LDFLAGS -rdynamic -Wl,--as-needed -Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/libavutil"
 ;;
 IRIX*)
 ranlib="echo ignoring ranlib"