Commit [334fb5] Maximize Restore History

* update autotools configuration

Paulo Assis Paulo Assis 2010-03-04

added bootstrap.sh
removed configure.in
changed pixmaps/Makefile.in
changed src/Makefile.am
changed src/Makefile.in
changed INSTALL
changed Makefile.in
changed config.h.in
changed configure
changed depcomp
changed install-sh
changed missing
changed mkinstalldirs
copied autogen.sh -> configure.ac
bootstrap.sh Diff Switch to side-by-side view
Loading...
configure.in
File was removed.
pixmaps/Makefile.in Diff Switch to side-by-side view
Loading...
src/Makefile.am Diff Switch to side-by-side view
Loading...
src/Makefile.in Diff Switch to side-by-side view
Loading...
INSTALL Diff Switch to side-by-side view
Loading...
Makefile.in Diff Switch to side-by-side view
Loading...
config.h.in Diff Switch to side-by-side view
Loading...
configure Diff Switch to side-by-side view
Loading...
depcomp Diff Switch to side-by-side view
Loading...
install-sh Diff Switch to side-by-side view
Loading...
missing Diff Switch to side-by-side view
Loading...
mkinstalldirs Diff Switch to side-by-side view
Loading...
autogen.sh to configure.ac
--- a/autogen.sh
+++ b/configure.ac
@@ -1,159 +1,174 @@
-#!/bin/sh
-# Run this to generate all the initial makefiles, etc.
+dnl Process this file with autoconf to produce a configure script.
 
-srcdir=`dirname $0`
-test -z "$srcdir" && srcdir=.
+# Save the original $CFLAGS so we can distinguish whether the user set those
+# in the environment, or whether autoconf added -O and -g options:
+ORIGINAL_CFLAGS="$CFLAGS"
 
-DIE=0
+dnl --------------------------------------------------------------------------
+dnl Package definitions and initialization
+dnl --------------------------------------------------------------------------
 
-if [ -n "$GNOME2_DIR" ]; then
-	ACLOCAL_FLAGS="-I $GNOME2_DIR/share/aclocal $ACLOCAL_FLAGS"
-	LD_LIBRARY_PATH="$GNOME2_DIR/lib:$LD_LIBRARY_PATH"
-	PATH="$GNOME2_DIR/bin:$PATH"
-	export PATH
-	export LD_LIBRARY_PATH
+AC_INIT(guvcview, 1.2.3, [<pj.assis@gmail.com>])
+AM_INIT_AUTOMAKE([gnu])
+AC_CONFIG_MACRO_DIR([m4])
+AM_CONFIG_HEADER(config.h)
+AM_MAINTAINER_MODE(disable)
+
+# autoconf 2.5x defaults to no cache file; we need the cache file's information
+# for building the config page.  But start with it empty to avoid confusion by
+# people who don't do a "make distclean" after applying patches.
+cache_file=config.cache
+rm -f config.cache; touch config.cache
+
+AC_PREFIX_DEFAULT(/usr/local)
+
+AC_ISC_POSIX
+AC_PROG_CC
+AC_HEADER_STDC
+
+dnl --------------------------------------------------------------------------
+dnl Debug/development/test
+dnl --------------------------------------------------------------------------
+
+dnl ---------------------------------------------------------------------------
+dnl CF_STRIP_G_OPT version: 3 updated: 2002/12/21 19:25:52
+dnl --------------
+dnl	Remove "-g" option from the compiler options
+AC_DEFUN([CF_STRIP_G_OPT],
+[$1=`echo ${$1} | sed -e 's%-g %%' -e 's%-g$%%'`])
+
+dnl ---------------------------------------------------------------------------
+dnl CF_STRIP_O_OPT version: 3 updated: 2001/02/02 19:06:08
+dnl --------------
+dnl	Remove "-O" option from the compiler options
+AC_DEFUN([CF_STRIP_O_OPT],
+[$1=`echo ${$1} | sed -e 's/-O[[1-9]]\? //' -e 's/-O[[1-9]]\?$//'`])
+
+# The comment about adding -g to $CFLAGS is unclear.  Autoconf tries to add
+# a -g flag; we remove it if the user's $CFLAGS was not set and debugging is
+# disabled.
+AC_MSG_CHECKING(if you specifically want to enable debug-code [-g])
+AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],
+	[enable debug compile w/ debugging - if \$CFLAGS is set, add -g there, too]),
+	[enable_debug=yes],
+	[enable_debug=no])
+
+AC_MSG_RESULT($enable_debug)
+
+if test "x$enable_debug" = "xyes" ; then
+	test -z "$ORIGINAL_CFLAGS" && CF_STRIP_O_OPT(CFLAGS)
+	if test "$CC" = gcc; then
+		CFLAGS="$CFLAGS -g"
+	fi
+#else
+#	CF_STRIP_G_OPT(CFLAGS)
 fi
 
