[libepc] Modernise autotools configuration



commit 3073da498e7e0c4eb8fc34315d50be5a6db41765
Author: David King <davidk openismus com>
Date:   Tue Mar 23 11:33:42 2010 +0100

    Modernise autotools configuration
    
    * configure.ac: Require autoconf 2.63 and automake 1.10.3. Change bug
    report link to bugzilla product. Add no-define option to automake
    configuration. Do not use GNOME_COMMON_INIT. Reorder to the â??standard
    configure.ac layoutâ?? as per the autoconf manual. Check deprecation
    flags with GNOME_MAINTAINER_MODE_DEFINES, to avoid deprecations
    affecting tarball releases. Enable warnings with
    GNOME_COMPILE_WARNINGS. Require libtool 2.2.6 for much faster builds.
    Check for uint16 type. Reduce the duplication of CFLAGS and LDFLAGS
    by checking for the existence of gio and libsoup separately to
    pkg-config invocation. Check for existence of glib-2.0 before
    attempting to use the pkg-config variables.
    
    * Makefile.am: Adapt to configure.ac changes. Do not use EXTRA_DIST.
    Distribute examples/publisher.ui.
    
    * examples/publisher.glade: Remove unused file.
    
    * libepc-1.0.pc.in:
    * libepc-ui-1.0.pc.in: Use modern autoconf variable names.
    
    * INSTALL: Remove generated file from repository.
    
    * .gitignore: Add INSTALL.
    
    * m4/.gitignore: Placeholder file so that git creates this â??empty
    directoryâ??.
    
    * autogen.sh: Remove autoconf version check.

 .gitignore               |    1 +
 ChangeLog                |   33 ++++
 INSTALL                  |  236 -----------------------------
 Makefile.am              |   14 +-
 autogen.sh               |    1 -
 configure.ac             |  115 ++++++++-------
 examples/publisher.glade |  367 ----------------------------------------------
 libepc-1.0.pc.in         |    2 +-
 libepc-ui-1.0.pc.in      |    2 +-
 m4/.gitignore            |    2 +
 10 files changed, 106 insertions(+), 667 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 20b7c80..272dbef 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
 .deps
 .libs
+INSTALL
 Makefile
 Makefile.in
 Makefile.local
diff --git a/ChangeLog b/ChangeLog
index cfc1931..f9b81dd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,38 @@
 2010-03-23  David King  <davidk openismus com>
 
+	Modernise autotools configuration
+
+	* configure.ac: Require autoconf 2.63 and automake 1.10.3. Change bug
+	report link to bugzilla product. Add no-define option to automake
+	configuration. Do not use GNOME_COMMON_INIT. Reorder to the â??standard
+	configure.ac layoutâ?? as per the autoconf manual. Check deprecation
+	flags with GNOME_MAINTAINER_MODE_DEFINES, to avoid deprecations
+	affecting tarball releases. Enable warnings with
+	GNOME_COMPILE_WARNINGS. Require libtool 2.2.6 for much faster builds.
+	Check for uint16 type. Reduce the duplication of CFLAGS and LDFLAGS
+	by checking for the existence of gio and libsoup separately to
+	pkg-config invocation. Check for existence of glib-2.0 before
+	attempting to use the pkg-config variables.
+
+	* Makefile.am: Adapt to configure.ac changes. Do not use EXTRA_DIST.
+	Distribute examples/publisher.ui.
+
+	* examples/publisher.glade: Remove unused file.
+
+	* libepc-1.0.pc.in:
+	* libepc-ui-1.0.pc.in: Use modern autoconf variable names.
+
+	* INSTALL: Remove generated file from repository.
+
+	* .gitignore: Add INSTALL.
+
+	* m4/.gitignore: Placeholder file so that git creates this â??empty
+	directoryâ??.
+
+	* autogen.sh: Remove autoconf version check.
+
+2010-03-23  David King  <davidk openismus com>
+
 	Drop GTK+ requirement back to 2.10
 
 	* libepc-ui/password-dialog.c: Wrap gtk_widget_get_visible() call in
diff --git a/Makefile.am b/Makefile.am
index a7326f8..cf6e7e4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,7 +4,7 @@
 
 DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
 TESTS_ENVIRONMENT = $(top_srcdir)/tests/test-runner.sh
-ACLOCAL_AMFLAGS = -I m4
+ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
 
 # ============================
 # -- DIRECTORY DECLARATIONS --
@@ -79,11 +79,13 @@ libepc_ui_include_HEADERS = \
 pkgconfig_DATA = \
 	libepc-1.0.pc \
 	libepc-ui-1.0.pc
-EXTRA_DIST = \
+dist_noinst_SCRIPTS = \
+	$(srcdir)/tests/test-runner.sh
+dist_noinst_DATA = \
+	$(srcdir)/examples/publisher.ui
 	$(srcdir)/gtk-doc.make \
 	$(gtkdoc_srcdir)/libepc-1.0-docs.xml \
 	$(gtkdoc_srcdir)/libepc-1.0-sections.txt \
