4 # Copyright (c) 2005-2007 United States Government as represented by
5 # the U.S. Army Research Laboratory.
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted provided that the following conditions
11 # 1. Redistributions of source code must retain the above copyright
12 # notice, this list of conditions and the following disclaimer.
14 # 2. Redistributions in binary form must reproduce the above
15 # copyright notice, this list of conditions and the following
16 # disclaimer in the documentation and/or other materials provided
17 # with the distribution.
19 # 3. The name of the author may not be used to endorse or promote
20 # products derived from this software without specific prior written
23 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
24 # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
27 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
29 # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
31 # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32 # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 # Script for automatically preparing the sources for compilation by
38 # performing the myrid of necessary steps. The script attempts to
39 # detect proper version support, and outputs warnings about particular
40 # systems that have autotool peculiarities.
42 # Basically, if everything is set up and installed correctly, the
43 # script will validate that minimum versions of the GNU Build System
44 # tools are installed, account for several common configuration
45 # issues, and then simply run autoreconf for you.
47 # If autoreconf fails, which can happen for many valid configurations,
48 # this script proceeds to run manual preparation steps effectively
49 # providing a POSIX shell script (mostly complete) reimplementation of
52 # The AUTORECONF, AUTOCONF, AUTOMAKE, LIBTOOLIZE, ACLOCAL, AUTOHEADER
53 # environment variables and corresponding _OPTIONS variables (e.g.
54 # AUTORECONF_OPTIONS) may be used to override the default automatic
55 # detection behaviors. Similarly the _VERSION variables will override
56 # the minimum required version numbers.
60 # To obtain help on usage:
63 # To obtain verbose output:
64 # ./autogen.sh --verbose
66 # To skip autoreconf and prepare manually:
67 # AUTORECONF=false ./autogen.sh
69 # To verbosely try running with an older (unsupported) autoconf:
70 # AUTOCONF_VERSION=2.50 ./autogen.sh --verbose
72 # Author: Christopher Sean Morrison <morrison@brlcad.org>
74 ######################################################################
76 # set to minimum acceptible version of autoconf
77 if [ "x$AUTOCONF_VERSION" = "x" ] ; then
80 # set to minimum acceptible version of automake
81 if [ "x$AUTOMAKE_VERSION" = "x" ] ; then
82 AUTOMAKE_VERSION
=1.6.0
84 # set to minimum acceptible version of libtool
85 if [ "x$LIBTOOL_VERSION" = "x" ] ; then
94 # extract copyright from header
95 __copyright
="`grep Copyright $AUTOGEN_SH | head -${HEAD_N}1 | awk '{print $4}'`"
96 if [ "x$__copyright" = "x" ] ; then
97 __copyright
="`date +%Y`"
100 # extract version from CVS Id string
101 __id
="$Id: autogen.sh,v 14.97 2007/06/18 22:25:02 brlcad Exp $"
102 __version
="`echo $__id | sed 's/.*\([0-9][0-9][0-9][0-9]\)[-\/]\([0-9][0-9]\)[-\/]\([0-9][0-9]\).*/\1\2\3/'`"
103 if [ "x$__version" = "x" ] ; then
107 echo "autogen.sh build preparation script by Christopher Sean Morrison"
108 echo "revised 3-clause BSD-style license, copyright (c) $__copyright"
109 echo "script version $__version, ISO/IEC 9945 POSIX shell script"
117 echo "Usage: $AUTOGEN_SH [-h|--help] [-v|--verbose] [-q|--quiet] [--version]"
118 echo " --help Help on $NAME_OF_AUTOGEN usage"
119 echo " --verbose Verbose progress output"
120 echo " --quiet Quiet suppressed progress output"
121 echo " --version Only perform GNU Build System version checks"
123 echo "Description: This script will validate that minimum versions of the"
124 echo "GNU Build System tools are installed and then run autoreconf for you."
125 echo "Should autoreconf fail, manual preparation steps will be run"
126 echo "potentially accounting for several common preparation issues. The"
128 echo "AUTORECONF, AUTOCONF, AUTOMAKE, LIBTOOLIZE, ACLOCAL, AUTOHEADER,"
129 echo "PROJECT, & CONFIGURE environment variables and corresponding _OPTIONS"
130 echo "variables (e.g. AUTORECONF_OPTIONS) may be used to override the"
131 echo "default automatic detection behavior."
140 ##########################
141 # VERSION_ERROR FUNCTION #
142 ##########################
144 if [ "x$1" = "x" ] ; then
145 echo "INTERNAL ERROR: version_error was not provided a version"
148 if [ "x$2" = "x" ] ; then
149 echo "INTERNAL ERROR: version_error was not provided an application name"
153 $ECHO "ERROR: To prepare the ${PROJECT} build system from scratch,"
154 $ECHO " at least version $1 of $2 must be installed."
156 $ECHO "$NAME_OF_AUTOGEN does not need to be run on the same machine that will"
157 $ECHO "run configure or make. Either the GNU Autotools will need to be installed"
158 $ECHO "or upgraded on this system, or $NAME_OF_AUTOGEN must be run on the source"
159 $ECHO "code on another system and then transferred to here. -- Cheers!"
163 ##########################
164 # VERSION_CHECK FUNCTION #
165 ##########################
167 if [ "x$1" = "x" ] ; then
168 echo "INTERNAL ERROR: version_check was not provided a minimum version"
172 if [ "x$2" = "x" ] ; then
173 echo "INTERNAL ERROR: version check was not provided a comparison version"
178 # needed to handle versions like 1.10 and 1.4-p6
179 _min
="`echo ${_min}. | sed 's/[^0-9]/./g' | sed 's/\.\././g'`"
180 _cur
="`echo ${_cur}. | sed 's/[^0-9]/./g' | sed 's/\.\././g'`"
182 _min_major
="`echo $_min | cut -d. -f1`"
183 _min_minor
="`echo $_min | cut -d. -f2`"
184 _min_patch
="`echo $_min | cut -d. -f3`"
186 _cur_major
="`echo $_cur | cut -d. -f1`"
187 _cur_minor
="`echo $_cur | cut -d. -f2`"
188 _cur_patch
="`echo $_cur | cut -d. -f3`"
190 if [ "x$_min_major" = "x" ] ; then
193 if [ "x$_min_minor" = "x" ] ; then
196 if [ "x$_min_patch" = "x" ] ; then
199 if [ "x$_cur_minor" = "x" ] ; then
202 if [ "x$_cur_minor" = "x" ] ; then
205 if [ "x$_cur_patch" = "x" ] ; then
209 $VERBOSE_ECHO "Checking if ${_cur_major}.${_cur_minor}.${_cur_patch} is greater than ${_min_major}.${_min_minor}.${_min_patch}"
211 if [ $_min_major -lt $_cur_major ] ; then
213 elif [ $_min_major -eq $_cur_major ] ; then
214 if [ $_min_minor -lt $_cur_minor ] ; then
216 elif [ $_min_minor -eq $_cur_minor ] ; then
217 if [ $_min_patch -lt $_cur_patch ] ; then
219 elif [ $_min_patch -eq $_cur_patch ] ; then
228 ######################################
229 # LOCATE_CONFIGURE_TEMPLATE FUNCTION #
230 ######################################
231 locate_configure_template
( ) {
233 if test -f "./configure.ac" ; then
234 echo "./configure.ac"
235 elif test -f "./configure.in" ; then
236 echo "./configure.in"
237 elif test -f "$_pwd/configure.ac" ; then
238 echo "$_pwd/configure.ac"
239 elif test -f "$_pwd/configure.in" ; then
240 echo "$_pwd/configure.in"
241 elif test -f "$PATH_TO_AUTOGEN/configure.ac" ; then
242 echo "$PATH_TO_AUTOGEN/configure.ac"
243 elif test -f "$PATH_TO_AUTOGEN/configure.in" ; then
244 echo "$PATH_TO_AUTOGEN/configure.in"
253 PATH_TO_AUTOGEN
="`dirname $0`"
254 NAME_OF_AUTOGEN
="`basename $0`"
255 AUTOGEN_SH
="$PATH_TO_AUTOGEN/$NAME_OF_AUTOGEN"
257 LIBTOOL_M4
="${PATH_TO_AUTOGEN}/misc/libtool.m4"
259 if [ "x$HELP" = "x" ] ; then
262 if [ "x$QUIET" = "x" ] ; then
265 if [ "x$VERBOSE" = "x" ] ; then
268 if [ "x$VERSION_ONLY" = "x" ] ; then
271 if [ "x$AUTORECONF_OPTIONS" = "x" ] ; then
272 AUTORECONF_OPTIONS
="-i -f"
274 if [ "x$AUTOCONF_OPTIONS" = "x" ] ; then
275 AUTOCONF_OPTIONS
="-f"
277 if [ "x$AUTOMAKE_OPTIONS" = "x" ] ; then
278 AUTOMAKE_OPTIONS
="-a -c -f"
280 ALT_AUTOMAKE_OPTIONS
="-a -c"
281 if [ "x$LIBTOOLIZE_OPTIONS" = "x" ] ; then
282 LIBTOOLIZE_OPTIONS
="--automake -c -f"
284 ALT_LIBTOOLIZE_OPTIONS
="--automake --copy --force"
285 if [ "x$ACLOCAL_OPTIONS" = "x" ] ; then
288 if [ "x$AUTOHEADER_OPTIONS" = "x" ] ; then
289 AUTOHEADER_OPTIONS
=""
291 for arg
in $ARGS ; do
295 x
--quiet) QUIET
=yes ;;
297 x
--verbose) VERBOSE
=yes ;;
298 x
-[vV
]) VERBOSE
=yes ;;
299 x
--version) VERSION_ONLY
=yes ;;
301 echo "Unknown option: $arg"
310 #####################
311 # environment check #
312 #####################
314 # sanity check before recursions potentially begin
315 if [ ! -f "$AUTOGEN_SH" ] ; then
316 echo "INTERNAL ERROR: $AUTOGEN_SH does not exist"
317 if [ ! "x$0" = "x$AUTOGEN_SH" ] ; then
318 echo "INTERNAL ERROR: dirname/basename inconsistency: $0 != $AUTOGEN_SH"
323 # force locale setting to C so things like date output as expected
326 # commands that this script expects
327 for __cmd
in echo head tail pwd ; do
328 echo "test" | $__cmd > /dev
/null
2>&1
329 if [ $?
!= 0 ] ; then
330 echo "INTERNAL ERROR: '${__cmd}' command is required"
334 echo "test" | grep "test" > /dev
/null
2>&1
335 if test ! x$?
= x0
; then
336 echo "INTERNAL ERROR: grep command is required"
339 echo "test" | sed "s/test/test/" > /dev
/null
2>&1
340 if test ! x$?
= x0
; then
341 echo "INTERNAL ERROR: sed command is required"
346 # determine the behavior of echo
347 case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
348 *c
*,-n*) ECHO_N
= ECHO_C
='
350 *c
*,* ) ECHO_N
=-n ECHO_C
= ECHO_T
= ;;
351 *) ECHO_N
= ECHO_C
='\c' ECHO_T
= ;;
354 # determine the behavior of head
355 case "x`echo 'head' | head -n 1 2>&1`" in
356 *xhead
*) HEAD_N
="n " ;;
360 # determine the behavior of tail
361 case "x`echo 'tail' | tail -n 1 2>&1`" in
362 *xtail
*) TAIL_N
="n " ;;
368 if [ "x$QUIET" = "xyes" ] ; then
369 if [ "x$VERBOSE" = "xyes" ] ; then
370 echo "Verbose output quelled by quiet option. Further output disabled."
374 if [ "x$VERBOSE" = "xyes" ] ; then
375 echo "Verbose output enabled"
381 # allow a recursive run to disable further recursions
382 if [ "x$RUN_RECURSIVE" = "x" ] ; then
387 ################################################
388 # check for help arg and bypass version checks #
389 ################################################
390 if [ "x`echo $ARGS | sed 's/.*[hH][eE][lL][pP].*/help/'`" = "xhelp" ] ; then
393 if [ "x$HELP" = "xyes" ] ; then
396 $ECHO "Help was requested. No preparation or configuration will be performed."
401 #######################
402 # set up signal traps #
403 #######################
404 untrap_abnormal
( ) {
405 for sig
in 1 2 13 15; do
410 # do this cleanup whenever we exit.
412 # start from the root
413 if test -d "$START_PATH" ; then
417 # restore/delete backup files
418 if test "x$PFC_INIT" = "x1" ; then
423 # trap SIGHUP (1), SIGINT (2), SIGPIPE (13), SIGTERM (15)
424 for sig
in 1 2 13 15; do
427 $ECHO "Aborting $NAME_OF_AUTOGEN: caught signal '$sig'"
429 # start from the root
430 if test -d "$START_PATH" ; then
434 # clean up on abnormal exit
435 $VERBOSE_ECHO "rm -rf autom4te.cache"
436 rm -rf autom4te.cache
438 if test -f "acinclude.m4.$$.backup" ; then
439 $VERBOSE_ECHO "cat acinclude.m4.$$.backup > acinclude.m4"
440 chmod u+w acinclude.m4
441 cat acinclude.m4.$$.backup > acinclude.m4
443 $VERBOSE_ECHO "rm -f acinclude.m4.$$.backup"
444 rm -f acinclude.m4.$$.backup
447 { (exit 1); exit 1; }
452 #############################
453 # look for a configure file #
454 #############################
455 if [ "x$CONFIGURE" = "x" ] ; then
456 CONFIGURE
="`locate_configure_template`"
457 if [ ! "x$CONFIGURE" = "x" ] ; then
458 $VERBOSE_ECHO "Found a configure template: $CONFIGURE"
461 $ECHO "Using CONFIGURE environment variable override: $CONFIGURE"
463 if [ "x$CONFIGURE" = "x" ] ; then
464 if [ "x$VERSION_ONLY" = "xyes" ] ; then
468 $ECHO "A configure.ac or configure.in file could not be located implying"
469 $ECHO "that the GNU Build System is at least not used in this directory. In"
470 $ECHO "any case, there is nothing to do here without one of those files."
472 $ECHO "ERROR: No configure.in or configure.ac file found in `pwd`"
480 if [ "x$PROJECT" = "x" ] ; then
481 PROJECT
="`grep AC_INIT $CONFIGURE | grep -v '.*#.*AC_INIT' | tail -${TAIL_N}1 | sed 's/^[ ]*AC_INIT(\([^,)]*\).*/\1/' | sed 's/.*\[\(.*\)\].*/\1/'`"
482 if [ "x$PROJECT" = "xAC_INIT" ] ; then
483 # projects might be using the older/deprecated arg-less AC_INIT .. look for AM_INIT_AUTOMAKE instead
484 PROJECT
="`grep AM_INIT_AUTOMAKE $CONFIGURE | grep -v '.*#.*AM_INIT_AUTOMAKE' | tail -${TAIL_N}1 | sed 's/^[ ]*AM_INIT_AUTOMAKE(\([^,)]*\).*/\1/' | sed 's/.*\[\(.*\)\].*/\1/'`"
486 if [ "x$PROJECT" = "xAM_INIT_AUTOMAKE" ] ; then
489 if [ "x$PROJECT" = "x" ] ; then
493 $ECHO "Using PROJECT environment variable override: $PROJECT"
495 $ECHO "Preparing the $PROJECT build system...please wait"
499 ########################
500 # check for autoreconf #
501 ########################
503 if [ "x$AUTORECONF" = "x" ] ; then
504 for AUTORECONF
in autoreconf
; do
505 $VERBOSE_ECHO "Checking autoreconf version: $AUTORECONF --version"
506 $AUTORECONF --version > /dev
/null
2>&1
514 $ECHO "Using AUTORECONF environment variable override: $AUTORECONF"
518 ##########################
519 # autoconf version check #
520 ##########################
522 if [ "x$AUTOCONF" = "x" ] ; then
523 for AUTOCONF
in autoconf
; do
524 $VERBOSE_ECHO "Checking autoconf version: $AUTOCONF --version"
525 $AUTOCONF --version > /dev
/null
2>&1
533 $ECHO "Using AUTOCONF environment variable override: $AUTOCONF"
537 if [ ! "x$_acfound" = "xyes" ] ; then
538 $ECHO "ERROR: Unable to locate GNU Autoconf."
541 _version
="`$AUTOCONF --version | head -${HEAD_N}1 | sed 's/[^0-9]*\([0-9\.][0-9\.]*\)/\1/'`"
542 if [ "x$_version" = "x" ] ; then
545 $ECHO "Found GNU Autoconf version $_version"
546 version_check
"$AUTOCONF_VERSION" "$_version"
547 if [ $?
-ne 0 ] ; then
551 if [ "x$_report_error" = "xyes" ] ; then
552 version_error
"$AUTOCONF_VERSION" "GNU Autoconf"
557 ##########################
558 # automake version check #
559 ##########################
561 if [ "x$AUTOMAKE" = "x" ] ; then
562 for AUTOMAKE
in automake
; do
563 $VERBOSE_ECHO "Checking automake version: $AUTOMAKE --version"
564 $AUTOMAKE --version > /dev
/null
2>&1
572 $ECHO "Using AUTOMAKE environment variable override: $AUTOMAKE"
577 if [ ! "x$_amfound" = "xyes" ] ; then
579 $ECHO "ERROR: Unable to locate GNU Automake."
582 _version
="`$AUTOMAKE --version | head -${HEAD_N}1 | sed 's/[^0-9]*\([0-9\.][0-9\.]*\)/\1/'`"
583 if [ "x$_version" = "x" ] ; then
586 $ECHO "Found GNU Automake version $_version"
587 version_check
"$AUTOMAKE_VERSION" "$_version"
588 if [ $?
-ne 0 ] ; then
592 if [ "x$_report_error" = "xyes" ] ; then
593 version_error
"$AUTOMAKE_VERSION" "GNU Automake"
598 ########################
599 # check for libtoolize #
600 ########################
602 HAVE_ALT_LIBTOOLIZE
=no
604 if [ "x$LIBTOOLIZE" = "x" ] ; then
605 LIBTOOLIZE
=libtoolize
606 $VERBOSE_ECHO "Checking libtoolize version: $LIBTOOLIZE --version"
607 $LIBTOOLIZE --version > /dev
/null
2>&1
608 if [ ! $?
= 0 ] ; then
611 if [ "x$HAVE_AUTORECONF" = "xno" ] ; then
612 $ECHO "Warning: libtoolize does not appear to be available."
614 $ECHO "Warning: libtoolize does not appear to be available. This means that"
615 $ECHO "the automatic build preparation via autoreconf will probably not work."
616 $ECHO "Preparing the build by running each step individually, however, should"
617 $ECHO "work and will be done automatically for you if autoreconf fails."
620 # look for some alternates
621 for tool
in glibtoolize libtoolize15 libtoolize14 libtoolize13
; do
622 $VERBOSE_ECHO "Checking libtoolize alternate: $tool --version"
623 _glibtoolize
="`$tool --version > /dev/null 2>&1`"
625 $VERBOSE_ECHO "Found $tool --version"
626 _glti
="`which $tool`"
627 if [ "x$_glti" = "x" ] ; then
628 $VERBOSE_ECHO "Cannot find $tool with which"
631 if test ! -f "$_glti" ; then
632 $VERBOSE_ECHO "Cannot use $tool, $_glti is not a file"
635 _gltidir
="`dirname $_glti`"
636 if [ "x$_gltidir" = "x" ] ; then
637 $VERBOSE_ECHO "Cannot find $tool path with dirname of $_glti"
640 if test ! -d "$_gltidir" ; then
641 $VERBOSE_ECHO "Cannot use $tool, $_gltidir is not a directory"
644 HAVE_ALT_LIBTOOLIZE
=yes
647 $ECHO "Fortunately, $tool was found which means that your system may simply"
648 $ECHO "have a non-standard or incomplete GNU Autotools install. If you have"
649 $ECHO "sufficient system access, it may be possible to quell this warning by"
652 sudo
-V > /dev
/null
2>&1
654 $ECHO " sudo ln -s $_glti $_gltidir/libtoolize"
657 $ECHO " ln -s $_glti $_gltidir/libtoolize"
659 $ECHO "Run that as root or with proper permissions to the $_gltidir directory"
671 $ECHO "Using LIBTOOLIZE environment variable override: $LIBTOOLIZE"
675 ############################
676 # libtoolize version check #
677 ############################
679 if [ ! "x$_ltfound" = "xyes" ] ; then
681 $ECHO "ERROR: Unable to locate GNU Libtool."
684 _version
="`$LIBTOOLIZE --version | head -${HEAD_N}1 | sed 's/[^0-9]*\([0-9\.][0-9\.]*\)/\1/'`"
685 if [ "x$_version" = "x" ] ; then
688 $ECHO "Found GNU Libtool version $_version"
689 version_check
"$LIBTOOL_VERSION" "$_version"
690 if [ $?
-ne 0 ] ; then
694 if [ "x$_report_error" = "xyes" ] ; then
695 version_error
"$LIBTOOL_VERSION" "GNU Libtool"
700 #####################
701 # check for aclocal #
702 #####################
703 if [ "x$ACLOCAL" = "x" ] ; then
704 for ACLOCAL
in aclocal
; do
705 $VERBOSE_ECHO "Checking aclocal version: $ACLOCAL --version"
706 $ACLOCAL --version > /dev
/null
2>&1
712 $ECHO "Using ACLOCAL environment variable override: $ACLOCAL"
716 ########################
717 # check for autoheader #
718 ########################
719 if [ "x$AUTOHEADER" = "x" ] ; then
720 for AUTOHEADER
in autoheader
; do
721 $VERBOSE_ECHO "Checking autoheader version: $AUTOHEADER --version"
722 $AUTOHEADER --version > /dev
/null
2>&1
728 $ECHO "Using AUTOHEADER environment variable override: $AUTOHEADER"
732 #########################
733 # check if version only #
734 #########################
735 $VERBOSE_ECHO "Checking whether to only output version information"
736 if [ "x$VERSION_ONLY" = "xyes" ] ; then
740 $ECHO "Version requested. No preparation or configuration will be performed."
745 #################################
746 # PROTECT_FROM_CLOBBER FUNCTION #
747 #################################
748 protect_from_clobber
( ) {
751 # protect COPYING & INSTALL from overwrite by automake. the
752 # automake force option will (inappropriately) ignore the existing
753 # contents of a COPYING and/or INSTALL files (depending on the
754 # version) instead of just forcing *missing* files like it does
755 # for AUTHORS, NEWS, and README. this is broken but extremely
756 # prevalent behavior, so we protect against it by keeping a backup
757 # of the file that can later be restored.
759 if test -f COPYING
; then
760 if test -f COPYING.$$.protect_from_automake.backup
; then
761 $VERBOSE_ECHO "Already backed up COPYING in `pwd`"
763 $VERBOSE_ECHO "Backing up COPYING in `pwd`"
764 $VERBOSE_ECHO "cp -p COPYING COPYING.$$.protect_from_automake.backup"
765 cp -p COPYING COPYING.$$.protect_from_automake.backup
768 if test -f INSTALL
; then
769 if test -f INSTALL.$$.protect_from_automake.backup
; then
770 $VERBOSE_ECHO "Already backed up INSTALL in `pwd`"
772 $VERBOSE_ECHO "Backing up INSTALL in `pwd`"
773 $VERBOSE_ECHO "cp -p INSTALL INSTALL.$$.protect_from_automake.backup"
774 cp -p INSTALL INSTALL.$$.protect_from_automake.backup
780 ##############################
781 # RECURSIVE_PROTECT FUNCTION #
782 ##############################
783 recursive_protect
( ) {
785 # for projects using recursive configure, run the build
786 # preparation steps for the subdirectories. this function assumes
787 # START_PATH was set to pwd before recursion begins so that
788 # relative paths work.
790 # git 'r done, protect COPYING and INSTALL from being clobbered
793 if test -d autom4te.cache
; then
794 $VERBOSE_ECHO "Found an autom4te.cache directory, deleting it"
795 $VERBOSE_ECHO "rm -rf autom4te.cache"
796 rm -rf autom4te.cache
799 # find configure template
800 _configure
="`locate_configure_template`"
801 if [ "x$_configure" = "x" ] ; then
804 # $VERBOSE_ECHO "Looking for configure template found `pwd`/$_configure"
807 # $VERBOSE_ECHO "Looking for subdirs in `pwd`"
808 _det_config_subdirs
="`grep AC_CONFIG_SUBDIRS $_configure | grep -v '.*#.*AC_CONFIG_SUBDIRS' | sed 's/^[ ]*AC_CONFIG_SUBDIRS(\(.*\)).*/\1/' | sed 's/.*\[\(.*\)\].*/\1/'`"
810 for dir
in $_det_config_subdirs ; do
811 if test -d "`pwd`/$dir" ; then
812 CHECK_DIRS
="$CHECK_DIRS \"`pwd`/$dir\""
817 if [ ! "x$CHECK_DIRS" = "x" ] ; then
818 $VERBOSE_ECHO "Recursively scanning the following directories:"
819 $VERBOSE_ECHO " $CHECK_DIRS"
820 for dir
in $CHECK_DIRS ; do
821 $VERBOSE_ECHO "Protecting files from automake in $dir"
825 # recursively git 'r done
829 } # end of recursive_protect
832 #############################
833 # RESTORE_CLOBBERED FUNCION #
834 #############################
835 restore_clobbered
( ) {
837 # The automake (and autoreconf by extension) -f/--force-missing
838 # option may overwrite COPYING and INSTALL even if they do exist.
839 # Here we restore the files if necessary.
844 if test -f COPYING.$$.protect_from_automake.backup
; then
845 if test -f COPYING
; then
846 # compare entire content, restore if needed
847 if test "x`cat COPYING`" != "x`cat COPYING.$$.protect_from_automake.backup`" ; then
848 if test "x$spacer" = "xno" ; then
853 $VERBOSE_ECHO "Restoring COPYING from backup (automake -f likely clobbered it)"
854 $VERBOSE_ECHO "rm -f COPYING"
856 $VERBOSE_ECHO "mv COPYING.$$.protect_from_automake.backup COPYING"
857 mv COPYING.$$.protect_from_automake.backup COPYING
859 elif test -f COPYING.$$.protect_from_automake.backup
; then
860 $VERBOSE_ECHO "mv COPYING.$$.protect_from_automake.backup COPYING"
861 mv COPYING.$$.protect_from_automake.backup COPYING
865 $VERBOSE_ECHO "rm -f COPYING.$$.protect_from_automake.backup"
866 rm -f COPYING.$$.protect_from_automake.backup
867 fi # -f COPYING.$$.protect_from_automake.backup
870 if test -f INSTALL.$$.protect_from_automake.backup
; then
871 if test -f INSTALL
; then
872 # compare entire content, restore if needed
873 if test "x`cat INSTALL`" != "x`cat INSTALL.$$.protect_from_automake.backup`" ; then
874 if test "x$spacer" = "xno" ; then
879 $VERBOSE_ECHO "Restoring INSTALL from backup (automake -f likely clobbered it)"
880 $VERBOSE_ECHO "rm -f INSTALL"
882 $VERBOSE_ECHO "mv INSTALL.$$.protect_from_automake.backup INSTALL"
883 mv INSTALL.$$.protect_from_automake.backup INSTALL
885 elif test -f INSTALL.$$.protect_from_automake.backup
; then
886 $VERBOSE_ECHO "mv INSTALL.$$.protect_from_automake.backup INSTALL"
887 mv INSTALL.$$.protect_from_automake.backup INSTALL
891 $VERBOSE_ECHO "rm -f INSTALL.$$.protect_from_automake.backup"
892 rm -f INSTALL.$$.protect_from_automake.backup
893 fi # -f INSTALL.$$.protect_from_automake.backup
895 CONFIGURE
="`locate_configure_template`"
896 if [ "x$CONFIGURE" = "x" ] ; then
900 _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/'`"
901 if test ! -d "$_aux_dir" ; then
905 for file in config.guess config.sub ltmain.sh
; do
906 if test -f "${_aux_dir}/${file}" ; then
907 $VERBOSE_ECHO "rm -f \"${_aux_dir}/${file}.backup\""
908 rm -f "${_aux_dir}/${file}.backup"
911 } # end of restore_clobbered
914 ##############################
915 # RECURSIVE_RESTORE FUNCTION #
916 ##############################
917 recursive_restore
( ) {
919 # restore COPYING and INSTALL from backup if they were clobbered
920 # for each directory recursively.
925 # find configure template
926 _configure
="`locate_configure_template`"
927 if [ "x$_configure" = "x" ] ; then
932 _det_config_subdirs
="`grep AC_CONFIG_SUBDIRS $_configure | grep -v '.*#.*AC_CONFIG_SUBDIRS' | sed 's/^[ ]*AC_CONFIG_SUBDIRS(\(.*\)).*/\1/' | sed 's/.*\[\(.*\)\].*/\1/'`"
934 for dir
in $_det_config_subdirs ; do
935 if test -d "`pwd`/$dir" ; then
936 CHECK_DIRS
="$CHECK_DIRS \"`pwd`/$dir\""
941 if [ ! "x$CHECK_DIRS" = "x" ] ; then
942 $VERBOSE_ECHO "Recursively scanning the following directories:"
943 $VERBOSE_ECHO " $CHECK_DIRS"
944 for dir
in $CHECK_DIRS ; do
945 $VERBOSE_ECHO "Checking files for automake damage in $dir"
949 # recursively git 'r undone
953 } # end of recursive_restore
956 #######################
957 # INITIALIZE FUNCTION #
958 #######################
961 # this routine performs a variety of directory-specific
962 # initializations. some are sanity checks, some are preventive,
963 # and some are necessary setup detection.
965 # this function sets:
970 ##################################
971 # check for a configure template #
972 ##################################
973 CONFIGURE
="`locate_configure_template`"
974 if [ "x$CONFIGURE" = "x" ] ; then
976 $ECHO "A configure.ac or configure.in file could not be located implying"
977 $ECHO "that the GNU Build System is at least not used in this directory. In"
978 $ECHO "any case, there is nothing to do here without one of those files."
980 $ECHO "ERROR: No configure.in or configure.ac file found in `pwd`"
984 #####################
985 # detect an aux dir #
986 #####################
987 _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/'`"
988 if test ! -d "$_aux_dir" ; then
991 $VERBOSE_ECHO "Detected auxillary directory: $_aux_dir"
994 ################################
995 # detect a recursive configure #
996 ################################
998 _det_config_subdirs
="`grep AC_CONFIG_SUBDIRS $CONFIGURE | grep -v '.*#.*AC_CONFIG_SUBDIRS' | sed 's/^[ ]*AC_CONFIG_SUBDIRS(\(.*\)).*/\1/' | sed 's/.*\[\(.*\)\].*/\1/'`"
999 for dir
in $_det_config_subdirs ; do
1000 if test -d "`pwd`/$dir" ; then
1001 $VERBOSE_ECHO "Detected recursive configure directory: `pwd`/$dir"
1002 CONFIG_SUBDIRS
="$CONFIG_SUBDIRS `pwd`/$dir"
1006 ##########################################
1007 # make sure certain required files exist #
1008 ##########################################
1009 for file in AUTHORS COPYING ChangeLog INSTALL NEWS README
; do
1010 if test ! -f $file ; then
1011 $VERBOSE_ECHO "Touching ${file} since it does not exist"
1016 ##################################################
1017 # make sure certain generated files do not exist #
1018 ##################################################
1019 for file in config.guess config.sub ltmain.sh
; do
1020 if test -f "${_aux_dir}/${file}" ; then
1021 $VERBOSE_ECHO "mv -f \"${_aux_dir}/${file}\" \"${_aux_dir}/${file}.backup\""
1022 mv -f "${_aux_dir}/${file}" "${_aux_dir}/${file}.backup"
1026 ############################
1027 # search alternate m4 dirs #
1028 ############################
1031 if [ -d $dir ] ; then
1032 $VERBOSE_ECHO "Found extra aclocal search directory: $dir"
1033 SEARCH_DIRS
="$SEARCH_DIRS -I $dir"
1037 ######################################
1038 # remove any previous build products #
1039 ######################################
1040 if test -d autom4te.cache
; then
1041 $VERBOSE_ECHO "Found an autom4te.cache directory, deleting it"
1042 $VERBOSE_ECHO "rm -rf autom4te.cache"
1043 rm -rf autom4te.cache
1045 # tcl/tk (and probably others) have a customized aclocal.m4, so can't delete it
1046 # if test -f aclocal.m4 ; then
1047 # $VERBOSE_ECHO "Found an aclocal.m4 file, deleting it"
1048 # $VERBOSE_ECHO "rm -f aclocal.m4"
1052 } # end of initialize()
1062 # Before running autoreconf or manual steps, some prep detection work
1063 # is necessary or useful. Only needs to occur once per directory, but
1064 # does need to traverse the entire subconfigure hierarchy to protect
1065 # files from being clobbered even by autoreconf.
1068 # start from where we started
1071 # get ready to process
1075 ############################################
1076 # prepare build via autoreconf or manually #
1077 ############################################
1078 reconfigure_manually
=no
1079 if [ "x$HAVE_AUTORECONF" = "xyes" ] ; then
1081 $ECHO $ECHO_N "Automatically preparing build ... $ECHO_C"
1083 $VERBOSE_ECHO "$AUTORECONF $SEARCH_DIRS $AUTORECONF_OPTIONS"
1084 autoreconf_output
="`$AUTORECONF $SEARCH_DIRS $AUTORECONF_OPTIONS 2>&1`"
1086 $VERBOSE_ECHO "$autoreconf_output"
1088 if [ ! $ret = 0 ] ; then
1089 if [ "x$HAVE_ALT_LIBTOOLIZE" = "xyes" ] ; then
1090 if [ ! "x`echo \"$autoreconf_output\" | grep libtoolize | grep \"No such file or directory\"`" = "x" ] ; then
1092 $ECHO "Warning: autoreconf failed but due to what is usually a common libtool"
1093 $ECHO "misconfiguration issue. This problem is encountered on systems that"
1094 $ECHO "have installed libtoolize under a different name without providing a"
1095 $ECHO "symbolic link or without setting the LIBTOOLIZE environment variable."
1097 $ECHO "Restarting the preparation steps with LIBTOOLIZE set to $LIBTOOLIZE"
1101 export RUN_RECURSIVE
1104 $VERBOSE_ECHO sh
$AUTOGEN_SH "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9"
1105 sh
"$AUTOGEN_SH" "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9"
1110 $ECHO "Warning: $AUTORECONF failed"
1112 if test -f ltmain.sh
; then
1113 $ECHO "libtoolize being run by autoreconf is not creating ltmain.sh in the auxillary directory like it should"
1116 $ECHO "Attempting to run the preparation steps individually"
1117 reconfigure_manually
=yes
1120 reconfigure_manually
=yes
1124 ############################
1125 # LIBTOOL_FAILURE FUNCTION #
1126 ############################
1127 libtool_failure
( ) {
1129 # libtool is rather error-prone in comparison to the other
1130 # autotools and this routine attempts to compensate for some
1131 # common failures. the output after a libtoolize failure is
1132 # parsed for an error related to AC_PROG_LIBTOOL and if found, we
1133 # attempt to inject a project-provided libtool.m4 file.
1135 _autoconf_output
="$1"
1137 if [ "x$RUN_RECURSIVE" = "xno" ] ; then
1138 # we already tried the libtool.m4, don't try again
1142 if test -f "$LIBTOOL_M4" ; then
1143 found_libtool
="`$ECHO $_autoconf_output | grep AC_PROG_LIBTOOL`"
1144 if test ! "x$found_libtool" = "x" ; then
1145 if test -f acinclude.
m4 ; then
1146 rm -f acinclude.
m4.$$.backup
1147 $VERBOSE_ECHO "cat acinclude.m4 > acinclude.m4.$$.backup"
1148 cat acinclude.
m4 > acinclude.
m4.$$.backup
1150 $VERBOSE_ECHO "cat \"$LIBTOOL_M4\" >> acinclude.m4"
1151 chmod u
+w acinclude.
m4
1152 cat "$LIBTOOL_M4" >> acinclude.
m4
1154 # don't keep doing this
1156 export RUN_RECURSIVE
1160 $ECHO "Restarting the preparation steps with libtool macros in acinclude.m4"
1161 $VERBOSE_ECHO sh
$AUTOGEN_SH "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9"
1162 sh
"$AUTOGEN_SH" "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9"
1169 ###########################
1170 # MANUAL_AUTOGEN FUNCTION #
1171 ###########################
1172 manual_autogen
( ) {
1174 ##################################################
1175 # Manual preparation steps taken are as follows: #
1177 # libtoolize --automake -c -f #
1181 # automake -a -c -f #
1182 ##################################################
1187 $VERBOSE_ECHO "$ACLOCAL $SEARCH_DIRS $ACLOCAL_OPTIONS"
1188 aclocal_output
="`$ACLOCAL $SEARCH_DIRS $ACLOCAL_OPTIONS 2>&1`"
1190 $VERBOSE_ECHO "$aclocal_output"
1191 if [ ! $ret = 0 ] ; then $ECHO "ERROR: $ACLOCAL failed" && exit 2 ; fi
1197 for feature
in AC_PROG_LIBTOOL LT_INIT
; do
1198 $VERBOSE_ECHO "Searching for $feature in $CONFIGURE"
1199 found
="`grep \"^$feature.*\" $CONFIGURE`"
1200 if [ ! "x$found" = "x" ] ; then
1205 if [ "x$need_libtoolize" = "xyes" ] ; then
1206 if [ "x$HAVE_LIBTOOLIZE" = "xyes" ] ; then
1207 $VERBOSE_ECHO "$LIBTOOLIZE $LIBTOOLIZE_OPTIONS"
1208 libtoolize_output
="`$LIBTOOLIZE $LIBTOOLIZE_OPTIONS 2>&1`"
1210 $VERBOSE_ECHO "$libtoolize_output"
1212 if [ ! $ret = 0 ] ; then $ECHO "ERROR: $LIBTOOLIZE failed" && exit 2 ; fi
1214 if [ "x$HAVE_ALT_LIBTOOLIZE" = "xyes" ] ; then
1215 $VERBOSE_ECHO "$LIBTOOLIZE $ALT_LIBTOOLIZE_OPTIONS"
1216 libtoolize_output
="`$LIBTOOLIZE $ALT_LIBTOOLIZE_OPTIONS 2>&1`"
1218 $VERBOSE_ECHO "$libtoolize_output"
1220 if [ ! $ret = 0 ] ; then $ECHO "ERROR: $LIBTOOLIZE failed" && exit 2 ; fi
1227 # re-run again as instructed by libtoolize
1228 $VERBOSE_ECHO "$ACLOCAL $SEARCH_DIRS $ACLOCAL_OPTIONS"
1229 aclocal_output
="`$ACLOCAL $SEARCH_DIRS $ACLOCAL_OPTIONS 2>&1`"
1231 $VERBOSE_ECHO "$aclocal_output"
1233 # libtoolize might put ltmain.sh in the wrong place
1234 if test -f ltmain.sh
; then
1235 if test ! -f "${_aux_dir}/ltmain.sh" ; then
1237 $ECHO "Warning: $LIBTOOLIZE is creating ltmain.sh in the wrong directory"
1239 $ECHO "Fortunately, the problem can be worked around by simply copying the"
1240 $ECHO "file to the appropriate location (${_aux_dir}/). This has been done for you."
1242 $VERBOSE_ECHO "cp -p ltmain.sh \"${_aux_dir}/ltmain.sh\""
1243 cp -p ltmain.sh
"${_aux_dir}/ltmain.sh"
1244 $ECHO $ECHO_N "Continuing build preparation ... $ECHO_C"
1247 fi # need_libtoolize
1253 $VERBOSE_ECHO "$AUTOCONF $AUTOCONF_OPTIONS"
1254 autoconf_output
="`$AUTOCONF $AUTOCONF_OPTIONS 2>&1`"
1256 $VERBOSE_ECHO "$autoconf_output"
1258 if [ ! $ret = 0 ] ; then
1259 # retry without the -f and check for usage of macros that are too new
1260 ac2_59_macros
="AC_C_RESTRICT AC_INCLUDES_DEFAULT AC_LANG_ASSERT AC_LANG_WERROR AS_SET_CATFILE"
1261 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"
1262 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"
1265 ac_major
="`echo ${AUTOCONF_VERSION}. | cut -d. -f1 | sed 's/[^0-9]//g'`"
1266 ac_minor
="`echo ${AUTOCONF_VERSION}. | cut -d. -f2 | sed 's/[^0-9]//g'`"
1268 if [ $ac_major -lt 2 ] ; then
1269 macros_to_search
="$ac2_59_macros $ac2_55_macros $ac2_54_macros"
1271 if [ $ac_minor -lt 54 ] ; then
1272 macros_to_search
="$ac2_59_macros $ac2_55_macros $ac2_54_macros"
1273 elif [ $ac_minor -lt 55 ] ; then
1274 macros_to_search
="$ac2_59_macros $ac2_55_macros"
1275 elif [ $ac_minor -lt 59 ] ; then
1276 macros_to_search
="$ac2_59_macros"
1280 configure_ac_macros
=__none__
1281 for feature
in $macros_to_search ; do
1282 $VERBOSE_ECHO "Searching for $feature in $CONFIGURE"
1283 found
="`grep \"^$feature.*\" $CONFIGURE`"
1284 if [ ! "x$found" = "x" ] ; then
1285 if [ "x$configure_ac_macros" = "x__none__" ] ; then
1286 configure_ac_macros
="$feature"
1288 configure_ac_macros
="$feature $configure_ac_macros"
1292 if [ ! "x$configure_ac_macros" = "x__none__" ] ; then
1294 $ECHO "Warning: Unsupported macros were found in $CONFIGURE"
1296 $ECHO "The `echo $CONFIGURE | basename` file was scanned in order to determine if any"
1297 $ECHO "unsupported macros are used that exceed the minimum version"
1298 $ECHO "settings specified within this file. As such, the following macros"
1299 $ECHO "should be removed from configure.ac or the version numbers in this"
1300 $ECHO "file should be increased:"
1302 $ECHO "$configure_ac_macros"
1304 $ECHO $ECHO_N "Ignorantly continuing build preparation ... $ECHO_C"
1311 $VERBOSE_ECHO "$AUTOCONF"
1312 autoconf_output
="`$AUTOCONF 2>&1`"
1314 $VERBOSE_ECHO "$autoconf_output"
1316 if [ ! $ret = 0 ] ; then
1317 # test if libtool is busted
1318 libtool_failure
"$autoconf_output"
1320 # let the user know what went wrong
1324 $ECHO "ERROR: $AUTOCONF failed"
1327 # autoconf sans -f and possibly sans unsupported options succeed so warn verbosely
1329 $ECHO "Warning: autoconf seems to have succeeded by removing the following options:"
1330 $ECHO " AUTOCONF_OPTIONS=\"$AUTOCONF_OPTIONS\""
1332 $ECHO "Removing those options should not be necessary and indicate some other"
1333 $ECHO "problem with the build system. The build preparation is highly suspect"
1334 $ECHO "and may result in configuration or compilation errors. Consider"
1335 if [ "x$VERBOSE_ECHO" = "x:" ] ; then
1336 $ECHO "rerunning the build preparation with verbose output enabled."
1337 $ECHO " $AUTOGEN_SH --verbose"
1339 $ECHO "reviewing the minimum GNU Autotools version settings contained in"
1340 $ECHO "this script along with the macros being used in your `echo $CONFIGURE | basename` file."
1343 $ECHO $ECHO_N "Continuing build preparation ... $ECHO_C"
1344 fi # autoconf ret = 0
1345 fi # autoconf ret = 0
1351 for feature
in AM_CONFIG_HEADER AC_CONFIG_HEADER
; do
1352 $VERBOSE_ECHO "Searching for $feature in $CONFIGURE"
1353 found
="`grep \"^$feature.*\" $CONFIGURE`"
1354 if [ ! "x$found" = "x" ] ; then
1359 if [ "x$need_autoheader" = "xyes" ] ; then
1360 $VERBOSE_ECHO "$AUTOHEADER $AUTOHEADER_OPTIONS"
1361 autoheader_output
="`$AUTOHEADER $AUTOHEADER_OPTIONS 2>&1`"
1363 $VERBOSE_ECHO "$autoheader_output"
1364 if [ ! $ret = 0 ] ; then $ECHO "ERROR: $AUTOHEADER failed" && exit 2 ; fi
1365 fi # need_autoheader
1371 for feature
in AM_INIT_AUTOMAKE
; do
1372 $VERBOSE_ECHO "Searching for $feature in $CONFIGURE"
1373 found
="`grep \"^$feature.*\" $CONFIGURE`"
1374 if [ ! "x$found" = "x" ] ; then
1380 if [ "x$need_automake" = "xyes" ] ; then
1381 $VERBOSE_ECHO "$AUTOMAKE $AUTOMAKE_OPTIONS"
1382 automake_output
="`$AUTOMAKE $AUTOMAKE_OPTIONS 2>&1`"
1384 $VERBOSE_ECHO "$automake_output"
1386 if [ ! $ret = 0 ] ; then
1392 $VERBOSE_ECHO "$AUTOMAKE $ALT_AUTOMAKE_OPTIONS"
1393 # retry without the -f
1394 automake_output
="`$AUTOMAKE $ALT_AUTOMAKE_OPTIONS 2>&1`"
1396 $VERBOSE_ECHO "$automake_output"
1398 if [ ! $ret = 0 ] ; then
1399 # test if libtool is busted
1400 libtool_failure
"$automake_output"
1402 # let the user know what went wrong
1406 $ECHO "ERROR: $AUTOMAKE failed"
1409 fi # automake ret = 0
1411 } # end of manual_autogen
1414 #####################################
1415 # RECURSIVE_MANUAL_AUTOGEN FUNCTION #
1416 #####################################
1417 recursive_manual_autogen
( ) {
1419 # run the build preparation steps manually for this directory
1422 # for projects using recursive configure, run the build
1423 # preparation steps for the subdirectories.
1424 if [ ! "x$CONFIG_SUBDIRS" = "x" ] ; then
1425 $VERBOSE_ECHO "Recursively configuring the following directories:"
1426 $VERBOSE_ECHO " $CONFIG_SUBDIRS"
1427 for dir
in $CONFIG_SUBDIRS ; do
1428 $VERBOSE_ECHO "Processing recursive configure in $dir"
1432 # new directory, prepare
1435 # run manual steps for the subdir and any others below
1436 recursive_manual_autogen
1442 ################################
1443 # run manual preparation steps #
1444 ################################
1445 if [ "x$reconfigure_manually" = "xyes" ] ; then
1447 $ECHO $ECHO_N "Preparing build ... $ECHO_C"
1449 recursive_manual_autogen
1453 #########################
1454 # restore and summarize #
1455 #########################
1458 # restore COPYING and INSTALL from backup if necessary
1461 # make sure we end up with a configure script
1462 config_ac
="`locate_configure_template`"
1463 config
="`echo $config_ac | sed 's/\.ac$//' | sed 's/\.in$//'`"
1464 if [ "x$config" = "x" ] ; then
1465 $VERBOSE_ECHO "Could not locate the configure template (from `pwd`)"
1471 if test "x$config" = "x" -o ! -f "$config" ; then
1472 $ECHO "WARNING: The $PROJECT build system should now be prepared but there"
1473 $ECHO "does not seem to be a resulting configure file. This is unexpected"
1474 $ECHO "and likely the result of an error. You should run $NAME_OF_AUTOGEN"
1475 $ECHO "with the --verbose option to get more details on a potential"
1476 $ECHO "misconfiguration."
1478 $ECHO "The $PROJECT build system is now prepared. To build here, run:"
1487 # sh-basic-offset: 4
1489 # indent-tabs-mode: t
1491 # ex: shiftwidth=4 tabstop=8