Blame autogen.sh

Packit Service 336c1b
#!/bin/sh
Packit Service 336c1b
#                        a u t o g e n . s h
Packit Service 336c1b
#
Packit Service 336c1b
# Copyright (c) 2005-2009 United States Government as represented by
Packit Service 336c1b
# the U.S. Army Research Laboratory.
Packit Service 336c1b
#
Packit Service 336c1b
# Redistribution and use in source and binary forms, with or without
Packit Service 336c1b
# modification, are permitted provided that the following conditions
Packit Service 336c1b
# are met:
Packit Service 336c1b
#
Packit Service 336c1b
# 1. Redistributions of source code must retain the above copyright
Packit Service 336c1b
# notice, this list of conditions and the following disclaimer.
Packit Service 336c1b
#
Packit Service 336c1b
# 2. Redistributions in binary form must reproduce the above
Packit Service 336c1b
# copyright notice, this list of conditions and the following
Packit Service 336c1b
# disclaimer in the documentation and/or other materials provided
Packit Service 336c1b
# with the distribution.
Packit Service 336c1b
#
Packit Service 336c1b
# 3. The name of the author may not be used to endorse or promote
Packit Service 336c1b
# products derived from this software without specific prior written
Packit Service 336c1b
# permission.
Packit Service 336c1b
#
Packit Service 336c1b
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
Packit Service 336c1b
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
Packit Service 336c1b
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Packit Service 336c1b
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
Packit Service 336c1b
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Packit Service 336c1b
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
Packit Service 336c1b
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
Packit Service 336c1b
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
Packit Service 336c1b
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
Packit Service 336c1b
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
Packit Service 336c1b
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Packit Service 336c1b
#
Packit Service 336c1b
###
Packit Service 336c1b
#
Packit Service 336c1b
# Script for automatically preparing the sources for compilation by
Packit Service 336c1b
# performing the myriad of necessary steps.  The script attempts to
Packit Service 336c1b
# detect proper version support, and outputs warnings about particular
Packit Service 336c1b
# systems that have autotool peculiarities.
Packit Service 336c1b
#
Packit Service 336c1b
# Basically, if everything is set up and installed correctly, the
Packit Service 336c1b
# script will validate that minimum versions of the GNU Build System
Packit Service 336c1b
# tools are installed, account for several common configuration
Packit Service 336c1b
# issues, and then simply run autoreconf for you.
Packit Service 336c1b
#
Packit Service 336c1b
# If autoreconf fails, which can happen for many valid configurations,
Packit Service 336c1b
# this script proceeds to run manual preparation steps effectively
Packit Service 336c1b
# providing a POSIX shell script (mostly complete) reimplementation of
Packit Service 336c1b
# autoreconf.
Packit Service 336c1b
#
Packit Service 336c1b
# The AUTORECONF, AUTOCONF, AUTOMAKE, LIBTOOLIZE, ACLOCAL, AUTOHEADER
Packit Service 336c1b
# environment variables and corresponding _OPTIONS variables (e.g.
Packit Service 336c1b
# AUTORECONF_OPTIONS) may be used to override the default automatic
Packit Service 336c1b
# detection behaviors.  Similarly the _VERSION variables will override
Packit Service 336c1b
# the minimum required version numbers.
Packit Service 336c1b
#
Packit Service 336c1b
# Examples:
Packit Service 336c1b
#
Packit Service 336c1b
#   To obtain help on usage:
Packit Service 336c1b
#     ./autogen.sh --help
Packit Service 336c1b
#
Packit Service 336c1b
#   To obtain verbose output:
Packit Service 336c1b
#     ./autogen.sh --verbose
Packit Service 336c1b
#
Packit Service 336c1b
#   To skip autoreconf and prepare manually:
Packit Service 336c1b
#     AUTORECONF=false ./autogen.sh
Packit Service 336c1b
#
Packit Service 336c1b
#   To verbosely try running with an older (unsupported) autoconf:
Packit Service 336c1b
#     AUTOCONF_VERSION=2.50 ./autogen.sh --verbose
Packit Service 336c1b
#
Packit Service 336c1b
# Author:
Packit Service 336c1b
#   Christopher Sean Morrison <morrison@brlcad.org>
Packit Service 336c1b
#
Packit Service 336c1b
# Patches:
Packit Service 336c1b
#   Sebastian Pipping <sebastian@pipping.org>
Packit Service 336c1b
#
Packit Service 336c1b
######################################################################
Packit Service 336c1b
Packit Service 336c1b
# set to minimum acceptable version of autoconf
Packit Service 336c1b
if [ "x$AUTOCONF_VERSION" = "x" ] ; then
Packit Service 336c1b
    AUTOCONF_VERSION=2.52
Packit Service 336c1b
fi
Packit Service 336c1b
# set to minimum acceptable version of automake
Packit Service 336c1b
if [ "x$AUTOMAKE_VERSION" = "x" ] ; then
Packit Service 336c1b
    AUTOMAKE_VERSION=1.6.0
Packit Service 336c1b
fi
Packit Service 336c1b
# set to minimum acceptable version of libtool
Packit Service 336c1b
if [ "x$LIBTOOL_VERSION" = "x" ] ; then
Packit Service 336c1b
    LIBTOOL_VERSION=1.4.2
Packit Service 336c1b
fi
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
##################
Packit Service 336c1b
# ident function #
Packit Service 336c1b
##################
Packit Service 336c1b
ident ( ) {
Packit Service 336c1b
    # extract copyright from header
Packit Service 336c1b
    __copyright="`grep Copyright $AUTOGEN_SH | head -${HEAD_N}1 | awk '{print $4}'`"
Packit Service 336c1b
    if [ "x$__copyright" = "x" ] ; then
Packit Service 336c1b
	__copyright="`date +%Y`"
Packit Service 336c1b
    fi
Packit Service 336c1b
Packit Service 336c1b
    # extract version from CVS Id string
Packit Service 336c1b
    __id="$Id: autogen.sh 33925 2009-03-01 23:27:06Z brlcad $"
Packit Service 336c1b
    __version="`echo $__id | sed 's/.*\([0-9][0-9][0-9][0-9]\)[-\/]\([0-9][0-9]\)[-\/]\([0-9][0-9]\).*/\1\2\3/'`"
Packit Service 336c1b
    if [ "x$__version" = "x" ] ; then
Packit Service 336c1b
	__version=""
Packit Service 336c1b
    fi
Packit Service 336c1b
Packit Service 336c1b
    echo "autogen.sh build preparation script by Christopher Sean Morrison"
Packit Service 336c1b
    echo "  + config.guess download patch by Sebastian Pipping (2008-12-03)"
Packit Service 336c1b
    echo "revised 3-clause BSD-style license, copyright (c) $__copyright"
Packit Service 336c1b
    echo "script version $__version, ISO/IEC 9945 POSIX shell script"
Packit Service 336c1b
}
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
##################
Packit Service 336c1b
# USAGE FUNCTION #
Packit Service 336c1b
##################
Packit Service 336c1b
usage ( ) {
Packit Service 336c1b
    echo "Usage: $AUTOGEN_SH [-h|--help] [-v|--verbose] [-q|--quiet] [-d|--download] [--version]"
Packit Service 336c1b
    echo "    --help      Help on $NAME_OF_AUTOGEN usage"
Packit Service 336c1b
    echo "    --verbose   Verbose progress output"
Packit Service 336c1b
    echo "    --quiet     Quiet suppressed progress output"
Packit Service 336c1b
    echo "    --download  Download the latest config.guess from gnulib"
Packit Service 336c1b
    echo "    --version   Only perform GNU Build System version checks"
Packit Service 336c1b
    echo
Packit Service 336c1b
    echo "Description: This script will validate that minimum versions of the"
Packit Service 336c1b
    echo "GNU Build System tools are installed and then run autoreconf for you."
Packit Service 336c1b
    echo "Should autoreconf fail, manual preparation steps will be run"
Packit Service 336c1b
    echo "potentially accounting for several common preparation issues.  The"
Packit Service 336c1b
Packit Service 336c1b
    echo "AUTORECONF, AUTOCONF, AUTOMAKE, LIBTOOLIZE, ACLOCAL, AUTOHEADER,"
Packit Service 336c1b
    echo "PROJECT, & CONFIGURE environment variables and corresponding _OPTIONS"
Packit Service 336c1b
    echo "variables (e.g. AUTORECONF_OPTIONS) may be used to override the"
Packit Service 336c1b
    echo "default automatic detection behavior."
Packit Service 336c1b
    echo
Packit Service 336c1b
Packit Service 336c1b
    ident
Packit Service 336c1b
Packit Service 336c1b
    return 0
Packit Service 336c1b
}
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
##########################
Packit Service 336c1b
# VERSION_ERROR FUNCTION #
Packit Service 336c1b
##########################
Packit Service 336c1b
version_error ( ) {
Packit Service 336c1b
    if [ "x$1" = "x" ] ; then
Packit Service 336c1b
	echo "INTERNAL ERROR: version_error was not provided a version"
Packit Service 336c1b
	exit 1
Packit Service 336c1b
    fi
Packit Service 336c1b
    if [ "x$2" = "x" ] ; then
Packit Service 336c1b
	echo "INTERNAL ERROR: version_error was not provided an application name"
Packit Service 336c1b
	exit 1
Packit Service 336c1b
    fi
Packit Service 336c1b
    $ECHO
Packit Service 336c1b
    $ECHO "ERROR:  To prepare the ${PROJECT} build system from scratch,"
Packit Service 336c1b
    $ECHO "        at least version $1 of $2 must be installed."
Packit Service 336c1b
    $ECHO
Packit Service 336c1b
    $ECHO "$NAME_OF_AUTOGEN does not need to be run on the same machine that will"
Packit Service 336c1b
    $ECHO "run configure or make.  Either the GNU Autotools will need to be installed"
Packit Service 336c1b
    $ECHO "or upgraded on this system, or $NAME_OF_AUTOGEN must be run on the source"
Packit Service 336c1b
    $ECHO "code on another system and then transferred to here. -- Cheers!"
Packit Service 336c1b
    $ECHO
Packit Service 336c1b
}
Packit Service 336c1b
Packit Service 336c1b
##########################
Packit Service 336c1b
# VERSION_CHECK FUNCTION #
Packit Service 336c1b
##########################
Packit Service 336c1b
version_check ( ) {
Packit Service 336c1b
    if [ "x$1" = "x" ] ; then
Packit Service 336c1b
	echo "INTERNAL ERROR: version_check was not provided a minimum version"
Packit Service 336c1b
	exit 1
Packit Service 336c1b
    fi
Packit Service 336c1b
    _min="$1"
Packit Service 336c1b
    if [ "x$2" = "x" ] ; then
Packit Service 336c1b
	echo "INTERNAL ERROR: version check was not provided a comparison version"
Packit Service 336c1b
	exit 1
Packit Service 336c1b
    fi
Packit Service 336c1b
    _cur="$2"
Packit Service 336c1b
Packit Service 336c1b
    # needed to handle versions like 1.10 and 1.4-p6
Packit Service 336c1b
    _min="`echo ${_min}. | sed 's/[^0-9]/./g' | sed 's/\.\././g'`"
Packit Service 336c1b
    _cur="`echo ${_cur}. | sed 's/[^0-9]/./g' | sed 's/\.\././g'`"
Packit Service 336c1b
Packit Service 336c1b
    _min_major="`echo $_min | cut -d. -f1`"
Packit Service 336c1b
    _min_minor="`echo $_min | cut -d. -f2`"
Packit Service 336c1b
    _min_patch="`echo $_min | cut -d. -f3`"
Packit Service 336c1b
Packit Service 336c1b
    _cur_major="`echo $_cur | cut -d. -f1`"
Packit Service 336c1b
    _cur_minor="`echo $_cur | cut -d. -f2`"
Packit Service 336c1b
    _cur_patch="`echo $_cur | cut -d. -f3`"
Packit Service 336c1b
Packit Service 336c1b
    if [ "x$_min_major" = "x" ] ; then
Packit Service 336c1b
	_min_major=0
Packit Service 336c1b
    fi
Packit Service 336c1b
    if [ "x$_min_minor" = "x" ] ; then
Packit Service 336c1b
	_min_minor=0
Packit Service 336c1b
    fi
Packit Service 336c1b
    if [ "x$_min_patch" = "x" ] ; then
Packit Service 336c1b
	_min_patch=0
Packit Service 336c1b
    fi
Packit Service 336c1b
    if [ "x$_cur_minor" = "x" ] ; then
Packit Service 336c1b
	_cur_major=0
Packit Service 336c1b
    fi
Packit Service 336c1b
    if [ "x$_cur_minor" = "x" ] ; then
Packit Service 336c1b
	_cur_minor=0
Packit Service 336c1b
    fi
Packit Service 336c1b
    if [ "x$_cur_patch" = "x" ] ; then
Packit Service 336c1b
	_cur_patch=0
Packit Service 336c1b
    fi
Packit Service 336c1b
Packit Service 336c1b
    $VERBOSE_ECHO "Checking if ${_cur_major}.${_cur_minor}.${_cur_patch} is greater than ${_min_major}.${_min_minor}.${_min_patch}"
Packit Service 336c1b
Packit Service 336c1b
    if [ $_min_major -lt $_cur_major ] ; then
Packit Service 336c1b
	return 0
Packit Service 336c1b
    elif [ $_min_major -eq $_cur_major ] ; then
Packit Service 336c1b
	if [ $_min_minor -lt $_cur_minor ] ; then
Packit Service 336c1b
	    return 0
Packit Service 336c1b
	elif [ $_min_minor -eq $_cur_minor ] ; then
Packit Service 336c1b
	    if [ $_min_patch -lt $_cur_patch ] ; then
Packit Service 336c1b
		return 0
Packit Service 336c1b
	    elif [ $_min_patch -eq $_cur_patch ] ; then
Packit Service 336c1b
		return 0
Packit Service 336c1b
	    fi
Packit Service 336c1b
	fi
Packit Service 336c1b
    fi
Packit Service 336c1b
    return 1
Packit Service 336c1b
}
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
######################################
Packit Service 336c1b
# LOCATE_CONFIGURE_TEMPLATE FUNCTION #
Packit Service 336c1b
######################################
Packit Service 336c1b
locate_configure_template ( ) {
Packit Service 336c1b
    _pwd="`pwd`"
Packit Service 336c1b
    if test -f "./configure.ac" ; then
Packit Service 336c1b
	echo "./configure.ac"
Packit Service 336c1b
    elif test -f "./configure.in" ; then
Packit Service 336c1b
	echo "./configure.in"
Packit Service 336c1b
    elif test -f "$_pwd/configure.ac" ; then
Packit Service 336c1b
	echo "$_pwd/configure.ac"
Packit Service 336c1b
    elif test -f "$_pwd/configure.in" ; then
Packit Service 336c1b
	echo "$_pwd/configure.in"
Packit Service 336c1b
    elif test -f "$PATH_TO_AUTOGEN/configure.ac" ; then
Packit Service 336c1b
	echo "$PATH_TO_AUTOGEN/configure.ac"
Packit Service 336c1b
    elif test -f "$PATH_TO_AUTOGEN/configure.in" ; then
Packit Service 336c1b
	echo "$PATH_TO_AUTOGEN/configure.in"
Packit Service 336c1b
    fi
Packit Service 336c1b
}
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
##################
Packit Service 336c1b
# argument check #
Packit Service 336c1b
##################
Packit Service 336c1b
ARGS="$*"
Packit Service 336c1b
PATH_TO_AUTOGEN="`dirname $0`"
Packit Service 336c1b
NAME_OF_AUTOGEN="`basename $0`"
Packit Service 336c1b
AUTOGEN_SH="$PATH_TO_AUTOGEN/$NAME_OF_AUTOGEN"
Packit Service 336c1b
Packit Service 336c1b
LIBTOOL_M4="${PATH_TO_AUTOGEN}/misc/libtool.m4"
Packit Service 336c1b
Packit Service 336c1b
if [ "x$HELP" = "x" ] ; then
Packit Service 336c1b
    HELP=no
