aclocal.m4 revision 100ae103
1100ae103Smrg# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
2100ae103Smrg
3100ae103Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4100ae103Smrg# 2005  Free Software Foundation, Inc.
5100ae103Smrg# This file is free software; the Free Software Foundation
6100ae103Smrg# gives unlimited permission to copy and/or distribute it,
7100ae103Smrg# with or without modifications, as long as this notice is preserved.
8100ae103Smrg
9100ae103Smrg# This program is distributed in the hope that it will be useful,
10100ae103Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11100ae103Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12100ae103Smrg# PARTICULAR PURPOSE.
13100ae103Smrg
14100ae103Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
15100ae103Smrg# 
16100ae103Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
17100ae103Smrg#
18100ae103Smrg# This program is free software; you can redistribute it and/or modify
19100ae103Smrg# it under the terms of the GNU General Public License as published by
20100ae103Smrg# the Free Software Foundation; either version 2 of the License, or
21100ae103Smrg# (at your option) any later version.
22100ae103Smrg#
23100ae103Smrg# This program is distributed in the hope that it will be useful, but
24100ae103Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
25100ae103Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
26100ae103Smrg# General Public License for more details.
27100ae103Smrg#
28100ae103Smrg# You should have received a copy of the GNU General Public License
29100ae103Smrg# along with this program; if not, write to the Free Software
30100ae103Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31100ae103Smrg#
32100ae103Smrg# As a special exception to the GNU General Public License, if you
33100ae103Smrg# distribute this file as part of a program that contains a
34100ae103Smrg# configuration script generated by Autoconf, you may include it under
35100ae103Smrg# the same distribution terms that you use for the rest of that program.
36100ae103Smrg
37100ae103Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
38100ae103Smrg# ----------------------------------
39100ae103SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
40100ae103Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
41100ae103Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
42100ae103SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
43100ae103Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
44100ae103Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
45100ae103Smrgfi
46100ae103Smrgif test -n "$PKG_CONFIG"; then
47100ae103Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
48100ae103Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
49100ae103Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
50100ae103Smrg		AC_MSG_RESULT([yes])
51100ae103Smrg	else
52100ae103Smrg		AC_MSG_RESULT([no])
53100ae103Smrg		PKG_CONFIG=""
54100ae103Smrg	fi
55100ae103Smrg		
56100ae103Smrgfi[]dnl
57100ae103Smrg])# PKG_PROG_PKG_CONFIG
58100ae103Smrg
59100ae103Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
60100ae103Smrg#
61100ae103Smrg# Check to see whether a particular set of modules exists.  Similar
62100ae103Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
63100ae103Smrg#
64100ae103Smrg#
65100ae103Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
66100ae103Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
67100ae103Smrg# PKG_CHECK_EXISTS manually
68100ae103Smrg# --------------------------------------------------------------
69100ae103SmrgAC_DEFUN([PKG_CHECK_EXISTS],
70100ae103Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
71100ae103Smrgif test -n "$PKG_CONFIG" && \
72100ae103Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
73100ae103Smrg  m4_ifval([$2], [$2], [:])
74100ae103Smrgm4_ifvaln([$3], [else
75100ae103Smrg  $3])dnl
76100ae103Smrgfi])
77100ae103Smrg
78100ae103Smrg
79100ae103Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
80100ae103Smrg# ---------------------------------------------
81100ae103Smrgm4_define([_PKG_CONFIG],
82100ae103Smrg[if test -n "$PKG_CONFIG"; then
83100ae103Smrg    if test -n "$$1"; then
84100ae103Smrg        pkg_cv_[]$1="$$1"
85100ae103Smrg    else
86100ae103Smrg        PKG_CHECK_EXISTS([$3],
87100ae103Smrg                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
88100ae103Smrg			 [pkg_failed=yes])
89100ae103Smrg    fi
90100ae103Smrgelse
91100ae103Smrg	pkg_failed=untried
92100ae103Smrgfi[]dnl
93100ae103Smrg])# _PKG_CONFIG
94100ae103Smrg
95100ae103Smrg# _PKG_SHORT_ERRORS_SUPPORTED
96100ae103Smrg# -----------------------------
97100ae103SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
98100ae103Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
99100ae103Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
100100ae103Smrg        _pkg_short_errors_supported=yes
101100ae103Smrgelse
102100ae103Smrg        _pkg_short_errors_supported=no
103100ae103Smrgfi[]dnl
104100ae103Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
105100ae103Smrg
106100ae103Smrg
107100ae103Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
108100ae103Smrg# [ACTION-IF-NOT-FOUND])
109100ae103Smrg#
110100ae103Smrg#
111100ae103Smrg# Note that if there is a possibility the first call to
112100ae103Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
113100ae103Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
114100ae103Smrg#
115100ae103Smrg#
116100ae103Smrg# --------------------------------------------------------------
117100ae103SmrgAC_DEFUN([PKG_CHECK_MODULES],
118100ae103Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
119100ae103SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
120100ae103SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
121100ae103Smrg
122100ae103Smrgpkg_failed=no
123100ae103SmrgAC_MSG_CHECKING([for $1])
124100ae103Smrg
125100ae103Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
126100ae103Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
127100ae103Smrg
128100ae103Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
129100ae103Smrgand $1[]_LIBS to avoid the need to call pkg-config.
130100ae103SmrgSee the pkg-config man page for more details.])
131100ae103Smrg
132100ae103Smrgif test $pkg_failed = yes; then
133100ae103Smrg        _PKG_SHORT_ERRORS_SUPPORTED
134100ae103Smrg        if test $_pkg_short_errors_supported = yes; then
135100ae103Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
136100ae103Smrg        else 
137100ae103Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
138100ae103Smrg        fi
139100ae103Smrg	# Put the nasty error message in config.log where it belongs
140100ae103Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
141100ae103Smrg
142100ae103Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
143100ae103Smrg[Package requirements ($2) were not met:
144100ae103Smrg
145100ae103Smrg$$1_PKG_ERRORS
146100ae103Smrg
147100ae103SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
148100ae103Smrginstalled software in a non-standard prefix.
149100ae103Smrg
150100ae103Smrg_PKG_TEXT
151100ae103Smrg])],
152100ae103Smrg		[AC_MSG_RESULT([no])
153100ae103Smrg                $4])
154100ae103Smrgelif test $pkg_failed = untried; then
155100ae103Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
156100ae103Smrg[The pkg-config script could not be found or is too old.  Make sure it
157100ae103Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
158100ae103Smrgpath to pkg-config.
159100ae103Smrg
160100ae103Smrg_PKG_TEXT
161100ae103Smrg
162100ae103SmrgTo get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
163100ae103Smrg		[$4])
164100ae103Smrgelse
165100ae103Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
166100ae103Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
167100ae103Smrg        AC_MSG_RESULT([yes])
168100ae103Smrg	ifelse([$3], , :, [$3])
169100ae103Smrgfi[]dnl
170100ae103Smrg])# PKG_CHECK_MODULES
171100ae103Smrg
172100ae103Smrg# Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
173100ae103Smrg#
174100ae103Smrg# This file is free software; the Free Software Foundation
175100ae103Smrg# gives unlimited permission to copy and/or distribute it,
176100ae103Smrg# with or without modifications, as long as this notice is preserved.
177100ae103Smrg
178100ae103Smrg# AM_AUTOMAKE_VERSION(VERSION)
179100ae103Smrg# ----------------------------
180100ae103Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
181100ae103Smrg# generated from the m4 files accompanying Automake X.Y.
182100ae103SmrgAC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
183100ae103Smrg
184100ae103Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
185100ae103Smrg# -------------------------------
186100ae103Smrg# Call AM_AUTOMAKE_VERSION so it can be traced.
187100ae103Smrg# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
188100ae103SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
189100ae103Smrg	 [AM_AUTOMAKE_VERSION([1.9.6])])
190100ae103Smrg
191100ae103Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
192100ae103Smrg
193100ae103Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
194100ae103Smrg#
195100ae103Smrg# This file is free software; the Free Software Foundation
196100ae103Smrg# gives unlimited permission to copy and/or distribute it,
197100ae103Smrg# with or without modifications, as long as this notice is preserved.
198100ae103Smrg
199100ae103Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
200100ae103Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
201100ae103Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
202100ae103Smrg#
203100ae103Smrg# Of course, Automake must honor this variable whenever it calls a
204100ae103Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
205100ae103Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
206100ae103Smrg# depending on how configure is run.  This is pretty annoying, since
207100ae103Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
208100ae103Smrg# source directory, any form will work fine, but in subdirectories a
209100ae103Smrg# relative path needs to be adjusted first.
210100ae103Smrg#
211100ae103Smrg# $ac_aux_dir/missing
212100ae103Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
213100ae103Smrg# $top_srcdir/$ac_aux_dir/missing
214100ae103Smrg#    fails if $ac_aux_dir is absolute,
215100ae103Smrg#    fails when called from a subdirectory in a VPATH build with
216100ae103Smrg#          a relative $ac_aux_dir
217100ae103Smrg#
218100ae103Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
219100ae103Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
220100ae103Smrg# harmless because $srcdir is `.', but things will broke when you
221100ae103Smrg# start a VPATH build or use an absolute $srcdir.
222100ae103Smrg#
223100ae103Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
224100ae103Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
225100ae103Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
226100ae103Smrg# and then we would define $MISSING as
227100ae103Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
228100ae103Smrg# This will work as long as MISSING is not called from configure, because
229100ae103Smrg# unfortunately $(top_srcdir) has no meaning in configure.
230100ae103Smrg# However there are other variables, like CC, which are often used in
231100ae103Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
232100ae103Smrg#
233100ae103Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
234100ae103Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
235100ae103Smrg# configured tree to be moved without reconfiguration.
236100ae103Smrg
237100ae103SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
238100ae103Smrg[dnl Rely on autoconf to set up CDPATH properly.
239100ae103SmrgAC_PREREQ([2.50])dnl
240100ae103Smrg# expand $ac_aux_dir to an absolute path
241100ae103Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
242100ae103Smrg])
243100ae103Smrg
244100ae103Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
245100ae103Smrg
246100ae103Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
247100ae103Smrg# Free Software Foundation, Inc.
248100ae103Smrg#
249100ae103Smrg# This file is free software; the Free Software Foundation
250100ae103Smrg# gives unlimited permission to copy and/or distribute it,
251100ae103Smrg# with or without modifications, as long as this notice is preserved.
252100ae103Smrg
253100ae103Smrg# serial 7
254100ae103Smrg
255100ae103Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
256100ae103Smrg# -------------------------------------
257100ae103Smrg# Define a conditional.
258100ae103SmrgAC_DEFUN([AM_CONDITIONAL],
259100ae103Smrg[AC_PREREQ(2.52)dnl
260100ae103Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
261100ae103Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
262100ae103SmrgAC_SUBST([$1_TRUE])
263100ae103SmrgAC_SUBST([$1_FALSE])
264100ae103Smrgif $2; then
265100ae103Smrg  $1_TRUE=
266100ae103Smrg  $1_FALSE='#'
267100ae103Smrgelse
268100ae103Smrg  $1_TRUE='#'
269100ae103Smrg  $1_FALSE=
270100ae103Smrgfi
271100ae103SmrgAC_CONFIG_COMMANDS_PRE(
272100ae103Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
273100ae103Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
274100ae103SmrgUsually this means the macro was only invoked conditionally.]])
275100ae103Smrgfi])])
276100ae103Smrg
277100ae103Smrg
278100ae103Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
279100ae103Smrg# Free Software Foundation, Inc.
280100ae103Smrg#
281100ae103Smrg# This file is free software; the Free Software Foundation
282100ae103Smrg# gives unlimited permission to copy and/or distribute it,
283100ae103Smrg# with or without modifications, as long as this notice is preserved.
284100ae103Smrg
285100ae103Smrg# serial 8
286100ae103Smrg
287100ae103Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
288100ae103Smrg# written in clear, in which case automake, when reading aclocal.m4,
289100ae103Smrg# will think it sees a *use*, and therefore will trigger all it's
290100ae103Smrg# C support machinery.  Also note that it means that autoscan, seeing
291100ae103Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
292100ae103Smrg
293100ae103Smrg
294100ae103Smrg# _AM_DEPENDENCIES(NAME)
295100ae103Smrg# ----------------------
296100ae103Smrg# See how the compiler implements dependency checking.
297100ae103Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
298100ae103Smrg# We try a few techniques and use that to set a single cache variable.
299100ae103Smrg#
300100ae103Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
301100ae103Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
302100ae103Smrg# dependency, and given that the user is not expected to run this macro,
303100ae103Smrg# just rely on AC_PROG_CC.
304100ae103SmrgAC_DEFUN([_AM_DEPENDENCIES],
305100ae103Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
306100ae103SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
307100ae103SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
308100ae103SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
309100ae103Smrg
310100ae103Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
311100ae103Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
312100ae103Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
313100ae103Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
314100ae103Smrg                   [depcc="$$1"   am_compiler_list=])
315100ae103Smrg
316100ae103SmrgAC_CACHE_CHECK([dependency style of $depcc],
317100ae103Smrg               [am_cv_$1_dependencies_compiler_type],
318100ae103Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
319100ae103Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
320100ae103Smrg  # making bogus files that we don't know about and never remove.  For
321100ae103Smrg  # instance it was reported that on HP-UX the gcc test will end up
322100ae103Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
323100ae103Smrg  # in D'.
324100ae103Smrg  mkdir conftest.dir
325100ae103Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
326100ae103Smrg  # using a relative directory.
327100ae103Smrg  cp "$am_depcomp" conftest.dir
328100ae103Smrg  cd conftest.dir
329100ae103Smrg  # We will build objects and dependencies in a subdirectory because
330100ae103Smrg  # it helps to detect inapplicable dependency modes.  For instance
331100ae103Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
332100ae103Smrg  # side effect of compilation, but ICC will put the dependencies in
333100ae103Smrg  # the current directory while Tru64 will put them in the object
334100ae103Smrg  # directory.
335100ae103Smrg  mkdir sub
336100ae103Smrg
337100ae103Smrg  am_cv_$1_dependencies_compiler_type=none
338100ae103Smrg  if test "$am_compiler_list" = ""; then
339100ae103Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
340100ae103Smrg  fi
341100ae103Smrg  for depmode in $am_compiler_list; do
342100ae103Smrg    # Setup a source with many dependencies, because some compilers
343100ae103Smrg    # like to wrap large dependency lists on column 80 (with \), and
344100ae103Smrg    # we should not choose a depcomp mode which is confused by this.
345100ae103Smrg    #
346100ae103Smrg    # We need to recreate these files for each test, as the compiler may
347100ae103Smrg    # overwrite some of them when testing with obscure command lines.
348100ae103Smrg    # This happens at least with the AIX C compiler.
349100ae103Smrg    : > sub/conftest.c
350100ae103Smrg    for i in 1 2 3 4 5 6; do
351100ae103Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
352100ae103Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
353100ae103Smrg      # Solaris 8's {/usr,}/bin/sh.
354100ae103Smrg      touch sub/conftst$i.h
355100ae103Smrg    done
356100ae103Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
357100ae103Smrg
358100ae103Smrg    case $depmode in
359100ae103Smrg    nosideeffect)
360100ae103Smrg      # after this tag, mechanisms are not by side-effect, so they'll
361100ae103Smrg      # only be used when explicitly requested
362100ae103Smrg      if test "x$enable_dependency_tracking" = xyes; then
363100ae103Smrg	continue
364100ae103Smrg      else
365100ae103Smrg	break
366100ae103Smrg      fi
367100ae103Smrg      ;;
368100ae103Smrg    none) break ;;
369100ae103Smrg    esac
370100ae103Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
371100ae103Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
372100ae103Smrg    # handle `-M -o', and we need to detect this.
373100ae103Smrg    if depmode=$depmode \
374100ae103Smrg       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
375100ae103Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
376100ae103Smrg       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
377100ae103Smrg         >/dev/null 2>conftest.err &&
378100ae103Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
379100ae103Smrg       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
380100ae103Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
381100ae103Smrg      # icc doesn't choke on unknown options, it will just issue warnings
382100ae103Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
383100ae103Smrg      # that says an option was ignored or not supported.
384100ae103Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
385100ae103Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
386100ae103Smrg      # The diagnosis changed in icc 8.0:
387100ae103Smrg      #   icc: Command line remark: option '-MP' not supported
388100ae103Smrg      if (grep 'ignoring option' conftest.err ||
389100ae103Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
390100ae103Smrg        am_cv_$1_dependencies_compiler_type=$depmode
391100ae103Smrg        break
392100ae103Smrg      fi
393100ae103Smrg    fi
394100ae103Smrg  done
395100ae103Smrg
396100ae103Smrg  cd ..
397100ae103Smrg  rm -rf conftest.dir
398100ae103Smrgelse
399100ae103Smrg  am_cv_$1_dependencies_compiler_type=none
400100ae103Smrgfi
401100ae103Smrg])
402100ae103SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
403100ae103SmrgAM_CONDITIONAL([am__fastdep$1], [
404100ae103Smrg  test "x$enable_dependency_tracking" != xno \
405100ae103Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
406100ae103Smrg])
407100ae103Smrg
408100ae103Smrg
409100ae103Smrg# AM_SET_DEPDIR
410100ae103Smrg# -------------
411100ae103Smrg# Choose a directory name for dependency files.
412100ae103Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
413100ae103SmrgAC_DEFUN([AM_SET_DEPDIR],
414100ae103Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
415100ae103SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
416100ae103Smrg])
417100ae103Smrg
418100ae103Smrg
419100ae103Smrg# AM_DEP_TRACK
420100ae103Smrg# ------------
421100ae103SmrgAC_DEFUN([AM_DEP_TRACK],
422100ae103Smrg[AC_ARG_ENABLE(dependency-tracking,
423100ae103Smrg[  --disable-dependency-tracking  speeds up one-time build
424100ae103Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
425100ae103Smrgif test "x$enable_dependency_tracking" != xno; then
426100ae103Smrg  am_depcomp="$ac_aux_dir/depcomp"
427100ae103Smrg  AMDEPBACKSLASH='\'
428100ae103Smrgfi
429100ae103SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
430100ae103SmrgAC_SUBST([AMDEPBACKSLASH])
431100ae103Smrg])
432100ae103Smrg
433100ae103Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
434100ae103Smrg
435100ae103Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
436100ae103Smrg# Free Software Foundation, Inc.
437100ae103Smrg#
438100ae103Smrg# This file is free software; the Free Software Foundation
439100ae103Smrg# gives unlimited permission to copy and/or distribute it,
440100ae103Smrg# with or without modifications, as long as this notice is preserved.
441100ae103Smrg
442100ae103Smrg#serial 3
443100ae103Smrg
444100ae103Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
445100ae103Smrg# ------------------------------
446100ae103SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
447100ae103Smrg[for mf in $CONFIG_FILES; do
448100ae103Smrg  # Strip MF so we end up with the name of the file.
449100ae103Smrg  mf=`echo "$mf" | sed -e 's/:.*$//'`
450100ae103Smrg  # Check whether this is an Automake generated Makefile or not.
451100ae103Smrg  # We used to match only the files named `Makefile.in', but
452100ae103Smrg  # some people rename them; so instead we look at the file content.
453100ae103Smrg  # Grep'ing the first line is not enough: some people post-process
454100ae103Smrg  # each Makefile.in and add a new line on top of each file to say so.
455100ae103Smrg  # So let's grep whole file.
456100ae103Smrg  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
457100ae103Smrg    dirpart=`AS_DIRNAME("$mf")`
458100ae103Smrg  else
459100ae103Smrg    continue
460100ae103Smrg  fi
461100ae103Smrg  # Extract the definition of DEPDIR, am__include, and am__quote
462100ae103Smrg  # from the Makefile without running `make'.
463100ae103Smrg  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
464100ae103Smrg  test -z "$DEPDIR" && continue
465100ae103Smrg  am__include=`sed -n 's/^am__include = //p' < "$mf"`
466100ae103Smrg  test -z "am__include" && continue
467100ae103Smrg  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
468100ae103Smrg  # When using ansi2knr, U may be empty or an underscore; expand it
469100ae103Smrg  U=`sed -n 's/^U = //p' < "$mf"`
470100ae103Smrg  # Find all dependency output files, they are included files with
471100ae103Smrg  # $(DEPDIR) in their names.  We invoke sed twice because it is the
472100ae103Smrg  # simplest approach to changing $(DEPDIR) to its actual value in the
473100ae103Smrg  # expansion.
474100ae103Smrg  for file in `sed -n "
475100ae103Smrg    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
476100ae103Smrg       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
477100ae103Smrg    # Make sure the directory exists.
478100ae103Smrg    test -f "$dirpart/$file" && continue
479100ae103Smrg    fdir=`AS_DIRNAME(["$file"])`
480100ae103Smrg    AS_MKDIR_P([$dirpart/$fdir])
481100ae103Smrg    # echo "creating $dirpart/$file"
482100ae103Smrg    echo '# dummy' > "$dirpart/$file"
483100ae103Smrg  done
484100ae103Smrgdone
485100ae103Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
486100ae103Smrg
487100ae103Smrg
488100ae103Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
489100ae103Smrg# -----------------------------
490100ae103Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
491100ae103Smrg#
492100ae103Smrg# This code is only required when automatic dependency tracking
493100ae103Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
494100ae103Smrg# need in order to bootstrap the dependency handling code.
495100ae103SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
496100ae103Smrg[AC_CONFIG_COMMANDS([depfiles],
497100ae103Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
498100ae103Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
499100ae103Smrg])
500100ae103Smrg
501100ae103Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
502100ae103Smrg# Free Software Foundation, Inc.
503100ae103Smrg#
504100ae103Smrg# This file is free software; the Free Software Foundation
505100ae103Smrg# gives unlimited permission to copy and/or distribute it,
506100ae103Smrg# with or without modifications, as long as this notice is preserved.
507100ae103Smrg
508100ae103Smrg# serial 8
509100ae103Smrg
510100ae103Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
511100ae103SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
512100ae103Smrg
513100ae103Smrg# Do all the work for Automake.                             -*- Autoconf -*-
514100ae103Smrg
515100ae103Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
516100ae103Smrg# Free Software Foundation, Inc.
517100ae103Smrg#
518100ae103Smrg# This file is free software; the Free Software Foundation
519100ae103Smrg# gives unlimited permission to copy and/or distribute it,
520100ae103Smrg# with or without modifications, as long as this notice is preserved.
521100ae103Smrg
522100ae103Smrg# serial 12
523100ae103Smrg
524100ae103Smrg# This macro actually does too much.  Some checks are only needed if
525100ae103Smrg# your package does certain things.  But this isn't really a big deal.
526100ae103Smrg
527100ae103Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
528100ae103Smrg# AM_INIT_AUTOMAKE([OPTIONS])
529100ae103Smrg# -----------------------------------------------
530100ae103Smrg# The call with PACKAGE and VERSION arguments is the old style
531100ae103Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
532100ae103Smrg# and VERSION should now be passed to AC_INIT and removed from
533100ae103Smrg# the call to AM_INIT_AUTOMAKE.
534100ae103Smrg# We support both call styles for the transition.  After
535100ae103Smrg# the next Automake release, Autoconf can make the AC_INIT
536100ae103Smrg# arguments mandatory, and then we can depend on a new Autoconf
537100ae103Smrg# release and drop the old call support.
538100ae103SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
539100ae103Smrg[AC_PREREQ([2.58])dnl
540100ae103Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
541100ae103Smrgdnl the ones we care about.
542100ae103Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
543100ae103SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
544100ae103SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
545100ae103Smrg# test to see if srcdir already configured
546100ae103Smrgif test "`cd $srcdir && pwd`" != "`pwd`" &&
547100ae103Smrg   test -f $srcdir/config.status; then
548100ae103Smrg  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
549100ae103Smrgfi
550100ae103Smrg
551100ae103Smrg# test whether we have cygpath
552100ae103Smrgif test -z "$CYGPATH_W"; then
553100ae103Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
554100ae103Smrg    CYGPATH_W='cygpath -w'
555100ae103Smrg  else
556100ae103Smrg    CYGPATH_W=echo
557100ae103Smrg  fi
558100ae103Smrgfi
559100ae103SmrgAC_SUBST([CYGPATH_W])
560100ae103Smrg
561100ae103Smrg# Define the identity of the package.
562100ae103Smrgdnl Distinguish between old-style and new-style calls.
563100ae103Smrgm4_ifval([$2],
564100ae103Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
565100ae103Smrg AC_SUBST([PACKAGE], [$1])dnl
566100ae103Smrg AC_SUBST([VERSION], [$2])],
567100ae103Smrg[_AM_SET_OPTIONS([$1])dnl
568100ae103Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
569100ae103Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
570100ae103Smrg
571100ae103Smrg_AM_IF_OPTION([no-define],,
572100ae103Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
573100ae103Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
574100ae103Smrg
575100ae103Smrg# Some tools Automake needs.
576100ae103SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
577100ae103SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
578100ae103SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
579100ae103SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
580100ae103SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
581100ae103SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
582100ae103SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
583100ae103SmrgAM_PROG_INSTALL_SH
584100ae103SmrgAM_PROG_INSTALL_STRIP
585100ae103SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
586100ae103Smrg# We need awk for the "check" target.  The system "awk" is bad on
587100ae103Smrg# some platforms.
588100ae103SmrgAC_REQUIRE([AC_PROG_AWK])dnl
589100ae103SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
590100ae103SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
591100ae103Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
592100ae103Smrg              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
593100ae103Smrg	      		     [_AM_PROG_TAR([v7])])])
594100ae103Smrg_AM_IF_OPTION([no-dependencies],,
595100ae103Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
596100ae103Smrg                  [_AM_DEPENDENCIES(CC)],
597100ae103Smrg                  [define([AC_PROG_CC],
598100ae103Smrg                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
599100ae103SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
600100ae103Smrg                  [_AM_DEPENDENCIES(CXX)],
601100ae103Smrg                  [define([AC_PROG_CXX],
602100ae103Smrg                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
603100ae103Smrg])
604100ae103Smrg])
605100ae103Smrg
606100ae103Smrg
607100ae103Smrg# When config.status generates a header, we must update the stamp-h file.
608100ae103Smrg# This file resides in the same directory as the config header
609100ae103Smrg# that is generated.  The stamp files are numbered to have different names.
610100ae103Smrg
611100ae103Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
612100ae103Smrg# loop where config.status creates the headers, so we can generate
613100ae103Smrg# our stamp files there.
614100ae103SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
615100ae103Smrg[# Compute $1's index in $config_headers.
616100ae103Smrg_am_stamp_count=1
617100ae103Smrgfor _am_header in $config_headers :; do
618100ae103Smrg  case $_am_header in
619100ae103Smrg    $1 | $1:* )
620100ae103Smrg      break ;;
621100ae103Smrg    * )
622100ae103Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
623100ae103Smrg  esac
624100ae103Smrgdone
625100ae103Smrgecho "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
626100ae103Smrg
627100ae103Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
628100ae103Smrg#
629100ae103Smrg# This file is free software; the Free Software Foundation
630100ae103Smrg# gives unlimited permission to copy and/or distribute it,
631100ae103Smrg# with or without modifications, as long as this notice is preserved.
632100ae103Smrg
633100ae103Smrg# AM_PROG_INSTALL_SH
634100ae103Smrg# ------------------
635100ae103Smrg# Define $install_sh.
636100ae103SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
637100ae103Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
638100ae103Smrginstall_sh=${install_sh-"$am_aux_dir/install-sh"}
639100ae103SmrgAC_SUBST(install_sh)])
640100ae103Smrg
641100ae103Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
642100ae103Smrg#
643100ae103Smrg# This file is free software; the Free Software Foundation
644100ae103Smrg# gives unlimited permission to copy and/or distribute it,
645100ae103Smrg# with or without modifications, as long as this notice is preserved.
646100ae103Smrg
647100ae103Smrg# serial 2
648100ae103Smrg
649100ae103Smrg# Check whether the underlying file-system supports filenames
650100ae103Smrg# with a leading dot.  For instance MS-DOS doesn't.
651100ae103SmrgAC_DEFUN([AM_SET_LEADING_DOT],
652100ae103Smrg[rm -rf .tst 2>/dev/null
653100ae103Smrgmkdir .tst 2>/dev/null
654100ae103Smrgif test -d .tst; then
655100ae103Smrg  am__leading_dot=.
656100ae103Smrgelse
657100ae103Smrg  am__leading_dot=_
658100ae103Smrgfi
659100ae103Smrgrmdir .tst 2>/dev/null
660100ae103SmrgAC_SUBST([am__leading_dot])])
661100ae103Smrg
662100ae103Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
663100ae103Smrg# From Jim Meyering
664100ae103Smrg
665100ae103Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
666100ae103Smrg# Free Software Foundation, Inc.
667100ae103Smrg#
668100ae103Smrg# This file is free software; the Free Software Foundation
669100ae103Smrg# gives unlimited permission to copy and/or distribute it,
670100ae103Smrg# with or without modifications, as long as this notice is preserved.
671100ae103Smrg
672100ae103Smrg# serial 4
673100ae103Smrg
674100ae103SmrgAC_DEFUN([AM_MAINTAINER_MODE],
675100ae103Smrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
676100ae103Smrg  dnl maintainer-mode is disabled by default
677100ae103Smrg  AC_ARG_ENABLE(maintainer-mode,
678100ae103Smrg[  --enable-maintainer-mode  enable make rules and dependencies not useful
679100ae103Smrg			  (and sometimes confusing) to the casual installer],
680100ae103Smrg      USE_MAINTAINER_MODE=$enableval,
681100ae103Smrg      USE_MAINTAINER_MODE=no)
682100ae103Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
683100ae103Smrg  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
684100ae103Smrg  MAINT=$MAINTAINER_MODE_TRUE
685100ae103Smrg  AC_SUBST(MAINT)dnl
686100ae103Smrg]
687100ae103Smrg)
688100ae103Smrg
689100ae103SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
690100ae103Smrg
691100ae103Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
692100ae103Smrg
693100ae103Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
694100ae103Smrg#
695100ae103Smrg# This file is free software; the Free Software Foundation
696100ae103Smrg# gives unlimited permission to copy and/or distribute it,
697100ae103Smrg# with or without modifications, as long as this notice is preserved.
698100ae103Smrg
699100ae103Smrg# serial 3
700100ae103Smrg
701100ae103Smrg# AM_MAKE_INCLUDE()
702100ae103Smrg# -----------------
703100ae103Smrg# Check to see how make treats includes.
704100ae103SmrgAC_DEFUN([AM_MAKE_INCLUDE],
705100ae103Smrg[am_make=${MAKE-make}
706100ae103Smrgcat > confinc << 'END'
707100ae103Smrgam__doit:
708100ae103Smrg	@echo done
709100ae103Smrg.PHONY: am__doit
710100ae103SmrgEND
711100ae103Smrg# If we don't find an include directive, just comment out the code.
712100ae103SmrgAC_MSG_CHECKING([for style of include used by $am_make])
713100ae103Smrgam__include="#"
714100ae103Smrgam__quote=
715100ae103Smrg_am_result=none
716100ae103Smrg# First try GNU make style include.
717100ae103Smrgecho "include confinc" > confmf
718100ae103Smrg# We grep out `Entering directory' and `Leaving directory'
719100ae103Smrg# messages which can occur if `w' ends up in MAKEFLAGS.
720100ae103Smrg# In particular we don't look at `^make:' because GNU make might
721100ae103Smrg# be invoked under some other name (usually "gmake"), in which
722100ae103Smrg# case it prints its new name instead of `make'.
723100ae103Smrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
724100ae103Smrg   am__include=include
725100ae103Smrg   am__quote=
726100ae103Smrg   _am_result=GNU
727100ae103Smrgfi
728100ae103Smrg# Now try BSD make style include.
729100ae103Smrgif test "$am__include" = "#"; then
730100ae103Smrg   echo '.include "confinc"' > confmf
731100ae103Smrg   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
732100ae103Smrg      am__include=.include
733100ae103Smrg      am__quote="\""
734100ae103Smrg      _am_result=BSD
735100ae103Smrg   fi
736100ae103Smrgfi
737100ae103SmrgAC_SUBST([am__include])
738100ae103SmrgAC_SUBST([am__quote])
739100ae103SmrgAC_MSG_RESULT([$_am_result])
740100ae103Smrgrm -f confinc confmf
741100ae103Smrg])
742100ae103Smrg
743100ae103Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
744100ae103Smrg
745100ae103Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
746100ae103Smrg# Free Software Foundation, Inc.
747100ae103Smrg#
748100ae103Smrg# This file is free software; the Free Software Foundation
749100ae103Smrg# gives unlimited permission to copy and/or distribute it,
750100ae103Smrg# with or without modifications, as long as this notice is preserved.
751100ae103Smrg
752100ae103Smrg# serial 4
753100ae103Smrg
754100ae103Smrg# AM_MISSING_PROG(NAME, PROGRAM)
755100ae103Smrg# ------------------------------
756100ae103SmrgAC_DEFUN([AM_MISSING_PROG],
757100ae103Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
758100ae103Smrg$1=${$1-"${am_missing_run}$2"}
759100ae103SmrgAC_SUBST($1)])
760100ae103Smrg
761100ae103Smrg
762100ae103Smrg# AM_MISSING_HAS_RUN
763100ae103Smrg# ------------------
764100ae103Smrg# Define MISSING if not defined so far and test if it supports --run.
765100ae103Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
766100ae103SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
767100ae103Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
768100ae103Smrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
769100ae103Smrg# Use eval to expand $SHELL
770100ae103Smrgif eval "$MISSING --run true"; then
771100ae103Smrg  am_missing_run="$MISSING --run "
772100ae103Smrgelse
773100ae103Smrg  am_missing_run=
774100ae103Smrg  AC_MSG_WARN([`missing' script is too old or missing])
775100ae103Smrgfi
776100ae103Smrg])
777100ae103Smrg
778100ae103Smrg# Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
779100ae103Smrg#
780100ae103Smrg# This file is free software; the Free Software Foundation
781100ae103Smrg# gives unlimited permission to copy and/or distribute it,
782100ae103Smrg# with or without modifications, as long as this notice is preserved.
783100ae103Smrg
784100ae103Smrg# AM_PROG_MKDIR_P
785100ae103Smrg# ---------------
786100ae103Smrg# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
787100ae103Smrg#
788100ae103Smrg# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
789100ae103Smrg# created by `make install' are always world readable, even if the
790100ae103Smrg# installer happens to have an overly restrictive umask (e.g. 077).
791100ae103Smrg# This was a mistake.  There are at least two reasons why we must not
792100ae103Smrg# use `-m 0755':
793100ae103Smrg#   - it causes special bits like SGID to be ignored,
794100ae103Smrg#   - it may be too restrictive (some setups expect 775 directories).
795100ae103Smrg#
796100ae103Smrg# Do not use -m 0755 and let people choose whatever they expect by
797100ae103Smrg# setting umask.
798100ae103Smrg#
799100ae103Smrg# We cannot accept any implementation of `mkdir' that recognizes `-p'.
800100ae103Smrg# Some implementations (such as Solaris 8's) are not thread-safe: if a
801100ae103Smrg# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
802100ae103Smrg# concurrently, both version can detect that a/ is missing, but only
803100ae103Smrg# one can create it and the other will error out.  Consequently we
804100ae103Smrg# restrict ourselves to GNU make (using the --version option ensures
805100ae103Smrg# this.)
806100ae103SmrgAC_DEFUN([AM_PROG_MKDIR_P],
807100ae103Smrg[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
808100ae103Smrg  # We used to keeping the `.' as first argument, in order to
809100ae103Smrg  # allow $(mkdir_p) to be used without argument.  As in
810100ae103Smrg  #   $(mkdir_p) $(somedir)
811100ae103Smrg  # where $(somedir) is conditionally defined.  However this is wrong
812100ae103Smrg  # for two reasons:
813100ae103Smrg  #  1. if the package is installed by a user who cannot write `.'
814100ae103Smrg  #     make install will fail,
815100ae103Smrg  #  2. the above comment should most certainly read
816100ae103Smrg  #     $(mkdir_p) $(DESTDIR)$(somedir)
817100ae103Smrg  #     so it does not work when $(somedir) is undefined and
818100ae103Smrg  #     $(DESTDIR) is not.
819100ae103Smrg  #  To support the latter case, we have to write
820100ae103Smrg  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
821100ae103Smrg  #  so the `.' trick is pointless.
822100ae103Smrg  mkdir_p='mkdir -p --'
823100ae103Smrgelse
824100ae103Smrg  # On NextStep and OpenStep, the `mkdir' command does not
825100ae103Smrg  # recognize any option.  It will interpret all options as
826100ae103Smrg  # directories to create, and then abort because `.' already
827100ae103Smrg  # exists.
828100ae103Smrg  for d in ./-p ./--version;
829100ae103Smrg  do
830100ae103Smrg    test -d $d && rmdir $d
831100ae103Smrg  done
832100ae103Smrg  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
833100ae103Smrg  if test -f "$ac_aux_dir/mkinstalldirs"; then
834100ae103Smrg    mkdir_p='$(mkinstalldirs)'
835100ae103Smrg  else
836100ae103Smrg    mkdir_p='$(SHELL) $(install_sh) -d'
837100ae103Smrg  fi
838100ae103Smrgfi
839100ae103SmrgAC_SUBST([mkdir_p])])
840100ae103Smrg
841100ae103Smrg# Helper functions for option handling.                     -*- Autoconf -*-
842100ae103Smrg
843100ae103Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
844100ae103Smrg#
845100ae103Smrg# This file is free software; the Free Software Foundation
846100ae103Smrg# gives unlimited permission to copy and/or distribute it,
847100ae103Smrg# with or without modifications, as long as this notice is preserved.
848100ae103Smrg
849100ae103Smrg# serial 3
850100ae103Smrg
851100ae103Smrg# _AM_MANGLE_OPTION(NAME)
852100ae103Smrg# -----------------------
853100ae103SmrgAC_DEFUN([_AM_MANGLE_OPTION],
854100ae103Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
855100ae103Smrg
856100ae103Smrg# _AM_SET_OPTION(NAME)
857100ae103Smrg# ------------------------------
858100ae103Smrg# Set option NAME.  Presently that only means defining a flag for this option.
859100ae103SmrgAC_DEFUN([_AM_SET_OPTION],
860100ae103Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
861100ae103Smrg
862100ae103Smrg# _AM_SET_OPTIONS(OPTIONS)
863100ae103Smrg# ----------------------------------
864100ae103Smrg# OPTIONS is a space-separated list of Automake options.
865100ae103SmrgAC_DEFUN([_AM_SET_OPTIONS],
866100ae103Smrg[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
867100ae103Smrg
868100ae103Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
869100ae103Smrg# -------------------------------------------
870100ae103Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
871100ae103SmrgAC_DEFUN([_AM_IF_OPTION],
872100ae103Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
873100ae103Smrg
874100ae103Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
875100ae103Smrg
876100ae103Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
877100ae103Smrg# Free Software Foundation, Inc.
878100ae103Smrg#
879100ae103Smrg# This file is free software; the Free Software Foundation
880100ae103Smrg# gives unlimited permission to copy and/or distribute it,
881100ae103Smrg# with or without modifications, as long as this notice is preserved.
882100ae103Smrg
883100ae103Smrg# serial 4
884100ae103Smrg
885100ae103Smrg# AM_SANITY_CHECK
886100ae103Smrg# ---------------
887100ae103SmrgAC_DEFUN([AM_SANITY_CHECK],
888100ae103Smrg[AC_MSG_CHECKING([whether build environment is sane])
889100ae103Smrg# Just in case
890100ae103Smrgsleep 1
891100ae103Smrgecho timestamp > conftest.file
892100ae103Smrg# Do `set' in a subshell so we don't clobber the current shell's
893100ae103Smrg# arguments.  Must try -L first in case configure is actually a
894100ae103Smrg# symlink; some systems play weird games with the mod time of symlinks
895100ae103Smrg# (eg FreeBSD returns the mod time of the symlink's containing
896100ae103Smrg# directory).
897100ae103Smrgif (
898100ae103Smrg   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
899100ae103Smrg   if test "$[*]" = "X"; then
900100ae103Smrg      # -L didn't work.
901100ae103Smrg      set X `ls -t $srcdir/configure conftest.file`
902100ae103Smrg   fi
903100ae103Smrg   rm -f conftest.file
904100ae103Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
905100ae103Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
906100ae103Smrg
907100ae103Smrg      # If neither matched, then we have a broken ls.  This can happen
908100ae103Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
909100ae103Smrg      # broken ls alias from the environment.  This has actually
910100ae103Smrg      # happened.  Such a system could not be considered "sane".
911100ae103Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
912100ae103Smrgalias in your environment])
913100ae103Smrg   fi
914100ae103Smrg
915100ae103Smrg   test "$[2]" = conftest.file
916100ae103Smrg   )
917100ae103Smrgthen
918100ae103Smrg   # Ok.
919100ae103Smrg   :
920100ae103Smrgelse
921100ae103Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
922100ae103SmrgCheck your system clock])
923100ae103Smrgfi
924100ae103SmrgAC_MSG_RESULT(yes)])
925100ae103Smrg
926100ae103Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
927100ae103Smrg#
928100ae103Smrg# This file is free software; the Free Software Foundation
929100ae103Smrg# gives unlimited permission to copy and/or distribute it,
930100ae103Smrg# with or without modifications, as long as this notice is preserved.
931100ae103Smrg
932100ae103Smrg# AM_PROG_INSTALL_STRIP
933100ae103Smrg# ---------------------
934100ae103Smrg# One issue with vendor `install' (even GNU) is that you can't
935100ae103Smrg# specify the program used to strip binaries.  This is especially
936100ae103Smrg# annoying in cross-compiling environments, where the build's strip
937100ae103Smrg# is unlikely to handle the host's binaries.
938100ae103Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
939100ae103Smrg# always use install-sh in `make install-strip', and initialize
940100ae103Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
941100ae103SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
942100ae103Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
943100ae103Smrg# Installed binaries are usually stripped using `strip' when the user
944100ae103Smrg# run `make install-strip'.  However `strip' might not be the right
945100ae103Smrg# tool to use in cross-compilation environments, therefore Automake
946100ae103Smrg# will honor the `STRIP' environment variable to overrule this program.
947100ae103Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
948100ae103Smrgif test "$cross_compiling" != no; then
949100ae103Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
950100ae103Smrgfi
951100ae103SmrgINSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
952100ae103SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
953100ae103Smrg
954100ae103Smrg# Check how to create a tarball.                            -*- Autoconf -*-
955100ae103Smrg
956100ae103Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
957100ae103Smrg#
958100ae103Smrg# This file is free software; the Free Software Foundation
959100ae103Smrg# gives unlimited permission to copy and/or distribute it,
960100ae103Smrg# with or without modifications, as long as this notice is preserved.
961100ae103Smrg
962100ae103Smrg# serial 2
963100ae103Smrg
964100ae103Smrg# _AM_PROG_TAR(FORMAT)
965100ae103Smrg# --------------------
966100ae103Smrg# Check how to create a tarball in format FORMAT.
967100ae103Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
968100ae103Smrg#
969100ae103Smrg# Substitute a variable $(am__tar) that is a command
970100ae103Smrg# writing to stdout a FORMAT-tarball containing the directory
971100ae103Smrg# $tardir.
972100ae103Smrg#     tardir=directory && $(am__tar) > result.tar
973100ae103Smrg#
974100ae103Smrg# Substitute a variable $(am__untar) that extract such
975100ae103Smrg# a tarball read from stdin.
976100ae103Smrg#     $(am__untar) < result.tar
977100ae103SmrgAC_DEFUN([_AM_PROG_TAR],
978100ae103Smrg[# Always define AMTAR for backward compatibility.
979100ae103SmrgAM_MISSING_PROG([AMTAR], [tar])
980100ae103Smrgm4_if([$1], [v7],
981100ae103Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
982100ae103Smrg     [m4_case([$1], [ustar],, [pax],,
983100ae103Smrg              [m4_fatal([Unknown tar format])])
984100ae103SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
985100ae103Smrg# Loop over all known methods to create a tar archive until one works.
986100ae103Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
987100ae103Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
988100ae103Smrg# Do not fold the above two line into one, because Tru64 sh and
989100ae103Smrg# Solaris sh will not grok spaces in the rhs of `-'.
990100ae103Smrgfor _am_tool in $_am_tools
991100ae103Smrgdo
992100ae103Smrg  case $_am_tool in
993100ae103Smrg  gnutar)
994100ae103Smrg    for _am_tar in tar gnutar gtar;
995100ae103Smrg    do
996100ae103Smrg      AM_RUN_LOG([$_am_tar --version]) && break
997100ae103Smrg    done
998100ae103Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
999100ae103Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1000100ae103Smrg    am__untar="$_am_tar -xf -"
1001100ae103Smrg    ;;
1002100ae103Smrg  plaintar)
1003100ae103Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
1004100ae103Smrg    # ustar tarball either.
1005100ae103Smrg    (tar --version) >/dev/null 2>&1 && continue
1006100ae103Smrg    am__tar='tar chf - "$$tardir"'
1007100ae103Smrg    am__tar_='tar chf - "$tardir"'
1008100ae103Smrg    am__untar='tar xf -'
1009100ae103Smrg    ;;
1010100ae103Smrg  pax)
1011100ae103Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
1012100ae103Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
1013100ae103Smrg    am__untar='pax -r'
1014100ae103Smrg    ;;
1015100ae103Smrg  cpio)
1016100ae103Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1017100ae103Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1018100ae103Smrg    am__untar='cpio -i -H $1 -d'
1019100ae103Smrg    ;;
1020100ae103Smrg  none)
1021100ae103Smrg    am__tar=false
1022100ae103Smrg    am__tar_=false
1023100ae103Smrg    am__untar=false
1024100ae103Smrg    ;;
1025100ae103Smrg  esac
1026100ae103Smrg
1027100ae103Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
1028100ae103Smrg  # and am__untar set.
1029100ae103Smrg  test -n "${am_cv_prog_tar_$1}" && break
1030100ae103Smrg
1031100ae103Smrg  # tar/untar a dummy directory, and stop if the command works
1032100ae103Smrg  rm -rf conftest.dir
1033100ae103Smrg  mkdir conftest.dir
1034100ae103Smrg  echo GrepMe > conftest.dir/file
1035100ae103Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1036100ae103Smrg  rm -rf conftest.dir
1037100ae103Smrg  if test -s conftest.tar; then
1038100ae103Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
1039100ae103Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1040100ae103Smrg  fi
1041100ae103Smrgdone
1042100ae103Smrgrm -rf conftest.dir
1043100ae103Smrg
1044100ae103SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1045100ae103SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
1046100ae103SmrgAC_SUBST([am__tar])
1047100ae103SmrgAC_SUBST([am__untar])
1048100ae103Smrg]) # _AM_PROG_TAR
1049100ae103Smrg
1050100ae103Smrgdnl Copyright 2005 Red Hat, Inc
1051100ae103Smrgdnl 
1052100ae103Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1053100ae103Smrgdnl documentation for any purpose is hereby granted without fee, provided that
1054100ae103Smrgdnl the above copyright notice appear in all copies and that both that
1055100ae103Smrgdnl copyright notice and this permission notice appear in supporting
1056100ae103Smrgdnl documentation.
1057100ae103Smrgdnl 
1058100ae103Smrgdnl The above copyright notice and this permission notice shall be included
1059100ae103Smrgdnl in all copies or substantial portions of the Software.
1060100ae103Smrgdnl 
1061100ae103Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1062100ae103Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1063100ae103Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1064100ae103Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1065100ae103Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1066100ae103Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1067100ae103Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
1068100ae103Smrgdnl 
1069100ae103Smrgdnl Except as contained in this notice, the name of the copyright holders shall
1070100ae103Smrgdnl not be used in advertising or otherwise to promote the sale, use or
1071100ae103Smrgdnl other dealings in this Software without prior written authorization
1072100ae103Smrgdnl from the copyright holders.
1073100ae103Smrgdnl 
1074100ae103Smrg
1075100ae103Smrg# XAW_CHECK_XPRINT_SUPPORT()
1076100ae103Smrg# --------------------------
1077100ae103Smrg# Adds --enable/disable-xprint and selects the appropriate version of the Xaw 
1078100ae103Smrg# library. If neither --enable-xprint nor --disable-xprint are given, 
1079100ae103Smrg# the presence of an Xaw with Xprint support will be auto detected
1080100ae103Smrg
1081100ae103SmrgAC_DEFUN([XAW_CHECK_XPRINT_SUPPORT],[
1082100ae103Smrg	AC_ARG_ENABLE(xprint, AC_HELP_STRING([--enable-xprint], [Enable XPrint support]),
1083100ae103Smrg			[use_xprint=$enableval],[use_xprint=auto])
1084100ae103Smrg	if test "x$use_xprint" = "xyes"; then
1085100ae103Smrg		TMP_CHECK1=xaw8
1086100ae103Smrg		TMP_CHECK2=
1087100ae103Smrg		xaw_use_xprint=yes
1088100ae103Smrg	elif test "x$use_xprint" = "xno"; then
1089100ae103Smrg		TMP_CHECK1=xaw7
1090100ae103Smrg		TMP_CHECK2=
1091100ae103Smrg		xaw_use_xprint=no
1092100ae103Smrg	else
1093100ae103Smrg		TMP_CHECK1=xaw8
1094100ae103Smrg		TMP_CHECK2=xaw7
1095100ae103Smrg		xaw_use_xprint=yes
1096100ae103Smrg	fi
1097100ae103Smrg
1098100ae103Smrg	PKG_CHECK_MODULES(TMP_XAW, $TMP_CHECK1, success=yes, success=no)
1099100ae103Smrg	if [[ ! -z $TMP_CHECK2 ]] ; then
1100100ae103Smrg		if test $success = no ; then
1101100ae103Smrg			PKG_CHECK_MODULES(TMP_XAW, $TMP_CHECK2, success=yes, success=no)
1102100ae103Smrg			xaw_use_xprint=no
1103100ae103Smrg		fi
1104100ae103Smrg	fi
1105100ae103Smrg
1106100ae103Smrg	if test "x$success" = "xyes"; then
1107100ae103Smrg		$1_CFLAGS=$TMP_XAW_CFLAGS
1108100ae103Smrg		$1_LIBS=$TMP_XAW_LIBS
1109100ae103Smrg
1110100ae103Smrg		AM_CONDITIONAL([XAW_USE_XPRINT], [test "x$xaw_use_xprint" = "xyes"])
1111100ae103Smrg	else
1112100ae103Smrg		AC_MSG_ERROR([No suitable version of Xaw found])
1113100ae103Smrg	fi
1114100ae103Smrg])
1115100ae103Smrg
1116100ae103Smrgdnl
1117100ae103Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
1118100ae103Smrgdnl 
1119100ae103Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
1120100ae103Smrgdnl copy of this software and associated documentation files (the
1121100ae103Smrgdnl "Software"), to deal in the Software without restriction, including
1122100ae103Smrgdnl without limitation the rights to use, copy, modify, merge, publish,
1123100ae103Smrgdnl distribute, and/or sell copies of the Software, and to permit persons
1124100ae103Smrgdnl to whom the Software is furnished to do so, provided that the above
1125100ae103Smrgdnl copyright notice(s) and this permission notice appear in all copies of
1126100ae103Smrgdnl the Software and that both the above copyright notice(s) and this
1127100ae103Smrgdnl permission notice appear in supporting documentation.
1128100ae103Smrgdnl
1129100ae103Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1130100ae103Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1131100ae103Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
1132100ae103Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
1133100ae103Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
1134100ae103Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
1135100ae103Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
1136100ae103Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
1137100ae103Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1138100ae103Smrgdnl
1139100ae103Smrgdnl Except as contained in this notice, the name of a copyright holder
1140100ae103Smrgdnl shall not be used in advertising or otherwise to promote the sale, use
1141100ae103Smrgdnl or other dealings in this Software without prior written authorization
1142100ae103Smrgdnl of the copyright holder.
1143100ae103Smrg
1144100ae103Smrg# XORG_MACROS_VERSION(required-version)
1145100ae103Smrg# -------------------------------------
1146100ae103Smrg# Minimum version: 1.1.0
1147100ae103Smrg#
1148100ae103Smrg# If you're using a macro added in Version 1.1 or newer, include this in
1149100ae103Smrg# your configure.ac with the minimum required version, such as:
1150100ae103Smrg# XORG_MACROS_VERSION(1.1)
1151100ae103Smrg#
1152100ae103Smrg# To force at least a version with this macro defined, also add:
1153100ae103Smrg# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
1154100ae103Smrg#
1155100ae103Smrg#
1156100ae103Smrg# See the "minimum version" comment for each macro you use to see what 
1157100ae103Smrg# version you require.
1158100ae103SmrgAC_DEFUN([XORG_MACROS_VERSION],[
1159100ae103Smrg	[XORG_MACROS_needed_version=$1
1160100ae103Smrg	XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
1161100ae103Smrg	XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
1162100ae103Smrg	AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
1163100ae103Smrg	[XORG_MACROS_version=1.1.5
1164100ae103Smrg	XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
1165100ae103Smrg	XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
1166100ae103Smrg	if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
1167100ae103Smrg		AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x])
1168100ae103Smrg	fi
1169100ae103Smrg	if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
1170100ae103Smrg		AC_MSG_ERROR([configure built with too old of a version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.${XORG_MACROS_minor}.0 or newer])
1171100ae103Smrg	fi
1172100ae103Smrg	AC_MSG_RESULT([yes, $XORG_MACROS_version])
1173100ae103Smrg]) # XORG_MACROS_VERSION
1174100ae103Smrg
1175100ae103Smrg# XORG_PROG_RAWCPP()
1176100ae103Smrg# ------------------
1177100ae103Smrg# Minimum version: 1.0.0
1178100ae103Smrg#
1179100ae103Smrg# Find cpp program and necessary flags for use in pre-processing text files
1180100ae103Smrg# such as man pages and config files
1181100ae103SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
1182100ae103SmrgAC_REQUIRE([AC_PROG_CPP])
1183100ae103SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
1184100ae103Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1185100ae103Smrg
1186100ae103Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
1187100ae103Smrg# which is not the best choice for supporting other OS'es, but covers most
1188100ae103Smrg# of the ones we need for now.
1189100ae103SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
1190100ae103SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
1191100ae103Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1192100ae103Smrg	AC_MSG_RESULT([no])
1193100ae103Smrgelse
1194100ae103Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1195100ae103Smrg		RAWCPPFLAGS=-undef
1196100ae103Smrg		AC_MSG_RESULT([yes])
1197100ae103Smrg	else
1198100ae103Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1199100ae103Smrg	fi
1200100ae103Smrgfi
1201100ae103Smrgrm -f conftest.$ac_ext
1202100ae103Smrg
1203100ae103SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
1204100ae103SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
1205100ae103Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1206100ae103Smrg	AC_MSG_RESULT([no])
1207100ae103Smrgelse
1208100ae103Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1209100ae103Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1210100ae103Smrg		AC_MSG_RESULT([yes])
1211100ae103Smrg	else
1212100ae103Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1213100ae103Smrg	fi
1214100ae103Smrgfi
1215100ae103Smrgrm -f conftest.$ac_ext
1216100ae103SmrgAC_SUBST(RAWCPPFLAGS)
1217100ae103Smrg]) # XORG_PROG_RAWCPP
1218100ae103Smrg
1219100ae103Smrg# XORG_MANPAGE_SECTIONS()
1220100ae103Smrg# -----------------------
1221100ae103Smrg# Minimum version: 1.0.0
1222100ae103Smrg#
1223100ae103Smrg# Determine which sections man pages go in for the different man page types
1224100ae103Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1225100ae103Smrg# Not sure if there's any better way than just hardcoding by OS name.
1226100ae103Smrg# Override default settings by setting environment variables
1227100ae103Smrg
1228100ae103SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1229100ae103SmrgAC_REQUIRE([AC_CANONICAL_HOST])
1230100ae103Smrg
1231100ae103Smrgif test x$APP_MAN_SUFFIX = x    ; then
1232100ae103Smrg    APP_MAN_SUFFIX=1
1233100ae103Smrgfi
1234100ae103Smrgif test x$APP_MAN_DIR = x    ; then
1235100ae103Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1236100ae103Smrgfi
1237100ae103Smrg
1238100ae103Smrgif test x$LIB_MAN_SUFFIX = x    ; then
1239100ae103Smrg    LIB_MAN_SUFFIX=3
1240100ae103Smrgfi
1241100ae103Smrgif test x$LIB_MAN_DIR = x    ; then
1242100ae103Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1243100ae103Smrgfi
1244100ae103Smrg
1245100ae103Smrgif test x$FILE_MAN_SUFFIX = x    ; then
1246100ae103Smrg    case $host_os in
1247100ae103Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
1248100ae103Smrg	*)		FILE_MAN_SUFFIX=5  ;;
1249100ae103Smrg    esac
1250100ae103Smrgfi
1251100ae103Smrgif test x$FILE_MAN_DIR = x    ; then
1252100ae103Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1253100ae103Smrgfi
1254100ae103Smrg
1255100ae103Smrgif test x$MISC_MAN_SUFFIX = x    ; then
1256100ae103Smrg    case $host_os in
1257100ae103Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
1258100ae103Smrg	*)		MISC_MAN_SUFFIX=7  ;;
1259100ae103Smrg    esac
1260100ae103Smrgfi
1261100ae103Smrgif test x$MISC_MAN_DIR = x    ; then
1262100ae103Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1263100ae103Smrgfi
1264100ae103Smrg
1265100ae103Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
1266100ae103Smrg    case $host_os in
1267100ae103Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
1268100ae103Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
1269100ae103Smrg    esac
1270100ae103Smrgfi
1271100ae103Smrgif test x$DRIVER_MAN_DIR = x    ; then
1272100ae103Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1273100ae103Smrgfi
1274100ae103Smrg
1275100ae103Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
1276100ae103Smrg    case $host_os in
1277100ae103Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
1278100ae103Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
1279100ae103Smrg    esac
1280100ae103Smrgfi
1281100ae103Smrgif test x$ADMIN_MAN_DIR = x    ; then
1282100ae103Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1283100ae103Smrgfi
1284100ae103Smrg
1285100ae103Smrg
1286100ae103SmrgAC_SUBST([APP_MAN_SUFFIX])
1287100ae103SmrgAC_SUBST([LIB_MAN_SUFFIX])
1288100ae103SmrgAC_SUBST([FILE_MAN_SUFFIX])
1289100ae103SmrgAC_SUBST([MISC_MAN_SUFFIX])
1290100ae103SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
1291100ae103SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
1292100ae103SmrgAC_SUBST([APP_MAN_DIR])
1293100ae103SmrgAC_SUBST([LIB_MAN_DIR])
1294100ae103SmrgAC_SUBST([FILE_MAN_DIR])
1295100ae103SmrgAC_SUBST([MISC_MAN_DIR])
1296100ae103SmrgAC_SUBST([DRIVER_MAN_DIR])
1297100ae103SmrgAC_SUBST([ADMIN_MAN_DIR])
1298100ae103Smrg]) # XORG_MANPAGE_SECTIONS
1299100ae103Smrg
1300100ae103Smrg# XORG_CHECK_LINUXDOC
1301100ae103Smrg# -------------------
1302100ae103Smrg# Minimum version: 1.0.0
1303100ae103Smrg#
1304100ae103Smrg# Defines the variable MAKE_TEXT if the necessary tools and
1305100ae103Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1306100ae103Smrg# Whether or not the necessary tools and files are found can be checked
1307100ae103Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1308100ae103SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
1309100ae103SmrgXORG_SGML_PATH=$prefix/share/sgml
1310100ae103SmrgHAVE_DEFS_ENT=
1311100ae103Smrg
1312100ae103SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1313100ae103Smrg
1314100ae103SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
1315100ae103SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
1316100ae103Smrg
1317100ae103SmrgAC_MSG_CHECKING([Whether to build documentation])
1318100ae103Smrg
1319100ae103Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
1320100ae103Smrg   BUILDDOC=yes
1321100ae103Smrgelse
1322100ae103Smrg   BUILDDOC=no
1323100ae103Smrgfi
1324100ae103Smrg
1325100ae103SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1326100ae103Smrg
1327100ae103SmrgAC_MSG_RESULT([$BUILDDOC])
1328100ae103Smrg
1329100ae103SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
1330100ae103Smrg
1331100ae103Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
1332100ae103Smrg   BUILDPDFDOC=yes
1333100ae103Smrgelse
1334100ae103Smrg   BUILDPDFDOC=no
1335100ae103Smrgfi
1336100ae103Smrg
1337100ae103SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1338100ae103Smrg
1339100ae103SmrgAC_MSG_RESULT([$BUILDPDFDOC])
1340100ae103Smrg
1341100ae103SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
1342100ae103SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1343100ae103SmrgMAKE_PDF="$PS2PDF"
1344100ae103SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1345100ae103Smrg
1346100ae103SmrgAC_SUBST(MAKE_TEXT)
1347100ae103SmrgAC_SUBST(MAKE_PS)
1348100ae103SmrgAC_SUBST(MAKE_PDF)
1349100ae103SmrgAC_SUBST(MAKE_HTML)
1350100ae103Smrg]) # XORG_CHECK_LINUXDOC
1351100ae103Smrg
1352100ae103Smrg# XORG_CHECK_DOCBOOK
1353100ae103Smrg# -------------------
1354100ae103Smrg# Minimum version: 1.0.0
1355100ae103Smrg#
1356100ae103Smrg# Checks for the ability to build output formats from SGML DocBook source.
1357100ae103Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1358100ae103Smrg# indicates whether the necessary tools and files are found and, if set,
1359100ae103Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1360100ae103SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
1361100ae103SmrgXORG_SGML_PATH=$prefix/share/sgml
1362100ae103SmrgHAVE_DEFS_ENT=
1363100ae103SmrgBUILDTXTDOC=no
1364100ae103SmrgBUILDPDFDOC=no
1365100ae103SmrgBUILDPSDOC=no
1366100ae103SmrgBUILDHTMLDOC=no
1367100ae103Smrg
1368100ae103SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1369100ae103Smrg
1370100ae103SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
1371100ae103SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1372100ae103SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
1373100ae103SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1374100ae103Smrg
1375100ae103SmrgAC_MSG_CHECKING([Whether to build text documentation])
1376100ae103Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
1377100ae103Smrg   test x$BUILD_TXTDOC != xno; then
1378100ae103Smrg	BUILDTXTDOC=yes
1379100ae103Smrgfi
1380100ae103SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1381100ae103SmrgAC_MSG_RESULT([$BUILDTXTDOC])
1382100ae103Smrg
1383100ae103SmrgAC_MSG_CHECKING([Whether to build PDF documentation])
1384100ae103Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
1385100ae103Smrg   test x$BUILD_PDFDOC != xno; then
1386100ae103Smrg	BUILDPDFDOC=yes
1387100ae103Smrgfi
1388100ae103SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1389100ae103SmrgAC_MSG_RESULT([$BUILDPDFDOC])
1390100ae103Smrg
1391100ae103SmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
1392100ae103Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
1393100ae103Smrg   test x$BUILD_PSDOC != xno; then
1394100ae103Smrg	BUILDPSDOC=yes
1395100ae103Smrgfi
1396100ae103SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1397100ae103SmrgAC_MSG_RESULT([$BUILDPSDOC])
1398100ae103Smrg
1399100ae103SmrgAC_MSG_CHECKING([Whether to build HTML documentation])
1400100ae103Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
1401100ae103Smrg   test x$BUILD_HTMLDOC != xno; then
1402100ae103Smrg	BUILDHTMLDOC=yes
1403100ae103Smrgfi
1404100ae103SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1405100ae103SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
1406100ae103Smrg
1407100ae103SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1408100ae103SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1409100ae103SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1410100ae103SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1411100ae103Smrg
1412100ae103SmrgAC_SUBST(MAKE_TEXT)
1413100ae103SmrgAC_SUBST(MAKE_PS)
1414100ae103SmrgAC_SUBST(MAKE_PDF)
1415100ae103SmrgAC_SUBST(MAKE_HTML)
1416100ae103Smrg]) # XORG_CHECK_DOCBOOK
1417100ae103Smrg
1418100ae103Smrg# XORG_CHECK_MALLOC_ZERO
1419100ae103Smrg# ----------------------
1420100ae103Smrg# Minimum version: 1.0.0
1421100ae103Smrg#
1422100ae103Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1423100ae103Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1424100ae103Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1425100ae103SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1426100ae103SmrgAC_ARG_ENABLE(malloc0returnsnull,
1427100ae103Smrg	AC_HELP_STRING([--enable-malloc0returnsnull],
1428100ae103Smrg		       [malloc(0) returns NULL (default: auto)]),
1429100ae103Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1430100ae103Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1431100ae103Smrg
1432100ae103SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1433100ae103Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1434100ae103Smrg	AC_RUN_IFELSE([
1435100ae103Smrgchar *malloc();
1436100ae103Smrgchar *realloc();
1437100ae103Smrgchar *calloc();
1438100ae103Smrgmain() {
1439100ae103Smrg    char *m0, *r0, *c0, *p;
1440100ae103Smrg    m0 = malloc(0);
1441100ae103Smrg    p = malloc(10);
1442100ae103Smrg    r0 = realloc(p,0);
1443100ae103Smrg    c0 = calloc(0);
1444100ae103Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
1445100ae103Smrg}],
1446100ae103Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
1447100ae103Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
1448100ae103Smrgfi
1449100ae103SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1450100ae103Smrg
1451100ae103Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1452100ae103Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1453100ae103Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1454100ae103Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1455100ae103Smrgelse
1456100ae103Smrg	MALLOC_ZERO_CFLAGS=""
1457100ae103Smrg	XMALLOC_ZERO_CFLAGS=""
1458100ae103Smrg	XTMALLOC_ZERO_CFLAGS=""
1459100ae103Smrgfi
1460100ae103Smrg
1461100ae103SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1462100ae103SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1463100ae103SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1464100ae103Smrg]) # XORG_CHECK_MALLOC_ZERO
1465100ae103Smrg
1466100ae103Smrg# XORG_WITH_LINT()
1467100ae103Smrg# ----------------
1468100ae103Smrg# Minimum version: 1.1.0
1469100ae103Smrg#
1470100ae103Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint
1471100ae103Smrg# is specified.   (Use --with-lint=sparse for sparse.)
1472100ae103Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
1473100ae103Smrg# Sets $LINT_FLAGS to flags to pass to source checker
1474100ae103Smrg# Sets LINT automake conditional if enabled (default: disabled)
1475100ae103Smrg#
1476100ae103SmrgAC_DEFUN([XORG_WITH_LINT],[
1477100ae103Smrg
1478100ae103Smrg# Allow checking code with lint, sparse, etc.
1479100ae103SmrgAC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
1480100ae103Smrg		[Use a lint-style source code checker (default: disabled)])],
1481100ae103Smrg		[use_lint=$withval], [use_lint=no])
1482100ae103Smrgif test "x$use_lint" = "xyes" ; then
1483100ae103Smrg	LINT="lint"
1484100ae103Smrgelse
1485100ae103Smrg	LINT="$use_lint"
1486100ae103Smrgfi
1487100ae103Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
1488100ae103Smrg    case $LINT in
1489100ae103Smrg	lint|*/lint)
1490100ae103Smrg	    case $host_os in
1491100ae103Smrg		solaris*)
1492100ae103Smrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1493100ae103Smrg			;;
1494100ae103Smrg	    esac
1495100ae103Smrg	    ;;
1496100ae103Smrg    esac
1497100ae103Smrgfi
1498100ae103Smrg
1499100ae103SmrgAC_SUBST(LINT)
1500100ae103SmrgAC_SUBST(LINT_FLAGS)
1501100ae103SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
1502100ae103Smrg
1503100ae103Smrg]) # XORG_WITH_LINT
1504100ae103Smrg
1505100ae103Smrg# XORG_LINT_LIBRARY(LIBNAME)
1506100ae103Smrg# --------------------------
1507100ae103Smrg# Minimum version: 1.1.0
1508100ae103Smrg#
1509100ae103Smrg# Sets up flags for building lint libraries for checking programs that call
1510100ae103Smrg# functions in the library.
1511100ae103Smrg# Disabled by default, enable with --enable-lint-library
1512100ae103Smrg# Sets: 
1513100ae103Smrg#	@LINTLIB@		- name of lint library file to make
1514100ae103Smrg#	MAKE_LINT_LIB		- automake conditional
1515100ae103Smrg#
1516100ae103Smrg
1517100ae103SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
1518100ae103SmrgAC_REQUIRE([XORG_WITH_LINT])
1519100ae103Smrg# Build lint "library" for more indepth checks of programs calling this library
1520100ae103SmrgAC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
1521100ae103Smrg	[Create lint library (default: disabled)])],
1522100ae103Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
1523100ae103Smrgif test "x$make_lint_lib" != "xno" ; then
1524100ae103Smrg	if test "x$LINT" = "xno" ; then
1525100ae103Smrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
1526100ae103Smrg	fi
1527100ae103Smrg	if test "x$make_lint_lib" = "xyes" ; then
1528100ae103Smrg		LINTLIB=llib-l$1.ln
1529100ae103Smrg	else
1530100ae103Smrg		LINTLIB=$make_lint_lib
1531100ae103Smrg	fi
1532100ae103Smrgfi
1533100ae103SmrgAC_SUBST(LINTLIB)
1534100ae103SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1535100ae103Smrg
1536100ae103Smrg]) # XORG_LINT_LIBRARY
1537100ae103Smrg
1538100ae103Smrgdnl Copyright 2005 Red Hat, Inc
1539100ae103Smrgdnl
1540100ae103Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1541100ae103Smrgdnl documentation for any purpose is hereby granted without fee, provided that
1542100ae103Smrgdnl the above copyright notice appear in all copies and that both that
1543100ae103Smrgdnl copyright notice and this permission notice appear in supporting
1544100ae103Smrgdnl documentation.
1545100ae103Smrgdnl
1546100ae103Smrgdnl The above copyright notice and this permission notice shall be included
1547100ae103Smrgdnl in all copies or substantial portions of the Software.
1548100ae103Smrgdnl
1549100ae103Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1550100ae103Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1551100ae103Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1552100ae103Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1553100ae103Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1554100ae103Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1555100ae103Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
1556100ae103Smrgdnl
1557100ae103Smrgdnl Except as contained in this notice, the name of the copyright holders shall
1558100ae103Smrgdnl not be used in advertising or otherwise to promote the sale, use or
1559100ae103Smrgdnl other dealings in this Software without prior written authorization
1560100ae103Smrgdnl from the copyright holders.
1561100ae103Smrgdnl
1562100ae103Smrg
1563100ae103Smrg# XORG_RELEASE_VERSION
1564100ae103Smrg# --------------------
1565100ae103Smrg# Adds --with/without-release-string and changes the PACKAGE and
1566100ae103Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
1567100ae103Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
1568100ae103Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1569100ae103Smrg 
1570100ae103SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
1571100ae103Smrg	AC_ARG_WITH(release-version,
1572100ae103Smrg			AC_HELP_STRING([--with-release-version=STRING],
1573100ae103Smrg				[Use release version string in package name]),
1574100ae103Smrg			[RELEASE_VERSION="$withval"],
1575100ae103Smrg			[RELEASE_VERSION=""])
1576100ae103Smrg	if test "x$RELEASE_VERSION" != "x"; then
1577100ae103Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
1578100ae103Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
1579100ae103Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
1580100ae103Smrg	fi
1581100ae103Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1582100ae103Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
1583100ae103Smrg		[Major version of this package])
1584100ae103Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2`
1585100ae103Smrg	if test "x$PVM" = "x"; then
1586100ae103Smrg		PVM="0"
1587100ae103Smrg	fi
1588100ae103Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
1589100ae103Smrg		[$PVM],
1590100ae103Smrg		[Minor version of this package])
1591100ae103Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3`
1592100ae103Smrg	if test "x$PVP" = "x"; then
1593100ae103Smrg		PVP="0"
1594100ae103Smrg	fi
1595100ae103Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1596100ae103Smrg		[$PVP],
1597100ae103Smrg		[Patch version of this package])
1598100ae103Smrg])
1599100ae103Smrg
1600