jim 98/03/17 08:08:46
Modified: src Configure Added: src/helpers fp2rp mfhead Log: Submitted by: Jim Jagielski Move the fp2rp and mfhead functions from Configure into their own shell scripts in ./helpers... Grrrr... We've never allowed functions in shell scripts, so we'll need to do it this way. Revision Changes Path 1.212 +9 -31 apache-1.3/src/Configure Index: Configure =================================================================== RCS file: /export/home/cvs/apache-1.3/src/Configure,v retrieving revision 1.211 retrieving revision 1.212 diff -u -r1.211 -r1.212 --- Configure 1998/03/17 15:42:23 1.211 +++ Configure 1998/03/17 16:08:44 1.212 @@ -65,12 +65,14 @@ # Big cleanup of the generated Makefiles and remove of # some old kludges -# Uses 4 supplemental scripts located in ./helpers: +# Uses 6 supplemental scripts located in ./helpers: # CutRule: Determines the value for a specified Rule # GuessOS: Uses uname to determine OS/platform # PrintPath: generic "type" or "whence" replacement # TestCompile: Can check for libs and if $(CC) is ANSI # (i.e., a simple "sanity check") +# mfhead: +# fp2rp: exitcode=0 trap 'rm -f $tmpfile $tmpfile2 $tmpfile3 $tmpconfig $awkfile; exit $exitcode' 0 1 2 3 15 @@ -87,30 +89,6 @@ SUBDIRS='$(OSDIR) main ap modules' #################################################################### -## Some helper functions -## -fp2rp () { - if [ "x$1" = x. ]; then - rp="." - else - rp="" - for pe in `echo $1 | sed -e 's:/: :'`; do - rp="../$rp" - done - fi - echo $rp | sed -e 's:/$::' -} -mfhead () { - echo "##" - echo "## Apache Makefile, automatically generated by Configure script." - echo "## Hand-edited changes will be lost if the Configure script is re-run." - echo "## Sources: - `fp2rp $1`/Makefile.config (via $file)" - echo "## - ./Makefile.tmpl" - echo "##" - echo "" -} - -#################################################################### ## Now handle any arguments, which, for now, is -file ## to select an alternate Configuration file ## @@ -218,7 +196,7 @@ ## then fold in the modules that were included in Configuration ## echo "Creating Makefile" -mfhead . > Makefile +./helpers/mfhead . $file > Makefile #################################################################### ## Now we create a stub file, called Makefile.config, which @@ -1300,15 +1278,15 @@ MAKEDIRS="support main ap regex $OSDIR" for dir in $MAKEDIRS ; do echo Creating Makefile in $dir - mfhead $dir > $dir/Makefile + ./helpers/mfhead $dir $file > $dir/Makefile $CAT Makefile.config $dir/Makefile.tmpl |\ - sed -e "s:^SRCDIR=.*:SRCDIR=`fp2rp $dir`:" >> $dir/Makefile + sed -e "s:^SRCDIR=.*:SRCDIR=`./helpers/fp2rp $dir`:" >> $dir/Makefile done #################################################################### ## Now create the modules/Makefile ## -mfhead modules > modules/Makefile +./helpers/mfhead modules $file > modules/Makefile $CAT Makefile.config | sed -e 's:^SRCDIR=.*:SRCDIR=..:' >> modules/Makefile $CAT << EOF >> modules/Makefile @@ -1332,9 +1310,9 @@ for moddir in $AUTODIRS ; do echo "Creating Makefile in $moddir" - mfhead $moddir > $moddir/Makefile + ./helpers/mfhead $moddir $file > $moddir/Makefile $CAT Makefile.config |\ - sed -e "s:^SRCDIR=.*:SRCDIR=`fp2rp $moddir`:" >> $moddir/Makefile + sed -e "s:^SRCDIR=.*:SRCDIR=`./helpers/fp2rp $moddir`:" >> $moddir/Makefile $CAT << 'EOF' >> $moddir/Makefile ## ## Default Makefile options from Configure script 1.1 apache-1.3/src/helpers/fp2rp Index: fp2rp =================================================================== #!/bin/sh if [ "x$1" = x. ]; then rp="." else rp="" for pe in `echo $1 | sed -e 's:/: :'`; do rp="../$rp" done fi echo $rp | sed -e 's:/$::' 1.1 apache-1.3/src/helpers/mfhead Index: mfhead =================================================================== #!/bin/sh echo "##" echo "## Apache Makefile, automatically generated by Configure script." echo "## Hand-edited changes will be lost if the Configure script is re-run." echo "## Sources: - `./helpers/fp2rp $1`/Makefile.config (via $2)" echo "## - ./Makefile.tmpl" echo "##" echo ""