aclocal.m4 revision 19569120
119569120Smrg# generated automatically by aclocal 1.16.5 -*- Autoconf -*- 2ac92798bSmrg 319569120Smrg# Copyright (C) 1996-2021 Free Software Foundation, Inc. 4a966c04fSmrg 5a966c04fSmrg# This file is free software; the Free Software Foundation 6a966c04fSmrg# gives unlimited permission to copy and/or distribute it, 7a966c04fSmrg# with or without modifications, as long as this notice is preserved. 8a966c04fSmrg 9a966c04fSmrg# This program is distributed in the hope that it will be useful, 10a966c04fSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without 11a966c04fSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A 12a966c04fSmrg# PARTICULAR PURPOSE. 13a966c04fSmrg 14ac92798bSmrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) 152e2dd055Smrgm4_ifndef([AC_AUTOCONF_VERSION], 162e2dd055Smrg [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 1719569120Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, 1819569120Smrg[m4_warning([this file was generated for autoconf 2.71. 192e2dd055SmrgYou have another version of autoconf. It may work, but is not guaranteed to. 202e2dd055SmrgIf you have problems, you may need to regenerate the build system entirely. 21ac92798bSmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])]) 22a966c04fSmrg 2319569120Smrg# Copyright (C) 2002-2021 Free Software Foundation, Inc. 2419569120Smrg# 2519569120Smrg# This file is free software; the Free Software Foundation 2619569120Smrg# gives unlimited permission to copy and/or distribute it, 2719569120Smrg# with or without modifications, as long as this notice is preserved. 28a966c04fSmrg 2919569120Smrg# AM_AUTOMAKE_VERSION(VERSION) 3019569120Smrg# ---------------------------- 3119569120Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been 3219569120Smrg# generated from the m4 files accompanying Automake X.Y. 3319569120Smrg# (This private macro should not be called outside this file.) 3419569120SmrgAC_DEFUN([AM_AUTOMAKE_VERSION], 3519569120Smrg[am__api_version='1.16' 3619569120Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to 3719569120Smrgdnl require some minimum version. Point them to the right macro. 3819569120Smrgm4_if([$1], [1.16.5], [], 3919569120Smrg [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl 4019569120Smrg]) 41edce3322Smrg 4219569120Smrg# _AM_AUTOCONF_VERSION(VERSION) 4319569120Smrg# ----------------------------- 4419569120Smrg# aclocal traces this macro to find the Autoconf version. 4519569120Smrg# This is a private macro too. Using m4_define simplifies 4619569120Smrg# the logic in aclocal, which can simply ignore this definition. 4719569120Smrgm4_define([_AM_AUTOCONF_VERSION], []) 48edce3322Smrg 4919569120Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION 5019569120Smrg# ------------------------------- 5119569120Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. 5219569120Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. 5319569120SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 5419569120Smrg[AM_AUTOMAKE_VERSION([1.16.5])dnl 5519569120Smrgm4_ifndef([AC_AUTOCONF_VERSION], 5619569120Smrg [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 5719569120Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) 58a966c04fSmrg 5919569120Smrg# AM_AUX_DIR_EXPAND -*- Autoconf -*- 60a966c04fSmrg 6119569120Smrg# Copyright (C) 2001-2021 Free Software Foundation, Inc. 6219569120Smrg# 6319569120Smrg# This file is free software; the Free Software Foundation 6419569120Smrg# gives unlimited permission to copy and/or distribute it, 6519569120Smrg# with or without modifications, as long as this notice is preserved. 66a966c04fSmrg 6719569120Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 6819569120Smrg# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to 6919569120Smrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'. 7019569120Smrg# 7119569120Smrg# Of course, Automake must honor this variable whenever it calls a 7219569120Smrg# tool from the auxiliary directory. The problem is that $srcdir (and 7319569120Smrg# therefore $ac_aux_dir as well) can be either absolute or relative, 7419569120Smrg# depending on how configure is run. This is pretty annoying, since 7519569120Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top 7619569120Smrg# source directory, any form will work fine, but in subdirectories a 7719569120Smrg# relative path needs to be adjusted first. 7819569120Smrg# 7919569120Smrg# $ac_aux_dir/missing 8019569120Smrg# fails when called from a subdirectory if $ac_aux_dir is relative 8119569120Smrg# $top_srcdir/$ac_aux_dir/missing 8219569120Smrg# fails if $ac_aux_dir is absolute, 8319569120Smrg# fails when called from a subdirectory in a VPATH build with 8419569120Smrg# a relative $ac_aux_dir 8519569120Smrg# 8619569120Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir 8719569120Smrg# are both prefixed by $srcdir. In an in-source build this is usually 8819569120Smrg# harmless because $srcdir is '.', but things will broke when you 8919569120Smrg# start a VPATH build or use an absolute $srcdir. 9019569120Smrg# 9119569120Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 9219569120Smrg# iff we strip the leading $srcdir from $ac_aux_dir. That would be: 9319569120Smrg# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 9419569120Smrg# and then we would define $MISSING as 9519569120Smrg# MISSING="\${SHELL} $am_aux_dir/missing" 9619569120Smrg# This will work as long as MISSING is not called from configure, because 9719569120Smrg# unfortunately $(top_srcdir) has no meaning in configure. 9819569120Smrg# However there are other variables, like CC, which are often used in 9919569120Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir. 10019569120Smrg# 10119569120Smrg# Another solution, used here, is to always expand $ac_aux_dir to an 10219569120Smrg# absolute PATH. The drawback is that using absolute paths prevent a 10319569120Smrg# configured tree to be moved without reconfiguration. 104a966c04fSmrg 10519569120SmrgAC_DEFUN([AM_AUX_DIR_EXPAND], 10619569120Smrg[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl 10719569120Smrg# Expand $ac_aux_dir to an absolute path. 10819569120Smrgam_aux_dir=`cd "$ac_aux_dir" && pwd` 10919569120Smrg]) 110a966c04fSmrg 11119569120Smrg# AM_CONDITIONAL -*- Autoconf -*- 1129f00f3a1Smrg 11319569120Smrg# Copyright (C) 1997-2021 Free Software Foundation, Inc. 11419569120Smrg# 11519569120Smrg# This file is free software; the Free Software Foundation 11619569120Smrg# gives unlimited permission to copy and/or distribute it, 11719569120Smrg# with or without modifications, as long as this notice is preserved. 118a966c04fSmrg 11919569120Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION) 12019569120Smrg# ------------------------------------- 12119569120Smrg# Define a conditional. 12219569120SmrgAC_DEFUN([AM_CONDITIONAL], 12319569120Smrg[AC_PREREQ([2.52])dnl 12419569120Smrg m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 12519569120Smrg [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 12619569120SmrgAC_SUBST([$1_TRUE])dnl 12719569120SmrgAC_SUBST([$1_FALSE])dnl 12819569120Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl 12919569120Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl 13019569120Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl 13119569120Smrgif $2; then 13219569120Smrg $1_TRUE= 13319569120Smrg $1_FALSE='#' 13419569120Smrgelse 13519569120Smrg $1_TRUE='#' 13619569120Smrg $1_FALSE= 13719569120Smrgfi 13819569120SmrgAC_CONFIG_COMMANDS_PRE( 13919569120Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 14019569120Smrg AC_MSG_ERROR([[conditional "$1" was never defined. 14119569120SmrgUsually this means the macro was only invoked conditionally.]]) 14219569120Smrgfi])]) 143a966c04fSmrg 14419569120Smrg# Copyright (C) 1999-2021 Free Software Foundation, Inc. 14519569120Smrg# 14619569120Smrg# This file is free software; the Free Software Foundation 14719569120Smrg# gives unlimited permission to copy and/or distribute it, 14819569120Smrg# with or without modifications, as long as this notice is preserved. 149a966c04fSmrg 150a966c04fSmrg 15119569120Smrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be 15219569120Smrg# written in clear, in which case automake, when reading aclocal.m4, 15319569120Smrg# will think it sees a *use*, and therefore will trigger all it's 15419569120Smrg# C support machinery. Also note that it means that autoscan, seeing 15519569120Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use... 156a966c04fSmrg 157a966c04fSmrg 15819569120Smrg# _AM_DEPENDENCIES(NAME) 15919569120Smrg# ---------------------- 16019569120Smrg# See how the compiler implements dependency checking. 16119569120Smrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". 16219569120Smrg# We try a few techniques and use that to set a single cache variable. 16319569120Smrg# 16419569120Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was 16519569120Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular 16619569120Smrg# dependency, and given that the user is not expected to run this macro, 16719569120Smrg# just rely on AC_PROG_CC. 16819569120SmrgAC_DEFUN([_AM_DEPENDENCIES], 16919569120Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl 17019569120SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl 17119569120SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl 17219569120SmrgAC_REQUIRE([AM_DEP_TRACK])dnl 173a966c04fSmrg 17419569120Smrgm4_if([$1], [CC], [depcc="$CC" am_compiler_list=], 17519569120Smrg [$1], [CXX], [depcc="$CXX" am_compiler_list=], 17619569120Smrg [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 17719569120Smrg [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], 17819569120Smrg [$1], [UPC], [depcc="$UPC" am_compiler_list=], 17919569120Smrg [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 18019569120Smrg [depcc="$$1" am_compiler_list=]) 181a966c04fSmrg 18219569120SmrgAC_CACHE_CHECK([dependency style of $depcc], 18319569120Smrg [am_cv_$1_dependencies_compiler_type], 18419569120Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then 18519569120Smrg # We make a subdir and do the tests there. Otherwise we can end up 18619569120Smrg # making bogus files that we don't know about and never remove. For 18719569120Smrg # instance it was reported that on HP-UX the gcc test will end up 18819569120Smrg # making a dummy file named 'D' -- because '-MD' means "put the output 18919569120Smrg # in D". 19019569120Smrg rm -rf conftest.dir 19119569120Smrg mkdir conftest.dir 19219569120Smrg # Copy depcomp to subdir because otherwise we won't find it if we're 19319569120Smrg # using a relative directory. 19419569120Smrg cp "$am_depcomp" conftest.dir 19519569120Smrg cd conftest.dir 19619569120Smrg # We will build objects and dependencies in a subdirectory because 19719569120Smrg # it helps to detect inapplicable dependency modes. For instance 19819569120Smrg # both Tru64's cc and ICC support -MD to output dependencies as a 19919569120Smrg # side effect of compilation, but ICC will put the dependencies in 20019569120Smrg # the current directory while Tru64 will put them in the object 20119569120Smrg # directory. 20219569120Smrg mkdir sub 203a966c04fSmrg 20419569120Smrg am_cv_$1_dependencies_compiler_type=none 20519569120Smrg if test "$am_compiler_list" = ""; then 20619569120Smrg am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` 20719569120Smrg fi 20819569120Smrg am__universal=false 20919569120Smrg m4_case([$1], [CC], 21019569120Smrg [case " $depcc " in #( 21119569120Smrg *\ -arch\ *\ -arch\ *) am__universal=true ;; 21219569120Smrg esac], 21319569120Smrg [CXX], 21419569120Smrg [case " $depcc " in #( 21519569120Smrg *\ -arch\ *\ -arch\ *) am__universal=true ;; 21619569120Smrg esac]) 217a966c04fSmrg 21819569120Smrg for depmode in $am_compiler_list; do 21919569120Smrg # Setup a source with many dependencies, because some compilers 22019569120Smrg # like to wrap large dependency lists on column 80 (with \), and 22119569120Smrg # we should not choose a depcomp mode which is confused by this. 22219569120Smrg # 22319569120Smrg # We need to recreate these files for each test, as the compiler may 22419569120Smrg # overwrite some of them when testing with obscure command lines. 22519569120Smrg # This happens at least with the AIX C compiler. 22619569120Smrg : > sub/conftest.c 22719569120Smrg for i in 1 2 3 4 5 6; do 22819569120Smrg echo '#include "conftst'$i'.h"' >> sub/conftest.c 22919569120Smrg # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with 23019569120Smrg # Solaris 10 /bin/sh. 23119569120Smrg echo '/* dummy */' > sub/conftst$i.h 23219569120Smrg done 23319569120Smrg echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 234edce3322Smrg 23519569120Smrg # We check with '-c' and '-o' for the sake of the "dashmstdout" 23619569120Smrg # mode. It turns out that the SunPro C++ compiler does not properly 23719569120Smrg # handle '-M -o', and we need to detect this. Also, some Intel 23819569120Smrg # versions had trouble with output in subdirs. 23919569120Smrg am__obj=sub/conftest.${OBJEXT-o} 24019569120Smrg am__minus_obj="-o $am__obj" 24119569120Smrg case $depmode in 24219569120Smrg gcc) 24319569120Smrg # This depmode causes a compiler race in universal mode. 24419569120Smrg test "$am__universal" = false || continue 24519569120Smrg ;; 24619569120Smrg nosideeffect) 24719569120Smrg # After this tag, mechanisms are not by side-effect, so they'll 24819569120Smrg # only be used when explicitly requested. 24919569120Smrg if test "x$enable_dependency_tracking" = xyes; then 25019569120Smrg continue 25119569120Smrg else 25219569120Smrg break 25319569120Smrg fi 25419569120Smrg ;; 25519569120Smrg msvc7 | msvc7msys | msvisualcpp | msvcmsys) 25619569120Smrg # This compiler won't grok '-c -o', but also, the minuso test has 25719569120Smrg # not run yet. These depmodes are late enough in the game, and 25819569120Smrg # so weak that their functioning should not be impacted. 25919569120Smrg am__obj=conftest.${OBJEXT-o} 26019569120Smrg am__minus_obj= 26119569120Smrg ;; 26219569120Smrg none) break ;; 26319569120Smrg esac 26419569120Smrg if depmode=$depmode \ 26519569120Smrg source=sub/conftest.c object=$am__obj \ 26619569120Smrg depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ 26719569120Smrg $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ 26819569120Smrg >/dev/null 2>conftest.err && 26919569120Smrg grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 27019569120Smrg grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && 27119569120Smrg grep $am__obj sub/conftest.Po > /dev/null 2>&1 && 27219569120Smrg ${MAKE-make} -s -f confmf > /dev/null 2>&1; then 27319569120Smrg # icc doesn't choke on unknown options, it will just issue warnings 27419569120Smrg # or remarks (even with -Werror). So we grep stderr for any message 27519569120Smrg # that says an option was ignored or not supported. 27619569120Smrg # When given -MP, icc 7.0 and 7.1 complain thusly: 27719569120Smrg # icc: Command line warning: ignoring option '-M'; no argument required 27819569120Smrg # The diagnosis changed in icc 8.0: 27919569120Smrg # icc: Command line remark: option '-MP' not supported 28019569120Smrg if (grep 'ignoring option' conftest.err || 28119569120Smrg grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else 28219569120Smrg am_cv_$1_dependencies_compiler_type=$depmode 28319569120Smrg break 28419569120Smrg fi 28519569120Smrg fi 28619569120Smrg done 287edce3322Smrg 28819569120Smrg cd .. 28919569120Smrg rm -rf conftest.dir 29019569120Smrgelse 29119569120Smrg am_cv_$1_dependencies_compiler_type=none 29219569120Smrgfi 29319569120Smrg]) 29419569120SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) 29519569120SmrgAM_CONDITIONAL([am__fastdep$1], [ 29619569120Smrg test "x$enable_dependency_tracking" != xno \ 29719569120Smrg && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) 29819569120Smrg]) 299edce3322Smrg 300edce3322Smrg 30119569120Smrg# AM_SET_DEPDIR 30219569120Smrg# ------------- 30319569120Smrg# Choose a directory name for dependency files. 30419569120Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES. 30519569120SmrgAC_DEFUN([AM_SET_DEPDIR], 30619569120Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl 30719569120SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl 30819569120Smrg]) 309edce3322Smrg 310edce3322Smrg 31119569120Smrg# AM_DEP_TRACK 31219569120Smrg# ------------ 31319569120SmrgAC_DEFUN([AM_DEP_TRACK], 31419569120Smrg[AC_ARG_ENABLE([dependency-tracking], [dnl 31519569120SmrgAS_HELP_STRING( 31619569120Smrg [--enable-dependency-tracking], 31719569120Smrg [do not reject slow dependency extractors]) 31819569120SmrgAS_HELP_STRING( 31919569120Smrg [--disable-dependency-tracking], 32019569120Smrg [speeds up one-time build])]) 32119569120Smrgif test "x$enable_dependency_tracking" != xno; then 32219569120Smrg am_depcomp="$ac_aux_dir/depcomp" 32319569120Smrg AMDEPBACKSLASH='\' 32419569120Smrg am__nodep='_no' 32519569120Smrgfi 32619569120SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) 32719569120SmrgAC_SUBST([AMDEPBACKSLASH])dnl 32819569120Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl 32919569120SmrgAC_SUBST([am__nodep])dnl 33019569120Smrg_AM_SUBST_NOTMAKE([am__nodep])dnl 33119569120Smrg]) 332edce3322Smrg 33319569120Smrg# Generate code to set up dependency tracking. -*- Autoconf -*- 334edce3322Smrg 33519569120Smrg# Copyright (C) 1999-2021 Free Software Foundation, Inc. 33619569120Smrg# 33719569120Smrg# This file is free software; the Free Software Foundation 33819569120Smrg# gives unlimited permission to copy and/or distribute it, 33919569120Smrg# with or without modifications, as long as this notice is preserved. 340a966c04fSmrg 34119569120Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS 34219569120Smrg# ------------------------------ 34319569120SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], 34419569120Smrg[{ 34519569120Smrg # Older Autoconf quotes --file arguments for eval, but not when files 34619569120Smrg # are listed without --file. Let's play safe and only enable the eval 34719569120Smrg # if we detect the quoting. 34819569120Smrg # TODO: see whether this extra hack can be removed once we start 34919569120Smrg # requiring Autoconf 2.70 or later. 35019569120Smrg AS_CASE([$CONFIG_FILES], 35119569120Smrg [*\'*], [eval set x "$CONFIG_FILES"], 35219569120Smrg [*], [set x $CONFIG_FILES]) 35319569120Smrg shift 35419569120Smrg # Used to flag and report bootstrapping failures. 35519569120Smrg am_rc=0 35619569120Smrg for am_mf 35719569120Smrg do 35819569120Smrg # Strip MF so we end up with the name of the file. 35919569120Smrg am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` 36019569120Smrg # Check whether this is an Automake generated Makefile which includes 36119569120Smrg # dependency-tracking related rules and includes. 36219569120Smrg # Grep'ing the whole file directly is not great: AIX grep has a line 36319569120Smrg # limit of 2048, but all sed's we know have understand at least 4000. 36419569120Smrg sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ 36519569120Smrg || continue 36619569120Smrg am_dirpart=`AS_DIRNAME(["$am_mf"])` 36719569120Smrg am_filepart=`AS_BASENAME(["$am_mf"])` 36819569120Smrg AM_RUN_LOG([cd "$am_dirpart" \ 36919569120Smrg && sed -e '/# am--include-marker/d' "$am_filepart" \ 37019569120Smrg | $MAKE -f - am--depfiles]) || am_rc=$? 37119569120Smrg done 37219569120Smrg if test $am_rc -ne 0; then 37319569120Smrg AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments 37419569120Smrg for automatic dependency tracking. If GNU make was not used, consider 37519569120Smrg re-running the configure script with MAKE="gmake" (or whatever is 37619569120Smrg necessary). You can also try re-running configure with the 37719569120Smrg '--disable-dependency-tracking' option to at least be able to build 37819569120Smrg the package (albeit without support for automatic dependency tracking).]) 37919569120Smrg fi 38019569120Smrg AS_UNSET([am_dirpart]) 38119569120Smrg AS_UNSET([am_filepart]) 38219569120Smrg AS_UNSET([am_mf]) 38319569120Smrg AS_UNSET([am_rc]) 38419569120Smrg rm -f conftest-deps.mk 38519569120Smrg} 38619569120Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS 387a966c04fSmrg 3882e2dd055Smrg 38919569120Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS 39019569120Smrg# ----------------------------- 39119569120Smrg# This macro should only be invoked once -- use via AC_REQUIRE. 3929f00f3a1Smrg# 39319569120Smrg# This code is only required when automatic dependency tracking is enabled. 39419569120Smrg# This creates each '.Po' and '.Plo' makefile fragment that we'll need in 39519569120Smrg# order to bootstrap the dependency handling code. 39619569120SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], 39719569120Smrg[AC_CONFIG_COMMANDS([depfiles], 39819569120Smrg [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], 39919569120Smrg [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) 400a966c04fSmrg 40119569120Smrg# Do all the work for Automake. -*- Autoconf -*- 402a966c04fSmrg 40319569120Smrg# Copyright (C) 1996-2021 Free Software Foundation, Inc. 4049f00f3a1Smrg# 40519569120Smrg# This file is free software; the Free Software Foundation 40619569120Smrg# gives unlimited permission to copy and/or distribute it, 40719569120Smrg# with or without modifications, as long as this notice is preserved. 408a966c04fSmrg 40919569120Smrg# This macro actually does too much. Some checks are only needed if 41019569120Smrg# your package does certain things. But this isn't really a big deal. 411edce3322Smrg 41219569120Smrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. 41319569120Smrgm4_define([AC_PROG_CC], 41419569120Smrgm4_defn([AC_PROG_CC]) 41519569120Smrg[_AM_PROG_CC_C_O 41619569120Smrg]) 417a966c04fSmrg 41819569120Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 41919569120Smrg# AM_INIT_AUTOMAKE([OPTIONS]) 42019569120Smrg# ----------------------------------------------- 42119569120Smrg# The call with PACKAGE and VERSION arguments is the old style 42219569120Smrg# call (pre autoconf-2.50), which is being phased out. PACKAGE 42319569120Smrg# and VERSION should now be passed to AC_INIT and removed from 42419569120Smrg# the call to AM_INIT_AUTOMAKE. 42519569120Smrg# We support both call styles for the transition. After 42619569120Smrg# the next Automake release, Autoconf can make the AC_INIT 42719569120Smrg# arguments mandatory, and then we can depend on a new Autoconf 42819569120Smrg# release and drop the old call support. 42919569120SmrgAC_DEFUN([AM_INIT_AUTOMAKE], 43019569120Smrg[AC_PREREQ([2.65])dnl 43119569120Smrgm4_ifdef([_$0_ALREADY_INIT], 43219569120Smrg [m4_fatal([$0 expanded multiple times 43319569120Smrg]m4_defn([_$0_ALREADY_INIT]))], 43419569120Smrg [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl 43519569120Smrgdnl Autoconf wants to disallow AM_ names. We explicitly allow 43619569120Smrgdnl the ones we care about. 43719569120Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 43819569120SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 43919569120SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl 44019569120Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then 44119569120Smrg # Use -I$(srcdir) only when $(srcdir) != ., so that make's output 44219569120Smrg # is not polluted with repeated "-I." 44319569120Smrg AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl 44419569120Smrg # test to see if srcdir already configured 44519569120Smrg if test -f $srcdir/config.status; then 44619569120Smrg AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 44719569120Smrg fi 448a966c04fSmrgfi 449a966c04fSmrg 45019569120Smrg# test whether we have cygpath 45119569120Smrgif test -z "$CYGPATH_W"; then 45219569120Smrg if (cygpath --version) >/dev/null 2>/dev/null; then 45319569120Smrg CYGPATH_W='cygpath -w' 45419569120Smrg else 45519569120Smrg CYGPATH_W=echo 45619569120Smrg fi 4579f00f3a1Smrgfi 45819569120SmrgAC_SUBST([CYGPATH_W]) 459a966c04fSmrg 46019569120Smrg# Define the identity of the package. 46119569120Smrgdnl Distinguish between old-style and new-style calls. 46219569120Smrgm4_ifval([$2], 46319569120Smrg[AC_DIAGNOSE([obsolete], 46419569120Smrg [$0: two- and three-arguments forms are deprecated.]) 46519569120Smrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 46619569120Smrg AC_SUBST([PACKAGE], [$1])dnl 46719569120Smrg AC_SUBST([VERSION], [$2])], 46819569120Smrg[_AM_SET_OPTIONS([$1])dnl 46919569120Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. 47019569120Smrgm4_if( 47119569120Smrg m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), 47219569120Smrg [ok:ok],, 47319569120Smrg [m4_fatal([AC_INIT should be called with package and version arguments])])dnl 47419569120Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl 47519569120Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl 476a966c04fSmrg 47719569120Smrg_AM_IF_OPTION([no-define],, 47819569120Smrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) 47919569120Smrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl 480a966c04fSmrg 48119569120Smrg# Some tools Automake needs. 48219569120SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl 48319569120SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl 48419569120SmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) 48519569120SmrgAM_MISSING_PROG([AUTOCONF], [autoconf]) 48619569120SmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) 48719569120SmrgAM_MISSING_PROG([AUTOHEADER], [autoheader]) 48819569120SmrgAM_MISSING_PROG([MAKEINFO], [makeinfo]) 48919569120SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl 49019569120SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl 49119569120SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl 49219569120Smrg# For better backward compatibility. To be removed once Automake 1.9.x 49319569120Smrg# dies out for good. For more background, see: 49419569120Smrg# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> 49519569120Smrg# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> 49619569120SmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)']) 49719569120Smrg# We need awk for the "check" target (and possibly the TAP driver). The 49819569120Smrg# system "awk" is bad on some platforms. 49919569120SmrgAC_REQUIRE([AC_PROG_AWK])dnl 50019569120SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl 50119569120SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl 50219569120Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], 50319569120Smrg [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], 50419569120Smrg [_AM_PROG_TAR([v7])])]) 50519569120Smrg_AM_IF_OPTION([no-dependencies],, 50619569120Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC], 50719569120Smrg [_AM_DEPENDENCIES([CC])], 50819569120Smrg [m4_define([AC_PROG_CC], 50919569120Smrg m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl 51019569120SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX], 51119569120Smrg [_AM_DEPENDENCIES([CXX])], 51219569120Smrg [m4_define([AC_PROG_CXX], 51319569120Smrg m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl 51419569120SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC], 51519569120Smrg [_AM_DEPENDENCIES([OBJC])], 51619569120Smrg [m4_define([AC_PROG_OBJC], 51719569120Smrg m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl 51819569120SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX], 51919569120Smrg [_AM_DEPENDENCIES([OBJCXX])], 52019569120Smrg [m4_define([AC_PROG_OBJCXX], 52119569120Smrg m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl 52219569120Smrg]) 52319569120Smrg# Variables for tags utilities; see am/tags.am 52419569120Smrgif test -z "$CTAGS"; then 52519569120Smrg CTAGS=ctags 5269f00f3a1Smrgfi 52719569120SmrgAC_SUBST([CTAGS]) 52819569120Smrgif test -z "$ETAGS"; then 52919569120Smrg ETAGS=etags 5309f00f3a1Smrgfi 53119569120SmrgAC_SUBST([ETAGS]) 53219569120Smrgif test -z "$CSCOPE"; then 53319569120Smrg CSCOPE=cscope 53419569120Smrgfi 53519569120SmrgAC_SUBST([CSCOPE]) 536a966c04fSmrg 53719569120SmrgAC_REQUIRE([AM_SILENT_RULES])dnl 53819569120Smrgdnl The testsuite driver may need to know about EXEEXT, so add the 53919569120Smrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This 54019569120Smrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. 54119569120SmrgAC_CONFIG_COMMANDS_PRE(dnl 54219569120Smrg[m4_provide_if([_AM_COMPILER_EXEEXT], 54319569120Smrg [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl 544a966c04fSmrg 54519569120Smrg# POSIX will say in a future version that running "rm -f" with no argument 54619569120Smrg# is OK; and we want to be able to make that assumption in our Makefile 54719569120Smrg# recipes. So use an aggressive probe to check that the usage we want is 54819569120Smrg# actually supported "in the wild" to an acceptable degree. 54919569120Smrg# See automake bug#10828. 55019569120Smrg# To make any issue more visible, cause the running configure to be aborted 55119569120Smrg# by default if the 'rm' program in use doesn't match our expectations; the 55219569120Smrg# user can still override this though. 55319569120Smrgif rm -f && rm -fr && rm -rf; then : OK; else 55419569120Smrg cat >&2 <<'END' 55519569120SmrgOops! 5569f00f3a1Smrg 55719569120SmrgYour 'rm' program seems unable to run without file operands specified 55819569120Smrgon the command line, even when the '-f' option is present. This is contrary 55919569120Smrgto the behaviour of most rm programs out there, and not conforming with 56019569120Smrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542> 5619f00f3a1Smrg 56219569120SmrgPlease tell bug-automake@gnu.org about your system, including the value 56319569120Smrgof your $PATH and any error possibly output before this message. This 56419569120Smrgcan help us improve future automake versions. 5659f00f3a1Smrg 56619569120SmrgEND 56719569120Smrg if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then 56819569120Smrg echo 'Configuration will proceed anyway, since you have set the' >&2 56919569120Smrg echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 57019569120Smrg echo >&2 57119569120Smrg else 57219569120Smrg cat >&2 <<'END' 57319569120SmrgAborting the configuration process, to ensure you take notice of the issue. 574a966c04fSmrg 57519569120SmrgYou can download and install GNU coreutils to get an 'rm' implementation 57619569120Smrgthat behaves properly: <https://www.gnu.org/software/coreutils/>. 57719569120Smrg 57819569120SmrgIf you want to complete the configuration process using your problematic 57919569120Smrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM 58019569120Smrgto "yes", and re-run configure. 58119569120Smrg 58219569120SmrgEND 58319569120Smrg AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) 58419569120Smrg fi 5859f00f3a1Smrgfi 58619569120Smrgdnl The trailing newline in this macro's definition is deliberate, for 58719569120Smrgdnl backward compatibility and to allow trailing 'dnl'-style comments 58819569120Smrgdnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. 58919569120Smrg]) 590a966c04fSmrg 59119569120Smrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not 59219569120Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further 59319569120Smrgdnl mangled by Autoconf and run in a shell conditional statement. 59419569120Smrgm4_define([_AC_COMPILER_EXEEXT], 59519569120Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) 5969f00f3a1Smrg 59719569120Smrg# When config.status generates a header, we must update the stamp-h file. 59819569120Smrg# This file resides in the same directory as the config header 59919569120Smrg# that is generated. The stamp files are numbered to have different names. 600a966c04fSmrg 60119569120Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 60219569120Smrg# loop where config.status creates the headers, so we can generate 60319569120Smrg# our stamp files there. 60419569120SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 60519569120Smrg[# Compute $1's index in $config_headers. 60619569120Smrg_am_arg=$1 60719569120Smrg_am_stamp_count=1 60819569120Smrgfor _am_header in $config_headers :; do 60919569120Smrg case $_am_header in 61019569120Smrg $_am_arg | $_am_arg:* ) 61119569120Smrg break ;; 61219569120Smrg * ) 61319569120Smrg _am_stamp_count=`expr $_am_stamp_count + 1` ;; 61419569120Smrg esac 61519569120Smrgdone 61619569120Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) 617a966c04fSmrg 61819569120Smrg# Copyright (C) 2001-2021 Free Software Foundation, Inc. 61919569120Smrg# 62019569120Smrg# This file is free software; the Free Software Foundation 62119569120Smrg# gives unlimited permission to copy and/or distribute it, 62219569120Smrg# with or without modifications, as long as this notice is preserved. 623ac92798bSmrg 62419569120Smrg# AM_PROG_INSTALL_SH 62519569120Smrg# ------------------ 62619569120Smrg# Define $install_sh. 62719569120SmrgAC_DEFUN([AM_PROG_INSTALL_SH], 62819569120Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 62919569120Smrgif test x"${install_sh+set}" != xset; then 63019569120Smrg case $am_aux_dir in 63119569120Smrg *\ * | *\ *) 63219569120Smrg install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; 63319569120Smrg *) 63419569120Smrg install_sh="\${SHELL} $am_aux_dir/install-sh" 63519569120Smrg esac 636a966c04fSmrgfi 63719569120SmrgAC_SUBST([install_sh])]) 638a966c04fSmrg 63919569120Smrg# Copyright (C) 2003-2021 Free Software Foundation, Inc. 64019569120Smrg# 64119569120Smrg# This file is free software; the Free Software Foundation 64219569120Smrg# gives unlimited permission to copy and/or distribute it, 64319569120Smrg# with or without modifications, as long as this notice is preserved. 6449f00f3a1Smrg 64519569120Smrg# Check whether the underlying file-system supports filenames 64619569120Smrg# with a leading dot. For instance MS-DOS doesn't. 64719569120SmrgAC_DEFUN([AM_SET_LEADING_DOT], 64819569120Smrg[rm -rf .tst 2>/dev/null 64919569120Smrgmkdir .tst 2>/dev/null 65019569120Smrgif test -d .tst; then 65119569120Smrg am__leading_dot=. 6529f00f3a1Smrgelse 65319569120Smrg am__leading_dot=_ 654a966c04fSmrgfi 65519569120Smrgrmdir .tst 2>/dev/null 65619569120SmrgAC_SUBST([am__leading_dot])]) 657a966c04fSmrg 65819569120Smrg# Check to see how 'make' treats includes. -*- Autoconf -*- 659a966c04fSmrg 66019569120Smrg# Copyright (C) 2001-2021 Free Software Foundation, Inc. 66119569120Smrg# 66219569120Smrg# This file is free software; the Free Software Foundation 66319569120Smrg# gives unlimited permission to copy and/or distribute it, 66419569120Smrg# with or without modifications, as long as this notice is preserved. 665a966c04fSmrg 66619569120Smrg# AM_MAKE_INCLUDE() 66719569120Smrg# ----------------- 66819569120Smrg# Check whether make has an 'include' directive that can support all 66919569120Smrg# the idioms we need for our automatic dependency tracking code. 67019569120SmrgAC_DEFUN([AM_MAKE_INCLUDE], 67119569120Smrg[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) 67219569120Smrgcat > confinc.mk << 'END' 67319569120Smrgam__doit: 67419569120Smrg @echo this is the am__doit target >confinc.out 67519569120Smrg.PHONY: am__doit 67619569120SmrgEND 67719569120Smrgam__include="#" 67819569120Smrgam__quote= 67919569120Smrg# BSD make does it like this. 68019569120Smrgecho '.include "confinc.mk" # ignored' > confmf.BSD 68119569120Smrg# Other make implementations (GNU, Solaris 10, AIX) do it like this. 68219569120Smrgecho 'include confinc.mk # ignored' > confmf.GNU 68319569120Smrg_am_result=no 68419569120Smrgfor s in GNU BSD; do 68519569120Smrg AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) 68619569120Smrg AS_CASE([$?:`cat confinc.out 2>/dev/null`], 68719569120Smrg ['0:this is the am__doit target'], 68819569120Smrg [AS_CASE([$s], 68919569120Smrg [BSD], [am__include='.include' am__quote='"'], 69019569120Smrg [am__include='include' am__quote=''])]) 69119569120Smrg if test "$am__include" != "#"; then 69219569120Smrg _am_result="yes ($s style)" 69319569120Smrg break 69419569120Smrg fi 69519569120Smrgdone 69619569120Smrgrm -f confinc.* confmf.* 69719569120SmrgAC_MSG_RESULT([${_am_result}]) 69819569120SmrgAC_SUBST([am__include])]) 69919569120SmrgAC_SUBST([am__quote])]) 700a966c04fSmrg 70119569120Smrg# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- 702ac92798bSmrg 70319569120Smrg# Copyright (C) 1997-2021 Free Software Foundation, Inc. 7049f00f3a1Smrg# 70519569120Smrg# This file is free software; the Free Software Foundation 70619569120Smrg# gives unlimited permission to copy and/or distribute it, 70719569120Smrg# with or without modifications, as long as this notice is preserved. 708ac92798bSmrg 70919569120Smrg# AM_MISSING_PROG(NAME, PROGRAM) 71019569120Smrg# ------------------------------ 71119569120SmrgAC_DEFUN([AM_MISSING_PROG], 71219569120Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN]) 71319569120Smrg$1=${$1-"${am_missing_run}$2"} 71419569120SmrgAC_SUBST($1)]) 715ac92798bSmrg 71619569120Smrg# AM_MISSING_HAS_RUN 71719569120Smrg# ------------------ 71819569120Smrg# Define MISSING if not defined so far and test if it is modern enough. 71919569120Smrg# If it is, set am_missing_run to use it, otherwise, to nothing. 72019569120SmrgAC_DEFUN([AM_MISSING_HAS_RUN], 72119569120Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 72219569120SmrgAC_REQUIRE_AUX_FILE([missing])dnl 72319569120Smrgif test x"${MISSING+set}" != xset; then 72419569120Smrg MISSING="\${SHELL} '$am_aux_dir/missing'" 7259f00f3a1Smrgfi 72619569120Smrg# Use eval to expand $SHELL 72719569120Smrgif eval "$MISSING --is-lightweight"; then 72819569120Smrg am_missing_run="$MISSING " 72919569120Smrgelse 73019569120Smrg am_missing_run= 73119569120Smrg AC_MSG_WARN(['missing' script is too old or missing]) 7329f00f3a1Smrgfi 73319569120Smrg]) 734ac92798bSmrg 73519569120Smrg# Helper functions for option handling. -*- Autoconf -*- 7362e2dd055Smrg 73719569120Smrg# Copyright (C) 2001-2021 Free Software Foundation, Inc. 73819569120Smrg# 73919569120Smrg# This file is free software; the Free Software Foundation 74019569120Smrg# gives unlimited permission to copy and/or distribute it, 74119569120Smrg# with or without modifications, as long as this notice is preserved. 742a966c04fSmrg 74319569120Smrg# _AM_MANGLE_OPTION(NAME) 74419569120Smrg# ----------------------- 74519569120SmrgAC_DEFUN([_AM_MANGLE_OPTION], 74619569120Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 747a966c04fSmrg 74819569120Smrg# _AM_SET_OPTION(NAME) 74919569120Smrg# -------------------- 75019569120Smrg# Set option NAME. Presently that only means defining a flag for this option. 75119569120SmrgAC_DEFUN([_AM_SET_OPTION], 75219569120Smrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) 753a966c04fSmrg 75419569120Smrg# _AM_SET_OPTIONS(OPTIONS) 75519569120Smrg# ------------------------ 75619569120Smrg# OPTIONS is a space-separated list of Automake options. 75719569120SmrgAC_DEFUN([_AM_SET_OPTIONS], 75819569120Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 759a966c04fSmrg 76019569120Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 76119569120Smrg# ------------------------------------------- 76219569120Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 76319569120SmrgAC_DEFUN([_AM_IF_OPTION], 76419569120Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 765a966c04fSmrg 76619569120Smrg# Copyright (C) 1999-2021 Free Software Foundation, Inc. 767edce3322Smrg# 76819569120Smrg# This file is free software; the Free Software Foundation 76919569120Smrg# gives unlimited permission to copy and/or distribute it, 77019569120Smrg# with or without modifications, as long as this notice is preserved. 771a966c04fSmrg 77219569120Smrg# _AM_PROG_CC_C_O 77319569120Smrg# --------------- 77419569120Smrg# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC 77519569120Smrg# to automatically call this. 77619569120SmrgAC_DEFUN([_AM_PROG_CC_C_O], 77719569120Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 77819569120SmrgAC_REQUIRE_AUX_FILE([compile])dnl 77919569120SmrgAC_LANG_PUSH([C])dnl 78019569120SmrgAC_CACHE_CHECK( 78119569120Smrg [whether $CC understands -c and -o together], 78219569120Smrg [am_cv_prog_cc_c_o], 78319569120Smrg [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) 78419569120Smrg # Make sure it works both with $CC and with simple cc. 78519569120Smrg # Following AC_PROG_CC_C_O, we do the test twice because some 78619569120Smrg # compilers refuse to overwrite an existing .o file with -o, 78719569120Smrg # though they will create one. 78819569120Smrg am_cv_prog_cc_c_o=yes 78919569120Smrg for am_i in 1 2; do 79019569120Smrg if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ 79119569120Smrg && test -f conftest2.$ac_objext; then 79219569120Smrg : OK 79319569120Smrg else 79419569120Smrg am_cv_prog_cc_c_o=no 79519569120Smrg break 79619569120Smrg fi 79719569120Smrg done 79819569120Smrg rm -f core conftest* 79919569120Smrg unset am_i]) 80019569120Smrgif test "$am_cv_prog_cc_c_o" != yes; then 80119569120Smrg # Losing compiler, so override with the script. 80219569120Smrg # FIXME: It is wrong to rewrite CC. 80319569120Smrg # But if we don't then we get into trouble of one sort or another. 80419569120Smrg # A longer-term fix would be to have automake use am__CC in this case, 80519569120Smrg # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" 80619569120Smrg CC="$am_aux_dir/compile $CC" 807a966c04fSmrgfi 80819569120SmrgAC_LANG_POP([C])]) 809a966c04fSmrg 81019569120Smrg# For backward compatibility. 81119569120SmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) 812a966c04fSmrg 81319569120Smrg# Copyright (C) 2001-2021 Free Software Foundation, Inc. 8149f00f3a1Smrg# 81519569120Smrg# This file is free software; the Free Software Foundation 81619569120Smrg# gives unlimited permission to copy and/or distribute it, 81719569120Smrg# with or without modifications, as long as this notice is preserved. 818a966c04fSmrg 81919569120Smrg# AM_RUN_LOG(COMMAND) 82019569120Smrg# ------------------- 82119569120Smrg# Run COMMAND, save the exit status in ac_status, and log it. 82219569120Smrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) 82319569120SmrgAC_DEFUN([AM_RUN_LOG], 82419569120Smrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD 82519569120Smrg ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD 82619569120Smrg ac_status=$? 82719569120Smrg echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD 82819569120Smrg (exit $ac_status); }]) 829a966c04fSmrg 83019569120Smrg# Check to make sure that the build environment is sane. -*- Autoconf -*- 831a966c04fSmrg 83219569120Smrg# Copyright (C) 1996-2021 Free Software Foundation, Inc. 833ac92798bSmrg# 83419569120Smrg# This file is free software; the Free Software Foundation 83519569120Smrg# gives unlimited permission to copy and/or distribute it, 83619569120Smrg# with or without modifications, as long as this notice is preserved. 837a966c04fSmrg 83819569120Smrg# AM_SANITY_CHECK 83919569120Smrg# --------------- 84019569120SmrgAC_DEFUN([AM_SANITY_CHECK], 84119569120Smrg[AC_MSG_CHECKING([whether build environment is sane]) 84219569120Smrg# Reject unsafe characters in $srcdir or the absolute working directory 84319569120Smrg# name. Accept space and tab only in the latter. 84419569120Smrgam_lf=' 84519569120Smrg' 84619569120Smrgcase `pwd` in 84719569120Smrg *[[\\\"\#\$\&\'\`$am_lf]]*) 84819569120Smrg AC_MSG_ERROR([unsafe absolute working directory name]);; 84919569120Smrgesac 85019569120Smrgcase $srcdir in 85119569120Smrg *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) 85219569120Smrg AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; 85319569120Smrgesac 8542e2dd055Smrg 85519569120Smrg# Do 'set' in a subshell so we don't clobber the current shell's 85619569120Smrg# arguments. Must try -L first in case configure is actually a 85719569120Smrg# symlink; some systems play weird games with the mod time of symlinks 85819569120Smrg# (eg FreeBSD returns the mod time of the symlink's containing 85919569120Smrg# directory). 86019569120Smrgif ( 86119569120Smrg am_has_slept=no 86219569120Smrg for am_try in 1 2; do 86319569120Smrg echo "timestamp, slept: $am_has_slept" > conftest.file 86419569120Smrg set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` 86519569120Smrg if test "$[*]" = "X"; then 86619569120Smrg # -L didn't work. 86719569120Smrg set X `ls -t "$srcdir/configure" conftest.file` 86819569120Smrg fi 86919569120Smrg if test "$[*]" != "X $srcdir/configure conftest.file" \ 87019569120Smrg && test "$[*]" != "X conftest.file $srcdir/configure"; then 871ac92798bSmrg 87219569120Smrg # If neither matched, then we have a broken ls. This can happen 87319569120Smrg # if, for instance, CONFIG_SHELL is bash and it inherits a 87419569120Smrg # broken ls alias from the environment. This has actually 87519569120Smrg # happened. Such a system could not be considered "sane". 87619569120Smrg AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 87719569120Smrg alias in your environment]) 87819569120Smrg fi 87919569120Smrg if test "$[2]" = conftest.file || test $am_try -eq 2; then 88019569120Smrg break 88119569120Smrg fi 88219569120Smrg # Just in case. 88319569120Smrg sleep 1 88419569120Smrg am_has_slept=yes 88519569120Smrg done 88619569120Smrg test "$[2]" = conftest.file 88719569120Smrg ) 88819569120Smrgthen 88919569120Smrg # Ok. 89019569120Smrg : 891a966c04fSmrgelse 89219569120Smrg AC_MSG_ERROR([newly created file is older than distributed files! 89319569120SmrgCheck your system clock]) 894ac92798bSmrgfi 89519569120SmrgAC_MSG_RESULT([yes]) 89619569120Smrg# If we didn't sleep, we still need to ensure time stamps of config.status and 89719569120Smrg# generated files are strictly newer. 89819569120Smrgam_sleep_pid= 89919569120Smrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then 90019569120Smrg ( sleep 1 ) & 90119569120Smrg am_sleep_pid=$! 902edce3322Smrgfi 90319569120SmrgAC_CONFIG_COMMANDS_PRE( 90419569120Smrg [AC_MSG_CHECKING([that generated files are newer than configure]) 90519569120Smrg if test -n "$am_sleep_pid"; then 90619569120Smrg # Hide warnings about reused PIDs. 90719569120Smrg wait $am_sleep_pid 2>/dev/null 90819569120Smrg fi 90919569120Smrg AC_MSG_RESULT([done])]) 91019569120Smrgrm -f conftest.file 91119569120Smrg]) 912edce3322Smrg 91319569120Smrg# Copyright (C) 2009-2021 Free Software Foundation, Inc. 9149f00f3a1Smrg# 91519569120Smrg# This file is free software; the Free Software Foundation 91619569120Smrg# gives unlimited permission to copy and/or distribute it, 91719569120Smrg# with or without modifications, as long as this notice is preserved. 9182e2dd055Smrg 91919569120Smrg# AM_SILENT_RULES([DEFAULT]) 92019569120Smrg# -------------------------- 92119569120Smrg# Enable less verbose build rules; with the default set to DEFAULT 92219569120Smrg# ("yes" being less verbose, "no" or empty being verbose). 92319569120SmrgAC_DEFUN([AM_SILENT_RULES], 92419569120Smrg[AC_ARG_ENABLE([silent-rules], [dnl 92519569120SmrgAS_HELP_STRING( 92619569120Smrg [--enable-silent-rules], 92719569120Smrg [less verbose build output (undo: "make V=1")]) 92819569120SmrgAS_HELP_STRING( 92919569120Smrg [--disable-silent-rules], 93019569120Smrg [verbose build output (undo: "make V=0")])dnl 93119569120Smrg]) 93219569120Smrgcase $enable_silent_rules in @%:@ ((( 93319569120Smrg yes) AM_DEFAULT_VERBOSITY=0;; 93419569120Smrg no) AM_DEFAULT_VERBOSITY=1;; 93519569120Smrg *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; 93619569120Smrgesac 93719569120Smrgdnl 93819569120Smrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep) 93919569120Smrgdnl do not support nested variable expansions. 94019569120Smrgdnl See automake bug#9928 and bug#10237. 94119569120Smrgam_make=${MAKE-make} 94219569120SmrgAC_CACHE_CHECK([whether $am_make supports nested variables], 94319569120Smrg [am_cv_make_support_nested_variables], 94419569120Smrg [if AS_ECHO([['TRUE=$(BAR$(V)) 94519569120SmrgBAR0=false 94619569120SmrgBAR1=true 94719569120SmrgV=1 94819569120Smrgam__doit: 94919569120Smrg @$(TRUE) 95019569120Smrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then 95119569120Smrg am_cv_make_support_nested_variables=yes 952ac92798bSmrgelse 95319569120Smrg am_cv_make_support_nested_variables=no 95419569120Smrgfi]) 95519569120Smrgif test $am_cv_make_support_nested_variables = yes; then 95619569120Smrg dnl Using '$V' instead of '$(V)' breaks IRIX make. 95719569120Smrg AM_V='$(V)' 95819569120Smrg AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' 95919569120Smrgelse 96019569120Smrg AM_V=$AM_DEFAULT_VERBOSITY 96119569120Smrg AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY 962ac92798bSmrgfi 96319569120SmrgAC_SUBST([AM_V])dnl 96419569120SmrgAM_SUBST_NOTMAKE([AM_V])dnl 96519569120SmrgAC_SUBST([AM_DEFAULT_V])dnl 96619569120SmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl 96719569120SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl 96819569120SmrgAM_BACKSLASH='\' 96919569120SmrgAC_SUBST([AM_BACKSLASH])dnl 97019569120Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl 97119569120Smrg]) 972a966c04fSmrg 97319569120Smrg# Copyright (C) 2001-2021 Free Software Foundation, Inc. 974a966c04fSmrg# 97519569120Smrg# This file is free software; the Free Software Foundation 97619569120Smrg# gives unlimited permission to copy and/or distribute it, 97719569120Smrg# with or without modifications, as long as this notice is preserved. 978ac92798bSmrg 97919569120Smrg# AM_PROG_INSTALL_STRIP 98019569120Smrg# --------------------- 98119569120Smrg# One issue with vendor 'install' (even GNU) is that you can't 98219569120Smrg# specify the program used to strip binaries. This is especially 98319569120Smrg# annoying in cross-compiling environments, where the build's strip 98419569120Smrg# is unlikely to handle the host's binaries. 98519569120Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we 98619569120Smrg# always use install-sh in "make install-strip", and initialize 98719569120Smrg# STRIPPROG with the value of the STRIP variable (set by the user). 98819569120SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP], 98919569120Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 99019569120Smrg# Installed binaries are usually stripped using 'strip' when the user 99119569120Smrg# run "make install-strip". However 'strip' might not be the right 99219569120Smrg# tool to use in cross-compilation environments, therefore Automake 99319569120Smrg# will honor the 'STRIP' environment variable to overrule this program. 99419569120Smrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'. 99519569120Smrgif test "$cross_compiling" != no; then 99619569120Smrg AC_CHECK_TOOL([STRIP], [strip], :) 9979f00f3a1Smrgfi 99819569120SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" 99919569120SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])]) 1000ac92798bSmrg 100119569120Smrg# Copyright (C) 2006-2021 Free Software Foundation, Inc. 100219569120Smrg# 100319569120Smrg# This file is free software; the Free Software Foundation 100419569120Smrg# gives unlimited permission to copy and/or distribute it, 100519569120Smrg# with or without modifications, as long as this notice is preserved. 1006a966c04fSmrg 100719569120Smrg# _AM_SUBST_NOTMAKE(VARIABLE) 1008edce3322Smrg# --------------------------- 100919569120Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. 101019569120Smrg# This macro is traced by Automake. 101119569120SmrgAC_DEFUN([_AM_SUBST_NOTMAKE]) 1012edce3322Smrg 101319569120Smrg# AM_SUBST_NOTMAKE(VARIABLE) 101419569120Smrg# -------------------------- 101519569120Smrg# Public sister of _AM_SUBST_NOTMAKE. 101619569120SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) 1017edce3322Smrg 101819569120Smrg# Check how to create a tarball. -*- Autoconf -*- 101919569120Smrg 102019569120Smrg# Copyright (C) 2004-2021 Free Software Foundation, Inc. 10219f00f3a1Smrg# 102219569120Smrg# This file is free software; the Free Software Foundation 102319569120Smrg# gives unlimited permission to copy and/or distribute it, 102419569120Smrg# with or without modifications, as long as this notice is preserved. 102519569120Smrg 102619569120Smrg# _AM_PROG_TAR(FORMAT) 102719569120Smrg# -------------------- 102819569120Smrg# Check how to create a tarball in format FORMAT. 102919569120Smrg# FORMAT should be one of 'v7', 'ustar', or 'pax'. 10309f00f3a1Smrg# 103119569120Smrg# Substitute a variable $(am__tar) that is a command 103219569120Smrg# writing to stdout a FORMAT-tarball containing the directory 103319569120Smrg# $tardir. 103419569120Smrg# tardir=directory && $(am__tar) > result.tar 10359f00f3a1Smrg# 103619569120Smrg# Substitute a variable $(am__untar) that extract such 103719569120Smrg# a tarball read from stdin. 103819569120Smrg# $(am__untar) < result.tar 10399f00f3a1Smrg# 104019569120SmrgAC_DEFUN([_AM_PROG_TAR], 104119569120Smrg[# Always define AMTAR for backward compatibility. Yes, it's still used 104219569120Smrg# in the wild :-( We should find a proper way to deprecate it ... 104319569120SmrgAC_SUBST([AMTAR], ['$${TAR-tar}']) 1044a966c04fSmrg 104519569120Smrg# We'll loop over all known methods to create a tar archive until one works. 104619569120Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' 1047a966c04fSmrg 104819569120Smrgm4_if([$1], [v7], 104919569120Smrg [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], 1050a966c04fSmrg 105119569120Smrg [m4_case([$1], 105219569120Smrg [ustar], 105319569120Smrg [# The POSIX 1988 'ustar' format is defined with fixed-size fields. 105419569120Smrg # There is notably a 21 bits limit for the UID and the GID. In fact, 105519569120Smrg # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 105619569120Smrg # and bug#13588). 105719569120Smrg am_max_uid=2097151 # 2^21 - 1 105819569120Smrg am_max_gid=$am_max_uid 105919569120Smrg # The $UID and $GID variables are not portable, so we need to resort 106019569120Smrg # to the POSIX-mandated id(1) utility. Errors in the 'id' calls 106119569120Smrg # below are definitely unexpected, so allow the users to see them 106219569120Smrg # (that is, avoid stderr redirection). 106319569120Smrg am_uid=`id -u || echo unknown` 106419569120Smrg am_gid=`id -g || echo unknown` 106519569120Smrg AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) 106619569120Smrg if test $am_uid -le $am_max_uid; then 106719569120Smrg AC_MSG_RESULT([yes]) 106819569120Smrg else 106919569120Smrg AC_MSG_RESULT([no]) 107019569120Smrg _am_tools=none 107119569120Smrg fi 107219569120Smrg AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) 107319569120Smrg if test $am_gid -le $am_max_gid; then 107419569120Smrg AC_MSG_RESULT([yes]) 107519569120Smrg else 107619569120Smrg AC_MSG_RESULT([no]) 107719569120Smrg _am_tools=none 107819569120Smrg fi], 107919569120Smrg 108019569120Smrg [pax], 108119569120Smrg [], 108219569120Smrg 108319569120Smrg [m4_fatal([Unknown tar format])]) 108419569120Smrg 108519569120Smrg AC_MSG_CHECKING([how to create a $1 tar archive]) 108619569120Smrg 108719569120Smrg # Go ahead even if we have the value already cached. We do so because we 108819569120Smrg # need to set the values for the 'am__tar' and 'am__untar' variables. 108919569120Smrg _am_tools=${am_cv_prog_tar_$1-$_am_tools} 109019569120Smrg 109119569120Smrg for _am_tool in $_am_tools; do 109219569120Smrg case $_am_tool in 109319569120Smrg gnutar) 109419569120Smrg for _am_tar in tar gnutar gtar; do 109519569120Smrg AM_RUN_LOG([$_am_tar --version]) && break 109619569120Smrg done 109719569120Smrg am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' 109819569120Smrg am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' 109919569120Smrg am__untar="$_am_tar -xf -" 110019569120Smrg ;; 110119569120Smrg plaintar) 110219569120Smrg # Must skip GNU tar: if it does not support --format= it doesn't create 110319569120Smrg # ustar tarball either. 110419569120Smrg (tar --version) >/dev/null 2>&1 && continue 110519569120Smrg am__tar='tar chf - "$$tardir"' 110619569120Smrg am__tar_='tar chf - "$tardir"' 110719569120Smrg am__untar='tar xf -' 110819569120Smrg ;; 110919569120Smrg pax) 111019569120Smrg am__tar='pax -L -x $1 -w "$$tardir"' 111119569120Smrg am__tar_='pax -L -x $1 -w "$tardir"' 111219569120Smrg am__untar='pax -r' 111319569120Smrg ;; 111419569120Smrg cpio) 111519569120Smrg am__tar='find "$$tardir" -print | cpio -o -H $1 -L' 111619569120Smrg am__tar_='find "$tardir" -print | cpio -o -H $1 -L' 111719569120Smrg am__untar='cpio -i -H $1 -d' 111819569120Smrg ;; 111919569120Smrg none) 112019569120Smrg am__tar=false 112119569120Smrg am__tar_=false 112219569120Smrg am__untar=false 112319569120Smrg ;; 112419569120Smrg esac 112519569120Smrg 112619569120Smrg # If the value was cached, stop now. We just wanted to have am__tar 112719569120Smrg # and am__untar set. 112819569120Smrg test -n "${am_cv_prog_tar_$1}" && break 112919569120Smrg 113019569120Smrg # tar/untar a dummy directory, and stop if the command works. 113119569120Smrg rm -rf conftest.dir 113219569120Smrg mkdir conftest.dir 113319569120Smrg echo GrepMe > conftest.dir/file 113419569120Smrg AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) 113519569120Smrg rm -rf conftest.dir 113619569120Smrg if test -s conftest.tar; then 113719569120Smrg AM_RUN_LOG([$am__untar <conftest.tar]) 113819569120Smrg AM_RUN_LOG([cat conftest.dir/file]) 113919569120Smrg grep GrepMe conftest.dir/file >/dev/null 2>&1 && break 114019569120Smrg fi 114119569120Smrg done 114219569120Smrg rm -rf conftest.dir 114319569120Smrg 114419569120Smrg AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) 114519569120Smrg AC_MSG_RESULT([$am_cv_prog_tar_$1])]) 114619569120Smrg 114719569120SmrgAC_SUBST([am__tar]) 114819569120SmrgAC_SUBST([am__untar]) 114919569120Smrg]) # _AM_PROG_TAR 115019569120Smrg 115119569120Smrgdnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- 115219569120Smrgdnl serial 11 (pkg-config-0.29) 115319569120Smrgdnl 115419569120Smrgdnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>. 115519569120Smrgdnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com> 115619569120Smrgdnl 115719569120Smrgdnl This program is free software; you can redistribute it and/or modify 115819569120Smrgdnl it under the terms of the GNU General Public License as published by 115919569120Smrgdnl the Free Software Foundation; either version 2 of the License, or 116019569120Smrgdnl (at your option) any later version. 116119569120Smrgdnl 116219569120Smrgdnl This program is distributed in the hope that it will be useful, but 116319569120Smrgdnl WITHOUT ANY WARRANTY; without even the implied warranty of 116419569120Smrgdnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 116519569120Smrgdnl General Public License for more details. 116619569120Smrgdnl 116719569120Smrgdnl You should have received a copy of the GNU General Public License 116819569120Smrgdnl along with this program; if not, write to the Free Software 116919569120Smrgdnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 117019569120Smrgdnl 02111-1307, USA. 117119569120Smrgdnl 117219569120Smrgdnl As a special exception to the GNU General Public License, if you 117319569120Smrgdnl distribute this file as part of a program that contains a 117419569120Smrgdnl configuration script generated by Autoconf, you may include it under 117519569120Smrgdnl the same distribution terms that you use for the rest of that 117619569120Smrgdnl program. 117719569120Smrg 117819569120Smrgdnl PKG_PREREQ(MIN-VERSION) 117919569120Smrgdnl ----------------------- 118019569120Smrgdnl Since: 0.29 118119569120Smrgdnl 118219569120Smrgdnl Verify that the version of the pkg-config macros are at least 118319569120Smrgdnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's 118419569120Smrgdnl installed version of pkg-config, this checks the developer's version 118519569120Smrgdnl of pkg.m4 when generating configure. 118619569120Smrgdnl 118719569120Smrgdnl To ensure that this macro is defined, also add: 118819569120Smrgdnl m4_ifndef([PKG_PREREQ], 118919569120Smrgdnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) 119019569120Smrgdnl 119119569120Smrgdnl See the "Since" comment for each macro you use to see what version 119219569120Smrgdnl of the macros you require. 119319569120Smrgm4_defun([PKG_PREREQ], 119419569120Smrg[m4_define([PKG_MACROS_VERSION], [0.29]) 119519569120Smrgm4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, 119619569120Smrg [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) 119719569120Smrg])dnl PKG_PREREQ 119819569120Smrg 119919569120Smrgdnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) 120019569120Smrgdnl ---------------------------------- 120119569120Smrgdnl Since: 0.16 120219569120Smrgdnl 120319569120Smrgdnl Search for the pkg-config tool and set the PKG_CONFIG variable to 120419569120Smrgdnl first found in the path. Checks that the version of pkg-config found 120519569120Smrgdnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is 120619569120Smrgdnl used since that's the first version where most current features of 120719569120Smrgdnl pkg-config existed. 120819569120SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG], 120919569120Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) 121019569120Smrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) 121119569120Smrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) 121219569120SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) 121319569120SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) 121419569120SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) 121519569120Smrg 121619569120Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then 121719569120Smrg AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) 121819569120Smrgfi 121919569120Smrgif test -n "$PKG_CONFIG"; then 122019569120Smrg _pkg_min_version=m4_default([$1], [0.9.0]) 122119569120Smrg AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) 122219569120Smrg if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then 122319569120Smrg AC_MSG_RESULT([yes]) 122419569120Smrg else 122519569120Smrg AC_MSG_RESULT([no]) 122619569120Smrg PKG_CONFIG="" 122719569120Smrg fi 122819569120Smrgfi[]dnl 122919569120Smrg])dnl PKG_PROG_PKG_CONFIG 123019569120Smrg 123119569120Smrgdnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 123219569120Smrgdnl ------------------------------------------------------------------- 123319569120Smrgdnl Since: 0.18 123419569120Smrgdnl 123519569120Smrgdnl Check to see whether a particular set of modules exists. Similar to 123619569120Smrgdnl PKG_CHECK_MODULES(), but does not set variables or print errors. 123719569120Smrgdnl 123819569120Smrgdnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 123919569120Smrgdnl only at the first occurence in configure.ac, so if the first place 124019569120Smrgdnl it's called might be skipped (such as if it is within an "if", you 124119569120Smrgdnl have to call PKG_CHECK_EXISTS manually 124219569120SmrgAC_DEFUN([PKG_CHECK_EXISTS], 124319569120Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 124419569120Smrgif test -n "$PKG_CONFIG" && \ 124519569120Smrg AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then 124619569120Smrg m4_default([$2], [:]) 124719569120Smrgm4_ifvaln([$3], [else 124819569120Smrg $3])dnl 124919569120Smrgfi]) 125019569120Smrg 125119569120Smrgdnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) 125219569120Smrgdnl --------------------------------------------- 125319569120Smrgdnl Internal wrapper calling pkg-config via PKG_CONFIG and setting 125419569120Smrgdnl pkg_failed based on the result. 125519569120Smrgm4_define([_PKG_CONFIG], 125619569120Smrg[if test -n "$$1"; then 125719569120Smrg pkg_cv_[]$1="$$1" 125819569120Smrg elif test -n "$PKG_CONFIG"; then 125919569120Smrg PKG_CHECK_EXISTS([$3], 126019569120Smrg [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` 126119569120Smrg test "x$?" != "x0" && pkg_failed=yes ], 126219569120Smrg [pkg_failed=yes]) 126319569120Smrg else 126419569120Smrg pkg_failed=untried 126519569120Smrgfi[]dnl 126619569120Smrg])dnl _PKG_CONFIG 126719569120Smrg 126819569120Smrgdnl _PKG_SHORT_ERRORS_SUPPORTED 126919569120Smrgdnl --------------------------- 127019569120Smrgdnl Internal check to see if pkg-config supports short errors. 127119569120SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], 127219569120Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 127319569120Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then 127419569120Smrg _pkg_short_errors_supported=yes 127519569120Smrgelse 127619569120Smrg _pkg_short_errors_supported=no 127719569120Smrgfi[]dnl 127819569120Smrg])dnl _PKG_SHORT_ERRORS_SUPPORTED 127919569120Smrg 128019569120Smrg 128119569120Smrgdnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], 128219569120Smrgdnl [ACTION-IF-NOT-FOUND]) 128319569120Smrgdnl -------------------------------------------------------------- 128419569120Smrgdnl Since: 0.4.0 128519569120Smrgdnl 128619569120Smrgdnl Note that if there is a possibility the first call to 128719569120Smrgdnl PKG_CHECK_MODULES might not happen, you should be sure to include an 128819569120Smrgdnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac 128919569120SmrgAC_DEFUN([PKG_CHECK_MODULES], 129019569120Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 129119569120SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl 129219569120SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl 129319569120Smrg 129419569120Smrgpkg_failed=no 129519569120SmrgAC_MSG_CHECKING([for $1]) 129619569120Smrg 129719569120Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) 129819569120Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2]) 129919569120Smrg 130019569120Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS 130119569120Smrgand $1[]_LIBS to avoid the need to call pkg-config. 130219569120SmrgSee the pkg-config man page for more details.]) 130319569120Smrg 130419569120Smrgif test $pkg_failed = yes; then 130519569120Smrg AC_MSG_RESULT([no]) 130619569120Smrg _PKG_SHORT_ERRORS_SUPPORTED 130719569120Smrg if test $_pkg_short_errors_supported = yes; then 130819569120Smrg $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` 130919569120Smrg else 131019569120Smrg $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` 131119569120Smrg fi 131219569120Smrg # Put the nasty error message in config.log where it belongs 131319569120Smrg echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD 13149f00f3a1Smrg 131519569120Smrg m4_default([$4], [AC_MSG_ERROR( 131619569120Smrg[Package requirements ($2) were not met: 1317a966c04fSmrg 131819569120Smrg$$1_PKG_ERRORS 1319a966c04fSmrg 132019569120SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you 132119569120Smrginstalled software in a non-standard prefix. 13226e7d3316Smrg 132319569120Smrg_PKG_TEXT])[]dnl 132419569120Smrg ]) 132519569120Smrgelif test $pkg_failed = untried; then 132619569120Smrg AC_MSG_RESULT([no]) 132719569120Smrg m4_default([$4], [AC_MSG_FAILURE( 132819569120Smrg[The pkg-config script could not be found or is too old. Make sure it 132919569120Smrgis in your PATH or set the PKG_CONFIG environment variable to the full 133019569120Smrgpath to pkg-config. 13316e7d3316Smrg 133219569120Smrg_PKG_TEXT 13336e7d3316Smrg 133419569120SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl 133519569120Smrg ]) 133619569120Smrgelse 133719569120Smrg $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS 133819569120Smrg $1[]_LIBS=$pkg_cv_[]$1[]_LIBS 133919569120Smrg AC_MSG_RESULT([yes]) 134019569120Smrg $3 134119569120Smrgfi[]dnl 134219569120Smrg])dnl PKG_CHECK_MODULES 13436e7d3316Smrg 13446e7d3316Smrg 134519569120Smrgdnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], 134619569120Smrgdnl [ACTION-IF-NOT-FOUND]) 134719569120Smrgdnl --------------------------------------------------------------------- 134819569120Smrgdnl Since: 0.29 134919569120Smrgdnl 135019569120Smrgdnl Checks for existence of MODULES and gathers its build flags with 135119569120Smrgdnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags 135219569120Smrgdnl and VARIABLE-PREFIX_LIBS from --libs. 135319569120Smrgdnl 135419569120Smrgdnl Note that if there is a possibility the first call to 135519569120Smrgdnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to 135619569120Smrgdnl include an explicit call to PKG_PROG_PKG_CONFIG in your 135719569120Smrgdnl configure.ac. 135819569120SmrgAC_DEFUN([PKG_CHECK_MODULES_STATIC], 135919569120Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 136019569120Smrg_save_PKG_CONFIG=$PKG_CONFIG 136119569120SmrgPKG_CONFIG="$PKG_CONFIG --static" 136219569120SmrgPKG_CHECK_MODULES($@) 136319569120SmrgPKG_CONFIG=$_save_PKG_CONFIG[]dnl 136419569120Smrg])dnl PKG_CHECK_MODULES_STATIC 136519569120Smrg 136619569120Smrg 136719569120Smrgdnl PKG_INSTALLDIR([DIRECTORY]) 136819569120Smrgdnl ------------------------- 136919569120Smrgdnl Since: 0.27 137019569120Smrgdnl 137119569120Smrgdnl Substitutes the variable pkgconfigdir as the location where a module 137219569120Smrgdnl should install pkg-config .pc files. By default the directory is 137319569120Smrgdnl $libdir/pkgconfig, but the default can be changed by passing 137419569120Smrgdnl DIRECTORY. The user can override through the --with-pkgconfigdir 137519569120Smrgdnl parameter. 137619569120SmrgAC_DEFUN([PKG_INSTALLDIR], 137719569120Smrg[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) 137819569120Smrgm4_pushdef([pkg_description], 137919569120Smrg [pkg-config installation directory @<:@]pkg_default[@:>@]) 138019569120SmrgAC_ARG_WITH([pkgconfigdir], 138119569120Smrg [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, 138219569120Smrg [with_pkgconfigdir=]pkg_default) 138319569120SmrgAC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) 138419569120Smrgm4_popdef([pkg_default]) 138519569120Smrgm4_popdef([pkg_description]) 138619569120Smrg])dnl PKG_INSTALLDIR 138719569120Smrg 138819569120Smrg 138919569120Smrgdnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) 139019569120Smrgdnl -------------------------------- 139119569120Smrgdnl Since: 0.27 139219569120Smrgdnl 139319569120Smrgdnl Substitutes the variable noarch_pkgconfigdir as the location where a 139419569120Smrgdnl module should install arch-independent pkg-config .pc files. By 139519569120Smrgdnl default the directory is $datadir/pkgconfig, but the default can be 139619569120Smrgdnl changed by passing DIRECTORY. The user can override through the 139719569120Smrgdnl --with-noarch-pkgconfigdir parameter. 139819569120SmrgAC_DEFUN([PKG_NOARCH_INSTALLDIR], 139919569120Smrg[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) 140019569120Smrgm4_pushdef([pkg_description], 140119569120Smrg [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) 140219569120SmrgAC_ARG_WITH([noarch-pkgconfigdir], 140319569120Smrg [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, 140419569120Smrg [with_noarch_pkgconfigdir=]pkg_default) 140519569120SmrgAC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) 140619569120Smrgm4_popdef([pkg_default]) 140719569120Smrgm4_popdef([pkg_description]) 140819569120Smrg])dnl PKG_NOARCH_INSTALLDIR 140919569120Smrg 141019569120Smrg 141119569120Smrgdnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, 141219569120Smrgdnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 141319569120Smrgdnl ------------------------------------------- 141419569120Smrgdnl Since: 0.28 141519569120Smrgdnl 141619569120Smrgdnl Retrieves the value of the pkg-config variable for the given module. 141719569120SmrgAC_DEFUN([PKG_CHECK_VAR], 141819569120Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 141919569120SmrgAC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl 14206e7d3316Smrg 142119569120Smrg_PKG_CONFIG([$1], [variable="][$3]["], [$2]) 142219569120SmrgAS_VAR_COPY([$1], [pkg_cv_][$1]) 14236e7d3316Smrg 142419569120SmrgAS_VAR_IF([$1], [""], [$5], [$4])dnl 142519569120Smrg])dnl PKG_CHECK_VAR 14266e7d3316Smrg 142719569120Smrgdnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. 142819569120Smrgdnl 142919569120Smrgdnl Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. 143019569120Smrgdnl 143119569120Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a 143219569120Smrgdnl copy of this software and associated documentation files (the "Software"), 143319569120Smrgdnl to deal in the Software without restriction, including without limitation 143419569120Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense, 143519569120Smrgdnl and/or sell copies of the Software, and to permit persons to whom the 143619569120Smrgdnl Software is furnished to do so, subject to the following conditions: 143719569120Smrgdnl 143819569120Smrgdnl The above copyright notice and this permission notice (including the next 143919569120Smrgdnl paragraph) shall be included in all copies or substantial portions of the 144019569120Smrgdnl Software. 144119569120Smrgdnl 144219569120Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 144319569120Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 144419569120Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 144519569120Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 144619569120Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 144719569120Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 144819569120Smrgdnl DEALINGS IN THE SOFTWARE. 14496e7d3316Smrg 145019569120Smrg# XORG_MACROS_VERSION(required-version) 145119569120Smrg# ------------------------------------- 145219569120Smrg# Minimum version: 1.1.0 14539f00f3a1Smrg# 145419569120Smrg# If you're using a macro added in Version 1.1 or newer, include this in 145519569120Smrg# your configure.ac with the minimum required version, such as: 145619569120Smrg# XORG_MACROS_VERSION(1.1) 14579f00f3a1Smrg# 145819569120Smrg# To ensure that this macro is defined, also add: 145919569120Smrg# m4_ifndef([XORG_MACROS_VERSION], 146019569120Smrg# [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])]) 14619f00f3a1Smrg# 14629f00f3a1Smrg# 146319569120Smrg# See the "minimum version" comment for each macro you use to see what 146419569120Smrg# version you require. 146519569120Smrgm4_defun([XORG_MACROS_VERSION],[ 146619569120Smrgm4_define([vers_have], [1.19.3]) 146719569120Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) 146819569120Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) 146919569120Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,, 147019569120Smrg [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])]) 147119569120Smrgm4_if(m4_version_compare(vers_have, [$1]), -1, 147219569120Smrg [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])]) 147319569120Smrgm4_undefine([vers_have]) 147419569120Smrgm4_undefine([maj_have]) 147519569120Smrgm4_undefine([maj_needed]) 147619569120Smrg]) # XORG_MACROS_VERSION 1477a966c04fSmrg 147819569120Smrg# XORG_PROG_RAWCPP() 147919569120Smrg# ------------------ 14809f00f3a1Smrg# Minimum version: 1.0.0 14819f00f3a1Smrg# 148219569120Smrg# Find cpp program and necessary flags for use in pre-processing text files 148319569120Smrg# such as man pages and config files 148419569120SmrgAC_DEFUN([XORG_PROG_RAWCPP],[ 148519569120SmrgAC_REQUIRE([AC_PROG_CPP]) 148619569120SmrgAC_PATH_TOOL(RAWCPP, [cpp], [${CPP}], 148719569120Smrg [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) 1488a966c04fSmrg 148919569120Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined, 149019569120Smrg# which is not the best choice for supporting other OS'es, but covers most 149119569120Smrg# of the ones we need for now. 149219569120SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef]) 149319569120SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])]) 149419569120Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 149519569120Smrg AC_MSG_RESULT([no]) 149619569120Smrgelse 149719569120Smrg if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 149819569120Smrg RAWCPPFLAGS=-undef 149919569120Smrg AC_MSG_RESULT([yes]) 150019569120Smrg # under Cygwin unix is still defined even with -undef 150119569120Smrg elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 150219569120Smrg RAWCPPFLAGS="-undef -ansi" 150319569120Smrg AC_MSG_RESULT([yes, with -ansi]) 150419569120Smrg else 150519569120Smrg AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.]) 150619569120Smrg fi 1507ac92798bSmrgfi 150819569120Smrgrm -f conftest.$ac_ext 15099f00f3a1Smrg 151019569120SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional]) 151119569120SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve "whitespace"?]])]) 151219569120Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 151319569120Smrg AC_MSG_RESULT([no]) 15149f00f3a1Smrgelse 151519569120Smrg if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 151619569120Smrg TRADITIONALCPPFLAGS="-traditional" 151719569120Smrg RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" 151819569120Smrg AC_MSG_RESULT([yes]) 151919569120Smrg else 152019569120Smrg AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) 152119569120Smrg fi 1522ac92798bSmrgfi 152319569120Smrgrm -f conftest.$ac_ext 152419569120SmrgAC_SUBST(RAWCPPFLAGS) 152519569120SmrgAC_SUBST(TRADITIONALCPPFLAGS) 152619569120Smrg]) # XORG_PROG_RAWCPP 1527ac92798bSmrg 152819569120Smrg# XORG_MANPAGE_SECTIONS() 152919569120Smrg# ----------------------- 153019569120Smrg# Minimum version: 1.0.0 15319f00f3a1Smrg# 153219569120Smrg# Determine which sections man pages go in for the different man page types 153319569120Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. 153419569120Smrg# Not sure if there's any better way than just hardcoding by OS name. 153519569120Smrg# Override default settings by setting environment variables 153619569120Smrg# Added MAN_SUBSTS in version 1.8 153719569120Smrg# Added AC_PROG_SED in version 1.8 15386e7d3316Smrg 153919569120SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[ 154019569120SmrgAC_REQUIRE([AC_CANONICAL_HOST]) 154119569120SmrgAC_REQUIRE([AC_PROG_SED]) 15426e7d3316Smrg 15439f00f3a1Smrgcase $host_os in 154419569120Smrg solaris*) 154519569120Smrg # Solaris 2.0 - 11.3 use SysV man page section numbers, so we 154619569120Smrg # check for a man page file found in later versions that use 154719569120Smrg # traditional section numbers instead 154819569120Smrg AC_CHECK_FILE([/usr/share/man/man7/attributes.7], 154919569120Smrg [SYSV_MAN_SECTIONS=false], [SYSV_MAN_SECTIONS=true]) 155019569120Smrg ;; 155119569120Smrg *) SYSV_MAN_SECTIONS=false ;; 15529f00f3a1Smrgesac 15536e7d3316Smrg 155419569120Smrgif test x$APP_MAN_SUFFIX = x ; then 155519569120Smrg APP_MAN_SUFFIX=1 15569f00f3a1Smrgfi 155719569120Smrgif test x$APP_MAN_DIR = x ; then 155819569120Smrg APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' 15599f00f3a1Smrgfi 15606e7d3316Smrg 156119569120Smrgif test x$LIB_MAN_SUFFIX = x ; then 156219569120Smrg LIB_MAN_SUFFIX=3 156319569120Smrgfi 156419569120Smrgif test x$LIB_MAN_DIR = x ; then 156519569120Smrg LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' 156619569120Smrgfi 15676e7d3316Smrg 156819569120Smrgif test x$FILE_MAN_SUFFIX = x ; then 156919569120Smrg case $SYSV_MAN_SECTIONS in 157019569120Smrg true) FILE_MAN_SUFFIX=4 ;; 157119569120Smrg *) FILE_MAN_SUFFIX=5 ;; 157219569120Smrg esac 157319569120Smrgfi 157419569120Smrgif test x$FILE_MAN_DIR = x ; then 157519569120Smrg FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' 157619569120Smrgfi 15776e7d3316Smrg 157819569120Smrgif test x$MISC_MAN_SUFFIX = x ; then 157919569120Smrg case $SYSV_MAN_SECTIONS in 158019569120Smrg true) MISC_MAN_SUFFIX=5 ;; 158119569120Smrg *) MISC_MAN_SUFFIX=7 ;; 158219569120Smrg esac 158319569120Smrgfi 158419569120Smrgif test x$MISC_MAN_DIR = x ; then 158519569120Smrg MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' 158619569120Smrgfi 15876e7d3316Smrg 158819569120Smrgif test x$DRIVER_MAN_SUFFIX = x ; then 158919569120Smrg case $SYSV_MAN_SECTIONS in 159019569120Smrg true) DRIVER_MAN_SUFFIX=7 ;; 159119569120Smrg *) DRIVER_MAN_SUFFIX=4 ;; 159219569120Smrg esac 159319569120Smrgfi 159419569120Smrgif test x$DRIVER_MAN_DIR = x ; then 159519569120Smrg DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' 159619569120Smrgfi 15976e7d3316Smrg 159819569120Smrgif test x$ADMIN_MAN_SUFFIX = x ; then 159919569120Smrg case $SYSV_MAN_SECTIONS in 160019569120Smrg true) ADMIN_MAN_SUFFIX=1m ;; 160119569120Smrg *) ADMIN_MAN_SUFFIX=8 ;; 160219569120Smrg esac 160319569120Smrgfi 160419569120Smrgif test x$ADMIN_MAN_DIR = x ; then 160519569120Smrg ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' 160697cf2ee2Smrgfi 16076e7d3316Smrg 16089f00f3a1Smrg 160919569120SmrgAC_SUBST([APP_MAN_SUFFIX]) 161019569120SmrgAC_SUBST([LIB_MAN_SUFFIX]) 161119569120SmrgAC_SUBST([FILE_MAN_SUFFIX]) 161219569120SmrgAC_SUBST([MISC_MAN_SUFFIX]) 161319569120SmrgAC_SUBST([DRIVER_MAN_SUFFIX]) 161419569120SmrgAC_SUBST([ADMIN_MAN_SUFFIX]) 161519569120SmrgAC_SUBST([APP_MAN_DIR]) 161619569120SmrgAC_SUBST([LIB_MAN_DIR]) 161719569120SmrgAC_SUBST([FILE_MAN_DIR]) 161819569120SmrgAC_SUBST([MISC_MAN_DIR]) 161919569120SmrgAC_SUBST([DRIVER_MAN_DIR]) 162019569120SmrgAC_SUBST([ADMIN_MAN_DIR]) 16216e7d3316Smrg 162219569120SmrgXORG_MAN_PAGE="X Version 11" 162319569120SmrgAC_SUBST([XORG_MAN_PAGE]) 162419569120SmrgMAN_SUBSTS="\ 162519569120Smrg -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ 162619569120Smrg -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ 162719569120Smrg -e 's|__xservername__|Xorg|g' \ 162819569120Smrg -e 's|__xconfigfile__|xorg.conf|g' \ 162919569120Smrg -e 's|__projectroot__|\$(prefix)|g' \ 163019569120Smrg -e 's|__apploaddir__|\$(appdefaultdir)|g' \ 163119569120Smrg -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \ 163219569120Smrg -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \ 163319569120Smrg -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \ 163419569120Smrg -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \ 163519569120Smrg -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \ 163619569120Smrg -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'" 163719569120SmrgAC_SUBST([MAN_SUBSTS]) 16386e7d3316Smrg 163919569120Smrg]) # XORG_MANPAGE_SECTIONS 164019569120Smrg 164119569120Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION]) 164219569120Smrg# ------------------------ 164319569120Smrg# Minimum version: 1.7.0 16449f00f3a1Smrg# 164519569120Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent 164619569120Smrg# provided by xorg-sgml-doctools, if installed. 164719569120SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[ 164819569120SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])]) 164919569120SmrgXORG_SGML_PATH= 165019569120SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])], 165119569120Smrg [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`], 165219569120Smrg [m4_ifval([$1],[:], 165319569120Smrg [if test x"$cross_compiling" != x"yes" ; then 165419569120Smrg AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent], 165519569120Smrg [XORG_SGML_PATH=$prefix/share/sgml]) 165619569120Smrg fi]) 165719569120Smrg ]) 16586e7d3316Smrg 165919569120Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing 166019569120Smrg# the path and the name of the doc stylesheet 166119569120Smrgif test "x$XORG_SGML_PATH" != "x" ; then 166219569120Smrg AC_MSG_RESULT([$XORG_SGML_PATH]) 166319569120Smrg STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11 166419569120Smrg XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl 166519569120Smrgelse 166619569120Smrg AC_MSG_RESULT([no]) 166719569120Smrgfi 16686e7d3316Smrg 166919569120SmrgAC_SUBST(XORG_SGML_PATH) 167019569120SmrgAC_SUBST(STYLESHEET_SRCDIR) 167119569120SmrgAC_SUBST(XSL_STYLESHEET) 167219569120SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"]) 167319569120Smrg]) # XORG_CHECK_SGML_DOCTOOLS 16746e7d3316Smrg 167519569120Smrg# XORG_CHECK_LINUXDOC 167619569120Smrg# ------------------- 167719569120Smrg# Minimum version: 1.0.0 167819569120Smrg# 167919569120Smrg# Defines the variable MAKE_TEXT if the necessary tools and 168019569120Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. 168119569120Smrg# Whether or not the necessary tools and files are found can be checked 168219569120Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC" 168319569120SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[ 168419569120SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) 168519569120SmrgAC_REQUIRE([XORG_WITH_PS2PDF]) 16866e7d3316Smrg 168719569120SmrgAC_PATH_PROG(LINUXDOC, linuxdoc) 16886e7d3316Smrg 168919569120SmrgAC_MSG_CHECKING([whether to build documentation]) 169019569120Smrg 169119569120Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then 169219569120Smrg BUILDDOC=yes 169319569120Smrgelse 169419569120Smrg BUILDDOC=no 16959f00f3a1Smrgfi 16966e7d3316Smrg 169719569120SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) 16986e7d3316Smrg 169919569120SmrgAC_MSG_RESULT([$BUILDDOC]) 17006e7d3316Smrg 170119569120SmrgAC_MSG_CHECKING([whether to build pdf documentation]) 17026e7d3316Smrg 170319569120Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then 170419569120Smrg BUILDPDFDOC=yes 170519569120Smrgelse 170619569120Smrg BUILDPDFDOC=no 170719569120Smrgfi 17086e7d3316Smrg 170919569120SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 17106e7d3316Smrg 171119569120SmrgAC_MSG_RESULT([$BUILDPDFDOC]) 17126e7d3316Smrg 171319569120SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f" 171419569120SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps" 171519569120SmrgMAKE_PDF="$PS2PDF" 171619569120SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0" 17179f00f3a1Smrg 171819569120SmrgAC_SUBST(MAKE_TEXT) 171919569120SmrgAC_SUBST(MAKE_PS) 172019569120SmrgAC_SUBST(MAKE_PDF) 172119569120SmrgAC_SUBST(MAKE_HTML) 172219569120Smrg]) # XORG_CHECK_LINUXDOC 17236e7d3316Smrg 172419569120Smrg# XORG_CHECK_DOCBOOK 172519569120Smrg# ------------------- 172619569120Smrg# Minimum version: 1.0.0 172719569120Smrg# 172819569120Smrg# Checks for the ability to build output formats from SGML DocBook source. 172919569120Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC" 173019569120Smrg# indicates whether the necessary tools and files are found and, if set, 173119569120Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx. 173219569120SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[ 173319569120SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) 17346e7d3316Smrg 173519569120SmrgBUILDTXTDOC=no 173619569120SmrgBUILDPDFDOC=no 173719569120SmrgBUILDPSDOC=no 173819569120SmrgBUILDHTMLDOC=no 17396e7d3316Smrg 174019569120SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps) 174119569120SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf) 174219569120SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html) 174319569120SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt) 17446e7d3316Smrg 174519569120SmrgAC_MSG_CHECKING([whether to build text documentation]) 174619569120Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x && 174719569120Smrg test x$BUILD_TXTDOC != xno; then 174819569120Smrg BUILDTXTDOC=yes 174919569120Smrgfi 175019569120SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes]) 175119569120SmrgAC_MSG_RESULT([$BUILDTXTDOC]) 17526e7d3316Smrg 175319569120SmrgAC_MSG_CHECKING([whether to build PDF documentation]) 175419569120Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x && 175519569120Smrg test x$BUILD_PDFDOC != xno; then 175619569120Smrg BUILDPDFDOC=yes 175719569120Smrgfi 175819569120SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 175919569120SmrgAC_MSG_RESULT([$BUILDPDFDOC]) 17606e7d3316Smrg 176119569120SmrgAC_MSG_CHECKING([whether to build PostScript documentation]) 176219569120Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x && 176319569120Smrg test x$BUILD_PSDOC != xno; then 176419569120Smrg BUILDPSDOC=yes 176519569120Smrgfi 176619569120SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes]) 176719569120SmrgAC_MSG_RESULT([$BUILDPSDOC]) 17686e7d3316Smrg 176919569120SmrgAC_MSG_CHECKING([whether to build HTML documentation]) 177019569120Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x && 177119569120Smrg test x$BUILD_HTMLDOC != xno; then 177219569120Smrg BUILDHTMLDOC=yes 177397cf2ee2Smrgfi 177419569120SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes]) 177519569120SmrgAC_MSG_RESULT([$BUILDHTMLDOC]) 177619569120Smrg 177719569120SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT" 177819569120SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS" 177919569120SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF" 178019569120SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML" 17816e7d3316Smrg 178219569120SmrgAC_SUBST(MAKE_TEXT) 178319569120SmrgAC_SUBST(MAKE_PS) 178419569120SmrgAC_SUBST(MAKE_PDF) 178519569120SmrgAC_SUBST(MAKE_HTML) 178619569120Smrg]) # XORG_CHECK_DOCBOOK 1787a966c04fSmrg 178819569120Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT]) 178919569120Smrg# ---------------- 179019569120Smrg# Minimum version: 1.5.0 179119569120Smrg# Minimum version for optional DEFAULT argument: 1.11.0 17929f00f3a1Smrg# 179319569120Smrg# Documentation tools are not always available on all platforms and sometimes 179419569120Smrg# not at the appropriate level. This macro enables a module to test for the 179519569120Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 179619569120Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions 179719569120Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified, 179819569120Smrg# --with-xmlto assumes 'auto'. 17999f00f3a1Smrg# 180019569120Smrg# Interface to module: 180119569120Smrg# HAVE_XMLTO: used in makefiles to conditionally generate documentation 180219569120Smrg# XMLTO: returns the path of the xmlto program found 180319569120Smrg# returns the path set by the user in the environment 180419569120Smrg# --with-xmlto: 'yes' user instructs the module to use xmlto 180519569120Smrg# 'no' user instructs the module not to use xmlto 18069f00f3a1Smrg# 180719569120Smrg# Added in version 1.10.0 180819569120Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation 180919569120Smrg# xmlto for text output requires either lynx, links, or w3m browsers 18109f00f3a1Smrg# 181119569120Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path. 18129f00f3a1Smrg# 181319569120SmrgAC_DEFUN([XORG_WITH_XMLTO],[ 181419569120SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command]) 181519569120Smrgm4_define([_defopt], m4_default([$2], [auto])) 181619569120SmrgAC_ARG_WITH(xmlto, 181719569120Smrg AS_HELP_STRING([--with-xmlto], 181819569120Smrg [Use xmlto to regenerate documentation (default: ]_defopt[)]), 181919569120Smrg [use_xmlto=$withval], [use_xmlto=]_defopt) 182019569120Smrgm4_undefine([_defopt]) 1821a966c04fSmrg 182219569120Smrgif test "x$use_xmlto" = x"auto"; then 182319569120Smrg AC_PATH_PROG([XMLTO], [xmlto]) 182419569120Smrg if test "x$XMLTO" = "x"; then 182519569120Smrg AC_MSG_WARN([xmlto not found - documentation targets will be skipped]) 182619569120Smrg have_xmlto=no 182719569120Smrg else 182819569120Smrg have_xmlto=yes 182919569120Smrg fi 183019569120Smrgelif test "x$use_xmlto" = x"yes" ; then 183119569120Smrg AC_PATH_PROG([XMLTO], [xmlto]) 183219569120Smrg if test "x$XMLTO" = "x"; then 183319569120Smrg AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH]) 183419569120Smrg fi 183519569120Smrg have_xmlto=yes 183619569120Smrgelif test "x$use_xmlto" = x"no" ; then 183719569120Smrg if test "x$XMLTO" != "x"; then 183819569120Smrg AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified]) 183919569120Smrg fi 184019569120Smrg have_xmlto=no 184119569120Smrgelse 184219569120Smrg AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no']) 184319569120Smrgfi 1844a966c04fSmrg 184519569120Smrg# Test for a minimum version of xmlto, if provided. 184619569120Smrgm4_ifval([$1], 184719569120Smrg[if test "$have_xmlto" = yes; then 184819569120Smrg # scrape the xmlto version 184919569120Smrg AC_MSG_CHECKING([the xmlto version]) 185019569120Smrg xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3` 185119569120Smrg AC_MSG_RESULT([$xmlto_version]) 185219569120Smrg AS_VERSION_COMPARE([$xmlto_version], [$1], 185319569120Smrg [if test "x$use_xmlto" = xauto; then 185419569120Smrg AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed]) 185519569120Smrg have_xmlto=no 185619569120Smrg else 185719569120Smrg AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed]) 185819569120Smrg fi]) 185919569120Smrgfi]) 18606e7d3316Smrg 186119569120Smrg# Test for the ability of xmlto to generate a text target 186219569120Smrg# 186319569120Smrg# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the 186419569120Smrg# following test for empty XML docbook files. 186519569120Smrg# For compatibility reasons use the following empty XML docbook file and if 186619569120Smrg# it fails try it again with a non-empty XML file. 186719569120Smrghave_xmlto_text=no 186819569120Smrgcat > conftest.xml << "EOF" 186919569120SmrgEOF 187019569120SmrgAS_IF([test "$have_xmlto" = yes], 187119569120Smrg [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1], 187219569120Smrg [have_xmlto_text=yes], 187319569120Smrg [# Try it again with a non-empty XML file. 187419569120Smrg cat > conftest.xml << "EOF" 187519569120Smrg<x></x> 187619569120SmrgEOF 187719569120Smrg AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1], 187819569120Smrg [have_xmlto_text=yes], 187919569120Smrg [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])]) 188019569120Smrgrm -f conftest.xml 188119569120SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes]) 188219569120SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes]) 188319569120Smrg]) # XORG_WITH_XMLTO 1884a966c04fSmrg 188519569120Smrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT]) 188619569120Smrg# -------------------------------------------- 188719569120Smrg# Minimum version: 1.12.0 188819569120Smrg# Minimum version for optional DEFAULT argument: 1.12.0 18899f00f3a1Smrg# 189019569120Smrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative, 189119569120Smrg# XML-based language used for the transformation of XML documents. 189219569120Smrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents. 189319569120Smrg# It is used under the cover by xmlto to generate html files from DocBook/XML. 189419569120Smrg# The XSLT processor is often used as a standalone tool for transformations. 189519569120Smrg# It should not be assumed that this tool is used only to work with documnetation. 189619569120Smrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'. 18979f00f3a1Smrg# 189819569120Smrg# Interface to module: 189919569120Smrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation 190019569120Smrg# XSLTPROC: returns the path of the xsltproc program found 190119569120Smrg# returns the path set by the user in the environment 190219569120Smrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc 190319569120Smrg# 'no' user instructs the module not to use xsltproc 190419569120Smrg# have_xsltproc: returns yes if xsltproc found in PATH or no 19059f00f3a1Smrg# 190619569120Smrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path. 19079f00f3a1Smrg# 190819569120SmrgAC_DEFUN([XORG_WITH_XSLTPROC],[ 190919569120SmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command]) 191019569120Smrg# Preserves the interface, should it be implemented later 191119569120Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])]) 191219569120Smrgm4_define([_defopt], m4_default([$2], [auto])) 191319569120SmrgAC_ARG_WITH(xsltproc, 191419569120Smrg AS_HELP_STRING([--with-xsltproc], 191519569120Smrg [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]), 191619569120Smrg [use_xsltproc=$withval], [use_xsltproc=]_defopt) 191719569120Smrgm4_undefine([_defopt]) 1918a966c04fSmrg 191919569120Smrgif test "x$use_xsltproc" = x"auto"; then 192019569120Smrg AC_PATH_PROG([XSLTPROC], [xsltproc]) 192119569120Smrg if test "x$XSLTPROC" = "x"; then 192219569120Smrg AC_MSG_WARN([xsltproc not found - cannot transform XML documents]) 192319569120Smrg have_xsltproc=no 192419569120Smrg else 192519569120Smrg have_xsltproc=yes 192619569120Smrg fi 192719569120Smrgelif test "x$use_xsltproc" = x"yes" ; then 192819569120Smrg AC_PATH_PROG([XSLTPROC], [xsltproc]) 192919569120Smrg if test "x$XSLTPROC" = "x"; then 193019569120Smrg AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH]) 193119569120Smrg fi 193219569120Smrg have_xsltproc=yes 193319569120Smrgelif test "x$use_xsltproc" = x"no" ; then 193419569120Smrg if test "x$XSLTPROC" != "x"; then 193519569120Smrg AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified]) 193619569120Smrg fi 193719569120Smrg have_xsltproc=no 193819569120Smrgelse 193919569120Smrg AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no']) 194019569120Smrgfi 1941edce3322Smrg 194219569120SmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes]) 194319569120Smrg]) # XORG_WITH_XSLTPROC 19446e7d3316Smrg 194519569120Smrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT]) 194619569120Smrg# ---------------------------------------- 194719569120Smrg# Minimum version: 1.15.0 19489f00f3a1Smrg# 194919569120Smrg# PERL (Practical Extraction and Report Language) is a language optimized for 195019569120Smrg# scanning arbitrary text files, extracting information from those text files, 195119569120Smrg# and printing reports based on that information. 19529f00f3a1Smrg# 195319569120Smrg# When DEFAULT is not specified, --with-perl assumes 'auto'. 19549f00f3a1Smrg# 195519569120Smrg# Interface to module: 195619569120Smrg# HAVE_PERL: used in makefiles to conditionally scan text files 195719569120Smrg# PERL: returns the path of the perl program found 195819569120Smrg# returns the path set by the user in the environment 195919569120Smrg# --with-perl: 'yes' user instructs the module to use perl 196019569120Smrg# 'no' user instructs the module not to use perl 196119569120Smrg# have_perl: returns yes if perl found in PATH or no 19629f00f3a1Smrg# 196319569120Smrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path. 196419569120Smrg# 196519569120SmrgAC_DEFUN([XORG_WITH_PERL],[ 196619569120SmrgAC_ARG_VAR([PERL], [Path to perl command]) 196719569120Smrg# Preserves the interface, should it be implemented later 196819569120Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])]) 196919569120Smrgm4_define([_defopt], m4_default([$2], [auto])) 197019569120SmrgAC_ARG_WITH(perl, 197119569120Smrg AS_HELP_STRING([--with-perl], 197219569120Smrg [Use perl for extracting information from files (default: ]_defopt[)]), 197319569120Smrg [use_perl=$withval], [use_perl=]_defopt) 197419569120Smrgm4_undefine([_defopt]) 1975a966c04fSmrg 197619569120Smrgif test "x$use_perl" = x"auto"; then 197719569120Smrg AC_PATH_PROG([PERL], [perl]) 197819569120Smrg if test "x$PERL" = "x"; then 197919569120Smrg AC_MSG_WARN([perl not found - cannot extract information and report]) 198019569120Smrg have_perl=no 198119569120Smrg else 198219569120Smrg have_perl=yes 198319569120Smrg fi 198419569120Smrgelif test "x$use_perl" = x"yes" ; then 198519569120Smrg AC_PATH_PROG([PERL], [perl]) 198619569120Smrg if test "x$PERL" = "x"; then 198719569120Smrg AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH]) 198819569120Smrg fi 198919569120Smrg have_perl=yes 199019569120Smrgelif test "x$use_perl" = x"no" ; then 199119569120Smrg if test "x$PERL" != "x"; then 199219569120Smrg AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified]) 199319569120Smrg fi 199419569120Smrg have_perl=no 199519569120Smrgelse 199619569120Smrg AC_MSG_ERROR([--with-perl expects 'yes' or 'no']) 199719569120Smrgfi 1998a966c04fSmrg 199919569120SmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes]) 200019569120Smrg]) # XORG_WITH_PERL 2001a966c04fSmrg 200219569120Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT]) 200319569120Smrg# ---------------- 200419569120Smrg# Minimum version: 1.5.0 200519569120Smrg# Minimum version for optional DEFAULT argument: 1.11.0 20069f00f3a1Smrg# 200719569120Smrg# Documentation tools are not always available on all platforms and sometimes 200819569120Smrg# not at the appropriate level. This macro enables a module to test for the 200919569120Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 201019569120Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions 201119569120Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified, 201219569120Smrg# --with-asciidoc assumes 'auto'. 20139f00f3a1Smrg# 201419569120Smrg# Interface to module: 201519569120Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation 201619569120Smrg# ASCIIDOC: returns the path of the asciidoc program found 201719569120Smrg# returns the path set by the user in the environment 201819569120Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc 201919569120Smrg# 'no' user instructs the module not to use asciidoc 20209f00f3a1Smrg# 202119569120Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path. 20229f00f3a1Smrg# 202319569120SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[ 202419569120SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command]) 202519569120Smrgm4_define([_defopt], m4_default([$2], [auto])) 202619569120SmrgAC_ARG_WITH(asciidoc, 202719569120Smrg AS_HELP_STRING([--with-asciidoc], 202819569120Smrg [Use asciidoc to regenerate documentation (default: ]_defopt[)]), 202919569120Smrg [use_asciidoc=$withval], [use_asciidoc=]_defopt) 203019569120Smrgm4_undefine([_defopt]) 2031a966c04fSmrg 203219569120Smrgif test "x$use_asciidoc" = x"auto"; then 203319569120Smrg AC_PATH_PROG([ASCIIDOC], [asciidoc]) 203419569120Smrg if test "x$ASCIIDOC" = "x"; then 203519569120Smrg AC_MSG_WARN([asciidoc not found - documentation targets will be skipped]) 203619569120Smrg have_asciidoc=no 203719569120Smrg else 203819569120Smrg have_asciidoc=yes 203919569120Smrg fi 204019569120Smrgelif test "x$use_asciidoc" = x"yes" ; then 204119569120Smrg AC_PATH_PROG([ASCIIDOC], [asciidoc]) 204219569120Smrg if test "x$ASCIIDOC" = "x"; then 204319569120Smrg AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH]) 204419569120Smrg fi 204519569120Smrg have_asciidoc=yes 204619569120Smrgelif test "x$use_asciidoc" = x"no" ; then 204719569120Smrg if test "x$ASCIIDOC" != "x"; then 204819569120Smrg AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified]) 204919569120Smrg fi 205019569120Smrg have_asciidoc=no 205119569120Smrgelse 205219569120Smrg AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no']) 205319569120Smrgfi 205419569120Smrgm4_ifval([$1], 205519569120Smrg[if test "$have_asciidoc" = yes; then 205619569120Smrg # scrape the asciidoc version 205719569120Smrg AC_MSG_CHECKING([the asciidoc version]) 205819569120Smrg asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2` 205919569120Smrg AC_MSG_RESULT([$asciidoc_version]) 206019569120Smrg AS_VERSION_COMPARE([$asciidoc_version], [$1], 206119569120Smrg [if test "x$use_asciidoc" = xauto; then 206219569120Smrg AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed]) 206319569120Smrg have_asciidoc=no 206419569120Smrg else 206519569120Smrg AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed]) 206619569120Smrg fi]) 206719569120Smrgfi]) 206819569120SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes]) 206919569120Smrg]) # XORG_WITH_ASCIIDOC 2070a966c04fSmrg 207119569120Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT]) 207219569120Smrg# ------------------------------------------- 207319569120Smrg# Minimum version: 1.5.0 207419569120Smrg# Minimum version for optional DEFAULT argument: 1.11.0 207519569120Smrg# Minimum version for optional DOT checking: 1.18.0 207619569120Smrg# 207719569120Smrg# Documentation tools are not always available on all platforms and sometimes 207819569120Smrg# not at the appropriate level. This macro enables a module to test for the 207919569120Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 208019569120Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions 208119569120Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified, 208219569120Smrg# --with-doxygen assumes 'auto'. 208319569120Smrg# 208419569120Smrg# Interface to module: 208519569120Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation 208619569120Smrg# DOXYGEN: returns the path of the doxygen program found 208719569120Smrg# returns the path set by the user in the environment 208819569120Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen 208919569120Smrg# 'no' user instructs the module not to use doxygen 20909f00f3a1Smrg# 209119569120Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path. 209219569120Smrg# 209319569120SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[ 209419569120SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command]) 209519569120SmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility]) 209619569120Smrgm4_define([_defopt], m4_default([$2], [auto])) 209719569120SmrgAC_ARG_WITH(doxygen, 209819569120Smrg AS_HELP_STRING([--with-doxygen], 209919569120Smrg [Use doxygen to regenerate documentation (default: ]_defopt[)]), 210019569120Smrg [use_doxygen=$withval], [use_doxygen=]_defopt) 210119569120Smrgm4_undefine([_defopt]) 2102a966c04fSmrg 210319569120Smrgif test "x$use_doxygen" = x"auto"; then 210419569120Smrg AC_PATH_PROG([DOXYGEN], [doxygen]) 210519569120Smrg if test "x$DOXYGEN" = "x"; then 210619569120Smrg AC_MSG_WARN([doxygen not found - documentation targets will be skipped]) 210719569120Smrg have_doxygen=no 210819569120Smrg else 210919569120Smrg have_doxygen=yes 211019569120Smrg fi 211119569120Smrgelif test "x$use_doxygen" = x"yes" ; then 211219569120Smrg AC_PATH_PROG([DOXYGEN], [doxygen]) 211319569120Smrg if test "x$DOXYGEN" = "x"; then 211419569120Smrg AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH]) 211519569120Smrg fi 211619569120Smrg have_doxygen=yes 211719569120Smrgelif test "x$use_doxygen" = x"no" ; then 211819569120Smrg if test "x$DOXYGEN" != "x"; then 211919569120Smrg AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified]) 212019569120Smrg fi 212119569120Smrg have_doxygen=no 21229f00f3a1Smrgelse 212319569120Smrg AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no']) 21249f00f3a1Smrgfi 212519569120Smrgm4_ifval([$1], 212619569120Smrg[if test "$have_doxygen" = yes; then 212719569120Smrg # scrape the doxygen version 212819569120Smrg AC_MSG_CHECKING([the doxygen version]) 212919569120Smrg doxygen_version=`$DOXYGEN --version 2>/dev/null` 213019569120Smrg AC_MSG_RESULT([$doxygen_version]) 213119569120Smrg AS_VERSION_COMPARE([$doxygen_version], [$1], 213219569120Smrg [if test "x$use_doxygen" = xauto; then 213319569120Smrg AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed]) 213419569120Smrg have_doxygen=no 213519569120Smrg else 213619569120Smrg AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed]) 213719569120Smrg fi]) 213819569120Smrgfi]) 2139a966c04fSmrg 214019569120Smrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory 214119569120Smrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file: 214219569120Smrgdnl HAVE_DOT = @HAVE_DOT@ 214319569120SmrgHAVE_DOT=no 214419569120Smrgif test "x$have_doxygen" = "xyes"; then 214519569120Smrg AC_PATH_PROG([DOT], [dot]) 214619569120Smrg if test "x$DOT" != "x"; then 214719569120Smrg HAVE_DOT=yes 214819569120Smrg fi 214919569120Smrgfi 2150a966c04fSmrg 215119569120SmrgAC_SUBST([HAVE_DOT]) 215219569120SmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"]) 215319569120SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes]) 215419569120Smrg]) # XORG_WITH_DOXYGEN 21556e7d3316Smrg 215619569120Smrg# XORG_WITH_GROFF([DEFAULT]) 215719569120Smrg# ---------------- 215819569120Smrg# Minimum version: 1.6.0 215919569120Smrg# Minimum version for optional DEFAULT argument: 1.11.0 21609f00f3a1Smrg# 216119569120Smrg# Documentation tools are not always available on all platforms and sometimes 216219569120Smrg# not at the appropriate level. This macro enables a module to test for the 216319569120Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 216419569120Smrg# the --with-groff option, it allows maximum flexibilty in making decisions 216519569120Smrg# as whether or not to use the groff package. When DEFAULT is not specified, 216619569120Smrg# --with-groff assumes 'auto'. 216719569120Smrg# 216819569120Smrg# Interface to module: 216919569120Smrg# HAVE_GROFF: used in makefiles to conditionally generate documentation 217019569120Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package 217119569120Smrg# HAVE_GROFF_MS: the -ms macros package 217219569120Smrg# GROFF: returns the path of the groff program found 217319569120Smrg# returns the path set by the user in the environment 217419569120Smrg# --with-groff: 'yes' user instructs the module to use groff 217519569120Smrg# 'no' user instructs the module not to use groff 217619569120Smrg# 217719569120Smrg# Added in version 1.9.0: 217819569120Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format: 217919569120Smrg# pnmcut pnmcrop pnmtopng pnmtops from the netpbm package. 218019569120Smrg# psselect from the psutils package. 218119569120Smrg# the ghostcript package. Refer to the grohtml man pages 218219569120Smrg# 218319569120Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path. 218419569120Smrg# 218519569120Smrg# OS and distros often splits groff in a basic and full package, the former 218619569120Smrg# having the groff program and the later having devices, fonts and macros 218719569120Smrg# Checking for the groff executable is not enough. 218819569120Smrg# 218919569120Smrg# If macros are missing, we cannot assume that groff is useless, so we don't 219019569120Smrg# unset HAVE_GROFF or GROFF env variables. 219119569120Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false. 219219569120Smrg# 219319569120SmrgAC_DEFUN([XORG_WITH_GROFF],[ 219419569120SmrgAC_ARG_VAR([GROFF], [Path to groff command]) 219519569120Smrgm4_define([_defopt], m4_default([$1], [auto])) 219619569120SmrgAC_ARG_WITH(groff, 219719569120Smrg AS_HELP_STRING([--with-groff], 219819569120Smrg [Use groff to regenerate documentation (default: ]_defopt[)]), 219919569120Smrg [use_groff=$withval], [use_groff=]_defopt) 220019569120Smrgm4_undefine([_defopt]) 22016e7d3316Smrg 220219569120Smrgif test "x$use_groff" = x"auto"; then 220319569120Smrg AC_PATH_PROG([GROFF], [groff]) 220419569120Smrg if test "x$GROFF" = "x"; then 220519569120Smrg AC_MSG_WARN([groff not found - documentation targets will be skipped]) 220619569120Smrg have_groff=no 220719569120Smrg else 220819569120Smrg have_groff=yes 220919569120Smrg fi 221019569120Smrgelif test "x$use_groff" = x"yes" ; then 221119569120Smrg AC_PATH_PROG([GROFF], [groff]) 221219569120Smrg if test "x$GROFF" = "x"; then 221319569120Smrg AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH]) 221419569120Smrg fi 221519569120Smrg have_groff=yes 221619569120Smrgelif test "x$use_groff" = x"no" ; then 221719569120Smrg if test "x$GROFF" != "x"; then 221819569120Smrg AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified]) 221919569120Smrg fi 222019569120Smrg have_groff=no 22216e7d3316Smrgelse 222219569120Smrg AC_MSG_ERROR([--with-groff expects 'yes' or 'no']) 22236e7d3316Smrgfi 222497cf2ee2Smrg 222519569120Smrg# We have groff, test for the presence of the macro packages 222619569120Smrgif test "x$have_groff" = x"yes"; then 222719569120Smrg AC_MSG_CHECKING([for ${GROFF} -ms macros]) 222819569120Smrg if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then 222919569120Smrg groff_ms_works=yes 223019569120Smrg else 223119569120Smrg groff_ms_works=no 223219569120Smrg fi 223319569120Smrg AC_MSG_RESULT([$groff_ms_works]) 223419569120Smrg AC_MSG_CHECKING([for ${GROFF} -mm macros]) 223519569120Smrg if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then 223619569120Smrg groff_mm_works=yes 223719569120Smrg else 223819569120Smrg groff_mm_works=no 223919569120Smrg fi 224019569120Smrg AC_MSG_RESULT([$groff_mm_works]) 224119569120Smrgfi 224297cf2ee2Smrg 224319569120Smrg# We have groff, test for HTML dependencies, one command per package 224419569120Smrgif test "x$have_groff" = x"yes"; then 224519569120Smrg AC_PATH_PROGS(GS_PATH, [gs gswin32c]) 224619569120Smrg AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng]) 224719569120Smrg AC_PATH_PROG(PSSELECT_PATH, [psselect]) 224819569120Smrg if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then 224919569120Smrg have_groff_html=yes 225019569120Smrg else 225119569120Smrg have_groff_html=no 225219569120Smrg AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages]) 225319569120Smrg fi 225419569120Smrgfi 225597cf2ee2Smrg 225619569120Smrg# Set Automake conditionals for Makefiles 225719569120SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes]) 225819569120SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes]) 225919569120SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes]) 226019569120SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes]) 226119569120Smrg]) # XORG_WITH_GROFF 2262a966c04fSmrg 226319569120Smrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT]) 226419569120Smrg# --------------------------------------- 226519569120Smrg# Minimum version: 1.6.0 226619569120Smrg# Minimum version for optional DEFAULT argument: 1.11.0 226719569120Smrg# Minimum version for optional MIN-VERSION argument: 1.15.0 226819569120Smrg# 226919569120Smrg# Documentation tools are not always available on all platforms and sometimes 227019569120Smrg# not at the appropriate level. This macro enables a module to test for the 227119569120Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 227219569120Smrg# the --with-fop option, it allows maximum flexibilty in making decisions 227319569120Smrg# as whether or not to use the fop package. When DEFAULT is not specified, 227419569120Smrg# --with-fop assumes 'auto'. 227519569120Smrg# 227619569120Smrg# Interface to module: 227719569120Smrg# HAVE_FOP: used in makefiles to conditionally generate documentation 227819569120Smrg# FOP: returns the path of the fop program found 227919569120Smrg# returns the path set by the user in the environment 228019569120Smrg# --with-fop: 'yes' user instructs the module to use fop 228119569120Smrg# 'no' user instructs the module not to use fop 228219569120Smrg# 228319569120Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path. 228419569120Smrg# 228519569120SmrgAC_DEFUN([XORG_WITH_FOP],[ 228619569120SmrgAC_ARG_VAR([FOP], [Path to fop command]) 228719569120Smrgm4_define([_defopt], m4_default([$2], [auto])) 228819569120SmrgAC_ARG_WITH(fop, 228919569120Smrg AS_HELP_STRING([--with-fop], 229019569120Smrg [Use fop to regenerate documentation (default: ]_defopt[)]), 229119569120Smrg [use_fop=$withval], [use_fop=]_defopt) 229219569120Smrgm4_undefine([_defopt]) 229319569120Smrg 229419569120Smrgif test "x$use_fop" = x"auto"; then 229519569120Smrg AC_PATH_PROG([FOP], [fop]) 229619569120Smrg if test "x$FOP" = "x"; then 229719569120Smrg AC_MSG_WARN([fop not found - documentation targets will be skipped]) 229819569120Smrg have_fop=no 229919569120Smrg else 230019569120Smrg have_fop=yes 230119569120Smrg fi 230219569120Smrgelif test "x$use_fop" = x"yes" ; then 230319569120Smrg AC_PATH_PROG([FOP], [fop]) 230419569120Smrg if test "x$FOP" = "x"; then 230519569120Smrg AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH]) 230619569120Smrg fi 230719569120Smrg have_fop=yes 230819569120Smrgelif test "x$use_fop" = x"no" ; then 230919569120Smrg if test "x$FOP" != "x"; then 231019569120Smrg AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified]) 231119569120Smrg fi 231219569120Smrg have_fop=no 231319569120Smrgelse 231419569120Smrg AC_MSG_ERROR([--with-fop expects 'yes' or 'no']) 23159f00f3a1Smrgfi 2316a966c04fSmrg 231719569120Smrg# Test for a minimum version of fop, if provided. 231819569120Smrgm4_ifval([$1], 231919569120Smrg[if test "$have_fop" = yes; then 232019569120Smrg # scrape the fop version 232119569120Smrg AC_MSG_CHECKING([for fop minimum version]) 232219569120Smrg fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3` 232319569120Smrg AC_MSG_RESULT([$fop_version]) 232419569120Smrg AS_VERSION_COMPARE([$fop_version], [$1], 232519569120Smrg [if test "x$use_fop" = xauto; then 232619569120Smrg AC_MSG_WARN([fop version $fop_version found, but $1 needed]) 232719569120Smrg have_fop=no 232819569120Smrg else 232919569120Smrg AC_MSG_ERROR([fop version $fop_version found, but $1 needed]) 233019569120Smrg fi]) 233119569120Smrgfi]) 233219569120SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes]) 233319569120Smrg]) # XORG_WITH_FOP 2334a966c04fSmrg 233519569120Smrg# XORG_WITH_M4([MIN-VERSION]) 233619569120Smrg# --------------------------- 233719569120Smrg# Minimum version: 1.19.0 2338ac92798bSmrg# 233919569120Smrg# This macro attempts to locate an m4 macro processor which supports 234019569120Smrg# -I option and is only useful for modules relying on M4 in order to 234119569120Smrg# expand macros in source code files. 234219569120Smrg# 234319569120Smrg# Interface to module: 234419569120Smrg# M4: returns the path of the m4 program found 234519569120Smrg# returns the path set by the user in the environment 234619569120Smrg# 234719569120SmrgAC_DEFUN([XORG_WITH_M4], [ 234819569120SmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4], 234919569120Smrg [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4], 235019569120Smrg [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \ 235119569120Smrg ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]], 235219569120Smrg [AC_MSG_ERROR([could not find m4 that supports -I option])], 235319569120Smrg [$PATH:/usr/gnu/bin])]) 2354ac92798bSmrg 235519569120SmrgAC_SUBST([M4], [$ac_cv_path_M4]) 235619569120Smrg]) # XORG_WITH_M4 235719569120Smrg 235819569120Smrg# XORG_WITH_PS2PDF([DEFAULT]) 235919569120Smrg# ---------------- 236019569120Smrg# Minimum version: 1.6.0 236119569120Smrg# Minimum version for optional DEFAULT argument: 1.11.0 236219569120Smrg# 236319569120Smrg# Documentation tools are not always available on all platforms and sometimes 236419569120Smrg# not at the appropriate level. This macro enables a module to test for the 236519569120Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 236619569120Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions 236719569120Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified, 236819569120Smrg# --with-ps2pdf assumes 'auto'. 236919569120Smrg# 237019569120Smrg# Interface to module: 237119569120Smrg# HAVE_PS2PDF: used in makefiles to conditionally generate documentation 237219569120Smrg# PS2PDF: returns the path of the ps2pdf program found 237319569120Smrg# returns the path set by the user in the environment 237419569120Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf 237519569120Smrg# 'no' user instructs the module not to use ps2pdf 237619569120Smrg# 237719569120Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path. 237819569120Smrg# 237919569120SmrgAC_DEFUN([XORG_WITH_PS2PDF],[ 238019569120SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command]) 238119569120Smrgm4_define([_defopt], m4_default([$1], [auto])) 238219569120SmrgAC_ARG_WITH(ps2pdf, 238319569120Smrg AS_HELP_STRING([--with-ps2pdf], 238419569120Smrg [Use ps2pdf to regenerate documentation (default: ]_defopt[)]), 238519569120Smrg [use_ps2pdf=$withval], [use_ps2pdf=]_defopt) 238619569120Smrgm4_undefine([_defopt]) 23879f00f3a1Smrg 238819569120Smrgif test "x$use_ps2pdf" = x"auto"; then 238919569120Smrg AC_PATH_PROG([PS2PDF], [ps2pdf]) 239019569120Smrg if test "x$PS2PDF" = "x"; then 239119569120Smrg AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped]) 239219569120Smrg have_ps2pdf=no 239319569120Smrg else 239419569120Smrg have_ps2pdf=yes 239519569120Smrg fi 239619569120Smrgelif test "x$use_ps2pdf" = x"yes" ; then 239719569120Smrg AC_PATH_PROG([PS2PDF], [ps2pdf]) 239819569120Smrg if test "x$PS2PDF" = "x"; then 239919569120Smrg AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH]) 240019569120Smrg fi 240119569120Smrg have_ps2pdf=yes 240219569120Smrgelif test "x$use_ps2pdf" = x"no" ; then 240319569120Smrg if test "x$PS2PDF" != "x"; then 240419569120Smrg AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified]) 240519569120Smrg fi 240619569120Smrg have_ps2pdf=no 240719569120Smrgelse 240819569120Smrg AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no']) 240919569120Smrgfi 241019569120SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes]) 241119569120Smrg]) # XORG_WITH_PS2PDF 24129f00f3a1Smrg 241319569120Smrg# XORG_ENABLE_DOCS (enable_docs=yes) 241419569120Smrg# ---------------- 241519569120Smrg# Minimum version: 1.6.0 2416ac92798bSmrg# 241719569120Smrg# Documentation tools are not always available on all platforms and sometimes 241819569120Smrg# not at the appropriate level. This macro enables a builder to skip all 241919569120Smrg# documentation targets except traditional man pages. 242019569120Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 242119569120Smrg# maximum flexibilty in controlling documentation building. 242219569120Smrg# Refer to: 242319569120Smrg# XORG_WITH_XMLTO --with-xmlto 242419569120Smrg# XORG_WITH_ASCIIDOC --with-asciidoc 242519569120Smrg# XORG_WITH_DOXYGEN --with-doxygen 242619569120Smrg# XORG_WITH_FOP --with-fop 242719569120Smrg# XORG_WITH_GROFF --with-groff 242819569120Smrg# XORG_WITH_PS2PDF --with-ps2pdf 242919569120Smrg# 243019569120Smrg# Interface to module: 243119569120Smrg# ENABLE_DOCS: used in makefiles to conditionally generate documentation 243219569120Smrg# --enable-docs: 'yes' user instructs the module to generate docs 243319569120Smrg# 'no' user instructs the module not to generate docs 243419569120Smrg# parm1: specify the default value, yes or no. 243519569120Smrg# 243619569120SmrgAC_DEFUN([XORG_ENABLE_DOCS],[ 243719569120Smrgm4_define([docs_default], m4_default([$1], [yes])) 243819569120SmrgAC_ARG_ENABLE(docs, 243919569120Smrg AS_HELP_STRING([--enable-docs], 244019569120Smrg [Enable building the documentation (default: ]docs_default[)]), 244119569120Smrg [build_docs=$enableval], [build_docs=]docs_default) 244219569120Smrgm4_undefine([docs_default]) 244319569120SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes]) 244419569120SmrgAC_MSG_CHECKING([whether to build documentation]) 244519569120SmrgAC_MSG_RESULT([$build_docs]) 244619569120Smrg]) # XORG_ENABLE_DOCS 24479f00f3a1Smrg 244819569120Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes) 244919569120Smrg# ---------------- 245019569120Smrg# Minimum version: 1.6.0 245119569120Smrg# 245219569120Smrg# This macro enables a builder to skip all developer documentation. 245319569120Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 245419569120Smrg# maximum flexibilty in controlling documentation building. 245519569120Smrg# Refer to: 245619569120Smrg# XORG_WITH_XMLTO --with-xmlto 245719569120Smrg# XORG_WITH_ASCIIDOC --with-asciidoc 245819569120Smrg# XORG_WITH_DOXYGEN --with-doxygen 245919569120Smrg# XORG_WITH_FOP --with-fop 246019569120Smrg# XORG_WITH_GROFF --with-groff 246119569120Smrg# XORG_WITH_PS2PDF --with-ps2pdf 246219569120Smrg# 246319569120Smrg# Interface to module: 246419569120Smrg# ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs 246519569120Smrg# --enable-devel-docs: 'yes' user instructs the module to generate developer docs 246619569120Smrg# 'no' user instructs the module not to generate developer docs 246719569120Smrg# parm1: specify the default value, yes or no. 246819569120Smrg# 246919569120SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[ 247019569120Smrgm4_define([devel_default], m4_default([$1], [yes])) 247119569120SmrgAC_ARG_ENABLE(devel-docs, 247219569120Smrg AS_HELP_STRING([--enable-devel-docs], 247319569120Smrg [Enable building the developer documentation (default: ]devel_default[)]), 247419569120Smrg [build_devel_docs=$enableval], [build_devel_docs=]devel_default) 247519569120Smrgm4_undefine([devel_default]) 247619569120SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes]) 247719569120SmrgAC_MSG_CHECKING([whether to build developer documentation]) 247819569120SmrgAC_MSG_RESULT([$build_devel_docs]) 247919569120Smrg]) # XORG_ENABLE_DEVEL_DOCS 24809f00f3a1Smrg 248119569120Smrg# XORG_ENABLE_SPECS (enable_specs=yes) 248219569120Smrg# ---------------- 248319569120Smrg# Minimum version: 1.6.0 248497cf2ee2Smrg# 248519569120Smrg# This macro enables a builder to skip all functional specification targets. 248619569120Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 248719569120Smrg# maximum flexibilty in controlling documentation building. 248819569120Smrg# Refer to: 248919569120Smrg# XORG_WITH_XMLTO --with-xmlto 249019569120Smrg# XORG_WITH_ASCIIDOC --with-asciidoc 249119569120Smrg# XORG_WITH_DOXYGEN --with-doxygen 249219569120Smrg# XORG_WITH_FOP --with-fop 249319569120Smrg# XORG_WITH_GROFF --with-groff 249419569120Smrg# XORG_WITH_PS2PDF --with-ps2pdf 249519569120Smrg# 249619569120Smrg# Interface to module: 249719569120Smrg# ENABLE_SPECS: used in makefiles to conditionally generate specs 249819569120Smrg# --enable-specs: 'yes' user instructs the module to generate specs 249919569120Smrg# 'no' user instructs the module not to generate specs 250019569120Smrg# parm1: specify the default value, yes or no. 250119569120Smrg# 250219569120SmrgAC_DEFUN([XORG_ENABLE_SPECS],[ 250319569120Smrgm4_define([spec_default], m4_default([$1], [yes])) 250419569120SmrgAC_ARG_ENABLE(specs, 250519569120Smrg AS_HELP_STRING([--enable-specs], 250619569120Smrg [Enable building the specs (default: ]spec_default[)]), 250719569120Smrg [build_specs=$enableval], [build_specs=]spec_default) 250819569120Smrgm4_undefine([spec_default]) 250919569120SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes]) 251019569120SmrgAC_MSG_CHECKING([whether to build functional specifications]) 251119569120SmrgAC_MSG_RESULT([$build_specs]) 251219569120Smrg]) # XORG_ENABLE_SPECS 2513a966c04fSmrg 251419569120Smrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto) 251519569120Smrg# ---------------------------------------------- 251619569120Smrg# Minimum version: 1.13.0 251719569120Smrg# 251819569120Smrg# This macro enables a builder to enable/disable unit testing 251919569120Smrg# It makes no assumption about the test cases implementation 252019569120Smrg# Test cases may or may not use Automake "Support for test suites" 252119569120Smrg# They may or may not use the software utility library GLib 252219569120Smrg# 252319569120Smrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL 252419569120Smrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib. 252519569120Smrg# The variable enable_unit_tests is used by other macros in this file. 252619569120Smrg# 252719569120Smrg# Interface to module: 252819569120Smrg# ENABLE_UNIT_TESTS: used in makefiles to conditionally build tests 252919569120Smrg# enable_unit_tests: used in configure.ac for additional configuration 253019569120Smrg# --enable-unit-tests: 'yes' user instructs the module to build tests 253119569120Smrg# 'no' user instructs the module not to build tests 253219569120Smrg# parm1: specify the default value, yes or no. 253319569120Smrg# 253419569120SmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[ 253519569120SmrgAC_BEFORE([$0], [XORG_WITH_GLIB]) 253619569120SmrgAC_BEFORE([$0], [XORG_LD_WRAP]) 253719569120SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS]) 253819569120Smrgm4_define([_defopt], m4_default([$1], [auto])) 253919569120SmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests], 254019569120Smrg [Enable building unit test cases (default: ]_defopt[)]), 254119569120Smrg [enable_unit_tests=$enableval], [enable_unit_tests=]_defopt) 254219569120Smrgm4_undefine([_defopt]) 254319569120SmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno]) 254419569120SmrgAC_MSG_CHECKING([whether to build unit test cases]) 254519569120SmrgAC_MSG_RESULT([$enable_unit_tests]) 254619569120Smrg]) # XORG_ENABLE_UNIT_TESTS 2547a966c04fSmrg 254819569120Smrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto) 254919569120Smrg# ------------------------------------------------------ 255019569120Smrg# Minimum version: 1.17.0 255119569120Smrg# 255219569120Smrg# This macro enables a builder to enable/disable integration testing 255319569120Smrg# It makes no assumption about the test cases' implementation 255419569120Smrg# Test cases may or may not use Automake "Support for test suites" 255519569120Smrg# 255619569120Smrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support 255719569120Smrg# usually requires less dependencies and may be built and run under less 255819569120Smrg# stringent environments than integration tests. 255919569120Smrg# 256019569120Smrg# Interface to module: 256119569120Smrg# ENABLE_INTEGRATION_TESTS: used in makefiles to conditionally build tests 256219569120Smrg# enable_integration_tests: used in configure.ac for additional configuration 256319569120Smrg# --enable-integration-tests: 'yes' user instructs the module to build tests 256419569120Smrg# 'no' user instructs the module not to build tests 256519569120Smrg# parm1: specify the default value, yes or no. 256619569120Smrg# 256719569120SmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[ 256819569120SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS]) 256919569120Smrgm4_define([_defopt], m4_default([$1], [auto])) 257019569120SmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests], 257119569120Smrg [Enable building integration test cases (default: ]_defopt[)]), 257219569120Smrg [enable_integration_tests=$enableval], 257319569120Smrg [enable_integration_tests=]_defopt) 257419569120Smrgm4_undefine([_defopt]) 257519569120SmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS], 257619569120Smrg [test "x$enable_integration_tests" != xno]) 257719569120SmrgAC_MSG_CHECKING([whether to build unit test cases]) 257819569120SmrgAC_MSG_RESULT([$enable_integration_tests]) 257919569120Smrg]) # XORG_ENABLE_INTEGRATION_TESTS 25809f00f3a1Smrg 258119569120Smrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT]) 258219569120Smrg# ---------------------------------------- 258319569120Smrg# Minimum version: 1.13.0 258419569120Smrg# 258519569120Smrg# GLib is a library which provides advanced data structures and functions. 258619569120Smrg# This macro enables a module to test for the presence of Glib. 258719569120Smrg# 258819569120Smrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing. 258919569120Smrg# Otherwise the value of $enable_unit_tests is blank. 259019569120Smrg# 259119569120Smrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit 259219569120Smrg# test support usually requires less dependencies and may be built and run under 259319569120Smrg# less stringent environments than integration tests. 259419569120Smrg# 259519569120Smrg# Interface to module: 259619569120Smrg# HAVE_GLIB: used in makefiles to conditionally build targets 259719569120Smrg# with_glib: used in configure.ac to know if GLib has been found 259819569120Smrg# --with-glib: 'yes' user instructs the module to use glib 259919569120Smrg# 'no' user instructs the module not to use glib 260019569120Smrg# 260119569120SmrgAC_DEFUN([XORG_WITH_GLIB],[ 260219569120SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG]) 260319569120Smrgm4_define([_defopt], m4_default([$2], [auto])) 260419569120SmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib], 260519569120Smrg [Use GLib library for unit testing (default: ]_defopt[)]), 260619569120Smrg [with_glib=$withval], [with_glib=]_defopt) 260719569120Smrgm4_undefine([_defopt]) 260819569120Smrg 260919569120Smrghave_glib=no 261019569120Smrg# Do not probe GLib if user explicitly disabled unit testing 261119569120Smrgif test "x$enable_unit_tests" != x"no"; then 261219569120Smrg # Do not probe GLib if user explicitly disabled it 261319569120Smrg if test "x$with_glib" != x"no"; then 261419569120Smrg m4_ifval( 261519569120Smrg [$1], 261619569120Smrg [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])], 261719569120Smrg [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])] 261819569120Smrg ) 261997cf2ee2Smrg fi 262097cf2ee2Smrgfi 2621a966c04fSmrg 262219569120Smrg# Not having GLib when unit testing has been explicitly requested is an error 262319569120Smrgif test "x$enable_unit_tests" = x"yes"; then 262419569120Smrg if test "x$have_glib" = x"no"; then 262519569120Smrg AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found]) 262697cf2ee2Smrg fi 262797cf2ee2Smrgfi 2628a966c04fSmrg 262919569120Smrg# Having unit testing disabled when GLib has been explicitly requested is an error 263019569120Smrgif test "x$enable_unit_tests" = x"no"; then 263119569120Smrg if test "x$with_glib" = x"yes"; then 263219569120Smrg AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found]) 263319569120Smrg fi 263419569120Smrgfi 2635a966c04fSmrg 263619569120Smrg# Not having GLib when it has been explicitly requested is an error 263719569120Smrgif test "x$with_glib" = x"yes"; then 263819569120Smrg if test "x$have_glib" = x"no"; then 263919569120Smrg AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found]) 264019569120Smrg fi 264119569120Smrgfi 2642a966c04fSmrg 264319569120SmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes]) 264419569120Smrg]) # XORG_WITH_GLIB 2645a966c04fSmrg 264619569120Smrg# XORG_LD_WRAP([required|optional]) 264719569120Smrg# --------------------------------- 264819569120Smrg# Minimum version: 1.13.0 264919569120Smrg# 265019569120Smrg# Check if linker supports -wrap, passed via compiler flags 265119569120Smrg# 265219569120Smrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing. 265319569120Smrg# Otherwise the value of $enable_unit_tests is blank. 265419569120Smrg# 265519569120Smrg# Argument added in 1.16.0 - default is "required", to match existing behavior 265619569120Smrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not 265719569120Smrg# available, an argument of "optional" allows use when some unit tests require 265819569120Smrg# ld -wrap and others do not. 265919569120Smrg# 266019569120SmrgAC_DEFUN([XORG_LD_WRAP],[ 266119569120SmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no], 266219569120Smrg [AC_LANG_PROGRAM([#include <stdlib.h> 266319569120Smrg void __wrap_exit(int status) { return; }], 266419569120Smrg [exit(0);])]) 266519569120Smrg# Not having ld wrap when unit testing has been explicitly requested is an error 266619569120Smrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then 266719569120Smrg if test "x$have_ld_wrap" = x"no"; then 266819569120Smrg AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available]) 266919569120Smrg fi 267019569120Smrgfi 267119569120SmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes]) 267219569120Smrg# 267319569120Smrg]) # XORG_LD_WRAP 26742e2dd055Smrg 267519569120Smrg# XORG_CHECK_LINKER_FLAGS 267619569120Smrg# ----------------------- 267719569120Smrg# SYNOPSIS 267819569120Smrg# 267919569120Smrg# XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE]) 268019569120Smrg# 268119569120Smrg# DESCRIPTION 268219569120Smrg# 268319569120Smrg# Check whether the given linker FLAGS work with the current language's 268419569120Smrg# linker, or whether they give an error. 268519569120Smrg# 268619569120Smrg# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on 268719569120Smrg# success/failure. 268819569120Smrg# 268919569120Smrg# PROGRAM-SOURCE is the program source to link with, if needed 269019569120Smrg# 269119569120Smrg# NOTE: Based on AX_CHECK_COMPILER_FLAGS. 269219569120Smrg# 269319569120Smrg# LICENSE 269419569120Smrg# 269519569120Smrg# Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org> 269619569120Smrg# Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu> 269719569120Smrg# Copyright (c) 2009 Matteo Frigo 269819569120Smrg# 269919569120Smrg# This program is free software: you can redistribute it and/or modify it 270019569120Smrg# under the terms of the GNU General Public License as published by the 270119569120Smrg# Free Software Foundation, either version 3 of the License, or (at your 270219569120Smrg# option) any later version. 270319569120Smrg# 270419569120Smrg# This program is distributed in the hope that it will be useful, but 270519569120Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of 270619569120Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 270719569120Smrg# Public License for more details. 270819569120Smrg# 270919569120Smrg# You should have received a copy of the GNU General Public License along 271019569120Smrg# with this program. If not, see <http://www.gnu.org/licenses/>. 271119569120Smrg# 271219569120Smrg# As a special exception, the respective Autoconf Macro's copyright owner 271319569120Smrg# gives unlimited permission to copy, distribute and modify the configure 271419569120Smrg# scripts that are the output of Autoconf when processing the Macro. You 271519569120Smrg# need not follow the terms of the GNU General Public License when using 271619569120Smrg# or distributing such scripts, even though portions of the text of the 271719569120Smrg# Macro appear in them. The GNU General Public License (GPL) does govern 271819569120Smrg# all other use of the material that constitutes the Autoconf Macro. 271919569120Smrg# 272019569120Smrg# This special exception to the GPL applies to versions of the Autoconf 272119569120Smrg# Macro released by the Autoconf Archive. When you make and distribute a 272219569120Smrg# modified version of the Autoconf Macro, you may extend this special 272319569120Smrg# exception to the GPL to apply to your modified version as well.# 272419569120SmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS], 272519569120Smrg[AC_MSG_CHECKING([whether the linker accepts $1]) 272619569120Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname: 272719569120SmrgAS_LITERAL_IF([$1], 272819569120Smrg [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [ 272919569120Smrg ax_save_FLAGS=$LDFLAGS 273019569120Smrg LDFLAGS="$1" 273119569120Smrg AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])], 273219569120Smrg AS_TR_SH(xorg_cv_linker_flags_[$1])=yes, 273319569120Smrg AS_TR_SH(xorg_cv_linker_flags_[$1])=no) 273419569120Smrg LDFLAGS=$ax_save_FLAGS])], 273519569120Smrg [ax_save_FLAGS=$LDFLAGS 273619569120Smrg LDFLAGS="$1" 273719569120Smrg AC_LINK_IFELSE([AC_LANG_PROGRAM()], 273819569120Smrg eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes, 273919569120Smrg eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no) 274019569120Smrg LDFLAGS=$ax_save_FLAGS]) 274119569120Smrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1]) 274219569120SmrgAC_MSG_RESULT($xorg_check_linker_flags) 274319569120Smrgif test "x$xorg_check_linker_flags" = xyes; then 274419569120Smrg m4_default([$2], :) 274519569120Smrgelse 274619569120Smrg m4_default([$3], :) 274719569120Smrgfi 274819569120Smrg]) # XORG_CHECK_LINKER_FLAGS 27492e2dd055Smrg 275019569120Smrg# XORG_MEMORY_CHECK_FLAGS 275119569120Smrg# ----------------------- 275219569120Smrg# Minimum version: 1.16.0 275319569120Smrg# 275419569120Smrg# This macro attempts to find appropriate memory checking functionality 275519569120Smrg# for various platforms which unit testing code may use to catch various 275619569120Smrg# forms of memory allocation and access errors in testing. 275719569120Smrg# 275819569120Smrg# Interface to module: 275919569120Smrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging 276019569120Smrg# Usually added to TESTS_ENVIRONMENT in Makefile.am 276119569120Smrg# 276219569120Smrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim. 276319569120Smrg# 276419569120SmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[ 27652e2dd055Smrg 276619569120SmrgAC_REQUIRE([AC_CANONICAL_HOST]) 276719569120SmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV], 276819569120Smrg [Environment variables to enable memory checking in tests]) 27692e2dd055Smrg 277019569120Smrg# Check for different types of support on different platforms 277119569120Smrgcase $host_os in 277219569120Smrg solaris*) 277319569120Smrg AC_CHECK_LIB([umem], [umem_alloc], 277419569120Smrg [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default']) 277519569120Smrg ;; 277619569120Smrg *-gnu*) # GNU libc - Value is used as a single byte bit pattern, 277719569120Smrg # both directly and inverted, so should not be 0 or 255. 277819569120Smrg malloc_debug_env='MALLOC_PERTURB_=15' 277919569120Smrg ;; 278019569120Smrg darwin*) 278119569120Smrg malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib' 278219569120Smrg ;; 278319569120Smrg *bsd*) 278419569120Smrg malloc_debug_env='MallocPreScribble=1 MallocScribble=1' 278519569120Smrg ;; 278619569120Smrgesac 2787a966c04fSmrg 278819569120Smrg# User supplied flags override default flags 278919569120Smrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then 279019569120Smrg malloc_debug_env="$XORG_MALLOC_DEBUG_ENV" 2791edce3322Smrgfi 27926e7d3316Smrg 279319569120SmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env]) 279419569120Smrg]) # XORG_WITH_LINT 27956e7d3316Smrg 279619569120Smrg# XORG_CHECK_MALLOC_ZERO 279719569120Smrg# ---------------------- 279819569120Smrg# Minimum version: 1.0.0 279997cf2ee2Smrg# 280019569120Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if 280119569120Smrg# malloc(0) returns NULL. Packages should add one of these cflags to 280219569120Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. 280319569120SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[ 280419569120SmrgAC_ARG_ENABLE(malloc0returnsnull, 280519569120Smrg AS_HELP_STRING([--enable-malloc0returnsnull], 280619569120Smrg [malloc(0) returns NULL (default: auto)]), 280719569120Smrg [MALLOC_ZERO_RETURNS_NULL=$enableval], 280819569120Smrg [MALLOC_ZERO_RETURNS_NULL=auto]) 28096e7d3316Smrg 281019569120SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL]) 281119569120Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then 281219569120SmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null], 281319569120Smrg [AC_RUN_IFELSE([AC_LANG_PROGRAM([ 281419569120Smrg#include <stdlib.h> 281519569120Smrg],[ 281619569120Smrg char *m0, *r0, *c0, *p; 281719569120Smrg m0 = malloc(0); 281819569120Smrg p = malloc(10); 281919569120Smrg r0 = realloc(p,0); 282019569120Smrg c0 = calloc(0,10); 282119569120Smrg exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1); 282219569120Smrg])], 282319569120Smrg [xorg_cv_malloc0_returns_null=yes], 282419569120Smrg [xorg_cv_malloc0_returns_null=no])]) 282519569120SmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null 28269f00f3a1Smrgfi 282719569120SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) 28286e7d3316Smrg 282919569120Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then 283019569120Smrg MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" 283119569120Smrg XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS 283219569120Smrg XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" 283397cf2ee2Smrgelse 283419569120Smrg MALLOC_ZERO_CFLAGS="" 283519569120Smrg XMALLOC_ZERO_CFLAGS="" 283619569120Smrg XTMALLOC_ZERO_CFLAGS="" 283797cf2ee2Smrgfi 28386e7d3316Smrg 283919569120SmrgAC_SUBST([MALLOC_ZERO_CFLAGS]) 284019569120SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS]) 284119569120SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS]) 284219569120Smrg]) # XORG_CHECK_MALLOC_ZERO 28436e7d3316Smrg 284419569120Smrg# XORG_WITH_LINT() 284519569120Smrg# ---------------- 284619569120Smrg# Minimum version: 1.1.0 284797cf2ee2Smrg# 284819569120Smrg# This macro enables the use of a tool that flags some suspicious and 284919569120Smrg# non-portable constructs (likely to be bugs) in C language source code. 285019569120Smrg# It will attempt to locate the tool and use appropriate options. 285119569120Smrg# There are various lint type tools on different platforms. 285297cf2ee2Smrg# 285319569120Smrg# Interface to module: 285419569120Smrg# LINT: returns the path to the tool found on the platform 285519569120Smrg# or the value set to LINT on the configure cmd line 285619569120Smrg# also an Automake conditional 285719569120Smrg# LINT_FLAGS: an Automake variable with appropriate flags 285819569120Smrg# 285919569120Smrg# --with-lint: 'yes' user instructs the module to use lint 286019569120Smrg# 'no' user instructs the module not to use lint (default) 286119569120Smrg# 286219569120Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path. 286319569120Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim. 286419569120Smrg# 286519569120SmrgAC_DEFUN([XORG_WITH_LINT],[ 2866a966c04fSmrg 286719569120SmrgAC_ARG_VAR([LINT], [Path to a lint-style command]) 286819569120SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command]) 286919569120SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint], 287019569120Smrg [Use a lint-style source code checker (default: disabled)])], 287119569120Smrg [use_lint=$withval], [use_lint=no]) 287297cf2ee2Smrg 287319569120Smrg# Obtain platform specific info like program name and options 287419569120Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris 287519569120Smrgcase $host_os in 287619569120Smrg *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*) 287719569120Smrg lint_name=splint 287819569120Smrg lint_options="-badflag" 287919569120Smrg ;; 288019569120Smrg *freebsd* | *netbsd*) 288119569120Smrg lint_name=lint 288219569120Smrg lint_options="-u -b" 288319569120Smrg ;; 288419569120Smrg *solaris*) 288519569120Smrg lint_name=lint 288619569120Smrg lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2" 288719569120Smrg ;; 288819569120Smrgesac 288919569120Smrg 289019569120Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user) 289119569120Smrgif test "x$use_lint" = x"yes" ; then 289219569120Smrg AC_PATH_PROG([LINT], [$lint_name]) 289319569120Smrg if test "x$LINT" = "x"; then 289419569120Smrg AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH]) 289519569120Smrg fi 289619569120Smrgelif test "x$use_lint" = x"no" ; then 289719569120Smrg if test "x$LINT" != "x"; then 289819569120Smrg AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified]) 289919569120Smrg fi 29009f00f3a1Smrgelse 290119569120Smrg AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.]) 290297cf2ee2Smrgfi 290397cf2ee2Smrg 290419569120Smrg# User supplied flags override default flags 290519569120Smrgif test "x$LINT_FLAGS" != "x"; then 290619569120Smrg lint_options=$LINT_FLAGS 290719569120Smrgfi 290897cf2ee2Smrg 290919569120SmrgAC_SUBST([LINT_FLAGS],[$lint_options]) 291019569120SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x]) 291197cf2ee2Smrg 291219569120Smrg]) # XORG_WITH_LINT 29132e2dd055Smrg 291419569120Smrg# XORG_LINT_LIBRARY(LIBNAME) 291519569120Smrg# -------------------------- 291619569120Smrg# Minimum version: 1.1.0 291797cf2ee2Smrg# 291819569120Smrg# Sets up flags for building lint libraries for checking programs that call 291919569120Smrg# functions in the library. 292019569120Smrg# 292119569120Smrg# Interface to module: 292219569120Smrg# LINTLIB - Automake variable with the name of lint library file to make 292319569120Smrg# MAKE_LINT_LIB - Automake conditional 292419569120Smrg# 292519569120Smrg# --enable-lint-library: - 'yes' user instructs the module to created a lint library 292619569120Smrg# - 'no' user instructs the module not to create a lint library (default) 292797cf2ee2Smrg 292819569120SmrgAC_DEFUN([XORG_LINT_LIBRARY],[ 292919569120SmrgAC_REQUIRE([XORG_WITH_LINT]) 293019569120SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library], 293119569120Smrg [Create lint library (default: disabled)])], 293219569120Smrg [make_lint_lib=$enableval], [make_lint_lib=no]) 293319569120Smrg 293419569120Smrgif test "x$make_lint_lib" = x"yes" ; then 293519569120Smrg LINTLIB=llib-l$1.ln 293619569120Smrg if test "x$LINT" = "x"; then 293719569120Smrg AC_MSG_ERROR([Cannot make lint library without --with-lint]) 293819569120Smrg fi 293919569120Smrgelif test "x$make_lint_lib" != x"no" ; then 294019569120Smrg AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.]) 294197cf2ee2Smrgfi 2942a966c04fSmrg 294319569120SmrgAC_SUBST(LINTLIB) 294419569120SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno]) 29459f00f3a1Smrg 294619569120Smrg]) # XORG_LINT_LIBRARY 29479f00f3a1Smrg 294819569120Smrg# XORG_COMPILER_BRAND 29499f00f3a1Smrg# ------------------- 295019569120Smrg# Minimum version: 1.14.0 29519f00f3a1Smrg# 295219569120Smrg# Checks for various brands of compilers and sets flags as appropriate: 295319569120Smrg# GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes" 295419569120Smrg# GNU g++ - relies on AC_PROG_CXX to set GXX to "yes" 295519569120Smrg# clang compiler - sets CLANGCC to "yes" 295619569120Smrg# Intel compiler - sets INTELCC to "yes" 295719569120Smrg# Sun/Oracle Solaris Studio cc - sets SUNCC to "yes" 295819569120Smrg# 295919569120SmrgAC_DEFUN([XORG_COMPILER_BRAND], [ 296019569120SmrgAC_LANG_CASE( 296119569120Smrg [C], [ 296219569120Smrg AC_REQUIRE([AC_PROG_CC_C99]) 296319569120Smrg ], 296419569120Smrg [C++], [ 296519569120Smrg AC_REQUIRE([AC_PROG_CXX]) 296619569120Smrg ] 296719569120Smrg) 296819569120SmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"]) 296919569120SmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"]) 297019569120SmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) 297119569120Smrg]) # XORG_COMPILER_BRAND 297297cf2ee2Smrg 297319569120Smrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...]) 29749f00f3a1Smrg# --------------- 297519569120Smrg# Minimum version: 1.16.0 297619569120Smrg# 297719569120Smrg# Test if the compiler works when passed the given flag as a command line argument. 297819569120Smrg# If it succeeds, the flag is appeneded to the given variable. If not, it tries the 297919569120Smrg# next flag in the list until there are no more options. 298019569120Smrg# 298119569120Smrg# Note that this does not guarantee that the compiler supports the flag as some 298219569120Smrg# compilers will simply ignore arguments that they do not understand, but we do 298319569120Smrg# attempt to weed out false positives by using -Werror=unknown-warning-option and 298419569120Smrg# -Werror=unused-command-line-argument 298519569120Smrg# 298619569120SmrgAC_DEFUN([XORG_TESTSET_CFLAG], [ 298719569120Smrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])]) 298819569120Smrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])]) 298997cf2ee2Smrg 299019569120SmrgAC_LANG_COMPILER_REQUIRE 299197cf2ee2Smrg 299219569120SmrgAC_LANG_CASE( 299319569120Smrg [C], [ 299419569120Smrg AC_REQUIRE([AC_PROG_CC_C99]) 299519569120Smrg define([PREFIX], [C]) 299619569120Smrg define([CACHE_PREFIX], [cc]) 299719569120Smrg define([COMPILER], [$CC]) 299819569120Smrg ], 299919569120Smrg [C++], [ 300019569120Smrg define([PREFIX], [CXX]) 300119569120Smrg define([CACHE_PREFIX], [cxx]) 300219569120Smrg define([COMPILER], [$CXX]) 300319569120Smrg ] 300419569120Smrg) 300519569120Smrg 300619569120Smrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]" 300719569120Smrg 300819569120Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then 300919569120Smrg PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option" 301019569120Smrg AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option], 301119569120Smrg [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option], 301219569120Smrg AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])], 301319569120Smrg [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes], 301419569120Smrg [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no])) 301519569120Smrg [xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option] 301619569120Smrg PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]" 301797cf2ee2Smrgfi 301819569120Smrg 301919569120Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then 302019569120Smrg if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then 302119569120Smrg PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option" 302219569120Smrg fi 302319569120Smrg PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument" 302419569120Smrg AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument], 302519569120Smrg [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument], 302619569120Smrg AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])], 302719569120Smrg [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes], 302819569120Smrg [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no])) 302919569120Smrg [xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument] 303019569120Smrg PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]" 30319f00f3a1Smrgfi 303219569120Smrg 303319569120Smrgfound="no" 303419569120Smrgm4_foreach([flag], m4_cdr($@), [ 303519569120Smrg if test $found = "no" ; then 303619569120Smrg if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then 303719569120Smrg PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option" 303819569120Smrg fi 303919569120Smrg 304019569120Smrg if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then 304119569120Smrg PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument" 304219569120Smrg fi 304319569120Smrg 304419569120Smrg PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag[" 304519569120Smrg 304619569120Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname 304719569120Smrg AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[]) 304819569120Smrg cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[]) 304919569120Smrg AC_CACHE_VAL($cacheid, 305019569120Smrg [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])], 305119569120Smrg [eval $cacheid=yes], 305219569120Smrg [eval $cacheid=no])]) 305319569120Smrg 305419569120Smrg PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]" 305519569120Smrg 305619569120Smrg eval supported=\$$cacheid 305719569120Smrg AC_MSG_RESULT([$supported]) 305819569120Smrg if test "$supported" = "yes" ; then 305919569120Smrg $1="$$1 ]flag[" 306019569120Smrg found="yes" 306119569120Smrg fi 306219569120Smrg fi 30639f00f3a1Smrg]) 306419569120Smrg]) # XORG_TESTSET_CFLAG 3065a966c04fSmrg 306619569120Smrg# XORG_COMPILER_FLAGS 306719569120Smrg# --------------- 306819569120Smrg# Minimum version: 1.16.0 306997cf2ee2Smrg# 307019569120Smrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line 307119569120Smrg# arguments supported by the selected compiler which do NOT alter the generated 307219569120Smrg# code. These arguments will cause the compiler to print various warnings 307319569120Smrg# during compilation AND turn a conservative set of warnings into errors. 307419569120Smrg# 307519569120Smrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in 307619569120Smrg# future versions of util-macros as options are added to new compilers. 307719569120Smrg# 307819569120SmrgAC_DEFUN([XORG_COMPILER_FLAGS], [ 307919569120SmrgAC_REQUIRE([XORG_COMPILER_BRAND]) 3080a966c04fSmrg 308119569120SmrgAC_ARG_ENABLE(selective-werror, 308219569120Smrg AS_HELP_STRING([--disable-selective-werror], 308319569120Smrg [Turn off selective compiler errors. (default: enabled)]), 308419569120Smrg [SELECTIVE_WERROR=$enableval], 308519569120Smrg [SELECTIVE_WERROR=yes]) 308619569120Smrg 308719569120SmrgAC_LANG_CASE( 308819569120Smrg [C], [ 308919569120Smrg define([PREFIX], [C]) 309019569120Smrg ], 309119569120Smrg [C++], [ 309219569120Smrg define([PREFIX], [CXX]) 309319569120Smrg ] 309419569120Smrg) 309519569120Smrg# -v is too short to test reliably with XORG_TESTSET_CFLAG 309619569120Smrgif test "x$SUNCC" = "xyes"; then 309719569120Smrg [BASE_]PREFIX[FLAGS]="-v" 30989f00f3a1Smrgelse 309919569120Smrg [BASE_]PREFIX[FLAGS]="" 31009f00f3a1Smrgfi 31019f00f3a1Smrg 310219569120Smrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS 310319569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall]) 310419569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith]) 310519569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations]) 310619569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat]) 31079f00f3a1Smrg 310819569120SmrgAC_LANG_CASE( 310919569120Smrg [C], [ 311019569120Smrg XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes]) 311119569120Smrg XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes]) 311219569120Smrg XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs]) 311319569120Smrg XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast]) 311419569120Smrg XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd]) 311519569120Smrg XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement]) 311619569120Smrg ] 311719569120Smrg) 31182e2dd055Smrg 311919569120Smrg# This chunk adds additional warnings that could catch undesired effects. 312019569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused]) 312119569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized]) 312219569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow]) 312319569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn]) 312419569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute]) 312519569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls]) 312619569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op]) 31272e2dd055Smrg 312819569120Smrg# These are currently disabled because they are noisy. They will be enabled 312919569120Smrg# in the future once the codebase is sufficiently modernized to silence 313019569120Smrg# them. For now, I don't want them to drown out the other warnings. 313119569120Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses]) 313219569120Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align]) 313319569120Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual]) 3134a966c04fSmrg 313519569120Smrg# Turn some warnings into errors, so we don't accidently get successful builds 313619569120Smrg# when there are problems that should be fixed. 3137a966c04fSmrg 313819569120Smrgif test "x$SELECTIVE_WERROR" = "xyes" ; then 313919569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED]) 314019569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull]) 314119569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self]) 314219569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main]) 314319569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces]) 314419569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point]) 314519569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT]) 314619569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs]) 314719569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds]) 314819569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings]) 314919569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address]) 315019569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION]) 315119569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION 315219569120Smrgelse 315319569120SmrgAC_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]) 315419569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit]) 315519569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull]) 315619569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self]) 315719569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain]) 315819569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces]) 315919569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point]) 316019569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type]) 316119569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs]) 316219569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds]) 316319569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings]) 316419569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress]) 316519569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast]) 316619569120SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast]) 316719569120Smrgfi 3168a966c04fSmrg 316919569120SmrgAC_SUBST([BASE_]PREFIX[FLAGS]) 317019569120Smrg]) # XORG_COMPILER_FLAGS 31716e7d3316Smrg 317219569120Smrg# XORG_CWARNFLAGS 317319569120Smrg# --------------- 317419569120Smrg# Minimum version: 1.2.0 317519569120Smrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead) 31766e7d3316Smrg# 317719569120Smrg# Defines CWARNFLAGS to enable C compiler warnings. 31786e7d3316Smrg# 317919569120Smrg# This function is deprecated because it defines -fno-strict-aliasing 318019569120Smrg# which alters the code generated by the compiler. If -fno-strict-aliasing 318119569120Smrg# is needed, then it should be added explicitly in the module when 318219569120Smrg# it is updated to use BASE_CFLAGS. 31836e7d3316Smrg# 318419569120SmrgAC_DEFUN([XORG_CWARNFLAGS], [ 318519569120SmrgAC_REQUIRE([XORG_COMPILER_FLAGS]) 318619569120SmrgAC_REQUIRE([XORG_COMPILER_BRAND]) 318719569120SmrgAC_LANG_CASE( 318819569120Smrg [C], [ 318919569120Smrg CWARNFLAGS="$BASE_CFLAGS" 319019569120Smrg if test "x$GCC" = xyes ; then 319119569120Smrg CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing" 319219569120Smrg fi 319319569120Smrg AC_SUBST(CWARNFLAGS) 319419569120Smrg ] 319519569120Smrg) 319619569120Smrg]) # XORG_CWARNFLAGS 3197ac92798bSmrg 319819569120Smrg# XORG_STRICT_OPTION 319919569120Smrg# ----------------------- 320019569120Smrg# Minimum version: 1.3.0 320119569120Smrg# 320219569120Smrg# Add configure option to enable strict compilation flags, such as treating 320319569120Smrg# warnings as fatal errors. 320419569120Smrg# If --enable-strict-compilation is passed to configure, adds strict flags to 320519569120Smrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS. 320619569120Smrg# 320719569120Smrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or 320819569120Smrg# when strict compilation is unconditionally desired. 320919569120SmrgAC_DEFUN([XORG_STRICT_OPTION], [ 321019569120SmrgAC_REQUIRE([XORG_CWARNFLAGS]) 321119569120SmrgAC_REQUIRE([XORG_COMPILER_FLAGS]) 32126e7d3316Smrg 321319569120SmrgAC_ARG_ENABLE(strict-compilation, 321419569120Smrg AS_HELP_STRING([--enable-strict-compilation], 321519569120Smrg [Enable all warnings from compiler and make them errors (default: disabled)]), 321619569120Smrg [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no]) 32179f00f3a1Smrg 321819569120SmrgAC_LANG_CASE( 321919569120Smrg [C], [ 322019569120Smrg define([PREFIX], [C]) 322119569120Smrg ], 322219569120Smrg [C++], [ 322319569120Smrg define([PREFIX], [CXX]) 322419569120Smrg ] 322519569120Smrg) 32269f00f3a1Smrg 322719569120Smrg[STRICT_]PREFIX[FLAGS]="" 322819569120SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic]) 322919569120SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn]) 32309f00f3a1Smrg 323119569120Smrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not 323219569120Smrg# activate it with -Werror, so we add it here explicitly. 323319569120SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes]) 32349f00f3a1Smrg 323519569120Smrgif test "x$STRICT_COMPILE" = "xyes"; then 323619569120Smrg [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]" 323719569120Smrg AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"]) 323819569120Smrgfi 323919569120SmrgAC_SUBST([STRICT_]PREFIX[FLAGS]) 324019569120SmrgAC_SUBST([BASE_]PREFIX[FLAGS]) 324119569120SmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS])) 324219569120Smrg]) # XORG_STRICT_OPTION 32439f00f3a1Smrg 324419569120Smrg# XORG_DEFAULT_OPTIONS 324519569120Smrg# -------------------- 324619569120Smrg# Minimum version: 1.3.0 324719569120Smrg# 324819569120Smrg# Defines default options for X.Org modules. 324919569120Smrg# 325019569120SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [ 325119569120SmrgAC_REQUIRE([AC_PROG_INSTALL]) 325219569120SmrgXORG_COMPILER_FLAGS 325319569120SmrgXORG_CWARNFLAGS 325419569120SmrgXORG_STRICT_OPTION 325519569120SmrgXORG_RELEASE_VERSION 325619569120SmrgXORG_CHANGELOG 325719569120SmrgXORG_INSTALL 325819569120SmrgXORG_MANPAGE_SECTIONS 325919569120Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], 326019569120Smrg [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) 326119569120Smrg]) # XORG_DEFAULT_OPTIONS 32629f00f3a1Smrg 326319569120Smrg# XORG_INSTALL() 326419569120Smrg# ---------------- 326519569120Smrg# Minimum version: 1.4.0 326619569120Smrg# 326719569120Smrg# Defines the variable INSTALL_CMD as the command to copy 326819569120Smrg# INSTALL from $prefix/share/util-macros. 326919569120Smrg# 327019569120SmrgAC_DEFUN([XORG_INSTALL], [ 327119569120SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG]) 327219569120Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` 327319569120SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ 327419569120Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ 327519569120Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; test -e \$(top_srcdir)/INSTALL || ( \ 327619569120Smrgtouch \$(top_srcdir)/INSTALL; \ 327719569120Smrgecho 'failed to copy INSTALL from util-macros: installing empty INSTALL.' >&2))" 327819569120SmrgAC_SUBST([INSTALL_CMD]) 327919569120Smrg]) # XORG_INSTALL 328019569120Smrgdnl Copyright 2005 Red Hat, Inc 328119569120Smrgdnl 328219569120Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its 328319569120Smrgdnl documentation for any purpose is hereby granted without fee, provided that 328419569120Smrgdnl the above copyright notice appear in all copies and that both that 328519569120Smrgdnl copyright notice and this permission notice appear in supporting 328619569120Smrgdnl documentation. 328719569120Smrgdnl 328819569120Smrgdnl The above copyright notice and this permission notice shall be included 328919569120Smrgdnl in all copies or substantial portions of the Software. 329019569120Smrgdnl 329119569120Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 329219569120Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 329319569120Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 329419569120Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 329519569120Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 329619569120Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 329719569120Smrgdnl OTHER DEALINGS IN THE SOFTWARE. 329819569120Smrgdnl 329919569120Smrgdnl Except as contained in this notice, the name of the copyright holders shall 330019569120Smrgdnl not be used in advertising or otherwise to promote the sale, use or 330119569120Smrgdnl other dealings in this Software without prior written authorization 330219569120Smrgdnl from the copyright holders. 330319569120Smrgdnl 33049f00f3a1Smrg 330519569120Smrg# XORG_RELEASE_VERSION 330619569120Smrg# -------------------- 330719569120Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use. 3308a966c04fSmrg 330919569120SmrgAC_DEFUN([XORG_RELEASE_VERSION],[ 331019569120Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR], 331119569120Smrg [`echo $PACKAGE_VERSION | cut -d . -f 1`], 331219569120Smrg [Major version of this package]) 331319569120Smrg PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` 331419569120Smrg if test "x$PVM" = "x"; then 331519569120Smrg PVM="0" 331619569120Smrg fi 331719569120Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR], 331819569120Smrg [$PVM], 331919569120Smrg [Minor version of this package]) 332019569120Smrg PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` 332119569120Smrg if test "x$PVP" = "x"; then 332219569120Smrg PVP="0" 332319569120Smrg fi 332419569120Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL], 332519569120Smrg [$PVP], 332619569120Smrg [Patch version of this package]) 332719569120Smrg]) 33289f00f3a1Smrg 332919569120Smrg# XORG_CHANGELOG() 333019569120Smrg# ---------------- 333119569120Smrg# Minimum version: 1.2.0 333219569120Smrg# 333319569120Smrg# Defines the variable CHANGELOG_CMD as the command to generate 333419569120Smrg# ChangeLog from git. 333519569120Smrg# 333619569120Smrg# 333719569120SmrgAC_DEFUN([XORG_CHANGELOG], [ 333819569120SmrgCHANGELOG_CMD="((GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp) 2>/dev/null && \ 333919569120Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ 334019569120Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; test -e \$(top_srcdir)/ChangeLog || ( \ 334119569120Smrgtouch \$(top_srcdir)/ChangeLog; \ 334219569120Smrgecho 'git failed to create ChangeLog: installing empty ChangeLog.' >&2))" 334319569120SmrgAC_SUBST([CHANGELOG_CMD]) 334419569120Smrg]) # XORG_CHANGELOG 33459f00f3a1Smrg 33469f00f3a1Smrgm4_include([m4/ax_define_dir.m4]) 33479f00f3a1Smrgm4_include([m4/libtool.m4]) 33489f00f3a1Smrgm4_include([m4/ltoptions.m4]) 33499f00f3a1Smrgm4_include([m4/ltsugar.m4]) 33509f00f3a1Smrgm4_include([m4/ltversion.m4]) 33519f00f3a1Smrgm4_include([m4/lt~obsolete.m4]) 3352