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 --------------------------------------------------------- ##
14 dnl The following definitions are from gettext-0.10.27. ##
15 dnl --------------------------------------------------------- ##
17 # Macro to add for using GNU gettext.
18 # Ulrich Drepper <drepper@cygnus.com>, 1995.
23 [AC_MSG_CHECKING([whether NLS is requested])
24 dnl Default is enabled NLS
26 [ --disable-nls do not use Native Language Support],
27 USE_NLS=$enableval, USE_NLS=yes)
28 AC_MSG_RESULT($USE_NLS)
31 USE_INCLUDED_LIBINTL=no
33 dnl If we use NLS figure out what method
34 if test "$USE_NLS" = "yes"; then
36 AC_MSG_CHECKING([whether included gettext is requested])
37 AC_ARG_WITH(included-gettext,
38 [ --with-included-gettext use the GNU gettext library included here],
39 nls_cv_force_use_gnu_gettext=$withval,
40 nls_cv_force_use_gnu_gettext=no)
41 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
43 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
44 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
45 dnl User does not insist on using GNU NLS library. Figure out what
46 dnl to use. If gettext or catgets are available (in this order) we
47 dnl use this. Else we have to fall back to GNU NLS library.
48 dnl catgets is only used if permitted by option --with-catgets.
53 AC_CHECK_HEADER(libintl.h,
54 [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
55 [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
56 gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
58 if test "$gt_cv_func_gettext_libc" != "yes"; then
59 AC_CHECK_LIB(intl, bindtextdomain,
60 [AC_CACHE_CHECK([for gettext in libintl],
61 gt_cv_func_gettext_libintl,
62 [AC_TRY_LINK([], [return (int) gettext ("")],
63 gt_cv_func_gettext_libintl=yes,
64 gt_cv_func_gettext_libintl=no)])])
67 if test "$gt_cv_func_gettext_libc" = "yes" \
68 || test "$gt_cv_func_gettext_libintl" = "yes"; then
69 AC_DEFINE(HAVE_GETTEXT)
70 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
71 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
72 if test "$MSGFMT" != "no"; then
73 AC_CHECK_FUNCS(dcgettext)
74 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
75 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
76 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
77 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
78 return _nl_msg_cat_cntr],
88 if test "$CATOBJEXT" = "NONE"; then
89 AC_MSG_CHECKING([whether catgets can be used])
91 [ --with-catgets use catgets functions if available],
92 nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
93 AC_MSG_RESULT($nls_cv_use_catgets)
95 if test "$nls_cv_use_catgets" = "yes"; then
96 dnl No gettext in C library. Try catgets next.
98 AC_CHECK_FUNC(catgets,
99 [AC_DEFINE(HAVE_CATGETS)
100 INTLOBJS="\$(CATOBJS)"
101 AC_PATH_PROG(GENCAT, gencat, no)dnl
102 if test "$GENCAT" != "no"; then
103 AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
104 if test "$GMSGFMT" = "no"; then
105 AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
106 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
108 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
109 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
110 USE_INCLUDED_LIBINTL=yes
114 INTLDEPS="../intl/libintl.a"
116 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
117 nls_cv_header_intl=intl/libintl.h
118 nls_cv_header_libgt=intl/libgettext.h
123 if test "$CATOBJEXT" = "NONE"; then
124 dnl Neither gettext nor catgets in included in the C library.
125 dnl Fall back on GNU gettext library.
126 nls_cv_use_gnu_gettext=yes
130 if test "$nls_cv_use_gnu_gettext" = "yes"; then
131 dnl Mark actions used to generate GNU NLS library.
132 INTLOBJS="\$(GETTOBJS)"
133 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
134 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
135 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
136 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
137 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
139 USE_INCLUDED_LIBINTL=yes
143 INTLDEPS="../intl/libintl.a"
145 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
146 nls_cv_header_intl=intl/libintl.h
147 nls_cv_header_libgt=intl/libgettext.h
150 dnl Test whether we really found GNU xgettext.
151 if test "$XGETTEXT" != ":"; then
152 dnl If it is no GNU xgettext we define it as : so that the
153 dnl Makefiles still can work.
154 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
158 [found xgettext programs is not GNU xgettext; ignore it])
163 # We need to process the po/ directory.
167 nls_cv_header_intl=intl/libintl.h
168 nls_cv_header_libgt=intl/libgettext.h
171 # If this is used in GNU gettext we have to set USE_NLS to `yes'
172 # because some of the sources are only built for this goal.
173 if test "$PACKAGE" = gettext; then
175 USE_INCLUDED_LIBINTL=yes
178 dnl These rules are solely for the distribution goal. While doing this
179 dnl we only have to keep exactly one list of the available catalogs
181 for lang in $ALL_LINGUAS; do
182 GMOFILES="$GMOFILES $lang.gmo"
183 POFILES="$POFILES $lang.po"
186 dnl Make all variables we use known to autoconf.
187 AC_SUBST(USE_INCLUDED_LIBINTL)
190 AC_SUBST(DATADIRNAME)
200 AC_DEFUN(AM_GNU_GETTEXT,
201 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
202 AC_REQUIRE([AC_PROG_CC])dnl
203 AC_REQUIRE([AC_ISC_POSIX])dnl
204 AC_REQUIRE([AC_HEADER_STDC])dnl
205 AC_REQUIRE([AC_C_CONST])dnl
206 AC_REQUIRE([AC_C_INLINE])dnl
207 AC_REQUIRE([AC_TYPE_OFF_T])dnl
208 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
209 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
210 AC_REQUIRE([AC_FUNC_MMAP])dnl
212 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
214 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
215 __argz_count __argz_stringify __argz_next])
217 if test "${ac_cv_func_stpcpy+set}" != "set"; then
218 AC_CHECK_FUNCS(stpcpy)
220 if test "${ac_cv_func_stpcpy}" = "yes"; then
221 AC_DEFINE(HAVE_STPCPY)
227 if test "x$CATOBJEXT" != "x"; then
228 if test "x$ALL_LINGUAS" = "x"; then
231 AC_MSG_CHECKING(for catalogs to be installed)
233 for lang in ${LINGUAS=$ALL_LINGUAS}; do
234 case "$ALL_LINGUAS" in
235 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
239 AC_MSG_RESULT($LINGUAS)
242 dnl Construct list of names of catalog files to be constructed.
243 if test -n "$LINGUAS"; then
244 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
248 dnl Determine which catalog format we have (if any is needed)
249 dnl For now we know about two different formats:
250 dnl Linux libc-5 and the normal X/Open format
251 test -d intl || mkdir intl
252 if test "$CATOBJEXT" = ".cat"; then
253 AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
255 dnl Transform the SED scripts while copying because some dumb SEDs
256 dnl cannot handle comments.
257 sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
259 dnl po2tbl.sed is always needed.
260 sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
261 $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
263 dnl In the intl/Makefile.in we have a special dependency which makes
264 dnl only sense for gettext. We comment this out for non-gettext
266 if test "$PACKAGE" = "gettext"; then
276 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
277 dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
278 dnl Try to locate is.
280 if test $ac_aux_dir; then
281 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
283 if test -z $MKINSTALLDIRS; then
284 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
286 AC_SUBST(MKINSTALLDIRS)
288 dnl Configure the intl/Makefile for shared libs.
289 if test "${enable_shared+set}" = set; then
296 dnl Generate list of files to be processed by xgettext which will
297 dnl be included in po/Makefile.
298 test -d po || mkdir po
299 if test "x$srcdir" != "x."; then
300 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
301 posrcprefix="$srcdir/"
303 posrcprefix="../$srcdir/"
308 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
309 < $srcdir/po/POTFILES.in > po/POTFILES
312 # Search path for a program which passes the given test.
313 # Ulrich Drepper <drepper@cygnus.com>, 1996.
317 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
318 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
319 AC_DEFUN(AM_PATH_PROG_WITH_TEST,
320 [# Extract the first word of "$2", so it can be a program name with args.
321 set dummy $2; ac_word=[$]2
322 AC_MSG_CHECKING([for $ac_word])
323 AC_CACHE_VAL(ac_cv_path_$1,
326 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
329 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
330 for ac_dir in ifelse([$5], , $PATH, [$5]); do
331 test -z "$ac_dir" && ac_dir=.
332 if test -f $ac_dir/$ac_word; then
334 ac_cv_path_$1="$ac_dir/$ac_word"
340 dnl If no 4th arg is given, leave the cache variable unset,
341 dnl so AC_PATH_PROGS will keep looking.
342 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
347 if test -n "[$]$1"; then
355 # Check whether LC_MESSAGES is available in <locale.h>.
356 # Ulrich Drepper <drepper@cygnus.com>, 1995.
360 AC_DEFUN(AM_LC_MESSAGES,
361 [if test $ac_cv_header_locale_h = yes; then
362 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
363 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
364 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
365 if test $am_cv_val_LC_MESSAGES = yes; then
366 AC_DEFINE(HAVE_LC_MESSAGES)
370 dnl Check longest integer in digits.
372 AC_DEFUN([BLP_INT_DIGITS],
374 AC_MSG_CHECKING(number of digits in LONG_MIN (incl. sign))
375 AC_CACHE_VAL(blp_int_digits,
376 [AC_TRY_RUN([#include <stdio.h>
383 sprintf(s, "%ld", LONG_MAX);
385 sprintf(s, "%ld", LONG_MIN);
386 if(strlen(s)>len) len=strlen(s);
387 sprintf(s, "%lu", ULONG_MAX);
388 if(strlen(s)>len) len=strlen(s);
392 eval "blp_int_digits=19",
393 eval "blp_int_digits=$?"
394 if test "$blp_int_digits" -lt 11; then
397 eval "blp_int_digits=19")
399 AC_DEFINE_UNQUOTED(INT_DIGITS, $blp_int_digits)
400 AC_MSG_RESULT($blp_int_digits)
403 dnl Check quality of this machine's sprintf implementation.
405 AC_DEFUN([BLP_IS_SPRINTF_GOOD],
407 AC_MSG_CHECKING(if sprintf returns a char count)
408 AC_CACHE_VAL(blp_is_sprintf_good,
409 [AC_TRY_RUN([#include <stdio.h>
414 exit((int)sprintf(s, "abcdefg")!=7);
417 eval "blp_is_sprintf_good=yes",
418 eval "blp_is_sprintf_good=no",
419 eval "blp_is_sprintf_good=no")
421 if test "$blp_is_sprintf_good" = yes; then
422 AC_DEFINE(HAVE_GOOD_SPRINTF)
429 dnl Check for proper random number generator.
431 AC_DEFUN([BLP_RANDOM],
433 AC_MSG_CHECKING(random number generator)
434 AC_CACHE_VAL(blp_random_good,
435 AC_TRY_COMPILE([#include <stdlib.h>], [int x=RAND_MAX;],
436 blp_random_good=yes, blp_random_good=no))
437 if test "$blp_random_good" = yes; then
438 AC_DEFINE(HAVE_GOOD_RANDOM)
445 dnl aclocal.m4 ends here
447 # Like AC_CONFIG_HEADER, but automatically create stamp file.
449 AC_DEFUN(AM_CONFIG_HEADER,
451 AC_CONFIG_HEADER([$1])
452 dnl When config.status generates a header, we must update the stamp-h file.
453 dnl This file resides in the same directory as the config header
454 dnl that is generated. We must strip everything past the first ":",
455 dnl and everything past the last "/".
456 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
457 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
458 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
460 for am_file in <<$1>>; do
461 case " <<$>>CONFIG_HEADERS " in
462 *" <<$>>am_file "*<<)>>
463 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
466 am_indx=`expr "<<$>>am_indx" + 1`
473 # @defmac AC_PROG_CC_STDC
474 # @maindex PROG_CC_STDC
476 # If the C compiler in not in ANSI C mode by default, try to add an option
477 # to output variable @code{CC} to make it so. This macro tries various
478 # options that select ANSI C on some system or another. It considers the
479 # compiler to be in ANSI C mode if it handles function prototypes correctly.
481 # If you use this macro, you should check after calling it whether the C
482 # compiler has been set to accept ANSI C; if not, the shell variable
483 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
484 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
485 # program @code{ansi2knr}, which comes with Ghostscript.
488 AC_DEFUN(AM_PROG_CC_STDC,
489 [AC_REQUIRE([AC_PROG_CC])
490 AC_BEFORE([$0], [AC_C_INLINE])
491 AC_BEFORE([$0], [AC_C_CONST])
492 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
493 dnl a magic option to avoid problems with ANSI preprocessor commands
495 dnl FIXME: can't do this because then AC_AIX won't work due to a
496 dnl circular dependency.
497 dnl AC_BEFORE([$0], [AC_PROG_CPP])
498 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
499 AC_CACHE_VAL(am_cv_prog_cc_stdc,
500 [am_cv_prog_cc_stdc=no
502 # Don't try gcc -ansi; that turns off useful extensions and
503 # breaks some systems' header files.
505 # Ultrix and OSF/1 -std1
506 # HP-UX -Aa -D_HPUX_SOURCE
507 # SVR4 -Xc -D__EXTENSIONS__
508 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
510 CC="$ac_save_CC $ac_arg"
514 #include <sys/types.h>
515 #include <sys/stat.h>
516 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
517 struct buf { int x; };
518 FILE * (*rcsopen) (struct buf *, struct stat *, int);
519 static char *e (p, i)
525 static char *f (char * (*g) (char **, int), char **p, ...)
530 s = g (p, va_arg (v,int));
534 int test (int i, double x);
535 struct s1 {int (*f) (int a);};
536 struct s2 {int (*f) (double a);};
537 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
541 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
543 [am_cv_prog_cc_stdc="$ac_arg"; break])
547 if test -z "$am_cv_prog_cc_stdc"; then
548 AC_MSG_RESULT([none needed])
550 AC_MSG_RESULT($am_cv_prog_cc_stdc)
552 case "x$am_cv_prog_cc_stdc" in
554 *) CC="$CC $am_cv_prog_cc_stdc" ;;
558 # Do all the work for Automake. This macro actually does too much --
559 # some checks are only needed if your package does certain things.
560 # But this isn't really a big deal.
565 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
567 AC_DEFUN(AM_INIT_AUTOMAKE,
568 [AC_REQUIRE([AC_PROG_INSTALL])
573 dnl test to see if srcdir already configured
574 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
575 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
578 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
579 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
580 AC_REQUIRE([AM_SANITY_CHECK])
581 AC_REQUIRE([AC_ARG_PROGRAM])
582 dnl FIXME This is truly gross.
583 missing_dir=`cd $ac_aux_dir && pwd`
584 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
585 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
586 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
587 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
588 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
589 AC_REQUIRE([AC_PROG_MAKE_SET])])
592 # Check to make sure that the build environment is sane.
595 AC_DEFUN(AM_SANITY_CHECK,
596 [AC_MSG_CHECKING([whether build environment is sane])
599 echo timestamp > conftestfile
600 # Do `set' in a subshell so we don't clobber the current shell's
601 # arguments. Must try -L first in case configure is actually a
602 # symlink; some systems play weird games with the mod time of symlinks
603 # (eg FreeBSD returns the mod time of the symlink's containing
606 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
607 if test "[$]*" = "X"; then
609 set X `ls -t $srcdir/configure conftestfile`
611 if test "[$]*" != "X $srcdir/configure conftestfile" \
612 && test "[$]*" != "X conftestfile $srcdir/configure"; then
614 # If neither matched, then we have a broken ls. This can happen
615 # if, for instance, CONFIG_SHELL is bash and it inherits a
616 # broken ls alias from the environment. This has actually
617 # happened. Such a system could not be considered "sane".
618 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
619 alias in your environment])
622 test "[$]2" = conftestfile
628 AC_MSG_ERROR([newly created file is older than distributed files!
629 Check your system clock])
634 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
635 dnl The program must properly implement --version.
636 AC_DEFUN(AM_MISSING_PROG,
637 [AC_MSG_CHECKING(for working $2)
638 # Run test in a subshell; some versions of sh will print an error if
639 # an executable is not found, even if stderr is redirected.
640 # Redirect stdin to placate older versions of autoconf. Sigh.
641 if ($2 --version) < /dev/null > /dev/null 2>&1; then
646 AC_MSG_RESULT(missing)
653 AC_DEFUN(AM_C_PROTOTYPES,
654 [AC_REQUIRE([AM_PROG_CC_STDC])
655 AC_REQUIRE([AC_PROG_CPP])
656 AC_MSG_CHECKING([for function prototypes])
657 if test "$am_cv_prog_cc_stdc" != no; then
659 AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
663 U=_ ANSI2KNR=./ansi2knr
664 # Ensure some checks needed by ansi2knr itself.
666 AC_CHECK_HEADERS(string.h)
669 AC_SUBST(ANSI2KNR)dnl