[shibboleth-sp2] 17/119: Find an apache and apxs if none specified.

Ferenc Wágner wferi-guest at moszumanska.debian.org
Tue Jan 26 21:29:45 UTC 2016


This is an automated email from the git hooks/post-receive script.

wferi-guest pushed a commit to annotated tag 1.3.1
in repository shibboleth-sp2.

commit c9ab98794c6910251e0bb7ace3a948f52cc693af
Author: Jim Fox <fox at washington.edu>
Date:   Mon Apr 2 18:56:16 2007 +0000

    Find an apache and apxs if none specified.
---
 configure.ac | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 59 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 302951a..2b56600 100644
--- a/configure.ac
+++ b/configure.ac
@@ -295,6 +295,63 @@ if test ! "$WANT_NSAPI" = "no" ; then
 fi
 
 
+#
+# If no --enable-apache-xx specified 
+# find a default and fake the specific parameters
+#
+
+# simple macro to peek at an enable or a with
+AC_DEFUN([Peek],
+if test "[${[$1]_][$2]+set}" = set; then
+  peekval="${[$1]_[$2]}"
+  $3
+fi; dnl
+)
+
+AC_MSG_CHECKING(if default apache needed)
+need_default=yes
+Peek(enable,apache_13,need_default=no)
+Peek(enable,apache_20,need_default=no)
+Peek(enable,apache_22,need_default=no)
+AC_MSG_RESULT($need_default)
+
+if test "$need_default" = "yes"; then
+  # find an apxs, then the httpd
+  xs=
+  Peek(with,apxs,xs="$peekval")
+  Peek(with,apxs2,xs="$peekval")
+  Peek(with,apxs22,xs="$peekval")
+  if test "x$xs" = "x"; then
+     AC_PATH_PROGS(xs, apxs2 apxs,
+        AC_MSG_ERROR(No apxs, no apache found.  Try --with-apxs),
+        [/usr/local/apache2/bin:/usr/local/apache/bin:/usr/sbin:$PATH])
+  fi
+  # ask the daemon for the version and set parameters
+  AC_MSG_CHECKING(default apache version)
+  httpd="`$xs -q SBINDIR`/`$xs -q TARGET`"
+  if test "x$httpd" != "x"; then
+     v=`$httpd -v|$SED -n -e 's/.*Apache\/\.*//p'`
+     case $v in
+       1.3*)   [enable_apache_13]=yes
+               [with_apxs]=$xs
+               AC_MSG_RESULT(1.3)
+               ;;
+       2.0*)   [enable_apache_20]=yes
+               [with_apxs2]=$xs
+               AC_MSG_RESULT(2.0)
+               ;;
+       2.2*)   [enable_apache_22]=yes
+               [with_apxs22]=$xs
+               AC_MSG_RESULT(2.2)
+               ;;
+       *)      AC_MSG_ERROR(unusable apache versions: $v. Try setting --with-apxs)
+     esac
+  else 
+     AC_MSG_RESULT(cannot determine version.  Try setting --with-apxs)
+  fi
+fi
+
+
 # Apache 1.3 (mod_shib_13)
 #   --enable-apache-13
 #   --with-apxs      (DSO build, the normal way, uses apxs to derive build flags)
@@ -427,7 +484,7 @@ if test "$WANT_APACHE_20" = "yes" ; then
         fi
         ],
         [
-        AC_PATH_PROG(APR_CONFIG, apr-config)
+        AC_PATH_PROG(APR_CONFIG, apr-config,,[`$APXS2 -q SBINDIR`]:[$PATH])
         ])
 	if test -f "${APR_CONFIG}"; then
         APR_CFLAGS="`${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags` `${APR_CONFIG} --includes`"
@@ -518,7 +575,7 @@ if test "$WANT_APACHE_22" = "yes" ; then
         fi
         ],
         [
-        AC_PATH_PROG(APR1_CONFIG, apr-1-config)
+        AC_PATH_PROG(APR1_CONFIG, apr-1-config,,[`$APXS22 -q SBINDIR`]:[$PATH])
         ])
 	if test -f "${APR1_CONFIG}"; then
         APR1_CFLAGS="`${APR1_CONFIG} --cflags` `${APR1_CONFIG} --cppflags` `${APR1_CONFIG} --includes`"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-shibboleth/shibboleth-sp2.git



More information about the Pkg-shibboleth-devel mailing list