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 # Do all the work for Automake. This macro actually does too much --
14 # some checks are only needed if your package does certain things.
15 # But this isn't really a big deal.
20 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
22 AC_DEFUN(AM_INIT_AUTOMAKE,
23 [AC_REQUIRE([AC_PROG_INSTALL])
28 dnl test to see if srcdir already configured
29 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
30 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
33 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
34 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
35 AC_REQUIRE([AM_SANITY_CHECK])
36 AC_REQUIRE([AC_ARG_PROGRAM])
37 dnl FIXME This is truly gross.
38 missing_dir=`cd $ac_aux_dir && pwd`
39 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
40 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
41 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
42 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
43 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
44 AC_REQUIRE([AC_PROG_MAKE_SET])])
47 # Check to make sure that the build environment is sane.
50 AC_DEFUN(AM_SANITY_CHECK,
51 [AC_MSG_CHECKING([whether build environment is sane])
54 echo timestamp > conftestfile
55 # Do `set' in a subshell so we don't clobber the current shell's
56 # arguments. Must try -L first in case configure is actually a
57 # symlink; some systems play weird games with the mod time of symlinks
58 # (eg FreeBSD returns the mod time of the symlink's containing
61 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
62 if test "[$]*" = "X"; then
64 set X `ls -t $srcdir/configure conftestfile`
66 if test "[$]*" != "X $srcdir/configure conftestfile" \
67 && test "[$]*" != "X conftestfile $srcdir/configure"; then
69 # If neither matched, then we have a broken ls. This can happen
70 # if, for instance, CONFIG_SHELL is bash and it inherits a
71 # broken ls alias from the environment. This has actually
72 # happened. Such a system could not be considered "sane".
73 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
74 alias in your environment])
77 test "[$]2" = conftestfile
83 AC_MSG_ERROR([newly created file is older than distributed files!
84 Check your system clock])
89 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
90 dnl The program must properly implement --version.
91 AC_DEFUN(AM_MISSING_PROG,
92 [AC_MSG_CHECKING(for working $2)
93 # Run test in a subshell; some versions of sh will print an error if
94 # an executable is not found, even if stderr is redirected.
95 # Redirect stdin to placate older versions of autoconf. Sigh.
96 if ($2 --version) < /dev/null > /dev/null 2>&1; then
101 AC_MSG_RESULT(missing)
106 # serial 40 AC_PROG_LIBTOOL
107 AC_DEFUN(AC_PROG_LIBTOOL,
108 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
110 # Save cache, so that ltconfig can load it
113 # Actually configure libtool. ac_aux_dir is where install-sh is found.
114 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
115 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
116 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
117 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
118 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
119 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
120 || AC_MSG_ERROR([libtool configure failed])
122 # Reload cache, that may have been modified by ltconfig
125 # This can be used to rebuild libtool when needed
126 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
128 # Always use our own libtool.
129 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
132 # Redirect the config.log output again, so that the ltconfig log is not
133 # clobbered by the next message.
137 AC_DEFUN(AC_LIBTOOL_SETUP,
139 AC_REQUIRE([AC_ENABLE_SHARED])dnl
140 AC_REQUIRE([AC_ENABLE_STATIC])dnl
141 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
142 AC_REQUIRE([AC_CANONICAL_HOST])dnl
143 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
144 AC_REQUIRE([AC_PROG_RANLIB])dnl
145 AC_REQUIRE([AC_PROG_CC])dnl
146 AC_REQUIRE([AC_PROG_LD])dnl
147 AC_REQUIRE([AC_PROG_NM])dnl
148 AC_REQUIRE([AC_PROG_LN_S])dnl
152 NONE) lt_target="$host" ;;
153 *) lt_target="$target" ;;
156 # Check for any special flags to pass to ltconfig.
157 libtool_flags="--cache-file=$cache_file"
158 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
159 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
160 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
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"
163 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
164 [libtool_flags="$libtool_flags --enable-dlopen"])
165 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
166 [libtool_flags="$libtool_flags --enable-win32-dll"])
167 AC_ARG_ENABLE(libtool-lock,
168 [ --disable-libtool-lock avoid locking (might break parallel builds)])
169 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
170 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
172 # Some flags need to be propagated to the compiler or linker for good
176 # Find out which ABI we are using.
177 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
178 if AC_TRY_EVAL(ac_compile); then
179 case "`/usr/bin/file conftest.o`" in
195 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
196 SAVE_CFLAGS="$CFLAGS"
197 CFLAGS="$CFLAGS -belf"
198 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
199 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
200 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
201 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
202 CFLAGS="$SAVE_CFLAGS"
206 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
207 [*-*-cygwin* | *-*-mingw*)
208 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
209 AC_CHECK_TOOL(AS, as, false)
210 AC_CHECK_TOOL(OBJDUMP, objdump, false)
216 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
217 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
219 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
220 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
222 # AC_ENABLE_SHARED - implement the --enable-shared flag
223 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
224 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
226 AC_DEFUN(AC_ENABLE_SHARED, [dnl
227 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
228 AC_ARG_ENABLE(shared,
229 changequote(<<, >>)dnl
230 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
232 [p=${PACKAGE-default}
234 yes) enable_shared=yes ;;
235 no) enable_shared=no ;;
238 # Look at the argument we got. We use all the common list separators.
239 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
240 for pkg in $enableval; do
241 if test "X$pkg" = "X$p"; then
248 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
251 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
252 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
253 AC_ENABLE_SHARED(no)])
255 # AC_ENABLE_STATIC - implement the --enable-static flag
256 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
257 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
259 AC_DEFUN(AC_ENABLE_STATIC, [dnl
260 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
261 AC_ARG_ENABLE(static,
262 changequote(<<, >>)dnl
263 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
265 [p=${PACKAGE-default}
267 yes) enable_static=yes ;;
268 no) enable_static=no ;;
271 # Look at the argument we got. We use all the common list separators.
272 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
273 for pkg in $enableval; do
274 if test "X$pkg" = "X$p"; then
281 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
284 # AC_DISABLE_STATIC - set the default static flag to --disable-static
285 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
286 AC_ENABLE_STATIC(no)])
289 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
290 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
291 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
293 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
294 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
295 AC_ARG_ENABLE(fast-install,
296 changequote(<<, >>)dnl
297 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
299 [p=${PACKAGE-default}
301 yes) enable_fast_install=yes ;;
302 no) enable_fast_install=no ;;
304 enable_fast_install=no
305 # Look at the argument we got. We use all the common list separators.
306 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
307 for pkg in $enableval; do
308 if test "X$pkg" = "X$p"; then
309 enable_fast_install=yes
315 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
318 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
319 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
320 AC_ENABLE_FAST_INSTALL(no)])
322 # AC_PROG_LD - find the path to the GNU or non-GNU linker
325 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
326 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
327 AC_REQUIRE([AC_PROG_CC])dnl
328 AC_REQUIRE([AC_CANONICAL_HOST])dnl
329 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
331 if test "$ac_cv_prog_gcc" = yes; then
332 # Check if gcc -print-prog-name=ld gives a path.
333 AC_MSG_CHECKING([for ld used by GCC])
334 ac_prog=`($CC -print-prog-name=ld) 2>&5`
336 # Accept absolute paths.
338 [\\/]* | [A-Za-z]:[\\/]*)
339 re_direlt='/[^/][^/]*/\.\./'
341 # Canonicalize the path of ld
342 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
343 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
344 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
346 test -z "$LD" && LD="$ac_prog"
349 # If it fails, then pretend we aren't using GCC.
353 # If it is relative, then search for the first ld in PATH.
357 elif test "$with_gnu_ld" = yes; then
358 AC_MSG_CHECKING([for GNU ld])
360 AC_MSG_CHECKING([for non-GNU ld])
362 AC_CACHE_VAL(ac_cv_path_LD,
363 [if test -z "$LD"; then
364 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
365 for ac_dir in $PATH; do
366 test -z "$ac_dir" && ac_dir=.
367 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
368 ac_cv_path_LD="$ac_dir/$ac_prog"
369 # Check to see if the program is GNU ld. I'd rather use --version,
370 # but apparently some GNU ld's only accept -v.
371 # Break only if it was the GNU/non-GNU ld that we prefer.
372 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
373 test "$with_gnu_ld" != no && break
375 test "$with_gnu_ld" != yes && break
381 ac_cv_path_LD="$LD" # Let the user override the test with a path.
384 if test -n "$LD"; then
389 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
393 AC_DEFUN(AC_PROG_LD_GNU,
394 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
395 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
396 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
397 ac_cv_prog_gnu_ld=yes
403 # AC_PROG_NM - find the path to a BSD-compatible name lister
405 [AC_MSG_CHECKING([for BSD-compatible nm])
406 AC_CACHE_VAL(ac_cv_path_NM,
407 [if test -n "$NM"; then
408 # Let the user override the test.
411 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
412 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
413 test -z "$ac_dir" && ac_dir=.
414 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
415 # Check to see if the nm accepts a BSD-compat flag.
416 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
417 # nm: unknown option "B" ignored
418 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
419 ac_cv_path_NM="$ac_dir/nm -B"
421 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
422 ac_cv_path_NM="$ac_dir/nm -p"
425 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
426 continue # so that we can try to find one that supports BSD flags
431 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
437 # AC_CHECK_LIBM - check for math library
438 AC_DEFUN(AC_CHECK_LIBM,
439 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
442 *-*-beos* | *-*-cygwin*)
443 # These system don't have libm
446 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
447 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
450 AC_CHECK_LIB(m, main, LIBM="-lm")
455 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
456 # the libltdl convenience library, adds --enable-ltdl-convenience to
457 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
458 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
459 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
460 # '${top_builddir}/' (note the single quotes!) if your package is not
461 # flat, and, if you're not using automake, define top_builddir as
462 # appropriate in the Makefiles.
463 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
464 case "$enable_ltdl_convenience" in
465 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
466 "") enable_ltdl_convenience=yes
467 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
469 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
470 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
473 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
474 # the libltdl installable library, and adds --enable-ltdl-install to
475 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
476 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
477 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
478 # '${top_builddir}/' (note the single quotes!) if your package is not
479 # flat, and, if you're not using automake, define top_builddir as
480 # appropriate in the Makefiles.
481 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
482 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
483 AC_CHECK_LIB(ltdl, main,
484 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
485 [if test x"$enable_ltdl_install" = xno; then
486 AC_MSG_WARN([libltdl not installed, but installation disabled])
488 enable_ltdl_install=yes
491 if test x"$enable_ltdl_install" = x"yes"; then
492 ac_configure_args="$ac_configure_args --enable-ltdl-install"
493 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
494 INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
496 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
503 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
504 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
505 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
506 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
507 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
508 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
509 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
511 dnl This is just to silence aclocal about the macro not being used
512 ifelse([AC_DISABLE_FAST_INSTALL])dnl
514 # Like AC_CONFIG_HEADER, but automatically create stamp file.
516 AC_DEFUN(AM_CONFIG_HEADER,
518 AC_CONFIG_HEADER([$1])
519 dnl When config.status generates a header, we must update the stamp-h file.
520 dnl This file resides in the same directory as the config header
521 dnl that is generated. We must strip everything past the first ":",
522 dnl and everything past the last "/".
523 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
524 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
525 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
527 for am_file in <<$1>>; do
528 case " <<$>>CONFIG_HEADERS " in
529 *" <<$>>am_file "*<<)>>
530 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
533 am_indx=`expr "<<$>>am_indx" + 1`
537 # This file is derived from `gettext.m4'. The difference is that the
538 # included macros assume Cygnus-style source and build trees.
540 # Macro to add for using GNU gettext.
541 # Ulrich Drepper <drepper@cygnus.com>, 1995.
543 # This file file be copied and used freely without restrictions. It can
544 # be used in projects which are not available under the GNU Public License
545 # but which still want to provide support for the GNU gettext functionality.
546 # Please note that the actual code is *not* freely available.
550 AC_DEFUN(CY_WITH_NLS,
551 [AC_MSG_CHECKING([whether NLS is requested])
552 dnl Default is enabled NLS
554 [ --disable-nls do not use Native Language Support],
555 USE_NLS=$enableval, USE_NLS=yes)
556 AC_MSG_RESULT($USE_NLS)
559 USE_INCLUDED_LIBINTL=no
561 dnl If we use NLS figure out what method
562 if test "$USE_NLS" = "yes"; then
563 AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS is requested])
564 AC_MSG_CHECKING([whether included gettext is requested])
565 AC_ARG_WITH(included-gettext,
566 [ --with-included-gettext use the GNU gettext library included here],
567 nls_cv_force_use_gnu_gettext=$withval,
568 nls_cv_force_use_gnu_gettext=no)
569 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
571 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
572 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
573 dnl User does not insist on using GNU NLS library. Figure out what
574 dnl to use. If gettext or catgets are available (in this order) we
575 dnl use this. Else we have to fall back to GNU NLS library.
576 dnl catgets is only used if permitted by option --with-catgets.
581 AC_CHECK_HEADER(libintl.h,
582 [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
583 [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
584 gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
586 if test "$gt_cv_func_gettext_libc" != "yes"; then
587 AC_CHECK_LIB(intl, bindtextdomain,
588 [AC_CACHE_CHECK([for gettext in libintl],
589 gt_cv_func_gettext_libintl,
590 [AC_TRY_LINK([], [return (int) gettext ("")],
591 gt_cv_func_gettext_libintl=yes,
592 gt_cv_func_gettext_libintl=no)])])
595 if test "$gt_cv_func_gettext_libc" = "yes" \
596 || test "$gt_cv_func_gettext_libintl" = "yes"; then
597 AC_DEFINE(HAVE_GETTEXT, 1,
598 [Define as 1 if you have gettext and don't want to use GNU gettext.])
599 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
600 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
601 if test "$MSGFMT" != "no"; then
602 AC_CHECK_FUNCS(dcgettext)
603 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
604 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
605 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
606 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
607 return _nl_msg_cat_cntr],
617 dnl In the standard gettext, we would now check for catgets.
618 dnl However, we never want to use catgets for our releases.
620 if test "$CATOBJEXT" = "NONE"; then
621 dnl Neither gettext nor catgets in included in the C library.
622 dnl Fall back on GNU gettext library.
623 nls_cv_use_gnu_gettext=yes
627 if test "$nls_cv_use_gnu_gettext" = "yes"; then
628 dnl Mark actions used to generate GNU NLS library.
629 INTLOBJS="\$(GETTOBJS)"
630 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
631 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
632 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
633 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
634 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
636 USE_INCLUDED_LIBINTL=yes
640 INTLDEPS='$(top_builddir)/../intl/libintl.a'
642 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
643 nls_cv_header_intl=libintl.h
644 nls_cv_header_libgt=libgettext.h
647 dnl Test whether we really found GNU xgettext.
648 if test "$XGETTEXT" != ":"; then
649 dnl If it is no GNU xgettext we define it as : so that the
650 dnl Makefiles still can work.
651 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
655 [found xgettext programs is not GNU xgettext; ignore it])
660 # We need to process the po/ directory.
664 nls_cv_header_intl=libintl.h
665 nls_cv_header_libgt=libgettext.h
668 # If this is used in GNU gettext we have to set USE_NLS to `yes'
669 # because some of the sources are only built for this goal.
670 if test "$PACKAGE" = gettext; then
672 USE_INCLUDED_LIBINTL=yes
675 dnl These rules are solely for the distribution goal. While doing this
676 dnl we only have to keep exactly one list of the available catalogs
678 for lang in $ALL_LINGUAS; do
679 GMOFILES="$GMOFILES $lang.gmo"
680 POFILES="$POFILES $lang.po"
683 dnl Make all variables we use known to autoconf.
684 AC_SUBST(USE_INCLUDED_LIBINTL)
687 AC_SUBST(DATADIRNAME)
697 AC_DEFUN(CY_GNU_GETTEXT,
698 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
699 AC_REQUIRE([AC_PROG_CC])dnl
700 AC_REQUIRE([AC_PROG_RANLIB])dnl
701 AC_REQUIRE([AC_ISC_POSIX])dnl
702 AC_REQUIRE([AC_HEADER_STDC])dnl
703 AC_REQUIRE([AC_C_CONST])dnl
704 AC_REQUIRE([AC_C_INLINE])dnl
705 AC_REQUIRE([AC_TYPE_OFF_T])dnl
706 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
707 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
708 AC_REQUIRE([AC_FUNC_MMAP])dnl
710 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
711 unistd.h values.h sys/param.h])
712 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
713 __argz_count __argz_stringify __argz_next])
715 if test "${ac_cv_func_stpcpy+set}" != "set"; then
716 AC_CHECK_FUNCS(stpcpy)
718 if test "${ac_cv_func_stpcpy}" = "yes"; then
719 AC_DEFINE(HAVE_STPCPY, 1, [Define if you have the stpcpy function])
725 if test "x$CATOBJEXT" != "x"; then
726 if test "x$ALL_LINGUAS" = "x"; then
729 AC_MSG_CHECKING(for catalogs to be installed)
731 for lang in ${LINGUAS=$ALL_LINGUAS}; do
732 case "$ALL_LINGUAS" in
733 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
737 AC_MSG_RESULT($LINGUAS)
740 dnl Construct list of names of catalog files to be constructed.
741 if test -n "$LINGUAS"; then
742 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
746 dnl The reference to <locale.h> in the installed <libintl.h> file
747 dnl must be resolved because we cannot expect the users of this
748 dnl to define HAVE_LOCALE_H.
749 if test $ac_cv_header_locale_h = yes; then
750 INCLUDE_LOCALE_H="#include <locale.h>"
753 /* The system does not provide the header <locale.h>. Take care yourself. */"
755 AC_SUBST(INCLUDE_LOCALE_H)
757 dnl Determine which catalog format we have (if any is needed)
758 dnl For now we know about two different formats:
759 dnl Linux libc-5 and the normal X/Open format
760 if test -f $srcdir/po2tbl.sed.in; then
761 if test "$CATOBJEXT" = ".cat"; then
762 AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
764 dnl Transform the SED scripts while copying because some dumb SEDs
765 dnl cannot handle comments.
766 sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed
768 dnl po2tbl.sed is always needed.
769 sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
770 $srcdir/po2tbl.sed.in > po2tbl.sed
773 dnl In the intl/Makefile.in we have a special dependency which makes
774 dnl only sense for gettext. We comment this out for non-gettext
776 if test "$PACKAGE" = "gettext"; then
786 MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs"
787 AC_SUBST(MKINSTALLDIRS)
789 dnl *** For now the libtool support in intl/Makefile is not for real.
793 dnl Generate list of files to be processed by xgettext which will
794 dnl be included in po/Makefile. But only do this if the po directory
795 dnl exists in srcdir.
796 if test -d $srcdir/po; then
797 test -d po || mkdir po
798 if test "x$srcdir" != "x."; then
799 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
800 posrcprefix="$srcdir/"
802 posrcprefix="../$srcdir/"
808 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
809 < $srcdir/po/POTFILES.in > po/POTFILES
813 # Search path for a program which passes the given test.
814 # Ulrich Drepper <drepper@cygnus.com>, 1996.
816 # This file file be copied and used freely without restrictions. It can
817 # be used in projects which are not available under the GNU Public License
818 # but which still want to provide support for the GNU gettext functionality.
819 # Please note that the actual code is *not* freely available.
823 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
824 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
825 AC_DEFUN(AM_PATH_PROG_WITH_TEST,
826 [# Extract the first word of "$2", so it can be a program name with args.
827 set dummy $2; ac_word=[$]2
828 AC_MSG_CHECKING([for $ac_word])
829 AC_CACHE_VAL(ac_cv_path_$1,
832 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
835 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
836 for ac_dir in ifelse([$5], , $PATH, [$5]); do
837 test -z "$ac_dir" && ac_dir=.
838 if test -f $ac_dir/$ac_word; then
840 ac_cv_path_$1="$ac_dir/$ac_word"
846 dnl If no 4th arg is given, leave the cache variable unset,
847 dnl so AC_PATH_PROGS will keep looking.
848 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
853 if test -n "[$]$1"; then
861 # Check whether LC_MESSAGES is available in <locale.h>.
862 # Ulrich Drepper <drepper@cygnus.com>, 1995.
864 # This file file be copied and used freely without restrictions. It can
865 # be used in projects which are not available under the GNU Public License
866 # but which still want to provide support for the GNU gettext functionality.
867 # Please note that the actual code is *not* freely available.
871 AC_DEFUN(AM_LC_MESSAGES,
872 [if test $ac_cv_header_locale_h = yes; then
873 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
874 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
875 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
876 if test $am_cv_val_LC_MESSAGES = yes; then
877 AC_DEFINE(HAVE_LC_MESSAGES, 1,
878 [Define if your locale.h file contains LC_MESSAGES.])
882 # Add --enable-maintainer-mode option to configure.
887 AC_DEFUN(AM_MAINTAINER_MODE,
888 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
889 dnl maintainer-mode is disabled by default
890 AC_ARG_ENABLE(maintainer-mode,
891 [ --enable-maintainer-mode enable make rules and dependencies not useful
892 (and sometimes confusing) to the casual installer],
893 USE_MAINTAINER_MODE=$enableval,
894 USE_MAINTAINER_MODE=no)
895 AC_MSG_RESULT($USE_MAINTAINER_MODE)
896 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
897 MAINT=$MAINTAINER_MODE_TRUE
902 # Define a conditional.
904 AC_DEFUN(AM_CONDITIONAL,