aclocal.m4 revision 4c61c93d
14c61c93dSmrg# generated automatically by aclocal 1.11 -*- Autoconf -*-
211d341caSmrg
311d341caSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
44c61c93dSmrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
511d341caSmrg# This file is free software; the Free Software Foundation
611d341caSmrg# gives unlimited permission to copy and/or distribute it,
711d341caSmrg# with or without modifications, as long as this notice is preserved.
811d341caSmrg
911d341caSmrg# This program is distributed in the hope that it will be useful,
1011d341caSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1111d341caSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1211d341caSmrg# PARTICULAR PURPOSE.
1311d341caSmrg
144c61c93dSmrgm4_ifndef([AC_AUTOCONF_VERSION],
154c61c93dSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
164c61c93dSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
174c61c93dSmrg[m4_warning([this file was generated for autoconf 2.63.
184c61c93dSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
194c61c93dSmrgIf you have problems, you may need to regenerate the build system entirely.
204c61c93dSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
2111d341caSmrg
224c61c93dSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
2311d341caSmrg#
2411d341caSmrg# This file is free software; the Free Software Foundation
2511d341caSmrg# gives unlimited permission to copy and/or distribute it,
2611d341caSmrg# with or without modifications, as long as this notice is preserved.
2711d341caSmrg
2811d341caSmrg# AM_AUTOMAKE_VERSION(VERSION)
2911d341caSmrg# ----------------------------
3011d341caSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
3111d341caSmrg# generated from the m4 files accompanying Automake X.Y.
324c61c93dSmrg# (This private macro should not be called outside this file.)
334c61c93dSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
344c61c93dSmrg[am__api_version='1.11'
354c61c93dSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
364c61c93dSmrgdnl require some minimum version.  Point them to the right macro.
374c61c93dSmrgm4_if([$1], [1.11], [],
384c61c93dSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
394c61c93dSmrg])
404c61c93dSmrg
414c61c93dSmrg# _AM_AUTOCONF_VERSION(VERSION)
424c61c93dSmrg# -----------------------------
434c61c93dSmrg# aclocal traces this macro to find the Autoconf version.
444c61c93dSmrg# This is a private macro too.  Using m4_define simplifies
454c61c93dSmrg# the logic in aclocal, which can simply ignore this definition.
464c61c93dSmrgm4_define([_AM_AUTOCONF_VERSION], [])
4711d341caSmrg
4811d341caSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
4911d341caSmrg# -------------------------------
504c61c93dSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
514c61c93dSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
5211d341caSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
534c61c93dSmrg[AM_AUTOMAKE_VERSION([1.11])dnl
544c61c93dSmrgm4_ifndef([AC_AUTOCONF_VERSION],
554c61c93dSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
564c61c93dSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
5711d341caSmrg
5811d341caSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
5911d341caSmrg
6011d341caSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
6111d341caSmrg#
6211d341caSmrg# This file is free software; the Free Software Foundation
6311d341caSmrg# gives unlimited permission to copy and/or distribute it,
6411d341caSmrg# with or without modifications, as long as this notice is preserved.
6511d341caSmrg
6611d341caSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
6711d341caSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
6811d341caSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
6911d341caSmrg#
7011d341caSmrg# Of course, Automake must honor this variable whenever it calls a
7111d341caSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
7211d341caSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
7311d341caSmrg# depending on how configure is run.  This is pretty annoying, since
7411d341caSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
7511d341caSmrg# source directory, any form will work fine, but in subdirectories a
7611d341caSmrg# relative path needs to be adjusted first.
7711d341caSmrg#
7811d341caSmrg# $ac_aux_dir/missing
7911d341caSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
8011d341caSmrg# $top_srcdir/$ac_aux_dir/missing
8111d341caSmrg#    fails if $ac_aux_dir is absolute,
8211d341caSmrg#    fails when called from a subdirectory in a VPATH build with
8311d341caSmrg#          a relative $ac_aux_dir
8411d341caSmrg#
8511d341caSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
8611d341caSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
8711d341caSmrg# harmless because $srcdir is `.', but things will broke when you
8811d341caSmrg# start a VPATH build or use an absolute $srcdir.
8911d341caSmrg#
9011d341caSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
9111d341caSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
9211d341caSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
9311d341caSmrg# and then we would define $MISSING as
9411d341caSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
9511d341caSmrg# This will work as long as MISSING is not called from configure, because
9611d341caSmrg# unfortunately $(top_srcdir) has no meaning in configure.
9711d341caSmrg# However there are other variables, like CC, which are often used in
9811d341caSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
9911d341caSmrg#
10011d341caSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
10111d341caSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
10211d341caSmrg# configured tree to be moved without reconfiguration.
10311d341caSmrg
10411d341caSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
10511d341caSmrg[dnl Rely on autoconf to set up CDPATH properly.
10611d341caSmrgAC_PREREQ([2.50])dnl
10711d341caSmrg# expand $ac_aux_dir to an absolute path
10811d341caSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
10911d341caSmrg])
11011d341caSmrg
11111d341caSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
11211d341caSmrg
1134c61c93dSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
11411d341caSmrg# Free Software Foundation, Inc.
11511d341caSmrg#
11611d341caSmrg# This file is free software; the Free Software Foundation
11711d341caSmrg# gives unlimited permission to copy and/or distribute it,
11811d341caSmrg# with or without modifications, as long as this notice is preserved.
11911d341caSmrg
1204c61c93dSmrg# serial 9
12111d341caSmrg
12211d341caSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
12311d341caSmrg# -------------------------------------
12411d341caSmrg# Define a conditional.
12511d341caSmrgAC_DEFUN([AM_CONDITIONAL],
12611d341caSmrg[AC_PREREQ(2.52)dnl
12711d341caSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
12811d341caSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1294c61c93dSmrgAC_SUBST([$1_TRUE])dnl
1304c61c93dSmrgAC_SUBST([$1_FALSE])dnl
1314c61c93dSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
1324c61c93dSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
1334c61c93dSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
13411d341caSmrgif $2; then
13511d341caSmrg  $1_TRUE=
13611d341caSmrg  $1_FALSE='#'
13711d341caSmrgelse
13811d341caSmrg  $1_TRUE='#'
13911d341caSmrg  $1_FALSE=
14011d341caSmrgfi
14111d341caSmrgAC_CONFIG_COMMANDS_PRE(
14211d341caSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
14311d341caSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
14411d341caSmrgUsually this means the macro was only invoked conditionally.]])
14511d341caSmrgfi])])
14611d341caSmrg
1474c61c93dSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
1484c61c93dSmrg# Free Software Foundation, Inc.
1494c61c93dSmrg#
1504c61c93dSmrg# This file is free software; the Free Software Foundation
1514c61c93dSmrg# gives unlimited permission to copy and/or distribute it,
1524c61c93dSmrg# with or without modifications, as long as this notice is preserved.
1534c61c93dSmrg
1544c61c93dSmrg# serial 10
1554c61c93dSmrg
1564c61c93dSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1574c61c93dSmrg# written in clear, in which case automake, when reading aclocal.m4,
1584c61c93dSmrg# will think it sees a *use*, and therefore will trigger all it's
1594c61c93dSmrg# C support machinery.  Also note that it means that autoscan, seeing
1604c61c93dSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
16111d341caSmrg
1624c61c93dSmrg
1634c61c93dSmrg# _AM_DEPENDENCIES(NAME)
1644c61c93dSmrg# ----------------------
1654c61c93dSmrg# See how the compiler implements dependency checking.
1664c61c93dSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
1674c61c93dSmrg# We try a few techniques and use that to set a single cache variable.
1684c61c93dSmrg#
1694c61c93dSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1704c61c93dSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1714c61c93dSmrg# dependency, and given that the user is not expected to run this macro,
1724c61c93dSmrg# just rely on AC_PROG_CC.
1734c61c93dSmrgAC_DEFUN([_AM_DEPENDENCIES],
1744c61c93dSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
1754c61c93dSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1764c61c93dSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
1774c61c93dSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1784c61c93dSmrg
1794c61c93dSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
1804c61c93dSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
1814c61c93dSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1824c61c93dSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
1834c61c93dSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1844c61c93dSmrg                   [depcc="$$1"   am_compiler_list=])
1854c61c93dSmrg
1864c61c93dSmrgAC_CACHE_CHECK([dependency style of $depcc],
1874c61c93dSmrg               [am_cv_$1_dependencies_compiler_type],
1884c61c93dSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1894c61c93dSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
1904c61c93dSmrg  # making bogus files that we don't know about and never remove.  For
1914c61c93dSmrg  # instance it was reported that on HP-UX the gcc test will end up
1924c61c93dSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
1934c61c93dSmrg  # in D'.
1944c61c93dSmrg  mkdir conftest.dir
1954c61c93dSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
1964c61c93dSmrg  # using a relative directory.
1974c61c93dSmrg  cp "$am_depcomp" conftest.dir
1984c61c93dSmrg  cd conftest.dir
1994c61c93dSmrg  # We will build objects and dependencies in a subdirectory because
2004c61c93dSmrg  # it helps to detect inapplicable dependency modes.  For instance
2014c61c93dSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
2024c61c93dSmrg  # side effect of compilation, but ICC will put the dependencies in
2034c61c93dSmrg  # the current directory while Tru64 will put them in the object
2044c61c93dSmrg  # directory.
2054c61c93dSmrg  mkdir sub
2064c61c93dSmrg
2074c61c93dSmrg  am_cv_$1_dependencies_compiler_type=none
2084c61c93dSmrg  if test "$am_compiler_list" = ""; then
2094c61c93dSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2104c61c93dSmrg  fi
2114c61c93dSmrg  am__universal=false
2124c61c93dSmrg  m4_case([$1], [CC],
2134c61c93dSmrg    [case " $depcc " in #(
2144c61c93dSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2154c61c93dSmrg     esac],
2164c61c93dSmrg    [CXX],
2174c61c93dSmrg    [case " $depcc " in #(
2184c61c93dSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2194c61c93dSmrg     esac])
2204c61c93dSmrg
2214c61c93dSmrg  for depmode in $am_compiler_list; do
2224c61c93dSmrg    # Setup a source with many dependencies, because some compilers
2234c61c93dSmrg    # like to wrap large dependency lists on column 80 (with \), and
2244c61c93dSmrg    # we should not choose a depcomp mode which is confused by this.
2254c61c93dSmrg    #
2264c61c93dSmrg    # We need to recreate these files for each test, as the compiler may
2274c61c93dSmrg    # overwrite some of them when testing with obscure command lines.
2284c61c93dSmrg    # This happens at least with the AIX C compiler.
2294c61c93dSmrg    : > sub/conftest.c
2304c61c93dSmrg    for i in 1 2 3 4 5 6; do
2314c61c93dSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
2324c61c93dSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
2334c61c93dSmrg      # Solaris 8's {/usr,}/bin/sh.
2344c61c93dSmrg      touch sub/conftst$i.h
2354c61c93dSmrg    done
2364c61c93dSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2374c61c93dSmrg
2384c61c93dSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
2394c61c93dSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
2404c61c93dSmrg    # handle `-M -o', and we need to detect this.  Also, some Intel
2414c61c93dSmrg    # versions had trouble with output in subdirs
2424c61c93dSmrg    am__obj=sub/conftest.${OBJEXT-o}
2434c61c93dSmrg    am__minus_obj="-o $am__obj"
2444c61c93dSmrg    case $depmode in
2454c61c93dSmrg    gcc)
2464c61c93dSmrg      # This depmode causes a compiler race in universal mode.
2474c61c93dSmrg      test "$am__universal" = false || continue
2484c61c93dSmrg      ;;
2494c61c93dSmrg    nosideeffect)
2504c61c93dSmrg      # after this tag, mechanisms are not by side-effect, so they'll
2514c61c93dSmrg      # only be used when explicitly requested
2524c61c93dSmrg      if test "x$enable_dependency_tracking" = xyes; then
2534c61c93dSmrg	continue
2544c61c93dSmrg      else
2554c61c93dSmrg	break
2564c61c93dSmrg      fi
2574c61c93dSmrg      ;;
2584c61c93dSmrg    msvisualcpp | msvcmsys)
2594c61c93dSmrg      # This compiler won't grok `-c -o', but also, the minuso test has
2604c61c93dSmrg      # not run yet.  These depmodes are late enough in the game, and
2614c61c93dSmrg      # so weak that their functioning should not be impacted.
2624c61c93dSmrg      am__obj=conftest.${OBJEXT-o}
2634c61c93dSmrg      am__minus_obj=
2644c61c93dSmrg      ;;
2654c61c93dSmrg    none) break ;;
2664c61c93dSmrg    esac
2674c61c93dSmrg    if depmode=$depmode \
2684c61c93dSmrg       source=sub/conftest.c object=$am__obj \
2694c61c93dSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
2704c61c93dSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
2714c61c93dSmrg         >/dev/null 2>conftest.err &&
2724c61c93dSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
2734c61c93dSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
2744c61c93dSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
2754c61c93dSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
2764c61c93dSmrg      # icc doesn't choke on unknown options, it will just issue warnings
2774c61c93dSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
2784c61c93dSmrg      # that says an option was ignored or not supported.
2794c61c93dSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
2804c61c93dSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
2814c61c93dSmrg      # The diagnosis changed in icc 8.0:
2824c61c93dSmrg      #   icc: Command line remark: option '-MP' not supported
2834c61c93dSmrg      if (grep 'ignoring option' conftest.err ||
2844c61c93dSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
2854c61c93dSmrg        am_cv_$1_dependencies_compiler_type=$depmode
2864c61c93dSmrg        break
2874c61c93dSmrg      fi
2884c61c93dSmrg    fi
2894c61c93dSmrg  done
2904c61c93dSmrg
2914c61c93dSmrg  cd ..
2924c61c93dSmrg  rm -rf conftest.dir
2934c61c93dSmrgelse
2944c61c93dSmrg  am_cv_$1_dependencies_compiler_type=none
2954c61c93dSmrgfi
2964c61c93dSmrg])
2974c61c93dSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
2984c61c93dSmrgAM_CONDITIONAL([am__fastdep$1], [
2994c61c93dSmrg  test "x$enable_dependency_tracking" != xno \
3004c61c93dSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
3014c61c93dSmrg])
3024c61c93dSmrg
3034c61c93dSmrg
3044c61c93dSmrg# AM_SET_DEPDIR
3054c61c93dSmrg# -------------
3064c61c93dSmrg# Choose a directory name for dependency files.
3074c61c93dSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
3084c61c93dSmrgAC_DEFUN([AM_SET_DEPDIR],
3094c61c93dSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
3104c61c93dSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
3114c61c93dSmrg])
3124c61c93dSmrg
3134c61c93dSmrg
3144c61c93dSmrg# AM_DEP_TRACK
3154c61c93dSmrg# ------------
3164c61c93dSmrgAC_DEFUN([AM_DEP_TRACK],
3174c61c93dSmrg[AC_ARG_ENABLE(dependency-tracking,
3184c61c93dSmrg[  --disable-dependency-tracking  speeds up one-time build
3194c61c93dSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
3204c61c93dSmrgif test "x$enable_dependency_tracking" != xno; then
3214c61c93dSmrg  am_depcomp="$ac_aux_dir/depcomp"
3224c61c93dSmrg  AMDEPBACKSLASH='\'
3234c61c93dSmrgfi
3244c61c93dSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
3254c61c93dSmrgAC_SUBST([AMDEPBACKSLASH])dnl
3264c61c93dSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
3274c61c93dSmrg])
3284c61c93dSmrg
3294c61c93dSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
3304c61c93dSmrg
3314c61c93dSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
33211d341caSmrg# Free Software Foundation, Inc.
33311d341caSmrg#
33411d341caSmrg# This file is free software; the Free Software Foundation
33511d341caSmrg# gives unlimited permission to copy and/or distribute it,
33611d341caSmrg# with or without modifications, as long as this notice is preserved.
33711d341caSmrg
3384c61c93dSmrg#serial 5
3394c61c93dSmrg
3404c61c93dSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
3414c61c93dSmrg# ------------------------------
3424c61c93dSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
3434c61c93dSmrg[{
3444c61c93dSmrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
3454c61c93dSmrg  # are listed without --file.  Let's play safe and only enable the eval
3464c61c93dSmrg  # if we detect the quoting.
3474c61c93dSmrg  case $CONFIG_FILES in
3484c61c93dSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
3494c61c93dSmrg  *)   set x $CONFIG_FILES ;;
3504c61c93dSmrg  esac
3514c61c93dSmrg  shift
3524c61c93dSmrg  for mf
3534c61c93dSmrg  do
3544c61c93dSmrg    # Strip MF so we end up with the name of the file.
3554c61c93dSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
3564c61c93dSmrg    # Check whether this is an Automake generated Makefile or not.
3574c61c93dSmrg    # We used to match only the files named `Makefile.in', but
3584c61c93dSmrg    # some people rename them; so instead we look at the file content.
3594c61c93dSmrg    # Grep'ing the first line is not enough: some people post-process
3604c61c93dSmrg    # each Makefile.in and add a new line on top of each file to say so.
3614c61c93dSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
3624c61c93dSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
3634c61c93dSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
3644c61c93dSmrg      dirpart=`AS_DIRNAME("$mf")`
3654c61c93dSmrg    else
3664c61c93dSmrg      continue
3674c61c93dSmrg    fi
3684c61c93dSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
3694c61c93dSmrg    # from the Makefile without running `make'.
3704c61c93dSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
3714c61c93dSmrg    test -z "$DEPDIR" && continue
3724c61c93dSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
3734c61c93dSmrg    test -z "am__include" && continue
3744c61c93dSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
3754c61c93dSmrg    # When using ansi2knr, U may be empty or an underscore; expand it
3764c61c93dSmrg    U=`sed -n 's/^U = //p' < "$mf"`
3774c61c93dSmrg    # Find all dependency output files, they are included files with
3784c61c93dSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
3794c61c93dSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
3804c61c93dSmrg    # expansion.
3814c61c93dSmrg    for file in `sed -n "
3824c61c93dSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
3834c61c93dSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
3844c61c93dSmrg      # Make sure the directory exists.
3854c61c93dSmrg      test -f "$dirpart/$file" && continue
3864c61c93dSmrg      fdir=`AS_DIRNAME(["$file"])`
3874c61c93dSmrg      AS_MKDIR_P([$dirpart/$fdir])
3884c61c93dSmrg      # echo "creating $dirpart/$file"
3894c61c93dSmrg      echo '# dummy' > "$dirpart/$file"
3904c61c93dSmrg    done
3914c61c93dSmrg  done
3924c61c93dSmrg}
3934c61c93dSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
3944c61c93dSmrg
3954c61c93dSmrg
3964c61c93dSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
3974c61c93dSmrg# -----------------------------
3984c61c93dSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
3994c61c93dSmrg#
4004c61c93dSmrg# This code is only required when automatic dependency tracking
4014c61c93dSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
4024c61c93dSmrg# need in order to bootstrap the dependency handling code.
4034c61c93dSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
4044c61c93dSmrg[AC_CONFIG_COMMANDS([depfiles],
4054c61c93dSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
4064c61c93dSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
4074c61c93dSmrg])
4084c61c93dSmrg
4094c61c93dSmrg# Do all the work for Automake.                             -*- Autoconf -*-
4104c61c93dSmrg
4114c61c93dSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4124c61c93dSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
4134c61c93dSmrg#
4144c61c93dSmrg# This file is free software; the Free Software Foundation
4154c61c93dSmrg# gives unlimited permission to copy and/or distribute it,
4164c61c93dSmrg# with or without modifications, as long as this notice is preserved.
4174c61c93dSmrg
4184c61c93dSmrg# serial 16
41911d341caSmrg
42011d341caSmrg# This macro actually does too much.  Some checks are only needed if
42111d341caSmrg# your package does certain things.  But this isn't really a big deal.
42211d341caSmrg
42311d341caSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
42411d341caSmrg# AM_INIT_AUTOMAKE([OPTIONS])
42511d341caSmrg# -----------------------------------------------
42611d341caSmrg# The call with PACKAGE and VERSION arguments is the old style
42711d341caSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
42811d341caSmrg# and VERSION should now be passed to AC_INIT and removed from
42911d341caSmrg# the call to AM_INIT_AUTOMAKE.
43011d341caSmrg# We support both call styles for the transition.  After
43111d341caSmrg# the next Automake release, Autoconf can make the AC_INIT
43211d341caSmrg# arguments mandatory, and then we can depend on a new Autoconf
43311d341caSmrg# release and drop the old call support.
43411d341caSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
4354c61c93dSmrg[AC_PREREQ([2.62])dnl
43611d341caSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
43711d341caSmrgdnl the ones we care about.
43811d341caSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
43911d341caSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
44011d341caSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
4414c61c93dSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
4424c61c93dSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
4434c61c93dSmrg  # is not polluted with repeated "-I."
4444c61c93dSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
4454c61c93dSmrg  # test to see if srcdir already configured
4464c61c93dSmrg  if test -f $srcdir/config.status; then
4474c61c93dSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
4484c61c93dSmrg  fi
44911d341caSmrgfi
45011d341caSmrg
45111d341caSmrg# test whether we have cygpath
45211d341caSmrgif test -z "$CYGPATH_W"; then
45311d341caSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
45411d341caSmrg    CYGPATH_W='cygpath -w'
45511d341caSmrg  else
45611d341caSmrg    CYGPATH_W=echo
45711d341caSmrg  fi
45811d341caSmrgfi
45911d341caSmrgAC_SUBST([CYGPATH_W])
46011d341caSmrg
46111d341caSmrg# Define the identity of the package.
46211d341caSmrgdnl Distinguish between old-style and new-style calls.
46311d341caSmrgm4_ifval([$2],
46411d341caSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
46511d341caSmrg AC_SUBST([PACKAGE], [$1])dnl
46611d341caSmrg AC_SUBST([VERSION], [$2])],
46711d341caSmrg[_AM_SET_OPTIONS([$1])dnl
4684c61c93dSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
4694c61c93dSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
4704c61c93dSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
47111d341caSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
47211d341caSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
47311d341caSmrg
47411d341caSmrg_AM_IF_OPTION([no-define],,
47511d341caSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
47611d341caSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
47711d341caSmrg
47811d341caSmrg# Some tools Automake needs.
47911d341caSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
48011d341caSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
48111d341caSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
48211d341caSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
48311d341caSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
48411d341caSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
48511d341caSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
4864c61c93dSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
4874c61c93dSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
48811d341caSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
48911d341caSmrg# We need awk for the "check" target.  The system "awk" is bad on
49011d341caSmrg# some platforms.
49111d341caSmrgAC_REQUIRE([AC_PROG_AWK])dnl
49211d341caSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
49311d341caSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
49411d341caSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
4954c61c93dSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
4964c61c93dSmrg			     [_AM_PROG_TAR([v7])])])
49711d341caSmrg_AM_IF_OPTION([no-dependencies],,
49811d341caSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
4994c61c93dSmrg		  [_AM_DEPENDENCIES(CC)],
5004c61c93dSmrg		  [define([AC_PROG_CC],
5014c61c93dSmrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
50211d341caSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
5034c61c93dSmrg		  [_AM_DEPENDENCIES(CXX)],
5044c61c93dSmrg		  [define([AC_PROG_CXX],
5054c61c93dSmrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
5064c61c93dSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
5074c61c93dSmrg		  [_AM_DEPENDENCIES(OBJC)],
5084c61c93dSmrg		  [define([AC_PROG_OBJC],
5094c61c93dSmrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
51011d341caSmrg])
5114c61c93dSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
5124c61c93dSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
5134c61c93dSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
5144c61c93dSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
5154c61c93dSmrgAC_CONFIG_COMMANDS_PRE(dnl
5164c61c93dSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
5174c61c93dSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
51811d341caSmrg])
51911d341caSmrg
5204c61c93dSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
5214c61c93dSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
5224c61c93dSmrgdnl mangled by Autoconf and run in a shell conditional statement.
5234c61c93dSmrgm4_define([_AC_COMPILER_EXEEXT],
5244c61c93dSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
5254c61c93dSmrg
52611d341caSmrg
52711d341caSmrg# When config.status generates a header, we must update the stamp-h file.
52811d341caSmrg# This file resides in the same directory as the config header
52911d341caSmrg# that is generated.  The stamp files are numbered to have different names.
53011d341caSmrg
53111d341caSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
53211d341caSmrg# loop where config.status creates the headers, so we can generate
53311d341caSmrg# our stamp files there.
53411d341caSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
53511d341caSmrg[# Compute $1's index in $config_headers.
5364c61c93dSmrg_am_arg=$1
53711d341caSmrg_am_stamp_count=1
53811d341caSmrgfor _am_header in $config_headers :; do
53911d341caSmrg  case $_am_header in
5404c61c93dSmrg    $_am_arg | $_am_arg:* )
54111d341caSmrg      break ;;
54211d341caSmrg    * )
54311d341caSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
54411d341caSmrg  esac
54511d341caSmrgdone
5464c61c93dSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
54711d341caSmrg
5484c61c93dSmrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
54911d341caSmrg#
55011d341caSmrg# This file is free software; the Free Software Foundation
55111d341caSmrg# gives unlimited permission to copy and/or distribute it,
55211d341caSmrg# with or without modifications, as long as this notice is preserved.
55311d341caSmrg
55411d341caSmrg# AM_PROG_INSTALL_SH
55511d341caSmrg# ------------------
55611d341caSmrg# Define $install_sh.
55711d341caSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
55811d341caSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
5594c61c93dSmrgif test x"${install_sh}" != xset; then
5604c61c93dSmrg  case $am_aux_dir in
5614c61c93dSmrg  *\ * | *\	*)
5624c61c93dSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
5634c61c93dSmrg  *)
5644c61c93dSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
5654c61c93dSmrg  esac
5664c61c93dSmrgfi
56711d341caSmrgAC_SUBST(install_sh)])
56811d341caSmrg
56911d341caSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
57011d341caSmrg#
57111d341caSmrg# This file is free software; the Free Software Foundation
57211d341caSmrg# gives unlimited permission to copy and/or distribute it,
57311d341caSmrg# with or without modifications, as long as this notice is preserved.
57411d341caSmrg
57511d341caSmrg# serial 2
57611d341caSmrg
57711d341caSmrg# Check whether the underlying file-system supports filenames
57811d341caSmrg# with a leading dot.  For instance MS-DOS doesn't.
57911d341caSmrgAC_DEFUN([AM_SET_LEADING_DOT],
58011d341caSmrg[rm -rf .tst 2>/dev/null
58111d341caSmrgmkdir .tst 2>/dev/null
58211d341caSmrgif test -d .tst; then
58311d341caSmrg  am__leading_dot=.
58411d341caSmrgelse
58511d341caSmrg  am__leading_dot=_
58611d341caSmrgfi
58711d341caSmrgrmdir .tst 2>/dev/null
58811d341caSmrgAC_SUBST([am__leading_dot])])
58911d341caSmrg
59011d341caSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
59111d341caSmrg# From Jim Meyering
59211d341caSmrg
5934c61c93dSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
59411d341caSmrg# Free Software Foundation, Inc.
59511d341caSmrg#
59611d341caSmrg# This file is free software; the Free Software Foundation
59711d341caSmrg# gives unlimited permission to copy and/or distribute it,
59811d341caSmrg# with or without modifications, as long as this notice is preserved.
59911d341caSmrg
6004c61c93dSmrg# serial 5
60111d341caSmrg
6024c61c93dSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
6034c61c93dSmrg# ----------------------------------
6044c61c93dSmrg# Control maintainer-specific portions of Makefiles.
6054c61c93dSmrg# Default is to disable them, unless `enable' is passed literally.
6064c61c93dSmrg# For symmetry, `disable' may be passed as well.  Anyway, the user
6074c61c93dSmrg# can override the default with the --enable/--disable switch.
60811d341caSmrgAC_DEFUN([AM_MAINTAINER_MODE],
6094c61c93dSmrg[m4_case(m4_default([$1], [disable]),
6104c61c93dSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
6114c61c93dSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
6124c61c93dSmrg       [m4_define([am_maintainer_other], [enable])
6134c61c93dSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
6144c61c93dSmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
6154c61c93dSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
6164c61c93dSmrg  AC_ARG_ENABLE([maintainer-mode],
6174c61c93dSmrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
61811d341caSmrg			  (and sometimes confusing) to the casual installer],
6194c61c93dSmrg      [USE_MAINTAINER_MODE=$enableval],
6204c61c93dSmrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
62111d341caSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
6224c61c93dSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
62311d341caSmrg  MAINT=$MAINTAINER_MODE_TRUE
6244c61c93dSmrg  AC_SUBST([MAINT])dnl
62511d341caSmrg]
62611d341caSmrg)
62711d341caSmrg
62811d341caSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
62911d341caSmrg
6304c61c93dSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
6314c61c93dSmrg
6324c61c93dSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
6334c61c93dSmrg#
6344c61c93dSmrg# This file is free software; the Free Software Foundation
6354c61c93dSmrg# gives unlimited permission to copy and/or distribute it,
6364c61c93dSmrg# with or without modifications, as long as this notice is preserved.
6374c61c93dSmrg
6384c61c93dSmrg# serial 4
6394c61c93dSmrg
6404c61c93dSmrg# AM_MAKE_INCLUDE()
6414c61c93dSmrg# -----------------
6424c61c93dSmrg# Check to see how make treats includes.
6434c61c93dSmrgAC_DEFUN([AM_MAKE_INCLUDE],
6444c61c93dSmrg[am_make=${MAKE-make}
6454c61c93dSmrgcat > confinc << 'END'
6464c61c93dSmrgam__doit:
6474c61c93dSmrg	@echo this is the am__doit target
6484c61c93dSmrg.PHONY: am__doit
6494c61c93dSmrgEND
6504c61c93dSmrg# If we don't find an include directive, just comment out the code.
6514c61c93dSmrgAC_MSG_CHECKING([for style of include used by $am_make])
6524c61c93dSmrgam__include="#"
6534c61c93dSmrgam__quote=
6544c61c93dSmrg_am_result=none
6554c61c93dSmrg# First try GNU make style include.
6564c61c93dSmrgecho "include confinc" > confmf
6574c61c93dSmrg# Ignore all kinds of additional output from `make'.
6584c61c93dSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
6594c61c93dSmrg*the\ am__doit\ target*)
6604c61c93dSmrg  am__include=include
6614c61c93dSmrg  am__quote=
6624c61c93dSmrg  _am_result=GNU
6634c61c93dSmrg  ;;
6644c61c93dSmrgesac
6654c61c93dSmrg# Now try BSD make style include.
6664c61c93dSmrgif test "$am__include" = "#"; then
6674c61c93dSmrg   echo '.include "confinc"' > confmf
6684c61c93dSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
6694c61c93dSmrg   *the\ am__doit\ target*)
6704c61c93dSmrg     am__include=.include
6714c61c93dSmrg     am__quote="\""
6724c61c93dSmrg     _am_result=BSD
6734c61c93dSmrg     ;;
6744c61c93dSmrg   esac
6754c61c93dSmrgfi
6764c61c93dSmrgAC_SUBST([am__include])
6774c61c93dSmrgAC_SUBST([am__quote])
6784c61c93dSmrgAC_MSG_RESULT([$_am_result])
6794c61c93dSmrgrm -f confinc confmf
6804c61c93dSmrg])
6814c61c93dSmrg
68211d341caSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
68311d341caSmrg
6844c61c93dSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
68511d341caSmrg# Free Software Foundation, Inc.
68611d341caSmrg#
68711d341caSmrg# This file is free software; the Free Software Foundation
68811d341caSmrg# gives unlimited permission to copy and/or distribute it,
68911d341caSmrg# with or without modifications, as long as this notice is preserved.
69011d341caSmrg
6914c61c93dSmrg# serial 6
69211d341caSmrg
69311d341caSmrg# AM_MISSING_PROG(NAME, PROGRAM)
69411d341caSmrg# ------------------------------
69511d341caSmrgAC_DEFUN([AM_MISSING_PROG],
69611d341caSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
69711d341caSmrg$1=${$1-"${am_missing_run}$2"}
69811d341caSmrgAC_SUBST($1)])
69911d341caSmrg
70011d341caSmrg
70111d341caSmrg# AM_MISSING_HAS_RUN
70211d341caSmrg# ------------------
70311d341caSmrg# Define MISSING if not defined so far and test if it supports --run.
70411d341caSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
70511d341caSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
70611d341caSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
7074c61c93dSmrgAC_REQUIRE_AUX_FILE([missing])dnl
7084c61c93dSmrgif test x"${MISSING+set}" != xset; then
7094c61c93dSmrg  case $am_aux_dir in
7104c61c93dSmrg  *\ * | *\	*)
7114c61c93dSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
7124c61c93dSmrg  *)
7134c61c93dSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
7144c61c93dSmrg  esac
7154c61c93dSmrgfi
71611d341caSmrg# Use eval to expand $SHELL
71711d341caSmrgif eval "$MISSING --run true"; then
71811d341caSmrg  am_missing_run="$MISSING --run "
71911d341caSmrgelse
72011d341caSmrg  am_missing_run=
72111d341caSmrg  AC_MSG_WARN([`missing' script is too old or missing])
72211d341caSmrgfi
72311d341caSmrg])
72411d341caSmrg
7254c61c93dSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
72611d341caSmrg#
72711d341caSmrg# This file is free software; the Free Software Foundation
72811d341caSmrg# gives unlimited permission to copy and/or distribute it,
72911d341caSmrg# with or without modifications, as long as this notice is preserved.
73011d341caSmrg
73111d341caSmrg# AM_PROG_MKDIR_P
73211d341caSmrg# ---------------
7334c61c93dSmrg# Check for `mkdir -p'.
73411d341caSmrgAC_DEFUN([AM_PROG_MKDIR_P],
7354c61c93dSmrg[AC_PREREQ([2.60])dnl
7364c61c93dSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
7374c61c93dSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
7384c61c93dSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
7394c61c93dSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
7404c61c93dSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
7414c61c93dSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
7424c61c93dSmrgdnl adjustment using top_builddir (which is defined more often than
7434c61c93dSmrgdnl MKDIR_P).
7444c61c93dSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
7454c61c93dSmrgcase $mkdir_p in
7464c61c93dSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
7474c61c93dSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
7484c61c93dSmrgesac
7494c61c93dSmrg])
75011d341caSmrg
75111d341caSmrg# Helper functions for option handling.                     -*- Autoconf -*-
75211d341caSmrg
7534c61c93dSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
75411d341caSmrg#
75511d341caSmrg# This file is free software; the Free Software Foundation
75611d341caSmrg# gives unlimited permission to copy and/or distribute it,
75711d341caSmrg# with or without modifications, as long as this notice is preserved.
75811d341caSmrg
7594c61c93dSmrg# serial 4
76011d341caSmrg
76111d341caSmrg# _AM_MANGLE_OPTION(NAME)
76211d341caSmrg# -----------------------
76311d341caSmrgAC_DEFUN([_AM_MANGLE_OPTION],
76411d341caSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
76511d341caSmrg
76611d341caSmrg# _AM_SET_OPTION(NAME)
76711d341caSmrg# ------------------------------
76811d341caSmrg# Set option NAME.  Presently that only means defining a flag for this option.
76911d341caSmrgAC_DEFUN([_AM_SET_OPTION],
77011d341caSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
77111d341caSmrg
77211d341caSmrg# _AM_SET_OPTIONS(OPTIONS)
77311d341caSmrg# ----------------------------------
77411d341caSmrg# OPTIONS is a space-separated list of Automake options.
77511d341caSmrgAC_DEFUN([_AM_SET_OPTIONS],
7764c61c93dSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
77711d341caSmrg
77811d341caSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
77911d341caSmrg# -------------------------------------------
78011d341caSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
78111d341caSmrgAC_DEFUN([_AM_IF_OPTION],
78211d341caSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
78311d341caSmrg
78411d341caSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
78511d341caSmrg
7864c61c93dSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
78711d341caSmrg# Free Software Foundation, Inc.
78811d341caSmrg#
78911d341caSmrg# This file is free software; the Free Software Foundation
79011d341caSmrg# gives unlimited permission to copy and/or distribute it,
79111d341caSmrg# with or without modifications, as long as this notice is preserved.
79211d341caSmrg
7934c61c93dSmrg# serial 5
79411d341caSmrg
79511d341caSmrg# AM_SANITY_CHECK
79611d341caSmrg# ---------------
79711d341caSmrgAC_DEFUN([AM_SANITY_CHECK],
79811d341caSmrg[AC_MSG_CHECKING([whether build environment is sane])
79911d341caSmrg# Just in case
80011d341caSmrgsleep 1
80111d341caSmrgecho timestamp > conftest.file
8024c61c93dSmrg# Reject unsafe characters in $srcdir or the absolute working directory
8034c61c93dSmrg# name.  Accept space and tab only in the latter.
8044c61c93dSmrgam_lf='
8054c61c93dSmrg'
8064c61c93dSmrgcase `pwd` in
8074c61c93dSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
8084c61c93dSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
8094c61c93dSmrgesac
8104c61c93dSmrgcase $srcdir in
8114c61c93dSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
8124c61c93dSmrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
8134c61c93dSmrgesac
8144c61c93dSmrg
81511d341caSmrg# Do `set' in a subshell so we don't clobber the current shell's
81611d341caSmrg# arguments.  Must try -L first in case configure is actually a
81711d341caSmrg# symlink; some systems play weird games with the mod time of symlinks
81811d341caSmrg# (eg FreeBSD returns the mod time of the symlink's containing
81911d341caSmrg# directory).
82011d341caSmrgif (
8214c61c93dSmrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
82211d341caSmrg   if test "$[*]" = "X"; then
82311d341caSmrg      # -L didn't work.
8244c61c93dSmrg      set X `ls -t "$srcdir/configure" conftest.file`
82511d341caSmrg   fi
82611d341caSmrg   rm -f conftest.file
82711d341caSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
82811d341caSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
82911d341caSmrg
83011d341caSmrg      # If neither matched, then we have a broken ls.  This can happen
83111d341caSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
83211d341caSmrg      # broken ls alias from the environment.  This has actually
83311d341caSmrg      # happened.  Such a system could not be considered "sane".
83411d341caSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
83511d341caSmrgalias in your environment])
83611d341caSmrg   fi
83711d341caSmrg
83811d341caSmrg   test "$[2]" = conftest.file
83911d341caSmrg   )
84011d341caSmrgthen
84111d341caSmrg   # Ok.
84211d341caSmrg   :
84311d341caSmrgelse
84411d341caSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
84511d341caSmrgCheck your system clock])
84611d341caSmrgfi
84711d341caSmrgAC_MSG_RESULT(yes)])
84811d341caSmrg
8494c61c93dSmrg# Copyright (C) 2009  Free Software Foundation, Inc.
8504c61c93dSmrg#
8514c61c93dSmrg# This file is free software; the Free Software Foundation
8524c61c93dSmrg# gives unlimited permission to copy and/or distribute it,
8534c61c93dSmrg# with or without modifications, as long as this notice is preserved.
8544c61c93dSmrg
8554c61c93dSmrg# serial 1
8564c61c93dSmrg
8574c61c93dSmrg# AM_SILENT_RULES([DEFAULT])
8584c61c93dSmrg# --------------------------
8594c61c93dSmrg# Enable less verbose build rules; with the default set to DEFAULT
8604c61c93dSmrg# (`yes' being less verbose, `no' or empty being verbose).
8614c61c93dSmrgAC_DEFUN([AM_SILENT_RULES],
8624c61c93dSmrg[AC_ARG_ENABLE([silent-rules],
8634c61c93dSmrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
8644c61c93dSmrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
8654c61c93dSmrgcase $enable_silent_rules in
8664c61c93dSmrgyes) AM_DEFAULT_VERBOSITY=0;;
8674c61c93dSmrgno)  AM_DEFAULT_VERBOSITY=1;;
8684c61c93dSmrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
8694c61c93dSmrgesac
8704c61c93dSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
8714c61c93dSmrgAM_BACKSLASH='\'
8724c61c93dSmrgAC_SUBST([AM_BACKSLASH])dnl
8734c61c93dSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
8744c61c93dSmrg])
8754c61c93dSmrg
87611d341caSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
87711d341caSmrg#
87811d341caSmrg# This file is free software; the Free Software Foundation
87911d341caSmrg# gives unlimited permission to copy and/or distribute it,
88011d341caSmrg# with or without modifications, as long as this notice is preserved.
88111d341caSmrg
88211d341caSmrg# AM_PROG_INSTALL_STRIP
88311d341caSmrg# ---------------------
88411d341caSmrg# One issue with vendor `install' (even GNU) is that you can't
88511d341caSmrg# specify the program used to strip binaries.  This is especially
88611d341caSmrg# annoying in cross-compiling environments, where the build's strip
88711d341caSmrg# is unlikely to handle the host's binaries.
88811d341caSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
88911d341caSmrg# always use install-sh in `make install-strip', and initialize
89011d341caSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
89111d341caSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
89211d341caSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
89311d341caSmrg# Installed binaries are usually stripped using `strip' when the user
89411d341caSmrg# run `make install-strip'.  However `strip' might not be the right
89511d341caSmrg# tool to use in cross-compilation environments, therefore Automake
89611d341caSmrg# will honor the `STRIP' environment variable to overrule this program.
89711d341caSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
89811d341caSmrgif test "$cross_compiling" != no; then
89911d341caSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
90011d341caSmrgfi
9014c61c93dSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
90211d341caSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
90311d341caSmrg
9044c61c93dSmrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
9054c61c93dSmrg#
9064c61c93dSmrg# This file is free software; the Free Software Foundation
9074c61c93dSmrg# gives unlimited permission to copy and/or distribute it,
9084c61c93dSmrg# with or without modifications, as long as this notice is preserved.
9094c61c93dSmrg
9104c61c93dSmrg# serial 2
9114c61c93dSmrg
9124c61c93dSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
9134c61c93dSmrg# ---------------------------
9144c61c93dSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
9154c61c93dSmrg# This macro is traced by Automake.
9164c61c93dSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
9174c61c93dSmrg
9184c61c93dSmrg# AM_SUBST_NOTMAKE(VARIABLE)
9194c61c93dSmrg# ---------------------------
9204c61c93dSmrg# Public sister of _AM_SUBST_NOTMAKE.
9214c61c93dSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
9224c61c93dSmrg
92311d341caSmrg# Check how to create a tarball.                            -*- Autoconf -*-
92411d341caSmrg
92511d341caSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
92611d341caSmrg#
92711d341caSmrg# This file is free software; the Free Software Foundation
92811d341caSmrg# gives unlimited permission to copy and/or distribute it,
92911d341caSmrg# with or without modifications, as long as this notice is preserved.
93011d341caSmrg
93111d341caSmrg# serial 2
93211d341caSmrg
93311d341caSmrg# _AM_PROG_TAR(FORMAT)
93411d341caSmrg# --------------------
93511d341caSmrg# Check how to create a tarball in format FORMAT.
93611d341caSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
93711d341caSmrg#
93811d341caSmrg# Substitute a variable $(am__tar) that is a command
93911d341caSmrg# writing to stdout a FORMAT-tarball containing the directory
94011d341caSmrg# $tardir.
94111d341caSmrg#     tardir=directory && $(am__tar) > result.tar
94211d341caSmrg#
94311d341caSmrg# Substitute a variable $(am__untar) that extract such
94411d341caSmrg# a tarball read from stdin.
94511d341caSmrg#     $(am__untar) < result.tar
94611d341caSmrgAC_DEFUN([_AM_PROG_TAR],
94711d341caSmrg[# Always define AMTAR for backward compatibility.
94811d341caSmrgAM_MISSING_PROG([AMTAR], [tar])
94911d341caSmrgm4_if([$1], [v7],
95011d341caSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
95111d341caSmrg     [m4_case([$1], [ustar],, [pax],,
95211d341caSmrg              [m4_fatal([Unknown tar format])])
95311d341caSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
95411d341caSmrg# Loop over all known methods to create a tar archive until one works.
95511d341caSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
95611d341caSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
95711d341caSmrg# Do not fold the above two line into one, because Tru64 sh and
95811d341caSmrg# Solaris sh will not grok spaces in the rhs of `-'.
95911d341caSmrgfor _am_tool in $_am_tools
96011d341caSmrgdo
96111d341caSmrg  case $_am_tool in
96211d341caSmrg  gnutar)
96311d341caSmrg    for _am_tar in tar gnutar gtar;
96411d341caSmrg    do
96511d341caSmrg      AM_RUN_LOG([$_am_tar --version]) && break
96611d341caSmrg    done
96711d341caSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
96811d341caSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
96911d341caSmrg    am__untar="$_am_tar -xf -"
97011d341caSmrg    ;;
97111d341caSmrg  plaintar)
97211d341caSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
97311d341caSmrg    # ustar tarball either.
97411d341caSmrg    (tar --version) >/dev/null 2>&1 && continue
97511d341caSmrg    am__tar='tar chf - "$$tardir"'
97611d341caSmrg    am__tar_='tar chf - "$tardir"'
97711d341caSmrg    am__untar='tar xf -'
97811d341caSmrg    ;;
97911d341caSmrg  pax)
98011d341caSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
98111d341caSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
98211d341caSmrg    am__untar='pax -r'
98311d341caSmrg    ;;
98411d341caSmrg  cpio)
98511d341caSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
98611d341caSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
98711d341caSmrg    am__untar='cpio -i -H $1 -d'
98811d341caSmrg    ;;
98911d341caSmrg  none)
99011d341caSmrg    am__tar=false
99111d341caSmrg    am__tar_=false
99211d341caSmrg    am__untar=false
99311d341caSmrg    ;;
99411d341caSmrg  esac
99511d341caSmrg
99611d341caSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
99711d341caSmrg  # and am__untar set.
99811d341caSmrg  test -n "${am_cv_prog_tar_$1}" && break
99911d341caSmrg
100011d341caSmrg  # tar/untar a dummy directory, and stop if the command works
100111d341caSmrg  rm -rf conftest.dir
100211d341caSmrg  mkdir conftest.dir
100311d341caSmrg  echo GrepMe > conftest.dir/file
100411d341caSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
100511d341caSmrg  rm -rf conftest.dir
100611d341caSmrg  if test -s conftest.tar; then
100711d341caSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
100811d341caSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
100911d341caSmrg  fi
101011d341caSmrgdone
101111d341caSmrgrm -rf conftest.dir
101211d341caSmrg
101311d341caSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
101411d341caSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
101511d341caSmrgAC_SUBST([am__tar])
101611d341caSmrgAC_SUBST([am__untar])
101711d341caSmrg]) # _AM_PROG_TAR
101811d341caSmrg
10194c61c93dSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
10204c61c93dSmrgdnl
10214c61c93dSmrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
10224c61c93dSmrgdnl 
10234c61c93dSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
10244c61c93dSmrgdnl copy of this software and associated documentation files (the
10254c61c93dSmrgdnl "Software"), to deal in the Software without restriction, including
10264c61c93dSmrgdnl without limitation the rights to use, copy, modify, merge, publish,
10274c61c93dSmrgdnl distribute, and/or sell copies of the Software, and to permit persons
10284c61c93dSmrgdnl to whom the Software is furnished to do so, provided that the above
10294c61c93dSmrgdnl copyright notice(s) and this permission notice appear in all copies of
10304c61c93dSmrgdnl the Software and that both the above copyright notice(s) and this
10314c61c93dSmrgdnl permission notice appear in supporting documentation.
10324c61c93dSmrgdnl
10334c61c93dSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
10344c61c93dSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
10354c61c93dSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
10364c61c93dSmrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
10374c61c93dSmrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
10384c61c93dSmrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
10394c61c93dSmrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
10404c61c93dSmrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
10414c61c93dSmrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
10424c61c93dSmrgdnl
10434c61c93dSmrgdnl Except as contained in this notice, the name of a copyright holder
10444c61c93dSmrgdnl shall not be used in advertising or otherwise to promote the sale, use
10454c61c93dSmrgdnl or other dealings in this Software without prior written authorization
10464c61c93dSmrgdnl of the copyright holder.
10474c61c93dSmrg
10484c61c93dSmrg# XORG_MACROS_VERSION(required-version)
10494c61c93dSmrg# -------------------------------------
10504c61c93dSmrg# Minimum version: 1.1.0
10514c61c93dSmrg#
10524c61c93dSmrg# If you're using a macro added in Version 1.1 or newer, include this in
10534c61c93dSmrg# your configure.ac with the minimum required version, such as:
10544c61c93dSmrg# XORG_MACROS_VERSION(1.1)
10554c61c93dSmrg#
10564c61c93dSmrg# To ensure that this macro is defined, also add:
10574c61c93dSmrg# m4_ifndef([XORG_MACROS_VERSION],
10584c61c93dSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
10594c61c93dSmrg#
10604c61c93dSmrg#
10614c61c93dSmrg# See the "minimum version" comment for each macro you use to see what 
10624c61c93dSmrg# version you require.
10634c61c93dSmrgm4_defun([XORG_MACROS_VERSION],[
10644c61c93dSmrgm4_define([vers_have], [1.3.0])
10654c61c93dSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
10664c61c93dSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
10674c61c93dSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
10684c61c93dSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
10694c61c93dSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
10704c61c93dSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
10714c61c93dSmrgm4_undefine([vers_have])
10724c61c93dSmrgm4_undefine([maj_have])
10734c61c93dSmrgm4_undefine([maj_needed])
10744c61c93dSmrg]) # XORG_MACROS_VERSION
10754c61c93dSmrg
10764c61c93dSmrg# XORG_PROG_RAWCPP()
10774c61c93dSmrg# ------------------
10784c61c93dSmrg# Minimum version: 1.0.0
10794c61c93dSmrg#
10804c61c93dSmrg# Find cpp program and necessary flags for use in pre-processing text files
10814c61c93dSmrg# such as man pages and config files
10824c61c93dSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
10834c61c93dSmrgAC_REQUIRE([AC_PROG_CPP])
10844c61c93dSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
10854c61c93dSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
10864c61c93dSmrg
10874c61c93dSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
10884c61c93dSmrg# which is not the best choice for supporting other OS'es, but covers most
10894c61c93dSmrg# of the ones we need for now.
10904c61c93dSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
10914c61c93dSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
10924c61c93dSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
10934c61c93dSmrg	AC_MSG_RESULT([no])
10944c61c93dSmrgelse
10954c61c93dSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
10964c61c93dSmrg		RAWCPPFLAGS=-undef
10974c61c93dSmrg		AC_MSG_RESULT([yes])
10984c61c93dSmrg	# under Cygwin unix is still defined even with -undef
10994c61c93dSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
11004c61c93dSmrg		RAWCPPFLAGS="-undef -ansi"
11014c61c93dSmrg		AC_MSG_RESULT([yes, with -ansi])
11024c61c93dSmrg	else
11034c61c93dSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
11044c61c93dSmrg	fi
11054c61c93dSmrgfi
11064c61c93dSmrgrm -f conftest.$ac_ext
11074c61c93dSmrg
11084c61c93dSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
11094c61c93dSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
11104c61c93dSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
11114c61c93dSmrg	AC_MSG_RESULT([no])
11124c61c93dSmrgelse
11134c61c93dSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
11144c61c93dSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
11154c61c93dSmrg		AC_MSG_RESULT([yes])
11164c61c93dSmrg	else
11174c61c93dSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
11184c61c93dSmrg	fi
11194c61c93dSmrgfi
11204c61c93dSmrgrm -f conftest.$ac_ext
11214c61c93dSmrgAC_SUBST(RAWCPPFLAGS)
11224c61c93dSmrg]) # XORG_PROG_RAWCPP
11234c61c93dSmrg
11244c61c93dSmrg# XORG_MANPAGE_SECTIONS()
11254c61c93dSmrg# -----------------------
11264c61c93dSmrg# Minimum version: 1.0.0
11274c61c93dSmrg#
11284c61c93dSmrg# Determine which sections man pages go in for the different man page types
11294c61c93dSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
11304c61c93dSmrg# Not sure if there's any better way than just hardcoding by OS name.
11314c61c93dSmrg# Override default settings by setting environment variables
11324c61c93dSmrg
11334c61c93dSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
11344c61c93dSmrgAC_REQUIRE([AC_CANONICAL_HOST])
11354c61c93dSmrg
11364c61c93dSmrgif test x$APP_MAN_SUFFIX = x    ; then
11374c61c93dSmrg    APP_MAN_SUFFIX=1
11384c61c93dSmrgfi
11394c61c93dSmrgif test x$APP_MAN_DIR = x    ; then
11404c61c93dSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
11414c61c93dSmrgfi
11424c61c93dSmrg
11434c61c93dSmrgif test x$LIB_MAN_SUFFIX = x    ; then
11444c61c93dSmrg    LIB_MAN_SUFFIX=3
11454c61c93dSmrgfi
11464c61c93dSmrgif test x$LIB_MAN_DIR = x    ; then
11474c61c93dSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
11484c61c93dSmrgfi
11494c61c93dSmrg
11504c61c93dSmrgif test x$FILE_MAN_SUFFIX = x    ; then
11514c61c93dSmrg    case $host_os in
11524c61c93dSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
11534c61c93dSmrg	*)		FILE_MAN_SUFFIX=5  ;;
11544c61c93dSmrg    esac
11554c61c93dSmrgfi
11564c61c93dSmrgif test x$FILE_MAN_DIR = x    ; then
11574c61c93dSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
11584c61c93dSmrgfi
11594c61c93dSmrg
11604c61c93dSmrgif test x$MISC_MAN_SUFFIX = x    ; then
11614c61c93dSmrg    case $host_os in
11624c61c93dSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
11634c61c93dSmrg	*)		MISC_MAN_SUFFIX=7  ;;
11644c61c93dSmrg    esac
11654c61c93dSmrgfi
11664c61c93dSmrgif test x$MISC_MAN_DIR = x    ; then
11674c61c93dSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
11684c61c93dSmrgfi
11694c61c93dSmrg
11704c61c93dSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
11714c61c93dSmrg    case $host_os in
11724c61c93dSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
11734c61c93dSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
11744c61c93dSmrg    esac
11754c61c93dSmrgfi
11764c61c93dSmrgif test x$DRIVER_MAN_DIR = x    ; then
11774c61c93dSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
11784c61c93dSmrgfi
11794c61c93dSmrg
11804c61c93dSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
11814c61c93dSmrg    case $host_os in
11824c61c93dSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
11834c61c93dSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
11844c61c93dSmrg    esac
11854c61c93dSmrgfi
11864c61c93dSmrgif test x$ADMIN_MAN_DIR = x    ; then
11874c61c93dSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
11884c61c93dSmrgfi
11894c61c93dSmrg
11904c61c93dSmrg
11914c61c93dSmrgAC_SUBST([APP_MAN_SUFFIX])
11924c61c93dSmrgAC_SUBST([LIB_MAN_SUFFIX])
11934c61c93dSmrgAC_SUBST([FILE_MAN_SUFFIX])
11944c61c93dSmrgAC_SUBST([MISC_MAN_SUFFIX])
11954c61c93dSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
11964c61c93dSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
11974c61c93dSmrgAC_SUBST([APP_MAN_DIR])
11984c61c93dSmrgAC_SUBST([LIB_MAN_DIR])
11994c61c93dSmrgAC_SUBST([FILE_MAN_DIR])
12004c61c93dSmrgAC_SUBST([MISC_MAN_DIR])
12014c61c93dSmrgAC_SUBST([DRIVER_MAN_DIR])
12024c61c93dSmrgAC_SUBST([ADMIN_MAN_DIR])
12034c61c93dSmrg]) # XORG_MANPAGE_SECTIONS
12044c61c93dSmrg
12054c61c93dSmrg# XORG_CHECK_LINUXDOC
12064c61c93dSmrg# -------------------
12074c61c93dSmrg# Minimum version: 1.0.0
12084c61c93dSmrg#
12094c61c93dSmrg# Defines the variable MAKE_TEXT if the necessary tools and
12104c61c93dSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
12114c61c93dSmrg# Whether or not the necessary tools and files are found can be checked
12124c61c93dSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
12134c61c93dSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
12144c61c93dSmrgif test x$XORG_SGML_PATH = x ; then
12154c61c93dSmrg    XORG_SGML_PATH=$prefix/share/sgml
12164c61c93dSmrgfi
12174c61c93dSmrgHAVE_DEFS_ENT=
12184c61c93dSmrg
12194c61c93dSmrgif test x"$cross_compiling" = x"yes" ; then
12204c61c93dSmrg  HAVE_DEFS_ENT=no
12214c61c93dSmrgelse
12224c61c93dSmrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
12234c61c93dSmrgfi
12244c61c93dSmrg
12254c61c93dSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
12264c61c93dSmrgAC_PATH_PROG(PS2PDF, ps2pdf)
12274c61c93dSmrg
12284c61c93dSmrgAC_MSG_CHECKING([Whether to build documentation])
12294c61c93dSmrg
12304c61c93dSmrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
12314c61c93dSmrg   BUILDDOC=yes
12324c61c93dSmrgelse
12334c61c93dSmrg   BUILDDOC=no
12344c61c93dSmrgfi
12354c61c93dSmrg
12364c61c93dSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
12374c61c93dSmrg
12384c61c93dSmrgAC_MSG_RESULT([$BUILDDOC])
12394c61c93dSmrg
12404c61c93dSmrgAC_MSG_CHECKING([Whether to build pdf documentation])
12414c61c93dSmrg
12424c61c93dSmrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
12434c61c93dSmrg   BUILDPDFDOC=yes
12444c61c93dSmrgelse
12454c61c93dSmrg   BUILDPDFDOC=no
12464c61c93dSmrgfi
12474c61c93dSmrg
12484c61c93dSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
12494c61c93dSmrg
12504c61c93dSmrgAC_MSG_RESULT([$BUILDPDFDOC])
12514c61c93dSmrg
12524c61c93dSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
12534c61c93dSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
12544c61c93dSmrgMAKE_PDF="$PS2PDF"
12554c61c93dSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
12564c61c93dSmrg
12574c61c93dSmrgAC_SUBST(MAKE_TEXT)
12584c61c93dSmrgAC_SUBST(MAKE_PS)
12594c61c93dSmrgAC_SUBST(MAKE_PDF)
12604c61c93dSmrgAC_SUBST(MAKE_HTML)
12614c61c93dSmrg]) # XORG_CHECK_LINUXDOC
12624c61c93dSmrg
12634c61c93dSmrg# XORG_CHECK_DOCBOOK
12644c61c93dSmrg# -------------------
12654c61c93dSmrg# Minimum version: 1.0.0
12664c61c93dSmrg#
12674c61c93dSmrg# Checks for the ability to build output formats from SGML DocBook source.
12684c61c93dSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
12694c61c93dSmrg# indicates whether the necessary tools and files are found and, if set,
12704c61c93dSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
12714c61c93dSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
12724c61c93dSmrgif test x$XORG_SGML_PATH = x ; then
12734c61c93dSmrg    XORG_SGML_PATH=$prefix/share/sgml
12744c61c93dSmrgfi
12754c61c93dSmrgHAVE_DEFS_ENT=
12764c61c93dSmrgBUILDTXTDOC=no
12774c61c93dSmrgBUILDPDFDOC=no
12784c61c93dSmrgBUILDPSDOC=no
12794c61c93dSmrgBUILDHTMLDOC=no
12804c61c93dSmrg
12814c61c93dSmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
12824c61c93dSmrg
12834c61c93dSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
12844c61c93dSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
12854c61c93dSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
12864c61c93dSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
12874c61c93dSmrg
12884c61c93dSmrgAC_MSG_CHECKING([Whether to build text documentation])
12894c61c93dSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
12904c61c93dSmrg   test x$BUILD_TXTDOC != xno; then
12914c61c93dSmrg	BUILDTXTDOC=yes
12924c61c93dSmrgfi
12934c61c93dSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
12944c61c93dSmrgAC_MSG_RESULT([$BUILDTXTDOC])
12954c61c93dSmrg
12964c61c93dSmrgAC_MSG_CHECKING([Whether to build PDF documentation])
12974c61c93dSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
12984c61c93dSmrg   test x$BUILD_PDFDOC != xno; then
12994c61c93dSmrg	BUILDPDFDOC=yes
13004c61c93dSmrgfi
13014c61c93dSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
13024c61c93dSmrgAC_MSG_RESULT([$BUILDPDFDOC])
13034c61c93dSmrg
13044c61c93dSmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
13054c61c93dSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
13064c61c93dSmrg   test x$BUILD_PSDOC != xno; then
13074c61c93dSmrg	BUILDPSDOC=yes
13084c61c93dSmrgfi
13094c61c93dSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
13104c61c93dSmrgAC_MSG_RESULT([$BUILDPSDOC])
13114c61c93dSmrg
13124c61c93dSmrgAC_MSG_CHECKING([Whether to build HTML documentation])
13134c61c93dSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
13144c61c93dSmrg   test x$BUILD_HTMLDOC != xno; then
13154c61c93dSmrg	BUILDHTMLDOC=yes
13164c61c93dSmrgfi
13174c61c93dSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
13184c61c93dSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
13194c61c93dSmrg
13204c61c93dSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
13214c61c93dSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
13224c61c93dSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
13234c61c93dSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
13244c61c93dSmrg
13254c61c93dSmrgAC_SUBST(MAKE_TEXT)
13264c61c93dSmrgAC_SUBST(MAKE_PS)
13274c61c93dSmrgAC_SUBST(MAKE_PDF)
13284c61c93dSmrgAC_SUBST(MAKE_HTML)
13294c61c93dSmrg]) # XORG_CHECK_DOCBOOK
13304c61c93dSmrg
13314c61c93dSmrg# XORG_CHECK_MALLOC_ZERO
13324c61c93dSmrg# ----------------------
13334c61c93dSmrg# Minimum version: 1.0.0
13344c61c93dSmrg#
13354c61c93dSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
13364c61c93dSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
13374c61c93dSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
13384c61c93dSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
13394c61c93dSmrgAC_ARG_ENABLE(malloc0returnsnull,
13404c61c93dSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
13414c61c93dSmrg		       [malloc(0) returns NULL (default: auto)]),
13424c61c93dSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
13434c61c93dSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
13444c61c93dSmrg
13454c61c93dSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
13464c61c93dSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
13474c61c93dSmrg	AC_RUN_IFELSE([
13484c61c93dSmrgchar *malloc();
13494c61c93dSmrgchar *realloc();
13504c61c93dSmrgchar *calloc();
13514c61c93dSmrgmain() {
13524c61c93dSmrg    char *m0, *r0, *c0, *p;
13534c61c93dSmrg    m0 = malloc(0);
13544c61c93dSmrg    p = malloc(10);
13554c61c93dSmrg    r0 = realloc(p,0);
13564c61c93dSmrg    c0 = calloc(0);
13574c61c93dSmrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
13584c61c93dSmrg}],
13594c61c93dSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
13604c61c93dSmrg		[MALLOC_ZERO_RETURNS_NULL=no])
13614c61c93dSmrgfi
13624c61c93dSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
13634c61c93dSmrg
13644c61c93dSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
13654c61c93dSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
13664c61c93dSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
13674c61c93dSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
13684c61c93dSmrgelse
13694c61c93dSmrg	MALLOC_ZERO_CFLAGS=""
13704c61c93dSmrg	XMALLOC_ZERO_CFLAGS=""
13714c61c93dSmrg	XTMALLOC_ZERO_CFLAGS=""
13724c61c93dSmrgfi
13734c61c93dSmrg
13744c61c93dSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
13754c61c93dSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
13764c61c93dSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
13774c61c93dSmrg]) # XORG_CHECK_MALLOC_ZERO
13784c61c93dSmrg
13794c61c93dSmrg# XORG_WITH_LINT()
13804c61c93dSmrg# ----------------
13814c61c93dSmrg# Minimum version: 1.1.0
13824c61c93dSmrg#
13834c61c93dSmrg# Sets up flags for source checkers such as lint and sparse if --with-lint
13844c61c93dSmrg# is specified.   (Use --with-lint=sparse for sparse.)
13854c61c93dSmrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
13864c61c93dSmrg# Sets $LINT_FLAGS to flags to pass to source checker
13874c61c93dSmrg# Sets LINT automake conditional if enabled (default: disabled)
13884c61c93dSmrg#
13894c61c93dSmrgAC_DEFUN([XORG_WITH_LINT],[
13904c61c93dSmrg
13914c61c93dSmrg# Allow checking code with lint, sparse, etc.
13924c61c93dSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
13934c61c93dSmrg		[Use a lint-style source code checker (default: disabled)])],
13944c61c93dSmrg		[use_lint=$withval], [use_lint=no])
13954c61c93dSmrgif test "x$use_lint" = "xyes" ; then
13964c61c93dSmrg	LINT="lint"
13974c61c93dSmrgelse
13984c61c93dSmrg	LINT="$use_lint"
13994c61c93dSmrgfi
14004c61c93dSmrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
14014c61c93dSmrg    case $LINT in
14024c61c93dSmrg	lint|*/lint)
14034c61c93dSmrg	    case $host_os in
14044c61c93dSmrg		solaris*)
14054c61c93dSmrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
14064c61c93dSmrg			;;
14074c61c93dSmrg	    esac
14084c61c93dSmrg	    ;;
14094c61c93dSmrg    esac
14104c61c93dSmrgfi
14114c61c93dSmrg
14124c61c93dSmrgAC_SUBST(LINT)
14134c61c93dSmrgAC_SUBST(LINT_FLAGS)
14144c61c93dSmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
14154c61c93dSmrg
14164c61c93dSmrg]) # XORG_WITH_LINT
14174c61c93dSmrg
14184c61c93dSmrg# XORG_LINT_LIBRARY(LIBNAME)
14194c61c93dSmrg# --------------------------
14204c61c93dSmrg# Minimum version: 1.1.0
14214c61c93dSmrg#
14224c61c93dSmrg# Sets up flags for building lint libraries for checking programs that call
14234c61c93dSmrg# functions in the library.
14244c61c93dSmrg# Disabled by default, enable with --enable-lint-library
14254c61c93dSmrg# Sets: 
14264c61c93dSmrg#	@LINTLIB@		- name of lint library file to make
14274c61c93dSmrg#	MAKE_LINT_LIB		- automake conditional
14284c61c93dSmrg#
14294c61c93dSmrg
14304c61c93dSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
14314c61c93dSmrgAC_REQUIRE([XORG_WITH_LINT])
14324c61c93dSmrg# Build lint "library" for more indepth checks of programs calling this library
14334c61c93dSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
14344c61c93dSmrg	[Create lint library (default: disabled)])],
14354c61c93dSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
14364c61c93dSmrgif test "x$make_lint_lib" != "xno" ; then
14374c61c93dSmrg	if test "x$LINT" = "xno" ; then
14384c61c93dSmrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
14394c61c93dSmrg	fi
14404c61c93dSmrg	if test "x$make_lint_lib" = "xyes" ; then
14414c61c93dSmrg		LINTLIB=llib-l$1.ln
14424c61c93dSmrg	else
14434c61c93dSmrg		LINTLIB=$make_lint_lib
14444c61c93dSmrg	fi
14454c61c93dSmrgfi
14464c61c93dSmrgAC_SUBST(LINTLIB)
14474c61c93dSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
14484c61c93dSmrg
14494c61c93dSmrg]) # XORG_LINT_LIBRARY
14504c61c93dSmrg
14514c61c93dSmrg# XORG_CWARNFLAGS
14524c61c93dSmrg# ---------------
14534c61c93dSmrg# Minimum version: 1.2.0
14544c61c93dSmrg#
14554c61c93dSmrg# Defines CWARNFLAGS to enable C compiler warnings.
14564c61c93dSmrg#
14574c61c93dSmrgAC_DEFUN([XORG_CWARNFLAGS], [
14584c61c93dSmrgAC_REQUIRE([AC_PROG_CC])
14594c61c93dSmrgif  test "x$GCC" = xyes ; then
14604c61c93dSmrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
14614c61c93dSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
14624c61c93dSmrg-Wbad-function-cast"
14634c61c93dSmrg    case `$CC -dumpversion` in
14644c61c93dSmrg    3.4.* | 4.*)
14654c61c93dSmrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
14664c61c93dSmrg	;;
14674c61c93dSmrg    esac
14684c61c93dSmrgelse
14694c61c93dSmrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
14704c61c93dSmrg    if test "x$SUNCC" = "xyes"; then
14714c61c93dSmrg	CWARNFLAGS="-v"
14724c61c93dSmrg    fi
14734c61c93dSmrgfi
14744c61c93dSmrgAC_SUBST(CWARNFLAGS)
14754c61c93dSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
14764c61c93dSmrg]) # XORG_CWARNFLAGS
14774c61c93dSmrg
14784c61c93dSmrg# XORG_STRICT_OPTION
14794c61c93dSmrg# -----------------------
14804c61c93dSmrg# Minimum version: 1.3.0
14814c61c93dSmrg#
14824c61c93dSmrg# Add configure option to enable strict compilation
14834c61c93dSmrgAC_DEFUN([XORG_STRICT_OPTION], [
14844c61c93dSmrgAC_REQUIRE([AC_PROG_CC])
14854c61c93dSmrgAC_REQUIRE([AC_PROG_CC_C99])
14864c61c93dSmrgAC_REQUIRE([XORG_CWARNFLAGS])
14874c61c93dSmrg
14884c61c93dSmrgAC_ARG_ENABLE(strict-compilation,
14894c61c93dSmrg			  AS_HELP_STRING([--enable-strict-compilation],
14904c61c93dSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
14914c61c93dSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
14924c61c93dSmrgif test "x$STRICT_COMPILE" = "xyes"; then
14934c61c93dSmrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
14944c61c93dSmrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
14954c61c93dSmrg	if test "x$GCC" = xyes ; then
14964c61c93dSmrg		STRICT_CFLAGS="-pedantic -Werror"
14974c61c93dSmrg	elif test "x$SUNCC" = "xyes"; then
14984c61c93dSmrg		STRICT_CFLAGS="-errwarn"
14994c61c93dSmrg    elif test "x$INTELCC" = "xyes"; then
15004c61c93dSmrg		STRICT_CFLAGS="-Werror"
15014c61c93dSmrg	fi
15024c61c93dSmrgfi
15034c61c93dSmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
15044c61c93dSmrgAC_SUBST([CWARNFLAGS])
15054c61c93dSmrg]) # XORG_STRICT_OPTION
15064c61c93dSmrg
15074c61c93dSmrg# XORG_DEFAULT_OPTIONS
15084c61c93dSmrg# --------------------
15094c61c93dSmrg# Minimum version: 1.3.0
15104c61c93dSmrg#
15114c61c93dSmrg# Defines default options for X.Org modules.
15124c61c93dSmrg#
15134c61c93dSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
15144c61c93dSmrgXORG_CWARNFLAGS
15154c61c93dSmrgXORG_STRICT_OPTION
15164c61c93dSmrgXORG_RELEASE_VERSION
15174c61c93dSmrgXORG_CHANGELOG
15184c61c93dSmrgXORG_MANPAGE_SECTIONS
15194c61c93dSmrg]) # XORG_DEFAULT_OPTIONS
15204c61c93dSmrgdnl Copyright 2005 Red Hat, Inc
15214c61c93dSmrgdnl
15224c61c93dSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
15234c61c93dSmrgdnl documentation for any purpose is hereby granted without fee, provided that
15244c61c93dSmrgdnl the above copyright notice appear in all copies and that both that
15254c61c93dSmrgdnl copyright notice and this permission notice appear in supporting
15264c61c93dSmrgdnl documentation.
15274c61c93dSmrgdnl
15284c61c93dSmrgdnl The above copyright notice and this permission notice shall be included
15294c61c93dSmrgdnl in all copies or substantial portions of the Software.
15304c61c93dSmrgdnl
15314c61c93dSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15324c61c93dSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15334c61c93dSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
15344c61c93dSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
15354c61c93dSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
15364c61c93dSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
15374c61c93dSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
15384c61c93dSmrgdnl
15394c61c93dSmrgdnl Except as contained in this notice, the name of the copyright holders shall
15404c61c93dSmrgdnl not be used in advertising or otherwise to promote the sale, use or
15414c61c93dSmrgdnl other dealings in this Software without prior written authorization
15424c61c93dSmrgdnl from the copyright holders.
15434c61c93dSmrgdnl
15444c61c93dSmrg
15454c61c93dSmrg# XORG_RELEASE_VERSION
15464c61c93dSmrg# --------------------
15474c61c93dSmrg# Adds --with/without-release-string and changes the PACKAGE and
15484c61c93dSmrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
15494c61c93dSmrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
15504c61c93dSmrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
15514c61c93dSmrg 
15524c61c93dSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
15534c61c93dSmrg	AC_ARG_WITH(release-version,
15544c61c93dSmrg			AS_HELP_STRING([--with-release-version=STRING],
15554c61c93dSmrg				[Use release version string in package name]),
15564c61c93dSmrg			[RELEASE_VERSION="$withval"],
15574c61c93dSmrg			[RELEASE_VERSION=""])
15584c61c93dSmrg	if test "x$RELEASE_VERSION" != "x"; then
15594c61c93dSmrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
15604c61c93dSmrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
15614c61c93dSmrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
15624c61c93dSmrg	fi
15634c61c93dSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
15644c61c93dSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
15654c61c93dSmrg		[Major version of this package])
15664c61c93dSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
15674c61c93dSmrg	if test "x$PVM" = "x"; then
15684c61c93dSmrg		PVM="0"
15694c61c93dSmrg	fi
15704c61c93dSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
15714c61c93dSmrg		[$PVM],
15724c61c93dSmrg		[Minor version of this package])
15734c61c93dSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
15744c61c93dSmrg	if test "x$PVP" = "x"; then
15754c61c93dSmrg		PVP="0"
15764c61c93dSmrg	fi
15774c61c93dSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
15784c61c93dSmrg		[$PVP],
15794c61c93dSmrg		[Patch version of this package])
15804c61c93dSmrg])
15814c61c93dSmrg
15824c61c93dSmrg# XORG_CHANGELOG()
15834c61c93dSmrg# ----------------
15844c61c93dSmrg# Minimum version: 1.2.0
15854c61c93dSmrg#
15864c61c93dSmrg# Defines the variable CHANGELOG_CMD as the command to generate
15874c61c93dSmrg# ChangeLog from git.
15884c61c93dSmrg#
15894c61c93dSmrg# Arrange that distcleancheck ignores ChangeLog left over by distclean.
15904c61c93dSmrg#
15914c61c93dSmrgAC_DEFUN([XORG_CHANGELOG], [
15924c61c93dSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
15934c61c93dSmrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
15944c61c93dSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
15954c61c93dSmrgAC_SUBST([CHANGELOG_CMD])
15964c61c93dSmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
15974c61c93dSmrg]) # XORG_CHANGELOG
15984c61c93dSmrg
1599