From 101362218645db3f0fbb55e1e6ea80c4bd70f97d Mon Sep 17 00:00:00 2001 From: Emilio Pozuelo Monfort Date: Mon, 30 Jul 2012 15:24:00 +0100 Subject: [PATCH] Fix bashisms in gnome-autogen.sh, bug 588020 --- macros2/gnome-autogen.sh | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/macros2/gnome-autogen.sh b/macros2/gnome-autogen.sh index 3179c3f..960046f 100644 --- a/macros2/gnome-autogen.sh +++ b/macros2/gnome-autogen.sh @@ -2,24 +2,24 @@ # Run this to generate all the initial makefiles, etc. #name of package -PKG_NAME=${PKG_NAME:-Package} -srcdir=${srcdir:-.} +test "$PKG_NAME" || PKG_NAME=Package +test "$srcdir" || srcdir=. # default version requirements ... -REQUIRED_AUTOCONF_VERSION=${REQUIRED_AUTOCONF_VERSION:-2.53} -REQUIRED_AUTOMAKE_VERSION=${REQUIRED_AUTOMAKE_VERSION:-1.9} -REQUIRED_LIBTOOL_VERSION=${REQUIRED_LIBTOOL_VERSION:-1.4.3} -REQUIRED_GETTEXT_VERSION=${REQUIRED_GETTEXT_VERSION:-0.10.40} -REQUIRED_GLIB_GETTEXT_VERSION=${REQUIRED_GLIB_GETTEXT_VERSION:-2.2.0} -REQUIRED_INTLTOOL_VERSION=${REQUIRED_INTLTOOL_VERSION:-0.25} -REQUIRED_PKG_CONFIG_VERSION=${REQUIRED_PKG_CONFIG_VERSION:-0.14.0} -REQUIRED_GTK_DOC_VERSION=${REQUIRED_GTK_DOC_VERSION:-1.0} -REQUIRED_DOC_COMMON_VERSION=${REQUIRED_DOC_COMMON_VERSION:-2.3.0} -REQUIRED_GNOME_DOC_UTILS_VERSION=${REQUIRED_GNOME_DOC_UTILS_VERSION:-0.4.2} +test "$REQUIRED_AUTOCONF_VERSION" || REQUIRED_AUTOCONF_VERSION=2.53 +test "$REQUIRED_AUTOMAKE_VERSION" || REQUIRED_AUTOMAKE_VERSION=1.9 +test "$REQUIRED_LIBTOOL_VERSION" || REQUIRED_LIBTOOL_VERSION=1.4.3 +test "$REQUIRED_GETTEXT_VERSION" || REQUIRED_GETTEXT_VERSION=0.10.40 +test "$REQUIRED_GLIB_GETTEXT_VERSION" || REQUIRED_GLIB_GETTEXT_VERSION=2.2.0 +test "$REQUIRED_INTLTOOL_VERSION" || REQUIRED_INTLTOOL_VERSION=0.25 +test "$REQUIRED_PKG_CONFIG_VERSION" || REQUIRED_PKG_CONFIG_VERSION=0.14.0 +test "$REQUIRED_GTK_DOC_VERSION" || REQUIRED_GTK_DOC_VERSION=1.0 +test "$REQUIRED_DOC_COMMON_VERSION" || REQUIRED_DOC_COMMON_VERSION=2.3.0 +test "$REQUIRED_GNOME_DOC_UTILS_VERSION" || REQUIRED_GNOME_DOC_UTILS_VERSION=0.4.2 # a list of required m4 macros. Package can set an initial value -REQUIRED_M4MACROS=${REQUIRED_M4MACROS:-} -FORBIDDEN_M4MACROS=${FORBIDDEN_M4MACROS:-} +test "$REQUIRED_M4MACROS" || REQUIRED_M4MACROS= +test "$FORBIDDEN_M4MACROS" || FORBIDDEN_M4MACROS= # Not all echo versions allow -n, so we check what is possible. This test is # based on the one in autoconf. @@ -174,7 +174,8 @@ check_m4macros() { # but it contains only Automake's own macros, so we can ignore it. # Read the dirlist file, supported by Automake >= 1.7. - if compare_versions 1.7 $AUTOMAKE_VERSION && [ -s $cm_macrodirs/dirlist ]; then + # If AUTOMAKE was defined, no version was detected. + if [ -z "$AUTOMAKE_VERSION" ] || compare_versions 1.7 $AUTOMAKE_VERSION && [ -s $cm_macrodirs/dirlist ]; then cm_dirlist=`sed 's/[ ]*#.*//;/^$/d' $cm_macrodirs/dirlist` if [ -n "$cm_dirlist" ] ; then for cm_dir in $cm_dirlist; do -- 2.7.4