# generated automatically by aclocal 1.16.1 -*- Autoconf -*- # Copyright (C) 1996-2018 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) dnl -------------------------------------------------------- -*- autoconf -*- dnl Licensed to the Apache Software Foundation (ASF) under one or more dnl contributor license agreements. See the NOTICE file distributed with dnl this work for additional information regarding copyright ownership. dnl The ASF licenses this file to You under the Apache License, Version 2.0 dnl (the "License"); you may not use this file except in compliance with dnl the License. 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 apr_common.m4: APR's general-purpose autoconf macros dnl dnl dnl APR_CONFIG_NICE(filename) dnl dnl Saves a snapshot of the configure command-line for later reuse dnl AC_DEFUN([APR_CONFIG_NICE], [ rm -f $1 cat >$1<> $1 fi if test -n "$CFLAGS"; then echo "CFLAGS=\"$CFLAGS\"; export CFLAGS" >> $1 fi if test -n "$CPPFLAGS"; then echo "CPPFLAGS=\"$CPPFLAGS\"; export CPPFLAGS" >> $1 fi if test -n "$LDFLAGS"; then echo "LDFLAGS=\"$LDFLAGS\"; export LDFLAGS" >> $1 fi if test -n "$LTFLAGS"; then echo "LTFLAGS=\"$LTFLAGS\"; export LTFLAGS" >> $1 fi if test -n "$LIBS"; then echo "LIBS=\"$LIBS\"; export LIBS" >> $1 fi if test -n "$INCLUDES"; then echo "INCLUDES=\"$INCLUDES\"; export INCLUDES" >> $1 fi if test -n "$NOTEST_CFLAGS"; then echo "NOTEST_CFLAGS=\"$NOTEST_CFLAGS\"; export NOTEST_CFLAGS" >> $1 fi if test -n "$NOTEST_CPPFLAGS"; then echo "NOTEST_CPPFLAGS=\"$NOTEST_CPPFLAGS\"; export NOTEST_CPPFLAGS" >> $1 fi if test -n "$NOTEST_LDFLAGS"; then echo "NOTEST_LDFLAGS=\"$NOTEST_LDFLAGS\"; export NOTEST_LDFLAGS" >> $1 fi if test -n "$NOTEST_LIBS"; then echo "NOTEST_LIBS=\"$NOTEST_LIBS\"; export NOTEST_LIBS" >> $1 fi # Retrieve command-line arguments. eval "set x $[0] $ac_configure_args" shift for arg do APR_EXPAND_VAR(arg, $arg) echo "\"[$]arg\" \\" >> $1 done echo '"[$]@"' >> $1 chmod +x $1 ])dnl dnl APR_MKDIR_P_CHECK(fallback-mkdir-p) dnl checks whether mkdir -p works AC_DEFUN([APR_MKDIR_P_CHECK], [ AC_CACHE_CHECK(for working mkdir -p, ac_cv_mkdir_p,[ test -d conftestdir && rm -rf conftestdir mkdir -p conftestdir/somedir >/dev/null 2>&1 if test -d conftestdir/somedir; then ac_cv_mkdir_p=yes else ac_cv_mkdir_p=no fi rm -rf conftestdir ]) if test "$ac_cv_mkdir_p" = "yes"; then mkdir_p="mkdir -p" else mkdir_p="$1" fi ]) dnl dnl APR_SUBDIR_CONFIG(dir [, sub-package-cmdline-args, args-to-drop]) dnl dnl dir: directory to find configure in dnl sub-package-cmdline-args: arguments to add to the invocation (optional) dnl args-to-drop: arguments to drop from the invocation (optional) dnl dnl Note: This macro relies on ac_configure_args being set properly. dnl dnl The args-to-drop argument is shoved into a case statement, so dnl multiple arguments can be separated with a |. dnl dnl Note: Older versions of autoconf do not single-quote args, while 2.54+ dnl places quotes around every argument. So, if you want to drop the dnl argument called --enable-layout, you must pass the third argument as: dnl [--enable-layout=*|\'--enable-layout=*] dnl dnl Trying to optimize this is left as an exercise to the reader who wants dnl to put up with more autoconf craziness. I give up. dnl AC_DEFUN([APR_SUBDIR_CONFIG], [ # save our work to this point; this allows the sub-package to use it AC_CACHE_SAVE echo "configuring package in $1 now" ac_popdir=`pwd` apr_config_subdirs="$1" test -d $1 || $mkdir_p $1 ac_abs_srcdir=`(cd $srcdir/$1 && pwd)` cd $1 changequote(, )dnl # A "../" for each directory in /$config_subdirs. ac_dots=`echo $apr_config_subdirs|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` changequote([, ])dnl # Make the cache file pathname absolute for the subdirs # required to correctly handle subdirs that might actually # be symlinks case "$cache_file" in /*) # already absolute ac_sub_cache_file=$cache_file ;; *) # Was relative path. ac_sub_cache_file="$ac_popdir/$cache_file" ;; esac ifelse($3, [], [apr_configure_args=$ac_configure_args],[ apr_configure_args= apr_sep= for apr_configure_arg in $ac_configure_args do case "$apr_configure_arg" in $3) continue ;; esac apr_configure_args="$apr_configure_args$apr_sep'$apr_configure_arg'" apr_sep=" " done ]) dnl autoconf doesn't add --silent to ac_configure_args; explicitly pass it test "x$silent" = "xyes" && apr_configure_args="$apr_configure_args --silent" dnl AC_CONFIG_SUBDIRS silences option warnings, emulate this for 2.62 apr_configure_args="--disable-option-checking $apr_configure_args" dnl The eval makes quoting arguments work - specifically the second argument dnl where the quoting mechanisms used is "" rather than []. dnl dnl We need to execute another shell because some autoconf/shell combinations dnl will choke after doing repeated APR_SUBDIR_CONFIG()s. (Namely Solaris dnl and autoconf-2.54+) if eval $SHELL $ac_abs_srcdir/configure $apr_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_abs_srcdir $2 then : echo "$1 configured properly" else echo "configure failed for $1" exit 1 fi cd $ac_popdir # grab any updates from the sub-package AC_CACHE_LOAD ])dnl dnl dnl APR_SAVE_THE_ENVIRONMENT(variable_name) dnl dnl Stores the variable (usually a Makefile macro) for later restoration dnl AC_DEFUN([APR_SAVE_THE_ENVIRONMENT], [ apr_ste_save_$1="$$1" ])dnl dnl dnl APR_RESTORE_THE_ENVIRONMENT(variable_name, prefix_) dnl dnl Uses the previously saved variable content to figure out what configure dnl has added to the variable, moving the new bits to prefix_variable_name dnl and restoring the original variable contents. This makes it possible dnl for a user to override configure when it does something stupid. dnl AC_DEFUN([APR_RESTORE_THE_ENVIRONMENT], [ dnl Check whether $apr_ste_save_$1 is empty or dnl only whitespace. The verbatim "X" is token number 1, dnl the following whitespace will be ignored. set X $apr_ste_save_$1 if test ${#} -eq 1; then $2$1="$$1" $1= else if test "x$apr_ste_save_$1" = "x$$1"; then $2$1= else $2$1=`echo "$$1" | sed -e "s%${apr_ste_save_$1}%%"` $1="$apr_ste_save_$1" fi fi if test "x$silent" != "xyes"; then echo " restoring $1 to \"$$1\"" echo " setting $2$1 to \"$$2$1\"" fi AC_SUBST($2$1) ])dnl dnl dnl APR_SETIFNULL(variable, value) dnl dnl Set variable iff it's currently null dnl AC_DEFUN([APR_SETIFNULL], [ if test -z "$$1"; then test "x$silent" != "xyes" && echo " setting $1 to \"$2\"" $1="$2" fi ])dnl dnl dnl APR_SETVAR(variable, value) dnl dnl Set variable no matter what dnl AC_DEFUN([APR_SETVAR], [ test "x$silent" != "xyes" && echo " forcing $1 to \"$2\"" $1="$2" ])dnl dnl dnl APR_ADDTO(variable, value) dnl dnl Add value to variable dnl AC_DEFUN([APR_ADDTO], [ if test "x$$1" = "x"; then test "x$silent" != "xyes" && echo " setting $1 to \"$2\"" $1="$2" else apr_addto_bugger="$2" for i in $apr_addto_bugger; do apr_addto_duplicate="0" for j in $$1; do if test "x$i" = "x$j"; then apr_addto_duplicate="1" break fi done if test $apr_addto_duplicate = "0"; then test "x$silent" != "xyes" && echo " adding \"$i\" to $1" $1="$$1 $i" fi done fi ])dnl dnl dnl APR_REMOVEFROM(variable, value) dnl dnl Remove a value from a variable dnl AC_DEFUN([APR_REMOVEFROM], [ if test "x$$1" = "x$2"; then test "x$silent" != "xyes" && echo " nulling $1" $1="" else apr_new_bugger="" apr_removed=0 for i in $$1; do if test "x$i" != "x$2"; then apr_new_bugger="$apr_new_bugger $i" else apr_removed=1 fi done if test $apr_removed = "1"; then test "x$silent" != "xyes" && echo " removed \"$2\" from $1" $1=$apr_new_bugger fi fi ]) dnl dnl dnl APR_CHECK_DEFINE_FILES( symbol, header_file [header_file ...] ) dnl AC_DEFUN([APR_CHECK_DEFINE_FILES], [ AC_CACHE_CHECK([for $1 in $2],ac_cv_define_$1,[ ac_cv_define_$1=no for curhdr in $2 do AC_EGREP_CPP(YES_IS_DEFINED, [ #include <$curhdr> #ifdef $1 YES_IS_DEFINED #endif ], ac_cv_define_$1=yes) done ]) if test "$ac_cv_define_$1" = "yes"; then AC_DEFINE(HAVE_$1, 1, [Define if $1 is defined]) fi ]) dnl dnl APR_CHECK_DEFINE(symbol, header_file) dnl AC_DEFUN([APR_CHECK_DEFINE], [ AC_CACHE_CHECK([for $1 in $2],ac_cv_define_$1,[ AC_EGREP_CPP(YES_IS_DEFINED, [ #include <$2> #ifdef $1 YES_IS_DEFINED #endif ], ac_cv_define_$1=yes, ac_cv_define_$1=no) ]) if test "$ac_cv_define_$1" = "yes"; then AC_DEFINE(HAVE_$1, 1, [Define if $1 is defined in $2]) fi ]) dnl dnl APR_CHECK_APR_DEFINE( symbol ) dnl AC_DEFUN([APR_CHECK_APR_DEFINE], [ apr_old_cppflags=$CPPFLAGS CPPFLAGS="$CPPFLAGS $INCLUDES" AC_EGREP_CPP(YES_IS_DEFINED, [ #include #if $1 YES_IS_DEFINED #endif ], ac_cv_define_$1=yes, ac_cv_define_$1=no) CPPFLAGS=$apr_old_cppflags ]) dnl APR_CHECK_FILE(filename); set ac_cv_file_filename to dnl "yes" if 'filename' is readable, else "no". dnl @deprecated! - use AC_CHECK_FILE instead AC_DEFUN([APR_CHECK_FILE], [ dnl Pick a safe variable name define([apr_cvname], ac_cv_file_[]translit([$1], [./+-], [__p_])) AC_CACHE_CHECK([for $1], [apr_cvname], [if test -r $1; then apr_cvname=yes else apr_cvname=no fi]) ]) define(APR_IFALLYES,[dnl ac_rc=yes for ac_spec in $1; do ac_type=`echo "$ac_spec" | sed -e 's/:.*$//'` ac_item=`echo "$ac_spec" | sed -e 's/^.*://'` case $ac_type in header ) ac_item=`echo "$ac_item" | sed 'y%./+-%__p_%'` ac_var="ac_cv_header_$ac_item" ;; file ) ac_item=`echo "$ac_item" | sed 'y%./+-%__p_%'` ac_var="ac_cv_file_$ac_item" ;; func ) ac_var="ac_cv_func_$ac_item" ;; struct ) ac_var="ac_cv_struct_$ac_item" ;; define ) ac_var="ac_cv_define_$ac_item" ;; custom ) ac_var="$ac_item" ;; esac eval "ac_val=\$$ac_var" if test ".$ac_val" != .yes; then ac_rc=no break fi done if test ".$ac_rc" = .yes; then : $2 else : $3 fi ]) define(APR_BEGIN_DECISION,[dnl ac_decision_item='$1' ac_decision_msg='FAILED' ac_decision='' ]) AC_DEFUN([APR_DECIDE],[dnl dnl Define the flag (or not) in apr_private.h via autoheader AH_TEMPLATE($1, [Define if $2 will be used]) ac_decision='$1' ac_decision_msg='$2' ac_decision_$1=yes ac_decision_$1_msg='$2' ]) define(APR_DECISION_OVERRIDE,[dnl ac_decision='' for ac_item in $1; do eval "ac_decision_this=\$ac_decision_${ac_item}" if test ".$ac_decision_this" = .yes; then ac_decision=$ac_item eval "ac_decision_msg=\$ac_decision_${ac_item}_msg" fi done ]) define(APR_DECISION_FORCE,[dnl ac_decision="$1" eval "ac_decision_msg=\"\$ac_decision_${ac_decision}_msg\"" ]) define(APR_END_DECISION,[dnl if test ".$ac_decision" = .; then echo "[$]0:Error: decision on $ac_decision_item failed" 1>&2 exit 1 else if test ".$ac_decision_msg" = .; then ac_decision_msg="$ac_decision" fi AC_DEFINE_UNQUOTED(${ac_decision_item}) AC_MSG_RESULT([decision on $ac_decision_item... $ac_decision_msg]) fi ]) dnl dnl APR_CHECK_SIZEOF_EXTENDED(INCLUDES, TYPE [, CROSS_SIZE]) dnl dnl A variant of AC_CHECK_SIZEOF which allows the checking of dnl sizes of non-builtin types dnl AC_DEFUN([APR_CHECK_SIZEOF_EXTENDED], [changequote(<<, >>)dnl dnl The name to #define. define(<>, translit(sizeof_$2, [a-z *], [A-Z_P]))dnl dnl The cache variable name. define(<>, translit(ac_cv_sizeof_$2, [ *], [_p]))dnl changequote([, ])dnl AC_MSG_CHECKING(size of $2) AC_CACHE_VAL(AC_CV_NAME, [AC_TRY_RUN([#include $1 #ifdef WIN32 #define binmode "b" #else #define binmode #endif main() { FILE *f=fopen("conftestval", "w" binmode); if (!f) exit(1); fprintf(f, "%d\n", sizeof($2)); exit(0); }], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$3],,, AC_CV_NAME=$3))])dnl AC_MSG_RESULT($AC_CV_NAME) AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The size of ]$2) undefine([AC_TYPE_NAME])dnl undefine([AC_CV_NAME])dnl ]) dnl dnl APR_TRY_COMPILE_NO_WARNING(INCLUDES, FUNCTION-BODY, dnl [ACTIONS-IF-NO-WARNINGS], [ACTIONS-IF-WARNINGS]) dnl dnl Tries a compile test with warnings activated so that the result dnl is false if the code doesn't compile cleanly. For compilers dnl where it is not known how to activate a "fail-on-error" mode, dnl it is undefined which of the sets of actions will be run. dnl AC_DEFUN([APR_TRY_COMPILE_NO_WARNING], [apr_save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $CFLAGS_WARN" if test "$ac_cv_prog_gcc" = "yes"; then CFLAGS="$CFLAGS -Werror" fi AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [#include "confdefs.h" ] [[$1]] [int main(int argc, const char *const *argv) {] [[$2]] [ return 0; }] )], [$3], [$4]) CFLAGS=$apr_save_CFLAGS ]) dnl dnl APR_CHECK_STRERROR_R_RC dnl dnl Decide which style of retcode is used by this system's dnl strerror_r(). It either returns int (0 for success, -1 dnl for failure), or it returns a pointer to the error dnl string. dnl dnl AC_DEFUN([APR_CHECK_STRERROR_R_RC], [ AC_MSG_CHECKING(for type of return code from strerror_r) AC_TRY_RUN([ #include #include #include main() { char buf[1024]; if (strerror_r(ERANGE, buf, sizeof buf) < 1) { exit(0); } else { exit(1); } }], [ ac_cv_strerror_r_rc_int=yes ], [ ac_cv_strerror_r_rc_int=no ], [ ac_cv_strerror_r_rc_int=no ] ) if test "x$ac_cv_strerror_r_rc_int" = xyes; then AC_DEFINE(STRERROR_R_RC_INT, 1, [Define if strerror returns int]) msg="int" else msg="pointer" fi AC_MSG_RESULT([$msg]) ] ) dnl dnl APR_CHECK_DIRENT_INODE dnl dnl Decide if d_fileno or d_ino are available in the dirent dnl structure on this platform. Single UNIX Spec says d_ino, dnl BSD uses d_fileno. Undef to find the real beast. dnl AC_DEFUN([APR_CHECK_DIRENT_INODE], [ AC_CACHE_CHECK([for inode member of struct dirent], apr_cv_dirent_inode, [ apr_cv_dirent_inode=no AC_TRY_COMPILE([ #include #include ],[ #ifdef d_ino #undef d_ino #endif struct dirent de; de.d_fileno; ], apr_cv_dirent_inode=d_fileno) if test "$apr_cv_dirent_inode" = "no"; then AC_TRY_COMPILE([ #include #include ],[ #ifdef d_fileno #undef d_fileno #endif struct dirent de; de.d_ino; ], apr_cv_dirent_inode=d_ino) fi ]) if test "$apr_cv_dirent_inode" != "no"; then AC_DEFINE_UNQUOTED(DIRENT_INODE, $apr_cv_dirent_inode, [Define if struct dirent has an inode member]) fi ]) dnl dnl APR_CHECK_DIRENT_TYPE dnl dnl Decide if d_type is available in the dirent structure dnl on this platform. Not part of the Single UNIX Spec. dnl Note that this is worthless without DT_xxx macros, so dnl look for one while we are at it. dnl AC_DEFUN([APR_CHECK_DIRENT_TYPE], [ AC_CACHE_CHECK([for file type member of struct dirent], apr_cv_dirent_type,[ apr_cv_dirent_type=no AC_TRY_COMPILE([ #include #include ],[ struct dirent de; de.d_type = DT_REG; ], apr_cv_dirent_type=d_type) ]) if test "$apr_cv_dirent_type" != "no"; then AC_DEFINE_UNQUOTED(DIRENT_TYPE, $apr_cv_dirent_type, [Define if struct dirent has a d_type member]) fi ]) dnl the following is a newline, a space, a tab, and a backslash (the dnl backslash is used by the shell to skip newlines, but m4 sees it; dnl treat it like whitespace). dnl WARNING: don't reindent these lines, or the space/tab will be lost! define([apr_whitespace],[ \]) dnl dnl APR_COMMA_ARGS(ARG1 ...) dnl convert the whitespace-separated arguments into comman-separated dnl arguments. dnl dnl APR_FOREACH(CODE-BLOCK, ARG1, ARG2, ...) dnl subsitute CODE-BLOCK for each ARG[i]. "eachval" will be set to ARG[i] dnl within each iteration. dnl changequote({,}) define({APR_COMMA_ARGS},{patsubst([$}{1],[[}apr_whitespace{]+],[,])}) define({APR_FOREACH}, {ifelse($}{2,,, [define([eachval], $}{2)$}{1[]APR_FOREACH([$}{1], builtin([shift], builtin([shift], $}{@)))])}) changequote([,]) dnl APR_FLAG_HEADERS(HEADER-FILE ... [, FLAG-TO-SET ] [, "yes" ]) dnl we set FLAG-TO-SET to 1 if we find HEADER-FILE, otherwise we set to 0 dnl if FLAG-TO-SET is null, we automagically determine it's name dnl by changing all "/" to "_" in the HEADER-FILE and dropping dnl all "." and "-" chars. If the 3rd parameter is "yes" then instead of dnl setting to 1 or 0, we set FLAG-TO-SET to yes or no. dnl AC_DEFUN([APR_FLAG_HEADERS], [ AC_CHECK_HEADERS($1) for aprt_i in $1 do ac_safe=`echo "$aprt_i" | sed 'y%./+-%__p_%'` aprt_2=`echo "$aprt_i" | sed -e 's%/%_%g' -e 's/\.//g' -e 's/-//g'` if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then eval "ifelse($2,,$aprt_2,$2)=ifelse($3,yes,yes,1)" else eval "ifelse($2,,$aprt_2,$2)=ifelse($3,yes,no,0)" fi done ]) dnl APR_FLAG_FUNCS(FUNC ... [, FLAG-TO-SET] [, "yes" ]) dnl if FLAG-TO-SET is null, we automagically determine it's name dnl prepending "have_" to the function name in FUNC, otherwise dnl we use what's provided as FLAG-TO-SET. If the 3rd parameter dnl is "yes" then instead of setting to 1 or 0, we set FLAG-TO-SET dnl to yes or no. dnl AC_DEFUN([APR_FLAG_FUNCS], [ AC_CHECK_FUNCS($1) for aprt_j in $1 do aprt_3="have_$aprt_j" if eval "test \"`echo '$ac_cv_func_'$aprt_j`\" = yes"; then eval "ifelse($2,,$aprt_3,$2)=ifelse($3,yes,yes,1)" else eval "ifelse($2,,$aprt_3,$2)=ifelse($3,yes,no,0)" fi done ]) dnl Iteratively interpolate the contents of the second argument dnl until interpolation offers no new result. Then assign the dnl final result to $1. dnl dnl Example: dnl dnl foo=1 dnl bar='${foo}/2' dnl baz='${bar}/3' dnl APR_EXPAND_VAR(fraz, $baz) dnl $fraz is now "1/2/3" dnl AC_DEFUN([APR_EXPAND_VAR], [ ap_last= ap_cur="$2" while test "x${ap_cur}" != "x${ap_last}"; do ap_last="${ap_cur}" ap_cur=`eval "echo ${ap_cur}"` done $1="${ap_cur}" ]) dnl dnl Removes the value of $3 from the string in $2, strips of any leading dnl slashes, and returns the value in $1. dnl dnl Example: dnl orig_path="${prefix}/bar" dnl APR_PATH_RELATIVE(final_path, $orig_path, $prefix) dnl $final_path now contains "bar" AC_DEFUN([APR_PATH_RELATIVE], [ ap_stripped=`echo $2 | sed -e "s#^$3##"` # check if the stripping was successful if test "x$2" != "x${ap_stripped}"; then # it was, so strip of any leading slashes $1="`echo ${ap_stripped} | sed -e 's#^/*##'`" else # it wasn't so return the original $1="$2" fi ]) dnl APR_HELP_STRING(LHS, RHS) dnl Autoconf 2.50 can not handle substr correctly. It does have dnl AC_HELP_STRING, so let's try to call it if we can. dnl Note: this define must be on one line so that it can be properly returned dnl as the help string. When using this macro with a multi-line RHS, ensure dnl that you surround the macro invocation with []s AC_DEFUN([APR_HELP_STRING], [ifelse(regexp(AC_ACVERSION, 2\.1), -1, AC_HELP_STRING([$1],[$2]),[ ][$1] substr([ ],len($1))[$2])]) dnl dnl APR_LAYOUT(configlayout, layoutname [, extravars]) dnl AC_DEFUN([APR_LAYOUT], [ if test ! -f $srcdir/config.layout; then echo "** Error: Layout file $srcdir/config.layout not found" echo "** Error: Cannot use undefined layout '$LAYOUT'" exit 1 fi # Catch layout names including a slash which will otherwise # confuse the heck out of the sed script. case $2 in */*) echo "** Error: $2 is not a valid layout name" exit 1 ;; esac pldconf=./config.pld changequote({,}) sed -e "1s/[ ]*<[lL]ayout[ ]*$2[ ]*>[ ]*//;1t" \ -e "1,/[ ]*<[lL]ayout[ ]*$2[ ]*>[ ]*/d" \ -e '/[ ]*<\/Layout>[ ]*/,$d' \ -e "s/^[ ]*//g" \ -e "s/:[ ]*/=\'/g" \ -e "s/[ ]*$/'/g" \ $1 > $pldconf layout_name=$2 if test ! -s $pldconf; then echo "** Error: unable to find layout $layout_name" exit 1 fi . $pldconf rm $pldconf for var in prefix exec_prefix bindir sbindir libexecdir mandir \ sysconfdir datadir includedir localstatedir runtimedir \ logfiledir libdir installbuilddir libsuffix $3; do eval "val=\"\$$var\"" case $val in *+) val=`echo $val | sed -e 's;\+$;;'` eval "$var=\"\$val\"" autosuffix=yes ;; *) autosuffix=no ;; esac val=`echo $val | sed -e 's:\(.\)/*$:\1:'` val=`echo $val | sed -e 's:[\$]\([a-z_]*\):${\1}:g'` if test "$autosuffix" = "yes"; then if echo $val | grep apache >/dev/null; then addtarget=no else addtarget=yes fi if test "$addtarget" = "yes"; then val="$val/apache2" fi fi eval "$var='$val'" done changequote([,]) ])dnl dnl dnl APR_ENABLE_LAYOUT(default layout name [, extra vars]) dnl AC_DEFUN([APR_ENABLE_LAYOUT], [ AC_ARG_ENABLE(layout, [ --enable-layout=LAYOUT],[ LAYOUT=$enableval ]) if test -z "$LAYOUT"; then LAYOUT="$1" fi APR_LAYOUT($srcdir/config.layout, $LAYOUT, $2) AC_MSG_CHECKING(for chosen layout) AC_MSG_RESULT($layout_name) ]) dnl dnl APR_PARSE_ARGUMENTS dnl a reimplementation of autoconf's argument parser, dnl used here to allow us to co-exist layouts and argument based dnl set ups. AC_DEFUN([APR_PARSE_ARGUMENTS], [ ac_prev= # Retrieve the command-line arguments. The eval is needed because # the arguments are quoted to preserve accuracy. eval "set x $ac_configure_args" shift for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[[^=]]*=\(.*\)'` case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir="$ac_optarg" ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir="$ac_optarg" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix="$ac_optarg" ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir="$ac_optarg" ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir="$ac_optarg" ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir="$ac_optarg" ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir="$ac_optarg" ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir="$ac_optarg" ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir="$ac_optarg" ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix="$ac_optarg" ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir="$ac_optarg" ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir="$ac_optarg" ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir="$ac_optarg" ;; esac done # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [[\\/$]]* | ?:[[\\/]]* | NONE | '' ) ;; *) AC_MSG_ERROR([expected an absolute path for --$ac_var: $ac_val]);; esac done ])dnl dnl dnl APR_CHECK_DEPEND dnl dnl Determine what program we can use to generate .deps-style dependencies dnl AC_DEFUN([APR_CHECK_DEPEND], [ dnl Try to determine what depend program we can use dnl All GCC-variants should have -MM. dnl If not, then we can check on those, too. if test "$GCC" = "yes"; then MKDEP='$(CC) -MM' else rm -f conftest.c dnl should be available everywhere! cat > conftest.c < int main() { return 0; } EOF MKDEP="true" for i in "$CC -MM" "$CC -M" "$CPP -MM" "$CPP -M" "cpp -M"; do AC_MSG_CHECKING([if $i can create proper make dependencies]) if $i conftest.c 2>/dev/null | grep 'conftest.o: conftest.c' >/dev/null; then MKDEP=$i AC_MSG_RESULT(yes) break; fi AC_MSG_RESULT(no) done rm -f conftest.c fi AC_SUBST(MKDEP) ]) dnl dnl APR_CHECK_TYPES_COMPATIBLE(TYPE-1, TYPE-2, [ACTION-IF-TRUE]) dnl dnl Try to determine whether two types are the same. Only works dnl for gcc and icc. dnl AC_DEFUN([APR_CHECK_TYPES_COMPATIBLE], [ define([apr_cvname], apr_cv_typematch_[]translit([$1], [ ], [_])_[]translit([$2], [ ], [_])) AC_CACHE_CHECK([whether $1 and $2 are the same], apr_cvname, [ AC_TRY_COMPILE(AC_INCLUDES_DEFAULT, [ int foo[0 - !__builtin_types_compatible_p($1, $2)]; ], [apr_cvname=yes $3], [apr_cvname=no])]) ]) dnl -------------------------------------------------------- -*- autoconf -*- dnl Licensed to the Apache Software Foundation (ASF) under one or more dnl contributor license agreements. See the NOTICE file distributed with dnl this work for additional information regarding copyright ownership. dnl The ASF licenses this file to You under the Apache License, Version 2.0 dnl (the "License"); you may not use this file except in compliance with dnl the License. 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 custom autoconf rules for APRUTIL dnl dnl dnl APU_FIND_APR: figure out where APR is located dnl AC_DEFUN([APU_FIND_APR], [ dnl use the find_apr.m4 script to locate APR. sets apr_found and apr_config APR_FIND_APR(,,,[1]) if test "$apr_found" = "no"; then AC_MSG_ERROR(APR could not be located. Please use the --with-apr option.) fi APR_BUILD_DIR="`$apr_config --installbuilddir`" dnl make APR_BUILD_DIR an absolute directory (we'll need it in the dnl sub-projects in some cases) APR_BUILD_DIR="`cd $APR_BUILD_DIR && pwd`" APR_INCLUDES="`$apr_config --includes`" APR_LIBS="`$apr_config --link-libtool --libs`" APR_SO_EXT="`$apr_config --apr-so-ext`" APR_LIB_TARGET="`$apr_config --apr-lib-target`" AC_SUBST(APR_INCLUDES) AC_SUBST(APR_LIBS) AC_SUBST(APR_BUILD_DIR) ]) dnl dnl APU_TRY_EXPAT_LINK( dnl test-message, cache-var-name, hdrs, libs, dnl [actions-on-success], [actions-on-failure]) dnl dnl Tests linking against expat with libraries 'libs' and includes dnl 'hdrs', passing message + cache-var-name to AC_CACHE_CHECK. dnl On success, sets $expat_libs to libs, sets $apu_have_expat to 1, dnl and runs actions-on-success; on failure runs actions-on-failure. dnl AC_DEFUN([APU_TRY_EXPAT_LINK], [ AC_CACHE_CHECK([$1], [$2], [ apu_expat_LIBS=$LIBS LIBS="$LIBS $4" AC_TRY_LINK([#include #include <$3>], [XML_ParserCreate(NULL);], [$2=yes], [$2=no]) LIBS=$apu_expat_LIBS ]) if test $[$2] = yes; then AC_DEFINE([HAVE_]translit([$3], [a-z./], [A-Z__]), 1, [Define if $3 is available]) apu_expat_libs="$4" apu_has_expat=1 $5 else apu_has_expat=0 $6 fi ]) dnl dnl APU_SYSTEM_EXPAT: tests for a system expat installation dnl If present, sets $apu_has_expat to 1 and adjusts LDFLAGS/CPPFLAGS dnl appropriately. This is mostly for compatibility with existing dnl expat releases; all but the first APU_TRY_EXPAT_LINK call could dnl be dropped later. dnl AC_DEFUN([APU_SYSTEM_EXPAT], [ APU_TRY_EXPAT_LINK([Expat 1.95.x], apu_cv_expat_system, [expat.h], [-lexpat]) if test $apu_has_expat = 0; then APU_TRY_EXPAT_LINK([old Debian-packaged expat], apu_cv_expat_debian, [xmltok/xmlparse.h], [-lxmlparse -lxmltok]) fi if test $apu_has_expat = 0; then APU_TRY_EXPAT_LINK([old FreeBSD-packaged expat], apu_cv_expat_freebsd, [xml/xmlparse.h], [-lexpat]) fi if test $apu_has_expat = 0; then APU_TRY_EXPAT_LINK([Expat 1.0/1.1], apu_cv_expat_1011, [xmlparse/xmlparse.h], [-lexpat]) fi if test $apu_has_expat = 0; then APR_ADDTO(LDFLAGS, [-L/usr/local/lib]) APR_ADDTO(CPPFLAGS, [-I/usr/local/include]) APU_TRY_EXPAT_LINK([Expat 1.95.x in /usr/local], apu_cv_expat_usrlocal, [expat.h], [-lexpat], [APR_ADDTO(APRUTIL_INCLUDES, [-I/usr/local/include]) APR_ADDTO(APRUTIL_LDFLAGS, [-L/usr/local/lib])],[ APR_REMOVEFROM(LDFLAGS, [-L/usr/local/lib]) APR_REMOVEFROM(CPPFLAGS, [-I/usr/local/include]) ]) fi ]) dnl dnl APU_FIND_EXPAT: figure out where EXPAT is located dnl AC_DEFUN([APU_FIND_EXPAT], [ save_cppflags="$CPPFLAGS" save_ldflags="$LDFLAGS" apu_has_expat=0 apu_try_external_expat=1 AC_ARG_WITH([expat], [ --with-expat=DIR specify Expat location], [ if test "$withval" = "yes"; then AC_MSG_ERROR([a directory must be specified for --with-expat]) elif test "$withval" = "no"; then AC_MSG_ERROR([Expat cannot be disabled (at this time)]) else # Add given path to standard search paths if appropriate: if test "$withval" != "/usr"; then APR_ADDTO(LDFLAGS, [-L$withval/lib]) APR_ADDTO(CPPFLAGS, [-I$withval/include]) APR_ADDTO(APRUTIL_INCLUDES, [-I$withval/include]) APR_ADDTO(APRUTIL_LDFLAGS, [-L$withval/lib]) fi fi ]) if test $apu_try_external_expat = 1; then APU_SYSTEM_EXPAT fi APR_ADDTO(APRUTIL_EXPORT_LIBS, [$apu_expat_libs]) APR_ADDTO(APRUTIL_LIBS, [$apu_expat_libs]) CPPFLAGS=$save_cppflags LDFLAGS=$save_ldflags ]) dnl dnl Find a particular LDAP library dnl AC_DEFUN([APU_FIND_LDAPLIB], [ if test ${apu_has_ldap} != "1"; then ldaplib=$1 extralib=$2 # Clear the cache entry for subsequent APU_FIND_LDAPLIB invocations. changequote(,) ldaplib_cache_id="`echo $ldaplib | sed -e 's/[^a-zA-Z0-9_]/_/g'`" changequote([,]) unset ac_cv_lib_${ldaplib_cache_id}_ldap_init unset ac_cv_lib_${ldaplib_cache_id}___ldap_init AC_CHECK_LIB(${ldaplib}, ldap_init, [ LDADD_ldap_found="-l${ldaplib} ${extralib}" AC_CHECK_LIB(${ldaplib}, ldapssl_client_init, apu_has_ldapssl_client_init="1", , ${extralib}) AC_CHECK_LIB(${ldaplib}, ldapssl_client_deinit, apu_has_ldapssl_client_deinit="1", , ${extralib}) AC_CHECK_LIB(${ldaplib}, ldapssl_add_trusted_cert, apu_has_ldapssl_add_trusted_cert="1", , ${extralib}) AC_CHECK_LIB(${ldaplib}, ldap_start_tls_s, apu_has_ldap_start_tls_s="1", , ${extralib}) AC_CHECK_LIB(${ldaplib}, ldap_sslinit, apu_has_ldap_sslinit="1", , ${extralib}) AC_CHECK_LIB(${ldaplib}, ldapssl_init, apu_has_ldapssl_init="1", , ${extralib}) AC_CHECK_LIB(${ldaplib}, ldapssl_install_routines, apu_has_ldapssl_install_routines="1", , ${extralib}) apu_has_ldap="1"; ], , ${extralib}) fi ]) dnl dnl APU_FIND_LDAP: figure out where LDAP is located dnl AC_DEFUN([APU_FIND_LDAP], [ echo $ac_n "${nl}checking for ldap support..." apu_has_ldap="0"; apu_has_ldapssl_client_init="0" apu_has_ldapssl_client_deinit="0" apu_has_ldapssl_add_trusted_cert="0" apu_has_ldap_start_tls_s="0" apu_has_ldapssl_init="0" apu_has_ldap_sslinit="0" apu_has_ldapssl_install_routines="0" apu_has_ldap_openldap="0" apu_has_ldap_solaris="0" apu_has_ldap_novell="0" apu_has_ldap_microsoft="0" apu_has_ldap_netscape="0" apu_has_ldap_mozilla="0" apu_has_ldap_tivoli="0" apu_has_ldap_zos="0" apu_has_ldap_other="0" LDADD_ldap_found="" AC_ARG_WITH(lber,[ --with-lber=library lber library to use], [ if test "$withval" = "yes"; then apu_liblber_name="lber" else apu_liblber_name="$withval" fi ], [ apu_liblber_name="lber" ]) AC_ARG_WITH(ldap-include,[ --with-ldap-include=path path to ldap include files with trailing slash]) AC_ARG_WITH(ldap-lib,[ --with-ldap-lib=path path to ldap lib file]) AC_ARG_WITH(ldap,[ --with-ldap=library ldap library to use], [ if test "$with_ldap" != "no"; then save_cppflags="$CPPFLAGS" save_ldflags="$LDFLAGS" save_libs="$LIBS" if test -n "$with_ldap_include"; then CPPFLAGS="$CPPFLAGS -I$with_ldap_include" APR_ADDTO(APRUTIL_INCLUDES, [-I$with_ldap_include]) fi if test -n "$with_ldap_lib"; then LDFLAGS="$LDFLAGS -L$with_ldap_lib" APR_ADDTO(APRUTIL_LDFLAGS, [-L$with_ldap_lib]) fi LIBLDAP="$withval" if test "$LIBLDAP" = "yes"; then dnl The iPlanet C SDK 5.0 is as yet untested... APU_FIND_LDAPLIB("ldap50", "-lnspr4 -lplc4 -lplds4 -liutil50 -llber50 -lldif50 -lnss3 -lprldap50 -lssl3 -lssldap50") APU_FIND_LDAPLIB("ldapssl41", "-lnspr3 -lplc3 -lplds3") APU_FIND_LDAPLIB("ldapssl40") APU_FIND_LDAPLIB("ldapssl30") APU_FIND_LDAPLIB("ldapssl20") APU_FIND_LDAPLIB("ldapsdk", "-lldapx -lldapssl -lldapgss -lgssapi_krb5") APU_FIND_LDAPLIB("ldapsdk", "-lldapx -lldapssl -lldapgss -lgss -lresolv -lsocket") APU_FIND_LDAPLIB("ldap", "-llber") APU_FIND_LDAPLIB("ldap", "-llber -lresolv") APU_FIND_LDAPLIB("ldap", "-llber -lresolv -lsocket -lnsl") APU_FIND_LDAPLIB("ldap", "-ldl -lpthread") else APU_FIND_LDAPLIB($LIBLDAP) APU_FIND_LDAPLIB($LIBLDAP, "-lresolv") APU_FIND_LDAPLIB($LIBLDAP, "-lresolv -lsocket -lnsl") APU_FIND_LDAPLIB($LIBLDAP, "-ldl -lpthread") fi if test ${apu_has_ldap} != "1"; then AC_MSG_ERROR(could not find an LDAP library) else APR_ADDTO(LDADD_ldap, [$LDADD_ldap_found]) fi AC_CHECK_LIB($apu_liblber_name, ber_init, [APR_ADDTO(LDADD_ldap, [-l${apu_liblber_name}])]) AC_CHECK_HEADERS(lber.h, lber_h=["#include "]) # Solaris has a problem in which prevents it from # being included by itself. Check for manually, # including lber.h first. AC_CACHE_CHECK([for ldap.h], [apr_cv_hdr_ldap_h], [AC_TRY_CPP( [#ifdef HAVE_LBER_H #include #endif #include ], [apr_cv_hdr_ldap_h=yes], [apr_cv_hdr_ldap_h=no])]) if test "$apr_cv_hdr_ldap_h" = "yes"; then ldap_h=["#include "] AC_DEFINE([HAVE_LDAP_H], 1, [Defined if ldap.h is present]) fi AC_CHECK_HEADERS(ldap_ssl.h, ldap_ssl_h=["#include "]) if test "$apr_cv_hdr_ldap_h" = "yes"; then AC_CACHE_CHECK([for LDAP toolkit], [apr_cv_ldap_toolkit], [ if test "x$apr_cv_ldap_toolkit" = "x"; then AC_EGREP_CPP([OpenLDAP], [$lber_h $ldap_h LDAP_VENDOR_NAME], [apu_has_ldap_openldap="1" apr_cv_ldap_toolkit="OpenLDAP"]) fi if test "x$apr_cv_ldap_toolkit" = "x"; then AC_EGREP_CPP([Sun Microsystems Inc.], [$lber_h $ldap_h LDAP_VENDOR_NAME], [apu_has_ldap_solaris="1" apr_cv_ldap_toolkit="Solaris"]) fi if test "x$apr_cv_ldap_toolkit" = "x"; then AC_EGREP_CPP([Novell], [$lber_h $ldap_h LDAP_VENDOR_NAME], [apu_has_ldap_novell="1" apr_cv_ldap_toolkit="Novell"]) fi if test "x$apr_cv_ldap_toolkit" = "x"; then AC_EGREP_CPP([Microsoft Corporation.], [$lber_h $ldap_h LDAP_VENDOR_NAME], [apu_has_ldap_microsoft="1" apr_cv_ldap_toolkit="Microsoft"]) fi if test "x$apr_cv_ldap_toolkit" = "x"; then AC_EGREP_CPP([Netscape Communications Corp.], [$lber_h $ldap_h LDAP_VENDOR_NAME], [apu_has_ldap_netscape="1" apr_cv_ldap_toolkit="Netscape"]) fi if test "x$apr_cv_ldap_toolkit" = "x"; then AC_EGREP_CPP([mozilla.org], [$lber_h $ldap_h LDAP_VENDOR_NAME], [apu_has_ldap_mozilla="1" apr_cv_ldap_toolkit="Mozilla"]) fi if test "x$apr_cv_ldap_toolkit" = "x"; then AC_EGREP_CPP([International Business Machines], [$lber_h $ldap_h LDAP_VENDOR_NAME], [apu_has_ldap_tivoli="1" apr_cv_ldap_toolkit="Tivoli"]) fi if test "x$apr_cv_ldap_toolkit" = "x"; then case "$host" in *-ibm-os390) AC_EGREP_CPP([IBM], [$lber_h $ldap_h], [apu_has_ldap_zos="1" apr_cv_ldap_toolkit="z/OS"]) ;; esac fi if test "x$apr_cv_ldap_toolkit" = "x"; then apu_has_ldap_other="1" apr_cv_ldap_toolkit="unknown" fi ]) fi CPPFLAGS=$save_cppflags LDFLAGS=$save_ldflags LIBS=$save_libs fi ]) if test "$apu_has_ldap_openldap" = "1"; then save_cppflags="$CPPFLAGS" save_ldflags="$LDFLAGS" save_libs="$LIBS" CPPFLAGS="$CPPFLAGS $APRUTIL_INCLUDES" LDFLAGS="$LDFLAGS $APRUTIL_LDFLAGS" AC_CACHE_CHECK([style of ldap_set_rebind_proc routine], ac_cv_ldap_set_rebind_proc_style, APR_TRY_COMPILE_NO_WARNING([ #ifdef HAVE_LBER_H #include #endif #ifdef HAVE_LDAP_H #include #endif ], [ ldap_set_rebind_proc((LDAP *)0, (LDAP_REBIND_PROC *)0, (void *)0); ], ac_cv_ldap_set_rebind_proc_style=three, ac_cv_ldap_set_rebind_proc_style=two)) if test "$ac_cv_ldap_set_rebind_proc_style" = "three"; then AC_DEFINE(LDAP_SET_REBIND_PROC_THREE, 1, [Define if ldap_set_rebind_proc takes three arguments]) fi CPPFLAGS="$save_cppflags" LDFLAGS="$save_ldflags" LIBS="$save_libs" fi AC_SUBST(ldap_h) AC_SUBST(lber_h) AC_SUBST(ldap_ssl_h) AC_SUBST(apu_has_ldapssl_client_init) AC_SUBST(apu_has_ldapssl_client_deinit) AC_SUBST(apu_has_ldapssl_add_trusted_cert) AC_SUBST(apu_has_ldap_start_tls_s) AC_SUBST(apu_has_ldapssl_init) AC_SUBST(apu_has_ldap_sslinit) AC_SUBST(apu_has_ldapssl_install_routines) AC_SUBST(apu_has_ldap) AC_SUBST(apu_has_ldap_openldap) AC_SUBST(apu_has_ldap_solaris) AC_SUBST(apu_has_ldap_novell) AC_SUBST(apu_has_ldap_microsoft) AC_SUBST(apu_has_ldap_netscape) AC_SUBST(apu_has_ldap_mozilla) AC_SUBST(apu_has_ldap_tivoli) AC_SUBST(apu_has_ldap_zos) AC_SUBST(apu_has_ldap_other) AC_SUBST(LDADD_ldap) ]) dnl dnl APU_CHECK_CRYPT_R_STYLE dnl dnl Decide which of a couple of flavors of crypt_r() is necessary for dnl this platform. dnl AC_DEFUN([APU_CHECK_CRYPT_R_STYLE], [ AC_CACHE_CHECK([style of crypt_r], apr_cv_crypt_r_style, [AC_TRY_COMPILE([#include ], [CRYPTD buffer; crypt_r("passwd", "hash", &buffer);], [apr_cv_crypt_r_style=cryptd], [AC_TRY_COMPILE([#include ], [struct crypt_data buffer; crypt_r("passwd", "hash", &buffer);], [apr_cv_crypt_r_style=struct_crypt_data], [apr_cv_crypt_r_style=none])])]) if test "$apr_cv_crypt_r_style" = "cryptd"; then AC_DEFINE(CRYPT_R_CRYPTD, 1, [Define if crypt_r has uses CRYPTD]) elif test "$apr_cv_crypt_r_style" = "struct_crypt_data"; then AC_DEFINE(CRYPT_R_STRUCT_CRYPT_DATA, 1, [Define if crypt_r uses struct crypt_data]) fi ]) dnl -------------------------------------------------------- -*- autoconf -*- dnl Licensed to the Apache Software Foundation (ASF) under one or more dnl contributor license agreements. See the NOTICE file distributed with dnl this work for additional information regarding copyright ownership. dnl The ASF licenses this file to You under the Apache License, Version 2.0 dnl (the "License"); you may not use this file except in compliance with dnl the License. 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 apu-hints.m4: apr-util's autoconf macros for platform-specific hints dnl dnl We preload various configure settings depending dnl on previously obtained platform knowledge. dnl We allow all settings to be overridden from dnl the command-line. dnl dnl APU_PRELOAD dnl dnl Preload various build parameters based on outside knowledge. dnl AC_DEFUN([APU_PRELOAD], [ if test "x$apu_preload_done" != "xyes" ; then apu_preload_done="yes" echo "Applying apr-util hints file rules for $host" case "$host" in *-dec-osf*) APR_SETIFNULL(apu_crypt_threadsafe, [1]) ;; *-hp-hpux11.*) APR_SETIFNULL(apu_crypt_threadsafe, [1]) ;; *-ibm-aix4*|*-ibm-aix5.1*) APR_SETIFNULL(apu_iconv_inbuf_const, [1]) ;; *-ibm-os390) APR_SETIFNULL(apu_crypt_threadsafe, [1]) ;; *-solaris2*) APR_SETIFNULL(apu_iconv_inbuf_const, [1]) APR_SETIFNULL(apu_crypt_threadsafe, [1]) AC_SEARCH_LIBS(fdatasync, [rt posix4]) ;; *-sco3.2v5*) APR_SETIFNULL(apu_db_xtra_libs, [-lsocket]) ;; esac fi ]) dnl -------------------------------------------------------- -*- autoconf -*- dnl Licensed to the Apache Software Foundation (ASF) under one or more dnl contributor license agreements. See the NOTICE file distributed with dnl this work for additional information regarding copyright ownership. dnl The ASF licenses this file to You under the Apache License, Version 2.0 dnl (the "License"); you may not use this file except in compliance with dnl the License. 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 APU_TRY_ICONV[ IF-SUCCESS, IF-FAILURE ]: try to compile for iconv. dnl AC_DEFUN([APU_TRY_ICONV], [ AC_TRY_LINK([ #include #include ], [ iconv_t cd = iconv_open("", ""); iconv(cd, NULL, NULL, NULL, NULL); ], [$1], [$2]) ]) dnl dnl APU_FIND_ICONV: find an iconv library dnl AC_DEFUN([APU_FIND_ICONV], [ apu_iconv_dir="unknown" have_apr_iconv="0" want_iconv="1" AC_ARG_WITH(iconv,[ --with-iconv[=DIR] path to iconv installation], [ apu_iconv_dir="$withval" if test "$apu_iconv_dir" = "no"; then have_apr_iconv="0" have_iconv="0" want_iconv="0" elif test "$apu_iconv_dir" != "yes"; then if test -f "$apu_iconv_dir/include/apr-1/api_version.h"; then have_apr_iconv="1" have_iconv="0" APR_ADDTO(APRUTIL_INCLUDES,[-I$apu_iconv_dir/include/apr-1]) APR_ADDTO(APRUTIL_LIBS,[$apu_iconv_dir/lib/libapriconv-1.la]) AC_MSG_RESULT(using apr-iconv) elif test -f "$apu_iconv_dir/include/iconv.h"; then have_apr_iconv="0" have_iconv="1" APR_ADDTO(CPPFLAGS,[-I$apu_iconv_dir/include]) APR_ADDTO(LDFLAGS,[-L$apu_iconv_dir/lib]) fi fi ]) if test "$want_iconv" = "1" -a "$have_apr_iconv" != "1"; then AC_CHECK_HEADER(iconv.h, [ APU_TRY_ICONV([ have_iconv="1" ], [ APR_ADDTO(LIBS,[-liconv]) APU_TRY_ICONV([ APR_ADDTO(APRUTIL_LIBS,[-liconv]) APR_ADDTO(APRUTIL_EXPORT_LIBS,[-liconv]) have_iconv="1" ], [ have_iconv="0" ]) APR_REMOVEFROM(LIBS,[-liconv]) ]) ], [ have_iconv="0" ]) fi if test "$want_iconv" = "1" -a "$apu_iconv_dir" != "unknown"; then if test "$have_iconv" != "1"; then if test "$have_apr_iconv" != "1"; then AC_MSG_ERROR([iconv support requested, but not found]) fi fi APR_REMOVEFROM(CPPFLAGS,[-I$apu_iconv_dir/include]) APR_REMOVEFROM(LDFLAGS,[-L$apu_iconv_dir/lib]) APR_ADDTO(APRUTIL_INCLUDES,[-I$apu_iconv_dir/include]) APR_ADDTO(APRUTIL_LDFLAGS,[-L$apu_iconv_dir/lib]) fi if test "$have_iconv" = "1"; then APU_CHECK_ICONV_INBUF fi APR_FLAG_HEADERS(iconv.h langinfo.h) APR_FLAG_FUNCS(nl_langinfo) APR_CHECK_DEFINE(CODESET, langinfo.h, [CODESET defined in langinfo.h]) AC_SUBST(have_iconv) AC_SUBST(have_apr_iconv) ])dnl dnl dnl APU_CHECK_ICONV_INBUF dnl dnl Decide whether or not the inbuf parameter to iconv() is const. dnl dnl We try to compile something without const. If it fails to dnl compile, we assume that the system's iconv() has const. dnl Unfortunately, we won't realize when there was a compile dnl warning, so we allow a variable -- apu_iconv_inbuf_const -- to dnl be set in hints.m4 to specify whether or not iconv() has const dnl on this parameter. dnl AC_DEFUN([APU_CHECK_ICONV_INBUF], [ AC_MSG_CHECKING(for type of inbuf parameter to iconv) if test "x$apu_iconv_inbuf_const" = "x"; then APR_TRY_COMPILE_NO_WARNING([ #include #include ],[ iconv(0,(char **)0,(size_t *)0,(char **)0,(size_t *)0); ], apu_iconv_inbuf_const="0", apu_iconv_inbuf_const="1") fi if test "$apu_iconv_inbuf_const" = "1"; then AC_DEFINE(APU_ICONV_INBUF_CONST, 1, [Define if the inbuf parm to iconv() is const char **]) msg="const char **" else msg="char **" fi AC_MSG_RESULT([$msg]) ])dnl dnl -------------------------------------------------------- -*- autoconf -*- dnl Copyright 2006 The Apache Software Foundation or its licensors, as dnl applicable. 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 Crypto module dnl dnl dnl APU_CHECK_CRYPTO: look for crypto libraries and headers dnl AC_DEFUN([APU_CHECK_CRYPTO], [ apu_have_crypto=0 apu_have_openssl=0 apu_have_nss=0 apu_have_commoncrypto=0 old_libs="$LIBS" old_cppflags="$CPPFLAGS" old_ldflags="$LDFLAGS" AC_ARG_WITH([crypto], [APR_HELP_STRING([--with-crypto], [enable crypto support])], [ cryptolibs="openssl nss commoncrypto" if test "$withval" = "yes"; then crypto_library_enabled=0 for cryptolib in $cryptolibs; do eval v=\$with_$cryptolib if test "$v" != "" -a "$v" != "no"; then crypto_library_enabled=1 fi done if test "$crypto_library_enabled" = "0"; then for cryptolib in $cryptolibs; do eval v=\$with_$cryptolib if test "$v" != "no"; then eval with_$cryptolib=yes crypto_library_enabled=1 fi done if test "$crypto_library_enabled" = "1"; then AC_MSG_NOTICE([Crypto was requested but no crypto library was found; autodetecting possible libraries]) else AC_ERROR([Crypto was requested but all possible crypto libraries were disabled.]) fi fi APU_CHECK_CRYPTO_OPENSSL APU_CHECK_CRYPTO_NSS APU_CHECK_CRYPTO_COMMONCRYPTO dnl add checks for other varieties of ssl here if test "$apu_have_crypto" = "0"; then AC_ERROR([Crypto was requested but no crypto library could be enabled; specify the location of a crypto library using --with-openssl, --with-nss, and/or --with-commoncrypto.]) fi fi ], [ apu_have_crypto=0 ]) AC_SUBST(apu_have_crypto) ]) dnl AC_DEFUN([APU_CHECK_CRYPTO_OPENSSL], [ openssl_have_headers=0 openssl_have_libs=0 old_libs="$LIBS" old_cppflags="$CPPFLAGS" old_ldflags="$LDFLAGS" AC_ARG_WITH([openssl], [APR_HELP_STRING([--with-openssl=DIR], [specify location of OpenSSL])], [ if test "$withval" = "yes"; then AC_CHECK_HEADERS(openssl/x509.h, [openssl_have_headers=1]) AC_CHECK_LIB(crypto, EVP_CIPHER_CTX_new, AC_CHECK_LIB(ssl, SSL_accept, [openssl_have_libs=1],,-lcrypto)) if test "$openssl_have_headers" != "0" && test "$openssl_have_libs" != "0"; then apu_have_openssl=1 fi elif test "$withval" = "no"; then apu_have_openssl=0 else openssl_CPPFLAGS="-I$withval/include" openssl_LDFLAGS="-L$withval/lib " APR_ADDTO(CPPFLAGS, [$openssl_CPPFLAGS]) APR_ADDTO(LDFLAGS, [$openssl_LDFLAGS]) AC_MSG_NOTICE(checking for openssl in $withval) AC_CHECK_HEADERS(openssl/x509.h, [openssl_have_headers=1]) AC_CHECK_LIB(crypto, EVP_CIPHER_CTX_new, AC_CHECK_LIB(ssl, SSL_accept, [openssl_have_libs=1],,-lcrypto)) if test "$openssl_have_headers" != "0" && test "$openssl_have_libs" != "0"; then apu_have_openssl=1 APR_ADDTO(APRUTIL_LDFLAGS, [-L$withval/lib]) APR_ADDTO(APRUTIL_INCLUDES, [-I$withval/include]) fi AC_CHECK_DECLS([EVP_PKEY_CTX_new], [], [], [#include ]) fi ], [ apu_have_openssl=0 ]) AC_SUBST(apu_have_openssl) dnl Since we have already done the AC_CHECK_LIB tests, if we have it, dnl we know the library is there. if test "$apu_have_openssl" = "1"; then APR_ADDTO(LDADD_crypto_openssl, [$openssl_LDFLAGS -lssl -lcrypto]) apu_have_crypto=1 AC_MSG_CHECKING([for const input buffers in OpenSSL]) AC_TRY_COMPILE([#include ], [ const unsigned char * buf; unsigned char * outbuf; RSA rsa; RSA_private_decrypt(1, buf, outbuf, &rsa, RSA_PKCS1_PADDING); ], [AC_MSG_RESULT([yes])] [AC_DEFINE([CRYPTO_OPENSSL_CONST_BUFFERS], 1, [Define that OpenSSL uses const buffers])], [AC_MSG_RESULT([no])]) fi AC_SUBST(LDADD_crypto_openssl) AC_SUBST(apu_have_crypto) LIBS="$old_libs" CPPFLAGS="$old_cppflags" LDFLAGS="$old_ldflags" ]) AC_DEFUN([APU_CHECK_CRYPTO_NSS], [ nss_have_libs=0 old_libs="$LIBS" old_cppflags="$CPPFLAGS" old_ldflags="$LDFLAGS" AC_ARG_WITH([nss], [APR_HELP_STRING([--with-nss=DIR], [specify location of NSS])], [ if test "$withval" = "yes"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) if test -n "$PKG_CONFIG"; then nss_CPPFLAGS=`$PKG_CONFIG --cflags-only-I nss` nss_LDFLAGS=`$PKG_CONFIG --libs nss` APR_ADDTO(CPPFLAGS, [$nss_CPPFLAGS]) APR_ADDTO(LDFLAGS, [$nss_LDFLAGS]) fi nss_have_prerrorh=0 nss_have_nssh=0 nss_have_pk11pubh=0 AC_CHECK_HEADERS(prerror.h, [nss_have_prerrorh=1]) AC_CHECK_HEADERS(nss/nss.h nss.h, [nss_have_nssh=1]) AC_CHECK_HEADERS(nss/pk11pub.h pk11pub.h, [nss_have_pk11pubh=1]) nss_have_headers=${nss_have_prerrorh}${nss_have_nssh}${nss_have_pk11pubh} AC_CHECK_LIB(nspr4, PR_Initialize, AC_CHECK_LIB(nss3, PK11_CreatePBEV2AlgorithmID, [nss_have_libs=1],,-lnspr4)) if test "$nss_have_headers" = "111" && test "$nss_have_libs" != "0"; then apu_have_nss=1 fi elif test "$withval" = "no"; then apu_have_nss=0 elif test "x$withval" != "x"; then nss_CPPFLAGS="-I$withval/include/nss -I$withval/include/nss3 -I$withval/include/nspr -I$withval/include/nspr4 -I$withval/include -I$withval/../public" nss_LDFLAGS="-L$withval/lib " APR_ADDTO(CPPFLAGS, [$nss_CPPFLAGS]) APR_ADDTO(LDFLAGS, [$nss_LDFLAGS]) AC_MSG_NOTICE(checking for nss in $withval) nss_have_prerrorh=0 nss_have_nssh=0 nss_have_pk11pubh=0 AC_CHECK_HEADERS(prerror.h, [nss_have_prerrorh=1]) AC_CHECK_HEADERS(nss/nss.h nss.h, [nss_have_nssh=1]) AC_CHECK_HEADERS(nss/pk11pub.h pk11pub.h, [nss_have_pk11pubh=1]) nss_have_headers=${nss_have_prerrorh}${nss_have_nssh}${nss_have_pk11pubh} AC_CHECK_LIB(nspr4, PR_Initialize, AC_CHECK_LIB(nss3, PK11_CreatePBEV2AlgorithmID, [nss_have_libs=1],,-lnspr4)) if test "$nss_have_headers" = "111" && test "$nss_have_libs" != "0"; then apu_have_nss=1 fi fi if test "$apu_have_nss" != "0"; then APR_ADDTO(APRUTIL_PRIV_INCLUDES, [$nss_CPPFLAGS]) fi ], [ apu_have_nss=0 ]) AC_SUBST(apu_have_nss) dnl Since we have already done the AC_CHECK_LIB tests, if we have it, dnl we know the library is there. if test "$apu_have_nss" = "1"; then APR_ADDTO(LDADD_crypto_nss, [$nss_LDFLAGS -lnspr4 -lnss3]) apu_have_crypto=1 fi AC_SUBST(LDADD_crypto_nss) AC_SUBST(apu_have_crypto) LIBS="$old_libs" CPPFLAGS="$old_cppflags" LDFLAGS="$old_ldflags" ]) AC_DEFUN([APU_CHECK_CRYPTO_COMMONCRYPTO], [ apu_have_commoncrypto=0 commoncrypto_have_headers=0 commoncrypto_have_libs=0 old_libs="$LIBS" old_cppflags="$CPPFLAGS" old_ldflags="$LDFLAGS" AC_ARG_WITH([commoncrypto], [APR_HELP_STRING([--with-commoncrypto=DIR], [specify location of CommonCrypto])], [ if test "$withval" = "yes"; then AC_CHECK_HEADERS(CommonCrypto/CommonKeyDerivation.h, [commoncrypto_have_headers=1]) AC_CHECK_LIB(System, CCKeyDerivationPBKDF, AC_CHECK_LIB(System, CCCryptorCreate, [commoncrypto_have_libs=1],,-lcrypto)) if test "$commoncrypto_have_headers" != "0" && test "$commoncrypto_have_libs" != "0"; then apu_have_commoncrypto=1 fi elif test "$withval" = "no"; then apu_have_commoncrypto=0 else commoncrypto_CPPFLAGS="-I$withval/include" commoncrypto_LDFLAGS="-L$withval/lib " APR_ADDTO(CPPFLAGS, [$commoncrypto_CPPFLAGS]) APR_ADDTO(LDFLAGS, [$commoncrypto_LDFLAGS]) AC_MSG_NOTICE(checking for commoncrypto in $withval) AC_CHECK_HEADERS(CommonCrypto/CommonKeyDerivation.h, [commoncrypto_have_headers=1]) AC_CHECK_LIB(System, CCKeyDerivationPBKDF, AC_CHECK_LIB(System, CCCryptorCreate, [commoncrypto_have_libs=1],,-lcrypto)) if test "$commoncrypto_have_headers" != "0" && test "$commoncrypto_have_libs" != "0"; then apu_have_commoncrypto=1 APR_ADDTO(LDFLAGS, [-L$withval/lib]) APR_ADDTO(INCLUDES, [-I$withval/include]) fi fi ], [ apu_have_commoncrypto=0 ]) dnl Since we have already done the AC_CHECK_LIB tests, if we have it, dnl we know the library is there. if test "$apu_have_commoncrypto" = "1"; then apu_have_crypto=1 fi AC_SUBST(apu_have_commoncrypto) AC_SUBST(LDADD_crypto_commoncrypto) AC_SUBST(apu_have_crypto) LIBS="$old_libs" CPPFLAGS="$old_cppflags" LDFLAGS="$old_ldflags" ]) dnl dnl -------------------------------------------------------- -*- autoconf -*- dnl Licensed to the Apache Software Foundation (ASF) under one or more dnl contributor license agreements. See the NOTICE file distributed with dnl this work for additional information regarding copyright ownership. dnl The ASF licenses this file to You under the Apache License, Version 2.0 dnl (the "License"); you may not use this file except in compliance with dnl the License. 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 DBD module dnl dnl dnl APU_CHECK_DBD: compile backends for apr_dbd. dnl AC_DEFUN([APU_CHECK_DBD], [ apu_have_pgsql=0 old_libs="$LIBS" old_cppflags="$CPPFLAGS" old_ldflags="$LDFLAGS" AC_ARG_WITH([pgsql], APR_HELP_STRING([--with-pgsql=DIR], [specify PostgreSQL location]), [ if test "$withval" = "yes"; then AC_PATH_PROG([PGSQL_CONFIG],[pg_config]) if test "x$PGSQL_CONFIG" != 'x'; then pgsql_CPPFLAGS="-I`$PGSQL_CONFIG --includedir`" pgsql_LDFLAGS="-L`$PGSQL_CONFIG --libdir`" APR_ADDTO(CPPFLAGS, [$pgsql_CPPFLAGS]) APR_ADDTO(LDFLAGS, [$pgsql_LDFLAGS]) fi AC_CHECK_HEADERS(libpq-fe.h, [ AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1],[ if test "x$PGSQL_CONFIG" != 'x'; then unset ac_cv_lib_pq_PQsendQueryPrepared pgsql_LIBS="`$PGSQL_CONFIG --libs`" APR_ADDTO(LIBS, [$pgsql_LIBS]) AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1]) fi ]) ]) if test "$apu_have_pgsql" = "0"; then AC_CHECK_HEADERS(postgresql/libpq-fe.h, [ AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1],[ if test "x$PGSQL_CONFIG" != 'x'; then unset ac_cv_lib_pq_PQsendQueryPrepared pgsql_LIBS="`$PGSQL_CONFIG --libs`" APR_ADDTO(LIBS, [$pgsql_LIBS]) AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1]) fi ]) ]) fi if test "$apu_have_pgsql" != "0" && test "x$PGSQL_CONFIG" != 'x'; then APR_ADDTO(APRUTIL_PRIV_INCLUDES, [$pgsql_CPPFLAGS]) fi elif test "$withval" = "no"; then : else AC_PATH_PROG([PGSQL_CONFIG],[pg_config],,[$withval/bin]) if test "x$PGSQL_CONFIG" != 'x'; then pgsql_CPPFLAGS="-I`$PGSQL_CONFIG --includedir`" pgsql_LDFLAGS="-L`$PGSQL_CONFIG --libdir`" else pgsql_CPPFLAGS="-I$withval/include" pgsql_LDFLAGS="-L$withval/lib " fi APR_ADDTO(CPPFLAGS, [$pgsql_CPPFLAGS]) APR_ADDTO(LDFLAGS, [$pgsql_LDFLAGS]) AC_MSG_NOTICE(checking for pgsql in $withval) AC_CHECK_HEADERS(libpq-fe.h, [ AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1],[ if test "x$PGSQL_CONFIG" != 'x'; then unset ac_cv_lib_pq_PQsendQueryPrepared pgsql_LIBS="`$PGSQL_CONFIG --libs`" APR_ADDTO(LIBS, [$pgsql_LIBS]) AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1]) fi ]) ]) if test "$apu_have_pgsql" != "1"; then AC_CHECK_HEADERS(postgresql/libpq-fe.h, [ AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1],[ if test "x$PGSQL_CONFIG" != 'x'; then unset ac_cv_lib_pq_PQsendQueryPrepared pgsql_LIBS="`$PGSQL_CONFIG --libs`" APR_ADDTO(LIBS, [$pgsql_LIBS]) AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1]) fi ]) ]) fi if test "$apu_have_pgsql" != "0"; then APR_ADDTO(APRUTIL_PRIV_INCLUDES, [$pgsql_CPPFLAGS]) fi fi ], [ AC_PATH_PROG([PGSQL_CONFIG],[pg_config]) if test "x$PGSQL_CONFIG" != 'x'; then pgsql_CPPFLAGS="-I`$PGSQL_CONFIG --includedir`" pgsql_LDFLAGS="-L`$PGSQL_CONFIG --libdir`" APR_ADDTO(CPPFLAGS, [$pgsql_CPPFLAGS]) APR_ADDTO(LDFLAGS, [$pgsql_LDFLAGS]) fi AC_CHECK_HEADERS(libpq-fe.h, [ AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1],[ if test "x$PGSQL_CONFIG" != 'x'; then unset ac_cv_lib_pq_PQsendQueryPrepared pgsql_LIBS="`$PGSQL_CONFIG --libs`" APR_ADDTO(LIBS, [$pgsql_LIBS]) AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1]) fi ]) ]) if test "$apu_have_pgsql" = "0"; then AC_CHECK_HEADERS(postgresql/libpq-fe.h, [ AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1],[ if test "x$PGSQL_CONFIG" != 'x'; then unset ac_cv_lib_pq_PQsendQueryPrepared pgsql_LIBS="`$PGSQL_CONFIG --libs`" APR_ADDTO(LIBS, [$pgsql_LIBS]) AC_CHECK_LIB(pq, PQsendQueryPrepared, [apu_have_pgsql=1]) fi ]) ]) fi if test "$apu_have_pgsql" != "0" && test "x$PGSQL_CONFIG" != 'x'; then APR_ADDTO(APRUTIL_PRIV_INCLUDES, [$pgsql_CPPFLAGS]) fi ]) AC_SUBST(apu_have_pgsql) dnl Since we have already done the AC_CHECK_LIB tests, if we have it, dnl we know the library is there. if test "$apu_have_pgsql" = "1"; then APR_ADDTO(LDADD_dbd_pgsql, [$pgsql_LDFLAGS -lpq $pgsql_LIBS]) fi AC_SUBST(LDADD_dbd_pgsql) LIBS="$old_libs" CPPFLAGS="$old_cppflags" LDFLAGS="$old_ldflags" ]) dnl AC_DEFUN([APU_CHECK_DBD_MYSQL], [ apu_have_mysql=0 old_libs="$LIBS" old_cppflags="$CPPFLAGS" old_ldflags="$LDFLAGS" AC_ARG_WITH([mysql], APR_HELP_STRING([--with-mysql=DIR], [enable MySQL DBD driver]), [ if test "$withval" = "yes"; then AC_PATH_PROG([MYSQL_CONFIG],[mysql_config]) if test "x$MYSQL_CONFIG" != 'x'; then mysql_CPPFLAGS="`$MYSQL_CONFIG --include`" mysql_LDFLAGS="`$MYSQL_CONFIG --libs_r | sed -e 's/-l[[^ ]]\+//g'`" mysql_LIBS="`$MYSQL_CONFIG --libs_r`" APR_ADDTO(CPPFLAGS, [$mysql_CPPFLAGS]) APR_ADDTO(LIBS, [$mysql_LIBS]) fi AC_CHECK_HEADERS([mysql.h my_global.h my_sys.h], AC_CHECK_LIB(mysqlclient, mysql_init, [apu_have_mysql=1]), [apu_have_mysql=0; break], [#include ]) if test "$apu_have_mysql" = "0"; then AC_CHECK_HEADERS([mysql/mysql.h mysql/my_global.h mysql/my_sys.h], AC_CHECK_LIB(mysqlclient, mysql_init, [apu_have_mysql=1]), [apu_have_mysql=0; break], [#include ]) fi if test "$apu_have_mysql" != "0" && test "x$MYSQL_CONFIG" != 'x'; then APR_ADDTO(APRUTIL_PRIV_INCLUDES, [$mysql_CPPFLAGS]) fi elif test "$withval" = "no"; then : else AC_PATH_PROG([MYSQL_CONFIG],[mysql_config],,[$withval/bin]) if test "x$MYSQL_CONFIG" != 'x'; then mysql_CPPFLAGS="`$MYSQL_CONFIG --include`" mysql_LDFLAGS="`$MYSQL_CONFIG --libs_r | sed -e 's/-l[[^ ]]\+//g'`" mysql_LIBS="`$MYSQL_CONFIG --libs_r`" else mysql_CPPFLAGS="-I$withval/include" mysql_LDFLAGS="-L$withval/lib " fi APR_ADDTO(CPPFLAGS, [$mysql_CPPFLAGS]) APR_ADDTO(LDFLAGS, [$mysql_LDFLAGS]) APR_ADDTO(LIBS, [$mysql_LIBS]) AC_MSG_NOTICE(checking for mysql in $withval) AC_CHECK_HEADERS([mysql.h my_global.h my_sys.h], AC_CHECK_LIB(mysqlclient, mysql_init, [apu_have_mysql=1]), [apu_have_mysql=0; break], [#include ]) if test "$apu_have_mysql" != "1"; then AC_CHECK_HEADERS([mysql/mysql.h mysql/my_global.h mysql/my_sys.h], AC_CHECK_LIB(mysqlclient, mysql_init, [apu_have_mysql=1]), [apu_have_mysql=0; break], [#include ]) fi if test "$apu_have_mysql" != "0"; then APR_ADDTO(APRUTIL_PRIV_INCLUDES, [$mysql_CPPFLAGS]) fi fi ]) AC_SUBST(apu_have_mysql) dnl Since we have already done the AC_CHECK_LIB tests, if we have it, dnl we know the library is there. if test "$apu_have_mysql" = "1"; then APR_ADDTO(LDADD_dbd_mysql, [$mysql_LDFLAGS -lmysqlclient $mysql_LIBS]) fi AC_SUBST(LDADD_dbd_mysql) LIBS="$old_libs" CPPFLAGS="$old_cppflags" LDFLAGS="$old_ldflags" ]) dnl AC_DEFUN([APU_CHECK_DBD_SQLITE3], [ apu_have_sqlite3=0 old_libs="$LIBS" old_cppflags="$CPPFLAGS" old_ldflags="$LDFLAGS" AC_ARG_WITH([sqlite3], APR_HELP_STRING([--with-sqlite3=DIR], [enable sqlite3 DBD driver]), [ if test "$withval" = "yes"; then AC_CHECK_HEADERS(sqlite3.h, AC_CHECK_LIB(sqlite3, sqlite3_open, [apu_have_sqlite3=1])) elif test "$withval" = "no"; then : else sqlite3_CPPFLAGS="-I$withval/include" sqlite3_LDFLAGS="-L$withval/lib " APR_ADDTO(CPPFLAGS, [$sqlite3_CPPFLAGS]) APR_ADDTO(LDFLAGS, [$sqlite3_LDFLAGS]) AC_MSG_NOTICE(checking for sqlite3 in $withval) AC_CHECK_HEADERS(sqlite3.h, AC_CHECK_LIB(sqlite3, sqlite3_open, [apu_have_sqlite3=1])) if test "$apu_have_sqlite3" != "0"; then APR_ADDTO(APRUTIL_PRIV_INCLUDES, [-I$withval/include]) fi fi ], [ AC_CHECK_HEADERS(sqlite3.h, AC_CHECK_LIB(sqlite3, sqlite3_open, [apu_have_sqlite3=1])) ]) AC_SUBST(apu_have_sqlite3) dnl Since we have already done the AC_CHECK_LIB tests, if we have it, dnl we know the library is there. if test "$apu_have_sqlite3" = "1"; then APR_ADDTO(LDADD_dbd_sqlite3, [$sqlite3_LDFLAGS -lsqlite3]) fi AC_SUBST(LDADD_dbd_sqlite3) LIBS="$old_libs" CPPFLAGS="$old_cppflags" LDFLAGS="$old_ldflags" ]) dnl AC_DEFUN([APU_CHECK_DBD_SQLITE2], [ apu_have_sqlite2=0 old_libs="$LIBS" old_cppflags="$CPPFLAGS" old_ldflags="$LDFLAGS" AC_ARG_WITH([sqlite2], APR_HELP_STRING([--with-sqlite2=DIR], [enable sqlite2 DBD driver]), [ if test "$withval" = "yes"; then AC_CHECK_HEADERS(sqlite.h, AC_CHECK_LIB(sqlite, sqlite_open, [apu_have_sqlite2=1])) elif test "$withval" = "no"; then : else sqlite2_CPPFLAGS="-I$withval/include" sqlite2_LDFLAGS="-L$withval/lib " APR_ADDTO(CPPFLAGS, [$sqlite2_CPPFLAGS]) APR_ADDTO(LDFLAGS, [$sqlite2_LDFLAGS]) AC_MSG_NOTICE(checking for sqlite2 in $withval) AC_CHECK_HEADERS(sqlite.h, AC_CHECK_LIB(sqlite, sqlite_open, [apu_have_sqlite2=1])) if test "$apu_have_sqlite2" != "0"; then APR_ADDTO(APRUTIL_PRIV_INCLUDES, [-I$withval/include]) fi fi ], [ AC_CHECK_HEADERS(sqlite.h, AC_CHECK_LIB(sqlite, sqlite_open, [apu_have_sqlite2=1])) ]) AC_SUBST(apu_have_sqlite2) dnl Since we have already done the AC_CHECK_LIB tests, if we have it, dnl we know the library is there. if test "$apu_have_sqlite2" = "1"; then APR_ADDTO(LDADD_dbd_sqlite2, [$sqlite2_LDFLAGS -lsqlite]) fi AC_SUBST(LDADD_dbd_sqlite2) LIBS="$old_libs" CPPFLAGS="$old_cppflags" LDFLAGS="$old_ldflags" ]) dnl AC_DEFUN([APU_CHECK_DBD_ORACLE], [ apu_have_oracle=0 old_libs="$LIBS" old_cppflags="$CPPFLAGS" old_ldflags="$LDFLAGS" AC_ARG_WITH([oracle-include], APR_HELP_STRING([--with-oracle-include=DIR], [path to Oracle include files])) AC_ARG_WITH([oracle], APR_HELP_STRING([--with-oracle=DIR], [enable Oracle DBD driver; giving ORACLE_HOME as DIR]), [ if test "$withval" = "yes"; then if test -n "$with_oracle_include"; then oracle_CPPFLAGS="$CPPFLAGS -I$with_oracle_include" APR_ADDTO(APRUTIL_PRIV_INCLUDES, [-I$with_oracle_include]) fi APR_ADDTO(CPPFLAGS, [$oracle_CPPFLAGS]) AC_CHECK_HEADERS(oci.h, AC_CHECK_LIB(clntsh, OCIEnvCreate, [apu_have_oracle=1],[ unset ac_cv_lib_clntsh_OCIEnvCreate oracle_LIBS="-lnnz11" APR_ADDTO(LIBS, [$oracle_LIBS]) AC_CHECK_LIB(clntsh, OCIEnvCreate, [apu_have_oracle=1],[ unset ac_cv_lib_clntsh_OCIEnvCreate APR_REMOVEFROM(LIBS, [$oracle_LIBS]) oracle_LIBS="-lnnz10" APR_ADDTO(LIBS, [$oracle_LIBS]) AC_CHECK_LIB(clntsh, OCIEnvCreate, [apu_have_oracle=1]) ]) ])) elif test "$withval" = "no"; then : else if test -n "$with_oracle_include"; then oracle_CPPFLAGS="$CPPFLAGS -I$with_oracle_include" APR_ADDTO(APRUTIL_PRIV_INCLUDES, [-I$with_oracle_include]) else oracle_CPPFLAGS="-I$withval/rdbms/demo -I$withval/rdbms/public" fi oracle_LDFLAGS="-L$withval/lib " APR_ADDTO(CPPFLAGS, [$oracle_CPPFLAGS]) APR_ADDTO(LDFLAGS, [$oracle_LDFLAGS]) AC_MSG_NOTICE(checking for oracle in $withval) AC_CHECK_HEADERS(oci.h, AC_CHECK_LIB(clntsh, OCIEnvCreate, [apu_have_oracle=1],[ unset ac_cv_lib_clntsh_OCIEnvCreate oracle_LIBS="-lnnz11" APR_ADDTO(LIBS, [$oracle_LIBS]) AC_CHECK_LIB(clntsh, OCIEnvCreate, [apu_have_oracle=1],[ unset ac_cv_lib_clntsh_OCIEnvCreate APR_REMOVEFROM(LIBS, [$oracle_LIBS]) oracle_LIBS="-lnnz10" APR_ADDTO(LIBS, [$oracle_LIBS]) AC_CHECK_LIB(clntsh, OCIEnvCreate, [apu_have_oracle=1]) ]) ])) if test "$apu_have_oracle" != "0"; then oracle_LDFLAGS="$oracle_LDFLAGS -R$withval/lib" if test -z "$with_oracle_include"; then APR_ADDTO(APRUTIL_PRIV_INCLUDES, [-I$withval/rdbms/demo]) APR_ADDTO(APRUTIL_PRIV_INCLUDES, [-I$withval/rdbms/public]) fi fi fi ]) AC_SUBST(apu_have_oracle) dnl Since we have already done the AC_CHECK_LIB tests, if we have it, dnl we know the library is there. if test "$apu_have_oracle" = "1"; then APR_ADDTO(LDADD_dbd_oracle, [$oracle_LDFLAGS -lclntsh $oracle_LIBS]) fi AC_SUBST(LDADD_dbd_oracle) LIBS="$old_libs" CPPFLAGS="$old_cppflags" LDFLAGS="$old_ldflags" ]) dnl AC_DEFUN([APU_CHECK_DBD_ODBC], [ apu_have_odbc=0 old_libs="$LIBS" old_cppflags="$CPPFLAGS" old_ldflags="$LDFLAGS" AC_ARG_WITH([odbc], APR_HELP_STRING([--with-odbc=DIR], [specify ODBC location]), [ if test "$withval" = "yes"; then AC_PATH_PROG([ODBC_CONFIG],[odbc_config]) if test "x$ODBC_CONFIG" != 'x'; then odbc_CPPFLAGS="-I`$ODBC_CONFIG --include-prefix`" odbc_LDFLAGS="-L`$ODBC_CONFIG --lib-prefix`" odbc_LIBS="`$ODBC_CONFIG --libs`" APR_ADDTO(CPPFLAGS, [$odbc_CPPFLAGS]) APR_ADDTO(LDFLAGS, [$odbc_LDFLAGS]) APR_ADDTO(LIBS, [$odbc_LIBS]) fi AC_CHECK_HEADERS(sql.h, AC_CHECK_LIB(odbc, SQLAllocHandle, [apu_have_odbc=1])) if test "$apu_have_odbc" = "0"; then AC_CHECK_HEADERS(odbc/sql.h, AC_CHECK_LIB(odbc, SQLAllocHandle, [apu_have_odbc=1])) fi if test "$apu_have_odbc" != "0" && test "x$ODBC_CONFIG" != 'x'; then APR_ADDTO(APRUTIL_PRIV_INCLUDES, [$odbc_CPPFLAGS]) fi elif test "$withval" = "no"; then : else AC_PATH_PROG([ODBC_CONFIG],[odbc_config],,[$withval/bin]) if test "x$ODBC_CONFIG" != 'x'; then odbc_CPPFLAGS="-I`$ODBC_CONFIG --include-prefix`" odbc_LDFLAGS="-L`$ODBC_CONFIG --lib-prefix`" odbc_LIBS="`$ODBC_CONFIG --libs`" else if test -f "$withval" && test -x "$withval"; then odbc_CPPFLAGS="-I`$withval --include-prefix`" odbc_LDFLAGS="-L`$withval --lib-prefix`" odbc_LIBS="`$withval --libs`" else odbc_CPPFLAGS="-I$withval/include" odbc_LDFLAGS="-L$withval/lib " fi fi APR_ADDTO(CPPFLAGS, [$odbc_CPPFLAGS]) APR_ADDTO(LDFLAGS, [$odbc_LDFLAGS]) APR_ADDTO(LIBS, [$odbc_LIBS]) AC_MSG_NOTICE(checking for odbc in $withval) AC_CHECK_HEADERS(sql.h, AC_CHECK_LIB(odbc, SQLAllocHandle, [apu_have_odbc=1])) if test "$apu_have_odbc" = "0"; then AC_CHECK_HEADERS(odbc/sql.h, AC_CHECK_LIB(odbc, SQLAllocHandle, [apu_have_odbc=1])) fi if test "$apu_have_odbc" != "0" && test "x$ODBC_CONFIG" != 'x'; then APR_ADDTO(APRUTIL_PRIV_INCLUDES, [$odbc_CPPFLAGS]) fi fi ], [ AC_PATH_PROG([ODBC_CONFIG],[odbc_config]) if test "x$ODBC_CONFIG" != 'x'; then odbc_CPPFLAGS="-I`$ODBC_CONFIG --include-prefix`" odbc_LDFLAGS="-L`$ODBC_CONFIG --lib-prefix`" odbc_LIBS="`$ODBC_CONFIG --libs`" APR_ADDTO(CPPFLAGS, [$odbc_CPPFLAGS]) APR_ADDTO(LDFLAGS, [$odbc_LDFLAGS]) APR_ADDTO(LIBS, [$odbc_LIBS]) fi AC_CHECK_HEADERS(sql.h, AC_CHECK_LIB(odbc, SQLAllocHandle, [apu_have_odbc=1])) if test "$apu_have_odbc" = "0"; then AC_CHECK_HEADERS(odbc/sql.h, AC_CHECK_LIB(odbc, SQLAllocHandle, [apu_have_odbc=1])) fi if test "$apu_have_odbc" != "0" && test "x$ODBC_CONFIG" != 'x'; then APR_ADDTO(APRUTIL_PRIV_INCLUDES, [$odbc_CPPFLAGS]) fi ]) AC_SUBST(apu_have_odbc) dnl Since we have already done the AC_CHECK_LIB tests, if we have it, dnl we know the library is there. if test "$apu_have_odbc" = "1"; then APR_ADDTO(LDADD_dbd_odbc, [$odbc_LDFLAGS -lodbc $odbc_LIBS]) fi AC_SUBST(LDADD_dbd_odbc) LIBS="$old_libs" CPPFLAGS="$old_cppflags" LDFLAGS="$old_ldflags" apu_dbd_tests="" test $apu_have_oracle = 1 && apu_dbd_tests="$apu_dbd_tests oracle" test $apu_have_pgsql = 1 && apu_dbd_tests="$apu_dbd_tests pgsql" test $apu_have_mysql = 1 && apu_dbd_tests="$apu_dbd_tests mysql" test $apu_have_sqlite2 = 1 && apu_dbd_tests="$apu_dbd_tests sqlite2" test $apu_have_sqlite3 = 1 && apu_dbd_tests="$apu_dbd_tests sqlite3" test $apu_have_odbc = 1 && apu_dbd_tests="$apu_dbd_tests odbc" AC_SUBST(apu_dbd_tests) ]) dnl -------------------------------------------------------- -*- autoconf -*- dnl Licensed to the Apache Software Foundation (ASF) under one or more dnl contributor license agreements. See the NOTICE file distributed with dnl this work for additional information regarding copyright ownership. dnl The ASF licenses this file to You under the Apache License, Version 2.0 dnl (the "License"); you may not use this file except in compliance with dnl the License. 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 DBM module dnl dnl APU_LIB_BERKELEY_DB(major, minor, patch, places, headers, libnames) dnl dnl Search for a useable version of Berkeley DB in a number of dnl common places. The installed DB must be no older than the dnl version given by MAJOR, MINOR, and PATCH. All of these dnl arguments are allowed to be '-1', indicating we don't care. dnl PLACES is a list of places to search for a Berkeley DB dnl installation. HEADERS is a list of headers to try. LIBNAMES dnl is a list of names of the library to attempt to link against, dnl typically 'db' and 'db4'. dnl dnl If we find a useable version, set CPPFLAGS and LIBS as dnl appropriate, and set the shell variable `apu_have_db' to dnl `1', and apu_db_lib to the matching lib name, and apu_db_header dnl to the header to use. Otherwise, set `apu_have_db' to `0'. dnl dnl This macro also checks for the `--with-berkeley-db=PATH' flag; dnl if given, the macro will use the PATH specified, and the dnl configuration script will die if it can't find the library. If dnl the user gives the `--without-berkeley-db' flag, the entire dnl search is skipped. dnl dnl We cache the results of individual searches under particular dnl prefixes, not the overall result of whether we found Berkeley dnl DB. That way, the user can re-run the configure script with dnl different --with-berkeley-db switch values, without interference dnl from the cache. AC_DEFUN([APU_CHECK_BERKELEY_DB], [ bdb_version=$1 if test "$2" != "-1"; then bdb_version="$bdb_version.$2" if test "$3" != "-1"; then bdb_version="$bdb_version.$3" fi fi bdb_places=$4 bdb_default_search_headers=$5 bdb_default_search_lib_names=$6 apu_have_db=0 # Save the original values of the flags we tweak. apu_check_lib_save_libs="$LIBS" apu_check_lib_save_ldflags="$LDFLAGS" apu_check_lib_save_cppflags="$CPPFLAGS" # The variable `found' is the prefix under which we've found # Berkeley DB, or `not' if we haven't found it anywhere yet. found=not for bdb_place in $bdb_places; do LDFLAGS="$apu_check_lib_save_ldflags" CPPFLAGS="$apu_check_lib_save_cppflags" case "$bdb_place" in "std" ) description="the standard places" ;; *":"* ) header="`echo $bdb_place | sed -e 's/:.*$//'`" lib="`echo $bdb_place | sed -e 's/^.*://'`" CPPFLAGS="$CPPFLAGS -I$header" LDFLAGS="$LDFLAGS -L$lib" description="$header and $lib" ;; * ) if test -d $bdb_place; then LDFLAGS="$LDFLAGS -L$bdb_place/lib" CPPFLAGS="$CPPFLAGS -I$bdb_place/include" else AC_MSG_CHECKING([for Berkeley DB $bdb_version in $bdb_place]) AC_MSG_RESULT([directory not found]) continue fi description="$bdb_place" ;; esac # Since there is no AC_MSG_NOTICE in autoconf 2.13, we use this # trick to display a message instead. AC_MSG_CHECKING([for Berkeley DB $bdb_version in $description]) AC_MSG_RESULT() for bdb_libname in $bdb_default_search_lib_names; do for bdb_header in $bdb_default_search_headers; do # Clear the header cache variable for each location changequote(,) cache_id="`echo ac_cv_header_${bdb_header} \ | sed -e 's/[^a-zA-Z0-9_]/_/g'`" changequote([,]) unset $cache_id AC_CHECK_HEADER([$bdb_header], [ if test "$1" = "3" -o "$1" = "4" -o "$1" = "5" -o "$1" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of # switches. changequote(,) cache_id="`echo apu_cv_check_berkeley_db_$1_$2_$3_${bdb_header}_${bdb_libname}_in_${bdb_place} \ | sed -e 's/[^a-zA-Z0-9_]/_/g'`" changequote([,]) AC_MSG_CHECKING([for -l$bdb_libname]) dnl We can't use AC_CACHE_CHECK here, because that won't print out dnl the value of the computed cache variable properly. AC_CACHE_VAL($cache_id, [ APU_TRY_BERKELEY_DB($1, $2, $3, $bdb_header, $bdb_libname) eval "$cache_id=$apu_try_berkeley_db" ]) result="`eval echo '$'$cache_id`" AC_MSG_RESULT($result) elif test "$1" = "1"; then AC_CHECK_LIB($bdb_libname, dbopen, [result=yes], [result=no] ) elif test "$1" = "2"; then AC_CHECK_LIB($bdb_libname, db_open, [result=yes], [result=no] ) fi ], [result="no"]) # If we found it, no need to search any more. if test "$result" = "yes"; then found="$bdb_place" break fi done test "$found" != "not" && break done test "$found" != "not" && break done # Restore the original values of the flags we tweak. LDFLAGS="$apu_check_lib_save_ldflags" CPPFLAGS="$apu_check_lib_save_cppflags" case "$found" in "not") apu_have_db=0 ;; "std") apu_db_header=$bdb_header apu_db_lib=$bdb_libname apu_have_db=1 ;; *":"*) header="`echo $found | sed -e 's/:.*$//'`" lib="`echo $found | sed -e 's/^.*://'`" APR_ADDTO(APRUTIL_INCLUDES, [-I$header]) APR_ADDTO(APRUTIL_LDFLAGS, [-L$lib]) apu_db_header=$bdb_header apu_db_lib=$bdb_libname apu_have_db=1 ;; *) APR_ADDTO(APRUTIL_INCLUDES, [-I$found/include]) APR_ADDTO(APRUTIL_LDFLAGS, [-L$found/lib]) apu_db_header=$bdb_header apu_db_lib=$bdb_libname apu_have_db=1 ;; esac ]) dnl APU_TRY_BERKELEY_DB(major, minor, patch, header, libname) dnl dnl A subroutine of APU_CHECK_BERKELEY_DB. dnl dnl Check that a new-enough version of Berkeley DB is installed. dnl "New enough" means no older than the version given by MAJOR, dnl MINOR, and PATCH. The result of the test is not cached; no dnl messages are printed. Use HEADER as the header file to include. dnl Use LIBNAME as the library to link against. dnl (e.g. LIBNAME should usually be "db" or "db4".) dnl dnl Set the shell variable `apu_try_berkeley_db' to `yes' if we found dnl an appropriate version installed, or `no' otherwise. dnl dnl This macro uses the Berkeley DB library function `db_version' to dnl find the version. If the library installed doesn't have this dnl function, then this macro assumes it is too old. dnl NOTE: This is pretty messed up. It seems that the FreeBSD port of dnl Berkeley DB 4 puts the header file in /usr/local/include/db4, but the dnl database library in /usr/local/lib, as libdb4.[a|so]. There is no dnl /usr/local/include/db.h. So if you check for /usr/local first, you'll dnl get the old header file from /usr/include, and the new library from dnl /usr/local/lib. Disaster. Thus this test compares the version constants dnl in the db.h header with the ones returned by db_version(). AC_DEFUN([APU_TRY_BERKELEY_DB], [ apu_try_berkeley_db_save_libs="$LIBS" apu_check_berkeley_db_major=$1 apu_check_berkeley_db_minor=$2 apu_check_berkeley_db_patch=$3 apu_try_berkeley_db_header=$4 apu_try_berkeley_db_libname=$5 LIBS="$LIBS -l$apu_try_berkeley_db_libname" AC_TRY_RUN( [ #include #include #include <$apu_try_berkeley_db_header> main () { int major, minor, patch; db_version(&major, &minor, &patch); /* Sanity check: ensure that db.h constants actually match the db library */ if (major != DB_VERSION_MAJOR || minor != DB_VERSION_MINOR || patch != DB_VERSION_PATCH) exit (1); /* Run-time check: ensure the library claims to be the correct version. */ if ($apu_check_berkeley_db_major != -1) { if (major < $apu_check_berkeley_db_major) exit (1); if (major > $apu_check_berkeley_db_major) exit (0); } if ($apu_check_berkeley_db_minor != -1) { if (minor < $apu_check_berkeley_db_minor) exit (1); if (minor > $apu_check_berkeley_db_minor) exit (0); } if ($apu_check_berkeley_db_patch == -1 || patch >= $apu_check_berkeley_db_patch) exit (0); else exit (1); } ], [apu_try_berkeley_db=yes], [apu_try_berkeley_db=no], [apu_try_berkeley_db=yes] ) LIBS="$apu_try_berkeley_db_save_libs" ] ) dnl dnl APU_CHECK_DB1: is DB1 present? dnl dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version dnl AC_DEFUN([APU_CHECK_DB1], [ places=$1 if test -z "$places"; then places="std" fi APU_CHECK_BERKELEY_DB(1, 0, 0, "$places", "db1/db.h db.h", "db1" ) if test "$apu_have_db" = "1"; then apu_db_version=1 fi ]) dnl dnl APU_CHECK_DB185: is DB1.85 present? dnl dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version dnl dnl NB: BerkelyDB v2 and above can be compiled in 1.85 mode dnl which has a libdb not libdb1 or libdb185 AC_DEFUN([APU_CHECK_DB185], [ places=$1 if test -z "$places"; then places="std" fi APU_CHECK_BERKELEY_DB(1, -1, -1, "$places", "db_185.h", "db" ) if test "$apu_have_db" = "1"; then apu_db_version=185 fi ]) dnl dnl APU_CHECK_DB2: is DB2 present? dnl dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version dnl AC_DEFUN([APU_CHECK_DB2], [ places=$1 if test -z "$places"; then places="std" fi APU_CHECK_BERKELEY_DB(2, -1, -1, "$places", "db2/db.h db.h", "db2 db" ) if test "$apu_have_db" = "1"; then apu_db_version=2 fi ]) dnl dnl APU_CHECK_DB3: is DB3 present? dnl dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version dnl AC_DEFUN([APU_CHECK_DB3], [ places=$1 if test -z "$places"; then places="std" fi APU_CHECK_BERKELEY_DB(3, -1, -1, "$places", "db3/db.h db.h", "db3 db" ) if test "$apu_have_db" = "1"; then apu_db_version=3 fi ]) dnl dnl APU_CHECK_DBXY: is DBX.Y present? dnl dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version dnl AC_DEFUN([APU_CHECK_DBXY], [ places=$1 db_major=$2 db_minor=$3 if test -z "$places"; then places="std /usr/local /usr/local/BerkeleyDB.${db_major}.${db_minor} /boot/home/config" fi APU_CHECK_BERKELEY_DB("${db_major}", "${db_minor}", "-1", "$places", "db${db_major}${db_minor}/db.h db${db_major}/db.h db.h", "db-${db_major}.${db_minor} db${db_major}-${db_major}.${db_minor} db${db_major}${db_minor} db-${db_major} db${db_major} db" ) if test "$apu_have_db" = "1"; then apu_db_version=${db_major} fi ]) AC_DEFUN([APU_CHECK_DB], [ requested=$1 check_places=$2 case "$requested" in db) APU_CHECK_DB_ALL("$check_places") if test "$apu_have_db" = "0"; then AC_MSG_ERROR(Berkeley db requested, but not found) fi ;; db1) APU_CHECK_DB1("$check_places") if test "$apu_db_version" != "1"; then AC_MSG_ERROR(Berkeley db1 not found) fi ;; db185) APU_CHECK_DB185("$check_places") if test "$apu_db_version" != "185"; then AC_MSG_ERROR(Berkeley db185 not found) fi ;; db2) APU_CHECK_DB2("$check_places") if test "$apu_db_version" != "2"; then AC_MSG_ERROR(Berkeley db2 not found) fi ;; db3) APU_CHECK_DB3("$check_places") if test "$apu_db_version" != "3"; then AC_MSG_ERROR(Berkeley db3 not found) fi ;; db[[456]][[0-9]]) db_major=`echo "$requested" | sed -e 's/db//' -e 's/.$//'` db_minor=`echo "$requested" | sed -e 's/db//' -e 's/.//'` APU_CHECK_DBXY("$check_places", "$db_major", "$db_minor") if test "$apu_db_version" != "$db_major"; then AC_MSG_ERROR(Berkeley db$db_major not found) fi ;; db[[456]]) db_major=`echo "$requested" | sed -e 's/db//'` # Start version search at version x.9 db_minor=9 while [[ $db_minor -ge 0 ]] do APU_CHECK_DBXY("$check_places", "$db_major", "$db_minor") if test "$apu_have_db" = "1"; then break fi db_minor=`expr $db_minor - 1` done if test "$apu_db_version" != "$db_major"; then AC_MSG_ERROR(Berkeley db$db_major not found) fi ;; default) APU_CHECK_DB_ALL("$check_places") ;; esac ]) dnl dnl APU_CHECK_DB_ALL: Try all Berkeley DB versions, from 6.X to 1. dnl AC_DEFUN([APU_CHECK_DB_ALL], [ all_places=$1 # Start version search at version 6.9 db_version=69 while [[ $db_version -ge 40 ]] do db_major=`echo $db_version | sed -e 's/.$//'` db_minor=`echo $db_version | sed -e 's/.//'` APU_CHECK_DBXY("$all_places", "$db_major", "$db_minor") if test "$apu_have_db" = "1"; then break fi db_version=`expr $db_version - 1` done if test "$apu_have_db" = "0"; then APU_CHECK_DB3("$all_places") fi if test "$apu_have_db" = "0"; then APU_CHECK_DB2("$all_places") fi if test "$apu_have_db" = "0"; then APU_CHECK_DB1("$all_places") fi if test "$apu_have_db" = "0"; then APU_CHECK_DB185("$all_places") fi AC_MSG_CHECKING(for Berkeley DB) if test "$apu_have_db" = "1"; then AC_MSG_RESULT(found db$apu_db_version) else AC_MSG_RESULT(not found) fi ]) dnl dnl APU_CHECK_DBM: see what kind of DBM backend to use for apr_dbm. dnl AC_DEFUN([APU_CHECK_DBM], [ apu_use_sdbm=0 apu_use_ndbm=0 apu_use_gdbm=0 apu_use_db=0 dnl it's in our codebase apu_have_sdbm=1 apu_have_gdbm=0 apu_have_ndbm=0 apu_have_db=0 apu_db_header=db.h # default so apu_select_dbm.h is syntactically correct apu_db_version=0 # Maximum supported version announced in help string. # Although we search for all versions up to 6.9, # we should only include existing versions in our # help string. dbm_list="sdbm, gdbm, ndbm, db, db1, db185, db2, db3, db4" db_max_version=48 db_min_version=41 db_version="$db_min_version" while [[ $db_version -le $db_max_version ]] do dbm_list="$dbm_list, db$db_version" db_version=`expr $db_version + 1` done db_max_version=53 db_min_version=50 db_version="$db_min_version" while [[ $db_version -le $db_max_version ]] do dbm_list="$dbm_list, db$db_version" db_version=`expr $db_version + 1` done db_max_version=60 db_min_version=60 db_version="$db_min_version" while [[ $db_version -le $db_max_version ]] do dbm_list="$dbm_list, db$db_version" db_version=`expr $db_version + 1` done AC_ARG_WITH(dbm, [APR_HELP_STRING([--with-dbm=DBM], [choose the DBM type to use. DBM={sdbm,gdbm,ndbm,db,db1,db185,db2,db3,db4,db4X,db5X,db6X} for some X=0,...,9])], [ if test "$withval" = "yes"; then AC_MSG_ERROR([--with-dbm needs to specify a DBM type to use. One of: $dbm_list]) fi requested="$withval" ], [ requested=default ]) dnl We don't pull in GDBM unless the user asks for it, since it's GPL AC_ARG_WITH([gdbm], [APR_HELP_STRING([--with-gdbm=DIR], [enable GDBM support])], [ apu_have_gdbm=0 if test "$withval" = "yes"; then AC_CHECK_HEADER(gdbm.h, AC_CHECK_LIB(gdbm, gdbm_open, [apu_have_gdbm=1])) elif test "$withval" = "no"; then apu_have_gdbm=0 else saved_cppflags="$CPPFLAGS" saved_ldflags="$LDFLAGS" CPPFLAGS="$CPPFLAGS -I$withval/include" LDFLAGS="$LDFLAGS -L$withval/lib " AC_MSG_CHECKING(checking for gdbm in $withval) AC_CHECK_HEADER(gdbm.h, AC_CHECK_LIB(gdbm, gdbm_open, [apu_have_gdbm=1])) if test "$apu_have_gdbm" != "0"; then APR_ADDTO(APRUTIL_LDFLAGS, [-L$withval/lib]) APR_ADDTO(APRUTIL_INCLUDES, [-I$withval/include]) fi CPPFLAGS="$saved_cppflags" LDFLAGS="$saved_ldflags" fi ]) AC_ARG_WITH([ndbm], [APR_HELP_STRING([--with-ndbm=PATH], [ Find the NDBM header and library in `PATH/include' and `PATH/lib'. If PATH is of the form `HEADER:LIB', then search for header files in HEADER, and the library in LIB. If you omit the `=PATH' part completely, the configure script will search for NDBM in a number of standard places.])], [ apu_have_ndbm=0 if test "$withval" = "yes"; then AC_MSG_CHECKING(checking for ndbm in the usual places) apu_want_ndbm=1 NDBM_INC="" NDBM_LDFLAGS="" elif test "$withval" = "no"; then apu_want_ndbm=0 else apu_want_ndbm=1 case "$withval" in *":"*) NDBM_INC="-I`echo $withval |sed -e 's/:.*$//'`" NDBM_LDFLAGS="-L`echo $withval |sed -e 's/^.*://'`" AC_MSG_CHECKING(checking for ndbm includes with $NDBM_INC libs with $NDBM_LDFLAGS ) ;; *) NDBM_INC="-I$withval/include" NDBM_LDFLAGS="-L$withval/lib" AC_MSG_CHECKING(checking for ndbm includes in $withval) ;; esac fi save_cppflags="$CPPFLAGS" save_ldflags="$LDFLAGS" CPPFLAGS="$CPPFLAGS $NDBM_INC" LDFLAGS="$LDFLAGS $NDBM_LDFLAGS" dnl db_ndbm_open is what sleepcat's compatibility library actually has in it's lib if test "$apu_want_ndbm" != "0"; then AC_CHECK_HEADER(ndbm.h, AC_CHECK_LIB(c, dbm_open, [apu_have_ndbm=1;apu_ndbm_lib=c], AC_CHECK_LIB(dbm, dbm_open, [apu_have_ndbm=1;apu_ndbm_lib=dbm], AC_CHECK_LIB(db, dbm_open, [apu_have_ndbm=1;apu_ndbm_lib=db], AC_CHECK_LIB(db, __db_ndbm_open, [apu_have_ndbm=1;apu_ndbm_lib=db]) ) ) ) ) if test "$apu_have_ndbm" != "0"; then if test "$withval" != "yes"; then APR_ADDTO(APRUTIL_INCLUDES, [$NDBM_INC]) APR_ADDTO(APRUTIL_LDFLAGS, [$NDBM_LDFLAGS]) fi elif test "$withval" != "yes"; then AC_ERROR( NDBM not found in the specified directory) fi fi CPPFLAGS="$save_cppflags" LDFLAGS="$save_ldflags" ], [ dnl don't check it no one has asked us for it apu_have_ndbm=0 ]) if test -n "$apu_db_xtra_libs"; then saveddbxtralibs="$LIBS" LIBS="$apu_db_xtra_libs $LIBS" fi dnl We're going to try to find the highest version of Berkeley DB supported. dnl dnl Note that we only do this if the user requested it, since the Sleepycat dnl license is viral and requires distribution of source along with programs dnl that use it. AC_ARG_WITH([berkeley-db], [APR_HELP_STRING([--with-berkeley-db=PATH], [Find the Berkeley DB header and library in `PATH/include' and `PATH/lib'. If PATH is of the form `HEADER:LIB', then search for header files in HEADER, and the library in LIB. If you omit the `=PATH' part completely, the configure script will search for Berkeley DB in a number of standard places.])], [ if test "$withval" = "yes"; then apu_want_db=1 user_places="" elif test "$withval" = "no"; then apu_want_db=0 else apu_want_db=1 user_places="$withval" fi if test "$apu_want_db" != "0"; then APU_CHECK_DB($requested, $user_places) if test "$apu_have_db" = "0"; then AC_ERROR(Berkeley DB not found.) fi fi ]) if test -n "$apu_db_xtra_libs"; then LIBS="$saveddbxtralibs" fi case "$requested" in sdbm | gdbm | ndbm | db) eval "apu_use_$requested=1" apu_default_dbm=$requested ;; db185 | db[[123456]]) apu_use_db=1 apu_default_dbm=$requested ;; db[[456]][[0-9]]) apu_use_db=1 apu_default_dbm=`echo $requested | sed -e 's/.$//'` ;; default) dnl ### use more sophisticated DBMs for the default? apu_default_dbm="sdbm (default)" apu_use_sdbm=1 ;; *) AC_MSG_ERROR([--with-dbm=$requested is an unknown DBM type. Use one of: $dbm_list]) ;; esac dnl Yes, it'd be nice if we could collate the output in an order dnl so that the AC_MSG_CHECKING would be output before the actual dnl checks, but it isn't happening now. AC_MSG_CHECKING(for default DBM) AC_MSG_RESULT($apu_default_dbm) AC_SUBST(apu_use_sdbm) AC_SUBST(apu_use_gdbm) AC_SUBST(apu_use_ndbm) AC_SUBST(apu_use_db) AC_SUBST(apu_have_sdbm) AC_SUBST(apu_have_gdbm) AC_SUBST(apu_have_ndbm) AC_SUBST(apu_have_db) AC_SUBST(apu_db_header) AC_SUBST(apu_db_version) if test "$apu_have_db" = "1"; then APR_ADDTO(LDADD_dbm_db, [-l$apu_db_lib]) if test -n "apu_db_xtra_libs"; then APR_ADDTO(LDADD_dbm_db, [$apu_db_xtra_libs]) fi fi dnl Since we have already done the AC_CHECK_LIB tests, if we have it, dnl we know the library is there. if test "$apu_have_gdbm" = "1"; then APR_ADDTO(LDADD_dbm_gdbm, [-lgdbm]) fi if test "$apu_have_ndbm" = "1"; then APR_ADDTO(LDADD_dbm_ndbm, [-l$apu_ndbm_lib]) fi AC_SUBST(LDADD_dbm_db) AC_SUBST(LDADD_dbm_gdbm) AC_SUBST(LDADD_dbm_ndbm) ]) dnl -------------------------------------------------------- -*- autoconf -*- dnl Licensed to the Apache Software Foundation (ASF) under one or more dnl contributor license agreements. See the NOTICE file distributed with dnl this work for additional information regarding copyright ownership. dnl The ASF licenses this file to You under the Apache License, Version 2.0 dnl (the "License"); you may not use this file except in compliance with dnl the License. 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 DSO module dnl AC_DEFUN([APU_CHECK_UTIL_DSO], [ AC_ARG_ENABLE([util-dso], APR_HELP_STRING([--disable-util-dso], [disable DSO build of modular components (crypto, dbd, dbm, ldap)])) if test "$enable_util_dso" = "no"; then apu_dso_build="0" else AC_CACHE_CHECK([whether APR has DSO support], [apu_cv_aprdso], [apu_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $APR_INCLUDES" AC_EGREP_CPP([yes], [#include "apr.h" #if APR_HAS_DSO yes #endif ], [apu_cv_aprdso=yes], [apu_cv_aprdso=no]) CPPFLAGS=$apu_save_CPPFLAGS]) if test $apu_cv_aprdso = yes; then apu_dso_build=1 else apu_dso_build=0 fi fi if test "$apu_dso_build" = "0"; then # Statically link the drivers: objs= test $apu_have_openssl = 1 && objs="$objs crypto/apr_crypto_openssl.lo" test $apu_have_nss = 1 && objs="$objs crypto/apr_crypto_nss.lo" test $apu_have_commoncrypto = 1 && objs="$objs crypto/apr_crypto_commoncrypto.lo" test $apu_have_oracle = 1 && objs="$objs dbd/apr_dbd_oracle.lo" test $apu_have_pgsql = 1 && objs="$objs dbd/apr_dbd_pgsql.lo" test $apu_have_mysql = 1 && objs="$objs dbd/apr_dbd_mysql.lo" test $apu_have_sqlite2 = 1 && objs="$objs dbd/apr_dbd_sqlite2.lo" test $apu_have_sqlite3 = 1 && objs="$objs dbd/apr_dbd_sqlite3.lo" test $apu_have_odbc = 1 && objs="$objs dbd/apr_dbd_odbc.lo" test $apu_have_db = 1 && objs="$objs dbm/apr_dbm_berkeleydb.lo" test $apu_have_gdbm = 1 && objs="$objs dbm/apr_dbm_gdbm.lo" test $apu_have_ndbm = 1 && objs="$objs dbm/apr_dbm_ndbm.lo" test $apu_has_ldap = 1 && objs="$objs ldap/apr_ldap_init.lo" test $apu_has_ldap = 1 && objs="$objs ldap/apr_ldap_option.lo" test $apu_has_ldap = 1 && objs="$objs ldap/apr_ldap_rebind.lo" EXTRA_OBJECTS="$EXTRA_OBJECTS $objs" # Use libtool *.la for mysql if available if test $apu_have_mysql = 1; then for flag in $LDADD_dbd_mysql do dir=`echo $flag | grep "^-L" | sed s:-L::` if test "x$dir" != 'x'; then if test -f "$dir/libmysqlclient_r.la"; then LDADD_dbd_mysql=$dir/libmysqlclient_r.la break fi fi done fi APRUTIL_LIBS="$APRUTIL_LIBS $LDADD_crypto_openssl $LDADD_crypto_nss $LDADD_crypto_commoncrypto" APRUTIL_LIBS="$APRUTIL_LIBS $LDADD_dbd_pgsql $LDADD_dbd_sqlite2 $LDADD_dbd_sqlite3 $LDADD_dbd_oracle $LDADD_dbd_mysql $LDADD_dbd_odbc" APRUTIL_LIBS="$APRUTIL_LIBS $LDADD_dbm_db $LDADD_dbm_gdbm $LDADD_dbm_ndbm" APRUTIL_LIBS="$APRUTIL_LIBS $LDADD_ldap" APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $LDADD_crypto_openssl $LDADD_crypto_nss $LDADD_crypto_commoncrypto" APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $LDADD_dbd_pgsql $LDADD_dbd_sqlite2 $LDADD_dbd_sqlite3 $LDADD_dbd_oracle $LDADD_dbd_mysql $LDADD_dbd_odbc" APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $LDADD_dbm_db $LDADD_dbm_gdbm $LDADD_dbm_ndbm" APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $LDADD_ldap" else # Build the drivers as loadable modules: dsos= test $apu_have_openssl = 1 && dsos="$dsos crypto/apr_crypto_openssl.la" test $apu_have_nss = 1 && dsos="$dsos crypto/apr_crypto_nss.la" test $apu_have_commoncrypto = 1 && dsos="$dsos crypto/apr_crypto_commoncrypto.la" test $apu_have_oracle = 1 && dsos="$dsos dbd/apr_dbd_oracle.la" test $apu_have_pgsql = 1 && dsos="$dsos dbd/apr_dbd_pgsql.la" test $apu_have_mysql = 1 && dsos="$dsos dbd/apr_dbd_mysql.la" test $apu_have_sqlite2 = 1 && dsos="$dsos dbd/apr_dbd_sqlite2.la" test $apu_have_sqlite3 = 1 && dsos="$dsos dbd/apr_dbd_sqlite3.la" test $apu_have_odbc = 1 && dsos="$dsos dbd/apr_dbd_odbc.la" test $apu_have_db = 1 && dsos="$dsos dbm/apr_dbm_db.la" test $apu_have_gdbm = 1 && dsos="$dsos dbm/apr_dbm_gdbm.la" test $apu_have_ndbm = 1 && dsos="$dsos dbm/apr_dbm_ndbm.la" test $apu_has_ldap = 1 && dsos="$dsos ldap/apr_ldap.la" if test -n "$dsos"; then APU_MODULES="$APU_MODULES $dsos" fi fi AC_DEFINE_UNQUOTED([APU_DSO_BUILD], $apu_dso_build, [Define to 1 if modular components are built as DSOs]) ]) dnl -------------------------------------------------------- -*- autoconf -*- dnl Licensed to the Apache Software Foundation (ASF) under one or more dnl contributor license agreements. See the NOTICE file distributed with dnl this work for additional information regarding copyright ownership. dnl The ASF licenses this file to You under the Apache License, Version 2.0 dnl (the "License"); you may not use this file except in compliance with dnl the License. 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 find_apr.m4 : locate the APR include files and libraries dnl dnl This macro file can be used by applications to find and use the APR dnl library. It provides a standardized mechanism for using APR. It supports dnl embedding APR into the application source, or locating an installed dnl copy of APR. dnl dnl APR_FIND_APR(srcdir, builddir, implicit-install-check, acceptable-majors, dnl detailed-check) dnl dnl where srcdir is the location of the bundled APR source directory, or dnl empty if source is not bundled. dnl dnl where builddir is the location where the bundled APR will will be built, dnl or empty if the build will occur in the srcdir. dnl dnl where implicit-install-check set to 1 indicates if there is no dnl --with-apr option specified, we will look for installed copies. dnl dnl where acceptable-majors is a space separated list of acceptable major dnl version numbers. Often only a single major version will be acceptable. dnl If multiple versions are specified, and --with-apr=PREFIX or the dnl implicit installed search are used, then the first (leftmost) version dnl in the list that is found will be used. Currently defaults to [0 1]. dnl dnl where detailed-check is an M4 macro which sets the apr_acceptable to dnl either "yes" or "no". The macro will be invoked for each installed dnl copy of APR found, with the apr_config variable set appropriately. dnl Only installed copies of APR which are considered acceptable by dnl this macro will be considered found. If no installed copies are dnl considered acceptable by this macro, apr_found will be set to either dnl either "no" or "reconfig". dnl dnl Sets the following variables on exit: dnl dnl apr_found : "yes", "no", "reconfig" dnl dnl apr_config : If the apr-config tool exists, this refers to it. If dnl apr_found is "reconfig", then the bundled directory dnl should be reconfigured *before* using apr_config. dnl dnl Note: this macro file assumes that apr-config has been installed; it dnl is normally considered a required part of an APR installation. dnl dnl If a bundled source directory is available and needs to be (re)configured, dnl then apr_found is set to "reconfig". The caller should reconfigure the dnl (passed-in) source directory, placing the result in the build directory, dnl as appropriate. dnl dnl If apr_found is "yes" or "reconfig", then the caller should use the dnl value of apr_config to fetch any necessary build/link information. dnl AC_DEFUN([APR_FIND_APR], [ apr_found="no" if test "$target_os" = "os2-emx"; then # Scripts don't pass test -x on OS/2 TEST_X="test -f" else TEST_X="test -x" fi ifelse([$4], [], [ ifdef(AC_WARNING,AC_WARNING([$0: missing argument 4 (acceptable-majors): Defaulting to APR 0.x then APR 1.x])) acceptable_majors="0 1"], [acceptable_majors="$4"]) apr_temp_acceptable_apr_config="" for apr_temp_major in $acceptable_majors do case $apr_temp_major in 0) apr_temp_acceptable_apr_config="$apr_temp_acceptable_apr_config apr-config" ;; *) apr_temp_acceptable_apr_config="$apr_temp_acceptable_apr_config apr-$apr_temp_major-config" ;; esac done AC_MSG_CHECKING(for APR) AC_ARG_WITH(apr, [ --with-apr=PATH prefix for installed APR or the full path to apr-config], [ if test "$withval" = "no" || test "$withval" = "yes"; then AC_MSG_ERROR([--with-apr requires a directory or file to be provided]) fi for apr_temp_apr_config_file in $apr_temp_acceptable_apr_config do for lookdir in "$withval/bin" "$withval" do if $TEST_X "$lookdir/$apr_temp_apr_config_file"; then apr_config="$lookdir/$apr_temp_apr_config_file" ifelse([$5], [], [], [ apr_acceptable="yes" $5 if test "$apr_acceptable" != "yes"; then AC_MSG_WARN([Found APR in $apr_config, but we think it is considered unacceptable]) continue fi]) apr_found="yes" break 2 fi done done if test "$apr_found" != "yes" && $TEST_X "$withval" && $withval --help > /dev/null 2>&1 ; then apr_config="$withval" ifelse([$5], [], [apr_found="yes"], [ apr_acceptable="yes" $5 if test "$apr_acceptable" = "yes"; then apr_found="yes" fi]) fi dnl if --with-apr is used, it is a fatal error for its argument dnl to be invalid if test "$apr_found" != "yes"; then AC_MSG_ERROR([the --with-apr parameter is incorrect. It must specify an install prefix, a build directory, or an apr-config file.]) fi ],[ dnl If we allow installed copies, check those before using bundled copy. if test -n "$3" && test "$3" = "1"; then for apr_temp_apr_config_file in $apr_temp_acceptable_apr_config do if $apr_temp_apr_config_file --help > /dev/null 2>&1 ; then apr_config="$apr_temp_apr_config_file" ifelse([$5], [], [], [ apr_acceptable="yes" $5 if test "$apr_acceptable" != "yes"; then AC_MSG_WARN([skipped APR at $apr_config, version not acceptable]) continue fi]) apr_found="yes" break else dnl look in some standard places for lookdir in /usr /usr/local /usr/local/apr /opt/apr; do if $TEST_X "$lookdir/bin/$apr_temp_apr_config_file"; then apr_config="$lookdir/bin/$apr_temp_apr_config_file" ifelse([$5], [], [], [ apr_acceptable="yes" $5 if test "$apr_acceptable" != "yes"; then AC_MSG_WARN([skipped APR at $apr_config, version not acceptable]) continue fi]) apr_found="yes" break 2 fi done fi done fi dnl if we have not found anything yet and have bundled source, use that if test "$apr_found" = "no" && test -d "$1"; then apr_temp_abs_srcdir="`cd \"$1\" && pwd`" apr_found="reconfig" apr_bundled_major="`sed -n '/#define.*APR_MAJOR_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p' \"$1/include/apr_version.h\"`" case $apr_bundled_major in "") AC_MSG_ERROR([failed to find major version of bundled APR]) ;; 0) apr_temp_apr_config_file="apr-config" ;; *) apr_temp_apr_config_file="apr-$apr_bundled_major-config" ;; esac if test -n "$2"; then apr_config="$2/$apr_temp_apr_config_file" else apr_config="$1/$apr_temp_apr_config_file" fi fi ]) AC_MSG_RESULT($apr_found) ])