-(test -f $srcdir/configure.in) || {
-    echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
-    echo " top-level package directory"
-    exit 1
-}
+AC_SUBST(CFLAGS)
 
-(autoconf --version) < /dev/null > /dev/null 2>&1 || {
-  echo
-  echo "**Error**: You must have \`autoconf' installed."
-  echo "Download the appropriate package for your distribution,"
-  echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
-  DIE=1
-}
+dnl --------------------------------------------------------------------------
+dnl Set gettext package name
+dnl --------------------------------------------------------------------------
+GETTEXT_PACKAGE=guvcview
+AC_SUBST(GETTEXT_PACKAGE)
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [guvcview])
 
-(grep "^AC_PROG_INTLTOOL" $srcdir/configure.in >/dev/null) && {
-  (intltoolize --version) < /dev/null > /dev/null 2>&1 || {
-    echo 
-    echo "**Error**: You must have \`intltool' installed."
-    echo "You can get it from:"
-    echo "  ftp://ftp.gnome.org/pub/GNOME/"
-    DIE=1
-  }
-}
+dnl --------------------------------------------------------------------------
+dnl Languages supported by guvcview.
+dnl --------------------------------------------------------------------------
+ALL_LINGUAS="pt pt_BR de es fr da tr cs ja ru nl he eu"
+AM_GLIB_GNU_GETTEXT([external])
 
-(grep "^AM_PROG_XML_I18N_TOOLS" $srcdir/configure.in >/dev/null) && {
-  (xml-i18n-toolize --version) < /dev/null > /dev/null 2>&1 || {
-    echo
-    echo "**Error**: You must have \`xml-i18n-toolize' installed."
-    echo "You can get it from:"
-    echo "  ftp://ftp.gnome.org/pub/GNOME/"
-    DIE=1
-  }
-}
+dnl --------------------------------------------------------------------------
+dnl check for dependencies
+dnl --------------------------------------------------------------------------
+PKG_CHECK_MODULES(DEPS, [gtk+-2.0 >= 2.14.0 glib-2.0 >= 2.10.0 gthread-2.0 gdk-2.0 >= 2.10.0 sdl >= 1.2.10 portaudio-2.0 libpng libavcodec libv4l2])
+AC_SUBST(DEPS_CFLAGS)
+AC_SUBST(DEPS_LIBS)
 
-(grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && {
-  (libtool --version) < /dev/null > /dev/null 2>&1 || {
-    echo
-    echo "**Error**: You must have \`libtool' installed."
-    echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
-    DIE=1
-  }
-}
+dnl --------------------------------------------------------------------------
+dnl set/unset debian menu
+dnl --------------------------------------------------------------------------
+AC_MSG_CHECKING(if you want to enable debian menu)
+AC_ARG_ENABLE(debian-menu, AS_HELP_STRING([--disable-debian-menu],
+		[disable debian menu (default: enabled)]),
+	[enable_debian_menu=no],
+	[enable_debian_menu=yes])
 
-(grep "^AM_GLIB_GNU_GETTEXT" $srcdir/configure.in >/dev/null) && {
-  (grep "sed.*POTFILES" $srcdir/configure.in) > /dev/null || \
-  (glib-gettextize --version) < /dev/null > /dev/null 2>&1 || {
-    echo
-    echo "**Error**: You must have \`glib' installed."
-    echo "You can get it from: ftp://ftp.gtk.org/pub/gtk"
-    DIE=1
-  }
-}
+AC_MSG_RESULT($enable_debian_menu)
 
-(automake --version) < /dev/null > /dev/null 2>&1 || {
-  echo
-  echo "**Error**: You must have \`automake' installed."
-  echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
-  DIE=1
-  NO_AUTOMAKE=yes
-}
+AM_CONDITIONAL(DEBIAN_MENU, test "$enable_debian_menu" = yes)
 
+dnl --------------------------------------------------------------------------
+dnl set/unset desktop file
+dnl --------------------------------------------------------------------------
+AC_MSG_CHECKING(if you want to enable desktop file)
+AC_ARG_ENABLE(desktop, AS_HELP_STRING([--disable-desktop],
+		[disable desktop file (default: enabled)]),
+	[enable_desktop=no],
+	[enable_desktop=yes])
 
-# if no automake, don't bother testing for aclocal
-test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
-  echo
-  echo "**Error**: Missing \`aclocal'.  The version of \`automake'"
-  echo "installed doesn't appear recent enough."
-  echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/"
-  DIE=1
-}
+AC_MSG_RESULT($enable_desktop)
 
