]> git.saurik.com Git - bison.git/blob - aclocal.m4
* tests/regression.at, tests/torture.at, tests/calc.at: Adjust to
[bison.git] / aclocal.m4
1 # aclocal.m4 generated automatically by aclocal 1.5c -*- Autoconf -*-
2
3 # Copyright 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 1996, 1997, 1998, 1999, 2000, 2001, 2002
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 8
38
39 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
40 # written in clear, in which case automake, when reading aclocal.m4,
41 # will think it sees a *use*, and therefore will trigger all it's
42 # C support machinery. Also note that it means that autoscan, seeing
43 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
44
45
46 AC_PREREQ([2.52])
47
48 # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
49 # the ones we care about.
50 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
51
52 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
53 # AM_INIT_AUTOMAKE([OPTIONS])
54 # -----------------------------------------------
55 # The call with PACKAGE and VERSION arguments is the old style
56 # call (pre autoconf-2.50), which is being phased out. PACKAGE
57 # and VERSION should now be passed to AC_INIT and removed from
58 # the call to AM_INIT_AUTOMAKE.
59 # We support both call styles for the transition. After
60 # the next Automake release, Autoconf can make the AC_INIT
61 # arguments mandatory, and then we can depend on a new Autoconf
62 # release and drop the old call support.
63 AC_DEFUN([AM_INIT_AUTOMAKE],
64 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
65 AC_REQUIRE([AC_PROG_INSTALL])dnl
66 # test to see if srcdir already configured
67 if test "`cd $srcdir && pwd`" != "`pwd`" &&
68 test -f $srcdir/config.status; then
69 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
70 fi
71
72 # Define the identity of the package.
73 dnl Distinguish between old-style and new-style calls.
74 m4_ifval([$2],
75 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
76 AC_SUBST([PACKAGE], [$1])dnl
77 AC_SUBST([VERSION], [$2])],
78 [_AM_SET_OPTIONS([$1])dnl
79 AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl
80 AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl
81
82 _AM_IF_OPTION([no-define],,
83 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
84 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
85
86 # Some tools Automake needs.
87 AC_REQUIRE([AM_SANITY_CHECK])dnl
88 AC_REQUIRE([AC_ARG_PROGRAM])dnl
89 AM_MISSING_PROG(ACLOCAL, "aclocal-${am__api_version}")
90 AM_MISSING_PROG(AUTOCONF, autoconf)
91 AM_MISSING_PROG(AUTOMAKE, "automake-${am__api_version}")
92 AM_MISSING_PROG(AUTOHEADER, autoheader)
93 AM_MISSING_PROG(MAKEINFO, makeinfo)
94 AM_MISSING_PROG(AMTAR, tar)
95 AM_PROG_INSTALL_SH
96 AM_PROG_INSTALL_STRIP
97 # We need awk for the "check" target. The system "awk" is bad on
98 # some platforms.
99 AC_REQUIRE([AC_PROG_AWK])dnl
100 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
101
102 _AM_IF_OPTION([no-dependencies],,
103 [AC_PROVIDE_IFELSE([AC_PROG_][CC],
104 [_AM_DEPENDENCIES(CC)],
105 [define([AC_PROG_][CC],
106 defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl
107 AC_PROVIDE_IFELSE([AC_PROG_][CXX],
108 [_AM_DEPENDENCIES(CXX)],
109 [define([AC_PROG_][CXX],
110 defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl
111 ])
112 ])
113
114 # Copyright 2002 Free Software Foundation, Inc.
115
116 # This program is free software; you can redistribute it and/or modify
117 # it under the terms of the GNU General Public License as published by
118 # the Free Software Foundation; either version 2, or (at your option)
119 # any later version.
120
121 # This program is distributed in the hope that it will be useful,
122 # but WITHOUT ANY WARRANTY; without even the implied warranty of
123 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
124 # GNU General Public License for more details.
125
126 # You should have received a copy of the GNU General Public License
127 # along with this program; if not, write to the Free Software
128 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
129
130 # AM_AUTOMAKE_VERSION(VERSION)
131 # ----------------------------
132 # Automake X.Y traces this macro to ensure aclocal.m4 has been
133 # generated from the m4 files accompanying Automake X.Y.
134 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.5c"])
135
136 # AM_SET_CURRENT_AUTOMAKE_VERSION
137 # -------------------------------
138 # Call AM_AUTOMAKE_VERSION so it can be traced.
139 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
140 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
141 [AM_AUTOMAKE_VERSION([1.5c])])
142
143 # Helper functions for option handling. -*- Autoconf -*-
144
145 # Copyright 2001, 2002 Free Software Foundation, Inc.
146
147 # This program is free software; you can redistribute it and/or modify
148 # it under the terms of the GNU General Public License as published by
149 # the Free Software Foundation; either version 2, or (at your option)
150 # any later version.
151
152 # This program is distributed in the hope that it will be useful,
153 # but WITHOUT ANY WARRANTY; without even the implied warranty of
154 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
155 # GNU General Public License for more details.
156
157 # You should have received a copy of the GNU General Public License
158 # along with this program; if not, write to the Free Software
159 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
160 # 02111-1307, USA.
161
162 # serial 2
163
164 # _AM_MANGLE_OPTION(NAME)
165 # -----------------------
166 AC_DEFUN([_AM_MANGLE_OPTION],
167 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
168
169 # _AM_SET_OPTION(NAME)
170 # ------------------------------
171 # Set option NAME. Presently that only means defining a flag for this option.
172 AC_DEFUN([_AM_SET_OPTION],
173 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
174
175 # _AM_SET_OPTIONS(OPTIONS)
176 # ----------------------------------
177 # OPTIONS is a space-separated list of Automake options.
178 AC_DEFUN([_AM_SET_OPTIONS],
179 [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
180
181 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
182 # -------------------------------------------
183 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
184 AC_DEFUN([_AM_IF_OPTION],
185 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
186
187 #
188 # Check to make sure that the build environment is sane.
189 #
190
191 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
192
193 # This program is free software; you can redistribute it and/or modify
194 # it under the terms of the GNU General Public License as published by
195 # the Free Software Foundation; either version 2, or (at your option)
196 # any later version.
197
198 # This program is distributed in the hope that it will be useful,
199 # but WITHOUT ANY WARRANTY; without even the implied warranty of
200 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
201 # GNU General Public License for more details.
202
203 # You should have received a copy of the GNU General Public License
204 # along with this program; if not, write to the Free Software
205 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
206 # 02111-1307, USA.
207
208 # serial 3
209
210 # AM_SANITY_CHECK
211 # ---------------
212 AC_DEFUN([AM_SANITY_CHECK],
213 [AC_MSG_CHECKING([whether build environment is sane])
214 # Just in case
215 sleep 1
216 echo timestamp > conftest.file
217 # Do `set' in a subshell so we don't clobber the current shell's
218 # arguments. Must try -L first in case configure is actually a
219 # symlink; some systems play weird games with the mod time of symlinks
220 # (eg FreeBSD returns the mod time of the symlink's containing
221 # directory).
222 if (
223 set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
224 if test "$[*]" = "X"; then
225 # -L didn't work.
226 set X `ls -t $srcdir/configure conftest.file`
227 fi
228 rm -f conftest.file
229 if test "$[*]" != "X $srcdir/configure conftest.file" \
230 && test "$[*]" != "X conftest.file $srcdir/configure"; then
231
232 # If neither matched, then we have a broken ls. This can happen
233 # if, for instance, CONFIG_SHELL is bash and it inherits a
234 # broken ls alias from the environment. This has actually
235 # happened. Such a system could not be considered "sane".
236 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
237 alias in your environment])
238 fi
239
240 test "$[2]" = conftest.file
241 )
242 then
243 # Ok.
244 :
245 else
246 AC_MSG_ERROR([newly created file is older than distributed files!
247 Check your system clock])
248 fi
249 AC_MSG_RESULT(yes)])
250
251 # -*- Autoconf -*-
252
253
254 # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
255
256 # This program is free software; you can redistribute it and/or modify
257 # it under the terms of the GNU General Public License as published by
258 # the Free Software Foundation; either version 2, or (at your option)
259 # any later version.
260
261 # This program is distributed in the hope that it will be useful,
262 # but WITHOUT ANY WARRANTY; without even the implied warranty of
263 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
264 # GNU General Public License for more details.
265
266 # You should have received a copy of the GNU General Public License
267 # along with this program; if not, write to the Free Software
268 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
269 # 02111-1307, USA.
270
271 # serial 3
272
273 # AM_MISSING_PROG(NAME, PROGRAM)
274 # ------------------------------
275 AC_DEFUN([AM_MISSING_PROG],
276 [AC_REQUIRE([AM_MISSING_HAS_RUN])
277 $1=${$1-"${am_missing_run}$2"}
278 AC_SUBST($1)])
279
280
281 # AM_MISSING_HAS_RUN
282 # ------------------
283 # Define MISSING if not defined so far and test if it supports --run.
284 # If it does, set am_missing_run to use it, otherwise, to nothing.
285 AC_DEFUN([AM_MISSING_HAS_RUN],
286 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
287 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
288 # Use eval to expand $SHELL
289 if eval "$MISSING --run true"; then
290 am_missing_run="$MISSING --run "
291 else
292 am_missing_run=
293 AC_MSG_WARN([`missing' script is too old or missing])
294 fi
295 ])
296
297 # AM_AUX_DIR_EXPAND
298
299 # Copyright 2001 Free Software Foundation, Inc.
300
301 # This program is free software; you can redistribute it and/or modify
302 # it under the terms of the GNU General Public License as published by
303 # the Free Software Foundation; either version 2, or (at your option)
304 # any later version.
305
306 # This program is distributed in the hope that it will be useful,
307 # but WITHOUT ANY WARRANTY; without even the implied warranty of
308 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
309 # GNU General Public License for more details.
310
311 # You should have received a copy of the GNU General Public License
312 # along with this program; if not, write to the Free Software
313 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
314 # 02111-1307, USA.
315
316 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
317 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
318 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
319 #
320 # Of course, Automake must honor this variable whenever it calls a
321 # tool from the auxiliary directory. The problem is that $srcdir (and
322 # therefore $ac_aux_dir as well) can be either absolute or relative,
323 # depending on how configure is run. This is pretty annoying, since
324 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
325 # source directory, any form will work fine, but in subdirectories a
326 # relative path needs to be adjusted first.
327 #
328 # $ac_aux_dir/missing
329 # fails when called from a subdirectory if $ac_aux_dir is relative
330 # $top_srcdir/$ac_aux_dir/missing
331 # fails if $ac_aux_dir is absolute,
332 # fails when called from a subdirectory in a VPATH build with
333 # a relative $ac_aux_dir
334 #
335 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
336 # are both prefixed by $srcdir. In an in-source build this is usually
337 # harmless because $srcdir is `.', but things will broke when you
338 # start a VPATH build or use an absolute $srcdir.
339 #
340 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
341 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
342 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
343 # and then we would define $MISSING as
344 # MISSING="\${SHELL} $am_aux_dir/missing"
345 # This will work as long as MISSING is not called from configure, because
346 # unfortunately $(top_srcdir) has no meaning in configure.
347 # However there are other variables, like CC, which are often used in
348 # configure, and could therefore not use this "fixed" $ac_aux_dir.
349 #
350 # Another solution, used here, is to always expand $ac_aux_dir to an
351 # absolute PATH. The drawback is that using absolute paths prevent a
352 # configured tree to be moved without reconfiguration.
353
354 # Rely on autoconf to set up CDPATH properly.
355 AC_PREREQ([2.50])
356
357 AC_DEFUN([AM_AUX_DIR_EXPAND], [
358 # expand $ac_aux_dir to an absolute path
359 am_aux_dir=`cd $ac_aux_dir && pwd`
360 ])
361
362 # AM_PROG_INSTALL_SH
363 # ------------------
364 # Define $install_sh.
365
366 # Copyright 2001 Free Software Foundation, Inc.
367
368 # This program is free software; you can redistribute it and/or modify
369 # it under the terms of the GNU General Public License as published by
370 # the Free Software Foundation; either version 2, or (at your option)
371 # any later version.
372
373 # This program is distributed in the hope that it will be useful,
374 # but WITHOUT ANY WARRANTY; without even the implied warranty of
375 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
376 # GNU General Public License for more details.
377
378 # You should have received a copy of the GNU General Public License
379 # along with this program; if not, write to the Free Software
380 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
381 # 02111-1307, USA.
382
383 AC_DEFUN([AM_PROG_INSTALL_SH],
384 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
385 install_sh=${install_sh-"$am_aux_dir/install-sh"}
386 AC_SUBST(install_sh)])
387
388 # AM_PROG_INSTALL_STRIP
389
390 # Copyright 2001 Free Software Foundation, Inc.
391
392 # This program is free software; you can redistribute it and/or modify
393 # it under the terms of the GNU General Public License as published by
394 # the Free Software Foundation; either version 2, or (at your option)
395 # any later version.
396
397 # This program is distributed in the hope that it will be useful,
398 # but WITHOUT ANY WARRANTY; without even the implied warranty of
399 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
400 # GNU General Public License for more details.
401
402 # You should have received a copy of the GNU General Public License
403 # along with this program; if not, write to the Free Software
404 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
405 # 02111-1307, USA.
406
407 # One issue with vendor `install' (even GNU) is that you can't
408 # specify the program used to strip binaries. This is especially
409 # annoying in cross-compiling environments, where the build's strip
410 # is unlikely to handle the host's binaries.
411 # Fortunately install-sh will honor a STRIPPROG variable, so we
412 # always use install-sh in `make install-strip', and initialize
413 # STRIPPROG with the value of the STRIP variable (set by the user).
414 AC_DEFUN([AM_PROG_INSTALL_STRIP],
415 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
416 # Installed binaries are usually stripped using `strip' when the user
417 # run `make install-strip'. However `strip' might not be the right
418 # tool to use in cross-compilation environments, therefore Automake
419 # will honor the `STRIP' environment variable to overrule this program.
420 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
421 if test "$cross_compiling" != no; then
422 AC_CHECK_TOOL([STRIP], [strip], :)
423 fi
424 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
425 AC_SUBST([INSTALL_STRIP_PROGRAM])])
426
427 # serial 4 -*- Autoconf -*-
428
429 # Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
430
431 # This program is free software; you can redistribute it and/or modify
432 # it under the terms of the GNU General Public License as published by
433 # the Free Software Foundation; either version 2, or (at your option)
434 # any later version.
435
436 # This program is distributed in the hope that it will be useful,
437 # but WITHOUT ANY WARRANTY; without even the implied warranty of
438 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
439 # GNU General Public License for more details.
440
441 # You should have received a copy of the GNU General Public License
442 # along with this program; if not, write to the Free Software
443 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
444 # 02111-1307, USA.
445
446
447 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
448 # written in clear, in which case automake, when reading aclocal.m4,
449 # will think it sees a *use*, and therefore will trigger all it's
450 # C support machinery. Also note that it means that autoscan, seeing
451 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
452
453
454
455 # _AM_DEPENDENCIES(NAME)
456 # ----------------------
457 # See how the compiler implements dependency checking.
458 # NAME is "CC", "CXX", "GCJ", or "OBJC".
459 # We try a few techniques and use that to set a single cache variable.
460 #
461 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
462 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
463 # dependency, and given that the user is not expected to run this macro,
464 # just rely on AC_PROG_CC.
465 AC_DEFUN([_AM_DEPENDENCIES],
466 [AC_REQUIRE([AM_SET_DEPDIR])dnl
467 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
468 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
469 AC_REQUIRE([AM_DEP_TRACK])dnl
470
471 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
472 [$1], CXX, [depcc="$CXX" am_compiler_list=],
473 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc']
474 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
475 [depcc="$$1" am_compiler_list=])
476
477 AC_CACHE_CHECK([dependency style of $depcc],
478 [am_cv_$1_dependencies_compiler_type],
479 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
480 # We make a subdir and do the tests there. Otherwise we can end up
481 # making bogus files that we don't know about and never remove. For
482 # instance it was reported that on HP-UX the gcc test will end up
483 # making a dummy file named `D' -- because `-MD' means `put the output
484 # in D'.
485 mkdir conftest.dir
486 # Copy depcomp to subdir because otherwise we won't find it if we're
487 # using a relative directory.
488 cp "$am_depcomp" conftest.dir
489 cd conftest.dir
490
491 am_cv_$1_dependencies_compiler_type=none
492 if test "$am_compiler_list" = ""; then
493 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
494 fi
495 for depmode in $am_compiler_list; do
496 # We need to recreate these files for each test, as the compiler may
497 # overwrite some of them when testing with obscure command lines.
498 # This happens at least with the AIX C compiler.
499 echo '#include "conftest.h"' > conftest.c
500 echo 'int i;' > conftest.h
501 echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
502
503 case $depmode in
504 nosideeffect)
505 # after this tag, mechanisms are not by side-effect, so they'll
506 # only be used when explicitly requested
507 if test "x$enable_dependency_tracking" = xyes; then
508 continue
509 else
510 break
511 fi
512 ;;
513 none) break ;;
514 esac
515 # We check with `-c' and `-o' for the sake of the "dashmstdout"
516 # mode. It turns out that the SunPro C++ compiler does not properly
517 # handle `-M -o', and we need to detect this.
518 if depmode=$depmode \
519 source=conftest.c object=conftest.o \
520 depfile=conftest.Po tmpdepfile=conftest.TPo \
521 $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
522 grep conftest.h conftest.Po > /dev/null 2>&1 &&
523 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
524 am_cv_$1_dependencies_compiler_type=$depmode
525 break
526 fi
527 done
528
529 cd ..
530 rm -rf conftest.dir
531 else
532 am_cv_$1_dependencies_compiler_type=none
533 fi
534 ])
535 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
536 ])
537
538
539 # AM_SET_DEPDIR
540 # -------------
541 # Choose a directory name for dependency files.
542 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
543 AC_DEFUN([AM_SET_DEPDIR],
544 [rm -f .deps 2>/dev/null
545 mkdir .deps 2>/dev/null
546 if test -d .deps; then
547 DEPDIR=.deps
548 else
549 # MS-DOS does not allow filenames that begin with a dot.
550 DEPDIR=_deps
551 fi
552 rmdir .deps 2>/dev/null
553 AC_SUBST([DEPDIR])
554 ])
555
556
557 # AM_DEP_TRACK
558 # ------------
559 AC_DEFUN([AM_DEP_TRACK],
560 [AC_ARG_ENABLE(dependency-tracking,
561 [ --disable-dependency-tracking Speeds up one-time builds
562 --enable-dependency-tracking Do not reject slow dependency extractors])
563 if test "x$enable_dependency_tracking" != xno; then
564 am_depcomp="$ac_aux_dir/depcomp"
565 AMDEPBACKSLASH='\'
566 fi
567 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
568 AC_SUBST([AMDEPBACKSLASH])
569 ])
570
571 # Generate code to set up dependency tracking. -*- Autoconf -*-
572
573 # Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
574
575 # This program is free software; you can redistribute it and/or modify
576 # it under the terms of the GNU General Public License as published by
577 # the Free Software Foundation; either version 2, or (at your option)
578 # any later version.
579
580 # This program is distributed in the hope that it will be useful,
581 # but WITHOUT ANY WARRANTY; without even the implied warranty of
582 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
583 # GNU General Public License for more details.
584
585 # You should have received a copy of the GNU General Public License
586 # along with this program; if not, write to the Free Software
587 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
588 # 02111-1307, USA.
589
590 #serial 2
591
592 # _AM_OUTPUT_DEPENDENCY_COMMANDS
593 # ------------------------------
594 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
595 [for mf in $CONFIG_FILES; do
596 # Strip MF so we end up with the name of the file.
597 mf=`echo "$mf" | sed -e 's/:.*$//'`
598 if (head -1 $mf | fgrep 'generated by automake') > /dev/null 2>&1; then
599 dirpart=`AS_DIRNAME("$mf")`
600 else
601 dirpart=
602 fi
603 grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
604 # Extract the definition of DEP_FILES from the Makefile without
605 # running `make'.
606 DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
607 test -z "$DEPDIR" && continue
608 # When using ansi2knr, U may be empty or an underscore; expand it
609 U=`sed -n -e '/^U = / s///p' < "$mf"`
610 test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
611 # We invoke sed twice because it is the simplest approach to
612 # changing $(DEPDIR) to its actual value in the expansion.
613 for file in `sed -n -e '
614 /^DEP_FILES = .*\\\\$/ {
615 s/^DEP_FILES = //
616 :loop
617 s/\\\\$//
618 p
619 n
620 /\\\\$/ b loop
621 p
622 }
623 /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
624 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
625 # Make sure the directory exists.
626 test -f "$dirpart/$file" && continue
627 fdir=`AS_DIRNAME(["$file"])`
628 AS_MKDIR_P([$dirpart/$fdir])
629 # echo "creating $dirpart/$file"
630 echo '# dummy' > "$dirpart/$file"
631 done
632 done
633 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
634
635
636 # AM_OUTPUT_DEPENDENCY_COMMANDS
637 # -----------------------------
638 # This macro should only be invoked once -- use via AC_REQUIRE.
639 #
640 # This code is only required when automatic dependency tracking
641 # is enabled. FIXME. This creates each `.P' file that we will
642 # need in order to bootstrap the dependency handling code.
643 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
644 [AC_CONFIG_COMMANDS([depfiles],
645 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
646 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
647 ])
648
649 # Copyright 2001 Free Software Foundation, Inc. -*- Autoconf -*-
650
651 # This program is free software; you can redistribute it and/or modify
652 # it under the terms of the GNU General Public License as published by
653 # the Free Software Foundation; either version 2, or (at your option)
654 # any later version.
655
656 # This program is distributed in the hope that it will be useful,
657 # but WITHOUT ANY WARRANTY; without even the implied warranty of
658 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
659 # GNU General Public License for more details.
660
661 # You should have received a copy of the GNU General Public License
662 # along with this program; if not, write to the Free Software
663 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
664 # 02111-1307, USA.
665
666 # serial 2
667
668 # AM_MAKE_INCLUDE()
669 # -----------------
670 # Check to see how make treats includes.
671 AC_DEFUN([AM_MAKE_INCLUDE],
672 [am_make=${MAKE-make}
673 cat > confinc << 'END'
674 doit:
675 @echo done
676 END
677 # If we don't find an include directive, just comment out the code.
678 AC_MSG_CHECKING([for style of include used by $am_make])
679 am__include="#"
680 am__quote=
681 _am_result=none
682 # First try GNU make style include.
683 echo "include confinc" > confmf
684 # We grep out `Entering directory' and `Leaving directory'
685 # messages which can occur if `w' ends up in MAKEFLAGS.
686 # In particular we don't look at `^make:' because GNU make might
687 # be invoked under some other name (usually "gmake"), in which
688 # case it prints its new name instead of `make'.
689 if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
690 am__include=include
691 am__quote=
692 _am_result=GNU
693 fi
694 # Now try BSD make style include.
695 if test "$am__include" = "#"; then
696 echo '.include "confinc"' > confmf
697 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
698 am__include=.include
699 am__quote="\""
700 _am_result=BSD
701 fi
702 fi
703 AC_SUBST(am__include)
704 AC_SUBST(am__quote)
705 AC_MSG_RESULT($_am_result)
706 rm -f confinc confmf
707 ])
708
709 # AM_CONDITIONAL -*- Autoconf -*-
710
711 # Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
712
713 # This program is free software; you can redistribute it and/or modify
714 # it under the terms of the GNU General Public License as published by
715 # the Free Software Foundation; either version 2, or (at your option)
716 # any later version.
717
718 # This program is distributed in the hope that it will be useful,
719 # but WITHOUT ANY WARRANTY; without even the implied warranty of
720 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
721 # GNU General Public License for more details.
722
723 # You should have received a copy of the GNU General Public License
724 # along with this program; if not, write to the Free Software
725 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
726 # 02111-1307, USA.
727
728 # serial 5
729
730 AC_PREREQ(2.52)
731
732 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
733 # -------------------------------------
734 # Define a conditional.
735 AC_DEFUN([AM_CONDITIONAL],
736 [ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
737 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
738 AC_SUBST([$1_TRUE])
739 AC_SUBST([$1_FALSE])
740 if $2; then
741 $1_TRUE=
742 $1_FALSE='#'
743 else
744 $1_TRUE='#'
745 $1_FALSE=
746 fi
747 AC_CONFIG_COMMANDS_PRE(
748 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
749 AC_MSG_ERROR([conditional \"$1\" was never defined.
750 Usually this means the macro was only invoked conditionally.])
751 fi])])
752
753 # Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
754
755 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
756
757 # This program is free software; you can redistribute it and/or modify
758 # it under the terms of the GNU General Public License as published by
759 # the Free Software Foundation; either version 2, or (at your option)
760 # any later version.
761
762 # This program is distributed in the hope that it will be useful,
763 # but WITHOUT ANY WARRANTY; without even the implied warranty of
764 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
765 # GNU General Public License for more details.
766
767 # You should have received a copy of the GNU General Public License
768 # along with this program; if not, write to the Free Software
769 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
770 # 02111-1307, USA.
771
772 AC_PREREQ([2.52])
773
774 # serial 6
775
776 # When config.status generates a header, we must update the stamp-h file.
777 # This file resides in the same directory as the config header
778 # that is generated. We must strip everything past the first ":",
779 # and everything past the last "/".
780
781 # _AM_DIRNAME(PATH)
782 # -----------------
783 # Like AS_DIRNAME, only do it during macro expansion
784 AC_DEFUN([_AM_DIRNAME],
785 [m4_if(regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
786 m4_if(regexp([$1], [^//\([^/]\|$\)]), -1,
787 m4_if(regexp([$1], [^/.*]), -1,
788 [.],
789 patsubst([$1], [^\(/\).*], [\1])),
790 patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
791 patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
792 ])# _AM_DIRNAME
793
794
795 # The stamp files are numbered to have different names.
796 # We could number them on a directory basis, but that's additional
797 # complications, let's have a unique counter.
798 m4_define([_AM_STAMP_Count], [0])
799
800
801 # _AM_STAMP(HEADER)
802 # -----------------
803 # The name of the stamp file for HEADER.
804 AC_DEFUN([_AM_STAMP],
805 [m4_define([_AM_STAMP_Count], m4_incr(_AM_STAMP_Count))dnl
806 AS_ESCAPE(_AM_DIRNAME(patsubst([$1],
807 [:.*])))/stamp-h[]_AM_STAMP_Count])
808
809
810 # _AM_CONFIG_HEADER(HEADER[:SOURCES], COMMANDS, INIT-COMMANDS)
811 # ------------------------------------------------------------
812 # We used to try to get a real timestamp in stamp-h. But the fear is that
813 # that will cause unnecessary cvs conflicts.
814 AC_DEFUN([_AM_CONFIG_HEADER],
815 [# Add the stamp file to the list of files AC keeps track of,
816 # along with our hook.
817 AC_CONFIG_HEADERS([$1],
818 [# update the timestamp
819 echo 'timestamp for $1' >"_AM_STAMP([$1])"
820 $2],
821 [$3])
822 ])# _AM_CONFIG_HEADER
823
824
825 # AM_CONFIG_HEADER(HEADER[:SOURCES]..., COMMANDS, INIT-COMMANDS)
826 # --------------------------------------------------------------
827 AC_DEFUN([AM_CONFIG_HEADER],
828 [AC_FOREACH([_AM_File], [$1], [_AM_CONFIG_HEADER(_AM_File, [$2], [$3])])
829 ])# AM_CONFIG_HEADER
830
831 #serial 1
832 # This test replaces the one in autoconf.
833 # Currently this macro should have the same name as the autoconf macro
834 # because gettext's gettext.m4 (distributed in the automake package)
835 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
836 # give these diagnostics:
837 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
838 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
839
840 undefine([AC_ISC_POSIX])
841
842 AC_DEFUN([AC_ISC_POSIX],
843 [
844 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
845 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
846 ]
847 )
848
849
850 # Copyright 1996, 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
851
852 # This program is free software; you can redistribute it and/or modify
853 # it under the terms of the GNU General Public License as published by
854 # the Free Software Foundation; either version 2, or (at your option)
855 # any later version.
856
857 # This program is distributed in the hope that it will be useful,
858 # but WITHOUT ANY WARRANTY; without even the implied warranty of
859 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
860 # GNU General Public License for more details.
861
862 # You should have received a copy of the GNU General Public License
863 # along with this program; if not, write to the Free Software
864 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
865 # 02111-1307, USA.
866
867 # serial 1
868
869 # @defmac AC_PROG_CC_STDC
870 # @maindex PROG_CC_STDC
871 # @ovindex CC
872 # If the C compiler in not in ANSI C mode by default, try to add an option
873 # to output variable @code{CC} to make it so. This macro tries various
874 # options that select ANSI C on some system or another. It considers the
875 # compiler to be in ANSI C mode if it handles function prototypes correctly.
876 #
877 # If you use this macro, you should check after calling it whether the C
878 # compiler has been set to accept ANSI C; if not, the shell variable
879 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
880 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
881 # program @code{ansi2knr}, which comes with Ghostscript.
882 # @end defmac
883
884 AC_DEFUN([AM_PROG_CC_STDC],
885 [AC_REQUIRE([AC_PROG_CC])
886 AC_BEFORE([$0], [AC_C_INLINE])
887 AC_BEFORE([$0], [AC_C_CONST])
888 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
889 dnl a magic option to avoid problems with ANSI preprocessor commands
890 dnl like #elif.
891 dnl FIXME: can't do this because then AC_AIX won't work due to a
892 dnl circular dependency.
893 dnl AC_BEFORE([$0], [AC_PROG_CPP])
894 AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
895 AC_CACHE_VAL(am_cv_prog_cc_stdc,
896 [am_cv_prog_cc_stdc=no
897 ac_save_CC="$CC"
898 # Don't try gcc -ansi; that turns off useful extensions and
899 # breaks some systems' header files.
900 # AIX -qlanglvl=ansi
901 # Ultrix and OSF/1 -std1
902 # HP-UX 10.20 and later -Ae
903 # HP-UX older versions -Aa -D_HPUX_SOURCE
904 # SVR4 -Xc -D__EXTENSIONS__
905 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
906 do
907 CC="$ac_save_CC $ac_arg"
908 AC_TRY_COMPILE(
909 [#include <stdarg.h>
910 #include <stdio.h>
911 #include <sys/types.h>
912 #include <sys/stat.h>
913 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
914 struct buf { int x; };
915 FILE * (*rcsopen) (struct buf *, struct stat *, int);
916 static char *e (p, i)
917 char **p;
918 int i;
919 {
920 return p[i];
921 }
922 static char *f (char * (*g) (char **, int), char **p, ...)
923 {
924 char *s;
925 va_list v;
926 va_start (v,p);
927 s = g (p, va_arg (v,int));
928 va_end (v);
929 return s;
930 }
931 int test (int i, double x);
932 struct s1 {int (*f) (int a);};
933 struct s2 {int (*f) (double a);};
934 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
935 int argc;
936 char **argv;
937 ], [
938 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
939 ],
940 [am_cv_prog_cc_stdc="$ac_arg"; break])
941 done
942 CC="$ac_save_CC"
943 ])
944 if test -z "$am_cv_prog_cc_stdc"; then
945 AC_MSG_RESULT([none needed])
946 else
947 AC_MSG_RESULT([$am_cv_prog_cc_stdc])
948 fi
949 case "x$am_cv_prog_cc_stdc" in
950 x|xno) ;;
951 *) CC="$CC $am_cv_prog_cc_stdc" ;;
952 esac
953 ])
954
955 AC_DEFUN(BISON_WARNING,
956 [AC_MSG_CHECKING(whether compiler accepts $1)
957 AC_SUBST(WARNING_CFLAGS)
958 ac_save_CFLAGS="$CFLAGS"
959 CFLAGS="$CFLAGS $1"
960 AC_TRY_COMPILE(,
961 [int x;],
962 WARNING_CFLAGS="$WARNING_CFLAGS $1"
963 AC_MSG_RESULT(yes),
964 AC_MSG_RESULT(no))
965 CFLAGS="$ac_save_CFLAGS"])
966
967
968 # Copyright 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
969
970 # This program is free software; you can redistribute it and/or modify
971 # it under the terms of the GNU General Public License as published by
972 # the Free Software Foundation; either version 2, or (at your option)
973 # any later version.
974
975 # This program is distributed in the hope that it will be useful,
976 # but WITHOUT ANY WARRANTY; without even the implied warranty of
977 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
978 # GNU General Public License for more details.
979
980 # You should have received a copy of the GNU General Public License
981 # along with this program; if not, write to the Free Software
982 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
983 # 02111-1307, USA.
984
985 # serial 1
986
987 AC_DEFUN([AM_C_PROTOTYPES],
988 [AC_REQUIRE([AM_PROG_CC_STDC])
989 AC_REQUIRE([AC_PROG_CPP])
990 AC_MSG_CHECKING([for function prototypes])
991 if test "$am_cv_prog_cc_stdc" != no; then
992 AC_MSG_RESULT(yes)
993 AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
994 U= ANSI2KNR=
995 else
996 AC_MSG_RESULT(no)
997 U=_ ANSI2KNR=./ansi2knr
998 fi
999 # Ensure some checks needed by ansi2knr itself.
1000 AC_HEADER_STDC
1001 AC_CHECK_HEADERS(string.h)
1002 AC_SUBST(U)dnl
1003 AC_SUBST(ANSI2KNR)dnl
1004 ])
1005
1006 #serial 5
1007
1008 dnl From Jim Meyering.
1009 dnl Determine whether malloc accepts 0 as its argument.
1010 dnl If it doesn't, arrange to use the replacement function.
1011 dnl
1012
1013 AC_DEFUN([jm_FUNC_MALLOC],
1014 [
1015 dnl xmalloc.c requires that this symbol be defined so it doesn't
1016 dnl mistakenly use a broken malloc -- as it might if this test were omitted.
1017 AC_DEFINE(HAVE_DONE_WORKING_MALLOC_CHECK, 1,
1018 [Define if the malloc check has been performed. ])
1019
1020 AC_CACHE_CHECK([for working malloc], jm_cv_func_working_malloc,
1021 [AC_TRY_RUN([
1022 char *malloc ();
1023 int
1024 main ()
1025 {
1026 exit (malloc (0) ? 0 : 1);
1027 }
1028 ],
1029 jm_cv_func_working_malloc=yes,
1030 jm_cv_func_working_malloc=no,
1031 dnl When crosscompiling, assume malloc is broken.
1032 jm_cv_func_working_malloc=no)
1033 ])
1034 if test $jm_cv_func_working_malloc = no; then
1035 AC_LIBOBJ(malloc)
1036 AC_DEFINE(malloc, rpl_malloc,
1037 [Define to rpl_malloc if the replacement function should be used.])
1038 fi
1039 ])
1040
1041 #serial 5
1042
1043 dnl From Jim Meyering.
1044 dnl Determine whether realloc works when both arguments are 0.
1045 dnl If it doesn't, arrange to use the replacement function.
1046 dnl
1047
1048 AC_DEFUN([jm_FUNC_REALLOC],
1049 [
1050 dnl xmalloc.c requires that this symbol be defined so it doesn't
1051 dnl mistakenly use a broken realloc -- as it might if this test were omitted.
1052 AC_DEFINE(HAVE_DONE_WORKING_REALLOC_CHECK, 1,
1053 [Define if the realloc check has been performed. ])
1054
1055 AC_CACHE_CHECK([for working realloc], jm_cv_func_working_realloc,
1056 [AC_TRY_RUN([
1057 char *realloc ();
1058 int
1059 main ()
1060 {
1061 exit (realloc (0, 0) ? 0 : 1);
1062 }
1063 ],
1064 jm_cv_func_working_realloc=yes,
1065 jm_cv_func_working_realloc=no,
1066 dnl When crosscompiling, assume realloc is broken.
1067 jm_cv_func_working_realloc=no)
1068 ])
1069 if test $jm_cv_func_working_realloc = no; then
1070 AC_LIBOBJ(realloc)
1071 AC_DEFINE(realloc, rpl_realloc,
1072 [Define to rpl_realloc if the replacement function should be used.])
1073 fi
1074 ])
1075
1076 #serial 2
1077
1078 dnl These are the prerequisite macros for files in the lib/
1079 dnl directories of Bison.
1080
1081 AC_DEFUN([jm_PREREQ_QUOTEARG],
1082 [
1083 AC_CHECK_FUNCS(isascii iswprint mbsinit)
1084 jm_FUNC_MBRTOWC
1085 AC_CHECK_HEADERS(limits.h stddef.h stdlib.h string.h wchar.h wctype.h)
1086 AC_HEADER_STDC
1087 AC_C_BACKSLASH_A
1088 AC_MBSTATE_T
1089 AM_C_PROTOTYPES
1090 ])
1091
1092 #serial 4
1093
1094 dnl From Paul Eggert
1095
1096 AC_DEFUN([jm_FUNC_MBRTOWC],
1097 [
1098 AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
1099 jm_cv_func_mbrtowc,
1100 [AC_TRY_LINK(
1101 [#include <wchar.h>],
1102 [mbstate_t state; return ! (sizeof state && mbrtowc);],
1103 jm_cv_func_mbrtowc=yes,
1104 jm_cv_func_mbrtowc=no)])
1105 if test $jm_cv_func_mbrtowc = yes; then
1106 AC_DEFINE(HAVE_MBRTOWC, 1,
1107 [Define to 1 if mbrtowc and mbstate_t are properly declared.])
1108 fi
1109 ])
1110
1111 #serial 4
1112
1113 dnl From Paul Eggert.
1114
1115 AC_DEFUN([AC_C_BACKSLASH_A],
1116 [
1117 AC_CACHE_CHECK([whether backslash-a works in strings], ac_cv_c_backslash_a,
1118 [AC_TRY_COMPILE([],
1119 [
1120 #if '\a' == 'a'
1121 syntax error;
1122 #endif
1123 char buf['\a' == 'a' ? -1 : 1];
1124 buf[0] = '\a';
1125 return buf[0] != "\a"[0];
1126 ],
1127 ac_cv_c_backslash_a=yes,
1128 ac_cv_c_backslash_a=no)])
1129 if test $ac_cv_c_backslash_a = yes; then
1130 AC_DEFINE(HAVE_C_BACKSLASH_A, 1,
1131 [Define if backslash-a works in C strings.])
1132 fi
1133 ])
1134
1135 # serial 9
1136
1137 # From Paul Eggert.
1138
1139 # BeOS 5 has <wchar.h> but does not define mbstate_t,
1140 # so you can't declare an object of that type.
1141 # Check for this incompatibility with Standard C.
1142
1143 # Include stdlib.h first, because otherwise this test would fail on Linux
1144 # (at least glibc-2.1.3) because the "_XOPEN_SOURCE 500" definition elicits
1145 # a syntax error in wchar.h due to the use of undefined __int32_t.
1146
1147 AC_DEFUN([AC_MBSTATE_T],
1148 [
1149 AC_CHECK_HEADERS(stdlib.h)
1150
1151 AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t,
1152 [AC_TRY_COMPILE([
1153 #if HAVE_STDLIB_H
1154 # include <stdlib.h>
1155 #endif
1156 #include <wchar.h>],
1157 [mbstate_t x; return sizeof x;],
1158 ac_cv_type_mbstate_t=yes,
1159 ac_cv_type_mbstate_t=no)])
1160 if test $ac_cv_type_mbstate_t = no; then
1161 AC_DEFINE(mbstate_t, int,
1162 [Define to a type if <wchar.h> does not define.])
1163 fi])
1164
1165 #serial 4
1166
1167 dnl FIXME: put these prerequisite-only *.m4 files in a separate
1168 dnl directory -- otherwise, they'll conflict with existing files.
1169
1170 dnl These are the prerequisite macros for GNU's error.c file.
1171 AC_DEFUN([jm_PREREQ_ERROR],
1172 [
1173 AC_CHECK_FUNCS(strerror vprintf doprnt)
1174 AC_CHECK_DECLS([strerror])
1175 AC_FUNC_STRERROR_R
1176 AC_HEADER_STDC
1177 ])
1178
1179 #serial 1003
1180 # Experimental replacement for the function in the latest CVS autoconf.
1181 # Use with the error.c file in ../lib.
1182
1183 # Copyright 2001 Free Software Foundation, Inc.
1184
1185 # This program is free software; you can redistribute it and/or modify
1186 # it under the terms of the GNU General Public License as published by
1187 # the Free Software Foundation; either version 2, or (at your option)
1188 # any later version.
1189
1190 # This program is distributed in the hope that it will be useful,
1191 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1192 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1193 # GNU General Public License for more details.
1194
1195 # You should have received a copy of the GNU General Public License
1196 # along with this program; if not, write to the Free Software Foundation,
1197 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
1198
1199 undefine([AC_FUNC_STRERROR_R])
1200
1201 # AC_FUNC_STRERROR_R
1202 # ------------------
1203 AC_DEFUN([AC_FUNC_STRERROR_R],
1204 [AC_CHECK_DECLS([strerror_r])
1205 AC_CHECK_FUNCS([strerror_r])
1206 AC_CACHE_CHECK([whether strerror_r returns char *],
1207 ac_cv_func_strerror_r_char_p,
1208 [
1209 ac_cv_func_strerror_r_char_p=no
1210 if test $ac_cv_have_decl_strerror_r = yes; then
1211 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
1212 [[
1213 char buf[100];
1214 char x = *strerror_r (0, buf, sizeof buf);
1215 char *p = strerror_r (0, buf, sizeof buf);
1216 ]])],
1217 ac_cv_func_strerror_r_char_p=yes)
1218 else
1219 # strerror_r is not declared. Choose between
1220 # systems that have relatively inaccessible declarations for the
1221 # function. BeOS and DEC UNIX 4.0 fall in this category, but the
1222 # former has a strerror_r that returns char*, while the latter
1223 # has a strerror_r that returns `int'.
1224 # This test should segfault on the DEC system.
1225 AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT
1226 extern char *strerror_r ();],
1227 [[char buf[100];
1228 char x = *strerror_r (0, buf, sizeof buf);
1229 exit (!isalpha (x));]])],
1230 ac_cv_func_strerror_r_char_p=yes, , :)
1231 fi
1232 ])
1233 if test $ac_cv_func_strerror_r_char_p = yes; then
1234 AC_DEFINE([STRERROR_R_CHAR_P], 1,
1235 [Define to 1 if strerror_r returns char *.])
1236 fi
1237 ])# AC_FUNC_STRERROR_R
1238
1239
1240 # serial 1
1241
1242 AC_DEFUN([AM_WITH_DMALLOC],
1243 [AC_MSG_CHECKING([if malloc debugging is wanted])
1244 AC_ARG_WITH(dmalloc,
1245 [ --with-dmalloc use dmalloc, as in
1246 http://www.dmalloc.com/dmalloc.tar.gz],
1247 [if test "$withval" = yes; then
1248 AC_MSG_RESULT(yes)
1249 AC_DEFINE(WITH_DMALLOC,1,
1250 [Define if using the dmalloc debugging malloc package])
1251 LIBS="$LIBS -ldmalloc"
1252 LDFLAGS="$LDFLAGS -g"
1253 else
1254 AC_MSG_RESULT(no)
1255 fi], [AC_MSG_RESULT(no)])
1256 ])
1257
1258 # Macro to add for using GNU gettext.
1259 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1260 #
1261 # This file can be copied and used freely without restrictions. It can
1262 # be used in projects which are not available under the GNU General Public
1263 # License or the GNU Library General Public License but which still want
1264 # to provide support for the GNU gettext functionality.
1265 # Please note that the actual code of the GNU gettext library is covered
1266 # by the GNU Library General Public License, and the rest of the GNU
1267 # gettext package package is covered by the GNU General Public License.
1268 # They are *not* in the public domain.
1269
1270 # serial 10
1271
1272 dnl Usage: AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR]).
1273 dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library
1274 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
1275 dnl depending on --{enable,disable}-{shared,static} and on the presence of
1276 dnl AM-DISABLE-SHARED). Otherwise, a static library
1277 dnl $(top_builddir)/intl/libintl.a will be created.
1278 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
1279 dnl implementations (in libc or libintl) without the ngettext() function
1280 dnl will be ignored.
1281 dnl LIBDIR is used to find the intl libraries. If empty,
1282 dnl the value `$(top_builddir)/intl/' is used.
1283 dnl
1284 dnl The result of the configuration is one of three cases:
1285 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
1286 dnl and used.
1287 dnl Catalog format: GNU --> install in $(datadir)
1288 dnl Catalog extension: .mo after installation, .gmo in source tree
1289 dnl 2) GNU gettext has been found in the system's C library.
1290 dnl Catalog format: GNU --> install in $(datadir)
1291 dnl Catalog extension: .mo after installation, .gmo in source tree
1292 dnl 3) No internationalization, always use English msgid.
1293 dnl Catalog format: none
1294 dnl Catalog extension: none
1295 dnl The use of .gmo is historical (it was needed to avoid overwriting the
1296 dnl GNU format catalogs when building on a platform with an X/Open gettext),
1297 dnl but we keep it in order not to force irrelevant filename changes on the
1298 dnl maintainers.
1299 dnl
1300 AC_DEFUN([AM_WITH_NLS],
1301 [AC_MSG_CHECKING([whether NLS is requested])
1302 dnl Default is enabled NLS
1303 AC_ARG_ENABLE(nls,
1304 [ --disable-nls do not use Native Language Support],
1305 USE_NLS=$enableval, USE_NLS=yes)
1306 AC_MSG_RESULT($USE_NLS)
1307 AC_SUBST(USE_NLS)
1308
1309 BUILD_INCLUDED_LIBINTL=no
1310 USE_INCLUDED_LIBINTL=no
1311 INTLLIBS=
1312
1313 dnl If we use NLS figure out what method
1314 if test "$USE_NLS" = "yes"; then
1315 AC_DEFINE(ENABLE_NLS, 1,
1316 [Define to 1 if translation of program messages to the user's native language
1317 is requested.])
1318 AC_MSG_CHECKING([whether included gettext is requested])
1319 AC_ARG_WITH(included-gettext,
1320 [ --with-included-gettext use the GNU gettext library included here],
1321 nls_cv_force_use_gnu_gettext=$withval,
1322 nls_cv_force_use_gnu_gettext=no)
1323 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
1324
1325 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
1326 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
1327 dnl User does not insist on using GNU NLS library. Figure out what
1328 dnl to use. If GNU gettext is available we use this. Else we have
1329 dnl to fall back to GNU NLS library.
1330 CATOBJEXT=NONE
1331
1332 dnl Add a version number to the cache macros.
1333 define(gt_cv_func_gnugettext_libc, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libc])
1334 define(gt_cv_func_gnugettext_libintl, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libintl])
1335
1336 AC_CHECK_HEADER(libintl.h,
1337 [AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
1338 [AC_TRY_LINK([#include <libintl.h>
1339 extern int _nl_msg_cat_cntr;],
1340 [bindtextdomain ("", "");
1341 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
1342 gt_cv_func_gnugettext_libc=yes,
1343 gt_cv_func_gnugettext_libc=no)])
1344
1345 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
1346 AC_CACHE_CHECK([for GNU gettext in libintl],
1347 gt_cv_func_gnugettext_libintl,
1348 [gt_save_LIBS="$LIBS"
1349 LIBS="$LIBS -lintl $LIBICONV"
1350 AC_TRY_LINK([#include <libintl.h>
1351 extern int _nl_msg_cat_cntr;],
1352 [bindtextdomain ("", "");
1353 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
1354 gt_cv_func_gnugettext_libintl=yes,
1355 gt_cv_func_gnugettext_libintl=no)
1356 LIBS="$gt_save_LIBS"])
1357 fi
1358
1359 dnl If an already present or preinstalled GNU gettext() is found,
1360 dnl use it. But if this macro is used in GNU gettext, and GNU
1361 dnl gettext is already preinstalled in libintl, we update this
1362 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
1363 if test "$gt_cv_func_gnugettext_libc" = "yes" \
1364 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
1365 && test "$PACKAGE" != gettext; }; then
1366 AC_DEFINE(HAVE_GETTEXT, 1,
1367 [Define if the GNU gettext() function is already present or preinstalled.])
1368
1369 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
1370 dnl If iconv() is in a separate libiconv library, then anyone
1371 dnl linking with libintl{.a,.so} also needs to link with
1372 dnl libiconv.
1373 INTLLIBS="-lintl $LIBICONV"
1374 fi
1375
1376 gt_save_LIBS="$LIBS"
1377 LIBS="$LIBS $INTLLIBS"
1378 AC_CHECK_FUNCS(dcgettext)
1379 LIBS="$gt_save_LIBS"
1380
1381 dnl Search for GNU msgfmt in the PATH.
1382 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1383 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
1384 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1385
1386 dnl Search for GNU xgettext in the PATH.
1387 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1388 [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
1389
1390 CATOBJEXT=.gmo
1391 fi
1392 ])
1393
1394 if test "$CATOBJEXT" = "NONE"; then
1395 dnl GNU gettext is not found in the C library.
1396 dnl Fall back on GNU gettext library.
1397 nls_cv_use_gnu_gettext=yes
1398 fi
1399 fi
1400
1401 if test "$nls_cv_use_gnu_gettext" = "yes"; then
1402 dnl Mark actions used to generate GNU NLS library.
1403 INTLOBJS="\$(GETTOBJS)"
1404 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1405 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
1406 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1407 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1408 [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
1409 AC_SUBST(MSGFMT)
1410 BUILD_INCLUDED_LIBINTL=yes
1411 USE_INCLUDED_LIBINTL=yes
1412 CATOBJEXT=.gmo
1413 INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV"
1414 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
1415 fi
1416
1417 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1418 dnl Test whether we really found GNU msgfmt.
1419 if test "$GMSGFMT" != ":"; then
1420 dnl If it is no GNU msgfmt we define it as : so that the
1421 dnl Makefiles still can work.
1422 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then
1423 : ;
1424 else
1425 AC_MSG_RESULT(
1426 [found msgfmt program is not GNU msgfmt; ignore it])
1427 GMSGFMT=":"
1428 fi
1429 fi
1430
1431 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1432 dnl Test whether we really found GNU xgettext.
1433 if test "$XGETTEXT" != ":"; then
1434 dnl If it is no GNU xgettext we define it as : so that the
1435 dnl Makefiles still can work.
1436 if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then
1437 : ;
1438 else
1439 AC_MSG_RESULT(
1440 [found xgettext program is not GNU xgettext; ignore it])
1441 XGETTEXT=":"
1442 fi
1443 fi
1444
1445 dnl We need to process the po/ directory.
1446 POSUB=po
1447 fi
1448 AC_OUTPUT_COMMANDS(
1449 [for ac_file in $CONFIG_FILES; do
1450 # Support "outfile[:infile[:infile...]]"
1451 case "$ac_file" in
1452 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1453 esac
1454 # PO directories have a Makefile.in generated from Makefile.in.in.
1455 case "$ac_file" in */Makefile.in)
1456 # Adjust a relative srcdir.
1457 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1458 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1459 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1460 # In autoconf-2.13 it is called $ac_given_srcdir.
1461 # In autoconf-2.50 it is called $srcdir.
1462 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1463 case "$ac_given_srcdir" in
1464 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1465 /*) top_srcdir="$ac_given_srcdir" ;;
1466 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
1467 esac
1468 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
1469 rm -f "$ac_dir/POTFILES"
1470 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
1471 sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
1472 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
1473 sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
1474 fi
1475 ;;
1476 esac
1477 done])
1478
1479
1480 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
1481 dnl to 'yes' because some of the testsuite requires it.
1482 if test "$PACKAGE" = gettext; then
1483 BUILD_INCLUDED_LIBINTL=yes
1484 fi
1485
1486 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
1487 dnl because plural.y uses bison specific features. It requires at least
1488 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
1489 dnl compile.
1490 dnl bison is only needed for the maintainer (who touches plural.y). But in
1491 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
1492 dnl the rule in general Makefile. Now, some people carelessly touch the
1493 dnl files or have a broken "make" program, hence the plural.c rule will
1494 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
1495 dnl present or too old.
1496 AC_CHECK_PROGS([INTLBISON], [bison])
1497 if test -z "$INTLBISON"; then
1498 ac_verc_fail=yes
1499 else
1500 dnl Found it, now check the version.
1501 AC_MSG_CHECKING([version of bison])
1502 changequote(<<,>>)dnl
1503 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
1504 case $ac_prog_version in
1505 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1506 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
1507 changequote([,])dnl
1508 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
1509 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
1510 esac
1511 AC_MSG_RESULT([$ac_prog_version])
1512 fi
1513 if test $ac_verc_fail = yes; then
1514 INTLBISON=:
1515 fi
1516
1517 dnl These rules are solely for the distribution goal. While doing this
1518 dnl we only have to keep exactly one list of the available catalogs
1519 dnl in configure.in.
1520 for lang in $ALL_LINGUAS; do
1521 GMOFILES="$GMOFILES $lang.gmo"
1522 POFILES="$POFILES $lang.po"
1523 done
1524
1525 dnl Make all variables we use known to autoconf.
1526 AC_SUBST(BUILD_INCLUDED_LIBINTL)
1527 AC_SUBST(USE_INCLUDED_LIBINTL)
1528 AC_SUBST(CATALOGS)
1529 AC_SUBST(CATOBJEXT)
1530 AC_SUBST(GMOFILES)
1531 AC_SUBST(INTLLIBS)
1532 AC_SUBST(INTLOBJS)
1533 AC_SUBST(POFILES)
1534 AC_SUBST(POSUB)
1535
1536 dnl For backward compatibility. Some configure.ins may be using this.
1537 nls_cv_header_intl=
1538 nls_cv_header_libgt=
1539
1540 dnl For backward compatibility. Some Makefiles may be using this.
1541 DATADIRNAME=share
1542 AC_SUBST(DATADIRNAME)
1543
1544 dnl For backward compatibility. Some Makefiles may be using this.
1545 INSTOBJEXT=.mo
1546 AC_SUBST(INSTOBJEXT)
1547
1548 dnl For backward compatibility. Some Makefiles may be using this.
1549 GENCAT=gencat
1550 AC_SUBST(GENCAT)
1551 ])
1552
1553 dnl Usage: Just like AM_WITH_NLS, which see.
1554 AC_DEFUN([AM_GNU_GETTEXT],
1555 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1556 AC_REQUIRE([AC_PROG_CC])dnl
1557 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1558 AC_REQUIRE([AC_PROG_RANLIB])dnl
1559 AC_REQUIRE([AC_ISC_POSIX])dnl
1560 AC_REQUIRE([AC_HEADER_STDC])dnl
1561 AC_REQUIRE([AC_C_CONST])dnl
1562 AC_REQUIRE([AC_C_INLINE])dnl
1563 AC_REQUIRE([AC_TYPE_OFF_T])dnl
1564 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1565 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1566 AC_REQUIRE([AC_FUNC_MMAP])dnl
1567 AC_REQUIRE([jm_GLIBC21])dnl
1568
1569 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
1570 stdlib.h string.h unistd.h sys/param.h])
1571 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \
1572 getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
1573 strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
1574
1575 AM_ICONV
1576 AM_LANGINFO_CODESET
1577 AM_LC_MESSAGES
1578 AM_WITH_NLS([$1],[$2],[$3])
1579
1580 if test "x$CATOBJEXT" != "x"; then
1581 if test "x$ALL_LINGUAS" = "x"; then
1582 LINGUAS=
1583 else
1584 AC_MSG_CHECKING(for catalogs to be installed)
1585 NEW_LINGUAS=
1586 for presentlang in $ALL_LINGUAS; do
1587 useit=no
1588 for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
1589 # Use the presentlang catalog if desiredlang is
1590 # a. equal to presentlang, or
1591 # b. a variant of presentlang (because in this case,
1592 # presentlang can be used as a fallback for messages
1593 # which are not translated in the desiredlang catalog).
1594 case "$desiredlang" in
1595 "$presentlang"*) useit=yes;;
1596 esac
1597 done
1598 if test $useit = yes; then
1599 NEW_LINGUAS="$NEW_LINGUAS $presentlang"
1600 fi
1601 done
1602 LINGUAS=$NEW_LINGUAS
1603 AC_MSG_RESULT($LINGUAS)
1604 fi
1605
1606 dnl Construct list of names of catalog files to be constructed.
1607 if test -n "$LINGUAS"; then
1608 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1609 fi
1610 fi
1611
1612 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1613 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1614 dnl Try to locate is.
1615 MKINSTALLDIRS=
1616 if test -n "$ac_aux_dir"; then
1617 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1618 fi
1619 if test -z "$MKINSTALLDIRS"; then
1620 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1621 fi
1622 AC_SUBST(MKINSTALLDIRS)
1623
1624 dnl Enable libtool support if the surrounding package wishes it.
1625 INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], [])
1626 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
1627 ])
1628
1629 # Search path for a program which passes the given test.
1630 # Ulrich Drepper <drepper@cygnus.com>, 1996.
1631 #
1632 # This file can be copied and used freely without restrictions. It can
1633 # be used in projects which are not available under the GNU General Public
1634 # License or the GNU Library General Public License but which still want
1635 # to provide support for the GNU gettext functionality.
1636 # Please note that the actual code of the GNU gettext library is covered
1637 # by the GNU Library General Public License, and the rest of the GNU
1638 # gettext package package is covered by the GNU General Public License.
1639 # They are *not* in the public domain.
1640
1641 # serial 2
1642
1643 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1644 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1645 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
1646 [# Extract the first word of "$2", so it can be a program name with args.
1647 set dummy $2; ac_word=[$]2
1648 AC_MSG_CHECKING([for $ac_word])
1649 AC_CACHE_VAL(ac_cv_path_$1,
1650 [case "[$]$1" in
1651 /*)
1652 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1653 ;;
1654 *)
1655 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1656 for ac_dir in ifelse([$5], , $PATH, [$5]); do
1657 test -z "$ac_dir" && ac_dir=.
1658 if test -f $ac_dir/$ac_word; then
1659 if [$3]; then
1660 ac_cv_path_$1="$ac_dir/$ac_word"
1661 break
1662 fi
1663 fi
1664 done
1665 IFS="$ac_save_ifs"
1666 dnl If no 4th arg is given, leave the cache variable unset,
1667 dnl so AC_PATH_PROGS will keep looking.
1668 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1669 ])dnl
1670 ;;
1671 esac])dnl
1672 $1="$ac_cv_path_$1"
1673 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1674 AC_MSG_RESULT([$]$1)
1675 else
1676 AC_MSG_RESULT(no)
1677 fi
1678 AC_SUBST($1)dnl
1679 ])
1680
1681 #serial 2
1682
1683 # Test for the GNU C Library, version 2.1 or newer.
1684 # From Bruno Haible.
1685
1686 AC_DEFUN([jm_GLIBC21],
1687 [
1688 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
1689 ac_cv_gnu_library_2_1,
1690 [AC_EGREP_CPP([Lucky GNU user],
1691 [
1692 #include <features.h>
1693 #ifdef __GNU_LIBRARY__
1694 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
1695 Lucky GNU user
1696 #endif
1697 #endif
1698 ],
1699 ac_cv_gnu_library_2_1=yes,
1700 ac_cv_gnu_library_2_1=no)
1701 ]
1702 )
1703 AC_SUBST(GLIBC21)
1704 GLIBC21="$ac_cv_gnu_library_2_1"
1705 ]
1706 )
1707
1708 #serial AM2
1709
1710 dnl From Bruno Haible.
1711
1712 AC_DEFUN([AM_ICONV],
1713 [
1714 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
1715 dnl those with the standalone portable GNU libiconv installed).
1716
1717 AC_ARG_WITH([libiconv-prefix],
1718 [ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
1719 for dir in `echo "$withval" | tr : ' '`; do
1720 if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
1721 if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
1722 done
1723 ])
1724
1725 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
1726 am_cv_func_iconv="no, consider installing GNU libiconv"
1727 am_cv_lib_iconv=no
1728 AC_TRY_LINK([#include <stdlib.h>
1729 #include <iconv.h>],
1730 [iconv_t cd = iconv_open("","");
1731 iconv(cd,NULL,NULL,NULL,NULL);
1732 iconv_close(cd);],
1733 am_cv_func_iconv=yes)
1734 if test "$am_cv_func_iconv" != yes; then
1735 am_save_LIBS="$LIBS"
1736 LIBS="$LIBS -liconv"
1737 AC_TRY_LINK([#include <stdlib.h>
1738 #include <iconv.h>],
1739 [iconv_t cd = iconv_open("","");
1740 iconv(cd,NULL,NULL,NULL,NULL);
1741 iconv_close(cd);],
1742 am_cv_lib_iconv=yes
1743 am_cv_func_iconv=yes)
1744 LIBS="$am_save_LIBS"
1745 fi
1746 ])
1747 if test "$am_cv_func_iconv" = yes; then
1748 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
1749 AC_MSG_CHECKING([for iconv declaration])
1750 AC_CACHE_VAL(am_cv_proto_iconv, [
1751 AC_TRY_COMPILE([
1752 #include <stdlib.h>
1753 #include <iconv.h>
1754 extern
1755 #ifdef __cplusplus
1756 "C"
1757 #endif
1758 #if defined(__STDC__) || defined(__cplusplus)
1759 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1760 #else
1761 size_t iconv();
1762 #endif
1763 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
1764 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);"])
1765 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
1766 AC_MSG_RESULT([$]{ac_t:-
1767 }[$]am_cv_proto_iconv)
1768 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
1769 [Define as const if the declaration of iconv() needs const.])
1770 fi
1771 LIBICONV=
1772 if test "$am_cv_lib_iconv" = yes; then
1773 LIBICONV="-liconv"
1774 fi
1775 AC_SUBST(LIBICONV)
1776 ])
1777
1778 #serial AM1
1779
1780 dnl From Bruno Haible.
1781
1782 AC_DEFUN([AM_LANGINFO_CODESET],
1783 [
1784 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
1785 [AC_TRY_LINK([#include <langinfo.h>],
1786 [char* cs = nl_langinfo(CODESET);],
1787 am_cv_langinfo_codeset=yes,
1788 am_cv_langinfo_codeset=no)
1789 ])
1790 if test $am_cv_langinfo_codeset = yes; then
1791 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
1792 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
1793 fi
1794 ])
1795
1796 # Check whether LC_MESSAGES is available in <locale.h>.
1797 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1798 #
1799 # This file can be copied and used freely without restrictions. It can
1800 # be used in projects which are not available under the GNU General Public
1801 # License or the GNU Library General Public License but which still want
1802 # to provide support for the GNU gettext functionality.
1803 # Please note that the actual code of the GNU gettext library is covered
1804 # by the GNU Library General Public License, and the rest of the GNU
1805 # gettext package package is covered by the GNU General Public License.
1806 # They are *not* in the public domain.
1807
1808 # serial 2
1809
1810 AC_DEFUN([AM_LC_MESSAGES],
1811 [if test $ac_cv_header_locale_h = yes; then
1812 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1813 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1814 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1815 if test $am_cv_val_LC_MESSAGES = yes; then
1816 AC_DEFINE(HAVE_LC_MESSAGES, 1,
1817 [Define if your <locale.h> file defines LC_MESSAGES.])
1818 fi
1819 fi])
1820