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