1e4b60806Smrg# generated automatically by aclocal 1.16.5 -*- Autoconf -*- 2c3d5982aSmrg 3e4b60806Smrg# Copyright (C) 1996-2021 Free Software Foundation, Inc. 47da8b7e3Smrg 57da8b7e3Smrg# This file is free software; the Free Software Foundation 67da8b7e3Smrg# gives unlimited permission to copy and/or distribute it, 77da8b7e3Smrg# with or without modifications, as long as this notice is preserved. 87da8b7e3Smrg 97da8b7e3Smrg# This program is distributed in the hope that it will be useful, 107da8b7e3Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without 117da8b7e3Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A 127da8b7e3Smrg# PARTICULAR PURPOSE. 137da8b7e3Smrg 14c3d5982aSmrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) 15123e2cc7Smrgm4_ifndef([AC_AUTOCONF_VERSION], 16123e2cc7Smrg [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 17e4efb0bcSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.72],, 18e4efb0bcSmrg[m4_warning([this file was generated for autoconf 2.72. 19123e2cc7SmrgYou have another version of autoconf. It may work, but is not guaranteed to. 20123e2cc7SmrgIf you have problems, you may need to regenerate the build system entirely. 21c3d5982aSmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])]) 227da8b7e3Smrg 23e4b60806Smrg# Copyright (C) 2002-2021 Free Software Foundation, Inc. 24e4b60806Smrg# 25e4b60806Smrg# This file is free software; the Free Software Foundation 26e4b60806Smrg# gives unlimited permission to copy and/or distribute it, 27e4b60806Smrg# with or without modifications, as long as this notice is preserved. 28ff143803Smrg 29e4b60806Smrg# AM_AUTOMAKE_VERSION(VERSION) 30e4b60806Smrg# ---------------------------- 31e4b60806Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been 32e4b60806Smrg# generated from the m4 files accompanying Automake X.Y. 33e4b60806Smrg# (This private macro should not be called outside this file.) 34e4b60806SmrgAC_DEFUN([AM_AUTOMAKE_VERSION], 35e4b60806Smrg[am__api_version='1.16' 36e4b60806Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to 37e4b60806Smrgdnl require some minimum version. Point them to the right macro. 38e4b60806Smrgm4_if([$1], [1.16.5], [], 39e4b60806Smrg [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl 40e4b60806Smrg]) 41ff143803Smrg 42e4b60806Smrg# _AM_AUTOCONF_VERSION(VERSION) 43e4b60806Smrg# ----------------------------- 44e4b60806Smrg# aclocal traces this macro to find the Autoconf version. 45e4b60806Smrg# This is a private macro too. Using m4_define simplifies 46e4b60806Smrg# the logic in aclocal, which can simply ignore this definition. 47e4b60806Smrgm4_define([_AM_AUTOCONF_VERSION], []) 487da8b7e3Smrg 49e4b60806Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION 50e4b60806Smrg# ------------------------------- 51e4b60806Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. 52e4b60806Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. 53e4b60806SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 54e4b60806Smrg[AM_AUTOMAKE_VERSION([1.16.5])dnl 55e4b60806Smrgm4_ifndef([AC_AUTOCONF_VERSION], 56e4b60806Smrg [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 57e4b60806Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) 587da8b7e3Smrg 59e4b60806Smrg# AM_AUX_DIR_EXPAND -*- Autoconf -*- 60123e2cc7Smrg 61e4b60806Smrg# Copyright (C) 2001-2021 Free Software Foundation, Inc. 62e4b60806Smrg# 63e4b60806Smrg# This file is free software; the Free Software Foundation 64e4b60806Smrg# gives unlimited permission to copy and/or distribute it, 65e4b60806Smrg# with or without modifications, as long as this notice is preserved. 667da8b7e3Smrg 67e4b60806Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 68e4b60806Smrg# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to 69e4b60806Smrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'. 70e4b60806Smrg# 71e4b60806Smrg# Of course, Automake must honor this variable whenever it calls a 72e4b60806Smrg# tool from the auxiliary directory. The problem is that $srcdir (and 73e4b60806Smrg# therefore $ac_aux_dir as well) can be either absolute or relative, 74e4b60806Smrg# depending on how configure is run. This is pretty annoying, since 75e4b60806Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top 76e4b60806Smrg# source directory, any form will work fine, but in subdirectories a 77e4b60806Smrg# relative path needs to be adjusted first. 78e4b60806Smrg# 79e4b60806Smrg# $ac_aux_dir/missing 80e4b60806Smrg# fails when called from a subdirectory if $ac_aux_dir is relative 81e4b60806Smrg# $top_srcdir/$ac_aux_dir/missing 82e4b60806Smrg# fails if $ac_aux_dir is absolute, 83e4b60806Smrg# fails when called from a subdirectory in a VPATH build with 84e4b60806Smrg# a relative $ac_aux_dir 85e4b60806Smrg# 86e4b60806Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir 87e4b60806Smrg# are both prefixed by $srcdir. In an in-source build this is usually 88e4b60806Smrg# harmless because $srcdir is '.', but things will broke when you 89e4b60806Smrg# start a VPATH build or use an absolute $srcdir. 90e4b60806Smrg# 91e4b60806Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 92e4b60806Smrg# iff we strip the leading $srcdir from $ac_aux_dir. That would be: 93e4b60806Smrg# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 94e4b60806Smrg# and then we would define $MISSING as 95e4b60806Smrg# MISSING="\${SHELL} $am_aux_dir/missing" 96e4b60806Smrg# This will work as long as MISSING is not called from configure, because 97e4b60806Smrg# unfortunately $(top_srcdir) has no meaning in configure. 98e4b60806Smrg# However there are other variables, like CC, which are often used in 99e4b60806Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir. 100e4b60806Smrg# 101e4b60806Smrg# Another solution, used here, is to always expand $ac_aux_dir to an 102e4b60806Smrg# absolute PATH. The drawback is that using absolute paths prevent a 103e4b60806Smrg# configured tree to be moved without reconfiguration. 1047da8b7e3Smrg 105e4b60806SmrgAC_DEFUN([AM_AUX_DIR_EXPAND], 106e4b60806Smrg[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl 107e4b60806Smrg# Expand $ac_aux_dir to an absolute path. 108e4b60806Smrgam_aux_dir=`cd "$ac_aux_dir" && pwd` 109e4b60806Smrg]) 110123e2cc7Smrg 111e4b60806Smrg# AM_CONDITIONAL -*- Autoconf -*- 1127da8b7e3Smrg 113e4b60806Smrg# Copyright (C) 1997-2021 Free Software Foundation, Inc. 114e4b60806Smrg# 115e4b60806Smrg# This file is free software; the Free Software Foundation 116e4b60806Smrg# gives unlimited permission to copy and/or distribute it, 117e4b60806Smrg# with or without modifications, as long as this notice is preserved. 1187da8b7e3Smrg 119e4b60806Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION) 120e4b60806Smrg# ------------------------------------- 121e4b60806Smrg# Define a conditional. 122e4b60806SmrgAC_DEFUN([AM_CONDITIONAL], 123e4b60806Smrg[AC_PREREQ([2.52])dnl 124e4b60806Smrg m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 125e4b60806Smrg [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 126e4b60806SmrgAC_SUBST([$1_TRUE])dnl 127e4b60806SmrgAC_SUBST([$1_FALSE])dnl 128e4b60806Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl 129e4b60806Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl 130e4b60806Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl 131e4b60806Smrgif $2; then 132e4b60806Smrg $1_TRUE= 133e4b60806Smrg $1_FALSE='#' 134e4b60806Smrgelse 135e4b60806Smrg $1_TRUE='#' 136e4b60806Smrg $1_FALSE= 137e4b60806Smrgfi 138e4b60806SmrgAC_CONFIG_COMMANDS_PRE( 139e4b60806Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 140e4b60806Smrg AC_MSG_ERROR([[conditional "$1" was never defined. 141e4b60806SmrgUsually this means the macro was only invoked conditionally.]]) 142e4b60806Smrgfi])]) 1437da8b7e3Smrg 144e4b60806Smrg# Copyright (C) 1999-2021 Free Software Foundation, Inc. 145e4b60806Smrg# 146e4b60806Smrg# This file is free software; the Free Software Foundation 147e4b60806Smrg# gives unlimited permission to copy and/or distribute it, 148e4b60806Smrg# with or without modifications, as long as this notice is preserved. 1497da8b7e3Smrg 1507da8b7e3Smrg 151e4b60806Smrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be 152e4b60806Smrg# written in clear, in which case automake, when reading aclocal.m4, 153e4b60806Smrg# will think it sees a *use*, and therefore will trigger all it's 154e4b60806Smrg# C support machinery. Also note that it means that autoscan, seeing 155e4b60806Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use... 1567da8b7e3Smrg 1577da8b7e3Smrg 158e4b60806Smrg# _AM_DEPENDENCIES(NAME) 159e4b60806Smrg# ---------------------- 160e4b60806Smrg# See how the compiler implements dependency checking. 161e4b60806Smrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". 162e4b60806Smrg# We try a few techniques and use that to set a single cache variable. 163e4b60806Smrg# 164e4b60806Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was 165e4b60806Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular 166e4b60806Smrg# dependency, and given that the user is not expected to run this macro, 167e4b60806Smrg# just rely on AC_PROG_CC. 168e4b60806SmrgAC_DEFUN([_AM_DEPENDENCIES], 169e4b60806Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl 170e4b60806SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl 171e4b60806SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl 172e4b60806SmrgAC_REQUIRE([AM_DEP_TRACK])dnl 1737da8b7e3Smrg 174e4b60806Smrgm4_if([$1], [CC], [depcc="$CC" am_compiler_list=], 175e4b60806Smrg [$1], [CXX], [depcc="$CXX" am_compiler_list=], 176e4b60806Smrg [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 177e4b60806Smrg [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], 178e4b60806Smrg [$1], [UPC], [depcc="$UPC" am_compiler_list=], 179e4b60806Smrg [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 180e4b60806Smrg [depcc="$$1" am_compiler_list=]) 1817da8b7e3Smrg 182e4b60806SmrgAC_CACHE_CHECK([dependency style of $depcc], 183e4b60806Smrg [am_cv_$1_dependencies_compiler_type], 184e4b60806Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then 185e4b60806Smrg # We make a subdir and do the tests there. Otherwise we can end up 186e4b60806Smrg # making bogus files that we don't know about and never remove. For 187e4b60806Smrg # instance it was reported that on HP-UX the gcc test will end up 188e4b60806Smrg # making a dummy file named 'D' -- because '-MD' means "put the output 189e4b60806Smrg # in D". 190e4b60806Smrg rm -rf conftest.dir 191e4b60806Smrg mkdir conftest.dir 192e4b60806Smrg # Copy depcomp to subdir because otherwise we won't find it if we're 193e4b60806Smrg # using a relative directory. 194e4b60806Smrg cp "$am_depcomp" conftest.dir 195e4b60806Smrg cd conftest.dir 196e4b60806Smrg # We will build objects and dependencies in a subdirectory because 197e4b60806Smrg # it helps to detect inapplicable dependency modes. For instance 198e4b60806Smrg # both Tru64's cc and ICC support -MD to output dependencies as a 199e4b60806Smrg # side effect of compilation, but ICC will put the dependencies in 200e4b60806Smrg # the current directory while Tru64 will put them in the object 201e4b60806Smrg # directory. 202e4b60806Smrg mkdir sub 2037da8b7e3Smrg 204e4b60806Smrg am_cv_$1_dependencies_compiler_type=none 205e4b60806Smrg if test "$am_compiler_list" = ""; then 206e4b60806Smrg am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` 207e4b60806Smrg fi 208e4b60806Smrg am__universal=false 209e4b60806Smrg m4_case([$1], [CC], 210e4b60806Smrg [case " $depcc " in #( 211e4b60806Smrg *\ -arch\ *\ -arch\ *) am__universal=true ;; 212e4b60806Smrg esac], 213e4b60806Smrg [CXX], 214e4b60806Smrg [case " $depcc " in #( 215e4b60806Smrg *\ -arch\ *\ -arch\ *) am__universal=true ;; 216e4b60806Smrg esac]) 2177da8b7e3Smrg 218e4b60806Smrg for depmode in $am_compiler_list; do 219e4b60806Smrg # Setup a source with many dependencies, because some compilers 220e4b60806Smrg # like to wrap large dependency lists on column 80 (with \), and 221e4b60806Smrg # we should not choose a depcomp mode which is confused by this. 222e4b60806Smrg # 223e4b60806Smrg # We need to recreate these files for each test, as the compiler may 224e4b60806Smrg # overwrite some of them when testing with obscure command lines. 225e4b60806Smrg # This happens at least with the AIX C compiler. 226e4b60806Smrg : > sub/conftest.c 227e4b60806Smrg for i in 1 2 3 4 5 6; do 228e4b60806Smrg echo '#include "conftst'$i'.h"' >> sub/conftest.c 229e4b60806Smrg # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with 230e4b60806Smrg # Solaris 10 /bin/sh. 231e4b60806Smrg echo '/* dummy */' > sub/conftst$i.h 232e4b60806Smrg done 233e4b60806Smrg echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 2347da8b7e3Smrg 235e4b60806Smrg # We check with '-c' and '-o' for the sake of the "dashmstdout" 236e4b60806Smrg # mode. It turns out that the SunPro C++ compiler does not properly 237e4b60806Smrg # handle '-M -o', and we need to detect this. Also, some Intel 238e4b60806Smrg # versions had trouble with output in subdirs. 239e4b60806Smrg am__obj=sub/conftest.${OBJEXT-o} 240e4b60806Smrg am__minus_obj="-o $am__obj" 241e4b60806Smrg case $depmode in 242e4b60806Smrg gcc) 243e4b60806Smrg # This depmode causes a compiler race in universal mode. 244e4b60806Smrg test "$am__universal" = false || continue 245e4b60806Smrg ;; 246e4b60806Smrg nosideeffect) 247e4b60806Smrg # After this tag, mechanisms are not by side-effect, so they'll 248e4b60806Smrg # only be used when explicitly requested. 249e4b60806Smrg if test "x$enable_dependency_tracking" = xyes; then 250e4b60806Smrg continue 251e4b60806Smrg else 252e4b60806Smrg break 253e4b60806Smrg fi 254e4b60806Smrg ;; 255e4b60806Smrg msvc7 | msvc7msys | msvisualcpp | msvcmsys) 256e4b60806Smrg # This compiler won't grok '-c -o', but also, the minuso test has 257e4b60806Smrg # not run yet. These depmodes are late enough in the game, and 258e4b60806Smrg # so weak that their functioning should not be impacted. 259e4b60806Smrg am__obj=conftest.${OBJEXT-o} 260e4b60806Smrg am__minus_obj= 261e4b60806Smrg ;; 262e4b60806Smrg none) break ;; 263e4b60806Smrg esac 264e4b60806Smrg if depmode=$depmode \ 265e4b60806Smrg source=sub/conftest.c object=$am__obj \ 266e4b60806Smrg depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ 267e4b60806Smrg $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ 268e4b60806Smrg >/dev/null 2>conftest.err && 269e4b60806Smrg grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 270e4b60806Smrg grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && 271e4b60806Smrg grep $am__obj sub/conftest.Po > /dev/null 2>&1 && 272e4b60806Smrg ${MAKE-make} -s -f confmf > /dev/null 2>&1; then 273e4b60806Smrg # icc doesn't choke on unknown options, it will just issue warnings 274e4b60806Smrg # or remarks (even with -Werror). So we grep stderr for any message 275e4b60806Smrg # that says an option was ignored or not supported. 276e4b60806Smrg # When given -MP, icc 7.0 and 7.1 complain thusly: 277e4b60806Smrg # icc: Command line warning: ignoring option '-M'; no argument required 278e4b60806Smrg # The diagnosis changed in icc 8.0: 279e4b60806Smrg # icc: Command line remark: option '-MP' not supported 280e4b60806Smrg if (grep 'ignoring option' conftest.err || 281e4b60806Smrg grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else 282e4b60806Smrg am_cv_$1_dependencies_compiler_type=$depmode 283e4b60806Smrg break 284e4b60806Smrg fi 285e4b60806Smrg fi 286e4b60806Smrg done 2877da8b7e3Smrg 288e4b60806Smrg cd .. 289e4b60806Smrg rm -rf conftest.dir 290e4b60806Smrgelse 291e4b60806Smrg am_cv_$1_dependencies_compiler_type=none 292e4b60806Smrgfi 293e4b60806Smrg]) 294e4b60806SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) 295e4b60806SmrgAM_CONDITIONAL([am__fastdep$1], [ 296e4b60806Smrg test "x$enable_dependency_tracking" != xno \ 297e4b60806Smrg && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) 298e4b60806Smrg]) 299123e2cc7Smrg 300ff143803Smrg 301e4b60806Smrg# AM_SET_DEPDIR 302e4b60806Smrg# ------------- 303e4b60806Smrg# Choose a directory name for dependency files. 304e4b60806Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES. 305e4b60806SmrgAC_DEFUN([AM_SET_DEPDIR], 306e4b60806Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl 307e4b60806SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl 308e4b60806Smrg]) 309ff143803Smrg 310ff143803Smrg 311e4b60806Smrg# AM_DEP_TRACK 312e4b60806Smrg# ------------ 313e4b60806SmrgAC_DEFUN([AM_DEP_TRACK], 314e4b60806Smrg[AC_ARG_ENABLE([dependency-tracking], [dnl 315e4b60806SmrgAS_HELP_STRING( 316e4b60806Smrg [--enable-dependency-tracking], 317e4b60806Smrg [do not reject slow dependency extractors]) 318e4b60806SmrgAS_HELP_STRING( 319e4b60806Smrg [--disable-dependency-tracking], 320e4b60806Smrg [speeds up one-time build])]) 321e4b60806Smrgif test "x$enable_dependency_tracking" != xno; then 322e4b60806Smrg am_depcomp="$ac_aux_dir/depcomp" 323e4b60806Smrg AMDEPBACKSLASH='\' 324e4b60806Smrg am__nodep='_no' 325e4b60806Smrgfi 326e4b60806SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) 327e4b60806SmrgAC_SUBST([AMDEPBACKSLASH])dnl 328e4b60806Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl 329e4b60806SmrgAC_SUBST([am__nodep])dnl 330e4b60806Smrg_AM_SUBST_NOTMAKE([am__nodep])dnl 331e4b60806Smrg]) 332ff143803Smrg 333e4b60806Smrg# Generate code to set up dependency tracking. -*- Autoconf -*- 334ff143803Smrg 335e4b60806Smrg# Copyright (C) 1999-2021 Free Software Foundation, Inc. 336ff143803Smrg# 337e4b60806Smrg# This file is free software; the Free Software Foundation 338e4b60806Smrg# gives unlimited permission to copy and/or distribute it, 339e4b60806Smrg# with or without modifications, as long as this notice is preserved. 340ff143803Smrg 341e4b60806Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS 342e4b60806Smrg# ------------------------------ 343e4b60806SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], 344e4b60806Smrg[{ 345e4b60806Smrg # Older Autoconf quotes --file arguments for eval, but not when files 346e4b60806Smrg # are listed without --file. Let's play safe and only enable the eval 347e4b60806Smrg # if we detect the quoting. 348e4b60806Smrg # TODO: see whether this extra hack can be removed once we start 349e4b60806Smrg # requiring Autoconf 2.70 or later. 350e4b60806Smrg AS_CASE([$CONFIG_FILES], 351e4b60806Smrg [*\'*], [eval set x "$CONFIG_FILES"], 352e4b60806Smrg [*], [set x $CONFIG_FILES]) 353e4b60806Smrg shift 354e4b60806Smrg # Used to flag and report bootstrapping failures. 355e4b60806Smrg am_rc=0 356e4b60806Smrg for am_mf 357e4b60806Smrg do 358e4b60806Smrg # Strip MF so we end up with the name of the file. 359e4b60806Smrg am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` 360e4b60806Smrg # Check whether this is an Automake generated Makefile which includes 361e4b60806Smrg # dependency-tracking related rules and includes. 362e4b60806Smrg # Grep'ing the whole file directly is not great: AIX grep has a line 363e4b60806Smrg # limit of 2048, but all sed's we know have understand at least 4000. 364e4b60806Smrg sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ 365e4b60806Smrg || continue 366e4b60806Smrg am_dirpart=`AS_DIRNAME(["$am_mf"])` 367e4b60806Smrg am_filepart=`AS_BASENAME(["$am_mf"])` 368e4b60806Smrg AM_RUN_LOG([cd "$am_dirpart" \ 369e4b60806Smrg && sed -e '/# am--include-marker/d' "$am_filepart" \ 370e4b60806Smrg | $MAKE -f - am--depfiles]) || am_rc=$? 371e4b60806Smrg done 372e4b60806Smrg if test $am_rc -ne 0; then 373e4b60806Smrg AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments 374e4b60806Smrg for automatic dependency tracking. If GNU make was not used, consider 375e4b60806Smrg re-running the configure script with MAKE="gmake" (or whatever is 376e4b60806Smrg necessary). You can also try re-running configure with the 377e4b60806Smrg '--disable-dependency-tracking' option to at least be able to build 378e4b60806Smrg the package (albeit without support for automatic dependency tracking).]) 379e4b60806Smrg fi 380e4b60806Smrg AS_UNSET([am_dirpart]) 381e4b60806Smrg AS_UNSET([am_filepart]) 382e4b60806Smrg AS_UNSET([am_mf]) 383e4b60806Smrg AS_UNSET([am_rc]) 384e4b60806Smrg rm -f conftest-deps.mk 385e4b60806Smrg} 386e4b60806Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS 3877da8b7e3Smrg 3887da8b7e3Smrg 389e4b60806Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS 390e4b60806Smrg# ----------------------------- 391e4b60806Smrg# This macro should only be invoked once -- use via AC_REQUIRE. 392ff143803Smrg# 393e4b60806Smrg# This code is only required when automatic dependency tracking is enabled. 394e4b60806Smrg# This creates each '.Po' and '.Plo' makefile fragment that we'll need in 395e4b60806Smrg# order to bootstrap the dependency handling code. 396e4b60806SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], 397e4b60806Smrg[AC_CONFIG_COMMANDS([depfiles], 398e4b60806Smrg [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], 399e4b60806Smrg [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) 4007da8b7e3Smrg 401e4b60806Smrg# Do all the work for Automake. -*- Autoconf -*- 4027da8b7e3Smrg 403e4b60806Smrg# Copyright (C) 1996-2021 Free Software Foundation, Inc. 404e4b60806Smrg# 405e4b60806Smrg# This file is free software; the Free Software Foundation 406e4b60806Smrg# gives unlimited permission to copy and/or distribute it, 407e4b60806Smrg# with or without modifications, as long as this notice is preserved. 4087da8b7e3Smrg 409e4b60806Smrg# This macro actually does too much. Some checks are only needed if 410e4b60806Smrg# your package does certain things. But this isn't really a big deal. 411123e2cc7Smrg 412e4b60806Smrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. 413e4b60806Smrgm4_define([AC_PROG_CC], 414e4b60806Smrgm4_defn([AC_PROG_CC]) 415e4b60806Smrg[_AM_PROG_CC_C_O 416e4b60806Smrg]) 417123e2cc7Smrg 418e4b60806Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 419e4b60806Smrg# AM_INIT_AUTOMAKE([OPTIONS]) 420e4b60806Smrg# ----------------------------------------------- 421e4b60806Smrg# The call with PACKAGE and VERSION arguments is the old style 422e4b60806Smrg# call (pre autoconf-2.50), which is being phased out. PACKAGE 423e4b60806Smrg# and VERSION should now be passed to AC_INIT and removed from 424e4b60806Smrg# the call to AM_INIT_AUTOMAKE. 425e4b60806Smrg# We support both call styles for the transition. After 426e4b60806Smrg# the next Automake release, Autoconf can make the AC_INIT 427e4b60806Smrg# arguments mandatory, and then we can depend on a new Autoconf 428e4b60806Smrg# release and drop the old call support. 429e4b60806SmrgAC_DEFUN([AM_INIT_AUTOMAKE], 430e4b60806Smrg[AC_PREREQ([2.65])dnl 431e4b60806Smrgm4_ifdef([_$0_ALREADY_INIT], 432e4b60806Smrg [m4_fatal([$0 expanded multiple times 433e4b60806Smrg]m4_defn([_$0_ALREADY_INIT]))], 434e4b60806Smrg [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl 435e4b60806Smrgdnl Autoconf wants to disallow AM_ names. We explicitly allow 436e4b60806Smrgdnl the ones we care about. 437e4b60806Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 438e4b60806SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 439e4b60806SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl 440e4b60806Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then 441e4b60806Smrg # Use -I$(srcdir) only when $(srcdir) != ., so that make's output 442e4b60806Smrg # is not polluted with repeated "-I." 443e4b60806Smrg AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl 444e4b60806Smrg # test to see if srcdir already configured 445e4b60806Smrg if test -f $srcdir/config.status; then 446e4b60806Smrg AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 447e4b60806Smrg fi 448ff143803Smrgfi 449123e2cc7Smrg 450e4b60806Smrg# test whether we have cygpath 451e4b60806Smrgif test -z "$CYGPATH_W"; then 452e4b60806Smrg if (cygpath --version) >/dev/null 2>/dev/null; then 453e4b60806Smrg CYGPATH_W='cygpath -w' 454e4b60806Smrg else 455e4b60806Smrg CYGPATH_W=echo 456e4b60806Smrg fi 457ff143803Smrgfi 458e4b60806SmrgAC_SUBST([CYGPATH_W]) 459123e2cc7Smrg 460e4b60806Smrg# Define the identity of the package. 461e4b60806Smrgdnl Distinguish between old-style and new-style calls. 462e4b60806Smrgm4_ifval([$2], 463e4b60806Smrg[AC_DIAGNOSE([obsolete], 464e4b60806Smrg [$0: two- and three-arguments forms are deprecated.]) 465e4b60806Smrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 466e4b60806Smrg AC_SUBST([PACKAGE], [$1])dnl 467e4b60806Smrg AC_SUBST([VERSION], [$2])], 468e4b60806Smrg[_AM_SET_OPTIONS([$1])dnl 469e4b60806Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. 470e4b60806Smrgm4_if( 471e4b60806Smrg m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), 472e4b60806Smrg [ok:ok],, 473e4b60806Smrg [m4_fatal([AC_INIT should be called with package and version arguments])])dnl 474e4b60806Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl 475e4b60806Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl 476123e2cc7Smrg 477e4b60806Smrg_AM_IF_OPTION([no-define],, 478e4b60806Smrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) 479e4b60806Smrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl 480123e2cc7Smrg 481e4b60806Smrg# Some tools Automake needs. 482e4b60806SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl 483e4b60806SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl 484e4b60806SmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) 485e4b60806SmrgAM_MISSING_PROG([AUTOCONF], [autoconf]) 486e4b60806SmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) 487e4b60806SmrgAM_MISSING_PROG([AUTOHEADER], [autoheader]) 488e4b60806SmrgAM_MISSING_PROG([MAKEINFO], [makeinfo]) 489e4b60806SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl 490e4b60806SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl 491e4b60806SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl 492e4b60806Smrg# For better backward compatibility. To be removed once Automake 1.9.x 493e4b60806Smrg# dies out for good. For more background, see: 494e4b60806Smrg# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> 495e4b60806Smrg# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> 496e4b60806SmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)']) 497e4b60806Smrg# We need awk for the "check" target (and possibly the TAP driver). The 498e4b60806Smrg# system "awk" is bad on some platforms. 499e4b60806SmrgAC_REQUIRE([AC_PROG_AWK])dnl 500e4b60806SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl 501e4b60806SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl 502e4b60806Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], 503e4b60806Smrg [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], 504e4b60806Smrg [_AM_PROG_TAR([v7])])]) 505e4b60806Smrg_AM_IF_OPTION([no-dependencies],, 506e4b60806Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC], 507e4b60806Smrg [_AM_DEPENDENCIES([CC])], 508e4b60806Smrg [m4_define([AC_PROG_CC], 509e4b60806Smrg m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl 510e4b60806SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX], 511e4b60806Smrg [_AM_DEPENDENCIES([CXX])], 512e4b60806Smrg [m4_define([AC_PROG_CXX], 513e4b60806Smrg m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl 514e4b60806SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC], 515e4b60806Smrg [_AM_DEPENDENCIES([OBJC])], 516e4b60806Smrg [m4_define([AC_PROG_OBJC], 517e4b60806Smrg m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl 518e4b60806SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX], 519e4b60806Smrg [_AM_DEPENDENCIES([OBJCXX])], 520e4b60806Smrg [m4_define([AC_PROG_OBJCXX], 521e4b60806Smrg m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl 522e4b60806Smrg]) 523e4b60806Smrg# Variables for tags utilities; see am/tags.am 524e4b60806Smrgif test -z "$CTAGS"; then 525e4b60806Smrg CTAGS=ctags 526e4b60806Smrgfi 527e4b60806SmrgAC_SUBST([CTAGS]) 528e4b60806Smrgif test -z "$ETAGS"; then 529e4b60806Smrg ETAGS=etags 530e4b60806Smrgfi 531e4b60806SmrgAC_SUBST([ETAGS]) 532e4b60806Smrgif test -z "$CSCOPE"; then 533e4b60806Smrg CSCOPE=cscope 534e4b60806Smrgfi 535e4b60806SmrgAC_SUBST([CSCOPE]) 536123e2cc7Smrg 537e4b60806SmrgAC_REQUIRE([AM_SILENT_RULES])dnl 538e4b60806Smrgdnl The testsuite driver may need to know about EXEEXT, so add the 539e4b60806Smrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This 540e4b60806Smrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. 541e4b60806SmrgAC_CONFIG_COMMANDS_PRE(dnl 542e4b60806Smrg[m4_provide_if([_AM_COMPILER_EXEEXT], 543e4b60806Smrg [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl 544123e2cc7Smrg 545e4b60806Smrg# POSIX will say in a future version that running "rm -f" with no argument 546e4b60806Smrg# is OK; and we want to be able to make that assumption in our Makefile 547e4b60806Smrg# recipes. So use an aggressive probe to check that the usage we want is 548e4b60806Smrg# actually supported "in the wild" to an acceptable degree. 549e4b60806Smrg# See automake bug#10828. 550e4b60806Smrg# To make any issue more visible, cause the running configure to be aborted 551e4b60806Smrg# by default if the 'rm' program in use doesn't match our expectations; the 552e4b60806Smrg# user can still override this though. 553e4b60806Smrgif rm -f && rm -fr && rm -rf; then : OK; else 554e4b60806Smrg cat >&2 <<'END' 555e4b60806SmrgOops! 5567da8b7e3Smrg 557e4b60806SmrgYour 'rm' program seems unable to run without file operands specified 558e4b60806Smrgon the command line, even when the '-f' option is present. This is contrary 559e4b60806Smrgto the behaviour of most rm programs out there, and not conforming with 560e4b60806Smrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542> 561123e2cc7Smrg 562e4b60806SmrgPlease tell bug-automake@gnu.org about your system, including the value 563e4b60806Smrgof your $PATH and any error possibly output before this message. This 564e4b60806Smrgcan help us improve future automake versions. 565123e2cc7Smrg 566e4b60806SmrgEND 567e4b60806Smrg if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then 568e4b60806Smrg echo 'Configuration will proceed anyway, since you have set the' >&2 569e4b60806Smrg echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 570e4b60806Smrg echo >&2 571e4b60806Smrg else 572e4b60806Smrg cat >&2 <<'END' 573e4b60806SmrgAborting the configuration process, to ensure you take notice of the issue. 574123e2cc7Smrg 575e4b60806SmrgYou can download and install GNU coreutils to get an 'rm' implementation 576e4b60806Smrgthat behaves properly: <https://www.gnu.org/software/coreutils/>. 577123e2cc7Smrg 578e4b60806SmrgIf you want to complete the configuration process using your problematic 579e4b60806Smrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM 580e4b60806Smrgto "yes", and re-run configure. 581123e2cc7Smrg 582e4b60806SmrgEND 583e4b60806Smrg AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) 584e4b60806Smrg fi 585ff143803Smrgfi 586e4b60806Smrgdnl The trailing newline in this macro's definition is deliberate, for 587e4b60806Smrgdnl backward compatibility and to allow trailing 'dnl'-style comments 588e4b60806Smrgdnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. 589e4b60806Smrg]) 590123e2cc7Smrg 591e4b60806Smrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not 592e4b60806Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further 593e4b60806Smrgdnl mangled by Autoconf and run in a shell conditional statement. 594e4b60806Smrgm4_define([_AC_COMPILER_EXEEXT], 595e4b60806Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) 596123e2cc7Smrg 597e4b60806Smrg# When config.status generates a header, we must update the stamp-h file. 598e4b60806Smrg# This file resides in the same directory as the config header 599e4b60806Smrg# that is generated. The stamp files are numbered to have different names. 6007da8b7e3Smrg 601e4b60806Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 602e4b60806Smrg# loop where config.status creates the headers, so we can generate 603e4b60806Smrg# our stamp files there. 604e4b60806SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 605e4b60806Smrg[# Compute $1's index in $config_headers. 606e4b60806Smrg_am_arg=$1 607e4b60806Smrg_am_stamp_count=1 608e4b60806Smrgfor _am_header in $config_headers :; do 609e4b60806Smrg case $_am_header in 610e4b60806Smrg $_am_arg | $_am_arg:* ) 611e4b60806Smrg break ;; 612e4b60806Smrg * ) 613e4b60806Smrg _am_stamp_count=`expr $_am_stamp_count + 1` ;; 614e4b60806Smrg esac 615e4b60806Smrgdone 616e4b60806Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) 617123e2cc7Smrg 618e4b60806Smrg# Copyright (C) 2001-2021 Free Software Foundation, Inc. 619e4b60806Smrg# 620e4b60806Smrg# This file is free software; the Free Software Foundation 621e4b60806Smrg# gives unlimited permission to copy and/or distribute it, 622e4b60806Smrg# with or without modifications, as long as this notice is preserved. 623e4b60806Smrg 624e4b60806Smrg# AM_PROG_INSTALL_SH 625e4b60806Smrg# ------------------ 626e4b60806Smrg# Define $install_sh. 627e4b60806SmrgAC_DEFUN([AM_PROG_INSTALL_SH], 628e4b60806Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 629e4b60806Smrgif test x"${install_sh+set}" != xset; then 630e4b60806Smrg case $am_aux_dir in 631e4b60806Smrg *\ * | *\ *) 632e4b60806Smrg install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; 633e4b60806Smrg *) 634e4b60806Smrg install_sh="\${SHELL} $am_aux_dir/install-sh" 635e4b60806Smrg esac 636e4b60806Smrgfi 637e4b60806SmrgAC_SUBST([install_sh])]) 638e4b60806Smrg 639e4b60806Smrg# Copyright (C) 2003-2021 Free Software Foundation, Inc. 640e4b60806Smrg# 641e4b60806Smrg# This file is free software; the Free Software Foundation 642e4b60806Smrg# gives unlimited permission to copy and/or distribute it, 643e4b60806Smrg# with or without modifications, as long as this notice is preserved. 644e4b60806Smrg 645e4b60806Smrg# Check whether the underlying file-system supports filenames 646e4b60806Smrg# with a leading dot. For instance MS-DOS doesn't. 647e4b60806SmrgAC_DEFUN([AM_SET_LEADING_DOT], 648e4b60806Smrg[rm -rf .tst 2>/dev/null 649e4b60806Smrgmkdir .tst 2>/dev/null 650e4b60806Smrgif test -d .tst; then 651e4b60806Smrg am__leading_dot=. 652123e2cc7Smrgelse 653e4b60806Smrg am__leading_dot=_ 6547da8b7e3Smrgfi 655e4b60806Smrgrmdir .tst 2>/dev/null 656e4b60806SmrgAC_SUBST([am__leading_dot])]) 657123e2cc7Smrg 658e4b60806Smrg# Check to see how 'make' treats includes. -*- Autoconf -*- 659123e2cc7Smrg 660e4b60806Smrg# Copyright (C) 2001-2021 Free Software Foundation, Inc. 661e4b60806Smrg# 662e4b60806Smrg# This file is free software; the Free Software Foundation 663e4b60806Smrg# gives unlimited permission to copy and/or distribute it, 664e4b60806Smrg# with or without modifications, as long as this notice is preserved. 665123e2cc7Smrg 666e4b60806Smrg# AM_MAKE_INCLUDE() 667e4b60806Smrg# ----------------- 668e4b60806Smrg# Check whether make has an 'include' directive that can support all 669e4b60806Smrg# the idioms we need for our automatic dependency tracking code. 670e4b60806SmrgAC_DEFUN([AM_MAKE_INCLUDE], 671e4b60806Smrg[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) 672e4b60806Smrgcat > confinc.mk << 'END' 673e4b60806Smrgam__doit: 674e4b60806Smrg @echo this is the am__doit target >confinc.out 675e4b60806Smrg.PHONY: am__doit 676e4b60806SmrgEND 677e4b60806Smrgam__include="#" 678e4b60806Smrgam__quote= 679e4b60806Smrg# BSD make does it like this. 680e4b60806Smrgecho '.include "confinc.mk" # ignored' > confmf.BSD 681e4b60806Smrg# Other make implementations (GNU, Solaris 10, AIX) do it like this. 682e4b60806Smrgecho 'include confinc.mk # ignored' > confmf.GNU 683e4b60806Smrg_am_result=no 684e4b60806Smrgfor s in GNU BSD; do 685e4b60806Smrg AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) 686e4b60806Smrg AS_CASE([$?:`cat confinc.out 2>/dev/null`], 687e4b60806Smrg ['0:this is the am__doit target'], 688e4b60806Smrg [AS_CASE([$s], 689e4b60806Smrg [BSD], [am__include='.include' am__quote='"'], 690e4b60806Smrg [am__include='include' am__quote=''])]) 691e4b60806Smrg if test "$am__include" != "#"; then 692e4b60806Smrg _am_result="yes ($s style)" 693e4b60806Smrg break 694e4b60806Smrg fi 695e4b60806Smrgdone 696e4b60806Smrgrm -f confinc.* confmf.* 697e4b60806SmrgAC_MSG_RESULT([${_am_result}]) 698e4b60806SmrgAC_SUBST([am__include])]) 699e4b60806SmrgAC_SUBST([am__quote])]) 700123e2cc7Smrg 701e4b60806Smrg# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- 702123e2cc7Smrg 703e4b60806Smrg# Copyright (C) 1997-2021 Free Software Foundation, Inc. 704123e2cc7Smrg# 705e4b60806Smrg# This file is free software; the Free Software Foundation 706e4b60806Smrg# gives unlimited permission to copy and/or distribute it, 707e4b60806Smrg# with or without modifications, as long as this notice is preserved. 708123e2cc7Smrg 709e4b60806Smrg# AM_MISSING_PROG(NAME, PROGRAM) 710e4b60806Smrg# ------------------------------ 711e4b60806SmrgAC_DEFUN([AM_MISSING_PROG], 712e4b60806Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN]) 713e4b60806Smrg$1=${$1-"${am_missing_run}$2"} 714e4b60806SmrgAC_SUBST($1)]) 715123e2cc7Smrg 716e4b60806Smrg# AM_MISSING_HAS_RUN 717e4b60806Smrg# ------------------ 718e4b60806Smrg# Define MISSING if not defined so far and test if it is modern enough. 719e4b60806Smrg# If it is, set am_missing_run to use it, otherwise, to nothing. 720e4b60806SmrgAC_DEFUN([AM_MISSING_HAS_RUN], 721e4b60806Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 722e4b60806SmrgAC_REQUIRE_AUX_FILE([missing])dnl 723e4b60806Smrgif test x"${MISSING+set}" != xset; then 724e4b60806Smrg MISSING="\${SHELL} '$am_aux_dir/missing'" 7257da8b7e3Smrgfi 726e4b60806Smrg# Use eval to expand $SHELL 727e4b60806Smrgif eval "$MISSING --is-lightweight"; then 728e4b60806Smrg am_missing_run="$MISSING " 729e4b60806Smrgelse 730e4b60806Smrg am_missing_run= 731e4b60806Smrg AC_MSG_WARN(['missing' script is too old or missing]) 732ff143803Smrgfi 733e4b60806Smrg]) 734123e2cc7Smrg 735e4b60806Smrg# Helper functions for option handling. -*- Autoconf -*- 736123e2cc7Smrg 737e4b60806Smrg# Copyright (C) 2001-2021 Free Software Foundation, Inc. 738e4b60806Smrg# 739e4b60806Smrg# This file is free software; the Free Software Foundation 740e4b60806Smrg# gives unlimited permission to copy and/or distribute it, 741e4b60806Smrg# with or without modifications, as long as this notice is preserved. 7427da8b7e3Smrg 743e4b60806Smrg# _AM_MANGLE_OPTION(NAME) 744e4b60806Smrg# ----------------------- 745e4b60806SmrgAC_DEFUN([_AM_MANGLE_OPTION], 746e4b60806Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 7477da8b7e3Smrg 748e4b60806Smrg# _AM_SET_OPTION(NAME) 749e4b60806Smrg# -------------------- 750e4b60806Smrg# Set option NAME. Presently that only means defining a flag for this option. 751e4b60806SmrgAC_DEFUN([_AM_SET_OPTION], 752e4b60806Smrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) 7537da8b7e3Smrg 754e4b60806Smrg# _AM_SET_OPTIONS(OPTIONS) 755e4b60806Smrg# ------------------------ 756e4b60806Smrg# OPTIONS is a space-separated list of Automake options. 757e4b60806SmrgAC_DEFUN([_AM_SET_OPTIONS], 758e4b60806Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 759e4b60806Smrg 760e4b60806Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 761e4b60806Smrg# ------------------------------------------- 762e4b60806Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 763e4b60806SmrgAC_DEFUN([_AM_IF_OPTION], 764e4b60806Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 765e4b60806Smrg 766e4b60806Smrg# Copyright (C) 1999-2021 Free Software Foundation, Inc. 767ff143803Smrg# 768e4b60806Smrg# This file is free software; the Free Software Foundation 769e4b60806Smrg# gives unlimited permission to copy and/or distribute it, 770e4b60806Smrg# with or without modifications, as long as this notice is preserved. 771c3d5982aSmrg 772e4b60806Smrg# _AM_PROG_CC_C_O 773e4b60806Smrg# --------------- 774e4b60806Smrg# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC 775e4b60806Smrg# to automatically call this. 776e4b60806SmrgAC_DEFUN([_AM_PROG_CC_C_O], 777e4b60806Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 778e4b60806SmrgAC_REQUIRE_AUX_FILE([compile])dnl 779e4b60806SmrgAC_LANG_PUSH([C])dnl 780e4b60806SmrgAC_CACHE_CHECK( 781e4b60806Smrg [whether $CC understands -c and -o together], 782e4b60806Smrg [am_cv_prog_cc_c_o], 783e4b60806Smrg [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) 784e4b60806Smrg # Make sure it works both with $CC and with simple cc. 785e4b60806Smrg # Following AC_PROG_CC_C_O, we do the test twice because some 786e4b60806Smrg # compilers refuse to overwrite an existing .o file with -o, 787e4b60806Smrg # though they will create one. 788e4b60806Smrg am_cv_prog_cc_c_o=yes 789e4b60806Smrg for am_i in 1 2; do 790e4b60806Smrg if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ 791e4b60806Smrg && test -f conftest2.$ac_objext; then 792e4b60806Smrg : OK 793e4b60806Smrg else 794e4b60806Smrg am_cv_prog_cc_c_o=no 795e4b60806Smrg break 796e4b60806Smrg fi 797e4b60806Smrg done 798e4b60806Smrg rm -f core conftest* 799e4b60806Smrg unset am_i]) 800e4b60806Smrgif test "$am_cv_prog_cc_c_o" != yes; then 801e4b60806Smrg # Losing compiler, so override with the script. 802e4b60806Smrg # FIXME: It is wrong to rewrite CC. 803e4b60806Smrg # But if we don't then we get into trouble of one sort or another. 804e4b60806Smrg # A longer-term fix would be to have automake use am__CC in this case, 805e4b60806Smrg # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" 806e4b60806Smrg CC="$am_aux_dir/compile $CC" 807c3d5982aSmrgfi 808e4b60806SmrgAC_LANG_POP([C])]) 8097da8b7e3Smrg 810e4b60806Smrg# For backward compatibility. 811e4b60806SmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) 8127da8b7e3Smrg 813e4b60806Smrg# Copyright (C) 2001-2021 Free Software Foundation, Inc. 814123e2cc7Smrg# 815e4b60806Smrg# This file is free software; the Free Software Foundation 816e4b60806Smrg# gives unlimited permission to copy and/or distribute it, 817e4b60806Smrg# with or without modifications, as long as this notice is preserved. 8187da8b7e3Smrg 819e4b60806Smrg# AM_RUN_LOG(COMMAND) 820e4b60806Smrg# ------------------- 821e4b60806Smrg# Run COMMAND, save the exit status in ac_status, and log it. 822e4b60806Smrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) 823e4b60806SmrgAC_DEFUN([AM_RUN_LOG], 824e4b60806Smrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD 825e4b60806Smrg ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD 826e4b60806Smrg ac_status=$? 827e4b60806Smrg echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD 828e4b60806Smrg (exit $ac_status); }]) 829e4b60806Smrg 830e4b60806Smrg# Check to make sure that the build environment is sane. -*- Autoconf -*- 831e4b60806Smrg 832e4b60806Smrg# Copyright (C) 1996-2021 Free Software Foundation, Inc. 8337da8b7e3Smrg# 834e4b60806Smrg# This file is free software; the Free Software Foundation 835e4b60806Smrg# gives unlimited permission to copy and/or distribute it, 836e4b60806Smrg# with or without modifications, as long as this notice is preserved. 8377da8b7e3Smrg 838e4b60806Smrg# AM_SANITY_CHECK 839e4b60806Smrg# --------------- 840e4b60806SmrgAC_DEFUN([AM_SANITY_CHECK], 841e4b60806Smrg[AC_MSG_CHECKING([whether build environment is sane]) 842e4b60806Smrg# Reject unsafe characters in $srcdir or the absolute working directory 843e4b60806Smrg# name. Accept space and tab only in the latter. 844e4b60806Smrgam_lf=' 845e4b60806Smrg' 846e4b60806Smrgcase `pwd` in 847e4b60806Smrg *[[\\\"\#\$\&\'\`$am_lf]]*) 848e4b60806Smrg AC_MSG_ERROR([unsafe absolute working directory name]);; 849e4b60806Smrgesac 850e4b60806Smrgcase $srcdir in 851e4b60806Smrg *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) 852e4b60806Smrg AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; 853e4b60806Smrgesac 854e4b60806Smrg 855e4b60806Smrg# Do 'set' in a subshell so we don't clobber the current shell's 856e4b60806Smrg# arguments. Must try -L first in case configure is actually a 857e4b60806Smrg# symlink; some systems play weird games with the mod time of symlinks 858e4b60806Smrg# (eg FreeBSD returns the mod time of the symlink's containing 859e4b60806Smrg# directory). 860e4b60806Smrgif ( 861e4b60806Smrg am_has_slept=no 862e4b60806Smrg for am_try in 1 2; do 863e4b60806Smrg echo "timestamp, slept: $am_has_slept" > conftest.file 864e4b60806Smrg set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` 865e4b60806Smrg if test "$[*]" = "X"; then 866e4b60806Smrg # -L didn't work. 867e4b60806Smrg set X `ls -t "$srcdir/configure" conftest.file` 868e4b60806Smrg fi 869e4b60806Smrg if test "$[*]" != "X $srcdir/configure conftest.file" \ 870e4b60806Smrg && test "$[*]" != "X conftest.file $srcdir/configure"; then 871e4b60806Smrg 872e4b60806Smrg # If neither matched, then we have a broken ls. This can happen 873e4b60806Smrg # if, for instance, CONFIG_SHELL is bash and it inherits a 874e4b60806Smrg # broken ls alias from the environment. This has actually 875e4b60806Smrg # happened. Such a system could not be considered "sane". 876e4b60806Smrg AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 877e4b60806Smrg alias in your environment]) 878e4b60806Smrg fi 879e4b60806Smrg if test "$[2]" = conftest.file || test $am_try -eq 2; then 880e4b60806Smrg break 881e4b60806Smrg fi 882e4b60806Smrg # Just in case. 883e4b60806Smrg sleep 1 884e4b60806Smrg am_has_slept=yes 885e4b60806Smrg done 886e4b60806Smrg test "$[2]" = conftest.file 887e4b60806Smrg ) 888e4b60806Smrgthen 889e4b60806Smrg # Ok. 890e4b60806Smrg : 891ff143803Smrgelse 892e4b60806Smrg AC_MSG_ERROR([newly created file is older than distributed files! 893e4b60806SmrgCheck your system clock]) 894ff143803Smrgfi 895e4b60806SmrgAC_MSG_RESULT([yes]) 896e4b60806Smrg# If we didn't sleep, we still need to ensure time stamps of config.status and 897e4b60806Smrg# generated files are strictly newer. 898e4b60806Smrgam_sleep_pid= 899e4b60806Smrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then 900e4b60806Smrg ( sleep 1 ) & 901e4b60806Smrg am_sleep_pid=$! 902e4b60806Smrgfi 903e4b60806SmrgAC_CONFIG_COMMANDS_PRE( 904e4b60806Smrg [AC_MSG_CHECKING([that generated files are newer than configure]) 905e4b60806Smrg if test -n "$am_sleep_pid"; then 906e4b60806Smrg # Hide warnings about reused PIDs. 907e4b60806Smrg wait $am_sleep_pid 2>/dev/null 908e4b60806Smrg fi 909e4b60806Smrg AC_MSG_RESULT([done])]) 910e4b60806Smrgrm -f conftest.file 911e4b60806Smrg]) 912c3d5982aSmrg 913e4b60806Smrg# Copyright (C) 2009-2021 Free Software Foundation, Inc. 914c3d5982aSmrg# 915e4b60806Smrg# This file is free software; the Free Software Foundation 916e4b60806Smrg# gives unlimited permission to copy and/or distribute it, 917e4b60806Smrg# with or without modifications, as long as this notice is preserved. 918c3d5982aSmrg 919e4b60806Smrg# AM_SILENT_RULES([DEFAULT]) 920e4b60806Smrg# -------------------------- 921e4b60806Smrg# Enable less verbose build rules; with the default set to DEFAULT 922e4b60806Smrg# ("yes" being less verbose, "no" or empty being verbose). 923e4b60806SmrgAC_DEFUN([AM_SILENT_RULES], 924e4b60806Smrg[AC_ARG_ENABLE([silent-rules], [dnl 925e4b60806SmrgAS_HELP_STRING( 926e4b60806Smrg [--enable-silent-rules], 927e4b60806Smrg [less verbose build output (undo: "make V=1")]) 928e4b60806SmrgAS_HELP_STRING( 929e4b60806Smrg [--disable-silent-rules], 930e4b60806Smrg [verbose build output (undo: "make V=0")])dnl 931e4b60806Smrg]) 932e4b60806Smrgcase $enable_silent_rules in @%:@ ((( 933e4b60806Smrg yes) AM_DEFAULT_VERBOSITY=0;; 934e4b60806Smrg no) AM_DEFAULT_VERBOSITY=1;; 935e4b60806Smrg *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; 936e4b60806Smrgesac 937e4b60806Smrgdnl 938e4b60806Smrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep) 939e4b60806Smrgdnl do not support nested variable expansions. 940e4b60806Smrgdnl See automake bug#9928 and bug#10237. 941e4b60806Smrgam_make=${MAKE-make} 942e4b60806SmrgAC_CACHE_CHECK([whether $am_make supports nested variables], 943e4b60806Smrg [am_cv_make_support_nested_variables], 944e4b60806Smrg [if AS_ECHO([['TRUE=$(BAR$(V)) 945e4b60806SmrgBAR0=false 946e4b60806SmrgBAR1=true 947e4b60806SmrgV=1 948e4b60806Smrgam__doit: 949e4b60806Smrg @$(TRUE) 950e4b60806Smrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then 951e4b60806Smrg am_cv_make_support_nested_variables=yes 952c3d5982aSmrgelse 953e4b60806Smrg am_cv_make_support_nested_variables=no 954e4b60806Smrgfi]) 955e4b60806Smrgif test $am_cv_make_support_nested_variables = yes; then 956e4b60806Smrg dnl Using '$V' instead of '$(V)' breaks IRIX make. 957e4b60806Smrg AM_V='$(V)' 958e4b60806Smrg AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' 959e4b60806Smrgelse 960e4b60806Smrg AM_V=$AM_DEFAULT_VERBOSITY 961e4b60806Smrg AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY 962ff143803Smrgfi 963e4b60806SmrgAC_SUBST([AM_V])dnl 964e4b60806SmrgAM_SUBST_NOTMAKE([AM_V])dnl 965e4b60806SmrgAC_SUBST([AM_DEFAULT_V])dnl 966e4b60806SmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl 967e4b60806SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl 968e4b60806SmrgAM_BACKSLASH='\' 969e4b60806SmrgAC_SUBST([AM_BACKSLASH])dnl 970e4b60806Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl 971e4b60806Smrg]) 972c3d5982aSmrg 973e4b60806Smrg# Copyright (C) 2001-2021 Free Software Foundation, Inc. 974c3d5982aSmrg# 975e4b60806Smrg# This file is free software; the Free Software Foundation 976e4b60806Smrg# gives unlimited permission to copy and/or distribute it, 977e4b60806Smrg# with or without modifications, as long as this notice is preserved. 978c3d5982aSmrg 979e4b60806Smrg# AM_PROG_INSTALL_STRIP 980e4b60806Smrg# --------------------- 981e4b60806Smrg# One issue with vendor 'install' (even GNU) is that you can't 982e4b60806Smrg# specify the program used to strip binaries. This is especially 983e4b60806Smrg# annoying in cross-compiling environments, where the build's strip 984e4b60806Smrg# is unlikely to handle the host's binaries. 985e4b60806Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we 986e4b60806Smrg# always use install-sh in "make install-strip", and initialize 987e4b60806Smrg# STRIPPROG with the value of the STRIP variable (set by the user). 988e4b60806SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP], 989e4b60806Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 990e4b60806Smrg# Installed binaries are usually stripped using 'strip' when the user 991e4b60806Smrg# run "make install-strip". However 'strip' might not be the right 992e4b60806Smrg# tool to use in cross-compilation environments, therefore Automake 993e4b60806Smrg# will honor the 'STRIP' environment variable to overrule this program. 994e4b60806Smrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'. 995e4b60806Smrgif test "$cross_compiling" != no; then 996e4b60806Smrg AC_CHECK_TOOL([STRIP], [strip], :) 997ff143803Smrgfi 998e4b60806SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" 999e4b60806SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])]) 10007da8b7e3Smrg 1001e4b60806Smrg# Copyright (C) 2006-2021 Free Software Foundation, Inc. 10027da8b7e3Smrg# 1003e4b60806Smrg# This file is free software; the Free Software Foundation 1004e4b60806Smrg# gives unlimited permission to copy and/or distribute it, 1005e4b60806Smrg# with or without modifications, as long as this notice is preserved. 10067da8b7e3Smrg 1007e4b60806Smrg# _AM_SUBST_NOTMAKE(VARIABLE) 1008e4b60806Smrg# --------------------------- 1009e4b60806Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. 1010e4b60806Smrg# This macro is traced by Automake. 1011e4b60806SmrgAC_DEFUN([_AM_SUBST_NOTMAKE]) 10127da8b7e3Smrg 1013e4b60806Smrg# AM_SUBST_NOTMAKE(VARIABLE) 1014e4b60806Smrg# -------------------------- 1015e4b60806Smrg# Public sister of _AM_SUBST_NOTMAKE. 1016e4b60806SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) 10177da8b7e3Smrg 1018e4b60806Smrg# Check how to create a tarball. -*- Autoconf -*- 10197da8b7e3Smrg 1020e4b60806Smrg# Copyright (C) 2004-2021 Free Software Foundation, Inc. 1021ff143803Smrg# 1022e4b60806Smrg# This file is free software; the Free Software Foundation 1023e4b60806Smrg# gives unlimited permission to copy and/or distribute it, 1024e4b60806Smrg# with or without modifications, as long as this notice is preserved. 1025e4b60806Smrg 1026e4b60806Smrg# _AM_PROG_TAR(FORMAT) 1027e4b60806Smrg# -------------------- 1028e4b60806Smrg# Check how to create a tarball in format FORMAT. 1029e4b60806Smrg# FORMAT should be one of 'v7', 'ustar', or 'pax'. 1030ff143803Smrg# 1031e4b60806Smrg# Substitute a variable $(am__tar) that is a command 1032e4b60806Smrg# writing to stdout a FORMAT-tarball containing the directory 1033e4b60806Smrg# $tardir. 1034e4b60806Smrg# tardir=directory && $(am__tar) > result.tar 1035ff143803Smrg# 1036e4b60806Smrg# Substitute a variable $(am__untar) that extract such 1037e4b60806Smrg# a tarball read from stdin. 1038e4b60806Smrg# $(am__untar) < result.tar 1039ff143803Smrg# 1040e4b60806SmrgAC_DEFUN([_AM_PROG_TAR], 1041e4b60806Smrg[# Always define AMTAR for backward compatibility. Yes, it's still used 1042e4b60806Smrg# in the wild :-( We should find a proper way to deprecate it ... 1043e4b60806SmrgAC_SUBST([AMTAR], ['$${TAR-tar}']) 10447da8b7e3Smrg 1045e4b60806Smrg# We'll loop over all known methods to create a tar archive until one works. 1046e4b60806Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' 10477da8b7e3Smrg 1048e4b60806Smrgm4_if([$1], [v7], 1049e4b60806Smrg [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], 10507da8b7e3Smrg 1051e4b60806Smrg [m4_case([$1], 1052e4b60806Smrg [ustar], 1053e4b60806Smrg [# The POSIX 1988 'ustar' format is defined with fixed-size fields. 1054e4b60806Smrg # There is notably a 21 bits limit for the UID and the GID. In fact, 1055e4b60806Smrg # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 1056e4b60806Smrg # and bug#13588). 1057e4b60806Smrg am_max_uid=2097151 # 2^21 - 1 1058e4b60806Smrg am_max_gid=$am_max_uid 1059e4b60806Smrg # The $UID and $GID variables are not portable, so we need to resort 1060e4b60806Smrg # to the POSIX-mandated id(1) utility. Errors in the 'id' calls 1061e4b60806Smrg # below are definitely unexpected, so allow the users to see them 1062e4b60806Smrg # (that is, avoid stderr redirection). 1063e4b60806Smrg am_uid=`id -u || echo unknown` 1064e4b60806Smrg am_gid=`id -g || echo unknown` 1065e4b60806Smrg AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) 1066e4b60806Smrg if test $am_uid -le $am_max_uid; then 1067e4b60806Smrg AC_MSG_RESULT([yes]) 1068e4b60806Smrg else 1069e4b60806Smrg AC_MSG_RESULT([no]) 1070e4b60806Smrg _am_tools=none 1071e4b60806Smrg fi 1072e4b60806Smrg AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) 1073e4b60806Smrg if test $am_gid -le $am_max_gid; then 1074e4b60806Smrg AC_MSG_RESULT([yes]) 1075e4b60806Smrg else 1076e4b60806Smrg AC_MSG_RESULT([no]) 1077e4b60806Smrg _am_tools=none 1078e4b60806Smrg fi], 1079bded5d25Smrg 1080e4b60806Smrg [pax], 1081e4b60806Smrg [], 1082bded5d25Smrg 1083e4b60806Smrg [m4_fatal([Unknown tar format])]) 1084c3d5982aSmrg 1085e4b60806Smrg AC_MSG_CHECKING([how to create a $1 tar archive]) 1086c3d5982aSmrg 1087e4b60806Smrg # Go ahead even if we have the value already cached. We do so because we 1088e4b60806Smrg # need to set the values for the 'am__tar' and 'am__untar' variables. 1089e4b60806Smrg _am_tools=${am_cv_prog_tar_$1-$_am_tools} 1090c3d5982aSmrg 1091e4b60806Smrg for _am_tool in $_am_tools; do 1092e4b60806Smrg case $_am_tool in 1093e4b60806Smrg gnutar) 1094e4b60806Smrg for _am_tar in tar gnutar gtar; do 1095e4b60806Smrg AM_RUN_LOG([$_am_tar --version]) && break 1096e4b60806Smrg done 1097e4b60806Smrg am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' 1098e4b60806Smrg am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' 1099e4b60806Smrg am__untar="$_am_tar -xf -" 1100e4b60806Smrg ;; 1101e4b60806Smrg plaintar) 1102e4b60806Smrg # Must skip GNU tar: if it does not support --format= it doesn't create 1103e4b60806Smrg # ustar tarball either. 1104e4b60806Smrg (tar --version) >/dev/null 2>&1 && continue 1105e4b60806Smrg am__tar='tar chf - "$$tardir"' 1106e4b60806Smrg am__tar_='tar chf - "$tardir"' 1107e4b60806Smrg am__untar='tar xf -' 1108e4b60806Smrg ;; 1109e4b60806Smrg pax) 1110e4b60806Smrg am__tar='pax -L -x $1 -w "$$tardir"' 1111e4b60806Smrg am__tar_='pax -L -x $1 -w "$tardir"' 1112e4b60806Smrg am__untar='pax -r' 1113e4b60806Smrg ;; 1114e4b60806Smrg cpio) 1115e4b60806Smrg am__tar='find "$$tardir" -print | cpio -o -H $1 -L' 1116e4b60806Smrg am__tar_='find "$tardir" -print | cpio -o -H $1 -L' 1117e4b60806Smrg am__untar='cpio -i -H $1 -d' 1118e4b60806Smrg ;; 1119e4b60806Smrg none) 1120e4b60806Smrg am__tar=false 1121e4b60806Smrg am__tar_=false 1122e4b60806Smrg am__untar=false 1123e4b60806Smrg ;; 1124e4b60806Smrg esac 1125c3d5982aSmrg 1126e4b60806Smrg # If the value was cached, stop now. We just wanted to have am__tar 1127e4b60806Smrg # and am__untar set. 1128e4b60806Smrg test -n "${am_cv_prog_tar_$1}" && break 1129ff143803Smrg 1130e4b60806Smrg # tar/untar a dummy directory, and stop if the command works. 1131e4b60806Smrg rm -rf conftest.dir 1132e4b60806Smrg mkdir conftest.dir 1133e4b60806Smrg echo GrepMe > conftest.dir/file 1134e4b60806Smrg AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) 1135e4b60806Smrg rm -rf conftest.dir 1136e4b60806Smrg if test -s conftest.tar; then 1137e4b60806Smrg AM_RUN_LOG([$am__untar <conftest.tar]) 1138e4b60806Smrg AM_RUN_LOG([cat conftest.dir/file]) 1139e4b60806Smrg grep GrepMe conftest.dir/file >/dev/null 2>&1 && break 1140e4b60806Smrg fi 1141e4b60806Smrg done 1142e4b60806Smrg rm -rf conftest.dir 1143bded5d25Smrg 1144e4b60806Smrg AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) 1145e4b60806Smrg AC_MSG_RESULT([$am_cv_prog_tar_$1])]) 1146bded5d25Smrg 1147e4b60806SmrgAC_SUBST([am__tar]) 1148e4b60806SmrgAC_SUBST([am__untar]) 1149e4b60806Smrg]) # _AM_PROG_TAR 1150ff143803Smrg 1151e4b60806Smrgdnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- 1152e4b60806Smrgdnl serial 11 (pkg-config-0.29) 1153e4b60806Smrgdnl 1154e4b60806Smrgdnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>. 1155e4b60806Smrgdnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com> 1156e4b60806Smrgdnl 1157e4b60806Smrgdnl This program is free software; you can redistribute it and/or modify 1158e4b60806Smrgdnl it under the terms of the GNU General Public License as published by 1159e4b60806Smrgdnl the Free Software Foundation; either version 2 of the License, or 1160e4b60806Smrgdnl (at your option) any later version. 1161e4b60806Smrgdnl 1162e4b60806Smrgdnl This program is distributed in the hope that it will be useful, but 1163e4b60806Smrgdnl WITHOUT ANY WARRANTY; without even the implied warranty of 1164e4b60806Smrgdnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1165e4b60806Smrgdnl General Public License for more details. 1166e4b60806Smrgdnl 1167e4b60806Smrgdnl You should have received a copy of the GNU General Public License 1168e4b60806Smrgdnl along with this program; if not, write to the Free Software 1169e4b60806Smrgdnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 1170e4b60806Smrgdnl 02111-1307, USA. 1171e4b60806Smrgdnl 1172e4b60806Smrgdnl As a special exception to the GNU General Public License, if you 1173e4b60806Smrgdnl distribute this file as part of a program that contains a 1174e4b60806Smrgdnl configuration script generated by Autoconf, you may include it under 1175e4b60806Smrgdnl the same distribution terms that you use for the rest of that 1176e4b60806Smrgdnl program. 1177ff143803Smrg 1178e4b60806Smrgdnl PKG_PREREQ(MIN-VERSION) 1179e4b60806Smrgdnl ----------------------- 1180e4b60806Smrgdnl Since: 0.29 1181e4b60806Smrgdnl 1182e4b60806Smrgdnl Verify that the version of the pkg-config macros are at least 1183e4b60806Smrgdnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's 1184e4b60806Smrgdnl installed version of pkg-config, this checks the developer's version 1185e4b60806Smrgdnl of pkg.m4 when generating configure. 1186e4b60806Smrgdnl 1187e4b60806Smrgdnl To ensure that this macro is defined, also add: 1188e4b60806Smrgdnl m4_ifndef([PKG_PREREQ], 1189e4b60806Smrgdnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) 1190e4b60806Smrgdnl 1191e4b60806Smrgdnl See the "Since" comment for each macro you use to see what version 1192e4b60806Smrgdnl of the macros you require. 1193e4b60806Smrgm4_defun([PKG_PREREQ], 1194e4b60806Smrg[m4_define([PKG_MACROS_VERSION], [0.29]) 1195e4b60806Smrgm4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, 1196e4b60806Smrg [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) 1197e4b60806Smrg])dnl PKG_PREREQ 1198ff143803Smrg 1199e4b60806Smrgdnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) 1200e4b60806Smrgdnl ---------------------------------- 1201e4b60806Smrgdnl Since: 0.16 1202e4b60806Smrgdnl 1203e4b60806Smrgdnl Search for the pkg-config tool and set the PKG_CONFIG variable to 1204e4b60806Smrgdnl first found in the path. Checks that the version of pkg-config found 1205e4b60806Smrgdnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is 1206e4b60806Smrgdnl used since that's the first version where most current features of 1207e4b60806Smrgdnl pkg-config existed. 1208e4b60806SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG], 1209e4b60806Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) 1210e4b60806Smrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) 1211e4b60806Smrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) 1212e4b60806SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) 1213e4b60806SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) 1214e4b60806SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) 1215ff143803Smrg 1216e4b60806Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then 1217e4b60806Smrg AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) 1218bded5d25Smrgfi 1219e4b60806Smrgif test -n "$PKG_CONFIG"; then 1220e4b60806Smrg _pkg_min_version=m4_default([$1], [0.9.0]) 1221e4b60806Smrg AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) 1222e4b60806Smrg if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then 1223e4b60806Smrg AC_MSG_RESULT([yes]) 1224e4b60806Smrg else 1225e4b60806Smrg AC_MSG_RESULT([no]) 1226e4b60806Smrg PKG_CONFIG="" 1227e4b60806Smrg fi 1228e4b60806Smrgfi[]dnl 1229e4b60806Smrg])dnl PKG_PROG_PKG_CONFIG 1230bded5d25Smrg 1231e4b60806Smrgdnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 1232e4b60806Smrgdnl ------------------------------------------------------------------- 1233e4b60806Smrgdnl Since: 0.18 1234e4b60806Smrgdnl 1235e4b60806Smrgdnl Check to see whether a particular set of modules exists. Similar to 1236e4b60806Smrgdnl PKG_CHECK_MODULES(), but does not set variables or print errors. 1237e4b60806Smrgdnl 1238e4b60806Smrgdnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 1239e4b60806Smrgdnl only at the first occurence in configure.ac, so if the first place 1240e4b60806Smrgdnl it's called might be skipped (such as if it is within an "if", you 1241e4b60806Smrgdnl have to call PKG_CHECK_EXISTS manually 1242e4b60806SmrgAC_DEFUN([PKG_CHECK_EXISTS], 1243e4b60806Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 1244e4b60806Smrgif test -n "$PKG_CONFIG" && \ 1245e4b60806Smrg AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then 1246e4b60806Smrg m4_default([$2], [:]) 1247e4b60806Smrgm4_ifvaln([$3], [else 1248e4b60806Smrg $3])dnl 1249e4b60806Smrgfi]) 1250e4b60806Smrg 1251e4b60806Smrgdnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) 1252e4b60806Smrgdnl --------------------------------------------- 1253e4b60806Smrgdnl Internal wrapper calling pkg-config via PKG_CONFIG and setting 1254e4b60806Smrgdnl pkg_failed based on the result. 1255e4b60806Smrgm4_define([_PKG_CONFIG], 1256e4b60806Smrg[if test -n "$$1"; then 1257e4b60806Smrg pkg_cv_[]$1="$$1" 1258e4b60806Smrg elif test -n "$PKG_CONFIG"; then 1259e4b60806Smrg PKG_CHECK_EXISTS([$3], 1260e4b60806Smrg [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` 1261e4b60806Smrg test "x$?" != "x0" && pkg_failed=yes ], 1262e4b60806Smrg [pkg_failed=yes]) 1263e4b60806Smrg else 1264e4b60806Smrg pkg_failed=untried 1265e4b60806Smrgfi[]dnl 1266e4b60806Smrg])dnl _PKG_CONFIG 1267e4b60806Smrg 1268e4b60806Smrgdnl _PKG_SHORT_ERRORS_SUPPORTED 1269e4b60806Smrgdnl --------------------------- 1270e4b60806Smrgdnl Internal check to see if pkg-config supports short errors. 1271e4b60806SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], 1272e4b60806Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 1273e4b60806Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then 1274e4b60806Smrg _pkg_short_errors_supported=yes 1275ff143803Smrgelse 1276e4b60806Smrg _pkg_short_errors_supported=no 1277e4b60806Smrgfi[]dnl 1278e4b60806Smrg])dnl _PKG_SHORT_ERRORS_SUPPORTED 1279bded5d25Smrg 1280bded5d25Smrg 1281e4b60806Smrgdnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], 1282e4b60806Smrgdnl [ACTION-IF-NOT-FOUND]) 1283e4b60806Smrgdnl -------------------------------------------------------------- 1284e4b60806Smrgdnl Since: 0.4.0 1285e4b60806Smrgdnl 1286e4b60806Smrgdnl Note that if there is a possibility the first call to 1287e4b60806Smrgdnl PKG_CHECK_MODULES might not happen, you should be sure to include an 1288e4b60806Smrgdnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac 1289e4b60806SmrgAC_DEFUN([PKG_CHECK_MODULES], 1290e4b60806Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 1291e4b60806SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl 1292e4b60806SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl 1293ff143803Smrg 1294e4b60806Smrgpkg_failed=no 1295e4b60806SmrgAC_MSG_CHECKING([for $1]) 1296ff143803Smrg 1297e4b60806Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) 1298e4b60806Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2]) 1299ff143803Smrg 1300e4b60806Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS 1301e4b60806Smrgand $1[]_LIBS to avoid the need to call pkg-config. 1302e4b60806SmrgSee the pkg-config man page for more details.]) 1303ff143803Smrg 1304e4b60806Smrgif test $pkg_failed = yes; then 1305e4b60806Smrg AC_MSG_RESULT([no]) 1306e4b60806Smrg _PKG_SHORT_ERRORS_SUPPORTED 1307e4b60806Smrg if test $_pkg_short_errors_supported = yes; then 1308e4b60806Smrg $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` 1309e4b60806Smrg else 1310e4b60806Smrg $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` 1311e4b60806Smrg fi 1312e4b60806Smrg # Put the nasty error message in config.log where it belongs 1313e4b60806Smrg echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD 1314ff143803Smrg 1315e4b60806Smrg m4_default([$4], [AC_MSG_ERROR( 1316e4b60806Smrg[Package requirements ($2) were not met: 1317ff143803Smrg 1318e4b60806Smrg$$1_PKG_ERRORS 1319e4b60806Smrg 1320e4b60806SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you 1321e4b60806Smrginstalled software in a non-standard prefix. 1322e4b60806Smrg 1323e4b60806Smrg_PKG_TEXT])[]dnl 1324e4b60806Smrg ]) 1325e4b60806Smrgelif test $pkg_failed = untried; then 1326e4b60806Smrg AC_MSG_RESULT([no]) 1327e4b60806Smrg m4_default([$4], [AC_MSG_FAILURE( 1328e4b60806Smrg[The pkg-config script could not be found or is too old. Make sure it 1329e4b60806Smrgis in your PATH or set the PKG_CONFIG environment variable to the full 1330e4b60806Smrgpath to pkg-config. 1331e4b60806Smrg 1332e4b60806Smrg_PKG_TEXT 1333e4b60806Smrg 1334e4b60806SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl 1335e4b60806Smrg ]) 1336bded5d25Smrgelse 1337e4b60806Smrg $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS 1338e4b60806Smrg $1[]_LIBS=$pkg_cv_[]$1[]_LIBS 1339e4b60806Smrg AC_MSG_RESULT([yes]) 1340e4b60806Smrg $3 1341e4b60806Smrgfi[]dnl 1342e4b60806Smrg])dnl PKG_CHECK_MODULES 1343c3d5982aSmrg 1344bded5d25Smrg 1345e4b60806Smrgdnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], 1346e4b60806Smrgdnl [ACTION-IF-NOT-FOUND]) 1347e4b60806Smrgdnl --------------------------------------------------------------------- 1348e4b60806Smrgdnl Since: 0.29 1349e4b60806Smrgdnl 1350e4b60806Smrgdnl Checks for existence of MODULES and gathers its build flags with 1351e4b60806Smrgdnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags 1352e4b60806Smrgdnl and VARIABLE-PREFIX_LIBS from --libs. 1353e4b60806Smrgdnl 1354e4b60806Smrgdnl Note that if there is a possibility the first call to 1355e4b60806Smrgdnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to 1356e4b60806Smrgdnl include an explicit call to PKG_PROG_PKG_CONFIG in your 1357e4b60806Smrgdnl configure.ac. 1358e4b60806SmrgAC_DEFUN([PKG_CHECK_MODULES_STATIC], 1359e4b60806Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 1360e4b60806Smrg_save_PKG_CONFIG=$PKG_CONFIG 1361e4b60806SmrgPKG_CONFIG="$PKG_CONFIG --static" 1362e4b60806SmrgPKG_CHECK_MODULES($@) 1363e4b60806SmrgPKG_CONFIG=$_save_PKG_CONFIG[]dnl 1364e4b60806Smrg])dnl PKG_CHECK_MODULES_STATIC 1365bded5d25Smrg 1366ff143803Smrg 1367e4b60806Smrgdnl PKG_INSTALLDIR([DIRECTORY]) 1368e4b60806Smrgdnl ------------------------- 1369e4b60806Smrgdnl Since: 0.27 1370e4b60806Smrgdnl 1371e4b60806Smrgdnl Substitutes the variable pkgconfigdir as the location where a module 1372e4b60806Smrgdnl should install pkg-config .pc files. By default the directory is 1373e4b60806Smrgdnl $libdir/pkgconfig, but the default can be changed by passing 1374e4b60806Smrgdnl DIRECTORY. The user can override through the --with-pkgconfigdir 1375e4b60806Smrgdnl parameter. 1376e4b60806SmrgAC_DEFUN([PKG_INSTALLDIR], 1377e4b60806Smrg[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) 1378e4b60806Smrgm4_pushdef([pkg_description], 1379e4b60806Smrg [pkg-config installation directory @<:@]pkg_default[@:>@]) 1380e4b60806SmrgAC_ARG_WITH([pkgconfigdir], 1381e4b60806Smrg [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, 1382e4b60806Smrg [with_pkgconfigdir=]pkg_default) 1383e4b60806SmrgAC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) 1384e4b60806Smrgm4_popdef([pkg_default]) 1385e4b60806Smrgm4_popdef([pkg_description]) 1386e4b60806Smrg])dnl PKG_INSTALLDIR 1387e4b60806Smrg 1388e4b60806Smrg 1389e4b60806Smrgdnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) 1390e4b60806Smrgdnl -------------------------------- 1391e4b60806Smrgdnl Since: 0.27 1392e4b60806Smrgdnl 1393e4b60806Smrgdnl Substitutes the variable noarch_pkgconfigdir as the location where a 1394e4b60806Smrgdnl module should install arch-independent pkg-config .pc files. By 1395e4b60806Smrgdnl default the directory is $datadir/pkgconfig, but the default can be 1396e4b60806Smrgdnl changed by passing DIRECTORY. The user can override through the 1397e4b60806Smrgdnl --with-noarch-pkgconfigdir parameter. 1398e4b60806SmrgAC_DEFUN([PKG_NOARCH_INSTALLDIR], 1399e4b60806Smrg[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) 1400e4b60806Smrgm4_pushdef([pkg_description], 1401e4b60806Smrg [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) 1402e4b60806SmrgAC_ARG_WITH([noarch-pkgconfigdir], 1403e4b60806Smrg [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, 1404e4b60806Smrg [with_noarch_pkgconfigdir=]pkg_default) 1405e4b60806SmrgAC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) 1406e4b60806Smrgm4_popdef([pkg_default]) 1407e4b60806Smrgm4_popdef([pkg_description]) 1408e4b60806Smrg])dnl PKG_NOARCH_INSTALLDIR 1409e4b60806Smrg 1410ff143803Smrg 1411e4b60806Smrgdnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, 1412e4b60806Smrgdnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 1413e4b60806Smrgdnl ------------------------------------------- 1414e4b60806Smrgdnl Since: 0.28 1415e4b60806Smrgdnl 1416e4b60806Smrgdnl Retrieves the value of the pkg-config variable for the given module. 1417e4b60806SmrgAC_DEFUN([PKG_CHECK_VAR], 1418e4b60806Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 1419e4b60806SmrgAC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl 1420bded5d25Smrg 1421e4b60806Smrg_PKG_CONFIG([$1], [variable="][$3]["], [$2]) 1422e4b60806SmrgAS_VAR_COPY([$1], [pkg_cv_][$1]) 1423bded5d25Smrg 1424e4b60806SmrgAS_VAR_IF([$1], [""], [$5], [$4])dnl 1425e4b60806Smrg])dnl PKG_CHECK_VAR 1426bded5d25Smrg 1427e4b60806Smrgdnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. 1428e4b60806Smrgdnl 1429e4efb0bcSmrgdnl Copyright (c) 2005, 2023, Oracle and/or its affiliates. 1430e4b60806Smrgdnl 1431e4b60806Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a 1432e4b60806Smrgdnl copy of this software and associated documentation files (the "Software"), 1433e4b60806Smrgdnl to deal in the Software without restriction, including without limitation 1434e4b60806Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense, 1435e4b60806Smrgdnl and/or sell copies of the Software, and to permit persons to whom the 1436e4b60806Smrgdnl Software is furnished to do so, subject to the following conditions: 1437e4b60806Smrgdnl 1438e4b60806Smrgdnl The above copyright notice and this permission notice (including the next 1439e4b60806Smrgdnl paragraph) shall be included in all copies or substantial portions of the 1440e4b60806Smrgdnl Software. 1441e4b60806Smrgdnl 1442e4b60806Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1443e4b60806Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1444e4b60806Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 1445e4b60806Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 1446e4b60806Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 1447e4b60806Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 1448e4b60806Smrgdnl DEALINGS IN THE SOFTWARE. 1449ff143803Smrg 1450e4b60806Smrg# XORG_MACROS_VERSION(required-version) 1451e4b60806Smrg# ------------------------------------- 1452ff143803Smrg# Minimum version: 1.1.0 1453bded5d25Smrg# 1454e4b60806Smrg# If you're using a macro added in Version 1.1 or newer, include this in 1455e4b60806Smrg# your configure.ac with the minimum required version, such as: 1456e4b60806Smrg# XORG_MACROS_VERSION(1.1) 1457bded5d25Smrg# 1458e4b60806Smrg# To ensure that this macro is defined, also add: 1459e4b60806Smrg# m4_ifndef([XORG_MACROS_VERSION], 1460e4b60806Smrg# [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])]) 1461bded5d25Smrg# 1462e4b60806Smrg# 1463e4b60806Smrg# See the "minimum version" comment for each macro you use to see what 1464e4b60806Smrg# version you require. 1465e4b60806Smrgm4_defun([XORG_MACROS_VERSION],[ 1466e4efb0bcSmrgm4_define([vers_have], [1.20.0]) 1467e4b60806Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) 1468e4b60806Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) 1469e4b60806Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,, 1470e4b60806Smrg [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])]) 1471e4b60806Smrgm4_if(m4_version_compare(vers_have, [$1]), -1, 1472e4b60806Smrg [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])]) 1473e4b60806Smrgm4_undefine([vers_have]) 1474e4b60806Smrgm4_undefine([maj_have]) 1475e4b60806Smrgm4_undefine([maj_needed]) 1476e4b60806Smrg]) # XORG_MACROS_VERSION 1477bded5d25Smrg 1478e4b60806Smrg# XORG_PROG_RAWCPP() 1479e4b60806Smrg# ------------------ 1480e4b60806Smrg# Minimum version: 1.0.0 1481e4b60806Smrg# 1482e4b60806Smrg# Find cpp program and necessary flags for use in pre-processing text files 1483e4b60806Smrg# such as man pages and config files 1484e4b60806SmrgAC_DEFUN([XORG_PROG_RAWCPP],[ 1485e4b60806SmrgAC_REQUIRE([AC_PROG_CPP]) 1486e4b60806SmrgAC_PATH_TOOL(RAWCPP, [cpp], [${CPP}], 1487e4b60806Smrg [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) 1488ff143803Smrg 1489e4b60806Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined, 1490e4b60806Smrg# which is not the best choice for supporting other OS'es, but covers most 1491e4b60806Smrg# of the ones we need for now. 1492e4b60806SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef]) 1493e4b60806SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])]) 1494e4b60806Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 1495e4b60806Smrg AC_MSG_RESULT([no]) 1496e4b60806Smrgelse 1497e4b60806Smrg if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 1498e4b60806Smrg RAWCPPFLAGS=-undef 1499e4b60806Smrg AC_MSG_RESULT([yes]) 1500e4b60806Smrg # under Cygwin unix is still defined even with -undef 1501e4b60806Smrg elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 1502e4b60806Smrg RAWCPPFLAGS="-undef -ansi" 1503e4b60806Smrg AC_MSG_RESULT([yes, with -ansi]) 1504e4b60806Smrg else 1505e4b60806Smrg AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.]) 1506e4b60806Smrg fi 1507ff143803Smrgfi 1508e4b60806Smrgrm -f conftest.$ac_ext 1509ff143803Smrg 1510e4b60806SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional]) 1511e4b60806SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve "whitespace"?]])]) 1512e4efb0bcSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve "'` -eq 1 ; then 1513e4b60806Smrg AC_MSG_RESULT([no]) 1514e4b60806Smrgelse 1515e4efb0bcSmrg if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve "'` -eq 1 ; then 1516e4b60806Smrg TRADITIONALCPPFLAGS="-traditional" 1517e4b60806Smrg RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" 1518e4b60806Smrg AC_MSG_RESULT([yes]) 1519e4b60806Smrg else 1520e4b60806Smrg AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) 1521e4b60806Smrg fi 1522e4b60806Smrgfi 1523e4b60806Smrgrm -f conftest.$ac_ext 1524e4b60806SmrgAC_SUBST(RAWCPPFLAGS) 1525e4b60806SmrgAC_SUBST(TRADITIONALCPPFLAGS) 1526e4b60806Smrg]) # XORG_PROG_RAWCPP 1527ff143803Smrg 1528e4b60806Smrg# XORG_MANPAGE_SECTIONS() 1529e4b60806Smrg# ----------------------- 1530e4b60806Smrg# Minimum version: 1.0.0 1531c3d5982aSmrg# 1532e4b60806Smrg# Determine which sections man pages go in for the different man page types 1533e4b60806Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. 1534e4b60806Smrg# Not sure if there's any better way than just hardcoding by OS name. 1535e4b60806Smrg# Override default settings by setting environment variables 1536e4b60806Smrg# Added MAN_SUBSTS in version 1.8 1537e4b60806Smrg# Added AC_PROG_SED in version 1.8 1538c3d5982aSmrg 1539e4b60806SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[ 1540e4b60806SmrgAC_REQUIRE([AC_CANONICAL_HOST]) 1541e4b60806SmrgAC_REQUIRE([AC_PROG_SED]) 1542c3d5982aSmrg 1543e4b60806Smrgcase $host_os in 1544e4b60806Smrg solaris*) 1545e4b60806Smrg # Solaris 2.0 - 11.3 use SysV man page section numbers, so we 1546e4b60806Smrg # check for a man page file found in later versions that use 1547e4b60806Smrg # traditional section numbers instead 1548e4b60806Smrg AC_CHECK_FILE([/usr/share/man/man7/attributes.7], 1549e4b60806Smrg [SYSV_MAN_SECTIONS=false], [SYSV_MAN_SECTIONS=true]) 1550e4b60806Smrg ;; 1551e4b60806Smrg *) SYSV_MAN_SECTIONS=false ;; 1552e4b60806Smrgesac 1553ff143803Smrg 1554e4b60806Smrgif test x$APP_MAN_SUFFIX = x ; then 1555e4b60806Smrg APP_MAN_SUFFIX=1 1556e4b60806Smrgfi 1557e4b60806Smrgif test x$APP_MAN_DIR = x ; then 1558e4b60806Smrg APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' 1559e4b60806Smrgfi 1560ff143803Smrg 1561e4b60806Smrgif test x$LIB_MAN_SUFFIX = x ; then 1562e4b60806Smrg LIB_MAN_SUFFIX=3 1563e4b60806Smrgfi 1564e4b60806Smrgif test x$LIB_MAN_DIR = x ; then 1565e4b60806Smrg LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' 1566e4b60806Smrgfi 1567ff143803Smrg 1568e4b60806Smrgif test x$FILE_MAN_SUFFIX = x ; then 1569e4b60806Smrg case $SYSV_MAN_SECTIONS in 1570e4b60806Smrg true) FILE_MAN_SUFFIX=4 ;; 1571e4b60806Smrg *) FILE_MAN_SUFFIX=5 ;; 1572e4b60806Smrg esac 1573e4b60806Smrgfi 1574e4b60806Smrgif test x$FILE_MAN_DIR = x ; then 1575e4b60806Smrg FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' 1576ff143803Smrgfi 1577ff143803Smrg 1578e4b60806Smrgif test x$MISC_MAN_SUFFIX = x ; then 1579e4b60806Smrg case $SYSV_MAN_SECTIONS in 1580e4b60806Smrg true) MISC_MAN_SUFFIX=5 ;; 1581e4b60806Smrg *) MISC_MAN_SUFFIX=7 ;; 1582e4b60806Smrg esac 1583e4b60806Smrgfi 1584e4b60806Smrgif test x$MISC_MAN_DIR = x ; then 1585e4b60806Smrg MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' 1586ff143803Smrgfi 1587ff143803Smrg 1588e4b60806Smrgif test x$DRIVER_MAN_SUFFIX = x ; then 1589e4b60806Smrg case $SYSV_MAN_SECTIONS in 1590e4b60806Smrg true) DRIVER_MAN_SUFFIX=7 ;; 1591e4b60806Smrg *) DRIVER_MAN_SUFFIX=4 ;; 1592e4b60806Smrg esac 1593e4b60806Smrgfi 1594e4b60806Smrgif test x$DRIVER_MAN_DIR = x ; then 1595e4b60806Smrg DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' 1596e4b60806Smrgfi 1597ff143803Smrg 1598e4b60806Smrgif test x$ADMIN_MAN_SUFFIX = x ; then 1599e4b60806Smrg case $SYSV_MAN_SECTIONS in 1600e4b60806Smrg true) ADMIN_MAN_SUFFIX=1m ;; 1601e4b60806Smrg *) ADMIN_MAN_SUFFIX=8 ;; 1602e4b60806Smrg esac 1603e4b60806Smrgfi 1604e4b60806Smrgif test x$ADMIN_MAN_DIR = x ; then 1605e4b60806Smrg ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' 1606e4b60806Smrgfi 1607ff143803Smrg 1608ff143803Smrg 1609e4b60806SmrgAC_SUBST([APP_MAN_SUFFIX]) 1610e4b60806SmrgAC_SUBST([LIB_MAN_SUFFIX]) 1611e4b60806SmrgAC_SUBST([FILE_MAN_SUFFIX]) 1612e4b60806SmrgAC_SUBST([MISC_MAN_SUFFIX]) 1613e4b60806SmrgAC_SUBST([DRIVER_MAN_SUFFIX]) 1614e4b60806SmrgAC_SUBST([ADMIN_MAN_SUFFIX]) 1615e4b60806SmrgAC_SUBST([APP_MAN_DIR]) 1616e4b60806SmrgAC_SUBST([LIB_MAN_DIR]) 1617e4b60806SmrgAC_SUBST([FILE_MAN_DIR]) 1618e4b60806SmrgAC_SUBST([MISC_MAN_DIR]) 1619e4b60806SmrgAC_SUBST([DRIVER_MAN_DIR]) 1620e4b60806SmrgAC_SUBST([ADMIN_MAN_DIR]) 1621ff143803Smrg 1622e4b60806SmrgXORG_MAN_PAGE="X Version 11" 1623e4b60806SmrgAC_SUBST([XORG_MAN_PAGE]) 1624e4b60806SmrgMAN_SUBSTS="\ 1625e4b60806Smrg -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ 1626e4b60806Smrg -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ 1627e4b60806Smrg -e 's|__xservername__|Xorg|g' \ 1628e4b60806Smrg -e 's|__xconfigfile__|xorg.conf|g' \ 1629e4b60806Smrg -e 's|__projectroot__|\$(prefix)|g' \ 1630e4b60806Smrg -e 's|__apploaddir__|\$(appdefaultdir)|g' \ 1631e4b60806Smrg -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \ 1632e4b60806Smrg -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \ 1633e4b60806Smrg -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \ 1634e4b60806Smrg -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \ 1635e4b60806Smrg -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \ 1636e4b60806Smrg -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'" 1637e4b60806SmrgAC_SUBST([MAN_SUBSTS]) 1638ff143803Smrg 1639e4b60806Smrg]) # XORG_MANPAGE_SECTIONS 1640ff143803Smrg 1641e4b60806Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION]) 1642e4b60806Smrg# ------------------------ 1643e4b60806Smrg# Minimum version: 1.7.0 1644c3d5982aSmrg# 1645e4b60806Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent 1646e4b60806Smrg# provided by xorg-sgml-doctools, if installed. 1647e4b60806SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[ 1648e4b60806SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])]) 1649e4b60806SmrgXORG_SGML_PATH= 1650e4b60806SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])], 1651e4b60806Smrg [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`], 1652e4b60806Smrg [m4_ifval([$1],[:], 1653e4b60806Smrg [if test x"$cross_compiling" != x"yes" ; then 1654e4b60806Smrg AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent], 1655e4b60806Smrg [XORG_SGML_PATH=$prefix/share/sgml]) 1656e4b60806Smrg fi]) 1657e4b60806Smrg ]) 1658e4b60806Smrg 1659e4b60806Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing 1660e4b60806Smrg# the path and the name of the doc stylesheet 1661e4b60806Smrgif test "x$XORG_SGML_PATH" != "x" ; then 1662e4b60806Smrg AC_MSG_RESULT([$XORG_SGML_PATH]) 1663e4b60806Smrg STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11 1664e4b60806Smrg XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl 1665e4b60806Smrgelse 1666e4b60806Smrg AC_MSG_RESULT([no]) 1667e4b60806Smrgfi 1668e4b60806Smrg 1669e4b60806SmrgAC_SUBST(XORG_SGML_PATH) 1670e4b60806SmrgAC_SUBST(STYLESHEET_SRCDIR) 1671e4b60806SmrgAC_SUBST(XSL_STYLESHEET) 1672e4b60806SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"]) 1673e4b60806Smrg]) # XORG_CHECK_SGML_DOCTOOLS 1674e4b60806Smrg 1675e4b60806Smrg# XORG_CHECK_LINUXDOC 1676e4b60806Smrg# ------------------- 1677e4b60806Smrg# Minimum version: 1.0.0 1678ff143803Smrg# 1679e4b60806Smrg# Defines the variable MAKE_TEXT if the necessary tools and 1680e4b60806Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. 1681e4b60806Smrg# Whether or not the necessary tools and files are found can be checked 1682e4b60806Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC" 1683e4b60806SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[ 1684e4b60806SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) 1685e4b60806SmrgAC_REQUIRE([XORG_WITH_PS2PDF]) 1686ff143803Smrg 1687e4b60806SmrgAC_PATH_PROG(LINUXDOC, linuxdoc) 1688ff143803Smrg 1689e4b60806SmrgAC_MSG_CHECKING([whether to build documentation]) 1690e4b60806Smrg 1691e4b60806Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then 1692e4b60806Smrg BUILDDOC=yes 1693ff143803Smrgelse 1694e4b60806Smrg BUILDDOC=no 1695ff143803Smrgfi 1696ff143803Smrg 1697e4b60806SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) 1698ff143803Smrg 1699e4b60806SmrgAC_MSG_RESULT([$BUILDDOC]) 1700ff143803Smrg 1701e4b60806SmrgAC_MSG_CHECKING([whether to build pdf documentation]) 1702e4b60806Smrg 1703e4b60806Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then 1704e4b60806Smrg BUILDPDFDOC=yes 1705e4b60806Smrgelse 1706e4b60806Smrg BUILDPDFDOC=no 1707e4b60806Smrgfi 1708e4b60806Smrg 1709e4b60806SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 1710e4b60806Smrg 1711e4b60806SmrgAC_MSG_RESULT([$BUILDPDFDOC]) 1712e4b60806Smrg 1713e4b60806SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f" 1714e4b60806SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps" 1715e4b60806SmrgMAKE_PDF="$PS2PDF" 1716e4b60806SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0" 1717e4b60806Smrg 1718e4b60806SmrgAC_SUBST(MAKE_TEXT) 1719e4b60806SmrgAC_SUBST(MAKE_PS) 1720e4b60806SmrgAC_SUBST(MAKE_PDF) 1721e4b60806SmrgAC_SUBST(MAKE_HTML) 1722e4b60806Smrg]) # XORG_CHECK_LINUXDOC 1723e4b60806Smrg 1724e4b60806Smrg# XORG_CHECK_DOCBOOK 1725e4b60806Smrg# ------------------- 1726e4b60806Smrg# Minimum version: 1.0.0 1727e4b60806Smrg# 1728e4b60806Smrg# Checks for the ability to build output formats from SGML DocBook source. 1729e4b60806Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC" 1730e4b60806Smrg# indicates whether the necessary tools and files are found and, if set, 1731e4b60806Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx. 1732e4b60806SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[ 1733e4b60806SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) 1734e4b60806Smrg 1735e4b60806SmrgBUILDTXTDOC=no 1736e4b60806SmrgBUILDPDFDOC=no 1737e4b60806SmrgBUILDPSDOC=no 1738e4b60806SmrgBUILDHTMLDOC=no 1739e4b60806Smrg 1740e4b60806SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps) 1741e4b60806SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf) 1742e4b60806SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html) 1743e4b60806SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt) 1744ff143803Smrg 1745e4b60806SmrgAC_MSG_CHECKING([whether to build text documentation]) 1746e4b60806Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x && 1747e4b60806Smrg test x$BUILD_TXTDOC != xno; then 1748e4b60806Smrg BUILDTXTDOC=yes 1749e4b60806Smrgfi 1750e4b60806SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes]) 1751e4b60806SmrgAC_MSG_RESULT([$BUILDTXTDOC]) 1752ff143803Smrg 1753e4b60806SmrgAC_MSG_CHECKING([whether to build PDF documentation]) 1754e4b60806Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x && 1755e4b60806Smrg test x$BUILD_PDFDOC != xno; then 1756e4b60806Smrg BUILDPDFDOC=yes 1757e4b60806Smrgfi 1758e4b60806SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 1759e4b60806SmrgAC_MSG_RESULT([$BUILDPDFDOC]) 1760ff143803Smrg 1761e4b60806SmrgAC_MSG_CHECKING([whether to build PostScript documentation]) 1762e4b60806Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x && 1763e4b60806Smrg test x$BUILD_PSDOC != xno; then 1764e4b60806Smrg BUILDPSDOC=yes 1765ff143803Smrgfi 1766e4b60806SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes]) 1767e4b60806SmrgAC_MSG_RESULT([$BUILDPSDOC]) 1768ff143803Smrg 1769e4b60806SmrgAC_MSG_CHECKING([whether to build HTML documentation]) 1770e4b60806Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x && 1771e4b60806Smrg test x$BUILD_HTMLDOC != xno; then 1772e4b60806Smrg BUILDHTMLDOC=yes 1773e4b60806Smrgfi 1774e4b60806SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes]) 1775e4b60806SmrgAC_MSG_RESULT([$BUILDHTMLDOC]) 1776ff143803Smrg 1777e4b60806SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT" 1778e4b60806SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS" 1779e4b60806SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF" 1780e4b60806SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML" 1781e4b60806Smrg 1782e4b60806SmrgAC_SUBST(MAKE_TEXT) 1783e4b60806SmrgAC_SUBST(MAKE_PS) 1784e4b60806SmrgAC_SUBST(MAKE_PDF) 1785e4b60806SmrgAC_SUBST(MAKE_HTML) 1786e4b60806Smrg]) # XORG_CHECK_DOCBOOK 1787e4b60806Smrg 1788e4b60806Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT]) 1789e4b60806Smrg# ---------------- 1790e4b60806Smrg# Minimum version: 1.5.0 1791e4b60806Smrg# Minimum version for optional DEFAULT argument: 1.11.0 1792ff143803Smrg# 1793e4b60806Smrg# Documentation tools are not always available on all platforms and sometimes 1794e4b60806Smrg# not at the appropriate level. This macro enables a module to test for the 1795e4b60806Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 1796e4efb0bcSmrg# the --with-xmlto option, it allows maximum flexibility in making decisions 1797e4b60806Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified, 1798e4b60806Smrg# --with-xmlto assumes 'auto'. 1799ff143803Smrg# 1800e4b60806Smrg# Interface to module: 1801e4b60806Smrg# HAVE_XMLTO: used in makefiles to conditionally generate documentation 1802e4b60806Smrg# XMLTO: returns the path of the xmlto program found 1803e4b60806Smrg# returns the path set by the user in the environment 1804e4b60806Smrg# --with-xmlto: 'yes' user instructs the module to use xmlto 1805e4b60806Smrg# 'no' user instructs the module not to use xmlto 1806ff143803Smrg# 1807e4b60806Smrg# Added in version 1.10.0 1808e4b60806Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation 1809e4b60806Smrg# xmlto for text output requires either lynx, links, or w3m browsers 1810ff143803Smrg# 1811e4b60806Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path. 1812ff143803Smrg# 1813e4b60806SmrgAC_DEFUN([XORG_WITH_XMLTO],[ 1814e4b60806SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command]) 1815e4b60806Smrgm4_define([_defopt], m4_default([$2], [auto])) 1816e4b60806SmrgAC_ARG_WITH(xmlto, 1817e4b60806Smrg AS_HELP_STRING([--with-xmlto], 1818e4b60806Smrg [Use xmlto to regenerate documentation (default: ]_defopt[)]), 1819e4b60806Smrg [use_xmlto=$withval], [use_xmlto=]_defopt) 1820e4b60806Smrgm4_undefine([_defopt]) 1821ff143803Smrg 1822e4b60806Smrgif test "x$use_xmlto" = x"auto"; then 1823e4b60806Smrg AC_PATH_PROG([XMLTO], [xmlto]) 1824e4b60806Smrg if test "x$XMLTO" = "x"; then 1825e4b60806Smrg AC_MSG_WARN([xmlto not found - documentation targets will be skipped]) 1826e4b60806Smrg have_xmlto=no 1827e4b60806Smrg else 1828e4b60806Smrg have_xmlto=yes 1829e4b60806Smrg fi 1830e4b60806Smrgelif test "x$use_xmlto" = x"yes" ; then 1831e4b60806Smrg AC_PATH_PROG([XMLTO], [xmlto]) 1832e4b60806Smrg if test "x$XMLTO" = "x"; then 1833e4b60806Smrg AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH]) 1834e4b60806Smrg fi 1835e4b60806Smrg have_xmlto=yes 1836e4b60806Smrgelif test "x$use_xmlto" = x"no" ; then 1837e4b60806Smrg if test "x$XMLTO" != "x"; then 1838e4b60806Smrg AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified]) 1839e4b60806Smrg fi 1840e4b60806Smrg have_xmlto=no 1841e4b60806Smrgelse 1842e4b60806Smrg AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no']) 1843e4b60806Smrgfi 1844ff143803Smrg 1845e4b60806Smrg# Test for a minimum version of xmlto, if provided. 1846e4b60806Smrgm4_ifval([$1], 1847e4b60806Smrg[if test "$have_xmlto" = yes; then 1848e4b60806Smrg # scrape the xmlto version 1849e4b60806Smrg AC_MSG_CHECKING([the xmlto version]) 1850e4b60806Smrg xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3` 1851e4b60806Smrg AC_MSG_RESULT([$xmlto_version]) 1852e4b60806Smrg AS_VERSION_COMPARE([$xmlto_version], [$1], 1853e4b60806Smrg [if test "x$use_xmlto" = xauto; then 1854e4b60806Smrg AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed]) 1855e4b60806Smrg have_xmlto=no 1856e4b60806Smrg else 1857e4b60806Smrg AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed]) 1858e4b60806Smrg fi]) 1859e4b60806Smrgfi]) 1860ff143803Smrg 1861e4b60806Smrg# Test for the ability of xmlto to generate a text target 1862e4b60806Smrg# 1863e4b60806Smrg# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the 1864e4b60806Smrg# following test for empty XML docbook files. 1865e4b60806Smrg# For compatibility reasons use the following empty XML docbook file and if 1866e4b60806Smrg# it fails try it again with a non-empty XML file. 1867e4b60806Smrghave_xmlto_text=no 1868e4b60806Smrgcat > conftest.xml << "EOF" 1869e4b60806SmrgEOF 1870e4b60806SmrgAS_IF([test "$have_xmlto" = yes], 1871e4b60806Smrg [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1], 1872e4b60806Smrg [have_xmlto_text=yes], 1873e4b60806Smrg [# Try it again with a non-empty XML file. 1874e4b60806Smrg cat > conftest.xml << "EOF" 1875e4b60806Smrg<x></x> 1876e4b60806SmrgEOF 1877e4b60806Smrg AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1], 1878e4b60806Smrg [have_xmlto_text=yes], 1879e4b60806Smrg [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])]) 1880e4b60806Smrgrm -f conftest.xml 1881e4b60806SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes]) 1882e4b60806SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes]) 1883e4b60806Smrg]) # XORG_WITH_XMLTO 1884ff143803Smrg 1885e4b60806Smrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT]) 1886e4b60806Smrg# -------------------------------------------- 1887e4b60806Smrg# Minimum version: 1.12.0 1888e4b60806Smrg# Minimum version for optional DEFAULT argument: 1.12.0 1889e4b60806Smrg# 1890e4b60806Smrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative, 1891e4b60806Smrg# XML-based language used for the transformation of XML documents. 1892e4b60806Smrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents. 1893e4b60806Smrg# It is used under the cover by xmlto to generate html files from DocBook/XML. 1894e4b60806Smrg# The XSLT processor is often used as a standalone tool for transformations. 1895e4b60806Smrg# It should not be assumed that this tool is used only to work with documnetation. 1896e4b60806Smrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'. 1897e4b60806Smrg# 1898e4b60806Smrg# Interface to module: 1899e4b60806Smrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation 1900e4b60806Smrg# XSLTPROC: returns the path of the xsltproc program found 1901e4b60806Smrg# returns the path set by the user in the environment 1902e4b60806Smrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc 1903e4b60806Smrg# 'no' user instructs the module not to use xsltproc 1904e4b60806Smrg# have_xsltproc: returns yes if xsltproc found in PATH or no 1905e4b60806Smrg# 1906e4b60806Smrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path. 1907e4b60806Smrg# 1908e4b60806SmrgAC_DEFUN([XORG_WITH_XSLTPROC],[ 1909e4b60806SmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command]) 1910e4b60806Smrg# Preserves the interface, should it be implemented later 1911e4b60806Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])]) 1912e4b60806Smrgm4_define([_defopt], m4_default([$2], [auto])) 1913e4b60806SmrgAC_ARG_WITH(xsltproc, 1914e4b60806Smrg AS_HELP_STRING([--with-xsltproc], 1915e4b60806Smrg [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]), 1916e4b60806Smrg [use_xsltproc=$withval], [use_xsltproc=]_defopt) 1917e4b60806Smrgm4_undefine([_defopt]) 1918ff143803Smrg 1919e4b60806Smrgif test "x$use_xsltproc" = x"auto"; then 1920e4b60806Smrg AC_PATH_PROG([XSLTPROC], [xsltproc]) 1921e4b60806Smrg if test "x$XSLTPROC" = "x"; then 1922e4b60806Smrg AC_MSG_WARN([xsltproc not found - cannot transform XML documents]) 1923e4b60806Smrg have_xsltproc=no 1924e4b60806Smrg else 1925e4b60806Smrg have_xsltproc=yes 1926e4b60806Smrg fi 1927e4b60806Smrgelif test "x$use_xsltproc" = x"yes" ; then 1928e4b60806Smrg AC_PATH_PROG([XSLTPROC], [xsltproc]) 1929e4b60806Smrg if test "x$XSLTPROC" = "x"; then 1930e4b60806Smrg AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH]) 1931e4b60806Smrg fi 1932e4b60806Smrg have_xsltproc=yes 1933e4b60806Smrgelif test "x$use_xsltproc" = x"no" ; then 1934e4b60806Smrg if test "x$XSLTPROC" != "x"; then 1935e4b60806Smrg AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified]) 1936e4b60806Smrg fi 1937e4b60806Smrg have_xsltproc=no 1938e4b60806Smrgelse 1939e4b60806Smrg AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no']) 1940ff143803Smrgfi 1941ff143803Smrg 1942e4b60806SmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes]) 1943e4b60806Smrg]) # XORG_WITH_XSLTPROC 1944e4b60806Smrg 1945e4b60806Smrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT]) 1946e4b60806Smrg# ---------------------------------------- 1947e4b60806Smrg# Minimum version: 1.15.0 1948ff143803Smrg# 1949e4b60806Smrg# PERL (Practical Extraction and Report Language) is a language optimized for 1950e4b60806Smrg# scanning arbitrary text files, extracting information from those text files, 1951e4b60806Smrg# and printing reports based on that information. 1952ff143803Smrg# 1953e4b60806Smrg# When DEFAULT is not specified, --with-perl assumes 'auto'. 1954ff143803Smrg# 1955e4b60806Smrg# Interface to module: 1956e4b60806Smrg# HAVE_PERL: used in makefiles to conditionally scan text files 1957e4b60806Smrg# PERL: returns the path of the perl program found 1958e4b60806Smrg# returns the path set by the user in the environment 1959e4b60806Smrg# --with-perl: 'yes' user instructs the module to use perl 1960e4b60806Smrg# 'no' user instructs the module not to use perl 1961e4b60806Smrg# have_perl: returns yes if perl found in PATH or no 1962ff143803Smrg# 1963e4b60806Smrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path. 1964e4b60806Smrg# 1965e4b60806SmrgAC_DEFUN([XORG_WITH_PERL],[ 1966e4b60806SmrgAC_ARG_VAR([PERL], [Path to perl command]) 1967e4b60806Smrg# Preserves the interface, should it be implemented later 1968e4b60806Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])]) 1969e4b60806Smrgm4_define([_defopt], m4_default([$2], [auto])) 1970e4b60806SmrgAC_ARG_WITH(perl, 1971e4b60806Smrg AS_HELP_STRING([--with-perl], 1972e4b60806Smrg [Use perl for extracting information from files (default: ]_defopt[)]), 1973e4b60806Smrg [use_perl=$withval], [use_perl=]_defopt) 1974e4b60806Smrgm4_undefine([_defopt]) 1975ff143803Smrg 1976e4b60806Smrgif test "x$use_perl" = x"auto"; then 1977e4b60806Smrg AC_PATH_PROG([PERL], [perl]) 1978e4b60806Smrg if test "x$PERL" = "x"; then 1979e4b60806Smrg AC_MSG_WARN([perl not found - cannot extract information and report]) 1980e4b60806Smrg have_perl=no 1981e4b60806Smrg else 1982e4b60806Smrg have_perl=yes 1983e4b60806Smrg fi 1984e4b60806Smrgelif test "x$use_perl" = x"yes" ; then 1985e4b60806Smrg AC_PATH_PROG([PERL], [perl]) 1986e4b60806Smrg if test "x$PERL" = "x"; then 1987e4b60806Smrg AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH]) 1988e4b60806Smrg fi 1989e4b60806Smrg have_perl=yes 1990e4b60806Smrgelif test "x$use_perl" = x"no" ; then 1991e4b60806Smrg if test "x$PERL" != "x"; then 1992e4b60806Smrg AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified]) 1993e4b60806Smrg fi 1994e4b60806Smrg have_perl=no 1995e4b60806Smrgelse 1996e4b60806Smrg AC_MSG_ERROR([--with-perl expects 'yes' or 'no']) 1997e4b60806Smrgfi 1998ff143803Smrg 1999e4b60806SmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes]) 2000e4b60806Smrg]) # XORG_WITH_PERL 2001ff143803Smrg 2002e4b60806Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT]) 2003ff143803Smrg# ---------------- 2004e4b60806Smrg# Minimum version: 1.5.0 2005e4b60806Smrg# Minimum version for optional DEFAULT argument: 1.11.0 2006ff143803Smrg# 2007e4b60806Smrg# Documentation tools are not always available on all platforms and sometimes 2008e4b60806Smrg# not at the appropriate level. This macro enables a module to test for the 2009e4b60806Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 2010e4efb0bcSmrg# the --with-asciidoc option, it allows maximum flexibility in making decisions 2011e4b60806Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified, 2012e4b60806Smrg# --with-asciidoc assumes 'auto'. 2013ff143803Smrg# 2014e4b60806Smrg# Interface to module: 2015e4b60806Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation 2016e4b60806Smrg# ASCIIDOC: returns the path of the asciidoc program found 2017e4b60806Smrg# returns the path set by the user in the environment 2018e4b60806Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc 2019e4b60806Smrg# 'no' user instructs the module not to use asciidoc 2020ff143803Smrg# 2021e4b60806Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path. 2022ff143803Smrg# 2023e4b60806SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[ 2024e4b60806SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command]) 2025e4b60806Smrgm4_define([_defopt], m4_default([$2], [auto])) 2026e4b60806SmrgAC_ARG_WITH(asciidoc, 2027e4b60806Smrg AS_HELP_STRING([--with-asciidoc], 2028e4b60806Smrg [Use asciidoc to regenerate documentation (default: ]_defopt[)]), 2029e4b60806Smrg [use_asciidoc=$withval], [use_asciidoc=]_defopt) 2030e4b60806Smrgm4_undefine([_defopt]) 2031ff143803Smrg 2032e4b60806Smrgif test "x$use_asciidoc" = x"auto"; then 2033e4b60806Smrg AC_PATH_PROG([ASCIIDOC], [asciidoc]) 2034e4b60806Smrg if test "x$ASCIIDOC" = "x"; then 2035e4b60806Smrg AC_MSG_WARN([asciidoc not found - documentation targets will be skipped]) 2036e4b60806Smrg have_asciidoc=no 2037e4b60806Smrg else 2038e4b60806Smrg have_asciidoc=yes 2039e4b60806Smrg fi 2040e4b60806Smrgelif test "x$use_asciidoc" = x"yes" ; then 2041e4b60806Smrg AC_PATH_PROG([ASCIIDOC], [asciidoc]) 2042e4b60806Smrg if test "x$ASCIIDOC" = "x"; then 2043e4b60806Smrg AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH]) 2044e4b60806Smrg fi 2045e4b60806Smrg have_asciidoc=yes 2046e4b60806Smrgelif test "x$use_asciidoc" = x"no" ; then 2047e4b60806Smrg if test "x$ASCIIDOC" != "x"; then 2048e4b60806Smrg AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified]) 2049e4b60806Smrg fi 2050e4b60806Smrg have_asciidoc=no 2051e4b60806Smrgelse 2052e4b60806Smrg AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no']) 2053e4b60806Smrgfi 2054e4b60806Smrgm4_ifval([$1], 2055e4b60806Smrg[if test "$have_asciidoc" = yes; then 2056e4b60806Smrg # scrape the asciidoc version 2057e4b60806Smrg AC_MSG_CHECKING([the asciidoc version]) 2058e4b60806Smrg asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2` 2059e4b60806Smrg AC_MSG_RESULT([$asciidoc_version]) 2060e4b60806Smrg AS_VERSION_COMPARE([$asciidoc_version], [$1], 2061e4b60806Smrg [if test "x$use_asciidoc" = xauto; then 2062e4b60806Smrg AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed]) 2063e4b60806Smrg have_asciidoc=no 2064e4b60806Smrg else 2065e4b60806Smrg AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed]) 2066e4b60806Smrg fi]) 2067e4b60806Smrgfi]) 2068e4b60806SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes]) 2069e4b60806Smrg]) # XORG_WITH_ASCIIDOC 2070ff143803Smrg 2071e4b60806Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT]) 2072e4b60806Smrg# ------------------------------------------- 2073e4b60806Smrg# Minimum version: 1.5.0 2074e4b60806Smrg# Minimum version for optional DEFAULT argument: 1.11.0 2075e4b60806Smrg# Minimum version for optional DOT checking: 1.18.0 2076ff143803Smrg# 2077e4b60806Smrg# Documentation tools are not always available on all platforms and sometimes 2078e4b60806Smrg# not at the appropriate level. This macro enables a module to test for the 2079e4b60806Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 2080e4efb0bcSmrg# the --with-doxygen option, it allows maximum flexibility in making decisions 2081e4b60806Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified, 2082e4b60806Smrg# --with-doxygen assumes 'auto'. 2083c3d5982aSmrg# 2084e4b60806Smrg# Interface to module: 2085e4b60806Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation 2086e4b60806Smrg# DOXYGEN: returns the path of the doxygen program found 2087e4b60806Smrg# returns the path set by the user in the environment 2088e4b60806Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen 2089e4b60806Smrg# 'no' user instructs the module not to use doxygen 2090c3d5982aSmrg# 2091e4b60806Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path. 2092c3d5982aSmrg# 2093e4b60806SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[ 2094e4b60806SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command]) 2095e4b60806SmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility]) 2096e4b60806Smrgm4_define([_defopt], m4_default([$2], [auto])) 2097e4b60806SmrgAC_ARG_WITH(doxygen, 2098e4b60806Smrg AS_HELP_STRING([--with-doxygen], 2099e4b60806Smrg [Use doxygen to regenerate documentation (default: ]_defopt[)]), 2100e4b60806Smrg [use_doxygen=$withval], [use_doxygen=]_defopt) 2101e4b60806Smrgm4_undefine([_defopt]) 2102c3d5982aSmrg 2103e4b60806Smrgif test "x$use_doxygen" = x"auto"; then 2104e4b60806Smrg AC_PATH_PROG([DOXYGEN], [doxygen]) 2105e4b60806Smrg if test "x$DOXYGEN" = "x"; then 2106e4b60806Smrg AC_MSG_WARN([doxygen not found - documentation targets will be skipped]) 2107e4b60806Smrg have_doxygen=no 2108e4b60806Smrg else 2109e4b60806Smrg have_doxygen=yes 2110e4b60806Smrg fi 2111e4b60806Smrgelif test "x$use_doxygen" = x"yes" ; then 2112e4b60806Smrg AC_PATH_PROG([DOXYGEN], [doxygen]) 2113e4b60806Smrg if test "x$DOXYGEN" = "x"; then 2114e4b60806Smrg AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH]) 2115e4b60806Smrg fi 2116e4b60806Smrg have_doxygen=yes 2117e4b60806Smrgelif test "x$use_doxygen" = x"no" ; then 2118e4b60806Smrg if test "x$DOXYGEN" != "x"; then 2119e4b60806Smrg AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified]) 2120e4b60806Smrg fi 2121e4b60806Smrg have_doxygen=no 2122ff143803Smrgelse 2123e4b60806Smrg AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no']) 2124c3d5982aSmrgfi 2125e4b60806Smrgm4_ifval([$1], 2126e4b60806Smrg[if test "$have_doxygen" = yes; then 2127e4b60806Smrg # scrape the doxygen version 2128e4b60806Smrg AC_MSG_CHECKING([the doxygen version]) 2129e4b60806Smrg doxygen_version=`$DOXYGEN --version 2>/dev/null` 2130e4b60806Smrg AC_MSG_RESULT([$doxygen_version]) 2131e4b60806Smrg AS_VERSION_COMPARE([$doxygen_version], [$1], 2132e4b60806Smrg [if test "x$use_doxygen" = xauto; then 2133e4b60806Smrg AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed]) 2134e4b60806Smrg have_doxygen=no 2135e4b60806Smrg else 2136e4b60806Smrg AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed]) 2137e4b60806Smrg fi]) 2138e4b60806Smrgfi]) 2139ff143803Smrg 2140e4b60806Smrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory 2141e4b60806Smrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file: 2142e4b60806Smrgdnl HAVE_DOT = @HAVE_DOT@ 2143e4b60806SmrgHAVE_DOT=no 2144e4b60806Smrgif test "x$have_doxygen" = "xyes"; then 2145e4b60806Smrg AC_PATH_PROG([DOT], [dot]) 2146e4b60806Smrg if test "x$DOT" != "x"; then 2147e4b60806Smrg HAVE_DOT=yes 2148e4b60806Smrg fi 2149e4b60806Smrgfi 2150ff143803Smrg 2151e4b60806SmrgAC_SUBST([HAVE_DOT]) 2152e4b60806SmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"]) 2153e4b60806SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes]) 2154e4b60806Smrg]) # XORG_WITH_DOXYGEN 2155ff143803Smrg 2156e4b60806Smrg# XORG_WITH_GROFF([DEFAULT]) 2157e4b60806Smrg# ---------------- 2158e4b60806Smrg# Minimum version: 1.6.0 2159e4b60806Smrg# Minimum version for optional DEFAULT argument: 1.11.0 2160ff143803Smrg# 2161e4b60806Smrg# Documentation tools are not always available on all platforms and sometimes 2162e4b60806Smrg# not at the appropriate level. This macro enables a module to test for the 2163e4b60806Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 2164e4efb0bcSmrg# the --with-groff option, it allows maximum flexibility in making decisions 2165e4b60806Smrg# as whether or not to use the groff package. When DEFAULT is not specified, 2166e4b60806Smrg# --with-groff assumes 'auto'. 2167e4b60806Smrg# 2168e4b60806Smrg# Interface to module: 2169e4b60806Smrg# HAVE_GROFF: used in makefiles to conditionally generate documentation 2170e4b60806Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package 2171e4b60806Smrg# HAVE_GROFF_MS: the -ms macros package 2172e4b60806Smrg# GROFF: returns the path of the groff program found 2173e4b60806Smrg# returns the path set by the user in the environment 2174e4b60806Smrg# --with-groff: 'yes' user instructs the module to use groff 2175e4b60806Smrg# 'no' user instructs the module not to use groff 2176e4b60806Smrg# 2177e4b60806Smrg# Added in version 1.9.0: 2178e4b60806Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format: 2179e4b60806Smrg# pnmcut pnmcrop pnmtopng pnmtops from the netpbm package. 2180e4b60806Smrg# psselect from the psutils package. 2181e4b60806Smrg# the ghostcript package. Refer to the grohtml man pages 2182e4b60806Smrg# 2183e4b60806Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path. 2184e4b60806Smrg# 2185e4b60806Smrg# OS and distros often splits groff in a basic and full package, the former 2186e4b60806Smrg# having the groff program and the later having devices, fonts and macros 2187e4b60806Smrg# Checking for the groff executable is not enough. 2188e4b60806Smrg# 2189e4b60806Smrg# If macros are missing, we cannot assume that groff is useless, so we don't 2190e4b60806Smrg# unset HAVE_GROFF or GROFF env variables. 2191e4b60806Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false. 2192e4b60806Smrg# 2193e4b60806SmrgAC_DEFUN([XORG_WITH_GROFF],[ 2194e4b60806SmrgAC_ARG_VAR([GROFF], [Path to groff command]) 2195e4b60806Smrgm4_define([_defopt], m4_default([$1], [auto])) 2196e4b60806SmrgAC_ARG_WITH(groff, 2197e4b60806Smrg AS_HELP_STRING([--with-groff], 2198e4b60806Smrg [Use groff to regenerate documentation (default: ]_defopt[)]), 2199e4b60806Smrg [use_groff=$withval], [use_groff=]_defopt) 2200e4b60806Smrgm4_undefine([_defopt]) 2201ff143803Smrg 2202e4b60806Smrgif test "x$use_groff" = x"auto"; then 2203e4b60806Smrg AC_PATH_PROG([GROFF], [groff]) 2204e4b60806Smrg if test "x$GROFF" = "x"; then 2205e4b60806Smrg AC_MSG_WARN([groff not found - documentation targets will be skipped]) 2206e4b60806Smrg have_groff=no 2207e4b60806Smrg else 2208e4b60806Smrg have_groff=yes 2209e4b60806Smrg fi 2210e4b60806Smrgelif test "x$use_groff" = x"yes" ; then 2211e4b60806Smrg AC_PATH_PROG([GROFF], [groff]) 2212e4b60806Smrg if test "x$GROFF" = "x"; then 2213e4b60806Smrg AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH]) 2214e4b60806Smrg fi 2215e4b60806Smrg have_groff=yes 2216e4b60806Smrgelif test "x$use_groff" = x"no" ; then 2217e4b60806Smrg if test "x$GROFF" != "x"; then 2218e4b60806Smrg AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified]) 2219e4b60806Smrg fi 2220e4b60806Smrg have_groff=no 2221e4b60806Smrgelse 2222e4b60806Smrg AC_MSG_ERROR([--with-groff expects 'yes' or 'no']) 2223e4b60806Smrgfi 2224ff143803Smrg 2225e4b60806Smrg# We have groff, test for the presence of the macro packages 2226e4b60806Smrgif test "x$have_groff" = x"yes"; then 2227e4b60806Smrg AC_MSG_CHECKING([for ${GROFF} -ms macros]) 2228e4b60806Smrg if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then 2229e4b60806Smrg groff_ms_works=yes 2230e4b60806Smrg else 2231e4b60806Smrg groff_ms_works=no 2232ff143803Smrg fi 2233e4b60806Smrg AC_MSG_RESULT([$groff_ms_works]) 2234e4b60806Smrg AC_MSG_CHECKING([for ${GROFF} -mm macros]) 2235e4b60806Smrg if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then 2236e4b60806Smrg groff_mm_works=yes 2237e4b60806Smrg else 2238e4b60806Smrg groff_mm_works=no 2239e4b60806Smrg fi 2240e4b60806Smrg AC_MSG_RESULT([$groff_mm_works]) 2241e4b60806Smrgfi 2242ff143803Smrg 2243e4b60806Smrg# We have groff, test for HTML dependencies, one command per package 2244e4b60806Smrgif test "x$have_groff" = x"yes"; then 2245e4b60806Smrg AC_PATH_PROGS(GS_PATH, [gs gswin32c]) 2246e4b60806Smrg AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng]) 2247e4b60806Smrg AC_PATH_PROG(PSSELECT_PATH, [psselect]) 2248e4b60806Smrg if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then 2249e4b60806Smrg have_groff_html=yes 2250e4b60806Smrg else 2251e4b60806Smrg have_groff_html=no 2252e4b60806Smrg AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages]) 2253e4b60806Smrg fi 2254e4b60806Smrgfi 2255e4b60806Smrg 2256e4b60806Smrg# Set Automake conditionals for Makefiles 2257e4b60806SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes]) 2258e4b60806SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes]) 2259e4b60806SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes]) 2260e4b60806SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes]) 2261e4b60806Smrg]) # XORG_WITH_GROFF 2262e4b60806Smrg 2263e4b60806Smrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT]) 2264e4b60806Smrg# --------------------------------------- 2265e4b60806Smrg# Minimum version: 1.6.0 2266e4b60806Smrg# Minimum version for optional DEFAULT argument: 1.11.0 2267e4b60806Smrg# Minimum version for optional MIN-VERSION argument: 1.15.0 2268e4b60806Smrg# 2269e4b60806Smrg# Documentation tools are not always available on all platforms and sometimes 2270e4b60806Smrg# not at the appropriate level. This macro enables a module to test for the 2271e4b60806Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 2272e4efb0bcSmrg# the --with-fop option, it allows maximum flexibility in making decisions 2273e4b60806Smrg# as whether or not to use the fop package. When DEFAULT is not specified, 2274e4b60806Smrg# --with-fop assumes 'auto'. 2275e4b60806Smrg# 2276e4b60806Smrg# Interface to module: 2277e4b60806Smrg# HAVE_FOP: used in makefiles to conditionally generate documentation 2278e4b60806Smrg# FOP: returns the path of the fop program found 2279e4b60806Smrg# returns the path set by the user in the environment 2280e4b60806Smrg# --with-fop: 'yes' user instructs the module to use fop 2281e4b60806Smrg# 'no' user instructs the module not to use fop 2282e4b60806Smrg# 2283e4b60806Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path. 2284e4b60806Smrg# 2285e4b60806SmrgAC_DEFUN([XORG_WITH_FOP],[ 2286e4b60806SmrgAC_ARG_VAR([FOP], [Path to fop command]) 2287e4b60806Smrgm4_define([_defopt], m4_default([$2], [auto])) 2288e4b60806SmrgAC_ARG_WITH(fop, 2289e4b60806Smrg AS_HELP_STRING([--with-fop], 2290e4b60806Smrg [Use fop to regenerate documentation (default: ]_defopt[)]), 2291e4b60806Smrg [use_fop=$withval], [use_fop=]_defopt) 2292e4b60806Smrgm4_undefine([_defopt]) 2293e4b60806Smrg 2294e4b60806Smrgif test "x$use_fop" = x"auto"; then 2295e4b60806Smrg AC_PATH_PROG([FOP], [fop]) 2296e4b60806Smrg if test "x$FOP" = "x"; then 2297e4b60806Smrg AC_MSG_WARN([fop not found - documentation targets will be skipped]) 2298e4b60806Smrg have_fop=no 2299e4b60806Smrg else 2300e4b60806Smrg have_fop=yes 2301e4b60806Smrg fi 2302e4b60806Smrgelif test "x$use_fop" = x"yes" ; then 2303e4b60806Smrg AC_PATH_PROG([FOP], [fop]) 2304e4b60806Smrg if test "x$FOP" = "x"; then 2305e4b60806Smrg AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH]) 2306e4b60806Smrg fi 2307e4b60806Smrg have_fop=yes 2308e4b60806Smrgelif test "x$use_fop" = x"no" ; then 2309e4b60806Smrg if test "x$FOP" != "x"; then 2310e4b60806Smrg AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified]) 2311e4b60806Smrg fi 2312e4b60806Smrg have_fop=no 2313ff143803Smrgelse 2314e4b60806Smrg AC_MSG_ERROR([--with-fop expects 'yes' or 'no']) 2315c3d5982aSmrgfi 2316c3d5982aSmrg 2317e4b60806Smrg# Test for a minimum version of fop, if provided. 2318e4b60806Smrgm4_ifval([$1], 2319e4b60806Smrg[if test "$have_fop" = yes; then 2320e4b60806Smrg # scrape the fop version 2321e4b60806Smrg AC_MSG_CHECKING([for fop minimum version]) 2322e4b60806Smrg fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3` 2323e4b60806Smrg AC_MSG_RESULT([$fop_version]) 2324e4b60806Smrg AS_VERSION_COMPARE([$fop_version], [$1], 2325e4b60806Smrg [if test "x$use_fop" = xauto; then 2326e4b60806Smrg AC_MSG_WARN([fop version $fop_version found, but $1 needed]) 2327e4b60806Smrg have_fop=no 2328e4b60806Smrg else 2329e4b60806Smrg AC_MSG_ERROR([fop version $fop_version found, but $1 needed]) 2330e4b60806Smrg fi]) 2331e4b60806Smrgfi]) 2332e4b60806SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes]) 2333e4b60806Smrg]) # XORG_WITH_FOP 2334e4b60806Smrg 2335e4b60806Smrg# XORG_WITH_M4([MIN-VERSION]) 2336e4b60806Smrg# --------------------------- 2337e4b60806Smrg# Minimum version: 1.19.0 2338e4b60806Smrg# 2339e4b60806Smrg# This macro attempts to locate an m4 macro processor which supports 2340e4b60806Smrg# -I option and is only useful for modules relying on M4 in order to 2341e4b60806Smrg# expand macros in source code files. 2342e4b60806Smrg# 2343e4b60806Smrg# Interface to module: 2344e4b60806Smrg# M4: returns the path of the m4 program found 2345e4b60806Smrg# returns the path set by the user in the environment 2346e4b60806Smrg# 2347e4b60806SmrgAC_DEFUN([XORG_WITH_M4], [ 2348e4b60806SmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4], 2349e4b60806Smrg [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4], 2350e4b60806Smrg [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \ 2351e4b60806Smrg ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]], 2352e4b60806Smrg [AC_MSG_ERROR([could not find m4 that supports -I option])], 2353e4b60806Smrg [$PATH:/usr/gnu/bin])]) 2354ff143803Smrg 2355e4b60806SmrgAC_SUBST([M4], [$ac_cv_path_M4]) 2356e4b60806Smrg]) # XORG_WITH_M4 2357ff143803Smrg 2358e4b60806Smrg# XORG_WITH_PS2PDF([DEFAULT]) 2359e4b60806Smrg# ---------------- 2360e4b60806Smrg# Minimum version: 1.6.0 2361e4b60806Smrg# Minimum version for optional DEFAULT argument: 1.11.0 2362e4b60806Smrg# 2363e4b60806Smrg# Documentation tools are not always available on all platforms and sometimes 2364e4b60806Smrg# not at the appropriate level. This macro enables a module to test for the 2365e4b60806Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 2366e4efb0bcSmrg# the --with-ps2pdf option, it allows maximum flexibility in making decisions 2367e4b60806Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified, 2368e4b60806Smrg# --with-ps2pdf assumes 'auto'. 2369e4b60806Smrg# 2370e4b60806Smrg# Interface to module: 2371e4b60806Smrg# HAVE_PS2PDF: used in makefiles to conditionally generate documentation 2372e4b60806Smrg# PS2PDF: returns the path of the ps2pdf program found 2373e4b60806Smrg# returns the path set by the user in the environment 2374e4b60806Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf 2375e4b60806Smrg# 'no' user instructs the module not to use ps2pdf 2376e4b60806Smrg# 2377e4b60806Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path. 2378e4b60806Smrg# 2379e4b60806SmrgAC_DEFUN([XORG_WITH_PS2PDF],[ 2380e4b60806SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command]) 2381e4b60806Smrgm4_define([_defopt], m4_default([$1], [auto])) 2382e4b60806SmrgAC_ARG_WITH(ps2pdf, 2383e4b60806Smrg AS_HELP_STRING([--with-ps2pdf], 2384e4b60806Smrg [Use ps2pdf to regenerate documentation (default: ]_defopt[)]), 2385e4b60806Smrg [use_ps2pdf=$withval], [use_ps2pdf=]_defopt) 2386e4b60806Smrgm4_undefine([_defopt]) 2387ff143803Smrg 2388e4b60806Smrgif test "x$use_ps2pdf" = x"auto"; then 2389e4b60806Smrg AC_PATH_PROG([PS2PDF], [ps2pdf]) 2390e4b60806Smrg if test "x$PS2PDF" = "x"; then 2391e4b60806Smrg AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped]) 2392e4b60806Smrg have_ps2pdf=no 2393e4b60806Smrg else 2394e4b60806Smrg have_ps2pdf=yes 2395e4b60806Smrg fi 2396e4b60806Smrgelif test "x$use_ps2pdf" = x"yes" ; then 2397e4b60806Smrg AC_PATH_PROG([PS2PDF], [ps2pdf]) 2398e4b60806Smrg if test "x$PS2PDF" = "x"; then 2399e4b60806Smrg AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH]) 2400e4b60806Smrg fi 2401e4b60806Smrg have_ps2pdf=yes 2402e4b60806Smrgelif test "x$use_ps2pdf" = x"no" ; then 2403e4b60806Smrg if test "x$PS2PDF" != "x"; then 2404e4b60806Smrg AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified]) 2405e4b60806Smrg fi 2406e4b60806Smrg have_ps2pdf=no 2407e4b60806Smrgelse 2408e4b60806Smrg AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no']) 2409c3d5982aSmrgfi 2410e4b60806SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes]) 2411e4b60806Smrg]) # XORG_WITH_PS2PDF 2412c3d5982aSmrg 2413e4b60806Smrg# XORG_ENABLE_DOCS (enable_docs=yes) 2414e4b60806Smrg# ---------------- 2415e4b60806Smrg# Minimum version: 1.6.0 2416c3d5982aSmrg# 2417e4b60806Smrg# Documentation tools are not always available on all platforms and sometimes 2418e4b60806Smrg# not at the appropriate level. This macro enables a builder to skip all 2419e4b60806Smrg# documentation targets except traditional man pages. 2420e4b60806Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 2421e4efb0bcSmrg# maximum flexibility in controlling documentation building. 2422e4b60806Smrg# Refer to: 2423e4b60806Smrg# XORG_WITH_XMLTO --with-xmlto 2424e4b60806Smrg# XORG_WITH_ASCIIDOC --with-asciidoc 2425e4b60806Smrg# XORG_WITH_DOXYGEN --with-doxygen 2426e4b60806Smrg# XORG_WITH_FOP --with-fop 2427e4b60806Smrg# XORG_WITH_GROFF --with-groff 2428e4b60806Smrg# XORG_WITH_PS2PDF --with-ps2pdf 2429e4b60806Smrg# 2430e4b60806Smrg# Interface to module: 2431e4b60806Smrg# ENABLE_DOCS: used in makefiles to conditionally generate documentation 2432e4b60806Smrg# --enable-docs: 'yes' user instructs the module to generate docs 2433e4b60806Smrg# 'no' user instructs the module not to generate docs 2434e4b60806Smrg# parm1: specify the default value, yes or no. 2435e4b60806Smrg# 2436e4b60806SmrgAC_DEFUN([XORG_ENABLE_DOCS],[ 2437e4b60806Smrgm4_define([docs_default], m4_default([$1], [yes])) 2438e4b60806SmrgAC_ARG_ENABLE(docs, 2439e4b60806Smrg AS_HELP_STRING([--enable-docs], 2440e4b60806Smrg [Enable building the documentation (default: ]docs_default[)]), 2441e4b60806Smrg [build_docs=$enableval], [build_docs=]docs_default) 2442e4b60806Smrgm4_undefine([docs_default]) 2443e4b60806SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes]) 2444e4b60806SmrgAC_MSG_CHECKING([whether to build documentation]) 2445e4b60806SmrgAC_MSG_RESULT([$build_docs]) 2446e4b60806Smrg]) # XORG_ENABLE_DOCS 2447c3d5982aSmrg 2448e4b60806Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes) 2449e4b60806Smrg# ---------------- 2450e4b60806Smrg# Minimum version: 1.6.0 2451e4b60806Smrg# 2452e4b60806Smrg# This macro enables a builder to skip all developer documentation. 2453e4b60806Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 2454e4efb0bcSmrg# maximum flexibility in controlling documentation building. 2455e4b60806Smrg# Refer to: 2456e4b60806Smrg# XORG_WITH_XMLTO --with-xmlto 2457e4b60806Smrg# XORG_WITH_ASCIIDOC --with-asciidoc 2458e4b60806Smrg# XORG_WITH_DOXYGEN --with-doxygen 2459e4b60806Smrg# XORG_WITH_FOP --with-fop 2460e4b60806Smrg# XORG_WITH_GROFF --with-groff 2461e4b60806Smrg# XORG_WITH_PS2PDF --with-ps2pdf 2462e4b60806Smrg# 2463e4b60806Smrg# Interface to module: 2464e4b60806Smrg# ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs 2465e4b60806Smrg# --enable-devel-docs: 'yes' user instructs the module to generate developer docs 2466e4b60806Smrg# 'no' user instructs the module not to generate developer docs 2467e4b60806Smrg# parm1: specify the default value, yes or no. 2468e4b60806Smrg# 2469e4b60806SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[ 2470e4b60806Smrgm4_define([devel_default], m4_default([$1], [yes])) 2471e4b60806SmrgAC_ARG_ENABLE(devel-docs, 2472e4b60806Smrg AS_HELP_STRING([--enable-devel-docs], 2473e4b60806Smrg [Enable building the developer documentation (default: ]devel_default[)]), 2474e4b60806Smrg [build_devel_docs=$enableval], [build_devel_docs=]devel_default) 2475e4b60806Smrgm4_undefine([devel_default]) 2476e4b60806SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes]) 2477e4b60806SmrgAC_MSG_CHECKING([whether to build developer documentation]) 2478e4b60806SmrgAC_MSG_RESULT([$build_devel_docs]) 2479e4b60806Smrg]) # XORG_ENABLE_DEVEL_DOCS 2480ff143803Smrg 2481e4b60806Smrg# XORG_ENABLE_SPECS (enable_specs=yes) 2482e4b60806Smrg# ---------------- 2483e4b60806Smrg# Minimum version: 1.6.0 2484e4b60806Smrg# 2485e4b60806Smrg# This macro enables a builder to skip all functional specification targets. 2486e4b60806Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 2487e4efb0bcSmrg# maximum flexibility in controlling documentation building. 2488e4b60806Smrg# Refer to: 2489e4b60806Smrg# XORG_WITH_XMLTO --with-xmlto 2490e4b60806Smrg# XORG_WITH_ASCIIDOC --with-asciidoc 2491e4b60806Smrg# XORG_WITH_DOXYGEN --with-doxygen 2492e4b60806Smrg# XORG_WITH_FOP --with-fop 2493e4b60806Smrg# XORG_WITH_GROFF --with-groff 2494e4b60806Smrg# XORG_WITH_PS2PDF --with-ps2pdf 2495e4b60806Smrg# 2496e4b60806Smrg# Interface to module: 2497e4b60806Smrg# ENABLE_SPECS: used in makefiles to conditionally generate specs 2498e4b60806Smrg# --enable-specs: 'yes' user instructs the module to generate specs 2499e4b60806Smrg# 'no' user instructs the module not to generate specs 2500e4b60806Smrg# parm1: specify the default value, yes or no. 2501e4b60806Smrg# 2502e4b60806SmrgAC_DEFUN([XORG_ENABLE_SPECS],[ 2503e4b60806Smrgm4_define([spec_default], m4_default([$1], [yes])) 2504e4b60806SmrgAC_ARG_ENABLE(specs, 2505e4b60806Smrg AS_HELP_STRING([--enable-specs], 2506e4b60806Smrg [Enable building the specs (default: ]spec_default[)]), 2507e4b60806Smrg [build_specs=$enableval], [build_specs=]spec_default) 2508e4b60806Smrgm4_undefine([spec_default]) 2509e4b60806SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes]) 2510e4b60806SmrgAC_MSG_CHECKING([whether to build functional specifications]) 2511e4b60806SmrgAC_MSG_RESULT([$build_specs]) 2512e4b60806Smrg]) # XORG_ENABLE_SPECS 2513ff143803Smrg 2514e4b60806Smrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto) 2515e4b60806Smrg# ---------------------------------------------- 2516e4b60806Smrg# Minimum version: 1.13.0 2517c3d5982aSmrg# 2518e4b60806Smrg# This macro enables a builder to enable/disable unit testing 2519e4b60806Smrg# It makes no assumption about the test cases implementation 2520e4b60806Smrg# Test cases may or may not use Automake "Support for test suites" 2521e4b60806Smrg# They may or may not use the software utility library GLib 2522e4b60806Smrg# 2523e4b60806Smrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL 2524e4b60806Smrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib. 2525e4b60806Smrg# The variable enable_unit_tests is used by other macros in this file. 2526e4b60806Smrg# 2527e4b60806Smrg# Interface to module: 2528e4b60806Smrg# ENABLE_UNIT_TESTS: used in makefiles to conditionally build tests 2529e4b60806Smrg# enable_unit_tests: used in configure.ac for additional configuration 2530e4b60806Smrg# --enable-unit-tests: 'yes' user instructs the module to build tests 2531e4b60806Smrg# 'no' user instructs the module not to build tests 2532e4b60806Smrg# parm1: specify the default value, yes or no. 2533e4b60806Smrg# 2534e4b60806SmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[ 2535e4b60806SmrgAC_BEFORE([$0], [XORG_WITH_GLIB]) 2536e4b60806SmrgAC_BEFORE([$0], [XORG_LD_WRAP]) 2537e4b60806SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS]) 2538e4b60806Smrgm4_define([_defopt], m4_default([$1], [auto])) 2539e4b60806SmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests], 2540e4b60806Smrg [Enable building unit test cases (default: ]_defopt[)]), 2541e4b60806Smrg [enable_unit_tests=$enableval], [enable_unit_tests=]_defopt) 2542e4b60806Smrgm4_undefine([_defopt]) 2543e4b60806SmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno]) 2544e4b60806SmrgAC_MSG_CHECKING([whether to build unit test cases]) 2545e4b60806SmrgAC_MSG_RESULT([$enable_unit_tests]) 2546e4b60806Smrg]) # XORG_ENABLE_UNIT_TESTS 2547ff143803Smrg 2548e4b60806Smrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto) 2549e4b60806Smrg# ------------------------------------------------------ 2550e4b60806Smrg# Minimum version: 1.17.0 2551e4b60806Smrg# 2552e4b60806Smrg# This macro enables a builder to enable/disable integration testing 2553e4b60806Smrg# It makes no assumption about the test cases' implementation 2554e4b60806Smrg# Test cases may or may not use Automake "Support for test suites" 2555e4b60806Smrg# 2556e4b60806Smrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support 2557e4b60806Smrg# usually requires less dependencies and may be built and run under less 2558e4b60806Smrg# stringent environments than integration tests. 2559e4b60806Smrg# 2560e4b60806Smrg# Interface to module: 2561e4b60806Smrg# ENABLE_INTEGRATION_TESTS: used in makefiles to conditionally build tests 2562e4b60806Smrg# enable_integration_tests: used in configure.ac for additional configuration 2563e4b60806Smrg# --enable-integration-tests: 'yes' user instructs the module to build tests 2564e4b60806Smrg# 'no' user instructs the module not to build tests 2565e4b60806Smrg# parm1: specify the default value, yes or no. 2566e4b60806Smrg# 2567e4b60806SmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[ 2568e4b60806SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS]) 2569e4b60806Smrgm4_define([_defopt], m4_default([$1], [auto])) 2570e4b60806SmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests], 2571e4b60806Smrg [Enable building integration test cases (default: ]_defopt[)]), 2572e4b60806Smrg [enable_integration_tests=$enableval], 2573e4b60806Smrg [enable_integration_tests=]_defopt) 2574e4b60806Smrgm4_undefine([_defopt]) 2575e4b60806SmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS], 2576e4b60806Smrg [test "x$enable_integration_tests" != xno]) 2577e4b60806SmrgAC_MSG_CHECKING([whether to build unit test cases]) 2578e4b60806SmrgAC_MSG_RESULT([$enable_integration_tests]) 2579e4b60806Smrg]) # XORG_ENABLE_INTEGRATION_TESTS 2580ff143803Smrg 2581e4b60806Smrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT]) 2582e4b60806Smrg# ---------------------------------------- 2583e4b60806Smrg# Minimum version: 1.13.0 2584e4b60806Smrg# 2585e4b60806Smrg# GLib is a library which provides advanced data structures and functions. 2586e4b60806Smrg# This macro enables a module to test for the presence of Glib. 2587e4b60806Smrg# 2588e4b60806Smrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing. 2589e4b60806Smrg# Otherwise the value of $enable_unit_tests is blank. 2590e4b60806Smrg# 2591e4b60806Smrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit 2592e4b60806Smrg# test support usually requires less dependencies and may be built and run under 2593e4b60806Smrg# less stringent environments than integration tests. 2594c3d5982aSmrg# 2595e4b60806Smrg# Interface to module: 2596e4b60806Smrg# HAVE_GLIB: used in makefiles to conditionally build targets 2597e4b60806Smrg# with_glib: used in configure.ac to know if GLib has been found 2598e4b60806Smrg# --with-glib: 'yes' user instructs the module to use glib 2599e4b60806Smrg# 'no' user instructs the module not to use glib 2600e4b60806Smrg# 2601e4b60806SmrgAC_DEFUN([XORG_WITH_GLIB],[ 2602e4b60806SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG]) 2603e4b60806Smrgm4_define([_defopt], m4_default([$2], [auto])) 2604e4b60806SmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib], 2605e4b60806Smrg [Use GLib library for unit testing (default: ]_defopt[)]), 2606e4b60806Smrg [with_glib=$withval], [with_glib=]_defopt) 2607e4b60806Smrgm4_undefine([_defopt]) 2608c3d5982aSmrg 2609e4b60806Smrghave_glib=no 2610e4b60806Smrg# Do not probe GLib if user explicitly disabled unit testing 2611e4b60806Smrgif test "x$enable_unit_tests" != x"no"; then 2612e4b60806Smrg # Do not probe GLib if user explicitly disabled it 2613e4b60806Smrg if test "x$with_glib" != x"no"; then 2614e4b60806Smrg m4_ifval( 2615e4b60806Smrg [$1], 2616e4b60806Smrg [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])], 2617e4b60806Smrg [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])] 2618e4b60806Smrg ) 2619ff143803Smrg fi 2620c3d5982aSmrgfi 2621c3d5982aSmrg 2622e4b60806Smrg# Not having GLib when unit testing has been explicitly requested is an error 2623e4b60806Smrgif test "x$enable_unit_tests" = x"yes"; then 2624e4b60806Smrg if test "x$have_glib" = x"no"; then 2625e4b60806Smrg AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found]) 2626ff143803Smrg fi 2627ff143803Smrgfi 26287da8b7e3Smrg 2629e4b60806Smrg# Having unit testing disabled when GLib has been explicitly requested is an error 2630e4b60806Smrgif test "x$enable_unit_tests" = x"no"; then 2631e4b60806Smrg if test "x$with_glib" = x"yes"; then 2632e4b60806Smrg AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found]) 2633e4b60806Smrg fi 2634e4b60806Smrgfi 26357da8b7e3Smrg 2636e4b60806Smrg# Not having GLib when it has been explicitly requested is an error 2637e4b60806Smrgif test "x$with_glib" = x"yes"; then 2638e4b60806Smrg if test "x$have_glib" = x"no"; then 2639e4b60806Smrg AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found]) 2640e4b60806Smrg fi 2641e4b60806Smrgfi 26427da8b7e3Smrg 2643e4b60806SmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes]) 2644e4b60806Smrg]) # XORG_WITH_GLIB 2645ff143803Smrg 2646e4b60806Smrg# XORG_LD_WRAP([required|optional]) 2647e4b60806Smrg# --------------------------------- 2648e4b60806Smrg# Minimum version: 1.13.0 2649e4b60806Smrg# 2650e4b60806Smrg# Check if linker supports -wrap, passed via compiler flags 2651e4b60806Smrg# 2652e4b60806Smrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing. 2653e4b60806Smrg# Otherwise the value of $enable_unit_tests is blank. 2654e4b60806Smrg# 2655e4b60806Smrg# Argument added in 1.16.0 - default is "required", to match existing behavior 2656e4b60806Smrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not 2657e4b60806Smrg# available, an argument of "optional" allows use when some unit tests require 2658e4b60806Smrg# ld -wrap and others do not. 2659e4b60806Smrg# 2660e4b60806SmrgAC_DEFUN([XORG_LD_WRAP],[ 2661e4b60806SmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no], 2662e4b60806Smrg [AC_LANG_PROGRAM([#include <stdlib.h> 2663e4b60806Smrg void __wrap_exit(int status) { return; }], 2664e4b60806Smrg [exit(0);])]) 2665e4b60806Smrg# Not having ld wrap when unit testing has been explicitly requested is an error 2666e4b60806Smrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then 2667e4b60806Smrg if test "x$have_ld_wrap" = x"no"; then 2668e4b60806Smrg AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available]) 2669e4b60806Smrg fi 2670e4b60806Smrgfi 2671e4b60806SmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes]) 2672e4b60806Smrg# 2673e4b60806Smrg]) # XORG_LD_WRAP 2674ff143803Smrg 2675e4b60806Smrg# XORG_CHECK_LINKER_FLAGS 2676e4b60806Smrg# ----------------------- 2677e4b60806Smrg# SYNOPSIS 2678e4b60806Smrg# 2679e4b60806Smrg# XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE]) 2680e4b60806Smrg# 2681e4b60806Smrg# DESCRIPTION 2682e4b60806Smrg# 2683e4b60806Smrg# Check whether the given linker FLAGS work with the current language's 2684e4b60806Smrg# linker, or whether they give an error. 2685e4b60806Smrg# 2686e4b60806Smrg# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on 2687e4b60806Smrg# success/failure. 2688e4b60806Smrg# 2689e4b60806Smrg# PROGRAM-SOURCE is the program source to link with, if needed 2690e4b60806Smrg# 2691e4b60806Smrg# NOTE: Based on AX_CHECK_COMPILER_FLAGS. 2692e4b60806Smrg# 2693e4b60806Smrg# LICENSE 2694e4b60806Smrg# 2695e4b60806Smrg# Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org> 2696e4b60806Smrg# Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu> 2697e4b60806Smrg# Copyright (c) 2009 Matteo Frigo 2698e4b60806Smrg# 2699e4b60806Smrg# This program is free software: you can redistribute it and/or modify it 2700e4b60806Smrg# under the terms of the GNU General Public License as published by the 2701e4b60806Smrg# Free Software Foundation, either version 3 of the License, or (at your 2702e4b60806Smrg# option) any later version. 2703e4b60806Smrg# 2704e4b60806Smrg# This program is distributed in the hope that it will be useful, but 2705e4b60806Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of 2706e4b60806Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 2707e4b60806Smrg# Public License for more details. 2708e4b60806Smrg# 2709e4b60806Smrg# You should have received a copy of the GNU General Public License along 2710e4b60806Smrg# with this program. If not, see <http://www.gnu.org/licenses/>. 2711e4b60806Smrg# 2712e4b60806Smrg# As a special exception, the respective Autoconf Macro's copyright owner 2713e4b60806Smrg# gives unlimited permission to copy, distribute and modify the configure 2714e4b60806Smrg# scripts that are the output of Autoconf when processing the Macro. You 2715e4b60806Smrg# need not follow the terms of the GNU General Public License when using 2716e4b60806Smrg# or distributing such scripts, even though portions of the text of the 2717e4b60806Smrg# Macro appear in them. The GNU General Public License (GPL) does govern 2718e4b60806Smrg# all other use of the material that constitutes the Autoconf Macro. 2719e4b60806Smrg# 2720e4b60806Smrg# This special exception to the GPL applies to versions of the Autoconf 2721e4b60806Smrg# Macro released by the Autoconf Archive. When you make and distribute a 2722e4b60806Smrg# modified version of the Autoconf Macro, you may extend this special 2723e4b60806Smrg# exception to the GPL to apply to your modified version as well.# 2724e4b60806SmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS], 2725e4b60806Smrg[AC_MSG_CHECKING([whether the linker accepts $1]) 2726e4b60806Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname: 2727e4b60806SmrgAS_LITERAL_IF([$1], 2728e4b60806Smrg [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [ 2729e4b60806Smrg ax_save_FLAGS=$LDFLAGS 2730e4b60806Smrg LDFLAGS="$1" 2731e4b60806Smrg AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])], 2732e4b60806Smrg AS_TR_SH(xorg_cv_linker_flags_[$1])=yes, 2733e4b60806Smrg AS_TR_SH(xorg_cv_linker_flags_[$1])=no) 2734e4b60806Smrg LDFLAGS=$ax_save_FLAGS])], 2735e4b60806Smrg [ax_save_FLAGS=$LDFLAGS 2736e4b60806Smrg LDFLAGS="$1" 2737e4b60806Smrg AC_LINK_IFELSE([AC_LANG_PROGRAM()], 2738e4b60806Smrg eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes, 2739e4b60806Smrg eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no) 2740e4b60806Smrg LDFLAGS=$ax_save_FLAGS]) 2741e4b60806Smrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1]) 2742e4b60806SmrgAC_MSG_RESULT($xorg_check_linker_flags) 2743e4b60806Smrgif test "x$xorg_check_linker_flags" = xyes; then 2744e4b60806Smrg m4_default([$2], :) 2745e4b60806Smrgelse 2746e4b60806Smrg m4_default([$3], :) 2747e4b60806Smrgfi 2748e4b60806Smrg]) # XORG_CHECK_LINKER_FLAGS 27497da8b7e3Smrg 2750e4b60806Smrg# XORG_MEMORY_CHECK_FLAGS 2751e4b60806Smrg# ----------------------- 2752e4b60806Smrg# Minimum version: 1.16.0 2753e4b60806Smrg# 2754e4b60806Smrg# This macro attempts to find appropriate memory checking functionality 2755e4b60806Smrg# for various platforms which unit testing code may use to catch various 2756e4b60806Smrg# forms of memory allocation and access errors in testing. 2757e4b60806Smrg# 2758e4b60806Smrg# Interface to module: 2759e4b60806Smrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging 2760e4b60806Smrg# Usually added to TESTS_ENVIRONMENT in Makefile.am 2761e4b60806Smrg# 2762e4b60806Smrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim. 2763e4b60806Smrg# 2764e4b60806SmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[ 2765123e2cc7Smrg 2766e4b60806SmrgAC_REQUIRE([AC_CANONICAL_HOST]) 2767e4b60806SmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV], 2768e4b60806Smrg [Environment variables to enable memory checking in tests]) 2769bded5d25Smrg 2770e4b60806Smrg# Check for different types of support on different platforms 2771e4b60806Smrgcase $host_os in 2772e4b60806Smrg solaris*) 2773e4b60806Smrg AC_CHECK_LIB([umem], [umem_alloc], 2774e4b60806Smrg [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default']) 2775e4b60806Smrg ;; 2776e4b60806Smrg *-gnu*) # GNU libc - Value is used as a single byte bit pattern, 2777e4b60806Smrg # both directly and inverted, so should not be 0 or 255. 2778e4b60806Smrg malloc_debug_env='MALLOC_PERTURB_=15' 2779e4b60806Smrg ;; 2780e4b60806Smrg darwin*) 2781e4b60806Smrg malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib' 2782e4b60806Smrg ;; 2783e4b60806Smrg *bsd*) 2784e4b60806Smrg malloc_debug_env='MallocPreScribble=1 MallocScribble=1' 2785e4b60806Smrg ;; 2786e4b60806Smrgesac 2787bded5d25Smrg 2788e4b60806Smrg# User supplied flags override default flags 2789e4b60806Smrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then 2790e4b60806Smrg malloc_debug_env="$XORG_MALLOC_DEBUG_ENV" 2791123e2cc7Smrgfi 27927da8b7e3Smrg 2793e4b60806SmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env]) 2794e4b60806Smrg]) # XORG_WITH_LINT 27957da8b7e3Smrg 2796e4b60806Smrg# XORG_CHECK_MALLOC_ZERO 2797e4b60806Smrg# ---------------------- 2798e4b60806Smrg# Minimum version: 1.0.0 2799bded5d25Smrg# 2800e4b60806Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if 2801e4b60806Smrg# malloc(0) returns NULL. Packages should add one of these cflags to 2802e4b60806Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. 2803e4b60806SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[ 2804e4b60806SmrgAC_ARG_ENABLE(malloc0returnsnull, 2805e4b60806Smrg AS_HELP_STRING([--enable-malloc0returnsnull], 2806e4b60806Smrg [malloc(0) returns NULL (default: auto)]), 2807e4b60806Smrg [MALLOC_ZERO_RETURNS_NULL=$enableval], 2808e4b60806Smrg [MALLOC_ZERO_RETURNS_NULL=auto]) 28097da8b7e3Smrg 2810e4b60806SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL]) 2811e4b60806Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then 2812e4b60806SmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null], 2813e4b60806Smrg [AC_RUN_IFELSE([AC_LANG_PROGRAM([ 2814e4b60806Smrg#include <stdlib.h> 2815e4b60806Smrg],[ 2816e4b60806Smrg char *m0, *r0, *c0, *p; 2817e4b60806Smrg m0 = malloc(0); 2818e4b60806Smrg p = malloc(10); 2819e4b60806Smrg r0 = realloc(p,0); 2820e4b60806Smrg c0 = calloc(0,10); 2821e4b60806Smrg exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1); 2822e4b60806Smrg])], 2823e4b60806Smrg [xorg_cv_malloc0_returns_null=yes], 2824e4b60806Smrg [xorg_cv_malloc0_returns_null=no])]) 2825e4b60806SmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null 2826ff143803Smrgfi 2827e4b60806SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) 2828ff143803Smrg 2829e4b60806Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then 2830e4b60806Smrg MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" 2831e4b60806Smrg XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS 2832e4b60806Smrg XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" 2833ff143803Smrgelse 2834e4b60806Smrg MALLOC_ZERO_CFLAGS="" 2835e4b60806Smrg XMALLOC_ZERO_CFLAGS="" 2836e4b60806Smrg XTMALLOC_ZERO_CFLAGS="" 2837123e2cc7Smrgfi 2838bded5d25Smrg 2839e4b60806SmrgAC_SUBST([MALLOC_ZERO_CFLAGS]) 2840e4b60806SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS]) 2841e4b60806SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS]) 2842e4b60806Smrg]) # XORG_CHECK_MALLOC_ZERO 28437da8b7e3Smrg 2844e4b60806Smrg# XORG_WITH_LINT() 2845e4b60806Smrg# ---------------- 2846e4b60806Smrg# Minimum version: 1.1.0 2847c3d5982aSmrg# 2848e4b60806Smrg# This macro enables the use of a tool that flags some suspicious and 2849e4b60806Smrg# non-portable constructs (likely to be bugs) in C language source code. 2850e4b60806Smrg# It will attempt to locate the tool and use appropriate options. 2851e4b60806Smrg# There are various lint type tools on different platforms. 2852ff143803Smrg# 2853e4b60806Smrg# Interface to module: 2854e4b60806Smrg# LINT: returns the path to the tool found on the platform 2855e4b60806Smrg# or the value set to LINT on the configure cmd line 2856e4b60806Smrg# also an Automake conditional 2857e4b60806Smrg# LINT_FLAGS: an Automake variable with appropriate flags 2858e4b60806Smrg# 2859e4b60806Smrg# --with-lint: 'yes' user instructs the module to use lint 2860e4b60806Smrg# 'no' user instructs the module not to use lint (default) 2861e4b60806Smrg# 2862e4b60806Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path. 2863e4b60806Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim. 2864e4b60806Smrg# 2865e4b60806SmrgAC_DEFUN([XORG_WITH_LINT],[ 2866c3d5982aSmrg 2867e4b60806SmrgAC_ARG_VAR([LINT], [Path to a lint-style command]) 2868e4b60806SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command]) 2869e4b60806SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint], 2870e4b60806Smrg [Use a lint-style source code checker (default: disabled)])], 2871e4b60806Smrg [use_lint=$withval], [use_lint=no]) 2872c3d5982aSmrg 2873e4b60806Smrg# Obtain platform specific info like program name and options 2874e4b60806Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris 2875e4b60806Smrgcase $host_os in 2876e4b60806Smrg *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*) 2877e4b60806Smrg lint_name=splint 2878e4b60806Smrg lint_options="-badflag" 2879e4b60806Smrg ;; 2880e4b60806Smrg *freebsd* | *netbsd*) 2881e4b60806Smrg lint_name=lint 2882e4b60806Smrg lint_options="-u -b" 2883e4b60806Smrg ;; 2884e4b60806Smrg *solaris*) 2885e4b60806Smrg lint_name=lint 2886e4b60806Smrg lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2" 2887e4b60806Smrg ;; 2888e4b60806Smrgesac 2889e4b60806Smrg 2890e4b60806Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user) 2891e4b60806Smrgif test "x$use_lint" = x"yes" ; then 2892e4b60806Smrg AC_PATH_PROG([LINT], [$lint_name]) 2893e4b60806Smrg if test "x$LINT" = "x"; then 2894e4b60806Smrg AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH]) 2895e4b60806Smrg fi 2896e4b60806Smrgelif test "x$use_lint" = x"no" ; then 2897e4b60806Smrg if test "x$LINT" != "x"; then 2898e4b60806Smrg AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified]) 2899e4b60806Smrg fi 2900ff143803Smrgelse 2901e4b60806Smrg AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.]) 2902c3d5982aSmrgfi 2903c3d5982aSmrg 2904e4b60806Smrg# User supplied flags override default flags 2905e4b60806Smrgif test "x$LINT_FLAGS" != "x"; then 2906e4b60806Smrg lint_options=$LINT_FLAGS 2907e4b60806Smrgfi 2908c3d5982aSmrg 2909e4b60806SmrgAC_SUBST([LINT_FLAGS],[$lint_options]) 2910e4b60806SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x]) 2911c3d5982aSmrg 2912e4b60806Smrg]) # XORG_WITH_LINT 2913c3d5982aSmrg 2914e4b60806Smrg# XORG_LINT_LIBRARY(LIBNAME) 2915e4b60806Smrg# -------------------------- 2916e4b60806Smrg# Minimum version: 1.1.0 2917c3d5982aSmrg# 2918e4b60806Smrg# Sets up flags for building lint libraries for checking programs that call 2919e4b60806Smrg# functions in the library. 2920e4b60806Smrg# 2921e4b60806Smrg# Interface to module: 2922e4b60806Smrg# LINTLIB - Automake variable with the name of lint library file to make 2923e4b60806Smrg# MAKE_LINT_LIB - Automake conditional 2924e4b60806Smrg# 2925e4b60806Smrg# --enable-lint-library: - 'yes' user instructs the module to created a lint library 2926e4b60806Smrg# - 'no' user instructs the module not to create a lint library (default) 2927c3d5982aSmrg 2928e4b60806SmrgAC_DEFUN([XORG_LINT_LIBRARY],[ 2929e4b60806SmrgAC_REQUIRE([XORG_WITH_LINT]) 2930e4b60806SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library], 2931e4b60806Smrg [Create lint library (default: disabled)])], 2932e4b60806Smrg [make_lint_lib=$enableval], [make_lint_lib=no]) 2933e4b60806Smrg 2934e4b60806Smrgif test "x$make_lint_lib" = x"yes" ; then 2935e4b60806Smrg LINTLIB=llib-l$1.ln 2936e4b60806Smrg if test "x$LINT" = "x"; then 2937e4b60806Smrg AC_MSG_ERROR([Cannot make lint library without --with-lint]) 2938e4b60806Smrg fi 2939e4b60806Smrgelif test "x$make_lint_lib" != x"no" ; then 2940e4b60806Smrg AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.]) 2941c3d5982aSmrgfi 2942ff143803Smrg 2943e4b60806SmrgAC_SUBST(LINTLIB) 2944e4b60806SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno]) 2945ff143803Smrg 2946e4b60806Smrg]) # XORG_LINT_LIBRARY 2947c3d5982aSmrg 2948e4b60806Smrg# XORG_COMPILER_BRAND 2949ff143803Smrg# ------------------- 2950e4b60806Smrg# Minimum version: 1.14.0 2951ff143803Smrg# 2952e4b60806Smrg# Checks for various brands of compilers and sets flags as appropriate: 2953e4b60806Smrg# GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes" 2954e4b60806Smrg# GNU g++ - relies on AC_PROG_CXX to set GXX to "yes" 2955e4b60806Smrg# clang compiler - sets CLANGCC to "yes" 2956e4b60806Smrg# Intel compiler - sets INTELCC to "yes" 2957e4b60806Smrg# Sun/Oracle Solaris Studio cc - sets SUNCC to "yes" 2958e4b60806Smrg# 2959e4b60806SmrgAC_DEFUN([XORG_COMPILER_BRAND], [ 2960e4b60806SmrgAC_LANG_CASE( 2961e4b60806Smrg [C], [ 2962e4efb0bcSmrg dnl autoconf-2.70 folded AC_PROG_CC_C99 into AC_PROG_CC 2963e4efb0bcSmrg dnl and complains that AC_PROG_CC_C99 is obsolete 2964e4efb0bcSmrg m4_version_prereq([2.70], 2965e4efb0bcSmrg [AC_REQUIRE([AC_PROG_CC])], 2966e4efb0bcSmrg [AC_REQUIRE([AC_PROG_CC_C99])]) 2967e4b60806Smrg ], 2968e4b60806Smrg [C++], [ 2969e4b60806Smrg AC_REQUIRE([AC_PROG_CXX]) 2970e4b60806Smrg ] 2971e4b60806Smrg) 2972e4b60806SmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"]) 2973e4b60806SmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"]) 2974e4b60806SmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) 2975e4b60806Smrg]) # XORG_COMPILER_BRAND 2976c3d5982aSmrg 2977e4b60806Smrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...]) 2978ff143803Smrg# --------------- 2979e4b60806Smrg# Minimum version: 1.16.0 2980e4b60806Smrg# 2981e4b60806Smrg# Test if the compiler works when passed the given flag as a command line argument. 2982e4efb0bcSmrg# If it succeeds, the flag is appended to the given variable. If not, it tries the 2983e4b60806Smrg# next flag in the list until there are no more options. 2984e4b60806Smrg# 2985e4b60806Smrg# Note that this does not guarantee that the compiler supports the flag as some 2986e4b60806Smrg# compilers will simply ignore arguments that they do not understand, but we do 2987e4b60806Smrg# attempt to weed out false positives by using -Werror=unknown-warning-option and 2988e4b60806Smrg# -Werror=unused-command-line-argument 2989e4b60806Smrg# 2990e4b60806SmrgAC_DEFUN([XORG_TESTSET_CFLAG], [ 2991e4b60806Smrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])]) 2992e4b60806Smrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])]) 2993c3d5982aSmrg 2994e4b60806SmrgAC_LANG_COMPILER_REQUIRE 2995c3d5982aSmrg 2996e4b60806SmrgAC_LANG_CASE( 2997e4b60806Smrg [C], [ 2998e4efb0bcSmrg dnl autoconf-2.70 folded AC_PROG_CC_C99 into AC_PROG_CC 2999e4efb0bcSmrg dnl and complains that AC_PROG_CC_C99 is obsolete 3000e4efb0bcSmrg m4_version_prereq([2.70], 3001e4efb0bcSmrg [AC_REQUIRE([AC_PROG_CC])], 3002e4efb0bcSmrg [AC_REQUIRE([AC_PROG_CC_C99])]) 3003e4b60806Smrg define([PREFIX], [C]) 3004e4b60806Smrg define([CACHE_PREFIX], [cc]) 3005e4b60806Smrg define([COMPILER], [$CC]) 3006e4b60806Smrg ], 3007e4b60806Smrg [C++], [ 3008e4b60806Smrg define([PREFIX], [CXX]) 3009e4b60806Smrg define([CACHE_PREFIX], [cxx]) 3010e4b60806Smrg define([COMPILER], [$CXX]) 3011e4b60806Smrg ] 3012e4b60806Smrg) 3013e4b60806Smrg 3014e4b60806Smrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]" 3015e4b60806Smrg 3016e4b60806Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then 3017e4b60806Smrg PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option" 3018e4b60806Smrg AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option], 3019e4b60806Smrg [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option], 3020e4b60806Smrg AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])], 3021e4b60806Smrg [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes], 3022e4b60806Smrg [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no])) 3023e4b60806Smrg [xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option] 3024e4b60806Smrg PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]" 3025ff143803Smrgfi 3026e4b60806Smrg 3027e4b60806Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then 3028e4b60806Smrg if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then 3029e4b60806Smrg PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option" 3030e4b60806Smrg fi 3031e4b60806Smrg PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument" 3032e4b60806Smrg AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument], 3033e4b60806Smrg [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument], 3034e4b60806Smrg AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])], 3035e4b60806Smrg [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes], 3036e4b60806Smrg [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no])) 3037e4b60806Smrg [xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument] 3038e4b60806Smrg PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]" 3039e4b60806Smrgfi 3040e4b60806Smrg 3041e4b60806Smrgfound="no" 3042e4b60806Smrgm4_foreach([flag], m4_cdr($@), [ 3043e4b60806Smrg if test $found = "no" ; then 3044e4b60806Smrg if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then 3045e4b60806Smrg PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option" 3046e4b60806Smrg fi 3047e4b60806Smrg 3048e4b60806Smrg if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then 3049e4b60806Smrg PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument" 3050e4b60806Smrg fi 3051e4b60806Smrg 3052e4b60806Smrg PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag[" 3053e4b60806Smrg 3054e4b60806Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname 3055e4b60806Smrg AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[]) 3056e4b60806Smrg cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[]) 3057e4b60806Smrg AC_CACHE_VAL($cacheid, 3058e4b60806Smrg [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])], 3059e4b60806Smrg [eval $cacheid=yes], 3060e4b60806Smrg [eval $cacheid=no])]) 3061e4b60806Smrg 3062e4b60806Smrg PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]" 3063e4b60806Smrg 3064e4b60806Smrg eval supported=\$$cacheid 3065e4b60806Smrg AC_MSG_RESULT([$supported]) 3066e4b60806Smrg if test "$supported" = "yes" ; then 3067e4b60806Smrg $1="$$1 ]flag[" 3068e4b60806Smrg found="yes" 3069e4b60806Smrg fi 3070e4b60806Smrg fi 3071ff143803Smrg]) 3072e4b60806Smrg]) # XORG_TESTSET_CFLAG 3073c3d5982aSmrg 3074e4b60806Smrg# XORG_COMPILER_FLAGS 3075e4b60806Smrg# --------------- 3076e4b60806Smrg# Minimum version: 1.16.0 3077c3d5982aSmrg# 3078e4b60806Smrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line 3079e4b60806Smrg# arguments supported by the selected compiler which do NOT alter the generated 3080e4b60806Smrg# code. These arguments will cause the compiler to print various warnings 3081e4b60806Smrg# during compilation AND turn a conservative set of warnings into errors. 3082e4b60806Smrg# 3083e4b60806Smrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in 3084e4b60806Smrg# future versions of util-macros as options are added to new compilers. 3085e4b60806Smrg# 3086e4b60806SmrgAC_DEFUN([XORG_COMPILER_FLAGS], [ 3087e4b60806SmrgAC_REQUIRE([XORG_COMPILER_BRAND]) 30887da8b7e3Smrg 3089e4b60806SmrgAC_ARG_ENABLE(selective-werror, 3090e4b60806Smrg AS_HELP_STRING([--disable-selective-werror], 3091e4b60806Smrg [Turn off selective compiler errors. (default: enabled)]), 3092e4b60806Smrg [SELECTIVE_WERROR=$enableval], 3093e4b60806Smrg [SELECTIVE_WERROR=yes]) 3094e4b60806Smrg 3095e4b60806SmrgAC_LANG_CASE( 3096e4b60806Smrg [C], [ 3097e4b60806Smrg define([PREFIX], [C]) 3098e4b60806Smrg ], 3099e4b60806Smrg [C++], [ 3100e4b60806Smrg define([PREFIX], [CXX]) 3101e4b60806Smrg ] 3102e4b60806Smrg) 3103e4b60806Smrg# -v is too short to test reliably with XORG_TESTSET_CFLAG 3104e4b60806Smrgif test "x$SUNCC" = "xyes"; then 3105e4b60806Smrg [BASE_]PREFIX[FLAGS]="-v" 3106ff143803Smrgelse 3107e4b60806Smrg [BASE_]PREFIX[FLAGS]="" 3108ff143803Smrgfi 3109ff143803Smrg 3110e4b60806Smrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS 3111e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall]) 3112e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith]) 3113e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations]) 3114e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat]) 3115ff143803Smrg 3116e4b60806SmrgAC_LANG_CASE( 3117e4b60806Smrg [C], [ 3118e4b60806Smrg XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes]) 3119e4b60806Smrg XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes]) 3120e4b60806Smrg XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs]) 3121e4b60806Smrg XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast]) 3122e4b60806Smrg XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd]) 3123e4b60806Smrg XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement]) 3124e4b60806Smrg ] 3125e4b60806Smrg) 3126123e2cc7Smrg 3127e4b60806Smrg# This chunk adds additional warnings that could catch undesired effects. 3128e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused]) 3129e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized]) 3130e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow]) 3131e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn]) 3132e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute]) 3133e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls]) 3134e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op]) 3135c3d5982aSmrg 3136e4b60806Smrg# These are currently disabled because they are noisy. They will be enabled 3137e4b60806Smrg# in the future once the codebase is sufficiently modernized to silence 3138e4b60806Smrg# them. For now, I don't want them to drown out the other warnings. 3139e4b60806Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses]) 3140e4b60806Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align]) 3141e4b60806Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual]) 3142c3d5982aSmrg 3143e4efb0bcSmrg# Turn some warnings into errors, so we don't accidentally get successful builds 3144e4b60806Smrg# when there are problems that should be fixed. 3145c3d5982aSmrg 3146e4b60806Smrgif test "x$SELECTIVE_WERROR" = "xyes" ; then 3147e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED]) 3148e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull]) 3149e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self]) 3150e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main]) 3151e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces]) 3152e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point]) 3153e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT]) 3154e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs]) 3155e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds]) 3156e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings]) 3157e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address]) 3158e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION]) 3159e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION 3160e4b60806Smrgelse 3161e4b60806SmrgAC_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]) 3162e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit]) 3163e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull]) 3164e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self]) 3165e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain]) 3166e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces]) 3167e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point]) 3168e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type]) 3169e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs]) 3170e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds]) 3171e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings]) 3172e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress]) 3173e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast]) 3174e4b60806SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast]) 3175e4b60806Smrgfi 3176c3d5982aSmrg 3177e4b60806SmrgAC_SUBST([BASE_]PREFIX[FLAGS]) 3178e4b60806Smrg]) # XORG_COMPILER_FLAGS 31797da8b7e3Smrg 3180e4b60806Smrg# XORG_CWARNFLAGS 3181e4b60806Smrg# --------------- 3182e4b60806Smrg# Minimum version: 1.2.0 3183e4b60806Smrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead) 3184123e2cc7Smrg# 3185e4b60806Smrg# Defines CWARNFLAGS to enable C compiler warnings. 3186bded5d25Smrg# 3187e4b60806Smrg# This function is deprecated because it defines -fno-strict-aliasing 3188e4b60806Smrg# which alters the code generated by the compiler. If -fno-strict-aliasing 3189e4b60806Smrg# is needed, then it should be added explicitly in the module when 3190e4b60806Smrg# it is updated to use BASE_CFLAGS. 3191bded5d25Smrg# 3192e4b60806SmrgAC_DEFUN([XORG_CWARNFLAGS], [ 3193e4b60806SmrgAC_REQUIRE([XORG_COMPILER_FLAGS]) 3194e4b60806SmrgAC_REQUIRE([XORG_COMPILER_BRAND]) 3195e4b60806SmrgAC_LANG_CASE( 3196e4b60806Smrg [C], [ 3197e4b60806Smrg CWARNFLAGS="$BASE_CFLAGS" 3198e4b60806Smrg if test "x$GCC" = xyes ; then 3199e4b60806Smrg CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing" 3200e4b60806Smrg fi 3201e4b60806Smrg AC_SUBST(CWARNFLAGS) 3202e4b60806Smrg ] 3203e4b60806Smrg) 3204e4b60806Smrg]) # XORG_CWARNFLAGS 32057da8b7e3Smrg 3206e4b60806Smrg# XORG_STRICT_OPTION 3207e4b60806Smrg# ----------------------- 3208e4b60806Smrg# Minimum version: 1.3.0 3209e4b60806Smrg# 3210e4b60806Smrg# Add configure option to enable strict compilation flags, such as treating 3211e4b60806Smrg# warnings as fatal errors. 3212e4b60806Smrg# If --enable-strict-compilation is passed to configure, adds strict flags to 3213e4b60806Smrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS. 3214e4b60806Smrg# 3215e4b60806Smrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or 3216e4b60806Smrg# when strict compilation is unconditionally desired. 3217e4b60806SmrgAC_DEFUN([XORG_STRICT_OPTION], [ 3218e4b60806SmrgAC_REQUIRE([XORG_CWARNFLAGS]) 3219e4b60806SmrgAC_REQUIRE([XORG_COMPILER_FLAGS]) 3220ff143803Smrg 3221e4b60806SmrgAC_ARG_ENABLE(strict-compilation, 3222e4b60806Smrg AS_HELP_STRING([--enable-strict-compilation], 3223e4b60806Smrg [Enable all warnings from compiler and make them errors (default: disabled)]), 3224e4b60806Smrg [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no]) 3225ff143803Smrg 3226e4b60806SmrgAC_LANG_CASE( 3227e4b60806Smrg [C], [ 3228e4b60806Smrg define([PREFIX], [C]) 3229e4b60806Smrg ], 3230e4b60806Smrg [C++], [ 3231e4b60806Smrg define([PREFIX], [CXX]) 3232e4b60806Smrg ] 3233e4b60806Smrg) 3234ff143803Smrg 3235e4b60806Smrg[STRICT_]PREFIX[FLAGS]="" 3236e4b60806SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic]) 3237e4b60806SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn]) 3238ff143803Smrg 3239e4b60806Smrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not 3240e4b60806Smrg# activate it with -Werror, so we add it here explicitly. 3241e4b60806SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes]) 3242ff143803Smrg 3243e4b60806Smrgif test "x$STRICT_COMPILE" = "xyes"; then 3244e4b60806Smrg [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]" 3245e4b60806Smrg AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"]) 3246e4b60806Smrgfi 3247e4b60806SmrgAC_SUBST([STRICT_]PREFIX[FLAGS]) 3248e4b60806SmrgAC_SUBST([BASE_]PREFIX[FLAGS]) 3249e4b60806SmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS])) 3250e4b60806Smrg]) # XORG_STRICT_OPTION 3251ff143803Smrg 3252e4efb0bcSmrg# XORG_DEFAULT_NOCODE_OPTIONS 3253e4efb0bcSmrg# --------------------------- 3254e4efb0bcSmrg# Minimum version: 1.20.0 3255e4efb0bcSmrg# 3256e4efb0bcSmrg# Defines default options for X.Org modules which don't compile code, 3257e4efb0bcSmrg# such as fonts, bitmaps, cursors, and docs. 3258e4efb0bcSmrg# 3259e4efb0bcSmrgAC_DEFUN([XORG_DEFAULT_NOCODE_OPTIONS], [ 3260e4efb0bcSmrgAC_REQUIRE([AC_PROG_INSTALL]) 3261e4efb0bcSmrgXORG_RELEASE_VERSION 3262e4efb0bcSmrgXORG_CHANGELOG 3263e4efb0bcSmrgXORG_INSTALL 3264e4efb0bcSmrgXORG_MANPAGE_SECTIONS 3265e4efb0bcSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], 3266e4efb0bcSmrg [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) 3267e4efb0bcSmrg]) # XORG_DEFAULT_NOCODE_OPTIONS 3268e4efb0bcSmrg 3269e4b60806Smrg# XORG_DEFAULT_OPTIONS 3270e4b60806Smrg# -------------------- 3271e4b60806Smrg# Minimum version: 1.3.0 3272e4b60806Smrg# 3273e4efb0bcSmrg# Defines default options for X.Org modules which compile code. 3274e4b60806Smrg# 3275e4b60806SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [ 3276e4b60806SmrgAC_REQUIRE([AC_PROG_INSTALL]) 3277e4b60806SmrgXORG_COMPILER_FLAGS 3278e4b60806SmrgXORG_CWARNFLAGS 3279e4b60806SmrgXORG_STRICT_OPTION 3280e4efb0bcSmrgXORG_DEFAULT_NOCODE_OPTIONS 3281e4b60806Smrg]) # XORG_DEFAULT_OPTIONS 3282ff143803Smrg 3283e4b60806Smrg# XORG_INSTALL() 3284e4b60806Smrg# ---------------- 3285e4b60806Smrg# Minimum version: 1.4.0 3286e4b60806Smrg# 3287e4b60806Smrg# Defines the variable INSTALL_CMD as the command to copy 3288e4b60806Smrg# INSTALL from $prefix/share/util-macros. 3289e4b60806Smrg# 3290e4b60806SmrgAC_DEFUN([XORG_INSTALL], [ 3291e4b60806SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG]) 3292e4b60806Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` 3293e4b60806SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ 3294e4b60806Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ 3295e4b60806Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; test -e \$(top_srcdir)/INSTALL || ( \ 3296e4b60806Smrgtouch \$(top_srcdir)/INSTALL; \ 3297e4b60806Smrgecho 'failed to copy INSTALL from util-macros: installing empty INSTALL.' >&2))" 3298e4b60806SmrgAC_SUBST([INSTALL_CMD]) 3299e4b60806Smrg]) # XORG_INSTALL 3300e4b60806Smrgdnl Copyright 2005 Red Hat, Inc 3301e4b60806Smrgdnl 3302e4b60806Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its 3303e4b60806Smrgdnl documentation for any purpose is hereby granted without fee, provided that 3304e4b60806Smrgdnl the above copyright notice appear in all copies and that both that 3305e4b60806Smrgdnl copyright notice and this permission notice appear in supporting 3306e4b60806Smrgdnl documentation. 3307e4b60806Smrgdnl 3308e4b60806Smrgdnl The above copyright notice and this permission notice shall be included 3309e4b60806Smrgdnl in all copies or substantial portions of the Software. 3310e4b60806Smrgdnl 3311e4b60806Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 3312e4b60806Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 3313e4b60806Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 3314e4b60806Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 3315e4b60806Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 3316e4b60806Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 3317e4b60806Smrgdnl OTHER DEALINGS IN THE SOFTWARE. 3318e4b60806Smrgdnl 3319e4b60806Smrgdnl Except as contained in this notice, the name of the copyright holders shall 3320e4b60806Smrgdnl not be used in advertising or otherwise to promote the sale, use or 3321e4b60806Smrgdnl other dealings in this Software without prior written authorization 3322e4b60806Smrgdnl from the copyright holders. 3323e4b60806Smrgdnl 3324ff143803Smrg 3325e4b60806Smrg# XORG_RELEASE_VERSION 3326e4b60806Smrg# -------------------- 3327e4b60806Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use. 3328ff143803Smrg 3329e4b60806SmrgAC_DEFUN([XORG_RELEASE_VERSION],[ 3330e4b60806Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR], 3331e4b60806Smrg [`echo $PACKAGE_VERSION | cut -d . -f 1`], 3332e4b60806Smrg [Major version of this package]) 3333e4b60806Smrg PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` 3334e4b60806Smrg if test "x$PVM" = "x"; then 3335e4b60806Smrg PVM="0" 3336e4b60806Smrg fi 3337e4b60806Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR], 3338e4b60806Smrg [$PVM], 3339e4b60806Smrg [Minor version of this package]) 3340e4b60806Smrg PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` 3341e4b60806Smrg if test "x$PVP" = "x"; then 3342e4b60806Smrg PVP="0" 3343e4b60806Smrg fi 3344e4b60806Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL], 3345e4b60806Smrg [$PVP], 3346e4b60806Smrg [Patch version of this package]) 3347e4b60806Smrg]) 3348ff143803Smrg 3349e4b60806Smrg# XORG_CHANGELOG() 3350e4b60806Smrg# ---------------- 3351e4b60806Smrg# Minimum version: 1.2.0 3352e4b60806Smrg# 3353e4b60806Smrg# Defines the variable CHANGELOG_CMD as the command to generate 3354e4b60806Smrg# ChangeLog from git. 3355e4b60806Smrg# 3356e4b60806Smrg# 3357e4b60806SmrgAC_DEFUN([XORG_CHANGELOG], [ 3358e4b60806SmrgCHANGELOG_CMD="((GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp) 2>/dev/null && \ 3359e4b60806Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ 3360e4b60806Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; test -e \$(top_srcdir)/ChangeLog || ( \ 3361e4b60806Smrgtouch \$(top_srcdir)/ChangeLog; \ 3362e4b60806Smrgecho 'git failed to create ChangeLog: installing empty ChangeLog.' >&2))" 3363e4b60806SmrgAC_SUBST([CHANGELOG_CMD]) 3364e4b60806Smrg]) # XORG_CHANGELOG 33657da8b7e3Smrg 3366