1 dnl -----------------------------------------------------------------
2 dnl apr_common.m4: APR's general-purpose autoconf macros
5 dnl APR_CONFIG_NICE(filename)
7 dnl Saves a snapshot of the configure command-line for later reuse
9 AC_DEFUN(APR_CONFIG_NICE,[
14 # Created by configure
17 if test -n "$CC"; then
18 echo "CC=\"$CC\"; export CC" >> $1
20 if test -n "$CFLAGS"; then
21 echo "CFLAGS=\"$CFLAGS\"; export CFLAGS" >> $1
23 if test -n "$CPPFLAGS"; then
24 echo "CPPFLAGS=\"$CPPFLAGS\"; export CPPFLAGS" >> $1
26 if test -n "$LDFLAGS"; then
27 echo "LDFLAGS=\"$LDFLAGS\"; export LDFLAGS" >> $1
29 if test -n "$LIBS"; then
30 echo "LIBS=\"$LIBS\"; export LIBS" >> $1
32 if test -n "$INCLUDES"; then
33 echo "INCLUDES=\"$INCLUDES\"; export INCLUDES" >> $1
35 if test -n "$NOTEST_CFLAGS"; then
36 echo "NOTEST_CFLAGS=\"$NOTEST_CFLAGS\"; export NOTEST_CFLAGS" >> $1
38 if test -n "$NOTEST_CPPFLAGS"; then
39 echo "NOTEST_CPPFLAGS=\"$NOTEST_CPPFLAGS\"; export NOTEST_CPPFLAGS" >> $1
41 if test -n "$NOTEST_LDFLAGS"; then
42 echo "NOTEST_LDFLAGS=\"$NOTEST_LDFLAGS\"; export NOTEST_LDFLAGS" >> $1
44 if test -n "$NOTEST_LIBS"; then
45 echo "NOTEST_LIBS=\"$NOTEST_LIBS\"; export NOTEST_LIBS" >> $1
48 # Retrieve command-line arguments.
49 eval "set x $[0] $ac_configure_args"
54 APR_EXPAND_VAR(arg, $arg)
55 echo "\"[$]arg\" \\" >> $1
61 dnl APR_MKDIR_P_CHECK(fallback-mkdir-p)
62 dnl checks whether mkdir -p works
63 AC_DEFUN(APR_MKDIR_P_CHECK,[
64 AC_CACHE_CHECK(for working mkdir -p, ac_cv_mkdir_p,[
65 test -d conftestdir && rm -rf conftestdir
66 mkdir -p conftestdir/somedir >/dev/null 2>&1
67 if test -d conftestdir/somedir; then
74 if test "$ac_cv_mkdir_p" = "yes"; then
82 dnl APR_SUBDIR_CONFIG(dir [, sub-package-cmdline-args, args-to-drop])
84 dnl dir: directory to find configure in
85 dnl sub-package-cmdline-args: arguments to add to the invocation (optional)
86 dnl args-to-drop: arguments to drop from the invocation (optional)
88 dnl Note: This macro relies on ac_configure_args being set properly.
90 dnl The args-to-drop argument is shoved into a case statement, so
91 dnl multiple arguments can be separated with a |.
93 dnl Note: Older versions of autoconf do not single-quote args, while 2.54+
94 dnl places quotes around every argument. So, if you want to drop the
95 dnl argument called --enable-layout, you must pass the third argument as:
96 dnl [--enable-layout=*|\'--enable-layout=*]
98 dnl Trying to optimize this is left as an exercise to the reader who wants
99 dnl to put up with more autoconf craziness. I give up.
101 AC_DEFUN(APR_SUBDIR_CONFIG, [
102 # save our work to this point; this allows the sub-package to use it
105 echo "configuring package in $1 now"
107 apr_config_subdirs="$1"
108 test -d $1 || $mkdir_p $1
109 ac_abs_srcdir=`(cd $srcdir/$1 && pwd)`
113 # A "../" for each directory in /$config_subdirs.
114 ac_dots=`echo $apr_config_subdirs|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
117 # Make the cache file pathname absolute for the subdirs
118 # required to correctly handle subdirs that might actually
120 case "$cache_file" in
121 /*) # already absolute
122 ac_sub_cache_file=$cache_file ;;
123 *) # Was relative path.
124 ac_sub_cache_file="$ac_popdir/$cache_file" ;;
127 ifelse($3, [], [apr_configure_args=$ac_configure_args],[
130 for apr_configure_arg in $ac_configure_args
132 case "$apr_configure_arg" in
136 apr_configure_args="$apr_configure_args$apr_sep'$apr_configure_arg'"
141 dnl autoconf doesn't add --silent to ac_configure_args; explicitly pass it
142 test "x$silent" = "xyes" && apr_configure_args="$apr_configure_args --silent"
144 dnl AC_CONFIG_SUBDIRS silences option warnings, emulate this for 2.62
145 apr_configure_args="--disable-option-checking $apr_configure_args"
147 dnl The eval makes quoting arguments work - specifically $2 where the
148 dnl quoting mechanisms used is "" rather than [].
150 dnl We need to execute another shell because some autoconf/shell combinations
151 dnl will choke after doing repeated APR_SUBDIR_CONFIG()s. (Namely Solaris
152 dnl and autoconf-2.54+)
153 if eval $SHELL $ac_abs_srcdir/configure $apr_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_abs_srcdir $2
155 echo "$1 configured properly"
157 echo "configure failed for $1"
163 # grab any updates from the sub-package
168 dnl APR_SAVE_THE_ENVIRONMENT(variable_name)
170 dnl Stores the variable (usually a Makefile macro) for later restoration
172 AC_DEFUN(APR_SAVE_THE_ENVIRONMENT,[
173 apr_ste_save_$1="$$1"
177 dnl APR_RESTORE_THE_ENVIRONMENT(variable_name, prefix_)
179 dnl Uses the previously saved variable content to figure out what configure
180 dnl has added to the variable, moving the new bits to prefix_variable_name
181 dnl and restoring the original variable contents. This makes it possible
182 dnl for a user to override configure when it does something stupid.
184 AC_DEFUN(APR_RESTORE_THE_ENVIRONMENT,[
185 if test "x$apr_ste_save_$1" = "x"; then
189 if test "x$apr_ste_save_$1" = "x$$1"; then
192 $2$1=`echo $$1 | sed -e "s%${apr_ste_save_$1}%%"`
193 $1="$apr_ste_save_$1"
196 echo " restoring $1 to \"$$1\""
197 echo " setting $2$1 to \"$$2$1\""
202 dnl APR_SETIFNULL(variable, value)
204 dnl Set variable iff it's currently null
206 AC_DEFUN(APR_SETIFNULL,[
207 if test -z "$$1"; then
208 echo " setting $1 to \"$2\""
214 dnl APR_SETVAR(variable, value)
216 dnl Set variable no matter what
218 AC_DEFUN(APR_SETVAR,[
219 echo " forcing $1 to \"$2\""
224 dnl APR_ADDTO(variable, value)
226 dnl Add value to variable
229 if test "x$$1" = "x"; then
230 echo " setting $1 to \"$2\""
233 apr_addto_bugger="$2"
234 for i in $apr_addto_bugger; do
235 apr_addto_duplicate="0"
237 if test "x$i" = "x$j"; then
238 apr_addto_duplicate="1"
242 if test $apr_addto_duplicate = "0"; then
243 echo " adding \"$i\" to $1"
251 dnl APR_REMOVEFROM(variable, value)
253 dnl Remove a value from a variable
255 AC_DEFUN(APR_REMOVEFROM,[
256 if test "x$$1" = "x$2"; then
263 if test "x$i" != "x$2"; then
264 apr_new_bugger="$apr_new_bugger $i"
269 if test $apr_removed = "1"; then
270 echo " removed \"$2\" from $1"
277 dnl APR_CHECK_DEFINE_FILES( symbol, header_file [header_file ...] )
279 AC_DEFUN(APR_CHECK_DEFINE_FILES,[
280 AC_CACHE_CHECK([for $1 in $2],ac_cv_define_$1,[
284 AC_EGREP_CPP(YES_IS_DEFINED, [
289 ], ac_cv_define_$1=yes)
292 if test "$ac_cv_define_$1" = "yes"; then
293 AC_DEFINE(HAVE_$1, 1, [Define if $1 is defined])
299 dnl APR_CHECK_DEFINE(symbol, header_file)
301 AC_DEFUN(APR_CHECK_DEFINE,[
302 AC_CACHE_CHECK([for $1 in $2],ac_cv_define_$1,[
303 AC_EGREP_CPP(YES_IS_DEFINED, [
308 ], ac_cv_define_$1=yes, ac_cv_define_$1=no)
310 if test "$ac_cv_define_$1" = "yes"; then
311 AC_DEFINE(HAVE_$1, 1, [Define if $1 is defined in $2])
316 dnl APR_CHECK_APR_DEFINE( symbol )
318 AC_DEFUN(APR_CHECK_APR_DEFINE,[
319 apr_old_cppflags=$CPPFLAGS
320 CPPFLAGS="$CPPFLAGS $INCLUDES"
321 AC_EGREP_CPP(YES_IS_DEFINED, [
326 ], ac_cv_define_$1=yes, ac_cv_define_$1=no)
327 CPPFLAGS=$apr_old_cppflags
330 dnl APR_CHECK_FILE(filename); set ac_cv_file_filename to
331 dnl "yes" if 'filename' is readable, else "no".
332 dnl @deprecated! - use AC_CHECK_FILE instead
333 AC_DEFUN([APR_CHECK_FILE], [
334 dnl Pick a safe variable name
335 define([apr_cvname], ac_cv_file_[]translit([$1], [./+-], [__p_]))
336 AC_CACHE_CHECK([for $1], [apr_cvname],
344 define(APR_IFALLYES,[dnl
346 for ac_spec in $1; do
347 ac_type=`echo "$ac_spec" | sed -e 's/:.*$//'`
348 ac_item=`echo "$ac_spec" | sed -e 's/^.*://'`
351 ac_item=`echo "$ac_item" | sed 'y%./+-%__p_%'`
352 ac_var="ac_cv_header_$ac_item"
355 ac_item=`echo "$ac_item" | sed 'y%./+-%__p_%'`
356 ac_var="ac_cv_file_$ac_item"
358 func ) ac_var="ac_cv_func_$ac_item" ;;
359 struct ) ac_var="ac_cv_struct_$ac_item" ;;
360 define ) ac_var="ac_cv_define_$ac_item" ;;
361 custom ) ac_var="$ac_item" ;;
363 eval "ac_val=\$$ac_var"
364 if test ".$ac_val" != .yes; then
369 if test ".$ac_rc" = .yes; then
379 define(APR_BEGIN_DECISION,[dnl
380 ac_decision_item='$1'
381 ac_decision_msg='FAILED'
386 define(APR_DECIDE,[dnl
390 ac_decision_$1_msg='$2'
394 define(APR_DECISION_OVERRIDE,[dnl
396 for ac_item in $1; do
397 eval "ac_decision_this=\$ac_decision_${ac_item}"
398 if test ".$ac_decision_this" = .yes; then
400 eval "ac_decision_msg=\$ac_decision_${ac_item}_msg"
406 define(APR_DECISION_FORCE,[dnl
408 eval "ac_decision_msg=\"\$ac_decision_${ac_decision}_msg\""
412 define(APR_END_DECISION,[dnl
413 if test ".$ac_decision" = .; then
414 echo "[$]0:Error: decision on $ac_decision_item failed" 1>&2
417 if test ".$ac_decision_msg" = .; then
418 ac_decision_msg="$ac_decision"
420 AC_DEFINE_UNQUOTED(${ac_decision_item})
421 AC_MSG_RESULT([decision on $ac_decision_item... $ac_decision_msg])
427 dnl APR_CHECK_SIZEOF_EXTENDED(INCLUDES, TYPE [, CROSS_SIZE])
429 dnl A variant of AC_CHECK_SIZEOF which allows the checking of
430 dnl sizes of non-builtin types
432 AC_DEFUN(APR_CHECK_SIZEOF_EXTENDED,
433 [changequote(<<,>>)dnl
434 dnl The name to #define
435 define(<<AC_TYPE_NAME>>, translit(sizeof_$2, [a-z *], [A-Z_P]))dnl
436 dnl The cache variable
437 define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$2, [ *],[<p>]))dnl
439 AC_MSG_CHECKING(size of $2)
440 AC_CACHE_VAL(AC_CV_NAME,
441 [AC_TRY_RUN([#include <stdio.h>
445 FILE *f=fopen("conftestval","w");
447 fprintf(f, "%d\n", sizeof($2));
449 }], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$3],,,
451 AC_MSG_RESULT($AC_CV_NAME)
452 AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The size of ]$2)
453 undefine([AC_TYPE_NAME])dnl
454 undefine([AC_CV_NAME])dnl
459 dnl APR_TRY_COMPILE_NO_WARNING(INCLUDES, FUNCTION-BODY,
460 dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
462 dnl Tries a compile test with warnings activated so that the result
463 dnl is false if the code doesn't compile cleanly.
465 AC_DEFUN(APR_TRY_COMPILE_NO_WARNING,
466 [if test "x$CFLAGS_WARN" = "x"; then
469 apr_tcnw_flags=$CFLAGS_WARN
471 if test "$ac_cv_prog_gcc" = "yes"; then
472 apr_tcnw_flags="$apr_tcnw_flags -Werror"
475 cat > conftest.$ac_ext <<EOTEST
476 #include "confdefs.h"
478 int main(int argc, const char * const *argv) {
483 if ${CC-cc} -c $CFLAGS $CPPFLAGS $apr_tcnw_flags conftest.$ac_ext 2>&AC_FD_CC ; then
484 ifelse([$3], , :, [rm -rf conftest*
487 echo "configure: failed or warning program:" >&AC_FD_CC
488 cat conftest.$ac_ext >&AC_FD_CC
489 ifelse([$4], , , [rm -rf conftest*
496 dnl APR_CHECK_STRERROR_R_RC
498 dnl Decide which style of retcode is used by this system's
499 dnl strerror_r(). It either returns int (0 for success, -1
500 dnl for failure), or it returns a pointer to the error
504 AC_DEFUN(APR_CHECK_STRERROR_R_RC,[
505 AC_MSG_CHECKING(for type of return code from strerror_r)
513 if (strerror_r(ERANGE, buf, sizeof buf) < 1) {
520 ac_cv_strerror_r_rc_int=yes ], [
521 ac_cv_strerror_r_rc_int=no ], [
522 ac_cv_strerror_r_rc_int=no ] )
523 if test "x$ac_cv_strerror_r_rc_int" = xyes; then
524 AC_DEFINE(STRERROR_R_RC_INT, 1, [Define if strerror returns int])
529 AC_MSG_RESULT([$msg])
532 dnl APR_CHECK_CRYPT_R_STYLE
534 dnl Decide which of a couple of flavors of crypt_r() is necessary for
537 AC_DEFUN(APR_CHECK_CRYPT_R_STYLE,[
538 AC_CACHE_CHECK(style of crypt_r, ac_cv_crypt_r_style,[
540 ac_cv_crypt_r_style=none
546 crypt_r("passwd", "hash", &buffer);
547 ], ac_cv_crypt_r_style=cryptd)
549 if test "$ac_cv_crypt_r_style" = "none"; then
553 struct crypt_data buffer;
554 crypt_r("passwd", "hash", &buffer);
555 ], ac_cv_crypt_r_style=struct_crypt_data)
559 if test "$ac_cv_crypt_r_style" = "cryptd"; then
560 AC_DEFINE(CRYPT_R_CRYPTD, 1, [Define if crypt_r has uses CRYPTD])
562 # if we don't combine these conditions, CRYPT_R_STRUCT_CRYPT_DATA
563 # will end up defined twice
564 if test "$ac_cv_crypt_r_style" = "struct_crypt_data"; then
565 AC_DEFINE(CRYPT_R_STRUCT_CRYPT_DATA, 1, [Define if crypt_r uses struct crypt_data])
570 dnl APR_CHECK_DIRENT_INODE
572 dnl Decide if d_fileno or d_ino are available in the dirent
573 dnl structure on this platform. Single UNIX Spec says d_ino,
574 dnl BSD uses d_fileno. Undef to find the real beast.
576 AC_DEFUN(APR_CHECK_DIRENT_INODE, [
577 AC_CACHE_CHECK([for inode member of struct dirent], apr_cv_dirent_inode, [
578 apr_cv_dirent_inode=no
580 #include <sys/types.h>
586 struct dirent de; de.d_fileno;
587 ], apr_cv_dirent_inode=d_fileno)
588 if test "$apr_cv_dirent_inode" = "no"; then
590 #include <sys/types.h>
596 struct dirent de; de.d_ino;
597 ], apr_cv_dirent_inode=d_ino)
600 if test "$apr_cv_dirent_inode" != "no"; then
601 AC_DEFINE_UNQUOTED(DIRENT_INODE, $apr_cv_dirent_inode)
606 dnl APR_CHECK_DIRENT_TYPE
608 dnl Decide if d_type is available in the dirent structure
609 dnl on this platform. Not part of the Single UNIX Spec.
610 dnl Note that this is worthless without DT_xxx macros, so
611 dnl look for one while we are at it.
613 AC_DEFUN(APR_CHECK_DIRENT_TYPE,[
614 AC_CACHE_CHECK([for file type member of struct dirent], apr_cv_dirent_type,[
615 apr_cv_dirent_type=no
617 #include <sys/types.h>
620 struct dirent de; de.d_type = DT_REG;
621 ], apr_cv_dirent_type=d_type)
623 if test "$apr_cv_dirent_type" != "no"; then
624 AC_DEFINE_UNQUOTED(DIRENT_TYPE, $apr_cv_dirent_type)
628 dnl the following is a newline, a space, a tab, and a backslash (the
629 dnl backslash is used by the shell to skip newlines, but m4 sees it;
630 dnl treat it like whitespace).
631 dnl WARNING: don't reindent these lines, or the space/tab will be lost!
632 define([apr_whitespace],[
636 dnl APR_COMMA_ARGS(ARG1 ...)
637 dnl convert the whitespace-separated arguments into comman-separated
640 dnl APR_FOREACH(CODE-BLOCK, ARG1, ARG2, ...)
641 dnl subsitute CODE-BLOCK for each ARG[i]. "eachval" will be set to ARG[i]
642 dnl within each iteration.
645 define({APR_COMMA_ARGS},{patsubst([$}{1],[[}apr_whitespace{]+],[,])})
646 define({APR_FOREACH},
649 $}{2)$}{1[]APR_FOREACH([$}{1],
651 builtin([shift], $}{@)))])})
654 dnl APR_FLAG_HEADERS(HEADER-FILE ... [, FLAG-TO-SET ] [, "yes" ])
655 dnl we set FLAG-TO-SET to 1 if we find HEADER-FILE, otherwise we set to 0
656 dnl if FLAG-TO-SET is null, we automagically determine it's name
657 dnl by changing all "/" to "_" in the HEADER-FILE and dropping
658 dnl all "." and "-" chars. If the 3rd parameter is "yes" then instead of
659 dnl setting to 1 or 0, we set FLAG-TO-SET to yes or no.
661 AC_DEFUN(APR_FLAG_HEADERS,[
665 ac_safe=`echo "$aprt_i" | sed 'y%./+-%__p_%'`
666 aprt_2=`echo "$aprt_i" | sed -e 's%/%_%g' -e 's/\.//g' -e 's/-//g'`
667 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
668 eval "ifelse($2,,$aprt_2,$2)=ifelse($3,yes,yes,1)"
670 eval "ifelse($2,,$aprt_2,$2)=ifelse($3,yes,no,0)"
675 dnl APR_FLAG_FUNCS(FUNC ... [, FLAG-TO-SET] [, "yes" ])
676 dnl if FLAG-TO-SET is null, we automagically determine it's name
677 dnl prepending "have_" to the function name in FUNC, otherwise
678 dnl we use what's provided as FLAG-TO-SET. If the 3rd parameter
679 dnl is "yes" then instead of setting to 1 or 0, we set FLAG-TO-SET
682 AC_DEFUN(APR_FLAG_FUNCS,[
686 aprt_3="have_$aprt_j"
687 if eval "test \"`echo '$ac_cv_func_'$aprt_j`\" = yes"; then
688 eval "ifelse($2,,$aprt_3,$2)=ifelse($3,yes,yes,1)"
690 eval "ifelse($2,,$aprt_3,$2)=ifelse($3,yes,no,0)"
695 dnl Iteratively interpolate the contents of the second argument
696 dnl until interpolation offers no new result. Then assign the
697 dnl final result to $1.
704 dnl APR_EXPAND_VAR(fraz, $baz)
705 dnl $fraz is now "1/2/3"
707 AC_DEFUN(APR_EXPAND_VAR,[
710 while test "x${ap_cur}" != "x${ap_last}";
713 ap_cur=`eval "echo ${ap_cur}"`
719 dnl Removes the value of $3 from the string in $2, strips of any leading
720 dnl slashes, and returns the value in $1.
723 dnl orig_path="${prefix}/bar"
724 dnl APR_PATH_RELATIVE(final_path, $orig_path, $prefix)
725 dnl $final_path now contains "bar"
726 AC_DEFUN(APR_PATH_RELATIVE,[
727 ap_stripped=`echo $2 | sed -e "s#^$3##"`
728 # check if the stripping was successful
729 if test "x$2" != "x${ap_stripped}"; then
730 # it was, so strip of any leading slashes
731 $1="`echo ${ap_stripped} | sed -e 's#^/*##'`"
733 # it wasn't so return the original
738 dnl APR_HELP_STRING(LHS, RHS)
739 dnl Autoconf 2.50 can not handle substr correctly. It does have
740 dnl AC_HELP_STRING, so let's try to call it if we can.
741 dnl Note: this define must be on one line so that it can be properly returned
742 dnl as the help string. When using this macro with a multi-line RHS, ensure
743 dnl that you surround the macro invocation with []s
744 AC_DEFUN(APR_HELP_STRING,[ifelse(regexp(AC_ACVERSION, 2\.1), -1, AC_HELP_STRING([$1],[$2]),[ ][$1] substr([ ],len($1))[$2])])
747 dnl APR_LAYOUT(configlayout, layoutname [, extravars])
749 AC_DEFUN(APR_LAYOUT,[
750 if test ! -f $srcdir/config.layout; then
751 echo "** Error: Layout file $srcdir/config.layout not found"
752 echo "** Error: Cannot use undefined layout '$LAYOUT'"
757 sed -e "1s/[ ]*<[lL]ayout[ ]*$2[ ]*>[ ]*//;1t" \
758 -e "1,/[ ]*<[lL]ayout[ ]*$2[ ]*>[ ]*/d" \
759 -e '/[ ]*<\/Layout>[ ]*/,$d' \
765 if test ! -s $pldconf; then
766 echo "** Error: unable to find layout $layout_name"
771 for var in prefix exec_prefix bindir sbindir libexecdir mandir \
772 sysconfdir datadir includedir localstatedir runtimedir \
773 logfiledir libdir installbuilddir libsuffix $3; do
774 eval "val=\"\$$var\""
777 val=`echo $val | sed -e 's;\+$;;'`
778 eval "$var=\"\$val\""
785 val=`echo $val | sed -e 's:\(.\)/*$:\1:'`
786 val=`echo $val | sed -e 's:[\$]\([a-z_]*\):${\1}:g'`
787 if test "$autosuffix" = "yes"; then
788 if echo $val | grep apache >/dev/null; then
793 if test "$addtarget" = "yes"; then
803 dnl APR_ENABLE_LAYOUT(default layout name [, extra vars])
805 AC_DEFUN(APR_ENABLE_LAYOUT,[
806 AC_ARG_ENABLE(layout,
807 [ --enable-layout=LAYOUT],[
811 if test -z "$LAYOUT"; then
814 APR_LAYOUT($srcdir/config.layout, $LAYOUT, $2)
816 AC_MSG_CHECKING(for chosen layout)
817 AC_MSG_RESULT($layout_name)
822 dnl APR_PARSE_ARGUMENTS
823 dnl a reimplementation of autoconf's argument parser,
824 dnl used here to allow us to co-exist layouts and argument based
826 AC_DEFUN(APR_PARSE_ARGUMENTS,[
828 # Retrieve the command-line arguments. The eval is needed because
829 # the arguments are quoted to preserve accuracy.
830 eval "set x $ac_configure_args"
834 # If the previous option needs an argument, assign it.
835 if test -n "$ac_prev"; then
836 eval "$ac_prev=\$ac_option"
841 ac_optarg=`expr "x$ac_option" : 'x[[^=]]*=\(.*\)'`
845 -bindir | --bindir | --bindi | --bind | --bin | --bi)
847 -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
848 bindir="$ac_optarg" ;;
850 -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
852 -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
854 datadir="$ac_optarg" ;;
856 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
857 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
858 | --exec | --exe | --ex)
859 ac_prev=exec_prefix ;;
860 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
861 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
862 | --exec=* | --exe=* | --ex=*)
863 exec_prefix="$ac_optarg" ;;
865 -includedir | --includedir | --includedi | --included | --include \
866 | --includ | --inclu | --incl | --inc)
867 ac_prev=includedir ;;
868 -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
869 | --includ=* | --inclu=* | --incl=* | --inc=*)
870 includedir="$ac_optarg" ;;
872 -infodir | --infodir | --infodi | --infod | --info | --inf)
874 -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
875 infodir="$ac_optarg" ;;
877 -libdir | --libdir | --libdi | --libd)
879 -libdir=* | --libdir=* | --libdi=* | --libd=*)
880 libdir="$ac_optarg" ;;
882 -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
883 | --libexe | --libex | --libe)
884 ac_prev=libexecdir ;;
885 -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
886 | --libexe=* | --libex=* | --libe=*)
887 libexecdir="$ac_optarg" ;;
889 -localstatedir | --localstatedir | --localstatedi | --localstated \
890 | --localstate | --localstat | --localsta | --localst \
891 | --locals | --local | --loca | --loc | --lo)
892 ac_prev=localstatedir ;;
893 -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
894 | --localstate=* | --localstat=* | --localsta=* | --localst=* \
895 | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
896 localstatedir="$ac_optarg" ;;
898 -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
900 -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
901 mandir="$ac_optarg" ;;
903 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
905 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
906 prefix="$ac_optarg" ;;
908 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
910 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
912 sbindir="$ac_optarg" ;;
914 -sharedstatedir | --sharedstatedir | --sharedstatedi \
915 | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
916 | --sharedst | --shareds | --shared | --share | --shar \
918 ac_prev=sharedstatedir ;;
919 -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
920 | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
921 | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
923 sharedstatedir="$ac_optarg" ;;
925 -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
926 | --syscon | --sysco | --sysc | --sys | --sy)
927 ac_prev=sysconfdir ;;
928 -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
929 | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
930 sysconfdir="$ac_optarg" ;;
935 # Be sure to have absolute paths.
936 for ac_var in exec_prefix prefix
938 eval ac_val=$`echo $ac_var`
940 [[\\/$]]* | ?:[[\\/]]* | NONE | '' ) ;;
941 *) AC_MSG_ERROR([expected an absolute path for --$ac_var: $ac_val]);;
950 dnl Determine what program we can use to generate .deps-style dependencies
952 AC_DEFUN(APR_CHECK_DEPEND,[
953 dnl Try to determine what depend program we can use
954 dnl All GCC-variants should have -MM.
955 dnl If not, then we can check on those, too.
956 if test "$GCC" = "yes"; then
960 dnl <sys/types.h> should be available everywhere!
961 cat > conftest.c <<EOF
962 #include <sys/types.h>
963 int main() { return 0; }
966 for i in "$CC -MM" "$CC -M" "$CPP -MM" "$CPP -M" "cpp -M"; do
967 AC_MSG_CHECKING([if $i can create proper make dependencies])
968 if $i conftest.c 2>/dev/null | grep 'conftest.o: conftest.c' >/dev/null; then
982 dnl APR_CHECK_TYPES_COMPATIBLE(TYPE-1, TYPE-2, [ACTION-IF-TRUE])
984 dnl Try to determine whether two types are the same. Only works
987 AC_DEFUN([APR_CHECK_TYPES_COMPATIBLE], [
988 define([apr_cvname], apr_cv_typematch_[]translit([$1], [ ], [_])_[]translit([$2], [ ], [_]))
989 AC_CACHE_CHECK([whether $1 and $2 are the same], apr_cvname, [
990 AC_TRY_COMPILE(AC_INCLUDES_DEFAULT, [
991 int foo[0 - !__builtin_types_compatible_p($1, $2)];
992 ], [apr_cvname=yes $3], [apr_cvname=no])])