Packit Service 336c1b
fi
Packit Service 336c1b
if [ "x$QUIET" = "x" ] ; then
Packit Service 336c1b
    QUIET=no
Packit Service 336c1b
fi
Packit Service 336c1b
if [ "x$VERBOSE" = "x" ] ; then
Packit Service 336c1b
    VERBOSE=no
Packit Service 336c1b
fi
Packit Service 336c1b
if [ "x$VERSION_ONLY" = "x" ] ; then
Packit Service 336c1b
    VERSION_ONLY=no
Packit Service 336c1b
fi
Packit Service 336c1b
if [ "x$DOWNLOAD" = "x" ] ; then
Packit Service 336c1b
    DOWNLOAD=no
Packit Service 336c1b
fi
Packit Service 336c1b
if [ "x$AUTORECONF_OPTIONS" = "x" ] ; then
Packit Service 336c1b
    AUTORECONF_OPTIONS="-i -f"
Packit Service 336c1b
fi
Packit Service 336c1b
if [ "x$AUTOCONF_OPTIONS" = "x" ] ; then
Packit Service 336c1b
    AUTOCONF_OPTIONS="-f"
Packit Service 336c1b
fi
Packit Service 336c1b
if [ "x$AUTOMAKE_OPTIONS" = "x" ] ; then
Packit Service 336c1b
    AUTOMAKE_OPTIONS="-a -c -f"
Packit Service 336c1b
fi
Packit Service 336c1b
ALT_AUTOMAKE_OPTIONS="-a -c"
Packit Service 336c1b
if [ "x$LIBTOOLIZE_OPTIONS" = "x" ] ; then
Packit Service 336c1b
    LIBTOOLIZE_OPTIONS="--automake -c -f"
Packit Service 336c1b
fi
Packit Service 336c1b
ALT_LIBTOOLIZE_OPTIONS="--automake --copy --force"
Packit Service 336c1b
if [ "x$ACLOCAL_OPTIONS" = "x" ] ; then
Packit Service 336c1b
    ACLOCAL_OPTIONS=""
Packit Service 336c1b
fi
Packit Service 336c1b
if [ "x$AUTOHEADER_OPTIONS" = "x" ] ; then
Packit Service 336c1b
    AUTOHEADER_OPTIONS=""
Packit Service 336c1b
fi
Packit Service 336c1b
if [ "x$CONFIG_GUESS_URL" = "x" ] ; then
Packit Service 336c1b
    CONFIG_GUESS_URL="http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=build-aux/config.guess;hb=HEAD"
Packit Service 336c1b
fi
Packit Service 336c1b
for arg in $ARGS ; do
Packit Service 336c1b
    case "x$arg" in
Packit Service 336c1b
	x--help) HELP=yes ;;
Packit Service 336c1b
	x-[hH]) HELP=yes ;;
Packit Service 336c1b
	x--quiet) QUIET=yes ;;
Packit Service 336c1b
	x-[qQ]) QUIET=yes ;;
Packit Service 336c1b
	x--verbose) VERBOSE=yes ;;
Packit Service 336c1b
	x-[dD]) DOWNLOAD=yes ;;
Packit Service 336c1b
	x--download) DOWNLOAD=yes ;;
Packit Service 336c1b
	x-[vV]) VERBOSE=yes ;;
Packit Service 336c1b
	x--version) VERSION_ONLY=yes ;;
Packit Service 336c1b
	*)
Packit Service 336c1b
	    echo "Unknown option: $arg"
Packit Service 336c1b
	    echo
Packit Service 336c1b
	    usage
Packit Service 336c1b
	    exit 1
Packit Service 336c1b
	    ;;
Packit Service 336c1b
    esac
Packit Service 336c1b
done
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
#####################
Packit Service 336c1b
# environment check #
Packit Service 336c1b
#####################
Packit Service 336c1b
Packit Service 336c1b
# sanity check before recursions potentially begin
Packit Service 336c1b
if [ ! -f "$AUTOGEN_SH" ] ; then
Packit Service 336c1b
    echo "INTERNAL ERROR: $AUTOGEN_SH does not exist"
Packit Service 336c1b
    if [ ! "x$0" = "x$AUTOGEN_SH" ] ; then
Packit Service 336c1b
	echo "INTERNAL ERROR: dirname/basename inconsistency: $0 != $AUTOGEN_SH"
Packit Service 336c1b
    fi
Packit Service 336c1b
    exit 1
Packit Service 336c1b
fi
Packit Service 336c1b
Packit Service 336c1b
# force locale setting to C so things like date output as expected
Packit Service 336c1b
LC_ALL=C
Packit Service 336c1b
Packit Service 336c1b
# commands that this script expects
Packit Service 336c1b
for __cmd in echo head tail pwd ; do
Packit Service 336c1b
    echo "test" | $__cmd > /dev/null 2>&1
Packit Service 336c1b
    if [ $? != 0 ] ; then
Packit Service 336c1b
	echo "INTERNAL ERROR: '${__cmd}' command is required"
Packit Service 336c1b
	exit 2
Packit Service 336c1b
    fi
Packit Service 336c1b
done
Packit Service 336c1b
echo "test" | grep "test" > /dev/null 2>&1
Packit Service 336c1b
if test ! x$? = x0 ; then
Packit Service 336c1b
    echo "INTERNAL ERROR: grep command is required"
Packit Service 336c1b
    exit 1
Packit Service 336c1b
fi
Packit Service 336c1b
echo "test" | sed "s/test/test/" > /dev/null 2>&1
Packit Service 336c1b
if test ! x$? = x0 ; then
Packit Service 336c1b
    echo "INTERNAL ERROR: sed command is required"
Packit Service 336c1b
    exit 1
Packit Service 336c1b
fi
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
# determine the behavior of echo
Packit Service 336c1b
case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
Packit Service 336c1b
    *c*,-n*) ECHO_N= ECHO_C='
Packit Service 336c1b
' ECHO_T='	' ;;
Packit Service 336c1b
    *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
Packit Service 336c1b
    *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
Packit Service 336c1b
esac
Packit Service 336c1b
Packit Service 336c1b
# determine the behavior of head
Packit Service 336c1b
case "x`echo 'head' | head -n 1 2>&1`" in
Packit Service 336c1b
    *xhead*) HEAD_N="n " ;;
Packit Service 336c1b
    *) HEAD_N="" ;;
Packit Service 336c1b
esac
Packit Service 336c1b
Packit Service 336c1b
# determine the behavior of tail
Packit Service 336c1b
case "x`echo 'tail' | tail -n 1 2>&1`" in
Packit Service 336c1b
    *xtail*) TAIL_N="n " ;;
Packit Service 336c1b
    *) TAIL_N="" ;;
Packit Service 336c1b
esac
Packit Service 336c1b
Packit Service 336c1b
VERBOSE_ECHO=:
Packit Service 336c1b
ECHO=:
Packit Service 336c1b
if [ "x$QUIET" = "xyes" ] ; then
Packit Service 336c1b
    if [ "x$VERBOSE" = "xyes" ] ; then
Packit Service 336c1b
	echo "Verbose output quelled by quiet option.  Further output disabled."
Packit Service 336c1b
    fi
Packit Service 336c1b
else
Packit Service 336c1b
    ECHO=echo
Packit Service 336c1b
    if [ "x$VERBOSE" = "xyes" ] ; then
Packit Service 336c1b
	echo "Verbose output enabled"
Packit Service 336c1b
	VERBOSE_ECHO=echo
Packit Service 336c1b
    fi
Packit Service 336c1b
fi
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
# allow a recursive run to disable further recursions
Packit Service 336c1b
if [ "x$RUN_RECURSIVE" = "x" ] ; then
Packit Service 336c1b
    RUN_RECURSIVE=yes
Packit Service 336c1b
fi
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
################################################
Packit Service 336c1b
# check for help arg and bypass version checks #
Packit Service 336c1b
################################################
Packit Service 336c1b
if [ "x`echo $ARGS | sed 's/.*[hH][eE][lL][pP].*/help/'`" = "xhelp" ] ; then
Packit Service 336c1b
    HELP=yes
Packit Service 336c1b
fi
Packit Service 336c1b
if [ "x$HELP" = "xyes" ] ; then
Packit Service 336c1b
    usage
Packit Service 336c1b
    $ECHO "---"
Packit Service 336c1b
    $ECHO "Help was requested.  No preparation or configuration will be performed."
Packit Service 336c1b
    exit 0
