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