Author: rmeggins
Update of /cvs/dirsec/adminserver/m4
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv1096/adminserver/m4
Modified Files:
httpd.m4 mod_nss.m4
Added Files:
fortitude.m4
Log Message:
Resolves: bug 245214
Bug Description: adminserver: Solaris port for 1.1
Reviewed by: nhosoi (Thanks!)
Fix Description: Fortitude can supply different components, depending on the operating
system. On Fedora, mod_nss and Apache are already there, so we don't use Fortitude.
On RHEL4, we use Fortitude for mod_nss.
On Solaris, we use Fortitude for Apache and mod_nss.
I've created a fortitude.m4 that can handle all of these cases, and changed the
existing httpd.m4 and mod_nss.m4 to first see if fortitude.m4 has found the component.
configure will also pass the proper --with flags to mod_admserv and mod_restartd.
ICU introduces a dependency on C++. Solaris requires linking with the C++ libraries and
that also requires using C++ to link as well. This means using the CXXLINK macro.
There were a few other minor porting issues which required the additional compiler defines
and use of config.h.
We need to set the libpath before using the @cgibindir@/config program.
LIBPATH was not being set correctly on Solaris because I was using the extended sort flags
instead of the standard ones.
Platforms tested: Solaris 9 64bit
Flag Day: no
Doc impact: no
--- NEW FILE fortitude.m4 ---
# BEGIN COPYRIGHT BLOCK
# Copyright (C) 2007 Red Hat, Inc.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# END COPYRIGHT BLOCK
# check for --with-fortitude
default_fortitudedir=/opt/fortitude
AC_MSG_CHECKING(for --with-fortitude)
AC_ARG_WITH(fortitude,
AS_HELP_STRING([--with-fortitude=PATH],
[Fortitude root directory (default: $default_fortitudedir)]),
[
if test -d "$withval"
then
AC_MSG_RESULT([using $withval])
fortitudedir="$withval"
elif test "$withval" = "yes" -a -d $default_fortitudedir ; then
AC_MSG_RESULT([using $default_fortitudedir])
fortitudedir="$default_fortitudedir"
else
echo
AC_MSG_ERROR([$withval not found])
fi
],
AC_MSG_RESULT(no))
if test -n "$fortitudedir" ; then
# see if there is a mod_nss in fortitude
modnsslist=`ls $fortitudedir/modules.local/libmodnss.* 2> /dev/null`
if test -n "$modnsslist" ; then
nssmoddir="$fortitudedir/modules.local"
fi
# see if there is a nss_pcache
if test -x "$fortitudedir/bin/nss_pcache" ; then
modnssbindir="$fortitudedir/bin"
fi
# see if fortitude supplies apache
if test -x "$fortitudedir/sbin/httpd.worker" ; then
HTTPD="$fortitudedir/sbin/httpd.worker"
fi
# see if fortitude supplies apache modules
if test -d "$fortitudedir/modules" ; then
moddir="$fortitudedir/modules"
fi
# see if fortitude supplies apxs
if test -x "$fortitudedir/sbin/apxs" ; then
APXS="$fortitudedir/sbin/apxs"
fi
# see if fortitude supplies apr-config
if test -x "$fortitudedir/bin/apr-config" ; then
APR_CONFIG="$fortitudedir/bin/apr-config"
fi
fi
Index: httpd.m4
===================================================================
RCS file: /cvs/dirsec/adminserver/m4/httpd.m4,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- httpd.m4 21 May 2007 15:52:27 -0000 1.3
+++ httpd.m4 22 Jun 2007 01:34:20 -0000 1.4
@@ -18,13 +18,31 @@
#
# END COPYRIGHT BLOCK
-AC_PATH_PROG([HTTPD], [httpd.worker], [],
-
[$PATH:/opt/hpws/apache/bin:/usr/local/apache/sbin:/usr/local/apache2/sbin:/usr/sbin])
-if test -z "$HTTPD" -o ! -x "$HTTPD" ; then
- AC_PATH_PROG([HTTPD], [httpd], [],
-
[$PATH:/opt/hpws/apache/bin:/usr/local/apache/sbin:/usr/local/apache2/sbin:/usr/sbin])
+AC_MSG_CHECKING(for --with-httpd)
+AC_ARG_WITH(httpd,
+ AS_HELP_STRING([--with-httpd=PATH],
+ [Full path of Apache binary. Configure will usually find the
right one, but if it does not, use this to specify the correct binary.]),
+[
+ if test -x "$withval"
+ then
+ AC_MSG_RESULT([using $withval])
+ HTTPD="$withval"
+ else
+ echo
+ AC_MSG_ERROR([$withval not found])
+ fi
+],
+AC_MSG_RESULT(no))
+
+if test -z "$HTTPD" ; then
+ AC_PATH_PROG([HTTPD], [httpd.worker], [],
+
[$PATH:/opt/hpws/apache/bin:/usr/local/apache/sbin:/usr/local/apache2/sbin:/usr/sbin])
+ if test -z "$HTTPD" -o ! -x "$HTTPD" ; then
+ AC_PATH_PROG([HTTPD], [httpd], [],
+
[$PATH:/opt/hpws/apache/bin:/usr/local/apache/sbin:/usr/local/apache2/sbin:/usr/sbin])
+ fi
if test -z "$HTTPD" -o ! -x "$HTTPD" ; then
- AC_MSG_ERROR([Apache2 httpd server not found])
+ AC_MSG_ERROR([Apache2 httpd server not found])
fi
fi
@@ -48,12 +66,75 @@
mimemagic=${httpd_root}/${mimemagic}
fi
-AC_PATH_PROG([APXS], [apxs], [],
-
[$PATH:/opt/hpws/apache/bin:/usr/local/apache/sbin:/usr/local/apache2/sbin:/usr/sbin])
-if test -n "$APXS" -a -x "$APXS" ; then
- moddir=`$APXS -q LIBEXECDIR`
+# check for --with-apxs
+AC_MSG_CHECKING(for --with-apxs)
+AC_ARG_WITH(apxs,
+ AS_HELP_STRING([--with-apxs=PATH],
+ [Path to apxs]),
+[
+ if test -x "$withval"
+ then
+ AC_MSG_RESULT([using $withval])
+ APXS=$withval
+ else
+ echo
+ AC_MSG_ERROR([$withval not found or not executable])
+ fi
+],
+AC_MSG_RESULT(no))
+
+if test -z "$APXS" ; then
+ # first look for APXS in same dir as HTTPD
+ apachedir=`dirname $HTTPD`
+ if test -x "$apachedir/apxs" ; then
+ APXS="$apachedir/apxs"
+ else
+ AC_PATH_PROG([APXS], [apxs], [],
+
[$PATH:/opt/hpws/apache/bin:/usr/local/apache/sbin:/usr/local/apache2/sbin:/usr/sbin])
+ fi
+ if test -z "$APXS" ; then
+ AC_MSG_ERROR([Apache2 apxs program not found])
+ fi
+fi
+
+AC_CHECKING(for apr-config)
+# check for --with-apr-config
+AC_MSG_CHECKING(for --with-apr-config)
+AC_ARG_WITH(apr-config,
+ AS_HELP_STRING([--with-apr-config],
+ [Use apr-config to determine the APR directory]),
+[
+ if test -x "$withval"
+ then
+ AC_MSG_RESULT([using $withval])
+ APR_CONFIG=$withval
+ fi
+],
+AC_MSG_RESULT(no))
+
+if test -z "$APR_CONFIG" ; then
+ # first look for APR_CONFIG in the bin dir if HTTPD is in the sbin dir
+ apachedir=`dirname $HTTPD`
+ parentdir=`dirname $apachedir`
+ if test -x "$parentdir/bin/apr-1-config" ; then
+ APR_CONFIG="$parentdir/bin/apr-1-config"
+ elif test -x "$parentdir/bin/apr-config" ; then
+ APR_CONFIG="$parentdir/bin/apr-config"
+ else
+ AC_PATH_PROGS(APR_CONFIG, apr-1-config apr-config, NO_APR_CONFIG,
+ [$PATH:/opt/hpws/apache/bin:/usr/local/apache/bin:/usr/bin])
+ fi
+ if test -z "$APR_CONFIG" ; then
+ AC_MSG_ERROR([Apache2 apr-config program not found])
+ fi
fi
if test -z "$moddir" ; then
- moddir='$(libdir)/httpd/modules'
+ if test -n "$APXS" -a -x "$APXS" ; then
+ moddir=`$APXS -q LIBEXECDIR`
+ fi
+
+ if test -z "$moddir" ; then
+ moddir='$(libdir)/httpd/modules'
+ fi
fi
Index: mod_nss.m4
===================================================================
RCS file: /cvs/dirsec/adminserver/m4/mod_nss.m4,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- mod_nss.m4 21 May 2007 15:52:27 -0000 1.2
+++ mod_nss.m4 22 Jun 2007 01:34:20 -0000 1.3
@@ -50,36 +50,7 @@
],
AC_MSG_RESULT(no))
-# check for --with-fortitude
-default_fortitudedir=/opt/fortitude
-AC_MSG_CHECKING(for --with-fortitude)
-AC_ARG_WITH(fortitude, [ --with-fortitude=PATH Fortitude root directory (default:
$default_fortitudedir)],
-[
- if test -d "$withval"
- then
- AC_MSG_RESULT([using $withval])
- fortitudedir="$withval"
- elif test "$withval" = "yes" -a -d $default_fortitudedir ; then
- AC_MSG_RESULT([using $default_fortitudedir])
- fortitudedir="$default_fortitudedir"
- else
- echo
- AC_MSG_ERROR([$withval not found])
- fi
-],
-AC_MSG_RESULT(no))
-
-if test -n "$fortitudedir" ; then
- if test -z "$nssmoddir" ; then
- nssmoddir="$fortitudedir/modules.local"
- fi
- if test -z "$modnssbindir" ; then
- modnssbindir="$fortitudedir/bin"
- fi
-fi
# else, parse httpd.conf or httpconfdir/nss.conf
-
-# else, punt
if test -z "$modnssbindir" ; then
nsspcache=`grep NSSPassPhraseHelper $httpdconf|awk '{print $2}'`
if test -z "$nsspcache" ; then