dnl =========================================================================
dnl
dnl The Apache Software License, Version 1.1
dnl
dnl Copyright (c) 1999-2003 The Apache Software Foundation.
dnl All rights reserved.
dnl
dnl =========================================================================
dnl
dnl Redistribution and use in source and binary forms, with or without modi-
dnl fication, are permitted provided that the following conditions are met:
dnl
dnl 1. Redistributions of source code must retain the above copyright notice
dnl notice, this list of conditions and the following disclaimer.
dnl
dnl 2. Redistributions in binary form must reproduce the above copyright
dnl notice, this list of conditions and the following disclaimer in the
dnl documentation and/or other materials provided with the distribution.
dnl
dnl 3. The end-user documentation included with the redistribution, if any,
dnl must include the following acknowlegement:
dnl
dnl "This product includes software developed by the Apache Software
dnl Foundation ."
dnl
dnl Alternately, this acknowlegement may appear in the software itself, if
dnl and wherever such third-party acknowlegements normally appear.
dnl
dnl 4. The names "The Jakarta Project", "Apache WebApp Module", and "Apache
dnl Software Foundation" must not be used to endorse or promote products
dnl derived from this software without prior written permission. For
dnl written permission, please contact .
dnl
dnl 5. Products derived from this software may not be called "Apache" nor may
dnl "Apache" appear in their names without prior written permission of the
dnl Apache Software Foundation.
dnl
dnl THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES
dnl INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
dnl AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
dnl THE APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY
dnl DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
dnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
dnl OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
dnl HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
dnl STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
dnl ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
dnl POSSIBILITY OF SUCH DAMAGE.
dnl
dnl =========================================================================
dnl
dnl This software consists of voluntary contributions made by many indivi-
dnl duals on behalf of the Apache Software Foundation. For more information
dnl on the Apache Software Foundation, please see .
dnl
dnl =========================================================================
dnl --------------------------------------------------------------------------
dnl Author Henri Gomez
dnl
dnl Version $Id$
dnl --------------------------------------------------------------------------
dnl sinclude(../support/jk_apache_static.m4)
sinclude(../support/jk_apxs.m4)
sinclude(../support/jk_ws.m4)
sinclude(../support/jk_exec.m4)
sinclude(../support/jk_apr.m4)
sinclude(../support/jk_tchome.m4)
sinclude(../support/jk_java.m4)
sinclude(../support/jk_pcre.m4)
dnl
dnl Process this file with autoconf to produce a configure script
dnl
AC_REVISION($Id$)dnl
AC_PREREQ(2.13)
AC_INIT(common/jk_config.c)
AC_CONFIG_AUX_DIR(scripts/build/unix)
AC_CANONICAL_SYSTEM
dnl package and version. (synchronization with common/jk_version.h ?)
PACKAGE=mod_jk2
VERSION=2.0.2
AM_INIT_AUTOMAKE(${PACKAGE}, ${VERSION})
AC_PROG_CC
AC_PROG_LD
dnl Not sure what it does, but the libtool manual seems to require this
dnl It should use the native platform dlopen ( if available )
AC_LIBTOOL_DLOPEN
dnl AM_PROG_LIBTOOL often causes problems.
dnl I have solved them once using aclocal --acdir=/usr/local/share/aclocal/
AM_PROG_LIBTOOL
AC_PATH_PROG(TEST,test,$PATH)dnl
AC_SUBST(TEST)
AC_PATH_PROG(RM,rm,$PATH)dnl
AC_SUBST(RM)
AC_PATH_PROG(GREP,grep,$PATH)dnl
AC_SUBST(GREP)
AC_PATH_PROG(ECHO,echo,echo,$PATH)dnl
AC_SUBST(ECHO)
AC_PATH_PROG(SED,sed,$PATH)dnl
AC_SUBST(SED)
AC_PATH_PROG(CP,cp,$PATH)dnl
AC_SUBST(CP)
AC_PATH_PROG(MKDIR,mkdir,$PATH)dnl
AC_SUBST(MKDIR)
dnl APXS settings
APR_LIBDIR_LA=""
AC_SUBST(APR_LIBDIR_LA)
JK_APXS([], [location of apxs for Apache 1.3])
JK_APXS([2], [location of apxs for Apache 2.0])
dnl APACHE13 settings
AC_MSG_CHECKING([checking for apache13...])
JK_WS_DIR([apache13], [APACHE], [src/include/httpd.h], [server/apache13])
JK_WS_INCDIR([apache13], [APACHE], [httpd.h])
JK_WS_LIBDIR([apache13], [APACHE])
dnl APACHE2 settings
AC_MSG_CHECKING([checking for apache20...])
JK_WS_DIR([apache2], [APACHE2], [include/httpd.h], [server/apache2])
JK_WS_INCDIR([apache2], [APACHE2], [httpd.h])
JK_WS_LIBDIR([apache2], [APACHE2])
dnl IIS settings
AC_MSG_CHECKING([checking for iis...])
JK_WS_DIR([iis], [IIS], [.], [server/isapi])
JK_WS_INCDIR([iis], [IIS], [.])
JK_WS_LIBDIR([iis], [IIS])
dnl iPlanet settings
AC_MSG_CHECKING([checking for iPlanet...])
JK_WS_DIR([iplanet], [IPLANET], [.], [server/aolserver])
JK_WS_INCDIR([iplanet], [IPLANET], [.])
JK_WS_LIBDIR([iplanet], [IPLANET])
dnl TOMCATs settings
JK_TCHOME([tomcat33], [TOMCAT33_HOME], [lib/tomcat.jar])
JK_TCHOME([tomcat40], [TOMCAT40_HOME], [server/lib/catalina.jar])
JK_TCHOME([tomcat41], [TOMCAT41_HOME], [server/lib/catalina.jar])
AC_SUBST(TOMCAT33_HOME)
AC_SUBST(TOMCAT40_HOME)
AC_SUBST(TOMCAT41_HOME)
dnl APR settings
JK_APR_THREADS()
JK_APR([include/apr.h.in])
JK_APR_UTIL([include/apu.h.in])
JK_APR_INCDIR([apr.h])
JK_APR_LIBDIR()
dnl Java settings
JK_JNI()
JK_JDK()
JK_JDK_OS()
JK_PCRE()
AC_SUBST(JAVA_HOME)
AC_SUBST(JAVA_PLATFORM)
AC_SUBST(OS)
AC_SUBST(HAVE_JNI)
AC_SUBST(HAS_PCRE)
AC_SUBST(PCRE_LIBS)
dnl Check that at least one WEBSERVER has been given
if ${TEST} -z "$WEBSERVERS" ; then
AC_MSG_ERROR(Cannot find any WebServer)
fi
AC_SUBST(WEBSERVERS)
dnl if --with-apr is specified, --with-apr-util must be too
if ${TEST} ! -z "$APR_BUILD" -a -z "$APR_UTIL_DIR"; then
AC_MSG_ERROR([--with-apr and --with-apr-util must be used together])
fi
dnl apache 1.3 consistancy checks
if ! ${TEST} -z "$APACHE_HOME" ; then
dnl check if apache 1.3 was selected without apr sources
if ${TEST} -z "$APR_BUILD"; then
AC_MSG_ERROR([Apache 1.3 requires apr to built from source, use --with-apr and --with-apr-util])
fi
dnl make sure compiler matchs apxs
if ${TEST} -n "$APACHE_CC" -a "$APACHE_CC" != "$CC"; then
AC_MSG_RESULT([error])
AC_MSG_RESULT([compiler discovered by configure: ${CC}])
AC_MSG_RESULT([compiler used by apache: ${APACHE_CC}])
AC_MSG_RESULT([delete config.cache and try CC=${APACHE_CC} ./configure])
AC_MSG_ERROR([jk2 and apache compilers must be the same])
fi
fi
dnl apache 2 consistancy checks
if ${TEST} ! -z "$APACHE2_HOME" ; then
dnl check if apache 2 was selected with apr sources
if ${TEST} ! -z "$APR_BUILD"; then
AC_MSG_ERROR([Use apr that comes with Apache 2, remove --with-apr])
fi
dnl make sure compiler matchs apxs
if ${TEST} -n "$APACHE2_CC" -a "$APACHE2_CC" != "$CC"; then
AC_MSG_RESULT([error])
AC_MSG_RESULT([compiler discovered by configure: ${CC}])
AC_MSG_RESULT([compiler used by apache: ${APACHE2_CC}])
AC_MSG_RESULT([delete config.cache and try CC=${APACHE2_CC} ./configure])
AC_MSG_ERROR([jk2 and apache compilers must be the same])
fi
fi
AC_SUBST(APACHE20_OEXT)
AC_SUBST(LIB_JK_TYPE)
AC_SUBST(INSTALL_TYPE)
dnl set APR defs
AC_SUBST(APR_BUILD)
AC_SUBST(APR_CFLAGS)
AC_SUBST(APR_CLEAN)
AC_SUBST(APR_DIR)
AC_SUBST(APR_UTIL_DIR)
AC_SUBST(APR_HOME)
AC_SUBST(APR_INCDIR)
AC_SUBST(APR_UTIL_INCDIR)
AC_SUBST(APR_LIBDIR)
AC_SUBST(APR_UTIL_LIBDIR)
AC_SUBST(APR_CONFIGURE_ARGS)
AC_SUBST(APR_LDFLAGS)
AC_SUBST(COMMON_APR_OBJECTS)
AC_SUBST(LIBTOOL)
dnl automake needs the path it does not work with $WEBSERVER
dnl that why useless Makefiles are build.
AC_OUTPUT([
Makefile
server/apache13/Makefile
server/apache13/Makefile.apxs
server/apache2/Makefile
server/apache2/Makefile.apxs
../build.properties:../build.properties.autoconf
scripts/build/unix/dummy
])