1 dnl aclocal.m4 generated automatically by aclocal 1.4
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
13 dnl See whether we need to use fopen-bin.h rather than fopen-same.h.
14 AC_DEFUN(BFD_BINARY_FOPEN,
15 [AC_REQUIRE([AC_CANONICAL_SYSTEM])
18 *-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
20 AC_DEFINE(USE_BINARY_FOPEN, 1, [Use b modifier when opening binary files?]) ;;
23 dnl Get a default for CC_FOR_BUILD to put into Makefile.
24 AC_DEFUN(BFD_CC_FOR_BUILD,
25 [# Put a plausible default for CC_FOR_BUILD in Makefile.
26 if test -z "$CC_FOR_BUILD"; then
27 if test "x$cross_compiling" = "xno"; then
33 AC_SUBST(CC_FOR_BUILD)
34 # Also set EXEEXT_FOR_BUILD.
35 if test "x$cross_compiling" = "xno"; then
36 EXEEXT_FOR_BUILD='$(EXEEXT)'
38 AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext,
40 echo 'int main () { return 0; }' > conftest.c
42 ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5
43 for file in conftest.*; do
45 *.c | *.o | *.obj | *.ilk | *.pdb) ;;
46 *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
50 test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
52 test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
54 AC_SUBST(EXEEXT_FOR_BUILD)])dnl
56 dnl See whether we need a declaration for a function.
57 AC_DEFUN(BFD_NEED_DECLARATION,
58 [AC_MSG_CHECKING([whether $1 must be declared])
59 AC_CACHE_VAL(bfd_cv_decl_needed_$1,
75 [char *(*pfn) = (char *(*)) $1],
76 bfd_cv_decl_needed_$1=no, bfd_cv_decl_needed_$1=yes)])
77 AC_MSG_RESULT($bfd_cv_decl_needed_$1)
78 if test $bfd_cv_decl_needed_$1 = yes; then
79 AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), 1,
80 [Define if $1 is not declared in system header files.])
84 dnl Check for existence of a type $1 in sys/procfs.h
86 AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE,
87 [AC_MSG_CHECKING([for $1 in sys/procfs.h])
88 AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_$1,
89 [AC_TRY_COMPILE([#include <sys/procfs.h>],
91 bfd_cv_have_sys_procfs_type_$1=yes,
92 bfd_cv_have_sys_procfs_type_$1=no
94 if test $bfd_cv_have_sys_procfs_type_$1 = yes; then
95 AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z]), 1,
96 [Define if <sys/procfs.h> has $1.])
98 AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_$1)
102 dnl Check for existence of member $2 in type $1 in sys/procfs.h
104 AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE_MEMBER,
105 [AC_MSG_CHECKING([for $1.$2 in sys/procfs.h])
106 AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_member_$1_$2,
107 [AC_TRY_COMPILE([#include <sys/procfs.h>],
108 [$1 avar; void* aref = (void*) &avar.$2],
109 bfd_cv_have_sys_procfs_type_member_$1_$2=yes,
110 bfd_cv_have_sys_procfs_type_member_$1_$2=no
112 if test $bfd_cv_have_sys_procfs_type_member_$1_$2 = yes; then
113 AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z])[_]translit($2, [a-z], [A-Z]), 1,
114 [Define if <sys/procfs.h> has $1.$2.])
116 AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_member_$1_$2)
121 # Do all the work for Automake. This macro actually does too much --
122 # some checks are only needed if your package does certain things.
123 # But this isn't really a big deal.
128 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
130 AC_DEFUN(AM_INIT_AUTOMAKE,
131 [AC_REQUIRE([AC_PROG_INSTALL])
136 dnl test to see if srcdir already configured
137 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
138 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
141 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
142 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
143 AC_REQUIRE([AM_SANITY_CHECK])
144 AC_REQUIRE([AC_ARG_PROGRAM])
145 dnl FIXME This is truly gross.
146 missing_dir=`cd $ac_aux_dir && pwd`
147 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
148 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
149 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
150 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
151 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
152 AC_REQUIRE([AC_PROG_MAKE_SET])])
155 # Check to make sure that the build environment is sane.
158 AC_DEFUN(AM_SANITY_CHECK,
159 [AC_MSG_CHECKING([whether build environment is sane])
162 echo timestamp > conftestfile
163 # Do `set' in a subshell so we don't clobber the current shell's
164 # arguments. Must try -L first in case configure is actually a
165 # symlink; some systems play weird games with the mod time of symlinks
166 # (eg FreeBSD returns the mod time of the symlink's containing
169 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
170 if test "[$]*" = "X"; then
172 set X `ls -t $srcdir/configure conftestfile`
174 if test "[$]*" != "X $srcdir/configure conftestfile" \
175 && test "[$]*" != "X conftestfile $srcdir/configure"; then
177 # If neither matched, then we have a broken ls. This can happen
178 # if, for instance, CONFIG_SHELL is bash and it inherits a
179 # broken ls alias from the environment. This has actually
180 # happened. Such a system could not be considered "sane".
181 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
182 alias in your environment])
185 test "[$]2" = conftestfile
191 AC_MSG_ERROR([newly created file is older than distributed files!
192 Check your system clock])
197 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
198 dnl The program must properly implement --version.
199 AC_DEFUN(AM_MISSING_PROG,
200 [AC_MSG_CHECKING(for working $2)
201 # Run test in a subshell; some versions of sh will print an error if
202 # an executable is not found, even if stderr is redirected.
203 # Redirect stdin to placate older versions of autoconf. Sigh.
204 if ($2 --version) < /dev/null > /dev/null 2>&1; then
209 AC_MSG_RESULT(missing)
214 # serial 35 AC_PROG_LIBTOOL
215 AC_DEFUN(AC_PROG_LIBTOOL,
216 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
218 # Save cache, so that ltconfig can load it
221 # Actually configure libtool. ac_aux_dir is where install-sh is found.
222 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
223 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
224 DLLTOOL="$DLLTOOL" AS="$AS" \
225 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
226 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
227 || AC_MSG_ERROR([libtool configure failed])
229 # Reload cache, that may have been modified by ltconfig
232 # This can be used to rebuild libtool when needed
233 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
235 # Always use our own libtool.
236 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
239 # Redirect the config.log output again, so that the ltconfig log is not
240 # clobbered by the next message.
244 AC_DEFUN(AC_LIBTOOL_SETUP,
246 AC_REQUIRE([AC_ENABLE_SHARED])dnl
247 AC_REQUIRE([AC_ENABLE_STATIC])dnl
248 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
249 AC_REQUIRE([AC_CANONICAL_HOST])dnl
250 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
251 AC_REQUIRE([AC_PROG_RANLIB])dnl
252 AC_REQUIRE([AC_PROG_CC])dnl
253 AC_REQUIRE([AC_PROG_LD])dnl
254 AC_REQUIRE([AC_PROG_NM])dnl
255 AC_REQUIRE([AC_SYS_NM_PARSE])dnl
256 AC_REQUIRE([AC_SYS_SYMBOL_UNDERSCORE])dnl
257 AC_REQUIRE([AC_PROG_LN_S])dnl
260 # Check for any special flags to pass to ltconfig.
261 libtool_flags="--cache-file=$cache_file"
262 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
263 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
264 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
265 test "$lt_dlopen" = yes && libtool_flags="$libtool_flags --enable-dlopen"
266 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
267 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
268 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
270 # Some flags need to be propagated to the compiler or linker for good
274 # Find out which ABI we are using.
275 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
276 if AC_TRY_EVAL(ac_compile); then
277 case "`/usr/bin/file conftest.o`" in
293 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
294 SAVE_CFLAGS="$CFLAGS"
295 CFLAGS="$CFLAGS -belf"
296 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
297 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
298 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
299 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
300 CFLAGS="$SAVE_CFLAGS"
305 AC_SYS_LIBTOOL_CYGWIN
310 # enable the --disable-libtool-lock switch
312 AC_ARG_ENABLE(libtool-lock,
313 [ --disable-libtool-lock force libtool not to do file locking],
314 need_locks=$enableval,
317 if test x"$need_locks" = xno; then
318 libtool_flags="$libtool_flags --disable-lock"
322 # AC_LIBTOOL_DLOPEN - check for dlopen support
323 AC_DEFUN(AC_LIBTOOL_DLOPEN, [lt_dlopen=yes])
325 # AC_ENABLE_SHARED - implement the --enable-shared flag
326 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
327 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
329 AC_DEFUN(AC_ENABLE_SHARED,
330 [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
331 AC_ARG_ENABLE(shared,
332 changequote(<<, >>)dnl
333 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
335 [p=${PACKAGE-default}
337 yes) enable_shared=yes ;;
338 no) enable_shared=no ;;
341 # Look at the argument we got. We use all the common list separators.
342 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
343 for pkg in $enableval; do
344 if test "X$pkg" = "X$p"; then
351 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
354 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
355 AC_DEFUN(AC_DISABLE_SHARED,
356 [AC_ENABLE_SHARED(no)])
358 # AC_ENABLE_STATIC - implement the --enable-static flag
359 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
360 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
362 AC_DEFUN(AC_ENABLE_STATIC,
363 [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
364 AC_ARG_ENABLE(static,
365 changequote(<<, >>)dnl
366 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
368 [p=${PACKAGE-default}
370 yes) enable_static=yes ;;
371 no) enable_static=no ;;
374 # Look at the argument we got. We use all the common list separators.
375 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
376 for pkg in $enableval; do
377 if test "X$pkg" = "X$p"; then
384 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
387 # AC_DISABLE_STATIC - set the default static flag to --disable-static
388 AC_DEFUN(AC_DISABLE_STATIC,
389 [AC_ENABLE_STATIC(no)])
392 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
393 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
394 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
396 AC_DEFUN(AC_ENABLE_FAST_INSTALL,
397 [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
398 AC_ARG_ENABLE(fast-install,
399 changequote(<<, >>)dnl
400 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
402 [p=${PACKAGE-default}
404 yes) enable_fast_install=yes ;;
405 no) enable_fast_install=no ;;
407 enable_fast_install=no
408 # Look at the argument we got. We use all the common list separators.
409 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
410 for pkg in $enableval; do
411 if test "X$pkg" = "X$p"; then
412 enable_fast_install=yes
418 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
421 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
422 AC_DEFUN(AC_DISABLE_FAST_INSTALL,
423 [AC_ENABLE_FAST_INSTALL(no)])
426 # AC_PROG_LD - find the path to the GNU or non-GNU linker
429 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
430 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
431 AC_REQUIRE([AC_PROG_CC])dnl
432 AC_REQUIRE([AC_CANONICAL_HOST])dnl
433 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
435 if test "$ac_cv_prog_gcc" = yes; then
436 # Check if gcc -print-prog-name=ld gives a path.
437 AC_MSG_CHECKING([for ld used by GCC])
438 ac_prog=`($CC -print-prog-name=ld) 2>&5`
440 # Accept absolute paths.
442 /* | [A-Za-z]:[\\/]*)
443 re_direlt='/[^/][^/]*/\.\./'
445 # Canonicalize the path of ld
446 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
447 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
448 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
450 test -z "$LD" && LD="$ac_prog"
453 # If it fails, then pretend we aren't using GCC.
457 # If it is relative, then search for the first ld in PATH.
461 elif test "$with_gnu_ld" = yes; then
462 AC_MSG_CHECKING([for GNU ld])
464 AC_MSG_CHECKING([for non-GNU ld])
466 AC_CACHE_VAL(ac_cv_path_LD,
467 [if test -z "$LD"; then
468 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
469 for ac_dir in $PATH; do
470 test -z "$ac_dir" && ac_dir=.
471 if test -f "$ac_dir/$ac_prog"; then
472 ac_cv_path_LD="$ac_dir/$ac_prog"
473 # Check to see if the program is GNU ld. I'd rather use --version,
474 # but apparently some GNU ld's only accept -v.
475 # Break only if it was the GNU/non-GNU ld that we prefer.
476 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
477 test "$with_gnu_ld" != no && break
479 test "$with_gnu_ld" != yes && break
485 ac_cv_path_LD="$LD" # Let the user override the test with a path.
488 if test -n "$LD"; then
493 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
498 AC_DEFUN(AC_PROG_LD_GNU,
499 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
500 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
501 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
502 ac_cv_prog_gnu_ld=yes
508 # AC_PROG_NM - find the path to a BSD-compatible name lister
510 [AC_MSG_CHECKING([for BSD-compatible nm])
511 AC_CACHE_VAL(ac_cv_path_NM,
512 [if test -n "$NM"; then
513 # Let the user override the test.
516 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
517 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
518 test -z "$ac_dir" && ac_dir=.
519 if test -f $ac_dir/nm; then
520 # Check to see if the nm accepts a BSD-compat flag.
521 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
522 # nm: unknown option "B" ignored
523 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
524 ac_cv_path_NM="$ac_dir/nm -B"
526 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
527 ac_cv_path_NM="$ac_dir/nm -p"
530 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
531 continue # so that we can try to find one that supports BSD flags
536 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
543 # AC_SYS_NM_PARSE - Check for command to grab the raw symbol name followed
544 # by C symbol name from nm.
545 AC_DEFUN(AC_SYS_NM_PARSE,
546 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
547 AC_REQUIRE([AC_PROG_NM])dnl
548 # Check for command to grab the raw symbol name followed by C symbol from nm.
549 AC_MSG_CHECKING([command to parse $NM output])
550 AC_CACHE_VAL(ac_cv_sys_global_symbol_pipe,
551 [# These are sane defaults that work on at least a few old systems.
552 # {They come from Ultrix. What could be older than Ultrix?!! ;)}
555 # Character class describing NM global symbol codes.
556 ac_symcode='[BCDEGRST]'
558 # Regexp to match symbols that can be accessed directly from C.
559 ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
561 # Transform the above into a raw symbol and a C symbol.
562 ac_symxfrm='\1 \2\3 \3'
564 # Transform an extracted symbol line into a proper C declaration
565 ac_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
567 # Define system-specific variables.
573 ac_symcode='[ABCDGISTW]'
576 ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
579 ac_symcode='[BCDEGRST]'
586 # If we're using GNU nm, then use its standard symbol codes.
587 if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
588 ac_symcode='[ABCDGISTW]'
592 # Try without a prefix undercore, then with it.
593 for ac_symprfx in "" "_"; do
595 ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($ac_symcode\)[ ][ ]*\($ac_symprfx\)$ac_sympat$/$ac_symxfrm/p'"
597 # Check to see that the pipe works correctly.
599 rm -f conftest.$ac_ext
600 cat > conftest.$ac_ext <<EOF
605 void nm_test_func(){}
609 int main(){nm_test_var='a';nm_test_func;return 0;}
612 if AC_TRY_EVAL(ac_compile); then
613 # Now try to grab the symbols.
616 if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
618 # Try sorting and uniquifying the output.
619 if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
620 mv -f "$ac_nlist"T "$ac_nlist"
625 # Make sure that we snagged all the symbols we need.
626 if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
627 if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
628 cat <<EOF > conftest.c
634 # Now generate the symbol file.
635 eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c'
637 cat <<EOF >> conftest.c
638 #if defined (__STDC__) && __STDC__
639 # define lt_ptr_t void *
641 # define lt_ptr_t char *
645 /* The mapping between symbol names and symbols. */
651 lt_preloaded_symbols[] =
655 sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
656 cat <<\EOF >> conftest.c
664 # Now try linking the two files.
665 mv conftest.$ac_objext conftestm.$ac_objext
667 ac_save_CFLAGS="$CFLAGS"
668 LIBS="conftestm.$ac_objext"
669 CFLAGS="$CFLAGS$no_builtin_flag"
670 if AC_TRY_EVAL(ac_link) && test -s conftest; then
673 echo "configure: failed program was:" >&AC_FD_CC
674 cat conftest.c >&AC_FD_CC
677 CFLAGS="$ac_save_CFLAGS"
679 echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
682 echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC
685 echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
688 echo "$progname: failed program was:" >&AC_FD_CC
689 cat conftest.c >&AC_FD_CC
693 # Do not use the global_symbol_pipe unless it works.
694 if test "$ac_pipe_works" = yes; then
695 if test x"$ac_symprfx" = x"_"; then
696 ac_cv_sys_symbol_underscore=yes
698 ac_cv_sys_symbol_underscore=no
702 ac_cv_sys_global_symbol_pipe=
708 if test -z "$ac_cv_sys_global_symbol_pipe"; then
711 AC_MSG_RESULT($ac_result)
714 # AC_SYS_LIBTOOL_CYGWIN - find tools needed on cygwin
715 AC_DEFUN(AC_SYS_LIBTOOL_CYGWIN,
716 [AC_CHECK_TOOL(DLLTOOL, dlltool, false)
717 AC_CHECK_TOOL(AS, as, false)
720 # AC_SYS_SYMBOL_UNDERSCORE - does the compiler prefix global symbols
721 # with an underscore?
722 AC_DEFUN(AC_SYS_SYMBOL_UNDERSCORE,
723 [AC_REQUIRE([AC_PROG_NM])dnl
724 AC_REQUIRE([AC_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 USE_SYMBOL_UNDERSCORE=${ac_cv_sys_symbol_underscore=no}
757 AC_SUBST(USE_SYMBOL_UNDERSCORE)dnl
760 # AC_CHECK_LIBM - check for math library
761 AC_DEFUN(AC_CHECK_LIBM, [
762 AC_CHECK_LIB(mw, _mwvalidcheckl)
766 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
767 # the libltdl convenience library, adds --enable-ltdl-convenience to
768 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
769 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
770 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
771 # '${top_builddir}/' (note the single quotes!) if your package is not
772 # flat, and, if you're not using automake, define top_builddir as
773 # appropriate in the Makefiles.
774 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [
775 case "$enable_ltdl_convenience" in
776 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
777 "") enable_ltdl_convenience=yes
778 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
780 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
783 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
784 # the libltdl installable library, and adds --enable-ltdl-install to
785 # the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
786 # is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
787 # to be `${top_builddir}/libltdl'. Make sure you start DIR with
788 # '${top_builddir}/' (note the single quotes!) if your package is not
789 # flat, and, if you're not using automake, define top_builddir as
790 # appropriate in the Makefiles.
791 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
792 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [
793 AC_CHECK_LIB(ltdl, main, LIBLTDL="-lltdl", [
794 case "$enable_ltdl_install" in
795 no) AC_MSG_WARN([libltdl not installed, but installation disabled]) ;;
796 "") enable_ltdl_install=yes
797 ac_configure_args="$ac_configure_args --enable-ltdl-install" ;;
800 if test x"$enable_ltdl_install" != x"no"; then
801 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
806 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
807 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
808 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
809 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
810 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
811 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
812 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
813 AC_DEFUN(AM_SYS_NM_PARSE, [indir([AC_SYS_NM_PARSE])])dnl
814 AC_DEFUN(AM_SYS_SYMBOL_UNDERSCORE, [indir([AC_SYS_SYMBOL_UNDERSCORE])])dnl
815 AC_DEFUN(AM_SYS_LIBTOOL_CYGWIN, [indir([AC_SYS_LIBTOOL_CYGWIN])])dnl
817 # Like AC_CONFIG_HEADER, but automatically create stamp file.
819 AC_DEFUN(AM_CONFIG_HEADER,
821 AC_CONFIG_HEADER([$1])
822 dnl When config.status generates a header, we must update the stamp-h file.
823 dnl This file resides in the same directory as the config header
824 dnl that is generated. We must strip everything past the first ":",
825 dnl and everything past the last "/".
826 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
827 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
828 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
830 for am_file in <<$1>>; do
831 case " <<$>>CONFIG_HEADERS " in
832 *" <<$>>am_file "*<<)>>
833 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
836 am_indx=`expr "<<$>>am_indx" + 1`
840 # Add --enable-maintainer-mode option to configure.
845 AC_DEFUN(AM_MAINTAINER_MODE,
846 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
847 dnl maintainer-mode is disabled by default
848 AC_ARG_ENABLE(maintainer-mode,
849 [ --enable-maintainer-mode enable make rules and dependencies not useful
850 (and sometimes confusing) to the casual installer],
851 USE_MAINTAINER_MODE=$enableval,
852 USE_MAINTAINER_MODE=no)
853 AC_MSG_RESULT($USE_MAINTAINER_MODE)
854 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
855 MAINT=$MAINTAINER_MODE_TRUE
860 # Define a conditional.
862 AC_DEFUN(AM_CONDITIONAL,
873 # This file is derived from `gettext.m4'. The difference is that the
874 # included macros assume Cygnus-style source and build trees.
876 # Macro to add for using GNU gettext.
877 # Ulrich Drepper <drepper@cygnus.com>, 1995.
879 # This file file be copied and used freely without restrictions. It can
880 # be used in projects which are not available under the GNU Public License
881 # but which still want to provide support for the GNU gettext functionality.
882 # Please note that the actual code is *not* freely available.
886 AC_DEFUN(CY_WITH_NLS,
887 [AC_MSG_CHECKING([whether NLS is requested])
888 dnl Default is enabled NLS
890 [ --disable-nls do not use Native Language Support],
891 USE_NLS=$enableval, USE_NLS=yes)
892 AC_MSG_RESULT($USE_NLS)
895 USE_INCLUDED_LIBINTL=no
897 dnl If we use NLS figure out what method
898 if test "$USE_NLS" = "yes"; then
899 AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS is requested])
900 AC_MSG_CHECKING([whether included gettext is requested])
901 AC_ARG_WITH(included-gettext,
902 [ --with-included-gettext use the GNU gettext library included here],
903 nls_cv_force_use_gnu_gettext=$withval,
904 nls_cv_force_use_gnu_gettext=no)
905 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
907 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
908 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
909 dnl User does not insist on using GNU NLS library. Figure out what
910 dnl to use. If gettext or catgets are available (in this order) we
911 dnl use this. Else we have to fall back to GNU NLS library.
912 dnl catgets is only used if permitted by option --with-catgets.
917 AC_CHECK_HEADER(libintl.h,
918 [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
919 [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
920 gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
922 if test "$gt_cv_func_gettext_libc" != "yes"; then
923 AC_CHECK_LIB(intl, bindtextdomain,
924 [AC_CACHE_CHECK([for gettext in libintl],
925 gt_cv_func_gettext_libintl,
926 [AC_TRY_LINK([], [return (int) gettext ("")],
927 gt_cv_func_gettext_libintl=yes,
928 gt_cv_func_gettext_libintl=no)])])
931 if test "$gt_cv_func_gettext_libc" = "yes" \
932 || test "$gt_cv_func_gettext_libintl" = "yes"; then
933 AC_DEFINE(HAVE_GETTEXT, 1,
934 [Define as 1 if you have gettext and don't want to use GNU gettext.])
935 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
936 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
937 if test "$MSGFMT" != "no"; then
938 AC_CHECK_FUNCS(dcgettext)
939 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
940 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
941 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
942 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
943 return _nl_msg_cat_cntr],
953 dnl In the standard gettext, we would now check for catgets.
954 dnl However, we never want to use catgets for our releases.
956 if test "$CATOBJEXT" = "NONE"; then
957 dnl Neither gettext nor catgets in included in the C library.
958 dnl Fall back on GNU gettext library.
959 nls_cv_use_gnu_gettext=yes
963 if test "$nls_cv_use_gnu_gettext" = "yes"; then
964 dnl Mark actions used to generate GNU NLS library.
965 INTLOBJS="\$(GETTOBJS)"
966 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
967 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
968 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
969 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
970 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
972 USE_INCLUDED_LIBINTL=yes
976 INTLDEPS='$(top_builddir)/../intl/libintl.a'
978 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
979 nls_cv_header_intl=libintl.h
980 nls_cv_header_libgt=libgettext.h
983 dnl Test whether we really found GNU xgettext.
984 if test "$XGETTEXT" != ":"; then
985 dnl If it is no GNU xgettext we define it as : so that the
986 dnl Makefiles still can work.
987 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
991 [found xgettext programs is not GNU xgettext; ignore it])
996 # We need to process the po/ directory.
1000 nls_cv_header_intl=libintl.h
1001 nls_cv_header_libgt=libgettext.h
1004 # If this is used in GNU gettext we have to set USE_NLS to `yes'
1005 # because some of the sources are only built for this goal.
1006 if test "$PACKAGE" = gettext; then
1008 USE_INCLUDED_LIBINTL=yes
1011 dnl These rules are solely for the distribution goal. While doing this
1012 dnl we only have to keep exactly one list of the available catalogs
1013 dnl in configure.in.
1014 for lang in $ALL_LINGUAS; do
1015 GMOFILES="$GMOFILES $lang.gmo"
1016 POFILES="$POFILES $lang.po"
1019 dnl Make all variables we use known to autoconf.
1020 AC_SUBST(USE_INCLUDED_LIBINTL)
1023 AC_SUBST(DATADIRNAME)
1025 AC_SUBST(INSTOBJEXT)
1033 AC_DEFUN(CY_GNU_GETTEXT,
1034 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1035 AC_REQUIRE([AC_PROG_CC])dnl
1036 AC_REQUIRE([AC_PROG_RANLIB])dnl
1037 AC_REQUIRE([AC_ISC_POSIX])dnl
1038 AC_REQUIRE([AC_HEADER_STDC])dnl
1039 AC_REQUIRE([AC_C_CONST])dnl
1040 AC_REQUIRE([AC_C_INLINE])dnl
1041 AC_REQUIRE([AC_TYPE_OFF_T])dnl
1042 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1043 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1044 AC_REQUIRE([AC_FUNC_MMAP])dnl
1046 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
1047 unistd.h values.h sys/param.h])
1048 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
1049 __argz_count __argz_stringify __argz_next])
1051 if test "${ac_cv_func_stpcpy+set}" != "set"; then
1052 AC_CHECK_FUNCS(stpcpy)
1054 if test "${ac_cv_func_stpcpy}" = "yes"; then
1055 AC_DEFINE(HAVE_STPCPY, 1, [Define if you have the stpcpy function])
1061 if test "x$CATOBJEXT" != "x"; then
1062 if test "x$ALL_LINGUAS" = "x"; then
1065 AC_MSG_CHECKING(for catalogs to be installed)
1067 for lang in ${LINGUAS=$ALL_LINGUAS}; do
1068 case "$ALL_LINGUAS" in
1069 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
1072 LINGUAS=$NEW_LINGUAS
1073 AC_MSG_RESULT($LINGUAS)
1076 dnl Construct list of names of catalog files to be constructed.
1077 if test -n "$LINGUAS"; then
1078 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1082 dnl The reference to <locale.h> in the installed <libintl.h> file
1083 dnl must be resolved because we cannot expect the users of this
1084 dnl to define HAVE_LOCALE_H.
1085 if test $ac_cv_header_locale_h = yes; then
1086 INCLUDE_LOCALE_H="#include <locale.h>"
1089 /* The system does not provide the header <locale.h>. Take care yourself. */"
1091 AC_SUBST(INCLUDE_LOCALE_H)
1093 dnl Determine which catalog format we have (if any is needed)
1094 dnl For now we know about two different formats:
1095 dnl Linux libc-5 and the normal X/Open format
1096 if test -f $srcdir/po2tbl.sed.in; then
1097 if test "$CATOBJEXT" = ".cat"; then
1098 AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
1100 dnl Transform the SED scripts while copying because some dumb SEDs
1101 dnl cannot handle comments.
1102 sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed
1104 dnl po2tbl.sed is always needed.
1105 sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
1106 $srcdir/po2tbl.sed.in > po2tbl.sed
1109 dnl In the intl/Makefile.in we have a special dependency which makes
1110 dnl only sense for gettext. We comment this out for non-gettext
1112 if test "$PACKAGE" = "gettext"; then
1122 MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs"
1123 AC_SUBST(MKINSTALLDIRS)
1125 dnl *** For now the libtool support in intl/Makefile is not for real.
1129 dnl Generate list of files to be processed by xgettext which will
1130 dnl be included in po/Makefile. But only do this if the po directory
1131 dnl exists in srcdir.
1132 if test -d $srcdir/po; then
1133 test -d po || mkdir po
1134 if test "x$srcdir" != "x."; then
1135 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
1136 posrcprefix="$srcdir/"
1138 posrcprefix="../$srcdir/"
1144 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
1145 < $srcdir/po/POTFILES.in > po/POTFILES
1149 # Search path for a program which passes the given test.
1150 # Ulrich Drepper <drepper@cygnus.com>, 1996.
1152 # This file file be copied and used freely without restrictions. It can
1153 # be used in projects which are not available under the GNU Public License
1154 # but which still want to provide support for the GNU gettext functionality.
1155 # Please note that the actual code is *not* freely available.
1159 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1160 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1161 AC_DEFUN(AM_PATH_PROG_WITH_TEST,
1162 [# Extract the first word of "$2", so it can be a program name with args.
1163 set dummy $2; ac_word=[$]2
1164 AC_MSG_CHECKING([for $ac_word])
1165 AC_CACHE_VAL(ac_cv_path_$1,
1168 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1171 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1172 for ac_dir in ifelse([$5], , $PATH, [$5]); do
1173 test -z "$ac_dir" && ac_dir=.
1174 if test -f $ac_dir/$ac_word; then
1176 ac_cv_path_$1="$ac_dir/$ac_word"
1182 dnl If no 4th arg is given, leave the cache variable unset,
1183 dnl so AC_PATH_PROGS will keep looking.
1184 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1189 if test -n "[$]$1"; then
1190 AC_MSG_RESULT([$]$1)
1197 # Check whether LC_MESSAGES is available in <locale.h>.
1198 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1200 # This file file be copied and used freely without restrictions. It can
1201 # be used in projects which are not available under the GNU Public License
1202 # but which still want to provide support for the GNU gettext functionality.
1203 # Please note that the actual code is *not* freely available.
1207 AC_DEFUN(AM_LC_MESSAGES,
1208 [if test $ac_cv_header_locale_h = yes; then
1209 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1210 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1211 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1212 if test $am_cv_val_LC_MESSAGES = yes; then
1213 AC_DEFINE(HAVE_LC_MESSAGES, 1,
1214 [Define if your locale.h file contains LC_MESSAGES.])