[Sumover-dev] [svn commit] r4566 - vic/branches/mpeg4

sumover-dev at cs.ucl.ac.uk sumover-dev at cs.ucl.ac.uk
Fri Jan 22 15:17:19 GMT 2010


Author: piers
Date: Fri Jan 22 15:47:10 2010
New Revision: 4566

Modified:
   vic/branches/mpeg4/Makefile.in
   vic/branches/mpeg4/configure
   vic/branches/mpeg4/configure.in
   vic/branches/mpeg4/configure.in.tail

Log:
Updates for configure - mostly for Snow Leopard build, but also some general reshuffling and tidy up.


Modified: vic/branches/mpeg4/Makefile.in
==============================================================================
--- vic/branches/mpeg4/Makefile.in	(original)
+++ vic/branches/mpeg4/Makefile.in	Fri Jan 22 15:47:10 2010
@@ -50,7 +50,7 @@
 CXX = @CXX@
 CCOPT = @V_CCOPT@
 
-LDFLAGS= @LDFLAGS@
+LDFLAGS= @V_LDFLAGS@
 
 INSTALL = @INSTALL@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -207,17 +207,17 @@
 #	rm -f $@
 #	$(CXX) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(OBJ_GRABBER) $(LIB) $(STATIC)
 
-vic: $(CODEC_LIB) $(VIDEO_LIB) $(OBJ) $(OBJ_GRABBER) $(JV_LIB) $(OBJ_CRYPT)  $(OBJ_XIL)
+vic: $(VIDEO_LIB) $(OBJ) $(OBJ_GRABBER) $(JV_LIB) $(OBJ_CRYPT)  $(OBJ_XIL)
 	rm -f $@
 	$(CXX) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(OBJ_GRABBER) $(OBJ_CRYPT) $(LIB) $(STATIC)
 
-vic.dyn: $(CODEC_LIB) $(VIDEO_LIB) $(OBJ) $(OBJ_GRABBER) $(JV_LIB)
+vic.dyn: $(VIDEO_LIB) $(OBJ) $(OBJ_GRABBER) $(JV_LIB)
 	rm -f $@
 	$(CXX) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(OBJ_GRABBER) $(LIB)
 
 # XIL support 
 #
-vic.xil: $(CODEC_LIB) $(VIDEO_LIB) $(OBJ) $(OBJ_GRABBER) $(JV_LIB) $(OBJ_CRYPT)  $(OBJ_XIL)
+vic.xil: $(VIDEO_LIB) $(OBJ) $(OBJ_GRABBER) $(JV_LIB) $(OBJ_CRYPT)  $(OBJ_XIL)
 	rm -f $@
 	$(CXX) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(OBJ_XIL) $(OBJ_GRABBER) $(OBJ_CRYPT) $(LIB) $(STATIC) @V_LIB_XIL@
 
@@ -430,25 +430,25 @@
 ffmpeg/libswscale/libswscale.a: ffmpeg/lib/libswscale.a
 ffmpeg/libpostproc/libpostproc.a: ffmpeg/lib/libpostproc.a
 
-ffmpeg/lib/libavcodec.a:
-	(cd ffmpeg/libavcodec; make; make install )
+codec/ffmpeg_codec.o: ffmpeg/lib/libavcodec.a ffmpeg/lib/libavutil.a ffmpeg/lib/libswscale.a ffmpeg/lib/libpostproc.a
 
-ffmpeg/lib/libavutil.a:
-	(cd ffmpeg/libavutil; make; make install )
+ffmpeg/lib/libavcodec.a ffmpeg/lib/libavutil.a ffmpeg/lib/libswscale.a ffmpeg/lib/libpostproc.a:
+	(cd ffmpeg; @V_CCLDFLAGS32@ $(MAKE); @V_CCLDFLAGS32@ $(MAKE) install )
 
-ffmpeg/lib/libswscale.a:
-	(cd ffmpeg/libswscale; make; make install )
-
-ffmpeg/lib/libpostproc.a:
-	(cd ffmpeg/libpostproc; make; make install )
+codec/x264encoder.o: x264/lib/libx264.a
 
 x264/lib/libx264.a:
-	(cd x264; make; make install )
+	(cd x264; @V_CCLDFLAGS32@ $(MAKE); @V_CCLDFLAGS32@ $(MAKE) install )
+
+codec/encoder-h263v2.o: codec/tmn-x/libh263coder.a
 
 codec/tmn-x/libh263coder.a:
 	(cd codec/tmn-x; $(MAKE) CC="$(CC)" CCOPT="$(CCOPT)" )
 
+codec/decoder-h263v2.o: codec/tmndec/libh263.a
+
 codec/tmndec/libh263.a:
 	(cd codec/tmndec; $(MAKE) CC="$(CC)" CCOPT="$(CCOPT)" -f Makefile.lib)
+
 strip:	vic
 	strip vic

Modified: vic/branches/mpeg4/configure
==============================================================================
--- vic/branches/mpeg4/configure	(original)
+++ vic/branches/mpeg4/configure	Fri Jan 22 15:47:10 2010
@@ -603,6 +603,8 @@
 V_DEFINE
 V_TAR_EXTRA
 V_CCOPT_H261
+V_CCLDFLAGS32
+V_LDFLAGS
 V_CCOPT
 V_ALL
 V_TAR_TARGET
@@ -723,6 +725,11 @@
 with_tk
 with_aix_shm
 with_qcam
+enable_dvdecode
+enable_xvideo
+with_decklink
+enable_XvGrabber
+enable_Linux1394Grabber
 enable_gpl
 with_ffmpegver
 enable_ffmpeg_co
@@ -733,11 +740,6 @@
 with_x264inc
 with_x264lib
 enable_cpudetect
-enable_dvdecode
-enable_xvideo
-with_decklink
-enable_XvGrabber
-enable_Linux1394Grabber
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1368,14 +1370,14 @@
 --enable-ipv6		build with ipv6 enabled
 --disable-aquatcl	build with aquatcl enabled
 --disable-aquatk	build with aquatk enabled
---enable-gpl	Enable or disable  use of gpl functionality - H264 MPEG4 Swscale
---disable-ffmpeg-co	Enable or disable ffmpeg download
---disable-x264-co      Enable or disable x264 download
---disable-cpudetect     Enable or disable runtime cpu detection
 --enable-dvdecode       Enable or disable dv decoding (default: disabled)
 --enable-xvideo		Enable or disable Xvideo rendering (default: disabled)
 --enable-XvGrabber    Enable or disable old XvGrabber (default: disabled)
 --enable-Linux1394Grabber    Enable or disable Linux1394XvGrabber (default: disabled)
+--enable-gpl	Enable or disable  use of gpl functionality - H264 MPEG4 Swscale
+--disable-ffmpeg-co	Enable or disable ffmpeg download
+--disable-x264-co      Enable or disable x264 download
+--disable-cpudetect     Enable or disable runtime cpu detection
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -1386,13 +1388,13 @@
   --with-tk               directory containing tk configuration (tkConfig.sh)
 --with-aix-shm=path	specify a pathname for the AIX shm X extension library file
 --with-qcam=dir     specify directory with qcam.h for Connectix QuickCam device driver
+  --with-decklink=dir     directory containing DeckLinkAPIDispatch.cpp
 --with-ffmpegver=ffmpeg-version     specify the version of ffmpeg to download and build
 --with-x264ver=x264ver-version     specify the version of x264 to download and build
 --with-ffmpeginc=dir     specify the prefix directory of ffmpeg header
 --with-ffmpeglib=dir     specify the directory of ffmpeg library
 --with-x264inc=dir     specify the directory of x264 header
 --with-x264lib=dir     specify the directory of x264 library
-  --with-decklink=dir     directory containing DeckLinkAPIDispatch.cpp
 
 Some influential environment variables:
   CC          C compiler command
@@ -2297,9 +2299,7 @@
     case "$target" in (*darwin*) V_DEFINE="$V_DEFINE -DSYS_DARWIN";; esac
     ppc_conf="--disable-altivec"
     ppc_tune="-mcpu=G3"
-    echo test1
     if sysctl hw.vectorunit 2>/dev/null | grep "hw.vectorunit: 1" >/dev/null 2>&1; then
-    echo testa
     	ppc_conf=""
     	ppc_tune="-mcpu=G4 -mtune=G4"
     fi
@@ -4656,6 +4656,24 @@
 V_LIB_X264=""
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for buggy version of GCC-2.96" >&5
+$as_echo_n "checking for buggy version of GCC-2.96... " >&6; }
+if test $CC = gcc ; then
+     if $CC --version | grep 2.96 >&/dev/null; then
+           { $as_echo "$as_me:${as_lineno-$LINENO}: result: Yes - Turning off optimisation for dct code" >&5
+$as_echo "Yes - Turning off optimisation for dct code" >&6; }
+           V_CCOPT_H261="";
+     else
+           { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+     fi
+fi
+
+if test -f codec/encoder-bvc.cpp ; then
+	V_OBJ="$V_OBJ codec/encoder-bvc.o codec/decoder-bvc.o"
+fi
+
+
 # Check whether --with-aix-shm was given.
 if test "${with_aix_shm+set}" = set; then :
   withval=$with_aix_shm; lib=$withval
@@ -4686,1221 +4704,1221 @@
 	exit 1
 fi
 
-# Check whether --enable-gpl was given.
-if test "${enable_gpl+set}" = set; then :
-  enableval=$enable_gpl; gpl="yes"
-else
-  gpl="no"
-fi
 
-if test "$gpl" = "yes" ; then
-  V_DEFINE="$V_DEFINE -DHAVE_SWSCALE"
-  V_OBJ="$V_OBJ codec/packetbuffer.o codec/databuffer.o \
-    codec/ffmpeg_codec.o codec/encoder-mpeg4.o codec/decoder-mpeg4.o \
-    codec/x264encoder.o codec/encoder-h264.o codec/decoder-h264.o \
-    codec/rtp_h264_depayloader.o render/color-swscale.o video/deinterlace.o"
+V_DV=""
+# Check whether --enable-dvdecode was given.
+if test "${enable_dvdecode+set}" = set; then :
+  enableval=$enable_dvdecode; dvdecode=yes
 else
-  V_OBJ="$V_OBJ render/color-true.o  render/color-hi.o"
+  dvdecode=no
 fi
 
-# Extract the first word of "wget", so it can be a program name with args.
-set dummy wget; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_DOWNLOAD+set}" = set; then :
+if test "$dvdecode" = "yes"; then
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ldv" >&5
+$as_echo_n "checking for main in -ldv... " >&6; }
+if test "${ac_cv_lib_dv_main+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$DOWNLOAD"; then
-  ac_cv_prog_DOWNLOAD="$DOWNLOAD" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_DOWNLOAD="wget -O -"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-DOWNLOAD=$ac_cv_prog_DOWNLOAD
-if test -n "$DOWNLOAD"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOWNLOAD" >&5
-$as_echo "$DOWNLOAD" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldv  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
 
-# Extract the first word of "curl", so it can be a program name with args.
-set dummy curl; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_DOWNLOAD+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$DOWNLOAD"; then
-  ac_cv_prog_DOWNLOAD="$DOWNLOAD" # Let the user override the test.
+int
+main ()
+{
+return main ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dv_main=yes
 else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_DOWNLOAD="curl -s"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
+  ac_cv_lib_dv_main=no
 fi
-DOWNLOAD=$ac_cv_prog_DOWNLOAD
-if test -n "$DOWNLOAD"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOWNLOAD" >&5
-$as_echo "$DOWNLOAD" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dv_main" >&5
+$as_echo "$ac_cv_lib_dv_main" >&6; }
+if test "x$ac_cv_lib_dv_main" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBDV 1
+_ACEOF
 
+  LIBS="-ldv $LIBS"
 
+else
 
+      echo "Error! libdv not available. Please install libdv."
+      exit 1
 
-# Check whether --with-ffmpegver was given.
-if test "${with_ffmpegver+set}" = set; then :
-  withval=$with_ffmpegver; ffmpegver=$withval
-else
-  ffmpegver=ffmpeg-0.5
 fi
 
-# Check whether --enable-ffmpeg-co was given.
-if test "${enable_ffmpeg_co+set}" = set; then :
-  enableval=$enable_ffmpeg_co; ffmpegco="no"
+   for ac_header in libdv/dv.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "libdv/dv.h" "ac_cv_header_libdv_dv_h" "$ac_includes_default"
+if test "x$ac_cv_header_libdv_dv_h" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBDV_DV_H 1
+_ACEOF
+
 else
-  ffmpegco="yes"
-fi
 
-if test "$ffmpegco" = "yes" ; then
-  if test "$gpl" = "yes" ; then
-   if test ! -r ${ffmpegver} ; then
-     echo "Downloading ${ffmpegver} from www.ffmpeg.org ..."
-     ${DOWNLOAD} http://www.ffmpeg.org/releases/${ffmpegver}.tar.bz2 | tar xjf - && rm -r ffmpeg ; ln -s ${ffmpegver} ffmpeg
-   fi
-   echo "Configuring ffmpeg..."
-   cd ffmpeg; ./configure --prefix=$V_PATH/ffmpeg $ppc_conf --enable-gpl --enable-swscale --enable-postproc; cd ..
-   V_INCLUDE="$V_INCLUDE -Iffmpeg/include -Iffmpeg"
-   V_CODEC_LIB="$V_CODEC_LIB ffmpeg/lib/libavcodec.a ffmpeg/lib/libavutil.a ffmpeg/lib/libswscale.a ffmpeg/lib/libpostproc.a"
-  else
-    echo "ffmpeg not available without --enable-gpl"
-  fi
+      echo "Error! libdv/dv.h not found. Please install libdv developer package."
+      exit 1
+
 fi
 
+done
 
-# Check whether --with-x264ver was given.
-if test "${with_x264ver+set}" = set; then :
-  withval=$with_x264ver; x264ver=$withval
-else
-  x264ver=x264-snapshot-20070413-2245
+   V_OBJ="$V_OBJ codec/decoder-dv.o"
+   V_DV="-DUSE_DVDECODER"
+   V_LIB="$V_LIB -ldv"
 fi
 
-# Check whether --enable-x264-co was given.
-if test "${enable_x264_co+set}" = set; then :
-  enableval=$enable_x264_co; x264co="no"
+V_XV=""
+# Check whether --enable-xvideo was given.
+if test "${enable_xvideo+set}" = set; then :
+  enableval=$enable_xvideo; xvideo=yes
 else