Packit Service 336c1b
fi
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
#######################
Packit Service 336c1b
# set up signal traps #
Packit Service 336c1b
#######################
Packit Service 336c1b
untrap_abnormal ( ) {
Packit Service 336c1b
    for sig in 1 2 13 15; do
Packit Service 336c1b
	trap - $sig
Packit Service 336c1b
    done
Packit Service 336c1b
}
Packit Service 336c1b
Packit Service 336c1b
# do this cleanup whenever we exit.
Packit Service 336c1b
trap '
Packit Service 336c1b
    # start from the root
Packit Service 336c1b
    if test -d "$START_PATH" ; then
Packit Service 336c1b
	cd "$START_PATH"
Packit Service 336c1b
    fi
Packit Service 336c1b
Packit Service 336c1b
    # restore/delete backup files
Packit Service 336c1b
    if test "x$PFC_INIT" = "x1" ; then
Packit Service 336c1b
	recursive_restore
Packit Service 336c1b
    fi
Packit Service 336c1b
' 0
Packit Service 336c1b
Packit Service 336c1b
# trap SIGHUP (1), SIGINT (2), SIGPIPE (13), SIGTERM (15)
Packit Service 336c1b
for sig in 1 2 13 15; do
Packit Service 336c1b
    trap '
Packit Service 336c1b
	$ECHO ""
Packit Service 336c1b
	$ECHO "Aborting $NAME_OF_AUTOGEN: caught signal '$sig'"
Packit Service 336c1b
Packit Service 336c1b
	# start from the root
Packit Service 336c1b
	if test -d "$START_PATH" ; then
Packit Service 336c1b
	    cd "$START_PATH"
Packit Service 336c1b
	fi
Packit Service 336c1b
Packit Service 336c1b
	# clean up on abnormal exit
Packit Service 336c1b
	$VERBOSE_ECHO "rm -rf autom4te.cache"
Packit Service 336c1b
	rm -rf autom4te.cache
Packit Service 336c1b
Packit Service 336c1b
	if test -f "acinclude.m4.$$.backup" ; then
Packit Service 336c1b
	    $VERBOSE_ECHO "cat acinclude.m4.$$.backup > acinclude.m4"
Packit Service 336c1b
	    chmod u+w acinclude.m4
Packit Service 336c1b
	    cat acinclude.m4.$$.backup > acinclude.m4
Packit Service 336c1b
Packit Service 336c1b
	    $VERBOSE_ECHO "rm -f acinclude.m4.$$.backup"
Packit Service 336c1b
	    rm -f acinclude.m4.$$.backup
Packit Service 336c1b
        fi
Packit Service 336c1b
Packit Service 336c1b
	{ (exit 1); exit 1; }
Packit Service 336c1b
' $sig
Packit Service 336c1b
done
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
#############################
Packit Service 336c1b
# look for a configure file #
Packit Service 336c1b
#############################
Packit Service 336c1b
if [ "x$CONFIGURE" = "x" ] ; then
Packit Service 336c1b
    CONFIGURE="`locate_configure_template`"
Packit Service 336c1b
    if [ ! "x$CONFIGURE" = "x" ] ; then
Packit Service 336c1b
	$VERBOSE_ECHO "Found a configure template: $CONFIGURE"
Packit Service 336c1b
    fi
Packit Service 336c1b
else
Packit Service 336c1b
    $ECHO "Using CONFIGURE environment variable override: $CONFIGURE"
Packit Service 336c1b
fi
Packit Service 336c1b
if [ "x$CONFIGURE" = "x" ] ; then
Packit Service 336c1b
    if [ "x$VERSION_ONLY" = "xyes" ] ; then
Packit Service 336c1b
	CONFIGURE=/dev/null
Packit Service 336c1b
    else
Packit Service 336c1b
	$ECHO
Packit Service 336c1b
	$ECHO "A configure.ac or configure.in file could not be located implying"
Packit Service 336c1b
	$ECHO "that the GNU Build System is at least not used in this directory.  In"
Packit Service 336c1b
	$ECHO "any case, there is nothing to do here without one of those files."
Packit Service 336c1b
	$ECHO
Packit Service 336c1b
	$ECHO "ERROR: No configure.in or configure.ac file found in `pwd`"
Packit Service 336c1b
	exit 1
Packit Service 336c1b
    fi
Packit Service 336c1b
fi
Packit Service 336c1b
Packit Service 336c1b
####################
Packit Service 336c1b
# get project name #
Packit Service 336c1b
####################
Packit Service 336c1b
if [ "x$PROJECT" = "x" ] ; then
Packit Service 336c1b
    PROJECT="`grep AC_INIT $CONFIGURE | grep -v '.*#.*AC_INIT' | tail -${TAIL_N}1 | sed 's/^[ 	]*AC_INIT(\([^,)]*\).*/\1/' | sed 's/.*\[\(.*\)\].*/\1/'`"
Packit Service 336c1b
    if [ "x$PROJECT" = "xAC_INIT" ] ; then
Packit Service 336c1b
	# projects might be using the older/deprecated arg-less AC_INIT .. look for AM_INIT_AUTOMAKE instead
Packit Service 336c1b
	PROJECT="`grep AM_INIT_AUTOMAKE $CONFIGURE | grep -v '.*#.*AM_INIT_AUTOMAKE' | tail -${TAIL_N}1 | sed 's/^[ 	]*AM_INIT_AUTOMAKE(\([^,)]*\).*/\1/' | sed 's/.*\[\(.*\)\].*/\1/'`"
Packit Service 336c1b
    fi
Packit Service 336c1b
    if [ "x$PROJECT" = "xAM_INIT_AUTOMAKE" ] ; then
Packit Service 336c1b
	PROJECT="project"
Packit Service 336c1b
    fi
Packit Service 336c1b
    if [ "x$PROJECT" = "x" ] ; then
Packit Service 336c1b
	PROJECT="project"
Packit Service 336c1b
    fi
Packit Service 336c1b
else
Packit Service 336c1b
    $ECHO "Using PROJECT environment variable override: $PROJECT"
Packit Service 336c1b
fi
Packit Service 336c1b
$ECHO "Preparing the $PROJECT build system...please wait"
Packit Service 336c1b
$ECHO
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
########################
Packit Service 336c1b
# check for autoreconf #
Packit Service 336c1b
########################
Packit Service 336c1b
HAVE_AUTORECONF=no
Packit Service 336c1b
if [ "x$AUTORECONF" = "x" ] ; then
Packit Service 336c1b
    for AUTORECONF in autoreconf ; do
Packit Service 336c1b
	$VERBOSE_ECHO "Checking autoreconf version: $AUTORECONF --version"
Packit Service 336c1b
	$AUTORECONF --version > /dev/null 2>&1
Packit Service 336c1b
	if [ $? = 0 ] ; then
Packit Service 336c1b
	    HAVE_AUTORECONF=yes
Packit Service 336c1b
	    break
Packit Service 336c1b
	fi
Packit Service 336c1b
    done
Packit Service 336c1b
else
Packit Service 336c1b
    HAVE_AUTORECONF=yes
Packit Service 336c1b
    $ECHO "Using AUTORECONF environment variable override: $AUTORECONF"
Packit Service 336c1b
fi
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
##########################
Packit Service 336c1b
# autoconf version check #
Packit Service 336c1b
##########################
Packit Service 336c1b
_acfound=no
Packit Service 336c1b
if [ "x$AUTOCONF" = "x" ] ; then
Packit Service 336c1b
    for AUTOCONF in autoconf ; do
Packit Service 336c1b
	$VERBOSE_ECHO "Checking autoconf version: $AUTOCONF --version"
Packit Service 336c1b
	$AUTOCONF --version > /dev/null 2>&1
Packit Service 336c1b
	if [ $? = 0 ] ; then
Packit Service 336c1b
	    _acfound=yes
Packit Service 336c1b
	    break
Packit Service 336c1b
	fi
Packit Service 336c1b
    done
Packit Service 336c1b
else
Packit Service 336c1b
    _acfound=yes
Packit Service 336c1b
    $ECHO "Using AUTOCONF environment variable override: $AUTOCONF"
Packit Service 336c1b
fi
Packit Service 336c1b
Packit Service 336c1b
_report_error=no
Packit Service 336c1b
if [ ! "x$_acfound" = "xyes" ] ; then
Packit Service 336c1b
    $ECHO "ERROR:  Unable to locate GNU Autoconf."
Packit Service 336c1b
    _report_error=yes
Packit Service 336c1b
else
Packit Service 336c1b
    _version="`$AUTOCONF --version | head -${HEAD_N}1 | sed 's/[^0-9]*\([0-9\.][0-9\.]*\)/\1/'`"
Packit Service 336c1b
    if [ "x$_version" = "x" ] ; then
Packit Service 336c1b
	_version="0.0.0"
Packit Service 336c1b
    fi
Packit Service 336c1b
    $ECHO "Found GNU Autoconf version $_version"
Packit Service 336c1b
    version_check "$AUTOCONF_VERSION" "$_version"
Packit Service 336c1b
    if [ $? -ne 0 ] ; then
Packit Service 336c1b
	_report_error=yes
Packit Service 336c1b
    fi
Packit Service 336c1b
fi
Packit Service 336c1b
if [ "x$_report_error" = "xyes" ] ; then
Packit Service 336c1b
    version_error "$AUTOCONF_VERSION" "GNU Autoconf"
Packit Service 336c1b
    exit 1
Packit Service 336c1b
fi
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
##########################
Packit Service 336c1b
# automake version check #
Packit Service 336c1b
##########################
Packit Service 336c1b
_amfound=no
Packit Service 336c1b
if [ "x$AUTOMAKE" = "x" ] ; then
Packit Service 336c1b
    for AUTOMAKE in automake ; do
Packit Service 336c1b
	$VERBOSE_ECHO "Checking automake version: $AUTOMAKE --version"
Packit Service 336c1b
	$AUTOMAKE --version > /dev/null 2>&1
Packit Service 336c1b
	if [ $? = 0 ] ; then
Packit Service 336c1b
	    _amfound=yes
Packit Service 336c1b
	    break
Packit Service 336c1b
	fi
Packit Service 336c1b
    done
Packit Service 336c1b
else
Packit Service 336c1b
    _amfound=yes
Packit Service 336c1b
    $ECHO "Using AUTOMAKE environment variable override: $AUTOMAKE"
Packit Service 336c1b
fi
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
_report_error=no
Packit Service 336c1b
if [ ! "x$_amfound" = "xyes" ] ; then
Packit Service 336c1b
    $ECHO
Packit Service 336c1b
    $ECHO "ERROR: Unable to locate GNU Automake."
Packit Service 336c1b
    _report_error=yes
Packit Service 336c1b
else
Packit Service 336c1b
    _version="`$AUTOMAKE --version | head -${HEAD_N}1 | sed 's/[^0-9]*\([0-9\.][0-9\.]*\)/\1/'`"
Packit Service 336c1b
    if [ "x$_version" = "x" ] ; then
Packit Service 336c1b
	_version="0.0.0"
Packit Service 336c1b
    fi
Packit Service 336c1b
    $ECHO "Found GNU Automake version $_version"
Packit Service 336c1b
    version_check "$AUTOMAKE_VERSION" "$_version"
Packit Service 336c1b
    if [ $? -ne 0 ] ; then
Packit Service 336c1b
	_report_error=yes
Packit Service 336c1b
    fi
Packit Service 336c1b
fi
Packit Service 336c1b
if [ "x$_report_error" = "xyes" ] ; then
Packit Service 336c1b
    version_error "$AUTOMAKE_VERSION" "GNU Automake"
Packit Service 336c1b
    exit 1
Packit Service 336c1b
fi
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
########################
Packit Service 336c1b
# check for libtoolize #
Packit Service 336c1b
########################
Packit Service 336c1b
HAVE_LIBTOOLIZE=yes
Packit Service 336c1b
HAVE_ALT_LIBTOOLIZE=no
Packit Service 336c1b
_ltfound=no
Packit Service 336c1b
if [ "x$LIBTOOLIZE" = "x" ] ; then
Packit Service 336c1b
    LIBTOOLIZE=libtoolize
Packit Service 336c1b
    $VERBOSE_ECHO "Checking libtoolize version: $LIBTOOLIZE --version"
Packit Service 336c1b
    $LIBTOOLIZE --version > /dev/null 2>&1
