[cheese] Update configure.ac to more modern style



commit 83e5a02e9774a29c5d946ccccd261bbe38eb894e
Author: David King <amigadave amigadave com>
Date:   Thu Oct 6 21:25:22 2011 +0200

    Update configure.ac to more modern style

 configure.ac |  192 +++++++++++++++++++++++++++-------------------------------
 1 files changed, 89 insertions(+), 103 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 00163c4..b675d5a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,25 +6,26 @@ AC_INIT([cheese],
         [cheese],
         [http://projects.gnome.org/cheese/])
 
+AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_HEADERS([cheese-config.h])
 AC_CONFIG_SRCDIR([configure.ac])
 AC_CONFIG_MACRO_DIR([m4])
 
-AM_INIT_AUTOMAKE([1.11 -Wall -Wno-portability])
+AM_INIT_AUTOMAKE([1.11 -Wall -Wno-portability dist-xz no-define no-dist-gzip nostdinc subdir-objects])
 AM_MAINTAINER_MODE([enable])
 
 # Check for programs
 AC_PROG_CC
-AM_PROG_CC_STDC
-AC_HEADER_STDC
-AM_PROG_VALAC([0.11.6])
+AM_PROG_CC_C_O
+AM_PROG_VALAC([0.12.0])
 
 # Initialize libtool
 LT_PREREQ([2.2])
-LT_INIT
+LT_INIT([disable-static])
 
-CFLAGS="${CFLAGS} -Wall"
-CFLAGS+=" -DGSEAL_ENABLE"
+PKG_PROG_PKG_CONFIG([0.16])
+
+AC_SUBST([CHEESE_WFLAGS], ["-Wall -DGSEAL_ENABLE"])
 
 GNOME_MAINTAINER_MODE_DEFINES
 GNOME_COMPILE_WARNINGS([maximum])
@@ -39,10 +40,8 @@ GNOME_COMPILE_WARNINGS([maximum])
 # - If binary compatibility has been broken (eg removed or changed interfaces)
 #   change to C+1:0:0
 # - If the interface is the same as the previous version, change to C:R+1:A
-LIBCHEESE_LT_VERSION=2:2:1
-LIBCHEESE_GTK_LT_VERSION=20:4:0
-AC_SUBST(LIBCHEESE_LT_VERSION)
-AC_SUBST(LIBCHEESE_GTK_LT_VERSION)
+AC_SUBST([LIBCHEESE_LT_VERSION], [2:2:1])
+AC_SUBST([LIBCHEESE_GTK_LT_VERSION], [20:4:0])
 
 #*******************************************************************************
 # Expanded dirs
@@ -67,9 +66,8 @@ AC_SUBST(FULL_LIBEXECDIR)
 #*******************************************************************************
 # Internationalization
 #*******************************************************************************
-GETTEXT_PACKAGE=cheese
-AC_SUBST(GETTEXT_PACKAGE)
-AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name])
+AC_SUBST([GETTEXT_PACKAGE], [$PACKAGE_TARNAME])
+AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [GETTEXT package name])
 
 IT_PROG_INTLTOOL([0.40.0])
 
@@ -78,103 +76,91 @@ IT_PROG_INTLTOOL([0.40.0])
 #*******************************************************************************
 
 
