]> git.decadent.org.uk Git - ap-utils.git/blob - aclocal.m4
Imported Upstream version 1.4.2~pre1~a
[ap-utils.git] / aclocal.m4
1 # generated automatically by aclocal 1.7.9 -*- Autoconf -*-
2
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.
8
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.
13
14 # Do all the work for Automake.                            -*- Autoconf -*-
15
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.
18
19 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
20 # Free Software Foundation, Inc.
21
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.
26
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.
31
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.
36
37 # serial 10
38
39 AC_PREREQ([2.54])
40
41 # Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
42 # the ones we care about.
43 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
44
45 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
46 # AM_INIT_AUTOMAKE([OPTIONS])
47 # -----------------------------------------------
48 # The call with PACKAGE and VERSION arguments is the old style
49 # call (pre autoconf-2.50), which is being phased out.  PACKAGE
50 # and VERSION should now be passed to AC_INIT and removed from
51 # the call to AM_INIT_AUTOMAKE.
52 # We support both call styles for the transition.  After
53 # the next Automake release, Autoconf can make the AC_INIT
54 # arguments mandatory, and then we can depend on a new Autoconf
55 # release and drop the old call support.
56 AC_DEFUN([AM_INIT_AUTOMAKE],
57 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
58  AC_REQUIRE([AC_PROG_INSTALL])dnl
59 # test to see if srcdir already configured
60 if test "`cd $srcdir && pwd`" != "`pwd`" &&
61    test -f $srcdir/config.status; then
62   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
63 fi
64
65 # test whether we have cygpath
66 if test -z "$CYGPATH_W"; then
67   if (cygpath --version) >/dev/null 2>/dev/null; then
68     CYGPATH_W='cygpath -w'
69   else
70     CYGPATH_W=echo
71   fi
72 fi
73 AC_SUBST([CYGPATH_W])
74
75 # Define the identity of the package.
76 dnl Distinguish between old-style and new-style calls.
77 m4_ifval([$2],
78 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
79  AC_SUBST([PACKAGE], [$1])dnl
80  AC_SUBST([VERSION], [$2])],
81 [_AM_SET_OPTIONS([$1])dnl
82  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
83  AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
84
85 _AM_IF_OPTION([no-define],,
86 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
87  AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
88
89 # Some tools Automake needs.
90 AC_REQUIRE([AM_SANITY_CHECK])dnl
91 AC_REQUIRE([AC_ARG_PROGRAM])dnl
92 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
93 AM_MISSING_PROG(AUTOCONF, autoconf)
94 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
95 AM_MISSING_PROG(AUTOHEADER, autoheader)
96 AM_MISSING_PROG(MAKEINFO, makeinfo)
97 AM_MISSING_PROG(AMTAR, tar)
98 AM_PROG_INSTALL_SH
99 AM_PROG_INSTALL_STRIP
100 # We need awk for the "check" target.  The system "awk" is bad on
101 # some platforms.
102 AC_REQUIRE([AC_PROG_AWK])dnl
103 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
104 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
105
106 _AM_IF_OPTION([no-dependencies],,
107 [AC_PROVIDE_IFELSE([AC_PROG_CC],
108                   [_AM_DEPENDENCIES(CC)],
109                   [define([AC_PROG_CC],
110                           defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
111 AC_PROVIDE_IFELSE([AC_PROG_CXX],
112                   [_AM_DEPENDENCIES(CXX)],
113                   [define([AC_PROG_CXX],
114                           defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
115 ])
116 ])
117
118
119 # When config.status generates a header, we must update the stamp-h file.
120 # This file resides in the same directory as the config header
121 # that is generated.  The stamp files are numbered to have different names.
122
123 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
124 # loop where config.status creates the headers, so we can generate
125 # our stamp files there.
126 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
127 [# Compute $1's index in $config_headers.
128 _am_stamp_count=1
129 for _am_header in $config_headers :; do
130   case $_am_header in
131     $1 | $1:* )
132       break ;;
133     * )
134       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
135   esac
136 done
137 echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
138
139 # Copyright 2002  Free Software Foundation, Inc.
140
141 # This program is free software; you can redistribute it and/or modify
142 # it under the terms of the GNU General Public License as published by
143 # the Free Software Foundation; either version 2, or (at your option)
144 # any later version.
145
146 # This program is distributed in the hope that it will be useful,
147 # but WITHOUT ANY WARRANTY; without even the implied warranty of
148 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
149 # GNU General Public License for more details.
150
151 # You should have received a copy of the GNU General Public License
152 # along with this program; if not, write to the Free Software
153 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
154
155 # AM_AUTOMAKE_VERSION(VERSION)
156 # ----------------------------
157 # Automake X.Y traces this macro to ensure aclocal.m4 has been
158 # generated from the m4 files accompanying Automake X.Y.
159 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
160
161 # AM_SET_CURRENT_AUTOMAKE_VERSION
162 # -------------------------------
163 # Call AM_AUTOMAKE_VERSION so it can be traced.
164 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
165 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
166          [AM_AUTOMAKE_VERSION([1.7.9])])
167
168 # Helper functions for option handling.                    -*- Autoconf -*-
169
170 # Copyright 2001, 2002  Free Software Foundation, Inc.
171
172 # This program is free software; you can redistribute it and/or modify
173 # it under the terms of the GNU General Public License as published by
174 # the Free Software Foundation; either version 2, or (at your option)
175 # any later version.
176
177 # This program is distributed in the hope that it will be useful,
178 # but WITHOUT ANY WARRANTY; without even the implied warranty of
179 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
180 # GNU General Public License for more details.
181
182 # You should have received a copy of the GNU General Public License
183 # along with this program; if not, write to the Free Software
184 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
185 # 02111-1307, USA.
186
187 # serial 2
188
189 # _AM_MANGLE_OPTION(NAME)
190 # -----------------------
191 AC_DEFUN([_AM_MANGLE_OPTION],
192 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
193
194 # _AM_SET_OPTION(NAME)
195 # ------------------------------
196 # Set option NAME.  Presently that only means defining a flag for this option.
197 AC_DEFUN([_AM_SET_OPTION],
198 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
199
200 # _AM_SET_OPTIONS(OPTIONS)
201 # ----------------------------------
202 # OPTIONS is a space-separated list of Automake options.
203 AC_DEFUN([_AM_SET_OPTIONS],
204 [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
205
206 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
207 # -------------------------------------------
208 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
209 AC_DEFUN([_AM_IF_OPTION],
210 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
211
212 #
213 # Check to make sure that the build environment is sane.
214 #
215
216 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
217
218 # This program is free software; you can redistribute it and/or modify
219 # it under the terms of the GNU General Public License as published by
220 # the Free Software Foundation; either version 2, or (at your option)
221 # any later version.
222
223 # This program is distributed in the hope that it will be useful,
224 # but WITHOUT ANY WARRANTY; without even the implied warranty of
225 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
226 # GNU General Public License for more details.
227
228 # You should have received a copy of the GNU General Public License
229 # along with this program; if not, write to the Free Software
230 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
231 # 02111-1307, USA.
232
233 # serial 3
234
235 # AM_SANITY_CHECK
236 # ---------------
237 AC_DEFUN([AM_SANITY_CHECK],
238 [AC_MSG_CHECKING([whether build environment is sane])
239 # Just in case
240 sleep 1
241 echo timestamp > conftest.file
242 # Do `set' in a subshell so we don't clobber the current shell's
243 # arguments.  Must try -L first in case configure is actually a
244 # symlink; some systems play weird games with the mod time of symlinks
245 # (eg FreeBSD returns the mod time of the symlink's containing
246 # directory).
247 if (
248    set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
249    if test "$[*]" = "X"; then
250       # -L didn't work.
251       set X `ls -t $srcdir/configure conftest.file`
252    fi
253    rm -f conftest.file
254    if test "$[*]" != "X $srcdir/configure conftest.file" \
255       && test "$[*]" != "X conftest.file $srcdir/configure"; then
256
257       # If neither matched, then we have a broken ls.  This can happen
258       # if, for instance, CONFIG_SHELL is bash and it inherits a
259       # broken ls alias from the environment.  This has actually
260       # happened.  Such a system could not be considered "sane".
261       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
262 alias in your environment])
263    fi
264
265    test "$[2]" = conftest.file
266    )
267 then
268    # Ok.
269    :
270 else
271    AC_MSG_ERROR([newly created file is older than distributed files!
272 Check your system clock])
273 fi
274 AC_MSG_RESULT(yes)])
275
276 #  -*- Autoconf -*-
277
278
279 # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
280
281 # This program is free software; you can redistribute it and/or modify
282 # it under the terms of the GNU General Public License as published by
283 # the Free Software Foundation; either version 2, or (at your option)
284 # any later version.
285
286 # This program is distributed in the hope that it will be useful,
287 # but WITHOUT ANY WARRANTY; without even the implied warranty of
288 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
289 # GNU General Public License for more details.
290
291 # You should have received a copy of the GNU General Public License
292 # along with this program; if not, write to the Free Software
293 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
294 # 02111-1307, USA.
295
296 # serial 3
297
298 # AM_MISSING_PROG(NAME, PROGRAM)
299 # ------------------------------
300 AC_DEFUN([AM_MISSING_PROG],
301 [AC_REQUIRE([AM_MISSING_HAS_RUN])
302 $1=${$1-"${am_missing_run}$2"}
303 AC_SUBST($1)])
304
305
306 # AM_MISSING_HAS_RUN
307 # ------------------
308 # Define MISSING if not defined so far and test if it supports --run.
309 # If it does, set am_missing_run to use it, otherwise, to nothing.
310 AC_DEFUN([AM_MISSING_HAS_RUN],
311 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
312 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
313 # Use eval to expand $SHELL
314 if eval "$MISSING --run true"; then
315   am_missing_run="$MISSING --run "
316 else
317   am_missing_run=
318   AC_MSG_WARN([`missing' script is too old or missing])
319 fi
320 ])
321
322 # AM_AUX_DIR_EXPAND
323
324 # Copyright 2001 Free Software Foundation, Inc.
325
326 # This program is free software; you can redistribute it and/or modify
327 # it under the terms of the GNU General Public License as published by
328 # the Free Software Foundation; either version 2, or (at your option)
329 # any later version.
330
331 # This program is distributed in the hope that it will be useful,
332 # but WITHOUT ANY WARRANTY; without even the implied warranty of
333 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
334 # GNU General Public License for more details.
335
336 # You should have received a copy of the GNU General Public License
337 # along with this program; if not, write to the Free Software
338 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
339 # 02111-1307, USA.
340
341 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
342 # $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
343 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
344 #
345 # Of course, Automake must honor this variable whenever it calls a
346 # tool from the auxiliary directory.  The problem is that $srcdir (and
347 # therefore $ac_aux_dir as well) can be either absolute or relative,
348 # depending on how configure is run.  This is pretty annoying, since
349 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
350 # source directory, any form will work fine, but in subdirectories a
351 # relative path needs to be adjusted first.
352 #
353 # $ac_aux_dir/missing
354 #    fails when called from a subdirectory if $ac_aux_dir is relative
355 # $top_srcdir/$ac_aux_dir/missing
356 #    fails if $ac_aux_dir is absolute,
357 #    fails when called from a subdirectory in a VPATH build with
358 #          a relative $ac_aux_dir
359 #
360 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
361 # are both prefixed by $srcdir.  In an in-source build this is usually
362 # harmless because $srcdir is `.', but things will broke when you
363 # start a VPATH build or use an absolute $srcdir.
364 #
365 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
366 # iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
367 #   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
368 # and then we would define $MISSING as
369 #   MISSING="\${SHELL} $am_aux_dir/missing"
370 # This will work as long as MISSING is not called from configure, because
371 # unfortunately $(top_srcdir) has no meaning in configure.
372 # However there are other variables, like CC, which are often used in
373 # configure, and could therefore not use this "fixed" $ac_aux_dir.
374 #
375 # Another solution, used here, is to always expand $ac_aux_dir to an
376 # absolute PATH.  The drawback is that using absolute paths prevent a
377 # configured tree to be moved without reconfiguration.
378
379 # Rely on autoconf to set up CDPATH properly.
380 AC_PREREQ([2.50])
381
382 AC_DEFUN([AM_AUX_DIR_EXPAND], [
383 # expand $ac_aux_dir to an absolute path
384 am_aux_dir=`cd $ac_aux_dir && pwd`
385 ])
386
387 # AM_PROG_INSTALL_SH
388 # ------------------
389 # Define $install_sh.
390
391 # Copyright 2001 Free Software Foundation, Inc.
392
393 # This program is free software; you can redistribute it and/or modify
394 # it under the terms of the GNU General Public License as published by
395 # the Free Software Foundation; either version 2, or (at your option)
396 # any later version.
397
398 # This program is distributed in the hope that it will be useful,
399 # but WITHOUT ANY WARRANTY; without even the implied warranty of
400 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
401 # GNU General Public License for more details.
402
403 # You should have received a copy of the GNU General Public License
404 # along with this program; if not, write to the Free Software
405 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
406 # 02111-1307, USA.
407
408 AC_DEFUN([AM_PROG_INSTALL_SH],
409 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
410 install_sh=${install_sh-"$am_aux_dir/install-sh"}
411 AC_SUBST(install_sh)])
412
413 # AM_PROG_INSTALL_STRIP
414
415 # Copyright 2001 Free Software Foundation, Inc.
416
417 # This program is free software; you can redistribute it and/or modify
418 # it under the terms of the GNU General Public License as published by
419 # the Free Software Foundation; either version 2, or (at your option)
420 # any later version.
421
422 # This program is distributed in the hope that it will be useful,
423 # but WITHOUT ANY WARRANTY; without even the implied warranty of
424 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
425 # GNU General Public License for more details.
426
427 # You should have received a copy of the GNU General Public License
428 # along with this program; if not, write to the Free Software
429 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
430 # 02111-1307, USA.
431
432 # One issue with vendor `install' (even GNU) is that you can't
433 # specify the program used to strip binaries.  This is especially
434 # annoying in cross-compiling environments, where the build's strip
435 # is unlikely to handle the host's binaries.
436 # Fortunately install-sh will honor a STRIPPROG variable, so we
437 # always use install-sh in `make install-strip', and initialize
438 # STRIPPROG with the value of the STRIP variable (set by the user).
439 AC_DEFUN([AM_PROG_INSTALL_STRIP],
440 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
441 # Installed binaries are usually stripped using `strip' when the user
442 # run `make install-strip'.  However `strip' might not be the right
443 # tool to use in cross-compilation environments, therefore Automake
444 # will honor the `STRIP' environment variable to overrule this program.
445 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
446 if test "$cross_compiling" != no; then
447   AC_CHECK_TOOL([STRIP], [strip], :)
448 fi
449 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
450 AC_SUBST([INSTALL_STRIP_PROGRAM])])
451
452 #                                                          -*- Autoconf -*-
453 # Copyright (C) 2003  Free Software Foundation, Inc.
454
455 # This program is free software; you can redistribute it and/or modify
456 # it under the terms of the GNU General Public License as published by
457 # the Free Software Foundation; either version 2, or (at your option)
458 # any later version.
459
460 # This program is distributed in the hope that it will be useful,
461 # but WITHOUT ANY WARRANTY; without even the implied warranty of
462 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
463 # GNU General Public License for more details.
464
465 # You should have received a copy of the GNU General Public License
466 # along with this program; if not, write to the Free Software
467 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
468 # 02111-1307, USA.
469
470 # serial 1
471
472 # Check whether the underlying file-system supports filenames
473 # with a leading dot.  For instance MS-DOS doesn't.
474 AC_DEFUN([AM_SET_LEADING_DOT],
475 [rm -rf .tst 2>/dev/null
476 mkdir .tst 2>/dev/null
477 if test -d .tst; then
478   am__leading_dot=.
479 else
480   am__leading_dot=_
481 fi
482 rmdir .tst 2>/dev/null
483 AC_SUBST([am__leading_dot])])
484
485 # serial 5                                              -*- Autoconf -*-
486
487 # Copyright (C) 1999, 2000, 2001, 2002, 2003  Free Software Foundation, Inc.
488
489 # This program is free software; you can redistribute it and/or modify
490 # it under the terms of the GNU General Public License as published by
491 # the Free Software Foundation; either version 2, or (at your option)
492 # any later version.
493
494 # This program is distributed in the hope that it will be useful,
495 # but WITHOUT ANY WARRANTY; without even the implied warranty of
496 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
497 # GNU General Public License for more details.
498
499 # You should have received a copy of the GNU General Public License
500 # along with this program; if not, write to the Free Software
501 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
502 # 02111-1307, USA.
503
504
505 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
506 # written in clear, in which case automake, when reading aclocal.m4,
507 # will think it sees a *use*, and therefore will trigger all it's
508 # C support machinery.  Also note that it means that autoscan, seeing
509 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
510
511
512
513 # _AM_DEPENDENCIES(NAME)
514 # ----------------------
515 # See how the compiler implements dependency checking.
516 # NAME is "CC", "CXX", "GCJ", or "OBJC".
517 # We try a few techniques and use that to set a single cache variable.
518 #
519 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
520 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
521 # dependency, and given that the user is not expected to run this macro,
522 # just rely on AC_PROG_CC.
523 AC_DEFUN([_AM_DEPENDENCIES],
524 [AC_REQUIRE([AM_SET_DEPDIR])dnl
525 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
526 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
527 AC_REQUIRE([AM_DEP_TRACK])dnl
528
529 ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
530        [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
531        [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
532        [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
533                    [depcc="$$1"   am_compiler_list=])
534
535 AC_CACHE_CHECK([dependency style of $depcc],
536                [am_cv_$1_dependencies_compiler_type],
537 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
538   # We make a subdir and do the tests there.  Otherwise we can end up
539   # making bogus files that we don't know about and never remove.  For
540   # instance it was reported that on HP-UX the gcc test will end up
541   # making a dummy file named `D' -- because `-MD' means `put the output
542   # in D'.
543   mkdir conftest.dir
544   # Copy depcomp to subdir because otherwise we won't find it if we're
545   # using a relative directory.
546   cp "$am_depcomp" conftest.dir
547   cd conftest.dir
548   # We will build objects and dependencies in a subdirectory because
549   # it helps to detect inapplicable dependency modes.  For instance
550   # both Tru64's cc and ICC support -MD to output dependencies as a
551   # side effect of compilation, but ICC will put the dependencies in
552   # the current directory while Tru64 will put them in the object
553   # directory.
554   mkdir sub
555
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     # Setup a source with many dependencies, because some compilers
562     # like to wrap large dependency lists on column 80 (with \), and
563     # we should not choose a depcomp mode which is confused by this.
564     #
565     # We need to recreate these files for each test, as the compiler may
566     # overwrite some of them when testing with obscure command lines.
567     # This happens at least with the AIX C compiler.
568     : > sub/conftest.c
569     for i in 1 2 3 4 5 6; do
570       echo '#include "conftst'$i'.h"' >> sub/conftest.c
571       : > sub/conftst$i.h
572     done
573     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
574
575     case $depmode in
576     nosideeffect)
577       # after this tag, mechanisms are not by side-effect, so they'll
578       # only be used when explicitly requested
579       if test "x$enable_dependency_tracking" = xyes; then
580         continue
581       else
582         break
583       fi
584       ;;
585     none) break ;;
586     esac
587     # We check with `-c' and `-o' for the sake of the "dashmstdout"
588     # mode.  It turns out that the SunPro C++ compiler does not properly
589     # handle `-M -o', and we need to detect this.
590     if depmode=$depmode \
591        source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
592        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
593        $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
594          >/dev/null 2>conftest.err &&
595        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
596        grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
597        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
598       # icc doesn't choke on unknown options, it will just issue warnings
599       # (even with -Werror).  So we grep stderr for any message
600       # that says an option was ignored.
601       if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
602         am_cv_$1_dependencies_compiler_type=$depmode
603         break
604       fi
605     fi
606   done
607
608   cd ..
609   rm -rf conftest.dir
610 else
611   am_cv_$1_dependencies_compiler_type=none
612 fi
613 ])
614 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
615 AM_CONDITIONAL([am__fastdep$1], [
616   test "x$enable_dependency_tracking" != xno \
617   && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
618 ])
619
620
621 # AM_SET_DEPDIR
622 # -------------
623 # Choose a directory name for dependency files.
624 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
625 AC_DEFUN([AM_SET_DEPDIR],
626 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
627 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
628 ])
629
630
631 # AM_DEP_TRACK
632 # ------------
633 AC_DEFUN([AM_DEP_TRACK],
634 [AC_ARG_ENABLE(dependency-tracking,
635 [  --disable-dependency-tracking Speeds up one-time builds
636   --enable-dependency-tracking  Do not reject slow dependency extractors])
637 if test "x$enable_dependency_tracking" != xno; then
638   am_depcomp="$ac_aux_dir/depcomp"
639   AMDEPBACKSLASH='\'
640 fi
641 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
642 AC_SUBST([AMDEPBACKSLASH])
643 ])
644
645 # Generate code to set up dependency tracking.   -*- Autoconf -*-
646
647 # Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
648
649 # This program is free software; you can redistribute it and/or modify
650 # it under the terms of the GNU General Public License as published by
651 # the Free Software Foundation; either version 2, or (at your option)
652 # any later version.
653
654 # This program is distributed in the hope that it will be useful,
655 # but WITHOUT ANY WARRANTY; without even the implied warranty of
656 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
657 # GNU General Public License for more details.
658
659 # You should have received a copy of the GNU General Public License
660 # along with this program; if not, write to the Free Software
661 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
662 # 02111-1307, USA.
663
664 #serial 2
665
666 # _AM_OUTPUT_DEPENDENCY_COMMANDS
667 # ------------------------------
668 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
669 [for mf in $CONFIG_FILES; do
670   # Strip MF so we end up with the name of the file.
671   mf=`echo "$mf" | sed -e 's/:.*$//'`
672   # Check whether this is an Automake generated Makefile or not.
673   # We used to match only the files named `Makefile.in', but
674   # some people rename them; so instead we look at the file content.
675   # Grep'ing the first line is not enough: some people post-process
676   # each Makefile.in and add a new line on top of each file to say so.
677   # So let's grep whole file.
678   if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
679     dirpart=`AS_DIRNAME("$mf")`
680   else
681     continue
682   fi
683   grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
684   # Extract the definition of DEP_FILES from the Makefile without
685   # running `make'.
686   DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
687   test -z "$DEPDIR" && continue
688   # When using ansi2knr, U may be empty or an underscore; expand it
689   U=`sed -n -e '/^U = / s///p' < "$mf"`
690   test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
691   # We invoke sed twice because it is the simplest approach to
692   # changing $(DEPDIR) to its actual value in the expansion.
693   for file in `sed -n -e '
694     /^DEP_FILES = .*\\\\$/ {
695       s/^DEP_FILES = //
696       :loop
697         s/\\\\$//
698         p
699         n
700         /\\\\$/ b loop
701       p
702     }
703     /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
704        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
705     # Make sure the directory exists.
706     test -f "$dirpart/$file" && continue
707     fdir=`AS_DIRNAME(["$file"])`
708     AS_MKDIR_P([$dirpart/$fdir])
709     # echo "creating $dirpart/$file"
710     echo '# dummy' > "$dirpart/$file"
711   done
712 done
713 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
714
715
716 # AM_OUTPUT_DEPENDENCY_COMMANDS
717 # -----------------------------
718 # This macro should only be invoked once -- use via AC_REQUIRE.
719 #
720 # This code is only required when automatic dependency tracking
721 # is enabled.  FIXME.  This creates each `.P' file that we will
722 # need in order to bootstrap the dependency handling code.
723 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
724 [AC_CONFIG_COMMANDS([depfiles],
725      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
726      [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
727 ])
728
729 # Check to see how 'make' treats includes.      -*- Autoconf -*-
730
731 # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
732
733 # This program is free software; you can redistribute it and/or modify
734 # it under the terms of the GNU General Public License as published by
735 # the Free Software Foundation; either version 2, or (at your option)
736 # any later version.
737
738 # This program is distributed in the hope that it will be useful,
739 # but WITHOUT ANY WARRANTY; without even the implied warranty of
740 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
741 # GNU General Public License for more details.
742
743 # You should have received a copy of the GNU General Public License
744 # along with this program; if not, write to the Free Software
745 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
746 # 02111-1307, USA.
747
748 # serial 2
749
750 # AM_MAKE_INCLUDE()
751 # -----------------
752 # Check to see how make treats includes.
753 AC_DEFUN([AM_MAKE_INCLUDE],
754 [am_make=${MAKE-make}
755 cat > confinc << 'END'
756 am__doit:
757         @echo done
758 .PHONY: am__doit
759 END
760 # If we don't find an include directive, just comment out the code.
761 AC_MSG_CHECKING([for style of include used by $am_make])
762 am__include="#"
763 am__quote=
764 _am_result=none
765 # First try GNU make style include.
766 echo "include confinc" > confmf
767 # We grep out `Entering directory' and `Leaving directory'
768 # messages which can occur if `w' ends up in MAKEFLAGS.
769 # In particular we don't look at `^make:' because GNU make might
770 # be invoked under some other name (usually "gmake"), in which
771 # case it prints its new name instead of `make'.
772 if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
773    am__include=include
774    am__quote=
775    _am_result=GNU
776 fi
777 # Now try BSD make style include.
778 if test "$am__include" = "#"; then
779    echo '.include "confinc"' > confmf
780    if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
781       am__include=.include
782       am__quote="\""
783       _am_result=BSD
784    fi
785 fi
786 AC_SUBST([am__include])
787 AC_SUBST([am__quote])
788 AC_MSG_RESULT([$_am_result])
789 rm -f confinc confmf
790 ])
791
792 # AM_CONDITIONAL                                              -*- Autoconf -*-
793
794 # Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
795
796 # This program is free software; you can redistribute it and/or modify
797 # it under the terms of the GNU General Public License as published by
798 # the Free Software Foundation; either version 2, or (at your option)
799 # any later version.
800
801 # This program is distributed in the hope that it will be useful,
802 # but WITHOUT ANY WARRANTY; without even the implied warranty of
803 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
804 # GNU General Public License for more details.
805
806 # You should have received a copy of the GNU General Public License
807 # along with this program; if not, write to the Free Software
808 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
809 # 02111-1307, USA.
810
811 # serial 5
812
813 AC_PREREQ(2.52)
814
815 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
816 # -------------------------------------
817 # Define a conditional.
818 AC_DEFUN([AM_CONDITIONAL],
819 [ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
820         [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
821 AC_SUBST([$1_TRUE])
822 AC_SUBST([$1_FALSE])
823 if $2; then
824   $1_TRUE=
825   $1_FALSE='#'
826 else
827   $1_TRUE='#'
828   $1_FALSE=
829 fi
830 AC_CONFIG_COMMANDS_PRE(
831 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
832   AC_MSG_ERROR([conditional "$1" was never defined.
833 Usually this means the macro was only invoked conditionally.])
834 fi])])
835
836 # Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
837
838 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
839
840 # This program is free software; you can redistribute it and/or modify
841 # it under the terms of the GNU General Public License as published by
842 # the Free Software Foundation; either version 2, or (at your option)
843 # any later version.
844
845 # This program is distributed in the hope that it will be useful,
846 # but WITHOUT ANY WARRANTY; without even the implied warranty of
847 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
848 # GNU General Public License for more details.
849
850 # You should have received a copy of the GNU General Public License
851 # along with this program; if not, write to the Free Software
852 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
853 # 02111-1307, USA.
854
855 AC_PREREQ([2.52])
856
857 # serial 6
858
859 # AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
860 AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
861
862 # gettext.m4 serial 28 (gettext-0.13)
863 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
864 dnl This file is free software, distributed under the terms of the GNU
865 dnl General Public License.  As a special exception to the GNU General
866 dnl Public License, this file may be distributed as part of a program
867 dnl that contains a configuration script generated by Autoconf, under
868 dnl the same distribution terms as the rest of that program.
869 dnl
870 dnl This file can can be used in projects which are not available under
871 dnl the GNU General Public License or the GNU Library General Public
872 dnl License but which still want to provide support for the GNU gettext
873 dnl functionality.
874 dnl Please note that the actual code of the GNU gettext library is covered
875 dnl by the GNU Library General Public License, and the rest of the GNU
876 dnl gettext package package is covered by the GNU General Public License.
877 dnl They are *not* in the public domain.
878
879 dnl Authors:
880 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
881 dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
882
883 dnl Macro to add for using GNU gettext.
884
885 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
886 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
887 dnl    default (if it is not specified or empty) is 'no-libtool'.
888 dnl    INTLSYMBOL should be 'external' for packages with no intl directory,
889 dnl    and 'no-libtool' or 'use-libtool' for packages with an intl directory.
890 dnl    If INTLSYMBOL is 'use-libtool', then a libtool library
891 dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
892 dnl    depending on --{enable,disable}-{shared,static} and on the presence of
893 dnl    AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
894 dnl    $(top_builddir)/intl/libintl.a will be created.
895 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
896 dnl    implementations (in libc or libintl) without the ngettext() function
897 dnl    will be ignored.  If NEEDSYMBOL is specified and is
898 dnl    'need-formatstring-macros', then GNU gettext implementations that don't
899 dnl    support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
900 dnl INTLDIR is used to find the intl libraries.  If empty,
901 dnl    the value `$(top_builddir)/intl/' is used.
902 dnl
903 dnl The result of the configuration is one of three cases:
904 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
905 dnl    and used.
906 dnl    Catalog format: GNU --> install in $(datadir)
907 dnl    Catalog extension: .mo after installation, .gmo in source tree
908 dnl 2) GNU gettext has been found in the system's C library.
909 dnl    Catalog format: GNU --> install in $(datadir)
910 dnl    Catalog extension: .mo after installation, .gmo in source tree
911 dnl 3) No internationalization, always use English msgid.
912 dnl    Catalog format: none
913 dnl    Catalog extension: none
914 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
915 dnl The use of .gmo is historical (it was needed to avoid overwriting the
916 dnl GNU format catalogs when building on a platform with an X/Open gettext),
917 dnl but we keep it in order not to force irrelevant filename changes on the
918 dnl maintainers.
919 dnl
920 AC_DEFUN([AM_GNU_GETTEXT],
921 [
922   dnl Argument checking.
923   ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
924     [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
925 ])])])])])
926   ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
927     [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
928 ])])])])
929   define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
930   define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
931
932   AC_REQUIRE([AM_PO_SUBDIRS])dnl
933   ifelse(gt_included_intl, yes, [
934     AC_REQUIRE([AM_INTL_SUBDIR])dnl
935   ])
936
937   dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
938   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
939   AC_REQUIRE([AC_LIB_RPATH])
940
941   dnl Sometimes libintl requires libiconv, so first search for libiconv.
942   dnl Ideally we would do this search only after the
943   dnl      if test "$USE_NLS" = "yes"; then
944   dnl        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
945   dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
946   dnl the configure script would need to contain the same shell code
947   dnl again, outside any 'if'. There are two solutions:
948   dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
949   dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
950   dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
951   dnl documented, we avoid it.
952   ifelse(gt_included_intl, yes, , [
953     AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
954   ])
955
956   dnl Set USE_NLS.
957   AM_NLS
958
959   ifelse(gt_included_intl, yes, [
960     BUILD_INCLUDED_LIBINTL=no
961     USE_INCLUDED_LIBINTL=no
962   ])
963   LIBINTL=
964   LTLIBINTL=
965   POSUB=
966
967   dnl If we use NLS figure out what method
968   if test "$USE_NLS" = "yes"; then
969     gt_use_preinstalled_gnugettext=no
970     ifelse(gt_included_intl, yes, [
971       AC_MSG_CHECKING([whether included gettext is requested])
972       AC_ARG_WITH(included-gettext,
973         [  --with-included-gettext use the GNU gettext library included here],
974         nls_cv_force_use_gnu_gettext=$withval,
975         nls_cv_force_use_gnu_gettext=no)
976       AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
977
978       nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
979       if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
980     ])
981         dnl User does not insist on using GNU NLS library.  Figure out what
982         dnl to use.  If GNU gettext is available we use this.  Else we have
983         dnl to fall back to GNU NLS library.
984
985         dnl Add a version number to the cache macros.
986         define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
987         define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
988         define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
989
990         AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
991          [AC_TRY_LINK([#include <libintl.h>
992 ]ifelse([$2], [need-formatstring-macros],
993 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
994 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
995 #endif
996 changequote(,)dnl
997 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
998 changequote([,])dnl
999 ], [])[extern int _nl_msg_cat_cntr;
1000 extern int *_nl_domain_bindings;],
1001             [bindtextdomain ("", "");
1002 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
1003             gt_cv_func_gnugettext_libc=yes,
1004             gt_cv_func_gnugettext_libc=no)])
1005
1006         if test "$gt_cv_func_gnugettext_libc" != "yes"; then
1007           dnl Sometimes libintl requires libiconv, so first search for libiconv.
1008           ifelse(gt_included_intl, yes, , [
1009             AM_ICONV_LINK
1010           ])
1011           dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
1012           dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
1013           dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
1014           dnl even if libiconv doesn't exist.
1015           AC_LIB_LINKFLAGS_BODY([intl])
1016           AC_CACHE_CHECK([for GNU gettext in libintl],
1017             gt_cv_func_gnugettext_libintl,
1018            [gt_save_CPPFLAGS="$CPPFLAGS"
1019             CPPFLAGS="$CPPFLAGS $INCINTL"
1020             gt_save_LIBS="$LIBS"
1021             LIBS="$LIBS $LIBINTL"
1022             dnl Now see whether libintl exists and does not depend on libiconv.
1023             AC_TRY_LINK([#include <libintl.h>
1024 ]ifelse([$2], [need-formatstring-macros],
1025 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1026 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
1027 #endif
1028 changequote(,)dnl
1029 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
1030 changequote([,])dnl
1031 ], [])[extern int _nl_msg_cat_cntr;
1032 extern
1033 #ifdef __cplusplus
1034 "C"
1035 #endif
1036 const char *_nl_expand_alias ();],
1037               [bindtextdomain ("", "");
1038 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
1039               gt_cv_func_gnugettext_libintl=yes,
1040               gt_cv_func_gnugettext_libintl=no)
1041             dnl Now see whether libintl exists and depends on libiconv.
1042             if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
1043               LIBS="$LIBS $LIBICONV"
1044               AC_TRY_LINK([#include <libintl.h>
1045 ]ifelse([$2], [need-formatstring-macros],
1046 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1047 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
1048 #endif
1049 changequote(,)dnl
1050 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
1051 changequote([,])dnl
1052 ], [])[extern int _nl_msg_cat_cntr;
1053 extern
1054 #ifdef __cplusplus
1055 "C"
1056 #endif
1057 const char *_nl_expand_alias ();],
1058                 [bindtextdomain ("", "");
1059 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
1060                [LIBINTL="$LIBINTL $LIBICONV"
1061                 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
1062                 gt_cv_func_gnugettext_libintl=yes
1063                ])
1064             fi
1065             CPPFLAGS="$gt_save_CPPFLAGS"
1066             LIBS="$gt_save_LIBS"])
1067         fi
1068
1069         dnl If an already present or preinstalled GNU gettext() is found,
1070         dnl use it.  But if this macro is used in GNU gettext, and GNU
1071         dnl gettext is already preinstalled in libintl, we update this
1072         dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
1073         if test "$gt_cv_func_gnugettext_libc" = "yes" \
1074            || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
1075                 && test "$PACKAGE" != gettext-runtime \
1076                 && test "$PACKAGE" != gettext-tools; }; then
1077           gt_use_preinstalled_gnugettext=yes
1078         else
1079           dnl Reset the values set by searching for libintl.
1080           LIBINTL=
1081           LTLIBINTL=
1082           INCINTL=
1083         fi
1084
1085     ifelse(gt_included_intl, yes, [
1086         if test "$gt_use_preinstalled_gnugettext" != "yes"; then
1087           dnl GNU gettext is not found in the C library.
1088           dnl Fall back on included GNU gettext library.
1089           nls_cv_use_gnu_gettext=yes
1090         fi
1091       fi
1092
1093       if test "$nls_cv_use_gnu_gettext" = "yes"; then
1094         dnl Mark actions used to generate GNU NLS library.
1095         BUILD_INCLUDED_LIBINTL=yes
1096         USE_INCLUDED_LIBINTL=yes
1097         LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
1098         LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
1099         LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
1100       fi
1101
1102       if test "$gt_use_preinstalled_gnugettext" = "yes" \
1103          || test "$nls_cv_use_gnu_gettext" = "yes"; then
1104         dnl Mark actions to use GNU gettext tools.
1105         CATOBJEXT=.gmo
1106       fi
1107     ])
1108
1109     if test "$gt_use_preinstalled_gnugettext" = "yes" \
1110        || test "$nls_cv_use_gnu_gettext" = "yes"; then
1111       AC_DEFINE(ENABLE_NLS, 1,
1112         [Define to 1 if translation of program messages to the user's native language
1113    is requested.])
1114     else
1115       USE_NLS=no
1116     fi
1117   fi
1118
1119   AC_MSG_CHECKING([whether to use NLS])
1120   AC_MSG_RESULT([$USE_NLS])
1121   if test "$USE_NLS" = "yes"; then
1122     AC_MSG_CHECKING([where the gettext function comes from])
1123     if test "$gt_use_preinstalled_gnugettext" = "yes"; then
1124       if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
1125         gt_source="external libintl"
1126       else
1127         gt_source="libc"
1128       fi
1129     else
1130       gt_source="included intl directory"
1131     fi
1132     AC_MSG_RESULT([$gt_source])
1133   fi
1134
1135   if test "$USE_NLS" = "yes"; then
1136
1137     if test "$gt_use_preinstalled_gnugettext" = "yes"; then
1138       if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
1139         AC_MSG_CHECKING([how to link with libintl])
1140         AC_MSG_RESULT([$LIBINTL])
1141         AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
1142       fi
1143
1144       dnl For backward compatibility. Some packages may be using this.
1145       AC_DEFINE(HAVE_GETTEXT, 1,
1146        [Define if the GNU gettext() function is already present or preinstalled.])
1147       AC_DEFINE(HAVE_DCGETTEXT, 1,
1148        [Define if the GNU dcgettext() function is already present or preinstalled.])
1149     fi
1150
1151     dnl We need to process the po/ directory.
1152     POSUB=po
1153   fi
1154
1155   ifelse(gt_included_intl, yes, [
1156     dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
1157     dnl to 'yes' because some of the testsuite requires it.
1158     if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
1159       BUILD_INCLUDED_LIBINTL=yes
1160     fi
1161
1162     dnl Make all variables we use known to autoconf.
1163     AC_SUBST(BUILD_INCLUDED_LIBINTL)
1164     AC_SUBST(USE_INCLUDED_LIBINTL)
1165     AC_SUBST(CATOBJEXT)
1166
1167     dnl For backward compatibility. Some configure.ins may be using this.
1168     nls_cv_header_intl=
1169     nls_cv_header_libgt=
1170
1171     dnl For backward compatibility. Some Makefiles may be using this.
1172     DATADIRNAME=share
1173     AC_SUBST(DATADIRNAME)
1174
1175     dnl For backward compatibility. Some Makefiles may be using this.
1176     INSTOBJEXT=.mo
1177     AC_SUBST(INSTOBJEXT)
1178
1179     dnl For backward compatibility. Some Makefiles may be using this.
1180     GENCAT=gencat
1181     AC_SUBST(GENCAT)
1182
1183     dnl For backward compatibility. Some Makefiles may be using this.
1184     if test "$USE_INCLUDED_LIBINTL" = yes; then
1185       INTLOBJS="\$(GETTOBJS)"
1186     fi
1187     AC_SUBST(INTLOBJS)
1188
1189     dnl Enable libtool support if the surrounding package wishes it.
1190     INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
1191     AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
1192   ])
1193
1194   dnl For backward compatibility. Some Makefiles may be using this.
1195   INTLLIBS="$LIBINTL"
1196   AC_SUBST(INTLLIBS)
1197
1198   dnl Make all documented variables known to autoconf.
1199   AC_SUBST(LIBINTL)
1200   AC_SUBST(LTLIBINTL)
1201   AC_SUBST(POSUB)
1202 ])
1203
1204
1205 dnl Checks for all prerequisites of the intl subdirectory,
1206 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
1207 dnl            USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
1208 AC_DEFUN([AM_INTL_SUBDIR],
1209 [
1210   AC_REQUIRE([AC_PROG_INSTALL])dnl
1211   AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1212   AC_REQUIRE([AC_PROG_CC])dnl
1213   AC_REQUIRE([AC_CANONICAL_HOST])dnl
1214   AC_REQUIRE([AC_PROG_RANLIB])dnl
1215   AC_REQUIRE([AC_ISC_POSIX])dnl
1216   AC_REQUIRE([AC_HEADER_STDC])dnl
1217   AC_REQUIRE([AC_C_CONST])dnl
1218   AC_REQUIRE([bh_C_SIGNED])dnl
1219   AC_REQUIRE([AC_C_INLINE])dnl
1220   AC_REQUIRE([AC_TYPE_OFF_T])dnl
1221   AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1222   AC_REQUIRE([jm_AC_TYPE_LONG_LONG])dnl
1223   AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
1224   AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
1225   AC_REQUIRE([gt_TYPE_WINT_T])dnl
1226   AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
1227   AC_REQUIRE([jm_AC_HEADER_STDINT_H])
1228   AC_REQUIRE([gt_TYPE_INTMAX_T])
1229   AC_REQUIRE([gt_PRINTF_POSIX])
1230   AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1231   AC_REQUIRE([AC_FUNC_MMAP])dnl
1232   AC_REQUIRE([jm_GLIBC21])dnl
1233   AC_REQUIRE([gt_INTDIV0])dnl
1234   AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
1235   AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
1236   AC_REQUIRE([gt_INTTYPES_PRI])dnl
1237   AC_REQUIRE([gl_XSIZE])dnl
1238
1239   AC_CHECK_TYPE([ptrdiff_t], ,
1240     [AC_DEFINE([ptrdiff_t], [long],
1241        [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
1242     ])
1243   AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
1244 stdlib.h string.h unistd.h sys/param.h])
1245   AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \
1246 mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \
1247 strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \
1248 __fsetlocking])
1249
1250   dnl Use the _snprintf function only if it is declared (because on NetBSD it
1251   dnl is defined as a weak alias of snprintf; we prefer to use the latter).
1252   gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
1253   gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
1254
1255   dnl Use the *_unlocked functions only if they are declared.
1256   dnl (because some of them were defined without being declared in Solaris
1257   dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
1258   dnl on Solaris 2.5.1 to run on Solaris 2.6).
1259   dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
1260   gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
1261   gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
1262   gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
1263
1264   case $gt_cv_func_printf_posix in
1265     *yes) HAVE_POSIX_PRINTF=1 ;;
1266     *) HAVE_POSIX_PRINTF=0 ;;
1267   esac
1268   AC_SUBST([HAVE_POSIX_PRINTF])
1269   if test "$ac_cv_func_asprintf" = yes; then
1270     HAVE_ASPRINTF=1
1271   else
1272     HAVE_ASPRINTF=0
1273   fi
1274   AC_SUBST([HAVE_ASPRINTF])
1275   if test "$ac_cv_func_snprintf" = yes; then
1276     HAVE_SNPRINTF=1
1277   else
1278     HAVE_SNPRINTF=0
1279   fi
1280   AC_SUBST([HAVE_SNPRINTF])
1281   if test "$ac_cv_func_wprintf" = yes; then
1282     HAVE_WPRINTF=1
1283   else
1284     HAVE_WPRINTF=0
1285   fi
1286   AC_SUBST([HAVE_WPRINTF])
1287
1288   AM_ICONV
1289   AM_LANGINFO_CODESET
1290   if test $ac_cv_header_locale_h = yes; then
1291     AM_LC_MESSAGES
1292   fi
1293
1294   dnl intl/plural.c is generated from intl/plural.y. It requires bison,
1295   dnl because plural.y uses bison specific features. It requires at least
1296   dnl bison-1.26 because earlier versions generate a plural.c that doesn't
1297   dnl compile.
1298   dnl bison is only needed for the maintainer (who touches plural.y). But in
1299   dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
1300   dnl the rule in general Makefile. Now, some people carelessly touch the
1301   dnl files or have a broken "make" program, hence the plural.c rule will
1302   dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
1303   dnl present or too old.
1304   AC_CHECK_PROGS([INTLBISON], [bison])
1305   if test -z "$INTLBISON"; then
1306     ac_verc_fail=yes
1307   else
1308     dnl Found it, now check the version.
1309     AC_MSG_CHECKING([version of bison])
1310 changequote(<<,>>)dnl
1311     ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
1312     case $ac_prog_version in
1313       '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1314       1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
1315 changequote([,])dnl
1316          ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
1317       *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
1318     esac
1319     AC_MSG_RESULT([$ac_prog_version])
1320   fi
1321   if test $ac_verc_fail = yes; then
1322     INTLBISON=:
1323   fi
1324 ])
1325
1326
1327 dnl gt_CHECK_DECL(FUNC, INCLUDES)
1328 dnl Check whether a function is declared.
1329 AC_DEFUN([gt_CHECK_DECL],
1330 [
1331   AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
1332     [AC_TRY_COMPILE([$2], [
1333 #ifndef $1
1334   char *p = (char *) $1;
1335 #endif
1336 ], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
1337   if test $ac_cv_have_decl_$1 = yes; then
1338     gt_value=1
1339   else
1340     gt_value=0
1341   fi
1342   AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
1343     [Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
1344 ])
1345
1346
1347 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
1348 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
1349
1350 # po.m4 serial 3 (gettext-0.14)
1351 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
1352 dnl This file is free software, distributed under the terms of the GNU
1353 dnl General Public License.  As a special exception to the GNU General
1354 dnl Public License, this file may be distributed as part of a program
1355 dnl that contains a configuration script generated by Autoconf, under
1356 dnl the same distribution terms as the rest of that program.
1357 dnl
1358 dnl This file can can be used in projects which are not available under
1359 dnl the GNU General Public License or the GNU Library General Public
1360 dnl License but which still want to provide support for the GNU gettext
1361 dnl functionality.
1362 dnl Please note that the actual code of the GNU gettext library is covered
1363 dnl by the GNU Library General Public License, and the rest of the GNU
1364 dnl gettext package package is covered by the GNU General Public License.
1365 dnl They are *not* in the public domain.
1366
1367 dnl Authors:
1368 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1369 dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1370
1371 dnl Checks for all prerequisites of the po subdirectory.
1372 AC_DEFUN([AM_PO_SUBDIRS],
1373 [
1374   AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1375   AC_REQUIRE([AC_PROG_INSTALL])dnl
1376   AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1377   AC_REQUIRE([AM_NLS])dnl
1378
1379   dnl Perform the following tests also if --disable-nls has been given,
1380   dnl because they are needed for "make dist" to work.
1381
1382   dnl Search for GNU msgfmt in the PATH.
1383   dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
1384   dnl The second test excludes FreeBSD msgfmt.
1385   AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1386     [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
1387      (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1388     :)
1389   AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1390
1391   dnl Search for GNU xgettext 0.12 or newer in the PATH.
1392   dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
1393   dnl The second test excludes FreeBSD xgettext.
1394   AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1395     [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
1396      (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1397     :)
1398   dnl Remove leftover from FreeBSD xgettext call.
1399   rm -f messages.po
1400
1401   dnl Search for GNU msgmerge 0.11 or newer in the PATH.
1402   AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
1403     [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
1404
1405   dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1406   dnl Test whether we really found GNU msgfmt.
1407   if test "$GMSGFMT" != ":"; then
1408     dnl If it is no GNU msgfmt we define it as : so that the
1409     dnl Makefiles still can work.
1410     if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
1411        (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1412       : ;
1413     else
1414       GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
1415       AC_MSG_RESULT(
1416         [found $GMSGFMT program is not GNU msgfmt; ignore it])
1417       GMSGFMT=":"
1418     fi
1419   fi
1420
1421   dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1422   dnl Test whether we really found GNU xgettext.
1423   if test "$XGETTEXT" != ":"; then
1424     dnl If it is no GNU xgettext we define it as : so that the
1425     dnl Makefiles still can work.
1426     if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
1427        (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1428       : ;
1429     else
1430       AC_MSG_RESULT(
1431         [found xgettext program is not GNU xgettext; ignore it])
1432       XGETTEXT=":"
1433     fi
1434     dnl Remove leftover from FreeBSD xgettext call.
1435     rm -f messages.po
1436   fi
1437
1438   AC_OUTPUT_COMMANDS([
1439     for ac_file in $CONFIG_FILES; do
1440       # Support "outfile[:infile[:infile...]]"
1441       case "$ac_file" in
1442         *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1443       esac
1444       # PO directories have a Makefile.in generated from Makefile.in.in.
1445       case "$ac_file" in */Makefile.in)
1446         # Adjust a relative srcdir.
1447         ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1448         ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1449         ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1450         # In autoconf-2.13 it is called $ac_given_srcdir.
1451         # In autoconf-2.50 it is called $srcdir.
1452         test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1453         case "$ac_given_srcdir" in
1454           .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1455           /*) top_srcdir="$ac_given_srcdir" ;;
1456           *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
1457         esac
1458         if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
1459           rm -f "$ac_dir/POTFILES"
1460           test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
1461           cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[   ]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
1462           POMAKEFILEDEPS="POTFILES.in"
1463           # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
1464           # on $ac_dir but don't depend on user-specified configuration
1465           # parameters.
1466           if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
1467             # The LINGUAS file contains the set of available languages.
1468             if test -n "$OBSOLETE_ALL_LINGUAS"; then
1469               test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
1470             fi
1471             ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
1472             # Hide the ALL_LINGUAS assigment from automake.
1473             eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
1474             POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
1475           else
1476             # The set of available languages was given in configure.in.
1477             eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
1478           fi
1479           # Compute POFILES
1480           # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
1481           # Compute UPDATEPOFILES
1482           # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
1483           # Compute DUMMYPOFILES
1484           # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
1485           # Compute GMOFILES
1486           # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
1487           case "$ac_given_srcdir" in
1488             .) srcdirpre= ;;
1489             *) srcdirpre='$(srcdir)/' ;;
1490           esac
1491           POFILES=
1492           UPDATEPOFILES=
1493           DUMMYPOFILES=
1494           GMOFILES=
1495           for lang in $ALL_LINGUAS; do
1496             POFILES="$POFILES $srcdirpre$lang.po"
1497             UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
1498             DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
1499             GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
1500           done
1501           # CATALOGS depends on both $ac_dir and the user's LINGUAS
1502           # environment variable.
1503           INST_LINGUAS=
1504           if test -n "$ALL_LINGUAS"; then
1505             for presentlang in $ALL_LINGUAS; do
1506               useit=no
1507               if test "%UNSET%" != "$LINGUAS"; then
1508                 desiredlanguages="$LINGUAS"
1509               else
1510                 desiredlanguages="$ALL_LINGUAS"
1511               fi
1512               for desiredlang in $desiredlanguages; do
1513                 # Use the presentlang catalog if desiredlang is
1514                 #   a. equal to presentlang, or
1515                 #   b. a variant of presentlang (because in this case,
1516                 #      presentlang can be used as a fallback for messages
1517                 #      which are not translated in the desiredlang catalog).
1518                 case "$desiredlang" in
1519                   "$presentlang"*) useit=yes;;
1520                 esac
1521               done
1522               if test $useit = yes; then
1523                 INST_LINGUAS="$INST_LINGUAS $presentlang"
1524               fi
1525             done
1526           fi
1527           CATALOGS=
1528           if test -n "$INST_LINGUAS"; then
1529             for lang in $INST_LINGUAS; do
1530               CATALOGS="$CATALOGS $lang.gmo"
1531             done
1532           fi
1533           test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
1534           sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
1535           for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
1536             if test -f "$f"; then
1537               case "$f" in
1538                 *.orig | *.bak | *~) ;;
1539                 *) cat "$f" >> "$ac_dir/Makefile" ;;
1540               esac
1541             fi
1542           done
1543         fi
1544         ;;
1545       esac
1546     done],
1547    [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
1548     # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
1549     # from automake.
1550     eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
1551     # Capture the value of LINGUAS because we need it to compute CATALOGS.
1552     LINGUAS="${LINGUAS-%UNSET%}"
1553    ])
1554 ])
1555
1556 dnl Postprocesses a Makefile in a directory containing PO files.
1557 AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
1558 [
1559   # When this code is run, in config.status, two variables have already been
1560   # set:
1561   # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
1562   # - LINGUAS is the value of the environment variable LINGUAS at configure
1563   #   time.
1564
1565 changequote(,)dnl
1566   # Adjust a relative srcdir.
1567   ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1568   ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1569   ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1570   # In autoconf-2.13 it is called $ac_given_srcdir.
1571   # In autoconf-2.50 it is called $srcdir.
1572   test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1573   case "$ac_given_srcdir" in
1574     .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1575     /*) top_srcdir="$ac_given_srcdir" ;;
1576     *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
1577   esac
1578
1579   # Find a way to echo strings without interpreting backslash.
1580   if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
1581     gt_echo='echo'
1582   else
1583     if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
1584       gt_echo='printf %s\n'
1585     else
1586       echo_func () {
1587         cat <<EOT
1588 $*
1589 EOT
1590       }
1591       gt_echo='echo_func'
1592     fi
1593   fi
1594
1595   # A sed script that extracts the value of VARIABLE from a Makefile.
1596   sed_x_variable='
1597 # Test if the hold space is empty.
1598 x
1599 s/P/P/
1600 x
1601 ta
1602 # Yes it was empty. Look if we have the expected variable definition.
1603 /^[      ]*VARIABLE[     ]*=/{
1604   # Seen the first line of the variable definition.
1605   s/^[   ]*VARIABLE[     ]*=//
1606   ba
1607 }
1608 bd
1609 :a
1610 # Here we are processing a line from the variable definition.
1611 # Remove comment, more precisely replace it with a space.
1612 s/#.*$/ /
1613 # See if the line ends in a backslash.
1614 tb
1615 :b
1616 s/\\$//
1617 # Print the line, without the trailing backslash.
1618 p
1619 tc
1620 # There was no trailing backslash. The end of the variable definition is
1621 # reached. Clear the hold space.
1622 s/^.*$//
1623 x
1624 bd
1625 :c
1626 # A trailing backslash means that the variable definition continues in the
1627 # next line. Put a nonempty string into the hold space to indicate this.
1628 s/^.*$/P/
1629 x
1630 :d
1631 '
1632 changequote([,])dnl
1633
1634   # Set POTFILES to the value of the Makefile variable POTFILES.
1635   sed_x_POTFILES="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`"
1636   POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
1637   # Compute POTFILES_DEPS as
1638   #   $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
1639   POTFILES_DEPS=
1640   for file in $POTFILES; do
1641     POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
1642   done
1643   POMAKEFILEDEPS=""
1644
1645   if test -n "$OBSOLETE_ALL_LINGUAS"; then
1646     test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
1647   fi
1648   if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
1649     # The LINGUAS file contains the set of available languages.
1650     ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
1651     POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
1652   else
1653     # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
1654     sed_x_LINGUAS="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`"
1655     ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
1656   fi
1657   # Hide the ALL_LINGUAS assigment from automake.
1658   eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
1659   # Compute POFILES
1660   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
1661   # Compute UPDATEPOFILES
1662   # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
1663   # Compute DUMMYPOFILES
1664   # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
1665   # Compute GMOFILES
1666   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
1667   # Compute PROPERTIESFILES
1668   # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
1669   # Compute CLASSFILES
1670   # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
1671   # Compute QMFILES
1672   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
1673   # Compute MSGFILES
1674   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
1675   # Compute RESOURCESDLLFILES
1676   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
1677   case "$ac_given_srcdir" in
1678     .) srcdirpre= ;;
1679     *) srcdirpre='$(srcdir)/' ;;
1680   esac
1681   POFILES=
1682   UPDATEPOFILES=
1683   DUMMYPOFILES=
1684   GMOFILES=
1685   PROPERTIESFILES=
1686   CLASSFILES=
1687   QMFILES=
1688   MSGFILES=
1689   RESOURCESDLLFILES=
1690   for lang in $ALL_LINGUAS; do
1691     POFILES="$POFILES $srcdirpre$lang.po"
1692     UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
1693     DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
1694     GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
1695     PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
1696     CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
1697     QMFILES="$QMFILES $srcdirpre$lang.qm"
1698     frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
1699     MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
1700     frobbedlang=`echo $lang | sed -e 's/_/-/g'`
1701     RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
1702   done
1703   # CATALOGS depends on both $ac_dir and the user's LINGUAS
1704   # environment variable.
1705   INST_LINGUAS=
1706   if test -n "$ALL_LINGUAS"; then
1707     for presentlang in $ALL_LINGUAS; do
1708       useit=no
1709       if test "%UNSET%" != "$LINGUAS"; then
1710         desiredlanguages="$LINGUAS"
1711       else
1712         desiredlanguages="$ALL_LINGUAS"
1713       fi
1714       for desiredlang in $desiredlanguages; do
1715         # Use the presentlang catalog if desiredlang is
1716         #   a. equal to presentlang, or
1717         #   b. a variant of presentlang (because in this case,
1718         #      presentlang can be used as a fallback for messages
1719         #      which are not translated in the desiredlang catalog).
1720         case "$desiredlang" in
1721           "$presentlang"*) useit=yes;;
1722         esac
1723       done
1724       if test $useit = yes; then
1725         INST_LINGUAS="$INST_LINGUAS $presentlang"
1726       fi
1727     done
1728   fi
1729   CATALOGS=
1730   JAVACATALOGS=
1731   QTCATALOGS=
1732   TCLCATALOGS=
1733   CSHARPCATALOGS=
1734   if test -n "$INST_LINGUAS"; then
1735     for lang in $INST_LINGUAS; do
1736       CATALOGS="$CATALOGS $lang.gmo"
1737       JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
1738       QTCATALOGS="$QTCATALOGS $lang.qm"
1739       frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
1740       TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
1741       frobbedlang=`echo $lang | sed -e 's/_/-/g'`
1742       CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
1743     done
1744   fi
1745
1746   sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
1747   if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
1748     # Add dependencies that cannot be formulated as a simple suffix rule.
1749     for lang in $ALL_LINGUAS; do
1750       frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
1751       cat >> "$ac_file.tmp" <<EOF
1752 $frobbedlang.msg: $lang.po
1753         @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
1754         \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
1755 EOF
1756     done
1757   fi
1758   if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
1759     # Add dependencies that cannot be formulated as a simple suffix rule.
1760     for lang in $ALL_LINGUAS; do
1761       frobbedlang=`echo $lang | sed -e 's/_/-/g'`
1762       cat >> "$ac_file.tmp" <<EOF
1763 $frobbedlang/\$(DOMAIN).resources.dll: $lang.po
1764         @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
1765         \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
1766 EOF
1767     done
1768   fi
1769   if test -n "$POMAKEFILEDEPS"; then
1770     cat >> "$ac_file.tmp" <<EOF
1771 Makefile: $POMAKEFILEDEPS
1772 EOF
1773   fi
1774   mv "$ac_file.tmp" "$ac_file"
1775 ])
1776
1777 # nls.m4 serial 1 (gettext-0.12)
1778 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
1779 dnl This file is free software, distributed under the terms of the GNU
1780 dnl General Public License.  As a special exception to the GNU General
1781 dnl Public License, this file may be distributed as part of a program
1782 dnl that contains a configuration script generated by Autoconf, under
1783 dnl the same distribution terms as the rest of that program.
1784 dnl
1785 dnl This file can can be used in projects which are not available under
1786 dnl the GNU General Public License or the GNU Library General Public
1787 dnl License but which still want to provide support for the GNU gettext
1788 dnl functionality.
1789 dnl Please note that the actual code of the GNU gettext library is covered
1790 dnl by the GNU Library General Public License, and the rest of the GNU
1791 dnl gettext package package is covered by the GNU General Public License.
1792 dnl They are *not* in the public domain.
1793
1794 dnl Authors:
1795 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1796 dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1797
1798 AC_DEFUN([AM_NLS],
1799 [
1800   AC_MSG_CHECKING([whether NLS is requested])
1801   dnl Default is enabled NLS
1802   AC_ARG_ENABLE(nls,
1803     [  --disable-nls           do not use Native Language Support],
1804     USE_NLS=$enableval, USE_NLS=yes)
1805   AC_MSG_RESULT($USE_NLS)
1806   AC_SUBST(USE_NLS)
1807 ])
1808
1809 AC_DEFUN([AM_MKINSTALLDIRS],
1810 [
1811   dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1812   dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1813   dnl Try to locate it.
1814   MKINSTALLDIRS=
1815   if test -n "$ac_aux_dir"; then
1816     case "$ac_aux_dir" in
1817       /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
1818       *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
1819     esac
1820   fi
1821   if test -z "$MKINSTALLDIRS"; then
1822     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1823   fi
1824   AC_SUBST(MKINSTALLDIRS)
1825 ])
1826
1827 # progtest.m4 serial 3 (gettext-0.12)
1828 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
1829 dnl This file is free software, distributed under the terms of the GNU
1830 dnl General Public License.  As a special exception to the GNU General
1831 dnl Public License, this file may be distributed as part of a program
1832 dnl that contains a configuration script generated by Autoconf, under
1833 dnl the same distribution terms as the rest of that program.
1834 dnl
1835 dnl This file can can be used in projects which are not available under
1836 dnl the GNU General Public License or the GNU Library General Public
1837 dnl License but which still want to provide support for the GNU gettext
1838 dnl functionality.
1839 dnl Please note that the actual code of the GNU gettext library is covered
1840 dnl by the GNU Library General Public License, and the rest of the GNU
1841 dnl gettext package package is covered by the GNU General Public License.
1842 dnl They are *not* in the public domain.
1843
1844 dnl Authors:
1845 dnl   Ulrich Drepper <drepper@cygnus.com>, 1996.
1846
1847 # Search path for a program which passes the given test.
1848
1849 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1850 dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1851 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
1852 [
1853 # Prepare PATH_SEPARATOR.
1854 # The user is always right.
1855 if test "${PATH_SEPARATOR+set}" != set; then
1856   echo "#! /bin/sh" >conf$$.sh
1857   echo  "exit 0"   >>conf$$.sh
1858   chmod +x conf$$.sh
1859   if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
1860     PATH_SEPARATOR=';'
1861   else
1862     PATH_SEPARATOR=:
1863   fi
1864   rm -f conf$$.sh
1865 fi
1866
1867 # Find out how to test for executable files. Don't use a zero-byte file,
1868 # as systems may use methods other than mode bits to determine executability.
1869 cat >conf$$.file <<_ASEOF
1870 #! /bin/sh
1871 exit 0
1872 _ASEOF
1873 chmod +x conf$$.file
1874 if test -x conf$$.file >/dev/null 2>&1; then
1875   ac_executable_p="test -x"
1876 else
1877   ac_executable_p="test -f"
1878 fi
1879 rm -f conf$$.file
1880
1881 # Extract the first word of "$2", so it can be a program name with args.
1882 set dummy $2; ac_word=[$]2
1883 AC_MSG_CHECKING([for $ac_word])
1884 AC_CACHE_VAL(ac_cv_path_$1,
1885 [case "[$]$1" in
1886   [[\\/]]* | ?:[[\\/]]*)
1887     ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1888     ;;
1889   *)
1890     ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
1891     for ac_dir in ifelse([$5], , $PATH, [$5]); do
1892       IFS="$ac_save_IFS"
1893       test -z "$ac_dir" && ac_dir=.
1894       for ac_exec_ext in '' $ac_executable_extensions; do
1895         if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
1896           if [$3]; then
1897             ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
1898             break 2
1899           fi
1900         fi
1901       done
1902     done
1903     IFS="$ac_save_IFS"
1904 dnl If no 4th arg is given, leave the cache variable unset,
1905 dnl so AC_PATH_PROGS will keep looking.
1906 ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1907 ])dnl
1908     ;;
1909 esac])dnl
1910 $1="$ac_cv_path_$1"
1911 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1912   AC_MSG_RESULT([$]$1)
1913 else
1914   AC_MSG_RESULT(no)
1915 fi
1916 AC_SUBST($1)dnl
1917 ])
1918
1919 # lib-prefix.m4 serial 3 (gettext-0.13)
1920 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
1921 dnl This file is free software, distributed under the terms of the GNU
1922 dnl General Public License.  As a special exception to the GNU General
1923 dnl Public License, this file may be distributed as part of a program
1924 dnl that contains a configuration script generated by Autoconf, under
1925 dnl the same distribution terms as the rest of that program.
1926
1927 dnl From Bruno Haible.
1928
1929 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
1930 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
1931 dnl require excessive bracketing.
1932 ifdef([AC_HELP_STRING],
1933 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
1934 [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
1935
1936 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1937 dnl to access previously installed libraries. The basic assumption is that
1938 dnl a user will want packages to use other packages he previously installed
1939 dnl with the same --prefix option.
1940 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1941 dnl libraries, but is otherwise very convenient.
1942 AC_DEFUN([AC_LIB_PREFIX],
1943 [
1944   AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1945   AC_REQUIRE([AC_PROG_CC])
1946   AC_REQUIRE([AC_CANONICAL_HOST])
1947   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1948   dnl By default, look in $includedir and $libdir.
1949   use_additional=yes
1950   AC_LIB_WITH_FINAL_PREFIX([
1951     eval additional_includedir=\"$includedir\"
1952     eval additional_libdir=\"$libdir\"
1953   ])
1954   AC_LIB_ARG_WITH([lib-prefix],
1955 [  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1956   --without-lib-prefix    don't search for libraries in includedir and libdir],
1957 [
1958     if test "X$withval" = "Xno"; then
1959       use_additional=no
1960     else
1961       if test "X$withval" = "X"; then
1962         AC_LIB_WITH_FINAL_PREFIX([
1963           eval additional_includedir=\"$includedir\"
1964           eval additional_libdir=\"$libdir\"
1965         ])
1966       else
1967         additional_includedir="$withval/include"
1968         additional_libdir="$withval/lib"
1969       fi
1970     fi
1971 ])
1972   if test $use_additional = yes; then
1973     dnl Potentially add $additional_includedir to $CPPFLAGS.
1974     dnl But don't add it
1975     dnl   1. if it's the standard /usr/include,
1976     dnl   2. if it's already present in $CPPFLAGS,
1977     dnl   3. if it's /usr/local/include and we are using GCC on Linux,
1978     dnl   4. if it doesn't exist as a directory.
1979     if test "X$additional_includedir" != "X/usr/include"; then
1980       haveit=
1981       for x in $CPPFLAGS; do
1982         AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1983         if test "X$x" = "X-I$additional_includedir"; then
1984           haveit=yes
1985           break
1986         fi
1987       done
1988       if test -z "$haveit"; then
1989         if test "X$additional_includedir" = "X/usr/local/include"; then
1990           if test -n "$GCC"; then
1991             case $host_os in
1992               linux*) haveit=yes;;
1993             esac
1994           fi
1995         fi
1996         if test -z "$haveit"; then
1997           if test -d "$additional_includedir"; then
1998             dnl Really add $additional_includedir to $CPPFLAGS.
1999             CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
2000           fi
2001         fi
2002       fi
2003     fi
2004     dnl Potentially add $additional_libdir to $LDFLAGS.
2005     dnl But don't add it
2006     dnl   1. if it's the standard /usr/lib,
2007     dnl   2. if it's already present in $LDFLAGS,
2008     dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
2009     dnl   4. if it doesn't exist as a directory.
2010     if test "X$additional_libdir" != "X/usr/lib"; then
2011       haveit=
2012       for x in $LDFLAGS; do
2013         AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2014         if test "X$x" = "X-L$additional_libdir"; then
2015           haveit=yes
2016           break
2017         fi
2018       done
2019       if test -z "$haveit"; then
2020         if test "X$additional_libdir" = "X/usr/local/lib"; then
2021           if test -n "$GCC"; then
2022             case $host_os in
2023               linux*) haveit=yes;;
2024             esac
2025           fi
2026         fi
2027         if test -z "$haveit"; then
2028           if test -d "$additional_libdir"; then
2029             dnl Really add $additional_libdir to $LDFLAGS.
2030             LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
2031           fi
2032         fi
2033       fi
2034     fi
2035   fi
2036 ])
2037
2038 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
2039 dnl acl_final_exec_prefix, containing the values to which $prefix and
2040 dnl $exec_prefix will expand at the end of the configure script.
2041 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
2042 [
2043   dnl Unfortunately, prefix and exec_prefix get only finally determined
2044   dnl at the end of configure.
2045   if test "X$prefix" = "XNONE"; then
2046     acl_final_prefix="$ac_default_prefix"
2047   else
2048     acl_final_prefix="$prefix"
2049   fi
2050   if test "X$exec_prefix" = "XNONE"; then
2051     acl_final_exec_prefix='${prefix}'
2052   else
2053     acl_final_exec_prefix="$exec_prefix"
2054   fi
2055   acl_save_prefix="$prefix"
2056   prefix="$acl_final_prefix"
2057   eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
2058   prefix="$acl_save_prefix"
2059 ])
2060
2061 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
2062 dnl variables prefix and exec_prefix bound to the values they will have
2063 dnl at the end of the configure script.
2064 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
2065 [
2066   acl_save_prefix="$prefix"
2067   prefix="$acl_final_prefix"
2068   acl_save_exec_prefix="$exec_prefix"
2069   exec_prefix="$acl_final_exec_prefix"
2070   $1
2071   exec_prefix="$acl_save_exec_prefix"
2072   prefix="$acl_save_prefix"
2073 ])
2074
2075 # lib-link.m4 serial 4 (gettext-0.12)
2076 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
2077 dnl This file is free software, distributed under the terms of the GNU
2078 dnl General Public License.  As a special exception to the GNU General
2079 dnl Public License, this file may be distributed as part of a program
2080 dnl that contains a configuration script generated by Autoconf, under
2081 dnl the same distribution terms as the rest of that program.
2082
2083 dnl From Bruno Haible.
2084
2085 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
2086 dnl the libraries corresponding to explicit and implicit dependencies.
2087 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
2088 dnl augments the CPPFLAGS variable.
2089 AC_DEFUN([AC_LIB_LINKFLAGS],
2090 [
2091   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2092   AC_REQUIRE([AC_LIB_RPATH])
2093   define([Name],[translit([$1],[./-], [___])])
2094   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
2095                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
2096   AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
2097     AC_LIB_LINKFLAGS_BODY([$1], [$2])
2098     ac_cv_lib[]Name[]_libs="$LIB[]NAME"
2099     ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
2100     ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
2101   ])
2102   LIB[]NAME="$ac_cv_lib[]Name[]_libs"
2103   LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
2104   INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
2105   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
2106   AC_SUBST([LIB]NAME)
2107   AC_SUBST([LTLIB]NAME)
2108   dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
2109   dnl results of this search when this library appears as a dependency.
2110   HAVE_LIB[]NAME=yes
2111   undefine([Name])
2112   undefine([NAME])
2113 ])
2114
2115 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
2116 dnl searches for libname and the libraries corresponding to explicit and
2117 dnl implicit dependencies, together with the specified include files and
2118 dnl the ability to compile and link the specified testcode. If found, it
2119 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
2120 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
2121 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
2122 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
2123 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
2124 [
2125   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2126   AC_REQUIRE([AC_LIB_RPATH])
2127   define([Name],[translit([$1],[./-], [___])])
2128   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
2129                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
2130
2131   dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
2132   dnl accordingly.
2133   AC_LIB_LINKFLAGS_BODY([$1], [$2])
2134
2135   dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
2136   dnl because if the user has installed lib[]Name and not disabled its use
2137   dnl via --without-lib[]Name-prefix, he wants to use it.
2138   ac_save_CPPFLAGS="$CPPFLAGS"
2139   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
2140
2141   AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
2142     ac_save_LIBS="$LIBS"
2143     LIBS="$LIBS $LIB[]NAME"
2144     AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
2145     LIBS="$ac_save_LIBS"
2146   ])
2147   if test "$ac_cv_lib[]Name" = yes; then
2148     HAVE_LIB[]NAME=yes
2149     AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
2150     AC_MSG_CHECKING([how to link with lib[]$1])
2151     AC_MSG_RESULT([$LIB[]NAME])
2152   else
2153     HAVE_LIB[]NAME=no
2154     dnl If $LIB[]NAME didn't lead to a usable library, we don't need
2155     dnl $INC[]NAME either.
2156     CPPFLAGS="$ac_save_CPPFLAGS"
2157     LIB[]NAME=
2158     LTLIB[]NAME=
2159   fi
2160   AC_SUBST([HAVE_LIB]NAME)
2161   AC_SUBST([LIB]NAME)
2162   AC_SUBST([LTLIB]NAME)
2163   undefine([Name])
2164   undefine([NAME])
2165 ])
2166
2167 dnl Determine the platform dependent parameters needed to use rpath:
2168 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
2169 dnl hardcode_direct, hardcode_minus_L.
2170 AC_DEFUN([AC_LIB_RPATH],
2171 [
2172   AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
2173   AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
2174   AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
2175   AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
2176   AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
2177     CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
2178     ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
2179     . ./conftest.sh
2180     rm -f ./conftest.sh
2181     acl_cv_rpath=done
2182   ])
2183   wl="$acl_cv_wl"
2184   libext="$acl_cv_libext"
2185   shlibext="$acl_cv_shlibext"
2186   hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
2187   hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
2188   hardcode_direct="$acl_cv_hardcode_direct"
2189   hardcode_minus_L="$acl_cv_hardcode_minus_L"
2190   dnl Determine whether the user wants rpath handling at all.
2191   AC_ARG_ENABLE(rpath,
2192     [  --disable-rpath         do not hardcode runtime library paths],
2193     :, enable_rpath=yes)
2194 ])
2195
2196 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
2197 dnl the libraries corresponding to explicit and implicit dependencies.
2198 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
2199 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
2200 [
2201   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
2202                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
2203   dnl By default, look in $includedir and $libdir.
2204   use_additional=yes
2205   AC_LIB_WITH_FINAL_PREFIX([
2206     eval additional_includedir=\"$includedir\"
2207     eval additional_libdir=\"$libdir\"
2208   ])
2209   AC_LIB_ARG_WITH([lib$1-prefix],
2210 [  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
2211   --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
2212 [
2213     if test "X$withval" = "Xno"; then
2214       use_additional=no
2215     else
2216       if test "X$withval" = "X"; then
2217         AC_LIB_WITH_FINAL_PREFIX([
2218           eval additional_includedir=\"$includedir\"
2219           eval additional_libdir=\"$libdir\"
2220         ])
2221       else
2222         additional_includedir="$withval/include"
2223         additional_libdir="$withval/lib"
2224       fi
2225     fi
2226 ])
2227   dnl Search the library and its dependencies in $additional_libdir and
2228   dnl $LDFLAGS. Using breadth-first-seach.
2229   LIB[]NAME=
2230   LTLIB[]NAME=
2231   INC[]NAME=
2232   rpathdirs=
2233   ltrpathdirs=
2234   names_already_handled=
2235   names_next_round='$1 $2'
2236   while test -n "$names_next_round"; do
2237     names_this_round="$names_next_round"
2238     names_next_round=
2239     for name in $names_this_round; do
2240       already_handled=
2241       for n in $names_already_handled; do
2242         if test "$n" = "$name"; then
2243           already_handled=yes
2244           break
2245         fi
2246       done
2247       if test -z "$already_handled"; then
2248         names_already_handled="$names_already_handled $name"
2249         dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
2250         dnl or AC_LIB_HAVE_LINKFLAGS call.
2251         uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
2252         eval value=\"\$HAVE_LIB$uppername\"
2253         if test -n "$value"; then
2254           if test "$value" = yes; then
2255             eval value=\"\$LIB$uppername\"
2256             test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
2257             eval value=\"\$LTLIB$uppername\"
2258             test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
2259           else
2260             dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
2261             dnl that this library doesn't exist. So just drop it.
2262             :
2263           fi
2264         else
2265           dnl Search the library lib$name in $additional_libdir and $LDFLAGS
2266           dnl and the already constructed $LIBNAME/$LTLIBNAME.
2267           found_dir=
2268           found_la=
2269           found_so=
2270           found_a=
2271           if test $use_additional = yes; then
2272             if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
2273               found_dir="$additional_libdir"
2274               found_so="$additional_libdir/lib$name.$shlibext"
2275               if test -f "$additional_libdir/lib$name.la"; then
2276                 found_la="$additional_libdir/lib$name.la"
2277               fi
2278             else
2279               if test -f "$additional_libdir/lib$name.$libext"; then
2280                 found_dir="$additional_libdir"
2281                 found_a="$additional_libdir/lib$name.$libext"
2282                 if test -f "$additional_libdir/lib$name.la"; then
2283                   found_la="$additional_libdir/lib$name.la"
2284                 fi
2285               fi
2286             fi
2287           fi
2288           if test "X$found_dir" = "X"; then
2289             for x in $LDFLAGS $LTLIB[]NAME; do
2290               AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2291               case "$x" in
2292                 -L*)
2293                   dir=`echo "X$x" | sed -e 's/^X-L//'`
2294                   if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
2295                     found_dir="$dir"
2296                     found_so="$dir/lib$name.$shlibext"
2297                     if test -f "$dir/lib$name.la"; then
2298                       found_la="$dir/lib$name.la"
2299                     fi
2300                   else
2301                     if test -f "$dir/lib$name.$libext"; then
2302                       found_dir="$dir"
2303                       found_a="$dir/lib$name.$libext"
2304                       if test -f "$dir/lib$name.la"; then
2305                         found_la="$dir/lib$name.la"
2306                       fi
2307                     fi
2308                   fi
2309                   ;;
2310               esac
2311               if test "X$found_dir" != "X"; then
2312                 break
2313               fi
2314             done
2315           fi
2316           if test "X$found_dir" != "X"; then
2317             dnl Found the library.
2318             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
2319             if test "X$found_so" != "X"; then
2320               dnl Linking with a shared library. We attempt to hardcode its
2321               dnl directory into the executable's runpath, unless it's the
2322               dnl standard /usr/lib.
2323               if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
2324                 dnl No hardcoding is needed.
2325                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2326               else
2327                 dnl Use an explicit option to hardcode DIR into the resulting
2328                 dnl binary.
2329                 dnl Potentially add DIR to ltrpathdirs.
2330                 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
2331                 haveit=
2332                 for x in $ltrpathdirs; do
2333                   if test "X$x" = "X$found_dir"; then
2334                     haveit=yes
2335                     break
2336                   fi
2337                 done
2338                 if test -z "$haveit"; then
2339                   ltrpathdirs="$ltrpathdirs $found_dir"
2340                 fi
2341                 dnl The hardcoding into $LIBNAME is system dependent.
2342                 if test "$hardcode_direct" = yes; then
2343                   dnl Using DIR/libNAME.so during linking hardcodes DIR into the
2344                   dnl resulting binary.
2345                   LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2346                 else
2347                   if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
2348                     dnl Use an explicit option to hardcode DIR into the resulting
2349                     dnl binary.
2350                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2351                     dnl Potentially add DIR to rpathdirs.
2352                     dnl The rpathdirs will be appended to $LIBNAME at the end.
2353                     haveit=
2354                     for x in $rpathdirs; do
2355                       if test "X$x" = "X$found_dir"; then
2356                         haveit=yes
2357                         break
2358                       fi
2359                     done
2360                     if test -z "$haveit"; then
2361                       rpathdirs="$rpathdirs $found_dir"
2362                     fi
2363                   else
2364                     dnl Rely on "-L$found_dir".
2365                     dnl But don't add it if it's already contained in the LDFLAGS
2366                     dnl or the already constructed $LIBNAME
2367                     haveit=
2368                     for x in $LDFLAGS $LIB[]NAME; do
2369                       AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2370                       if test "X$x" = "X-L$found_dir"; then
2371                         haveit=yes
2372                         break
2373                       fi
2374                     done
2375                     if test -z "$haveit"; then
2376                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
2377                     fi
2378                     if test "$hardcode_minus_L" != no; then
2379                       dnl FIXME: Not sure whether we should use
2380                       dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
2381                       dnl here.
2382                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2383                     else
2384                       dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
2385                       dnl here, because this doesn't fit in flags passed to the
2386                       dnl compiler. So give up. No hardcoding. This affects only
2387                       dnl very old systems.
2388                       dnl FIXME: Not sure whether we should use
2389                       dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
2390                       dnl here.
2391                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2392                     fi
2393                   fi
2394                 fi
2395               fi
2396             else
2397               if test "X$found_a" != "X"; then
2398                 dnl Linking with a static library.
2399                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
2400               else
2401                 dnl We shouldn't come here, but anyway it's good to have a
2402                 dnl fallback.
2403                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
2404               fi
2405             fi
2406             dnl Assume the include files are nearby.
2407             additional_includedir=
2408             case "$found_dir" in
2409               */lib | */lib/)
2410                 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
2411                 additional_includedir="$basedir/include"
2412                 ;;
2413             esac
2414             if test "X$additional_includedir" != "X"; then
2415               dnl Potentially add $additional_includedir to $INCNAME.
2416               dnl But don't add it
2417               dnl   1. if it's the standard /usr/include,
2418               dnl   2. if it's /usr/local/include and we are using GCC on Linux,
2419               dnl   3. if it's already present in $CPPFLAGS or the already
2420               dnl      constructed $INCNAME,
2421               dnl   4. if it doesn't exist as a directory.
2422               if test "X$additional_includedir" != "X/usr/include"; then
2423                 haveit=
2424                 if test "X$additional_includedir" = "X/usr/local/include"; then
2425                   if test -n "$GCC"; then
2426                     case $host_os in
2427                       linux*) haveit=yes;;
2428                     esac
2429                   fi
2430                 fi
2431                 if test -z "$haveit"; then
2432                   for x in $CPPFLAGS $INC[]NAME; do
2433                     AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2434                     if test "X$x" = "X-I$additional_includedir"; then
2435                       haveit=yes
2436                       break
2437                     fi
2438                   done
2439                   if test -z "$haveit"; then
2440                     if test -d "$additional_includedir"; then
2441                       dnl Really add $additional_includedir to $INCNAME.
2442                       INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
2443                     fi
2444                   fi
2445                 fi
2446               fi
2447             fi
2448             dnl Look for dependencies.
2449             if test -n "$found_la"; then
2450               dnl Read the .la file. It defines the variables
2451               dnl dlname, library_names, old_library, dependency_libs, current,
2452               dnl age, revision, installed, dlopen, dlpreopen, libdir.
2453               save_libdir="$libdir"
2454               case "$found_la" in
2455                 */* | *\\*) . "$found_la" ;;
2456                 *) . "./$found_la" ;;
2457               esac
2458               libdir="$save_libdir"
2459               dnl We use only dependency_libs.
2460               for dep in $dependency_libs; do
2461                 case "$dep" in
2462                   -L*)
2463                     additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
2464                     dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
2465                     dnl But don't add it
2466                     dnl   1. if it's the standard /usr/lib,
2467                     dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
2468                     dnl   3. if it's already present in $LDFLAGS or the already
2469                     dnl      constructed $LIBNAME,
2470                     dnl   4. if it doesn't exist as a directory.
2471                     if test "X$additional_libdir" != "X/usr/lib"; then
2472                       haveit=
2473                       if test "X$additional_libdir" = "X/usr/local/lib"; then
2474                         if test -n "$GCC"; then
2475                           case $host_os in
2476                             linux*) haveit=yes;;
2477                           esac
2478                         fi
2479                       fi
2480                       if test -z "$haveit"; then
2481                         haveit=
2482                         for x in $LDFLAGS $LIB[]NAME; do
2483                           AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2484                           if test "X$x" = "X-L$additional_libdir"; then
2485                             haveit=yes
2486                             break
2487                           fi
2488                         done
2489                         if test -z "$haveit"; then
2490                           if test -d "$additional_libdir"; then
2491                             dnl Really add $additional_libdir to $LIBNAME.
2492                             LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
2493                           fi
2494                         fi
2495                         haveit=
2496                         for x in $LDFLAGS $LTLIB[]NAME; do
2497                           AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2498                           if test "X$x" = "X-L$additional_libdir"; then
2499                             haveit=yes
2500                             break
2501                           fi
2502                         done
2503                         if test -z "$haveit"; then
2504                           if test -d "$additional_libdir"; then
2505                             dnl Really add $additional_libdir to $LTLIBNAME.
2506                             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
2507                           fi
2508                         fi
2509                       fi
2510                     fi
2511                     ;;
2512                   -R*)
2513                     dir=`echo "X$dep" | sed -e 's/^X-R//'`
2514                     if test "$enable_rpath" != no; then
2515                       dnl Potentially add DIR to rpathdirs.
2516                       dnl The rpathdirs will be appended to $LIBNAME at the end.
2517                       haveit=
2518                       for x in $rpathdirs; do
2519                         if test "X$x" = "X$dir"; then
2520                           haveit=yes
2521                           break
2522                         fi
2523                       done
2524                       if test -z "$haveit"; then
2525                         rpathdirs="$rpathdirs $dir"
2526                       fi
2527                       dnl Potentially add DIR to ltrpathdirs.
2528                       dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
2529                       haveit=
2530                       for x in $ltrpathdirs; do
2531                         if test "X$x" = "X$dir"; then
2532                           haveit=yes
2533                           break
2534                         fi
2535                       done
2536                       if test -z "$haveit"; then
2537                         ltrpathdirs="$ltrpathdirs $dir"
2538                       fi
2539                     fi
2540                     ;;
2541                   -l*)
2542                     dnl Handle this in the next round.
2543                     names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
2544                     ;;
2545                   *.la)
2546                     dnl Handle this in the next round. Throw away the .la's
2547                     dnl directory; it is already contained in a preceding -L
2548                     dnl option.
2549                     names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
2550                     ;;
2551                   *)
2552                     dnl Most likely an immediate library name.
2553                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
2554                     LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
2555                     ;;
2556                 esac
2557               done
2558             fi
2559           else
2560             dnl Didn't find the library; assume it is in the system directories
2561             dnl known to the linker and runtime loader. (All the system
2562             dnl directories known to the linker should also be known to the
2563             dnl runtime loader, otherwise the system is severely misconfigured.)
2564             LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2565             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
2566           fi
2567         fi
2568       fi
2569     done
2570   done
2571   if test "X$rpathdirs" != "X"; then
2572     if test -n "$hardcode_libdir_separator"; then
2573       dnl Weird platform: only the last -rpath option counts, the user must
2574       dnl pass all path elements in one option. We can arrange that for a
2575       dnl single library, but not when more than one $LIBNAMEs are used.
2576       alldirs=
2577       for found_dir in $rpathdirs; do
2578         alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
2579       done
2580       dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
2581       acl_save_libdir="$libdir"
2582       libdir="$alldirs"
2583       eval flag=\"$hardcode_libdir_flag_spec\"
2584       libdir="$acl_save_libdir"
2585       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2586     else
2587       dnl The -rpath options are cumulative.
2588       for found_dir in $rpathdirs; do
2589         acl_save_libdir="$libdir"
2590         libdir="$found_dir"
2591         eval flag=\"$hardcode_libdir_flag_spec\"
2592         libdir="$acl_save_libdir"
2593         LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2594       done
2595     fi
2596   fi
2597   if test "X$ltrpathdirs" != "X"; then
2598     dnl When using libtool, the option that works for both libraries and
2599     dnl executables is -R. The -R options are cumulative.
2600     for found_dir in $ltrpathdirs; do
2601       LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
2602     done
2603   fi
2604 ])
2605
2606 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
2607 dnl unless already present in VAR.
2608 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
2609 dnl contains two or three consecutive elements that belong together.
2610 AC_DEFUN([AC_LIB_APPENDTOVAR],
2611 [
2612   for element in [$2]; do
2613     haveit=
2614     for x in $[$1]; do
2615       AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2616       if test "X$x" = "X$element"; then
2617         haveit=yes
2618         break
2619       fi
2620     done
2621     if test -z "$haveit"; then
2622       [$1]="${[$1]}${[$1]:+ }$element"
2623     fi
2624   done
2625 ])
2626
2627 # lib-ld.m4 serial 3 (gettext-0.13)
2628 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
2629 dnl This file is free software, distributed under the terms of the GNU
2630 dnl General Public License.  As a special exception to the GNU General
2631 dnl Public License, this file may be distributed as part of a program
2632 dnl that contains a configuration script generated by Autoconf, under
2633 dnl the same distribution terms as the rest of that program.
2634
2635 dnl Subroutines of libtool.m4,
2636 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
2637 dnl with libtool.m4.
2638
2639 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
2640 AC_DEFUN([AC_LIB_PROG_LD_GNU],
2641 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
2642 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
2643 case `$LD -v 2>&1 </dev/null` in
2644 *GNU* | *'with BFD'*)
2645   acl_cv_prog_gnu_ld=yes ;;
2646 *)
2647   acl_cv_prog_gnu_ld=no ;;
2648 esac])
2649 with_gnu_ld=$acl_cv_prog_gnu_ld
2650 ])
2651
2652 dnl From libtool-1.4. Sets the variable LD.
2653 AC_DEFUN([AC_LIB_PROG_LD],
2654 [AC_ARG_WITH(gnu-ld,
2655 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
2656 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
2657 AC_REQUIRE([AC_PROG_CC])dnl
2658 AC_REQUIRE([AC_CANONICAL_HOST])dnl
2659 # Prepare PATH_SEPARATOR.
2660 # The user is always right.
2661 if test "${PATH_SEPARATOR+set}" != set; then
2662   echo "#! /bin/sh" >conf$$.sh
2663   echo  "exit 0"   >>conf$$.sh
2664   chmod +x conf$$.sh
2665   if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
2666     PATH_SEPARATOR=';'
2667   else
2668     PATH_SEPARATOR=:
2669   fi
2670   rm -f conf$$.sh
2671 fi
2672 ac_prog=ld
2673 if test "$GCC" = yes; then
2674   # Check if gcc -print-prog-name=ld gives a path.
2675   AC_MSG_CHECKING([for ld used by GCC])
2676   case $host in
2677   *-*-mingw*)
2678     # gcc leaves a trailing carriage return which upsets mingw
2679     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
2680   *)
2681     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
2682   esac
2683   case $ac_prog in
2684     # Accept absolute paths.
2685     [[\\/]* | [A-Za-z]:[\\/]*)]
2686       [re_direlt='/[^/][^/]*/\.\./']
2687       # Canonicalize the path of ld
2688       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
2689       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2690         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
2691       done
2692       test -z "$LD" && LD="$ac_prog"
2693       ;;
2694   "")
2695     # If it fails, then pretend we aren't using GCC.
2696     ac_prog=ld
2697     ;;
2698   *)
2699     # If it is relative, then search for the first ld in PATH.
2700     with_gnu_ld=unknown
2701     ;;
2702   esac
2703 elif test "$with_gnu_ld" = yes; then
2704   AC_MSG_CHECKING([for GNU ld])
2705 else
2706   AC_MSG_CHECKING([for non-GNU ld])
2707 fi
2708 AC_CACHE_VAL(acl_cv_path_LD,
2709 [if test -z "$LD"; then
2710   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2711   for ac_dir in $PATH; do
2712     test -z "$ac_dir" && ac_dir=.
2713     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2714       acl_cv_path_LD="$ac_dir/$ac_prog"
2715       # Check to see if the program is GNU ld.  I'd rather use --version,
2716       # but apparently some GNU ld's only accept -v.
2717       # Break only if it was the GNU/non-GNU ld that we prefer.
2718       case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
2719       *GNU* | *'with BFD'*)
2720         test "$with_gnu_ld" != no && break ;;
2721       *)
2722         test "$with_gnu_ld" != yes && break ;;
2723       esac
2724     fi
2725   done
2726   IFS="$ac_save_ifs"
2727 else
2728   acl_cv_path_LD="$LD" # Let the user override the test with a path.
2729 fi])
2730 LD="$acl_cv_path_LD"
2731 if test -n "$LD"; then
2732   AC_MSG_RESULT($LD)
2733 else
2734   AC_MSG_RESULT(no)
2735 fi
2736 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
2737 AC_LIB_PROG_LD_GNU
2738 ])
2739
2740 # iconv.m4 serial AM4 (gettext-0.11.3)
2741 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2742 dnl This file is free software, distributed under the terms of the GNU
2743 dnl General Public License.  As a special exception to the GNU General
2744 dnl Public License, this file may be distributed as part of a program
2745 dnl that contains a configuration script generated by Autoconf, under
2746 dnl the same distribution terms as the rest of that program.
2747
2748 dnl From Bruno Haible.
2749
2750 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
2751 [
2752   dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
2753   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2754   AC_REQUIRE([AC_LIB_RPATH])
2755
2756   dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
2757   dnl accordingly.
2758   AC_LIB_LINKFLAGS_BODY([iconv])
2759 ])
2760
2761 AC_DEFUN([AM_ICONV_LINK],
2762 [
2763   dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
2764   dnl those with the standalone portable GNU libiconv installed).
2765
2766   dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
2767   dnl accordingly.
2768   AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
2769
2770   dnl Add $INCICONV to CPPFLAGS before performing the following checks,
2771   dnl because if the user has installed libiconv and not disabled its use
2772   dnl via --without-libiconv-prefix, he wants to use it. The first
2773   dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
2774   am_save_CPPFLAGS="$CPPFLAGS"
2775   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
2776
2777   AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
2778     am_cv_func_iconv="no, consider installing GNU libiconv"
2779     am_cv_lib_iconv=no
2780     AC_TRY_LINK([#include <stdlib.h>
2781 #include <iconv.h>],
2782       [iconv_t cd = iconv_open("","");
2783        iconv(cd,NULL,NULL,NULL,NULL);
2784        iconv_close(cd);],
2785       am_cv_func_iconv=yes)
2786     if test "$am_cv_func_iconv" != yes; then
2787       am_save_LIBS="$LIBS"
2788       LIBS="$LIBS $LIBICONV"
2789       AC_TRY_LINK([#include <stdlib.h>
2790 #include <iconv.h>],
2791         [iconv_t cd = iconv_open("","");
2792          iconv(cd,NULL,NULL,NULL,NULL);
2793          iconv_close(cd);],
2794         am_cv_lib_iconv=yes
2795         am_cv_func_iconv=yes)
2796       LIBS="$am_save_LIBS"
2797     fi
2798   ])
2799   if test "$am_cv_func_iconv" = yes; then
2800     AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
2801   fi
2802   if test "$am_cv_lib_iconv" = yes; then
2803     AC_MSG_CHECKING([how to link with libiconv])
2804     AC_MSG_RESULT([$LIBICONV])
2805   else
2806     dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
2807     dnl either.
2808     CPPFLAGS="$am_save_CPPFLAGS"
2809     LIBICONV=
2810     LTLIBICONV=
2811   fi
2812   AC_SUBST(LIBICONV)
2813   AC_SUBST(LTLIBICONV)
2814 ])
2815
2816 AC_DEFUN([AM_ICONV],
2817 [
2818   AM_ICONV_LINK
2819   if test "$am_cv_func_iconv" = yes; then
2820     AC_MSG_CHECKING([for iconv declaration])
2821     AC_CACHE_VAL(am_cv_proto_iconv, [
2822       AC_TRY_COMPILE([
2823 #include <stdlib.h>
2824 #include <iconv.h>
2825 extern
2826 #ifdef __cplusplus
2827 "C"
2828 #endif
2829 #if defined(__STDC__) || defined(__cplusplus)
2830 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
2831 #else
2832 size_t iconv();
2833 #endif
2834 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
2835       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);"])
2836     am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
2837     AC_MSG_RESULT([$]{ac_t:-
2838          }[$]am_cv_proto_iconv)
2839     AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
2840       [Define as const if the declaration of iconv() needs const.])
2841   fi
2842 ])
2843
2844 # isc-posix.m4 serial 2 (gettext-0.11.2)
2845 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
2846 dnl This file is free software, distributed under the terms of the GNU
2847 dnl General Public License.  As a special exception to the GNU General
2848 dnl Public License, this file may be distributed as part of a program
2849 dnl that contains a configuration script generated by Autoconf, under
2850 dnl the same distribution terms as the rest of that program.
2851
2852 # This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
2853
2854 # This test replaces the one in autoconf.
2855 # Currently this macro should have the same name as the autoconf macro
2856 # because gettext's gettext.m4 (distributed in the automake package)
2857 # still uses it.  Otherwise, the use in gettext.m4 makes autoheader
2858 # give these diagnostics:
2859 #   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
2860 #   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
2861
2862 undefine([AC_ISC_POSIX])
2863
2864 AC_DEFUN([AC_ISC_POSIX],
2865   [
2866     dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
2867     AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
2868   ]
2869 )
2870
2871 # signed.m4 serial 1 (gettext-0.10.40)
2872 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
2873 dnl This file is free software, distributed under the terms of the GNU
2874 dnl General Public License.  As a special exception to the GNU General
2875 dnl Public License, this file may be distributed as part of a program
2876 dnl that contains a configuration script generated by Autoconf, under
2877 dnl the same distribution terms as the rest of that program.
2878
2879 dnl From Bruno Haible.
2880
2881 AC_DEFUN([bh_C_SIGNED],
2882 [
2883   AC_CACHE_CHECK([for signed], bh_cv_c_signed,
2884    [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)])
2885   if test $bh_cv_c_signed = no; then
2886     AC_DEFINE(signed, ,
2887               [Define to empty if the C compiler doesn't support this keyword.])
2888   fi
2889 ])
2890
2891 # longlong.m4 serial 4
2892 dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
2893 dnl This file is free software, distributed under the terms of the GNU
2894 dnl General Public License.  As a special exception to the GNU General
2895 dnl Public License, this file may be distributed as part of a program
2896 dnl that contains a configuration script generated by Autoconf, under
2897 dnl the same distribution terms as the rest of that program.
2898
2899 dnl From Paul Eggert.
2900
2901 # Define HAVE_LONG_LONG if 'long long' works.
2902
2903 AC_DEFUN([jm_AC_TYPE_LONG_LONG],
2904 [
2905   AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
2906   [AC_TRY_LINK([long long ll = 1LL; int i = 63;],
2907     [long long llmax = (long long) -1;
2908      return ll << i | ll >> i | llmax / ll | llmax % ll;],
2909     ac_cv_type_long_long=yes,
2910     ac_cv_type_long_long=no)])
2911   if test $ac_cv_type_long_long = yes; then
2912     AC_DEFINE(HAVE_LONG_LONG, 1,
2913       [Define if you have the 'long long' type.])
2914   fi
2915 ])
2916
2917 # longdouble.m4 serial 1 (gettext-0.12)
2918 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
2919 dnl This file is free software, distributed under the terms of the GNU
2920 dnl General Public License.  As a special exception to the GNU General
2921 dnl Public License, this file may be distributed as part of a program
2922 dnl that contains a configuration script generated by Autoconf, under
2923 dnl the same distribution terms as the rest of that program.
2924
2925 dnl From Bruno Haible.
2926 dnl Test whether the compiler supports the 'long double' type.
2927 dnl Prerequisite: AC_PROG_CC
2928
2929 AC_DEFUN([gt_TYPE_LONGDOUBLE],
2930 [
2931   AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
2932     [if test "$GCC" = yes; then
2933        gt_cv_c_long_double=yes
2934      else
2935        AC_TRY_COMPILE([
2936          /* The Stardent Vistra knows sizeof(long double), but does not support it.  */
2937          long double foo = 0.0;
2938          /* On Ultrix 4.3 cc, long double is 4 and double is 8.  */
2939          int array [2*(sizeof(long double) >= sizeof(double)) - 1];
2940          ], ,
2941          gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
2942      fi])
2943   if test $gt_cv_c_long_double = yes; then
2944     AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
2945   fi
2946 ])
2947
2948 # wchar_t.m4 serial 1 (gettext-0.12)
2949 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
2950 dnl This file is free software, distributed under the terms of the GNU
2951 dnl General Public License.  As a special exception to the GNU General
2952 dnl Public License, this file may be distributed as part of a program
2953 dnl that contains a configuration script generated by Autoconf, under
2954 dnl the same distribution terms as the rest of that program.
2955
2956 dnl From Bruno Haible.
2957 dnl Test whether <stddef.h> has the 'wchar_t' type.
2958 dnl Prerequisite: AC_PROG_CC
2959
2960 AC_DEFUN([gt_TYPE_WCHAR_T],
2961 [
2962   AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t,
2963     [AC_TRY_COMPILE([#include <stddef.h>
2964        wchar_t foo = (wchar_t)'\0';], ,
2965        gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)])
2966   if test $gt_cv_c_wchar_t = yes; then
2967     AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.])
2968   fi
2969 ])
2970
2971 # wint_t.m4 serial 1 (gettext-0.12)
2972 dnl Copyright (C) 2003 Free Software Foundation, Inc.
2973 dnl This file is free software, distributed under the terms of the GNU
2974 dnl General Public License.  As a special exception to the GNU General
2975 dnl Public License, this file may be distributed as part of a program
2976 dnl that contains a configuration script generated by Autoconf, under
2977 dnl the same distribution terms as the rest of that program.
2978
2979 dnl From Bruno Haible.
2980 dnl Test whether <wchar.h> has the 'wint_t' type.
2981 dnl Prerequisite: AC_PROG_CC
2982
2983 AC_DEFUN([gt_TYPE_WINT_T],
2984 [
2985   AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
2986     [AC_TRY_COMPILE([#include <wchar.h>
2987        wint_t foo = (wchar_t)'\0';], ,
2988        gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
2989   if test $gt_cv_c_wint_t = yes; then
2990     AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
2991   fi
2992 ])
2993
2994 # inttypes_h.m4 serial 5 (gettext-0.12)
2995 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
2996 dnl This file is free software, distributed under the terms of the GNU
2997 dnl General Public License.  As a special exception to the GNU General
2998 dnl Public License, this file may be distributed as part of a program
2999 dnl that contains a configuration script generated by Autoconf, under
3000 dnl the same distribution terms as the rest of that program.
3001
3002 dnl From Paul Eggert.
3003
3004 # Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
3005 # doesn't clash with <sys/types.h>, and declares uintmax_t.
3006
3007 AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
3008 [
3009   AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
3010   [AC_TRY_COMPILE(
3011     [#include <sys/types.h>
3012 #include <inttypes.h>],
3013     [uintmax_t i = (uintmax_t) -1;],
3014     jm_ac_cv_header_inttypes_h=yes,
3015     jm_ac_cv_header_inttypes_h=no)])
3016   if test $jm_ac_cv_header_inttypes_h = yes; then
3017     AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
3018       [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
3019        and declares uintmax_t. ])
3020   fi
3021 ])
3022
3023 # stdint_h.m4 serial 3 (gettext-0.12)
3024 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
3025 dnl This file is free software, distributed under the terms of the GNU
3026 dnl General Public License.  As a special exception to the GNU General
3027 dnl Public License, this file may be distributed as part of a program
3028 dnl that contains a configuration script generated by Autoconf, under
3029 dnl the same distribution terms as the rest of that program.
3030
3031 dnl From Paul Eggert.
3032
3033 # Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
3034 # doesn't clash with <sys/types.h>, and declares uintmax_t.
3035
3036 AC_DEFUN([jm_AC_HEADER_STDINT_H],
3037 [
3038   AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
3039   [AC_TRY_COMPILE(
3040     [#include <sys/types.h>
3041 #include <stdint.h>],
3042     [uintmax_t i = (uintmax_t) -1;],
3043     jm_ac_cv_header_stdint_h=yes,
3044     jm_ac_cv_header_stdint_h=no)])
3045   if test $jm_ac_cv_header_stdint_h = yes; then
3046     AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
3047       [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
3048        and declares uintmax_t. ])
3049   fi
3050 ])
3051
3052 # intmax.m4 serial 1 (gettext-0.12)
3053 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
3054 dnl This file is free software, distributed under the terms of the GNU
3055 dnl General Public License.  As a special exception to the GNU General
3056 dnl Public License, this file may be distributed as part of a program
3057 dnl that contains a configuration script generated by Autoconf, under
3058 dnl the same distribution terms as the rest of that program.
3059
3060 dnl From Bruno Haible.
3061 dnl Test whether the system has the 'intmax_t' type, but don't attempt to
3062 dnl find a replacement if it is lacking.
3063
3064 AC_DEFUN([gt_TYPE_INTMAX_T],
3065 [
3066   AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
3067   AC_REQUIRE([jm_AC_HEADER_STDINT_H])
3068   AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
3069     [AC_TRY_COMPILE([
3070 #include <stddef.h> 
3071 #include <stdlib.h>
3072 #if HAVE_STDINT_H_WITH_UINTMAX
3073 #include <stdint.h>
3074 #endif
3075 #if HAVE_INTTYPES_H_WITH_UINTMAX
3076 #include <inttypes.h>
3077 #endif
3078 ], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
3079   if test $gt_cv_c_intmax_t = yes; then
3080     AC_DEFINE(HAVE_INTMAX_T, 1,
3081       [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
3082   fi
3083 ])
3084
3085 # printf-posix.m4 serial 2 (gettext-0.13.1)
3086 dnl Copyright (C) 2003 Free Software Foundation, Inc.
3087 dnl This file is free software, distributed under the terms of the GNU
3088 dnl General Public License.  As a special exception to the GNU General
3089 dnl Public License, this file may be distributed as part of a program
3090 dnl that contains a configuration script generated by Autoconf, under
3091 dnl the same distribution terms as the rest of that program.
3092
3093 dnl From Bruno Haible.
3094 dnl Test whether the printf() function supports POSIX/XSI format strings with
3095 dnl positions.
3096
3097 AC_DEFUN([gt_PRINTF_POSIX],
3098 [
3099   AC_REQUIRE([AC_PROG_CC])
3100   AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings],
3101     gt_cv_func_printf_posix,
3102     [
3103       AC_TRY_RUN([
3104 #include <stdio.h>
3105 #include <string.h>
3106 /* The string "%2$d %1$d", with dollar characters protected from the shell's
3107    dollar expansion (possibly an autoconf bug).  */
3108 static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
3109 static char buf[100];
3110 int main ()
3111 {
3112   sprintf (buf, format, 33, 55);
3113   return (strcmp (buf, "55 33") != 0);
3114 }], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no,
3115       [
3116         AC_EGREP_CPP(notposix, [
3117 #if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
3118   notposix
3119 #endif
3120         ], gt_cv_func_printf_posix="guessing no",
3121            gt_cv_func_printf_posix="guessing yes")
3122       ])
3123     ])
3124   case $gt_cv_func_printf_posix in
3125     *yes)
3126       AC_DEFINE(HAVE_POSIX_PRINTF, 1,
3127         [Define if your printf() function supports format strings with positions.])
3128       ;;
3129   esac
3130 ])
3131
3132 # glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
3133 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
3134 dnl This file is free software, distributed under the terms of the GNU
3135 dnl General Public License.  As a special exception to the GNU General
3136 dnl Public License, this file may be distributed as part of a program
3137 dnl that contains a configuration script generated by Autoconf, under
3138 dnl the same distribution terms as the rest of that program.
3139
3140 # Test for the GNU C Library, version 2.1 or newer.
3141 # From Bruno Haible.
3142
3143 AC_DEFUN([jm_GLIBC21],
3144   [
3145     AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
3146       ac_cv_gnu_library_2_1,
3147       [AC_EGREP_CPP([Lucky GNU user],
3148         [
3149 #include <features.h>
3150 #ifdef __GNU_LIBRARY__
3151  #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
3152   Lucky GNU user
3153  #endif
3154 #endif
3155         ],
3156         ac_cv_gnu_library_2_1=yes,
3157         ac_cv_gnu_library_2_1=no)
3158       ]
3159     )
3160     AC_SUBST(GLIBC21)
3161     GLIBC21="$ac_cv_gnu_library_2_1"
3162   ]
3163 )
3164
3165 # intdiv0.m4 serial 1 (gettext-0.11.3)
3166 dnl Copyright (C) 2002 Free Software Foundation, Inc.
3167 dnl This file is free software, distributed under the terms of the GNU
3168 dnl General Public License.  As a special exception to the GNU General
3169 dnl Public License, this file may be distributed as part of a program
3170 dnl that contains a configuration script generated by Autoconf, under
3171 dnl the same distribution terms as the rest of that program.
3172
3173 dnl From Bruno Haible.
3174
3175 AC_DEFUN([gt_INTDIV0],
3176 [
3177   AC_REQUIRE([AC_PROG_CC])dnl
3178   AC_REQUIRE([AC_CANONICAL_HOST])dnl
3179
3180   AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
3181     gt_cv_int_divbyzero_sigfpe,
3182     [
3183       AC_TRY_RUN([
3184 #include <stdlib.h>
3185 #include <signal.h>
3186
3187 static void
3188 #ifdef __cplusplus
3189 sigfpe_handler (int sig)
3190 #else
3191 sigfpe_handler (sig) int sig;
3192 #endif
3193 {
3194   /* Exit with code 0 if SIGFPE, with code 1 if any other signal.  */
3195   exit (sig != SIGFPE);
3196 }
3197
3198 int x = 1;
3199 int y = 0;
3200 int z;
3201 int nan;
3202
3203 int main ()
3204 {
3205   signal (SIGFPE, sigfpe_handler);
3206 /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP.  */
3207 #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
3208   signal (SIGTRAP, sigfpe_handler);
3209 #endif
3210 /* Linux/SPARC yields signal SIGILL.  */
3211 #if defined (__sparc__) && defined (__linux__)
3212   signal (SIGILL, sigfpe_handler);
3213 #endif
3214
3215   z = x / y;
3216   nan = y / y;
3217   exit (1);
3218 }
3219 ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
3220         [
3221           # Guess based on the CPU.
3222           case "$host_cpu" in
3223             alpha* | i[34567]86 | m68k | s390*)
3224               gt_cv_int_divbyzero_sigfpe="guessing yes";;
3225             *)
3226               gt_cv_int_divbyzero_sigfpe="guessing no";;
3227           esac
3228         ])
3229     ])
3230   case "$gt_cv_int_divbyzero_sigfpe" in
3231     *yes) value=1;;
3232     *) value=0;;
3233   esac
3234   AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
3235     [Define if integer division by zero raises signal SIGFPE.])
3236 ])
3237
3238 # uintmax_t.m4 serial 7 (gettext-0.12)
3239 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
3240 dnl This file is free software, distributed under the terms of the GNU
3241 dnl General Public License.  As a special exception to the GNU General
3242 dnl Public License, this file may be distributed as part of a program
3243 dnl that contains a configuration script generated by Autoconf, under
3244 dnl the same distribution terms as the rest of that program.
3245
3246 dnl From Paul Eggert.
3247
3248 AC_PREREQ(2.13)
3249
3250 # Define uintmax_t to 'unsigned long' or 'unsigned long long'
3251 # if it is not already defined in <stdint.h> or <inttypes.h>.
3252
3253 AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
3254 [
3255   AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
3256   AC_REQUIRE([jm_AC_HEADER_STDINT_H])
3257   if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
3258     AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
3259     test $ac_cv_type_unsigned_long_long = yes \
3260       && ac_type='unsigned long long' \
3261       || ac_type='unsigned long'
3262     AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
3263       [Define to unsigned long or unsigned long long
3264        if <stdint.h> and <inttypes.h> don't define.])
3265   else
3266     AC_DEFINE(HAVE_UINTMAX_T, 1,
3267       [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
3268   fi
3269 ])
3270
3271 # ulonglong.m4 serial 3
3272 dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
3273 dnl This file is free software, distributed under the terms of the GNU
3274 dnl General Public License.  As a special exception to the GNU General
3275 dnl Public License, this file may be distributed as part of a program
3276 dnl that contains a configuration script generated by Autoconf, under
3277 dnl the same distribution terms as the rest of that program.
3278
3279 dnl From Paul Eggert.
3280
3281 # Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
3282
3283 AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
3284 [
3285   AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
3286   [AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;],
3287     [unsigned long long ullmax = (unsigned long long) -1;
3288      return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
3289     ac_cv_type_unsigned_long_long=yes,
3290     ac_cv_type_unsigned_long_long=no)])
3291   if test $ac_cv_type_unsigned_long_long = yes; then
3292     AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
3293       [Define if you have the 'unsigned long long' type.])
3294   fi
3295 ])
3296
3297 # inttypes.m4 serial 1 (gettext-0.11.4)
3298 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
3299 dnl This file is free software, distributed under the terms of the GNU
3300 dnl General Public License.  As a special exception to the GNU General
3301 dnl Public License, this file may be distributed as part of a program
3302 dnl that contains a configuration script generated by Autoconf, under
3303 dnl the same distribution terms as the rest of that program.
3304
3305 dnl From Paul Eggert.
3306
3307 # Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
3308 # <sys/types.h>.
3309
3310 AC_DEFUN([gt_HEADER_INTTYPES_H],
3311 [
3312   AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
3313   [
3314     AC_TRY_COMPILE(
3315       [#include <sys/types.h>
3316 #include <inttypes.h>],
3317       [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
3318   ])
3319   if test $gt_cv_header_inttypes_h = yes; then
3320     AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
3321       [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
3322   fi
3323 ])
3324
3325 # inttypes-pri.m4 serial 1 (gettext-0.11.4)
3326 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
3327 dnl This file is free software, distributed under the terms of the GNU
3328 dnl General Public License.  As a special exception to the GNU General
3329 dnl Public License, this file may be distributed as part of a program
3330 dnl that contains a configuration script generated by Autoconf, under
3331 dnl the same distribution terms as the rest of that program.
3332
3333 dnl From Bruno Haible.
3334
3335 # Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
3336 # macros to non-string values.  This is the case on AIX 4.3.3.
3337
3338 AC_DEFUN([gt_INTTYPES_PRI],
3339 [
3340   AC_REQUIRE([gt_HEADER_INTTYPES_H])
3341   if test $gt_cv_header_inttypes_h = yes; then
3342     AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
3343       gt_cv_inttypes_pri_broken,
3344       [
3345         AC_TRY_COMPILE([#include <inttypes.h>
3346 #ifdef PRId32
3347 char *p = PRId32;
3348 #endif
3349 ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
3350       ])
3351   fi
3352   if test "$gt_cv_inttypes_pri_broken" = yes; then
3353     AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
3354       [Define if <inttypes.h> exists and defines unusable PRI* macros.])
3355   fi
3356 ])
3357
3358 # xsize.m4 serial 2
3359 dnl Copyright (C) 2003 Free Software Foundation, Inc.
3360 dnl This file is free software, distributed under the terms of the GNU
3361 dnl General Public License.  As a special exception to the GNU General
3362 dnl Public License, this file may be distributed as part of a program
3363 dnl that contains a configuration script generated by Autoconf, under
3364 dnl the same distribution terms as the rest of that program.
3365
3366 AC_DEFUN([gl_XSIZE],
3367 [
3368   dnl Prerequisites of lib/xsize.h.
3369   AC_REQUIRE([gl_SIZE_MAX])
3370   AC_CHECK_HEADERS(stdint.h)
3371 ])
3372
3373 # size_max.m4 serial 2
3374 dnl Copyright (C) 2003 Free Software Foundation, Inc.
3375 dnl This file is free software, distributed under the terms of the GNU
3376 dnl General Public License.  As a special exception to the GNU General
3377 dnl Public License, this file may be distributed as part of a program
3378 dnl that contains a configuration script generated by Autoconf, under
3379 dnl the same distribution terms as the rest of that program.
3380
3381 dnl From Bruno Haible.
3382
3383 AC_DEFUN([gl_SIZE_MAX],
3384 [
3385   AC_CHECK_HEADERS(stdint.h)
3386   dnl First test whether the system already has SIZE_MAX.
3387   AC_MSG_CHECKING([for SIZE_MAX])
3388   result=
3389   AC_EGREP_CPP([Found it], [
3390 #include <limits.h>
3391 #if HAVE_STDINT_H
3392 #include <stdint.h>
3393 #endif
3394 #ifdef SIZE_MAX
3395 Found it
3396 #endif
3397 ], result=yes)
3398   if test -z "$result"; then
3399     dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
3400     dnl than the type 'unsigned long'.
3401     dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses 'expr',
3402     dnl which is guaranteed to work from LONG_MIN to LONG_MAX.
3403     _AC_COMPUTE_INT([~(size_t)0 / 10], res_hi,
3404       [#include <stddef.h>], result=?)
3405     _AC_COMPUTE_INT([~(size_t)0 % 10], res_lo,
3406       [#include <stddef.h>], result=?)
3407     _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint,
3408       [#include <stddef.h>], result=?)
3409     if test "$fits_in_uint" = 1; then
3410       dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
3411       dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
3412       AC_TRY_COMPILE([#include <stddef.h>
3413         extern size_t foo;
3414         extern unsigned long foo;
3415         ], [], fits_in_uint=0)
3416     fi
3417     if test -z "$result"; then
3418       if test "$fits_in_uint" = 1; then
3419         result="$res_hi$res_lo"U
3420       else
3421         result="$res_hi$res_lo"UL
3422       fi
3423     else
3424       dnl Shouldn't happen, but who knows...
3425       result='~(size_t)0'
3426     fi
3427   fi
3428   AC_MSG_RESULT([$result])
3429   if test "$result" != yes; then
3430     AC_DEFINE_UNQUOTED([SIZE_MAX], [$result],
3431       [Define as the maximum value of type 'size_t', if the system doesn't define it.])
3432   fi
3433 ])
3434
3435 # codeset.m4 serial AM1 (gettext-0.10.40)
3436 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
3437 dnl This file is free software, distributed under the terms of the GNU
3438 dnl General Public License.  As a special exception to the GNU General
3439 dnl Public License, this file may be distributed as part of a program
3440 dnl that contains a configuration script generated by Autoconf, under
3441 dnl the same distribution terms as the rest of that program.
3442
3443 dnl From Bruno Haible.
3444
3445 AC_DEFUN([AM_LANGINFO_CODESET],
3446 [
3447   AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
3448     [AC_TRY_LINK([#include <langinfo.h>],
3449       [char* cs = nl_langinfo(CODESET);],
3450       am_cv_langinfo_codeset=yes,
3451       am_cv_langinfo_codeset=no)
3452     ])
3453   if test $am_cv_langinfo_codeset = yes; then
3454     AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
3455       [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
3456   fi
3457 ])
3458
3459 # lcmessage.m4 serial 3 (gettext-0.11.3)
3460 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
3461 dnl This file is free software, distributed under the terms of the GNU
3462 dnl General Public License.  As a special exception to the GNU General
3463 dnl Public License, this file may be distributed as part of a program
3464 dnl that contains a configuration script generated by Autoconf, under
3465 dnl the same distribution terms as the rest of that program.
3466 dnl
3467 dnl This file can can be used in projects which are not available under
3468 dnl the GNU General Public License or the GNU Library General Public
3469 dnl License but which still want to provide support for the GNU gettext
3470 dnl functionality.
3471 dnl Please note that the actual code of the GNU gettext library is covered
3472 dnl by the GNU Library General Public License, and the rest of the GNU
3473 dnl gettext package package is covered by the GNU General Public License.
3474 dnl They are *not* in the public domain.
3475
3476 dnl Authors:
3477 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995.
3478
3479 # Check whether LC_MESSAGES is available in <locale.h>.
3480
3481 AC_DEFUN([AM_LC_MESSAGES],
3482 [
3483   AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
3484     [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
3485        am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
3486   if test $am_cv_val_LC_MESSAGES = yes; then
3487     AC_DEFINE(HAVE_LC_MESSAGES, 1,
3488       [Define if your <locale.h> file defines LC_MESSAGES.])
3489   fi
3490 ])
3491