Commit [333942] default Maximize Restore History

video: major overhaul of the autoconf and make stuff (unfinished)

carandraug carandraug 2012-11-14

added src/bootstrap
removed src/autogen.sh
removed src/configure.base
changed src/Makefile.in
copied src/Makeconf.in -> src/configure.ac
src/bootstrap Diff Switch to side-by-side view
Loading...
src/autogen.sh
File was removed.
src/configure.base
File was removed.
src/Makefile.in Diff Switch to side-by-side view
Loading...
src/Makeconf.in to src/configure.ac
--- a/src/Makeconf.in
+++ b/src/configure.ac
@@ -1,68 +1,60 @@
+dnl Process this file with autoconf to produce a configure script.
 
-## Makeconf is automatically generated from Makeconf.base and Makeconf.add
-## in the various subdirectories.  To regenerate, use ./autogen.sh to
-## create a new ./Makeconf.in, then use ./configure to generate a new
-## Makeconf.
+AC_PREREQ([2.67])
+AC_INIT([Octave-Forge video package], [1.1.0+])
 
-OCTAVE_FORGE = 1
+AC_PROG_CXX
+AC_LANG(C++)
 
-SHELL = @SHELL@
+AC_CHECK_PROG([HAVE_MKOCTFILE], [mkoctfile], [yes], [no])
+if [test $HAVE_MKOCTFILE = "no"]; then
+  AC_MSG_ERROR([mkoctfile required to install $PACKAGE_NAME])
+fi
 
-canonical_host_type = @canonical_host_type@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-bindir = @bindir@
-mandir = @mandir@
-libdir = @libdir@
-datadir = @datadir@
-infodir = @infodir@
-includedir = @includedir@
-datarootdir = @datarootdir@
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALLOCT=octinst.sh
+dnl Check for ffmpeg
+AC_CHECK_PROG([FFMPEG_CONFIG], [pkg-config], [pkg-config])
+if test -z $FFMPEG_CONFIG ; then
+  AC_MSG_WARN([`pkg-config' not found -- using default configuration])
+  FFMPEG_FLAGS="-lavcodec -lavutil -lm"
+  echo $FFMPEG_FLAGS
+else
+  FFMPEG_FLAGS=`pkg-config libavformat libavcodec libavutil libswscale --libs --cflags`
+  echo $FFMPEG_FLAGS
+fi
 
-DESTDIR =
+AC_CHECK_LIB([avformat], [av_write_frame], [],
+             [AC_MSG_ERROR([$PACKAGE_NAME requires libavformat from FFmpeg])],
+             [$FFMPEG_FLAGS])
+AC_CHECK_LIB([avcodec], [av_malloc], [],
+             [AC_MSG_ERROR([$PACKAGE_NAME requires libavcodec from FFmpeg])],
+             [$FFMPEG_FLAGS])
+AC_CHECK_LIB([swscale], [sws_scale], [],
+             [AC_MSG_ERROR([$PACKAGE_NAME requires libswscale from FFmpeg])],
+             [$FFMPEG_FLAGS])
 
-RANLIB = @RANLIB@
-STRIP = @STRIP@
-LN_S = @LN_S@
+OLD_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $FFMPEG_FLAGS"
+FFMPEG_DEFS=
+AC_SUBST(FFMPEG_DEFS)
+AC_CHECK_HEADERS(ffmpeg/avformat.h,
+  FFMPEG_DEFS="$FFMPEG_DEFS -DHAVE_FFMPEG_AVFORMAT_H", [
+  AC_CHECK_HEADERS(libavformat/avformat.h, 
+    FFMPEG_DEFS="$FFMPEG_DEFS -DHAVE_LIBAVFORMAT_AVFORMAT_H",
+    AC_MSG_ERROR([FFMpeg header files not found]))])
+AC_CHECK_HEADERS(ffmpeg/avcodec.h, 
+  FFMPEG_DEFS="$FFMPEG_DEFS -DHAVE_FFMPEG_AVCODEC_H", [
+  AC_CHECK_HEADERS(libavcodec/avcodec.h, 
+    FFMPEG_DEFS="$FFMPEG_DEFS -DHAVE_LIBAVCODEC_AVCODEC_H",
+    AC_MSG_ERROR([FFMpeg header files not found]))])
+AC_CHECK_DECL(AVSEEK_FLAG_BACKWARD, [],
+              AC_MSG_ERROR([need a newer version of FFMpeg]), [
+#if defined(HAVE_FFMPEG_AVFORMAT_H)
+#include <ffmpeg/avformat.h>
+#elif defined(HAVE_LIBAVFORMAT_AVFORMAT_H)
+#include <libavformat/avformat.h>
+#endif])
+CPPFLAGS=$OLD_CPPFLAGS
 
-AWK = @AWK@
-
-# Most octave programs will be compiled with $(MKOCTFILE).  Those which
-# cannot use mkoctfile directly can request the flags that mkoctfile 
-# would use as follows:
-#    FLAG = $(shell $(MKOCTFILE) -p FLAG)
-# The following flags are for compiling programs that are independent
-# of Octave.  How confusing.
-CC = @CC@
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@
-CPICFLAG = @CPICFLAG@
-CXX = @CXX@
-CXXFLAGS = @CXXFLAGS@
-CXXPICFLAG = @CXXPICFLAG@
-F77 = @F77@
-FFLAGS = @FFLAGS@
-FPICFLAG = @FPICFLAG@
-FFMPEG_DEFS = @FFMPEG_DEFS@
-
-OCTAVE = @OCTAVE@
-OCTAVE_VERSION = @OCTAVE_VERSION@
-MKOCTFILE = @MKOCTFILE@ -DHAVE_OCTAVE_$(ver) -v
-SHLEXT = @SHLEXT@
-
-ver = @ver@
-MPATH = @mpath@
-OPATH = @opath@
-XPATH = @xpath@
-ALTMPATH = @altmpath@
-ALTOPATH = @altopath@
-
-%.o: %.c ; $(MKOCTFILE) -c $<
-%.o: %.f ; $(MKOCTFILE) -c $<
-%.o: %.cc ; $(MKOCTFILE) -c $<
-%.oct: %.cc ; $(MKOCTFILE) $<
+AC_CONFIG_FILES([Makefile])
+AC_SUBST([FFMPEG_CONFIG])
+AC_OUTPUT