]> granicus.if.org Git - apache/commitdiff
Fix a problem in the new --enable-layout functionality where
authorAaron Bannert <aaron@apache.org>
Wed, 6 Mar 2002 18:48:22 +0000 (18:48 +0000)
committerAaron Bannert <aaron@apache.org>
Wed, 6 Mar 2002 18:48:22 +0000 (18:48 +0000)
it wouldn't allow overrides from variables like --prefix,
--bindir, etc.

Obtained from:  Partly from an autoconf-generated configure script.
Submitted by: Thom May <thom@planetarytramp.net>
Reviewed by: Aaron Bannert, Justin Erenkrantz

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93738 13f79535-47bb-0310-9956-ffa450edef68

acinclude.m4
configure.in

index c6f4e438b44791af835b481686f822cc38ad817a..25c903a3bd5ab235fb788fdc0b0e3792b8fd3fd9 100644 (file)
@@ -349,6 +349,24 @@ AC_DEFUN(APACHE_LAYOUT,[
   changequote([,])
 ])dnl
 
+dnl
+dnl APACHE_ENABLE_LAYOUT
+dnl
+AC_DEFUN(APACHE_ENABLE_LAYOUT,[
+AC_ARG_ENABLE(layout,
+[  --enable-layout=LAYOUT],[
+  LAYOUT=$enableval
+])
+
+if test -z "$LAYOUT"; then
+  LAYOUT="Apache"
+fi
+APACHE_LAYOUT($srcdir/config.layout, $LAYOUT)
+
+AC_MSG_CHECKING(for chosen layout)
+AC_MSG_RESULT($layout_name)
+])
+
 dnl
 dnl APACHE_ENABLE_MODULES
 dnl
@@ -497,3 +515,124 @@ if test "x$ap_ssltk_base" = "x"; then
 fi
 ])
 
+dnl
+dnl APACHE_PARSE_ARGUMENTS
+dnl a reimplementation of autoconf's argument parser,
+dnl used here to allow us to co-exist layouts and argument based
+dnl set ups.
+AC_DEFUN(APACHE_PARSE_ARGUMENTS,[
+ac_prev=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval "$ac_prev=\$ac_option"
+    ac_prev=
+    continue
+  fi
+
+  ac_optarg=`expr "x$ac_option" : 'x[[^=]]*=\(.*\)'`
+
+  case $ac_option in
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+  | --da=*)
+    datadir=$ac_optarg ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  esac
+done
+
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [[\\/$]]* | ?:[[\\/]]* | NONE | '' ) ;;
+    *)  AC_MSG_ERROR([expected an absolute path for --$ac_var: $ac_val]);;
+  esac
+done
+
+])dnl
index e670c00ab1f022d5fcc1ae970e7e1023005c4026..7091b6277013a5427bc1e9889d875ca5697eb530 100644 (file)
@@ -24,17 +24,10 @@ dnl Something seems broken here.
 AC_PREFIX_DEFAULT(/usr/local/apache2)
 
 dnl Get the layout here, so we can pass the required variables to apr
-dnl APACHE_ENABLE_LAYOUT
-AC_MSG_CHECKING(for chosen layout)
-AC_ARG_ENABLE(layout,
-APACHE_HELP_STRING(--enable-layout=LAYOUT,Default file layout),[
-  LAYOUT=$enableval
-  APACHE_LAYOUT($srcdir/config.layout, $LAYOUT)
-  AC_MSG_RESULT($LAYOUT)
-], [
-  APACHE_LAYOUT_DEFAULTS
-  AC_MSG_RESULT([Autoconf Defaults])
-])
+APACHE_ENABLE_LAYOUT
+
+dnl reparse the configure arguments.
+APACHE_PARSE_ARGUMENTS
 
 dnl Save user-defined environment settings for later restoration
 dnl