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