-	$(srcdir)/tests/test-runner.sh \
 	$(srcdir)/intltool-extract.in \
 	$(srcdir)/intltool-merge.in \
 	$(srcdir)/intltool-update.in
@@ -127,10 +129,8 @@ tests_libepc_tests_la_SOURCES = \
 # ====================
 
 AM_CFLAGS = \
-	-Wall \
-	-DG_DISABLE_DEPRECATED=1 \
-	-DGDK_DISABLE_DEPRECATED=1 \
-	-DGTK_DISABLE_DEPRECATED=1 \
+	$(WARN_CFLAGS) \
+	$(DISABLE_DEPRECATED) \
 	-DLOCALEDIR=\"$(localedir)\" \
 	-DGETTEXT_PACKAGE=\"@GETTEXT_PACKAGE \"
 
diff --git a/autogen.sh b/autogen.sh
index ea65f99..12e48dd 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -4,7 +4,6 @@ srcdir=`dirname $0`
 [ -z "$srcdir" ] && srcdir=.
 
 PKG_NAME=libepc
-REQUIRED_AUTOMAKE_VERSION=1.10
 
 if [ ! -f "$srcdir/libepc/publisher.c" ]; then
  echo "$srcdir doesn't look like source directory for $PKG_NAME" >&2
diff --git a/configure.ac b/configure.ac
index e87be7c..8b76521 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,11 @@
-AC_INIT([libepc], [0.3.10], [mathias openismus com])
-AM_INIT_AUTOMAKE([-Wall dist-bzip2 subdir-objects])
-
-GNOME_COMMON_INIT
+AC_PREREQ([2.63])
+AC_INIT([libepc], [0.3.10], [https://bugzilla.gnome.org/enter_bug.cgi?product=libepc], [libepc], [http://live.gnome.org/libepc])
+AM_INIT_AUTOMAKE([1.10.3 -Wall dist-bzip2 no-define subdir-objects])
+AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_MACRO_DIR([m4])
+AC_ARG_VAR([ACLOCAL_FLAGS], [aclocal flags, e.g. -I <macro dir>])
+GNOME_COMPILE_WARNINGS([maximum])
+GNOME_MAINTAINER_MODE_DEFINES
 
 dnl LT_VERSION_INFO=CURRENT:REVISION:AGE
 dnl
@@ -19,26 +23,52 @@ dnl
 LT_VERSION_INFO="2:0:0"
 AC_SUBST(LT_VERSION_INFO)
 
-AC_CONFIG_HEADER([config.h])
-AC_CONFIG_FILES([
-  Makefile
-  po/Makefile.in
-  docs/reference/libepc/Makefile
-  libepc-1.0.pc libepc-ui-1.0.pc
-])
-
 GETTEXT_PACKAGE=libepc
 AC_SUBST([GETTEXT_PACKAGE])
 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[The gettext domain name])
 
 AC_PROG_CC
 AM_PROG_CC_C_O
-AM_PROG_LIBTOOL
+LT_PREREQ([2.2.6])
+LT_INIT([dlopen disable-static])
 IT_PROG_INTLTOOL([0.35.0])
 GTK_DOC_CHECK([1.4])
 AM_GLIB_GNU_GETTEXT
-
 PKG_PROG_PKG_CONFIG([0.14])
+
+AC_MSG_CHECKING([for glib-genmarshal and glib-mkenums scripts])
+PKG_CHECK_EXISTS([glib-2.0],
+                 [GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
+                  GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
+                  AC_MSG_RESULT([yes])],
+                 [AC_MSG_ERROR([glib-2.0 not found])])
+
+AC_SUBST(GLIB_GENMARSHAL)
+AC_SUBST(GLIB_MKENUMS)
+
+LIBSOUP_24="libsoup-2.4 >= 2.3"
+LIBSOUP_22="libsoup-2.2 >= 2.2"
+AC_MSG_CHECKING([for a suitable API version of libsoup])
+PKG_CHECK_EXISTS([$LIBSOUP_24],
+                 [LIBSOUP_API=2.4
+                  LIBSOUP=$LIBSOUP_24],
+                 [PKG_CHECK_EXISTS([$LIBSOUP_22],
+                                   [LIBSOUP_API=2.2
+                                    LIBSOUP=$LIBSOUP_22
+                                    AC_DEFINE([HAVE_LIBSOUP22],
+                                              [1],
+                                              [Define to 1 if you still want to use libsoup 2.2.])],
+                                   [AC_MSG_ERROR([no suitable libsoup API version found])])])
+AC_MSG_RESULT([$LIBSOUP_API])
+AC_SUBST(LIBSOUP_API)
+
+GIO_REQUIREMENT="gio-2.0 >= 2.15.1"
+AC_MSG_CHECKING([for gio])
+PKG_CHECK_EXISTS([$GIO_REQUIREMENT],
+                 [AC_MSG_RESULT([yes])
+                  GIO=$GIO_REQUIREMENT],
+                 [AC_MSG_RESULT([no])])
+
 PKG_CHECK_MODULES(AVAHI_UI,  [avahi-ui     >= 0.6])
 PKG_CHECK_MODULES(LIBEPC,    [avahi-client >= 0.6
                               avahi-glib   >= 0.6
@@ -47,32 +77,21 @@ PKG_CHECK_MODULES(LIBEPC,    [avahi-client >= 0.6
                               gmodule-2.0  >= 2.0
                               gobject-2.0  >= 2.4
                               gnutls       >= 1.4
-                              uuid         >= 1.36])
+                              uuid         >= 1.36
+                              $LIBSOUP
+                              $GIO])
 PKG_CHECK_MODULES(LIBEPC_UI, [gtk+-2.0     >= 2.10])
 
-PKG_CHECK_MODULES(LIBSOUP,   [libsoup-2.4  >= 2.3],
-                             [LIBSOUP_API=2.4],[
-PKG_CHECK_MODULES(LIBSOUP,   [libsoup-2.2  >= 2.2],
-                             [LIBSOUP_API=2.2])])
-
-PKG_CHECK_MODULES(GIO,       [gio-2.0      >= 2.15.1],
-                             [have_gio=yes],
-                             [have_gio=no])
-
-if test "2.2" == "$LIBSOUP_API"
-then
-  AC_DEFINE([HAVE_LIBSOUP22], [1], [Define to 1 if you still want to use libsoup 2.2.])
-fi
-
-if test "yes" == "$have_gio"
-then
-  LIBEPC_CFLAGS="$LIBEPC_CFLAGS $GIO_CFLAGS"
-  LIBEPC_LIBS="$LIBEPC_LIBS $GIO_LIBS"
-fi
+AC_SUBST(AVAHI_UI_CFLAGS)
+AC_SUBST(AVAHI_UI_LIBS)
 
-LIBEPC_CFLAGS="$LIBEPC_CFLAGS $LIBSOUP_CFLAGS"
-LIBEPC_LIBS="$LIBEPC_LIBS $LIBSOUP_LIBS"
+AC_SUBST(LIBEPC_CFLAGS)
+AC_SUBST(LIBEPC_LIBS)
 
+#AC_CHECK_HEADERS([fcntl.h sys/ioctl.h sys/socket.h])
+AC_TYPE_UINT16_T
+ 
+#AC_CHECK_FUNCS([memset setlocale socket strchr])
 AC_CHECK_LIB([avahi-ui],
              [aui_service_dialog_set_service_type_name],
              [AC_DEFINE([HAVE_SET_SERVICE_TYPE_NAME], [1],
@@ -80,23 +99,11 @@ AC_CHECK_LIB([avahi-ui],
              [],
              [${AVAHI_UI_LIBS}])
 
-GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
-GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
-
-AC_SUBST(AVAHI_UI_CFLAGS)
-AC_SUBST(AVAHI_UI_LIBS)
-
-AC_SUBST(LIBEPC_CFLAGS)
-AC_SUBST(LIBEPC_LIBS)
-
-AC_SUBST(GLIB_GENMARSHAL)
-AC_SUBST(GLIB_MKENUMS)
-
-AC_SUBST(LIBSOUP_API)
+AC_CONFIG_FILES([
+  Makefile
+  po/Makefile.in
+  docs/reference/libepc/Makefile
+  libepc-1.0.pc libepc-ui-1.0.pc
+])
 
 AC_OUTPUT
-
-AC_MSG_NOTICE([============================================])
-AC_MSG_NOTICE([  libsoup API ........................ $LIBSOUP_API])
-AC_MSG_NOTICE([  gio support ........................ $have_gio])
-AC_MSG_NOTICE([============================================])
diff --git a/libepc-1.0.pc.in b/libepc-1.0.pc.in
index 997bf31..2b7aca1 100644
--- a/libepc-1.0.pc.in
+++ b/libepc-1.0.pc.in
@@ -5,7 +5,7 @@ includedir= includedir@
 
 Name: Easy Publish and Consume Library
 Description: a library to easily publish and consume values on networks
-Version: @VERSION@
+Version: @PACKAGE_VERSION@
 Requires: avahi-client avahi-glib libsoup- LIBSOUP_API@
 Cflags: -I${includedir}/libepc-1.0
 Libs: -L${libdir} -lepc-1.0
diff --git a/libepc-ui-1.0.pc.in b/libepc-ui-1.0.pc.in
index 396f6f2..9a80d84 100644
--- a/libepc-ui-1.0.pc.in
+++ b/libepc-ui-1.0.pc.in
@@ -5,7 +5,7 @@ includedir= includedir@
 
 Name: Easy Publish and Consume Widgets
 Description: widgets for the Easy Publish and Consume Library
-Version: @VERSION@
+Version: @PACKAGE_VERSION@
 Requires: libepc-1.0 gtk+-2.0
 Cflags: -I${includedir}/libepc-ui-1.0
 Libs: -L${libdir} -lepc-ui-1.0
diff --git a/m4/.gitignore b/m4/.gitignore
new file mode 100644
index 0000000..d6b7ef3
--- /dev/null
+++ b/m4/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore



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