1 dnl aclocal.m4 generated automatically by aclocal 1.4a
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])
24 dnl We require 2.13 because we rely on SHELL being computed by configure.
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)
107 # Like AC_CONFIG_HEADER, but automatically create stamp file.
109 AC_DEFUN(AM_CONFIG_HEADER,
111 AC_CONFIG_HEADER([$1])
112 dnl When config.status generates a header, we must update the stamp-h file.
113 dnl This file resides in the same directory as the config header
114 dnl that is generated. We must strip everything past the first ":",
115 dnl and everything past the last "/".
116 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
117 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
118 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
120 for am_file in <<$1>>; do
121 case " <<$>>CONFIG_HEADERS " in
122 *" <<$>>am_file "*<<)>>
123 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
126 am_indx=`expr "<<$>>am_indx" + 1`
133 AC_DEFUN(AM_C_PROTOTYPES,
134 [AC_REQUIRE([AM_PROG_CC_STDC])
135 AC_REQUIRE([AC_PROG_CPP])
136 AC_MSG_CHECKING([for function prototypes])
137 if test "$am_cv_prog_cc_stdc" != no; then
139 AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
143 U=_ ANSI2KNR=./ansi2knr
144 # Ensure some checks needed by ansi2knr itself.
146 AC_CHECK_HEADERS(string.h)
149 AC_SUBST(ANSI2KNR)dnl
155 # @defmac AC_PROG_CC_STDC
156 # @maindex PROG_CC_STDC
158 # If the C compiler in not in ANSI C mode by default, try to add an option
159 # to output variable @code{CC} to make it so. This macro tries various
160 # options that select ANSI C on some system or another. It considers the
161 # compiler to be in ANSI C mode if it handles function prototypes correctly.
163 # If you use this macro, you should check after calling it whether the C
164 # compiler has been set to accept ANSI C; if not, the shell variable
165 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
166 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
167 # program @code{ansi2knr}, which comes with Ghostscript.
170 AC_DEFUN(AM_PROG_CC_STDC,
171 [AC_REQUIRE([AC_PROG_CC])
172 AC_BEFORE([$0], [AC_C_INLINE])
173 AC_BEFORE([$0], [AC_C_CONST])
174 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
175 dnl a magic option to avoid problems with ANSI preprocessor commands
177 dnl FIXME: can't do this because then AC_AIX won't work due to a
178 dnl circular dependency.
179 dnl AC_BEFORE([$0], [AC_PROG_CPP])
180 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
181 AC_CACHE_VAL(am_cv_prog_cc_stdc,
182 [am_cv_prog_cc_stdc=no
184 # Don't try gcc -ansi; that turns off useful extensions and
185 # breaks some systems' header files.
187 # Ultrix and OSF/1 -std1
188 # HP-UX -Aa -D_HPUX_SOURCE
189 # SVR4 -Xc -D__EXTENSIONS__
190 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
192 CC="$ac_save_CC $ac_arg"
196 #include <sys/types.h>
197 #include <sys/stat.h>
198 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
199 struct buf { int x; };
200 FILE * (*rcsopen) (struct buf *, struct stat *, int);
201 static char *e (p, i)
207 static char *f (char * (*g) (char **, int), char **p, ...)
212 s = g (p, va_arg (v,int));
216 int test (int i, double x);
217 struct s1 {int (*f) (int a);};
218 struct s2 {int (*f) (double a);};
219 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
223 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
225 [am_cv_prog_cc_stdc="$ac_arg"; break])
229 if test -z "$am_cv_prog_cc_stdc"; then
230 AC_MSG_RESULT([none needed])
232 AC_MSG_RESULT($am_cv_prog_cc_stdc)
234 case "x$am_cv_prog_cc_stdc" in
236 *) CC="$CC $am_cv_prog_cc_stdc" ;;
241 # serial 29 AM_PROG_LIBTOOL
242 AC_DEFUN(AM_PROG_LIBTOOL,
243 [AC_REQUIRE([AM_ENABLE_SHARED])dnl
244 AC_REQUIRE([AM_ENABLE_STATIC])dnl
245 AC_REQUIRE([AC_CANONICAL_HOST])dnl
246 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
247 AC_REQUIRE([AC_PROG_RANLIB])dnl
248 AC_REQUIRE([AC_PROG_CC])dnl
249 AC_REQUIRE([AM_PROG_LD])dnl
250 AC_REQUIRE([AM_PROG_NM])dnl
251 AC_REQUIRE([AM_SYS_NM_PARSE])dnl
252 AC_REQUIRE([AM_SYS_SYMBOL_UNDERSCORE])dnl
253 AC_REQUIRE([AC_PROG_LN_S])dnl
255 # Always use our own libtool.
256 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
259 # Check for any special flags to pass to ltconfig.
261 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
262 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
263 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
264 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
265 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
267 # Some flags need to be propagated to the compiler or linker for good
271 # Find out which ABI we are using.
272 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
273 if AC_TRY_EVAL(ac_compile); then
274 case "`/usr/bin/file conftest.o`" in
290 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
291 SAVE_CFLAGS="$CFLAGS"
292 CFLAGS="$CFLAGS -belf"
293 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
294 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
295 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
296 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
297 CFLAGS="$SAVE_CFLAGS"
302 AM_SYS_LIBTOOL_CYGWIN32
307 # enable the --disable-libtool-lock switch
309 AC_ARG_ENABLE(libtool-lock,
310 [ --disable-libtool-lock force libtool not to do file locking],
311 need_locks=$enableval,
314 if test x"$need_locks" = xno; then
315 libtool_flags="$libtool_flags --disable-lock"
319 # Actually configure libtool. ac_aux_dir is where install-sh is found.
320 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
321 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
322 DLLTOOL="$DLLTOOL" AS="$AS" \
323 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
324 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
325 || AC_MSG_ERROR([libtool configure failed])
327 # Redirect the config.log output again, so that the ltconfig log is not
328 # clobbered by the next message.
332 # AM_ENABLE_SHARED - implement the --enable-shared flag
333 # Usage: AM_ENABLE_SHARED[(DEFAULT)]
334 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
336 AC_DEFUN(AM_ENABLE_SHARED,
337 [define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
338 AC_ARG_ENABLE(shared,
339 changequote(<<, >>)dnl
340 << --enable-shared[=PKGS] build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT],
342 [p=${PACKAGE-default}
344 yes) enable_shared=yes ;;
345 no) enable_shared=no ;;
348 # Look at the argument we got. We use all the common list separators.
349 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
350 for pkg in $enableval; do
351 if test "X$pkg" = "X$p"; then
358 enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
361 # AM_DISABLE_SHARED - set the default shared flag to --disable-shared
362 AC_DEFUN(AM_DISABLE_SHARED,
363 [AM_ENABLE_SHARED(no)])
365 # AM_DISABLE_STATIC - set the default static flag to --disable-static
366 AC_DEFUN(AM_DISABLE_STATIC,
367 [AM_ENABLE_STATIC(no)])
369 # AM_ENABLE_STATIC - implement the --enable-static flag
370 # Usage: AM_ENABLE_STATIC[(DEFAULT)]
371 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
373 AC_DEFUN(AM_ENABLE_STATIC,
374 [define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
375 AC_ARG_ENABLE(static,
376 changequote(<<, >>)dnl
377 << --enable-static[=PKGS] build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT],
379 [p=${PACKAGE-default}
381 yes) enable_static=yes ;;
382 no) enable_static=no ;;
385 # Look at the argument we got. We use all the common list separators.
386 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
387 for pkg in $enableval; do
388 if test "X$pkg" = "X$p"; then
395 enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
399 # AM_PROG_LD - find the path to the GNU or non-GNU linker
402 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
403 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
404 AC_REQUIRE([AC_PROG_CC])dnl
405 AC_REQUIRE([AC_CANONICAL_HOST])dnl
406 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
408 if test "$ac_cv_prog_gcc" = yes; then
409 # Check if gcc -print-prog-name=ld gives a path.
410 AC_MSG_CHECKING([for ld used by GCC])
411 ac_prog=`($CC -print-prog-name=ld) 2>&5`
413 # Accept absolute paths.
416 # Canonicalize the path of ld
417 re_direlt='/[^/][^/]*/\.\./'
418 sub_uncdrive='s%^\([A-Za-z]\):/%//\1/%'
420 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
421 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
425 # Convert to a UNC path for cygwin
426 test -z "$LD" && LD=`echo X$ac_prog | $Xsed -e "$sub_uncdrive"`
429 test -z "$LD" && LD="$ac_prog"
434 ## FIXME: The code fails later on if we try to use an $LD with
435 ## '\\' path separators.
439 # Canonicalize the path of ld
440 re_direlt='\\[^\\][^\\]*\\\.\.\(\\\)'
441 sub_uncdrive='s%^\([A-Za-z]\):\\%//\1/%'
443 sub_uncdir='s%\\%/%g'
444 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
445 ac_prog=`echo $ac_prog| sed "s%$re_direlt%\1%"`
449 # Convert to a UNC path for cygwin
450 test -z "$LD" && LD=`echo X$ac_prog | sed -e 's%^X%%' -e "$sub_uncdrive" -e "$sub_uncdir"`
453 test -z "$LD" && LD="$ac_prog"
458 # If it fails, then pretend we aren't using GCC.
462 # If it is relative, then search for the first ld in PATH.
466 elif test "$with_gnu_ld" = yes; then
467 AC_MSG_CHECKING([for GNU ld])
469 AC_MSG_CHECKING([for non-GNU ld])
471 AC_CACHE_VAL(ac_cv_path_LD,
472 [if test -z "$LD"; then
473 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
474 for ac_dir in $PATH; do
475 test -z "$ac_dir" && ac_dir=.
476 if test -f "$ac_dir/$ac_prog"; then
477 ac_cv_path_LD="$ac_dir/$ac_prog"
478 # Check to see if the program is GNU ld. I'd rather use --version,
479 # but apparently some GNU ld's only accept -v.
480 # Break only if it was the GNU/non-GNU ld that we prefer.
481 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
482 test "$with_gnu_ld" != no && break
484 test "$with_gnu_ld" != yes && break
490 ac_cv_path_LD="$LD" # Let the user override the test with a path.
493 if test -n "$LD"; then
498 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
503 AC_DEFUN(AM_PROG_LD_GNU,
504 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
505 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
506 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
507 ac_cv_prog_gnu_ld=yes
513 # AM_PROG_NM - find the path to a BSD-compatible name lister
515 [AC_MSG_CHECKING([for BSD-compatible nm])
516 AC_CACHE_VAL(ac_cv_path_NM,
517 [if test -n "$NM"; then
518 # Let the user override the test.
521 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
522 for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
523 test -z "$ac_dir" && ac_dir=.
524 if test -f $ac_dir/nm; then
525 # Check to see if the nm accepts a BSD-compat flag.
526 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
527 # nm: unknown option "B" ignored
528 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
529 ac_cv_path_NM="$ac_dir/nm -B"
530 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
531 ac_cv_path_NM="$ac_dir/nm -p"
533 ac_cv_path_NM="$ac_dir/nm"
539 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
546 # AM_SYS_NM_PARSE - Check for command ro grab the raw symbol name followed
547 # by C symbol name from nm.
548 AC_DEFUN(AM_SYS_NM_PARSE,
549 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
550 AC_REQUIRE([AM_PROG_NM])dnl
551 # Check for command to grab the raw symbol name followed by C symbol from nm.
552 AC_MSG_CHECKING([command to parse $NM output])
553 AC_CACHE_VAL(ac_cv_sys_global_symbol_pipe,
554 [# These are sane defaults that work on at least a few old systems.
555 # {They come from Ultrix. What could be older than Ultrix?!! ;)}
558 # Character class describing NM global symbol codes.
559 ac_symcode='[BCDEGRSTU]'
561 # Regexp to match symbols that can be accessed directly from C.
562 ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
564 # Transform the above into a raw symbol and a C symbol.
567 # Define system-specific variables.
572 sunos* | cygwin32* | mingw32*)
573 ac_sympat='_\([_A-Za-z][_A-Za-z0-9]*\)'
577 # Cannot use undefined symbols on IRIX because inlined functions mess us up.
578 ac_symcode='[BCDEGRST]'
585 # If we're using GNU nm, then use its standard symbol codes.
586 if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
587 ac_symcode='[ABCDGISTUW]'
591 cygwin32* | mingw32*)
592 # We do not want undefined symbols on cygwin32. The user must
593 # arrange to define them via -l arguments.
594 ac_symcode='[ABCDGISTW]'
599 # Write the raw and C identifiers.
600 ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.* $ac_symcode $ac_sympat$/$ac_symxfrm/p'"
602 # Check to see that the pipe works correctly.
604 cat > conftest.$ac_ext <<EOF
609 void nm_test_func(){}
613 int main(){nm_test_var='a';nm_test_func;return 0;}
615 if AC_TRY_EVAL(ac_compile); then
616 # Now try to grab the symbols.
618 if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
620 # Try sorting and uniquifying the output.
621 if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
622 mv -f "$ac_nlist"T "$ac_nlist"
623 ac_wcout=`wc "$ac_nlist" 2>/dev/null`
625 ac_count=`echo "X$ac_wcout" | sed -e 's,^X,,' -e 's/^[ ]*\([0-9][0-9]*\).*$/\1/'`
627 (test "$ac_count" -ge 0) 2>/dev/null || ac_count=-1
633 # Make sure that we snagged all the symbols we need.
634 if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
635 if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
636 cat <<EOF > conftest.c
642 # Now generate the symbol file.
643 sed 's/^.* \(.*\)$/extern char \1;/' < "$ac_nlist" >> conftest.c
645 cat <<EOF >> conftest.c
646 #if defined (__STDC__) && __STDC__
647 # define __ptr_t void *
649 # define __ptr_t char *
652 /* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
653 int dld_preloaded_symbol_count = $ac_count;
655 /* The mapping between symbol names and symbols. */
661 dld_preloaded_symbols[] =
665 sed 's/^\(.*\) \(.*\)$/ {"\1", (__ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
666 cat <<\EOF >> conftest.c
674 # Now try linking the two files.
675 mv conftest.$ac_objext conftestm.$ac_objext
677 ac_save_CFLAGS="$CFLAGS"
678 LIBS="conftestm.$ac_objext"
679 CFLAGS="$CFLAGS$no_builtin_flag"
680 if AC_TRY_EVAL(ac_link) && test -s conftest; then
683 echo "configure: failed program was:" >&AC_FD_CC
684 cat conftest.c >&AC_FD_CC
687 CFLAGS="$ac_save_CFLAGS"
689 echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
692 echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC
695 echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
698 echo "$progname: failed program was:" >&AC_FD_CC
699 cat conftest.c >&AC_FD_CC
703 # Do not use the global_symbol_pipe unless it works.
704 test "$ac_pipe_works" = yes || ac_cv_sys_global_symbol_pipe=
708 if test -z "$ac_cv_sys_global_symbol_pipe"; then
711 AC_MSG_RESULT($ac_result)
714 # AM_SYS_LIBTOOL_CYGWIN32 - find tools needed on cygwin32
715 AC_DEFUN(AM_SYS_LIBTOOL_CYGWIN32,
716 [AC_CHECK_TOOL(DLLTOOL, dlltool, false)
717 AC_CHECK_TOOL(AS, as, false)
720 # AM_SYS_SYMBOL_UNDERSCORE - does the compiler prefix global symbols
721 # with an underscore?
722 AC_DEFUN(AM_SYS_SYMBOL_UNDERSCORE,
723 [AC_REQUIRE([AM_PROG_NM])dnl
724 AC_REQUIRE([AM_SYS_NM_PARSE])dnl
725 AC_MSG_CHECKING([for _ prefix in compiled symbols])
726 AC_CACHE_VAL(ac_cv_sys_symbol_underscore,
727 [ac_cv_sys_symbol_underscore=no
728 cat > conftest.$ac_ext <<EOF
729 void nm_test_func(){}
730 int main(){nm_test_func;return 0;}
732 if AC_TRY_EVAL(ac_compile); then
733 # Now try to grab the symbols.
735 if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
736 # See whether the symbols have a leading underscore.
737 if egrep '^_nm_test_func' "$ac_nlist" >/dev/null; then
738 ac_cv_sys_symbol_underscore=yes
740 if egrep '^nm_test_func ' "$ac_nlist" >/dev/null; then
743 echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
747 echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
750 echo "configure: failed program was:" >&AC_FD_CC
751 cat conftest.c >&AC_FD_CC
755 AC_MSG_RESULT($ac_cv_sys_symbol_underscore)
756 if test x$ac_cv_sys_symbol_underscore = xyes; then
757 AC_DEFINE(WITH_SYMBOL_UNDERSCORE,1,
758 [define if compiled symbols have a leading underscore])
762 dnl From Jim Meyering. Use this if you use the GNU error.[ch].
763 dnl FIXME: Migrate into libit
765 AC_DEFUN(AM_FUNC_ERROR_AT_LINE,
766 [AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
767 [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
768 am_cv_lib_error_at_line=yes,
769 am_cv_lib_error_at_line=no)])
770 if test $am_cv_lib_error_at_line = no; then
771 LIBOBJS="$LIBOBJS error.o"
776 # Macro to add for using GNU gettext.
777 # Ulrich Drepper <drepper@cygnus.com>, 1995.
779 # This file can be copied and used freely without restrictions. It can
780 # be used in projects which are not available under the GNU Public License
781 # but which still want to provide support for the GNU gettext functionality.
782 # Please note that the actual code is *not* freely available.
786 AC_DEFUN(AM_WITH_NLS,
787 [AC_MSG_CHECKING([whether NLS is requested])
788 dnl Default is enabled NLS
790 [ --disable-nls do not use Native Language Support],
791 USE_NLS=$enableval, USE_NLS=yes)
792 AC_MSG_RESULT($USE_NLS)
795 USE_INCLUDED_LIBINTL=no
797 dnl If we use NLS figure out what method
798 if test "$USE_NLS" = "yes"; then
799 AC_DEFINE(ENABLE_NLS)
800 AC_MSG_CHECKING([whether included gettext is requested])
801 AC_ARG_WITH(included-gettext,
802 [ --with-included-gettext use the GNU gettext library included here],
803 nls_cv_force_use_gnu_gettext=$withval,
804 nls_cv_force_use_gnu_gettext=no)
805 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
807 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
808 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
809 dnl User does not insist on using GNU NLS library. Figure out what
810 dnl to use. If gettext or catgets are available (in this order) we
811 dnl use this. Else we have to fall back to GNU NLS library.
812 dnl catgets is only used if permitted by option --with-catgets.
817 AC_CHECK_HEADER(libintl.h,
818 [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
819 [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
820 gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
822 if test "$gt_cv_func_gettext_libc" != "yes"; then
823 AC_CHECK_LIB(intl, bindtextdomain,
824 [AC_CACHE_CHECK([for gettext in libintl],
825 gt_cv_func_gettext_libintl,
826 [AC_CHECK_LIB(intl, gettext,
827 gt_cv_func_gettext_libintl=yes,
828 gt_cv_func_gettext_libintl=no)],
829 gt_cv_func_gettext_libintl=no)])
832 if test "$gt_cv_func_gettext_libc" = "yes" \
833 || test "$gt_cv_func_gettext_libintl" = "yes"; then
834 AC_DEFINE(HAVE_GETTEXT)
835 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
836 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
837 if test "$MSGFMT" != "no"; then
838 AC_CHECK_FUNCS(dcgettext)
839 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
840 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
841 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
842 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
843 return _nl_msg_cat_cntr],
853 if test "$CATOBJEXT" = "NONE"; then
854 AC_MSG_CHECKING([whether catgets can be used])
856 [ --with-catgets use catgets functions if available],
857 nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
858 AC_MSG_RESULT($nls_cv_use_catgets)
860 if test "$nls_cv_use_catgets" = "yes"; then
861 dnl No gettext in C library. Try catgets next.
862 AC_CHECK_LIB(i, main)
863 AC_CHECK_FUNC(catgets,
864 [AC_DEFINE(HAVE_CATGETS)
865 INTLOBJS="\$(CATOBJS)"
866 AC_PATH_PROG(GENCAT, gencat, no)dnl
867 if test "$GENCAT" != "no"; then
868 AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
869 if test "$GMSGFMT" = "no"; then
870 AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
871 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
873 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
874 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
875 USE_INCLUDED_LIBINTL=yes
879 INTLDEPS='$(top_builddir)/intl/libintl.a'
881 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
882 nls_cv_header_intl=intl/libintl.h
883 nls_cv_header_libgt=intl/libgettext.h
888 if test "$CATOBJEXT" = "NONE"; then
889 dnl Neither gettext nor catgets in included in the C library.
890 dnl Fall back on GNU gettext library.
891 nls_cv_use_gnu_gettext=yes
895 if test "$nls_cv_use_gnu_gettext" = "yes"; then
896 dnl Mark actions used to generate GNU NLS library.
897 INTLOBJS="\$(GETTOBJS)"
898 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
899 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
900 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
901 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
902 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
904 USE_INCLUDED_LIBINTL=yes
908 INTLDEPS='$(top_builddir)/intl/libintl.a'
910 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
911 nls_cv_header_intl=intl/libintl.h
912 nls_cv_header_libgt=intl/libgettext.h
915 dnl Test whether we really found GNU xgettext.
916 if test "$XGETTEXT" != ":"; then
917 dnl If it is no GNU xgettext we define it as : so that the
918 dnl Makefiles still can work.
919 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
923 [found xgettext program is not GNU xgettext; ignore it])
928 # We need to process the po/ directory.
932 nls_cv_header_intl=intl/libintl.h
933 nls_cv_header_libgt=intl/libgettext.h
935 AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
937 [case "$CONFIG_FILES" in *po/Makefile.in*)
938 sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
942 # If this is used in GNU gettext we have to set USE_NLS to `yes'
943 # because some of the sources are only built for this goal.
944 if test "$PACKAGE" = gettext; then
946 USE_INCLUDED_LIBINTL=yes
949 dnl These rules are solely for the distribution goal. While doing this
950 dnl we only have to keep exactly one list of the available catalogs
952 for lang in $ALL_LINGUAS; do
953 GMOFILES="$GMOFILES $lang.gmo"
954 POFILES="$POFILES $lang.po"
957 dnl Make all variables we use known to autoconf.
958 AC_SUBST(USE_INCLUDED_LIBINTL)
961 AC_SUBST(DATADIRNAME)
971 AC_DEFUN(AM_GNU_GETTEXT,
972 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
973 AC_REQUIRE([AC_PROG_CC])dnl
974 AC_REQUIRE([AC_PROG_RANLIB])dnl
975 AC_REQUIRE([AC_ISC_POSIX])dnl
976 AC_REQUIRE([AC_HEADER_STDC])dnl
977 AC_REQUIRE([AC_C_CONST])dnl
978 AC_REQUIRE([AC_C_INLINE])dnl
979 AC_REQUIRE([AC_TYPE_OFF_T])dnl
980 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
981 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
982 AC_REQUIRE([AC_FUNC_MMAP])dnl
984 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
985 unistd.h sys/param.h])
986 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
987 strdup __argz_count __argz_stringify __argz_next])
989 if test "${ac_cv_func_stpcpy+set}" != "set"; then
990 AC_CHECK_FUNCS(stpcpy)
992 if test "${ac_cv_func_stpcpy}" = "yes"; then
993 AC_DEFINE(HAVE_STPCPY)
999 if test "x$CATOBJEXT" != "x"; then
1000 if test "x$ALL_LINGUAS" = "x"; then
1003 AC_MSG_CHECKING(for catalogs to be installed)
1005 for lang in ${LINGUAS=$ALL_LINGUAS}; do
1006 case "$ALL_LINGUAS" in
1007 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
1010 LINGUAS=$NEW_LINGUAS
1011 AC_MSG_RESULT($LINGUAS)
1014 dnl Construct list of names of catalog files to be constructed.
1015 if test -n "$LINGUAS"; then
1016 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1020 dnl The reference to <locale.h> in the installed <libintl.h> file
1021 dnl must be resolved because we cannot expect the users of this
1022 dnl to define HAVE_LOCALE_H.
1023 if test $ac_cv_header_locale_h = yes; then
1024 INCLUDE_LOCALE_H="#include <locale.h>"
1027 /* The system does not provide the header <locale.h>. Take care yourself. */"
1029 AC_SUBST(INCLUDE_LOCALE_H)
1031 dnl Determine which catalog format we have (if any is needed)
1032 dnl For now we know about two different formats:
1033 dnl Linux libc-5 and the normal X/Open format
1034 test -d intl || mkdir intl
1035 if test "$CATOBJEXT" = ".cat"; then
1036 AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
1038 dnl Transform the SED scripts while copying because some dumb SEDs
1039 dnl cannot handle comments.
1040 sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
1042 dnl po2tbl.sed is always needed.
1043 sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
1044 $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
1046 dnl In the intl/Makefile.in we have a special dependency which makes
1047 dnl only sense for gettext. We comment this out for non-gettext
1049 if test "$PACKAGE" = "gettext"; then
1059 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1060 dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
1061 dnl Try to locate is.
1063 if test -n "$ac_aux_dir"; then
1064 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1066 if test -z "$MKINSTALLDIRS"; then
1067 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1069 AC_SUBST(MKINSTALLDIRS)
1071 dnl *** For now the libtool support in intl/Makefile is not for real.
1075 dnl Generate list of files to be processed by xgettext which will
1076 dnl be included in po/Makefile.
1077 test -d po || mkdir po
1078 if test "x$srcdir" != "x."; then
1079 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
1080 posrcprefix="$srcdir/"
1082 posrcprefix="../$srcdir/"
1088 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
1089 < $srcdir/po/POTFILES.in > po/POTFILES
1092 # Search path for a program which passes the given test.
1093 # Ulrich Drepper <drepper@cygnus.com>, 1996.
1095 # This file can be copied and used freely without restrictions. It can
1096 # be used in projects which are not available under the GNU Public License
1097 # but which still want to provide support for the GNU gettext functionality.
1098 # Please note that the actual code is *not* freely available.
1102 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1103 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1104 AC_DEFUN(AM_PATH_PROG_WITH_TEST,
1105 [# Extract the first word of "$2", so it can be a program name with args.
1106 set dummy $2; ac_word=[$]2
1107 AC_MSG_CHECKING([for $ac_word])
1108 AC_CACHE_VAL(ac_cv_path_$1,
1111 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1114 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1115 for ac_dir in ifelse([$5], , $PATH, [$5]); do
1116 test -z "$ac_dir" && ac_dir=.
1117 if test -f $ac_dir/$ac_word; then
1119 ac_cv_path_$1="$ac_dir/$ac_word"
1125 dnl If no 4th arg is given, leave the cache variable unset,
1126 dnl so AC_PATH_PROGS will keep looking.
1127 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1132 if test -n "[$]$1"; then
1133 AC_MSG_RESULT([$]$1)
1140 # Check whether LC_MESSAGES is available in <locale.h>.
1141 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1143 # This file can be copied and used freely without restrictions. It can
1144 # be used in projects which are not available under the GNU Public License
1145 # but which still want to provide support for the GNU gettext functionality.
1146 # Please note that the actual code is *not* freely available.
1150 AC_DEFUN(AM_LC_MESSAGES,
1151 [if test $ac_cv_header_locale_h = yes; then
1152 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1153 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1154 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1155 if test $am_cv_val_LC_MESSAGES = yes; then
1156 AC_DEFINE(HAVE_LC_MESSAGES)