Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

open source release

  • Loading branch information...
commit 14f8e1a0ab1ab3b8dead6d4aa20fc59f258084d8 0 parents
Ilya Golubtsov authored

Showing 131 changed files with 12,039 additions and 0 deletions. Show diff stats Hide diff stats

  1. +16 0 Makefile.am
  2. +1,491 0 autogen.sh
  3. +37 0 config/ac_cxx_gnucxx_hashmap.m4
  4. +78 0 config/ac_cxx_have_ext_hash_map.m4
  5. +38 0 config/ac_cxx_namespaces.m4
  6. +37 0 config/ac_cxx_stlport_hashmap.m4
  7. +26 0 config/ax_check_compiler_flags.m4
  8. +44 0 config/ax_check_cppunit.m4
  9. +32 0 config/ax_check_dmalloc.m4
  10. +27 0 config/ax_check_fastcgi.m4
  11. +39 0 config/ax_check_log4cxx.m4
  12. +92 0 config/cppunit.m4
  13. +79 0 configure.in
  14. +173 0 debian/changelog
  15. +1 0  debian/compat
  16. +73 0 debian/control
  17. +41 0 debian/control_etch64
  18. +3 0  debian/fastcgi-daemon2-init.files
  19. +19 0 debian/fastcgi-daemon2-init.postinst
  20. +15 0 debian/fastcgi-daemon2-init.postrm
  21. +2 0  debian/fastcgi-daemon2.files
  22. +3 0  debian/libfastcgi-daemon2-dev.files
  23. +1 0  debian/libfastcgi-daemon2.files
  24. +1 0  debian/libfastcgi2-filelogger.files
  25. +1 0  debian/libfastcgi2-request-cache.files
  26. +1 0  debian/libfastcgi2-statistics.files
  27. +1 0  debian/libfastcgi2-syslog.files
  28. +78 0 debian/rules
  29. +10 0 example/Makefile.am
  30. +153 0 example/example.cpp
  31. +54 0 example/fastcgi.conf
  32. +211 0 extra/fastcgi-daemon2
  33. +57 0 extra/fastcgistart2.sh
  34. +184 0 fastcgi-daemon2-bf.spec
  35. +160 0 fastcgi-daemon2.spec
  36. +10 0 file-logger/Makefile.am
  37. +192 0 file-logger/file_logger.cpp
  38. +70 0 file-logger/file_logger.h
  39. +2 0  include/Makefile.am
  40. +4 0 include/details/Makefile.am
  41. +34 0 include/details/component_context.h
  42. +55 0 include/details/componentset.h
  43. +48 0 include/details/config.h
  44. +28 0 include/details/data_buffer_impl.h
  45. +68 0 include/details/functors.h
  46. +54 0 include/details/globals.h
  47. +23 0 include/details/handler_context.h
  48. +48 0 include/details/handlerset.h
  49. +38 0 include/details/loader.h
  50. +83 0 include/details/parser.h
  51. +164 0 include/details/range.h
  52. +26 0 include/details/request_cache.h
  53. +33 0 include/details/request_thread_pool.h
  54. +186 0 include/details/requestimpl.h
  55. +21 0 include/details/response_time_statistics.h
  56. +30 0 include/details/server.h
  57. +36 0 include/details/string_buffer.h
  58. +174 0 include/details/thread_pool.h
  59. +52 0 include/details/xml.h
  60. +2 0  include/fastcgi2/Makefile.am
  61. +49 0 include/fastcgi2/component.h
  62. +56 0 include/fastcgi2/component_factory.h
  63. +41 0 include/fastcgi2/config.h
  64. +51 0 include/fastcgi2/cookie.h
  65. +93 0 include/fastcgi2/data_buffer.h
  66. +45 0 include/fastcgi2/except.h
  67. +36 0 include/fastcgi2/handler.h
  68. +102 0 include/fastcgi2/helpers.h
  69. +56 0 include/fastcgi2/logger.h
  70. +108 0 include/fastcgi2/request.h
  71. +16 0 include/fastcgi2/request_io_stream.h
  72. +36 0 include/fastcgi2/stream.h
  73. +58 0 include/fastcgi2/util.h
  74. +11 0 library/Makefile.am
  75. +31 0 library/component.cpp
  76. +42 0 library/component_context.cpp
  77. +17 0 library/component_factory.cpp
  78. +110 0 library/componentset.cpp
  79. +213 0 library/config.cpp
  80. +257 0 library/cookie.cpp
  81. +337 0 library/data_buffer.cpp
  82. +51 0 library/except.cpp
  83. +148 0 library/globals.cpp
  84. +38 0 library/handler.cpp
  85. +118 0 library/handlerset.cpp
  86. +90 0 library/loader.cpp
  87. +202 0 library/logger.cpp
  88. +295 0 library/parser.cpp
  89. +294 0 library/request.cpp
  90. +103 0 library/request_thread_pool.cpp
  91. +818 0 library/requestimpl.cpp
  92. +18 0 library/response_time_statistics.cpp
  93. +49 0 library/server.cpp
  94. +21 0 library/stream.cpp
  95. +91 0 library/string_buffer.cpp
  96. +225 0 library/util.cpp
  97. +88 0 library/xml.cpp
  98. +10 0 logging/Makefile.am
  99. +128 0 logging/logger.cpp
  100. +40 0 logging/logger.h
  101. +10 0 main/Makefile.am
  102. +104 0 main/endpoint.cpp
  103. +48 0 main/endpoint.h
  104. +2 0  main/fastcgi.conf.example
  105. +111 0 main/fcgi_request.cpp
  106. +52 0 main/fcgi_request.h
  107. +455 0 main/fcgi_server.cpp
  108. +128 0 main/fcgi_server.h
  109. +53 0 main/main.cpp
  110. +10 0 request-cache/Makefile.am
  111. +166 0 request-cache/file_buffer.cpp
  112. +50 0 request-cache/file_buffer.h
  113. +334 0 request-cache/file_cache.cpp
  114. +72 0 request-cache/file_cache.h
  115. +203 0 request-cache/mmap_file.cpp
  116. +66 0 request-cache/mmap_file.h
  117. +10 0 statistics/Makefile.am
  118. +117 0 statistics/response_time_handler.cpp
  119. +53 0 statistics/response_time_handler.h
  120. +10 0 syslog/Makefile.am
  121. +97 0 syslog/syslog-logger.cpp
  122. +39 0 syslog/syslog-logger.h
  123. +13 0 tests/Makefile.am
  124. +18 0 tests/main.cpp
  125. +34 0 tests/multipart-test-n.dat
  126. +29 0 tests/multipart-test-rn.dat
  127. +21 0 tests/multipart-test-rn2.dat
  128. +21 0 tests/test.conf
  129. +34 0 tests/test_cache.conf
  130. +38 0 tests/test_config.cpp
  131. +290 0 tests/test_request.cpp