Packit Service 336c1b
    if [ ! $? = 0 ] ; then
Packit Service 336c1b
	HAVE_LIBTOOLIZE=no
Packit Service 336c1b
	$ECHO
Packit Service 336c1b
	if [ "x$HAVE_AUTORECONF" = "xno" ] ; then
Packit Service 336c1b
	    $ECHO "Warning:  libtoolize does not appear to be available."
Packit Service 336c1b
	else
Packit Service 336c1b
	    $ECHO "Warning:  libtoolize does not appear to be available.  This means that"
Packit Service 336c1b
	    $ECHO "the automatic build preparation via autoreconf will probably not work."
Packit Service 336c1b
	    $ECHO "Preparing the build by running each step individually, however, should"
Packit Service 336c1b
	    $ECHO "work and will be done automatically for you if autoreconf fails."
Packit Service 336c1b
	fi
Packit Service 336c1b
Packit Service 336c1b
	# look for some alternates
Packit Service 336c1b
	for tool in glibtoolize libtoolize15 libtoolize14 libtoolize13 ; do
Packit Service 336c1b
	    $VERBOSE_ECHO "Checking libtoolize alternate: $tool --version"
Packit Service 336c1b
	    _glibtoolize="`$tool --version > /dev/null 2>&1`"
Packit Service 336c1b
	    if [ $? = 0 ] ; then
Packit Service 336c1b
		$VERBOSE_ECHO "Found $tool --version"
Packit Service 336c1b
		_glti="`which $tool`"
Packit Service 336c1b
		if [ "x$_glti" = "x" ] ; then
Packit Service 336c1b
		    $VERBOSE_ECHO "Cannot find $tool with which"
Packit Service 336c1b
		    continue;
Packit Service 336c1b
		fi
Packit Service 336c1b
		if test ! -f "$_glti" ; then
Packit Service 336c1b
		    $VERBOSE_ECHO "Cannot use $tool, $_glti is not a file"
Packit Service 336c1b
		    continue;
Packit Service 336c1b
		fi
Packit Service 336c1b
		_gltidir="`dirname $_glti`"
Packit Service 336c1b
		if [ "x$_gltidir" = "x" ] ; then
Packit Service 336c1b
		    $VERBOSE_ECHO "Cannot find $tool path with dirname of $_glti"
Packit Service 336c1b
		    continue;
Packit Service 336c1b
		fi
Packit Service 336c1b
		if test ! -d "$_gltidir" ; then
Packit Service 336c1b
		    $VERBOSE_ECHO "Cannot use $tool, $_gltidir is not a directory"
Packit Service 336c1b
		    continue;
Packit Service 336c1b
		fi
Packit Service 336c1b
		HAVE_ALT_LIBTOOLIZE=yes
Packit Service 336c1b
		LIBTOOLIZE="$tool"
Packit Service 336c1b
		$ECHO
Packit Service 336c1b
		$ECHO "Fortunately, $tool was found which means that your system may simply"
Packit Service 336c1b
		$ECHO "have a non-standard or incomplete GNU Autotools install.  If you have"
Packit Service 336c1b
		$ECHO "sufficient system access, it may be possible to quell this warning by"
Packit Service 336c1b
		$ECHO "running:"
Packit Service 336c1b
		$ECHO
Packit Service 336c1b
		sudo -V > /dev/null 2>&1
Packit Service 336c1b
		if [ $? = 0 ] ; then
Packit Service 336c1b
		    $ECHO "   sudo ln -s $_glti $_gltidir/libtoolize"
Packit Service 336c1b
		    $ECHO
Packit Service 336c1b
		else
Packit Service 336c1b
		    $ECHO "   ln -s $_glti $_gltidir/libtoolize"
Packit Service 336c1b
		    $ECHO
Packit Service 336c1b
		    $ECHO "Run that as root or with proper permissions to the $_gltidir directory"
Packit Service 336c1b
		    $ECHO
Packit Service 336c1b
		fi
Packit Service 336c1b
		_ltfound=yes
Packit Service 336c1b
		break
Packit Service 336c1b
	    fi
Packit Service 336c1b
	done
Packit Service 336c1b
    else
Packit Service 336c1b
	_ltfound=yes
Packit Service 336c1b
    fi
Packit Service 336c1b
else
Packit Service 336c1b
    _ltfound=yes
Packit Service 336c1b
    $ECHO "Using LIBTOOLIZE environment variable override: $LIBTOOLIZE"
Packit Service 336c1b
fi
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
############################
Packit Service 336c1b
# libtoolize version check #
Packit Service 336c1b
############################
Packit Service 336c1b
_report_error=no
Packit Service 336c1b
if [ ! "x$_ltfound" = "xyes" ] ; then
Packit Service 336c1b
    $ECHO
Packit Service 336c1b
    $ECHO "ERROR: Unable to locate GNU Libtool."
Packit Service 336c1b
    _report_error=yes
Packit Service 336c1b
else
Packit Service 336c1b
    _version="`$LIBTOOLIZE --version | head -${HEAD_N}1 | sed 's/[^0-9]*\([0-9\.][0-9\.]*\)/\1/'`"
Packit Service 336c1b
    if [ "x$_version" = "x" ] ; then
Packit Service 336c1b
	_version="0.0.0"
Packit Service 336c1b
    fi
Packit Service 336c1b
    $ECHO "Found GNU Libtool version $_version"
Packit Service 336c1b
    version_check "$LIBTOOL_VERSION" "$_version"
Packit Service 336c1b
    if [ $? -ne 0 ] ; then
Packit Service 336c1b
	_report_error=yes
Packit Service 336c1b
    fi
Packit Service 336c1b
fi
Packit Service 336c1b
if [ "x$_report_error" = "xyes" ] ; then
Packit Service 336c1b
    version_error "$LIBTOOL_VERSION" "GNU Libtool"
Packit Service 336c1b
    exit 1
Packit Service 336c1b
fi
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
#####################
Packit Service 336c1b
# check for aclocal #
Packit Service 336c1b
#####################
Packit Service 336c1b
if [ "x$ACLOCAL" = "x" ] ; then
Packit Service 336c1b
    for ACLOCAL in aclocal ; do
Packit Service 336c1b
	$VERBOSE_ECHO "Checking aclocal version: $ACLOCAL --version"
Packit Service 336c1b
	$ACLOCAL --version > /dev/null 2>&1
Packit Service 336c1b
	if [ $? = 0 ] ; then
Packit Service 336c1b
	    break
Packit Service 336c1b
	fi
Packit Service 336c1b
    done
Packit Service 336c1b
else
Packit Service 336c1b
    $ECHO "Using ACLOCAL environment variable override: $ACLOCAL"
Packit Service 336c1b
fi
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
########################
Packit Service 336c1b
# check for autoheader #
Packit Service 336c1b
########################
Packit Service 336c1b
if [ "x$AUTOHEADER" = "x" ] ; then
Packit Service 336c1b
    for AUTOHEADER in autoheader ; do
Packit Service 336c1b
	$VERBOSE_ECHO "Checking autoheader version: $AUTOHEADER --version"
Packit Service 336c1b
	$AUTOHEADER --version > /dev/null 2>&1
Packit Service 336c1b
	if [ $? = 0 ] ; then
Packit Service 336c1b
	    break
Packit Service 336c1b
	fi
Packit Service 336c1b
    done
Packit Service 336c1b
else
Packit Service 336c1b
    $ECHO "Using AUTOHEADER environment variable override: $AUTOHEADER"
Packit Service 336c1b
fi
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
#########################
Packit Service 336c1b
# check if version only #
Packit Service 336c1b
#########################
Packit Service 336c1b
$VERBOSE_ECHO "Checking whether to only output version information"
Packit Service 336c1b
if [ "x$VERSION_ONLY" = "xyes" ] ; then
Packit Service 336c1b
    $ECHO
Packit Service 336c1b
    ident
Packit Service 336c1b
    $ECHO "---"
Packit Service 336c1b
    $ECHO "Version requested.  No preparation or configuration will be performed."
Packit Service 336c1b
    exit 0
