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