-  x264co="yes"
+  xvideo=no
 fi
 
-if test "$x264co" = "yes" ; then
-  if test "$gpl" = "yes" ; then
-   if test ! -r ${x264ver} ; then
-     echo "Downloading ${x264ver} (r650) of x264 from videolan.org ..."
-     #svn checkout -r 650 svn://svn.videolan.org/x264/trunk x264
-     ${DOWNLOAD} http://downloads.videolan.org/pub/videolan/x264/snapshots/${x264ver}.tar.bz2 | tar xjf - && ln -sf ${x264ver} x264
-   fi
-   echo "Configuring x264..."
-   cd x264; ./configure --prefix=$V_PATH/x264; cd ..
-   V_INCLUDE="$V_INCLUDE -Ix264/include"
-   V_CODEC_LIB="$V_CODEC_LIB x264/lib/libx264.a"
-  else
-    echo "x264 not available without --enable-gpl"
-  fi
-fi
+if test "$xvideo" = "yes"; then
 
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XvQueryExtension in -lXv_pic" >&5
+$as_echo_n "checking for XvQueryExtension in -lXv_pic... " >&6; }
+if test "${ac_cv_lib_Xv_pic_XvQueryExtension+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lXv_pic -lXext $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-# Check whether --with-ffmpeginc was given.
-if test "${with_ffmpeginc+set}" = set; then :
-  withval=$with_ffmpeginc; ffmpeginc=$withval
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char XvQueryExtension ();
+int
+main ()
+{
+return XvQueryExtension ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_Xv_pic_XvQueryExtension=yes
 else
-  ffmpeginc=""
+  ac_cv_lib_Xv_pic_XvQueryExtension=no
 fi
-
-
-# Check whether --with-ffmpeglib was given.
-if test "${with_ffmpeglib+set}" = set; then :
-  withval=$with_ffmpeglib; ffmpeglib=$withval
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xv_pic_XvQueryExtension" >&5
+$as_echo "$ac_cv_lib_Xv_pic_XvQueryExtension" >&6; }
+if test "x$ac_cv_lib_Xv_pic_XvQueryExtension" = x""yes; then :
+  HAVE_XVIDEO="yes"
 else
-  ffmpeglib=""
+  HAVE_XVIDEO="no"
 fi
 
+   if test $HAVE_XVIDEO = "yes"; then
+	V_LIB="$V_LIB -lXv_pic"
+        V_XV="-DHAVE_XVIDEO"
+        V_OBJ="$V_OBJ render/xvideo.o"
+   else
 
-if test "$gpl" = "yes" ; then
-  if test "$ffmpegco" != "yes"; then
-
-	if test "$ffmpeginc" != "" ; then
-	   if test ! -r $ffmpeginc/ffmpeg/avcodec.h ; then
-	        echo "Error! you need to have $ffmpeginc/ffmpeg/avcodec.h around"
-	        exit 1
-	   elif test ! -r $ffmpeginc/ffmpeg/avutil.h ; then
-	        echo "Error! you need to have $ffmpeginc/ffmpeg/avutil.h around"
-	        exit 1
-	   elif test ! -r $ffmpeginc/ffmpeg/swscale.h ; then
-	        echo "Error! you need to have $ffmpeginc/ffmpeg/swscale.h around"
-	        exit 1
-	   fi
-	   echo "checking for FFmpeg headers...yes"
-	   V_INCLUDE="$V_INCLUDE -I$ffmpeginc"
-
-	else
-
-	   ac_fn_c_check_header_mongrel "$LINENO" "ffmpeg/avcodec.h" "ac_cv_header_ffmpeg_avcodec_h" "$ac_includes_default"
-if test "x$ac_cv_header_ffmpeg_avcodec_h" = x""yes; then :
-
-else
-
-        	echo "Error! you need to have avcodec.h around."
-	        exit -1
-
-fi
-
-
-	   ac_fn_c_check_header_mongrel "$LINENO" "ffmpeg/avutil.h" "ac_cv_header_ffmpeg_avutil_h" "$ac_includes_default"
-if test "x$ac_cv_header_ffmpeg_avutil_h" = x""yes; then :
-
-else
-
-	        echo "Error! you need to have avutil.h around."
-	        exit -1
-
-fi
-
-
-	   ac_fn_c_check_header_mongrel "$LINENO" "ffmpeg/swscale.h" "ac_cv_header_ffmpeg_swscale_h" "$ac_includes_default"
-if test "x$ac_cv_header_ffmpeg_swscale_h" = x""yes; then :
-
-else
-
-	        echo "Error! you need to have swscale.h around."
-	        exit -1
-
-fi
-
-
-	fi
-
-	if test "$ffmpeglib" != "" ; then
-	   if test ! -r $ffmpeglib/libavcodec.a ; then
-		echo "Error! you need to have $ffmpeglib/libavcodec.a around"
-	   elif test ! -r $ffmpeglib/libavutil.a ; then
-	        echo "Error! you need to have $ffmpeglib/libavutil.a around"
-	   elif test ! -r $ffmpeglib/libswscale.a ; then
-	        echo "Error! you need to have $ffmpeglib/libswscale.a around"
-           elif test ! -r $ffmpeglib/libpostproc.a ; then
-                echo "Error! you need to have $ffmpeglib/libpostproc.a around"
-           fi
-
-	   V_LIB_FFMPEG="-L$ffmpeglib -lavcodec -lavutil -lswscale -lpostproc"
-	else
-	   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lavcodec" >&5
-$as_echo_n "checking for main in -lavcodec... " >&6; }
-if test "${ac_cv_lib_avcodec_main+set}" = set; then :
+   	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XvQueryExtension in -lXv" >&5
+$as_echo_n "checking for XvQueryExtension in -lXv... " >&6; }
+if test "${ac_cv_lib_Xv_XvQueryExtension+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lavcodec  $LIBS"
+LIBS="-lXv -lXext $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char XvQueryExtension ();
 int
 main ()
 {
-return main ();
+return XvQueryExtension ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_avcodec_main=yes
+  ac_cv_lib_Xv_XvQueryExtension=yes
 else
-  ac_cv_lib_avcodec_main=no
+  ac_cv_lib_Xv_XvQueryExtension=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avcodec_main" >&5
-$as_echo "$ac_cv_lib_avcodec_main" >&6; }
-if test "x$ac_cv_lib_avcodec_main" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBAVCODEC 1
-_ACEOF
-
-  LIBS="-lavcodec $LIBS"
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xv_XvQueryExtension" >&5
+$as_echo "$ac_cv_lib_Xv_XvQueryExtension" >&6; }
+if test "x$ac_cv_lib_Xv_XvQueryExtension" = x""yes; then :
+  HAVE_XVIDEO="yes"
 else
-
-	        echo "Error! you need to have libavcodec around."
-	        exit -1
-
+  HAVE_XVIDEO="no"
 fi
 
-	   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lavutil" >&5
-$as_echo_n "checking for main in -lavutil... " >&6; }
-if test "${ac_cv_lib_avutil_main+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lavutil  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
+   	if test $HAVE_XVIDEO = "yes"; then
+       	    V_XV="-DHAVE_XVIDEO"
+       	    V_LIB="$V_LIB -lXv"
+            V_OBJ="$V_OBJ render/xvideo.o"
+   	fi
+   fi
 
-int
-main ()
-{
-return main ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_avutil_main=yes
-else
-  ac_cv_lib_avutil_main=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avutil_main" >&5
-$as_echo "$ac_cv_lib_avutil_main" >&6; }
-if test "x$ac_cv_lib_avutil_main" = x""yes; then :
+   if test $HAVE_XVIDEO = "yes"; then
+   	for ac_header in X11/extensions/Xvlib.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "X11/extensions/Xvlib.h" "ac_cv_header_X11_extensions_Xvlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_X11_extensions_Xvlib_h" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBAVUTIL 1
+#define HAVE_X11_EXTENSIONS_XVLIB_H 1
 _ACEOF
 
-  LIBS="-lavutil $LIBS"
-
 else
 
-	        echo "Error! you need to have libavutil around."
-	        exit -1
+      	echo "Error! \"X11/extensions/Xvlib.h\" not found. Please install \"libxv-dev\" package."
+      		exit 1
 
 fi
 
-	   { $as_echo "$as_me:${as_lineno-$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 confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
+done
 
-int
-main ()
-{
-return main ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_swscale_main=yes
-else
-  ac_cv_lib_swscale_main=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+   fi
 fi
-{ $as_echo "$as_me:${as_lineno-$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"
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for V4L support" >&5
+$as_echo "$as_me: checking for V4L support" >&6;}
+ac_fn_c_check_header_mongrel "$LINENO" "linux/videodev.h" "ac_cv_header_linux_videodev_h" "$ac_includes_default"
+if test "x$ac_cv_header_linux_videodev_h" = x""yes; then :
+   have_videodev_h=yes;
 else
-
-	        echo "Error! you need to have libswscale around."
-	        exit -1
-
+  ac_fn_c_check_header_mongrel "$LINENO" "/usr/local/include/linux/videodev.h" "ac_cv_header__usr_local_include_linux_videodev_h" "$ac_includes_default"
+if test "x$ac_cv_header__usr_local_include_linux_videodev_h" = x""yes; then :
+   have_videodev_h=yes;
 fi
 
 
-           { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpostproc" >&5
-$as_echo_n "checking for main in -lpostproc... " >&6; }
-if test "${ac_cv_lib_postproc_main+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpostproc  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+fi
 
 
-int
-main ()
-{
-return main ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_postproc_main=yes
-else
-  ac_cv_lib_postproc_main=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+if test x$have_videodev_h = xyes; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: suitable V4L support found... using linux/videodev.h" >&5
+$as_echo "$as_me: suitable V4L support found... using linux/videodev.h" >&6;}
+        V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-video4linux.o"
+        have_V4L=yes
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_postproc_main" >&5
-$as_echo "$ac_cv_lib_postproc_main" >&6; }
-if test "x$ac_cv_lib_postproc_main" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBPOSTPROC 1
-_ACEOF
-
-  LIBS="-lpostproc $LIBS"
 
-else
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for V4L2 support" >&5
+$as_echo "$as_me: checking for V4L2 support" >&6;}
+ac_fn_c_check_header_mongrel "$LINENO" "linux/videodev2.h" "ac_cv_header_linux_videodev2_h" "$ac_includes_default"
+if test "x$ac_cv_header_linux_videodev2_h" = x""yes; then :
+   have_linux_videodev2_h=yes;
+fi
 
-                echo "Error! you need to have libpostproc around."
-                exit -1
 
+ac_fn_c_check_header_mongrel "$LINENO" "sys/videodev2.h" "ac_cv_header_sys_videodev2_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_videodev2_h" = x""yes; then :
+   have_sys_videodev2_h=yes;
 fi
 
 
-	   V_LIB_FFMPEG="-lavcodec -lavutil -lswscale -lpostproc"
-	fi
-  fi
+ac_fn_c_check_header_mongrel "$LINENO" "sys/videoio.h" "ac_cv_header_sys_videoio_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_videoio_h" = x""yes; then :
+   have_sys_videoio_h=yes;
 fi
 
 
-# Check whether --with-x264inc was given.
-if test "${with_x264inc+set}" = set; then :
-  withval=$with_x264inc; x264inc=$withval
-else
-  x264inc=""
-fi
 
+if test x$have_linux_videodev2_h = xyes ; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: suitable V4L2 support found... using linux/videodev2.h" >&5
+$as_echo "$as_me: suitable V4L2 support found... using linux/videodev2.h" >&6;}
+        V_DEFINE="$V_DEFINE -DHAVE_LINUX_VIDEODEV2_H"
+        V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-v4l2.o"
+        have_V4L2=yes
+
+elif test x$have_sys_videodev2_h = xyes; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: suitable V4L2 support found... using sys/videodev2.h" >&5
+$as_echo "$as_me: suitable V4L2 support found... using sys/videodev2.h" >&6;}
+        V_DEFINE="$V_DEFINE -DHAVE_SYS_VIDEODEV2_H"
+        V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-v4l2.o"
+        have_V4L2=yes
+
+elif test x$have_sys_videodev2_h = xyes; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: suitable V4L2 support found... using sys/videoio.h" >&5
+$as_echo "$as_me: suitable V4L2 support found... using sys/videoio.h" >&6;}
+        V_DEFINE="$V_DEFINE -DHAVE_SYS_VIDEOIO_H"
+        V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-v4l2.o"
+        have_V4L2=yes
 
-# Check whether --with-x264lib was given.
-if test "${with_x264lib+set}" = set; then :
-  withval=$with_x264lib; x264lib=$withval
-else
-  x264lib=""
 fi
 
-if test "$gpl" = "yes" ; then
-  if test "$x264co" != "yes" ; then
-	if test "$x264inc" != "" ; then
-	   if test ! -r $x264inc/x264.h ; then
-	        echo "Error! you need to have $x264inc/x264.h around."
-	        exit 1
-	   fi
-	   V_INCLUDE="$V_INCLUDE -I$x264inc"
-	elif test ! -r /usr/local/include/x264.h -a ! -r /usr/include/x264.h ; then
-	        echo "Error! you need to have x264.h around."
-	        exit 1
-	else
-	   echo "checking for x264.h...yes"
-	fi
+if test x$have_V4L = xyes -o x$have_V4L2 = xyes; then
+        V_OBJ_GRABBER="$V_OBJ_GRABBER video/yuv_convert.o"
+fi
 
