[opus] [opus PATCH 8/9] build: use the proper invocation of AC_INIT and AM_INIT_AUTOMAKE.

Diego Elio Pettenò flameeyes at flameeyes.eu
Mon Sep 10 01:48:26 PDT 2012


The old AC_INIT invocation is deprecated, so don't use that anymore.
To use the new one, the version calculation needs to be done ASAP, and
it can't rely on AC_MSG_* functions.

Also this allows to use the new AM_INIT_AUTOMAKE syntax, which is
deprecated starting from automake 1.13.

Signed-off-by: Diego Elio Pettenò <flameeyes at flameeyes.eu>
---
 configure.ac | 30 +++++++++++-------------------
 1 file modificato, 11 inserzioni(+), 19 rimozioni(-)

diff --git a/configure.ac b/configure.ac
index 0773c37..403d997 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,15 +1,7 @@
 dnl Process this file with autoconf to produce a configure script. -*-m4-*-
 
-AC_INIT(src/opus_encoder.c)
-
-AM_CONFIG_HEADER([config.h])
-
-dnl enable silent rules on automake 1.11 and later
-m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
-
 # Read our default version string from version.mk.
 # Please update this file for releases.
-AC_MSG_CHECKING([version.mk])
 MK_VERSION=$(awk 'BEGIN { FS = "=" }
                   /OPUS_VERSION/ { ver = $2}
                   END {
@@ -18,20 +10,13 @@ MK_VERSION=$(awk 'BEGIN { FS = "=" }
                         gsub(/ $/, "", ver);
                         print ver;
                   }' $srcdir/version.mk)
-if test -z "$MK_VERSION"; then
-  AC_MSG_RESULT([no])
-else
-  AC_MSG_RESULT([$MK_VERSION])
+if ! test -z "$MK_VERSION"; then
   OPUS_VERSION="$MK_VERSION"
 fi
 
 # Override with the git version, if available.
-AC_MSG_CHECKING([git revision])
 GIT_VERSION=$(git describe --tags --match 'v*' 2>/dev/null | sed 's/^v//')
-if test -z "$GIT_VERSION"; then
-  AC_MSG_RESULT([no])
-else
-  AC_MSG_RESULT([$GIT_VERSION])
+if ! test -z "$GIT_VERSION"; then
   OPUS_VERSION="$GIT_VERSION"
 fi
 
@@ -40,10 +25,18 @@ if test -z "$OPUS_VERSION"; then
   OPUS_VERSION="unknown"
 fi
 
-# For automake.
+dnl for AC_INIT
 PACKAGE=opus
 VERSION=$OPUS_VERSION
 
+AC_INIT(PACKAGE, VERSION)
+AM_INIT_AUTOMAKE([no-define])
+
+AM_CONFIG_HEADER([config.h])
+
+dnl enable silent rules on automake 1.11 and later
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+
 # For autoconf
 AC_SUBST(OPUS_VERSION)
 
@@ -61,7 +54,6 @@ AC_SUBST(OPUS_LT_CURRENT)
 AC_SUBST(OPUS_LT_REVISION)
 AC_SUBST(OPUS_LT_AGE)
 
-AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
 AM_MAINTAINER_MODE
 
 AC_CANONICAL_HOST
-- 
1.7.12



More information about the opus mailing list