Create symbolic links for all library sonames and clean up Makefiles.
authorDiego Biurrun <diego@biurrun.de>
Sat, 14 Jan 2006 03:39:02 +0000 (03:39 +0000)
committerDiego Biurrun <diego@biurrun.de>
Sat, 14 Jan 2006 03:39:02 +0000 (03:39 +0000)
based on a patch by Luca Barbato < lu_zero -- at -- gentoo -- dot -- org >

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

configure
libavcodec/Makefile
libavcodec/libpostproc/Makefile
libavformat/Makefile
libavutil/Makefile

index e983d23..ef914f7 100755 (executable)
--- a/configure
+++ b/configure
@@ -219,7 +219,7 @@ vhook="default"
 dlfcn="no"
 dlopen="no"
 mpegaudio_hp="yes"
 dlfcn="no"
 dlopen="no"
 mpegaudio_hp="yes"
-SHFLAGS='-shared -Wl,-soname,$@.$(LIBVERSION)'
+SHFLAGS='-shared -Wl,-soname,$@.$(LIBMAJOR)'
 netserver="no"
 need_inet_aton="no"
 ffserver="yes"
 netserver="no"
 need_inet_aton="no"
 ffserver="yes"
@@ -232,6 +232,8 @@ LIBPREF="lib"
 LIBSUF=".a"
 SLIBPREF="lib"
 SLIBSUF=".so"
 LIBSUF=".a"
 SLIBPREF="lib"
 SLIBSUF=".so"
+SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)$(SLIBSUF).$(LIBVERSION)'
+SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)$(SLIBSUF).$(LIBMAJOR)'
 EXESUF=""
 BUILDSUF=""
 amr_nb="no"
 EXESUF=""
 BUILDSUF=""
 amr_nb="no"
@@ -343,6 +345,8 @@ strip="strip -x"
 installstrip=""
 LDFLAGS="-Wl,-dynamic,-search_paths_first"
 SLIBSUF=".dylib"
 installstrip=""
 LDFLAGS="-Wl,-dynamic,-search_paths_first"
 SLIBSUF=".dylib"
+SLIBNAME_WITH_FULLVERSION='$(SLIBPREF)$(NAME).$(LIBVERSION)$(SLIBSUF)'
+SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME).$(LIBMAJOR)$(SLIBSUF)'
 FFSLDFLAGS=-Wl,-bind_at_load
 ;;
 MINGW32*)
 FFSLDFLAGS=-Wl,-bind_at_load
 ;;
 MINGW32*)
@@ -1504,6 +1508,8 @@ if test "$lshared" = "yes" ; then
   echo "LAVFVERSION=$lavf_version" >> config.mak
   echo "LAVUMAJOR=${lavu_version%%.*}" >> config.mak
   echo "LAVUVERSION=$lavu_version" >> config.mak
   echo "LAVFVERSION=$lavf_version" >> config.mak
   echo "LAVUMAJOR=${lavu_version%%.*}" >> config.mak
   echo "LAVUVERSION=$lavu_version" >> config.mak
+  echo "SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}" >> config.mak
+  echo "SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}" >> config.mak
 fi
 echo "EXTRALIBS=$extralibs" >> config.mak
 version=`grep '#define FFMPEG_VERSION ' "$source_path/libavcodec/avcodec.h" |
 fi
 echo "EXTRALIBS=$extralibs" >> config.mak
 version=`grep '#define FFMPEG_VERSION ' "$source_path/libavcodec/avcodec.h" |
index 2e91588..5e3fd45 100644 (file)
@@ -399,6 +399,9 @@ OBJS := $(OBJS) $(ASM_OBJS)
 LIB= $(LIBPREF)avcodec$(LIBSUF)
 LIBAVUTIL= $(SRC_PATH)/libavutil/$(LIBPREF)avutil$(LIBSUF)
 ifeq ($(BUILD_SHARED),yes)
 LIB= $(LIBPREF)avcodec$(LIBSUF)
 LIBAVUTIL= $(SRC_PATH)/libavutil/$(LIBPREF)avutil$(LIBSUF)
 ifeq ($(BUILD_SHARED),yes)