-	if test "$x264lib" != "" ; then
-	   if test ! -r $x264lib/libx264.a ; then
-	        echo "Error! you need to have $x264lib/libx264.a around"
-		exit 1
-	   fi
-	   V_LIB_X264="-L$x264lib -lx264"
-	else
-	   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lx264" >&5
-$as_echo_n "checking for main in -lx264... " >&6; }
-if test "${ac_cv_lib_x264_main+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lx264  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+ac_fn_c_check_header_mongrel "$LINENO" "libv4lconvert.h" "ac_cv_header_libv4lconvert_h" "$ac_includes_default"
+if test "x$ac_cv_header_libv4lconvert_h" = x""yes; then :
+   have_libv4lconvert_h=yes;
+fi
 
 
-int
-main ()
-{
-return main ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_x264_main=yes
+if test x$have_libv4lconvert_h = xyes; then
+        V_DEFINE="$V_DEFINE -DHAVE_LIBV4L"
+        if test x$have_V4L = xyes; then
+                V_LIB_GRABBER="$V_LIB_GRABBER -lv4l1"
+        fi
+        if test x$have_V4L2 = xyes; then
+                V_LIB_GRABBER="$V_LIB_GRABBER -lv4l2"
+        fi
 else
-  ac_cv_lib_x264_main=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+        V_OBJ_GRABBER="$V_OBJ_GRABBER  video/tinyjpeg.o video/jidctflt.o"
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_x264_main" >&5
-$as_echo "$ac_cv_lib_x264_main" >&6; }
-if test "x$ac_cv_lib_x264_main" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBX264 1
-_ACEOF
 
-  LIBS="-lx264 $LIBS"
 
+# Check whether --with-decklink was given.
+if test "${with_decklink+set}" = set; then :
+  withval=$with_decklink; with_decklinkapidispatch=${withval}
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Blackmagic DeckLink SDK" >&5
+$as_echo "$as_me: checking for Blackmagic DeckLink SDK" >&6;}
+if test "${ac_cv_c_decklinkapidispatch+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
 
-	        echo "Error! you need to have libx264 around."
-	        exit -1
+        # First check to see if --with-decklink was specified.
+        if test x"${with_decklinkapidispatch}" != x ; then
+                case ${with_decklinkapidispatch} in
+                */DeckLinkAPIDispatch.cpp )
+                        if test -f ${with_decklinkapidispatch}; then
+                                { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-decklink argument should refer to directory containing DeckLinkAPIDispatch.cpp, not to DeckLinkAPIDispatch.cpp itself" >&5
+$as_echo "$as_me: WARNING: --with-decklink argument should refer to directory containing DeckLinkAPIDispatch.cpp, not to DeckLinkAPIDispatch.cpp itself" >&2;}
+                                with_decklinkapidispatch=`echo ${with_decklinkapidispatch} | sed 's!/DeckLinkAPIDispatch\.cpp!!'`
+                        fi ;;
+                esac
+                if test -f "${with_decklinkapidispatch}/DeckLinkAPIDispatch.cpp" ; then
+                    ac_cv_c_decklinkapidispatch=`(cd ${with_decklinkapidispatch}; pwd)`
+                else
+                    as_fn_error "${with_decklinkapidispatch} directory doesn't contain DeckLinkAPIDispatch.cpp" "$LINENO" 5
+                fi
+        fi
 
-fi
+        # then check for a private Blackmagic DeckLink SDK installation
+        if test x"${ac_cv_c_decklinkapidispatch}" = x ; then
+		as_save_IFS=$IFS
+		IFS=`echo`
+                for i in \
+                        `ls -dr "Blackmagic DeckLink SDK "[0-9]* 2>/dev/null` \
+                        `ls -dr ../"Blackmagic DeckLink SDK "[0-9]* 2>/dev/null` \
+                        `ls -dr $HOME/"Blackmagic DeckLink SDK "[0-9]* 2>/dev/null` \
+                        `ls -dr $HOME/Downloads/"Blackmagic DeckLink SDK "[0-9]* 2>/dev/null` \
+                        `ls -dr /usr/local/"Blackmagic DeckLink SDK "[0-9]* 2>/dev/null` \
+                        `ls -dr /opt/local/"Blackmagic DeckLink SDK "[0-9]* 2>/dev/null` ; do
+                        case "$target" in
+                        *linux* )
+                                if test -f "$i/Linux/include/DeckLinkAPIDispatch.cpp" ; then
+                                        ac_cv_c_decklinkapidispatch=`(cd "$i/Linux/include"; pwd)`
+                                        break
+                                fi ;;
+                        *darwin* )
+                                if test -f "$i/Mac/include/DeckLinkAPIDispatch.cpp" ; then
+                                        ac_cv_c_decklinkapidispatch=`(cd "$i/Mac/include"; pwd)`
+                                        break
+                                fi ;;
+                        esac
+                done
+		IFS=$as_save_IFS
+        fi
 
-	   V_LIB_X264="-lx264"
-	fi
- fi
 fi
 
-V_CPUDETECT=""
-# Check whether --enable-cpudetect was given.
-if test "${enable_cpudetect+set}" = set; then :
-  enableval=$enable_cpudetect; cpudetect="no"
+if test x"${ac_cv_c_decklinkapidispatch}" = x ; then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no DeckLinkAPIDispatch.cpp file found" >&5
+$as_echo "$as_me: WARNING: no DeckLinkAPIDispatch.cpp file found" >&2;}
 else
-  cpudetect="yes"
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: found ${ac_cv_c_decklinkapidispatch}/DeckLinkAPIDispatch.cpp" >&5
+$as_echo "found ${ac_cv_c_decklinkapidispatch}/DeckLinkAPIDispatch.cpp" >&6; }
+	V_INCLUDE="$V_INCLUDE -I\"${ac_cv_c_decklinkapidispatch}\""
+	V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-decklink.o"
 fi
 
-if test "$gpl" = "yes" ; then
- if test "$cpudetect" = "yes"; then
-    echo "using CPU runtime detection..."
-    V_CPUDETECT="-DRUNTIME_CPUDETECT"
-    V_CPUDETECT_OBJ="cpu/cpudetect.o cpu/cpuid.o"
- fi
- else
-   echo "No runtime cputect without --enable-gpl"
+if test -r /usr/lib/libvl.so ; then
+	V_LIB_GRABBER="$V_LIB_GRABBER -lvl -ldmedia"
+	V_OBJ_GRABBER="video/grabber-vl.o video/output-vl.o $V_OBJ_GRABBER"
+	if test -r /usr/include/dmedia/cl_cosmo.h  ; then
+		V_LIB_GRABBER="$V_LIB_GRABBER -lcl"
+		V_OBJ_GRABBER="video/grabber-cosmo.o $V_OBJ_GRABBER"
+	fi
 fi
-
-V_DV=""
-# Check whether --enable-dvdecode was given.
-if test "${enable_dvdecode+set}" = set; then :
-  enableval=$enable_dvdecode; dvdecode=yes
-else
-  dvdecode=no
+if test -r /usr/lib/libsvideo.a ; then
+	V_LIB_GRABBER="$V_LIB_GRABBER -lsvideo"
+	V_OBJ_GRABBER="video/grabber-svideo.o $V_OBJ_GRABBER"
 fi
 
-if test "$dvdecode" = "yes"; then
-   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ldv" >&5
-$as_echo_n "checking for main in -ldv... " >&6; }
-if test "${ac_cv_lib_dv_main+set}" = set; then :
-  $as_echo_n "(cached) " >&6
+# Check whether --enable-XvGrabber was given.
+if test "${enable_XvGrabber+set}" = set; then :
+  enableval=$enable_XvGrabber; XvGrabber=yes
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldv  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
+  XvGrabber=no
+fi
 
-int
-main ()
-{
-return main ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_dv_main=yes
-else
-  ac_cv_lib_dv_main=no
+if test -r /usr/lib/libXv.a -a "$XvGrabber" = "yes" ; then
+	V_LIB_GRABBER="$V_LIB_GRABBER -lXv"
+	V_DEFINE="$V_DEFINE -DXV_PSEUDO8"
+	V_OBJ_GRABBER="video/grabber-xv.o $V_OBJ_GRABBER"
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+if test -r /usr/lpp/parallax/lib/libXvid.a ; then
+    V_LIB_GRABBER="$V_LIB_GRABBER -L/usr/lpp/parallax/lib -lXvid -lXv"
+    V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I/usr/lpp/parallax/include"
+    V_OBJ_GRABBER="video/grabber-plx.o video/assistor-plx.o $V_OBJ_GRABBER"
+fi
+if test -r /usr/lpp/UMS6000/lib/libUMSobj.a ; then
+	V_LIB_GRABBER="$V_LIB_GRABBER -L/usr/lpp/UMS6000/lib -lUMSobj"
+	V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I/usr/lpp/UMS6000/include"
+	V_DEFINE="$V_DEFINE -DSUNRISE"
+	V_OBJ_GRABBER="video/grabber-sunrise.o video/output-sunrise.o $V_OBJ_GRABBER"
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dv_main" >&5
-$as_echo "$ac_cv_lib_dv_main" >&6; }
-if test "x$ac_cv_lib_dv_main" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBDV 1
-_ACEOF
 
-  LIBS="-ldv $LIBS"
+if test -r /usr/include/machine/ioctl_meteor.h -o \
+    -r /usr/include/dev/ic/bt8xx.h ; then
+	V_OBJ_GRABBER="video/grabber-meteor.o $V_OBJ_GRABBER"
+fi
 
+# Check whether --enable-Linux1394Grabber was given.
+if test "${enable_Linux1394Grabber+set}" = set; then :
+  enableval=$enable_Linux1394Grabber; Linux1394Grabber=yes
 else
+  Linux1394Grabber=no
+fi
 
