diff -up gpac/configure.ffmpeg gpac/configure --- gpac/configure.ffmpeg 2009-09-01 16:50:50.270496559 +0200 +++ gpac/configure 2009-09-01 17:59:05.902493824 +0200 @@ -808,25 +808,19 @@ cat > $TMPC << EOF int main( void ) { return 0; } EOF -if $cc $TMPO -c $TMPC 2> /dev/null ; then -old_ffmpeg_inc="no" +if pkg-config --exists libavcodec libavformat libswscale 2> /dev/null ; then + ffmpeg_cflags=`pkg-config --cflags libavcodec libavformat libswscale` + ffmpeg_lflags=`pkg-config --libs libavcodec libavformat libswscale` + has_ffmpeg="system" else - -old_ffmpeg_inc="yes" - -cat > $TMPC << EOF -#include -int main( void ) { return 0; } -EOF - -fi - + ffmpeg_cflags= + ffmpeg_lflags=`-lavcodec -lavformat` if test "$cross_prefix" != "" ; then - if $cc -o $TMPO $TMPC -I$prefix/include -L$prefix/lib -lz -lavcodec -lavformat -lavutil 2> /dev/null ; then + if $cc -o $TMPO $TMPC -I$prefix/include -L$prefix/lib -lz $ffmpeg_lflags -lavutil 2> /dev/null ; then has_ffmpeg="system" else - if $cc -o $TMPO $TMPC -I$local_inc -L$local_lib -lz -lavcodec -lavformat 2> /dev/null ; then + if $cc -o $TMPO $TMPC -I$local_inc -L$local_lib -lz $ffmpeg_lflags 2> /dev/null ; then has_ffmpeg="local" fi fi @@ -841,6 +835,7 @@ else has_ffmpeg="local" fi fi +fi #look for vorbis support cat > $TMPC << EOF @@ -1912,6 +1907,10 @@ echo "CONFIG_VORBIS=$has_vorbis" >> conf echo "CONFIG_THEORA=$has_theora" >> config.mak echo "CONFIG_FFMPEG=$has_ffmpeg" >> config.mak echo "CONFIG_FFMPEG_OLD=$old_ffmpeg_inc" >> config.mak +if test x$has_ffmpeg != x ; then + echo "FFMPEG_CFLAGS=$ffmpeg_cflags" >> config.mak + echo "FFMPEG_LFLAGS=$ffmpeg_lflags" >> config.mak +fi echo "CONFIG_OSS_AUDIO=$has_oss_audio" >> config.mak echo "CONFIG_ALSA=$has_alsa" >> config.mak diff -up gpac/modules/ffmpeg_in/Makefile.ffmpeg gpac/modules/ffmpeg_in/Makefile --- gpac/modules/ffmpeg_in/Makefile.ffmpeg 2009-07-31 09:37:41.000000000 +0200 +++ gpac/modules/ffmpeg_in/Makefile 2009-09-01 17:49:55.333497907 +0200 @@ -2,7 +2,7 @@ include ../../config.mak vpath %.c $(SRC_PATH)/modules/ffmpeg_in -CFLAGS= $(OPTFLAGS) -I$(SRC_PATH)/include +CFLAGS= $(OPTFLAGS) -I$(SRC_PATH)/include $(FFMPEG_CFLAGS) ifeq ($(DEBUGBUILD), yes) CFLAGS+=-g @@ -15,13 +15,11 @@ LDFLAGS+=-pg endif LOCAL_LIB= -LINKLIBS=-lgpac -lavcodec -lavformat -lz +LINKLIBS=-lgpac $(FFMPEG_LFLAGS) -lz #old ffmpeg lib ifeq ($(CONFIG_FFMPEG_OLD), yes) CFLAGS+=-DFFMPEG_OLD_HEADERS -else -LINKLIBS+=-lswscale endif #common obj