aclocal.m4 revision 0c7e83b2
10c7e83b2Smrg# generated automatically by aclocal 1.15 -*- Autoconf -*-
20c7e83b2Smrg
30c7e83b2Smrg# Copyright (C) 1996-2014 Free Software Foundation, Inc.
49aa228fdSmrg
59aa228fdSmrg# This file is free software; the Free Software Foundation
69aa228fdSmrg# gives unlimited permission to copy and/or distribute it,
79aa228fdSmrg# with or without modifications, as long as this notice is preserved.
89aa228fdSmrg
99aa228fdSmrg# This program is distributed in the hope that it will be useful,
109aa228fdSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
119aa228fdSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
129aa228fdSmrg# PARTICULAR PURPOSE.
139aa228fdSmrg
140c7e83b2Smrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
158f65982aSmrgm4_ifndef([AC_AUTOCONF_VERSION],
168f65982aSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
170c7e83b2Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
180c7e83b2Smrg[m4_warning([this file was generated for autoconf 2.69.
198f65982aSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
208f65982aSmrgIf you have problems, you may need to regenerate the build system entirely.
210c7e83b2SmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
229aa228fdSmrg
230c7e83b2Smrg# Copyright (C) 2002-2014 Free Software Foundation, Inc.
249aa228fdSmrg#
259aa228fdSmrg# This file is free software; the Free Software Foundation
269aa228fdSmrg# gives unlimited permission to copy and/or distribute it,
279aa228fdSmrg# with or without modifications, as long as this notice is preserved.
289aa228fdSmrg
299aa228fdSmrg# AM_AUTOMAKE_VERSION(VERSION)
309aa228fdSmrg# ----------------------------
319aa228fdSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
329aa228fdSmrg# generated from the m4 files accompanying Automake X.Y.
339aa228fdSmrg# (This private macro should not be called outside this file.)
349aa228fdSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
350c7e83b2Smrg[am__api_version='1.15'
369aa228fdSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
379aa228fdSmrgdnl require some minimum version.  Point them to the right macro.
380c7e83b2Smrgm4_if([$1], [1.15], [],
399aa228fdSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
409aa228fdSmrg])
419aa228fdSmrg
429aa228fdSmrg# _AM_AUTOCONF_VERSION(VERSION)
439aa228fdSmrg# -----------------------------
449aa228fdSmrg# aclocal traces this macro to find the Autoconf version.
459aa228fdSmrg# This is a private macro too.  Using m4_define simplifies
469aa228fdSmrg# the logic in aclocal, which can simply ignore this definition.
479aa228fdSmrgm4_define([_AM_AUTOCONF_VERSION], [])
489aa228fdSmrg
499aa228fdSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
509aa228fdSmrg# -------------------------------
519aa228fdSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
528f65982aSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
539aa228fdSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
540c7e83b2Smrg[AM_AUTOMAKE_VERSION([1.15])dnl
558f65982aSmrgm4_ifndef([AC_AUTOCONF_VERSION],
568f65982aSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
578f65982aSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
589aa228fdSmrg
599aa228fdSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
609aa228fdSmrg
610c7e83b2Smrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
629aa228fdSmrg#
639aa228fdSmrg# This file is free software; the Free Software Foundation
649aa228fdSmrg# gives unlimited permission to copy and/or distribute it,
659aa228fdSmrg# with or without modifications, as long as this notice is preserved.
669aa228fdSmrg
679aa228fdSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
680c7e83b2Smrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
690c7e83b2Smrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
709aa228fdSmrg#
719aa228fdSmrg# Of course, Automake must honor this variable whenever it calls a
729aa228fdSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
739aa228fdSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
749aa228fdSmrg# depending on how configure is run.  This is pretty annoying, since
759aa228fdSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
769aa228fdSmrg# source directory, any form will work fine, but in subdirectories a
779aa228fdSmrg# relative path needs to be adjusted first.
789aa228fdSmrg#
799aa228fdSmrg# $ac_aux_dir/missing
809aa228fdSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
819aa228fdSmrg# $top_srcdir/$ac_aux_dir/missing
829aa228fdSmrg#    fails if $ac_aux_dir is absolute,
839aa228fdSmrg#    fails when called from a subdirectory in a VPATH build with
849aa228fdSmrg#          a relative $ac_aux_dir
859aa228fdSmrg#
869aa228fdSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
879aa228fdSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
880c7e83b2Smrg# harmless because $srcdir is '.', but things will broke when you
899aa228fdSmrg# start a VPATH build or use an absolute $srcdir.
909aa228fdSmrg#
919aa228fdSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
929aa228fdSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
939aa228fdSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
949aa228fdSmrg# and then we would define $MISSING as
959aa228fdSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
969aa228fdSmrg# This will work as long as MISSING is not called from configure, because
979aa228fdSmrg# unfortunately $(top_srcdir) has no meaning in configure.
989aa228fdSmrg# However there are other variables, like CC, which are often used in
999aa228fdSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
1009aa228fdSmrg#
1019aa228fdSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
1029aa228fdSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
1039aa228fdSmrg# configured tree to be moved without reconfiguration.
1049aa228fdSmrg
1059aa228fdSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
1060c7e83b2Smrg[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
1070c7e83b2Smrg# Expand $ac_aux_dir to an absolute path.
1080c7e83b2Smrgam_aux_dir=`cd "$ac_aux_dir" && pwd`
1099aa228fdSmrg])
1109aa228fdSmrg
1119aa228fdSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
1129aa228fdSmrg
1130c7e83b2Smrg# Copyright (C) 1997-2014 Free Software Foundation, Inc.
1149aa228fdSmrg#
1159aa228fdSmrg# This file is free software; the Free Software Foundation
1169aa228fdSmrg# gives unlimited permission to copy and/or distribute it,
1179aa228fdSmrg# with or without modifications, as long as this notice is preserved.
1189aa228fdSmrg
1199aa228fdSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
1209aa228fdSmrg# -------------------------------------
1219aa228fdSmrg# Define a conditional.
1229aa228fdSmrgAC_DEFUN([AM_CONDITIONAL],
1230c7e83b2Smrg[AC_PREREQ([2.52])dnl
1240c7e83b2Smrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1250c7e83b2Smrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1269aa228fdSmrgAC_SUBST([$1_TRUE])dnl
1279aa228fdSmrgAC_SUBST([$1_FALSE])dnl
1289aa228fdSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
1299aa228fdSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
1308f65982aSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
1319aa228fdSmrgif $2; then
1329aa228fdSmrg  $1_TRUE=
1339aa228fdSmrg  $1_FALSE='#'
1349aa228fdSmrgelse
1359aa228fdSmrg  $1_TRUE='#'
1369aa228fdSmrg  $1_FALSE=
1379aa228fdSmrgfi
1389aa228fdSmrgAC_CONFIG_COMMANDS_PRE(
1399aa228fdSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1409aa228fdSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
1419aa228fdSmrgUsually this means the macro was only invoked conditionally.]])
1429aa228fdSmrgfi])])
1439aa228fdSmrg
1440c7e83b2Smrg# Copyright (C) 1999-2014 Free Software Foundation, Inc.
1459aa228fdSmrg#
1469aa228fdSmrg# This file is free software; the Free Software Foundation
1479aa228fdSmrg# gives unlimited permission to copy and/or distribute it,
1489aa228fdSmrg# with or without modifications, as long as this notice is preserved.
1499aa228fdSmrg
1509aa228fdSmrg
1510c7e83b2Smrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
1529aa228fdSmrg# written in clear, in which case automake, when reading aclocal.m4,
1539aa228fdSmrg# will think it sees a *use*, and therefore will trigger all it's
1549aa228fdSmrg# C support machinery.  Also note that it means that autoscan, seeing
1559aa228fdSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1569aa228fdSmrg
1579aa228fdSmrg
1589aa228fdSmrg# _AM_DEPENDENCIES(NAME)
1599aa228fdSmrg# ----------------------
1609aa228fdSmrg# See how the compiler implements dependency checking.
1610c7e83b2Smrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
1629aa228fdSmrg# We try a few techniques and use that to set a single cache variable.
1639aa228fdSmrg#
1649aa228fdSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1659aa228fdSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1669aa228fdSmrg# dependency, and given that the user is not expected to run this macro,
1679aa228fdSmrg# just rely on AC_PROG_CC.
1689aa228fdSmrgAC_DEFUN([_AM_DEPENDENCIES],
1699aa228fdSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
1709aa228fdSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1719aa228fdSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
1729aa228fdSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1739aa228fdSmrg
1740c7e83b2Smrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
1750c7e83b2Smrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
1760c7e83b2Smrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1770c7e83b2Smrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
1780c7e83b2Smrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
1790c7e83b2Smrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1800c7e83b2Smrg                    [depcc="$$1"   am_compiler_list=])
1819aa228fdSmrg
1829aa228fdSmrgAC_CACHE_CHECK([dependency style of $depcc],
1839aa228fdSmrg               [am_cv_$1_dependencies_compiler_type],
1849aa228fdSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1859aa228fdSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
1869aa228fdSmrg  # making bogus files that we don't know about and never remove.  For
1879aa228fdSmrg  # instance it was reported that on HP-UX the gcc test will end up
1880c7e83b2Smrg  # making a dummy file named 'D' -- because '-MD' means "put the output
1890c7e83b2Smrg  # in D".
19080b026c6Smrg  rm -rf conftest.dir
1919aa228fdSmrg  mkdir conftest.dir
1929aa228fdSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
1939aa228fdSmrg  # using a relative directory.
1949aa228fdSmrg  cp "$am_depcomp" conftest.dir
1959aa228fdSmrg  cd conftest.dir
1969aa228fdSmrg  # We will build objects and dependencies in a subdirectory because
1979aa228fdSmrg  # it helps to detect inapplicable dependency modes.  For instance
1989aa228fdSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
1999aa228fdSmrg  # side effect of compilation, but ICC will put the dependencies in
2009aa228fdSmrg  # the current directory while Tru64 will put them in the object
2019aa228fdSmrg  # directory.
2029aa228fdSmrg  mkdir sub
2039aa228fdSmrg
2049aa228fdSmrg  am_cv_$1_dependencies_compiler_type=none
2059aa228fdSmrg  if test "$am_compiler_list" = ""; then
2069aa228fdSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2079aa228fdSmrg  fi
2088f65982aSmrg  am__universal=false
2098f65982aSmrg  m4_case([$1], [CC],
2108f65982aSmrg    [case " $depcc " in #(
2118f65982aSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2128f65982aSmrg     esac],
2138f65982aSmrg    [CXX],
2148f65982aSmrg    [case " $depcc " in #(
2158f65982aSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2168f65982aSmrg     esac])
2178f65982aSmrg
2189aa228fdSmrg  for depmode in $am_compiler_list; do
2199aa228fdSmrg    # Setup a source with many dependencies, because some compilers
2209aa228fdSmrg    # like to wrap large dependency lists on column 80 (with \), and
2219aa228fdSmrg    # we should not choose a depcomp mode which is confused by this.
2229aa228fdSmrg    #
2239aa228fdSmrg    # We need to recreate these files for each test, as the compiler may
2249aa228fdSmrg    # overwrite some of them when testing with obscure command lines.
2259aa228fdSmrg    # This happens at least with the AIX C compiler.
2269aa228fdSmrg    : > sub/conftest.c
2279aa228fdSmrg    for i in 1 2 3 4 5 6; do
2289aa228fdSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
2290c7e83b2Smrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
2300c7e83b2Smrg      # Solaris 10 /bin/sh.
2310c7e83b2Smrg      echo '/* dummy */' > sub/conftst$i.h
2329aa228fdSmrg    done
2339aa228fdSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2349aa228fdSmrg
2350c7e83b2Smrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
2368f65982aSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
2370c7e83b2Smrg    # handle '-M -o', and we need to detect this.  Also, some Intel
2380c7e83b2Smrg    # versions had trouble with output in subdirs.
2398f65982aSmrg    am__obj=sub/conftest.${OBJEXT-o}
2408f65982aSmrg    am__minus_obj="-o $am__obj"
2419aa228fdSmrg    case $depmode in
2428f65982aSmrg    gcc)
2438f65982aSmrg      # This depmode causes a compiler race in universal mode.
2448f65982aSmrg      test "$am__universal" = false || continue
2458f65982aSmrg      ;;
2469aa228fdSmrg    nosideeffect)
2470c7e83b2Smrg      # After this tag, mechanisms are not by side-effect, so they'll
2480c7e83b2Smrg      # only be used when explicitly requested.
2499aa228fdSmrg      if test "x$enable_dependency_tracking" = xyes; then
2509aa228fdSmrg	continue
2519aa228fdSmrg      else
2529aa228fdSmrg	break
2539aa228fdSmrg      fi
2549aa228fdSmrg      ;;
25580b026c6Smrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
2560c7e83b2Smrg      # This compiler won't grok '-c -o', but also, the minuso test has
2578f65982aSmrg      # not run yet.  These depmodes are late enough in the game, and
2588f65982aSmrg      # so weak that their functioning should not be impacted.
2598f65982aSmrg      am__obj=conftest.${OBJEXT-o}
2608f65982aSmrg      am__minus_obj=
2618f65982aSmrg      ;;
2629aa228fdSmrg    none) break ;;
2639aa228fdSmrg    esac
2649aa228fdSmrg    if depmode=$depmode \
2658f65982aSmrg       source=sub/conftest.c object=$am__obj \
2669aa228fdSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
2678f65982aSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
2689aa228fdSmrg         >/dev/null 2>conftest.err &&
2699aa228fdSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
2709aa228fdSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
2718f65982aSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
2729aa228fdSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
2739aa228fdSmrg      # icc doesn't choke on unknown options, it will just issue warnings
2749aa228fdSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
2759aa228fdSmrg      # that says an option was ignored or not supported.
2769aa228fdSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
2779aa228fdSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
2789aa228fdSmrg      # The diagnosis changed in icc 8.0:
2799aa228fdSmrg      #   icc: Command line remark: option '-MP' not supported
2809aa228fdSmrg      if (grep 'ignoring option' conftest.err ||
2819aa228fdSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
2829aa228fdSmrg        am_cv_$1_dependencies_compiler_type=$depmode
2839aa228fdSmrg        break
2849aa228fdSmrg      fi
2859aa228fdSmrg    fi
2869aa228fdSmrg  done
2879aa228fdSmrg
2889aa228fdSmrg  cd ..
2899aa228fdSmrg  rm -rf conftest.dir
2909aa228fdSmrgelse
2919aa228fdSmrg  am_cv_$1_dependencies_compiler_type=none
2929aa228fdSmrgfi
2939aa228fdSmrg])
2949aa228fdSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
2959aa228fdSmrgAM_CONDITIONAL([am__fastdep$1], [
2969aa228fdSmrg  test "x$enable_dependency_tracking" != xno \
2979aa228fdSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
2989aa228fdSmrg])
2999aa228fdSmrg
3009aa228fdSmrg
3019aa228fdSmrg# AM_SET_DEPDIR
3029aa228fdSmrg# -------------
3039aa228fdSmrg# Choose a directory name for dependency files.
3040c7e83b2Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
3059aa228fdSmrgAC_DEFUN([AM_SET_DEPDIR],
3069aa228fdSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
3079aa228fdSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
3089aa228fdSmrg])
3099aa228fdSmrg
3109aa228fdSmrg
3119aa228fdSmrg# AM_DEP_TRACK
3129aa228fdSmrg# ------------
3139aa228fdSmrgAC_DEFUN([AM_DEP_TRACK],
3140c7e83b2Smrg[AC_ARG_ENABLE([dependency-tracking], [dnl
3150c7e83b2SmrgAS_HELP_STRING(
3160c7e83b2Smrg  [--enable-dependency-tracking],
3170c7e83b2Smrg  [do not reject slow dependency extractors])
3180c7e83b2SmrgAS_HELP_STRING(
3190c7e83b2Smrg  [--disable-dependency-tracking],
3200c7e83b2Smrg  [speeds up one-time build])])
3219aa228fdSmrgif test "x$enable_dependency_tracking" != xno; then
3229aa228fdSmrg  am_depcomp="$ac_aux_dir/depcomp"
3239aa228fdSmrg  AMDEPBACKSLASH='\'
32480b026c6Smrg  am__nodep='_no'
3259aa228fdSmrgfi
3269aa228fdSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
3279aa228fdSmrgAC_SUBST([AMDEPBACKSLASH])dnl
3289aa228fdSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
32980b026c6SmrgAC_SUBST([am__nodep])dnl
33080b026c6Smrg_AM_SUBST_NOTMAKE([am__nodep])dnl
3319aa228fdSmrg])
3329aa228fdSmrg
3339aa228fdSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
3349aa228fdSmrg
3350c7e83b2Smrg# Copyright (C) 1999-2014 Free Software Foundation, Inc.
3369aa228fdSmrg#
3379aa228fdSmrg# This file is free software; the Free Software Foundation
3389aa228fdSmrg# gives unlimited permission to copy and/or distribute it,
3399aa228fdSmrg# with or without modifications, as long as this notice is preserved.
3409aa228fdSmrg
3419aa228fdSmrg
3429aa228fdSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
3439aa228fdSmrg# ------------------------------
3449aa228fdSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
3458f65982aSmrg[{
3460c7e83b2Smrg  # Older Autoconf quotes --file arguments for eval, but not when files
3478f65982aSmrg  # are listed without --file.  Let's play safe and only enable the eval
3488f65982aSmrg  # if we detect the quoting.
3498f65982aSmrg  case $CONFIG_FILES in
3508f65982aSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
3518f65982aSmrg  *)   set x $CONFIG_FILES ;;
3528f65982aSmrg  esac
3538f65982aSmrg  shift
3548f65982aSmrg  for mf
3558f65982aSmrg  do
3568f65982aSmrg    # Strip MF so we end up with the name of the file.
3578f65982aSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
3588f65982aSmrg    # Check whether this is an Automake generated Makefile or not.
3590c7e83b2Smrg    # We used to match only the files named 'Makefile.in', but
3608f65982aSmrg    # some people rename them; so instead we look at the file content.
3618f65982aSmrg    # Grep'ing the first line is not enough: some people post-process
3628f65982aSmrg    # each Makefile.in and add a new line on top of each file to say so.
3638f65982aSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
3648f65982aSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
3658f65982aSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
3668f65982aSmrg      dirpart=`AS_DIRNAME("$mf")`
3678f65982aSmrg    else
3688f65982aSmrg      continue
3698f65982aSmrg    fi
3708f65982aSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
3710c7e83b2Smrg    # from the Makefile without running 'make'.
3728f65982aSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
3738f65982aSmrg    test -z "$DEPDIR" && continue
3748f65982aSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
3750c7e83b2Smrg    test -z "$am__include" && continue
3768f65982aSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
3778f65982aSmrg    # Find all dependency output files, they are included files with
3788f65982aSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
3798f65982aSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
3808f65982aSmrg    # expansion.
3818f65982aSmrg    for file in `sed -n "
3828f65982aSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
3830c7e83b2Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
3848f65982aSmrg      # Make sure the directory exists.
3858f65982aSmrg      test -f "$dirpart/$file" && continue
3868f65982aSmrg      fdir=`AS_DIRNAME(["$file"])`
3878f65982aSmrg      AS_MKDIR_P([$dirpart/$fdir])
3888f65982aSmrg      # echo "creating $dirpart/$file"
3898f65982aSmrg      echo '# dummy' > "$dirpart/$file"
3908f65982aSmrg    done
3919aa228fdSmrg  done
3928f65982aSmrg}
3939aa228fdSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
3949aa228fdSmrg
3959aa228fdSmrg
3969aa228fdSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
3979aa228fdSmrg# -----------------------------
3989aa228fdSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
3999aa228fdSmrg#
4009aa228fdSmrg# This code is only required when automatic dependency tracking
4010c7e83b2Smrg# is enabled.  FIXME.  This creates each '.P' file that we will
4029aa228fdSmrg# need in order to bootstrap the dependency handling code.
4039aa228fdSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
4049aa228fdSmrg[AC_CONFIG_COMMANDS([depfiles],
4059aa228fdSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
4069aa228fdSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
4079aa228fdSmrg])
4089aa228fdSmrg
4099aa228fdSmrg# Do all the work for Automake.                             -*- Autoconf -*-
4109aa228fdSmrg
4110c7e83b2Smrg# Copyright (C) 1996-2014 Free Software Foundation, Inc.
4129aa228fdSmrg#
4139aa228fdSmrg# This file is free software; the Free Software Foundation
4149aa228fdSmrg# gives unlimited permission to copy and/or distribute it,
4159aa228fdSmrg# with or without modifications, as long as this notice is preserved.
4169aa228fdSmrg
4179aa228fdSmrg# This macro actually does too much.  Some checks are only needed if
4189aa228fdSmrg# your package does certain things.  But this isn't really a big deal.
4199aa228fdSmrg
4200c7e83b2Smrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
4210c7e83b2Smrgm4_define([AC_PROG_CC],
4220c7e83b2Smrgm4_defn([AC_PROG_CC])
4230c7e83b2Smrg[_AM_PROG_CC_C_O
4240c7e83b2Smrg])
4250c7e83b2Smrg
4269aa228fdSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
4279aa228fdSmrg# AM_INIT_AUTOMAKE([OPTIONS])
4289aa228fdSmrg# -----------------------------------------------
4299aa228fdSmrg# The call with PACKAGE and VERSION arguments is the old style
4309aa228fdSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
4319aa228fdSmrg# and VERSION should now be passed to AC_INIT and removed from
4329aa228fdSmrg# the call to AM_INIT_AUTOMAKE.
4339aa228fdSmrg# We support both call styles for the transition.  After
4349aa228fdSmrg# the next Automake release, Autoconf can make the AC_INIT
4359aa228fdSmrg# arguments mandatory, and then we can depend on a new Autoconf
4369aa228fdSmrg# release and drop the old call support.
4379aa228fdSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
4380c7e83b2Smrg[AC_PREREQ([2.65])dnl
4399aa228fdSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
4409aa228fdSmrgdnl the ones we care about.
4419aa228fdSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
4429aa228fdSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
4439aa228fdSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
4449aa228fdSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
4459aa228fdSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
4469aa228fdSmrg  # is not polluted with repeated "-I."
4479aa228fdSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
4489aa228fdSmrg  # test to see if srcdir already configured
4499aa228fdSmrg  if test -f $srcdir/config.status; then
4509aa228fdSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
4519aa228fdSmrg  fi
4529aa228fdSmrgfi
4539aa228fdSmrg
4549aa228fdSmrg# test whether we have cygpath
4559aa228fdSmrgif test -z "$CYGPATH_W"; then
4569aa228fdSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
4579aa228fdSmrg    CYGPATH_W='cygpath -w'
4589aa228fdSmrg  else
4599aa228fdSmrg    CYGPATH_W=echo
4609aa228fdSmrg  fi
4619aa228fdSmrgfi
4629aa228fdSmrgAC_SUBST([CYGPATH_W])
4639aa228fdSmrg
4649aa228fdSmrg# Define the identity of the package.
4659aa228fdSmrgdnl Distinguish between old-style and new-style calls.
4669aa228fdSmrgm4_ifval([$2],
4670c7e83b2Smrg[AC_DIAGNOSE([obsolete],
4680c7e83b2Smrg             [$0: two- and three-arguments forms are deprecated.])
4690c7e83b2Smrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
4709aa228fdSmrg AC_SUBST([PACKAGE], [$1])dnl
4719aa228fdSmrg AC_SUBST([VERSION], [$2])],
4729aa228fdSmrg[_AM_SET_OPTIONS([$1])dnl
4739aa228fdSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
4740c7e83b2Smrgm4_if(
4750c7e83b2Smrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
4760c7e83b2Smrg  [ok:ok],,
4779aa228fdSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
4789aa228fdSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
4799aa228fdSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
4809aa228fdSmrg
4819aa228fdSmrg_AM_IF_OPTION([no-define],,
4820c7e83b2Smrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
4830c7e83b2Smrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
4849aa228fdSmrg
4859aa228fdSmrg# Some tools Automake needs.
4869aa228fdSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
4879aa228fdSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
4880c7e83b2SmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
4890c7e83b2SmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
4900c7e83b2SmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
4910c7e83b2SmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
4920c7e83b2SmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
4938f65982aSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
4948f65982aSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
4950c7e83b2SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
4960c7e83b2Smrg# For better backward compatibility.  To be removed once Automake 1.9.x
4970c7e83b2Smrg# dies out for good.  For more background, see:
4980c7e83b2Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
4990c7e83b2Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
5000c7e83b2SmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
5010c7e83b2Smrg# We need awk for the "check" target (and possibly the TAP driver).  The
5020c7e83b2Smrg# system "awk" is bad on some platforms.
5039aa228fdSmrgAC_REQUIRE([AC_PROG_AWK])dnl
5049aa228fdSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
5059aa228fdSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
5069aa228fdSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
5078f65982aSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
5088f65982aSmrg			     [_AM_PROG_TAR([v7])])])
5099aa228fdSmrg_AM_IF_OPTION([no-dependencies],,
5109aa228fdSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
5110c7e83b2Smrg		  [_AM_DEPENDENCIES([CC])],
5120c7e83b2Smrg		  [m4_define([AC_PROG_CC],
5130c7e83b2Smrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
5149aa228fdSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
5150c7e83b2Smrg		  [_AM_DEPENDENCIES([CXX])],
5160c7e83b2Smrg		  [m4_define([AC_PROG_CXX],
5170c7e83b2Smrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
5189aa228fdSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
5190c7e83b2Smrg		  [_AM_DEPENDENCIES([OBJC])],
5200c7e83b2Smrg		  [m4_define([AC_PROG_OBJC],
5210c7e83b2Smrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
5220c7e83b2SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
5230c7e83b2Smrg		  [_AM_DEPENDENCIES([OBJCXX])],
5240c7e83b2Smrg		  [m4_define([AC_PROG_OBJCXX],
5250c7e83b2Smrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
5269aa228fdSmrg])
5270c7e83b2SmrgAC_REQUIRE([AM_SILENT_RULES])dnl
5280c7e83b2Smrgdnl The testsuite driver may need to know about EXEEXT, so add the
5290c7e83b2Smrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
5300c7e83b2Smrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
5318f65982aSmrgAC_CONFIG_COMMANDS_PRE(dnl
5328f65982aSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
5338f65982aSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
5340c7e83b2Smrg
5350c7e83b2Smrg# POSIX will say in a future version that running "rm -f" with no argument
5360c7e83b2Smrg# is OK; and we want to be able to make that assumption in our Makefile
5370c7e83b2Smrg# recipes.  So use an aggressive probe to check that the usage we want is
5380c7e83b2Smrg# actually supported "in the wild" to an acceptable degree.
5390c7e83b2Smrg# See automake bug#10828.
5400c7e83b2Smrg# To make any issue more visible, cause the running configure to be aborted
5410c7e83b2Smrg# by default if the 'rm' program in use doesn't match our expectations; the
5420c7e83b2Smrg# user can still override this though.
5430c7e83b2Smrgif rm -f && rm -fr && rm -rf; then : OK; else
5440c7e83b2Smrg  cat >&2 <<'END'
5450c7e83b2SmrgOops!
5460c7e83b2Smrg
5470c7e83b2SmrgYour 'rm' program seems unable to run without file operands specified
5480c7e83b2Smrgon the command line, even when the '-f' option is present.  This is contrary
5490c7e83b2Smrgto the behaviour of most rm programs out there, and not conforming with
5500c7e83b2Smrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
5510c7e83b2Smrg
5520c7e83b2SmrgPlease tell bug-automake@gnu.org about your system, including the value
5530c7e83b2Smrgof your $PATH and any error possibly output before this message.  This
5540c7e83b2Smrgcan help us improve future automake versions.
5550c7e83b2Smrg
5560c7e83b2SmrgEND
5570c7e83b2Smrg  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
5580c7e83b2Smrg    echo 'Configuration will proceed anyway, since you have set the' >&2
5590c7e83b2Smrg    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
5600c7e83b2Smrg    echo >&2
5610c7e83b2Smrg  else
5620c7e83b2Smrg    cat >&2 <<'END'
5630c7e83b2SmrgAborting the configuration process, to ensure you take notice of the issue.
5640c7e83b2Smrg
5650c7e83b2SmrgYou can download and install GNU coreutils to get an 'rm' implementation
5660c7e83b2Smrgthat behaves properly: <http://www.gnu.org/software/coreutils/>.
5670c7e83b2Smrg
5680c7e83b2SmrgIf you want to complete the configuration process using your problematic
5690c7e83b2Smrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
5700c7e83b2Smrgto "yes", and re-run configure.
5710c7e83b2Smrg
5720c7e83b2SmrgEND
5730c7e83b2Smrg    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
5740c7e83b2Smrg  fi
5750c7e83b2Smrgfi
5760c7e83b2Smrgdnl The trailing newline in this macro's definition is deliberate, for
5770c7e83b2Smrgdnl backward compatibility and to allow trailing 'dnl'-style comments
5780c7e83b2Smrgdnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
5799aa228fdSmrg])
5809aa228fdSmrg
5810c7e83b2Smrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
5828f65982aSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
5838f65982aSmrgdnl mangled by Autoconf and run in a shell conditional statement.
5848f65982aSmrgm4_define([_AC_COMPILER_EXEEXT],
5858f65982aSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
5868f65982aSmrg
5879aa228fdSmrg# When config.status generates a header, we must update the stamp-h file.
5889aa228fdSmrg# This file resides in the same directory as the config header
5899aa228fdSmrg# that is generated.  The stamp files are numbered to have different names.
5909aa228fdSmrg
5919aa228fdSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
5929aa228fdSmrg# loop where config.status creates the headers, so we can generate
5939aa228fdSmrg# our stamp files there.
5949aa228fdSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
5959aa228fdSmrg[# Compute $1's index in $config_headers.
5968f65982aSmrg_am_arg=$1
5979aa228fdSmrg_am_stamp_count=1
5989aa228fdSmrgfor _am_header in $config_headers :; do
5999aa228fdSmrg  case $_am_header in
6008f65982aSmrg    $_am_arg | $_am_arg:* )
6019aa228fdSmrg      break ;;
6029aa228fdSmrg    * )
6039aa228fdSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
6049aa228fdSmrg  esac
6059aa228fdSmrgdone
6068f65982aSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
6079aa228fdSmrg
6080c7e83b2Smrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
6099aa228fdSmrg#
6109aa228fdSmrg# This file is free software; the Free Software Foundation
6119aa228fdSmrg# gives unlimited permission to copy and/or distribute it,
6129aa228fdSmrg# with or without modifications, as long as this notice is preserved.
6139aa228fdSmrg
6149aa228fdSmrg# AM_PROG_INSTALL_SH
6159aa228fdSmrg# ------------------
6169aa228fdSmrg# Define $install_sh.
6179aa228fdSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
6189aa228fdSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
6190c7e83b2Smrgif test x"${install_sh+set}" != xset; then
6208f65982aSmrg  case $am_aux_dir in
6218f65982aSmrg  *\ * | *\	*)
6228f65982aSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
6238f65982aSmrg  *)
6248f65982aSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
6258f65982aSmrg  esac
6268f65982aSmrgfi
6270c7e83b2SmrgAC_SUBST([install_sh])])
6289aa228fdSmrg
6290c7e83b2Smrg# Copyright (C) 2003-2014 Free Software Foundation, Inc.
6309aa228fdSmrg#
6319aa228fdSmrg# This file is free software; the Free Software Foundation
6329aa228fdSmrg# gives unlimited permission to copy and/or distribute it,
6339aa228fdSmrg# with or without modifications, as long as this notice is preserved.
6349aa228fdSmrg
6359aa228fdSmrg# Check whether the underlying file-system supports filenames
6369aa228fdSmrg# with a leading dot.  For instance MS-DOS doesn't.
6379aa228fdSmrgAC_DEFUN([AM_SET_LEADING_DOT],
6389aa228fdSmrg[rm -rf .tst 2>/dev/null
6399aa228fdSmrgmkdir .tst 2>/dev/null
6409aa228fdSmrgif test -d .tst; then
6419aa228fdSmrg  am__leading_dot=.
6429aa228fdSmrgelse
6439aa228fdSmrg  am__leading_dot=_
6449aa228fdSmrgfi
6459aa228fdSmrgrmdir .tst 2>/dev/null
6469aa228fdSmrgAC_SUBST([am__leading_dot])])
6479aa228fdSmrg
6489aa228fdSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
6499aa228fdSmrg
6500c7e83b2Smrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
6519aa228fdSmrg#
6529aa228fdSmrg# This file is free software; the Free Software Foundation
6539aa228fdSmrg# gives unlimited permission to copy and/or distribute it,
6549aa228fdSmrg# with or without modifications, as long as this notice is preserved.
6559aa228fdSmrg
6569aa228fdSmrg# AM_MAKE_INCLUDE()
6579aa228fdSmrg# -----------------
6589aa228fdSmrg# Check to see how make treats includes.
6599aa228fdSmrgAC_DEFUN([AM_MAKE_INCLUDE],
6609aa228fdSmrg[am_make=${MAKE-make}
6619aa228fdSmrgcat > confinc << 'END'
6629aa228fdSmrgam__doit:
6638f65982aSmrg	@echo this is the am__doit target
6649aa228fdSmrg.PHONY: am__doit
6659aa228fdSmrgEND
6669aa228fdSmrg# If we don't find an include directive, just comment out the code.
6679aa228fdSmrgAC_MSG_CHECKING([for style of include used by $am_make])
6689aa228fdSmrgam__include="#"
6699aa228fdSmrgam__quote=
6709aa228fdSmrg_am_result=none
6719aa228fdSmrg# First try GNU make style include.
6729aa228fdSmrgecho "include confinc" > confmf
6730c7e83b2Smrg# Ignore all kinds of additional output from 'make'.
6748f65982aSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
6758f65982aSmrg*the\ am__doit\ target*)
6768f65982aSmrg  am__include=include
6778f65982aSmrg  am__quote=
6788f65982aSmrg  _am_result=GNU
6798f65982aSmrg  ;;
6808f65982aSmrgesac
6819aa228fdSmrg# Now try BSD make style include.
6829aa228fdSmrgif test "$am__include" = "#"; then
6839aa228fdSmrg   echo '.include "confinc"' > confmf
6848f65982aSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
6858f65982aSmrg   *the\ am__doit\ target*)
6868f65982aSmrg     am__include=.include
6878f65982aSmrg     am__quote="\""
6888f65982aSmrg     _am_result=BSD
6898f65982aSmrg     ;;
6908f65982aSmrg   esac
6919aa228fdSmrgfi
6929aa228fdSmrgAC_SUBST([am__include])
6939aa228fdSmrgAC_SUBST([am__quote])
6949aa228fdSmrgAC_MSG_RESULT([$_am_result])
6959aa228fdSmrgrm -f confinc confmf
6969aa228fdSmrg])
6979aa228fdSmrg
6989aa228fdSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
6999aa228fdSmrg
7000c7e83b2Smrg# Copyright (C) 1997-2014 Free Software Foundation, Inc.
7019aa228fdSmrg#
7029aa228fdSmrg# This file is free software; the Free Software Foundation
7039aa228fdSmrg# gives unlimited permission to copy and/or distribute it,
7049aa228fdSmrg# with or without modifications, as long as this notice is preserved.
7059aa228fdSmrg
7069aa228fdSmrg# AM_MISSING_PROG(NAME, PROGRAM)
7079aa228fdSmrg# ------------------------------
7089aa228fdSmrgAC_DEFUN([AM_MISSING_PROG],
7099aa228fdSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
7109aa228fdSmrg$1=${$1-"${am_missing_run}$2"}
7119aa228fdSmrgAC_SUBST($1)])
7129aa228fdSmrg
7139aa228fdSmrg# AM_MISSING_HAS_RUN
7149aa228fdSmrg# ------------------
7150c7e83b2Smrg# Define MISSING if not defined so far and test if it is modern enough.
7160c7e83b2Smrg# If it is, set am_missing_run to use it, otherwise, to nothing.
7179aa228fdSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
7189aa228fdSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
7199aa228fdSmrgAC_REQUIRE_AUX_FILE([missing])dnl
7208f65982aSmrgif test x"${MISSING+set}" != xset; then
7218f65982aSmrg  case $am_aux_dir in
7228f65982aSmrg  *\ * | *\	*)
7238f65982aSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
7248f65982aSmrg  *)
7258f65982aSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
7268f65982aSmrg  esac
7278f65982aSmrgfi
7289aa228fdSmrg# Use eval to expand $SHELL
7290c7e83b2Smrgif eval "$MISSING --is-lightweight"; then
7300c7e83b2Smrg  am_missing_run="$MISSING "
7319aa228fdSmrgelse
7329aa228fdSmrg  am_missing_run=
7330c7e83b2Smrg  AC_MSG_WARN(['missing' script is too old or missing])
7349aa228fdSmrgfi
7359aa228fdSmrg])
7369aa228fdSmrg
7379aa228fdSmrg# Helper functions for option handling.                     -*- Autoconf -*-
7389aa228fdSmrg
7390c7e83b2Smrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
7409aa228fdSmrg#
7419aa228fdSmrg# This file is free software; the Free Software Foundation
7429aa228fdSmrg# gives unlimited permission to copy and/or distribute it,
7439aa228fdSmrg# with or without modifications, as long as this notice is preserved.
7449aa228fdSmrg
7459aa228fdSmrg# _AM_MANGLE_OPTION(NAME)
7469aa228fdSmrg# -----------------------
7479aa228fdSmrgAC_DEFUN([_AM_MANGLE_OPTION],
7489aa228fdSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
7499aa228fdSmrg
7509aa228fdSmrg# _AM_SET_OPTION(NAME)
75180b026c6Smrg# --------------------
7529aa228fdSmrg# Set option NAME.  Presently that only means defining a flag for this option.
7539aa228fdSmrgAC_DEFUN([_AM_SET_OPTION],
7540c7e83b2Smrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
7559aa228fdSmrg
7569aa228fdSmrg# _AM_SET_OPTIONS(OPTIONS)
75780b026c6Smrg# ------------------------
7589aa228fdSmrg# OPTIONS is a space-separated list of Automake options.
7599aa228fdSmrgAC_DEFUN([_AM_SET_OPTIONS],
7608f65982aSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
7619aa228fdSmrg
7629aa228fdSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
7639aa228fdSmrg# -------------------------------------------
7649aa228fdSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
7659aa228fdSmrgAC_DEFUN([_AM_IF_OPTION],
7669aa228fdSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
7679aa228fdSmrg
7680c7e83b2Smrg# Copyright (C) 1999-2014 Free Software Foundation, Inc.
7690c7e83b2Smrg#
7700c7e83b2Smrg# This file is free software; the Free Software Foundation
7710c7e83b2Smrg# gives unlimited permission to copy and/or distribute it,
7720c7e83b2Smrg# with or without modifications, as long as this notice is preserved.
7739aa228fdSmrg
7740c7e83b2Smrg# _AM_PROG_CC_C_O
7750c7e83b2Smrg# ---------------
7760c7e83b2Smrg# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
7770c7e83b2Smrg# to automatically call this.
7780c7e83b2SmrgAC_DEFUN([_AM_PROG_CC_C_O],
7790c7e83b2Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
7800c7e83b2SmrgAC_REQUIRE_AUX_FILE([compile])dnl
7810c7e83b2SmrgAC_LANG_PUSH([C])dnl
7820c7e83b2SmrgAC_CACHE_CHECK(
7830c7e83b2Smrg  [whether $CC understands -c and -o together],
7840c7e83b2Smrg  [am_cv_prog_cc_c_o],
7850c7e83b2Smrg  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
7860c7e83b2Smrg  # Make sure it works both with $CC and with simple cc.
7870c7e83b2Smrg  # Following AC_PROG_CC_C_O, we do the test twice because some
7880c7e83b2Smrg  # compilers refuse to overwrite an existing .o file with -o,
7890c7e83b2Smrg  # though they will create one.
7900c7e83b2Smrg  am_cv_prog_cc_c_o=yes
7910c7e83b2Smrg  for am_i in 1 2; do
7920c7e83b2Smrg    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
7930c7e83b2Smrg         && test -f conftest2.$ac_objext; then
7940c7e83b2Smrg      : OK
7950c7e83b2Smrg    else
7960c7e83b2Smrg      am_cv_prog_cc_c_o=no
7970c7e83b2Smrg      break
7980c7e83b2Smrg    fi
7990c7e83b2Smrg  done
8000c7e83b2Smrg  rm -f core conftest*
8010c7e83b2Smrg  unset am_i])
8020c7e83b2Smrgif test "$am_cv_prog_cc_c_o" != yes; then
8030c7e83b2Smrg   # Losing compiler, so override with the script.
8040c7e83b2Smrg   # FIXME: It is wrong to rewrite CC.
8050c7e83b2Smrg   # But if we don't then we get into trouble of one sort or another.
8060c7e83b2Smrg   # A longer-term fix would be to have automake use am__CC in this case,
8070c7e83b2Smrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
8080c7e83b2Smrg   CC="$am_aux_dir/compile $CC"
8090c7e83b2Smrgfi
8100c7e83b2SmrgAC_LANG_POP([C])])
8110c7e83b2Smrg
8120c7e83b2Smrg# For backward compatibility.
8130c7e83b2SmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
8140c7e83b2Smrg
8150c7e83b2Smrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
8169aa228fdSmrg#
8179aa228fdSmrg# This file is free software; the Free Software Foundation
8189aa228fdSmrg# gives unlimited permission to copy and/or distribute it,
8199aa228fdSmrg# with or without modifications, as long as this notice is preserved.
8209aa228fdSmrg
8210c7e83b2Smrg# AM_RUN_LOG(COMMAND)
8220c7e83b2Smrg# -------------------
8230c7e83b2Smrg# Run COMMAND, save the exit status in ac_status, and log it.
8240c7e83b2Smrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
8250c7e83b2SmrgAC_DEFUN([AM_RUN_LOG],
8260c7e83b2Smrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
8270c7e83b2Smrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
8280c7e83b2Smrg   ac_status=$?
8290c7e83b2Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
8300c7e83b2Smrg   (exit $ac_status); }])
8310c7e83b2Smrg
8320c7e83b2Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
8330c7e83b2Smrg
8340c7e83b2Smrg# Copyright (C) 1996-2014 Free Software Foundation, Inc.
8350c7e83b2Smrg#
8360c7e83b2Smrg# This file is free software; the Free Software Foundation
8370c7e83b2Smrg# gives unlimited permission to copy and/or distribute it,
8380c7e83b2Smrg# with or without modifications, as long as this notice is preserved.
8399aa228fdSmrg
8409aa228fdSmrg# AM_SANITY_CHECK
8419aa228fdSmrg# ---------------
8429aa228fdSmrgAC_DEFUN([AM_SANITY_CHECK],
8439aa228fdSmrg[AC_MSG_CHECKING([whether build environment is sane])
8448f65982aSmrg# Reject unsafe characters in $srcdir or the absolute working directory
8458f65982aSmrg# name.  Accept space and tab only in the latter.
8468f65982aSmrgam_lf='
8478f65982aSmrg'
8488f65982aSmrgcase `pwd` in
8498f65982aSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
8508f65982aSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
8518f65982aSmrgesac
8528f65982aSmrgcase $srcdir in
8538f65982aSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
8540c7e83b2Smrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
8558f65982aSmrgesac
8568f65982aSmrg
8570c7e83b2Smrg# Do 'set' in a subshell so we don't clobber the current shell's
8589aa228fdSmrg# arguments.  Must try -L first in case configure is actually a
8599aa228fdSmrg# symlink; some systems play weird games with the mod time of symlinks
8609aa228fdSmrg# (eg FreeBSD returns the mod time of the symlink's containing
8619aa228fdSmrg# directory).
8629aa228fdSmrgif (
8630c7e83b2Smrg   am_has_slept=no
8640c7e83b2Smrg   for am_try in 1 2; do
8650c7e83b2Smrg     echo "timestamp, slept: $am_has_slept" > conftest.file
8660c7e83b2Smrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
8670c7e83b2Smrg     if test "$[*]" = "X"; then
8680c7e83b2Smrg	# -L didn't work.
8690c7e83b2Smrg	set X `ls -t "$srcdir/configure" conftest.file`
8700c7e83b2Smrg     fi
8710c7e83b2Smrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
8720c7e83b2Smrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
8730c7e83b2Smrg
8740c7e83b2Smrg	# If neither matched, then we have a broken ls.  This can happen
8750c7e83b2Smrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
8760c7e83b2Smrg	# broken ls alias from the environment.  This has actually
8770c7e83b2Smrg	# happened.  Such a system could not be considered "sane".
8780c7e83b2Smrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
8790c7e83b2Smrg  alias in your environment])
8800c7e83b2Smrg     fi
8810c7e83b2Smrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
8820c7e83b2Smrg       break
8830c7e83b2Smrg     fi
8840c7e83b2Smrg     # Just in case.
8850c7e83b2Smrg     sleep 1
8860c7e83b2Smrg     am_has_slept=yes
8870c7e83b2Smrg   done
8889aa228fdSmrg   test "$[2]" = conftest.file
8899aa228fdSmrg   )
8909aa228fdSmrgthen
8919aa228fdSmrg   # Ok.
8929aa228fdSmrg   :
8939aa228fdSmrgelse
8949aa228fdSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
8959aa228fdSmrgCheck your system clock])
8969aa228fdSmrgfi
8970c7e83b2SmrgAC_MSG_RESULT([yes])
8980c7e83b2Smrg# If we didn't sleep, we still need to ensure time stamps of config.status and
8990c7e83b2Smrg# generated files are strictly newer.
9000c7e83b2Smrgam_sleep_pid=
9010c7e83b2Smrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
9020c7e83b2Smrg  ( sleep 1 ) &
9030c7e83b2Smrg  am_sleep_pid=$!
9040c7e83b2Smrgfi
9050c7e83b2SmrgAC_CONFIG_COMMANDS_PRE(
9060c7e83b2Smrg  [AC_MSG_CHECKING([that generated files are newer than configure])
9070c7e83b2Smrg   if test -n "$am_sleep_pid"; then
9080c7e83b2Smrg     # Hide warnings about reused PIDs.
9090c7e83b2Smrg     wait $am_sleep_pid 2>/dev/null
9100c7e83b2Smrg   fi
9110c7e83b2Smrg   AC_MSG_RESULT([done])])
9120c7e83b2Smrgrm -f conftest.file
9130c7e83b2Smrg])
9149aa228fdSmrg
9150c7e83b2Smrg# Copyright (C) 2009-2014 Free Software Foundation, Inc.
9168f65982aSmrg#
9178f65982aSmrg# This file is free software; the Free Software Foundation
9188f65982aSmrg# gives unlimited permission to copy and/or distribute it,
9198f65982aSmrg# with or without modifications, as long as this notice is preserved.
9208f65982aSmrg
9218f65982aSmrg# AM_SILENT_RULES([DEFAULT])
9228f65982aSmrg# --------------------------
9238f65982aSmrg# Enable less verbose build rules; with the default set to DEFAULT
9240c7e83b2Smrg# ("yes" being less verbose, "no" or empty being verbose).
9258f65982aSmrgAC_DEFUN([AM_SILENT_RULES],
9260c7e83b2Smrg[AC_ARG_ENABLE([silent-rules], [dnl
9270c7e83b2SmrgAS_HELP_STRING(
9280c7e83b2Smrg  [--enable-silent-rules],
9290c7e83b2Smrg  [less verbose build output (undo: "make V=1")])
9300c7e83b2SmrgAS_HELP_STRING(
9310c7e83b2Smrg  [--disable-silent-rules],
9320c7e83b2Smrg  [verbose build output (undo: "make V=0")])dnl
9330c7e83b2Smrg])
9340c7e83b2Smrgcase $enable_silent_rules in @%:@ (((
9350c7e83b2Smrg  yes) AM_DEFAULT_VERBOSITY=0;;
9360c7e83b2Smrg   no) AM_DEFAULT_VERBOSITY=1;;
9370c7e83b2Smrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
9388f65982aSmrgesac
9390c7e83b2Smrgdnl
9400c7e83b2Smrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
9410c7e83b2Smrgdnl do not support nested variable expansions.
9420c7e83b2Smrgdnl See automake bug#9928 and bug#10237.
9430c7e83b2Smrgam_make=${MAKE-make}
9440c7e83b2SmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
9450c7e83b2Smrg   [am_cv_make_support_nested_variables],
9460c7e83b2Smrg   [if AS_ECHO([['TRUE=$(BAR$(V))
9470c7e83b2SmrgBAR0=false
9480c7e83b2SmrgBAR1=true
9490c7e83b2SmrgV=1
9500c7e83b2Smrgam__doit:
9510c7e83b2Smrg	@$(TRUE)
9520c7e83b2Smrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
9530c7e83b2Smrg  am_cv_make_support_nested_variables=yes
9540c7e83b2Smrgelse
9550c7e83b2Smrg  am_cv_make_support_nested_variables=no
9560c7e83b2Smrgfi])
9570c7e83b2Smrgif test $am_cv_make_support_nested_variables = yes; then
9580c7e83b2Smrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
9590c7e83b2Smrg  AM_V='$(V)'
9600c7e83b2Smrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
9610c7e83b2Smrgelse
9620c7e83b2Smrg  AM_V=$AM_DEFAULT_VERBOSITY
9630c7e83b2Smrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
9640c7e83b2Smrgfi
9650c7e83b2SmrgAC_SUBST([AM_V])dnl
9660c7e83b2SmrgAM_SUBST_NOTMAKE([AM_V])dnl
9670c7e83b2SmrgAC_SUBST([AM_DEFAULT_V])dnl
9680c7e83b2SmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
9698f65982aSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
9708f65982aSmrgAM_BACKSLASH='\'
9718f65982aSmrgAC_SUBST([AM_BACKSLASH])dnl
9728f65982aSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
9738f65982aSmrg])
9748f65982aSmrg
9750c7e83b2Smrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
9769aa228fdSmrg#
9779aa228fdSmrg# This file is free software; the Free Software Foundation
9789aa228fdSmrg# gives unlimited permission to copy and/or distribute it,
9799aa228fdSmrg# with or without modifications, as long as this notice is preserved.
9809aa228fdSmrg
9819aa228fdSmrg# AM_PROG_INSTALL_STRIP
9829aa228fdSmrg# ---------------------
9830c7e83b2Smrg# One issue with vendor 'install' (even GNU) is that you can't
9849aa228fdSmrg# specify the program used to strip binaries.  This is especially
9859aa228fdSmrg# annoying in cross-compiling environments, where the build's strip
9869aa228fdSmrg# is unlikely to handle the host's binaries.
9879aa228fdSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
9880c7e83b2Smrg# always use install-sh in "make install-strip", and initialize
9899aa228fdSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
9909aa228fdSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
9919aa228fdSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
9920c7e83b2Smrg# Installed binaries are usually stripped using 'strip' when the user
9930c7e83b2Smrg# run "make install-strip".  However 'strip' might not be the right
9949aa228fdSmrg# tool to use in cross-compilation environments, therefore Automake
9950c7e83b2Smrg# will honor the 'STRIP' environment variable to overrule this program.
9960c7e83b2Smrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
9979aa228fdSmrgif test "$cross_compiling" != no; then
9989aa228fdSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
9999aa228fdSmrgfi
10009aa228fdSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
10019aa228fdSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
10029aa228fdSmrg
10030c7e83b2Smrg# Copyright (C) 2006-2014 Free Software Foundation, Inc.
10049aa228fdSmrg#
10059aa228fdSmrg# This file is free software; the Free Software Foundation
10069aa228fdSmrg# gives unlimited permission to copy and/or distribute it,
10079aa228fdSmrg# with or without modifications, as long as this notice is preserved.
10089aa228fdSmrg
10099aa228fdSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
10109aa228fdSmrg# ---------------------------
10118f65982aSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
10129aa228fdSmrg# This macro is traced by Automake.
10139aa228fdSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
10149aa228fdSmrg
10158f65982aSmrg# AM_SUBST_NOTMAKE(VARIABLE)
101680b026c6Smrg# --------------------------
10178f65982aSmrg# Public sister of _AM_SUBST_NOTMAKE.
10188f65982aSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
10198f65982aSmrg
10209aa228fdSmrg# Check how to create a tarball.                            -*- Autoconf -*-
10219aa228fdSmrg
10220c7e83b2Smrg# Copyright (C) 2004-2014 Free Software Foundation, Inc.
10239aa228fdSmrg#
10249aa228fdSmrg# This file is free software; the Free Software Foundation
10259aa228fdSmrg# gives unlimited permission to copy and/or distribute it,
10269aa228fdSmrg# with or without modifications, as long as this notice is preserved.
10279aa228fdSmrg
10289aa228fdSmrg# _AM_PROG_TAR(FORMAT)
10299aa228fdSmrg# --------------------
10309aa228fdSmrg# Check how to create a tarball in format FORMAT.
10310c7e83b2Smrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
10329aa228fdSmrg#
10339aa228fdSmrg# Substitute a variable $(am__tar) that is a command
10349aa228fdSmrg# writing to stdout a FORMAT-tarball containing the directory
10359aa228fdSmrg# $tardir.
10369aa228fdSmrg#     tardir=directory && $(am__tar) > result.tar
10379aa228fdSmrg#
10389aa228fdSmrg# Substitute a variable $(am__untar) that extract such
10399aa228fdSmrg# a tarball read from stdin.
10409aa228fdSmrg#     $(am__untar) < result.tar
10410c7e83b2Smrg#
10429aa228fdSmrgAC_DEFUN([_AM_PROG_TAR],
10430c7e83b2Smrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
10440c7e83b2Smrg# in the wild :-(  We should find a proper way to deprecate it ...
10450c7e83b2SmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
10460c7e83b2Smrg
10470c7e83b2Smrg# We'll loop over all known methods to create a tar archive until one works.
10489aa228fdSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
10499aa228fdSmrg
10500c7e83b2Smrgm4_if([$1], [v7],
10510c7e83b2Smrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
10520c7e83b2Smrg
10530c7e83b2Smrg  [m4_case([$1],
10540c7e83b2Smrg    [ustar],
10550c7e83b2Smrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
10560c7e83b2Smrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
10570c7e83b2Smrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
10580c7e83b2Smrg      # and bug#13588).
10590c7e83b2Smrg      am_max_uid=2097151 # 2^21 - 1
10600c7e83b2Smrg      am_max_gid=$am_max_uid
10610c7e83b2Smrg      # The $UID and $GID variables are not portable, so we need to resort
10620c7e83b2Smrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
10630c7e83b2Smrg      # below are definitely unexpected, so allow the users to see them
10640c7e83b2Smrg      # (that is, avoid stderr redirection).
10650c7e83b2Smrg      am_uid=`id -u || echo unknown`
10660c7e83b2Smrg      am_gid=`id -g || echo unknown`
10670c7e83b2Smrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
10680c7e83b2Smrg      if test $am_uid -le $am_max_uid; then
10690c7e83b2Smrg         AC_MSG_RESULT([yes])
10700c7e83b2Smrg      else
10710c7e83b2Smrg         AC_MSG_RESULT([no])
10720c7e83b2Smrg         _am_tools=none
10730c7e83b2Smrg      fi
10740c7e83b2Smrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
10750c7e83b2Smrg      if test $am_gid -le $am_max_gid; then
10760c7e83b2Smrg         AC_MSG_RESULT([yes])
10770c7e83b2Smrg      else
10780c7e83b2Smrg        AC_MSG_RESULT([no])
10790c7e83b2Smrg        _am_tools=none
10800c7e83b2Smrg      fi],
10810c7e83b2Smrg
10820c7e83b2Smrg  [pax],
10830c7e83b2Smrg    [],
10840c7e83b2Smrg
10850c7e83b2Smrg  [m4_fatal([Unknown tar format])])
10860c7e83b2Smrg
10870c7e83b2Smrg  AC_MSG_CHECKING([how to create a $1 tar archive])
10880c7e83b2Smrg
10890c7e83b2Smrg  # Go ahead even if we have the value already cached.  We do so because we
10900c7e83b2Smrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
10910c7e83b2Smrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
10920c7e83b2Smrg
10930c7e83b2Smrg  for _am_tool in $_am_tools; do
10940c7e83b2Smrg    case $_am_tool in
10950c7e83b2Smrg    gnutar)
10960c7e83b2Smrg      for _am_tar in tar gnutar gtar; do
10970c7e83b2Smrg        AM_RUN_LOG([$_am_tar --version]) && break
10980c7e83b2Smrg      done
10990c7e83b2Smrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
11000c7e83b2Smrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
11010c7e83b2Smrg      am__untar="$_am_tar -xf -"
11020c7e83b2Smrg      ;;
11030c7e83b2Smrg    plaintar)
11040c7e83b2Smrg      # Must skip GNU tar: if it does not support --format= it doesn't create
11050c7e83b2Smrg      # ustar tarball either.
11060c7e83b2Smrg      (tar --version) >/dev/null 2>&1 && continue
11070c7e83b2Smrg      am__tar='tar chf - "$$tardir"'
11080c7e83b2Smrg      am__tar_='tar chf - "$tardir"'
11090c7e83b2Smrg      am__untar='tar xf -'
11100c7e83b2Smrg      ;;
11110c7e83b2Smrg    pax)
11120c7e83b2Smrg      am__tar='pax -L -x $1 -w "$$tardir"'
11130c7e83b2Smrg      am__tar_='pax -L -x $1 -w "$tardir"'
11140c7e83b2Smrg      am__untar='pax -r'
11150c7e83b2Smrg      ;;
11160c7e83b2Smrg    cpio)
11170c7e83b2Smrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
11180c7e83b2Smrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
11190c7e83b2Smrg      am__untar='cpio -i -H $1 -d'
11200c7e83b2Smrg      ;;
11210c7e83b2Smrg    none)
11220c7e83b2Smrg      am__tar=false
11230c7e83b2Smrg      am__tar_=false
11240c7e83b2Smrg      am__untar=false
11250c7e83b2Smrg      ;;
11260c7e83b2Smrg    esac
11279aa228fdSmrg
11280c7e83b2Smrg    # If the value was cached, stop now.  We just wanted to have am__tar
11290c7e83b2Smrg    # and am__untar set.
11300c7e83b2Smrg    test -n "${am_cv_prog_tar_$1}" && break
11310c7e83b2Smrg
11320c7e83b2Smrg    # tar/untar a dummy directory, and stop if the command works.
11330c7e83b2Smrg    rm -rf conftest.dir
11340c7e83b2Smrg    mkdir conftest.dir
11350c7e83b2Smrg    echo GrepMe > conftest.dir/file
11360c7e83b2Smrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
11370c7e83b2Smrg    rm -rf conftest.dir
11380c7e83b2Smrg    if test -s conftest.tar; then
11390c7e83b2Smrg      AM_RUN_LOG([$am__untar <conftest.tar])
11400c7e83b2Smrg      AM_RUN_LOG([cat conftest.dir/file])
11410c7e83b2Smrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
11420c7e83b2Smrg    fi
11430c7e83b2Smrg  done
11449aa228fdSmrg  rm -rf conftest.dir
11459aa228fdSmrg
11460c7e83b2Smrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
11470c7e83b2Smrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
11480c7e83b2Smrg
11499aa228fdSmrgAC_SUBST([am__tar])
11509aa228fdSmrgAC_SUBST([am__untar])
11519aa228fdSmrg]) # _AM_PROG_TAR
11529aa228fdSmrg
115380b026c6Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
115480b026c6Smrg# 
115580b026c6Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
115680b026c6Smrg#
115780b026c6Smrg# This program is free software; you can redistribute it and/or modify
115880b026c6Smrg# it under the terms of the GNU General Public License as published by
115980b026c6Smrg# the Free Software Foundation; either version 2 of the License, or
116080b026c6Smrg# (at your option) any later version.
116180b026c6Smrg#
116280b026c6Smrg# This program is distributed in the hope that it will be useful, but
116380b026c6Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
116480b026c6Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
116580b026c6Smrg# General Public License for more details.
116680b026c6Smrg#
116780b026c6Smrg# You should have received a copy of the GNU General Public License
116880b026c6Smrg# along with this program; if not, write to the Free Software
116980b026c6Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
117080b026c6Smrg#
117180b026c6Smrg# As a special exception to the GNU General Public License, if you
117280b026c6Smrg# distribute this file as part of a program that contains a
117380b026c6Smrg# configuration script generated by Autoconf, you may include it under
117480b026c6Smrg# the same distribution terms that you use for the rest of that program.
117580b026c6Smrg
117680b026c6Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
117780b026c6Smrg# ----------------------------------
117880b026c6SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
117980b026c6Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
118080b026c6Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
118180b026c6SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
118280b026c6Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
118380b026c6Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
118480b026c6Smrgfi
118580b026c6Smrgif test -n "$PKG_CONFIG"; then
118680b026c6Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
118780b026c6Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
118880b026c6Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
118980b026c6Smrg		AC_MSG_RESULT([yes])
119080b026c6Smrg	else
119180b026c6Smrg		AC_MSG_RESULT([no])
119280b026c6Smrg		PKG_CONFIG=""
119380b026c6Smrg	fi
119480b026c6Smrg		
119580b026c6Smrgfi[]dnl
119680b026c6Smrg])# PKG_PROG_PKG_CONFIG
119780b026c6Smrg
119880b026c6Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
119980b026c6Smrg#
120080b026c6Smrg# Check to see whether a particular set of modules exists.  Similar
120180b026c6Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
120280b026c6Smrg#
120380b026c6Smrg#
120480b026c6Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
120580b026c6Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
120680b026c6Smrg# PKG_CHECK_EXISTS manually
120780b026c6Smrg# --------------------------------------------------------------
120880b026c6SmrgAC_DEFUN([PKG_CHECK_EXISTS],
120980b026c6Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
121080b026c6Smrgif test -n "$PKG_CONFIG" && \
121180b026c6Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
121280b026c6Smrg  m4_ifval([$2], [$2], [:])
121380b026c6Smrgm4_ifvaln([$3], [else
121480b026c6Smrg  $3])dnl
121580b026c6Smrgfi])
121680b026c6Smrg
121780b026c6Smrg
121880b026c6Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
121980b026c6Smrg# ---------------------------------------------
122080b026c6Smrgm4_define([_PKG_CONFIG],
122180b026c6Smrg[if test -n "$$1"; then
122280b026c6Smrg    pkg_cv_[]$1="$$1"
122380b026c6Smrg elif test -n "$PKG_CONFIG"; then
122480b026c6Smrg    PKG_CHECK_EXISTS([$3],
122580b026c6Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
122680b026c6Smrg		     [pkg_failed=yes])
122780b026c6Smrg else
122880b026c6Smrg    pkg_failed=untried
122980b026c6Smrgfi[]dnl
123080b026c6Smrg])# _PKG_CONFIG
123180b026c6Smrg
123280b026c6Smrg# _PKG_SHORT_ERRORS_SUPPORTED
123380b026c6Smrg# -----------------------------
123480b026c6SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
123580b026c6Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
123680b026c6Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
123780b026c6Smrg        _pkg_short_errors_supported=yes
123880b026c6Smrgelse
123980b026c6Smrg        _pkg_short_errors_supported=no
124080b026c6Smrgfi[]dnl
124180b026c6Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
124280b026c6Smrg
124380b026c6Smrg
124480b026c6Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
124580b026c6Smrg# [ACTION-IF-NOT-FOUND])
124680b026c6Smrg#
124780b026c6Smrg#
124880b026c6Smrg# Note that if there is a possibility the first call to
124980b026c6Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
125080b026c6Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
125180b026c6Smrg#
125280b026c6Smrg#
125380b026c6Smrg# --------------------------------------------------------------
125480b026c6SmrgAC_DEFUN([PKG_CHECK_MODULES],
125580b026c6Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
125680b026c6SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
125780b026c6SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
125880b026c6Smrg
125980b026c6Smrgpkg_failed=no
126080b026c6SmrgAC_MSG_CHECKING([for $1])
126180b026c6Smrg
126280b026c6Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
126380b026c6Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
126480b026c6Smrg
126580b026c6Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
126680b026c6Smrgand $1[]_LIBS to avoid the need to call pkg-config.
126780b026c6SmrgSee the pkg-config man page for more details.])
126880b026c6Smrg
126980b026c6Smrgif test $pkg_failed = yes; then
127080b026c6Smrg        _PKG_SHORT_ERRORS_SUPPORTED
127180b026c6Smrg        if test $_pkg_short_errors_supported = yes; then
127280b026c6Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
127380b026c6Smrg        else 
127480b026c6Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
127580b026c6Smrg        fi
127680b026c6Smrg	# Put the nasty error message in config.log where it belongs
127780b026c6Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
127880b026c6Smrg
127980b026c6Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
128080b026c6Smrg[Package requirements ($2) were not met:
128180b026c6Smrg
128280b026c6Smrg$$1_PKG_ERRORS
128380b026c6Smrg
128480b026c6SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
128580b026c6Smrginstalled software in a non-standard prefix.
128680b026c6Smrg
128780b026c6Smrg_PKG_TEXT
128880b026c6Smrg])],
128980b026c6Smrg		[AC_MSG_RESULT([no])
129080b026c6Smrg                $4])
129180b026c6Smrgelif test $pkg_failed = untried; then
129280b026c6Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
129380b026c6Smrg[The pkg-config script could not be found or is too old.  Make sure it
129480b026c6Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
129580b026c6Smrgpath to pkg-config.
129680b026c6Smrg
129780b026c6Smrg_PKG_TEXT
129880b026c6Smrg
129980b026c6SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
130080b026c6Smrg		[$4])
130180b026c6Smrgelse
130280b026c6Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
130380b026c6Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
130480b026c6Smrg        AC_MSG_RESULT([yes])
130580b026c6Smrg	ifelse([$3], , :, [$3])
130680b026c6Smrgfi[]dnl
130780b026c6Smrg])# PKG_CHECK_MODULES
130880b026c6Smrg
130983d7c197Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
13109aa228fdSmrgdnl
13118f65982aSmrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
13120c7e83b2Smrgdnl
13139aa228fdSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
13148f65982aSmrgdnl copy of this software and associated documentation files (the "Software"),
13158f65982aSmrgdnl to deal in the Software without restriction, including without limitation
13168f65982aSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
13178f65982aSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
13188f65982aSmrgdnl Software is furnished to do so, subject to the following conditions:
13199aa228fdSmrgdnl
13208f65982aSmrgdnl The above copyright notice and this permission notice (including the next
13218f65982aSmrgdnl paragraph) shall be included in all copies or substantial portions of the
13228f65982aSmrgdnl Software.
13239aa228fdSmrgdnl
13248f65982aSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13258f65982aSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13268f65982aSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
13278f65982aSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
13288f65982aSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
13298f65982aSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
13308f65982aSmrgdnl DEALINGS IN THE SOFTWARE.
13319aa228fdSmrg
13329aa228fdSmrg# XORG_MACROS_VERSION(required-version)
13339aa228fdSmrg# -------------------------------------
13349aa228fdSmrg# Minimum version: 1.1.0
13359aa228fdSmrg#
13369aa228fdSmrg# If you're using a macro added in Version 1.1 or newer, include this in
13379aa228fdSmrg# your configure.ac with the minimum required version, such as:
13389aa228fdSmrg# XORG_MACROS_VERSION(1.1)
13399aa228fdSmrg#
134083d7c197Smrg# To ensure that this macro is defined, also add:
134183d7c197Smrg# m4_ifndef([XORG_MACROS_VERSION],
134283d7c197Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
13439aa228fdSmrg#
13449aa228fdSmrg#
13450c7e83b2Smrg# See the "minimum version" comment for each macro you use to see what
13469aa228fdSmrg# version you require.
134783d7c197Smrgm4_defun([XORG_MACROS_VERSION],[
13480c7e83b2Smrgm4_define([vers_have], [1.19.0])
134983d7c197Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
135083d7c197Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
135183d7c197Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
135283d7c197Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
135383d7c197Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
135483d7c197Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
135583d7c197Smrgm4_undefine([vers_have])
135683d7c197Smrgm4_undefine([maj_have])
135783d7c197Smrgm4_undefine([maj_needed])
13589aa228fdSmrg]) # XORG_MACROS_VERSION
13599aa228fdSmrg
13609aa228fdSmrg# XORG_PROG_RAWCPP()
13619aa228fdSmrg# ------------------
13629aa228fdSmrg# Minimum version: 1.0.0
13639aa228fdSmrg#
13649aa228fdSmrg# Find cpp program and necessary flags for use in pre-processing text files
13659aa228fdSmrg# such as man pages and config files
13669aa228fdSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
13679aa228fdSmrgAC_REQUIRE([AC_PROG_CPP])
13680c7e83b2SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
13699aa228fdSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
13709aa228fdSmrg
13719aa228fdSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
13729aa228fdSmrg# which is not the best choice for supporting other OS'es, but covers most
13739aa228fdSmrg# of the ones we need for now.
13749aa228fdSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
137580b026c6SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
13769aa228fdSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
13779aa228fdSmrg	AC_MSG_RESULT([no])
13789aa228fdSmrgelse
13799aa228fdSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
13809aa228fdSmrg		RAWCPPFLAGS=-undef
13819aa228fdSmrg		AC_MSG_RESULT([yes])
138283d7c197Smrg	# under Cygwin unix is still defined even with -undef
138383d7c197Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
138483d7c197Smrg		RAWCPPFLAGS="-undef -ansi"
138583d7c197Smrg		AC_MSG_RESULT([yes, with -ansi])
13869aa228fdSmrg	else
13879aa228fdSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
13889aa228fdSmrg	fi
13899aa228fdSmrgfi
13909aa228fdSmrgrm -f conftest.$ac_ext
13919aa228fdSmrg
13929aa228fdSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
139380b026c6SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
13949aa228fdSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
13959aa228fdSmrg	AC_MSG_RESULT([no])
13969aa228fdSmrgelse
13979aa228fdSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
13980c7e83b2Smrg		TRADITIONALCPPFLAGS="-traditional"
13999aa228fdSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
14009aa228fdSmrg		AC_MSG_RESULT([yes])
14019aa228fdSmrg	else
14029aa228fdSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
14039aa228fdSmrg	fi
14049aa228fdSmrgfi
14059aa228fdSmrgrm -f conftest.$ac_ext
14069aa228fdSmrgAC_SUBST(RAWCPPFLAGS)
14070c7e83b2SmrgAC_SUBST(TRADITIONALCPPFLAGS)
14089aa228fdSmrg]) # XORG_PROG_RAWCPP
14099aa228fdSmrg
14109aa228fdSmrg# XORG_MANPAGE_SECTIONS()
14119aa228fdSmrg# -----------------------
14129aa228fdSmrg# Minimum version: 1.0.0
14139aa228fdSmrg#
14149aa228fdSmrg# Determine which sections man pages go in for the different man page types
14159aa228fdSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
14169aa228fdSmrg# Not sure if there's any better way than just hardcoding by OS name.
14179aa228fdSmrg# Override default settings by setting environment variables
14188f65982aSmrg# Added MAN_SUBSTS in version 1.8
14198f65982aSmrg# Added AC_PROG_SED in version 1.8
14209aa228fdSmrg
14219aa228fdSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
14229aa228fdSmrgAC_REQUIRE([AC_CANONICAL_HOST])
14238f65982aSmrgAC_REQUIRE([AC_PROG_SED])
14249aa228fdSmrg
14259aa228fdSmrgif test x$APP_MAN_SUFFIX = x    ; then
14269aa228fdSmrg    APP_MAN_SUFFIX=1
14279aa228fdSmrgfi
14289aa228fdSmrgif test x$APP_MAN_DIR = x    ; then
14299aa228fdSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
14309aa228fdSmrgfi
14319aa228fdSmrg
14329aa228fdSmrgif test x$LIB_MAN_SUFFIX = x    ; then
14339aa228fdSmrg    LIB_MAN_SUFFIX=3
14349aa228fdSmrgfi
14359aa228fdSmrgif test x$LIB_MAN_DIR = x    ; then
14369aa228fdSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
14379aa228fdSmrgfi
14389aa228fdSmrg
14399aa228fdSmrgif test x$FILE_MAN_SUFFIX = x    ; then
14409aa228fdSmrg    case $host_os in
14419aa228fdSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
14429aa228fdSmrg	*)		FILE_MAN_SUFFIX=5  ;;
14439aa228fdSmrg    esac
14449aa228fdSmrgfi
14459aa228fdSmrgif test x$FILE_MAN_DIR = x    ; then
14469aa228fdSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
14479aa228fdSmrgfi
14489aa228fdSmrg
14499aa228fdSmrgif test x$MISC_MAN_SUFFIX = x    ; then
14509aa228fdSmrg    case $host_os in
14519aa228fdSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
14529aa228fdSmrg	*)		MISC_MAN_SUFFIX=7  ;;
14539aa228fdSmrg    esac
14549aa228fdSmrgfi
14559aa228fdSmrgif test x$MISC_MAN_DIR = x    ; then
14569aa228fdSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
14579aa228fdSmrgfi
14589aa228fdSmrg
14599aa228fdSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
14609aa228fdSmrg    case $host_os in
14619aa228fdSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
14629aa228fdSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
14639aa228fdSmrg    esac
14649aa228fdSmrgfi
14659aa228fdSmrgif test x$DRIVER_MAN_DIR = x    ; then
14669aa228fdSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
14679aa228fdSmrgfi
14689aa228fdSmrg
14699aa228fdSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
14709aa228fdSmrg    case $host_os in
14719aa228fdSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
14729aa228fdSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
14739aa228fdSmrg    esac
14749aa228fdSmrgfi
14759aa228fdSmrgif test x$ADMIN_MAN_DIR = x    ; then
14769aa228fdSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
14779aa228fdSmrgfi
14789aa228fdSmrg
14799aa228fdSmrg
14809aa228fdSmrgAC_SUBST([APP_MAN_SUFFIX])
14819aa228fdSmrgAC_SUBST([LIB_MAN_SUFFIX])
14829aa228fdSmrgAC_SUBST([FILE_MAN_SUFFIX])
14839aa228fdSmrgAC_SUBST([MISC_MAN_SUFFIX])
14849aa228fdSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
14859aa228fdSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
14869aa228fdSmrgAC_SUBST([APP_MAN_DIR])
14879aa228fdSmrgAC_SUBST([LIB_MAN_DIR])
14889aa228fdSmrgAC_SUBST([FILE_MAN_DIR])
14899aa228fdSmrgAC_SUBST([MISC_MAN_DIR])
14909aa228fdSmrgAC_SUBST([DRIVER_MAN_DIR])
14919aa228fdSmrgAC_SUBST([ADMIN_MAN_DIR])
14928f65982aSmrg
14938f65982aSmrgXORG_MAN_PAGE="X Version 11"
14948f65982aSmrgAC_SUBST([XORG_MAN_PAGE])
14958f65982aSmrgMAN_SUBSTS="\
14968f65982aSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
14978f65982aSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
14988f65982aSmrg	-e 's|__xservername__|Xorg|g' \
14998f65982aSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
15008f65982aSmrg	-e 's|__projectroot__|\$(prefix)|g' \
15018f65982aSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
15028f65982aSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
15038f65982aSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
15048f65982aSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
15058f65982aSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
15068f65982aSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
15078f65982aSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
15088f65982aSmrgAC_SUBST([MAN_SUBSTS])
15098f65982aSmrg
15109aa228fdSmrg]) # XORG_MANPAGE_SECTIONS
15119aa228fdSmrg
15128f65982aSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
15138f65982aSmrg# ------------------------
15148f65982aSmrg# Minimum version: 1.7.0
15158f65982aSmrg#
15168f65982aSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
15178f65982aSmrg# provided by xorg-sgml-doctools, if installed.
15188f65982aSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
15198f65982aSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
15208f65982aSmrgXORG_SGML_PATH=
15218f65982aSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
15228f65982aSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
15238f65982aSmrg    [m4_ifval([$1],[:],
15248f65982aSmrg        [if test x"$cross_compiling" != x"yes" ; then
15258f65982aSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
15268f65982aSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
15278f65982aSmrg         fi])
15288f65982aSmrg    ])
15298f65982aSmrg
15308f65982aSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
15318f65982aSmrg# the path and the name of the doc stylesheet
15328f65982aSmrgif test "x$XORG_SGML_PATH" != "x" ; then
15338f65982aSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
15348f65982aSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
15358f65982aSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
15368f65982aSmrgelse
15378f65982aSmrg   AC_MSG_RESULT([no])
15388f65982aSmrgfi
15398f65982aSmrg
15408f65982aSmrgAC_SUBST(XORG_SGML_PATH)
15418f65982aSmrgAC_SUBST(STYLESHEET_SRCDIR)
15428f65982aSmrgAC_SUBST(XSL_STYLESHEET)
15438f65982aSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
15448f65982aSmrg]) # XORG_CHECK_SGML_DOCTOOLS
15458f65982aSmrg
15469aa228fdSmrg# XORG_CHECK_LINUXDOC
15479aa228fdSmrg# -------------------
15489aa228fdSmrg# Minimum version: 1.0.0
15499aa228fdSmrg#
15509aa228fdSmrg# Defines the variable MAKE_TEXT if the necessary tools and
15519aa228fdSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
15529aa228fdSmrg# Whether or not the necessary tools and files are found can be checked
15539aa228fdSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
15549aa228fdSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
15558f65982aSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
15568f65982aSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
15579aa228fdSmrg
15589aa228fdSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
15599aa228fdSmrg
15608f65982aSmrgAC_MSG_CHECKING([whether to build documentation])
15619aa228fdSmrg
15628f65982aSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
15639aa228fdSmrg   BUILDDOC=yes
15649aa228fdSmrgelse
15659aa228fdSmrg   BUILDDOC=no
15669aa228fdSmrgfi
15679aa228fdSmrg
15689aa228fdSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
15699aa228fdSmrg
15709aa228fdSmrgAC_MSG_RESULT([$BUILDDOC])
15719aa228fdSmrg
15728f65982aSmrgAC_MSG_CHECKING([whether to build pdf documentation])
15739aa228fdSmrg
15748f65982aSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
15759aa228fdSmrg   BUILDPDFDOC=yes
15769aa228fdSmrgelse
15779aa228fdSmrg   BUILDPDFDOC=no
15789aa228fdSmrgfi
15799aa228fdSmrg
15809aa228fdSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
15819aa228fdSmrg
15829aa228fdSmrgAC_MSG_RESULT([$BUILDPDFDOC])
15839aa228fdSmrg
15848f65982aSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
15859aa228fdSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
15869aa228fdSmrgMAKE_PDF="$PS2PDF"
15879aa228fdSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
15889aa228fdSmrg
15899aa228fdSmrgAC_SUBST(MAKE_TEXT)
15909aa228fdSmrgAC_SUBST(MAKE_PS)
15919aa228fdSmrgAC_SUBST(MAKE_PDF)
15929aa228fdSmrgAC_SUBST(MAKE_HTML)
15939aa228fdSmrg]) # XORG_CHECK_LINUXDOC
15949aa228fdSmrg
15959aa228fdSmrg# XORG_CHECK_DOCBOOK
15969aa228fdSmrg# -------------------
15979aa228fdSmrg# Minimum version: 1.0.0
15989aa228fdSmrg#
15999aa228fdSmrg# Checks for the ability to build output formats from SGML DocBook source.
16009aa228fdSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
16019aa228fdSmrg# indicates whether the necessary tools and files are found and, if set,
16029aa228fdSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
16039aa228fdSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
16048f65982aSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
16058f65982aSmrg
16069aa228fdSmrgBUILDTXTDOC=no
16079aa228fdSmrgBUILDPDFDOC=no
16089aa228fdSmrgBUILDPSDOC=no
16099aa228fdSmrgBUILDHTMLDOC=no
16109aa228fdSmrg
16119aa228fdSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
16129aa228fdSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
16139aa228fdSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
16149aa228fdSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
16159aa228fdSmrg
16168f65982aSmrgAC_MSG_CHECKING([whether to build text documentation])
16178f65982aSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
16189aa228fdSmrg   test x$BUILD_TXTDOC != xno; then
16199aa228fdSmrg	BUILDTXTDOC=yes
16209aa228fdSmrgfi
16219aa228fdSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
16229aa228fdSmrgAC_MSG_RESULT([$BUILDTXTDOC])
16239aa228fdSmrg
16248f65982aSmrgAC_MSG_CHECKING([whether to build PDF documentation])
16258f65982aSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
16269aa228fdSmrg   test x$BUILD_PDFDOC != xno; then
16279aa228fdSmrg	BUILDPDFDOC=yes
16289aa228fdSmrgfi
16299aa228fdSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
16309aa228fdSmrgAC_MSG_RESULT([$BUILDPDFDOC])
16319aa228fdSmrg
16328f65982aSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
16338f65982aSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
16349aa228fdSmrg   test x$BUILD_PSDOC != xno; then
16359aa228fdSmrg	BUILDPSDOC=yes
16369aa228fdSmrgfi
16379aa228fdSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
16389aa228fdSmrgAC_MSG_RESULT([$BUILDPSDOC])
16399aa228fdSmrg
16408f65982aSmrgAC_MSG_CHECKING([whether to build HTML documentation])
16418f65982aSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
16429aa228fdSmrg   test x$BUILD_HTMLDOC != xno; then
16439aa228fdSmrg	BUILDHTMLDOC=yes
16449aa228fdSmrgfi
16459aa228fdSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
16469aa228fdSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
16479aa228fdSmrg
16489aa228fdSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
16499aa228fdSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
16509aa228fdSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
16519aa228fdSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
16529aa228fdSmrg
16539aa228fdSmrgAC_SUBST(MAKE_TEXT)
16549aa228fdSmrgAC_SUBST(MAKE_PS)
16559aa228fdSmrgAC_SUBST(MAKE_PDF)
16569aa228fdSmrgAC_SUBST(MAKE_HTML)
16579aa228fdSmrg]) # XORG_CHECK_DOCBOOK
16589aa228fdSmrg
16598f65982aSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
16608f65982aSmrg# ----------------
16618f65982aSmrg# Minimum version: 1.5.0
16628f65982aSmrg# Minimum version for optional DEFAULT argument: 1.11.0
16638f65982aSmrg#
16648f65982aSmrg# Documentation tools are not always available on all platforms and sometimes
16658f65982aSmrg# not at the appropriate level. This macro enables a module to test for the
16668f65982aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
16678f65982aSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
16688f65982aSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
16698f65982aSmrg# --with-xmlto assumes 'auto'.
16708f65982aSmrg#
16718f65982aSmrg# Interface to module:
16728f65982aSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
16738f65982aSmrg# XMLTO:	returns the path of the xmlto program found
16748f65982aSmrg#		returns the path set by the user in the environment
16758f65982aSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
16768f65982aSmrg#		'no' user instructs the module not to use xmlto
16778f65982aSmrg#
16788f65982aSmrg# Added in version 1.10.0
16798f65982aSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
16808f65982aSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
16818f65982aSmrg#
16828f65982aSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
16838f65982aSmrg#
16848f65982aSmrgAC_DEFUN([XORG_WITH_XMLTO],[
16858f65982aSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
16868f65982aSmrgm4_define([_defopt], m4_default([$2], [auto]))
16878f65982aSmrgAC_ARG_WITH(xmlto,
16888f65982aSmrg	AS_HELP_STRING([--with-xmlto],
16898f65982aSmrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
16908f65982aSmrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
16918f65982aSmrgm4_undefine([_defopt])
16928f65982aSmrg
16938f65982aSmrgif test "x$use_xmlto" = x"auto"; then
16948f65982aSmrg   AC_PATH_PROG([XMLTO], [xmlto])
16958f65982aSmrg   if test "x$XMLTO" = "x"; then
16968f65982aSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
16978f65982aSmrg	have_xmlto=no
16988f65982aSmrg   else
16998f65982aSmrg        have_xmlto=yes
17008f65982aSmrg   fi
17018f65982aSmrgelif test "x$use_xmlto" = x"yes" ; then
17028f65982aSmrg   AC_PATH_PROG([XMLTO], [xmlto])
17038f65982aSmrg   if test "x$XMLTO" = "x"; then
17048f65982aSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
17058f65982aSmrg   fi
17068f65982aSmrg   have_xmlto=yes
17078f65982aSmrgelif test "x$use_xmlto" = x"no" ; then
17088f65982aSmrg   if test "x$XMLTO" != "x"; then
17098f65982aSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
17108f65982aSmrg   fi
17118f65982aSmrg   have_xmlto=no
17128f65982aSmrgelse
17138f65982aSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
17148f65982aSmrgfi
17158f65982aSmrg
17168f65982aSmrg# Test for a minimum version of xmlto, if provided.
17178f65982aSmrgm4_ifval([$1],
17188f65982aSmrg[if test "$have_xmlto" = yes; then
17198f65982aSmrg    # scrape the xmlto version
17208f65982aSmrg    AC_MSG_CHECKING([the xmlto version])
17218f65982aSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
17228f65982aSmrg    AC_MSG_RESULT([$xmlto_version])
17238f65982aSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
17248f65982aSmrg        [if test "x$use_xmlto" = xauto; then
17258f65982aSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
17268f65982aSmrg            have_xmlto=no
17278f65982aSmrg        else
17288f65982aSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
17298f65982aSmrg        fi])
17308f65982aSmrgfi])
17318f65982aSmrg
17328f65982aSmrg# Test for the ability of xmlto to generate a text target
17338f65982aSmrghave_xmlto_text=no
17348f65982aSmrgcat > conftest.xml << "EOF"
17358f65982aSmrgEOF
17368f65982aSmrgAS_IF([test "$have_xmlto" = yes],
17378f65982aSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
17388f65982aSmrg             [have_xmlto_text=yes],
17398f65982aSmrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
17408f65982aSmrgrm -f conftest.xml
17418f65982aSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
17428f65982aSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
17438f65982aSmrg]) # XORG_WITH_XMLTO
17448f65982aSmrg
174580b026c6Smrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
174680b026c6Smrg# --------------------------------------------
174780b026c6Smrg# Minimum version: 1.12.0
174880b026c6Smrg# Minimum version for optional DEFAULT argument: 1.12.0
174980b026c6Smrg#
175080b026c6Smrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
175180b026c6Smrg# XML-based language used for the transformation of XML documents.
175280b026c6Smrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
175380b026c6Smrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
175480b026c6Smrg# The XSLT processor is often used as a standalone tool for transformations.
175580b026c6Smrg# It should not be assumed that this tool is used only to work with documnetation.
175680b026c6Smrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
175780b026c6Smrg#
175880b026c6Smrg# Interface to module:
175980b026c6Smrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
176080b026c6Smrg# XSLTPROC:	 returns the path of the xsltproc program found
176180b026c6Smrg#		 returns the path set by the user in the environment
176280b026c6Smrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
176380b026c6Smrg#		  'no' user instructs the module not to use xsltproc
176480b026c6Smrg# have_xsltproc: returns yes if xsltproc found in PATH or no
176580b026c6Smrg#
176680b026c6Smrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
176780b026c6Smrg#
176880b026c6SmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
176980b026c6SmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
177080b026c6Smrg# Preserves the interface, should it be implemented later
177180b026c6Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
177280b026c6Smrgm4_define([_defopt], m4_default([$2], [auto]))
177380b026c6SmrgAC_ARG_WITH(xsltproc,
177480b026c6Smrg	AS_HELP_STRING([--with-xsltproc],
177580b026c6Smrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
177680b026c6Smrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
177780b026c6Smrgm4_undefine([_defopt])
177880b026c6Smrg
177980b026c6Smrgif test "x$use_xsltproc" = x"auto"; then
178080b026c6Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
178180b026c6Smrg   if test "x$XSLTPROC" = "x"; then
178280b026c6Smrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
178380b026c6Smrg	have_xsltproc=no
178480b026c6Smrg   else
178580b026c6Smrg        have_xsltproc=yes
178680b026c6Smrg   fi
178780b026c6Smrgelif test "x$use_xsltproc" = x"yes" ; then
178880b026c6Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
178980b026c6Smrg   if test "x$XSLTPROC" = "x"; then
179080b026c6Smrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
179180b026c6Smrg   fi
179280b026c6Smrg   have_xsltproc=yes
179380b026c6Smrgelif test "x$use_xsltproc" = x"no" ; then
179480b026c6Smrg   if test "x$XSLTPROC" != "x"; then
179580b026c6Smrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
179680b026c6Smrg   fi
179780b026c6Smrg   have_xsltproc=no
179880b026c6Smrgelse
179980b026c6Smrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
180080b026c6Smrgfi
180180b026c6Smrg
180280b026c6SmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
180380b026c6Smrg]) # XORG_WITH_XSLTPROC
180480b026c6Smrg
180580b026c6Smrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
180680b026c6Smrg# ----------------------------------------
180780b026c6Smrg# Minimum version: 1.15.0
180880b026c6Smrg#
180980b026c6Smrg# PERL (Practical Extraction and Report Language) is a language optimized for
181080b026c6Smrg# scanning arbitrary text files, extracting information from those text files,
181180b026c6Smrg# and printing reports based on that information.
181280b026c6Smrg#
181380b026c6Smrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
181480b026c6Smrg#
181580b026c6Smrg# Interface to module:
181680b026c6Smrg# HAVE_PERL: used in makefiles to conditionally scan text files
181780b026c6Smrg# PERL:	     returns the path of the perl program found
181880b026c6Smrg#	     returns the path set by the user in the environment
181980b026c6Smrg# --with-perl: 'yes' user instructs the module to use perl
182080b026c6Smrg#	       'no' user instructs the module not to use perl
182180b026c6Smrg# have_perl: returns yes if perl found in PATH or no
182280b026c6Smrg#
182380b026c6Smrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
182480b026c6Smrg#
182580b026c6SmrgAC_DEFUN([XORG_WITH_PERL],[
182680b026c6SmrgAC_ARG_VAR([PERL], [Path to perl command])
182780b026c6Smrg# Preserves the interface, should it be implemented later
182880b026c6Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
182980b026c6Smrgm4_define([_defopt], m4_default([$2], [auto]))
183080b026c6SmrgAC_ARG_WITH(perl,
183180b026c6Smrg	AS_HELP_STRING([--with-perl],
183280b026c6Smrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
183380b026c6Smrg	   [use_perl=$withval], [use_perl=]_defopt)
183480b026c6Smrgm4_undefine([_defopt])
183580b026c6Smrg
183680b026c6Smrgif test "x$use_perl" = x"auto"; then
183780b026c6Smrg   AC_PATH_PROG([PERL], [perl])
183880b026c6Smrg   if test "x$PERL" = "x"; then
183980b026c6Smrg        AC_MSG_WARN([perl not found - cannot extract information and report])
184080b026c6Smrg	have_perl=no
184180b026c6Smrg   else
184280b026c6Smrg        have_perl=yes
184380b026c6Smrg   fi
184480b026c6Smrgelif test "x$use_perl" = x"yes" ; then
184580b026c6Smrg   AC_PATH_PROG([PERL], [perl])
184680b026c6Smrg   if test "x$PERL" = "x"; then
184780b026c6Smrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
184880b026c6Smrg   fi
184980b026c6Smrg   have_perl=yes
185080b026c6Smrgelif test "x$use_perl" = x"no" ; then
185180b026c6Smrg   if test "x$PERL" != "x"; then
185280b026c6Smrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
185380b026c6Smrg   fi
185480b026c6Smrg   have_perl=no
185580b026c6Smrgelse
185680b026c6Smrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
185780b026c6Smrgfi
185880b026c6Smrg
185980b026c6SmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
186080b026c6Smrg]) # XORG_WITH_PERL
186180b026c6Smrg
18628f65982aSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
18638f65982aSmrg# ----------------
18648f65982aSmrg# Minimum version: 1.5.0
18658f65982aSmrg# Minimum version for optional DEFAULT argument: 1.11.0
18668f65982aSmrg#
18678f65982aSmrg# Documentation tools are not always available on all platforms and sometimes
18688f65982aSmrg# not at the appropriate level. This macro enables a module to test for the
18698f65982aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
18708f65982aSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
18718f65982aSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
18728f65982aSmrg# --with-asciidoc assumes 'auto'.
18738f65982aSmrg#
18748f65982aSmrg# Interface to module:
18758f65982aSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
18768f65982aSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
18778f65982aSmrg#		 returns the path set by the user in the environment
18788f65982aSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
18798f65982aSmrg#		  'no' user instructs the module not to use asciidoc
18808f65982aSmrg#
18818f65982aSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
18828f65982aSmrg#
18838f65982aSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
18848f65982aSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
18858f65982aSmrgm4_define([_defopt], m4_default([$2], [auto]))
18868f65982aSmrgAC_ARG_WITH(asciidoc,
18878f65982aSmrg	AS_HELP_STRING([--with-asciidoc],
18888f65982aSmrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
18898f65982aSmrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
18908f65982aSmrgm4_undefine([_defopt])
18918f65982aSmrg
18928f65982aSmrgif test "x$use_asciidoc" = x"auto"; then
18938f65982aSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
18948f65982aSmrg   if test "x$ASCIIDOC" = "x"; then
18958f65982aSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
18968f65982aSmrg	have_asciidoc=no
18978f65982aSmrg   else
18988f65982aSmrg        have_asciidoc=yes
18998f65982aSmrg   fi
19008f65982aSmrgelif test "x$use_asciidoc" = x"yes" ; then
19018f65982aSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
19028f65982aSmrg   if test "x$ASCIIDOC" = "x"; then
19038f65982aSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
19048f65982aSmrg   fi
19058f65982aSmrg   have_asciidoc=yes
19068f65982aSmrgelif test "x$use_asciidoc" = x"no" ; then
19078f65982aSmrg   if test "x$ASCIIDOC" != "x"; then
19088f65982aSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
19098f65982aSmrg   fi
19108f65982aSmrg   have_asciidoc=no
19118f65982aSmrgelse
19128f65982aSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
19138f65982aSmrgfi
19148f65982aSmrgm4_ifval([$1],
19158f65982aSmrg[if test "$have_asciidoc" = yes; then
19168f65982aSmrg    # scrape the asciidoc version
19178f65982aSmrg    AC_MSG_CHECKING([the asciidoc version])
19188f65982aSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
19198f65982aSmrg    AC_MSG_RESULT([$asciidoc_version])
19208f65982aSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
19218f65982aSmrg        [if test "x$use_asciidoc" = xauto; then
19228f65982aSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
19238f65982aSmrg            have_asciidoc=no
19248f65982aSmrg        else
19258f65982aSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
19268f65982aSmrg        fi])
19278f65982aSmrgfi])
19288f65982aSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
19298f65982aSmrg]) # XORG_WITH_ASCIIDOC
19308f65982aSmrg
19318f65982aSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
19320c7e83b2Smrg# -------------------------------------------
19338f65982aSmrg# Minimum version: 1.5.0
19348f65982aSmrg# Minimum version for optional DEFAULT argument: 1.11.0
19350c7e83b2Smrg# Minimum version for optional DOT checking: 1.18.0
19368f65982aSmrg#
19378f65982aSmrg# Documentation tools are not always available on all platforms and sometimes
19388f65982aSmrg# not at the appropriate level. This macro enables a module to test for the
19398f65982aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
19408f65982aSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
19418f65982aSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
19428f65982aSmrg# --with-doxygen assumes 'auto'.
19438f65982aSmrg#
19448f65982aSmrg# Interface to module:
19458f65982aSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
19468f65982aSmrg# DOXYGEN:	 returns the path of the doxygen program found
19478f65982aSmrg#		 returns the path set by the user in the environment
19488f65982aSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
19498f65982aSmrg#		  'no' user instructs the module not to use doxygen
19508f65982aSmrg#
19518f65982aSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
19528f65982aSmrg#
19538f65982aSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
19548f65982aSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
19550c7e83b2SmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility])
19568f65982aSmrgm4_define([_defopt], m4_default([$2], [auto]))
19578f65982aSmrgAC_ARG_WITH(doxygen,
19588f65982aSmrg	AS_HELP_STRING([--with-doxygen],
19598f65982aSmrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
19608f65982aSmrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
19618f65982aSmrgm4_undefine([_defopt])
19628f65982aSmrg
19638f65982aSmrgif test "x$use_doxygen" = x"auto"; then
19648f65982aSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
19658f65982aSmrg   if test "x$DOXYGEN" = "x"; then
19668f65982aSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
19678f65982aSmrg	have_doxygen=no
19688f65982aSmrg   else
19698f65982aSmrg        have_doxygen=yes
19708f65982aSmrg   fi
19718f65982aSmrgelif test "x$use_doxygen" = x"yes" ; then
19728f65982aSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
19738f65982aSmrg   if test "x$DOXYGEN" = "x"; then
19748f65982aSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
19758f65982aSmrg   fi
19768f65982aSmrg   have_doxygen=yes
19778f65982aSmrgelif test "x$use_doxygen" = x"no" ; then
19788f65982aSmrg   if test "x$DOXYGEN" != "x"; then
19798f65982aSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
19808f65982aSmrg   fi
19818f65982aSmrg   have_doxygen=no
19828f65982aSmrgelse
19838f65982aSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
19848f65982aSmrgfi
19858f65982aSmrgm4_ifval([$1],
19868f65982aSmrg[if test "$have_doxygen" = yes; then
19878f65982aSmrg    # scrape the doxygen version
19888f65982aSmrg    AC_MSG_CHECKING([the doxygen version])
19898f65982aSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
19908f65982aSmrg    AC_MSG_RESULT([$doxygen_version])
19918f65982aSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
19928f65982aSmrg        [if test "x$use_doxygen" = xauto; then
19938f65982aSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
19948f65982aSmrg            have_doxygen=no
19958f65982aSmrg        else
19968f65982aSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
19978f65982aSmrg        fi])
19988f65982aSmrgfi])
19990c7e83b2Smrg
20000c7e83b2Smrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory
20010c7e83b2Smrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
20020c7e83b2Smrgdnl 	HAVE_DOT = @HAVE_DOT@
20030c7e83b2SmrgHAVE_DOT=no
20040c7e83b2Smrgif test "x$have_doxygen" = "xyes"; then
20050c7e83b2Smrg  AC_PATH_PROG([DOT], [dot])
20060c7e83b2Smrg    if test "x$DOT" != "x"; then
20070c7e83b2Smrg      HAVE_DOT=yes
20080c7e83b2Smrg    fi
20090c7e83b2Smrgfi
20100c7e83b2Smrg
20110c7e83b2SmrgAC_SUBST([HAVE_DOT])
20120c7e83b2SmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
20138f65982aSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
20148f65982aSmrg]) # XORG_WITH_DOXYGEN
20158f65982aSmrg
20168f65982aSmrg# XORG_WITH_GROFF([DEFAULT])
20178f65982aSmrg# ----------------
20188f65982aSmrg# Minimum version: 1.6.0
20198f65982aSmrg# Minimum version for optional DEFAULT argument: 1.11.0
20208f65982aSmrg#
20218f65982aSmrg# Documentation tools are not always available on all platforms and sometimes
20228f65982aSmrg# not at the appropriate level. This macro enables a module to test for the
20238f65982aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
20248f65982aSmrg# the --with-groff option, it allows maximum flexibilty in making decisions
20258f65982aSmrg# as whether or not to use the groff package. When DEFAULT is not specified,
20268f65982aSmrg# --with-groff assumes 'auto'.
20278f65982aSmrg#
20288f65982aSmrg# Interface to module:
20298f65982aSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
20308f65982aSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
20318f65982aSmrg# HAVE_GROFF_MS: the -ms macros package
20328f65982aSmrg# GROFF:	 returns the path of the groff program found
20338f65982aSmrg#		 returns the path set by the user in the environment
20348f65982aSmrg# --with-groff:	 'yes' user instructs the module to use groff
20358f65982aSmrg#		 'no' user instructs the module not to use groff
20368f65982aSmrg#
20378f65982aSmrg# Added in version 1.9.0:
20388f65982aSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
20398f65982aSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
20408f65982aSmrg#		   psselect from the psutils package.
20418f65982aSmrg#		   the ghostcript package. Refer to the grohtml man pages
20428f65982aSmrg#
20438f65982aSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
20448f65982aSmrg#
20458f65982aSmrg# OS and distros often splits groff in a basic and full package, the former
20468f65982aSmrg# having the groff program and the later having devices, fonts and macros
20478f65982aSmrg# Checking for the groff executable is not enough.
20488f65982aSmrg#
20498f65982aSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
20508f65982aSmrg# unset HAVE_GROFF or GROFF env variables.
20518f65982aSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
20528f65982aSmrg#
20538f65982aSmrgAC_DEFUN([XORG_WITH_GROFF],[
20548f65982aSmrgAC_ARG_VAR([GROFF], [Path to groff command])
20558f65982aSmrgm4_define([_defopt], m4_default([$1], [auto]))
20568f65982aSmrgAC_ARG_WITH(groff,
20578f65982aSmrg	AS_HELP_STRING([--with-groff],
20588f65982aSmrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
20598f65982aSmrg	   [use_groff=$withval], [use_groff=]_defopt)
20608f65982aSmrgm4_undefine([_defopt])
20618f65982aSmrg
20628f65982aSmrgif test "x$use_groff" = x"auto"; then
20638f65982aSmrg   AC_PATH_PROG([GROFF], [groff])
20648f65982aSmrg   if test "x$GROFF" = "x"; then
20658f65982aSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
20668f65982aSmrg	have_groff=no
20678f65982aSmrg   else
20688f65982aSmrg        have_groff=yes
20698f65982aSmrg   fi
20708f65982aSmrgelif test "x$use_groff" = x"yes" ; then
20718f65982aSmrg   AC_PATH_PROG([GROFF], [groff])
20728f65982aSmrg   if test "x$GROFF" = "x"; then
20738f65982aSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
20748f65982aSmrg   fi
20758f65982aSmrg   have_groff=yes
20768f65982aSmrgelif test "x$use_groff" = x"no" ; then
20778f65982aSmrg   if test "x$GROFF" != "x"; then
20788f65982aSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
20798f65982aSmrg   fi
20808f65982aSmrg   have_groff=no
20818f65982aSmrgelse
20828f65982aSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
20838f65982aSmrgfi
20848f65982aSmrg
20858f65982aSmrg# We have groff, test for the presence of the macro packages
20868f65982aSmrgif test "x$have_groff" = x"yes"; then
20878f65982aSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
20888f65982aSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
20898f65982aSmrg        groff_ms_works=yes
20908f65982aSmrg    else
20918f65982aSmrg        groff_ms_works=no
20928f65982aSmrg    fi
20938f65982aSmrg    AC_MSG_RESULT([$groff_ms_works])
20948f65982aSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
20958f65982aSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
20968f65982aSmrg        groff_mm_works=yes
20978f65982aSmrg    else
20988f65982aSmrg        groff_mm_works=no
20998f65982aSmrg    fi
21008f65982aSmrg    AC_MSG_RESULT([$groff_mm_works])
21018f65982aSmrgfi
21028f65982aSmrg
21038f65982aSmrg# We have groff, test for HTML dependencies, one command per package
21048f65982aSmrgif test "x$have_groff" = x"yes"; then
21058f65982aSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
21068f65982aSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
21078f65982aSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
21088f65982aSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
21098f65982aSmrg      have_groff_html=yes
21108f65982aSmrg   else
21118f65982aSmrg      have_groff_html=no
21128f65982aSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
21138f65982aSmrg   fi
21148f65982aSmrgfi
21158f65982aSmrg
21168f65982aSmrg# Set Automake conditionals for Makefiles
21178f65982aSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
21188f65982aSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
21198f65982aSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
21208f65982aSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
21218f65982aSmrg]) # XORG_WITH_GROFF
21228f65982aSmrg
212380b026c6Smrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
212480b026c6Smrg# ---------------------------------------
21258f65982aSmrg# Minimum version: 1.6.0
21268f65982aSmrg# Minimum version for optional DEFAULT argument: 1.11.0
212780b026c6Smrg# Minimum version for optional MIN-VERSION argument: 1.15.0
21288f65982aSmrg#
21298f65982aSmrg# Documentation tools are not always available on all platforms and sometimes
21308f65982aSmrg# not at the appropriate level. This macro enables a module to test for the
21318f65982aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
21328f65982aSmrg# the --with-fop option, it allows maximum flexibilty in making decisions
21338f65982aSmrg# as whether or not to use the fop package. When DEFAULT is not specified,
21348f65982aSmrg# --with-fop assumes 'auto'.
21358f65982aSmrg#
21368f65982aSmrg# Interface to module:
21378f65982aSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
21388f65982aSmrg# FOP:	 	returns the path of the fop program found
21398f65982aSmrg#		returns the path set by the user in the environment
21408f65982aSmrg# --with-fop: 	'yes' user instructs the module to use fop
21418f65982aSmrg#		'no' user instructs the module not to use fop
21428f65982aSmrg#
21438f65982aSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
21448f65982aSmrg#
21458f65982aSmrgAC_DEFUN([XORG_WITH_FOP],[
21468f65982aSmrgAC_ARG_VAR([FOP], [Path to fop command])
214780b026c6Smrgm4_define([_defopt], m4_default([$2], [auto]))
21488f65982aSmrgAC_ARG_WITH(fop,
21498f65982aSmrg	AS_HELP_STRING([--with-fop],
21508f65982aSmrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
21518f65982aSmrg	   [use_fop=$withval], [use_fop=]_defopt)
21528f65982aSmrgm4_undefine([_defopt])
21538f65982aSmrg
21548f65982aSmrgif test "x$use_fop" = x"auto"; then
21558f65982aSmrg   AC_PATH_PROG([FOP], [fop])
21568f65982aSmrg   if test "x$FOP" = "x"; then
21578f65982aSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
21588f65982aSmrg	have_fop=no
21598f65982aSmrg   else
21608f65982aSmrg        have_fop=yes
21618f65982aSmrg   fi
21628f65982aSmrgelif test "x$use_fop" = x"yes" ; then
21638f65982aSmrg   AC_PATH_PROG([FOP], [fop])
21648f65982aSmrg   if test "x$FOP" = "x"; then
21658f65982aSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
21668f65982aSmrg   fi
21678f65982aSmrg   have_fop=yes
21688f65982aSmrgelif test "x$use_fop" = x"no" ; then
21698f65982aSmrg   if test "x$FOP" != "x"; then
21708f65982aSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
21718f65982aSmrg   fi
21728f65982aSmrg   have_fop=no
21738f65982aSmrgelse
21748f65982aSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
21758f65982aSmrgfi
217680b026c6Smrg
217780b026c6Smrg# Test for a minimum version of fop, if provided.
217880b026c6Smrgm4_ifval([$1],
217980b026c6Smrg[if test "$have_fop" = yes; then
218080b026c6Smrg    # scrape the fop version
218180b026c6Smrg    AC_MSG_CHECKING([for fop minimum version])
218280b026c6Smrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
218380b026c6Smrg    AC_MSG_RESULT([$fop_version])
218480b026c6Smrg    AS_VERSION_COMPARE([$fop_version], [$1],
218580b026c6Smrg        [if test "x$use_fop" = xauto; then
218680b026c6Smrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
218780b026c6Smrg            have_fop=no
218880b026c6Smrg        else
218980b026c6Smrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
219080b026c6Smrg        fi])
219180b026c6Smrgfi])
21928f65982aSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
21938f65982aSmrg]) # XORG_WITH_FOP
21948f65982aSmrg
21950c7e83b2Smrg# XORG_WITH_M4([MIN-VERSION])
21960c7e83b2Smrg# ---------------------------
21970c7e83b2Smrg# Minimum version: 1.19.0
21980c7e83b2Smrg#
21990c7e83b2Smrg# This macro attempts to locate an m4 macro processor which supports
22000c7e83b2Smrg# -I option and is only useful for modules relying on M4 in order to
22010c7e83b2Smrg# expand macros in source code files.
22020c7e83b2Smrg#
22030c7e83b2Smrg# Interface to module:
22040c7e83b2Smrg# M4:	 	returns the path of the m4 program found
22050c7e83b2Smrg#		returns the path set by the user in the environment
22060c7e83b2Smrg#
22070c7e83b2SmrgAC_DEFUN([XORG_WITH_M4], [
22080c7e83b2SmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
22090c7e83b2Smrg   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
22100c7e83b2Smrg       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
22110c7e83b2Smrg         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
22120c7e83b2Smrg   [AC_MSG_ERROR([could not find m4 that supports -I option])],
22130c7e83b2Smrg   [$PATH:/usr/gnu/bin])])
22140c7e83b2Smrg
22150c7e83b2SmrgAC_SUBST([M4], [$ac_cv_path_M4])
22160c7e83b2Smrg]) # XORG_WITH_M4
22170c7e83b2Smrg
22188f65982aSmrg# XORG_WITH_PS2PDF([DEFAULT])
22198f65982aSmrg# ----------------
22208f65982aSmrg# Minimum version: 1.6.0
22218f65982aSmrg# Minimum version for optional DEFAULT argument: 1.11.0
22228f65982aSmrg#
22238f65982aSmrg# Documentation tools are not always available on all platforms and sometimes
22248f65982aSmrg# not at the appropriate level. This macro enables a module to test for the
22258f65982aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
22268f65982aSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
22278f65982aSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
22288f65982aSmrg# --with-ps2pdf assumes 'auto'.
22298f65982aSmrg#
22308f65982aSmrg# Interface to module:
22318f65982aSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
22328f65982aSmrg# PS2PDF:	returns the path of the ps2pdf program found
22338f65982aSmrg#		returns the path set by the user in the environment
22348f65982aSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
22358f65982aSmrg#		 'no' user instructs the module not to use ps2pdf
22368f65982aSmrg#
22378f65982aSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
22388f65982aSmrg#
22398f65982aSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
22408f65982aSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
22418f65982aSmrgm4_define([_defopt], m4_default([$1], [auto]))
22428f65982aSmrgAC_ARG_WITH(ps2pdf,
22438f65982aSmrg	AS_HELP_STRING([--with-ps2pdf],
22448f65982aSmrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
22458f65982aSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
22468f65982aSmrgm4_undefine([_defopt])
22478f65982aSmrg
22488f65982aSmrgif test "x$use_ps2pdf" = x"auto"; then
22498f65982aSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
22508f65982aSmrg   if test "x$PS2PDF" = "x"; then
22518f65982aSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
22528f65982aSmrg	have_ps2pdf=no
22538f65982aSmrg   else
22548f65982aSmrg        have_ps2pdf=yes
22558f65982aSmrg   fi
22568f65982aSmrgelif test "x$use_ps2pdf" = x"yes" ; then
22578f65982aSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
22588f65982aSmrg   if test "x$PS2PDF" = "x"; then
22598f65982aSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
22608f65982aSmrg   fi
22618f65982aSmrg   have_ps2pdf=yes
22628f65982aSmrgelif test "x$use_ps2pdf" = x"no" ; then
22638f65982aSmrg   if test "x$PS2PDF" != "x"; then
22648f65982aSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
22658f65982aSmrg   fi
22668f65982aSmrg   have_ps2pdf=no
22678f65982aSmrgelse
22688f65982aSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
22698f65982aSmrgfi
22708f65982aSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
22718f65982aSmrg]) # XORG_WITH_PS2PDF
22728f65982aSmrg
22738f65982aSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
22748f65982aSmrg# ----------------
22758f65982aSmrg# Minimum version: 1.6.0
22768f65982aSmrg#
22778f65982aSmrg# Documentation tools are not always available on all platforms and sometimes
22788f65982aSmrg# not at the appropriate level. This macro enables a builder to skip all
22798f65982aSmrg# documentation targets except traditional man pages.
22808f65982aSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
22818f65982aSmrg# maximum flexibilty in controlling documentation building.
22828f65982aSmrg# Refer to:
22838f65982aSmrg# XORG_WITH_XMLTO         --with-xmlto
22848f65982aSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
22858f65982aSmrg# XORG_WITH_DOXYGEN       --with-doxygen
22868f65982aSmrg# XORG_WITH_FOP           --with-fop
22878f65982aSmrg# XORG_WITH_GROFF         --with-groff
22888f65982aSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
22898f65982aSmrg#
22908f65982aSmrg# Interface to module:
22918f65982aSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
22928f65982aSmrg# --enable-docs: 'yes' user instructs the module to generate docs
22938f65982aSmrg#		 'no' user instructs the module not to generate docs
22948f65982aSmrg# parm1:	specify the default value, yes or no.
22958f65982aSmrg#
22968f65982aSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
229780b026c6Smrgm4_define([docs_default], m4_default([$1], [yes]))
22988f65982aSmrgAC_ARG_ENABLE(docs,
22998f65982aSmrg	AS_HELP_STRING([--enable-docs],
230080b026c6Smrg	   [Enable building the documentation (default: ]docs_default[)]),
230180b026c6Smrg	   [build_docs=$enableval], [build_docs=]docs_default)
230280b026c6Smrgm4_undefine([docs_default])
23038f65982aSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
23048f65982aSmrgAC_MSG_CHECKING([whether to build documentation])
23058f65982aSmrgAC_MSG_RESULT([$build_docs])
23068f65982aSmrg]) # XORG_ENABLE_DOCS
23078f65982aSmrg
23088f65982aSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
23098f65982aSmrg# ----------------
23108f65982aSmrg# Minimum version: 1.6.0
23118f65982aSmrg#
23128f65982aSmrg# This macro enables a builder to skip all developer documentation.
23138f65982aSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
23148f65982aSmrg# maximum flexibilty in controlling documentation building.
23158f65982aSmrg# Refer to:
23168f65982aSmrg# XORG_WITH_XMLTO         --with-xmlto
23178f65982aSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
23188f65982aSmrg# XORG_WITH_DOXYGEN       --with-doxygen
23198f65982aSmrg# XORG_WITH_FOP           --with-fop
23208f65982aSmrg# XORG_WITH_GROFF         --with-groff
23218f65982aSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
23228f65982aSmrg#
23238f65982aSmrg# Interface to module:
23248f65982aSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
23258f65982aSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
23268f65982aSmrg#			'no' user instructs the module not to generate developer docs
23278f65982aSmrg# parm1:		specify the default value, yes or no.
23288f65982aSmrg#
23298f65982aSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
23308f65982aSmrgm4_define([devel_default], m4_default([$1], [yes]))
23318f65982aSmrgAC_ARG_ENABLE(devel-docs,
23328f65982aSmrg	AS_HELP_STRING([--enable-devel-docs],
23338f65982aSmrg	   [Enable building the developer documentation (default: ]devel_default[)]),
23348f65982aSmrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
23358f65982aSmrgm4_undefine([devel_default])
23368f65982aSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
23378f65982aSmrgAC_MSG_CHECKING([whether to build developer documentation])
23388f65982aSmrgAC_MSG_RESULT([$build_devel_docs])
23398f65982aSmrg]) # XORG_ENABLE_DEVEL_DOCS
23408f65982aSmrg
23418f65982aSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
23428f65982aSmrg# ----------------
23438f65982aSmrg# Minimum version: 1.6.0
23448f65982aSmrg#
23458f65982aSmrg# This macro enables a builder to skip all functional specification targets.
23468f65982aSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
23478f65982aSmrg# maximum flexibilty in controlling documentation building.
23488f65982aSmrg# Refer to:
23498f65982aSmrg# XORG_WITH_XMLTO         --with-xmlto
23508f65982aSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
23518f65982aSmrg# XORG_WITH_DOXYGEN       --with-doxygen
23528f65982aSmrg# XORG_WITH_FOP           --with-fop
23538f65982aSmrg# XORG_WITH_GROFF         --with-groff
23548f65982aSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
23558f65982aSmrg#
23568f65982aSmrg# Interface to module:
23578f65982aSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
23588f65982aSmrg# --enable-specs:	'yes' user instructs the module to generate specs
23598f65982aSmrg#			'no' user instructs the module not to generate specs
23608f65982aSmrg# parm1:		specify the default value, yes or no.
23618f65982aSmrg#
23628f65982aSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
23638f65982aSmrgm4_define([spec_default], m4_default([$1], [yes]))
23648f65982aSmrgAC_ARG_ENABLE(specs,
23658f65982aSmrg	AS_HELP_STRING([--enable-specs],
23668f65982aSmrg	   [Enable building the specs (default: ]spec_default[)]),
23678f65982aSmrg	   [build_specs=$enableval], [build_specs=]spec_default)
23688f65982aSmrgm4_undefine([spec_default])
23698f65982aSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
23708f65982aSmrgAC_MSG_CHECKING([whether to build functional specifications])
23718f65982aSmrgAC_MSG_RESULT([$build_specs])
23728f65982aSmrg]) # XORG_ENABLE_SPECS
23738f65982aSmrg
237480b026c6Smrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
237580b026c6Smrg# ----------------------------------------------
237680b026c6Smrg# Minimum version: 1.13.0
237780b026c6Smrg#
237880b026c6Smrg# This macro enables a builder to enable/disable unit testing
237980b026c6Smrg# It makes no assumption about the test cases implementation
238080b026c6Smrg# Test cases may or may not use Automake "Support for test suites"
238180b026c6Smrg# They may or may not use the software utility library GLib
238280b026c6Smrg#
238380b026c6Smrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
238480b026c6Smrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
238580b026c6Smrg# The variable enable_unit_tests is used by other macros in this file.
238680b026c6Smrg#
238780b026c6Smrg# Interface to module:
238880b026c6Smrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
238980b026c6Smrg# enable_unit_tests:    used in configure.ac for additional configuration
239080b026c6Smrg# --enable-unit-tests:	'yes' user instructs the module to build tests
239180b026c6Smrg#			'no' user instructs the module not to build tests
239280b026c6Smrg# parm1:		specify the default value, yes or no.
239380b026c6Smrg#
239480b026c6SmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
239580b026c6SmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
239680b026c6SmrgAC_BEFORE([$0], [XORG_LD_WRAP])
239780b026c6SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
239880b026c6Smrgm4_define([_defopt], m4_default([$1], [auto]))
239980b026c6SmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
240080b026c6Smrg	[Enable building unit test cases (default: ]_defopt[)]),
240180b026c6Smrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
240280b026c6Smrgm4_undefine([_defopt])
240380b026c6SmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
240480b026c6SmrgAC_MSG_CHECKING([whether to build unit test cases])
240580b026c6SmrgAC_MSG_RESULT([$enable_unit_tests])
240680b026c6Smrg]) # XORG_ENABLE_UNIT_TESTS
240780b026c6Smrg
240880b026c6Smrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
240980b026c6Smrg# ------------------------------------------------------
241080b026c6Smrg# Minimum version: 1.17.0
241180b026c6Smrg#
241280b026c6Smrg# This macro enables a builder to enable/disable integration testing
241380b026c6Smrg# It makes no assumption about the test cases' implementation
241480b026c6Smrg# Test cases may or may not use Automake "Support for test suites"
241580b026c6Smrg#
241680b026c6Smrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
241780b026c6Smrg# usually requires less dependencies and may be built and run under less
241880b026c6Smrg# stringent environments than integration tests.
241980b026c6Smrg#
242080b026c6Smrg# Interface to module:
242180b026c6Smrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
242280b026c6Smrg# enable_integration_tests:   used in configure.ac for additional configuration
242380b026c6Smrg# --enable-integration-tests: 'yes' user instructs the module to build tests
242480b026c6Smrg#                             'no' user instructs the module not to build tests
242580b026c6Smrg# parm1:                      specify the default value, yes or no.
242680b026c6Smrg#
242780b026c6SmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
242880b026c6SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
242980b026c6Smrgm4_define([_defopt], m4_default([$1], [auto]))
243080b026c6SmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
243180b026c6Smrg	[Enable building integration test cases (default: ]_defopt[)]),
243280b026c6Smrg	[enable_integration_tests=$enableval],
243380b026c6Smrg	[enable_integration_tests=]_defopt)
243480b026c6Smrgm4_undefine([_defopt])
243580b026c6SmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
243680b026c6Smrg	[test "x$enable_integration_tests" != xno])
243780b026c6SmrgAC_MSG_CHECKING([whether to build unit test cases])
243880b026c6SmrgAC_MSG_RESULT([$enable_integration_tests])
243980b026c6Smrg]) # XORG_ENABLE_INTEGRATION_TESTS
244080b026c6Smrg
244180b026c6Smrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
244280b026c6Smrg# ----------------------------------------
244380b026c6Smrg# Minimum version: 1.13.0
244480b026c6Smrg#
244580b026c6Smrg# GLib is a library which provides advanced data structures and functions.
244680b026c6Smrg# This macro enables a module to test for the presence of Glib.
244780b026c6Smrg#
244880b026c6Smrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
244980b026c6Smrg# Otherwise the value of $enable_unit_tests is blank.
245080b026c6Smrg#
245180b026c6Smrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
245280b026c6Smrg# test support usually requires less dependencies and may be built and run under
245380b026c6Smrg# less stringent environments than integration tests.
245480b026c6Smrg#
245580b026c6Smrg# Interface to module:
245680b026c6Smrg# HAVE_GLIB: used in makefiles to conditionally build targets
245780b026c6Smrg# with_glib: used in configure.ac to know if GLib has been found
245880b026c6Smrg# --with-glib:	'yes' user instructs the module to use glib
245980b026c6Smrg#		'no' user instructs the module not to use glib
246080b026c6Smrg#
246180b026c6SmrgAC_DEFUN([XORG_WITH_GLIB],[
246280b026c6SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
246380b026c6Smrgm4_define([_defopt], m4_default([$2], [auto]))
246480b026c6SmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
246580b026c6Smrg	[Use GLib library for unit testing (default: ]_defopt[)]),
246680b026c6Smrg	[with_glib=$withval], [with_glib=]_defopt)
246780b026c6Smrgm4_undefine([_defopt])
246880b026c6Smrg
246980b026c6Smrghave_glib=no
247080b026c6Smrg# Do not probe GLib if user explicitly disabled unit testing
247180b026c6Smrgif test "x$enable_unit_tests" != x"no"; then
247280b026c6Smrg  # Do not probe GLib if user explicitly disabled it
247380b026c6Smrg  if test "x$with_glib" != x"no"; then
247480b026c6Smrg    m4_ifval(
247580b026c6Smrg      [$1],
247680b026c6Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
247780b026c6Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
247880b026c6Smrg    )
247980b026c6Smrg  fi
248080b026c6Smrgfi
248180b026c6Smrg
248280b026c6Smrg# Not having GLib when unit testing has been explicitly requested is an error
248380b026c6Smrgif test "x$enable_unit_tests" = x"yes"; then
248480b026c6Smrg  if test "x$have_glib" = x"no"; then
248580b026c6Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
248680b026c6Smrg  fi
248780b026c6Smrgfi
248880b026c6Smrg
248980b026c6Smrg# Having unit testing disabled when GLib has been explicitly requested is an error
249080b026c6Smrgif test "x$enable_unit_tests" = x"no"; then
249180b026c6Smrg  if test "x$with_glib" = x"yes"; then
249280b026c6Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
249380b026c6Smrg  fi
249480b026c6Smrgfi
249580b026c6Smrg
249680b026c6Smrg# Not having GLib when it has been explicitly requested is an error
249780b026c6Smrgif test "x$with_glib" = x"yes"; then
249880b026c6Smrg  if test "x$have_glib" = x"no"; then
249980b026c6Smrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
250080b026c6Smrg  fi
250180b026c6Smrgfi
250280b026c6Smrg
250380b026c6SmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
250480b026c6Smrg]) # XORG_WITH_GLIB
250580b026c6Smrg
250680b026c6Smrg# XORG_LD_WRAP([required|optional])
250780b026c6Smrg# ---------------------------------
250880b026c6Smrg# Minimum version: 1.13.0
250980b026c6Smrg#
251080b026c6Smrg# Check if linker supports -wrap, passed via compiler flags
251180b026c6Smrg#
251280b026c6Smrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
251380b026c6Smrg# Otherwise the value of $enable_unit_tests is blank.
251480b026c6Smrg#
251580b026c6Smrg# Argument added in 1.16.0 - default is "required", to match existing behavior
251680b026c6Smrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
251780b026c6Smrg# available, an argument of "optional" allows use when some unit tests require
251880b026c6Smrg# ld -wrap and others do not.
251980b026c6Smrg#
252080b026c6SmrgAC_DEFUN([XORG_LD_WRAP],[
252180b026c6SmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
252280b026c6Smrg    [AC_LANG_PROGRAM([#include <stdlib.h>
252380b026c6Smrg                      void __wrap_exit(int status) { return; }],
252480b026c6Smrg                     [exit(0);])])
252580b026c6Smrg# Not having ld wrap when unit testing has been explicitly requested is an error
252680b026c6Smrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
252780b026c6Smrg  if test "x$have_ld_wrap" = x"no"; then
252880b026c6Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
252980b026c6Smrg  fi
253080b026c6Smrgfi
253180b026c6SmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
253280b026c6Smrg#
253380b026c6Smrg]) # XORG_LD_WRAP
253480b026c6Smrg
253580b026c6Smrg# XORG_CHECK_LINKER_FLAGS
253680b026c6Smrg# -----------------------
253780b026c6Smrg# SYNOPSIS
253880b026c6Smrg#
253980b026c6Smrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
254080b026c6Smrg#
254180b026c6Smrg# DESCRIPTION
254280b026c6Smrg#
254380b026c6Smrg#   Check whether the given linker FLAGS work with the current language's
254480b026c6Smrg#   linker, or whether they give an error.
254580b026c6Smrg#
254680b026c6Smrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
254780b026c6Smrg#   success/failure.
254880b026c6Smrg#
254980b026c6Smrg#   PROGRAM-SOURCE is the program source to link with, if needed
255080b026c6Smrg#
255180b026c6Smrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
255280b026c6Smrg#
255380b026c6Smrg# LICENSE
255480b026c6Smrg#
255580b026c6Smrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
255680b026c6Smrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
255780b026c6Smrg#   Copyright (c) 2009 Matteo Frigo
255880b026c6Smrg#
255980b026c6Smrg#   This program is free software: you can redistribute it and/or modify it
256080b026c6Smrg#   under the terms of the GNU General Public License as published by the
256180b026c6Smrg#   Free Software Foundation, either version 3 of the License, or (at your
256280b026c6Smrg#   option) any later version.
256380b026c6Smrg#
256480b026c6Smrg#   This program is distributed in the hope that it will be useful, but
256580b026c6Smrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
256680b026c6Smrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
256780b026c6Smrg#   Public License for more details.
256880b026c6Smrg#
256980b026c6Smrg#   You should have received a copy of the GNU General Public License along
257080b026c6Smrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
257180b026c6Smrg#
257280b026c6Smrg#   As a special exception, the respective Autoconf Macro's copyright owner
257380b026c6Smrg#   gives unlimited permission to copy, distribute and modify the configure
257480b026c6Smrg#   scripts that are the output of Autoconf when processing the Macro. You
257580b026c6Smrg#   need not follow the terms of the GNU General Public License when using
257680b026c6Smrg#   or distributing such scripts, even though portions of the text of the
257780b026c6Smrg#   Macro appear in them. The GNU General Public License (GPL) does govern
257880b026c6Smrg#   all other use of the material that constitutes the Autoconf Macro.
257980b026c6Smrg#
258080b026c6Smrg#   This special exception to the GPL applies to versions of the Autoconf
258180b026c6Smrg#   Macro released by the Autoconf Archive. When you make and distribute a
258280b026c6Smrg#   modified version of the Autoconf Macro, you may extend this special
258380b026c6Smrg#   exception to the GPL to apply to your modified version as well.#
258480b026c6SmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
258580b026c6Smrg[AC_MSG_CHECKING([whether the linker accepts $1])
258680b026c6Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
258780b026c6SmrgAS_LITERAL_IF([$1],
258880b026c6Smrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
258980b026c6Smrg      ax_save_FLAGS=$LDFLAGS
259080b026c6Smrg      LDFLAGS="$1"
259180b026c6Smrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
259280b026c6Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
259380b026c6Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
259480b026c6Smrg      LDFLAGS=$ax_save_FLAGS])],
259580b026c6Smrg  [ax_save_FLAGS=$LDFLAGS
259680b026c6Smrg   LDFLAGS="$1"
259780b026c6Smrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
259880b026c6Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
259980b026c6Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
260080b026c6Smrg   LDFLAGS=$ax_save_FLAGS])
260180b026c6Smrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
260280b026c6SmrgAC_MSG_RESULT($xorg_check_linker_flags)
260380b026c6Smrgif test "x$xorg_check_linker_flags" = xyes; then
260480b026c6Smrg	m4_default([$2], :)
260580b026c6Smrgelse
260680b026c6Smrg	m4_default([$3], :)
260780b026c6Smrgfi
260880b026c6Smrg]) # XORG_CHECK_LINKER_FLAGS
260980b026c6Smrg
261080b026c6Smrg# XORG_MEMORY_CHECK_FLAGS
261180b026c6Smrg# -----------------------
261280b026c6Smrg# Minimum version: 1.16.0
261380b026c6Smrg#
261480b026c6Smrg# This macro attempts to find appropriate memory checking functionality
261580b026c6Smrg# for various platforms which unit testing code may use to catch various
261680b026c6Smrg# forms of memory allocation and access errors in testing.
261780b026c6Smrg#
261880b026c6Smrg# Interface to module:
261980b026c6Smrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
262080b026c6Smrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
262180b026c6Smrg#
262280b026c6Smrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
262380b026c6Smrg#
262480b026c6SmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
262580b026c6Smrg
262680b026c6SmrgAC_REQUIRE([AC_CANONICAL_HOST])
262780b026c6SmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
262880b026c6Smrg           [Environment variables to enable memory checking in tests])
262980b026c6Smrg
263080b026c6Smrg# Check for different types of support on different platforms
263180b026c6Smrgcase $host_os in
263280b026c6Smrg    solaris*)
263380b026c6Smrg        AC_CHECK_LIB([umem], [umem_alloc],
263480b026c6Smrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
263580b026c6Smrg        ;;
263680b026c6Smrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
263780b026c6Smrg        # both directly and inverted, so should not be 0 or 255.
263880b026c6Smrg        malloc_debug_env='MALLOC_PERTURB_=15'
263980b026c6Smrg        ;;
264080b026c6Smrg    darwin*)
264180b026c6Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
264280b026c6Smrg        ;;
264380b026c6Smrg    *bsd*)
264480b026c6Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
264580b026c6Smrg        ;;
264680b026c6Smrgesac
264780b026c6Smrg
264880b026c6Smrg# User supplied flags override default flags
264980b026c6Smrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
265080b026c6Smrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
265180b026c6Smrgfi
265280b026c6Smrg
265380b026c6SmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
265480b026c6Smrg]) # XORG_WITH_LINT
265580b026c6Smrg
26569aa228fdSmrg# XORG_CHECK_MALLOC_ZERO
26579aa228fdSmrg# ----------------------
26589aa228fdSmrg# Minimum version: 1.0.0
26599aa228fdSmrg#
26609aa228fdSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
26619aa228fdSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
26629aa228fdSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
26639aa228fdSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
26649aa228fdSmrgAC_ARG_ENABLE(malloc0returnsnull,
26658f65982aSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
26669aa228fdSmrg		       [malloc(0) returns NULL (default: auto)]),
26679aa228fdSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
26689aa228fdSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
26699aa228fdSmrg
26709aa228fdSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
26719aa228fdSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
26720c7e83b2SmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null],
26730c7e83b2Smrg	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
267480b026c6Smrg#include <stdlib.h>
267580b026c6Smrg],[
26769aa228fdSmrg    char *m0, *r0, *c0, *p;
26779aa228fdSmrg    m0 = malloc(0);
26789aa228fdSmrg    p = malloc(10);
26799aa228fdSmrg    r0 = realloc(p,0);
268080b026c6Smrg    c0 = calloc(0,10);
268180b026c6Smrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
268280b026c6Smrg])],
26830c7e83b2Smrg		[xorg_cv_malloc0_returns_null=yes],
26840c7e83b2Smrg		[xorg_cv_malloc0_returns_null=no])])
26850c7e83b2SmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
26869aa228fdSmrgfi
26879aa228fdSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
26889aa228fdSmrg
26899aa228fdSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
26909aa228fdSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
26919aa228fdSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
26929aa228fdSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
26939aa228fdSmrgelse
26949aa228fdSmrg	MALLOC_ZERO_CFLAGS=""
26959aa228fdSmrg	XMALLOC_ZERO_CFLAGS=""
26969aa228fdSmrg	XTMALLOC_ZERO_CFLAGS=""
26979aa228fdSmrgfi
26989aa228fdSmrg
26999aa228fdSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
27009aa228fdSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
27019aa228fdSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
27029aa228fdSmrg]) # XORG_CHECK_MALLOC_ZERO
27039aa228fdSmrg
27049aa228fdSmrg# XORG_WITH_LINT()
27059aa228fdSmrg# ----------------
27069aa228fdSmrg# Minimum version: 1.1.0
27079aa228fdSmrg#
27088f65982aSmrg# This macro enables the use of a tool that flags some suspicious and
27098f65982aSmrg# non-portable constructs (likely to be bugs) in C language source code.
27108f65982aSmrg# It will attempt to locate the tool and use appropriate options.
27118f65982aSmrg# There are various lint type tools on different platforms.
27128f65982aSmrg#
27138f65982aSmrg# Interface to module:
27148f65982aSmrg# LINT:		returns the path to the tool found on the platform
27158f65982aSmrg#		or the value set to LINT on the configure cmd line
27168f65982aSmrg#		also an Automake conditional
27178f65982aSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
27188f65982aSmrg#
27198f65982aSmrg# --with-lint:	'yes' user instructs the module to use lint
27208f65982aSmrg#		'no' user instructs the module not to use lint (default)
27218f65982aSmrg#
27228f65982aSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
27238f65982aSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
27249aa228fdSmrg#
27259aa228fdSmrgAC_DEFUN([XORG_WITH_LINT],[
27269aa228fdSmrg
27278f65982aSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
27288f65982aSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
27298f65982aSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
27309aa228fdSmrg		[Use a lint-style source code checker (default: disabled)])],
27319aa228fdSmrg		[use_lint=$withval], [use_lint=no])
27328f65982aSmrg
27338f65982aSmrg# Obtain platform specific info like program name and options
27348f65982aSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
27358f65982aSmrgcase $host_os in
27368f65982aSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
27378f65982aSmrg	lint_name=splint
27388f65982aSmrg	lint_options="-badflag"
27398f65982aSmrg	;;
27408f65982aSmrg  *freebsd* | *netbsd*)
27418f65982aSmrg	lint_name=lint
27428f65982aSmrg	lint_options="-u -b"
27438f65982aSmrg	;;
27448f65982aSmrg  *solaris*)
27458f65982aSmrg	lint_name=lint
27468f65982aSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
27478f65982aSmrg	;;
27488f65982aSmrgesac
27498f65982aSmrg
27508f65982aSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
27518f65982aSmrgif test "x$use_lint" = x"yes" ; then
27528f65982aSmrg   AC_PATH_PROG([LINT], [$lint_name])
27538f65982aSmrg   if test "x$LINT" = "x"; then
27548f65982aSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
27558f65982aSmrg   fi
27568f65982aSmrgelif test "x$use_lint" = x"no" ; then
27578f65982aSmrg   if test "x$LINT" != "x"; then
27588f65982aSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
27598f65982aSmrg   fi
27609aa228fdSmrgelse
27618f65982aSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
27629aa228fdSmrgfi
27638f65982aSmrg
27648f65982aSmrg# User supplied flags override default flags
27658f65982aSmrgif test "x$LINT_FLAGS" != "x"; then
27668f65982aSmrg   lint_options=$LINT_FLAGS
27679aa228fdSmrgfi
27689aa228fdSmrg
27698f65982aSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
27708f65982aSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
27719aa228fdSmrg
27729aa228fdSmrg]) # XORG_WITH_LINT
27739aa228fdSmrg
27749aa228fdSmrg# XORG_LINT_LIBRARY(LIBNAME)
27759aa228fdSmrg# --------------------------
27769aa228fdSmrg# Minimum version: 1.1.0
27779aa228fdSmrg#
27789aa228fdSmrg# Sets up flags for building lint libraries for checking programs that call
27799aa228fdSmrg# functions in the library.
27809aa228fdSmrg#
27818f65982aSmrg# Interface to module:
27828f65982aSmrg# LINTLIB		- Automake variable with the name of lint library file to make
27838f65982aSmrg# MAKE_LINT_LIB		- Automake conditional
27848f65982aSmrg#
27858f65982aSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
27868f65982aSmrg#			  - 'no' user instructs the module not to create a lint library (default)
27879aa228fdSmrg
27889aa228fdSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
27899aa228fdSmrgAC_REQUIRE([XORG_WITH_LINT])
27908f65982aSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
27919aa228fdSmrg	[Create lint library (default: disabled)])],
27929aa228fdSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
27938f65982aSmrg
27948f65982aSmrgif test "x$make_lint_lib" = x"yes" ; then
27958f65982aSmrg   LINTLIB=llib-l$1.ln
27968f65982aSmrg   if test "x$LINT" = "x"; then
27978f65982aSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
27988f65982aSmrg   fi
27998f65982aSmrgelif test "x$make_lint_lib" != x"no" ; then
28008f65982aSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
28019aa228fdSmrgfi
28028f65982aSmrg
28039aa228fdSmrgAC_SUBST(LINTLIB)
28049aa228fdSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
28059aa228fdSmrg
28069aa228fdSmrg]) # XORG_LINT_LIBRARY
28079aa228fdSmrg
280880b026c6Smrg# XORG_COMPILER_BRAND
280980b026c6Smrg# -------------------
281080b026c6Smrg# Minimum version: 1.14.0
281180b026c6Smrg#
281280b026c6Smrg# Checks for various brands of compilers and sets flags as appropriate:
281380b026c6Smrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
281480b026c6Smrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
281580b026c6Smrg#   clang compiler - sets CLANGCC to "yes"
281680b026c6Smrg#   Intel compiler - sets INTELCC to "yes"
281780b026c6Smrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
281880b026c6Smrg#
281980b026c6SmrgAC_DEFUN([XORG_COMPILER_BRAND], [
282080b026c6SmrgAC_LANG_CASE(
282180b026c6Smrg	[C], [
282280b026c6Smrg		AC_REQUIRE([AC_PROG_CC_C99])
282380b026c6Smrg	],
282480b026c6Smrg	[C++], [
282580b026c6Smrg		AC_REQUIRE([AC_PROG_CXX])
282680b026c6Smrg	]
282780b026c6Smrg)
282880b026c6SmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
282980b026c6SmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
283080b026c6SmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
283180b026c6Smrg]) # XORG_COMPILER_BRAND
283280b026c6Smrg
283380b026c6Smrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
283480b026c6Smrg# ---------------
283580b026c6Smrg# Minimum version: 1.16.0
283680b026c6Smrg#
283780b026c6Smrg# Test if the compiler works when passed the given flag as a command line argument.
283880b026c6Smrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
283980b026c6Smrg# next flag in the list until there are no more options.
284080b026c6Smrg#
284180b026c6Smrg# Note that this does not guarantee that the compiler supports the flag as some
284280b026c6Smrg# compilers will simply ignore arguments that they do not understand, but we do
284380b026c6Smrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
284480b026c6Smrg# -Werror=unused-command-line-argument
284580b026c6Smrg#
284680b026c6SmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
284780b026c6Smrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
284880b026c6Smrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
284980b026c6Smrg
285080b026c6SmrgAC_LANG_COMPILER_REQUIRE
285180b026c6Smrg
285280b026c6SmrgAC_LANG_CASE(
285380b026c6Smrg	[C], [
285480b026c6Smrg		AC_REQUIRE([AC_PROG_CC_C99])
285580b026c6Smrg		define([PREFIX], [C])
285680b026c6Smrg		define([CACHE_PREFIX], [cc])
285780b026c6Smrg		define([COMPILER], [$CC])
285880b026c6Smrg	],
285980b026c6Smrg	[C++], [
286080b026c6Smrg		define([PREFIX], [CXX])
286180b026c6Smrg		define([CACHE_PREFIX], [cxx])
286280b026c6Smrg		define([COMPILER], [$CXX])
286380b026c6Smrg	]
286480b026c6Smrg)
286580b026c6Smrg
286680b026c6Smrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
286780b026c6Smrg
286880b026c6Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
286980b026c6Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
287080b026c6Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
287180b026c6Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
287280b026c6Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
287380b026c6Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
287480b026c6Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
287580b026c6Smrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
287680b026c6Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
287780b026c6Smrgfi
287880b026c6Smrg
287980b026c6Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
288080b026c6Smrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
288180b026c6Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
288280b026c6Smrg	fi
288380b026c6Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
288480b026c6Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
288580b026c6Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
288680b026c6Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
288780b026c6Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
288880b026c6Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
288980b026c6Smrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
289080b026c6Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
289180b026c6Smrgfi
289280b026c6Smrg
289380b026c6Smrgfound="no"
289480b026c6Smrgm4_foreach([flag], m4_cdr($@), [
289580b026c6Smrg	if test $found = "no" ; then
28960c7e83b2Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
289780b026c6Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
289880b026c6Smrg		fi
289980b026c6Smrg
29000c7e83b2Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
290180b026c6Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
290280b026c6Smrg		fi
290380b026c6Smrg
290480b026c6Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
290580b026c6Smrg
290680b026c6Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
290780b026c6Smrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
290880b026c6Smrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
290980b026c6Smrg		AC_CACHE_VAL($cacheid,
291080b026c6Smrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
291180b026c6Smrg					     [eval $cacheid=yes],
291280b026c6Smrg					     [eval $cacheid=no])])
291380b026c6Smrg
291480b026c6Smrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
291580b026c6Smrg
291680b026c6Smrg		eval supported=\$$cacheid
291780b026c6Smrg		AC_MSG_RESULT([$supported])
291880b026c6Smrg		if test "$supported" = "yes" ; then
291980b026c6Smrg			$1="$$1 ]flag["
292080b026c6Smrg			found="yes"
292180b026c6Smrg		fi
292280b026c6Smrg	fi
292380b026c6Smrg])
292480b026c6Smrg]) # XORG_TESTSET_CFLAG
292580b026c6Smrg
292680b026c6Smrg# XORG_COMPILER_FLAGS
292780b026c6Smrg# ---------------
292880b026c6Smrg# Minimum version: 1.16.0
292980b026c6Smrg#
293080b026c6Smrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
293180b026c6Smrg# arguments supported by the selected compiler which do NOT alter the generated
293280b026c6Smrg# code.  These arguments will cause the compiler to print various warnings
293380b026c6Smrg# during compilation AND turn a conservative set of warnings into errors.
293480b026c6Smrg#
293580b026c6Smrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
293680b026c6Smrg# future versions of util-macros as options are added to new compilers.
293780b026c6Smrg#
293880b026c6SmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
293980b026c6SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
294080b026c6Smrg
294180b026c6SmrgAC_ARG_ENABLE(selective-werror,
294280b026c6Smrg              AS_HELP_STRING([--disable-selective-werror],
294380b026c6Smrg                             [Turn off selective compiler errors. (default: enabled)]),
294480b026c6Smrg              [SELECTIVE_WERROR=$enableval],
294580b026c6Smrg              [SELECTIVE_WERROR=yes])
294680b026c6Smrg
294780b026c6SmrgAC_LANG_CASE(
294880b026c6Smrg        [C], [
294980b026c6Smrg                define([PREFIX], [C])
295080b026c6Smrg        ],
295180b026c6Smrg        [C++], [
295280b026c6Smrg                define([PREFIX], [CXX])
295380b026c6Smrg        ]
295480b026c6Smrg)
295580b026c6Smrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
295680b026c6Smrgif test "x$SUNCC" = "xyes"; then
295780b026c6Smrg    [BASE_]PREFIX[FLAGS]="-v"
295880b026c6Smrgelse
295980b026c6Smrg    [BASE_]PREFIX[FLAGS]=""
296080b026c6Smrgfi
296180b026c6Smrg
296280b026c6Smrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
296380b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
296480b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
296580b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
296680b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
296780b026c6Smrg
296880b026c6SmrgAC_LANG_CASE(
296980b026c6Smrg	[C], [
297080b026c6Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
297180b026c6Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
297280b026c6Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
297380b026c6Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
29740c7e83b2Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
297580b026c6Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
297680b026c6Smrg	]
297780b026c6Smrg)
297880b026c6Smrg
297980b026c6Smrg# This chunk adds additional warnings that could catch undesired effects.
298080b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
298180b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
298280b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
298380b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
298480b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
298580b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
29860c7e83b2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
298780b026c6Smrg
298880b026c6Smrg# These are currently disabled because they are noisy.  They will be enabled
298980b026c6Smrg# in the future once the codebase is sufficiently modernized to silence
299080b026c6Smrg# them.  For now, I don't want them to drown out the other warnings.
299180b026c6Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
299280b026c6Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
29930c7e83b2Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
299480b026c6Smrg
299580b026c6Smrg# Turn some warnings into errors, so we don't accidently get successful builds
299680b026c6Smrg# when there are problems that should be fixed.
299780b026c6Smrg
299880b026c6Smrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
299980b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
300080b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
300180b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
300280b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
300380b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
300480b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
300580b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
300680b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
300780b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
300880b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
300980b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
301080b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
301180b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
301280b026c6Smrgelse
301380b026c6SmrgAC_MSG_WARN([You have chosen not to turn some select compiler warnings into errors.  This should not be necessary.  Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT])
301480b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
301580b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
301680b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
301780b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
301880b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
301980b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
302080b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
302180b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
302280b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
302380b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
302480b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
302580b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
302680b026c6SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
302780b026c6Smrgfi
302880b026c6Smrg
302980b026c6SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
303080b026c6Smrg]) # XORG_COMPILER_FLAGS
303180b026c6Smrg
303283d7c197Smrg# XORG_CWARNFLAGS
303383d7c197Smrg# ---------------
303483d7c197Smrg# Minimum version: 1.2.0
303580b026c6Smrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
303683d7c197Smrg#
303783d7c197Smrg# Defines CWARNFLAGS to enable C compiler warnings.
303883d7c197Smrg#
303980b026c6Smrg# This function is deprecated because it defines -fno-strict-aliasing
304080b026c6Smrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
304180b026c6Smrg# is needed, then it should be added explicitly in the module when
304280b026c6Smrg# it is updated to use BASE_CFLAGS.
304380b026c6Smrg#
304483d7c197SmrgAC_DEFUN([XORG_CWARNFLAGS], [
304580b026c6SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
304680b026c6SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
304780b026c6SmrgAC_LANG_CASE(
304880b026c6Smrg	[C], [
304980b026c6Smrg		CWARNFLAGS="$BASE_CFLAGS"
305080b026c6Smrg		if  test "x$GCC" = xyes ; then
305180b026c6Smrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
305280b026c6Smrg		fi
305380b026c6Smrg		AC_SUBST(CWARNFLAGS)
305480b026c6Smrg	]
305580b026c6Smrg)
305683d7c197Smrg]) # XORG_CWARNFLAGS
30578f65982aSmrg
30588f65982aSmrg# XORG_STRICT_OPTION
30598f65982aSmrg# -----------------------
30608f65982aSmrg# Minimum version: 1.3.0
30618f65982aSmrg#
306280b026c6Smrg# Add configure option to enable strict compilation flags, such as treating
306380b026c6Smrg# warnings as fatal errors.
306480b026c6Smrg# If --enable-strict-compilation is passed to configure, adds strict flags to
306580b026c6Smrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
306680b026c6Smrg#
306780b026c6Smrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
306880b026c6Smrg# when strict compilation is unconditionally desired.
30698f65982aSmrgAC_DEFUN([XORG_STRICT_OPTION], [
30708f65982aSmrgAC_REQUIRE([XORG_CWARNFLAGS])
307180b026c6SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
30728f65982aSmrg
30738f65982aSmrgAC_ARG_ENABLE(strict-compilation,
30748f65982aSmrg			  AS_HELP_STRING([--enable-strict-compilation],
30758f65982aSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
30768f65982aSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
307780b026c6Smrg
307880b026c6SmrgAC_LANG_CASE(
307980b026c6Smrg        [C], [
308080b026c6Smrg                define([PREFIX], [C])
308180b026c6Smrg        ],
308280b026c6Smrg        [C++], [
308380b026c6Smrg                define([PREFIX], [CXX])
308480b026c6Smrg        ]
308580b026c6Smrg)
308680b026c6Smrg
308780b026c6Smrg[STRICT_]PREFIX[FLAGS]=""
308880b026c6SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
308980b026c6SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
309080b026c6Smrg
309180b026c6Smrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
309280b026c6Smrg# activate it with -Werror, so we add it here explicitly.
309380b026c6SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
309480b026c6Smrg
30958f65982aSmrgif test "x$STRICT_COMPILE" = "xyes"; then
309680b026c6Smrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
309780b026c6Smrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
30988f65982aSmrgfi
309980b026c6SmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
310080b026c6SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
310180b026c6SmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
31028f65982aSmrg]) # XORG_STRICT_OPTION
31038f65982aSmrg
31048f65982aSmrg# XORG_DEFAULT_OPTIONS
31058f65982aSmrg# --------------------
31068f65982aSmrg# Minimum version: 1.3.0
31078f65982aSmrg#
31088f65982aSmrg# Defines default options for X.Org modules.
31098f65982aSmrg#
31108f65982aSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
31118f65982aSmrgAC_REQUIRE([AC_PROG_INSTALL])
311280b026c6SmrgXORG_COMPILER_FLAGS
31138f65982aSmrgXORG_CWARNFLAGS
31148f65982aSmrgXORG_STRICT_OPTION
31158f65982aSmrgXORG_RELEASE_VERSION
31168f65982aSmrgXORG_CHANGELOG
31178f65982aSmrgXORG_INSTALL
31188f65982aSmrgXORG_MANPAGE_SECTIONS
31198f65982aSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
31208f65982aSmrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
31218f65982aSmrg]) # XORG_DEFAULT_OPTIONS
31228f65982aSmrg
31238f65982aSmrg# XORG_INSTALL()
31248f65982aSmrg# ----------------
31258f65982aSmrg# Minimum version: 1.4.0
31268f65982aSmrg#
31278f65982aSmrg# Defines the variable INSTALL_CMD as the command to copy
31288f65982aSmrg# INSTALL from $prefix/share/util-macros.
31298f65982aSmrg#
31308f65982aSmrgAC_DEFUN([XORG_INSTALL], [
31318f65982aSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
31328f65982aSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
31338f65982aSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
31348f65982aSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
31358f65982aSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
31368f65982aSmrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
31378f65982aSmrgAC_SUBST([INSTALL_CMD])
31388f65982aSmrg]) # XORG_INSTALL
31399aa228fdSmrgdnl Copyright 2005 Red Hat, Inc
31409aa228fdSmrgdnl
31419aa228fdSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
31429aa228fdSmrgdnl documentation for any purpose is hereby granted without fee, provided that
31439aa228fdSmrgdnl the above copyright notice appear in all copies and that both that
31449aa228fdSmrgdnl copyright notice and this permission notice appear in supporting
31459aa228fdSmrgdnl documentation.
31469aa228fdSmrgdnl
31479aa228fdSmrgdnl The above copyright notice and this permission notice shall be included
31489aa228fdSmrgdnl in all copies or substantial portions of the Software.
31499aa228fdSmrgdnl
31509aa228fdSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
31519aa228fdSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
31529aa228fdSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
31539aa228fdSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
31549aa228fdSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
31559aa228fdSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
31569aa228fdSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
31579aa228fdSmrgdnl
31589aa228fdSmrgdnl Except as contained in this notice, the name of the copyright holders shall
31599aa228fdSmrgdnl not be used in advertising or otherwise to promote the sale, use or
31609aa228fdSmrgdnl other dealings in this Software without prior written authorization
31619aa228fdSmrgdnl from the copyright holders.
31629aa228fdSmrgdnl
31639aa228fdSmrg
31649aa228fdSmrg# XORG_RELEASE_VERSION
31659aa228fdSmrg# --------------------
31668f65982aSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
31670c7e83b2Smrg
31689aa228fdSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
31699aa228fdSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
31709aa228fdSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
31719aa228fdSmrg		[Major version of this package])
317283d7c197Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
31739aa228fdSmrg	if test "x$PVM" = "x"; then
31749aa228fdSmrg		PVM="0"
31759aa228fdSmrg	fi
31769aa228fdSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
31779aa228fdSmrg		[$PVM],
31789aa228fdSmrg		[Minor version of this package])
317983d7c197Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
31809aa228fdSmrg	if test "x$PVP" = "x"; then
31819aa228fdSmrg		PVP="0"
31829aa228fdSmrg	fi
31839aa228fdSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
31849aa228fdSmrg		[$PVP],
31859aa228fdSmrg		[Patch version of this package])
31869aa228fdSmrg])
31879aa228fdSmrg
318883d7c197Smrg# XORG_CHANGELOG()
318983d7c197Smrg# ----------------
319083d7c197Smrg# Minimum version: 1.2.0
319183d7c197Smrg#
319283d7c197Smrg# Defines the variable CHANGELOG_CMD as the command to generate
319383d7c197Smrg# ChangeLog from git.
319483d7c197Smrg#
319583d7c197Smrg#
319683d7c197SmrgAC_DEFUN([XORG_CHANGELOG], [
31978f65982aSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
31988f65982aSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
31998f65982aSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
320083d7c197Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
320183d7c197SmrgAC_SUBST([CHANGELOG_CMD])
320283d7c197Smrg]) # XORG_CHANGELOG
320383d7c197Smrg
3204