-      echo "Error! libdv not available. Please install libdv."
-      exit 1
-
+if test -r /usr/include/libdc1394/dc1394_control.h -a -r /usr/include/libraw1394/raw1394.h -a "$Linux1394Grabber" = "yes"; then
+      V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-linux1394.o"
+      V_LIB_GRABBER="$V_LIB_GRABBER -lraw1394 -ldc1394_control"
+fi
+
+#if test -r /usr/local/lib/libspigot.a -a ${PORTOBJFORMAT} != elf; then
+if test -r /usr/local/lib/libspigot.a ; then
+	V_OBJ_GRABBER="video/grabber-spigot.o $V_OBJ_GRABBER"
+	V_LIB_GRABBER="$V_LIB_GRABBER -lspigot"
+	V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I/usr/local/include"
+fi
+
+if test "$qcamdir" != "" ; then
+	V_OBJ_GRABBER="video/grabber-qcam.o $V_OBJ_GRABBER"
+	V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I$qcamdir"
+	V_DEFINE="$V_DEFINE -DQCAMDEV -DQCAMDOTH=qcam.h"
+elif test -r /usr/local/lib/libqcam.a ; then
+	V_OBJ_GRABBER="video/grabber-qcam.o $V_OBJ_GRABBER"
+	V_LIB_GRABBER="$V_LIB_GRABBER -lqcam"
+	V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I/usr/local/include"
+	V_DEFINE="$V_DEFINE -DQCAMLIB"
+elif test -r /dev/qcam0 ; then
+	V_OBJ_GRABBER="video/grabber-qcam.o $V_OBJ_GRABBER"
+	V_DEFINE="$V_DEFINE -DQCAMDEV"
+fi
+vpix_dir=/usr/src/local/vfc-1.0
+vpix_lib=$vpix_dir/vfc_lib
+if test -d /import/VideoPix ; then
+	vpix_dir=/import/VideoPix
+	vpic_lib=$vpix_dir/lib
+fi
+if test -d $vpix_dir ; then
+	V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I$vpix_dir/sys -I$vpix_lib"
+	V_LIB_GRABBER="$V_LIB_GRABBER $vpix_lib/libvfc.a"
+	V_DEFINE="$V_DEFINE -DVIDEOPIX"
+	V_OBJ_GRABBER="video/grabber-vpix.o $V_OBJ_GRABBER"
+fi
+places="/usr/src/local/vigrapix/lib \
+	/opt/VIGRAvigrapix/lib"
+for dir in $places; do
+	if test -d $dir ; then
+		V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I$dir"
+		V_LIB_GRABBER="$V_LIB_GRABBER $dir/libvigrapix.a"
+		V_OBJ_GRABBER="video/grabber-vigra.o $V_OBJ_GRABBER"
+		break
+	fi
+done
+
+d=/opt/MMACslv
+if test -d $d ; then
+	V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I$d/include"
+	V_LIB_GRABBER="$V_LIB_GRABBER $d/lib/libslv.a -lintl"
+	V_OBJ_GRABBER="video/grabber-slv.o $V_OBJ_GRABBER"
+fi
+
+d=/usr/include/mme
+if test -d $d ; then
+	V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I$d"
+	V_LIB_GRABBER="$V_LIB_GRABBER -lmme"
+	V_OBJ_GRABBER="video/grabber-mme.o $V_OBJ_GRABBER"
+fi
+
+places="/opt/parallax \
+	/usr/src/local/parallax \
+	/usr/local/parallax \
+	/usr/local/parallax/components/Xclients_sun4.ow3_1.18 \
+	/usr/src/local/parallax/components/Xclients_sun4.ow3_1.18"
+for dir in $places; do
+	if test -d $dir/include ; then
+		V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I$dir/include"
+		V_LIB_GRABBER="$V_LIB_GRABBER -L$dir/lib -lXext -lXvid"
+		V_OBJ_GRABBER="video/grabber-plx.o video/assistor-plx.o $V_OBJ_GRABBER"
+		break
+	fi
+done
+
+
+case "$target" in
+*-dec-*)
+	jv_dir=jv2
+	V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I$jv_dir"
+	V_LIB_GRABBER="$V_LIB_GRABBER $jv_dir/jvdriverint.o"
+	V_OBJ_GRABBER="video/assistor-jv.o video/grabber-jv.o $V_OBJ_GRABBER"
+	if test "$target_os" = ultrix4.3 ; then
+		#XXX rtip code currently broken
+		#V_DEFINE="$V_DEFINE -DRTIP"
+		#V_LIB="$V_LIB lib.ultrix/librcap.a"
+		#V_INCLUDE="$V_INCLUDE -Ircap-include"
+		#XXX
+		#V_OBJ_GRABBER="$V_OBJ_GRABBER net-rtip.o"
+		echo no rtip support
+	fi
+	;;
+sparc-sun-solaris*)
+	V_STATIC=""
+	have_xil=no
+	xil_dir=/usr/openwin
+	if test -d $xil_dir ; then
+		if test ! -d $xil_dir/include/xil ; then
+			echo "You don't have the XIL developer's kit!"
+			echo "Building without XIL support..."
+		else
+			echo "Using XIL developer's kit (Found in: $xil_dir/include/xil)"
+			have_xil=yes
+		fi
+	fi
+	SYSINC="-I"
+	if test $CC = gcc ; then
+		V_DEFINE="$V_DEFINE -mv8 -msupersparc"
+		SYSINC="-isystem "
+	elif  test -z "$enable_debug" ; then
+		V_CCOPT="-xO2";
+	fi
+	if test $ipv6 = yes; then
+		V_DEFINE="$V_DEFINE -D__svr4__ -DSolaris -DHAVE_IPV6 -DSOLARIS7_IPV6"
+	else
+		V_DEFINE="$V_DEFINE -D__svr4__ -DSolaris"
+	fi
+	OPSYS=solaris
+	if test -f video/grabber-rtvc.cpp || test -f video/grabber-rtvc.o ; then
+		V_OBJ_GRABBER="video/grabber-rtvc.o $V_OBJ_GRABBER"
+		if test "$have_xil" = yes ; then
+			V_ALL="$V_PROG $V_PROG.xil"
+			V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER $SYSINC$xil_dir/include -DSUNXIL_WARNING_DISABLE"
+			V_LIB_XIL="-L$xil_dir/lib -R\"$xil_dir/lib:/opt/SUNWo1kp/lib:/opt/MMACo1k/lib\" -lxil"
+			V_OBJ_XIL="video/grabber-xil.o codec/framer-h261hw.o codec/framer-cellb.o video/assistor-xil.o"
+		fi
+	elif test "$have_xil" = yes ; then
+		V_OBJ_XIL="video/grabber-xil.o codec/framer-h261hw.o codec/framer-cellb.o video/assistor-xil.o"
+		V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I$xil_dir/include"
+		V_LIB_GRABBER="$V_LIB_GRABBER -L$xil_dir/lib -R\"$xil_dir/lib:/opt/SUNWo1kp/lib:/opt/MMACo1k/lib\" -lxil "
+	fi
+	;;
+sparc-sun-sunos*)
+	V_DEFINE="$V_DEFINE -DNEED_SUNOS_PROTOS -DSunOS"
+	;;
+*-sgi-irix*)
+	V_DEFINE="$V_DEFINE -D_BSD_SIGNALS -DIRIX"
+	OPSYS=irix
+	if test "$target_os" = irix6.2 ; then
+		V_DEFINE="$V_DEFINE -DIRIX6_2 -DSIGARGS=__sigargs"
+	fi
+	V_TARCMD="tar cfL"
+	V_SHELL="SHELL = /bin/sh"
+	if test $CC != gcc ; then
+		V_DEFINE="$V_DEFINE -signed -g3"
+		CC="cc -Dinline="
+		if test "$target_os" = irix5.2 ; then
+			CC="$CC -xansi -D__STDC__"
+		fi
+		CXX="CC +p -float -woff 3262 -DSGI_COMPAT"
+	else
+		CXX=$CC
+	fi
+	V_STATIC=""
+	;;
+*-*-bsdi1*)
+	V_SHM=""
+	V_TARCMD="tar cfL"
+	;;
+*-*-bsdi2.0*)
+	V_SHM=""
+	V_TARCMD="tar cfL"
+	;;
+*-*-bsdi*)
+	# bsdi2.1 added sys-v shared memory support but their implementation
+	# is broken so we have to turn it off.  If they ever fix libipc,
+	# the following line should be deleted.
+	V_SHM=""
+	V_TARCMD="tar cfL"
+	V_CCOPT="-O2 -m486"
+	V_LIB="$V_LIB -lipc"
+	;;
+*-*-netbsd*)
+	if test "$gpl" = "yes" ; then
+		V_OBJ_GRABBER="video/grabber-ov511.o $V_OBJ_GRABBER"
+	fi
+	V_DEFINE="$V_DEFINE -DNetBSD"
+	V_STATIC=""
+	V_TARCMD="tar -h -c -f"
+	OPSYS=netbsd
+	;;
+*-*-freebsd*)
+	if test "$gpl" = "yes" ; then
+		V_OBJ_GRABBER="video/grabber-ov511.o $V_OBJ_GRABBER"
+	fi
+	V_STATIC=""
+	V_DEFINE="$V_DEFINE -DSIGARGS=int -DFreeBSD"
+	if test $ipv6 = yes; then
+		V_DEFINE="$V_DEFINE -DHAVE_IPV6"
+		V_LIB="$V_LIB -L/usr/local/v6/lib"
+	fi
+	OPSYS=freebsd
+	;;
+*-*-hpux*)
+	V_CCOPT="-O -DHPUX"
+	OPSYS=hpux
+	;;
+*-*-aix3*)
+	V_STATIC=""
+	V_DEFINE="$V_DEFINE -DSIGARGS=int -DHPUX"
+	if test "$V_LIB_AIXSHM" != "" ; then
+		V_LIB="$V_LIB $V_LIB_AIXSHM"
+	else
+		V_SHM=""
+	fi
+	CXX="xlC -+"
+	;;
+*-*-aix4*)
+	V_STATIC=""
+	V_DEFINE="$V_DEFINE -DSIGARGS=int -D_AIX41"
+	if test "$V_LIB_AIXSHM" != "" ; then
+		V_LIB="$V_LIB $V_LIB_AIXSHM"
+	else
+		V_SHM=""
+	fi
+	CXX="xlC -+"
+	;;
+armv4l-*-linux)
+	V_STATIC=""
+	V_BROKEN_OBJ=
+	CC=arm-linux-gcc
+	CPP=arm-linux-g++
+	AR=arm-linux-ar
+	RANLIB=arm-linux-ranlib
+	if test $ipv6 = yes; then
+		V_DEFINE="$V_DEFINE -DLinux -DHAVE_IPV6 -DLINUX_IPV6"
+	else
+		V_DEFINE="$V_DEFINE -DLinux"
+	fi
+	OPSYS=linux
+	;;
+*-*-linux*)
+	V_STATIC=""
+	V_BROKEN_OBJ=
+	if test $ipv6 = yes; then
+		V_DEFINE="$V_DEFINE -DLinux -DHAVE_IPV6 -DLINUX_IPV6"
+	else
+		V_DEFINE="$V_DEFINE -DLinux"
+	fi
+	OPSYS=linux
+        ;;
+*darwin*)
+        V_SHM=""
+        V_STATIC=""
+        V_BROKEN_OBJ=
+        V_DEFINE="$V_DEFINE -DHAVE_IPV6 -DHAVE_FAST_INT"
+        V_LIB="$V_LIB -framework Carbon -framework QuickTime"
+        if test "$target_cpu" = powerpc; then
+            V_CCOPT="-O2 $ppc_tune"
+        fi
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit gcc on OSX" >&5
+$as_echo_n "checking for 64-bit gcc on OSX... " >&6; }
+	if gcc -v 2>&1 | grep host=x86_64 >& /dev/null ; then
+	   if ! file -L  /System/Library/Frameworks/QuickTime.framework/QuickTime 2>&1 | grep x86_64 >&/dev/null; then
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: Yes but forcing 32-bit due to QT" >&5
+$as_echo "Yes but forcing 32-bit due to QT" >&6; }
+              V_CCOPT="$V_CCOPT -arch i386"
+              V_LDFLAGS="$V_LDFLAGS -arch i386  -mmacosx-version-min=10.4"
+              V_CCLDFLAGS32="LDFLAGS='-arch i386 -mmacosx-version-min=10.4' CFLAGS='-arch i386'"
+	   fi
+	else
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: No - using 32-bit" >&5
+$as_echo "No - using 32-bit" >&6; }
+	fi
+        OPSYS=macosx
+        V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-macosx.o"
+        ;;
+   *)
+        V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-x11.o"
+        ;;
+esac
+
+# Check whether --enable-gpl was given.
+if test "${enable_gpl+set}" = set; then :
+  enableval=$enable_gpl; gpl="yes"
+else
+  gpl="no"
+fi
+
+if test "$gpl" = "yes" ; then
+  V_DEFINE="$V_DEFINE -DHAVE_SWSCALE"
+  V_OBJ="$V_OBJ codec/packetbuffer.o codec/databuffer.o \
+    codec/ffmpeg_codec.o codec/encoder-mpeg4.o codec/decoder-mpeg4.o \
+    codec/x264encoder.o codec/encoder-h264.o codec/decoder-h264.o \
+    codec/rtp_h264_depayloader.o render/color-swscale.o video/deinterlace.o"
+else
+  V_OBJ="$V_OBJ render/color-true.o  render/color-hi.o"
+fi
+
+# Extract the first word of "wget", so it can be a program name with args.
+set dummy wget; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_DOWNLOAD+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DOWNLOAD"; then
+  ac_cv_prog_DOWNLOAD="$DOWNLOAD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_DOWNLOAD="wget -O -"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+DOWNLOAD=$ac_cv_prog_DOWNLOAD
+if test -n "$DOWNLOAD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOWNLOAD" >&5
+$as_echo "$DOWNLOAD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "curl", so it can be a program name with args.
+set dummy curl; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_DOWNLOAD+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DOWNLOAD"; then
+  ac_cv_prog_DOWNLOAD="$DOWNLOAD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_DOWNLOAD="curl -s"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+DOWNLOAD=$ac_cv_prog_DOWNLOAD
+if test -n "$DOWNLOAD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOWNLOAD" >&5
+$as_echo "$DOWNLOAD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
+# Check whether --with-ffmpegver was given.
+if test "${with_ffmpegver+set}" = set; then :
+  withval=$with_ffmpegver; ffmpegver=$withval
+else
+  ffmpegver=ffmpeg
+fi
+
+# Check whether --enable-ffmpeg-co was given.
+if test "${enable_ffmpeg_co+set}" = set; then :
+  enableval=$enable_ffmpeg_co; ffmpegco="no"
+else
+  ffmpegco="yes"
+fi
+
+if test "$ffmpegco" = "yes" ; then
+  if test "$gpl" = "yes" ; then
+   if test ! -d ${ffmpegver} ; then
+      echo "Checking out r20462 (and 29824 of libswscale) of ffmpeg from svn://svn.ffmpeg.org/ffmpeg/trunk..."
+      svn checkout -q -r 20462 svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
+      svn checkout -q -r 29824 svn://svn.ffmpeg.org/mplayer/trunk/libswscale  ffmpeg/libswscale
+   fi
+   patch --dry-run -sf -p0 < ffmpeg.iocom.patch >& /dev/null
+   if test $? = 0; then
+      echo "Patching ffmpeg h264 for IOCOM decode compatibility..."
+      patch -p0 < ffmpeg.iocom.patch
+   else
+      echo "ffmpeg has already been patched for IOCOM decode compatibility"
+   fi
+   echo "Configuring ffmpeg..."
+   echo "cd ffmpeg && ${V_CCLDFLAGS32} ./configure --prefix=$V_PATH/ffmpeg $ppc_conf --enable-gpl --enable-postproc; cd .."
+   cd ffmpeg && eval ${V_CCLDFLAGS32} ./configure --prefix=$V_PATH/ffmpeg $ppc_conf --enable-gpl --enable-postproc; cd ..
+   V_INCLUDE="$V_INCLUDE -Iffmpeg/include -Iffmpeg"
+   V_CODEC_LIB="$V_CODEC_LIB -Lffmpeg/lib -lavcodec -lavutil -lswscale -lpostproc "
+  else
+   echo "ffmpeg not available without --enable-gpl"
+  fi
+fi
+
+
+# Check whether --with-x264ver was given.
+if test "${with_x264ver+set}" = set; then :
+  withval=$with_x264ver; x264ver=$withval
+else
+  x264ver=x264-snapshot-20090708-2245
+fi
+
+# Check whether --enable-x264-co was given.
+if test "${enable_x264_co+set}" = set; then :
+  enableval=$enable_x264_co; x264co="no"
+else
+  x264co="yes"
+fi
+
+if test "$x264co" = "yes" ; then
+  if test "$gpl" = "yes" ; then
+   if test ! -d ${x264ver} ; then
+     echo "Downloading ${x264ver} of x264 from videolan.org ..."
+     ${DOWNLOAD} http://downloads.videolan.org/pub/videolan/x264/snapshots/${x264ver}.tar.bz2 | tar xjf - && ln -sf ${x264ver} x264
+   fi
+   echo "Configuring x264..."
+   cd x264 && eval ${V_CCLDFLAGS32} ./configure --prefix=$V_PATH/x264; cd ..
+   V_INCLUDE="$V_INCLUDE -Ix264/include"
+   V_CODEC_LIB="$V_CODEC_LIB -Lx264/lib -lx264"
+  else
+   echo "x264 not available without --enable-gpl"
+  fi
+fi
+
+
+# Check whether --with-ffmpeginc was given.
+if test "${with_ffmpeginc+set}" = set; then :
+  withval=$with_ffmpeginc; ffmpeginc=$withval
+else
+  ffmpeginc=""
 fi
 
-   for ac_header in libdv/dv.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "libdv/dv.h" "ac_cv_header_libdv_dv_h" "$ac_includes_default"
-if test "x$ac_cv_header_libdv_dv_h" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBDV_DV_H 1
-_ACEOF
 
+# Check whether --with-ffmpeglib was given.
+if test "${with_ffmpeglib+set}" = set; then :
+  withval=$with_ffmpeglib; ffmpeglib=$withval
 else
+  ffmpeglib=""
+fi
 
-      echo "Error! libdv/dv.h not found. Please install libdv developer package."
-      exit 1
+
+if test "$gpl" = "yes" ; then
+  if test "$ffmpegco" != "yes"; then
+
+	if test "$ffmpeginc" != "" ; then
+	   if test ! -r $ffmpeginc/ffmpeg/avcodec.h ; then
+	        echo "Error! you need to have $ffmpeginc/ffmpeg/avcodec.h around"
+	        exit 1
+	   elif test ! -r $ffmpeginc/ffmpeg/avutil.h ; then
+	        echo "Error! you need to have $ffmpeginc/ffmpeg/avutil.h around"
+	        exit 1
+	   elif test ! -r $ffmpeginc/ffmpeg/swscale.h ; then
+	        echo "Error! you need to have $ffmpeginc/ffmpeg/swscale.h around"
+	        exit 1
+	   fi
+	   echo "checking for FFmpeg headers...yes"
+	   V_INCLUDE="$V_INCLUDE -I$ffmpeginc"
+
+	else
+
+	   ac_fn_c_check_header_mongrel "$LINENO" "ffmpeg/avcodec.h" "ac_cv_header_ffmpeg_avcodec_h" "$ac_includes_default"
+if test "x$ac_cv_header_ffmpeg_avcodec_h" = x""yes; then :
+
+else
+
+        	echo "Error! you need to have avcodec.h around."
+	        exit -1
 
 fi
 
