1 dnl Licensed to the Apache Software Foundation (ASF) under one or more
2 dnl contributor license agreements. See the NOTICE file distributed with
3 dnl this work for additional information regarding copyright ownership.
4 dnl The ASF licenses this file to You under the Apache License, Version 2.0
5 dnl (the "License"); you may not use this file except in compliance with
6 dnl the License. You may obtain a copy of the License at
8 dnl http://www.apache.org/licenses/LICENSE-2.0
10 dnl Unless required by applicable law or agreed to in writing, software
11 dnl distributed under the License is distributed on an "AS IS" BASIS,
12 dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 dnl See the License for the specific language governing permissions and
14 dnl limitations under the License.
17 dnl Process this file with autoconf to produce a configure script
19 AC_REVISION($Id: configure.in 1054607 2011-01-03 13:13:49Z rjung $)dnl
22 AC_INIT(common/jk_worker.h)
23 AC_CONFIG_HEADER(common/config.h)
24 AC_CONFIG_AUX_DIR(scripts/build/unix)
27 dnl package and version. (synchronization with common/jk_version.h ?)
31 AM_INIT_AUTOMAKE(${PACKAGE}, ${VERSION})
34 dnl Include our own M4 macros
36 sinclude(scripts/build/jk_common.m4)
38 dnl Generate ./config.nice for reproducing runs of configure
40 JK_CONFIG_NICE(config.nice)
42 AC_PATH_PROG(TEST,test,$PATH)dnl
45 AC_PATH_PROG(RM,rm,$PATH)dnl
48 AC_PATH_PROG(GREP,grep,$PATH)dnl
51 AC_PATH_PROG(ECHO,echo,echo,$PATH)dnl
54 AC_PATH_PROG(SED,sed,$PATH)dnl
57 AC_PATH_PROG(CP,cp,$PATH)dnl
60 AC_PATH_PROG(MKDIR,mkdir,$PATH)dnl
63 dnl Mark that we have generated config.h
64 CFLAGS="${CFLAGS} -DHAVE_CONFIG_H"
67 APACHE_CONFIG_VARS=`pwd`/scripts/build/config_vars.mk
73 [[ --with-apxs[=FILE] Build shared Apache module.
74 FILE is the optional pathname to the apxs tool;
75 defaults to finding apxs in your PATH.]],
78 y | yes | true) find_apxs=true ;;
79 n | no | false) find_apxs= ;;
80 *) find_apxs=${withval} ;;
83 if ${TEST} ${find_apxs} ; then
84 AC_MSG_RESULT([need to check for Perl first, apxs depends on it...])
85 AC_PATH_PROG(PERL,perl,$PATH)dnl
87 if ${TEST} ${find_apxs} = true ; then
88 AC_PATH_PROG(APXS,apxs,$PATH)dnl
93 if ${TEST} -n "${APXS}" ; then
94 dnl Seems that we have it, but have to check if it is OK first
95 if ${TEST} ! -x "${APXS}" ; then
96 AC_MSG_ERROR(Invalid location for apxs: '${APXS}')
99 ${APXS} -q PREFIX >/dev/null 2>/dev/null || apxs_support=false
101 if ${TEST} "${apxs_support}" = "false" ; then
102 AC_MSG_RESULT(could not find ${APXS})
103 AC_MSG_ERROR(You must specify a valid --with-apxs path)
106 dnl apache_dir and apache_include are also needed.
107 apache_dir=`$APXS -q PREFIX`
108 apache_include="-I`$APXS -q INCLUDEDIR`"
110 dnl test apache version
111 APA=`${GREP} STANDARD20 ${APXS}`
112 if ${TEST} -z "$APA" ; then
113 WEBSERVER="apache-1.3"
114 APXSCC="`$APXS -q CC`"
115 APXSCFLAGS="`$APXS -q CFLAGS` -DJK_PREFORK"
117 APXSLDFLAGS="`$APXS -q LDFLAGS_SHLIB`"
119 WEBSERVER="apache-2.0"
121 INCTEMP="`$APXS -q APR_INCLUDEDIR` `$APXS -q APU_INCLUDEDIR`"
122 for INC in ${INCTEMP}; do
123 APRINCLUDEDIR="${APRINCLUDEDIR} -I${INC}"
125 AC_MSG_RESULT([APRINCLUDEDIR is $APRINCLUDEDIR])
126 APXSCC="`$APXS -q CC`"
127 APXSCFLAGS="`${APXS} -q CFLAGS` `${APXS} -q EXTRA_CFLAGS` -DHAVE_APR ${APRINCLUDEDIR}"
128 APXSCPPFLAGS="`${APXS} -q EXTRA_CPPFLAGS`"
129 APXSLDFLAGS="`$APXS -q LDFLAGS`"
130 APACHE_CONFIG_VARS="`${APXS} -q exp_installbuilddir`/config_vars.mk"
131 LIBTOOL=`$APXS -q LIBTOOL`
133 AC_MSG_RESULT([building connector for \"$WEBSERVER\"])
134 if ${TEST} -z "${CC}" ; then
137 if ${TEST} "${CC}" != "$APXSCC" ; then
147 AC_MSG_RESULT(no apxs given)
150 AC_SUBST(APACHE_CONFIG_VARS)
155 SAVE_LIBTOOL="$LIBTOOL"
157 dnl Not sure what it does, but the libtool manual seems to require this
158 dnl It should use the native platform dlopen ( if available )
161 dnl AM_PROG_LIBTOOL often causes problems.
162 dnl I have solved them once using aclocal --acdir=/usr/local/share/aclocal/
165 if ${TEST} -n "${SAVE_LIBTOOL}" ; then
166 LIBTOOL="$SAVE_LIBTOOL"
168 AC_MSG_RESULT([LIBTOOL="$LIBTOOL"])
172 dnl ----------------------------- Checks for standard typedefs
174 dnl Checks for integer size
175 AC_CHECK_SIZEOF(char, 1)
176 AC_CHECK_SIZEOF(int, 4)
177 AC_CHECK_SIZEOF(long, 4)
178 AC_CHECK_SIZEOF(short, 2)
179 AC_CHECK_SIZEOF(long double, 12)
180 AC_CHECK_SIZEOF(long long, 8)
181 AC_CHECK_SIZEOF(longlong, 8)
183 # Now we need to find what jk_uint32_t (sizeof == 4) will be.
184 # The first match is our preference.
185 if test "$ac_cv_sizeof_int" = "4"; then
186 int32_t_fmt='#define JK_INT32_T_FMT "d"'
187 uint32_t_fmt='#define JK_UINT32_T_FMT "u"'
188 uint32_t_hex_fmt='#define JK_UINT32_T_HEX_FMT "x"'
190 elif test "$ac_cv_sizeof_long" = "4"; then
191 int32_t_fmt='#define JK_INT32_T_FMT "ld"'
192 uint32_t_fmt='#define JK_UINT32_T_FMT "lu"'
193 uint32_t_hex_fmt='#define JK_UINT32_T_HEX_FMT "lx"'
196 int32_t_fmt='#error could not detect a 32-bit integer type'
197 uint32_t_fmt='#error could not detect a 32-bit integer type'
198 uint32_t_hex_fmt='#error could not detect a 32-bit integer type'
199 AC_ERROR([could not detect a 32-bit integer type])
202 # Now we need to find what jk_uint64_t (sizeof == 8) will be.
203 # The first match is our preference.
204 if test "$ac_cv_sizeof_int" = "8"; then
205 int64_t_fmt='#define JK_INT64_T_FMT "d"'
206 uint64_t_fmt='#define JK_UINT64_T_FMT "u"'
207 uint64_t_hex_fmt='#define JK_UINT64_T_HEX_FMT "x"'
209 elif test "$ac_cv_sizeof_long" = "8"; then
210 int64_t_fmt='#define JK_INT64_T_FMT "ld"'
211 uint64_t_fmt='#define JK_UINT64_T_FMT "lu"'
212 uint64_t_hex_fmt='#define JK_UINT64_T_HEX_FMT "lx"'
214 elif test "$ac_cv_sizeof_long_long" = "8"; then
215 # Linux, Solaris, FreeBSD all support ll with printf.
216 # BSD 4.4 originated 'q'. Solaris is more popular and
217 # doesn't support 'q'. Solaris wins. Exceptions can
218 # go to the OS-dependent section.
219 int64_t_fmt='#define JK_INT64_T_FMT "lld"'
220 uint64_t_fmt='#define JK_UINT64_T_FMT "llu"'
221 uint64_t_hex_fmt='#define JK_UINT64_T_HEX_FMT "llx"'
222 int64_value="long long"
223 elif test "$ac_cv_sizeof_long_double" = "8"; then
224 int64_t_fmt='#define JK_INT64_T_FMT "Ld"'
225 uint64_t_fmt='#define JK_UINT64_T_FMT "Lu"'
226 uint64_t_hex_fmt='#define JK_UINT64_T_HEX_FMT "Lx"'
227 int64_value="long double"
228 elif test "$ac_cv_sizeof_longlong" = "8"; then
229 int64_t_fmt='#define JK_INT64_T_FMT "qd"'
230 uint64_t_fmt='#define JK_UINT64_T_FMT "qu"'
231 uint64_t_hex_fmt='#define JK_UINT64_T_HEX_FMT "qx"'
232 int64_value="__int64"
234 int64_t_fmt='#error could not detect a 64-bit integer type'
235 uint64_t_fmt='#error could not detect a 64-bit integer type'
236 uint64_t_hex_fmt='#error could not detect a 64-bit integer type'
237 AC_ERROR([could not detect a 64-bit integer type])
240 JK_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], pid_t, 8)
242 if test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_short"; then
243 pid_t_fmt='#define JK_PID_T_FMT "hd"'
244 elif test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_int"; then
245 pid_t_fmt='#define JK_PID_T_FMT "d"'
246 elif test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_long"; then
247 pid_t_fmt='#define JK_PID_T_FMT "ld"'
248 elif test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_long_long"; then
249 pid_t_fmt='#define JK_PID_T_FMT JK_INT64_T_FMT'
251 pid_t_fmt='#error Can not determine the proper size for pid_t'
254 JK_CHECK_SIZEOF_EXTENDED([#include <pthread.h>], pthread_t, 8)
256 if test "$ac_cv_sizeof_pthread_t" = "$ac_cv_sizeof_short"; then
257 pthread_t_fmt='#define JK_PTHREAD_T_FMT "hu"'
258 pthread_t_value="short"
259 elif test "$ac_cv_sizeof_pthread_t" = "$ac_cv_sizeof_int"; then
260 pthread_t_fmt='#define JK_PTHREAD_T_FMT "u"'
261 pthread_t_value="int"
262 elif test "$ac_cv_sizeof_pthread_t" = "$ac_cv_sizeof_long"; then
263 pthread_t_fmt='#define JK_PTHREAD_T_FMT "lu"'
264 pthread_t_value="long"
265 elif test "$ac_cv_sizeof_pthread_t" = "$ac_cv_sizeof_long_long"; then
266 pthread_t_fmt='#define JK_PTHREAD_T_FMT "llu"'
267 pthread_t_value="long long"
269 pthread_t_fmt='#error Can not determine the proper size for pthread_t'
272 # Basically, we have tried to figure out the correct format strings
273 # for pid_t which varies between platforms, but we don't always get
274 # it right. If you find that we don't get it right for your platform,
275 # you can override our decision below.
278 if test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_long"; then
279 pid_t_fmt='#define JK_PID_T_FMT "ld"'
284 AC_SUBST(int32_value)
285 AC_SUBST(int32_t_fmt)
286 AC_SUBST(uint32_t_fmt)
287 AC_SUBST(uint32_t_hex_fmt)
288 AC_SUBST(int64_value)
289 AC_SUBST(int64_t_fmt)
290 AC_SUBST(uint64_t_fmt)
291 AC_SUBST(uint64_t_hex_fmt)
293 AC_SUBST(pthread_t_fmt)
294 AC_SUBST(pthread_t_value)
296 dnl check for snprintf and vsnprintf.
297 AC_CHECK_FUNC(snprintf, AC_DEFINE(HAVE_SNPRINTF,1,[Have snprintf()]))
298 AC_CHECK_FUNC(vsnprintf, AC_DEFINE(HAVE_VSNPRINTF,1,[Have vsnprintf()]))
299 dnl check for flock function.
300 AC_CHECK_FUNC(flock, AC_DEFINE(HAVE_FLOCK,1,[Have flock()]))
302 dnl check for -lsocket library
303 AC_CHECK_LIB(socket, setsockopt, [LIBS="$LIBS -lsocket"])
305 dnl check for filio.h used on Solaris to define FIONREAD ioctl.
306 AC_CHECK_HEADERS(sys/filio.h)
308 AC_DEFUN([JK_CHECK_SETSOCKOPT], [
309 AC_MSG_CHECKING(whether to use $1 with setsockopt())
311 #include <sys/types.h>
312 #include <sys/socket.h>
313 #include <sys/time.h>
325 if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1)
328 /* fails on Solaris 2.6,8,9,10 and some Linuxes because
329 SO_RCVTIMEO|SO_SNDTIMEO are defined but not implemented */
330 if (setsockopt(s, SOL_SOCKET, $1, (const void *)&tv, sizeof(tv)) == -1)
337 , [ AC_MSG_RESULT([yes]) AC_DEFINE(USE_$1, 1, [Define to use $1 with setsockopt()]) ]
338 , [ AC_MSG_RESULT([no]) ]
342 dnl check for SO_RCVTIMEO and SO_SNDTIMEO
343 JK_CHECK_SETSOCKOPT(SO_RCVTIMEO)
344 JK_CHECK_SETSOCKOPT(SO_SNDTIMEO)
346 AC_DEFUN([JK_CHECK_SOCKOPT], [
347 AC_MSG_CHECKING(whether to use $1 with socket())
349 #include <sys/types.h>
350 #include <sys/socket.h>
351 #include <sys/time.h>
360 if ((s = socket(AF_INET, SOCK_STREAM | $1, 0)) == -1)
367 , [ AC_MSG_RESULT([yes]) AC_DEFINE(USE_$1, 1, [Define to use $1 with socket()]) ]
368 , [ AC_MSG_RESULT([no]) ]
372 dnl check for SOCK_CLOEXEC
373 JK_CHECK_SOCKOPT(SOCK_CLOEXEC)
375 dnl check for poll.h header
376 AC_CHECK_HEADERS(poll.h)
377 dnl check for poll function
378 AC_CHECK_FUNC(poll, AC_DEFINE(HAVE_POLL,1,[Have poll()]))
380 dnl Apache-2.0 needs the os subdirectory to include os.h
381 dnl this include is copy from os/config.m4
382 sinclude(../support/os_apache.m4)
384 dnl it is copied from the configure of JServ ;=)
387 apache_dir_is_src="false"
389 [AS_HELP_STRING([--with-apache=DIR],
390 [Build static Apache module. DIR is the pathname
391 to the Apache source directory.])],
393 if ${TEST} ! -z "$WEBSERVER" ; then
394 AC_MSG_ERROR([Sorry cannot use --with-apxs=${APXS} and --with-apache=${withval} together, please choose one of both])
397 AC_MSG_CHECKING([for Apache source directory (assume static build)])
399 if ${TEST} -n "${withval}" && ${TEST} -d "${withval}" ; then
400 if ${TEST} -d "${withval}/src" ; then
401 # handle the case where people use relative paths to
402 # the apache source directory by pre-pending the current
403 # build directory to the path. there are probably
404 # errors with this if configure is run while in a
405 # different directory than what you are in at the time
406 if ${TEST} -n "`${ECHO} ${withval}|${GREP} \"^\.\.\"`" ; then
407 withval=`pwd`/${withval}
410 apache_dir=${withval}
411 apache_dir_is_src="true"
412 AC_MSG_RESULT(${apache_dir})
414 AC_MSG_CHECKING(for Apache include directory)
416 if ${TEST} -d "${withval}/src/include" ; then
417 # read osdir from the existing apache.
418 osdir=`${GREP} '^OSDIR=' ${withval}/src/Makefile.config | ${SED} -e 's:^OSDIR=.*/os:os:'`
419 if ${TEST} -z "${osdir}" ; then
422 apache_include="-I${withval}/src/include \
423 -I${withval}/src/${osdir}"
424 WEBSERVER="apache-1.3"
426 CFLAGS="${CFLAGS} -DJK_PREFORK"
427 AC_MSG_RESULT([${apache_include}, version 1.3])
429 AC_MSG_ERROR([Sorry Apache 1.2.x is no longer supported.])
432 if ${TEST} -d "${withval}/include" ; then
433 # osdir for Apache20.
434 WEBSERVER="apache-2.0"
435 apache_dir=${withval}
436 apache_dir_is_src="true"
437 LIB_JK_TYPE=lib_jk.la
438 apache_include="-I${withval}/include -I${withval}/srclib/apr/include -I${withval}/os/${OS_APACHE_DIR} -I${withval}/srclib/apr-util/include"
439 AC_MSG_RESULT(${apache_dir})
444 dnl Make sure we have a result.
445 if ${TEST} -z "$WEBSERVER" ; then
446 AC_MSG_ERROR([Directory $apache_dir is not a valid Apache source distribution])
449 # VT: Now, which one I'm supposed to use? Let's figure it out later
451 configure_apache=true
454 AC_MSG_RESULT([building connector for \"$WEBSERVER\"])
457 AC_MSG_RESULT(no apache given)
460 AC_SUBST(apache_include)
461 APACHE_DIR=${apache_dir}
464 AC_ARG_ENABLE(netscape,
465 [AS_HELP_STRING([--enable-netscape=DIR],[Build Netscape/iPlanet/SunONE nsapi redirector plugin])],
467 if ${TEST} ! -z "$WEBSERVER" ; then
468 AC_MSG_ERROR([Sorry cannot use --with-apxs=${APXS} or --with-apache=${withval} with --with-netscape, please choose one or the other.])
473 AC_MSG_RESULT([building connector for \"$WEBSERVER\"])
476 AC_MSG_RESULT(no netscape given)
479 dnl Check for enable-jni
482 [AS_HELP_STRING([--enable-jni],[DEPRECATED: Build jni_connect.so and enable jni_worker])],
484 AC_MSG_RESULT(jni enable (need JDK))
485 CFLAGS="${CFLAGS} -DHAVE_JNI"
486 JK_JNI_WORKER="\${JK}jk_jni_worker\${OEXT}"
489 AC_SUBST(JK_JNI_WORKER)
491 dnl CFLAGS for EAPI mod_ssl (Apache 1.3)
492 dnl it also allows the CFLAGS environment variable.
495 [AS_HELP_STRING([--enable-EAPI],[Enable EAPI support (mod_ssl, Apache 1.3)])],
497 case "${enableval}" in
498 y | Y | YES | yes | TRUE | true )
499 CFLAGS="${CFLAGS} -DEAPI"
500 AC_MSG_RESULT([...Enabling EAPI Support...])
506 dnl CFLAGS for maintainer mode
507 dnl it also allows the CFLAGS environment variable.
509 AC_ARG_ENABLE(maintainer-mode,
510 [AS_HELP_STRING([--enable-maintainer-mode],[Turn on debugging and compile time warnings])],
512 case "${enableval}" in
513 y | Y | YES | yes | TRUE | true )
514 CFLAGS="${CFLAGS} -DDEBUG -Wall"
515 AC_MSG_RESULT([...Enabling Maintainer mode...])
521 dnl CFLAGS for prefork mode
522 dnl it also allows the CFLAGS environment variable.
524 AC_ARG_ENABLE(prefork,
525 [AS_HELP_STRING([--enable-prefork],[Turn on prefork web server mode (single-threaded)])],
527 case "${enableval}" in
528 y | Y | YES | yes | TRUE | true )
529 CFLAGS="${CFLAGS} -DJK_PREFORK"
530 AC_MSG_RESULT([...Enabling Prefork mode...])
536 dnl CFLAGS for stripping TRACE logs
537 dnl it also allows the CFLAGS environment variable.
540 [AS_HELP_STRING([--disable-trace],[Exclude trace log code from compilation])],
542 case "${enableval}" in
544 CFLAGS="${CFLAGS} -DJK_PRODUCTION"
545 AC_MSG_RESULT([...Exclude trace log code...])
551 dnl CFLAGS for building against recent httpd but without
552 dnl using httpd API functions, which didn't exist in the first
553 dnl production releases. This ensures, that the resulting
554 dnl module binary is compatible with older httpd releases.
555 dnl Until now only relevant for httpd 2.2.x with x >= 4.
557 AC_ARG_ENABLE(api-compatibility,
558 [AS_HELP_STRING([--enable-api-compatibility],
559 [Only use httpd API functions available in all production releases.
560 This improves binary compatibility of module builds with httpd releases
561 older than the release against we build (only between minor versions).])],
563 case "${enableval}" in
564 y | Y | YES | yes | TRUE | true )
565 CFLAGS="${CFLAGS} -DAPI_COMPATIBILITY"
566 AC_MSG_RESULT([...Only using compatible httpd API...])
572 dnl CFLAGS for shared memory lock mode
573 dnl it also allows the CFLAGS environment variable.
576 [AS_HELP_STRING([--enable-flock],[Turn on flock for shared locking if present])],
578 case "${enableval}" in
579 y | Y | YES | yes | TRUE | true )
580 CFLAGS="${CFLAGS} -DJK_USE_FLOCK"
581 AC_MSG_RESULT([...Enabling flock() shared memory locking...])
587 dnl the APXSCFLAGS is given by apxs to the C compiler
588 if ${TEST} -n "${CFLAGS}" ; then
589 APXSCFLAGS="${APXSCFLAGS} ${CFLAGS}"
592 AC_SUBST(APXSCPPFLAGS)
594 dnl the APXSLDFLAGS is given to the linker (for APRVARS).
595 if ${TEST} -n "${LDFLAGS}" ; then
596 APXSLDFLAGS="${APXSLDFLAGS} ${LDFLAGS}"
599 dnl Prefix all LDFLAGS with "-Wl,",
600 dnl because we pass them to libtool
601 JK_PREFIX_IF_MISSING(APXSLDFLAGS, [-Wl,])
603 AC_SUBST(APXSLDFLAGS)
605 if ${TEST} -n "${JK_JNI_WORKER}" ; then
607 WEBSERVER="jni ${WEBSERVER}"
610 dnl Results go in JAVA_HOME
611 dnl Also sets JAVA_PLATFORM to 1 for 1.1 and to 2 for 1.2
613 AC_MSG_CHECKING([for JDK location (please wait)])
615 dnl The order is: --with-java-home first, environment second, guessed value third.
617 dnl This is a safe default. Could screw up on the security features, but
618 dnl oh well, this is what --with-java2 is for.
620 if ${TEST} -n "${JAVA_HOME}" ; then
621 JAVA_HOME_ENV="${JAVA_HOME}"
628 AC_ARG_WITH(java-home,
629 [AS_HELP_STRING([--with-java-home=DIR],[DEPRECATED: Where is your JDK root directory])],
632 # This stuff works if the command line parameter --with-java-home was
633 # specified, so it takes priority rightfully.
637 if ${TEST} ! -d "${JAVA_HOME}" ; then
638 AC_MSG_ERROR(Not a directory: ${JAVA_HOME})
641 AC_MSG_RESULT(${JAVA_HOME})
645 # This works if the parameter was NOT specified, so it's a good time
646 # to see what the enviroment says.
648 # Since Sun uses JAVA_HOME a lot, we check it first and ignore the
649 # JAVA_HOME, otherwise just use whatever JAVA_HOME was specified.
651 if ${TEST} -n "${JAVA_HOME_ENV}" ; then
653 JAVA_HOME=${JAVA_HOME_ENV}
654 AC_MSG_RESULT(${JAVA_HOME_ENV} from environment)
658 if ${TEST} -z "${JAVA_HOME}" ; then
660 # Oh well, nobody set neither JAVA_HOME nor JAVA_HOME, have to guess
662 # The following code is based on the code submitted by Henner Zeller
663 # for ${srcdir}/src/scripts/package/rpm/ApacheJServ.spec
665 # Two variables will be set as a result:
669 AC_MSG_CHECKING([Try to guess JDK location])
680 for JAVA_PLATFORM in 3 2 1 ;
683 for subversion in .9 .8 .7 .6 .5 .4 .3 .2 .1 "" ;
685 for VARIANT in IBMJava2- java java- jdk jdk-;
687 GUESS="${JAVA_PREFIX}/${VARIANT}1.${JAVA_PLATFORM}${subversion}"
688 dnl AC_MSG_CHECKING([${GUESS}])
689 if ${TEST} -d "${GUESS}/bin" \
690 && ${TEST} -d "${GUESS}/include" ; then
693 AC_MSG_RESULT([${GUESS}])
699 if ${TEST} -n "${JAVA_HOME}" ; then
705 if ${TEST} -n "${JAVA_HOME}" ; then
711 if ${TEST} -n "${JAVA_HOME}" ; then
717 if ${TEST} -n "${JAVA_HOME}" ; then
719 dnl Just to have the messages looking uniformly
721 AC_MSG_CHECKING(Java platform)
722 AC_MSG_RESULT([guess ${JAVA_PLATFORM}])
728 AC_MSG_CHECKING(Java platform)
730 AC_ARG_WITH(java-platform,
731 [AS_HELP_STRING([--with-java-platform=VAL],
732 [DEPRECATED: Force the Java platform
733 (value is 1 for 1.1.x or 2 for 1.2.x or greater)])],
735 dnl This requires a bit of tweaking to be handled properly, but
736 dnl the default is good enough
741 AC_MSG_RESULT(forced Java ${JAVA_PLATFORM})
746 dnl test if --enable-jni give but not valid JAVA_HOME
747 if ${TEST} -z "${JAVA_HOME}" ; then
748 AC_MSG_ERROR([JDK home not found, please specify one with --with-java-home option (run ./configure --help for more options)])
751 dnl guess OS = OS_TYPE for jni_md.h
754 [AS_HELP_STRING([--with-os-type=SUBDIR],[DEPRECATED: Where is your JDK os-type subdirectory])],
758 if ${TEST} ! -d "${JAVA_HOME}/${OS}" ; then
759 AC_MSG_ERROR(Not a directory: ${JAVA_HOME}/${OS})
763 AC_MSG_CHECKING(os_type directory)
764 if ${TEST} -f ${JAVA_HOME}/include/jni_md.h; then
767 for f in ${JAVA_HOME}/include/*/jni_md.h; do
768 if ${TEST} -f $f; then
774 if ${TEST} -z "${OS}"; then
775 AC_MSG_RESULT(Cannot find jni_md.h in ${JAVA_HOME}/${OS})
776 AC_MSG_ERROR(You should retry --with-os-type=SUBDIR)
785 dnl Check that a WEBSERVER has been given
786 if ${TEST} -z "$WEBSERVER" ; then
787 AC_MSG_ERROR(Cannot find the WebServer)
790 dnl Add common to subdir list
791 WEBSERVER="common ${WEBSERVER}"
795 AM_CONDITIONAL(MAKE_DYNAMIC_APACHE, ${TEST} "${apache_dir_is_src}" = "false")
797 if ${TEST} "${apache_dir_is_src}" = "false" ; then
798 dnl normal apxs handling
800 LIB_JK_TYPE=mod_jk.so
801 INSTALL_TYPE=install_dynamic
803 dnl install static library in apache sources.
805 INSTALL_TYPE=install_static
807 AC_SUBST(APACHE20_OEXT)
808 AC_SUBST(LIB_JK_TYPE)
809 AC_SUBST(INSTALL_TYPE)
811 dnl automake needs the path it does not work with $WEBSERVER
812 dnl that why useless Makefiles are build.
816 apache-1.3/Makefile.apxs
818 apache-2.0/Makefile.apxs
825 if ${TEST} -n "${WARN_JNI}" ; then
826 AC_MSG_WARN([===========================================])
827 AC_MSG_WARN([You have used one of the following options:])
828 AC_MSG_WARN([ --enable-jni])
829 AC_MSG_WARN([ --with-java-home])
830 AC_MSG_WARN([ --with-java-platform])
831 AC_MSG_WARN([ --with-os-type])
832 AC_MSG_WARN([These options are only necessary if])
833 AC_MSG_WARN([you want to use a worker of type jni.])
834 AC_MSG_WARN([These workers have been deprecated.])
835 AC_MSG_WARN([They do not work and will be removed from])
836 AC_MSG_WARN([a future release])
837 AC_MSG_WARN([===========================================])
840 if ${TEST} -n "${WARN_CC}" ; then
841 AC_MSG_WARN([===========================================])
842 AC_MSG_WARN([Using CC from environment:])
843 AC_MSG_WARN([ CC="$CC"])
844 AC_MSG_WARN([instead of CC from apxs:])
845 AC_MSG_WARN([ CC="$APXSCC"])
846 AC_MSG_WARN([If "make" throws an error of the form])
847 AC_MSG_WARN([ "libtool: compile: unable to infer tagged configuration"])
848 AC_MSG_WARN([ "libtool: compile: specify a tag with `--tag'"])
849 AC_MSG_WARN([try running configure without setting CC,])
850 AC_MSG_WARN([or at least CC should start with "$APXSCC"])
851 AC_MSG_WARN([===========================================])