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 40 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" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
118 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
119 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
120 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
121 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
122 || AC_MSG_ERROR([libtool configure failed])
124 # Reload cache, that may have been modified by ltconfig
127 # This can be used to rebuild libtool when needed
128 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
130 # Always use our own libtool.
131 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
134 # Redirect the config.log output again, so that the ltconfig log is not
135 # clobbered by the next message.
139 AC_DEFUN(AC_LIBTOOL_SETUP,
141 AC_REQUIRE([AC_ENABLE_SHARED])dnl
142 AC_REQUIRE([AC_ENABLE_STATIC])dnl
143 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
144 AC_REQUIRE([AC_CANONICAL_HOST])dnl
145 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
146 AC_REQUIRE([AC_PROG_RANLIB])dnl
147 AC_REQUIRE([AC_PROG_CC])dnl
148 AC_REQUIRE([AC_PROG_LD])dnl
149 AC_REQUIRE([AC_PROG_NM])dnl
150 AC_REQUIRE([AC_PROG_LN_S])dnl
154 NONE) lt_target="$host" ;;
155 *) lt_target="$target" ;;
158 # Check for any special flags to pass to ltconfig.
159 libtool_flags="--cache-file=$cache_file"
160 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
161 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
162 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
163 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
164 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
165 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
166 [libtool_flags="$libtool_flags --enable-dlopen"])
167 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
168 [libtool_flags="$libtool_flags --enable-win32-dll"])
169 AC_ARG_ENABLE(libtool-lock,
170 [ --disable-libtool-lock avoid locking (might break parallel builds)])
171 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
172 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
174 # Some flags need to be propagated to the compiler or linker for good
178 # Find out which ABI we are using.
179 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
180 if AC_TRY_EVAL(ac_compile); then
181 case "`/usr/bin/file conftest.o`" in
197 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
198 SAVE_CFLAGS="$CFLAGS"
199 CFLAGS="$CFLAGS -belf"
200 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
201 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
202 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
203 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
204 CFLAGS="$SAVE_CFLAGS"
208 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
209 [*-*-cygwin* | *-*-mingw*)
210 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
211 AC_CHECK_TOOL(AS, as, false)
212 AC_CHECK_TOOL(OBJDUMP, objdump, false)
218 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
219 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
221 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
222 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
224 # AC_ENABLE_SHARED - implement the --enable-shared flag
225 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
226 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
228 AC_DEFUN(AC_ENABLE_SHARED, [dnl
229 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
230 AC_ARG_ENABLE(shared,
231 changequote(<<, >>)dnl
232 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
234 [p=${PACKAGE-default}
236 yes) enable_shared=yes ;;
237 no) enable_shared=no ;;
240 # Look at the argument we got. We use all the common list separators.
241 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
242 for pkg in $enableval; do
243 if test "X$pkg" = "X$p"; then
250 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
253 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
254 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
255 AC_ENABLE_SHARED(no)])
257 # AC_ENABLE_STATIC - implement the --enable-static flag
258 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
259 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
261 AC_DEFUN(AC_ENABLE_STATIC, [dnl
262 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
263 AC_ARG_ENABLE(static,
264 changequote(<<, >>)dnl
265 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
267 [p=${PACKAGE-default}
269 yes) enable_static=yes ;;
270 no) enable_static=no ;;
273 # Look at the argument we got. We use all the common list separators.
274 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
275 for pkg in $enableval; do
276 if test "X$pkg" = "X$p"; then
283 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
286 # AC_DISABLE_STATIC - set the default static flag to --disable-static
287 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
288 AC_ENABLE_STATIC(no)])
291 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
292 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
293 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
295 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
296 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
297 AC_ARG_ENABLE(fast-install,
298 changequote(<<, >>)dnl
299 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
301 [p=${PACKAGE-default}
303 yes) enable_fast_install=yes ;;
304 no) enable_fast_install=no ;;
306 enable_fast_install=no
307 # Look at the argument we got. We use all the common list separators.
308 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
309 for pkg in $enableval; do
310 if test "X$pkg" = "X$p"; then
311 enable_fast_install=yes
317 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
320 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
321 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
322 AC_ENABLE_FAST_INSTALL(no)])
324 # AC_PROG_LD - find the path to the GNU or non-GNU linker
327 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
328 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
329 AC_REQUIRE([AC_PROG_CC])dnl
330 AC_REQUIRE([AC_CANONICAL_HOST])dnl
331 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
333 if test "$ac_cv_prog_gcc" = yes; then
334 # Check if gcc -print-prog-name=ld gives a path.
335 AC_MSG_CHECKING([for ld used by GCC])
336 ac_prog=`($CC -print-prog-name=ld) 2>&5`
338 # Accept absolute paths.
340 [\\/]* | [A-Za-z]:[\\/]*)
341 re_direlt='/[^/][^/]*/\.\./'
343 # Canonicalize the path of ld
344 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
345 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
346 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
348 test -z "$LD" && LD="$ac_prog"
351 # If it fails, then pretend we aren't using GCC.
355 # If it is relative, then search for the first ld in PATH.
359 elif test "$with_gnu_ld" = yes; then
360 AC_MSG_CHECKING([for GNU ld])
362 AC_MSG_CHECKING([for non-GNU ld])
364 AC_CACHE_VAL(ac_cv_path_LD,
365 [if test -z "$LD"; then
366 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
367 for ac_dir in $PATH; do
368 test -z "$ac_dir" && ac_dir=.
369 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
370 ac_cv_path_LD="$ac_dir/$ac_prog"
371 # Check to see if the program is GNU ld. I'd rather use --version,
372 # but apparently some GNU ld's only accept -v.
373 # Break only if it was the GNU/non-GNU ld that we prefer.
374 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
375 test "$with_gnu_ld" != no && break
377 test "$with_gnu_ld" != yes && break
383 ac_cv_path_LD="$LD" # Let the user override the test with a path.
386 if test -n "$LD"; then
391 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
395 AC_DEFUN(AC_PROG_LD_GNU,
396 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
397 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
398 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
399 ac_cv_prog_gnu_ld=yes
405 # AC_PROG_NM - find the path to a BSD-compatible name lister
407 [AC_MSG_CHECKING([for BSD-compatible nm])
408 AC_CACHE_VAL(ac_cv_path_NM,
409 [if test -n "$NM"; then
410 # Let the user override the test.
413 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
414 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
415 test -z "$ac_dir" && ac_dir=.
416 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
417 # Check to see if the nm accepts a BSD-compat flag.
418 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
419 # nm: unknown option "B" ignored
420 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
421 ac_cv_path_NM="$ac_dir/nm -B"
423 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
424 ac_cv_path_NM="$ac_dir/nm -p"
427 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
428 continue # so that we can try to find one that supports BSD flags
433 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
439 # AC_CHECK_LIBM - check for math library
440 AC_DEFUN(AC_CHECK_LIBM,
441 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
444 *-*-beos* | *-*-cygwin*)
445 # These system don't have libm
448 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
449 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
452 AC_CHECK_LIB(m, main, LIBM="-lm")
457 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
458 # the libltdl convenience library, adds --enable-ltdl-convenience to
459 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
460 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
461 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
462 # '${top_builddir}/' (note the single quotes!) if your package is not
463 # flat, and, if you're not using automake, define top_builddir as
464 # appropriate in the Makefiles.
465 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
466 case "$enable_ltdl_convenience" in
467 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
468 "") enable_ltdl_convenience=yes
469 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
471 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
472 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
475 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
476 # the libltdl installable library, and adds --enable-ltdl-install to
477 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
478 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
479 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
480 # '${top_builddir}/' (note the single quotes!) if your package is not
481 # flat, and, if you're not using automake, define top_builddir as
482 # appropriate in the Makefiles.
483 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
484 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
485 AC_CHECK_LIB(ltdl, main,
486 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
487 [if test x"$enable_ltdl_install" = xno; then
488 AC_MSG_WARN([libltdl not installed, but installation disabled])
490 enable_ltdl_install=yes
493 if test x"$enable_ltdl_install" = x"yes"; then
494 ac_configure_args="$ac_configure_args --enable-ltdl-install"
495 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
496 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
498 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
505 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
506 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
507 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
508 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
509 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
510 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
511 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
513 dnl This is just to silence aclocal about the macro not being used
514 ifelse([AC_DISABLE_FAST_INSTALL])dnl
516 # Like AC_CONFIG_HEADER, but automatically create stamp file.
518 AC_DEFUN(AM_CONFIG_HEADER,
520 AC_CONFIG_HEADER([$1])
521 dnl When config.status generates a header, we must update the stamp-h file.
522 dnl This file resides in the same directory as the config header
523 dnl that is generated. We must strip everything past the first ":",
524 dnl and everything past the last "/".
525 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
526 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
527 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
529 for am_file in <<$1>>; do
530 case " <<$>>CONFIG_HEADERS " in
531 *" <<$>>am_file "*<<)>>
532 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
535 am_indx=`expr "<<$>>am_indx" + 1`
539 # This file is derived from `gettext.m4'. The difference is that the
540 # included macros assume Cygnus-style source and build trees.
542 # Macro to add for using GNU gettext.
543 # Ulrich Drepper <drepper@cygnus.com>, 1995.
545 # This file file be copied and used freely without restrictions. It can
546 # be used in projects which are not available under the GNU Public License
547 # but which still want to provide support for the GNU gettext functionality.
548 # Please note that the actual code is *not* freely available.
552 AC_DEFUN(CY_WITH_NLS,
553 [AC_MSG_CHECKING([whether NLS is requested])
554 dnl Default is enabled NLS
556 [ --disable-nls do not use Native Language Support],
557 USE_NLS=$enableval, USE_NLS=yes)
558 AC_MSG_RESULT($USE_NLS)
561 USE_INCLUDED_LIBINTL=no
563 dnl If we use NLS figure out what method
564 if test "$USE_NLS" = "yes"; then
565 AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS is requested])
566 AC_MSG_CHECKING([whether included gettext is requested])
567 AC_ARG_WITH(included-gettext,
568 [ --with-included-gettext use the GNU gettext library included here],
569 nls_cv_force_use_gnu_gettext=$withval,
570 nls_cv_force_use_gnu_gettext=no)
571 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
573 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
574 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
575 dnl User does not insist on using GNU NLS library. Figure out what
576 dnl to use. If gettext or catgets are available (in this order) we
577 dnl use this. Else we have to fall back to GNU NLS library.
578 dnl catgets is only used if permitted by option --with-catgets.
583 AC_CHECK_HEADER(libintl.h,
584 [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
585 [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
586 gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
588 if test "$gt_cv_func_gettext_libc" != "yes"; then
589 AC_CHECK_LIB(intl, bindtextdomain,
590 [AC_CACHE_CHECK([for gettext in libintl],
591 gt_cv_func_gettext_libintl,
592 [AC_TRY_LINK([], [return (int) gettext ("")],
593 gt_cv_func_gettext_libintl=yes,
594 gt_cv_func_gettext_libintl=no)])])
597 if test "$gt_cv_func_gettext_libc" = "yes" \
598 || test "$gt_cv_func_gettext_libintl" = "yes"; then
599 AC_DEFINE(HAVE_GETTEXT, 1,
600 [Define as 1 if you have gettext and don't want to use GNU gettext.])
601 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
602 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
603 if test "$MSGFMT" != "no"; then
604 AC_CHECK_FUNCS(dcgettext)
605 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
606 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
607 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
608 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
609 return _nl_msg_cat_cntr],
619 dnl In the standard gettext, we would now check for catgets.
620 dnl However, we never want to use catgets for our releases.
622 if test "$CATOBJEXT" = "NONE"; then
623 dnl Neither gettext nor catgets in included in the C library.
624 dnl Fall back on GNU gettext library.
625 nls_cv_use_gnu_gettext=yes
629 if test "$nls_cv_use_gnu_gettext" = "yes"; then
630 dnl Mark actions used to generate GNU NLS library.
631 INTLOBJS="\$(GETTOBJS)"
632 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
633 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
634 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
635 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
636 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
638 USE_INCLUDED_LIBINTL=yes
642 INTLDEPS='$(top_builddir)/../intl/libintl.a'
644 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
645 nls_cv_header_intl=libintl.h
646 nls_cv_header_libgt=libgettext.h
649 dnl Test whether we really found GNU xgettext.
650 if test "$XGETTEXT" != ":"; then
651 dnl If it is no GNU xgettext we define it as : so that the
652 dnl Makefiles still can work.
653 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
657 [found xgettext programs is not GNU xgettext; ignore it])
662 # We need to process the po/ directory.
666 nls_cv_header_intl=libintl.h
667 nls_cv_header_libgt=libgettext.h
670 # If this is used in GNU gettext we have to set USE_NLS to `yes'
671 # because some of the sources are only built for this goal.
672 if test "$PACKAGE" = gettext; then
674 USE_INCLUDED_LIBINTL=yes
677 dnl These rules are solely for the distribution goal. While doing this
678 dnl we only have to keep exactly one list of the available catalogs
680 for lang in $ALL_LINGUAS; do
681 GMOFILES="$GMOFILES $lang.gmo"
682 POFILES="$POFILES $lang.po"
685 dnl Make all variables we use known to autoconf.
686 AC_SUBST(USE_INCLUDED_LIBINTL)
689 AC_SUBST(DATADIRNAME)
699 AC_DEFUN(CY_GNU_GETTEXT,
700 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
701 AC_REQUIRE([AC_PROG_CC])dnl
702 AC_REQUIRE([AC_PROG_RANLIB])dnl
703 AC_REQUIRE([AC_ISC_POSIX])dnl
704 AC_REQUIRE([AC_HEADER_STDC])dnl
705 AC_REQUIRE([AC_C_CONST])dnl
706 AC_REQUIRE([AC_C_INLINE])dnl
707 AC_REQUIRE([AC_TYPE_OFF_T])dnl
708 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
709 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
710 AC_REQUIRE([AC_FUNC_MMAP])dnl
712 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
713 unistd.h values.h sys/param.h])
714 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
715 __argz_count __argz_stringify __argz_next])
717 if test "${ac_cv_func_stpcpy+set}" != "set"; then
718 AC_CHECK_FUNCS(stpcpy)
720 if test "${ac_cv_func_stpcpy}" = "yes"; then
721 AC_DEFINE(HAVE_STPCPY, 1, [Define if you have the stpcpy function])
727 if test "x$CATOBJEXT" != "x"; then
728 if test "x$ALL_LINGUAS" = "x"; then
731 AC_MSG_CHECKING(for catalogs to be installed)
733 for lang in ${LINGUAS=$ALL_LINGUAS}; do
734 case "$ALL_LINGUAS" in
735 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
739 AC_MSG_RESULT($LINGUAS)
742 dnl Construct list of names of catalog files to be constructed.
743 if test -n "$LINGUAS"; then
744 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
748 dnl The reference to <locale.h> in the installed <libintl.h> file
749 dnl must be resolved because we cannot expect the users of this
750 dnl to define HAVE_LOCALE_H.
751 if test $ac_cv_header_locale_h = yes; then
752 INCLUDE_LOCALE_H="#include <locale.h>"
755 /* The system does not provide the header <locale.h>. Take care yourself. */"
757 AC_SUBST(INCLUDE_LOCALE_H)
759 dnl Determine which catalog format we have (if any is needed)
760 dnl For now we know about two different formats:
761 dnl Linux libc-5 and the normal X/Open format
762 if test -f $srcdir/po2tbl.sed.in; then
763 if test "$CATOBJEXT" = ".cat"; then
764 AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
766 dnl Transform the SED scripts while copying because some dumb SEDs
767 dnl cannot handle comments.
768 sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed
770 dnl po2tbl.sed is always needed.
771 sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
772 $srcdir/po2tbl.sed.in > po2tbl.sed
775 dnl In the intl/Makefile.in we have a special dependency which makes
776 dnl only sense for gettext. We comment this out for non-gettext
778 if test "$PACKAGE" = "gettext"; then
788 MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs"
789 AC_SUBST(MKINSTALLDIRS)
791 dnl *** For now the libtool support in intl/Makefile is not for real.
795 dnl Generate list of files to be processed by xgettext which will
796 dnl be included in po/Makefile. But only do this if the po directory
797 dnl exists in srcdir.
798 if test -d $srcdir/po; then
799 test -d po || mkdir po
800 if test "x$srcdir" != "x."; then
801 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
802 posrcprefix="$srcdir/"
804 posrcprefix="../$srcdir/"
810 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
811 < $srcdir/po/POTFILES.in > po/POTFILES
815 # Search path for a program which passes the given test.
816 # Ulrich Drepper <drepper@cygnus.com>, 1996.
818 # This file file be copied and used freely without restrictions. It can
819 # be used in projects which are not available under the GNU Public License
820 # but which still want to provide support for the GNU gettext functionality.
821 # Please note that the actual code is *not* freely available.
825 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
826 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
827 AC_DEFUN(AM_PATH_PROG_WITH_TEST,
828 [# Extract the first word of "$2", so it can be a program name with args.
829 set dummy $2; ac_word=[$]2
830 AC_MSG_CHECKING([for $ac_word])
831 AC_CACHE_VAL(ac_cv_path_$1,
834 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
837 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
838 for ac_dir in ifelse([$5], , $PATH, [$5]); do
839 test -z "$ac_dir" && ac_dir=.
840 if test -f $ac_dir/$ac_word; then
842 ac_cv_path_$1="$ac_dir/$ac_word"
848 dnl If no 4th arg is given, leave the cache variable unset,
849 dnl so AC_PATH_PROGS will keep looking.
850 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
855 if test -n "[$]$1"; then
863 # Check whether LC_MESSAGES is available in <locale.h>.
864 # Ulrich Drepper <drepper@cygnus.com>, 1995.
866 # This file file be copied and used freely without restrictions. It can
867 # be used in projects which are not available under the GNU Public License
868 # but which still want to provide support for the GNU gettext functionality.
869 # Please note that the actual code is *not* freely available.
873 AC_DEFUN(AM_LC_MESSAGES,
874 [if test $ac_cv_header_locale_h = yes; then
875 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
876 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
877 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
878 if test $am_cv_val_LC_MESSAGES = yes; then
879 AC_DEFINE(HAVE_LC_MESSAGES, 1,
880 [Define if your locale.h file contains LC_MESSAGES.])
886 dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
887 AC_DEFUN(AM_PROG_LEX,
888 [missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1)
889 AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex")
893 # Add --enable-maintainer-mode option to configure.
898 AC_DEFUN(AM_MAINTAINER_MODE,
899 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
900 dnl maintainer-mode is disabled by default
901 AC_ARG_ENABLE(maintainer-mode,
902 [ --enable-maintainer-mode enable make rules and dependencies not useful
903 (and sometimes confusing) to the casual installer],
904 USE_MAINTAINER_MODE=$enableval,
905 USE_MAINTAINER_MODE=no)
906 AC_MSG_RESULT($USE_MAINTAINER_MODE)
907 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
908 MAINT=$MAINTAINER_MODE_TRUE
913 # Define a conditional.
915 AC_DEFUN(AM_CONDITIONAL,