-done
 
-   V_OBJ="$V_OBJ codec/decoder-dv.o"
-   V_DV="-DUSE_DVDECODER"
-   V_LIB="$V_LIB -ldv"
+	   ac_fn_c_check_header_mongrel "$LINENO" "ffmpeg/avutil.h" "ac_cv_header_ffmpeg_avutil_h" "$ac_includes_default"
+if test "x$ac_cv_header_ffmpeg_avutil_h" = x""yes; then :
+
+else
+
+	        echo "Error! you need to have avutil.h around."
+	        exit -1
+
 fi
 
-V_XV=""
-# Check whether --enable-xvideo was given.
-if test "${enable_xvideo+set}" = set; then :
-  enableval=$enable_xvideo; xvideo=yes
+
+	   ac_fn_c_check_header_mongrel "$LINENO" "ffmpeg/swscale.h" "ac_cv_header_ffmpeg_swscale_h" "$ac_includes_default"
+if test "x$ac_cv_header_ffmpeg_swscale_h" = x""yes; then :
+
 else
-  xvideo=no
+
+	        echo "Error! you need to have swscale.h around."
+	        exit -1
+
 fi
 
-if test "$xvideo" = "yes"; then
 
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XvQueryExtension in -lXv_pic" >&5
-$as_echo_n "checking for XvQueryExtension in -lXv_pic... " >&6; }
-if test "${ac_cv_lib_Xv_pic_XvQueryExtension+set}" = set; then :
+	fi
+
+	if test "$ffmpeglib" != "" ; then
+	   if test ! -r $ffmpeglib/libavcodec.a ; then
+		echo "Error! you need to have $ffmpeglib/libavcodec.a around"
+	   elif test ! -r $ffmpeglib/libavutil.a ; then
+	        echo "Error! you need to have $ffmpeglib/libavutil.a around"
+	   elif test ! -r $ffmpeglib/libswscale.a ; then
+	        echo "Error! you need to have $ffmpeglib/libswscale.a around"
+           elif test ! -r $ffmpeglib/libpostproc.a ; then
+                echo "Error! you need to have $ffmpeglib/libpostproc.a around"
+           fi
+
+	   V_LIB_FFMPEG="-L$ffmpeglib -lavcodec -lavutil -lswscale -lpostproc"
+	else
+	   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lavcodec" >&5
+$as_echo_n "checking for main in -lavcodec... " >&6; }
+if test "${ac_cv_lib_avcodec_main+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXv_pic -lXext $LIBS"
+LIBS="-lavcodec  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XvQueryExtension ();
+
 int
 main ()
 {
-return XvQueryExtension ();
+return main ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_Xv_pic_XvQueryExtension=yes
+  ac_cv_lib_avcodec_main=yes
 else
-  ac_cv_lib_Xv_pic_XvQueryExtension=no
+  ac_cv_lib_avcodec_main=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xv_pic_XvQueryExtension" >&5
-$as_echo "$ac_cv_lib_Xv_pic_XvQueryExtension" >&6; }
-if test "x$ac_cv_lib_Xv_pic_XvQueryExtension" = x""yes; then :
-  HAVE_XVIDEO="yes"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avcodec_main" >&5
+$as_echo "$ac_cv_lib_avcodec_main" >&6; }
+if test "x$ac_cv_lib_avcodec_main" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBAVCODEC 1
+_ACEOF
+
+  LIBS="-lavcodec $LIBS"
+
 else
-  HAVE_XVIDEO="no"
-fi
 
-   if test $HAVE_XVIDEO = "yes"; then
-	V_LIB="$V_LIB -lXv_pic"
-        V_XV="-DHAVE_XVIDEO"
-        V_OBJ="$V_OBJ render/xvideo.o"
-   else
+	        echo "Error! you need to have libavcodec around."
+	        exit -1
 
-   	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XvQueryExtension in -lXv" >&5
-$as_echo_n "checking for XvQueryExtension in -lXv... " >&6; }
-if test "${ac_cv_lib_Xv_XvQueryExtension+set}" = set; then :
+fi
+
+	   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lavutil" >&5
+$as_echo_n "checking for main in -lavutil... " >&6; }
+if test "${ac_cv_lib_avutil_main+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXv -lXext $LIBS"
+LIBS="-lavutil  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XvQueryExtension ();
+
 int
 main ()
 {
-return XvQueryExtension ();
+return main ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_Xv_XvQueryExtension=yes
+  ac_cv_lib_avutil_main=yes
 else
-  ac_cv_lib_Xv_XvQueryExtension=no
+  ac_cv_lib_avutil_main=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xv_XvQueryExtension" >&5
-$as_echo "$ac_cv_lib_Xv_XvQueryExtension" >&6; }
-if test "x$ac_cv_lib_Xv_XvQueryExtension" = x""yes; then :
-  HAVE_XVIDEO="yes"
-else
-  HAVE_XVIDEO="no"
-fi
-
-
-   	if test $HAVE_XVIDEO = "yes"; then
-       	    V_XV="-DHAVE_XVIDEO"
-       	    V_LIB="$V_LIB -lXv"
-            V_OBJ="$V_OBJ render/xvideo.o"
-   	fi
-   fi
-
-   if test $HAVE_XVIDEO = "yes"; then
-   	for ac_header in X11/extensions/Xvlib.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "X11/extensions/Xvlib.h" "ac_cv_header_X11_extensions_Xvlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_X11_extensions_Xvlib_h" = x""yes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avutil_main" >&5
+$as_echo "$ac_cv_lib_avutil_main" >&6; }
+if test "x$ac_cv_lib_avutil_main" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define HAVE_X11_EXTENSIONS_XVLIB_H 1
+#define HAVE_LIBAVUTIL 1
 _ACEOF
 
-else
-
-      	echo "Error! \"X11/extensions/Xvlib.h\" not found. Please install \"libxv-dev\" package."
-      		exit 1
-
-fi
-
-done
-
-   fi
-fi
-
+  LIBS="-lavutil $LIBS"
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for V4L support" >&5
-$as_echo "$as_me: checking for V4L support" >&6;}
-ac_fn_c_check_header_mongrel "$LINENO" "linux/videodev.h" "ac_cv_header_linux_videodev_h" "$ac_includes_default"
-if test "x$ac_cv_header_linux_videodev_h" = x""yes; then :
-   have_videodev_h=yes;
 else
-  ac_fn_c_check_header_mongrel "$LINENO" "/usr/local/include/linux/videodev.h" "ac_cv_header__usr_local_include_linux_videodev_h" "$ac_includes_default"
-if test "x$ac_cv_header__usr_local_include_linux_videodev_h" = x""yes; then :
-   have_videodev_h=yes;
-fi
-
-
-fi
-
-
-if test x$have_videodev_h = xyes; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: suitable V4L support found... using linux/videodev.h" >&5
-$as_echo "$as_me: suitable V4L support found... using linux/videodev.h" >&6;}
-        V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-video4linux.o"
-        have_V4L=yes
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for V4L2 support" >&5
-$as_echo "$as_me: checking for V4L2 support" >&6;}
-ac_fn_c_check_header_mongrel "$LINENO" "linux/videodev2.h" "ac_cv_header_linux_videodev2_h" "$ac_includes_default"
-if test "x$ac_cv_header_linux_videodev2_h" = x""yes; then :
-   have_linux_videodev2_h=yes;
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "sys/videodev2.h" "ac_cv_header_sys_videodev2_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_videodev2_h" = x""yes; then :
-   have_sys_videodev2_h=yes;
-fi
 
+	        echo "Error! you need to have libavutil around."
+	        exit -1
 
-ac_fn_c_check_header_mongrel "$LINENO" "sys/videoio.h" "ac_cv_header_sys_videoio_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_videoio_h" = x""yes; then :
-   have_sys_videoio_h=yes;
 fi
 
+	   { $as_echo "$as_me:${as_lineno-$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 confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
 
-if test x$have_linux_videodev2_h = xyes ; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: suitable V4L2 support found... using linux/videodev2.h" >&5
-$as_echo "$as_me: suitable V4L2 support found... using linux/videodev2.h" >&6;}
-        V_DEFINE="$V_DEFINE -DHAVE_LINUX_VIDEODEV2_H"
-        V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-v4l2.o"
-        have_V4L2=yes
-
-elif test x$have_sys_videodev2_h = xyes; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: suitable V4L2 support found... using sys/videodev2.h" >&5
-$as_echo "$as_me: suitable V4L2 support found... using sys/videodev2.h" >&6;}
-        V_DEFINE="$V_DEFINE -DHAVE_SYS_VIDEODEV2_H"
-        V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-v4l2.o"
-        have_V4L2=yes
-
-elif test x$have_sys_videodev2_h = xyes; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: suitable V4L2 support found... using sys/videoio.h" >&5
-$as_echo "$as_me: suitable V4L2 support found... using sys/videoio.h" >&6;}
-        V_DEFINE="$V_DEFINE -DHAVE_SYS_VIDEOIO_H"
-        V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-v4l2.o"
-        have_V4L2=yes
-
-fi
-
-if test x$have_V4L = xyes -o x$have_V4L2 = xyes; then
-        V_OBJ_GRABBER="$V_OBJ_GRABBER video/yuv_convert.o"
+int
+main ()
+{
+return main ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_swscale_main=yes
+else
+  ac_cv_lib_swscale_main=no
 fi
-
-ac_fn_c_check_header_mongrel "$LINENO" "libv4lconvert.h" "ac_cv_header_libv4lconvert_h" "$ac_includes_default"
-if test "x$ac_cv_header_libv4lconvert_h" = x""yes; then :
-   have_libv4lconvert_h=yes;
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
+{ $as_echo "$as_me:${as_lineno-$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"
 
-if test x$have_libv4lconvert_h = xyes; then
-        V_DEFINE="$V_DEFINE -DHAVE_LIBV4L"
-        if test x$have_V4L = xyes; then
-                V_LIB_GRABBER="$V_LIB_GRABBER -lv4l1"
-        fi
-        if test x$have_V4L2 = xyes; then
-                V_LIB_GRABBER="$V_LIB_GRABBER -lv4l2"
-        fi
 else
-        V_OBJ_GRABBER="$V_OBJ_GRABBER  video/tinyjpeg.o video/jidctflt.o"
-fi
 
+	        echo "Error! you need to have libswscale around."
+	        exit -1
 
-# Check whether --with-decklink was given.
-if test "${with_decklink+set}" = set; then :
-  withval=$with_decklink; with_decklinkapidispatch=${withval}
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Blackmagic DeckLink SDK" >&5
-$as_echo "$as_me: checking for Blackmagic DeckLink SDK" >&6;}
-if test "${ac_cv_c_decklinkapidispatch+set}" = set; then :
+
+           { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpostproc" >&5
+$as_echo_n "checking for main in -lpostproc... " >&6; }
+if test "${ac_cv_lib_postproc_main+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpostproc  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-        # First check to see if --with-decklink was specified.
-        if test x"${with_decklinkapidispatch}" != x ; then
-                case ${with_decklinkapidispatch} in
-                */DeckLinkAPIDispatch.cpp )
-                        if test -f ${with_decklinkapidispatch}; then
-                                { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-decklink argument should refer to directory containing DeckLinkAPIDispatch.cpp, not to DeckLinkAPIDispatch.cpp itself" >&5
-$as_echo "$as_me: WARNING: --with-decklink argument should refer to directory containing DeckLinkAPIDispatch.cpp, not to DeckLinkAPIDispatch.cpp itself" >&2;}
-                                with_decklinkapidispatch=`echo ${with_decklinkapidispatch} | sed 's!/DeckLinkAPIDispatch\.cpp!!'`
-                        fi ;;
-                esac
-                if test -f "${with_decklinkapidispatch}/DeckLinkAPIDispatch.cpp" ; then
-                    ac_cv_c_decklinkapidispatch=`(cd ${with_decklinkapidispatch}; pwd)`
-                else
-                    as_fn_error "${with_decklinkapidispatch} directory doesn't contain DeckLinkAPIDispatch.cpp" "$LINENO" 5
-                fi
-        fi
-
-        # then check for a private Blackmagic DeckLink SDK installation
-        if test x"${ac_cv_c_decklinkapidispatch}" = x ; then
-		as_save_IFS=$IFS
-		IFS=`echo`
-                for i in \
-                        `ls -dr "Blackmagic DeckLink SDK "[0-9]* 2>/dev/null` \
-                        `ls -dr ../"Blackmagic DeckLink SDK "[0-9]* 2>/dev/null` \
-                        `ls -dr $HOME/"Blackmagic DeckLink SDK "[0-9]* 2>/dev/null` \
-                        `ls -dr $HOME/Downloads/"Blackmagic DeckLink SDK "[0-9]* 2>/dev/null` \
-                        `ls -dr /usr/local/"Blackmagic DeckLink SDK "[0-9]* 2>/dev/null` \
-                        `ls -dr /opt/local/"Blackmagic DeckLink SDK "[0-9]* 2>/dev/null` ; do
-                        case "$target" in
-                        *linux* )
-                                if test -f "$i/Linux/include/DeckLinkAPIDispatch.cpp" ; then
-                                        ac_cv_c_decklinkapidispatch=`(cd "$i/Linux/include"; pwd)`
-                                        break
-                                fi ;;
-                        *darwin* )
-                                if test -f "$i/Mac/include/DeckLinkAPIDispatch.cpp" ; then
-                                        ac_cv_c_decklinkapidispatch=`(cd "$i/Mac/include"; pwd)`
-                                        break
-                                fi ;;
-                        esac
-                done
-		IFS=$as_save_IFS
-        fi
-
-fi
 
