gliv-1.7
[gliv.git] / aclocal.m4
blob5ab95edccdb541e05fedb713cca9b45cdfdc404e
1 # generated automatically by aclocal 1.7.3 -*- 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
12 # PARTICULAR PURPOSE.
14 # Do all the work for Automake.                            -*- Autoconf -*-
16 # This macro actually does too much some checks are only needed if
17 # your package does certain things.  But this isn't really a big deal.
19 # Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
20 # Free Software Foundation, Inc.
22 # This program is free software; you can redistribute it and/or modify
23 # it under the terms of the GNU General Public License as published by
24 # the Free Software Foundation; either version 2, or (at your option)
25 # any later version.
27 # This program is distributed in the hope that it will be useful,
28 # but WITHOUT ANY WARRANTY; without even the implied warranty of
29 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
30 # GNU General Public License for more details.
32 # You should have received a copy of the GNU General Public License
33 # along with this program; if not, write to the Free Software
34 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
35 # 02111-1307, USA.
37 # serial 9
39 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
40 # written in clear, in which case automake, when reading aclocal.m4,
41 # will think it sees a *use*, and therefore will trigger all it's
42 # C support machinery.  Also note that it means that autoscan, seeing
43 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
46 AC_PREREQ([2.54])
48 # Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
49 # the ones we care about.
50 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
52 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
53 # AM_INIT_AUTOMAKE([OPTIONS])
54 # -----------------------------------------------
55 # The call with PACKAGE and VERSION arguments is the old style
56 # call (pre autoconf-2.50), which is being phased out.  PACKAGE
57 # and VERSION should now be passed to AC_INIT and removed from
58 # the call to AM_INIT_AUTOMAKE.
59 # We support both call styles for the transition.  After
60 # the next Automake release, Autoconf can make the AC_INIT
61 # arguments mandatory, and then we can depend on a new Autoconf
62 # release and drop the old call support.
63 AC_DEFUN([AM_INIT_AUTOMAKE],
64 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
65  AC_REQUIRE([AC_PROG_INSTALL])dnl
66 # test to see if srcdir already configured
67 if test "`cd $srcdir && pwd`" != "`pwd`" &&
68    test -f $srcdir/config.status; then
69   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
72 # test whether we have cygpath
73 if test -z "$CYGPATH_W"; then
74   if (cygpath --version) >/dev/null 2>/dev/null; then
75     CYGPATH_W='cygpath -w'
76   else
77     CYGPATH_W=echo
78   fi
80 AC_SUBST([CYGPATH_W])
82 # Define the identity of the package.
83 dnl Distinguish between old-style and new-style calls.
84 m4_ifval([$2],
85 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
86  AC_SUBST([PACKAGE], [$1])dnl
87  AC_SUBST([VERSION], [$2])],
88 [_AM_SET_OPTIONS([$1])dnl
89  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
90  AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
92 _AM_IF_OPTION([no-define],,
93 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
94  AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
96 # Some tools Automake needs.
97 AC_REQUIRE([AM_SANITY_CHECK])dnl
98 AC_REQUIRE([AC_ARG_PROGRAM])dnl
99 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
100 AM_MISSING_PROG(AUTOCONF, autoconf)
101 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
102 AM_MISSING_PROG(AUTOHEADER, autoheader)
103 AM_MISSING_PROG(MAKEINFO, makeinfo)
104 AM_MISSING_PROG(AMTAR, tar)
105 AM_PROG_INSTALL_SH
106 AM_PROG_INSTALL_STRIP
107 # We need awk for the "check" target.  The system "awk" is bad on
108 # some platforms.
109 AC_REQUIRE([AC_PROG_AWK])dnl
110 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
111 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
113 _AM_IF_OPTION([no-dependencies],,
114 [AC_PROVIDE_IFELSE([AC_PROG_CC],
115                   [_AM_DEPENDENCIES(CC)],
116                   [define([AC_PROG_CC],
117                           defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
118 AC_PROVIDE_IFELSE([AC_PROG_CXX],
119                   [_AM_DEPENDENCIES(CXX)],
120                   [define([AC_PROG_CXX],
121                           defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
126 # When config.status generates a header, we must update the stamp-h file.
127 # This file resides in the same directory as the config header
128 # that is generated.  The stamp files are numbered to have different names.
130 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
131 # loop where config.status creates the headers, so we can generate
132 # our stamp files there.
133 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
134 [# Compute $1's index in $config_headers.
135 _am_stamp_count=1
136 for _am_header in $config_headers :; do
137   case $_am_header in
138     $1 | $1:* )
139       break ;;
140     * )
141       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
142   esac
143 done
144 echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
146 # Copyright 2002  Free Software Foundation, Inc.
148 # This program is free software; you can redistribute it and/or modify
149 # it under the terms of the GNU General Public License as published by
150 # the Free Software Foundation; either version 2, or (at your option)
151 # any later version.
153 # This program is distributed in the hope that it will be useful,
154 # but WITHOUT ANY WARRANTY; without even the implied warranty of
155 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
156 # GNU General Public License for more details.
158 # You should have received a copy of the GNU General Public License
159 # along with this program; if not, write to the Free Software
160 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
162 # AM_AUTOMAKE_VERSION(VERSION)
163 # ----------------------------
164 # Automake X.Y traces this macro to ensure aclocal.m4 has been
165 # generated from the m4 files accompanying Automake X.Y.
166 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
168 # AM_SET_CURRENT_AUTOMAKE_VERSION
169 # -------------------------------
170 # Call AM_AUTOMAKE_VERSION so it can be traced.
171 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
172 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
173          [AM_AUTOMAKE_VERSION([1.7.3])])
175 # Helper functions for option handling.                    -*- Autoconf -*-
177 # Copyright 2001, 2002  Free Software Foundation, Inc.
179 # This program is free software; you can redistribute it and/or modify
180 # it under the terms of the GNU General Public License as published by
181 # the Free Software Foundation; either version 2, or (at your option)
182 # any later version.
184 # This program is distributed in the hope that it will be useful,
185 # but WITHOUT ANY WARRANTY; without even the implied warranty of
186 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
187 # GNU General Public License for more details.
189 # You should have received a copy of the GNU General Public License
190 # along with this program; if not, write to the Free Software
191 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
192 # 02111-1307, USA.
194 # serial 2
196 # _AM_MANGLE_OPTION(NAME)
197 # -----------------------
198 AC_DEFUN([_AM_MANGLE_OPTION],
199 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
201 # _AM_SET_OPTION(NAME)
202 # ------------------------------
203 # Set option NAME.  Presently that only means defining a flag for this option.
204 AC_DEFUN([_AM_SET_OPTION],
205 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
207 # _AM_SET_OPTIONS(OPTIONS)
208 # ----------------------------------
209 # OPTIONS is a space-separated list of Automake options.
210 AC_DEFUN([_AM_SET_OPTIONS],
211 [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
213 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
214 # -------------------------------------------
215 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
216 AC_DEFUN([_AM_IF_OPTION],
217 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
220 # Check to make sure that the build environment is sane.
223 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
225 # This program is free software; you can redistribute it and/or modify
226 # it under the terms of the GNU General Public License as published by
227 # the Free Software Foundation; either version 2, or (at your option)
228 # any later version.
230 # This program is distributed in the hope that it will be useful,
231 # but WITHOUT ANY WARRANTY; without even the implied warranty of
232 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
233 # GNU General Public License for more details.
235 # You should have received a copy of the GNU General Public License
236 # along with this program; if not, write to the Free Software
237 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
238 # 02111-1307, USA.
240 # serial 3
242 # AM_SANITY_CHECK
243 # ---------------
244 AC_DEFUN([AM_SANITY_CHECK],
245 [AC_MSG_CHECKING([whether build environment is sane])
246 # Just in case
247 sleep 1
248 echo timestamp > conftest.file
249 # Do `set' in a subshell so we don't clobber the current shell's
250 # arguments.  Must try -L first in case configure is actually a
251 # symlink; some systems play weird games with the mod time of symlinks
252 # (eg FreeBSD returns the mod time of the symlink's containing
253 # directory).
254 if (
255    set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
256    if test "$[*]" = "X"; then
257       # -L didn't work.
258       set X `ls -t $srcdir/configure conftest.file`
259    fi
260    rm -f conftest.file
261    if test "$[*]" != "X $srcdir/configure conftest.file" \
262       && test "$[*]" != "X conftest.file $srcdir/configure"; then
264       # If neither matched, then we have a broken ls.  This can happen
265       # if, for instance, CONFIG_SHELL is bash and it inherits a
266       # broken ls alias from the environment.  This has actually
267       # happened.  Such a system could not be considered "sane".
268       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
269 alias in your environment])
270    fi
272    test "$[2]" = conftest.file
273    )
274 then
275    # Ok.
276    :
277 else
278    AC_MSG_ERROR([newly created file is older than distributed files!
279 Check your system clock])
281 AC_MSG_RESULT(yes)])
283 #  -*- Autoconf -*-
286 # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
288 # This program is free software; you can redistribute it and/or modify
289 # it under the terms of the GNU General Public License as published by
290 # the Free Software Foundation; either version 2, or (at your option)
291 # any later version.
293 # This program is distributed in the hope that it will be useful,
294 # but WITHOUT ANY WARRANTY; without even the implied warranty of
295 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
296 # GNU General Public License for more details.
298 # You should have received a copy of the GNU General Public License
299 # along with this program; if not, write to the Free Software
300 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
301 # 02111-1307, USA.
303 # serial 3
305 # AM_MISSING_PROG(NAME, PROGRAM)
306 # ------------------------------
307 AC_DEFUN([AM_MISSING_PROG],
308 [AC_REQUIRE([AM_MISSING_HAS_RUN])
309 $1=${$1-"${am_missing_run}$2"}
310 AC_SUBST($1)])
313 # AM_MISSING_HAS_RUN
314 # ------------------
315 # Define MISSING if not defined so far and test if it supports --run.
316 # If it does, set am_missing_run to use it, otherwise, to nothing.
317 AC_DEFUN([AM_MISSING_HAS_RUN],
318 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
319 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
320 # Use eval to expand $SHELL
321 if eval "$MISSING --run true"; then
322   am_missing_run="$MISSING --run "
323 else
324   am_missing_run=
325   AC_MSG_WARN([`missing' script is too old or missing])
329 # AM_AUX_DIR_EXPAND
331 # Copyright 2001 Free Software Foundation, Inc.
333 # This program is free software; you can redistribute it and/or modify
334 # it under the terms of the GNU General Public License as published by
335 # the Free Software Foundation; either version 2, or (at your option)
336 # any later version.
338 # This program is distributed in the hope that it will be useful,
339 # but WITHOUT ANY WARRANTY; without even the implied warranty of
340 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
341 # GNU General Public License for more details.
343 # You should have received a copy of the GNU General Public License
344 # along with this program; if not, write to the Free Software
345 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
346 # 02111-1307, USA.
348 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
349 # $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
350 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
352 # Of course, Automake must honor this variable whenever it calls a
353 # tool from the auxiliary directory.  The problem is that $srcdir (and
354 # therefore $ac_aux_dir as well) can be either absolute or relative,
355 # depending on how configure is run.  This is pretty annoying, since
356 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
357 # source directory, any form will work fine, but in subdirectories a
358 # relative path needs to be adjusted first.
360 # $ac_aux_dir/missing
361 #    fails when called from a subdirectory if $ac_aux_dir is relative
362 # $top_srcdir/$ac_aux_dir/missing
363 #    fails if $ac_aux_dir is absolute,
364 #    fails when called from a subdirectory in a VPATH build with
365 #          a relative $ac_aux_dir
367 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
368 # are both prefixed by $srcdir.  In an in-source build this is usually
369 # harmless because $srcdir is `.', but things will broke when you
370 # start a VPATH build or use an absolute $srcdir.
372 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
373 # iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
374 #   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
375 # and then we would define $MISSING as
376 #   MISSING="\${SHELL} $am_aux_dir/missing"
377 # This will work as long as MISSING is not called from configure, because
378 # unfortunately $(top_srcdir) has no meaning in configure.
379 # However there are other variables, like CC, which are often used in
380 # configure, and could therefore not use this "fixed" $ac_aux_dir.
382 # Another solution, used here, is to always expand $ac_aux_dir to an
383 # absolute PATH.  The drawback is that using absolute paths prevent a
384 # configured tree to be moved without reconfiguration.
386 # Rely on autoconf to set up CDPATH properly.
387 AC_PREREQ([2.50])
389 AC_DEFUN([AM_AUX_DIR_EXPAND], [
390 # expand $ac_aux_dir to an absolute path
391 am_aux_dir=`cd $ac_aux_dir && pwd`
394 # AM_PROG_INSTALL_SH
395 # ------------------
396 # Define $install_sh.
398 # Copyright 2001 Free Software Foundation, Inc.
400 # This program is free software; you can redistribute it and/or modify
401 # it under the terms of the GNU General Public License as published by
402 # the Free Software Foundation; either version 2, or (at your option)
403 # any later version.
405 # This program is distributed in the hope that it will be useful,
406 # but WITHOUT ANY WARRANTY; without even the implied warranty of
407 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
408 # GNU General Public License for more details.
410 # You should have received a copy of the GNU General Public License
411 # along with this program; if not, write to the Free Software
412 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
413 # 02111-1307, USA.
415 AC_DEFUN([AM_PROG_INSTALL_SH],
416 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
417 install_sh=${install_sh-"$am_aux_dir/install-sh"}
418 AC_SUBST(install_sh)])
420 # AM_PROG_INSTALL_STRIP
422 # Copyright 2001 Free Software Foundation, Inc.
424 # This program is free software; you can redistribute it and/or modify
425 # it under the terms of the GNU General Public License as published by
426 # the Free Software Foundation; either version 2, or (at your option)
427 # any later version.
429 # This program is distributed in the hope that it will be useful,
430 # but WITHOUT ANY WARRANTY; without even the implied warranty of
431 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
432 # GNU General Public License for more details.
434 # You should have received a copy of the GNU General Public License
435 # along with this program; if not, write to the Free Software
436 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
437 # 02111-1307, USA.
439 # One issue with vendor `install' (even GNU) is that you can't
440 # specify the program used to strip binaries.  This is especially
441 # annoying in cross-compiling environments, where the build's strip
442 # is unlikely to handle the host's binaries.
443 # Fortunately install-sh will honor a STRIPPROG variable, so we
444 # always use install-sh in `make install-strip', and initialize
445 # STRIPPROG with the value of the STRIP variable (set by the user).
446 AC_DEFUN([AM_PROG_INSTALL_STRIP],
447 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
448 # Installed binaries are usually stripped using `strip' when the user
449 # run `make install-strip'.  However `strip' might not be the right
450 # tool to use in cross-compilation environments, therefore Automake
451 # will honor the `STRIP' environment variable to overrule this program.
452 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
453 if test "$cross_compiling" != no; then
454   AC_CHECK_TOOL([STRIP], [strip], :)
456 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
457 AC_SUBST([INSTALL_STRIP_PROGRAM])])
459 #                                                          -*- Autoconf -*-
460 # Copyright (C) 2003  Free Software Foundation, Inc.
462 # This program is free software; you can redistribute it and/or modify
463 # it under the terms of the GNU General Public License as published by
464 # the Free Software Foundation; either version 2, or (at your option)
465 # any later version.
467 # This program is distributed in the hope that it will be useful,
468 # but WITHOUT ANY WARRANTY; without even the implied warranty of
469 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
470 # GNU General Public License for more details.
472 # You should have received a copy of the GNU General Public License
473 # along with this program; if not, write to the Free Software
474 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
475 # 02111-1307, USA.
477 # serial 1
479 # Check whether the underlying file-system supports filenames
480 # with a leading dot.  For instance MS-DOS doesn't.
481 AC_DEFUN([AM_SET_LEADING_DOT],
482 [rm -rf .tst 2>/dev/null
483 mkdir .tst 2>/dev/null
484 if test -d .tst; then
485   am__leading_dot=.
486 else
487   am__leading_dot=_
489 rmdir .tst 2>/dev/null
490 AC_SUBST([am__leading_dot])])
492 # serial 5                                              -*- Autoconf -*-
494 # Copyright (C) 1999, 2000, 2001, 2002, 2003  Free Software Foundation, Inc.
496 # This program is free software; you can redistribute it and/or modify
497 # it under the terms of the GNU General Public License as published by
498 # the Free Software Foundation; either version 2, or (at your option)
499 # any later version.
501 # This program is distributed in the hope that it will be useful,
502 # but WITHOUT ANY WARRANTY; without even the implied warranty of
503 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
504 # GNU General Public License for more details.
506 # You should have received a copy of the GNU General Public License
507 # along with this program; if not, write to the Free Software
508 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
509 # 02111-1307, USA.
512 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
513 # written in clear, in which case automake, when reading aclocal.m4,
514 # will think it sees a *use*, and therefore will trigger all it's
515 # C support machinery.  Also note that it means that autoscan, seeing
516 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
520 # _AM_DEPENDENCIES(NAME)
521 # ----------------------
522 # See how the compiler implements dependency checking.
523 # NAME is "CC", "CXX", "GCJ", or "OBJC".
524 # We try a few techniques and use that to set a single cache variable.
526 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
527 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
528 # dependency, and given that the user is not expected to run this macro,
529 # just rely on AC_PROG_CC.
530 AC_DEFUN([_AM_DEPENDENCIES],
531 [AC_REQUIRE([AM_SET_DEPDIR])dnl
532 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
533 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
534 AC_REQUIRE([AM_DEP_TRACK])dnl
536 ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
537        [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
538        [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
539        [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
540                    [depcc="$$1"   am_compiler_list=])
542 AC_CACHE_CHECK([dependency style of $depcc],
543                [am_cv_$1_dependencies_compiler_type],
544 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
545   # We make a subdir and do the tests there.  Otherwise we can end up
546   # making bogus files that we don't know about and never remove.  For
547   # instance it was reported that on HP-UX the gcc test will end up
548   # making a dummy file named `D' -- because `-MD' means `put the output
549   # in D'.
550   mkdir conftest.dir
551   # Copy depcomp to subdir because otherwise we won't find it if we're
552   # using a relative directory.
553   cp "$am_depcomp" conftest.dir
554   cd conftest.dir
556   am_cv_$1_dependencies_compiler_type=none
557   if test "$am_compiler_list" = ""; then
558      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
559   fi
560   for depmode in $am_compiler_list; do
561     # We need to recreate these files for each test, as the compiler may
562     # overwrite some of them when testing with obscure command lines.
563     # This happens at least with the AIX C compiler.
564     echo '#include "conftest.h"' > conftest.c
565     echo 'int i;' > conftest.h
566     echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
568     case $depmode in
569     nosideeffect)
570       # after this tag, mechanisms are not by side-effect, so they'll
571       # only be used when explicitly requested
572       if test "x$enable_dependency_tracking" = xyes; then
573         continue
574       else
575         break
576       fi
577       ;;
578     none) break ;;
579     esac
580     # We check with `-c' and `-o' for the sake of the "dashmstdout"
581     # mode.  It turns out that the SunPro C++ compiler does not properly
582     # handle `-M -o', and we need to detect this.
583     if depmode=$depmode \
584        source=conftest.c object=conftest.o \
585        depfile=conftest.Po tmpdepfile=conftest.TPo \
586        $SHELL ./depcomp $depcc -c -o conftest.o conftest.c \
587          >/dev/null 2>conftest.err &&
588        grep conftest.h conftest.Po > /dev/null 2>&1 &&
589        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
590       # icc doesn't choke on unknown options, it will just issue warnings
591       # (even with -Werror).  So we grep stderr for any message
592       # that says an option was ignored.
593       if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
594         am_cv_$1_dependencies_compiler_type=$depmode
595         break
596       fi
597     fi
598   done
600   cd ..
601   rm -rf conftest.dir
602 else
603   am_cv_$1_dependencies_compiler_type=none
606 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
607 AM_CONDITIONAL([am__fastdep$1], [
608   test "x$enable_dependency_tracking" != xno \
609   && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
613 # AM_SET_DEPDIR
614 # -------------
615 # Choose a directory name for dependency files.
616 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
617 AC_DEFUN([AM_SET_DEPDIR],
618 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
619 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
623 # AM_DEP_TRACK
624 # ------------
625 AC_DEFUN([AM_DEP_TRACK],
626 [AC_ARG_ENABLE(dependency-tracking,
627 [  --disable-dependency-tracking Speeds up one-time builds
628   --enable-dependency-tracking  Do not reject slow dependency extractors])
629 if test "x$enable_dependency_tracking" != xno; then
630   am_depcomp="$ac_aux_dir/depcomp"
631   AMDEPBACKSLASH='\'
633 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
634 AC_SUBST([AMDEPBACKSLASH])
637 # Generate code to set up dependency tracking.   -*- Autoconf -*-
639 # Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
641 # This program is free software; you can redistribute it and/or modify
642 # it under the terms of the GNU General Public License as published by
643 # the Free Software Foundation; either version 2, or (at your option)
644 # any later version.
646 # This program is distributed in the hope that it will be useful,
647 # but WITHOUT ANY WARRANTY; without even the implied warranty of
648 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
649 # GNU General Public License for more details.
651 # You should have received a copy of the GNU General Public License
652 # along with this program; if not, write to the Free Software
653 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
654 # 02111-1307, USA.
656 #serial 2
658 # _AM_OUTPUT_DEPENDENCY_COMMANDS
659 # ------------------------------
660 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
661 [for mf in $CONFIG_FILES; do
662   # Strip MF so we end up with the name of the file.
663   mf=`echo "$mf" | sed -e 's/:.*$//'`
664   # Check whether this is an Automake generated Makefile or not.
665   # We used to match only the files named `Makefile.in', but
666   # some people rename them; so instead we look at the file content.
667   # Grep'ing the first line is not enough: some people post-process
668   # each Makefile.in and add a new line on top of each file to say so.
669   # So let's grep whole file.
670   if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
671     dirpart=`AS_DIRNAME("$mf")`
672   else
673     continue
674   fi
675   grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
676   # Extract the definition of DEP_FILES from the Makefile without
677   # running `make'.
678   DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
679   test -z "$DEPDIR" && continue
680   # When using ansi2knr, U may be empty or an underscore; expand it
681   U=`sed -n -e '/^U = / s///p' < "$mf"`
682   test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
683   # We invoke sed twice because it is the simplest approach to
684   # changing $(DEPDIR) to its actual value in the expansion.
685   for file in `sed -n -e '
686     /^DEP_FILES = .*\\\\$/ {
687       s/^DEP_FILES = //
688       :loop
689         s/\\\\$//
690         p
691         n
692         /\\\\$/ b loop
693       p
694     }
695     /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
696        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
697     # Make sure the directory exists.
698     test -f "$dirpart/$file" && continue
699     fdir=`AS_DIRNAME(["$file"])`
700     AS_MKDIR_P([$dirpart/$fdir])
701     # echo "creating $dirpart/$file"
702     echo '# dummy' > "$dirpart/$file"
703   done
704 done
705 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
708 # AM_OUTPUT_DEPENDENCY_COMMANDS
709 # -----------------------------
710 # This macro should only be invoked once -- use via AC_REQUIRE.
712 # This code is only required when automatic dependency tracking
713 # is enabled.  FIXME.  This creates each `.P' file that we will
714 # need in order to bootstrap the dependency handling code.
715 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
716 [AC_CONFIG_COMMANDS([depfiles],
717      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
718      [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
721 # Check to see how 'make' treats includes.      -*- Autoconf -*-
723 # Copyright (C) 2001, 2002 Free Software Foundation, Inc.
725 # This program is free software; you can redistribute it and/or modify
726 # it under the terms of the GNU General Public License as published by
727 # the Free Software Foundation; either version 2, or (at your option)
728 # any later version.
730 # This program is distributed in the hope that it will be useful,
731 # but WITHOUT ANY WARRANTY; without even the implied warranty of
732 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
733 # GNU General Public License for more details.
735 # You should have received a copy of the GNU General Public License
736 # along with this program; if not, write to the Free Software
737 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
738 # 02111-1307, USA.
740 # serial 2
742 # AM_MAKE_INCLUDE()
743 # -----------------
744 # Check to see how make treats includes.
745 AC_DEFUN([AM_MAKE_INCLUDE],
746 [am_make=${MAKE-make}
747 cat > confinc << 'END'
748 doit:
749         @echo done
751 # If we don't find an include directive, just comment out the code.
752 AC_MSG_CHECKING([for style of include used by $am_make])
753 am__include="#"
754 am__quote=
755 _am_result=none
756 # First try GNU make style include.
757 echo "include confinc" > confmf
758 # We grep out `Entering directory' and `Leaving directory'
759 # messages which can occur if `w' ends up in MAKEFLAGS.
760 # In particular we don't look at `^make:' because GNU make might
761 # be invoked under some other name (usually "gmake"), in which
762 # case it prints its new name instead of `make'.
763 if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
764    am__include=include
765    am__quote=
766    _am_result=GNU
768 # Now try BSD make style include.
769 if test "$am__include" = "#"; then
770    echo '.include "confinc"' > confmf
771    if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
772       am__include=.include
773       am__quote="\""
774       _am_result=BSD
775    fi
777 AC_SUBST(am__include)
778 AC_SUBST(am__quote)
779 AC_MSG_RESULT($_am_result)
780 rm -f confinc confmf
783 # AM_CONDITIONAL                                              -*- Autoconf -*-
785 # Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
787 # This program is free software; you can redistribute it and/or modify
788 # it under the terms of the GNU General Public License as published by
789 # the Free Software Foundation; either version 2, or (at your option)
790 # any later version.
792 # This program is distributed in the hope that it will be useful,
793 # but WITHOUT ANY WARRANTY; without even the implied warranty of
794 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
795 # GNU General Public License for more details.
797 # You should have received a copy of the GNU General Public License
798 # along with this program; if not, write to the Free Software
799 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
800 # 02111-1307, USA.
802 # serial 5
804 AC_PREREQ(2.52)
806 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
807 # -------------------------------------
808 # Define a conditional.
809 AC_DEFUN([AM_CONDITIONAL],
810 [ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
811         [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
812 AC_SUBST([$1_TRUE])
813 AC_SUBST([$1_FALSE])
814 if $2; then
815   $1_TRUE=
816   $1_FALSE='#'
817 else
818   $1_TRUE='#'
819   $1_FALSE=
821 AC_CONFIG_COMMANDS_PRE(
822 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
823   AC_MSG_ERROR([conditional "$1" was never defined.
824 Usually this means the macro was only invoked conditionally.])
825 fi])])
827 # Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
829 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
831 # This program is free software; you can redistribute it and/or modify
832 # it under the terms of the GNU General Public License as published by
833 # the Free Software Foundation; either version 2, or (at your option)
834 # any later version.
836 # This program is distributed in the hope that it will be useful,
837 # but WITHOUT ANY WARRANTY; without even the implied warranty of
838 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
839 # GNU General Public License for more details.
841 # You should have received a copy of the GNU General Public License
842 # along with this program; if not, write to the Free Software
843 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
844 # 02111-1307, USA.
846 AC_PREREQ([2.52])
848 # serial 6
850 # AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
851 AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
853 # Configure paths for GTK+
854 # Owen Taylor     1997-2001
856 dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
857 dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES, 
858 dnl pass to pkg-config
860 AC_DEFUN(AM_PATH_GTK_2_0,
861 [dnl 
862 dnl Get the cflags and libraries from pkg-config
864 AC_ARG_ENABLE(gtktest, [  --disable-gtktest       do not try to compile and run a test GTK+ program],
865                     , enable_gtktest=yes)
867   pkg_config_args=gtk+-2.0
868   for module in . $4
869   do
870       case "$module" in
871          gthread) 
872              pkg_config_args="$pkg_config_args gthread-2.0"
873          ;;
874       esac
875   done
877   no_gtk=""
879   AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
881   if test x$PKG_CONFIG != xno ; then
882     if pkg-config --atleast-pkgconfig-version 0.7 ; then
883       :
884     else
885       echo *** pkg-config too old; version 0.7 or better required.
886       no_gtk=yes
887       PKG_CONFIG=no
888     fi
889   else
890     no_gtk=yes
891   fi
893   min_gtk_version=ifelse([$1], ,2.0.0,$1)
894   AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version)
896   if test x$PKG_CONFIG != xno ; then
897     ## don't try to run the test against uninstalled libtool libs
898     if $PKG_CONFIG --uninstalled $pkg_config_args; then
899           echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH"
900           enable_gtktest=no
901     fi
903     if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then
904           :
905     else
906           no_gtk=yes
907     fi
908   fi
910   if test x"$no_gtk" = x ; then
911     GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
912     GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
913     gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
914            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
915     gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
916            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
917     gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
918            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
919     if test "x$enable_gtktest" = "xyes" ; then
920       ac_save_CFLAGS="$CFLAGS"
921       ac_save_LIBS="$LIBS"
922       CFLAGS="$CFLAGS $GTK_CFLAGS"
923       LIBS="$GTK_LIBS $LIBS"
925 dnl Now check if the installed GTK+ is sufficiently new. (Also sanity
926 dnl checks the results of pkg-config to some extent)
928       rm -f conf.gtktest
929       AC_TRY_RUN([
930 #include <gtk/gtk.h>
931 #include <stdio.h>
932 #include <stdlib.h>
934 int 
935 main ()
937   int major, minor, micro;
938   char *tmp_version;
940   system ("touch conf.gtktest");
942   /* HP/UX 9 (%@#!) writes to sscanf strings */
943   tmp_version = g_strdup("$min_gtk_version");
944   if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
945      printf("%s, bad version string\n", "$min_gtk_version");
946      exit(1);
947    }
949   if ((gtk_major_version != $gtk_config_major_version) ||
950       (gtk_minor_version != $gtk_config_minor_version) ||
951       (gtk_micro_version != $gtk_config_micro_version))
952     {
953       printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", 
954              $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
955              gtk_major_version, gtk_minor_version, gtk_micro_version);
956       printf ("*** was found! If pkg-config was correct, then it is best\n");
957       printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
958       printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
959       printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
960       printf("*** required on your system.\n");
961       printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
962       printf("*** to point to the correct configuration files\n");
963     } 
964   else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
965            (gtk_minor_version != GTK_MINOR_VERSION) ||
966            (gtk_micro_version != GTK_MICRO_VERSION))
967     {
968       printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
969              GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
970       printf("*** library (version %d.%d.%d)\n",
971              gtk_major_version, gtk_minor_version, gtk_micro_version);
972     }
973   else
974     {
975       if ((gtk_major_version > major) ||
976         ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
977         ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
978       {
979         return 0;
980        }
981      else
982       {
983         printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
984                gtk_major_version, gtk_minor_version, gtk_micro_version);
985         printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
986                major, minor, micro);
987         printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
988         printf("***\n");
989         printf("*** If you have already installed a sufficiently new version, this error\n");
990         printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
991         printf("*** being found. The easiest way to fix this is to remove the old version\n");
992         printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n");
993         printf("*** correct copy of pkg-config. (In this case, you will have to\n");
994         printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
995         printf("*** so that the correct libraries are found at run-time))\n");
996       }
997     }
998   return 1;
1000 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1001        CFLAGS="$ac_save_CFLAGS"
1002        LIBS="$ac_save_LIBS"
1003      fi
1004   fi
1005   if test "x$no_gtk" = x ; then
1006      AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version))
1007      ifelse([$2], , :, [$2])     
1008   else
1009      AC_MSG_RESULT(no)
1010      if test "$PKG_CONFIG" = "no" ; then
1011        echo "*** A new enough version of pkg-config was not found."
1012        echo "*** See http://pkgconfig.sourceforge.net"
1013      else
1014        if test -f conf.gtktest ; then
1015         :
1016        else
1017           echo "*** Could not run GTK+ test program, checking why..."
1018           ac_save_CFLAGS="$CFLAGS"
1019           ac_save_LIBS="$LIBS"
1020           CFLAGS="$CFLAGS $GTK_CFLAGS"
1021           LIBS="$LIBS $GTK_LIBS"
1022           AC_TRY_LINK([
1023 #include <gtk/gtk.h>
1024 #include <stdio.h>
1025 ],      [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
1026         [ echo "*** The test program compiled, but did not run. This usually means"
1027           echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
1028           echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your"
1029           echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1030           echo "*** to the installed location  Also, make sure you have run ldconfig if that"
1031           echo "*** is required on your system"
1032           echo "***"
1033           echo "*** If you have an old version installed, it is best to remove it, although"
1034           echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
1035         [ echo "*** The test program failed to compile or link. See the file config.log for the"
1036           echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."])
1037           CFLAGS="$ac_save_CFLAGS"
1038           LIBS="$ac_save_LIBS"
1039        fi
1040      fi
1041      GTK_CFLAGS=""
1042      GTK_LIBS=""
1043      ifelse([$3], , :, [$3])
1044   fi
1045   AC_SUBST(GTK_CFLAGS)
1046   AC_SUBST(GTK_LIBS)
1047   rm -f conf.gtktest
1051 dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
1052 dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
1053 dnl also defines GSTUFF_PKG_ERRORS on error
1054 AC_DEFUN(PKG_CHECK_MODULES, [
1055   succeeded=no
1057   if test -z "$PKG_CONFIG"; then
1058     AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
1059   fi
1061   if test "$PKG_CONFIG" = "no" ; then
1062      echo "*** The pkg-config script could not be found. Make sure it is"
1063      echo "*** in your path, or set the PKG_CONFIG environment variable"
1064      echo "*** to the full path to pkg-config."
1065      echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
1066   else
1067      PKG_CONFIG_MIN_VERSION=0.9.0
1068      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
1069         AC_MSG_CHECKING(for $2)
1071         if $PKG_CONFIG --exists "$2" ; then
1072             AC_MSG_RESULT(yes)
1073             succeeded=yes
1075             AC_MSG_CHECKING($1_CFLAGS)
1076             $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
1077             AC_MSG_RESULT($$1_CFLAGS)
1079             AC_MSG_CHECKING($1_LIBS)
1080             $1_LIBS=`$PKG_CONFIG --libs "$2"`
1081             AC_MSG_RESULT($$1_LIBS)
1082         else
1083             $1_CFLAGS=""
1084             $1_LIBS=""
1085             ## If we have a custom action on failure, don't print errors, but 
1086             ## do set a variable so people can do so.
1087             $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
1088             ifelse([$4], ,echo $$1_PKG_ERRORS,)
1089         fi
1091         AC_SUBST($1_CFLAGS)
1092         AC_SUBST($1_LIBS)
1093      else
1094         echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
1095         echo "*** See http://www.freedesktop.org/software/pkgconfig"
1096      fi
1097   fi
1099   if test $succeeded = yes; then
1100      ifelse([$3], , :, [$3])
1101   else
1102      ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
1103   fi
1108 # gettext.m4 serial 17 (gettext-0.11.5)
1109 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
1110 dnl This file is free software, distributed under the terms of the GNU
1111 dnl General Public License.  As a special exception to the GNU General
1112 dnl Public License, this file may be distributed as part of a program
1113 dnl that contains a configuration script generated by Autoconf, under
1114 dnl the same distribution terms as the rest of that program.
1116 dnl This file can can be used in projects which are not available under
1117 dnl the GNU General Public License or the GNU Library General Public
1118 dnl License but which still want to provide support for the GNU gettext
1119 dnl functionality.
1120 dnl Please note that the actual code of the GNU gettext library is covered
1121 dnl by the GNU Library General Public License, and the rest of the GNU
1122 dnl gettext package package is covered by the GNU General Public License.
1123 dnl They are *not* in the public domain.
1125 dnl Authors:
1126 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1127 dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2002.
1129 dnl Macro to add for using GNU gettext.
1131 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
1132 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
1133 dnl    default (if it is not specified or empty) is 'no-libtool'.
1134 dnl    INTLSYMBOL should be 'external' for packages with no intl directory,
1135 dnl    and 'no-libtool' or 'use-libtool' for packages with an intl directory.
1136 dnl    If INTLSYMBOL is 'use-libtool', then a libtool library
1137 dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
1138 dnl    depending on --{enable,disable}-{shared,static} and on the presence of
1139 dnl    AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
1140 dnl    $(top_builddir)/intl/libintl.a will be created.
1141 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
1142 dnl    implementations (in libc or libintl) without the ngettext() function
1143 dnl    will be ignored.  If NEEDSYMBOL is specified and is
1144 dnl    'need-formatstring-macros', then GNU gettext implementations that don't
1145 dnl    support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
1146 dnl INTLDIR is used to find the intl libraries.  If empty,
1147 dnl    the value `$(top_builddir)/intl/' is used.
1149 dnl The result of the configuration is one of three cases:
1150 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
1151 dnl    and used.
1152 dnl    Catalog format: GNU --> install in $(datadir)
1153 dnl    Catalog extension: .mo after installation, .gmo in source tree
1154 dnl 2) GNU gettext has been found in the system's C library.
1155 dnl    Catalog format: GNU --> install in $(datadir)
1156 dnl    Catalog extension: .mo after installation, .gmo in source tree
1157 dnl 3) No internationalization, always use English msgid.
1158 dnl    Catalog format: none
1159 dnl    Catalog extension: none
1160 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
1161 dnl The use of .gmo is historical (it was needed to avoid overwriting the
1162 dnl GNU format catalogs when building on a platform with an X/Open gettext),
1163 dnl but we keep it in order not to force irrelevant filename changes on the
1164 dnl maintainers.
1166 AC_DEFUN([AM_GNU_GETTEXT],
1168   dnl Argument checking.
1169   ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
1170     [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
1171 ])])])])])
1172   ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
1173     [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
1174 ])])])])
1175   define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
1176   define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
1178   AC_REQUIRE([AM_PO_SUBDIRS])dnl
1179   ifelse(gt_included_intl, yes, [
1180     AC_REQUIRE([AM_INTL_SUBDIR])dnl
1181   ])
1183   dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
1184   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1185   AC_REQUIRE([AC_LIB_RPATH])
1187   dnl Sometimes libintl requires libiconv, so first search for libiconv.
1188   dnl Ideally we would do this search only after the
1189   dnl      if test "$USE_NLS" = "yes"; then
1190   dnl        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
1191   dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
1192   dnl the configure script would need to contain the same shell code
1193   dnl again, outside any 'if'. There are two solutions:
1194   dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
1195   dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
1196   dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
1197   dnl documented, we avoid it.
1198   ifelse(gt_included_intl, yes, , [
1199     AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
1200   ])
1202   AC_MSG_CHECKING([whether NLS is requested])
1203   dnl Default is enabled NLS
1204   AC_ARG_ENABLE(nls,
1205     [  --disable-nls           do not use Native Language Support],
1206     USE_NLS=$enableval, USE_NLS=yes)
1207   AC_MSG_RESULT($USE_NLS)
1208   AC_SUBST(USE_NLS)
1210   ifelse(gt_included_intl, yes, [
1211     BUILD_INCLUDED_LIBINTL=no
1212     USE_INCLUDED_LIBINTL=no
1213   ])
1214   LIBINTL=
1215   LTLIBINTL=
1216   POSUB=
1218   dnl If we use NLS figure out what method
1219   if test "$USE_NLS" = "yes"; then
1220     gt_use_preinstalled_gnugettext=no
1221     ifelse(gt_included_intl, yes, [
1222       AC_MSG_CHECKING([whether included gettext is requested])
1223       AC_ARG_WITH(included-gettext,
1224         [  --with-included-gettext use the GNU gettext library included here],
1225         nls_cv_force_use_gnu_gettext=$withval,
1226         nls_cv_force_use_gnu_gettext=no)
1227       AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
1229       nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
1230       if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
1231     ])
1232         dnl User does not insist on using GNU NLS library.  Figure out what
1233         dnl to use.  If GNU gettext is available we use this.  Else we have
1234         dnl to fall back to GNU NLS library.
1236         dnl Add a version number to the cache macros.
1237         define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
1238         define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
1239         define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
1241         AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
1242          [AC_TRY_LINK([#include <libintl.h>
1243 ]ifelse([$2], [need-formatstring-macros],
1244 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1245 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
1246 #endif
1247 changequote(,)dnl
1248 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
1249 changequote([,])dnl
1250 ], [])[extern int _nl_msg_cat_cntr;
1251 extern int *_nl_domain_bindings;],
1252             [bindtextdomain ("", "");
1253 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
1254             gt_cv_func_gnugettext_libc=yes,
1255             gt_cv_func_gnugettext_libc=no)])
1257         if test "$gt_cv_func_gnugettext_libc" != "yes"; then
1258           dnl Sometimes libintl requires libiconv, so first search for libiconv.
1259           ifelse(gt_included_intl, yes, , [
1260             AM_ICONV_LINK
1261           ])
1262           dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
1263           dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
1264           dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
1265           dnl even if libiconv doesn't exist.
1266           AC_LIB_LINKFLAGS_BODY([intl])
1267           AC_CACHE_CHECK([for GNU gettext in libintl],
1268             gt_cv_func_gnugettext_libintl,
1269            [gt_save_CPPFLAGS="$CPPFLAGS"
1270             CPPFLAGS="$CPPFLAGS $INCINTL"
1271             gt_save_LIBS="$LIBS"
1272             LIBS="$LIBS $LIBINTL"
1273             dnl Now see whether libintl exists and does not depend on libiconv.
1274             AC_TRY_LINK([#include <libintl.h>
1275 ]ifelse([$2], [need-formatstring-macros],
1276 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1277 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
1278 #endif
1279 changequote(,)dnl
1280 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
1281 changequote([,])dnl
1282 ], [])[extern int _nl_msg_cat_cntr;
1283 extern
1284 #ifdef __cplusplus
1286 #endif
1287 const char *_nl_expand_alias ();],
1288               [bindtextdomain ("", "");
1289 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
1290               gt_cv_func_gnugettext_libintl=yes,
1291               gt_cv_func_gnugettext_libintl=no)
1292             dnl Now see whether libintl exists and depends on libiconv.
1293             if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
1294               LIBS="$LIBS $LIBICONV"
1295               AC_TRY_LINK([#include <libintl.h>
1296 ]ifelse([$2], [need-formatstring-macros],
1297 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1298 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
1299 #endif
1300 changequote(,)dnl
1301 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
1302 changequote([,])dnl
1303 ], [])[extern int _nl_msg_cat_cntr;
1304 extern
1305 #ifdef __cplusplus
1307 #endif
1308 const char *_nl_expand_alias ();],
1309                 [bindtextdomain ("", "");
1310 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
1311                [LIBINTL="$LIBINTL $LIBICONV"
1312                 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
1313                 gt_cv_func_gnugettext_libintl=yes
1314                ])
1315             fi
1316             CPPFLAGS="$gt_save_CPPFLAGS"
1317             LIBS="$gt_save_LIBS"])
1318         fi
1320         dnl If an already present or preinstalled GNU gettext() is found,
1321         dnl use it.  But if this macro is used in GNU gettext, and GNU
1322         dnl gettext is already preinstalled in libintl, we update this
1323         dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
1324         if test "$gt_cv_func_gnugettext_libc" = "yes" \
1325            || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
1326                 && test "$PACKAGE" != gettext; }; then
1327           gt_use_preinstalled_gnugettext=yes
1328         else
1329           dnl Reset the values set by searching for libintl.
1330           LIBINTL=
1331           LTLIBINTL=
1332           INCINTL=
1333         fi
1335     ifelse(gt_included_intl, yes, [
1336         if test "$gt_use_preinstalled_gnugettext" != "yes"; then
1337           dnl GNU gettext is not found in the C library.
1338           dnl Fall back on included GNU gettext library.
1339           nls_cv_use_gnu_gettext=yes
1340         fi
1341       fi
1343       if test "$nls_cv_use_gnu_gettext" = "yes"; then
1344         dnl Mark actions used to generate GNU NLS library.
1345         INTLOBJS="\$(GETTOBJS)"
1346         BUILD_INCLUDED_LIBINTL=yes
1347         USE_INCLUDED_LIBINTL=yes
1348         LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
1349         LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
1350         LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
1351       fi
1353       if test "$gt_use_preinstalled_gnugettext" = "yes" \
1354          || test "$nls_cv_use_gnu_gettext" = "yes"; then
1355         dnl Mark actions to use GNU gettext tools.
1356         CATOBJEXT=.gmo
1357       fi
1358     ])
1360     if test "$gt_use_preinstalled_gnugettext" = "yes" \
1361        || test "$nls_cv_use_gnu_gettext" = "yes"; then
1362       AC_DEFINE(ENABLE_NLS, 1,
1363         [Define to 1 if translation of program messages to the user's native language
1364    is requested.])
1365     else
1366       USE_NLS=no
1367     fi
1368   fi
1370   if test "$USE_NLS" = "yes"; then
1372     if test "$gt_use_preinstalled_gnugettext" = "yes"; then
1373       if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
1374         AC_MSG_CHECKING([how to link with libintl])
1375         AC_MSG_RESULT([$LIBINTL])
1376         AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
1377       fi
1379       dnl For backward compatibility. Some packages may be using this.
1380       AC_DEFINE(HAVE_GETTEXT, 1,
1381        [Define if the GNU gettext() function is already present or preinstalled.])
1382       AC_DEFINE(HAVE_DCGETTEXT, 1,
1383        [Define if the GNU dcgettext() function is already present or preinstalled.])
1384     fi
1386     dnl We need to process the po/ directory.
1387     POSUB=po
1388   fi
1390   ifelse(gt_included_intl, yes, [
1391     dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
1392     dnl to 'yes' because some of the testsuite requires it.
1393     if test "$PACKAGE" = gettext; then
1394       BUILD_INCLUDED_LIBINTL=yes
1395     fi
1397     dnl Make all variables we use known to autoconf.
1398     AC_SUBST(BUILD_INCLUDED_LIBINTL)
1399     AC_SUBST(USE_INCLUDED_LIBINTL)
1400     AC_SUBST(CATOBJEXT)
1401     AC_SUBST(INTLOBJS)
1403     dnl For backward compatibility. Some configure.ins may be using this.
1404     nls_cv_header_intl=
1405     nls_cv_header_libgt=
1407     dnl For backward compatibility. Some Makefiles may be using this.
1408     DATADIRNAME=share
1409     AC_SUBST(DATADIRNAME)
1411     dnl For backward compatibility. Some Makefiles may be using this.
1412     INSTOBJEXT=.mo
1413     AC_SUBST(INSTOBJEXT)
1415     dnl For backward compatibility. Some Makefiles may be using this.
1416     GENCAT=gencat
1417     AC_SUBST(GENCAT)
1419     dnl Enable libtool support if the surrounding package wishes it.
1420     INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
1421     AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
1422   ])
1424   dnl For backward compatibility. Some Makefiles may be using this.
1425   INTLLIBS="$LIBINTL"
1426   AC_SUBST(INTLLIBS)
1428   dnl Make all documented variables known to autoconf.
1429   AC_SUBST(LIBINTL)
1430   AC_SUBST(LTLIBINTL)
1431   AC_SUBST(POSUB)
1435 dnl Checks for all prerequisites of the po subdirectory,
1436 dnl except for USE_NLS.
1437 AC_DEFUN([AM_PO_SUBDIRS],
1439   AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1440   AC_REQUIRE([AC_PROG_INSTALL])dnl
1441   AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1443   dnl Perform the following tests also if --disable-nls has been given,
1444   dnl because they are needed for "make dist" to work.
1446   dnl Search for GNU msgfmt in the PATH.
1447   dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
1448   dnl The second test excludes FreeBSD msgfmt.
1449   AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1450     [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
1451      (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1452     :)
1453   AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1455   dnl Search for GNU xgettext 0.11 or newer in the PATH.
1456   dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
1457   dnl The second test excludes FreeBSD xgettext.
1458   AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1459     [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
1460      (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)],
1461     :)
1462   dnl Remove leftover from FreeBSD xgettext call.
1463   rm -f messages.po
1465   dnl Search for GNU msgmerge 0.11 or newer in the PATH.
1466   AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
1467     [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
1469   dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1470   dnl Test whether we really found GNU msgfmt.
1471   if test "$GMSGFMT" != ":"; then
1472     dnl If it is no GNU msgfmt we define it as : so that the
1473     dnl Makefiles still can work.
1474     if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
1475        (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1476       : ;
1477     else
1478       GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
1479       AC_MSG_RESULT(
1480         [found $GMSGFMT program is not GNU msgfmt; ignore it])
1481       GMSGFMT=":"
1482     fi
1483   fi
1485   dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1486   dnl Test whether we really found GNU xgettext.
1487   if test "$XGETTEXT" != ":"; then
1488     dnl If it is no GNU xgettext we define it as : so that the
1489     dnl Makefiles still can work.
1490     if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
1491        (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1492       : ;
1493     else
1494       AC_MSG_RESULT(
1495         [found xgettext program is not GNU xgettext; ignore it])
1496       XGETTEXT=":"
1497     fi
1498     dnl Remove leftover from FreeBSD xgettext call.
1499     rm -f messages.po
1500   fi
1502   AC_OUTPUT_COMMANDS([
1503     for ac_file in $CONFIG_FILES; do
1504       # Support "outfile[:infile[:infile...]]"
1505       case "$ac_file" in
1506         *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1507       esac
1508       # PO directories have a Makefile.in generated from Makefile.in.in.
1509       case "$ac_file" in */Makefile.in)
1510         # Adjust a relative srcdir.
1511         ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1512         ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1513         ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1514         # In autoconf-2.13 it is called $ac_given_srcdir.
1515         # In autoconf-2.50 it is called $srcdir.
1516         test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1517         case "$ac_given_srcdir" in
1518           .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1519           /*) top_srcdir="$ac_given_srcdir" ;;
1520           *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
1521         esac
1522         if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
1523           rm -f "$ac_dir/POTFILES"
1524           test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
1525           cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[   ]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
1526           # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
1527           # on $ac_dir but don't depend on user-specified configuration
1528           # parameters.
1529           if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
1530             # The LINGUAS file contains the set of available languages.
1531             if test -n "$ALL_LINGUAS"; then
1532               test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
1533             fi
1534             ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
1535             # Hide the ALL_LINGUAS assigment from automake.
1536             eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
1537           fi
1538           case "$ac_given_srcdir" in
1539             .) srcdirpre= ;;
1540             *) srcdirpre='$(srcdir)/' ;;
1541           esac
1542           POFILES=
1543           GMOFILES=
1544           UPDATEPOFILES=
1545           DUMMYPOFILES=
1546           for lang in $ALL_LINGUAS; do
1547             POFILES="$POFILES $srcdirpre$lang.po"
1548             GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
1549             UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
1550             DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
1551           done
1552           # CATALOGS depends on both $ac_dir and the user's LINGUAS
1553           # environment variable.
1554           INST_LINGUAS=
1555           if test -n "$ALL_LINGUAS"; then
1556             for presentlang in $ALL_LINGUAS; do
1557               useit=no
1558               if test "%UNSET%" != "$LINGUAS"; then
1559                 desiredlanguages="$LINGUAS"
1560               else
1561                 desiredlanguages="$ALL_LINGUAS"
1562               fi
1563               for desiredlang in $desiredlanguages; do
1564                 # Use the presentlang catalog if desiredlang is
1565                 #   a. equal to presentlang, or
1566                 #   b. a variant of presentlang (because in this case,
1567                 #      presentlang can be used as a fallback for messages
1568                 #      which are not translated in the desiredlang catalog).
1569                 case "$desiredlang" in
1570                   "$presentlang"*) useit=yes;;
1571                 esac
1572               done
1573               if test $useit = yes; then
1574                 INST_LINGUAS="$INST_LINGUAS $presentlang"
1575               fi
1576             done
1577           fi
1578           CATALOGS=
1579           if test -n "$INST_LINGUAS"; then
1580             for lang in $INST_LINGUAS; do
1581               CATALOGS="$CATALOGS $lang.gmo"
1582             done
1583           fi
1584           test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
1585           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"
1586           for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
1587             if test -f "$f"; then
1588               case "$f" in
1589                 *.orig | *.bak | *~) ;;
1590                 *) cat "$f" >> "$ac_dir/Makefile" ;;
1591               esac
1592             fi
1593           done
1594         fi
1595         ;;
1596       esac
1597     done],
1598    [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
1599     # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
1600     # from automake.
1601     eval 'ALL_LINGUAS''="$ALL_LINGUAS"'
1602     # Capture the value of LINGUAS because we need it to compute CATALOGS.
1603     LINGUAS="${LINGUAS-%UNSET%}"
1604    ])
1608 dnl Checks for all prerequisites of the intl subdirectory,
1609 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
1610 dnl            USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
1611 AC_DEFUN([AM_INTL_SUBDIR],
1613   AC_REQUIRE([AC_PROG_INSTALL])dnl
1614   AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1615   AC_REQUIRE([AC_PROG_CC])dnl
1616   AC_REQUIRE([AC_CANONICAL_HOST])dnl
1617   AC_REQUIRE([AC_PROG_RANLIB])dnl
1618   AC_REQUIRE([AC_ISC_POSIX])dnl
1619   AC_REQUIRE([AC_HEADER_STDC])dnl
1620   AC_REQUIRE([AC_C_CONST])dnl
1621   AC_REQUIRE([AC_C_INLINE])dnl
1622   AC_REQUIRE([AC_TYPE_OFF_T])dnl
1623   AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1624   AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1625   AC_REQUIRE([AC_FUNC_MMAP])dnl
1626   AC_REQUIRE([jm_GLIBC21])dnl
1627   AC_REQUIRE([gt_INTDIV0])dnl
1628   AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
1629   AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
1630   AC_REQUIRE([gt_INTTYPES_PRI])dnl
1632   AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
1633 stdlib.h string.h unistd.h sys/param.h])
1634   AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
1635 geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
1636 strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
1638   AM_ICONV
1639   AM_LANGINFO_CODESET
1640   if test $ac_cv_header_locale_h = yes; then
1641     AM_LC_MESSAGES
1642   fi
1644   dnl intl/plural.c is generated from intl/plural.y. It requires bison,
1645   dnl because plural.y uses bison specific features. It requires at least
1646   dnl bison-1.26 because earlier versions generate a plural.c that doesn't
1647   dnl compile.
1648   dnl bison is only needed for the maintainer (who touches plural.y). But in
1649   dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
1650   dnl the rule in general Makefile. Now, some people carelessly touch the
1651   dnl files or have a broken "make" program, hence the plural.c rule will
1652   dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
1653   dnl present or too old.
1654   AC_CHECK_PROGS([INTLBISON], [bison])
1655   if test -z "$INTLBISON"; then
1656     ac_verc_fail=yes
1657   else
1658     dnl Found it, now check the version.
1659     AC_MSG_CHECKING([version of bison])
1660 changequote(<<,>>)dnl
1661     ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
1662     case $ac_prog_version in
1663       '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1664       1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
1665 changequote([,])dnl
1666          ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
1667       *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
1668     esac
1669     AC_MSG_RESULT([$ac_prog_version])
1670   fi
1671   if test $ac_verc_fail = yes; then
1672     INTLBISON=:
1673   fi
1677 AC_DEFUN([AM_MKINSTALLDIRS],
1679   dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1680   dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1681   dnl Try to locate is.
1682   MKINSTALLDIRS=
1683   if test -n "$ac_aux_dir"; then
1684     MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1685   fi
1686   if test -z "$MKINSTALLDIRS"; then
1687     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1688   fi
1689   AC_SUBST(MKINSTALLDIRS)
1693 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
1694 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
1696 # lib-prefix.m4 serial 1 (gettext-0.11)
1697 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
1698 dnl This file is free software, distributed under the terms of the GNU
1699 dnl General Public License.  As a special exception to the GNU General
1700 dnl Public License, this file may be distributed as part of a program
1701 dnl that contains a configuration script generated by Autoconf, under
1702 dnl the same distribution terms as the rest of that program.
1704 dnl From Bruno Haible.
1706 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1707 dnl to access previously installed libraries. The basic assumption is that
1708 dnl a user will want packages to use other packages he previously installed
1709 dnl with the same --prefix option.
1710 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1711 dnl libraries, but is otherwise very convenient.
1712 AC_DEFUN([AC_LIB_PREFIX],
1714   AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1715   AC_REQUIRE([AC_PROG_CC])
1716   AC_REQUIRE([AC_CANONICAL_HOST])
1717   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1718   dnl By default, look in $includedir and $libdir.
1719   use_additional=yes
1720   AC_LIB_WITH_FINAL_PREFIX([
1721     eval additional_includedir=\"$includedir\"
1722     eval additional_libdir=\"$libdir\"
1723   ])
1724   AC_ARG_WITH([lib-prefix],
1725 [  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1726   --without-lib-prefix    don't search for libraries in includedir and libdir],
1728     if test "X$withval" = "Xno"; then
1729       use_additional=no
1730     else
1731       if test "X$withval" = "X"; then
1732         AC_LIB_WITH_FINAL_PREFIX([
1733           eval additional_includedir=\"$includedir\"
1734           eval additional_libdir=\"$libdir\"
1735         ])
1736       else
1737         additional_includedir="$withval/include"
1738         additional_libdir="$withval/lib"
1739       fi
1740     fi
1742   if test $use_additional = yes; then
1743     dnl Potentially add $additional_includedir to $CPPFLAGS.
1744     dnl But don't add it
1745     dnl   1. if it's the standard /usr/include,
1746     dnl   2. if it's already present in $CPPFLAGS,
1747     dnl   3. if it's /usr/local/include and we are using GCC on Linux,
1748     dnl   4. if it doesn't exist as a directory.
1749     if test "X$additional_includedir" != "X/usr/include"; then
1750       haveit=
1751       for x in $CPPFLAGS; do
1752         AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1753         if test "X$x" = "X-I$additional_includedir"; then
1754           haveit=yes
1755           break
1756         fi
1757       done
1758       if test -z "$haveit"; then
1759         if test "X$additional_includedir" = "X/usr/local/include"; then
1760           if test -n "$GCC"; then
1761             case $host_os in
1762               linux*) haveit=yes;;
1763             esac
1764           fi
1765         fi
1766         if test -z "$haveit"; then
1767           if test -d "$additional_includedir"; then
1768             dnl Really add $additional_includedir to $CPPFLAGS.
1769             CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1770           fi
1771         fi
1772       fi
1773     fi
1774     dnl Potentially add $additional_libdir to $LDFLAGS.
1775     dnl But don't add it
1776     dnl   1. if it's the standard /usr/lib,
1777     dnl   2. if it's already present in $LDFLAGS,
1778     dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
1779     dnl   4. if it doesn't exist as a directory.
1780     if test "X$additional_libdir" != "X/usr/lib"; then
1781       haveit=
1782       for x in $LDFLAGS; do
1783         AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1784         if test "X$x" = "X-L$additional_libdir"; then
1785           haveit=yes
1786           break
1787         fi
1788       done
1789       if test -z "$haveit"; then
1790         if test "X$additional_libdir" = "X/usr/local/lib"; then
1791           if test -n "$GCC"; then
1792             case $host_os in
1793               linux*) haveit=yes;;
1794             esac
1795           fi
1796         fi
1797         if test -z "$haveit"; then
1798           if test -d "$additional_libdir"; then
1799             dnl Really add $additional_libdir to $LDFLAGS.
1800             LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1801           fi
1802         fi
1803       fi
1804     fi
1805   fi
1808 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1809 dnl acl_final_exec_prefix, containing the values to which $prefix and
1810 dnl $exec_prefix will expand at the end of the configure script.
1811 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1813   dnl Unfortunately, prefix and exec_prefix get only finally determined
1814   dnl at the end of configure.
1815   if test "X$prefix" = "XNONE"; then
1816     acl_final_prefix="$ac_default_prefix"
1817   else
1818     acl_final_prefix="$prefix"
1819   fi
1820   if test "X$exec_prefix" = "XNONE"; then
1821     acl_final_exec_prefix='${prefix}'
1822   else
1823     acl_final_exec_prefix="$exec_prefix"
1824   fi
1825   acl_save_prefix="$prefix"
1826   prefix="$acl_final_prefix"
1827   eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1828   prefix="$acl_save_prefix"
1831 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1832 dnl variables prefix and exec_prefix bound to the values they will have
1833 dnl at the end of the configure script.
1834 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1836   acl_save_prefix="$prefix"
1837   prefix="$acl_final_prefix"
1838   acl_save_exec_prefix="$exec_prefix"
1839   exec_prefix="$acl_final_exec_prefix"
1840   $1
1841   exec_prefix="$acl_save_exec_prefix"
1842   prefix="$acl_save_prefix"
1845 # lib-link.m4 serial 3 (gettext-0.11.3)
1846 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
1847 dnl This file is free software, distributed under the terms of the GNU
1848 dnl General Public License.  As a special exception to the GNU General
1849 dnl Public License, this file may be distributed as part of a program
1850 dnl that contains a configuration script generated by Autoconf, under
1851 dnl the same distribution terms as the rest of that program.
1853 dnl From Bruno Haible.
1855 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
1856 dnl the libraries corresponding to explicit and implicit dependencies.
1857 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
1858 dnl augments the CPPFLAGS variable.
1859 AC_DEFUN([AC_LIB_LINKFLAGS],
1861   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1862   AC_REQUIRE([AC_LIB_RPATH])
1863   define([Name],[translit([$1],[./-], [___])])
1864   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1865                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1866   AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
1867     AC_LIB_LINKFLAGS_BODY([$1], [$2])
1868     ac_cv_lib[]Name[]_libs="$LIB[]NAME"
1869     ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
1870     ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
1871   ])
1872   LIB[]NAME="$ac_cv_lib[]Name[]_libs"
1873   LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
1874   INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
1875   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1876   AC_SUBST([LIB]NAME)
1877   AC_SUBST([LTLIB]NAME)
1878   dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
1879   dnl results of this search when this library appears as a dependency.
1880   HAVE_LIB[]NAME=yes
1881   undefine([Name])
1882   undefine([NAME])
1885 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
1886 dnl searches for libname and the libraries corresponding to explicit and
1887 dnl implicit dependencies, together with the specified include files and
1888 dnl the ability to compile and link the specified testcode. If found, it
1889 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
1890 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
1891 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
1892 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
1893 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
1895   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1896   AC_REQUIRE([AC_LIB_RPATH])
1897   define([Name],[translit([$1],[./-], [___])])
1898   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1899                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1901   dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
1902   dnl accordingly.
1903   AC_LIB_LINKFLAGS_BODY([$1], [$2])
1905   dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
1906   dnl because if the user has installed lib[]Name and not disabled its use
1907   dnl via --without-lib[]Name-prefix, he wants to use it.
1908   ac_save_CPPFLAGS="$CPPFLAGS"
1909   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1911   AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
1912     ac_save_LIBS="$LIBS"
1913     LIBS="$LIBS $LIB[]NAME"
1914     AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
1915     LIBS="$ac_save_LIBS"
1916   ])
1917   if test "$ac_cv_lib[]Name" = yes; then
1918     HAVE_LIB[]NAME=yes
1919     AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
1920     AC_MSG_CHECKING([how to link with lib[]$1])
1921     AC_MSG_RESULT([$LIB[]NAME])
1922   else
1923     HAVE_LIB[]NAME=no
1924     dnl If $LIB[]NAME didn't lead to a usable library, we don't need
1925     dnl $INC[]NAME either.
1926     CPPFLAGS="$ac_save_CPPFLAGS"
1927     LIB[]NAME=
1928     LTLIB[]NAME=
1929   fi
1930   AC_SUBST([HAVE_LIB]NAME)
1931   AC_SUBST([LIB]NAME)
1932   AC_SUBST([LTLIB]NAME)
1933   undefine([Name])
1934   undefine([NAME])
1937 dnl Determine the platform dependent parameters needed to use rpath:
1938 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
1939 dnl hardcode_direct, hardcode_minus_L,
1940 dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec.
1941 AC_DEFUN([AC_LIB_RPATH],
1943   AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
1944   AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
1945   AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
1946   AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
1947   AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
1948     CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
1949     ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
1950     . ./conftest.sh
1951     rm -f ./conftest.sh
1952     acl_cv_rpath=done
1953   ])
1954   wl="$acl_cv_wl"
1955   libext="$acl_cv_libext"
1956   shlibext="$acl_cv_shlibext"
1957   hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
1958   hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
1959   hardcode_direct="$acl_cv_hardcode_direct"
1960   hardcode_minus_L="$acl_cv_hardcode_minus_L"
1961   sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec"
1962   sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec"
1963   dnl Determine whether the user wants rpath handling at all.
1964   AC_ARG_ENABLE(rpath,
1965     [  --disable-rpath         do not hardcode runtime library paths],
1966     :, enable_rpath=yes)
1969 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
1970 dnl the libraries corresponding to explicit and implicit dependencies.
1971 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
1972 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
1974   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1975                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1976   dnl By default, look in $includedir and $libdir.
1977   use_additional=yes
1978   AC_LIB_WITH_FINAL_PREFIX([
1979     eval additional_includedir=\"$includedir\"
1980     eval additional_libdir=\"$libdir\"
1981   ])
1982   AC_ARG_WITH([lib$1-prefix],
1983 [  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
1984   --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
1986     if test "X$withval" = "Xno"; then
1987       use_additional=no
1988     else
1989       if test "X$withval" = "X"; then
1990         AC_LIB_WITH_FINAL_PREFIX([
1991           eval additional_includedir=\"$includedir\"
1992           eval additional_libdir=\"$libdir\"
1993         ])
1994       else
1995         additional_includedir="$withval/include"
1996         additional_libdir="$withval/lib"
1997       fi
1998     fi
2000   dnl Search the library and its dependencies in $additional_libdir and
2001   dnl $LDFLAGS. Using breadth-first-seach.
2002   LIB[]NAME=
2003   LTLIB[]NAME=
2004   INC[]NAME=
2005   rpathdirs=
2006   ltrpathdirs=
2007   names_already_handled=
2008   names_next_round='$1 $2'
2009   while test -n "$names_next_round"; do
2010     names_this_round="$names_next_round"
2011     names_next_round=
2012     for name in $names_this_round; do
2013       already_handled=
2014       for n in $names_already_handled; do
2015         if test "$n" = "$name"; then
2016           already_handled=yes
2017           break
2018         fi
2019       done
2020       if test -z "$already_handled"; then
2021         names_already_handled="$names_already_handled $name"
2022         dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
2023         dnl or AC_LIB_HAVE_LINKFLAGS call.
2024         uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
2025         eval value=\"\$HAVE_LIB$uppername\"
2026         if test -n "$value"; then
2027           if test "$value" = yes; then
2028             eval value=\"\$LIB$uppername\"
2029             test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
2030             eval value=\"\$LTLIB$uppername\"
2031             test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
2032           else
2033             dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
2034             dnl that this library doesn't exist. So just drop it.
2035             :
2036           fi
2037         else
2038           dnl Search the library lib$name in $additional_libdir and $LDFLAGS
2039           dnl and the already constructed $LIBNAME/$LTLIBNAME.
2040           found_dir=
2041           found_la=
2042           found_so=
2043           found_a=
2044           if test $use_additional = yes; then
2045             if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
2046               found_dir="$additional_libdir"
2047               found_so="$additional_libdir/lib$name.$shlibext"
2048               if test -f "$additional_libdir/lib$name.la"; then
2049                 found_la="$additional_libdir/lib$name.la"
2050               fi
2051             else
2052               if test -f "$additional_libdir/lib$name.$libext"; then
2053                 found_dir="$additional_libdir"
2054                 found_a="$additional_libdir/lib$name.$libext"
2055                 if test -f "$additional_libdir/lib$name.la"; then
2056                   found_la="$additional_libdir/lib$name.la"
2057                 fi
2058               fi
2059             fi
2060           fi
2061           if test "X$found_dir" = "X"; then
2062             for x in $LDFLAGS $LTLIB[]NAME; do
2063               AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2064               case "$x" in
2065                 -L*)
2066                   dir=`echo "X$x" | sed -e 's/^X-L//'`
2067                   if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
2068                     found_dir="$dir"
2069                     found_so="$dir/lib$name.$shlibext"
2070                     if test -f "$dir/lib$name.la"; then
2071                       found_la="$dir/lib$name.la"
2072                     fi
2073                   else
2074                     if test -f "$dir/lib$name.$libext"; then
2075                       found_dir="$dir"
2076                       found_a="$dir/lib$name.$libext"
2077                       if test -f "$dir/lib$name.la"; then
2078                         found_la="$dir/lib$name.la"
2079                       fi
2080                     fi
2081                   fi
2082                   ;;
2083               esac
2084               if test "X$found_dir" != "X"; then
2085                 break
2086               fi
2087             done
2088           fi
2089           if test "X$found_dir" != "X"; then
2090             dnl Found the library.
2091             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
2092             if test "X$found_so" != "X"; then
2093               dnl Linking with a shared library. We attempt to hardcode its
2094               dnl directory into the executable's runpath, unless it's the
2095               dnl standard /usr/lib.
2096               if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
2097                 dnl No hardcoding is needed.
2098                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2099               else
2100                 dnl Use an explicit option to hardcode DIR into the resulting
2101                 dnl binary.
2102                 dnl Potentially add DIR to ltrpathdirs.
2103                 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
2104                 haveit=
2105                 for x in $ltrpathdirs; do
2106                   if test "X$x" = "X$found_dir"; then
2107                     haveit=yes
2108                     break
2109                   fi
2110                 done
2111                 if test -z "$haveit"; then
2112                   ltrpathdirs="$ltrpathdirs $found_dir"
2113                 fi
2114                 dnl The hardcoding into $LIBNAME is system dependent.
2115                 if test "$hardcode_direct" = yes; then
2116                   dnl Using DIR/libNAME.so during linking hardcodes DIR into the
2117                   dnl resulting binary.
2118                   LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2119                 else
2120                   if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
2121                     dnl Use an explicit option to hardcode DIR into the resulting
2122                     dnl binary.
2123                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2124                     dnl Potentially add DIR to rpathdirs.
2125                     dnl The rpathdirs will be appended to $LIBNAME at the end.
2126                     haveit=
2127                     for x in $rpathdirs; do
2128                       if test "X$x" = "X$found_dir"; then
2129                         haveit=yes
2130                         break
2131                       fi
2132                     done
2133                     if test -z "$haveit"; then
2134                       rpathdirs="$rpathdirs $found_dir"
2135                     fi
2136                   else
2137                     dnl Rely on "-L$found_dir".
2138                     dnl But don't add it if it's already contained in the LDFLAGS
2139                     dnl or the already constructed $LIBNAME
2140                     haveit=
2141                     for x in $LDFLAGS $LIB[]NAME; do
2142                       AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2143                       if test "X$x" = "X-L$found_dir"; then
2144                         haveit=yes
2145                         break
2146                       fi
2147                     done
2148                     if test -z "$haveit"; then
2149                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
2150                     fi
2151                     if test "$hardcode_minus_L" != no; then
2152                       dnl FIXME: Not sure whether we should use
2153                       dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
2154                       dnl here.
2155                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2156                     else
2157                       dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
2158                       dnl here, because this doesn't fit in flags passed to the
2159                       dnl compiler. So give up. No hardcoding. This affects only
2160                       dnl very old systems.
2161                       dnl FIXME: Not sure whether we should use
2162                       dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
2163                       dnl here.
2164                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2165                     fi
2166                   fi
2167                 fi
2168               fi
2169             else
2170               if test "X$found_a" != "X"; then
2171                 dnl Linking with a static library.
2172                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
2173               else
2174                 dnl We shouldn't come here, but anyway it's good to have a
2175                 dnl fallback.
2176                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
2177               fi
2178             fi
2179             dnl Assume the include files are nearby.
2180             additional_includedir=
2181             case "$found_dir" in
2182               */lib | */lib/)
2183                 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
2184                 additional_includedir="$basedir/include"
2185                 ;;
2186             esac
2187             if test "X$additional_includedir" != "X"; then
2188               dnl Potentially add $additional_includedir to $INCNAME.
2189               dnl But don't add it
2190               dnl   1. if it's the standard /usr/include,
2191               dnl   2. if it's /usr/local/include and we are using GCC on Linux,
2192               dnl   3. if it's already present in $CPPFLAGS or the already
2193               dnl      constructed $INCNAME,
2194               dnl   4. if it doesn't exist as a directory.
2195               if test "X$additional_includedir" != "X/usr/include"; then
2196                 haveit=
2197                 if test "X$additional_includedir" = "X/usr/local/include"; then
2198                   if test -n "$GCC"; then
2199                     case $host_os in
2200                       linux*) haveit=yes;;
2201                     esac
2202                   fi
2203                 fi
2204                 if test -z "$haveit"; then
2205                   for x in $CPPFLAGS $INC[]NAME; do
2206                     AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2207                     if test "X$x" = "X-I$additional_includedir"; then
2208                       haveit=yes
2209                       break
2210                     fi
2211                   done
2212                   if test -z "$haveit"; then
2213                     if test -d "$additional_includedir"; then
2214                       dnl Really add $additional_includedir to $INCNAME.
2215                       INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
2216                     fi
2217                   fi
2218                 fi
2219               fi
2220             fi
2221             dnl Look for dependencies.
2222             if test -n "$found_la"; then
2223               dnl Read the .la file. It defines the variables
2224               dnl dlname, library_names, old_library, dependency_libs, current,
2225               dnl age, revision, installed, dlopen, dlpreopen, libdir.
2226               save_libdir="$libdir"
2227               case "$found_la" in
2228                 */* | *\\*) . "$found_la" ;;
2229                 *) . "./$found_la" ;;
2230               esac
2231               libdir="$save_libdir"
2232               dnl We use only dependency_libs.
2233               for dep in $dependency_libs; do
2234                 case "$dep" in
2235                   -L*)
2236                     additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
2237                     dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
2238                     dnl But don't add it
2239                     dnl   1. if it's the standard /usr/lib,
2240                     dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
2241                     dnl   3. if it's already present in $LDFLAGS or the already
2242                     dnl      constructed $LIBNAME,
2243                     dnl   4. if it doesn't exist as a directory.
2244                     if test "X$additional_libdir" != "X/usr/lib"; then
2245                       haveit=
2246                       if test "X$additional_libdir" = "X/usr/local/lib"; then
2247                         if test -n "$GCC"; then
2248                           case $host_os in
2249                             linux*) haveit=yes;;
2250                           esac
2251                         fi
2252                       fi
2253                       if test -z "$haveit"; then
2254                         haveit=
2255                         for x in $LDFLAGS $LIB[]NAME; do
2256                           AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2257                           if test "X$x" = "X-L$additional_libdir"; then
2258                             haveit=yes
2259                             break
2260                           fi
2261                         done
2262                         if test -z "$haveit"; then
2263                           if test -d "$additional_libdir"; then
2264                             dnl Really add $additional_libdir to $LIBNAME.
2265                             LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
2266                           fi
2267                         fi
2268                         haveit=
2269                         for x in $LDFLAGS $LTLIB[]NAME; do
2270                           AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2271                           if test "X$x" = "X-L$additional_libdir"; then
2272                             haveit=yes
2273                             break
2274                           fi
2275                         done
2276                         if test -z "$haveit"; then
2277                           if test -d "$additional_libdir"; then
2278                             dnl Really add $additional_libdir to $LTLIBNAME.
2279                             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
2280                           fi
2281                         fi
2282                       fi
2283                     fi
2284                     ;;
2285                   -R*)
2286                     dir=`echo "X$dep" | sed -e 's/^X-R//'`
2287                     if test "$enable_rpath" != no; then
2288                       dnl Potentially add DIR to rpathdirs.
2289                       dnl The rpathdirs will be appended to $LIBNAME at the end.
2290                       haveit=
2291                       for x in $rpathdirs; do
2292                         if test "X$x" = "X$dir"; then
2293                           haveit=yes
2294                           break
2295                         fi
2296                       done
2297                       if test -z "$haveit"; then
2298                         rpathdirs="$rpathdirs $dir"
2299                       fi
2300                       dnl Potentially add DIR to ltrpathdirs.
2301                       dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
2302                       haveit=
2303                       for x in $ltrpathdirs; do
2304                         if test "X$x" = "X$dir"; then
2305                           haveit=yes
2306                           break
2307                         fi
2308                       done
2309                       if test -z "$haveit"; then
2310                         ltrpathdirs="$ltrpathdirs $dir"
2311                       fi
2312                     fi
2313                     ;;
2314                   -l*)
2315                     dnl Handle this in the next round.
2316                     names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
2317                     ;;
2318                   *.la)
2319                     dnl Handle this in the next round. Throw away the .la's
2320                     dnl directory; it is already contained in a preceding -L
2321                     dnl option.
2322                     names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
2323                     ;;
2324                   *)
2325                     dnl Most likely an immediate library name.
2326                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
2327                     LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
2328                     ;;
2329                 esac
2330               done
2331             fi
2332           else
2333             dnl Didn't find the library; assume it is in the system directories
2334             dnl known to the linker and runtime loader. (All the system
2335             dnl directories known to the linker should also be known to the
2336             dnl runtime loader, otherwise the system is severely misconfigured.)
2337             LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2338             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
2339           fi
2340         fi
2341       fi
2342     done
2343   done
2344   if test "X$rpathdirs" != "X"; then
2345     if test -n "$hardcode_libdir_separator"; then
2346       dnl Weird platform: only the last -rpath option counts, the user must
2347       dnl pass all path elements in one option. We can arrange that for a
2348       dnl single library, but not when more than one $LIBNAMEs are used.
2349       alldirs=
2350       for found_dir in $rpathdirs; do
2351         alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
2352       done
2353       dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
2354       acl_save_libdir="$libdir"
2355       libdir="$alldirs"
2356       eval flag=\"$hardcode_libdir_flag_spec\"
2357       libdir="$acl_save_libdir"
2358       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2359     else
2360       dnl The -rpath options are cumulative.
2361       for found_dir in $rpathdirs; do
2362         acl_save_libdir="$libdir"
2363         libdir="$found_dir"
2364         eval flag=\"$hardcode_libdir_flag_spec\"
2365         libdir="$acl_save_libdir"
2366         LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2367       done
2368     fi
2369   fi
2370   if test "X$ltrpathdirs" != "X"; then
2371     dnl When using libtool, the option that works for both libraries and
2372     dnl executables is -R. The -R options are cumulative.
2373     for found_dir in $ltrpathdirs; do
2374       LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
2375     done
2376   fi
2379 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
2380 dnl unless already present in VAR.
2381 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
2382 dnl contains two or three consecutive elements that belong together.
2383 AC_DEFUN([AC_LIB_APPENDTOVAR],
2385   for element in [$2]; do
2386     haveit=
2387     for x in $[$1]; do
2388       AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2389       if test "X$x" = "X$element"; then
2390         haveit=yes
2391         break
2392       fi
2393     done
2394     if test -z "$haveit"; then
2395       [$1]="${[$1]}${[$1]:+ }$element"
2396     fi
2397   done
2400 # lib-ld.m4 serial 1 (gettext-0.11)
2401 dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
2402 dnl This file is free software, distributed under the terms of the GNU
2403 dnl General Public License.  As a special exception to the GNU General
2404 dnl Public License, this file may be distributed as part of a program
2405 dnl that contains a configuration script generated by Autoconf, under
2406 dnl the same distribution terms as the rest of that program.
2408 dnl Subroutines of libtool.m4,
2409 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
2410 dnl with libtool.m4.
2412 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
2413 AC_DEFUN([AC_LIB_PROG_LD_GNU],
2414 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
2415 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
2416 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2417   acl_cv_prog_gnu_ld=yes
2418 else
2419   acl_cv_prog_gnu_ld=no
2420 fi])
2421 with_gnu_ld=$acl_cv_prog_gnu_ld
2424 dnl From libtool-1.4. Sets the variable LD.
2425 AC_DEFUN([AC_LIB_PROG_LD],
2426 [AC_ARG_WITH(gnu-ld,
2427 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
2428 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
2429 AC_REQUIRE([AC_PROG_CC])dnl
2430 AC_REQUIRE([AC_CANONICAL_HOST])dnl
2431 ac_prog=ld
2432 if test "$GCC" = yes; then
2433   # Check if gcc -print-prog-name=ld gives a path.
2434   AC_MSG_CHECKING([for ld used by GCC])
2435   case $host in
2436   *-*-mingw*)
2437     # gcc leaves a trailing carriage return which upsets mingw
2438     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
2439   *)
2440     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
2441   esac
2442   case $ac_prog in
2443     # Accept absolute paths.
2444     [[\\/]* | [A-Za-z]:[\\/]*)]
2445       [re_direlt='/[^/][^/]*/\.\./']
2446       # Canonicalize the path of ld
2447       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
2448       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2449         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
2450       done
2451       test -z "$LD" && LD="$ac_prog"
2452       ;;
2453   "")
2454     # If it fails, then pretend we aren't using GCC.
2455     ac_prog=ld
2456     ;;
2457   *)
2458     # If it is relative, then search for the first ld in PATH.
2459     with_gnu_ld=unknown
2460     ;;
2461   esac
2462 elif test "$with_gnu_ld" = yes; then
2463   AC_MSG_CHECKING([for GNU ld])
2464 else
2465   AC_MSG_CHECKING([for non-GNU ld])
2467 AC_CACHE_VAL(acl_cv_path_LD,
2468 [if test -z "$LD"; then
2469   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2470   for ac_dir in $PATH; do
2471     test -z "$ac_dir" && ac_dir=.
2472     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2473       acl_cv_path_LD="$ac_dir/$ac_prog"
2474       # Check to see if the program is GNU ld.  I'd rather use --version,
2475       # but apparently some GNU ld's only accept -v.
2476       # Break only if it was the GNU/non-GNU ld that we prefer.
2477       if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2478         test "$with_gnu_ld" != no && break
2479       else
2480         test "$with_gnu_ld" != yes && break
2481       fi
2482     fi
2483   done
2484   IFS="$ac_save_ifs"
2485 else
2486   acl_cv_path_LD="$LD" # Let the user override the test with a path.
2487 fi])
2488 LD="$acl_cv_path_LD"
2489 if test -n "$LD"; then
2490   AC_MSG_RESULT($LD)
2491 else
2492   AC_MSG_RESULT(no)
2494 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
2495 AC_LIB_PROG_LD_GNU
2498 # iconv.m4 serial AM4 (gettext-0.11.3)
2499 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2500 dnl This file is free software, distributed under the terms of the GNU
2501 dnl General Public License.  As a special exception to the GNU General
2502 dnl Public License, this file may be distributed as part of a program
2503 dnl that contains a configuration script generated by Autoconf, under
2504 dnl the same distribution terms as the rest of that program.
2506 dnl From Bruno Haible.
2508 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
2510   dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
2511   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2512   AC_REQUIRE([AC_LIB_RPATH])
2514   dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
2515   dnl accordingly.
2516   AC_LIB_LINKFLAGS_BODY([iconv])
2519 AC_DEFUN([AM_ICONV_LINK],
2521   dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
2522   dnl those with the standalone portable GNU libiconv installed).
2524   dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
2525   dnl accordingly.
2526   AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
2528   dnl Add $INCICONV to CPPFLAGS before performing the following checks,
2529   dnl because if the user has installed libiconv and not disabled its use
2530   dnl via --without-libiconv-prefix, he wants to use it. The first
2531   dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
2532   am_save_CPPFLAGS="$CPPFLAGS"
2533   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
2535   AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
2536     am_cv_func_iconv="no, consider installing GNU libiconv"
2537     am_cv_lib_iconv=no
2538     AC_TRY_LINK([#include <stdlib.h>
2539 #include <iconv.h>],
2540       [iconv_t cd = iconv_open("","");
2541        iconv(cd,NULL,NULL,NULL,NULL);
2542        iconv_close(cd);],
2543       am_cv_func_iconv=yes)
2544     if test "$am_cv_func_iconv" != yes; then
2545       am_save_LIBS="$LIBS"
2546       LIBS="$LIBS $LIBICONV"
2547       AC_TRY_LINK([#include <stdlib.h>
2548 #include <iconv.h>],
2549         [iconv_t cd = iconv_open("","");
2550          iconv(cd,NULL,NULL,NULL,NULL);
2551          iconv_close(cd);],
2552         am_cv_lib_iconv=yes
2553         am_cv_func_iconv=yes)
2554       LIBS="$am_save_LIBS"
2555     fi
2556   ])
2557   if test "$am_cv_func_iconv" = yes; then
2558     AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
2559   fi
2560   if test "$am_cv_lib_iconv" = yes; then
2561     AC_MSG_CHECKING([how to link with libiconv])
2562     AC_MSG_RESULT([$LIBICONV])
2563   else
2564     dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
2565     dnl either.
2566     CPPFLAGS="$am_save_CPPFLAGS"
2567     LIBICONV=
2568     LTLIBICONV=
2569   fi
2570   AC_SUBST(LIBICONV)
2571   AC_SUBST(LTLIBICONV)
2574 AC_DEFUN([AM_ICONV],
2576   AM_ICONV_LINK
2577   if test "$am_cv_func_iconv" = yes; then
2578     AC_MSG_CHECKING([for iconv declaration])
2579     AC_CACHE_VAL(am_cv_proto_iconv, [
2580       AC_TRY_COMPILE([
2581 #include <stdlib.h>
2582 #include <iconv.h>
2583 extern
2584 #ifdef __cplusplus
2586 #endif
2587 #if defined(__STDC__) || defined(__cplusplus)
2588 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
2589 #else
2590 size_t iconv();
2591 #endif
2592 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
2593       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);"])
2594     am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
2595     AC_MSG_RESULT([$]{ac_t:-
2596          }[$]am_cv_proto_iconv)
2597     AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
2598       [Define as const if the declaration of iconv() needs const.])
2599   fi
2602 # progtest.m4 serial 2 (gettext-0.10.40)
2603 dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
2604 dnl This file is free software, distributed under the terms of the GNU
2605 dnl General Public License.  As a special exception to the GNU General
2606 dnl Public License, this file may be distributed as part of a program
2607 dnl that contains a configuration script generated by Autoconf, under
2608 dnl the same distribution terms as the rest of that program.
2610 dnl This file can can be used in projects which are not available under
2611 dnl the GNU General Public License or the GNU Library General Public
2612 dnl License but which still want to provide support for the GNU gettext
2613 dnl functionality.
2614 dnl Please note that the actual code of the GNU gettext library is covered
2615 dnl by the GNU Library General Public License, and the rest of the GNU
2616 dnl gettext package package is covered by the GNU General Public License.
2617 dnl They are *not* in the public domain.
2619 dnl Authors:
2620 dnl   Ulrich Drepper <drepper@cygnus.com>, 1996.
2622 # Search path for a program which passes the given test.
2624 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
2625 dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2626 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
2627 [# Extract the first word of "$2", so it can be a program name with args.
2628 set dummy $2; ac_word=[$]2
2629 AC_MSG_CHECKING([for $ac_word])
2630 AC_CACHE_VAL(ac_cv_path_$1,
2631 [case "[$]$1" in
2632   /*)
2633   ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2634   ;;
2635   *)
2636   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2637   for ac_dir in ifelse([$5], , $PATH, [$5]); do
2638     test -z "$ac_dir" && ac_dir=.
2639     if test -f $ac_dir/$ac_word; then
2640       if [$3]; then
2641         ac_cv_path_$1="$ac_dir/$ac_word"
2642         break
2643       fi
2644     fi
2645   done
2646   IFS="$ac_save_ifs"
2647 dnl If no 4th arg is given, leave the cache variable unset,
2648 dnl so AC_PATH_PROGS will keep looking.
2649 ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2650 ])dnl
2651   ;;
2652 esac])dnl
2653 $1="$ac_cv_path_$1"
2654 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
2655   AC_MSG_RESULT([$]$1)
2656 else
2657   AC_MSG_RESULT(no)
2659 AC_SUBST($1)dnl
2662 # isc-posix.m4 serial 2 (gettext-0.11.2)
2663 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
2664 dnl This file is free software, distributed under the terms of the GNU
2665 dnl General Public License.  As a special exception to the GNU General
2666 dnl Public License, this file may be distributed as part of a program
2667 dnl that contains a configuration script generated by Autoconf, under
2668 dnl the same distribution terms as the rest of that program.
2670 # This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
2672 # This test replaces the one in autoconf.
2673 # Currently this macro should have the same name as the autoconf macro
2674 # because gettext's gettext.m4 (distributed in the automake package)
2675 # still uses it.  Otherwise, the use in gettext.m4 makes autoheader
2676 # give these diagnostics:
2677 #   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
2678 #   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
2680 undefine([AC_ISC_POSIX])
2682 AC_DEFUN([AC_ISC_POSIX],
2683   [
2684     dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
2685     AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
2686   ]
2689 # glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
2690 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2691 dnl This file is free software, distributed under the terms of the GNU
2692 dnl General Public License.  As a special exception to the GNU General
2693 dnl Public License, this file may be distributed as part of a program
2694 dnl that contains a configuration script generated by Autoconf, under
2695 dnl the same distribution terms as the rest of that program.
2697 # Test for the GNU C Library, version 2.1 or newer.
2698 # From Bruno Haible.
2700 AC_DEFUN([jm_GLIBC21],
2701   [
2702     AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
2703       ac_cv_gnu_library_2_1,
2704       [AC_EGREP_CPP([Lucky GNU user],
2705         [
2706 #include <features.h>
2707 #ifdef __GNU_LIBRARY__
2708  #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
2709   Lucky GNU user
2710  #endif
2711 #endif
2712         ],
2713         ac_cv_gnu_library_2_1=yes,
2714         ac_cv_gnu_library_2_1=no)
2715       ]
2716     )
2717     AC_SUBST(GLIBC21)
2718     GLIBC21="$ac_cv_gnu_library_2_1"
2719   ]
2722 # intdiv0.m4 serial 1 (gettext-0.11.3)
2723 dnl Copyright (C) 2002 Free Software Foundation, Inc.
2724 dnl This file is free software, distributed under the terms of the GNU
2725 dnl General Public License.  As a special exception to the GNU General
2726 dnl Public License, this file may be distributed as part of a program
2727 dnl that contains a configuration script generated by Autoconf, under
2728 dnl the same distribution terms as the rest of that program.
2730 dnl From Bruno Haible.
2732 AC_DEFUN([gt_INTDIV0],
2734   AC_REQUIRE([AC_PROG_CC])dnl
2735   AC_REQUIRE([AC_CANONICAL_HOST])dnl
2737   AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
2738     gt_cv_int_divbyzero_sigfpe,
2739     [
2740       AC_TRY_RUN([
2741 #include <stdlib.h>
2742 #include <signal.h>
2744 static void
2745 #ifdef __cplusplus
2746 sigfpe_handler (int sig)
2747 #else
2748 sigfpe_handler (sig) int sig;
2749 #endif
2751   /* Exit with code 0 if SIGFPE, with code 1 if any other signal.  */
2752   exit (sig != SIGFPE);
2755 int x = 1;
2756 int y = 0;
2757 int z;
2758 int nan;
2760 int main ()
2762   signal (SIGFPE, sigfpe_handler);
2763 /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP.  */
2764 #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
2765   signal (SIGTRAP, sigfpe_handler);
2766 #endif
2767 /* Linux/SPARC yields signal SIGILL.  */
2768 #if defined (__sparc__) && defined (__linux__)
2769   signal (SIGILL, sigfpe_handler);
2770 #endif
2772   z = x / y;
2773   nan = y / y;
2774   exit (1);
2776 ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
2777         [
2778           # Guess based on the CPU.
2779           case "$host_cpu" in
2780             alpha* | i[34567]86 | m68k | s390*)
2781               gt_cv_int_divbyzero_sigfpe="guessing yes";;
2782             *)
2783               gt_cv_int_divbyzero_sigfpe="guessing no";;
2784           esac
2785         ])
2786     ])
2787   case "$gt_cv_int_divbyzero_sigfpe" in
2788     *yes) value=1;;
2789     *) value=0;;
2790   esac
2791   AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
2792     [Define if integer division by zero raises signal SIGFPE.])
2795 # uintmax_t.m4 serial 6 (gettext-0.11)
2796 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2797 dnl This file is free software, distributed under the terms of the GNU
2798 dnl General Public License.  As a special exception to the GNU General
2799 dnl Public License, this file may be distributed as part of a program
2800 dnl that contains a configuration script generated by Autoconf, under
2801 dnl the same distribution terms as the rest of that program.
2803 dnl From Paul Eggert.
2805 AC_PREREQ(2.13)
2807 # Define uintmax_t to `unsigned long' or `unsigned long long'
2808 # if <inttypes.h> does not exist.
2810 AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
2812   AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
2813   AC_REQUIRE([jm_AC_HEADER_STDINT_H])
2814   if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
2815     AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
2816     test $ac_cv_type_unsigned_long_long = yes \
2817       && ac_type='unsigned long long' \
2818       || ac_type='unsigned long'
2819     AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
2820   [Define to unsigned long or unsigned long long
2821    if <inttypes.h> and <stdint.h> don't define.])
2822   fi
2825 # inttypes_h.m4 serial 4 (gettext-0.11.4)
2826 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2827 dnl This file is free software, distributed under the terms of the GNU
2828 dnl General Public License.  As a special exception to the GNU General
2829 dnl Public License, this file may be distributed as part of a program
2830 dnl that contains a configuration script generated by Autoconf, under
2831 dnl the same distribution terms as the rest of that program.
2833 dnl From Paul Eggert.
2835 # Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
2836 # doesn't clash with <sys/types.h>, and declares uintmax_t.
2838 AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
2840   AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
2841   [AC_TRY_COMPILE(
2842     [#include <sys/types.h>
2843 #include <inttypes.h>],
2844     [uintmax_t i = (uintmax_t) -1;],
2845     jm_ac_cv_header_inttypes_h=yes,
2846     jm_ac_cv_header_inttypes_h=no)])
2847   if test $jm_ac_cv_header_inttypes_h = yes; then
2848     AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
2849 [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
2850    and declares uintmax_t. ])
2851   fi
2854 # stdint_h.m4 serial 2 (gettext-0.11.4)
2855 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2856 dnl This file is free software, distributed under the terms of the GNU
2857 dnl General Public License.  As a special exception to the GNU General
2858 dnl Public License, this file may be distributed as part of a program
2859 dnl that contains a configuration script generated by Autoconf, under
2860 dnl the same distribution terms as the rest of that program.
2862 dnl From Paul Eggert.
2864 # Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
2865 # doesn't clash with <sys/types.h>, and declares uintmax_t.
2867 AC_DEFUN([jm_AC_HEADER_STDINT_H],
2869   AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
2870   [AC_TRY_COMPILE(
2871     [#include <sys/types.h>
2872 #include <stdint.h>],
2873     [uintmax_t i = (uintmax_t) -1;],
2874     jm_ac_cv_header_stdint_h=yes,
2875     jm_ac_cv_header_stdint_h=no)])
2876   if test $jm_ac_cv_header_stdint_h = yes; then
2877     AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
2878 [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
2879    and declares uintmax_t. ])
2880   fi
2883 # ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40)
2884 dnl Copyright (C) 1999-2002 Free Software Foundation, Inc.
2885 dnl This file is free software, distributed under the terms of the GNU
2886 dnl General Public License.  As a special exception to the GNU General
2887 dnl Public License, this file may be distributed as part of a program
2888 dnl that contains a configuration script generated by Autoconf, under
2889 dnl the same distribution terms as the rest of that program.
2891 dnl From Paul Eggert.
2893 AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
2895   AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
2896   [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
2897     [unsigned long long ullmax = (unsigned long long) -1;
2898      return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
2899     ac_cv_type_unsigned_long_long=yes,
2900     ac_cv_type_unsigned_long_long=no)])
2901   if test $ac_cv_type_unsigned_long_long = yes; then
2902     AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
2903       [Define if you have the unsigned long long type.])
2904   fi
2907 # inttypes.m4 serial 1 (gettext-0.11.4)
2908 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2909 dnl This file is free software, distributed under the terms of the GNU
2910 dnl General Public License.  As a special exception to the GNU General
2911 dnl Public License, this file may be distributed as part of a program
2912 dnl that contains a configuration script generated by Autoconf, under
2913 dnl the same distribution terms as the rest of that program.
2915 dnl From Paul Eggert.
2917 # Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
2918 # <sys/types.h>.
2920 AC_DEFUN([gt_HEADER_INTTYPES_H],
2922   AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
2923   [
2924     AC_TRY_COMPILE(
2925       [#include <sys/types.h>
2926 #include <inttypes.h>],
2927       [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
2928   ])
2929   if test $gt_cv_header_inttypes_h = yes; then
2930     AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
2931       [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
2932   fi
2935 # inttypes-pri.m4 serial 1 (gettext-0.11.4)
2936 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2937 dnl This file is free software, distributed under the terms of the GNU
2938 dnl General Public License.  As a special exception to the GNU General
2939 dnl Public License, this file may be distributed as part of a program
2940 dnl that contains a configuration script generated by Autoconf, under
2941 dnl the same distribution terms as the rest of that program.
2943 dnl From Bruno Haible.
2945 # Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
2946 # macros to non-string values.  This is the case on AIX 4.3.3.
2948 AC_DEFUN([gt_INTTYPES_PRI],
2950   AC_REQUIRE([gt_HEADER_INTTYPES_H])
2951   if test $gt_cv_header_inttypes_h = yes; then
2952     AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
2953       gt_cv_inttypes_pri_broken,
2954       [
2955         AC_TRY_COMPILE([#include <inttypes.h>
2956 #ifdef PRId32
2957 char *p = PRId32;
2958 #endif
2959 ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
2960       ])
2961   fi
2962   if test "$gt_cv_inttypes_pri_broken" = yes; then
2963     AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
2964       [Define if <inttypes.h> exists and defines unusable PRI* macros.])
2965   fi
2968 # codeset.m4 serial AM1 (gettext-0.10.40)
2969 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2970 dnl This file is free software, distributed under the terms of the GNU
2971 dnl General Public License.  As a special exception to the GNU General
2972 dnl Public License, this file may be distributed as part of a program
2973 dnl that contains a configuration script generated by Autoconf, under
2974 dnl the same distribution terms as the rest of that program.
2976 dnl From Bruno Haible.
2978 AC_DEFUN([AM_LANGINFO_CODESET],
2980   AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
2981     [AC_TRY_LINK([#include <langinfo.h>],
2982       [char* cs = nl_langinfo(CODESET);],
2983       am_cv_langinfo_codeset=yes,
2984       am_cv_langinfo_codeset=no)
2985     ])
2986   if test $am_cv_langinfo_codeset = yes; then
2987     AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
2988       [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
2989   fi
2992 # lcmessage.m4 serial 3 (gettext-0.11.3)
2993 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
2994 dnl This file is free software, distributed under the terms of the GNU
2995 dnl General Public License.  As a special exception to the GNU General
2996 dnl Public License, this file may be distributed as part of a program
2997 dnl that contains a configuration script generated by Autoconf, under
2998 dnl the same distribution terms as the rest of that program.
3000 dnl This file can can be used in projects which are not available under
3001 dnl the GNU General Public License or the GNU Library General Public
3002 dnl License but which still want to provide support for the GNU gettext
3003 dnl functionality.
3004 dnl Please note that the actual code of the GNU gettext library is covered
3005 dnl by the GNU Library General Public License, and the rest of the GNU
3006 dnl gettext package package is covered by the GNU General Public License.
3007 dnl They are *not* in the public domain.
3009 dnl Authors:
3010 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995.
3012 # Check whether LC_MESSAGES is available in <locale.h>.
3014 AC_DEFUN([AM_LC_MESSAGES],
3016   AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
3017     [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
3018        am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
3019   if test $am_cv_val_LC_MESSAGES = yes; then
3020     AC_DEFINE(HAVE_LC_MESSAGES, 1,
3021       [Define if your <locale.h> file defines LC_MESSAGES.])
3022   fi