-# a u t o g e n . s h
-#
-# Copyright (c) 2005-2007 United States Government as represented by
-# the U.S. Army Research Laboratory.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided
-# with the distribution.
-#
-# 3. The name of the author may not be used to endorse or promote
-# products derived from this software without specific prior written
-# permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
-# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-###
-#
-# Script for automatically preparing the sources for compilation by
-# performing the myrid of necessary steps. The script attempts to
-# detect proper version support, and outputs warnings about particular
-# systems that have autotool peculiarities.
-#
-# Basically, if everything is set up and installed correctly, the
-# script will validate that minimum versions of the GNU Build System
-# tools are installed, account for several common configuration
-# issues, and then simply run autoreconf for you.
-#
-# If autoreconf fails, which can happen for many valid configurations,
-# this script proceeds to run manual preparation steps effectively
-# providing a POSIX shell script (mostly complete) reimplementation of
-# autoreconf.
-#
-# The AUTORECONF, AUTOCONF, AUTOMAKE, LIBTOOLIZE, ACLOCAL, AUTOHEADER
-# environment variables and corresponding _OPTIONS variables (e.g.
-# AUTORECONF_OPTIONS) may be used to override the default automatic
-# detection behaviors. Similarly the _VERSION variables will override
-# the minimum required version numbers.
-#
-# Examples:
-#
-# To obtain help on usage:
-# ./autogen.sh --help
-#
-# To obtain verbose output:
-# ./autogen.sh --verbose
-#
-# To skip autoreconf and prepare manually:
-# AUTORECONF=false ./autogen.sh
-#
-# To verbosely try running with an older (unsupported) autoconf:
-# AUTOCONF_VERSION=2.50 ./autogen.sh --verbose
-#
-# Author: Christopher Sean Morrison <morrison@brlcad.org>
-#
-######################################################################
-
-# set to minimum acceptible version of autoconf
-if [ "x$AUTOCONF_VERSION" = "x" ] ; then
- AUTOCONF_VERSION=2.52
-fi
-# set to minimum acceptible version of automake
-if [ "x$AUTOMAKE_VERSION" = "x" ] ; then
- AUTOMAKE_VERSION=1.6.0
-fi
-# set to minimum acceptible version of libtool
-if [ "x$LIBTOOL_VERSION" = "x" ] ; then
- LIBTOOL_VERSION=1.4.2
-fi
-
-
-##################
-# ident function #
-##################
-ident ( ) {
- # extract copyright from header
- __copyright="`grep Copyright $AUTOGEN_SH | head -${HEAD_N}1 | awk '{print $4}'`"
- if [ "x$__copyright" = "x" ] ; then
- __copyright="`date +%Y`"
- fi
-
- # extract version from CVS Id string
- __id="$Id: autogen.sh,v 14.97 2007/06/18 22:25:02 brlcad Exp $"
- __version="`echo $__id | sed 's/.*\([0-9][0-9][0-9][0-9]\)[-\/]\([0-9][0-9]\)[-\/]\([0-9][0-9]\).*/\1\2\3/'`"
- if [ "x$__version" = "x" ] ; then
- __version=""
- fi
-
- echo "autogen.sh build preparation script by Christopher Sean Morrison"
- echo "revised 3-clause BSD-style license, copyright (c) $__copyright"
- echo "script version $__version, ISO/IEC 9945 POSIX shell script"
-}
-
-
-##################
-# USAGE FUNCTION #
-##################
-usage ( ) {
- echo "Usage: $AUTOGEN_SH [-h|--help] [-v|--verbose] [-q|--quiet] [--version]"
- echo " --help Help on $NAME_OF_AUTOGEN usage"
- echo " --verbose Verbose progress output"
- echo " --quiet Quiet suppressed progress output"
- echo " --version Only perform GNU Build System version checks"
- echo
- echo "Description: This script will validate that minimum versions of the"
- echo "GNU Build System tools are installed and then run autoreconf for you."
- echo "Should autoreconf fail, manual preparation steps will be run"
- echo "potentially accounting for several common preparation issues. The"
-
- echo "AUTORECONF, AUTOCONF, AUTOMAKE, LIBTOOLIZE, ACLOCAL, AUTOHEADER,"
- echo "PROJECT, & CONFIGURE environment variables and corresponding _OPTIONS"
- echo "variables (e.g. AUTORECONF_OPTIONS) may be used to override the"
- echo "default automatic detection behavior."
- echo
-
- ident
+# Run this to generate all the initial makefiles, etc.
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+#name of package
+PKG_NAME=${PKG_NAME:-Package}
+
+# 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}
+
+# a list of required m4 macros. Package can set an initial value
+REQUIRED_M4MACROS=${REQUIRED_M4MACROS:-}
+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.
+ECHO_C=
+ECHO_N=
+case `echo -n x` in
+-n*)
+ case `echo 'x\c'` in
+ *c*) ;;
+ *) ECHO_C='\c';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac