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

[Libvir] PATCH: Disable automake portability warnings



The latest automake has a nasty habit of complaining about use of GNU Make
features such as wildcards. We use these extensively in the tests/ directory
since there are so many test datafiles, listing them explicitly is a waste
of time.

The attached patch passes the -Wno-portability flag to automake to make it
keep quiet.

NB, to do this required a bit of a re-working of the automake/autoconf
initialization stuff. Our current configure script uses AC_INIT and 
AM_INIT_AUTOMAKE in the so called 'legacy style'. 

To quote the automake  manual

[quote]
     If your `configure.ac' has:

          AC_INIT([src/foo.c])
          AM_INIT_AUTOMAKE([mumble], [1.5])

     you can modernize it as follows:

          AC_INIT([mumble], [1.5])
          AC_CONFIG_SRCDIR([src/foo.c])
          AM_INIT_AUTOMAKE
[/quote]

This re-arrangement is valid on any non-jurassic era automake & only impacts
developers running autogen.sh - not end users running the configure script
itself.

The one complication is that the version given to AC_INIT must be a literal,
but we currently used an environment variable. So m4 black-magic gets around
this problem. 

I also killed LIBVIRT_VERSION_EXTRA since it is not referenced anywhere in
the source tree.

Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 
diff -r b0ba1c637c8e configure.in
--- a/configure.in	Mon Sep 17 04:26:14 2007 -0400
+++ b/configure.in	Mon Sep 17 05:22:35 2007 -0400
@@ -1,25 +1,18 @@ dnl Process this file with autoconf to p
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT(src/libvirt.c)
+
+AC_INIT(libvirt, 0.3.2)
+AC_CONFIG_SRCDIR(src/libvirt.c)
 AM_CONFIG_HEADER(config.h)
+dnl Make automake keep quiet about wildcards & other GNUmake-isms
+AM_INIT_AUTOMAKE([-Wno-portability])
 AC_CANONICAL_HOST
 
-LIBVIRT_MAJOR_VERSION=0
-LIBVIRT_MINOR_VERSION=3
-LIBVIRT_MICRO_VERSION=2
-LIBVIRT_MICRO_VERSION_SUFFIX=
+LIBVIRT_MAJOR_VERSION=`echo $VERSION | awk -F . '{print $1}'`
+LIBVIRT_MINOR_VERSION=`echo $VERSION | awk -F . '{print $2}'`
+LIBVIRT_MICRO_VERSION=`echo $VERSION | awk -F . '{print $3}'`
 LIBVIRT_VERSION=$LIBVIRT_MAJOR_VERSION.$LIBVIRT_MINOR_VERSION.$LIBVIRT_MICRO_VERSION$LIBVIRT_MICRO_VERSION_SUFFIX
 LIBVIRT_VERSION_INFO=`expr $LIBVIRT_MAJOR_VERSION + $LIBVIRT_MINOR_VERSION`:$LIBVIRT_MICRO_VERSION:$LIBVIRT_MINOR_VERSION
-
 LIBVIRT_VERSION_NUMBER=`expr $LIBVIRT_MAJOR_VERSION \* 1000000 + $LIBVIRT_MINOR_VERSION \* 1000 + $LIBVIRT_MICRO_VERSION`
-
-if test -f CVS/Entries; then
-  extra=`grep ChangeLog CVS/Entries | grep -v LIBVIR | sed -e s\%/ChangeLog/1\.%% -e s\%/.*$%%`
-  echo extra=$extra
-  if test "$extra" != ""
-  then
-      LIBVIRT_VERSION_EXTRA="-CVS$extra"
-  fi
-fi
 
 AC_SUBST(LIBVIRT_MAJOR_VERSION)
 AC_SUBST(LIBVIRT_MINOR_VERSION)
@@ -27,14 +20,9 @@ AC_SUBST(LIBVIRT_VERSION)
 AC_SUBST(LIBVIRT_VERSION)
 AC_SUBST(LIBVIRT_VERSION_INFO)
 AC_SUBST(LIBVIRT_VERSION_NUMBER)
-AC_SUBST(LIBVIRT_VERSION_EXTRA)
 
 LIBXML_REQUIRED="2.5.0"
 GNUTLS_REQUIRED="1.2.0"
-
-VERSION=${LIBVIRT_VERSION}
-
-AM_INIT_AUTOMAKE(libvirt, $VERSION)
 
 dnl Checks for programs.
 AC_PROG_CC

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