aclocal.m4 revision 9acbb460
19acbb460Smrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*- 24ecf19b2Smrg 332034fa5Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 432034fa5Smrg# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. 54ecf19b2Smrg# This file is free software; the Free Software Foundation 64ecf19b2Smrg# gives unlimited permission to copy and/or distribute it, 74ecf19b2Smrg# with or without modifications, as long as this notice is preserved. 84ecf19b2Smrg 94ecf19b2Smrg# This program is distributed in the hope that it will be useful, 104ecf19b2Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without 114ecf19b2Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A 124ecf19b2Smrg# PARTICULAR PURPOSE. 134ecf19b2Smrg 1432034fa5Smrgm4_ifndef([AC_AUTOCONF_VERSION], 1532034fa5Smrg [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 169acbb460Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, 179acbb460Smrg[m4_warning([this file was generated for autoconf 2.68. 1832034fa5SmrgYou have another version of autoconf. It may work, but is not guaranteed to. 1932034fa5SmrgIf you have problems, you may need to regenerate the build system entirely. 2032034fa5SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])]) 214ecf19b2Smrg 229acbb460Smrgdnl fontutil.m4. Generated from fontutil.m4.in by configure. 239acbb460Smrgdnl 249acbb460Smrgdnl This file comes from X.Org's font-util 1.2.0 259acbb460Smrgdnl 269acbb460Smrgdnl Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. 279acbb460Smrgdnl 289acbb460Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a 299acbb460Smrgdnl copy of this software and associated documentation files (the "Software"), 309acbb460Smrgdnl to deal in the Software without restriction, including without limitation 319acbb460Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense, 329acbb460Smrgdnl and/or sell copies of the Software, and to permit persons to whom the 339acbb460Smrgdnl Software is furnished to do so, subject to the following conditions: 349acbb460Smrgdnl 359acbb460Smrgdnl The above copyright notice and this permission notice (including the next 369acbb460Smrgdnl paragraph) shall be included in all copies or substantial portions of the 379acbb460Smrgdnl Software. 389acbb460Smrgdnl 399acbb460Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 409acbb460Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 419acbb460Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 429acbb460Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 439acbb460Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 449acbb460Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 459acbb460Smrgdnl DEALINGS IN THE SOFTWARE. 469acbb460Smrgdnl 479acbb460Smrgdnl -------------------------------------------------------------------- 489acbb460Smrgdnl 499acbb460Smrgdnl Copyright 2005 Red Hat, Inc 509acbb460Smrgdnl 519acbb460Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its 529acbb460Smrgdnl documentation for any purpose is hereby granted without fee, provided that 539acbb460Smrgdnl the above copyright notice appear in all copies and that both that 549acbb460Smrgdnl copyright notice and this permission notice appear in supporting 559acbb460Smrgdnl documentation. 569acbb460Smrgdnl 579acbb460Smrgdnl The above copyright notice and this permission notice shall be included 589acbb460Smrgdnl in all copies or substantial portions of the Software. 599acbb460Smrgdnl 609acbb460Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 619acbb460Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 629acbb460Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 639acbb460Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 649acbb460Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 659acbb460Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 669acbb460Smrgdnl OTHER DEALINGS IN THE SOFTWARE. 679acbb460Smrgdnl 689acbb460Smrgdnl Except as contained in this notice, the name of the copyright holders shall 699acbb460Smrgdnl not be used in advertising or otherwise to promote the sale, use or 709acbb460Smrgdnl other dealings in this Software without prior written authorization 719acbb460Smrgdnl from the copyright holders. 729acbb460Smrg 739acbb460Smrg# XORG_FONT_MACROS_VERSION(required-version) 749acbb460Smrg# ------------------------------------------ 759acbb460Smrg# Minimum version: 1.1.0 7632034fa5Smrg# 779acbb460Smrg# If you're using a macro added in Version 1.1 or newer, include this in 789acbb460Smrg# your configure.ac with the minimum required version, such as: 799acbb460Smrg# XORG_FONT_MACROS_VERSION(1.1) 809acbb460Smrg# 819acbb460Smrg# To ensure that this macro is defined, also add: 829acbb460Smrg# m4_ifndef([XORG_FONT_MACROS_VERSION], 839acbb460Smrg# [m4_fatal([must install X.Org font-util 1.1 or later before running autoconf/autogen])]) 849acbb460Smrg# 859acbb460Smrg# 869acbb460Smrg# See the "minimum version" comment for each macro you use to see what 879acbb460Smrg# version you require. 889acbb460Smrgm4_defun([XORG_FONT_MACROS_VERSION],[ 899acbb460Smrgm4_define([vers_have], [1.2.0]) 909acbb460Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) 919acbb460Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) 929acbb460Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,, 939acbb460Smrg [m4_fatal([font-util major version ]maj_needed[ is required but ]vers_have[ found])]) 949acbb460Smrgm4_if(m4_version_compare(vers_have, [$1]), -1, 959acbb460Smrg [m4_fatal([font-util version $1 or higher is required but ]vers_have[ found])]) 969acbb460Smrgm4_undefine([vers_have]) 979acbb460Smrgm4_undefine([maj_have]) 989acbb460Smrgm4_undefine([maj_needed]) 999acbb460Smrg]) # XORG_FONT_MACROS_VERSION 1004ecf19b2Smrg 1019acbb460Smrg# XORG_FONT_CHECK_{maps}() 1029acbb460Smrg# ------------------------ 1039acbb460Smrg# Minimum version: 1.0.0 1049acbb460Smrg# These macros add --enable/disable-{maps} where {maps} are ISO8859-*, 1059acbb460Smrg# JISX0201 or KOI8_R. By default, they are all enabled. 10632034fa5Smrg 1079acbb460SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_1], [XORG_FONT_CHECK_ENCODING(ISO8859-1)]) 1089acbb460SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_2], [XORG_FONT_CHECK_ENCODING(ISO8859-2)]) 1099acbb460SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_3], [XORG_FONT_CHECK_ENCODING(ISO8859-3)]) 1109acbb460SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_4], [XORG_FONT_CHECK_ENCODING(ISO8859-4)]) 1119acbb460SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_5], [XORG_FONT_CHECK_ENCODING(ISO8859-5)]) 1129acbb460SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_6], [XORG_FONT_CHECK_ENCODING(ISO8859-6)]) 1139acbb460SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_7], [XORG_FONT_CHECK_ENCODING(ISO8859-7)]) 1149acbb460SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_8], [XORG_FONT_CHECK_ENCODING(ISO8859-8)]) 1159acbb460SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_9], [XORG_FONT_CHECK_ENCODING(ISO8859-9)]) 1169acbb460SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_10],[XORG_FONT_CHECK_ENCODING(ISO8859-10)]) 1179acbb460SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_11],[XORG_FONT_CHECK_ENCODING(ISO8859-11)]) 1189acbb460SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_12],[XORG_FONT_CHECK_ENCODING(ISO8859-12)]) 1199acbb460SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_13],[XORG_FONT_CHECK_ENCODING(ISO8859-13)]) 1209acbb460SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_14],[XORG_FONT_CHECK_ENCODING(ISO8859-14)]) 1219acbb460SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_15],[XORG_FONT_CHECK_ENCODING(ISO8859-15)]) 1229acbb460SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_16],[XORG_FONT_CHECK_ENCODING(ISO8859-16)]) 1239acbb460SmrgAC_DEFUN([XORG_FONT_CHECK_JISX0201], [XORG_FONT_CHECK_ENCODING(JISX0201)]) 1249acbb460SmrgAC_DEFUN([XORG_FONT_CHECK_KOI8_R], [XORG_FONT_CHECK_ENCODING(KOI8-R)]) 1254ecf19b2Smrg 1269acbb460Smrg# XORG_FONT_CHECK_ENCODING(encoding) 1279acbb460Smrg# ---------------------------------- 1289acbb460Smrg# Minimum version: 1.1.0 1299acbb460Smrg# This macro adds --enable/disable-<encoding>, enabled by default. 1309acbb460Smrg# It replaced individual copies of this code in the above macros in 1.1. 1319acbb460Smrg# Currently assumes encoding names will be all upper-case - add m4_toupper 1329acbb460Smrg# calls if this is not true in the future. 1334ecf19b2Smrg 1349acbb460SmrgAC_DEFUN([XORG_FONT_CHECK_ENCODING],[ 1359acbb460Smrg AC_ARG_ENABLE(m4_tolower($1), 1369acbb460Smrg AS_HELP_STRING(m4_join([-], [--disable], m4_tolower($1)), 1379acbb460Smrg [Build $1 fonts (default: yes)]), 1389acbb460Smrg [AS_TR_SH($1)=$enableval]) 1399acbb460Smrg AC_MSG_CHECKING([whether to build $1 fonts]) 1409acbb460Smrg AC_MSG_RESULT($[AS_TR_SH($1)]) 1419acbb460Smrg AM_CONDITIONAL(AS_TR_SH($1), [test "x$AS_TR_SH($1)" = xyes]) 1429acbb460Smrg]) # XORG_FONT_CHECK_ENCODING 1434ecf19b2Smrg 1449acbb460Smrg# XORG_FONT_CHECK_ENCODING_LIST(encoding1 encoding2....) 1459acbb460Smrg# ----------------------------------------------------- 1469acbb460Smrg# Minimum version: 1.1.0 1479acbb460Smrg# Call XORG_FONT_CHECK_ENCODING for multiple encodings at once. 1489acbb460Smrg# Add a shorthand --enable/disable-all-encodings option. 1494ecf19b2Smrg 1509acbb460SmrgAC_DEFUN([XORG_FONT_CHECK_ENCODING_LIST],[ 1519acbb460Smrg AC_ARG_ENABLE([all-encodings], 1529acbb460Smrg AS_HELP_STRING([--disable-all-encodings], 1539acbb460Smrg [Disable building of all font encodings]), 1549acbb460Smrg [m4_foreach_w([enc], [$1], [ 1559acbb460Smrg AS_TR_SH(enc)=$enableval 1569acbb460Smrg ])], 1579acbb460Smrg [m4_foreach_w([enc], [$1], [ 1589acbb460Smrg AS_TR_SH(enc)=yes 1599acbb460Smrg ])]) 1609acbb460Smrg m4_foreach_w([enc], [$1], [XORG_FONT_CHECK_ENCODING(enc)]) 1619acbb460Smrg]) # XORG_FONT_CHECK_ENCODING_LIST 1629acbb460Smrg 1639acbb460Smrg# XORG_FONT_REQUIRED_PROG(VARNAME, progname) 1649acbb460Smrg# ------------------------------------------ 1659acbb460Smrg# Minimum version: 1.1.0 1664ecf19b2Smrg# 1679acbb460Smrg# Simple wrapper around AC_PATH_PROG that errors if not found 1684ecf19b2Smrg# 1694ecf19b2Smrg 1709acbb460SmrgAC_DEFUN([XORG_FONT_REQUIRED_PROG],[ 1719acbb460Smrg AC_PATH_PROG($1, $2) 1729acbb460Smrg if test x"$$1" = x; then 1739acbb460Smrg AC_MSG_ERROR([$2 is required to build $PACKAGE_NAME.]) 1749acbb460Smrg fi 1754ecf19b2Smrg]) 1764ecf19b2Smrg 1774ecf19b2Smrg 1789acbb460Smrg# XORG_FONT_FCCACHE() 1799acbb460Smrg# ------------------- 1809acbb460Smrg# Minimum version: 1.1.0 18132034fa5Smrg# 1829acbb460Smrg# Set FCCACHE to path to fc-cache (fontconfig cache builder) if found 1839acbb460Smrg# Set RUN_FCCACHE to a rule suitable for substituting into a makefile 1849acbb460Smrg# to run fc-cache if found and not installing to $DESTDIR 1859acbb460Smrg# 1869acbb460Smrg# fc-cache is optional, not required, and should be skipped when making 1879acbb460Smrg# packages (installing to $DESTDIR). 1889acbb460Smrg# 1899acbb460SmrgAC_DEFUN([XORG_FONT_FCCACHE],[ 1909acbb460Smrg AC_PATH_PROG(FCCACHE, fc-cache) 1919acbb460Smrg FCCACHE_WARN='echo "** Warning: fonts.cache not built" ; echo "** Generate this file manually on host system using fc-cache"' 1929acbb460Smrg if test x"$FCCACHE" = x ; then 1939acbb460Smrg RUN_FCCACHE="${FCCACHE_WARN}" 1949acbb460Smrg else 1959acbb460Smrg RUN_FCCACHE='@(if test -z "$(DESTDIR)"; then echo $(FCCACHE) $(fontdir); $(FCCACHE) $(fontdir); else' 1969acbb460Smrg RUN_FCCACHE="${RUN_FCCACHE} ${FCCACHE_WARN} ; fi)" 1979acbb460Smrg fi 1989acbb460Smrg AC_SUBST([RUN_FCCACHE]) 1999acbb460Smrg]) 2004ecf19b2Smrg 2014ecf19b2Smrg 2029acbb460Smrg# XORG_FONT_COMMON_UTILS() 2039acbb460Smrg# ------------------------ 2049acbb460Smrg# Minimum version: 1.1.0 20532034fa5Smrg# 2069acbb460Smrg# Call XORG_FONT_REQUIRED_PROG for programs needed for all font types 2074ecf19b2Smrg 2089acbb460SmrgAC_DEFUN([XORG_FONT_COMMON_UTILS],[ 2099acbb460Smrg XORG_FONT_FCCACHE 2109acbb460Smrg XORG_FONT_REQUIRED_PROG(MKFONTDIR, mkfontdir) 2119acbb460Smrg]) 2124ecf19b2Smrg 2139acbb460Smrg# XORG_FONT_SCALED_UTILS() 2149acbb460Smrg# ------------------------ 2159acbb460Smrg# Minimum version: 1.1.0 2169acbb460Smrg# 2179acbb460Smrg# Call XORG_FONT_REQUIRED_PROG for programs needed for scalable fonts 2189acbb460Smrg# (TrueType, OpenType, Type1) 2194ecf19b2Smrg 2209acbb460SmrgAC_DEFUN([XORG_FONT_SCALED_UTILS],[ 2219acbb460Smrg XORG_FONT_COMMON_UTILS 2229acbb460Smrg XORG_FONT_REQUIRED_PROG(MKFONTSCALE, mkfontscale) 2239acbb460Smrg]) 2244ecf19b2Smrg 2259acbb460Smrg# XORG_FONT_BDF_UTILS() 2269acbb460Smrg# --------------------- 2279acbb460Smrg# Minimum version: 1.1.0 2284ecf19b2Smrg# 2299acbb460Smrg# Call XORG_FONT_REQUIRED_PROG for programs needed for BDF format bitmap fonts 2309acbb460Smrg# Also call XORG_FONT_CHECK_COMPRESSION to determine how to compress the 2319acbb460Smrg# PCF output files created by bdftopcf 2324ecf19b2Smrg 2339acbb460SmrgAC_DEFUN([XORG_FONT_BDF_UTILS],[ 2349acbb460Smrg XORG_FONT_COMMON_UTILS 2359acbb460Smrg XORG_FONT_REQUIRED_PROG(BDFTOPCF, bdftopcf) 2369acbb460Smrg XORG_FONT_CHECK_COMPRESSION 2379acbb460Smrg]) 2384ecf19b2Smrg 2399acbb460Smrg# XORG_FONT_CHECK_COMPRESSION() 2409acbb460Smrg# ----------------------------- 2419acbb460Smrg# Minimum version: 1.1.0 2429acbb460Smrg# 2439acbb460Smrg# Offer a --with-compression flag to control what compression method is 2449acbb460Smrg# used for pcf font files. Offers all the methods currently supported 2459acbb460Smrg# by libXfont, including no compression. 24632034fa5Smrg 2479acbb460SmrgAC_DEFUN([XORG_FONT_CHECK_COMPRESSION],[ 2489acbb460Smrg AC_MSG_CHECKING([font compression method]) 2499acbb460Smrg AC_ARG_WITH(compression, 2509acbb460Smrg [AS_HELP_STRING([--with-compression=<no|compress|gzip|bzip2>], 2519acbb460Smrg [compression method to use on pcf fonts])], 2529acbb460Smrg [compression="$withval"], [compression="yes"]) 2539acbb460Smrg if test x"$compression" = "xyes" ; then 2549acbb460Smrg compression="gzip" 2559acbb460Smrg fi 2569acbb460Smrg AC_MSG_RESULT([${compression}]) 2579acbb460Smrg case ${compression} in 2589acbb460Smrg *compress) COMPRESS_SUFFIX=".Z" ;; 2599acbb460Smrg *gzip) COMPRESS_SUFFIX=".gz" ;; 2609acbb460Smrg *bzip2) COMPRESS_SUFFIX=".bz2" ;; 2619acbb460Smrg no|none) COMPRESS_SUFFIX="" ; COMPRESS="cat" ;; 2629acbb460Smrg *) AC_MSG_ERROR([${compression} is not a supported compression method]) ;; 2639acbb460Smrg esac 2649acbb460Smrg if test x"$COMPRESS_SUFFIX" != "x" ; then 2659acbb460Smrg XORG_FONT_REQUIRED_PROG(COMPRESS, ${compression}) 2669acbb460Smrg fi 2679acbb460Smrg AC_SUBST([COMPRESS_SUFFIX]) 2689acbb460Smrg]) 2694ecf19b2Smrg 2709acbb460Smrg# XORG_FONT_UCS2ANY() 2719acbb460Smrg# ------------------- 2729acbb460Smrg# Minimum version: 1.1.0 2739acbb460Smrg# 2749acbb460Smrg# Call XORG_FONT_REQUIRED_PROG for ucs2any program needed for splitting 2759acbb460Smrg# Unicode-encoded BDF format bitmap fonts into subsets for older encodings. 2769acbb460Smrg# Also call pkg-config to find the directory with the encoding files needed 2779acbb460Smrg# by ucs2any, and export it as MAPFILES_PATH to the Makefiles 2784ecf19b2Smrg 2799acbb460SmrgAC_DEFUN([XORG_FONT_UCS2ANY],[ 2809acbb460Smrg XORG_FONT_REQUIRED_PROG(UCS2ANY, ucs2any) 2819acbb460Smrg PKG_CHECK_MODULES(MAPS, [fontutil]) 2829acbb460Smrg AC_MSG_CHECKING([for ucs2any encoding data files]) 2839acbb460Smrg MAPFILES_PATH=`pkg-config --variable=mapdir fontutil` 2849acbb460Smrg AC_SUBST(MAPFILES_PATH) 2859acbb460Smrg AC_MSG_RESULT([${MAPFILES_PATH}]) 2864ecf19b2Smrg]) 2874ecf19b2Smrg 2884ecf19b2Smrg 2894ecf19b2Smrg 2909acbb460Smrg# XORG_FONT_FC_CONFDIR() 2919acbb460Smrg# -------------------- 2929acbb460Smrg# Minimum version: 1.2.0 2939acbb460Smrg# 2949acbb460Smrg# Sets FC_CONFDIR to the fontconfig config directory 2959acbb460Smrg# (which should be --with-confdir=... when building fontconfig) 2969acbb460Smrg# found from: 2979acbb460Smrg# --with-fc-confdir=... 2989acbb460Smrg# pkg-config --variable=confdir fontconfig 2999acbb460Smrg# ${sysconfdir}/fonts 3004ecf19b2Smrg 3019acbb460SmrgAC_DEFUN([XORG_FONT_FC_CONFDIR],[ 3029acbb460Smrg dnl Ensure $PKG_CONFIG is set first 3039acbb460Smrg AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 3049acbb460Smrg 3059acbb460Smrg AC_MSG_CHECKING([for fontconfig's configuration directory]) 3069acbb460Smrg AC_ARG_WITH(fc-confdir, 3079acbb460Smrg AS_HELP_STRING([--with-fc-confdir=DIR], 3089acbb460Smrg [Path to fontconfig's configuration directory]), 3099acbb460Smrg [FC_CONFDIR="$withval"]) 3109acbb460Smrg # if --with-fc-confdir was not specified 3119acbb460Smrg if test "x${FC_CONFDIR}" = "x"; then 3129acbb460Smrg FC_CONFDIR=`$PKG_CONFIG --variable=confdir fontconfig` 3139acbb460Smrg fi 3149acbb460Smrg # ...and if pkg-config didn't find confdir in fontconfig.pc... 3159acbb460Smrg if test "x${FC_CONFDIR}" = "x"; then 3169acbb460Smrg FC_CONFDIR="${sysconfdir}/fonts" 3179acbb460Smrg fi 3189acbb460Smrg AC_SUBST(FC_CONFDIR) 3199acbb460Smrg AC_MSG_RESULT([${FC_CONFDIR}]) 3204ecf19b2Smrg]) 3214ecf19b2Smrg 3224ecf19b2Smrg 3239acbb460Smrg 3249acbb460Smrg# XORG_FONTROOTDIR() 3259acbb460Smrg# -------------------- 3269acbb460Smrg# Minimum version: 1.1.0 32732034fa5Smrg# 3289acbb460Smrg# Sets FONTROOTDIR to the root directory for font files. Uses the first 3299acbb460Smrg# found from: 3309acbb460Smrg# --with-fontrootdir 3319acbb460Smrg# pkg-config --variable=fontrootdir fontutil 3329acbb460Smrg# ${datadir}/fonts/X11 3334ecf19b2Smrg 3349acbb460SmrgAC_DEFUN([XORG_FONTROOTDIR],[ 3359acbb460Smrg dnl Ensure $PKG_CONFIG is set first 3369acbb460Smrg AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 3374ecf19b2Smrg 3389acbb460Smrg AC_MSG_CHECKING([for root directory for font files]) 3399acbb460Smrg AC_ARG_WITH(fontrootdir, 3409acbb460Smrg AS_HELP_STRING([--with-fontrootdir=DIR], 3419acbb460Smrg [Path to root directory for font files]), 3429acbb460Smrg [FONTROOTDIR="$withval"]) 3439acbb460Smrg # if --with-fontrootdir not specified... 3449acbb460Smrg if test "x${FONTROOTDIR}" = "x"; then 3459acbb460Smrg FONTROOTDIR=`$PKG_CONFIG --variable=fontrootdir fontutil` 3469acbb460Smrg fi 3479acbb460Smrg # ...and if pkg-config didn't find fontdir in fontutil.pc... 3489acbb460Smrg if test "x${FONTROOTDIR}" = "x"; then 3499acbb460Smrg FONTROOTDIR="${datadir}/fonts/X11" 3509acbb460Smrg fi 3519acbb460Smrg AC_SUBST(FONTROOTDIR) 3529acbb460Smrg AC_MSG_RESULT([${FONTROOTDIR}]) 3539acbb460Smrg]) 3544ecf19b2Smrg 3559acbb460Smrg# XORG_FONTSUBDIR(variable, flag, subdir) 3569acbb460Smrg# --------------------------------------- 3579acbb460Smrg# Minimum version: 1.1.0 3584ecf19b2Smrg# 3599acbb460Smrg# Offer a --with-<flag> flag to control directory for font installation 3609acbb460Smrg# Default is the specified <subdir> of the font root directory. 3619acbb460Smrg# Sets <variable> to the selected directory 3624ecf19b2Smrg 3639acbb460SmrgAC_DEFUN([XORG_FONTSUBDIR],[ 3649acbb460Smrg AC_REQUIRE([XORG_FONTROOTDIR]) 36532034fa5Smrg 3669acbb460Smrg AC_MSG_CHECKING([for directory for $3 files]) 3679acbb460Smrg AC_ARG_WITH($2, 3689acbb460Smrg [AS_HELP_STRING([--with-$2=DIR], 3699acbb460Smrg [Path to $3 files [FONTROOTDIR/$3]])], 3709acbb460Smrg [$1="${withval}"], [$1='${FONTROOTDIR}/$3']) 3719acbb460Smrg AC_SUBST($1) 3729acbb460Smrg AC_MSG_RESULT([${$1}]) 3739acbb460Smrg]) # XORG_FONTSUBDIR 3749acbb460Smrg 3759acbb460Smrg# XORG_FONTDIR(subdir) 3769acbb460Smrg# -------------------- 3779acbb460Smrg# Minimum version: 1.1.0 37832034fa5Smrg# 3799acbb460Smrg# Offer a --with-fontdir flag to control directory for font installation 3809acbb460Smrg# Default is the specified subdir of the font root directory. 3819acbb460Smrg# Sets FONTDIR to the selected directory 38232034fa5Smrg 3839acbb460SmrgAC_DEFUN([XORG_FONTDIR],[XORG_FONTSUBDIR([FONTDIR], [fontdir], [$1])]) 38432034fa5Smrg 3859acbb460Smrg# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- 3869acbb460Smrg# serial 1 (pkg-config-0.24) 3879acbb460Smrg# 3889acbb460Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>. 3899acbb460Smrg# 3909acbb460Smrg# This program is free software; you can redistribute it and/or modify 3919acbb460Smrg# it under the terms of the GNU General Public License as published by 3929acbb460Smrg# the Free Software Foundation; either version 2 of the License, or 3939acbb460Smrg# (at your option) any later version. 3949acbb460Smrg# 3959acbb460Smrg# This program is distributed in the hope that it will be useful, but 3969acbb460Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of 3979acbb460Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 3989acbb460Smrg# General Public License for more details. 3999acbb460Smrg# 4009acbb460Smrg# You should have received a copy of the GNU General Public License 4019acbb460Smrg# along with this program; if not, write to the Free Software 4029acbb460Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 4039acbb460Smrg# 4049acbb460Smrg# As a special exception to the GNU General Public License, if you 4059acbb460Smrg# distribute this file as part of a program that contains a 4069acbb460Smrg# configuration script generated by Autoconf, you may include it under 4079acbb460Smrg# the same distribution terms that you use for the rest of that program. 40832034fa5Smrg 4099acbb460Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION]) 4109acbb460Smrg# ---------------------------------- 4119acbb460SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG], 4129acbb460Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) 4139acbb460Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$]) 4149acbb460SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) 4159acbb460SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) 4169acbb460SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) 41732034fa5Smrg 4189acbb460Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then 4199acbb460Smrg AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) 42032034fa5Smrgfi 4219acbb460Smrgif test -n "$PKG_CONFIG"; then 4229acbb460Smrg _pkg_min_version=m4_default([$1], [0.9.0]) 4239acbb460Smrg AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) 4249acbb460Smrg if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then 4259acbb460Smrg AC_MSG_RESULT([yes]) 4269acbb460Smrg else 4279acbb460Smrg AC_MSG_RESULT([no]) 4289acbb460Smrg PKG_CONFIG="" 4299acbb460Smrg fi 4309acbb460Smrgfi[]dnl 4319acbb460Smrg])# PKG_PROG_PKG_CONFIG 43232034fa5Smrg 4339acbb460Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 4349acbb460Smrg# 4359acbb460Smrg# Check to see whether a particular set of modules exists. Similar 4369acbb460Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors. 4379acbb460Smrg# 4389acbb460Smrg# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 4399acbb460Smrg# only at the first occurence in configure.ac, so if the first place 4409acbb460Smrg# it's called might be skipped (such as if it is within an "if", you 4419acbb460Smrg# have to call PKG_CHECK_EXISTS manually 4429acbb460Smrg# -------------------------------------------------------------- 4439acbb460SmrgAC_DEFUN([PKG_CHECK_EXISTS], 4449acbb460Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 4459acbb460Smrgif test -n "$PKG_CONFIG" && \ 4469acbb460Smrg AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then 4479acbb460Smrg m4_default([$2], [:]) 4489acbb460Smrgm4_ifvaln([$3], [else 4499acbb460Smrg $3])dnl 4509acbb460Smrgfi]) 45132034fa5Smrg 4529acbb460Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) 4539acbb460Smrg# --------------------------------------------- 4549acbb460Smrgm4_define([_PKG_CONFIG], 4559acbb460Smrg[if test -n "$$1"; then 4569acbb460Smrg pkg_cv_[]$1="$$1" 4579acbb460Smrg elif test -n "$PKG_CONFIG"; then 4589acbb460Smrg PKG_CHECK_EXISTS([$3], 4599acbb460Smrg [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], 4609acbb460Smrg [pkg_failed=yes]) 4619acbb460Smrg else 4629acbb460Smrg pkg_failed=untried 4639acbb460Smrgfi[]dnl 4649acbb460Smrg])# _PKG_CONFIG 46532034fa5Smrg 4669acbb460Smrg# _PKG_SHORT_ERRORS_SUPPORTED 4679acbb460Smrg# ----------------------------- 4689acbb460SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], 4699acbb460Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 4709acbb460Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then 4719acbb460Smrg _pkg_short_errors_supported=yes 4729acbb460Smrgelse 4739acbb460Smrg _pkg_short_errors_supported=no 4749acbb460Smrgfi[]dnl 4759acbb460Smrg])# _PKG_SHORT_ERRORS_SUPPORTED 47632034fa5Smrg 47732034fa5Smrg 4789acbb460Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], 4799acbb460Smrg# [ACTION-IF-NOT-FOUND]) 4809acbb460Smrg# 4819acbb460Smrg# 4829acbb460Smrg# Note that if there is a possibility the first call to 4839acbb460Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an 4849acbb460Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac 4859acbb460Smrg# 4869acbb460Smrg# 4879acbb460Smrg# -------------------------------------------------------------- 4889acbb460SmrgAC_DEFUN([PKG_CHECK_MODULES], 4899acbb460Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 4909acbb460SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl 4919acbb460SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl 49232034fa5Smrg 4939acbb460Smrgpkg_failed=no 4949acbb460SmrgAC_MSG_CHECKING([for $1]) 4959acbb460Smrg 4969acbb460Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) 4979acbb460Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2]) 4989acbb460Smrg 4999acbb460Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS 5009acbb460Smrgand $1[]_LIBS to avoid the need to call pkg-config. 5019acbb460SmrgSee the pkg-config man page for more details.]) 5029acbb460Smrg 5039acbb460Smrgif test $pkg_failed = yes; then 5049acbb460Smrg AC_MSG_RESULT([no]) 5059acbb460Smrg _PKG_SHORT_ERRORS_SUPPORTED 5069acbb460Smrg if test $_pkg_short_errors_supported = yes; then 5079acbb460Smrg $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` 5089acbb460Smrg else 5099acbb460Smrg $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` 5109acbb460Smrg fi 5119acbb460Smrg # Put the nasty error message in config.log where it belongs 5129acbb460Smrg echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD 5139acbb460Smrg 5149acbb460Smrg m4_default([$4], [AC_MSG_ERROR( 5159acbb460Smrg[Package requirements ($2) were not met: 5169acbb460Smrg 5179acbb460Smrg$$1_PKG_ERRORS 5189acbb460Smrg 5199acbb460SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you 5209acbb460Smrginstalled software in a non-standard prefix. 5219acbb460Smrg 5229acbb460Smrg_PKG_TEXT])[]dnl 5239acbb460Smrg ]) 5249acbb460Smrgelif test $pkg_failed = untried; then 5259acbb460Smrg AC_MSG_RESULT([no]) 5269acbb460Smrg m4_default([$4], [AC_MSG_FAILURE( 5279acbb460Smrg[The pkg-config script could not be found or is too old. Make sure it 5289acbb460Smrgis in your PATH or set the PKG_CONFIG environment variable to the full 5299acbb460Smrgpath to pkg-config. 5309acbb460Smrg 5319acbb460Smrg_PKG_TEXT 5329acbb460Smrg 5339acbb460SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])dnl 5349acbb460Smrg ]) 5359acbb460Smrgelse 5369acbb460Smrg $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS 5379acbb460Smrg $1[]_LIBS=$pkg_cv_[]$1[]_LIBS 5389acbb460Smrg AC_MSG_RESULT([yes]) 5399acbb460Smrg $3 5409acbb460Smrgfi[]dnl 5419acbb460Smrg])# PKG_CHECK_MODULES 54232034fa5Smrg 5439acbb460Smrgdnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. 5449acbb460Smrgdnl 5459acbb460Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. 5469acbb460Smrgdnl 5479acbb460Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a 5489acbb460Smrgdnl copy of this software and associated documentation files (the "Software"), 5499acbb460Smrgdnl to deal in the Software without restriction, including without limitation 5509acbb460Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense, 5519acbb460Smrgdnl and/or sell copies of the Software, and to permit persons to whom the 5529acbb460Smrgdnl Software is furnished to do so, subject to the following conditions: 5539acbb460Smrgdnl 5549acbb460Smrgdnl The above copyright notice and this permission notice (including the next 5559acbb460Smrgdnl paragraph) shall be included in all copies or substantial portions of the 5569acbb460Smrgdnl Software. 5579acbb460Smrgdnl 5589acbb460Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 5599acbb460Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 5609acbb460Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 5619acbb460Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 5629acbb460Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 5639acbb460Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 5649acbb460Smrgdnl DEALINGS IN THE SOFTWARE. 56532034fa5Smrg 5669acbb460Smrg# XORG_MACROS_VERSION(required-version) 5679acbb460Smrg# ------------------------------------- 5689acbb460Smrg# Minimum version: 1.1.0 56932034fa5Smrg# 5709acbb460Smrg# If you're using a macro added in Version 1.1 or newer, include this in 5719acbb460Smrg# your configure.ac with the minimum required version, such as: 5729acbb460Smrg# XORG_MACROS_VERSION(1.1) 5739acbb460Smrg# 5749acbb460Smrg# To ensure that this macro is defined, also add: 5759acbb460Smrg# m4_ifndef([XORG_MACROS_VERSION], 5769acbb460Smrg# [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])]) 5779acbb460Smrg# 5789acbb460Smrg# 5799acbb460Smrg# See the "minimum version" comment for each macro you use to see what 5809acbb460Smrg# version you require. 5819acbb460Smrgm4_defun([XORG_MACROS_VERSION],[ 5829acbb460Smrgm4_define([vers_have], [1.11.0]) 5839acbb460Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) 5849acbb460Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) 5859acbb460Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,, 5869acbb460Smrg [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])]) 5879acbb460Smrgm4_if(m4_version_compare(vers_have, [$1]), -1, 5889acbb460Smrg [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])]) 5899acbb460Smrgm4_undefine([vers_have]) 5909acbb460Smrgm4_undefine([maj_have]) 5919acbb460Smrgm4_undefine([maj_needed]) 5929acbb460Smrg]) # XORG_MACROS_VERSION 59332034fa5Smrg 5949acbb460Smrg# XORG_PROG_RAWCPP() 59532034fa5Smrg# ------------------ 5969acbb460Smrg# Minimum version: 1.0.0 59732034fa5Smrg# 5989acbb460Smrg# Find cpp program and necessary flags for use in pre-processing text files 5999acbb460Smrg# such as man pages and config files 6009acbb460SmrgAC_DEFUN([XORG_PROG_RAWCPP],[ 6019acbb460SmrgAC_REQUIRE([AC_PROG_CPP]) 6029acbb460SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 6039acbb460Smrg [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) 60432034fa5Smrg 6059acbb460Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined, 6069acbb460Smrg# which is not the best choice for supporting other OS'es, but covers most 6079acbb460Smrg# of the ones we need for now. 6089acbb460SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef]) 6099acbb460SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?]) 6109acbb460Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 6119acbb460Smrg AC_MSG_RESULT([no]) 61232034fa5Smrgelse 6139acbb460Smrg if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 6149acbb460Smrg RAWCPPFLAGS=-undef 6159acbb460Smrg AC_MSG_RESULT([yes]) 6169acbb460Smrg # under Cygwin unix is still defined even with -undef 6179acbb460Smrg elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 6189acbb460Smrg RAWCPPFLAGS="-undef -ansi" 6199acbb460Smrg AC_MSG_RESULT([yes, with -ansi]) 6209acbb460Smrg else 6219acbb460Smrg AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.]) 6229acbb460Smrg fi 62332034fa5Smrgfi 6249acbb460Smrgrm -f conftest.$ac_ext 62532034fa5Smrg 6269acbb460SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional]) 6279acbb460SmrgAC_LANG_CONFTEST([Does cpp preserve "whitespace"?]) 6289acbb460Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 6299acbb460Smrg AC_MSG_RESULT([no]) 6309acbb460Smrgelse 6319acbb460Smrg if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 6329acbb460Smrg RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" 6339acbb460Smrg AC_MSG_RESULT([yes]) 6349acbb460Smrg else 6359acbb460Smrg AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) 6369acbb460Smrg fi 6379acbb460Smrgfi 6389acbb460Smrgrm -f conftest.$ac_ext 6399acbb460SmrgAC_SUBST(RAWCPPFLAGS) 6409acbb460Smrg]) # XORG_PROG_RAWCPP 64132034fa5Smrg 6429acbb460Smrg# XORG_MANPAGE_SECTIONS() 6439acbb460Smrg# ----------------------- 6449acbb460Smrg# Minimum version: 1.0.0 64532034fa5Smrg# 6469acbb460Smrg# Determine which sections man pages go in for the different man page types 6479acbb460Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. 6489acbb460Smrg# Not sure if there's any better way than just hardcoding by OS name. 6499acbb460Smrg# Override default settings by setting environment variables 6509acbb460Smrg# Added MAN_SUBSTS in version 1.8 6519acbb460Smrg# Added AC_PROG_SED in version 1.8 65232034fa5Smrg 6539acbb460SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[ 6549acbb460SmrgAC_REQUIRE([AC_CANONICAL_HOST]) 6559acbb460SmrgAC_REQUIRE([AC_PROG_SED]) 65632034fa5Smrg 6579acbb460Smrgif test x$APP_MAN_SUFFIX = x ; then 6589acbb460Smrg APP_MAN_SUFFIX=1 6599acbb460Smrgfi 6609acbb460Smrgif test x$APP_MAN_DIR = x ; then 6619acbb460Smrg APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' 6629acbb460Smrgfi 66332034fa5Smrg 6649acbb460Smrgif test x$LIB_MAN_SUFFIX = x ; then 6659acbb460Smrg LIB_MAN_SUFFIX=3 6669acbb460Smrgfi 6679acbb460Smrgif test x$LIB_MAN_DIR = x ; then 6689acbb460Smrg LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' 6699acbb460Smrgfi 67032034fa5Smrg 6719acbb460Smrgif test x$FILE_MAN_SUFFIX = x ; then 6729acbb460Smrg case $host_os in 6739acbb460Smrg solaris*) FILE_MAN_SUFFIX=4 ;; 6749acbb460Smrg *) FILE_MAN_SUFFIX=5 ;; 6759acbb460Smrg esac 6769acbb460Smrgfi 6779acbb460Smrgif test x$FILE_MAN_DIR = x ; then 6789acbb460Smrg FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' 6799acbb460Smrgfi 6804ecf19b2Smrg 6819acbb460Smrgif test x$MISC_MAN_SUFFIX = x ; then 6829acbb460Smrg case $host_os in 6839acbb460Smrg solaris*) MISC_MAN_SUFFIX=5 ;; 6849acbb460Smrg *) MISC_MAN_SUFFIX=7 ;; 6859acbb460Smrg esac 6869acbb460Smrgfi 6879acbb460Smrgif test x$MISC_MAN_DIR = x ; then 6889acbb460Smrg MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' 6899acbb460Smrgfi 69032034fa5Smrg 6919acbb460Smrgif test x$DRIVER_MAN_SUFFIX = x ; then 6929acbb460Smrg case $host_os in 6939acbb460Smrg solaris*) DRIVER_MAN_SUFFIX=7 ;; 6949acbb460Smrg *) DRIVER_MAN_SUFFIX=4 ;; 6959acbb460Smrg esac 6969acbb460Smrgfi 6979acbb460Smrgif test x$DRIVER_MAN_DIR = x ; then 6989acbb460Smrg DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' 6999acbb460Smrgfi 70032034fa5Smrg 7019acbb460Smrgif test x$ADMIN_MAN_SUFFIX = x ; then 7029acbb460Smrg case $host_os in 7039acbb460Smrg solaris*) ADMIN_MAN_SUFFIX=1m ;; 7049acbb460Smrg *) ADMIN_MAN_SUFFIX=8 ;; 7059acbb460Smrg esac 7069acbb460Smrgfi 7079acbb460Smrgif test x$ADMIN_MAN_DIR = x ; then 7089acbb460Smrg ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' 70932034fa5Smrgfi 71032034fa5Smrg 71132034fa5Smrg 7129acbb460SmrgAC_SUBST([APP_MAN_SUFFIX]) 7139acbb460SmrgAC_SUBST([LIB_MAN_SUFFIX]) 7149acbb460SmrgAC_SUBST([FILE_MAN_SUFFIX]) 7159acbb460SmrgAC_SUBST([MISC_MAN_SUFFIX]) 7169acbb460SmrgAC_SUBST([DRIVER_MAN_SUFFIX]) 7179acbb460SmrgAC_SUBST([ADMIN_MAN_SUFFIX]) 7189acbb460SmrgAC_SUBST([APP_MAN_DIR]) 7199acbb460SmrgAC_SUBST([LIB_MAN_DIR]) 7209acbb460SmrgAC_SUBST([FILE_MAN_DIR]) 7219acbb460SmrgAC_SUBST([MISC_MAN_DIR]) 7229acbb460SmrgAC_SUBST([DRIVER_MAN_DIR]) 7239acbb460SmrgAC_SUBST([ADMIN_MAN_DIR]) 72432034fa5Smrg 7259acbb460SmrgXORG_MAN_PAGE="X Version 11" 7269acbb460SmrgAC_SUBST([XORG_MAN_PAGE]) 7279acbb460SmrgMAN_SUBSTS="\ 7289acbb460Smrg -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ 7299acbb460Smrg -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ 7309acbb460Smrg -e 's|__xservername__|Xorg|g' \ 7319acbb460Smrg -e 's|__xconfigfile__|xorg.conf|g' \ 7329acbb460Smrg -e 's|__projectroot__|\$(prefix)|g' \ 7339acbb460Smrg -e 's|__apploaddir__|\$(appdefaultdir)|g' \ 7349acbb460Smrg -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \ 7359acbb460Smrg -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \ 7369acbb460Smrg -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \ 7379acbb460Smrg -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \ 7389acbb460Smrg -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \ 7399acbb460Smrg -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'" 7409acbb460SmrgAC_SUBST([MAN_SUBSTS]) 74132034fa5Smrg 7429acbb460Smrg]) # XORG_MANPAGE_SECTIONS 74332034fa5Smrg 7449acbb460Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION]) 7459acbb460Smrg# ------------------------ 7469acbb460Smrg# Minimum version: 1.7.0 7479acbb460Smrg# 7489acbb460Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent 7499acbb460Smrg# provided by xorg-sgml-doctools, if installed. 7509acbb460SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[ 7519acbb460SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])]) 7529acbb460SmrgXORG_SGML_PATH= 7539acbb460SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])], 7549acbb460Smrg [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`], 7559acbb460Smrg [m4_ifval([$1],[:], 7569acbb460Smrg [if test x"$cross_compiling" != x"yes" ; then 7579acbb460Smrg AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent], 7589acbb460Smrg [XORG_SGML_PATH=$prefix/share/sgml]) 7599acbb460Smrg fi]) 7609acbb460Smrg ]) 7619acbb460Smrg 7629acbb460Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing 7639acbb460Smrg# the path and the name of the doc stylesheet 7649acbb460Smrgif test "x$XORG_SGML_PATH" != "x" ; then 7659acbb460Smrg AC_MSG_RESULT([$XORG_SGML_PATH]) 7669acbb460Smrg STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11 7679acbb460Smrg XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl 76832034fa5Smrgelse 7699acbb460Smrg AC_MSG_RESULT([no]) 77032034fa5Smrgfi 77132034fa5Smrg 7729acbb460SmrgAC_SUBST(XORG_SGML_PATH) 7739acbb460SmrgAC_SUBST(STYLESHEET_SRCDIR) 7749acbb460SmrgAC_SUBST(XSL_STYLESHEET) 7759acbb460SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"]) 7769acbb460Smrg]) # XORG_CHECK_SGML_DOCTOOLS 7779acbb460Smrg 7789acbb460Smrg# XORG_CHECK_LINUXDOC 7799acbb460Smrg# ------------------- 7809acbb460Smrg# Minimum version: 1.0.0 78132034fa5Smrg# 7829acbb460Smrg# Defines the variable MAKE_TEXT if the necessary tools and 7839acbb460Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. 7849acbb460Smrg# Whether or not the necessary tools and files are found can be checked 7859acbb460Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC" 7869acbb460SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[ 7879acbb460SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) 7889acbb460SmrgAC_REQUIRE([XORG_WITH_PS2PDF]) 78932034fa5Smrg 7909acbb460SmrgAC_PATH_PROG(LINUXDOC, linuxdoc) 79132034fa5Smrg 7929acbb460SmrgAC_MSG_CHECKING([whether to build documentation]) 79332034fa5Smrg 7949acbb460Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then 7959acbb460Smrg BUILDDOC=yes 7969acbb460Smrgelse 7979acbb460Smrg BUILDDOC=no 7989acbb460Smrgfi 79932034fa5Smrg 8009acbb460SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) 80132034fa5Smrg 8029acbb460SmrgAC_MSG_RESULT([$BUILDDOC]) 80332034fa5Smrg 8049acbb460SmrgAC_MSG_CHECKING([whether to build pdf documentation]) 80532034fa5Smrg 8069acbb460Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then 8079acbb460Smrg BUILDPDFDOC=yes 8089acbb460Smrgelse 8099acbb460Smrg BUILDPDFDOC=no 8109acbb460Smrgfi 81132034fa5Smrg 8129acbb460SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 81332034fa5Smrg 8149acbb460SmrgAC_MSG_RESULT([$BUILDPDFDOC]) 81532034fa5Smrg 8169acbb460SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f" 8179acbb460SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps" 8189acbb460SmrgMAKE_PDF="$PS2PDF" 8199acbb460SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0" 82032034fa5Smrg 8219acbb460SmrgAC_SUBST(MAKE_TEXT) 8229acbb460SmrgAC_SUBST(MAKE_PS) 8239acbb460SmrgAC_SUBST(MAKE_PDF) 8249acbb460SmrgAC_SUBST(MAKE_HTML) 8259acbb460Smrg]) # XORG_CHECK_LINUXDOC 82632034fa5Smrg 8279acbb460Smrg# XORG_CHECK_DOCBOOK 8289acbb460Smrg# ------------------- 8299acbb460Smrg# Minimum version: 1.0.0 8309acbb460Smrg# 8319acbb460Smrg# Checks for the ability to build output formats from SGML DocBook source. 8329acbb460Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC" 8339acbb460Smrg# indicates whether the necessary tools and files are found and, if set, 8349acbb460Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx. 8359acbb460SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[ 8369acbb460SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) 83732034fa5Smrg 8389acbb460SmrgBUILDTXTDOC=no 8399acbb460SmrgBUILDPDFDOC=no 8409acbb460SmrgBUILDPSDOC=no 8419acbb460SmrgBUILDHTMLDOC=no 84232034fa5Smrg 8439acbb460SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps) 8449acbb460SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf) 8459acbb460SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html) 8469acbb460SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt) 84732034fa5Smrg 8489acbb460SmrgAC_MSG_CHECKING([whether to build text documentation]) 8499acbb460Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x && 8509acbb460Smrg test x$BUILD_TXTDOC != xno; then 8519acbb460Smrg BUILDTXTDOC=yes 85232034fa5Smrgfi 8539acbb460SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes]) 8549acbb460SmrgAC_MSG_RESULT([$BUILDTXTDOC]) 85532034fa5Smrg 8569acbb460SmrgAC_MSG_CHECKING([whether to build PDF documentation]) 8579acbb460Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x && 8589acbb460Smrg test x$BUILD_PDFDOC != xno; then 8599acbb460Smrg BUILDPDFDOC=yes 8609acbb460Smrgfi 8619acbb460SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 8629acbb460SmrgAC_MSG_RESULT([$BUILDPDFDOC]) 86332034fa5Smrg 8649acbb460SmrgAC_MSG_CHECKING([whether to build PostScript documentation]) 8659acbb460Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x && 8669acbb460Smrg test x$BUILD_PSDOC != xno; then 8679acbb460Smrg BUILDPSDOC=yes 8689acbb460Smrgfi 8699acbb460SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes]) 8709acbb460SmrgAC_MSG_RESULT([$BUILDPSDOC]) 87132034fa5Smrg 8729acbb460SmrgAC_MSG_CHECKING([whether to build HTML documentation]) 8739acbb460Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x && 8749acbb460Smrg test x$BUILD_HTMLDOC != xno; then 8759acbb460Smrg BUILDHTMLDOC=yes 8769acbb460Smrgfi 8779acbb460SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes]) 8789acbb460SmrgAC_MSG_RESULT([$BUILDHTMLDOC]) 8799acbb460Smrg 8809acbb460SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT" 8819acbb460SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS" 8829acbb460SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF" 8839acbb460SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML" 88432034fa5Smrg 8859acbb460SmrgAC_SUBST(MAKE_TEXT) 8869acbb460SmrgAC_SUBST(MAKE_PS) 8879acbb460SmrgAC_SUBST(MAKE_PDF) 8889acbb460SmrgAC_SUBST(MAKE_HTML) 8899acbb460Smrg]) # XORG_CHECK_DOCBOOK 89032034fa5Smrg 8919acbb460Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT]) 8929acbb460Smrg# ---------------- 8939acbb460Smrg# Minimum version: 1.5.0 8949acbb460Smrg# Minimum version for optional DEFAULT argument: 1.11.0 8959acbb460Smrg# 8969acbb460Smrg# Documentation tools are not always available on all platforms and sometimes 8979acbb460Smrg# not at the appropriate level. This macro enables a module to test for the 8989acbb460Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 8999acbb460Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions 9009acbb460Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified, 9019acbb460Smrg# --with-xmlto assumes 'auto'. 9029acbb460Smrg# 9039acbb460Smrg# Interface to module: 9049acbb460Smrg# HAVE_XMLTO: used in makefiles to conditionally generate documentation 9059acbb460Smrg# XMLTO: returns the path of the xmlto program found 9069acbb460Smrg# returns the path set by the user in the environment 9079acbb460Smrg# --with-xmlto: 'yes' user instructs the module to use xmlto 9089acbb460Smrg# 'no' user instructs the module not to use xmlto 9099acbb460Smrg# 9109acbb460Smrg# Added in version 1.10.0 9119acbb460Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation 9129acbb460Smrg# xmlto for text output requires either lynx, links, or w3m browsers 9139acbb460Smrg# 9149acbb460Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path. 9159acbb460Smrg# 9169acbb460SmrgAC_DEFUN([XORG_WITH_XMLTO],[ 9179acbb460SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command]) 9189acbb460Smrgm4_define([_defopt], m4_default([$2], [auto])) 9199acbb460SmrgAC_ARG_WITH(xmlto, 9209acbb460Smrg AS_HELP_STRING([--with-xmlto], 9219acbb460Smrg [Use xmlto to regenerate documentation (default: ]_defopt[)]), 9229acbb460Smrg [use_xmlto=$withval], [use_xmlto=]_defopt) 9239acbb460Smrgm4_undefine([_defopt]) 9249acbb460Smrg 9259acbb460Smrgif test "x$use_xmlto" = x"auto"; then 9269acbb460Smrg AC_PATH_PROG([XMLTO], [xmlto]) 9279acbb460Smrg if test "x$XMLTO" = "x"; then 9289acbb460Smrg AC_MSG_WARN([xmlto not found - documentation targets will be skipped]) 9299acbb460Smrg have_xmlto=no 9309acbb460Smrg else 9319acbb460Smrg have_xmlto=yes 9329acbb460Smrg fi 9339acbb460Smrgelif test "x$use_xmlto" = x"yes" ; then 9349acbb460Smrg AC_PATH_PROG([XMLTO], [xmlto]) 9359acbb460Smrg if test "x$XMLTO" = "x"; then 9369acbb460Smrg AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH]) 9379acbb460Smrg fi 9389acbb460Smrg have_xmlto=yes 9399acbb460Smrgelif test "x$use_xmlto" = x"no" ; then 9409acbb460Smrg if test "x$XMLTO" != "x"; then 9419acbb460Smrg AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified]) 9429acbb460Smrg fi 9439acbb460Smrg have_xmlto=no 9449acbb460Smrgelse 9459acbb460Smrg AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no']) 94632034fa5Smrgfi 94732034fa5Smrg 9489acbb460Smrg# Test for a minimum version of xmlto, if provided. 9499acbb460Smrgm4_ifval([$1], 9509acbb460Smrg[if test "$have_xmlto" = yes; then 9519acbb460Smrg # scrape the xmlto version 9529acbb460Smrg AC_MSG_CHECKING([the xmlto version]) 9539acbb460Smrg xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3` 9549acbb460Smrg AC_MSG_RESULT([$xmlto_version]) 9559acbb460Smrg AS_VERSION_COMPARE([$xmlto_version], [$1], 9569acbb460Smrg [if test "x$use_xmlto" = xauto; then 9579acbb460Smrg AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed]) 9589acbb460Smrg have_xmlto=no 9599acbb460Smrg else 9609acbb460Smrg AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed]) 9619acbb460Smrg fi]) 9629acbb460Smrgfi]) 96332034fa5Smrg 9649acbb460Smrg# Test for the ability of xmlto to generate a text target 9659acbb460Smrghave_xmlto_text=no 9669acbb460Smrgcat > conftest.xml << "EOF" 9679acbb460SmrgEOF 9689acbb460SmrgAS_IF([test "$have_xmlto" = yes], 9699acbb460Smrg [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1], 9709acbb460Smrg [have_xmlto_text=yes], 9719acbb460Smrg [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])]) 9729acbb460Smrgrm -f conftest.xml 9739acbb460SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes]) 9749acbb460SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes]) 9759acbb460Smrg]) # XORG_WITH_XMLTO 9769acbb460Smrg 9779acbb460Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT]) 9789acbb460Smrg# ---------------- 9799acbb460Smrg# Minimum version: 1.5.0 9809acbb460Smrg# Minimum version for optional DEFAULT argument: 1.11.0 9819acbb460Smrg# 9829acbb460Smrg# Documentation tools are not always available on all platforms and sometimes 9839acbb460Smrg# not at the appropriate level. This macro enables a module to test for the 9849acbb460Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 9859acbb460Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions 9869acbb460Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified, 9879acbb460Smrg# --with-asciidoc assumes 'auto'. 9889acbb460Smrg# 9899acbb460Smrg# Interface to module: 9909acbb460Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation 9919acbb460Smrg# ASCIIDOC: returns the path of the asciidoc program found 9929acbb460Smrg# returns the path set by the user in the environment 9939acbb460Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc 9949acbb460Smrg# 'no' user instructs the module not to use asciidoc 9959acbb460Smrg# 9969acbb460Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path. 9979acbb460Smrg# 9989acbb460SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[ 9999acbb460SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command]) 10009acbb460Smrgm4_define([_defopt], m4_default([$2], [auto])) 10019acbb460SmrgAC_ARG_WITH(asciidoc, 10029acbb460Smrg AS_HELP_STRING([--with-asciidoc], 10039acbb460Smrg [Use asciidoc to regenerate documentation (default: ]_defopt[)]), 10049acbb460Smrg [use_asciidoc=$withval], [use_asciidoc=]_defopt) 10059acbb460Smrgm4_undefine([_defopt]) 10069acbb460Smrg 10079acbb460Smrgif test "x$use_asciidoc" = x"auto"; then 10089acbb460Smrg AC_PATH_PROG([ASCIIDOC], [asciidoc]) 10099acbb460Smrg if test "x$ASCIIDOC" = "x"; then 10109acbb460Smrg AC_MSG_WARN([asciidoc not found - documentation targets will be skipped]) 10119acbb460Smrg have_asciidoc=no 10129acbb460Smrg else 10139acbb460Smrg have_asciidoc=yes 10149acbb460Smrg fi 10159acbb460Smrgelif test "x$use_asciidoc" = x"yes" ; then 10169acbb460Smrg AC_PATH_PROG([ASCIIDOC], [asciidoc]) 10179acbb460Smrg if test "x$ASCIIDOC" = "x"; then 10189acbb460Smrg AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH]) 10199acbb460Smrg fi 10209acbb460Smrg have_asciidoc=yes 10219acbb460Smrgelif test "x$use_asciidoc" = x"no" ; then 10229acbb460Smrg if test "x$ASCIIDOC" != "x"; then 10239acbb460Smrg AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified]) 10249acbb460Smrg fi 10259acbb460Smrg have_asciidoc=no 10269acbb460Smrgelse 10279acbb460Smrg AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no']) 10289acbb460Smrgfi 10299acbb460Smrgm4_ifval([$1], 10309acbb460Smrg[if test "$have_asciidoc" = yes; then 10319acbb460Smrg # scrape the asciidoc version 10329acbb460Smrg AC_MSG_CHECKING([the asciidoc version]) 10339acbb460Smrg asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2` 10349acbb460Smrg AC_MSG_RESULT([$asciidoc_version]) 10359acbb460Smrg AS_VERSION_COMPARE([$asciidoc_version], [$1], 10369acbb460Smrg [if test "x$use_asciidoc" = xauto; then 10379acbb460Smrg AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed]) 10389acbb460Smrg have_asciidoc=no 10399acbb460Smrg else 10409acbb460Smrg AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed]) 10419acbb460Smrg fi]) 10429acbb460Smrgfi]) 10439acbb460SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes]) 10449acbb460Smrg]) # XORG_WITH_ASCIIDOC 10459acbb460Smrg 10469acbb460Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT]) 10479acbb460Smrg# -------------------------------- 10489acbb460Smrg# Minimum version: 1.5.0 10499acbb460Smrg# Minimum version for optional DEFAULT argument: 1.11.0 10509acbb460Smrg# 10519acbb460Smrg# Documentation tools are not always available on all platforms and sometimes 10529acbb460Smrg# not at the appropriate level. This macro enables a module to test for the 10539acbb460Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 10549acbb460Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions 10559acbb460Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified, 10569acbb460Smrg# --with-doxygen assumes 'auto'. 10579acbb460Smrg# 10589acbb460Smrg# Interface to module: 10599acbb460Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation 10609acbb460Smrg# DOXYGEN: returns the path of the doxygen program found 10619acbb460Smrg# returns the path set by the user in the environment 10629acbb460Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen 10639acbb460Smrg# 'no' user instructs the module not to use doxygen 10649acbb460Smrg# 10659acbb460Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path. 10669acbb460Smrg# 10679acbb460SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[ 10689acbb460SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command]) 10699acbb460Smrgm4_define([_defopt], m4_default([$2], [auto])) 10709acbb460SmrgAC_ARG_WITH(doxygen, 10719acbb460Smrg AS_HELP_STRING([--with-doxygen], 10729acbb460Smrg [Use doxygen to regenerate documentation (default: ]_defopt[)]), 10739acbb460Smrg [use_doxygen=$withval], [use_doxygen=]_defopt) 10749acbb460Smrgm4_undefine([_defopt]) 10759acbb460Smrg 10769acbb460Smrgif test "x$use_doxygen" = x"auto"; then 10779acbb460Smrg AC_PATH_PROG([DOXYGEN], [doxygen]) 10789acbb460Smrg if test "x$DOXYGEN" = "x"; then 10799acbb460Smrg AC_MSG_WARN([doxygen not found - documentation targets will be skipped]) 10809acbb460Smrg have_doxygen=no 10819acbb460Smrg else 10829acbb460Smrg have_doxygen=yes 10839acbb460Smrg fi 10849acbb460Smrgelif test "x$use_doxygen" = x"yes" ; then 10859acbb460Smrg AC_PATH_PROG([DOXYGEN], [doxygen]) 10869acbb460Smrg if test "x$DOXYGEN" = "x"; then 10879acbb460Smrg AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH]) 10889acbb460Smrg fi 10899acbb460Smrg have_doxygen=yes 10909acbb460Smrgelif test "x$use_doxygen" = x"no" ; then 10919acbb460Smrg if test "x$DOXYGEN" != "x"; then 10929acbb460Smrg AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified]) 10939acbb460Smrg fi 10949acbb460Smrg have_doxygen=no 10959acbb460Smrgelse 10969acbb460Smrg AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no']) 10979acbb460Smrgfi 10989acbb460Smrgm4_ifval([$1], 10999acbb460Smrg[if test "$have_doxygen" = yes; then 11009acbb460Smrg # scrape the doxygen version 11019acbb460Smrg AC_MSG_CHECKING([the doxygen version]) 11029acbb460Smrg doxygen_version=`$DOXYGEN --version 2>/dev/null` 11039acbb460Smrg AC_MSG_RESULT([$doxygen_version]) 11049acbb460Smrg AS_VERSION_COMPARE([$doxygen_version], [$1], 11059acbb460Smrg [if test "x$use_doxygen" = xauto; then 11069acbb460Smrg AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed]) 11079acbb460Smrg have_doxygen=no 11089acbb460Smrg else 11099acbb460Smrg AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed]) 11109acbb460Smrg fi]) 11119acbb460Smrgfi]) 11129acbb460SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes]) 11139acbb460Smrg]) # XORG_WITH_DOXYGEN 111432034fa5Smrg 11159acbb460Smrg# XORG_WITH_GROFF([DEFAULT]) 11169acbb460Smrg# ---------------- 11179acbb460Smrg# Minimum version: 1.6.0 11189acbb460Smrg# Minimum version for optional DEFAULT argument: 1.11.0 11199acbb460Smrg# 11209acbb460Smrg# Documentation tools are not always available on all platforms and sometimes 11219acbb460Smrg# not at the appropriate level. This macro enables a module to test for the 11229acbb460Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 11239acbb460Smrg# the --with-groff option, it allows maximum flexibilty in making decisions 11249acbb460Smrg# as whether or not to use the groff package. When DEFAULT is not specified, 11259acbb460Smrg# --with-groff assumes 'auto'. 11269acbb460Smrg# 11279acbb460Smrg# Interface to module: 11289acbb460Smrg# HAVE_GROFF: used in makefiles to conditionally generate documentation 11299acbb460Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package 11309acbb460Smrg# HAVE_GROFF_MS: the -ms macros package 11319acbb460Smrg# GROFF: returns the path of the groff program found 11329acbb460Smrg# returns the path set by the user in the environment 11339acbb460Smrg# --with-groff: 'yes' user instructs the module to use groff 11349acbb460Smrg# 'no' user instructs the module not to use groff 11359acbb460Smrg# 11369acbb460Smrg# Added in version 1.9.0: 11379acbb460Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format: 11389acbb460Smrg# pnmcut pnmcrop pnmtopng pnmtops from the netpbm package. 11399acbb460Smrg# psselect from the psutils package. 11409acbb460Smrg# the ghostcript package. Refer to the grohtml man pages 11419acbb460Smrg# 11429acbb460Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path. 11439acbb460Smrg# 11449acbb460Smrg# OS and distros often splits groff in a basic and full package, the former 11459acbb460Smrg# having the groff program and the later having devices, fonts and macros 11469acbb460Smrg# Checking for the groff executable is not enough. 11479acbb460Smrg# 11489acbb460Smrg# If macros are missing, we cannot assume that groff is useless, so we don't 11499acbb460Smrg# unset HAVE_GROFF or GROFF env variables. 11509acbb460Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false. 11519acbb460Smrg# 11529acbb460SmrgAC_DEFUN([XORG_WITH_GROFF],[ 11539acbb460SmrgAC_ARG_VAR([GROFF], [Path to groff command]) 11549acbb460Smrgm4_define([_defopt], m4_default([$1], [auto])) 11559acbb460SmrgAC_ARG_WITH(groff, 11569acbb460Smrg AS_HELP_STRING([--with-groff], 11579acbb460Smrg [Use groff to regenerate documentation (default: ]_defopt[)]), 11589acbb460Smrg [use_groff=$withval], [use_groff=]_defopt) 11599acbb460Smrgm4_undefine([_defopt]) 11609acbb460Smrg 11619acbb460Smrgif test "x$use_groff" = x"auto"; then 11629acbb460Smrg AC_PATH_PROG([GROFF], [groff]) 11639acbb460Smrg if test "x$GROFF" = "x"; then 11649acbb460Smrg AC_MSG_WARN([groff not found - documentation targets will be skipped]) 11659acbb460Smrg have_groff=no 11669acbb460Smrg else 11679acbb460Smrg have_groff=yes 11689acbb460Smrg fi 11699acbb460Smrgelif test "x$use_groff" = x"yes" ; then 11709acbb460Smrg AC_PATH_PROG([GROFF], [groff]) 11719acbb460Smrg if test "x$GROFF" = "x"; then 11729acbb460Smrg AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH]) 11739acbb460Smrg fi 11749acbb460Smrg have_groff=yes 11759acbb460Smrgelif test "x$use_groff" = x"no" ; then 11769acbb460Smrg if test "x$GROFF" != "x"; then 11779acbb460Smrg AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified]) 11789acbb460Smrg fi 11799acbb460Smrg have_groff=no 11809acbb460Smrgelse 11819acbb460Smrg AC_MSG_ERROR([--with-groff expects 'yes' or 'no']) 11829acbb460Smrgfi 118332034fa5Smrg 11849acbb460Smrg# We have groff, test for the presence of the macro packages 11859acbb460Smrgif test "x$have_groff" = x"yes"; then 11869acbb460Smrg AC_MSG_CHECKING([for ${GROFF} -ms macros]) 11879acbb460Smrg if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then 11889acbb460Smrg groff_ms_works=yes 11899acbb460Smrg else 11909acbb460Smrg groff_ms_works=no 11919acbb460Smrg fi 11929acbb460Smrg AC_MSG_RESULT([$groff_ms_works]) 11939acbb460Smrg AC_MSG_CHECKING([for ${GROFF} -mm macros]) 11949acbb460Smrg if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then 11959acbb460Smrg groff_mm_works=yes 11969acbb460Smrg else 11979acbb460Smrg groff_mm_works=no 11989acbb460Smrg fi 11999acbb460Smrg AC_MSG_RESULT([$groff_mm_works]) 12009acbb460Smrgfi 120132034fa5Smrg 12029acbb460Smrg# We have groff, test for HTML dependencies, one command per package 12039acbb460Smrgif test "x$have_groff" = x"yes"; then 12049acbb460Smrg AC_PATH_PROGS(GS_PATH, [gs gswin32c]) 12059acbb460Smrg AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng]) 12069acbb460Smrg AC_PATH_PROG(PSSELECT_PATH, [psselect]) 12079acbb460Smrg if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then 12089acbb460Smrg have_groff_html=yes 12099acbb460Smrg else 12109acbb460Smrg have_groff_html=no 12119acbb460Smrg AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages]) 12129acbb460Smrg fi 12139acbb460Smrgfi 121432034fa5Smrg 12159acbb460Smrg# Set Automake conditionals for Makefiles 12169acbb460SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes]) 12179acbb460SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes]) 12189acbb460SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes]) 12199acbb460SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes]) 12209acbb460Smrg]) # XORG_WITH_GROFF 122132034fa5Smrg 12229acbb460Smrg# XORG_WITH_FOP([DEFAULT]) 12239acbb460Smrg# ---------------- 12249acbb460Smrg# Minimum version: 1.6.0 12259acbb460Smrg# Minimum version for optional DEFAULT argument: 1.11.0 12269acbb460Smrg# 12279acbb460Smrg# Documentation tools are not always available on all platforms and sometimes 12289acbb460Smrg# not at the appropriate level. This macro enables a module to test for the 12299acbb460Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 12309acbb460Smrg# the --with-fop option, it allows maximum flexibilty in making decisions 12319acbb460Smrg# as whether or not to use the fop package. When DEFAULT is not specified, 12329acbb460Smrg# --with-fop assumes 'auto'. 12339acbb460Smrg# 12349acbb460Smrg# Interface to module: 12359acbb460Smrg# HAVE_FOP: used in makefiles to conditionally generate documentation 12369acbb460Smrg# FOP: returns the path of the fop program found 12379acbb460Smrg# returns the path set by the user in the environment 12389acbb460Smrg# --with-fop: 'yes' user instructs the module to use fop 12399acbb460Smrg# 'no' user instructs the module not to use fop 12409acbb460Smrg# 12419acbb460Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path. 12429acbb460Smrg# 12439acbb460SmrgAC_DEFUN([XORG_WITH_FOP],[ 12449acbb460SmrgAC_ARG_VAR([FOP], [Path to fop command]) 12459acbb460Smrgm4_define([_defopt], m4_default([$1], [auto])) 12469acbb460SmrgAC_ARG_WITH(fop, 12479acbb460Smrg AS_HELP_STRING([--with-fop], 12489acbb460Smrg [Use fop to regenerate documentation (default: ]_defopt[)]), 12499acbb460Smrg [use_fop=$withval], [use_fop=]_defopt) 12509acbb460Smrgm4_undefine([_defopt]) 12519acbb460Smrg 12529acbb460Smrgif test "x$use_fop" = x"auto"; then 12539acbb460Smrg AC_PATH_PROG([FOP], [fop]) 12549acbb460Smrg if test "x$FOP" = "x"; then 12559acbb460Smrg AC_MSG_WARN([fop not found - documentation targets will be skipped]) 12569acbb460Smrg have_fop=no 12579acbb460Smrg else 12589acbb460Smrg have_fop=yes 12599acbb460Smrg fi 12609acbb460Smrgelif test "x$use_fop" = x"yes" ; then 12619acbb460Smrg AC_PATH_PROG([FOP], [fop]) 12629acbb460Smrg if test "x$FOP" = "x"; then 12639acbb460Smrg AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH]) 12649acbb460Smrg fi 12659acbb460Smrg have_fop=yes 12669acbb460Smrgelif test "x$use_fop" = x"no" ; then 12679acbb460Smrg if test "x$FOP" != "x"; then 12689acbb460Smrg AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified]) 12699acbb460Smrg fi 12709acbb460Smrg have_fop=no 12719acbb460Smrgelse 12729acbb460Smrg AC_MSG_ERROR([--with-fop expects 'yes' or 'no']) 12739acbb460Smrgfi 12749acbb460SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes]) 12759acbb460Smrg]) # XORG_WITH_FOP 127632034fa5Smrg 12779acbb460Smrg# XORG_WITH_PS2PDF([DEFAULT]) 12789acbb460Smrg# ---------------- 12799acbb460Smrg# Minimum version: 1.6.0 12809acbb460Smrg# Minimum version for optional DEFAULT argument: 1.11.0 12819acbb460Smrg# 12829acbb460Smrg# Documentation tools are not always available on all platforms and sometimes 12839acbb460Smrg# not at the appropriate level. This macro enables a module to test for the 12849acbb460Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 12859acbb460Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions 12869acbb460Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified, 12879acbb460Smrg# --with-ps2pdf assumes 'auto'. 12889acbb460Smrg# 12899acbb460Smrg# Interface to module: 12909acbb460Smrg# HAVE_PS2PDF: used in makefiles to conditionally generate documentation 12919acbb460Smrg# PS2PDF: returns the path of the ps2pdf program found 12929acbb460Smrg# returns the path set by the user in the environment 12939acbb460Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf 12949acbb460Smrg# 'no' user instructs the module not to use ps2pdf 12959acbb460Smrg# 12969acbb460Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path. 12979acbb460Smrg# 12989acbb460SmrgAC_DEFUN([XORG_WITH_PS2PDF],[ 12999acbb460SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command]) 13009acbb460Smrgm4_define([_defopt], m4_default([$1], [auto])) 13019acbb460SmrgAC_ARG_WITH(ps2pdf, 13029acbb460Smrg AS_HELP_STRING([--with-ps2pdf], 13039acbb460Smrg [Use ps2pdf to regenerate documentation (default: ]_defopt[)]), 13049acbb460Smrg [use_ps2pdf=$withval], [use_ps2pdf=]_defopt) 13059acbb460Smrgm4_undefine([_defopt]) 13069acbb460Smrg 13079acbb460Smrgif test "x$use_ps2pdf" = x"auto"; then 13089acbb460Smrg AC_PATH_PROG([PS2PDF], [ps2pdf]) 13099acbb460Smrg if test "x$PS2PDF" = "x"; then 13109acbb460Smrg AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped]) 13119acbb460Smrg have_ps2pdf=no 13129acbb460Smrg else 13139acbb460Smrg have_ps2pdf=yes 13149acbb460Smrg fi 13159acbb460Smrgelif test "x$use_ps2pdf" = x"yes" ; then 13169acbb460Smrg AC_PATH_PROG([PS2PDF], [ps2pdf]) 13179acbb460Smrg if test "x$PS2PDF" = "x"; then 13189acbb460Smrg AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH]) 13199acbb460Smrg fi 13209acbb460Smrg have_ps2pdf=yes 13219acbb460Smrgelif test "x$use_ps2pdf" = x"no" ; then 13229acbb460Smrg if test "x$PS2PDF" != "x"; then 13239acbb460Smrg AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified]) 13249acbb460Smrg fi 13259acbb460Smrg have_ps2pdf=no 13269acbb460Smrgelse 13279acbb460Smrg AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no']) 13289acbb460Smrgfi 13299acbb460SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes]) 13309acbb460Smrg]) # XORG_WITH_PS2PDF 133132034fa5Smrg 13329acbb460Smrg# XORG_ENABLE_DOCS (enable_docs=yes) 13339acbb460Smrg# ---------------- 13349acbb460Smrg# Minimum version: 1.6.0 13359acbb460Smrg# 13369acbb460Smrg# Documentation tools are not always available on all platforms and sometimes 13379acbb460Smrg# not at the appropriate level. This macro enables a builder to skip all 13389acbb460Smrg# documentation targets except traditional man pages. 13399acbb460Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 13409acbb460Smrg# maximum flexibilty in controlling documentation building. 13419acbb460Smrg# Refer to: 13429acbb460Smrg# XORG_WITH_XMLTO --with-xmlto 13439acbb460Smrg# XORG_WITH_ASCIIDOC --with-asciidoc 13449acbb460Smrg# XORG_WITH_DOXYGEN --with-doxygen 13459acbb460Smrg# XORG_WITH_FOP --with-fop 13469acbb460Smrg# XORG_WITH_GROFF --with-groff 13479acbb460Smrg# XORG_WITH_PS2PDF --with-ps2pdf 13489acbb460Smrg# 13499acbb460Smrg# Interface to module: 13509acbb460Smrg# ENABLE_DOCS: used in makefiles to conditionally generate documentation 13519acbb460Smrg# --enable-docs: 'yes' user instructs the module to generate docs 13529acbb460Smrg# 'no' user instructs the module not to generate docs 13539acbb460Smrg# parm1: specify the default value, yes or no. 13549acbb460Smrg# 13559acbb460SmrgAC_DEFUN([XORG_ENABLE_DOCS],[ 13569acbb460Smrgm4_define([default], m4_default([$1], [yes])) 13579acbb460SmrgAC_ARG_ENABLE(docs, 13589acbb460Smrg AS_HELP_STRING([--enable-docs], 13599acbb460Smrg [Enable building the documentation (default: ]default[)]), 13609acbb460Smrg [build_docs=$enableval], [build_docs=]default) 13619acbb460Smrgm4_undefine([default]) 13629acbb460SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes]) 13639acbb460SmrgAC_MSG_CHECKING([whether to build documentation]) 13649acbb460SmrgAC_MSG_RESULT([$build_docs]) 13659acbb460Smrg]) # XORG_ENABLE_DOCS 13669acbb460Smrg 13679acbb460Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes) 13689acbb460Smrg# ---------------- 13699acbb460Smrg# Minimum version: 1.6.0 13709acbb460Smrg# 13719acbb460Smrg# This macro enables a builder to skip all developer documentation. 13729acbb460Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 13739acbb460Smrg# maximum flexibilty in controlling documentation building. 13749acbb460Smrg# Refer to: 13759acbb460Smrg# XORG_WITH_XMLTO --with-xmlto 13769acbb460Smrg# XORG_WITH_ASCIIDOC --with-asciidoc 13779acbb460Smrg# XORG_WITH_DOXYGEN --with-doxygen 13789acbb460Smrg# XORG_WITH_FOP --with-fop 13799acbb460Smrg# XORG_WITH_GROFF --with-groff 13809acbb460Smrg# XORG_WITH_PS2PDF --with-ps2pdf 13819acbb460Smrg# 13829acbb460Smrg# Interface to module: 13839acbb460Smrg# ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs 13849acbb460Smrg# --enable-devel-docs: 'yes' user instructs the module to generate developer docs 13859acbb460Smrg# 'no' user instructs the module not to generate developer docs 13869acbb460Smrg# parm1: specify the default value, yes or no. 13879acbb460Smrg# 13889acbb460SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[ 13899acbb460Smrgm4_define([devel_default], m4_default([$1], [yes])) 13909acbb460SmrgAC_ARG_ENABLE(devel-docs, 13919acbb460Smrg AS_HELP_STRING([--enable-devel-docs], 13929acbb460Smrg [Enable building the developer documentation (default: ]devel_default[)]), 13939acbb460Smrg [build_devel_docs=$enableval], [build_devel_docs=]devel_default) 13949acbb460Smrgm4_undefine([devel_default]) 13959acbb460SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes]) 13969acbb460SmrgAC_MSG_CHECKING([whether to build developer documentation]) 13979acbb460SmrgAC_MSG_RESULT([$build_devel_docs]) 13989acbb460Smrg]) # XORG_ENABLE_DEVEL_DOCS 13999acbb460Smrg 14009acbb460Smrg# XORG_ENABLE_SPECS (enable_specs=yes) 14019acbb460Smrg# ---------------- 14029acbb460Smrg# Minimum version: 1.6.0 14039acbb460Smrg# 14049acbb460Smrg# This macro enables a builder to skip all functional specification targets. 14059acbb460Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 14069acbb460Smrg# maximum flexibilty in controlling documentation building. 14079acbb460Smrg# Refer to: 14089acbb460Smrg# XORG_WITH_XMLTO --with-xmlto 14099acbb460Smrg# XORG_WITH_ASCIIDOC --with-asciidoc 14109acbb460Smrg# XORG_WITH_DOXYGEN --with-doxygen 14119acbb460Smrg# XORG_WITH_FOP --with-fop 14129acbb460Smrg# XORG_WITH_GROFF --with-groff 14139acbb460Smrg# XORG_WITH_PS2PDF --with-ps2pdf 14149acbb460Smrg# 14159acbb460Smrg# Interface to module: 14169acbb460Smrg# ENABLE_SPECS: used in makefiles to conditionally generate specs 14179acbb460Smrg# --enable-specs: 'yes' user instructs the module to generate specs 14189acbb460Smrg# 'no' user instructs the module not to generate specs 14199acbb460Smrg# parm1: specify the default value, yes or no. 14209acbb460Smrg# 14219acbb460SmrgAC_DEFUN([XORG_ENABLE_SPECS],[ 14229acbb460Smrgm4_define([spec_default], m4_default([$1], [yes])) 14239acbb460SmrgAC_ARG_ENABLE(specs, 14249acbb460Smrg AS_HELP_STRING([--enable-specs], 14259acbb460Smrg [Enable building the specs (default: ]spec_default[)]), 14269acbb460Smrg [build_specs=$enableval], [build_specs=]spec_default) 14279acbb460Smrgm4_undefine([spec_default]) 14289acbb460SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes]) 14299acbb460SmrgAC_MSG_CHECKING([whether to build functional specifications]) 14309acbb460SmrgAC_MSG_RESULT([$build_specs]) 14319acbb460Smrg]) # XORG_ENABLE_SPECS 143232034fa5Smrg 14339acbb460Smrg# XORG_CHECK_MALLOC_ZERO 14349acbb460Smrg# ---------------------- 14359acbb460Smrg# Minimum version: 1.0.0 14369acbb460Smrg# 14379acbb460Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if 14389acbb460Smrg# malloc(0) returns NULL. Packages should add one of these cflags to 14399acbb460Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. 14409acbb460SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[ 14419acbb460SmrgAC_ARG_ENABLE(malloc0returnsnull, 14429acbb460Smrg AS_HELP_STRING([--enable-malloc0returnsnull], 14439acbb460Smrg [malloc(0) returns NULL (default: auto)]), 14449acbb460Smrg [MALLOC_ZERO_RETURNS_NULL=$enableval], 14459acbb460Smrg [MALLOC_ZERO_RETURNS_NULL=auto]) 144632034fa5Smrg 14479acbb460SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL]) 14489acbb460Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then 14499acbb460Smrg AC_RUN_IFELSE([ 14509acbb460Smrgchar *malloc(); 14519acbb460Smrgchar *realloc(); 14529acbb460Smrgchar *calloc(); 14539acbb460Smrgmain() { 14549acbb460Smrg char *m0, *r0, *c0, *p; 14559acbb460Smrg m0 = malloc(0); 14569acbb460Smrg p = malloc(10); 14579acbb460Smrg r0 = realloc(p,0); 14589acbb460Smrg c0 = calloc(0); 14599acbb460Smrg exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1); 14609acbb460Smrg}], 14619acbb460Smrg [MALLOC_ZERO_RETURNS_NULL=yes], 14629acbb460Smrg [MALLOC_ZERO_RETURNS_NULL=no], 14639acbb460Smrg [MALLOC_ZERO_RETURNS_NULL=yes]) 14649acbb460Smrgfi 14659acbb460SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) 146632034fa5Smrg 14679acbb460Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then 14689acbb460Smrg MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" 14699acbb460Smrg XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS 14709acbb460Smrg XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" 14719acbb460Smrgelse 14729acbb460Smrg MALLOC_ZERO_CFLAGS="" 14739acbb460Smrg XMALLOC_ZERO_CFLAGS="" 14749acbb460Smrg XTMALLOC_ZERO_CFLAGS="" 14759acbb460Smrgfi 14769acbb460Smrg 14779acbb460SmrgAC_SUBST([MALLOC_ZERO_CFLAGS]) 14789acbb460SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS]) 14799acbb460SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS]) 14809acbb460Smrg]) # XORG_CHECK_MALLOC_ZERO 148132034fa5Smrg 14829acbb460Smrg# XORG_WITH_LINT() 14839acbb460Smrg# ---------------- 148432034fa5Smrg# Minimum version: 1.1.0 148532034fa5Smrg# 14869acbb460Smrg# This macro enables the use of a tool that flags some suspicious and 14879acbb460Smrg# non-portable constructs (likely to be bugs) in C language source code. 14889acbb460Smrg# It will attempt to locate the tool and use appropriate options. 14899acbb460Smrg# There are various lint type tools on different platforms. 149032034fa5Smrg# 14919acbb460Smrg# Interface to module: 14929acbb460Smrg# LINT: returns the path to the tool found on the platform 14939acbb460Smrg# or the value set to LINT on the configure cmd line 14949acbb460Smrg# also an Automake conditional 14959acbb460Smrg# LINT_FLAGS: an Automake variable with appropriate flags 149632034fa5Smrg# 14979acbb460Smrg# --with-lint: 'yes' user instructs the module to use lint 14989acbb460Smrg# 'no' user instructs the module not to use lint (default) 149932034fa5Smrg# 15009acbb460Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path. 15019acbb460Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim. 15029acbb460Smrg# 15039acbb460SmrgAC_DEFUN([XORG_WITH_LINT],[ 150432034fa5Smrg 15059acbb460SmrgAC_ARG_VAR([LINT], [Path to a lint-style command]) 15069acbb460SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command]) 15079acbb460SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint], 15089acbb460Smrg [Use a lint-style source code checker (default: disabled)])], 15099acbb460Smrg [use_lint=$withval], [use_lint=no]) 151032034fa5Smrg 15119acbb460Smrg# Obtain platform specific info like program name and options 15129acbb460Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris 15139acbb460Smrgcase $host_os in 15149acbb460Smrg *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*) 15159acbb460Smrg lint_name=splint 15169acbb460Smrg lint_options="-badflag" 15179acbb460Smrg ;; 15189acbb460Smrg *freebsd* | *netbsd*) 15199acbb460Smrg lint_name=lint 15209acbb460Smrg lint_options="-u -b" 15219acbb460Smrg ;; 15229acbb460Smrg *solaris*) 15239acbb460Smrg lint_name=lint 15249acbb460Smrg lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2" 15259acbb460Smrg ;; 15269acbb460Smrgesac 152732034fa5Smrg 15289acbb460Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user) 15299acbb460Smrgif test "x$use_lint" = x"yes" ; then 15309acbb460Smrg AC_PATH_PROG([LINT], [$lint_name]) 15319acbb460Smrg if test "x$LINT" = "x"; then 15329acbb460Smrg AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH]) 15339acbb460Smrg fi 15349acbb460Smrgelif test "x$use_lint" = x"no" ; then 15359acbb460Smrg if test "x$LINT" != "x"; then 15369acbb460Smrg AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified]) 15379acbb460Smrg fi 15389acbb460Smrgelse 15399acbb460Smrg AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.]) 15409acbb460Smrgfi 154132034fa5Smrg 15429acbb460Smrg# User supplied flags override default flags 15439acbb460Smrgif test "x$LINT_FLAGS" != "x"; then 15449acbb460Smrg lint_options=$LINT_FLAGS 15459acbb460Smrgfi 154632034fa5Smrg 15479acbb460SmrgAC_SUBST([LINT_FLAGS],[$lint_options]) 15489acbb460SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x]) 154932034fa5Smrg 15509acbb460Smrg]) # XORG_WITH_LINT 155132034fa5Smrg 15529acbb460Smrg# XORG_LINT_LIBRARY(LIBNAME) 15539acbb460Smrg# -------------------------- 155432034fa5Smrg# Minimum version: 1.1.0 155532034fa5Smrg# 15569acbb460Smrg# Sets up flags for building lint libraries for checking programs that call 15579acbb460Smrg# functions in the library. 155832034fa5Smrg# 15599acbb460Smrg# Interface to module: 15609acbb460Smrg# LINTLIB - Automake variable with the name of lint library file to make 15619acbb460Smrg# MAKE_LINT_LIB - Automake conditional 156232034fa5Smrg# 15639acbb460Smrg# --enable-lint-library: - 'yes' user instructs the module to created a lint library 15649acbb460Smrg# - 'no' user instructs the module not to create a lint library (default) 156532034fa5Smrg 15669acbb460SmrgAC_DEFUN([XORG_LINT_LIBRARY],[ 15679acbb460SmrgAC_REQUIRE([XORG_WITH_LINT]) 15689acbb460SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library], 15699acbb460Smrg [Create lint library (default: disabled)])], 15709acbb460Smrg [make_lint_lib=$enableval], [make_lint_lib=no]) 157132034fa5Smrg 15729acbb460Smrgif test "x$make_lint_lib" = x"yes" ; then 15739acbb460Smrg LINTLIB=llib-l$1.ln 15749acbb460Smrg if test "x$LINT" = "x"; then 15759acbb460Smrg AC_MSG_ERROR([Cannot make lint library without --with-lint]) 15769acbb460Smrg fi 15779acbb460Smrgelif test "x$make_lint_lib" != x"no" ; then 15789acbb460Smrg AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.]) 15799acbb460Smrgfi 158032034fa5Smrg 15819acbb460SmrgAC_SUBST(LINTLIB) 15829acbb460SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno]) 158332034fa5Smrg 15849acbb460Smrg]) # XORG_LINT_LIBRARY 158532034fa5Smrg 15869acbb460Smrg# XORG_CWARNFLAGS 15879acbb460Smrg# --------------- 15889acbb460Smrg# Minimum version: 1.2.0 158932034fa5Smrg# 15909acbb460Smrg# Defines CWARNFLAGS to enable C compiler warnings. 159132034fa5Smrg# 15929acbb460SmrgAC_DEFUN([XORG_CWARNFLAGS], [ 15939acbb460SmrgAC_REQUIRE([AC_PROG_CC_C99]) 15949acbb460Smrgif test "x$GCC" = xyes ; then 15959acbb460Smrg CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \ 15969acbb460Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \ 15979acbb460Smrg-Wbad-function-cast -Wformat=2" 15989acbb460Smrg case `$CC -dumpversion` in 15999acbb460Smrg 3.4.* | 4.*) 16009acbb460Smrg CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement" 16019acbb460Smrg ;; 16029acbb460Smrg esac 16039acbb460Smrgelse 16049acbb460Smrg AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) 16059acbb460Smrg if test "x$SUNCC" = "xyes"; then 16069acbb460Smrg CWARNFLAGS="-v" 16079acbb460Smrg fi 16089acbb460Smrgfi 16099acbb460SmrgAC_SUBST(CWARNFLAGS) 16109acbb460Smrg]) # XORG_CWARNFLAGS 161132034fa5Smrg 16129acbb460Smrg# XORG_STRICT_OPTION 16139acbb460Smrg# ----------------------- 16149acbb460Smrg# Minimum version: 1.3.0 161532034fa5Smrg# 16169acbb460Smrg# Add configure option to enable strict compilation 16179acbb460SmrgAC_DEFUN([XORG_STRICT_OPTION], [ 16189acbb460Smrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89 16199acbb460SmrgAC_REQUIRE([AC_PROG_CC_C99]) 16209acbb460SmrgAC_REQUIRE([XORG_CWARNFLAGS]) 162132034fa5Smrg 16229acbb460SmrgAC_ARG_ENABLE(strict-compilation, 16239acbb460Smrg AS_HELP_STRING([--enable-strict-compilation], 16249acbb460Smrg [Enable all warnings from compiler and make them errors (default: disabled)]), 16259acbb460Smrg [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no]) 16269acbb460Smrgif test "x$STRICT_COMPILE" = "xyes"; then 16279acbb460Smrg AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) 16289acbb460Smrg AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"]) 16299acbb460Smrg if test "x$GCC" = xyes ; then 16309acbb460Smrg STRICT_CFLAGS="-pedantic -Werror" 16319acbb460Smrg elif test "x$SUNCC" = "xyes"; then 16329acbb460Smrg STRICT_CFLAGS="-errwarn" 16339acbb460Smrg elif test "x$INTELCC" = "xyes"; then 16349acbb460Smrg STRICT_CFLAGS="-Werror" 16359acbb460Smrg fi 16369acbb460Smrgfi 16379acbb460SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS" 16389acbb460SmrgAC_SUBST([CWARNFLAGS]) 16399acbb460Smrg]) # XORG_STRICT_OPTION 164032034fa5Smrg 16419acbb460Smrg# XORG_DEFAULT_OPTIONS 164232034fa5Smrg# -------------------- 16439acbb460Smrg# Minimum version: 1.3.0 164432034fa5Smrg# 16459acbb460Smrg# Defines default options for X.Org modules. 16469acbb460Smrg# 16479acbb460SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [ 16489acbb460SmrgAC_REQUIRE([AC_PROG_INSTALL]) 16499acbb460SmrgXORG_CWARNFLAGS 16509acbb460SmrgXORG_STRICT_OPTION 16519acbb460SmrgXORG_RELEASE_VERSION 16529acbb460SmrgXORG_CHANGELOG 16539acbb460SmrgXORG_INSTALL 16549acbb460SmrgXORG_MANPAGE_SECTIONS 16559acbb460Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], 16569acbb460Smrg [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) 16579acbb460Smrg]) # XORG_DEFAULT_OPTIONS 165832034fa5Smrg 16599acbb460Smrg# XORG_INSTALL() 16609acbb460Smrg# ---------------- 16619acbb460Smrg# Minimum version: 1.4.0 16629acbb460Smrg# 16639acbb460Smrg# Defines the variable INSTALL_CMD as the command to copy 16649acbb460Smrg# INSTALL from $prefix/share/util-macros. 16659acbb460Smrg# 16669acbb460SmrgAC_DEFUN([XORG_INSTALL], [ 16679acbb460SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG]) 16689acbb460Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` 16699acbb460SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ 16709acbb460Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ 16719acbb460Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \ 16729acbb460Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)" 16739acbb460SmrgAC_SUBST([INSTALL_CMD]) 16749acbb460Smrg]) # XORG_INSTALL 16759acbb460Smrgdnl Copyright 2005 Red Hat, Inc 16769acbb460Smrgdnl 16779acbb460Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its 16789acbb460Smrgdnl documentation for any purpose is hereby granted without fee, provided that 16799acbb460Smrgdnl the above copyright notice appear in all copies and that both that 16809acbb460Smrgdnl copyright notice and this permission notice appear in supporting 16819acbb460Smrgdnl documentation. 16829acbb460Smrgdnl 16839acbb460Smrgdnl The above copyright notice and this permission notice shall be included 16849acbb460Smrgdnl in all copies or substantial portions of the Software. 16859acbb460Smrgdnl 16869acbb460Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 16879acbb460Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16889acbb460Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16899acbb460Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 16909acbb460Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 16919acbb460Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 16929acbb460Smrgdnl OTHER DEALINGS IN THE SOFTWARE. 16939acbb460Smrgdnl 16949acbb460Smrgdnl Except as contained in this notice, the name of the copyright holders shall 16959acbb460Smrgdnl not be used in advertising or otherwise to promote the sale, use or 16969acbb460Smrgdnl other dealings in this Software without prior written authorization 16979acbb460Smrgdnl from the copyright holders. 16989acbb460Smrgdnl 169932034fa5Smrg 17009acbb460Smrg# XORG_RELEASE_VERSION 17019acbb460Smrg# -------------------- 17029acbb460Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use. 17039acbb460Smrg 17049acbb460SmrgAC_DEFUN([XORG_RELEASE_VERSION],[ 17059acbb460Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR], 17069acbb460Smrg [`echo $PACKAGE_VERSION | cut -d . -f 1`], 17079acbb460Smrg [Major version of this package]) 17089acbb460Smrg PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` 17099acbb460Smrg if test "x$PVM" = "x"; then 17109acbb460Smrg PVM="0" 171132034fa5Smrg fi 17129acbb460Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR], 17139acbb460Smrg [$PVM], 17149acbb460Smrg [Minor version of this package]) 17159acbb460Smrg PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` 17169acbb460Smrg if test "x$PVP" = "x"; then 17179acbb460Smrg PVP="0" 171832034fa5Smrg fi 17199acbb460Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL], 17209acbb460Smrg [$PVP], 17219acbb460Smrg [Patch version of this package]) 172232034fa5Smrg]) 172332034fa5Smrg 17249acbb460Smrg# XORG_CHANGELOG() 17259acbb460Smrg# ---------------- 17269acbb460Smrg# Minimum version: 1.2.0 172732034fa5Smrg# 17289acbb460Smrg# Defines the variable CHANGELOG_CMD as the command to generate 17299acbb460Smrg# ChangeLog from git. 17309acbb460Smrg# 17319acbb460Smrg# 17329acbb460SmrgAC_DEFUN([XORG_CHANGELOG], [ 17339acbb460SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \ 17349acbb460Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ 17359acbb460Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \ 17369acbb460Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)" 17379acbb460SmrgAC_SUBST([CHANGELOG_CMD]) 17389acbb460Smrg]) # XORG_CHANGELOG 173932034fa5Smrg 17409acbb460Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. 17419acbb460Smrg# 17429acbb460Smrg# This file is free software; the Free Software Foundation 17439acbb460Smrg# gives unlimited permission to copy and/or distribute it, 17449acbb460Smrg# with or without modifications, as long as this notice is preserved. 174532034fa5Smrg 17469acbb460Smrg# AM_AUTOMAKE_VERSION(VERSION) 17479acbb460Smrg# ---------------------------- 17489acbb460Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been 17499acbb460Smrg# generated from the m4 files accompanying Automake X.Y. 17509acbb460Smrg# (This private macro should not be called outside this file.) 17519acbb460SmrgAC_DEFUN([AM_AUTOMAKE_VERSION], 17529acbb460Smrg[am__api_version='1.11' 17539acbb460Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to 17549acbb460Smrgdnl require some minimum version. Point them to the right macro. 17559acbb460Smrgm4_if([$1], [1.11.1], [], 17569acbb460Smrg [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl 17579acbb460Smrg]) 175832034fa5Smrg 17599acbb460Smrg# _AM_AUTOCONF_VERSION(VERSION) 17609acbb460Smrg# ----------------------------- 17619acbb460Smrg# aclocal traces this macro to find the Autoconf version. 17629acbb460Smrg# This is a private macro too. Using m4_define simplifies 17639acbb460Smrg# the logic in aclocal, which can simply ignore this definition. 17649acbb460Smrgm4_define([_AM_AUTOCONF_VERSION], []) 176532034fa5Smrg 17669acbb460Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION 17679acbb460Smrg# ------------------------------- 17689acbb460Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. 17699acbb460Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. 17709acbb460SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 17719acbb460Smrg[AM_AUTOMAKE_VERSION([1.11.1])dnl 17729acbb460Smrgm4_ifndef([AC_AUTOCONF_VERSION], 17739acbb460Smrg [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 17749acbb460Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) 177532034fa5Smrg 17769acbb460Smrg# AM_AUX_DIR_EXPAND -*- Autoconf -*- 177732034fa5Smrg 17789acbb460Smrg# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 177932034fa5Smrg# 17809acbb460Smrg# This file is free software; the Free Software Foundation 17819acbb460Smrg# gives unlimited permission to copy and/or distribute it, 17829acbb460Smrg# with or without modifications, as long as this notice is preserved. 17839acbb460Smrg 17849acbb460Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 17859acbb460Smrg# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to 17869acbb460Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'. 178732034fa5Smrg# 17889acbb460Smrg# Of course, Automake must honor this variable whenever it calls a 17899acbb460Smrg# tool from the auxiliary directory. The problem is that $srcdir (and 17909acbb460Smrg# therefore $ac_aux_dir as well) can be either absolute or relative, 17919acbb460Smrg# depending on how configure is run. This is pretty annoying, since 17929acbb460Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top 17939acbb460Smrg# source directory, any form will work fine, but in subdirectories a 17949acbb460Smrg# relative path needs to be adjusted first. 179532034fa5Smrg# 17969acbb460Smrg# $ac_aux_dir/missing 17979acbb460Smrg# fails when called from a subdirectory if $ac_aux_dir is relative 17989acbb460Smrg# $top_srcdir/$ac_aux_dir/missing 17999acbb460Smrg# fails if $ac_aux_dir is absolute, 18009acbb460Smrg# fails when called from a subdirectory in a VPATH build with 18019acbb460Smrg# a relative $ac_aux_dir 180232034fa5Smrg# 18039acbb460Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir 18049acbb460Smrg# are both prefixed by $srcdir. In an in-source build this is usually 18059acbb460Smrg# harmless because $srcdir is `.', but things will broke when you 18069acbb460Smrg# start a VPATH build or use an absolute $srcdir. 180732034fa5Smrg# 18089acbb460Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 18099acbb460Smrg# iff we strip the leading $srcdir from $ac_aux_dir. That would be: 18109acbb460Smrg# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 18119acbb460Smrg# and then we would define $MISSING as 18129acbb460Smrg# MISSING="\${SHELL} $am_aux_dir/missing" 18139acbb460Smrg# This will work as long as MISSING is not called from configure, because 18149acbb460Smrg# unfortunately $(top_srcdir) has no meaning in configure. 18159acbb460Smrg# However there are other variables, like CC, which are often used in 18169acbb460Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir. 18179acbb460Smrg# 18189acbb460Smrg# Another solution, used here, is to always expand $ac_aux_dir to an 18199acbb460Smrg# absolute PATH. The drawback is that using absolute paths prevent a 18209acbb460Smrg# configured tree to be moved without reconfiguration. 182132034fa5Smrg 18229acbb460SmrgAC_DEFUN([AM_AUX_DIR_EXPAND], 18239acbb460Smrg[dnl Rely on autoconf to set up CDPATH properly. 18249acbb460SmrgAC_PREREQ([2.50])dnl 18259acbb460Smrg# expand $ac_aux_dir to an absolute path 18269acbb460Smrgam_aux_dir=`cd $ac_aux_dir && pwd` 18279acbb460Smrg]) 18289acbb460Smrg 18299acbb460Smrg# AM_CONDITIONAL -*- Autoconf -*- 18309acbb460Smrg 18319acbb460Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 18329acbb460Smrg# Free Software Foundation, Inc. 18339acbb460Smrg# 18349acbb460Smrg# This file is free software; the Free Software Foundation 18359acbb460Smrg# gives unlimited permission to copy and/or distribute it, 18369acbb460Smrg# with or without modifications, as long as this notice is preserved. 183732034fa5Smrg 18389acbb460Smrg# serial 9 18399acbb460Smrg 18409acbb460Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION) 18419acbb460Smrg# ------------------------------------- 18429acbb460Smrg# Define a conditional. 18439acbb460SmrgAC_DEFUN([AM_CONDITIONAL], 18449acbb460Smrg[AC_PREREQ(2.52)dnl 18459acbb460Smrg ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 18469acbb460Smrg [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 18479acbb460SmrgAC_SUBST([$1_TRUE])dnl 18489acbb460SmrgAC_SUBST([$1_FALSE])dnl 18499acbb460Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl 18509acbb460Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl 18519acbb460Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl 18529acbb460Smrgif $2; then 18539acbb460Smrg $1_TRUE= 18549acbb460Smrg $1_FALSE='#' 185532034fa5Smrgelse 18569acbb460Smrg $1_TRUE='#' 18579acbb460Smrg $1_FALSE= 185832034fa5Smrgfi 18599acbb460SmrgAC_CONFIG_COMMANDS_PRE( 18609acbb460Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 18619acbb460Smrg AC_MSG_ERROR([[conditional "$1" was never defined. 18629acbb460SmrgUsually this means the macro was only invoked conditionally.]]) 18639acbb460Smrgfi])]) 186432034fa5Smrg 18659acbb460Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 18669acbb460Smrg# Free Software Foundation, Inc. 186732034fa5Smrg# 18689acbb460Smrg# This file is free software; the Free Software Foundation 18699acbb460Smrg# gives unlimited permission to copy and/or distribute it, 18709acbb460Smrg# with or without modifications, as long as this notice is preserved. 187132034fa5Smrg 18729acbb460Smrg# serial 10 187332034fa5Smrg 18749acbb460Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be 18759acbb460Smrg# written in clear, in which case automake, when reading aclocal.m4, 18769acbb460Smrg# will think it sees a *use*, and therefore will trigger all it's 18779acbb460Smrg# C support machinery. Also note that it means that autoscan, seeing 18789acbb460Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use... 187932034fa5Smrg 188032034fa5Smrg 18819acbb460Smrg# _AM_DEPENDENCIES(NAME) 18829acbb460Smrg# ---------------------- 18839acbb460Smrg# See how the compiler implements dependency checking. 18849acbb460Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC". 18859acbb460Smrg# We try a few techniques and use that to set a single cache variable. 18869acbb460Smrg# 18879acbb460Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was 18889acbb460Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular 18899acbb460Smrg# dependency, and given that the user is not expected to run this macro, 18909acbb460Smrg# just rely on AC_PROG_CC. 18919acbb460SmrgAC_DEFUN([_AM_DEPENDENCIES], 18929acbb460Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl 18939acbb460SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl 18949acbb460SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl 18959acbb460SmrgAC_REQUIRE([AM_DEP_TRACK])dnl 189632034fa5Smrg 18979acbb460Smrgifelse([$1], CC, [depcc="$CC" am_compiler_list=], 18989acbb460Smrg [$1], CXX, [depcc="$CXX" am_compiler_list=], 18999acbb460Smrg [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 19009acbb460Smrg [$1], UPC, [depcc="$UPC" am_compiler_list=], 19019acbb460Smrg [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 19029acbb460Smrg [depcc="$$1" am_compiler_list=]) 190332034fa5Smrg 19049acbb460SmrgAC_CACHE_CHECK([dependency style of $depcc], 19059acbb460Smrg [am_cv_$1_dependencies_compiler_type], 19069acbb460Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then 19079acbb460Smrg # We make a subdir and do the tests there. Otherwise we can end up 19089acbb460Smrg # making bogus files that we don't know about and never remove. For 19099acbb460Smrg # instance it was reported that on HP-UX the gcc test will end up 19109acbb460Smrg # making a dummy file named `D' -- because `-MD' means `put the output 19119acbb460Smrg # in D'. 19129acbb460Smrg mkdir conftest.dir 19139acbb460Smrg # Copy depcomp to subdir because otherwise we won't find it if we're 19149acbb460Smrg # using a relative directory. 19159acbb460Smrg cp "$am_depcomp" conftest.dir 19169acbb460Smrg cd conftest.dir 19179acbb460Smrg # We will build objects and dependencies in a subdirectory because 19189acbb460Smrg # it helps to detect inapplicable dependency modes. For instance 19199acbb460Smrg # both Tru64's cc and ICC support -MD to output dependencies as a 19209acbb460Smrg # side effect of compilation, but ICC will put the dependencies in 19219acbb460Smrg # the current directory while Tru64 will put them in the object 19229acbb460Smrg # directory. 19239acbb460Smrg mkdir sub 192432034fa5Smrg 19259acbb460Smrg am_cv_$1_dependencies_compiler_type=none 19269acbb460Smrg if test "$am_compiler_list" = ""; then 19279acbb460Smrg am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` 19289acbb460Smrg fi 19299acbb460Smrg am__universal=false 19309acbb460Smrg m4_case([$1], [CC], 19319acbb460Smrg [case " $depcc " in #( 19329acbb460Smrg *\ -arch\ *\ -arch\ *) am__universal=true ;; 19339acbb460Smrg esac], 19349acbb460Smrg [CXX], 19359acbb460Smrg [case " $depcc " in #( 19369acbb460Smrg *\ -arch\ *\ -arch\ *) am__universal=true ;; 19379acbb460Smrg esac]) 19389acbb460Smrg 19399acbb460Smrg for depmode in $am_compiler_list; do 19409acbb460Smrg # Setup a source with many dependencies, because some compilers 19419acbb460Smrg # like to wrap large dependency lists on column 80 (with \), and 19429acbb460Smrg # we should not choose a depcomp mode which is confused by this. 19439acbb460Smrg # 19449acbb460Smrg # We need to recreate these files for each test, as the compiler may 19459acbb460Smrg # overwrite some of them when testing with obscure command lines. 19469acbb460Smrg # This happens at least with the AIX C compiler. 19479acbb460Smrg : > sub/conftest.c 19489acbb460Smrg for i in 1 2 3 4 5 6; do 19499acbb460Smrg echo '#include "conftst'$i'.h"' >> sub/conftest.c 19509acbb460Smrg # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with 19519acbb460Smrg # Solaris 8's {/usr,}/bin/sh. 19529acbb460Smrg touch sub/conftst$i.h 19539acbb460Smrg done 19549acbb460Smrg echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 19559acbb460Smrg 19569acbb460Smrg # We check with `-c' and `-o' for the sake of the "dashmstdout" 19579acbb460Smrg # mode. It turns out that the SunPro C++ compiler does not properly 19589acbb460Smrg # handle `-M -o', and we need to detect this. Also, some Intel 19599acbb460Smrg # versions had trouble with output in subdirs 19609acbb460Smrg am__obj=sub/conftest.${OBJEXT-o} 19619acbb460Smrg am__minus_obj="-o $am__obj" 19629acbb460Smrg case $depmode in 19639acbb460Smrg gcc) 19649acbb460Smrg # This depmode causes a compiler race in universal mode. 19659acbb460Smrg test "$am__universal" = false || continue 19669acbb460Smrg ;; 19679acbb460Smrg nosideeffect) 19689acbb460Smrg # after this tag, mechanisms are not by side-effect, so they'll 19699acbb460Smrg # only be used when explicitly requested 19709acbb460Smrg if test "x$enable_dependency_tracking" = xyes; then 19719acbb460Smrg continue 19729acbb460Smrg else 19739acbb460Smrg break 19749acbb460Smrg fi 19759acbb460Smrg ;; 19769acbb460Smrg msvisualcpp | msvcmsys) 19779acbb460Smrg # This compiler won't grok `-c -o', but also, the minuso test has 19789acbb460Smrg # not run yet. These depmodes are late enough in the game, and 19799acbb460Smrg # so weak that their functioning should not be impacted. 19809acbb460Smrg am__obj=conftest.${OBJEXT-o} 19819acbb460Smrg am__minus_obj= 19829acbb460Smrg ;; 19839acbb460Smrg none) break ;; 198432034fa5Smrg esac 19859acbb460Smrg if depmode=$depmode \ 19869acbb460Smrg source=sub/conftest.c object=$am__obj \ 19879acbb460Smrg depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ 19889acbb460Smrg $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ 19899acbb460Smrg >/dev/null 2>conftest.err && 19909acbb460Smrg grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 19919acbb460Smrg grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && 19929acbb460Smrg grep $am__obj sub/conftest.Po > /dev/null 2>&1 && 19939acbb460Smrg ${MAKE-make} -s -f confmf > /dev/null 2>&1; then 19949acbb460Smrg # icc doesn't choke on unknown options, it will just issue warnings 19959acbb460Smrg # or remarks (even with -Werror). So we grep stderr for any message 19969acbb460Smrg # that says an option was ignored or not supported. 19979acbb460Smrg # When given -MP, icc 7.0 and 7.1 complain thusly: 19989acbb460Smrg # icc: Command line warning: ignoring option '-M'; no argument required 19999acbb460Smrg # The diagnosis changed in icc 8.0: 20009acbb460Smrg # icc: Command line remark: option '-MP' not supported 20019acbb460Smrg if (grep 'ignoring option' conftest.err || 20029acbb460Smrg grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else 20039acbb460Smrg am_cv_$1_dependencies_compiler_type=$depmode 20049acbb460Smrg break 20059acbb460Smrg fi 20069acbb460Smrg fi 20079acbb460Smrg done 20089acbb460Smrg 20099acbb460Smrg cd .. 20109acbb460Smrg rm -rf conftest.dir 20119acbb460Smrgelse 20129acbb460Smrg am_cv_$1_dependencies_compiler_type=none 201332034fa5Smrgfi 20149acbb460Smrg]) 20159acbb460SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) 20169acbb460SmrgAM_CONDITIONAL([am__fastdep$1], [ 20179acbb460Smrg test "x$enable_dependency_tracking" != xno \ 20189acbb460Smrg && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) 20199acbb460Smrg]) 20209acbb460Smrg 20219acbb460Smrg 20229acbb460Smrg# AM_SET_DEPDIR 20239acbb460Smrg# ------------- 20249acbb460Smrg# Choose a directory name for dependency files. 20259acbb460Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES 20269acbb460SmrgAC_DEFUN([AM_SET_DEPDIR], 20279acbb460Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl 20289acbb460SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl 20299acbb460Smrg]) 20309acbb460Smrg 20319acbb460Smrg 20329acbb460Smrg# AM_DEP_TRACK 20339acbb460Smrg# ------------ 20349acbb460SmrgAC_DEFUN([AM_DEP_TRACK], 20359acbb460Smrg[AC_ARG_ENABLE(dependency-tracking, 20369acbb460Smrg[ --disable-dependency-tracking speeds up one-time build 20379acbb460Smrg --enable-dependency-tracking do not reject slow dependency extractors]) 20389acbb460Smrgif test "x$enable_dependency_tracking" != xno; then 20399acbb460Smrg am_depcomp="$ac_aux_dir/depcomp" 20409acbb460Smrg AMDEPBACKSLASH='\' 204132034fa5Smrgfi 20429acbb460SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) 20439acbb460SmrgAC_SUBST([AMDEPBACKSLASH])dnl 20449acbb460Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl 20459acbb460Smrg]) 204632034fa5Smrg 20479acbb460Smrg# Generate code to set up dependency tracking. -*- Autoconf -*- 204832034fa5Smrg 20499acbb460Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 20509acbb460Smrg# Free Software Foundation, Inc. 205132034fa5Smrg# 20529acbb460Smrg# This file is free software; the Free Software Foundation 20539acbb460Smrg# gives unlimited permission to copy and/or distribute it, 20549acbb460Smrg# with or without modifications, as long as this notice is preserved. 205532034fa5Smrg 20569acbb460Smrg#serial 5 205732034fa5Smrg 20589acbb460Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS 20599acbb460Smrg# ------------------------------ 20609acbb460SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], 20619acbb460Smrg[{ 20629acbb460Smrg # Autoconf 2.62 quotes --file arguments for eval, but not when files 20639acbb460Smrg # are listed without --file. Let's play safe and only enable the eval 20649acbb460Smrg # if we detect the quoting. 20659acbb460Smrg case $CONFIG_FILES in 20669acbb460Smrg *\'*) eval set x "$CONFIG_FILES" ;; 20679acbb460Smrg *) set x $CONFIG_FILES ;; 20689acbb460Smrg esac 20699acbb460Smrg shift 20709acbb460Smrg for mf 20719acbb460Smrg do 20729acbb460Smrg # Strip MF so we end up with the name of the file. 20739acbb460Smrg mf=`echo "$mf" | sed -e 's/:.*$//'` 20749acbb460Smrg # Check whether this is an Automake generated Makefile or not. 20759acbb460Smrg # We used to match only the files named `Makefile.in', but 20769acbb460Smrg # some people rename them; so instead we look at the file content. 20779acbb460Smrg # Grep'ing the first line is not enough: some people post-process 20789acbb460Smrg # each Makefile.in and add a new line on top of each file to say so. 20799acbb460Smrg # Grep'ing the whole file is not good either: AIX grep has a line 20809acbb460Smrg # limit of 2048, but all sed's we know have understand at least 4000. 20819acbb460Smrg if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then 20829acbb460Smrg dirpart=`AS_DIRNAME("$mf")` 20839acbb460Smrg else 20849acbb460Smrg continue 20859acbb460Smrg fi 20869acbb460Smrg # Extract the definition of DEPDIR, am__include, and am__quote 20879acbb460Smrg # from the Makefile without running `make'. 20889acbb460Smrg DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` 20899acbb460Smrg test -z "$DEPDIR" && continue 20909acbb460Smrg am__include=`sed -n 's/^am__include = //p' < "$mf"` 20919acbb460Smrg test -z "am__include" && continue 20929acbb460Smrg am__quote=`sed -n 's/^am__quote = //p' < "$mf"` 20939acbb460Smrg # When using ansi2knr, U may be empty or an underscore; expand it 20949acbb460Smrg U=`sed -n 's/^U = //p' < "$mf"` 20959acbb460Smrg # Find all dependency output files, they are included files with 20969acbb460Smrg # $(DEPDIR) in their names. We invoke sed twice because it is the 20979acbb460Smrg # simplest approach to changing $(DEPDIR) to its actual value in the 20989acbb460Smrg # expansion. 20999acbb460Smrg for file in `sed -n " 21009acbb460Smrg s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ 21019acbb460Smrg sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do 21029acbb460Smrg # Make sure the directory exists. 21039acbb460Smrg test -f "$dirpart/$file" && continue 21049acbb460Smrg fdir=`AS_DIRNAME(["$file"])` 21059acbb460Smrg AS_MKDIR_P([$dirpart/$fdir]) 21069acbb460Smrg # echo "creating $dirpart/$file" 21079acbb460Smrg echo '# dummy' > "$dirpart/$file" 21089acbb460Smrg done 21099acbb460Smrg done 21109acbb460Smrg} 21119acbb460Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS 211232034fa5Smrg 211332034fa5Smrg 21149acbb460Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS 21159acbb460Smrg# ----------------------------- 21169acbb460Smrg# This macro should only be invoked once -- use via AC_REQUIRE. 21179acbb460Smrg# 21189acbb460Smrg# This code is only required when automatic dependency tracking 21199acbb460Smrg# is enabled. FIXME. This creates each `.P' file that we will 21209acbb460Smrg# need in order to bootstrap the dependency handling code. 21219acbb460SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], 21229acbb460Smrg[AC_CONFIG_COMMANDS([depfiles], 21239acbb460Smrg [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], 21249acbb460Smrg [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) 21259acbb460Smrg]) 212632034fa5Smrg 21279acbb460Smrg# Do all the work for Automake. -*- Autoconf -*- 212832034fa5Smrg 21299acbb460Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 21309acbb460Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. 21319acbb460Smrg# 21329acbb460Smrg# This file is free software; the Free Software Foundation 21339acbb460Smrg# gives unlimited permission to copy and/or distribute it, 21349acbb460Smrg# with or without modifications, as long as this notice is preserved. 21359acbb460Smrg 21369acbb460Smrg# serial 16 213732034fa5Smrg 21389acbb460Smrg# This macro actually does too much. Some checks are only needed if 21399acbb460Smrg# your package does certain things. But this isn't really a big deal. 214032034fa5Smrg 21419acbb460Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 21429acbb460Smrg# AM_INIT_AUTOMAKE([OPTIONS]) 21439acbb460Smrg# ----------------------------------------------- 21449acbb460Smrg# The call with PACKAGE and VERSION arguments is the old style 21459acbb460Smrg# call (pre autoconf-2.50), which is being phased out. PACKAGE 21469acbb460Smrg# and VERSION should now be passed to AC_INIT and removed from 21479acbb460Smrg# the call to AM_INIT_AUTOMAKE. 21489acbb460Smrg# We support both call styles for the transition. After 21499acbb460Smrg# the next Automake release, Autoconf can make the AC_INIT 21509acbb460Smrg# arguments mandatory, and then we can depend on a new Autoconf 21519acbb460Smrg# release and drop the old call support. 21529acbb460SmrgAC_DEFUN([AM_INIT_AUTOMAKE], 21539acbb460Smrg[AC_PREREQ([2.62])dnl 21549acbb460Smrgdnl Autoconf wants to disallow AM_ names. We explicitly allow 21559acbb460Smrgdnl the ones we care about. 21569acbb460Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 21579acbb460SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 21589acbb460SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl 21599acbb460Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then 21609acbb460Smrg # Use -I$(srcdir) only when $(srcdir) != ., so that make's output 21619acbb460Smrg # is not polluted with repeated "-I." 21629acbb460Smrg AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl 21639acbb460Smrg # test to see if srcdir already configured 21649acbb460Smrg if test -f $srcdir/config.status; then 21659acbb460Smrg AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 21669acbb460Smrg fi 216732034fa5Smrgfi 21684ecf19b2Smrg 21699acbb460Smrg# test whether we have cygpath 21709acbb460Smrgif test -z "$CYGPATH_W"; then 21719acbb460Smrg if (cygpath --version) >/dev/null 2>/dev/null; then 21729acbb460Smrg CYGPATH_W='cygpath -w' 21739acbb460Smrg else 21749acbb460Smrg CYGPATH_W=echo 21759acbb460Smrg fi 21769acbb460Smrgfi 21779acbb460SmrgAC_SUBST([CYGPATH_W]) 21784ecf19b2Smrg 21799acbb460Smrg# Define the identity of the package. 21809acbb460Smrgdnl Distinguish between old-style and new-style calls. 21819acbb460Smrgm4_ifval([$2], 21829acbb460Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 21839acbb460Smrg AC_SUBST([PACKAGE], [$1])dnl 21849acbb460Smrg AC_SUBST([VERSION], [$2])], 21859acbb460Smrg[_AM_SET_OPTIONS([$1])dnl 21869acbb460Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. 21879acbb460Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, 21889acbb460Smrg [m4_fatal([AC_INIT should be called with package and version arguments])])dnl 21899acbb460Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl 21909acbb460Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl 21914ecf19b2Smrg 21929acbb460Smrg_AM_IF_OPTION([no-define],, 21939acbb460Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) 21949acbb460Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl 21954ecf19b2Smrg 21969acbb460Smrg# Some tools Automake needs. 21979acbb460SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl 21989acbb460SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl 21999acbb460SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) 22009acbb460SmrgAM_MISSING_PROG(AUTOCONF, autoconf) 22019acbb460SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) 22029acbb460SmrgAM_MISSING_PROG(AUTOHEADER, autoheader) 22039acbb460SmrgAM_MISSING_PROG(MAKEINFO, makeinfo) 22049acbb460SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl 22059acbb460SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl 22069acbb460SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl 22079acbb460Smrg# We need awk for the "check" target. The system "awk" is bad on 22089acbb460Smrg# some platforms. 22099acbb460SmrgAC_REQUIRE([AC_PROG_AWK])dnl 22109acbb460SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl 22119acbb460SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl 22129acbb460Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], 22139acbb460Smrg [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], 22149acbb460Smrg [_AM_PROG_TAR([v7])])]) 22159acbb460Smrg_AM_IF_OPTION([no-dependencies],, 22169acbb460Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC], 22179acbb460Smrg [_AM_DEPENDENCIES(CC)], 22189acbb460Smrg [define([AC_PROG_CC], 22199acbb460Smrg defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl 22209acbb460SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX], 22219acbb460Smrg [_AM_DEPENDENCIES(CXX)], 22229acbb460Smrg [define([AC_PROG_CXX], 22239acbb460Smrg defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl 22249acbb460SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC], 22259acbb460Smrg [_AM_DEPENDENCIES(OBJC)], 22269acbb460Smrg [define([AC_PROG_OBJC], 22279acbb460Smrg defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl 22289acbb460Smrg]) 22299acbb460Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl 22309acbb460Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the 22319acbb460Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro 22329acbb460Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below. 22339acbb460SmrgAC_CONFIG_COMMANDS_PRE(dnl 22349acbb460Smrg[m4_provide_if([_AM_COMPILER_EXEEXT], 22359acbb460Smrg [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl 22369acbb460Smrg]) 22374ecf19b2Smrg 22389acbb460Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not 22399acbb460Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further 22409acbb460Smrgdnl mangled by Autoconf and run in a shell conditional statement. 22419acbb460Smrgm4_define([_AC_COMPILER_EXEEXT], 22429acbb460Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) 22439acbb460Smrg 22449acbb460Smrg 22459acbb460Smrg# When config.status generates a header, we must update the stamp-h file. 22469acbb460Smrg# This file resides in the same directory as the config header 22479acbb460Smrg# that is generated. The stamp files are numbered to have different names. 22489acbb460Smrg 22499acbb460Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 22509acbb460Smrg# loop where config.status creates the headers, so we can generate 22519acbb460Smrg# our stamp files there. 22529acbb460SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 22539acbb460Smrg[# Compute $1's index in $config_headers. 22549acbb460Smrg_am_arg=$1 22559acbb460Smrg_am_stamp_count=1 22569acbb460Smrgfor _am_header in $config_headers :; do 22579acbb460Smrg case $_am_header in 22589acbb460Smrg $_am_arg | $_am_arg:* ) 22599acbb460Smrg break ;; 22609acbb460Smrg * ) 22619acbb460Smrg _am_stamp_count=`expr $_am_stamp_count + 1` ;; 22629acbb460Smrg esac 22639acbb460Smrgdone 22649acbb460Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) 22659acbb460Smrg 22669acbb460Smrg# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. 226732034fa5Smrg# 22689acbb460Smrg# This file is free software; the Free Software Foundation 22699acbb460Smrg# gives unlimited permission to copy and/or distribute it, 22709acbb460Smrg# with or without modifications, as long as this notice is preserved. 22719acbb460Smrg 22729acbb460Smrg# AM_PROG_INSTALL_SH 22739acbb460Smrg# ------------------ 22749acbb460Smrg# Define $install_sh. 22759acbb460SmrgAC_DEFUN([AM_PROG_INSTALL_SH], 22769acbb460Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 22779acbb460Smrgif test x"${install_sh}" != xset; then 22789acbb460Smrg case $am_aux_dir in 22799acbb460Smrg *\ * | *\ *) 22809acbb460Smrg install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; 22819acbb460Smrg *) 22829acbb460Smrg install_sh="\${SHELL} $am_aux_dir/install-sh" 22839acbb460Smrg esac 22844ecf19b2Smrgfi 22859acbb460SmrgAC_SUBST(install_sh)]) 228632034fa5Smrg 22879acbb460Smrg# Copyright (C) 2003, 2005 Free Software Foundation, Inc. 22889acbb460Smrg# 22899acbb460Smrg# This file is free software; the Free Software Foundation 22909acbb460Smrg# gives unlimited permission to copy and/or distribute it, 22919acbb460Smrg# with or without modifications, as long as this notice is preserved. 229232034fa5Smrg 22939acbb460Smrg# serial 2 229432034fa5Smrg 22959acbb460Smrg# Check whether the underlying file-system supports filenames 22969acbb460Smrg# with a leading dot. For instance MS-DOS doesn't. 22979acbb460SmrgAC_DEFUN([AM_SET_LEADING_DOT], 22989acbb460Smrg[rm -rf .tst 2>/dev/null 22999acbb460Smrgmkdir .tst 2>/dev/null 23009acbb460Smrgif test -d .tst; then 23019acbb460Smrg am__leading_dot=. 23029acbb460Smrgelse 23039acbb460Smrg am__leading_dot=_ 23044ecf19b2Smrgfi 23059acbb460Smrgrmdir .tst 2>/dev/null 23069acbb460SmrgAC_SUBST([am__leading_dot])]) 23074ecf19b2Smrg 23089acbb460Smrg# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- 23099acbb460Smrg# From Jim Meyering 23104ecf19b2Smrg 23119acbb460Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 23129acbb460Smrg# Free Software Foundation, Inc. 23139acbb460Smrg# 23149acbb460Smrg# This file is free software; the Free Software Foundation 23159acbb460Smrg# gives unlimited permission to copy and/or distribute it, 23169acbb460Smrg# with or without modifications, as long as this notice is preserved. 23174ecf19b2Smrg 23189acbb460Smrg# serial 5 23194ecf19b2Smrg 23209acbb460Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE]) 23219acbb460Smrg# ---------------------------------- 23229acbb460Smrg# Control maintainer-specific portions of Makefiles. 23239acbb460Smrg# Default is to disable them, unless `enable' is passed literally. 23249acbb460Smrg# For symmetry, `disable' may be passed as well. Anyway, the user 23259acbb460Smrg# can override the default with the --enable/--disable switch. 23269acbb460SmrgAC_DEFUN([AM_MAINTAINER_MODE], 23279acbb460Smrg[m4_case(m4_default([$1], [disable]), 23289acbb460Smrg [enable], [m4_define([am_maintainer_other], [disable])], 23299acbb460Smrg [disable], [m4_define([am_maintainer_other], [enable])], 23309acbb460Smrg [m4_define([am_maintainer_other], [enable]) 23319acbb460Smrg m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) 23329acbb460SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) 23339acbb460Smrg dnl maintainer-mode's default is 'disable' unless 'enable' is passed 23349acbb460Smrg AC_ARG_ENABLE([maintainer-mode], 23359acbb460Smrg[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful 23369acbb460Smrg (and sometimes confusing) to the casual installer], 23379acbb460Smrg [USE_MAINTAINER_MODE=$enableval], 23389acbb460Smrg [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) 23399acbb460Smrg AC_MSG_RESULT([$USE_MAINTAINER_MODE]) 23409acbb460Smrg AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) 23419acbb460Smrg MAINT=$MAINTAINER_MODE_TRUE 23429acbb460Smrg AC_SUBST([MAINT])dnl 23439acbb460Smrg] 23449acbb460Smrg) 23454ecf19b2Smrg 23469acbb460SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) 23474ecf19b2Smrg 23489acbb460Smrg# Check to see how 'make' treats includes. -*- Autoconf -*- 23499acbb460Smrg 23509acbb460Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. 235132034fa5Smrg# 23529acbb460Smrg# This file is free software; the Free Software Foundation 23539acbb460Smrg# gives unlimited permission to copy and/or distribute it, 23549acbb460Smrg# with or without modifications, as long as this notice is preserved. 235532034fa5Smrg 23569acbb460Smrg# serial 4 23574ecf19b2Smrg 23589acbb460Smrg# AM_MAKE_INCLUDE() 23599acbb460Smrg# ----------------- 23609acbb460Smrg# Check to see how make treats includes. 23619acbb460SmrgAC_DEFUN([AM_MAKE_INCLUDE], 23629acbb460Smrg[am_make=${MAKE-make} 23639acbb460Smrgcat > confinc << 'END' 23649acbb460Smrgam__doit: 23659acbb460Smrg @echo this is the am__doit target 23669acbb460Smrg.PHONY: am__doit 23679acbb460SmrgEND 23689acbb460Smrg# If we don't find an include directive, just comment out the code. 23699acbb460SmrgAC_MSG_CHECKING([for style of include used by $am_make]) 23709acbb460Smrgam__include="#" 23719acbb460Smrgam__quote= 23729acbb460Smrg_am_result=none 23739acbb460Smrg# First try GNU make style include. 23749acbb460Smrgecho "include confinc" > confmf 23759acbb460Smrg# Ignore all kinds of additional output from `make'. 23769acbb460Smrgcase `$am_make -s -f confmf 2> /dev/null` in #( 23779acbb460Smrg*the\ am__doit\ target*) 23789acbb460Smrg am__include=include 23799acbb460Smrg am__quote= 23809acbb460Smrg _am_result=GNU 23819acbb460Smrg ;; 23829acbb460Smrgesac 23839acbb460Smrg# Now try BSD make style include. 23849acbb460Smrgif test "$am__include" = "#"; then 23859acbb460Smrg echo '.include "confinc"' > confmf 23869acbb460Smrg case `$am_make -s -f confmf 2> /dev/null` in #( 23879acbb460Smrg *the\ am__doit\ target*) 23889acbb460Smrg am__include=.include 23899acbb460Smrg am__quote="\"" 23909acbb460Smrg _am_result=BSD 23919acbb460Smrg ;; 23929acbb460Smrg esac 239332034fa5Smrgfi 23949acbb460SmrgAC_SUBST([am__include]) 23959acbb460SmrgAC_SUBST([am__quote]) 23969acbb460SmrgAC_MSG_RESULT([$_am_result]) 23979acbb460Smrgrm -f confinc confmf 23989acbb460Smrg]) 23994ecf19b2Smrg 24009acbb460Smrg# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- 240132034fa5Smrg 24029acbb460Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 24039acbb460Smrg# Free Software Foundation, Inc. 240432034fa5Smrg# 24059acbb460Smrg# This file is free software; the Free Software Foundation 24069acbb460Smrg# gives unlimited permission to copy and/or distribute it, 24079acbb460Smrg# with or without modifications, as long as this notice is preserved. 24084ecf19b2Smrg 24099acbb460Smrg# serial 6 24104ecf19b2Smrg 24119acbb460Smrg# AM_MISSING_PROG(NAME, PROGRAM) 24129acbb460Smrg# ------------------------------ 24139acbb460SmrgAC_DEFUN([AM_MISSING_PROG], 24149acbb460Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN]) 24159acbb460Smrg$1=${$1-"${am_missing_run}$2"} 24169acbb460SmrgAC_SUBST($1)]) 24174ecf19b2Smrg 24184ecf19b2Smrg 24199acbb460Smrg# AM_MISSING_HAS_RUN 24209acbb460Smrg# ------------------ 24219acbb460Smrg# Define MISSING if not defined so far and test if it supports --run. 24229acbb460Smrg# If it does, set am_missing_run to use it, otherwise, to nothing. 24239acbb460SmrgAC_DEFUN([AM_MISSING_HAS_RUN], 24249acbb460Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 24259acbb460SmrgAC_REQUIRE_AUX_FILE([missing])dnl 24269acbb460Smrgif test x"${MISSING+set}" != xset; then 24279acbb460Smrg case $am_aux_dir in 24289acbb460Smrg *\ * | *\ *) 24299acbb460Smrg MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; 24309acbb460Smrg *) 24319acbb460Smrg MISSING="\${SHELL} $am_aux_dir/missing" ;; 24329acbb460Smrg esac 243332034fa5Smrgfi 24349acbb460Smrg# Use eval to expand $SHELL 24359acbb460Smrgif eval "$MISSING --run true"; then 24369acbb460Smrg am_missing_run="$MISSING --run " 24379acbb460Smrgelse 24389acbb460Smrg am_missing_run= 24399acbb460Smrg AC_MSG_WARN([`missing' script is too old or missing]) 24409acbb460Smrgfi 24419acbb460Smrg]) 24424ecf19b2Smrg 24439acbb460Smrg# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 24449acbb460Smrg# 24459acbb460Smrg# This file is free software; the Free Software Foundation 24469acbb460Smrg# gives unlimited permission to copy and/or distribute it, 24479acbb460Smrg# with or without modifications, as long as this notice is preserved. 24484ecf19b2Smrg 24499acbb460Smrg# AM_PROG_MKDIR_P 245032034fa5Smrg# --------------- 24519acbb460Smrg# Check for `mkdir -p'. 24529acbb460SmrgAC_DEFUN([AM_PROG_MKDIR_P], 24539acbb460Smrg[AC_PREREQ([2.60])dnl 24549acbb460SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl 24559acbb460Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, 24569acbb460Smrgdnl while keeping a definition of mkdir_p for backward compatibility. 24579acbb460Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. 24589acbb460Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of 24599acbb460Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own 24609acbb460Smrgdnl adjustment using top_builddir (which is defined more often than 24619acbb460Smrgdnl MKDIR_P). 24629acbb460SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl 24639acbb460Smrgcase $mkdir_p in 24649acbb460Smrg [[\\/$]]* | ?:[[\\/]]*) ;; 24659acbb460Smrg */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; 24669acbb460Smrgesac 24679acbb460Smrg]) 24689acbb460Smrg 24699acbb460Smrg# Helper functions for option handling. -*- Autoconf -*- 24709acbb460Smrg 24719acbb460Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. 247232034fa5Smrg# 24739acbb460Smrg# This file is free software; the Free Software Foundation 24749acbb460Smrg# gives unlimited permission to copy and/or distribute it, 24759acbb460Smrg# with or without modifications, as long as this notice is preserved. 24764ecf19b2Smrg 24779acbb460Smrg# serial 4 24789acbb460Smrg 24799acbb460Smrg# _AM_MANGLE_OPTION(NAME) 248032034fa5Smrg# ----------------------- 24819acbb460SmrgAC_DEFUN([_AM_MANGLE_OPTION], 24829acbb460Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 248332034fa5Smrg 24849acbb460Smrg# _AM_SET_OPTION(NAME) 24859acbb460Smrg# ------------------------------ 24869acbb460Smrg# Set option NAME. Presently that only means defining a flag for this option. 24879acbb460SmrgAC_DEFUN([_AM_SET_OPTION], 24889acbb460Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) 24894ecf19b2Smrg 24909acbb460Smrg# _AM_SET_OPTIONS(OPTIONS) 24919acbb460Smrg# ---------------------------------- 24929acbb460Smrg# OPTIONS is a space-separated list of Automake options. 24939acbb460SmrgAC_DEFUN([_AM_SET_OPTIONS], 24949acbb460Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 249532034fa5Smrg 24969acbb460Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 24979acbb460Smrg# ------------------------------------------- 24989acbb460Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 24999acbb460SmrgAC_DEFUN([_AM_IF_OPTION], 25009acbb460Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 250132034fa5Smrg 25029acbb460Smrg# Check to make sure that the build environment is sane. -*- Autoconf -*- 25034ecf19b2Smrg 25049acbb460Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 25059acbb460Smrg# Free Software Foundation, Inc. 25064ecf19b2Smrg# 25079acbb460Smrg# This file is free software; the Free Software Foundation 25089acbb460Smrg# gives unlimited permission to copy and/or distribute it, 25099acbb460Smrg# with or without modifications, as long as this notice is preserved. 25104ecf19b2Smrg 25119acbb460Smrg# serial 5 25129acbb460Smrg 25139acbb460Smrg# AM_SANITY_CHECK 25149acbb460Smrg# --------------- 25159acbb460SmrgAC_DEFUN([AM_SANITY_CHECK], 25169acbb460Smrg[AC_MSG_CHECKING([whether build environment is sane]) 25179acbb460Smrg# Just in case 25189acbb460Smrgsleep 1 25199acbb460Smrgecho timestamp > conftest.file 25209acbb460Smrg# Reject unsafe characters in $srcdir or the absolute working directory 25219acbb460Smrg# name. Accept space and tab only in the latter. 25229acbb460Smrgam_lf=' 25239acbb460Smrg' 25249acbb460Smrgcase `pwd` in 25259acbb460Smrg *[[\\\"\#\$\&\'\`$am_lf]]*) 25269acbb460Smrg AC_MSG_ERROR([unsafe absolute working directory name]);; 25279acbb460Smrgesac 25289acbb460Smrgcase $srcdir in 25299acbb460Smrg *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) 25309acbb460Smrg AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; 25319acbb460Smrgesac 25329acbb460Smrg 25339acbb460Smrg# Do `set' in a subshell so we don't clobber the current shell's 25349acbb460Smrg# arguments. Must try -L first in case configure is actually a 25359acbb460Smrg# symlink; some systems play weird games with the mod time of symlinks 25369acbb460Smrg# (eg FreeBSD returns the mod time of the symlink's containing 25379acbb460Smrg# directory). 25389acbb460Smrgif ( 25399acbb460Smrg set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` 25409acbb460Smrg if test "$[*]" = "X"; then 25419acbb460Smrg # -L didn't work. 25429acbb460Smrg set X `ls -t "$srcdir/configure" conftest.file` 25439acbb460Smrg fi 25449acbb460Smrg rm -f conftest.file 25459acbb460Smrg if test "$[*]" != "X $srcdir/configure conftest.file" \ 25469acbb460Smrg && test "$[*]" != "X conftest.file $srcdir/configure"; then 25479acbb460Smrg 25489acbb460Smrg # If neither matched, then we have a broken ls. This can happen 25499acbb460Smrg # if, for instance, CONFIG_SHELL is bash and it inherits a 25509acbb460Smrg # broken ls alias from the environment. This has actually 25519acbb460Smrg # happened. Such a system could not be considered "sane". 25529acbb460Smrg AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 25539acbb460Smrgalias in your environment]) 25549acbb460Smrg fi 25559acbb460Smrg 25569acbb460Smrg test "$[2]" = conftest.file 25579acbb460Smrg ) 25589acbb460Smrgthen 25599acbb460Smrg # Ok. 25609acbb460Smrg : 25619acbb460Smrgelse 25629acbb460Smrg AC_MSG_ERROR([newly created file is older than distributed files! 25639acbb460SmrgCheck your system clock]) 25644ecf19b2Smrgfi 25659acbb460SmrgAC_MSG_RESULT(yes)]) 25664ecf19b2Smrg 25679acbb460Smrg# Copyright (C) 2009 Free Software Foundation, Inc. 25684ecf19b2Smrg# 25699acbb460Smrg# This file is free software; the Free Software Foundation 25709acbb460Smrg# gives unlimited permission to copy and/or distribute it, 25719acbb460Smrg# with or without modifications, as long as this notice is preserved. 25724ecf19b2Smrg 25739acbb460Smrg# serial 1 25744ecf19b2Smrg 25759acbb460Smrg# AM_SILENT_RULES([DEFAULT]) 25769acbb460Smrg# -------------------------- 25779acbb460Smrg# Enable less verbose build rules; with the default set to DEFAULT 25789acbb460Smrg# (`yes' being less verbose, `no' or empty being verbose). 25799acbb460SmrgAC_DEFUN([AM_SILENT_RULES], 25809acbb460Smrg[AC_ARG_ENABLE([silent-rules], 25819acbb460Smrg[ --enable-silent-rules less verbose build output (undo: `make V=1') 25829acbb460Smrg --disable-silent-rules verbose build output (undo: `make V=0')]) 25839acbb460Smrgcase $enable_silent_rules in 25849acbb460Smrgyes) AM_DEFAULT_VERBOSITY=0;; 25859acbb460Smrgno) AM_DEFAULT_VERBOSITY=1;; 25869acbb460Smrg*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; 25879acbb460Smrgesac 25889acbb460SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl 25899acbb460SmrgAM_BACKSLASH='\' 25909acbb460SmrgAC_SUBST([AM_BACKSLASH])dnl 25919acbb460Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl 25929acbb460Smrg]) 25934ecf19b2Smrg 25949acbb460Smrg# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 25959acbb460Smrg# 25969acbb460Smrg# This file is free software; the Free Software Foundation 25979acbb460Smrg# gives unlimited permission to copy and/or distribute it, 25989acbb460Smrg# with or without modifications, as long as this notice is preserved. 25994ecf19b2Smrg 26009acbb460Smrg# AM_PROG_INSTALL_STRIP 26019acbb460Smrg# --------------------- 26029acbb460Smrg# One issue with vendor `install' (even GNU) is that you can't 26039acbb460Smrg# specify the program used to strip binaries. This is especially 26049acbb460Smrg# annoying in cross-compiling environments, where the build's strip 26059acbb460Smrg# is unlikely to handle the host's binaries. 26069acbb460Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we 26079acbb460Smrg# always use install-sh in `make install-strip', and initialize 26089acbb460Smrg# STRIPPROG with the value of the STRIP variable (set by the user). 26099acbb460SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP], 26109acbb460Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 26119acbb460Smrg# Installed binaries are usually stripped using `strip' when the user 26129acbb460Smrg# run `make install-strip'. However `strip' might not be the right 26139acbb460Smrg# tool to use in cross-compilation environments, therefore Automake 26149acbb460Smrg# will honor the `STRIP' environment variable to overrule this program. 26159acbb460Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'. 26169acbb460Smrgif test "$cross_compiling" != no; then 26179acbb460Smrg AC_CHECK_TOOL([STRIP], [strip], :) 26189acbb460Smrgfi 26199acbb460SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" 26209acbb460SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])]) 26214ecf19b2Smrg 26229acbb460Smrg# Copyright (C) 2006, 2008 Free Software Foundation, Inc. 26234ecf19b2Smrg# 26249acbb460Smrg# This file is free software; the Free Software Foundation 26259acbb460Smrg# gives unlimited permission to copy and/or distribute it, 26269acbb460Smrg# with or without modifications, as long as this notice is preserved. 26274ecf19b2Smrg 26289acbb460Smrg# serial 2 26294ecf19b2Smrg 26309acbb460Smrg# _AM_SUBST_NOTMAKE(VARIABLE) 26319acbb460Smrg# --------------------------- 26329acbb460Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. 26339acbb460Smrg# This macro is traced by Automake. 26349acbb460SmrgAC_DEFUN([_AM_SUBST_NOTMAKE]) 26354ecf19b2Smrg 26369acbb460Smrg# AM_SUBST_NOTMAKE(VARIABLE) 26379acbb460Smrg# --------------------------- 26389acbb460Smrg# Public sister of _AM_SUBST_NOTMAKE. 26399acbb460SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) 26404ecf19b2Smrg 26419acbb460Smrg# Check how to create a tarball. -*- Autoconf -*- 26424ecf19b2Smrg 26439acbb460Smrg# Copyright (C) 2004, 2005 Free Software Foundation, Inc. 26449acbb460Smrg# 26459acbb460Smrg# This file is free software; the Free Software Foundation 26469acbb460Smrg# gives unlimited permission to copy and/or distribute it, 26479acbb460Smrg# with or without modifications, as long as this notice is preserved. 26484ecf19b2Smrg 26499acbb460Smrg# serial 2 26504ecf19b2Smrg 26519acbb460Smrg# _AM_PROG_TAR(FORMAT) 26529acbb460Smrg# -------------------- 26539acbb460Smrg# Check how to create a tarball in format FORMAT. 26549acbb460Smrg# FORMAT should be one of `v7', `ustar', or `pax'. 26559acbb460Smrg# 26569acbb460Smrg# Substitute a variable $(am__tar) that is a command 26579acbb460Smrg# writing to stdout a FORMAT-tarball containing the directory 26589acbb460Smrg# $tardir. 26599acbb460Smrg# tardir=directory && $(am__tar) > result.tar 26609acbb460Smrg# 26619acbb460Smrg# Substitute a variable $(am__untar) that extract such 26629acbb460Smrg# a tarball read from stdin. 26639acbb460Smrg# $(am__untar) < result.tar 26649acbb460SmrgAC_DEFUN([_AM_PROG_TAR], 26659acbb460Smrg[# Always define AMTAR for backward compatibility. 26669acbb460SmrgAM_MISSING_PROG([AMTAR], [tar]) 26679acbb460Smrgm4_if([$1], [v7], 26689acbb460Smrg [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], 26699acbb460Smrg [m4_case([$1], [ustar],, [pax],, 26709acbb460Smrg [m4_fatal([Unknown tar format])]) 26719acbb460SmrgAC_MSG_CHECKING([how to create a $1 tar archive]) 26729acbb460Smrg# Loop over all known methods to create a tar archive until one works. 26739acbb460Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' 26749acbb460Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools} 26759acbb460Smrg# Do not fold the above two line into one, because Tru64 sh and 26769acbb460Smrg# Solaris sh will not grok spaces in the rhs of `-'. 26779acbb460Smrgfor _am_tool in $_am_tools 26789acbb460Smrgdo 26799acbb460Smrg case $_am_tool in 26809acbb460Smrg gnutar) 26819acbb460Smrg for _am_tar in tar gnutar gtar; 26829acbb460Smrg do 26839acbb460Smrg AM_RUN_LOG([$_am_tar --version]) && break 26849acbb460Smrg done 26859acbb460Smrg am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' 26869acbb460Smrg am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' 26879acbb460Smrg am__untar="$_am_tar -xf -" 26889acbb460Smrg ;; 26899acbb460Smrg plaintar) 26909acbb460Smrg # Must skip GNU tar: if it does not support --format= it doesn't create 26919acbb460Smrg # ustar tarball either. 26929acbb460Smrg (tar --version) >/dev/null 2>&1 && continue 26939acbb460Smrg am__tar='tar chf - "$$tardir"' 26949acbb460Smrg am__tar_='tar chf - "$tardir"' 26959acbb460Smrg am__untar='tar xf -' 26969acbb460Smrg ;; 26979acbb460Smrg pax) 26989acbb460Smrg am__tar='pax -L -x $1 -w "$$tardir"' 26999acbb460Smrg am__tar_='pax -L -x $1 -w "$tardir"' 27009acbb460Smrg am__untar='pax -r' 27019acbb460Smrg ;; 27029acbb460Smrg cpio) 27039acbb460Smrg am__tar='find "$$tardir" -print | cpio -o -H $1 -L' 27049acbb460Smrg am__tar_='find "$tardir" -print | cpio -o -H $1 -L' 27059acbb460Smrg am__untar='cpio -i -H $1 -d' 27069acbb460Smrg ;; 27079acbb460Smrg none) 27089acbb460Smrg am__tar=false 27099acbb460Smrg am__tar_=false 27109acbb460Smrg am__untar=false 27119acbb460Smrg ;; 27129acbb460Smrg esac 27134ecf19b2Smrg 27149acbb460Smrg # If the value was cached, stop now. We just wanted to have am__tar 27159acbb460Smrg # and am__untar set. 27169acbb460Smrg test -n "${am_cv_prog_tar_$1}" && break 27174ecf19b2Smrg 27189acbb460Smrg # tar/untar a dummy directory, and stop if the command works 27199acbb460Smrg rm -rf conftest.dir 27209acbb460Smrg mkdir conftest.dir 27219acbb460Smrg echo GrepMe > conftest.dir/file 27229acbb460Smrg AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) 27239acbb460Smrg rm -rf conftest.dir 27249acbb460Smrg if test -s conftest.tar; then 27259acbb460Smrg AM_RUN_LOG([$am__untar <conftest.tar]) 27269acbb460Smrg grep GrepMe conftest.dir/file >/dev/null 2>&1 && break 27279acbb460Smrg fi 27289acbb460Smrgdone 27299acbb460Smrgrm -rf conftest.dir 27304ecf19b2Smrg 27319acbb460SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) 27329acbb460SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])]) 27339acbb460SmrgAC_SUBST([am__tar]) 27349acbb460SmrgAC_SUBST([am__untar]) 27359acbb460Smrg]) # _AM_PROG_TAR 27364ecf19b2Smrg 2737