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