blob: 1f3b3d427234f3f59df4518b1b538893cf5cfeaf [file] [log] [blame]
dnl
dnl Copyright 1999-2004 The Apache Software Foundation
dnl
dnl Licensed under the Apache License, Version 2.0 (the "License");
dnl you may not use this file except in compliance with the License.
dnl You may obtain a copy of the License at
dnl
dnl http://www.apache.org/licenses/LICENSE-2.0
dnl
dnl Unless required by applicable law or agreed to in writing, software
dnl distributed under the License is distributed on an "AS IS" BASIS,
dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
dnl See the License for the specific language governing permissions and
dnl limitations under the License.
dnl
dnl --------------------------------------------------------------------------
dnl Author Henri Gomez <hgomez@apache.org>
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_dominohome.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 DSAPI settings
AC_MSG_CHECKING([checking for dsapi...])
JK_WS_DIR([dsapi], [DOMINO], [server/dsapi/jk_dsapi_plugin.c], [server/dsapi])
JK_WS_INCDIR([dsapi], [DOMINO], [.])
JK_WS_LIBDIR([dsapi], [DOMINO])
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 Domino settings
JK_DOMHOME([domino], [DOMINO_HOME], [libnotes.so])
JK_DOMHOME([notesapi], [NOTESAPI], [include/global.h])
AC_SUBST(DOMINO_HOME)
AC_SUBST(NOTESAPI)
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(JNI_BUILD)
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
server/dsapi/Makefile
../build.properties:../build.properties.autoconf
scripts/build/unix/dummy
])