1 dnl aclocal.m4 generated automatically by aclocal 1.4
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
13 sinclude(../bfd/acinclude.m4)
15 # Do all the work for Automake. This macro actually does too much --
16 # some checks are only needed if your package does certain things.
17 # But this isn't really a big deal.
22 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
24 AC_DEFUN(AM_INIT_AUTOMAKE,
25 [AC_REQUIRE([AC_PROG_INSTALL])
30 dnl test to see if srcdir already configured
31 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
32 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
35 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
36 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
37 AC_REQUIRE([AM_SANITY_CHECK])
38 AC_REQUIRE([AC_ARG_PROGRAM])
39 dnl FIXME This is truly gross.
40 missing_dir=`cd $ac_aux_dir && pwd`
41 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
42 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
43 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
44 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
45 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
46 AC_REQUIRE([AC_PROG_MAKE_SET])])
49 # Check to make sure that the build environment is sane.
52 AC_DEFUN(AM_SANITY_CHECK,
53 [AC_MSG_CHECKING([whether build environment is sane])
56 echo timestamp > conftestfile
57 # Do `set' in a subshell so we don't clobber the current shell's
58 # arguments. Must try -L first in case configure is actually a
59 # symlink; some systems play weird games with the mod time of symlinks
60 # (eg FreeBSD returns the mod time of the symlink's containing
63 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
64 if test "[$]*" = "X"; then
66 set X `ls -t $srcdir/configure conftestfile`
68 if test "[$]*" != "X $srcdir/configure conftestfile" \
69 && test "[$]*" != "X conftestfile $srcdir/configure"; then
71 # If neither matched, then we have a broken ls. This can happen
72 # if, for instance, CONFIG_SHELL is bash and it inherits a
73 # broken ls alias from the environment. This has actually
74 # happened. Such a system could not be considered "sane".
75 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
76 alias in your environment])
79 test "[$]2" = conftestfile
85 AC_MSG_ERROR([newly created file is older than distributed files!
86 Check your system clock])
91 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
92 dnl The program must properly implement --version.
93 AC_DEFUN(AM_MISSING_PROG,
94 [AC_MSG_CHECKING(for working $2)
95 # Run test in a subshell; some versions of sh will print an error if
96 # an executable is not found, even if stderr is redirected.
97 # Redirect stdin to placate older versions of autoconf. Sigh.
98 if ($2 --version) < /dev/null > /dev/null 2>&1; then
103 AC_MSG_RESULT(missing)
108 # serial 35 AC_PROG_LIBTOOL
109 AC_DEFUN(AC_PROG_LIBTOOL,
110 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
112 # Save cache, so that ltconfig can load it
115 # Actually configure libtool. ac_aux_dir is where install-sh is found.
116 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
117 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
118 DLLTOOL="$DLLTOOL" AS="$AS" \
119 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
120 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
121 || AC_MSG_ERROR([libtool configure failed])
123 # Reload cache, that may have been modified by ltconfig
126 # This can be used to rebuild libtool when needed
127 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
129 # Always use our own libtool.
130 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
133 # Redirect the config.log output again, so that the ltconfig log is not
134 # clobbered by the next message.
138 AC_DEFUN(AC_LIBTOOL_SETUP,
140 AC_REQUIRE([AC_ENABLE_SHARED])dnl
141 AC_REQUIRE([AC_ENABLE_STATIC])dnl
142 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
143 AC_REQUIRE([AC_CANONICAL_HOST])dnl
144 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
145 AC_REQUIRE([AC_PROG_RANLIB])dnl
146 AC_REQUIRE([AC_PROG_CC])dnl
147 AC_REQUIRE([AC_PROG_LD])dnl
148 AC_REQUIRE([AC_PROG_NM])dnl
149 AC_REQUIRE([AC_SYS_NM_PARSE])dnl
150 AC_REQUIRE([AC_SYS_SYMBOL_UNDERSCORE])dnl
151 AC_REQUIRE([AC_PROG_LN_S])dnl
154 # Check for any special flags to pass to ltconfig.
155 libtool_flags="--cache-file=$cache_file"
156 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
157 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
158 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
159 test "$lt_dlopen" = yes && libtool_flags="$libtool_flags --enable-dlopen"
160 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
161 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
162 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
164 # Some flags need to be propagated to the compiler or linker for good
168 # Find out which ABI we are using.
169 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
170 if AC_TRY_EVAL(ac_compile); then
171 case "`/usr/bin/file conftest.o`" in
187 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
188 SAVE_CFLAGS="$CFLAGS"
189 CFLAGS="$CFLAGS -belf"
190 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
191 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
192 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
193 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
194 CFLAGS="$SAVE_CFLAGS"
199 AC_SYS_LIBTOOL_CYGWIN
204 # enable the --disable-libtool-lock switch
206 AC_ARG_ENABLE(libtool-lock,
207 [ --disable-libtool-lock force libtool not to do file locking],
208 need_locks=$enableval,
211 if test x"$need_locks" = xno; then
212 libtool_flags="$libtool_flags --disable-lock"
216 # AC_LIBTOOL_DLOPEN - check for dlopen support
217 AC_DEFUN(AC_LIBTOOL_DLOPEN, [lt_dlopen=yes])
219 # AC_ENABLE_SHARED - implement the --enable-shared flag
220 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
221 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
223 AC_DEFUN(AC_ENABLE_SHARED,
224 [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
225 AC_ARG_ENABLE(shared,
226 changequote(<<, >>)dnl
227 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
229 [p=${PACKAGE-default}
231 yes) enable_shared=yes ;;
232 no) enable_shared=no ;;
235 # Look at the argument we got. We use all the common list separators.
236 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
237 for pkg in $enableval; do
238 if test "X$pkg" = "X$p"; then
245 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
248 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
249 AC_DEFUN(AC_DISABLE_SHARED,
250 [AC_ENABLE_SHARED(no)])
252 # AC_ENABLE_STATIC - implement the --enable-static flag
253 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
254 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
256 AC_DEFUN(AC_ENABLE_STATIC,
257 [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
258 AC_ARG_ENABLE(static,
259 changequote(<<, >>)dnl
260 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
262 [p=${PACKAGE-default}
264 yes) enable_static=yes ;;
265 no) enable_static=no ;;
268 # Look at the argument we got. We use all the common list separators.
269 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
270 for pkg in $enableval; do
271 if test "X$pkg" = "X$p"; then
278 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
281 # AC_DISABLE_STATIC - set the default static flag to --disable-static
282 AC_DEFUN(AC_DISABLE_STATIC,
283 [AC_ENABLE_STATIC(no)])
286 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
287 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
288 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
290 AC_DEFUN(AC_ENABLE_FAST_INSTALL,
291 [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
292 AC_ARG_ENABLE(fast-install,
293 changequote(<<, >>)dnl
294 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
296 [p=${PACKAGE-default}
298 yes) enable_fast_install=yes ;;
299 no) enable_fast_install=no ;;
301 enable_fast_install=no
302 # Look at the argument we got. We use all the common list separators.
303 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
304 for pkg in $enableval; do
305 if test "X$pkg" = "X$p"; then
306 enable_fast_install=yes
312 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
315 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
316 AC_DEFUN(AC_DISABLE_FAST_INSTALL,
317 [AC_ENABLE_FAST_INSTALL(no)])
320 # AC_PROG_LD - find the path to the GNU or non-GNU linker
323 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
324 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
325 AC_REQUIRE([AC_PROG_CC])dnl
326 AC_REQUIRE([AC_CANONICAL_HOST])dnl
327 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
329 if test "$ac_cv_prog_gcc" = yes; then
330 # Check if gcc -print-prog-name=ld gives a path.
331 AC_MSG_CHECKING([for ld used by GCC])
332 ac_prog=`($CC -print-prog-name=ld) 2>&5`
334 # Accept absolute paths.
336 /* | [A-Za-z]:[\\/]*)
337 re_direlt='/[^/][^/]*/\.\./'
339 # Canonicalize the path of ld
340 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
341 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
342 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
344 test -z "$LD" && LD="$ac_prog"
347 # If it fails, then pretend we aren't using GCC.
351 # If it is relative, then search for the first ld in PATH.
355 elif test "$with_gnu_ld" = yes; then
356 AC_MSG_CHECKING([for GNU ld])
358 AC_MSG_CHECKING([for non-GNU ld])
360 AC_CACHE_VAL(ac_cv_path_LD,
361 [if test -z "$LD"; then
362 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
363 for ac_dir in $PATH; do
364 test -z "$ac_dir" && ac_dir=.
365 if test -f "$ac_dir/$ac_prog"; then
366 ac_cv_path_LD="$ac_dir/$ac_prog"
367 # Check to see if the program is GNU ld. I'd rather use --version,
368 # but apparently some GNU ld's only accept -v.
369 # Break only if it was the GNU/non-GNU ld that we prefer.
370 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
371 test "$with_gnu_ld" != no && break
373 test "$with_gnu_ld" != yes && break
379 ac_cv_path_LD="$LD" # Let the user override the test with a path.
382 if test -n "$LD"; then
387 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
392 AC_DEFUN(AC_PROG_LD_GNU,
393 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
394 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
395 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
396 ac_cv_prog_gnu_ld=yes
402 # AC_PROG_NM - find the path to a BSD-compatible name lister
404 [AC_MSG_CHECKING([for BSD-compatible nm])
405 AC_CACHE_VAL(ac_cv_path_NM,
406 [if test -n "$NM"; then
407 # Let the user override the test.
410 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
411 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
412 test -z "$ac_dir" && ac_dir=.
413 if test -f $ac_dir/nm; then
414 # Check to see if the nm accepts a BSD-compat flag.
415 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
416 # nm: unknown option "B" ignored
417 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
418 ac_cv_path_NM="$ac_dir/nm -B"
420 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
421 ac_cv_path_NM="$ac_dir/nm -p"
424 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
425 continue # so that we can try to find one that supports BSD flags
430 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
437 # AC_SYS_NM_PARSE - Check for command to grab the raw symbol name followed
438 # by C symbol name from nm.
439 AC_DEFUN(AC_SYS_NM_PARSE,
440 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
441 AC_REQUIRE([AC_PROG_NM])dnl
442 # Check for command to grab the raw symbol name followed by C symbol from nm.
443 AC_MSG_CHECKING([command to parse $NM output])
444 AC_CACHE_VAL(ac_cv_sys_global_symbol_pipe,
445 [# These are sane defaults that work on at least a few old systems.
446 # {They come from Ultrix. What could be older than Ultrix?!! ;)}
449 # Character class describing NM global symbol codes.
450 ac_symcode='[BCDEGRST]'
452 # Regexp to match symbols that can be accessed directly from C.
453 ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
455 # Transform the above into a raw symbol and a C symbol.
456 ac_symxfrm='\1 \2\3 \3'
458 # Transform an extracted symbol line into a proper C declaration
459 ac_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
461 # Define system-specific variables.
467 ac_symcode='[ABCDGISTW]'
470 ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
473 ac_symcode='[BCDEGRST]'
480 # If we're using GNU nm, then use its standard symbol codes.
481 if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
482 ac_symcode='[ABCDGISTW]'
486 # Try without a prefix undercore, then with it.
487 for ac_symprfx in "" "_"; do
489 ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($ac_symcode\)[ ][ ]*\($ac_symprfx\)$ac_sympat$/$ac_symxfrm/p'"
491 # Check to see that the pipe works correctly.
493 rm -f conftest.$ac_ext
494 cat > conftest.$ac_ext <<EOF
499 void nm_test_func(){}
503 int main(){nm_test_var='a';nm_test_func;return 0;}
506 if AC_TRY_EVAL(ac_compile); then
507 # Now try to grab the symbols.
510 if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
512 # Try sorting and uniquifying the output.
513 if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
514 mv -f "$ac_nlist"T "$ac_nlist"
519 # Make sure that we snagged all the symbols we need.
520 if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
521 if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
522 cat <<EOF > conftest.c
528 # Now generate the symbol file.
529 eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c'
531 cat <<EOF >> conftest.c
532 #if defined (__STDC__) && __STDC__
533 # define lt_ptr_t void *
535 # define lt_ptr_t char *
539 /* The mapping between symbol names and symbols. */
545 lt_preloaded_symbols[] =
549 sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
550 cat <<\EOF >> conftest.c
558 # Now try linking the two files.
559 mv conftest.$ac_objext conftestm.$ac_objext
561 ac_save_CFLAGS="$CFLAGS"
562 LIBS="conftestm.$ac_objext"
563 CFLAGS="$CFLAGS$no_builtin_flag"
564 if AC_TRY_EVAL(ac_link) && test -s conftest; then
567 echo "configure: failed program was:" >&AC_FD_CC
568 cat conftest.c >&AC_FD_CC
571 CFLAGS="$ac_save_CFLAGS"
573 echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
576 echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC
579 echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
582 echo "$progname: failed program was:" >&AC_FD_CC
583 cat conftest.c >&AC_FD_CC
587 # Do not use the global_symbol_pipe unless it works.
588 if test "$ac_pipe_works" = yes; then
589 if test x"$ac_symprfx" = x"_"; then
590 ac_cv_sys_symbol_underscore=yes
592 ac_cv_sys_symbol_underscore=no
596 ac_cv_sys_global_symbol_pipe=
602 if test -z "$ac_cv_sys_global_symbol_pipe"; then
605 AC_MSG_RESULT($ac_result)
608 # AC_SYS_LIBTOOL_CYGWIN - find tools needed on cygwin
609 AC_DEFUN(AC_SYS_LIBTOOL_CYGWIN,
610 [AC_CHECK_TOOL(DLLTOOL, dlltool, false)
611 AC_CHECK_TOOL(AS, as, false)
614 # AC_SYS_SYMBOL_UNDERSCORE - does the compiler prefix global symbols
615 # with an underscore?
616 AC_DEFUN(AC_SYS_SYMBOL_UNDERSCORE,
617 [AC_REQUIRE([AC_PROG_NM])dnl
618 AC_REQUIRE([AC_SYS_NM_PARSE])dnl
619 AC_MSG_CHECKING([for _ prefix in compiled symbols])
620 AC_CACHE_VAL(ac_cv_sys_symbol_underscore,
621 [ac_cv_sys_symbol_underscore=no
622 cat > conftest.$ac_ext <<EOF
623 void nm_test_func(){}
624 int main(){nm_test_func;return 0;}
626 if AC_TRY_EVAL(ac_compile); then
627 # Now try to grab the symbols.
629 if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
630 # See whether the symbols have a leading underscore.
631 if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
632 ac_cv_sys_symbol_underscore=yes
634 if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
637 echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
641 echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
644 echo "configure: failed program was:" >&AC_FD_CC
645 cat conftest.c >&AC_FD_CC
649 AC_MSG_RESULT($ac_cv_sys_symbol_underscore)
650 USE_SYMBOL_UNDERSCORE=${ac_cv_sys_symbol_underscore=no}
651 AC_SUBST(USE_SYMBOL_UNDERSCORE)dnl
654 # AC_CHECK_LIBM - check for math library
655 AC_DEFUN(AC_CHECK_LIBM, [
656 AC_CHECK_LIB(mw, _mwvalidcheckl)
660 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
661 # the libltdl convenience library, adds --enable-ltdl-convenience to
662 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
663 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
664 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
665 # '${top_builddir}/' (note the single quotes!) if your package is not
666 # flat, and, if you're not using automake, define top_builddir as
667 # appropriate in the Makefiles.
668 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [
669 case "$enable_ltdl_convenience" in
670 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
671 "") enable_ltdl_convenience=yes
672 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
674 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
677 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
678 # the libltdl installable library, and adds --enable-ltdl-install to
679 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
680 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
681 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
682 # '${top_builddir}/' (note the single quotes!) if your package is not
683 # flat, and, if you're not using automake, define top_builddir as
684 # appropriate in the Makefiles.
685 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
686 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [
687 AC_CHECK_LIB(ltdl, main, LIBLTDL="-lltdl", [
688 case "$enable_ltdl_install" in
689 no) AC_MSG_WARN([libltdl not installed, but installation disabled]) ;;
690 "") enable_ltdl_install=yes
691 ac_configure_args="$ac_configure_args --enable-ltdl-install" ;;
694 if test x"$enable_ltdl_install" != x"no"; then
695 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
700 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
701 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
702 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
703 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
704 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
705 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
706 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
707 AC_DEFUN(AM_SYS_NM_PARSE, [indir([AC_SYS_NM_PARSE])])dnl
708 AC_DEFUN(AM_SYS_SYMBOL_UNDERSCORE, [indir([AC_SYS_SYMBOL_UNDERSCORE])])dnl
709 AC_DEFUN(AM_SYS_LIBTOOL_CYGWIN, [indir([AC_SYS_LIBTOOL_CYGWIN])])dnl
711 # Like AC_CONFIG_HEADER, but automatically create stamp file.
713 AC_DEFUN(AM_CONFIG_HEADER,
715 AC_CONFIG_HEADER([$1])
716 dnl When config.status generates a header, we must update the stamp-h file.
717 dnl This file resides in the same directory as the config header
718 dnl that is generated. We must strip everything past the first ":",
719 dnl and everything past the last "/".
720 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
721 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
722 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
724 for am_file in <<$1>>; do
725 case " <<$>>CONFIG_HEADERS " in
726 *" <<$>>am_file "*<<)>>
727 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
730 am_indx=`expr "<<$>>am_indx" + 1`
734 # Add --enable-maintainer-mode option to configure.
739 AC_DEFUN(AM_MAINTAINER_MODE,
740 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
741 dnl maintainer-mode is disabled by default
742 AC_ARG_ENABLE(maintainer-mode,
743 [ --enable-maintainer-mode enable make rules and dependencies not useful
744 (and sometimes confusing) to the casual installer],
745 USE_MAINTAINER_MODE=$enableval,
746 USE_MAINTAINER_MODE=no)
747 AC_MSG_RESULT($USE_MAINTAINER_MODE)
748 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
749 MAINT=$MAINTAINER_MODE_TRUE
754 # Define a conditional.
756 AC_DEFUN(AM_CONDITIONAL,
767 # This file is derived from `gettext.m4'. The difference is that the
768 # included macros assume Cygnus-style source and build trees.
770 # Macro to add for using GNU gettext.
771 # Ulrich Drepper <drepper@cygnus.com>, 1995.
773 # This file file be copied and used freely without restrictions. It can
774 # be used in projects which are not available under the GNU Public License
775 # but which still want to provide support for the GNU gettext functionality.
776 # Please note that the actual code is *not* freely available.
780 AC_DEFUN(CY_WITH_NLS,
781 [AC_MSG_CHECKING([whether NLS is requested])
782 dnl Default is enabled NLS
784 [ --disable-nls do not use Native Language Support],
785 USE_NLS=$enableval, USE_NLS=yes)
786 AC_MSG_RESULT($USE_NLS)
789 USE_INCLUDED_LIBINTL=no
791 dnl If we use NLS figure out what method
792 if test "$USE_NLS" = "yes"; then
793 AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS is requested])
794 AC_MSG_CHECKING([whether included gettext is requested])
795 AC_ARG_WITH(included-gettext,
796 [ --with-included-gettext use the GNU gettext library included here],
797 nls_cv_force_use_gnu_gettext=$withval,
798 nls_cv_force_use_gnu_gettext=no)
799 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
801 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
802 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
803 dnl User does not insist on using GNU NLS library. Figure out what
804 dnl to use. If gettext or catgets are available (in this order) we
805 dnl use this. Else we have to fall back to GNU NLS library.
806 dnl catgets is only used if permitted by option --with-catgets.
811 AC_CHECK_HEADER(libintl.h,
812 [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
813 [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
814 gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
816 if test "$gt_cv_func_gettext_libc" != "yes"; then
817 AC_CHECK_LIB(intl, bindtextdomain,
818 [AC_CACHE_CHECK([for gettext in libintl],
819 gt_cv_func_gettext_libintl,
820 [AC_TRY_LINK([], [return (int) gettext ("")],
821 gt_cv_func_gettext_libintl=yes,
822 gt_cv_func_gettext_libintl=no)])])
825 if test "$gt_cv_func_gettext_libc" = "yes" \
826 || test "$gt_cv_func_gettext_libintl" = "yes"; then
827 AC_DEFINE(HAVE_GETTEXT, 1,
828 [Define as 1 if you have gettext and don't want to use GNU gettext.])
829 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
830 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
831 if test "$MSGFMT" != "no"; then
832 AC_CHECK_FUNCS(dcgettext)
833 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
834 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
835 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
836 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
837 return _nl_msg_cat_cntr],
847 dnl In the standard gettext, we would now check for catgets.
848 dnl However, we never want to use catgets for our releases.
850 if test "$CATOBJEXT" = "NONE"; then
851 dnl Neither gettext nor catgets in included in the C library.
852 dnl Fall back on GNU gettext library.
853 nls_cv_use_gnu_gettext=yes
857 if test "$nls_cv_use_gnu_gettext" = "yes"; then
858 dnl Mark actions used to generate GNU NLS library.
859 INTLOBJS="\$(GETTOBJS)"
860 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
861 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
862 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
863 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
864 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
866 USE_INCLUDED_LIBINTL=yes
870 INTLDEPS='$(top_builddir)/../intl/libintl.a'
872 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
873 nls_cv_header_intl=libintl.h
874 nls_cv_header_libgt=libgettext.h
877 dnl Test whether we really found GNU xgettext.
878 if test "$XGETTEXT" != ":"; then
879 dnl If it is no GNU xgettext we define it as : so that the
880 dnl Makefiles still can work.
881 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
885 [found xgettext programs is not GNU xgettext; ignore it])
890 # We need to process the po/ directory.
894 nls_cv_header_intl=libintl.h
895 nls_cv_header_libgt=libgettext.h
898 # If this is used in GNU gettext we have to set USE_NLS to `yes'
899 # because some of the sources are only built for this goal.
900 if test "$PACKAGE" = gettext; then
902 USE_INCLUDED_LIBINTL=yes
905 dnl These rules are solely for the distribution goal. While doing this
906 dnl we only have to keep exactly one list of the available catalogs
908 for lang in $ALL_LINGUAS; do
909 GMOFILES="$GMOFILES $lang.gmo"
910 POFILES="$POFILES $lang.po"
913 dnl Make all variables we use known to autoconf.
914 AC_SUBST(USE_INCLUDED_LIBINTL)
917 AC_SUBST(DATADIRNAME)
927 AC_DEFUN(CY_GNU_GETTEXT,
928 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
929 AC_REQUIRE([AC_PROG_CC])dnl
930 AC_REQUIRE([AC_PROG_RANLIB])dnl
931 AC_REQUIRE([AC_ISC_POSIX])dnl
932 AC_REQUIRE([AC_HEADER_STDC])dnl
933 AC_REQUIRE([AC_C_CONST])dnl
934 AC_REQUIRE([AC_C_INLINE])dnl
935 AC_REQUIRE([AC_TYPE_OFF_T])dnl
936 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
937 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
938 AC_REQUIRE([AC_FUNC_MMAP])dnl
940 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
941 unistd.h values.h sys/param.h])
942 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
943 __argz_count __argz_stringify __argz_next])
945 if test "${ac_cv_func_stpcpy+set}" != "set"; then
946 AC_CHECK_FUNCS(stpcpy)
948 if test "${ac_cv_func_stpcpy}" = "yes"; then
949 AC_DEFINE(HAVE_STPCPY, 1, [Define if you have the stpcpy function])
955 if test "x$CATOBJEXT" != "x"; then
956 if test "x$ALL_LINGUAS" = "x"; then
959 AC_MSG_CHECKING(for catalogs to be installed)
961 for lang in ${LINGUAS=$ALL_LINGUAS}; do
962 case "$ALL_LINGUAS" in
963 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
967 AC_MSG_RESULT($LINGUAS)
970 dnl Construct list of names of catalog files to be constructed.
971 if test -n "$LINGUAS"; then
972 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
976 dnl The reference to <locale.h> in the installed <libintl.h> file
977 dnl must be resolved because we cannot expect the users of this
978 dnl to define HAVE_LOCALE_H.
979 if test $ac_cv_header_locale_h = yes; then
980 INCLUDE_LOCALE_H="#include <locale.h>"
983 /* The system does not provide the header <locale.h>. Take care yourself. */"
985 AC_SUBST(INCLUDE_LOCALE_H)
987 dnl Determine which catalog format we have (if any is needed)
988 dnl For now we know about two different formats:
989 dnl Linux libc-5 and the normal X/Open format
990 if test -f $srcdir/po2tbl.sed.in; then
991 if test "$CATOBJEXT" = ".cat"; then
992 AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
994 dnl Transform the SED scripts while copying because some dumb SEDs
995 dnl cannot handle comments.
996 sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed
998 dnl po2tbl.sed is always needed.
999 sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
1000 $srcdir/po2tbl.sed.in > po2tbl.sed
1003 dnl In the intl/Makefile.in we have a special dependency which makes
1004 dnl only sense for gettext. We comment this out for non-gettext
1006 if test "$PACKAGE" = "gettext"; then
1016 MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs"
1017 AC_SUBST(MKINSTALLDIRS)
1019 dnl *** For now the libtool support in intl/Makefile is not for real.
1023 dnl Generate list of files to be processed by xgettext which will
1024 dnl be included in po/Makefile. But only do this if the po directory
1025 dnl exists in srcdir.
1026 if test -d $srcdir/po; then
1027 test -d po || mkdir po
1028 if test "x$srcdir" != "x."; then
1029 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
1030 posrcprefix="$srcdir/"
1032 posrcprefix="../$srcdir/"
1038 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
1039 < $srcdir/po/POTFILES.in > po/POTFILES
1043 # Search path for a program which passes the given test.
1044 # Ulrich Drepper <drepper@cygnus.com>, 1996.
1046 # This file file be copied and used freely without restrictions. It can
1047 # be used in projects which are not available under the GNU Public License
1048 # but which still want to provide support for the GNU gettext functionality.
1049 # Please note that the actual code is *not* freely available.
1053 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1054 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1055 AC_DEFUN(AM_PATH_PROG_WITH_TEST,
1056 [# Extract the first word of "$2", so it can be a program name with args.
1057 set dummy $2; ac_word=[$]2
1058 AC_MSG_CHECKING([for $ac_word])
1059 AC_CACHE_VAL(ac_cv_path_$1,
1062 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1065 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1066 for ac_dir in ifelse([$5], , $PATH, [$5]); do
1067 test -z "$ac_dir" && ac_dir=.
1068 if test -f $ac_dir/$ac_word; then
1070 ac_cv_path_$1="$ac_dir/$ac_word"
1076 dnl If no 4th arg is given, leave the cache variable unset,
1077 dnl so AC_PATH_PROGS will keep looking.
1078 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1083 if test -n "[$]$1"; then
1084 AC_MSG_RESULT([$]$1)
1091 # Check whether LC_MESSAGES is available in <locale.h>.
1092 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1094 # This file file be copied and used freely without restrictions. It can
1095 # be used in projects which are not available under the GNU Public License
1096 # but which still want to provide support for the GNU gettext functionality.
1097 # Please note that the actual code is *not* freely available.
1101 AC_DEFUN(AM_LC_MESSAGES,
1102 [if test $ac_cv_header_locale_h = yes; then
1103 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1104 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1105 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1106 if test $am_cv_val_LC_MESSAGES = yes; then
1107 AC_DEFINE(HAVE_LC_MESSAGES, 1,
1108 [Define if your locale.h file contains LC_MESSAGES.])