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