[project @ 2002-08-18 21:34:24 by unknown_lamer]
[clinton/bobotpp.git] / aclocal.m4
CommitLineData
2e20c3e1 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
14pr#
15# Copyright (c) 1998 Etienne Bernard
16# Copyright (c) 2002 Clinton Ebadi
17#
18
19# Check if we have a decent C++ compiler
20# that supports Standard Template Library (STL)
21AC_DEFUN(AC_CPP_STL,
22[
23 AC_MSG_CHECKING([for STL support])
24
25 AC_CACHE_VAL(ac_cv_cpp_stl,
26 [
27 AC_LANG_CPLUSPLUS
28 cat > conftest.$ac_ext <<EOF
29 #include <list>
30 int main() {
31 std::list<int> l;
32 return 0;
33 };
34EOF
35
36
37 if AC_TRY_EVAL(ac_link) && test -s conftest; then
38 ac_cv_cpp_stl="have_stl=yes"
39 else
40 ac_cv_cpp_stl="have_stl=no"
41 fi
42 rm -f conftest*
43 ])dnl
44 eval "$ac_cv_cpp_stl"
45
46 AC_MSG_RESULT([$have_stl])
47
48 if test "$have_stl" != "yes"; then
49 AC_MSG_ERROR([Sorry, you need STL support with your compiler])
50 fi
51])
52
53
54# Check is compiler has ios_base
55AC_DEFUN(AC_CPP_STL_IOSBASE,
56[
57 AC_MSG_CHECKING([for std::ios_base in iostreams])
58
59 AC_CACHE_VAL(ac_cv_cpp_iosbase,
60 [
61 AC_LANG_CPLUSPLUS
62 cat > conftest.$ac_ext <<EOF
63 #include <iostream>
64 #include <fstream>
65 int main() {
66 std::ifstream file ("README", std::ios_base::in);
67 return 0;
68 };
69EOF
70
71 if AC_TRY_EVAL(ac_link) && test -s conftest; then
72 ac_cv_cpp_iosbase="have_iosbase=yes"
73 else
74 ac_cv_cpp_iosbase="have_iosbase=no"
75 fi
76 rm -f conftest*
77 ])dnl
78 eval "$ac_cv_cpp_iosbase"
79
80 AC_MSG_RESULT([$have_iosbase])
81
82 if test "$have_iosbase" = "yes"; then
83 HAVE_IOSBASE="-DHAVE_IOSBASE"
84 AC_DEFINE(HAVE_IOSBASE,1)
85 else
86 AC_DEFINE(HAVE_IOSBASE,0)
87 fi
88])
89
90# Check if STL elements support the clear() method
91AC_DEFUN(AC_CPP_STL_CLEAR,
92[
93 AC_MSG_CHECKING([for clear() method in STL objects])
94
95 AC_CACHE_VAL(ac_cv_cpp_stl_clear,
96 [
97 AC_LANG_CPLUSPLUS
98 cat > conftest.$ac_ext <<EOF
99 #include <map>
100 int main() {
101 std::map<int, int, std::less<int> > m;
102 m.clear();
103 return 0;
104 };
105EOF
106
107 if AC_TRY_EVAL(ac_link) && test -s conftest; then
108 ac_cv_cpp_stl_clear="have_stl_clear=yes"
109 else
110 ac_cv_cpp_stl_clear="have_stl_clear=no"
111 fi
112 rm -f conftest*
113 ])dnl
114 eval "$ac_cv_cpp_stl_clear"
115
116 AC_MSG_RESULT([$have_stl_clear])
117
118 if test "$have_stl_clear" = "yes"; then
119 HAVE_STL_CLEAR="-DHAVE_STL_CLEAR"
120 AC_DEFINE(HAVE_STL_CLEAR,1)
121 fi
122])
123
124
125
126
127# GUILE_PROGS -- set paths to Guile interpreter, config and tool programs
128#
129# Usage: GUILE_PROGS
130#
131# This macro looks for programs @code{guile}, @code{guile-config} and
132# @code{guile-tools}, and sets variables @var{GUILE}, @var{GUILE_CONFIG} and
133# @var{GUILE_TOOLS}, to their paths, respectively. If either of the first two
134# is not found, signal error.
135#
136# The variables are marked for substitution, as by @code{AC_SUBST}.
137#
138AC_DEFUN([GUILE_PROGS],
139 [AC_PATH_PROG(GUILE,guile)
140 if test "$GUILE" = "" ; then
141 AC_MSG_ERROR([guile required but not found])
142 fi
143 AC_SUBST(GUILE)
144 AC_PATH_PROG(GUILE_CONFIG,guile-config)
145 if test "$GUILE_CONFIG" = "" ; then
146 AC_MSG_ERROR([guile-config required but not found])
147 fi
148 AC_SUBST(GUILE_CONFIG)
149 AC_PATH_PROG(GUILE_TOOLS,guile-tools)
150 AC_SUBST(GUILE_TOOLS)
151 ])
152
153# GUILE_FLAGS -- set flags for compiling and linking with Guile
154#
155# Usage: GUILE_FLAGS
156#
157# This macro runs the @code{guile-config} script, installed with Guile, to
158# find out where Guile's header files and libraries are installed. It sets
159# two variables, @var{GUILE_CFLAGS} and @var{GUILE_LDFLAGS}.
160#
161# @var{GUILE_CFLAGS}: flags to pass to a C or C++ compiler to build code that
162# uses Guile header files. This is almost always just a @code{-I} flag.
163#
164# @var{GUILE_LDFLAGS}: flags to pass to the linker to link a program against
165# Guile. This includes @code{-lguile} for the Guile library itself, any
166# libraries that Guile itself requires (like -lqthreads), and so on. It may
167# also include a @code{-L} flag to tell the compiler where to find the
168# libraries.
169#
170# The variables are marked for substitution, as by @code{AC_SUBST}.
171#
172AC_DEFUN([GUILE_FLAGS],
173 [AC_REQUIRE([GUILE_PROGS])dnl
174 AC_MSG_CHECKING([libguile compile flags])
175 GUILE_CFLAGS="`$GUILE_CONFIG compile`"
176 AC_MSG_RESULT([$GUILE_CFLAGS])
177 AC_MSG_CHECKING([libguile link flags])
178 GUILE_LDFLAGS="`$GUILE_CONFIG link`"
179 AC_MSG_RESULT([$GUILE_LDFLAGS])
180 AC_SUBST(GUILE_CFLAGS)
181 AC_SUBST(GUILE_LDFLAGS)
182 ])
183
184# GUILE_SITE_DIR -- find path to Guile "site" directory
185#
186# Usage: GUILE_SITE_DIR
187#
188# This looks for Guile's "site" directory, usually something like
189# PREFIX/share/guile/site, and sets var @var{GUILE_SITE} to the path.
190# Note that the var name is different from the macro name.
191#
192# The variable is marked for substitution, as by @code{AC_SUBST}.
193#
194AC_DEFUN([GUILE_SITE_DIR],
195 [AC_REQUIRE([GUILE_PROGS])dnl
196 AC_MSG_CHECKING(for Guile site directory)
197 GUILE_SITE=`[$GUILE_CONFIG] info pkgdatadir`/site
198 AC_MSG_RESULT($GUILE_SITE)
199 AC_SUBST(GUILE_SITE)
200 ])
201
202# GUILE_CHECK -- evaluate Guile Scheme code and capture the return value
203#
204# Usage: GUILE_CHECK_RETVAL(var,check)
205#
206# @var{var} is a shell variable name to be set to the return value.
207# @var{check} is a Guile Scheme expression, evaluated with "$GUILE -c", and
208# returning either 0 or non-#f to indicate the check passed.
209# Non-0 number or #f indicates failure.
210# Avoid using the character "#" since that confuses autoconf.
211#
212AC_DEFUN([GUILE_CHECK],
213 [AC_REQUIRE([GUILE_PROGS])
214 $GUILE -c "$2" > /dev/null 2>&1
215 $1=$?
216 ])
217
218# GUILE_MODULE_CHECK -- check feature of a Guile Scheme module
219#
220# Usage: GUILE_MODULE_CHECK(var,module,featuretest,description)
221#
222# @var{var} is a shell variable name to be set to "yes" or "no".
223# @var{module} is a list of symbols, like: (ice-9 common-list).
224# @var{featuretest} is an expression acceptable to GUILE_CHECK, q.v.
225# @var{description} is a present-tense verb phrase (passed to AC_MSG_CHECKING).
226#
227AC_DEFUN([GUILE_MODULE_CHECK],
228 [AC_MSG_CHECKING([if $2 $4])
229 GUILE_CHECK($1,(use-modules $2) (exit ((lambda () $3))))
230 if test "$$1" = "0" ; then $1=yes ; else $1=no ; fi
231 AC_MSG_RESULT($$1)
232 ])
233
234# GUILE_MODULE_AVAILABLE -- check availability of a Guile Scheme module
235#
236# Usage: GUILE_MODULE_AVAILABLE(var,module)
237#
238# @var{var} is a shell variable name to be set to "yes" or "no".
239# @var{module} is a list of symbols, like: (ice-9 common-list).
240#
241AC_DEFUN([GUILE_MODULE_AVAILABLE],
242 [GUILE_MODULE_CHECK($1,$2,0,is available)
243 ])
244
245# GUILE_MODULE_REQUIRED -- fail if a Guile Scheme module is unavailable
246#
247# Usage: GUILE_MODULE_REQUIRED(symlist)
248#
249# @var{symlist} is a list of symbols, WITHOUT surrounding parens,
250# like: ice-9 common-list.
251#
252AC_DEFUN([GUILE_MODULE_REQUIRED],
253 [GUILE_MODULE_AVAILABLE(ac_guile_module_required, ($1))
254 if test "$ac_guile_module_required" = "no" ; then
255 AC_MSG_ERROR([required guile module not found: ($1)])
256 fi
257 ])
258
259# GUILE_MODULE_EXPORTS -- check if a module exports a variable
260#
261# Usage: GUILE_MODULE_EXPORTS(var,module,modvar)
262#
263# @var{var} is a shell variable to be set to "yes" or "no".
264# @var{module} is a list of symbols, like: (ice-9 common-list).
265# @var{modvar} is the Guile Scheme variable to check.
266#
267AC_DEFUN([GUILE_MODULE_EXPORTS],
268 [GUILE_MODULE_CHECK($1,$2,$3,exports `$3')
269 ])
270
271# GUILE_MODULE_REQUIRED_EXPORT -- fail if a module doesn't export a variable
272#
273# Usage: GUILE_MODULE_REQUIRED_EXPORT(module,modvar)
274#
275# @var{module} is a list of symbols, like: (ice-9 common-list).
276# @var{modvar} is the Guile Scheme variable to check.
277#
278AC_DEFUN([GUILE_MODULE_REQUIRED_EXPORT],
279 [GUILE_MODULE_EXPORTS(guile_module_required_export,$1,$2)
280 if test "$guile_module_required_export" = "no" ; then
281 AC_MSG_ERROR([module $1 does not export $2; required])
282 fi
283 ])
284
285
286# Do all the work for Automake. This macro actually does too much --
287# some checks are only needed if your package does certain things.
288# But this isn't really a big deal.
289
290# serial 5
291
292# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
293# written in clear, in which case automake, when reading aclocal.m4,
294# will think it sees a *use*, and therefore will trigger all it's
295# C support machinery. Also note that it means that autoscan, seeing
296# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
297
298
299# We require 2.13 because we rely on SHELL being computed by configure.
300AC_PREREQ([2.13])
301
302# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
303# -----------------------------------------------------------
304# If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED.
305# The purpose of this macro is to provide the user with a means to
306# check macros which are provided without letting her know how the
307# information is coded.
308# If this macro is not defined by Autoconf, define it here.
309ifdef([AC_PROVIDE_IFELSE],
310 [],
311 [define([AC_PROVIDE_IFELSE],
312 [ifdef([AC_PROVIDE_$1],
313 [$2], [$3])])])
314
315
316# AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
317# ----------------------------------------------
318AC_DEFUN([AM_INIT_AUTOMAKE],
319[AC_REQUIRE([AC_PROG_INSTALL])dnl
320# test to see if srcdir already configured
321if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" &&
322 test -f $srcdir/config.status; then
323 AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first])
324fi
325
326# Define the identity of the package.
327PACKAGE=$1
328AC_SUBST(PACKAGE)dnl
329VERSION=$2
330AC_SUBST(VERSION)dnl
331ifelse([$3],,
332[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
333AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
334
335# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
336# the ones we care about.
337ifdef([m4_pattern_allow],
338 [m4_pattern_allow([^AM_[A-Z]+FLAGS])])dnl
339
340# Autoconf 2.50 always computes EXEEXT. However we need to be
341# compatible with 2.13, for now. So we always define EXEEXT, but we
342# don't compute it.
343AC_SUBST(EXEEXT)
344# Similar for OBJEXT -- only we only use OBJEXT if the user actually
345# requests that it be used. This is a bit dumb.
346: ${OBJEXT=o}
347AC_SUBST(OBJEXT)
348
349# Some tools Automake needs.
350AC_REQUIRE([AM_SANITY_CHECK])dnl
351AC_REQUIRE([AC_ARG_PROGRAM])dnl
352AM_MISSING_PROG(ACLOCAL, aclocal)
353AM_MISSING_PROG(AUTOCONF, autoconf)
354AM_MISSING_PROG(AUTOMAKE, automake)
355AM_MISSING_PROG(AUTOHEADER, autoheader)
356AM_MISSING_PROG(MAKEINFO, makeinfo)
357AM_MISSING_PROG(AMTAR, tar)
358AM_PROG_INSTALL_SH
359AM_PROG_INSTALL_STRIP
360# We need awk for the "check" target. The system "awk" is bad on
361# some platforms.
362AC_REQUIRE([AC_PROG_AWK])dnl
363AC_REQUIRE([AC_PROG_MAKE_SET])dnl
364AC_REQUIRE([AM_DEP_TRACK])dnl
365AC_REQUIRE([AM_SET_DEPDIR])dnl
366AC_PROVIDE_IFELSE([AC_PROG_][CC],
367 [_AM_DEPENDENCIES(CC)],
368 [define([AC_PROG_][CC],
369 defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl
370AC_PROVIDE_IFELSE([AC_PROG_][CXX],
371 [_AM_DEPENDENCIES(CXX)],
372 [define([AC_PROG_][CXX],
373 defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl
374])
375
376#
377# Check to make sure that the build environment is sane.
378#
379
380# serial 3
381
382# AM_SANITY_CHECK
383# ---------------
384AC_DEFUN([AM_SANITY_CHECK],
385[AC_MSG_CHECKING([whether build environment is sane])
386# Just in case
387sleep 1
388echo timestamp > conftest.file
389# Do `set' in a subshell so we don't clobber the current shell's
390# arguments. Must try -L first in case configure is actually a
391# symlink; some systems play weird games with the mod time of symlinks
392# (eg FreeBSD returns the mod time of the symlink's containing
393# directory).
394if (
395 set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
396 if test "$[*]" = "X"; then
397 # -L didn't work.
398 set X `ls -t $srcdir/configure conftest.file`
399 fi
400 rm -f conftest.file
401 if test "$[*]" != "X $srcdir/configure conftest.file" \
402 && test "$[*]" != "X conftest.file $srcdir/configure"; then
403
404 # If neither matched, then we have a broken ls. This can happen
405 # if, for instance, CONFIG_SHELL is bash and it inherits a
406 # broken ls alias from the environment. This has actually
407 # happened. Such a system could not be considered "sane".
408 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
409alias in your environment])
410 fi
411
412 test "$[2]" = conftest.file
413 )
414then
415 # Ok.
416 :
417else
418 AC_MSG_ERROR([newly created file is older than distributed files!
419Check your system clock])
420fi
421AC_MSG_RESULT(yes)])
422
423
424# serial 2
425
426# AM_MISSING_PROG(NAME, PROGRAM)
427# ------------------------------
428AC_DEFUN([AM_MISSING_PROG],
429[AC_REQUIRE([AM_MISSING_HAS_RUN])
430$1=${$1-"${am_missing_run}$2"}
431AC_SUBST($1)])
432
433
434# AM_MISSING_HAS_RUN
435# ------------------
436# Define MISSING if not defined so far and test if it supports --run.
437# If it does, set am_missing_run to use it, otherwise, to nothing.
438AC_DEFUN([AM_MISSING_HAS_RUN],
439[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
440test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
441# Use eval to expand $SHELL
442if eval "$MISSING --run true"; then
443 am_missing_run="$MISSING --run "
444else
445 am_missing_run=
446 am_backtick='`'
447 AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
448fi
449])
450
451# AM_AUX_DIR_EXPAND
452
453# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
454# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
455# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
456#
457# Of course, Automake must honor this variable whenever it calls a
458# tool from the auxiliary directory. The problem is that $srcdir (and
459# therefore $ac_aux_dir as well) can be either absolute or relative,
460# depending on how configure is run. This is pretty annoying, since
461# it makes $ac_aux_dir quite unusable in subdirectories: in the top
462# source directory, any form will work fine, but in subdirectories a
463# relative path needs to be adjusted first.
464#
465# $ac_aux_dir/missing
466# fails when called from a subdirectory if $ac_aux_dir is relative
467# $top_srcdir/$ac_aux_dir/missing
468# fails if $ac_aux_dir is absolute,
469# fails when called from a subdirectory in a VPATH build with
470# a relative $ac_aux_dir
471#
472# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
473# are both prefixed by $srcdir. In an in-source build this is usually
474# harmless because $srcdir is `.', but things will broke when you
475# start a VPATH build or use an absolute $srcdir.
476#
477# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
478# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
479# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
480# and then we would define $MISSING as
481# MISSING="\${SHELL} $am_aux_dir/missing"
482# This will work as long as MISSING is not called from configure, because
483# unfortunately $(top_srcdir) has no meaning in configure.
484# However there are other variables, like CC, which are often used in
485# configure, and could therefore not use this "fixed" $ac_aux_dir.
486#
487# Another solution, used here, is to always expand $ac_aux_dir to an
488# absolute PATH. The drawback is that using absolute paths prevent a
489# configured tree to be moved without reconfiguration.
490
491AC_DEFUN([AM_AUX_DIR_EXPAND], [
492# expand $ac_aux_dir to an absolute path
493am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd`
494])
495
496# AM_PROG_INSTALL_SH
497# ------------------
498# Define $install_sh.
499AC_DEFUN([AM_PROG_INSTALL_SH],
500[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
501install_sh=${install_sh-"$am_aux_dir/install-sh"}
502AC_SUBST(install_sh)])
503
504# One issue with vendor `install' (even GNU) is that you can't
505# specify the program used to strip binaries. This is especially
506# annoying in cross-compiling environments, where the build's strip
507# is unlikely to handle the host's binaries.
508# Fortunately install-sh will honor a STRIPPROG variable, so we
509# always use install-sh in `make install-strip', and initialize
510# STRIPPROG with the value of the STRIP variable (set by the user).
511AC_DEFUN([AM_PROG_INSTALL_STRIP],
512[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
513INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
514AC_SUBST([INSTALL_STRIP_PROGRAM])])
515
516# serial 4 -*- Autoconf -*-
517
518
519
520# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
521# written in clear, in which case automake, when reading aclocal.m4,
522# will think it sees a *use*, and therefore will trigger all it's
523# C support machinery. Also note that it means that autoscan, seeing
524# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
525
526
527
528# _AM_DEPENDENCIES(NAME)
529# ---------------------
530# See how the compiler implements dependency checking.
531# NAME is "CC", "CXX" or "OBJC".
532# We try a few techniques and use that to set a single cache variable.
533#
534# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
535# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
536# dependency, and given that the user is not expected to run this macro,
537# just rely on AC_PROG_CC.
538AC_DEFUN([_AM_DEPENDENCIES],
539[AC_REQUIRE([AM_SET_DEPDIR])dnl
540AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
541AC_REQUIRE([AM_MAKE_INCLUDE])dnl
542AC_REQUIRE([AM_DEP_TRACK])dnl
543
544ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
545 [$1], CXX, [depcc="$CXX" am_compiler_list=],
546 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc']
547 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
548 [depcc="$$1" am_compiler_list=])
549
550AC_CACHE_CHECK([dependency style of $depcc],
551 [am_cv_$1_dependencies_compiler_type],
552[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
553 # We make a subdir and do the tests there. Otherwise we can end up
554 # making bogus files that we don't know about and never remove. For
555 # instance it was reported that on HP-UX the gcc test will end up
556 # making a dummy file named `D' -- because `-MD' means `put the output
557 # in D'.
558 mkdir conftest.dir
559 # Copy depcomp to subdir because otherwise we won't find it if we're
560 # using a relative directory.
561 cp "$am_depcomp" conftest.dir
562 cd conftest.dir
563
564 am_cv_$1_dependencies_compiler_type=none
565 if test "$am_compiler_list" = ""; then
566 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
567 fi
568 for depmode in $am_compiler_list; do
569 # We need to recreate these files for each test, as the compiler may
570 # overwrite some of them when testing with obscure command lines.
571 # This happens at least with the AIX C compiler.
572 echo '#include "conftest.h"' > conftest.c
573 echo 'int i;' > conftest.h
574 echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
575
576 case $depmode in
577 nosideeffect)
578 # after this tag, mechanisms are not by side-effect, so they'll
579 # only be used when explicitly requested
580 if test "x$enable_dependency_tracking" = xyes; then
581 continue
582 else
583 break
584 fi
585 ;;
586 none) break ;;
587 esac
588 # We check with `-c' and `-o' for the sake of the "dashmstdout"
589 # mode. It turns out that the SunPro C++ compiler does not properly
590 # handle `-M -o', and we need to detect this.
591 if depmode=$depmode \
592 source=conftest.c object=conftest.o \
593 depfile=conftest.Po tmpdepfile=conftest.TPo \
594 $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
595 grep conftest.h conftest.Po > /dev/null 2>&1 &&
596 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
597 am_cv_$1_dependencies_compiler_type=$depmode
598 break
599 fi
600 done
601
602 cd ..
603 rm -rf conftest.dir
604else
605 am_cv_$1_dependencies_compiler_type=none
606fi
607])
608$1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type"
609AC_SUBST([$1DEPMODE])
610])
611
612
613# AM_SET_DEPDIR
614# -------------
615# Choose a directory name for dependency files.
616# This macro is AC_REQUIREd in _AM_DEPENDENCIES
617AC_DEFUN([AM_SET_DEPDIR],
618[rm -f .deps 2>/dev/null
619mkdir .deps 2>/dev/null
620if test -d .deps; then
621 DEPDIR=.deps
622else
623 # MS-DOS does not allow filenames that begin with a dot.
624 DEPDIR=_deps
625fi
626rmdir .deps 2>/dev/null
627AC_SUBST(DEPDIR)
628])
629
630
631# AM_DEP_TRACK
632# ------------
633AC_DEFUN([AM_DEP_TRACK],
634[AC_ARG_ENABLE(dependency-tracking,
635[ --disable-dependency-tracking Speeds up one-time builds
636 --enable-dependency-tracking Do not reject slow dependency extractors])
637if test "x$enable_dependency_tracking" != xno; then
638 am_depcomp="$ac_aux_dir/depcomp"
639 AMDEPBACKSLASH='\'
640fi
641AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
642pushdef([subst], defn([AC_SUBST]))
643subst(AMDEPBACKSLASH)
644popdef([subst])
645])
646
647# Generate code to set up dependency tracking.
648# This macro should only be invoked once -- use via AC_REQUIRE.
649# Usage:
650# AM_OUTPUT_DEPENDENCY_COMMANDS
651
652#
653# This code is only required when automatic dependency tracking
654# is enabled. FIXME. This creates each `.P' file that we will
655# need in order to bootstrap the dependency handling code.
656AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[
657AC_OUTPUT_COMMANDS([
658test x"$AMDEP_TRUE" != x"" ||
659for mf in $CONFIG_FILES; do
660 case "$mf" in
661 Makefile) dirpart=.;;
662 */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
663 *) continue;;
664 esac
665 grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
666 # Extract the definition of DEP_FILES from the Makefile without
667 # running `make'.
668 DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
669 test -z "$DEPDIR" && continue
670 # When using ansi2knr, U may be empty or an underscore; expand it
671 U=`sed -n -e '/^U = / s///p' < "$mf"`
672 test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
673 # We invoke sed twice because it is the simplest approach to
674 # changing $(DEPDIR) to its actual value in the expansion.
675 for file in `sed -n -e '
676 /^DEP_FILES = .*\\\\$/ {
677 s/^DEP_FILES = //
678 :loop
679 s/\\\\$//
680 p
681 n
682 /\\\\$/ b loop
683 p
684 }
685 /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
686 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
687 # Make sure the directory exists.
688 test -f "$dirpart/$file" && continue
689 fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
690 $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
691 # echo "creating $dirpart/$file"
692 echo '# dummy' > "$dirpart/$file"
693 done
694done
695], [AMDEP_TRUE="$AMDEP_TRUE"
696ac_aux_dir="$ac_aux_dir"])])
697
698# AM_MAKE_INCLUDE()
699# -----------------
700# Check to see how make treats includes.
701AC_DEFUN([AM_MAKE_INCLUDE],
702[am_make=${MAKE-make}
703cat > confinc << 'END'
704doit:
705 @echo done
706END
707# If we don't find an include directive, just comment out the code.
708AC_MSG_CHECKING([for style of include used by $am_make])
709am__include='#'
710am__quote=
711_am_result=none
712# First try GNU make style include.
713echo "include confinc" > confmf
714# We grep out `Entering directory' and `Leaving directory'
715# messages which can occur if `w' ends up in MAKEFLAGS.
716# In particular we don't look at `^make:' because GNU make might
717# be invoked under some other name (usually "gmake"), in which
718# case it prints its new name instead of `make'.
719if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
720 am__include=include
721 am__quote=
722 _am_result=GNU
723fi
724# Now try BSD make style include.
725if test "$am__include" = "#"; then
726 echo '.include "confinc"' > confmf
727 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
728 am__include=.include
729 am__quote='"'
730 _am_result=BSD
731 fi
732fi
733AC_SUBST(am__include)
734AC_SUBST(am__quote)
735AC_MSG_RESULT($_am_result)
736rm -f confinc confmf
737])
738
739# serial 3
740
741# AM_CONDITIONAL(NAME, SHELL-CONDITION)
742# -------------------------------------
743# Define a conditional.
744#
745# FIXME: Once using 2.50, use this:
746# m4_match([$1], [^TRUE\|FALSE$], [AC_FATAL([$0: invalid condition: $1])])dnl
747AC_DEFUN([AM_CONDITIONAL],
748[ifelse([$1], [TRUE],
749 [errprint(__file__:__line__: [$0: invalid condition: $1
750])dnl
751m4exit(1)])dnl
752ifelse([$1], [FALSE],
753 [errprint(__file__:__line__: [$0: invalid condition: $1
754])dnl
755m4exit(1)])dnl
756AC_SUBST([$1_TRUE])
757AC_SUBST([$1_FALSE])
758if $2; then
759 $1_TRUE=
760 $1_FALSE='#'
761else
762 $1_TRUE='#'
763 $1_FALSE=
764fi])
765
766# Like AC_CONFIG_HEADER, but automatically create stamp file.
767
768# serial 3
769
770# When config.status generates a header, we must update the stamp-h file.
771# This file resides in the same directory as the config header
772# that is generated. We must strip everything past the first ":",
773# and everything past the last "/".
774
775AC_PREREQ([2.12])
776
777AC_DEFUN([AM_CONFIG_HEADER],
778[ifdef([AC_FOREACH],dnl
779 [dnl init our file count if it isn't already
780 m4_ifndef([_AM_Config_Header_Index], m4_define([_AM_Config_Header_Index], [0]))
781 dnl prepare to store our destination file list for use in config.status
782 AC_FOREACH([_AM_File], [$1],
783 [m4_pushdef([_AM_Dest], m4_patsubst(_AM_File, [:.*]))
784 m4_define([_AM_Config_Header_Index], m4_incr(_AM_Config_Header_Index))
785 dnl and add it to the list of files AC keeps track of, along
786 dnl with our hook
787 AC_CONFIG_HEADERS(_AM_File,
788dnl COMMANDS, [, INIT-CMDS]
789[# update the timestamp
790echo timestamp >"AS_ESCAPE(_AM_DIRNAME(]_AM_Dest[))/stamp-h]_AM_Config_Header_Index["
791][$2]m4_ifval([$3], [, [$3]]))dnl AC_CONFIG_HEADERS
792 m4_popdef([_AM_Dest])])],dnl
793[AC_CONFIG_HEADER([$1])
794 AC_OUTPUT_COMMANDS(
795 ifelse(patsubst([$1], [[^ ]], []),
796 [],
797 [test -z "$CONFIG_HEADERS" || echo timestamp >dnl
798 patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),dnl
799[am_indx=1
800for am_file in $1; do
801 case " \$CONFIG_HEADERS " in
802 *" \$am_file "*)
803 am_dir=\`echo \$am_file |sed 's%:.*%%;s%[^/]*\$%%'\`
804 if test -n "\$am_dir"; then
805 am_tmpdir=\`echo \$am_dir |sed 's%^\(/*\).*\$%\1%'\`
806 for am_subdir in \`echo \$am_dir |sed 's%/% %'\`; do
807 am_tmpdir=\$am_tmpdir\$am_subdir/
808 if test ! -d \$am_tmpdir; then
809 mkdir \$am_tmpdir
810 fi
811 done
812 fi
813 echo timestamp > "\$am_dir"stamp-h\$am_indx
814 ;;
815 esac
816 am_indx=\`expr \$am_indx + 1\`
817done])
818])]) # AM_CONFIG_HEADER
819
820# _AM_DIRNAME(PATH)
821# -----------------
822# Like AS_DIRNAME, only do it during macro expansion
823AC_DEFUN([_AM_DIRNAME],
824 [m4_if(m4_regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
825 m4_if(m4_regexp([$1], [^//\([^/]\|$\)]), -1,
826 m4_if(m4_regexp([$1], [^/.*]), -1,
827 [.],
828 m4_patsubst([$1], [^\(/\).*], [\1])),
829 m4_patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
830 m4_patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
831]) # _AM_DIRNAME
832