Packit Service 336c1b
fi
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
#################################
Packit Service 336c1b
# PROTECT_FROM_CLOBBER FUNCTION #
Packit Service 336c1b
#################################
Packit Service 336c1b
protect_from_clobber ( ) {
Packit Service 336c1b
    PFC_INIT=1
Packit Service 336c1b
Packit Service 336c1b
    # protect COPYING & INSTALL from overwrite by automake.  the
Packit Service 336c1b
    # automake force option will (inappropriately) ignore the existing
Packit Service 336c1b
    # contents of a COPYING and/or INSTALL files (depending on the
Packit Service 336c1b
    # version) instead of just forcing *missing* files like it does
Packit Service 336c1b
    # for AUTHORS, NEWS, and README. this is broken but extremely
Packit Service 336c1b
    # prevalent behavior, so we protect against it by keeping a backup
Packit Service 336c1b
    # of the file that can later be restored.
Packit Service 336c1b
Packit Service 336c1b
    for file in COPYING INSTALL ; do
Packit Service 336c1b
	if test -f ${file} ; then
Packit Service 336c1b
	    if test -f ${file}.$$.protect_from_automake.backup ; then
Packit Service 336c1b
		$VERBOSE_ECHO "Already backed up ${file} in `pwd`"
Packit Service 336c1b
	    else
Packit Service 336c1b
		$VERBOSE_ECHO "Backing up ${file} in `pwd`"
Packit Service 336c1b
		$VERBOSE_ECHO "cp -p ${file} ${file}.$$.protect_from_automake.backup"
Packit Service 336c1b
		cp -p ${file} ${file}.$$.protect_from_automake.backup
Packit Service 336c1b
	    fi
Packit Service 336c1b
	fi
Packit Service 336c1b
    done
Packit Service 336c1b
}
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
##############################
Packit Service 336c1b
# RECURSIVE_PROTECT FUNCTION #
Packit Service 336c1b
##############################
Packit Service 336c1b
recursive_protect ( ) {
Packit Service 336c1b
Packit Service 336c1b
    # for projects using recursive configure, run the build
Packit Service 336c1b
    # preparation steps for the subdirectories.  this function assumes
Packit Service 336c1b
    # START_PATH was set to pwd before recursion begins so that
Packit Service 336c1b
    # relative paths work.
Packit Service 336c1b
Packit Service 336c1b
    # git 'r done, protect COPYING and INSTALL from being clobbered
Packit Service 336c1b
    protect_from_clobber
Packit Service 336c1b
Packit Service 336c1b
    if test -d autom4te.cache ; then
Packit Service 336c1b
	$VERBOSE_ECHO "Found an autom4te.cache directory, deleting it"
Packit Service 336c1b
	$VERBOSE_ECHO "rm -rf autom4te.cache"
Packit Service 336c1b
	rm -rf autom4te.cache
Packit Service 336c1b
    fi
Packit Service 336c1b
Packit Service 336c1b
    # find configure template
Packit Service 336c1b
    _configure="`locate_configure_template`"
Packit Service 336c1b
    if [ "x$_configure" = "x" ] ; then
Packit Service 336c1b
	return
Packit Service 336c1b
    fi
Packit Service 336c1b
    # $VERBOSE_ECHO "Looking for configure template found `pwd`/$_configure"
Packit Service 336c1b
Packit Service 336c1b
    # look for subdirs
Packit Service 336c1b
    # $VERBOSE_ECHO "Looking for subdirs in `pwd`"
Packit Service 336c1b
    _det_config_subdirs="`grep AC_CONFIG_SUBDIRS $_configure | grep -v '.*#.*AC_CONFIG_SUBDIRS' | sed 's/^[ 	]*AC_CONFIG_SUBDIRS(\(.*\)).*/\1/' | sed 's/.*\[\(.*\)\].*/\1/'`"
Packit Service 336c1b
    CHECK_DIRS=""
Packit Service 336c1b
    for dir in $_det_config_subdirs ; do
Packit Service 336c1b
	if test -d "`pwd`/$dir" ; then
Packit Service 336c1b
	    CHECK_DIRS="$CHECK_DIRS \"`pwd`/$dir\""
Packit Service 336c1b
	fi
Packit Service 336c1b
    done
Packit Service 336c1b
Packit Service 336c1b
    # process subdirs
Packit Service 336c1b
    if [ ! "x$CHECK_DIRS" = "x" ] ; then
Packit Service 336c1b
	$VERBOSE_ECHO "Recursively scanning the following directories:"
Packit Service 336c1b
	$VERBOSE_ECHO "  $CHECK_DIRS"
Packit Service 336c1b
	for dir in $CHECK_DIRS ; do
Packit Service 336c1b
	    $VERBOSE_ECHO "Protecting files from automake in $dir"
Packit Service 336c1b
	    cd "$START_PATH"
Packit Service 336c1b
	    eval "cd $dir"
Packit Service 336c1b
Packit Service 336c1b
	    # recursively git 'r done
Packit Service 336c1b
	    recursive_protect
Packit Service 336c1b
	done
Packit Service 336c1b
    fi
Packit Service 336c1b
} # end of recursive_protect
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
#############################
Packit Service 336c1b
# RESTORE_CLOBBERED FUNCION #
Packit Service 336c1b
#############################
Packit Service 336c1b
restore_clobbered ( ) {
Packit Service 336c1b
Packit Service 336c1b
    # The automake (and autoreconf by extension) -f/--force-missing
Packit Service 336c1b
    # option may overwrite COPYING and INSTALL even if they do exist.
Packit Service 336c1b
    # Here we restore the files if necessary.
Packit Service 336c1b
Packit Service 336c1b
    spacer=no
Packit Service 336c1b
Packit Service 336c1b
    for file in COPYING INSTALL ; do
Packit Service 336c1b
	if test -f ${file}.$$.protect_from_automake.backup ; then
Packit Service 336c1b
	    if test -f ${file} ; then
Packit Service 336c1b
	    # compare entire content, restore if needed
Packit Service 336c1b
	    if test "x`cat ${file}`" != "x`cat ${file}.$$.protect_from_automake.backup`" ; then
Packit Service 336c1b
		if test "x$spacer" = "xno" ; then
Packit Service 336c1b
		    $VERBOSE_ECHO
Packit Service 336c1b
		    spacer=yes
Packit Service 336c1b
		fi
Packit Service 336c1b
		# restore the backup
Packit Service 336c1b
		$VERBOSE_ECHO "Restoring ${file} from backup (automake -f likely clobbered it)"
Packit Service 336c1b
		$VERBOSE_ECHO "rm -f ${file}"
Packit Service 336c1b
		rm -f ${file}
Packit Service 336c1b
		$VERBOSE_ECHO "mv ${file}.$$.protect_from_automake.backup ${file}"
Packit Service 336c1b
		mv ${file}.$$.protect_from_automake.backup ${file}
Packit Service 336c1b
	    fi # check contents
Packit Service 336c1b
	    elif test -f ${file}.$$.protect_from_automake.backup ; then
Packit Service 336c1b
		$VERBOSE_ECHO "mv ${file}.$$.protect_from_automake.backup ${file}"
Packit Service 336c1b
		mv ${file}.$$.protect_from_automake.backup ${file}
Packit Service 336c1b
	    fi # -f ${file}
Packit Service 336c1b
	
Packit Service 336c1b
	    # just in case
Packit Service 336c1b
	    $VERBOSE_ECHO "rm -f ${file}.$$.protect_from_automake.backup"
Packit Service 336c1b
	    rm -f ${file}.$$.protect_from_automake.backup
Packit Service 336c1b
	fi # -f ${file}.$$.protect_from_automake.backup
Packit Service 336c1b
    done
Packit Service 336c1b
Packit Service 336c1b
    CONFIGURE="`locate_configure_template`"
Packit Service 336c1b
    if [ "x$CONFIGURE" = "x" ] ; then
Packit Service 336c1b
	return
Packit Service 336c1b
    fi
Packit Service 336c1b
Packit Service 336c1b
    _aux_dir="`grep AC_CONFIG_AUX_DIR $CONFIGURE | grep -v '.*#.*AC_CONFIG_AUX_DIR' | tail -${TAIL_N}1 | sed 's/^[ 	]*AC_CONFIG_AUX_DIR(\(.*\)).*/\1/' | sed 's/.*\[\(.*\)\].*/\1/'`"
Packit Service 336c1b
    if test ! -d "$_aux_dir" ; then
Packit Service 336c1b
	_aux_dir=.
Packit Service 336c1b
    fi
Packit Service 336c1b
Packit Service 336c1b
    for file in config.guess config.sub ltmain.sh ; do
Packit Service 336c1b
	if test -f "${_aux_dir}/${file}" ; then
Packit Service 336c1b
	    $VERBOSE_ECHO "rm -f \"${_aux_dir}/${file}.backup\""
Packit Service 336c1b
	    rm -f "${_aux_dir}/${file}.backup"
Packit Service 336c1b
	fi
Packit Service 336c1b
    done
Packit Service 336c1b
} # end of restore_clobbered
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
##############################
Packit Service 336c1b
# RECURSIVE_RESTORE FUNCTION #
Packit Service 336c1b
##############################
Packit Service 336c1b
recursive_restore ( ) {
Packit Service 336c1b
Packit Service 336c1b
    # restore COPYING and INSTALL from backup if they were clobbered
Packit Service 336c1b
    # for each directory recursively.
Packit Service 336c1b
Packit Service 336c1b
    # git 'r undone
Packit Service 336c1b
    restore_clobbered
Packit Service 336c1b
Packit Service 336c1b
    # find configure template
Packit Service 336c1b
    _configure="`locate_configure_template`"
Packit Service 336c1b
    if [ "x$_configure" = "x" ] ; then
Packit Service 336c1b
	return
Packit Service 336c1b
    fi
Packit Service 336c1b
Packit Service 336c1b
    # look for subdirs
Packit Service 336c1b
    _det_config_subdirs="`grep AC_CONFIG_SUBDIRS $_configure | grep -v '.*#.*AC_CONFIG_SUBDIRS' | sed 's/^[ 	]*AC_CONFIG_SUBDIRS(\(.*\)).*/\1/' | sed 's/.*\[\(.*\)\].*/\1/'`"
Packit Service 336c1b
    CHECK_DIRS=""
Packit Service 336c1b
    for dir in $_det_config_subdirs ; do
Packit Service 336c1b
	if test -d "`pwd`/$dir" ; then
Packit Service 336c1b
	    CHECK_DIRS="$CHECK_DIRS \"`pwd`/$dir\""
Packit Service 336c1b
	fi
Packit Service 336c1b
    done
Packit Service 336c1b
Packit Service 336c1b
    # process subdirs
Packit Service 336c1b
    if [ ! "x$CHECK_DIRS" = "x" ] ; then
Packit Service 336c1b
	$VERBOSE_ECHO "Recursively scanning the following directories:"
Packit Service 336c1b
	$VERBOSE_ECHO "  $CHECK_DIRS"
Packit Service 336c1b
	for dir in $CHECK_DIRS ; do
Packit Service 336c1b
	    $VERBOSE_ECHO "Checking files for automake damage in $dir"
Packit Service 336c1b
	    cd "$START_PATH"
Packit Service 336c1b
	    eval "cd $dir"
Packit Service 336c1b
Packit Service 336c1b
	    # recursively git 'r undone
Packit Service 336c1b
	    recursive_restore
Packit Service 336c1b
	done
Packit Service 336c1b
    fi
Packit Service 336c1b
} # end of recursive_restore
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
#######################
Packit Service 336c1b
# INITIALIZE FUNCTION #
Packit Service 336c1b
#######################
Packit Service 336c1b
initialize ( ) {
Packit Service 336c1b
Packit Service 336c1b
    # this routine performs a variety of directory-specific
Packit Service 336c1b
    # initializations.  some are sanity checks, some are preventive,
Packit Service 336c1b
    # and some are necessary setup detection.
Packit Service 336c1b
    #
Packit Service 336c1b
    # this function sets:
Packit Service 336c1b
    #   CONFIGURE
Packit Service 336c1b
    #   SEARCH_DIRS
Packit Service 336c1b
    #   CONFIG_SUBDIRS
Packit Service 336c1b
Packit Service 336c1b
    ##################################
Packit Service 336c1b
    # check for a configure template #
Packit Service 336c1b
    ##################################
Packit Service 336c1b
    CONFIGURE="`locate_configure_template`"
Packit Service 336c1b
    if [ "x$CONFIGURE" = "x" ] ; then
Packit Service 336c1b
	$ECHO
Packit Service 336c1b
	$ECHO "A configure.ac or configure.in file could not be located implying"
Packit Service 336c1b
	$ECHO "that the GNU Build System is at least not used in this directory.  In"
Packit Service 336c1b
	$ECHO "any case, there is nothing to do here without one of those files."
Packit Service 336c1b
	$ECHO
Packit Service 336c1b
	$ECHO "ERROR: No configure.in or configure.ac file found in `pwd`"
Packit Service 336c1b
	exit 1
Packit Service 336c1b
    fi
Packit Service 336c1b
Packit Service 336c1b
    #####################
Packit Service 336c1b
    # detect an aux dir #
Packit Service 336c1b
    #####################
Packit Service 336c1b
    _aux_dir="`grep AC_CONFIG_AUX_DIR $CONFIGURE | grep -v '.*#.*AC_CONFIG_AUX_DIR' | tail -${TAIL_N}1 | sed 's/^[ 	]*AC_CONFIG_AUX_DIR(\(.*\)).*/\1/' | sed 's/.*\[\(.*\)\].*/\1/'`"
Packit Service 336c1b
    if test ! -d "$_aux_dir" ; then
Packit Service 336c1b
	_aux_dir=.
Packit Service 336c1b
    else
Packit Service 336c1b
	$VERBOSE_ECHO "Detected auxillary directory: $_aux_dir"
Packit Service 336c1b
    fi
Packit Service 336c1b
Packit Service 336c1b
    ################################
Packit Service 336c1b
    # detect a recursive configure #
Packit Service 336c1b
    ################################
Packit Service 336c1b
    CONFIG_SUBDIRS=""
Packit Service 336c1b
    _det_config_subdirs="`grep AC_CONFIG_SUBDIRS $CONFIGURE | grep -v '.*#.*AC_CONFIG_SUBDIRS' | sed 's/^[ 	]*AC_CONFIG_SUBDIRS(\(.*\)).*/\1/' | sed 's/.*\[\(.*\)\].*/\1/'`"
Packit Service 336c1b
    for dir in $_det_config_subdirs ; do
Packit Service 336c1b
	if test -d "`pwd`/$dir" ; then
Packit Service 336c1b
	    $VERBOSE_ECHO "Detected recursive configure directory: `pwd`/$dir"
Packit Service 336c1b
	    CONFIG_SUBDIRS="$CONFIG_SUBDIRS `pwd`/$dir"
Packit Service 336c1b
	fi
Packit Service 336c1b
    done
Packit Service 336c1b
Packit Service 336c1b
    ###########################################################
Packit Service 336c1b
    # make sure certain required files exist for GNU projects #
Packit Service 336c1b
    ###########################################################
Packit Service 336c1b
    _marker_found=""
Packit Service 336c1b
    _marker_found_message_intro='Detected non-GNU marker "'
Packit Service 336c1b
    _marker_found_message_mid='" in '
Packit Service 336c1b
    for marker in foreign cygnus ; do
Packit Service 336c1b
	_marker_found_message=${_marker_found_message_intro}${marker}${_marker_found_message_mid}
Packit Service 336c1b
	_marker_found="`grep 'AM_INIT_AUTOMAKE.*'${marker} $CONFIGURE`"
Packit Service 336c1b
	if [ ! "x$_marker_found" = "x" ] ; then
Packit Service 336c1b
	    $VERBOSE_ECHO "${_marker_found_message}`basename \"$CONFIGURE\"`"
Packit Service 336c1b
	    break
Packit Service 336c1b
	fi
Packit Service 336c1b
	if test -f "`dirname \"$CONFIGURE\"/Makefile.am`" ; then
Packit Service 336c1b
	    _marker_found="`grep 'AUTOMAKE_OPTIONS.*'${marker} Makefile.am`"
Packit Service 336c1b
	    if [ ! "x$_marker_found" = "x" ] ; then
Packit Service 336c1b
		$VERBOSE_ECHO "${_marker_found_message}Makefile.am"
Packit Service 336c1b
		break
Packit Service 336c1b
	    fi
Packit Service 336c1b
	fi
Packit Service 336c1b
    done
Packit Service 336c1b
    if [ "x${_marker_found}" = "x" ] ; then
Packit Service 336c1b
	_suggest_foreign=no
Packit Service 336c1b
	for file in AUTHORS COPYING ChangeLog INSTALL NEWS README ; do
Packit Service 336c1b
	    if [ ! -f $file ] ; then
Packit Service 336c1b
		$VERBOSE_ECHO "Touching ${file} since it does not exist"
Packit Service 336c1b
		_suggest_foreign=yes
Packit Service 336c1b
		touch $file
Packit Service 336c1b
	    fi
Packit Service 336c1b
	done
Packit Service 336c1b
Packit Service 336c1b
	if [ "x${_suggest_foreign}" = "xyes" ] ; then
Packit Service 336c1b
	    $ECHO
Packit Service 336c1b
	    $ECHO "Warning: Several files expected of projects that conform to the GNU"
Packit Service 336c1b
	    $ECHO "coding standards were not found.  The files were automatically added"
Packit Service 336c1b
	    $ECHO "for you since you do not have a 'foreign' declaration specified."
Packit Service 336c1b
	    $ECHO
Packit Service 336c1b
	    $ECHO "Considered adding 'foreign' to AM_INIT_AUTOMAKE in `basename \"$CONFIGURE\"`"
Packit Service 336c1b
	    if test -f "`dirname \"$CONFIGURE\"/Makefile.am`" ; then
Packit Service 336c1b
		$ECHO "or to AUTOMAKE_OPTIONS in your top-level Makefile.am file."
Packit Service 336c1b
	    fi
Packit Service 336c1b
	    $ECHO
Packit Service 336c1b
	fi
Packit Service 336c1b
    fi
Packit Service 336c1b
Packit Service 336c1b
    ##################################################
Packit Service 336c1b
    # make sure certain generated files do not exist #
Packit Service 336c1b
    ##################################################
Packit Service 336c1b
    for file in config.guess config.sub ltmain.sh ; do
Packit Service 336c1b
	if test -f "${_aux_dir}/${file}" ; then
Packit Service 336c1b
	    $VERBOSE_ECHO "mv -f \"${_aux_dir}/${file}\" \"${_aux_dir}/${file}.backup\""
Packit Service 336c1b
	    mv -f "${_aux_dir}/${file}" "${_aux_dir}/${file}.backup"
Packit Service 336c1b
	fi
Packit Service 336c1b
    done
Packit Service 336c1b
Packit Service 336c1b
    ############################
Packit Service 336c1b
    # search alternate m4 dirs #
Packit Service 336c1b
    ############################
Packit Service 336c1b
    SEARCH_DIRS=""
Packit Service 336c1b
    for dir in m4 ; do
Packit Service 336c1b
	if [ -d $dir ] ; then
Packit Service 336c1b
	    $VERBOSE_ECHO "Found extra aclocal search directory: $dir"
Packit Service 336c1b
	    SEARCH_DIRS="$SEARCH_DIRS -I $dir"
Packit Service 336c1b
	fi
Packit Service 336c1b
    done
Packit Service 336c1b
Packit Service 336c1b
    ######################################
Packit Service 336c1b
    # remove any previous build products #
Packit Service 336c1b
    ######################################
Packit Service 336c1b
    if test -d autom4te.cache ; then
Packit Service 336c1b
	$VERBOSE_ECHO "Found an autom4te.cache directory, deleting it"
Packit Service 336c1b
	$VERBOSE_ECHO "rm -rf autom4te.cache"
Packit Service 336c1b
	rm -rf autom4te.cache
Packit Service 336c1b
    fi
Packit Service 336c1b
# tcl/tk (and probably others) have a customized aclocal.m4, so can't delete it
Packit Service 336c1b
#     if test -f aclocal.m4 ; then
Packit Service 336c1b
# 	$VERBOSE_ECHO "Found an aclocal.m4 file, deleting it"
Packit Service 336c1b
# 	$VERBOSE_ECHO "rm -f aclocal.m4"
Packit Service 336c1b
# 	rm -f aclocal.m4
Packit Service 336c1b
#     fi
Packit Service 336c1b
Packit Service 336c1b
} # end of initialize()
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
##############
Packit Service 336c1b
# initialize #
Packit Service 336c1b
##############
Packit Service 336c1b
Packit Service 336c1b
# stash path
Packit Service 336c1b
START_PATH="`pwd`"
Packit Service 336c1b
Packit Service 336c1b
# Before running autoreconf or manual steps, some prep detection work
Packit Service 336c1b
# is necessary or useful.  Only needs to occur once per directory, but
Packit Service 336c1b
# does need to traverse the entire subconfigure hierarchy to protect
Packit Service 336c1b
# files from being clobbered even by autoreconf.
Packit Service 336c1b
recursive_protect
Packit Service 336c1b
Packit Service 336c1b
# start from where we started
Packit Service 336c1b
cd "$START_PATH"
Packit Service 336c1b
Packit Service 336c1b
# get ready to process
Packit Service 336c1b
initialize
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
#########################################
Packit Service 336c1b
# DOWNLOAD_GNULIB_CONFIG_GUESS FUNCTION #
Packit Service 336c1b
#########################################
Packit Service 336c1b
Packit Service 336c1b
# TODO - should make sure wget/curl exist and/or work before trying to
Packit Service 336c1b
# use them.
Packit Service 336c1b
Packit Service 336c1b
download_gnulib_config_guess () {
Packit Service 336c1b
    # abuse gitweb to download gnulib's latest config.guess via HTTP
Packit Service 336c1b
    config_guess_temp="config.guess.$$.download"
Packit Service 336c1b
    ret=1
Packit Service 336c1b
    for __cmd in wget curl fetch ; do
Packit Service 336c1b
	$VERBOSE_ECHO "Checking for command ${__cmd}"
Packit Service 336c1b
	${__cmd} --version > /dev/null 2>&1
Packit Service 336c1b
	ret=$?
Packit Service 336c1b
	if [ ! $ret = 0 ] ; then
Packit Service 336c1b
	    continue
Packit Service 336c1b
        fi
Packit Service 336c1b
Packit Service 336c1b
	__cmd_version=`${__cmd} --version | head -n 1 | sed -e 's/^[^0-9]\+//' -e 's/ .*//'`
Packit Service 336c1b
	$VERBOSE_ECHO "Found ${__cmd} ${__cmd_version}"
Packit Service 336c1b
Packit Service 336c1b
	opts=""
Packit Service 336c1b
	case ${__cmd} in
Packit Service 336c1b
	    wget)