+LIBVERSION=$(LAVCVERSION)
+LIBMAJOR=$(LAVCMAJOR)
+NAME=avcodec
 SLIBNAME= $(SLIBPREF)avcodec$(SLIBSUF)
 endif
 TESTS= imgresample-test dct-test motion-test fft-test
 SLIBNAME= $(SLIBPREF)avcodec$(SLIBSUF)
 endif
 TESTS= imgresample-test dct-test motion-test fft-test
@@ -490,14 +493,17 @@ fft-test: fft-test.o $(LIB)
        $(CC) -o $@ $^ $(LIBAVUTIL) -lm
 
 ifeq ($(BUILD_SHARED),yes)
        $(CC) -o $@ $^ $(LIBAVUTIL) -lm
 
 ifeq ($(BUILD_SHARED),yes)
-LIBVERSION=$(LAVCMAJOR)
 install: all install-headers
 ifeq ($(CONFIG_WIN32),yes)
        install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
 else
        install -d $(libdir)
 install: all install-headers
 ifeq ($(CONFIG_WIN32),yes)
        install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
 else
        install -d $(libdir)
-       install $(INSTALLSTRIP) -m 755 $(SLIBNAME) $(libdir)/libavcodec-$(VERSION)$(SLIBSUF)
-       ln -sf $(SLIBPREF)avcodec-$(VERSION)$(SLIBSUF) $(libdir)/$(SLIBNAME)
+       install $(INSTALLSTRIP) -m 755 $(SLIBNAME) \
+               $(libdir)/$(SLIBNAME_WITH_VERSION)
+       ln -sf $(SLIBNAME_WITH_VERSION) \
+               $(libdir)/$(SLIBNAME_WITH_MAJOR)
+       ln -sf $(SLIBNAME_WITH_VERSION) \
+               $(libdir)/$(SLIBNAME)
        $(LDCONFIG) || true
 endif
 ifeq ($(CONFIG_PP),yes)
        $(LDCONFIG) || true
 endif
 ifeq ($(CONFIG_PP),yes)
index f497d6a..3026b96 100644 (file)
@@ -5,6 +5,9 @@ VPATH=$(SRC_PATH)/libavcodec/libpostproc
 
 LIB = $(LIBPREF)postproc$(LIBSUF)
 ifeq ($(SHARED_PP),yes)
 
 LIB = $(LIBPREF)postproc$(LIBSUF)
 ifeq ($(SHARED_PP),yes)
+LIBVERSION=$(SPPVERSION)
+LIBMAJOR=$(SPPMAJOR)
+NAME=postproc
 SLIBNAME = $(SLIBPREF)postproc$(SLIBSUF)
 endif
 
 SLIBNAME = $(SLIBPREF)postproc$(SLIBSUF)
 endif
 
@@ -53,8 +56,12 @@ ifeq ($(CONFIG_WIN32),yes)
        install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
 else
        install -d $(libdir)
        install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
 else
        install -d $(libdir)
-       install $(INSTALLSTRIP) -m 755 $(SLIBNAME) $(libdir)/libpostproc-$(VERSION)$(SLIBSUF)
-       ln -sf $(SLIBPREF)postproc-$(VERSION)$(SLIBSUF) $(libdir)/$(SLIBNAME)
+       install $(INSTALLSTRIP) -m 755 $(SLIBNAME) \
+               $(libdir)/$(SLIBNAME_WITH_VERSION)
+       ln -sf $(SLIBNAME_WITH_VERSION) \
+               $(libdir)/$(SLIBNAME_WITH_MAJOR)
+       ln -sf $(SLIBNAME_WITH_VERSION) \
+               $(libdir)/$(SLIBNAME)
        $(LDCONFIG) || true
 endif
 endif
        $(LDCONFIG) || true
 endif
 endif
