110f94802Smrg# generated automatically by aclocal 1.17 -*- Autoconf -*- 257ee1794Smrg 310f94802Smrg# Copyright (C) 1996-2024 Free Software Foundation, Inc. 4a253d6aeSmrg 5a253d6aeSmrg# This file is free software; the Free Software Foundation 6a253d6aeSmrg# gives unlimited permission to copy and/or distribute it, 7a253d6aeSmrg# with or without modifications, as long as this notice is preserved. 8a253d6aeSmrg 9a253d6aeSmrg# This program is distributed in the hope that it will be useful, 10a253d6aeSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without 11a253d6aeSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A 12a253d6aeSmrg# PARTICULAR PURPOSE. 13a253d6aeSmrg 1457ee1794Smrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) 15ea133fd7Smrgm4_ifndef([AC_AUTOCONF_VERSION], 16ea133fd7Smrg [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 1710f94802Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.72],, 1810f94802Smrg[m4_warning([this file was generated for autoconf 2.72. 19ea133fd7SmrgYou have another version of autoconf. It may work, but is not guaranteed to. 20ea133fd7SmrgIf you have problems, you may need to regenerate the build system entirely. 2157ee1794SmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])]) 22a253d6aeSmrg 2310f94802Smrg# Copyright (C) 2002-2024 Free Software Foundation, Inc. 24a253d6aeSmrg# 25b41a30aaSmrg# This file is free software; the Free Software Foundation 26b41a30aaSmrg# gives unlimited permission to copy and/or distribute it, 27b41a30aaSmrg# with or without modifications, as long as this notice is preserved. 28b41a30aaSmrg 29b41a30aaSmrg# AM_AUTOMAKE_VERSION(VERSION) 30b41a30aaSmrg# ---------------------------- 31b41a30aaSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been 32b41a30aaSmrg# generated from the m4 files accompanying Automake X.Y. 33b41a30aaSmrg# (This private macro should not be called outside this file.) 34b41a30aaSmrgAC_DEFUN([AM_AUTOMAKE_VERSION], 3510f94802Smrg[am__api_version='1.17' 36b41a30aaSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to 37b41a30aaSmrgdnl require some minimum version. Point them to the right macro. 3810f94802Smrgm4_if([$1], [1.17], [], 39b41a30aaSmrg [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl 40b41a30aaSmrg]) 41b41a30aaSmrg 42b41a30aaSmrg# _AM_AUTOCONF_VERSION(VERSION) 43b41a30aaSmrg# ----------------------------- 44b41a30aaSmrg# aclocal traces this macro to find the Autoconf version. 45b41a30aaSmrg# This is a private macro too. Using m4_define simplifies 46b41a30aaSmrg# the logic in aclocal, which can simply ignore this definition. 47b41a30aaSmrgm4_define([_AM_AUTOCONF_VERSION], []) 48b41a30aaSmrg 49b41a30aaSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION 50b41a30aaSmrg# ------------------------------- 51b41a30aaSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. 52b41a30aaSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. 53b41a30aaSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 5410f94802Smrg[AM_AUTOMAKE_VERSION([1.17])dnl 55b41a30aaSmrgm4_ifndef([AC_AUTOCONF_VERSION], 56b41a30aaSmrg [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 57b41a30aaSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) 58b41a30aaSmrg 59b41a30aaSmrg# AM_AUX_DIR_EXPAND -*- Autoconf -*- 60b41a30aaSmrg 6110f94802Smrg# Copyright (C) 2001-2024 Free Software Foundation, Inc. 62a253d6aeSmrg# 63b41a30aaSmrg# This file is free software; the Free Software Foundation 64b41a30aaSmrg# gives unlimited permission to copy and/or distribute it, 65b41a30aaSmrg# with or without modifications, as long as this notice is preserved. 66ea133fd7Smrg 67b41a30aaSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 68b41a30aaSmrg# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to 69b41a30aaSmrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'. 70a253d6aeSmrg# 71b41a30aaSmrg# Of course, Automake must honor this variable whenever it calls a 72b41a30aaSmrg# tool from the auxiliary directory. The problem is that $srcdir (and 73b41a30aaSmrg# therefore $ac_aux_dir as well) can be either absolute or relative, 74b41a30aaSmrg# depending on how configure is run. This is pretty annoying, since 75b41a30aaSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top 76b41a30aaSmrg# source directory, any form will work fine, but in subdirectories a 77b41a30aaSmrg# relative path needs to be adjusted first. 78a253d6aeSmrg# 79b41a30aaSmrg# $ac_aux_dir/missing 80b41a30aaSmrg# fails when called from a subdirectory if $ac_aux_dir is relative 81b41a30aaSmrg# $top_srcdir/$ac_aux_dir/missing 82b41a30aaSmrg# fails if $ac_aux_dir is absolute, 83b41a30aaSmrg# fails when called from a subdirectory in a VPATH build with 84b41a30aaSmrg# a relative $ac_aux_dir 85a253d6aeSmrg# 86b41a30aaSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir 87b41a30aaSmrg# are both prefixed by $srcdir. In an in-source build this is usually 88b41a30aaSmrg# harmless because $srcdir is '.', but things will broke when you 89b41a30aaSmrg# start a VPATH build or use an absolute $srcdir. 90a253d6aeSmrg# 91b41a30aaSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 92b41a30aaSmrg# iff we strip the leading $srcdir from $ac_aux_dir. That would be: 93b41a30aaSmrg# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 94b41a30aaSmrg# and then we would define $MISSING as 95b41a30aaSmrg# MISSING="\${SHELL} $am_aux_dir/missing" 96b41a30aaSmrg# This will work as long as MISSING is not called from configure, because 97b41a30aaSmrg# unfortunately $(top_srcdir) has no meaning in configure. 98b41a30aaSmrg# However there are other variables, like CC, which are often used in 99b41a30aaSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir. 100a253d6aeSmrg# 101b41a30aaSmrg# Another solution, used here, is to always expand $ac_aux_dir to an 102b41a30aaSmrg# absolute PATH. The drawback is that using absolute paths prevent a 103b41a30aaSmrg# configured tree to be moved without reconfiguration. 104a253d6aeSmrg 105b41a30aaSmrgAC_DEFUN([AM_AUX_DIR_EXPAND], 106b41a30aaSmrg[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl 107b41a30aaSmrg# Expand $ac_aux_dir to an absolute path. 108b41a30aaSmrgam_aux_dir=`cd "$ac_aux_dir" && pwd` 10931637056Smrg]) 110a253d6aeSmrg 111b41a30aaSmrg# AM_CONDITIONAL -*- Autoconf -*- 112ea133fd7Smrg 11310f94802Smrg# Copyright (C) 1997-2024 Free Software Foundation, Inc. 114b41a30aaSmrg# 115b41a30aaSmrg# This file is free software; the Free Software Foundation 116b41a30aaSmrg# gives unlimited permission to copy and/or distribute it, 117b41a30aaSmrg# with or without modifications, as long as this notice is preserved. 118ea133fd7Smrg 119b41a30aaSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION) 120b41a30aaSmrg# ------------------------------------- 121b41a30aaSmrg# Define a conditional. 122b41a30aaSmrgAC_DEFUN([AM_CONDITIONAL], 123b41a30aaSmrg[AC_PREREQ([2.52])dnl 124b41a30aaSmrg m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 125b41a30aaSmrg [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 126b41a30aaSmrgAC_SUBST([$1_TRUE])dnl 127b41a30aaSmrgAC_SUBST([$1_FALSE])dnl 128b41a30aaSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl 129b41a30aaSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl 130b41a30aaSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl 131b41a30aaSmrgif $2; then 132b41a30aaSmrg $1_TRUE= 133b41a30aaSmrg $1_FALSE='#' 134b41a30aaSmrgelse 135b41a30aaSmrg $1_TRUE='#' 136b41a30aaSmrg $1_FALSE= 137b41a30aaSmrgfi 138b41a30aaSmrgAC_CONFIG_COMMANDS_PRE( 139b41a30aaSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 140b41a30aaSmrg AC_MSG_ERROR([[conditional "$1" was never defined. 141b41a30aaSmrgUsually this means the macro was only invoked conditionally.]]) 142b41a30aaSmrgfi])]) 143ea133fd7Smrg 14410f94802Smrg# Copyright (C) 1999-2024 Free Software Foundation, Inc. 145b41a30aaSmrg# 146b41a30aaSmrg# This file is free software; the Free Software Foundation 147b41a30aaSmrg# gives unlimited permission to copy and/or distribute it, 148b41a30aaSmrg# with or without modifications, as long as this notice is preserved. 149a253d6aeSmrg 150a253d6aeSmrg 151b41a30aaSmrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be 152b41a30aaSmrg# written in clear, in which case automake, when reading aclocal.m4, 153b41a30aaSmrg# will think it sees a *use*, and therefore will trigger all it's 154b41a30aaSmrg# C support machinery. Also note that it means that autoscan, seeing 155b41a30aaSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use... 156a253d6aeSmrg 157a253d6aeSmrg 158b41a30aaSmrg# _AM_DEPENDENCIES(NAME) 159b41a30aaSmrg# ---------------------- 160b41a30aaSmrg# See how the compiler implements dependency checking. 161b41a30aaSmrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". 162b41a30aaSmrg# We try a few techniques and use that to set a single cache variable. 163b41a30aaSmrg# 164b41a30aaSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was 165b41a30aaSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular 166b41a30aaSmrg# dependency, and given that the user is not expected to run this macro, 167b41a30aaSmrg# just rely on AC_PROG_CC. 168b41a30aaSmrgAC_DEFUN([_AM_DEPENDENCIES], 169b41a30aaSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl 170b41a30aaSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl 171b41a30aaSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl 172b41a30aaSmrgAC_REQUIRE([AM_DEP_TRACK])dnl 173a253d6aeSmrg 174b41a30aaSmrgm4_if([$1], [CC], [depcc="$CC" am_compiler_list=], 175b41a30aaSmrg [$1], [CXX], [depcc="$CXX" am_compiler_list=], 176b41a30aaSmrg [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 177b41a30aaSmrg [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], 178b41a30aaSmrg [$1], [UPC], [depcc="$UPC" am_compiler_list=], 179b41a30aaSmrg [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 180b41a30aaSmrg [depcc="$$1" am_compiler_list=]) 181a253d6aeSmrg 182b41a30aaSmrgAC_CACHE_CHECK([dependency style of $depcc], 183b41a30aaSmrg [am_cv_$1_dependencies_compiler_type], 184b41a30aaSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then 185b41a30aaSmrg # We make a subdir and do the tests there. Otherwise we can end up 186b41a30aaSmrg # making bogus files that we don't know about and never remove. For 187b41a30aaSmrg # instance it was reported that on HP-UX the gcc test will end up 188b41a30aaSmrg # making a dummy file named 'D' -- because '-MD' means "put the output 189b41a30aaSmrg # in D". 190b41a30aaSmrg rm -rf conftest.dir 191b41a30aaSmrg mkdir conftest.dir 192b41a30aaSmrg # Copy depcomp to subdir because otherwise we won't find it if we're 193b41a30aaSmrg # using a relative directory. 194b41a30aaSmrg cp "$am_depcomp" conftest.dir 195b41a30aaSmrg cd conftest.dir 196b41a30aaSmrg # We will build objects and dependencies in a subdirectory because 197b41a30aaSmrg # it helps to detect inapplicable dependency modes. For instance 198b41a30aaSmrg # both Tru64's cc and ICC support -MD to output dependencies as a 199b41a30aaSmrg # side effect of compilation, but ICC will put the dependencies in 200b41a30aaSmrg # the current directory while Tru64 will put them in the object 201b41a30aaSmrg # directory. 202b41a30aaSmrg mkdir sub 203a253d6aeSmrg 204b41a30aaSmrg am_cv_$1_dependencies_compiler_type=none 205b41a30aaSmrg if test "$am_compiler_list" = ""; then 206b41a30aaSmrg am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` 207b41a30aaSmrg fi 208b41a30aaSmrg am__universal=false 209b41a30aaSmrg m4_case([$1], [CC], 210b41a30aaSmrg [case " $depcc " in #( 211b41a30aaSmrg *\ -arch\ *\ -arch\ *) am__universal=true ;; 212b41a30aaSmrg esac], 213b41a30aaSmrg [CXX], 214b41a30aaSmrg [case " $depcc " in #( 215b41a30aaSmrg *\ -arch\ *\ -arch\ *) am__universal=true ;; 216b41a30aaSmrg esac]) 217a253d6aeSmrg 218b41a30aaSmrg for depmode in $am_compiler_list; do 219b41a30aaSmrg # Setup a source with many dependencies, because some compilers 220b41a30aaSmrg # like to wrap large dependency lists on column 80 (with \), and 221b41a30aaSmrg # we should not choose a depcomp mode which is confused by this. 222b41a30aaSmrg # 223b41a30aaSmrg # We need to recreate these files for each test, as the compiler may 224b41a30aaSmrg # overwrite some of them when testing with obscure command lines. 225b41a30aaSmrg # This happens at least with the AIX C compiler. 226b41a30aaSmrg : > sub/conftest.c 227b41a30aaSmrg for i in 1 2 3 4 5 6; do 228b41a30aaSmrg echo '#include "conftst'$i'.h"' >> sub/conftest.c 229b41a30aaSmrg # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with 230b41a30aaSmrg # Solaris 10 /bin/sh. 231b41a30aaSmrg echo '/* dummy */' > sub/conftst$i.h 232b41a30aaSmrg done 233b41a30aaSmrg echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 234a253d6aeSmrg 235b41a30aaSmrg # We check with '-c' and '-o' for the sake of the "dashmstdout" 236b41a30aaSmrg # mode. It turns out that the SunPro C++ compiler does not properly 237b41a30aaSmrg # handle '-M -o', and we need to detect this. Also, some Intel 238b41a30aaSmrg # versions had trouble with output in subdirs. 239b41a30aaSmrg am__obj=sub/conftest.${OBJEXT-o} 240b41a30aaSmrg am__minus_obj="-o $am__obj" 241b41a30aaSmrg case $depmode in 242b41a30aaSmrg gcc) 243b41a30aaSmrg # This depmode causes a compiler race in universal mode. 244b41a30aaSmrg test "$am__universal" = false || continue 245b41a30aaSmrg ;; 246b41a30aaSmrg nosideeffect) 247b41a30aaSmrg # After this tag, mechanisms are not by side-effect, so they'll 248b41a30aaSmrg # only be used when explicitly requested. 249b41a30aaSmrg if test "x$enable_dependency_tracking" = xyes; then 250b41a30aaSmrg continue 251b41a30aaSmrg else 252b41a30aaSmrg break 253b41a30aaSmrg fi 254b41a30aaSmrg ;; 255b41a30aaSmrg msvc7 | msvc7msys | msvisualcpp | msvcmsys) 256b41a30aaSmrg # This compiler won't grok '-c -o', but also, the minuso test has 257b41a30aaSmrg # not run yet. These depmodes are late enough in the game, and 258b41a30aaSmrg # so weak that their functioning should not be impacted. 259b41a30aaSmrg am__obj=conftest.${OBJEXT-o} 260b41a30aaSmrg am__minus_obj= 261b41a30aaSmrg ;; 262b41a30aaSmrg none) break ;; 263b41a30aaSmrg esac 264b41a30aaSmrg if depmode=$depmode \ 265b41a30aaSmrg source=sub/conftest.c object=$am__obj \ 266b41a30aaSmrg depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ 267b41a30aaSmrg $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ 268b41a30aaSmrg >/dev/null 2>conftest.err && 269b41a30aaSmrg grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 270b41a30aaSmrg grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && 271b41a30aaSmrg grep $am__obj sub/conftest.Po > /dev/null 2>&1 && 272b41a30aaSmrg ${MAKE-make} -s -f confmf > /dev/null 2>&1; then 273b41a30aaSmrg # icc doesn't choke on unknown options, it will just issue warnings 274b41a30aaSmrg # or remarks (even with -Werror). So we grep stderr for any message 275b41a30aaSmrg # that says an option was ignored or not supported. 27610f94802Smrg # When given -MP, icc 7.0 and 7.1 complain thus: 277b41a30aaSmrg # icc: Command line warning: ignoring option '-M'; no argument required 278b41a30aaSmrg # The diagnosis changed in icc 8.0: 279b41a30aaSmrg # icc: Command line remark: option '-MP' not supported 280b41a30aaSmrg if (grep 'ignoring option' conftest.err || 281b41a30aaSmrg grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else 282b41a30aaSmrg am_cv_$1_dependencies_compiler_type=$depmode 283b41a30aaSmrg break 284b41a30aaSmrg fi 285b41a30aaSmrg fi 286b41a30aaSmrg done 287b41a30aaSmrg 288b41a30aaSmrg cd .. 289b41a30aaSmrg rm -rf conftest.dir 290b41a30aaSmrgelse 291b41a30aaSmrg am_cv_$1_dependencies_compiler_type=none 292b41a30aaSmrgfi 293b41a30aaSmrg]) 294b41a30aaSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) 295b41a30aaSmrgAM_CONDITIONAL([am__fastdep$1], [ 296b41a30aaSmrg test "x$enable_dependency_tracking" != xno \ 297b41a30aaSmrg && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) 298b41a30aaSmrg]) 299a253d6aeSmrg 300ea133fd7Smrg 301b41a30aaSmrg# AM_SET_DEPDIR 302b41a30aaSmrg# ------------- 303b41a30aaSmrg# Choose a directory name for dependency files. 304b41a30aaSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES. 305b41a30aaSmrgAC_DEFUN([AM_SET_DEPDIR], 306b41a30aaSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl 307b41a30aaSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl 308b41a30aaSmrg]) 309ea133fd7Smrg 310ea133fd7Smrg 311b41a30aaSmrg# AM_DEP_TRACK 312b41a30aaSmrg# ------------ 313b41a30aaSmrgAC_DEFUN([AM_DEP_TRACK], 314b41a30aaSmrg[AC_ARG_ENABLE([dependency-tracking], [dnl 315b41a30aaSmrgAS_HELP_STRING( 316b41a30aaSmrg [--enable-dependency-tracking], 317b41a30aaSmrg [do not reject slow dependency extractors]) 318b41a30aaSmrgAS_HELP_STRING( 319b41a30aaSmrg [--disable-dependency-tracking], 320b41a30aaSmrg [speeds up one-time build])]) 321b41a30aaSmrgif test "x$enable_dependency_tracking" != xno; then 322b41a30aaSmrg am_depcomp="$ac_aux_dir/depcomp" 323b41a30aaSmrg AMDEPBACKSLASH='\' 324b41a30aaSmrg am__nodep='_no' 32531637056Smrgfi 326b41a30aaSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) 327b41a30aaSmrgAC_SUBST([AMDEPBACKSLASH])dnl 328b41a30aaSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl 329b41a30aaSmrgAC_SUBST([am__nodep])dnl 330b41a30aaSmrg_AM_SUBST_NOTMAKE([am__nodep])dnl 331a253d6aeSmrg]) 332ea133fd7Smrg 333b41a30aaSmrg# Generate code to set up dependency tracking. -*- Autoconf -*- 334ea133fd7Smrg 33510f94802Smrg# Copyright (C) 1999-2024 Free Software Foundation, Inc. 336b41a30aaSmrg# 337b41a30aaSmrg# This file is free software; the Free Software Foundation 338b41a30aaSmrg# gives unlimited permission to copy and/or distribute it, 339b41a30aaSmrg# with or without modifications, as long as this notice is preserved. 340a253d6aeSmrg 341b41a30aaSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS 342b41a30aaSmrg# ------------------------------ 343b41a30aaSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], 344b41a30aaSmrg[{ 345b41a30aaSmrg # Older Autoconf quotes --file arguments for eval, but not when files 346b41a30aaSmrg # are listed without --file. Let's play safe and only enable the eval 347b41a30aaSmrg # if we detect the quoting. 348b41a30aaSmrg # TODO: see whether this extra hack can be removed once we start 349b41a30aaSmrg # requiring Autoconf 2.70 or later. 350b41a30aaSmrg AS_CASE([$CONFIG_FILES], 351b41a30aaSmrg [*\'*], [eval set x "$CONFIG_FILES"], 352b41a30aaSmrg [*], [set x $CONFIG_FILES]) 353b41a30aaSmrg shift 354b41a30aaSmrg # Used to flag and report bootstrapping failures. 355b41a30aaSmrg am_rc=0 356b41a30aaSmrg for am_mf 357b41a30aaSmrg do 358b41a30aaSmrg # Strip MF so we end up with the name of the file. 359b41a30aaSmrg am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` 360b41a30aaSmrg # Check whether this is an Automake generated Makefile which includes 361b41a30aaSmrg # dependency-tracking related rules and includes. 362b41a30aaSmrg # Grep'ing the whole file directly is not great: AIX grep has a line 363b41a30aaSmrg # limit of 2048, but all sed's we know have understand at least 4000. 364b41a30aaSmrg sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ 365b41a30aaSmrg || continue 366b41a30aaSmrg am_dirpart=`AS_DIRNAME(["$am_mf"])` 367b41a30aaSmrg am_filepart=`AS_BASENAME(["$am_mf"])` 368b41a30aaSmrg AM_RUN_LOG([cd "$am_dirpart" \ 369b41a30aaSmrg && sed -e '/# am--include-marker/d' "$am_filepart" \ 370b41a30aaSmrg | $MAKE -f - am--depfiles]) || am_rc=$? 371b41a30aaSmrg done 372b41a30aaSmrg if test $am_rc -ne 0; then 373b41a30aaSmrg AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments 374b41a30aaSmrg for automatic dependency tracking. If GNU make was not used, consider 375b41a30aaSmrg re-running the configure script with MAKE="gmake" (or whatever is 376b41a30aaSmrg necessary). You can also try re-running configure with the 377b41a30aaSmrg '--disable-dependency-tracking' option to at least be able to build 378b41a30aaSmrg the package (albeit without support for automatic dependency tracking).]) 37925b89263Smrg fi 380b41a30aaSmrg AS_UNSET([am_dirpart]) 381b41a30aaSmrg AS_UNSET([am_filepart]) 382b41a30aaSmrg AS_UNSET([am_mf]) 383b41a30aaSmrg AS_UNSET([am_rc]) 384b41a30aaSmrg rm -f conftest-deps.mk 385b41a30aaSmrg} 386b41a30aaSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS 387a253d6aeSmrg 388a253d6aeSmrg 389b41a30aaSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS 390b41a30aaSmrg# ----------------------------- 391b41a30aaSmrg# This macro should only be invoked once -- use via AC_REQUIRE. 392b41a30aaSmrg# 393b41a30aaSmrg# This code is only required when automatic dependency tracking is enabled. 394b41a30aaSmrg# This creates each '.Po' and '.Plo' makefile fragment that we'll need in 395b41a30aaSmrg# order to bootstrap the dependency handling code. 396b41a30aaSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], 397b41a30aaSmrg[AC_CONFIG_COMMANDS([depfiles], 398b41a30aaSmrg [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], 399b41a30aaSmrg [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) 400a253d6aeSmrg 401b41a30aaSmrg# Do all the work for Automake. -*- Autoconf -*- 402a253d6aeSmrg 40310f94802Smrg# Copyright (C) 1996-2024 Free Software Foundation, Inc. 404b41a30aaSmrg# 405b41a30aaSmrg# This file is free software; the Free Software Foundation 406b41a30aaSmrg# gives unlimited permission to copy and/or distribute it, 407b41a30aaSmrg# with or without modifications, as long as this notice is preserved. 408a253d6aeSmrg 409b41a30aaSmrg# This macro actually does too much. Some checks are only needed if 410b41a30aaSmrg# your package does certain things. But this isn't really a big deal. 411a253d6aeSmrg 412b41a30aaSmrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. 413b41a30aaSmrgm4_define([AC_PROG_CC], 414b41a30aaSmrgm4_defn([AC_PROG_CC]) 415b41a30aaSmrg[_AM_PROG_CC_C_O 416b41a30aaSmrg]) 417a253d6aeSmrg 418b41a30aaSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 419b41a30aaSmrg# AM_INIT_AUTOMAKE([OPTIONS]) 420b41a30aaSmrg# ----------------------------------------------- 421b41a30aaSmrg# The call with PACKAGE and VERSION arguments is the old style 422b41a30aaSmrg# call (pre autoconf-2.50), which is being phased out. PACKAGE 423b41a30aaSmrg# and VERSION should now be passed to AC_INIT and removed from 424b41a30aaSmrg# the call to AM_INIT_AUTOMAKE. 425b41a30aaSmrg# We support both call styles for the transition. After 426b41a30aaSmrg# the next Automake release, Autoconf can make the AC_INIT 427b41a30aaSmrg# arguments mandatory, and then we can depend on a new Autoconf 428b41a30aaSmrg# release and drop the old call support. 429b41a30aaSmrgAC_DEFUN([AM_INIT_AUTOMAKE], 430b41a30aaSmrg[AC_PREREQ([2.65])dnl 431b41a30aaSmrgm4_ifdef([_$0_ALREADY_INIT], 432b41a30aaSmrg [m4_fatal([$0 expanded multiple times 433b41a30aaSmrg]m4_defn([_$0_ALREADY_INIT]))], 434b41a30aaSmrg [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl 435b41a30aaSmrgdnl Autoconf wants to disallow AM_ names. We explicitly allow 436b41a30aaSmrgdnl the ones we care about. 437b41a30aaSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 438b41a30aaSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 439b41a30aaSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl 440b41a30aaSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then 441b41a30aaSmrg # Use -I$(srcdir) only when $(srcdir) != ., so that make's output 442b41a30aaSmrg # is not polluted with repeated "-I." 443b41a30aaSmrg AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl 444b41a30aaSmrg # test to see if srcdir already configured 445b41a30aaSmrg if test -f $srcdir/config.status; then 446b41a30aaSmrg AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 44731637056Smrg fi 448b41a30aaSmrgfi 449a253d6aeSmrg 450b41a30aaSmrg# test whether we have cygpath 451b41a30aaSmrgif test -z "$CYGPATH_W"; then 452b41a30aaSmrg if (cygpath --version) >/dev/null 2>/dev/null; then 453b41a30aaSmrg CYGPATH_W='cygpath -w' 454b41a30aaSmrg else 455b41a30aaSmrg CYGPATH_W=echo 456b41a30aaSmrg fi 457b41a30aaSmrgfi 458b41a30aaSmrgAC_SUBST([CYGPATH_W]) 459a253d6aeSmrg 460b41a30aaSmrg# Define the identity of the package. 461b41a30aaSmrgdnl Distinguish between old-style and new-style calls. 462b41a30aaSmrgm4_ifval([$2], 463b41a30aaSmrg[AC_DIAGNOSE([obsolete], 464b41a30aaSmrg [$0: two- and three-arguments forms are deprecated.]) 465b41a30aaSmrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 466b41a30aaSmrg AC_SUBST([PACKAGE], [$1])dnl 467b41a30aaSmrg AC_SUBST([VERSION], [$2])], 468b41a30aaSmrg[_AM_SET_OPTIONS([$1])dnl 469b41a30aaSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. 470b41a30aaSmrgm4_if( 471b41a30aaSmrg m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), 472b41a30aaSmrg [ok:ok],, 473b41a30aaSmrg [m4_fatal([AC_INIT should be called with package and version arguments])])dnl 474b41a30aaSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl 475b41a30aaSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl 476a253d6aeSmrg 477b41a30aaSmrg_AM_IF_OPTION([no-define],, 478b41a30aaSmrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) 479b41a30aaSmrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl 48025b89263Smrg 481b41a30aaSmrg# Some tools Automake needs. 482b41a30aaSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl 483b41a30aaSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl 484b41a30aaSmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) 485b41a30aaSmrgAM_MISSING_PROG([AUTOCONF], [autoconf]) 486b41a30aaSmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) 487b41a30aaSmrgAM_MISSING_PROG([AUTOHEADER], [autoheader]) 488b41a30aaSmrgAM_MISSING_PROG([MAKEINFO], [makeinfo]) 489b41a30aaSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl 490b41a30aaSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl 491b41a30aaSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl 492b41a30aaSmrg# For better backward compatibility. To be removed once Automake 1.9.x 493b41a30aaSmrg# dies out for good. For more background, see: 494b41a30aaSmrg# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> 495b41a30aaSmrg# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> 496b41a30aaSmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)']) 497b41a30aaSmrg# We need awk for the "check" target (and possibly the TAP driver). The 498b41a30aaSmrg# system "awk" is bad on some platforms. 499b41a30aaSmrgAC_REQUIRE([AC_PROG_AWK])dnl 500b41a30aaSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl 501b41a30aaSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl 502b41a30aaSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], 503b41a30aaSmrg [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], 504b41a30aaSmrg [_AM_PROG_TAR([v7])])]) 505b41a30aaSmrg_AM_IF_OPTION([no-dependencies],, 506b41a30aaSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC], 507b41a30aaSmrg [_AM_DEPENDENCIES([CC])], 508b41a30aaSmrg [m4_define([AC_PROG_CC], 509b41a30aaSmrg m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl 510b41a30aaSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX], 511b41a30aaSmrg [_AM_DEPENDENCIES([CXX])], 512b41a30aaSmrg [m4_define([AC_PROG_CXX], 513b41a30aaSmrg m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl 514b41a30aaSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC], 515b41a30aaSmrg [_AM_DEPENDENCIES([OBJC])], 516b41a30aaSmrg [m4_define([AC_PROG_OBJC], 517b41a30aaSmrg m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl 518b41a30aaSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX], 519b41a30aaSmrg [_AM_DEPENDENCIES([OBJCXX])], 520b41a30aaSmrg [m4_define([AC_PROG_OBJCXX], 521b41a30aaSmrg m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl 52231637056Smrg]) 523b41a30aaSmrg# Variables for tags utilities; see am/tags.am 524b41a30aaSmrgif test -z "$CTAGS"; then 525b41a30aaSmrg CTAGS=ctags 526b41a30aaSmrgfi 527b41a30aaSmrgAC_SUBST([CTAGS]) 528b41a30aaSmrgif test -z "$ETAGS"; then 529b41a30aaSmrg ETAGS=etags 530b41a30aaSmrgfi 531b41a30aaSmrgAC_SUBST([ETAGS]) 532b41a30aaSmrgif test -z "$CSCOPE"; then 533b41a30aaSmrg CSCOPE=cscope 534b41a30aaSmrgfi 535b41a30aaSmrgAC_SUBST([CSCOPE]) 536a253d6aeSmrg 53710f94802SmrgAC_REQUIRE([_AM_SILENT_RULES])dnl 538b41a30aaSmrgdnl The testsuite driver may need to know about EXEEXT, so add the 539b41a30aaSmrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This 540b41a30aaSmrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. 541b41a30aaSmrgAC_CONFIG_COMMANDS_PRE(dnl 542b41a30aaSmrg[m4_provide_if([_AM_COMPILER_EXEEXT], 543b41a30aaSmrg [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl 544ea133fd7Smrg 54510f94802SmrgAC_REQUIRE([_AM_PROG_RM_F]) 54610f94802SmrgAC_REQUIRE([_AM_PROG_XARGS_N]) 54731637056Smrg 548b41a30aaSmrgdnl The trailing newline in this macro's definition is deliberate, for 549b41a30aaSmrgdnl backward compatibility and to allow trailing 'dnl'-style comments 550b41a30aaSmrgdnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. 551b41a30aaSmrg]) 552ea133fd7Smrg 553b41a30aaSmrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not 554b41a30aaSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further 555b41a30aaSmrgdnl mangled by Autoconf and run in a shell conditional statement. 556b41a30aaSmrgm4_define([_AC_COMPILER_EXEEXT], 557b41a30aaSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) 55831637056Smrg 559b41a30aaSmrg# When config.status generates a header, we must update the stamp-h file. 560b41a30aaSmrg# This file resides in the same directory as the config header 561b41a30aaSmrg# that is generated. The stamp files are numbered to have different names. 56231637056Smrg 563b41a30aaSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 564b41a30aaSmrg# loop where config.status creates the headers, so we can generate 565b41a30aaSmrg# our stamp files there. 566b41a30aaSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 567b41a30aaSmrg[# Compute $1's index in $config_headers. 568b41a30aaSmrg_am_arg=$1 569b41a30aaSmrg_am_stamp_count=1 570b41a30aaSmrgfor _am_header in $config_headers :; do 571b41a30aaSmrg case $_am_header in 572b41a30aaSmrg $_am_arg | $_am_arg:* ) 573b41a30aaSmrg break ;; 574b41a30aaSmrg * ) 575b41a30aaSmrg _am_stamp_count=`expr $_am_stamp_count + 1` ;; 576b41a30aaSmrg esac 577b41a30aaSmrgdone 578b41a30aaSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) 579ea133fd7Smrg 58010f94802Smrg# Copyright (C) 2001-2024 Free Software Foundation, Inc. 581b41a30aaSmrg# 582b41a30aaSmrg# This file is free software; the Free Software Foundation 583b41a30aaSmrg# gives unlimited permission to copy and/or distribute it, 584b41a30aaSmrg# with or without modifications, as long as this notice is preserved. 585a253d6aeSmrg 586b41a30aaSmrg# AM_PROG_INSTALL_SH 587b41a30aaSmrg# ------------------ 588b41a30aaSmrg# Define $install_sh. 589b41a30aaSmrgAC_DEFUN([AM_PROG_INSTALL_SH], 590b41a30aaSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 591b41a30aaSmrgif test x"${install_sh+set}" != xset; then 592b41a30aaSmrg case $am_aux_dir in 593b41a30aaSmrg *\ * | *\ *) 594b41a30aaSmrg install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; 595b41a30aaSmrg *) 596b41a30aaSmrg install_sh="\${SHELL} $am_aux_dir/install-sh" 597b41a30aaSmrg esac 598b41a30aaSmrgfi 599b41a30aaSmrgAC_SUBST([install_sh])]) 600ea133fd7Smrg 60110f94802Smrg# Copyright (C) 2003-2024 Free Software Foundation, Inc. 602b41a30aaSmrg# 603b41a30aaSmrg# This file is free software; the Free Software Foundation 604b41a30aaSmrg# gives unlimited permission to copy and/or distribute it, 605b41a30aaSmrg# with or without modifications, as long as this notice is preserved. 606a253d6aeSmrg 607b41a30aaSmrg# Check whether the underlying file-system supports filenames 608b41a30aaSmrg# with a leading dot. For instance MS-DOS doesn't. 609b41a30aaSmrgAC_DEFUN([AM_SET_LEADING_DOT], 610b41a30aaSmrg[rm -rf .tst 2>/dev/null 611b41a30aaSmrgmkdir .tst 2>/dev/null 612b41a30aaSmrgif test -d .tst; then 613b41a30aaSmrg am__leading_dot=. 614b41a30aaSmrgelse 615b41a30aaSmrg am__leading_dot=_ 616b41a30aaSmrgfi 617b41a30aaSmrgrmdir .tst 2>/dev/null 618b41a30aaSmrgAC_SUBST([am__leading_dot])]) 619a253d6aeSmrg 620b41a30aaSmrg# Check to see how 'make' treats includes. -*- Autoconf -*- 621a253d6aeSmrg 62210f94802Smrg# Copyright (C) 2001-2024 Free Software Foundation, Inc. 623b41a30aaSmrg# 624b41a30aaSmrg# This file is free software; the Free Software Foundation 625b41a30aaSmrg# gives unlimited permission to copy and/or distribute it, 626b41a30aaSmrg# with or without modifications, as long as this notice is preserved. 627a253d6aeSmrg 628b41a30aaSmrg# AM_MAKE_INCLUDE() 629b41a30aaSmrg# ----------------- 630b41a30aaSmrg# Check whether make has an 'include' directive that can support all 631b41a30aaSmrg# the idioms we need for our automatic dependency tracking code. 632b41a30aaSmrgAC_DEFUN([AM_MAKE_INCLUDE], 633b41a30aaSmrg[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) 634b41a30aaSmrgcat > confinc.mk << 'END' 635b41a30aaSmrgam__doit: 636b41a30aaSmrg @echo this is the am__doit target >confinc.out 637b41a30aaSmrg.PHONY: am__doit 638b41a30aaSmrgEND 639b41a30aaSmrgam__include="#" 640b41a30aaSmrgam__quote= 641b41a30aaSmrg# BSD make does it like this. 642b41a30aaSmrgecho '.include "confinc.mk" # ignored' > confmf.BSD 643b41a30aaSmrg# Other make implementations (GNU, Solaris 10, AIX) do it like this. 644b41a30aaSmrgecho 'include confinc.mk # ignored' > confmf.GNU 645b41a30aaSmrg_am_result=no 646b41a30aaSmrgfor s in GNU BSD; do 647b41a30aaSmrg AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) 648b41a30aaSmrg AS_CASE([$?:`cat confinc.out 2>/dev/null`], 649b41a30aaSmrg ['0:this is the am__doit target'], 650b41a30aaSmrg [AS_CASE([$s], 651b41a30aaSmrg [BSD], [am__include='.include' am__quote='"'], 652b41a30aaSmrg [am__include='include' am__quote=''])]) 653b41a30aaSmrg if test "$am__include" != "#"; then 654b41a30aaSmrg _am_result="yes ($s style)" 655b41a30aaSmrg break 656b41a30aaSmrg fi 657b41a30aaSmrgdone 658b41a30aaSmrgrm -f confinc.* confmf.* 659b41a30aaSmrgAC_MSG_RESULT([${_am_result}]) 660b41a30aaSmrgAC_SUBST([am__include])]) 661b41a30aaSmrgAC_SUBST([am__quote])]) 662a253d6aeSmrg 663b41a30aaSmrg# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- 664a253d6aeSmrg 66510f94802Smrg# Copyright (C) 1997-2024 Free Software Foundation, Inc. 666b41a30aaSmrg# 667b41a30aaSmrg# This file is free software; the Free Software Foundation 668b41a30aaSmrg# gives unlimited permission to copy and/or distribute it, 669b41a30aaSmrg# with or without modifications, as long as this notice is preserved. 67031637056Smrg 671b41a30aaSmrg# AM_MISSING_PROG(NAME, PROGRAM) 672b41a30aaSmrg# ------------------------------ 673b41a30aaSmrgAC_DEFUN([AM_MISSING_PROG], 674b41a30aaSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN]) 675b41a30aaSmrg$1=${$1-"${am_missing_run}$2"} 676b41a30aaSmrgAC_SUBST($1)]) 67731637056Smrg 678b41a30aaSmrg# AM_MISSING_HAS_RUN 679b41a30aaSmrg# ------------------ 680b41a30aaSmrg# Define MISSING if not defined so far and test if it is modern enough. 681b41a30aaSmrg# If it is, set am_missing_run to use it, otherwise, to nothing. 682b41a30aaSmrgAC_DEFUN([AM_MISSING_HAS_RUN], 683b41a30aaSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 684b41a30aaSmrgAC_REQUIRE_AUX_FILE([missing])dnl 685b41a30aaSmrgif test x"${MISSING+set}" != xset; then 686b41a30aaSmrg MISSING="\${SHELL} '$am_aux_dir/missing'" 687b41a30aaSmrgfi 688b41a30aaSmrg# Use eval to expand $SHELL 689b41a30aaSmrgif eval "$MISSING --is-lightweight"; then 690b41a30aaSmrg am_missing_run="$MISSING " 691b41a30aaSmrgelse 692b41a30aaSmrg am_missing_run= 693b41a30aaSmrg AC_MSG_WARN(['missing' script is too old or missing]) 694b41a30aaSmrgfi 69557ee1794Smrg]) 696ea133fd7Smrg 697b41a30aaSmrg# Helper functions for option handling. -*- Autoconf -*- 698a253d6aeSmrg 69910f94802Smrg# Copyright (C) 2001-2024 Free Software Foundation, Inc. 700b41a30aaSmrg# 701b41a30aaSmrg# This file is free software; the Free Software Foundation 702b41a30aaSmrg# gives unlimited permission to copy and/or distribute it, 703b41a30aaSmrg# with or without modifications, as long as this notice is preserved. 70431637056Smrg 705b41a30aaSmrg# _AM_MANGLE_OPTION(NAME) 706b41a30aaSmrg# ----------------------- 707b41a30aaSmrgAC_DEFUN([_AM_MANGLE_OPTION], 708b41a30aaSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 709a253d6aeSmrg 710b41a30aaSmrg# _AM_SET_OPTION(NAME) 711b41a30aaSmrg# -------------------- 712b41a30aaSmrg# Set option NAME. Presently that only means defining a flag for this option. 713b41a30aaSmrgAC_DEFUN([_AM_SET_OPTION], 714b41a30aaSmrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) 715ea133fd7Smrg 716b41a30aaSmrg# _AM_SET_OPTIONS(OPTIONS) 717b41a30aaSmrg# ------------------------ 718b41a30aaSmrg# OPTIONS is a space-separated list of Automake options. 719b41a30aaSmrgAC_DEFUN([_AM_SET_OPTIONS], 720b41a30aaSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 721a253d6aeSmrg 722b41a30aaSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 723b41a30aaSmrg# ------------------------------------------- 724b41a30aaSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 725b41a30aaSmrgAC_DEFUN([_AM_IF_OPTION], 726b41a30aaSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 727a253d6aeSmrg 72810f94802Smrg# Copyright (C) 1999-2024 Free Software Foundation, Inc. 72931637056Smrg# 730b41a30aaSmrg# This file is free software; the Free Software Foundation 731b41a30aaSmrg# gives unlimited permission to copy and/or distribute it, 732b41a30aaSmrg# with or without modifications, as long as this notice is preserved. 733a253d6aeSmrg 734b41a30aaSmrg# _AM_PROG_CC_C_O 735b41a30aaSmrg# --------------- 736b41a30aaSmrg# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC 737b41a30aaSmrg# to automatically call this. 738b41a30aaSmrgAC_DEFUN([_AM_PROG_CC_C_O], 739b41a30aaSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 740b41a30aaSmrgAC_REQUIRE_AUX_FILE([compile])dnl 741b41a30aaSmrgAC_LANG_PUSH([C])dnl 742b41a30aaSmrgAC_CACHE_CHECK( 743b41a30aaSmrg [whether $CC understands -c and -o together], 744b41a30aaSmrg [am_cv_prog_cc_c_o], 745b41a30aaSmrg [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) 746b41a30aaSmrg # Make sure it works both with $CC and with simple cc. 747b41a30aaSmrg # Following AC_PROG_CC_C_O, we do the test twice because some 748b41a30aaSmrg # compilers refuse to overwrite an existing .o file with -o, 749b41a30aaSmrg # though they will create one. 750b41a30aaSmrg am_cv_prog_cc_c_o=yes 751b41a30aaSmrg for am_i in 1 2; do 752b41a30aaSmrg if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ 753b41a30aaSmrg && test -f conftest2.$ac_objext; then 754b41a30aaSmrg : OK 755b41a30aaSmrg else 756b41a30aaSmrg am_cv_prog_cc_c_o=no 757b41a30aaSmrg break 758b41a30aaSmrg fi 759b41a30aaSmrg done 760b41a30aaSmrg rm -f core conftest* 761b41a30aaSmrg unset am_i]) 762b41a30aaSmrgif test "$am_cv_prog_cc_c_o" != yes; then 763b41a30aaSmrg # Losing compiler, so override with the script. 764b41a30aaSmrg # FIXME: It is wrong to rewrite CC. 765b41a30aaSmrg # But if we don't then we get into trouble of one sort or another. 766b41a30aaSmrg # A longer-term fix would be to have automake use am__CC in this case, 767b41a30aaSmrg # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" 768b41a30aaSmrg CC="$am_aux_dir/compile $CC" 769b41a30aaSmrgfi 770b41a30aaSmrgAC_LANG_POP([C])]) 771a253d6aeSmrg 772b41a30aaSmrg# For backward compatibility. 773b41a30aaSmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) 774a253d6aeSmrg 77510f94802Smrg# Copyright (C) 2022-2024 Free Software Foundation, Inc. 77610f94802Smrg# 77710f94802Smrg# This file is free software; the Free Software Foundation 77810f94802Smrg# gives unlimited permission to copy and/or distribute it, 77910f94802Smrg# with or without modifications, as long as this notice is preserved. 78010f94802Smrg 78110f94802Smrg# _AM_PROG_RM_F 78210f94802Smrg# --------------- 78310f94802Smrg# Check whether 'rm -f' without any arguments works. 78410f94802Smrg# https://bugs.gnu.org/10828 78510f94802SmrgAC_DEFUN([_AM_PROG_RM_F], 78610f94802Smrg[am__rm_f_notfound= 78710f94802SmrgAS_IF([(rm -f && rm -fr && rm -rf) 2>/dev/null], [], [am__rm_f_notfound='""']) 78810f94802SmrgAC_SUBST(am__rm_f_notfound) 78910f94802Smrg]) 79010f94802Smrg 79110f94802Smrg# Copyright (C) 2001-2024 Free Software Foundation, Inc. 79206f32fbeSmrg# 793b41a30aaSmrg# This file is free software; the Free Software Foundation 794b41a30aaSmrg# gives unlimited permission to copy and/or distribute it, 795b41a30aaSmrg# with or without modifications, as long as this notice is preserved. 79657ee1794Smrg 797b41a30aaSmrg# AM_RUN_LOG(COMMAND) 798b41a30aaSmrg# ------------------- 799b41a30aaSmrg# Run COMMAND, save the exit status in ac_status, and log it. 800b41a30aaSmrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) 801b41a30aaSmrgAC_DEFUN([AM_RUN_LOG], 802b41a30aaSmrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD 803b41a30aaSmrg ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD 804b41a30aaSmrg ac_status=$? 805b41a30aaSmrg echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD 806b41a30aaSmrg (exit $ac_status); }]) 807a253d6aeSmrg 808b41a30aaSmrg# Check to make sure that the build environment is sane. -*- Autoconf -*- 809a253d6aeSmrg 81010f94802Smrg# Copyright (C) 1996-2024 Free Software Foundation, Inc. 811b41a30aaSmrg# 812b41a30aaSmrg# This file is free software; the Free Software Foundation 813b41a30aaSmrg# gives unlimited permission to copy and/or distribute it, 814b41a30aaSmrg# with or without modifications, as long as this notice is preserved. 815a253d6aeSmrg 81610f94802Smrg# _AM_SLEEP_FRACTIONAL_SECONDS 81710f94802Smrg# ---------------------------- 81810f94802SmrgAC_DEFUN([_AM_SLEEP_FRACTIONAL_SECONDS], [dnl 81910f94802SmrgAC_CACHE_CHECK([whether sleep supports fractional seconds], 82010f94802Smrg am_cv_sleep_fractional_seconds, [dnl 82110f94802SmrgAS_IF([sleep 0.001 2>/dev/null], [am_cv_sleep_fractional_seconds=yes], 82210f94802Smrg [am_cv_sleep_fractional_seconds=no]) 82310f94802Smrg])]) 82410f94802Smrg 82510f94802Smrg# _AM_FILESYSTEM_TIMESTAMP_RESOLUTION 82610f94802Smrg# ----------------------------------- 82710f94802Smrg# Determine the filesystem's resolution for file modification 82810f94802Smrg# timestamps. The coarsest we know of is FAT, with a resolution 82910f94802Smrg# of only two seconds, even with the most recent "exFAT" extensions. 83010f94802Smrg# The finest (e.g. ext4 with large inodes, XFS, ZFS) is one 83110f94802Smrg# nanosecond, matching clock_gettime. However, it is probably not 83210f94802Smrg# possible to delay execution of a shell script for less than one 83310f94802Smrg# millisecond, due to process creation overhead and scheduling 83410f94802Smrg# granularity, so we don't check for anything finer than that. (See below.) 83510f94802SmrgAC_DEFUN([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION], [dnl 83610f94802SmrgAC_REQUIRE([_AM_SLEEP_FRACTIONAL_SECONDS]) 83710f94802SmrgAC_CACHE_CHECK([filesystem timestamp resolution], 83810f94802Smrg am_cv_filesystem_timestamp_resolution, [dnl 83910f94802Smrg# Default to the worst case. 84010f94802Smrgam_cv_filesystem_timestamp_resolution=2 84110f94802Smrg 84210f94802Smrg# Only try to go finer than 1 sec if sleep can do it. 84310f94802Smrg# Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work, 84410f94802Smrg# - 1 sec is not much of a win compared to 2 sec, and 84510f94802Smrg# - it takes 2 seconds to perform the test whether 1 sec works. 84610f94802Smrg# 84710f94802Smrg# Instead, just use the default 2s on platforms that have 1s resolution, 84810f94802Smrg# accept the extra 1s delay when using $sleep in the Automake tests, in 84910f94802Smrg# exchange for not incurring the 2s delay for running the test for all 85010f94802Smrg# packages. 85110f94802Smrg# 85210f94802Smrgam_try_resolutions= 85310f94802Smrgif test "$am_cv_sleep_fractional_seconds" = yes; then 85410f94802Smrg # Even a millisecond often causes a bunch of false positives, 85510f94802Smrg # so just try a hundredth of a second. The time saved between .001 and 85610f94802Smrg # .01 is not terribly consequential. 85710f94802Smrg am_try_resolutions="0.01 0.1 $am_try_resolutions" 85810f94802Smrgfi 85910f94802Smrg 86010f94802Smrg# In order to catch current-generation FAT out, we must *modify* files 86110f94802Smrg# that already exist; the *creation* timestamp is finer. Use names 86210f94802Smrg# that make ls -t sort them differently when they have equal 86310f94802Smrg# timestamps than when they have distinct timestamps, keeping 86410f94802Smrg# in mind that ls -t prints the *newest* file first. 86510f94802Smrgrm -f conftest.ts? 86610f94802Smrg: > conftest.ts1 86710f94802Smrg: > conftest.ts2 86810f94802Smrg: > conftest.ts3 86910f94802Smrg 87010f94802Smrg# Make sure ls -t actually works. Do 'set' in a subshell so we don't 87110f94802Smrg# clobber the current shell's arguments. (Outer-level square brackets 87210f94802Smrg# are removed by m4; they're present so that m4 does not expand 87310f94802Smrg# <dollar><star>; be careful, easy to get confused.) 87410f94802Smrgif ( 87510f94802Smrg set X `[ls -t conftest.ts[12]]` && 87610f94802Smrg { 87710f94802Smrg test "$[]*" != "X conftest.ts1 conftest.ts2" || 87810f94802Smrg test "$[]*" != "X conftest.ts2 conftest.ts1"; 87910f94802Smrg } 88010f94802Smrg); then :; else 88110f94802Smrg # If neither matched, then we have a broken ls. This can happen 88210f94802Smrg # if, for instance, CONFIG_SHELL is bash and it inherits a 88310f94802Smrg # broken ls alias from the environment. This has actually 88410f94802Smrg # happened. Such a system could not be considered "sane". 88510f94802Smrg _AS_ECHO_UNQUOTED( 88610f94802Smrg ["Bad output from ls -t: \"`[ls -t conftest.ts[12]]`\""], 88710f94802Smrg [AS_MESSAGE_LOG_FD]) 88810f94802Smrg AC_MSG_FAILURE([ls -t produces unexpected output. 88910f94802SmrgMake sure there is not a broken ls alias in your environment.]) 89010f94802Smrgfi 89110f94802Smrg 89210f94802Smrgfor am_try_res in $am_try_resolutions; do 89310f94802Smrg # Any one fine-grained sleep might happen to cross the boundary 89410f94802Smrg # between two values of a coarser actual resolution, but if we do 89510f94802Smrg # two fine-grained sleeps in a row, at least one of them will fall 89610f94802Smrg # entirely within a coarse interval. 89710f94802Smrg echo alpha > conftest.ts1 89810f94802Smrg sleep $am_try_res 89910f94802Smrg echo beta > conftest.ts2 90010f94802Smrg sleep $am_try_res 90110f94802Smrg echo gamma > conftest.ts3 90210f94802Smrg 90310f94802Smrg # We assume that 'ls -t' will make use of high-resolution 90410f94802Smrg # timestamps if the operating system supports them at all. 90510f94802Smrg if (set X `ls -t conftest.ts?` && 90610f94802Smrg test "$[]2" = conftest.ts3 && 90710f94802Smrg test "$[]3" = conftest.ts2 && 90810f94802Smrg test "$[]4" = conftest.ts1); then 90910f94802Smrg # 91010f94802Smrg # Ok, ls -t worked. If we're at a resolution of 1 second, we're done, 91110f94802Smrg # because we don't need to test make. 91210f94802Smrg make_ok=true 91310f94802Smrg if test $am_try_res != 1; then 91410f94802Smrg # But if we've succeeded so far with a subsecond resolution, we 91510f94802Smrg # have one more thing to check: make. It can happen that 91610f94802Smrg # everything else supports the subsecond mtimes, but make doesn't; 91710f94802Smrg # notably on macOS, which ships make 3.81 from 2006 (the last one 91810f94802Smrg # released under GPLv2). https://bugs.gnu.org/68808 91910f94802Smrg # 92010f94802Smrg # We test $MAKE if it is defined in the environment, else "make". 92110f94802Smrg # It might get overridden later, but our hope is that in practice 92210f94802Smrg # it does not matter: it is the system "make" which is (by far) 92310f94802Smrg # the most likely to be broken, whereas if the user overrides it, 92410f94802Smrg # probably they did so with a better, or at least not worse, make. 92510f94802Smrg # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html 92610f94802Smrg # 92710f94802Smrg # Create a Makefile (real tab character here): 92810f94802Smrg rm -f conftest.mk 92910f94802Smrg echo 'conftest.ts1: conftest.ts2' >conftest.mk 93010f94802Smrg echo ' touch conftest.ts2' >>conftest.mk 93110f94802Smrg # 93210f94802Smrg # Now, running 93310f94802Smrg # touch conftest.ts1; touch conftest.ts2; make 93410f94802Smrg # should touch ts1 because ts2 is newer. This could happen by luck, 93510f94802Smrg # but most often, it will fail if make's support is insufficient. So 93610f94802Smrg # test for several consecutive successes. 93710f94802Smrg # 93810f94802Smrg # (We reuse conftest.ts[12] because we still want to modify existing 93910f94802Smrg # files, not create new ones, per above.) 94010f94802Smrg n=0 94110f94802Smrg make=${MAKE-make} 94210f94802Smrg until test $n -eq 3; do 94310f94802Smrg echo one > conftest.ts1 94410f94802Smrg sleep $am_try_res 94510f94802Smrg echo two > conftest.ts2 # ts2 should now be newer than ts1 94610f94802Smrg if $make -f conftest.mk | grep 'up to date' >/dev/null; then 94710f94802Smrg make_ok=false 94810f94802Smrg break # out of $n loop 94910f94802Smrg fi 95010f94802Smrg n=`expr $n + 1` 95110f94802Smrg done 95210f94802Smrg fi 95310f94802Smrg # 95410f94802Smrg if $make_ok; then 95510f94802Smrg # Everything we know to check worked out, so call this resolution good. 95610f94802Smrg am_cv_filesystem_timestamp_resolution=$am_try_res 95710f94802Smrg break # out of $am_try_res loop 95810f94802Smrg fi 95910f94802Smrg # Otherwise, we'll go on to check the next resolution. 96010f94802Smrg fi 96110f94802Smrgdone 96210f94802Smrgrm -f conftest.ts? 96310f94802Smrg# (end _am_filesystem_timestamp_resolution) 96410f94802Smrg])]) 96510f94802Smrg 966b41a30aaSmrg# AM_SANITY_CHECK 967b41a30aaSmrg# --------------- 968b41a30aaSmrgAC_DEFUN([AM_SANITY_CHECK], 96910f94802Smrg[AC_REQUIRE([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION]) 97010f94802Smrg# This check should not be cached, as it may vary across builds of 97110f94802Smrg# different projects. 97210f94802SmrgAC_MSG_CHECKING([whether build environment is sane]) 973b41a30aaSmrg# Reject unsafe characters in $srcdir or the absolute working directory 974b41a30aaSmrg# name. Accept space and tab only in the latter. 975b41a30aaSmrgam_lf=' 976b41a30aaSmrg' 977b41a30aaSmrgcase `pwd` in 978b41a30aaSmrg *[[\\\"\#\$\&\'\`$am_lf]]*) 979b41a30aaSmrg AC_MSG_ERROR([unsafe absolute working directory name]);; 980b41a30aaSmrgesac 981b41a30aaSmrgcase $srcdir in 982b41a30aaSmrg *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) 983b41a30aaSmrg AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; 984b41a30aaSmrgesac 985a253d6aeSmrg 986b41a30aaSmrg# Do 'set' in a subshell so we don't clobber the current shell's 987b41a30aaSmrg# arguments. Must try -L first in case configure is actually a 988b41a30aaSmrg# symlink; some systems play weird games with the mod time of symlinks 989b41a30aaSmrg# (eg FreeBSD returns the mod time of the symlink's containing 990b41a30aaSmrg# directory). 99110f94802Smrgam_build_env_is_sane=no 99210f94802Smrgam_has_slept=no 99310f94802Smrgrm -f conftest.file 99410f94802Smrgfor am_try in 1 2; do 99510f94802Smrg echo "timestamp, slept: $am_has_slept" > conftest.file 99610f94802Smrg if ( 99710f94802Smrg set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` 99810f94802Smrg if test "$[]*" = "X"; then 99910f94802Smrg # -L didn't work. 100010f94802Smrg set X `ls -t "$srcdir/configure" conftest.file` 100110f94802Smrg fi 100210f94802Smrg test "$[]2" = conftest.file 100310f94802Smrg ); then 100410f94802Smrg am_build_env_is_sane=yes 100510f94802Smrg break 100610f94802Smrg fi 100710f94802Smrg # Just in case. 100810f94802Smrg sleep "$am_cv_filesystem_timestamp_resolution" 100910f94802Smrg am_has_slept=yes 101010f94802Smrgdone 101110f94802Smrg 101210f94802SmrgAC_MSG_RESULT([$am_build_env_is_sane]) 101310f94802Smrgif test "$am_build_env_is_sane" = no; then 101410f94802Smrg AC_MSG_ERROR([newly created file is older than distributed files! 1015b41a30aaSmrgCheck your system clock]) 1016b41a30aaSmrgfi 101710f94802Smrg 1018b41a30aaSmrg# If we didn't sleep, we still need to ensure time stamps of config.status and 1019b41a30aaSmrg# generated files are strictly newer. 1020b41a30aaSmrgam_sleep_pid= 102110f94802SmrgAS_IF([test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1],, [dnl 102210f94802Smrg ( sleep "$am_cv_filesystem_timestamp_resolution" ) & 1023b41a30aaSmrg am_sleep_pid=$! 102410f94802Smrg]) 1025b41a30aaSmrgAC_CONFIG_COMMANDS_PRE( 1026b41a30aaSmrg [AC_MSG_CHECKING([that generated files are newer than configure]) 1027b41a30aaSmrg if test -n "$am_sleep_pid"; then 1028b41a30aaSmrg # Hide warnings about reused PIDs. 1029b41a30aaSmrg wait $am_sleep_pid 2>/dev/null 1030b41a30aaSmrg fi 1031b41a30aaSmrg AC_MSG_RESULT([done])]) 1032b41a30aaSmrgrm -f conftest.file 1033b41a30aaSmrg]) 1034a253d6aeSmrg 103510f94802Smrg# Copyright (C) 2009-2024 Free Software Foundation, Inc. 1036b41a30aaSmrg# 1037b41a30aaSmrg# This file is free software; the Free Software Foundation 1038b41a30aaSmrg# gives unlimited permission to copy and/or distribute it, 1039b41a30aaSmrg# with or without modifications, as long as this notice is preserved. 1040a253d6aeSmrg 104110f94802Smrg# _AM_SILENT_RULES 104210f94802Smrg# ---------------- 104310f94802Smrg# Enable less verbose build rules support. 104410f94802SmrgAC_DEFUN([_AM_SILENT_RULES], 104510f94802Smrg[AM_DEFAULT_VERBOSITY=1 104610f94802SmrgAC_ARG_ENABLE([silent-rules], [dnl 1047b41a30aaSmrgAS_HELP_STRING( 1048b41a30aaSmrg [--enable-silent-rules], 1049b41a30aaSmrg [less verbose build output (undo: "make V=1")]) 1050b41a30aaSmrgAS_HELP_STRING( 1051b41a30aaSmrg [--disable-silent-rules], 1052b41a30aaSmrg [verbose build output (undo: "make V=0")])dnl 1053b41a30aaSmrg]) 1054b41a30aaSmrgdnl 1055b41a30aaSmrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep) 1056b41a30aaSmrgdnl do not support nested variable expansions. 1057b41a30aaSmrgdnl See automake bug#9928 and bug#10237. 1058b41a30aaSmrgam_make=${MAKE-make} 1059b41a30aaSmrgAC_CACHE_CHECK([whether $am_make supports nested variables], 1060b41a30aaSmrg [am_cv_make_support_nested_variables], 1061b41a30aaSmrg [if AS_ECHO([['TRUE=$(BAR$(V)) 1062b41a30aaSmrgBAR0=false 1063b41a30aaSmrgBAR1=true 1064b41a30aaSmrgV=1 1065b41a30aaSmrgam__doit: 1066b41a30aaSmrg @$(TRUE) 1067b41a30aaSmrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then 1068b41a30aaSmrg am_cv_make_support_nested_variables=yes 1069b41a30aaSmrgelse 1070b41a30aaSmrg am_cv_make_support_nested_variables=no 1071b41a30aaSmrgfi]) 1072b41a30aaSmrgAC_SUBST([AM_V])dnl 1073b41a30aaSmrgAM_SUBST_NOTMAKE([AM_V])dnl 1074b41a30aaSmrgAC_SUBST([AM_DEFAULT_V])dnl 1075b41a30aaSmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl 1076b41a30aaSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl 1077b41a30aaSmrgAM_BACKSLASH='\' 1078b41a30aaSmrgAC_SUBST([AM_BACKSLASH])dnl 1079b41a30aaSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl 108010f94802Smrgdnl Delay evaluation of AM_DEFAULT_VERBOSITY to the end to allow multiple calls 108110f94802Smrgdnl to AM_SILENT_RULES to change the default value. 108210f94802SmrgAC_CONFIG_COMMANDS_PRE([dnl 108310f94802Smrgcase $enable_silent_rules in @%:@ ((( 108410f94802Smrg yes) AM_DEFAULT_VERBOSITY=0;; 108510f94802Smrg no) AM_DEFAULT_VERBOSITY=1;; 108610f94802Smrgesac 108710f94802Smrgif test $am_cv_make_support_nested_variables = yes; then 108810f94802Smrg dnl Using '$V' instead of '$(V)' breaks IRIX make. 108910f94802Smrg AM_V='$(V)' 109010f94802Smrg AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' 109110f94802Smrgelse 109210f94802Smrg AM_V=$AM_DEFAULT_VERBOSITY 109310f94802Smrg AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY 109410f94802Smrgfi 109510f94802Smrg])dnl 109606f32fbeSmrg]) 1097a253d6aeSmrg 109810f94802Smrg# AM_SILENT_RULES([DEFAULT]) 109910f94802Smrg# -------------------------- 110010f94802Smrg# Set the default verbosity level to DEFAULT ("yes" being less verbose, "no" or 110110f94802Smrg# empty being verbose). 110210f94802SmrgAC_DEFUN([AM_SILENT_RULES], 110310f94802Smrg[AC_REQUIRE([_AM_SILENT_RULES]) 110410f94802SmrgAM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1])]) 110510f94802Smrg 110610f94802Smrg# Copyright (C) 2001-2024 Free Software Foundation, Inc. 1107b41a30aaSmrg# 1108b41a30aaSmrg# This file is free software; the Free Software Foundation 1109b41a30aaSmrg# gives unlimited permission to copy and/or distribute it, 1110b41a30aaSmrg# with or without modifications, as long as this notice is preserved. 1111a253d6aeSmrg 1112b41a30aaSmrg# AM_PROG_INSTALL_STRIP 1113b41a30aaSmrg# --------------------- 1114b41a30aaSmrg# One issue with vendor 'install' (even GNU) is that you can't 1115b41a30aaSmrg# specify the program used to strip binaries. This is especially 1116b41a30aaSmrg# annoying in cross-compiling environments, where the build's strip 1117b41a30aaSmrg# is unlikely to handle the host's binaries. 1118b41a30aaSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we 1119b41a30aaSmrg# always use install-sh in "make install-strip", and initialize 1120b41a30aaSmrg# STRIPPROG with the value of the STRIP variable (set by the user). 1121b41a30aaSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP], 1122b41a30aaSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 1123b41a30aaSmrg# Installed binaries are usually stripped using 'strip' when the user 1124b41a30aaSmrg# run "make install-strip". However 'strip' might not be the right 1125b41a30aaSmrg# tool to use in cross-compilation environments, therefore Automake 1126b41a30aaSmrg# will honor the 'STRIP' environment variable to overrule this program. 1127b41a30aaSmrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'. 1128b41a30aaSmrgif test "$cross_compiling" != no; then 1129b41a30aaSmrg AC_CHECK_TOOL([STRIP], [strip], :) 1130b41a30aaSmrgfi 1131b41a30aaSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" 1132b41a30aaSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])]) 1133a253d6aeSmrg 113410f94802Smrg# Copyright (C) 2006-2024 Free Software Foundation, Inc. 1135b41a30aaSmrg# 1136b41a30aaSmrg# This file is free software; the Free Software Foundation 1137b41a30aaSmrg# gives unlimited permission to copy and/or distribute it, 1138b41a30aaSmrg# with or without modifications, as long as this notice is preserved. 1139a253d6aeSmrg 1140b41a30aaSmrg# _AM_SUBST_NOTMAKE(VARIABLE) 1141b41a30aaSmrg# --------------------------- 1142b41a30aaSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. 1143b41a30aaSmrg# This macro is traced by Automake. 1144b41a30aaSmrgAC_DEFUN([_AM_SUBST_NOTMAKE]) 1145a253d6aeSmrg 1146b41a30aaSmrg# AM_SUBST_NOTMAKE(VARIABLE) 1147b41a30aaSmrg# -------------------------- 1148b41a30aaSmrg# Public sister of _AM_SUBST_NOTMAKE. 1149b41a30aaSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) 1150a253d6aeSmrg 1151b41a30aaSmrg# Check how to create a tarball. -*- Autoconf -*- 1152a253d6aeSmrg 115310f94802Smrg# Copyright (C) 2004-2024 Free Software Foundation, Inc. 1154b41a30aaSmrg# 1155b41a30aaSmrg# This file is free software; the Free Software Foundation 1156b41a30aaSmrg# gives unlimited permission to copy and/or distribute it, 1157b41a30aaSmrg# with or without modifications, as long as this notice is preserved. 1158a253d6aeSmrg 1159b41a30aaSmrg# _AM_PROG_TAR(FORMAT) 1160b41a30aaSmrg# -------------------- 1161b41a30aaSmrg# Check how to create a tarball in format FORMAT. 1162b41a30aaSmrg# FORMAT should be one of 'v7', 'ustar', or 'pax'. 1163b41a30aaSmrg# 1164b41a30aaSmrg# Substitute a variable $(am__tar) that is a command 1165b41a30aaSmrg# writing to stdout a FORMAT-tarball containing the directory 1166b41a30aaSmrg# $tardir. 1167b41a30aaSmrg# tardir=directory && $(am__tar) > result.tar 1168b41a30aaSmrg# 1169b41a30aaSmrg# Substitute a variable $(am__untar) that extract such 1170b41a30aaSmrg# a tarball read from stdin. 1171b41a30aaSmrg# $(am__untar) < result.tar 1172b41a30aaSmrg# 1173b41a30aaSmrgAC_DEFUN([_AM_PROG_TAR], 1174b41a30aaSmrg[# Always define AMTAR for backward compatibility. Yes, it's still used 1175b41a30aaSmrg# in the wild :-( We should find a proper way to deprecate it ... 1176b41a30aaSmrgAC_SUBST([AMTAR], ['$${TAR-tar}']) 1177a253d6aeSmrg 1178b41a30aaSmrg# We'll loop over all known methods to create a tar archive until one works. 1179b41a30aaSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' 1180a253d6aeSmrg 1181b41a30aaSmrgm4_if([$1], [v7], 1182b41a30aaSmrg [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], 1183a253d6aeSmrg 1184b41a30aaSmrg [m4_case([$1], 1185b41a30aaSmrg [ustar], 1186b41a30aaSmrg [# The POSIX 1988 'ustar' format is defined with fixed-size fields. 1187b41a30aaSmrg # There is notably a 21 bits limit for the UID and the GID. In fact, 1188b41a30aaSmrg # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 1189b41a30aaSmrg # and bug#13588). 1190b41a30aaSmrg am_max_uid=2097151 # 2^21 - 1 1191b41a30aaSmrg am_max_gid=$am_max_uid 1192b41a30aaSmrg # The $UID and $GID variables are not portable, so we need to resort 1193b41a30aaSmrg # to the POSIX-mandated id(1) utility. Errors in the 'id' calls 1194b41a30aaSmrg # below are definitely unexpected, so allow the users to see them 1195b41a30aaSmrg # (that is, avoid stderr redirection). 1196b41a30aaSmrg am_uid=`id -u || echo unknown` 1197b41a30aaSmrg am_gid=`id -g || echo unknown` 1198b41a30aaSmrg AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) 119910f94802Smrg if test x$am_uid = xunknown; then 120010f94802Smrg AC_MSG_WARN([ancient id detected; assuming current UID is ok, but dist-ustar might not work]) 120110f94802Smrg elif test $am_uid -le $am_max_uid; then 120210f94802Smrg AC_MSG_RESULT([yes]) 1203b41a30aaSmrg else 120410f94802Smrg AC_MSG_RESULT([no]) 120510f94802Smrg _am_tools=none 1206b41a30aaSmrg fi 1207b41a30aaSmrg AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) 120810f94802Smrg if test x$gm_gid = xunknown; then 120910f94802Smrg AC_MSG_WARN([ancient id detected; assuming current GID is ok, but dist-ustar might not work]) 121010f94802Smrg elif test $am_gid -le $am_max_gid; then 121110f94802Smrg AC_MSG_RESULT([yes]) 1212b41a30aaSmrg else 1213b41a30aaSmrg AC_MSG_RESULT([no]) 1214b41a30aaSmrg _am_tools=none 1215b41a30aaSmrg fi], 1216a253d6aeSmrg 1217b41a30aaSmrg [pax], 1218b41a30aaSmrg [], 1219a253d6aeSmrg 1220b41a30aaSmrg [m4_fatal([Unknown tar format])]) 1221a253d6aeSmrg 1222b41a30aaSmrg AC_MSG_CHECKING([how to create a $1 tar archive]) 122325b89263Smrg 1224b41a30aaSmrg # Go ahead even if we have the value already cached. We do so because we 1225b41a30aaSmrg # need to set the values for the 'am__tar' and 'am__untar' variables. 1226b41a30aaSmrg _am_tools=${am_cv_prog_tar_$1-$_am_tools} 122706f32fbeSmrg 1228b41a30aaSmrg for _am_tool in $_am_tools; do 1229b41a30aaSmrg case $_am_tool in 1230b41a30aaSmrg gnutar) 1231b41a30aaSmrg for _am_tar in tar gnutar gtar; do 1232b41a30aaSmrg AM_RUN_LOG([$_am_tar --version]) && break 1233b41a30aaSmrg done 1234b41a30aaSmrg am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' 1235b41a30aaSmrg am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' 1236b41a30aaSmrg am__untar="$_am_tar -xf -" 1237b41a30aaSmrg ;; 1238b41a30aaSmrg plaintar) 1239b41a30aaSmrg # Must skip GNU tar: if it does not support --format= it doesn't create 1240b41a30aaSmrg # ustar tarball either. 1241b41a30aaSmrg (tar --version) >/dev/null 2>&1 && continue 1242b41a30aaSmrg am__tar='tar chf - "$$tardir"' 1243b41a30aaSmrg am__tar_='tar chf - "$tardir"' 1244b41a30aaSmrg am__untar='tar xf -' 1245b41a30aaSmrg ;; 1246b41a30aaSmrg pax) 1247b41a30aaSmrg am__tar='pax -L -x $1 -w "$$tardir"' 1248b41a30aaSmrg am__tar_='pax -L -x $1 -w "$tardir"' 1249b41a30aaSmrg am__untar='pax -r' 1250b41a30aaSmrg ;; 1251b41a30aaSmrg cpio) 1252b41a30aaSmrg am__tar='find "$$tardir" -print | cpio -o -H $1 -L' 1253b41a30aaSmrg am__tar_='find "$tardir" -print | cpio -o -H $1 -L' 1254b41a30aaSmrg am__untar='cpio -i -H $1 -d' 1255b41a30aaSmrg ;; 1256b41a30aaSmrg none) 1257b41a30aaSmrg am__tar=false 1258b41a30aaSmrg am__tar_=false 1259b41a30aaSmrg am__untar=false 1260b41a30aaSmrg ;; 1261b41a30aaSmrg esac 1262a253d6aeSmrg 1263b41a30aaSmrg # If the value was cached, stop now. We just wanted to have am__tar 1264b41a30aaSmrg # and am__untar set. 1265b41a30aaSmrg test -n "${am_cv_prog_tar_$1}" && break 1266a253d6aeSmrg 1267b41a30aaSmrg # tar/untar a dummy directory, and stop if the command works. 1268b41a30aaSmrg rm -rf conftest.dir 1269b41a30aaSmrg mkdir conftest.dir 1270b41a30aaSmrg echo GrepMe > conftest.dir/file 1271b41a30aaSmrg AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) 1272b41a30aaSmrg rm -rf conftest.dir 1273b41a30aaSmrg if test -s conftest.tar; then 1274b41a30aaSmrg AM_RUN_LOG([$am__untar <conftest.tar]) 1275b41a30aaSmrg AM_RUN_LOG([cat conftest.dir/file]) 1276b41a30aaSmrg grep GrepMe conftest.dir/file >/dev/null 2>&1 && break 1277b41a30aaSmrg fi 1278b41a30aaSmrg done 1279b41a30aaSmrg rm -rf conftest.dir 128025b89263Smrg 1281b41a30aaSmrg AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) 1282b41a30aaSmrg AC_MSG_RESULT([$am_cv_prog_tar_$1])]) 128325b89263Smrg 1284b41a30aaSmrgAC_SUBST([am__tar]) 1285b41a30aaSmrgAC_SUBST([am__untar]) 1286b41a30aaSmrg]) # _AM_PROG_TAR 1287a253d6aeSmrg 128810f94802Smrg# Copyright (C) 2022-2024 Free Software Foundation, Inc. 128910f94802Smrg# 129010f94802Smrg# This file is free software; the Free Software Foundation 129110f94802Smrg# gives unlimited permission to copy and/or distribute it, 129210f94802Smrg# with or without modifications, as long as this notice is preserved. 129310f94802Smrg 129410f94802Smrg# _AM_PROG_XARGS_N 129510f94802Smrg# ---------------- 129610f94802Smrg# Check whether 'xargs -n' works. It should work everywhere, so the fallback 129710f94802Smrg# is not optimized at all as we never expect to use it. 129810f94802SmrgAC_DEFUN([_AM_PROG_XARGS_N], 129910f94802Smrg[AC_CACHE_CHECK([xargs -n works], am_cv_xargs_n_works, [dnl 130010f94802SmrgAS_IF([test "`echo 1 2 3 | xargs -n2 echo`" = "1 2 130110f94802Smrg3"], [am_cv_xargs_n_works=yes], [am_cv_xargs_n_works=no])]) 130210f94802SmrgAS_IF([test "$am_cv_xargs_n_works" = yes], [am__xargs_n='xargs -n'], [dnl 130310f94802Smrg am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "$@" "$am__xargs_n_arg"; done; }' 130410f94802Smrg])dnl 130510f94802SmrgAC_SUBST(am__xargs_n) 130610f94802Smrg]) 130710f94802Smrg 1308b41a30aaSmrgdnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- 1309b41a30aaSmrgdnl serial 11 (pkg-config-0.29) 1310b41a30aaSmrgdnl 1311b41a30aaSmrgdnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>. 1312b41a30aaSmrgdnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com> 1313b41a30aaSmrgdnl 1314b41a30aaSmrgdnl This program is free software; you can redistribute it and/or modify 1315b41a30aaSmrgdnl it under the terms of the GNU General Public License as published by 1316b41a30aaSmrgdnl the Free Software Foundation; either version 2 of the License, or 1317b41a30aaSmrgdnl (at your option) any later version. 1318b41a30aaSmrgdnl 1319b41a30aaSmrgdnl This program is distributed in the hope that it will be useful, but 1320b41a30aaSmrgdnl WITHOUT ANY WARRANTY; without even the implied warranty of 1321b41a30aaSmrgdnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1322b41a30aaSmrgdnl General Public License for more details. 1323b41a30aaSmrgdnl 1324b41a30aaSmrgdnl You should have received a copy of the GNU General Public License 1325b41a30aaSmrgdnl along with this program; if not, write to the Free Software 1326b41a30aaSmrgdnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 1327b41a30aaSmrgdnl 02111-1307, USA. 1328b41a30aaSmrgdnl 1329b41a30aaSmrgdnl As a special exception to the GNU General Public License, if you 1330b41a30aaSmrgdnl distribute this file as part of a program that contains a 1331b41a30aaSmrgdnl configuration script generated by Autoconf, you may include it under 1332b41a30aaSmrgdnl the same distribution terms that you use for the rest of that 1333b41a30aaSmrgdnl program. 1334b41a30aaSmrg 1335b41a30aaSmrgdnl PKG_PREREQ(MIN-VERSION) 1336b41a30aaSmrgdnl ----------------------- 1337b41a30aaSmrgdnl Since: 0.29 1338b41a30aaSmrgdnl 1339b41a30aaSmrgdnl Verify that the version of the pkg-config macros are at least 1340b41a30aaSmrgdnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's 1341b41a30aaSmrgdnl installed version of pkg-config, this checks the developer's version 1342b41a30aaSmrgdnl of pkg.m4 when generating configure. 1343b41a30aaSmrgdnl 1344b41a30aaSmrgdnl To ensure that this macro is defined, also add: 1345b41a30aaSmrgdnl m4_ifndef([PKG_PREREQ], 1346b41a30aaSmrgdnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) 1347b41a30aaSmrgdnl 1348b41a30aaSmrgdnl See the "Since" comment for each macro you use to see what version 1349b41a30aaSmrgdnl of the macros you require. 1350b41a30aaSmrgm4_defun([PKG_PREREQ], 1351b41a30aaSmrg[m4_define([PKG_MACROS_VERSION], [0.29]) 1352b41a30aaSmrgm4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, 1353b41a30aaSmrg [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) 1354b41a30aaSmrg])dnl PKG_PREREQ 1355b41a30aaSmrg 1356b41a30aaSmrgdnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) 1357b41a30aaSmrgdnl ---------------------------------- 1358b41a30aaSmrgdnl Since: 0.16 1359b41a30aaSmrgdnl 1360b41a30aaSmrgdnl Search for the pkg-config tool and set the PKG_CONFIG variable to 1361b41a30aaSmrgdnl first found in the path. Checks that the version of pkg-config found 1362b41a30aaSmrgdnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is 1363b41a30aaSmrgdnl used since that's the first version where most current features of 1364b41a30aaSmrgdnl pkg-config existed. 1365b41a30aaSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG], 1366b41a30aaSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) 1367b41a30aaSmrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) 1368b41a30aaSmrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) 1369b41a30aaSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) 1370b41a30aaSmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) 1371b41a30aaSmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) 137225b89263Smrg 1373b41a30aaSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then 1374b41a30aaSmrg AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) 137531637056Smrgfi 1376b41a30aaSmrgif test -n "$PKG_CONFIG"; then 1377b41a30aaSmrg _pkg_min_version=m4_default([$1], [0.9.0]) 1378b41a30aaSmrg AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) 1379b41a30aaSmrg if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then 1380b41a30aaSmrg AC_MSG_RESULT([yes]) 1381b41a30aaSmrg else 1382b41a30aaSmrg AC_MSG_RESULT([no]) 1383b41a30aaSmrg PKG_CONFIG="" 1384b41a30aaSmrg fi 1385b41a30aaSmrgfi[]dnl 1386b41a30aaSmrg])dnl PKG_PROG_PKG_CONFIG 1387a253d6aeSmrg 1388b41a30aaSmrgdnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 1389b41a30aaSmrgdnl ------------------------------------------------------------------- 1390b41a30aaSmrgdnl Since: 0.18 1391b41a30aaSmrgdnl 1392b41a30aaSmrgdnl Check to see whether a particular set of modules exists. Similar to 1393b41a30aaSmrgdnl PKG_CHECK_MODULES(), but does not set variables or print errors. 1394b41a30aaSmrgdnl 1395b41a30aaSmrgdnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 1396b41a30aaSmrgdnl only at the first occurence in configure.ac, so if the first place 1397b41a30aaSmrgdnl it's called might be skipped (such as if it is within an "if", you 1398b41a30aaSmrgdnl have to call PKG_CHECK_EXISTS manually 1399b41a30aaSmrgAC_DEFUN([PKG_CHECK_EXISTS], 1400b41a30aaSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 1401b41a30aaSmrgif test -n "$PKG_CONFIG" && \ 1402b41a30aaSmrg AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then 1403b41a30aaSmrg m4_default([$2], [:]) 1404b41a30aaSmrgm4_ifvaln([$3], [else 1405b41a30aaSmrg $3])dnl 1406b41a30aaSmrgfi]) 140725b89263Smrg 1408b41a30aaSmrgdnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) 1409b41a30aaSmrgdnl --------------------------------------------- 1410b41a30aaSmrgdnl Internal wrapper calling pkg-config via PKG_CONFIG and setting 1411b41a30aaSmrgdnl pkg_failed based on the result. 1412b41a30aaSmrgm4_define([_PKG_CONFIG], 1413b41a30aaSmrg[if test -n "$$1"; then 1414b41a30aaSmrg pkg_cv_[]$1="$$1" 1415b41a30aaSmrg elif test -n "$PKG_CONFIG"; then 1416b41a30aaSmrg PKG_CHECK_EXISTS([$3], 1417b41a30aaSmrg [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` 1418b41a30aaSmrg test "x$?" != "x0" && pkg_failed=yes ], 1419b41a30aaSmrg [pkg_failed=yes]) 1420b41a30aaSmrg else 1421b41a30aaSmrg pkg_failed=untried 1422b41a30aaSmrgfi[]dnl 1423b41a30aaSmrg])dnl _PKG_CONFIG 1424a253d6aeSmrg 1425b41a30aaSmrgdnl _PKG_SHORT_ERRORS_SUPPORTED 1426b41a30aaSmrgdnl --------------------------- 1427b41a30aaSmrgdnl Internal check to see if pkg-config supports short errors. 1428b41a30aaSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], 1429b41a30aaSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 1430b41a30aaSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then 1431b41a30aaSmrg _pkg_short_errors_supported=yes 1432b41a30aaSmrgelse 1433b41a30aaSmrg _pkg_short_errors_supported=no 1434b41a30aaSmrgfi[]dnl 1435b41a30aaSmrg])dnl _PKG_SHORT_ERRORS_SUPPORTED 1436a253d6aeSmrg 1437a253d6aeSmrg 1438b41a30aaSmrgdnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], 1439b41a30aaSmrgdnl [ACTION-IF-NOT-FOUND]) 1440b41a30aaSmrgdnl -------------------------------------------------------------- 1441b41a30aaSmrgdnl Since: 0.4.0 1442b41a30aaSmrgdnl 1443b41a30aaSmrgdnl Note that if there is a possibility the first call to 1444b41a30aaSmrgdnl PKG_CHECK_MODULES might not happen, you should be sure to include an 1445b41a30aaSmrgdnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac 1446b41a30aaSmrgAC_DEFUN([PKG_CHECK_MODULES], 1447b41a30aaSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 1448b41a30aaSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl 1449b41a30aaSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl 1450a253d6aeSmrg 1451b41a30aaSmrgpkg_failed=no 1452b41a30aaSmrgAC_MSG_CHECKING([for $1]) 145325b89263Smrg 1454b41a30aaSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) 1455b41a30aaSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2]) 1456a253d6aeSmrg 1457b41a30aaSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS 1458b41a30aaSmrgand $1[]_LIBS to avoid the need to call pkg-config. 1459b41a30aaSmrgSee the pkg-config man page for more details.]) 146025b89263Smrg 1461b41a30aaSmrgif test $pkg_failed = yes; then 1462b41a30aaSmrg AC_MSG_RESULT([no]) 1463b41a30aaSmrg _PKG_SHORT_ERRORS_SUPPORTED 1464b41a30aaSmrg if test $_pkg_short_errors_supported = yes; then 1465b41a30aaSmrg $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` 1466b41a30aaSmrg else 1467b41a30aaSmrg $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` 1468b41a30aaSmrg fi 1469b41a30aaSmrg # Put the nasty error message in config.log where it belongs 1470b41a30aaSmrg echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD 1471a253d6aeSmrg 1472b41a30aaSmrg m4_default([$4], [AC_MSG_ERROR( 1473b41a30aaSmrg[Package requirements ($2) were not met: 1474a253d6aeSmrg 1475b41a30aaSmrg$$1_PKG_ERRORS 1476a253d6aeSmrg 1477b41a30aaSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you 1478b41a30aaSmrginstalled software in a non-standard prefix. 1479a253d6aeSmrg 1480b41a30aaSmrg_PKG_TEXT])[]dnl 1481b41a30aaSmrg ]) 1482b41a30aaSmrgelif test $pkg_failed = untried; then 1483b41a30aaSmrg AC_MSG_RESULT([no]) 1484b41a30aaSmrg m4_default([$4], [AC_MSG_FAILURE( 1485b41a30aaSmrg[The pkg-config script could not be found or is too old. Make sure it 1486b41a30aaSmrgis in your PATH or set the PKG_CONFIG environment variable to the full 1487b41a30aaSmrgpath to pkg-config. 1488a253d6aeSmrg 1489b41a30aaSmrg_PKG_TEXT 1490a253d6aeSmrg 1491b41a30aaSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl 1492b41a30aaSmrg ]) 1493b41a30aaSmrgelse 1494b41a30aaSmrg $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS 1495b41a30aaSmrg $1[]_LIBS=$pkg_cv_[]$1[]_LIBS 1496b41a30aaSmrg AC_MSG_RESULT([yes]) 1497b41a30aaSmrg $3 1498b41a30aaSmrgfi[]dnl 1499b41a30aaSmrg])dnl PKG_CHECK_MODULES 1500a253d6aeSmrg 1501a253d6aeSmrg 1502b41a30aaSmrgdnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], 1503b41a30aaSmrgdnl [ACTION-IF-NOT-FOUND]) 1504b41a30aaSmrgdnl --------------------------------------------------------------------- 1505b41a30aaSmrgdnl Since: 0.29 1506b41a30aaSmrgdnl 1507b41a30aaSmrgdnl Checks for existence of MODULES and gathers its build flags with 1508b41a30aaSmrgdnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags 1509b41a30aaSmrgdnl and VARIABLE-PREFIX_LIBS from --libs. 1510b41a30aaSmrgdnl 1511b41a30aaSmrgdnl Note that if there is a possibility the first call to 1512b41a30aaSmrgdnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to 1513b41a30aaSmrgdnl include an explicit call to PKG_PROG_PKG_CONFIG in your 1514b41a30aaSmrgdnl configure.ac. 1515b41a30aaSmrgAC_DEFUN([PKG_CHECK_MODULES_STATIC], 1516b41a30aaSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 1517b41a30aaSmrg_save_PKG_CONFIG=$PKG_CONFIG 1518b41a30aaSmrgPKG_CONFIG="$PKG_CONFIG --static" 1519b41a30aaSmrgPKG_CHECK_MODULES($@) 1520b41a30aaSmrgPKG_CONFIG=$_save_PKG_CONFIG[]dnl 1521b41a30aaSmrg])dnl PKG_CHECK_MODULES_STATIC 1522a253d6aeSmrg 1523a253d6aeSmrg 1524b41a30aaSmrgdnl PKG_INSTALLDIR([DIRECTORY]) 1525b41a30aaSmrgdnl ------------------------- 1526b41a30aaSmrgdnl Since: 0.27 1527b41a30aaSmrgdnl 1528b41a30aaSmrgdnl Substitutes the variable pkgconfigdir as the location where a module 1529b41a30aaSmrgdnl should install pkg-config .pc files. By default the directory is 1530b41a30aaSmrgdnl $libdir/pkgconfig, but the default can be changed by passing 1531b41a30aaSmrgdnl DIRECTORY. The user can override through the --with-pkgconfigdir 1532b41a30aaSmrgdnl parameter. 1533b41a30aaSmrgAC_DEFUN([PKG_INSTALLDIR], 1534b41a30aaSmrg[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) 1535b41a30aaSmrgm4_pushdef([pkg_description], 1536b41a30aaSmrg [pkg-config installation directory @<:@]pkg_default[@:>@]) 1537b41a30aaSmrgAC_ARG_WITH([pkgconfigdir], 1538b41a30aaSmrg [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, 1539b41a30aaSmrg [with_pkgconfigdir=]pkg_default) 1540b41a30aaSmrgAC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) 1541b41a30aaSmrgm4_popdef([pkg_default]) 1542b41a30aaSmrgm4_popdef([pkg_description]) 1543b41a30aaSmrg])dnl PKG_INSTALLDIR 1544b41a30aaSmrg 1545b41a30aaSmrg 1546b41a30aaSmrgdnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) 1547b41a30aaSmrgdnl -------------------------------- 1548b41a30aaSmrgdnl Since: 0.27 1549b41a30aaSmrgdnl 1550b41a30aaSmrgdnl Substitutes the variable noarch_pkgconfigdir as the location where a 1551b41a30aaSmrgdnl module should install arch-independent pkg-config .pc files. By 1552b41a30aaSmrgdnl default the directory is $datadir/pkgconfig, but the default can be 1553b41a30aaSmrgdnl changed by passing DIRECTORY. The user can override through the 1554b41a30aaSmrgdnl --with-noarch-pkgconfigdir parameter. 1555b41a30aaSmrgAC_DEFUN([PKG_NOARCH_INSTALLDIR], 1556b41a30aaSmrg[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) 1557b41a30aaSmrgm4_pushdef([pkg_description], 1558b41a30aaSmrg [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) 1559b41a30aaSmrgAC_ARG_WITH([noarch-pkgconfigdir], 1560b41a30aaSmrg [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, 1561b41a30aaSmrg [with_noarch_pkgconfigdir=]pkg_default) 1562b41a30aaSmrgAC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) 1563b41a30aaSmrgm4_popdef([pkg_default]) 1564b41a30aaSmrgm4_popdef([pkg_description]) 1565b41a30aaSmrg])dnl PKG_NOARCH_INSTALLDIR 1566b41a30aaSmrg 1567b41a30aaSmrg 1568b41a30aaSmrgdnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, 1569b41a30aaSmrgdnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 1570b41a30aaSmrgdnl ------------------------------------------- 1571b41a30aaSmrgdnl Since: 0.28 1572b41a30aaSmrgdnl 1573b41a30aaSmrgdnl Retrieves the value of the pkg-config variable for the given module. 1574b41a30aaSmrgAC_DEFUN([PKG_CHECK_VAR], 1575b41a30aaSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 1576b41a30aaSmrgAC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl 1577a253d6aeSmrg 1578b41a30aaSmrg_PKG_CONFIG([$1], [variable="][$3]["], [$2]) 1579b41a30aaSmrgAS_VAR_COPY([$1], [pkg_cv_][$1]) 1580a253d6aeSmrg 1581b41a30aaSmrgAS_VAR_IF([$1], [""], [$5], [$4])dnl 1582b41a30aaSmrg])dnl PKG_CHECK_VAR 1583a253d6aeSmrg 1584b41a30aaSmrgdnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. 1585b41a30aaSmrgdnl 158610f94802Smrgdnl Copyright (c) 2005, 2023, Oracle and/or its affiliates. 1587b41a30aaSmrgdnl 1588b41a30aaSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a 1589b41a30aaSmrgdnl copy of this software and associated documentation files (the "Software"), 1590b41a30aaSmrgdnl to deal in the Software without restriction, including without limitation 1591b41a30aaSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense, 1592b41a30aaSmrgdnl and/or sell copies of the Software, and to permit persons to whom the 1593b41a30aaSmrgdnl Software is furnished to do so, subject to the following conditions: 1594b41a30aaSmrgdnl 1595b41a30aaSmrgdnl The above copyright notice and this permission notice (including the next 1596b41a30aaSmrgdnl paragraph) shall be included in all copies or substantial portions of the 1597b41a30aaSmrgdnl Software. 1598b41a30aaSmrgdnl 1599b41a30aaSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1600b41a30aaSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1601b41a30aaSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 1602b41a30aaSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 1603b41a30aaSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 1604b41a30aaSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 1605b41a30aaSmrgdnl DEALINGS IN THE SOFTWARE. 1606a253d6aeSmrg 1607b41a30aaSmrg# XORG_MACROS_VERSION(required-version) 1608b41a30aaSmrg# ------------------------------------- 1609b41a30aaSmrg# Minimum version: 1.1.0 1610b41a30aaSmrg# 1611b41a30aaSmrg# If you're using a macro added in Version 1.1 or newer, include this in 1612b41a30aaSmrg# your configure.ac with the minimum required version, such as: 1613b41a30aaSmrg# XORG_MACROS_VERSION(1.1) 1614b41a30aaSmrg# 1615b41a30aaSmrg# To ensure that this macro is defined, also add: 1616b41a30aaSmrg# m4_ifndef([XORG_MACROS_VERSION], 1617b41a30aaSmrg# [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])]) 1618b41a30aaSmrg# 1619b41a30aaSmrg# 1620b41a30aaSmrg# See the "minimum version" comment for each macro you use to see what 1621b41a30aaSmrg# version you require. 1622b41a30aaSmrgm4_defun([XORG_MACROS_VERSION],[ 162310f94802Smrgm4_define([vers_have], [1.20.1]) 1624b41a30aaSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) 1625b41a30aaSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) 1626b41a30aaSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,, 1627b41a30aaSmrg [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])]) 1628b41a30aaSmrgm4_if(m4_version_compare(vers_have, [$1]), -1, 1629b41a30aaSmrg [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])]) 1630b41a30aaSmrgm4_undefine([vers_have]) 1631b41a30aaSmrgm4_undefine([maj_have]) 1632b41a30aaSmrgm4_undefine([maj_needed]) 1633b41a30aaSmrg]) # XORG_MACROS_VERSION 1634a253d6aeSmrg 1635b41a30aaSmrg# XORG_PROG_RAWCPP() 1636b41a30aaSmrg# ------------------ 1637b41a30aaSmrg# Minimum version: 1.0.0 1638b41a30aaSmrg# 1639b41a30aaSmrg# Find cpp program and necessary flags for use in pre-processing text files 1640b41a30aaSmrg# such as man pages and config files 1641b41a30aaSmrgAC_DEFUN([XORG_PROG_RAWCPP],[ 1642b41a30aaSmrgAC_REQUIRE([AC_PROG_CPP]) 1643b41a30aaSmrgAC_PATH_TOOL(RAWCPP, [cpp], [${CPP}], 1644b41a30aaSmrg [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) 1645a253d6aeSmrg 1646b41a30aaSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined, 1647b41a30aaSmrg# which is not the best choice for supporting other OS'es, but covers most 1648b41a30aaSmrg# of the ones we need for now. 1649b41a30aaSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef]) 1650b41a30aaSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])]) 1651b41a30aaSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 1652b41a30aaSmrg AC_MSG_RESULT([no]) 1653b41a30aaSmrgelse 1654b41a30aaSmrg if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 1655b41a30aaSmrg RAWCPPFLAGS=-undef 1656b41a30aaSmrg AC_MSG_RESULT([yes]) 1657b41a30aaSmrg # under Cygwin unix is still defined even with -undef 1658b41a30aaSmrg elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 1659b41a30aaSmrg RAWCPPFLAGS="-undef -ansi" 1660b41a30aaSmrg AC_MSG_RESULT([yes, with -ansi]) 1661b41a30aaSmrg else 1662b41a30aaSmrg AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.]) 1663b41a30aaSmrg fi 1664b41a30aaSmrgfi 1665b41a30aaSmrgrm -f conftest.$ac_ext 1666a253d6aeSmrg 1667b41a30aaSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional]) 1668b41a30aaSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve "whitespace"?]])]) 166910f94802Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve "'` -eq 1 ; then 1670b41a30aaSmrg AC_MSG_RESULT([no]) 1671b41a30aaSmrgelse 167210f94802Smrg if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve "'` -eq 1 ; then 1673b41a30aaSmrg TRADITIONALCPPFLAGS="-traditional" 1674b41a30aaSmrg RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" 1675b41a30aaSmrg AC_MSG_RESULT([yes]) 1676b41a30aaSmrg else 1677b41a30aaSmrg AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) 1678b41a30aaSmrg fi 1679b41a30aaSmrgfi 1680b41a30aaSmrgrm -f conftest.$ac_ext 1681b41a30aaSmrgAC_SUBST(RAWCPPFLAGS) 1682b41a30aaSmrgAC_SUBST(TRADITIONALCPPFLAGS) 1683b41a30aaSmrg]) # XORG_PROG_RAWCPP 1684a253d6aeSmrg 1685b41a30aaSmrg# XORG_MANPAGE_SECTIONS() 1686b41a30aaSmrg# ----------------------- 1687b41a30aaSmrg# Minimum version: 1.0.0 1688b41a30aaSmrg# 1689b41a30aaSmrg# Determine which sections man pages go in for the different man page types 1690b41a30aaSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. 1691b41a30aaSmrg# Not sure if there's any better way than just hardcoding by OS name. 1692b41a30aaSmrg# Override default settings by setting environment variables 1693b41a30aaSmrg# Added MAN_SUBSTS in version 1.8 1694b41a30aaSmrg# Added AC_PROG_SED in version 1.8 169506f32fbeSmrg 1696b41a30aaSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[ 1697b41a30aaSmrgAC_REQUIRE([AC_CANONICAL_HOST]) 1698b41a30aaSmrgAC_REQUIRE([AC_PROG_SED]) 169906f32fbeSmrg 1700b41a30aaSmrgcase $host_os in 1701b41a30aaSmrg solaris*) 1702b41a30aaSmrg # Solaris 2.0 - 11.3 use SysV man page section numbers, so we 1703b41a30aaSmrg # check for a man page file found in later versions that use 1704b41a30aaSmrg # traditional section numbers instead 1705b41a30aaSmrg AC_CHECK_FILE([/usr/share/man/man7/attributes.7], 1706b41a30aaSmrg [SYSV_MAN_SECTIONS=false], [SYSV_MAN_SECTIONS=true]) 1707b41a30aaSmrg ;; 1708b41a30aaSmrg *) SYSV_MAN_SECTIONS=false ;; 1709b41a30aaSmrgesac 1710a253d6aeSmrg 1711b41a30aaSmrgif test x$APP_MAN_SUFFIX = x ; then 1712b41a30aaSmrg APP_MAN_SUFFIX=1 1713b41a30aaSmrgfi 1714b41a30aaSmrgif test x$APP_MAN_DIR = x ; then 1715b41a30aaSmrg APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' 1716b41a30aaSmrgfi 1717a253d6aeSmrg 1718b41a30aaSmrgif test x$LIB_MAN_SUFFIX = x ; then 1719b41a30aaSmrg LIB_MAN_SUFFIX=3 1720b41a30aaSmrgfi 1721b41a30aaSmrgif test x$LIB_MAN_DIR = x ; then 1722b41a30aaSmrg LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' 1723b41a30aaSmrgfi 1724a253d6aeSmrg 1725b41a30aaSmrgif test x$FILE_MAN_SUFFIX = x ; then 1726b41a30aaSmrg case $SYSV_MAN_SECTIONS in 1727b41a30aaSmrg true) FILE_MAN_SUFFIX=4 ;; 1728b41a30aaSmrg *) FILE_MAN_SUFFIX=5 ;; 1729b41a30aaSmrg esac 1730b41a30aaSmrgfi 1731b41a30aaSmrgif test x$FILE_MAN_DIR = x ; then 1732b41a30aaSmrg FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' 1733b41a30aaSmrgfi 1734a253d6aeSmrg 1735b41a30aaSmrgif test x$MISC_MAN_SUFFIX = x ; then 1736b41a30aaSmrg case $SYSV_MAN_SECTIONS in 1737b41a30aaSmrg true) MISC_MAN_SUFFIX=5 ;; 1738b41a30aaSmrg *) MISC_MAN_SUFFIX=7 ;; 1739b41a30aaSmrg esac 1740b41a30aaSmrgfi 1741b41a30aaSmrgif test x$MISC_MAN_DIR = x ; then 1742b41a30aaSmrg MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' 1743b41a30aaSmrgfi 1744a253d6aeSmrg 1745b41a30aaSmrgif test x$DRIVER_MAN_SUFFIX = x ; then 1746b41a30aaSmrg case $SYSV_MAN_SECTIONS in 1747b41a30aaSmrg true) DRIVER_MAN_SUFFIX=7 ;; 1748b41a30aaSmrg *) DRIVER_MAN_SUFFIX=4 ;; 1749b41a30aaSmrg esac 1750b41a30aaSmrgfi 1751b41a30aaSmrgif test x$DRIVER_MAN_DIR = x ; then 1752b41a30aaSmrg DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' 1753b41a30aaSmrgfi 1754a253d6aeSmrg 1755b41a30aaSmrgif test x$ADMIN_MAN_SUFFIX = x ; then 1756b41a30aaSmrg case $SYSV_MAN_SECTIONS in 1757b41a30aaSmrg true) ADMIN_MAN_SUFFIX=1m ;; 1758b41a30aaSmrg *) ADMIN_MAN_SUFFIX=8 ;; 1759b41a30aaSmrg esac 1760b41a30aaSmrgfi 1761b41a30aaSmrgif test x$ADMIN_MAN_DIR = x ; then 1762b41a30aaSmrg ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' 1763b41a30aaSmrgfi 1764a253d6aeSmrg 1765a253d6aeSmrg 1766b41a30aaSmrgAC_SUBST([APP_MAN_SUFFIX]) 1767b41a30aaSmrgAC_SUBST([LIB_MAN_SUFFIX]) 1768b41a30aaSmrgAC_SUBST([FILE_MAN_SUFFIX]) 1769b41a30aaSmrgAC_SUBST([MISC_MAN_SUFFIX]) 1770b41a30aaSmrgAC_SUBST([DRIVER_MAN_SUFFIX]) 1771b41a30aaSmrgAC_SUBST([ADMIN_MAN_SUFFIX]) 1772b41a30aaSmrgAC_SUBST([APP_MAN_DIR]) 1773b41a30aaSmrgAC_SUBST([LIB_MAN_DIR]) 1774b41a30aaSmrgAC_SUBST([FILE_MAN_DIR]) 1775b41a30aaSmrgAC_SUBST([MISC_MAN_DIR]) 1776b41a30aaSmrgAC_SUBST([DRIVER_MAN_DIR]) 1777b41a30aaSmrgAC_SUBST([ADMIN_MAN_DIR]) 1778a253d6aeSmrg 1779b41a30aaSmrgXORG_MAN_PAGE="X Version 11" 1780b41a30aaSmrgAC_SUBST([XORG_MAN_PAGE]) 1781b41a30aaSmrgMAN_SUBSTS="\ 1782b41a30aaSmrg -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ 1783b41a30aaSmrg -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ 1784b41a30aaSmrg -e 's|__xservername__|Xorg|g' \ 1785b41a30aaSmrg -e 's|__xconfigfile__|xorg.conf|g' \ 1786b41a30aaSmrg -e 's|__projectroot__|\$(prefix)|g' \ 1787b41a30aaSmrg -e 's|__apploaddir__|\$(appdefaultdir)|g' \ 1788b41a30aaSmrg -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \ 1789b41a30aaSmrg -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \ 1790b41a30aaSmrg -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \ 1791b41a30aaSmrg -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \ 1792b41a30aaSmrg -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \ 1793b41a30aaSmrg -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'" 1794b41a30aaSmrgAC_SUBST([MAN_SUBSTS]) 1795a253d6aeSmrg 1796b41a30aaSmrg]) # XORG_MANPAGE_SECTIONS 1797a253d6aeSmrg 1798b41a30aaSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION]) 1799b41a30aaSmrg# ------------------------ 1800b41a30aaSmrg# Minimum version: 1.7.0 1801b41a30aaSmrg# 1802b41a30aaSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent 1803b41a30aaSmrg# provided by xorg-sgml-doctools, if installed. 1804b41a30aaSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[ 1805b41a30aaSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])]) 1806b41a30aaSmrgXORG_SGML_PATH= 1807b41a30aaSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])], 1808b41a30aaSmrg [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`], 1809b41a30aaSmrg [m4_ifval([$1],[:], 1810b41a30aaSmrg [if test x"$cross_compiling" != x"yes" ; then 1811b41a30aaSmrg AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent], 1812b41a30aaSmrg [XORG_SGML_PATH=$prefix/share/sgml]) 1813b41a30aaSmrg fi]) 1814b41a30aaSmrg ]) 1815b41a30aaSmrg 1816b41a30aaSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing 1817b41a30aaSmrg# the path and the name of the doc stylesheet 1818b41a30aaSmrgif test "x$XORG_SGML_PATH" != "x" ; then 1819b41a30aaSmrg AC_MSG_RESULT([$XORG_SGML_PATH]) 1820b41a30aaSmrg STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11 1821b41a30aaSmrg XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl 182231637056Smrgelse 1823b41a30aaSmrg AC_MSG_RESULT([no]) 182431637056Smrgfi 1825ea133fd7Smrg 1826b41a30aaSmrgAC_SUBST(XORG_SGML_PATH) 1827b41a30aaSmrgAC_SUBST(STYLESHEET_SRCDIR) 1828b41a30aaSmrgAC_SUBST(XSL_STYLESHEET) 1829b41a30aaSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"]) 1830b41a30aaSmrg]) # XORG_CHECK_SGML_DOCTOOLS 1831a253d6aeSmrg 1832b41a30aaSmrg# XORG_CHECK_LINUXDOC 183331637056Smrg# ------------------- 1834b41a30aaSmrg# Minimum version: 1.0.0 1835b41a30aaSmrg# 1836b41a30aaSmrg# Defines the variable MAKE_TEXT if the necessary tools and 1837b41a30aaSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. 1838b41a30aaSmrg# Whether or not the necessary tools and files are found can be checked 1839b41a30aaSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC" 1840b41a30aaSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[ 1841b41a30aaSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) 1842b41a30aaSmrgAC_REQUIRE([XORG_WITH_PS2PDF]) 1843a253d6aeSmrg 1844b41a30aaSmrgAC_PATH_PROG(LINUXDOC, linuxdoc) 1845a253d6aeSmrg 1846b41a30aaSmrgAC_MSG_CHECKING([whether to build documentation]) 1847ea133fd7Smrg 1848b41a30aaSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then 1849b41a30aaSmrg BUILDDOC=yes 185031637056Smrgelse 1851b41a30aaSmrg BUILDDOC=no 185231637056Smrgfi 1853ea133fd7Smrg 1854b41a30aaSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) 1855ea133fd7Smrg 1856b41a30aaSmrgAC_MSG_RESULT([$BUILDDOC]) 1857ea133fd7Smrg 1858b41a30aaSmrgAC_MSG_CHECKING([whether to build pdf documentation]) 1859a253d6aeSmrg 1860b41a30aaSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then 1861b41a30aaSmrg BUILDPDFDOC=yes 1862b41a30aaSmrgelse 1863b41a30aaSmrg BUILDPDFDOC=no 1864b41a30aaSmrgfi 1865a253d6aeSmrg 1866b41a30aaSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 186725b89263Smrg 1868b41a30aaSmrgAC_MSG_RESULT([$BUILDPDFDOC]) 186925b89263Smrg 1870b41a30aaSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f" 1871b41a30aaSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps" 1872b41a30aaSmrgMAKE_PDF="$PS2PDF" 1873b41a30aaSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0" 187425b89263Smrg 1875b41a30aaSmrgAC_SUBST(MAKE_TEXT) 1876b41a30aaSmrgAC_SUBST(MAKE_PS) 1877b41a30aaSmrgAC_SUBST(MAKE_PDF) 1878b41a30aaSmrgAC_SUBST(MAKE_HTML) 1879b41a30aaSmrg]) # XORG_CHECK_LINUXDOC 188025b89263Smrg 1881b41a30aaSmrg# XORG_CHECK_DOCBOOK 1882b41a30aaSmrg# ------------------- 1883b41a30aaSmrg# Minimum version: 1.0.0 1884b41a30aaSmrg# 1885b41a30aaSmrg# Checks for the ability to build output formats from SGML DocBook source. 1886b41a30aaSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC" 1887b41a30aaSmrg# indicates whether the necessary tools and files are found and, if set, 1888b41a30aaSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx. 1889b41a30aaSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[ 1890b41a30aaSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) 189131637056Smrg 1892b41a30aaSmrgBUILDTXTDOC=no 1893b41a30aaSmrgBUILDPDFDOC=no 1894b41a30aaSmrgBUILDPSDOC=no 1895b41a30aaSmrgBUILDHTMLDOC=no 1896ea133fd7Smrg 1897b41a30aaSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps) 1898b41a30aaSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf) 1899b41a30aaSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html) 1900b41a30aaSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt) 1901a253d6aeSmrg 1902b41a30aaSmrgAC_MSG_CHECKING([whether to build text documentation]) 1903b41a30aaSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x && 1904b41a30aaSmrg test x$BUILD_TXTDOC != xno; then 1905b41a30aaSmrg BUILDTXTDOC=yes 1906b41a30aaSmrgfi 1907b41a30aaSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes]) 1908b41a30aaSmrgAC_MSG_RESULT([$BUILDTXTDOC]) 1909a253d6aeSmrg 1910b41a30aaSmrgAC_MSG_CHECKING([whether to build PDF documentation]) 1911b41a30aaSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x && 1912b41a30aaSmrg test x$BUILD_PDFDOC != xno; then 1913b41a30aaSmrg BUILDPDFDOC=yes 191431637056Smrgfi 1915b41a30aaSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 1916b41a30aaSmrgAC_MSG_RESULT([$BUILDPDFDOC]) 1917a253d6aeSmrg 1918b41a30aaSmrgAC_MSG_CHECKING([whether to build PostScript documentation]) 1919b41a30aaSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x && 1920b41a30aaSmrg test x$BUILD_PSDOC != xno; then 1921b41a30aaSmrg BUILDPSDOC=yes 1922b41a30aaSmrgfi 1923b41a30aaSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes]) 1924b41a30aaSmrgAC_MSG_RESULT([$BUILDPSDOC]) 1925a253d6aeSmrg 1926b41a30aaSmrgAC_MSG_CHECKING([whether to build HTML documentation]) 1927b41a30aaSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x && 1928b41a30aaSmrg test x$BUILD_HTMLDOC != xno; then 1929b41a30aaSmrg BUILDHTMLDOC=yes 1930b41a30aaSmrgfi 1931b41a30aaSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes]) 1932b41a30aaSmrgAC_MSG_RESULT([$BUILDHTMLDOC]) 1933a253d6aeSmrg 1934b41a30aaSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT" 1935b41a30aaSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS" 1936b41a30aaSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF" 1937b41a30aaSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML" 1938a253d6aeSmrg 1939b41a30aaSmrgAC_SUBST(MAKE_TEXT) 1940b41a30aaSmrgAC_SUBST(MAKE_PS) 1941b41a30aaSmrgAC_SUBST(MAKE_PDF) 1942b41a30aaSmrgAC_SUBST(MAKE_HTML) 1943b41a30aaSmrg]) # XORG_CHECK_DOCBOOK 1944a253d6aeSmrg 1945b41a30aaSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT]) 1946b41a30aaSmrg# ---------------- 1947b41a30aaSmrg# Minimum version: 1.5.0 1948b41a30aaSmrg# Minimum version for optional DEFAULT argument: 1.11.0 1949b41a30aaSmrg# 1950b41a30aaSmrg# Documentation tools are not always available on all platforms and sometimes 1951b41a30aaSmrg# not at the appropriate level. This macro enables a module to test for the 1952b41a30aaSmrg# presence of the tool and obtain it's path in separate variables. Coupled with 195310f94802Smrg# the --with-xmlto option, it allows maximum flexibility in making decisions 1954b41a30aaSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified, 1955b41a30aaSmrg# --with-xmlto assumes 'auto'. 1956b41a30aaSmrg# 1957b41a30aaSmrg# Interface to module: 1958b41a30aaSmrg# HAVE_XMLTO: used in makefiles to conditionally generate documentation 1959b41a30aaSmrg# XMLTO: returns the path of the xmlto program found 1960b41a30aaSmrg# returns the path set by the user in the environment 1961b41a30aaSmrg# --with-xmlto: 'yes' user instructs the module to use xmlto 1962b41a30aaSmrg# 'no' user instructs the module not to use xmlto 1963b41a30aaSmrg# 1964b41a30aaSmrg# Added in version 1.10.0 1965b41a30aaSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation 1966b41a30aaSmrg# xmlto for text output requires either lynx, links, or w3m browsers 1967b41a30aaSmrg# 1968b41a30aaSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path. 1969b41a30aaSmrg# 1970b41a30aaSmrgAC_DEFUN([XORG_WITH_XMLTO],[ 1971b41a30aaSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command]) 1972b41a30aaSmrgm4_define([_defopt], m4_default([$2], [auto])) 1973b41a30aaSmrgAC_ARG_WITH(xmlto, 1974b41a30aaSmrg AS_HELP_STRING([--with-xmlto], 1975b41a30aaSmrg [Use xmlto to regenerate documentation (default: ]_defopt[)]), 1976b41a30aaSmrg [use_xmlto=$withval], [use_xmlto=]_defopt) 1977b41a30aaSmrgm4_undefine([_defopt]) 1978a253d6aeSmrg 1979b41a30aaSmrgif test "x$use_xmlto" = x"auto"; then 1980b41a30aaSmrg AC_PATH_PROG([XMLTO], [xmlto]) 1981b41a30aaSmrg if test "x$XMLTO" = "x"; then 1982b41a30aaSmrg AC_MSG_WARN([xmlto not found - documentation targets will be skipped]) 1983b41a30aaSmrg have_xmlto=no 1984b41a30aaSmrg else 1985b41a30aaSmrg have_xmlto=yes 1986b41a30aaSmrg fi 1987b41a30aaSmrgelif test "x$use_xmlto" = x"yes" ; then 1988b41a30aaSmrg AC_PATH_PROG([XMLTO], [xmlto]) 1989b41a30aaSmrg if test "x$XMLTO" = "x"; then 1990b41a30aaSmrg AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH]) 1991b41a30aaSmrg fi 1992b41a30aaSmrg have_xmlto=yes 1993b41a30aaSmrgelif test "x$use_xmlto" = x"no" ; then 1994b41a30aaSmrg if test "x$XMLTO" != "x"; then 1995b41a30aaSmrg AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified]) 1996b41a30aaSmrg fi 1997b41a30aaSmrg have_xmlto=no 1998b41a30aaSmrgelse 1999b41a30aaSmrg AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no']) 200006f32fbeSmrgfi 2001a253d6aeSmrg 2002b41a30aaSmrg# Test for a minimum version of xmlto, if provided. 2003b41a30aaSmrgm4_ifval([$1], 2004b41a30aaSmrg[if test "$have_xmlto" = yes; then 2005b41a30aaSmrg # scrape the xmlto version 2006b41a30aaSmrg AC_MSG_CHECKING([the xmlto version]) 2007b41a30aaSmrg xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3` 2008b41a30aaSmrg AC_MSG_RESULT([$xmlto_version]) 2009b41a30aaSmrg AS_VERSION_COMPARE([$xmlto_version], [$1], 2010b41a30aaSmrg [if test "x$use_xmlto" = xauto; then 2011b41a30aaSmrg AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed]) 2012b41a30aaSmrg have_xmlto=no 2013b41a30aaSmrg else 2014b41a30aaSmrg AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed]) 2015b41a30aaSmrg fi]) 2016b41a30aaSmrgfi]) 2017a253d6aeSmrg 2018b41a30aaSmrg# Test for the ability of xmlto to generate a text target 2019b41a30aaSmrg# 2020b41a30aaSmrg# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the 2021b41a30aaSmrg# following test for empty XML docbook files. 2022b41a30aaSmrg# For compatibility reasons use the following empty XML docbook file and if 2023b41a30aaSmrg# it fails try it again with a non-empty XML file. 2024b41a30aaSmrghave_xmlto_text=no 2025b41a30aaSmrgcat > conftest.xml << "EOF" 2026b41a30aaSmrgEOF 2027b41a30aaSmrgAS_IF([test "$have_xmlto" = yes], 2028b41a30aaSmrg [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1], 2029b41a30aaSmrg [have_xmlto_text=yes], 2030b41a30aaSmrg [# Try it again with a non-empty XML file. 2031b41a30aaSmrg cat > conftest.xml << "EOF" 2032b41a30aaSmrg<x></x> 2033b41a30aaSmrgEOF 2034b41a30aaSmrg AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1], 2035b41a30aaSmrg [have_xmlto_text=yes], 2036b41a30aaSmrg [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])]) 2037b41a30aaSmrgrm -f conftest.xml 2038b41a30aaSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes]) 2039b41a30aaSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes]) 2040b41a30aaSmrg]) # XORG_WITH_XMLTO 2041a253d6aeSmrg 2042b41a30aaSmrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT]) 2043b41a30aaSmrg# -------------------------------------------- 2044b41a30aaSmrg# Minimum version: 1.12.0 2045b41a30aaSmrg# Minimum version for optional DEFAULT argument: 1.12.0 2046b41a30aaSmrg# 2047b41a30aaSmrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative, 2048b41a30aaSmrg# XML-based language used for the transformation of XML documents. 2049b41a30aaSmrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents. 2050b41a30aaSmrg# It is used under the cover by xmlto to generate html files from DocBook/XML. 2051b41a30aaSmrg# The XSLT processor is often used as a standalone tool for transformations. 2052b41a30aaSmrg# It should not be assumed that this tool is used only to work with documnetation. 2053b41a30aaSmrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'. 2054b41a30aaSmrg# 2055b41a30aaSmrg# Interface to module: 2056b41a30aaSmrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation 2057b41a30aaSmrg# XSLTPROC: returns the path of the xsltproc program found 2058b41a30aaSmrg# returns the path set by the user in the environment 2059b41a30aaSmrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc 2060b41a30aaSmrg# 'no' user instructs the module not to use xsltproc 2061b41a30aaSmrg# have_xsltproc: returns yes if xsltproc found in PATH or no 2062b41a30aaSmrg# 2063b41a30aaSmrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path. 2064b41a30aaSmrg# 2065b41a30aaSmrgAC_DEFUN([XORG_WITH_XSLTPROC],[ 2066b41a30aaSmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command]) 2067b41a30aaSmrg# Preserves the interface, should it be implemented later 2068b41a30aaSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])]) 2069b41a30aaSmrgm4_define([_defopt], m4_default([$2], [auto])) 2070b41a30aaSmrgAC_ARG_WITH(xsltproc, 2071b41a30aaSmrg AS_HELP_STRING([--with-xsltproc], 2072b41a30aaSmrg [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]), 2073b41a30aaSmrg [use_xsltproc=$withval], [use_xsltproc=]_defopt) 2074b41a30aaSmrgm4_undefine([_defopt]) 2075b41a30aaSmrg 2076b41a30aaSmrgif test "x$use_xsltproc" = x"auto"; then 2077b41a30aaSmrg AC_PATH_PROG([XSLTPROC], [xsltproc]) 2078b41a30aaSmrg if test "x$XSLTPROC" = "x"; then 2079b41a30aaSmrg AC_MSG_WARN([xsltproc not found - cannot transform XML documents]) 2080b41a30aaSmrg have_xsltproc=no 2081b41a30aaSmrg else 2082b41a30aaSmrg have_xsltproc=yes 2083b41a30aaSmrg fi 2084b41a30aaSmrgelif test "x$use_xsltproc" = x"yes" ; then 2085b41a30aaSmrg AC_PATH_PROG([XSLTPROC], [xsltproc]) 2086b41a30aaSmrg if test "x$XSLTPROC" = "x"; then 2087b41a30aaSmrg AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH]) 2088b41a30aaSmrg fi 2089b41a30aaSmrg have_xsltproc=yes 2090b41a30aaSmrgelif test "x$use_xsltproc" = x"no" ; then 2091b41a30aaSmrg if test "x$XSLTPROC" != "x"; then 2092b41a30aaSmrg AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified]) 2093b41a30aaSmrg fi 2094b41a30aaSmrg have_xsltproc=no 209531637056Smrgelse 2096b41a30aaSmrg AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no']) 209706f32fbeSmrgfi 2098a253d6aeSmrg 2099b41a30aaSmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes]) 2100b41a30aaSmrg]) # XORG_WITH_XSLTPROC 2101a253d6aeSmrg 2102b41a30aaSmrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT]) 2103b41a30aaSmrg# ---------------------------------------- 2104b41a30aaSmrg# Minimum version: 1.15.0 2105b41a30aaSmrg# 2106b41a30aaSmrg# PERL (Practical Extraction and Report Language) is a language optimized for 2107b41a30aaSmrg# scanning arbitrary text files, extracting information from those text files, 2108b41a30aaSmrg# and printing reports based on that information. 2109b41a30aaSmrg# 2110b41a30aaSmrg# When DEFAULT is not specified, --with-perl assumes 'auto'. 2111b41a30aaSmrg# 2112b41a30aaSmrg# Interface to module: 2113b41a30aaSmrg# HAVE_PERL: used in makefiles to conditionally scan text files 2114b41a30aaSmrg# PERL: returns the path of the perl program found 2115b41a30aaSmrg# returns the path set by the user in the environment 2116b41a30aaSmrg# --with-perl: 'yes' user instructs the module to use perl 2117b41a30aaSmrg# 'no' user instructs the module not to use perl 2118b41a30aaSmrg# have_perl: returns yes if perl found in PATH or no 2119b41a30aaSmrg# 2120b41a30aaSmrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path. 2121b41a30aaSmrg# 2122b41a30aaSmrgAC_DEFUN([XORG_WITH_PERL],[ 2123b41a30aaSmrgAC_ARG_VAR([PERL], [Path to perl command]) 2124b41a30aaSmrg# Preserves the interface, should it be implemented later 2125b41a30aaSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])]) 2126b41a30aaSmrgm4_define([_defopt], m4_default([$2], [auto])) 2127b41a30aaSmrgAC_ARG_WITH(perl, 2128b41a30aaSmrg AS_HELP_STRING([--with-perl], 2129b41a30aaSmrg [Use perl for extracting information from files (default: ]_defopt[)]), 2130b41a30aaSmrg [use_perl=$withval], [use_perl=]_defopt) 2131b41a30aaSmrgm4_undefine([_defopt]) 2132a253d6aeSmrg 2133b41a30aaSmrgif test "x$use_perl" = x"auto"; then 2134b41a30aaSmrg AC_PATH_PROG([PERL], [perl]) 2135b41a30aaSmrg if test "x$PERL" = "x"; then 2136b41a30aaSmrg AC_MSG_WARN([perl not found - cannot extract information and report]) 2137b41a30aaSmrg have_perl=no 2138b41a30aaSmrg else 2139b41a30aaSmrg have_perl=yes 214031637056Smrg fi 2141b41a30aaSmrgelif test "x$use_perl" = x"yes" ; then 2142b41a30aaSmrg AC_PATH_PROG([PERL], [perl]) 2143b41a30aaSmrg if test "x$PERL" = "x"; then 2144b41a30aaSmrg AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH]) 2145b41a30aaSmrg fi 2146b41a30aaSmrg have_perl=yes 2147b41a30aaSmrgelif test "x$use_perl" = x"no" ; then 2148b41a30aaSmrg if test "x$PERL" != "x"; then 2149b41a30aaSmrg AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified]) 2150b41a30aaSmrg fi 2151b41a30aaSmrg have_perl=no 215231637056Smrgelse 2153b41a30aaSmrg AC_MSG_ERROR([--with-perl expects 'yes' or 'no']) 215431637056Smrgfi 2155ea133fd7Smrg 2156b41a30aaSmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes]) 2157b41a30aaSmrg]) # XORG_WITH_PERL 2158ea133fd7Smrg 2159b41a30aaSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT]) 2160b41a30aaSmrg# ---------------- 2161b41a30aaSmrg# Minimum version: 1.5.0 2162b41a30aaSmrg# Minimum version for optional DEFAULT argument: 1.11.0 2163b41a30aaSmrg# 2164b41a30aaSmrg# Documentation tools are not always available on all platforms and sometimes 2165b41a30aaSmrg# not at the appropriate level. This macro enables a module to test for the 2166b41a30aaSmrg# presence of the tool and obtain it's path in separate variables. Coupled with 216710f94802Smrg# the --with-asciidoc option, it allows maximum flexibility in making decisions 2168b41a30aaSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified, 2169b41a30aaSmrg# --with-asciidoc assumes 'auto'. 2170b41a30aaSmrg# 2171b41a30aaSmrg# Interface to module: 2172b41a30aaSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation 2173b41a30aaSmrg# ASCIIDOC: returns the path of the asciidoc program found 2174b41a30aaSmrg# returns the path set by the user in the environment 2175b41a30aaSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc 2176b41a30aaSmrg# 'no' user instructs the module not to use asciidoc 2177b41a30aaSmrg# 2178b41a30aaSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path. 2179b41a30aaSmrg# 2180b41a30aaSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[ 2181b41a30aaSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command]) 2182b41a30aaSmrgm4_define([_defopt], m4_default([$2], [auto])) 2183b41a30aaSmrgAC_ARG_WITH(asciidoc, 2184b41a30aaSmrg AS_HELP_STRING([--with-asciidoc], 2185b41a30aaSmrg [Use asciidoc to regenerate documentation (default: ]_defopt[)]), 2186b41a30aaSmrg [use_asciidoc=$withval], [use_asciidoc=]_defopt) 2187b41a30aaSmrgm4_undefine([_defopt]) 2188a253d6aeSmrg 2189b41a30aaSmrgif test "x$use_asciidoc" = x"auto"; then 2190b41a30aaSmrg AC_PATH_PROG([ASCIIDOC], [asciidoc]) 2191b41a30aaSmrg if test "x$ASCIIDOC" = "x"; then 2192b41a30aaSmrg AC_MSG_WARN([asciidoc not found - documentation targets will be skipped]) 2193b41a30aaSmrg have_asciidoc=no 2194b41a30aaSmrg else 2195b41a30aaSmrg have_asciidoc=yes 2196b41a30aaSmrg fi 2197b41a30aaSmrgelif test "x$use_asciidoc" = x"yes" ; then 2198b41a30aaSmrg AC_PATH_PROG([ASCIIDOC], [asciidoc]) 2199b41a30aaSmrg if test "x$ASCIIDOC" = "x"; then 2200b41a30aaSmrg AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH]) 2201b41a30aaSmrg fi 2202b41a30aaSmrg have_asciidoc=yes 2203b41a30aaSmrgelif test "x$use_asciidoc" = x"no" ; then 2204b41a30aaSmrg if test "x$ASCIIDOC" != "x"; then 2205b41a30aaSmrg AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified]) 2206b41a30aaSmrg fi 2207b41a30aaSmrg have_asciidoc=no 2208b41a30aaSmrgelse 2209b41a30aaSmrg AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no']) 2210b41a30aaSmrgfi 2211b41a30aaSmrgm4_ifval([$1], 2212b41a30aaSmrg[if test "$have_asciidoc" = yes; then 2213b41a30aaSmrg # scrape the asciidoc version 2214b41a30aaSmrg AC_MSG_CHECKING([the asciidoc version]) 2215b41a30aaSmrg asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2` 2216b41a30aaSmrg AC_MSG_RESULT([$asciidoc_version]) 2217b41a30aaSmrg AS_VERSION_COMPARE([$asciidoc_version], [$1], 2218b41a30aaSmrg [if test "x$use_asciidoc" = xauto; then 2219b41a30aaSmrg AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed]) 2220b41a30aaSmrg have_asciidoc=no 2221b41a30aaSmrg else 2222b41a30aaSmrg AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed]) 2223b41a30aaSmrg fi]) 2224b41a30aaSmrgfi]) 2225b41a30aaSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes]) 2226b41a30aaSmrg]) # XORG_WITH_ASCIIDOC 2227a253d6aeSmrg 2228b41a30aaSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT]) 2229b41a30aaSmrg# ------------------------------------------- 2230b41a30aaSmrg# Minimum version: 1.5.0 2231b41a30aaSmrg# Minimum version for optional DEFAULT argument: 1.11.0 2232b41a30aaSmrg# Minimum version for optional DOT checking: 1.18.0 2233b41a30aaSmrg# 2234b41a30aaSmrg# Documentation tools are not always available on all platforms and sometimes 2235b41a30aaSmrg# not at the appropriate level. This macro enables a module to test for the 2236b41a30aaSmrg# presence of the tool and obtain it's path in separate variables. Coupled with 223710f94802Smrg# the --with-doxygen option, it allows maximum flexibility in making decisions 2238b41a30aaSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified, 2239b41a30aaSmrg# --with-doxygen assumes 'auto'. 2240b41a30aaSmrg# 2241b41a30aaSmrg# Interface to module: 2242b41a30aaSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation 2243b41a30aaSmrg# DOXYGEN: returns the path of the doxygen program found 2244b41a30aaSmrg# returns the path set by the user in the environment 2245b41a30aaSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen 2246b41a30aaSmrg# 'no' user instructs the module not to use doxygen 2247b41a30aaSmrg# 2248b41a30aaSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path. 2249b41a30aaSmrg# 2250b41a30aaSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[ 2251b41a30aaSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command]) 2252b41a30aaSmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility]) 2253b41a30aaSmrgm4_define([_defopt], m4_default([$2], [auto])) 2254b41a30aaSmrgAC_ARG_WITH(doxygen, 2255b41a30aaSmrg AS_HELP_STRING([--with-doxygen], 2256b41a30aaSmrg [Use doxygen to regenerate documentation (default: ]_defopt[)]), 2257b41a30aaSmrg [use_doxygen=$withval], [use_doxygen=]_defopt) 2258b41a30aaSmrgm4_undefine([_defopt]) 2259a253d6aeSmrg 2260b41a30aaSmrgif test "x$use_doxygen" = x"auto"; then 2261b41a30aaSmrg AC_PATH_PROG([DOXYGEN], [doxygen]) 2262b41a30aaSmrg if test "x$DOXYGEN" = "x"; then 2263b41a30aaSmrg AC_MSG_WARN([doxygen not found - documentation targets will be skipped]) 2264b41a30aaSmrg have_doxygen=no 2265b41a30aaSmrg else 2266b41a30aaSmrg have_doxygen=yes 2267b41a30aaSmrg fi 2268b41a30aaSmrgelif test "x$use_doxygen" = x"yes" ; then 2269b41a30aaSmrg AC_PATH_PROG([DOXYGEN], [doxygen]) 2270b41a30aaSmrg if test "x$DOXYGEN" = "x"; then 2271b41a30aaSmrg AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH]) 2272b41a30aaSmrg fi 2273b41a30aaSmrg have_doxygen=yes 2274b41a30aaSmrgelif test "x$use_doxygen" = x"no" ; then 2275b41a30aaSmrg if test "x$DOXYGEN" != "x"; then 2276b41a30aaSmrg AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified]) 2277b41a30aaSmrg fi 2278b41a30aaSmrg have_doxygen=no 2279b41a30aaSmrgelse 2280b41a30aaSmrg AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no']) 2281b41a30aaSmrgfi 2282b41a30aaSmrgm4_ifval([$1], 2283b41a30aaSmrg[if test "$have_doxygen" = yes; then 2284b41a30aaSmrg # scrape the doxygen version 2285b41a30aaSmrg AC_MSG_CHECKING([the doxygen version]) 2286b41a30aaSmrg doxygen_version=`$DOXYGEN --version 2>/dev/null` 2287b41a30aaSmrg AC_MSG_RESULT([$doxygen_version]) 2288b41a30aaSmrg AS_VERSION_COMPARE([$doxygen_version], [$1], 2289b41a30aaSmrg [if test "x$use_doxygen" = xauto; then 2290b41a30aaSmrg AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed]) 2291b41a30aaSmrg have_doxygen=no 2292b41a30aaSmrg else 2293b41a30aaSmrg AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed]) 2294b41a30aaSmrg fi]) 2295b41a30aaSmrgfi]) 2296a253d6aeSmrg 2297b41a30aaSmrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory 2298b41a30aaSmrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file: 2299b41a30aaSmrgdnl HAVE_DOT = @HAVE_DOT@ 2300b41a30aaSmrgHAVE_DOT=no 2301b41a30aaSmrgif test "x$have_doxygen" = "xyes"; then 2302b41a30aaSmrg AC_PATH_PROG([DOT], [dot]) 2303b41a30aaSmrg if test "x$DOT" != "x"; then 2304b41a30aaSmrg HAVE_DOT=yes 230531637056Smrg fi 2306b41a30aaSmrgfi 2307a253d6aeSmrg 2308b41a30aaSmrgAC_SUBST([HAVE_DOT]) 2309b41a30aaSmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"]) 2310b41a30aaSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes]) 2311b41a30aaSmrg]) # XORG_WITH_DOXYGEN 231257ee1794Smrg 2313b41a30aaSmrg# XORG_WITH_GROFF([DEFAULT]) 2314b41a30aaSmrg# ---------------- 2315b41a30aaSmrg# Minimum version: 1.6.0 2316b41a30aaSmrg# Minimum version for optional DEFAULT argument: 1.11.0 2317b41a30aaSmrg# 2318b41a30aaSmrg# Documentation tools are not always available on all platforms and sometimes 2319b41a30aaSmrg# not at the appropriate level. This macro enables a module to test for the 2320b41a30aaSmrg# presence of the tool and obtain it's path in separate variables. Coupled with 232110f94802Smrg# the --with-groff option, it allows maximum flexibility in making decisions 2322b41a30aaSmrg# as whether or not to use the groff package. When DEFAULT is not specified, 2323b41a30aaSmrg# --with-groff assumes 'auto'. 2324b41a30aaSmrg# 2325b41a30aaSmrg# Interface to module: 2326b41a30aaSmrg# HAVE_GROFF: used in makefiles to conditionally generate documentation 2327b41a30aaSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package 2328b41a30aaSmrg# HAVE_GROFF_MS: the -ms macros package 2329b41a30aaSmrg# GROFF: returns the path of the groff program found 2330b41a30aaSmrg# returns the path set by the user in the environment 2331b41a30aaSmrg# --with-groff: 'yes' user instructs the module to use groff 2332b41a30aaSmrg# 'no' user instructs the module not to use groff 2333b41a30aaSmrg# 2334b41a30aaSmrg# Added in version 1.9.0: 2335b41a30aaSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format: 2336b41a30aaSmrg# pnmcut pnmcrop pnmtopng pnmtops from the netpbm package. 2337b41a30aaSmrg# psselect from the psutils package. 2338b41a30aaSmrg# the ghostcript package. Refer to the grohtml man pages 2339b41a30aaSmrg# 2340b41a30aaSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path. 2341b41a30aaSmrg# 2342b41a30aaSmrg# OS and distros often splits groff in a basic and full package, the former 2343b41a30aaSmrg# having the groff program and the later having devices, fonts and macros 2344b41a30aaSmrg# Checking for the groff executable is not enough. 2345b41a30aaSmrg# 2346b41a30aaSmrg# If macros are missing, we cannot assume that groff is useless, so we don't 2347b41a30aaSmrg# unset HAVE_GROFF or GROFF env variables. 2348b41a30aaSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false. 2349b41a30aaSmrg# 2350b41a30aaSmrgAC_DEFUN([XORG_WITH_GROFF],[ 2351b41a30aaSmrgAC_ARG_VAR([GROFF], [Path to groff command]) 2352b41a30aaSmrgm4_define([_defopt], m4_default([$1], [auto])) 2353b41a30aaSmrgAC_ARG_WITH(groff, 2354b41a30aaSmrg AS_HELP_STRING([--with-groff], 2355b41a30aaSmrg [Use groff to regenerate documentation (default: ]_defopt[)]), 2356b41a30aaSmrg [use_groff=$withval], [use_groff=]_defopt) 2357b41a30aaSmrgm4_undefine([_defopt]) 235857ee1794Smrg 2359b41a30aaSmrgif test "x$use_groff" = x"auto"; then 2360b41a30aaSmrg AC_PATH_PROG([GROFF], [groff]) 2361b41a30aaSmrg if test "x$GROFF" = "x"; then 2362b41a30aaSmrg AC_MSG_WARN([groff not found - documentation targets will be skipped]) 2363b41a30aaSmrg have_groff=no 2364b41a30aaSmrg else 2365b41a30aaSmrg have_groff=yes 2366b41a30aaSmrg fi 2367b41a30aaSmrgelif test "x$use_groff" = x"yes" ; then 2368b41a30aaSmrg AC_PATH_PROG([GROFF], [groff]) 2369b41a30aaSmrg if test "x$GROFF" = "x"; then 2370b41a30aaSmrg AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH]) 2371b41a30aaSmrg fi 2372b41a30aaSmrg have_groff=yes 2373b41a30aaSmrgelif test "x$use_groff" = x"no" ; then 2374b41a30aaSmrg if test "x$GROFF" != "x"; then 2375b41a30aaSmrg AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified]) 2376b41a30aaSmrg fi 2377b41a30aaSmrg have_groff=no 2378b41a30aaSmrgelse 2379b41a30aaSmrg AC_MSG_ERROR([--with-groff expects 'yes' or 'no']) 2380b41a30aaSmrgfi 2381b41a30aaSmrg 2382b41a30aaSmrg# We have groff, test for the presence of the macro packages 2383b41a30aaSmrgif test "x$have_groff" = x"yes"; then 2384b41a30aaSmrg AC_MSG_CHECKING([for ${GROFF} -ms macros]) 2385b41a30aaSmrg if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then 2386b41a30aaSmrg groff_ms_works=yes 2387b41a30aaSmrg else 2388b41a30aaSmrg groff_ms_works=no 238931637056Smrg fi 2390b41a30aaSmrg AC_MSG_RESULT([$groff_ms_works]) 2391b41a30aaSmrg AC_MSG_CHECKING([for ${GROFF} -mm macros]) 2392b41a30aaSmrg if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then 2393b41a30aaSmrg groff_mm_works=yes 239431637056Smrg else 2395b41a30aaSmrg groff_mm_works=no 239631637056Smrg fi 2397b41a30aaSmrg AC_MSG_RESULT([$groff_mm_works]) 239831637056Smrgfi 2399ea133fd7Smrg 2400b41a30aaSmrg# We have groff, test for HTML dependencies, one command per package 2401b41a30aaSmrgif test "x$have_groff" = x"yes"; then 2402b41a30aaSmrg AC_PATH_PROGS(GS_PATH, [gs gswin32c]) 2403b41a30aaSmrg AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng]) 2404b41a30aaSmrg AC_PATH_PROG(PSSELECT_PATH, [psselect]) 2405b41a30aaSmrg if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then 2406b41a30aaSmrg have_groff_html=yes 2407b41a30aaSmrg else 2408b41a30aaSmrg have_groff_html=no 2409b41a30aaSmrg AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages]) 2410b41a30aaSmrg fi 2411b41a30aaSmrgfi 2412a253d6aeSmrg 2413b41a30aaSmrg# Set Automake conditionals for Makefiles 2414b41a30aaSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes]) 2415b41a30aaSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes]) 2416b41a30aaSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes]) 2417b41a30aaSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes]) 2418b41a30aaSmrg]) # XORG_WITH_GROFF 241957ee1794Smrg 2420b41a30aaSmrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT]) 2421b41a30aaSmrg# --------------------------------------- 2422b41a30aaSmrg# Minimum version: 1.6.0 2423b41a30aaSmrg# Minimum version for optional DEFAULT argument: 1.11.0 2424b41a30aaSmrg# Minimum version for optional MIN-VERSION argument: 1.15.0 2425b41a30aaSmrg# 2426b41a30aaSmrg# Documentation tools are not always available on all platforms and sometimes 2427b41a30aaSmrg# not at the appropriate level. This macro enables a module to test for the 2428b41a30aaSmrg# presence of the tool and obtain it's path in separate variables. Coupled with 242910f94802Smrg# the --with-fop option, it allows maximum flexibility in making decisions 2430b41a30aaSmrg# as whether or not to use the fop package. When DEFAULT is not specified, 2431b41a30aaSmrg# --with-fop assumes 'auto'. 2432b41a30aaSmrg# 2433b41a30aaSmrg# Interface to module: 2434b41a30aaSmrg# HAVE_FOP: used in makefiles to conditionally generate documentation 2435b41a30aaSmrg# FOP: returns the path of the fop program found 2436b41a30aaSmrg# returns the path set by the user in the environment 2437b41a30aaSmrg# --with-fop: 'yes' user instructs the module to use fop 2438b41a30aaSmrg# 'no' user instructs the module not to use fop 2439b41a30aaSmrg# 2440b41a30aaSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path. 2441b41a30aaSmrg# 2442b41a30aaSmrgAC_DEFUN([XORG_WITH_FOP],[ 2443b41a30aaSmrgAC_ARG_VAR([FOP], [Path to fop command]) 2444b41a30aaSmrgm4_define([_defopt], m4_default([$2], [auto])) 2445b41a30aaSmrgAC_ARG_WITH(fop, 2446b41a30aaSmrg AS_HELP_STRING([--with-fop], 2447b41a30aaSmrg [Use fop to regenerate documentation (default: ]_defopt[)]), 2448b41a30aaSmrg [use_fop=$withval], [use_fop=]_defopt) 2449b41a30aaSmrgm4_undefine([_defopt]) 2450a253d6aeSmrg 2451b41a30aaSmrgif test "x$use_fop" = x"auto"; then 2452b41a30aaSmrg AC_PATH_PROG([FOP], [fop]) 2453b41a30aaSmrg if test "x$FOP" = "x"; then 2454b41a30aaSmrg AC_MSG_WARN([fop not found - documentation targets will be skipped]) 2455b41a30aaSmrg have_fop=no 2456b41a30aaSmrg else 2457b41a30aaSmrg have_fop=yes 2458b41a30aaSmrg fi 2459b41a30aaSmrgelif test "x$use_fop" = x"yes" ; then 2460b41a30aaSmrg AC_PATH_PROG([FOP], [fop]) 2461b41a30aaSmrg if test "x$FOP" = "x"; then 2462b41a30aaSmrg AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH]) 2463b41a30aaSmrg fi 2464b41a30aaSmrg have_fop=yes 2465b41a30aaSmrgelif test "x$use_fop" = x"no" ; then 2466b41a30aaSmrg if test "x$FOP" != "x"; then 2467b41a30aaSmrg AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified]) 2468b41a30aaSmrg fi 2469b41a30aaSmrg have_fop=no 247031637056Smrgelse 2471b41a30aaSmrg AC_MSG_ERROR([--with-fop expects 'yes' or 'no']) 2472b41a30aaSmrgfi 2473a253d6aeSmrg 2474b41a30aaSmrg# Test for a minimum version of fop, if provided. 2475b41a30aaSmrgm4_ifval([$1], 2476b41a30aaSmrg[if test "$have_fop" = yes; then 2477b41a30aaSmrg # scrape the fop version 2478b41a30aaSmrg AC_MSG_CHECKING([for fop minimum version]) 2479b41a30aaSmrg fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3` 2480b41a30aaSmrg AC_MSG_RESULT([$fop_version]) 2481b41a30aaSmrg AS_VERSION_COMPARE([$fop_version], [$1], 2482b41a30aaSmrg [if test "x$use_fop" = xauto; then 2483b41a30aaSmrg AC_MSG_WARN([fop version $fop_version found, but $1 needed]) 2484b41a30aaSmrg have_fop=no 2485b41a30aaSmrg else 2486b41a30aaSmrg AC_MSG_ERROR([fop version $fop_version found, but $1 needed]) 2487b41a30aaSmrg fi]) 2488b41a30aaSmrgfi]) 2489b41a30aaSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes]) 2490b41a30aaSmrg]) # XORG_WITH_FOP 2491a253d6aeSmrg 2492b41a30aaSmrg# XORG_WITH_M4([MIN-VERSION]) 2493b41a30aaSmrg# --------------------------- 2494b41a30aaSmrg# Minimum version: 1.19.0 2495b41a30aaSmrg# 2496b41a30aaSmrg# This macro attempts to locate an m4 macro processor which supports 2497b41a30aaSmrg# -I option and is only useful for modules relying on M4 in order to 2498b41a30aaSmrg# expand macros in source code files. 2499b41a30aaSmrg# 2500b41a30aaSmrg# Interface to module: 2501b41a30aaSmrg# M4: returns the path of the m4 program found 2502b41a30aaSmrg# returns the path set by the user in the environment 2503b41a30aaSmrg# 2504b41a30aaSmrgAC_DEFUN([XORG_WITH_M4], [ 2505b41a30aaSmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4], 2506b41a30aaSmrg [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4], 2507b41a30aaSmrg [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \ 2508b41a30aaSmrg ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]], 2509b41a30aaSmrg [AC_MSG_ERROR([could not find m4 that supports -I option])], 2510b41a30aaSmrg [$PATH:/usr/gnu/bin])]) 2511a253d6aeSmrg 2512b41a30aaSmrgAC_SUBST([M4], [$ac_cv_path_M4]) 2513b41a30aaSmrg]) # XORG_WITH_M4 2514a253d6aeSmrg 2515b41a30aaSmrg# XORG_WITH_PS2PDF([DEFAULT]) 2516b41a30aaSmrg# ---------------- 2517b41a30aaSmrg# Minimum version: 1.6.0 2518b41a30aaSmrg# Minimum version for optional DEFAULT argument: 1.11.0 2519b41a30aaSmrg# 2520b41a30aaSmrg# Documentation tools are not always available on all platforms and sometimes 2521b41a30aaSmrg# not at the appropriate level. This macro enables a module to test for the 2522b41a30aaSmrg# presence of the tool and obtain it's path in separate variables. Coupled with 252310f94802Smrg# the --with-ps2pdf option, it allows maximum flexibility in making decisions 2524b41a30aaSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified, 2525b41a30aaSmrg# --with-ps2pdf assumes 'auto'. 2526b41a30aaSmrg# 2527b41a30aaSmrg# Interface to module: 2528b41a30aaSmrg# HAVE_PS2PDF: used in makefiles to conditionally generate documentation 2529b41a30aaSmrg# PS2PDF: returns the path of the ps2pdf program found 2530b41a30aaSmrg# returns the path set by the user in the environment 2531b41a30aaSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf 2532b41a30aaSmrg# 'no' user instructs the module not to use ps2pdf 2533b41a30aaSmrg# 2534b41a30aaSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path. 2535b41a30aaSmrg# 2536b41a30aaSmrgAC_DEFUN([XORG_WITH_PS2PDF],[ 2537b41a30aaSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command]) 2538b41a30aaSmrgm4_define([_defopt], m4_default([$1], [auto])) 2539b41a30aaSmrgAC_ARG_WITH(ps2pdf, 2540b41a30aaSmrg AS_HELP_STRING([--with-ps2pdf], 2541b41a30aaSmrg [Use ps2pdf to regenerate documentation (default: ]_defopt[)]), 2542b41a30aaSmrg [use_ps2pdf=$withval], [use_ps2pdf=]_defopt) 2543b41a30aaSmrgm4_undefine([_defopt]) 2544a253d6aeSmrg 2545b41a30aaSmrgif test "x$use_ps2pdf" = x"auto"; then 2546b41a30aaSmrg AC_PATH_PROG([PS2PDF], [ps2pdf]) 2547b41a30aaSmrg if test "x$PS2PDF" = "x"; then 2548b41a30aaSmrg AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped]) 2549b41a30aaSmrg have_ps2pdf=no 2550b41a30aaSmrg else 2551b41a30aaSmrg have_ps2pdf=yes 2552b41a30aaSmrg fi 2553b41a30aaSmrgelif test "x$use_ps2pdf" = x"yes" ; then 2554b41a30aaSmrg AC_PATH_PROG([PS2PDF], [ps2pdf]) 2555b41a30aaSmrg if test "x$PS2PDF" = "x"; then 2556b41a30aaSmrg AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH]) 2557b41a30aaSmrg fi 2558b41a30aaSmrg have_ps2pdf=yes 2559b41a30aaSmrgelif test "x$use_ps2pdf" = x"no" ; then 2560b41a30aaSmrg if test "x$PS2PDF" != "x"; then 2561b41a30aaSmrg AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified]) 2562b41a30aaSmrg fi 2563b41a30aaSmrg have_ps2pdf=no 2564b41a30aaSmrgelse 2565b41a30aaSmrg AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no']) 2566b41a30aaSmrgfi 2567b41a30aaSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes]) 2568b41a30aaSmrg]) # XORG_WITH_PS2PDF 2569a253d6aeSmrg 2570b41a30aaSmrg# XORG_ENABLE_DOCS (enable_docs=yes) 2571b41a30aaSmrg# ---------------- 2572b41a30aaSmrg# Minimum version: 1.6.0 2573b41a30aaSmrg# 2574b41a30aaSmrg# Documentation tools are not always available on all platforms and sometimes 2575b41a30aaSmrg# not at the appropriate level. This macro enables a builder to skip all 2576b41a30aaSmrg# documentation targets except traditional man pages. 2577b41a30aaSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 257810f94802Smrg# maximum flexibility in controlling documentation building. 2579b41a30aaSmrg# Refer to: 2580b41a30aaSmrg# XORG_WITH_XMLTO --with-xmlto 2581b41a30aaSmrg# XORG_WITH_ASCIIDOC --with-asciidoc 2582b41a30aaSmrg# XORG_WITH_DOXYGEN --with-doxygen 2583b41a30aaSmrg# XORG_WITH_FOP --with-fop 2584b41a30aaSmrg# XORG_WITH_GROFF --with-groff 2585b41a30aaSmrg# XORG_WITH_PS2PDF --with-ps2pdf 2586b41a30aaSmrg# 2587b41a30aaSmrg# Interface to module: 2588b41a30aaSmrg# ENABLE_DOCS: used in makefiles to conditionally generate documentation 2589b41a30aaSmrg# --enable-docs: 'yes' user instructs the module to generate docs 2590b41a30aaSmrg# 'no' user instructs the module not to generate docs 2591b41a30aaSmrg# parm1: specify the default value, yes or no. 2592b41a30aaSmrg# 2593b41a30aaSmrgAC_DEFUN([XORG_ENABLE_DOCS],[ 2594b41a30aaSmrgm4_define([docs_default], m4_default([$1], [yes])) 2595b41a30aaSmrgAC_ARG_ENABLE(docs, 2596b41a30aaSmrg AS_HELP_STRING([--enable-docs], 2597b41a30aaSmrg [Enable building the documentation (default: ]docs_default[)]), 2598b41a30aaSmrg [build_docs=$enableval], [build_docs=]docs_default) 2599b41a30aaSmrgm4_undefine([docs_default]) 2600b41a30aaSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes]) 2601b41a30aaSmrgAC_MSG_CHECKING([whether to build documentation]) 2602b41a30aaSmrgAC_MSG_RESULT([$build_docs]) 2603b41a30aaSmrg]) # XORG_ENABLE_DOCS 2604a253d6aeSmrg 2605b41a30aaSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes) 2606b41a30aaSmrg# ---------------- 2607b41a30aaSmrg# Minimum version: 1.6.0 2608b41a30aaSmrg# 2609b41a30aaSmrg# This macro enables a builder to skip all developer documentation. 2610b41a30aaSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 261110f94802Smrg# maximum flexibility in controlling documentation building. 2612b41a30aaSmrg# Refer to: 2613b41a30aaSmrg# XORG_WITH_XMLTO --with-xmlto 2614b41a30aaSmrg# XORG_WITH_ASCIIDOC --with-asciidoc 2615b41a30aaSmrg# XORG_WITH_DOXYGEN --with-doxygen 2616b41a30aaSmrg# XORG_WITH_FOP --with-fop 2617b41a30aaSmrg# XORG_WITH_GROFF --with-groff 2618b41a30aaSmrg# XORG_WITH_PS2PDF --with-ps2pdf 2619b41a30aaSmrg# 2620b41a30aaSmrg# Interface to module: 2621b41a30aaSmrg# ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs 2622b41a30aaSmrg# --enable-devel-docs: 'yes' user instructs the module to generate developer docs 2623b41a30aaSmrg# 'no' user instructs the module not to generate developer docs 2624b41a30aaSmrg# parm1: specify the default value, yes or no. 2625b41a30aaSmrg# 2626b41a30aaSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[ 2627b41a30aaSmrgm4_define([devel_default], m4_default([$1], [yes])) 2628b41a30aaSmrgAC_ARG_ENABLE(devel-docs, 2629b41a30aaSmrg AS_HELP_STRING([--enable-devel-docs], 2630b41a30aaSmrg [Enable building the developer documentation (default: ]devel_default[)]), 2631b41a30aaSmrg [build_devel_docs=$enableval], [build_devel_docs=]devel_default) 2632b41a30aaSmrgm4_undefine([devel_default]) 2633b41a30aaSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes]) 2634b41a30aaSmrgAC_MSG_CHECKING([whether to build developer documentation]) 2635b41a30aaSmrgAC_MSG_RESULT([$build_devel_docs]) 2636b41a30aaSmrg]) # XORG_ENABLE_DEVEL_DOCS 2637a253d6aeSmrg 2638b41a30aaSmrg# XORG_ENABLE_SPECS (enable_specs=yes) 2639b41a30aaSmrg# ---------------- 2640b41a30aaSmrg# Minimum version: 1.6.0 2641b41a30aaSmrg# 2642b41a30aaSmrg# This macro enables a builder to skip all functional specification targets. 2643b41a30aaSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 264410f94802Smrg# maximum flexibility in controlling documentation building. 2645b41a30aaSmrg# Refer to: 2646b41a30aaSmrg# XORG_WITH_XMLTO --with-xmlto 2647b41a30aaSmrg# XORG_WITH_ASCIIDOC --with-asciidoc 2648b41a30aaSmrg# XORG_WITH_DOXYGEN --with-doxygen 2649b41a30aaSmrg# XORG_WITH_FOP --with-fop 2650b41a30aaSmrg# XORG_WITH_GROFF --with-groff 2651b41a30aaSmrg# XORG_WITH_PS2PDF --with-ps2pdf 2652b41a30aaSmrg# 2653b41a30aaSmrg# Interface to module: 2654b41a30aaSmrg# ENABLE_SPECS: used in makefiles to conditionally generate specs 2655b41a30aaSmrg# --enable-specs: 'yes' user instructs the module to generate specs 2656b41a30aaSmrg# 'no' user instructs the module not to generate specs 2657b41a30aaSmrg# parm1: specify the default value, yes or no. 2658b41a30aaSmrg# 2659b41a30aaSmrgAC_DEFUN([XORG_ENABLE_SPECS],[ 2660b41a30aaSmrgm4_define([spec_default], m4_default([$1], [yes])) 2661b41a30aaSmrgAC_ARG_ENABLE(specs, 2662b41a30aaSmrg AS_HELP_STRING([--enable-specs], 2663b41a30aaSmrg [Enable building the specs (default: ]spec_default[)]), 2664b41a30aaSmrg [build_specs=$enableval], [build_specs=]spec_default) 2665b41a30aaSmrgm4_undefine([spec_default]) 2666b41a30aaSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes]) 2667b41a30aaSmrgAC_MSG_CHECKING([whether to build functional specifications]) 2668b41a30aaSmrgAC_MSG_RESULT([$build_specs]) 2669b41a30aaSmrg]) # XORG_ENABLE_SPECS 2670a253d6aeSmrg 2671b41a30aaSmrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto) 2672b41a30aaSmrg# ---------------------------------------------- 2673b41a30aaSmrg# Minimum version: 1.13.0 2674b41a30aaSmrg# 2675b41a30aaSmrg# This macro enables a builder to enable/disable unit testing 2676b41a30aaSmrg# It makes no assumption about the test cases implementation 2677b41a30aaSmrg# Test cases may or may not use Automake "Support for test suites" 2678b41a30aaSmrg# They may or may not use the software utility library GLib 2679b41a30aaSmrg# 2680b41a30aaSmrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL 2681b41a30aaSmrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib. 2682b41a30aaSmrg# The variable enable_unit_tests is used by other macros in this file. 2683b41a30aaSmrg# 2684b41a30aaSmrg# Interface to module: 2685b41a30aaSmrg# ENABLE_UNIT_TESTS: used in makefiles to conditionally build tests 2686b41a30aaSmrg# enable_unit_tests: used in configure.ac for additional configuration 2687b41a30aaSmrg# --enable-unit-tests: 'yes' user instructs the module to build tests 2688b41a30aaSmrg# 'no' user instructs the module not to build tests 2689b41a30aaSmrg# parm1: specify the default value, yes or no. 2690b41a30aaSmrg# 2691b41a30aaSmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[ 2692b41a30aaSmrgAC_BEFORE([$0], [XORG_WITH_GLIB]) 2693b41a30aaSmrgAC_BEFORE([$0], [XORG_LD_WRAP]) 2694b41a30aaSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS]) 2695b41a30aaSmrgm4_define([_defopt], m4_default([$1], [auto])) 2696b41a30aaSmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests], 2697b41a30aaSmrg [Enable building unit test cases (default: ]_defopt[)]), 2698b41a30aaSmrg [enable_unit_tests=$enableval], [enable_unit_tests=]_defopt) 2699b41a30aaSmrgm4_undefine([_defopt]) 2700b41a30aaSmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno]) 2701b41a30aaSmrgAC_MSG_CHECKING([whether to build unit test cases]) 2702b41a30aaSmrgAC_MSG_RESULT([$enable_unit_tests]) 2703b41a30aaSmrg]) # XORG_ENABLE_UNIT_TESTS 2704a253d6aeSmrg 2705b41a30aaSmrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto) 2706b41a30aaSmrg# ------------------------------------------------------ 2707b41a30aaSmrg# Minimum version: 1.17.0 2708b41a30aaSmrg# 2709b41a30aaSmrg# This macro enables a builder to enable/disable integration testing 2710b41a30aaSmrg# It makes no assumption about the test cases' implementation 2711b41a30aaSmrg# Test cases may or may not use Automake "Support for test suites" 2712b41a30aaSmrg# 2713b41a30aaSmrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support 2714b41a30aaSmrg# usually requires less dependencies and may be built and run under less 2715b41a30aaSmrg# stringent environments than integration tests. 2716b41a30aaSmrg# 2717b41a30aaSmrg# Interface to module: 2718b41a30aaSmrg# ENABLE_INTEGRATION_TESTS: used in makefiles to conditionally build tests 2719b41a30aaSmrg# enable_integration_tests: used in configure.ac for additional configuration 2720b41a30aaSmrg# --enable-integration-tests: 'yes' user instructs the module to build tests 2721b41a30aaSmrg# 'no' user instructs the module not to build tests 2722b41a30aaSmrg# parm1: specify the default value, yes or no. 2723b41a30aaSmrg# 2724b41a30aaSmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[ 2725b41a30aaSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS]) 2726b41a30aaSmrgm4_define([_defopt], m4_default([$1], [auto])) 2727b41a30aaSmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests], 2728b41a30aaSmrg [Enable building integration test cases (default: ]_defopt[)]), 2729b41a30aaSmrg [enable_integration_tests=$enableval], 2730b41a30aaSmrg [enable_integration_tests=]_defopt) 2731b41a30aaSmrgm4_undefine([_defopt]) 2732b41a30aaSmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS], 2733b41a30aaSmrg [test "x$enable_integration_tests" != xno]) 2734b41a30aaSmrgAC_MSG_CHECKING([whether to build unit test cases]) 2735b41a30aaSmrgAC_MSG_RESULT([$enable_integration_tests]) 2736b41a30aaSmrg]) # XORG_ENABLE_INTEGRATION_TESTS 2737a253d6aeSmrg 2738b41a30aaSmrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT]) 2739b41a30aaSmrg# ---------------------------------------- 2740b41a30aaSmrg# Minimum version: 1.13.0 2741b41a30aaSmrg# 2742b41a30aaSmrg# GLib is a library which provides advanced data structures and functions. 2743b41a30aaSmrg# This macro enables a module to test for the presence of Glib. 2744b41a30aaSmrg# 2745b41a30aaSmrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing. 2746b41a30aaSmrg# Otherwise the value of $enable_unit_tests is blank. 2747b41a30aaSmrg# 2748b41a30aaSmrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit 2749b41a30aaSmrg# test support usually requires less dependencies and may be built and run under 2750b41a30aaSmrg# less stringent environments than integration tests. 2751b41a30aaSmrg# 2752b41a30aaSmrg# Interface to module: 2753b41a30aaSmrg# HAVE_GLIB: used in makefiles to conditionally build targets 2754b41a30aaSmrg# with_glib: used in configure.ac to know if GLib has been found 2755b41a30aaSmrg# --with-glib: 'yes' user instructs the module to use glib 2756b41a30aaSmrg# 'no' user instructs the module not to use glib 2757b41a30aaSmrg# 2758b41a30aaSmrgAC_DEFUN([XORG_WITH_GLIB],[ 2759b41a30aaSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG]) 2760b41a30aaSmrgm4_define([_defopt], m4_default([$2], [auto])) 2761b41a30aaSmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib], 2762b41a30aaSmrg [Use GLib library for unit testing (default: ]_defopt[)]), 2763b41a30aaSmrg [with_glib=$withval], [with_glib=]_defopt) 2764b41a30aaSmrgm4_undefine([_defopt]) 276557ee1794Smrg 2766b41a30aaSmrghave_glib=no 2767b41a30aaSmrg# Do not probe GLib if user explicitly disabled unit testing 2768b41a30aaSmrgif test "x$enable_unit_tests" != x"no"; then 2769b41a30aaSmrg # Do not probe GLib if user explicitly disabled it 2770b41a30aaSmrg if test "x$with_glib" != x"no"; then 2771b41a30aaSmrg m4_ifval( 2772b41a30aaSmrg [$1], 2773b41a30aaSmrg [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])], 2774b41a30aaSmrg [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])] 2775b41a30aaSmrg ) 2776b41a30aaSmrg fi 2777b41a30aaSmrgfi 277857ee1794Smrg 2779b41a30aaSmrg# Not having GLib when unit testing has been explicitly requested is an error 2780b41a30aaSmrgif test "x$enable_unit_tests" = x"yes"; then 2781b41a30aaSmrg if test "x$have_glib" = x"no"; then 2782b41a30aaSmrg AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found]) 2783b41a30aaSmrg fi 2784b41a30aaSmrgfi 2785a253d6aeSmrg 2786b41a30aaSmrg# Having unit testing disabled when GLib has been explicitly requested is an error 2787b41a30aaSmrgif test "x$enable_unit_tests" = x"no"; then 2788b41a30aaSmrg if test "x$with_glib" = x"yes"; then 2789b41a30aaSmrg AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found]) 279006f32fbeSmrg fi 2791b41a30aaSmrgfi 2792ea133fd7Smrg 2793b41a30aaSmrg# Not having GLib when it has been explicitly requested is an error 2794b41a30aaSmrgif test "x$with_glib" = x"yes"; then 2795b41a30aaSmrg if test "x$have_glib" = x"no"; then 2796b41a30aaSmrg AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found]) 2797b41a30aaSmrg fi 2798b41a30aaSmrgfi 2799ea133fd7Smrg 2800b41a30aaSmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes]) 2801b41a30aaSmrg]) # XORG_WITH_GLIB 2802ea133fd7Smrg 2803b41a30aaSmrg# XORG_LD_WRAP([required|optional]) 2804b41a30aaSmrg# --------------------------------- 2805b41a30aaSmrg# Minimum version: 1.13.0 2806b41a30aaSmrg# 2807b41a30aaSmrg# Check if linker supports -wrap, passed via compiler flags 2808b41a30aaSmrg# 2809b41a30aaSmrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing. 2810b41a30aaSmrg# Otherwise the value of $enable_unit_tests is blank. 2811b41a30aaSmrg# 2812b41a30aaSmrg# Argument added in 1.16.0 - default is "required", to match existing behavior 2813b41a30aaSmrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not 2814b41a30aaSmrg# available, an argument of "optional" allows use when some unit tests require 2815b41a30aaSmrg# ld -wrap and others do not. 2816b41a30aaSmrg# 2817b41a30aaSmrgAC_DEFUN([XORG_LD_WRAP],[ 2818b41a30aaSmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no], 2819b41a30aaSmrg [AC_LANG_PROGRAM([#include <stdlib.h> 2820b41a30aaSmrg void __wrap_exit(int status) { return; }], 2821b41a30aaSmrg [exit(0);])]) 2822b41a30aaSmrg# Not having ld wrap when unit testing has been explicitly requested is an error 2823b41a30aaSmrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then 2824b41a30aaSmrg if test "x$have_ld_wrap" = x"no"; then 2825b41a30aaSmrg AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available]) 2826b41a30aaSmrg fi 2827b41a30aaSmrgfi 2828b41a30aaSmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes]) 2829b41a30aaSmrg# 2830b41a30aaSmrg]) # XORG_LD_WRAP 2831ea133fd7Smrg 2832b41a30aaSmrg# XORG_CHECK_LINKER_FLAGS 2833b41a30aaSmrg# ----------------------- 2834b41a30aaSmrg# SYNOPSIS 2835b41a30aaSmrg# 2836b41a30aaSmrg# XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE]) 2837b41a30aaSmrg# 2838b41a30aaSmrg# DESCRIPTION 2839b41a30aaSmrg# 2840b41a30aaSmrg# Check whether the given linker FLAGS work with the current language's 2841b41a30aaSmrg# linker, or whether they give an error. 2842b41a30aaSmrg# 2843b41a30aaSmrg# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on 2844b41a30aaSmrg# success/failure. 2845b41a30aaSmrg# 2846b41a30aaSmrg# PROGRAM-SOURCE is the program source to link with, if needed 2847b41a30aaSmrg# 2848b41a30aaSmrg# NOTE: Based on AX_CHECK_COMPILER_FLAGS. 2849b41a30aaSmrg# 2850b41a30aaSmrg# LICENSE 2851b41a30aaSmrg# 2852b41a30aaSmrg# Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org> 2853b41a30aaSmrg# Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu> 2854b41a30aaSmrg# Copyright (c) 2009 Matteo Frigo 2855b41a30aaSmrg# 2856b41a30aaSmrg# This program is free software: you can redistribute it and/or modify it 2857b41a30aaSmrg# under the terms of the GNU General Public License as published by the 2858b41a30aaSmrg# Free Software Foundation, either version 3 of the License, or (at your 2859b41a30aaSmrg# option) any later version. 2860b41a30aaSmrg# 2861b41a30aaSmrg# This program is distributed in the hope that it will be useful, but 2862b41a30aaSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of 2863b41a30aaSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 2864b41a30aaSmrg# Public License for more details. 2865b41a30aaSmrg# 2866b41a30aaSmrg# You should have received a copy of the GNU General Public License along 2867b41a30aaSmrg# with this program. If not, see <http://www.gnu.org/licenses/>. 2868b41a30aaSmrg# 2869b41a30aaSmrg# As a special exception, the respective Autoconf Macro's copyright owner 2870b41a30aaSmrg# gives unlimited permission to copy, distribute and modify the configure 2871b41a30aaSmrg# scripts that are the output of Autoconf when processing the Macro. You 2872b41a30aaSmrg# need not follow the terms of the GNU General Public License when using 2873b41a30aaSmrg# or distributing such scripts, even though portions of the text of the 2874b41a30aaSmrg# Macro appear in them. The GNU General Public License (GPL) does govern 2875b41a30aaSmrg# all other use of the material that constitutes the Autoconf Macro. 2876b41a30aaSmrg# 2877b41a30aaSmrg# This special exception to the GPL applies to versions of the Autoconf 2878b41a30aaSmrg# Macro released by the Autoconf Archive. When you make and distribute a 2879b41a30aaSmrg# modified version of the Autoconf Macro, you may extend this special 2880b41a30aaSmrg# exception to the GPL to apply to your modified version as well.# 2881b41a30aaSmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS], 2882b41a30aaSmrg[AC_MSG_CHECKING([whether the linker accepts $1]) 2883b41a30aaSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname: 2884b41a30aaSmrgAS_LITERAL_IF([$1], 2885b41a30aaSmrg [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [ 2886b41a30aaSmrg ax_save_FLAGS=$LDFLAGS 2887b41a30aaSmrg LDFLAGS="$1" 2888b41a30aaSmrg AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])], 2889b41a30aaSmrg AS_TR_SH(xorg_cv_linker_flags_[$1])=yes, 2890b41a30aaSmrg AS_TR_SH(xorg_cv_linker_flags_[$1])=no) 2891b41a30aaSmrg LDFLAGS=$ax_save_FLAGS])], 2892b41a30aaSmrg [ax_save_FLAGS=$LDFLAGS 2893b41a30aaSmrg LDFLAGS="$1" 2894b41a30aaSmrg AC_LINK_IFELSE([AC_LANG_PROGRAM()], 2895b41a30aaSmrg eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes, 2896b41a30aaSmrg eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no) 2897b41a30aaSmrg LDFLAGS=$ax_save_FLAGS]) 2898b41a30aaSmrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1]) 2899b41a30aaSmrgAC_MSG_RESULT($xorg_check_linker_flags) 2900b41a30aaSmrgif test "x$xorg_check_linker_flags" = xyes; then 2901b41a30aaSmrg m4_default([$2], :) 2902b41a30aaSmrgelse 2903b41a30aaSmrg m4_default([$3], :) 2904b41a30aaSmrgfi 2905b41a30aaSmrg]) # XORG_CHECK_LINKER_FLAGS 2906a253d6aeSmrg 2907b41a30aaSmrg# XORG_MEMORY_CHECK_FLAGS 2908b41a30aaSmrg# ----------------------- 2909b41a30aaSmrg# Minimum version: 1.16.0 2910b41a30aaSmrg# 2911b41a30aaSmrg# This macro attempts to find appropriate memory checking functionality 2912b41a30aaSmrg# for various platforms which unit testing code may use to catch various 2913b41a30aaSmrg# forms of memory allocation and access errors in testing. 2914b41a30aaSmrg# 2915b41a30aaSmrg# Interface to module: 2916b41a30aaSmrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging 2917b41a30aaSmrg# Usually added to TESTS_ENVIRONMENT in Makefile.am 2918b41a30aaSmrg# 2919b41a30aaSmrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim. 2920b41a30aaSmrg# 2921b41a30aaSmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[ 2922a253d6aeSmrg 2923b41a30aaSmrgAC_REQUIRE([AC_CANONICAL_HOST]) 2924b41a30aaSmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV], 2925b41a30aaSmrg [Environment variables to enable memory checking in tests]) 2926a253d6aeSmrg 2927b41a30aaSmrg# Check for different types of support on different platforms 2928b41a30aaSmrgcase $host_os in 2929b41a30aaSmrg solaris*) 2930b41a30aaSmrg AC_CHECK_LIB([umem], [umem_alloc], 2931b41a30aaSmrg [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default']) 2932b41a30aaSmrg ;; 2933b41a30aaSmrg *-gnu*) # GNU libc - Value is used as a single byte bit pattern, 2934b41a30aaSmrg # both directly and inverted, so should not be 0 or 255. 2935b41a30aaSmrg malloc_debug_env='MALLOC_PERTURB_=15' 2936b41a30aaSmrg ;; 2937b41a30aaSmrg darwin*) 2938b41a30aaSmrg malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib' 2939b41a30aaSmrg ;; 2940b41a30aaSmrg *bsd*) 2941b41a30aaSmrg malloc_debug_env='MallocPreScribble=1 MallocScribble=1' 2942b41a30aaSmrg ;; 2943b41a30aaSmrgesac 2944a253d6aeSmrg 2945b41a30aaSmrg# User supplied flags override default flags 2946b41a30aaSmrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then 2947b41a30aaSmrg malloc_debug_env="$XORG_MALLOC_DEBUG_ENV" 294831637056Smrgfi 2949a253d6aeSmrg 2950b41a30aaSmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env]) 2951b41a30aaSmrg]) # XORG_WITH_LINT 2952a253d6aeSmrg 2953b41a30aaSmrg# XORG_CHECK_MALLOC_ZERO 2954b41a30aaSmrg# ---------------------- 2955b41a30aaSmrg# Minimum version: 1.0.0 2956b41a30aaSmrg# 2957b41a30aaSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if 2958b41a30aaSmrg# malloc(0) returns NULL. Packages should add one of these cflags to 2959b41a30aaSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. 2960b41a30aaSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[ 2961b41a30aaSmrgAC_ARG_ENABLE(malloc0returnsnull, 2962b41a30aaSmrg AS_HELP_STRING([--enable-malloc0returnsnull], 2963b41a30aaSmrg [malloc(0) returns NULL (default: auto)]), 2964b41a30aaSmrg [MALLOC_ZERO_RETURNS_NULL=$enableval], 2965b41a30aaSmrg [MALLOC_ZERO_RETURNS_NULL=auto]) 296606f32fbeSmrg 2967b41a30aaSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL]) 2968b41a30aaSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then 2969b41a30aaSmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null], 2970b41a30aaSmrg [AC_RUN_IFELSE([AC_LANG_PROGRAM([ 2971b41a30aaSmrg#include <stdlib.h> 2972b41a30aaSmrg],[ 2973b41a30aaSmrg char *m0, *r0, *c0, *p; 2974b41a30aaSmrg m0 = malloc(0); 2975b41a30aaSmrg p = malloc(10); 2976b41a30aaSmrg r0 = realloc(p,0); 2977b41a30aaSmrg c0 = calloc(0,10); 2978b41a30aaSmrg exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1); 2979b41a30aaSmrg])], 2980b41a30aaSmrg [xorg_cv_malloc0_returns_null=yes], 2981b41a30aaSmrg [xorg_cv_malloc0_returns_null=no])]) 2982b41a30aaSmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null 2983b41a30aaSmrgfi 2984b41a30aaSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) 2985a253d6aeSmrg 2986b41a30aaSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then 2987b41a30aaSmrg MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" 2988b41a30aaSmrg XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS 2989b41a30aaSmrg XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" 299031637056Smrgelse 2991b41a30aaSmrg MALLOC_ZERO_CFLAGS="" 2992b41a30aaSmrg XMALLOC_ZERO_CFLAGS="" 2993b41a30aaSmrg XTMALLOC_ZERO_CFLAGS="" 299431637056Smrgfi 2995a253d6aeSmrg 2996b41a30aaSmrgAC_SUBST([MALLOC_ZERO_CFLAGS]) 2997b41a30aaSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS]) 2998b41a30aaSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS]) 2999b41a30aaSmrg]) # XORG_CHECK_MALLOC_ZERO 3000a253d6aeSmrg 3001b41a30aaSmrg# XORG_WITH_LINT() 300231637056Smrg# ---------------- 3003b41a30aaSmrg# Minimum version: 1.1.0 3004b41a30aaSmrg# 3005b41a30aaSmrg# This macro enables the use of a tool that flags some suspicious and 3006b41a30aaSmrg# non-portable constructs (likely to be bugs) in C language source code. 3007b41a30aaSmrg# It will attempt to locate the tool and use appropriate options. 3008b41a30aaSmrg# There are various lint type tools on different platforms. 3009b41a30aaSmrg# 3010b41a30aaSmrg# Interface to module: 3011b41a30aaSmrg# LINT: returns the path to the tool found on the platform 3012b41a30aaSmrg# or the value set to LINT on the configure cmd line 3013b41a30aaSmrg# also an Automake conditional 3014b41a30aaSmrg# LINT_FLAGS: an Automake variable with appropriate flags 3015b41a30aaSmrg# 3016b41a30aaSmrg# --with-lint: 'yes' user instructs the module to use lint 3017b41a30aaSmrg# 'no' user instructs the module not to use lint (default) 3018b41a30aaSmrg# 3019b41a30aaSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path. 3020b41a30aaSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim. 3021b41a30aaSmrg# 3022b41a30aaSmrgAC_DEFUN([XORG_WITH_LINT],[ 3023a253d6aeSmrg 3024b41a30aaSmrgAC_ARG_VAR([LINT], [Path to a lint-style command]) 3025b41a30aaSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command]) 3026b41a30aaSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint], 3027b41a30aaSmrg [Use a lint-style source code checker (default: disabled)])], 3028b41a30aaSmrg [use_lint=$withval], [use_lint=no]) 3029a253d6aeSmrg 3030b41a30aaSmrg# Obtain platform specific info like program name and options 3031b41a30aaSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris 3032b41a30aaSmrgcase $host_os in 3033b41a30aaSmrg *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*) 3034b41a30aaSmrg lint_name=splint 3035b41a30aaSmrg lint_options="-badflag" 3036b41a30aaSmrg ;; 3037b41a30aaSmrg *freebsd* | *netbsd*) 3038b41a30aaSmrg lint_name=lint 3039b41a30aaSmrg lint_options="-u -b" 3040b41a30aaSmrg ;; 3041b41a30aaSmrg *solaris*) 3042b41a30aaSmrg lint_name=lint 3043b41a30aaSmrg lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2" 3044b41a30aaSmrg ;; 3045b41a30aaSmrgesac 3046a253d6aeSmrg 3047b41a30aaSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user) 3048b41a30aaSmrgif test "x$use_lint" = x"yes" ; then 3049b41a30aaSmrg AC_PATH_PROG([LINT], [$lint_name]) 3050b41a30aaSmrg if test "x$LINT" = "x"; then 3051b41a30aaSmrg AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH]) 3052b41a30aaSmrg fi 3053b41a30aaSmrgelif test "x$use_lint" = x"no" ; then 3054b41a30aaSmrg if test "x$LINT" != "x"; then 3055b41a30aaSmrg AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified]) 3056b41a30aaSmrg fi 305731637056Smrgelse 3058b41a30aaSmrg AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.]) 305931637056Smrgfi 3060a253d6aeSmrg 3061b41a30aaSmrg# User supplied flags override default flags 3062b41a30aaSmrgif test "x$LINT_FLAGS" != "x"; then 3063b41a30aaSmrg lint_options=$LINT_FLAGS 306431637056Smrgfi 3065a253d6aeSmrg 3066b41a30aaSmrgAC_SUBST([LINT_FLAGS],[$lint_options]) 3067b41a30aaSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x]) 3068a253d6aeSmrg 3069b41a30aaSmrg]) # XORG_WITH_LINT 3070b41a30aaSmrg 3071b41a30aaSmrg# XORG_LINT_LIBRARY(LIBNAME) 3072b41a30aaSmrg# -------------------------- 3073b41a30aaSmrg# Minimum version: 1.1.0 3074b41a30aaSmrg# 3075b41a30aaSmrg# Sets up flags for building lint libraries for checking programs that call 3076b41a30aaSmrg# functions in the library. 3077b41a30aaSmrg# 3078b41a30aaSmrg# Interface to module: 3079b41a30aaSmrg# LINTLIB - Automake variable with the name of lint library file to make 3080b41a30aaSmrg# MAKE_LINT_LIB - Automake conditional 3081b41a30aaSmrg# 3082b41a30aaSmrg# --enable-lint-library: - 'yes' user instructs the module to created a lint library 3083b41a30aaSmrg# - 'no' user instructs the module not to create a lint library (default) 3084b41a30aaSmrg 3085b41a30aaSmrgAC_DEFUN([XORG_LINT_LIBRARY],[ 3086b41a30aaSmrgAC_REQUIRE([XORG_WITH_LINT]) 3087b41a30aaSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library], 3088b41a30aaSmrg [Create lint library (default: disabled)])], 3089b41a30aaSmrg [make_lint_lib=$enableval], [make_lint_lib=no]) 3090b41a30aaSmrg 3091b41a30aaSmrgif test "x$make_lint_lib" = x"yes" ; then 3092b41a30aaSmrg LINTLIB=llib-l$1.ln 3093b41a30aaSmrg if test "x$LINT" = "x"; then 3094b41a30aaSmrg AC_MSG_ERROR([Cannot make lint library without --with-lint]) 3095b41a30aaSmrg fi 3096b41a30aaSmrgelif test "x$make_lint_lib" != x"no" ; then 3097b41a30aaSmrg AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.]) 309806f32fbeSmrgfi 3099a253d6aeSmrg 3100b41a30aaSmrgAC_SUBST(LINTLIB) 3101b41a30aaSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno]) 3102a253d6aeSmrg 3103b41a30aaSmrg]) # XORG_LINT_LIBRARY 3104a253d6aeSmrg 3105b41a30aaSmrg# XORG_COMPILER_BRAND 3106b41a30aaSmrg# ------------------- 3107b41a30aaSmrg# Minimum version: 1.14.0 3108b41a30aaSmrg# 3109b41a30aaSmrg# Checks for various brands of compilers and sets flags as appropriate: 3110b41a30aaSmrg# GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes" 3111b41a30aaSmrg# GNU g++ - relies on AC_PROG_CXX to set GXX to "yes" 3112b41a30aaSmrg# clang compiler - sets CLANGCC to "yes" 3113b41a30aaSmrg# Intel compiler - sets INTELCC to "yes" 3114b41a30aaSmrg# Sun/Oracle Solaris Studio cc - sets SUNCC to "yes" 3115b41a30aaSmrg# 3116b41a30aaSmrgAC_DEFUN([XORG_COMPILER_BRAND], [ 3117b41a30aaSmrgAC_LANG_CASE( 3118b41a30aaSmrg [C], [ 311910f94802Smrg dnl autoconf-2.70 folded AC_PROG_CC_C99 into AC_PROG_CC 312010f94802Smrg dnl and complains that AC_PROG_CC_C99 is obsolete 312110f94802Smrg m4_version_prereq([2.70], 312210f94802Smrg [AC_REQUIRE([AC_PROG_CC])], 312310f94802Smrg [AC_REQUIRE([AC_PROG_CC_C99])]) 3124b41a30aaSmrg ], 3125b41a30aaSmrg [C++], [ 3126b41a30aaSmrg AC_REQUIRE([AC_PROG_CXX]) 3127b41a30aaSmrg ] 3128b41a30aaSmrg) 3129b41a30aaSmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"]) 3130b41a30aaSmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"]) 3131b41a30aaSmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) 3132b41a30aaSmrg]) # XORG_COMPILER_BRAND 3133a253d6aeSmrg 3134b41a30aaSmrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...]) 3135b41a30aaSmrg# --------------- 3136b41a30aaSmrg# Minimum version: 1.16.0 3137b41a30aaSmrg# 3138b41a30aaSmrg# Test if the compiler works when passed the given flag as a command line argument. 313910f94802Smrg# If it succeeds, the flag is appended to the given variable. If not, it tries the 3140b41a30aaSmrg# next flag in the list until there are no more options. 3141b41a30aaSmrg# 3142b41a30aaSmrg# Note that this does not guarantee that the compiler supports the flag as some 3143b41a30aaSmrg# compilers will simply ignore arguments that they do not understand, but we do 3144b41a30aaSmrg# attempt to weed out false positives by using -Werror=unknown-warning-option and 3145b41a30aaSmrg# -Werror=unused-command-line-argument 3146b41a30aaSmrg# 3147b41a30aaSmrgAC_DEFUN([XORG_TESTSET_CFLAG], [ 3148b41a30aaSmrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])]) 3149b41a30aaSmrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])]) 3150a253d6aeSmrg 3151b41a30aaSmrgAC_LANG_COMPILER_REQUIRE 3152a253d6aeSmrg 3153b41a30aaSmrgAC_LANG_CASE( 3154b41a30aaSmrg [C], [ 315510f94802Smrg dnl autoconf-2.70 folded AC_PROG_CC_C99 into AC_PROG_CC 315610f94802Smrg dnl and complains that AC_PROG_CC_C99 is obsolete 315710f94802Smrg m4_version_prereq([2.70], 315810f94802Smrg [AC_REQUIRE([AC_PROG_CC])], 315910f94802Smrg [AC_REQUIRE([AC_PROG_CC_C99])]) 3160b41a30aaSmrg define([PREFIX], [C]) 3161b41a30aaSmrg define([CACHE_PREFIX], [cc]) 3162b41a30aaSmrg define([COMPILER], [$CC]) 3163b41a30aaSmrg ], 3164b41a30aaSmrg [C++], [ 3165b41a30aaSmrg define([PREFIX], [CXX]) 3166b41a30aaSmrg define([CACHE_PREFIX], [cxx]) 3167b41a30aaSmrg define([COMPILER], [$CXX]) 3168b41a30aaSmrg ] 3169b41a30aaSmrg) 3170a253d6aeSmrg 3171b41a30aaSmrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]" 317225b89263Smrg 3173b41a30aaSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then 3174b41a30aaSmrg PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option" 3175b41a30aaSmrg AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option], 3176b41a30aaSmrg [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option], 3177b41a30aaSmrg AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])], 3178b41a30aaSmrg [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes], 3179b41a30aaSmrg [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no])) 3180b41a30aaSmrg [xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option] 3181b41a30aaSmrg PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]" 3182b41a30aaSmrgfi 318325b89263Smrg 3184b41a30aaSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then 3185b41a30aaSmrg if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then 3186b41a30aaSmrg PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option" 3187b41a30aaSmrg fi 3188b41a30aaSmrg PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument" 3189b41a30aaSmrg AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument], 3190b41a30aaSmrg [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument], 3191b41a30aaSmrg AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])], 3192b41a30aaSmrg [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes], 3193b41a30aaSmrg [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no])) 3194b41a30aaSmrg [xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument] 3195b41a30aaSmrg PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]" 3196b41a30aaSmrgfi 319725b89263Smrg 3198b41a30aaSmrgfound="no" 3199b41a30aaSmrgm4_foreach([flag], m4_cdr($@), [ 3200b41a30aaSmrg if test $found = "no" ; then 3201b41a30aaSmrg if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then 3202b41a30aaSmrg PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option" 3203b41a30aaSmrg fi 320425b89263Smrg 3205b41a30aaSmrg if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then 3206b41a30aaSmrg PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument" 3207b41a30aaSmrg fi 320825b89263Smrg 3209b41a30aaSmrg PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag[" 321057ee1794Smrg 3211b41a30aaSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname 3212b41a30aaSmrg AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[]) 3213b41a30aaSmrg cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[]) 3214b41a30aaSmrg AC_CACHE_VAL($cacheid, 3215b41a30aaSmrg [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])], 3216b41a30aaSmrg [eval $cacheid=yes], 3217b41a30aaSmrg [eval $cacheid=no])]) 321831637056Smrg 3219b41a30aaSmrg PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]" 322025b89263Smrg 3221b41a30aaSmrg eval supported=\$$cacheid 3222b41a30aaSmrg AC_MSG_RESULT([$supported]) 3223b41a30aaSmrg if test "$supported" = "yes" ; then 3224b41a30aaSmrg $1="$$1 ]flag[" 3225b41a30aaSmrg found="yes" 3226b41a30aaSmrg fi 3227b41a30aaSmrg fi 3228b41a30aaSmrg]) 3229b41a30aaSmrg]) # XORG_TESTSET_CFLAG 323025b89263Smrg 3231b41a30aaSmrg# XORG_COMPILER_FLAGS 3232b41a30aaSmrg# --------------- 3233b41a30aaSmrg# Minimum version: 1.16.0 3234b41a30aaSmrg# 3235b41a30aaSmrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line 3236b41a30aaSmrg# arguments supported by the selected compiler which do NOT alter the generated 3237b41a30aaSmrg# code. These arguments will cause the compiler to print various warnings 3238b41a30aaSmrg# during compilation AND turn a conservative set of warnings into errors. 3239b41a30aaSmrg# 3240b41a30aaSmrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in 3241b41a30aaSmrg# future versions of util-macros as options are added to new compilers. 3242b41a30aaSmrg# 3243b41a30aaSmrgAC_DEFUN([XORG_COMPILER_FLAGS], [ 3244b41a30aaSmrgAC_REQUIRE([XORG_COMPILER_BRAND]) 324525b89263Smrg 3246b41a30aaSmrgAC_ARG_ENABLE(selective-werror, 3247b41a30aaSmrg AS_HELP_STRING([--disable-selective-werror], 3248b41a30aaSmrg [Turn off selective compiler errors. (default: enabled)]), 3249b41a30aaSmrg [SELECTIVE_WERROR=$enableval], 3250b41a30aaSmrg [SELECTIVE_WERROR=yes]) 325125b89263Smrg 3252b41a30aaSmrgAC_LANG_CASE( 3253b41a30aaSmrg [C], [ 3254b41a30aaSmrg define([PREFIX], [C]) 3255b41a30aaSmrg ], 3256b41a30aaSmrg [C++], [ 3257b41a30aaSmrg define([PREFIX], [CXX]) 3258b41a30aaSmrg ] 3259b41a30aaSmrg) 3260b41a30aaSmrg# -v is too short to test reliably with XORG_TESTSET_CFLAG 3261b41a30aaSmrgif test "x$SUNCC" = "xyes"; then 3262b41a30aaSmrg [BASE_]PREFIX[FLAGS]="-v" 3263b41a30aaSmrgelse 3264b41a30aaSmrg [BASE_]PREFIX[FLAGS]="" 3265b41a30aaSmrgfi 326625b89263Smrg 3267b41a30aaSmrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS 3268b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall]) 3269b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith]) 3270b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations]) 3271b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat]) 327225b89263Smrg 3273b41a30aaSmrgAC_LANG_CASE( 3274b41a30aaSmrg [C], [ 3275b41a30aaSmrg XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes]) 3276b41a30aaSmrg XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes]) 3277b41a30aaSmrg XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs]) 3278b41a30aaSmrg XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast]) 3279b41a30aaSmrg XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd]) 3280b41a30aaSmrg XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement]) 3281b41a30aaSmrg ] 3282b41a30aaSmrg) 328325b89263Smrg 3284b41a30aaSmrg# This chunk adds additional warnings that could catch undesired effects. 3285b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused]) 3286b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized]) 3287b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow]) 3288b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn]) 3289b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute]) 3290b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls]) 3291b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op]) 329206f32fbeSmrg 3293b41a30aaSmrg# These are currently disabled because they are noisy. They will be enabled 3294b41a30aaSmrg# in the future once the codebase is sufficiently modernized to silence 3295b41a30aaSmrg# them. For now, I don't want them to drown out the other warnings. 3296b41a30aaSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses]) 3297b41a30aaSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align]) 3298b41a30aaSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual]) 329906f32fbeSmrg 330010f94802Smrg# Turn some warnings into errors, so we don't accidentally get successful builds 3301b41a30aaSmrg# when there are problems that should be fixed. 330225b89263Smrg 3303b41a30aaSmrgif test "x$SELECTIVE_WERROR" = "xyes" ; then 3304b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED]) 3305b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull]) 3306b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self]) 3307b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main]) 3308b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces]) 3309b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point]) 3310b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT]) 3311b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs]) 3312b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds]) 3313b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings]) 3314b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address]) 3315b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION]) 3316b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION 3317b41a30aaSmrgelse 3318b41a30aaSmrgAC_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]) 3319b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit]) 3320b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull]) 3321b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self]) 3322b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain]) 3323b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces]) 3324b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point]) 3325b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type]) 3326b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs]) 3327b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds]) 3328b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings]) 3329b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress]) 3330b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast]) 3331b41a30aaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast]) 3332b41a30aaSmrgfi 333325b89263Smrg 3334b41a30aaSmrgAC_SUBST([BASE_]PREFIX[FLAGS]) 3335b41a30aaSmrg]) # XORG_COMPILER_FLAGS 333625b89263Smrg 3337b41a30aaSmrg# XORG_CWARNFLAGS 3338b41a30aaSmrg# --------------- 3339b41a30aaSmrg# Minimum version: 1.2.0 3340b41a30aaSmrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead) 3341b41a30aaSmrg# 3342b41a30aaSmrg# Defines CWARNFLAGS to enable C compiler warnings. 3343b41a30aaSmrg# 3344b41a30aaSmrg# This function is deprecated because it defines -fno-strict-aliasing 3345b41a30aaSmrg# which alters the code generated by the compiler. If -fno-strict-aliasing 3346b41a30aaSmrg# is needed, then it should be added explicitly in the module when 3347b41a30aaSmrg# it is updated to use BASE_CFLAGS. 3348b41a30aaSmrg# 3349b41a30aaSmrgAC_DEFUN([XORG_CWARNFLAGS], [ 3350b41a30aaSmrgAC_REQUIRE([XORG_COMPILER_FLAGS]) 3351b41a30aaSmrgAC_REQUIRE([XORG_COMPILER_BRAND]) 3352b41a30aaSmrgAC_LANG_CASE( 3353b41a30aaSmrg [C], [ 3354b41a30aaSmrg CWARNFLAGS="$BASE_CFLAGS" 3355b41a30aaSmrg if test "x$GCC" = xyes ; then 3356b41a30aaSmrg CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing" 3357b41a30aaSmrg fi 3358b41a30aaSmrg AC_SUBST(CWARNFLAGS) 3359b41a30aaSmrg ] 3360b41a30aaSmrg) 3361b41a30aaSmrg]) # XORG_CWARNFLAGS 336225b89263Smrg 3363b41a30aaSmrg# XORG_STRICT_OPTION 3364b41a30aaSmrg# ----------------------- 3365b41a30aaSmrg# Minimum version: 1.3.0 3366b41a30aaSmrg# 3367b41a30aaSmrg# Add configure option to enable strict compilation flags, such as treating 3368b41a30aaSmrg# warnings as fatal errors. 3369b41a30aaSmrg# If --enable-strict-compilation is passed to configure, adds strict flags to 3370b41a30aaSmrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS. 3371b41a30aaSmrg# 3372b41a30aaSmrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or 3373b41a30aaSmrg# when strict compilation is unconditionally desired. 3374b41a30aaSmrgAC_DEFUN([XORG_STRICT_OPTION], [ 3375b41a30aaSmrgAC_REQUIRE([XORG_CWARNFLAGS]) 3376b41a30aaSmrgAC_REQUIRE([XORG_COMPILER_FLAGS]) 337725b89263Smrg 3378b41a30aaSmrgAC_ARG_ENABLE(strict-compilation, 3379b41a30aaSmrg AS_HELP_STRING([--enable-strict-compilation], 3380b41a30aaSmrg [Enable all warnings from compiler and make them errors (default: disabled)]), 3381b41a30aaSmrg [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no]) 338225b89263Smrg 3383b41a30aaSmrgAC_LANG_CASE( 3384b41a30aaSmrg [C], [ 3385b41a30aaSmrg define([PREFIX], [C]) 3386b41a30aaSmrg ], 3387b41a30aaSmrg [C++], [ 3388b41a30aaSmrg define([PREFIX], [CXX]) 3389b41a30aaSmrg ] 3390b41a30aaSmrg) 339106f32fbeSmrg 3392b41a30aaSmrg[STRICT_]PREFIX[FLAGS]="" 3393b41a30aaSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic]) 3394b41a30aaSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn]) 339525b89263Smrg 3396b41a30aaSmrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not 3397b41a30aaSmrg# activate it with -Werror, so we add it here explicitly. 3398b41a30aaSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes]) 339925b89263Smrg 3400b41a30aaSmrgif test "x$STRICT_COMPILE" = "xyes"; then 3401b41a30aaSmrg [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]" 3402b41a30aaSmrg AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"]) 3403b41a30aaSmrgfi 3404b41a30aaSmrgAC_SUBST([STRICT_]PREFIX[FLAGS]) 3405b41a30aaSmrgAC_SUBST([BASE_]PREFIX[FLAGS]) 3406b41a30aaSmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS])) 3407b41a30aaSmrg]) # XORG_STRICT_OPTION 340825b89263Smrg 340910f94802Smrg# XORG_DEFAULT_NOCODE_OPTIONS 341010f94802Smrg# --------------------------- 341110f94802Smrg# Minimum version: 1.20.0 341210f94802Smrg# 341310f94802Smrg# Defines default options for X.Org modules which don't compile code, 341410f94802Smrg# such as fonts, bitmaps, cursors, and docs. 341510f94802Smrg# 341610f94802SmrgAC_DEFUN([XORG_DEFAULT_NOCODE_OPTIONS], [ 341710f94802SmrgAC_REQUIRE([AC_PROG_INSTALL]) 341810f94802SmrgXORG_RELEASE_VERSION 341910f94802SmrgXORG_CHANGELOG 342010f94802SmrgXORG_INSTALL 342110f94802SmrgXORG_MANPAGE_SECTIONS 342210f94802Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], 342310f94802Smrg [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) 342410f94802Smrg]) # XORG_DEFAULT_NOCODE_OPTIONS 342510f94802Smrg 3426b41a30aaSmrg# XORG_DEFAULT_OPTIONS 3427b41a30aaSmrg# -------------------- 3428b41a30aaSmrg# Minimum version: 1.3.0 3429b41a30aaSmrg# 343010f94802Smrg# Defines default options for X.Org modules which compile code. 3431b41a30aaSmrg# 3432b41a30aaSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [ 3433b41a30aaSmrgAC_REQUIRE([AC_PROG_INSTALL]) 3434b41a30aaSmrgXORG_COMPILER_FLAGS 3435b41a30aaSmrgXORG_CWARNFLAGS 3436b41a30aaSmrgXORG_STRICT_OPTION 343710f94802SmrgXORG_DEFAULT_NOCODE_OPTIONS 3438b41a30aaSmrg]) # XORG_DEFAULT_OPTIONS 343931637056Smrg 3440b41a30aaSmrg# XORG_INSTALL() 3441b41a30aaSmrg# ---------------- 3442b41a30aaSmrg# Minimum version: 1.4.0 3443b41a30aaSmrg# 3444b41a30aaSmrg# Defines the variable INSTALL_CMD as the command to copy 3445b41a30aaSmrg# INSTALL from $prefix/share/util-macros. 3446b41a30aaSmrg# 3447b41a30aaSmrgAC_DEFUN([XORG_INSTALL], [ 3448b41a30aaSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG]) 3449b41a30aaSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` 3450b41a30aaSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ 3451b41a30aaSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ 3452b41a30aaSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; test -e \$(top_srcdir)/INSTALL || ( \ 3453b41a30aaSmrgtouch \$(top_srcdir)/INSTALL; \ 3454b41a30aaSmrgecho 'failed to copy INSTALL from util-macros: installing empty INSTALL.' >&2))" 3455b41a30aaSmrgAC_SUBST([INSTALL_CMD]) 3456b41a30aaSmrg]) # XORG_INSTALL 3457b41a30aaSmrgdnl Copyright 2005 Red Hat, Inc 3458b41a30aaSmrgdnl 3459b41a30aaSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its 3460b41a30aaSmrgdnl documentation for any purpose is hereby granted without fee, provided that 3461b41a30aaSmrgdnl the above copyright notice appear in all copies and that both that 3462b41a30aaSmrgdnl copyright notice and this permission notice appear in supporting 3463b41a30aaSmrgdnl documentation. 3464b41a30aaSmrgdnl 3465b41a30aaSmrgdnl The above copyright notice and this permission notice shall be included 3466b41a30aaSmrgdnl in all copies or substantial portions of the Software. 3467b41a30aaSmrgdnl 3468b41a30aaSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 3469b41a30aaSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 3470b41a30aaSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 3471b41a30aaSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 3472b41a30aaSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 3473b41a30aaSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 3474b41a30aaSmrgdnl OTHER DEALINGS IN THE SOFTWARE. 3475b41a30aaSmrgdnl 3476b41a30aaSmrgdnl Except as contained in this notice, the name of the copyright holders shall 3477b41a30aaSmrgdnl not be used in advertising or otherwise to promote the sale, use or 3478b41a30aaSmrgdnl other dealings in this Software without prior written authorization 3479b41a30aaSmrgdnl from the copyright holders. 3480b41a30aaSmrgdnl 348125b89263Smrg 3482b41a30aaSmrg# XORG_RELEASE_VERSION 3483b41a30aaSmrg# -------------------- 3484b41a30aaSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use. 348525b89263Smrg 3486b41a30aaSmrgAC_DEFUN([XORG_RELEASE_VERSION],[ 3487b41a30aaSmrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR], 3488b41a30aaSmrg [`echo $PACKAGE_VERSION | cut -d . -f 1`], 3489b41a30aaSmrg [Major version of this package]) 3490b41a30aaSmrg PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` 3491b41a30aaSmrg if test "x$PVM" = "x"; then 3492b41a30aaSmrg PVM="0" 3493b41a30aaSmrg fi 3494b41a30aaSmrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR], 3495b41a30aaSmrg [$PVM], 3496b41a30aaSmrg [Minor version of this package]) 3497b41a30aaSmrg PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` 3498b41a30aaSmrg if test "x$PVP" = "x"; then 3499b41a30aaSmrg PVP="0" 3500b41a30aaSmrg fi 3501b41a30aaSmrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL], 3502b41a30aaSmrg [$PVP], 3503b41a30aaSmrg [Patch version of this package]) 3504b41a30aaSmrg]) 3505a253d6aeSmrg 3506b41a30aaSmrg# XORG_CHANGELOG() 3507b41a30aaSmrg# ---------------- 3508b41a30aaSmrg# Minimum version: 1.2.0 3509b41a30aaSmrg# 3510b41a30aaSmrg# Defines the variable CHANGELOG_CMD as the command to generate 3511b41a30aaSmrg# ChangeLog from git. 3512b41a30aaSmrg# 3513b41a30aaSmrg# 3514b41a30aaSmrgAC_DEFUN([XORG_CHANGELOG], [ 3515b41a30aaSmrgCHANGELOG_CMD="((GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp) 2>/dev/null && \ 3516b41a30aaSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ 3517b41a30aaSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; test -e \$(top_srcdir)/ChangeLog || ( \ 3518b41a30aaSmrgtouch \$(top_srcdir)/ChangeLog; \ 3519b41a30aaSmrgecho 'git failed to create ChangeLog: installing empty ChangeLog.' >&2))" 3520b41a30aaSmrgAC_SUBST([CHANGELOG_CMD]) 3521b41a30aaSmrg]) # XORG_CHANGELOG 3522a253d6aeSmrg 352310f94802Smrgm4_include([m4/libtool.m4]) 352410f94802Smrgm4_include([m4/ltoptions.m4]) 352510f94802Smrgm4_include([m4/ltsugar.m4]) 352610f94802Smrgm4_include([m4/ltversion.m4]) 352710f94802Smrgm4_include([m4/lt~obsolete.m4]) 3528