1 dnl AC_VALIDATE_CACHE_SYSTEM_TYPE[(cmd)]
2 dnl if the cache file is inconsistent with the current host,
3 dnl target and build system types, execute CMD or print a default
5 AC_DEFUN(AC_VALIDATE_CACHE_SYSTEM_TYPE, [
6 AC_REQUIRE([AC_CANONICAL_SYSTEM])
7 AC_MSG_CHECKING([config.cache system type])
8 if { test x"${ac_cv_host_system_type+set}" = x"set" &&
9 test x"$ac_cv_host_system_type" != x"$host"; } ||
10 { test x"${ac_cv_build_system_type+set}" = x"set" &&
11 test x"$ac_cv_build_system_type" != x"$build"; } ||
12 { test x"${ac_cv_target_system_type+set}" = x"set" &&
13 test x"$ac_cv_target_system_type" != x"$target"; }; then
14 AC_MSG_RESULT([different])
16 [AC_MSG_ERROR(["you must remove config.cache and restart configure"])])
20 ac_cv_host_system_type="$host"
21 ac_cv_build_system_type="$build"
22 ac_cv_target_system_type="$target"
26 dnl test whether dirent has a d_off member
27 AC_DEFUN(AC_DIRENT_D_OFF,
28 [AC_CACHE_CHECK([for d_off in dirent], ac_cv_dirent_d_off,
31 #include <sys/types.h>
32 #include <dirent.h>], [struct dirent d; d.d_off;],
33 ac_cv_dirent_d_off=yes, ac_cv_dirent_d_off=no)])
34 if test $ac_cv_dirent_d_off = yes; then
35 AC_DEFINE(HAVE_DIRENT_D_OFF,1,[Whether dirent has a d_off member])
39 dnl Mark specified module as shared
40 dnl SMB_MODULE(name,static_files,shared_files,subsystem,whatif-static,whatif-shared)
43 AC_MSG_CHECKING([how to build $1])
44 if test "$[MODULE_][$1]"; then
46 elif test "$[MODULE_]translit([$4], [A-Z], [a-z])" -a "$[MODULE_DEFAULT_][$1]"; then
47 DEST=$[MODULE_]translit([$4], [A-Z], [a-z])
49 DEST=$[MODULE_DEFAULT_][$1]
52 if test x"$DEST" = xSHARED; then
53 AC_DEFINE([$1][_init], [init_module], [Whether to build $1 as shared module])
54 $4_MODULES="$$4_MODULES $3"
55 AC_MSG_RESULT([shared])
57 elif test x"$DEST" = xSTATIC; then
58 [init_static_modules_]translit([$4], [A-Z], [a-z])="$[init_static_modules_]translit([$4], [A-Z], [a-z]) $1_init();"
59 string_static_modules="$string_static_modules $1"
60 $4_STATIC="$$4_STATIC $2"
63 AC_MSG_RESULT([static])
69 AC_DEFUN(SMB_SUBSYSTEM,
73 AC_DEFINE_UNQUOTED([static_init_]translit([$1], [A-Z], [a-z]), [{$init_static_modules_]translit([$1], [A-Z], [a-z])[}], [Static init functions])
76 dnl AC_PROG_CC_FLAG(flag)
77 AC_DEFUN(AC_PROG_CC_FLAG,
78 [AC_CACHE_CHECK(whether ${CC-cc} accepts -$1, ac_cv_prog_cc_$1,
79 [echo 'void f(){}' > conftest.c
80 if test -z "`${CC-cc} -$1 -c conftest.c 2>&1`"; then
88 dnl see if a declaration exists for a function or variable
89 dnl defines HAVE_function_DECL if it exists
90 dnl AC_HAVE_DECL(var, includes)
91 AC_DEFUN(AC_HAVE_DECL,
93 AC_CACHE_CHECK([for $1 declaration],ac_cv_have_$1_decl,[
94 AC_TRY_COMPILE([$2],[int i = (int)$1],
95 ac_cv_have_$1_decl=yes,ac_cv_have_$1_decl=no)])
96 if test x"$ac_cv_have_$1_decl" = x"yes"; then
97 AC_DEFINE([HAVE_]translit([$1], [a-z], [A-Z])[_DECL],1,[Whether $1() is available])
102 dnl check for a function in a library, but don't
103 dnl keep adding the same library to the LIBS variable.
104 dnl AC_LIBTESTFUNC(lib,func)
105 AC_DEFUN(AC_LIBTESTFUNC,
107 *-l$1*) AC_CHECK_FUNCS($2) ;;
108 *) AC_CHECK_LIB($1, $2)
114 dnl Define an AC_DEFINE with ifndef guard.
115 dnl AC_N_DEFINE(VARIABLE [, VALUE])
117 [cat >> confdefs.h <<\EOF
119 [#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1)
125 dnl AC_ADD_INCLUDE(VARIABLE)
126 define(AC_ADD_INCLUDE,
127 [cat >> confdefs.h <<\EOF
132 dnl Copied from libtool.m4
133 AC_DEFUN(AC_PROG_LD_GNU,
134 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
135 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
136 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
137 ac_cv_prog_gnu_ld=yes
143 # Configure paths for LIBXML2
144 # Toshio Kuratomi 2001-04-21
146 # Configure paths for GLIB
147 # Owen Taylor 97-11-3
149 dnl AM_PATH_XML2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
150 dnl Test for XML, and define XML_CFLAGS and XML_LIBS
152 AC_DEFUN(AM_PATH_XML2,[
153 AC_ARG_WITH(xml-prefix,
154 [ --with-xml-prefix=PFX Prefix where libxml is installed (optional)],
155 xml_config_prefix="$withval", xml_config_prefix="")
156 AC_ARG_WITH(xml-exec-prefix,
157 [ --with-xml-exec-prefix=PFX Exec prefix where libxml is installed (optional)],
158 xml_config_exec_prefix="$withval", xml_config_exec_prefix="")
159 AC_ARG_ENABLE(xmltest,
160 [ --disable-xmltest Do not try to compile and run a test LIBXML program],,
163 if test x$xml_config_exec_prefix != x ; then
164 xml_config_args="$xml_config_args --exec-prefix=$xml_config_exec_prefix"
165 if test x${XML2_CONFIG+set} != xset ; then
166 XML2_CONFIG=$xml_config_exec_prefix/bin/xml2-config
169 if test x$xml_config_prefix != x ; then
170 xml_config_args="$xml_config_args --prefix=$xml_config_prefix"
171 if test x${XML2_CONFIG+set} != xset ; then
172 XML2_CONFIG=$xml_config_prefix/bin/xml2-config
176 AC_PATH_PROG(XML2_CONFIG, xml2-config, no)
177 min_xml_version=ifelse([$1], ,2.0.0,[$1])
178 AC_MSG_CHECKING(for libxml - version >= $min_xml_version)
180 if test "$XML2_CONFIG" = "no" ; then
183 XML_CFLAGS=`$XML2_CONFIG $xml_config_args --cflags`
184 XML_LIBS=`$XML2_CONFIG $xml_config_args --libs`
185 xml_config_major_version=`$XML2_CONFIG $xml_config_args --version | \
186 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
187 xml_config_minor_version=`$XML2_CONFIG $xml_config_args --version | \
188 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
189 xml_config_micro_version=`$XML2_CONFIG $xml_config_args --version | \
190 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
191 if test "x$enable_xmltest" = "xyes" ; then
192 ac_save_CFLAGS="$CFLAGS"
194 CFLAGS="$CFLAGS $XML_CFLAGS"
195 LIBS="$XML_LIBS $LIBS"
197 dnl Now check if the installed libxml is sufficiently new.
198 dnl (Also sanity checks the results of xml2-config to some extent)
205 #include <libxml/xmlversion.h>
210 int xml_major_version, xml_minor_version, xml_micro_version;
211 int major, minor, micro;
214 system("touch conf.xmltest");
216 /* Capture xml2-config output via autoconf/configure variables */
217 /* HP/UX 9 (%@#!) writes to sscanf strings */
218 tmp_version = (char *)strdup("$min_xml_version");
219 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
220 printf("%s, bad version string from xml2-config\n", "$min_xml_version");
225 /* Capture the version information from the header files */
226 tmp_version = (char *)strdup(LIBXML_DOTTED_VERSION);
227 if (sscanf(tmp_version, "%d.%d.%d", &xml_major_version, &xml_minor_version, &xml_micro_version) != 3) {
228 printf("%s, bad version string from libxml includes\n", "LIBXML_DOTTED_VERSION");
233 /* Compare xml2-config output to the libxml headers */
234 if ((xml_major_version != $xml_config_major_version) ||
235 (xml_minor_version != $xml_config_minor_version) ||
236 (xml_micro_version != $xml_config_micro_version))
238 printf("*** libxml header files (version %d.%d.%d) do not match\n",
239 xml_major_version, xml_minor_version, xml_micro_version);
240 printf("*** xml2-config (version %d.%d.%d)\n",
241 $xml_config_major_version, $xml_config_minor_version, $xml_config_micro_version);
244 /* Compare the headers to the library to make sure we match */
245 /* Less than ideal -- doesn't provide us with return value feedback,
246 * only exits if there's a serious mismatch between header and library.
250 /* Test that the library is greater than our minimum version */
251 if ((xml_major_version > major) ||
252 ((xml_major_version == major) && (xml_minor_version > minor)) ||
253 ((xml_major_version == major) && (xml_minor_version == minor) &&
254 (xml_micro_version >= micro)))
260 printf("\n*** An old version of libxml (%d.%d.%d) was found.\n",
261 xml_major_version, xml_minor_version, xml_micro_version);
262 printf("*** You need a version of libxml newer than %d.%d.%d. The latest version of\n",
263 major, minor, micro);
264 printf("*** libxml is always available from ftp://ftp.xmlsoft.org.\n");
266 printf("*** If you have already installed a sufficiently new version, this error\n");
267 printf("*** probably means that the wrong copy of the xml2-config shell script is\n");
268 printf("*** being found. The easiest way to fix this is to remove the old version\n");
269 printf("*** of LIBXML, but you can also set the XML2_CONFIG environment to point to the\n");
270 printf("*** correct copy of xml2-config. (In this case, you will have to\n");
271 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
272 printf("*** so that the correct libraries are found at run-time))\n");
276 ],, no_xml=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
277 CFLAGS="$ac_save_CFLAGS"
282 if test "x$no_xml" = x ; then
283 AC_MSG_RESULT(yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version))
284 ifelse([$2], , :, [$2])
287 if test "$XML2_CONFIG" = "no" ; then
288 echo "*** The xml2-config script installed by LIBXML could not be found"
289 echo "*** If libxml was installed in PREFIX, make sure PREFIX/bin is in"
290 echo "*** your path, or set the XML2_CONFIG environment variable to the"
291 echo "*** full path to xml2-config."
293 if test -f conf.xmltest ; then
296 echo "*** Could not run libxml test program, checking why..."
297 CFLAGS="$CFLAGS $XML_CFLAGS"
298 LIBS="$LIBS $XML_LIBS"
300 #include <libxml/xmlversion.h>
302 ], [ LIBXML_TEST_VERSION; return 0;],
303 [ echo "*** The test program compiled, but did not run. This usually means"
304 echo "*** that the run-time linker is not finding LIBXML or finding the wrong"
305 echo "*** version of LIBXML. If it is not finding LIBXML, you'll need to set your"
306 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
307 echo "*** to the installed location Also, make sure you have run ldconfig if that"
308 echo "*** is required on your system"
310 echo "*** If you have an old version installed, it is best to remove it, although"
311 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
312 [ echo "*** The test program failed to compile or link. See the file config.log for the"
313 echo "*** exact error that occured. This usually means LIBXML was incorrectly installed"
314 echo "*** or that you have moved LIBXML since it was installed. In the latter case, you"
315 echo "*** may want to edit the xml2-config script: $XML2_CONFIG" ])
316 CFLAGS="$ac_save_CFLAGS"
323 ifelse([$3], , :, [$3])
330 # =========================================================================
331 # AM_PATH_MYSQL : MySQL library
333 dnl AM_PATH_MYSQL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
334 dnl Test for MYSQL, and define MYSQL_CFLAGS and MYSQL_LIBS
336 AC_DEFUN(AM_PATH_MYSQL,
338 dnl Get the cflags and libraries from the mysql_config script
340 AC_ARG_WITH(mysql-prefix,[ --with-mysql-prefix=PFX Prefix where MYSQL is installed (optional)],
341 mysql_prefix="$withval", mysql_prefix="")
342 AC_ARG_WITH(mysql-exec-prefix,[ --with-mysql-exec-prefix=PFX Exec prefix where MYSQL is installed (optional)],
343 mysql_exec_prefix="$withval", mysql_exec_prefix="")
344 AC_ARG_ENABLE(mysqltest, [ --disable-mysqltest Do not try to compile and run a test MYSQL program],
345 , enable_mysqltest=yes)
347 if test x$mysql_exec_prefix != x ; then
348 mysql_args="$mysql_args --exec-prefix=$mysql_exec_prefix"
349 if test x${MYSQL_CONFIG+set} != xset ; then
350 MYSQL_CONFIG=$mysql_exec_prefix/bin/mysql_config
353 if test x$mysql_prefix != x ; then
354 mysql_args="$mysql_args --prefix=$mysql_prefix"
355 if test x${MYSQL_CONFIG+set} != xset ; then
356 MYSQL_CONFIG=$mysql_prefix/bin/mysql_config
360 AC_REQUIRE([AC_CANONICAL_TARGET])
361 AC_PATH_PROG(MYSQL_CONFIG, mysql_config, no)
362 min_mysql_version=ifelse([$1], ,0.11.0,$1)
363 AC_MSG_CHECKING(for MYSQL - version >= $min_mysql_version)
365 if test "$MYSQL_CONFIG" = "no" ; then
368 MYSQL_CFLAGS=`$MYSQL_CONFIG $mysqlconf_args --cflags | sed -e "s/'//g"`
369 MYSQL_LIBS=`$MYSQL_CONFIG $mysqlconf_args --libs | sed -e "s/'//g"`
371 mysql_major_version=`$MYSQL_CONFIG $mysql_args --version | \
372 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
373 mysql_minor_version=`$MYSQL_CONFIG $mysql_args --version | \
374 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
375 mysql_micro_version=`$MYSQL_CONFIG $mysql_config_args --version | \
376 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
377 if test "x$enable_mysqltest" = "xyes" ; then
378 ac_save_CFLAGS="$CFLAGS"
380 CFLAGS="$CFLAGS $MYSQL_CFLAGS"
381 LIBS="$LIBS $MYSQL_LIBS"
383 dnl Now check if the installed MYSQL is sufficiently new. (Also sanity
384 dnl checks the results of mysql_config to some extent
394 my_strdup (char *str)
400 new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
401 strcpy (new_str, str);
409 int main (int argc, char *argv[])
411 int major, minor, micro;
414 /* This hangs on some systems (?)
415 system ("touch conf.mysqltest");
417 { FILE *fp = fopen("conf.mysqltest", "a"); if ( fp ) fclose(fp); }
419 /* HP/UX 9 (%@#!) writes to sscanf strings */
420 tmp_version = my_strdup("$min_mysql_version");
421 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
422 printf("%s, bad version string\n", "$min_mysql_version");
426 if (($mysql_major_version > major) ||
427 (($mysql_major_version == major) && ($mysql_minor_version > minor)) ||
428 (($mysql_major_version == major) && ($mysql_minor_version == minor) && ($mysql_micro_version >= micro)))
434 printf("\n*** 'mysql_config --version' returned %d.%d.%d, but the minimum version\n", $mysql_major_version, $mysql_minor_version, $mysql_micro_version);
435 printf("*** of MYSQL required is %d.%d.%d. If mysql_config is correct, then it is\n", major, minor, micro);
436 printf("*** best to upgrade to the required version.\n");
437 printf("*** If mysql_config was wrong, set the environment variable MYSQL_CONFIG\n");
438 printf("*** to point to the correct copy of mysql_config, and remove the file\n");
439 printf("*** config.cache before re-running configure\n");
444 ],, no_mysql=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
445 CFLAGS="$ac_save_CFLAGS"
449 if test "x$no_mysql" = x ; then
451 ifelse([$2], , :, [$2])
454 if test "$MYSQL_CONFIG" = "no" ; then
455 echo "*** The mysql_config script installed by MYSQL could not be found"
456 echo "*** If MYSQL was installed in PREFIX, make sure PREFIX/bin is in"
457 echo "*** your path, or set the MYSQL_CONFIG environment variable to the"
458 echo "*** full path to mysql_config."
460 if test -f conf.mysqltest ; then
463 echo "*** Could not run MYSQL test program, checking why..."
464 CFLAGS="$CFLAGS $MYSQL_CFLAGS"
465 LIBS="$LIBS $MYSQL_LIBS"
470 int main(int argc, char *argv[])
473 #define main K_and_R_C_main
475 [ echo "*** The test program compiled, but did not run. This usually means"
476 echo "*** that the run-time linker is not finding MYSQL or finding the wrong"
477 echo "*** version of MYSQL. If it is not finding MYSQL, you'll need to set your"
478 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
479 echo "*** to the installed location Also, make sure you have run ldconfig if that"
480 echo "*** is required on your system"
482 echo "*** If you have an old version installed, it is best to remove it, although"
483 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
484 [ echo "*** The test program failed to compile or link. See the file config.log for the"
485 echo "*** exact error that occured. This usually means MYSQL was incorrectly installed"
486 echo "*** or that you have moved MYSQL since it was installed. In the latter case, you"
487 echo "*** may want to edit the mysql_config script: $MYSQL_CONFIG" ])
488 CFLAGS="$ac_save_CFLAGS"
494 ifelse([$3], , :, [$3])
496 AC_SUBST(MYSQL_CFLAGS)
501 dnl Removes -I/usr/include/? from given variable
502 AC_DEFUN(CFLAGS_REMOVE_USR_INCLUDE,[
506 -I/usr/include|-I/usr/include/) ;;
507 *) ac_new_flags="[$]ac_new_flags [$]i" ;;
513 dnl Removes -L/usr/lib/? from given variable
514 AC_DEFUN(LIB_REMOVE_USR_LIB,[
518 -L/usr/lib|-L/usr/lib/) ;;
519 *) ac_new_flags="[$]ac_new_flags [$]i" ;;
525 dnl From Bruno Haible.
529 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
530 dnl those with the standalone portable libiconv installed).
531 AC_MSG_CHECKING(for iconv in $1)
532 jm_cv_func_iconv="no"
536 LIBS="$LIBS -lbiconv"
537 AC_TRY_LINK([#include <stdlib.h>
538 #include <biconv.h>],
539 [iconv_t cd = iconv_open("","");
540 iconv(cd,NULL,NULL,NULL,NULL);
544 jm_cv_include="biconv.h"
545 jm_cv_lib_iconv="yes")
548 if test "$jm_cv_func_iconv" != yes; then
549 AC_TRY_LINK([#include <stdlib.h>
550 #include <giconv.h>],
551 [iconv_t cd = iconv_open("","");
552 iconv(cd,NULL,NULL,NULL,NULL);
555 jm_cv_include="giconv.h"
558 if test "$jm_cv_func_iconv" != yes; then
559 AC_TRY_LINK([#include <stdlib.h>
561 [iconv_t cd = iconv_open("","");
562 iconv(cd,NULL,NULL,NULL,NULL);
564 jm_cv_include="iconv.h"
565 jm_cv_func_iconv=yes)
567 if test "$jm_cv_lib_iconv" != yes; then
569 LIBS="$LIBS -lgiconv"
570 AC_TRY_LINK([#include <stdlib.h>
571 #include <giconv.h>],
572 [iconv_t cd = iconv_open("","");
573 iconv(cd,NULL,NULL,NULL,NULL);
577 jm_cv_include="giconv.h"
581 if test "$jm_cv_func_iconv" != yes; then
584 AC_TRY_LINK([#include <stdlib.h>
586 [iconv_t cd = iconv_open("","");
587 iconv(cd,NULL,NULL,NULL,NULL);
590 jm_cv_include="iconv.h"
591 jm_cv_func_iconv=yes)
597 if test "$jm_cv_func_iconv" = yes; then
598 if test "$jm_cv_giconv" = yes; then
599 AC_DEFINE(HAVE_GICONV, 1, [What header to include for iconv() function: giconv.h])
603 if test "$jm_cv_biconv" = yes; then
604 AC_DEFINE(HAVE_BICONV, 1, [What header to include for iconv() function: biconv.h])
608 AC_DEFINE(HAVE_ICONV, 1, [What header to include for iconv() function: iconv.h])
616 if test "$jm_cv_lib_iconv" = yes; then
617 if test "$jm_cv_giconv" = yes; then
618 LIBS="$LIBS -lgiconv"
620 if test "$jm_cv_biconv" = yes; then
621 LIBS="$LIBS -lbiconv"
629 dnl CFLAGS_ADD_DIR(CFLAGS, $INCDIR)
630 dnl This function doesn't add -I/usr/include into CFLAGS
631 AC_DEFUN(CFLAGS_ADD_DIR,[
632 if test "$2" != "/usr/include" ; then
637 dnl LIB_ADD_DIR(LDFLAGS, $LIBDIR)
638 dnl This function doesn't add -L/usr/lib into LDFLAGS
639 AC_DEFUN(LIB_ADD_DIR,[
640 if test "$2" != "/usr/lib" ; then
645 dnl AC_ENABLE_SHARED - implement the --enable-shared flag
646 dnl Usage: AC_ENABLE_SHARED[(DEFAULT)]
647 dnl Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
649 AC_DEFUN([AC_ENABLE_SHARED],
650 [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
651 AC_ARG_ENABLE(shared,
652 changequote(<<, >>)dnl
653 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
655 [p=${PACKAGE-default}
657 yes) enable_shared=yes ;;
658 no) enable_shared=no ;;
661 # Look at the argument we got. We use all the common list separators.
662 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
663 for pkg in $enableval; do
664 if test "X$pkg" = "X$p"; then
672 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
675 dnl AC_ENABLE_STATIC - implement the --enable-static flag
676 dnl Usage: AC_ENABLE_STATIC[(DEFAULT)]
677 dnl Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
679 AC_DEFUN([AC_ENABLE_STATIC],
680 [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
681 AC_ARG_ENABLE(static,
682 changequote(<<, >>)dnl
683 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
685 [p=${PACKAGE-default}
687 yes) enable_static=yes ;;
688 no) enable_static=no ;;
691 # Look at the argument we got. We use all the common list separators.
692 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
693 for pkg in $enableval; do
694 if test "X$pkg" = "X$p"; then
701 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
704 dnl AC_DISABLE_STATIC - set the default static flag to --disable-static
705 AC_DEFUN([AC_DISABLE_STATIC],
706 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
707 AC_ENABLE_STATIC(no)])
709 dnl AC_TRY_RUN_STRICT(PROGRAM,CFLAGS,CPPFLAGS,LDFLAGS,
710 dnl [ACTION-IF-TRUE],[ACTION-IF-FALSE],
711 dnl [ACTION-IF-CROSS-COMPILING = RUNTIME-ERROR])
712 AC_DEFUN( [AC_TRY_RUN_STRICT],
714 old_CFLAGS="$CFLAGS";
717 old_CPPFLAGS="$CPPFLAGS";
720 old_LDFLAGS="$LDFLAGS";
723 AC_TRY_RUN([$1],[$5],[$6],[$7]);
724 CFLAGS="$old_CFLAGS";
727 CPPFLAGS="$old_CPPFLAGS";
730 LDFLAGS="$old_LDFLAGS";