1 # generated automatically by aclocal 1.7 -*- Autoconf -*-
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
4 # Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14 dnl acinclude.m4 -- Extra macros needed for GNU make.
16 dnl Automake will incorporate this into its generated aclocal.m4.
18 dnl ---------------------------------------------------------------------------
19 dnl Got this from the lynx 2.8 distribution.
20 dnl by T.E.Dickey <dickey@clark.net>
21 dnl and Jim Spath <jspath@mail.bcpl.lib.md.us>
22 dnl and Philippe De Muyter <phdm@macqel.be>
24 dnl Created: 1997/1/28
25 dnl Updated: 1997/12/23
26 dnl ---------------------------------------------------------------------------
27 dnl After checking for functions in the default $LIBS, make a further check
28 dnl for the functions that are netlib-related (these aren't always in the
29 dnl libc, etc., and have to be handled specially because there are conflicting
30 dnl and broken implementations.
31 dnl Common library requirements (in order):
32 dnl -lresolv -lsocket -lnsl
36 AC_DEFUN([CF_NETLIBS],[
38 AC_MSG_CHECKING(for network libraries)
39 AC_CACHE_VAL(cf_cv_netlibs,[
40 AC_MSG_RESULT(working...)
43 AC_CHECK_FUNCS(gethostname,,[
44 CF_RECHECK_FUNC(gethostname,nsl,cf_cv_netlibs,[
45 CF_RECHECK_FUNC(gethostname,socket,cf_cv_netlibs)])])
47 # FIXME: sequent needs this library (i.e., -lsocket -linet -lnsl), but
48 # I don't know the entrypoints - 97/7/22 TD
49 AC_CHECK_LIB(inet,main,cf_cv_netlibs="-linet $cf_cv_netlibs")
51 if test "$ac_cv_func_lsocket" != no ; then
52 AC_CHECK_FUNCS(socket,,[
53 CF_RECHECK_FUNC(socket,socket,cf_cv_netlibs,[
54 CF_RECHECK_FUNC(socket,bsd,cf_cv_netlibs)])])
57 AC_CHECK_FUNCS(gethostbyname,,[
58 CF_RECHECK_FUNC(gethostbyname,nsl,cf_cv_netlibs)])
60 AC_CHECK_FUNCS(strcasecmp,,[
61 CF_RECHECK_FUNC(strcasecmp,resolv,cf_cv_netlibs)])
63 LIBS="$LIBS $cf_cv_netlibs"
64 test $cf_test_netlibs = no && echo "$cf_cv_netlibs" >&AC_FD_MSG
66 dnl ---------------------------------------------------------------------------
67 dnl Re-check on a function to see if we can pick it up by adding a library.
68 dnl $1 = function to check
69 dnl $2 = library to check in
70 dnl $3 = environment to update (e.g., $LIBS)
71 dnl $4 = what to do if this fails
73 dnl This uses 'unset' if the shell happens to support it, but leaves the
74 dnl configuration variable set to 'unknown' if not. This is a little better
75 dnl than the normal autoconf test, which gives misleading results if a test
76 dnl for the function is made (e.g., with AC_CHECK_FUNC) after this macro is
77 dnl used (autoconf does not distinguish between a null token and one that is
79 AC_DEFUN([CF_RECHECK_FUNC],[
81 CF_UPPER(cf_tr_func,$1)
82 AC_DEFINE_UNQUOTED(HAVE_$cf_tr_func,1,[Define if you have function $1])
86 unset ac_cv_func_$1 2>/dev/null
90 dnl ---------------------------------------------------------------------------
91 dnl Make an uppercase version of a variable
96 $1=`echo $2 | tr '[a-z]' '[A-Z]'`
101 dnl ---------------------------------------------------------------------------
102 dnl From Paul Eggert <eggert@twinsun.com>
104 AC_DEFUN(AC_STRUCT_ST_MTIM_NSEC,
105 [AC_CACHE_CHECK([for nanoseconds field of struct stat.st_mtim],
106 ac_cv_struct_st_mtim_nsec,
107 [ac_save_CPPFLAGS="$CPPFLAGS"
108 ac_cv_struct_st_mtim_nsec=no
109 # tv_nsec -- the usual case
110 # _tv_nsec -- Solaris 2.6, if
111 # (defined _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED == 1
112 # && !defined __EXTENSIONS__)
113 # st__tim.tv_nsec -- UnixWare 2.1.2
114 for ac_val in tv_nsec _tv_nsec st__tim.tv_nsec; do
115 CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val"
116 AC_TRY_COMPILE([#include <sys/types.h>
117 #include <sys/stat.h>], [struct stat s; s.st_mtim.ST_MTIM_NSEC;],
118 [ac_cv_struct_st_mtim_nsec=$ac_val; break])
120 CPPFLAGS="$ac_save_CPPFLAGS"])
122 if test $ac_cv_struct_st_mtim_nsec != no; then
123 AC_DEFINE_UNQUOTED(ST_MTIM_NSEC, $ac_cv_struct_st_mtim_nsec, [Define if 'struct stat' contains a nanoseconds field])
129 dnl ---------------------------------------------------------------------------
130 dnl This will be in the next version of autoconf; take this out then!
132 # make_FUNC_SETVBUF_REVERSED
133 # ------------------------
134 AC_DEFUN([make_FUNC_SETVBUF_REVERSED],
135 [AC_REQUIRE([AC_C_PROTOTYPES])dnl
136 AC_CACHE_CHECK(whether setvbuf arguments are reversed,
137 ac_cv_func_setvbuf_reversed,
138 [ac_cv_func_setvbuf_reversed=no
143 int (setvbuf) (FILE *, int, char *, size_t);
145 [[char buf; return setvbuf (stdout, _IOLBF, &buf, 1);]])],
150 int (setvbuf) (FILE *, int, char *, size_t);
152 [[char buf; return setvbuf (stdout, &buf, _IOLBF, 1);]])],
153 [# It compiles and links either way, so it must not be declared
154 # with a prototype and most likely this is a K&R C compiler.
158 [[#include <stdio.h>]],
159 [[/* This call has the arguments reversed.
160 A reversed system may check and see that the address of buf
161 is not _IOLBF, _IONBF, or _IOFBF, and return nonzero. */
163 if (setvbuf (stdout, _IOLBF, &buf, 1) != 0)
166 exit (0); /* Non-reversed systems SEGV here. */]])],
167 ac_cv_func_setvbuf_reversed=yes,
168 rm -f core core.* *.core,
169 [[: # Assume setvbuf is not reversed when cross-compiling.]])]
170 ac_cv_func_setvbuf_reversed=yes)])])
171 if test $ac_cv_func_setvbuf_reversed = yes; then
172 AC_DEFINE(SETVBUF_REVERSED, 1,
173 [Define to 1 if the `setvbuf' function takes the buffering type as
174 its second argument and the buffer pointer as the third, as on
175 System V before release 3.])
177 ])# make_FUNC_SETVBUF_REVERSED
179 # Do all the work for Automake. -*- Autoconf -*-
181 # This macro actually does too much some checks are only needed if
182 # your package does certain things. But this isn't really a big deal.
184 # Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
185 # Free Software Foundation, Inc.
187 # This program is free software; you can redistribute it and/or modify
188 # it under the terms of the GNU General Public License as published by
189 # the Free Software Foundation; either version 2, or (at your option)
192 # This program is distributed in the hope that it will be useful,
193 # but WITHOUT ANY WARRANTY; without even the implied warranty of
194 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
195 # GNU General Public License for more details.
197 # You should have received a copy of the GNU General Public License
198 # along with this program; if not, write to the Free Software
199 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
204 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
205 # written in clear, in which case automake, when reading aclocal.m4,
206 # will think it sees a *use*, and therefore will trigger all it's
207 # C support machinery. Also note that it means that autoscan, seeing
208 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
213 # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
214 # the ones we care about.
215 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
217 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
218 # AM_INIT_AUTOMAKE([OPTIONS])
219 # -----------------------------------------------
220 # The call with PACKAGE and VERSION arguments is the old style
221 # call (pre autoconf-2.50), which is being phased out. PACKAGE
222 # and VERSION should now be passed to AC_INIT and removed from
223 # the call to AM_INIT_AUTOMAKE.
224 # We support both call styles for the transition. After
225 # the next Automake release, Autoconf can make the AC_INIT
226 # arguments mandatory, and then we can depend on a new Autoconf
227 # release and drop the old call support.
228 AC_DEFUN([AM_INIT_AUTOMAKE],
229 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
230 AC_REQUIRE([AC_PROG_INSTALL])dnl
231 # test to see if srcdir already configured
232 if test "`cd $srcdir && pwd`" != "`pwd`" &&
233 test -f $srcdir/config.status; then
234 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
237 # test whether we have cygpath
238 if test -z "$CYGPATH_W"; then
239 if (cygpath --version) >/dev/null 2>/dev/null; then
240 CYGPATH_W='cygpath -w'
245 AC_SUBST([CYGPATH_W])
247 # Define the identity of the package.
248 dnl Distinguish between old-style and new-style calls.
250 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
251 AC_SUBST([PACKAGE], [$1])dnl
252 AC_SUBST([VERSION], [$2])],
253 [_AM_SET_OPTIONS([$1])dnl
254 AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl
255 AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl
257 _AM_IF_OPTION([no-define],,
258 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
259 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
261 # Some tools Automake needs.
262 AC_REQUIRE([AM_SANITY_CHECK])dnl
263 AC_REQUIRE([AC_ARG_PROGRAM])dnl
264 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
265 AM_MISSING_PROG(AUTOCONF, autoconf)
266 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
267 AM_MISSING_PROG(AUTOHEADER, autoheader)
268 AM_MISSING_PROG(MAKEINFO, makeinfo)
269 AM_MISSING_PROG(AMTAR, tar)
271 AM_PROG_INSTALL_STRIP
272 # We need awk for the "check" target. The system "awk" is bad on
274 AC_REQUIRE([AC_PROG_AWK])dnl
275 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
277 _AM_IF_OPTION([no-dependencies],,
278 [AC_PROVIDE_IFELSE([AC_PROG_CC],
279 [_AM_DEPENDENCIES(CC)],
280 [define([AC_PROG_CC],
281 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
282 AC_PROVIDE_IFELSE([AC_PROG_CXX],
283 [_AM_DEPENDENCIES(CXX)],
284 [define([AC_PROG_CXX],
285 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
290 # When config.status generates a header, we must update the stamp-h file.
291 # This file resides in the same directory as the config header
292 # that is generated. The stamp files are numbered to have different names.
294 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
295 # loop where config.status creates the headers, so we can generate
296 # our stamp files there.
297 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
298 [_am_stamp_count=`expr ${_am_stamp_count-0} + 1`
299 echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
301 # Copyright 2002 Free Software Foundation, Inc.
303 # This program is free software; you can redistribute it and/or modify
304 # it under the terms of the GNU General Public License as published by
305 # the Free Software Foundation; either version 2, or (at your option)
308 # This program is distributed in the hope that it will be useful,
309 # but WITHOUT ANY WARRANTY; without even the implied warranty of
310 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
311 # GNU General Public License for more details.
313 # You should have received a copy of the GNU General Public License
314 # along with this program; if not, write to the Free Software
315 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
317 # AM_AUTOMAKE_VERSION(VERSION)
318 # ----------------------------
319 # Automake X.Y traces this macro to ensure aclocal.m4 has been
320 # generated from the m4 files accompanying Automake X.Y.
321 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
323 # AM_SET_CURRENT_AUTOMAKE_VERSION
324 # -------------------------------
325 # Call AM_AUTOMAKE_VERSION so it can be traced.
326 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
327 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
328 [AM_AUTOMAKE_VERSION([1.7])])
330 # Helper functions for option handling. -*- Autoconf -*-
332 # Copyright 2001, 2002 Free Software Foundation, Inc.
334 # This program is free software; you can redistribute it and/or modify
335 # it under the terms of the GNU General Public License as published by
336 # the Free Software Foundation; either version 2, or (at your option)
339 # This program is distributed in the hope that it will be useful,
340 # but WITHOUT ANY WARRANTY; without even the implied warranty of
341 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
342 # GNU General Public License for more details.
344 # You should have received a copy of the GNU General Public License
345 # along with this program; if not, write to the Free Software
346 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
351 # _AM_MANGLE_OPTION(NAME)
352 # -----------------------
353 AC_DEFUN([_AM_MANGLE_OPTION],
354 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
356 # _AM_SET_OPTION(NAME)
357 # ------------------------------
358 # Set option NAME. Presently that only means defining a flag for this option.
359 AC_DEFUN([_AM_SET_OPTION],
360 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
362 # _AM_SET_OPTIONS(OPTIONS)
363 # ----------------------------------
364 # OPTIONS is a space-separated list of Automake options.
365 AC_DEFUN([_AM_SET_OPTIONS],
366 [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
368 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
369 # -------------------------------------------
370 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
371 AC_DEFUN([_AM_IF_OPTION],
372 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
375 # Check to make sure that the build environment is sane.
378 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
380 # This program is free software; you can redistribute it and/or modify
381 # it under the terms of the GNU General Public License as published by
382 # the Free Software Foundation; either version 2, or (at your option)
385 # This program is distributed in the hope that it will be useful,
386 # but WITHOUT ANY WARRANTY; without even the implied warranty of
387 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
388 # GNU General Public License for more details.
390 # You should have received a copy of the GNU General Public License
391 # along with this program; if not, write to the Free Software
392 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
399 AC_DEFUN([AM_SANITY_CHECK],
400 [AC_MSG_CHECKING([whether build environment is sane])
403 echo timestamp > conftest.file
404 # Do `set' in a subshell so we don't clobber the current shell's
405 # arguments. Must try -L first in case configure is actually a
406 # symlink; some systems play weird games with the mod time of symlinks
407 # (eg FreeBSD returns the mod time of the symlink's containing
410 set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
411 if test "$[*]" = "X"; then
413 set X `ls -t $srcdir/configure conftest.file`
416 if test "$[*]" != "X $srcdir/configure conftest.file" \
417 && test "$[*]" != "X conftest.file $srcdir/configure"; then
419 # If neither matched, then we have a broken ls. This can happen
420 # if, for instance, CONFIG_SHELL is bash and it inherits a
421 # broken ls alias from the environment. This has actually
422 # happened. Such a system could not be considered "sane".
423 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
424 alias in your environment])
427 test "$[2]" = conftest.file
433 AC_MSG_ERROR([newly created file is older than distributed files!
434 Check your system clock])
441 # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
443 # This program is free software; you can redistribute it and/or modify
444 # it under the terms of the GNU General Public License as published by
445 # the Free Software Foundation; either version 2, or (at your option)
448 # This program is distributed in the hope that it will be useful,
449 # but WITHOUT ANY WARRANTY; without even the implied warranty of
450 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
451 # GNU General Public License for more details.
453 # You should have received a copy of the GNU General Public License
454 # along with this program; if not, write to the Free Software
455 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
460 # AM_MISSING_PROG(NAME, PROGRAM)
461 # ------------------------------
462 AC_DEFUN([AM_MISSING_PROG],
463 [AC_REQUIRE([AM_MISSING_HAS_RUN])
464 $1=${$1-"${am_missing_run}$2"}
470 # Define MISSING if not defined so far and test if it supports --run.
471 # If it does, set am_missing_run to use it, otherwise, to nothing.
472 AC_DEFUN([AM_MISSING_HAS_RUN],
473 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
474 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
475 # Use eval to expand $SHELL
476 if eval "$MISSING --run true"; then
477 am_missing_run="$MISSING --run "
480 AC_MSG_WARN([`missing' script is too old or missing])
486 # Copyright 2001 Free Software Foundation, Inc.
488 # This program is free software; you can redistribute it and/or modify
489 # it under the terms of the GNU General Public License as published by
490 # the Free Software Foundation; either version 2, or (at your option)
493 # This program is distributed in the hope that it will be useful,
494 # but WITHOUT ANY WARRANTY; without even the implied warranty of
495 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
496 # GNU General Public License for more details.
498 # You should have received a copy of the GNU General Public License
499 # along with this program; if not, write to the Free Software
500 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
503 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
504 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
505 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
507 # Of course, Automake must honor this variable whenever it calls a
508 # tool from the auxiliary directory. The problem is that $srcdir (and
509 # therefore $ac_aux_dir as well) can be either absolute or relative,
510 # depending on how configure is run. This is pretty annoying, since
511 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
512 # source directory, any form will work fine, but in subdirectories a
513 # relative path needs to be adjusted first.
515 # $ac_aux_dir/missing
516 # fails when called from a subdirectory if $ac_aux_dir is relative
517 # $top_srcdir/$ac_aux_dir/missing
518 # fails if $ac_aux_dir is absolute,
519 # fails when called from a subdirectory in a VPATH build with
520 # a relative $ac_aux_dir
522 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
523 # are both prefixed by $srcdir. In an in-source build this is usually
524 # harmless because $srcdir is `.', but things will broke when you
525 # start a VPATH build or use an absolute $srcdir.
527 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
528 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
529 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
530 # and then we would define $MISSING as
531 # MISSING="\${SHELL} $am_aux_dir/missing"
532 # This will work as long as MISSING is not called from configure, because
533 # unfortunately $(top_srcdir) has no meaning in configure.
534 # However there are other variables, like CC, which are often used in
535 # configure, and could therefore not use this "fixed" $ac_aux_dir.
537 # Another solution, used here, is to always expand $ac_aux_dir to an
538 # absolute PATH. The drawback is that using absolute paths prevent a
539 # configured tree to be moved without reconfiguration.
541 # Rely on autoconf to set up CDPATH properly.
544 AC_DEFUN([AM_AUX_DIR_EXPAND], [
545 # expand $ac_aux_dir to an absolute path
546 am_aux_dir=`cd $ac_aux_dir && pwd`
551 # Define $install_sh.
553 # Copyright 2001 Free Software Foundation, Inc.
555 # This program is free software; you can redistribute it and/or modify
556 # it under the terms of the GNU General Public License as published by
557 # the Free Software Foundation; either version 2, or (at your option)
560 # This program is distributed in the hope that it will be useful,
561 # but WITHOUT ANY WARRANTY; without even the implied warranty of
562 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
563 # GNU General Public License for more details.
565 # You should have received a copy of the GNU General Public License
566 # along with this program; if not, write to the Free Software
567 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
570 AC_DEFUN([AM_PROG_INSTALL_SH],
571 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
572 install_sh=${install_sh-"$am_aux_dir/install-sh"}
573 AC_SUBST(install_sh)])
575 # AM_PROG_INSTALL_STRIP
577 # Copyright 2001 Free Software Foundation, Inc.
579 # This program is free software; you can redistribute it and/or modify
580 # it under the terms of the GNU General Public License as published by
581 # the Free Software Foundation; either version 2, or (at your option)
584 # This program is distributed in the hope that it will be useful,
585 # but WITHOUT ANY WARRANTY; without even the implied warranty of
586 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
587 # GNU General Public License for more details.
589 # You should have received a copy of the GNU General Public License
590 # along with this program; if not, write to the Free Software
591 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
594 # One issue with vendor `install' (even GNU) is that you can't
595 # specify the program used to strip binaries. This is especially
596 # annoying in cross-compiling environments, where the build's strip
597 # is unlikely to handle the host's binaries.
598 # Fortunately install-sh will honor a STRIPPROG variable, so we
599 # always use install-sh in `make install-strip', and initialize
600 # STRIPPROG with the value of the STRIP variable (set by the user).
601 AC_DEFUN([AM_PROG_INSTALL_STRIP],
602 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
603 # Installed binaries are usually stripped using `strip' when the user
604 # run `make install-strip'. However `strip' might not be the right
605 # tool to use in cross-compilation environments, therefore Automake
606 # will honor the `STRIP' environment variable to overrule this program.
607 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
608 if test "$cross_compiling" != no; then
609 AC_CHECK_TOOL([STRIP], [strip], :)
611 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
612 AC_SUBST([INSTALL_STRIP_PROGRAM])])
614 # serial 4 -*- Autoconf -*-
616 # Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
618 # This program is free software; you can redistribute it and/or modify
619 # it under the terms of the GNU General Public License as published by
620 # the Free Software Foundation; either version 2, or (at your option)
623 # This program is distributed in the hope that it will be useful,
624 # but WITHOUT ANY WARRANTY; without even the implied warranty of
625 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
626 # GNU General Public License for more details.
628 # You should have received a copy of the GNU General Public License
629 # along with this program; if not, write to the Free Software
630 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
634 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
635 # written in clear, in which case automake, when reading aclocal.m4,
636 # will think it sees a *use*, and therefore will trigger all it's
637 # C support machinery. Also note that it means that autoscan, seeing
638 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
642 # _AM_DEPENDENCIES(NAME)
643 # ----------------------
644 # See how the compiler implements dependency checking.
645 # NAME is "CC", "CXX", "GCJ", or "OBJC".
646 # We try a few techniques and use that to set a single cache variable.
648 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
649 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
650 # dependency, and given that the user is not expected to run this macro,
651 # just rely on AC_PROG_CC.
652 AC_DEFUN([_AM_DEPENDENCIES],
653 [AC_REQUIRE([AM_SET_DEPDIR])dnl
654 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
655 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
656 AC_REQUIRE([AM_DEP_TRACK])dnl
658 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
659 [$1], CXX, [depcc="$CXX" am_compiler_list=],
660 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
661 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
662 [depcc="$$1" am_compiler_list=])
664 AC_CACHE_CHECK([dependency style of $depcc],
665 [am_cv_$1_dependencies_compiler_type],
666 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
667 # We make a subdir and do the tests there. Otherwise we can end up
668 # making bogus files that we don't know about and never remove. For
669 # instance it was reported that on HP-UX the gcc test will end up
670 # making a dummy file named `D' -- because `-MD' means `put the output
673 # Copy depcomp to subdir because otherwise we won't find it if we're
674 # using a relative directory.
675 cp "$am_depcomp" conftest.dir
678 am_cv_$1_dependencies_compiler_type=none
679 if test "$am_compiler_list" = ""; then
680 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
682 for depmode in $am_compiler_list; do
683 # We need to recreate these files for each test, as the compiler may
684 # overwrite some of them when testing with obscure command lines.
685 # This happens at least with the AIX C compiler.
686 echo '#include "conftest.h"' > conftest.c
687 echo 'int i;' > conftest.h
688 echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
692 # after this tag, mechanisms are not by side-effect, so they'll
693 # only be used when explicitly requested
694 if test "x$enable_dependency_tracking" = xyes; then
702 # We check with `-c' and `-o' for the sake of the "dashmstdout"
703 # mode. It turns out that the SunPro C++ compiler does not properly
704 # handle `-M -o', and we need to detect this.
705 if depmode=$depmode \
706 source=conftest.c object=conftest.o \
707 depfile=conftest.Po tmpdepfile=conftest.TPo \
708 $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
709 grep conftest.h conftest.Po > /dev/null 2>&1 &&
710 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
711 am_cv_$1_dependencies_compiler_type=$depmode
719 am_cv_$1_dependencies_compiler_type=none
722 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
723 AM_CONDITIONAL([am__fastdep$1], [
724 test "x$enable_dependency_tracking" != xno \
725 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
731 # Choose a directory name for dependency files.
732 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
733 AC_DEFUN([AM_SET_DEPDIR],
734 [rm -f .deps 2>/dev/null
735 mkdir .deps 2>/dev/null
736 if test -d .deps; then
739 # MS-DOS does not allow filenames that begin with a dot.
742 rmdir .deps 2>/dev/null
749 AC_DEFUN([AM_DEP_TRACK],
750 [AC_ARG_ENABLE(dependency-tracking,
751 [ --disable-dependency-tracking Speeds up one-time builds
752 --enable-dependency-tracking Do not reject slow dependency extractors])
753 if test "x$enable_dependency_tracking" != xno; then
754 am_depcomp="$ac_aux_dir/depcomp"
757 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
758 AC_SUBST([AMDEPBACKSLASH])
761 # Generate code to set up dependency tracking. -*- Autoconf -*-
763 # Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
765 # This program is free software; you can redistribute it and/or modify
766 # it under the terms of the GNU General Public License as published by
767 # the Free Software Foundation; either version 2, or (at your option)
770 # This program is distributed in the hope that it will be useful,
771 # but WITHOUT ANY WARRANTY; without even the implied warranty of
772 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
773 # GNU General Public License for more details.
775 # You should have received a copy of the GNU General Public License
776 # along with this program; if not, write to the Free Software
777 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
782 # _AM_OUTPUT_DEPENDENCY_COMMANDS
783 # ------------------------------
784 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
785 [for mf in $CONFIG_FILES; do
786 # Strip MF so we end up with the name of the file.
787 mf=`echo "$mf" | sed -e 's/:.*$//'`
788 # Check whether this is an Automake generated Makefile or not.
789 # We used to match only the files named `Makefile.in', but
790 # some people rename them; so instead we look at the file content.
791 # Grep'ing the first line is not enough: some people post-process
792 # each Makefile.in and add a new line on top of each file to say so.
793 # So let's grep whole file.
794 if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
795 dirpart=`AS_DIRNAME("$mf")`
799 grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
800 # Extract the definition of DEP_FILES from the Makefile without
802 DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
803 test -z "$DEPDIR" && continue
804 # When using ansi2knr, U may be empty or an underscore; expand it
805 U=`sed -n -e '/^U = / s///p' < "$mf"`
806 test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
807 # We invoke sed twice because it is the simplest approach to
808 # changing $(DEPDIR) to its actual value in the expansion.
809 for file in `sed -n -e '
810 /^DEP_FILES = .*\\\\$/ {
819 /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
820 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
821 # Make sure the directory exists.
822 test -f "$dirpart/$file" && continue
823 fdir=`AS_DIRNAME(["$file"])`
824 AS_MKDIR_P([$dirpart/$fdir])
825 # echo "creating $dirpart/$file"
826 echo '# dummy' > "$dirpart/$file"
829 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
832 # AM_OUTPUT_DEPENDENCY_COMMANDS
833 # -----------------------------
834 # This macro should only be invoked once -- use via AC_REQUIRE.
836 # This code is only required when automatic dependency tracking
837 # is enabled. FIXME. This creates each `.P' file that we will
838 # need in order to bootstrap the dependency handling code.
839 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
840 [AC_CONFIG_COMMANDS([depfiles],
841 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
842 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
845 # Check to see how 'make' treats includes. -*- Autoconf -*-
847 # Copyright (C) 2001, 2002 Free Software Foundation, Inc.
849 # This program is free software; you can redistribute it and/or modify
850 # it under the terms of the GNU General Public License as published by
851 # the Free Software Foundation; either version 2, or (at your option)
854 # This program is distributed in the hope that it will be useful,
855 # but WITHOUT ANY WARRANTY; without even the implied warranty of
856 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
857 # GNU General Public License for more details.
859 # You should have received a copy of the GNU General Public License
860 # along with this program; if not, write to the Free Software
861 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
868 # Check to see how make treats includes.
869 AC_DEFUN([AM_MAKE_INCLUDE],
870 [am_make=${MAKE-make}
871 cat > confinc << 'END'
875 # If we don't find an include directive, just comment out the code.
876 AC_MSG_CHECKING([for style of include used by $am_make])
880 # First try GNU make style include.
881 echo "include confinc" > confmf
882 # We grep out `Entering directory' and `Leaving directory'
883 # messages which can occur if `w' ends up in MAKEFLAGS.
884 # In particular we don't look at `^make:' because GNU make might
885 # be invoked under some other name (usually "gmake"), in which
886 # case it prints its new name instead of `make'.
887 if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
892 # Now try BSD make style include.
893 if test "$am__include" = "#"; then
894 echo '.include "confinc"' > confmf
895 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
901 AC_SUBST(am__include)
903 AC_MSG_RESULT($_am_result)
907 # AM_CONDITIONAL -*- Autoconf -*-
909 # Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
911 # This program is free software; you can redistribute it and/or modify
912 # it under the terms of the GNU General Public License as published by
913 # the Free Software Foundation; either version 2, or (at your option)
916 # This program is distributed in the hope that it will be useful,
917 # but WITHOUT ANY WARRANTY; without even the implied warranty of
918 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
919 # GNU General Public License for more details.
921 # You should have received a copy of the GNU General Public License
922 # along with this program; if not, write to the Free Software
923 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
930 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
931 # -------------------------------------
932 # Define a conditional.
933 AC_DEFUN([AM_CONDITIONAL],
934 [ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
935 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
945 AC_CONFIG_COMMANDS_PRE(
946 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
947 AC_MSG_ERROR([conditional "$1" was never defined.
948 Usually this means the macro was only invoked conditionally.])
951 # isc-posix.m4 serial 2 (gettext-0.11.2)
952 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
953 dnl This file is free software, distributed under the terms of the GNU
954 dnl General Public License. As a special exception to the GNU General
955 dnl Public License, this file may be distributed as part of a program
956 dnl that contains a configuration script generated by Autoconf, under
957 dnl the same distribution terms as the rest of that program.
959 # This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
961 # This test replaces the one in autoconf.
962 # Currently this macro should have the same name as the autoconf macro
963 # because gettext's gettext.m4 (distributed in the automake package)
964 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
965 # give these diagnostics:
966 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
967 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
969 undefine([AC_ISC_POSIX])
971 AC_DEFUN([AC_ISC_POSIX],
973 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
974 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
978 # gettext.m4 serial 17 (gettext-0.11.5)
979 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
980 dnl This file is free software, distributed under the terms of the GNU
981 dnl General Public License. As a special exception to the GNU General
982 dnl Public License, this file may be distributed as part of a program
983 dnl that contains a configuration script generated by Autoconf, under
984 dnl the same distribution terms as the rest of that program.
986 dnl This file can can be used in projects which are not available under
987 dnl the GNU General Public License or the GNU Library General Public
988 dnl License but which still want to provide support for the GNU gettext
990 dnl Please note that the actual code of the GNU gettext library is covered
991 dnl by the GNU Library General Public License, and the rest of the GNU
992 dnl gettext package package is covered by the GNU General Public License.
993 dnl They are *not* in the public domain.
996 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
997 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2002.
999 dnl Macro to add for using GNU gettext.
1001 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
1002 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
1003 dnl default (if it is not specified or empty) is 'no-libtool'.
1004 dnl INTLSYMBOL should be 'external' for packages with no intl directory,
1005 dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
1006 dnl If INTLSYMBOL is 'use-libtool', then a libtool library
1007 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
1008 dnl depending on --{enable,disable}-{shared,static} and on the presence of
1009 dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
1010 dnl $(top_builddir)/intl/libintl.a will be created.
1011 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
1012 dnl implementations (in libc or libintl) without the ngettext() function
1013 dnl will be ignored. If NEEDSYMBOL is specified and is
1014 dnl 'need-formatstring-macros', then GNU gettext implementations that don't
1015 dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
1016 dnl INTLDIR is used to find the intl libraries. If empty,
1017 dnl the value `$(top_builddir)/intl/' is used.
1019 dnl The result of the configuration is one of three cases:
1020 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
1022 dnl Catalog format: GNU --> install in $(datadir)
1023 dnl Catalog extension: .mo after installation, .gmo in source tree
1024 dnl 2) GNU gettext has been found in the system's C library.
1025 dnl Catalog format: GNU --> install in $(datadir)
1026 dnl Catalog extension: .mo after installation, .gmo in source tree
1027 dnl 3) No internationalization, always use English msgid.
1028 dnl Catalog format: none
1029 dnl Catalog extension: none
1030 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
1031 dnl The use of .gmo is historical (it was needed to avoid overwriting the
1032 dnl GNU format catalogs when building on a platform with an X/Open gettext),
1033 dnl but we keep it in order not to force irrelevant filename changes on the
1036 AC_DEFUN([AM_GNU_GETTEXT],
1038 dnl Argument checking.
1039 ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
1040 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
1042 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
1043 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
1045 define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
1046 define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
1048 AC_REQUIRE([AM_PO_SUBDIRS])dnl
1049 ifelse(gt_included_intl, yes, [
1050 AC_REQUIRE([AM_INTL_SUBDIR])dnl
1053 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
1054 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1055 AC_REQUIRE([AC_LIB_RPATH])
1057 dnl Sometimes libintl requires libiconv, so first search for libiconv.
1058 dnl Ideally we would do this search only after the
1059 dnl if test "$USE_NLS" = "yes"; then
1060 dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
1061 dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
1062 dnl the configure script would need to contain the same shell code
1063 dnl again, outside any 'if'. There are two solutions:
1064 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
1065 dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
1066 dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
1067 dnl documented, we avoid it.
1068 ifelse(gt_included_intl, yes, , [
1069 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
1072 AC_MSG_CHECKING([whether NLS is requested])
1073 dnl Default is enabled NLS
1075 [ --disable-nls do not use Native Language Support],
1076 USE_NLS=$enableval, USE_NLS=yes)
1077 AC_MSG_RESULT($USE_NLS)
1080 ifelse(gt_included_intl, yes, [
1081 BUILD_INCLUDED_LIBINTL=no
1082 USE_INCLUDED_LIBINTL=no
1088 dnl If we use NLS figure out what method
1089 if test "$USE_NLS" = "yes"; then
1090 gt_use_preinstalled_gnugettext=no
1091 ifelse(gt_included_intl, yes, [
1092 AC_MSG_CHECKING([whether included gettext is requested])
1093 AC_ARG_WITH(included-gettext,
1094 [ --with-included-gettext use the GNU gettext library included here],
1095 nls_cv_force_use_gnu_gettext=$withval,
1096 nls_cv_force_use_gnu_gettext=no)
1097 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
1099 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
1100 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
1102 dnl User does not insist on using GNU NLS library. Figure out what
1103 dnl to use. If GNU gettext is available we use this. Else we have
1104 dnl to fall back to GNU NLS library.
1106 dnl Add a version number to the cache macros.
1107 define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
1108 define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
1109 define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
1111 AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
1112 [AC_TRY_LINK([#include <libintl.h>
1113 ]ifelse([$2], [need-formatstring-macros],
1114 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1115 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
1118 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
1120 ], [])[extern int _nl_msg_cat_cntr;
1121 extern int *_nl_domain_bindings;],
1122 [bindtextdomain ("", "");
1123 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
1124 gt_cv_func_gnugettext_libc=yes,
1125 gt_cv_func_gnugettext_libc=no)])
1127 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
1128 dnl Sometimes libintl requires libiconv, so first search for libiconv.
1129 ifelse(gt_included_intl, yes, , [
1132 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
1133 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
1134 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
1135 dnl even if libiconv doesn't exist.
1136 AC_LIB_LINKFLAGS_BODY([intl])
1137 AC_CACHE_CHECK([for GNU gettext in libintl],
1138 gt_cv_func_gnugettext_libintl,
1139 [gt_save_CPPFLAGS="$CPPFLAGS"
1140 CPPFLAGS="$CPPFLAGS $INCINTL"
1141 gt_save_LIBS="$LIBS"
1142 LIBS="$LIBS $LIBINTL"
1143 dnl Now see whether libintl exists and does not depend on libiconv.
1144 AC_TRY_LINK([#include <libintl.h>
1145 ]ifelse([$2], [need-formatstring-macros],
1146 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1147 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
1150 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
1152 ], [])[extern int _nl_msg_cat_cntr;
1157 const char *_nl_expand_alias ();],
1158 [bindtextdomain ("", "");
1159 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
1160 gt_cv_func_gnugettext_libintl=yes,
1161 gt_cv_func_gnugettext_libintl=no)
1162 dnl Now see whether libintl exists and depends on libiconv.
1163 if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
1164 LIBS="$LIBS $LIBICONV"
1165 AC_TRY_LINK([#include <libintl.h>
1166 ]ifelse([$2], [need-formatstring-macros],
1167 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1168 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
1171 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
1173 ], [])[extern int _nl_msg_cat_cntr;
1178 const char *_nl_expand_alias ();],
1179 [bindtextdomain ("", "");
1180 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
1181 [LIBINTL="$LIBINTL $LIBICONV"
1182 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
1183 gt_cv_func_gnugettext_libintl=yes
1186 CPPFLAGS="$gt_save_CPPFLAGS"
1187 LIBS="$gt_save_LIBS"])
1190 dnl If an already present or preinstalled GNU gettext() is found,
1191 dnl use it. But if this macro is used in GNU gettext, and GNU
1192 dnl gettext is already preinstalled in libintl, we update this
1193 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
1194 if test "$gt_cv_func_gnugettext_libc" = "yes" \
1195 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
1196 && test "$PACKAGE" != gettext; }; then
1197 gt_use_preinstalled_gnugettext=yes
1199 dnl Reset the values set by searching for libintl.
1205 ifelse(gt_included_intl, yes, [
1206 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
1207 dnl GNU gettext is not found in the C library.
1208 dnl Fall back on included GNU gettext library.
1209 nls_cv_use_gnu_gettext=yes
1213 if test "$nls_cv_use_gnu_gettext" = "yes"; then
1214 dnl Mark actions used to generate GNU NLS library.
1215 INTLOBJS="\$(GETTOBJS)"
1216 BUILD_INCLUDED_LIBINTL=yes
1217 USE_INCLUDED_LIBINTL=yes
1218 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
1219 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
1220 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
1223 if test "$gt_use_preinstalled_gnugettext" = "yes" \
1224 || test "$nls_cv_use_gnu_gettext" = "yes"; then
1225 dnl Mark actions to use GNU gettext tools.
1230 if test "$gt_use_preinstalled_gnugettext" = "yes" \
1231 || test "$nls_cv_use_gnu_gettext" = "yes"; then
1232 AC_DEFINE(ENABLE_NLS, 1,
1233 [Define to 1 if translation of program messages to the user's native language
1240 if test "$USE_NLS" = "yes"; then
1242 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
1243 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
1244 AC_MSG_CHECKING([how to link with libintl])
1245 AC_MSG_RESULT([$LIBINTL])
1246 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
1249 dnl For backward compatibility. Some packages may be using this.
1250 AC_DEFINE(HAVE_GETTEXT, 1,
1251 [Define if the GNU gettext() function is already present or preinstalled.])
1252 AC_DEFINE(HAVE_DCGETTEXT, 1,
1253 [Define if the GNU dcgettext() function is already present or preinstalled.])
1256 dnl We need to process the po/ directory.
1260 ifelse(gt_included_intl, yes, [
1261 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
1262 dnl to 'yes' because some of the testsuite requires it.
1263 if test "$PACKAGE" = gettext; then
1264 BUILD_INCLUDED_LIBINTL=yes
1267 dnl Make all variables we use known to autoconf.
1268 AC_SUBST(BUILD_INCLUDED_LIBINTL)
1269 AC_SUBST(USE_INCLUDED_LIBINTL)
1273 dnl For backward compatibility. Some configure.ins may be using this.
1275 nls_cv_header_libgt=
1277 dnl For backward compatibility. Some Makefiles may be using this.
1279 AC_SUBST(DATADIRNAME)
1281 dnl For backward compatibility. Some Makefiles may be using this.
1283 AC_SUBST(INSTOBJEXT)
1285 dnl For backward compatibility. Some Makefiles may be using this.
1289 dnl Enable libtool support if the surrounding package wishes it.
1290 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
1291 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
1294 dnl For backward compatibility. Some Makefiles may be using this.
1298 dnl Make all documented variables known to autoconf.
1305 dnl Checks for all prerequisites of the po subdirectory,
1306 dnl except for USE_NLS.
1307 AC_DEFUN([AM_PO_SUBDIRS],
1309 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1310 AC_REQUIRE([AC_PROG_INSTALL])dnl
1311 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1313 dnl Perform the following tests also if --disable-nls has been given,
1314 dnl because they are needed for "make dist" to work.
1316 dnl Search for GNU msgfmt in the PATH.
1317 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
1318 dnl The second test excludes FreeBSD msgfmt.
1319 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1320 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
1321 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1323 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1325 dnl Search for GNU xgettext 0.11 or newer in the PATH.
1326 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
1327 dnl The second test excludes FreeBSD xgettext.
1328 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1329 [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
1330 (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1332 dnl Remove leftover from FreeBSD xgettext call.
1335 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
1336 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
1337 [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
1339 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1340 dnl Test whether we really found GNU msgfmt.
1341 if test "$GMSGFMT" != ":"; then
1342 dnl If it is no GNU msgfmt we define it as : so that the
1343 dnl Makefiles still can work.
1344 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
1345 (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1348 GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
1350 [found $GMSGFMT program is not GNU msgfmt; ignore it])
1355 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1356 dnl Test whether we really found GNU xgettext.
1357 if test "$XGETTEXT" != ":"; then
1358 dnl If it is no GNU xgettext we define it as : so that the
1359 dnl Makefiles still can work.
1360 if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
1361 (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1365 [found xgettext program is not GNU xgettext; ignore it])
1368 dnl Remove leftover from FreeBSD xgettext call.
1372 AC_OUTPUT_COMMANDS([
1373 for ac_file in $CONFIG_FILES; do
1374 # Support "outfile[:infile[:infile...]]"
1376 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1378 # PO directories have a Makefile.in generated from Makefile.in.in.
1379 case "$ac_file" in */Makefile.in)
1380 # Adjust a relative srcdir.
1381 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1382 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1383 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1384 # In autoconf-2.13 it is called $ac_given_srcdir.
1385 # In autoconf-2.50 it is called $srcdir.
1386 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1387 case "$ac_given_srcdir" in
1388 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1389 /*) top_srcdir="$ac_given_srcdir" ;;
1390 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
1392 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
1393 rm -f "$ac_dir/POTFILES"
1394 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
1395 cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
1396 # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
1397 # on $ac_dir but don't depend on user-specified configuration
1399 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
1400 # The LINGUAS file contains the set of available languages.
1401 if test -n "$ALL_LINGUAS"; then
1402 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
1404 ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
1405 # Hide the ALL_LINGUAS assigment from automake.
1406 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
1408 case "$ac_given_srcdir" in
1410 *) srcdirpre='$(srcdir)/' ;;
1416 for lang in $ALL_LINGUAS; do
1417 POFILES="$POFILES $srcdirpre$lang.po"
1418 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
1419 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
1420 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
1422 # CATALOGS depends on both $ac_dir and the user's LINGUAS
1423 # environment variable.
1425 if test -n "$ALL_LINGUAS"; then
1426 for presentlang in $ALL_LINGUAS; do
1428 if test "%UNSET%" != "$LINGUAS"; then
1429 desiredlanguages="$LINGUAS"
1431 desiredlanguages="$ALL_LINGUAS"
1433 for desiredlang in $desiredlanguages; do
1434 # Use the presentlang catalog if desiredlang is
1435 # a. equal to presentlang, or
1436 # b. a variant of presentlang (because in this case,
1437 # presentlang can be used as a fallback for messages
1438 # which are not translated in the desiredlang catalog).
1439 case "$desiredlang" in
1440 "$presentlang"*) useit=yes;;
1443 if test $useit = yes; then
1444 INST_LINGUAS="$INST_LINGUAS $presentlang"
1449 if test -n "$INST_LINGUAS"; then
1450 for lang in $INST_LINGUAS; do
1451 CATALOGS="$CATALOGS $lang.gmo"
1454 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
1455 sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
1456 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
1457 if test -f "$f"; then
1459 *.orig | *.bak | *~) ;;
1460 *) cat "$f" >> "$ac_dir/Makefile" ;;
1468 [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
1469 # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
1471 eval 'ALL_LINGUAS''="$ALL_LINGUAS"'
1472 # Capture the value of LINGUAS because we need it to compute CATALOGS.
1473 LINGUAS="${LINGUAS-%UNSET%}"
1478 dnl Checks for all prerequisites of the intl subdirectory,
1479 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
1480 dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
1481 AC_DEFUN([AM_INTL_SUBDIR],
1483 AC_REQUIRE([AC_PROG_INSTALL])dnl
1484 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1485 AC_REQUIRE([AC_PROG_CC])dnl
1486 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1487 AC_REQUIRE([AC_PROG_RANLIB])dnl
1488 AC_REQUIRE([AC_ISC_POSIX])dnl
1489 AC_REQUIRE([AC_HEADER_STDC])dnl
1490 AC_REQUIRE([AC_C_CONST])dnl
1491 AC_REQUIRE([AC_C_INLINE])dnl
1492 AC_REQUIRE([AC_TYPE_OFF_T])dnl
1493 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1494 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1495 AC_REQUIRE([AC_FUNC_MMAP])dnl
1496 AC_REQUIRE([jm_GLIBC21])dnl
1497 AC_REQUIRE([gt_INTDIV0])dnl
1498 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
1499 AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
1500 AC_REQUIRE([gt_INTTYPES_PRI])dnl
1502 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
1503 stdlib.h string.h unistd.h sys/param.h])
1504 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
1505 geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
1506 strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
1510 if test $ac_cv_header_locale_h = yes; then
1514 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
1515 dnl because plural.y uses bison specific features. It requires at least
1516 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
1518 dnl bison is only needed for the maintainer (who touches plural.y). But in
1519 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
1520 dnl the rule in general Makefile. Now, some people carelessly touch the
1521 dnl files or have a broken "make" program, hence the plural.c rule will
1522 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
1523 dnl present or too old.
1524 AC_CHECK_PROGS([INTLBISON], [bison])
1525 if test -z "$INTLBISON"; then
1528 dnl Found it, now check the version.
1529 AC_MSG_CHECKING([version of bison])
1530 changequote(<<,>>)dnl
1531 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
1532 case $ac_prog_version in
1533 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1534 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
1536 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
1537 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
1539 AC_MSG_RESULT([$ac_prog_version])
1541 if test $ac_verc_fail = yes; then
1547 AC_DEFUN([AM_MKINSTALLDIRS],
1549 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1550 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1551 dnl Try to locate is.
1553 if test -n "$ac_aux_dir"; then
1554 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1556 if test -z "$MKINSTALLDIRS"; then
1557 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1559 AC_SUBST(MKINSTALLDIRS)
1563 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
1564 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
1566 # lib-prefix.m4 serial 1 (gettext-0.11)
1567 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
1568 dnl This file is free software, distributed under the terms of the GNU
1569 dnl General Public License. As a special exception to the GNU General
1570 dnl Public License, this file may be distributed as part of a program
1571 dnl that contains a configuration script generated by Autoconf, under
1572 dnl the same distribution terms as the rest of that program.
1574 dnl From Bruno Haible.
1576 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1577 dnl to access previously installed libraries. The basic assumption is that
1578 dnl a user will want packages to use other packages he previously installed
1579 dnl with the same --prefix option.
1580 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1581 dnl libraries, but is otherwise very convenient.
1582 AC_DEFUN([AC_LIB_PREFIX],
1584 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1585 AC_REQUIRE([AC_PROG_CC])
1586 AC_REQUIRE([AC_CANONICAL_HOST])
1587 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1588 dnl By default, look in $includedir and $libdir.
1590 AC_LIB_WITH_FINAL_PREFIX([
1591 eval additional_includedir=\"$includedir\"
1592 eval additional_libdir=\"$libdir\"
1594 AC_ARG_WITH([lib-prefix],
1595 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1596 --without-lib-prefix don't search for libraries in includedir and libdir],
1598 if test "X$withval" = "Xno"; then
1601 if test "X$withval" = "X"; then
1602 AC_LIB_WITH_FINAL_PREFIX([
1603 eval additional_includedir=\"$includedir\"
1604 eval additional_libdir=\"$libdir\"
1607 additional_includedir="$withval/include"
1608 additional_libdir="$withval/lib"
1612 if test $use_additional = yes; then
1613 dnl Potentially add $additional_includedir to $CPPFLAGS.
1614 dnl But don't add it
1615 dnl 1. if it's the standard /usr/include,
1616 dnl 2. if it's already present in $CPPFLAGS,
1617 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
1618 dnl 4. if it doesn't exist as a directory.
1619 if test "X$additional_includedir" != "X/usr/include"; then
1621 for x in $CPPFLAGS; do
1622 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1623 if test "X$x" = "X-I$additional_includedir"; then
1628 if test -z "$haveit"; then
1629 if test "X$additional_includedir" = "X/usr/local/include"; then
1630 if test -n "$GCC"; then
1632 linux*) haveit=yes;;
1636 if test -z "$haveit"; then
1637 if test -d "$additional_includedir"; then
1638 dnl Really add $additional_includedir to $CPPFLAGS.
1639 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1644 dnl Potentially add $additional_libdir to $LDFLAGS.
1645 dnl But don't add it
1646 dnl 1. if it's the standard /usr/lib,
1647 dnl 2. if it's already present in $LDFLAGS,
1648 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
1649 dnl 4. if it doesn't exist as a directory.
1650 if test "X$additional_libdir" != "X/usr/lib"; then
1652 for x in $LDFLAGS; do
1653 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1654 if test "X$x" = "X-L$additional_libdir"; then
1659 if test -z "$haveit"; then
1660 if test "X$additional_libdir" = "X/usr/local/lib"; then
1661 if test -n "$GCC"; then
1663 linux*) haveit=yes;;
1667 if test -z "$haveit"; then
1668 if test -d "$additional_libdir"; then
1669 dnl Really add $additional_libdir to $LDFLAGS.
1670 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1678 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1679 dnl acl_final_exec_prefix, containing the values to which $prefix and
1680 dnl $exec_prefix will expand at the end of the configure script.
1681 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1683 dnl Unfortunately, prefix and exec_prefix get only finally determined
1684 dnl at the end of configure.
1685 if test "X$prefix" = "XNONE"; then
1686 acl_final_prefix="$ac_default_prefix"
1688 acl_final_prefix="$prefix"
1690 if test "X$exec_prefix" = "XNONE"; then
1691 acl_final_exec_prefix='${prefix}'
1693 acl_final_exec_prefix="$exec_prefix"
1695 acl_save_prefix="$prefix"
1696 prefix="$acl_final_prefix"
1697 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1698 prefix="$acl_save_prefix"
1701 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1702 dnl variables prefix and exec_prefix bound to the values they will have
1703 dnl at the end of the configure script.
1704 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1706 acl_save_prefix="$prefix"
1707 prefix="$acl_final_prefix"
1708 acl_save_exec_prefix="$exec_prefix"
1709 exec_prefix="$acl_final_exec_prefix"
1711 exec_prefix="$acl_save_exec_prefix"
1712 prefix="$acl_save_prefix"
1715 # lib-link.m4 serial 3 (gettext-0.11.3)
1716 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
1717 dnl This file is free software, distributed under the terms of the GNU
1718 dnl General Public License. As a special exception to the GNU General
1719 dnl Public License, this file may be distributed as part of a program
1720 dnl that contains a configuration script generated by Autoconf, under
1721 dnl the same distribution terms as the rest of that program.
1723 dnl From Bruno Haible.
1725 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
1726 dnl the libraries corresponding to explicit and implicit dependencies.
1727 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
1728 dnl augments the CPPFLAGS variable.
1729 AC_DEFUN([AC_LIB_LINKFLAGS],
1731 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1732 AC_REQUIRE([AC_LIB_RPATH])
1733 define([Name],[translit([$1],[./-], [___])])
1734 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1735 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1736 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
1737 AC_LIB_LINKFLAGS_BODY([$1], [$2])
1738 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
1739 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
1740 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
1742 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
1743 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
1744 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
1745 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1747 AC_SUBST([LTLIB]NAME)
1748 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
1749 dnl results of this search when this library appears as a dependency.
1755 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
1756 dnl searches for libname and the libraries corresponding to explicit and
1757 dnl implicit dependencies, together with the specified include files and
1758 dnl the ability to compile and link the specified testcode. If found, it
1759 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
1760 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
1761 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
1762 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
1763 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
1765 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1766 AC_REQUIRE([AC_LIB_RPATH])
1767 define([Name],[translit([$1],[./-], [___])])
1768 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1769 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1771 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
1773 AC_LIB_LINKFLAGS_BODY([$1], [$2])
1775 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
1776 dnl because if the user has installed lib[]Name and not disabled its use
1777 dnl via --without-lib[]Name-prefix, he wants to use it.
1778 ac_save_CPPFLAGS="$CPPFLAGS"
1779 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1781 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
1782 ac_save_LIBS="$LIBS"
1783 LIBS="$LIBS $LIB[]NAME"
1784 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
1785 LIBS="$ac_save_LIBS"
1787 if test "$ac_cv_lib[]Name" = yes; then
1789 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
1790 AC_MSG_CHECKING([how to link with lib[]$1])
1791 AC_MSG_RESULT([$LIB[]NAME])
1794 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
1795 dnl $INC[]NAME either.
1796 CPPFLAGS="$ac_save_CPPFLAGS"
1800 AC_SUBST([HAVE_LIB]NAME)
1802 AC_SUBST([LTLIB]NAME)
1807 dnl Determine the platform dependent parameters needed to use rpath:
1808 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
1809 dnl hardcode_direct, hardcode_minus_L,
1810 dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec.
1811 AC_DEFUN([AC_LIB_RPATH],
1813 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
1814 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
1815 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
1816 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
1817 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
1818 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
1819 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
1825 libext="$acl_cv_libext"
1826 shlibext="$acl_cv_shlibext"
1827 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
1828 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
1829 hardcode_direct="$acl_cv_hardcode_direct"
1830 hardcode_minus_L="$acl_cv_hardcode_minus_L"
1831 sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec"
1832 sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec"
1833 dnl Determine whether the user wants rpath handling at all.
1834 AC_ARG_ENABLE(rpath,
1835 [ --disable-rpath do not hardcode runtime library paths],
1836 :, enable_rpath=yes)
1839 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
1840 dnl the libraries corresponding to explicit and implicit dependencies.
1841 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
1842 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
1844 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1845 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1846 dnl By default, look in $includedir and $libdir.
1848 AC_LIB_WITH_FINAL_PREFIX([
1849 eval additional_includedir=\"$includedir\"
1850 eval additional_libdir=\"$libdir\"
1852 AC_ARG_WITH([lib$1-prefix],
1853 [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
1854 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
1856 if test "X$withval" = "Xno"; then
1859 if test "X$withval" = "X"; then
1860 AC_LIB_WITH_FINAL_PREFIX([
1861 eval additional_includedir=\"$includedir\"
1862 eval additional_libdir=\"$libdir\"
1865 additional_includedir="$withval/include"
1866 additional_libdir="$withval/lib"
1870 dnl Search the library and its dependencies in $additional_libdir and
1871 dnl $LDFLAGS. Using breadth-first-seach.
1877 names_already_handled=
1878 names_next_round='$1 $2'
1879 while test -n "$names_next_round"; do
1880 names_this_round="$names_next_round"
1882 for name in $names_this_round; do
1884 for n in $names_already_handled; do
1885 if test "$n" = "$name"; then
1890 if test -z "$already_handled"; then
1891 names_already_handled="$names_already_handled $name"
1892 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
1893 dnl or AC_LIB_HAVE_LINKFLAGS call.
1894 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
1895 eval value=\"\$HAVE_LIB$uppername\"
1896 if test -n "$value"; then
1897 if test "$value" = yes; then
1898 eval value=\"\$LIB$uppername\"
1899 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
1900 eval value=\"\$LTLIB$uppername\"
1901 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
1903 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
1904 dnl that this library doesn't exist. So just drop it.
1908 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
1909 dnl and the already constructed $LIBNAME/$LTLIBNAME.
1914 if test $use_additional = yes; then
1915 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
1916 found_dir="$additional_libdir"
1917 found_so="$additional_libdir/lib$name.$shlibext"
1918 if test -f "$additional_libdir/lib$name.la"; then
1919 found_la="$additional_libdir/lib$name.la"
1922 if test -f "$additional_libdir/lib$name.$libext"; then
1923 found_dir="$additional_libdir"
1924 found_a="$additional_libdir/lib$name.$libext"
1925 if test -f "$additional_libdir/lib$name.la"; then
1926 found_la="$additional_libdir/lib$name.la"
1931 if test "X$found_dir" = "X"; then
1932 for x in $LDFLAGS $LTLIB[]NAME; do
1933 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1936 dir=`echo "X$x" | sed -e 's/^X-L//'`
1937 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
1939 found_so="$dir/lib$name.$shlibext"
1940 if test -f "$dir/lib$name.la"; then
1941 found_la="$dir/lib$name.la"
1944 if test -f "$dir/lib$name.$libext"; then
1946 found_a="$dir/lib$name.$libext"
1947 if test -f "$dir/lib$name.la"; then
1948 found_la="$dir/lib$name.la"
1954 if test "X$found_dir" != "X"; then
1959 if test "X$found_dir" != "X"; then
1960 dnl Found the library.
1961 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
1962 if test "X$found_so" != "X"; then
1963 dnl Linking with a shared library. We attempt to hardcode its
1964 dnl directory into the executable's runpath, unless it's the
1965 dnl standard /usr/lib.
1966 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
1967 dnl No hardcoding is needed.
1968 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1970 dnl Use an explicit option to hardcode DIR into the resulting
1972 dnl Potentially add DIR to ltrpathdirs.
1973 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1975 for x in $ltrpathdirs; do
1976 if test "X$x" = "X$found_dir"; then
1981 if test -z "$haveit"; then
1982 ltrpathdirs="$ltrpathdirs $found_dir"
1984 dnl The hardcoding into $LIBNAME is system dependent.
1985 if test "$hardcode_direct" = yes; then
1986 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
1987 dnl resulting binary.
1988 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1990 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
1991 dnl Use an explicit option to hardcode DIR into the resulting
1993 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1994 dnl Potentially add DIR to rpathdirs.
1995 dnl The rpathdirs will be appended to $LIBNAME at the end.
1997 for x in $rpathdirs; do
1998 if test "X$x" = "X$found_dir"; then
2003 if test -z "$haveit"; then
2004 rpathdirs="$rpathdirs $found_dir"
2007 dnl Rely on "-L$found_dir".
2008 dnl But don't add it if it's already contained in the LDFLAGS
2009 dnl or the already constructed $LIBNAME
2011 for x in $LDFLAGS $LIB[]NAME; do
2012 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2013 if test "X$x" = "X-L$found_dir"; then
2018 if test -z "$haveit"; then
2019 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
2021 if test "$hardcode_minus_L" != no; then
2022 dnl FIXME: Not sure whether we should use
2023 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
2025 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2027 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
2028 dnl here, because this doesn't fit in flags passed to the
2029 dnl compiler. So give up. No hardcoding. This affects only
2030 dnl very old systems.
2031 dnl FIXME: Not sure whether we should use
2032 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
2034 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2040 if test "X$found_a" != "X"; then
2041 dnl Linking with a static library.
2042 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
2044 dnl We shouldn't come here, but anyway it's good to have a
2046 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
2049 dnl Assume the include files are nearby.
2050 additional_includedir=
2051 case "$found_dir" in
2053 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
2054 additional_includedir="$basedir/include"
2057 if test "X$additional_includedir" != "X"; then
2058 dnl Potentially add $additional_includedir to $INCNAME.
2059 dnl But don't add it
2060 dnl 1. if it's the standard /usr/include,
2061 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
2062 dnl 3. if it's already present in $CPPFLAGS or the already
2063 dnl constructed $INCNAME,
2064 dnl 4. if it doesn't exist as a directory.
2065 if test "X$additional_includedir" != "X/usr/include"; then
2067 if test "X$additional_includedir" = "X/usr/local/include"; then
2068 if test -n "$GCC"; then
2070 linux*) haveit=yes;;
2074 if test -z "$haveit"; then
2075 for x in $CPPFLAGS $INC[]NAME; do
2076 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2077 if test "X$x" = "X-I$additional_includedir"; then
2082 if test -z "$haveit"; then
2083 if test -d "$additional_includedir"; then
2084 dnl Really add $additional_includedir to $INCNAME.
2085 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
2091 dnl Look for dependencies.
2092 if test -n "$found_la"; then
2093 dnl Read the .la file. It defines the variables
2094 dnl dlname, library_names, old_library, dependency_libs, current,
2095 dnl age, revision, installed, dlopen, dlpreopen, libdir.
2096 save_libdir="$libdir"
2098 */* | *\\*) . "$found_la" ;;
2099 *) . "./$found_la" ;;
2101 libdir="$save_libdir"
2102 dnl We use only dependency_libs.
2103 for dep in $dependency_libs; do
2106 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
2107 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
2108 dnl But don't add it
2109 dnl 1. if it's the standard /usr/lib,
2110 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
2111 dnl 3. if it's already present in $LDFLAGS or the already
2112 dnl constructed $LIBNAME,
2113 dnl 4. if it doesn't exist as a directory.
2114 if test "X$additional_libdir" != "X/usr/lib"; then
2116 if test "X$additional_libdir" = "X/usr/local/lib"; then
2117 if test -n "$GCC"; then
2119 linux*) haveit=yes;;
2123 if test -z "$haveit"; then
2125 for x in $LDFLAGS $LIB[]NAME; do
2126 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2127 if test "X$x" = "X-L$additional_libdir"; then
2132 if test -z "$haveit"; then
2133 if test -d "$additional_libdir"; then
2134 dnl Really add $additional_libdir to $LIBNAME.
2135 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
2139 for x in $LDFLAGS $LTLIB[]NAME; do
2140 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2141 if test "X$x" = "X-L$additional_libdir"; then
2146 if test -z "$haveit"; then
2147 if test -d "$additional_libdir"; then
2148 dnl Really add $additional_libdir to $LTLIBNAME.
2149 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
2156 dir=`echo "X$dep" | sed -e 's/^X-R//'`
2157 if test "$enable_rpath" != no; then
2158 dnl Potentially add DIR to rpathdirs.
2159 dnl The rpathdirs will be appended to $LIBNAME at the end.
2161 for x in $rpathdirs; do
2162 if test "X$x" = "X$dir"; then
2167 if test -z "$haveit"; then
2168 rpathdirs="$rpathdirs $dir"
2170 dnl Potentially add DIR to ltrpathdirs.
2171 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
2173 for x in $ltrpathdirs; do
2174 if test "X$x" = "X$dir"; then
2179 if test -z "$haveit"; then
2180 ltrpathdirs="$ltrpathdirs $dir"
2185 dnl Handle this in the next round.
2186 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
2189 dnl Handle this in the next round. Throw away the .la's
2190 dnl directory; it is already contained in a preceding -L
2192 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
2195 dnl Most likely an immediate library name.
2196 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
2197 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
2203 dnl Didn't find the library; assume it is in the system directories
2204 dnl known to the linker and runtime loader. (All the system
2205 dnl directories known to the linker should also be known to the
2206 dnl runtime loader, otherwise the system is severely misconfigured.)
2207 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2208 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
2214 if test "X$rpathdirs" != "X"; then
2215 if test -n "$hardcode_libdir_separator"; then
2216 dnl Weird platform: only the last -rpath option counts, the user must
2217 dnl pass all path elements in one option. We can arrange that for a
2218 dnl single library, but not when more than one $LIBNAMEs are used.
2220 for found_dir in $rpathdirs; do
2221 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
2223 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
2224 acl_save_libdir="$libdir"
2226 eval flag=\"$hardcode_libdir_flag_spec\"
2227 libdir="$acl_save_libdir"
2228 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2230 dnl The -rpath options are cumulative.
2231 for found_dir in $rpathdirs; do
2232 acl_save_libdir="$libdir"
2234 eval flag=\"$hardcode_libdir_flag_spec\"
2235 libdir="$acl_save_libdir"
2236 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2240 if test "X$ltrpathdirs" != "X"; then
2241 dnl When using libtool, the option that works for both libraries and
2242 dnl executables is -R. The -R options are cumulative.
2243 for found_dir in $ltrpathdirs; do
2244 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
2249 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
2250 dnl unless already present in VAR.
2251 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
2252 dnl contains two or three consecutive elements that belong together.
2253 AC_DEFUN([AC_LIB_APPENDTOVAR],
2255 for element in [$2]; do
2258 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2259 if test "X$x" = "X$element"; then
2264 if test -z "$haveit"; then
2265 [$1]="${[$1]}${[$1]:+ }$element"
2270 # lib-ld.m4 serial 1 (gettext-0.11)
2271 dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
2272 dnl This file is free software, distributed under the terms of the GNU
2273 dnl General Public License. As a special exception to the GNU General
2274 dnl Public License, this file may be distributed as part of a program
2275 dnl that contains a configuration script generated by Autoconf, under
2276 dnl the same distribution terms as the rest of that program.
2278 dnl Subroutines of libtool.m4,
2279 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
2280 dnl with libtool.m4.
2282 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
2283 AC_DEFUN([AC_LIB_PROG_LD_GNU],
2284 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
2285 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
2286 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2287 acl_cv_prog_gnu_ld=yes
2289 acl_cv_prog_gnu_ld=no
2291 with_gnu_ld=$acl_cv_prog_gnu_ld
2294 dnl From libtool-1.4. Sets the variable LD.
2295 AC_DEFUN([AC_LIB_PROG_LD],
2296 [AC_ARG_WITH(gnu-ld,
2297 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
2298 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
2299 AC_REQUIRE([AC_PROG_CC])dnl
2300 AC_REQUIRE([AC_CANONICAL_HOST])dnl
2302 if test "$GCC" = yes; then
2303 # Check if gcc -print-prog-name=ld gives a path.
2304 AC_MSG_CHECKING([for ld used by GCC])
2307 # gcc leaves a trailing carriage return which upsets mingw
2308 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
2310 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
2313 # Accept absolute paths.
2314 [[\\/]* | [A-Za-z]:[\\/]*)]
2315 [re_direlt='/[^/][^/]*/\.\./']
2316 # Canonicalize the path of ld
2317 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
2318 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2319 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
2321 test -z "$LD" && LD="$ac_prog"
2324 # If it fails, then pretend we aren't using GCC.
2328 # If it is relative, then search for the first ld in PATH.
2332 elif test "$with_gnu_ld" = yes; then
2333 AC_MSG_CHECKING([for GNU ld])
2335 AC_MSG_CHECKING([for non-GNU ld])
2337 AC_CACHE_VAL(acl_cv_path_LD,
2338 [if test -z "$LD"; then
2339 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2340 for ac_dir in $PATH; do
2341 test -z "$ac_dir" && ac_dir=.
2342 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2343 acl_cv_path_LD="$ac_dir/$ac_prog"
2344 # Check to see if the program is GNU ld. I'd rather use --version,
2345 # but apparently some GNU ld's only accept -v.
2346 # Break only if it was the GNU/non-GNU ld that we prefer.
2347 if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2348 test "$with_gnu_ld" != no && break
2350 test "$with_gnu_ld" != yes && break
2356 acl_cv_path_LD="$LD" # Let the user override the test with a path.
2358 LD="$acl_cv_path_LD"
2359 if test -n "$LD"; then
2364 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
2368 # iconv.m4 serial AM4 (gettext-0.11.3)
2369 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2370 dnl This file is free software, distributed under the terms of the GNU
2371 dnl General Public License. As a special exception to the GNU General
2372 dnl Public License, this file may be distributed as part of a program
2373 dnl that contains a configuration script generated by Autoconf, under
2374 dnl the same distribution terms as the rest of that program.
2376 dnl From Bruno Haible.
2378 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
2380 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
2381 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2382 AC_REQUIRE([AC_LIB_RPATH])
2384 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
2386 AC_LIB_LINKFLAGS_BODY([iconv])
2389 AC_DEFUN([AM_ICONV_LINK],
2391 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
2392 dnl those with the standalone portable GNU libiconv installed).
2394 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
2396 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
2398 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
2399 dnl because if the user has installed libiconv and not disabled its use
2400 dnl via --without-libiconv-prefix, he wants to use it. The first
2401 dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
2402 am_save_CPPFLAGS="$CPPFLAGS"
2403 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
2405 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
2406 am_cv_func_iconv="no, consider installing GNU libiconv"
2408 AC_TRY_LINK([#include <stdlib.h>
2409 #include <iconv.h>],
2410 [iconv_t cd = iconv_open("","");
2411 iconv(cd,NULL,NULL,NULL,NULL);
2413 am_cv_func_iconv=yes)
2414 if test "$am_cv_func_iconv" != yes; then
2415 am_save_LIBS="$LIBS"
2416 LIBS="$LIBS $LIBICONV"
2417 AC_TRY_LINK([#include <stdlib.h>
2418 #include <iconv.h>],
2419 [iconv_t cd = iconv_open("","");
2420 iconv(cd,NULL,NULL,NULL,NULL);
2423 am_cv_func_iconv=yes)
2424 LIBS="$am_save_LIBS"
2427 if test "$am_cv_func_iconv" = yes; then
2428 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
2430 if test "$am_cv_lib_iconv" = yes; then
2431 AC_MSG_CHECKING([how to link with libiconv])
2432 AC_MSG_RESULT([$LIBICONV])
2434 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
2436 CPPFLAGS="$am_save_CPPFLAGS"
2441 AC_SUBST(LTLIBICONV)
2444 AC_DEFUN([AM_ICONV],
2447 if test "$am_cv_func_iconv" = yes; then
2448 AC_MSG_CHECKING([for iconv declaration])
2449 AC_CACHE_VAL(am_cv_proto_iconv, [
2457 #if defined(__STDC__) || defined(__cplusplus)
2458 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
2462 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
2463 am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
2464 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
2465 AC_MSG_RESULT([$]{ac_t:-
2466 }[$]am_cv_proto_iconv)
2467 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
2468 [Define as const if the declaration of iconv() needs const.])
2472 # progtest.m4 serial 2 (gettext-0.10.40)
2473 dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
2474 dnl This file is free software, distributed under the terms of the GNU
2475 dnl General Public License. As a special exception to the GNU General
2476 dnl Public License, this file may be distributed as part of a program
2477 dnl that contains a configuration script generated by Autoconf, under
2478 dnl the same distribution terms as the rest of that program.
2480 dnl This file can can be used in projects which are not available under
2481 dnl the GNU General Public License or the GNU Library General Public
2482 dnl License but which still want to provide support for the GNU gettext
2484 dnl Please note that the actual code of the GNU gettext library is covered
2485 dnl by the GNU Library General Public License, and the rest of the GNU
2486 dnl gettext package package is covered by the GNU General Public License.
2487 dnl They are *not* in the public domain.
2490 dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
2492 # Search path for a program which passes the given test.
2494 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
2495 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2496 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
2497 [# Extract the first word of "$2", so it can be a program name with args.
2498 set dummy $2; ac_word=[$]2
2499 AC_MSG_CHECKING([for $ac_word])
2500 AC_CACHE_VAL(ac_cv_path_$1,
2503 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2506 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2507 for ac_dir in ifelse([$5], , $PATH, [$5]); do
2508 test -z "$ac_dir" && ac_dir=.
2509 if test -f $ac_dir/$ac_word; then
2511 ac_cv_path_$1="$ac_dir/$ac_word"
2517 dnl If no 4th arg is given, leave the cache variable unset,
2518 dnl so AC_PATH_PROGS will keep looking.
2519 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2524 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
2525 AC_MSG_RESULT([$]$1)
2532 # glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
2533 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2534 dnl This file is free software, distributed under the terms of the GNU
2535 dnl General Public License. As a special exception to the GNU General
2536 dnl Public License, this file may be distributed as part of a program
2537 dnl that contains a configuration script generated by Autoconf, under
2538 dnl the same distribution terms as the rest of that program.
2540 # Test for the GNU C Library, version 2.1 or newer.
2541 # From Bruno Haible.
2543 AC_DEFUN([jm_GLIBC21],
2545 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
2546 ac_cv_gnu_library_2_1,
2547 [AC_EGREP_CPP([Lucky GNU user],
2549 #include <features.h>
2550 #ifdef __GNU_LIBRARY__
2551 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
2556 ac_cv_gnu_library_2_1=yes,
2557 ac_cv_gnu_library_2_1=no)
2561 GLIBC21="$ac_cv_gnu_library_2_1"
2565 # intdiv0.m4 serial 1 (gettext-0.11.3)
2566 dnl Copyright (C) 2002 Free Software Foundation, Inc.
2567 dnl This file is free software, distributed under the terms of the GNU
2568 dnl General Public License. As a special exception to the GNU General
2569 dnl Public License, this file may be distributed as part of a program
2570 dnl that contains a configuration script generated by Autoconf, under
2571 dnl the same distribution terms as the rest of that program.
2573 dnl From Bruno Haible.
2575 AC_DEFUN([gt_INTDIV0],
2577 AC_REQUIRE([AC_PROG_CC])dnl
2578 AC_REQUIRE([AC_CANONICAL_HOST])dnl
2580 AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
2581 gt_cv_int_divbyzero_sigfpe,
2589 sigfpe_handler (int sig)
2591 sigfpe_handler (sig) int sig;
2594 /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
2595 exit (sig != SIGFPE);
2605 signal (SIGFPE, sigfpe_handler);
2606 /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
2607 #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
2608 signal (SIGTRAP, sigfpe_handler);
2610 /* Linux/SPARC yields signal SIGILL. */
2611 #if defined (__sparc__) && defined (__linux__)
2612 signal (SIGILL, sigfpe_handler);
2619 ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
2621 # Guess based on the CPU.
2623 alpha* | i[34567]86 | m68k | s390*)
2624 gt_cv_int_divbyzero_sigfpe="guessing yes";;
2626 gt_cv_int_divbyzero_sigfpe="guessing no";;
2630 case "$gt_cv_int_divbyzero_sigfpe" in
2634 AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
2635 [Define if integer division by zero raises signal SIGFPE.])
2638 # uintmax_t.m4 serial 6 (gettext-0.11)
2639 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2640 dnl This file is free software, distributed under the terms of the GNU
2641 dnl General Public License. As a special exception to the GNU General
2642 dnl Public License, this file may be distributed as part of a program
2643 dnl that contains a configuration script generated by Autoconf, under
2644 dnl the same distribution terms as the rest of that program.
2646 dnl From Paul Eggert.
2650 # Define uintmax_t to `unsigned long' or `unsigned long long'
2651 # if <inttypes.h> does not exist.
2653 AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
2655 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
2656 AC_REQUIRE([jm_AC_HEADER_STDINT_H])
2657 if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
2658 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
2659 test $ac_cv_type_unsigned_long_long = yes \
2660 && ac_type='unsigned long long' \
2661 || ac_type='unsigned long'
2662 AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
2663 [Define to unsigned long or unsigned long long
2664 if <inttypes.h> and <stdint.h> don't define.])
2668 # inttypes_h.m4 serial 4 (gettext-0.11.4)
2669 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2670 dnl This file is free software, distributed under the terms of the GNU
2671 dnl General Public License. As a special exception to the GNU General
2672 dnl Public License, this file may be distributed as part of a program
2673 dnl that contains a configuration script generated by Autoconf, under
2674 dnl the same distribution terms as the rest of that program.
2676 dnl From Paul Eggert.
2678 # Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
2679 # doesn't clash with <sys/types.h>, and declares uintmax_t.
2681 AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
2683 AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
2685 [#include <sys/types.h>
2686 #include <inttypes.h>],
2687 [uintmax_t i = (uintmax_t) -1;],
2688 jm_ac_cv_header_inttypes_h=yes,
2689 jm_ac_cv_header_inttypes_h=no)])
2690 if test $jm_ac_cv_header_inttypes_h = yes; then
2691 AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
2692 [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
2693 and declares uintmax_t. ])
2697 # stdint_h.m4 serial 2 (gettext-0.11.4)
2698 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2699 dnl This file is free software, distributed under the terms of the GNU
2700 dnl General Public License. As a special exception to the GNU General
2701 dnl Public License, this file may be distributed as part of a program
2702 dnl that contains a configuration script generated by Autoconf, under
2703 dnl the same distribution terms as the rest of that program.
2705 dnl From Paul Eggert.
2707 # Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
2708 # doesn't clash with <sys/types.h>, and declares uintmax_t.
2710 AC_DEFUN([jm_AC_HEADER_STDINT_H],
2712 AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
2714 [#include <sys/types.h>
2715 #include <stdint.h>],
2716 [uintmax_t i = (uintmax_t) -1;],
2717 jm_ac_cv_header_stdint_h=yes,
2718 jm_ac_cv_header_stdint_h=no)])
2719 if test $jm_ac_cv_header_stdint_h = yes; then
2720 AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
2721 [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
2722 and declares uintmax_t. ])
2726 # ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40)
2727 dnl Copyright (C) 1999-2002 Free Software Foundation, Inc.
2728 dnl This file is free software, distributed under the terms of the GNU
2729 dnl General Public License. As a special exception to the GNU General
2730 dnl Public License, this file may be distributed as part of a program
2731 dnl that contains a configuration script generated by Autoconf, under
2732 dnl the same distribution terms as the rest of that program.
2734 dnl From Paul Eggert.
2736 AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
2738 AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
2739 [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
2740 [unsigned long long ullmax = (unsigned long long) -1;
2741 return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
2742 ac_cv_type_unsigned_long_long=yes,
2743 ac_cv_type_unsigned_long_long=no)])
2744 if test $ac_cv_type_unsigned_long_long = yes; then
2745 AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
2746 [Define if you have the unsigned long long type.])
2750 # inttypes.m4 serial 1 (gettext-0.11.4)
2751 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2752 dnl This file is free software, distributed under the terms of the GNU
2753 dnl General Public License. As a special exception to the GNU General
2754 dnl Public License, this file may be distributed as part of a program
2755 dnl that contains a configuration script generated by Autoconf, under
2756 dnl the same distribution terms as the rest of that program.
2758 dnl From Paul Eggert.
2760 # Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
2763 AC_DEFUN([gt_HEADER_INTTYPES_H],
2765 AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
2768 [#include <sys/types.h>
2769 #include <inttypes.h>],
2770 [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
2772 if test $gt_cv_header_inttypes_h = yes; then
2773 AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
2774 [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
2778 # inttypes-pri.m4 serial 1 (gettext-0.11.4)
2779 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2780 dnl This file is free software, distributed under the terms of the GNU
2781 dnl General Public License. As a special exception to the GNU General
2782 dnl Public License, this file may be distributed as part of a program
2783 dnl that contains a configuration script generated by Autoconf, under
2784 dnl the same distribution terms as the rest of that program.
2786 dnl From Bruno Haible.
2788 # Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
2789 # macros to non-string values. This is the case on AIX 4.3.3.
2791 AC_DEFUN([gt_INTTYPES_PRI],
2793 AC_REQUIRE([gt_HEADER_INTTYPES_H])
2794 if test $gt_cv_header_inttypes_h = yes; then
2795 AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
2796 gt_cv_inttypes_pri_broken,
2798 AC_TRY_COMPILE([#include <inttypes.h>
2802 ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
2805 if test "$gt_cv_inttypes_pri_broken" = yes; then
2806 AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
2807 [Define if <inttypes.h> exists and defines unusable PRI* macros.])
2811 # codeset.m4 serial AM1 (gettext-0.10.40)
2812 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2813 dnl This file is free software, distributed under the terms of the GNU
2814 dnl General Public License. As a special exception to the GNU General
2815 dnl Public License, this file may be distributed as part of a program
2816 dnl that contains a configuration script generated by Autoconf, under
2817 dnl the same distribution terms as the rest of that program.
2819 dnl From Bruno Haible.
2821 AC_DEFUN([AM_LANGINFO_CODESET],
2823 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
2824 [AC_TRY_LINK([#include <langinfo.h>],
2825 [char* cs = nl_langinfo(CODESET);],
2826 am_cv_langinfo_codeset=yes,
2827 am_cv_langinfo_codeset=no)
2829 if test $am_cv_langinfo_codeset = yes; then
2830 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
2831 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
2835 # lcmessage.m4 serial 3 (gettext-0.11.3)
2836 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
2837 dnl This file is free software, distributed under the terms of the GNU
2838 dnl General Public License. As a special exception to the GNU General
2839 dnl Public License, this file may be distributed as part of a program
2840 dnl that contains a configuration script generated by Autoconf, under
2841 dnl the same distribution terms as the rest of that program.
2843 dnl This file can can be used in projects which are not available under
2844 dnl the GNU General Public License or the GNU Library General Public
2845 dnl License but which still want to provide support for the GNU gettext
2847 dnl Please note that the actual code of the GNU gettext library is covered
2848 dnl by the GNU Library General Public License, and the rest of the GNU
2849 dnl gettext package package is covered by the GNU General Public License.
2850 dnl They are *not* in the public domain.
2853 dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
2855 # Check whether LC_MESSAGES is available in <locale.h>.
2857 AC_DEFUN([AM_LC_MESSAGES],
2859 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
2860 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
2861 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
2862 if test $am_cv_val_LC_MESSAGES = yes; then
2863 AC_DEFINE(HAVE_LC_MESSAGES, 1,
2864 [Define if your <locale.h> file defines LC_MESSAGES.])
2872 # Like AC_PROG_CC_C_O, but changed for automake.
2874 # Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
2876 # This program is free software; you can redistribute it and/or modify
2877 # it under the terms of the GNU General Public License as published by
2878 # the Free Software Foundation; either version 2, or (at your option)
2879 # any later version.
2881 # This program is distributed in the hope that it will be useful,
2882 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2883 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2884 # GNU General Public License for more details.
2886 # You should have received a copy of the GNU General Public License
2887 # along with this program; if not, write to the Free Software
2888 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2891 AC_DEFUN([AM_PROG_CC_C_O],
2892 [AC_REQUIRE([AC_PROG_CC_C_O])dnl
2893 AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2894 # FIXME: we rely on the cache variable name because
2895 # there is no other way.
2897 ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
2898 if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
2899 # Losing compiler, so override with the script.
2900 # FIXME: It is wrong to rewrite CC.
2901 # But if we don't then we get into trouble of one sort or another.
2902 # A longer-term fix would be to have automake use am__CC in this case,
2903 # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
2904 CC="$am_aux_dir/compile $CC"
2909 # Copyright 1996, 1997, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
2911 # This program is free software; you can redistribute it and/or modify
2912 # it under the terms of the GNU General Public License as published by
2913 # the Free Software Foundation; either version 2, or (at your option)
2914 # any later version.
2916 # This program is distributed in the hope that it will be useful,
2917 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2918 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2919 # GNU General Public License for more details.
2921 # You should have received a copy of the GNU General Public License
2922 # along with this program; if not, write to the Free Software
2923 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2928 # @defmac AC_PROG_CC_STDC
2929 # @maindex PROG_CC_STDC
2931 # If the C compiler in not in ANSI C mode by default, try to add an option
2932 # to output variable @code{CC} to make it so. This macro tries various
2933 # options that select ANSI C on some system or another. It considers the
2934 # compiler to be in ANSI C mode if it handles function prototypes correctly.
2936 # If you use this macro, you should check after calling it whether the C
2937 # compiler has been set to accept ANSI C; if not, the shell variable
2938 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
2939 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
2940 # program @code{ansi2knr}, which comes with Ghostscript.
2943 AC_DEFUN([AM_PROG_CC_STDC],
2944 [AC_REQUIRE([AC_PROG_CC])
2945 AC_BEFORE([$0], [AC_C_INLINE])
2946 AC_BEFORE([$0], [AC_C_CONST])
2947 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
2948 dnl a magic option to avoid problems with ANSI preprocessor commands
2950 dnl FIXME: can't do this because then AC_AIX won't work due to a
2951 dnl circular dependency.
2952 dnl AC_BEFORE([$0], [AC_PROG_CPP])
2953 AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
2954 AC_CACHE_VAL(am_cv_prog_cc_stdc,
2955 [am_cv_prog_cc_stdc=no
2957 # Don't try gcc -ansi; that turns off useful extensions and
2958 # breaks some systems' header files.
2959 # AIX -qlanglvl=ansi
2960 # Ultrix and OSF/1 -std1
2961 # HP-UX 10.20 and later -Ae
2962 # HP-UX older versions -Aa -D_HPUX_SOURCE
2963 # SVR4 -Xc -D__EXTENSIONS__
2964 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2966 CC="$ac_save_CC $ac_arg"
2968 [#include <stdarg.h>
2970 #include <sys/types.h>
2971 #include <sys/stat.h>
2972 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
2973 struct buf { int x; };
2974 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2975 static char *e (p, i)
2981 static char *f (char * (*g) (char **, int), char **p, ...)
2986 s = g (p, va_arg (v,int));
2990 int test (int i, double x);
2991 struct s1 {int (*f) (int a);};
2992 struct s2 {int (*f) (double a);};
2993 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2997 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
2999 [am_cv_prog_cc_stdc="$ac_arg"; break])
3003 if test -z "$am_cv_prog_cc_stdc"; then
3004 AC_MSG_RESULT([none needed])
3006 AC_MSG_RESULT([$am_cv_prog_cc_stdc])
3008 case "x$am_cv_prog_cc_stdc" in
3010 *) CC="$CC $am_cv_prog_cc_stdc" ;;
3014 AU_DEFUN([fp_PROG_CC_STDC], [AM_PROG_CC_STDC])
3017 # Copyright 1996, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
3019 # This program is free software; you can redistribute it and/or modify
3020 # it under the terms of the GNU General Public License as published by
3021 # the Free Software Foundation; either version 2, or (at your option)
3022 # any later version.
3024 # This program is distributed in the hope that it will be useful,
3025 # but WITHOUT ANY WARRANTY; without even the implied warranty of
3026 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3027 # GNU General Public License for more details.
3029 # You should have received a copy of the GNU General Public License
3030 # along with this program; if not, write to the Free Software
3031 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
3036 AC_DEFUN([AM_WITH_DMALLOC],
3037 [AC_MSG_CHECKING([if malloc debugging is wanted])
3038 AC_ARG_WITH(dmalloc,
3039 [ --with-dmalloc use dmalloc, as in
3040 http://www.dmalloc.com/dmalloc.tar.gz],
3041 [if test "$withval" = yes; then
3043 AC_DEFINE(WITH_DMALLOC,1,
3044 [Define if using the dmalloc debugging malloc package])
3045 LIBS="$LIBS -ldmalloc"
3046 LDFLAGS="$LDFLAGS -g"
3049 fi], [AC_MSG_RESULT(no)])
3052 AU_DEFUN([fp_WITH_DMALLOC], [AM_WITH_DMALLOC])