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