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