Packit Service 336c1b
		opts="-O" 
Packit Service 336c1b
		;;
Packit Service 336c1b
	    curl)
Packit Service 336c1b
		opts="-o"
Packit Service 336c1b
		;;
Packit Service 336c1b
	    fetch)
Packit Service 336c1b
		opts="-t 5 -f"
Packit Service 336c1b
		;;
Packit Service 336c1b
	esac
Packit Service 336c1b
Packit Service 336c1b
	$VERBOSE_ECHO "Running $__cmd \"${CONFIG_GUESS_URL}\" $opts \"${config_guess_temp}\""
Packit Service 336c1b
	eval "$__cmd \"${CONFIG_GUESS_URL}\" $opts \"${config_guess_temp}\"" > /dev/null 2>&1
Packit Service 336c1b
	if [ $? = 0 ] ; then
Packit Service 336c1b
	    mv -f "${config_guess_temp}" ${_aux_dir}/config.guess
Packit Service 336c1b
	    ret=0
Packit Service 336c1b
	    break
Packit Service 336c1b
	fi
Packit Service 336c1b
    done
Packit Service 336c1b
Packit Service 336c1b
    if [ ! $ret = 0 ] ; then
Packit Service 336c1b
	$ECHO "Warning: config.guess download failed from: $CONFIG_GUESS_URL"
Packit Service 336c1b
	rm -f "${config_guess_temp}"
Packit Service 336c1b
    fi
Packit Service 336c1b
}
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
##############################
Packit Service 336c1b
# LIBTOOLIZE_NEEDED FUNCTION #
Packit Service 336c1b
##############################
Packit Service 336c1b
libtoolize_needed () {
Packit Service 336c1b
    ret=1 # means no, don't need libtoolize
Packit Service 336c1b
    for feature in AC_PROG_LIBTOOL AM_PROG_LIBTOOL LT_INIT ; do
Packit Service 336c1b
	$VERBOSE_ECHO "Searching for $feature in $CONFIGURE"
Packit Service 336c1b
	found="`grep \"^$feature.*\" $CONFIGURE`"
Packit Service 336c1b
	if [ ! "x$found" = "x" ] ; then
Packit Service 336c1b
	    ret=0 # means yes, need to run libtoolize
Packit Service 336c1b
	    break
Packit Service 336c1b
	fi
Packit Service 336c1b
    done
Packit Service 336c1b
    return ${ret}
Packit Service 336c1b
}
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
############################################
Packit Service 336c1b
# prepare build via autoreconf or manually #
Packit Service 336c1b
############################################
Packit Service 336c1b
reconfigure_manually=no
Packit Service 336c1b
if [ "x$HAVE_AUTORECONF" = "xyes" ] ; then
Packit Service 336c1b
    $ECHO
Packit Service 336c1b
    $ECHO $ECHO_N "Automatically preparing build ... $ECHO_C"
Packit Service 336c1b
Packit Service 336c1b
    $VERBOSE_ECHO "$AUTORECONF $SEARCH_DIRS $AUTORECONF_OPTIONS"
Packit Service 336c1b
    autoreconf_output="`$AUTORECONF $SEARCH_DIRS $AUTORECONF_OPTIONS 2>&1`"
Packit Service 336c1b
    ret=$?
Packit Service 336c1b
    $VERBOSE_ECHO "$autoreconf_output"
Packit Service 336c1b
Packit Service 336c1b
    if [ ! $ret = 0 ] ; then
Packit Service 336c1b
	if [ "x$HAVE_ALT_LIBTOOLIZE" = "xyes" ] ; then
Packit Service 336c1b
	    if [ ! "x`echo \"$autoreconf_output\" | grep libtoolize | grep \"No such file or directory\"`" = "x" ] ; then
Packit Service 336c1b
		$ECHO
Packit Service 336c1b
		$ECHO "Warning: autoreconf failed but due to what is usually a common libtool"
Packit Service 336c1b
		$ECHO "misconfiguration issue.  This problem is encountered on systems that"
Packit Service 336c1b
		$ECHO "have installed libtoolize under a different name without providing a"
Packit Service 336c1b
		$ECHO "symbolic link or without setting the LIBTOOLIZE environment variable."
Packit Service 336c1b
		$ECHO
Packit Service 336c1b
		$ECHO "Restarting the preparation steps with LIBTOOLIZE set to $LIBTOOLIZE"
Packit Service 336c1b
Packit Service 336c1b
		export LIBTOOLIZE
Packit Service 336c1b
		RUN_RECURSIVE=no
Packit Service 336c1b
		export RUN_RECURSIVE
Packit Service 336c1b
		untrap_abnormal
Packit Service 336c1b
Packit Service 336c1b
		$VERBOSE_ECHO sh $AUTOGEN_SH "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9"
Packit Service 336c1b
		sh "$AUTOGEN_SH" "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9"
Packit Service 336c1b
		exit $?
Packit Service 336c1b
	    fi
Packit Service 336c1b
	fi
Packit Service 336c1b
Packit Service 336c1b
	$ECHO "Warning: $AUTORECONF failed"
Packit Service 336c1b
Packit Service 336c1b
	if test -f ltmain.sh ; then
Packit Service 336c1b
	    $ECHO "libtoolize being run by autoreconf is not creating ltmain.sh in the auxillary directory like it should"
Packit Service 336c1b
	fi
Packit Service 336c1b
Packit Service 336c1b
	$ECHO "Attempting to run the preparation steps individually"
Packit Service 336c1b
	reconfigure_manually=yes
Packit Service 336c1b
    else
Packit Service 336c1b
	if [ "x$DOWNLOAD" = "xyes" ] ; then
Packit Service 336c1b
	    if libtoolize_needed ; then
Packit Service 336c1b
		download_gnulib_config_guess
Packit Service 336c1b
	    fi
