httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralf S. Engelschall" <...@engelschall.com>
Subject [PATCH] Configuration (3/4): APACI Makefile for src/Configure
Date Tue, 01 Dec 1998 13:06:48 GMT

Configuration (3/4): APACI Makefile for src/Configure [config-makefile]
-----------------------------------------------------------------------

This patch is an alternative solution for Randys idea to provide a top-level
APACI Makefile although src/Configure is called. Because this way although
people use src/Configure they can use the sophisticated APACI installation
procedure. The patch tries to provide the same as Randys patch but does it
totally different. Instead of merging code between APACI's configure script
and the src/Configure script (which is against the APACI implementation goals)
it uses a wrapper:

  o APACI's configure script is enhanced to allow a --with-template=FILE
    option. The default for FILE is src/Configuration.tmpl. 

  o the src/Configure script is renamed to src/Setup (don't know whether this
    is a good name, it's not important) and APACI's configure script now calls
    src/Setup instead of src/Configure.

  o a new wrapper script src/Configure is created which provides
    again the -file FILE option. FILE here defaults to Configuration.  It does
    nothing more than running APACI's configure script with this file by using
    --with-template.

The effect is that the same source tree configuration is done, but with APACI
involved. This way a top-level Makefile is created, too. It can be used to
install the package. For this the src/Makefile provides an install target now,
too.

This patch can be optimized and polished even more when we should decide that
it's the correct way. For instance we can get rid of the `apaci` in CFLAGS
(only needed for real APACI runs where more flexibility has to be implemented)
and we can avoid the Configuration -> Configuration.apaci step (i.e.
Configuration is used directly). But I don't want to polish it even more
because it's not clear whether we like this approach or want to use Randys
code merging approach.
                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com
Index: configure
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/configure,v
retrieving revision 1.50
diff -u -r1.50 configure
--- configure	1998/11/08 21:24:01	1.50
+++ configure	1998/12/01 12:51:40
@@ -76,6 +76,7 @@
 sedsubst=src/.apaci.sedsubst
 addconf=src/.apaci.addconf
 tplconf=src/.apaci.tplconf
+template=src/Configuration.tmpl
 configstatus=config.status
 
 ##
@@ -214,7 +215,7 @@
 rulelist=""
 OIFS="$IFS" IFS='
 '
-for rule in `grep '^Rule' $src/Configuration.tmpl`; do
+for rule in `grep '^Rule' $template`; do
     rule=`echo "$rule" | sed -e 's/^Rule[ ]*//'`
     name=`echo "$rule" | sed -e 's/=.*$//'`
     namelow=`echo "$name" | tr "A-Z" "a-z"`
@@ -233,7 +234,7 @@
 modulelist=""
 OIFS="$IFS" IFS='
 '
-for module in `egrep '^[# ]*(Add|Shared)Module' $src/Configuration.tmpl`; do
+for module in `egrep '^[# ]*(Add|Shared)Module' $template`; do
     add=yes
     share=no
     if [ ".`echo $module | grep '^#'`" != . ]; then
@@ -364,6 +365,7 @@
             shadowsedsubst="src.$gnutriple/.apaci.sedsubst"
             shadowaddconf="src.$gnutriple/.apaci.addconf"
             shadowtplconf="src.$gnutriple/.apaci.tplconf"
+            shadowtemplate="src.$gnutriple/Configuration.tmpl"
             #   (re)create shadow tree
             if [ .$quiet = .no ]; then
                 echo " + create shadow tree ($shadowsrc)"
@@ -380,6 +382,7 @@
             rm -f $addconf 2>/dev/null
             touch $addconf
             tplconf=$shadowtplconf
+            template=$shadowtemplate
             ;;
         --help | -h | -help )
             echo "Usage: configure [options]"
@@ -424,6 +427,7 @@
             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 " --with-template=FILE   use the configuration template FILE"
             echo ""
             echo "suEXEC options:"
             echo " --enable-suexec        enable the suEXEC feature"
@@ -736,6 +740,9 @@
         --without-confadjust)
             confadjust=0
             ;;
+        --with-template=*)
+            template="$apc_optarg"
+            ;;
         --suexec-caller=*)
             suexec_caller="$apc_optarg"
             suexec_ok=1
@@ -1190,12 +1197,12 @@
 
 ##
 ##  create all other Makefiles by running the proprietary 
-##  $src/Configure script with our custom Configuration.apaci file
+##  $src/Setup script with our custom Configuration.apaci file
 ##
 if [ .$quiet = .yes ]; then
-    (cd $src; ./Configure -file Configuration.apaci >/dev/null);
+    (cd $src; ./Setup -file Configuration.apaci >/dev/null);
 else
-    (cd $src; ./Configure -file Configuration.apaci |\
+    (cd $src; ./Setup -file Configuration.apaci |\
      sed -e '/^Using config file:.*/d' \
          -e "s:Makefile in :Makefile in $src\\/:" \
          -e "s:Makefile\$:Makefile in $src:")
Index: src/Makefile.tmpl
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/Makefile.tmpl,v
retrieving revision 1.106
diff -u -r1.106 Makefile.tmpl
--- src/Makefile.tmpl	1998/09/17 14:43:21	1.106
+++ src/Makefile.tmpl	1998/12/01 13:03:15
@@ -88,8 +88,7 @@
 	-rm -f Makefile
 
 install:
-	@echo "++ Sorry, no installation procedure available at this level."
-	@echo "++ Go to the parent directory for an 'install' target."
+	cd ..; $(MAKE) $(MFLAGS_STATIC) install
 
 # We really don't expect end users to use this rule.  It works only with
 # gcc, and rebuilds Makefile.tmpl.  You have to re-run Configure after

Index: src/Setup
===================================================================
<contents of old src/Configure>

Index: src/Configure
===================================================================
#!/bin/sh
##
##  src/Configure -- APACI frontend for src/ location
##

#
#   check from where we are called
#
if [ ! -f "Setup" ]; then
    echo "Configure:Error: Called from wrong directory."
    echo "Configure:Hint:  Run $0 from the src/ directory."
    exit 1
fi

#
#   handle -file option
#
file=Configuration
while [ "x$1" != "x" ]; do
    if [ "x$1" = "x-file" ] ; then
        shift 1; file=$1; shift 1
        if [ ! -r $file ]; then
            echo "Configure:Error: $file does not exist or is not readable."
            exit 1
        fi
    else
        echo "Configure:Error: Bad command line option '$1'"
        echo "Configure:Hint:  Please read the file INSTALL."
        exit 1
    fi
done
if [ ! -r $file ]; then
    echo "Configure:Error: Can't see or read \"$file\""
    echo "Configure:Hint:  Please copy Configuration.tmpl to $file and edit it."
    echo "Configure:Hint:  Then re-run $0 again."
    exit 1
fi

#
#  determine path for $file from APACI's point of view
#
case $file in
   /* ) ;;
    * ) file="src/$file" ;;
esac

#
#  run APACI
#
cd .. 
./configure \
    --with-layout=Apache \
    --with-template=$file


Mime
View raw message