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