-if test "$DIE" -eq 1; then
-  exit 1
+AM_CONDITIONAL(DESKTOP, test "$enable_desktop" = yes)
+
+dnl --------------------------------------------------------------------------
+dnl Check for pulseaudio
+dnl --------------------------------------------------------------------------
+AC_MSG_CHECKING(if you want to enable pulse support)
+AC_ARG_ENABLE(pulse, AS_HELP_STRING([--enable-pulse],
+		[enable pulseaudio support (default: disabled)]),
+	[enable_pulse=yes],
+	[enable_pulse=no])
+
+AC_MSG_RESULT($enable_pulse)
+
+if test $enable_pulse = yes; then
+	PKG_CHECK_MODULES(PULSE, libpulse-simple >= 0.9.15, has_pulse=yes, has_pulse=no)
+	AC_SUBST(PULSE_CFLAGS)
+	AC_SUBST(PULSE_LIBS)
+	if test "$has_pulse" = yes; then
+	  AC_DEFINE(PULSEAUDIO,1,[set to 1 if pulseaudio installed])
+	else 
+	  AC_MSG_WARN(libpulse missing... pulse support will be disabled.)
+	fi
 fi
 
-if test -z "$*"; then
-  echo "**Warning**: I am going to run \`configure' with no arguments."
-  echo "If you wish to pass any to it, please specify them on the"
-  echo \`$0\'" command line."
-  echo
+dnl --------------------------------------------------------------------------
+dnl Check for avcodec.h installation path
+dnl --------------------------------------------------------------------------
+
+dnl Check for avcodec.h directly
+dnl if all tests fail must add avcodec.h path to C_INCLUDE_PATH before running configure
+AC_CHECK_HEADER([avcodec.h], [has_avcodec_h="yes"])
+
+dnl Check old install path for avcodec.h (ffmpeg/avcodec.h)
+AC_CHECK_HEADER([ffmpeg/avcodec.h], [has_ffmpeg_dir="yes"])
+
+dnl Check new install path for avcodec.h (libavcodec/avcodec.h)
+dnl if all the checks fail we include "libavcodec/avcodec.h"
+AC_CHECK_HEADER([libavcodec/avcodec.h], [has_libavcodec_dir="yes"])
+
+if test "$has_avcodec_h" = yes; then
+  AC_DEFINE(HAS_AVCODEC_H,1,[Define if avcodec.h can be acessed directly]) 
+fi
+if test "$has_ffmpeg_dir" = yes; then
+  AC_DEFINE(HAS_FFMPEG_AVCODEC_H,1,[Define if avcodec.h installed to ffmpeg dir]) 
+fi
+if test "$has_libavcodec_dir" = yes; then
+  AC_DEFINE(HAS_LIBAVCODEC_AVCODEC_H,1,[Define if avcodec.h installed to libavcodec dir])
 fi
 
-case $CC in
-xlc )
-  am_opt=--include-deps;;
-esac
+dnl --------------------------------------------------------------------------
+dnl Check if the processor stores words with the most significant byte first 
+dnl (like Motorola and SPARC, unlike Intel and VAX).
+dnl --------------------------------------------------------------------------
+AC_C_BIGENDIAN 
 
-for coin in `find $srcdir -path $srcdir/CVS -prune -o -name configure.in -print`
-do 
-  dr=`dirname $coin`
-  if test -f $dr/NO-AUTO-GEN; then
-    echo skipping $dr -- flagged as no auto-gen
-  else
-    echo processing $dr
-    ( cd $dr
-
-      aclocalinclude="$ACLOCAL_FLAGS"
-
-      if grep "^AM_GLIB_GNU_GETTEXT" configure.in >/dev/null; then
-	echo "Creating $dr/aclocal.m4 ..."
-	test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
-	echo "Running glib-gettextize...  Ignore non-fatal messages."
-	echo "no" | glib-gettextize --force --copy
-	echo "Making $dr/aclocal.m4 writable ..."
-	test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
-      fi
-      if grep "^AC_PROG_INTLTOOL" configure.in >/dev/null; then
-        echo "Running intltoolize..."
-	intltoolize --copy --force --automake
-      fi
-      if grep "^AM_PROG_XML_I18N_TOOLS" configure.in >/dev/null; then
-        echo "Running xml-i18n-toolize..."
-	xml-i18n-toolize --copy --force --automake
-      fi
-      if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
-	if test -z "$NO_LIBTOOLIZE" ; then 
-	  echo "Running libtoolize..."
-	  libtoolize --force --copy
-	fi
-      fi
-      echo "Running aclocal $aclocalinclude ..."
-      aclocal $aclocalinclude
-      if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
-	echo "Running autoheader..."
-	autoheader
-      fi
-      echo "Running automake --gnu $am_opt ..."
-      automake --add-missing --gnu $am_opt
-      echo "Running autoconf ..."
-      autoconf
-    )
-  fi
-done
-
-conf_flags="--enable-maintainer-mode"
-
-if test x$NOCONFIGURE = x; then
-  echo Running $srcdir/configure $conf_flags "$@" ...
-  $srcdir/configure $conf_flags "$@" \
-  && echo Now type \`make\' to compile. || exit 1
-else
-  echo Skipping configure process.
-fi
+dnl Write output
+AC_OUTPUT([
+Makefile
+src/Makefile
+po/Makefile.in
+pixmaps/Makefile
+])