From a11ea5941878e559b6f15b4cb220504a32a06b4e Mon Sep 17 00:00:00 2001 From: Frank Zago Date: Sat, 20 Jun 2009 01:40:52 +0000 Subject: [PATCH] Video player compilation. --- AI/EmptyAI/Makefile.in | 1 + AI/GeniusAI/Makefile.in | 1 + AI/Makefile.in | 1 + Makefile.in | 1 + client/CGameInfo.h | 3 + client/CMT.cpp | 5 ++ client/Makefile.am | 3 +- client/Makefile.in | 20 ++++- configure | 191 +++++++++++++++++++++++++++++++++++----- configure.ac | 6 ++ lib/Makefile.in | 1 + server/Makefile.in | 1 + 12 files changed, 212 insertions(+), 22 deletions(-) diff --git a/AI/EmptyAI/Makefile.in b/AI/EmptyAI/Makefile.in index 8159948b0..df81d8ec6 100644 --- a/AI/EmptyAI/Makefile.in +++ b/AI/EmptyAI/Makefile.in @@ -123,6 +123,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +FFMPEG_LIBS = @FFMPEG_LIBS@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SDL_CONFIG = @HAVE_SDL_CONFIG@ diff --git a/AI/GeniusAI/Makefile.in b/AI/GeniusAI/Makefile.in index 370d955f5..280fd8584 100644 --- a/AI/GeniusAI/Makefile.in +++ b/AI/GeniusAI/Makefile.in @@ -124,6 +124,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +FFMPEG_LIBS = @FFMPEG_LIBS@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SDL_CONFIG = @HAVE_SDL_CONFIG@ diff --git a/AI/Makefile.in b/AI/Makefile.in index a32e1f552..019146f81 100644 --- a/AI/Makefile.in +++ b/AI/Makefile.in @@ -96,6 +96,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +FFMPEG_LIBS = @FFMPEG_LIBS@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SDL_CONFIG = @HAVE_SDL_CONFIG@ diff --git a/Makefile.in b/Makefile.in index d63a33507..f6fd93b19 100644 --- a/Makefile.in +++ b/Makefile.in @@ -111,6 +111,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +FFMPEG_LIBS = @FFMPEG_LIBS@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SDL_CONFIG = @HAVE_SDL_CONFIG@ diff --git a/client/CGameInfo.h b/client/CGameInfo.h index 93b59f74e..cba58f6b1 100644 --- a/client/CGameInfo.h +++ b/client/CGameInfo.h @@ -40,6 +40,8 @@ class CMapHandler; class CGameInterface; class CPreGame; class CDefHandler; +class CVideoPlayer; + /* CGameInfo class for allowing different functions for modifying game informations @@ -63,6 +65,7 @@ public: CConsoleHandler * consoleh; CCursorHandler * curh; CScreenHandler * screenh; + CVideoPlayer * videoh; CGameInfo(); void setFromLib(); diff --git a/client/CMT.cpp b/client/CMT.cpp index a2bde2146..c41a703e4 100644 --- a/client/CMT.cpp +++ b/client/CMT.cpp @@ -30,6 +30,7 @@ #include "../hch/CCreatureHandler.h" #include "../hch/CSpellHandler.h" #include "../hch/CMusicHandler.h" +#include "../hch/CVideoHandler.h" #include "../hch/CLodHandler.h" #include "../hch/CDefHandler.h" #include "../hch/CAmbarCendamo.h" @@ -131,6 +132,10 @@ int main(int argc, char** argv) cgi->musich->setVolume(88); tlog0<<"\tInitializing sound: "<videoh = new CVideoPlayer; + tlog0<<"\tInitializing video: "<setFromLib(); diff --git a/client/Makefile.am b/client/Makefile.am index cf8643168..ea55724e1 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -1,6 +1,6 @@ bin_PROGRAMS = vcmiclient -vcmiclient_LDADD = $(top_builddir)/lib/libvcmi.la @SDL_LIBS@ @BOOST_SYSTEM_LIB@ @BOOST_FILESYSTEM_LIB@ @BOOST_THREAD_LIB@ @BOOST_IOSTREAMS_LIB@ +vcmiclient_LDADD = $(top_builddir)/lib/libvcmi.la @SDL_LIBS@ @BOOST_SYSTEM_LIB@ @BOOST_FILESYSTEM_LIB@ @BOOST_THREAD_LIB@ @BOOST_IOSTREAMS_LIB@ @FFMPEG_LIBS@ vcmiclient_CXXFLAGS = @CXXFLAGS@ @SDL_CXXFLAGS@ vcmiclient_LDFLAGS = -L$(top_builddir)/lib vcmiclient_SOURCES = \ @@ -23,6 +23,7 @@ vcmiclient_SOURCES = \ ../hch/CObjectHandler.h \ ../hch/CSndHandler.cpp \ ../hch/CSndHandler.h \ + ../hch/CVideoHandler.cpp \ ../hch/CVideoHandler.h \ ../int3.h \ ../mapHandler.cpp \ diff --git a/client/Makefile.in b/client/Makefile.in index e646f3be9..44ea95472 100644 --- a/client/Makefile.in +++ b/client/Makefile.in @@ -60,6 +60,7 @@ am_vcmiclient_OBJECTS = vcmiclient-CCallback.$(OBJEXT) \ vcmiclient-CDefHandler.$(OBJEXT) \ vcmiclient-CMusicHandler.$(OBJEXT) \ vcmiclient-CSndHandler.$(OBJEXT) \ + vcmiclient-CVideoHandler.$(OBJEXT) \ vcmiclient-mapHandler.$(OBJEXT) \ vcmiclient-AdventureMapButton.$(OBJEXT) \ vcmiclient-CAdvmapInterface.$(OBJEXT) \ @@ -143,6 +144,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +FFMPEG_LIBS = @FFMPEG_LIBS@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SDL_CONFIG = @HAVE_SDL_CONFIG@ @@ -235,7 +237,7 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -vcmiclient_LDADD = $(top_builddir)/lib/libvcmi.la @SDL_LIBS@ @BOOST_SYSTEM_LIB@ @BOOST_FILESYSTEM_LIB@ @BOOST_THREAD_LIB@ @BOOST_IOSTREAMS_LIB@ +vcmiclient_LDADD = $(top_builddir)/lib/libvcmi.la @SDL_LIBS@ @BOOST_SYSTEM_LIB@ @BOOST_FILESYSTEM_LIB@ @BOOST_THREAD_LIB@ @BOOST_IOSTREAMS_LIB@ @FFMPEG_LIBS@ vcmiclient_CXXFLAGS = @CXXFLAGS@ @SDL_CXXFLAGS@ vcmiclient_LDFLAGS = -L$(top_builddir)/lib vcmiclient_SOURCES = \ @@ -258,6 +260,7 @@ vcmiclient_SOURCES = \ ../hch/CObjectHandler.h \ ../hch/CSndHandler.cpp \ ../hch/CSndHandler.h \ + ../hch/CVideoHandler.cpp \ ../hch/CVideoHandler.h \ ../int3.h \ ../mapHandler.cpp \ @@ -402,6 +405,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vcmiclient-CSndHandler.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vcmiclient-CSpellWindow.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vcmiclient-CThreadHelper.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vcmiclient-CVideoHandler.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vcmiclient-Client.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vcmiclient-GUIBase.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vcmiclient-GUIClasses.Po@am__quote@ @@ -516,6 +520,20 @@ vcmiclient-CSndHandler.obj: ../hch/CSndHandler.cpp @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(vcmiclient_CXXFLAGS) $(CXXFLAGS) -c -o vcmiclient-CSndHandler.obj `if test -f '../hch/CSndHandler.cpp'; then $(CYGPATH_W) '../hch/CSndHandler.cpp'; else $(CYGPATH_W) '$(srcdir)/../hch/CSndHandler.cpp'; fi` +vcmiclient-CVideoHandler.o: ../hch/CVideoHandler.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(vcmiclient_CXXFLAGS) $(CXXFLAGS) -MT vcmiclient-CVideoHandler.o -MD -MP -MF $(DEPDIR)/vcmiclient-CVideoHandler.Tpo -c -o vcmiclient-CVideoHandler.o `test -f '../hch/CVideoHandler.cpp' || echo '$(srcdir)/'`../hch/CVideoHandler.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/vcmiclient-CVideoHandler.Tpo $(DEPDIR)/vcmiclient-CVideoHandler.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='../hch/CVideoHandler.cpp' object='vcmiclient-CVideoHandler.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(vcmiclient_CXXFLAGS) $(CXXFLAGS) -c -o vcmiclient-CVideoHandler.o `test -f '../hch/CVideoHandler.cpp' || echo '$(srcdir)/'`../hch/CVideoHandler.cpp + +vcmiclient-CVideoHandler.obj: ../hch/CVideoHandler.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(vcmiclient_CXXFLAGS) $(CXXFLAGS) -MT vcmiclient-CVideoHandler.obj -MD -MP -MF $(DEPDIR)/vcmiclient-CVideoHandler.Tpo -c -o vcmiclient-CVideoHandler.obj `if test -f '../hch/CVideoHandler.cpp'; then $(CYGPATH_W) '../hch/CVideoHandler.cpp'; else $(CYGPATH_W) '$(srcdir)/../hch/CVideoHandler.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/vcmiclient-CVideoHandler.Tpo $(DEPDIR)/vcmiclient-CVideoHandler.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='../hch/CVideoHandler.cpp' object='vcmiclient-CVideoHandler.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(vcmiclient_CXXFLAGS) $(CXXFLAGS) -c -o vcmiclient-CVideoHandler.obj `if test -f '../hch/CVideoHandler.cpp'; then $(CYGPATH_W) '../hch/CVideoHandler.cpp'; else $(CYGPATH_W) '$(srcdir)/../hch/CVideoHandler.cpp'; fi` + vcmiclient-mapHandler.o: ../mapHandler.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(vcmiclient_CXXFLAGS) $(CXXFLAGS) -MT vcmiclient-mapHandler.o -MD -MP -MF $(DEPDIR)/vcmiclient-mapHandler.Tpo -c -o vcmiclient-mapHandler.o `test -f '../mapHandler.cpp' || echo '$(srcdir)/'`../mapHandler.cpp @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/vcmiclient-mapHandler.Tpo $(DEPDIR)/vcmiclient-mapHandler.Po diff --git a/configure b/configure index 6078713fc..c61ac5f37 100755 --- a/configure +++ b/configure @@ -785,6 +785,7 @@ ac_includes_default="\ ac_subst_vars='LTLIBOBJS LIBOBJS +FFMPEG_LIBS SDL_CXXFLAGS SDL_LIBS HAVE_SDL_CONFIG @@ -4913,13 +4914,13 @@ if test "${lt_cv_nm_interface+set}" = set; then else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:4916: $ac_compile\"" >&5) + (eval echo "\"\$as_me:4917: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:4919: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:4920: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:4922: output\"" >&5) + (eval echo "\"\$as_me:4923: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -6125,7 +6126,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 6128 "configure"' > conftest.$ac_ext + echo '#line 6129 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -8641,11 +8642,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8644: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8645: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8648: \$? = $ac_status" >&5 + echo "$as_me:8649: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -8980,11 +8981,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8983: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8984: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8987: \$? = $ac_status" >&5 + echo "$as_me:8988: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -9085,11 +9086,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9088: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9089: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:9092: \$? = $ac_status" >&5 + echo "$as_me:9093: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -9140,11 +9141,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9143: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9144: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:9147: \$? = $ac_status" >&5 + echo "$as_me:9148: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -11953,7 +11954,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11956 "configure" +#line 11957 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12049,7 +12050,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12052 "configure" +#line 12053 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -14069,11 +14070,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14072: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14073: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14076: \$? = $ac_status" >&5 + echo "$as_me:14077: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -14168,11 +14169,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14171: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14172: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14175: \$? = $ac_status" >&5 + echo "$as_me:14176: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -14220,11 +14221,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14223: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14224: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14227: \$? = $ac_status" >&5 + echo "$as_me:14228: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -17359,6 +17360,155 @@ SDL_CXXFLAGS=`sdl-config --cflags` SDL_LIBS="`sdl-config --libs` $LIBS" LIBS=$saved_LIBS +# Check for ffmpeg libraries + +{ $as_echo "$as_me:$LINENO: checking for main in -lavformat" >&5 +$as_echo_n "checking for main in -lavformat... " >&6; } +if test "${ac_cv_lib_avformat_main+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lavformat $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_avformat_main=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_avformat_main=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_avformat_main" >&5 +$as_echo "$ac_cv_lib_avformat_main" >&6; } +if test "x$ac_cv_lib_avformat_main" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBAVFORMAT 1 +_ACEOF + + LIBS="-lavformat $LIBS" + +else + { { $as_echo "$as_me:$LINENO: error: FFMpeg avformat library not found. Please install it." >&5 +$as_echo "$as_me: error: FFMpeg avformat library not found. Please install it." >&2;} + { (exit 1); exit 1; }; } +fi + + +{ $as_echo "$as_me:$LINENO: checking for main in -lswscale" >&5 +$as_echo_n "checking for main in -lswscale... " >&6; } +if test "${ac_cv_lib_swscale_main+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lswscale $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_swscale_main=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_swscale_main=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_swscale_main" >&5 +$as_echo "$ac_cv_lib_swscale_main" >&6; } +if test "x$ac_cv_lib_swscale_main" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBSWSCALE 1 +_ACEOF + + LIBS="-lswscale $LIBS" + +else + { { $as_echo "$as_me:$LINENO: error: FFMpeg swscale library not found. Please install it." >&5 +$as_echo "$as_me: error: FFMpeg swscale library not found. Please install it." >&2;} + { (exit 1); exit 1; }; } +fi + +FFMPEG_LIBS="-lavformat -lswscale" + # Checks for header files. { $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 @@ -17956,6 +18106,7 @@ done + ac_config_files="$ac_config_files Makefile lib/Makefile client/Makefile server/Makefile AI/Makefile AI/GeniusAI/Makefile AI/EmptyAI/Makefile" cat >confcache <<\_ACEOF diff --git a/configure.ac b/configure.ac index 16840b907..626a53bde 100644 --- a/configure.ac +++ b/configure.ac @@ -48,6 +48,11 @@ SDL_CXXFLAGS=`sdl-config --cflags` SDL_LIBS="`sdl-config --libs` $LIBS" LIBS=$saved_LIBS +# Check for ffmpeg libraries +AC_CHECK_LIB(avformat,main,,AC_MSG_ERROR([FFMpeg avformat library not found. Please install it.])) +AC_CHECK_LIB(swscale,main,,AC_MSG_ERROR([FFMpeg swscale library not found. Please install it.])) +FFMPEG_LIBS="-lavformat -lswscale" + # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([fcntl.h stdlib.h string.h]) @@ -59,5 +64,6 @@ AC_CHECK_FUNCS([atexit memset pow select sqrt]) AC_SUBST(SDL_LIBS) AC_SUBST(SDL_CXXFLAGS) +AC_SUBST(FFMPEG_LIBS) AC_OUTPUT(Makefile lib/Makefile client/Makefile server/Makefile AI/Makefile AI/GeniusAI/Makefile AI/EmptyAI/Makefile) diff --git a/lib/Makefile.in b/lib/Makefile.in index 95a704450..f53094059 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -125,6 +125,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +FFMPEG_LIBS = @FFMPEG_LIBS@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SDL_CONFIG = @HAVE_SDL_CONFIG@ diff --git a/server/Makefile.in b/server/Makefile.in index 3d1254e29..81d36ba46 100644 --- a/server/Makefile.in +++ b/server/Makefile.in @@ -119,6 +119,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +FFMPEG_LIBS = @FFMPEG_LIBS@ FGREP = @FGREP@ GREP = @GREP@ HAVE_SDL_CONFIG = @HAVE_SDL_CONFIG@