aclocal.m4 revision 14ddf674
114ddf674Smrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
2cacd992dSmrg
314ddf674Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
414ddf674Smrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5cacd992dSmrg# This file is free software; the Free Software Foundation
6cacd992dSmrg# gives unlimited permission to copy and/or distribute it,
7cacd992dSmrg# with or without modifications, as long as this notice is preserved.
8cacd992dSmrg
9cacd992dSmrg# This program is distributed in the hope that it will be useful,
10cacd992dSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11cacd992dSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12cacd992dSmrg# PARTICULAR PURPOSE.
13cacd992dSmrg
1414ddf674Smrgm4_ifndef([AC_AUTOCONF_VERSION],
1514ddf674Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1614ddf674Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],,
1714ddf674Smrg[m4_warning([this file was generated for autoconf 2.65.
1814ddf674SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
1914ddf674SmrgIf you have problems, you may need to regenerate the build system entirely.
2014ddf674SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21cacd992dSmrg
2214ddf674Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
2314ddf674Smrg#
2414ddf674Smrg# This file is free software; the Free Software Foundation
2514ddf674Smrg# gives unlimited permission to copy and/or distribute it,
2614ddf674Smrg# with or without modifications, as long as this notice is preserved.
27cacd992dSmrg
28cacd992dSmrg# AM_AUTOMAKE_VERSION(VERSION)
29cacd992dSmrg# ----------------------------
30cacd992dSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
31cacd992dSmrg# generated from the m4 files accompanying Automake X.Y.
3214ddf674Smrg# (This private macro should not be called outside this file.)
3314ddf674SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
3414ddf674Smrg[am__api_version='1.11'
3514ddf674Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
3614ddf674Smrgdnl require some minimum version.  Point them to the right macro.
3714ddf674Smrgm4_if([$1], [1.11.1], [],
3814ddf674Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
3914ddf674Smrg])
4014ddf674Smrg
4114ddf674Smrg# _AM_AUTOCONF_VERSION(VERSION)
4214ddf674Smrg# -----------------------------
4314ddf674Smrg# aclocal traces this macro to find the Autoconf version.
4414ddf674Smrg# This is a private macro too.  Using m4_define simplifies
4514ddf674Smrg# the logic in aclocal, which can simply ignore this definition.
4614ddf674Smrgm4_define([_AM_AUTOCONF_VERSION], [])
47cacd992dSmrg
48cacd992dSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
49cacd992dSmrg# -------------------------------
5014ddf674Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
5114ddf674Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
52cacd992dSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
5314ddf674Smrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
5414ddf674Smrgm4_ifndef([AC_AUTOCONF_VERSION],
5514ddf674Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
5614ddf674Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
57cacd992dSmrg
5814ddf674Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
59cacd992dSmrg
6014ddf674Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
61cacd992dSmrg#
6214ddf674Smrg# This file is free software; the Free Software Foundation
6314ddf674Smrg# gives unlimited permission to copy and/or distribute it,
6414ddf674Smrg# with or without modifications, as long as this notice is preserved.
65cacd992dSmrg
66cacd992dSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
67cacd992dSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
68cacd992dSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
69cacd992dSmrg#
70cacd992dSmrg# Of course, Automake must honor this variable whenever it calls a
71cacd992dSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
72cacd992dSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
73cacd992dSmrg# depending on how configure is run.  This is pretty annoying, since
74cacd992dSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
75cacd992dSmrg# source directory, any form will work fine, but in subdirectories a
76cacd992dSmrg# relative path needs to be adjusted first.
77cacd992dSmrg#
78cacd992dSmrg# $ac_aux_dir/missing
79cacd992dSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
80cacd992dSmrg# $top_srcdir/$ac_aux_dir/missing
81cacd992dSmrg#    fails if $ac_aux_dir is absolute,
82cacd992dSmrg#    fails when called from a subdirectory in a VPATH build with
83cacd992dSmrg#          a relative $ac_aux_dir
84cacd992dSmrg#
85cacd992dSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
86cacd992dSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
87cacd992dSmrg# harmless because $srcdir is `.', but things will broke when you
88cacd992dSmrg# start a VPATH build or use an absolute $srcdir.
89cacd992dSmrg#
90cacd992dSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
91cacd992dSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
92cacd992dSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
93cacd992dSmrg# and then we would define $MISSING as
94cacd992dSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
95cacd992dSmrg# This will work as long as MISSING is not called from configure, because
96cacd992dSmrg# unfortunately $(top_srcdir) has no meaning in configure.
97cacd992dSmrg# However there are other variables, like CC, which are often used in
98cacd992dSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
99cacd992dSmrg#
100cacd992dSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
101cacd992dSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
102cacd992dSmrg# configured tree to be moved without reconfiguration.
103cacd992dSmrg
10414ddf674SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
10514ddf674Smrg[dnl Rely on autoconf to set up CDPATH properly.
10614ddf674SmrgAC_PREREQ([2.50])dnl
107cacd992dSmrg# expand $ac_aux_dir to an absolute path
108cacd992dSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
109cacd992dSmrg])
110cacd992dSmrg
11114ddf674Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
112cacd992dSmrg
11314ddf674Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
11414ddf674Smrg# Free Software Foundation, Inc.
11514ddf674Smrg#
11614ddf674Smrg# This file is free software; the Free Software Foundation
11714ddf674Smrg# gives unlimited permission to copy and/or distribute it,
11814ddf674Smrg# with or without modifications, as long as this notice is preserved.
119cacd992dSmrg
12014ddf674Smrg# serial 9
121cacd992dSmrg
12214ddf674Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
12314ddf674Smrg# -------------------------------------
12414ddf674Smrg# Define a conditional.
12514ddf674SmrgAC_DEFUN([AM_CONDITIONAL],
12614ddf674Smrg[AC_PREREQ(2.52)dnl
12714ddf674Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
12814ddf674Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
12914ddf674SmrgAC_SUBST([$1_TRUE])dnl
13014ddf674SmrgAC_SUBST([$1_FALSE])dnl
13114ddf674Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
13214ddf674Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
13314ddf674Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
13414ddf674Smrgif $2; then
13514ddf674Smrg  $1_TRUE=
13614ddf674Smrg  $1_FALSE='#'
137cacd992dSmrgelse
13814ddf674Smrg  $1_TRUE='#'
13914ddf674Smrg  $1_FALSE=
140cacd992dSmrgfi
14114ddf674SmrgAC_CONFIG_COMMANDS_PRE(
14214ddf674Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
14314ddf674Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
14414ddf674SmrgUsually this means the macro was only invoked conditionally.]])
14514ddf674Smrgfi])])
146cacd992dSmrg
14714ddf674Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
14814ddf674Smrg# Free Software Foundation, Inc.
14914ddf674Smrg#
15014ddf674Smrg# This file is free software; the Free Software Foundation
15114ddf674Smrg# gives unlimited permission to copy and/or distribute it,
15214ddf674Smrg# with or without modifications, as long as this notice is preserved.
153cacd992dSmrg
15414ddf674Smrg# serial 10
155cacd992dSmrg
156cacd992dSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
157cacd992dSmrg# written in clear, in which case automake, when reading aclocal.m4,
158cacd992dSmrg# will think it sees a *use*, and therefore will trigger all it's
159cacd992dSmrg# C support machinery.  Also note that it means that autoscan, seeing
160cacd992dSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
161cacd992dSmrg
162cacd992dSmrg
163cacd992dSmrg# _AM_DEPENDENCIES(NAME)
164cacd992dSmrg# ----------------------
165cacd992dSmrg# See how the compiler implements dependency checking.
166cacd992dSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
167cacd992dSmrg# We try a few techniques and use that to set a single cache variable.
168cacd992dSmrg#
169cacd992dSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
170cacd992dSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
171cacd992dSmrg# dependency, and given that the user is not expected to run this macro,
172cacd992dSmrg# just rely on AC_PROG_CC.
173cacd992dSmrgAC_DEFUN([_AM_DEPENDENCIES],
174cacd992dSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
175cacd992dSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
176cacd992dSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
177cacd992dSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
178cacd992dSmrg
179cacd992dSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
180cacd992dSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
181cacd992dSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
18214ddf674Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
183cacd992dSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
184cacd992dSmrg                   [depcc="$$1"   am_compiler_list=])
185cacd992dSmrg
186cacd992dSmrgAC_CACHE_CHECK([dependency style of $depcc],
187cacd992dSmrg               [am_cv_$1_dependencies_compiler_type],
188cacd992dSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
189cacd992dSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
190cacd992dSmrg  # making bogus files that we don't know about and never remove.  For
191cacd992dSmrg  # instance it was reported that on HP-UX the gcc test will end up
192cacd992dSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
193cacd992dSmrg  # in D'.
194cacd992dSmrg  mkdir conftest.dir
195cacd992dSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
196cacd992dSmrg  # using a relative directory.
197cacd992dSmrg  cp "$am_depcomp" conftest.dir
198cacd992dSmrg  cd conftest.dir
199cacd992dSmrg  # We will build objects and dependencies in a subdirectory because
200cacd992dSmrg  # it helps to detect inapplicable dependency modes.  For instance
201cacd992dSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
202cacd992dSmrg  # side effect of compilation, but ICC will put the dependencies in
203cacd992dSmrg  # the current directory while Tru64 will put them in the object
204cacd992dSmrg  # directory.
205cacd992dSmrg  mkdir sub
206cacd992dSmrg
207cacd992dSmrg  am_cv_$1_dependencies_compiler_type=none
208cacd992dSmrg  if test "$am_compiler_list" = ""; then
209cacd992dSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
210cacd992dSmrg  fi
21114ddf674Smrg  am__universal=false
21214ddf674Smrg  m4_case([$1], [CC],
21314ddf674Smrg    [case " $depcc " in #(
21414ddf674Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
21514ddf674Smrg     esac],
21614ddf674Smrg    [CXX],
21714ddf674Smrg    [case " $depcc " in #(
21814ddf674Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
21914ddf674Smrg     esac])
22014ddf674Smrg
221cacd992dSmrg  for depmode in $am_compiler_list; do
222cacd992dSmrg    # Setup a source with many dependencies, because some compilers
223cacd992dSmrg    # like to wrap large dependency lists on column 80 (with \), and
224cacd992dSmrg    # we should not choose a depcomp mode which is confused by this.
225cacd992dSmrg    #
226cacd992dSmrg    # We need to recreate these files for each test, as the compiler may
227cacd992dSmrg    # overwrite some of them when testing with obscure command lines.
228cacd992dSmrg    # This happens at least with the AIX C compiler.
229cacd992dSmrg    : > sub/conftest.c
230cacd992dSmrg    for i in 1 2 3 4 5 6; do
231cacd992dSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
23214ddf674Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
23314ddf674Smrg      # Solaris 8's {/usr,}/bin/sh.
23414ddf674Smrg      touch sub/conftst$i.h
235cacd992dSmrg    done
236cacd992dSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
237cacd992dSmrg
23814ddf674Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
23914ddf674Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
24014ddf674Smrg    # handle `-M -o', and we need to detect this.  Also, some Intel
24114ddf674Smrg    # versions had trouble with output in subdirs
24214ddf674Smrg    am__obj=sub/conftest.${OBJEXT-o}
24314ddf674Smrg    am__minus_obj="-o $am__obj"
244cacd992dSmrg    case $depmode in
24514ddf674Smrg    gcc)
24614ddf674Smrg      # This depmode causes a compiler race in universal mode.
24714ddf674Smrg      test "$am__universal" = false || continue
24814ddf674Smrg      ;;
249cacd992dSmrg    nosideeffect)
250cacd992dSmrg      # after this tag, mechanisms are not by side-effect, so they'll
251cacd992dSmrg      # only be used when explicitly requested
252cacd992dSmrg      if test "x$enable_dependency_tracking" = xyes; then
253cacd992dSmrg	continue
254cacd992dSmrg      else
255cacd992dSmrg	break
256cacd992dSmrg      fi
257cacd992dSmrg      ;;
25814ddf674Smrg    msvisualcpp | msvcmsys)
25914ddf674Smrg      # This compiler won't grok `-c -o', but also, the minuso test has
26014ddf674Smrg      # not run yet.  These depmodes are late enough in the game, and
26114ddf674Smrg      # so weak that their functioning should not be impacted.
26214ddf674Smrg      am__obj=conftest.${OBJEXT-o}
26314ddf674Smrg      am__minus_obj=
26414ddf674Smrg      ;;
265cacd992dSmrg    none) break ;;
266cacd992dSmrg    esac
267cacd992dSmrg    if depmode=$depmode \
26814ddf674Smrg       source=sub/conftest.c object=$am__obj \
269cacd992dSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
27014ddf674Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
271cacd992dSmrg         >/dev/null 2>conftest.err &&
27214ddf674Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
273cacd992dSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
27414ddf674Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
275cacd992dSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
276cacd992dSmrg      # icc doesn't choke on unknown options, it will just issue warnings
27714ddf674Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
27814ddf674Smrg      # that says an option was ignored or not supported.
27914ddf674Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
28014ddf674Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
28114ddf674Smrg      # The diagnosis changed in icc 8.0:
28214ddf674Smrg      #   icc: Command line remark: option '-MP' not supported
28314ddf674Smrg      if (grep 'ignoring option' conftest.err ||
28414ddf674Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
285cacd992dSmrg        am_cv_$1_dependencies_compiler_type=$depmode
286cacd992dSmrg        break
287cacd992dSmrg      fi
288cacd992dSmrg    fi
289cacd992dSmrg  done
290cacd992dSmrg
291cacd992dSmrg  cd ..
292cacd992dSmrg  rm -rf conftest.dir
293cacd992dSmrgelse
294cacd992dSmrg  am_cv_$1_dependencies_compiler_type=none
295cacd992dSmrgfi
296cacd992dSmrg])
297cacd992dSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
298cacd992dSmrgAM_CONDITIONAL([am__fastdep$1], [
299cacd992dSmrg  test "x$enable_dependency_tracking" != xno \
300cacd992dSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
301cacd992dSmrg])
302cacd992dSmrg
303cacd992dSmrg
304cacd992dSmrg# AM_SET_DEPDIR
305cacd992dSmrg# -------------
306cacd992dSmrg# Choose a directory name for dependency files.
307cacd992dSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
308cacd992dSmrgAC_DEFUN([AM_SET_DEPDIR],
309cacd992dSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
310cacd992dSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
311cacd992dSmrg])
312cacd992dSmrg
313cacd992dSmrg
314cacd992dSmrg# AM_DEP_TRACK
315cacd992dSmrg# ------------
316cacd992dSmrgAC_DEFUN([AM_DEP_TRACK],
317cacd992dSmrg[AC_ARG_ENABLE(dependency-tracking,
31814ddf674Smrg[  --disable-dependency-tracking  speeds up one-time build
31914ddf674Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
320cacd992dSmrgif test "x$enable_dependency_tracking" != xno; then
321cacd992dSmrg  am_depcomp="$ac_aux_dir/depcomp"
322cacd992dSmrg  AMDEPBACKSLASH='\'
323cacd992dSmrgfi
324cacd992dSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
32514ddf674SmrgAC_SUBST([AMDEPBACKSLASH])dnl
32614ddf674Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
327cacd992dSmrg])
328cacd992dSmrg
32914ddf674Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
330cacd992dSmrg
33114ddf674Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
33214ddf674Smrg# Free Software Foundation, Inc.
33314ddf674Smrg#
33414ddf674Smrg# This file is free software; the Free Software Foundation
33514ddf674Smrg# gives unlimited permission to copy and/or distribute it,
33614ddf674Smrg# with or without modifications, as long as this notice is preserved.
337cacd992dSmrg
33814ddf674Smrg#serial 5
339cacd992dSmrg
340cacd992dSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
341cacd992dSmrg# ------------------------------
342cacd992dSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
34314ddf674Smrg[{
34414ddf674Smrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
34514ddf674Smrg  # are listed without --file.  Let's play safe and only enable the eval
34614ddf674Smrg  # if we detect the quoting.
34714ddf674Smrg  case $CONFIG_FILES in
34814ddf674Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
34914ddf674Smrg  *)   set x $CONFIG_FILES ;;
35014ddf674Smrg  esac
35114ddf674Smrg  shift
35214ddf674Smrg  for mf
35314ddf674Smrg  do
35414ddf674Smrg    # Strip MF so we end up with the name of the file.
35514ddf674Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
35614ddf674Smrg    # Check whether this is an Automake generated Makefile or not.
35714ddf674Smrg    # We used to match only the files named `Makefile.in', but
35814ddf674Smrg    # some people rename them; so instead we look at the file content.
35914ddf674Smrg    # Grep'ing the first line is not enough: some people post-process
36014ddf674Smrg    # each Makefile.in and add a new line on top of each file to say so.
36114ddf674Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
36214ddf674Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
36314ddf674Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
36414ddf674Smrg      dirpart=`AS_DIRNAME("$mf")`
36514ddf674Smrg    else
36614ddf674Smrg      continue
36714ddf674Smrg    fi
36814ddf674Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
36914ddf674Smrg    # from the Makefile without running `make'.
37014ddf674Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
37114ddf674Smrg    test -z "$DEPDIR" && continue
37214ddf674Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
37314ddf674Smrg    test -z "am__include" && continue
37414ddf674Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
37514ddf674Smrg    # When using ansi2knr, U may be empty or an underscore; expand it
37614ddf674Smrg    U=`sed -n 's/^U = //p' < "$mf"`
37714ddf674Smrg    # Find all dependency output files, they are included files with
37814ddf674Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
37914ddf674Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
38014ddf674Smrg    # expansion.
38114ddf674Smrg    for file in `sed -n "
38214ddf674Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
38314ddf674Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
38414ddf674Smrg      # Make sure the directory exists.
38514ddf674Smrg      test -f "$dirpart/$file" && continue
38614ddf674Smrg      fdir=`AS_DIRNAME(["$file"])`
38714ddf674Smrg      AS_MKDIR_P([$dirpart/$fdir])
38814ddf674Smrg      # echo "creating $dirpart/$file"
38914ddf674Smrg      echo '# dummy' > "$dirpart/$file"
39014ddf674Smrg    done
391cacd992dSmrg  done
39214ddf674Smrg}
393cacd992dSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
394cacd992dSmrg
395cacd992dSmrg
396cacd992dSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
397cacd992dSmrg# -----------------------------
398cacd992dSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
399cacd992dSmrg#
400cacd992dSmrg# This code is only required when automatic dependency tracking
401cacd992dSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
402cacd992dSmrg# need in order to bootstrap the dependency handling code.
403cacd992dSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
404cacd992dSmrg[AC_CONFIG_COMMANDS([depfiles],
405cacd992dSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
406cacd992dSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
407cacd992dSmrg])
408cacd992dSmrg
40914ddf674Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
41014ddf674Smrg# Free Software Foundation, Inc.
41114ddf674Smrg#
41214ddf674Smrg# This file is free software; the Free Software Foundation
41314ddf674Smrg# gives unlimited permission to copy and/or distribute it,
41414ddf674Smrg# with or without modifications, as long as this notice is preserved.
415cacd992dSmrg
41614ddf674Smrg# serial 8
417cacd992dSmrg
41814ddf674Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
41914ddf674SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
420cacd992dSmrg
42114ddf674Smrg# Do all the work for Automake.                             -*- Autoconf -*-
422cacd992dSmrg
42314ddf674Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
42414ddf674Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
42514ddf674Smrg#
42614ddf674Smrg# This file is free software; the Free Software Foundation
42714ddf674Smrg# gives unlimited permission to copy and/or distribute it,
42814ddf674Smrg# with or without modifications, as long as this notice is preserved.
429cacd992dSmrg
43014ddf674Smrg# serial 16
431cacd992dSmrg
43214ddf674Smrg# This macro actually does too much.  Some checks are only needed if
43314ddf674Smrg# your package does certain things.  But this isn't really a big deal.
43414ddf674Smrg
43514ddf674Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
43614ddf674Smrg# AM_INIT_AUTOMAKE([OPTIONS])
43714ddf674Smrg# -----------------------------------------------
43814ddf674Smrg# The call with PACKAGE and VERSION arguments is the old style
43914ddf674Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
44014ddf674Smrg# and VERSION should now be passed to AC_INIT and removed from
44114ddf674Smrg# the call to AM_INIT_AUTOMAKE.
44214ddf674Smrg# We support both call styles for the transition.  After
44314ddf674Smrg# the next Automake release, Autoconf can make the AC_INIT
44414ddf674Smrg# arguments mandatory, and then we can depend on a new Autoconf
44514ddf674Smrg# release and drop the old call support.
44614ddf674SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
44714ddf674Smrg[AC_PREREQ([2.62])dnl
44814ddf674Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
44914ddf674Smrgdnl the ones we care about.
45014ddf674Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
45114ddf674SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
45214ddf674SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
45314ddf674Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
45414ddf674Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
45514ddf674Smrg  # is not polluted with repeated "-I."
45614ddf674Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
45714ddf674Smrg  # test to see if srcdir already configured
45814ddf674Smrg  if test -f $srcdir/config.status; then
45914ddf674Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
46014ddf674Smrg  fi
461cacd992dSmrgfi
46214ddf674Smrg
46314ddf674Smrg# test whether we have cygpath
46414ddf674Smrgif test -z "$CYGPATH_W"; then
46514ddf674Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
46614ddf674Smrg    CYGPATH_W='cygpath -w'
46714ddf674Smrg  else
46814ddf674Smrg    CYGPATH_W=echo
46914ddf674Smrg  fi
470cacd992dSmrgfi
47114ddf674SmrgAC_SUBST([CYGPATH_W])
472cacd992dSmrg
47314ddf674Smrg# Define the identity of the package.
47414ddf674Smrgdnl Distinguish between old-style and new-style calls.
47514ddf674Smrgm4_ifval([$2],
47614ddf674Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
47714ddf674Smrg AC_SUBST([PACKAGE], [$1])dnl
47814ddf674Smrg AC_SUBST([VERSION], [$2])],
47914ddf674Smrg[_AM_SET_OPTIONS([$1])dnl
48014ddf674Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
48114ddf674Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
48214ddf674Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
48314ddf674Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
48414ddf674Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
485cacd992dSmrg
48614ddf674Smrg_AM_IF_OPTION([no-define],,
48714ddf674Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
48814ddf674Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
489cacd992dSmrg
49014ddf674Smrg# Some tools Automake needs.
49114ddf674SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
49214ddf674SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
49314ddf674SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
49414ddf674SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
49514ddf674SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
49614ddf674SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
49714ddf674SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
49814ddf674SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
49914ddf674SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
50014ddf674SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
50114ddf674Smrg# We need awk for the "check" target.  The system "awk" is bad on
50214ddf674Smrg# some platforms.
50314ddf674SmrgAC_REQUIRE([AC_PROG_AWK])dnl
50414ddf674SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
50514ddf674SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
50614ddf674Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
50714ddf674Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
50814ddf674Smrg			     [_AM_PROG_TAR([v7])])])
50914ddf674Smrg_AM_IF_OPTION([no-dependencies],,
51014ddf674Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
51114ddf674Smrg		  [_AM_DEPENDENCIES(CC)],
51214ddf674Smrg		  [define([AC_PROG_CC],
51314ddf674Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
51414ddf674SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
51514ddf674Smrg		  [_AM_DEPENDENCIES(CXX)],
51614ddf674Smrg		  [define([AC_PROG_CXX],
51714ddf674Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
51814ddf674SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
51914ddf674Smrg		  [_AM_DEPENDENCIES(OBJC)],
52014ddf674Smrg		  [define([AC_PROG_OBJC],
52114ddf674Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
52214ddf674Smrg])
52314ddf674Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
52414ddf674Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
52514ddf674Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
52614ddf674Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
52714ddf674SmrgAC_CONFIG_COMMANDS_PRE(dnl
52814ddf674Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
52914ddf674Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
53014ddf674Smrg])
531cacd992dSmrg
53214ddf674Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
53314ddf674Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
53414ddf674Smrgdnl mangled by Autoconf and run in a shell conditional statement.
53514ddf674Smrgm4_define([_AC_COMPILER_EXEEXT],
53614ddf674Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
537cacd992dSmrg
538cacd992dSmrg
53914ddf674Smrg# When config.status generates a header, we must update the stamp-h file.
54014ddf674Smrg# This file resides in the same directory as the config header
54114ddf674Smrg# that is generated.  The stamp files are numbered to have different names.
54214ddf674Smrg
54314ddf674Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
54414ddf674Smrg# loop where config.status creates the headers, so we can generate
54514ddf674Smrg# our stamp files there.
54614ddf674SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
54714ddf674Smrg[# Compute $1's index in $config_headers.
54814ddf674Smrg_am_arg=$1
54914ddf674Smrg_am_stamp_count=1
55014ddf674Smrgfor _am_header in $config_headers :; do
55114ddf674Smrg  case $_am_header in
55214ddf674Smrg    $_am_arg | $_am_arg:* )
55314ddf674Smrg      break ;;
55414ddf674Smrg    * )
55514ddf674Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
55614ddf674Smrg  esac
55714ddf674Smrgdone
55814ddf674Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
559cacd992dSmrg
56014ddf674Smrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
56114ddf674Smrg#
56214ddf674Smrg# This file is free software; the Free Software Foundation
56314ddf674Smrg# gives unlimited permission to copy and/or distribute it,
56414ddf674Smrg# with or without modifications, as long as this notice is preserved.
565cacd992dSmrg
56614ddf674Smrg# AM_PROG_INSTALL_SH
56714ddf674Smrg# ------------------
56814ddf674Smrg# Define $install_sh.
56914ddf674SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
57014ddf674Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
57114ddf674Smrgif test x"${install_sh}" != xset; then
57214ddf674Smrg  case $am_aux_dir in
57314ddf674Smrg  *\ * | *\	*)
57414ddf674Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
57514ddf674Smrg  *)
57614ddf674Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
57714ddf674Smrg  esac
578cacd992dSmrgfi
57914ddf674SmrgAC_SUBST(install_sh)])
580cacd992dSmrg
58114ddf674Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
58214ddf674Smrg#
58314ddf674Smrg# This file is free software; the Free Software Foundation
58414ddf674Smrg# gives unlimited permission to copy and/or distribute it,
58514ddf674Smrg# with or without modifications, as long as this notice is preserved.
586cacd992dSmrg
58714ddf674Smrg# serial 2
588cacd992dSmrg
58914ddf674Smrg# Check whether the underlying file-system supports filenames
59014ddf674Smrg# with a leading dot.  For instance MS-DOS doesn't.
59114ddf674SmrgAC_DEFUN([AM_SET_LEADING_DOT],
59214ddf674Smrg[rm -rf .tst 2>/dev/null
59314ddf674Smrgmkdir .tst 2>/dev/null
59414ddf674Smrgif test -d .tst; then
59514ddf674Smrg  am__leading_dot=.
59614ddf674Smrgelse
59714ddf674Smrg  am__leading_dot=_
59814ddf674Smrgfi
59914ddf674Smrgrmdir .tst 2>/dev/null
60014ddf674SmrgAC_SUBST([am__leading_dot])])
601cacd992dSmrg
60214ddf674Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
60314ddf674Smrg# From Jim Meyering
604cacd992dSmrg
60514ddf674Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
60614ddf674Smrg# Free Software Foundation, Inc.
60714ddf674Smrg#
60814ddf674Smrg# This file is free software; the Free Software Foundation
60914ddf674Smrg# gives unlimited permission to copy and/or distribute it,
61014ddf674Smrg# with or without modifications, as long as this notice is preserved.
611cacd992dSmrg
61214ddf674Smrg# serial 5
613cacd992dSmrg
61414ddf674Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
61514ddf674Smrg# ----------------------------------
61614ddf674Smrg# Control maintainer-specific portions of Makefiles.
61714ddf674Smrg# Default is to disable them, unless `enable' is passed literally.
61814ddf674Smrg# For symmetry, `disable' may be passed as well.  Anyway, the user
61914ddf674Smrg# can override the default with the --enable/--disable switch.
620cacd992dSmrgAC_DEFUN([AM_MAINTAINER_MODE],
62114ddf674Smrg[m4_case(m4_default([$1], [disable]),
62214ddf674Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
62314ddf674Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
62414ddf674Smrg       [m4_define([am_maintainer_other], [enable])
62514ddf674Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
62614ddf674SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
62714ddf674Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
62814ddf674Smrg  AC_ARG_ENABLE([maintainer-mode],
62914ddf674Smrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
63014ddf674Smrg			  (and sometimes confusing) to the casual installer],
63114ddf674Smrg      [USE_MAINTAINER_MODE=$enableval],
63214ddf674Smrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
633cacd992dSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
63414ddf674Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
635cacd992dSmrg  MAINT=$MAINTAINER_MODE_TRUE
63614ddf674Smrg  AC_SUBST([MAINT])dnl
637cacd992dSmrg]
638cacd992dSmrg)
639cacd992dSmrg
640cacd992dSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
641cacd992dSmrg
64214ddf674Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
643cacd992dSmrg
64414ddf674Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
64514ddf674Smrg#
64614ddf674Smrg# This file is free software; the Free Software Foundation
64714ddf674Smrg# gives unlimited permission to copy and/or distribute it,
64814ddf674Smrg# with or without modifications, as long as this notice is preserved.
649cacd992dSmrg
65014ddf674Smrg# serial 4
651cacd992dSmrg
65214ddf674Smrg# AM_MAKE_INCLUDE()
65314ddf674Smrg# -----------------
65414ddf674Smrg# Check to see how make treats includes.
65514ddf674SmrgAC_DEFUN([AM_MAKE_INCLUDE],
65614ddf674Smrg[am_make=${MAKE-make}
65714ddf674Smrgcat > confinc << 'END'
65814ddf674Smrgam__doit:
65914ddf674Smrg	@echo this is the am__doit target
66014ddf674Smrg.PHONY: am__doit
66114ddf674SmrgEND
66214ddf674Smrg# If we don't find an include directive, just comment out the code.
66314ddf674SmrgAC_MSG_CHECKING([for style of include used by $am_make])
66414ddf674Smrgam__include="#"
66514ddf674Smrgam__quote=
66614ddf674Smrg_am_result=none
66714ddf674Smrg# First try GNU make style include.
66814ddf674Smrgecho "include confinc" > confmf
66914ddf674Smrg# Ignore all kinds of additional output from `make'.
67014ddf674Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
67114ddf674Smrg*the\ am__doit\ target*)
67214ddf674Smrg  am__include=include
67314ddf674Smrg  am__quote=
67414ddf674Smrg  _am_result=GNU
67514ddf674Smrg  ;;
67614ddf674Smrgesac
67714ddf674Smrg# Now try BSD make style include.
67814ddf674Smrgif test "$am__include" = "#"; then
67914ddf674Smrg   echo '.include "confinc"' > confmf
68014ddf674Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
68114ddf674Smrg   *the\ am__doit\ target*)
68214ddf674Smrg     am__include=.include
68314ddf674Smrg     am__quote="\""
68414ddf674Smrg     _am_result=BSD
68514ddf674Smrg     ;;
68614ddf674Smrg   esac
68714ddf674Smrgfi
68814ddf674SmrgAC_SUBST([am__include])
68914ddf674SmrgAC_SUBST([am__quote])
69014ddf674SmrgAC_MSG_RESULT([$_am_result])
69114ddf674Smrgrm -f confinc confmf
69214ddf674Smrg])
693cacd992dSmrg
69414ddf674Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
695cacd992dSmrg
69614ddf674Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
69714ddf674Smrg# Free Software Foundation, Inc.
69814ddf674Smrg#
69914ddf674Smrg# This file is free software; the Free Software Foundation
70014ddf674Smrg# gives unlimited permission to copy and/or distribute it,
70114ddf674Smrg# with or without modifications, as long as this notice is preserved.
702cacd992dSmrg
703cacd992dSmrg# serial 6
704cacd992dSmrg
70514ddf674Smrg# AM_MISSING_PROG(NAME, PROGRAM)
70614ddf674Smrg# ------------------------------
70714ddf674SmrgAC_DEFUN([AM_MISSING_PROG],
70814ddf674Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
70914ddf674Smrg$1=${$1-"${am_missing_run}$2"}
71014ddf674SmrgAC_SUBST($1)])
711cacd992dSmrg
712cacd992dSmrg
71314ddf674Smrg# AM_MISSING_HAS_RUN
71414ddf674Smrg# ------------------
71514ddf674Smrg# Define MISSING if not defined so far and test if it supports --run.
71614ddf674Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
71714ddf674SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
71814ddf674Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
71914ddf674SmrgAC_REQUIRE_AUX_FILE([missing])dnl
72014ddf674Smrgif test x"${MISSING+set}" != xset; then
72114ddf674Smrg  case $am_aux_dir in
72214ddf674Smrg  *\ * | *\	*)
72314ddf674Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
72414ddf674Smrg  *)
72514ddf674Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
72614ddf674Smrg  esac
72714ddf674Smrgfi
72814ddf674Smrg# Use eval to expand $SHELL
72914ddf674Smrgif eval "$MISSING --run true"; then
73014ddf674Smrg  am_missing_run="$MISSING --run "
73114ddf674Smrgelse
73214ddf674Smrg  am_missing_run=
73314ddf674Smrg  AC_MSG_WARN([`missing' script is too old or missing])
73414ddf674Smrgfi
73514ddf674Smrg])
736cacd992dSmrg
73714ddf674Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
73814ddf674Smrg#
73914ddf674Smrg# This file is free software; the Free Software Foundation
74014ddf674Smrg# gives unlimited permission to copy and/or distribute it,
74114ddf674Smrg# with or without modifications, as long as this notice is preserved.
742cacd992dSmrg
74314ddf674Smrg# AM_PROG_MKDIR_P
74414ddf674Smrg# ---------------
74514ddf674Smrg# Check for `mkdir -p'.
74614ddf674SmrgAC_DEFUN([AM_PROG_MKDIR_P],
74714ddf674Smrg[AC_PREREQ([2.60])dnl
74814ddf674SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
74914ddf674Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
75014ddf674Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
75114ddf674Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
75214ddf674Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
75314ddf674Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
75414ddf674Smrgdnl adjustment using top_builddir (which is defined more often than
75514ddf674Smrgdnl MKDIR_P).
75614ddf674SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
75714ddf674Smrgcase $mkdir_p in
75814ddf674Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
75914ddf674Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
76014ddf674Smrgesac
761cacd992dSmrg])
762cacd992dSmrg
76314ddf674Smrg# Helper functions for option handling.                     -*- Autoconf -*-
76414ddf674Smrg
76514ddf674Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
766cacd992dSmrg#
76714ddf674Smrg# This file is free software; the Free Software Foundation
76814ddf674Smrg# gives unlimited permission to copy and/or distribute it,
76914ddf674Smrg# with or without modifications, as long as this notice is preserved.
770cacd992dSmrg
77114ddf674Smrg# serial 4
77214ddf674Smrg
77314ddf674Smrg# _AM_MANGLE_OPTION(NAME)
77414ddf674Smrg# -----------------------
77514ddf674SmrgAC_DEFUN([_AM_MANGLE_OPTION],
77614ddf674Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
77714ddf674Smrg
77814ddf674Smrg# _AM_SET_OPTION(NAME)
77914ddf674Smrg# ------------------------------
78014ddf674Smrg# Set option NAME.  Presently that only means defining a flag for this option.
78114ddf674SmrgAC_DEFUN([_AM_SET_OPTION],
78214ddf674Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
78314ddf674Smrg
78414ddf674Smrg# _AM_SET_OPTIONS(OPTIONS)
785cacd992dSmrg# ----------------------------------
78614ddf674Smrg# OPTIONS is a space-separated list of Automake options.
78714ddf674SmrgAC_DEFUN([_AM_SET_OPTIONS],
78814ddf674Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
789cacd992dSmrg
79014ddf674Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
79114ddf674Smrg# -------------------------------------------
79214ddf674Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
79314ddf674SmrgAC_DEFUN([_AM_IF_OPTION],
79414ddf674Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
79514ddf674Smrg
79614ddf674Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
79714ddf674Smrg
79814ddf674Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
79914ddf674Smrg# Free Software Foundation, Inc.
800cacd992dSmrg#
80114ddf674Smrg# This file is free software; the Free Software Foundation
80214ddf674Smrg# gives unlimited permission to copy and/or distribute it,
80314ddf674Smrg# with or without modifications, as long as this notice is preserved.
804cacd992dSmrg
80514ddf674Smrg# serial 5
806cacd992dSmrg
80714ddf674Smrg# AM_SANITY_CHECK
80814ddf674Smrg# ---------------
80914ddf674SmrgAC_DEFUN([AM_SANITY_CHECK],
81014ddf674Smrg[AC_MSG_CHECKING([whether build environment is sane])
81114ddf674Smrg# Just in case
81214ddf674Smrgsleep 1
81314ddf674Smrgecho timestamp > conftest.file
81414ddf674Smrg# Reject unsafe characters in $srcdir or the absolute working directory
81514ddf674Smrg# name.  Accept space and tab only in the latter.
81614ddf674Smrgam_lf='
81714ddf674Smrg'
81814ddf674Smrgcase `pwd` in
81914ddf674Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
82014ddf674Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
82114ddf674Smrgesac
82214ddf674Smrgcase $srcdir in
82314ddf674Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
82414ddf674Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
82514ddf674Smrgesac
826cacd992dSmrg
82714ddf674Smrg# Do `set' in a subshell so we don't clobber the current shell's
82814ddf674Smrg# arguments.  Must try -L first in case configure is actually a
82914ddf674Smrg# symlink; some systems play weird games with the mod time of symlinks
83014ddf674Smrg# (eg FreeBSD returns the mod time of the symlink's containing
83114ddf674Smrg# directory).
83214ddf674Smrgif (
83314ddf674Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
83414ddf674Smrg   if test "$[*]" = "X"; then
83514ddf674Smrg      # -L didn't work.
83614ddf674Smrg      set X `ls -t "$srcdir/configure" conftest.file`
83714ddf674Smrg   fi
83814ddf674Smrg   rm -f conftest.file
83914ddf674Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
84014ddf674Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
841cacd992dSmrg
84214ddf674Smrg      # If neither matched, then we have a broken ls.  This can happen
84314ddf674Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
84414ddf674Smrg      # broken ls alias from the environment.  This has actually
84514ddf674Smrg      # happened.  Such a system could not be considered "sane".
84614ddf674Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
84714ddf674Smrgalias in your environment])
84814ddf674Smrg   fi
849cacd992dSmrg
85014ddf674Smrg   test "$[2]" = conftest.file
85114ddf674Smrg   )
85214ddf674Smrgthen
85314ddf674Smrg   # Ok.
85414ddf674Smrg   :
85514ddf674Smrgelse
85614ddf674Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
85714ddf674SmrgCheck your system clock])
85814ddf674Smrgfi
85914ddf674SmrgAC_MSG_RESULT(yes)])
860cacd992dSmrg
86114ddf674Smrg# Copyright (C) 2009  Free Software Foundation, Inc.
86214ddf674Smrg#
86314ddf674Smrg# This file is free software; the Free Software Foundation
86414ddf674Smrg# gives unlimited permission to copy and/or distribute it,
86514ddf674Smrg# with or without modifications, as long as this notice is preserved.
866cacd992dSmrg
86714ddf674Smrg# serial 1
868cacd992dSmrg
86914ddf674Smrg# AM_SILENT_RULES([DEFAULT])
87014ddf674Smrg# --------------------------
87114ddf674Smrg# Enable less verbose build rules; with the default set to DEFAULT
87214ddf674Smrg# (`yes' being less verbose, `no' or empty being verbose).
87314ddf674SmrgAC_DEFUN([AM_SILENT_RULES],
87414ddf674Smrg[AC_ARG_ENABLE([silent-rules],
87514ddf674Smrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
87614ddf674Smrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
87714ddf674Smrgcase $enable_silent_rules in
87814ddf674Smrgyes) AM_DEFAULT_VERBOSITY=0;;
87914ddf674Smrgno)  AM_DEFAULT_VERBOSITY=1;;
88014ddf674Smrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
88114ddf674Smrgesac
88214ddf674SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
88314ddf674SmrgAM_BACKSLASH='\'
88414ddf674SmrgAC_SUBST([AM_BACKSLASH])dnl
88514ddf674Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
88614ddf674Smrg])
887cacd992dSmrg
88814ddf674Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
88914ddf674Smrg#
89014ddf674Smrg# This file is free software; the Free Software Foundation
89114ddf674Smrg# gives unlimited permission to copy and/or distribute it,
89214ddf674Smrg# with or without modifications, as long as this notice is preserved.
893cacd992dSmrg
89414ddf674Smrg# AM_PROG_INSTALL_STRIP
89514ddf674Smrg# ---------------------
89614ddf674Smrg# One issue with vendor `install' (even GNU) is that you can't
89714ddf674Smrg# specify the program used to strip binaries.  This is especially
89814ddf674Smrg# annoying in cross-compiling environments, where the build's strip
89914ddf674Smrg# is unlikely to handle the host's binaries.
90014ddf674Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
90114ddf674Smrg# always use install-sh in `make install-strip', and initialize
90214ddf674Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
90314ddf674SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
90414ddf674Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
90514ddf674Smrg# Installed binaries are usually stripped using `strip' when the user
90614ddf674Smrg# run `make install-strip'.  However `strip' might not be the right
90714ddf674Smrg# tool to use in cross-compilation environments, therefore Automake
90814ddf674Smrg# will honor the `STRIP' environment variable to overrule this program.
90914ddf674Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
91014ddf674Smrgif test "$cross_compiling" != no; then
91114ddf674Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
91214ddf674Smrgfi
91314ddf674SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
91414ddf674SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
915cacd992dSmrg
91614ddf674Smrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
91714ddf674Smrg#
91814ddf674Smrg# This file is free software; the Free Software Foundation
91914ddf674Smrg# gives unlimited permission to copy and/or distribute it,
92014ddf674Smrg# with or without modifications, as long as this notice is preserved.
921cacd992dSmrg
92214ddf674Smrg# serial 2
923cacd992dSmrg
92414ddf674Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
92514ddf674Smrg# ---------------------------
92614ddf674Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
92714ddf674Smrg# This macro is traced by Automake.
92814ddf674SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
929cacd992dSmrg
93014ddf674Smrg# AM_SUBST_NOTMAKE(VARIABLE)
93114ddf674Smrg# ---------------------------
93214ddf674Smrg# Public sister of _AM_SUBST_NOTMAKE.
93314ddf674SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
934cacd992dSmrg
93514ddf674Smrg# Check how to create a tarball.                            -*- Autoconf -*-
936cacd992dSmrg
93714ddf674Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
93814ddf674Smrg#
93914ddf674Smrg# This file is free software; the Free Software Foundation
94014ddf674Smrg# gives unlimited permission to copy and/or distribute it,
94114ddf674Smrg# with or without modifications, as long as this notice is preserved.
94214ddf674Smrg
94314ddf674Smrg# serial 2
94414ddf674Smrg
94514ddf674Smrg# _AM_PROG_TAR(FORMAT)
94614ddf674Smrg# --------------------
94714ddf674Smrg# Check how to create a tarball in format FORMAT.
94814ddf674Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
94914ddf674Smrg#
95014ddf674Smrg# Substitute a variable $(am__tar) that is a command
95114ddf674Smrg# writing to stdout a FORMAT-tarball containing the directory
95214ddf674Smrg# $tardir.
95314ddf674Smrg#     tardir=directory && $(am__tar) > result.tar
95414ddf674Smrg#
95514ddf674Smrg# Substitute a variable $(am__untar) that extract such
95614ddf674Smrg# a tarball read from stdin.
95714ddf674Smrg#     $(am__untar) < result.tar
95814ddf674SmrgAC_DEFUN([_AM_PROG_TAR],
95914ddf674Smrg[# Always define AMTAR for backward compatibility.
96014ddf674SmrgAM_MISSING_PROG([AMTAR], [tar])
96114ddf674Smrgm4_if([$1], [v7],
96214ddf674Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
96314ddf674Smrg     [m4_case([$1], [ustar],, [pax],,
96414ddf674Smrg              [m4_fatal([Unknown tar format])])
96514ddf674SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
96614ddf674Smrg# Loop over all known methods to create a tar archive until one works.
96714ddf674Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
96814ddf674Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
96914ddf674Smrg# Do not fold the above two line into one, because Tru64 sh and
97014ddf674Smrg# Solaris sh will not grok spaces in the rhs of `-'.
97114ddf674Smrgfor _am_tool in $_am_tools
97214ddf674Smrgdo
97314ddf674Smrg  case $_am_tool in
97414ddf674Smrg  gnutar)
97514ddf674Smrg    for _am_tar in tar gnutar gtar;
97614ddf674Smrg    do
97714ddf674Smrg      AM_RUN_LOG([$_am_tar --version]) && break
97814ddf674Smrg    done
97914ddf674Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
98014ddf674Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
98114ddf674Smrg    am__untar="$_am_tar -xf -"
98214ddf674Smrg    ;;
98314ddf674Smrg  plaintar)
98414ddf674Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
98514ddf674Smrg    # ustar tarball either.
98614ddf674Smrg    (tar --version) >/dev/null 2>&1 && continue
98714ddf674Smrg    am__tar='tar chf - "$$tardir"'
98814ddf674Smrg    am__tar_='tar chf - "$tardir"'
98914ddf674Smrg    am__untar='tar xf -'
99014ddf674Smrg    ;;
99114ddf674Smrg  pax)
99214ddf674Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
99314ddf674Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
99414ddf674Smrg    am__untar='pax -r'
99514ddf674Smrg    ;;
99614ddf674Smrg  cpio)
99714ddf674Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
99814ddf674Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
99914ddf674Smrg    am__untar='cpio -i -H $1 -d'
100014ddf674Smrg    ;;
100114ddf674Smrg  none)
100214ddf674Smrg    am__tar=false
100314ddf674Smrg    am__tar_=false
100414ddf674Smrg    am__untar=false
100514ddf674Smrg    ;;
100614ddf674Smrg  esac
100714ddf674Smrg
100814ddf674Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
100914ddf674Smrg  # and am__untar set.
101014ddf674Smrg  test -n "${am_cv_prog_tar_$1}" && break
101114ddf674Smrg
101214ddf674Smrg  # tar/untar a dummy directory, and stop if the command works
101314ddf674Smrg  rm -rf conftest.dir
101414ddf674Smrg  mkdir conftest.dir
101514ddf674Smrg  echo GrepMe > conftest.dir/file
101614ddf674Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
101714ddf674Smrg  rm -rf conftest.dir
101814ddf674Smrg  if test -s conftest.tar; then
101914ddf674Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
102014ddf674Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
102114ddf674Smrg  fi
102214ddf674Smrgdone
102314ddf674Smrgrm -rf conftest.dir
102414ddf674Smrg
102514ddf674SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
102614ddf674SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
102714ddf674SmrgAC_SUBST([am__tar])
102814ddf674SmrgAC_SUBST([am__untar])
102914ddf674Smrg]) # _AM_PROG_TAR
103014ddf674Smrg
103114ddf674Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
103214ddf674Smrgdnl
103314ddf674Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
1034cacd992dSmrgdnl 
103514ddf674Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
103614ddf674Smrgdnl copy of this software and associated documentation files (the "Software"),
103714ddf674Smrgdnl to deal in the Software without restriction, including without limitation
103814ddf674Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
103914ddf674Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
104014ddf674Smrgdnl Software is furnished to do so, subject to the following conditions:
104114ddf674Smrgdnl
104214ddf674Smrgdnl The above copyright notice and this permission notice (including the next
104314ddf674Smrgdnl paragraph) shall be included in all copies or substantial portions of the
104414ddf674Smrgdnl Software.
104514ddf674Smrgdnl
104614ddf674Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
104714ddf674Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
104814ddf674Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
104914ddf674Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
105014ddf674Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
105114ddf674Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
105214ddf674Smrgdnl DEALINGS IN THE SOFTWARE.
105314ddf674Smrg
105414ddf674Smrg# XORG_MACROS_VERSION(required-version)
105514ddf674Smrg# -------------------------------------
105614ddf674Smrg# Minimum version: 1.1.0
105714ddf674Smrg#
105814ddf674Smrg# If you're using a macro added in Version 1.1 or newer, include this in
105914ddf674Smrg# your configure.ac with the minimum required version, such as:
106014ddf674Smrg# XORG_MACROS_VERSION(1.1)
106114ddf674Smrg#
106214ddf674Smrg# To ensure that this macro is defined, also add:
106314ddf674Smrg# m4_ifndef([XORG_MACROS_VERSION],
106414ddf674Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
106514ddf674Smrg#
106614ddf674Smrg#
106714ddf674Smrg# See the "minimum version" comment for each macro you use to see what 
106814ddf674Smrg# version you require.
106914ddf674Smrgm4_defun([XORG_MACROS_VERSION],[
107014ddf674Smrgm4_define([vers_have], [1.4.1])
107114ddf674Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
107214ddf674Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
107314ddf674Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
107414ddf674Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
107514ddf674Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
107614ddf674Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
107714ddf674Smrgm4_undefine([vers_have])
107814ddf674Smrgm4_undefine([maj_have])
107914ddf674Smrgm4_undefine([maj_needed])
108014ddf674Smrg]) # XORG_MACROS_VERSION
1081cacd992dSmrg
1082cacd992dSmrg# XORG_PROG_RAWCPP()
1083cacd992dSmrg# ------------------
108414ddf674Smrg# Minimum version: 1.0.0
108514ddf674Smrg#
1086cacd992dSmrg# Find cpp program and necessary flags for use in pre-processing text files
1087cacd992dSmrg# such as man pages and config files
1088cacd992dSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
1089cacd992dSmrgAC_REQUIRE([AC_PROG_CPP])
1090cacd992dSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
1091cacd992dSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1092cacd992dSmrg
1093cacd992dSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
1094cacd992dSmrg# which is not the best choice for supporting other OS'es, but covers most
1095cacd992dSmrg# of the ones we need for now.
1096cacd992dSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
1097cacd992dSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
1098cacd992dSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1099cacd992dSmrg	AC_MSG_RESULT([no])
1100cacd992dSmrgelse
1101cacd992dSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1102cacd992dSmrg		RAWCPPFLAGS=-undef
1103cacd992dSmrg		AC_MSG_RESULT([yes])
110414ddf674Smrg	# under Cygwin unix is still defined even with -undef
110514ddf674Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
110614ddf674Smrg		RAWCPPFLAGS="-undef -ansi"
110714ddf674Smrg		AC_MSG_RESULT([yes, with -ansi])
1108cacd992dSmrg	else
1109cacd992dSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1110cacd992dSmrg	fi
1111cacd992dSmrgfi
1112cacd992dSmrgrm -f conftest.$ac_ext
1113cacd992dSmrg
1114cacd992dSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
1115cacd992dSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
1116cacd992dSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1117cacd992dSmrg	AC_MSG_RESULT([no])
1118cacd992dSmrgelse
1119cacd992dSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1120cacd992dSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1121cacd992dSmrg		AC_MSG_RESULT([yes])
1122cacd992dSmrg	else
1123cacd992dSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1124cacd992dSmrg	fi
1125cacd992dSmrgfi
1126cacd992dSmrgrm -f conftest.$ac_ext
1127cacd992dSmrgAC_SUBST(RAWCPPFLAGS)
1128cacd992dSmrg]) # XORG_PROG_RAWCPP
1129cacd992dSmrg
1130cacd992dSmrg# XORG_MANPAGE_SECTIONS()
1131cacd992dSmrg# -----------------------
113214ddf674Smrg# Minimum version: 1.0.0
113314ddf674Smrg#
1134cacd992dSmrg# Determine which sections man pages go in for the different man page types
1135cacd992dSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1136cacd992dSmrg# Not sure if there's any better way than just hardcoding by OS name.
1137cacd992dSmrg# Override default settings by setting environment variables
1138cacd992dSmrg
1139cacd992dSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1140cacd992dSmrgAC_REQUIRE([AC_CANONICAL_HOST])
1141cacd992dSmrg
1142cacd992dSmrgif test x$APP_MAN_SUFFIX = x    ; then
114314ddf674Smrg    APP_MAN_SUFFIX=1
1144cacd992dSmrgfi
1145cacd992dSmrgif test x$APP_MAN_DIR = x    ; then
114614ddf674Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1147cacd992dSmrgfi
1148cacd992dSmrg
1149cacd992dSmrgif test x$LIB_MAN_SUFFIX = x    ; then
115014ddf674Smrg    LIB_MAN_SUFFIX=3
1151cacd992dSmrgfi
1152cacd992dSmrgif test x$LIB_MAN_DIR = x    ; then
115314ddf674Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1154cacd992dSmrgfi
1155cacd992dSmrg
1156cacd992dSmrgif test x$FILE_MAN_SUFFIX = x    ; then
1157cacd992dSmrg    case $host_os in
1158cacd992dSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
1159cacd992dSmrg	*)		FILE_MAN_SUFFIX=5  ;;
1160cacd992dSmrg    esac
1161cacd992dSmrgfi
1162cacd992dSmrgif test x$FILE_MAN_DIR = x    ; then
116314ddf674Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1164cacd992dSmrgfi
1165cacd992dSmrg
1166cacd992dSmrgif test x$MISC_MAN_SUFFIX = x    ; then
1167cacd992dSmrg    case $host_os in
1168cacd992dSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
1169cacd992dSmrg	*)		MISC_MAN_SUFFIX=7  ;;
1170cacd992dSmrg    esac
1171cacd992dSmrgfi
1172cacd992dSmrgif test x$MISC_MAN_DIR = x    ; then
117314ddf674Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1174cacd992dSmrgfi
1175cacd992dSmrg
1176cacd992dSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
1177cacd992dSmrg    case $host_os in
1178cacd992dSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
1179cacd992dSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
1180cacd992dSmrg    esac
1181cacd992dSmrgfi
1182cacd992dSmrgif test x$DRIVER_MAN_DIR = x    ; then
118314ddf674Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1184cacd992dSmrgfi
1185cacd992dSmrg
1186cacd992dSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
1187cacd992dSmrg    case $host_os in
1188cacd992dSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
1189cacd992dSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
1190cacd992dSmrg    esac
1191cacd992dSmrgfi
1192cacd992dSmrgif test x$ADMIN_MAN_DIR = x    ; then
1193cacd992dSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1194cacd992dSmrgfi
1195cacd992dSmrg
1196cacd992dSmrg
1197cacd992dSmrgAC_SUBST([APP_MAN_SUFFIX])
1198cacd992dSmrgAC_SUBST([LIB_MAN_SUFFIX])
1199cacd992dSmrgAC_SUBST([FILE_MAN_SUFFIX])
1200cacd992dSmrgAC_SUBST([MISC_MAN_SUFFIX])
1201cacd992dSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
1202cacd992dSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
1203cacd992dSmrgAC_SUBST([APP_MAN_DIR])
1204cacd992dSmrgAC_SUBST([LIB_MAN_DIR])
1205cacd992dSmrgAC_SUBST([FILE_MAN_DIR])
1206cacd992dSmrgAC_SUBST([MISC_MAN_DIR])
1207cacd992dSmrgAC_SUBST([DRIVER_MAN_DIR])
1208cacd992dSmrgAC_SUBST([ADMIN_MAN_DIR])
1209cacd992dSmrg]) # XORG_MANPAGE_SECTIONS
1210cacd992dSmrg
1211cacd992dSmrg# XORG_CHECK_LINUXDOC
1212cacd992dSmrg# -------------------
121314ddf674Smrg# Minimum version: 1.0.0
121414ddf674Smrg#
1215cacd992dSmrg# Defines the variable MAKE_TEXT if the necessary tools and
1216cacd992dSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1217cacd992dSmrg# Whether or not the necessary tools and files are found can be checked
1218cacd992dSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1219cacd992dSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
122014ddf674Smrgif test x$XORG_SGML_PATH = x ; then
122114ddf674Smrg    XORG_SGML_PATH=$prefix/share/sgml
122214ddf674Smrgfi
122314ddf674SmrgHAVE_DEFS_ENT=
122414ddf674Smrg
122514ddf674Smrgif test x"$cross_compiling" = x"yes" ; then
122614ddf674Smrg  HAVE_DEFS_ENT=no
122714ddf674Smrgelse
122814ddf674Smrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
122914ddf674Smrgfi
1230cacd992dSmrg
1231cacd992dSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
1232cacd992dSmrgAC_PATH_PROG(PS2PDF, ps2pdf)
1233cacd992dSmrg
1234cacd992dSmrgAC_MSG_CHECKING([Whether to build documentation])
1235cacd992dSmrg
123614ddf674Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
1237cacd992dSmrg   BUILDDOC=yes
1238cacd992dSmrgelse
1239cacd992dSmrg   BUILDDOC=no
1240cacd992dSmrgfi
1241cacd992dSmrg
1242cacd992dSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1243cacd992dSmrg
1244cacd992dSmrgAC_MSG_RESULT([$BUILDDOC])
1245cacd992dSmrg
1246cacd992dSmrgAC_MSG_CHECKING([Whether to build pdf documentation])
1247cacd992dSmrg
124814ddf674Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
1249cacd992dSmrg   BUILDPDFDOC=yes
1250cacd992dSmrgelse
1251cacd992dSmrg   BUILDPDFDOC=no
1252cacd992dSmrgfi
1253cacd992dSmrg
1254cacd992dSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1255cacd992dSmrg
1256cacd992dSmrgAC_MSG_RESULT([$BUILDPDFDOC])
1257cacd992dSmrg
125814ddf674SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
125914ddf674SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1260cacd992dSmrgMAKE_PDF="$PS2PDF"
126114ddf674SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1262cacd992dSmrg
1263cacd992dSmrgAC_SUBST(MAKE_TEXT)
1264cacd992dSmrgAC_SUBST(MAKE_PS)
1265cacd992dSmrgAC_SUBST(MAKE_PDF)
1266cacd992dSmrgAC_SUBST(MAKE_HTML)
1267cacd992dSmrg]) # XORG_CHECK_LINUXDOC
1268cacd992dSmrg
126914ddf674Smrg# XORG_CHECK_DOCBOOK
127014ddf674Smrg# -------------------
127114ddf674Smrg# Minimum version: 1.0.0
127214ddf674Smrg#
127314ddf674Smrg# Checks for the ability to build output formats from SGML DocBook source.
127414ddf674Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
127514ddf674Smrg# indicates whether the necessary tools and files are found and, if set,
127614ddf674Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
127714ddf674SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
127814ddf674Smrgif test x$XORG_SGML_PATH = x ; then
127914ddf674Smrg    XORG_SGML_PATH=$prefix/share/sgml
128014ddf674Smrgfi
128114ddf674SmrgHAVE_DEFS_ENT=
128214ddf674SmrgBUILDTXTDOC=no
128314ddf674SmrgBUILDPDFDOC=no
128414ddf674SmrgBUILDPSDOC=no
128514ddf674SmrgBUILDHTMLDOC=no
128614ddf674Smrg
128714ddf674SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
128814ddf674Smrg
128914ddf674SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
129014ddf674SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
129114ddf674SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
129214ddf674SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
129314ddf674Smrg
129414ddf674SmrgAC_MSG_CHECKING([Whether to build text documentation])
129514ddf674Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
129614ddf674Smrg   test x$BUILD_TXTDOC != xno; then
129714ddf674Smrg	BUILDTXTDOC=yes
129814ddf674Smrgfi
129914ddf674SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
130014ddf674SmrgAC_MSG_RESULT([$BUILDTXTDOC])
130114ddf674Smrg
130214ddf674SmrgAC_MSG_CHECKING([Whether to build PDF documentation])
130314ddf674Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
130414ddf674Smrg   test x$BUILD_PDFDOC != xno; then
130514ddf674Smrg	BUILDPDFDOC=yes
130614ddf674Smrgfi
130714ddf674SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
130814ddf674SmrgAC_MSG_RESULT([$BUILDPDFDOC])
130914ddf674Smrg
131014ddf674SmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
131114ddf674Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
131214ddf674Smrg   test x$BUILD_PSDOC != xno; then
131314ddf674Smrg	BUILDPSDOC=yes
131414ddf674Smrgfi
131514ddf674SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
131614ddf674SmrgAC_MSG_RESULT([$BUILDPSDOC])
131714ddf674Smrg
131814ddf674SmrgAC_MSG_CHECKING([Whether to build HTML documentation])
131914ddf674Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
132014ddf674Smrg   test x$BUILD_HTMLDOC != xno; then
132114ddf674Smrg	BUILDHTMLDOC=yes
132214ddf674Smrgfi
132314ddf674SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
132414ddf674SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
132514ddf674Smrg
132614ddf674SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
132714ddf674SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
132814ddf674SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
132914ddf674SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
133014ddf674Smrg
133114ddf674SmrgAC_SUBST(MAKE_TEXT)
133214ddf674SmrgAC_SUBST(MAKE_PS)
133314ddf674SmrgAC_SUBST(MAKE_PDF)
133414ddf674SmrgAC_SUBST(MAKE_HTML)
133514ddf674Smrg]) # XORG_CHECK_DOCBOOK
133614ddf674Smrg
1337cacd992dSmrg# XORG_CHECK_MALLOC_ZERO
1338cacd992dSmrg# ----------------------
133914ddf674Smrg# Minimum version: 1.0.0
134014ddf674Smrg#
1341cacd992dSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1342cacd992dSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1343cacd992dSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1344cacd992dSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1345cacd992dSmrgAC_ARG_ENABLE(malloc0returnsnull,
134614ddf674Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
1347cacd992dSmrg		       [malloc(0) returns NULL (default: auto)]),
1348cacd992dSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1349cacd992dSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1350cacd992dSmrg
1351cacd992dSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1352cacd992dSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1353cacd992dSmrg	AC_RUN_IFELSE([
1354cacd992dSmrgchar *malloc();
1355cacd992dSmrgchar *realloc();
1356cacd992dSmrgchar *calloc();
1357cacd992dSmrgmain() {
1358cacd992dSmrg    char *m0, *r0, *c0, *p;
1359cacd992dSmrg    m0 = malloc(0);
1360cacd992dSmrg    p = malloc(10);
1361cacd992dSmrg    r0 = realloc(p,0);
1362cacd992dSmrg    c0 = calloc(0);
1363cacd992dSmrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
1364cacd992dSmrg}],
1365cacd992dSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
136614ddf674Smrg		[MALLOC_ZERO_RETURNS_NULL=no],
136714ddf674Smrg		[MALLOC_ZERO_RETURNS_NULL=yes])
1368cacd992dSmrgfi
1369cacd992dSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1370cacd992dSmrg
1371cacd992dSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1372cacd992dSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1373cacd992dSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1374cacd992dSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1375cacd992dSmrgelse
1376cacd992dSmrg	MALLOC_ZERO_CFLAGS=""
1377cacd992dSmrg	XMALLOC_ZERO_CFLAGS=""
1378cacd992dSmrg	XTMALLOC_ZERO_CFLAGS=""
1379cacd992dSmrgfi
1380cacd992dSmrg
1381cacd992dSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1382cacd992dSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1383cacd992dSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1384cacd992dSmrg]) # XORG_CHECK_MALLOC_ZERO
1385cacd992dSmrg
138614ddf674Smrg# XORG_WITH_LINT()
138714ddf674Smrg# ----------------
138814ddf674Smrg# Minimum version: 1.1.0
138914ddf674Smrg#
139014ddf674Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint
139114ddf674Smrg# is specified.   (Use --with-lint=sparse for sparse.)
139214ddf674Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
139314ddf674Smrg# Sets $LINT_FLAGS to flags to pass to source checker
139414ddf674Smrg# Sets LINT automake conditional if enabled (default: disabled)
139514ddf674Smrg#
139614ddf674SmrgAC_DEFUN([XORG_WITH_LINT],[
139714ddf674Smrg
139814ddf674Smrg# Allow checking code with lint, sparse, etc.
139914ddf674SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
140014ddf674Smrg		[Use a lint-style source code checker (default: disabled)])],
140114ddf674Smrg		[use_lint=$withval], [use_lint=no])
140214ddf674Smrgif test "x$use_lint" = "xyes" ; then
140314ddf674Smrg	LINT="lint"
140414ddf674Smrgelse
140514ddf674Smrg	LINT="$use_lint"
140614ddf674Smrgfi
140714ddf674Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
140814ddf674Smrg    case $LINT in
140914ddf674Smrg	lint|*/lint)
141014ddf674Smrg	    case $host_os in
141114ddf674Smrg		solaris*)
141214ddf674Smrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
141314ddf674Smrg			;;
141414ddf674Smrg	    esac
141514ddf674Smrg	    ;;
141614ddf674Smrg    esac
141714ddf674Smrgfi
141814ddf674Smrg
141914ddf674SmrgAC_SUBST(LINT)
142014ddf674SmrgAC_SUBST(LINT_FLAGS)
142114ddf674SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
142214ddf674Smrg
142314ddf674Smrg]) # XORG_WITH_LINT
142414ddf674Smrg
142514ddf674Smrg# XORG_LINT_LIBRARY(LIBNAME)
142614ddf674Smrg# --------------------------
142714ddf674Smrg# Minimum version: 1.1.0
142814ddf674Smrg#
142914ddf674Smrg# Sets up flags for building lint libraries for checking programs that call
143014ddf674Smrg# functions in the library.
143114ddf674Smrg# Disabled by default, enable with --enable-lint-library
143214ddf674Smrg# Sets: 
143314ddf674Smrg#	@LINTLIB@		- name of lint library file to make
143414ddf674Smrg#	MAKE_LINT_LIB		- automake conditional
143514ddf674Smrg#
143614ddf674Smrg
143714ddf674SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
143814ddf674SmrgAC_REQUIRE([XORG_WITH_LINT])
143914ddf674Smrg# Build lint "library" for more indepth checks of programs calling this library
144014ddf674SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
144114ddf674Smrg	[Create lint library (default: disabled)])],
144214ddf674Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
144314ddf674Smrgif test "x$make_lint_lib" != "xno" ; then
144414ddf674Smrg	if test "x$LINT" = "xno" ; then
144514ddf674Smrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
144614ddf674Smrg	fi
144714ddf674Smrg	if test "x$make_lint_lib" = "xyes" ; then
144814ddf674Smrg		LINTLIB=llib-l$1.ln
144914ddf674Smrg	else
145014ddf674Smrg		LINTLIB=$make_lint_lib
145114ddf674Smrg	fi
145214ddf674Smrgfi
145314ddf674SmrgAC_SUBST(LINTLIB)
145414ddf674SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
145514ddf674Smrg
145614ddf674Smrg]) # XORG_LINT_LIBRARY
145714ddf674Smrg
145814ddf674Smrg# XORG_CWARNFLAGS
145914ddf674Smrg# ---------------
146014ddf674Smrg# Minimum version: 1.2.0
146114ddf674Smrg#
146214ddf674Smrg# Defines CWARNFLAGS to enable C compiler warnings.
146314ddf674Smrg#
146414ddf674SmrgAC_DEFUN([XORG_CWARNFLAGS], [
146514ddf674SmrgAC_REQUIRE([AC_PROG_CC])
146614ddf674Smrgif  test "x$GCC" = xyes ; then
146714ddf674Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
146814ddf674Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
146914ddf674Smrg-Wbad-function-cast"
147014ddf674Smrg    case `$CC -dumpversion` in
147114ddf674Smrg    3.4.* | 4.*)
147214ddf674Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
147314ddf674Smrg	;;
147414ddf674Smrg    esac
147514ddf674Smrgelse
147614ddf674Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
147714ddf674Smrg    if test "x$SUNCC" = "xyes"; then
147814ddf674Smrg	CWARNFLAGS="-v"
147914ddf674Smrg    fi
148014ddf674Smrgfi
148114ddf674SmrgAC_SUBST(CWARNFLAGS)
148214ddf674Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
148314ddf674Smrg]) # XORG_CWARNFLAGS
148414ddf674Smrg
148514ddf674Smrg# XORG_STRICT_OPTION
148614ddf674Smrg# -----------------------
148714ddf674Smrg# Minimum version: 1.3.0
148814ddf674Smrg#
148914ddf674Smrg# Add configure option to enable strict compilation
149014ddf674SmrgAC_DEFUN([XORG_STRICT_OPTION], [
149114ddf674SmrgAC_REQUIRE([AC_PROG_CC])
149214ddf674SmrgAC_REQUIRE([AC_PROG_CC_C99])
149314ddf674SmrgAC_REQUIRE([XORG_CWARNFLAGS])
149414ddf674Smrg
149514ddf674SmrgAC_ARG_ENABLE(strict-compilation,
149614ddf674Smrg			  AS_HELP_STRING([--enable-strict-compilation],
149714ddf674Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
149814ddf674Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
149914ddf674Smrgif test "x$STRICT_COMPILE" = "xyes"; then
150014ddf674Smrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
150114ddf674Smrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
150214ddf674Smrg	if test "x$GCC" = xyes ; then
150314ddf674Smrg		STRICT_CFLAGS="-pedantic -Werror"
150414ddf674Smrg	elif test "x$SUNCC" = "xyes"; then
150514ddf674Smrg		STRICT_CFLAGS="-errwarn"
150614ddf674Smrg    elif test "x$INTELCC" = "xyes"; then
150714ddf674Smrg		STRICT_CFLAGS="-Werror"
150814ddf674Smrg	fi
150914ddf674Smrgfi
151014ddf674SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
151114ddf674SmrgAC_SUBST([CWARNFLAGS])
151214ddf674Smrg]) # XORG_STRICT_OPTION
151314ddf674Smrg
151414ddf674Smrg# XORG_DEFAULT_OPTIONS
151514ddf674Smrg# --------------------
151614ddf674Smrg# Minimum version: 1.3.0
151714ddf674Smrg#
151814ddf674Smrg# Defines default options for X.Org modules.
151914ddf674Smrg#
152014ddf674SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
152114ddf674SmrgXORG_CWARNFLAGS
152214ddf674SmrgXORG_STRICT_OPTION
152314ddf674SmrgXORG_RELEASE_VERSION
152414ddf674SmrgXORG_CHANGELOG
152514ddf674SmrgXORG_INSTALL
152614ddf674SmrgXORG_MANPAGE_SECTIONS
152714ddf674Smrg]) # XORG_DEFAULT_OPTIONS
152814ddf674Smrg
152914ddf674Smrg# XORG_INSTALL()
153014ddf674Smrg# ----------------
153114ddf674Smrg# Minimum version: 1.4.0
153214ddf674Smrg#
153314ddf674Smrg# Defines the variable INSTALL_CMD as the command to copy
153414ddf674Smrg# INSTALL from $prefix/share/util-macros.
153514ddf674Smrg#
153614ddf674SmrgAC_DEFUN([XORG_INSTALL], [
153714ddf674SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
153814ddf674Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
153914ddf674SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
154014ddf674Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
154114ddf674Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
154214ddf674Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
154314ddf674SmrgAC_SUBST([INSTALL_CMD])
154414ddf674Smrg]) # XORG_INSTALL
1545cacd992dSmrgdnl Copyright 2005 Red Hat, Inc
1546cacd992dSmrgdnl
1547cacd992dSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1548cacd992dSmrgdnl documentation for any purpose is hereby granted without fee, provided that
1549cacd992dSmrgdnl the above copyright notice appear in all copies and that both that
1550cacd992dSmrgdnl copyright notice and this permission notice appear in supporting
1551cacd992dSmrgdnl documentation.
1552cacd992dSmrgdnl
1553cacd992dSmrgdnl The above copyright notice and this permission notice shall be included
1554cacd992dSmrgdnl in all copies or substantial portions of the Software.
1555cacd992dSmrgdnl
1556cacd992dSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1557cacd992dSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1558cacd992dSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1559cacd992dSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1560cacd992dSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1561cacd992dSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1562cacd992dSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
1563cacd992dSmrgdnl
1564cacd992dSmrgdnl Except as contained in this notice, the name of the copyright holders shall
1565cacd992dSmrgdnl not be used in advertising or otherwise to promote the sale, use or
1566cacd992dSmrgdnl other dealings in this Software without prior written authorization
1567cacd992dSmrgdnl from the copyright holders.
1568cacd992dSmrgdnl
1569cacd992dSmrg
1570cacd992dSmrg# XORG_RELEASE_VERSION
1571cacd992dSmrg# --------------------
1572cacd992dSmrg# Adds --with/without-release-string and changes the PACKAGE and
1573cacd992dSmrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
157414ddf674Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
157514ddf674Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1576cacd992dSmrg 
1577cacd992dSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
1578cacd992dSmrg	AC_ARG_WITH(release-version,
157914ddf674Smrg			AS_HELP_STRING([--with-release-version=STRING],
1580cacd992dSmrg				[Use release version string in package name]),
1581cacd992dSmrg			[RELEASE_VERSION="$withval"],
1582cacd992dSmrg			[RELEASE_VERSION=""])
1583cacd992dSmrg	if test "x$RELEASE_VERSION" != "x"; then
1584cacd992dSmrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
1585cacd992dSmrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
1586cacd992dSmrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
1587cacd992dSmrg	fi
158814ddf674Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
158914ddf674Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
159014ddf674Smrg		[Major version of this package])
159114ddf674Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
159214ddf674Smrg	if test "x$PVM" = "x"; then
159314ddf674Smrg		PVM="0"
159414ddf674Smrg	fi
159514ddf674Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
159614ddf674Smrg		[$PVM],
159714ddf674Smrg		[Minor version of this package])
159814ddf674Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
159914ddf674Smrg	if test "x$PVP" = "x"; then
160014ddf674Smrg		PVP="0"
160114ddf674Smrg	fi
160214ddf674Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
160314ddf674Smrg		[$PVP],
160414ddf674Smrg		[Patch version of this package])
1605cacd992dSmrg])
1606cacd992dSmrg
160714ddf674Smrg# XORG_CHANGELOG()
160814ddf674Smrg# ----------------
160914ddf674Smrg# Minimum version: 1.2.0
161014ddf674Smrg#
161114ddf674Smrg# Defines the variable CHANGELOG_CMD as the command to generate
161214ddf674Smrg# ChangeLog from git.
161314ddf674Smrg#
161414ddf674Smrg#
161514ddf674SmrgAC_DEFUN([XORG_CHANGELOG], [
161614ddf674SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
161714ddf674Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
161814ddf674Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
161914ddf674Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
162014ddf674SmrgAC_SUBST([CHANGELOG_CMD])
162114ddf674Smrg]) # XORG_CHANGELOG
162214ddf674Smrg
162314ddf674Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
162414ddf674Smrg# 
162514ddf674Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
162614ddf674Smrg#
162714ddf674Smrg# This program is free software; you can redistribute it and/or modify
162814ddf674Smrg# it under the terms of the GNU General Public License as published by
162914ddf674Smrg# the Free Software Foundation; either version 2 of the License, or
163014ddf674Smrg# (at your option) any later version.
163114ddf674Smrg#
163214ddf674Smrg# This program is distributed in the hope that it will be useful, but
163314ddf674Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
163414ddf674Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
163514ddf674Smrg# General Public License for more details.
163614ddf674Smrg#
163714ddf674Smrg# You should have received a copy of the GNU General Public License
163814ddf674Smrg# along with this program; if not, write to the Free Software
163914ddf674Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
164014ddf674Smrg#
164114ddf674Smrg# As a special exception to the GNU General Public License, if you
164214ddf674Smrg# distribute this file as part of a program that contains a
164314ddf674Smrg# configuration script generated by Autoconf, you may include it under
164414ddf674Smrg# the same distribution terms that you use for the rest of that program.
164514ddf674Smrg
164614ddf674Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
164714ddf674Smrg# ----------------------------------
164814ddf674SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
164914ddf674Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
165014ddf674Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
165114ddf674SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
165214ddf674Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
165314ddf674Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
165414ddf674Smrgfi
165514ddf674Smrgif test -n "$PKG_CONFIG"; then
165614ddf674Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
165714ddf674Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
165814ddf674Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
165914ddf674Smrg		AC_MSG_RESULT([yes])
166014ddf674Smrg	else
166114ddf674Smrg		AC_MSG_RESULT([no])
166214ddf674Smrg		PKG_CONFIG=""
166314ddf674Smrg	fi
166414ddf674Smrg		
166514ddf674Smrgfi[]dnl
166614ddf674Smrg])# PKG_PROG_PKG_CONFIG
166714ddf674Smrg
166814ddf674Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
166914ddf674Smrg#
167014ddf674Smrg# Check to see whether a particular set of modules exists.  Similar
167114ddf674Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
167214ddf674Smrg#
167314ddf674Smrg#
167414ddf674Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
167514ddf674Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
167614ddf674Smrg# PKG_CHECK_EXISTS manually
167714ddf674Smrg# --------------------------------------------------------------
167814ddf674SmrgAC_DEFUN([PKG_CHECK_EXISTS],
167914ddf674Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
168014ddf674Smrgif test -n "$PKG_CONFIG" && \
168114ddf674Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
168214ddf674Smrg  m4_ifval([$2], [$2], [:])
168314ddf674Smrgm4_ifvaln([$3], [else
168414ddf674Smrg  $3])dnl
168514ddf674Smrgfi])
168614ddf674Smrg
168714ddf674Smrg
168814ddf674Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
168914ddf674Smrg# ---------------------------------------------
169014ddf674Smrgm4_define([_PKG_CONFIG],
169114ddf674Smrg[if test -n "$$1"; then
169214ddf674Smrg    pkg_cv_[]$1="$$1"
169314ddf674Smrg elif test -n "$PKG_CONFIG"; then
169414ddf674Smrg    PKG_CHECK_EXISTS([$3],
169514ddf674Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
169614ddf674Smrg		     [pkg_failed=yes])
169714ddf674Smrg else
169814ddf674Smrg    pkg_failed=untried
169914ddf674Smrgfi[]dnl
170014ddf674Smrg])# _PKG_CONFIG
170114ddf674Smrg
170214ddf674Smrg# _PKG_SHORT_ERRORS_SUPPORTED
170314ddf674Smrg# -----------------------------
170414ddf674SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
170514ddf674Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
170614ddf674Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
170714ddf674Smrg        _pkg_short_errors_supported=yes
170814ddf674Smrgelse
170914ddf674Smrg        _pkg_short_errors_supported=no
171014ddf674Smrgfi[]dnl
171114ddf674Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
171214ddf674Smrg
171314ddf674Smrg
171414ddf674Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
171514ddf674Smrg# [ACTION-IF-NOT-FOUND])
171614ddf674Smrg#
171714ddf674Smrg#
171814ddf674Smrg# Note that if there is a possibility the first call to
171914ddf674Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
172014ddf674Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
172114ddf674Smrg#
172214ddf674Smrg#
172314ddf674Smrg# --------------------------------------------------------------
172414ddf674SmrgAC_DEFUN([PKG_CHECK_MODULES],
172514ddf674Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
172614ddf674SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
172714ddf674SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
172814ddf674Smrg
172914ddf674Smrgpkg_failed=no
173014ddf674SmrgAC_MSG_CHECKING([for $1])
173114ddf674Smrg
173214ddf674Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
173314ddf674Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
173414ddf674Smrg
173514ddf674Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
173614ddf674Smrgand $1[]_LIBS to avoid the need to call pkg-config.
173714ddf674SmrgSee the pkg-config man page for more details.])
173814ddf674Smrg
173914ddf674Smrgif test $pkg_failed = yes; then
174014ddf674Smrg        _PKG_SHORT_ERRORS_SUPPORTED
174114ddf674Smrg        if test $_pkg_short_errors_supported = yes; then
174214ddf674Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
174314ddf674Smrg        else 
174414ddf674Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
174514ddf674Smrg        fi
174614ddf674Smrg	# Put the nasty error message in config.log where it belongs
174714ddf674Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
174814ddf674Smrg
174914ddf674Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
175014ddf674Smrg[Package requirements ($2) were not met:
175114ddf674Smrg
175214ddf674Smrg$$1_PKG_ERRORS
175314ddf674Smrg
175414ddf674SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
175514ddf674Smrginstalled software in a non-standard prefix.
175614ddf674Smrg
175714ddf674Smrg_PKG_TEXT
175814ddf674Smrg])],
175914ddf674Smrg		[AC_MSG_RESULT([no])
176014ddf674Smrg                $4])
176114ddf674Smrgelif test $pkg_failed = untried; then
176214ddf674Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
176314ddf674Smrg[The pkg-config script could not be found or is too old.  Make sure it
176414ddf674Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
176514ddf674Smrgpath to pkg-config.
176614ddf674Smrg
176714ddf674Smrg_PKG_TEXT
176814ddf674Smrg
176914ddf674SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
177014ddf674Smrg		[$4])
177114ddf674Smrgelse
177214ddf674Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
177314ddf674Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
177414ddf674Smrg        AC_MSG_RESULT([yes])
177514ddf674Smrg	ifelse([$3], , :, [$3])
177614ddf674Smrgfi[]dnl
177714ddf674Smrg])# PKG_CHECK_MODULES
177814ddf674Smrg
1779