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)
40 dnl AC_PROG_CC_FLAG(flag)
41 AC_DEFUN(AC_PROG_CC_FLAG,
42 [AC_CACHE_CHECK(whether ${CC-cc} accepts -$1, ac_cv_prog_cc_$1,
43 [echo 'void f(){}' > conftest.c
44 if test -z "`${CC-cc} -$1 -c conftest.c 2>&1`"; then
52 dnl see if a declaration exists for a function or variable
53 dnl defines HAVE_function_DECL if it exists
54 dnl AC_HAVE_DECL(var, includes)
55 AC_DEFUN(AC_HAVE_DECL,
57 AC_CACHE_CHECK([for $1 declaration],ac_cv_have_$1_decl,[
58 AC_TRY_COMPILE([$2],[int i = (int)$1],
59 ac_cv_have_$1_decl=yes,ac_cv_have_$1_decl=no)])
60 if test x"$ac_cv_have_$1_decl" = x"yes"; then
61 AC_DEFINE([HAVE_]translit([$1], [a-z], [A-Z])[_DECL])
66 dnl check for a function in a library, but don't
67 dnl keep adding the same library to the LIBS variable.
68 dnl AC_LIBTESTFUNC(lib,func)
69 AC_DEFUN(AC_LIBTESTFUNC,
71 *-l$1*) AC_CHECK_FUNCS($2) ;;
72 *) AC_CHECK_LIB($1, $2)
78 dnl Define an AC_DEFINE with ifndef guard.
79 dnl AC_N_DEFINE(VARIABLE [, VALUE])
81 [cat >> confdefs.h <<\EOF
83 [#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1)
89 dnl AC_ADD_INCLUDE(VARIABLE)
90 define(AC_ADD_INCLUDE,
91 [cat >> confdefs.h <<\EOF
96 ## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
97 ## Copyright (C) 1996-1999 Free Software Foundation, Inc.
98 ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
100 ## This program is free software; you can redistribute it and/or modify
101 ## it under the terms of the GNU General Public License as published by
102 ## the Free Software Foundation; either version 2 of the License, or
103 ## (at your option) any later version.
105 ## This program is distributed in the hope that it will be useful, but
106 ## WITHOUT ANY WARRANTY; without even the implied warranty of
107 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
108 ## General Public License for more details.
110 ## You should have received a copy of the GNU General Public License
111 ## along with this program; if not, write to the Free Software
112 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
114 ## As a special exception to the GNU General Public License, if you
115 ## distribute this file as part of a program that contains a
116 ## configuration script generated by Autoconf, you may include it under
117 ## the same distribution terms that you use for the rest of that program.
119 # serial 40 AC_PROG_LIBTOOL
120 AC_DEFUN(AC_PROG_LIBTOOL,
121 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
123 # Save cache, so that ltconfig can load it
126 # Actually configure libtool. ac_aux_dir is where install-sh is found.
127 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
128 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
129 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
130 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
131 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
132 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
133 || AC_MSG_ERROR([libtool configure failed])
135 # Reload cache, that may have been modified by ltconfig
138 # This can be used to rebuild libtool when needed
139 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
141 # Always use our own libtool.
142 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
145 # Redirect the config.log output again, so that the ltconfig log is not
146 # clobbered by the next message.
150 # Macro to add for using GNU gettext.
151 # Ulrich Drepper <drepper@cygnus.com>, 1995.
153 # This file can be copied and used freely without restrictions. It can
154 # be used in projects which are not available under the GNU Public License
155 # but which still want to provide support for the GNU gettext functionality.
156 # Please note that the actual code is *not* freely available.
160 AC_DEFUN(AM_WITH_NLS,
161 [AC_MSG_CHECKING([whether NLS is requested])
162 dnl Default is enabled NLS
164 [ --disable-nls do not use Native Language Support],
165 USE_NLS=$enableval, USE_NLS=yes)
166 AC_MSG_RESULT($USE_NLS)
169 USE_INCLUDED_LIBINTL=no
171 dnl If we use NLS figure out what method
172 if test "$USE_NLS" = "yes"; then
173 AC_DEFINE(ENABLE_NLS)
174 # AC_MSG_CHECKING([whether included gettext is requested])
175 # AC_ARG_WITH(included-gettext,
176 # [ --with-included-gettext use the GNU gettext library included here],
177 # nls_cv_force_use_gnu_gettext=$withval,
178 # nls_cv_force_use_gnu_gettext=no)
179 # AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
181 dnl ad-hoc fix to prevent configure from detecting
182 dnl gettext on the system. use included-gettext as default.(rkawa)
183 nls_cv_force_use_gnu_gettext="yes"
185 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
186 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
187 dnl User does not insist on using GNU NLS library. Figure out what
188 dnl to use. If gettext or catgets are available (in this order) we
189 dnl use this. Else we have to fall back to GNU NLS library.
190 dnl catgets is only used if permitted by option --with-catgets.
195 AC_CHECK_HEADER(libintl.h,
196 [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
197 [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
198 gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
200 if test "$gt_cv_func_gettext_libc" != "yes"; then
201 AC_CHECK_LIB(intl, bindtextdomain,
202 [AC_CACHE_CHECK([for gettext in libintl],
203 gt_cv_func_gettext_libintl,
204 [AC_CHECK_LIB(intl, gettext,
205 gt_cv_func_gettext_libintl=yes,
206 gt_cv_func_gettext_libintl=no)],
207 gt_cv_func_gettext_libintl=no)])
210 if test "$gt_cv_func_gettext_libc" = "yes" \
211 || test "$gt_cv_func_gettext_libintl" = "yes"; then
212 AC_DEFINE(HAVE_GETTEXT)
213 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
214 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
215 if test "$MSGFMT" != "no"; then
216 AC_CHECK_FUNCS(dcgettext)
217 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
218 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
219 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
220 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
221 return _nl_msg_cat_cntr],
231 if test "$CATOBJEXT" = "NONE"; then
232 # AC_MSG_CHECKING([whether catgets can be used])
233 # AC_ARG_WITH(catgets,
234 # [ --with-catgets use catgets functions if available],
235 # nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
236 # AC_MSG_RESULT($nls_cv_use_catgets)
238 dnl ad-hoc fix to prevent configure to detect catgets library.
240 nls_cv_use_catgets="no"
242 if test "$nls_cv_use_catgets" = "yes"; then
243 dnl No gettext in C library. Try catgets next.
244 AC_CHECK_LIB(i, main)
245 AC_CHECK_FUNC(catgets,
246 [AC_DEFINE(HAVE_CATGETS)
247 INTLOBJS="\$(CATOBJS)"
248 AC_PATH_PROG(GENCAT, gencat, no)dnl
249 if test "$GENCAT" != "no"; then
250 AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
251 if test "$GMSGFMT" = "no"; then
252 AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
253 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
255 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
256 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
257 USE_INCLUDED_LIBINTL=yes
261 INTLDEPS='$(top_builddir)/intl/libintl.a'
263 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
264 nls_cv_header_intl=intl/libintl.h
265 nls_cv_header_libgt=intl/libgettext.h
270 if test "$CATOBJEXT" = "NONE"; then
271 dnl Neither gettext nor catgets in included in the C library.
272 dnl Fall back on GNU gettext library.
273 nls_cv_use_gnu_gettext=yes
277 if test "$nls_cv_use_gnu_gettext" = "yes"; then
278 dnl Mark actions used to generate GNU NLS library.
279 INTLOBJS="\$(GETTOBJS)"
280 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
281 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
282 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
283 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
284 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
286 USE_INCLUDED_LIBINTL=yes
290 INTLDEPS='$(top_builddir)/intl/libintl.a'
292 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
293 nls_cv_header_intl=intl/libintl.h
294 nls_cv_header_libgt=intl/libgettext.h
297 dnl Test whether we really found GNU xgettext.
298 if test "$XGETTEXT" != ":"; then
299 dnl If it is no GNU xgettext we define it as : so that the
300 dnl Makefiles still can work.
301 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
305 [found xgettext program is not GNU xgettext; ignore it])
310 # We need to process the po/ directory.
314 nls_cv_header_intl=intl/libintl.h
315 nls_cv_header_libgt=intl/libgettext.h
318 dnl the next line has been modified by rkawa to avoid
319 dnl misconfiguration of intl/libintl.h symlink.
322 AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
324 [case "$CONFIG_FILES" in *po/Makefile.in*)
325 sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
329 # If this is used in GNU gettext we have to set USE_NLS to `yes'
330 # because some of the sources are only built for this goal.
331 if test "$PACKAGE" = gettext; then
333 USE_INCLUDED_LIBINTL=yes
336 dnl These rules are solely for the distribution goal. While doing this
337 dnl we only have to keep exactly one list of the available catalogs
339 for lang in $ALL_LINGUAS; do
340 GMOFILES="$GMOFILES $lang.gmo"
341 POFILES="$POFILES $lang.po"
344 dnl Make all variables we use known to autoconf.
345 AC_SUBST(USE_INCLUDED_LIBINTL)
348 AC_SUBST(DATADIRNAME)
358 AC_DEFUN(AM_GNU_GETTEXT,
359 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
360 AC_REQUIRE([AC_PROG_CC])dnl
361 AC_REQUIRE([AC_PROG_RANLIB])dnl
362 AC_REQUIRE([AC_ISC_POSIX])dnl
363 AC_REQUIRE([AC_HEADER_STDC])dnl
364 AC_REQUIRE([AC_C_CONST])dnl
365 AC_REQUIRE([AC_C_INLINE])dnl
366 AC_REQUIRE([AC_TYPE_OFF_T])dnl
367 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
368 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
369 AC_REQUIRE([AC_FUNC_MMAP])dnl
371 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
372 unistd.h sys/param.h])
373 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
374 strdup __argz_count __argz_stringify __argz_next])
376 if test "${ac_cv_func_stpcpy+set}" != "set"; then
377 AC_CHECK_FUNCS(stpcpy)
379 if test "${ac_cv_func_stpcpy}" = "yes"; then
380 AC_DEFINE(HAVE_STPCPY)
387 if test "x$CATOBJEXT" != "x"; then
388 if test "x$ALL_LINGUAS" = "x"; then
391 AC_MSG_CHECKING(for catalogs to be installed)
393 for lang in ${LINGUAS=$ALL_LINGUAS}; do
394 case "$ALL_LINGUAS" in
395 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
399 AC_MSG_RESULT($LINGUAS)
402 dnl Construct list of names of catalog files to be constructed.
403 if test -n "$LINGUAS"; then
404 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
408 dnl The reference to <locale.h> in the installed <libintl.h> file
409 dnl must be resolved because we cannot expect the users of this
410 dnl to define HAVE_LOCALE_H.
411 if test $ac_cv_header_locale_h = yes; then
412 INCLUDE_LOCALE_H="#include <locale.h>"
415 /* The system does not provide the header <locale.h>. Take care yourself. */"
417 AC_SUBST(INCLUDE_LOCALE_H)
418 dnl Determine which catalog format we have (if any is needed)
419 dnl For now we know about two different formats:
420 dnl Linux libc-5 and the normal X/Open format
421 test -d intl || mkdir intl
422 if test "$CATOBJEXT" = ".cat"; then
423 AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
425 dnl Transform the SED scripts while copying because some dumb SEDs
426 dnl cannot handle comments.
427 sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
429 dnl To avoid XPG incompatible SED to be used, .msg files of
430 dnl x/open format are included to the archive, rather than
431 dnl compiled in the installation. If the system uses linux libc5
432 dnl format, then x/open files are removed and the sed script
433 dnl creates the files of the correct format. (rkawa)
434 if test "$msgformat" = "linux"; then
435 rm -f $srcdir/po/*.msg
438 dnl po2tbl.sed is always needed.
439 sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
440 $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
442 dnl In the intl/Makefile.in we have a special dependency which makes
443 dnl only sense for gettext. We comment this out for non-gettext
445 if test "$PACKAGE" = "gettext"; then
455 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
456 dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
457 dnl Try to locate is.
459 if test -n "$ac_aux_dir"; then
460 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
462 if test -z "$MKINSTALLDIRS"; then
463 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
465 AC_SUBST(MKINSTALLDIRS)
467 dnl *** For now the libtool support in intl/Makefile is not for real.
471 dnl Generate list of files to be processed by xgettext which will
472 dnl be included in po/Makefile.
473 test -d po || mkdir po
474 if test "x$srcdir" != "x."; then
475 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
476 posrcprefix="$srcdir/"
478 posrcprefix="../$srcdir/"
484 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
485 < $srcdir/po/POTFILES.in > po/POTFILES
488 # Check whether LC_MESSAGES is available in <locale.h>.
489 # Ulrich Drepper <drepper@cygnus.com>, 1995.
491 # This file can be copied and used freely without restrictions. It can
492 # be used in projects which are not available under the GNU Public License
493 # but which still want to provide support for the GNU gettext functionality.
494 # Please note that the actual code is *not* freely available.
498 AC_DEFUN(AM_LC_MESSAGES,
499 [if test $ac_cv_header_locale_h = yes; then
500 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
501 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
502 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
503 if test $am_cv_val_LC_MESSAGES = yes; then
504 AC_DEFINE(HAVE_LC_MESSAGES)
508 # Search path for a program which passes the given test.
509 # Ulrich Drepper <drepper@cygnus.com>, 1996.
511 # This file can be copied and used freely without restrictions. It can
512 # be used in projects which are not available under the GNU Public License
513 # but which still want to provide support for the GNU gettext functionality.
514 # Please note that the actual code is *not* freely available.
518 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
519 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
520 AC_DEFUN(AM_PATH_PROG_WITH_TEST,
521 [# Extract the first word of "$2", so it can be a program name with args.
522 set dummy $2; ac_word=[$]2
523 AC_MSG_CHECKING([for $ac_word])
524 AC_CACHE_VAL(ac_cv_path_$1,
527 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
530 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
531 for ac_dir in ifelse([$5], , $PATH, [$5]); do
532 test -z "$ac_dir" && ac_dir=.
533 if test -f $ac_dir/$ac_word; then
535 ac_cv_path_$1="$ac_dir/$ac_word"
541 dnl If no 4th arg is given, leave the cache variable unset,
542 dnl so AC_PATH_PROGS will keep looking.
543 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
548 if test -n "[$]$1"; then
557 AC_DEFUN(AC_LIBTOOL_SETUP,
559 AC_REQUIRE([AC_ENABLE_SHARED])dnl
560 AC_REQUIRE([AC_ENABLE_STATIC])dnl
561 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
562 AC_REQUIRE([AC_CANONICAL_HOST])dnl
563 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
564 AC_REQUIRE([AC_PROG_RANLIB])dnl
565 AC_REQUIRE([AC_PROG_CC])dnl
566 AC_REQUIRE([AC_PROG_LD])dnl
567 AC_REQUIRE([AC_PROG_NM])dnl
568 AC_REQUIRE([AC_PROG_LN_S])dnl
572 NONE) lt_target="$host" ;;
573 *) lt_target="$target" ;;
576 # Check for any special flags to pass to ltconfig.
577 libtool_flags="--cache-file=$cache_file"
578 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
579 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
580 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
581 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
582 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
583 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
584 [libtool_flags="$libtool_flags --enable-dlopen"])
585 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
586 [libtool_flags="$libtool_flags --enable-win32-dll"])
587 AC_ARG_ENABLE(libtool-lock,
588 [ --disable-libtool-lock avoid locking (might break parallel builds)])
589 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
590 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
592 # Some flags need to be propagated to the compiler or linker for good
596 # Find out which ABI we are using.
597 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
598 if AC_TRY_EVAL(ac_compile); then
599 case "`/usr/bin/file conftest.o`" in
615 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
616 SAVE_CFLAGS="$CFLAGS"
617 CFLAGS="$CFLAGS -belf"
618 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
619 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
620 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
621 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
622 CFLAGS="$SAVE_CFLAGS"
626 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
627 [*-*-cygwin* | *-*-mingw*)
628 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
629 AC_CHECK_TOOL(AS, as, false)
630 AC_CHECK_TOOL(OBJDUMP, objdump, false)
636 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
637 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
639 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
640 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
642 # AC_ENABLE_SHARED - implement the --enable-shared flag
643 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
644 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
646 AC_DEFUN(AC_ENABLE_SHARED, [dnl
647 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
648 AC_ARG_ENABLE(shared,
649 changequote(<<, >>)dnl
650 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
652 [p=${PACKAGE-default}
654 yes) enable_shared=yes ;;
655 no) enable_shared=no ;;
658 # Look at the argument we got. We use all the common list separators.
659 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
660 for pkg in $enableval; do
661 if test "X$pkg" = "X$p"; then
668 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
671 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
672 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
673 AC_ENABLE_SHARED(no)])
675 # AC_ENABLE_STATIC - implement the --enable-static flag
676 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
677 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
679 AC_DEFUN(AC_ENABLE_STATIC, [dnl
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 # AC_DISABLE_STATIC - set the default static flag to --disable-static
705 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
706 AC_ENABLE_STATIC(no)])
709 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
710 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
711 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
713 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
714 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
715 AC_ARG_ENABLE(fast-install,
716 changequote(<<, >>)dnl
717 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
719 [p=${PACKAGE-default}
721 yes) enable_fast_install=yes ;;
722 no) enable_fast_install=no ;;
724 enable_fast_install=no
725 # Look at the argument we got. We use all the common list separators.
726 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
727 for pkg in $enableval; do
728 if test "X$pkg" = "X$p"; then
729 enable_fast_install=yes
735 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
738 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
739 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
740 AC_ENABLE_FAST_INSTALL(no)])
742 # AC_PROG_LD - find the path to the GNU or non-GNU linker
745 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
746 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
747 AC_REQUIRE([AC_PROG_CC])dnl
748 AC_REQUIRE([AC_CANONICAL_HOST])dnl
749 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
751 if test "$ac_cv_prog_gcc" = yes; then
752 # Check if gcc -print-prog-name=ld gives a path.
753 AC_MSG_CHECKING([for ld used by GCC])
754 ac_prog=`($CC -print-prog-name=ld) 2>&5`
756 # Accept absolute paths.
758 [\\/]* | [A-Za-z]:[\\/]*)
759 re_direlt='/[^/][^/]*/\.\./'
761 # Canonicalize the path of ld
762 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
763 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
764 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
766 test -z "$LD" && LD="$ac_prog"
769 # If it fails, then pretend we aren't using GCC.
773 # If it is relative, then search for the first ld in PATH.
777 elif test "$with_gnu_ld" = yes; then
778 AC_MSG_CHECKING([for GNU ld])
780 AC_MSG_CHECKING([for non-GNU ld])
782 AC_CACHE_VAL(ac_cv_path_LD,
783 [if test -z "$LD"; then
784 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
785 for ac_dir in $PATH; do
786 test -z "$ac_dir" && ac_dir=.
787 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
788 ac_cv_path_LD="$ac_dir/$ac_prog"
789 # Check to see if the program is GNU ld. I'd rather use --version,
790 # but apparently some GNU ld's only accept -v.
791 # Break only if it was the GNU/non-GNU ld that we prefer.
792 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
793 test "$with_gnu_ld" != no && break
795 test "$with_gnu_ld" != yes && break
801 ac_cv_path_LD="$LD" # Let the user override the test with a path.
804 if test -n "$LD"; then
809 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
813 AC_DEFUN(AC_PROG_LD_GNU,
814 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
815 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
816 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
817 ac_cv_prog_gnu_ld=yes
823 # AC_PROG_NM - find the path to a BSD-compatible name lister
825 [AC_MSG_CHECKING([for BSD-compatible nm])
826 AC_CACHE_VAL(ac_cv_path_NM,
827 [if test -n "$NM"; then
828 # Let the user override the test.
831 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
832 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
833 test -z "$ac_dir" && ac_dir=.
834 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
835 # Check to see if the nm accepts a BSD-compat flag.
836 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
837 # nm: unknown option "B" ignored
838 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
839 ac_cv_path_NM="$ac_dir/nm -B"
841 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
842 ac_cv_path_NM="$ac_dir/nm -p"
845 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
846 continue # so that we can try to find one that supports BSD flags
851 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
857 # AC_CHECK_LIBM - check for math library
858 AC_DEFUN(AC_CHECK_LIBM,
859 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
862 *-*-beos* | *-*-cygwin*)
863 # These system don't have libm
866 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
867 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
870 AC_CHECK_LIB(m, main, LIBM="-lm")
875 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
876 # the libltdl convenience library, adds --enable-ltdl-convenience to
877 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
878 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
879 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
880 # '${top_builddir}/' (note the single quotes!) if your package is not
881 # flat, and, if you're not using automake, define top_builddir as
882 # appropriate in the Makefiles.
883 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
884 case "$enable_ltdl_convenience" in
885 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
886 "") enable_ltdl_convenience=yes
887 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
889 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
890 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
893 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
894 # the libltdl installable library, and adds --enable-ltdl-install to
895 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
896 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
897 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
898 # '${top_builddir}/' (note the single quotes!) if your package is not
899 # flat, and, if you're not using automake, define top_builddir as
900 # appropriate in the Makefiles.
901 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
902 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
903 AC_CHECK_LIB(ltdl, main,
904 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
905 [if test x"$enable_ltdl_install" = xno; then
906 AC_MSG_WARN([libltdl not installed, but installation disabled])
908 enable_ltdl_install=yes
911 if test x"$enable_ltdl_install" = x"yes"; then
912 ac_configure_args="$ac_configure_args --enable-ltdl-install"
913 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
914 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
916 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
923 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
924 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
925 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
926 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
927 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
928 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
929 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
931 dnl This is just to silence aclocal about the macro not being used
932 ifelse([AC_DISABLE_FAST_INSTALL])dnl