[notification-daemon] Modernize autotools configuration



commit d3a066db001114c3901d7da1aa237bce369eb640
Author: Javier Jardón <jjardon gnome org>
Date:   Thu Feb 4 01:32:25 2010 +0100

    Modernize autotools configuration
    
    New requirements:
    autoconf >= 2.63
    automake >= 1.10
    libtool >= 2.2.6
    intltool >= 0.40.0
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=608858

 Makefile.am         |    3 ++
 autogen.sh          |    3 +-
 configure.ac        |   94 +++++++++++++++++++++++++++------------------------
 src/daemon/daemon.c |    2 +-
 4 files changed, 55 insertions(+), 47 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 59a4b8e..969b5c5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,8 @@
 SUBDIRS = data po src
 
+# Point to our macro directory and pick up user flags from the environment
+ACLOCAL_AMFLAGS  = -I macros ${ACLOCAL_FLAGS}
+
 EXTRA_DIST = \
 	AUTHORS NEWS INSTALL COPYING README \
 	ChangeLog \
diff --git a/autogen.sh b/autogen.sh
index 9720758..0a403f5 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -5,7 +5,6 @@ srcdir=`dirname $0`
 test -z "$srcdir" && srcdir=.
 
 PKG_NAME="Notification Daemon"
-REQUIRED_AUTOMAKE_VERSION=1.9
 
 (test -f $srcdir/configure.ac \
   && test -d $srcdir/src) || {
@@ -16,7 +15,7 @@ REQUIRED_AUTOMAKE_VERSION=1.9
 
 
 which gnome-autogen.sh || {
-    echo "You need to install gnome-common from the GNOME CVS"
+    echo "You need to install gnome-common"
     exit 1
 }
 
diff --git a/configure.ac b/configure.ac
index 2dd6487..60e4a47 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,11 +3,14 @@ dnl Process this file with autoconf to create configure.
 dnl ################################################################
 dnl # Initialize autoconf
 dnl ################################################################
-AC_INIT([notification-daemon], [0.4.2], [galago-devel lists freedesktop org])
-AC_PREREQ(2.50)
-AC_CONFIG_SRCDIR(config.h.in)
-AC_COPYRIGHT([Copyright 2006 Christian Hammond])
+AC_INIT([notification-daemon],[0.4.2],[https://bugzilla.gnome.org/enter_bug.cgi?product=notification-daemon],[notification-daemon])
+AC_PREREQ(2.63)
+
+AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_SRCDIR([config.h.in])
+AC_CONFIG_MACRO_DIR([macros])
 
+AC_COPYRIGHT([Copyright 2006 Christian Hammond])
 
 dnl ################################################################
 dnl # Version information
@@ -40,41 +43,45 @@ AC_DEFINE_UNQUOTED(NOTIFICATION_DAEMON_VERSION, "$NOTIFICATION_DAEMON_VERSION",
 dnl ################################################################
 dnl # Initialize automake
 dnl ################################################################
-VERSION=$NOTIFICATION_DAEMON_VERSION
-PACKAGE=notification-daemon
-
-AM_INIT_AUTOMAKE([1.9 no-dist-gzip dist-bzip2])
-
+AM_INIT_AUTOMAKE([1.10 no-dist-gzip dist-bzip2])
+AM_MAINTAINER_MODE
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
 dnl ################################################################
-dnl # Specify a header configuration file
-dnl ################################################################
-AM_CONFIG_HEADER(config.h)
-
-dnl ################################################################
 dnl # Check for some standard stuff.
 dnl ################################################################
+# Checks for programs
 AC_PROG_CC
-#AC_ARG_PROGRAM
 AC_PROG_CPP
 AC_PROG_MAKE_SET
 AC_PROG_LN_S
 AC_PROG_INSTALL
 
-AC_C_CONST
+# Checks for typedefs, structures, and compiler characteristics.
 AC_TYPE_SIZE_T
-AC_EXEEXT
 
-AM_PROG_LIBTOOL
-IT_PROG_INTLTOOL([0.35.0])
+dnl ---------------------------------------------------------------------------
+dnl Initialize Libtool
+dnl ---------------------------------------------------------------------------
+LT_PREREQ([2.2.6])
+LT_INIT
 
-REQ_GTK_VERSION=2.18.0
 
 dnl ---------------------------------------------------------------------------
-dnl Requirements for the themes
+dnl i18n stuff
 dnl ---------------------------------------------------------------------------
+IT_PROG_INTLTOOL([0.40.0])
+
+AC_SUBST([GETTEXT_PACKAGE], [notification-daemon])
+AM_GNU_GETTEXT_VERSION([0.11])
+AM_GLIB_GNU_GETTEXT
+AC_DEFINE([GETTEXT_PACKAGE], [PACKAGE_TARNAME], [Define to the gettext package name.])
 
+
+dnl ---------------------------------------------------------------------------
+dnl Requirements for the themes
+dnl ---------------------------------------------------------------------------
+REQ_GTK_VERSION=2.18.0
 PKG_CHECK_MODULES(THEME,
   gtk+-2.0 >= $REQ_GTK_VERSION
 )
@@ -84,12 +91,6 @@ AC_SUBST(THEME_LIBS)
 dnl ---------------------------------------------------------------------------
 dnl Requirements for the daemon
 dnl ---------------------------------------------------------------------------
-
-GETTEXT_PACKAGE=notification-daemon
-AC_SUBST(GETTEXT_PACKAGE)
-AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext package])
-AM_GLIB_GNU_GETTEXT
-
 REQ_GLIB_VERSION=$REQ_GTK_VERSION
 REQ_DBUS_VERSION=0.36
 REQ_LIBCANBERRA_GTK_VERSION=0.4
@@ -110,7 +111,6 @@ AC_SUBST(NOTIFICATION_DAEMON_LIBS)
 dnl ---------------------------------------------------------------------------
 dnl Requirements for the setup tool
 dnl ---------------------------------------------------------------------------
-
 PKG_CHECK_MODULES(NOTIFICATION_CAPPLET, glib-2.0 >= $REQ_GLIB_VERSION gtk+-2.0 >= $REQ_GTK_VERSION gconf-2.0 libnotify dbus-1 dbus-glib-1)
 AC_SUBST(NOTIFICATION_CAPPLET_CFLAGS)
 AC_SUBST(NOTIFICATION_CAPPLET_LIBS)
@@ -122,7 +122,7 @@ gdk_modules="
 PKG_CHECK_MODULES(GDK, $gdk_modules, have_gdk=yes,
 [
 	have_gdk=no
-	AC_WARN("Some test apps will not be built")
+	AC_MSG_WARN("Some test apps will not be built")
 ])
 
 AM_CONDITIONAL(HAVE_GDK, test "x$have_gdk" = "xyes")
@@ -179,8 +179,12 @@ AC_SUBST(DBUS_SERVICES_DIR)
 AC_DEFINE_UNQUOTED(DBUS_SYSTEMD_DIR, "$DBUS_SYS_DIR", [Where system.d dir for DBUS is])
 AC_DEFINE_UNQUOTED(DBUS_SERVICES_DIR, "$DBUS_SERVICES_DIR", [Where services dir for DBUS is])
 
-
-# Turn on the additional warnings last
+dnl ---------------------------------------------------------------------------
+dnl Turn on the additional warnings last
+dnl ---------------------------------------------------------------------------
+GNOME_COMPILE_WARNINGS([maximum])
+GNOME_CXX_WARNINGS([yes])
+GNOME_MAINTAINER_MODE_DEFINES
 
 AC_ARG_ENABLE(more-warnings,
               AS_HELP_STRING([--enable-more-warnings],
@@ -195,22 +199,20 @@ AC_ARG_ENABLE(more-warnings,
 AC_MSG_CHECKING(for more warnings)
 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
         AC_MSG_RESULT(yes)
-        CFLAGS="\
-        -Wall \
-        -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
-        -Wnested-externs -Wpointer-arith \
+        WARNINGCFLAGS="\
+        -Wchar-subscripts -Wmissing-declarations \
         -Wcast-align -Wsign-compare -Wp,-D_FORTIFY_SOURCE=2 \
-        $CFLAGS"
+        $WARNINGCFLAGS"
 
-        for option in -Wno-strict-aliasing -Wno-sign-compare; do
-                SAVE_CFLAGS="$CFLAGS"
-                CFLAGS="$CFLAGS $option"
+        for option in -Wno-strict-aliasing; do
+                SAVE_CFLAGS="$WARNINGCFLAGS"
+                WARNINGCFLAGS="$WARNINGCFLAGS $option"
                 AC_MSG_CHECKING([whether gcc understands $option])
                 AC_TRY_COMPILE([], [],
                         has_option=yes,
                         has_option=no,)
                 if test $has_option = no; then
-                        CFLAGS="$SAVE_CFLAGS"
+                        WARNINGCFLAGS="$SAVE_CFLAGS"
                 fi
                 AC_MSG_RESULT($has_option)
                 unset has_option
@@ -221,7 +223,11 @@ else
         AC_MSG_RESULT(no)
 fi
 
-AC_SUBST(CFLAGS)
+AM_CFLAGS="$AM_CFLAGS $WARN_CFLAGS $WARNINGCFLAGS"
+AM_CXXFLAGS="$AM_CXXFLAGS $WARN_CXXFLAGS"
+
+AC_SUBST([AM_CFLAGS])
+AC_SUBST([AM_CXXFLAGS])
 
 AC_CONFIG_FILES([
 Makefile
@@ -239,15 +245,15 @@ src/themes/standard/Makefile
 AC_OUTPUT
 
 echo "
-                    $PACKAGE $VERSION
-                    ========================
+                    $PACKAGE_NAME $PACKAGE_VERSION
+                    =========================
 
 	prefix:                   ${prefix}
 	exec_prefix:              ${exec_prefix}
         bindir:                   ${bindir}
         datadir:                  ${datadir}
 	source code location:	  ${srcdir}
-	cflags:		          ${CFLAGS}
+	cflags:		          ${AM_CFLAGS}
 
         dbus-1 system.d           $DBUS_SYS_DIR
         dbus-1 services           $DBUS_SERVICES_DIR
diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c
index e24a915..3bb78bb 100644
--- a/src/daemon/daemon.c
+++ b/src/daemon/daemon.c
@@ -1499,7 +1499,7 @@ notify_daemon_get_server_information (NotifyDaemon *daemon,
 {
         *out_name = g_strdup ("Notification Daemon");
         *out_vendor = g_strdup ("GNOME");
-        *out_version = g_strdup (VERSION);
+        *out_version = g_strdup (PACKAGE_VERSION);
         *out_spec_ver = g_strdup ("1.1");
 
         return TRUE;



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