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 dnl See whether we need to use fopen-bin.h rather than fopen-same.h.
14 AC_DEFUN(BFD_BINARY_FOPEN,
15 [AC_REQUIRE([AC_CANONICAL_SYSTEM])
18 *-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
20 AC_DEFINE(USE_BINARY_FOPEN, 1, [Use b modifier when opening binary files?]) ;;
23 dnl Get a default for CC_FOR_BUILD to put into Makefile.
24 AC_DEFUN(BFD_CC_FOR_BUILD,
25 [# Put a plausible default for CC_FOR_BUILD in Makefile.
26 if test -z "$CC_FOR_BUILD"; then
27 if test "x$cross_compiling" = "xno"; then
33 AC_SUBST(CC_FOR_BUILD)
34 # Also set EXEEXT_FOR_BUILD.
35 if test "x$cross_compiling" = "xno"; then
36 EXEEXT_FOR_BUILD='$(EXEEXT)'
38 AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext,
40 echo 'int main () { return 0; }' > conftest.c
42 ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5
43 for file in conftest.*; do
45 *.c | *.o | *.obj | *.ilk | *.pdb) ;;
46 *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
50 test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
52 test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
54 AC_SUBST(EXEEXT_FOR_BUILD)])dnl
56 dnl See whether we need a declaration for a function.
57 AC_DEFUN(BFD_NEED_DECLARATION,
58 [AC_MSG_CHECKING([whether $1 must be declared])
59 AC_CACHE_VAL(bfd_cv_decl_needed_$1,
75 [char *(*pfn) = (char *(*)) $1],
76 bfd_cv_decl_needed_$1=no, bfd_cv_decl_needed_$1=yes)])
77 AC_MSG_RESULT($bfd_cv_decl_needed_$1)
78 if test $bfd_cv_decl_needed_$1 = yes; then
79 AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), 1,
80 [Define if $1 is not declared in system header files.])
84 dnl Check for existence of a type $1 in sys/procfs.h
86 AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE,
87 [AC_MSG_CHECKING([for $1 in sys/procfs.h])
88 AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_$1,
89 [AC_TRY_COMPILE([#include <sys/procfs.h>],
91 bfd_cv_have_sys_procfs_type_$1=yes,
92 bfd_cv_have_sys_procfs_type_$1=no
94 if test $bfd_cv_have_sys_procfs_type_$1 = yes; then
95 AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z]), 1,
96 [Define if <sys/procfs.h> has $1.])
98 AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_$1)
102 dnl Check for existence of member $2 in type $1 in sys/procfs.h
104 AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE_MEMBER,
105 [AC_MSG_CHECKING([for $1.$2 in sys/procfs.h])
106 AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_member_$1_$2,
107 [AC_TRY_COMPILE([#include <sys/procfs.h>],
108 [$1 avar; void* aref = (void*) &avar.$2],
109 bfd_cv_have_sys_procfs_type_member_$1_$2=yes,
110 bfd_cv_have_sys_procfs_type_member_$1_$2=no
112 if test $bfd_cv_have_sys_procfs_type_member_$1_$2 = yes; then
113 AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z])[_]translit($2, [a-z], [A-Z]), 1,
114 [Define if <sys/procfs.h> has $1.$2.])
116 AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_member_$1_$2)
121 # Do all the work for Automake. This macro actually does too much --
122 # some checks are only needed if your package does certain things.
123 # But this isn't really a big deal.
128 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
130 AC_DEFUN(AM_INIT_AUTOMAKE,
131 [AC_REQUIRE([AC_PROG_INSTALL])
136 dnl test to see if srcdir already configured
137 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
138 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
141 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
142 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
143 AC_REQUIRE([AM_SANITY_CHECK])
144 AC_REQUIRE([AC_ARG_PROGRAM])
145 dnl FIXME This is truly gross.
146 missing_dir=`cd $ac_aux_dir && pwd`
147 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
148 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
149 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
150 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
151 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
152 AC_REQUIRE([AC_PROG_MAKE_SET])])
155 # Check to make sure that the build environment is sane.
158 AC_DEFUN(AM_SANITY_CHECK,
159 [AC_MSG_CHECKING([whether build environment is sane])
162 echo timestamp > conftestfile
163 # Do `set' in a subshell so we don't clobber the current shell's
164 # arguments. Must try -L first in case configure is actually a
165 # symlink; some systems play weird games with the mod time of symlinks
166 # (eg FreeBSD returns the mod time of the symlink's containing
169 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
170 if test "[$]*" = "X"; then
172 set X `ls -t $srcdir/configure conftestfile`
174 if test "[$]*" != "X $srcdir/configure conftestfile" \
175 && test "[$]*" != "X conftestfile $srcdir/configure"; then
177 # If neither matched, then we have a broken ls. This can happen
178 # if, for instance, CONFIG_SHELL is bash and it inherits a
179 # broken ls alias from the environment. This has actually
180 # happened. Such a system could not be considered "sane".
181 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
182 alias in your environment])
185 test "[$]2" = conftestfile
191 AC_MSG_ERROR([newly created file is older than distributed files!
192 Check your system clock])
197 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
198 dnl The program must properly implement --version.
199 AC_DEFUN(AM_MISSING_PROG,
200 [AC_MSG_CHECKING(for working $2)
201 # Run test in a subshell; some versions of sh will print an error if
202 # an executable is not found, even if stderr is redirected.
203 # Redirect stdin to placate older versions of autoconf. Sigh.
204 if ($2 --version) < /dev/null > /dev/null 2>&1; then
209 AC_MSG_RESULT(missing)
214 # serial 40 AC_PROG_LIBTOOL
215 AC_DEFUN(AC_PROG_LIBTOOL,
216 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
218 # Save cache, so that ltconfig can load it
221 # Actually configure libtool. ac_aux_dir is where install-sh is found.
222 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
223 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
224 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
225 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
226 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
227 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
228 || AC_MSG_ERROR([libtool configure failed])
230 # Reload cache, that may have been modified by ltconfig
233 # This can be used to rebuild libtool when needed
234 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
236 # Always use our own libtool.
237 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
240 # Redirect the config.log output again, so that the ltconfig log is not
241 # clobbered by the next message.
245 AC_DEFUN(AC_LIBTOOL_SETUP,
247 AC_REQUIRE([AC_ENABLE_SHARED])dnl
248 AC_REQUIRE([AC_ENABLE_STATIC])dnl
249 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
250 AC_REQUIRE([AC_CANONICAL_HOST])dnl
251 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
252 AC_REQUIRE([AC_PROG_RANLIB])dnl
253 AC_REQUIRE([AC_PROG_CC])dnl
254 AC_REQUIRE([AC_PROG_LD])dnl
255 AC_REQUIRE([AC_PROG_NM])dnl
256 AC_REQUIRE([AC_PROG_LN_S])dnl
260 NONE) lt_target="$host" ;;
261 *) lt_target="$target" ;;
264 # Check for any special flags to pass to ltconfig.
265 libtool_flags="--cache-file=$cache_file"
266 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
267 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
268 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
269 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
270 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
271 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
272 [libtool_flags="$libtool_flags --enable-dlopen"])
273 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
274 [libtool_flags="$libtool_flags --enable-win32-dll"])
275 AC_ARG_ENABLE(libtool-lock,
276 [ --disable-libtool-lock avoid locking (might break parallel builds)])
277 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
278 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
280 # Some flags need to be propagated to the compiler or linker for good
284 # Find out which ABI we are using.
285 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
286 if AC_TRY_EVAL(ac_compile); then
287 case "`/usr/bin/file conftest.o`" in
303 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
304 SAVE_CFLAGS="$CFLAGS"
305 CFLAGS="$CFLAGS -belf"
306 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
307 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
308 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
309 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
310 CFLAGS="$SAVE_CFLAGS"
314 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
315 [*-*-cygwin* | *-*-mingw*)
316 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
317 AC_CHECK_TOOL(AS, as, false)
318 AC_CHECK_TOOL(OBJDUMP, objdump, false)
324 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
325 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
327 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
328 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
330 # AC_ENABLE_SHARED - implement the --enable-shared flag
331 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
332 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
334 AC_DEFUN(AC_ENABLE_SHARED, [dnl
335 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
336 AC_ARG_ENABLE(shared,
337 changequote(<<, >>)dnl
338 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
340 [p=${PACKAGE-default}
342 yes) enable_shared=yes ;;
343 no) enable_shared=no ;;
346 # Look at the argument we got. We use all the common list separators.
347 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
348 for pkg in $enableval; do
349 if test "X$pkg" = "X$p"; then
356 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
359 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
360 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
361 AC_ENABLE_SHARED(no)])
363 # AC_ENABLE_STATIC - implement the --enable-static flag
364 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
365 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
367 AC_DEFUN(AC_ENABLE_STATIC, [dnl
368 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
369 AC_ARG_ENABLE(static,
370 changequote(<<, >>)dnl
371 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
373 [p=${PACKAGE-default}
375 yes) enable_static=yes ;;
376 no) enable_static=no ;;
379 # Look at the argument we got. We use all the common list separators.
380 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
381 for pkg in $enableval; do
382 if test "X$pkg" = "X$p"; then
389 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
392 # AC_DISABLE_STATIC - set the default static flag to --disable-static
393 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
394 AC_ENABLE_STATIC(no)])
397 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
398 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
399 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
401 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
402 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
403 AC_ARG_ENABLE(fast-install,
404 changequote(<<, >>)dnl
405 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
407 [p=${PACKAGE-default}
409 yes) enable_fast_install=yes ;;
410 no) enable_fast_install=no ;;
412 enable_fast_install=no
413 # Look at the argument we got. We use all the common list separators.
414 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
415 for pkg in $enableval; do
416 if test "X$pkg" = "X$p"; then
417 enable_fast_install=yes
423 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
426 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
427 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
428 AC_ENABLE_FAST_INSTALL(no)])
430 # AC_PROG_LD - find the path to the GNU or non-GNU linker
433 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
434 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
435 AC_REQUIRE([AC_PROG_CC])dnl
436 AC_REQUIRE([AC_CANONICAL_HOST])dnl
437 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
439 if test "$ac_cv_prog_gcc" = yes; then
440 # Check if gcc -print-prog-name=ld gives a path.
441 AC_MSG_CHECKING([for ld used by GCC])
442 ac_prog=`($CC -print-prog-name=ld) 2>&5`
444 # Accept absolute paths.
446 [\\/]* | [A-Za-z]:[\\/]*)
447 re_direlt='/[^/][^/]*/\.\./'
449 # Canonicalize the path of ld
450 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
451 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
452 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
454 test -z "$LD" && LD="$ac_prog"
457 # If it fails, then pretend we aren't using GCC.
461 # If it is relative, then search for the first ld in PATH.
465 elif test "$with_gnu_ld" = yes; then
466 AC_MSG_CHECKING([for GNU ld])
468 AC_MSG_CHECKING([for non-GNU ld])
470 AC_CACHE_VAL(ac_cv_path_LD,
471 [if test -z "$LD"; then
472 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
473 for ac_dir in $PATH; do
474 test -z "$ac_dir" && ac_dir=.
475 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
476 ac_cv_path_LD="$ac_dir/$ac_prog"
477 # Check to see if the program is GNU ld. I'd rather use --version,
478 # but apparently some GNU ld's only accept -v.
479 # Break only if it was the GNU/non-GNU ld that we prefer.
480 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
481 test "$with_gnu_ld" != no && break
483 test "$with_gnu_ld" != yes && break
489 ac_cv_path_LD="$LD" # Let the user override the test with a path.
492 if test -n "$LD"; then
497 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
501 AC_DEFUN(AC_PROG_LD_GNU,
502 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
503 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
504 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
505 ac_cv_prog_gnu_ld=yes
511 # AC_PROG_NM - find the path to a BSD-compatible name lister
513 [AC_MSG_CHECKING([for BSD-compatible nm])
514 AC_CACHE_VAL(ac_cv_path_NM,
515 [if test -n "$NM"; then
516 # Let the user override the test.
519 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
520 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
521 test -z "$ac_dir" && ac_dir=.
522 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
523 # Check to see if the nm accepts a BSD-compat flag.
524 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
525 # nm: unknown option "B" ignored
526 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
527 ac_cv_path_NM="$ac_dir/nm -B"
529 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
530 ac_cv_path_NM="$ac_dir/nm -p"
533 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
534 continue # so that we can try to find one that supports BSD flags
539 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
545 # AC_CHECK_LIBM - check for math library
546 AC_DEFUN(AC_CHECK_LIBM,
547 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
550 *-*-beos* | *-*-cygwin*)
551 # These system don't have libm
554 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
555 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
558 AC_CHECK_LIB(m, main, LIBM="-lm")
563 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
564 # the libltdl convenience library, adds --enable-ltdl-convenience to
565 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
566 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
567 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
568 # '${top_builddir}/' (note the single quotes!) if your package is not
569 # flat, and, if you're not using automake, define top_builddir as
570 # appropriate in the Makefiles.
571 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
572 case "$enable_ltdl_convenience" in
573 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
574 "") enable_ltdl_convenience=yes
575 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
577 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
578 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
581 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
582 # the libltdl installable library, and adds --enable-ltdl-install to
583 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
584 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
585 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
586 # '${top_builddir}/' (note the single quotes!) if your package is not
587 # flat, and, if you're not using automake, define top_builddir as
588 # appropriate in the Makefiles.
589 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
590 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
591 AC_CHECK_LIB(ltdl, main,
592 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
593 [if test x"$enable_ltdl_install" = xno; then
594 AC_MSG_WARN([libltdl not installed, but installation disabled])
596 enable_ltdl_install=yes
599 if test x"$enable_ltdl_install" = x"yes"; then
600 ac_configure_args="$ac_configure_args --enable-ltdl-install"
601 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
602 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
604 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
611 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
612 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
613 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
614 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
615 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
616 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
617 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
619 dnl This is just to silence aclocal about the macro not being used
620 ifelse([AC_DISABLE_FAST_INSTALL])dnl
622 # Like AC_CONFIG_HEADER, but automatically create stamp file.
624 AC_DEFUN(AM_CONFIG_HEADER,
626 AC_CONFIG_HEADER([$1])
627 dnl When config.status generates a header, we must update the stamp-h file.
628 dnl This file resides in the same directory as the config header
629 dnl that is generated. We must strip everything past the first ":",
630 dnl and everything past the last "/".
631 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
632 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
633 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
635 for am_file in <<$1>>; do
636 case " <<$>>CONFIG_HEADERS " in
637 *" <<$>>am_file "*<<)>>
638 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
641 am_indx=`expr "<<$>>am_indx" + 1`
645 # Add --enable-maintainer-mode option to configure.
650 AC_DEFUN(AM_MAINTAINER_MODE,
651 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
652 dnl maintainer-mode is disabled by default
653 AC_ARG_ENABLE(maintainer-mode,
654 [ --enable-maintainer-mode enable make rules and dependencies not useful
655 (and sometimes confusing) to the casual installer],
656 USE_MAINTAINER_MODE=$enableval,
657 USE_MAINTAINER_MODE=no)
658 AC_MSG_RESULT($USE_MAINTAINER_MODE)
659 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
660 MAINT=$MAINTAINER_MODE_TRUE
665 # Define a conditional.
667 AC_DEFUN(AM_CONDITIONAL,
678 # This file is derived from `gettext.m4'. The difference is that the
679 # included macros assume Cygnus-style source and build trees.
681 # Macro to add for using GNU gettext.
682 # Ulrich Drepper <drepper@cygnus.com>, 1995.
684 # This file file be copied and used freely without restrictions. It can
685 # be used in projects which are not available under the GNU Public License
686 # but which still want to provide support for the GNU gettext functionality.
687 # Please note that the actual code is *not* freely available.
691 AC_DEFUN(CY_WITH_NLS,
692 [AC_MSG_CHECKING([whether NLS is requested])
693 dnl Default is enabled NLS
695 [ --disable-nls do not use Native Language Support],
696 USE_NLS=$enableval, USE_NLS=yes)
697 AC_MSG_RESULT($USE_NLS)
700 USE_INCLUDED_LIBINTL=no
702 dnl If we use NLS figure out what method
703 if test "$USE_NLS" = "yes"; then
704 AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS is requested])
705 AC_MSG_CHECKING([whether included gettext is requested])
706 AC_ARG_WITH(included-gettext,
707 [ --with-included-gettext use the GNU gettext library included here],
708 nls_cv_force_use_gnu_gettext=$withval,
709 nls_cv_force_use_gnu_gettext=no)
710 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
712 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
713 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
714 dnl User does not insist on using GNU NLS library. Figure out what
715 dnl to use. If gettext or catgets are available (in this order) we
716 dnl use this. Else we have to fall back to GNU NLS library.
717 dnl catgets is only used if permitted by option --with-catgets.
722 AC_CHECK_HEADER(libintl.h,
723 [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
724 [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
725 gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
727 if test "$gt_cv_func_gettext_libc" != "yes"; then
728 AC_CHECK_LIB(intl, bindtextdomain,
729 [AC_CACHE_CHECK([for gettext in libintl],
730 gt_cv_func_gettext_libintl,
731 [AC_TRY_LINK([], [return (int) gettext ("")],
732 gt_cv_func_gettext_libintl=yes,
733 gt_cv_func_gettext_libintl=no)])])
736 if test "$gt_cv_func_gettext_libc" = "yes" \
737 || test "$gt_cv_func_gettext_libintl" = "yes"; then
738 AC_DEFINE(HAVE_GETTEXT, 1,
739 [Define as 1 if you have gettext and don't want to use GNU gettext.])
740 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
741 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
742 if test "$MSGFMT" != "no"; then
743 AC_CHECK_FUNCS(dcgettext)
744 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
745 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
746 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
747 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
748 return _nl_msg_cat_cntr],
758 dnl In the standard gettext, we would now check for catgets.
759 dnl However, we never want to use catgets for our releases.
761 if test "$CATOBJEXT" = "NONE"; then
762 dnl Neither gettext nor catgets in included in the C library.
763 dnl Fall back on GNU gettext library.
764 nls_cv_use_gnu_gettext=yes
768 if test "$nls_cv_use_gnu_gettext" = "yes"; then
769 dnl Mark actions used to generate GNU NLS library.
770 INTLOBJS="\$(GETTOBJS)"
771 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
772 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
773 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
774 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
775 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
777 USE_INCLUDED_LIBINTL=yes
781 INTLDEPS='$(top_builddir)/../intl/libintl.a'
783 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
784 nls_cv_header_intl=libintl.h
785 nls_cv_header_libgt=libgettext.h
788 dnl Test whether we really found GNU xgettext.
789 if test "$XGETTEXT" != ":"; then
790 dnl If it is no GNU xgettext we define it as : so that the
791 dnl Makefiles still can work.
792 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
796 [found xgettext programs is not GNU xgettext; ignore it])
801 # We need to process the po/ directory.
805 nls_cv_header_intl=libintl.h
806 nls_cv_header_libgt=libgettext.h
809 # If this is used in GNU gettext we have to set USE_NLS to `yes'
810 # because some of the sources are only built for this goal.
811 if test "$PACKAGE" = gettext; then
813 USE_INCLUDED_LIBINTL=yes
816 dnl These rules are solely for the distribution goal. While doing this
817 dnl we only have to keep exactly one list of the available catalogs
819 for lang in $ALL_LINGUAS; do
820 GMOFILES="$GMOFILES $lang.gmo"
821 POFILES="$POFILES $lang.po"
824 dnl Make all variables we use known to autoconf.
825 AC_SUBST(USE_INCLUDED_LIBINTL)
828 AC_SUBST(DATADIRNAME)
838 AC_DEFUN(CY_GNU_GETTEXT,
839 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
840 AC_REQUIRE([AC_PROG_CC])dnl
841 AC_REQUIRE([AC_PROG_RANLIB])dnl
842 AC_REQUIRE([AC_ISC_POSIX])dnl
843 AC_REQUIRE([AC_HEADER_STDC])dnl
844 AC_REQUIRE([AC_C_CONST])dnl
845 AC_REQUIRE([AC_C_INLINE])dnl
846 AC_REQUIRE([AC_TYPE_OFF_T])dnl
847 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
848 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
849 AC_REQUIRE([AC_FUNC_MMAP])dnl
851 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
852 unistd.h values.h sys/param.h])
853 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
854 __argz_count __argz_stringify __argz_next])
856 if test "${ac_cv_func_stpcpy+set}" != "set"; then
857 AC_CHECK_FUNCS(stpcpy)
859 if test "${ac_cv_func_stpcpy}" = "yes"; then
860 AC_DEFINE(HAVE_STPCPY, 1, [Define if you have the stpcpy function])
866 if test "x$CATOBJEXT" != "x"; then
867 if test "x$ALL_LINGUAS" = "x"; then
870 AC_MSG_CHECKING(for catalogs to be installed)
872 for lang in ${LINGUAS=$ALL_LINGUAS}; do
873 case "$ALL_LINGUAS" in
874 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
878 AC_MSG_RESULT($LINGUAS)
881 dnl Construct list of names of catalog files to be constructed.
882 if test -n "$LINGUAS"; then
883 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
887 dnl The reference to <locale.h> in the installed <libintl.h> file
888 dnl must be resolved because we cannot expect the users of this
889 dnl to define HAVE_LOCALE_H.
890 if test $ac_cv_header_locale_h = yes; then
891 INCLUDE_LOCALE_H="#include <locale.h>"
894 /* The system does not provide the header <locale.h>. Take care yourself. */"
896 AC_SUBST(INCLUDE_LOCALE_H)
898 dnl Determine which catalog format we have (if any is needed)
899 dnl For now we know about two different formats:
900 dnl Linux libc-5 and the normal X/Open format
901 if test -f $srcdir/po2tbl.sed.in; then
902 if test "$CATOBJEXT" = ".cat"; then
903 AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
905 dnl Transform the SED scripts while copying because some dumb SEDs
906 dnl cannot handle comments.
907 sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed
909 dnl po2tbl.sed is always needed.
910 sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
911 $srcdir/po2tbl.sed.in > po2tbl.sed
914 dnl In the intl/Makefile.in we have a special dependency which makes
915 dnl only sense for gettext. We comment this out for non-gettext
917 if test "$PACKAGE" = "gettext"; then
927 MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs"
928 AC_SUBST(MKINSTALLDIRS)
930 dnl *** For now the libtool support in intl/Makefile is not for real.
934 dnl Generate list of files to be processed by xgettext which will
935 dnl be included in po/Makefile. But only do this if the po directory
936 dnl exists in srcdir.
937 if test -d $srcdir/po; then
938 test -d po || mkdir po
939 if test "x$srcdir" != "x."; then
940 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
941 posrcprefix="$srcdir/"
943 posrcprefix="../$srcdir/"
949 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
950 < $srcdir/po/POTFILES.in > po/POTFILES
954 # Search path for a program which passes the given test.
955 # Ulrich Drepper <drepper@cygnus.com>, 1996.
957 # This file file be copied and used freely without restrictions. It can
958 # be used in projects which are not available under the GNU Public License
959 # but which still want to provide support for the GNU gettext functionality.
960 # Please note that the actual code is *not* freely available.
964 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
965 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
966 AC_DEFUN(AM_PATH_PROG_WITH_TEST,
967 [# Extract the first word of "$2", so it can be a program name with args.
968 set dummy $2; ac_word=[$]2
969 AC_MSG_CHECKING([for $ac_word])
970 AC_CACHE_VAL(ac_cv_path_$1,
973 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
976 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
977 for ac_dir in ifelse([$5], , $PATH, [$5]); do
978 test -z "$ac_dir" && ac_dir=.
979 if test -f $ac_dir/$ac_word; then
981 ac_cv_path_$1="$ac_dir/$ac_word"
987 dnl If no 4th arg is given, leave the cache variable unset,
988 dnl so AC_PATH_PROGS will keep looking.
989 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
994 if test -n "[$]$1"; then
1002 # Check whether LC_MESSAGES is available in <locale.h>.
1003 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1005 # This file file be copied and used freely without restrictions. It can
1006 # be used in projects which are not available under the GNU Public License
1007 # but which still want to provide support for the GNU gettext functionality.
1008 # Please note that the actual code is *not* freely available.
1012 AC_DEFUN(AM_LC_MESSAGES,
1013 [if test $ac_cv_header_locale_h = yes; then
1014 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1015 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1016 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1017 if test $am_cv_val_LC_MESSAGES = yes; then
1018 AC_DEFINE(HAVE_LC_MESSAGES, 1,
1019 [Define if your locale.h file contains LC_MESSAGES.])