index 8db1c59..3b2ee7d 100644 (file)
@@ -80,7 +80,9 @@ endif
 
 LIB= $(LIBPREF)avformat$(LIBSUF)
 ifeq ($(BUILD_SHARED),yes)
 
 LIB= $(LIBPREF)avformat$(LIBSUF)
 ifeq ($(BUILD_SHARED),yes)
-LIBVERSION=$(LAVFMAJOR)
+LIBVERSION=$(LAVFVERSION)
+LIBMAJOR=$(LAVFMAJOR)
+NAME=avformat
 SLIBNAME= $(SLIBPREF)avformat$(SLIBSUF)
 AVCLIBS+=-lavcodec$(BUILDSUF) -L../libavcodec -lavutil$(BUILDSUF) -L../libavutil
 endif
 SLIBNAME= $(SLIBPREF)avformat$(SLIBSUF)
 AVCLIBS+=-lavcodec$(BUILDSUF) -L../libavcodec -lavutil$(BUILDSUF) -L../libavutil
 endif
@@ -111,8 +113,12 @@ ifeq ($(CONFIG_WIN32),yes)
        install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
 else
        install -d $(libdir)
        install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
 else
        install -d $(libdir)
-       install $(INSTALLSTRIP) -m 755 $(SLIBNAME) $(libdir)/$(SLIBPREF)avformat-$(VERSION)$(SLIBSUF)
-       ln -sf $(SLIBPREF)avformat-$(VERSION)$(SLIBSUF) $(libdir)/$(SLIBNAME)
+       install $(INSTALLSTRIP) -m 755 $(SLIBNAME) \
+               $(libdir)/$(SLIBNAME_WITH_VERSION)
+       ln -sf $(SLIBNAME_WITH_VERSION) \
+               $(libdir)/$(SLIBNAME_WITH_MAJOR)
+       ln -sf $(SLIBNAME_WITH_VERSION) \
+               $(libdir)/$(SLIBNAME)
        $(LDCONFIG) || true
 endif
 else
        $(LDCONFIG) || true
 endif
 else
index 47ce552..efa40da 100644 (file)
@@ -22,7 +22,9 @@ SRCS := $(OBJS:.o=.c)
 
 LIB= $(LIBPREF)avutil$(LIBSUF)
 ifeq ($(BUILD_SHARED),yes)
 
 LIB= $(LIBPREF)avutil$(LIBSUF)
 ifeq ($(BUILD_SHARED),yes)
-LIBVERSION=$(LAVUMAJOR)
+LIBVERSION=$(LAVUVERSION)
+LIBMAJOR=$(LAVUMAJOR)
+NAME=avutil
 SLIBNAME= $(SLIBPREF)avutil$(SLIBSUF)
 endif
 
 SLIBNAME= $(SLIBPREF)avutil$(SLIBSUF)
 endif
 
@@ -62,8 +64,12 @@ ifeq ($(CONFIG_WIN32),yes)
        install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
 else
        install -d $(libdir)
        install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
 else
        install -d $(libdir)
-       install $(INSTALLSTRIP) -m 755 $(SLIBNAME) $(libdir)/libavutil-$(VERSION)$(SLIBSUF)
-       ln -sf libavutil-$(VERSION)$(SLIBSUF) $(libdir)/$(SLIBNAME)
+       install $(INSTALLSTRIP) -m 755 $(SLIBNAME) \
+               $(libdir)/$(SLIBNAME_WITH_VERSION)
+       ln -sf $(SLIBNAME_WITH_VERSION) \
+               $(libdir)/$(SLIBNAME_WITH_MAJOR)
+       ln -sf $(SLIBNAME_WITH_VERSION) \
+               $(libdir)/$(SLIBNAME)
        $(LDCONFIG) || true
 endif
 else
        $(LDCONFIG) || true
 endif
 else