Packit Service 336c1b
	fi
Packit Service 336c1b
    fi
Packit Service 336c1b
else
Packit Service 336c1b
    reconfigure_manually=yes
Packit Service 336c1b
fi
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
############################
Packit Service 336c1b
# LIBTOOL_FAILURE FUNCTION #
Packit Service 336c1b
############################
Packit Service 336c1b
libtool_failure ( ) {
Packit Service 336c1b
Packit Service 336c1b
    # libtool is rather error-prone in comparison to the other
Packit Service 336c1b
    # autotools and this routine attempts to compensate for some
Packit Service 336c1b
    # common failures.  the output after a libtoolize failure is
Packit Service 336c1b
    # parsed for an error related to AC_PROG_LIBTOOL and if found, we
Packit Service 336c1b
    # attempt to inject a project-provided libtool.m4 file.
Packit Service 336c1b
Packit Service 336c1b
    _autoconf_output="$1"
Packit Service 336c1b
Packit Service 336c1b
    if [ "x$RUN_RECURSIVE" = "xno" ] ; then
Packit Service 336c1b
	# we already tried the libtool.m4, don't try again
Packit Service 336c1b
	return 1
Packit Service 336c1b
    fi
Packit Service 336c1b
Packit Service 336c1b
    if test -f "$LIBTOOL_M4" ; then
Packit Service 336c1b
	found_libtool="`$ECHO $_autoconf_output | grep AC_PROG_LIBTOOL`"
Packit Service 336c1b
	if test ! "x$found_libtool" = "x" ; then
Packit Service 336c1b
	    if test -f acinclude.m4 ; then
Packit Service 336c1b
		rm -f acinclude.m4.$$.backup
Packit Service 336c1b
		$VERBOSE_ECHO "cat acinclude.m4 > acinclude.m4.$$.backup"
Packit Service 336c1b
		cat acinclude.m4 > acinclude.m4.$$.backup
Packit Service 336c1b
	    fi
Packit Service 336c1b
	    $VERBOSE_ECHO "cat \"$LIBTOOL_M4\" >> acinclude.m4"
Packit Service 336c1b
	    chmod u+w acinclude.m4
Packit Service 336c1b
	    cat "$LIBTOOL_M4" >> acinclude.m4
Packit Service 336c1b
Packit Service 336c1b
	    # don't keep doing this
Packit Service 336c1b
	    RUN_RECURSIVE=no
Packit Service 336c1b
	    export RUN_RECURSIVE
Packit Service 336c1b
	    untrap_abnormal
Packit Service 336c1b
Packit Service 336c1b
	    $ECHO
Packit Service 336c1b
	    $ECHO "Restarting the preparation steps with libtool macros in acinclude.m4"
Packit Service 336c1b
	    $VERBOSE_ECHO sh $AUTOGEN_SH "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9"
Packit Service 336c1b
	    sh "$AUTOGEN_SH" "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9"
Packit Service 336c1b
	    exit $?
Packit Service 336c1b
	fi
Packit Service 336c1b
    fi
Packit Service 336c1b
}
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
###########################
Packit Service 336c1b
# MANUAL_AUTOGEN FUNCTION #
Packit Service 336c1b
###########################
Packit Service 336c1b
manual_autogen ( ) {
Packit Service 336c1b
Packit Service 336c1b
    ##################################################
Packit Service 336c1b
    # Manual preparation steps taken are as follows: #
Packit Service 336c1b
    #   aclocal [-I m4]                              #
Packit Service 336c1b
    #   libtoolize --automake -c -f                  #
Packit Service 336c1b
    #   aclocal [-I m4]                              #
Packit Service 336c1b
    #   autoconf -f                                  #
Packit Service 336c1b
    #   autoheader                                   #
Packit Service 336c1b
    #   automake -a -c -f                            #
Packit Service 336c1b
    ##################################################
Packit Service 336c1b
Packit Service 336c1b
    ###########
Packit Service 336c1b
    # aclocal #
Packit Service 336c1b
    ###########
Packit Service 336c1b
    $VERBOSE_ECHO "$ACLOCAL $SEARCH_DIRS $ACLOCAL_OPTIONS"
Packit Service 336c1b
    aclocal_output="`$ACLOCAL $SEARCH_DIRS $ACLOCAL_OPTIONS 2>&1`"
Packit Service 336c1b
    ret=$?
Packit Service 336c1b
    $VERBOSE_ECHO "$aclocal_output"
Packit Service 336c1b
    if [ ! $ret = 0 ] ; then $ECHO "ERROR: $ACLOCAL failed" && exit 2 ; fi
Packit Service 336c1b
Packit Service 336c1b
    ##############
Packit Service 336c1b
    # libtoolize #
Packit Service 336c1b
    ##############
Packit Service 336c1b
    if libtoolize_needed ; then
Packit Service 336c1b
	if [ "x$HAVE_LIBTOOLIZE" = "xyes" ] ; then
Packit Service 336c1b
	    $VERBOSE_ECHO "$LIBTOOLIZE $LIBTOOLIZE_OPTIONS"
Packit Service 336c1b
	    libtoolize_output="`$LIBTOOLIZE $LIBTOOLIZE_OPTIONS 2>&1`"
Packit Service 336c1b
	    ret=$?
Packit Service 336c1b
	    $VERBOSE_ECHO "$libtoolize_output"
Packit Service 336c1b
Packit Service 336c1b
	    if [ ! $ret = 0 ] ; then $ECHO "ERROR: $LIBTOOLIZE failed" && exit 2 ; fi
Packit Service 336c1b
	else
Packit Service 336c1b
	    if [ "x$HAVE_ALT_LIBTOOLIZE" = "xyes" ] ; then
Packit Service 336c1b
		$VERBOSE_ECHO "$LIBTOOLIZE $ALT_LIBTOOLIZE_OPTIONS"
Packit Service 336c1b
		libtoolize_output="`$LIBTOOLIZE $ALT_LIBTOOLIZE_OPTIONS 2>&1`"
Packit Service 336c1b
		ret=$?
Packit Service 336c1b
		$VERBOSE_ECHO "$libtoolize_output"
Packit Service 336c1b
Packit Service 336c1b
		if [ ! $ret = 0 ] ; then $ECHO "ERROR: $LIBTOOLIZE failed" && exit 2 ; fi
Packit Service 336c1b
	    fi
Packit Service 336c1b
	fi
Packit Service 336c1b
Packit Service 336c1b
	###########
Packit Service 336c1b
	# aclocal #
Packit Service 336c1b
	###########
Packit Service 336c1b
	# re-run again as instructed by libtoolize
Packit Service 336c1b
	$VERBOSE_ECHO "$ACLOCAL $SEARCH_DIRS $ACLOCAL_OPTIONS"
Packit Service 336c1b
	aclocal_output="`$ACLOCAL $SEARCH_DIRS $ACLOCAL_OPTIONS 2>&1`"
Packit Service 336c1b
	ret=$?
Packit Service 336c1b
	$VERBOSE_ECHO "$aclocal_output"
Packit Service 336c1b
Packit Service 336c1b
	# libtoolize might put ltmain.sh in the wrong place
Packit Service 336c1b
	if test -f ltmain.sh ; then
Packit Service 336c1b
	    if test ! -f "${_aux_dir}/ltmain.sh" ; then
Packit Service 336c1b
		$ECHO
Packit Service 336c1b
		$ECHO "Warning:  $LIBTOOLIZE is creating ltmain.sh in the wrong directory"
Packit Service 336c1b
		$ECHO
Packit Service 336c1b
		$ECHO "Fortunately, the problem can be worked around by simply copying the"
Packit Service 336c1b
		$ECHO "file to the appropriate location (${_aux_dir}/).  This has been done for you."
Packit Service 336c1b
		$ECHO
Packit Service 336c1b
		$VERBOSE_ECHO "cp -p ltmain.sh \"${_aux_dir}/ltmain.sh\""
Packit Service 336c1b
		cp -p ltmain.sh "${_aux_dir}/ltmain.sh"
Packit Service 336c1b
		$ECHO $ECHO_N "Continuing build preparation ... $ECHO_C"
Packit Service 336c1b
	    fi
Packit Service 336c1b
	fi # ltmain.sh
Packit Service 336c1b
Packit Service 336c1b
	if [ "x$DOWNLOAD" = "xyes" ] ; then
Packit Service 336c1b
	    download_gnulib_config_guess
Packit Service 336c1b
	fi
Packit Service 336c1b
    fi # libtoolize_needed
Packit Service 336c1b
Packit Service 336c1b
    ############
Packit Service 336c1b
    # autoconf #
Packit Service 336c1b
    ############
Packit Service 336c1b
    $VERBOSE_ECHO
Packit Service 336c1b
    $VERBOSE_ECHO "$AUTOCONF $AUTOCONF_OPTIONS"
Packit Service 336c1b
    autoconf_output="`$AUTOCONF $AUTOCONF_OPTIONS 2>&1`"
Packit Service 336c1b
    ret=$?
Packit Service 336c1b
    $VERBOSE_ECHO "$autoconf_output"
Packit Service 336c1b
Packit Service 336c1b
    if [ ! $ret = 0 ] ; then
Packit Service 336c1b
	# retry without the -f and check for usage of macros that are too new
Packit Service 336c1b
	ac2_59_macros="AC_C_RESTRICT AC_INCLUDES_DEFAULT AC_LANG_ASSERT AC_LANG_WERROR AS_SET_CATFILE"
Packit Service 336c1b
	ac2_55_macros="AC_COMPILER_IFELSE AC_FUNC_MBRTOWC AC_HEADER_STDBOOL AC_LANG_CONFTEST AC_LANG_SOURCE AC_LANG_PROGRAM AC_LANG_CALL AC_LANG_FUNC_TRY_LINK AC_MSG_FAILURE AC_PREPROC_IFELSE"
Packit Service 336c1b
	ac2_54_macros="AC_C_BACKSLASH_A AC_CONFIG_LIBOBJ_DIR AC_GNU_SOURCE AC_PROG_EGREP AC_PROG_FGREP AC_REPLACE_FNMATCH AC_FUNC_FNMATCH_GNU AC_FUNC_REALLOC AC_TYPE_MBSTATE_T"
Packit Service 336c1b
Packit Service 336c1b
	macros_to_search=""
Packit Service 336c1b
	ac_major="`echo ${AUTOCONF_VERSION}. | cut -d. -f1 | sed 's/[^0-9]//g'`"
Packit Service 336c1b
	ac_minor="`echo ${AUTOCONF_VERSION}. | cut -d. -f2 | sed 's/[^0-9]//g'`"
Packit Service 336c1b
Packit Service 336c1b
	if [ $ac_major -lt 2 ] ; then
Packit Service 336c1b
	    macros_to_search="$ac2_59_macros $ac2_55_macros $ac2_54_macros"
Packit Service 336c1b
	else
Packit Service 336c1b
	    if [ $ac_minor -lt 54 ] ; then
Packit Service 336c1b
		macros_to_search="$ac2_59_macros $ac2_55_macros $ac2_54_macros"
Packit Service 336c1b
	    elif [ $ac_minor -lt 55 ] ; then
Packit Service 336c1b
		macros_to_search="$ac2_59_macros $ac2_55_macros"
Packit Service 336c1b
	    elif [ $ac_minor -lt 59 ] ; then
Packit Service 336c1b
		macros_to_search="$ac2_59_macros"
Packit Service 336c1b
	    fi
Packit Service 336c1b
	fi
Packit Service 336c1b
Packit Service 336c1b
	configure_ac_macros=__none__
Packit Service 336c1b
	for feature in $macros_to_search ; do
Packit Service 336c1b
	    $VERBOSE_ECHO "Searching for $feature in $CONFIGURE"
Packit Service 336c1b
	    found="`grep \"^$feature.*\" $CONFIGURE`"
Packit Service 336c1b
	    if [ ! "x$found" = "x" ] ; then
Packit Service 336c1b
		if [ "x$configure_ac_macros" = "x__none__" ] ; then
Packit Service 336c1b
		    configure_ac_macros="$feature"
Packit Service 336c1b
		else
Packit Service 336c1b
		    configure_ac_macros="$feature $configure_ac_macros"
Packit Service 336c1b
		fi
Packit Service 336c1b
	    fi
Packit Service 336c1b
	done
Packit Service 336c1b
	if [ ! "x$configure_ac_macros" = "x__none__" ] ; then
Packit Service 336c1b
	    $ECHO
Packit Service 336c1b
	    $ECHO "Warning:  Unsupported macros were found in $CONFIGURE"
Packit Service 336c1b
	    $ECHO
Packit Service 336c1b
	    $ECHO "The `basename \"$CONFIGURE\"` file was scanned in order to determine if any"
Packit Service 336c1b
	    $ECHO "unsupported macros are used that exceed the minimum version"
Packit Service 336c1b
	    $ECHO "settings specified within this file.  As such, the following macros"
Packit Service 336c1b
	    $ECHO "should be removed from configure.ac or the version numbers in this"
Packit Service 336c1b
	    $ECHO "file should be increased:"
Packit Service 336c1b
	    $ECHO
Packit Service 336c1b
	    $ECHO "$configure_ac_macros"
Packit Service 336c1b
	    $ECHO
Packit Service 336c1b
	    $ECHO $ECHO_N "Ignorantly continuing build preparation ... $ECHO_C"
Packit Service 336c1b
	fi
Packit Service 336c1b
Packit Service 336c1b
	###################
Packit Service 336c1b
	# autoconf, retry #
Packit Service 336c1b
	###################
Packit Service 336c1b
	$VERBOSE_ECHO
Packit Service 336c1b
	$VERBOSE_ECHO "$AUTOCONF"
Packit Service 336c1b
	autoconf_output="`$AUTOCONF 2>&1`"
Packit Service 336c1b
	ret=$?
Packit Service 336c1b
	$VERBOSE_ECHO "$autoconf_output"
Packit Service 336c1b
Packit Service 336c1b
	if [ ! $ret = 0 ] ; then
Packit Service 336c1b
	    # test if libtool is busted
Packit Service 336c1b
	    libtool_failure "$autoconf_output"
Packit Service 336c1b
Packit Service 336c1b
	    # let the user know what went wrong
Packit Service 336c1b
	    cat <
Packit Service 336c1b
$autoconf_output
Packit Service 336c1b
EOF
Packit Service 336c1b
	    $ECHO "ERROR: $AUTOCONF failed"
Packit Service 336c1b
	    exit 2
Packit Service 336c1b
	else
Packit Service 336c1b
	    # autoconf sans -f and possibly sans unsupported options succeed so warn verbosely
Packit Service 336c1b
	    $ECHO
Packit Service 336c1b
	    $ECHO "Warning: autoconf seems to have succeeded by removing the following options:"
Packit Service 336c1b
	    $ECHO "	AUTOCONF_OPTIONS=\"$AUTOCONF_OPTIONS\""
Packit Service 336c1b
	    $ECHO
Packit Service 336c1b
	    $ECHO "Removing those options should not be necessary and indicate some other"
Packit Service 336c1b
	    $ECHO "problem with the build system.  The build preparation is highly suspect"
Packit Service 336c1b
	    $ECHO "and may result in configuration or compilation errors.  Consider"
Packit Service 336c1b
	    if [ "x$VERBOSE_ECHO" = "x:" ] ; then
Packit Service 336c1b
		$ECHO "rerunning the build preparation with verbose output enabled."
Packit Service 336c1b
		$ECHO "	$AUTOGEN_SH --verbose"
Packit Service 336c1b
	    else
Packit Service 336c1b
		$ECHO "reviewing the minimum GNU Autotools version settings contained in"
Packit Service 336c1b
		$ECHO "this script along with the macros being used in your `basename \"$CONFIGURE\"` file."
Packit Service 336c1b
	    fi
Packit Service 336c1b
	    $ECHO
Packit Service 336c1b
	    $ECHO $ECHO_N "Continuing build preparation ... $ECHO_C"
Packit Service 336c1b
	fi # autoconf ret = 0
Packit Service 336c1b
    fi # autoconf ret = 0
Packit Service 336c1b
Packit Service 336c1b
    ##############
Packit Service 336c1b
    # autoheader #
Packit Service 336c1b
    ##############
Packit Service 336c1b
    need_autoheader=no
Packit Service 336c1b
    for feature in AM_CONFIG_HEADER AC_CONFIG_HEADER ; do
Packit Service 336c1b
	$VERBOSE_ECHO "Searching for $feature in $CONFIGURE"
Packit Service 336c1b
	found="`grep \"^$feature.*\" $CONFIGURE`"
Packit Service 336c1b
	if [ ! "x$found" = "x" ] ; then
Packit Service 336c1b
	    need_autoheader=yes
Packit Service 336c1b
	    break
Packit Service 336c1b
	fi
Packit Service 336c1b
    done
Packit Service 336c1b
    if [ "x$need_autoheader" = "xyes" ] ; then
Packit Service 336c1b
	$VERBOSE_ECHO "$AUTOHEADER $AUTOHEADER_OPTIONS"
Packit Service 336c1b
	autoheader_output="`$AUTOHEADER $AUTOHEADER_OPTIONS 2>&1`"
Packit Service 336c1b
	ret=$?
Packit Service 336c1b
	$VERBOSE_ECHO "$autoheader_output"
Packit Service 336c1b
	if [ ! $ret = 0 ] ; then $ECHO "ERROR: $AUTOHEADER failed" && exit 2 ; fi
Packit Service 336c1b
    fi # need_autoheader
Packit Service 336c1b
Packit Service 336c1b
    ############
Packit Service 336c1b
    # automake #
Packit Service 336c1b
    ############
Packit Service 336c1b
    need_automake=no
Packit Service 336c1b
    for feature in AM_INIT_AUTOMAKE ; do
Packit Service 336c1b
	$VERBOSE_ECHO "Searching for $feature in $CONFIGURE"
Packit Service 336c1b
	found="`grep \"^$feature.*\" $CONFIGURE`"
Packit Service 336c1b
	if [ ! "x$found" = "x" ] ; then
Packit Service 336c1b
	    need_automake=yes
Packit Service 336c1b
	    break
Packit Service 336c1b
	fi
Packit Service 336c1b
    done
Packit Service 336c1b
Packit Service 336c1b
    if [ "x$need_automake" = "xyes" ] ; then
Packit Service 336c1b
	$VERBOSE_ECHO "$AUTOMAKE $AUTOMAKE_OPTIONS"
Packit Service 336c1b
	automake_output="`$AUTOMAKE $AUTOMAKE_OPTIONS 2>&1`"
Packit Service 336c1b
	ret=$?
Packit Service 336c1b
	$VERBOSE_ECHO "$automake_output"
Packit Service 336c1b
Packit Service 336c1b
	if [ ! $ret = 0 ] ; then
Packit Service 336c1b
Packit Service 336c1b
	    ###################
Packit Service 336c1b
	    # automake, retry #
Packit Service 336c1b
	    ###################
Packit Service 336c1b
	    $VERBOSE_ECHO
Packit Service 336c1b
	    $VERBOSE_ECHO "$AUTOMAKE $ALT_AUTOMAKE_OPTIONS"
Packit Service 336c1b
	    # retry without the -f
Packit Service 336c1b
	    automake_output="`$AUTOMAKE $ALT_AUTOMAKE_OPTIONS 2>&1`"
Packit Service 336c1b
	    ret=$?
Packit Service 336c1b
	    $VERBOSE_ECHO "$automake_output"
Packit Service 336c1b
Packit Service 336c1b
	    if [ ! $ret = 0 ] ; then
Packit Service 336c1b
	 	# test if libtool is busted
Packit Service 336c1b
		libtool_failure "$automake_output"
Packit Service 336c1b
Packit Service 336c1b
		# let the user know what went wrong
Packit Service 336c1b
		cat <
Packit Service 336c1b
$automake_output
Packit Service 336c1b
EOF
Packit Service 336c1b
		$ECHO "ERROR: $AUTOMAKE failed"
Packit Service 336c1b
		exit 2
Packit Service 336c1b
	    fi # automake retry
Packit Service 336c1b
	fi # automake ret = 0
Packit Service 336c1b
    fi # need_automake
Packit Service 336c1b
} # end of manual_autogen
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
#####################################
Packit Service 336c1b
# RECURSIVE_MANUAL_AUTOGEN FUNCTION #
Packit Service 336c1b
#####################################
Packit Service 336c1b
recursive_manual_autogen ( ) {
Packit Service 336c1b
Packit Service 336c1b
    # run the build preparation steps manually for this directory
Packit Service 336c1b
    manual_autogen
Packit Service 336c1b
Packit Service 336c1b
    # for projects using recursive configure, run the build
Packit Service 336c1b
    # preparation steps for the subdirectories.
Packit Service 336c1b
    if [ ! "x$CONFIG_SUBDIRS" = "x" ] ; then
Packit Service 336c1b
	$VERBOSE_ECHO "Recursively configuring the following directories:"
Packit Service 336c1b
	$VERBOSE_ECHO "  $CONFIG_SUBDIRS"
Packit Service 336c1b
	for dir in $CONFIG_SUBDIRS ; do
Packit Service 336c1b
	    $VERBOSE_ECHO "Processing recursive configure in $dir"
Packit Service 336c1b
	    cd "$START_PATH"
Packit Service 336c1b
	    cd "$dir"
Packit Service 336c1b
Packit Service 336c1b
	    # new directory, prepare
Packit Service 336c1b
	    initialize
Packit Service 336c1b
Packit Service 336c1b
	    # run manual steps for the subdir and any others below
Packit Service 336c1b
	    recursive_manual_autogen
Packit Service 336c1b
	done
Packit Service 336c1b
    fi
Packit Service 336c1b
}
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
################################
Packit Service 336c1b
# run manual preparation steps #
Packit Service 336c1b
################################
Packit Service 336c1b
if [ "x$reconfigure_manually" = "xyes" ] ; then
Packit Service 336c1b
    $ECHO
