The following reply was made to PR config/2654; it has been noted by GNATS.

From: "Ralf S. Engelschall" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: config/2654: APACI autoconfig generates broken Configure.apaci
Date: Sat, 25 Jul 1998 13:16:00 +0200

 In article <[EMAIL PROTECTED]> you wrote:
 > The following reply was made to PR config/2654; it has been noted by GNATS.
 
 > From: Andreas Muck <[EMAIL PROTECTED]>
 > To: [EMAIL PROTECTED]
 > Cc: [EMAIL PROTECTED]
 > Subject: Re: config/2654: APACI autoconfig generates broken Configure.apaci
 > Date: Wed, 22 Jul 1998 19:58:41 +0200 (MEST)
 >[...]
 >  >So please check again your system and
 >  >either provide us with more details (exactly
 >  >which construct in configure makes the problem)
 >  >or try to fix your (perhaps) broken /bin/echo.
 >  
 >  As for me, I did a simple "%s/echo/echo -E/g" on the configure script and
 >  this fixed it. But like I said, I think others may not be able to find out
 >  how to get it running that easy. At least add a note to some README file
 >  pointing out the problem, I can't believe it I'm the only one with a
 >  non-default echo ;)
 >  
 >  >Please reply with more information. Thanks.
 >  
 >  Hope it was understandable now :-)
 >[...]
 
 Yeah, now the problem is clear. Its actually Linux' /bin/echo which is broken.
 Also on my Debian box. But usually this doesn't harm because the internal echo
 from the shell is used (which is not broken). Why your /bin/echo is used
 instead of the internal one is not known to me. But we have a problem.  I've
 tried to fix it in the configure script but want another guy to review it
 under other platforms before I commit for Apache 1.3.2. I append you the fixed
 "configure" script below. Please copy it over your configure script from 1.3.1
 and try again. And then please give immediately feedback. Thanks.
 
 Greetings,
                                        Ralf S. Engelschall
                                        [EMAIL PROTECTED]
                                        www.engelschall.com
 
 #!/bin/sh
 ## ====================================================================
 ## Copyright (c) 1998 The Apache Group.  All rights reserved.
 ##
 ## Redistribution and use in source and binary forms, with or without
 ## modification, are permitted provided that the following conditions
 ## are met:
 ##
 ## 1. Redistributions of source code must retain the above copyright
 ##    notice, this list of conditions and the following disclaimer. 
 ##
 ## 2. Redistributions in binary form must reproduce the above copyright
 ##    notice, this list of conditions and the following disclaimer in
 ##    the documentation and/or other materials provided with the
 ##    distribution.
 ##
 ## 3. All advertising materials mentioning features or use of this
 ##    software must display the following acknowledgment:
 ##    "This product includes software developed by the Apache Group
 ##    for use in the Apache HTTP server project (http://www.apache.org/)."
 ##
 ## 4. The names "Apache Server" and "Apache Group" must not be used to
 ##    endorse or promote products derived from this software without
 ##    prior written permission. For written permission, please contact
 ##    [EMAIL PROTECTED]
 ##
 ## 5. Products derived from this software may not be called "Apache"
 ##    nor may "Apache" appear in their names without prior written
 ##    permission of the Apache Group.
 ##
 ## 6. Redistributions of any form whatsoever must retain the following
 ##    acknowledgment:
 ##    "This product includes software developed by the Apache Group
 ##    for use in the Apache HTTP server project (http://www.apache.org/)."
 ##
 ## THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
 ## EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 ## PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE APACHE GROUP OR
 ## ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 ## NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 ## LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 ## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 ## STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 ## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 ## OF THE POSSIBILITY OF SUCH DAMAGE.
 ## ====================================================================
 ##
 ## This software consists of voluntary contributions made by many
 ## individuals on behalf of the Apache Group and was originally based
 ## on public domain software written at the National Center for
 ## Supercomputing Applications, University of Illinois, Urbana-Champaign.
 ## For more information on the Apache Group and the Apache HTTP server
 ## project, please see <http://www.apache.org/>.
 ##
 
 ##
 ##  configure -- Apache Autoconf-style Interface (APACI) 
 ##
 ##  Written by Ralf S. Engelschall <[EMAIL PROTECTED]>
 ##
 
 #   default input separator chars: <space><tab><cr>
 DIFS='         
 '
 
 ##
 ##  the paths to the Apache source tree
 ##
 
 top=.
 mkf=Makefile
 src=src
 aux=src/helpers
 sedsubst=src/.apaci.sedsubst
 addconf=src/.apaci.addconf
 configstatus=config.status
 
 ##
 ##  pre-determine runtime modes
 ##
 
 quiet=no
 verbose=no
 case "$*" in
     --help|*--help|*--help* ) quiet=yes ;;
     --quiet|*--quiet|*--quiet* ) quiet=yes ;;
     --verbose|*--verbose|*--verbose*|-v|*-v|*-v* ) verbose=yes ;;
     * ) ;;
 esac
 
 ##
 ##  look for deadly broken echo commands which interpret escape
 ##  sequences `\XX' *per default*. For those we first try the -E option
 ##  and if it then is still broken we give an error message.
 ##
 
 ECHO=echo
 bytes=`echo '\1' | wc -c | awk '{ printf("%s", $1); }'`
 if [ ".$bytes" != .3 ]; then
     bytes=`echo -E '\1' | wc -c | awk '{ printf("%s", $1); }'`
     if [ ".$bytes" != .3 ]; then
         echo "configure:Error: Your 'echo' command is broken."
         echo "It interprets escape sequences per default."
         echo "We already tried 'echo -E' but had no success."
         echo "Please set the ECHO variable in 'configure' manually"
         echo "to a working 'echo', i.e. one which doesn't interpret"
         echo "escape sequences per default."
         exit 1
     else
         ECHO='echo -E'
     fi
 fi
 
 ##
 ##  display version information
 ##
 
 if [ ".$quiet" = .no ]; then
     APV=`cat $src/include/httpd.h |\
          grep "#define SERVER_BASEVERSION" |\
          sed -e 's/^[^"]*"//' -e 's/".*$//' -e 's/^Apache\///'`
     $ECHO "Configuring for Apache, Version $APV"
 fi
 
 ##
 ##  important hint for the first-time users
 ##
 
 if [ $# -eq 0 ]; then
     $ECHO " + Warning: Configuring Apache with default settings."
     $ECHO " + This is probably not what you really want."
     $ECHO " + Please read the README.configure and INSTALL files"
     $ECHO " + first or at least run '$0 --help' for"
     $ECHO " + a compact summary of available options."
 fi
 
 ##
 ##  determine path to (optional) Perl interpreter
 ##
 
 PERL=no-perl-on-this-system
 perlpath="`$aux/findprg.sh perl5 perl miniperl`"
 if [ ".$perlpath" != . ]; then
     PERL="$perlpath"
 fi
 
 ##
 ##  look for the best Awk we can find because some
 ##  standard Awks are really braindead and cause 
 ##  problems for our scripts under some platforms.
 ##
 
 AWK=awk
 awkpath="`$aux/findprg.sh nawk gawk awk`"
 if [ ".$awkpath" != . ]; then
     AWK="$awkpath"
 fi
 
 ##
 ##  determine default parameters
 ##
 
 #   default paths
 prefix='/usr/local/apache'
 exec_prefix='$prefix'
 bindir='$exec_prefix/bin'
 sbindir='$exec_prefix/sbin'
 libexecdir='$exec_prefix/libexec'
 mandir='$prefix/man'
 sysconfdir='$prefix/etc'
 datadir='$prefix/share'
 includedir='$prefix/include'
 localstatedir='$prefix/var'
 runtimedir='$localstatedir/run'
 logfiledir='$localstatedir/log'
 proxycachedir='$localstatedir/proxy'
 
 #   customization flags for
 #   automatic "apache" suffix 
 customized_sysconfdir=0
 customized_datadir=0
 customized_localstatedir=0
 customized_includedir=0
 
 #   check and debug
 layout=0
 
 #   suexec defaults
 suexec=0
 suexec_ok=0
 suexec_caller=www
 suexec_userdir=public_html
 suexec_uidmin=100
 suexec_gidmin=100
 suexec_safepath="/usr/local/bin:/usr/bin:/bin"
 
 #   with support tools
 support=1
 
 #   with adjustments
 confadjust=1
 
 #   determine rules
 rules=""
 rulelist=""
 OIFS="$IFS" IFS='
 '
 for rule in `grep '^Rule' $src/Configuration.tmpl`; do
     rule=`$ECHO "$rule" | sed -e 's/^Rule[ ]*//'`
     name=`$ECHO "$rule" | sed -e 's/=.*$//'`
     namelow=`$ECHO "$name" | tr "A-Z" "a-z"`
     arg=`$ECHO "$rule" | sed -e 's/^.*=//'`
     eval "rule_$namelow=$arg"
     rules="$rules:$namelow"
     rulelist="$rulelist:$name=$arg"
 done
 IFS="$OIFS"
 rules=`$ECHO $rules | sed -e 's/^://'`
 
 #   determine modules
 rm -f $addconf 2>/dev/null
 touch $addconf
 modules=""
 modulelist=""
 OIFS="$IFS" IFS='
 '
 for module in `egrep '^[# ]*(Add|Shared)Module' $src/Configuration.tmpl`; do
     add=yes
     share=no
     if [ ".`$ECHO $module | grep '^#'`" != . ]; then
         add=no
     fi
     if [ ".`$ECHO $module | grep 'SharedModule'`" != . ]; then
         share=yes
     fi
     module=`$ECHO "$module" |\
             sed -e 's%^.*/\(.*\)$%\1%' \
                 -e 's/\.[oa]$//' \
                 -e 's/^mod_//' \
                 -e 's/^lib//'`
     eval "module_$module=$add"
     eval "shared_$module=$share"
     modules="${modules}:$module"
     modulelist="${modulelist}:$module=$add"
     if [ ".$share" = .yes ]; then
         modulelist="${modulelist}*"
     fi
 done
 IFS="$OIFS"
 modules=`$ECHO $modules | sed -e 's/^://'`
 
 #   backward compatibility from old src/Configuration.tmpl
 #   parameter names to the canonical Autoconf-style shell
 #   variable names.
 OIFS="$IFS" IFS="$DIFS"
 for var in CFLAGS LDFLAGS LIBS INCLUDES DEPS; do
     eval "val=\$EXTRA_$var"
     if [ ".$val" != . ]; then
         eval "$var=\$val"
         eval "EXTRA_$var=\"\"; export EXTRA_$var"
         $ECHO " + Hint: please use $var instead of EXTRA_$var next time"
     fi
 done
 IFS="$OIFS"
 
 #   create a config status script for restoring
 #   the configuration via a simple shell script
 rm -f $configstatus 2>/dev/null
 $ECHO "#!/bin/sh" >$configstatus
 $ECHO "##" >>$configstatus
 $ECHO "##  $configstatus -- APACI auto-generated configuration restore script" 
>>$configstatus
 $ECHO "##" >>$configstatus
 $ECHO "##  Use this shell script to re-run the APACI configure script for" 
>>$configstatus
 $ECHO "##  restoring your configuration. Additional parameters can be 
supplied." >>$configstatus
 $ECHO "##" >>$configstatus
 $ECHO "" >>$configstatus
 for var in CC OPTIM CFLAGS CFLAGS_SHLIB LDFLAGS LD_SHLIB LDFLAGS_SHLIB \
            LDFLAGS_SHLIB_EXPORT LIBS INCLUDES RANLIB; do
     eval "val=\"\$$var\""
     if [ ".$val" != . ]; then
         $ECHO "$var=$val" |\
         sed -e 's:\(["$\\]\):\\\1:g' \
             -e 's:\([A-Z]*=\):\1":' \
             -e 's:$:" \\:' >>$configstatus
     fi
 done
 if [ $# -eq 0 ]; then
     $ECHO "./configure" >>$configstatus
 else
     $ECHO "./configure \\" >>$configstatus
     for arg
     do
         $ECHO "$arg" |\
         sed -e 's:\(["$\\]\):\\\1:g' \
             -e 's:^:":' \
             -e 's:$:" \\:' >>$configstatus
     done
 fi
 $ECHO '$*' >>$configstatus
 $ECHO '' >>$configstatus
 chmod a+x $configstatus
 
 ##
 ##  parse argument line options
 ##
 
 apc_prev=""
 OIFS1="$IFS" IFS="$DIFS"
 for apc_option
 do
     #   if previous option needs an argument, assign it.
     if [ ".$apc_prev" != . ]; then
         eval "$apc_prev=\$apc_option"
         apc_prev=""
         continue
     fi
     #   split out arguments
     case "$apc_option" in
         -*=*) apc_optarg=`$ECHO "$apc_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
            *) apc_optarg= ;;
     esac
 
     #  accept only the most important GNU Autoconf-style options
     case "$apc_option" in
         --quiet | --silent) 
             quiet=yes
             ;;
         --verbose | -v)
             verbose=yes
             ;;
         --shadow)
             #   determine GNU platform triple
             gnutriple=`$aux/GuessOS | $AWK '{ printf("%s",$1); }' | sed -e 
's:/:-:g'`
             #   create Makefile wrapper (the first time only)
             if [ ".`ls $top/src.* 2>/dev/null`" = . ]; then
                 if [ .$quiet = .no ]; then
                     $ECHO " + creating Makefile (shadow wrapper)"
                 fi
                 $ECHO "##" > Makefile
                 $ECHO "##  Apache Makefile (shadow wrapper)" >> Makefile
                 $ECHO "##" >> Makefile
                 $ECHO "" >> Makefile
                 $ECHO "GNUTRIPLE=\`$aux/GuessOS | sed -e 's:/:-:g' | $AWK '{ 
printf(\"%s\",\$\$1); }'\`" >> Makefile
                 $ECHO "" >> Makefile
                 $ECHO "all build install install-quiet clean distclean:" >> 
Makefile
                 $ECHO "        @\$(MAKE) -f Makefile.\$(GNUTRIPLE) \$(MFLAGS) 
\$@" >> Makefile
                 $ECHO "" >> Makefile
             fi
             #   set shadow paths
             shadowmkf="Makefile.$gnutriple"
             shadowsrc="src.$gnutriple"
             shadowaux="src.$gnutriple/helpers"
             shadowsedsubst="src.$gnutriple/.apaci.sedsubst"
             shadowaddconf="src.$gnutriple/.apaci.addconf"
             #   (re)create shadow tree
             if [ .$quiet = .no ]; then
                 $ECHO " + create shadow tree ($shadowsrc)"
             fi
             rm -rf $shadowsrc
             $aux/mkshadow.sh $src $shadowsrc
             #   delegate us to the shadow paths
             mkf=$shadowmkf
             src=$shadowsrc
             aux=$shadowaux
             sedsubst=$shadowsedsubst
             rm -f $addconf 2>/dev/null
             addconf=$shadowaddconf
             rm -f $addconf 2>/dev/null
             touch $addconf
             ;;
         --help | -h | -help )
             $ECHO "Usage: configure [options]"
             $ECHO "Options: [defaults in brackets after descriptions]"
             $ECHO "General options:"
             $ECHO " --quiet, --silent      do not print messages"
             $ECHO " --verbose, -v          print even more messages"
             $ECHO " --shadow               switch to a shadow tree for 
building"
             $ECHO ""
             $ECHO "Stand-alone options:"
             $ECHO " --help, -h             print this message"
             $ECHO " --layout               print installation layout (check 
and debug)"
             $ECHO ""
             $ECHO "Installation layout options:"
             $ECHO " --prefix=PREFIX        install architecture-independent 
files in PREFIX"
             $ECHO " --exec-prefix=EPREFIX  install architecture-dependent 
files in EPREFIX"
             $ECHO " --bindir=DIR           install user     executables in DIR 
 [EPREFIX/bin]"
             $ECHO " --sbindir=DIR          install sysadmin executables in DIR 
 [EPREFIX/sbin]"
             $ECHO " --libexecdir=DIR       install program  executables in DIR 
 [EPREFIX/libexec]"
             $ECHO " --mandir=DIR           install manual pages in DIR         
 [PREFIX/man]"
             $ECHO " --sysconfdir=DIR       install configuration files in DIR  
 [PREFIX/etc]"
             $ECHO " --datadir=DIR          install read-only  data files in 
DIR [PREFIX/share]"
             $ECHO " --includedir=DIR       install includes files in DIR       
 [PREFIX/include]"
             $ECHO " --localstatedir=DIR    install modifiable data files in 
DIR [PREFIX/var]"
             $ECHO " --runtimedir=DIR       install runtime data in DIR         
 [PREFIX/var/run]"
             $ECHO " --logfiledir=DIR       install logfile data in DIR         
 [PREFIX/var/log]"
             $ECHO " --proxycachedir=DIR    install proxy cache data in DIR     
 [PREFIX/var/proxy]"
             $ECHO " --compat               install with old Apache 1.2 
installation paths"
             $ECHO ""
             $ECHO "Configuration options:"
             $ECHO " --enable-rule=NAME     enable  a particular Rule named 
'NAME'"
             $ECHO " --disable-rule=NAME    disable a particular Rule named 
'NAME'"
             $aux/ppl.sh $rulelist
             $ECHO " --add-module=FILE      on-the-fly copy & activate a 
third-party Module source"
             $ECHO " --activate-module=FILE on-the-fly activate existing 
third-party Module source"
             $ECHO " --enable-module=NAME   enable  a particular Module named 
'NAME'"
             $ECHO " --disable-module=NAME  disable a particular Module named 
'NAME'"
             $aux/ppl.sh $modulelist
             $ECHO " --enable-shared=NAME   enable  build of Module named 
'NAME' as a shared object"
             $ECHO " --disable-shared=NAME  disable build of Module named 
'NAME' as a shared object"
             $ECHO " --with-perl=FILE       set the path to the optional Perl 
interpreter to use"
             $ECHO " --without-support      disable the build and installation 
of support tools"
             $ECHO " --without-confadjust   disable some build user/situation 
adjustments to config files"
             $ECHO ""
             $ECHO "suEXEC options:"
             $ECHO " --enable-suexec        enable the suEXEC feature"
             $ECHO " --suexec-caller=NAME   set the suEXEC username of the 
allowed caller [$suexec_caller]"
             $ECHO " --suexec-userdir=DIR   set the suEXEC user subdirectory 
[$suexec_userdir]"
             $ECHO " --suexec-uidmin=UID    set the suEXEC minimal allowed UID 
[$suexec_uidmin]"
             $ECHO " --suexec-gidmin=GID    set the suEXEC minimal allowed GID 
[$suexec_gidmin]"
             $ECHO " --suexec-safepath=PATH set the suEXEC safe PATH 
[$suexec_safepath]"
             $ECHO ""
             exit 0
             ;;
         --layout)
             layout=1
             ;;
         --prefix=*)
             prefix="$apc_optarg"
             ;;
         --exec-prefix=*)
             exec_prefix="$apc_optarg"
             ;;
         --bindir=*)       
             bindir="$apc_optarg"
             ;;
         --sbindir=*)       
             sbindir="$apc_optarg"
             ;;
         --libexecdir=*)
             libexecdir="$apc_optarg"    
             ;;
         --mandir=*)        
             mandir="$apc_optarg"        
             ;;
         --sysconfdir=*)    
             sysconfdir="$apc_optarg"    
             customized_sysconfdir=1
             ;;
         --datadir=*)       
             datadir="$apc_optarg"       
             customized_datadir=1
             ;;
         --includedir=*)       
             includedir="$apc_optarg"       
             customized_includedir=1
             ;;
         --localstatedir=*) 
             localstatedir="$apc_optarg" 
             customized_localstatedir=1
             ;;
         --runtimedir=*) 
             runtimedir="$apc_optarg" 
             ;;
         --logfiledir=*) 
             logfiledir="$apc_optarg" 
             ;;
         --proxycachedir=*) 
             proxycachedir="$apc_optarg" 
             ;;
         --compat) 
             exec_prefix='$prefix'
             bindir='$exec_prefix/bin'
             sbindir='$exec_prefix/bin'
             libexecdir='$exec_prefix/libexec'
             mandir='$prefix/man'
             sysconfdir='$prefix/conf'
             datadir='$prefix'
             includedir='$prefix/include'
             localstatedir='$prefix'
             runtimedir='$localstatedir/logs'
             logfiledir='$localstatedir/logs'
             proxycachedir='$localstatedir/proxy'
             customized_sysconfdir=1
             customized_datadir=1
             customized_localstatedir=1
             customized_includedir=1
             ;;
         --add-module=*) 
             file="$apc_optarg"
             if [ ".`$ECHO $file | egrep '/?mod_[a-zA-Z0-9][a-zA-Z0-9_]*\.c$'`" 
= . ]; then
                 $ECHO "configure:Error: Module filename doesn't match 
'/?mod_[a-zA-Z0-9][a-zA-Z0-9_]*\.c'" 1>&2
                 exit 1
             fi
             if [ ! -f $file ]; then
                 $ECHO "configure:Error: Module source $file not found" 1>&2
                 exit 1
             fi
             modfilec=`$ECHO $file | sed -e 's;^.*/;;'`
             modfileo=`$ECHO $file | sed -e 's;^.*/;;' -e 's;\.c$;.o;'`
             if [ ".$file" != ".$src/modules/extra/$modfilec" ]; then
                 cp $file $src/modules/extra/$modfilec
             fi
             $ECHO "" >>$addconf
             $ECHO "## On-the-fly added module" >>$addconf
             $ECHO "## (configure --add-module=$file)" >>$addconf
             $ECHO "AddModule modules/extra/$modfileo" >>$addconf
             module=`$ECHO "$modfileo" |\
                     sed -e 's%^.*/\(.*\)$%\1%' \
                         -e 's/\.[^.]*$//' \
                         -e 's/^mod_//' \
                         -e 's/^lib//'`
             eval "module_$module=yes"
             eval "shared_$module=no"
             modules="${modules}:$module"
             modulelist="${modulelist}:$module=yes"
             if [ ".$quiet" = .no ]; then
                 $ECHO " + on-the-fly added and activated $module module 
(modules/extra/$modfileo)"
             fi
             ;;
         --activate-module=*) 
             file="$apc_optarg"
             case $file in
                 src/modules/* ) ;;
                 *)  $ECHO "configure:Error: Module source already has to stay 
below src/modules/ to be activated" 1>&2
                     exit 1
                     ;;
             esac
             modfile=`$ECHO $file | sed -e 's;^src/;;'`
             $ECHO "" >>$addconf
             $ECHO "## On-the-fly activated module" >>$addconf
             $ECHO "## (configure --activate-module=$file)" >>$addconf
             $ECHO "AddModule $modfile" >>$addconf
             module=`$ECHO "$modfile" |\
                     sed -e 's%^.*/\(.*\)$%\1%' \
                         -e 's/\.[^.]*$//' \
                         -e 's/^mod_//' \
                         -e 's/^lib//'`
             eval "module_$module=yes"
             eval "shared_$module=no"
             modules="${modules}:$module"
             modulelist="${modulelist}:$module=yes"
             if [ ".$quiet" = .no ]; then
                 $ECHO " + activated $module module ($modfile)"
             fi
             ;;
         --enable-*)
             apc_feature=`$ECHO $apc_option | sed -e 's/-*enable-//' -e 
's/=.*//'`
             apc_feature=`$ECHO $apc_feature | sed 's/-/_/g'`
             case "$apc_option" in
                 *=*) ;;
                   *) apc_optarg=yes ;;
             esac
             case "$apc_feature" in
                 rule   )
                     apc_optarg=`$ECHO "$apc_optarg" | tr "A-Z" "a-z"`
                     apc_optarg_real=`$ECHO "$apc_optarg" | tr "a-z" "A-Z"`
                     eval "exists=\$rule_${apc_optarg}" 
                     if [ ".$exists" = . ]; then
                         $ECHO "configure:Error: No such rule named 
'${apc_optarg_real}'" 1>&2
                         exit 1
                     fi
                     eval "rule_${apc_optarg}=yes"
                     ;;
                 module ) 
                     case $apc_optarg in
                        all ) 
                            OIFS="$IFS" IFS=':'
                            for module in $modules; do
                                eval "module_${module}=yes" 
                            done
                            IFS="$OIFS"
                            ;;
                        most ) 
                            OIFS="$IFS" IFS=':'
                            for module in $modules; do
                                eval "module_${module}=yes" 
                            done
                            IFS="$OIFS"
                            module_auth_db=no     # not all platforms have -ldb
                            module_mmap_static=no # not all platforms have 
mmap()
                            module_so=no          # not all platforms have 
dlopen()
                            module_example=no     # only for developers
                            module_log_agent=no   # deprecated
                            module_log_referer=no # deprecated
                            ;;
                        * ) 
                            eval "exists=\$module_${apc_optarg}" 
                            if [ ".$exists" = . ]; then
                                $ECHO "configure:Error: No such module named 
'${apc_optarg}'" 1>&2
                                exit 1
                            fi
                            eval "module_${apc_optarg}=yes" 
                            ;;
                     esac
                     ;;
                 shared ) 
                     case $apc_optarg in
                        max ) 
                            OIFS="$IFS" IFS=':'
                            for module in $modules; do
                                eval "shared_${module}=yes" 
                            done
                            IFS="$OIFS"
                            shared_so=no        # because of bootstrapping
                            ;;
                        remain ) 
                            OIFS="$IFS" IFS=':'
                            for module in $modules; do
                                eval "add=\$module_${module}" 
                                if [ ".$add" = .no ]; then
                                    eval "module_${module}=yes" 
                                    eval "shared_${module}=yes" 
                                fi
                            done
                            IFS="$OIFS"
                            shared_so=no
                            ;;
                        * ) 
                            eval "exists=\$module_${apc_optarg}" 
                            if [ ".$exists" = . ]; then
                                $ECHO "configure:Error: No such module named 
'${apc_optarg}'" 1>&2
                                exit 1
                            fi
                            eval "shared_${apc_optarg}=yes" 
                            ;;
                     esac
                     ;;
                 suexec ) 
                     suexec=1
                     ;;
             esac
             ;;
         --disable-*)
             apc_feature=`$ECHO $apc_option | sed -e 's/-*disable-//' -e 
's/=.*//'`
             apc_feature=`$ECHO $apc_feature| sed 's/-/_/g'`
             case "$apc_option" in
                 *=*) ;;
                   *) apc_optarg=yes ;;
             esac
             case "$apc_feature" in
                 rule   ) 
                     apc_optarg=`$ECHO "$apc_optarg" | tr "A-Z" "a-z"`
                     apc_optarg_real=`$ECHO "$apc_optarg" | tr "a-z" "A-Z"`
                     eval "exists=\$rule_${apc_optarg}" 
                     if [ ".$exists" = . ]; then
                         $ECHO "configure:Error: No such rule named 
'${apc_optarg_real}'" 1>&2
                         exit 1
                     fi
                     eval "rule_${apc_optarg}=no"
                     ;;
                 module )
                     case $apc_optarg in
                        all ) 
                            OIFS="$IFS" IFS=':'
                            for module in $modules; do
                                eval "module_${module}=no" 
                            done
                            IFS="$OIFS"
                            ;;
                        * ) 
                            eval "exists=\$module_${apc_optarg}" 
                            if [ ".$exists" = . ]; then
                                $ECHO "configure:Error: No such module named 
'${apc_optarg}'" 1>&2
                                exit 1
                            fi
                            eval "module_${apc_optarg}=no" 
                            ;;
                     esac
                     ;;
                 shared )
                     case $apc_optarg in
                        all ) 
                            OIFS="$IFS" IFS=':'
                            for module in $modules; do
                                eval "shared_${module}=no" 
                            done
                            IFS="$OIFS"
                            ;;
                        * ) 
                            eval "exists=\$module_${apc_optarg}" 
                            if [ ".$exists" = . ]; then
                                $ECHO "configure:Error: No such module named 
'${apc_optarg}'" 1>&2
                                exit 1
                            fi
                            eval "shared_${apc_optarg}=no" 
                            ;;
                     esac
                     ;;
             esac
             ;;
         --with-perl=*)
             PERL="$apc_optarg"
             ;;
         --without-support)
             support=0
             ;;
         --without-confadjust)
             confadjust=0
             ;;
         --suexec-caller=*)
             suexec_caller="$apc_optarg"
             suexec_ok=1
             ;;
         --suexec-userdir=*)
             suexec_userdir="$apc_optarg"
             suexec_ok=1
             ;;
         --suexec-uidmin=*)
             suexec_uidmin="$apc_optarg"
             suexec_ok=1
             ;;
         --suexec-gidmin=*)
             suexec_gidmin="$apc_optarg"
             suexec_ok=1
             ;;
         --suexec-safepath=*)
             suexec_safepath="$apc_optarg"
             suexec_ok=1
             ;;
         * )
             $ECHO "configure:Error: invalid option '$apc_option'" 1>&2
             exit 1
             ;;
     esac
 done
 IFS="$OIFS1"
 if [ ".$apc_prev" != . ]; then
     $ECHO "configure:Error: missing argument to --`$ECHO $apc_prev | sed 
's/_/-/g'`" 1>&2
     exit 1
 fi
 
 ##
 ##  a few errors
 ##
 if [ ".$suexec" = .1 ]; then
     if [ ".$suexec_ok" = .0 ]; then
         $ECHO "configure:Error: You enabled the suEXEC feature via 
--enable-suexec but"
         $ECHO "                 without explicitly configuring it via at least 
one"
         $ECHO "                 --suexec-xxxxx option. Seems like you are 
still not"
         $ECHO "                 familiar with the suEXEC risks. Please read 
the INSTALL"
         $ECHO "                 and htdocs/manual/suexec.html documents first."
         exit 1
     fi
 fi
 
 ##
 ##  a few warnings
 ##
 if [ ".$suexec" = .1 ]; then
     if [ ".`id | grep root`" = . ]; then
         $ECHO " + Warning: You enabled the suEXEC feature. Be aware that you 
need" 1>&2
         $ECHO " + root privileges for this, at the latest at the installation 
step." 1>&2
     fi
 fi
 if [ ".$PERL" = .no-perl-on-this-system ]; then
     if [ .$quiet = .no ]; then
         $ECHO " + Warning: no Perl interpreter available for support scripts."
         $ECHO " + Perhaps you have to select one with --with-perl=FILE."
     fi
 fi
 
 ##
 ##  expand path variables and make sure
 ##  they do not end with a backslash
 ##
 OIFS="$IFS" IFS="$DIFS"
 for var in prefix exec_prefix bindir sbindir \
            libexecdir mandir sysconfdir datadir \
            includedir localstatedir runtimedir \
            logfiledir proxycachedir; do
     eval "val=\"\$$var\"";
     val=`$ECHO $val | sed -e 's:/*$::'`
     eval "$var=\"$val\""
     case $var in
        libexecdir|sysconfdir|datadir|localstatedir|includedir ) 
            eval "val=\$$var"
            case $val in
                *apache | *apache* ) ;;
                * ) eval "customized=\$customized_$var"
                    if [ ".$customized" = .0 ]; then
                        eval "$var=\"\$$var/apache\""
                    fi
                    ;;
            esac
            ;;
     esac
 done
 IFS="$OIFS"
 
 ##
 ##  determine special configurable Makefile targets
 ##
 if [ ".$support" = .1 ]; then
       build_support=build-support
     install_support=install-support
       clean_support=clean-support
   distclean_support=distclean-support
 else
       build_support=
     install_support=
       clean_support=
   distclean_support=
 fi
 
 ##
 ##  determine special configuration parameters
 ##
 conf_group="#-1"
 conf_port="80"
 conf_serveradmin="[EMAIL PROTECTED]"
 conf_servername="new.host.name"
 if [ ".$confadjust" = .1 ]; then
     if [ ".`egrep '^nobody:' /etc/group`" != . ]; then
         conf_group="nobody"
         if [ ".`egrep '^nogroup:' /etc/group`" != . ]; then
             conf_group="nogroup"
         fi
     fi
     if [ ".`id | grep root`" = . ]; then
         conf_port="8080"
     fi
     username="$LOGNAME"
     if [ ".$username" = . ]; then
         username="$USER"
         if [ ".$username" = . ]; then
             username="`whoami 2>/dev/null | sed -e 's/\n$//'`"
             if [ ".$username" = . ]; then
                 username="`who am i 2>/dev/null | cut '-d ' -f1`"
                 if [ ".$username" = . ]; then
                     username="unknown"
                 fi
             fi
         fi
     fi
     hostname="`uname -n | sed -e 's/\n$//'`"
     if [ ".$hostname" = . ]; then
         hostname="`hostname | sed -e 's/\n$//'`"
         if [ ".$hostname" = . ]; then
             hostname="hostname"
         fi
     fi
     hostname="`$ECHO $hostname | sed -e 's/\..*//'`"
     domainname="";
     if [ -f /etc/resolv.conf ]; then
         domainname="`egrep '^[         ]*domain' /etc/resolv.conf | head -1 |\
                      sed -e 's/.*domain//' -e 's/^[    ]*//' \
                          -e 's/^ *//' -e 's/^  *//' \
                          -e 's/^\.//' -e 's/^/./'`"
         if [ ".$domainname" = . ]; then
             domainname="`egrep '^[     ]*search' /etc/resolv.conf | head -1 |\
                          sed -e 's/.*search//' -e 's/^[        ]*//' \
                              -e 's/^ *//' -e 's/^      *//' \
                              -e 's/ .*//' -e 's/^\.//' -e 's/^/./'`"
         fi
     fi
     conf_serveradmin="[EMAIL PROTECTED]"
     conf_servername="$hostname$domainname"
 fi
  
 ##
 ##  determine prefix-relative paths for directories
 ##  because Apache supports them for the -d and -f 
 ##  options, the LoadModule directive, etc.
 ##
 ##  [we have to make sure that it ends with a slash
 ##   or we cannot support the case where the relative
 ##   path is just the emtpy one, i.e. ""]
 ##
 runtimedir_relative=`$ECHO $runtimedir | sed -e "s:^$prefix/*::" -e 
's:\(.\)$:\1/:'`
 logfiledir_relative=`$ECHO $logfiledir | sed -e "s:^$prefix/*::" -e 
's:\(.\)$:\1/:'`
 sysconfdir_relative=`$ECHO $sysconfdir | sed -e "s:^$prefix/*::" -e 
's:\(.\)$:\1/:'`
 libexecdir_relative=`$ECHO $libexecdir | sed -e "s:^$prefix/*::" -e 
's:\(.\)$:\1/:'`
 
 ##
 ##  check and debug
 ##
 if [ ".$layout" = .1 ]; then
     $ECHO ""
     $ECHO "Installation paths:"
     $ECHO "               prefix: $prefix"
     $ECHO "          exec_prefix: $exec_prefix" 
     $ECHO "               bindir: $bindir" 
     $ECHO "              sbindir: $sbindir" 
     $ECHO "           libexecdir: $libexecdir" 
     $ECHO "               mandir: $mandir" 
     $ECHO "           sysconfdir: $sysconfdir" 
     $ECHO "              datadir: $datadir" 
     $ECHO "           includedir: $includedir" 
     $ECHO "        localstatedir: $localstatedir" 
     $ECHO "           runtimedir: $runtimedir" 
     $ECHO "           logfiledir: $logfiledir" 
     $ECHO "        proxycachedir: $proxycachedir" 
     $ECHO ""
     $ECHO "Compilation paths:"
     $ECHO "           HTTPD_ROOT: $prefix"
     $ECHO "           SUEXEC_BIN: $sbindir/suexec"
     $ECHO "      SHARED_CORE_DIR: $libexecdir"
     $ECHO "       DEFAULT_PIDLOG: ${runtimedir_relative}httpd.pid"
     $ECHO "   DEFAULT_SCOREBOARD: ${runtimedir_relative}httpd.scoreboard"
     $ECHO "     DEFAULT_LOCKFILE: ${runtimedir_relative}httpd.lock"
     $ECHO "      DEFAULT_XFERLOG: ${logfiledir_relative}access_log"
     $ECHO "     DEFAULT_ERRORLOG: ${logfiledir_relative}error_log"
     $ECHO "    TYPES_CONFIG_FILE: ${sysconfdir_relative}mime.types"
     $ECHO "   SERVER_CONFIG_FILE: ${sysconfdir_relative}httpd.conf"
     $ECHO "   ACCESS_CONFIG_FILE: ${sysconfdir_relative}access.conf"
     $ECHO " RESOURCE_CONFIG_FILE: ${sysconfdir_relative}srm.conf"
     $ECHO ""
     exit 0
 fi
 
 ##
 ##  create Makefile from Makefile.tmpl
 ##
 if [ .$quiet = .no ]; then
     $ECHO "Creating $mkf"
 fi
 sed <Makefile.tmpl >$mkf \
 -e "[EMAIL PROTECTED]@%$PERL%g" \
 -e "[EMAIL PROTECTED]@%$top%g" \
 -e "[EMAIL PROTECTED]@%$src%g" \
 -e "[EMAIL PROTECTED]@%$mkf%g" \
 -e "[EMAIL PROTECTED]@%$aux%g" \
 -e "[EMAIL PROTECTED]@%$prefix%g" \
 -e "[EMAIL PROTECTED]@%$exec_prefix%g" \
 -e "[EMAIL PROTECTED]@%$bindir%g" \
 -e "[EMAIL PROTECTED]@%$sbindir%g" \
 -e "[EMAIL PROTECTED]@%$libexecdir%g" \
 -e "[EMAIL PROTECTED]@%$libexecdir_relative%g" \
 -e "[EMAIL PROTECTED]@%$mandir%g" \
 -e "[EMAIL PROTECTED]@%$sysconfdir%g" \
 -e "[EMAIL PROTECTED]@%$datadir%g" \
 -e "[EMAIL PROTECTED]@%$localstatedir%g" \
 -e "[EMAIL PROTECTED]@%$includedir%g" \
 -e "[EMAIL PROTECTED]@%$runtimedir%g" \
 -e "[EMAIL PROTECTED]@%$logfiledir%g" \
 -e "[EMAIL PROTECTED]@%$proxycachedir%g" \
 -e "[EMAIL PROTECTED]@%$suexec%g" \
 -e "[EMAIL PROTECTED]@%$suexec_caller%g" \
 -e "[EMAIL PROTECTED]@%$suexec_userdir%g" \
 -e "[EMAIL PROTECTED]@%$suexec_uidmin%g" \
 -e "[EMAIL PROTECTED]@%$suexec_gidmin%g" \
 -e "[EMAIL PROTECTED]@%$suexec_safepath%g" \
 -e "[EMAIL PROTECTED]@%$conf_group%g" \
 -e "[EMAIL PROTECTED]@%$conf_port%g" \
 -e "[EMAIL PROTECTED]@%$conf_serveradmin%g" \
 -e "[EMAIL PROTECTED]@%$conf_servername%g" \
 -e "[EMAIL PROTECTED]@%$build_support%g" \
 -e "[EMAIL PROTECTED]@%$install_support%g" \
 -e "[EMAIL PROTECTED]@%$clean_support%g" \
 -e "[EMAIL PROTECTED]@%$distclean_support%g"
 
 ##
 ##  override default paths in $src/include/httpd.h
 ##  via command line arguments for the compiler
 ##  supplied by a little shell script named $src/apaci
 ##
 $ECHO "#!/bin/sh" >$src/apaci
 $ECHO "## USED AS A COMMAND LINE EXPANDER TO OVERRIDE PATHS" >>$src/apaci
 $ECHO "## WITHOUT DISTURBING THE KNOWN MAKE BUILD PROCESS DISPLAY" >>$src/apaci
 $ECHO "$ECHO '-DHTTPD_ROOT=\"$prefix\"'" >>$src/apaci
 $ECHO "$ECHO '-DSUEXEC_BIN=\"$sbindir/suexec\"'" >>$src/apaci
 $ECHO "$ECHO '-DSHARED_CORE_DIR=\"$libexecdir\"'" >>$src/apaci
 $ECHO "$ECHO '-DDEFAULT_PIDLOG=\"${runtimedir_relative}httpd.pid\"'" 
>>$src/apaci
 $ECHO "$ECHO 
'-DDEFAULT_SCOREBOARD=\"${runtimedir_relative}httpd.scoreboard\"'" >>$src/apaci
 $ECHO "$ECHO '-DDEFAULT_LOCKFILE=\"${runtimedir_relative}httpd.lock\"'" 
>>$src/apaci
 $ECHO "$ECHO '-DDEFAULT_XFERLOG=\"${logfiledir_relative}access_log\"'" 
>>$src/apaci
 $ECHO "$ECHO '-DDEFAULT_ERRORLOG=\"${logfiledir_relative}error_log\"'" 
>>$src/apaci
 $ECHO "$ECHO '-DTYPES_CONFIG_FILE=\"${sysconfdir_relative}mime.types\"'" 
>>$src/apaci
 $ECHO "$ECHO '-DSERVER_CONFIG_FILE=\"${sysconfdir_relative}httpd.conf\"'" 
>>$src/apaci
 $ECHO "$ECHO '-DACCESS_CONFIG_FILE=\"${sysconfdir_relative}access.conf\"'" 
>>$src/apaci
 $ECHO "$ECHO '-DRESOURCE_CONFIG_FILE=\"${sysconfdir_relative}srm.conf\"'" 
>>$src/apaci
 chmod a+x $src/apaci
 CFLAGS="$CFLAGS \\\`\$(SRCDIR)/apaci\\\`"
 
 ##
 ##  create $src/Configuration.apaci file
 ##
 if [ .$quiet = .no ]; then
     $ECHO "Creating Configuration.apaci in $src"
 fi
 rm -f $sedsubst 2>/dev/null
 touch $sedsubst
 
 #   generate settings from imported environment variables
 OIFS="$IFS" IFS="$DIFS"
 for var in CC OPTIM CFLAGS CFLAGS_SHLIB LDFLAGS LD_SHLIB LDFLAGS_SHLIB \
            LDFLAGS_SHLIB_EXPORT LIBS INCLUDES RANLIB DEPS; do
     eval "val=\"\$$var\"";
     if [ ".$val" != . ]; then
         case $var in 
             CFLAGS|LDFLAGS|LIBS|INCLUDES|DEPS) 
                 $ECHO "s%^#*\\(EXTRA_$var=\\).*%\\1$val%g" >>$sedsubst
                 ;;
             *)
                 $ECHO "s%^#*\\($var=\\).*%\\1$val%g" >>$sedsubst
                 ;;
         esac
         eval "$var=\"\"; export $var"
     fi
 done
 IFS="$OIFS"
 
 #   generate rule directives 
 OIFS="$IFS" IFS=':'
 for rule in $rules; do
     name="`$ECHO $rule | tr "a-z" "A-Z"`"
     eval "val=\$rule_$rule"
     $ECHO "s%^\\(Rule $name=\\).*%\\1$val%g" >>$sedsubst
     if [ $verbose = yes ]; then
         $ECHO " + Rule $name=$val"
     fi
 done
 IFS="$OIFS"
 
 #   consistency checks for shared object support
 some_shares=0
 OIFS="$IFS" IFS=':'
 for module in $modules; do
     eval "share=\$shared_$module"
     if [ $share = yes ]; then
         some_shares=1
     fi
 done
 IFS="$OIFS"
 if [ $some_shares = 1 ]; then
     if [ $module_so = no ]; then
         module_so=yes
         if [ .$quiet = .no ]; then
             $ECHO " + enabling mod_so for DSO support"
         fi
     fi
 fi
 if [ ".$shared_so" = .yes ]; then
     shared_so=no
     $ECHO "configure:Error: Module mod_so cannot be made a DSO itself" 1>&2
     exit 1
 fi
 
 #   generate module directives
 OIFS="$IFS" IFS=':'
 for module in $modules; do
     eval "add=\$module_$module"
     if [ $add = yes ]; then
         $ECHO "s%^.*\\(AddModule.*$module\\..*\\)%\\1%g" >>$sedsubst
         $ECHO "s%^.*\\(SharedModule.*$module\\..*\\)%\\1%g" >>$sedsubst
         m="yes [static]"
     else
         $ECHO "s%^.*\\(AddModule.*$module\\..*\\)%# \\1%g" >>$sedsubst
         $ECHO "s%^.*\\(SharedModule.*$module\\..*\\)%# \\1%g" >>$sedsubst
         m=no
     fi
     eval "share=\$shared_$module"
     if [ $share = yes ]; then
         $ECHO 
"s%^\\(.*\\)AddModule\\(.*$module\\.\\)[oa]\\(.*\\)%\\1SharedModule\\2so\\3%g" 
>>$sedsubst
         m="yes [shared]"
     fi
     if [ $verbose = yes ]; then
         $ECHO " + Module $module: $m"
     fi
 done
 IFS="$OIFS"
 
 #   split sedsubst into chunks of 50 commands
 #   to workaround limits in braindead seds
 files=`$AWK <$sedsubst '
     BEGIN { line=0; cnt=0; }
     {
         if (line % 50 == 0) {
             file = sedsubst "." cnt;
             printf("%s\n", file);
             cnt++;
         }
         line++;
         print $0 >file;
     }
 ' "sedsubst=$sedsubst"`
 OIFS="$IFS" IFS="$DIFS"
 substcmd=""
 for file in $files; do
     substcmd="${substcmd} sed -f $file |"
 done
 substcmd="${substcmd} cat"
 IFS="$OIFS"
 
 #   and finally translate the config template 
 #   according to our defined configuration
 eval "cat $src/Configuration.tmpl $addconf | $substcmd 
>$src/Configuration.apaci"
 
 #   cleanup
 rm -f $sedsubst $sedsubst.[0-9] 2>/dev/null
 rm -f $addconf 2>/dev/null
 
 ##
 ##  create all other Makefiles by running the proprietary 
 ##  $src/Configure script with our custom Configuration.apaci file
 ##
 if [ .$quiet = .yes ]; then
     (cd $src; ./Configure -file Configuration.apaci >/dev/null);
 else
     (cd $src; ./Configure -file Configuration.apaci |\
      sed -e '/^Using config file:.*/d' \
          -e "s:Makefile in :Makefile in $src\\/:" \
          -e "s:Makefile\$:Makefile in $src:")
 fi
 

Reply via email to