100ca1914Smrg# generated automatically by aclocal 1.17 -*- Autoconf -*-
21bedbe3fSmrg
300ca1914Smrg# Copyright (C) 1996-2024 Free Software Foundation, Inc.
4ba6a1819Smrg
5ba6a1819Smrg# This file is free software; the Free Software Foundation
6ba6a1819Smrg# gives unlimited permission to copy and/or distribute it,
7ba6a1819Smrg# with or without modifications, as long as this notice is preserved.
8ba6a1819Smrg
9ba6a1819Smrg# This program is distributed in the hope that it will be useful,
10ba6a1819Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11ba6a1819Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12ba6a1819Smrg# PARTICULAR PURPOSE.
13ba6a1819Smrg
141bedbe3fSmrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15549e21daSmrgm4_ifndef([AC_AUTOCONF_VERSION],
16549e21daSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1700ca1914Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.72],,
1800ca1914Smrg[m4_warning([this file was generated for autoconf 2.72.
19549e21daSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
20549e21daSmrgIf you have problems, you may need to regenerate the build system entirely.
211bedbe3fSmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
22ba6a1819Smrg
2300ca1914Smrg# Copyright (C) 2002-2024 Free Software Foundation, Inc.
24549e21daSmrg#
25549e21daSmrg# This file is free software; the Free Software Foundation
26549e21daSmrg# gives unlimited permission to copy and/or distribute it,
27549e21daSmrg# with or without modifications, as long as this notice is preserved.
282d8abe4fSmrg
29549e21daSmrg# AM_AUTOMAKE_VERSION(VERSION)
30549e21daSmrg# ----------------------------
31549e21daSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
32549e21daSmrg# generated from the m4 files accompanying Automake X.Y.
33549e21daSmrg# (This private macro should not be called outside this file.)
34549e21daSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
3500ca1914Smrg[am__api_version='1.17'
36549e21daSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
37549e21daSmrgdnl require some minimum version.  Point them to the right macro.
3800ca1914Smrgm4_if([$1], [1.17], [],
39549e21daSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
40549e21daSmrg])
41549e21daSmrg
42549e21daSmrg# _AM_AUTOCONF_VERSION(VERSION)
43549e21daSmrg# -----------------------------
44549e21daSmrg# aclocal traces this macro to find the Autoconf version.
45549e21daSmrg# This is a private macro too.  Using m4_define simplifies
46549e21daSmrg# the logic in aclocal, which can simply ignore this definition.
47549e21daSmrgm4_define([_AM_AUTOCONF_VERSION], [])
48549e21daSmrg
49549e21daSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
50549e21daSmrg# -------------------------------
51549e21daSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
52549e21daSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
53549e21daSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
5400ca1914Smrg[AM_AUTOMAKE_VERSION([1.17])dnl
55549e21daSmrgm4_ifndef([AC_AUTOCONF_VERSION],
56549e21daSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
57549e21daSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
58549e21daSmrg
59549e21daSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
60549e21daSmrg
6100ca1914Smrg# Copyright (C) 2001-2024 Free Software Foundation, Inc.
622d8abe4fSmrg#
63549e21daSmrg# This file is free software; the Free Software Foundation
64549e21daSmrg# gives unlimited permission to copy and/or distribute it,
65549e21daSmrg# with or without modifications, as long as this notice is preserved.
66549e21daSmrg
67549e21daSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
681bedbe3fSmrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
691bedbe3fSmrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
70549e21daSmrg#
71549e21daSmrg# Of course, Automake must honor this variable whenever it calls a
72549e21daSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
73549e21daSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
74549e21daSmrg# depending on how configure is run.  This is pretty annoying, since
75549e21daSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
76549e21daSmrg# source directory, any form will work fine, but in subdirectories a
77549e21daSmrg# relative path needs to be adjusted first.
782d8abe4fSmrg#
79549e21daSmrg# $ac_aux_dir/missing
80549e21daSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
81549e21daSmrg# $top_srcdir/$ac_aux_dir/missing
82549e21daSmrg#    fails if $ac_aux_dir is absolute,
83549e21daSmrg#    fails when called from a subdirectory in a VPATH build with
84549e21daSmrg#          a relative $ac_aux_dir
852d8abe4fSmrg#
86549e21daSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
87549e21daSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
881bedbe3fSmrg# harmless because $srcdir is '.', but things will broke when you
89549e21daSmrg# start a VPATH build or use an absolute $srcdir.
902d8abe4fSmrg#
91549e21daSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
92549e21daSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
93549e21daSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
94549e21daSmrg# and then we would define $MISSING as
95549e21daSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
96549e21daSmrg# This will work as long as MISSING is not called from configure, because
97549e21daSmrg# unfortunately $(top_srcdir) has no meaning in configure.
98549e21daSmrg# However there are other variables, like CC, which are often used in
99549e21daSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
1002d8abe4fSmrg#
101549e21daSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
102549e21daSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
103549e21daSmrg# configured tree to be moved without reconfiguration.
1042d8abe4fSmrg
105549e21daSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
106298453a4Smrg[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
107298453a4Smrg# Expand $ac_aux_dir to an absolute path.
108298453a4Smrgam_aux_dir=`cd "$ac_aux_dir" && pwd`
109549e21daSmrg])
1102d8abe4fSmrg
111549e21daSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
1122d8abe4fSmrg
11300ca1914Smrg# Copyright (C) 1997-2024 Free Software Foundation, Inc.
1142d8abe4fSmrg#
115549e21daSmrg# This file is free software; the Free Software Foundation
116549e21daSmrg# gives unlimited permission to copy and/or distribute it,
117549e21daSmrg# with or without modifications, as long as this notice is preserved.
1182d8abe4fSmrg
119549e21daSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
120549e21daSmrg# -------------------------------------
121549e21daSmrg# Define a conditional.
122549e21daSmrgAC_DEFUN([AM_CONDITIONAL],
1231bedbe3fSmrg[AC_PREREQ([2.52])dnl
1241bedbe3fSmrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1251bedbe3fSmrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
126549e21daSmrgAC_SUBST([$1_TRUE])dnl
127549e21daSmrgAC_SUBST([$1_FALSE])dnl
128549e21daSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
129549e21daSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
130549e21daSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
131549e21daSmrgif $2; then
132549e21daSmrg  $1_TRUE=
133549e21daSmrg  $1_FALSE='#'
134549e21daSmrgelse
135549e21daSmrg  $1_TRUE='#'
136549e21daSmrg  $1_FALSE=
1372d8abe4fSmrgfi
138549e21daSmrgAC_CONFIG_COMMANDS_PRE(
139549e21daSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
140549e21daSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
141549e21daSmrgUsually this means the macro was only invoked conditionally.]])
142549e21daSmrgfi])])
1432d8abe4fSmrg
14400ca1914Smrg# Copyright (C) 1999-2024 Free Software Foundation, Inc.
145549e21daSmrg#
146549e21daSmrg# This file is free software; the Free Software Foundation
147549e21daSmrg# gives unlimited permission to copy and/or distribute it,
148549e21daSmrg# with or without modifications, as long as this notice is preserved.
1492d8abe4fSmrg
1502d8abe4fSmrg
1511bedbe3fSmrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
152549e21daSmrg# written in clear, in which case automake, when reading aclocal.m4,
153549e21daSmrg# will think it sees a *use*, and therefore will trigger all it's
154549e21daSmrg# C support machinery.  Also note that it means that autoscan, seeing
155549e21daSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1562d8abe4fSmrg
1572d8abe4fSmrg
158549e21daSmrg# _AM_DEPENDENCIES(NAME)
159549e21daSmrg# ----------------------
160549e21daSmrg# See how the compiler implements dependency checking.
1611bedbe3fSmrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
162549e21daSmrg# We try a few techniques and use that to set a single cache variable.
163549e21daSmrg#
164549e21daSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
165549e21daSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
166549e21daSmrg# dependency, and given that the user is not expected to run this macro,
167549e21daSmrg# just rely on AC_PROG_CC.
168549e21daSmrgAC_DEFUN([_AM_DEPENDENCIES],
169549e21daSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
170549e21daSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
171549e21daSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
172549e21daSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1732d8abe4fSmrg
1741bedbe3fSmrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
1751bedbe3fSmrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
1761bedbe3fSmrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1771bedbe3fSmrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
1781bedbe3fSmrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
1791bedbe3fSmrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1801bedbe3fSmrg                    [depcc="$$1"   am_compiler_list=])
1812d8abe4fSmrg
182549e21daSmrgAC_CACHE_CHECK([dependency style of $depcc],
183549e21daSmrg               [am_cv_$1_dependencies_compiler_type],
184549e21daSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
185549e21daSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
186549e21daSmrg  # making bogus files that we don't know about and never remove.  For
187549e21daSmrg  # instance it was reported that on HP-UX the gcc test will end up
1881bedbe3fSmrg  # making a dummy file named 'D' -- because '-MD' means "put the output
1891bedbe3fSmrg  # in D".
1901bedbe3fSmrg  rm -rf conftest.dir
191549e21daSmrg  mkdir conftest.dir
192549e21daSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
193549e21daSmrg  # using a relative directory.
194549e21daSmrg  cp "$am_depcomp" conftest.dir
195549e21daSmrg  cd conftest.dir
196549e21daSmrg  # We will build objects and dependencies in a subdirectory because
197549e21daSmrg  # it helps to detect inapplicable dependency modes.  For instance
198549e21daSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
199549e21daSmrg  # side effect of compilation, but ICC will put the dependencies in
200549e21daSmrg  # the current directory while Tru64 will put them in the object
201549e21daSmrg  # directory.
202549e21daSmrg  mkdir sub
2032d8abe4fSmrg
204549e21daSmrg  am_cv_$1_dependencies_compiler_type=none
205549e21daSmrg  if test "$am_compiler_list" = ""; then
206549e21daSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
207549e21daSmrg  fi
208549e21daSmrg  am__universal=false
209549e21daSmrg  m4_case([$1], [CC],
210549e21daSmrg    [case " $depcc " in #(
211549e21daSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
212549e21daSmrg     esac],
213549e21daSmrg    [CXX],
214549e21daSmrg    [case " $depcc " in #(
215549e21daSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
216549e21daSmrg     esac])
2172d8abe4fSmrg
218549e21daSmrg  for depmode in $am_compiler_list; do
219549e21daSmrg    # Setup a source with many dependencies, because some compilers
220549e21daSmrg    # like to wrap large dependency lists on column 80 (with \), and
221549e21daSmrg    # we should not choose a depcomp mode which is confused by this.
222549e21daSmrg    #
223549e21daSmrg    # We need to recreate these files for each test, as the compiler may
224549e21daSmrg    # overwrite some of them when testing with obscure command lines.
225549e21daSmrg    # This happens at least with the AIX C compiler.
226549e21daSmrg    : > sub/conftest.c
227549e21daSmrg    for i in 1 2 3 4 5 6; do
228549e21daSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
2291bedbe3fSmrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
2301bedbe3fSmrg      # Solaris 10 /bin/sh.
2311bedbe3fSmrg      echo '/* dummy */' > sub/conftst$i.h
232549e21daSmrg    done
233549e21daSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2342d8abe4fSmrg
2351bedbe3fSmrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
236549e21daSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
2371bedbe3fSmrg    # handle '-M -o', and we need to detect this.  Also, some Intel
2381bedbe3fSmrg    # versions had trouble with output in subdirs.
239549e21daSmrg    am__obj=sub/conftest.${OBJEXT-o}
240549e21daSmrg    am__minus_obj="-o $am__obj"
241549e21daSmrg    case $depmode in
242549e21daSmrg    gcc)
243549e21daSmrg      # This depmode causes a compiler race in universal mode.
244549e21daSmrg      test "$am__universal" = false || continue
245549e21daSmrg      ;;
246549e21daSmrg    nosideeffect)
2471bedbe3fSmrg      # After this tag, mechanisms are not by side-effect, so they'll
2481bedbe3fSmrg      # only be used when explicitly requested.
249549e21daSmrg      if test "x$enable_dependency_tracking" = xyes; then
250549e21daSmrg	continue
251549e21daSmrg      else
252549e21daSmrg	break
253549e21daSmrg      fi
254549e21daSmrg      ;;
2551bedbe3fSmrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
2561bedbe3fSmrg      # This compiler won't grok '-c -o', but also, the minuso test has
257549e21daSmrg      # not run yet.  These depmodes are late enough in the game, and
258549e21daSmrg      # so weak that their functioning should not be impacted.
259549e21daSmrg      am__obj=conftest.${OBJEXT-o}
260549e21daSmrg      am__minus_obj=
261549e21daSmrg      ;;
262549e21daSmrg    none) break ;;
263549e21daSmrg    esac
264549e21daSmrg    if depmode=$depmode \
265549e21daSmrg       source=sub/conftest.c object=$am__obj \
266549e21daSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
267549e21daSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
268549e21daSmrg         >/dev/null 2>conftest.err &&
269549e21daSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
270549e21daSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
271549e21daSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
272549e21daSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
273549e21daSmrg      # icc doesn't choke on unknown options, it will just issue warnings
274549e21daSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
275549e21daSmrg      # that says an option was ignored or not supported.
27600ca1914Smrg      # When given -MP, icc 7.0 and 7.1 complain thus:
277549e21daSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
278549e21daSmrg      # The diagnosis changed in icc 8.0:
279549e21daSmrg      #   icc: Command line remark: option '-MP' not supported
280549e21daSmrg      if (grep 'ignoring option' conftest.err ||
281549e21daSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
282549e21daSmrg        am_cv_$1_dependencies_compiler_type=$depmode
283549e21daSmrg        break
284549e21daSmrg      fi
285549e21daSmrg    fi
286549e21daSmrg  done
2872d8abe4fSmrg
288549e21daSmrg  cd ..
289549e21daSmrg  rm -rf conftest.dir
2902d8abe4fSmrgelse
291549e21daSmrg  am_cv_$1_dependencies_compiler_type=none
2922d8abe4fSmrgfi
293549e21daSmrg])
294549e21daSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
295549e21daSmrgAM_CONDITIONAL([am__fastdep$1], [
296549e21daSmrg  test "x$enable_dependency_tracking" != xno \
297549e21daSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
298549e21daSmrg])
2992d8abe4fSmrg
3002d8abe4fSmrg
301549e21daSmrg# AM_SET_DEPDIR
302549e21daSmrg# -------------
303549e21daSmrg# Choose a directory name for dependency files.
3041bedbe3fSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
305549e21daSmrgAC_DEFUN([AM_SET_DEPDIR],
306549e21daSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
307549e21daSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
308549e21daSmrg])
3092d8abe4fSmrg
3102d8abe4fSmrg
311549e21daSmrg# AM_DEP_TRACK
312549e21daSmrg# ------------
313549e21daSmrgAC_DEFUN([AM_DEP_TRACK],
3141bedbe3fSmrg[AC_ARG_ENABLE([dependency-tracking], [dnl
3151bedbe3fSmrgAS_HELP_STRING(
3161bedbe3fSmrg  [--enable-dependency-tracking],
3171bedbe3fSmrg  [do not reject slow dependency extractors])
3181bedbe3fSmrgAS_HELP_STRING(
3191bedbe3fSmrg  [--disable-dependency-tracking],
3201bedbe3fSmrg  [speeds up one-time build])])
321549e21daSmrgif test "x$enable_dependency_tracking" != xno; then
322549e21daSmrg  am_depcomp="$ac_aux_dir/depcomp"
323549e21daSmrg  AMDEPBACKSLASH='\'
3241bedbe3fSmrg  am__nodep='_no'
3252d8abe4fSmrgfi
326549e21daSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
327549e21daSmrgAC_SUBST([AMDEPBACKSLASH])dnl
328549e21daSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
3291bedbe3fSmrgAC_SUBST([am__nodep])dnl
3301bedbe3fSmrg_AM_SUBST_NOTMAKE([am__nodep])dnl
331549e21daSmrg])
3322d8abe4fSmrg
333549e21daSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
3342d8abe4fSmrg
33500ca1914Smrg# Copyright (C) 1999-2024 Free Software Foundation, Inc.
3362d8abe4fSmrg#
337549e21daSmrg# This file is free software; the Free Software Foundation
338549e21daSmrg# gives unlimited permission to copy and/or distribute it,
339549e21daSmrg# with or without modifications, as long as this notice is preserved.
3402d8abe4fSmrg
341549e21daSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
342549e21daSmrg# ------------------------------
343549e21daSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
344549e21daSmrg[{
3451bedbe3fSmrg  # Older Autoconf quotes --file arguments for eval, but not when files
346549e21daSmrg  # are listed without --file.  Let's play safe and only enable the eval
347549e21daSmrg  # if we detect the quoting.
348da1f2d5dSmrg  # TODO: see whether this extra hack can be removed once we start
349da1f2d5dSmrg  # requiring Autoconf 2.70 or later.
350da1f2d5dSmrg  AS_CASE([$CONFIG_FILES],
351da1f2d5dSmrg          [*\'*], [eval set x "$CONFIG_FILES"],
352da1f2d5dSmrg          [*], [set x $CONFIG_FILES])
353549e21daSmrg  shift
354da1f2d5dSmrg  # Used to flag and report bootstrapping failures.
355da1f2d5dSmrg  am_rc=0
356da1f2d5dSmrg  for am_mf
357549e21daSmrg  do
358549e21daSmrg    # Strip MF so we end up with the name of the file.
359da1f2d5dSmrg    am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
360da1f2d5dSmrg    # Check whether this is an Automake generated Makefile which includes
361da1f2d5dSmrg    # dependency-tracking related rules and includes.
362da1f2d5dSmrg    # Grep'ing the whole file directly is not great: AIX grep has a line
363549e21daSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
364da1f2d5dSmrg    sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
365da1f2d5dSmrg      || continue
366da1f2d5dSmrg    am_dirpart=`AS_DIRNAME(["$am_mf"])`
367da1f2d5dSmrg    am_filepart=`AS_BASENAME(["$am_mf"])`
368da1f2d5dSmrg    AM_RUN_LOG([cd "$am_dirpart" \
369da1f2d5dSmrg      && sed -e '/# am--include-marker/d' "$am_filepart" \
370da1f2d5dSmrg        | $MAKE -f - am--depfiles]) || am_rc=$?
371549e21daSmrg  done
372da1f2d5dSmrg  if test $am_rc -ne 0; then
373da1f2d5dSmrg    AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
374da1f2d5dSmrg    for automatic dependency tracking.  If GNU make was not used, consider
375da1f2d5dSmrg    re-running the configure script with MAKE="gmake" (or whatever is
376da1f2d5dSmrg    necessary).  You can also try re-running configure with the
377da1f2d5dSmrg    '--disable-dependency-tracking' option to at least be able to build
378da1f2d5dSmrg    the package (albeit without support for automatic dependency tracking).])
379da1f2d5dSmrg  fi
380da1f2d5dSmrg  AS_UNSET([am_dirpart])
381da1f2d5dSmrg  AS_UNSET([am_filepart])
382da1f2d5dSmrg  AS_UNSET([am_mf])
383da1f2d5dSmrg  AS_UNSET([am_rc])
384da1f2d5dSmrg  rm -f conftest-deps.mk
385549e21daSmrg}
386549e21daSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
3872d8abe4fSmrg
3882d8abe4fSmrg
389549e21daSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
390549e21daSmrg# -----------------------------
391549e21daSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
392549e21daSmrg#
393da1f2d5dSmrg# This code is only required when automatic dependency tracking is enabled.
394da1f2d5dSmrg# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
395da1f2d5dSmrg# order to bootstrap the dependency handling code.
396549e21daSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
397549e21daSmrg[AC_CONFIG_COMMANDS([depfiles],
398549e21daSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
399da1f2d5dSmrg     [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
4002d8abe4fSmrg
401549e21daSmrg# Do all the work for Automake.                             -*- Autoconf -*-
4022d8abe4fSmrg
40300ca1914Smrg# Copyright (C) 1996-2024 Free Software Foundation, Inc.
4042d8abe4fSmrg#
405549e21daSmrg# This file is free software; the Free Software Foundation
406549e21daSmrg# gives unlimited permission to copy and/or distribute it,
407549e21daSmrg# with or without modifications, as long as this notice is preserved.
4082d8abe4fSmrg
409549e21daSmrg# This macro actually does too much.  Some checks are only needed if
410549e21daSmrg# your package does certain things.  But this isn't really a big deal.
411549e21daSmrg
4126af7124fSmrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
4136af7124fSmrgm4_define([AC_PROG_CC],
4146af7124fSmrgm4_defn([AC_PROG_CC])
4156af7124fSmrg[_AM_PROG_CC_C_O
4166af7124fSmrg])
4176af7124fSmrg
418549e21daSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
419549e21daSmrg# AM_INIT_AUTOMAKE([OPTIONS])
420549e21daSmrg# -----------------------------------------------
421549e21daSmrg# The call with PACKAGE and VERSION arguments is the old style
422549e21daSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
423549e21daSmrg# and VERSION should now be passed to AC_INIT and removed from
424549e21daSmrg# the call to AM_INIT_AUTOMAKE.
425549e21daSmrg# We support both call styles for the transition.  After
426549e21daSmrg# the next Automake release, Autoconf can make the AC_INIT
427549e21daSmrg# arguments mandatory, and then we can depend on a new Autoconf
428549e21daSmrg# release and drop the old call support.
429549e21daSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
4301bedbe3fSmrg[AC_PREREQ([2.65])dnl
431da1f2d5dSmrgm4_ifdef([_$0_ALREADY_INIT],
432da1f2d5dSmrg  [m4_fatal([$0 expanded multiple times
433da1f2d5dSmrg]m4_defn([_$0_ALREADY_INIT]))],
434da1f2d5dSmrg  [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl
435549e21daSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
436549e21daSmrgdnl the ones we care about.
437549e21daSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
438549e21daSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
439549e21daSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
440549e21daSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
441549e21daSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
442549e21daSmrg  # is not polluted with repeated "-I."
443549e21daSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
444549e21daSmrg  # test to see if srcdir already configured
445549e21daSmrg  if test -f $srcdir/config.status; then
446549e21daSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
447549e21daSmrg  fi
4482d8abe4fSmrgfi
4492d8abe4fSmrg
450549e21daSmrg# test whether we have cygpath
451549e21daSmrgif test -z "$CYGPATH_W"; then
452549e21daSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
453549e21daSmrg    CYGPATH_W='cygpath -w'
454549e21daSmrg  else
455549e21daSmrg    CYGPATH_W=echo
456549e21daSmrg  fi
4572d8abe4fSmrgfi
458549e21daSmrgAC_SUBST([CYGPATH_W])
4592d8abe4fSmrg
460549e21daSmrg# Define the identity of the package.
461549e21daSmrgdnl Distinguish between old-style and new-style calls.
462549e21daSmrgm4_ifval([$2],
4631bedbe3fSmrg[AC_DIAGNOSE([obsolete],
4641bedbe3fSmrg             [$0: two- and three-arguments forms are deprecated.])
4651bedbe3fSmrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
466549e21daSmrg AC_SUBST([PACKAGE], [$1])dnl
467549e21daSmrg AC_SUBST([VERSION], [$2])],
468549e21daSmrg[_AM_SET_OPTIONS([$1])dnl
469549e21daSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
4701bedbe3fSmrgm4_if(
471da1f2d5dSmrg  m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]),
4721bedbe3fSmrg  [ok:ok],,
473549e21daSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
474549e21daSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
475549e21daSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
4762d8abe4fSmrg
477549e21daSmrg_AM_IF_OPTION([no-define],,
4781bedbe3fSmrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
4791bedbe3fSmrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
4802d8abe4fSmrg
481549e21daSmrg# Some tools Automake needs.
482549e21daSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
483549e21daSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
4841bedbe3fSmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
4851bedbe3fSmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
4861bedbe3fSmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
4871bedbe3fSmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
4881bedbe3fSmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
489549e21daSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
490549e21daSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
4911bedbe3fSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
4921bedbe3fSmrg# For better backward compatibility.  To be removed once Automake 1.9.x
4931bedbe3fSmrg# dies out for good.  For more background, see:
494da1f2d5dSmrg# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
495da1f2d5dSmrg# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
4961bedbe3fSmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
497298453a4Smrg# We need awk for the "check" target (and possibly the TAP driver).  The
498298453a4Smrg# system "awk" is bad on some platforms.
499549e21daSmrgAC_REQUIRE([AC_PROG_AWK])dnl
500549e21daSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
501549e21daSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
502549e21daSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
503549e21daSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
504549e21daSmrg			     [_AM_PROG_TAR([v7])])])
505549e21daSmrg_AM_IF_OPTION([no-dependencies],,
506549e21daSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
5071bedbe3fSmrg		  [_AM_DEPENDENCIES([CC])],
5081bedbe3fSmrg		  [m4_define([AC_PROG_CC],
5091bedbe3fSmrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
510549e21daSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
5111bedbe3fSmrg		  [_AM_DEPENDENCIES([CXX])],
5121bedbe3fSmrg		  [m4_define([AC_PROG_CXX],
5131bedbe3fSmrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
514549e21daSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
5151bedbe3fSmrg		  [_AM_DEPENDENCIES([OBJC])],
5161bedbe3fSmrg		  [m4_define([AC_PROG_OBJC],
5171bedbe3fSmrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
5181bedbe3fSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
5191bedbe3fSmrg		  [_AM_DEPENDENCIES([OBJCXX])],
5201bedbe3fSmrg		  [m4_define([AC_PROG_OBJCXX],
5211bedbe3fSmrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
522549e21daSmrg])
523da1f2d5dSmrg# Variables for tags utilities; see am/tags.am
524da1f2d5dSmrgif test -z "$CTAGS"; then
525da1f2d5dSmrg  CTAGS=ctags
526da1f2d5dSmrgfi
527da1f2d5dSmrgAC_SUBST([CTAGS])
528da1f2d5dSmrgif test -z "$ETAGS"; then
529da1f2d5dSmrg  ETAGS=etags
530da1f2d5dSmrgfi
531da1f2d5dSmrgAC_SUBST([ETAGS])
532da1f2d5dSmrgif test -z "$CSCOPE"; then
533da1f2d5dSmrg  CSCOPE=cscope
534da1f2d5dSmrgfi
535da1f2d5dSmrgAC_SUBST([CSCOPE])
536da1f2d5dSmrg
53700ca1914SmrgAC_REQUIRE([_AM_SILENT_RULES])dnl
5381bedbe3fSmrgdnl The testsuite driver may need to know about EXEEXT, so add the
5391bedbe3fSmrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
5401bedbe3fSmrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
541549e21daSmrgAC_CONFIG_COMMANDS_PRE(dnl
542549e21daSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
543549e21daSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
5446af7124fSmrg
54500ca1914SmrgAC_REQUIRE([_AM_PROG_RM_F])
54600ca1914SmrgAC_REQUIRE([_AM_PROG_XARGS_N])
5476af7124fSmrg
548298453a4Smrgdnl The trailing newline in this macro's definition is deliberate, for
549298453a4Smrgdnl backward compatibility and to allow trailing 'dnl'-style comments
550298453a4Smrgdnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
551298453a4Smrg])
5522d8abe4fSmrg
5531bedbe3fSmrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
554549e21daSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
555549e21daSmrgdnl mangled by Autoconf and run in a shell conditional statement.
556549e21daSmrgm4_define([_AC_COMPILER_EXEEXT],
557549e21daSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
5582d8abe4fSmrg
559549e21daSmrg# When config.status generates a header, we must update the stamp-h file.
560549e21daSmrg# This file resides in the same directory as the config header
561549e21daSmrg# that is generated.  The stamp files are numbered to have different names.
562549e21daSmrg
563549e21daSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
564549e21daSmrg# loop where config.status creates the headers, so we can generate
565549e21daSmrg# our stamp files there.
566549e21daSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
567549e21daSmrg[# Compute $1's index in $config_headers.
568549e21daSmrg_am_arg=$1
569549e21daSmrg_am_stamp_count=1
570549e21daSmrgfor _am_header in $config_headers :; do
571549e21daSmrg  case $_am_header in
572549e21daSmrg    $_am_arg | $_am_arg:* )
573549e21daSmrg      break ;;
574549e21daSmrg    * )
575549e21daSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
576549e21daSmrg  esac
577549e21daSmrgdone
578549e21daSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
579549e21daSmrg
58000ca1914Smrg# Copyright (C) 2001-2024 Free Software Foundation, Inc.
5812d8abe4fSmrg#
582549e21daSmrg# This file is free software; the Free Software Foundation
583549e21daSmrg# gives unlimited permission to copy and/or distribute it,
584549e21daSmrg# with or without modifications, as long as this notice is preserved.
5852d8abe4fSmrg
586549e21daSmrg# AM_PROG_INSTALL_SH
587549e21daSmrg# ------------------
588549e21daSmrg# Define $install_sh.
589549e21daSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
590549e21daSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
591298453a4Smrgif test x"${install_sh+set}" != xset; then
592549e21daSmrg  case $am_aux_dir in
593549e21daSmrg  *\ * | *\	*)
594549e21daSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
595549e21daSmrg  *)
596549e21daSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
597549e21daSmrg  esac
5982d8abe4fSmrgfi
5991bedbe3fSmrgAC_SUBST([install_sh])])
6002d8abe4fSmrg
60100ca1914Smrg# Copyright (C) 2003-2024 Free Software Foundation, Inc.
6022d8abe4fSmrg#
603549e21daSmrg# This file is free software; the Free Software Foundation
604549e21daSmrg# gives unlimited permission to copy and/or distribute it,
605549e21daSmrg# with or without modifications, as long as this notice is preserved.
606549e21daSmrg
607549e21daSmrg# Check whether the underlying file-system supports filenames
608549e21daSmrg# with a leading dot.  For instance MS-DOS doesn't.
609549e21daSmrgAC_DEFUN([AM_SET_LEADING_DOT],
610549e21daSmrg[rm -rf .tst 2>/dev/null
611549e21daSmrgmkdir .tst 2>/dev/null
612549e21daSmrgif test -d .tst; then
613549e21daSmrg  am__leading_dot=.
6142d8abe4fSmrgelse
615549e21daSmrg  am__leading_dot=_
6162d8abe4fSmrgfi
617549e21daSmrgrmdir .tst 2>/dev/null
618549e21daSmrgAC_SUBST([am__leading_dot])])
6192d8abe4fSmrg
620549e21daSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
621ba6a1819Smrg
62200ca1914Smrg# Copyright (C) 2001-2024 Free Software Foundation, Inc.
623ba6a1819Smrg#
624ba6a1819Smrg# This file is free software; the Free Software Foundation
625ba6a1819Smrg# gives unlimited permission to copy and/or distribute it,
626ba6a1819Smrg# with or without modifications, as long as this notice is preserved.
627ba6a1819Smrg
628549e21daSmrg# AM_MAKE_INCLUDE()
629549e21daSmrg# -----------------
630da1f2d5dSmrg# Check whether make has an 'include' directive that can support all
631da1f2d5dSmrg# the idioms we need for our automatic dependency tracking code.
632549e21daSmrgAC_DEFUN([AM_MAKE_INCLUDE],
633da1f2d5dSmrg[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
634da1f2d5dSmrgcat > confinc.mk << 'END'
635549e21daSmrgam__doit:
636da1f2d5dSmrg	@echo this is the am__doit target >confinc.out
637549e21daSmrg.PHONY: am__doit
638549e21daSmrgEND
639549e21daSmrgam__include="#"
640549e21daSmrgam__quote=
641da1f2d5dSmrg# BSD make does it like this.
642da1f2d5dSmrgecho '.include "confinc.mk" # ignored' > confmf.BSD
643da1f2d5dSmrg# Other make implementations (GNU, Solaris 10, AIX) do it like this.
644da1f2d5dSmrgecho 'include confinc.mk # ignored' > confmf.GNU
645da1f2d5dSmrg_am_result=no
646da1f2d5dSmrgfor s in GNU BSD; do
647da1f2d5dSmrg  AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
648da1f2d5dSmrg  AS_CASE([$?:`cat confinc.out 2>/dev/null`],
649da1f2d5dSmrg      ['0:this is the am__doit target'],
650da1f2d5dSmrg      [AS_CASE([$s],
651da1f2d5dSmrg          [BSD], [am__include='.include' am__quote='"'],
652da1f2d5dSmrg          [am__include='include' am__quote=''])])
653da1f2d5dSmrg  if test "$am__include" != "#"; then
654da1f2d5dSmrg    _am_result="yes ($s style)"
655da1f2d5dSmrg    break
656da1f2d5dSmrg  fi
657da1f2d5dSmrgdone
658da1f2d5dSmrgrm -f confinc.* confmf.*
659da1f2d5dSmrgAC_MSG_RESULT([${_am_result}])
660da1f2d5dSmrgAC_SUBST([am__include])])
661da1f2d5dSmrgAC_SUBST([am__quote])])
662ba6a1819Smrg
663549e21daSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
664ba6a1819Smrg
66500ca1914Smrg# Copyright (C) 1997-2024 Free Software Foundation, Inc.
666ba6a1819Smrg#
667ba6a1819Smrg# This file is free software; the Free Software Foundation
668ba6a1819Smrg# gives unlimited permission to copy and/or distribute it,
669ba6a1819Smrg# with or without modifications, as long as this notice is preserved.
670ba6a1819Smrg
671549e21daSmrg# AM_MISSING_PROG(NAME, PROGRAM)
672549e21daSmrg# ------------------------------
673549e21daSmrgAC_DEFUN([AM_MISSING_PROG],
674549e21daSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
675549e21daSmrg$1=${$1-"${am_missing_run}$2"}
676549e21daSmrgAC_SUBST($1)])
677549e21daSmrg
678549e21daSmrg# AM_MISSING_HAS_RUN
679549e21daSmrg# ------------------
6801bedbe3fSmrg# Define MISSING if not defined so far and test if it is modern enough.
6811bedbe3fSmrg# If it is, set am_missing_run to use it, otherwise, to nothing.
682549e21daSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
683549e21daSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
684549e21daSmrgAC_REQUIRE_AUX_FILE([missing])dnl
685549e21daSmrgif test x"${MISSING+set}" != xset; then
686da1f2d5dSmrg  MISSING="\${SHELL} '$am_aux_dir/missing'"
687549e21daSmrgfi
688549e21daSmrg# Use eval to expand $SHELL
6891bedbe3fSmrgif eval "$MISSING --is-lightweight"; then
6901bedbe3fSmrg  am_missing_run="$MISSING "
691ba6a1819Smrgelse
692549e21daSmrg  am_missing_run=
6931bedbe3fSmrg  AC_MSG_WARN(['missing' script is too old or missing])
694ba6a1819Smrgfi
695549e21daSmrg])
696ba6a1819Smrg
697549e21daSmrg# Helper functions for option handling.                     -*- Autoconf -*-
698ba6a1819Smrg
69900ca1914Smrg# Copyright (C) 2001-2024 Free Software Foundation, Inc.
700ba6a1819Smrg#
701549e21daSmrg# This file is free software; the Free Software Foundation
702549e21daSmrg# gives unlimited permission to copy and/or distribute it,
703549e21daSmrg# with or without modifications, as long as this notice is preserved.
704ba6a1819Smrg
705549e21daSmrg# _AM_MANGLE_OPTION(NAME)
706549e21daSmrg# -----------------------
707549e21daSmrgAC_DEFUN([_AM_MANGLE_OPTION],
708549e21daSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
709ba6a1819Smrg
710549e21daSmrg# _AM_SET_OPTION(NAME)
7111bedbe3fSmrg# --------------------
712549e21daSmrg# Set option NAME.  Presently that only means defining a flag for this option.
713549e21daSmrgAC_DEFUN([_AM_SET_OPTION],
7141bedbe3fSmrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
715ba6a1819Smrg
716549e21daSmrg# _AM_SET_OPTIONS(OPTIONS)
7171bedbe3fSmrg# ------------------------
718549e21daSmrg# OPTIONS is a space-separated list of Automake options.
719549e21daSmrgAC_DEFUN([_AM_SET_OPTIONS],
720549e21daSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
721ba6a1819Smrg
722549e21daSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
723549e21daSmrg# -------------------------------------------
724549e21daSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
725549e21daSmrgAC_DEFUN([_AM_IF_OPTION],
726549e21daSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
727ba6a1819Smrg
72800ca1914Smrg# Copyright (C) 1999-2024 Free Software Foundation, Inc.
7296af7124fSmrg#
7306af7124fSmrg# This file is free software; the Free Software Foundation
7316af7124fSmrg# gives unlimited permission to copy and/or distribute it,
7326af7124fSmrg# with or without modifications, as long as this notice is preserved.
7336af7124fSmrg
7346af7124fSmrg# _AM_PROG_CC_C_O
7356af7124fSmrg# ---------------
7366af7124fSmrg# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
7376af7124fSmrg# to automatically call this.
7386af7124fSmrgAC_DEFUN([_AM_PROG_CC_C_O],
7396af7124fSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
7406af7124fSmrgAC_REQUIRE_AUX_FILE([compile])dnl
7416af7124fSmrgAC_LANG_PUSH([C])dnl
7426af7124fSmrgAC_CACHE_CHECK(
7436af7124fSmrg  [whether $CC understands -c and -o together],
7446af7124fSmrg  [am_cv_prog_cc_c_o],
7456af7124fSmrg  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
7466af7124fSmrg  # Make sure it works both with $CC and with simple cc.
7476af7124fSmrg  # Following AC_PROG_CC_C_O, we do the test twice because some
7486af7124fSmrg  # compilers refuse to overwrite an existing .o file with -o,
7496af7124fSmrg  # though they will create one.
7506af7124fSmrg  am_cv_prog_cc_c_o=yes
7516af7124fSmrg  for am_i in 1 2; do
7526af7124fSmrg    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
7536af7124fSmrg         && test -f conftest2.$ac_objext; then
7546af7124fSmrg      : OK
7556af7124fSmrg    else
7566af7124fSmrg      am_cv_prog_cc_c_o=no
7576af7124fSmrg      break
7586af7124fSmrg    fi
7596af7124fSmrg  done
7606af7124fSmrg  rm -f core conftest*
7616af7124fSmrg  unset am_i])
7626af7124fSmrgif test "$am_cv_prog_cc_c_o" != yes; then
7636af7124fSmrg   # Losing compiler, so override with the script.
7646af7124fSmrg   # FIXME: It is wrong to rewrite CC.
7656af7124fSmrg   # But if we don't then we get into trouble of one sort or another.
7666af7124fSmrg   # A longer-term fix would be to have automake use am__CC in this case,
7676af7124fSmrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
7686af7124fSmrg   CC="$am_aux_dir/compile $CC"
7696af7124fSmrgfi
7706af7124fSmrgAC_LANG_POP([C])])
7716af7124fSmrg
7726af7124fSmrg# For backward compatibility.
7736af7124fSmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
7746af7124fSmrg
77500ca1914Smrg# Copyright (C) 2022-2024 Free Software Foundation, Inc.
77600ca1914Smrg#
77700ca1914Smrg# This file is free software; the Free Software Foundation
77800ca1914Smrg# gives unlimited permission to copy and/or distribute it,
77900ca1914Smrg# with or without modifications, as long as this notice is preserved.
78000ca1914Smrg
78100ca1914Smrg# _AM_PROG_RM_F
78200ca1914Smrg# ---------------
78300ca1914Smrg# Check whether 'rm -f' without any arguments works.
78400ca1914Smrg# https://bugs.gnu.org/10828
78500ca1914SmrgAC_DEFUN([_AM_PROG_RM_F],
78600ca1914Smrg[am__rm_f_notfound=
78700ca1914SmrgAS_IF([(rm -f && rm -fr && rm -rf) 2>/dev/null], [], [am__rm_f_notfound='""'])
78800ca1914SmrgAC_SUBST(am__rm_f_notfound)
78900ca1914Smrg])
79000ca1914Smrg
79100ca1914Smrg# Copyright (C) 2001-2024 Free Software Foundation, Inc.
7926af7124fSmrg#
7936af7124fSmrg# This file is free software; the Free Software Foundation
7946af7124fSmrg# gives unlimited permission to copy and/or distribute it,
7956af7124fSmrg# with or without modifications, as long as this notice is preserved.
7966af7124fSmrg
7976af7124fSmrg# AM_RUN_LOG(COMMAND)
7986af7124fSmrg# -------------------
7996af7124fSmrg# Run COMMAND, save the exit status in ac_status, and log it.
8006af7124fSmrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
8016af7124fSmrgAC_DEFUN([AM_RUN_LOG],
8026af7124fSmrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
8036af7124fSmrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
8046af7124fSmrg   ac_status=$?
8056af7124fSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
8066af7124fSmrg   (exit $ac_status); }])
8076af7124fSmrg
808549e21daSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
809ba6a1819Smrg
81000ca1914Smrg# Copyright (C) 1996-2024 Free Software Foundation, Inc.
811ba6a1819Smrg#
812ba6a1819Smrg# This file is free software; the Free Software Foundation
813ba6a1819Smrg# gives unlimited permission to copy and/or distribute it,
814ba6a1819Smrg# with or without modifications, as long as this notice is preserved.
815ba6a1819Smrg
81600ca1914Smrg# _AM_SLEEP_FRACTIONAL_SECONDS
81700ca1914Smrg# ----------------------------
81800ca1914SmrgAC_DEFUN([_AM_SLEEP_FRACTIONAL_SECONDS], [dnl
81900ca1914SmrgAC_CACHE_CHECK([whether sleep supports fractional seconds],
82000ca1914Smrg               am_cv_sleep_fractional_seconds, [dnl
82100ca1914SmrgAS_IF([sleep 0.001 2>/dev/null], [am_cv_sleep_fractional_seconds=yes],
82200ca1914Smrg                                 [am_cv_sleep_fractional_seconds=no])
82300ca1914Smrg])])
82400ca1914Smrg
82500ca1914Smrg# _AM_FILESYSTEM_TIMESTAMP_RESOLUTION
82600ca1914Smrg# -----------------------------------
82700ca1914Smrg# Determine the filesystem's resolution for file modification
82800ca1914Smrg# timestamps.  The coarsest we know of is FAT, with a resolution
82900ca1914Smrg# of only two seconds, even with the most recent "exFAT" extensions.
83000ca1914Smrg# The finest (e.g. ext4 with large inodes, XFS, ZFS) is one
83100ca1914Smrg# nanosecond, matching clock_gettime.  However, it is probably not
83200ca1914Smrg# possible to delay execution of a shell script for less than one
83300ca1914Smrg# millisecond, due to process creation overhead and scheduling
83400ca1914Smrg# granularity, so we don't check for anything finer than that. (See below.)
83500ca1914SmrgAC_DEFUN([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION], [dnl
83600ca1914SmrgAC_REQUIRE([_AM_SLEEP_FRACTIONAL_SECONDS])
83700ca1914SmrgAC_CACHE_CHECK([filesystem timestamp resolution],
83800ca1914Smrg               am_cv_filesystem_timestamp_resolution, [dnl
83900ca1914Smrg# Default to the worst case.
84000ca1914Smrgam_cv_filesystem_timestamp_resolution=2
84100ca1914Smrg
84200ca1914Smrg# Only try to go finer than 1 sec if sleep can do it.
84300ca1914Smrg# Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work,
84400ca1914Smrg# - 1 sec is not much of a win compared to 2 sec, and
84500ca1914Smrg# - it takes 2 seconds to perform the test whether 1 sec works.
84600ca1914Smrg# 
84700ca1914Smrg# Instead, just use the default 2s on platforms that have 1s resolution,
84800ca1914Smrg# accept the extra 1s delay when using $sleep in the Automake tests, in
84900ca1914Smrg# exchange for not incurring the 2s delay for running the test for all
85000ca1914Smrg# packages.
85100ca1914Smrg#
85200ca1914Smrgam_try_resolutions=
85300ca1914Smrgif test "$am_cv_sleep_fractional_seconds" = yes; then
85400ca1914Smrg  # Even a millisecond often causes a bunch of false positives,
85500ca1914Smrg  # so just try a hundredth of a second. The time saved between .001 and
85600ca1914Smrg  # .01 is not terribly consequential.
85700ca1914Smrg  am_try_resolutions="0.01 0.1 $am_try_resolutions"
85800ca1914Smrgfi
85900ca1914Smrg
86000ca1914Smrg# In order to catch current-generation FAT out, we must *modify* files
86100ca1914Smrg# that already exist; the *creation* timestamp is finer.  Use names
86200ca1914Smrg# that make ls -t sort them differently when they have equal
86300ca1914Smrg# timestamps than when they have distinct timestamps, keeping
86400ca1914Smrg# in mind that ls -t prints the *newest* file first.
86500ca1914Smrgrm -f conftest.ts?
86600ca1914Smrg: > conftest.ts1
86700ca1914Smrg: > conftest.ts2
86800ca1914Smrg: > conftest.ts3
86900ca1914Smrg
87000ca1914Smrg# Make sure ls -t actually works.  Do 'set' in a subshell so we don't
87100ca1914Smrg# clobber the current shell's arguments. (Outer-level square brackets
87200ca1914Smrg# are removed by m4; they're present so that m4 does not expand
87300ca1914Smrg# <dollar><star>; be careful, easy to get confused.)
87400ca1914Smrgif (
87500ca1914Smrg     set X `[ls -t conftest.ts[12]]` &&
87600ca1914Smrg     {
87700ca1914Smrg       test "$[]*" != "X conftest.ts1 conftest.ts2" ||
87800ca1914Smrg       test "$[]*" != "X conftest.ts2 conftest.ts1";
87900ca1914Smrg     }
88000ca1914Smrg); then :; else
88100ca1914Smrg  # If neither matched, then we have a broken ls.  This can happen
88200ca1914Smrg  # if, for instance, CONFIG_SHELL is bash and it inherits a
88300ca1914Smrg  # broken ls alias from the environment.  This has actually
88400ca1914Smrg  # happened.  Such a system could not be considered "sane".
88500ca1914Smrg  _AS_ECHO_UNQUOTED(
88600ca1914Smrg    ["Bad output from ls -t: \"`[ls -t conftest.ts[12]]`\""],
88700ca1914Smrg    [AS_MESSAGE_LOG_FD])
88800ca1914Smrg  AC_MSG_FAILURE([ls -t produces unexpected output.
88900ca1914SmrgMake sure there is not a broken ls alias in your environment.])
89000ca1914Smrgfi
89100ca1914Smrg
89200ca1914Smrgfor am_try_res in $am_try_resolutions; do
89300ca1914Smrg  # Any one fine-grained sleep might happen to cross the boundary
89400ca1914Smrg  # between two values of a coarser actual resolution, but if we do
89500ca1914Smrg  # two fine-grained sleeps in a row, at least one of them will fall
89600ca1914Smrg  # entirely within a coarse interval.
89700ca1914Smrg  echo alpha > conftest.ts1
89800ca1914Smrg  sleep $am_try_res
89900ca1914Smrg  echo beta > conftest.ts2
90000ca1914Smrg  sleep $am_try_res
90100ca1914Smrg  echo gamma > conftest.ts3
90200ca1914Smrg
90300ca1914Smrg  # We assume that 'ls -t' will make use of high-resolution
90400ca1914Smrg  # timestamps if the operating system supports them at all.
90500ca1914Smrg  if (set X `ls -t conftest.ts?` &&
90600ca1914Smrg      test "$[]2" = conftest.ts3 &&
90700ca1914Smrg      test "$[]3" = conftest.ts2 &&
90800ca1914Smrg      test "$[]4" = conftest.ts1); then
90900ca1914Smrg    #
91000ca1914Smrg    # Ok, ls -t worked. If we're at a resolution of 1 second, we're done,
91100ca1914Smrg    # because we don't need to test make.
91200ca1914Smrg    make_ok=true
91300ca1914Smrg    if test $am_try_res != 1; then
91400ca1914Smrg      # But if we've succeeded so far with a subsecond resolution, we
91500ca1914Smrg      # have one more thing to check: make. It can happen that
91600ca1914Smrg      # everything else supports the subsecond mtimes, but make doesn't;
91700ca1914Smrg      # notably on macOS, which ships make 3.81 from 2006 (the last one
91800ca1914Smrg      # released under GPLv2). https://bugs.gnu.org/68808
91900ca1914Smrg      # 
92000ca1914Smrg      # We test $MAKE if it is defined in the environment, else "make".
92100ca1914Smrg      # It might get overridden later, but our hope is that in practice
92200ca1914Smrg      # it does not matter: it is the system "make" which is (by far)
92300ca1914Smrg      # the most likely to be broken, whereas if the user overrides it,
92400ca1914Smrg      # probably they did so with a better, or at least not worse, make.
92500ca1914Smrg      # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html
92600ca1914Smrg      #
92700ca1914Smrg      # Create a Makefile (real tab character here):
92800ca1914Smrg      rm -f conftest.mk
92900ca1914Smrg      echo 'conftest.ts1: conftest.ts2' >conftest.mk
93000ca1914Smrg      echo '	touch conftest.ts2' >>conftest.mk
93100ca1914Smrg      #
93200ca1914Smrg      # Now, running
93300ca1914Smrg      #   touch conftest.ts1; touch conftest.ts2; make
93400ca1914Smrg      # should touch ts1 because ts2 is newer. This could happen by luck,
93500ca1914Smrg      # but most often, it will fail if make's support is insufficient. So
93600ca1914Smrg      # test for several consecutive successes.
93700ca1914Smrg      #
93800ca1914Smrg      # (We reuse conftest.ts[12] because we still want to modify existing
93900ca1914Smrg      # files, not create new ones, per above.)
94000ca1914Smrg      n=0
94100ca1914Smrg      make=${MAKE-make}
94200ca1914Smrg      until test $n -eq 3; do
94300ca1914Smrg        echo one > conftest.ts1
94400ca1914Smrg        sleep $am_try_res
94500ca1914Smrg        echo two > conftest.ts2 # ts2 should now be newer than ts1
94600ca1914Smrg        if $make -f conftest.mk | grep 'up to date' >/dev/null; then
94700ca1914Smrg          make_ok=false
94800ca1914Smrg          break # out of $n loop
94900ca1914Smrg        fi
95000ca1914Smrg        n=`expr $n + 1`
95100ca1914Smrg      done
95200ca1914Smrg    fi
95300ca1914Smrg    #
95400ca1914Smrg    if $make_ok; then
95500ca1914Smrg      # Everything we know to check worked out, so call this resolution good.
95600ca1914Smrg      am_cv_filesystem_timestamp_resolution=$am_try_res
95700ca1914Smrg      break # out of $am_try_res loop
95800ca1914Smrg    fi
95900ca1914Smrg    # Otherwise, we'll go on to check the next resolution.
96000ca1914Smrg  fi
96100ca1914Smrgdone
96200ca1914Smrgrm -f conftest.ts?
96300ca1914Smrg# (end _am_filesystem_timestamp_resolution)
96400ca1914Smrg])])
96500ca1914Smrg
966549e21daSmrg# AM_SANITY_CHECK
967549e21daSmrg# ---------------
968549e21daSmrgAC_DEFUN([AM_SANITY_CHECK],
96900ca1914Smrg[AC_REQUIRE([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION])
97000ca1914Smrg# This check should not be cached, as it may vary across builds of
97100ca1914Smrg# different projects.
97200ca1914SmrgAC_MSG_CHECKING([whether build environment is sane])
973549e21daSmrg# Reject unsafe characters in $srcdir or the absolute working directory
974549e21daSmrg# name.  Accept space and tab only in the latter.
975549e21daSmrgam_lf='
976549e21daSmrg'
977549e21daSmrgcase `pwd` in
978549e21daSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
979549e21daSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
980549e21daSmrgesac
981549e21daSmrgcase $srcdir in
982549e21daSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
9831bedbe3fSmrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
984549e21daSmrgesac
985ba6a1819Smrg
9861bedbe3fSmrg# Do 'set' in a subshell so we don't clobber the current shell's
987549e21daSmrg# arguments.  Must try -L first in case configure is actually a
988549e21daSmrg# symlink; some systems play weird games with the mod time of symlinks
989549e21daSmrg# (eg FreeBSD returns the mod time of the symlink's containing
990549e21daSmrg# directory).
99100ca1914Smrgam_build_env_is_sane=no
99200ca1914Smrgam_has_slept=no
99300ca1914Smrgrm -f conftest.file
99400ca1914Smrgfor am_try in 1 2; do
99500ca1914Smrg  echo "timestamp, slept: $am_has_slept" > conftest.file
99600ca1914Smrg  if (
99700ca1914Smrg    set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
99800ca1914Smrg    if test "$[]*" = "X"; then
99900ca1914Smrg      # -L didn't work.
100000ca1914Smrg      set X `ls -t "$srcdir/configure" conftest.file`
100100ca1914Smrg    fi
100200ca1914Smrg    test "$[]2" = conftest.file
100300ca1914Smrg  ); then
100400ca1914Smrg    am_build_env_is_sane=yes
100500ca1914Smrg    break
100600ca1914Smrg  fi
100700ca1914Smrg  # Just in case.
100800ca1914Smrg  sleep "$am_cv_filesystem_timestamp_resolution"
100900ca1914Smrg  am_has_slept=yes
101000ca1914Smrgdone
101100ca1914Smrg
101200ca1914SmrgAC_MSG_RESULT([$am_build_env_is_sane])
101300ca1914Smrgif test "$am_build_env_is_sane" = no; then
101400ca1914Smrg  AC_MSG_ERROR([newly created file is older than distributed files!
1015549e21daSmrgCheck your system clock])
1016549e21daSmrgfi
101700ca1914Smrg
10181bedbe3fSmrg# If we didn't sleep, we still need to ensure time stamps of config.status and
10191bedbe3fSmrg# generated files are strictly newer.
10201bedbe3fSmrgam_sleep_pid=
102100ca1914SmrgAS_IF([test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1],, [dnl
102200ca1914Smrg  ( sleep "$am_cv_filesystem_timestamp_resolution" ) &
10231bedbe3fSmrg  am_sleep_pid=$!
102400ca1914Smrg])
10251bedbe3fSmrgAC_CONFIG_COMMANDS_PRE(
10261bedbe3fSmrg  [AC_MSG_CHECKING([that generated files are newer than configure])
10271bedbe3fSmrg   if test -n "$am_sleep_pid"; then
10281bedbe3fSmrg     # Hide warnings about reused PIDs.
10291bedbe3fSmrg     wait $am_sleep_pid 2>/dev/null
10301bedbe3fSmrg   fi
10311bedbe3fSmrg   AC_MSG_RESULT([done])])
10321bedbe3fSmrgrm -f conftest.file
10331bedbe3fSmrg])
1034549e21daSmrg
103500ca1914Smrg# Copyright (C) 2009-2024 Free Software Foundation, Inc.
1036ba6a1819Smrg#
1037ba6a1819Smrg# This file is free software; the Free Software Foundation
1038ba6a1819Smrg# gives unlimited permission to copy and/or distribute it,
1039ba6a1819Smrg# with or without modifications, as long as this notice is preserved.
1040ba6a1819Smrg
104100ca1914Smrg# _AM_SILENT_RULES
104200ca1914Smrg# ----------------
104300ca1914Smrg# Enable less verbose build rules support.
104400ca1914SmrgAC_DEFUN([_AM_SILENT_RULES],
104500ca1914Smrg[AM_DEFAULT_VERBOSITY=1
104600ca1914SmrgAC_ARG_ENABLE([silent-rules], [dnl
10471bedbe3fSmrgAS_HELP_STRING(
10481bedbe3fSmrg  [--enable-silent-rules],
10491bedbe3fSmrg  [less verbose build output (undo: "make V=1")])
10501bedbe3fSmrgAS_HELP_STRING(
10511bedbe3fSmrg  [--disable-silent-rules],
10521bedbe3fSmrg  [verbose build output (undo: "make V=0")])dnl
10531bedbe3fSmrg])
10541bedbe3fSmrgdnl
10551bedbe3fSmrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
10561bedbe3fSmrgdnl do not support nested variable expansions.
10571bedbe3fSmrgdnl See automake bug#9928 and bug#10237.
10581bedbe3fSmrgam_make=${MAKE-make}
10591bedbe3fSmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
10601bedbe3fSmrg   [am_cv_make_support_nested_variables],
10611bedbe3fSmrg   [if AS_ECHO([['TRUE=$(BAR$(V))
10621bedbe3fSmrgBAR0=false
10631bedbe3fSmrgBAR1=true
10641bedbe3fSmrgV=1
10651bedbe3fSmrgam__doit:
10661bedbe3fSmrg	@$(TRUE)
10671bedbe3fSmrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
10681bedbe3fSmrg  am_cv_make_support_nested_variables=yes
10691bedbe3fSmrgelse
10701bedbe3fSmrg  am_cv_make_support_nested_variables=no
10711bedbe3fSmrgfi])
10721bedbe3fSmrgAC_SUBST([AM_V])dnl
10731bedbe3fSmrgAM_SUBST_NOTMAKE([AM_V])dnl
10741bedbe3fSmrgAC_SUBST([AM_DEFAULT_V])dnl
10751bedbe3fSmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
1076549e21daSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
1077549e21daSmrgAM_BACKSLASH='\'
1078549e21daSmrgAC_SUBST([AM_BACKSLASH])dnl
1079549e21daSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
108000ca1914Smrgdnl Delay evaluation of AM_DEFAULT_VERBOSITY to the end to allow multiple calls
108100ca1914Smrgdnl to AM_SILENT_RULES to change the default value.
108200ca1914SmrgAC_CONFIG_COMMANDS_PRE([dnl
108300ca1914Smrgcase $enable_silent_rules in @%:@ (((
108400ca1914Smrg  yes) AM_DEFAULT_VERBOSITY=0;;
108500ca1914Smrg   no) AM_DEFAULT_VERBOSITY=1;;
108600ca1914Smrgesac
108700ca1914Smrgif test $am_cv_make_support_nested_variables = yes; then
108800ca1914Smrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
108900ca1914Smrg  AM_V='$(V)'
109000ca1914Smrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
109100ca1914Smrgelse
109200ca1914Smrg  AM_V=$AM_DEFAULT_VERBOSITY
109300ca1914Smrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
109400ca1914Smrgfi
109500ca1914Smrg])dnl
1096549e21daSmrg])
1097ba6a1819Smrg
109800ca1914Smrg# AM_SILENT_RULES([DEFAULT])
109900ca1914Smrg# --------------------------
110000ca1914Smrg# Set the default verbosity level to DEFAULT ("yes" being less verbose, "no" or
110100ca1914Smrg# empty being verbose).
110200ca1914SmrgAC_DEFUN([AM_SILENT_RULES],
110300ca1914Smrg[AC_REQUIRE([_AM_SILENT_RULES])
110400ca1914SmrgAM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1])])
110500ca1914Smrg
110600ca1914Smrg# Copyright (C) 2001-2024 Free Software Foundation, Inc.
1107ba6a1819Smrg#
1108ba6a1819Smrg# This file is free software; the Free Software Foundation
1109ba6a1819Smrg# gives unlimited permission to copy and/or distribute it,
1110ba6a1819Smrg# with or without modifications, as long as this notice is preserved.
1111ba6a1819Smrg
1112549e21daSmrg# AM_PROG_INSTALL_STRIP
1113549e21daSmrg# ---------------------
11141bedbe3fSmrg# One issue with vendor 'install' (even GNU) is that you can't
1115549e21daSmrg# specify the program used to strip binaries.  This is especially
1116549e21daSmrg# annoying in cross-compiling environments, where the build's strip
1117549e21daSmrg# is unlikely to handle the host's binaries.
1118549e21daSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
11191bedbe3fSmrg# always use install-sh in "make install-strip", and initialize
1120549e21daSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
1121549e21daSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
1122549e21daSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
11231bedbe3fSmrg# Installed binaries are usually stripped using 'strip' when the user
11241bedbe3fSmrg# run "make install-strip".  However 'strip' might not be the right
1125549e21daSmrg# tool to use in cross-compilation environments, therefore Automake
11261bedbe3fSmrg# will honor the 'STRIP' environment variable to overrule this program.
11271bedbe3fSmrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
1128549e21daSmrgif test "$cross_compiling" != no; then
1129549e21daSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
1130ba6a1819Smrgfi
1131549e21daSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1132549e21daSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
1133ba6a1819Smrg
113400ca1914Smrg# Copyright (C) 2006-2024 Free Software Foundation, Inc.
1135549e21daSmrg#
1136549e21daSmrg# This file is free software; the Free Software Foundation
1137549e21daSmrg# gives unlimited permission to copy and/or distribute it,
1138549e21daSmrg# with or without modifications, as long as this notice is preserved.
1139ba6a1819Smrg
1140549e21daSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
1141549e21daSmrg# ---------------------------
1142549e21daSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1143549e21daSmrg# This macro is traced by Automake.
1144549e21daSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
1145ba6a1819Smrg
1146549e21daSmrg# AM_SUBST_NOTMAKE(VARIABLE)
11471bedbe3fSmrg# --------------------------
1148549e21daSmrg# Public sister of _AM_SUBST_NOTMAKE.
1149549e21daSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1150ba6a1819Smrg
1151549e21daSmrg# Check how to create a tarball.                            -*- Autoconf -*-
1152ba6a1819Smrg
115300ca1914Smrg# Copyright (C) 2004-2024 Free Software Foundation, Inc.
1154ba6a1819Smrg#
1155ba6a1819Smrg# This file is free software; the Free Software Foundation
1156ba6a1819Smrg# gives unlimited permission to copy and/or distribute it,
1157ba6a1819Smrg# with or without modifications, as long as this notice is preserved.
1158ba6a1819Smrg
1159549e21daSmrg# _AM_PROG_TAR(FORMAT)
1160549e21daSmrg# --------------------
1161549e21daSmrg# Check how to create a tarball in format FORMAT.
11621bedbe3fSmrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
1163ba6a1819Smrg#
1164549e21daSmrg# Substitute a variable $(am__tar) that is a command
1165549e21daSmrg# writing to stdout a FORMAT-tarball containing the directory
1166549e21daSmrg# $tardir.
1167549e21daSmrg#     tardir=directory && $(am__tar) > result.tar
1168549e21daSmrg#
1169549e21daSmrg# Substitute a variable $(am__untar) that extract such
1170549e21daSmrg# a tarball read from stdin.
1171549e21daSmrg#     $(am__untar) < result.tar
11721bedbe3fSmrg#
1173549e21daSmrgAC_DEFUN([_AM_PROG_TAR],
11741bedbe3fSmrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
11751bedbe3fSmrg# in the wild :-(  We should find a proper way to deprecate it ...
11761bedbe3fSmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
11771bedbe3fSmrg
11781bedbe3fSmrg# We'll loop over all known methods to create a tar archive until one works.
1179549e21daSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1180ba6a1819Smrg
11811bedbe3fSmrgm4_if([$1], [v7],
11821bedbe3fSmrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
11831bedbe3fSmrg
11841bedbe3fSmrg  [m4_case([$1],
11851bedbe3fSmrg    [ustar],
11861bedbe3fSmrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
11871bedbe3fSmrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
11881bedbe3fSmrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
11891bedbe3fSmrg      # and bug#13588).
11901bedbe3fSmrg      am_max_uid=2097151 # 2^21 - 1
11911bedbe3fSmrg      am_max_gid=$am_max_uid
11921bedbe3fSmrg      # The $UID and $GID variables are not portable, so we need to resort
11931bedbe3fSmrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
11941bedbe3fSmrg      # below are definitely unexpected, so allow the users to see them
11951bedbe3fSmrg      # (that is, avoid stderr redirection).
11961bedbe3fSmrg      am_uid=`id -u || echo unknown`
11971bedbe3fSmrg      am_gid=`id -g || echo unknown`
11981bedbe3fSmrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
119900ca1914Smrg      if test x$am_uid = xunknown; then
120000ca1914Smrg        AC_MSG_WARN([ancient id detected; assuming current UID is ok, but dist-ustar might not work])
120100ca1914Smrg      elif test $am_uid -le $am_max_uid; then
120200ca1914Smrg        AC_MSG_RESULT([yes])
12031bedbe3fSmrg      else
120400ca1914Smrg        AC_MSG_RESULT([no])
120500ca1914Smrg        _am_tools=none
12061bedbe3fSmrg      fi
12071bedbe3fSmrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
120800ca1914Smrg      if test x$gm_gid = xunknown; then
120900ca1914Smrg        AC_MSG_WARN([ancient id detected; assuming current GID is ok, but dist-ustar might not work])
121000ca1914Smrg      elif test $am_gid -le $am_max_gid; then
121100ca1914Smrg        AC_MSG_RESULT([yes])
12121bedbe3fSmrg      else
12131bedbe3fSmrg        AC_MSG_RESULT([no])
12141bedbe3fSmrg        _am_tools=none
12151bedbe3fSmrg      fi],
12161bedbe3fSmrg
12171bedbe3fSmrg  [pax],
12181bedbe3fSmrg    [],
1219ba6a1819Smrg
12201bedbe3fSmrg  [m4_fatal([Unknown tar format])])
12211bedbe3fSmrg
12221bedbe3fSmrg  AC_MSG_CHECKING([how to create a $1 tar archive])
12231bedbe3fSmrg
12241bedbe3fSmrg  # Go ahead even if we have the value already cached.  We do so because we
12251bedbe3fSmrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
12261bedbe3fSmrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
12271bedbe3fSmrg
12281bedbe3fSmrg  for _am_tool in $_am_tools; do
12291bedbe3fSmrg    case $_am_tool in
12301bedbe3fSmrg    gnutar)
12311bedbe3fSmrg      for _am_tar in tar gnutar gtar; do
12321bedbe3fSmrg        AM_RUN_LOG([$_am_tar --version]) && break
12331bedbe3fSmrg      done
12341bedbe3fSmrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
12351bedbe3fSmrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
12361bedbe3fSmrg      am__untar="$_am_tar -xf -"
12371bedbe3fSmrg      ;;
12381bedbe3fSmrg    plaintar)
12391bedbe3fSmrg      # Must skip GNU tar: if it does not support --format= it doesn't create
12401bedbe3fSmrg      # ustar tarball either.
12411bedbe3fSmrg      (tar --version) >/dev/null 2>&1 && continue
12421bedbe3fSmrg      am__tar='tar chf - "$$tardir"'
12431bedbe3fSmrg      am__tar_='tar chf - "$tardir"'
12441bedbe3fSmrg      am__untar='tar xf -'
12451bedbe3fSmrg      ;;
12461bedbe3fSmrg    pax)
12471bedbe3fSmrg      am__tar='pax -L -x $1 -w "$$tardir"'
12481bedbe3fSmrg      am__tar_='pax -L -x $1 -w "$tardir"'
12491bedbe3fSmrg      am__untar='pax -r'
12501bedbe3fSmrg      ;;
12511bedbe3fSmrg    cpio)
12521bedbe3fSmrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
12531bedbe3fSmrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
12541bedbe3fSmrg      am__untar='cpio -i -H $1 -d'
12551bedbe3fSmrg      ;;
12561bedbe3fSmrg    none)
12571bedbe3fSmrg      am__tar=false
12581bedbe3fSmrg      am__tar_=false
12591bedbe3fSmrg      am__untar=false
12601bedbe3fSmrg      ;;
12611bedbe3fSmrg    esac
12621bedbe3fSmrg
12631bedbe3fSmrg    # If the value was cached, stop now.  We just wanted to have am__tar
12641bedbe3fSmrg    # and am__untar set.
12651bedbe3fSmrg    test -n "${am_cv_prog_tar_$1}" && break
12661bedbe3fSmrg
12671bedbe3fSmrg    # tar/untar a dummy directory, and stop if the command works.
12681bedbe3fSmrg    rm -rf conftest.dir
12691bedbe3fSmrg    mkdir conftest.dir
12701bedbe3fSmrg    echo GrepMe > conftest.dir/file
12711bedbe3fSmrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
12721bedbe3fSmrg    rm -rf conftest.dir
12731bedbe3fSmrg    if test -s conftest.tar; then
12741bedbe3fSmrg      AM_RUN_LOG([$am__untar <conftest.tar])
12751bedbe3fSmrg      AM_RUN_LOG([cat conftest.dir/file])
12761bedbe3fSmrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
12771bedbe3fSmrg    fi
12781bedbe3fSmrg  done
1279549e21daSmrg  rm -rf conftest.dir
1280ba6a1819Smrg
12811bedbe3fSmrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
12821bedbe3fSmrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
12831bedbe3fSmrg
1284549e21daSmrgAC_SUBST([am__tar])
1285549e21daSmrgAC_SUBST([am__untar])
1286549e21daSmrg]) # _AM_PROG_TAR
1287ba6a1819Smrg
128800ca1914Smrg# Copyright (C) 2022-2024 Free Software Foundation, Inc.
128900ca1914Smrg#
129000ca1914Smrg# This file is free software; the Free Software Foundation
129100ca1914Smrg# gives unlimited permission to copy and/or distribute it,
129200ca1914Smrg# with or without modifications, as long as this notice is preserved.
129300ca1914Smrg
129400ca1914Smrg# _AM_PROG_XARGS_N
129500ca1914Smrg# ----------------
129600ca1914Smrg# Check whether 'xargs -n' works.  It should work everywhere, so the fallback
129700ca1914Smrg# is not optimized at all as we never expect to use it.
129800ca1914SmrgAC_DEFUN([_AM_PROG_XARGS_N],
129900ca1914Smrg[AC_CACHE_CHECK([xargs -n works], am_cv_xargs_n_works, [dnl
130000ca1914SmrgAS_IF([test "`echo 1 2 3 | xargs -n2 echo`" = "1 2
130100ca1914Smrg3"], [am_cv_xargs_n_works=yes], [am_cv_xargs_n_works=no])])
130200ca1914SmrgAS_IF([test "$am_cv_xargs_n_works" = yes], [am__xargs_n='xargs -n'], [dnl
130300ca1914Smrg  am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "$@" "$am__xargs_n_arg"; done; }'
130400ca1914Smrg])dnl
130500ca1914SmrgAC_SUBST(am__xargs_n)
130600ca1914Smrg])
130700ca1914Smrg
1308fe4c343aSmrgdnl pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
1309fe4c343aSmrgdnl serial 11 (pkg-config-0.29)
1310fe4c343aSmrgdnl
1311fe4c343aSmrgdnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1312fe4c343aSmrgdnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
1313fe4c343aSmrgdnl
1314fe4c343aSmrgdnl This program is free software; you can redistribute it and/or modify
1315fe4c343aSmrgdnl it under the terms of the GNU General Public License as published by
1316fe4c343aSmrgdnl the Free Software Foundation; either version 2 of the License, or
1317fe4c343aSmrgdnl (at your option) any later version.
1318fe4c343aSmrgdnl
1319fe4c343aSmrgdnl This program is distributed in the hope that it will be useful, but
1320fe4c343aSmrgdnl WITHOUT ANY WARRANTY; without even the implied warranty of
1321fe4c343aSmrgdnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1322fe4c343aSmrgdnl General Public License for more details.
1323fe4c343aSmrgdnl
1324fe4c343aSmrgdnl You should have received a copy of the GNU General Public License
1325fe4c343aSmrgdnl along with this program; if not, write to the Free Software
1326fe4c343aSmrgdnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1327fe4c343aSmrgdnl 02111-1307, USA.
1328fe4c343aSmrgdnl
1329fe4c343aSmrgdnl As a special exception to the GNU General Public License, if you
1330fe4c343aSmrgdnl distribute this file as part of a program that contains a
1331fe4c343aSmrgdnl configuration script generated by Autoconf, you may include it under
1332fe4c343aSmrgdnl the same distribution terms that you use for the rest of that
1333fe4c343aSmrgdnl program.
1334fe4c343aSmrg
1335fe4c343aSmrgdnl PKG_PREREQ(MIN-VERSION)
1336fe4c343aSmrgdnl -----------------------
1337fe4c343aSmrgdnl Since: 0.29
1338fe4c343aSmrgdnl
1339fe4c343aSmrgdnl Verify that the version of the pkg-config macros are at least
1340fe4c343aSmrgdnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
1341fe4c343aSmrgdnl installed version of pkg-config, this checks the developer's version
1342fe4c343aSmrgdnl of pkg.m4 when generating configure.
1343fe4c343aSmrgdnl
1344fe4c343aSmrgdnl To ensure that this macro is defined, also add:
1345fe4c343aSmrgdnl m4_ifndef([PKG_PREREQ],
1346fe4c343aSmrgdnl     [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
1347fe4c343aSmrgdnl
1348fe4c343aSmrgdnl See the "Since" comment for each macro you use to see what version
1349fe4c343aSmrgdnl of the macros you require.
1350fe4c343aSmrgm4_defun([PKG_PREREQ],
1351fe4c343aSmrg[m4_define([PKG_MACROS_VERSION], [0.29])
1352fe4c343aSmrgm4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
1353fe4c343aSmrg    [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
1354fe4c343aSmrg])dnl PKG_PREREQ
1355fe4c343aSmrg
1356fe4c343aSmrgdnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
1357fe4c343aSmrgdnl ----------------------------------
1358fe4c343aSmrgdnl Since: 0.16
1359fe4c343aSmrgdnl
1360fe4c343aSmrgdnl Search for the pkg-config tool and set the PKG_CONFIG variable to
1361fe4c343aSmrgdnl first found in the path. Checks that the version of pkg-config found
1362fe4c343aSmrgdnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
1363fe4c343aSmrgdnl used since that's the first version where most current features of
1364fe4c343aSmrgdnl pkg-config existed.
1365fe4c343aSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
1366fe4c343aSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1367fe4c343aSmrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
1368fe4c343aSmrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
1369fe4c343aSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
1370fe4c343aSmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
1371fe4c343aSmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
1372ba6a1819Smrg
1373fe4c343aSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1374fe4c343aSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1375fe4c343aSmrgfi
1376fe4c343aSmrgif test -n "$PKG_CONFIG"; then
1377fe4c343aSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
1378fe4c343aSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1379fe4c343aSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1380fe4c343aSmrg		AC_MSG_RESULT([yes])
1381fe4c343aSmrg	else
1382fe4c343aSmrg		AC_MSG_RESULT([no])
1383fe4c343aSmrg		PKG_CONFIG=""
1384fe4c343aSmrg	fi
1385fe4c343aSmrgfi[]dnl
1386fe4c343aSmrg])dnl PKG_PROG_PKG_CONFIG
1387ba6a1819Smrg
1388fe4c343aSmrgdnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1389fe4c343aSmrgdnl -------------------------------------------------------------------
1390fe4c343aSmrgdnl Since: 0.18
1391fe4c343aSmrgdnl
1392fe4c343aSmrgdnl Check to see whether a particular set of modules exists. Similar to
1393fe4c343aSmrgdnl PKG_CHECK_MODULES(), but does not set variables or print errors.
1394fe4c343aSmrgdnl
1395fe4c343aSmrgdnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1396fe4c343aSmrgdnl only at the first occurence in configure.ac, so if the first place
1397fe4c343aSmrgdnl it's called might be skipped (such as if it is within an "if", you
1398fe4c343aSmrgdnl have to call PKG_CHECK_EXISTS manually
1399fe4c343aSmrgAC_DEFUN([PKG_CHECK_EXISTS],
1400fe4c343aSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1401fe4c343aSmrgif test -n "$PKG_CONFIG" && \
1402fe4c343aSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1403fe4c343aSmrg  m4_default([$2], [:])
1404fe4c343aSmrgm4_ifvaln([$3], [else
1405fe4c343aSmrg  $3])dnl
1406fe4c343aSmrgfi])
1407ba6a1819Smrg
1408fe4c343aSmrgdnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1409fe4c343aSmrgdnl ---------------------------------------------
1410fe4c343aSmrgdnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
1411fe4c343aSmrgdnl pkg_failed based on the result.
1412fe4c343aSmrgm4_define([_PKG_CONFIG],
1413fe4c343aSmrg[if test -n "$$1"; then
1414fe4c343aSmrg    pkg_cv_[]$1="$$1"
1415fe4c343aSmrg elif test -n "$PKG_CONFIG"; then
1416fe4c343aSmrg    PKG_CHECK_EXISTS([$3],
1417fe4c343aSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
1418fe4c343aSmrg		      test "x$?" != "x0" && pkg_failed=yes ],
1419fe4c343aSmrg		     [pkg_failed=yes])
1420fe4c343aSmrg else
1421fe4c343aSmrg    pkg_failed=untried
1422fe4c343aSmrgfi[]dnl
1423fe4c343aSmrg])dnl _PKG_CONFIG
1424ba6a1819Smrg
1425fe4c343aSmrgdnl _PKG_SHORT_ERRORS_SUPPORTED
1426fe4c343aSmrgdnl ---------------------------
1427fe4c343aSmrgdnl Internal check to see if pkg-config supports short errors.
1428fe4c343aSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1429fe4c343aSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1430fe4c343aSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1431fe4c343aSmrg        _pkg_short_errors_supported=yes
1432fe4c343aSmrgelse
1433fe4c343aSmrg        _pkg_short_errors_supported=no
1434fe4c343aSmrgfi[]dnl
1435fe4c343aSmrg])dnl _PKG_SHORT_ERRORS_SUPPORTED
1436ba6a1819Smrg
1437ba6a1819Smrg
1438fe4c343aSmrgdnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1439fe4c343aSmrgdnl   [ACTION-IF-NOT-FOUND])
1440fe4c343aSmrgdnl --------------------------------------------------------------
1441fe4c343aSmrgdnl Since: 0.4.0
1442fe4c343aSmrgdnl
1443fe4c343aSmrgdnl Note that if there is a possibility the first call to
1444fe4c343aSmrgdnl PKG_CHECK_MODULES might not happen, you should be sure to include an
1445fe4c343aSmrgdnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1446fe4c343aSmrgAC_DEFUN([PKG_CHECK_MODULES],
1447fe4c343aSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1448fe4c343aSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1449fe4c343aSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1450ba6a1819Smrg
1451fe4c343aSmrgpkg_failed=no
1452fe4c343aSmrgAC_MSG_CHECKING([for $1])
1453ba6a1819Smrg
1454fe4c343aSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1455fe4c343aSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1456ba6a1819Smrg
1457fe4c343aSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1458fe4c343aSmrgand $1[]_LIBS to avoid the need to call pkg-config.
1459fe4c343aSmrgSee the pkg-config man page for more details.])
1460ba6a1819Smrg
1461fe4c343aSmrgif test $pkg_failed = yes; then
1462fe4c343aSmrg   	AC_MSG_RESULT([no])
1463fe4c343aSmrg        _PKG_SHORT_ERRORS_SUPPORTED
1464fe4c343aSmrg        if test $_pkg_short_errors_supported = yes; then
1465fe4c343aSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
1466fe4c343aSmrg        else 
1467fe4c343aSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
1468fe4c343aSmrg        fi
1469fe4c343aSmrg	# Put the nasty error message in config.log where it belongs
1470fe4c343aSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1471ba6a1819Smrg
1472fe4c343aSmrg	m4_default([$4], [AC_MSG_ERROR(
1473fe4c343aSmrg[Package requirements ($2) were not met:
1474ba6a1819Smrg
1475fe4c343aSmrg$$1_PKG_ERRORS
1476ba6a1819Smrg
1477fe4c343aSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
1478fe4c343aSmrginstalled software in a non-standard prefix.
1479ba6a1819Smrg
1480fe4c343aSmrg_PKG_TEXT])[]dnl
1481fe4c343aSmrg        ])
1482fe4c343aSmrgelif test $pkg_failed = untried; then
1483fe4c343aSmrg     	AC_MSG_RESULT([no])
1484fe4c343aSmrg	m4_default([$4], [AC_MSG_FAILURE(
1485fe4c343aSmrg[The pkg-config script could not be found or is too old.  Make sure it
1486fe4c343aSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
1487fe4c343aSmrgpath to pkg-config.
1488ba6a1819Smrg
1489fe4c343aSmrg_PKG_TEXT
1490ba6a1819Smrg
1491fe4c343aSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
1492fe4c343aSmrg        ])
1493fe4c343aSmrgelse
1494fe4c343aSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1495fe4c343aSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1496fe4c343aSmrg        AC_MSG_RESULT([yes])
1497fe4c343aSmrg	$3
1498fe4c343aSmrgfi[]dnl
1499fe4c343aSmrg])dnl PKG_CHECK_MODULES
1500ba6a1819Smrg
1501ba6a1819Smrg
1502fe4c343aSmrgdnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1503fe4c343aSmrgdnl   [ACTION-IF-NOT-FOUND])
1504fe4c343aSmrgdnl ---------------------------------------------------------------------
1505fe4c343aSmrgdnl Since: 0.29
1506fe4c343aSmrgdnl
1507fe4c343aSmrgdnl Checks for existence of MODULES and gathers its build flags with
1508fe4c343aSmrgdnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
1509fe4c343aSmrgdnl and VARIABLE-PREFIX_LIBS from --libs.
1510fe4c343aSmrgdnl
1511fe4c343aSmrgdnl Note that if there is a possibility the first call to
1512fe4c343aSmrgdnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
1513fe4c343aSmrgdnl include an explicit call to PKG_PROG_PKG_CONFIG in your
1514fe4c343aSmrgdnl configure.ac.
1515fe4c343aSmrgAC_DEFUN([PKG_CHECK_MODULES_STATIC],
1516fe4c343aSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1517fe4c343aSmrg_save_PKG_CONFIG=$PKG_CONFIG
1518fe4c343aSmrgPKG_CONFIG="$PKG_CONFIG --static"
1519fe4c343aSmrgPKG_CHECK_MODULES($@)
1520fe4c343aSmrgPKG_CONFIG=$_save_PKG_CONFIG[]dnl
1521fe4c343aSmrg])dnl PKG_CHECK_MODULES_STATIC
1522ba6a1819Smrg
1523ba6a1819Smrg
1524fe4c343aSmrgdnl PKG_INSTALLDIR([DIRECTORY])
1525fe4c343aSmrgdnl -------------------------
1526fe4c343aSmrgdnl Since: 0.27
1527fe4c343aSmrgdnl
1528fe4c343aSmrgdnl Substitutes the variable pkgconfigdir as the location where a module
1529fe4c343aSmrgdnl should install pkg-config .pc files. By default the directory is
1530fe4c343aSmrgdnl $libdir/pkgconfig, but the default can be changed by passing
1531fe4c343aSmrgdnl DIRECTORY. The user can override through the --with-pkgconfigdir
1532fe4c343aSmrgdnl parameter.
1533fe4c343aSmrgAC_DEFUN([PKG_INSTALLDIR],
1534fe4c343aSmrg[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
1535fe4c343aSmrgm4_pushdef([pkg_description],
1536fe4c343aSmrg    [pkg-config installation directory @<:@]pkg_default[@:>@])
1537fe4c343aSmrgAC_ARG_WITH([pkgconfigdir],
1538fe4c343aSmrg    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
1539fe4c343aSmrg    [with_pkgconfigdir=]pkg_default)
1540fe4c343aSmrgAC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
1541fe4c343aSmrgm4_popdef([pkg_default])
1542fe4c343aSmrgm4_popdef([pkg_description])
1543fe4c343aSmrg])dnl PKG_INSTALLDIR
1544fe4c343aSmrg
1545fe4c343aSmrg
1546fe4c343aSmrgdnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
1547fe4c343aSmrgdnl --------------------------------
1548fe4c343aSmrgdnl Since: 0.27
1549fe4c343aSmrgdnl
1550fe4c343aSmrgdnl Substitutes the variable noarch_pkgconfigdir as the location where a
1551fe4c343aSmrgdnl module should install arch-independent pkg-config .pc files. By
1552fe4c343aSmrgdnl default the directory is $datadir/pkgconfig, but the default can be
1553fe4c343aSmrgdnl changed by passing DIRECTORY. The user can override through the
1554fe4c343aSmrgdnl --with-noarch-pkgconfigdir parameter.
1555fe4c343aSmrgAC_DEFUN([PKG_NOARCH_INSTALLDIR],
1556fe4c343aSmrg[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
1557fe4c343aSmrgm4_pushdef([pkg_description],
1558fe4c343aSmrg    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
1559fe4c343aSmrgAC_ARG_WITH([noarch-pkgconfigdir],
1560fe4c343aSmrg    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
1561fe4c343aSmrg    [with_noarch_pkgconfigdir=]pkg_default)
1562fe4c343aSmrgAC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
1563fe4c343aSmrgm4_popdef([pkg_default])
1564fe4c343aSmrgm4_popdef([pkg_description])
1565fe4c343aSmrg])dnl PKG_NOARCH_INSTALLDIR
1566fe4c343aSmrg
1567fe4c343aSmrg
1568fe4c343aSmrgdnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
1569fe4c343aSmrgdnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1570fe4c343aSmrgdnl -------------------------------------------
1571fe4c343aSmrgdnl Since: 0.28
1572fe4c343aSmrgdnl
1573fe4c343aSmrgdnl Retrieves the value of the pkg-config variable for the given module.
1574fe4c343aSmrgAC_DEFUN([PKG_CHECK_VAR],
1575fe4c343aSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1576fe4c343aSmrgAC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
1577ba6a1819Smrg
1578fe4c343aSmrg_PKG_CONFIG([$1], [variable="][$3]["], [$2])
1579fe4c343aSmrgAS_VAR_COPY([$1], [pkg_cv_][$1])
1580ba6a1819Smrg
1581fe4c343aSmrgAS_VAR_IF([$1], [""], [$5], [$4])dnl
1582fe4c343aSmrg])dnl PKG_CHECK_VAR
1583ba6a1819Smrg
1584fe4c343aSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
15851bedbe3fSmrgdnl
158600ca1914Smrgdnl Copyright (c) 2005, 2023, Oracle and/or its affiliates.
15871bedbe3fSmrgdnl
1588fe4c343aSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
1589fe4c343aSmrgdnl copy of this software and associated documentation files (the "Software"),
1590fe4c343aSmrgdnl to deal in the Software without restriction, including without limitation
1591fe4c343aSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
1592fe4c343aSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
1593fe4c343aSmrgdnl Software is furnished to do so, subject to the following conditions:
15941bedbe3fSmrgdnl
1595fe4c343aSmrgdnl The above copyright notice and this permission notice (including the next
1596fe4c343aSmrgdnl paragraph) shall be included in all copies or substantial portions of the
1597fe4c343aSmrgdnl Software.
15981bedbe3fSmrgdnl
1599fe4c343aSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1600fe4c343aSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1601fe4c343aSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1602fe4c343aSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1603fe4c343aSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1604fe4c343aSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1605fe4c343aSmrgdnl DEALINGS IN THE SOFTWARE.
1606ba6a1819Smrg
1607fe4c343aSmrg# XORG_MACROS_VERSION(required-version)
1608fe4c343aSmrg# -------------------------------------
1609fe4c343aSmrg# Minimum version: 1.1.0
1610fe4c343aSmrg#
1611fe4c343aSmrg# If you're using a macro added in Version 1.1 or newer, include this in
1612fe4c343aSmrg# your configure.ac with the minimum required version, such as:
1613fe4c343aSmrg# XORG_MACROS_VERSION(1.1)
1614fe4c343aSmrg#
1615fe4c343aSmrg# To ensure that this macro is defined, also add:
1616fe4c343aSmrg# m4_ifndef([XORG_MACROS_VERSION],
1617fe4c343aSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
1618fe4c343aSmrg#
1619fe4c343aSmrg#
1620fe4c343aSmrg# See the "minimum version" comment for each macro you use to see what
1621fe4c343aSmrg# version you require.
1622fe4c343aSmrgm4_defun([XORG_MACROS_VERSION],[
162300ca1914Smrgm4_define([vers_have], [1.20.1])
1624fe4c343aSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1625fe4c343aSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1626fe4c343aSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
1627fe4c343aSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1628fe4c343aSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
1629fe4c343aSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1630fe4c343aSmrgm4_undefine([vers_have])
1631fe4c343aSmrgm4_undefine([maj_have])
1632fe4c343aSmrgm4_undefine([maj_needed])
1633fe4c343aSmrg]) # XORG_MACROS_VERSION
1634ba6a1819Smrg
1635fe4c343aSmrg# XORG_PROG_RAWCPP()
1636fe4c343aSmrg# ------------------
1637fe4c343aSmrg# Minimum version: 1.0.0
1638fe4c343aSmrg#
1639fe4c343aSmrg# Find cpp program and necessary flags for use in pre-processing text files
1640fe4c343aSmrg# such as man pages and config files
1641fe4c343aSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
1642fe4c343aSmrgAC_REQUIRE([AC_PROG_CPP])
1643fe4c343aSmrgAC_PATH_TOOL(RAWCPP, [cpp], [${CPP}],
1644fe4c343aSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1645ba6a1819Smrg
1646fe4c343aSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
1647fe4c343aSmrg# which is not the best choice for supporting other OS'es, but covers most
1648fe4c343aSmrg# of the ones we need for now.
1649fe4c343aSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
1650fe4c343aSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
1651fe4c343aSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1652fe4c343aSmrg	AC_MSG_RESULT([no])
1653fe4c343aSmrgelse
1654fe4c343aSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1655fe4c343aSmrg		RAWCPPFLAGS=-undef
1656fe4c343aSmrg		AC_MSG_RESULT([yes])
1657fe4c343aSmrg	# under Cygwin unix is still defined even with -undef
1658fe4c343aSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1659fe4c343aSmrg		RAWCPPFLAGS="-undef -ansi"
1660fe4c343aSmrg		AC_MSG_RESULT([yes, with -ansi])
1661fe4c343aSmrg	else
1662fe4c343aSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1663fe4c343aSmrg	fi
1664fe4c343aSmrgfi
1665fe4c343aSmrgrm -f conftest.$ac_ext
1666ba6a1819Smrg
1667fe4c343aSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
1668fe4c343aSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
166900ca1914Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   "'` -eq 1 ; then
1670fe4c343aSmrg	AC_MSG_RESULT([no])
1671fe4c343aSmrgelse
167200ca1914Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   "'` -eq 1 ; then
1673fe4c343aSmrg		TRADITIONALCPPFLAGS="-traditional"
1674fe4c343aSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1675fe4c343aSmrg		AC_MSG_RESULT([yes])
1676fe4c343aSmrg	else
1677fe4c343aSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1678fe4c343aSmrg	fi
1679fe4c343aSmrgfi
1680fe4c343aSmrgrm -f conftest.$ac_ext
1681fe4c343aSmrgAC_SUBST(RAWCPPFLAGS)
1682fe4c343aSmrgAC_SUBST(TRADITIONALCPPFLAGS)
1683fe4c343aSmrg]) # XORG_PROG_RAWCPP
1684ba6a1819Smrg
1685fe4c343aSmrg# XORG_MANPAGE_SECTIONS()
1686fe4c343aSmrg# -----------------------
1687fe4c343aSmrg# Minimum version: 1.0.0
1688fe4c343aSmrg#
1689fe4c343aSmrg# Determine which sections man pages go in for the different man page types
1690fe4c343aSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1691fe4c343aSmrg# Not sure if there's any better way than just hardcoding by OS name.
1692fe4c343aSmrg# Override default settings by setting environment variables
1693fe4c343aSmrg# Added MAN_SUBSTS in version 1.8
1694fe4c343aSmrg# Added AC_PROG_SED in version 1.8
1695549e21daSmrg
1696fe4c343aSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1697fe4c343aSmrgAC_REQUIRE([AC_CANONICAL_HOST])
1698fe4c343aSmrgAC_REQUIRE([AC_PROG_SED])
1699549e21daSmrg
1700fe4c343aSmrgcase $host_os in
1701fe4c343aSmrg    solaris*)
1702fe4c343aSmrg        # Solaris 2.0 - 11.3 use SysV man page section numbers, so we
1703fe4c343aSmrg        # check for a man page file found in later versions that use
1704fe4c343aSmrg        # traditional section numbers instead
1705fe4c343aSmrg        AC_CHECK_FILE([/usr/share/man/man7/attributes.7],
1706fe4c343aSmrg                [SYSV_MAN_SECTIONS=false], [SYSV_MAN_SECTIONS=true])
1707fe4c343aSmrg        ;;
1708fe4c343aSmrg    *) SYSV_MAN_SECTIONS=false ;;
1709fe4c343aSmrgesac
1710549e21daSmrg
1711fe4c343aSmrgif test x$APP_MAN_SUFFIX = x    ; then
1712fe4c343aSmrg    APP_MAN_SUFFIX=1
1713fe4c343aSmrgfi
1714fe4c343aSmrgif test x$APP_MAN_DIR = x    ; then
1715fe4c343aSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1716fe4c343aSmrgfi
1717549e21daSmrg
1718fe4c343aSmrgif test x$LIB_MAN_SUFFIX = x    ; then
1719fe4c343aSmrg    LIB_MAN_SUFFIX=3
1720fe4c343aSmrgfi
1721fe4c343aSmrgif test x$LIB_MAN_DIR = x    ; then
1722fe4c343aSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1723fe4c343aSmrgfi
1724ba6a1819Smrg
1725fe4c343aSmrgif test x$FILE_MAN_SUFFIX = x    ; then
1726fe4c343aSmrg    case $SYSV_MAN_SECTIONS in
1727fe4c343aSmrg	true)				FILE_MAN_SUFFIX=4  ;;
1728fe4c343aSmrg	*)				FILE_MAN_SUFFIX=5  ;;
1729fe4c343aSmrg    esac
1730fe4c343aSmrgfi
1731fe4c343aSmrgif test x$FILE_MAN_DIR = x    ; then
1732fe4c343aSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1733fe4c343aSmrgfi
1734549e21daSmrg
1735fe4c343aSmrgif test x$MISC_MAN_SUFFIX = x    ; then
1736fe4c343aSmrg    case $SYSV_MAN_SECTIONS in
1737fe4c343aSmrg	true)				MISC_MAN_SUFFIX=5  ;;
1738fe4c343aSmrg	*)				MISC_MAN_SUFFIX=7  ;;
1739fe4c343aSmrg    esac
1740fe4c343aSmrgfi
1741fe4c343aSmrgif test x$MISC_MAN_DIR = x    ; then
1742fe4c343aSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1743fe4c343aSmrgfi
1744549e21daSmrg
1745fe4c343aSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
1746fe4c343aSmrg    case $SYSV_MAN_SECTIONS in
1747fe4c343aSmrg	true)				DRIVER_MAN_SUFFIX=7  ;;
1748fe4c343aSmrg	*)				DRIVER_MAN_SUFFIX=4  ;;
1749fe4c343aSmrg    esac
1750fe4c343aSmrgfi
1751fe4c343aSmrgif test x$DRIVER_MAN_DIR = x    ; then
1752fe4c343aSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1753fe4c343aSmrgfi
1754549e21daSmrg
1755fe4c343aSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
1756fe4c343aSmrg    case $SYSV_MAN_SECTIONS in
1757fe4c343aSmrg	true)				ADMIN_MAN_SUFFIX=1m ;;
1758fe4c343aSmrg	*)				ADMIN_MAN_SUFFIX=8  ;;
1759fe4c343aSmrg    esac
1760fe4c343aSmrgfi
1761fe4c343aSmrgif test x$ADMIN_MAN_DIR = x    ; then
1762fe4c343aSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1763fe4c343aSmrgfi
1764ba6a1819Smrg
1765549e21daSmrg
1766fe4c343aSmrgAC_SUBST([APP_MAN_SUFFIX])
1767fe4c343aSmrgAC_SUBST([LIB_MAN_SUFFIX])
1768fe4c343aSmrgAC_SUBST([FILE_MAN_SUFFIX])
1769fe4c343aSmrgAC_SUBST([MISC_MAN_SUFFIX])
1770fe4c343aSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
1771fe4c343aSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
1772fe4c343aSmrgAC_SUBST([APP_MAN_DIR])
1773fe4c343aSmrgAC_SUBST([LIB_MAN_DIR])
1774fe4c343aSmrgAC_SUBST([FILE_MAN_DIR])
1775fe4c343aSmrgAC_SUBST([MISC_MAN_DIR])
1776fe4c343aSmrgAC_SUBST([DRIVER_MAN_DIR])
1777fe4c343aSmrgAC_SUBST([ADMIN_MAN_DIR])
1778ba6a1819Smrg
1779fe4c343aSmrgXORG_MAN_PAGE="X Version 11"
1780fe4c343aSmrgAC_SUBST([XORG_MAN_PAGE])
1781fe4c343aSmrgMAN_SUBSTS="\
1782fe4c343aSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1783fe4c343aSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1784fe4c343aSmrg	-e 's|__xservername__|Xorg|g' \
1785fe4c343aSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
1786fe4c343aSmrg	-e 's|__projectroot__|\$(prefix)|g' \
1787fe4c343aSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
1788fe4c343aSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
1789fe4c343aSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
1790fe4c343aSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
1791fe4c343aSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
1792fe4c343aSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
1793fe4c343aSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
1794fe4c343aSmrgAC_SUBST([MAN_SUBSTS])
1795549e21daSmrg
1796fe4c343aSmrg]) # XORG_MANPAGE_SECTIONS
1797549e21daSmrg
1798fe4c343aSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
1799fe4c343aSmrg# ------------------------
1800fe4c343aSmrg# Minimum version: 1.7.0
1801fe4c343aSmrg#
1802fe4c343aSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
1803fe4c343aSmrg# provided by xorg-sgml-doctools, if installed.
1804fe4c343aSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
1805fe4c343aSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
1806fe4c343aSmrgXORG_SGML_PATH=
1807fe4c343aSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
1808fe4c343aSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
1809fe4c343aSmrg    [m4_ifval([$1],[:],
1810fe4c343aSmrg        [if test x"$cross_compiling" != x"yes" ; then
1811fe4c343aSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
1812fe4c343aSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
1813fe4c343aSmrg         fi])
1814fe4c343aSmrg    ])
1815ba6a1819Smrg
1816fe4c343aSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
1817fe4c343aSmrg# the path and the name of the doc stylesheet
1818fe4c343aSmrgif test "x$XORG_SGML_PATH" != "x" ; then
1819fe4c343aSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
1820fe4c343aSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
1821fe4c343aSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
1822fe4c343aSmrgelse
1823fe4c343aSmrg   AC_MSG_RESULT([no])
1824fe4c343aSmrgfi
1825ba6a1819Smrg
1826fe4c343aSmrgAC_SUBST(XORG_SGML_PATH)
1827fe4c343aSmrgAC_SUBST(STYLESHEET_SRCDIR)
1828fe4c343aSmrgAC_SUBST(XSL_STYLESHEET)
1829fe4c343aSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
1830fe4c343aSmrg]) # XORG_CHECK_SGML_DOCTOOLS
1831549e21daSmrg
1832fe4c343aSmrg# XORG_CHECK_LINUXDOC
1833fe4c343aSmrg# -------------------
1834fe4c343aSmrg# Minimum version: 1.0.0
1835fe4c343aSmrg#
1836fe4c343aSmrg# Defines the variable MAKE_TEXT if the necessary tools and
1837fe4c343aSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1838fe4c343aSmrg# Whether or not the necessary tools and files are found can be checked
1839fe4c343aSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1840fe4c343aSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
1841fe4c343aSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1842fe4c343aSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
1843ba6a1819Smrg
1844fe4c343aSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
1845549e21daSmrg
1846fe4c343aSmrgAC_MSG_CHECKING([whether to build documentation])
1847549e21daSmrg
1848fe4c343aSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
1849fe4c343aSmrg   BUILDDOC=yes
1850fe4c343aSmrgelse
1851fe4c343aSmrg   BUILDDOC=no
1852fe4c343aSmrgfi
1853ba6a1819Smrg
1854fe4c343aSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1855ba6a1819Smrg
1856fe4c343aSmrgAC_MSG_RESULT([$BUILDDOC])
1857ba6a1819Smrg
1858fe4c343aSmrgAC_MSG_CHECKING([whether to build pdf documentation])
1859ba6a1819Smrg
1860fe4c343aSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
1861fe4c343aSmrg   BUILDPDFDOC=yes
1862fe4c343aSmrgelse
1863fe4c343aSmrg   BUILDPDFDOC=no
1864fe4c343aSmrgfi
1865ba6a1819Smrg
1866fe4c343aSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1867ba6a1819Smrg
1868fe4c343aSmrgAC_MSG_RESULT([$BUILDPDFDOC])
1869549e21daSmrg
1870fe4c343aSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
1871fe4c343aSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1872fe4c343aSmrgMAKE_PDF="$PS2PDF"
1873fe4c343aSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1874549e21daSmrg
1875fe4c343aSmrgAC_SUBST(MAKE_TEXT)
1876fe4c343aSmrgAC_SUBST(MAKE_PS)
1877fe4c343aSmrgAC_SUBST(MAKE_PDF)
1878fe4c343aSmrgAC_SUBST(MAKE_HTML)
1879fe4c343aSmrg]) # XORG_CHECK_LINUXDOC
1880549e21daSmrg
1881fe4c343aSmrg# XORG_CHECK_DOCBOOK
1882fe4c343aSmrg# -------------------
1883fe4c343aSmrg# Minimum version: 1.0.0
1884fe4c343aSmrg#
1885fe4c343aSmrg# Checks for the ability to build output formats from SGML DocBook source.
1886fe4c343aSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1887fe4c343aSmrg# indicates whether the necessary tools and files are found and, if set,
1888fe4c343aSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1889fe4c343aSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
1890fe4c343aSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1891ba6a1819Smrg
1892fe4c343aSmrgBUILDTXTDOC=no
1893fe4c343aSmrgBUILDPDFDOC=no
1894fe4c343aSmrgBUILDPSDOC=no
1895fe4c343aSmrgBUILDHTMLDOC=no
1896ba6a1819Smrg
1897fe4c343aSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
1898fe4c343aSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1899fe4c343aSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
1900fe4c343aSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1901ba6a1819Smrg
1902fe4c343aSmrgAC_MSG_CHECKING([whether to build text documentation])
1903fe4c343aSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
1904fe4c343aSmrg   test x$BUILD_TXTDOC != xno; then
1905fe4c343aSmrg	BUILDTXTDOC=yes
1906fe4c343aSmrgfi
1907fe4c343aSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1908fe4c343aSmrgAC_MSG_RESULT([$BUILDTXTDOC])
1909ba6a1819Smrg
1910fe4c343aSmrgAC_MSG_CHECKING([whether to build PDF documentation])
1911fe4c343aSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
1912fe4c343aSmrg   test x$BUILD_PDFDOC != xno; then
1913fe4c343aSmrg	BUILDPDFDOC=yes
1914fe4c343aSmrgfi
1915fe4c343aSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1916fe4c343aSmrgAC_MSG_RESULT([$BUILDPDFDOC])
1917549e21daSmrg
1918fe4c343aSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
1919fe4c343aSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
1920fe4c343aSmrg   test x$BUILD_PSDOC != xno; then
1921fe4c343aSmrg	BUILDPSDOC=yes
1922fe4c343aSmrgfi
1923fe4c343aSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1924fe4c343aSmrgAC_MSG_RESULT([$BUILDPSDOC])
1925549e21daSmrg
1926fe4c343aSmrgAC_MSG_CHECKING([whether to build HTML documentation])
1927fe4c343aSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
1928fe4c343aSmrg   test x$BUILD_HTMLDOC != xno; then
1929fe4c343aSmrg	BUILDHTMLDOC=yes
1930fe4c343aSmrgfi
1931fe4c343aSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1932fe4c343aSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
1933ba6a1819Smrg
1934fe4c343aSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1935fe4c343aSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1936fe4c343aSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1937fe4c343aSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1938ba6a1819Smrg
1939fe4c343aSmrgAC_SUBST(MAKE_TEXT)
1940fe4c343aSmrgAC_SUBST(MAKE_PS)
1941fe4c343aSmrgAC_SUBST(MAKE_PDF)
1942fe4c343aSmrgAC_SUBST(MAKE_HTML)
1943fe4c343aSmrg]) # XORG_CHECK_DOCBOOK
1944549e21daSmrg
1945fe4c343aSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
1946fe4c343aSmrg# ----------------
1947fe4c343aSmrg# Minimum version: 1.5.0
1948fe4c343aSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1949fe4c343aSmrg#
1950fe4c343aSmrg# Documentation tools are not always available on all platforms and sometimes
1951fe4c343aSmrg# not at the appropriate level. This macro enables a module to test for the
1952fe4c343aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
195300ca1914Smrg# the --with-xmlto option, it allows maximum flexibility in making decisions
1954fe4c343aSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
1955fe4c343aSmrg# --with-xmlto assumes 'auto'.
1956fe4c343aSmrg#
1957fe4c343aSmrg# Interface to module:
1958fe4c343aSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
1959fe4c343aSmrg# XMLTO:	returns the path of the xmlto program found
1960fe4c343aSmrg#		returns the path set by the user in the environment
1961fe4c343aSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
1962fe4c343aSmrg#		'no' user instructs the module not to use xmlto
1963fe4c343aSmrg#
1964fe4c343aSmrg# Added in version 1.10.0
1965fe4c343aSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
1966fe4c343aSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
1967fe4c343aSmrg#
1968fe4c343aSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
1969fe4c343aSmrg#
1970fe4c343aSmrgAC_DEFUN([XORG_WITH_XMLTO],[
1971fe4c343aSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
1972fe4c343aSmrgm4_define([_defopt], m4_default([$2], [auto]))
1973fe4c343aSmrgAC_ARG_WITH(xmlto,
1974fe4c343aSmrg	AS_HELP_STRING([--with-xmlto],
1975fe4c343aSmrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
1976fe4c343aSmrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
1977fe4c343aSmrgm4_undefine([_defopt])
1978549e21daSmrg
1979fe4c343aSmrgif test "x$use_xmlto" = x"auto"; then
1980fe4c343aSmrg   AC_PATH_PROG([XMLTO], [xmlto])
1981fe4c343aSmrg   if test "x$XMLTO" = "x"; then
1982fe4c343aSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
1983fe4c343aSmrg	have_xmlto=no
1984fe4c343aSmrg   else
1985fe4c343aSmrg        have_xmlto=yes
1986fe4c343aSmrg   fi
1987fe4c343aSmrgelif test "x$use_xmlto" = x"yes" ; then
1988fe4c343aSmrg   AC_PATH_PROG([XMLTO], [xmlto])
1989fe4c343aSmrg   if test "x$XMLTO" = "x"; then
1990fe4c343aSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
1991fe4c343aSmrg   fi
1992fe4c343aSmrg   have_xmlto=yes
1993fe4c343aSmrgelif test "x$use_xmlto" = x"no" ; then
1994fe4c343aSmrg   if test "x$XMLTO" != "x"; then
1995fe4c343aSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
1996fe4c343aSmrg   fi
1997fe4c343aSmrg   have_xmlto=no
1998fe4c343aSmrgelse
1999fe4c343aSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
2000fe4c343aSmrgfi
2001549e21daSmrg
2002fe4c343aSmrg# Test for a minimum version of xmlto, if provided.
2003fe4c343aSmrgm4_ifval([$1],
2004fe4c343aSmrg[if test "$have_xmlto" = yes; then
2005fe4c343aSmrg    # scrape the xmlto version
2006fe4c343aSmrg    AC_MSG_CHECKING([the xmlto version])
2007fe4c343aSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
2008fe4c343aSmrg    AC_MSG_RESULT([$xmlto_version])
2009fe4c343aSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
2010fe4c343aSmrg        [if test "x$use_xmlto" = xauto; then
2011fe4c343aSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
2012fe4c343aSmrg            have_xmlto=no
2013fe4c343aSmrg        else
2014fe4c343aSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
2015fe4c343aSmrg        fi])
2016fe4c343aSmrgfi])
2017549e21daSmrg
2018fe4c343aSmrg# Test for the ability of xmlto to generate a text target
2019549e21daSmrg#
2020fe4c343aSmrg# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the
2021fe4c343aSmrg# following test for empty XML docbook files.
2022fe4c343aSmrg# For compatibility reasons use the following empty XML docbook file and if
2023fe4c343aSmrg# it fails try it again with a non-empty XML file.
2024fe4c343aSmrghave_xmlto_text=no
2025fe4c343aSmrgcat > conftest.xml << "EOF"
2026fe4c343aSmrgEOF
2027fe4c343aSmrgAS_IF([test "$have_xmlto" = yes],
2028fe4c343aSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
2029fe4c343aSmrg             [have_xmlto_text=yes],
2030fe4c343aSmrg             [# Try it again with a non-empty XML file.
2031fe4c343aSmrg              cat > conftest.xml << "EOF"
2032fe4c343aSmrg<x></x>
2033fe4c343aSmrgEOF
2034fe4c343aSmrg              AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
2035fe4c343aSmrg                    [have_xmlto_text=yes],
2036fe4c343aSmrg                    [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])])
2037fe4c343aSmrgrm -f conftest.xml
2038fe4c343aSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
2039fe4c343aSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
2040fe4c343aSmrg]) # XORG_WITH_XMLTO
2041ba6a1819Smrg
2042fe4c343aSmrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
2043fe4c343aSmrg# --------------------------------------------
2044fe4c343aSmrg# Minimum version: 1.12.0
2045fe4c343aSmrg# Minimum version for optional DEFAULT argument: 1.12.0
20461bedbe3fSmrg#
2047fe4c343aSmrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
2048fe4c343aSmrg# XML-based language used for the transformation of XML documents.
2049fe4c343aSmrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
2050fe4c343aSmrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
2051fe4c343aSmrg# The XSLT processor is often used as a standalone tool for transformations.
2052fe4c343aSmrg# It should not be assumed that this tool is used only to work with documnetation.
2053fe4c343aSmrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
2054fe4c343aSmrg#
2055fe4c343aSmrg# Interface to module:
2056fe4c343aSmrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
2057fe4c343aSmrg# XSLTPROC:	 returns the path of the xsltproc program found
2058fe4c343aSmrg#		 returns the path set by the user in the environment
2059fe4c343aSmrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
2060fe4c343aSmrg#		  'no' user instructs the module not to use xsltproc
2061fe4c343aSmrg# have_xsltproc: returns yes if xsltproc found in PATH or no
2062fe4c343aSmrg#
2063fe4c343aSmrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
2064fe4c343aSmrg#
2065fe4c343aSmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
2066fe4c343aSmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
2067fe4c343aSmrg# Preserves the interface, should it be implemented later
2068fe4c343aSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
2069fe4c343aSmrgm4_define([_defopt], m4_default([$2], [auto]))
2070fe4c343aSmrgAC_ARG_WITH(xsltproc,
2071fe4c343aSmrg	AS_HELP_STRING([--with-xsltproc],
2072fe4c343aSmrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
2073fe4c343aSmrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
2074fe4c343aSmrgm4_undefine([_defopt])
2075ba6a1819Smrg
2076fe4c343aSmrgif test "x$use_xsltproc" = x"auto"; then
2077fe4c343aSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
2078fe4c343aSmrg   if test "x$XSLTPROC" = "x"; then
2079fe4c343aSmrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
2080fe4c343aSmrg	have_xsltproc=no
2081fe4c343aSmrg   else
2082fe4c343aSmrg        have_xsltproc=yes
2083fe4c343aSmrg   fi
2084fe4c343aSmrgelif test "x$use_xsltproc" = x"yes" ; then
2085fe4c343aSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
2086fe4c343aSmrg   if test "x$XSLTPROC" = "x"; then
2087fe4c343aSmrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
2088fe4c343aSmrg   fi
2089fe4c343aSmrg   have_xsltproc=yes
2090fe4c343aSmrgelif test "x$use_xsltproc" = x"no" ; then
2091fe4c343aSmrg   if test "x$XSLTPROC" != "x"; then
2092fe4c343aSmrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
2093fe4c343aSmrg   fi
2094fe4c343aSmrg   have_xsltproc=no
2095fe4c343aSmrgelse
2096fe4c343aSmrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
2097fe4c343aSmrgfi
2098ba6a1819Smrg
2099fe4c343aSmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
2100fe4c343aSmrg]) # XORG_WITH_XSLTPROC
2101ba6a1819Smrg
2102fe4c343aSmrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
2103fe4c343aSmrg# ----------------------------------------
2104fe4c343aSmrg# Minimum version: 1.15.0
2105fe4c343aSmrg#
2106fe4c343aSmrg# PERL (Practical Extraction and Report Language) is a language optimized for
2107fe4c343aSmrg# scanning arbitrary text files, extracting information from those text files,
2108fe4c343aSmrg# and printing reports based on that information.
2109fe4c343aSmrg#
2110fe4c343aSmrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
2111fe4c343aSmrg#
2112fe4c343aSmrg# Interface to module:
2113fe4c343aSmrg# HAVE_PERL: used in makefiles to conditionally scan text files
2114fe4c343aSmrg# PERL:	     returns the path of the perl program found
2115fe4c343aSmrg#	     returns the path set by the user in the environment
2116fe4c343aSmrg# --with-perl: 'yes' user instructs the module to use perl
2117fe4c343aSmrg#	       'no' user instructs the module not to use perl
2118fe4c343aSmrg# have_perl: returns yes if perl found in PATH or no
2119fe4c343aSmrg#
2120fe4c343aSmrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
2121fe4c343aSmrg#
2122fe4c343aSmrgAC_DEFUN([XORG_WITH_PERL],[
2123fe4c343aSmrgAC_ARG_VAR([PERL], [Path to perl command])
2124fe4c343aSmrg# Preserves the interface, should it be implemented later
2125fe4c343aSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
2126fe4c343aSmrgm4_define([_defopt], m4_default([$2], [auto]))
2127fe4c343aSmrgAC_ARG_WITH(perl,
2128fe4c343aSmrg	AS_HELP_STRING([--with-perl],
2129fe4c343aSmrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
2130fe4c343aSmrg	   [use_perl=$withval], [use_perl=]_defopt)
2131fe4c343aSmrgm4_undefine([_defopt])
2132ba6a1819Smrg
2133fe4c343aSmrgif test "x$use_perl" = x"auto"; then
2134fe4c343aSmrg   AC_PATH_PROG([PERL], [perl])
2135fe4c343aSmrg   if test "x$PERL" = "x"; then
2136fe4c343aSmrg        AC_MSG_WARN([perl not found - cannot extract information and report])
2137fe4c343aSmrg	have_perl=no
2138fe4c343aSmrg   else
2139fe4c343aSmrg        have_perl=yes
2140fe4c343aSmrg   fi
2141fe4c343aSmrgelif test "x$use_perl" = x"yes" ; then
2142fe4c343aSmrg   AC_PATH_PROG([PERL], [perl])
2143fe4c343aSmrg   if test "x$PERL" = "x"; then
2144fe4c343aSmrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
2145fe4c343aSmrg   fi
2146fe4c343aSmrg   have_perl=yes
2147fe4c343aSmrgelif test "x$use_perl" = x"no" ; then
2148fe4c343aSmrg   if test "x$PERL" != "x"; then
2149fe4c343aSmrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
2150fe4c343aSmrg   fi
2151fe4c343aSmrg   have_perl=no
2152fe4c343aSmrgelse
2153fe4c343aSmrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
2154fe4c343aSmrgfi
2155549e21daSmrg
2156fe4c343aSmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
2157fe4c343aSmrg]) # XORG_WITH_PERL
2158549e21daSmrg
2159fe4c343aSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
2160fe4c343aSmrg# ----------------
2161fe4c343aSmrg# Minimum version: 1.5.0
2162fe4c343aSmrg# Minimum version for optional DEFAULT argument: 1.11.0
2163fe4c343aSmrg#
2164fe4c343aSmrg# Documentation tools are not always available on all platforms and sometimes
2165fe4c343aSmrg# not at the appropriate level. This macro enables a module to test for the
2166fe4c343aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
216700ca1914Smrg# the --with-asciidoc option, it allows maximum flexibility in making decisions
2168fe4c343aSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
2169fe4c343aSmrg# --with-asciidoc assumes 'auto'.
2170fe4c343aSmrg#
2171fe4c343aSmrg# Interface to module:
2172fe4c343aSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
2173fe4c343aSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
2174fe4c343aSmrg#		 returns the path set by the user in the environment
2175fe4c343aSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
2176fe4c343aSmrg#		  'no' user instructs the module not to use asciidoc
2177fe4c343aSmrg#
2178fe4c343aSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
2179fe4c343aSmrg#
2180fe4c343aSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
2181fe4c343aSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
2182fe4c343aSmrgm4_define([_defopt], m4_default([$2], [auto]))
2183fe4c343aSmrgAC_ARG_WITH(asciidoc,
2184fe4c343aSmrg	AS_HELP_STRING([--with-asciidoc],
2185fe4c343aSmrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
2186fe4c343aSmrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
2187fe4c343aSmrgm4_undefine([_defopt])
2188549e21daSmrg
2189fe4c343aSmrgif test "x$use_asciidoc" = x"auto"; then
2190fe4c343aSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
2191fe4c343aSmrg   if test "x$ASCIIDOC" = "x"; then
2192fe4c343aSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
2193fe4c343aSmrg	have_asciidoc=no
2194fe4c343aSmrg   else
2195fe4c343aSmrg        have_asciidoc=yes
2196fe4c343aSmrg   fi
2197fe4c343aSmrgelif test "x$use_asciidoc" = x"yes" ; then
2198fe4c343aSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
2199fe4c343aSmrg   if test "x$ASCIIDOC" = "x"; then
2200fe4c343aSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
2201fe4c343aSmrg   fi
2202fe4c343aSmrg   have_asciidoc=yes
2203fe4c343aSmrgelif test "x$use_asciidoc" = x"no" ; then
2204fe4c343aSmrg   if test "x$ASCIIDOC" != "x"; then
2205fe4c343aSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
2206fe4c343aSmrg   fi
2207fe4c343aSmrg   have_asciidoc=no
2208fe4c343aSmrgelse
2209fe4c343aSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
2210fe4c343aSmrgfi
2211fe4c343aSmrgm4_ifval([$1],
2212fe4c343aSmrg[if test "$have_asciidoc" = yes; then
2213fe4c343aSmrg    # scrape the asciidoc version
2214fe4c343aSmrg    AC_MSG_CHECKING([the asciidoc version])
2215fe4c343aSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
2216fe4c343aSmrg    AC_MSG_RESULT([$asciidoc_version])
2217fe4c343aSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
2218fe4c343aSmrg        [if test "x$use_asciidoc" = xauto; then
2219fe4c343aSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
2220fe4c343aSmrg            have_asciidoc=no
2221fe4c343aSmrg        else
2222fe4c343aSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
2223fe4c343aSmrg        fi])
2224fe4c343aSmrgfi])
2225fe4c343aSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
2226fe4c343aSmrg]) # XORG_WITH_ASCIIDOC
2227549e21daSmrg
2228fe4c343aSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
2229fe4c343aSmrg# -------------------------------------------
2230fe4c343aSmrg# Minimum version: 1.5.0
2231fe4c343aSmrg# Minimum version for optional DEFAULT argument: 1.11.0
2232fe4c343aSmrg# Minimum version for optional DOT checking: 1.18.0
2233fe4c343aSmrg#
2234fe4c343aSmrg# Documentation tools are not always available on all platforms and sometimes
2235fe4c343aSmrg# not at the appropriate level. This macro enables a module to test for the
2236fe4c343aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
223700ca1914Smrg# the --with-doxygen option, it allows maximum flexibility in making decisions
2238fe4c343aSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
2239fe4c343aSmrg# --with-doxygen assumes 'auto'.
2240fe4c343aSmrg#
2241fe4c343aSmrg# Interface to module:
2242fe4c343aSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
2243fe4c343aSmrg# DOXYGEN:	 returns the path of the doxygen program found
2244fe4c343aSmrg#		 returns the path set by the user in the environment
2245fe4c343aSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
2246fe4c343aSmrg#		  'no' user instructs the module not to use doxygen
2247fe4c343aSmrg#
2248fe4c343aSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
2249fe4c343aSmrg#
2250fe4c343aSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
2251fe4c343aSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
2252fe4c343aSmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility])
2253fe4c343aSmrgm4_define([_defopt], m4_default([$2], [auto]))
2254fe4c343aSmrgAC_ARG_WITH(doxygen,
2255fe4c343aSmrg	AS_HELP_STRING([--with-doxygen],
2256fe4c343aSmrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
2257fe4c343aSmrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
2258fe4c343aSmrgm4_undefine([_defopt])
2259549e21daSmrg
2260fe4c343aSmrgif test "x$use_doxygen" = x"auto"; then
2261fe4c343aSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
2262fe4c343aSmrg   if test "x$DOXYGEN" = "x"; then
2263fe4c343aSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
2264fe4c343aSmrg	have_doxygen=no
2265fe4c343aSmrg   else
2266fe4c343aSmrg        have_doxygen=yes
2267fe4c343aSmrg   fi
2268fe4c343aSmrgelif test "x$use_doxygen" = x"yes" ; then
2269fe4c343aSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
2270fe4c343aSmrg   if test "x$DOXYGEN" = "x"; then
2271fe4c343aSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
2272fe4c343aSmrg   fi
2273fe4c343aSmrg   have_doxygen=yes
2274fe4c343aSmrgelif test "x$use_doxygen" = x"no" ; then
2275fe4c343aSmrg   if test "x$DOXYGEN" != "x"; then
2276fe4c343aSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
2277fe4c343aSmrg   fi
2278fe4c343aSmrg   have_doxygen=no
2279fe4c343aSmrgelse
2280fe4c343aSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
2281fe4c343aSmrgfi
2282fe4c343aSmrgm4_ifval([$1],
2283fe4c343aSmrg[if test "$have_doxygen" = yes; then
2284fe4c343aSmrg    # scrape the doxygen version
2285fe4c343aSmrg    AC_MSG_CHECKING([the doxygen version])
2286fe4c343aSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
2287fe4c343aSmrg    AC_MSG_RESULT([$doxygen_version])
2288fe4c343aSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
2289fe4c343aSmrg        [if test "x$use_doxygen" = xauto; then
2290fe4c343aSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
2291fe4c343aSmrg            have_doxygen=no
2292fe4c343aSmrg        else
2293fe4c343aSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
2294fe4c343aSmrg        fi])
2295fe4c343aSmrgfi])
2296549e21daSmrg
2297fe4c343aSmrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory
2298fe4c343aSmrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
2299fe4c343aSmrgdnl 	HAVE_DOT = @HAVE_DOT@
2300fe4c343aSmrgHAVE_DOT=no
2301fe4c343aSmrgif test "x$have_doxygen" = "xyes"; then
2302fe4c343aSmrg  AC_PATH_PROG([DOT], [dot])
2303fe4c343aSmrg    if test "x$DOT" != "x"; then
2304fe4c343aSmrg      HAVE_DOT=yes
2305fe4c343aSmrg    fi
2306fe4c343aSmrgfi
2307549e21daSmrg
2308fe4c343aSmrgAC_SUBST([HAVE_DOT])
2309fe4c343aSmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
2310fe4c343aSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
2311fe4c343aSmrg]) # XORG_WITH_DOXYGEN
2312549e21daSmrg
2313fe4c343aSmrg# XORG_WITH_GROFF([DEFAULT])
2314fe4c343aSmrg# ----------------
2315fe4c343aSmrg# Minimum version: 1.6.0
2316fe4c343aSmrg# Minimum version for optional DEFAULT argument: 1.11.0
2317fe4c343aSmrg#
2318fe4c343aSmrg# Documentation tools are not always available on all platforms and sometimes
2319fe4c343aSmrg# not at the appropriate level. This macro enables a module to test for the
2320fe4c343aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
232100ca1914Smrg# the --with-groff option, it allows maximum flexibility in making decisions
2322fe4c343aSmrg# as whether or not to use the groff package. When DEFAULT is not specified,
2323fe4c343aSmrg# --with-groff assumes 'auto'.
2324fe4c343aSmrg#
2325fe4c343aSmrg# Interface to module:
2326fe4c343aSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
2327fe4c343aSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
2328fe4c343aSmrg# HAVE_GROFF_MS: the -ms macros package
2329fe4c343aSmrg# GROFF:	 returns the path of the groff program found
2330fe4c343aSmrg#		 returns the path set by the user in the environment
2331fe4c343aSmrg# --with-groff:	 'yes' user instructs the module to use groff
2332fe4c343aSmrg#		 'no' user instructs the module not to use groff
2333fe4c343aSmrg#
2334fe4c343aSmrg# Added in version 1.9.0:
2335fe4c343aSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
2336fe4c343aSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
2337fe4c343aSmrg#		   psselect from the psutils package.
2338fe4c343aSmrg#		   the ghostcript package. Refer to the grohtml man pages
2339fe4c343aSmrg#
2340fe4c343aSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
2341fe4c343aSmrg#
2342fe4c343aSmrg# OS and distros often splits groff in a basic and full package, the former
2343fe4c343aSmrg# having the groff program and the later having devices, fonts and macros
2344fe4c343aSmrg# Checking for the groff executable is not enough.
2345fe4c343aSmrg#
2346fe4c343aSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
2347fe4c343aSmrg# unset HAVE_GROFF or GROFF env variables.
2348fe4c343aSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
2349fe4c343aSmrg#
2350fe4c343aSmrgAC_DEFUN([XORG_WITH_GROFF],[
2351fe4c343aSmrgAC_ARG_VAR([GROFF], [Path to groff command])
2352fe4c343aSmrgm4_define([_defopt], m4_default([$1], [auto]))
2353fe4c343aSmrgAC_ARG_WITH(groff,
2354fe4c343aSmrg	AS_HELP_STRING([--with-groff],
2355fe4c343aSmrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
2356fe4c343aSmrg	   [use_groff=$withval], [use_groff=]_defopt)
2357fe4c343aSmrgm4_undefine([_defopt])
2358549e21daSmrg
2359fe4c343aSmrgif test "x$use_groff" = x"auto"; then
2360fe4c343aSmrg   AC_PATH_PROG([GROFF], [groff])
2361fe4c343aSmrg   if test "x$GROFF" = "x"; then
2362fe4c343aSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
2363fe4c343aSmrg	have_groff=no
2364fe4c343aSmrg   else
2365fe4c343aSmrg        have_groff=yes
2366fe4c343aSmrg   fi
2367fe4c343aSmrgelif test "x$use_groff" = x"yes" ; then
2368fe4c343aSmrg   AC_PATH_PROG([GROFF], [groff])
2369fe4c343aSmrg   if test "x$GROFF" = "x"; then
2370fe4c343aSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
2371fe4c343aSmrg   fi
2372fe4c343aSmrg   have_groff=yes
2373fe4c343aSmrgelif test "x$use_groff" = x"no" ; then
2374fe4c343aSmrg   if test "x$GROFF" != "x"; then
2375fe4c343aSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
2376fe4c343aSmrg   fi
2377fe4c343aSmrg   have_groff=no
2378fe4c343aSmrgelse
2379fe4c343aSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
2380fe4c343aSmrgfi
2381549e21daSmrg
2382fe4c343aSmrg# We have groff, test for the presence of the macro packages
2383fe4c343aSmrgif test "x$have_groff" = x"yes"; then
2384fe4c343aSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
2385fe4c343aSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
2386fe4c343aSmrg        groff_ms_works=yes
2387fe4c343aSmrg    else
2388fe4c343aSmrg        groff_ms_works=no
2389fe4c343aSmrg    fi
2390fe4c343aSmrg    AC_MSG_RESULT([$groff_ms_works])
2391fe4c343aSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
2392fe4c343aSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
2393fe4c343aSmrg        groff_mm_works=yes
2394fe4c343aSmrg    else
2395fe4c343aSmrg        groff_mm_works=no
2396fe4c343aSmrg    fi
2397fe4c343aSmrg    AC_MSG_RESULT([$groff_mm_works])
2398fe4c343aSmrgfi
2399549e21daSmrg
2400fe4c343aSmrg# We have groff, test for HTML dependencies, one command per package
2401fe4c343aSmrgif test "x$have_groff" = x"yes"; then
2402fe4c343aSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
2403fe4c343aSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
2404fe4c343aSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
2405fe4c343aSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
2406fe4c343aSmrg      have_groff_html=yes
2407fe4c343aSmrg   else
2408fe4c343aSmrg      have_groff_html=no
2409fe4c343aSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
2410fe4c343aSmrg   fi
2411fe4c343aSmrgfi
2412549e21daSmrg
2413fe4c343aSmrg# Set Automake conditionals for Makefiles
2414fe4c343aSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
2415fe4c343aSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
2416fe4c343aSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
2417fe4c343aSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
2418fe4c343aSmrg]) # XORG_WITH_GROFF
2419549e21daSmrg
2420fe4c343aSmrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
2421fe4c343aSmrg# ---------------------------------------
2422fe4c343aSmrg# Minimum version: 1.6.0
2423fe4c343aSmrg# Minimum version for optional DEFAULT argument: 1.11.0
2424fe4c343aSmrg# Minimum version for optional MIN-VERSION argument: 1.15.0
2425fe4c343aSmrg#
2426fe4c343aSmrg# Documentation tools are not always available on all platforms and sometimes
2427fe4c343aSmrg# not at the appropriate level. This macro enables a module to test for the
2428fe4c343aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
242900ca1914Smrg# the --with-fop option, it allows maximum flexibility in making decisions
2430fe4c343aSmrg# as whether or not to use the fop package. When DEFAULT is not specified,
2431fe4c343aSmrg# --with-fop assumes 'auto'.
2432fe4c343aSmrg#
2433fe4c343aSmrg# Interface to module:
2434fe4c343aSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
2435fe4c343aSmrg# FOP:	 	returns the path of the fop program found
2436fe4c343aSmrg#		returns the path set by the user in the environment
2437fe4c343aSmrg# --with-fop: 	'yes' user instructs the module to use fop
2438fe4c343aSmrg#		'no' user instructs the module not to use fop
2439fe4c343aSmrg#
2440fe4c343aSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
2441fe4c343aSmrg#
2442fe4c343aSmrgAC_DEFUN([XORG_WITH_FOP],[
2443fe4c343aSmrgAC_ARG_VAR([FOP], [Path to fop command])
2444fe4c343aSmrgm4_define([_defopt], m4_default([$2], [auto]))
2445fe4c343aSmrgAC_ARG_WITH(fop,
2446fe4c343aSmrg	AS_HELP_STRING([--with-fop],
2447fe4c343aSmrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
2448fe4c343aSmrg	   [use_fop=$withval], [use_fop=]_defopt)
2449fe4c343aSmrgm4_undefine([_defopt])
2450549e21daSmrg
2451fe4c343aSmrgif test "x$use_fop" = x"auto"; then
2452fe4c343aSmrg   AC_PATH_PROG([FOP], [fop])
2453fe4c343aSmrg   if test "x$FOP" = "x"; then
2454fe4c343aSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
2455fe4c343aSmrg	have_fop=no
2456fe4c343aSmrg   else
2457fe4c343aSmrg        have_fop=yes
2458fe4c343aSmrg   fi
2459fe4c343aSmrgelif test "x$use_fop" = x"yes" ; then
2460fe4c343aSmrg   AC_PATH_PROG([FOP], [fop])
2461fe4c343aSmrg   if test "x$FOP" = "x"; then
2462fe4c343aSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
2463fe4c343aSmrg   fi
2464fe4c343aSmrg   have_fop=yes
2465fe4c343aSmrgelif test "x$use_fop" = x"no" ; then
2466fe4c343aSmrg   if test "x$FOP" != "x"; then
2467fe4c343aSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
2468fe4c343aSmrg   fi
2469fe4c343aSmrg   have_fop=no
2470fe4c343aSmrgelse
2471fe4c343aSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
24721bedbe3fSmrgfi
2473549e21daSmrg
2474fe4c343aSmrg# Test for a minimum version of fop, if provided.
2475fe4c343aSmrgm4_ifval([$1],
2476fe4c343aSmrg[if test "$have_fop" = yes; then
2477fe4c343aSmrg    # scrape the fop version
2478fe4c343aSmrg    AC_MSG_CHECKING([for fop minimum version])
2479fe4c343aSmrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
2480fe4c343aSmrg    AC_MSG_RESULT([$fop_version])
2481fe4c343aSmrg    AS_VERSION_COMPARE([$fop_version], [$1],
2482fe4c343aSmrg        [if test "x$use_fop" = xauto; then
2483fe4c343aSmrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
2484fe4c343aSmrg            have_fop=no
2485fe4c343aSmrg        else
2486fe4c343aSmrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
2487fe4c343aSmrg        fi])
2488fe4c343aSmrgfi])
2489fe4c343aSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
2490fe4c343aSmrg]) # XORG_WITH_FOP
2491549e21daSmrg
2492fe4c343aSmrg# XORG_WITH_M4([MIN-VERSION])
2493fe4c343aSmrg# ---------------------------
2494fe4c343aSmrg# Minimum version: 1.19.0
24951bedbe3fSmrg#
2496fe4c343aSmrg# This macro attempts to locate an m4 macro processor which supports
2497fe4c343aSmrg# -I option and is only useful for modules relying on M4 in order to
2498fe4c343aSmrg# expand macros in source code files.
2499fe4c343aSmrg#
2500fe4c343aSmrg# Interface to module:
2501fe4c343aSmrg# M4:	 	returns the path of the m4 program found
2502fe4c343aSmrg#		returns the path set by the user in the environment
2503fe4c343aSmrg#
2504fe4c343aSmrgAC_DEFUN([XORG_WITH_M4], [
2505fe4c343aSmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
2506fe4c343aSmrg   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
2507fe4c343aSmrg       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
2508fe4c343aSmrg         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
2509fe4c343aSmrg   [AC_MSG_ERROR([could not find m4 that supports -I option])],
2510fe4c343aSmrg   [$PATH:/usr/gnu/bin])])
2511ba6a1819Smrg
2512fe4c343aSmrgAC_SUBST([M4], [$ac_cv_path_M4])
2513fe4c343aSmrg]) # XORG_WITH_M4
2514ba6a1819Smrg
2515fe4c343aSmrg# XORG_WITH_PS2PDF([DEFAULT])
2516fe4c343aSmrg# ----------------
2517fe4c343aSmrg# Minimum version: 1.6.0
2518fe4c343aSmrg# Minimum version for optional DEFAULT argument: 1.11.0
2519fe4c343aSmrg#
2520fe4c343aSmrg# Documentation tools are not always available on all platforms and sometimes
2521fe4c343aSmrg# not at the appropriate level. This macro enables a module to test for the
2522fe4c343aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
252300ca1914Smrg# the --with-ps2pdf option, it allows maximum flexibility in making decisions
2524fe4c343aSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
2525fe4c343aSmrg# --with-ps2pdf assumes 'auto'.
2526fe4c343aSmrg#
2527fe4c343aSmrg# Interface to module:
2528fe4c343aSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
2529fe4c343aSmrg# PS2PDF:	returns the path of the ps2pdf program found
2530fe4c343aSmrg#		returns the path set by the user in the environment
2531fe4c343aSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
2532fe4c343aSmrg#		 'no' user instructs the module not to use ps2pdf
2533fe4c343aSmrg#
2534fe4c343aSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
2535fe4c343aSmrg#
2536fe4c343aSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
2537fe4c343aSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
2538fe4c343aSmrgm4_define([_defopt], m4_default([$1], [auto]))
2539fe4c343aSmrgAC_ARG_WITH(ps2pdf,
2540fe4c343aSmrg	AS_HELP_STRING([--with-ps2pdf],
2541fe4c343aSmrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
2542fe4c343aSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
2543fe4c343aSmrgm4_undefine([_defopt])
2544ba6a1819Smrg
2545fe4c343aSmrgif test "x$use_ps2pdf" = x"auto"; then
2546fe4c343aSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
2547fe4c343aSmrg   if test "x$PS2PDF" = "x"; then
2548fe4c343aSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
2549fe4c343aSmrg	have_ps2pdf=no
2550fe4c343aSmrg   else
2551fe4c343aSmrg        have_ps2pdf=yes
2552fe4c343aSmrg   fi
2553fe4c343aSmrgelif test "x$use_ps2pdf" = x"yes" ; then
2554fe4c343aSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
2555fe4c343aSmrg   if test "x$PS2PDF" = "x"; then
2556fe4c343aSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
2557fe4c343aSmrg   fi
2558fe4c343aSmrg   have_ps2pdf=yes
2559fe4c343aSmrgelif test "x$use_ps2pdf" = x"no" ; then
2560fe4c343aSmrg   if test "x$PS2PDF" != "x"; then
2561fe4c343aSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
2562fe4c343aSmrg   fi
2563fe4c343aSmrg   have_ps2pdf=no
2564fe4c343aSmrgelse
2565fe4c343aSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
25661bedbe3fSmrgfi
2567fe4c343aSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
2568fe4c343aSmrg]) # XORG_WITH_PS2PDF
2569549e21daSmrg
2570fe4c343aSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
2571fe4c343aSmrg# ----------------
2572fe4c343aSmrg# Minimum version: 1.6.0
2573fe4c343aSmrg#
2574fe4c343aSmrg# Documentation tools are not always available on all platforms and sometimes
2575fe4c343aSmrg# not at the appropriate level. This macro enables a builder to skip all
2576fe4c343aSmrg# documentation targets except traditional man pages.
2577fe4c343aSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
257800ca1914Smrg# maximum flexibility in controlling documentation building.
2579fe4c343aSmrg# Refer to:
2580fe4c343aSmrg# XORG_WITH_XMLTO         --with-xmlto
2581fe4c343aSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
2582fe4c343aSmrg# XORG_WITH_DOXYGEN       --with-doxygen
2583fe4c343aSmrg# XORG_WITH_FOP           --with-fop
2584fe4c343aSmrg# XORG_WITH_GROFF         --with-groff
2585fe4c343aSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
2586fe4c343aSmrg#
2587fe4c343aSmrg# Interface to module:
2588fe4c343aSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
2589fe4c343aSmrg# --enable-docs: 'yes' user instructs the module to generate docs
2590fe4c343aSmrg#		 'no' user instructs the module not to generate docs
2591fe4c343aSmrg# parm1:	specify the default value, yes or no.
2592fe4c343aSmrg#
2593fe4c343aSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
2594fe4c343aSmrgm4_define([docs_default], m4_default([$1], [yes]))
2595fe4c343aSmrgAC_ARG_ENABLE(docs,
2596fe4c343aSmrg	AS_HELP_STRING([--enable-docs],
2597fe4c343aSmrg	   [Enable building the documentation (default: ]docs_default[)]),
2598fe4c343aSmrg	   [build_docs=$enableval], [build_docs=]docs_default)
2599fe4c343aSmrgm4_undefine([docs_default])
2600fe4c343aSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
2601fe4c343aSmrgAC_MSG_CHECKING([whether to build documentation])
2602fe4c343aSmrgAC_MSG_RESULT([$build_docs])
2603fe4c343aSmrg]) # XORG_ENABLE_DOCS
2604549e21daSmrg
2605fe4c343aSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
2606fe4c343aSmrg# ----------------
2607fe4c343aSmrg# Minimum version: 1.6.0
2608fe4c343aSmrg#
2609fe4c343aSmrg# This macro enables a builder to skip all developer documentation.
2610fe4c343aSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
261100ca1914Smrg# maximum flexibility in controlling documentation building.
2612fe4c343aSmrg# Refer to:
2613fe4c343aSmrg# XORG_WITH_XMLTO         --with-xmlto
2614fe4c343aSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
2615fe4c343aSmrg# XORG_WITH_DOXYGEN       --with-doxygen
2616fe4c343aSmrg# XORG_WITH_FOP           --with-fop
2617fe4c343aSmrg# XORG_WITH_GROFF         --with-groff
2618fe4c343aSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
2619fe4c343aSmrg#
2620fe4c343aSmrg# Interface to module:
2621fe4c343aSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
2622fe4c343aSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
2623fe4c343aSmrg#			'no' user instructs the module not to generate developer docs
2624fe4c343aSmrg# parm1:		specify the default value, yes or no.
2625fe4c343aSmrg#
2626fe4c343aSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
2627fe4c343aSmrgm4_define([devel_default], m4_default([$1], [yes]))
2628fe4c343aSmrgAC_ARG_ENABLE(devel-docs,
2629fe4c343aSmrg	AS_HELP_STRING([--enable-devel-docs],
2630fe4c343aSmrg	   [Enable building the developer documentation (default: ]devel_default[)]),
2631fe4c343aSmrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
2632fe4c343aSmrgm4_undefine([devel_default])
2633fe4c343aSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
2634fe4c343aSmrgAC_MSG_CHECKING([whether to build developer documentation])
2635fe4c343aSmrgAC_MSG_RESULT([$build_devel_docs])
2636fe4c343aSmrg]) # XORG_ENABLE_DEVEL_DOCS
2637ba6a1819Smrg
2638fe4c343aSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
2639fe4c343aSmrg# ----------------
2640fe4c343aSmrg# Minimum version: 1.6.0
2641fe4c343aSmrg#
2642fe4c343aSmrg# This macro enables a builder to skip all functional specification targets.
2643fe4c343aSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
264400ca1914Smrg# maximum flexibility in controlling documentation building.
2645fe4c343aSmrg# Refer to:
2646fe4c343aSmrg# XORG_WITH_XMLTO         --with-xmlto
2647fe4c343aSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
2648fe4c343aSmrg# XORG_WITH_DOXYGEN       --with-doxygen
2649fe4c343aSmrg# XORG_WITH_FOP           --with-fop
2650fe4c343aSmrg# XORG_WITH_GROFF         --with-groff
2651fe4c343aSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
2652fe4c343aSmrg#
2653fe4c343aSmrg# Interface to module:
2654fe4c343aSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
2655fe4c343aSmrg# --enable-specs:	'yes' user instructs the module to generate specs
2656fe4c343aSmrg#			'no' user instructs the module not to generate specs
2657fe4c343aSmrg# parm1:		specify the default value, yes or no.
2658fe4c343aSmrg#
2659fe4c343aSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
2660fe4c343aSmrgm4_define([spec_default], m4_default([$1], [yes]))
2661fe4c343aSmrgAC_ARG_ENABLE(specs,
2662fe4c343aSmrg	AS_HELP_STRING([--enable-specs],
2663fe4c343aSmrg	   [Enable building the specs (default: ]spec_default[)]),
2664fe4c343aSmrg	   [build_specs=$enableval], [build_specs=]spec_default)
2665fe4c343aSmrgm4_undefine([spec_default])
2666fe4c343aSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
2667fe4c343aSmrgAC_MSG_CHECKING([whether to build functional specifications])
2668fe4c343aSmrgAC_MSG_RESULT([$build_specs])
2669fe4c343aSmrg]) # XORG_ENABLE_SPECS
2670549e21daSmrg
2671fe4c343aSmrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
2672fe4c343aSmrg# ----------------------------------------------
2673fe4c343aSmrg# Minimum version: 1.13.0
2674fe4c343aSmrg#
2675fe4c343aSmrg# This macro enables a builder to enable/disable unit testing
2676fe4c343aSmrg# It makes no assumption about the test cases implementation
2677fe4c343aSmrg# Test cases may or may not use Automake "Support for test suites"
2678fe4c343aSmrg# They may or may not use the software utility library GLib
2679fe4c343aSmrg#
2680fe4c343aSmrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
2681fe4c343aSmrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
2682fe4c343aSmrg# The variable enable_unit_tests is used by other macros in this file.
2683fe4c343aSmrg#
2684fe4c343aSmrg# Interface to module:
2685fe4c343aSmrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
2686fe4c343aSmrg# enable_unit_tests:    used in configure.ac for additional configuration
2687fe4c343aSmrg# --enable-unit-tests:	'yes' user instructs the module to build tests
2688fe4c343aSmrg#			'no' user instructs the module not to build tests
2689fe4c343aSmrg# parm1:		specify the default value, yes or no.
2690fe4c343aSmrg#
2691fe4c343aSmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
2692fe4c343aSmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
2693fe4c343aSmrgAC_BEFORE([$0], [XORG_LD_WRAP])
2694fe4c343aSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
2695fe4c343aSmrgm4_define([_defopt], m4_default([$1], [auto]))
2696fe4c343aSmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
2697fe4c343aSmrg	[Enable building unit test cases (default: ]_defopt[)]),
2698fe4c343aSmrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
2699fe4c343aSmrgm4_undefine([_defopt])
2700fe4c343aSmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
2701fe4c343aSmrgAC_MSG_CHECKING([whether to build unit test cases])
2702fe4c343aSmrgAC_MSG_RESULT([$enable_unit_tests])
2703fe4c343aSmrg]) # XORG_ENABLE_UNIT_TESTS
2704ba6a1819Smrg
2705fe4c343aSmrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
2706fe4c343aSmrg# ------------------------------------------------------
2707fe4c343aSmrg# Minimum version: 1.17.0
2708fe4c343aSmrg#
2709fe4c343aSmrg# This macro enables a builder to enable/disable integration testing
2710fe4c343aSmrg# It makes no assumption about the test cases' implementation
2711fe4c343aSmrg# Test cases may or may not use Automake "Support for test suites"
2712fe4c343aSmrg#
2713fe4c343aSmrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
2714fe4c343aSmrg# usually requires less dependencies and may be built and run under less
2715fe4c343aSmrg# stringent environments than integration tests.
2716fe4c343aSmrg#
2717fe4c343aSmrg# Interface to module:
2718fe4c343aSmrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
2719fe4c343aSmrg# enable_integration_tests:   used in configure.ac for additional configuration
2720fe4c343aSmrg# --enable-integration-tests: 'yes' user instructs the module to build tests
2721fe4c343aSmrg#                             'no' user instructs the module not to build tests
2722fe4c343aSmrg# parm1:                      specify the default value, yes or no.
2723fe4c343aSmrg#
2724fe4c343aSmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
2725fe4c343aSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
2726fe4c343aSmrgm4_define([_defopt], m4_default([$1], [auto]))
2727fe4c343aSmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
2728fe4c343aSmrg	[Enable building integration test cases (default: ]_defopt[)]),
2729fe4c343aSmrg	[enable_integration_tests=$enableval],
2730fe4c343aSmrg	[enable_integration_tests=]_defopt)
2731fe4c343aSmrgm4_undefine([_defopt])
2732fe4c343aSmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
2733fe4c343aSmrg	[test "x$enable_integration_tests" != xno])
2734fe4c343aSmrgAC_MSG_CHECKING([whether to build unit test cases])
2735fe4c343aSmrgAC_MSG_RESULT([$enable_integration_tests])
2736fe4c343aSmrg]) # XORG_ENABLE_INTEGRATION_TESTS
2737ba6a1819Smrg
2738fe4c343aSmrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
2739fe4c343aSmrg# ----------------------------------------
2740fe4c343aSmrg# Minimum version: 1.13.0
2741fe4c343aSmrg#
2742fe4c343aSmrg# GLib is a library which provides advanced data structures and functions.
2743fe4c343aSmrg# This macro enables a module to test for the presence of Glib.
2744fe4c343aSmrg#
2745fe4c343aSmrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
2746fe4c343aSmrg# Otherwise the value of $enable_unit_tests is blank.
2747fe4c343aSmrg#
2748fe4c343aSmrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
2749fe4c343aSmrg# test support usually requires less dependencies and may be built and run under
2750fe4c343aSmrg# less stringent environments than integration tests.
2751fe4c343aSmrg#
2752fe4c343aSmrg# Interface to module:
2753fe4c343aSmrg# HAVE_GLIB: used in makefiles to conditionally build targets
2754fe4c343aSmrg# with_glib: used in configure.ac to know if GLib has been found
2755fe4c343aSmrg# --with-glib:	'yes' user instructs the module to use glib
2756fe4c343aSmrg#		'no' user instructs the module not to use glib
2757fe4c343aSmrg#
2758fe4c343aSmrgAC_DEFUN([XORG_WITH_GLIB],[
2759fe4c343aSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
2760fe4c343aSmrgm4_define([_defopt], m4_default([$2], [auto]))
2761fe4c343aSmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
2762fe4c343aSmrg	[Use GLib library for unit testing (default: ]_defopt[)]),
2763fe4c343aSmrg	[with_glib=$withval], [with_glib=]_defopt)
2764fe4c343aSmrgm4_undefine([_defopt])
2765ba6a1819Smrg
2766fe4c343aSmrghave_glib=no
2767fe4c343aSmrg# Do not probe GLib if user explicitly disabled unit testing
2768fe4c343aSmrgif test "x$enable_unit_tests" != x"no"; then
2769fe4c343aSmrg  # Do not probe GLib if user explicitly disabled it
2770fe4c343aSmrg  if test "x$with_glib" != x"no"; then
2771fe4c343aSmrg    m4_ifval(
2772fe4c343aSmrg      [$1],
2773fe4c343aSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
2774fe4c343aSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
2775fe4c343aSmrg    )
2776fe4c343aSmrg  fi
2777fe4c343aSmrgfi
2778ba6a1819Smrg
2779fe4c343aSmrg# Not having GLib when unit testing has been explicitly requested is an error
2780fe4c343aSmrgif test "x$enable_unit_tests" = x"yes"; then
2781fe4c343aSmrg  if test "x$have_glib" = x"no"; then
2782fe4c343aSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
2783fe4c343aSmrg  fi
2784fe4c343aSmrgfi
2785ba6a1819Smrg
2786fe4c343aSmrg# Having unit testing disabled when GLib has been explicitly requested is an error
2787fe4c343aSmrgif test "x$enable_unit_tests" = x"no"; then
2788fe4c343aSmrg  if test "x$with_glib" = x"yes"; then
2789fe4c343aSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
2790fe4c343aSmrg  fi
2791fe4c343aSmrgfi
2792ba6a1819Smrg
2793fe4c343aSmrg# Not having GLib when it has been explicitly requested is an error
2794fe4c343aSmrgif test "x$with_glib" = x"yes"; then
2795fe4c343aSmrg  if test "x$have_glib" = x"no"; then
2796fe4c343aSmrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
2797fe4c343aSmrg  fi
2798fe4c343aSmrgfi
2799ba6a1819Smrg
2800fe4c343aSmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
2801fe4c343aSmrg]) # XORG_WITH_GLIB
2802ba6a1819Smrg
2803fe4c343aSmrg# XORG_LD_WRAP([required|optional])
2804fe4c343aSmrg# ---------------------------------
2805fe4c343aSmrg# Minimum version: 1.13.0
2806fe4c343aSmrg#
2807fe4c343aSmrg# Check if linker supports -wrap, passed via compiler flags
2808fe4c343aSmrg#
2809fe4c343aSmrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
2810fe4c343aSmrg# Otherwise the value of $enable_unit_tests is blank.
2811fe4c343aSmrg#
2812fe4c343aSmrg# Argument added in 1.16.0 - default is "required", to match existing behavior
2813fe4c343aSmrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
2814fe4c343aSmrg# available, an argument of "optional" allows use when some unit tests require
2815fe4c343aSmrg# ld -wrap and others do not.
2816fe4c343aSmrg#
2817fe4c343aSmrgAC_DEFUN([XORG_LD_WRAP],[
2818fe4c343aSmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
2819fe4c343aSmrg    [AC_LANG_PROGRAM([#include <stdlib.h>
2820fe4c343aSmrg                      void __wrap_exit(int status) { return; }],
2821fe4c343aSmrg                     [exit(0);])])
2822fe4c343aSmrg# Not having ld wrap when unit testing has been explicitly requested is an error
2823fe4c343aSmrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
2824fe4c343aSmrg  if test "x$have_ld_wrap" = x"no"; then
2825fe4c343aSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
2826ba6a1819Smrg  fi
28271bedbe3fSmrgfi
2828fe4c343aSmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
2829fe4c343aSmrg#
2830fe4c343aSmrg]) # XORG_LD_WRAP
2831ba6a1819Smrg
2832fe4c343aSmrg# XORG_CHECK_LINKER_FLAGS
28331bedbe3fSmrg# -----------------------
2834fe4c343aSmrg# SYNOPSIS
2835fe4c343aSmrg#
2836fe4c343aSmrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
2837fe4c343aSmrg#
2838fe4c343aSmrg# DESCRIPTION
2839fe4c343aSmrg#
2840fe4c343aSmrg#   Check whether the given linker FLAGS work with the current language's
2841fe4c343aSmrg#   linker, or whether they give an error.
2842fe4c343aSmrg#
2843fe4c343aSmrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
2844fe4c343aSmrg#   success/failure.
2845fe4c343aSmrg#
2846fe4c343aSmrg#   PROGRAM-SOURCE is the program source to link with, if needed
2847fe4c343aSmrg#
2848fe4c343aSmrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
2849fe4c343aSmrg#
2850fe4c343aSmrg# LICENSE
2851fe4c343aSmrg#
2852fe4c343aSmrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
2853fe4c343aSmrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
2854fe4c343aSmrg#   Copyright (c) 2009 Matteo Frigo
2855fe4c343aSmrg#
2856fe4c343aSmrg#   This program is free software: you can redistribute it and/or modify it
2857fe4c343aSmrg#   under the terms of the GNU General Public License as published by the
2858fe4c343aSmrg#   Free Software Foundation, either version 3 of the License, or (at your
2859fe4c343aSmrg#   option) any later version.
2860fe4c343aSmrg#
2861fe4c343aSmrg#   This program is distributed in the hope that it will be useful, but
2862fe4c343aSmrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
2863fe4c343aSmrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
2864fe4c343aSmrg#   Public License for more details.
2865fe4c343aSmrg#
2866fe4c343aSmrg#   You should have received a copy of the GNU General Public License along
2867fe4c343aSmrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
2868fe4c343aSmrg#
2869fe4c343aSmrg#   As a special exception, the respective Autoconf Macro's copyright owner
2870fe4c343aSmrg#   gives unlimited permission to copy, distribute and modify the configure
2871fe4c343aSmrg#   scripts that are the output of Autoconf when processing the Macro. You
2872fe4c343aSmrg#   need not follow the terms of the GNU General Public License when using
2873fe4c343aSmrg#   or distributing such scripts, even though portions of the text of the
2874fe4c343aSmrg#   Macro appear in them. The GNU General Public License (GPL) does govern
2875fe4c343aSmrg#   all other use of the material that constitutes the Autoconf Macro.
2876fe4c343aSmrg#
2877fe4c343aSmrg#   This special exception to the GPL applies to versions of the Autoconf
2878fe4c343aSmrg#   Macro released by the Autoconf Archive. When you make and distribute a
2879fe4c343aSmrg#   modified version of the Autoconf Macro, you may extend this special
2880fe4c343aSmrg#   exception to the GPL to apply to your modified version as well.#
2881fe4c343aSmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
2882fe4c343aSmrg[AC_MSG_CHECKING([whether the linker accepts $1])
2883fe4c343aSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
2884fe4c343aSmrgAS_LITERAL_IF([$1],
2885fe4c343aSmrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
2886fe4c343aSmrg      ax_save_FLAGS=$LDFLAGS
2887fe4c343aSmrg      LDFLAGS="$1"
2888fe4c343aSmrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
2889fe4c343aSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
2890fe4c343aSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
2891fe4c343aSmrg      LDFLAGS=$ax_save_FLAGS])],
2892fe4c343aSmrg  [ax_save_FLAGS=$LDFLAGS
2893fe4c343aSmrg   LDFLAGS="$1"
2894fe4c343aSmrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
2895fe4c343aSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
2896fe4c343aSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
2897fe4c343aSmrg   LDFLAGS=$ax_save_FLAGS])
2898fe4c343aSmrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
2899fe4c343aSmrgAC_MSG_RESULT($xorg_check_linker_flags)
2900fe4c343aSmrgif test "x$xorg_check_linker_flags" = xyes; then
2901fe4c343aSmrg	m4_default([$2], :)
2902fe4c343aSmrgelse
2903fe4c343aSmrg	m4_default([$3], :)
2904fe4c343aSmrgfi
2905fe4c343aSmrg]) # XORG_CHECK_LINKER_FLAGS
2906ba6a1819Smrg
2907fe4c343aSmrg# XORG_MEMORY_CHECK_FLAGS
2908fe4c343aSmrg# -----------------------
2909fe4c343aSmrg# Minimum version: 1.16.0
2910fe4c343aSmrg#
2911fe4c343aSmrg# This macro attempts to find appropriate memory checking functionality
2912fe4c343aSmrg# for various platforms which unit testing code may use to catch various
2913fe4c343aSmrg# forms of memory allocation and access errors in testing.
2914fe4c343aSmrg#
2915fe4c343aSmrg# Interface to module:
2916fe4c343aSmrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
2917fe4c343aSmrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
2918fe4c343aSmrg#
2919fe4c343aSmrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
2920fe4c343aSmrg#
2921fe4c343aSmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
2922ba6a1819Smrg
2923fe4c343aSmrgAC_REQUIRE([AC_CANONICAL_HOST])
2924fe4c343aSmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
2925fe4c343aSmrg           [Environment variables to enable memory checking in tests])
2926ba6a1819Smrg
2927fe4c343aSmrg# Check for different types of support on different platforms
2928fe4c343aSmrgcase $host_os in
2929fe4c343aSmrg    solaris*)
2930fe4c343aSmrg        AC_CHECK_LIB([umem], [umem_alloc],
2931fe4c343aSmrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
2932fe4c343aSmrg        ;;
2933fe4c343aSmrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
2934fe4c343aSmrg        # both directly and inverted, so should not be 0 or 255.
2935fe4c343aSmrg        malloc_debug_env='MALLOC_PERTURB_=15'
2936fe4c343aSmrg        ;;
2937fe4c343aSmrg    darwin*)
2938fe4c343aSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
2939fe4c343aSmrg        ;;
2940fe4c343aSmrg    *bsd*)
2941fe4c343aSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
2942fe4c343aSmrg        ;;
2943fe4c343aSmrgesac
2944ba6a1819Smrg
2945fe4c343aSmrg# User supplied flags override default flags
2946fe4c343aSmrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
2947fe4c343aSmrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
2948fe4c343aSmrgfi
2949ba6a1819Smrg
2950fe4c343aSmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
2951fe4c343aSmrg]) # XORG_WITH_LINT
2952549e21daSmrg
2953fe4c343aSmrg# XORG_CHECK_MALLOC_ZERO
2954fe4c343aSmrg# ----------------------
2955fe4c343aSmrg# Minimum version: 1.0.0
2956fe4c343aSmrg#
2957fe4c343aSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
2958fe4c343aSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
2959fe4c343aSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
2960fe4c343aSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
2961fe4c343aSmrgAC_ARG_ENABLE(malloc0returnsnull,
2962fe4c343aSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
2963fe4c343aSmrg		       [malloc(0) returns NULL (default: auto)]),
2964fe4c343aSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
2965fe4c343aSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
2966549e21daSmrg
2967fe4c343aSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
2968fe4c343aSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
2969fe4c343aSmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null],
2970fe4c343aSmrg	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
2971fe4c343aSmrg#include <stdlib.h>
2972fe4c343aSmrg],[
2973fe4c343aSmrg    char *m0, *r0, *c0, *p;
2974fe4c343aSmrg    m0 = malloc(0);
2975fe4c343aSmrg    p = malloc(10);
2976fe4c343aSmrg    r0 = realloc(p,0);
2977fe4c343aSmrg    c0 = calloc(0,10);
2978fe4c343aSmrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
2979fe4c343aSmrg])],
2980fe4c343aSmrg		[xorg_cv_malloc0_returns_null=yes],
2981fe4c343aSmrg		[xorg_cv_malloc0_returns_null=no])])
2982fe4c343aSmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
2983fe4c343aSmrgfi
2984fe4c343aSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
2985549e21daSmrg
2986fe4c343aSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
2987fe4c343aSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
2988fe4c343aSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
2989fe4c343aSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
2990fe4c343aSmrgelse
2991fe4c343aSmrg	MALLOC_ZERO_CFLAGS=""
2992fe4c343aSmrg	XMALLOC_ZERO_CFLAGS=""
2993fe4c343aSmrg	XTMALLOC_ZERO_CFLAGS=""
2994fe4c343aSmrgfi
2995549e21daSmrg
2996fe4c343aSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
2997fe4c343aSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
2998fe4c343aSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
2999fe4c343aSmrg]) # XORG_CHECK_MALLOC_ZERO
3000549e21daSmrg
3001fe4c343aSmrg# XORG_WITH_LINT()
3002fe4c343aSmrg# ----------------
3003fe4c343aSmrg# Minimum version: 1.1.0
3004fe4c343aSmrg#
3005fe4c343aSmrg# This macro enables the use of a tool that flags some suspicious and
3006fe4c343aSmrg# non-portable constructs (likely to be bugs) in C language source code.
3007fe4c343aSmrg# It will attempt to locate the tool and use appropriate options.
3008fe4c343aSmrg# There are various lint type tools on different platforms.
3009fe4c343aSmrg#
3010fe4c343aSmrg# Interface to module:
3011fe4c343aSmrg# LINT:		returns the path to the tool found on the platform
3012fe4c343aSmrg#		or the value set to LINT on the configure cmd line
3013fe4c343aSmrg#		also an Automake conditional
3014fe4c343aSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
3015fe4c343aSmrg#
3016fe4c343aSmrg# --with-lint:	'yes' user instructs the module to use lint
3017fe4c343aSmrg#		'no' user instructs the module not to use lint (default)
3018fe4c343aSmrg#
3019fe4c343aSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
3020fe4c343aSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
3021fe4c343aSmrg#
3022fe4c343aSmrgAC_DEFUN([XORG_WITH_LINT],[
3023549e21daSmrg
3024fe4c343aSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
3025fe4c343aSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
3026fe4c343aSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
3027fe4c343aSmrg		[Use a lint-style source code checker (default: disabled)])],
3028fe4c343aSmrg		[use_lint=$withval], [use_lint=no])
3029549e21daSmrg
3030fe4c343aSmrg# Obtain platform specific info like program name and options
3031fe4c343aSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
3032fe4c343aSmrgcase $host_os in
3033fe4c343aSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
3034fe4c343aSmrg	lint_name=splint
3035fe4c343aSmrg	lint_options="-badflag"
3036fe4c343aSmrg	;;
3037fe4c343aSmrg  *freebsd* | *netbsd*)
3038fe4c343aSmrg	lint_name=lint
3039fe4c343aSmrg	lint_options="-u -b"
3040fe4c343aSmrg	;;
3041fe4c343aSmrg  *solaris*)
3042fe4c343aSmrg	lint_name=lint
3043fe4c343aSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
3044fe4c343aSmrg	;;
3045fe4c343aSmrgesac
3046549e21daSmrg
3047fe4c343aSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
3048fe4c343aSmrgif test "x$use_lint" = x"yes" ; then
3049fe4c343aSmrg   AC_PATH_PROG([LINT], [$lint_name])
3050fe4c343aSmrg   if test "x$LINT" = "x"; then
3051fe4c343aSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
3052fe4c343aSmrg   fi
3053fe4c343aSmrgelif test "x$use_lint" = x"no" ; then
3054fe4c343aSmrg   if test "x$LINT" != "x"; then
3055fe4c343aSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
3056fe4c343aSmrg   fi
3057fe4c343aSmrgelse
3058fe4c343aSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
3059fe4c343aSmrgfi
3060549e21daSmrg
3061fe4c343aSmrg# User supplied flags override default flags
3062fe4c343aSmrgif test "x$LINT_FLAGS" != "x"; then
3063fe4c343aSmrg   lint_options=$LINT_FLAGS
3064fe4c343aSmrgfi
3065549e21daSmrg
3066fe4c343aSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
3067fe4c343aSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
3068549e21daSmrg
3069fe4c343aSmrg]) # XORG_WITH_LINT
3070549e21daSmrg
3071fe4c343aSmrg# XORG_LINT_LIBRARY(LIBNAME)
3072fe4c343aSmrg# --------------------------
3073fe4c343aSmrg# Minimum version: 1.1.0
3074fe4c343aSmrg#
3075fe4c343aSmrg# Sets up flags for building lint libraries for checking programs that call
3076fe4c343aSmrg# functions in the library.
3077fe4c343aSmrg#
3078fe4c343aSmrg# Interface to module:
3079fe4c343aSmrg# LINTLIB		- Automake variable with the name of lint library file to make
3080fe4c343aSmrg# MAKE_LINT_LIB		- Automake conditional
3081fe4c343aSmrg#
3082fe4c343aSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
3083fe4c343aSmrg#			  - 'no' user instructs the module not to create a lint library (default)
3084549e21daSmrg
3085fe4c343aSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
3086fe4c343aSmrgAC_REQUIRE([XORG_WITH_LINT])
3087fe4c343aSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
3088fe4c343aSmrg	[Create lint library (default: disabled)])],
3089fe4c343aSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
3090549e21daSmrg
3091fe4c343aSmrgif test "x$make_lint_lib" = x"yes" ; then
3092fe4c343aSmrg   LINTLIB=llib-l$1.ln
3093fe4c343aSmrg   if test "x$LINT" = "x"; then
3094fe4c343aSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
3095fe4c343aSmrg   fi
3096fe4c343aSmrgelif test "x$make_lint_lib" != x"no" ; then
3097fe4c343aSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
30981bedbe3fSmrgfi
3099549e21daSmrg
3100fe4c343aSmrgAC_SUBST(LINTLIB)
3101fe4c343aSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
3102549e21daSmrg
3103fe4c343aSmrg]) # XORG_LINT_LIBRARY
3104fe4c343aSmrg
3105fe4c343aSmrg# XORG_COMPILER_BRAND
31061bedbe3fSmrg# -------------------
3107fe4c343aSmrg# Minimum version: 1.14.0
3108fe4c343aSmrg#
3109fe4c343aSmrg# Checks for various brands of compilers and sets flags as appropriate:
3110fe4c343aSmrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
3111fe4c343aSmrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
3112fe4c343aSmrg#   clang compiler - sets CLANGCC to "yes"
3113fe4c343aSmrg#   Intel compiler - sets INTELCC to "yes"
3114fe4c343aSmrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
3115fe4c343aSmrg#
3116fe4c343aSmrgAC_DEFUN([XORG_COMPILER_BRAND], [
3117fe4c343aSmrgAC_LANG_CASE(
3118fe4c343aSmrg	[C], [
311900ca1914Smrg		dnl autoconf-2.70 folded AC_PROG_CC_C99 into AC_PROG_CC
312000ca1914Smrg		dnl and complains that AC_PROG_CC_C99 is obsolete
312100ca1914Smrg		m4_version_prereq([2.70],
312200ca1914Smrg			[AC_REQUIRE([AC_PROG_CC])],
312300ca1914Smrg			[AC_REQUIRE([AC_PROG_CC_C99])])
3124fe4c343aSmrg	],
3125fe4c343aSmrg	[C++], [
3126fe4c343aSmrg		AC_REQUIRE([AC_PROG_CXX])
3127fe4c343aSmrg	]
3128fe4c343aSmrg)
3129fe4c343aSmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
3130fe4c343aSmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
3131fe4c343aSmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
3132fe4c343aSmrg]) # XORG_COMPILER_BRAND
3133549e21daSmrg
3134fe4c343aSmrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
3135fe4c343aSmrg# ---------------
3136fe4c343aSmrg# Minimum version: 1.16.0
3137fe4c343aSmrg#
3138fe4c343aSmrg# Test if the compiler works when passed the given flag as a command line argument.
313900ca1914Smrg# If it succeeds, the flag is appended to the given variable.  If not, it tries the
3140fe4c343aSmrg# next flag in the list until there are no more options.
3141fe4c343aSmrg#
3142fe4c343aSmrg# Note that this does not guarantee that the compiler supports the flag as some
3143fe4c343aSmrg# compilers will simply ignore arguments that they do not understand, but we do
3144fe4c343aSmrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
3145fe4c343aSmrg# -Werror=unused-command-line-argument
3146fe4c343aSmrg#
3147fe4c343aSmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
3148fe4c343aSmrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
3149fe4c343aSmrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
3150549e21daSmrg
3151fe4c343aSmrgAC_LANG_COMPILER_REQUIRE
3152549e21daSmrg
3153fe4c343aSmrgAC_LANG_CASE(
3154fe4c343aSmrg	[C], [
315500ca1914Smrg		dnl autoconf-2.70 folded AC_PROG_CC_C99 into AC_PROG_CC
315600ca1914Smrg		dnl and complains that AC_PROG_CC_C99 is obsolete
315700ca1914Smrg		m4_version_prereq([2.70],
315800ca1914Smrg			[AC_REQUIRE([AC_PROG_CC])],
315900ca1914Smrg			[AC_REQUIRE([AC_PROG_CC_C99])])
3160fe4c343aSmrg		define([PREFIX], [C])
3161fe4c343aSmrg		define([CACHE_PREFIX], [cc])
3162fe4c343aSmrg		define([COMPILER], [$CC])
3163fe4c343aSmrg	],
3164fe4c343aSmrg	[C++], [
3165fe4c343aSmrg		define([PREFIX], [CXX])
3166fe4c343aSmrg		define([CACHE_PREFIX], [cxx])
3167fe4c343aSmrg		define([COMPILER], [$CXX])
3168fe4c343aSmrg	]
3169fe4c343aSmrg)
3170549e21daSmrg
3171fe4c343aSmrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
3172549e21daSmrg
3173fe4c343aSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
3174fe4c343aSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
3175fe4c343aSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
3176fe4c343aSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
3177fe4c343aSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
3178fe4c343aSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
3179fe4c343aSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
3180fe4c343aSmrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
3181fe4c343aSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
3182fe4c343aSmrgfi
3183549e21daSmrg
3184fe4c343aSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
3185fe4c343aSmrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
3186fe4c343aSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
3187fe4c343aSmrg	fi
3188fe4c343aSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
3189fe4c343aSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
3190fe4c343aSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
3191fe4c343aSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
3192fe4c343aSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
3193fe4c343aSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
3194fe4c343aSmrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
3195fe4c343aSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
3196fe4c343aSmrgfi
3197549e21daSmrg
3198fe4c343aSmrgfound="no"
3199fe4c343aSmrgm4_foreach([flag], m4_cdr($@), [
3200fe4c343aSmrg	if test $found = "no" ; then
3201fe4c343aSmrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
3202fe4c343aSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
3203fe4c343aSmrg		fi
3204549e21daSmrg
3205fe4c343aSmrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
3206fe4c343aSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
3207fe4c343aSmrg		fi
3208549e21daSmrg
3209fe4c343aSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
3210549e21daSmrg
3211fe4c343aSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
3212fe4c343aSmrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
3213fe4c343aSmrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
3214fe4c343aSmrg		AC_CACHE_VAL($cacheid,
3215fe4c343aSmrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
3216fe4c343aSmrg					     [eval $cacheid=yes],
3217fe4c343aSmrg					     [eval $cacheid=no])])
32181bedbe3fSmrg
3219fe4c343aSmrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
3220549e21daSmrg
3221fe4c343aSmrg		eval supported=\$$cacheid
3222fe4c343aSmrg		AC_MSG_RESULT([$supported])
3223fe4c343aSmrg		if test "$supported" = "yes" ; then
3224fe4c343aSmrg			$1="$$1 ]flag["
3225fe4c343aSmrg			found="yes"
3226fe4c343aSmrg		fi
3227fe4c343aSmrg	fi
3228fe4c343aSmrg])
3229fe4c343aSmrg]) # XORG_TESTSET_CFLAG
3230549e21daSmrg
3231fe4c343aSmrg# XORG_COMPILER_FLAGS
32321bedbe3fSmrg# ---------------
3233fe4c343aSmrg# Minimum version: 1.16.0
3234fe4c343aSmrg#
3235fe4c343aSmrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
3236fe4c343aSmrg# arguments supported by the selected compiler which do NOT alter the generated
3237fe4c343aSmrg# code.  These arguments will cause the compiler to print various warnings
3238fe4c343aSmrg# during compilation AND turn a conservative set of warnings into errors.
3239fe4c343aSmrg#
3240fe4c343aSmrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
3241fe4c343aSmrg# future versions of util-macros as options are added to new compilers.
3242fe4c343aSmrg#
3243fe4c343aSmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
3244fe4c343aSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
3245549e21daSmrg
3246fe4c343aSmrgAC_ARG_ENABLE(selective-werror,
3247fe4c343aSmrg              AS_HELP_STRING([--disable-selective-werror],
3248fe4c343aSmrg                             [Turn off selective compiler errors. (default: enabled)]),
3249fe4c343aSmrg              [SELECTIVE_WERROR=$enableval],
3250fe4c343aSmrg              [SELECTIVE_WERROR=yes])
3251549e21daSmrg
3252fe4c343aSmrgAC_LANG_CASE(
3253fe4c343aSmrg        [C], [
3254fe4c343aSmrg                define([PREFIX], [C])
3255fe4c343aSmrg        ],
3256fe4c343aSmrg        [C++], [
3257fe4c343aSmrg                define([PREFIX], [CXX])
3258fe4c343aSmrg        ]
3259fe4c343aSmrg)
3260fe4c343aSmrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
3261fe4c343aSmrgif test "x$SUNCC" = "xyes"; then
3262fe4c343aSmrg    [BASE_]PREFIX[FLAGS]="-v"
3263fe4c343aSmrgelse
3264fe4c343aSmrg    [BASE_]PREFIX[FLAGS]=""
3265fe4c343aSmrgfi
3266549e21daSmrg
3267fe4c343aSmrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
3268fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
3269fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
3270fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
3271fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
3272549e21daSmrg
3273fe4c343aSmrgAC_LANG_CASE(
3274fe4c343aSmrg	[C], [
3275fe4c343aSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
3276fe4c343aSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
3277fe4c343aSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
3278fe4c343aSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
3279fe4c343aSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
3280fe4c343aSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
3281fe4c343aSmrg	]
3282fe4c343aSmrg)
3283549e21daSmrg
3284fe4c343aSmrg# This chunk adds additional warnings that could catch undesired effects.
3285fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
3286fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
3287fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
3288fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
3289fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
3290fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
3291fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
3292549e21daSmrg
3293fe4c343aSmrg# These are currently disabled because they are noisy.  They will be enabled
3294fe4c343aSmrg# in the future once the codebase is sufficiently modernized to silence
3295fe4c343aSmrg# them.  For now, I don't want them to drown out the other warnings.
3296fe4c343aSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
3297fe4c343aSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
3298fe4c343aSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
32991bedbe3fSmrg
330000ca1914Smrg# Turn some warnings into errors, so we don't accidentally get successful builds
3301fe4c343aSmrg# when there are problems that should be fixed.
3302549e21daSmrg
3303fe4c343aSmrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
3304fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
3305fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
3306fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
3307fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
3308fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
3309fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
3310fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
3311fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
3312fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
3313fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
3314fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
3315fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
3316fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
33171bedbe3fSmrgelse
3318fe4c343aSmrgAC_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])
3319fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
3320fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
3321fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
3322fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
3323fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
3324fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
3325fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
3326fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
3327fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
3328fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
3329fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
3330fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
3331fe4c343aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
33321bedbe3fSmrgfi
3333549e21daSmrg
3334fe4c343aSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
3335fe4c343aSmrg]) # XORG_COMPILER_FLAGS
3336549e21daSmrg
3337fe4c343aSmrg# XORG_CWARNFLAGS
3338fe4c343aSmrg# ---------------
3339fe4c343aSmrg# Minimum version: 1.2.0
3340fe4c343aSmrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
3341fe4c343aSmrg#
3342fe4c343aSmrg# Defines CWARNFLAGS to enable C compiler warnings.
3343fe4c343aSmrg#
3344fe4c343aSmrg# This function is deprecated because it defines -fno-strict-aliasing
3345fe4c343aSmrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
3346fe4c343aSmrg# is needed, then it should be added explicitly in the module when
3347fe4c343aSmrg# it is updated to use BASE_CFLAGS.
3348fe4c343aSmrg#
3349fe4c343aSmrgAC_DEFUN([XORG_CWARNFLAGS], [
3350fe4c343aSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
3351fe4c343aSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
3352fe4c343aSmrgAC_LANG_CASE(
3353fe4c343aSmrg	[C], [
3354fe4c343aSmrg		CWARNFLAGS="$BASE_CFLAGS"
3355fe4c343aSmrg		if  test "x$GCC" = xyes ; then
3356fe4c343aSmrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
3357fe4c343aSmrg		fi
3358fe4c343aSmrg		AC_SUBST(CWARNFLAGS)
3359fe4c343aSmrg	]
3360fe4c343aSmrg)
3361fe4c343aSmrg]) # XORG_CWARNFLAGS
3362549e21daSmrg
3363fe4c343aSmrg# XORG_STRICT_OPTION
3364fe4c343aSmrg# -----------------------
3365fe4c343aSmrg# Minimum version: 1.3.0
3366fe4c343aSmrg#
3367fe4c343aSmrg# Add configure option to enable strict compilation flags, such as treating
3368fe4c343aSmrg# warnings as fatal errors.
3369fe4c343aSmrg# If --enable-strict-compilation is passed to configure, adds strict flags to
3370fe4c343aSmrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
3371fe4c343aSmrg#
3372fe4c343aSmrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
3373fe4c343aSmrg# when strict compilation is unconditionally desired.
3374fe4c343aSmrgAC_DEFUN([XORG_STRICT_OPTION], [
3375fe4c343aSmrgAC_REQUIRE([XORG_CWARNFLAGS])
3376fe4c343aSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
3377549e21daSmrg
3378fe4c343aSmrgAC_ARG_ENABLE(strict-compilation,
3379fe4c343aSmrg			  AS_HELP_STRING([--enable-strict-compilation],
3380fe4c343aSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
3381fe4c343aSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
3382549e21daSmrg
3383fe4c343aSmrgAC_LANG_CASE(
3384fe4c343aSmrg        [C], [
3385fe4c343aSmrg                define([PREFIX], [C])
3386fe4c343aSmrg        ],
3387fe4c343aSmrg        [C++], [
3388fe4c343aSmrg                define([PREFIX], [CXX])
3389fe4c343aSmrg        ]
3390fe4c343aSmrg)
3391549e21daSmrg
3392fe4c343aSmrg[STRICT_]PREFIX[FLAGS]=""
3393fe4c343aSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
3394fe4c343aSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
3395549e21daSmrg
3396fe4c343aSmrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
3397fe4c343aSmrg# activate it with -Werror, so we add it here explicitly.
3398fe4c343aSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
3399549e21daSmrg
3400fe4c343aSmrgif test "x$STRICT_COMPILE" = "xyes"; then
3401fe4c343aSmrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
3402fe4c343aSmrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
34031bedbe3fSmrgfi
3404fe4c343aSmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
3405fe4c343aSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
3406fe4c343aSmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
3407fe4c343aSmrg]) # XORG_STRICT_OPTION
3408549e21daSmrg
340900ca1914Smrg# XORG_DEFAULT_NOCODE_OPTIONS
341000ca1914Smrg# ---------------------------
341100ca1914Smrg# Minimum version: 1.20.0
341200ca1914Smrg#
341300ca1914Smrg# Defines default options for X.Org modules which don't compile code,
341400ca1914Smrg# such as fonts, bitmaps, cursors, and docs.
341500ca1914Smrg#
341600ca1914SmrgAC_DEFUN([XORG_DEFAULT_NOCODE_OPTIONS], [
341700ca1914SmrgAC_REQUIRE([AC_PROG_INSTALL])
341800ca1914SmrgXORG_RELEASE_VERSION
341900ca1914SmrgXORG_CHANGELOG
342000ca1914SmrgXORG_INSTALL
342100ca1914SmrgXORG_MANPAGE_SECTIONS
342200ca1914Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
342300ca1914Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
342400ca1914Smrg]) # XORG_DEFAULT_NOCODE_OPTIONS
342500ca1914Smrg
3426fe4c343aSmrg# XORG_DEFAULT_OPTIONS
3427fe4c343aSmrg# --------------------
3428fe4c343aSmrg# Minimum version: 1.3.0
3429fe4c343aSmrg#
343000ca1914Smrg# Defines default options for X.Org modules which compile code.
3431fe4c343aSmrg#
3432fe4c343aSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
3433fe4c343aSmrgAC_REQUIRE([AC_PROG_INSTALL])
3434fe4c343aSmrgXORG_COMPILER_FLAGS
3435fe4c343aSmrgXORG_CWARNFLAGS
3436fe4c343aSmrgXORG_STRICT_OPTION
343700ca1914SmrgXORG_DEFAULT_NOCODE_OPTIONS
3438fe4c343aSmrg]) # XORG_DEFAULT_OPTIONS
3439fe4c343aSmrg
3440fe4c343aSmrg# XORG_INSTALL()
3441fe4c343aSmrg# ----------------
3442fe4c343aSmrg# Minimum version: 1.4.0
3443fe4c343aSmrg#
3444fe4c343aSmrg# Defines the variable INSTALL_CMD as the command to copy
3445fe4c343aSmrg# INSTALL from $prefix/share/util-macros.
3446fe4c343aSmrg#
3447fe4c343aSmrgAC_DEFUN([XORG_INSTALL], [
3448fe4c343aSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
3449fe4c343aSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
3450fe4c343aSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
3451fe4c343aSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
3452fe4c343aSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; test -e \$(top_srcdir)/INSTALL || ( \
3453fe4c343aSmrgtouch \$(top_srcdir)/INSTALL; \
3454fe4c343aSmrgecho 'failed to copy INSTALL from util-macros: installing empty INSTALL.' >&2))"
3455fe4c343aSmrgAC_SUBST([INSTALL_CMD])
3456fe4c343aSmrg]) # XORG_INSTALL
3457fe4c343aSmrgdnl Copyright 2005 Red Hat, Inc
3458fe4c343aSmrgdnl
3459fe4c343aSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
3460fe4c343aSmrgdnl documentation for any purpose is hereby granted without fee, provided that
3461fe4c343aSmrgdnl the above copyright notice appear in all copies and that both that
3462fe4c343aSmrgdnl copyright notice and this permission notice appear in supporting
3463fe4c343aSmrgdnl documentation.
3464fe4c343aSmrgdnl
3465fe4c343aSmrgdnl The above copyright notice and this permission notice shall be included
3466fe4c343aSmrgdnl in all copies or substantial portions of the Software.
3467fe4c343aSmrgdnl
3468fe4c343aSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
3469fe4c343aSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
3470fe4c343aSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
3471fe4c343aSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
3472fe4c343aSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
3473fe4c343aSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
3474fe4c343aSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
3475fe4c343aSmrgdnl
3476fe4c343aSmrgdnl Except as contained in this notice, the name of the copyright holders shall
3477fe4c343aSmrgdnl not be used in advertising or otherwise to promote the sale, use or
3478fe4c343aSmrgdnl other dealings in this Software without prior written authorization
3479fe4c343aSmrgdnl from the copyright holders.
3480fe4c343aSmrgdnl
3481549e21daSmrg
3482fe4c343aSmrg# XORG_RELEASE_VERSION
3483fe4c343aSmrg# --------------------
3484fe4c343aSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
3485549e21daSmrg
3486fe4c343aSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
3487fe4c343aSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
3488fe4c343aSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
3489fe4c343aSmrg		[Major version of this package])
3490fe4c343aSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
3491fe4c343aSmrg	if test "x$PVM" = "x"; then
3492fe4c343aSmrg		PVM="0"
3493fe4c343aSmrg	fi
3494fe4c343aSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
3495fe4c343aSmrg		[$PVM],
3496fe4c343aSmrg		[Minor version of this package])
3497fe4c343aSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
3498fe4c343aSmrg	if test "x$PVP" = "x"; then
3499fe4c343aSmrg		PVP="0"
3500fe4c343aSmrg	fi
3501fe4c343aSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
3502fe4c343aSmrg		[$PVP],
3503fe4c343aSmrg		[Patch version of this package])
35041bedbe3fSmrg])
3505549e21daSmrg
3506fe4c343aSmrg# XORG_CHANGELOG()
3507fe4c343aSmrg# ----------------
3508fe4c343aSmrg# Minimum version: 1.2.0
3509fe4c343aSmrg#
3510fe4c343aSmrg# Defines the variable CHANGELOG_CMD as the command to generate
3511fe4c343aSmrg# ChangeLog from git.
3512fe4c343aSmrg#
3513fe4c343aSmrg#
3514fe4c343aSmrgAC_DEFUN([XORG_CHANGELOG], [
3515fe4c343aSmrgCHANGELOG_CMD="((GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp) 2>/dev/null && \
3516fe4c343aSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
3517fe4c343aSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; test -e \$(top_srcdir)/ChangeLog || ( \
3518fe4c343aSmrgtouch \$(top_srcdir)/ChangeLog; \
3519fe4c343aSmrgecho 'git failed to create ChangeLog: installing empty ChangeLog.' >&2))"
3520fe4c343aSmrgAC_SUBST([CHANGELOG_CMD])
3521fe4c343aSmrg]) # XORG_CHANGELOG
3522549e21daSmrg
3523fe4c343aSmrgdnl
352400ca1914Smrgdnl Copyright (c) 2005, Oracle and/or its affiliates.
3525fe4c343aSmrgdnl
3526fe4c343aSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
3527fe4c343aSmrgdnl copy of this software and associated documentation files (the "Software"),
3528fe4c343aSmrgdnl to deal in the Software without restriction, including without limitation
3529fe4c343aSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
3530fe4c343aSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
3531fe4c343aSmrgdnl Software is furnished to do so, subject to the following conditions:
3532fe4c343aSmrgdnl
3533fe4c343aSmrgdnl The above copyright notice and this permission notice (including the next
3534fe4c343aSmrgdnl paragraph) shall be included in all copies or substantial portions of the
3535fe4c343aSmrgdnl Software.
3536fe4c343aSmrgdnl
3537fe4c343aSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
3538fe4c343aSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
3539fe4c343aSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
3540fe4c343aSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
3541fe4c343aSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
3542fe4c343aSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
3543fe4c343aSmrgdnl DEALINGS IN THE SOFTWARE.
3544fe4c343aSmrgdnl
3545549e21daSmrg
3546fe4c343aSmrg# XTRANS_TCP_FLAGS()
3547fe4c343aSmrg# ------------------
3548fe4c343aSmrg# Find needed libraries for TCP sockets, and check for IPv6 support
3549fe4c343aSmrgAC_DEFUN([XTRANS_TCP_FLAGS],[
3550fe4c343aSmrg # SVR4 hides these in libraries other than libc
3551fe4c343aSmrg AC_SEARCH_LIBS(socket, [socket])
3552fe4c343aSmrg AC_SEARCH_LIBS(gethostbyname, [nsl])
3553fe4c343aSmrg if test "$ac_cv_search_socket$ac_cv_search_gethostbyname" = "nono"; then
3554fe4c343aSmrg   AC_CHECK_LIB([ws2_32],[main])
3555fe4c343aSmrg fi
3556549e21daSmrg
3557fe4c343aSmrg # Needs to come after above checks for libsocket & libnsl for SVR4 systems
3558fe4c343aSmrg AC_ARG_ENABLE(ipv6,
3559fe4c343aSmrg	AS_HELP_STRING([--enable-ipv6],[Enable IPv6 support]),
3560fe4c343aSmrg	[IPV6CONN=$enableval],
3561fe4c343aSmrg	[AC_CHECK_FUNC(getaddrinfo,[IPV6CONN=yes],[IPV6CONN=no])])
3562fe4c343aSmrg AC_MSG_CHECKING([if IPv6 support should be built])
3563fe4c343aSmrg if test "$IPV6CONN" = "yes"; then
3564fe4c343aSmrg	AC_DEFINE(IPv6,1,[Support IPv6 for TCP connections])
3565fe4c343aSmrg fi
3566fe4c343aSmrg AC_MSG_RESULT($IPV6CONN)
3567549e21daSmrg
3568fe4c343aSmrg # 4.3BSD-Reno added a new member to struct sockaddr_in
3569fe4c343aSmrg AC_CHECK_MEMBER([struct sockaddr_in.sin_len],
3570fe4c343aSmrg	AC_DEFINE([BSD44SOCKETS],1,
3571fe4c343aSmrg 	    [Define to 1 if `struct sockaddr_in' has a `sin_len' member]), [], [
3572fe4c343aSmrg#include <sys/types.h>
3573fe4c343aSmrg#include <sys/socket.h>
3574fe4c343aSmrg#include <netinet/in.h>
3575fe4c343aSmrg ])
3576549e21daSmrg
3577fe4c343aSmrg # POSIX.1g changed the type of pointer passed to getsockname/getpeername/etc.
3578fe4c343aSmrg AC_CHECK_TYPES([socklen_t], [], [], [
3579fe4c343aSmrgAC_INCLUDES_DEFAULT
3580fe4c343aSmrg#include <sys/socket.h>])
3581549e21daSmrg
3582fe4c343aSmrg # XPG4v2/UNIX95 added msg_control - check to see if we need to define
3583fe4c343aSmrg # _XOPEN_SOURCE to get it (such as on Solaris)
3584fe4c343aSmrg AC_CHECK_MEMBER([struct msghdr.msg_control], [], [],
3585fe4c343aSmrg                 [
3586fe4c343aSmrgAC_INCLUDES_DEFAULT
3587fe4c343aSmrg#include <sys/socket.h>
3588fe4c343aSmrg                 ])
3589fe4c343aSmrg # First try for Solaris in C99 compliant mode, which requires XPG6/UNIX03
3590fe4c343aSmrg if test "x$ac_cv_member_struct_msghdr_msg_control" = xno; then
3591fe4c343aSmrg     unset ac_cv_member_struct_msghdr_msg_control
3592fe4c343aSmrg     AC_MSG_NOTICE([trying again with _XOPEN_SOURCE=600])
3593fe4c343aSmrg     AC_CHECK_MEMBER([struct msghdr.msg_control],
3594fe4c343aSmrg                     [AC_DEFINE([_XOPEN_SOURCE], [600],
3595fe4c343aSmrg                       [Defined if needed to expose struct msghdr.msg_control])
3596fe4c343aSmrg                     ], [], [
3597fe4c343aSmrg#define _XOPEN_SOURCE 600
3598fe4c343aSmrgAC_INCLUDES_DEFAULT
3599fe4c343aSmrg#include <sys/socket.h>
3600fe4c343aSmrg                     ])
3601fe4c343aSmrg fi
3602fe4c343aSmrg # If that didn't work, fall back to XPG5/UNIX98 with C89
3603fe4c343aSmrg if test "x$ac_cv_member_struct_msghdr_msg_control" = xno; then
3604fe4c343aSmrg     unset ac_cv_member_struct_msghdr_msg_control
3605fe4c343aSmrg     AC_MSG_NOTICE([trying again with _XOPEN_SOURCE=500])
3606fe4c343aSmrg     AC_CHECK_MEMBER([struct msghdr.msg_control],
3607fe4c343aSmrg                     [AC_DEFINE([_XOPEN_SOURCE], [500],
3608fe4c343aSmrg                       [Defined if needed to expose struct msghdr.msg_control])
3609fe4c343aSmrg                     ], [], [
3610fe4c343aSmrg#define _XOPEN_SOURCE 500
3611fe4c343aSmrgAC_INCLUDES_DEFAULT
3612fe4c343aSmrg#include <sys/socket.h>
3613fe4c343aSmrg                     ])
3614fe4c343aSmrg fi
3615549e21daSmrg
3616549e21daSmrg
3617fe4c343aSmrg]) # XTRANS_TCP_FLAGS
3618549e21daSmrg
3619fe4c343aSmrg# XTRANS_CONNECTION_FLAGS()
3620fe4c343aSmrg# -------------------------
3621fe4c343aSmrg# Standard checks for which Xtrans transports to use by the Xorg packages
3622fe4c343aSmrg# that use Xtrans functions
3623fe4c343aSmrgAC_DEFUN([XTRANS_CONNECTION_FLAGS],[
3624fe4c343aSmrg AC_REQUIRE([AC_CANONICAL_HOST])
3625fe4c343aSmrg [case $host_os in
3626fe4c343aSmrg	mingw*)	unixdef="no"   ;;
3627fe4c343aSmrg	*)	unixdef="yes"  ;;
3628fe4c343aSmrg esac]
3629fe4c343aSmrg AC_ARG_ENABLE(unix-transport,
3630fe4c343aSmrg	AS_HELP_STRING([--enable-unix-transport],[Enable UNIX domain socket transport]),
3631fe4c343aSmrg	[UNIXCONN=$enableval], [UNIXCONN=$unixdef])
3632fe4c343aSmrg AC_MSG_CHECKING([if Xtrans should support UNIX socket connections])
3633fe4c343aSmrg if test "$UNIXCONN" = "yes"; then
3634fe4c343aSmrg	AC_DEFINE(UNIXCONN,1,[Support UNIX socket connections])
3635fe4c343aSmrg fi
3636fe4c343aSmrg AC_MSG_RESULT($UNIXCONN)
3637fe4c343aSmrg AC_ARG_ENABLE(tcp-transport,
3638fe4c343aSmrg	AS_HELP_STRING([--enable-tcp-transport],[Enable TCP socket transport]),
3639fe4c343aSmrg	[TCPCONN=$enableval], [TCPCONN=yes])
3640fe4c343aSmrg AC_MSG_CHECKING([if Xtrans should support TCP socket connections])
3641fe4c343aSmrg AC_MSG_RESULT($TCPCONN)
3642fe4c343aSmrg if test "$TCPCONN" = "yes"; then
3643fe4c343aSmrg	AC_DEFINE(TCPCONN,1,[Support TCP socket connections])
3644fe4c343aSmrg	XTRANS_TCP_FLAGS
3645fe4c343aSmrg fi
3646fe4c343aSmrg [case $host_os in
3647da1f2d5dSmrg	solaris*)		localdef="yes" ;;
3648fe4c343aSmrg	*)			localdef="no"  ;;
3649fe4c343aSmrg esac]
3650fe4c343aSmrg AC_ARG_ENABLE(local-transport,
3651fe4c343aSmrg	AS_HELP_STRING([--enable-local-transport],[Enable os-specific local transport]),
3652fe4c343aSmrg	[LOCALCONN=$enableval], [LOCALCONN=$localdef])
3653fe4c343aSmrg AC_MSG_CHECKING([if Xtrans should support os-specific local connections])
3654fe4c343aSmrg AC_MSG_RESULT($LOCALCONN)
3655fe4c343aSmrg if test "$LOCALCONN" = "yes"; then
3656fe4c343aSmrg	AC_DEFINE(LOCALCONN,1,[Support os-specific local connections])
3657fe4c343aSmrg fi
3658549e21daSmrg
3659fe4c343aSmrg # Other functions Xtrans may need
3660fe4c343aSmrg AC_CHECK_FUNCS([strcasecmp strlcpy])
3661549e21daSmrg
3662fe4c343aSmrg]) # XTRANS_CONNECTION_FLAGS
3663549e21daSmrg
3664549e21daSmrg
3665fe4c343aSmrg# XTRANS_SECURE_RPC_FLAGS()
3666fe4c343aSmrg# -------------------------
3667fe4c343aSmrg# Check for Secure RPC functions - must come after XTRANS_TCP_FLAGS
3668fe4c343aSmrg# so that any necessary networking libraries are already found
3669fe4c343aSmrgAC_DEFUN([XTRANS_SECURE_RPC_FLAGS],
3670fe4c343aSmrg[AC_REQUIRE([XTRANS_TCP_FLAGS])
3671fe4c343aSmrg AC_ARG_ENABLE(secure-rpc,
3672fe4c343aSmrg	AS_HELP_STRING([--enable-secure-rpc],[Enable Secure RPC]),
3673fe4c343aSmrg        [SECURE_RPC=$enableval], [SECURE_RPC="try"])
3674549e21daSmrg
3675fe4c343aSmrg if test "x$SECURE_RPC" = "xyes" -o "x$SECURE_RPC" = "xtry" ; then
3676fe4c343aSmrg	FOUND_SECURE_RPC="no"
3677fe4c343aSmrg	AC_CHECK_FUNCS([authdes_seccreate authdes_create],
3678fe4c343aSmrg			[FOUND_SECURE_RPC="yes"])
3679fe4c343aSmrg	if test "x$FOUND_SECURE_RPC" = "xno" ; then
3680fe4c343aSmrg		if test "x$SECURE_RPC" = "xyes" ; then
3681fe4c343aSmrg	AC_MSG_ERROR([Secure RPC requested, but required functions not found])
3682fe4c343aSmrg		fi
3683fe4c343aSmrg		SECURE_RPC="no"
3684fe4c343aSmrg	else
3685fe4c343aSmrg		dnl FreeBSD keeps getsecretkey in librpcsvc
3686fe4c343aSmrg		AC_SEARCH_LIBS(getsecretkey, [rpcsvc])
3687fe4c343aSmrg		SECURE_RPC="yes"
3688fe4c343aSmrg	fi
3689fe4c343aSmrg fi
3690fe4c343aSmrg AC_MSG_CHECKING([if Secure RPC authentication ("SUN-DES-1") should be supported])
3691fe4c343aSmrg if test "x$SECURE_RPC" = "xyes" ; then
3692fe4c343aSmrg	AC_DEFINE(SECURE_RPC, 1, [Support Secure RPC ("SUN-DES-1") authentication for X11 clients])
3693fe4c343aSmrg fi
3694fe4c343aSmrg AC_MSG_RESULT($SECURE_RPC)
3695fe4c343aSmrg]) # XTRANS_SECURE_RPC_FLAGS
3696549e21daSmrg
3697549e21daSmrg
369800ca1914Smrgm4_include([m4/libtool.m4])
369900ca1914Smrgm4_include([m4/ltoptions.m4])
370000ca1914Smrgm4_include([m4/ltsugar.m4])
370100ca1914Smrgm4_include([m4/ltversion.m4])
370200ca1914Smrgm4_include([m4/lt~obsolete.m4])
3703