Packit Service 336c1b
    $ECHO $ECHO_N "Preparing build ... $ECHO_C"
Packit Service 336c1b
Packit Service 336c1b
    recursive_manual_autogen
Packit Service 336c1b
fi
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
#########################
Packit Service 336c1b
# restore and summarize #
Packit Service 336c1b
#########################
Packit Service 336c1b
cd "$START_PATH"
Packit Service 336c1b
Packit Service 336c1b
# restore COPYING and INSTALL from backup if necessary
Packit Service 336c1b
recursive_restore
Packit Service 336c1b
Packit Service 336c1b
# make sure we end up with a configure script
Packit Service 336c1b
config_ac="`locate_configure_template`"
Packit Service 336c1b
config="`echo $config_ac | sed 's/\.ac$//' | sed 's/\.in$//'`"
Packit Service 336c1b
if [ "x$config" = "x" ] ; then
Packit Service 336c1b
    $VERBOSE_ECHO "Could not locate the configure template (from `pwd`)"
Packit Service 336c1b
fi
Packit Service 336c1b
Packit Service 336c1b
# summarize
Packit Service 336c1b
$ECHO "done"
Packit Service 336c1b
$ECHO
Packit Service 336c1b
if test "x$config" = "x" -o ! -f "$config" ; then
Packit Service 336c1b
    $ECHO "WARNING: The $PROJECT build system should now be prepared but there"
Packit Service 336c1b
    $ECHO "does not seem to be a resulting configure file.  This is unexpected"
Packit Service 336c1b
    $ECHO "and likely the result of an error.  You should run $NAME_OF_AUTOGEN"
Packit Service 336c1b
    $ECHO "with the --verbose option to get more details on a potential"
Packit Service 336c1b
    $ECHO "misconfiguration."
Packit Service 336c1b
else
Packit Service 336c1b
    $ECHO "The $PROJECT build system is now prepared.  To build here, run:"
Packit Service 336c1b
    $ECHO "  $config"
Packit Service 336c1b
    $ECHO "  make"
Packit Service 336c1b
fi
Packit Service 336c1b
Packit Service 336c1b
Packit Service 336c1b
# Local Variables:
Packit Service 336c1b
# mode: sh
Packit Service 336c1b
# tab-width: 8
Packit Service 336c1b
# sh-basic-offset: 4
Packit Service 336c1b
# sh-indentation: 4
Packit Service 336c1b
# indent-tabs-mode: t
Packit Service 336c1b
# End:
Packit Service 336c1b
# ex: shiftwidth=4 tabstop=8