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 Specify the default build method of this module
40 dnl SMB_MODULE_DEFAULT(1:name,2:default_build)
41 AC_DEFUN(SMB_MODULE_DEFAULT,
43 dnl Fall back to static if dlopen() is not available
44 eval MODULE_DEFAULT_$1=$2
46 if test x"MODULE_DEFAULT_$1" = xSHARED -a x"$ac_cv_func_dlopen" != xyes; then
47 eval MODULE_DEFAULT_$1=STATIC
51 dnl Mark specified module as shared
52 dnl SMB_MODULE(1:name,2:subsystem,3:default_build,4:object_files,5:shared_object,6:libs,7:whatif-static,8:whatif-shared,9:whatif-not)
55 AC_MSG_CHECKING([how to build $1])
56 if test -z "$[MODULE_DEFAULT_][$1]"; then
57 eval MODULE_DEFAULT_$1=$3
59 if test x"MODULE_DEFAULT_$1" = xSHARED -a x"$ac_cv_func_dlopen" != xyes; then
60 eval MODULE_DEFAULT_$1=STATIC
64 if test "$[MODULE_][$1]"; then
66 elif test "$[MODULE_]translit([$2], [A-Z], [a-z])" -a "$[MODULE_DEFAULT_][$1]"; then
67 DEST=$[MODULE_]translit([$2], [A-Z], [a-z])
69 DEST=$[MODULE_DEFAULT_][$1]
72 if test x"$DEST" = xSHARED; then
73 AC_DEFINE([$1][_init], [init_module], [Whether to build $1 as shared module])
74 $2_MODULES="$$2_MODULES $5"
75 [MODULE_][$1][_LIBS]="$6"
76 AC_MSG_RESULT([shared])
78 string_shared_modules="$string_shared_modules $1"
79 elif test x"$DEST" = xSTATIC; then
80 [init_static_modules_]translit([$2], [A-Z], [a-z])="$[init_static_modules_]translit([$2], [A-Z], [a-z]) $1_init();"
81 string_static_modules="$string_static_modules $1"
82 $2_STATIC="$$2_STATIC $4"
85 AC_MSG_RESULT([static])
87 string_ignored_modules="$string_ignored_modules $1"
93 dnl Mark specified module as shared
94 dnl SMB_SUBSYSTEM(1:name,2:init_objectfile)
95 AC_DEFUN(SMB_SUBSYSTEM,
100 AC_DEFINE_UNQUOTED([static_init_]translit([$1], [A-Z], [a-z]), [{$init_static_modules_]translit([$1], [A-Z], [a-z])[}], [Static init functions])
101 ifelse([$2], , :, [rm -f $2])
104 dnl AC_PROG_CC_FLAG(flag)
105 AC_DEFUN(AC_PROG_CC_FLAG,
106 [AC_CACHE_CHECK(whether ${CC-cc} accepts -$1, ac_cv_prog_cc_$1,
107 [echo 'void f(){}' > conftest.c
108 if test -z "`${CC-cc} -$1 -c conftest.c 2>&1`"; then
116 dnl see if a declaration exists for a function or variable
117 dnl defines HAVE_function_DECL if it exists
118 dnl AC_HAVE_DECL(var, includes)
119 AC_DEFUN(AC_HAVE_DECL,
121 AC_CACHE_CHECK([for $1 declaration],ac_cv_have_$1_decl,[
122 AC_TRY_COMPILE([$2],[int i = (int)$1],
123 ac_cv_have_$1_decl=yes,ac_cv_have_$1_decl=no)])
124 if test x"$ac_cv_have_$1_decl" = x"yes"; then
125 AC_DEFINE([HAVE_]translit([$1], [a-z], [A-Z])[_DECL],1,[Whether $1() is available])
130 dnl check for a function in a library, but don't
131 dnl keep adding the same library to the LIBS variable.
132 dnl AC_LIBTESTFUNC(lib,func)
133 AC_DEFUN(AC_LIBTESTFUNC,
135 *-l$1*) AC_CHECK_FUNCS($2) ;;
136 *) AC_CHECK_LIB($1, $2)
142 # AC_CHECK_LIB_EXT(LIBRARY, [EXT_LIBS], [FUNCTION],
143 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
144 # [ADD-ACTION-IF-FOUND],[OTHER-LIBRARIES])
145 # ------------------------------------------------------
147 # Use a cache variable name containing both the library and function name,
148 # because the test really is for library $1 defining function $3, not
149 # just for library $1. Separate tests with the same $1 and different $3s
150 # may have different results.
152 # Note that using directly AS_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$3])
153 # is asking for trouble, since AC_CHECK_LIB($lib, fun) would give
154 # ac_cv_lib_$lib_fun, which is definitely not what was meant. Hence
155 # the AS_LITERAL_IF indirection.
157 # FIXME: This macro is extremely suspicious. It DEFINEs unconditionally,
158 # whatever the FUNCTION, in addition to not being a *S macro. Note
159 # that the cache does depend upon the function we are looking for.
161 # It is on purpose we used `ac_check_lib_ext_save_LIBS' and not just
162 # `ac_save_LIBS': there are many macros which don't want to see `LIBS'
163 # changed but still want to use AC_CHECK_LIB_EXT, so they save `LIBS'.
164 # And ``ac_save_LIBS' is too tempting a name, so let's leave them some
166 AC_DEFUN([AC_CHECK_LIB_EXT],
168 AH_CHECK_LIB_EXT([$1])
169 ac_check_lib_ext_save_LIBS=$LIBS
170 LIBS="-l$1 $$2 $7 $LIBS"
172 [AS_VAR_PUSHDEF([ac_Lib_ext], [ac_cv_lib_ext_$1])],
173 [AS_VAR_PUSHDEF([ac_Lib_ext], [ac_cv_lib_ext_$1''])])dnl
177 AH_CHECK_FUNC_EXT([$3])
179 [AS_VAR_PUSHDEF([ac_Lib_func], [ac_cv_lib_ext_$1_$3])],
180 [AS_VAR_PUSHDEF([ac_Lib_func], [ac_cv_lib_ext_$1''_$3])])dnl
181 AC_CACHE_CHECK([for $3 in -l$1], ac_Lib_func,
182 [AC_TRY_LINK_FUNC($3,
183 [AS_VAR_SET(ac_Lib_func, yes);
184 AS_VAR_SET(ac_Lib_ext, yes)],
185 [AS_VAR_SET(ac_Lib_func, no);
186 AS_VAR_SET(ac_Lib_ext, no)])
188 AS_IF([test AS_VAR_GET(ac_Lib_func) = yes],
189 [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$3))])dnl
190 AS_VAR_POPDEF([ac_Lib_func])dnl
192 AC_CACHE_CHECK([for -l$1], ac_Lib_ext,
193 [AC_TRY_LINK_FUNC([main],
194 [AS_VAR_SET(ac_Lib_ext, yes)],
195 [AS_VAR_SET(ac_Lib_ext, no)])
198 LIBS=$ac_check_lib_ext_save_LIBS
200 AS_IF([test AS_VAR_GET(ac_Lib_ext) = yes],
202 [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_LIB$1))
213 AS_VAR_POPDEF([ac_Lib_ext])dnl
216 # AH_CHECK_LIB_EXT(LIBNAME)
217 # ---------------------
218 m4_define([AH_CHECK_LIB_EXT],
219 [AH_TEMPLATE(AS_TR_CPP(HAVE_LIB$1),
220 [Define to 1 if you have the `]$1[' library (-l]$1[).])])
222 # AC_CHECK_FUNCS_EXT(FUNCTION, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
223 # -----------------------------------------------------------------
224 dnl check for a function in a $LIBS and $OTHER_LIBS libraries variable.
225 dnl AC_CHECK_FUNC_EXT(func,OTHER_LIBS,IF-TRUE,IF-FALSE)
226 AC_DEFUN([AC_CHECK_FUNC_EXT],
228 AH_CHECK_FUNC_EXT($1)
229 ac_check_func_ext_save_LIBS=$LIBS
231 AS_VAR_PUSHDEF([ac_var], [ac_cv_func_ext_$1])dnl
232 AC_CACHE_CHECK([for $1], ac_var,
233 [AC_LINK_IFELSE([AC_LANG_FUNC_LINK_TRY([$1])],
234 [AS_VAR_SET(ac_var, yes)],
235 [AS_VAR_SET(ac_var, no)])])
236 LIBS=$ac_check_func_ext_save_LIBS
237 AS_IF([test AS_VAR_GET(ac_var) = yes],
238 [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$1])) $3],
240 AS_VAR_POPDEF([ac_var])dnl
243 # AH_CHECK_FUNC_EXT(FUNCNAME)
244 # ---------------------
245 m4_define([AH_CHECK_FUNC_EXT],
246 [AH_TEMPLATE(AS_TR_CPP(HAVE_$1),
247 [Define to 1 if you have the `]$1[' function.])])
249 dnl Define an AC_DEFINE with ifndef guard.
250 dnl AC_N_DEFINE(VARIABLE [, VALUE])
252 [cat >> confdefs.h <<\EOF
254 [#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1)
260 dnl AC_ADD_INCLUDE(VARIABLE)
261 define(AC_ADD_INCLUDE,
262 [cat >> confdefs.h <<\EOF
267 dnl Copied from libtool.m4
268 AC_DEFUN(AC_PROG_LD_GNU,
269 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
270 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
271 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
272 ac_cv_prog_gnu_ld=yes
278 # Configure paths for LIBXML2
279 # Toshio Kuratomi 2001-04-21
281 # Configure paths for GLIB
282 # Owen Taylor 97-11-3
284 dnl AM_PATH_XML2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
285 dnl Test for XML, and define XML_CFLAGS and XML_LIBS
287 AC_DEFUN(AM_PATH_XML2,[
288 AC_ARG_WITH(xml-prefix,
289 [ --with-xml-prefix=PFX Prefix where libxml is installed (optional)],
290 xml_config_prefix="$withval", xml_config_prefix="")
291 AC_ARG_WITH(xml-exec-prefix,
292 [ --with-xml-exec-prefix=PFX Exec prefix where libxml is installed (optional)],
293 xml_config_exec_prefix="$withval", xml_config_exec_prefix="")
294 AC_ARG_ENABLE(xmltest,
295 [ --disable-xmltest Do not try to compile and run a test LIBXML program],,
298 if test x$xml_config_exec_prefix != x ; then
299 xml_config_args="$xml_config_args --exec-prefix=$xml_config_exec_prefix"
300 if test x${XML2_CONFIG+set} != xset ; then
301 XML2_CONFIG=$xml_config_exec_prefix/bin/xml2-config
304 if test x$xml_config_prefix != x ; then
305 xml_config_args="$xml_config_args --prefix=$xml_config_prefix"
306 if test x${XML2_CONFIG+set} != xset ; then
307 XML2_CONFIG=$xml_config_prefix/bin/xml2-config
311 AC_PATH_PROG(XML2_CONFIG, xml2-config, no)
312 min_xml_version=ifelse([$1], ,2.0.0,[$1])
313 AC_MSG_CHECKING(for libxml - version >= $min_xml_version)
315 if test "$XML2_CONFIG" = "no" ; then
318 XML_CFLAGS=`$XML2_CONFIG $xml_config_args --cflags`
319 XML_LIBS=`$XML2_CONFIG $xml_config_args --libs`
320 xml_config_major_version=`$XML2_CONFIG $xml_config_args --version | \
321 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
322 xml_config_minor_version=`$XML2_CONFIG $xml_config_args --version | \
323 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
324 xml_config_micro_version=`$XML2_CONFIG $xml_config_args --version | \
325 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
326 if test "x$enable_xmltest" = "xyes" ; then
327 ac_save_CFLAGS="$CFLAGS"
329 CFLAGS="$CFLAGS $XML_CFLAGS"
330 LIBS="$XML_LIBS $LIBS"
332 dnl Now check if the installed libxml is sufficiently new.
333 dnl (Also sanity checks the results of xml2-config to some extent)
340 #include <libxml/xmlversion.h>
345 int xml_major_version, xml_minor_version, xml_micro_version;
346 int major, minor, micro;
349 system("touch conf.xmltest");
351 /* Capture xml2-config output via autoconf/configure variables */
352 /* HP/UX 9 (%@#!) writes to sscanf strings */
353 tmp_version = (char *)strdup("$min_xml_version");
354 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
355 printf("%s, bad version string from xml2-config\n", "$min_xml_version");
360 /* Capture the version information from the header files */
361 tmp_version = (char *)strdup(LIBXML_DOTTED_VERSION);
362 if (sscanf(tmp_version, "%d.%d.%d", &xml_major_version, &xml_minor_version, &xml_micro_version) != 3) {
363 printf("%s, bad version string from libxml includes\n", "LIBXML_DOTTED_VERSION");
368 /* Compare xml2-config output to the libxml headers */
369 if ((xml_major_version != $xml_config_major_version) ||
370 (xml_minor_version != $xml_config_minor_version) ||
371 (xml_micro_version != $xml_config_micro_version))
373 printf("*** libxml header files (version %d.%d.%d) do not match\n",
374 xml_major_version, xml_minor_version, xml_micro_version);
375 printf("*** xml2-config (version %d.%d.%d)\n",
376 $xml_config_major_version, $xml_config_minor_version, $xml_config_micro_version);
379 /* Compare the headers to the library to make sure we match */
380 /* Less than ideal -- doesn't provide us with return value feedback,
381 * only exits if there's a serious mismatch between header and library.
385 /* Test that the library is greater than our minimum version */
386 if ((xml_major_version > major) ||
387 ((xml_major_version == major) && (xml_minor_version > minor)) ||
388 ((xml_major_version == major) && (xml_minor_version == minor) &&
389 (xml_micro_version >= micro)))
395 printf("\n*** An old version of libxml (%d.%d.%d) was found.\n",
396 xml_major_version, xml_minor_version, xml_micro_version);
397 printf("*** You need a version of libxml newer than %d.%d.%d. The latest version of\n",
398 major, minor, micro);
399 printf("*** libxml is always available from ftp://ftp.xmlsoft.org.\n");
401 printf("*** If you have already installed a sufficiently new version, this error\n");
402 printf("*** probably means that the wrong copy of the xml2-config shell script is\n");
403 printf("*** being found. The easiest way to fix this is to remove the old version\n");
404 printf("*** of LIBXML, but you can also set the XML2_CONFIG environment to point to the\n");
405 printf("*** correct copy of xml2-config. (In this case, you will have to\n");
406 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
407 printf("*** so that the correct libraries are found at run-time))\n");
411 ],, no_xml=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
412 CFLAGS="$ac_save_CFLAGS"
417 if test "x$no_xml" = x ; then
418 AC_MSG_RESULT(yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version))
419 ifelse([$2], , :, [$2])
422 if test "$XML2_CONFIG" = "no" ; then
423 echo "*** The xml2-config script installed by LIBXML could not be found"
424 echo "*** If libxml was installed in PREFIX, make sure PREFIX/bin is in"
425 echo "*** your path, or set the XML2_CONFIG environment variable to the"
426 echo "*** full path to xml2-config."
428 if test -f conf.xmltest ; then
431 echo "*** Could not run libxml test program, checking why..."
432 CFLAGS="$CFLAGS $XML_CFLAGS"
433 LIBS="$LIBS $XML_LIBS"
435 #include <libxml/xmlversion.h>
437 ], [ LIBXML_TEST_VERSION; return 0;],
438 [ echo "*** The test program compiled, but did not run. This usually means"
439 echo "*** that the run-time linker is not finding LIBXML or finding the wrong"
440 echo "*** version of LIBXML. If it is not finding LIBXML, you'll need to set your"
441 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
442 echo "*** to the installed location Also, make sure you have run ldconfig if that"
443 echo "*** is required on your system"
445 echo "*** If you have an old version installed, it is best to remove it, although"
446 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
447 [ echo "*** The test program failed to compile or link. See the file config.log for the"
448 echo "*** exact error that occured. This usually means LIBXML was incorrectly installed"
449 echo "*** or that you have moved LIBXML since it was installed. In the latter case, you"
450 echo "*** may want to edit the xml2-config script: $XML2_CONFIG" ])
451 CFLAGS="$ac_save_CFLAGS"
458 ifelse([$3], , :, [$3])
465 # =========================================================================
466 # AM_PATH_MYSQL : MySQL library
468 dnl AM_PATH_MYSQL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
469 dnl Test for MYSQL, and define MYSQL_CFLAGS and MYSQL_LIBS
471 AC_DEFUN(AM_PATH_MYSQL,
473 dnl Get the cflags and libraries from the mysql_config script
475 AC_ARG_WITH(mysql-prefix,[ --with-mysql-prefix=PFX Prefix where MYSQL is installed (optional)],
476 mysql_prefix="$withval", mysql_prefix="")
477 AC_ARG_WITH(mysql-exec-prefix,[ --with-mysql-exec-prefix=PFX Exec prefix where MYSQL is installed (optional)],
478 mysql_exec_prefix="$withval", mysql_exec_prefix="")
480 if test x$mysql_exec_prefix != x ; then
481 mysql_args="$mysql_args --exec-prefix=$mysql_exec_prefix"
482 if test x${MYSQL_CONFIG+set} != xset ; then
483 MYSQL_CONFIG=$mysql_exec_prefix/bin/mysql_config
486 if test x$mysql_prefix != x ; then
487 mysql_args="$mysql_args --prefix=$mysql_prefix"
488 if test x${MYSQL_CONFIG+set} != xset ; then
489 MYSQL_CONFIG=$mysql_prefix/bin/mysql_config
493 AC_REQUIRE([AC_CANONICAL_TARGET])
494 AC_PATH_PROG(MYSQL_CONFIG, mysql_config, no)
495 AC_MSG_CHECKING(for MYSQL)
497 if test "$MYSQL_CONFIG" = "no" ; then
501 ifelse([$2], , :, [$2])
503 MYSQL_CFLAGS=`$MYSQL_CONFIG $mysqlconf_args --cflags | sed -e "s/'//g"`
504 MYSQL_LIBS=`$MYSQL_CONFIG $mysqlconf_args --libs | sed -e "s/'//g"`
506 ifelse([$1], , :, [$1])
508 AC_SUBST(MYSQL_CFLAGS)
512 dnl Removes -I/usr/include/? from given variable
513 AC_DEFUN(CFLAGS_REMOVE_USR_INCLUDE,[
517 -I/usr/include|-I/usr/include/) ;;
518 *) ac_new_flags="[$]ac_new_flags [$]i" ;;
524 dnl Removes -L/usr/lib/? from given variable
525 AC_DEFUN(LIB_REMOVE_USR_LIB,[
529 -L/usr/lib|-L/usr/lib/) ;;
530 *) ac_new_flags="[$]ac_new_flags [$]i" ;;
536 dnl From Bruno Haible.
540 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
541 dnl those with the standalone portable libiconv installed).
542 AC_MSG_CHECKING(for iconv in $1)
543 jm_cv_func_iconv="no"
546 AC_TRY_LINK([#include <stdlib.h>
547 #include <giconv.h>],
548 [iconv_t cd = iconv_open("","");
549 iconv(cd,NULL,NULL,NULL,NULL);
554 if test "$jm_cv_func_iconv" != yes; then
555 AC_TRY_LINK([#include <stdlib.h>
557 [iconv_t cd = iconv_open("","");
558 iconv(cd,NULL,NULL,NULL,NULL);
560 jm_cv_func_iconv=yes)
562 if test "$jm_cv_lib_iconv" != yes; then
564 LIBS="$LIBS -lgiconv"
565 AC_TRY_LINK([#include <stdlib.h>
566 #include <giconv.h>],
567 [iconv_t cd = iconv_open("","");
568 iconv(cd,NULL,NULL,NULL,NULL);
575 if test "$jm_cv_func_iconv" != yes; then
578 AC_TRY_LINK([#include <stdlib.h>
580 [iconv_t cd = iconv_open("","");
581 iconv(cd,NULL,NULL,NULL,NULL);
584 jm_cv_func_iconv=yes)
590 if test "$jm_cv_func_iconv" = yes; then
591 if test "$jm_cv_giconv" = yes; then
592 AC_DEFINE(HAVE_GICONV, 1, [What header to include for iconv() function: giconv.h])
596 AC_DEFINE(HAVE_ICONV, 1, [What header to include for iconv() function: iconv.h])
603 if test "$jm_cv_lib_iconv" = yes; then
604 if test "$jm_cv_giconv" = yes; then
605 LIBS="$LIBS -lgiconv"
612 dnl CFLAGS_ADD_DIR(CFLAGS, $INCDIR)
613 dnl This function doesn't add -I/usr/include into CFLAGS
614 AC_DEFUN(CFLAGS_ADD_DIR,[
615 if test "$2" != "/usr/include" ; then
620 dnl LIB_ADD_DIR(LDFLAGS, $LIBDIR)
621 dnl This function doesn't add -L/usr/lib into LDFLAGS
622 AC_DEFUN(LIB_ADD_DIR,[
623 if test "$2" != "/usr/lib" ; then
628 dnl AC_ENABLE_SHARED - implement the --enable-shared flag
629 dnl Usage: AC_ENABLE_SHARED[(DEFAULT)]
630 dnl Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
632 AC_DEFUN([AC_ENABLE_SHARED],
633 [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
634 AC_ARG_ENABLE(shared,
635 changequote(<<, >>)dnl
636 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
638 [p=${PACKAGE-default}
640 yes) enable_shared=yes ;;
641 no) enable_shared=no ;;
644 # Look at the argument we got. We use all the common list separators.
645 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
646 for pkg in $enableval; do
647 if test "X$pkg" = "X$p"; then
655 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
658 dnl AC_ENABLE_STATIC - implement the --enable-static flag
659 dnl Usage: AC_ENABLE_STATIC[(DEFAULT)]
660 dnl Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
662 AC_DEFUN([AC_ENABLE_STATIC],
663 [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
664 AC_ARG_ENABLE(static,
665 changequote(<<, >>)dnl
666 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
668 [p=${PACKAGE-default}
670 yes) enable_static=yes ;;
671 no) enable_static=no ;;
674 # Look at the argument we got. We use all the common list separators.
675 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
676 for pkg in $enableval; do
677 if test "X$pkg" = "X$p"; then
684 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
687 dnl AC_DISABLE_STATIC - set the default static flag to --disable-static
688 AC_DEFUN([AC_DISABLE_STATIC],
689 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
690 AC_ENABLE_STATIC(no)])