-if test x"${ac_cv_c_decklinkapidispatch}" = x ; then
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no DeckLinkAPIDispatch.cpp file found" >&5
-$as_echo "$as_me: WARNING: no DeckLinkAPIDispatch.cpp file found" >&2;}
+int
+main ()
+{
+return main ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_postproc_main=yes
 else
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: found ${ac_cv_c_decklinkapidispatch}/DeckLinkAPIDispatch.cpp" >&5
-$as_echo "found ${ac_cv_c_decklinkapidispatch}/DeckLinkAPIDispatch.cpp" >&6; }
-	V_INCLUDE="$V_INCLUDE -I\"${ac_cv_c_decklinkapidispatch}\""
-	V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-decklink.o"
-fi
-
-if test -r /usr/lib/libvl.so ; then
-	V_LIB_GRABBER="$V_LIB_GRABBER -lvl -ldmedia"
-	V_OBJ_GRABBER="video/grabber-vl.o video/output-vl.o $V_OBJ_GRABBER"
-	if test -r /usr/include/dmedia/cl_cosmo.h  ; then
-		V_LIB_GRABBER="$V_LIB_GRABBER -lcl"
-		V_OBJ_GRABBER="video/grabber-cosmo.o $V_OBJ_GRABBER"
-	fi
+  ac_cv_lib_postproc_main=no
 fi
-if test -r /usr/lib/libsvideo.a ; then
-	V_LIB_GRABBER="$V_LIB_GRABBER -lsvideo"
-	V_OBJ_GRABBER="video/grabber-svideo.o $V_OBJ_GRABBER"
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_postproc_main" >&5
+$as_echo "$ac_cv_lib_postproc_main" >&6; }
+if test "x$ac_cv_lib_postproc_main" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBPOSTPROC 1
+_ACEOF
+
+  LIBS="-lpostproc $LIBS"
 
-# Check whether --enable-XvGrabber was given.
-if test "${enable_XvGrabber+set}" = set; then :
-  enableval=$enable_XvGrabber; XvGrabber=yes
 else
-  XvGrabber=no
-fi
 
-if test -r /usr/lib/libXv.a -a "$XvGrabber" = "yes" ; then
-	V_LIB_GRABBER="$V_LIB_GRABBER -lXv"
-	V_DEFINE="$V_DEFINE -DXV_PSEUDO8"
-	V_OBJ_GRABBER="video/grabber-xv.o $V_OBJ_GRABBER"
-fi
-if test -r /usr/lpp/parallax/lib/libXvid.a ; then
-    V_LIB_GRABBER="$V_LIB_GRABBER -L/usr/lpp/parallax/lib -lXvid -lXv"
-    V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I/usr/lpp/parallax/include"
-    V_OBJ_GRABBER="video/grabber-plx.o video/assistor-plx.o $V_OBJ_GRABBER"
-fi
-if test -r /usr/lpp/UMS6000/lib/libUMSobj.a ; then
-	V_LIB_GRABBER="$V_LIB_GRABBER -L/usr/lpp/UMS6000/lib -lUMSobj"
-	V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I/usr/lpp/UMS6000/include"
-	V_DEFINE="$V_DEFINE -DSUNRISE"
-	V_OBJ_GRABBER="video/grabber-sunrise.o video/output-sunrise.o $V_OBJ_GRABBER"
+                echo "Error! you need to have libpostproc around."
+                exit -1
+
 fi
 
-if test -r /usr/include/machine/ioctl_meteor.h -o \
-    -r /usr/include/dev/ic/bt8xx.h ; then
-	V_OBJ_GRABBER="video/grabber-meteor.o $V_OBJ_GRABBER"
+
+	   V_LIB_FFMPEG="-lavcodec -lavutil -lswscale -lpostproc"
+	fi
+  fi
 fi
 
-# Check whether --enable-Linux1394Grabber was given.
-if test "${enable_Linux1394Grabber+set}" = set; then :
-  enableval=$enable_Linux1394Grabber; Linux1394Grabber=yes
+
+# Check whether --with-x264inc was given.
+if test "${with_x264inc+set}" = set; then :
+  withval=$with_x264inc; x264inc=$withval
 else
-  Linux1394Grabber=no
+  x264inc=""
 fi
 
-if test -r /usr/include/libdc1394/dc1394_control.h -a -r /usr/include/libraw1394/raw1394.h -a "$Linux1394Grabber" = "yes"; then
-      V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-linux1394.o"
-      V_LIB_GRABBER="$V_LIB_GRABBER -lraw1394 -ldc1394_control"
-fi
 
-#if test -r /usr/local/lib/libspigot.a -a ${PORTOBJFORMAT} != elf; then
-if test -r /usr/local/lib/libspigot.a ; then
-	V_OBJ_GRABBER="video/grabber-spigot.o $V_OBJ_GRABBER"
-	V_LIB_GRABBER="$V_LIB_GRABBER -lspigot"
-	V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I/usr/local/include"
+# Check whether --with-x264lib was given.
+if test "${with_x264lib+set}" = set; then :
+  withval=$with_x264lib; x264lib=$withval
+else
+  x264lib=""
 fi
 
-if test "$qcamdir" != "" ; then
-	V_OBJ_GRABBER="video/grabber-qcam.o $V_OBJ_GRABBER"
-	V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I$qcamdir"
-	V_DEFINE="$V_DEFINE -DQCAMDEV -DQCAMDOTH=qcam.h"
-elif test -r /usr/local/lib/libqcam.a ; then
-	V_OBJ_GRABBER="video/grabber-qcam.o $V_OBJ_GRABBER"
-	V_LIB_GRABBER="$V_LIB_GRABBER -lqcam"
-	V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I/usr/local/include"
-	V_DEFINE="$V_DEFINE -DQCAMLIB"
-elif test -r /dev/qcam0 ; then
-	V_OBJ_GRABBER="video/grabber-qcam.o $V_OBJ_GRABBER"
-	V_DEFINE="$V_DEFINE -DQCAMDEV"
-fi
-vpix_dir=/usr/src/local/vfc-1.0
-vpix_lib=$vpix_dir/vfc_lib
-if test -d /import/VideoPix ; then
-	vpix_dir=/import/VideoPix
-	vpic_lib=$vpix_dir/lib
-fi
-if test -d $vpix_dir ; then
-	V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I$vpix_dir/sys -I$vpix_lib"
-	V_LIB_GRABBER="$V_LIB_GRABBER $vpix_lib/libvfc.a"
-	V_DEFINE="$V_DEFINE -DVIDEOPIX"
-	V_OBJ_GRABBER="video/grabber-vpix.o $V_OBJ_GRABBER"
-fi
-places="/usr/src/local/vigrapix/lib \
-	/opt/VIGRAvigrapix/lib"
-for dir in $places; do
-	if test -d $dir ; then
-		V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I$dir"
-		V_LIB_GRABBER="$V_LIB_GRABBER $dir/libvigrapix.a"
-		V_OBJ_GRABBER="video/grabber-vigra.o $V_OBJ_GRABBER"
-		break
+if test "$gpl" = "yes" ; then
+  if test "$x264co" != "yes" ; then
+	if test "$x264inc" != "" ; then
+	   if test ! -r $x264inc/x264.h ; then
+	        echo "Error! you need to have $x264inc/x264.h around."
+	        exit 1
+	   fi
+	   V_INCLUDE="$V_INCLUDE -I$x264inc"
+	elif test ! -r /usr/local/include/x264.h -a ! -r /usr/include/x264.h ; then
+	        echo "Error! you need to have x264.h around."
+	        exit 1
+	else
+	   echo "checking for x264.h...yes"
 	fi
-done
 
-d=/opt/MMACslv
-if test -d $d ; then
-	V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I$d/include"
-	V_LIB_GRABBER="$V_LIB_GRABBER $d/lib/libslv.a -lintl"
-	V_OBJ_GRABBER="video/grabber-slv.o $V_OBJ_GRABBER"
-fi
+	if test "$x264lib" != "" ; then
+	   if test ! -r $x264lib/libx264.a ; then
+	        echo "Error! you need to have $x264lib/libx264.a around"
+		exit 1
+	   fi
+	   V_LIB_X264="-L$x264lib -lx264"
+	else
+	   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lx264" >&5
+$as_echo_n "checking for main in -lx264... " >&6; }
+if test "${ac_cv_lib_x264_main+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lx264  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-d=/usr/include/mme
-if test -d $d ; then
-	V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I$d"
-	V_LIB_GRABBER="$V_LIB_GRABBER -lmme"
-	V_OBJ_GRABBER="video/grabber-mme.o $V_OBJ_GRABBER"
+
+int
+main ()
+{
+return main ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_x264_main=yes
+else
+  ac_cv_lib_x264_main=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_x264_main" >&5
+$as_echo "$ac_cv_lib_x264_main" >&6; }
+if test "x$ac_cv_lib_x264_main" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBX264 1
+_ACEOF
 
-places="/opt/parallax \
-	/usr/src/local/parallax \
-	/usr/local/parallax \
-	/usr/local/parallax/components/Xclients_sun4.ow3_1.18 \
-	/usr/src/local/parallax/components/Xclients_sun4.ow3_1.18"
-for dir in $places; do
-	if test -d $dir/include ; then
-		V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I$dir/include"
-		V_LIB_GRABBER="$V_LIB_GRABBER -L$dir/lib -lXext -lXvid"
-		V_OBJ_GRABBER="video/grabber-plx.o video/assistor-plx.o $V_OBJ_GRABBER"
-		break
-	fi
-done
+  LIBS="-lx264 $LIBS"
 
+else
 
-case "$target" in
-*-dec-*)
-	jv_dir=jv2
-	V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I$jv_dir"
-	V_LIB_GRABBER="$V_LIB_GRABBER $jv_dir/jvdriverint.o"
-	V_OBJ_GRABBER="video/assistor-jv.o video/grabber-jv.o $V_OBJ_GRABBER"
-	if test "$target_os" = ultrix4.3 ; then
-		#XXX rtip code currently broken
-		#V_DEFINE="$V_DEFINE -DRTIP"
-		#V_LIB="$V_LIB lib.ultrix/librcap.a"
-		#V_INCLUDE="$V_INCLUDE -Ircap-include"
-		#XXX
-		#V_OBJ_GRABBER="$V_OBJ_GRABBER net-rtip.o"
-		echo no rtip support
-	fi
-	;;
-sparc-sun-solaris*)
-	V_STATIC=""
-	have_xil=no
-	xil_dir=/usr/openwin
-	if test -d $xil_dir ; then
-		if test ! -d $xil_dir/include/xil ; then
-			echo "You don't have the XIL developer's kit!"
-			echo "Building without XIL support..."
-		else
-			echo "Using XIL developer's kit (Found in: $xil_dir/include/xil)"
-			have_xil=yes
-		fi
-	fi
-	SYSINC="-I"
-	if test $CC = gcc ; then
-		V_DEFINE="$V_DEFINE -mv8 -msupersparc"
-		SYSINC="-isystem "
-	elif  test -z "$enable_debug" ; then
-		V_CCOPT="-xO2";
-	fi
-	if test $ipv6 = yes; then
-		V_DEFINE="$V_DEFINE -D__svr4__ -DSolaris -DHAVE_IPV6 -DSOLARIS7_IPV6"
-	else
-		V_DEFINE="$V_DEFINE -D__svr4__ -DSolaris"
-	fi
-	OPSYS=solaris
-	if test -f video/grabber-rtvc.cpp || test -f video/grabber-rtvc.o ; then
-		V_OBJ_GRABBER="video/grabber-rtvc.o $V_OBJ_GRABBER"
-		if test "$have_xil" = yes ; then
-			V_ALL="$V_PROG $V_PROG.xil"
-			V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER $SYSINC$xil_dir/include -DSUNXIL_WARNING_DISABLE"
-			V_LIB_XIL="-L$xil_dir/lib -R\"$xil_dir/lib:/opt/SUNWo1kp/lib:/opt/MMACo1k/lib\" -lxil"
-			V_OBJ_XIL="video/grabber-xil.o codec/framer-h261hw.o codec/framer-cellb.o video/assistor-xil.o"
-		fi
-	elif test "$have_xil" = yes ; then
-		V_OBJ_XIL="video/grabber-xil.o codec/framer-h261hw.o codec/framer-cellb.o video/assistor-xil.o"
-		V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I$xil_dir/include"
-		V_LIB_GRABBER="$V_LIB_GRABBER -L$xil_dir/lib -R\"$xil_dir/lib:/opt/SUNWo1kp/lib:/opt/MMACo1k/lib\" -lxil "
-	fi
-	;;
-sparc-sun-sunos*)
-	V_DEFINE="$V_DEFINE -DNEED_SUNOS_PROTOS -DSunOS"
-	;;
-*-sgi-irix*)
-	V_DEFINE="$V_DEFINE -D_BSD_SIGNALS -DIRIX"
-	OPSYS=irix
-	if test "$target_os" = irix6.2 ; then
-		V_DEFINE="$V_DEFINE -DIRIX6_2 -DSIGARGS=__sigargs"
-	fi
-	V_TARCMD="tar cfL"
-	V_SHELL="SHELL = /bin/sh"
-	if test $CC != gcc ; then
-		V_DEFINE="$V_DEFINE -signed -g3"
-		CC="cc -Dinline="
-		if test "$target_os" = irix5.2 ; then
-			CC="$CC -xansi -D__STDC__"
-		fi
-		CXX="CC +p -float -woff 3262 -DSGI_COMPAT"
-	else
-		CXX=$CC
-	fi
-	V_STATIC=""
-	;;
-*-*-bsdi1*)
-	V_SHM=""
-	V_TARCMD="tar cfL"
-	;;
-*-*-bsdi2.0*)
-	V_SHM=""
-	V_TARCMD="tar cfL"
-	;;
-*-*-bsdi*)
-	# bsdi2.1 added sys-v shared memory support but their implementation
-	# is broken so we have to turn it off.  If they ever fix libipc,
-	# the following line should be deleted.
-	V_SHM=""
-	V_TARCMD="tar cfL"
-	V_CCOPT="-O2 -m486"
-	V_LIB="$V_LIB -lipc"
-	;;
-*-*-netbsd*)
-	if test "$gpl" = "yes" ; then
-		V_OBJ_GRABBER="video/grabber-ov511.o $V_OBJ_GRABBER"
-	fi
-	V_DEFINE="$V_DEFINE -DNetBSD"
-	V_STATIC=""
-	V_TARCMD="tar -h -c -f"
-	OPSYS=netbsd
-	;;
-*-*-freebsd*)
-	if test "$gpl" = "yes" ; then
-		V_OBJ_GRABBER="video/grabber-ov511.o $V_OBJ_GRABBER"
-	fi
-	V_STATIC=""
-	V_DEFINE="$V_DEFINE -DSIGARGS=int -DFreeBSD"
-	if test $ipv6 = yes; then
-		V_DEFINE="$V_DEFINE -DHAVE_IPV6"
-		V_LIB="$V_LIB -L/usr/local/v6/lib"
-	fi
-	OPSYS=freebsd
-	;;
-*-*-hpux*)
-	V_CCOPT="-O -DHPUX"
-	OPSYS=hpux
-	;;
-*-*-aix3*)
-	V_STATIC=""
-	V_DEFINE="$V_DEFINE -DSIGARGS=int -DHPUX"
-	if test "$V_LIB_AIXSHM" != "" ; then
-		V_LIB="$V_LIB $V_LIB_AIXSHM"
-	else
-		V_SHM=""
-	fi
-	CXX="xlC -+"
-	;;
-*-*-aix4*)
-	V_STATIC=""
-	V_DEFINE="$V_DEFINE -DSIGARGS=int -D_AIX41"
-	if test "$V_LIB_AIXSHM" != "" ; then
-		V_LIB="$V_LIB $V_LIB_AIXSHM"
-	else
-		V_SHM=""
-	fi
-	CXX="xlC -+"
-	;;
-armv4l-*-linux)
-	V_STATIC=""
-	V_BROKEN_OBJ=
-	CC=arm-linux-gcc
-	CPP=arm-linux-g++
-	AR=arm-linux-ar
-	RANLIB=arm-linux-ranlib
-	if test $ipv6 = yes; then
-		V_DEFINE="$V_DEFINE -DLinux -DHAVE_IPV6 -DLINUX_IPV6"
-	else
-		V_DEFINE="$V_DEFINE -DLinux"
-	fi
-	OPSYS=linux
-	;;
-*-*-linux*)
-	V_STATIC=""
-	V_BROKEN_OBJ=
-	if test $ipv6 = yes; then
-		V_DEFINE="$V_DEFINE -DLinux -DHAVE_IPV6 -DLINUX_IPV6"
-	else
-		V_DEFINE="$V_DEFINE -DLinux"
-	fi
-	OPSYS=linux
-        ;;
-*darwin*)
-        V_SHM=""
-        V_STATIC=""
-        V_BROKEN_OBJ=
-        V_DEFINE="$V_DEFINE -DHAVE_IPV6 -DHAVE_FAST_INT"
-        V_LIB="$V_LIB -framework Carbon -framework QuickTime"
-        if test "$target_cpu" = powerpc; then
-            V_CCOPT="-O2 $ppc_tune"
-        fi
-	if ! file -L  /System/Library/Frameworks//QuickTime.framework/QuickTime 2>/dev/null | grep x86_64 >/dev/null 2>&1; then
-          V_CCOPT="$V_CCOPT -arch i386"
-	fi
-        OPSYS=macosx
-        ;;
-esac
+	        echo "Error! you need to have libx264 around."
+	        exit -1
 