-GLIB_REQUIRED=2.28.0
-GOBJECT_REQUIRED=2.28.0
-GIO_REQUIRED=2.28.0
-GTK_REQUIRED=2.99.4
-GDK_REQUIRED=2.99.4
-LIBGNOMEDESKTOP_REQUIRED=2.91.6
-GSTREAMER_REQUIRED=0.10.32
-CAIRO_REQUIRED=1.10.0
-PANGOCAIRO_REQUIRED=1.28.0
-LIBRSVG_REQUIRED=2.32.0
-CLUTTER_REQUIRED=1.6.1
-CLUTTERGTK_REQUIRED=0.91.8
-CLUTTERGST_REQUIRED=1.0.0
-GEE_REQUIRED=0.6.0
-LIBCANBERRA_REQUIRED=0.26
-
-#*******************************************************************************
-# Check for udev
-#*******************************************************************************
-
-UDEV_PKG=
-PKG_CHECK_MODULES(UDEV, gudev-1.0,
-                  [AC_DEFINE(HAVE_UDEV, 1, [Define to 1 to enable udev support])
-                  UDEV_PKG=gudev-1.0],
-                  [UDEV_PKG=])
-
-AC_MSG_CHECKING([operating system])
-case $host in
-  *-linux*)
-    AC_DEFINE(OS_LINUX, [], [Linux backend])
-    AC_SUBST(OS_LINUX)
-    AC_MSG_RESULT([Linux])
-    if test x$UDEV_PKG = "x" ; then
-            AC_MSG_ERROR([libgudev is required under Linux and not installed])
-    fi
-    ;;
-  *)
-    AC_MSG_RESULT([unsupported operating system])
-esac
-
-
-AC_CHECK_HEADER([sys/videoio.h],
-                [AC_DEFINE(USE_SYS_VIDEOIO_H, 1, define to 1 if sys/videoio.h is present)],
-                [AC_DEFINE(USE_SYS_VIDEOIO_H, 0, define to 1 if sys/videoio.h is present)], [])
-
-XTEST_LIBS=
-AC_CHECK_HEADER(X11/extensions/XTest.h, [
-  AC_CHECK_LIB(Xtst, XTestFakeKeyEvent, [
-    AC_DEFINE(HAVE_XTEST, 1, [Defined if the XTEST X extension is present])
-    XTEST_LIBS="-lX11 -lXtst"])
-])
-AC_SUBST(XTEST_LIBS)
-AM_CONDITIONAL(HAVE_XTEST, test "x$HAVE_TEST" = "xyes")
-
-PKG_CHECK_MODULES(CHEESE, \ 
-  glib-2.0 >= $GLIB_REQUIRED \
-  gio-2.0 >= $GIO_REQUIRED \
-  x11 \
-  gobject-2.0 >= $GOBJECT_REQUIRED \
-  gdk-pixbuf-2.0 \
-  gstreamer-0.10 >= $GSTREAMER_REQUIRED \
-  gstreamer-plugins-base-0.10 >= $GSTREAMER_REQUIRED \
-  cairo >= $CAIRO_REQUIRED \
-  pangocairo >= $PANGOCAIRO_REQUIRED \
-  clutter-1.0 >= $CLUTTER_REQUIRED \
-  clutter-gst-1.0 >= $CLUTTERGST_REQUIRED \
-  mx-1.0 \
-  $UDEV_PKG
-  )
-AC_SUBST(CHEESE_CFLAGS)
-AC_SUBST(CHEESE_LIBS)
+GLIB_REQUIRED="glib-2.0 >= 2.28.0"
+GOBJECT_REQUIRED="gobject-2.0 >= 2.28.0"
+GIO_REQUIRED="gio-2.0 >= 2.28.0"
+GTK_REQUIRED="gtk+-3.0 >= 2.99.4"
+GDK_REQUIRED="gdk-3.0 >= 2.99.4"
+GDK_PIXBUF_REQUIRED="gdk-pixbuf-2.0"
+LIBGNOMEDESKTOP_REQUIRED="gnome-desktop-3.0 >= 2.91.6"
+GSTREAMER_VERSION=0.10.32
+GSTREAMER_REQUIRED="gstreamer-plugins-base-0.10 >= $GSTREAMER_VERSION gstreamer-0.10 >= $GSTREAMER_VERSION"
+CAIRO_REQUIRED="cairo >= 1.10.0"
+PANGOCAIRO_REQUIRED="pangocairo >= 1.28.0"
+LIBRSVG_REQUIRED="librsvg-2.0 >= 2.32.0"
+CLUTTER_REQUIRED="clutter-1.0 >= 1.6.1"
+CLUTTERGTK_REQUIRED="clutter-gtk-1.0 >= 0.91.8"
+CLUTTERGST_REQUIRED="clutter-gst-1.0 >= 1.0.0"
+GEE_REQUIRED="gee-1.0 >= 0.6.0"
+LIBCANBERRA_REQUIRED="libcanberra-gtk3 >= 0.26"
+MX_REQUIRED="mx-1.0"
+X11_REQUIRED="x11"
+GNOME_VIDEO_EFFECTS_REQUIRED="gnome-video-effects"
+
+# Libtool requires this, but it is only expanded once anyway.
+AC_CANONICAL_HOST
+
+AC_MSG_CHECKING([host operating system])
+AS_CASE([$host_os],
+  [*linux-*], [AC_MSG_RESULT([Linux])
+    UDEV_REQUIRED="gudev-1.0"],
+  [AC_MSG_RESULT([unsupported operating system])])
+
+AC_CHECK_HEADERS([sys/videoio.h])
+
+AC_CHECK_HEADER([X11/extensions/XTest.h],
+  [AC_CHECK_LIB([Xtst], [XTestFakeKeyEvent],
+    [AC_DEFINE([HAVE_XTEST], [1], [Defined if the XTEST X extension is present])
+     AC_SUBST([XTEST_LIBS], ["-lX11 -lXtst"])])
+  ])
+AM_CONDITIONAL([HAVE_XTEST], test "x$HAVE_TEST" = "xyes")
+
+PKG_CHECK_MODULES([CHEESE],
+  [$GLIB_REQUIRED
+  $GIO_REQUIRED
+  $X11_REQUIRED
+  $GOBJECT_REQUIRED
+  $GDK_PIXBUF_REQUIRED
+  $GSTREAMER_REQUIRED
+  $CAIRO_REQUIRED
+  $PANGOCAIRO_REQUIRED
+  $CLUTTER_REQUIRED
+  $CLUTTERGST_REQUIRED
+  $MX_REQUIRED
+  $UDEV_REQUIRED])
 CHEESE_LIBS="$CHEESE_LIBS -lgstinterfaces-0.10"
 
