Update MySQL configuration scripts, add module macros
[kai/samba.git] / source4 / aclocal.m4
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
4 dnl error message.
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])
15         ifelse($#, 1, [$1],
16                 [AC_MSG_ERROR(["you must remove config.cache and restart configure"])])
17     else
18         AC_MSG_RESULT([same])
19     fi
20     ac_cv_host_system_type="$host"
21     ac_cv_build_system_type="$build"
22     ac_cv_target_system_type="$target"
23 ])
24
25
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,
29 [AC_TRY_COMPILE([
30 #include <unistd.h>
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])
36 fi
37 ])
38
39 dnl Mark specified module as shared
40 dnl SMB_MODULE(name,static_files,shared_files,subsystem,whatif-static,whatif-shared)
41 AC_DEFUN(SMB_MODULE,
42 [
43         AC_MSG_CHECKING([how to build $1])
44         if test "$[MODULE_][$1]"; then
45                 DEST=$[MODULE_][$1]
46         elif test "$[MODULE_]translit([$4], [A-Z], [a-z])" -a "$[MODULE_DEFAULT_][$1]"; then
47                 DEST=$[MODULE_]translit([$4], [A-Z], [a-z])
48         else
49                 DEST=$[MODULE_DEFAULT_][$1]
50         fi
51         
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])
56                 [$6]
57                 string_shared_modules="$string_shared_modules $1"
58         elif test x"$DEST" = xSTATIC; then
59                 [init_static_modules_]translit([$4], [A-Z], [a-z])="$[init_static_modules_]translit([$4], [A-Z], [a-z]) $1_init();"
60                 string_static_modules="$string_static_modules $1"
61                 $4_STATIC="$$4_STATIC $2"
62                 AC_SUBST($4_STATIC)
63                 [$5]
64                 AC_MSG_RESULT([static])
65         else
66             string_ignored_modules="$string_ignored_modules $1"
67                 AC_MSG_RESULT([not])
68         fi
69 ])
70
71 AC_DEFUN(SMB_SUBSYSTEM,
72 [
73         AC_SUBST($1_STATIC)
74         AC_SUBST($1_MODULES)
75         AC_DEFINE_UNQUOTED([static_init_]translit([$1], [A-Z], [a-z]), [{$init_static_modules_]translit([$1], [A-Z], [a-z])[}], [Static init functions])
76         ifelse([$2], , :, [rm -f $2])
77 ])
78
79 dnl AC_PROG_CC_FLAG(flag)
80 AC_DEFUN(AC_PROG_CC_FLAG,
81 [AC_CACHE_CHECK(whether ${CC-cc} accepts -$1, ac_cv_prog_cc_$1,
82 [echo 'void f(){}' > conftest.c
83 if test -z "`${CC-cc} -$1 -c conftest.c 2>&1`"; then
84   ac_cv_prog_cc_$1=yes
85 else
86   ac_cv_prog_cc_$1=no
87 fi
88 rm -f conftest*
89 ])])
90
91 dnl see if a declaration exists for a function or variable
92 dnl defines HAVE_function_DECL if it exists
93 dnl AC_HAVE_DECL(var, includes)
94 AC_DEFUN(AC_HAVE_DECL,
95 [
96  AC_CACHE_CHECK([for $1 declaration],ac_cv_have_$1_decl,[
97     AC_TRY_COMPILE([$2],[int i = (int)$1],
98         ac_cv_have_$1_decl=yes,ac_cv_have_$1_decl=no)])
99  if test x"$ac_cv_have_$1_decl" = x"yes"; then
100     AC_DEFINE([HAVE_]translit([$1], [a-z], [A-Z])[_DECL],1,[Whether $1() is available])
101  fi
102 ])
103
104
105 dnl check for a function in a library, but don't
106 dnl keep adding the same library to the LIBS variable.
107 dnl AC_LIBTESTFUNC(lib,func)
108 AC_DEFUN(AC_LIBTESTFUNC,
109 [case "$LIBS" in
110   *-l$1*) AC_CHECK_FUNCS($2) ;;
111   *) AC_CHECK_LIB($1, $2) 
112      AC_CHECK_FUNCS($2)
113   ;;
114   esac
115 ])
116
117 dnl Define an AC_DEFINE with ifndef guard.
118 dnl AC_N_DEFINE(VARIABLE [, VALUE])
119 define(AC_N_DEFINE,
120 [cat >> confdefs.h <<\EOF
121 [#ifndef] $1
122 [#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1)
123 [#endif]
124 EOF
125 ])
126
127 dnl Add an #include
128 dnl AC_ADD_INCLUDE(VARIABLE)
129 define(AC_ADD_INCLUDE,
130 [cat >> confdefs.h <<\EOF
131 [#include] $1
132 EOF
133 ])
134
135 dnl Copied from libtool.m4
136 AC_DEFUN(AC_PROG_LD_GNU,
137 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
138 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
139 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
140   ac_cv_prog_gnu_ld=yes
141 else
142   ac_cv_prog_gnu_ld=no
143 fi])
144 ])
145
146 # Configure paths for LIBXML2
147 # Toshio Kuratomi 2001-04-21
148 # Adapted from:
149 # Configure paths for GLIB
150 # Owen Taylor     97-11-3
151
152 dnl AM_PATH_XML2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
153 dnl Test for XML, and define XML_CFLAGS and XML_LIBS
154 dnl
155 AC_DEFUN(AM_PATH_XML2,[ 
156 AC_ARG_WITH(xml-prefix,
157             [  --with-xml-prefix=PFX   Prefix where libxml is installed (optional)],
158             xml_config_prefix="$withval", xml_config_prefix="")
159 AC_ARG_WITH(xml-exec-prefix,
160             [  --with-xml-exec-prefix=PFX Exec prefix where libxml is installed (optional)],
161             xml_config_exec_prefix="$withval", xml_config_exec_prefix="")
162 AC_ARG_ENABLE(xmltest,
163               [  --disable-xmltest       Do not try to compile and run a test LIBXML program],,
164               enable_xmltest=yes)
165
166   if test x$xml_config_exec_prefix != x ; then
167      xml_config_args="$xml_config_args --exec-prefix=$xml_config_exec_prefix"
168      if test x${XML2_CONFIG+set} != xset ; then
169         XML2_CONFIG=$xml_config_exec_prefix/bin/xml2-config
170      fi
171   fi
172   if test x$xml_config_prefix != x ; then
173      xml_config_args="$xml_config_args --prefix=$xml_config_prefix"
174      if test x${XML2_CONFIG+set} != xset ; then
175         XML2_CONFIG=$xml_config_prefix/bin/xml2-config
176      fi
177   fi
178
179   AC_PATH_PROG(XML2_CONFIG, xml2-config, no)
180   min_xml_version=ifelse([$1], ,2.0.0,[$1])
181   AC_MSG_CHECKING(for libxml - version >= $min_xml_version)
182   no_xml=""
183   if test "$XML2_CONFIG" = "no" ; then
184     no_xml=yes
185   else
186     XML_CFLAGS=`$XML2_CONFIG $xml_config_args --cflags`
187     XML_LIBS=`$XML2_CONFIG $xml_config_args --libs`
188     xml_config_major_version=`$XML2_CONFIG $xml_config_args --version | \
189            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
190     xml_config_minor_version=`$XML2_CONFIG $xml_config_args --version | \
191            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
192     xml_config_micro_version=`$XML2_CONFIG $xml_config_args --version | \
193            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
194     if test "x$enable_xmltest" = "xyes" ; then
195       ac_save_CFLAGS="$CFLAGS"
196       ac_save_LIBS="$LIBS"
197       CFLAGS="$CFLAGS $XML_CFLAGS"
198       LIBS="$XML_LIBS $LIBS"
199 dnl
200 dnl Now check if the installed libxml is sufficiently new.
201 dnl (Also sanity checks the results of xml2-config to some extent)
202 dnl
203       rm -f conf.xmltest
204       AC_TRY_RUN([
205 #include <stdlib.h>
206 #include <stdio.h>
207 #include <string.h>
208 #include <libxml/xmlversion.h>
209
210 int 
211 main()
212 {
213   int xml_major_version, xml_minor_version, xml_micro_version;
214   int major, minor, micro;
215   char *tmp_version;
216
217   system("touch conf.xmltest");
218
219   /* Capture xml2-config output via autoconf/configure variables */
220   /* HP/UX 9 (%@#!) writes to sscanf strings */
221   tmp_version = (char *)strdup("$min_xml_version");
222   if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
223      printf("%s, bad version string from xml2-config\n", "$min_xml_version");
224      exit(1);
225    }
226    free(tmp_version);
227
228    /* Capture the version information from the header files */
229    tmp_version = (char *)strdup(LIBXML_DOTTED_VERSION);
230    if (sscanf(tmp_version, "%d.%d.%d", &xml_major_version, &xml_minor_version, &xml_micro_version) != 3) {
231      printf("%s, bad version string from libxml includes\n", "LIBXML_DOTTED_VERSION");
232      exit(1);
233    }
234    free(tmp_version);
235
236  /* Compare xml2-config output to the libxml headers */
237   if ((xml_major_version != $xml_config_major_version) ||
238       (xml_minor_version != $xml_config_minor_version) ||
239       (xml_micro_version != $xml_config_micro_version))
240     {
241       printf("*** libxml header files (version %d.%d.%d) do not match\n",
242          xml_major_version, xml_minor_version, xml_micro_version);
243       printf("*** xml2-config (version %d.%d.%d)\n",
244          $xml_config_major_version, $xml_config_minor_version, $xml_config_micro_version);
245       return 1;
246     } 
247 /* Compare the headers to the library to make sure we match */
248   /* Less than ideal -- doesn't provide us with return value feedback, 
249    * only exits if there's a serious mismatch between header and library.
250    */
251     LIBXML_TEST_VERSION;
252
253     /* Test that the library is greater than our minimum version */
254     if ((xml_major_version > major) ||
255         ((xml_major_version == major) && (xml_minor_version > minor)) ||
256         ((xml_major_version == major) && (xml_minor_version == minor) &&
257         (xml_micro_version >= micro)))
258       {
259         return 0;
260        }
261      else
262       {
263         printf("\n*** An old version of libxml (%d.%d.%d) was found.\n",
264                xml_major_version, xml_minor_version, xml_micro_version);
265         printf("*** You need a version of libxml newer than %d.%d.%d. The latest version of\n",
266            major, minor, micro);
267         printf("*** libxml is always available from ftp://ftp.xmlsoft.org.\n");
268         printf("***\n");
269         printf("*** If you have already installed a sufficiently new version, this error\n");
270         printf("*** probably means that the wrong copy of the xml2-config shell script is\n");
271         printf("*** being found. The easiest way to fix this is to remove the old version\n");
272         printf("*** of LIBXML, but you can also set the XML2_CONFIG environment to point to the\n");
273         printf("*** correct copy of xml2-config. (In this case, you will have to\n");
274         printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
275         printf("*** so that the correct libraries are found at run-time))\n");
276     }
277   return 1;
278 }
279 ],, no_xml=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
280        CFLAGS="$ac_save_CFLAGS"
281        LIBS="$ac_save_LIBS"
282      fi
283   fi
284
285   if test "x$no_xml" = x ; then
286      AC_MSG_RESULT(yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version))
287      ifelse([$2], , :, [$2])     
288   else
289      AC_MSG_RESULT(no)
290      if test "$XML2_CONFIG" = "no" ; then
291        echo "*** The xml2-config script installed by LIBXML could not be found"
292        echo "*** If libxml was installed in PREFIX, make sure PREFIX/bin is in"
293        echo "*** your path, or set the XML2_CONFIG environment variable to the"
294        echo "*** full path to xml2-config."
295      else
296        if test -f conf.xmltest ; then
297         :
298        else
299           echo "*** Could not run libxml test program, checking why..."
300           CFLAGS="$CFLAGS $XML_CFLAGS"
301           LIBS="$LIBS $XML_LIBS"
302           AC_TRY_LINK([
303 #include <libxml/xmlversion.h>
304 #include <stdio.h>
305 ],      [ LIBXML_TEST_VERSION; return 0;],
306         [ echo "*** The test program compiled, but did not run. This usually means"
307           echo "*** that the run-time linker is not finding LIBXML or finding the wrong"
308           echo "*** version of LIBXML. If it is not finding LIBXML, you'll need to set your"
309           echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
310           echo "*** to the installed location  Also, make sure you have run ldconfig if that"
311           echo "*** is required on your system"
312           echo "***"
313           echo "*** If you have an old version installed, it is best to remove it, although"
314           echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
315         [ echo "*** The test program failed to compile or link. See the file config.log for the"
316           echo "*** exact error that occured. This usually means LIBXML was incorrectly installed"
317           echo "*** or that you have moved LIBXML since it was installed. In the latter case, you"
318           echo "*** may want to edit the xml2-config script: $XML2_CONFIG" ])
319           CFLAGS="$ac_save_CFLAGS"
320           LIBS="$ac_save_LIBS"
321        fi
322      fi
323
324      XML_CFLAGS=""
325      XML_LIBS=""
326      ifelse([$3], , :, [$3])
327   fi
328   AC_SUBST(XML_CFLAGS)
329   AC_SUBST(XML_LIBS)
330   rm -f conf.xmltest
331 ])
332
333 # =========================================================================
334 # AM_PATH_MYSQL : MySQL library
335
336 dnl AM_PATH_MYSQL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
337 dnl Test for MYSQL, and define MYSQL_CFLAGS and MYSQL_LIBS
338 dnl
339 AC_DEFUN(AM_PATH_MYSQL,
340 [dnl
341 dnl Get the cflags and libraries from the mysql_config script
342 dnl
343 AC_ARG_WITH(mysql-prefix,[  --with-mysql-prefix=PFX   Prefix where MYSQL is installed (optional)],
344             mysql_prefix="$withval", mysql_prefix="")
345 AC_ARG_WITH(mysql-exec-prefix,[  --with-mysql-exec-prefix=PFX Exec prefix where MYSQL is installed (optional)],
346             mysql_exec_prefix="$withval", mysql_exec_prefix="")
347
348   if test x$mysql_exec_prefix != x ; then
349      mysql_args="$mysql_args --exec-prefix=$mysql_exec_prefix"
350      if test x${MYSQL_CONFIG+set} != xset ; then
351         MYSQL_CONFIG=$mysql_exec_prefix/bin/mysql_config
352      fi
353   fi
354   if test x$mysql_prefix != x ; then
355      mysql_args="$mysql_args --prefix=$mysql_prefix"
356      if test x${MYSQL_CONFIG+set} != xset ; then
357         MYSQL_CONFIG=$mysql_prefix/bin/mysql_config
358      fi
359   fi
360
361   AC_REQUIRE([AC_CANONICAL_TARGET])
362   AC_PATH_PROG(MYSQL_CONFIG, mysql_config, no)
363   AC_MSG_CHECKING(for MYSQL)
364   no_mysql=""
365   if test "$MYSQL_CONFIG" = "no" ; then
366     MYSQL_CFLAGS=""
367     MYSQL_LIBS=""
368     AC_MSG_RESULT(no)
369      ifelse([$2], , :, [$2])
370   else
371     MYSQL_CFLAGS=`$MYSQL_CONFIG $mysqlconf_args --cflags | sed -e "s/'//g"`
372     MYSQL_LIBS=`$MYSQL_CONFIG $mysqlconf_args --libs | sed -e "s/'//g"`
373     AC_MSG_RESULT(yes)
374     ifelse([$1], , :, [$1])
375   fi
376   AC_SUBST(MYSQL_CFLAGS)
377   AC_SUBST(MYSQL_LIBS)
378 ])
379
380 dnl Removes -I/usr/include/? from given variable
381 AC_DEFUN(CFLAGS_REMOVE_USR_INCLUDE,[
382   ac_new_flags=""
383   for i in [$]$1; do
384     case [$]i in
385     -I/usr/include|-I/usr/include/) ;;
386     *) ac_new_flags="[$]ac_new_flags [$]i" ;;
387     esac
388   done
389   $1=[$]ac_new_flags
390 ])
391     
392 dnl Removes -L/usr/lib/? from given variable
393 AC_DEFUN(LIB_REMOVE_USR_LIB,[
394   ac_new_flags=""
395   for i in [$]$1; do
396     case [$]i in
397     -L/usr/lib|-L/usr/lib/) ;;
398     *) ac_new_flags="[$]ac_new_flags [$]i" ;;
399     esac
400   done
401   $1=[$]ac_new_flags
402 ])
403
404 dnl From Bruno Haible.
405
406 AC_DEFUN(jm_ICONV,
407 [
408   dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
409   dnl those with the standalone portable libiconv installed).
410   AC_MSG_CHECKING(for iconv in $1)
411     jm_cv_func_iconv="no"
412     jm_cv_lib_iconv=no
413     jm_cv_giconv=no
414     AC_TRY_LINK([#include <stdlib.h>
415 #include <giconv.h>],
416       [iconv_t cd = iconv_open("","");
417        iconv(cd,NULL,NULL,NULL,NULL);
418        iconv_close(cd);],
419       jm_cv_func_iconv=yes
420       jm_cv_giconv=yes)
421
422     if test "$jm_cv_func_iconv" != yes; then
423       AC_TRY_LINK([#include <stdlib.h>
424 #include <iconv.h>],
425         [iconv_t cd = iconv_open("","");
426          iconv(cd,NULL,NULL,NULL,NULL);
427          iconv_close(cd);],
428         jm_cv_func_iconv=yes)
429
430         if test "$jm_cv_lib_iconv" != yes; then
431           jm_save_LIBS="$LIBS"
432           LIBS="$LIBS -lgiconv"
433           AC_TRY_LINK([#include <stdlib.h>
434 #include <giconv.h>],
435             [iconv_t cd = iconv_open("","");
436              iconv(cd,NULL,NULL,NULL,NULL);
437              iconv_close(cd);],
438             jm_cv_lib_iconv=yes
439             jm_cv_func_iconv=yes
440             jm_cv_giconv=yes)
441           LIBS="$jm_save_LIBS"
442
443       if test "$jm_cv_func_iconv" != yes; then
444         jm_save_LIBS="$LIBS"
445         LIBS="$LIBS -liconv"
446         AC_TRY_LINK([#include <stdlib.h>
447 #include <iconv.h>],
448           [iconv_t cd = iconv_open("","");
449            iconv(cd,NULL,NULL,NULL,NULL);
450            iconv_close(cd);],
451           jm_cv_lib_iconv=yes
452           jm_cv_func_iconv=yes)
453         LIBS="$jm_save_LIBS"
454         fi
455       fi
456     fi
457
458   if test "$jm_cv_func_iconv" = yes; then
459     if test "$jm_cv_giconv" = yes; then
460       AC_DEFINE(HAVE_GICONV, 1, [What header to include for iconv() function: giconv.h])
461       AC_MSG_RESULT(yes)
462       ICONV_FOUND=yes
463     else
464       AC_DEFINE(HAVE_ICONV, 1, [What header to include for iconv() function: iconv.h])
465       AC_MSG_RESULT(yes)
466       ICONV_FOUND=yes
467     fi
468   else
469     AC_MSG_RESULT(no)
470   fi
471   if test "$jm_cv_lib_iconv" = yes; then
472     if test "$jm_cv_giconv" = yes; then
473       LIBS="$LIBS -lgiconv"
474     else
475       LIBS="$LIBS -liconv"
476     fi
477   fi
478 ])
479
480 dnl CFLAGS_ADD_DIR(CFLAGS, $INCDIR)
481 dnl This function doesn't add -I/usr/include into CFLAGS
482 AC_DEFUN(CFLAGS_ADD_DIR,[
483 if test "$2" != "/usr/include" ; then
484     $1="$$1 -I$2"
485 fi
486 ])
487
488 dnl LIB_ADD_DIR(LDFLAGS, $LIBDIR)
489 dnl This function doesn't add -L/usr/lib into LDFLAGS
490 AC_DEFUN(LIB_ADD_DIR,[
491 if test "$2" != "/usr/lib" ; then
492     $1="$$1 -L$2"
493 fi
494 ])
495
496 dnl AC_ENABLE_SHARED - implement the --enable-shared flag
497 dnl Usage: AC_ENABLE_SHARED[(DEFAULT)]
498 dnl   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
499 dnl   `yes'.
500 AC_DEFUN([AC_ENABLE_SHARED],
501 [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
502 AC_ARG_ENABLE(shared,
503 changequote(<<, >>)dnl
504 <<  --enable-shared[=PKGS]    build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
505 changequote([, ])dnl
506 [p=${PACKAGE-default}
507 case $enableval in
508 yes) enable_shared=yes ;;
509 no) enable_shared=no ;;
510 *)
511   enable_shared=no
512   # Look at the argument we got.  We use all the common list separators.
513   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
514   for pkg in $enableval; do
515     if test "X$pkg" = "X$p"; then
516       enable_shared=yes
517     fi
518
519   done
520   IFS="$ac_save_ifs"
521   ;;
522 esac],
523 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
524 ])
525
526 dnl AC_ENABLE_STATIC - implement the --enable-static flag
527 dnl Usage: AC_ENABLE_STATIC[(DEFAULT)]
528 dnl   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
529 dnl   `yes'.
530 AC_DEFUN([AC_ENABLE_STATIC],
531 [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
532 AC_ARG_ENABLE(static,
533 changequote(<<, >>)dnl
534 <<  --enable-static[=PKGS]    build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
535 changequote([, ])dnl
536 [p=${PACKAGE-default}
537 case $enableval in
538 yes) enable_static=yes ;;
539 no) enable_static=no ;;
540 *)
541   enable_static=no
542   # Look at the argument we got.  We use all the common list separators.
543   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
544   for pkg in $enableval; do
545     if test "X$pkg" = "X$p"; then
546       enable_static=yes
547     fi
548   done
549   IFS="$ac_save_ifs"
550   ;;
551 esac],
552 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
553 ])
554
555 dnl AC_DISABLE_STATIC - set the default static flag to --disable-static
556 AC_DEFUN([AC_DISABLE_STATIC],
557 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
558 AC_ENABLE_STATIC(no)])