-case "$target" in
-   *-*-darwin*)
-        V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-macosx.o video/yuv_convert.o"
-        ;;
-   *)
-        V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-x11.o"
-        ;;
-esac
+fi
 
+	   V_LIB_X264="-lx264"
+	fi
+ fi
+fi
 
-if test $CC = gcc ; then
-     echo $ac_n "checking version of GCC""... $ac_c"
-     GCC_version=`$CC --version`
-     echo "$GCC_version"
-     if test "$GCC_version" = 2.96 ; then
-           echo "Turning off optimisation for dct code"
-           V_CCOPT_H261="";
-     fi
+V_CPUDETECT=""
+# Check whether --enable-cpudetect was given.
+if test "${enable_cpudetect+set}" = set; then :
+  enableval=$enable_cpudetect; cpudetect="no"
+else
+  cpudetect="yes"
 fi
 
-if test -f codec/encoder-bvc.cpp ; then
-	V_OBJ="$V_OBJ codec/encoder-bvc.o codec/decoder-bvc.o"
+if test "$gpl" = "yes" ; then
+ if test "$cpudetect" = "yes"; then
+    echo "Using CPU runtime detection..."
+    V_CPUDETECT="-DRUNTIME_CPUDETECT"
+    V_CPUDETECT_OBJ="cpu/cpudetect.o cpu/cpuid.o"
+ fi
+ else
+   echo "No runtime cputect without --enable-gpl"
 fi
 
 
@@ -5938,13 +5956,13 @@
 # various linker hacks
 if test x$prefix != xNONE ; then
 	if test -d $prefix/lib64 ; then
-		LDFLAGS="-L$prefix/lib64 $LDFLAGS"
+		V_LDFLAGS="-L$prefix/lib64 $V_LDFLAGS"
 	else
-		LDFLAGS="-L$prefix/lib $LDFLAGS"
+		V_LDFLAGS="-L$prefix/lib $V_LDFLAGS"
 	fi
 else
 	if test -d ../common/src ; then
-		LDFLAGS="-L../common/src $LDFLAGS"
+		V_LDFLAGS="-L../common/src $V_LDFLAGS"
 	fi
 fi
 
@@ -5974,6 +5992,8 @@
 
 
 
+
+
 ac_config_files="$ac_config_files Makefile"
 
 cat >confcache <<\_ACEOF

Modified: vic/branches/mpeg4/configure.in
==============================================================================
--- vic/branches/mpeg4/configure.in	(original)
+++ vic/branches/mpeg4/configure.in	Fri Jan 22 15:47:10 2010
@@ -29,9 +29,7 @@
     case "$target" in (*darwin*) V_DEFINE="$V_DEFINE -DSYS_DARWIN";; esac
     ppc_conf="--disable-altivec"
     ppc_tune="-mcpu=G3"
-    echo test1
     if sysctl hw.vectorunit 2>/dev/null | grep "hw.vectorunit: 1" >/dev/null 2>&1; then
-    echo testa
     	ppc_conf=""
     	ppc_tune="-mcpu=G4 -mtune=G4"
     fi
@@ -53,6 +51,22 @@
 V_LIB_FFMPEG=""
 V_LIB_X264=""
 
+dnl Optimisation in H261 decoder needs to be turned off for GCC 2.96 
+
+AC_MSG_CHECKING([for buggy version of GCC-2.96])
+if test $CC = gcc ; then
+     if $CC --version | grep 2.96 >&/dev/null; then
+           AC_MSG_RESULT([Yes - Turning off optimisation for dct code])
+           V_CCOPT_H261="";
+     else
+           AC_MSG_RESULT(no)
+     fi
+fi
+
+if test -f codec/encoder-bvc.cpp ; then
+	V_OBJ="$V_OBJ codec/encoder-bvc.o codec/decoder-bvc.o"
+fi
+
 AC_ARG_WITH(aix-shm,	--with-aix-shm=path	specify a pathname for the AIX shm X extension library file, lib=$withval, lib="")
 if test "$lib" != "" ; then
 	if test ! -r $lib ; then
@@ -70,171 +84,6 @@
 	exit 1
 fi
 
-AC_ARG_ENABLE(gpl,	--enable-gpl	Enable or disable  use of gpl functionality - H264 MPEG4 Swscale, gpl="yes", gpl="no")
-if test "$gpl" = "yes" ; then
-  V_DEFINE="$V_DEFINE -DHAVE_SWSCALE"
-  V_OBJ="$V_OBJ codec/packetbuffer.o codec/databuffer.o \
-    codec/ffmpeg_codec.o codec/encoder-mpeg4.o codec/decoder-mpeg4.o \
-    codec/x264encoder.o codec/encoder-h264.o codec/decoder-h264.o \
-    codec/rtp_h264_depayloader.o render/color-swscale.o video/deinterlace.o"
-else
-  V_OBJ="$V_OBJ render/color-true.o  render/color-hi.o"
-fi
-
-AC_CHECK_PROG(DOWNLOAD, wget, [wget -O -])
-AC_CHECK_PROG(DOWNLOAD, curl, [curl -s])
-
-AC_ARG_WITH(ffmpegver,       --with-ffmpegver=ffmpeg-version     specify the version of ffmpeg to download and build, ffmpegver=$withval, ffmpegver=ffmpeg-0.5)
-AC_ARG_ENABLE(ffmpeg-co,	--disable-ffmpeg-co	Enable or disable ffmpeg download, ffmpegco="no", ffmpegco="yes")
-if test "$ffmpegco" = "yes" ; then
-  if test "$gpl" = "yes" ; then
-   if test ! -r ${ffmpegver} ; then
-     echo "Downloading ${ffmpegver} from www.ffmpeg.org ..."
-     ${DOWNLOAD} http://www.ffmpeg.org/releases/${ffmpegver}.tar.bz2 | tar xjf - && rm -r ffmpeg ; ln -s ${ffmpegver} ffmpeg
-   fi
-   echo "Configuring ffmpeg..."
-   cd ffmpeg; ./configure --prefix=$V_PATH/ffmpeg $ppc_conf --enable-gpl --enable-swscale --enable-postproc; cd ..
-   V_INCLUDE="$V_INCLUDE -Iffmpeg/include -Iffmpeg"
-   V_CODEC_LIB="$V_CODEC_LIB ffmpeg/lib/libavcodec.a ffmpeg/lib/libavutil.a ffmpeg/lib/libswscale.a ffmpeg/lib/libpostproc.a"
-  else 
-    echo "ffmpeg not available without --enable-gpl"
-  fi
-fi
-
-AC_ARG_WITH(x264ver,       --with-x264ver=x264ver-version     specify the version of x264 to download and build, x264ver=$withval, x264ver=x264-snapshot-20070413-2245)
-AC_ARG_ENABLE(x264-co,        --disable-x264-co      Enable or disable x264 download, x264co="no", x264co="yes")
-if test "$x264co" = "yes" ; then
-  if test "$gpl" = "yes" ; then
-   if test ! -r ${x264ver} ; then
-     echo "Downloading ${x264ver} (r650) of x264 from videolan.org ..."
-     #svn checkout -r 650 svn://svn.videolan.org/x264/trunk x264
-     ${DOWNLOAD} http://downloads.videolan.org/pub/videolan/x264/snapshots/${x264ver}.tar.bz2 | tar xjf - && ln -sf ${x264ver} x264
-   fi
-   echo "Configuring x264..."
-   cd x264; ./configure --prefix=$V_PATH/x264; cd ..
-   V_INCLUDE="$V_INCLUDE -Ix264/include"
-   V_CODEC_LIB="$V_CODEC_LIB x264/lib/libx264.a"
-  else 
-    echo "x264 not available without --enable-gpl"
-  fi
-fi
-
-AC_ARG_WITH(ffmpeginc,       --with-ffmpeginc=dir     specify the prefix directory of ffmpeg header, ffmpeginc=$withval, ffmpeginc="")
-AC_ARG_WITH(ffmpeglib,       --with-ffmpeglib=dir     specify the directory of ffmpeg library, ffmpeglib=$withval, ffmpeglib="")
-
-if test "$gpl" = "yes" ; then
-  if test "$ffmpegco" != "yes"; then
-
-	if test "$ffmpeginc" != "" ; then
-	   if test ! -r $ffmpeginc/ffmpeg/avcodec.h ; then
-	        echo "Error! you need to have $ffmpeginc/ffmpeg/avcodec.h around"
-	        exit 1
-	   elif test ! -r $ffmpeginc/ffmpeg/avutil.h ; then
-	        echo "Error! you need to have $ffmpeginc/ffmpeg/avutil.h around"
-	        exit 1
-	   elif test ! -r $ffmpeginc/ffmpeg/swscale.h ; then
-	        echo "Error! you need to have $ffmpeginc/ffmpeg/swscale.h around"
-	        exit 1
-	   fi
-	   echo "checking for FFmpeg headers...yes"
-	   V_INCLUDE="$V_INCLUDE -I$ffmpeginc"
-	
-	else
-
-	   AC_CHECK_HEADER(ffmpeg/avcodec.h, [], [
-        	echo "Error! you need to have avcodec.h around."
-	        exit -1
-	   ])
-	   AC_CHECK_HEADER(ffmpeg/avutil.h, [], [
-	        echo "Error! you need to have avutil.h around."
-	        exit -1
-	   ])
-	   AC_CHECK_HEADER(ffmpeg/swscale.h, [], [
-	        echo "Error! you need to have swscale.h around."
-	        exit -1
-	   ])
-	fi
-
-	if test "$ffmpeglib" != "" ; then
-	   if test ! -r $ffmpeglib/libavcodec.a ; then
-		echo "Error! you need to have $ffmpeglib/libavcodec.a around"
-	   elif test ! -r $ffmpeglib/libavutil.a ; then
-	        echo "Error! you need to have $ffmpeglib/libavutil.a around"
-	   elif test ! -r $ffmpeglib/libswscale.a ; then
-	        echo "Error! you need to have $ffmpeglib/libswscale.a around"
-           elif test ! -r $ffmpeglib/libpostproc.a ; then
-                echo "Error! you need to have $ffmpeglib/libpostproc.a around"
-           fi
-	   
-	   V_LIB_FFMPEG="-L$ffmpeglib -lavcodec -lavutil -lswscale -lpostproc"
-	else
-	   AC_CHECK_LIB(avcodec, main, [], [
-	        echo "Error! you need to have libavcodec around."
-	        exit -1
-	   ])
-	   AC_CHECK_LIB(avutil, main, [], [
-	        echo "Error! you need to have libavutil around."
-	        exit -1
-	   ])
-	   AC_CHECK_LIB(swscale, main, [], [
-	        echo "Error! you need to have libswscale around."
-	        exit -1
-	   ])
-
-           AC_CHECK_LIB(postproc, main, [], [
-                echo "Error! you need to have libpostproc around."
-                exit -1
-           ])
-
-	   V_LIB_FFMPEG="-lavcodec -lavutil -lswscale -lpostproc"
-	fi
-  fi 
-fi
-
-AC_ARG_WITH(x264inc,       --with-x264inc=dir     specify the directory of x264 header, x264inc=$withval, x264inc="")
-AC_ARG_WITH(x264lib,       --with-x264lib=dir     specify the directory of x264 library, x264lib=$withval, x264lib="")
-if test "$gpl" = "yes" ; then
-  if test "$x264co" != "yes" ; then
-	if test "$x264inc" != "" ; then
-	   if test ! -r $x264inc/x264.h ; then
-	        echo "Error! you need to have $x264inc/x264.h around."
-	        exit 1
-	   fi
-	   V_INCLUDE="$V_INCLUDE -I$x264inc"
-	elif test ! -r /usr/local/include/x264.h -a ! -r /usr/include/x264.h ; then
-	        echo "Error! you need to have x264.h around."
-	        exit 1
-	else
-	   echo "checking for x264.h...yes"
-	fi
-
-	if test "$x264lib" != "" ; then
-	   if test ! -r $x264lib/libx264.a ; then
-	        echo "Error! you need to have $x264lib/libx264.a around"
-		exit 1
-	   fi
-	   V_LIB_X264="-L$x264lib -lx264"
-	else
-	   AC_CHECK_LIB(x264, main, [], [
-	        echo "Error! you need to have libx264 around."
-	        exit -1
-	   ])
-	   V_LIB_X264="-lx264"
-	fi
- fi
-fi
-
-V_CPUDETECT=""
-AC_ARG_ENABLE(cpudetect, --disable-cpudetect     Enable or disable runtime cpu detection, cpudetect="no", cpudetect="yes")
-if test "$gpl" = "yes" ; then
- if test "$cpudetect" = "yes"; then
-    echo "using CPU runtime detection..."
-    V_CPUDETECT="-DRUNTIME_CPUDETECT"
-    V_CPUDETECT_OBJ="cpu/cpudetect.o cpu/cpuid.o"
- fi
- else 
-   echo "No runtime cputect without --enable-gpl"
-fi
 
 V_DV=""
 dnl dv decoding support
