|
From: Sean M. <br...@us...> - 2007-02-26 05:14:27
|
Update of /cvsroot/bzflag/bzflag In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30904 Modified Files: autogen.sh Log Message: updates from cad. major modification, now supporting projects that don't use one or more of the various autotools (e.g. not using automake, libtool, autoheader, libtool). also now supports projects that have recursive configures that go more than one level deep. Index: autogen.sh =================================================================== RCS file: /cvsroot/bzflag/bzflag/autogen.sh,v retrieving revision 2.28 retrieving revision 2.29 diff -w -u -r2.28 -r2.29 --- autogen.sh 24 Feb 2007 01:46:16 -0000 2.28 +++ autogen.sh 26 Feb 2007 05:14:26 -0000 2.29 @@ -647,6 +647,27 @@ ####################### initialize ( ) { + ################################## + # check for a configure template # + ################################## + CONFIGURE="`locate_configure_template`" + config_fail=no + if [ "x$CONFIGURE" = "x" ] ; then + config_fail=yes + elif ! test -f $CONFIGURE ; then + config_fail=yes + fi + if [ "x$config_fail" = "xyes" ] ; then + $ECHO + $ECHO "A configure.ac or configure.in file could not be located implying" + $ECHO "that the GNU Build System is at least not used in this directory. In" + $ECHO "any case, there is nothing to do here without one of those files." + $ECHO + $ECHO "ERROR: No configure.in or configure.ac file found." + exit 1 + fi + + ##################### # detect an aux dir # ##################### @@ -661,8 +682,8 @@ ################################ # detect a recursive configure # ################################ - _det_config_subdirs="`grep AC_CONFIG_SUBDIRS $CONFIGURE | grep -v '.*#.*AC_CONFIG_SUBDIRS' | sed 's/^[ ]*AC_CONFIG_SUBDIRS(\(.*\)).*/\1/' | sed 's/.*\[\(.*\)\].*/\1/'`" CONFIG_SUBDIRS="" + _det_config_subdirs="`grep AC_CONFIG_SUBDIRS $CONFIGURE | grep -v '.*#.*AC_CONFIG_SUBDIRS' | sed 's/^[ ]*AC_CONFIG_SUBDIRS(\(.*\)).*/\1/' | sed 's/.*\[\(.*\)\].*/\1/'`" for dir in $_det_config_subdirs ; do if test -d "$dir" ; then $VERBOSE_ECHO "Detected recursive configure directory: $dir" @@ -774,6 +795,25 @@ $VERBOSE_ECHO "$autoreconf_output" if [ ! $ret = 0 ] ; then + if [ "x$HAVE_ALT_LIBTOOLIZE" = "xyes" ] ; then + if [ ! "x`echo \"$autoreconf_output\" | grep \"failed to run libtoolize: No such file or directory\"`" = "x" ] ; then + $ECHO + $ECHO "Warning: autoreconf failed but for for a reason that seems to be" + $ECHO "a common libtool misconfiguration issue. This problem is commonly" + $ECHO "found on systems that have installed libtoolize under a different" + $ECHO "name without providing a symbolic link or a LIBTOOLIZE environment" + $ECHO "variable." + $ECHO + $ECHO "Restarting the preparation steps with LIBTOOLIZE set to $LIBTOOLIZE" + export LIBTOOLIZE + RUN_RECURSIVE=no + export RUN_RECURSIVE + $VERBOSE_ECHO sh $AUTOGEN_SH "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9" + sh "$AUTOGEN_SH" "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9" + exit $? + fi + fi + $ECHO "Warning: $AUTORECONF failed" if test -f ltmain.sh ; then @@ -837,19 +877,6 @@ # autoheader # # automake -a -c -f # ################################################## - $ECHO - $ECHO $ECHO_N "Preparing build ... $ECHO_C" - - if ! test -f configure.in -o -f configure.ac ; then - $ECHO - $ECHO - $ECHO "A configure.ac or configure.in file could not be located implying" - $ECHO "that the GNU Build System is at least not used in this directory. In" - $ECHO "any case, there is nothing to do here without one of those files." - $ECHO - $ECHO "ERROR: No configure.in or configure.ac file found." - exit 1 - fi ########### # aclocal # @@ -863,6 +890,16 @@ ############## # libtoolize # ############## + need_libtoolize=no + for feature in AC_PROG_LIBTOOL LT_INIT ; do + $VERBOSE_ECHO "Searching for $feature in $CONFIGURE" + found="`grep \"^$feature.*\" $CONFIGURE`" + if [ ! "x$found" = "x" ] ; then + need_libtoolize=yes + break + fi + done + if [ "x$need_libtoolize" = "x" ] ; then if [ "x$HAVE_LIBTOOLIZE" = "xyes" ] ; then $VERBOSE_ECHO "$LIBTOOLIZE $LIBTOOLIZE_OPTIONS" libtoolize_output="`$LIBTOOLIZE $LIBTOOLIZE_OPTIONS 2>&1`" @@ -903,7 +940,9 @@ cp ltmain.sh "${_aux_dir}/ltmain.sh" $ECHO $ECHO_N "Continuing build preparation ... $ECHO_C" fi - fi + fi # ltmain.sh + fi # need_libtoolize + ############ # autoconf # @@ -997,21 +1036,42 @@ fi $ECHO $ECHO $ECHO_N "Continuing build preparation ... $ECHO_C" - fi - fi + fi # autoconf ret = 0 + fi # autoconf ret = 0 ############## # autoheader # ############## + need_autoheader=no + for feature in AM_CONFIG_HEADER AC_CONFIG_HEADER ; do + $VERBOSE_ECHO "Searching for $feature in $CONFIGURE" + found="`grep \"^$feature.*\" $CONFIGURE`" + if [ ! "x$found" = "x" ] ; then + need_autoheader=yes + break + fi + done + if [ "x$need_autoheader" = "x" ] ; then $VERBOSE_ECHO "$AUTOHEADER $AUTOHEADER_OPTIONS" autoheader_output="`$AUTOHEADER $AUTOHEADER_OPTIONS 2>&1`" ret=$? $VERBOSE_ECHO "$autoheader_output" if [ ! $ret = 0 ] ; then $ECHO "ERROR: $AUTOHEADER failed" && exit 2 ; fi + fi # need_autoheader ############ # automake # ############ + need_automake=no + for feature in AM_INIT_AUTOMAKE ; do + $VERBOSE_ECHO "Searching for $feature in $CONFIGURE" + found="`grep \"^$feature.*\" $CONFIGURE`" + if [ ! "x$found" = "x" ] ; then + config_header=yes + break + fi + done + if [ "x$need_automake" = "x" ] ; then $VERBOSE_ECHO "$AUTOMAKE $AUTOMAKE_OPTIONS" automake_output="`$AUTOMAKE $AUTOMAKE_OPTIONS 2>&1`" ret=$? @@ -1040,48 +1100,15 @@ fi $ECHO "ERROR: $AUTOMAKE failed" exit 2 - fi + fi # automake ret = 0 + fi # need_automake } -################################## -# run manual preparation steps # -################################## -if [ "x$reconfigure_manually" = "xyes" ] ; then - - # XXX if this is a recursive configure, manual steps don't work - # yet .. assume it's the libtool/glibtool problem. - if [ ! "x$CONFIG_SUBDIRS" = "x" ] ; then - $ECHO "Running the preparation steps individually does not yet work" - $ECHO "well with a recursive configure." - if [ ! "x$HAVE_ALT_LIBTOOLIZE" = "xyes" ] ; then - exit 3 - fi - $ECHO "Assuming this is a libtoolize problem..." - export LIBTOOLIZE - RUN_RECURSIVE=no - export RUN_RECURSIVE - $ECHO - $ECHO "Restarting the preparation steps with LIBTOOLIZE set to $LIBTOOLIZE" - $VERBOSE_ECHO sh $AUTOGEN_SH "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9" - sh "$AUTOGEN_SH" "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9" - exit $? - fi - +recursive_manual_autogen ( ) { # run the build preparation steps manually for this directory manual_autogen - # for projects using recursive configure, run the build - # preparation steps for the subdirectories. - for dir in $CONFIG_SUBDIRS ; do - $VERBOSE_ECHO "Processing recursive configure in $dir" - cd "$_prev_path" - cd "$dir" - manual_autogen - done -fi - - ######################################### # restore COPYING & INSTALL from backup # ######################################### @@ -1121,6 +1148,32 @@ fi fi + # for projects using recursive configure, run the build + # preparation steps for the subdirectories. + if [ ! "x$CONFIG_SUBDIRS" = "x" ] ; then + $VERBOSE_ECHO "Recursively configuring the following directories:" + $VERBOSE_ECHO " $CONFIG_SUBDIRS" + for dir in $CONFIG_SUBDIRS ; do + $VERBOSE_ECHO "Processing recursive configure in $dir" + cd "$_prev_path" + cd "$dir" + initialize + recursive_manual_autogen + done + fi +} + + +################################ +# run manual preparation steps # +################################ +if [ "x$reconfigure_manually" = "xyes" ] ; then + $ECHO + $ECHO $ECHO_N "Preparing build ... $ECHO_C" + + recursive_manual_autogen +fi + ######################### # restore and summarize # |