]> git.deb.at Git - pkg/abook.git/blob - aclocal.m4
autoconf/automake update
[pkg/abook.git] / aclocal.m4
1 # generated automatically by aclocal 1.7.8 -*- Autoconf -*-
2
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
4 # Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 # PARTICULAR PURPOSE.
13
14 dnl ---------------------------------------------------------------------------
15 dnl Look for the curses libraries.  Older curses implementations may require
16 dnl termcap/termlib to be linked as well.
17 AC_DEFUN([CF_CURSES_LIBS],[
18 AC_CHECK_FUNC(initscr,,[
19 case $host_os in #(vi
20 freebsd*) #(vi
21         AC_CHECK_LIB(mytinfo,tgoto,[LIBS="-lmytinfo $LIBS"])
22         ;;
23 hpux10.*|hpux11.*)
24         AC_CHECK_LIB(cur_colr,initscr,[
25                 LIBS="-lcur_colr $LIBS"
26                 CFLAGS="-I/usr/include/curses_colr $CFLAGS"
27                 ac_cv_func_initscr=yes
28                 ],[
29         AC_CHECK_LIB(Hcurses,initscr,[
30                 # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
31                 LIBS="-lHcurses $LIBS"
32                 CFLAGS="-D__HP_CURSES -D_HP_CURSES $CFLAGS"
33                 ac_cv_func_initscr=yes
34                 ])])
35         ;;
36 linux*) # Suse Linux does not follow /usr/lib convention
37         LIBS="$LIBS -L/lib"
38         ;;
39 esac
40
41 if test ".$With5lib" != ".no" ; then
42 if test -d /usr/5lib ; then
43         # SunOS 3.x or 4.x
44         CPPFLAGS="$CPPFLAGS -I/usr/5include"
45         LIBS="$LIBS -L/usr/5lib"
46 fi
47 fi
48
49 if test ".$ac_cv_func_initscr" != .yes ; then
50         cf_save_LIBS="$LIBS"
51         cf_term_lib=""
52         cf_curs_lib=""
53
54         # Check for library containing tgoto.  Do this before curses library
55         # because it may be needed to link the test-case for initscr.
56         AC_CHECK_FUNC(tgoto,[cf_term_lib=predefined],[
57                 for cf_term_lib in termcap termlib unknown
58                 do
59                         AC_CHECK_LIB($cf_term_lib,tgoto,[break])
60                 done
61         ])
62
63         # Check for library containing initscr
64         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
65         for cf_curs_lib in cursesX curses ncurses xcurses jcurses unknown
66         do
67                 AC_CHECK_LIB($cf_curs_lib,initscr,[break])
68         done
69         test $cf_curs_lib = unknown && AC_ERROR(no curses library found)
70
71         LIBS="-l$cf_curs_lib $cf_save_LIBS"
72         if test "$cf_term_lib" = unknown ; then
73                 AC_MSG_CHECKING(if we can link with $cf_curs_lib library)
74                 AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
75                         [initscr()],
76                         [cf_result=yes],
77                         [cf_result=no])
78                 AC_MSG_RESULT($cf_result)
79                 test $cf_result = no && AC_ERROR(Cannot link curses library)
80         elif test "$cf_term_lib" != predefined ; then
81                 AC_MSG_CHECKING(if we need both $cf_curs_lib and $cf_term_lib libraries)
82                 AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
83                         [initscr(); tgoto((char *)0, 0, 0);],
84                         [cf_result=no],
85                         [
86                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
87                         AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
88                                 [initscr()],
89                                 [cf_result=yes],
90                                 [cf_result=error])
91                         ])
92                 AC_MSG_RESULT($cf_result)
93         fi
94 fi
95
96 ])])
97
98
99
100 dnl @synopsis AC_LIB_READLINE
101 dnl
102 dnl Searches for a readline compatible library.  If found, defines
103 dnl `HAVE_LIBREADLINE'.  If the found library has the `add_history'
104 dnl function, sets also `HAVE_READLINE_HISTORY'.  Also checks for the
105 dnl locations of the necessary include files and sets `HAVE_READLINE_H'
106 dnl or `HAVE_READLINE_READLINE_H' and `HAVE_READLINE_HISTORY_H' or
107 dnl 'HAVE_HISTORY_H' if the corresponding include files exists.
108 dnl
109 dnl The libraries that may be readline compatible are `libedit',
110 dnl `libeditline' and `libreadline'.  Sometimes we need to link a termcap
111 dnl library for readline to work, this macro tests these cases too by
112 dnl trying to link with `libtermcap', `libcurses' or `libncurses' before
113 dnl giving up.
114 dnl
115 dnl Here is an example of how to use the information provided by this
116 dnl macro to perform the necessary includes or declarations in a C file:
117 dnl
118 dnl   #include <config.h>
119 dnl
120 dnl   #ifdef HAVE_LIBREADLINE
121 dnl   #if defined(HAVE_READLINE_READLINE_H)
122 dnl   #include <readline/readline.h>
123 dnl   #elif defined(HAVE_READLINE_H)
124 dnl   #include <readline.h>
125 dnl   #else /* !defined(HAVE_READLINE_H) */
126 dnl   extern char *readline ();
127 dnl   #endif /* !defined(HAVE_READLINE_H) */
128 dnl   char *cmdline = NULL;
129 dnl   #else /* !defined(HAVE_READLINE_READLINE_H) */
130 dnl     /* no readline */
131 dnl   #endif /* HAVE_LIBREADLINE */
132 dnl
133 dnl   #ifdef HAVE_READLINE_HISTORY
134 dnl   #if defined(HAVE_READLINE_HISTORY_H)
135 dnl   #include <readline/history.h>
136 dnl   #elif defined(HAVE_HISTORY_H)
137 dnl   #include <history.h>
138 dnl   #else /* !defined(HAVE_HISTORY_H) */
139 dnl   extern void add_history ();
140 dnl   extern int write_history ();
141 dnl   extern int read_history ();
142 dnl   #endif /* defined(HAVE_READLINE_HISTORY_H) */
143 dnl     /* no history */
144 dnl   #endif /* HAVE_READLINE_HISTORY */
145 dnl
146 dnl
147 dnl @version $Id$
148 dnl @author Ville Laurikari <vl@iki.fi>
149 dnl
150 AC_DEFUN([AC_LIB_READLINE], [
151   AC_CACHE_CHECK([for a readline compatible library],
152                  ac_cv_lib_readline, [
153     ORIG_LIBS="$LIBS"
154     for readline_lib in readline edit editline; do
155       for termcap_lib in "" termcap curses ncurses; do
156         if test -z "$termcap_lib"; then
157           TRY_LIB="-l$readline_lib"
158         else
159           TRY_LIB="-l$readline_lib -l$termcap_lib"
160         fi
161         LIBS="$ORIG_LIBS $TRY_LIB"
162         AC_TRY_LINK_FUNC(readline, ac_cv_lib_readline="$TRY_LIB")
163         if test -n "$ac_cv_lib_readline"; then
164           break
165         fi
166       done
167       if test -n "$ac_cv_lib_readline"; then
168         break
169       fi
170     done
171     if test -z "$ac_cv_lib_readline"; then
172       ac_cv_lib_readline="no"
173     fi
174     LIBS="$ORIG_LIBS"
175   ])
176
177   if test "$ac_cv_lib_readline" != "no"; then
178     LIBS="$LIBS $ac_cv_lib_readline"
179     AC_DEFINE(HAVE_LIBREADLINE, 1,
180               [Define if you have a readline compatible library])
181     AC_CHECK_HEADERS(readline.h readline/readline.h)
182     AC_CACHE_CHECK([whether readline supports history],
183                    ac_cv_lib_readline_history, [
184       ac_cv_lib_readline_history="no"
185       AC_TRY_LINK_FUNC(add_history, ac_cv_lib_readline_history="yes")
186     ])
187     if test "$ac_cv_lib_readline_history" = "yes"; then
188       AC_DEFINE(HAVE_READLINE_HISTORY, 1,
189                 [Define if your readline library has \`add_history'])
190       AC_CHECK_HEADERS(history.h readline/history.h)
191     fi
192   fi
193
194 ])
195
196 # Do all the work for Automake.                            -*- Autoconf -*-
197
198 # This macro actually does too much some checks are only needed if
199 # your package does certain things.  But this isn't really a big deal.
200
201 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
202 # Free Software Foundation, Inc.
203
204 # This program is free software; you can redistribute it and/or modify
205 # it under the terms of the GNU General Public License as published by
206 # the Free Software Foundation; either version 2, or (at your option)
207 # any later version.
208
209 # This program is distributed in the hope that it will be useful,
210 # but WITHOUT ANY WARRANTY; without even the implied warranty of
211 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
212 # GNU General Public License for more details.
213
214 # You should have received a copy of the GNU General Public License
215 # along with this program; if not, write to the Free Software
216 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
217 # 02111-1307, USA.
218
219 # serial 10
220
221 AC_PREREQ([2.54])
222
223 # Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
224 # the ones we care about.
225 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
226
227 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
228 # AM_INIT_AUTOMAKE([OPTIONS])
229 # -----------------------------------------------
230 # The call with PACKAGE and VERSION arguments is the old style
231 # call (pre autoconf-2.50), which is being phased out.  PACKAGE
232 # and VERSION should now be passed to AC_INIT and removed from
233 # the call to AM_INIT_AUTOMAKE.
234 # We support both call styles for the transition.  After
235 # the next Automake release, Autoconf can make the AC_INIT
236 # arguments mandatory, and then we can depend on a new Autoconf
237 # release and drop the old call support.
238 AC_DEFUN([AM_INIT_AUTOMAKE],
239 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
240  AC_REQUIRE([AC_PROG_INSTALL])dnl
241 # test to see if srcdir already configured
242 if test "`cd $srcdir && pwd`" != "`pwd`" &&
243    test -f $srcdir/config.status; then
244   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
245 fi
246
247 # test whether we have cygpath
248 if test -z "$CYGPATH_W"; then
249   if (cygpath --version) >/dev/null 2>/dev/null; then
250     CYGPATH_W='cygpath -w'
251   else
252     CYGPATH_W=echo
253   fi
254 fi
255 AC_SUBST([CYGPATH_W])
256
257 # Define the identity of the package.
258 dnl Distinguish between old-style and new-style calls.
259 m4_ifval([$2],
260 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
261  AC_SUBST([PACKAGE], [$1])dnl
262  AC_SUBST([VERSION], [$2])],
263 [_AM_SET_OPTIONS([$1])dnl
264  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
265  AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
266
267 _AM_IF_OPTION([no-define],,
268 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
269  AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
270
271 # Some tools Automake needs.
272 AC_REQUIRE([AM_SANITY_CHECK])dnl
273 AC_REQUIRE([AC_ARG_PROGRAM])dnl
274 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
275 AM_MISSING_PROG(AUTOCONF, autoconf)
276 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
277 AM_MISSING_PROG(AUTOHEADER, autoheader)
278 AM_MISSING_PROG(MAKEINFO, makeinfo)
279 AM_MISSING_PROG(AMTAR, tar)
280 AM_PROG_INSTALL_SH
281 AM_PROG_INSTALL_STRIP
282 # We need awk for the "check" target.  The system "awk" is bad on
283 # some platforms.
284 AC_REQUIRE([AC_PROG_AWK])dnl
285 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
286 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
287
288 _AM_IF_OPTION([no-dependencies],,
289 [AC_PROVIDE_IFELSE([AC_PROG_CC],
290                   [_AM_DEPENDENCIES(CC)],
291                   [define([AC_PROG_CC],
292                           defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
293 AC_PROVIDE_IFELSE([AC_PROG_CXX],
294                   [_AM_DEPENDENCIES(CXX)],
295                   [define([AC_PROG_CXX],
296                           defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
297 ])
298 ])
299
300
301 # When config.status generates a header, we must update the stamp-h file.
302 # This file resides in the same directory as the config header
303 # that is generated.  The stamp files are numbered to have different names.
304
305 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
306 # loop where config.status creates the headers, so we can generate
307 # our stamp files there.
308 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
309 [# Compute $1's index in $config_headers.
310 _am_stamp_count=1
311 for _am_header in $config_headers :; do
312   case $_am_header in
313     $1 | $1:* )
314       break ;;
315     * )
316       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
317   esac
318 done
319 echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
320
321 # Copyright 2002  Free Software Foundation, Inc.
322
323 # This program is free software; you can redistribute it and/or modify
324 # it under the terms of the GNU General Public License as published by
325 # the Free Software Foundation; either version 2, or (at your option)
326 # any later version.
327
328 # This program is distributed in the hope that it will be useful,
329 # but WITHOUT ANY WARRANTY; without even the implied warranty of
330 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
331 # GNU General Public License for more details.
332
333 # You should have received a copy of the GNU General Public License
334 # along with this program; if not, write to the Free Software
335 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
336
337 # AM_AUTOMAKE_VERSION(VERSION)
338 # ----------------------------
339 # Automake X.Y traces this macro to ensure aclocal.m4 has been
340 # generated from the m4 files accompanying Automake X.Y.
341 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
342
343 # AM_SET_CURRENT_AUTOMAKE_VERSION
344 # -------------------------------
345 # Call AM_AUTOMAKE_VERSION so it can be traced.
346 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
347 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
348          [AM_AUTOMAKE_VERSION([1.7.8])])
349
350 # Helper functions for option handling.                    -*- Autoconf -*-
351
352 # Copyright 2001, 2002  Free Software Foundation, Inc.
353
354 # This program is free software; you can redistribute it and/or modify
355 # it under the terms of the GNU General Public License as published by
356 # the Free Software Foundation; either version 2, or (at your option)
357 # any later version.
358
359 # This program is distributed in the hope that it will be useful,
360 # but WITHOUT ANY WARRANTY; without even the implied warranty of
361 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
362 # GNU General Public License for more details.
363
364 # You should have received a copy of the GNU General Public License
365 # along with this program; if not, write to the Free Software
366 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
367 # 02111-1307, USA.
368
369 # serial 2
370
371 # _AM_MANGLE_OPTION(NAME)
372 # -----------------------
373 AC_DEFUN([_AM_MANGLE_OPTION],
374 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
375
376 # _AM_SET_OPTION(NAME)
377 # ------------------------------
378 # Set option NAME.  Presently that only means defining a flag for this option.
379 AC_DEFUN([_AM_SET_OPTION],
380 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
381
382 # _AM_SET_OPTIONS(OPTIONS)
383 # ----------------------------------
384 # OPTIONS is a space-separated list of Automake options.
385 AC_DEFUN([_AM_SET_OPTIONS],
386 [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
387
388 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
389 # -------------------------------------------
390 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
391 AC_DEFUN([_AM_IF_OPTION],
392 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
393
394 #
395 # Check to make sure that the build environment is sane.
396 #
397
398 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
399
400 # This program is free software; you can redistribute it and/or modify
401 # it under the terms of the GNU General Public License as published by
402 # the Free Software Foundation; either version 2, or (at your option)
403 # any later version.
404
405 # This program is distributed in the hope that it will be useful,
406 # but WITHOUT ANY WARRANTY; without even the implied warranty of
407 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
408 # GNU General Public License for more details.
409
410 # You should have received a copy of the GNU General Public License
411 # along with this program; if not, write to the Free Software
412 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
413 # 02111-1307, USA.
414
415 # serial 3
416
417 # AM_SANITY_CHECK
418 # ---------------
419 AC_DEFUN([AM_SANITY_CHECK],
420 [AC_MSG_CHECKING([whether build environment is sane])
421 # Just in case
422 sleep 1
423 echo timestamp > conftest.file
424 # Do `set' in a subshell so we don't clobber the current shell's
425 # arguments.  Must try -L first in case configure is actually a
426 # symlink; some systems play weird games with the mod time of symlinks
427 # (eg FreeBSD returns the mod time of the symlink's containing
428 # directory).
429 if (
430    set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
431    if test "$[*]" = "X"; then
432       # -L didn't work.
433       set X `ls -t $srcdir/configure conftest.file`
434    fi
435    rm -f conftest.file
436    if test "$[*]" != "X $srcdir/configure conftest.file" \
437       && test "$[*]" != "X conftest.file $srcdir/configure"; then
438
439       # If neither matched, then we have a broken ls.  This can happen
440       # if, for instance, CONFIG_SHELL is bash and it inherits a
441       # broken ls alias from the environment.  This has actually
442       # happened.  Such a system could not be considered "sane".
443       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
444 alias in your environment])
445    fi
446
447    test "$[2]" = conftest.file
448    )
449 then
450    # Ok.
451    :
452 else
453    AC_MSG_ERROR([newly created file is older than distributed files!
454 Check your system clock])
455 fi
456 AC_MSG_RESULT(yes)])
457
458 #  -*- Autoconf -*-
459
460
461 # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
462
463 # This program is free software; you can redistribute it and/or modify
464 # it under the terms of the GNU General Public License as published by
465 # the Free Software Foundation; either version 2, or (at your option)
466 # any later version.
467
468 # This program is distributed in the hope that it will be useful,
469 # but WITHOUT ANY WARRANTY; without even the implied warranty of
470 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
471 # GNU General Public License for more details.
472
473 # You should have received a copy of the GNU General Public License
474 # along with this program; if not, write to the Free Software
475 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
476 # 02111-1307, USA.
477
478 # serial 3
479
480 # AM_MISSING_PROG(NAME, PROGRAM)
481 # ------------------------------
482 AC_DEFUN([AM_MISSING_PROG],
483 [AC_REQUIRE([AM_MISSING_HAS_RUN])
484 $1=${$1-"${am_missing_run}$2"}
485 AC_SUBST($1)])
486
487
488 # AM_MISSING_HAS_RUN
489 # ------------------
490 # Define MISSING if not defined so far and test if it supports --run.
491 # If it does, set am_missing_run to use it, otherwise, to nothing.
492 AC_DEFUN([AM_MISSING_HAS_RUN],
493 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
494 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
495 # Use eval to expand $SHELL
496 if eval "$MISSING --run true"; then
497   am_missing_run="$MISSING --run "
498 else
499   am_missing_run=
500   AC_MSG_WARN([`missing' script is too old or missing])
501 fi
502 ])
503
504 # AM_AUX_DIR_EXPAND
505
506 # Copyright 2001 Free Software Foundation, Inc.
507
508 # This program is free software; you can redistribute it and/or modify
509 # it under the terms of the GNU General Public License as published by
510 # the Free Software Foundation; either version 2, or (at your option)
511 # any later version.
512
513 # This program is distributed in the hope that it will be useful,
514 # but WITHOUT ANY WARRANTY; without even the implied warranty of
515 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
516 # GNU General Public License for more details.
517
518 # You should have received a copy of the GNU General Public License
519 # along with this program; if not, write to the Free Software
520 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
521 # 02111-1307, USA.
522
523 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
524 # $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
525 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
526 #
527 # Of course, Automake must honor this variable whenever it calls a
528 # tool from the auxiliary directory.  The problem is that $srcdir (and
529 # therefore $ac_aux_dir as well) can be either absolute or relative,
530 # depending on how configure is run.  This is pretty annoying, since
531 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
532 # source directory, any form will work fine, but in subdirectories a
533 # relative path needs to be adjusted first.
534 #
535 # $ac_aux_dir/missing
536 #    fails when called from a subdirectory if $ac_aux_dir is relative
537 # $top_srcdir/$ac_aux_dir/missing
538 #    fails if $ac_aux_dir is absolute,
539 #    fails when called from a subdirectory in a VPATH build with
540 #          a relative $ac_aux_dir
541 #
542 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
543 # are both prefixed by $srcdir.  In an in-source build this is usually
544 # harmless because $srcdir is `.', but things will broke when you
545 # start a VPATH build or use an absolute $srcdir.
546 #
547 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
548 # iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
549 #   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
550 # and then we would define $MISSING as
551 #   MISSING="\${SHELL} $am_aux_dir/missing"
552 # This will work as long as MISSING is not called from configure, because
553 # unfortunately $(top_srcdir) has no meaning in configure.
554 # However there are other variables, like CC, which are often used in
555 # configure, and could therefore not use this "fixed" $ac_aux_dir.
556 #
557 # Another solution, used here, is to always expand $ac_aux_dir to an
558 # absolute PATH.  The drawback is that using absolute paths prevent a
559 # configured tree to be moved without reconfiguration.
560
561 # Rely on autoconf to set up CDPATH properly.
562 AC_PREREQ([2.50])
563
564 AC_DEFUN([AM_AUX_DIR_EXPAND], [
565 # expand $ac_aux_dir to an absolute path
566 am_aux_dir=`cd $ac_aux_dir && pwd`
567 ])
568
569 # AM_PROG_INSTALL_SH
570 # ------------------
571 # Define $install_sh.
572
573 # Copyright 2001 Free Software Foundation, Inc.
574
575 # This program is free software; you can redistribute it and/or modify
576 # it under the terms of the GNU General Public License as published by
577 # the Free Software Foundation; either version 2, or (at your option)
578 # any later version.
579
580 # This program is distributed in the hope that it will be useful,
581 # but WITHOUT ANY WARRANTY; without even the implied warranty of
582 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
583 # GNU General Public License for more details.
584
585 # You should have received a copy of the GNU General Public License
586 # along with this program; if not, write to the Free Software
587 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
588 # 02111-1307, USA.
589
590 AC_DEFUN([AM_PROG_INSTALL_SH],
591 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
592 install_sh=${install_sh-"$am_aux_dir/install-sh"}
593 AC_SUBST(install_sh)])
594
595 # AM_PROG_INSTALL_STRIP
596
597 # Copyright 2001 Free Software Foundation, Inc.
598
599 # This program is free software; you can redistribute it and/or modify
600 # it under the terms of the GNU General Public License as published by
601 # the Free Software Foundation; either version 2, or (at your option)
602 # any later version.
603
604 # This program is distributed in the hope that it will be useful,
605 # but WITHOUT ANY WARRANTY; without even the implied warranty of
606 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
607 # GNU General Public License for more details.
608
609 # You should have received a copy of the GNU General Public License
610 # along with this program; if not, write to the Free Software
611 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
612 # 02111-1307, USA.
613
614 # One issue with vendor `install' (even GNU) is that you can't
615 # specify the program used to strip binaries.  This is especially
616 # annoying in cross-compiling environments, where the build's strip
617 # is unlikely to handle the host's binaries.
618 # Fortunately install-sh will honor a STRIPPROG variable, so we
619 # always use install-sh in `make install-strip', and initialize
620 # STRIPPROG with the value of the STRIP variable (set by the user).
621 AC_DEFUN([AM_PROG_INSTALL_STRIP],
622 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
623 # Installed binaries are usually stripped using `strip' when the user
624 # run `make install-strip'.  However `strip' might not be the right
625 # tool to use in cross-compilation environments, therefore Automake
626 # will honor the `STRIP' environment variable to overrule this program.
627 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
628 if test "$cross_compiling" != no; then
629   AC_CHECK_TOOL([STRIP], [strip], :)
630 fi
631 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
632 AC_SUBST([INSTALL_STRIP_PROGRAM])])
633
634 #                                                          -*- Autoconf -*-
635 # Copyright (C) 2003  Free Software Foundation, Inc.
636
637 # This program is free software; you can redistribute it and/or modify
638 # it under the terms of the GNU General Public License as published by
639 # the Free Software Foundation; either version 2, or (at your option)
640 # any later version.
641
642 # This program is distributed in the hope that it will be useful,
643 # but WITHOUT ANY WARRANTY; without even the implied warranty of
644 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
645 # GNU General Public License for more details.
646
647 # You should have received a copy of the GNU General Public License
648 # along with this program; if not, write to the Free Software
649 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
650 # 02111-1307, USA.
651
652 # serial 1
653
654 # Check whether the underlying file-system supports filenames
655 # with a leading dot.  For instance MS-DOS doesn't.
656 AC_DEFUN([AM_SET_LEADING_DOT],
657 [rm -rf .tst 2>/dev/null
658 mkdir .tst 2>/dev/null
659 if test -d .tst; then
660   am__leading_dot=.
661 else
662   am__leading_dot=_
663 fi
664 rmdir .tst 2>/dev/null
665 AC_SUBST([am__leading_dot])])
666
667 # serial 5                                              -*- Autoconf -*-
668
669 # Copyright (C) 1999, 2000, 2001, 2002, 2003  Free Software Foundation, Inc.
670
671 # This program is free software; you can redistribute it and/or modify
672 # it under the terms of the GNU General Public License as published by
673 # the Free Software Foundation; either version 2, or (at your option)
674 # any later version.
675
676 # This program is distributed in the hope that it will be useful,
677 # but WITHOUT ANY WARRANTY; without even the implied warranty of
678 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
679 # GNU General Public License for more details.
680
681 # You should have received a copy of the GNU General Public License
682 # along with this program; if not, write to the Free Software
683 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
684 # 02111-1307, USA.
685
686
687 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
688 # written in clear, in which case automake, when reading aclocal.m4,
689 # will think it sees a *use*, and therefore will trigger all it's
690 # C support machinery.  Also note that it means that autoscan, seeing
691 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
692
693
694
695 # _AM_DEPENDENCIES(NAME)
696 # ----------------------
697 # See how the compiler implements dependency checking.
698 # NAME is "CC", "CXX", "GCJ", or "OBJC".
699 # We try a few techniques and use that to set a single cache variable.
700 #
701 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
702 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
703 # dependency, and given that the user is not expected to run this macro,
704 # just rely on AC_PROG_CC.
705 AC_DEFUN([_AM_DEPENDENCIES],
706 [AC_REQUIRE([AM_SET_DEPDIR])dnl
707 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
708 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
709 AC_REQUIRE([AM_DEP_TRACK])dnl
710
711 ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
712        [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
713        [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
714        [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
715                    [depcc="$$1"   am_compiler_list=])
716
717 AC_CACHE_CHECK([dependency style of $depcc],
718                [am_cv_$1_dependencies_compiler_type],
719 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
720   # We make a subdir and do the tests there.  Otherwise we can end up
721   # making bogus files that we don't know about and never remove.  For
722   # instance it was reported that on HP-UX the gcc test will end up
723   # making a dummy file named `D' -- because `-MD' means `put the output
724   # in D'.
725   mkdir conftest.dir
726   # Copy depcomp to subdir because otherwise we won't find it if we're
727   # using a relative directory.
728   cp "$am_depcomp" conftest.dir
729   cd conftest.dir
730   # We will build objects and dependencies in a subdirectory because
731   # it helps to detect inapplicable dependency modes.  For instance
732   # both Tru64's cc and ICC support -MD to output dependencies as a
733   # side effect of compilation, but ICC will put the dependencies in
734   # the current directory while Tru64 will put them in the object
735   # directory.
736   mkdir sub
737
738   am_cv_$1_dependencies_compiler_type=none
739   if test "$am_compiler_list" = ""; then
740      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
741   fi
742   for depmode in $am_compiler_list; do
743     # Setup a source with many dependencies, because some compilers
744     # like to wrap large dependency lists on column 80 (with \), and
745     # we should not choose a depcomp mode which is confused by this.
746     #
747     # We need to recreate these files for each test, as the compiler may
748     # overwrite some of them when testing with obscure command lines.
749     # This happens at least with the AIX C compiler.
750     : > sub/conftest.c
751     for i in 1 2 3 4 5 6; do
752       echo '#include "conftst'$i'.h"' >> sub/conftest.c
753       : > sub/conftst$i.h
754     done
755     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
756
757     case $depmode in
758     nosideeffect)
759       # after this tag, mechanisms are not by side-effect, so they'll
760       # only be used when explicitly requested
761       if test "x$enable_dependency_tracking" = xyes; then
762         continue
763       else
764         break
765       fi
766       ;;
767     none) break ;;
768     esac
769     # We check with `-c' and `-o' for the sake of the "dashmstdout"
770     # mode.  It turns out that the SunPro C++ compiler does not properly
771     # handle `-M -o', and we need to detect this.
772     if depmode=$depmode \
773        source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
774        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
775        $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
776          >/dev/null 2>conftest.err &&
777        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
778        grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
779        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
780       # icc doesn't choke on unknown options, it will just issue warnings
781       # (even with -Werror).  So we grep stderr for any message
782       # that says an option was ignored.
783       if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
784         am_cv_$1_dependencies_compiler_type=$depmode
785         break
786       fi
787     fi
788   done
789
790   cd ..
791   rm -rf conftest.dir
792 else
793   am_cv_$1_dependencies_compiler_type=none
794 fi
795 ])
796 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
797 AM_CONDITIONAL([am__fastdep$1], [
798   test "x$enable_dependency_tracking" != xno \
799   && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
800 ])
801
802
803 # AM_SET_DEPDIR
804 # -------------
805 # Choose a directory name for dependency files.
806 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
807 AC_DEFUN([AM_SET_DEPDIR],
808 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
809 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
810 ])
811
812
813 # AM_DEP_TRACK
814 # ------------
815 AC_DEFUN([AM_DEP_TRACK],
816 [AC_ARG_ENABLE(dependency-tracking,
817 [  --disable-dependency-tracking Speeds up one-time builds
818   --enable-dependency-tracking  Do not reject slow dependency extractors])
819 if test "x$enable_dependency_tracking" != xno; then
820   am_depcomp="$ac_aux_dir/depcomp"
821   AMDEPBACKSLASH='\'
822 fi
823 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
824 AC_SUBST([AMDEPBACKSLASH])
825 ])
826
827 # Generate code to set up dependency tracking.   -*- Autoconf -*-
828
829 # Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
830
831 # This program is free software; you can redistribute it and/or modify
832 # it under the terms of the GNU General Public License as published by
833 # the Free Software Foundation; either version 2, or (at your option)
834 # any later version.
835
836 # This program is distributed in the hope that it will be useful,
837 # but WITHOUT ANY WARRANTY; without even the implied warranty of
838 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
839 # GNU General Public License for more details.
840
841 # You should have received a copy of the GNU General Public License
842 # along with this program; if not, write to the Free Software
843 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
844 # 02111-1307, USA.
845
846 #serial 2
847
848 # _AM_OUTPUT_DEPENDENCY_COMMANDS
849 # ------------------------------
850 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
851 [for mf in $CONFIG_FILES; do
852   # Strip MF so we end up with the name of the file.
853   mf=`echo "$mf" | sed -e 's/:.*$//'`
854   # Check whether this is an Automake generated Makefile or not.
855   # We used to match only the files named `Makefile.in', but
856   # some people rename them; so instead we look at the file content.
857   # Grep'ing the first line is not enough: some people post-process
858   # each Makefile.in and add a new line on top of each file to say so.
859   # So let's grep whole file.
860   if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
861     dirpart=`AS_DIRNAME("$mf")`
862   else
863     continue
864   fi
865   grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
866   # Extract the definition of DEP_FILES from the Makefile without
867   # running `make'.
868   DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
869   test -z "$DEPDIR" && continue
870   # When using ansi2knr, U may be empty or an underscore; expand it
871   U=`sed -n -e '/^U = / s///p' < "$mf"`
872   test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
873   # We invoke sed twice because it is the simplest approach to
874   # changing $(DEPDIR) to its actual value in the expansion.
875   for file in `sed -n -e '
876     /^DEP_FILES = .*\\\\$/ {
877       s/^DEP_FILES = //
878       :loop
879         s/\\\\$//
880         p
881         n
882         /\\\\$/ b loop
883       p
884     }
885     /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
886        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
887     # Make sure the directory exists.
888     test -f "$dirpart/$file" && continue
889     fdir=`AS_DIRNAME(["$file"])`
890     AS_MKDIR_P([$dirpart/$fdir])
891     # echo "creating $dirpart/$file"
892     echo '# dummy' > "$dirpart/$file"
893   done
894 done
895 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
896
897
898 # AM_OUTPUT_DEPENDENCY_COMMANDS
899 # -----------------------------
900 # This macro should only be invoked once -- use via AC_REQUIRE.
901 #
902 # This code is only required when automatic dependency tracking
903 # is enabled.  FIXME.  This creates each `.P' file that we will
904 # need in order to bootstrap the dependency handling code.
905 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
906 [AC_CONFIG_COMMANDS([depfiles],
907      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
908      [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
909 ])
910
911 # Check to see how 'make' treats includes.      -*- Autoconf -*-
912
913 # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
914
915 # This program is free software; you can redistribute it and/or modify
916 # it under the terms of the GNU General Public License as published by
917 # the Free Software Foundation; either version 2, or (at your option)
918 # any later version.
919
920 # This program is distributed in the hope that it will be useful,
921 # but WITHOUT ANY WARRANTY; without even the implied warranty of
922 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
923 # GNU General Public License for more details.
924
925 # You should have received a copy of the GNU General Public License
926 # along with this program; if not, write to the Free Software
927 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
928 # 02111-1307, USA.
929
930 # serial 2
931
932 # AM_MAKE_INCLUDE()
933 # -----------------
934 # Check to see how make treats includes.
935 AC_DEFUN([AM_MAKE_INCLUDE],
936 [am_make=${MAKE-make}
937 cat > confinc << 'END'
938 am__doit:
939         @echo done
940 .PHONY: am__doit
941 END
942 # If we don't find an include directive, just comment out the code.
943 AC_MSG_CHECKING([for style of include used by $am_make])
944 am__include="#"
945 am__quote=
946 _am_result=none
947 # First try GNU make style include.
948 echo "include confinc" > confmf
949 # We grep out `Entering directory' and `Leaving directory'
950 # messages which can occur if `w' ends up in MAKEFLAGS.
951 # In particular we don't look at `^make:' because GNU make might
952 # be invoked under some other name (usually "gmake"), in which
953 # case it prints its new name instead of `make'.
954 if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
955    am__include=include
956    am__quote=
957    _am_result=GNU
958 fi
959 # Now try BSD make style include.
960 if test "$am__include" = "#"; then
961    echo '.include "confinc"' > confmf
962    if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
963       am__include=.include
964       am__quote="\""
965       _am_result=BSD
966    fi
967 fi
968 AC_SUBST([am__include])
969 AC_SUBST([am__quote])
970 AC_MSG_RESULT([$_am_result])
971 rm -f confinc confmf
972 ])
973
974 # AM_CONDITIONAL                                              -*- Autoconf -*-
975
976 # Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
977
978 # This program is free software; you can redistribute it and/or modify
979 # it under the terms of the GNU General Public License as published by
980 # the Free Software Foundation; either version 2, or (at your option)
981 # any later version.
982
983 # This program is distributed in the hope that it will be useful,
984 # but WITHOUT ANY WARRANTY; without even the implied warranty of
985 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
986 # GNU General Public License for more details.
987
988 # You should have received a copy of the GNU General Public License
989 # along with this program; if not, write to the Free Software
990 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
991 # 02111-1307, USA.
992
993 # serial 5
994
995 AC_PREREQ(2.52)
996
997 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
998 # -------------------------------------
999 # Define a conditional.
1000 AC_DEFUN([AM_CONDITIONAL],
1001 [ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1002         [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1003 AC_SUBST([$1_TRUE])
1004 AC_SUBST([$1_FALSE])
1005 if $2; then
1006   $1_TRUE=
1007   $1_FALSE='#'
1008 else
1009   $1_TRUE='#'
1010   $1_FALSE=
1011 fi
1012 AC_CONFIG_COMMANDS_PRE(
1013 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1014   AC_MSG_ERROR([conditional "$1" was never defined.
1015 Usually this means the macro was only invoked conditionally.])
1016 fi])])
1017
1018 # Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
1019
1020 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
1021
1022 # This program is free software; you can redistribute it and/or modify
1023 # it under the terms of the GNU General Public License as published by
1024 # the Free Software Foundation; either version 2, or (at your option)
1025 # any later version.
1026
1027 # This program is distributed in the hope that it will be useful,
1028 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1029 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1030 # GNU General Public License for more details.
1031
1032 # You should have received a copy of the GNU General Public License
1033 # along with this program; if not, write to the Free Software
1034 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1035 # 02111-1307, USA.
1036
1037 AC_PREREQ([2.52])
1038
1039 # serial 6
1040
1041 # AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
1042 AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
1043
1044 # isc-posix.m4 serial 2 (gettext-0.11.2)
1045 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
1046 dnl This file is free software, distributed under the terms of the GNU
1047 dnl General Public License.  As a special exception to the GNU General
1048 dnl Public License, this file may be distributed as part of a program
1049 dnl that contains a configuration script generated by Autoconf, under
1050 dnl the same distribution terms as the rest of that program.
1051
1052 # This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
1053
1054 # This test replaces the one in autoconf.
1055 # Currently this macro should have the same name as the autoconf macro
1056 # because gettext's gettext.m4 (distributed in the automake package)
1057 # still uses it.  Otherwise, the use in gettext.m4 makes autoheader
1058 # give these diagnostics:
1059 #   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
1060 #   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
1061
1062 undefine([AC_ISC_POSIX])
1063
1064 AC_DEFUN([AC_ISC_POSIX],
1065   [
1066     dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
1067     AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
1068   ]
1069 )
1070
1071
1072 # Copyright 1996, 1997, 1998, 2000, 2001, 2002  Free Software Foundation, Inc.
1073
1074 # This program is free software; you can redistribute it and/or modify
1075 # it under the terms of the GNU General Public License as published by
1076 # the Free Software Foundation; either version 2, or (at your option)
1077 # any later version.
1078
1079 # This program is distributed in the hope that it will be useful,
1080 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1081 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1082 # GNU General Public License for more details.
1083
1084 # You should have received a copy of the GNU General Public License
1085 # along with this program; if not, write to the Free Software
1086 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1087 # 02111-1307, USA.
1088
1089 # serial 2
1090
1091 AC_DEFUN([AM_C_PROTOTYPES],
1092 [AC_REQUIRE([AM_PROG_CC_STDC])
1093 AC_REQUIRE([AC_PROG_CPP])
1094 AC_MSG_CHECKING([for function prototypes])
1095 if test "$am_cv_prog_cc_stdc" != no; then
1096   AC_MSG_RESULT(yes)
1097   AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
1098   U= ANSI2KNR=
1099 else
1100   AC_MSG_RESULT(no)
1101   U=_ ANSI2KNR=./ansi2knr
1102 fi
1103 # Ensure some checks needed by ansi2knr itself.
1104 AC_HEADER_STDC
1105 AC_CHECK_HEADERS(string.h)
1106 AC_SUBST(U)dnl
1107 AC_SUBST(ANSI2KNR)dnl
1108 ])
1109
1110 AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
1111
1112
1113 # Copyright 1996, 1997, 1999, 2000, 2001, 2002  Free Software Foundation, Inc.
1114
1115 # This program is free software; you can redistribute it and/or modify
1116 # it under the terms of the GNU General Public License as published by
1117 # the Free Software Foundation; either version 2, or (at your option)
1118 # any later version.
1119
1120 # This program is distributed in the hope that it will be useful,
1121 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1122 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1123 # GNU General Public License for more details.
1124
1125 # You should have received a copy of the GNU General Public License
1126 # along with this program; if not, write to the Free Software
1127 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1128 # 02111-1307, USA.
1129
1130 # serial 2
1131
1132 # @defmac AC_PROG_CC_STDC
1133 # @maindex PROG_CC_STDC
1134 # @ovindex CC
1135 # If the C compiler in not in ANSI C mode by default, try to add an option
1136 # to output variable @code{CC} to make it so.  This macro tries various
1137 # options that select ANSI C on some system or another.  It considers the
1138 # compiler to be in ANSI C mode if it handles function prototypes correctly.
1139 #
1140 # If you use this macro, you should check after calling it whether the C
1141 # compiler has been set to accept ANSI C; if not, the shell variable
1142 # @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
1143 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
1144 # program @code{ansi2knr}, which comes with Ghostscript.
1145 # @end defmac
1146
1147 AC_DEFUN([AM_PROG_CC_STDC],
1148 [AC_REQUIRE([AC_PROG_CC])
1149 AC_BEFORE([$0], [AC_C_INLINE])
1150 AC_BEFORE([$0], [AC_C_CONST])
1151 dnl Force this before AC_PROG_CPP.  Some cpp's, eg on HPUX, require
1152 dnl a magic option to avoid problems with ANSI preprocessor commands
1153 dnl like #elif.
1154 dnl FIXME: can't do this because then AC_AIX won't work due to a
1155 dnl circular dependency.
1156 dnl AC_BEFORE([$0], [AC_PROG_CPP])
1157 AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
1158 AC_CACHE_VAL(am_cv_prog_cc_stdc,
1159 [am_cv_prog_cc_stdc=no
1160 ac_save_CC="$CC"
1161 # Don't try gcc -ansi; that turns off useful extensions and
1162 # breaks some systems' header files.
1163 # AIX                   -qlanglvl=ansi
1164 # Ultrix and OSF/1      -std1
1165 # HP-UX 10.20 and later -Ae
1166 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1167 # SVR4                  -Xc -D__EXTENSIONS__
1168 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1169 do
1170   CC="$ac_save_CC $ac_arg"
1171   AC_TRY_COMPILE(
1172 [#include <stdarg.h>
1173 #include <stdio.h>
1174 #include <sys/types.h>
1175 #include <sys/stat.h>
1176 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1177 struct buf { int x; };
1178 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1179 static char *e (p, i)
1180      char **p;
1181      int i;
1182 {
1183   return p[i];
1184 }
1185 static char *f (char * (*g) (char **, int), char **p, ...)
1186 {
1187   char *s;
1188   va_list v;
1189   va_start (v,p);
1190   s = g (p, va_arg (v,int));
1191   va_end (v);
1192   return s;
1193 }
1194 int test (int i, double x);
1195 struct s1 {int (*f) (int a);};
1196 struct s2 {int (*f) (double a);};
1197 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1198 int argc;
1199 char **argv;
1200 ], [
1201 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1202 ],
1203 [am_cv_prog_cc_stdc="$ac_arg"; break])
1204 done
1205 CC="$ac_save_CC"
1206 ])
1207 if test -z "$am_cv_prog_cc_stdc"; then
1208   AC_MSG_RESULT([none needed])
1209 else
1210   AC_MSG_RESULT([$am_cv_prog_cc_stdc])
1211 fi
1212 case "x$am_cv_prog_cc_stdc" in
1213   x|xno) ;;
1214   *) CC="$CC $am_cv_prog_cc_stdc" ;;
1215 esac
1216 ])
1217
1218 AU_DEFUN([fp_PROG_CC_STDC], [AM_PROG_CC_STDC])
1219