aclocal.m4 revision a1d141d5
1a1d141d5Smrg# generated automatically by aclocal 1.7.9 -*- Autoconf -*-
2a1d141d5Smrg
3a1d141d5Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
4a1d141d5Smrg# Free Software Foundation, Inc.
5a1d141d5Smrg# This file is free software; the Free Software Foundation
6a1d141d5Smrg# gives unlimited permission to copy and/or distribute it,
7a1d141d5Smrg# with or without modifications, as long as this notice is preserved.
8a1d141d5Smrg
9a1d141d5Smrg# This program is distributed in the hope that it will be useful,
10a1d141d5Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11a1d141d5Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12a1d141d5Smrg# PARTICULAR PURPOSE.
13a1d141d5Smrg
14a1d141d5Smrg# Do all the work for Automake.                            -*- Autoconf -*-
15a1d141d5Smrg
16a1d141d5Smrg# This macro actually does too much some checks are only needed if
17a1d141d5Smrg# your package does certain things.  But this isn't really a big deal.
18a1d141d5Smrg
19a1d141d5Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
20a1d141d5Smrg# Free Software Foundation, Inc.
21a1d141d5Smrg
22a1d141d5Smrg# This program is free software; you can redistribute it and/or modify
23a1d141d5Smrg# it under the terms of the GNU General Public License as published by
24a1d141d5Smrg# the Free Software Foundation; either version 2, or (at your option)
25a1d141d5Smrg# any later version.
26a1d141d5Smrg
27a1d141d5Smrg# This program is distributed in the hope that it will be useful,
28a1d141d5Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
29a1d141d5Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
30a1d141d5Smrg# GNU General Public License for more details.
31a1d141d5Smrg
32a1d141d5Smrg# You should have received a copy of the GNU General Public License
33a1d141d5Smrg# along with this program; if not, write to the Free Software
34a1d141d5Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
35a1d141d5Smrg# 02111-1307, USA.
36a1d141d5Smrg
37a1d141d5Smrg# serial 10
38a1d141d5Smrg
39a1d141d5SmrgAC_PREREQ([2.54])
40a1d141d5Smrg
41a1d141d5Smrg# Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
42a1d141d5Smrg# the ones we care about.
43a1d141d5Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
44a1d141d5Smrg
45a1d141d5Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
46a1d141d5Smrg# AM_INIT_AUTOMAKE([OPTIONS])
47a1d141d5Smrg# -----------------------------------------------
48a1d141d5Smrg# The call with PACKAGE and VERSION arguments is the old style
49a1d141d5Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
50a1d141d5Smrg# and VERSION should now be passed to AC_INIT and removed from
51a1d141d5Smrg# the call to AM_INIT_AUTOMAKE.
52a1d141d5Smrg# We support both call styles for the transition.  After
53a1d141d5Smrg# the next Automake release, Autoconf can make the AC_INIT
54a1d141d5Smrg# arguments mandatory, and then we can depend on a new Autoconf
55a1d141d5Smrg# release and drop the old call support.
56a1d141d5SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
57a1d141d5Smrg[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
58a1d141d5Smrg AC_REQUIRE([AC_PROG_INSTALL])dnl
59a1d141d5Smrg# test to see if srcdir already configured
60a1d141d5Smrgif test "`cd $srcdir && pwd`" != "`pwd`" &&
61a1d141d5Smrg   test -f $srcdir/config.status; then
62a1d141d5Smrg  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
63a1d141d5Smrgfi
64a1d141d5Smrg
65a1d141d5Smrg# test whether we have cygpath
66a1d141d5Smrgif test -z "$CYGPATH_W"; then
67a1d141d5Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
68a1d141d5Smrg    CYGPATH_W='cygpath -w'
69a1d141d5Smrg  else
70a1d141d5Smrg    CYGPATH_W=echo
71a1d141d5Smrg  fi
72a1d141d5Smrgfi
73a1d141d5SmrgAC_SUBST([CYGPATH_W])
74a1d141d5Smrg
75a1d141d5Smrg# Define the identity of the package.
76a1d141d5Smrgdnl Distinguish between old-style and new-style calls.
77a1d141d5Smrgm4_ifval([$2],
78a1d141d5Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
79a1d141d5Smrg AC_SUBST([PACKAGE], [$1])dnl
80a1d141d5Smrg AC_SUBST([VERSION], [$2])],
81a1d141d5Smrg[_AM_SET_OPTIONS([$1])dnl
82a1d141d5Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
83a1d141d5Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
84a1d141d5Smrg
85a1d141d5Smrg_AM_IF_OPTION([no-define],,
86a1d141d5Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
87a1d141d5Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
88a1d141d5Smrg
89a1d141d5Smrg# Some tools Automake needs.
90a1d141d5SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
91a1d141d5SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
92a1d141d5SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
93a1d141d5SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
94a1d141d5SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
95a1d141d5SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
96a1d141d5SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
97a1d141d5SmrgAM_MISSING_PROG(AMTAR, tar)
98a1d141d5SmrgAM_PROG_INSTALL_SH
99a1d141d5SmrgAM_PROG_INSTALL_STRIP
100a1d141d5Smrg# We need awk for the "check" target.  The system "awk" is bad on
101a1d141d5Smrg# some platforms.
102a1d141d5SmrgAC_REQUIRE([AC_PROG_AWK])dnl
103a1d141d5SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
104a1d141d5SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
105a1d141d5Smrg
106a1d141d5Smrg_AM_IF_OPTION([no-dependencies],,
107a1d141d5Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
108a1d141d5Smrg                  [_AM_DEPENDENCIES(CC)],
109a1d141d5Smrg                  [define([AC_PROG_CC],
110a1d141d5Smrg                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
111a1d141d5SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
112a1d141d5Smrg                  [_AM_DEPENDENCIES(CXX)],
113a1d141d5Smrg                  [define([AC_PROG_CXX],
114a1d141d5Smrg                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
115a1d141d5Smrg])
116a1d141d5Smrg])
117a1d141d5Smrg
118a1d141d5Smrg
119a1d141d5Smrg# When config.status generates a header, we must update the stamp-h file.
120a1d141d5Smrg# This file resides in the same directory as the config header
121a1d141d5Smrg# that is generated.  The stamp files are numbered to have different names.
122a1d141d5Smrg
123a1d141d5Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
124a1d141d5Smrg# loop where config.status creates the headers, so we can generate
125a1d141d5Smrg# our stamp files there.
126a1d141d5SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
127a1d141d5Smrg[# Compute $1's index in $config_headers.
128a1d141d5Smrg_am_stamp_count=1
129a1d141d5Smrgfor _am_header in $config_headers :; do
130a1d141d5Smrg  case $_am_header in
131a1d141d5Smrg    $1 | $1:* )
132a1d141d5Smrg      break ;;
133a1d141d5Smrg    * )
134a1d141d5Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
135a1d141d5Smrg  esac
136a1d141d5Smrgdone
137a1d141d5Smrgecho "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
138a1d141d5Smrg
139a1d141d5Smrg# Copyright 2002  Free Software Foundation, Inc.
140a1d141d5Smrg
141a1d141d5Smrg# This program is free software; you can redistribute it and/or modify
142a1d141d5Smrg# it under the terms of the GNU General Public License as published by
143a1d141d5Smrg# the Free Software Foundation; either version 2, or (at your option)
144a1d141d5Smrg# any later version.
145a1d141d5Smrg
146a1d141d5Smrg# This program is distributed in the hope that it will be useful,
147a1d141d5Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
148a1d141d5Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
149a1d141d5Smrg# GNU General Public License for more details.
150a1d141d5Smrg
151a1d141d5Smrg# You should have received a copy of the GNU General Public License
152a1d141d5Smrg# along with this program; if not, write to the Free Software
153a1d141d5Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
154a1d141d5Smrg
155a1d141d5Smrg# AM_AUTOMAKE_VERSION(VERSION)
156a1d141d5Smrg# ----------------------------
157a1d141d5Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
158a1d141d5Smrg# generated from the m4 files accompanying Automake X.Y.
159a1d141d5SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
160a1d141d5Smrg
161a1d141d5Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
162a1d141d5Smrg# -------------------------------
163a1d141d5Smrg# Call AM_AUTOMAKE_VERSION so it can be traced.
164a1d141d5Smrg# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
165a1d141d5SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
166a1d141d5Smrg	 [AM_AUTOMAKE_VERSION([1.7.9])])
167a1d141d5Smrg
168a1d141d5Smrg# Helper functions for option handling.                    -*- Autoconf -*-
169a1d141d5Smrg
170a1d141d5Smrg# Copyright 2001, 2002  Free Software Foundation, Inc.
171a1d141d5Smrg
172a1d141d5Smrg# This program is free software; you can redistribute it and/or modify
173a1d141d5Smrg# it under the terms of the GNU General Public License as published by
174a1d141d5Smrg# the Free Software Foundation; either version 2, or (at your option)
175a1d141d5Smrg# any later version.
176a1d141d5Smrg
177a1d141d5Smrg# This program is distributed in the hope that it will be useful,
178a1d141d5Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
179a1d141d5Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
180a1d141d5Smrg# GNU General Public License for more details.
181a1d141d5Smrg
182a1d141d5Smrg# You should have received a copy of the GNU General Public License
183a1d141d5Smrg# along with this program; if not, write to the Free Software
184a1d141d5Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
185a1d141d5Smrg# 02111-1307, USA.
186a1d141d5Smrg
187a1d141d5Smrg# serial 2
188a1d141d5Smrg
189a1d141d5Smrg# _AM_MANGLE_OPTION(NAME)
190a1d141d5Smrg# -----------------------
191a1d141d5SmrgAC_DEFUN([_AM_MANGLE_OPTION],
192a1d141d5Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
193a1d141d5Smrg
194a1d141d5Smrg# _AM_SET_OPTION(NAME)
195a1d141d5Smrg# ------------------------------
196a1d141d5Smrg# Set option NAME.  Presently that only means defining a flag for this option.
197a1d141d5SmrgAC_DEFUN([_AM_SET_OPTION],
198a1d141d5Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
199a1d141d5Smrg
200a1d141d5Smrg# _AM_SET_OPTIONS(OPTIONS)
201a1d141d5Smrg# ----------------------------------
202a1d141d5Smrg# OPTIONS is a space-separated list of Automake options.
203a1d141d5SmrgAC_DEFUN([_AM_SET_OPTIONS],
204a1d141d5Smrg[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
205a1d141d5Smrg
206a1d141d5Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
207a1d141d5Smrg# -------------------------------------------
208a1d141d5Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
209a1d141d5SmrgAC_DEFUN([_AM_IF_OPTION],
210a1d141d5Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
211a1d141d5Smrg
212a1d141d5Smrg#
213a1d141d5Smrg# Check to make sure that the build environment is sane.
214a1d141d5Smrg#
215a1d141d5Smrg
216a1d141d5Smrg# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
217a1d141d5Smrg
218a1d141d5Smrg# This program is free software; you can redistribute it and/or modify
219a1d141d5Smrg# it under the terms of the GNU General Public License as published by
220a1d141d5Smrg# the Free Software Foundation; either version 2, or (at your option)
221a1d141d5Smrg# any later version.
222a1d141d5Smrg
223a1d141d5Smrg# This program is distributed in the hope that it will be useful,
224a1d141d5Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
225a1d141d5Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
226a1d141d5Smrg# GNU General Public License for more details.
227a1d141d5Smrg
228a1d141d5Smrg# You should have received a copy of the GNU General Public License
229a1d141d5Smrg# along with this program; if not, write to the Free Software
230a1d141d5Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
231a1d141d5Smrg# 02111-1307, USA.
232a1d141d5Smrg
233a1d141d5Smrg# serial 3
234a1d141d5Smrg
235a1d141d5Smrg# AM_SANITY_CHECK
236a1d141d5Smrg# ---------------
237a1d141d5SmrgAC_DEFUN([AM_SANITY_CHECK],
238a1d141d5Smrg[AC_MSG_CHECKING([whether build environment is sane])
239a1d141d5Smrg# Just in case
240a1d141d5Smrgsleep 1
241a1d141d5Smrgecho timestamp > conftest.file
242a1d141d5Smrg# Do `set' in a subshell so we don't clobber the current shell's
243a1d141d5Smrg# arguments.  Must try -L first in case configure is actually a
244a1d141d5Smrg# symlink; some systems play weird games with the mod time of symlinks
245a1d141d5Smrg# (eg FreeBSD returns the mod time of the symlink's containing
246a1d141d5Smrg# directory).
247a1d141d5Smrgif (
248a1d141d5Smrg   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
249a1d141d5Smrg   if test "$[*]" = "X"; then
250a1d141d5Smrg      # -L didn't work.
251a1d141d5Smrg      set X `ls -t $srcdir/configure conftest.file`
252a1d141d5Smrg   fi
253a1d141d5Smrg   rm -f conftest.file
254a1d141d5Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
255a1d141d5Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
256a1d141d5Smrg
257a1d141d5Smrg      # If neither matched, then we have a broken ls.  This can happen
258a1d141d5Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
259a1d141d5Smrg      # broken ls alias from the environment.  This has actually
260a1d141d5Smrg      # happened.  Such a system could not be considered "sane".
261a1d141d5Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
262a1d141d5Smrgalias in your environment])
263a1d141d5Smrg   fi
264a1d141d5Smrg
265a1d141d5Smrg   test "$[2]" = conftest.file
266a1d141d5Smrg   )
267a1d141d5Smrgthen
268a1d141d5Smrg   # Ok.
269a1d141d5Smrg   :
270a1d141d5Smrgelse
271a1d141d5Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
272a1d141d5SmrgCheck your system clock])
273a1d141d5Smrgfi
274a1d141d5SmrgAC_MSG_RESULT(yes)])
275a1d141d5Smrg
276a1d141d5Smrg#  -*- Autoconf -*-
277a1d141d5Smrg
278a1d141d5Smrg
279a1d141d5Smrg# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
280a1d141d5Smrg
281a1d141d5Smrg# This program is free software; you can redistribute it and/or modify
282a1d141d5Smrg# it under the terms of the GNU General Public License as published by
283a1d141d5Smrg# the Free Software Foundation; either version 2, or (at your option)
284a1d141d5Smrg# any later version.
285a1d141d5Smrg
286a1d141d5Smrg# This program is distributed in the hope that it will be useful,
287a1d141d5Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
288a1d141d5Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
289a1d141d5Smrg# GNU General Public License for more details.
290a1d141d5Smrg
291a1d141d5Smrg# You should have received a copy of the GNU General Public License
292a1d141d5Smrg# along with this program; if not, write to the Free Software
293a1d141d5Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
294a1d141d5Smrg# 02111-1307, USA.
295a1d141d5Smrg
296a1d141d5Smrg# serial 3
297a1d141d5Smrg
298a1d141d5Smrg# AM_MISSING_PROG(NAME, PROGRAM)
299a1d141d5Smrg# ------------------------------
300a1d141d5SmrgAC_DEFUN([AM_MISSING_PROG],
301a1d141d5Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
302a1d141d5Smrg$1=${$1-"${am_missing_run}$2"}
303a1d141d5SmrgAC_SUBST($1)])
304a1d141d5Smrg
305a1d141d5Smrg
306a1d141d5Smrg# AM_MISSING_HAS_RUN
307a1d141d5Smrg# ------------------
308a1d141d5Smrg# Define MISSING if not defined so far and test if it supports --run.
309a1d141d5Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
310a1d141d5SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
311a1d141d5Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
312a1d141d5Smrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
313a1d141d5Smrg# Use eval to expand $SHELL
314a1d141d5Smrgif eval "$MISSING --run true"; then
315a1d141d5Smrg  am_missing_run="$MISSING --run "
316a1d141d5Smrgelse
317a1d141d5Smrg  am_missing_run=
318a1d141d5Smrg  AC_MSG_WARN([`missing' script is too old or missing])
319a1d141d5Smrgfi
320a1d141d5Smrg])
321a1d141d5Smrg
322a1d141d5Smrg# AM_AUX_DIR_EXPAND
323a1d141d5Smrg
324a1d141d5Smrg# Copyright 2001 Free Software Foundation, Inc.
325a1d141d5Smrg
326a1d141d5Smrg# This program is free software; you can redistribute it and/or modify
327a1d141d5Smrg# it under the terms of the GNU General Public License as published by
328a1d141d5Smrg# the Free Software Foundation; either version 2, or (at your option)
329a1d141d5Smrg# any later version.
330a1d141d5Smrg
331a1d141d5Smrg# This program is distributed in the hope that it will be useful,
332a1d141d5Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
333a1d141d5Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
334a1d141d5Smrg# GNU General Public License for more details.
335a1d141d5Smrg
336a1d141d5Smrg# You should have received a copy of the GNU General Public License
337a1d141d5Smrg# along with this program; if not, write to the Free Software
338a1d141d5Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
339a1d141d5Smrg# 02111-1307, USA.
340a1d141d5Smrg
341a1d141d5Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
342a1d141d5Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
343a1d141d5Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
344a1d141d5Smrg#
345a1d141d5Smrg# Of course, Automake must honor this variable whenever it calls a
346a1d141d5Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
347a1d141d5Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
348a1d141d5Smrg# depending on how configure is run.  This is pretty annoying, since
349a1d141d5Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
350a1d141d5Smrg# source directory, any form will work fine, but in subdirectories a
351a1d141d5Smrg# relative path needs to be adjusted first.
352a1d141d5Smrg#
353a1d141d5Smrg# $ac_aux_dir/missing
354a1d141d5Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
355a1d141d5Smrg# $top_srcdir/$ac_aux_dir/missing
356a1d141d5Smrg#    fails if $ac_aux_dir is absolute,
357a1d141d5Smrg#    fails when called from a subdirectory in a VPATH build with
358a1d141d5Smrg#          a relative $ac_aux_dir
359a1d141d5Smrg#
360a1d141d5Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
361a1d141d5Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
362a1d141d5Smrg# harmless because $srcdir is `.', but things will broke when you
363a1d141d5Smrg# start a VPATH build or use an absolute $srcdir.
364a1d141d5Smrg#
365a1d141d5Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
366a1d141d5Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
367a1d141d5Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
368a1d141d5Smrg# and then we would define $MISSING as
369a1d141d5Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
370a1d141d5Smrg# This will work as long as MISSING is not called from configure, because
371a1d141d5Smrg# unfortunately $(top_srcdir) has no meaning in configure.
372a1d141d5Smrg# However there are other variables, like CC, which are often used in
373a1d141d5Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
374a1d141d5Smrg#
375a1d141d5Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
376a1d141d5Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
377a1d141d5Smrg# configured tree to be moved without reconfiguration.
378a1d141d5Smrg
379a1d141d5Smrg# Rely on autoconf to set up CDPATH properly.
380a1d141d5SmrgAC_PREREQ([2.50])
381a1d141d5Smrg
382a1d141d5SmrgAC_DEFUN([AM_AUX_DIR_EXPAND], [
383a1d141d5Smrg# expand $ac_aux_dir to an absolute path
384a1d141d5Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
385a1d141d5Smrg])
386a1d141d5Smrg
387a1d141d5Smrg# AM_PROG_INSTALL_SH
388a1d141d5Smrg# ------------------
389a1d141d5Smrg# Define $install_sh.
390a1d141d5Smrg
391a1d141d5Smrg# Copyright 2001 Free Software Foundation, Inc.
392a1d141d5Smrg
393a1d141d5Smrg# This program is free software; you can redistribute it and/or modify
394a1d141d5Smrg# it under the terms of the GNU General Public License as published by
395a1d141d5Smrg# the Free Software Foundation; either version 2, or (at your option)
396a1d141d5Smrg# any later version.
397a1d141d5Smrg
398a1d141d5Smrg# This program is distributed in the hope that it will be useful,
399a1d141d5Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
400a1d141d5Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
401a1d141d5Smrg# GNU General Public License for more details.
402a1d141d5Smrg
403a1d141d5Smrg# You should have received a copy of the GNU General Public License
404a1d141d5Smrg# along with this program; if not, write to the Free Software
405a1d141d5Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
406a1d141d5Smrg# 02111-1307, USA.
407a1d141d5Smrg
408a1d141d5SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
409a1d141d5Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
410a1d141d5Smrginstall_sh=${install_sh-"$am_aux_dir/install-sh"}
411a1d141d5SmrgAC_SUBST(install_sh)])
412a1d141d5Smrg
413a1d141d5Smrg# AM_PROG_INSTALL_STRIP
414a1d141d5Smrg
415a1d141d5Smrg# Copyright 2001 Free Software Foundation, Inc.
416a1d141d5Smrg
417a1d141d5Smrg# This program is free software; you can redistribute it and/or modify
418a1d141d5Smrg# it under the terms of the GNU General Public License as published by
419a1d141d5Smrg# the Free Software Foundation; either version 2, or (at your option)
420a1d141d5Smrg# any later version.
421a1d141d5Smrg
422a1d141d5Smrg# This program is distributed in the hope that it will be useful,
423a1d141d5Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
424a1d141d5Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
425a1d141d5Smrg# GNU General Public License for more details.
426a1d141d5Smrg
427a1d141d5Smrg# You should have received a copy of the GNU General Public License
428a1d141d5Smrg# along with this program; if not, write to the Free Software
429a1d141d5Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
430a1d141d5Smrg# 02111-1307, USA.
431a1d141d5Smrg
432a1d141d5Smrg# One issue with vendor `install' (even GNU) is that you can't
433a1d141d5Smrg# specify the program used to strip binaries.  This is especially
434a1d141d5Smrg# annoying in cross-compiling environments, where the build's strip
435a1d141d5Smrg# is unlikely to handle the host's binaries.
436a1d141d5Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
437a1d141d5Smrg# always use install-sh in `make install-strip', and initialize
438a1d141d5Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
439a1d141d5SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
440a1d141d5Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
441a1d141d5Smrg# Installed binaries are usually stripped using `strip' when the user
442a1d141d5Smrg# run `make install-strip'.  However `strip' might not be the right
443a1d141d5Smrg# tool to use in cross-compilation environments, therefore Automake
444a1d141d5Smrg# will honor the `STRIP' environment variable to overrule this program.
445a1d141d5Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
446a1d141d5Smrgif test "$cross_compiling" != no; then
447a1d141d5Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
448a1d141d5Smrgfi
449a1d141d5SmrgINSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
450a1d141d5SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
451a1d141d5Smrg
452a1d141d5Smrg#                                                          -*- Autoconf -*-
453a1d141d5Smrg# Copyright (C) 2003  Free Software Foundation, Inc.
454a1d141d5Smrg
455a1d141d5Smrg# This program is free software; you can redistribute it and/or modify
456a1d141d5Smrg# it under the terms of the GNU General Public License as published by
457a1d141d5Smrg# the Free Software Foundation; either version 2, or (at your option)
458a1d141d5Smrg# any later version.
459a1d141d5Smrg
460a1d141d5Smrg# This program is distributed in the hope that it will be useful,
461a1d141d5Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
462a1d141d5Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
463a1d141d5Smrg# GNU General Public License for more details.
464a1d141d5Smrg
465a1d141d5Smrg# You should have received a copy of the GNU General Public License
466a1d141d5Smrg# along with this program; if not, write to the Free Software
467a1d141d5Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
468a1d141d5Smrg# 02111-1307, USA.
469a1d141d5Smrg
470a1d141d5Smrg# serial 1
471a1d141d5Smrg
472a1d141d5Smrg# Check whether the underlying file-system supports filenames
473a1d141d5Smrg# with a leading dot.  For instance MS-DOS doesn't.
474a1d141d5SmrgAC_DEFUN([AM_SET_LEADING_DOT],
475a1d141d5Smrg[rm -rf .tst 2>/dev/null
476a1d141d5Smrgmkdir .tst 2>/dev/null
477a1d141d5Smrgif test -d .tst; then
478a1d141d5Smrg  am__leading_dot=.
479a1d141d5Smrgelse
480a1d141d5Smrg  am__leading_dot=_
481a1d141d5Smrgfi
482a1d141d5Smrgrmdir .tst 2>/dev/null
483a1d141d5SmrgAC_SUBST([am__leading_dot])])
484a1d141d5Smrg
485a1d141d5Smrg# serial 5						-*- Autoconf -*-
486a1d141d5Smrg
487a1d141d5Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003  Free Software Foundation, Inc.
488a1d141d5Smrg
489a1d141d5Smrg# This program is free software; you can redistribute it and/or modify
490a1d141d5Smrg# it under the terms of the GNU General Public License as published by
491a1d141d5Smrg# the Free Software Foundation; either version 2, or (at your option)
492a1d141d5Smrg# any later version.
493a1d141d5Smrg
494a1d141d5Smrg# This program is distributed in the hope that it will be useful,
495a1d141d5Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
496a1d141d5Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
497a1d141d5Smrg# GNU General Public License for more details.
498a1d141d5Smrg
499a1d141d5Smrg# You should have received a copy of the GNU General Public License
500a1d141d5Smrg# along with this program; if not, write to the Free Software
501a1d141d5Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
502a1d141d5Smrg# 02111-1307, USA.
503a1d141d5Smrg
504a1d141d5Smrg
505a1d141d5Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
506a1d141d5Smrg# written in clear, in which case automake, when reading aclocal.m4,
507a1d141d5Smrg# will think it sees a *use*, and therefore will trigger all it's
508a1d141d5Smrg# C support machinery.  Also note that it means that autoscan, seeing
509a1d141d5Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
510a1d141d5Smrg
511a1d141d5Smrg
512a1d141d5Smrg
513a1d141d5Smrg# _AM_DEPENDENCIES(NAME)
514a1d141d5Smrg# ----------------------
515a1d141d5Smrg# See how the compiler implements dependency checking.
516a1d141d5Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
517a1d141d5Smrg# We try a few techniques and use that to set a single cache variable.
518a1d141d5Smrg#
519a1d141d5Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
520a1d141d5Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
521a1d141d5Smrg# dependency, and given that the user is not expected to run this macro,
522a1d141d5Smrg# just rely on AC_PROG_CC.
523a1d141d5SmrgAC_DEFUN([_AM_DEPENDENCIES],
524a1d141d5Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
525a1d141d5SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
526a1d141d5SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
527a1d141d5SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
528a1d141d5Smrg
529a1d141d5Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
530a1d141d5Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
531a1d141d5Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
532a1d141d5Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
533a1d141d5Smrg                   [depcc="$$1"   am_compiler_list=])
534a1d141d5Smrg
535a1d141d5SmrgAC_CACHE_CHECK([dependency style of $depcc],
536a1d141d5Smrg               [am_cv_$1_dependencies_compiler_type],
537a1d141d5Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
538a1d141d5Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
539a1d141d5Smrg  # making bogus files that we don't know about and never remove.  For
540a1d141d5Smrg  # instance it was reported that on HP-UX the gcc test will end up
541a1d141d5Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
542a1d141d5Smrg  # in D'.
543a1d141d5Smrg  mkdir conftest.dir
544a1d141d5Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
545a1d141d5Smrg  # using a relative directory.
546a1d141d5Smrg  cp "$am_depcomp" conftest.dir
547a1d141d5Smrg  cd conftest.dir
548a1d141d5Smrg  # We will build objects and dependencies in a subdirectory because
549a1d141d5Smrg  # it helps to detect inapplicable dependency modes.  For instance
550a1d141d5Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
551a1d141d5Smrg  # side effect of compilation, but ICC will put the dependencies in
552a1d141d5Smrg  # the current directory while Tru64 will put them in the object
553a1d141d5Smrg  # directory.
554a1d141d5Smrg  mkdir sub
555a1d141d5Smrg
556a1d141d5Smrg  am_cv_$1_dependencies_compiler_type=none
557a1d141d5Smrg  if test "$am_compiler_list" = ""; then
558a1d141d5Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
559a1d141d5Smrg  fi
560a1d141d5Smrg  for depmode in $am_compiler_list; do
561a1d141d5Smrg    # Setup a source with many dependencies, because some compilers
562a1d141d5Smrg    # like to wrap large dependency lists on column 80 (with \), and
563a1d141d5Smrg    # we should not choose a depcomp mode which is confused by this.
564a1d141d5Smrg    #
565a1d141d5Smrg    # We need to recreate these files for each test, as the compiler may
566a1d141d5Smrg    # overwrite some of them when testing with obscure command lines.
567a1d141d5Smrg    # This happens at least with the AIX C compiler.
568a1d141d5Smrg    : > sub/conftest.c
569a1d141d5Smrg    for i in 1 2 3 4 5 6; do
570a1d141d5Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
571a1d141d5Smrg      : > sub/conftst$i.h
572a1d141d5Smrg    done
573a1d141d5Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
574a1d141d5Smrg
575a1d141d5Smrg    case $depmode in
576a1d141d5Smrg    nosideeffect)
577a1d141d5Smrg      # after this tag, mechanisms are not by side-effect, so they'll
578a1d141d5Smrg      # only be used when explicitly requested
579a1d141d5Smrg      if test "x$enable_dependency_tracking" = xyes; then
580a1d141d5Smrg	continue
581a1d141d5Smrg      else
582a1d141d5Smrg	break
583a1d141d5Smrg      fi
584a1d141d5Smrg      ;;
585a1d141d5Smrg    none) break ;;
586a1d141d5Smrg    esac
587a1d141d5Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
588a1d141d5Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
589a1d141d5Smrg    # handle `-M -o', and we need to detect this.
590a1d141d5Smrg    if depmode=$depmode \
591a1d141d5Smrg       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
592a1d141d5Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
593a1d141d5Smrg       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
594a1d141d5Smrg         >/dev/null 2>conftest.err &&
595a1d141d5Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
596a1d141d5Smrg       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
597a1d141d5Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
598a1d141d5Smrg      # icc doesn't choke on unknown options, it will just issue warnings
599a1d141d5Smrg      # (even with -Werror).  So we grep stderr for any message
600a1d141d5Smrg      # that says an option was ignored.
601a1d141d5Smrg      if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
602a1d141d5Smrg        am_cv_$1_dependencies_compiler_type=$depmode
603a1d141d5Smrg        break
604a1d141d5Smrg      fi
605a1d141d5Smrg    fi
606a1d141d5Smrg  done
607a1d141d5Smrg
608a1d141d5Smrg  cd ..
609a1d141d5Smrg  rm -rf conftest.dir
610a1d141d5Smrgelse
611a1d141d5Smrg  am_cv_$1_dependencies_compiler_type=none
612a1d141d5Smrgfi
613a1d141d5Smrg])
614a1d141d5SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
615a1d141d5SmrgAM_CONDITIONAL([am__fastdep$1], [
616a1d141d5Smrg  test "x$enable_dependency_tracking" != xno \
617a1d141d5Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
618a1d141d5Smrg])
619a1d141d5Smrg
620a1d141d5Smrg
621a1d141d5Smrg# AM_SET_DEPDIR
622a1d141d5Smrg# -------------
623a1d141d5Smrg# Choose a directory name for dependency files.
624a1d141d5Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
625a1d141d5SmrgAC_DEFUN([AM_SET_DEPDIR],
626a1d141d5Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
627a1d141d5SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
628a1d141d5Smrg])
629a1d141d5Smrg
630a1d141d5Smrg
631a1d141d5Smrg# AM_DEP_TRACK
632a1d141d5Smrg# ------------
633a1d141d5SmrgAC_DEFUN([AM_DEP_TRACK],
634a1d141d5Smrg[AC_ARG_ENABLE(dependency-tracking,
635a1d141d5Smrg[  --disable-dependency-tracking Speeds up one-time builds
636a1d141d5Smrg  --enable-dependency-tracking  Do not reject slow dependency extractors])
637a1d141d5Smrgif test "x$enable_dependency_tracking" != xno; then
638a1d141d5Smrg  am_depcomp="$ac_aux_dir/depcomp"
639a1d141d5Smrg  AMDEPBACKSLASH='\'
640a1d141d5Smrgfi
641a1d141d5SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
642a1d141d5SmrgAC_SUBST([AMDEPBACKSLASH])
643a1d141d5Smrg])
644a1d141d5Smrg
645a1d141d5Smrg# Generate code to set up dependency tracking.   -*- Autoconf -*-
646a1d141d5Smrg
647a1d141d5Smrg# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
648a1d141d5Smrg
649a1d141d5Smrg# This program is free software; you can redistribute it and/or modify
650a1d141d5Smrg# it under the terms of the GNU General Public License as published by
651a1d141d5Smrg# the Free Software Foundation; either version 2, or (at your option)
652a1d141d5Smrg# any later version.
653a1d141d5Smrg
654a1d141d5Smrg# This program is distributed in the hope that it will be useful,
655a1d141d5Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
656a1d141d5Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
657a1d141d5Smrg# GNU General Public License for more details.
658a1d141d5Smrg
659a1d141d5Smrg# You should have received a copy of the GNU General Public License
660a1d141d5Smrg# along with this program; if not, write to the Free Software
661a1d141d5Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
662a1d141d5Smrg# 02111-1307, USA.
663a1d141d5Smrg
664a1d141d5Smrg#serial 2
665a1d141d5Smrg
666a1d141d5Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
667a1d141d5Smrg# ------------------------------
668a1d141d5SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
669a1d141d5Smrg[for mf in $CONFIG_FILES; do
670a1d141d5Smrg  # Strip MF so we end up with the name of the file.
671a1d141d5Smrg  mf=`echo "$mf" | sed -e 's/:.*$//'`
672a1d141d5Smrg  # Check whether this is an Automake generated Makefile or not.
673a1d141d5Smrg  # We used to match only the files named `Makefile.in', but
674a1d141d5Smrg  # some people rename them; so instead we look at the file content.
675a1d141d5Smrg  # Grep'ing the first line is not enough: some people post-process
676a1d141d5Smrg  # each Makefile.in and add a new line on top of each file to say so.
677a1d141d5Smrg  # So let's grep whole file.
678a1d141d5Smrg  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
679a1d141d5Smrg    dirpart=`AS_DIRNAME("$mf")`
680a1d141d5Smrg  else
681a1d141d5Smrg    continue
682a1d141d5Smrg  fi
683a1d141d5Smrg  grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
684a1d141d5Smrg  # Extract the definition of DEP_FILES from the Makefile without
685a1d141d5Smrg  # running `make'.
686a1d141d5Smrg  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
687a1d141d5Smrg  test -z "$DEPDIR" && continue
688a1d141d5Smrg  # When using ansi2knr, U may be empty or an underscore; expand it
689a1d141d5Smrg  U=`sed -n -e '/^U = / s///p' < "$mf"`
690a1d141d5Smrg  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
691a1d141d5Smrg  # We invoke sed twice because it is the simplest approach to
692a1d141d5Smrg  # changing $(DEPDIR) to its actual value in the expansion.
693a1d141d5Smrg  for file in `sed -n -e '
694a1d141d5Smrg    /^DEP_FILES = .*\\\\$/ {
695a1d141d5Smrg      s/^DEP_FILES = //
696a1d141d5Smrg      :loop
697a1d141d5Smrg	s/\\\\$//
698a1d141d5Smrg	p
699a1d141d5Smrg	n
700a1d141d5Smrg	/\\\\$/ b loop
701a1d141d5Smrg      p
702a1d141d5Smrg    }
703a1d141d5Smrg    /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
704a1d141d5Smrg       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
705a1d141d5Smrg    # Make sure the directory exists.
706a1d141d5Smrg    test -f "$dirpart/$file" && continue
707a1d141d5Smrg    fdir=`AS_DIRNAME(["$file"])`
708a1d141d5Smrg    AS_MKDIR_P([$dirpart/$fdir])
709a1d141d5Smrg    # echo "creating $dirpart/$file"
710a1d141d5Smrg    echo '# dummy' > "$dirpart/$file"
711a1d141d5Smrg  done
712a1d141d5Smrgdone
713a1d141d5Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
714a1d141d5Smrg
715a1d141d5Smrg
716a1d141d5Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
717a1d141d5Smrg# -----------------------------
718a1d141d5Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
719a1d141d5Smrg#
720a1d141d5Smrg# This code is only required when automatic dependency tracking
721a1d141d5Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
722a1d141d5Smrg# need in order to bootstrap the dependency handling code.
723a1d141d5SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
724a1d141d5Smrg[AC_CONFIG_COMMANDS([depfiles],
725a1d141d5Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
726a1d141d5Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
727a1d141d5Smrg])
728a1d141d5Smrg
729a1d141d5Smrg# Check to see how 'make' treats includes.	-*- Autoconf -*-
730a1d141d5Smrg
731a1d141d5Smrg# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
732a1d141d5Smrg
733a1d141d5Smrg# This program is free software; you can redistribute it and/or modify
734a1d141d5Smrg# it under the terms of the GNU General Public License as published by
735a1d141d5Smrg# the Free Software Foundation; either version 2, or (at your option)
736a1d141d5Smrg# any later version.
737a1d141d5Smrg
738a1d141d5Smrg# This program is distributed in the hope that it will be useful,
739a1d141d5Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
740a1d141d5Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
741a1d141d5Smrg# GNU General Public License for more details.
742a1d141d5Smrg
743a1d141d5Smrg# You should have received a copy of the GNU General Public License
744a1d141d5Smrg# along with this program; if not, write to the Free Software
745a1d141d5Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
746a1d141d5Smrg# 02111-1307, USA.
747a1d141d5Smrg
748a1d141d5Smrg# serial 2
749a1d141d5Smrg
750a1d141d5Smrg# AM_MAKE_INCLUDE()
751a1d141d5Smrg# -----------------
752a1d141d5Smrg# Check to see how make treats includes.
753a1d141d5SmrgAC_DEFUN([AM_MAKE_INCLUDE],
754a1d141d5Smrg[am_make=${MAKE-make}
755a1d141d5Smrgcat > confinc << 'END'
756a1d141d5Smrgam__doit:
757a1d141d5Smrg	@echo done
758a1d141d5Smrg.PHONY: am__doit
759a1d141d5SmrgEND
760a1d141d5Smrg# If we don't find an include directive, just comment out the code.
761a1d141d5SmrgAC_MSG_CHECKING([for style of include used by $am_make])
762a1d141d5Smrgam__include="#"
763a1d141d5Smrgam__quote=
764a1d141d5Smrg_am_result=none
765a1d141d5Smrg# First try GNU make style include.
766a1d141d5Smrgecho "include confinc" > confmf
767a1d141d5Smrg# We grep out `Entering directory' and `Leaving directory'
768a1d141d5Smrg# messages which can occur if `w' ends up in MAKEFLAGS.
769a1d141d5Smrg# In particular we don't look at `^make:' because GNU make might
770a1d141d5Smrg# be invoked under some other name (usually "gmake"), in which
771a1d141d5Smrg# case it prints its new name instead of `make'.
772a1d141d5Smrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
773a1d141d5Smrg   am__include=include
774a1d141d5Smrg   am__quote=
775a1d141d5Smrg   _am_result=GNU
776a1d141d5Smrgfi
777a1d141d5Smrg# Now try BSD make style include.
778a1d141d5Smrgif test "$am__include" = "#"; then
779a1d141d5Smrg   echo '.include "confinc"' > confmf
780a1d141d5Smrg   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
781a1d141d5Smrg      am__include=.include
782a1d141d5Smrg      am__quote="\""
783a1d141d5Smrg      _am_result=BSD
784a1d141d5Smrg   fi
785a1d141d5Smrgfi
786a1d141d5SmrgAC_SUBST([am__include])
787a1d141d5SmrgAC_SUBST([am__quote])
788a1d141d5SmrgAC_MSG_RESULT([$_am_result])
789a1d141d5Smrgrm -f confinc confmf
790a1d141d5Smrg])
791a1d141d5Smrg
792a1d141d5Smrg# AM_CONDITIONAL                                              -*- Autoconf -*-
793a1d141d5Smrg
794a1d141d5Smrg# Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
795a1d141d5Smrg
796a1d141d5Smrg# This program is free software; you can redistribute it and/or modify
797a1d141d5Smrg# it under the terms of the GNU General Public License as published by
798a1d141d5Smrg# the Free Software Foundation; either version 2, or (at your option)
799a1d141d5Smrg# any later version.
800a1d141d5Smrg
801a1d141d5Smrg# This program is distributed in the hope that it will be useful,
802a1d141d5Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
803a1d141d5Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
804a1d141d5Smrg# GNU General Public License for more details.
805a1d141d5Smrg
806a1d141d5Smrg# You should have received a copy of the GNU General Public License
807a1d141d5Smrg# along with this program; if not, write to the Free Software
808a1d141d5Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
809a1d141d5Smrg# 02111-1307, USA.
810a1d141d5Smrg
811a1d141d5Smrg# serial 5
812a1d141d5Smrg
813a1d141d5SmrgAC_PREREQ(2.52)
814a1d141d5Smrg
815a1d141d5Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
816a1d141d5Smrg# -------------------------------------
817a1d141d5Smrg# Define a conditional.
818a1d141d5SmrgAC_DEFUN([AM_CONDITIONAL],
819a1d141d5Smrg[ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
820a1d141d5Smrg        [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
821a1d141d5SmrgAC_SUBST([$1_TRUE])
822a1d141d5SmrgAC_SUBST([$1_FALSE])
823a1d141d5Smrgif $2; then
824a1d141d5Smrg  $1_TRUE=
825a1d141d5Smrg  $1_FALSE='#'
826a1d141d5Smrgelse
827a1d141d5Smrg  $1_TRUE='#'
828a1d141d5Smrg  $1_FALSE=
829a1d141d5Smrgfi
830a1d141d5SmrgAC_CONFIG_COMMANDS_PRE(
831a1d141d5Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
832a1d141d5Smrg  AC_MSG_ERROR([conditional "$1" was never defined.
833a1d141d5SmrgUsually this means the macro was only invoked conditionally.])
834a1d141d5Smrgfi])])
835a1d141d5Smrg
836a1d141d5Smrg# Add --enable-maintainer-mode option to configure.
837a1d141d5Smrg# From Jim Meyering
838a1d141d5Smrg
839a1d141d5Smrg# Copyright 1996, 1998, 2000, 2001, 2002  Free Software Foundation, Inc.
840a1d141d5Smrg
841a1d141d5Smrg# This program is free software; you can redistribute it and/or modify
842a1d141d5Smrg# it under the terms of the GNU General Public License as published by
843a1d141d5Smrg# the Free Software Foundation; either version 2, or (at your option)
844a1d141d5Smrg# any later version.
845a1d141d5Smrg
846a1d141d5Smrg# This program is distributed in the hope that it will be useful,
847a1d141d5Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
848a1d141d5Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
849a1d141d5Smrg# GNU General Public License for more details.
850a1d141d5Smrg
851a1d141d5Smrg# You should have received a copy of the GNU General Public License
852a1d141d5Smrg# along with this program; if not, write to the Free Software
853a1d141d5Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
854a1d141d5Smrg# 02111-1307, USA.
855a1d141d5Smrg
856a1d141d5Smrg# serial 2
857a1d141d5Smrg
858a1d141d5SmrgAC_DEFUN([AM_MAINTAINER_MODE],
859a1d141d5Smrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
860a1d141d5Smrg  dnl maintainer-mode is disabled by default
861a1d141d5Smrg  AC_ARG_ENABLE(maintainer-mode,
862a1d141d5Smrg[  --enable-maintainer-mode enable make rules and dependencies not useful
863a1d141d5Smrg                          (and sometimes confusing) to the casual installer],
864a1d141d5Smrg      USE_MAINTAINER_MODE=$enableval,
865a1d141d5Smrg      USE_MAINTAINER_MODE=no)
866a1d141d5Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
867a1d141d5Smrg  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
868a1d141d5Smrg  MAINT=$MAINTAINER_MODE_TRUE
869a1d141d5Smrg  AC_SUBST(MAINT)dnl
870a1d141d5Smrg]
871a1d141d5Smrg)
872a1d141d5Smrg
873a1d141d5SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
874a1d141d5Smrg
875a1d141d5Smrg# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
876a1d141d5Smrg
877a1d141d5Smrg# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
878a1d141d5Smrg
879a1d141d5Smrg# This program is free software; you can redistribute it and/or modify
880a1d141d5Smrg# it under the terms of the GNU General Public License as published by
881a1d141d5Smrg# the Free Software Foundation; either version 2, or (at your option)
882a1d141d5Smrg# any later version.
883a1d141d5Smrg
884a1d141d5Smrg# This program is distributed in the hope that it will be useful,
885a1d141d5Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
886a1d141d5Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
887a1d141d5Smrg# GNU General Public License for more details.
888a1d141d5Smrg
889a1d141d5Smrg# You should have received a copy of the GNU General Public License
890a1d141d5Smrg# along with this program; if not, write to the Free Software
891a1d141d5Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
892a1d141d5Smrg# 02111-1307, USA.
893a1d141d5Smrg
894a1d141d5SmrgAC_PREREQ([2.52])
895a1d141d5Smrg
896a1d141d5Smrg# serial 6
897a1d141d5Smrg
898a1d141d5Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
899a1d141d5SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
900a1d141d5Smrg
901a1d141d5Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
902a1d141d5Smrg# 
903a1d141d5Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
904a1d141d5Smrg#
905a1d141d5Smrg# This program is free software; you can redistribute it and/or modify
906a1d141d5Smrg# it under the terms of the GNU General Public License as published by
907a1d141d5Smrg# the Free Software Foundation; either version 2 of the License, or
908a1d141d5Smrg# (at your option) any later version.
909a1d141d5Smrg#
910a1d141d5Smrg# This program is distributed in the hope that it will be useful, but
911a1d141d5Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
912a1d141d5Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
913a1d141d5Smrg# General Public License for more details.
914a1d141d5Smrg#
915a1d141d5Smrg# You should have received a copy of the GNU General Public License
916a1d141d5Smrg# along with this program; if not, write to the Free Software
917a1d141d5Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
918a1d141d5Smrg#
919a1d141d5Smrg# As a special exception to the GNU General Public License, if you
920a1d141d5Smrg# distribute this file as part of a program that contains a
921a1d141d5Smrg# configuration script generated by Autoconf, you may include it under
922a1d141d5Smrg# the same distribution terms that you use for the rest of that program.
923a1d141d5Smrg
924a1d141d5Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
925a1d141d5Smrg# ----------------------------------
926a1d141d5SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
927a1d141d5Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
928a1d141d5Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
929a1d141d5SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
930a1d141d5Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
931a1d141d5Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
932a1d141d5Smrgfi
933a1d141d5Smrgif test -n "$PKG_CONFIG"; then
934a1d141d5Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
935a1d141d5Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
936a1d141d5Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
937a1d141d5Smrg		AC_MSG_RESULT([yes])
938a1d141d5Smrg	else
939a1d141d5Smrg		AC_MSG_RESULT([no])
940a1d141d5Smrg		PKG_CONFIG=""
941a1d141d5Smrg	fi
942a1d141d5Smrg		
943a1d141d5Smrgfi[]dnl
944a1d141d5Smrg])# PKG_PROG_PKG_CONFIG
945a1d141d5Smrg
946a1d141d5Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
947a1d141d5Smrg#
948a1d141d5Smrg# Check to see whether a particular set of modules exists.  Similar
949a1d141d5Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
950a1d141d5Smrg#
951a1d141d5Smrg#
952a1d141d5Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
953a1d141d5Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
954a1d141d5Smrg# PKG_CHECK_EXISTS manually
955a1d141d5Smrg# --------------------------------------------------------------
956a1d141d5SmrgAC_DEFUN([PKG_CHECK_EXISTS],
957a1d141d5Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
958a1d141d5Smrgif test -n "$PKG_CONFIG" && \
959a1d141d5Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
960a1d141d5Smrg  m4_ifval([$2], [$2], [:])
961a1d141d5Smrgm4_ifvaln([$3], [else
962a1d141d5Smrg  $3])dnl
963a1d141d5Smrgfi])
964a1d141d5Smrg
965a1d141d5Smrg
966a1d141d5Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
967a1d141d5Smrg# ---------------------------------------------
968a1d141d5Smrgm4_define([_PKG_CONFIG],
969a1d141d5Smrg[if test -n "$PKG_CONFIG"; then
970a1d141d5Smrg    if test -n "$$1"; then
971a1d141d5Smrg        pkg_cv_[]$1="$$1"
972a1d141d5Smrg    else
973a1d141d5Smrg        PKG_CHECK_EXISTS([$3],
974a1d141d5Smrg                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
975a1d141d5Smrg			 [pkg_failed=yes])
976a1d141d5Smrg    fi
977a1d141d5Smrgelse
978a1d141d5Smrg	pkg_failed=untried
979a1d141d5Smrgfi[]dnl
980a1d141d5Smrg])# _PKG_CONFIG
981a1d141d5Smrg
982a1d141d5Smrg# _PKG_SHORT_ERRORS_SUPPORTED
983a1d141d5Smrg# -----------------------------
984a1d141d5SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
985a1d141d5Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
986a1d141d5Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
987a1d141d5Smrg        _pkg_short_errors_supported=yes
988a1d141d5Smrgelse
989a1d141d5Smrg        _pkg_short_errors_supported=no
990a1d141d5Smrgfi[]dnl
991a1d141d5Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
992a1d141d5Smrg
993a1d141d5Smrg
994a1d141d5Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
995a1d141d5Smrg# [ACTION-IF-NOT-FOUND])
996a1d141d5Smrg#
997a1d141d5Smrg#
998a1d141d5Smrg# Note that if there is a possibility the first call to
999a1d141d5Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
1000a1d141d5Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1001a1d141d5Smrg#
1002a1d141d5Smrg#
1003a1d141d5Smrg# --------------------------------------------------------------
1004a1d141d5SmrgAC_DEFUN([PKG_CHECK_MODULES],
1005a1d141d5Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1006a1d141d5SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1007a1d141d5SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1008a1d141d5Smrg
1009a1d141d5Smrgpkg_failed=no
1010a1d141d5SmrgAC_MSG_CHECKING([for $1])
1011a1d141d5Smrg
1012a1d141d5Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1013a1d141d5Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1014a1d141d5Smrg
1015a1d141d5Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1016a1d141d5Smrgand $1[]_LIBS to avoid the need to call pkg-config.
1017a1d141d5SmrgSee the pkg-config man page for more details.])
1018a1d141d5Smrg
1019a1d141d5Smrgif test $pkg_failed = yes; then
1020a1d141d5Smrg        _PKG_SHORT_ERRORS_SUPPORTED
1021a1d141d5Smrg        if test $_pkg_short_errors_supported = yes; then
1022a1d141d5Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
1023a1d141d5Smrg        else 
1024a1d141d5Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
1025a1d141d5Smrg        fi
1026a1d141d5Smrg	# Put the nasty error message in config.log where it belongs
1027a1d141d5Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1028a1d141d5Smrg
1029a1d141d5Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
1030a1d141d5Smrg[Package requirements ($2) were not met:
1031a1d141d5Smrg
1032a1d141d5Smrg$$1_PKG_ERRORS
1033a1d141d5Smrg
1034a1d141d5SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
1035a1d141d5Smrginstalled software in a non-standard prefix.
1036a1d141d5Smrg
1037a1d141d5Smrg_PKG_TEXT
1038a1d141d5Smrg])],
1039a1d141d5Smrg		[$4])
1040a1d141d5Smrgelif test $pkg_failed = untried; then
1041a1d141d5Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
1042a1d141d5Smrg[The pkg-config script could not be found or is too old.  Make sure it
1043a1d141d5Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
1044a1d141d5Smrgpath to pkg-config.
1045a1d141d5Smrg
1046a1d141d5Smrg_PKG_TEXT
1047a1d141d5Smrg
1048a1d141d5SmrgTo get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
1049a1d141d5Smrg		[$4])
1050a1d141d5Smrgelse
1051a1d141d5Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1052a1d141d5Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1053a1d141d5Smrg        AC_MSG_RESULT([yes])
1054a1d141d5Smrg	ifelse([$3], , :, [$3])
1055a1d141d5Smrgfi[]dnl
1056a1d141d5Smrg])# PKG_CHECK_MODULES
1057a1d141d5Smrg
1058a1d141d5Smrgdnl $Id: aclocal.m4,v 1.1.1.1 2008/07/30 04:16:38 mrg Exp $
1059a1d141d5Smrgdnl
1060a1d141d5Smrgdnl Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
1061a1d141d5Smrgdnl 
1062a1d141d5Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1063a1d141d5Smrgdnl documentation for any purpose is hereby granted without fee, provided that
1064a1d141d5Smrgdnl the above copyright notice appear in all copies and that both that
1065a1d141d5Smrgdnl copyright notice and this permission notice appear in supporting
1066a1d141d5Smrgdnl documentation.
1067a1d141d5Smrgdnl 
1068a1d141d5Smrgdnl The above copyright notice and this permission notice shall be included
1069a1d141d5Smrgdnl in all copies or substantial portions of the Software.
1070a1d141d5Smrgdnl 
1071a1d141d5Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1072a1d141d5Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1073a1d141d5Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1074a1d141d5Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1075a1d141d5Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1076a1d141d5Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1077a1d141d5Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
1078a1d141d5Smrgdnl 
1079a1d141d5Smrgdnl Except as contained in this notice, the name of the copyright holders shall
1080a1d141d5Smrgdnl not be used in advertising or otherwise to promote the sale, use or
1081a1d141d5Smrgdnl other dealings in this Software without prior written authorization
1082a1d141d5Smrgdnl from the copyright holders.
1083a1d141d5Smrgdnl 
1084a1d141d5Smrg
1085a1d141d5Smrg# XORG_PROG_RAWCPP()
1086a1d141d5Smrg# ------------------
1087a1d141d5Smrg# Find cpp program and necessary flags for use in pre-processing text files
1088a1d141d5Smrg# such as man pages and config files
1089a1d141d5SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
1090a1d141d5SmrgAC_REQUIRE([AC_PROG_CPP])
1091a1d141d5SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
1092a1d141d5Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1093a1d141d5Smrg
1094a1d141d5Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
1095a1d141d5Smrg# which is not the best choice for supporting other OS'es, but covers most
1096a1d141d5Smrg# of the ones we need for now.
1097a1d141d5SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
1098a1d141d5SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
1099a1d141d5Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1100a1d141d5Smrg	AC_MSG_RESULT([no])
1101a1d141d5Smrgelse
1102a1d141d5Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1103a1d141d5Smrg		RAWCPPFLAGS=-undef
1104a1d141d5Smrg		AC_MSG_RESULT([yes])
1105a1d141d5Smrg	else
1106a1d141d5Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1107a1d141d5Smrg	fi
1108a1d141d5Smrgfi
1109a1d141d5Smrgrm -f conftest.$ac_ext
1110a1d141d5Smrg
1111a1d141d5SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
1112a1d141d5SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
1113a1d141d5Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1114a1d141d5Smrg	AC_MSG_RESULT([no])
1115a1d141d5Smrgelse
1116a1d141d5Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1117a1d141d5Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1118a1d141d5Smrg		AC_MSG_RESULT([yes])
1119a1d141d5Smrg	else
1120a1d141d5Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1121a1d141d5Smrg	fi
1122a1d141d5Smrgfi
1123a1d141d5Smrgrm -f conftest.$ac_ext
1124a1d141d5SmrgAC_SUBST(RAWCPPFLAGS)
1125a1d141d5Smrg]) # XORG_PROG_RAWCPP
1126a1d141d5Smrg
1127a1d141d5Smrg# XORG_MANPAGE_SECTIONS()
1128a1d141d5Smrg# -----------------------
1129a1d141d5Smrg# Determine which sections man pages go in for the different man page types
1130a1d141d5Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1131a1d141d5Smrg# Not sure if there's any better way than just hardcoding by OS name.
1132a1d141d5Smrg# Override default settings by setting environment variables
1133a1d141d5Smrg
1134a1d141d5SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1135a1d141d5SmrgAC_REQUIRE([AC_CANONICAL_HOST])
1136a1d141d5Smrg
1137a1d141d5Smrgif test x$APP_MAN_SUFFIX = x    ; then
1138a1d141d5Smrg    case $host_os in
1139a1d141d5Smrg	linux*)	APP_MAN_SUFFIX=1x ;;
1140a1d141d5Smrg	*)	APP_MAN_SUFFIX=1  ;;
1141a1d141d5Smrg    esac
1142a1d141d5Smrgfi
1143a1d141d5Smrgif test x$APP_MAN_DIR = x    ; then
1144a1d141d5Smrg    case $host_os in
1145a1d141d5Smrg	linux*)	APP_MAN_DIR='$(mandir)/man1' ;;
1146a1d141d5Smrg	*)	APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' ;;
1147a1d141d5Smrg    esac
1148a1d141d5Smrgfi
1149a1d141d5Smrg
1150a1d141d5Smrgif test x$LIB_MAN_SUFFIX = x    ; then
1151a1d141d5Smrg    case $host_os in
1152a1d141d5Smrg	linux*)	LIB_MAN_SUFFIX=3x ;;
1153a1d141d5Smrg	*)	LIB_MAN_SUFFIX=3  ;;
1154a1d141d5Smrg    esac
1155a1d141d5Smrgfi
1156a1d141d5Smrgif test x$LIB_MAN_DIR = x    ; then
1157a1d141d5Smrg    case $host_os in
1158a1d141d5Smrg	linux*)	LIB_MAN_DIR='$(mandir)/man3' ;;
1159a1d141d5Smrg	*)	LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' ;;
1160a1d141d5Smrg    esac
1161a1d141d5Smrgfi
1162a1d141d5Smrg
1163a1d141d5Smrgif test x$FILE_MAN_SUFFIX = x    ; then
1164a1d141d5Smrg    case $host_os in
1165a1d141d5Smrg	linux*)		FILE_MAN_SUFFIX=5x ;;
1166a1d141d5Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
1167a1d141d5Smrg	*)		FILE_MAN_SUFFIX=5  ;;
1168a1d141d5Smrg    esac
1169a1d141d5Smrgfi
1170a1d141d5Smrgif test x$FILE_MAN_DIR = x    ; then
1171a1d141d5Smrg    case $host_os in
1172a1d141d5Smrg	linux*)	FILE_MAN_DIR='$(mandir)/man5' ;;
1173a1d141d5Smrg	*)	FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' ;;
1174a1d141d5Smrg    esac
1175a1d141d5Smrgfi
1176a1d141d5Smrg
1177a1d141d5Smrg# In Imake's linux.cf, the misc man suffix & dir was only changed for 
1178a1d141d5Smrg# LinuxDebian, not other Linuxes, so we leave it unchanged here
1179a1d141d5Smrgif test x$MISC_MAN_SUFFIX = x    ; then
1180a1d141d5Smrg    case $host_os in
1181a1d141d5Smrg#	linux*)		MISC_MAN_SUFFIX=7x ;;
1182a1d141d5Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
1183a1d141d5Smrg	*)		MISC_MAN_SUFFIX=7  ;;
1184a1d141d5Smrg    esac
1185a1d141d5Smrgfi
1186a1d141d5Smrgif test x$MISC_MAN_DIR = x    ; then
1187a1d141d5Smrg    case $host_os in
1188a1d141d5Smrg#	linux*)	MISC_MAN_DIR='$(mandir)/man7' ;;
1189a1d141d5Smrg	*)	MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' ;;
1190a1d141d5Smrg    esac
1191a1d141d5Smrgfi
1192a1d141d5Smrg
1193a1d141d5Smrg# In Imake's linux.cf, the driver man suffix & dir was only changed for 
1194a1d141d5Smrg# LinuxDebian, not other Linuxes, so we leave it unchanged here
1195a1d141d5Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
1196a1d141d5Smrg    case $host_os in
1197a1d141d5Smrg#	linux*)		DRIVER_MAN_SUFFIX=4x ;;
1198a1d141d5Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
1199a1d141d5Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
1200a1d141d5Smrg    esac
1201a1d141d5Smrgfi
1202a1d141d5Smrgif test x$DRIVER_MAN_DIR = x    ; then
1203a1d141d5Smrg    case $host_os in
1204a1d141d5Smrg#	linux*)	DRIVER_MAN_DIR='$(mandir)/man4' ;;
1205a1d141d5Smrg	*)	DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' ;;
1206a1d141d5Smrg    esac
1207a1d141d5Smrgfi
1208a1d141d5Smrg
1209a1d141d5Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
1210a1d141d5Smrg    case $host_os in
1211a1d141d5Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
1212a1d141d5Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
1213a1d141d5Smrg    esac
1214a1d141d5Smrgfi
1215a1d141d5Smrgif test x$ADMIN_MAN_DIR = x    ; then
1216a1d141d5Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1217a1d141d5Smrgfi
1218a1d141d5Smrg
1219a1d141d5Smrg
1220a1d141d5SmrgAC_SUBST([APP_MAN_SUFFIX])
1221a1d141d5SmrgAC_SUBST([LIB_MAN_SUFFIX])
1222a1d141d5SmrgAC_SUBST([FILE_MAN_SUFFIX])
1223a1d141d5SmrgAC_SUBST([MISC_MAN_SUFFIX])
1224a1d141d5SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
1225a1d141d5SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
1226a1d141d5SmrgAC_SUBST([APP_MAN_DIR])
1227a1d141d5SmrgAC_SUBST([LIB_MAN_DIR])
1228a1d141d5SmrgAC_SUBST([FILE_MAN_DIR])
1229a1d141d5SmrgAC_SUBST([MISC_MAN_DIR])
1230a1d141d5SmrgAC_SUBST([DRIVER_MAN_DIR])
1231a1d141d5SmrgAC_SUBST([ADMIN_MAN_DIR])
1232a1d141d5Smrg]) # XORG_MANPAGE_SECTIONS
1233a1d141d5Smrg
1234a1d141d5Smrg# XORG_CHECK_LINUXDOC
1235a1d141d5Smrg# -------------------
1236a1d141d5Smrg# Defines the variable MAKE_TEXT if the necessary tools and
1237a1d141d5Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1238a1d141d5Smrg# Whether or not the necessary tools and files are found can be checked
1239a1d141d5Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1240a1d141d5SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
1241a1d141d5SmrgAC_CHECK_FILE(
1242a1d141d5Smrg	[$prefix/share/X11/sgml/defs.ent], 
1243a1d141d5Smrg	[DEFS_ENT_PATH=$prefix/share/X11/sgml],
1244a1d141d5Smrg	[DEFS_ENT_PATH=]
1245a1d141d5Smrg)
1246a1d141d5Smrg
1247a1d141d5SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
1248a1d141d5SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
1249a1d141d5Smrg
1250a1d141d5SmrgAC_MSG_CHECKING([Whether to build documentation])
1251a1d141d5Smrg
1252a1d141d5Smrgif test x$DEFS_ENT_PATH != x && test x$LINUXDOC != x ; then
1253a1d141d5Smrg   BUILDDOC=yes
1254a1d141d5Smrgelse
1255a1d141d5Smrg   BUILDDOC=no
1256a1d141d5Smrgfi
1257a1d141d5Smrg
1258a1d141d5SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1259a1d141d5Smrg
1260a1d141d5SmrgAC_MSG_RESULT([$BUILDDOC])
1261a1d141d5Smrg
1262a1d141d5SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
1263a1d141d5Smrg
1264a1d141d5Smrgif test x$PS2PDF != x ; then
1265a1d141d5Smrg   BUILDPDFDOC=yes
1266a1d141d5Smrgelse
1267a1d141d5Smrg   BUILDPDFDOC=no
1268a1d141d5Smrgfi
1269a1d141d5Smrg
1270a1d141d5SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1271a1d141d5Smrg
1272a1d141d5SmrgAC_MSG_RESULT([$BUILDPDFDOC])
1273a1d141d5Smrg
1274a1d141d5SmrgMAKE_TEXT="SGML_SEARCH_PATH=$DEFS_ENT_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
1275a1d141d5SmrgMAKE_PS="SGML_SEARCH_PATH=$DEFS_ENT_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1276a1d141d5SmrgMAKE_PDF="$PS2PDF"
1277a1d141d5SmrgMAKE_HTML="SGML_SEARCH_PATH=$DEFS_ENT_PATH $LINUXDOC  -B html --split=0"
1278a1d141d5Smrg
1279a1d141d5SmrgAC_SUBST(MAKE_TEXT)
1280a1d141d5SmrgAC_SUBST(MAKE_PS)
1281a1d141d5SmrgAC_SUBST(MAKE_PDF)
1282a1d141d5SmrgAC_SUBST(MAKE_HTML)
1283a1d141d5Smrg]) # XORG_CHECK_LINUXDOC
1284a1d141d5Smrg
1285a1d141d5Smrg# XORG_CHECK_MALLOC_ZERO
1286a1d141d5Smrg# ----------------------
1287a1d141d5Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1288a1d141d5Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1289a1d141d5Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1290a1d141d5SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1291a1d141d5SmrgAC_ARG_ENABLE(malloc0returnsnull,
1292a1d141d5Smrg	AC_HELP_STRING([--enable-malloc0returnsnull],
1293a1d141d5Smrg		       [malloc(0) returns NULL (default: auto)]),
1294a1d141d5Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1295a1d141d5Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1296a1d141d5Smrg
1297a1d141d5SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1298a1d141d5Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1299a1d141d5Smrg	AC_RUN_IFELSE([
1300a1d141d5Smrgchar *malloc();
1301a1d141d5Smrgchar *realloc();
1302a1d141d5Smrgchar *calloc();
1303a1d141d5Smrgmain() {
1304a1d141d5Smrg    char *m0, *r0, *c0, *p;
1305a1d141d5Smrg    m0 = malloc(0);
1306a1d141d5Smrg    p = malloc(10);
1307a1d141d5Smrg    r0 = realloc(p,0);
1308a1d141d5Smrg    c0 = calloc(0);
1309a1d141d5Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
1310a1d141d5Smrg}],
1311a1d141d5Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
1312a1d141d5Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
1313a1d141d5Smrgfi
1314a1d141d5SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1315a1d141d5Smrg
1316a1d141d5Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1317a1d141d5Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1318a1d141d5Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1319a1d141d5Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1320a1d141d5Smrgelse
1321a1d141d5Smrg	MALLOC_ZERO_CFLAGS=""
1322a1d141d5Smrg	XMALLOC_ZERO_CFLAGS=""
1323a1d141d5Smrg	XTMALLOC_ZERO_CFLAGS=""
1324a1d141d5Smrgfi
1325a1d141d5Smrg
1326a1d141d5SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1327a1d141d5SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1328a1d141d5SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1329a1d141d5Smrg]) # XORG_CHECK_MALLOC_ZERO
1330a1d141d5Smrg
1331a1d141d5Smrgdnl Copyright 2005 Red Hat, Inc
1332a1d141d5Smrgdnl
1333a1d141d5Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1334a1d141d5Smrgdnl documentation for any purpose is hereby granted without fee, provided that
1335a1d141d5Smrgdnl the above copyright notice appear in all copies and that both that
1336a1d141d5Smrgdnl copyright notice and this permission notice appear in supporting
1337a1d141d5Smrgdnl documentation.
1338a1d141d5Smrgdnl
1339a1d141d5Smrgdnl The above copyright notice and this permission notice shall be included
1340a1d141d5Smrgdnl in all copies or substantial portions of the Software.
1341a1d141d5Smrgdnl
1342a1d141d5Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1343a1d141d5Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1344a1d141d5Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1345a1d141d5Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1346a1d141d5Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1347a1d141d5Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1348a1d141d5Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
1349a1d141d5Smrgdnl
1350a1d141d5Smrgdnl Except as contained in this notice, the name of the copyright holders shall
1351a1d141d5Smrgdnl not be used in advertising or otherwise to promote the sale, use or
1352a1d141d5Smrgdnl other dealings in this Software without prior written authorization
1353a1d141d5Smrgdnl from the copyright holders.
1354a1d141d5Smrgdnl
1355a1d141d5Smrg
1356a1d141d5Smrg# XORG_RELEASE_VERSION
1357a1d141d5Smrg# --------------------
1358a1d141d5Smrg# Adds --with/without-release-string and changes the PACKAGE and
1359a1d141d5Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
1360a1d141d5Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.
1361a1d141d5Smrg 
1362a1d141d5SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
1363a1d141d5Smrg	AC_ARG_WITH(release-version,
1364a1d141d5Smrg			AC_HELP_STRING([--with-release-version=STRING],
1365a1d141d5Smrg				[Use release version string in package name]),
1366a1d141d5Smrg			[RELEASE_VERSION="$withval"],
1367a1d141d5Smrg			[RELEASE_VERSION=""])
1368a1d141d5Smrg	if test "x$RELEASE_VERSION" != "x"; then
1369a1d141d5Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
1370a1d141d5Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
1371a1d141d5Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
1372a1d141d5Smrg	fi
1373a1d141d5Smrg])
1374a1d141d5Smrg
1375