@@ -687,15 +536,21 @@
         if test "$target_cpu" = powerpc; then
             V_CCOPT="-O2 $ppc_tune"
         fi
-	if ! file -L  /System/Library/Frameworks//QuickTime.framework/QuickTime 2>/dev/null | grep x86_64 >/dev/null 2>&1; then
-          V_CCOPT="$V_CCOPT -arch i386"
+dnl Check for 64-bit host gcc - in Snow Leopard+
+        AC_MSG_CHECKING([for 64-bit gcc on OSX])
+	if gcc -v 2>&1 | grep host=x86_64 >& /dev/null ; then
+dnl Check for lack of 64-bit support in QT - an issue in Snow Leopard+
+	   if ! file -L  /System/Library/Frameworks/QuickTime.framework/QuickTime 2>&1 | grep x86_64 >&/dev/null; then
+              AC_MSG_RESULT([Yes but forcing 32-bit due to QT])
+              V_CCOPT="$V_CCOPT -arch i386"
+              V_LDFLAGS="$V_LDFLAGS -arch i386  -mmacosx-version-min=10.4"
+dnl If gcc 32bit then we need to set these flags for compilation of ffmpeg and x264
+              V_CCLDFLAGS32="LDFLAGS='-arch i386 -mmacosx-version-min=10.4' CFLAGS='-arch i386'"
+	   fi
+	else
+              AC_MSG_RESULT([No - using 32-bit])
 	fi
         OPSYS=macosx
-        ;;
-esac
-
-case "$target" in
-   *-*-darwin*)
         V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-macosx.o video/yuv_convert.o"
         ;;
    *)
@@ -703,20 +558,178 @@
         ;;
 esac
 
-dnl Optimisation in H261 decoder needs to be turned off for GCC 2.96 
+AC_ARG_ENABLE(gpl,	--enable-gpl	Enable or disable  use of gpl functionality - H264 MPEG4 Swscale, gpl="yes", gpl="no")
+if test "$gpl" = "yes" ; then
+  V_DEFINE="$V_DEFINE -DHAVE_SWSCALE"
+  V_OBJ="$V_OBJ codec/packetbuffer.o codec/databuffer.o \
+    codec/ffmpeg_codec.o codec/encoder-mpeg4.o codec/decoder-mpeg4.o \
+    codec/x264encoder.o codec/encoder-h264.o codec/decoder-h264.o \
+    codec/rtp_h264_depayloader.o render/color-swscale.o video/deinterlace.o"
+else
+  V_OBJ="$V_OBJ render/color-true.o  render/color-hi.o"
+fi
 
-if test $CC = gcc ; then
-     echo $ac_n "checking version of GCC""... $ac_c"
-     GCC_version=`$CC --version`
-     echo "$GCC_version"
-     if test "$GCC_version" = 2.96 ; then
-           echo "Turning off optimisation for dct code"
-           V_CCOPT_H261="";
-     fi
+AC_CHECK_PROG(DOWNLOAD, wget, [wget -O -])
+AC_CHECK_PROG(DOWNLOAD, curl, [curl -s])
+
+AC_ARG_WITH(ffmpegver,       --with-ffmpegver=ffmpeg-version     specify the version of ffmpeg to download and build, ffmpegver=$withval, ffmpegver=ffmpeg)
+AC_ARG_ENABLE(ffmpeg-co,	--disable-ffmpeg-co	Enable or disable ffmpeg download, ffmpegco="no", ffmpegco="yes")
+if test "$ffmpegco" = "yes" ; then
+  if test "$gpl" = "yes" ; then
+   if test ! -d ${ffmpegver} ; then
+      echo "Checking out r20462 (and 29824 of libswscale) of ffmpeg from svn://svn.ffmpeg.org/ffmpeg/trunk..."
+      svn checkout -q -r 20462 svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
+      svn checkout -q -r 29824 svn://svn.ffmpeg.org/mplayer/trunk/libswscale  ffmpeg/libswscale
+   fi
+   patch --dry-run -sf -p0 < ffmpeg.iocom.patch >& /dev/null
+   if test $? = 0; then
+      echo "Patching ffmpeg h264 for IOCOM decode compatibility..."
+      patch -p0 < ffmpeg.iocom.patch
+   else
+      echo "ffmpeg has already been patched for IOCOM decode compatibility"
+   fi
+   echo "Configuring ffmpeg..."
+   echo "cd ffmpeg && ${V_CCLDFLAGS32} ./configure --prefix=$V_PATH/ffmpeg $ppc_conf --enable-gpl --enable-postproc; cd .."
+   cd ffmpeg && eval ${V_CCLDFLAGS32} ./configure --prefix=$V_PATH/ffmpeg $ppc_conf --enable-gpl --enable-postproc; cd ..
+   V_INCLUDE="$V_INCLUDE -Iffmpeg/include -Iffmpeg"
+   V_CODEC_LIB="$V_CODEC_LIB -Lffmpeg/lib -lavcodec -lavutil -lswscale -lpostproc "
+  else 
+   echo "ffmpeg not available without --enable-gpl"
+  fi
 fi
 
-if test -f codec/encoder-bvc.cpp ; then
-	V_OBJ="$V_OBJ codec/encoder-bvc.o codec/decoder-bvc.o"
+AC_ARG_WITH(x264ver,       --with-x264ver=x264ver-version     specify the version of x264 to download and build, x264ver=$withval, x264ver=x264-snapshot-20090708-2245)
+AC_ARG_ENABLE(x264-co,        --disable-x264-co      Enable or disable x264 download, x264co="no", x264co="yes")
+if test "$x264co" = "yes" ; then
+  if test "$gpl" = "yes" ; then
+   if test ! -d ${x264ver} ; then
+     echo "Downloading ${x264ver} of x264 from videolan.org ..."
+     ${DOWNLOAD} http://downloads.videolan.org/pub/videolan/x264/snapshots/${x264ver}.tar.bz2 | tar xjf - && ln -sf ${x264ver} x264
+   fi
+   echo "Configuring x264..."
+   cd x264 && eval ${V_CCLDFLAGS32} ./configure --prefix=$V_PATH/x264; cd ..
+   V_INCLUDE="$V_INCLUDE -Ix264/include"
+   V_CODEC_LIB="$V_CODEC_LIB -Lx264/lib -lx264"
+  else 
+   echo "x264 not available without --enable-gpl"
+  fi
+fi
+
+AC_ARG_WITH(ffmpeginc,       --with-ffmpeginc=dir     specify the prefix directory of ffmpeg header, ffmpeginc=$withval, ffmpeginc="")
+AC_ARG_WITH(ffmpeglib,       --with-ffmpeglib=dir     specify the directory of ffmpeg library, ffmpeglib=$withval, ffmpeglib="")
+
+if test "$gpl" = "yes" ; then
+  if test "$ffmpegco" != "yes"; then
+
+	if test "$ffmpeginc" != "" ; then
+	   if test ! -r $ffmpeginc/ffmpeg/avcodec.h ; then
+	        echo "Error! you need to have $ffmpeginc/ffmpeg/avcodec.h around"
+	        exit 1
+	   elif test ! -r $ffmpeginc/ffmpeg/avutil.h ; then
+	        echo "Error! you need to have $ffmpeginc/ffmpeg/avutil.h around"
+	        exit 1
+	   elif test ! -r $ffmpeginc/ffmpeg/swscale.h ; then
+	        echo "Error! you need to have $ffmpeginc/ffmpeg/swscale.h around"
+	        exit 1
+	   fi
+	   echo "checking for FFmpeg headers...yes"
+	   V_INCLUDE="$V_INCLUDE -I$ffmpeginc"
+	
+	else
+
+	   AC_CHECK_HEADER(ffmpeg/avcodec.h, [], [
+        	echo "Error! you need to have avcodec.h around."
+	        exit -1
+	   ])
+	   AC_CHECK_HEADER(ffmpeg/avutil.h, [], [
+	        echo "Error! you need to have avutil.h around."
+	        exit -1
+	   ])
+	   AC_CHECK_HEADER(ffmpeg/swscale.h, [], [
+	        echo "Error! you need to have swscale.h around."
+	        exit -1
+	   ])
+	fi
+
+	if test "$ffmpeglib" != "" ; then
+	   if test ! -r $ffmpeglib/libavcodec.a ; then
+		echo "Error! you need to have $ffmpeglib/libavcodec.a around"
+	   elif test ! -r $ffmpeglib/libavutil.a ; then
+	        echo "Error! you need to have $ffmpeglib/libavutil.a around"
+	   elif test ! -r $ffmpeglib/libswscale.a ; then
+	        echo "Error! you need to have $ffmpeglib/libswscale.a around"
+           elif test ! -r $ffmpeglib/libpostproc.a ; then
+                echo "Error! you need to have $ffmpeglib/libpostproc.a around"
+           fi
+	   
+	   V_LIB_FFMPEG="-L$ffmpeglib -lavcodec -lavutil -lswscale -lpostproc"
+	else
+	   AC_CHECK_LIB(avcodec, main, [], [
+	        echo "Error! you need to have libavcodec around."
+	        exit -1
+	   ])
+	   AC_CHECK_LIB(avutil, main, [], [
+	        echo "Error! you need to have libavutil around."
+	        exit -1
+	   ])
+	   AC_CHECK_LIB(swscale, main, [], [
+	        echo "Error! you need to have libswscale around."
+	        exit -1
+	   ])
+
+           AC_CHECK_LIB(postproc, main, [], [
+                echo "Error! you need to have libpostproc around."
+                exit -1
+           ])
+
+	   V_LIB_FFMPEG="-lavcodec -lavutil -lswscale -lpostproc"
+	fi
+  fi 
+fi
+
+AC_ARG_WITH(x264inc,       --with-x264inc=dir     specify the directory of x264 header, x264inc=$withval, x264inc="")
+AC_ARG_WITH(x264lib,       --with-x264lib=dir     specify the directory of x264 library, x264lib=$withval, x264lib="")
+if test "$gpl" = "yes" ; then
+  if test "$x264co" != "yes" ; then
+	if test "$x264inc" != "" ; then
+	   if test ! -r $x264inc/x264.h ; then
+	        echo "Error! you need to have $x264inc/x264.h around."
+	        exit 1
+	   fi
+	   V_INCLUDE="$V_INCLUDE -I$x264inc"
+	elif test ! -r /usr/local/include/x264.h -a ! -r /usr/include/x264.h ; then
+	        echo "Error! you need to have x264.h around."
+	        exit 1
+	else
+	   echo "checking for x264.h...yes"
+	fi
+
+	if test "$x264lib" != "" ; then
+	   if test ! -r $x264lib/libx264.a ; then
+	        echo "Error! you need to have $x264lib/libx264.a around"
+		exit 1
+	   fi
+	   V_LIB_X264="-L$x264lib -lx264"
+	else
+	   AC_CHECK_LIB(x264, main, [], [
+	        echo "Error! you need to have libx264 around."
+	        exit -1
+	   ])
+	   V_LIB_X264="-lx264"
+	fi
+ fi
+fi
+
+V_CPUDETECT=""
+AC_ARG_ENABLE(cpudetect, --disable-cpudetect     Enable or disable runtime cpu detection, cpudetect="no", cpudetect="yes")
+if test "$gpl" = "yes" ; then
+ if test "$cpudetect" = "yes"; then
+    echo "Using CPU runtime detection..."
+    V_CPUDETECT="-DRUNTIME_CPUDETECT"
+    V_CPUDETECT_OBJ="cpu/cpudetect.o cpu/cpuid.o"
+ fi
+ else 
+   echo "No runtime cputect without --enable-gpl"
 fi
 
 AC_SUBST(V_LIB_FFMPEG)

Modified: vic/branches/mpeg4/configure.in.tail
==============================================================================
--- vic/branches/mpeg4/configure.in.tail	(original)
+++ vic/branches/mpeg4/configure.in.tail	Fri Jan 22 15:47:10 2010
@@ -21,13 +21,13 @@
 # various linker hacks
 if test x$prefix != xNONE ; then
 	if test -d $prefix/lib64 ; then
-		LDFLAGS="-L$prefix/lib64 $LDFLAGS"
+		V_LDFLAGS="-L$prefix/lib64 $V_LDFLAGS"
 	else
-		LDFLAGS="-L$prefix/lib $LDFLAGS"
+		V_LDFLAGS="-L$prefix/lib $V_LDFLAGS"
 	fi
 else
 	if test -d ../common/src ; then
-		LDFLAGS="-L../common/src $LDFLAGS"
+		V_LDFLAGS="-L../common/src $V_LDFLAGS"
 	fi
 fi
 
@@ -44,6 +44,8 @@
 
 AC_SUBST(V_ALL)
 AC_SUBST(V_CCOPT)
+AC_SUBST(V_LDFLAGS)
+AC_SUBST(V_CCLDFLAGS32)
 AC_SUBST(V_CCOPT_H261)
 AC_SUBST(V_TAR_EXTRA)
 AC_SUBST(V_LIB)



More information about the Sumover-dev mailing list