16 Makefile.am
... ... @@ -0,0 +1,16 @@
  1 +AUTOMAKE_OPTIONS = 1.9 foreign
  2 +
  3 +SUBDIRS = include library main example syslog request-cache statistics file-logger
  4 +
  5 +ACLOCAL_AMFLAGS = -I config -I /usr/share/autoconf-archive/
  6 +
  7 +if HAVE_CPPUNIT
  8 +SUBDIRS += tests
  9 +endif
  10 +
  11 +EXTRA_DIST = autogen.sh config/settings.h.in config/ac_cxx_gnucxx_hashmap.m4 \
  12 + config/ac_cxx_have_ext_hash_map.m4 config/ac_cxx_namespaces.m4 \
  13 + config/ac_cxx_stlport_hashmap.m4 config/ax_check_cppunit.m4 \
  14 + config/ax_check_dmalloc.m4 config/ax_check_fastcgi.m4 \
  15 + ax_check_compiler_flags.m4 config/cppunit.m4 extra/fastcgi-daemon2 \
  16 + extra/fastcgistart2.sh
1,491 autogen.sh
... ... @@ -0,0 +1,1491 @@
  1 +#!/bin/sh
  2 +# a u t o g e n . s h
  3 +#
  4 +# Copyright (c) 2005-2007 United States Government as represented by
  5 +# the U.S. Army Research Laboratory.
  6 +#
  7 +# Redistribution and use in source and binary forms, with or without
  8 +# modification, are permitted provided that the following conditions
  9 +# are met:
  10 +#
  11 +# 1. Redistributions of source code must retain the above copyright
  12 +# notice, this list of conditions and the following disclaimer.
  13 +#
  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.
  18 +#
  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
  21 +# permission.
  22 +#
  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.
  34 +#
  35 +###
  36 +#
  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.
  41 +#
  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.
  46 +#
  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
  50 +# autoreconf.
  51 +#
  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.
  57 +#
  58 +# Examples:
  59 +#
  60 +# To obtain help on usage:
  61 +# ./autogen.sh --help
  62 +#
  63 +# To obtain verbose output:
  64 +# ./autogen.sh --verbose
  65 +#
  66 +# To skip autoreconf and prepare manually:
  67 +# AUTORECONF=false ./autogen.sh
  68 +#
  69 +# To verbosely try running with an older (unsupported) autoconf:
  70 +# AUTOCONF_VERSION=2.50 ./autogen.sh --verbose
  71 +#
  72 +# Author: Christopher Sean Morrison <morrison@brlcad.org>
  73 +#
  74 +######################################################################
  75 +
  76 +# set to minimum acceptible version of autoconf
  77 +if [ "x$AUTOCONF_VERSION" = "x" ] ; then
  78 + AUTOCONF_VERSION=2.52
  79 +fi
  80 +# set to minimum acceptible version of automake
  81 +if [ "x$AUTOMAKE_VERSION" = "x" ] ; then
  82 + AUTOMAKE_VERSION=1.6.0
  83 +fi
  84 +# set to minimum acceptible version of libtool
  85 +if [ "x$LIBTOOL_VERSION" = "x" ] ; then
  86 + LIBTOOL_VERSION=1.4.2
  87 +fi
  88 +
  89 +
  90 +##################
  91 +# ident function #
  92 +##################
  93 +ident ( ) {
  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`"
  98 + fi
  99 +
  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
  104 + __version=""
  105 + fi
  106 +
  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"
  110 +}
  111 +
  112 +
  113 +##################
  114 +# USAGE FUNCTION #
  115 +##################
  116 +usage ( ) {
  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"
  122 + echo
  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"
  127 +
  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."
  132 + echo
  133 +
  134 + ident
  135 +
  136 + return 0
  137 +}
  138 +
  139 +
  140 +##########################
  141 +# VERSION_ERROR FUNCTION #
  142 +##########################
  143 +version_error ( ) {
  144 + if [ "x$1" = "x" ] ; then
  145 + echo "INTERNAL ERROR: version_error was not provided a version"
  146 + exit 1
  147 + fi
  148 + if [ "x$2" = "x" ] ; then
  149 + echo "INTERNAL ERROR: version_error was not provided an application name"
  150 + exit 1
  151 + fi
  152 + $ECHO
  153 + $ECHO "ERROR: To prepare the ${PROJECT} build system from scratch,"
  154 + $ECHO " at least version $1 of $2 must be installed."
  155 + $ECHO
  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!"
  160 + $ECHO
  161 +}
  162 +
  163 +##########################
  164 +# VERSION_CHECK FUNCTION #
  165 +##########################
  166 +version_check ( ) {
  167 + if [ "x$1" = "x" ] ; then
  168 + echo "INTERNAL ERROR: version_check was not provided a minimum version"
  169 + exit 1
  170 + fi
  171 + _min="$1"
  172 + if [ "x$2" = "x" ] ; then
  173 + echo "INTERNAL ERROR: version check was not provided a comparison version"
  174 + exit 1
  175 + fi
  176 + _cur="$2"
  177 +
  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'`"
  181 +
  182 + _min_major="`echo $_min | cut -d. -f1`"
  183 + _min_minor="`echo $_min | cut -d. -f2`"
  184 + _min_patch="`echo $_min | cut -d. -f3`"
  185 +
  186 + _cur_major="`echo $_cur | cut -d. -f1`"
  187 + _cur_minor="`echo $_cur | cut -d. -f2`"
  188 + _cur_patch="`echo $_cur | cut -d. -f3`"
  189 +
  190 + if [ "x$_min_major" = "x" ] ; then
  191 + _min_major=0
  192 + fi
  193 + if [ "x$_min_minor" = "x" ] ; then
  194 + _min_minor=0
  195 + fi
  196 + if [ "x$_min_patch" = "x" ] ; then
  197 + _min_patch=0
  198 + fi
  199 + if [ "x$_cur_minor" = "x" ] ; then
  200 + _cur_major=0
  201 + fi
  202 + if [ "x$_cur_minor" = "x" ] ; then
  203 + _cur_minor=0
  204 + fi
  205 + if [ "x$_cur_patch" = "x" ] ; then
  206 + _cur_patch=0
  207 + fi
  208 +
  209 + $VERBOSE_ECHO "Checking if ${_cur_major}.${_cur_minor}.${_cur_patch} is greater than ${_min_major}.${_min_minor}.${_min_patch}"
  210 +
  211 + if [ $_min_major -lt $_cur_major ] ; then
  212 + return 0
  213 + elif [ $_min_major -eq $_cur_major ] ; then
  214 + if [ $_min_minor -lt $_cur_minor ] ; then
  215 + return 0
  216 + elif [ $_min_minor -eq $_cur_minor ] ; then
  217 + if [ $_min_patch -lt $_cur_patch ] ; then
  218 + return 0
  219 + elif [ $_min_patch -eq $_cur_patch ] ; then
  220 + return 0
  221 + fi
  222 + fi
  223 + fi
  224 + return 1
  225 +}
  226 +
  227 +
  228 +######################################
  229 +# LOCATE_CONFIGURE_TEMPLATE FUNCTION #
  230 +######################################
  231 +locate_configure_template ( ) {
  232 + _pwd="`pwd`"
  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"
  245 + fi
  246 +}
  247 +
  248 +
  249 +##################
  250 +# argument check #
  251 +##################
  252 +ARGS="$*"
  253 +PATH_TO_AUTOGEN="`dirname $0`"
  254 +NAME_OF_AUTOGEN="`basename $0`"
  255 +AUTOGEN_SH="$PATH_TO_AUTOGEN/$NAME_OF_AUTOGEN"
  256 +
  257 +LIBTOOL_M4="${PATH_TO_AUTOGEN}/misc/libtool.m4"
  258 +
  259 +if [ "x$HELP" = "x" ] ; then
  260 + HELP=no
  261 +fi
  262 +if [ "x$QUIET" = "x" ] ; then
  263 + QUIET=no
  264 +fi
  265 +if [ "x$VERBOSE" = "x" ] ; then
  266 + VERBOSE=no
  267 +fi
  268 +if [ "x$VERSION_ONLY" = "x" ] ; then
  269 + VERSION_ONLY=no
  270 +fi
  271 +if [ "x$AUTORECONF_OPTIONS" = "x" ] ; then
  272 + AUTORECONF_OPTIONS="-i -f"
  273 +fi
  274 +if [ "x$AUTOCONF_OPTIONS" = "x" ] ; then
  275 + AUTOCONF_OPTIONS="-f"
  276 +fi
  277 +if [ "x$AUTOMAKE_OPTIONS" = "x" ] ; then
  278 + AUTOMAKE_OPTIONS="-a -c -f"
  279 +fi
  280 +ALT_AUTOMAKE_OPTIONS="-a -c"
  281 +if [ "x$LIBTOOLIZE_OPTIONS" = "x" ] ; then
  282 + LIBTOOLIZE_OPTIONS="--automake -c -f"
  283 +fi
  284 +ALT_LIBTOOLIZE_OPTIONS="--automake --copy --force"
  285 +if [ "x$ACLOCAL_OPTIONS" = "x" ] ; then
  286 + ACLOCAL_OPTIONS=""
  287 +fi
  288 +if [ "x$AUTOHEADER_OPTIONS" = "x" ] ; then
  289 + AUTOHEADER_OPTIONS=""
  290 +fi
  291 +for arg in $ARGS ; do
  292 + case "x$arg" in
  293 + x--help) HELP=yes ;;
  294 + x-[hH]) HELP=yes ;;
  295 + x--quiet) QUIET=yes ;;
  296 + x-[qQ]) QUIET=yes ;;
  297 + x--verbose) VERBOSE=yes ;;
  298 + x-[vV]) VERBOSE=yes ;;
  299 + x--version) VERSION_ONLY=yes ;;
  300 + *)
  301 + echo "Unknown option: $arg"
  302 + echo
  303 + usage
  304 + exit 1
  305 + ;;
  306 + esac
  307 +done
  308 +
  309 +
  310 +#####################
  311 +# environment check #
  312 +#####################
  313 +
  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"
  319 + fi
  320 + exit 1
  321 +fi
  322 +
  323 +# force locale setting to C so things like date output as expected
  324 +LC_ALL=C
  325 +
  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"
  331 + exit 2
  332 + fi
  333 +done
  334 +echo "test" | grep "test" > /dev/null 2>&1
  335 +if test ! x$? = x0 ; then
  336 + echo "INTERNAL ERROR: grep command is required"
  337 + exit 1
  338 +fi
  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"
  342 + exit 1
  343 +fi
  344 +
  345 +
  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='
  349 +' ECHO_T=' ' ;;
  350 + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
  351 + *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
  352 +esac
  353 +
  354 +# determine the behavior of head
  355 +case "x`echo 'head' | head -n 1 2>&1`" in
  356 + *xhead*) HEAD_N="n " ;;
  357 + *) HEAD_N="" ;;
  358 +esac
  359 +
  360 +# determine the behavior of tail
  361 +case "x`echo 'tail' | tail -n 1 2>&1`" in
  362 + *xtail*) TAIL_N="n " ;;
  363 + *) TAIL_N="" ;;
  364 +esac
  365 +
  366 +VERBOSE_ECHO=:
  367 +ECHO=:
  368 +if [ "x$QUIET" = "xyes" ] ; then
  369 + if [ "x$VERBOSE" = "xyes" ] ; then
  370 + echo "Verbose output quelled by quiet option. Further output disabled."
  371 + fi
  372 +else
  373 + ECHO=echo
  374 + if [ "x$VERBOSE" = "xyes" ] ; then
  375 + echo "Verbose output enabled"
  376 + VERBOSE_ECHO=echo
  377 + fi
  378 +fi
  379 +
  380 +
  381 +# allow a recursive run to disable further recursions
  382 +if [ "x$RUN_RECURSIVE" = "x" ] ; then
  383 + RUN_RECURSIVE=yes
  384 +fi
  385 +
  386 +
  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
  391 + HELP=yes
  392 +fi
  393 +if [ "x$HELP" = "xyes" ] ; then
  394 + usage
  395 + $ECHO "---"
  396 + $ECHO "Help was requested. No preparation or configuration will be performed."
  397 + exit 0
  398 +fi
  399 +
  400 +
  401 +#######################
  402 +# set up signal traps #
  403 +#######################
  404 +untrap_abnormal ( ) {
  405 + for sig in 1 2 13 15; do
  406 + trap - $sig
  407 + done
  408 +}
  409 +
  410 +# do this cleanup whenever we exit.
  411 +trap '
  412 + # start from the root
  413 + if test -d "$START_PATH" ; then
  414 + cd "$START_PATH"
  415 + fi
  416 +
  417 + # restore/delete backup files
  418 + if test "x$PFC_INIT" = "x1" ; then
  419 + recursive_restore
  420 + fi
  421 +' 0
  422 +
  423 +# trap SIGHUP (1), SIGINT (2), SIGPIPE (13), SIGTERM (15)
  424 +for sig in 1 2 13 15; do
  425 + trap '
  426 + $ECHO ""
  427 + $ECHO "Aborting $NAME_OF_AUTOGEN: caught signal '$sig'"
  428 +
  429 + # start from the root
  430 + if test -d "$START_PATH" ; then
  431 + cd "$START_PATH"
  432 + fi
  433 +
  434 + # clean up on abnormal exit
  435 + $VERBOSE_ECHO "rm -rf autom4te.cache"
  436 + rm -rf autom4te.cache
  437 +
  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
  442 +
  443 + $VERBOSE_ECHO "rm -f acinclude.m4.$$.backup"
  444 + rm -f acinclude.m4.$$.backup
  445 + fi
  446 +
  447 + { (exit 1); exit 1; }
  448 +' $sig
  449 +done
  450 +
  451 +
  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"
  459 + fi
  460 +else
  461 + $ECHO "Using CONFIGURE environment variable override: $CONFIGURE"
  462 +fi
  463 +if [ "x$CONFIGURE" = "x" ] ; then
  464 + if [ "x$VERSION_ONLY" = "xyes" ] ; then
  465 + CONFIGURE=/dev/null
  466 + else
  467 + $ECHO
  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."
  471 + $ECHO
  472 + $ECHO "ERROR: No configure.in or configure.ac file found in `pwd`"
  473 + exit 1
  474 + fi
  475 +fi
  476 +
  477 +####################
  478 +# get project name #
  479 +####################
  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/'`"
  485 + fi
  486 + if [ "x$PROJECT" = "xAM_INIT_AUTOMAKE" ] ; then
  487 + PROJECT="project"
  488 + fi
  489 + if [ "x$PROJECT" = "x" ] ; then
  490 + PROJECT="project"
  491 + fi
  492 +else
  493 + $ECHO "Using PROJECT environment variable override: $PROJECT"
  494 +fi
  495 +$ECHO "Preparing the $PROJECT build system...please wait"
  496 +$ECHO
  497 +
  498 +
  499 +########################
  500 +# check for autoreconf #
  501 +########################
  502 +HAVE_AUTORECONF=no
  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
  507 + if [ $? = 0 ] ; then
  508 + HAVE_AUTORECONF=yes
  509 + break
  510 + fi
  511 + done
  512 +else
  513 + HAVE_AUTORECONF=yes
  514 + $ECHO "Using AUTORECONF environment variable override: $AUTORECONF"
  515 +fi
  516 +
  517 +
  518 +##########################
  519 +# autoconf version check #
  520 +##########################
  521 +_acfound=no
  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
  526 + if [ $? = 0 ] ; then
  527 + _acfound=yes
  528 + break
  529 + fi
  530 + done
  531 +else
  532 + _acfound=yes
  533 + $ECHO "Using AUTOCONF environment variable override: $AUTOCONF"
  534 +fi
  535 +
  536 +_report_error=no
  537 +if [ ! "x$_acfound" = "xyes" ] ; then
  538 + $ECHO "ERROR: Unable to locate GNU Autoconf."
  539 + _report_error=yes
  540 +else
  541 + _version="`$AUTOCONF --version | head -${HEAD_N}1 | sed 's/[^0-9]*\([0-9\.][0-9\.]*\)/\1/'`"
  542 + if [ "x$_version" = "x" ] ; then
  543 + _version="0.0.0"
  544 + fi
  545 + $ECHO "Found GNU Autoconf version $_version"
  546 + version_check "$AUTOCONF_VERSION" "$_version"
  547 + if [ $? -ne 0 ] ; then
  548 + _report_error=yes
  549 + fi
  550 +fi
  551 +if [ "x$_report_error" = "xyes" ] ; then
  552 + version_error "$AUTOCONF_VERSION" "GNU Autoconf"
  553 + exit 1
  554 +fi
  555 +
  556 +
  557 +##########################
  558 +# automake version check #
  559 +##########################
  560 +_amfound=no
  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
  565 + if [ $? = 0 ] ; then
  566 + _amfound=yes
  567 + break
  568 + fi
  569 + done
  570 +else
  571 + _amfound=yes
  572 + $ECHO "Using AUTOMAKE environment variable override: $AUTOMAKE"
  573 +fi
  574 +
  575 +
  576 +_report_error=no
  577 +if [ ! "x$_amfound" = "xyes" ] ; then
  578 + $ECHO
  579 + $ECHO "ERROR: Unable to locate GNU Automake."
  580 + _report_error=yes
  581 +else
  582 + _version="`$AUTOMAKE --version | head -${HEAD_N}1 | sed 's/[^0-9]*\([0-9\.][0-9\.]*\)/\1/'`"
  583 + if [ "x$_version" = "x" ] ; then
  584 + _version="0.0.0"
  585 + fi
  586 + $ECHO "Found GNU Automake version $_version"
  587 + version_check "$AUTOMAKE_VERSION" "$_version"
  588 + if [ $? -ne 0 ] ; then
  589 + _report_error=yes
  590 + fi
  591 +fi
  592 +if [ "x$_report_error" = "xyes" ] ; then
  593 + version_error "$AUTOMAKE_VERSION" "GNU Automake"
  594 + exit 1
  595 +fi
  596 +
  597 +
  598 +########################
  599 +# check for libtoolize #
  600 +########################
  601 +HAVE_LIBTOOLIZE=yes
  602 +HAVE_ALT_LIBTOOLIZE=no
  603 +_ltfound=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
  609 + HAVE_LIBTOOLIZE=no
  610 + $ECHO
  611 + if [ "x$HAVE_AUTORECONF" = "xno" ] ; then
  612 + $ECHO "Warning: libtoolize does not appear to be available."
  613 + else
  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."
  618 + fi
  619 +
  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`"
  624 + if [ $? = 0 ] ; then
  625 + $VERBOSE_ECHO "Found $tool --version"
  626 + _glti="`which $tool`"
  627 + if [ "x$_glti" = "x" ] ; then
  628 + $VERBOSE_ECHO "Cannot find $tool with which"
  629 + continue;
  630 + fi
  631 + if test ! -f "$_glti" ; then
  632 + $VERBOSE_ECHO "Cannot use $tool, $_glti is not a file"
  633 + continue;
  634 + fi
  635 + _gltidir="`dirname $_glti`"
  636 + if [ "x$_gltidir" = "x" ] ; then
  637 + $VERBOSE_ECHO "Cannot find $tool path with dirname of $_glti"
  638 + continue;
  639 + fi
  640 + if test ! -d "$_gltidir" ; then
  641 + $VERBOSE_ECHO "Cannot use $tool, $_gltidir is not a directory"
  642 + continue;
  643 + fi
  644 + HAVE_ALT_LIBTOOLIZE=yes
  645 + LIBTOOLIZE="$tool"
  646 + $ECHO
  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"
  650 + $ECHO "running:"
  651 + $ECHO
  652 + sudo -V > /dev/null 2>&1
  653 + if [ $? = 0 ] ; then
  654 + $ECHO " sudo ln -s $_glti $_gltidir/libtoolize"
  655 + $ECHO
  656 + else
  657 + $ECHO " ln -s $_glti $_gltidir/libtoolize"
  658 + $ECHO
  659 + $ECHO "Run that as root or with proper permissions to the $_gltidir directory"
  660 + $ECHO
  661 + fi
  662 + _ltfound=yes
  663 + break
  664 + fi
  665 + done
  666 + else
  667 + _ltfound=yes
  668 + fi
  669 +else
  670 + _ltfound=yes
  671 + $ECHO "Using LIBTOOLIZE environment variable override: $LIBTOOLIZE"
  672 +fi
  673 +
  674 +
  675 +############################
  676 +# libtoolize version check #
  677 +############################
  678 +_report_error=no
  679 +if [ ! "x$_ltfound" = "xyes" ] ; then
  680 + $ECHO
  681 + $ECHO "ERROR: Unable to locate GNU Libtool."
  682 + _report_error=yes
  683 +else
  684 + _version="`$LIBTOOLIZE --version | head -${HEAD_N}1 | sed 's/[^0-9]*\([0-9\.][0-9\.]*\)/\1/'`"
  685 + if [ "x$_version" = "x" ] ; then
  686 + _version="0.0.0"
  687 + fi
  688 + $ECHO "Found GNU Libtool version $_version"
  689 + version_check "$LIBTOOL_VERSION" "$_version"
  690 + if [ $? -ne 0 ] ; then
  691 + _report_error=yes
  692 + fi
  693 +fi
  694 +if [ "x$_report_error" = "xyes" ] ; then
  695 + version_error "$LIBTOOL_VERSION" "GNU Libtool"
  696 + exit 1
  697 +fi
  698 +
  699 +
  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
  707 + if [ $? = 0 ] ; then
  708 + break
  709 + fi
  710 + done
  711 +else
  712 + $ECHO "Using ACLOCAL environment variable override: $ACLOCAL"
  713 +fi
  714 +
  715 +
  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
  723 + if [ $? = 0 ] ; then
  724 + break
  725 + fi
  726 + done
  727 +else
  728 + $ECHO "Using AUTOHEADER environment variable override: $AUTOHEADER"
  729 +fi
  730 +
  731 +
  732 +#########################
  733 +# check if version only #
  734 +#########################
  735 +$VERBOSE_ECHO "Checking whether to only output version information"
  736 +if [ "x$VERSION_ONLY" = "xyes" ] ; then
  737 + $ECHO
  738 + ident
  739 + $ECHO "---"
  740 + $ECHO "Version requested. No preparation or configuration will be performed."
  741 + exit 0
  742 +fi
  743 +
  744 +
  745 +#################################
  746 +# PROTECT_FROM_CLOBBER FUNCTION #
  747 +#################################
  748 +protect_from_clobber ( ) {
  749 + PFC_INIT=1
  750 +
  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.
  758 +
  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`"
  762 + else
  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
  766 + fi
  767 + fi
  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`"
  771 + else
  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
  775 + fi
  776 + fi
  777 +}
  778 +
  779 +
  780 +##############################
  781 +# RECURSIVE_PROTECT FUNCTION #
  782 +##############################
  783 +recursive_protect ( ) {
  784 +
  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.
  789 +
  790 + # git 'r done, protect COPYING and INSTALL from being clobbered
  791 + protect_from_clobber
  792 +
  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
  797 + fi
  798 +
  799 + # find configure template
  800 + _configure="`locate_configure_template`"
  801 + if [ "x$_configure" = "x" ] ; then
  802 + return
  803 + fi
  804 + # $VERBOSE_ECHO "Looking for configure template found `pwd`/$_configure"
  805 +
  806 + # look for subdirs
  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/'`"
  809 + CHECK_DIRS=""
  810 + for dir in $_det_config_subdirs ; do
  811 + if test -d "`pwd`/$dir" ; then
  812 + CHECK_DIRS="$CHECK_DIRS \"`pwd`/$dir\""
  813 + fi
  814 + done
  815 +
  816 + # process subdirs
  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"
  822 + cd "$START_PATH"
  823 + eval "cd $dir"
  824 +
  825 + # recursively git 'r done
  826 + recursive_protect
  827 + done
  828 + fi
  829 +} # end of recursive_protect
  830 +
  831 +
  832 +#############################
  833 +# RESTORE_CLOBBERED FUNCION #
  834 +#############################
  835 +restore_clobbered ( ) {
  836 +
  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.
  840 +
  841 + spacer=no
  842 +
  843 + # COPYING
  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
  849 + $VERBOSE_ECHO
  850 + spacer=yes
  851 + fi
  852 + # restore the backup
  853 + $VERBOSE_ECHO "Restoring COPYING from backup (automake -f likely clobbered it)"
  854 + $VERBOSE_ECHO "rm -f COPYING"
  855 + rm -f COPYING
  856 + $VERBOSE_ECHO "mv COPYING.$$.protect_from_automake.backup COPYING"
  857 + mv COPYING.$$.protect_from_automake.backup COPYING
  858 + fi # check contents
  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
  862 + fi # -f COPYING
  863 +
  864 + # just in case
  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
  868 +
  869 + # INSTALL
  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
  875 + $VERBOSE_ECHO
  876 + spacer=yes
  877 + fi
  878 + # restore the backup
  879 + $VERBOSE_ECHO "Restoring INSTALL from backup (automake -f likely clobbered it)"
  880 + $VERBOSE_ECHO "rm -f INSTALL"
  881 + rm -f INSTALL
  882 + $VERBOSE_ECHO "mv INSTALL.$$.protect_from_automake.backup INSTALL"
  883 + mv INSTALL.$$.protect_from_automake.backup INSTALL
  884 + fi # check contents
  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
  888 + fi # -f INSTALL
  889 +
  890 + # just in case
  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
  894 +
  895 + CONFIGURE="`locate_configure_template`"
  896 + if [ "x$CONFIGURE" = "x" ] ; then
  897 + return
  898 + fi
  899 +
  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
  902 + _aux_dir=.
  903 + fi
  904 +
  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"
  909 + fi
  910 + done
  911 +} # end of restore_clobbered
  912 +
  913 +
  914 +##############################
  915 +# RECURSIVE_RESTORE FUNCTION #
  916 +##############################
  917 +recursive_restore ( ) {
  918 +
  919 + # restore COPYING and INSTALL from backup if they were clobbered
  920 + # for each directory recursively.
  921 +
  922 + # git 'r undone
  923 + restore_clobbered
  924 +
  925 + # find configure template
  926 + _configure="`locate_configure_template`"
  927 + if [ "x$_configure" = "x" ] ; then
  928 + return
  929 + fi
  930 +
  931 + # look for subdirs
  932 + _det_config_subdirs="`grep AC_CONFIG_SUBDIRS $_configure | grep -v '.*#.*AC_CONFIG_SUBDIRS' | sed 's/^[ ]*AC_CONFIG_SUBDIRS(\(.*\)).*/\1/' | sed 's/.*\[\(.*\)\].*/\1/'`"
  933 + CHECK_DIRS=""
  934 + for dir in $_det_config_subdirs ; do
  935 + if test -d "`pwd`/$dir" ; then
  936 + CHECK_DIRS="$CHECK_DIRS \"`pwd`/$dir\""
  937 + fi
  938 + done
  939 +
  940 + # process subdirs
  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"
  946 + cd "$START_PATH"
  947 + eval "cd $dir"
  948 +
  949 + # recursively git 'r undone
  950 + recursive_restore
  951 + done
  952 + fi
  953 +} # end of recursive_restore
  954 +
  955 +
  956 +#######################
  957 +# INITIALIZE FUNCTION #
  958 +#######################
  959 +initialize ( ) {
  960 +
  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.
  964 + #
  965 + # this function sets:
  966 + # CONFIGURE
  967 + # SEARCH_DIRS
  968 + # CONFIG_SUBDIRS
  969 +
  970 + ##################################
  971 + # check for a configure template #
  972 + ##################################
  973 + CONFIGURE="`locate_configure_template`"
  974 + if [ "x$CONFIGURE" = "x" ] ; then
  975 + $ECHO
  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."
  979 + $ECHO
  980 + $ECHO "ERROR: No configure.in or configure.ac file found in `pwd`"
  981 + exit 1
  982 + fi
  983 +
  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
  989 + _aux_dir=.
  990 + else
  991 + $VERBOSE_ECHO "Detected auxillary directory: $_aux_dir"
  992 + fi
  993 +
  994 + ################################
  995 + # detect a recursive configure #
  996 + ################################
  997 + CONFIG_SUBDIRS=""
  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"
  1003 + fi
  1004 + done
  1005 +
  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"
  1012 + touch $file
  1013 + fi
  1014 + done
  1015 +
  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"
  1023 + fi
  1024 + done
  1025 +
  1026 + ############################
  1027 + # search alternate m4 dirs #
  1028 + ############################
  1029 + SEARCH_DIRS=""
  1030 + for dir in m4 ; do
  1031 + if [ -d $dir ] ; then
  1032 + $VERBOSE_ECHO "Found extra aclocal search directory: $dir"
  1033 + SEARCH_DIRS="$SEARCH_DIRS -I $dir"
  1034 + fi
  1035 + done
  1036 +
  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
  1044 + fi
  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"
  1049 +# rm -f aclocal.m4
  1050 +# fi
  1051 +
  1052 +} # end of initialize()
  1053 +
  1054 +
  1055 +##############
  1056 +# initialize #
  1057 +##############
  1058 +
  1059 +# stash path
  1060 +START_PATH="`pwd`"
  1061 +
  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.
  1066 +recursive_protect
  1067 +
  1068 +# start from where we started
  1069 +cd "$START_PATH"
  1070 +
  1071 +# get ready to process
  1072 +initialize
  1073 +
  1074 +
  1075 +############################################
  1076 +# prepare build via autoreconf or manually #
  1077 +############################################
  1078 +reconfigure_manually=no
  1079 +if [ "x$HAVE_AUTORECONF" = "xyes" ] ; then
  1080 + $ECHO
  1081 + $ECHO $ECHO_N "Automatically preparing build ... $ECHO_C"
  1082 +
  1083 + $VERBOSE_ECHO "$AUTORECONF $SEARCH_DIRS $AUTORECONF_OPTIONS"
  1084 + autoreconf_output="`$AUTORECONF $SEARCH_DIRS $AUTORECONF_OPTIONS 2>&1`"
  1085 + ret=$?
  1086 + $VERBOSE_ECHO "$autoreconf_output"
  1087 +
  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
  1091 + $ECHO
  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."
  1096 + $ECHO
  1097 + $ECHO "Restarting the preparation steps with LIBTOOLIZE set to $LIBTOOLIZE"
  1098 +
  1099 + export LIBTOOLIZE
  1100 + RUN_RECURSIVE=no
  1101 + export RUN_RECURSIVE
  1102 + untrap_abnormal
  1103 +
  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"
  1106 + exit $?
  1107 + fi
  1108 + fi
  1109 +
  1110 + $ECHO "Warning: $AUTORECONF failed"
  1111 +
  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"
  1114 + fi
  1115 +
  1116 + $ECHO "Attempting to run the preparation steps individually"
  1117 + reconfigure_manually=yes
  1118 + fi
  1119 +else
  1120 + reconfigure_manually=yes
  1121 +fi
  1122 +
  1123 +
  1124 +############################
  1125 +# LIBTOOL_FAILURE FUNCTION #
  1126 +############################
  1127 +libtool_failure ( ) {
  1128 +
  1129 + # libtool is rather error-prone in comparison to the other
  1130 + # autotools and this routine attempts to compensate for some