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