aclocal.m4 revision 96d43ffd
196d43ffdSmrg# generated automatically by aclocal 1.16.5 -*- Autoconf -*-
2f765521fSmrg
396d43ffdSmrg# Copyright (C) 1996-2021 Free Software Foundation, Inc.
45dfecf96Smrg
55dfecf96Smrg# This file is free software; the Free Software Foundation
65dfecf96Smrg# gives unlimited permission to copy and/or distribute it,
75dfecf96Smrg# with or without modifications, as long as this notice is preserved.
85dfecf96Smrg
95dfecf96Smrg# This program is distributed in the hope that it will be useful,
105dfecf96Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
115dfecf96Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
125dfecf96Smrg# PARTICULAR PURPOSE.
135dfecf96Smrg
14f765521fSmrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15f14f4646Smrgm4_ifndef([AC_AUTOCONF_VERSION],
16f14f4646Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1796d43ffdSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],,
1896d43ffdSmrg[m4_warning([this file was generated for autoconf 2.71.
19f14f4646SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
20f14f4646SmrgIf you have problems, you may need to regenerate the build system entirely.
21f765521fSmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
22f14f4646Smrg
2396d43ffdSmrg# Copyright (C) 2002-2021 Free Software Foundation, Inc.
245dfecf96Smrg#
2596d43ffdSmrg# This file is free software; the Free Software Foundation
2696d43ffdSmrg# gives unlimited permission to copy and/or distribute it,
2796d43ffdSmrg# with or without modifications, as long as this notice is preserved.
2831de2854Smrg
2996d43ffdSmrg# AM_AUTOMAKE_VERSION(VERSION)
3096d43ffdSmrg# ----------------------------
3196d43ffdSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
3296d43ffdSmrg# generated from the m4 files accompanying Automake X.Y.
3396d43ffdSmrg# (This private macro should not be called outside this file.)
3496d43ffdSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
3596d43ffdSmrg[am__api_version='1.16'
3696d43ffdSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
3796d43ffdSmrgdnl require some minimum version.  Point them to the right macro.
3896d43ffdSmrgm4_if([$1], [1.16.5], [],
3996d43ffdSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
4096d43ffdSmrg])
415dfecf96Smrg
4296d43ffdSmrg# _AM_AUTOCONF_VERSION(VERSION)
4396d43ffdSmrg# -----------------------------
4496d43ffdSmrg# aclocal traces this macro to find the Autoconf version.
4596d43ffdSmrg# This is a private macro too.  Using m4_define simplifies
4696d43ffdSmrg# the logic in aclocal, which can simply ignore this definition.
4796d43ffdSmrgm4_define([_AM_AUTOCONF_VERSION], [])
485dfecf96Smrg
4996d43ffdSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
5096d43ffdSmrg# -------------------------------
5196d43ffdSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
5296d43ffdSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
5396d43ffdSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
5496d43ffdSmrg[AM_AUTOMAKE_VERSION([1.16.5])dnl
5596d43ffdSmrgm4_ifndef([AC_AUTOCONF_VERSION],
5696d43ffdSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
5796d43ffdSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
5896d43ffdSmrg
5996d43ffdSmrg# Copyright (C) 2011-2021 Free Software Foundation, Inc.
60f765521fSmrg#
6196d43ffdSmrg# This file is free software; the Free Software Foundation
6296d43ffdSmrg# gives unlimited permission to copy and/or distribute it,
6396d43ffdSmrg# with or without modifications, as long as this notice is preserved.
645dfecf96Smrg
6596d43ffdSmrg# AM_PROG_AR([ACT-IF-FAIL])
6696d43ffdSmrg# -------------------------
6796d43ffdSmrg# Try to determine the archiver interface, and trigger the ar-lib wrapper
6896d43ffdSmrg# if it is needed.  If the detection of archiver interface fails, run
6996d43ffdSmrg# ACT-IF-FAIL (default is to abort configure with a proper error message).
7096d43ffdSmrgAC_DEFUN([AM_PROG_AR],
7196d43ffdSmrg[AC_BEFORE([$0], [LT_INIT])dnl
7296d43ffdSmrgAC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl
7396d43ffdSmrgAC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
7496d43ffdSmrgAC_REQUIRE_AUX_FILE([ar-lib])dnl
7596d43ffdSmrgAC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false])
7696d43ffdSmrg: ${AR=ar}
775dfecf96Smrg
7896d43ffdSmrgAC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface],
7996d43ffdSmrg  [AC_LANG_PUSH([C])
8096d43ffdSmrg   am_cv_ar_interface=ar
8196d43ffdSmrg   AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])],
8296d43ffdSmrg     [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
8396d43ffdSmrg      AC_TRY_EVAL([am_ar_try])
8496d43ffdSmrg      if test "$ac_status" -eq 0; then
8596d43ffdSmrg        am_cv_ar_interface=ar
8696d43ffdSmrg      else
8796d43ffdSmrg        am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
8896d43ffdSmrg        AC_TRY_EVAL([am_ar_try])
8996d43ffdSmrg        if test "$ac_status" -eq 0; then
9096d43ffdSmrg          am_cv_ar_interface=lib
9196d43ffdSmrg        else
9296d43ffdSmrg          am_cv_ar_interface=unknown
9396d43ffdSmrg        fi
9496d43ffdSmrg      fi
9596d43ffdSmrg      rm -f conftest.lib libconftest.a
9696d43ffdSmrg     ])
9796d43ffdSmrg   AC_LANG_POP([C])])
9896d43ffdSmrg
9996d43ffdSmrgcase $am_cv_ar_interface in
10096d43ffdSmrgar)
10196d43ffdSmrg  ;;
10296d43ffdSmrglib)
10396d43ffdSmrg  # Microsoft lib, so override with the ar-lib wrapper script.
10496d43ffdSmrg  # FIXME: It is wrong to rewrite AR.
10596d43ffdSmrg  # But if we don't then we get into trouble of one sort or another.
10696d43ffdSmrg  # A longer-term fix would be to have automake use am__AR in this case,
10796d43ffdSmrg  # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something
10896d43ffdSmrg  # similar.
10996d43ffdSmrg  AR="$am_aux_dir/ar-lib $AR"
11096d43ffdSmrg  ;;
11196d43ffdSmrgunknown)
11296d43ffdSmrg  m4_default([$1],
11396d43ffdSmrg             [AC_MSG_ERROR([could not determine $AR interface])])
11496d43ffdSmrg  ;;
11596d43ffdSmrgesac
11696d43ffdSmrgAC_SUBST([AR])dnl
11796d43ffdSmrg])
1185dfecf96Smrg
11996d43ffdSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
12031de2854Smrg
12196d43ffdSmrg# Copyright (C) 2001-2021 Free Software Foundation, Inc.
1225dfecf96Smrg#
12396d43ffdSmrg# This file is free software; the Free Software Foundation
12496d43ffdSmrg# gives unlimited permission to copy and/or distribute it,
12596d43ffdSmrg# with or without modifications, as long as this notice is preserved.
12696d43ffdSmrg
12796d43ffdSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
12896d43ffdSmrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
12996d43ffdSmrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
1305dfecf96Smrg#
13196d43ffdSmrg# Of course, Automake must honor this variable whenever it calls a
13296d43ffdSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
13396d43ffdSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
13496d43ffdSmrg# depending on how configure is run.  This is pretty annoying, since
13596d43ffdSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
13696d43ffdSmrg# source directory, any form will work fine, but in subdirectories a
13796d43ffdSmrg# relative path needs to be adjusted first.
1385dfecf96Smrg#
13996d43ffdSmrg# $ac_aux_dir/missing
14096d43ffdSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
14196d43ffdSmrg# $top_srcdir/$ac_aux_dir/missing
14296d43ffdSmrg#    fails if $ac_aux_dir is absolute,
14396d43ffdSmrg#    fails when called from a subdirectory in a VPATH build with
14496d43ffdSmrg#          a relative $ac_aux_dir
145c05e22d7Smrg#
14696d43ffdSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
14796d43ffdSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
14896d43ffdSmrg# harmless because $srcdir is '.', but things will broke when you
14996d43ffdSmrg# start a VPATH build or use an absolute $srcdir.
15096d43ffdSmrg#
15196d43ffdSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
15296d43ffdSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
15396d43ffdSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
15496d43ffdSmrg# and then we would define $MISSING as
15596d43ffdSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
15696d43ffdSmrg# This will work as long as MISSING is not called from configure, because
15796d43ffdSmrg# unfortunately $(top_srcdir) has no meaning in configure.
15896d43ffdSmrg# However there are other variables, like CC, which are often used in
15996d43ffdSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
16096d43ffdSmrg#
16196d43ffdSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
16296d43ffdSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
16396d43ffdSmrg# configured tree to be moved without reconfiguration.
1645dfecf96Smrg
16596d43ffdSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
16696d43ffdSmrg[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
16796d43ffdSmrg# Expand $ac_aux_dir to an absolute path.
16896d43ffdSmrgam_aux_dir=`cd "$ac_aux_dir" && pwd`
16996d43ffdSmrg])
1705dfecf96Smrg
17196d43ffdSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
1725dfecf96Smrg
17396d43ffdSmrg# Copyright (C) 1997-2021 Free Software Foundation, Inc.
17496d43ffdSmrg#
17596d43ffdSmrg# This file is free software; the Free Software Foundation
17696d43ffdSmrg# gives unlimited permission to copy and/or distribute it,
17796d43ffdSmrg# with or without modifications, as long as this notice is preserved.
1785dfecf96Smrg
17996d43ffdSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
18096d43ffdSmrg# -------------------------------------
18196d43ffdSmrg# Define a conditional.
18296d43ffdSmrgAC_DEFUN([AM_CONDITIONAL],
18396d43ffdSmrg[AC_PREREQ([2.52])dnl
18496d43ffdSmrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
18596d43ffdSmrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
18696d43ffdSmrgAC_SUBST([$1_TRUE])dnl
18796d43ffdSmrgAC_SUBST([$1_FALSE])dnl
18896d43ffdSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
18996d43ffdSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
19096d43ffdSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
19196d43ffdSmrgif $2; then
19296d43ffdSmrg  $1_TRUE=
19396d43ffdSmrg  $1_FALSE='#'
19496d43ffdSmrgelse
19596d43ffdSmrg  $1_TRUE='#'
19696d43ffdSmrg  $1_FALSE=
19796d43ffdSmrgfi
19896d43ffdSmrgAC_CONFIG_COMMANDS_PRE(
19996d43ffdSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
20096d43ffdSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
20196d43ffdSmrgUsually this means the macro was only invoked conditionally.]])
20296d43ffdSmrgfi])])
2035dfecf96Smrg
20496d43ffdSmrg# Copyright (C) 1999-2021 Free Software Foundation, Inc.
20596d43ffdSmrg#
20696d43ffdSmrg# This file is free software; the Free Software Foundation
20796d43ffdSmrg# gives unlimited permission to copy and/or distribute it,
20896d43ffdSmrg# with or without modifications, as long as this notice is preserved.
2095dfecf96Smrg
2105dfecf96Smrg
21196d43ffdSmrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
21296d43ffdSmrg# written in clear, in which case automake, when reading aclocal.m4,
21396d43ffdSmrg# will think it sees a *use*, and therefore will trigger all it's
21496d43ffdSmrg# C support machinery.  Also note that it means that autoscan, seeing
21596d43ffdSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
2165dfecf96Smrg
2175dfecf96Smrg
21896d43ffdSmrg# _AM_DEPENDENCIES(NAME)
21996d43ffdSmrg# ----------------------
22096d43ffdSmrg# See how the compiler implements dependency checking.
22196d43ffdSmrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
22296d43ffdSmrg# We try a few techniques and use that to set a single cache variable.
22396d43ffdSmrg#
22496d43ffdSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
22596d43ffdSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
22696d43ffdSmrg# dependency, and given that the user is not expected to run this macro,
22796d43ffdSmrg# just rely on AC_PROG_CC.
22896d43ffdSmrgAC_DEFUN([_AM_DEPENDENCIES],
22996d43ffdSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
23096d43ffdSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
23196d43ffdSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
23296d43ffdSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
233f765521fSmrg
23496d43ffdSmrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
23596d43ffdSmrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
23696d43ffdSmrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
23796d43ffdSmrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
23896d43ffdSmrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
23996d43ffdSmrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
24096d43ffdSmrg                    [depcc="$$1"   am_compiler_list=])
241f765521fSmrg
24296d43ffdSmrgAC_CACHE_CHECK([dependency style of $depcc],
24396d43ffdSmrg               [am_cv_$1_dependencies_compiler_type],
24496d43ffdSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
24596d43ffdSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
24696d43ffdSmrg  # making bogus files that we don't know about and never remove.  For
24796d43ffdSmrg  # instance it was reported that on HP-UX the gcc test will end up
24896d43ffdSmrg  # making a dummy file named 'D' -- because '-MD' means "put the output
24996d43ffdSmrg  # in D".
25096d43ffdSmrg  rm -rf conftest.dir
25196d43ffdSmrg  mkdir conftest.dir
25296d43ffdSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
25396d43ffdSmrg  # using a relative directory.
25496d43ffdSmrg  cp "$am_depcomp" conftest.dir
25596d43ffdSmrg  cd conftest.dir
25696d43ffdSmrg  # We will build objects and dependencies in a subdirectory because
25796d43ffdSmrg  # it helps to detect inapplicable dependency modes.  For instance
25896d43ffdSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
25996d43ffdSmrg  # side effect of compilation, but ICC will put the dependencies in
26096d43ffdSmrg  # the current directory while Tru64 will put them in the object
26196d43ffdSmrg  # directory.
26296d43ffdSmrg  mkdir sub
263f765521fSmrg
26496d43ffdSmrg  am_cv_$1_dependencies_compiler_type=none
26596d43ffdSmrg  if test "$am_compiler_list" = ""; then
26696d43ffdSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
26796d43ffdSmrg  fi
26896d43ffdSmrg  am__universal=false
26996d43ffdSmrg  m4_case([$1], [CC],
27096d43ffdSmrg    [case " $depcc " in #(
27196d43ffdSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
27296d43ffdSmrg     esac],
27396d43ffdSmrg    [CXX],
27496d43ffdSmrg    [case " $depcc " in #(
27596d43ffdSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
27696d43ffdSmrg     esac])
277f765521fSmrg
27896d43ffdSmrg  for depmode in $am_compiler_list; do
27996d43ffdSmrg    # Setup a source with many dependencies, because some compilers
28096d43ffdSmrg    # like to wrap large dependency lists on column 80 (with \), and
28196d43ffdSmrg    # we should not choose a depcomp mode which is confused by this.
28296d43ffdSmrg    #
28396d43ffdSmrg    # We need to recreate these files for each test, as the compiler may
28496d43ffdSmrg    # overwrite some of them when testing with obscure command lines.
28596d43ffdSmrg    # This happens at least with the AIX C compiler.
28696d43ffdSmrg    : > sub/conftest.c
28796d43ffdSmrg    for i in 1 2 3 4 5 6; do
28896d43ffdSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
28996d43ffdSmrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
29096d43ffdSmrg      # Solaris 10 /bin/sh.
29196d43ffdSmrg      echo '/* dummy */' > sub/conftst$i.h
29296d43ffdSmrg    done
29396d43ffdSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2945dfecf96Smrg
29596d43ffdSmrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
29696d43ffdSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
29796d43ffdSmrg    # handle '-M -o', and we need to detect this.  Also, some Intel
29896d43ffdSmrg    # versions had trouble with output in subdirs.
29996d43ffdSmrg    am__obj=sub/conftest.${OBJEXT-o}
30096d43ffdSmrg    am__minus_obj="-o $am__obj"
30196d43ffdSmrg    case $depmode in
30296d43ffdSmrg    gcc)
30396d43ffdSmrg      # This depmode causes a compiler race in universal mode.
30496d43ffdSmrg      test "$am__universal" = false || continue
30596d43ffdSmrg      ;;
30696d43ffdSmrg    nosideeffect)
30796d43ffdSmrg      # After this tag, mechanisms are not by side-effect, so they'll
30896d43ffdSmrg      # only be used when explicitly requested.
30996d43ffdSmrg      if test "x$enable_dependency_tracking" = xyes; then
31096d43ffdSmrg	continue
31196d43ffdSmrg      else
31296d43ffdSmrg	break
31396d43ffdSmrg      fi
31496d43ffdSmrg      ;;
31596d43ffdSmrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
31696d43ffdSmrg      # This compiler won't grok '-c -o', but also, the minuso test has
31796d43ffdSmrg      # not run yet.  These depmodes are late enough in the game, and
31896d43ffdSmrg      # so weak that their functioning should not be impacted.
31996d43ffdSmrg      am__obj=conftest.${OBJEXT-o}
32096d43ffdSmrg      am__minus_obj=
32196d43ffdSmrg      ;;
32296d43ffdSmrg    none) break ;;
32396d43ffdSmrg    esac
32496d43ffdSmrg    if depmode=$depmode \
32596d43ffdSmrg       source=sub/conftest.c object=$am__obj \
32696d43ffdSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
32796d43ffdSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
32896d43ffdSmrg         >/dev/null 2>conftest.err &&
32996d43ffdSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
33096d43ffdSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
33196d43ffdSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
33296d43ffdSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
33396d43ffdSmrg      # icc doesn't choke on unknown options, it will just issue warnings
33496d43ffdSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
33596d43ffdSmrg      # that says an option was ignored or not supported.
33696d43ffdSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
33796d43ffdSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
33896d43ffdSmrg      # The diagnosis changed in icc 8.0:
33996d43ffdSmrg      #   icc: Command line remark: option '-MP' not supported
34096d43ffdSmrg      if (grep 'ignoring option' conftest.err ||
34196d43ffdSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
34296d43ffdSmrg        am_cv_$1_dependencies_compiler_type=$depmode
34396d43ffdSmrg        break
34496d43ffdSmrg      fi
34596d43ffdSmrg    fi
34696d43ffdSmrg  done
3475dfecf96Smrg
34896d43ffdSmrg  cd ..
34996d43ffdSmrg  rm -rf conftest.dir
35096d43ffdSmrgelse
35196d43ffdSmrg  am_cv_$1_dependencies_compiler_type=none
35296d43ffdSmrgfi
35396d43ffdSmrg])
35496d43ffdSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
35596d43ffdSmrgAM_CONDITIONAL([am__fastdep$1], [
35696d43ffdSmrg  test "x$enable_dependency_tracking" != xno \
35796d43ffdSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
35896d43ffdSmrg])
3595dfecf96Smrg
3605dfecf96Smrg
36196d43ffdSmrg# AM_SET_DEPDIR
36296d43ffdSmrg# -------------
36396d43ffdSmrg# Choose a directory name for dependency files.
36496d43ffdSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
36596d43ffdSmrgAC_DEFUN([AM_SET_DEPDIR],
36696d43ffdSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
36796d43ffdSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
36896d43ffdSmrg])
369f765521fSmrg
37096d43ffdSmrg
37196d43ffdSmrg# AM_DEP_TRACK
37296d43ffdSmrg# ------------
37396d43ffdSmrgAC_DEFUN([AM_DEP_TRACK],
37496d43ffdSmrg[AC_ARG_ENABLE([dependency-tracking], [dnl
37596d43ffdSmrgAS_HELP_STRING(
37696d43ffdSmrg  [--enable-dependency-tracking],
37796d43ffdSmrg  [do not reject slow dependency extractors])
37896d43ffdSmrgAS_HELP_STRING(
37996d43ffdSmrg  [--disable-dependency-tracking],
38096d43ffdSmrg  [speeds up one-time build])])
38196d43ffdSmrgif test "x$enable_dependency_tracking" != xno; then
38296d43ffdSmrg  am_depcomp="$ac_aux_dir/depcomp"
38396d43ffdSmrg  AMDEPBACKSLASH='\'
38496d43ffdSmrg  am__nodep='_no'
38596d43ffdSmrgfi
38696d43ffdSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
38796d43ffdSmrgAC_SUBST([AMDEPBACKSLASH])dnl
38896d43ffdSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
38996d43ffdSmrgAC_SUBST([am__nodep])dnl
39096d43ffdSmrg_AM_SUBST_NOTMAKE([am__nodep])dnl
39196d43ffdSmrg])
39296d43ffdSmrg
39396d43ffdSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
39496d43ffdSmrg
39596d43ffdSmrg# Copyright (C) 1999-2021 Free Software Foundation, Inc.
396f765521fSmrg#
39796d43ffdSmrg# This file is free software; the Free Software Foundation
39896d43ffdSmrg# gives unlimited permission to copy and/or distribute it,
39996d43ffdSmrg# with or without modifications, as long as this notice is preserved.
400f765521fSmrg
40196d43ffdSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
40296d43ffdSmrg# ------------------------------
40396d43ffdSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
40496d43ffdSmrg[{
40596d43ffdSmrg  # Older Autoconf quotes --file arguments for eval, but not when files
40696d43ffdSmrg  # are listed without --file.  Let's play safe and only enable the eval
40796d43ffdSmrg  # if we detect the quoting.
40896d43ffdSmrg  # TODO: see whether this extra hack can be removed once we start
40996d43ffdSmrg  # requiring Autoconf 2.70 or later.
41096d43ffdSmrg  AS_CASE([$CONFIG_FILES],
41196d43ffdSmrg          [*\'*], [eval set x "$CONFIG_FILES"],
41296d43ffdSmrg          [*], [set x $CONFIG_FILES])
41396d43ffdSmrg  shift
41496d43ffdSmrg  # Used to flag and report bootstrapping failures.
41596d43ffdSmrg  am_rc=0
41696d43ffdSmrg  for am_mf
41796d43ffdSmrg  do
41896d43ffdSmrg    # Strip MF so we end up with the name of the file.
41996d43ffdSmrg    am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
42096d43ffdSmrg    # Check whether this is an Automake generated Makefile which includes
42196d43ffdSmrg    # dependency-tracking related rules and includes.
42296d43ffdSmrg    # Grep'ing the whole file directly is not great: AIX grep has a line
42396d43ffdSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
42496d43ffdSmrg    sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
42596d43ffdSmrg      || continue
42696d43ffdSmrg    am_dirpart=`AS_DIRNAME(["$am_mf"])`
42796d43ffdSmrg    am_filepart=`AS_BASENAME(["$am_mf"])`
42896d43ffdSmrg    AM_RUN_LOG([cd "$am_dirpart" \
42996d43ffdSmrg      && sed -e '/# am--include-marker/d' "$am_filepart" \
43096d43ffdSmrg        | $MAKE -f - am--depfiles]) || am_rc=$?
43196d43ffdSmrg  done
43296d43ffdSmrg  if test $am_rc -ne 0; then
43396d43ffdSmrg    AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
43496d43ffdSmrg    for automatic dependency tracking.  If GNU make was not used, consider
43596d43ffdSmrg    re-running the configure script with MAKE="gmake" (or whatever is
43696d43ffdSmrg    necessary).  You can also try re-running configure with the
43796d43ffdSmrg    '--disable-dependency-tracking' option to at least be able to build
43896d43ffdSmrg    the package (albeit without support for automatic dependency tracking).])
43996d43ffdSmrg  fi
44096d43ffdSmrg  AS_UNSET([am_dirpart])
44196d43ffdSmrg  AS_UNSET([am_filepart])
44296d43ffdSmrg  AS_UNSET([am_mf])
44396d43ffdSmrg  AS_UNSET([am_rc])
44496d43ffdSmrg  rm -f conftest-deps.mk
44596d43ffdSmrg}
44696d43ffdSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
4475dfecf96Smrg
4485dfecf96Smrg
44996d43ffdSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
45096d43ffdSmrg# -----------------------------
45196d43ffdSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
452f765521fSmrg#
45396d43ffdSmrg# This code is only required when automatic dependency tracking is enabled.
45496d43ffdSmrg# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
45596d43ffdSmrg# order to bootstrap the dependency handling code.
45696d43ffdSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
45796d43ffdSmrg[AC_CONFIG_COMMANDS([depfiles],
45896d43ffdSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
45996d43ffdSmrg     [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
4605dfecf96Smrg
46196d43ffdSmrg# Do all the work for Automake.                             -*- Autoconf -*-
4625dfecf96Smrg
46396d43ffdSmrg# Copyright (C) 1996-2021 Free Software Foundation, Inc.
46496d43ffdSmrg#
46596d43ffdSmrg# This file is free software; the Free Software Foundation
46696d43ffdSmrg# gives unlimited permission to copy and/or distribute it,
46796d43ffdSmrg# with or without modifications, as long as this notice is preserved.
4685dfecf96Smrg
46996d43ffdSmrg# This macro actually does too much.  Some checks are only needed if
47096d43ffdSmrg# your package does certain things.  But this isn't really a big deal.
4715dfecf96Smrg
47296d43ffdSmrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
47396d43ffdSmrgm4_define([AC_PROG_CC],
47496d43ffdSmrgm4_defn([AC_PROG_CC])
47596d43ffdSmrg[_AM_PROG_CC_C_O
47696d43ffdSmrg])
4775dfecf96Smrg
47896d43ffdSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
47996d43ffdSmrg# AM_INIT_AUTOMAKE([OPTIONS])
48096d43ffdSmrg# -----------------------------------------------
48196d43ffdSmrg# The call with PACKAGE and VERSION arguments is the old style
48296d43ffdSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
48396d43ffdSmrg# and VERSION should now be passed to AC_INIT and removed from
48496d43ffdSmrg# the call to AM_INIT_AUTOMAKE.
48596d43ffdSmrg# We support both call styles for the transition.  After
48696d43ffdSmrg# the next Automake release, Autoconf can make the AC_INIT
48796d43ffdSmrg# arguments mandatory, and then we can depend on a new Autoconf
48896d43ffdSmrg# release and drop the old call support.
48996d43ffdSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
49096d43ffdSmrg[AC_PREREQ([2.65])dnl
49196d43ffdSmrgm4_ifdef([_$0_ALREADY_INIT],
49296d43ffdSmrg  [m4_fatal([$0 expanded multiple times
49396d43ffdSmrg]m4_defn([_$0_ALREADY_INIT]))],
49496d43ffdSmrg  [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl
49596d43ffdSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
49696d43ffdSmrgdnl the ones we care about.
49796d43ffdSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
49896d43ffdSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
49996d43ffdSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
50096d43ffdSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
50196d43ffdSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
50296d43ffdSmrg  # is not polluted with repeated "-I."
50396d43ffdSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
50496d43ffdSmrg  # test to see if srcdir already configured
50596d43ffdSmrg  if test -f $srcdir/config.status; then
50696d43ffdSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
50796d43ffdSmrg  fi
508f765521fSmrgfi
5095dfecf96Smrg
51096d43ffdSmrg# test whether we have cygpath
51196d43ffdSmrgif test -z "$CYGPATH_W"; then
51296d43ffdSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
51396d43ffdSmrg    CYGPATH_W='cygpath -w'
51496d43ffdSmrg  else
51596d43ffdSmrg    CYGPATH_W=echo
51696d43ffdSmrg  fi
517f765521fSmrgfi
51896d43ffdSmrgAC_SUBST([CYGPATH_W])
519c05e22d7Smrg
52096d43ffdSmrg# Define the identity of the package.
52196d43ffdSmrgdnl Distinguish between old-style and new-style calls.
52296d43ffdSmrgm4_ifval([$2],
52396d43ffdSmrg[AC_DIAGNOSE([obsolete],
52496d43ffdSmrg             [$0: two- and three-arguments forms are deprecated.])
52596d43ffdSmrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
52696d43ffdSmrg AC_SUBST([PACKAGE], [$1])dnl
52796d43ffdSmrg AC_SUBST([VERSION], [$2])],
52896d43ffdSmrg[_AM_SET_OPTIONS([$1])dnl
52996d43ffdSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
53096d43ffdSmrgm4_if(
53196d43ffdSmrg  m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]),
53296d43ffdSmrg  [ok:ok],,
53396d43ffdSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
53496d43ffdSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
53596d43ffdSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
53696d43ffdSmrg
53796d43ffdSmrg_AM_IF_OPTION([no-define],,
53896d43ffdSmrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
53996d43ffdSmrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
54096d43ffdSmrg
54196d43ffdSmrg# Some tools Automake needs.
54296d43ffdSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
54396d43ffdSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
54496d43ffdSmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
54596d43ffdSmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
54696d43ffdSmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
54796d43ffdSmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
54896d43ffdSmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
54996d43ffdSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
55096d43ffdSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
55196d43ffdSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
55296d43ffdSmrg# For better backward compatibility.  To be removed once Automake 1.9.x
55396d43ffdSmrg# dies out for good.  For more background, see:
55496d43ffdSmrg# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
55596d43ffdSmrg# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
55696d43ffdSmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
55796d43ffdSmrg# We need awk for the "check" target (and possibly the TAP driver).  The
55896d43ffdSmrg# system "awk" is bad on some platforms.
55996d43ffdSmrgAC_REQUIRE([AC_PROG_AWK])dnl
56096d43ffdSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
56196d43ffdSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
56296d43ffdSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
56396d43ffdSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
56496d43ffdSmrg			     [_AM_PROG_TAR([v7])])])
56596d43ffdSmrg_AM_IF_OPTION([no-dependencies],,
56696d43ffdSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
56796d43ffdSmrg		  [_AM_DEPENDENCIES([CC])],
56896d43ffdSmrg		  [m4_define([AC_PROG_CC],
56996d43ffdSmrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
57096d43ffdSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
57196d43ffdSmrg		  [_AM_DEPENDENCIES([CXX])],
57296d43ffdSmrg		  [m4_define([AC_PROG_CXX],
57396d43ffdSmrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
57496d43ffdSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
57596d43ffdSmrg		  [_AM_DEPENDENCIES([OBJC])],
57696d43ffdSmrg		  [m4_define([AC_PROG_OBJC],
57796d43ffdSmrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
57896d43ffdSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
57996d43ffdSmrg		  [_AM_DEPENDENCIES([OBJCXX])],
58096d43ffdSmrg		  [m4_define([AC_PROG_OBJCXX],
58196d43ffdSmrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
58296d43ffdSmrg])
58396d43ffdSmrg# Variables for tags utilities; see am/tags.am
58496d43ffdSmrgif test -z "$CTAGS"; then
58596d43ffdSmrg  CTAGS=ctags
586f765521fSmrgfi
58796d43ffdSmrgAC_SUBST([CTAGS])
58896d43ffdSmrgif test -z "$ETAGS"; then
58996d43ffdSmrg  ETAGS=etags
59096d43ffdSmrgfi
59196d43ffdSmrgAC_SUBST([ETAGS])
59296d43ffdSmrgif test -z "$CSCOPE"; then
59396d43ffdSmrg  CSCOPE=cscope
594f765521fSmrgfi
59596d43ffdSmrgAC_SUBST([CSCOPE])
596c05e22d7Smrg
59796d43ffdSmrgAC_REQUIRE([AM_SILENT_RULES])dnl
59896d43ffdSmrgdnl The testsuite driver may need to know about EXEEXT, so add the
59996d43ffdSmrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
60096d43ffdSmrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
60196d43ffdSmrgAC_CONFIG_COMMANDS_PRE(dnl
60296d43ffdSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
60396d43ffdSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
604f14f4646Smrg
60596d43ffdSmrg# POSIX will say in a future version that running "rm -f" with no argument
60696d43ffdSmrg# is OK; and we want to be able to make that assumption in our Makefile
60796d43ffdSmrg# recipes.  So use an aggressive probe to check that the usage we want is
60896d43ffdSmrg# actually supported "in the wild" to an acceptable degree.
60996d43ffdSmrg# See automake bug#10828.
61096d43ffdSmrg# To make any issue more visible, cause the running configure to be aborted
61196d43ffdSmrg# by default if the 'rm' program in use doesn't match our expectations; the
61296d43ffdSmrg# user can still override this though.
61396d43ffdSmrgif rm -f && rm -fr && rm -rf; then : OK; else
61496d43ffdSmrg  cat >&2 <<'END'
61596d43ffdSmrgOops!
61696d43ffdSmrg
61796d43ffdSmrgYour 'rm' program seems unable to run without file operands specified
61896d43ffdSmrgon the command line, even when the '-f' option is present.  This is contrary
61996d43ffdSmrgto the behaviour of most rm programs out there, and not conforming with
62096d43ffdSmrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
62196d43ffdSmrg
62296d43ffdSmrgPlease tell bug-automake@gnu.org about your system, including the value
62396d43ffdSmrgof your $PATH and any error possibly output before this message.  This
62496d43ffdSmrgcan help us improve future automake versions.
6255dfecf96Smrg
62696d43ffdSmrgEND
62796d43ffdSmrg  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
62896d43ffdSmrg    echo 'Configuration will proceed anyway, since you have set the' >&2
62996d43ffdSmrg    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
63096d43ffdSmrg    echo >&2
63196d43ffdSmrg  else
63296d43ffdSmrg    cat >&2 <<'END'
63396d43ffdSmrgAborting the configuration process, to ensure you take notice of the issue.
6345dfecf96Smrg
63596d43ffdSmrgYou can download and install GNU coreutils to get an 'rm' implementation
63696d43ffdSmrgthat behaves properly: <https://www.gnu.org/software/coreutils/>.
6375dfecf96Smrg
63896d43ffdSmrgIf you want to complete the configuration process using your problematic
63996d43ffdSmrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
64096d43ffdSmrgto "yes", and re-run configure.
6415dfecf96Smrg
64296d43ffdSmrgEND
64396d43ffdSmrg    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
64496d43ffdSmrg  fi
6455dfecf96Smrgfi
64696d43ffdSmrgdnl The trailing newline in this macro's definition is deliberate, for
64796d43ffdSmrgdnl backward compatibility and to allow trailing 'dnl'-style comments
64896d43ffdSmrgdnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
64996d43ffdSmrg])
6505dfecf96Smrg
65196d43ffdSmrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
65296d43ffdSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
65396d43ffdSmrgdnl mangled by Autoconf and run in a shell conditional statement.
65496d43ffdSmrgm4_define([_AC_COMPILER_EXEEXT],
65596d43ffdSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
6565dfecf96Smrg
65796d43ffdSmrg# When config.status generates a header, we must update the stamp-h file.
65896d43ffdSmrg# This file resides in the same directory as the config header
65996d43ffdSmrg# that is generated.  The stamp files are numbered to have different names.
66096d43ffdSmrg
66196d43ffdSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
66296d43ffdSmrg# loop where config.status creates the headers, so we can generate
66396d43ffdSmrg# our stamp files there.
66496d43ffdSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
66596d43ffdSmrg[# Compute $1's index in $config_headers.
66696d43ffdSmrg_am_arg=$1
66796d43ffdSmrg_am_stamp_count=1
66896d43ffdSmrgfor _am_header in $config_headers :; do
66996d43ffdSmrg  case $_am_header in
67096d43ffdSmrg    $_am_arg | $_am_arg:* )
67196d43ffdSmrg      break ;;
67296d43ffdSmrg    * )
67396d43ffdSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
67496d43ffdSmrg  esac
67596d43ffdSmrgdone
67696d43ffdSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
67796d43ffdSmrg
67896d43ffdSmrg# Copyright (C) 2001-2021 Free Software Foundation, Inc.
679f765521fSmrg#
68096d43ffdSmrg# This file is free software; the Free Software Foundation
68196d43ffdSmrg# gives unlimited permission to copy and/or distribute it,
68296d43ffdSmrg# with or without modifications, as long as this notice is preserved.
6835dfecf96Smrg
68496d43ffdSmrg# AM_PROG_INSTALL_SH
68596d43ffdSmrg# ------------------
68696d43ffdSmrg# Define $install_sh.
68796d43ffdSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
68896d43ffdSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
68996d43ffdSmrgif test x"${install_sh+set}" != xset; then
69096d43ffdSmrg  case $am_aux_dir in
69196d43ffdSmrg  *\ * | *\	*)
69296d43ffdSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
69396d43ffdSmrg  *)
69496d43ffdSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
69596d43ffdSmrg  esac
69696d43ffdSmrgfi
69796d43ffdSmrgAC_SUBST([install_sh])])
6985dfecf96Smrg
69996d43ffdSmrg# Copyright (C) 2003-2021 Free Software Foundation, Inc.
70096d43ffdSmrg#
70196d43ffdSmrg# This file is free software; the Free Software Foundation
70296d43ffdSmrg# gives unlimited permission to copy and/or distribute it,
70396d43ffdSmrg# with or without modifications, as long as this notice is preserved.
7045dfecf96Smrg
70596d43ffdSmrg# Check whether the underlying file-system supports filenames
70696d43ffdSmrg# with a leading dot.  For instance MS-DOS doesn't.
70796d43ffdSmrgAC_DEFUN([AM_SET_LEADING_DOT],
70896d43ffdSmrg[rm -rf .tst 2>/dev/null
70996d43ffdSmrgmkdir .tst 2>/dev/null
71096d43ffdSmrgif test -d .tst; then
71196d43ffdSmrg  am__leading_dot=.
712f765521fSmrgelse
71396d43ffdSmrg  am__leading_dot=_
714f765521fSmrgfi
71596d43ffdSmrgrmdir .tst 2>/dev/null
71696d43ffdSmrgAC_SUBST([am__leading_dot])])
717f14f4646Smrg
71896d43ffdSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
719f14f4646Smrg
72096d43ffdSmrg# Copyright (C) 2001-2021 Free Software Foundation, Inc.
72196d43ffdSmrg#
72296d43ffdSmrg# This file is free software; the Free Software Foundation
72396d43ffdSmrg# gives unlimited permission to copy and/or distribute it,
72496d43ffdSmrg# with or without modifications, as long as this notice is preserved.
725f14f4646Smrg
72696d43ffdSmrg# AM_MAKE_INCLUDE()
72796d43ffdSmrg# -----------------
72896d43ffdSmrg# Check whether make has an 'include' directive that can support all
72996d43ffdSmrg# the idioms we need for our automatic dependency tracking code.
73096d43ffdSmrgAC_DEFUN([AM_MAKE_INCLUDE],
73196d43ffdSmrg[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
73296d43ffdSmrgcat > confinc.mk << 'END'
73396d43ffdSmrgam__doit:
73496d43ffdSmrg	@echo this is the am__doit target >confinc.out
73596d43ffdSmrg.PHONY: am__doit
73696d43ffdSmrgEND
73796d43ffdSmrgam__include="#"
73896d43ffdSmrgam__quote=
73996d43ffdSmrg# BSD make does it like this.
74096d43ffdSmrgecho '.include "confinc.mk" # ignored' > confmf.BSD
74196d43ffdSmrg# Other make implementations (GNU, Solaris 10, AIX) do it like this.
74296d43ffdSmrgecho 'include confinc.mk # ignored' > confmf.GNU
74396d43ffdSmrg_am_result=no
74496d43ffdSmrgfor s in GNU BSD; do
74596d43ffdSmrg  AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
74696d43ffdSmrg  AS_CASE([$?:`cat confinc.out 2>/dev/null`],
74796d43ffdSmrg      ['0:this is the am__doit target'],
74896d43ffdSmrg      [AS_CASE([$s],
74996d43ffdSmrg          [BSD], [am__include='.include' am__quote='"'],
75096d43ffdSmrg          [am__include='include' am__quote=''])])
75196d43ffdSmrg  if test "$am__include" != "#"; then
75296d43ffdSmrg    _am_result="yes ($s style)"
75396d43ffdSmrg    break
75496d43ffdSmrg  fi
75596d43ffdSmrgdone
75696d43ffdSmrgrm -f confinc.* confmf.*
75796d43ffdSmrgAC_MSG_RESULT([${_am_result}])
75896d43ffdSmrgAC_SUBST([am__include])])
75996d43ffdSmrgAC_SUBST([am__quote])])
760f14f4646Smrg
76196d43ffdSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
762f14f4646Smrg
76396d43ffdSmrg# Copyright (C) 1997-2021 Free Software Foundation, Inc.
76496d43ffdSmrg#
76596d43ffdSmrg# This file is free software; the Free Software Foundation
76696d43ffdSmrg# gives unlimited permission to copy and/or distribute it,
76796d43ffdSmrg# with or without modifications, as long as this notice is preserved.
76831de2854Smrg
76996d43ffdSmrg# AM_MISSING_PROG(NAME, PROGRAM)
77096d43ffdSmrg# ------------------------------
77196d43ffdSmrgAC_DEFUN([AM_MISSING_PROG],
77296d43ffdSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
77396d43ffdSmrg$1=${$1-"${am_missing_run}$2"}
77496d43ffdSmrgAC_SUBST($1)])
775f14f4646Smrg
77696d43ffdSmrg# AM_MISSING_HAS_RUN
77796d43ffdSmrg# ------------------
77896d43ffdSmrg# Define MISSING if not defined so far and test if it is modern enough.
77996d43ffdSmrg# If it is, set am_missing_run to use it, otherwise, to nothing.
78096d43ffdSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
78196d43ffdSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
78296d43ffdSmrgAC_REQUIRE_AUX_FILE([missing])dnl
78396d43ffdSmrgif test x"${MISSING+set}" != xset; then
78496d43ffdSmrg  MISSING="\${SHELL} '$am_aux_dir/missing'"
78596d43ffdSmrgfi
78696d43ffdSmrg# Use eval to expand $SHELL
78796d43ffdSmrgif eval "$MISSING --is-lightweight"; then
78896d43ffdSmrg  am_missing_run="$MISSING "
78996d43ffdSmrgelse
79096d43ffdSmrg  am_missing_run=
79196d43ffdSmrg  AC_MSG_WARN(['missing' script is too old or missing])
79296d43ffdSmrgfi
79396d43ffdSmrg])
794f14f4646Smrg
79596d43ffdSmrg# Helper functions for option handling.                     -*- Autoconf -*-
796c05e22d7Smrg
79796d43ffdSmrg# Copyright (C) 2001-2021 Free Software Foundation, Inc.
798f14f4646Smrg#
79996d43ffdSmrg# This file is free software; the Free Software Foundation
80096d43ffdSmrg# gives unlimited permission to copy and/or distribute it,
80196d43ffdSmrg# with or without modifications, as long as this notice is preserved.
8025dfecf96Smrg
80396d43ffdSmrg# _AM_MANGLE_OPTION(NAME)
80496d43ffdSmrg# -----------------------
80596d43ffdSmrgAC_DEFUN([_AM_MANGLE_OPTION],
80696d43ffdSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
807c05e22d7Smrg
80896d43ffdSmrg# _AM_SET_OPTION(NAME)
80996d43ffdSmrg# --------------------
81096d43ffdSmrg# Set option NAME.  Presently that only means defining a flag for this option.
81196d43ffdSmrgAC_DEFUN([_AM_SET_OPTION],
81296d43ffdSmrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
813f14f4646Smrg
81496d43ffdSmrg# _AM_SET_OPTIONS(OPTIONS)
81596d43ffdSmrg# ------------------------
81696d43ffdSmrg# OPTIONS is a space-separated list of Automake options.
81796d43ffdSmrgAC_DEFUN([_AM_SET_OPTIONS],
81896d43ffdSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
819c05e22d7Smrg
82096d43ffdSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
82196d43ffdSmrg# -------------------------------------------
82296d43ffdSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
82396d43ffdSmrgAC_DEFUN([_AM_IF_OPTION],
82496d43ffdSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
825f14f4646Smrg
82696d43ffdSmrg# Copyright (C) 1999-2021 Free Software Foundation, Inc.
82796d43ffdSmrg#
82896d43ffdSmrg# This file is free software; the Free Software Foundation
82996d43ffdSmrg# gives unlimited permission to copy and/or distribute it,
83096d43ffdSmrg# with or without modifications, as long as this notice is preserved.
831f14f4646Smrg
83296d43ffdSmrg# _AM_PROG_CC_C_O
83396d43ffdSmrg# ---------------
83496d43ffdSmrg# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
83596d43ffdSmrg# to automatically call this.
83696d43ffdSmrgAC_DEFUN([_AM_PROG_CC_C_O],
83796d43ffdSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
83896d43ffdSmrgAC_REQUIRE_AUX_FILE([compile])dnl
83996d43ffdSmrgAC_LANG_PUSH([C])dnl
84096d43ffdSmrgAC_CACHE_CHECK(
84196d43ffdSmrg  [whether $CC understands -c and -o together],
84296d43ffdSmrg  [am_cv_prog_cc_c_o],
84396d43ffdSmrg  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
84496d43ffdSmrg  # Make sure it works both with $CC and with simple cc.
84596d43ffdSmrg  # Following AC_PROG_CC_C_O, we do the test twice because some
84696d43ffdSmrg  # compilers refuse to overwrite an existing .o file with -o,
84796d43ffdSmrg  # though they will create one.
84896d43ffdSmrg  am_cv_prog_cc_c_o=yes
84996d43ffdSmrg  for am_i in 1 2; do
85096d43ffdSmrg    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
85196d43ffdSmrg         && test -f conftest2.$ac_objext; then
85296d43ffdSmrg      : OK
85396d43ffdSmrg    else
85496d43ffdSmrg      am_cv_prog_cc_c_o=no
85596d43ffdSmrg      break
85696d43ffdSmrg    fi
85796d43ffdSmrg  done
85896d43ffdSmrg  rm -f core conftest*
85996d43ffdSmrg  unset am_i])
86096d43ffdSmrgif test "$am_cv_prog_cc_c_o" != yes; then
86196d43ffdSmrg   # Losing compiler, so override with the script.
86296d43ffdSmrg   # FIXME: It is wrong to rewrite CC.
86396d43ffdSmrg   # But if we don't then we get into trouble of one sort or another.
86496d43ffdSmrg   # A longer-term fix would be to have automake use am__CC in this case,
86596d43ffdSmrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
86696d43ffdSmrg   CC="$am_aux_dir/compile $CC"
867f765521fSmrgfi
86896d43ffdSmrgAC_LANG_POP([C])])
869c05e22d7Smrg
87096d43ffdSmrg# For backward compatibility.
87196d43ffdSmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
872c05e22d7Smrg
87396d43ffdSmrg# Copyright (C) 2001-2021 Free Software Foundation, Inc.
874f14f4646Smrg#
87596d43ffdSmrg# This file is free software; the Free Software Foundation
87696d43ffdSmrg# gives unlimited permission to copy and/or distribute it,
87796d43ffdSmrg# with or without modifications, as long as this notice is preserved.
87896d43ffdSmrg
87996d43ffdSmrg# AM_RUN_LOG(COMMAND)
88096d43ffdSmrg# -------------------
88196d43ffdSmrg# Run COMMAND, save the exit status in ac_status, and log it.
88296d43ffdSmrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
88396d43ffdSmrgAC_DEFUN([AM_RUN_LOG],
88496d43ffdSmrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
88596d43ffdSmrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
88696d43ffdSmrg   ac_status=$?
88796d43ffdSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
88896d43ffdSmrg   (exit $ac_status); }])
88996d43ffdSmrg
89096d43ffdSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
89196d43ffdSmrg
89296d43ffdSmrg# Copyright (C) 1996-2021 Free Software Foundation, Inc.
893f765521fSmrg#
89496d43ffdSmrg# This file is free software; the Free Software Foundation
89596d43ffdSmrg# gives unlimited permission to copy and/or distribute it,
89696d43ffdSmrg# with or without modifications, as long as this notice is preserved.
8975dfecf96Smrg
89896d43ffdSmrg# AM_SANITY_CHECK
89996d43ffdSmrg# ---------------
90096d43ffdSmrgAC_DEFUN([AM_SANITY_CHECK],
90196d43ffdSmrg[AC_MSG_CHECKING([whether build environment is sane])
90296d43ffdSmrg# Reject unsafe characters in $srcdir or the absolute working directory
90396d43ffdSmrg# name.  Accept space and tab only in the latter.
90496d43ffdSmrgam_lf='
90596d43ffdSmrg'
90696d43ffdSmrgcase `pwd` in
90796d43ffdSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
90896d43ffdSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
90996d43ffdSmrgesac
91096d43ffdSmrgcase $srcdir in
91196d43ffdSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
91296d43ffdSmrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
91396d43ffdSmrgesac
9145dfecf96Smrg
91596d43ffdSmrg# Do 'set' in a subshell so we don't clobber the current shell's
91696d43ffdSmrg# arguments.  Must try -L first in case configure is actually a
91796d43ffdSmrg# symlink; some systems play weird games with the mod time of symlinks
91896d43ffdSmrg# (eg FreeBSD returns the mod time of the symlink's containing
91996d43ffdSmrg# directory).
92096d43ffdSmrgif (
92196d43ffdSmrg   am_has_slept=no
92296d43ffdSmrg   for am_try in 1 2; do
92396d43ffdSmrg     echo "timestamp, slept: $am_has_slept" > conftest.file
92496d43ffdSmrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
92596d43ffdSmrg     if test "$[*]" = "X"; then
92696d43ffdSmrg	# -L didn't work.
92796d43ffdSmrg	set X `ls -t "$srcdir/configure" conftest.file`
92896d43ffdSmrg     fi
92996d43ffdSmrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
93096d43ffdSmrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
93131de2854Smrg
93296d43ffdSmrg	# If neither matched, then we have a broken ls.  This can happen
93396d43ffdSmrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
93496d43ffdSmrg	# broken ls alias from the environment.  This has actually
93596d43ffdSmrg	# happened.  Such a system could not be considered "sane".
93696d43ffdSmrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
93796d43ffdSmrg  alias in your environment])
93896d43ffdSmrg     fi
93996d43ffdSmrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
94096d43ffdSmrg       break
94196d43ffdSmrg     fi
94296d43ffdSmrg     # Just in case.
94396d43ffdSmrg     sleep 1
94496d43ffdSmrg     am_has_slept=yes
94596d43ffdSmrg   done
94696d43ffdSmrg   test "$[2]" = conftest.file
94796d43ffdSmrg   )
94896d43ffdSmrgthen
94996d43ffdSmrg   # Ok.
95096d43ffdSmrg   :
95196d43ffdSmrgelse
95296d43ffdSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
95396d43ffdSmrgCheck your system clock])
95496d43ffdSmrgfi
95596d43ffdSmrgAC_MSG_RESULT([yes])
95696d43ffdSmrg# If we didn't sleep, we still need to ensure time stamps of config.status and
95796d43ffdSmrg# generated files are strictly newer.
95896d43ffdSmrgam_sleep_pid=
95996d43ffdSmrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
96096d43ffdSmrg  ( sleep 1 ) &
96196d43ffdSmrg  am_sleep_pid=$!
96296d43ffdSmrgfi
96396d43ffdSmrgAC_CONFIG_COMMANDS_PRE(
96496d43ffdSmrg  [AC_MSG_CHECKING([that generated files are newer than configure])
96596d43ffdSmrg   if test -n "$am_sleep_pid"; then
96696d43ffdSmrg     # Hide warnings about reused PIDs.
96796d43ffdSmrg     wait $am_sleep_pid 2>/dev/null
96896d43ffdSmrg   fi
96996d43ffdSmrg   AC_MSG_RESULT([done])])
97096d43ffdSmrgrm -f conftest.file
97196d43ffdSmrg])
972f14f4646Smrg
97396d43ffdSmrg# Copyright (C) 2009-2021 Free Software Foundation, Inc.
974f765521fSmrg#
97596d43ffdSmrg# This file is free software; the Free Software Foundation
97696d43ffdSmrg# gives unlimited permission to copy and/or distribute it,
97796d43ffdSmrg# with or without modifications, as long as this notice is preserved.
978c05e22d7Smrg
97996d43ffdSmrg# AM_SILENT_RULES([DEFAULT])
98096d43ffdSmrg# --------------------------
98196d43ffdSmrg# Enable less verbose build rules; with the default set to DEFAULT
98296d43ffdSmrg# ("yes" being less verbose, "no" or empty being verbose).
98396d43ffdSmrgAC_DEFUN([AM_SILENT_RULES],
98496d43ffdSmrg[AC_ARG_ENABLE([silent-rules], [dnl
98596d43ffdSmrgAS_HELP_STRING(
98696d43ffdSmrg  [--enable-silent-rules],
98796d43ffdSmrg  [less verbose build output (undo: "make V=1")])
98896d43ffdSmrgAS_HELP_STRING(
98996d43ffdSmrg  [--disable-silent-rules],
99096d43ffdSmrg  [verbose build output (undo: "make V=0")])dnl
99196d43ffdSmrg])
99296d43ffdSmrgcase $enable_silent_rules in @%:@ (((
99396d43ffdSmrg  yes) AM_DEFAULT_VERBOSITY=0;;
99496d43ffdSmrg   no) AM_DEFAULT_VERBOSITY=1;;
99596d43ffdSmrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
99696d43ffdSmrgesac
99796d43ffdSmrgdnl
99896d43ffdSmrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
99996d43ffdSmrgdnl do not support nested variable expansions.
100096d43ffdSmrgdnl See automake bug#9928 and bug#10237.
100196d43ffdSmrgam_make=${MAKE-make}
100296d43ffdSmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
100396d43ffdSmrg   [am_cv_make_support_nested_variables],
100496d43ffdSmrg   [if AS_ECHO([['TRUE=$(BAR$(V))
100596d43ffdSmrgBAR0=false
100696d43ffdSmrgBAR1=true
100796d43ffdSmrgV=1
100896d43ffdSmrgam__doit:
100996d43ffdSmrg	@$(TRUE)
101096d43ffdSmrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
101196d43ffdSmrg  am_cv_make_support_nested_variables=yes
10125dfecf96Smrgelse
101396d43ffdSmrg  am_cv_make_support_nested_variables=no
101496d43ffdSmrgfi])
101596d43ffdSmrgif test $am_cv_make_support_nested_variables = yes; then
101696d43ffdSmrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
101796d43ffdSmrg  AM_V='$(V)'
101896d43ffdSmrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
101996d43ffdSmrgelse
102096d43ffdSmrg  AM_V=$AM_DEFAULT_VERBOSITY
102196d43ffdSmrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
10225dfecf96Smrgfi
102396d43ffdSmrgAC_SUBST([AM_V])dnl
102496d43ffdSmrgAM_SUBST_NOTMAKE([AM_V])dnl
102596d43ffdSmrgAC_SUBST([AM_DEFAULT_V])dnl
102696d43ffdSmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
102796d43ffdSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
102896d43ffdSmrgAM_BACKSLASH='\'
102996d43ffdSmrgAC_SUBST([AM_BACKSLASH])dnl
103096d43ffdSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
103196d43ffdSmrg])
10325dfecf96Smrg
103396d43ffdSmrg# Copyright (C) 2001-2021 Free Software Foundation, Inc.
1034c05e22d7Smrg#
103596d43ffdSmrg# This file is free software; the Free Software Foundation
103696d43ffdSmrg# gives unlimited permission to copy and/or distribute it,
103796d43ffdSmrg# with or without modifications, as long as this notice is preserved.
1038c05e22d7Smrg
103996d43ffdSmrg# AM_PROG_INSTALL_STRIP
104096d43ffdSmrg# ---------------------
104196d43ffdSmrg# One issue with vendor 'install' (even GNU) is that you can't
104296d43ffdSmrg# specify the program used to strip binaries.  This is especially
104396d43ffdSmrg# annoying in cross-compiling environments, where the build's strip
104496d43ffdSmrg# is unlikely to handle the host's binaries.
104596d43ffdSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
104696d43ffdSmrg# always use install-sh in "make install-strip", and initialize
104796d43ffdSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
104896d43ffdSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
104996d43ffdSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
105096d43ffdSmrg# Installed binaries are usually stripped using 'strip' when the user
105196d43ffdSmrg# run "make install-strip".  However 'strip' might not be the right
105296d43ffdSmrg# tool to use in cross-compilation environments, therefore Automake
105396d43ffdSmrg# will honor the 'STRIP' environment variable to overrule this program.
105496d43ffdSmrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
105596d43ffdSmrgif test "$cross_compiling" != no; then
105696d43ffdSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
1057f765521fSmrgfi
105896d43ffdSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
105996d43ffdSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
1060c05e22d7Smrg
106196d43ffdSmrg# Copyright (C) 2006-2021 Free Software Foundation, Inc.
106231de2854Smrg#
106396d43ffdSmrg# This file is free software; the Free Software Foundation
106496d43ffdSmrg# gives unlimited permission to copy and/or distribute it,
106596d43ffdSmrg# with or without modifications, as long as this notice is preserved.
106631de2854Smrg
106796d43ffdSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
106896d43ffdSmrg# ---------------------------
106996d43ffdSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
107096d43ffdSmrg# This macro is traced by Automake.
107196d43ffdSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
107231de2854Smrg
107396d43ffdSmrg# AM_SUBST_NOTMAKE(VARIABLE)
107496d43ffdSmrg# --------------------------
107596d43ffdSmrg# Public sister of _AM_SUBST_NOTMAKE.
107696d43ffdSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
107796d43ffdSmrg
107896d43ffdSmrg# Check how to create a tarball.                            -*- Autoconf -*-
107996d43ffdSmrg
108096d43ffdSmrg# Copyright (C) 2004-2021 Free Software Foundation, Inc.
108131de2854Smrg#
108296d43ffdSmrg# This file is free software; the Free Software Foundation
108396d43ffdSmrg# gives unlimited permission to copy and/or distribute it,
108496d43ffdSmrg# with or without modifications, as long as this notice is preserved.
108596d43ffdSmrg
108696d43ffdSmrg# _AM_PROG_TAR(FORMAT)
108796d43ffdSmrg# --------------------
108896d43ffdSmrg# Check how to create a tarball in format FORMAT.
108996d43ffdSmrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
109031de2854Smrg#
109196d43ffdSmrg# Substitute a variable $(am__tar) that is a command
109296d43ffdSmrg# writing to stdout a FORMAT-tarball containing the directory
109396d43ffdSmrg# $tardir.
109496d43ffdSmrg#     tardir=directory && $(am__tar) > result.tar
109531de2854Smrg#
109696d43ffdSmrg# Substitute a variable $(am__untar) that extract such
109796d43ffdSmrg# a tarball read from stdin.
109896d43ffdSmrg#     $(am__untar) < result.tar
1099f765521fSmrg#
110096d43ffdSmrgAC_DEFUN([_AM_PROG_TAR],
110196d43ffdSmrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
110296d43ffdSmrg# in the wild :-(  We should find a proper way to deprecate it ...
110396d43ffdSmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
1104f765521fSmrg
110596d43ffdSmrg# We'll loop over all known methods to create a tar archive until one works.
110696d43ffdSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
110731de2854Smrg
110896d43ffdSmrgm4_if([$1], [v7],
110996d43ffdSmrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
111031de2854Smrg
111196d43ffdSmrg  [m4_case([$1],
111296d43ffdSmrg    [ustar],
111396d43ffdSmrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
111496d43ffdSmrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
111596d43ffdSmrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
111696d43ffdSmrg      # and bug#13588).
111796d43ffdSmrg      am_max_uid=2097151 # 2^21 - 1
111896d43ffdSmrg      am_max_gid=$am_max_uid
111996d43ffdSmrg      # The $UID and $GID variables are not portable, so we need to resort
112096d43ffdSmrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
112196d43ffdSmrg      # below are definitely unexpected, so allow the users to see them
112296d43ffdSmrg      # (that is, avoid stderr redirection).
112396d43ffdSmrg      am_uid=`id -u || echo unknown`
112496d43ffdSmrg      am_gid=`id -g || echo unknown`
112596d43ffdSmrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
112696d43ffdSmrg      if test $am_uid -le $am_max_uid; then
112796d43ffdSmrg         AC_MSG_RESULT([yes])
112896d43ffdSmrg      else
112996d43ffdSmrg         AC_MSG_RESULT([no])
113096d43ffdSmrg         _am_tools=none
113196d43ffdSmrg      fi
113296d43ffdSmrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
113396d43ffdSmrg      if test $am_gid -le $am_max_gid; then
113496d43ffdSmrg         AC_MSG_RESULT([yes])
113596d43ffdSmrg      else
113696d43ffdSmrg        AC_MSG_RESULT([no])
113796d43ffdSmrg        _am_tools=none
113896d43ffdSmrg      fi],
113931de2854Smrg
114096d43ffdSmrg  [pax],
114196d43ffdSmrg    [],
114231de2854Smrg
114396d43ffdSmrg  [m4_fatal([Unknown tar format])])
114496d43ffdSmrg
114596d43ffdSmrg  AC_MSG_CHECKING([how to create a $1 tar archive])
114696d43ffdSmrg
114796d43ffdSmrg  # Go ahead even if we have the value already cached.  We do so because we
114896d43ffdSmrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
114996d43ffdSmrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
115096d43ffdSmrg
115196d43ffdSmrg  for _am_tool in $_am_tools; do
115296d43ffdSmrg    case $_am_tool in
115396d43ffdSmrg    gnutar)
115496d43ffdSmrg      for _am_tar in tar gnutar gtar; do
115596d43ffdSmrg        AM_RUN_LOG([$_am_tar --version]) && break
115696d43ffdSmrg      done
115796d43ffdSmrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
115896d43ffdSmrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
115996d43ffdSmrg      am__untar="$_am_tar -xf -"
116096d43ffdSmrg      ;;
116196d43ffdSmrg    plaintar)
116296d43ffdSmrg      # Must skip GNU tar: if it does not support --format= it doesn't create
116396d43ffdSmrg      # ustar tarball either.
116496d43ffdSmrg      (tar --version) >/dev/null 2>&1 && continue
116596d43ffdSmrg      am__tar='tar chf - "$$tardir"'
116696d43ffdSmrg      am__tar_='tar chf - "$tardir"'
116796d43ffdSmrg      am__untar='tar xf -'
116896d43ffdSmrg      ;;
116996d43ffdSmrg    pax)
117096d43ffdSmrg      am__tar='pax -L -x $1 -w "$$tardir"'
117196d43ffdSmrg      am__tar_='pax -L -x $1 -w "$tardir"'
117296d43ffdSmrg      am__untar='pax -r'
117396d43ffdSmrg      ;;
117496d43ffdSmrg    cpio)
117596d43ffdSmrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
117696d43ffdSmrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
117796d43ffdSmrg      am__untar='cpio -i -H $1 -d'
117896d43ffdSmrg      ;;
117996d43ffdSmrg    none)
118096d43ffdSmrg      am__tar=false
118196d43ffdSmrg      am__tar_=false
118296d43ffdSmrg      am__untar=false
118396d43ffdSmrg      ;;
118496d43ffdSmrg    esac
118596d43ffdSmrg
118696d43ffdSmrg    # If the value was cached, stop now.  We just wanted to have am__tar
118796d43ffdSmrg    # and am__untar set.
118896d43ffdSmrg    test -n "${am_cv_prog_tar_$1}" && break
118996d43ffdSmrg
119096d43ffdSmrg    # tar/untar a dummy directory, and stop if the command works.
119196d43ffdSmrg    rm -rf conftest.dir
119296d43ffdSmrg    mkdir conftest.dir
119396d43ffdSmrg    echo GrepMe > conftest.dir/file
119496d43ffdSmrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
119596d43ffdSmrg    rm -rf conftest.dir
119696d43ffdSmrg    if test -s conftest.tar; then
119796d43ffdSmrg      AM_RUN_LOG([$am__untar <conftest.tar])
119896d43ffdSmrg      AM_RUN_LOG([cat conftest.dir/file])
119996d43ffdSmrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1200f765521fSmrg    fi
120196d43ffdSmrg  done
120296d43ffdSmrg  rm -rf conftest.dir
120331de2854Smrg
120496d43ffdSmrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
120596d43ffdSmrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
120696d43ffdSmrg
120796d43ffdSmrgAC_SUBST([am__tar])
120896d43ffdSmrgAC_SUBST([am__untar])
120996d43ffdSmrg]) # _AM_PROG_TAR
121096d43ffdSmrg
121196d43ffdSmrgdnl pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
121296d43ffdSmrgdnl serial 11 (pkg-config-0.29)
121396d43ffdSmrgdnl
121496d43ffdSmrgdnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
121596d43ffdSmrgdnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
121696d43ffdSmrgdnl
121796d43ffdSmrgdnl This program is free software; you can redistribute it and/or modify
121896d43ffdSmrgdnl it under the terms of the GNU General Public License as published by
121996d43ffdSmrgdnl the Free Software Foundation; either version 2 of the License, or
122096d43ffdSmrgdnl (at your option) any later version.
122196d43ffdSmrgdnl
122296d43ffdSmrgdnl This program is distributed in the hope that it will be useful, but
122396d43ffdSmrgdnl WITHOUT ANY WARRANTY; without even the implied warranty of
122496d43ffdSmrgdnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
122596d43ffdSmrgdnl General Public License for more details.
122696d43ffdSmrgdnl
122796d43ffdSmrgdnl You should have received a copy of the GNU General Public License
122896d43ffdSmrgdnl along with this program; if not, write to the Free Software
122996d43ffdSmrgdnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
123096d43ffdSmrgdnl 02111-1307, USA.
123196d43ffdSmrgdnl
123296d43ffdSmrgdnl As a special exception to the GNU General Public License, if you
123396d43ffdSmrgdnl distribute this file as part of a program that contains a
123496d43ffdSmrgdnl configuration script generated by Autoconf, you may include it under
123596d43ffdSmrgdnl the same distribution terms that you use for the rest of that
123696d43ffdSmrgdnl program.
123796d43ffdSmrg
123896d43ffdSmrgdnl PKG_PREREQ(MIN-VERSION)
123996d43ffdSmrgdnl -----------------------
124096d43ffdSmrgdnl Since: 0.29
124196d43ffdSmrgdnl
124296d43ffdSmrgdnl Verify that the version of the pkg-config macros are at least
124396d43ffdSmrgdnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
124496d43ffdSmrgdnl installed version of pkg-config, this checks the developer's version
124596d43ffdSmrgdnl of pkg.m4 when generating configure.
124696d43ffdSmrgdnl
124796d43ffdSmrgdnl To ensure that this macro is defined, also add:
124896d43ffdSmrgdnl m4_ifndef([PKG_PREREQ],
124996d43ffdSmrgdnl     [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
125096d43ffdSmrgdnl
125196d43ffdSmrgdnl See the "Since" comment for each macro you use to see what version
125296d43ffdSmrgdnl of the macros you require.
125396d43ffdSmrgm4_defun([PKG_PREREQ],
125496d43ffdSmrg[m4_define([PKG_MACROS_VERSION], [0.29])
125596d43ffdSmrgm4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
125696d43ffdSmrg    [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
125796d43ffdSmrg])dnl PKG_PREREQ
125896d43ffdSmrg
125996d43ffdSmrgdnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
126096d43ffdSmrgdnl ----------------------------------
126196d43ffdSmrgdnl Since: 0.16
126296d43ffdSmrgdnl
126396d43ffdSmrgdnl Search for the pkg-config tool and set the PKG_CONFIG variable to
126496d43ffdSmrgdnl first found in the path. Checks that the version of pkg-config found
126596d43ffdSmrgdnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
126696d43ffdSmrgdnl used since that's the first version where most current features of
126796d43ffdSmrgdnl pkg-config existed.
126896d43ffdSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
126996d43ffdSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
127096d43ffdSmrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
127196d43ffdSmrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
127296d43ffdSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
127396d43ffdSmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
127496d43ffdSmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
127596d43ffdSmrg
127696d43ffdSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
127796d43ffdSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1278f765521fSmrgfi
127996d43ffdSmrgif test -n "$PKG_CONFIG"; then
128096d43ffdSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
128196d43ffdSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
128296d43ffdSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
128396d43ffdSmrg		AC_MSG_RESULT([yes])
128496d43ffdSmrg	else
128596d43ffdSmrg		AC_MSG_RESULT([no])
128696d43ffdSmrg		PKG_CONFIG=""
128796d43ffdSmrg	fi
128896d43ffdSmrgfi[]dnl
128996d43ffdSmrg])dnl PKG_PROG_PKG_CONFIG
129031de2854Smrg
129196d43ffdSmrgdnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
129296d43ffdSmrgdnl -------------------------------------------------------------------
129396d43ffdSmrgdnl Since: 0.18
129496d43ffdSmrgdnl
129596d43ffdSmrgdnl Check to see whether a particular set of modules exists. Similar to
129696d43ffdSmrgdnl PKG_CHECK_MODULES(), but does not set variables or print errors.
129796d43ffdSmrgdnl
129896d43ffdSmrgdnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
129996d43ffdSmrgdnl only at the first occurence in configure.ac, so if the first place
130096d43ffdSmrgdnl it's called might be skipped (such as if it is within an "if", you
130196d43ffdSmrgdnl have to call PKG_CHECK_EXISTS manually
130296d43ffdSmrgAC_DEFUN([PKG_CHECK_EXISTS],
130396d43ffdSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
130496d43ffdSmrgif test -n "$PKG_CONFIG" && \
130596d43ffdSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
130696d43ffdSmrg  m4_default([$2], [:])
130796d43ffdSmrgm4_ifvaln([$3], [else
130896d43ffdSmrg  $3])dnl
130996d43ffdSmrgfi])
1310c05e22d7Smrg
131196d43ffdSmrgdnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
131296d43ffdSmrgdnl ---------------------------------------------
131396d43ffdSmrgdnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
131496d43ffdSmrgdnl pkg_failed based on the result.
131596d43ffdSmrgm4_define([_PKG_CONFIG],
131696d43ffdSmrg[if test -n "$$1"; then
131796d43ffdSmrg    pkg_cv_[]$1="$$1"
131896d43ffdSmrg elif test -n "$PKG_CONFIG"; then
131996d43ffdSmrg    PKG_CHECK_EXISTS([$3],
132096d43ffdSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
132196d43ffdSmrg		      test "x$?" != "x0" && pkg_failed=yes ],
132296d43ffdSmrg		     [pkg_failed=yes])
132396d43ffdSmrg else
132496d43ffdSmrg    pkg_failed=untried
132596d43ffdSmrgfi[]dnl
132696d43ffdSmrg])dnl _PKG_CONFIG
1327c05e22d7Smrg
132896d43ffdSmrgdnl _PKG_SHORT_ERRORS_SUPPORTED
132996d43ffdSmrgdnl ---------------------------
133096d43ffdSmrgdnl Internal check to see if pkg-config supports short errors.
133196d43ffdSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
133296d43ffdSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
133396d43ffdSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
133496d43ffdSmrg        _pkg_short_errors_supported=yes
1335c05e22d7Smrgelse
133696d43ffdSmrg        _pkg_short_errors_supported=no
133796d43ffdSmrgfi[]dnl
133896d43ffdSmrg])dnl _PKG_SHORT_ERRORS_SUPPORTED
13395dfecf96Smrg
13405dfecf96Smrg
134196d43ffdSmrgdnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
134296d43ffdSmrgdnl   [ACTION-IF-NOT-FOUND])
134396d43ffdSmrgdnl --------------------------------------------------------------
134496d43ffdSmrgdnl Since: 0.4.0
134596d43ffdSmrgdnl
134696d43ffdSmrgdnl Note that if there is a possibility the first call to
134796d43ffdSmrgdnl PKG_CHECK_MODULES might not happen, you should be sure to include an
134896d43ffdSmrgdnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
134996d43ffdSmrgAC_DEFUN([PKG_CHECK_MODULES],
135096d43ffdSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
135196d43ffdSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
135296d43ffdSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
13535dfecf96Smrg
135496d43ffdSmrgpkg_failed=no
135596d43ffdSmrgAC_MSG_CHECKING([for $1])
13565dfecf96Smrg
135796d43ffdSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
135896d43ffdSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1359c05e22d7Smrg
136096d43ffdSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
136196d43ffdSmrgand $1[]_LIBS to avoid the need to call pkg-config.
136296d43ffdSmrgSee the pkg-config man page for more details.])
136396d43ffdSmrg
136496d43ffdSmrgif test $pkg_failed = yes; then
136596d43ffdSmrg   	AC_MSG_RESULT([no])
136696d43ffdSmrg        _PKG_SHORT_ERRORS_SUPPORTED
136796d43ffdSmrg        if test $_pkg_short_errors_supported = yes; then
136896d43ffdSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
136996d43ffdSmrg        else 
137096d43ffdSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
137196d43ffdSmrg        fi
137296d43ffdSmrg	# Put the nasty error message in config.log where it belongs
137396d43ffdSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
137496d43ffdSmrg
137596d43ffdSmrg	m4_default([$4], [AC_MSG_ERROR(
137696d43ffdSmrg[Package requirements ($2) were not met:
137796d43ffdSmrg
137896d43ffdSmrg$$1_PKG_ERRORS
137996d43ffdSmrg
138096d43ffdSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
138196d43ffdSmrginstalled software in a non-standard prefix.
138296d43ffdSmrg
138396d43ffdSmrg_PKG_TEXT])[]dnl
138496d43ffdSmrg        ])
138596d43ffdSmrgelif test $pkg_failed = untried; then
138696d43ffdSmrg     	AC_MSG_RESULT([no])
138796d43ffdSmrg	m4_default([$4], [AC_MSG_FAILURE(
138896d43ffdSmrg[The pkg-config script could not be found or is too old.  Make sure it
138996d43ffdSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
139096d43ffdSmrgpath to pkg-config.
139196d43ffdSmrg
139296d43ffdSmrg_PKG_TEXT
139396d43ffdSmrg
139496d43ffdSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
139596d43ffdSmrg        ])
1396c05e22d7Smrgelse
139796d43ffdSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
139896d43ffdSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
139996d43ffdSmrg        AC_MSG_RESULT([yes])
140096d43ffdSmrg	$3
140196d43ffdSmrgfi[]dnl
140296d43ffdSmrg])dnl PKG_CHECK_MODULES
14035dfecf96Smrg
14045dfecf96Smrg
140596d43ffdSmrgdnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
140696d43ffdSmrgdnl   [ACTION-IF-NOT-FOUND])
140796d43ffdSmrgdnl ---------------------------------------------------------------------
140896d43ffdSmrgdnl Since: 0.29
140996d43ffdSmrgdnl
141096d43ffdSmrgdnl Checks for existence of MODULES and gathers its build flags with
141196d43ffdSmrgdnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
141296d43ffdSmrgdnl and VARIABLE-PREFIX_LIBS from --libs.
141396d43ffdSmrgdnl
141496d43ffdSmrgdnl Note that if there is a possibility the first call to
141596d43ffdSmrgdnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
141696d43ffdSmrgdnl include an explicit call to PKG_PROG_PKG_CONFIG in your
141796d43ffdSmrgdnl configure.ac.
141896d43ffdSmrgAC_DEFUN([PKG_CHECK_MODULES_STATIC],
141996d43ffdSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
142096d43ffdSmrg_save_PKG_CONFIG=$PKG_CONFIG
142196d43ffdSmrgPKG_CONFIG="$PKG_CONFIG --static"
142296d43ffdSmrgPKG_CHECK_MODULES($@)
142396d43ffdSmrgPKG_CONFIG=$_save_PKG_CONFIG[]dnl
142496d43ffdSmrg])dnl PKG_CHECK_MODULES_STATIC
1425c05e22d7Smrg
1426f765521fSmrg
142796d43ffdSmrgdnl PKG_INSTALLDIR([DIRECTORY])
142896d43ffdSmrgdnl -------------------------
142996d43ffdSmrgdnl Since: 0.27
143096d43ffdSmrgdnl
143196d43ffdSmrgdnl Substitutes the variable pkgconfigdir as the location where a module
143296d43ffdSmrgdnl should install pkg-config .pc files. By default the directory is
143396d43ffdSmrgdnl $libdir/pkgconfig, but the default can be changed by passing
143496d43ffdSmrgdnl DIRECTORY. The user can override through the --with-pkgconfigdir
143596d43ffdSmrgdnl parameter.
143696d43ffdSmrgAC_DEFUN([PKG_INSTALLDIR],
143796d43ffdSmrg[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
143896d43ffdSmrgm4_pushdef([pkg_description],
143996d43ffdSmrg    [pkg-config installation directory @<:@]pkg_default[@:>@])
144096d43ffdSmrgAC_ARG_WITH([pkgconfigdir],
144196d43ffdSmrg    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
144296d43ffdSmrg    [with_pkgconfigdir=]pkg_default)
144396d43ffdSmrgAC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
144496d43ffdSmrgm4_popdef([pkg_default])
144596d43ffdSmrgm4_popdef([pkg_description])
144696d43ffdSmrg])dnl PKG_INSTALLDIR
144796d43ffdSmrg
1448f765521fSmrg
144996d43ffdSmrgdnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
145096d43ffdSmrgdnl --------------------------------
145196d43ffdSmrgdnl Since: 0.27
145296d43ffdSmrgdnl
145396d43ffdSmrgdnl Substitutes the variable noarch_pkgconfigdir as the location where a
145496d43ffdSmrgdnl module should install arch-independent pkg-config .pc files. By
145596d43ffdSmrgdnl default the directory is $datadir/pkgconfig, but the default can be
145696d43ffdSmrgdnl changed by passing DIRECTORY. The user can override through the
145796d43ffdSmrgdnl --with-noarch-pkgconfigdir parameter.
145896d43ffdSmrgAC_DEFUN([PKG_NOARCH_INSTALLDIR],
145996d43ffdSmrg[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
146096d43ffdSmrgm4_pushdef([pkg_description],
146196d43ffdSmrg    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
146296d43ffdSmrgAC_ARG_WITH([noarch-pkgconfigdir],
146396d43ffdSmrg    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
146496d43ffdSmrg    [with_noarch_pkgconfigdir=]pkg_default)
146596d43ffdSmrgAC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
146696d43ffdSmrgm4_popdef([pkg_default])
146796d43ffdSmrgm4_popdef([pkg_description])
146896d43ffdSmrg])dnl PKG_NOARCH_INSTALLDIR
146996d43ffdSmrg
147096d43ffdSmrg
147196d43ffdSmrgdnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
147296d43ffdSmrgdnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
147396d43ffdSmrgdnl -------------------------------------------
147496d43ffdSmrgdnl Since: 0.28
147596d43ffdSmrgdnl
147696d43ffdSmrgdnl Retrieves the value of the pkg-config variable for the given module.
147796d43ffdSmrgAC_DEFUN([PKG_CHECK_VAR],
147896d43ffdSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
147996d43ffdSmrgAC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
148096d43ffdSmrg
148196d43ffdSmrg_PKG_CONFIG([$1], [variable="][$3]["], [$2])
148296d43ffdSmrgAS_VAR_COPY([$1], [pkg_cv_][$1])
148396d43ffdSmrg
148496d43ffdSmrgAS_VAR_IF([$1], [""], [$5], [$4])dnl
148596d43ffdSmrg])dnl PKG_CHECK_VAR
148696d43ffdSmrg
148796d43ffdSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
148896d43ffdSmrgdnl
148996d43ffdSmrgdnl Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
149096d43ffdSmrgdnl
149196d43ffdSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
149296d43ffdSmrgdnl copy of this software and associated documentation files (the "Software"),
149396d43ffdSmrgdnl to deal in the Software without restriction, including without limitation
149496d43ffdSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
149596d43ffdSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
149696d43ffdSmrgdnl Software is furnished to do so, subject to the following conditions:
149796d43ffdSmrgdnl
149896d43ffdSmrgdnl The above copyright notice and this permission notice (including the next
149996d43ffdSmrgdnl paragraph) shall be included in all copies or substantial portions of the
150096d43ffdSmrgdnl Software.
150196d43ffdSmrgdnl
150296d43ffdSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
150396d43ffdSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
150496d43ffdSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
150596d43ffdSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
150696d43ffdSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
150796d43ffdSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
150896d43ffdSmrgdnl DEALINGS IN THE SOFTWARE.
150996d43ffdSmrg
151096d43ffdSmrg# XORG_MACROS_VERSION(required-version)
151196d43ffdSmrg# -------------------------------------
151296d43ffdSmrg# Minimum version: 1.1.0
1513f765521fSmrg#
151496d43ffdSmrg# If you're using a macro added in Version 1.1 or newer, include this in
151596d43ffdSmrg# your configure.ac with the minimum required version, such as:
151696d43ffdSmrg# XORG_MACROS_VERSION(1.1)
1517f765521fSmrg#
151896d43ffdSmrg# To ensure that this macro is defined, also add:
151996d43ffdSmrg# m4_ifndef([XORG_MACROS_VERSION],
152096d43ffdSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
1521f765521fSmrg#
1522f765521fSmrg#
152396d43ffdSmrg# See the "minimum version" comment for each macro you use to see what
152496d43ffdSmrg# version you require.
152596d43ffdSmrgm4_defun([XORG_MACROS_VERSION],[
152696d43ffdSmrgm4_define([vers_have], [1.19.3])
152796d43ffdSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
152896d43ffdSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
152996d43ffdSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
153096d43ffdSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
153196d43ffdSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
153296d43ffdSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
153396d43ffdSmrgm4_undefine([vers_have])
153496d43ffdSmrgm4_undefine([maj_have])
153596d43ffdSmrgm4_undefine([maj_needed])
153696d43ffdSmrg]) # XORG_MACROS_VERSION
1537f765521fSmrg
153896d43ffdSmrg# XORG_PROG_RAWCPP()
153996d43ffdSmrg# ------------------
154096d43ffdSmrg# Minimum version: 1.0.0
154131de2854Smrg#
154296d43ffdSmrg# Find cpp program and necessary flags for use in pre-processing text files
154396d43ffdSmrg# such as man pages and config files
154496d43ffdSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
154596d43ffdSmrgAC_REQUIRE([AC_PROG_CPP])
154696d43ffdSmrgAC_PATH_TOOL(RAWCPP, [cpp], [${CPP}],
154796d43ffdSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
154896d43ffdSmrg
154996d43ffdSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
155096d43ffdSmrg# which is not the best choice for supporting other OS'es, but covers most
155196d43ffdSmrg# of the ones we need for now.
155296d43ffdSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
155396d43ffdSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
155496d43ffdSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
155596d43ffdSmrg	AC_MSG_RESULT([no])
155696d43ffdSmrgelse
155796d43ffdSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
155896d43ffdSmrg		RAWCPPFLAGS=-undef
155996d43ffdSmrg		AC_MSG_RESULT([yes])
156096d43ffdSmrg	# under Cygwin unix is still defined even with -undef
156196d43ffdSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
156296d43ffdSmrg		RAWCPPFLAGS="-undef -ansi"
156396d43ffdSmrg		AC_MSG_RESULT([yes, with -ansi])
156496d43ffdSmrg	else
156596d43ffdSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
156696d43ffdSmrg	fi
156796d43ffdSmrgfi
156896d43ffdSmrgrm -f conftest.$ac_ext
156996d43ffdSmrg
157096d43ffdSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
157196d43ffdSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
157296d43ffdSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
157396d43ffdSmrg	AC_MSG_RESULT([no])
157496d43ffdSmrgelse
157596d43ffdSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
157696d43ffdSmrg		TRADITIONALCPPFLAGS="-traditional"
157796d43ffdSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
157896d43ffdSmrg		AC_MSG_RESULT([yes])
157996d43ffdSmrg	else
158096d43ffdSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
158196d43ffdSmrg	fi
158296d43ffdSmrgfi
158396d43ffdSmrgrm -f conftest.$ac_ext
158496d43ffdSmrgAC_SUBST(RAWCPPFLAGS)
158596d43ffdSmrgAC_SUBST(TRADITIONALCPPFLAGS)
158696d43ffdSmrg]) # XORG_PROG_RAWCPP
158796d43ffdSmrg
158896d43ffdSmrg# XORG_MANPAGE_SECTIONS()
158996d43ffdSmrg# -----------------------
159096d43ffdSmrg# Minimum version: 1.0.0
159131de2854Smrg#
159296d43ffdSmrg# Determine which sections man pages go in for the different man page types
159396d43ffdSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
159496d43ffdSmrg# Not sure if there's any better way than just hardcoding by OS name.
159596d43ffdSmrg# Override default settings by setting environment variables
159696d43ffdSmrg# Added MAN_SUBSTS in version 1.8
159796d43ffdSmrg# Added AC_PROG_SED in version 1.8
159831de2854Smrg
159996d43ffdSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
160096d43ffdSmrgAC_REQUIRE([AC_CANONICAL_HOST])
160196d43ffdSmrgAC_REQUIRE([AC_PROG_SED])
160296d43ffdSmrg
160396d43ffdSmrgcase $host_os in
160496d43ffdSmrg    solaris*)
160596d43ffdSmrg        # Solaris 2.0 - 11.3 use SysV man page section numbers, so we
160696d43ffdSmrg        # check for a man page file found in later versions that use
160796d43ffdSmrg        # traditional section numbers instead
160896d43ffdSmrg        AC_CHECK_FILE([/usr/share/man/man7/attributes.7],
160996d43ffdSmrg                [SYSV_MAN_SECTIONS=false], [SYSV_MAN_SECTIONS=true])
161096d43ffdSmrg        ;;
161196d43ffdSmrg    *) SYSV_MAN_SECTIONS=false ;;
161296d43ffdSmrgesac
161396d43ffdSmrg
161496d43ffdSmrgif test x$APP_MAN_SUFFIX = x    ; then
161596d43ffdSmrg    APP_MAN_SUFFIX=1
161696d43ffdSmrgfi
161796d43ffdSmrgif test x$APP_MAN_DIR = x    ; then
161896d43ffdSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
161996d43ffdSmrgfi
162096d43ffdSmrg
162196d43ffdSmrgif test x$LIB_MAN_SUFFIX = x    ; then
162296d43ffdSmrg    LIB_MAN_SUFFIX=3
162396d43ffdSmrgfi
162496d43ffdSmrgif test x$LIB_MAN_DIR = x    ; then
162596d43ffdSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
162696d43ffdSmrgfi
162796d43ffdSmrg
162896d43ffdSmrgif test x$FILE_MAN_SUFFIX = x    ; then
162996d43ffdSmrg    case $SYSV_MAN_SECTIONS in
163096d43ffdSmrg	true)				FILE_MAN_SUFFIX=4  ;;
163196d43ffdSmrg	*)				FILE_MAN_SUFFIX=5  ;;
163296d43ffdSmrg    esac
163396d43ffdSmrgfi
163496d43ffdSmrgif test x$FILE_MAN_DIR = x    ; then
163596d43ffdSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
163696d43ffdSmrgfi
163796d43ffdSmrg
163896d43ffdSmrgif test x$MISC_MAN_SUFFIX = x    ; then
163996d43ffdSmrg    case $SYSV_MAN_SECTIONS in
164096d43ffdSmrg	true)				MISC_MAN_SUFFIX=5  ;;
164196d43ffdSmrg	*)				MISC_MAN_SUFFIX=7  ;;
164296d43ffdSmrg    esac
164331de2854Smrgfi
164496d43ffdSmrgif test x$MISC_MAN_DIR = x    ; then
164596d43ffdSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1646f765521fSmrgfi
164731de2854Smrg
164896d43ffdSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
164996d43ffdSmrg    case $SYSV_MAN_SECTIONS in
165096d43ffdSmrg	true)				DRIVER_MAN_SUFFIX=7  ;;
165196d43ffdSmrg	*)				DRIVER_MAN_SUFFIX=4  ;;
165296d43ffdSmrg    esac
165396d43ffdSmrgfi
165496d43ffdSmrgif test x$DRIVER_MAN_DIR = x    ; then
165596d43ffdSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1656f765521fSmrgfi
1657f765521fSmrg
165896d43ffdSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
165996d43ffdSmrg    case $SYSV_MAN_SECTIONS in
166096d43ffdSmrg	true)				ADMIN_MAN_SUFFIX=1m ;;
166196d43ffdSmrg	*)				ADMIN_MAN_SUFFIX=8  ;;
166296d43ffdSmrg    esac
166396d43ffdSmrgfi
166496d43ffdSmrgif test x$ADMIN_MAN_DIR = x    ; then
166596d43ffdSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1666f765521fSmrgfi
1667f765521fSmrg
1668f765521fSmrg
166996d43ffdSmrgAC_SUBST([APP_MAN_SUFFIX])
167096d43ffdSmrgAC_SUBST([LIB_MAN_SUFFIX])
167196d43ffdSmrgAC_SUBST([FILE_MAN_SUFFIX])
167296d43ffdSmrgAC_SUBST([MISC_MAN_SUFFIX])
167396d43ffdSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
167496d43ffdSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
167596d43ffdSmrgAC_SUBST([APP_MAN_DIR])
167696d43ffdSmrgAC_SUBST([LIB_MAN_DIR])
167796d43ffdSmrgAC_SUBST([FILE_MAN_DIR])
167896d43ffdSmrgAC_SUBST([MISC_MAN_DIR])
167996d43ffdSmrgAC_SUBST([DRIVER_MAN_DIR])
168096d43ffdSmrgAC_SUBST([ADMIN_MAN_DIR])
168196d43ffdSmrg
168296d43ffdSmrgXORG_MAN_PAGE="X Version 11"
168396d43ffdSmrgAC_SUBST([XORG_MAN_PAGE])
168496d43ffdSmrgMAN_SUBSTS="\
168596d43ffdSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
168696d43ffdSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
168796d43ffdSmrg	-e 's|__xservername__|Xorg|g' \
168896d43ffdSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
168996d43ffdSmrg	-e 's|__projectroot__|\$(prefix)|g' \
169096d43ffdSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
169196d43ffdSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
169296d43ffdSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
169396d43ffdSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
169496d43ffdSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
169596d43ffdSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
169696d43ffdSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
169796d43ffdSmrgAC_SUBST([MAN_SUBSTS])
169896d43ffdSmrg
169996d43ffdSmrg]) # XORG_MANPAGE_SECTIONS
170096d43ffdSmrg
170196d43ffdSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
170296d43ffdSmrg# ------------------------
170396d43ffdSmrg# Minimum version: 1.7.0
170431de2854Smrg#
170596d43ffdSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
170696d43ffdSmrg# provided by xorg-sgml-doctools, if installed.
170796d43ffdSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
170896d43ffdSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
170996d43ffdSmrgXORG_SGML_PATH=
171096d43ffdSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
171196d43ffdSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
171296d43ffdSmrg    [m4_ifval([$1],[:],
171396d43ffdSmrg        [if test x"$cross_compiling" != x"yes" ; then
171496d43ffdSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
171596d43ffdSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
171696d43ffdSmrg         fi])
171796d43ffdSmrg    ])
171896d43ffdSmrg
171996d43ffdSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
172096d43ffdSmrg# the path and the name of the doc stylesheet
172196d43ffdSmrgif test "x$XORG_SGML_PATH" != "x" ; then
172296d43ffdSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
172396d43ffdSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
172496d43ffdSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
172596d43ffdSmrgelse
172696d43ffdSmrg   AC_MSG_RESULT([no])
172731de2854Smrgfi
172831de2854Smrg
172996d43ffdSmrgAC_SUBST(XORG_SGML_PATH)
173096d43ffdSmrgAC_SUBST(STYLESHEET_SRCDIR)
173196d43ffdSmrgAC_SUBST(XSL_STYLESHEET)
173296d43ffdSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
173396d43ffdSmrg]) # XORG_CHECK_SGML_DOCTOOLS
173496d43ffdSmrg
173596d43ffdSmrg# XORG_CHECK_LINUXDOC
173696d43ffdSmrg# -------------------
173796d43ffdSmrg# Minimum version: 1.0.0
1738f765521fSmrg#
173996d43ffdSmrg# Defines the variable MAKE_TEXT if the necessary tools and
174096d43ffdSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
174196d43ffdSmrg# Whether or not the necessary tools and files are found can be checked
174296d43ffdSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
174396d43ffdSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
174496d43ffdSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
174596d43ffdSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
174696d43ffdSmrg
174796d43ffdSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
174896d43ffdSmrg
174996d43ffdSmrgAC_MSG_CHECKING([whether to build documentation])
175096d43ffdSmrg
175196d43ffdSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
175296d43ffdSmrg   BUILDDOC=yes
17535dfecf96Smrgelse
175496d43ffdSmrg   BUILDDOC=no
17555dfecf96Smrgfi
17565dfecf96Smrg
175796d43ffdSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1758c05e22d7Smrg
175996d43ffdSmrgAC_MSG_RESULT([$BUILDDOC])
1760f765521fSmrg
176196d43ffdSmrgAC_MSG_CHECKING([whether to build pdf documentation])
1762f765521fSmrg
176396d43ffdSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
176496d43ffdSmrg   BUILDPDFDOC=yes
176596d43ffdSmrgelse
176696d43ffdSmrg   BUILDPDFDOC=no
1767f765521fSmrgfi
1768f765521fSmrg
176996d43ffdSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
177096d43ffdSmrg
177196d43ffdSmrgAC_MSG_RESULT([$BUILDPDFDOC])
1772f765521fSmrg
177396d43ffdSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
177496d43ffdSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
177596d43ffdSmrgMAKE_PDF="$PS2PDF"
177696d43ffdSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
177796d43ffdSmrg
177896d43ffdSmrgAC_SUBST(MAKE_TEXT)
177996d43ffdSmrgAC_SUBST(MAKE_PS)
178096d43ffdSmrgAC_SUBST(MAKE_PDF)
178196d43ffdSmrgAC_SUBST(MAKE_HTML)
178296d43ffdSmrg]) # XORG_CHECK_LINUXDOC
178396d43ffdSmrg
178496d43ffdSmrg# XORG_CHECK_DOCBOOK
178596d43ffdSmrg# -------------------
1786f765521fSmrg# Minimum version: 1.0.0
1787f765521fSmrg#
178896d43ffdSmrg# Checks for the ability to build output formats from SGML DocBook source.
178996d43ffdSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
179096d43ffdSmrg# indicates whether the necessary tools and files are found and, if set,
179196d43ffdSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
179296d43ffdSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
179396d43ffdSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1794f765521fSmrg
179596d43ffdSmrgBUILDTXTDOC=no
179696d43ffdSmrgBUILDPDFDOC=no
179796d43ffdSmrgBUILDPSDOC=no
179896d43ffdSmrgBUILDHTMLDOC=no
179996d43ffdSmrg
180096d43ffdSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
180196d43ffdSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
180296d43ffdSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
180396d43ffdSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
180496d43ffdSmrg
180596d43ffdSmrgAC_MSG_CHECKING([whether to build text documentation])
180696d43ffdSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
180796d43ffdSmrg   test x$BUILD_TXTDOC != xno; then
180896d43ffdSmrg	BUILDTXTDOC=yes
1809f765521fSmrgfi
181096d43ffdSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
181196d43ffdSmrgAC_MSG_RESULT([$BUILDTXTDOC])
1812f765521fSmrg
181396d43ffdSmrgAC_MSG_CHECKING([whether to build PDF documentation])
181496d43ffdSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
181596d43ffdSmrg   test x$BUILD_PDFDOC != xno; then
181696d43ffdSmrg	BUILDPDFDOC=yes
1817c05e22d7Smrgfi
181896d43ffdSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
181996d43ffdSmrgAC_MSG_RESULT([$BUILDPDFDOC])
18205dfecf96Smrg
182196d43ffdSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
182296d43ffdSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
182396d43ffdSmrg   test x$BUILD_PSDOC != xno; then
182496d43ffdSmrg	BUILDPSDOC=yes
182596d43ffdSmrgfi
182696d43ffdSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
182796d43ffdSmrgAC_MSG_RESULT([$BUILDPSDOC])
1828f765521fSmrg
182996d43ffdSmrgAC_MSG_CHECKING([whether to build HTML documentation])
183096d43ffdSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
183196d43ffdSmrg   test x$BUILD_HTMLDOC != xno; then
183296d43ffdSmrg	BUILDHTMLDOC=yes
183396d43ffdSmrgfi
183496d43ffdSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
183596d43ffdSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
183696d43ffdSmrg
183796d43ffdSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
183896d43ffdSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
183996d43ffdSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
184096d43ffdSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
184196d43ffdSmrg
184296d43ffdSmrgAC_SUBST(MAKE_TEXT)
184396d43ffdSmrgAC_SUBST(MAKE_PS)
184496d43ffdSmrgAC_SUBST(MAKE_PDF)
184596d43ffdSmrgAC_SUBST(MAKE_HTML)
184696d43ffdSmrg]) # XORG_CHECK_DOCBOOK
184796d43ffdSmrg
184896d43ffdSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
1849c05e22d7Smrg# ----------------
185096d43ffdSmrg# Minimum version: 1.5.0
185196d43ffdSmrg# Minimum version for optional DEFAULT argument: 1.11.0
18525dfecf96Smrg#
185396d43ffdSmrg# Documentation tools are not always available on all platforms and sometimes
185496d43ffdSmrg# not at the appropriate level. This macro enables a module to test for the
185596d43ffdSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
185696d43ffdSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
185796d43ffdSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
185896d43ffdSmrg# --with-xmlto assumes 'auto'.
1859c05e22d7Smrg#
1860c05e22d7Smrg# Interface to module:
186196d43ffdSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
186296d43ffdSmrg# XMLTO:	returns the path of the xmlto program found
186396d43ffdSmrg#		returns the path set by the user in the environment
186496d43ffdSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
186596d43ffdSmrg#		'no' user instructs the module not to use xmlto
1866c05e22d7Smrg#
186796d43ffdSmrg# Added in version 1.10.0
186896d43ffdSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
186996d43ffdSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
1870c05e22d7Smrg#
187196d43ffdSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
1872c05e22d7Smrg#
187396d43ffdSmrgAC_DEFUN([XORG_WITH_XMLTO],[
187496d43ffdSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
187596d43ffdSmrgm4_define([_defopt], m4_default([$2], [auto]))
187696d43ffdSmrgAC_ARG_WITH(xmlto,
187796d43ffdSmrg	AS_HELP_STRING([--with-xmlto],
187896d43ffdSmrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
187996d43ffdSmrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
188096d43ffdSmrgm4_undefine([_defopt])
1881f765521fSmrg
188296d43ffdSmrgif test "x$use_xmlto" = x"auto"; then
188396d43ffdSmrg   AC_PATH_PROG([XMLTO], [xmlto])
188496d43ffdSmrg   if test "x$XMLTO" = "x"; then
188596d43ffdSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
188696d43ffdSmrg	have_xmlto=no
188796d43ffdSmrg   else
188896d43ffdSmrg        have_xmlto=yes
188996d43ffdSmrg   fi
189096d43ffdSmrgelif test "x$use_xmlto" = x"yes" ; then
189196d43ffdSmrg   AC_PATH_PROG([XMLTO], [xmlto])
189296d43ffdSmrg   if test "x$XMLTO" = "x"; then
189396d43ffdSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
189496d43ffdSmrg   fi
189596d43ffdSmrg   have_xmlto=yes
189696d43ffdSmrgelif test "x$use_xmlto" = x"no" ; then
189796d43ffdSmrg   if test "x$XMLTO" != "x"; then
189896d43ffdSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
189996d43ffdSmrg   fi
190096d43ffdSmrg   have_xmlto=no
190196d43ffdSmrgelse
190296d43ffdSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
190396d43ffdSmrgfi
1904f765521fSmrg
190596d43ffdSmrg# Test for a minimum version of xmlto, if provided.
190696d43ffdSmrgm4_ifval([$1],
190796d43ffdSmrg[if test "$have_xmlto" = yes; then
190896d43ffdSmrg    # scrape the xmlto version
190996d43ffdSmrg    AC_MSG_CHECKING([the xmlto version])
191096d43ffdSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
191196d43ffdSmrg    AC_MSG_RESULT([$xmlto_version])
191296d43ffdSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
191396d43ffdSmrg        [if test "x$use_xmlto" = xauto; then
191496d43ffdSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
191596d43ffdSmrg            have_xmlto=no
191696d43ffdSmrg        else
191796d43ffdSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
191896d43ffdSmrg        fi])
191996d43ffdSmrgfi])
192096d43ffdSmrg
192196d43ffdSmrg# Test for the ability of xmlto to generate a text target
192296d43ffdSmrg#
192396d43ffdSmrg# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the
192496d43ffdSmrg# following test for empty XML docbook files.
192596d43ffdSmrg# For compatibility reasons use the following empty XML docbook file and if
192696d43ffdSmrg# it fails try it again with a non-empty XML file.
192796d43ffdSmrghave_xmlto_text=no
192896d43ffdSmrgcat > conftest.xml << "EOF"
192996d43ffdSmrgEOF
193096d43ffdSmrgAS_IF([test "$have_xmlto" = yes],
193196d43ffdSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
193296d43ffdSmrg             [have_xmlto_text=yes],
193396d43ffdSmrg             [# Try it again with a non-empty XML file.
193496d43ffdSmrg              cat > conftest.xml << "EOF"
193596d43ffdSmrg<x></x>
193696d43ffdSmrgEOF
193796d43ffdSmrg              AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
193896d43ffdSmrg                    [have_xmlto_text=yes],
193996d43ffdSmrg                    [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])])
194096d43ffdSmrgrm -f conftest.xml
194196d43ffdSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
194296d43ffdSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
194396d43ffdSmrg]) # XORG_WITH_XMLTO
194496d43ffdSmrg
194596d43ffdSmrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
194696d43ffdSmrg# --------------------------------------------
194796d43ffdSmrg# Minimum version: 1.12.0
194896d43ffdSmrg# Minimum version for optional DEFAULT argument: 1.12.0
194996d43ffdSmrg#
195096d43ffdSmrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
195196d43ffdSmrg# XML-based language used for the transformation of XML documents.
195296d43ffdSmrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
195396d43ffdSmrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
195496d43ffdSmrg# The XSLT processor is often used as a standalone tool for transformations.
195596d43ffdSmrg# It should not be assumed that this tool is used only to work with documnetation.
195696d43ffdSmrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
195796d43ffdSmrg#
195896d43ffdSmrg# Interface to module:
195996d43ffdSmrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
196096d43ffdSmrg# XSLTPROC:	 returns the path of the xsltproc program found
196196d43ffdSmrg#		 returns the path set by the user in the environment
196296d43ffdSmrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
196396d43ffdSmrg#		  'no' user instructs the module not to use xsltproc
196496d43ffdSmrg# have_xsltproc: returns yes if xsltproc found in PATH or no
196596d43ffdSmrg#
196696d43ffdSmrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
196796d43ffdSmrg#
196896d43ffdSmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
196996d43ffdSmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
197096d43ffdSmrg# Preserves the interface, should it be implemented later
197196d43ffdSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
197296d43ffdSmrgm4_define([_defopt], m4_default([$2], [auto]))
197396d43ffdSmrgAC_ARG_WITH(xsltproc,
197496d43ffdSmrg	AS_HELP_STRING([--with-xsltproc],
197596d43ffdSmrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
197696d43ffdSmrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
197796d43ffdSmrgm4_undefine([_defopt])
1978c05e22d7Smrg
197996d43ffdSmrgif test "x$use_xsltproc" = x"auto"; then
198096d43ffdSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
198196d43ffdSmrg   if test "x$XSLTPROC" = "x"; then
198296d43ffdSmrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
198396d43ffdSmrg	have_xsltproc=no
198496d43ffdSmrg   else
198596d43ffdSmrg        have_xsltproc=yes
1986c05e22d7Smrg   fi
198796d43ffdSmrgelif test "x$use_xsltproc" = x"yes" ; then
198896d43ffdSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
198996d43ffdSmrg   if test "x$XSLTPROC" = "x"; then
199096d43ffdSmrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
199196d43ffdSmrg   fi
199296d43ffdSmrg   have_xsltproc=yes
199396d43ffdSmrgelif test "x$use_xsltproc" = x"no" ; then
199496d43ffdSmrg   if test "x$XSLTPROC" != "x"; then
199596d43ffdSmrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
1996c05e22d7Smrg   fi
199796d43ffdSmrg   have_xsltproc=no
1998c05e22d7Smrgelse
199996d43ffdSmrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
2000c05e22d7Smrgfi
20015dfecf96Smrg
200296d43ffdSmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
200396d43ffdSmrg]) # XORG_WITH_XSLTPROC
2004f765521fSmrg
200596d43ffdSmrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
200696d43ffdSmrg# ----------------------------------------
200796d43ffdSmrg# Minimum version: 1.15.0
2008f765521fSmrg#
200996d43ffdSmrg# PERL (Practical Extraction and Report Language) is a language optimized for
201096d43ffdSmrg# scanning arbitrary text files, extracting information from those text files,
201196d43ffdSmrg# and printing reports based on that information.
201296d43ffdSmrg#
201396d43ffdSmrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
2014f765521fSmrg#
2015f765521fSmrg# Interface to module:
201696d43ffdSmrg# HAVE_PERL: used in makefiles to conditionally scan text files
201796d43ffdSmrg# PERL:	     returns the path of the perl program found
201896d43ffdSmrg#	     returns the path set by the user in the environment
201996d43ffdSmrg# --with-perl: 'yes' user instructs the module to use perl
202096d43ffdSmrg#	       'no' user instructs the module not to use perl
202196d43ffdSmrg# have_perl: returns yes if perl found in PATH or no
2022f765521fSmrg#
202396d43ffdSmrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
202496d43ffdSmrg#
202596d43ffdSmrgAC_DEFUN([XORG_WITH_PERL],[
202696d43ffdSmrgAC_ARG_VAR([PERL], [Path to perl command])
202796d43ffdSmrg# Preserves the interface, should it be implemented later
202896d43ffdSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
202996d43ffdSmrgm4_define([_defopt], m4_default([$2], [auto]))
203096d43ffdSmrgAC_ARG_WITH(perl,
203196d43ffdSmrg	AS_HELP_STRING([--with-perl],
203296d43ffdSmrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
203396d43ffdSmrg	   [use_perl=$withval], [use_perl=]_defopt)
203496d43ffdSmrgm4_undefine([_defopt])
2035f765521fSmrg
203696d43ffdSmrgif test "x$use_perl" = x"auto"; then
203796d43ffdSmrg   AC_PATH_PROG([PERL], [perl])
203896d43ffdSmrg   if test "x$PERL" = "x"; then
203996d43ffdSmrg        AC_MSG_WARN([perl not found - cannot extract information and report])
204096d43ffdSmrg	have_perl=no
204196d43ffdSmrg   else
204296d43ffdSmrg        have_perl=yes
2043c05e22d7Smrg   fi
204496d43ffdSmrgelif test "x$use_perl" = x"yes" ; then
204596d43ffdSmrg   AC_PATH_PROG([PERL], [perl])
204696d43ffdSmrg   if test "x$PERL" = "x"; then
204796d43ffdSmrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
204896d43ffdSmrg   fi
204996d43ffdSmrg   have_perl=yes
205096d43ffdSmrgelif test "x$use_perl" = x"no" ; then
205196d43ffdSmrg   if test "x$PERL" != "x"; then
205296d43ffdSmrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
205396d43ffdSmrg   fi
205496d43ffdSmrg   have_perl=no
205596d43ffdSmrgelse
205696d43ffdSmrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
2057c05e22d7Smrgfi
20585dfecf96Smrg
205996d43ffdSmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
206096d43ffdSmrg]) # XORG_WITH_PERL
2061f765521fSmrg
206296d43ffdSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
206396d43ffdSmrg# ----------------
206496d43ffdSmrg# Minimum version: 1.5.0
206596d43ffdSmrg# Minimum version for optional DEFAULT argument: 1.11.0
2066c05e22d7Smrg#
206796d43ffdSmrg# Documentation tools are not always available on all platforms and sometimes
206896d43ffdSmrg# not at the appropriate level. This macro enables a module to test for the
206996d43ffdSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
207096d43ffdSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
207196d43ffdSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
207296d43ffdSmrg# --with-asciidoc assumes 'auto'.
2073c05e22d7Smrg#
207496d43ffdSmrg# Interface to module:
207596d43ffdSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
207696d43ffdSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
207796d43ffdSmrg#		 returns the path set by the user in the environment
207896d43ffdSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
207996d43ffdSmrg#		  'no' user instructs the module not to use asciidoc
2080c05e22d7Smrg#
208196d43ffdSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
2082f765521fSmrg#
208396d43ffdSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
208496d43ffdSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
208596d43ffdSmrgm4_define([_defopt], m4_default([$2], [auto]))
208696d43ffdSmrgAC_ARG_WITH(asciidoc,
208796d43ffdSmrg	AS_HELP_STRING([--with-asciidoc],
208896d43ffdSmrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
208996d43ffdSmrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
209096d43ffdSmrgm4_undefine([_defopt])
2091f765521fSmrg
209296d43ffdSmrgif test "x$use_asciidoc" = x"auto"; then
209396d43ffdSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
209496d43ffdSmrg   if test "x$ASCIIDOC" = "x"; then
209596d43ffdSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
209696d43ffdSmrg	have_asciidoc=no
209796d43ffdSmrg   else
209896d43ffdSmrg        have_asciidoc=yes
209996d43ffdSmrg   fi
210096d43ffdSmrgelif test "x$use_asciidoc" = x"yes" ; then
210196d43ffdSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
210296d43ffdSmrg   if test "x$ASCIIDOC" = "x"; then
210396d43ffdSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
210496d43ffdSmrg   fi
210596d43ffdSmrg   have_asciidoc=yes
210696d43ffdSmrgelif test "x$use_asciidoc" = x"no" ; then
210796d43ffdSmrg   if test "x$ASCIIDOC" != "x"; then
210896d43ffdSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
210996d43ffdSmrg   fi
211096d43ffdSmrg   have_asciidoc=no
211196d43ffdSmrgelse
211296d43ffdSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
211396d43ffdSmrgfi
211496d43ffdSmrgm4_ifval([$1],
211596d43ffdSmrg[if test "$have_asciidoc" = yes; then
211696d43ffdSmrg    # scrape the asciidoc version
211796d43ffdSmrg    AC_MSG_CHECKING([the asciidoc version])
211896d43ffdSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
211996d43ffdSmrg    AC_MSG_RESULT([$asciidoc_version])
212096d43ffdSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
212196d43ffdSmrg        [if test "x$use_asciidoc" = xauto; then
212296d43ffdSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
212396d43ffdSmrg            have_asciidoc=no
212496d43ffdSmrg        else
212596d43ffdSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
212696d43ffdSmrg        fi])
212796d43ffdSmrgfi])
212896d43ffdSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
212996d43ffdSmrg]) # XORG_WITH_ASCIIDOC
2130f765521fSmrg
213196d43ffdSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
213296d43ffdSmrg# -------------------------------------------
213396d43ffdSmrg# Minimum version: 1.5.0
213496d43ffdSmrg# Minimum version for optional DEFAULT argument: 1.11.0
213596d43ffdSmrg# Minimum version for optional DOT checking: 1.18.0
2136c05e22d7Smrg#
213796d43ffdSmrg# Documentation tools are not always available on all platforms and sometimes
213896d43ffdSmrg# not at the appropriate level. This macro enables a module to test for the
213996d43ffdSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
214096d43ffdSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
214196d43ffdSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
214296d43ffdSmrg# --with-doxygen assumes 'auto'.
2143c05e22d7Smrg#
214496d43ffdSmrg# Interface to module:
214596d43ffdSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
214696d43ffdSmrg# DOXYGEN:	 returns the path of the doxygen program found
214796d43ffdSmrg#		 returns the path set by the user in the environment
214896d43ffdSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
214996d43ffdSmrg#		  'no' user instructs the module not to use doxygen
2150c05e22d7Smrg#
215196d43ffdSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
215296d43ffdSmrg#
215396d43ffdSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
215496d43ffdSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
215596d43ffdSmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility])
215696d43ffdSmrgm4_define([_defopt], m4_default([$2], [auto]))
215796d43ffdSmrgAC_ARG_WITH(doxygen,
215896d43ffdSmrg	AS_HELP_STRING([--with-doxygen],
215996d43ffdSmrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
216096d43ffdSmrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
216196d43ffdSmrgm4_undefine([_defopt])
2162f765521fSmrg
216396d43ffdSmrgif test "x$use_doxygen" = x"auto"; then
216496d43ffdSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
216596d43ffdSmrg   if test "x$DOXYGEN" = "x"; then
216696d43ffdSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
216796d43ffdSmrg	have_doxygen=no
216896d43ffdSmrg   else
216996d43ffdSmrg        have_doxygen=yes
217096d43ffdSmrg   fi
217196d43ffdSmrgelif test "x$use_doxygen" = x"yes" ; then
217296d43ffdSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
217396d43ffdSmrg   if test "x$DOXYGEN" = "x"; then
217496d43ffdSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
217596d43ffdSmrg   fi
217696d43ffdSmrg   have_doxygen=yes
217796d43ffdSmrgelif test "x$use_doxygen" = x"no" ; then
217896d43ffdSmrg   if test "x$DOXYGEN" != "x"; then
217996d43ffdSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
218096d43ffdSmrg   fi
218196d43ffdSmrg   have_doxygen=no
2182c05e22d7Smrgelse
218396d43ffdSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
2184c05e22d7Smrgfi
218596d43ffdSmrgm4_ifval([$1],
218696d43ffdSmrg[if test "$have_doxygen" = yes; then
218796d43ffdSmrg    # scrape the doxygen version
218896d43ffdSmrg    AC_MSG_CHECKING([the doxygen version])
218996d43ffdSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
219096d43ffdSmrg    AC_MSG_RESULT([$doxygen_version])
219196d43ffdSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
219296d43ffdSmrg        [if test "x$use_doxygen" = xauto; then
219396d43ffdSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
219496d43ffdSmrg            have_doxygen=no
219596d43ffdSmrg        else
219696d43ffdSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
219796d43ffdSmrg        fi])
219896d43ffdSmrgfi])
21995dfecf96Smrg
220096d43ffdSmrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory
220196d43ffdSmrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
220296d43ffdSmrgdnl 	HAVE_DOT = @HAVE_DOT@
220396d43ffdSmrgHAVE_DOT=no
220496d43ffdSmrgif test "x$have_doxygen" = "xyes"; then
220596d43ffdSmrg  AC_PATH_PROG([DOT], [dot])
220696d43ffdSmrg    if test "x$DOT" != "x"; then
220796d43ffdSmrg      HAVE_DOT=yes
220896d43ffdSmrg    fi
2209f765521fSmrgfi
221031de2854Smrg
221196d43ffdSmrgAC_SUBST([HAVE_DOT])
221296d43ffdSmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
221396d43ffdSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
221496d43ffdSmrg]) # XORG_WITH_DOXYGEN
221531de2854Smrg
221696d43ffdSmrg# XORG_WITH_GROFF([DEFAULT])
221796d43ffdSmrg# ----------------
221896d43ffdSmrg# Minimum version: 1.6.0
221996d43ffdSmrg# Minimum version for optional DEFAULT argument: 1.11.0
222031de2854Smrg#
222196d43ffdSmrg# Documentation tools are not always available on all platforms and sometimes
222296d43ffdSmrg# not at the appropriate level. This macro enables a module to test for the
222396d43ffdSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
222496d43ffdSmrg# the --with-groff option, it allows maximum flexibilty in making decisions
222596d43ffdSmrg# as whether or not to use the groff package. When DEFAULT is not specified,
222696d43ffdSmrg# --with-groff assumes 'auto'.
222731de2854Smrg#
222896d43ffdSmrg# Interface to module:
222996d43ffdSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
223096d43ffdSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
223196d43ffdSmrg# HAVE_GROFF_MS: the -ms macros package
223296d43ffdSmrg# GROFF:	 returns the path of the groff program found
223396d43ffdSmrg#		 returns the path set by the user in the environment
223496d43ffdSmrg# --with-groff:	 'yes' user instructs the module to use groff
223596d43ffdSmrg#		 'no' user instructs the module not to use groff
223631de2854Smrg#
223796d43ffdSmrg# Added in version 1.9.0:
223896d43ffdSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
223996d43ffdSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
224096d43ffdSmrg#		   psselect from the psutils package.
224196d43ffdSmrg#		   the ghostcript package. Refer to the grohtml man pages
224296d43ffdSmrg#
224396d43ffdSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
224496d43ffdSmrg#
224596d43ffdSmrg# OS and distros often splits groff in a basic and full package, the former
224696d43ffdSmrg# having the groff program and the later having devices, fonts and macros
224796d43ffdSmrg# Checking for the groff executable is not enough.
224831de2854Smrg#
224996d43ffdSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
225096d43ffdSmrg# unset HAVE_GROFF or GROFF env variables.
225196d43ffdSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
225231de2854Smrg#
225396d43ffdSmrgAC_DEFUN([XORG_WITH_GROFF],[
225496d43ffdSmrgAC_ARG_VAR([GROFF], [Path to groff command])
225596d43ffdSmrgm4_define([_defopt], m4_default([$1], [auto]))
225696d43ffdSmrgAC_ARG_WITH(groff,
225796d43ffdSmrg	AS_HELP_STRING([--with-groff],
225896d43ffdSmrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
225996d43ffdSmrg	   [use_groff=$withval], [use_groff=]_defopt)
226096d43ffdSmrgm4_undefine([_defopt])
226131de2854Smrg
226296d43ffdSmrgif test "x$use_groff" = x"auto"; then
226396d43ffdSmrg   AC_PATH_PROG([GROFF], [groff])
226496d43ffdSmrg   if test "x$GROFF" = "x"; then
226596d43ffdSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
226696d43ffdSmrg	have_groff=no
226796d43ffdSmrg   else
226896d43ffdSmrg        have_groff=yes
226996d43ffdSmrg   fi
227096d43ffdSmrgelif test "x$use_groff" = x"yes" ; then
227196d43ffdSmrg   AC_PATH_PROG([GROFF], [groff])
227296d43ffdSmrg   if test "x$GROFF" = "x"; then
227396d43ffdSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
227496d43ffdSmrg   fi
227596d43ffdSmrg   have_groff=yes
227696d43ffdSmrgelif test "x$use_groff" = x"no" ; then
227796d43ffdSmrg   if test "x$GROFF" != "x"; then
227896d43ffdSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
227996d43ffdSmrg   fi
228096d43ffdSmrg   have_groff=no
228196d43ffdSmrgelse
228296d43ffdSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
228396d43ffdSmrgfi
228431de2854Smrg
228596d43ffdSmrg# We have groff, test for the presence of the macro packages
228696d43ffdSmrgif test "x$have_groff" = x"yes"; then
228796d43ffdSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
228896d43ffdSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
228996d43ffdSmrg        groff_ms_works=yes
229096d43ffdSmrg    else
229196d43ffdSmrg        groff_ms_works=no
229296d43ffdSmrg    fi
229396d43ffdSmrg    AC_MSG_RESULT([$groff_ms_works])
229496d43ffdSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
229596d43ffdSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
229696d43ffdSmrg        groff_mm_works=yes
229796d43ffdSmrg    else
229896d43ffdSmrg        groff_mm_works=no
229996d43ffdSmrg    fi
230096d43ffdSmrg    AC_MSG_RESULT([$groff_mm_works])
230196d43ffdSmrgfi
230231de2854Smrg
230396d43ffdSmrg# We have groff, test for HTML dependencies, one command per package
230496d43ffdSmrgif test "x$have_groff" = x"yes"; then
230596d43ffdSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
230696d43ffdSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
230796d43ffdSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
230896d43ffdSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
230996d43ffdSmrg      have_groff_html=yes
231096d43ffdSmrg   else
231196d43ffdSmrg      have_groff_html=no
231296d43ffdSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
231396d43ffdSmrg   fi
2314f765521fSmrgfi
231531de2854Smrg
231696d43ffdSmrg# Set Automake conditionals for Makefiles
231796d43ffdSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
231896d43ffdSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
231996d43ffdSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
232096d43ffdSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
232196d43ffdSmrg]) # XORG_WITH_GROFF
232296d43ffdSmrg
232396d43ffdSmrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
232496d43ffdSmrg# ---------------------------------------
232596d43ffdSmrg# Minimum version: 1.6.0
232696d43ffdSmrg# Minimum version for optional DEFAULT argument: 1.11.0
232796d43ffdSmrg# Minimum version for optional MIN-VERSION argument: 1.15.0
232831de2854Smrg#
232996d43ffdSmrg# Documentation tools are not always available on all platforms and sometimes
233096d43ffdSmrg# not at the appropriate level. This macro enables a module to test for the
233196d43ffdSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
233296d43ffdSmrg# the --with-fop option, it allows maximum flexibilty in making decisions
233396d43ffdSmrg# as whether or not to use the fop package. When DEFAULT is not specified,
233496d43ffdSmrg# --with-fop assumes 'auto'.
233531de2854Smrg#
233696d43ffdSmrg# Interface to module:
233796d43ffdSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
233896d43ffdSmrg# FOP:	 	returns the path of the fop program found
233996d43ffdSmrg#		returns the path set by the user in the environment
234096d43ffdSmrg# --with-fop: 	'yes' user instructs the module to use fop
234196d43ffdSmrg#		'no' user instructs the module not to use fop
234231de2854Smrg#
234396d43ffdSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
234431de2854Smrg#
234596d43ffdSmrgAC_DEFUN([XORG_WITH_FOP],[
234696d43ffdSmrgAC_ARG_VAR([FOP], [Path to fop command])
234796d43ffdSmrgm4_define([_defopt], m4_default([$2], [auto]))
234896d43ffdSmrgAC_ARG_WITH(fop,
234996d43ffdSmrg	AS_HELP_STRING([--with-fop],
235096d43ffdSmrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
235196d43ffdSmrg	   [use_fop=$withval], [use_fop=]_defopt)
235296d43ffdSmrgm4_undefine([_defopt])
235331de2854Smrg
235496d43ffdSmrgif test "x$use_fop" = x"auto"; then
235596d43ffdSmrg   AC_PATH_PROG([FOP], [fop])
235696d43ffdSmrg   if test "x$FOP" = "x"; then
235796d43ffdSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
235896d43ffdSmrg	have_fop=no
235996d43ffdSmrg   else
236096d43ffdSmrg        have_fop=yes
236196d43ffdSmrg   fi
236296d43ffdSmrgelif test "x$use_fop" = x"yes" ; then
236396d43ffdSmrg   AC_PATH_PROG([FOP], [fop])
236496d43ffdSmrg   if test "x$FOP" = "x"; then
236596d43ffdSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
236696d43ffdSmrg   fi
236796d43ffdSmrg   have_fop=yes
236896d43ffdSmrgelif test "x$use_fop" = x"no" ; then
236996d43ffdSmrg   if test "x$FOP" != "x"; then
237096d43ffdSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
237196d43ffdSmrg   fi
237296d43ffdSmrg   have_fop=no
237396d43ffdSmrgelse
237496d43ffdSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
237596d43ffdSmrgfi
2376f765521fSmrg
237796d43ffdSmrg# Test for a minimum version of fop, if provided.
237896d43ffdSmrgm4_ifval([$1],
237996d43ffdSmrg[if test "$have_fop" = yes; then
238096d43ffdSmrg    # scrape the fop version
238196d43ffdSmrg    AC_MSG_CHECKING([for fop minimum version])
238296d43ffdSmrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
238396d43ffdSmrg    AC_MSG_RESULT([$fop_version])
238496d43ffdSmrg    AS_VERSION_COMPARE([$fop_version], [$1],
238596d43ffdSmrg        [if test "x$use_fop" = xauto; then
238696d43ffdSmrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
238796d43ffdSmrg            have_fop=no
238896d43ffdSmrg        else
238996d43ffdSmrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
239096d43ffdSmrg        fi])
239196d43ffdSmrgfi])
239296d43ffdSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
239396d43ffdSmrg]) # XORG_WITH_FOP
239496d43ffdSmrg
239596d43ffdSmrg# XORG_WITH_M4([MIN-VERSION])
239696d43ffdSmrg# ---------------------------
239796d43ffdSmrg# Minimum version: 1.19.0
239896d43ffdSmrg#
239996d43ffdSmrg# This macro attempts to locate an m4 macro processor which supports
240096d43ffdSmrg# -I option and is only useful for modules relying on M4 in order to
240196d43ffdSmrg# expand macros in source code files.
240296d43ffdSmrg#
240396d43ffdSmrg# Interface to module:
240496d43ffdSmrg# M4:	 	returns the path of the m4 program found
240596d43ffdSmrg#		returns the path set by the user in the environment
240696d43ffdSmrg#
240796d43ffdSmrgAC_DEFUN([XORG_WITH_M4], [
240896d43ffdSmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
240996d43ffdSmrg   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
241096d43ffdSmrg       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
241196d43ffdSmrg         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
241296d43ffdSmrg   [AC_MSG_ERROR([could not find m4 that supports -I option])],
241396d43ffdSmrg   [$PATH:/usr/gnu/bin])])
2414f765521fSmrg
241596d43ffdSmrgAC_SUBST([M4], [$ac_cv_path_M4])
241696d43ffdSmrg]) # XORG_WITH_M4
241796d43ffdSmrg
241896d43ffdSmrg# XORG_WITH_PS2PDF([DEFAULT])
2419f765521fSmrg# ----------------
242096d43ffdSmrg# Minimum version: 1.6.0
242196d43ffdSmrg# Minimum version for optional DEFAULT argument: 1.11.0
242231de2854Smrg#
242396d43ffdSmrg# Documentation tools are not always available on all platforms and sometimes
242496d43ffdSmrg# not at the appropriate level. This macro enables a module to test for the
242596d43ffdSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
242696d43ffdSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
242796d43ffdSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
242896d43ffdSmrg# --with-ps2pdf assumes 'auto'.
242931de2854Smrg#
243096d43ffdSmrg# Interface to module:
243196d43ffdSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
243296d43ffdSmrg# PS2PDF:	returns the path of the ps2pdf program found
243396d43ffdSmrg#		returns the path set by the user in the environment
243496d43ffdSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
243596d43ffdSmrg#		 'no' user instructs the module not to use ps2pdf
243631de2854Smrg#
243796d43ffdSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
243831de2854Smrg#
243996d43ffdSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
244096d43ffdSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
244196d43ffdSmrgm4_define([_defopt], m4_default([$1], [auto]))
244296d43ffdSmrgAC_ARG_WITH(ps2pdf,
244396d43ffdSmrg	AS_HELP_STRING([--with-ps2pdf],
244496d43ffdSmrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
244596d43ffdSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
244696d43ffdSmrgm4_undefine([_defopt])
2447f765521fSmrg
244896d43ffdSmrgif test "x$use_ps2pdf" = x"auto"; then
244996d43ffdSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
245096d43ffdSmrg   if test "x$PS2PDF" = "x"; then
245196d43ffdSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
245296d43ffdSmrg	have_ps2pdf=no
245396d43ffdSmrg   else
245496d43ffdSmrg        have_ps2pdf=yes
245596d43ffdSmrg   fi
245696d43ffdSmrgelif test "x$use_ps2pdf" = x"yes" ; then
245796d43ffdSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
245896d43ffdSmrg   if test "x$PS2PDF" = "x"; then
245996d43ffdSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
246096d43ffdSmrg   fi
246196d43ffdSmrg   have_ps2pdf=yes
246296d43ffdSmrgelif test "x$use_ps2pdf" = x"no" ; then
246396d43ffdSmrg   if test "x$PS2PDF" != "x"; then
246496d43ffdSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
246596d43ffdSmrg   fi
246696d43ffdSmrg   have_ps2pdf=no
246796d43ffdSmrgelse
246896d43ffdSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
246996d43ffdSmrgfi
247096d43ffdSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
247196d43ffdSmrg]) # XORG_WITH_PS2PDF
2472f765521fSmrg
247396d43ffdSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
247496d43ffdSmrg# ----------------
247596d43ffdSmrg# Minimum version: 1.6.0
247631de2854Smrg#
247796d43ffdSmrg# Documentation tools are not always available on all platforms and sometimes
247896d43ffdSmrg# not at the appropriate level. This macro enables a builder to skip all
247996d43ffdSmrg# documentation targets except traditional man pages.
248096d43ffdSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
248196d43ffdSmrg# maximum flexibilty in controlling documentation building.
248296d43ffdSmrg# Refer to:
248396d43ffdSmrg# XORG_WITH_XMLTO         --with-xmlto
248496d43ffdSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
248596d43ffdSmrg# XORG_WITH_DOXYGEN       --with-doxygen
248696d43ffdSmrg# XORG_WITH_FOP           --with-fop
248796d43ffdSmrg# XORG_WITH_GROFF         --with-groff
248896d43ffdSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
248996d43ffdSmrg#
249096d43ffdSmrg# Interface to module:
249196d43ffdSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
249296d43ffdSmrg# --enable-docs: 'yes' user instructs the module to generate docs
249396d43ffdSmrg#		 'no' user instructs the module not to generate docs
249496d43ffdSmrg# parm1:	specify the default value, yes or no.
249596d43ffdSmrg#
249696d43ffdSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
249796d43ffdSmrgm4_define([docs_default], m4_default([$1], [yes]))
249896d43ffdSmrgAC_ARG_ENABLE(docs,
249996d43ffdSmrg	AS_HELP_STRING([--enable-docs],
250096d43ffdSmrg	   [Enable building the documentation (default: ]docs_default[)]),
250196d43ffdSmrg	   [build_docs=$enableval], [build_docs=]docs_default)
250296d43ffdSmrgm4_undefine([docs_default])
250396d43ffdSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
250496d43ffdSmrgAC_MSG_CHECKING([whether to build documentation])
250596d43ffdSmrgAC_MSG_RESULT([$build_docs])
250696d43ffdSmrg]) # XORG_ENABLE_DOCS
2507f765521fSmrg
250896d43ffdSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
250996d43ffdSmrg# ----------------
251096d43ffdSmrg# Minimum version: 1.6.0
251131de2854Smrg#
251296d43ffdSmrg# This macro enables a builder to skip all developer documentation.
251396d43ffdSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
251496d43ffdSmrg# maximum flexibilty in controlling documentation building.
251596d43ffdSmrg# Refer to:
251696d43ffdSmrg# XORG_WITH_XMLTO         --with-xmlto
251796d43ffdSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
251896d43ffdSmrg# XORG_WITH_DOXYGEN       --with-doxygen
251996d43ffdSmrg# XORG_WITH_FOP           --with-fop
252096d43ffdSmrg# XORG_WITH_GROFF         --with-groff
252196d43ffdSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
252296d43ffdSmrg#
252396d43ffdSmrg# Interface to module:
252496d43ffdSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
252596d43ffdSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
252696d43ffdSmrg#			'no' user instructs the module not to generate developer docs
252796d43ffdSmrg# parm1:		specify the default value, yes or no.
252896d43ffdSmrg#
252996d43ffdSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
253096d43ffdSmrgm4_define([devel_default], m4_default([$1], [yes]))
253196d43ffdSmrgAC_ARG_ENABLE(devel-docs,
253296d43ffdSmrg	AS_HELP_STRING([--enable-devel-docs],
253396d43ffdSmrg	   [Enable building the developer documentation (default: ]devel_default[)]),
253496d43ffdSmrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
253596d43ffdSmrgm4_undefine([devel_default])
253696d43ffdSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
253796d43ffdSmrgAC_MSG_CHECKING([whether to build developer documentation])
253896d43ffdSmrgAC_MSG_RESULT([$build_devel_docs])
253996d43ffdSmrg]) # XORG_ENABLE_DEVEL_DOCS
2540f765521fSmrg
254196d43ffdSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
254296d43ffdSmrg# ----------------
254396d43ffdSmrg# Minimum version: 1.6.0
254431de2854Smrg#
254596d43ffdSmrg# This macro enables a builder to skip all functional specification targets.
254696d43ffdSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
254796d43ffdSmrg# maximum flexibilty in controlling documentation building.
254896d43ffdSmrg# Refer to:
254996d43ffdSmrg# XORG_WITH_XMLTO         --with-xmlto
255096d43ffdSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
255196d43ffdSmrg# XORG_WITH_DOXYGEN       --with-doxygen
255296d43ffdSmrg# XORG_WITH_FOP           --with-fop
255396d43ffdSmrg# XORG_WITH_GROFF         --with-groff
255496d43ffdSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
255596d43ffdSmrg#
255696d43ffdSmrg# Interface to module:
255796d43ffdSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
255896d43ffdSmrg# --enable-specs:	'yes' user instructs the module to generate specs
255996d43ffdSmrg#			'no' user instructs the module not to generate specs
256096d43ffdSmrg# parm1:		specify the default value, yes or no.
256196d43ffdSmrg#
256296d43ffdSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
256396d43ffdSmrgm4_define([spec_default], m4_default([$1], [yes]))
256496d43ffdSmrgAC_ARG_ENABLE(specs,
256596d43ffdSmrg	AS_HELP_STRING([--enable-specs],
256696d43ffdSmrg	   [Enable building the specs (default: ]spec_default[)]),
256796d43ffdSmrg	   [build_specs=$enableval], [build_specs=]spec_default)
256896d43ffdSmrgm4_undefine([spec_default])
256996d43ffdSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
257096d43ffdSmrgAC_MSG_CHECKING([whether to build functional specifications])
257196d43ffdSmrgAC_MSG_RESULT([$build_specs])
257296d43ffdSmrg]) # XORG_ENABLE_SPECS
257396d43ffdSmrg
257496d43ffdSmrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
257596d43ffdSmrg# ----------------------------------------------
257696d43ffdSmrg# Minimum version: 1.13.0
257731de2854Smrg#
257896d43ffdSmrg# This macro enables a builder to enable/disable unit testing
257996d43ffdSmrg# It makes no assumption about the test cases implementation
258096d43ffdSmrg# Test cases may or may not use Automake "Support for test suites"
258196d43ffdSmrg# They may or may not use the software utility library GLib
258231de2854Smrg#
258396d43ffdSmrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
258496d43ffdSmrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
258596d43ffdSmrg# The variable enable_unit_tests is used by other macros in this file.
258631de2854Smrg#
258796d43ffdSmrg# Interface to module:
258896d43ffdSmrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
258996d43ffdSmrg# enable_unit_tests:    used in configure.ac for additional configuration
259096d43ffdSmrg# --enable-unit-tests:	'yes' user instructs the module to build tests
259196d43ffdSmrg#			'no' user instructs the module not to build tests
259296d43ffdSmrg# parm1:		specify the default value, yes or no.
259331de2854Smrg#
259496d43ffdSmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
259596d43ffdSmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
259696d43ffdSmrgAC_BEFORE([$0], [XORG_LD_WRAP])
259796d43ffdSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
259896d43ffdSmrgm4_define([_defopt], m4_default([$1], [auto]))
259996d43ffdSmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
260096d43ffdSmrg	[Enable building unit test cases (default: ]_defopt[)]),
260196d43ffdSmrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
260296d43ffdSmrgm4_undefine([_defopt])
260396d43ffdSmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
260496d43ffdSmrgAC_MSG_CHECKING([whether to build unit test cases])
260596d43ffdSmrgAC_MSG_RESULT([$enable_unit_tests])
260696d43ffdSmrg]) # XORG_ENABLE_UNIT_TESTS
2607f765521fSmrg
260896d43ffdSmrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
260996d43ffdSmrg# ------------------------------------------------------
261096d43ffdSmrg# Minimum version: 1.17.0
261131de2854Smrg#
261296d43ffdSmrg# This macro enables a builder to enable/disable integration testing
261396d43ffdSmrg# It makes no assumption about the test cases' implementation
261496d43ffdSmrg# Test cases may or may not use Automake "Support for test suites"
261531de2854Smrg#
261696d43ffdSmrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
261796d43ffdSmrg# usually requires less dependencies and may be built and run under less
261896d43ffdSmrg# stringent environments than integration tests.
2619c05e22d7Smrg#
262096d43ffdSmrg# Interface to module:
262196d43ffdSmrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
262296d43ffdSmrg# enable_integration_tests:   used in configure.ac for additional configuration
262396d43ffdSmrg# --enable-integration-tests: 'yes' user instructs the module to build tests
262496d43ffdSmrg#                             'no' user instructs the module not to build tests
262596d43ffdSmrg# parm1:                      specify the default value, yes or no.
262696d43ffdSmrg#
262796d43ffdSmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
262896d43ffdSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
262996d43ffdSmrgm4_define([_defopt], m4_default([$1], [auto]))
263096d43ffdSmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
263196d43ffdSmrg	[Enable building integration test cases (default: ]_defopt[)]),
263296d43ffdSmrg	[enable_integration_tests=$enableval],
263396d43ffdSmrg	[enable_integration_tests=]_defopt)
263496d43ffdSmrgm4_undefine([_defopt])
263596d43ffdSmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
263696d43ffdSmrg	[test "x$enable_integration_tests" != xno])
263796d43ffdSmrgAC_MSG_CHECKING([whether to build unit test cases])
263896d43ffdSmrgAC_MSG_RESULT([$enable_integration_tests])
263996d43ffdSmrg]) # XORG_ENABLE_INTEGRATION_TESTS
2640c05e22d7Smrg
264196d43ffdSmrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
264296d43ffdSmrg# ----------------------------------------
264396d43ffdSmrg# Minimum version: 1.13.0
264496d43ffdSmrg#
264596d43ffdSmrg# GLib is a library which provides advanced data structures and functions.
264696d43ffdSmrg# This macro enables a module to test for the presence of Glib.
264796d43ffdSmrg#
264896d43ffdSmrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
264996d43ffdSmrg# Otherwise the value of $enable_unit_tests is blank.
265096d43ffdSmrg#
265196d43ffdSmrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
265296d43ffdSmrg# test support usually requires less dependencies and may be built and run under
265396d43ffdSmrg# less stringent environments than integration tests.
265496d43ffdSmrg#
265596d43ffdSmrg# Interface to module:
265696d43ffdSmrg# HAVE_GLIB: used in makefiles to conditionally build targets
265796d43ffdSmrg# with_glib: used in configure.ac to know if GLib has been found
265896d43ffdSmrg# --with-glib:	'yes' user instructs the module to use glib
265996d43ffdSmrg#		'no' user instructs the module not to use glib
266096d43ffdSmrg#
266196d43ffdSmrgAC_DEFUN([XORG_WITH_GLIB],[
266296d43ffdSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
266396d43ffdSmrgm4_define([_defopt], m4_default([$2], [auto]))
266496d43ffdSmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
266596d43ffdSmrg	[Use GLib library for unit testing (default: ]_defopt[)]),
266696d43ffdSmrg	[with_glib=$withval], [with_glib=]_defopt)
266796d43ffdSmrgm4_undefine([_defopt])
26685dfecf96Smrg
266996d43ffdSmrghave_glib=no
267096d43ffdSmrg# Do not probe GLib if user explicitly disabled unit testing
267196d43ffdSmrgif test "x$enable_unit_tests" != x"no"; then
267296d43ffdSmrg  # Do not probe GLib if user explicitly disabled it
267396d43ffdSmrg  if test "x$with_glib" != x"no"; then
267496d43ffdSmrg    m4_ifval(
267596d43ffdSmrg      [$1],
267696d43ffdSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
267796d43ffdSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
267896d43ffdSmrg    )
267996d43ffdSmrg  fi
268096d43ffdSmrgfi
26815dfecf96Smrg
268296d43ffdSmrg# Not having GLib when unit testing has been explicitly requested is an error
268396d43ffdSmrgif test "x$enable_unit_tests" = x"yes"; then
268496d43ffdSmrg  if test "x$have_glib" = x"no"; then
268596d43ffdSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
268696d43ffdSmrg  fi
268796d43ffdSmrgfi
26885dfecf96Smrg
268996d43ffdSmrg# Having unit testing disabled when GLib has been explicitly requested is an error
269096d43ffdSmrgif test "x$enable_unit_tests" = x"no"; then
269196d43ffdSmrg  if test "x$with_glib" = x"yes"; then
269296d43ffdSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
269396d43ffdSmrg  fi
269496d43ffdSmrgfi
26955dfecf96Smrg
269696d43ffdSmrg# Not having GLib when it has been explicitly requested is an error
269796d43ffdSmrgif test "x$with_glib" = x"yes"; then
269896d43ffdSmrg  if test "x$have_glib" = x"no"; then
269996d43ffdSmrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
270096d43ffdSmrg  fi
27015dfecf96Smrgfi
27025dfecf96Smrg
270396d43ffdSmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
270496d43ffdSmrg]) # XORG_WITH_GLIB
27055dfecf96Smrg
270696d43ffdSmrg# XORG_LD_WRAP([required|optional])
270796d43ffdSmrg# ---------------------------------
270896d43ffdSmrg# Minimum version: 1.13.0
270931de2854Smrg#
271096d43ffdSmrg# Check if linker supports -wrap, passed via compiler flags
271131de2854Smrg#
271296d43ffdSmrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
271396d43ffdSmrg# Otherwise the value of $enable_unit_tests is blank.
2714f765521fSmrg#
271596d43ffdSmrg# Argument added in 1.16.0 - default is "required", to match existing behavior
271696d43ffdSmrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
271796d43ffdSmrg# available, an argument of "optional" allows use when some unit tests require
271896d43ffdSmrg# ld -wrap and others do not.
271996d43ffdSmrg#
272096d43ffdSmrgAC_DEFUN([XORG_LD_WRAP],[
272196d43ffdSmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
272296d43ffdSmrg    [AC_LANG_PROGRAM([#include <stdlib.h>
272396d43ffdSmrg                      void __wrap_exit(int status) { return; }],
272496d43ffdSmrg                     [exit(0);])])
272596d43ffdSmrg# Not having ld wrap when unit testing has been explicitly requested is an error
272696d43ffdSmrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
272796d43ffdSmrg  if test "x$have_ld_wrap" = x"no"; then
272896d43ffdSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
2729f765521fSmrg  fi
273031de2854Smrgfi
273196d43ffdSmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
273296d43ffdSmrg#
273396d43ffdSmrg]) # XORG_LD_WRAP
273496d43ffdSmrg
273596d43ffdSmrg# XORG_CHECK_LINKER_FLAGS
273696d43ffdSmrg# -----------------------
273796d43ffdSmrg# SYNOPSIS
273896d43ffdSmrg#
273996d43ffdSmrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
274096d43ffdSmrg#
274196d43ffdSmrg# DESCRIPTION
274296d43ffdSmrg#
274396d43ffdSmrg#   Check whether the given linker FLAGS work with the current language's
274496d43ffdSmrg#   linker, or whether they give an error.
274596d43ffdSmrg#
274696d43ffdSmrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
274796d43ffdSmrg#   success/failure.
274896d43ffdSmrg#
274996d43ffdSmrg#   PROGRAM-SOURCE is the program source to link with, if needed
275096d43ffdSmrg#
275196d43ffdSmrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
275296d43ffdSmrg#
275396d43ffdSmrg# LICENSE
275496d43ffdSmrg#
275596d43ffdSmrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
275696d43ffdSmrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
275796d43ffdSmrg#   Copyright (c) 2009 Matteo Frigo
275896d43ffdSmrg#
275996d43ffdSmrg#   This program is free software: you can redistribute it and/or modify it
276096d43ffdSmrg#   under the terms of the GNU General Public License as published by the
276196d43ffdSmrg#   Free Software Foundation, either version 3 of the License, or (at your
276296d43ffdSmrg#   option) any later version.
276396d43ffdSmrg#
276496d43ffdSmrg#   This program is distributed in the hope that it will be useful, but
276596d43ffdSmrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
276696d43ffdSmrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
276796d43ffdSmrg#   Public License for more details.
276896d43ffdSmrg#
276996d43ffdSmrg#   You should have received a copy of the GNU General Public License along
277096d43ffdSmrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
277196d43ffdSmrg#
277296d43ffdSmrg#   As a special exception, the respective Autoconf Macro's copyright owner
277396d43ffdSmrg#   gives unlimited permission to copy, distribute and modify the configure
277496d43ffdSmrg#   scripts that are the output of Autoconf when processing the Macro. You
277596d43ffdSmrg#   need not follow the terms of the GNU General Public License when using
277696d43ffdSmrg#   or distributing such scripts, even though portions of the text of the
277796d43ffdSmrg#   Macro appear in them. The GNU General Public License (GPL) does govern
277896d43ffdSmrg#   all other use of the material that constitutes the Autoconf Macro.
277996d43ffdSmrg#
278096d43ffdSmrg#   This special exception to the GPL applies to versions of the Autoconf
278196d43ffdSmrg#   Macro released by the Autoconf Archive. When you make and distribute a
278296d43ffdSmrg#   modified version of the Autoconf Macro, you may extend this special
278396d43ffdSmrg#   exception to the GPL to apply to your modified version as well.#
278496d43ffdSmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
278596d43ffdSmrg[AC_MSG_CHECKING([whether the linker accepts $1])
278696d43ffdSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
278796d43ffdSmrgAS_LITERAL_IF([$1],
278896d43ffdSmrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
278996d43ffdSmrg      ax_save_FLAGS=$LDFLAGS
279096d43ffdSmrg      LDFLAGS="$1"
279196d43ffdSmrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
279296d43ffdSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
279396d43ffdSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
279496d43ffdSmrg      LDFLAGS=$ax_save_FLAGS])],
279596d43ffdSmrg  [ax_save_FLAGS=$LDFLAGS
279696d43ffdSmrg   LDFLAGS="$1"
279796d43ffdSmrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
279896d43ffdSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
279996d43ffdSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
280096d43ffdSmrg   LDFLAGS=$ax_save_FLAGS])
280196d43ffdSmrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
280296d43ffdSmrgAC_MSG_RESULT($xorg_check_linker_flags)
280396d43ffdSmrgif test "x$xorg_check_linker_flags" = xyes; then
280496d43ffdSmrg	m4_default([$2], :)
280596d43ffdSmrgelse
280696d43ffdSmrg	m4_default([$3], :)
280796d43ffdSmrgfi
280896d43ffdSmrg]) # XORG_CHECK_LINKER_FLAGS
280931de2854Smrg
281096d43ffdSmrg# XORG_MEMORY_CHECK_FLAGS
281196d43ffdSmrg# -----------------------
281296d43ffdSmrg# Minimum version: 1.16.0
281396d43ffdSmrg#
281496d43ffdSmrg# This macro attempts to find appropriate memory checking functionality
281596d43ffdSmrg# for various platforms which unit testing code may use to catch various
281696d43ffdSmrg# forms of memory allocation and access errors in testing.
281796d43ffdSmrg#
281896d43ffdSmrg# Interface to module:
281996d43ffdSmrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
282096d43ffdSmrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
282196d43ffdSmrg#
282296d43ffdSmrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
282396d43ffdSmrg#
282496d43ffdSmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
282531de2854Smrg
282696d43ffdSmrgAC_REQUIRE([AC_CANONICAL_HOST])
282796d43ffdSmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
282896d43ffdSmrg           [Environment variables to enable memory checking in tests])
282931de2854Smrg
283096d43ffdSmrg# Check for different types of support on different platforms
283196d43ffdSmrgcase $host_os in
283296d43ffdSmrg    solaris*)
283396d43ffdSmrg        AC_CHECK_LIB([umem], [umem_alloc],
283496d43ffdSmrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
283596d43ffdSmrg        ;;
283696d43ffdSmrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
283796d43ffdSmrg        # both directly and inverted, so should not be 0 or 255.
283896d43ffdSmrg        malloc_debug_env='MALLOC_PERTURB_=15'
283996d43ffdSmrg        ;;
284096d43ffdSmrg    darwin*)
284196d43ffdSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
284296d43ffdSmrg        ;;
284396d43ffdSmrg    *bsd*)
284496d43ffdSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
284596d43ffdSmrg        ;;
284696d43ffdSmrgesac
284731de2854Smrg
284896d43ffdSmrg# User supplied flags override default flags
284996d43ffdSmrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
285096d43ffdSmrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
285196d43ffdSmrgfi
285231de2854Smrg
285396d43ffdSmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
285496d43ffdSmrg]) # XORG_WITH_LINT
2855f765521fSmrg
285696d43ffdSmrg# XORG_CHECK_MALLOC_ZERO
285796d43ffdSmrg# ----------------------
285896d43ffdSmrg# Minimum version: 1.0.0
285996d43ffdSmrg#
286096d43ffdSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
286196d43ffdSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
286296d43ffdSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
286396d43ffdSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
286496d43ffdSmrgAC_ARG_ENABLE(malloc0returnsnull,
286596d43ffdSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
286696d43ffdSmrg		       [malloc(0) returns NULL (default: auto)]),
286796d43ffdSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
286896d43ffdSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
2869f765521fSmrg
287096d43ffdSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
287196d43ffdSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
287296d43ffdSmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null],
287396d43ffdSmrg	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
287496d43ffdSmrg#include <stdlib.h>
287596d43ffdSmrg],[
287696d43ffdSmrg    char *m0, *r0, *c0, *p;
287796d43ffdSmrg    m0 = malloc(0);
287896d43ffdSmrg    p = malloc(10);
287996d43ffdSmrg    r0 = realloc(p,0);
288096d43ffdSmrg    c0 = calloc(0,10);
288196d43ffdSmrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
288296d43ffdSmrg])],
288396d43ffdSmrg		[xorg_cv_malloc0_returns_null=yes],
288496d43ffdSmrg		[xorg_cv_malloc0_returns_null=no])])
288596d43ffdSmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
288696d43ffdSmrgfi
288796d43ffdSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
2888f765521fSmrg
288996d43ffdSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
289096d43ffdSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
289196d43ffdSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
289296d43ffdSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
289396d43ffdSmrgelse
289496d43ffdSmrg	MALLOC_ZERO_CFLAGS=""
289596d43ffdSmrg	XMALLOC_ZERO_CFLAGS=""
289696d43ffdSmrg	XTMALLOC_ZERO_CFLAGS=""
289796d43ffdSmrgfi
289896d43ffdSmrg
289996d43ffdSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
290096d43ffdSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
290196d43ffdSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
290296d43ffdSmrg]) # XORG_CHECK_MALLOC_ZERO
290331de2854Smrg
290496d43ffdSmrg# XORG_WITH_LINT()
290596d43ffdSmrg# ----------------
290696d43ffdSmrg# Minimum version: 1.1.0
2907f765521fSmrg#
290896d43ffdSmrg# This macro enables the use of a tool that flags some suspicious and
290996d43ffdSmrg# non-portable constructs (likely to be bugs) in C language source code.
291096d43ffdSmrg# It will attempt to locate the tool and use appropriate options.
291196d43ffdSmrg# There are various lint type tools on different platforms.
291296d43ffdSmrg#
291396d43ffdSmrg# Interface to module:
291496d43ffdSmrg# LINT:		returns the path to the tool found on the platform
291596d43ffdSmrg#		or the value set to LINT on the configure cmd line
291696d43ffdSmrg#		also an Automake conditional
291796d43ffdSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
291896d43ffdSmrg#
291996d43ffdSmrg# --with-lint:	'yes' user instructs the module to use lint
292096d43ffdSmrg#		'no' user instructs the module not to use lint (default)
292196d43ffdSmrg#
292296d43ffdSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
292396d43ffdSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
292496d43ffdSmrg#
292596d43ffdSmrgAC_DEFUN([XORG_WITH_LINT],[
292631de2854Smrg
292796d43ffdSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
292896d43ffdSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
292996d43ffdSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
293096d43ffdSmrg		[Use a lint-style source code checker (default: disabled)])],
293196d43ffdSmrg		[use_lint=$withval], [use_lint=no])
293231de2854Smrg
293396d43ffdSmrg# Obtain platform specific info like program name and options
293496d43ffdSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
293596d43ffdSmrgcase $host_os in
293696d43ffdSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
293796d43ffdSmrg	lint_name=splint
293896d43ffdSmrg	lint_options="-badflag"
293996d43ffdSmrg	;;
294096d43ffdSmrg  *freebsd* | *netbsd*)
294196d43ffdSmrg	lint_name=lint
294296d43ffdSmrg	lint_options="-u -b"
294396d43ffdSmrg	;;
294496d43ffdSmrg  *solaris*)
294596d43ffdSmrg	lint_name=lint
294696d43ffdSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
294796d43ffdSmrg	;;
294896d43ffdSmrgesac
294931de2854Smrg
295096d43ffdSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
295196d43ffdSmrgif test "x$use_lint" = x"yes" ; then
295296d43ffdSmrg   AC_PATH_PROG([LINT], [$lint_name])
295396d43ffdSmrg   if test "x$LINT" = "x"; then
295496d43ffdSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
295596d43ffdSmrg   fi
295696d43ffdSmrgelif test "x$use_lint" = x"no" ; then
295796d43ffdSmrg   if test "x$LINT" != "x"; then
295896d43ffdSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
295996d43ffdSmrg   fi
296031de2854Smrgelse
296196d43ffdSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
296231de2854Smrgfi
296331de2854Smrg
296496d43ffdSmrg# User supplied flags override default flags
296596d43ffdSmrgif test "x$LINT_FLAGS" != "x"; then
296696d43ffdSmrg   lint_options=$LINT_FLAGS
296796d43ffdSmrgfi
296831de2854Smrg
296996d43ffdSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
297096d43ffdSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
297131de2854Smrg
297296d43ffdSmrg]) # XORG_WITH_LINT
297331de2854Smrg
297496d43ffdSmrg# XORG_LINT_LIBRARY(LIBNAME)
297596d43ffdSmrg# --------------------------
297696d43ffdSmrg# Minimum version: 1.1.0
2977f765521fSmrg#
297896d43ffdSmrg# Sets up flags for building lint libraries for checking programs that call
297996d43ffdSmrg# functions in the library.
2980c05e22d7Smrg#
298196d43ffdSmrg# Interface to module:
298296d43ffdSmrg# LINTLIB		- Automake variable with the name of lint library file to make
298396d43ffdSmrg# MAKE_LINT_LIB		- Automake conditional
298496d43ffdSmrg#
298596d43ffdSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
298696d43ffdSmrg#			  - 'no' user instructs the module not to create a lint library (default)
2987f765521fSmrg
298896d43ffdSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
298996d43ffdSmrgAC_REQUIRE([XORG_WITH_LINT])
299096d43ffdSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
299196d43ffdSmrg	[Create lint library (default: disabled)])],
299296d43ffdSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
2993c05e22d7Smrg
299496d43ffdSmrgif test "x$make_lint_lib" = x"yes" ; then
299596d43ffdSmrg   LINTLIB=llib-l$1.ln
299696d43ffdSmrg   if test "x$LINT" = "x"; then
299796d43ffdSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
299896d43ffdSmrg   fi
299996d43ffdSmrgelif test "x$make_lint_lib" != x"no" ; then
300096d43ffdSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
300196d43ffdSmrgfi
300231de2854Smrg
300396d43ffdSmrgAC_SUBST(LINTLIB)
300496d43ffdSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
300531de2854Smrg
300696d43ffdSmrg]) # XORG_LINT_LIBRARY
300731de2854Smrg
300896d43ffdSmrg# XORG_COMPILER_BRAND
300996d43ffdSmrg# -------------------
301096d43ffdSmrg# Minimum version: 1.14.0
3011f765521fSmrg#
301296d43ffdSmrg# Checks for various brands of compilers and sets flags as appropriate:
301396d43ffdSmrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
301496d43ffdSmrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
301596d43ffdSmrg#   clang compiler - sets CLANGCC to "yes"
301696d43ffdSmrg#   Intel compiler - sets INTELCC to "yes"
301796d43ffdSmrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
301896d43ffdSmrg#
301996d43ffdSmrgAC_DEFUN([XORG_COMPILER_BRAND], [
302096d43ffdSmrgAC_LANG_CASE(
302196d43ffdSmrg	[C], [
302296d43ffdSmrg		AC_REQUIRE([AC_PROG_CC_C99])
302396d43ffdSmrg	],
302496d43ffdSmrg	[C++], [
302596d43ffdSmrg		AC_REQUIRE([AC_PROG_CXX])
302696d43ffdSmrg	]
302796d43ffdSmrg)
302896d43ffdSmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
302996d43ffdSmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
303096d43ffdSmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
303196d43ffdSmrg]) # XORG_COMPILER_BRAND
303231de2854Smrg
303396d43ffdSmrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
3034f765521fSmrg# ---------------
303596d43ffdSmrg# Minimum version: 1.16.0
303696d43ffdSmrg#
303796d43ffdSmrg# Test if the compiler works when passed the given flag as a command line argument.
303896d43ffdSmrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
303996d43ffdSmrg# next flag in the list until there are no more options.
304096d43ffdSmrg#
304196d43ffdSmrg# Note that this does not guarantee that the compiler supports the flag as some
304296d43ffdSmrg# compilers will simply ignore arguments that they do not understand, but we do
304396d43ffdSmrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
304496d43ffdSmrg# -Werror=unused-command-line-argument
304596d43ffdSmrg#
304696d43ffdSmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
304796d43ffdSmrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
304896d43ffdSmrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
3049f765521fSmrg
305096d43ffdSmrgAC_LANG_COMPILER_REQUIRE
3051f765521fSmrg
305296d43ffdSmrgAC_LANG_CASE(
305396d43ffdSmrg	[C], [
305496d43ffdSmrg		AC_REQUIRE([AC_PROG_CC_C99])
305596d43ffdSmrg		define([PREFIX], [C])
305696d43ffdSmrg		define([CACHE_PREFIX], [cc])
305796d43ffdSmrg		define([COMPILER], [$CC])
305896d43ffdSmrg	],
305996d43ffdSmrg	[C++], [
306096d43ffdSmrg		define([PREFIX], [CXX])
306196d43ffdSmrg		define([CACHE_PREFIX], [cxx])
306296d43ffdSmrg		define([COMPILER], [$CXX])
306396d43ffdSmrg	]
306496d43ffdSmrg)
306596d43ffdSmrg
306696d43ffdSmrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
306796d43ffdSmrg
306896d43ffdSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
306996d43ffdSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
307096d43ffdSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
307196d43ffdSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
307296d43ffdSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
307396d43ffdSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
307496d43ffdSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
307596d43ffdSmrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
307696d43ffdSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
3077f765521fSmrgfi
307896d43ffdSmrg
307996d43ffdSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
308096d43ffdSmrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
308196d43ffdSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
308296d43ffdSmrg	fi
308396d43ffdSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
308496d43ffdSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
308596d43ffdSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
308696d43ffdSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
308796d43ffdSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
308896d43ffdSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
308996d43ffdSmrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
309096d43ffdSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
309196d43ffdSmrgfi
309296d43ffdSmrg
309396d43ffdSmrgfound="no"
309496d43ffdSmrgm4_foreach([flag], m4_cdr($@), [
309596d43ffdSmrg	if test $found = "no" ; then
309696d43ffdSmrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
309796d43ffdSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
309896d43ffdSmrg		fi
309996d43ffdSmrg
310096d43ffdSmrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
310196d43ffdSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
310296d43ffdSmrg		fi
310396d43ffdSmrg
310496d43ffdSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
310596d43ffdSmrg
310696d43ffdSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
310796d43ffdSmrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
310896d43ffdSmrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
310996d43ffdSmrg		AC_CACHE_VAL($cacheid,
311096d43ffdSmrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
311196d43ffdSmrg					     [eval $cacheid=yes],
311296d43ffdSmrg					     [eval $cacheid=no])])
311396d43ffdSmrg
311496d43ffdSmrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
311596d43ffdSmrg
311696d43ffdSmrg		eval supported=\$$cacheid
311796d43ffdSmrg		AC_MSG_RESULT([$supported])
311896d43ffdSmrg		if test "$supported" = "yes" ; then
311996d43ffdSmrg			$1="$$1 ]flag["
312096d43ffdSmrg			found="yes"
312196d43ffdSmrg		fi
312296d43ffdSmrg	fi
3123f765521fSmrg])
312496d43ffdSmrg]) # XORG_TESTSET_CFLAG
31255dfecf96Smrg
312696d43ffdSmrg# XORG_COMPILER_FLAGS
312796d43ffdSmrg# ---------------
312896d43ffdSmrg# Minimum version: 1.16.0
3129c05e22d7Smrg#
313096d43ffdSmrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
313196d43ffdSmrg# arguments supported by the selected compiler which do NOT alter the generated
313296d43ffdSmrg# code.  These arguments will cause the compiler to print various warnings
313396d43ffdSmrg# during compilation AND turn a conservative set of warnings into errors.
313496d43ffdSmrg#
313596d43ffdSmrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
313696d43ffdSmrg# future versions of util-macros as options are added to new compilers.
313796d43ffdSmrg#
313896d43ffdSmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
313996d43ffdSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
3140f765521fSmrg
314196d43ffdSmrgAC_ARG_ENABLE(selective-werror,
314296d43ffdSmrg              AS_HELP_STRING([--disable-selective-werror],
314396d43ffdSmrg                             [Turn off selective compiler errors. (default: enabled)]),
314496d43ffdSmrg              [SELECTIVE_WERROR=$enableval],
314596d43ffdSmrg              [SELECTIVE_WERROR=yes])
314696d43ffdSmrg
314796d43ffdSmrgAC_LANG_CASE(
314896d43ffdSmrg        [C], [
314996d43ffdSmrg                define([PREFIX], [C])
315096d43ffdSmrg        ],
315196d43ffdSmrg        [C++], [
315296d43ffdSmrg                define([PREFIX], [CXX])
315396d43ffdSmrg        ]
315496d43ffdSmrg)
315596d43ffdSmrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
315696d43ffdSmrgif test "x$SUNCC" = "xyes"; then
315796d43ffdSmrg    [BASE_]PREFIX[FLAGS]="-v"
3158f765521fSmrgelse
315996d43ffdSmrg    [BASE_]PREFIX[FLAGS]=""
3160f765521fSmrgfi
3161f765521fSmrg
316296d43ffdSmrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
316396d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
316496d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
316596d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
316696d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
3167c05e22d7Smrg
316896d43ffdSmrgAC_LANG_CASE(
316996d43ffdSmrg	[C], [
317096d43ffdSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
317196d43ffdSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
317296d43ffdSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
317396d43ffdSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
317496d43ffdSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
317596d43ffdSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
317696d43ffdSmrg	]
317796d43ffdSmrg)
3178f765521fSmrg
317996d43ffdSmrg# This chunk adds additional warnings that could catch undesired effects.
318096d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
318196d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
318296d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
318396d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
318496d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
318596d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
318696d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
3187f765521fSmrg
318896d43ffdSmrg# These are currently disabled because they are noisy.  They will be enabled
318996d43ffdSmrg# in the future once the codebase is sufficiently modernized to silence
319096d43ffdSmrg# them.  For now, I don't want them to drown out the other warnings.
319196d43ffdSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
319296d43ffdSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
319396d43ffdSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
3194f765521fSmrg
319596d43ffdSmrg# Turn some warnings into errors, so we don't accidently get successful builds
319696d43ffdSmrg# when there are problems that should be fixed.
3197f765521fSmrg
319896d43ffdSmrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
319996d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
320096d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
320196d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
320296d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
320396d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
320496d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
320596d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
320696d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
320796d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
320896d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
320996d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
321096d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
321196d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
321296d43ffdSmrgelse
321396d43ffdSmrgAC_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])
321496d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
321596d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
321696d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
321796d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
321896d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
321996d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
322096d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
322196d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
322296d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
322396d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
322496d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
322596d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
322696d43ffdSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
322796d43ffdSmrgfi
3228f765521fSmrg
322996d43ffdSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
323096d43ffdSmrg]) # XORG_COMPILER_FLAGS
32315dfecf96Smrg
323296d43ffdSmrg# XORG_CWARNFLAGS
323396d43ffdSmrg# ---------------
323496d43ffdSmrg# Minimum version: 1.2.0
323596d43ffdSmrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
3236c05e22d7Smrg#
323796d43ffdSmrg# Defines CWARNFLAGS to enable C compiler warnings.
3238c05e22d7Smrg#
323996d43ffdSmrg# This function is deprecated because it defines -fno-strict-aliasing
324096d43ffdSmrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
324196d43ffdSmrg# is needed, then it should be added explicitly in the module when
324296d43ffdSmrg# it is updated to use BASE_CFLAGS.
3243c05e22d7Smrg#
324496d43ffdSmrgAC_DEFUN([XORG_CWARNFLAGS], [
324596d43ffdSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
324696d43ffdSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
324796d43ffdSmrgAC_LANG_CASE(
324896d43ffdSmrg	[C], [
324996d43ffdSmrg		CWARNFLAGS="$BASE_CFLAGS"
325096d43ffdSmrg		if  test "x$GCC" = xyes ; then
325196d43ffdSmrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
325296d43ffdSmrg		fi
325396d43ffdSmrg		AC_SUBST(CWARNFLAGS)
325496d43ffdSmrg	]
325596d43ffdSmrg)
325696d43ffdSmrg]) # XORG_CWARNFLAGS
3257f765521fSmrg
325896d43ffdSmrg# XORG_STRICT_OPTION
325996d43ffdSmrg# -----------------------
326096d43ffdSmrg# Minimum version: 1.3.0
326196d43ffdSmrg#
326296d43ffdSmrg# Add configure option to enable strict compilation flags, such as treating
326396d43ffdSmrg# warnings as fatal errors.
326496d43ffdSmrg# If --enable-strict-compilation is passed to configure, adds strict flags to
326596d43ffdSmrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
326696d43ffdSmrg#
326796d43ffdSmrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
326896d43ffdSmrg# when strict compilation is unconditionally desired.
326996d43ffdSmrgAC_DEFUN([XORG_STRICT_OPTION], [
327096d43ffdSmrgAC_REQUIRE([XORG_CWARNFLAGS])
327196d43ffdSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
3272f765521fSmrg
327396d43ffdSmrgAC_ARG_ENABLE(strict-compilation,
327496d43ffdSmrg			  AS_HELP_STRING([--enable-strict-compilation],
327596d43ffdSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
327696d43ffdSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
3277f765521fSmrg
327896d43ffdSmrgAC_LANG_CASE(
327996d43ffdSmrg        [C], [
328096d43ffdSmrg                define([PREFIX], [C])
328196d43ffdSmrg        ],
328296d43ffdSmrg        [C++], [
328396d43ffdSmrg                define([PREFIX], [CXX])
328496d43ffdSmrg        ]
328596d43ffdSmrg)
3286f765521fSmrg
328796d43ffdSmrg[STRICT_]PREFIX[FLAGS]=""
328896d43ffdSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
328996d43ffdSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
3290f765521fSmrg
329196d43ffdSmrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
329296d43ffdSmrg# activate it with -Werror, so we add it here explicitly.
329396d43ffdSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
3294f765521fSmrg
329596d43ffdSmrgif test "x$STRICT_COMPILE" = "xyes"; then
329696d43ffdSmrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
329796d43ffdSmrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
329896d43ffdSmrgfi
329996d43ffdSmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
330096d43ffdSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
330196d43ffdSmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
330296d43ffdSmrg]) # XORG_STRICT_OPTION
3303f765521fSmrg
330496d43ffdSmrg# XORG_DEFAULT_OPTIONS
330596d43ffdSmrg# --------------------
330696d43ffdSmrg# Minimum version: 1.3.0
330796d43ffdSmrg#
330896d43ffdSmrg# Defines default options for X.Org modules.
330996d43ffdSmrg#
331096d43ffdSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
331196d43ffdSmrgAC_REQUIRE([AC_PROG_INSTALL])
331296d43ffdSmrgXORG_COMPILER_FLAGS
331396d43ffdSmrgXORG_CWARNFLAGS
331496d43ffdSmrgXORG_STRICT_OPTION
331596d43ffdSmrgXORG_RELEASE_VERSION
331696d43ffdSmrgXORG_CHANGELOG
331796d43ffdSmrgXORG_INSTALL
331896d43ffdSmrgXORG_MANPAGE_SECTIONS
331996d43ffdSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
332096d43ffdSmrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
332196d43ffdSmrg]) # XORG_DEFAULT_OPTIONS
3322f765521fSmrg
332396d43ffdSmrg# XORG_INSTALL()
332496d43ffdSmrg# ----------------
332596d43ffdSmrg# Minimum version: 1.4.0
332696d43ffdSmrg#
332796d43ffdSmrg# Defines the variable INSTALL_CMD as the command to copy
332896d43ffdSmrg# INSTALL from $prefix/share/util-macros.
332996d43ffdSmrg#
333096d43ffdSmrgAC_DEFUN([XORG_INSTALL], [
333196d43ffdSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
333296d43ffdSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
333396d43ffdSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
333496d43ffdSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
333596d43ffdSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; test -e \$(top_srcdir)/INSTALL || ( \
333696d43ffdSmrgtouch \$(top_srcdir)/INSTALL; \
333796d43ffdSmrgecho 'failed to copy INSTALL from util-macros: installing empty INSTALL.' >&2))"
333896d43ffdSmrgAC_SUBST([INSTALL_CMD])
333996d43ffdSmrg]) # XORG_INSTALL
334096d43ffdSmrgdnl Copyright 2005 Red Hat, Inc
334196d43ffdSmrgdnl
334296d43ffdSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
334396d43ffdSmrgdnl documentation for any purpose is hereby granted without fee, provided that
334496d43ffdSmrgdnl the above copyright notice appear in all copies and that both that
334596d43ffdSmrgdnl copyright notice and this permission notice appear in supporting
334696d43ffdSmrgdnl documentation.
334796d43ffdSmrgdnl
334896d43ffdSmrgdnl The above copyright notice and this permission notice shall be included
334996d43ffdSmrgdnl in all copies or substantial portions of the Software.
335096d43ffdSmrgdnl
335196d43ffdSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
335296d43ffdSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
335396d43ffdSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
335496d43ffdSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
335596d43ffdSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
335696d43ffdSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
335796d43ffdSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
335896d43ffdSmrgdnl
335996d43ffdSmrgdnl Except as contained in this notice, the name of the copyright holders shall
336096d43ffdSmrgdnl not be used in advertising or otherwise to promote the sale, use or
336196d43ffdSmrgdnl other dealings in this Software without prior written authorization
336296d43ffdSmrgdnl from the copyright holders.
336396d43ffdSmrgdnl
3364f765521fSmrg
336596d43ffdSmrg# XORG_RELEASE_VERSION
336696d43ffdSmrg# --------------------
336796d43ffdSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
3368f765521fSmrg
336996d43ffdSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
337096d43ffdSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
337196d43ffdSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
337296d43ffdSmrg		[Major version of this package])
337396d43ffdSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
337496d43ffdSmrg	if test "x$PVM" = "x"; then
337596d43ffdSmrg		PVM="0"
337696d43ffdSmrg	fi
337796d43ffdSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
337896d43ffdSmrg		[$PVM],
337996d43ffdSmrg		[Minor version of this package])
338096d43ffdSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
338196d43ffdSmrg	if test "x$PVP" = "x"; then
338296d43ffdSmrg		PVP="0"
338396d43ffdSmrg	fi
338496d43ffdSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
338596d43ffdSmrg		[$PVP],
338696d43ffdSmrg		[Patch version of this package])
338796d43ffdSmrg])
3388f765521fSmrg
338996d43ffdSmrg# XORG_CHANGELOG()
339096d43ffdSmrg# ----------------
339196d43ffdSmrg# Minimum version: 1.2.0
339296d43ffdSmrg#
339396d43ffdSmrg# Defines the variable CHANGELOG_CMD as the command to generate
339496d43ffdSmrg# ChangeLog from git.
339596d43ffdSmrg#
339696d43ffdSmrg#
339796d43ffdSmrgAC_DEFUN([XORG_CHANGELOG], [
339896d43ffdSmrgCHANGELOG_CMD="((GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp) 2>/dev/null && \
339996d43ffdSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
340096d43ffdSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; test -e \$(top_srcdir)/ChangeLog || ( \
340196d43ffdSmrgtouch \$(top_srcdir)/ChangeLog; \
340296d43ffdSmrgecho 'git failed to create ChangeLog: installing empty ChangeLog.' >&2))"
340396d43ffdSmrgAC_SUBST([CHANGELOG_CMD])
340496d43ffdSmrg]) # XORG_CHANGELOG
34055dfecf96Smrg
3406