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