-PKG_CHECK_MODULES(CHEESE_GTK, \ 
-  gio-2.0 >= $GIO_REQUIRED \
-  gtk+-3.0 >= $GTK_REQUIRED \
-  gdk-3.0 >= $GDK_REQUIRED \
-  gnome-desktop-3.0 >= $LIBGNOMEDESKTOP_REQUIRED \
-  librsvg-2.0 >= $LIBRSVG_REQUIRED \
-  clutter-gtk-1.0 >= $CLUTTERGTK_REQUIRED \
-  gee-1.0 >= $GEE_REQUIRED \
-  libcanberra-gtk3 >= $LIBCANBERRA_REQUIRED \
-  $UDEV_PKG \
-  gnome-video-effects
-  )
-AC_SUBST(CHEESE_GTK_CFLAGS)
-AC_SUBST(CHEESE_GTK_LIBS)
-
+PKG_CHECK_MODULES([CHEESE_GTK],
+  [$GIO_REQUIRED
+   $GTK_REQUIRED
+   $GDK_REQUIRED
+   $LIBGNOMEDESKTOP_REQUIRED
+   $LIBRSVG_REQUIRED
+   $CLUTTERGTK_REQUIRED
+   $GEE_REQUIRED
+   $LIBCANBERRA_REQUIRED
+   $UDEV_REQUIRED
+   $GNOME_VIDEO_EFFECTS_REQUIRED])
+
+AC_MSG_CHECKING([for glib-genmarshal script])
 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
+AS_IF([test "x$GLIB_GENMARSHAL" = "x"],
+  [AC_MSG_ERROR([glib-genmarshal not listed in glib-2.0 pkg-config file])],
+  [AC_SUBST([GLIB_GENMARSHAL])
+    AC_MSG_RESULT([$GLIB_GENMARSHAL])])
+
+AC_MSG_CHECKING([for glib-mkenums script])
 GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
-AC_SUBST(GLIB_GENMARSHAL)
-AC_SUBST(GLIB_MKENUMS)
+AS_IF([test "x$GLIB_MKENUMS" = "x"],
+  [AC_MSG_ERROR([glib-mkenums not listed in glib-2.0 pkg-config file])],
+  [AC_SUBST([GLIB_MKENUMS])
+   AC_MSG_RESULT([$GLIB_MKENUMS])])
+
 
 GOBJECT_INTROSPECTION_CHECK([0.6.7])
 
 # API documentation
-GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
+GTK_DOC_CHECK([1.14], [--flavour no-tmpl])
 
 # User manual
 GNOME_DOC_INIT([0.20])



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]