]> git.deb.at Git - pkg/abook.git/blob - aclocal.m4
added --add-email option etc.
[pkg/abook.git] / aclocal.m4
1 # aclocal.m4 generated automatically by aclocal 1.5
2
3 # Copyright 1996, 1997, 1998, 1999, 2000, 2001
4 # Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 # PARTICULAR PURPOSE.
13
14 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 # Do all the work for Automake.  This macro actually does too much --
99 # some checks are only needed if your package does certain things.
100 # But this isn't really a big deal.
101
102 # serial 5
103
104 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
105 # written in clear, in which case automake, when reading aclocal.m4,
106 # will think it sees a *use*, and therefore will trigger all it's
107 # C support machinery.  Also note that it means that autoscan, seeing
108 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
109
110
111 # We require 2.13 because we rely on SHELL being computed by configure.
112 AC_PREREQ([2.13])
113
114 # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
115 # -----------------------------------------------------------
116 # If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED.
117 # The purpose of this macro is to provide the user with a means to
118 # check macros which are provided without letting her know how the
119 # information is coded.
120 # If this macro is not defined by Autoconf, define it here.
121 ifdef([AC_PROVIDE_IFELSE],
122       [],
123       [define([AC_PROVIDE_IFELSE],
124               [ifdef([AC_PROVIDE_$1],
125                      [$2], [$3])])])
126
127
128 # AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
129 # ----------------------------------------------
130 AC_DEFUN([AM_INIT_AUTOMAKE],
131 [AC_REQUIRE([AC_PROG_INSTALL])dnl
132 # test to see if srcdir already configured
133 if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" &&
134    test -f $srcdir/config.status; then
135   AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first])
136 fi
137
138 # Define the identity of the package.
139 PACKAGE=$1
140 AC_SUBST(PACKAGE)dnl
141 VERSION=$2
142 AC_SUBST(VERSION)dnl
143 ifelse([$3],,
144 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
145 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
146
147 # Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
148 # the ones we care about.
149 ifdef([m4_pattern_allow],
150       [m4_pattern_allow([^AM_[A-Z]+FLAGS])])dnl
151
152 # Autoconf 2.50 always computes EXEEXT.  However we need to be
153 # compatible with 2.13, for now.  So we always define EXEEXT, but we
154 # don't compute it.
155 AC_SUBST(EXEEXT)
156 # Similar for OBJEXT -- only we only use OBJEXT if the user actually
157 # requests that it be used.  This is a bit dumb.
158 : ${OBJEXT=o}
159 AC_SUBST(OBJEXT)
160
161 # Some tools Automake needs.
162 AC_REQUIRE([AM_SANITY_CHECK])dnl
163 AC_REQUIRE([AC_ARG_PROGRAM])dnl
164 AM_MISSING_PROG(ACLOCAL, aclocal)
165 AM_MISSING_PROG(AUTOCONF, autoconf)
166 AM_MISSING_PROG(AUTOMAKE, automake)
167 AM_MISSING_PROG(AUTOHEADER, autoheader)
168 AM_MISSING_PROG(MAKEINFO, makeinfo)
169 AM_MISSING_PROG(AMTAR, tar)
170 AM_PROG_INSTALL_SH
171 AM_PROG_INSTALL_STRIP
172 # We need awk for the "check" target.  The system "awk" is bad on
173 # some platforms.
174 AC_REQUIRE([AC_PROG_AWK])dnl
175 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
176 AC_REQUIRE([AM_DEP_TRACK])dnl
177 AC_REQUIRE([AM_SET_DEPDIR])dnl
178 AC_PROVIDE_IFELSE([AC_PROG_][CC],
179                   [_AM_DEPENDENCIES(CC)],
180                   [define([AC_PROG_][CC],
181                           defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl
182 AC_PROVIDE_IFELSE([AC_PROG_][CXX],
183                   [_AM_DEPENDENCIES(CXX)],
184                   [define([AC_PROG_][CXX],
185                           defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl
186 ])
187
188 #
189 # Check to make sure that the build environment is sane.
190 #
191
192 # serial 3
193
194 # AM_SANITY_CHECK
195 # ---------------
196 AC_DEFUN([AM_SANITY_CHECK],
197 [AC_MSG_CHECKING([whether build environment is sane])
198 # Just in case
199 sleep 1
200 echo timestamp > conftest.file
201 # Do `set' in a subshell so we don't clobber the current shell's
202 # arguments.  Must try -L first in case configure is actually a
203 # symlink; some systems play weird games with the mod time of symlinks
204 # (eg FreeBSD returns the mod time of the symlink's containing
205 # directory).
206 if (
207    set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
208    if test "$[*]" = "X"; then
209       # -L didn't work.
210       set X `ls -t $srcdir/configure conftest.file`
211    fi
212    rm -f conftest.file
213    if test "$[*]" != "X $srcdir/configure conftest.file" \
214       && test "$[*]" != "X conftest.file $srcdir/configure"; then
215
216       # If neither matched, then we have a broken ls.  This can happen
217       # if, for instance, CONFIG_SHELL is bash and it inherits a
218       # broken ls alias from the environment.  This has actually
219       # happened.  Such a system could not be considered "sane".
220       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
221 alias in your environment])
222    fi
223
224    test "$[2]" = conftest.file
225    )
226 then
227    # Ok.
228    :
229 else
230    AC_MSG_ERROR([newly created file is older than distributed files!
231 Check your system clock])
232 fi
233 AC_MSG_RESULT(yes)])
234
235
236 # serial 2
237
238 # AM_MISSING_PROG(NAME, PROGRAM)
239 # ------------------------------
240 AC_DEFUN([AM_MISSING_PROG],
241 [AC_REQUIRE([AM_MISSING_HAS_RUN])
242 $1=${$1-"${am_missing_run}$2"}
243 AC_SUBST($1)])
244
245
246 # AM_MISSING_HAS_RUN
247 # ------------------
248 # Define MISSING if not defined so far and test if it supports --run.
249 # If it does, set am_missing_run to use it, otherwise, to nothing.
250 AC_DEFUN([AM_MISSING_HAS_RUN],
251 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
252 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
253 # Use eval to expand $SHELL
254 if eval "$MISSING --run true"; then
255   am_missing_run="$MISSING --run "
256 else
257   am_missing_run=
258   am_backtick='`'
259   AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
260 fi
261 ])
262
263 # AM_AUX_DIR_EXPAND
264
265 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
266 # $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
267 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
268 #
269 # Of course, Automake must honor this variable whenever it calls a
270 # tool from the auxiliary directory.  The problem is that $srcdir (and
271 # therefore $ac_aux_dir as well) can be either absolute or relative,
272 # depending on how configure is run.  This is pretty annoying, since
273 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
274 # source directory, any form will work fine, but in subdirectories a
275 # relative path needs to be adjusted first.
276 #
277 # $ac_aux_dir/missing
278 #    fails when called from a subdirectory if $ac_aux_dir is relative
279 # $top_srcdir/$ac_aux_dir/missing
280 #    fails if $ac_aux_dir is absolute,
281 #    fails when called from a subdirectory in a VPATH build with
282 #          a relative $ac_aux_dir
283 #
284 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
285 # are both prefixed by $srcdir.  In an in-source build this is usually
286 # harmless because $srcdir is `.', but things will broke when you
287 # start a VPATH build or use an absolute $srcdir.
288 #
289 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
290 # iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
291 #   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
292 # and then we would define $MISSING as
293 #   MISSING="\${SHELL} $am_aux_dir/missing"
294 # This will work as long as MISSING is not called from configure, because
295 # unfortunately $(top_srcdir) has no meaning in configure.
296 # However there are other variables, like CC, which are often used in
297 # configure, and could therefore not use this "fixed" $ac_aux_dir.
298 #
299 # Another solution, used here, is to always expand $ac_aux_dir to an
300 # absolute PATH.  The drawback is that using absolute paths prevent a
301 # configured tree to be moved without reconfiguration.
302
303 AC_DEFUN([AM_AUX_DIR_EXPAND], [
304 # expand $ac_aux_dir to an absolute path
305 am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd`
306 ])
307
308 # AM_PROG_INSTALL_SH
309 # ------------------
310 # Define $install_sh.
311 AC_DEFUN([AM_PROG_INSTALL_SH],
312 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
313 install_sh=${install_sh-"$am_aux_dir/install-sh"}
314 AC_SUBST(install_sh)])
315
316 # One issue with vendor `install' (even GNU) is that you can't
317 # specify the program used to strip binaries.  This is especially
318 # annoying in cross-compiling environments, where the build's strip
319 # is unlikely to handle the host's binaries.
320 # Fortunately install-sh will honor a STRIPPROG variable, so we
321 # always use install-sh in `make install-strip', and initialize
322 # STRIPPROG with the value of the STRIP variable (set by the user).
323 AC_DEFUN([AM_PROG_INSTALL_STRIP],
324 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
325 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
326 AC_SUBST([INSTALL_STRIP_PROGRAM])])
327
328 # serial 4                                              -*- Autoconf -*-
329
330
331
332 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
333 # written in clear, in which case automake, when reading aclocal.m4,
334 # will think it sees a *use*, and therefore will trigger all it's
335 # C support machinery.  Also note that it means that autoscan, seeing
336 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
337
338
339
340 # _AM_DEPENDENCIES(NAME)
341 # ---------------------
342 # See how the compiler implements dependency checking.
343 # NAME is "CC", "CXX" or "OBJC".
344 # We try a few techniques and use that to set a single cache variable.
345 #
346 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
347 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
348 # dependency, and given that the user is not expected to run this macro,
349 # just rely on AC_PROG_CC.
350 AC_DEFUN([_AM_DEPENDENCIES],
351 [AC_REQUIRE([AM_SET_DEPDIR])dnl
352 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
353 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
354 AC_REQUIRE([AM_DEP_TRACK])dnl
355
356 ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
357        [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
358        [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc']
359        [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
360                    [depcc="$$1"   am_compiler_list=])
361
362 AC_CACHE_CHECK([dependency style of $depcc],
363                [am_cv_$1_dependencies_compiler_type],
364 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
365   # We make a subdir and do the tests there.  Otherwise we can end up
366   # making bogus files that we don't know about and never remove.  For
367   # instance it was reported that on HP-UX the gcc test will end up
368   # making a dummy file named `D' -- because `-MD' means `put the output
369   # in D'.
370   mkdir conftest.dir
371   # Copy depcomp to subdir because otherwise we won't find it if we're
372   # using a relative directory.
373   cp "$am_depcomp" conftest.dir
374   cd conftest.dir
375
376   am_cv_$1_dependencies_compiler_type=none
377   if test "$am_compiler_list" = ""; then
378      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
379   fi
380   for depmode in $am_compiler_list; do
381     # We need to recreate these files for each test, as the compiler may
382     # overwrite some of them when testing with obscure command lines.
383     # This happens at least with the AIX C compiler.
384     echo '#include "conftest.h"' > conftest.c
385     echo 'int i;' > conftest.h
386     echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
387
388     case $depmode in
389     nosideeffect)
390       # after this tag, mechanisms are not by side-effect, so they'll
391       # only be used when explicitly requested
392       if test "x$enable_dependency_tracking" = xyes; then
393         continue
394       else
395         break
396       fi
397       ;;
398     none) break ;;
399     esac
400     # We check with `-c' and `-o' for the sake of the "dashmstdout"
401     # mode.  It turns out that the SunPro C++ compiler does not properly
402     # handle `-M -o', and we need to detect this.
403     if depmode=$depmode \
404        source=conftest.c object=conftest.o \
405        depfile=conftest.Po tmpdepfile=conftest.TPo \
406        $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
407        grep conftest.h conftest.Po > /dev/null 2>&1 &&
408        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
409       am_cv_$1_dependencies_compiler_type=$depmode
410       break
411     fi
412   done
413
414   cd ..
415   rm -rf conftest.dir
416 else
417   am_cv_$1_dependencies_compiler_type=none
418 fi
419 ])
420 $1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type"
421 AC_SUBST([$1DEPMODE])
422 ])
423
424
425 # AM_SET_DEPDIR
426 # -------------
427 # Choose a directory name for dependency files.
428 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
429 AC_DEFUN([AM_SET_DEPDIR],
430 [rm -f .deps 2>/dev/null
431 mkdir .deps 2>/dev/null
432 if test -d .deps; then
433   DEPDIR=.deps
434 else
435   # MS-DOS does not allow filenames that begin with a dot.
436   DEPDIR=_deps
437 fi
438 rmdir .deps 2>/dev/null
439 AC_SUBST(DEPDIR)
440 ])
441
442
443 # AM_DEP_TRACK
444 # ------------
445 AC_DEFUN([AM_DEP_TRACK],
446 [AC_ARG_ENABLE(dependency-tracking,
447 [  --disable-dependency-tracking Speeds up one-time builds
448   --enable-dependency-tracking  Do not reject slow dependency extractors])
449 if test "x$enable_dependency_tracking" != xno; then
450   am_depcomp="$ac_aux_dir/depcomp"
451   AMDEPBACKSLASH='\'
452 fi
453 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
454 pushdef([subst], defn([AC_SUBST]))
455 subst(AMDEPBACKSLASH)
456 popdef([subst])
457 ])
458
459 # Generate code to set up dependency tracking.
460 # This macro should only be invoked once -- use via AC_REQUIRE.
461 # Usage:
462 # AM_OUTPUT_DEPENDENCY_COMMANDS
463
464 #
465 # This code is only required when automatic dependency tracking
466 # is enabled.  FIXME.  This creates each `.P' file that we will
467 # need in order to bootstrap the dependency handling code.
468 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[
469 AC_OUTPUT_COMMANDS([
470 test x"$AMDEP_TRUE" != x"" ||
471 for mf in $CONFIG_FILES; do
472   case "$mf" in
473   Makefile) dirpart=.;;
474   */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
475   *) continue;;
476   esac
477   grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
478   # Extract the definition of DEP_FILES from the Makefile without
479   # running `make'.
480   DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
481   test -z "$DEPDIR" && continue
482   # When using ansi2knr, U may be empty or an underscore; expand it
483   U=`sed -n -e '/^U = / s///p' < "$mf"`
484   test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
485   # We invoke sed twice because it is the simplest approach to
486   # changing $(DEPDIR) to its actual value in the expansion.
487   for file in `sed -n -e '
488     /^DEP_FILES = .*\\\\$/ {
489       s/^DEP_FILES = //
490       :loop
491         s/\\\\$//
492         p
493         n
494         /\\\\$/ b loop
495       p
496     }
497     /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
498        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
499     # Make sure the directory exists.
500     test -f "$dirpart/$file" && continue
501     fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
502     $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
503     # echo "creating $dirpart/$file"
504     echo '# dummy' > "$dirpart/$file"
505   done
506 done
507 ], [AMDEP_TRUE="$AMDEP_TRUE"
508 ac_aux_dir="$ac_aux_dir"])])
509
510 # AM_MAKE_INCLUDE()
511 # -----------------
512 # Check to see how make treats includes.
513 AC_DEFUN([AM_MAKE_INCLUDE],
514 [am_make=${MAKE-make}
515 cat > confinc << 'END'
516 doit:
517         @echo done
518 END
519 # If we don't find an include directive, just comment out the code.
520 AC_MSG_CHECKING([for style of include used by $am_make])
521 am__include='#'
522 am__quote=
523 _am_result=none
524 # First try GNU make style include.
525 echo "include confinc" > confmf
526 # We grep out `Entering directory' and `Leaving directory'
527 # messages which can occur if `w' ends up in MAKEFLAGS.
528 # In particular we don't look at `^make:' because GNU make might
529 # be invoked under some other name (usually "gmake"), in which
530 # case it prints its new name instead of `make'.
531 if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
532    am__include=include
533    am__quote=
534    _am_result=GNU
535 fi
536 # Now try BSD make style include.
537 if test "$am__include" = "#"; then
538    echo '.include "confinc"' > confmf
539    if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
540       am__include=.include
541       am__quote='"'
542       _am_result=BSD
543    fi
544 fi
545 AC_SUBST(am__include)
546 AC_SUBST(am__quote)
547 AC_MSG_RESULT($_am_result)
548 rm -f confinc confmf
549 ])
550
551 # serial 3
552
553 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
554 # -------------------------------------
555 # Define a conditional.
556 #
557 # FIXME: Once using 2.50, use this:
558 # m4_match([$1], [^TRUE\|FALSE$], [AC_FATAL([$0: invalid condition: $1])])dnl
559 AC_DEFUN([AM_CONDITIONAL],
560 [ifelse([$1], [TRUE],
561         [errprint(__file__:__line__: [$0: invalid condition: $1
562 ])dnl
563 m4exit(1)])dnl
564 ifelse([$1], [FALSE],
565        [errprint(__file__:__line__: [$0: invalid condition: $1
566 ])dnl
567 m4exit(1)])dnl
568 AC_SUBST([$1_TRUE])
569 AC_SUBST([$1_FALSE])
570 if $2; then
571   $1_TRUE=
572   $1_FALSE='#'
573 else
574   $1_TRUE='#'
575   $1_FALSE=
576 fi])
577
578 # Like AC_CONFIG_HEADER, but automatically create stamp file.
579
580 # serial 3
581
582 # When config.status generates a header, we must update the stamp-h file.
583 # This file resides in the same directory as the config header
584 # that is generated.  We must strip everything past the first ":",
585 # and everything past the last "/".
586
587 AC_PREREQ([2.12])
588
589 AC_DEFUN([AM_CONFIG_HEADER],
590 [ifdef([AC_FOREACH],dnl
591          [dnl init our file count if it isn't already
592          m4_ifndef([_AM_Config_Header_Index], m4_define([_AM_Config_Header_Index], [0]))
593          dnl prepare to store our destination file list for use in config.status
594          AC_FOREACH([_AM_File], [$1],
595                     [m4_pushdef([_AM_Dest], m4_patsubst(_AM_File, [:.*]))
596                     m4_define([_AM_Config_Header_Index], m4_incr(_AM_Config_Header_Index))
597                     dnl and add it to the list of files AC keeps track of, along
598                     dnl with our hook
599                     AC_CONFIG_HEADERS(_AM_File,
600 dnl COMMANDS, [, INIT-CMDS]
601 [# update the timestamp
602 echo timestamp >"AS_ESCAPE(_AM_DIRNAME(]_AM_Dest[))/stamp-h]_AM_Config_Header_Index["
603 ][$2]m4_ifval([$3], [, [$3]]))dnl AC_CONFIG_HEADERS
604                     m4_popdef([_AM_Dest])])],dnl
605 [AC_CONFIG_HEADER([$1])
606   AC_OUTPUT_COMMANDS(
607    ifelse(patsubst([$1], [[^ ]], []),
608           [],
609           [test -z "$CONFIG_HEADERS" || echo timestamp >dnl
610            patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),dnl
611 [am_indx=1
612 for am_file in $1; do
613   case " \$CONFIG_HEADERS " in
614   *" \$am_file "*)
615     am_dir=\`echo \$am_file |sed 's%:.*%%;s%[^/]*\$%%'\`
616     if test -n "\$am_dir"; then
617       am_tmpdir=\`echo \$am_dir |sed 's%^\(/*\).*\$%\1%'\`
618       for am_subdir in \`echo \$am_dir |sed 's%/% %'\`; do
619         am_tmpdir=\$am_tmpdir\$am_subdir/
620         if test ! -d \$am_tmpdir; then
621           mkdir \$am_tmpdir
622         fi
623       done
624     fi
625     echo timestamp > "\$am_dir"stamp-h\$am_indx
626     ;;
627   esac
628   am_indx=\`expr \$am_indx + 1\`
629 done])
630 ])]) # AM_CONFIG_HEADER
631
632 # _AM_DIRNAME(PATH)
633 # -----------------
634 # Like AS_DIRNAME, only do it during macro expansion
635 AC_DEFUN([_AM_DIRNAME],
636        [m4_if(m4_regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
637               m4_if(m4_regexp([$1], [^//\([^/]\|$\)]), -1,
638                     m4_if(m4_regexp([$1], [^/.*]), -1,
639                           [.],
640                           m4_patsubst([$1], [^\(/\).*], [\1])),
641                     m4_patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
642               m4_patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
643 ]) # _AM_DIRNAME
644
645 #serial 1
646 # This test replaces the one in autoconf.
647 # Currently this macro should have the same name as the autoconf macro
648 # because gettext's gettext.m4 (distributed in the automake package)
649 # still uses it.  Otherwise, the use in gettext.m4 makes autoheader
650 # give these diagnostics:
651 #   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
652 #   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
653
654 undefine([AC_ISC_POSIX])
655
656 AC_DEFUN([AC_ISC_POSIX],
657   [
658     dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
659     AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
660   ]
661 )
662
663
664 # serial 1
665
666 AC_DEFUN([AM_C_PROTOTYPES],
667 [AC_REQUIRE([AM_PROG_CC_STDC])
668 AC_REQUIRE([AC_PROG_CPP])
669 AC_MSG_CHECKING([for function prototypes])
670 if test "$am_cv_prog_cc_stdc" != no; then
671   AC_MSG_RESULT(yes)
672   AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
673   U= ANSI2KNR=
674 else
675   AC_MSG_RESULT(no)
676   U=_ ANSI2KNR=./ansi2knr
677 fi
678 # Ensure some checks needed by ansi2knr itself.
679 AC_HEADER_STDC
680 AC_CHECK_HEADERS(string.h)
681 AC_SUBST(U)dnl
682 AC_SUBST(ANSI2KNR)dnl
683 ])
684
685
686 # serial 1
687
688 # @defmac AC_PROG_CC_STDC
689 # @maindex PROG_CC_STDC
690 # @ovindex CC
691 # If the C compiler in not in ANSI C mode by default, try to add an option
692 # to output variable @code{CC} to make it so.  This macro tries various
693 # options that select ANSI C on some system or another.  It considers the
694 # compiler to be in ANSI C mode if it handles function prototypes correctly.
695 #
696 # If you use this macro, you should check after calling it whether the C
697 # compiler has been set to accept ANSI C; if not, the shell variable
698 # @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
699 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
700 # program @code{ansi2knr}, which comes with Ghostscript.
701 # @end defmac
702
703 AC_DEFUN([AM_PROG_CC_STDC],
704 [AC_REQUIRE([AC_PROG_CC])
705 AC_BEFORE([$0], [AC_C_INLINE])
706 AC_BEFORE([$0], [AC_C_CONST])
707 dnl Force this before AC_PROG_CPP.  Some cpp's, eg on HPUX, require
708 dnl a magic option to avoid problems with ANSI preprocessor commands
709 dnl like #elif.
710 dnl FIXME: can't do this because then AC_AIX won't work due to a
711 dnl circular dependency.
712 dnl AC_BEFORE([$0], [AC_PROG_CPP])
713 AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
714 AC_CACHE_VAL(am_cv_prog_cc_stdc,
715 [am_cv_prog_cc_stdc=no
716 ac_save_CC="$CC"
717 # Don't try gcc -ansi; that turns off useful extensions and
718 # breaks some systems' header files.
719 # AIX                   -qlanglvl=ansi
720 # Ultrix and OSF/1      -std1
721 # HP-UX 10.20 and later -Ae
722 # HP-UX older versions  -Aa -D_HPUX_SOURCE
723 # SVR4                  -Xc -D__EXTENSIONS__
724 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
725 do
726   CC="$ac_save_CC $ac_arg"
727   AC_TRY_COMPILE(
728 [#include <stdarg.h>
729 #include <stdio.h>
730 #include <sys/types.h>
731 #include <sys/stat.h>
732 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
733 struct buf { int x; };
734 FILE * (*rcsopen) (struct buf *, struct stat *, int);
735 static char *e (p, i)
736      char **p;
737      int i;
738 {
739   return p[i];
740 }
741 static char *f (char * (*g) (char **, int), char **p, ...)
742 {
743   char *s;
744   va_list v;
745   va_start (v,p);
746   s = g (p, va_arg (v,int));
747   va_end (v);
748   return s;
749 }
750 int test (int i, double x);
751 struct s1 {int (*f) (int a);};
752 struct s2 {int (*f) (double a);};
753 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
754 int argc;
755 char **argv;
756 ], [
757 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
758 ],
759 [am_cv_prog_cc_stdc="$ac_arg"; break])
760 done
761 CC="$ac_save_CC"
762 ])
763 if test -z "$am_cv_prog_cc_stdc"; then
764   AC_MSG_RESULT([none needed])
765 else
766   AC_MSG_RESULT([$am_cv_prog_cc_stdc])
767 fi
768 case "x$am_cv_prog_cc_stdc" in
769   x|xno) ;;
770   *) CC="$CC $am_cv_prog_cc_stdc" ;;
771 esac
772 ])
773