summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThom May <thommay@apache.org>2002-08-15 19:58:35 +0000
committerThom May <thommay@apache.org>2002-08-15 19:58:35 +0000
commit5d9c168875e7029dfaf52c8b184b1056ad2f84f2 (patch)
tree5123102198bd06f77fbb5db7fc064a31aab4684d
parentaeb5aed4a27dfae97e3586fbf94ac0fab02b3b59 (diff)
downloadapr-5d9c168875e7029dfaf52c8b184b1056ad2f84f2.tar.gz
configure.in
Add layout and argument parsing macros config.layout Create a skeleton set of layouts for APR build/apr_common.m4 APR_LAYOUT: New macro to parse layouts stored in config.layout APR_ENABLE_LAYOUT: New macro to enable layout parsing, takes one argument in configure, --enable-layout=<layout> APR_PARSE_ARGUMENTS: New macro to allow us to reparse location handling arguments after setting up a layout. Concept Obtained From: Justin, Greg git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63815 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--build/apr_common.m4193
-rw-r--r--config.layout213
-rw-r--r--configure.in5
3 files changed, 411 insertions, 0 deletions
diff --git a/build/apr_common.m4 b/build/apr_common.m4
index af072ff7c..244837347 100644
--- a/build/apr_common.m4
+++ b/build/apr_common.m4
@@ -653,3 +653,196 @@ dnl Note: this define must be on one line so that it can be properly returned
dnl as the help string. When using this macro with a multi-line RHS, ensure
dnl that you surround the macro invocation with []s
AC_DEFUN(APR_HELP_STRING,[ifelse(regexp(AC_ACVERSION, 2\.1), -1, AC_HELP_STRING([$1],[$2]),[ ][$1] substr([ ],len($1))[$2])])
+
+dnl
+dnl APR_LAYOUT(configlayout, layoutname)
+dnl
+AC_DEFUN(APR_LAYOUT,[
+ if test ! -f $srcdir/config.layout; then
+ echo "** Error: Layout file $srcdir/config.layout not found"
+ echo "** Error: Cannot use undefined layout '$LAYOUT'"
+ exit 1
+ fi
+ pldconf=./config.pld
+ changequote({,})
+ sed -e "1,/[ ]*<[lL]ayout[ ]*$2[ ]*>[ ]*/d" \
+ -e '/[ ]*<\/Layout>[ ]*/,$d' \
+ -e "s/^[ ]*//g" \
+ -e "s/:[ ]*/=\'/g" \
+ -e "s/[ ]*$/'/g" \
+ $1 > $pldconf
+ layout_name=$2
+ . $pldconf
+ rm $pldconf
+ for var in prefix exec_prefix bindir sbindir libexecdir mandir \
+ sysconfdir datadir \
+ includedir localstatedir runtimedir logfiledir libdir \
+ installbuilddir; do
+ eval "val=\"\$$var\""
+ case $val in
+ *+)
+ val=`echo $val | sed -e 's;\+$;;'`
+ eval "$var=\"\$val\""
+ autosuffix=yes
+ ;;
+ *)
+ autosuffix=no
+ ;;
+ esac
+ val=`echo $val | sed -e 's:\(.\)/*$:\1:'`
+ val=`echo $val | sed -e 's:[\$]\([a-z_]*\):${\1}:g'`
+ if test "$autosuffix" = "yes"; then
+ if echo $val | grep apache >/dev/null; then
+ addtarget=no
+ else
+ addtarget=yes
+ fi
+ if test "$addtarget" = "yes"; then
+ val="$val/apache2"
+ fi
+ fi
+ eval "$var='$val'"
+ done
+ changequote([,])
+])dnl
+
+dnl
+dnl APR_ENABLE_LAYOUT
+dnl
+AC_DEFUN(APR_ENABLE_LAYOUT,[
+AC_ARG_ENABLE(layout,
+[ --enable-layout=LAYOUT],[
+ LAYOUT=$enableval
+])
+
+if test -z "$LAYOUT"; then
+ LAYOUT="Apache"
+fi
+APR_LAYOUT($srcdir/config.layout, $LAYOUT)
+
+AC_MSG_CHECKING(for chosen layout)
+AC_MSG_RESULT($layout_name)
+])
+
+
+dnl
+dnl APR_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(APR_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
diff --git a/config.layout b/config.layout
new file mode 100644
index 000000000..245da94eb
--- /dev/null
+++ b/config.layout
@@ -0,0 +1,213 @@
+##
+## config.layout -- Pre-defined Installation Path Layouts
+##
+## Hints:
+## - layouts can be loaded with configure's --enable-layout=ID option
+## - when no --enable-layout option is given, the default layout is `apr'
+## - a trailing plus character (`+') on paths is replaced with a
+## `/<target>' suffix where <target> is currently hardcoded to 'apr'.
+## (This may become a configurable parameter at some point.)
+##
+
+# Classical apr path layout.
+<Layout apr>
+ prefix: /usr/local/apr
+ exec_prefix: ${prefix}
+ bindir: ${exec_prefix}/bin
+ sbindir: ${exec_prefix}/bin
+ libdir: ${exec_prefix}/lib
+ libexecdir: ${exec_prefix}/modules
+ mandir: ${prefix}/man
+ sysconfdir: ${prefix}/conf
+ datadir: ${prefix}
+ installbuilddir: ${datadir}/build
+ includedir: ${prefix}/include
+ localstatedir: ${prefix}
+</Layout>
+
+# GNU standards conforming path layout.
+# See FSF's GNU project `make-stds' document for details.
+<Layout GNU>
+ prefix: /usr/local
+ exec_prefix: ${prefix}
+ bindir: ${exec_prefix}/bin
+ sbindir: ${exec_prefix}/sbin
+ libdir: ${exec_prefix}/lib
+ libexecdir: ${exec_prefix}/libexec
+ mandir: ${prefix}/man
+ sysconfdir: ${prefix}/etc+
+ datadir: ${prefix}/share+
+ installbuilddir: ${datadir}/build
+ includedir: ${prefix}/include+
+ localstatedir: ${prefix}/var+
+ runtimedir: ${localstatedir}/run
+</Layout>
+
+# Mac OS X Server (Rhapsody)
+<Layout Mac OS X Server>
+ prefix: /Local/Library/WebServer
+ exec_prefix: /usr
+ bindir: ${exec_prefix}/bin
+ sbindir: ${exec_prefix}/sbin
+ libdir: ${exec_prefix}/lib
+ libexecdir: /System/Library/apr/Modules
+ mandir: ${exec_prefix}/share/man
+ sysconfdir: ${prefix}/Configuration
+ datadir: ${prefix}
+ installbuilddir: /System/Library/apr/Build
+ includedir: /System/Library/Frameworks/apr.framework/Versions/2.0/Headers
+ localstatedir: /var
+ runtimedir: ${prefix}/Logs
+</Layout>
+
+# Darwin/Mac OS Layout
+<Layout Darwin>
+ prefix: /usr
+ exec_prefix: ${prefix}
+ bindir: ${exec_prefix}/bin
+ sbindir: ${exec_prefix}/sbin
+ libdir: ${exec_prefix}/lib
+ libexecdir: ${exec_prefix}/libexec+
+ mandir: ${prefix}/share/man
+ datadir: /Library/WebServer
+ sysconfdir: /etc+
+ installbuilddir: ${prefix}/share/httpd/build
+ includedir: ${prefix}/include+
+ localstatedir: /var
+ runtimedir: ${localstatedir}/run
+</Layout>
+
+# Red Hat Linux 7.x layout
+<Layout RedHat>
+ prefix: /usr
+ exec_prefix: ${prefix}
+ bindir: ${prefix}/bin
+ sbindir: ${prefix}/sbin
+ libdir: ${prefix}/lib
+ libexecdir: ${prefix}/lib/apr
+ mandir: ${prefix}/man
+ sysconfdir: /etc/httpd/conf
+ datadir: /var/www
+ installbuilddir: ${datadir}/build
+ includedir: ${prefix}/include/apr
+ localstatedir: /var
+ runtimedir: ${localstatedir}/run
+</Layout>
+
+# According to the /opt filesystem conventions
+<Layout opt>
+ prefix: /opt/apr
+ exec_prefix: ${prefix}
+ bindir: ${exec_prefix}/bin
+ sbindir: ${exec_prefix}/sbin
+ libdir: ${exec_prefix}/lib
+ libexecdir: ${exec_prefix}/libexec
+ mandir: ${prefix}/man
+ sysconfdir: /etc${prefix}
+ datadir: ${prefix}/share
+ installbuilddir: ${datadir}/build
+ includedir: ${prefix}/include
+ localstatedir: /var${prefix}
+ runtimedir: ${localstatedir}/run
+</Layout>
+
+# BeOS layout...
+<Layout beos>
+ prefix: /boot/home/apr
+ exec_prefix: ${prefix}
+ bindir: ${exec_prefix}/bin
+ sbindir: ${exec_prefix}/bin
+ libdir: ${exec_prefix}/lib
+ libexecdir: ${exec_prefix}/libexec
+ mandir: ${prefix}/man
+ sysconfdir: ${prefix}/conf
+ datadir: ${prefix}
+ installbuilddir: ${datadir}/build
+ includedir: ${prefix}/include
+ localstatedir: ${prefix}
+ runtimedir: ${localstatedir}/logs
+</Layout>
+
+# SuSE 6.x layout
+<Layout SuSE>
+ prefix: /usr
+ exec_prefix: ${prefix}
+ bindir: ${prefix}/bin
+ sbindir: ${prefix}/sbin
+ libdir: ${prefix}/lib
+ libexecdir: ${prefix}/lib/apr
+ mandir: ${prefix}/share/man
+ sysconfdir: /etc/httpd
+ datadir: /usr/local/httpd
+ installbuilddir: ${datadir}/build
+ includedir: ${prefix}/include/apr
+ localstatedir: /var/lib/httpd
+ runtimedir: /var/run
+</Layout>
+
+# BSD/OS layout
+<Layout BSDI>
+ prefix: /var/www
+ exec_prefix: /usr/contrib
+ bindir: ${exec_prefix}/bin
+ sbindir: ${exec_prefix}/bin
+ libdir: ${exec_prefix}/lib
+ libexecdir: ${exec_prefix}/libexec/apr
+ mandir: ${exec_prefix}/man
+ sysconfdir: ${prefix}/conf
+ datadir: ${prefix}
+ installbuilddir: ${datadir}/build
+ includedir: ${exec_prefix}/include/apr
+ localstatedir: /var
+ runtimedir: ${localstatedir}/run
+</Layout>
+
+# Solaris 8 Layout
+<Layout Solaris>
+ prefix: /usr/apr
+ exec_prefix: ${prefix}
+ bindir: ${exec_prefix}/bin
+ sbindir: ${exec_prefix}/bin
+ libdir: ${exec_prefix}/lib
+ libexecdir: ${exec_prefix}/libexec
+ mandir: ${exec_prefix}/man
+ sysconfdir: /etc/apr
+ datadir: /var/apr
+ installbuilddir: ${datadir}/build
+ includedir: ${exec_prefix}/include
+ localstatedir: ${prefix}
+ runtimedir: /var/run
+</Layout>
+
+# OpenBSD Layout
+<Layout OpenBSD>
+ prefix: /var/www
+ exec_prefix: /usr
+ bindir: ${exec_prefix}/bin
+ sbindir: ${exec_prefix}/sbin
+ libdir: ${exec_prefix}/lib
+ libexecdir: ${exec_prefix}/lib/apr/modules
+ mandir: ${exec_prefix}/share/man
+ sysconfdir: ${prefix}/conf
+ datadir: ${prefix}
+ installbuilddir: ${prefix}/build
+ includedir: ${exec_prefix}/lib/apr/include
+ localstatedir: ${prefix}
+ runtimedir: ${prefix}/logs
+</Layout>
+
+# Debian layout
+<Layout Debian>
+ prefix:
+ exec_prefix: ${prefix}/usr
+ bindir: ${exec_prefix}/bin
+ sbindir: ${exec_prefix}/sbin
+ libdir: ${exec_prefix}/lib
+ libexecdir: ${exec_prefix}/lib/apr/modules
+ mandir: ${exec_prefix}/share/man
+ datadir: ${exec_prefix}/share/apr
+ includedir: ${exec_prefix}/include/apr
+ localstatedir: ${prefix}/var/run
+ runtimedir: ${prefix}/var/run
+ infodir: ${exec_prefix}/share/info
+</Layout>
diff --git a/configure.in b/configure.in
index 71985e667..ecd039541 100644
--- a/configure.in
+++ b/configure.in
@@ -36,6 +36,11 @@ echo "Platform: $host"
dnl # Some initial steps for configuration. We setup the default directory
dnl # and which files are to be configured.
+dnl # First, we need to enable the layout handling code, then reparse the
+dnl # prefix-style arguments due to autoconf being a PITA.
+APR_ENABLE_LAYOUT
+APR_PARSE_ARGUMENTS
+
dnl Set optional CC hints here in case autoconf makes an inappropriate choice.
dnl This allows us to suggest what the compiler should be, but still
dnl allows the user to override CC externally.