aclocal.m4 revision bf2eeab3
1bf2eeab3Smrg# generated automatically by aclocal 1.11 -*- Autoconf -*-
214c0a534Smrg
314c0a534Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4bf2eeab3Smrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
514c0a534Smrg# This file is free software; the Free Software Foundation
614c0a534Smrg# gives unlimited permission to copy and/or distribute it,
714c0a534Smrg# with or without modifications, as long as this notice is preserved.
814c0a534Smrg
914c0a534Smrg# This program is distributed in the hope that it will be useful,
1014c0a534Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1114c0a534Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1214c0a534Smrg# PARTICULAR PURPOSE.
1314c0a534Smrg
14bf2eeab3Smrgm4_ifndef([AC_AUTOCONF_VERSION],
15bf2eeab3Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16bf2eeab3Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
17bf2eeab3Smrg[m4_warning([this file was generated for autoconf 2.63.
18bf2eeab3SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19bf2eeab3SmrgIf you have problems, you may need to regenerate the build system entirely.
20bf2eeab3SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
2114c0a534Smrg
22bf2eeab3Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
2314c0a534Smrg#
24bf2eeab3Smrg# This file is free software; the Free Software Foundation
25bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it,
26bf2eeab3Smrg# with or without modifications, as long as this notice is preserved.
2714c0a534Smrg
28bf2eeab3Smrg# AM_AUTOMAKE_VERSION(VERSION)
29bf2eeab3Smrg# ----------------------------
30bf2eeab3Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
31bf2eeab3Smrg# generated from the m4 files accompanying Automake X.Y.
32bf2eeab3Smrg# (This private macro should not be called outside this file.)
33bf2eeab3SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
34bf2eeab3Smrg[am__api_version='1.11'
35bf2eeab3Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
36bf2eeab3Smrgdnl require some minimum version.  Point them to the right macro.
37bf2eeab3Smrgm4_if([$1], [1.11], [],
38bf2eeab3Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
39bf2eeab3Smrg])
4014c0a534Smrg
41bf2eeab3Smrg# _AM_AUTOCONF_VERSION(VERSION)
4214c0a534Smrg# -----------------------------
43bf2eeab3Smrg# aclocal traces this macro to find the Autoconf version.
44bf2eeab3Smrg# This is a private macro too.  Using m4_define simplifies
45bf2eeab3Smrg# the logic in aclocal, which can simply ignore this definition.
46bf2eeab3Smrgm4_define([_AM_AUTOCONF_VERSION], [])
47bf2eeab3Smrg
48bf2eeab3Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
49bf2eeab3Smrg# -------------------------------
50bf2eeab3Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
51bf2eeab3Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
52bf2eeab3SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
53bf2eeab3Smrg[AM_AUTOMAKE_VERSION([1.11])dnl
54bf2eeab3Smrgm4_ifndef([AC_AUTOCONF_VERSION],
55bf2eeab3Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
56bf2eeab3Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
5714c0a534Smrg
58bf2eeab3Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
5914c0a534Smrg
60bf2eeab3Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
61bf2eeab3Smrg#
62bf2eeab3Smrg# This file is free software; the Free Software Foundation
63bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it,
64bf2eeab3Smrg# with or without modifications, as long as this notice is preserved.
65bf2eeab3Smrg
66bf2eeab3Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
67bf2eeab3Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
68bf2eeab3Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
6914c0a534Smrg#
70bf2eeab3Smrg# Of course, Automake must honor this variable whenever it calls a
71bf2eeab3Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
72bf2eeab3Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
73bf2eeab3Smrg# depending on how configure is run.  This is pretty annoying, since
74bf2eeab3Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
75bf2eeab3Smrg# source directory, any form will work fine, but in subdirectories a
76bf2eeab3Smrg# relative path needs to be adjusted first.
7714c0a534Smrg#
78bf2eeab3Smrg# $ac_aux_dir/missing
79bf2eeab3Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
80bf2eeab3Smrg# $top_srcdir/$ac_aux_dir/missing
81bf2eeab3Smrg#    fails if $ac_aux_dir is absolute,
82bf2eeab3Smrg#    fails when called from a subdirectory in a VPATH build with
83bf2eeab3Smrg#          a relative $ac_aux_dir
8414c0a534Smrg#
85bf2eeab3Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
86bf2eeab3Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
87bf2eeab3Smrg# harmless because $srcdir is `.', but things will broke when you
88bf2eeab3Smrg# start a VPATH build or use an absolute $srcdir.
8914c0a534Smrg#
90bf2eeab3Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
91bf2eeab3Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
92bf2eeab3Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
93bf2eeab3Smrg# and then we would define $MISSING as
94bf2eeab3Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
95bf2eeab3Smrg# This will work as long as MISSING is not called from configure, because
96bf2eeab3Smrg# unfortunately $(top_srcdir) has no meaning in configure.
97bf2eeab3Smrg# However there are other variables, like CC, which are often used in
98bf2eeab3Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
99bf2eeab3Smrg#
100bf2eeab3Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
101bf2eeab3Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
102bf2eeab3Smrg# configured tree to be moved without reconfiguration.
10314c0a534Smrg
104bf2eeab3SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
105bf2eeab3Smrg[dnl Rely on autoconf to set up CDPATH properly.
106bf2eeab3SmrgAC_PREREQ([2.50])dnl
107bf2eeab3Smrg# expand $ac_aux_dir to an absolute path
108bf2eeab3Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
109bf2eeab3Smrg])
11014c0a534Smrg
111bf2eeab3Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
11214c0a534Smrg
113bf2eeab3Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
114bf2eeab3Smrg# Free Software Foundation, Inc.
115bf2eeab3Smrg#
116bf2eeab3Smrg# This file is free software; the Free Software Foundation
117bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it,
118bf2eeab3Smrg# with or without modifications, as long as this notice is preserved.
11914c0a534Smrg
120bf2eeab3Smrg# serial 9
12114c0a534Smrg
122bf2eeab3Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
123bf2eeab3Smrg# -------------------------------------
124bf2eeab3Smrg# Define a conditional.
125bf2eeab3SmrgAC_DEFUN([AM_CONDITIONAL],
126bf2eeab3Smrg[AC_PREREQ(2.52)dnl
127bf2eeab3Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
128bf2eeab3Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
129bf2eeab3SmrgAC_SUBST([$1_TRUE])dnl
130bf2eeab3SmrgAC_SUBST([$1_FALSE])dnl
131bf2eeab3Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
132bf2eeab3Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
133bf2eeab3Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
134bf2eeab3Smrgif $2; then
135bf2eeab3Smrg  $1_TRUE=
136bf2eeab3Smrg  $1_FALSE='#'
137bf2eeab3Smrgelse
138bf2eeab3Smrg  $1_TRUE='#'
139bf2eeab3Smrg  $1_FALSE=
140bf2eeab3Smrgfi
141bf2eeab3SmrgAC_CONFIG_COMMANDS_PRE(
142bf2eeab3Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
143bf2eeab3Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
144bf2eeab3SmrgUsually this means the macro was only invoked conditionally.]])
145bf2eeab3Smrgfi])])
14614c0a534Smrg
147bf2eeab3Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
148bf2eeab3Smrg# Free Software Foundation, Inc.
149bf2eeab3Smrg#
150bf2eeab3Smrg# This file is free software; the Free Software Foundation
151bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it,
152bf2eeab3Smrg# with or without modifications, as long as this notice is preserved.
15314c0a534Smrg
154bf2eeab3Smrg# serial 10
15514c0a534Smrg
156bf2eeab3Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
157bf2eeab3Smrg# written in clear, in which case automake, when reading aclocal.m4,
158bf2eeab3Smrg# will think it sees a *use*, and therefore will trigger all it's
159bf2eeab3Smrg# C support machinery.  Also note that it means that autoscan, seeing
160bf2eeab3Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
16114c0a534Smrg
16214c0a534Smrg
163bf2eeab3Smrg# _AM_DEPENDENCIES(NAME)
164bf2eeab3Smrg# ----------------------
165bf2eeab3Smrg# See how the compiler implements dependency checking.
166bf2eeab3Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
167bf2eeab3Smrg# We try a few techniques and use that to set a single cache variable.
168bf2eeab3Smrg#
169bf2eeab3Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
170bf2eeab3Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
171bf2eeab3Smrg# dependency, and given that the user is not expected to run this macro,
172bf2eeab3Smrg# just rely on AC_PROG_CC.
173bf2eeab3SmrgAC_DEFUN([_AM_DEPENDENCIES],
174bf2eeab3Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
175bf2eeab3SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
176bf2eeab3SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
177bf2eeab3SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
17814c0a534Smrg
179bf2eeab3Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
180bf2eeab3Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
181bf2eeab3Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
182bf2eeab3Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
183bf2eeab3Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
184bf2eeab3Smrg                   [depcc="$$1"   am_compiler_list=])
18514c0a534Smrg
186bf2eeab3SmrgAC_CACHE_CHECK([dependency style of $depcc],
187bf2eeab3Smrg               [am_cv_$1_dependencies_compiler_type],
188bf2eeab3Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
189bf2eeab3Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
190bf2eeab3Smrg  # making bogus files that we don't know about and never remove.  For
191bf2eeab3Smrg  # instance it was reported that on HP-UX the gcc test will end up
192bf2eeab3Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
193bf2eeab3Smrg  # in D'.
194bf2eeab3Smrg  mkdir conftest.dir
195bf2eeab3Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
196bf2eeab3Smrg  # using a relative directory.
197bf2eeab3Smrg  cp "$am_depcomp" conftest.dir
198bf2eeab3Smrg  cd conftest.dir
199bf2eeab3Smrg  # We will build objects and dependencies in a subdirectory because
200bf2eeab3Smrg  # it helps to detect inapplicable dependency modes.  For instance
201bf2eeab3Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
202bf2eeab3Smrg  # side effect of compilation, but ICC will put the dependencies in
203bf2eeab3Smrg  # the current directory while Tru64 will put them in the object
204bf2eeab3Smrg  # directory.
205bf2eeab3Smrg  mkdir sub
20614c0a534Smrg
207bf2eeab3Smrg  am_cv_$1_dependencies_compiler_type=none
208bf2eeab3Smrg  if test "$am_compiler_list" = ""; then
209bf2eeab3Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
210bf2eeab3Smrg  fi
211bf2eeab3Smrg  am__universal=false
212bf2eeab3Smrg  m4_case([$1], [CC],
213bf2eeab3Smrg    [case " $depcc " in #(
214bf2eeab3Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
215bf2eeab3Smrg     esac],
216bf2eeab3Smrg    [CXX],
217bf2eeab3Smrg    [case " $depcc " in #(
218bf2eeab3Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
219bf2eeab3Smrg     esac])
22014c0a534Smrg
221bf2eeab3Smrg  for depmode in $am_compiler_list; do
222bf2eeab3Smrg    # Setup a source with many dependencies, because some compilers
223bf2eeab3Smrg    # like to wrap large dependency lists on column 80 (with \), and
224bf2eeab3Smrg    # we should not choose a depcomp mode which is confused by this.
225bf2eeab3Smrg    #
226bf2eeab3Smrg    # We need to recreate these files for each test, as the compiler may
227bf2eeab3Smrg    # overwrite some of them when testing with obscure command lines.
228bf2eeab3Smrg    # This happens at least with the AIX C compiler.
229bf2eeab3Smrg    : > sub/conftest.c
230bf2eeab3Smrg    for i in 1 2 3 4 5 6; do
231bf2eeab3Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
232bf2eeab3Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
233bf2eeab3Smrg      # Solaris 8's {/usr,}/bin/sh.
234bf2eeab3Smrg      touch sub/conftst$i.h
235bf2eeab3Smrg    done
236bf2eeab3Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
237bf2eeab3Smrg
238bf2eeab3Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
239bf2eeab3Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
240bf2eeab3Smrg    # handle `-M -o', and we need to detect this.  Also, some Intel
241bf2eeab3Smrg    # versions had trouble with output in subdirs
242bf2eeab3Smrg    am__obj=sub/conftest.${OBJEXT-o}
243bf2eeab3Smrg    am__minus_obj="-o $am__obj"
244bf2eeab3Smrg    case $depmode in
245bf2eeab3Smrg    gcc)
246bf2eeab3Smrg      # This depmode causes a compiler race in universal mode.
247bf2eeab3Smrg      test "$am__universal" = false || continue
248bf2eeab3Smrg      ;;
249bf2eeab3Smrg    nosideeffect)
250bf2eeab3Smrg      # after this tag, mechanisms are not by side-effect, so they'll
251bf2eeab3Smrg      # only be used when explicitly requested
252bf2eeab3Smrg      if test "x$enable_dependency_tracking" = xyes; then
253bf2eeab3Smrg	continue
254bf2eeab3Smrg      else
255bf2eeab3Smrg	break
256bf2eeab3Smrg      fi
257bf2eeab3Smrg      ;;
258bf2eeab3Smrg    msvisualcpp | msvcmsys)
259bf2eeab3Smrg      # This compiler won't grok `-c -o', but also, the minuso test has
260bf2eeab3Smrg      # not run yet.  These depmodes are late enough in the game, and
261bf2eeab3Smrg      # so weak that their functioning should not be impacted.
262bf2eeab3Smrg      am__obj=conftest.${OBJEXT-o}
263bf2eeab3Smrg      am__minus_obj=
264bf2eeab3Smrg      ;;
265bf2eeab3Smrg    none) break ;;
266bf2eeab3Smrg    esac
267bf2eeab3Smrg    if depmode=$depmode \
268bf2eeab3Smrg       source=sub/conftest.c object=$am__obj \
269bf2eeab3Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
270bf2eeab3Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
271bf2eeab3Smrg         >/dev/null 2>conftest.err &&
272bf2eeab3Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
273bf2eeab3Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
274bf2eeab3Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
275bf2eeab3Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
276bf2eeab3Smrg      # icc doesn't choke on unknown options, it will just issue warnings
277bf2eeab3Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
278bf2eeab3Smrg      # that says an option was ignored or not supported.
279bf2eeab3Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
280bf2eeab3Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
281bf2eeab3Smrg      # The diagnosis changed in icc 8.0:
282bf2eeab3Smrg      #   icc: Command line remark: option '-MP' not supported
283bf2eeab3Smrg      if (grep 'ignoring option' conftest.err ||
284bf2eeab3Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
285bf2eeab3Smrg        am_cv_$1_dependencies_compiler_type=$depmode
286bf2eeab3Smrg        break
287bf2eeab3Smrg      fi
288bf2eeab3Smrg    fi
289bf2eeab3Smrg  done
290bf2eeab3Smrg
291bf2eeab3Smrg  cd ..
292bf2eeab3Smrg  rm -rf conftest.dir
29314c0a534Smrgelse
294bf2eeab3Smrg  am_cv_$1_dependencies_compiler_type=none
29514c0a534Smrgfi
296bf2eeab3Smrg])
297bf2eeab3SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
298bf2eeab3SmrgAM_CONDITIONAL([am__fastdep$1], [
299bf2eeab3Smrg  test "x$enable_dependency_tracking" != xno \
300bf2eeab3Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
301bf2eeab3Smrg])
30214c0a534Smrg
30314c0a534Smrg
304bf2eeab3Smrg# AM_SET_DEPDIR
305bf2eeab3Smrg# -------------
306bf2eeab3Smrg# Choose a directory name for dependency files.
307bf2eeab3Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
308bf2eeab3SmrgAC_DEFUN([AM_SET_DEPDIR],
309bf2eeab3Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
310bf2eeab3SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
311bf2eeab3Smrg])
31214c0a534Smrg
31314c0a534Smrg
314bf2eeab3Smrg# AM_DEP_TRACK
315bf2eeab3Smrg# ------------
316bf2eeab3SmrgAC_DEFUN([AM_DEP_TRACK],
317bf2eeab3Smrg[AC_ARG_ENABLE(dependency-tracking,
318bf2eeab3Smrg[  --disable-dependency-tracking  speeds up one-time build
319bf2eeab3Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
320bf2eeab3Smrgif test "x$enable_dependency_tracking" != xno; then
321bf2eeab3Smrg  am_depcomp="$ac_aux_dir/depcomp"
322bf2eeab3Smrg  AMDEPBACKSLASH='\'
32314c0a534Smrgfi
324bf2eeab3SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
325bf2eeab3SmrgAC_SUBST([AMDEPBACKSLASH])dnl
326bf2eeab3Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
327bf2eeab3Smrg])
32814c0a534Smrg
329bf2eeab3Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
330bf2eeab3Smrg
331bf2eeab3Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
332bf2eeab3Smrg# Free Software Foundation, Inc.
333bf2eeab3Smrg#
334bf2eeab3Smrg# This file is free software; the Free Software Foundation
335bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it,
336bf2eeab3Smrg# with or without modifications, as long as this notice is preserved.
337bf2eeab3Smrg
338bf2eeab3Smrg#serial 5
339bf2eeab3Smrg
340bf2eeab3Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
341bf2eeab3Smrg# ------------------------------
342bf2eeab3SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
343bf2eeab3Smrg[{
344bf2eeab3Smrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
345bf2eeab3Smrg  # are listed without --file.  Let's play safe and only enable the eval
346bf2eeab3Smrg  # if we detect the quoting.
347bf2eeab3Smrg  case $CONFIG_FILES in
348bf2eeab3Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
349bf2eeab3Smrg  *)   set x $CONFIG_FILES ;;
350bf2eeab3Smrg  esac
351bf2eeab3Smrg  shift
352bf2eeab3Smrg  for mf
353bf2eeab3Smrg  do
354bf2eeab3Smrg    # Strip MF so we end up with the name of the file.
355bf2eeab3Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
356bf2eeab3Smrg    # Check whether this is an Automake generated Makefile or not.
357bf2eeab3Smrg    # We used to match only the files named `Makefile.in', but
358bf2eeab3Smrg    # some people rename them; so instead we look at the file content.
359bf2eeab3Smrg    # Grep'ing the first line is not enough: some people post-process
360bf2eeab3Smrg    # each Makefile.in and add a new line on top of each file to say so.
361bf2eeab3Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
362bf2eeab3Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
363bf2eeab3Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
364bf2eeab3Smrg      dirpart=`AS_DIRNAME("$mf")`
365bf2eeab3Smrg    else
366bf2eeab3Smrg      continue
367bf2eeab3Smrg    fi
368bf2eeab3Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
369bf2eeab3Smrg    # from the Makefile without running `make'.
370bf2eeab3Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
371bf2eeab3Smrg    test -z "$DEPDIR" && continue
372bf2eeab3Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
373bf2eeab3Smrg    test -z "am__include" && continue
374bf2eeab3Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
375bf2eeab3Smrg    # When using ansi2knr, U may be empty or an underscore; expand it
376bf2eeab3Smrg    U=`sed -n 's/^U = //p' < "$mf"`
377bf2eeab3Smrg    # Find all dependency output files, they are included files with
378bf2eeab3Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
379bf2eeab3Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
380bf2eeab3Smrg    # expansion.
381bf2eeab3Smrg    for file in `sed -n "
382bf2eeab3Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
383bf2eeab3Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
384bf2eeab3Smrg      # Make sure the directory exists.
385bf2eeab3Smrg      test -f "$dirpart/$file" && continue
386bf2eeab3Smrg      fdir=`AS_DIRNAME(["$file"])`
387bf2eeab3Smrg      AS_MKDIR_P([$dirpart/$fdir])
388bf2eeab3Smrg      # echo "creating $dirpart/$file"
389bf2eeab3Smrg      echo '# dummy' > "$dirpart/$file"
390bf2eeab3Smrg    done
391bf2eeab3Smrg  done
392bf2eeab3Smrg}
393bf2eeab3Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
394bf2eeab3Smrg
395bf2eeab3Smrg
396bf2eeab3Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
397bf2eeab3Smrg# -----------------------------
398bf2eeab3Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
399bf2eeab3Smrg#
400bf2eeab3Smrg# This code is only required when automatic dependency tracking
401bf2eeab3Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
402bf2eeab3Smrg# need in order to bootstrap the dependency handling code.
403bf2eeab3SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
404bf2eeab3Smrg[AC_CONFIG_COMMANDS([depfiles],
405bf2eeab3Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
406bf2eeab3Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
407bf2eeab3Smrg])
408bf2eeab3Smrg
409bf2eeab3Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
410bf2eeab3Smrg# Free Software Foundation, Inc.
411bf2eeab3Smrg#
412bf2eeab3Smrg# This file is free software; the Free Software Foundation
413bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it,
414bf2eeab3Smrg# with or without modifications, as long as this notice is preserved.
415bf2eeab3Smrg
416bf2eeab3Smrg# serial 8
417bf2eeab3Smrg
418bf2eeab3Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
419bf2eeab3SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
420bf2eeab3Smrg
421bf2eeab3Smrg# Do all the work for Automake.                             -*- Autoconf -*-
422bf2eeab3Smrg
423bf2eeab3Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
424bf2eeab3Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
425bf2eeab3Smrg#
426bf2eeab3Smrg# This file is free software; the Free Software Foundation
427bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it,
428bf2eeab3Smrg# with or without modifications, as long as this notice is preserved.
429bf2eeab3Smrg
430bf2eeab3Smrg# serial 16
431bf2eeab3Smrg
432bf2eeab3Smrg# This macro actually does too much.  Some checks are only needed if
433bf2eeab3Smrg# your package does certain things.  But this isn't really a big deal.
434bf2eeab3Smrg
435bf2eeab3Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
436bf2eeab3Smrg# AM_INIT_AUTOMAKE([OPTIONS])
437bf2eeab3Smrg# -----------------------------------------------
438bf2eeab3Smrg# The call with PACKAGE and VERSION arguments is the old style
439bf2eeab3Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
440bf2eeab3Smrg# and VERSION should now be passed to AC_INIT and removed from
441bf2eeab3Smrg# the call to AM_INIT_AUTOMAKE.
442bf2eeab3Smrg# We support both call styles for the transition.  After
443bf2eeab3Smrg# the next Automake release, Autoconf can make the AC_INIT
444bf2eeab3Smrg# arguments mandatory, and then we can depend on a new Autoconf
445bf2eeab3Smrg# release and drop the old call support.
446bf2eeab3SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
447bf2eeab3Smrg[AC_PREREQ([2.62])dnl
448bf2eeab3Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
449bf2eeab3Smrgdnl the ones we care about.
450bf2eeab3Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
451bf2eeab3SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
452bf2eeab3SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
453bf2eeab3Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
454bf2eeab3Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
455bf2eeab3Smrg  # is not polluted with repeated "-I."
456bf2eeab3Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
457bf2eeab3Smrg  # test to see if srcdir already configured
458bf2eeab3Smrg  if test -f $srcdir/config.status; then
459bf2eeab3Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
460bf2eeab3Smrg  fi
46114c0a534Smrgfi
46214c0a534Smrg
463bf2eeab3Smrg# test whether we have cygpath
464bf2eeab3Smrgif test -z "$CYGPATH_W"; then
465bf2eeab3Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
466bf2eeab3Smrg    CYGPATH_W='cygpath -w'
467bf2eeab3Smrg  else
468bf2eeab3Smrg    CYGPATH_W=echo
469bf2eeab3Smrg  fi
47014c0a534Smrgfi
471bf2eeab3SmrgAC_SUBST([CYGPATH_W])
472bf2eeab3Smrg
473bf2eeab3Smrg# Define the identity of the package.
474bf2eeab3Smrgdnl Distinguish between old-style and new-style calls.
475bf2eeab3Smrgm4_ifval([$2],
476bf2eeab3Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
477bf2eeab3Smrg AC_SUBST([PACKAGE], [$1])dnl
478bf2eeab3Smrg AC_SUBST([VERSION], [$2])],
479bf2eeab3Smrg[_AM_SET_OPTIONS([$1])dnl
480bf2eeab3Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
481bf2eeab3Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
482bf2eeab3Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
483bf2eeab3Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
484bf2eeab3Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
485bf2eeab3Smrg
486bf2eeab3Smrg_AM_IF_OPTION([no-define],,
487bf2eeab3Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
488bf2eeab3Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
489bf2eeab3Smrg
490bf2eeab3Smrg# Some tools Automake needs.
491bf2eeab3SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
492bf2eeab3SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
493bf2eeab3SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
494bf2eeab3SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
495bf2eeab3SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
496bf2eeab3SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
497bf2eeab3SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
498bf2eeab3SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
499bf2eeab3SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
500bf2eeab3SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
501bf2eeab3Smrg# We need awk for the "check" target.  The system "awk" is bad on
502bf2eeab3Smrg# some platforms.
503bf2eeab3SmrgAC_REQUIRE([AC_PROG_AWK])dnl
504bf2eeab3SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
505bf2eeab3SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
506bf2eeab3Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
507bf2eeab3Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
508bf2eeab3Smrg			     [_AM_PROG_TAR([v7])])])
509bf2eeab3Smrg_AM_IF_OPTION([no-dependencies],,
510bf2eeab3Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
511bf2eeab3Smrg		  [_AM_DEPENDENCIES(CC)],
512bf2eeab3Smrg		  [define([AC_PROG_CC],
513bf2eeab3Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
514bf2eeab3SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
515bf2eeab3Smrg		  [_AM_DEPENDENCIES(CXX)],
516bf2eeab3Smrg		  [define([AC_PROG_CXX],
517bf2eeab3Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
518bf2eeab3SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
519bf2eeab3Smrg		  [_AM_DEPENDENCIES(OBJC)],
520bf2eeab3Smrg		  [define([AC_PROG_OBJC],
521bf2eeab3Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
522bf2eeab3Smrg])
523bf2eeab3Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
524bf2eeab3Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
525bf2eeab3Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
526bf2eeab3Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
527bf2eeab3SmrgAC_CONFIG_COMMANDS_PRE(dnl
528bf2eeab3Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
529bf2eeab3Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
530bf2eeab3Smrg])
531bf2eeab3Smrg
532bf2eeab3Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
533bf2eeab3Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
534bf2eeab3Smrgdnl mangled by Autoconf and run in a shell conditional statement.
535bf2eeab3Smrgm4_define([_AC_COMPILER_EXEEXT],
536bf2eeab3Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
537bf2eeab3Smrg
538bf2eeab3Smrg
539bf2eeab3Smrg# When config.status generates a header, we must update the stamp-h file.
540bf2eeab3Smrg# This file resides in the same directory as the config header
541bf2eeab3Smrg# that is generated.  The stamp files are numbered to have different names.
542bf2eeab3Smrg
543bf2eeab3Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
544bf2eeab3Smrg# loop where config.status creates the headers, so we can generate
545bf2eeab3Smrg# our stamp files there.
546bf2eeab3SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
547bf2eeab3Smrg[# Compute $1's index in $config_headers.
548bf2eeab3Smrg_am_arg=$1
549bf2eeab3Smrg_am_stamp_count=1
550bf2eeab3Smrgfor _am_header in $config_headers :; do
551bf2eeab3Smrg  case $_am_header in
552bf2eeab3Smrg    $_am_arg | $_am_arg:* )
553bf2eeab3Smrg      break ;;
554bf2eeab3Smrg    * )
555bf2eeab3Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
556bf2eeab3Smrg  esac
557bf2eeab3Smrgdone
558bf2eeab3Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
559bf2eeab3Smrg
560bf2eeab3Smrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
561bf2eeab3Smrg#
562bf2eeab3Smrg# This file is free software; the Free Software Foundation
563bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it,
564bf2eeab3Smrg# with or without modifications, as long as this notice is preserved.
565bf2eeab3Smrg
566bf2eeab3Smrg# AM_PROG_INSTALL_SH
567bf2eeab3Smrg# ------------------
568bf2eeab3Smrg# Define $install_sh.
569bf2eeab3SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
570bf2eeab3Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
571bf2eeab3Smrgif test x"${install_sh}" != xset; then
572bf2eeab3Smrg  case $am_aux_dir in
573bf2eeab3Smrg  *\ * | *\	*)
574bf2eeab3Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
575bf2eeab3Smrg  *)
576bf2eeab3Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
577bf2eeab3Smrg  esac
57814c0a534Smrgfi
579bf2eeab3SmrgAC_SUBST(install_sh)])
58014c0a534Smrg
581bf2eeab3Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
582bf2eeab3Smrg#
583bf2eeab3Smrg# This file is free software; the Free Software Foundation
584bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it,
585bf2eeab3Smrg# with or without modifications, as long as this notice is preserved.
586bf2eeab3Smrg
587bf2eeab3Smrg# serial 2
588bf2eeab3Smrg
589bf2eeab3Smrg# Check whether the underlying file-system supports filenames
590bf2eeab3Smrg# with a leading dot.  For instance MS-DOS doesn't.
591bf2eeab3SmrgAC_DEFUN([AM_SET_LEADING_DOT],
592bf2eeab3Smrg[rm -rf .tst 2>/dev/null
593bf2eeab3Smrgmkdir .tst 2>/dev/null
594bf2eeab3Smrgif test -d .tst; then
595bf2eeab3Smrg  am__leading_dot=.
596bf2eeab3Smrgelse
597bf2eeab3Smrg  am__leading_dot=_
59814c0a534Smrgfi
599bf2eeab3Smrgrmdir .tst 2>/dev/null
600bf2eeab3SmrgAC_SUBST([am__leading_dot])])
601bf2eeab3Smrg
602bf2eeab3Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
603bf2eeab3Smrg# From Jim Meyering
604bf2eeab3Smrg
605bf2eeab3Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
606bf2eeab3Smrg# Free Software Foundation, Inc.
607bf2eeab3Smrg#
608bf2eeab3Smrg# This file is free software; the Free Software Foundation
609bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it,
610bf2eeab3Smrg# with or without modifications, as long as this notice is preserved.
611bf2eeab3Smrg
612bf2eeab3Smrg# serial 5
613bf2eeab3Smrg
614bf2eeab3Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
615bf2eeab3Smrg# ----------------------------------
616bf2eeab3Smrg# Control maintainer-specific portions of Makefiles.
617bf2eeab3Smrg# Default is to disable them, unless `enable' is passed literally.
618bf2eeab3Smrg# For symmetry, `disable' may be passed as well.  Anyway, the user
619bf2eeab3Smrg# can override the default with the --enable/--disable switch.
620bf2eeab3SmrgAC_DEFUN([AM_MAINTAINER_MODE],
621bf2eeab3Smrg[m4_case(m4_default([$1], [disable]),
622bf2eeab3Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
623bf2eeab3Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
624bf2eeab3Smrg       [m4_define([am_maintainer_other], [enable])
625bf2eeab3Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
626bf2eeab3SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
627bf2eeab3Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
628bf2eeab3Smrg  AC_ARG_ENABLE([maintainer-mode],
629bf2eeab3Smrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
630bf2eeab3Smrg			  (and sometimes confusing) to the casual installer],
631bf2eeab3Smrg      [USE_MAINTAINER_MODE=$enableval],
632bf2eeab3Smrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
633bf2eeab3Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
634bf2eeab3Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
635bf2eeab3Smrg  MAINT=$MAINTAINER_MODE_TRUE
636bf2eeab3Smrg  AC_SUBST([MAINT])dnl
637bf2eeab3Smrg]
638bf2eeab3Smrg)
639bf2eeab3Smrg
640bf2eeab3SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
641bf2eeab3Smrg
642bf2eeab3Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
643bf2eeab3Smrg
644bf2eeab3Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
645bf2eeab3Smrg#
646bf2eeab3Smrg# This file is free software; the Free Software Foundation
647bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it,
648bf2eeab3Smrg# with or without modifications, as long as this notice is preserved.
649bf2eeab3Smrg
650bf2eeab3Smrg# serial 4
651bf2eeab3Smrg
652bf2eeab3Smrg# AM_MAKE_INCLUDE()
653bf2eeab3Smrg# -----------------
654bf2eeab3Smrg# Check to see how make treats includes.
655bf2eeab3SmrgAC_DEFUN([AM_MAKE_INCLUDE],
656bf2eeab3Smrg[am_make=${MAKE-make}
657bf2eeab3Smrgcat > confinc << 'END'
658bf2eeab3Smrgam__doit:
659bf2eeab3Smrg	@echo this is the am__doit target
660bf2eeab3Smrg.PHONY: am__doit
661bf2eeab3SmrgEND
662bf2eeab3Smrg# If we don't find an include directive, just comment out the code.
663bf2eeab3SmrgAC_MSG_CHECKING([for style of include used by $am_make])
664bf2eeab3Smrgam__include="#"
665bf2eeab3Smrgam__quote=
666bf2eeab3Smrg_am_result=none
667bf2eeab3Smrg# First try GNU make style include.
668bf2eeab3Smrgecho "include confinc" > confmf
669bf2eeab3Smrg# Ignore all kinds of additional output from `make'.
670bf2eeab3Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
671bf2eeab3Smrg*the\ am__doit\ target*)
672bf2eeab3Smrg  am__include=include
673bf2eeab3Smrg  am__quote=
674bf2eeab3Smrg  _am_result=GNU
675bf2eeab3Smrg  ;;
676bf2eeab3Smrgesac
677bf2eeab3Smrg# Now try BSD make style include.
678bf2eeab3Smrgif test "$am__include" = "#"; then
679bf2eeab3Smrg   echo '.include "confinc"' > confmf
680bf2eeab3Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
681bf2eeab3Smrg   *the\ am__doit\ target*)
682bf2eeab3Smrg     am__include=.include
683bf2eeab3Smrg     am__quote="\""
684bf2eeab3Smrg     _am_result=BSD
685bf2eeab3Smrg     ;;
686bf2eeab3Smrg   esac
68714c0a534Smrgfi
688bf2eeab3SmrgAC_SUBST([am__include])
689bf2eeab3SmrgAC_SUBST([am__quote])
690bf2eeab3SmrgAC_MSG_RESULT([$_am_result])
691bf2eeab3Smrgrm -f confinc confmf
692bf2eeab3Smrg])
69314c0a534Smrg
694bf2eeab3Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
695bf2eeab3Smrg
696bf2eeab3Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
697bf2eeab3Smrg# Free Software Foundation, Inc.
698bf2eeab3Smrg#
699bf2eeab3Smrg# This file is free software; the Free Software Foundation
700bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it,
701bf2eeab3Smrg# with or without modifications, as long as this notice is preserved.
702bf2eeab3Smrg
703bf2eeab3Smrg# serial 6
704bf2eeab3Smrg
705bf2eeab3Smrg# AM_MISSING_PROG(NAME, PROGRAM)
706bf2eeab3Smrg# ------------------------------
707bf2eeab3SmrgAC_DEFUN([AM_MISSING_PROG],
708bf2eeab3Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
709bf2eeab3Smrg$1=${$1-"${am_missing_run}$2"}
710bf2eeab3SmrgAC_SUBST($1)])
711bf2eeab3Smrg
712bf2eeab3Smrg
713bf2eeab3Smrg# AM_MISSING_HAS_RUN
714bf2eeab3Smrg# ------------------
715bf2eeab3Smrg# Define MISSING if not defined so far and test if it supports --run.
716bf2eeab3Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
717bf2eeab3SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
718bf2eeab3Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
719bf2eeab3SmrgAC_REQUIRE_AUX_FILE([missing])dnl
720bf2eeab3Smrgif test x"${MISSING+set}" != xset; then
721bf2eeab3Smrg  case $am_aux_dir in
722bf2eeab3Smrg  *\ * | *\	*)
723bf2eeab3Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
724bf2eeab3Smrg  *)
725bf2eeab3Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
726bf2eeab3Smrg  esac
72714c0a534Smrgfi
728bf2eeab3Smrg# Use eval to expand $SHELL
729bf2eeab3Smrgif eval "$MISSING --run true"; then
730bf2eeab3Smrg  am_missing_run="$MISSING --run "
731bf2eeab3Smrgelse
732bf2eeab3Smrg  am_missing_run=
733bf2eeab3Smrg  AC_MSG_WARN([`missing' script is too old or missing])
73414c0a534Smrgfi
735bf2eeab3Smrg])
73614c0a534Smrg
737bf2eeab3Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
738bf2eeab3Smrg#
739bf2eeab3Smrg# This file is free software; the Free Software Foundation
740bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it,
741bf2eeab3Smrg# with or without modifications, as long as this notice is preserved.
74214c0a534Smrg
743bf2eeab3Smrg# AM_PROG_MKDIR_P
744bf2eeab3Smrg# ---------------
745bf2eeab3Smrg# Check for `mkdir -p'.
746bf2eeab3SmrgAC_DEFUN([AM_PROG_MKDIR_P],
747bf2eeab3Smrg[AC_PREREQ([2.60])dnl
748bf2eeab3SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
749bf2eeab3Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
750bf2eeab3Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
751bf2eeab3Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
752bf2eeab3Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
753bf2eeab3Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
754bf2eeab3Smrgdnl adjustment using top_builddir (which is defined more often than
755bf2eeab3Smrgdnl MKDIR_P).
756bf2eeab3SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
757bf2eeab3Smrgcase $mkdir_p in
758bf2eeab3Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
759bf2eeab3Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
760bf2eeab3Smrgesac
761bf2eeab3Smrg])
76214c0a534Smrg
763bf2eeab3Smrg# Helper functions for option handling.                     -*- Autoconf -*-
764bf2eeab3Smrg
765bf2eeab3Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
766bf2eeab3Smrg#
767bf2eeab3Smrg# This file is free software; the Free Software Foundation
768bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it,
769bf2eeab3Smrg# with or without modifications, as long as this notice is preserved.
770bf2eeab3Smrg
771bf2eeab3Smrg# serial 4
772bf2eeab3Smrg
773bf2eeab3Smrg# _AM_MANGLE_OPTION(NAME)
774bf2eeab3Smrg# -----------------------
775bf2eeab3SmrgAC_DEFUN([_AM_MANGLE_OPTION],
776bf2eeab3Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
777bf2eeab3Smrg
778bf2eeab3Smrg# _AM_SET_OPTION(NAME)
779bf2eeab3Smrg# ------------------------------
780bf2eeab3Smrg# Set option NAME.  Presently that only means defining a flag for this option.
781bf2eeab3SmrgAC_DEFUN([_AM_SET_OPTION],
782bf2eeab3Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
783bf2eeab3Smrg
784bf2eeab3Smrg# _AM_SET_OPTIONS(OPTIONS)
785bf2eeab3Smrg# ----------------------------------
786bf2eeab3Smrg# OPTIONS is a space-separated list of Automake options.
787bf2eeab3SmrgAC_DEFUN([_AM_SET_OPTIONS],
788bf2eeab3Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
78914c0a534Smrg
790bf2eeab3Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
791bf2eeab3Smrg# -------------------------------------------
792bf2eeab3Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
793bf2eeab3SmrgAC_DEFUN([_AM_IF_OPTION],
794bf2eeab3Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
79514c0a534Smrg
796bf2eeab3Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
79714c0a534Smrg
798bf2eeab3Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
799bf2eeab3Smrg# Free Software Foundation, Inc.
800bf2eeab3Smrg#
801bf2eeab3Smrg# This file is free software; the Free Software Foundation
802bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it,
803bf2eeab3Smrg# with or without modifications, as long as this notice is preserved.
80414c0a534Smrg
805bf2eeab3Smrg# serial 5
80614c0a534Smrg
807bf2eeab3Smrg# AM_SANITY_CHECK
808bf2eeab3Smrg# ---------------
809bf2eeab3SmrgAC_DEFUN([AM_SANITY_CHECK],
810bf2eeab3Smrg[AC_MSG_CHECKING([whether build environment is sane])
811bf2eeab3Smrg# Just in case
812bf2eeab3Smrgsleep 1
813bf2eeab3Smrgecho timestamp > conftest.file
814bf2eeab3Smrg# Reject unsafe characters in $srcdir or the absolute working directory
815bf2eeab3Smrg# name.  Accept space and tab only in the latter.
816bf2eeab3Smrgam_lf='
817bf2eeab3Smrg'
818bf2eeab3Smrgcase `pwd` in
819bf2eeab3Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
820bf2eeab3Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
821bf2eeab3Smrgesac
822bf2eeab3Smrgcase $srcdir in
823bf2eeab3Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
824bf2eeab3Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
825bf2eeab3Smrgesac
82614c0a534Smrg
827bf2eeab3Smrg# Do `set' in a subshell so we don't clobber the current shell's
828bf2eeab3Smrg# arguments.  Must try -L first in case configure is actually a
829bf2eeab3Smrg# symlink; some systems play weird games with the mod time of symlinks
830bf2eeab3Smrg# (eg FreeBSD returns the mod time of the symlink's containing
831bf2eeab3Smrg# directory).
832bf2eeab3Smrgif (
833bf2eeab3Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
834bf2eeab3Smrg   if test "$[*]" = "X"; then
835bf2eeab3Smrg      # -L didn't work.
836bf2eeab3Smrg      set X `ls -t "$srcdir/configure" conftest.file`
837bf2eeab3Smrg   fi
838bf2eeab3Smrg   rm -f conftest.file
839bf2eeab3Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
840bf2eeab3Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
84114c0a534Smrg
842bf2eeab3Smrg      # If neither matched, then we have a broken ls.  This can happen
843bf2eeab3Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
844bf2eeab3Smrg      # broken ls alias from the environment.  This has actually
845bf2eeab3Smrg      # happened.  Such a system could not be considered "sane".
846bf2eeab3Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
847bf2eeab3Smrgalias in your environment])
848bf2eeab3Smrg   fi
849bf2eeab3Smrg
850bf2eeab3Smrg   test "$[2]" = conftest.file
851bf2eeab3Smrg   )
852bf2eeab3Smrgthen
853bf2eeab3Smrg   # Ok.
854bf2eeab3Smrg   :
85514c0a534Smrgelse
856bf2eeab3Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
857bf2eeab3SmrgCheck your system clock])
85814c0a534Smrgfi
859bf2eeab3SmrgAC_MSG_RESULT(yes)])
86014c0a534Smrg
861bf2eeab3Smrg# Copyright (C) 2009  Free Software Foundation, Inc.
862bf2eeab3Smrg#
863bf2eeab3Smrg# This file is free software; the Free Software Foundation
864bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it,
865bf2eeab3Smrg# with or without modifications, as long as this notice is preserved.
86614c0a534Smrg
867bf2eeab3Smrg# serial 1
868bf2eeab3Smrg
869bf2eeab3Smrg# AM_SILENT_RULES([DEFAULT])
870bf2eeab3Smrg# --------------------------
871bf2eeab3Smrg# Enable less verbose build rules; with the default set to DEFAULT
872bf2eeab3Smrg# (`yes' being less verbose, `no' or empty being verbose).
873bf2eeab3SmrgAC_DEFUN([AM_SILENT_RULES],
874bf2eeab3Smrg[AC_ARG_ENABLE([silent-rules],
875bf2eeab3Smrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
876bf2eeab3Smrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
877bf2eeab3Smrgcase $enable_silent_rules in
878bf2eeab3Smrgyes) AM_DEFAULT_VERBOSITY=0;;
879bf2eeab3Smrgno)  AM_DEFAULT_VERBOSITY=1;;
880bf2eeab3Smrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
881bf2eeab3Smrgesac
882bf2eeab3SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
883bf2eeab3SmrgAM_BACKSLASH='\'
884bf2eeab3SmrgAC_SUBST([AM_BACKSLASH])dnl
885bf2eeab3Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
886bf2eeab3Smrg])
88714c0a534Smrg
888bf2eeab3Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
889bf2eeab3Smrg#
890bf2eeab3Smrg# This file is free software; the Free Software Foundation
891bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it,
892bf2eeab3Smrg# with or without modifications, as long as this notice is preserved.
89314c0a534Smrg
894bf2eeab3Smrg# AM_PROG_INSTALL_STRIP
895bf2eeab3Smrg# ---------------------
896bf2eeab3Smrg# One issue with vendor `install' (even GNU) is that you can't
897bf2eeab3Smrg# specify the program used to strip binaries.  This is especially
898bf2eeab3Smrg# annoying in cross-compiling environments, where the build's strip
899bf2eeab3Smrg# is unlikely to handle the host's binaries.
900bf2eeab3Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
901bf2eeab3Smrg# always use install-sh in `make install-strip', and initialize
902bf2eeab3Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
903bf2eeab3SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
904bf2eeab3Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
905bf2eeab3Smrg# Installed binaries are usually stripped using `strip' when the user
906bf2eeab3Smrg# run `make install-strip'.  However `strip' might not be the right
907bf2eeab3Smrg# tool to use in cross-compilation environments, therefore Automake
908bf2eeab3Smrg# will honor the `STRIP' environment variable to overrule this program.
909bf2eeab3Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
910bf2eeab3Smrgif test "$cross_compiling" != no; then
911bf2eeab3Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
91214c0a534Smrgfi
913bf2eeab3SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
914bf2eeab3SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
91514c0a534Smrg
916bf2eeab3Smrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
917bf2eeab3Smrg#
918bf2eeab3Smrg# This file is free software; the Free Software Foundation
919bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it,
920bf2eeab3Smrg# with or without modifications, as long as this notice is preserved.
92114c0a534Smrg
922bf2eeab3Smrg# serial 2
92314c0a534Smrg
924bf2eeab3Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
925bf2eeab3Smrg# ---------------------------
926bf2eeab3Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
927bf2eeab3Smrg# This macro is traced by Automake.
928bf2eeab3SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
92914c0a534Smrg
930bf2eeab3Smrg# AM_SUBST_NOTMAKE(VARIABLE)
931bf2eeab3Smrg# ---------------------------
932bf2eeab3Smrg# Public sister of _AM_SUBST_NOTMAKE.
933bf2eeab3SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
93414c0a534Smrg
935bf2eeab3Smrg# Check how to create a tarball.                            -*- Autoconf -*-
936bf2eeab3Smrg
937bf2eeab3Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
93814c0a534Smrg#
93914c0a534Smrg# This file is free software; the Free Software Foundation
94014c0a534Smrg# gives unlimited permission to copy and/or distribute it,
94114c0a534Smrg# with or without modifications, as long as this notice is preserved.
94214c0a534Smrg
943bf2eeab3Smrg# serial 2
944bf2eeab3Smrg
945bf2eeab3Smrg# _AM_PROG_TAR(FORMAT)
946bf2eeab3Smrg# --------------------
947bf2eeab3Smrg# Check how to create a tarball in format FORMAT.
948bf2eeab3Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
949bf2eeab3Smrg#
950bf2eeab3Smrg# Substitute a variable $(am__tar) that is a command
951bf2eeab3Smrg# writing to stdout a FORMAT-tarball containing the directory
952bf2eeab3Smrg# $tardir.
953bf2eeab3Smrg#     tardir=directory && $(am__tar) > result.tar
954bf2eeab3Smrg#
955bf2eeab3Smrg# Substitute a variable $(am__untar) that extract such
956bf2eeab3Smrg# a tarball read from stdin.
957bf2eeab3Smrg#     $(am__untar) < result.tar
958bf2eeab3SmrgAC_DEFUN([_AM_PROG_TAR],
959bf2eeab3Smrg[# Always define AMTAR for backward compatibility.
960bf2eeab3SmrgAM_MISSING_PROG([AMTAR], [tar])
961bf2eeab3Smrgm4_if([$1], [v7],
962bf2eeab3Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
963bf2eeab3Smrg     [m4_case([$1], [ustar],, [pax],,
964bf2eeab3Smrg              [m4_fatal([Unknown tar format])])
965bf2eeab3SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
966bf2eeab3Smrg# Loop over all known methods to create a tar archive until one works.
967bf2eeab3Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
968bf2eeab3Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
969bf2eeab3Smrg# Do not fold the above two line into one, because Tru64 sh and
970bf2eeab3Smrg# Solaris sh will not grok spaces in the rhs of `-'.
971bf2eeab3Smrgfor _am_tool in $_am_tools
972bf2eeab3Smrgdo
973bf2eeab3Smrg  case $_am_tool in
974bf2eeab3Smrg  gnutar)
975bf2eeab3Smrg    for _am_tar in tar gnutar gtar;
976bf2eeab3Smrg    do
977bf2eeab3Smrg      AM_RUN_LOG([$_am_tar --version]) && break
978bf2eeab3Smrg    done
979bf2eeab3Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
980bf2eeab3Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
981bf2eeab3Smrg    am__untar="$_am_tar -xf -"
982bf2eeab3Smrg    ;;
983bf2eeab3Smrg  plaintar)
984bf2eeab3Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
985bf2eeab3Smrg    # ustar tarball either.
986bf2eeab3Smrg    (tar --version) >/dev/null 2>&1 && continue
987bf2eeab3Smrg    am__tar='tar chf - "$$tardir"'
988bf2eeab3Smrg    am__tar_='tar chf - "$tardir"'
989bf2eeab3Smrg    am__untar='tar xf -'
990bf2eeab3Smrg    ;;
991bf2eeab3Smrg  pax)
992bf2eeab3Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
993bf2eeab3Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
994bf2eeab3Smrg    am__untar='pax -r'
995bf2eeab3Smrg    ;;
996bf2eeab3Smrg  cpio)
997bf2eeab3Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
998bf2eeab3Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
999bf2eeab3Smrg    am__untar='cpio -i -H $1 -d'
1000bf2eeab3Smrg    ;;
1001bf2eeab3Smrg  none)
1002bf2eeab3Smrg    am__tar=false
1003bf2eeab3Smrg    am__tar_=false
1004bf2eeab3Smrg    am__untar=false
1005bf2eeab3Smrg    ;;
1006bf2eeab3Smrg  esac
1007bf2eeab3Smrg
1008bf2eeab3Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
1009bf2eeab3Smrg  # and am__untar set.
1010bf2eeab3Smrg  test -n "${am_cv_prog_tar_$1}" && break
101114c0a534Smrg
1012bf2eeab3Smrg  # tar/untar a dummy directory, and stop if the command works
1013bf2eeab3Smrg  rm -rf conftest.dir
1014bf2eeab3Smrg  mkdir conftest.dir
1015bf2eeab3Smrg  echo GrepMe > conftest.dir/file
1016bf2eeab3Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1017bf2eeab3Smrg  rm -rf conftest.dir
1018bf2eeab3Smrg  if test -s conftest.tar; then
1019bf2eeab3Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
1020bf2eeab3Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1021bf2eeab3Smrg  fi
1022bf2eeab3Smrgdone
1023bf2eeab3Smrgrm -rf conftest.dir
102414c0a534Smrg
1025bf2eeab3SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1026bf2eeab3SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
1027bf2eeab3SmrgAC_SUBST([am__tar])
1028bf2eeab3SmrgAC_SUBST([am__untar])
1029bf2eeab3Smrg]) # _AM_PROG_TAR
103014c0a534Smrg
1031bf2eeab3Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1032bf2eeab3Smrgdnl
1033bf2eeab3Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
1034bf2eeab3Smrgdnl 
1035bf2eeab3Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
1036bf2eeab3Smrgdnl copy of this software and associated documentation files (the
1037bf2eeab3Smrgdnl "Software"), to deal in the Software without restriction, including
1038bf2eeab3Smrgdnl without limitation the rights to use, copy, modify, merge, publish,
1039bf2eeab3Smrgdnl distribute, and/or sell copies of the Software, and to permit persons
1040bf2eeab3Smrgdnl to whom the Software is furnished to do so, provided that the above
1041bf2eeab3Smrgdnl copyright notice(s) and this permission notice appear in all copies of
1042bf2eeab3Smrgdnl the Software and that both the above copyright notice(s) and this
1043bf2eeab3Smrgdnl permission notice appear in supporting documentation.
1044bf2eeab3Smrgdnl
1045bf2eeab3Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1046bf2eeab3Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1047bf2eeab3Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
1048bf2eeab3Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
1049bf2eeab3Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
1050bf2eeab3Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
1051bf2eeab3Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
1052bf2eeab3Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
1053bf2eeab3Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1054bf2eeab3Smrgdnl
1055bf2eeab3Smrgdnl Except as contained in this notice, the name of a copyright holder
1056bf2eeab3Smrgdnl shall not be used in advertising or otherwise to promote the sale, use
1057bf2eeab3Smrgdnl or other dealings in this Software without prior written authorization
1058bf2eeab3Smrgdnl of the copyright holder.
105914c0a534Smrg
1060bf2eeab3Smrg# XORG_MACROS_VERSION(required-version)
1061bf2eeab3Smrg# -------------------------------------
1062bf2eeab3Smrg# Minimum version: 1.1.0
106314c0a534Smrg#
1064bf2eeab3Smrg# If you're using a macro added in Version 1.1 or newer, include this in
1065bf2eeab3Smrg# your configure.ac with the minimum required version, such as:
1066bf2eeab3Smrg# XORG_MACROS_VERSION(1.1)
106714c0a534Smrg#
1068bf2eeab3Smrg# To ensure that this macro is defined, also add:
1069bf2eeab3Smrg# m4_ifndef([XORG_MACROS_VERSION],
1070bf2eeab3Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
107114c0a534Smrg#
107214c0a534Smrg#
1073bf2eeab3Smrg# See the "minimum version" comment for each macro you use to see what 
1074bf2eeab3Smrg# version you require.
1075bf2eeab3Smrgm4_defun([XORG_MACROS_VERSION],[
1076bf2eeab3Smrgm4_define([vers_have], [1.3.0])
1077bf2eeab3Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1078bf2eeab3Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1079bf2eeab3Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
1080bf2eeab3Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1081bf2eeab3Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
1082bf2eeab3Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1083bf2eeab3Smrgm4_undefine([vers_have])
1084bf2eeab3Smrgm4_undefine([maj_have])
1085bf2eeab3Smrgm4_undefine([maj_needed])
1086bf2eeab3Smrg]) # XORG_MACROS_VERSION
108714c0a534Smrg
1088bf2eeab3Smrg# XORG_PROG_RAWCPP()
1089bf2eeab3Smrg# ------------------
1090bf2eeab3Smrg# Minimum version: 1.0.0
109114c0a534Smrg#
1092bf2eeab3Smrg# Find cpp program and necessary flags for use in pre-processing text files
1093bf2eeab3Smrg# such as man pages and config files
1094bf2eeab3SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
1095bf2eeab3SmrgAC_REQUIRE([AC_PROG_CPP])
1096bf2eeab3SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
1097bf2eeab3Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
109814c0a534Smrg
1099bf2eeab3Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
1100bf2eeab3Smrg# which is not the best choice for supporting other OS'es, but covers most
1101bf2eeab3Smrg# of the ones we need for now.
1102bf2eeab3SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
1103bf2eeab3SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
1104bf2eeab3Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1105bf2eeab3Smrg	AC_MSG_RESULT([no])
110614c0a534Smrgelse
1107bf2eeab3Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1108bf2eeab3Smrg		RAWCPPFLAGS=-undef
1109bf2eeab3Smrg		AC_MSG_RESULT([yes])
1110bf2eeab3Smrg	# under Cygwin unix is still defined even with -undef
1111bf2eeab3Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1112bf2eeab3Smrg		RAWCPPFLAGS="-undef -ansi"
1113bf2eeab3Smrg		AC_MSG_RESULT([yes, with -ansi])
1114bf2eeab3Smrg	else
1115bf2eeab3Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1116bf2eeab3Smrg	fi
111714c0a534Smrgfi
1118bf2eeab3Smrgrm -f conftest.$ac_ext
111914c0a534Smrg
1120bf2eeab3SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
1121bf2eeab3SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
1122bf2eeab3Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1123bf2eeab3Smrg	AC_MSG_RESULT([no])
1124bf2eeab3Smrgelse
1125bf2eeab3Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1126bf2eeab3Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1127bf2eeab3Smrg		AC_MSG_RESULT([yes])
1128bf2eeab3Smrg	else
1129bf2eeab3Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1130bf2eeab3Smrg	fi
1131bf2eeab3Smrgfi
1132bf2eeab3Smrgrm -f conftest.$ac_ext
1133bf2eeab3SmrgAC_SUBST(RAWCPPFLAGS)
1134bf2eeab3Smrg]) # XORG_PROG_RAWCPP
113514c0a534Smrg
1136bf2eeab3Smrg# XORG_MANPAGE_SECTIONS()
1137bf2eeab3Smrg# -----------------------
1138bf2eeab3Smrg# Minimum version: 1.0.0
113914c0a534Smrg#
1140bf2eeab3Smrg# Determine which sections man pages go in for the different man page types
1141bf2eeab3Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1142bf2eeab3Smrg# Not sure if there's any better way than just hardcoding by OS name.
1143bf2eeab3Smrg# Override default settings by setting environment variables
114414c0a534Smrg
1145bf2eeab3SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1146bf2eeab3SmrgAC_REQUIRE([AC_CANONICAL_HOST])
114714c0a534Smrg
1148bf2eeab3Smrgif test x$APP_MAN_SUFFIX = x    ; then
1149bf2eeab3Smrg    APP_MAN_SUFFIX=1
1150bf2eeab3Smrgfi
1151bf2eeab3Smrgif test x$APP_MAN_DIR = x    ; then
1152bf2eeab3Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1153bf2eeab3Smrgfi
115414c0a534Smrg
1155bf2eeab3Smrgif test x$LIB_MAN_SUFFIX = x    ; then
1156bf2eeab3Smrg    LIB_MAN_SUFFIX=3
1157bf2eeab3Smrgfi
1158bf2eeab3Smrgif test x$LIB_MAN_DIR = x    ; then
1159bf2eeab3Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
116014c0a534Smrgfi
116114c0a534Smrg
1162bf2eeab3Smrgif test x$FILE_MAN_SUFFIX = x    ; then
1163bf2eeab3Smrg    case $host_os in
1164bf2eeab3Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
1165bf2eeab3Smrg	*)		FILE_MAN_SUFFIX=5  ;;
1166bf2eeab3Smrg    esac
1167bf2eeab3Smrgfi
1168bf2eeab3Smrgif test x$FILE_MAN_DIR = x    ; then
1169bf2eeab3Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1170bf2eeab3Smrgfi
117114c0a534Smrg
1172bf2eeab3Smrgif test x$MISC_MAN_SUFFIX = x    ; then
1173bf2eeab3Smrg    case $host_os in
1174bf2eeab3Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
1175bf2eeab3Smrg	*)		MISC_MAN_SUFFIX=7  ;;
1176bf2eeab3Smrg    esac
1177bf2eeab3Smrgfi
1178bf2eeab3Smrgif test x$MISC_MAN_DIR = x    ; then
1179bf2eeab3Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1180bf2eeab3Smrgfi
118114c0a534Smrg
1182bf2eeab3Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
1183bf2eeab3Smrg    case $host_os in
1184bf2eeab3Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
1185bf2eeab3Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
1186bf2eeab3Smrg    esac
1187bf2eeab3Smrgfi
1188bf2eeab3Smrgif test x$DRIVER_MAN_DIR = x    ; then
1189bf2eeab3Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1190bf2eeab3Smrgfi
119114c0a534Smrg
1192bf2eeab3Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
1193bf2eeab3Smrg    case $host_os in
1194bf2eeab3Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
1195bf2eeab3Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
1196bf2eeab3Smrg    esac
1197bf2eeab3Smrgfi
1198bf2eeab3Smrgif test x$ADMIN_MAN_DIR = x    ; then
1199bf2eeab3Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
120014c0a534Smrgfi
120114c0a534Smrg
120214c0a534Smrg
1203bf2eeab3SmrgAC_SUBST([APP_MAN_SUFFIX])
1204bf2eeab3SmrgAC_SUBST([LIB_MAN_SUFFIX])
1205bf2eeab3SmrgAC_SUBST([FILE_MAN_SUFFIX])
1206bf2eeab3SmrgAC_SUBST([MISC_MAN_SUFFIX])
1207bf2eeab3SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
1208bf2eeab3SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
1209bf2eeab3SmrgAC_SUBST([APP_MAN_DIR])
1210bf2eeab3SmrgAC_SUBST([LIB_MAN_DIR])
1211bf2eeab3SmrgAC_SUBST([FILE_MAN_DIR])
1212bf2eeab3SmrgAC_SUBST([MISC_MAN_DIR])
1213bf2eeab3SmrgAC_SUBST([DRIVER_MAN_DIR])
1214bf2eeab3SmrgAC_SUBST([ADMIN_MAN_DIR])
1215bf2eeab3Smrg]) # XORG_MANPAGE_SECTIONS
1216bf2eeab3Smrg
1217bf2eeab3Smrg# XORG_CHECK_LINUXDOC
1218bf2eeab3Smrg# -------------------
1219bf2eeab3Smrg# Minimum version: 1.0.0
122014c0a534Smrg#
1221bf2eeab3Smrg# Defines the variable MAKE_TEXT if the necessary tools and
1222bf2eeab3Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1223bf2eeab3Smrg# Whether or not the necessary tools and files are found can be checked
1224bf2eeab3Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1225bf2eeab3SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
1226bf2eeab3Smrgif test x$XORG_SGML_PATH = x ; then
1227bf2eeab3Smrg    XORG_SGML_PATH=$prefix/share/sgml
1228bf2eeab3Smrgfi
1229bf2eeab3SmrgHAVE_DEFS_ENT=
123014c0a534Smrg
1231bf2eeab3Smrgif test x"$cross_compiling" = x"yes" ; then
1232bf2eeab3Smrg  HAVE_DEFS_ENT=no
1233bf2eeab3Smrgelse
1234bf2eeab3Smrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1235bf2eeab3Smrgfi
123614c0a534Smrg
1237bf2eeab3SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
1238bf2eeab3SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
123914c0a534Smrg
1240bf2eeab3SmrgAC_MSG_CHECKING([Whether to build documentation])
124114c0a534Smrg
1242bf2eeab3Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
1243bf2eeab3Smrg   BUILDDOC=yes
1244bf2eeab3Smrgelse
1245bf2eeab3Smrg   BUILDDOC=no
1246bf2eeab3Smrgfi
124714c0a534Smrg
1248bf2eeab3SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
124914c0a534Smrg
1250bf2eeab3SmrgAC_MSG_RESULT([$BUILDDOC])
125114c0a534Smrg
1252bf2eeab3SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
125314c0a534Smrg
1254bf2eeab3Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
1255bf2eeab3Smrg   BUILDPDFDOC=yes
1256bf2eeab3Smrgelse
1257bf2eeab3Smrg   BUILDPDFDOC=no
1258bf2eeab3Smrgfi
125914c0a534Smrg
1260bf2eeab3SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
126114c0a534Smrg
1262bf2eeab3SmrgAC_MSG_RESULT([$BUILDPDFDOC])
126314c0a534Smrg
1264bf2eeab3SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
1265bf2eeab3SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1266bf2eeab3SmrgMAKE_PDF="$PS2PDF"
1267bf2eeab3SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
126814c0a534Smrg
1269bf2eeab3SmrgAC_SUBST(MAKE_TEXT)
1270bf2eeab3SmrgAC_SUBST(MAKE_PS)
1271bf2eeab3SmrgAC_SUBST(MAKE_PDF)
1272bf2eeab3SmrgAC_SUBST(MAKE_HTML)
1273bf2eeab3Smrg]) # XORG_CHECK_LINUXDOC
1274bf2eeab3Smrg
1275bf2eeab3Smrg# XORG_CHECK_DOCBOOK
1276bf2eeab3Smrg# -------------------
1277bf2eeab3Smrg# Minimum version: 1.0.0
1278bf2eeab3Smrg#
1279bf2eeab3Smrg# Checks for the ability to build output formats from SGML DocBook source.
1280bf2eeab3Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1281bf2eeab3Smrg# indicates whether the necessary tools and files are found and, if set,
1282bf2eeab3Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1283bf2eeab3SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
1284bf2eeab3Smrgif test x$XORG_SGML_PATH = x ; then
1285bf2eeab3Smrg    XORG_SGML_PATH=$prefix/share/sgml
128614c0a534Smrgfi
1287bf2eeab3SmrgHAVE_DEFS_ENT=
1288bf2eeab3SmrgBUILDTXTDOC=no
1289bf2eeab3SmrgBUILDPDFDOC=no
1290bf2eeab3SmrgBUILDPSDOC=no
1291bf2eeab3SmrgBUILDHTMLDOC=no
1292bf2eeab3Smrg
1293bf2eeab3SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1294bf2eeab3Smrg
1295bf2eeab3SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
1296bf2eeab3SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1297bf2eeab3SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
1298bf2eeab3SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1299bf2eeab3Smrg
1300bf2eeab3SmrgAC_MSG_CHECKING([Whether to build text documentation])
1301bf2eeab3Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
1302bf2eeab3Smrg   test x$BUILD_TXTDOC != xno; then
1303bf2eeab3Smrg	BUILDTXTDOC=yes
1304bf2eeab3Smrgfi
1305bf2eeab3SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1306bf2eeab3SmrgAC_MSG_RESULT([$BUILDTXTDOC])
130714c0a534Smrg
1308bf2eeab3SmrgAC_MSG_CHECKING([Whether to build PDF documentation])
1309bf2eeab3Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
1310bf2eeab3Smrg   test x$BUILD_PDFDOC != xno; then
1311bf2eeab3Smrg	BUILDPDFDOC=yes
131214c0a534Smrgfi
1313bf2eeab3SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1314bf2eeab3SmrgAC_MSG_RESULT([$BUILDPDFDOC])
131514c0a534Smrg
1316bf2eeab3SmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
1317bf2eeab3Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
1318bf2eeab3Smrg   test x$BUILD_PSDOC != xno; then
1319bf2eeab3Smrg	BUILDPSDOC=yes
1320bf2eeab3Smrgfi
1321bf2eeab3SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1322bf2eeab3SmrgAC_MSG_RESULT([$BUILDPSDOC])
132314c0a534Smrg
1324bf2eeab3SmrgAC_MSG_CHECKING([Whether to build HTML documentation])
1325bf2eeab3Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
1326bf2eeab3Smrg   test x$BUILD_HTMLDOC != xno; then
1327bf2eeab3Smrg	BUILDHTMLDOC=yes
1328bf2eeab3Smrgfi
1329bf2eeab3SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1330bf2eeab3SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
133114c0a534Smrg
1332bf2eeab3SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1333bf2eeab3SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1334bf2eeab3SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1335bf2eeab3SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
133614c0a534Smrg
1337bf2eeab3SmrgAC_SUBST(MAKE_TEXT)
1338bf2eeab3SmrgAC_SUBST(MAKE_PS)
1339bf2eeab3SmrgAC_SUBST(MAKE_PDF)
1340bf2eeab3SmrgAC_SUBST(MAKE_HTML)
1341bf2eeab3Smrg]) # XORG_CHECK_DOCBOOK
134214c0a534Smrg
1343bf2eeab3Smrg# XORG_CHECK_MALLOC_ZERO
1344bf2eeab3Smrg# ----------------------
1345bf2eeab3Smrg# Minimum version: 1.0.0
1346bf2eeab3Smrg#
1347bf2eeab3Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1348bf2eeab3Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1349bf2eeab3Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1350bf2eeab3SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1351bf2eeab3SmrgAC_ARG_ENABLE(malloc0returnsnull,
1352bf2eeab3Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
1353bf2eeab3Smrg		       [malloc(0) returns NULL (default: auto)]),
1354bf2eeab3Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1355bf2eeab3Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
135614c0a534Smrg
1357bf2eeab3SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1358bf2eeab3Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1359bf2eeab3Smrg	AC_RUN_IFELSE([
1360bf2eeab3Smrgchar *malloc();
1361bf2eeab3Smrgchar *realloc();
1362bf2eeab3Smrgchar *calloc();
1363bf2eeab3Smrgmain() {
1364bf2eeab3Smrg    char *m0, *r0, *c0, *p;
1365bf2eeab3Smrg    m0 = malloc(0);
1366bf2eeab3Smrg    p = malloc(10);
1367bf2eeab3Smrg    r0 = realloc(p,0);
1368bf2eeab3Smrg    c0 = calloc(0);
1369bf2eeab3Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
1370bf2eeab3Smrg}],
1371bf2eeab3Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
1372bf2eeab3Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
1373bf2eeab3Smrgfi
1374bf2eeab3SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
137514c0a534Smrg
1376bf2eeab3Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1377bf2eeab3Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1378bf2eeab3Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1379bf2eeab3Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1380bf2eeab3Smrgelse
1381bf2eeab3Smrg	MALLOC_ZERO_CFLAGS=""
1382bf2eeab3Smrg	XMALLOC_ZERO_CFLAGS=""
1383bf2eeab3Smrg	XTMALLOC_ZERO_CFLAGS=""
1384bf2eeab3Smrgfi
138514c0a534Smrg
1386bf2eeab3SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1387bf2eeab3SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1388bf2eeab3SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1389bf2eeab3Smrg]) # XORG_CHECK_MALLOC_ZERO
139014c0a534Smrg
1391bf2eeab3Smrg# XORG_WITH_LINT()
1392bf2eeab3Smrg# ----------------
1393bf2eeab3Smrg# Minimum version: 1.1.0
139414c0a534Smrg#
1395bf2eeab3Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint
1396bf2eeab3Smrg# is specified.   (Use --with-lint=sparse for sparse.)
1397bf2eeab3Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
1398bf2eeab3Smrg# Sets $LINT_FLAGS to flags to pass to source checker
1399bf2eeab3Smrg# Sets LINT automake conditional if enabled (default: disabled)
1400bf2eeab3Smrg#
1401bf2eeab3SmrgAC_DEFUN([XORG_WITH_LINT],[
1402bf2eeab3Smrg
1403bf2eeab3Smrg# Allow checking code with lint, sparse, etc.
1404bf2eeab3SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1405bf2eeab3Smrg		[Use a lint-style source code checker (default: disabled)])],
1406bf2eeab3Smrg		[use_lint=$withval], [use_lint=no])
1407bf2eeab3Smrgif test "x$use_lint" = "xyes" ; then
1408bf2eeab3Smrg	LINT="lint"
140914c0a534Smrgelse
1410bf2eeab3Smrg	LINT="$use_lint"
1411bf2eeab3Smrgfi
1412bf2eeab3Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
1413bf2eeab3Smrg    case $LINT in
1414bf2eeab3Smrg	lint|*/lint)
1415bf2eeab3Smrg	    case $host_os in
1416bf2eeab3Smrg		solaris*)
1417bf2eeab3Smrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1418bf2eeab3Smrg			;;
1419bf2eeab3Smrg	    esac
1420bf2eeab3Smrg	    ;;
1421bf2eeab3Smrg    esac
142214c0a534Smrgfi
142314c0a534Smrg
1424bf2eeab3SmrgAC_SUBST(LINT)
1425bf2eeab3SmrgAC_SUBST(LINT_FLAGS)
1426bf2eeab3SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
142714c0a534Smrg
1428bf2eeab3Smrg]) # XORG_WITH_LINT
142914c0a534Smrg
1430bf2eeab3Smrg# XORG_LINT_LIBRARY(LIBNAME)
1431bf2eeab3Smrg# --------------------------
1432bf2eeab3Smrg# Minimum version: 1.1.0
1433bf2eeab3Smrg#
1434bf2eeab3Smrg# Sets up flags for building lint libraries for checking programs that call
1435bf2eeab3Smrg# functions in the library.
1436bf2eeab3Smrg# Disabled by default, enable with --enable-lint-library
1437bf2eeab3Smrg# Sets: 
1438bf2eeab3Smrg#	@LINTLIB@		- name of lint library file to make
1439bf2eeab3Smrg#	MAKE_LINT_LIB		- automake conditional
1440bf2eeab3Smrg#
144114c0a534Smrg
1442bf2eeab3SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
1443bf2eeab3SmrgAC_REQUIRE([XORG_WITH_LINT])
1444bf2eeab3Smrg# Build lint "library" for more indepth checks of programs calling this library
1445bf2eeab3SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
1446bf2eeab3Smrg	[Create lint library (default: disabled)])],
1447bf2eeab3Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
1448bf2eeab3Smrgif test "x$make_lint_lib" != "xno" ; then
1449bf2eeab3Smrg	if test "x$LINT" = "xno" ; then
1450bf2eeab3Smrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
1451bf2eeab3Smrg	fi
1452bf2eeab3Smrg	if test "x$make_lint_lib" = "xyes" ; then
1453bf2eeab3Smrg		LINTLIB=llib-l$1.ln
1454bf2eeab3Smrg	else
1455bf2eeab3Smrg		LINTLIB=$make_lint_lib
1456bf2eeab3Smrg	fi
1457bf2eeab3Smrgfi
1458bf2eeab3SmrgAC_SUBST(LINTLIB)
1459bf2eeab3SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
146014c0a534Smrg
1461bf2eeab3Smrg]) # XORG_LINT_LIBRARY
146214c0a534Smrg
1463bf2eeab3Smrg# XORG_CWARNFLAGS
1464bf2eeab3Smrg# ---------------
1465bf2eeab3Smrg# Minimum version: 1.2.0
1466bf2eeab3Smrg#
1467bf2eeab3Smrg# Defines CWARNFLAGS to enable C compiler warnings.
1468bf2eeab3Smrg#
1469bf2eeab3SmrgAC_DEFUN([XORG_CWARNFLAGS], [
1470bf2eeab3SmrgAC_REQUIRE([AC_PROG_CC])
1471bf2eeab3Smrgif  test "x$GCC" = xyes ; then
1472bf2eeab3Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
1473bf2eeab3Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
1474bf2eeab3Smrg-Wbad-function-cast"
1475bf2eeab3Smrg    case `$CC -dumpversion` in
1476bf2eeab3Smrg    3.4.* | 4.*)
1477bf2eeab3Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
1478bf2eeab3Smrg	;;
1479bf2eeab3Smrg    esac
1480bf2eeab3Smrgelse
1481bf2eeab3Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1482bf2eeab3Smrg    if test "x$SUNCC" = "xyes"; then
1483bf2eeab3Smrg	CWARNFLAGS="-v"
1484bf2eeab3Smrg    fi
1485bf2eeab3Smrgfi
1486bf2eeab3SmrgAC_SUBST(CWARNFLAGS)
1487bf2eeab3Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
1488bf2eeab3Smrg]) # XORG_CWARNFLAGS
148914c0a534Smrg
1490bf2eeab3Smrg# XORG_STRICT_OPTION
1491bf2eeab3Smrg# -----------------------
1492bf2eeab3Smrg# Minimum version: 1.3.0
149314c0a534Smrg#
1494bf2eeab3Smrg# Add configure option to enable strict compilation
1495bf2eeab3SmrgAC_DEFUN([XORG_STRICT_OPTION], [
1496bf2eeab3SmrgAC_REQUIRE([AC_PROG_CC])
1497bf2eeab3SmrgAC_REQUIRE([AC_PROG_CC_C99])
1498bf2eeab3SmrgAC_REQUIRE([XORG_CWARNFLAGS])
1499bf2eeab3Smrg
1500bf2eeab3SmrgAC_ARG_ENABLE(strict-compilation,
1501bf2eeab3Smrg			  AS_HELP_STRING([--enable-strict-compilation],
1502bf2eeab3Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
1503bf2eeab3Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
1504bf2eeab3Smrgif test "x$STRICT_COMPILE" = "xyes"; then
1505bf2eeab3Smrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1506bf2eeab3Smrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
1507bf2eeab3Smrg	if test "x$GCC" = xyes ; then
1508bf2eeab3Smrg		STRICT_CFLAGS="-pedantic -Werror"
1509bf2eeab3Smrg	elif test "x$SUNCC" = "xyes"; then
1510bf2eeab3Smrg		STRICT_CFLAGS="-errwarn"
1511bf2eeab3Smrg    elif test "x$INTELCC" = "xyes"; then
1512bf2eeab3Smrg		STRICT_CFLAGS="-Werror"
1513bf2eeab3Smrg	fi
1514bf2eeab3Smrgfi
1515bf2eeab3SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
1516bf2eeab3SmrgAC_SUBST([CWARNFLAGS])
1517bf2eeab3Smrg]) # XORG_STRICT_OPTION
151814c0a534Smrg
1519bf2eeab3Smrg# XORG_DEFAULT_OPTIONS
1520bf2eeab3Smrg# --------------------
1521bf2eeab3Smrg# Minimum version: 1.3.0
1522bf2eeab3Smrg#
1523bf2eeab3Smrg# Defines default options for X.Org modules.
1524bf2eeab3Smrg#
1525bf2eeab3SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
1526bf2eeab3SmrgXORG_CWARNFLAGS
1527bf2eeab3SmrgXORG_STRICT_OPTION
1528bf2eeab3SmrgXORG_RELEASE_VERSION
1529bf2eeab3SmrgXORG_CHANGELOG
1530bf2eeab3SmrgXORG_MANPAGE_SECTIONS
1531bf2eeab3Smrg]) # XORG_DEFAULT_OPTIONS
1532bf2eeab3Smrgdnl Copyright 2005 Red Hat, Inc
1533bf2eeab3Smrgdnl
1534bf2eeab3Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1535bf2eeab3Smrgdnl documentation for any purpose is hereby granted without fee, provided that
1536bf2eeab3Smrgdnl the above copyright notice appear in all copies and that both that
1537bf2eeab3Smrgdnl copyright notice and this permission notice appear in supporting
1538bf2eeab3Smrgdnl documentation.
1539bf2eeab3Smrgdnl
1540bf2eeab3Smrgdnl The above copyright notice and this permission notice shall be included
1541bf2eeab3Smrgdnl in all copies or substantial portions of the Software.
1542bf2eeab3Smrgdnl
1543bf2eeab3Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1544bf2eeab3Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1545bf2eeab3Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1546bf2eeab3Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1547bf2eeab3Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1548bf2eeab3Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1549bf2eeab3Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
1550bf2eeab3Smrgdnl
1551bf2eeab3Smrgdnl Except as contained in this notice, the name of the copyright holders shall
1552bf2eeab3Smrgdnl not be used in advertising or otherwise to promote the sale, use or
1553bf2eeab3Smrgdnl other dealings in this Software without prior written authorization
1554bf2eeab3Smrgdnl from the copyright holders.
1555bf2eeab3Smrgdnl
155614c0a534Smrg
1557bf2eeab3Smrg# XORG_RELEASE_VERSION
1558bf2eeab3Smrg# --------------------
1559bf2eeab3Smrg# Adds --with/without-release-string and changes the PACKAGE and
1560bf2eeab3Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
1561bf2eeab3Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
1562bf2eeab3Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1563bf2eeab3Smrg 
1564bf2eeab3SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
1565bf2eeab3Smrg	AC_ARG_WITH(release-version,
1566bf2eeab3Smrg			AS_HELP_STRING([--with-release-version=STRING],
1567bf2eeab3Smrg				[Use release version string in package name]),
1568bf2eeab3Smrg			[RELEASE_VERSION="$withval"],
1569bf2eeab3Smrg			[RELEASE_VERSION=""])
1570bf2eeab3Smrg	if test "x$RELEASE_VERSION" != "x"; then
1571bf2eeab3Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
1572bf2eeab3Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
1573bf2eeab3Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
1574bf2eeab3Smrg	fi
1575bf2eeab3Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1576bf2eeab3Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
1577bf2eeab3Smrg		[Major version of this package])
1578bf2eeab3Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
1579bf2eeab3Smrg	if test "x$PVM" = "x"; then
1580bf2eeab3Smrg		PVM="0"
1581bf2eeab3Smrg	fi
1582bf2eeab3Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
1583bf2eeab3Smrg		[$PVM],
1584bf2eeab3Smrg		[Minor version of this package])
1585bf2eeab3Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
1586bf2eeab3Smrg	if test "x$PVP" = "x"; then
1587bf2eeab3Smrg		PVP="0"
1588bf2eeab3Smrg	fi
1589bf2eeab3Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1590bf2eeab3Smrg		[$PVP],
1591bf2eeab3Smrg		[Patch version of this package])
159214c0a534Smrg])
159314c0a534Smrg
1594bf2eeab3Smrg# XORG_CHANGELOG()
1595bf2eeab3Smrg# ----------------
1596bf2eeab3Smrg# Minimum version: 1.2.0
1597bf2eeab3Smrg#
1598bf2eeab3Smrg# Defines the variable CHANGELOG_CMD as the command to generate
1599bf2eeab3Smrg# ChangeLog from git.
1600bf2eeab3Smrg#
1601bf2eeab3Smrg# Arrange that distcleancheck ignores ChangeLog left over by distclean.
1602bf2eeab3Smrg#
1603bf2eeab3SmrgAC_DEFUN([XORG_CHANGELOG], [
1604bf2eeab3SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
1605bf2eeab3Smrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
1606bf2eeab3Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
1607bf2eeab3SmrgAC_SUBST([CHANGELOG_CMD])
1608bf2eeab3SmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
1609bf2eeab3Smrg]) # XORG_CHANGELOG
161014c0a534Smrg
1611bf2eeab3Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
1612bf2eeab3Smrg# 
1613bf2eeab3Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
161414c0a534Smrg#
1615bf2eeab3Smrg# This program is free software; you can redistribute it and/or modify
1616bf2eeab3Smrg# it under the terms of the GNU General Public License as published by
1617bf2eeab3Smrg# the Free Software Foundation; either version 2 of the License, or
1618bf2eeab3Smrg# (at your option) any later version.
1619bf2eeab3Smrg#
1620bf2eeab3Smrg# This program is distributed in the hope that it will be useful, but
1621bf2eeab3Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
1622bf2eeab3Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1623bf2eeab3Smrg# General Public License for more details.
1624bf2eeab3Smrg#
1625bf2eeab3Smrg# You should have received a copy of the GNU General Public License
1626bf2eeab3Smrg# along with this program; if not, write to the Free Software
1627bf2eeab3Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1628bf2eeab3Smrg#
1629bf2eeab3Smrg# As a special exception to the GNU General Public License, if you
1630bf2eeab3Smrg# distribute this file as part of a program that contains a
1631bf2eeab3Smrg# configuration script generated by Autoconf, you may include it under
1632bf2eeab3Smrg# the same distribution terms that you use for the rest of that program.
163314c0a534Smrg
1634bf2eeab3Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
1635bf2eeab3Smrg# ----------------------------------
1636bf2eeab3SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
1637bf2eeab3Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1638bf2eeab3Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
1639bf2eeab3SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
1640bf2eeab3Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1641bf2eeab3Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1642bf2eeab3Smrgfi
1643bf2eeab3Smrgif test -n "$PKG_CONFIG"; then
1644bf2eeab3Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
1645bf2eeab3Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1646bf2eeab3Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1647bf2eeab3Smrg		AC_MSG_RESULT([yes])
1648bf2eeab3Smrg	else
1649bf2eeab3Smrg		AC_MSG_RESULT([no])
1650bf2eeab3Smrg		PKG_CONFIG=""
1651bf2eeab3Smrg	fi
1652bf2eeab3Smrg		
1653bf2eeab3Smrgfi[]dnl
1654bf2eeab3Smrg])# PKG_PROG_PKG_CONFIG
165514c0a534Smrg
1656bf2eeab3Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1657bf2eeab3Smrg#
1658bf2eeab3Smrg# Check to see whether a particular set of modules exists.  Similar
1659bf2eeab3Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
1660bf2eeab3Smrg#
1661bf2eeab3Smrg#
1662bf2eeab3Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
1663bf2eeab3Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
1664bf2eeab3Smrg# PKG_CHECK_EXISTS manually
1665bf2eeab3Smrg# --------------------------------------------------------------
1666bf2eeab3SmrgAC_DEFUN([PKG_CHECK_EXISTS],
1667bf2eeab3Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1668bf2eeab3Smrgif test -n "$PKG_CONFIG" && \
1669bf2eeab3Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1670bf2eeab3Smrg  m4_ifval([$2], [$2], [:])
1671bf2eeab3Smrgm4_ifvaln([$3], [else
1672bf2eeab3Smrg  $3])dnl
1673bf2eeab3Smrgfi])
167414c0a534Smrg
167514c0a534Smrg
1676bf2eeab3Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1677bf2eeab3Smrg# ---------------------------------------------
1678bf2eeab3Smrgm4_define([_PKG_CONFIG],
1679bf2eeab3Smrg[if test -n "$$1"; then
1680bf2eeab3Smrg    pkg_cv_[]$1="$$1"
1681bf2eeab3Smrg elif test -n "$PKG_CONFIG"; then
1682bf2eeab3Smrg    PKG_CHECK_EXISTS([$3],
1683bf2eeab3Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
1684bf2eeab3Smrg		     [pkg_failed=yes])
1685bf2eeab3Smrg else
1686bf2eeab3Smrg    pkg_failed=untried
1687bf2eeab3Smrgfi[]dnl
1688bf2eeab3Smrg])# _PKG_CONFIG
1689bf2eeab3Smrg
1690bf2eeab3Smrg# _PKG_SHORT_ERRORS_SUPPORTED
1691bf2eeab3Smrg# -----------------------------
1692bf2eeab3SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1693bf2eeab3Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1694bf2eeab3Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1695bf2eeab3Smrg        _pkg_short_errors_supported=yes
169614c0a534Smrgelse
1697bf2eeab3Smrg        _pkg_short_errors_supported=no
1698bf2eeab3Smrgfi[]dnl
1699bf2eeab3Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
170014c0a534Smrg
170114c0a534Smrg
1702bf2eeab3Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1703bf2eeab3Smrg# [ACTION-IF-NOT-FOUND])
170414c0a534Smrg#
170514c0a534Smrg#
1706bf2eeab3Smrg# Note that if there is a possibility the first call to
1707bf2eeab3Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
1708bf2eeab3Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
170914c0a534Smrg#
171014c0a534Smrg#
1711bf2eeab3Smrg# --------------------------------------------------------------
1712bf2eeab3SmrgAC_DEFUN([PKG_CHECK_MODULES],
1713bf2eeab3Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1714bf2eeab3SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1715bf2eeab3SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
171614c0a534Smrg
1717bf2eeab3Smrgpkg_failed=no
1718bf2eeab3SmrgAC_MSG_CHECKING([for $1])
171914c0a534Smrg
1720bf2eeab3Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1721bf2eeab3Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
172214c0a534Smrg
1723bf2eeab3Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1724bf2eeab3Smrgand $1[]_LIBS to avoid the need to call pkg-config.
1725bf2eeab3SmrgSee the pkg-config man page for more details.])
172614c0a534Smrg
1727bf2eeab3Smrgif test $pkg_failed = yes; then
1728bf2eeab3Smrg        _PKG_SHORT_ERRORS_SUPPORTED
1729bf2eeab3Smrg        if test $_pkg_short_errors_supported = yes; then
1730bf2eeab3Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
1731bf2eeab3Smrg        else 
1732bf2eeab3Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
1733bf2eeab3Smrg        fi
1734bf2eeab3Smrg	# Put the nasty error message in config.log where it belongs
1735bf2eeab3Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
173614c0a534Smrg
1737bf2eeab3Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
1738bf2eeab3Smrg[Package requirements ($2) were not met:
173914c0a534Smrg
1740bf2eeab3Smrg$$1_PKG_ERRORS
174114c0a534Smrg
1742bf2eeab3SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
1743bf2eeab3Smrginstalled software in a non-standard prefix.
174414c0a534Smrg
1745bf2eeab3Smrg_PKG_TEXT
1746bf2eeab3Smrg])],
1747bf2eeab3Smrg		[AC_MSG_RESULT([no])
1748bf2eeab3Smrg                $4])
1749bf2eeab3Smrgelif test $pkg_failed = untried; then
1750bf2eeab3Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
1751bf2eeab3Smrg[The pkg-config script could not be found or is too old.  Make sure it
1752bf2eeab3Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
1753bf2eeab3Smrgpath to pkg-config.
175414c0a534Smrg
1755bf2eeab3Smrg_PKG_TEXT
175614c0a534Smrg
1757bf2eeab3SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
1758bf2eeab3Smrg		[$4])
175914c0a534Smrgelse
1760bf2eeab3Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1761bf2eeab3Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1762bf2eeab3Smrg        AC_MSG_RESULT([yes])
1763bf2eeab3Smrg	ifelse([$3], , :, [$3])
1764bf2eeab3Smrgfi[]dnl
1765bf2eeab3Smrg])# PKG_CHECK_MODULES
176614c0a534Smrg
1767