Commit c99dd233 authored by j@v2v.cc's avatar j@v2v.cc Committed by Diego Biurrun

Move all definitions of external dependencies into configure instead of

defining it in configure and the Makefiles in a random fashion.
patch by j -- at -- v2v -- dot -- cc

Originally committed as revision 4628 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 5af83797
...@@ -38,43 +38,6 @@ ifeq ($(BUILD_SHARED),yes) ...@@ -38,43 +38,6 @@ ifeq ($(BUILD_SHARED),yes)
DEP_LIBS=libavcodec/$(SLIBPREF)avcodec$(SLIBSUF) libavformat/$(SLIBPREF)avformat$(SLIBSUF) DEP_LIBS=libavcodec/$(SLIBPREF)avcodec$(SLIBSUF) libavformat/$(SLIBPREF)avformat$(SLIBSUF)
else else
DEP_LIBS=libavcodec/$(LIBPREF)avcodec$(LIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF) DEP_LIBS=libavcodec/$(LIBPREF)avcodec$(LIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF)
ifeq ($(CONFIG_MP3LAME),yes)
EXTRALIBS+=-lmp3lame
endif
endif
ifeq ($(CONFIG_LIBOGG),yes)
ifeq ($(CONFIG_LIBVORBIS),yes)
EXTRALIBS+= -lvorbisenc -lvorbis
endif
ifeq ($(CONFIG_LIBTHEORA),yes)
EXTRALIBS+= -ltheora
endif
EXTRALIBS+= -logg
endif
ifeq ($(CONFIG_FAAD),yes)
ifeq ($(CONFIG_FAADBIN),yes)
# no libs needed
else
EXTRALIBS += -lfaad
endif
endif
ifeq ($(CONFIG_FAAC),yes)
EXTRALIBS+=-lfaac
endif
ifeq ($(CONFIG_XVID),yes)
EXTRALIBS+=-lxvidcore
endif
ifeq ($(CONFIG_LIBGSM),yes)
EXTRALIBS+=-lgsm
endif
ifeq ($(CONFIG_DC1394),yes)
EXTRALIBS+=-ldc1394_control -lraw1394
endif endif
ifeq ($(BUILD_VHOOK),yes) ifeq ($(BUILD_VHOOK),yes)
......
...@@ -375,6 +375,7 @@ SLIBPREF="" ...@@ -375,6 +375,7 @@ SLIBPREF=""
SLIBSUF=".dll" SLIBSUF=".dll"
EXESUF=".exe" EXESUF=".exe"
extralibs="" extralibs=""
pkg_requires=""
v4l="no" v4l="no"
audio_oss="no" audio_oss="no"
dv1394="no" dv1394="no"
...@@ -470,6 +471,7 @@ for opt do ...@@ -470,6 +471,7 @@ for opt do
--disable-audio-oss) audio_oss="no" --disable-audio-oss) audio_oss="no"
;; ;;
--disable-audio-beos) audio_beos="no" --disable-audio-beos) audio_beos="no"
extralibs="$extralibs -lbe -lmedia"
;; ;;
--disable-dv1394) dv1394="no" --disable-dv1394) dv1394="no"
;; ;;
...@@ -481,33 +483,48 @@ for opt do ...@@ -481,33 +483,48 @@ for opt do
;; ;;
--enable-a52bin) a52bin="yes" --enable-a52bin) a52bin="yes"
;; ;;
--enable-dts) dts="yes" ; extralibs="$extralibs -ldts" --enable-dts) dts="yes"
extralibs="$extralibs -ldts"
;; ;;
--enable-pp) pp="yes" --enable-pp) pp="yes"
;; ;;
--enable-shared-pp) shared_pp="yes" --enable-shared-pp) shared_pp="yes"
;; ;;
--enable-libgsm) libgsm="yes" --enable-libgsm) libgsm="yes"
extralibs="$extralibs -lgsm"
;; ;;
--enable-mp3lame) mp3lame="yes"; extralibs="$extralibs -lmp3lame" --enable-mp3lame) mp3lame="yes"
extralibs="$extralibs -lmp3lame"
;; ;;
--enable-libogg) libogg="yes" --enable-libogg) libogg="yes"
extralibs="$extralibs -logg"
pkg_requires="$pkg_requires ogg >= 1.1"
;; ;;
--enable-vorbis) vorbis="yes" --enable-vorbis) vorbis="yes"
extralibs="$extralibs -lvorbis -lvorbisenc"
pkg_requires="$pkg_requires vorbis vorbisenc"
;; ;;
--enable-theora) theora="yes" --enable-theora) theora="yes"
extralibs="$extralibs -ltheora"
pkg_requires="$pkg_requires theora"
;; ;;
--enable-faad) faad="yes" --enable-faad) faad="yes"
extralibs="$extralibs -lfaad"
;; ;;
--enable-faadbin) faadbin="yes" --enable-faadbin) faadbin="yes"
;; ;;
--enable-faac) faac="yes"; extralibs="$extralibs -lfaac" --enable-faac) faac="yes"
extralibs="$extralibs -lfaac"
;; ;;
--enable-xvid) xvid="yes" --enable-xvid) xvid="yes"
extralibs="$extralibs -lxvidcore"
;; ;;
--enable-x264) x264="yes"; extralibs="$extralibs -lx264" --enable-x264) x264="yes"
extralibs="$extralibs -lx264"
;; ;;
--enable-dc1394) dc1394="yes" --enable-dc1394) dc1394="yes"
extralibs="$extralibs -ldc1394_control -lraw1394"
pkg_requires="$pkg_requires libraw1394"
;; ;;
--disable-vhook) vhook="no" --disable-vhook) vhook="no"
;; ;;
...@@ -1772,17 +1789,6 @@ lavc_version=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcode ...@@ -1772,17 +1789,6 @@ lavc_version=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcode
lavf_version=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]//g'` lavf_version=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]//g'`
lavu_version=`grep '#define LIBAVUTIL_VERSION ' "$source_path/libavutil/avutil.h" | sed 's/[^0-9\.]//g'` lavu_version=`grep '#define LIBAVUTIL_VERSION ' "$source_path/libavutil/avutil.h" | sed 's/[^0-9\.]//g'`
requires=
test "$dc1394" = "yes" && extralibs="$extralibs -ldc1394_control" && requires="$requires libraw1394"
test "$libgsm" = "yes" && extralibs="$extralibs -lgsm"
test "$libogg" = "yes" && requires="$requires ogg >= 1.1"
test "$vorbis" = "yes" && requires="$requires vorbis"
test "$mp3lame" = "yes" && extralibs="$extralibs -lmp3lame"
test "$theora" = "yes" && requires="$requires theora"
test "$faad" = "yes" && test "$faadbin" = "no" && extralibs="$extralibs -lfaad"
test "$faac" = "yes" && extralibs="$extralibs -lfaac"
test "$xvid" = "yes" && extralibs="$extralibs -lxvidcore"
# libavutil.pc # libavutil.pc
cat <<EOF >libavutil.pc cat <<EOF >libavutil.pc
prefix=$prefix prefix=$prefix
...@@ -1824,7 +1830,7 @@ includedir=\${prefix}/include ...@@ -1824,7 +1830,7 @@ includedir=\${prefix}/include
Name: libavcodec Name: libavcodec
Description: FFmpeg codec library Description: FFmpeg codec library
Version: $lavc_version Version: $lavc_version
Requires: $requires libavutil = $lavu_version Requires: $pkg_requires libavutil = $lavu_version
Conflicts: Conflicts:
Libs: -L\${libdir} -lavcodec $extralibs Libs: -L\${libdir} -lavcodec $extralibs
Cflags: -I\${includedir} -I\${includedir}/ffmpeg Cflags: -I\${includedir} -I\${includedir}/ffmpeg
...@@ -1839,7 +1845,7 @@ includedir=\${pcfiledir}/libavcodec ...@@ -1839,7 +1845,7 @@ includedir=\${pcfiledir}/libavcodec
Name: libavcodec Name: libavcodec
Description: FFmpeg codec library Description: FFmpeg codec library
Version: $lavc_version Version: $lavc_version
Requires: $requires libavutil = $lavu_version Requires: $pkg_requires libavutil = $lavu_version
Conflicts: Conflicts:
Libs: \${libdir}/${LIBPREF}avcodec${LIBSUF} $extralibs Libs: \${libdir}/${LIBPREF}avcodec${LIBSUF} $extralibs
Cflags: -I\${includedir} Cflags: -I\${includedir}
...@@ -1855,7 +1861,7 @@ includedir=\${prefix}/include ...@@ -1855,7 +1861,7 @@ includedir=\${prefix}/include
Name: libavformat Name: libavformat
Description: FFmpeg container format library Description: FFmpeg container format library
Version: $lavf_version Version: $lavf_version
Requires: $requires libavcodec = $lavc_version Requires: $pkg_requires libavcodec = $lavc_version
Conflicts: Conflicts:
Libs: -L\${libdir} -lavformat $extralibs Libs: -L\${libdir} -lavformat $extralibs
Cflags: -I\${includedir} -I\${includedir}/ffmpeg Cflags: -I\${includedir} -I\${includedir}/ffmpeg
...@@ -1870,7 +1876,7 @@ includedir=\${pcfiledir}/libavformat ...@@ -1870,7 +1876,7 @@ includedir=\${pcfiledir}/libavformat
Name: libavformat Name: libavformat
Description: FFmpeg container format library Description: FFmpeg container format library
Version: $lavf_version Version: $lavf_version
Requires: $requires libavcodec = $lavc_version Requires: $pkg_requires libavcodec = $lavc_version
Conflicts: Conflicts:
Libs: \${libdir}/${LIBPREF}avformat${LIBSUF} $extralibs Libs: \${libdir}/${LIBPREF}avformat${LIBSUF} $extralibs
Cflags: -I\${includedir} Cflags: -I\${includedir}
......
...@@ -240,32 +240,22 @@ EXTRALIBS += -L../libavutil -lavutil$(BUILDSUF) ...@@ -240,32 +240,22 @@ EXTRALIBS += -L../libavutil -lavutil$(BUILDSUF)
# currently using libdts for dts decoding # currently using libdts for dts decoding
ifeq ($(CONFIG_DTS),yes) ifeq ($(CONFIG_DTS),yes)
OBJS+= dtsdec.o OBJS+= dtsdec.o
CFLAGS += $(DTS_INC)
EXTRALIBS += -ldts
endif endif
ifeq ($(CONFIG_FAAD),yes) ifeq ($(CONFIG_FAAD),yes)
OBJS+= faad.o OBJS+= faad.o
ifeq ($(CONFIG_FAADBIN),yes)
# no libs needed
else
EXTRALIBS += -lfaad
endif
endif endif
ifeq ($(CONFIG_FAAC),yes) ifeq ($(CONFIG_FAAC),yes)
OBJS+= faac.o OBJS+= faac.o
EXTRALIBS += -lfaac
endif endif
ifeq ($(CONFIG_XVID),yes) ifeq ($(CONFIG_XVID),yes)
OBJS+= xvidff.o OBJS+= xvidff.o
EXTRALIBS += -lxvidcore
endif endif
ifeq ($(CONFIG_X264),yes) ifeq ($(CONFIG_X264),yes)
OBJS+= x264.o OBJS+= x264.o
EXTRALIBS += -lx264
endif endif
ifeq ($(CONFIG_PP),yes) ifeq ($(CONFIG_PP),yes)
...@@ -279,24 +269,19 @@ endif ...@@ -279,24 +269,19 @@ endif
ifeq ($(CONFIG_MP3LAME),yes) ifeq ($(CONFIG_MP3LAME),yes)
OBJS += mp3lameaudio.o OBJS += mp3lameaudio.o
EXTRALIBS += -lmp3lame
endif endif
ifeq ($(CONFIG_LIBOGG),yes) ifeq ($(CONFIG_LIBOGG),yes)
ifeq ($(CONFIG_LIBVORBIS),yes) ifeq ($(CONFIG_LIBVORBIS),yes)
OBJS += oggvorbis.o OBJS += oggvorbis.o
EXTRALIBS += -lvorbisenc -lvorbis
endif endif
ifeq ($(CONFIG_LIBTHEORA), yes) ifeq ($(CONFIG_LIBTHEORA), yes)
OBJS += oggtheora.o OBJS += oggtheora.o
EXTRALIBS += -ltheora
endif endif
EXTRALIBS += -logg
endif endif
ifeq ($(CONFIG_LIBGSM),yes) ifeq ($(CONFIG_LIBGSM),yes)
OBJS += libgsm.o OBJS += libgsm.o
EXTRALIBS += -lgsm
endif endif
ifeq ($(TARGET_GPROF),yes) ifeq ($(TARGET_GPROF),yes)
......
...@@ -60,7 +60,6 @@ EXTRALIBS += -L../libavutil -lavutil$(BUILDSUF) ...@@ -60,7 +60,6 @@ EXTRALIBS += -L../libavutil -lavutil$(BUILDSUF)
ifeq ($(CONFIG_AUDIO_BEOS),yes) ifeq ($(CONFIG_AUDIO_BEOS),yes)
PPOBJS+= beosaudio.o PPOBJS+= beosaudio.o
EXTRALIBS+=-lbe -lmedia
endif endif
ifeq ($(CONFIG_NETWORK),yes) ifeq ($(CONFIG_NETWORK),yes)
...@@ -86,9 +85,6 @@ AVCLIBS+=-lavcodec$(BUILDSUF) -L../libavcodec -lavutil$(BUILDSUF) -L../libavutil ...@@ -86,9 +85,6 @@ AVCLIBS+=-lavcodec$(BUILDSUF) -L../libavcodec -lavutil$(BUILDSUF) -L../libavutil
ifeq ($(CONFIG_DARWIN),yes) ifeq ($(CONFIG_DARWIN),yes)
SHFLAGS += -Wl,-install_name,$(libdir)/$(SLIBNAME),-current_version,$(SPPVERSION),-compatibility_version,$(SPPVERSION) SHFLAGS += -Wl,-install_name,$(libdir)/$(SLIBNAME),-current_version,$(SPPVERSION),-compatibility_version,$(SPPVERSION)
endif endif
ifeq ($(CONFIG_MP3LAME),yes)
AVCLIBS+=-lmp3lame
endif
endif endif
SRCS := $(OBJS:.o=.c) $(PPOBJS:.o=.cpp) SRCS := $(OBJS:.o=.c) $(PPOBJS:.o=.cpp)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment