aclocal.m4 revision 2227fc13
12227fc13Smrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*- 2644fc5c1Stron 32227fc13Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 42227fc13Smrg# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. 5644fc5c1Stron# This file is free software; the Free Software Foundation 6644fc5c1Stron# gives unlimited permission to copy and/or distribute it, 7644fc5c1Stron# with or without modifications, as long as this notice is preserved. 8644fc5c1Stron 9644fc5c1Stron# This program is distributed in the hope that it will be useful, 10644fc5c1Stron# but WITHOUT ANY WARRANTY, to the extent permitted by law; without 11644fc5c1Stron# even the implied warranty of MERCHANTABILITY or FITNESS FOR A 12644fc5c1Stron# PARTICULAR PURPOSE. 13644fc5c1Stron 142227fc13Smrgm4_ifndef([AC_AUTOCONF_VERSION], 152227fc13Smrg [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 162227fc13Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, 172227fc13Smrg[m4_warning([this file was generated for autoconf 2.68. 182227fc13SmrgYou have another version of autoconf. It may work, but is not guaranteed to. 192227fc13SmrgIf you have problems, you may need to regenerate the build system entirely. 202227fc13SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])]) 21644fc5c1Stron 222227fc13Smrgdnl fontutil.m4. Generated from fontutil.m4.in by configure. 232227fc13Smrgdnl 242227fc13Smrgdnl This file comes from X.Org's font-util 1.2.0 252227fc13Smrgdnl 262227fc13Smrgdnl Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. 272227fc13Smrgdnl 282227fc13Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a 292227fc13Smrgdnl copy of this software and associated documentation files (the "Software"), 302227fc13Smrgdnl to deal in the Software without restriction, including without limitation 312227fc13Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense, 322227fc13Smrgdnl and/or sell copies of the Software, and to permit persons to whom the 332227fc13Smrgdnl Software is furnished to do so, subject to the following conditions: 342227fc13Smrgdnl 352227fc13Smrgdnl The above copyright notice and this permission notice (including the next 362227fc13Smrgdnl paragraph) shall be included in all copies or substantial portions of the 372227fc13Smrgdnl Software. 382227fc13Smrgdnl 392227fc13Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 402227fc13Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 412227fc13Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 422227fc13Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 432227fc13Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 442227fc13Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 452227fc13Smrgdnl DEALINGS IN THE SOFTWARE. 462227fc13Smrgdnl 472227fc13Smrgdnl -------------------------------------------------------------------- 482227fc13Smrgdnl 492227fc13Smrgdnl Copyright 2005 Red Hat, Inc 502227fc13Smrgdnl 512227fc13Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its 522227fc13Smrgdnl documentation for any purpose is hereby granted without fee, provided that 532227fc13Smrgdnl the above copyright notice appear in all copies and that both that 542227fc13Smrgdnl copyright notice and this permission notice appear in supporting 552227fc13Smrgdnl documentation. 562227fc13Smrgdnl 572227fc13Smrgdnl The above copyright notice and this permission notice shall be included 582227fc13Smrgdnl in all copies or substantial portions of the Software. 592227fc13Smrgdnl 602227fc13Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 612227fc13Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 622227fc13Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 632227fc13Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 642227fc13Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 652227fc13Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 662227fc13Smrgdnl OTHER DEALINGS IN THE SOFTWARE. 672227fc13Smrgdnl 682227fc13Smrgdnl Except as contained in this notice, the name of the copyright holders shall 692227fc13Smrgdnl not be used in advertising or otherwise to promote the sale, use or 702227fc13Smrgdnl other dealings in this Software without prior written authorization 712227fc13Smrgdnl from the copyright holders. 72644fc5c1Stron 732227fc13Smrg# XORG_FONT_MACROS_VERSION(required-version) 742227fc13Smrg# ------------------------------------------ 752227fc13Smrg# Minimum version: 1.1.0 762227fc13Smrg# 772227fc13Smrg# If you're using a macro added in Version 1.1 or newer, include this in 782227fc13Smrg# your configure.ac with the minimum required version, such as: 792227fc13Smrg# XORG_FONT_MACROS_VERSION(1.1) 802227fc13Smrg# 812227fc13Smrg# To ensure that this macro is defined, also add: 822227fc13Smrg# m4_ifndef([XORG_FONT_MACROS_VERSION], 832227fc13Smrg# [m4_fatal([must install X.Org font-util 1.1 or later before running autoconf/autogen])]) 842227fc13Smrg# 852227fc13Smrg# 862227fc13Smrg# See the "minimum version" comment for each macro you use to see what 872227fc13Smrg# version you require. 882227fc13Smrgm4_defun([XORG_FONT_MACROS_VERSION],[ 892227fc13Smrgm4_define([vers_have], [1.2.0]) 902227fc13Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) 912227fc13Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) 922227fc13Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,, 932227fc13Smrg [m4_fatal([font-util major version ]maj_needed[ is required but ]vers_have[ found])]) 942227fc13Smrgm4_if(m4_version_compare(vers_have, [$1]), -1, 952227fc13Smrg [m4_fatal([font-util version $1 or higher is required but ]vers_have[ found])]) 962227fc13Smrgm4_undefine([vers_have]) 972227fc13Smrgm4_undefine([maj_have]) 982227fc13Smrgm4_undefine([maj_needed]) 992227fc13Smrg]) # XORG_FONT_MACROS_VERSION 1002227fc13Smrg 1012227fc13Smrg# XORG_FONT_CHECK_{maps}() 1022227fc13Smrg# ------------------------ 1032227fc13Smrg# Minimum version: 1.0.0 1042227fc13Smrg# These macros add --enable/disable-{maps} where {maps} are ISO8859-*, 1052227fc13Smrg# JISX0201 or KOI8_R. By default, they are all enabled. 1062227fc13Smrg 1072227fc13SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_1], [XORG_FONT_CHECK_ENCODING(ISO8859-1)]) 1082227fc13SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_2], [XORG_FONT_CHECK_ENCODING(ISO8859-2)]) 1092227fc13SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_3], [XORG_FONT_CHECK_ENCODING(ISO8859-3)]) 1102227fc13SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_4], [XORG_FONT_CHECK_ENCODING(ISO8859-4)]) 1112227fc13SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_5], [XORG_FONT_CHECK_ENCODING(ISO8859-5)]) 1122227fc13SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_6], [XORG_FONT_CHECK_ENCODING(ISO8859-6)]) 1132227fc13SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_7], [XORG_FONT_CHECK_ENCODING(ISO8859-7)]) 1142227fc13SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_8], [XORG_FONT_CHECK_ENCODING(ISO8859-8)]) 1152227fc13SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_9], [XORG_FONT_CHECK_ENCODING(ISO8859-9)]) 1162227fc13SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_10],[XORG_FONT_CHECK_ENCODING(ISO8859-10)]) 1172227fc13SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_11],[XORG_FONT_CHECK_ENCODING(ISO8859-11)]) 1182227fc13SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_12],[XORG_FONT_CHECK_ENCODING(ISO8859-12)]) 1192227fc13SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_13],[XORG_FONT_CHECK_ENCODING(ISO8859-13)]) 1202227fc13SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_14],[XORG_FONT_CHECK_ENCODING(ISO8859-14)]) 1212227fc13SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_15],[XORG_FONT_CHECK_ENCODING(ISO8859-15)]) 1222227fc13SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_16],[XORG_FONT_CHECK_ENCODING(ISO8859-16)]) 1232227fc13SmrgAC_DEFUN([XORG_FONT_CHECK_JISX0201], [XORG_FONT_CHECK_ENCODING(JISX0201)]) 1242227fc13SmrgAC_DEFUN([XORG_FONT_CHECK_KOI8_R], [XORG_FONT_CHECK_ENCODING(KOI8-R)]) 1252227fc13Smrg 1262227fc13Smrg# XORG_FONT_CHECK_ENCODING(encoding) 1272227fc13Smrg# ---------------------------------- 1282227fc13Smrg# Minimum version: 1.1.0 1292227fc13Smrg# This macro adds --enable/disable-<encoding>, enabled by default. 1302227fc13Smrg# It replaced individual copies of this code in the above macros in 1.1. 1312227fc13Smrg# Currently assumes encoding names will be all upper-case - add m4_toupper 1322227fc13Smrg# calls if this is not true in the future. 1332227fc13Smrg 1342227fc13SmrgAC_DEFUN([XORG_FONT_CHECK_ENCODING],[ 1352227fc13Smrg AC_ARG_ENABLE(m4_tolower($1), 1362227fc13Smrg AS_HELP_STRING(m4_join([-], [--disable], m4_tolower($1)), 1372227fc13Smrg [Build $1 fonts (default: yes)]), 1382227fc13Smrg [AS_TR_SH($1)=$enableval]) 1392227fc13Smrg AC_MSG_CHECKING([whether to build $1 fonts]) 1402227fc13Smrg AC_MSG_RESULT($[AS_TR_SH($1)]) 1412227fc13Smrg AM_CONDITIONAL(AS_TR_SH($1), [test "x$AS_TR_SH($1)" = xyes]) 1422227fc13Smrg]) # XORG_FONT_CHECK_ENCODING 1432227fc13Smrg 1442227fc13Smrg# XORG_FONT_CHECK_ENCODING_LIST(encoding1 encoding2....) 1452227fc13Smrg# ----------------------------------------------------- 1462227fc13Smrg# Minimum version: 1.1.0 1472227fc13Smrg# Call XORG_FONT_CHECK_ENCODING for multiple encodings at once. 1482227fc13Smrg# Add a shorthand --enable/disable-all-encodings option. 1492227fc13Smrg 1502227fc13SmrgAC_DEFUN([XORG_FONT_CHECK_ENCODING_LIST],[ 1512227fc13Smrg AC_ARG_ENABLE([all-encodings], 1522227fc13Smrg AS_HELP_STRING([--disable-all-encodings], 1532227fc13Smrg [Disable building of all font encodings]), 1542227fc13Smrg [m4_foreach_w([enc], [$1], [ 1552227fc13Smrg AS_TR_SH(enc)=$enableval 1562227fc13Smrg ])], 1572227fc13Smrg [m4_foreach_w([enc], [$1], [ 1582227fc13Smrg AS_TR_SH(enc)=yes 1592227fc13Smrg ])]) 1602227fc13Smrg m4_foreach_w([enc], [$1], [XORG_FONT_CHECK_ENCODING(enc)]) 1612227fc13Smrg]) # XORG_FONT_CHECK_ENCODING_LIST 1622227fc13Smrg 1632227fc13Smrg# XORG_FONT_REQUIRED_PROG(VARNAME, progname) 1642227fc13Smrg# ------------------------------------------ 1652227fc13Smrg# Minimum version: 1.1.0 1662227fc13Smrg# 1672227fc13Smrg# Simple wrapper around AC_PATH_PROG that errors if not found 1682227fc13Smrg# 169644fc5c1Stron 1702227fc13SmrgAC_DEFUN([XORG_FONT_REQUIRED_PROG],[ 1712227fc13Smrg AC_PATH_PROG($1, $2) 1722227fc13Smrg if test x"$$1" = x; then 1732227fc13Smrg AC_MSG_ERROR([$2 is required to build $PACKAGE_NAME.]) 1742227fc13Smrg fi 1752227fc13Smrg]) 176644fc5c1Stron 177644fc5c1Stron 1782227fc13Smrg# XORG_FONT_FCCACHE() 1792227fc13Smrg# ------------------- 1802227fc13Smrg# Minimum version: 1.1.0 1812227fc13Smrg# 1822227fc13Smrg# Set FCCACHE to path to fc-cache (fontconfig cache builder) if found 1832227fc13Smrg# Set RUN_FCCACHE to a rule suitable for substituting into a makefile 1842227fc13Smrg# to run fc-cache if found and not installing to $DESTDIR 1852227fc13Smrg# 1862227fc13Smrg# fc-cache is optional, not required, and should be skipped when making 1872227fc13Smrg# packages (installing to $DESTDIR). 1882227fc13Smrg# 1892227fc13SmrgAC_DEFUN([XORG_FONT_FCCACHE],[ 1902227fc13Smrg AC_PATH_PROG(FCCACHE, fc-cache) 1912227fc13Smrg FCCACHE_WARN='echo "** Warning: fonts.cache not built" ; echo "** Generate this file manually on host system using fc-cache"' 1922227fc13Smrg if test x"$FCCACHE" = x ; then 1932227fc13Smrg RUN_FCCACHE="${FCCACHE_WARN}" 1942227fc13Smrg else 1952227fc13Smrg RUN_FCCACHE='@(if test -z "$(DESTDIR)"; then echo $(FCCACHE) $(fontdir); $(FCCACHE) $(fontdir); else' 1962227fc13Smrg RUN_FCCACHE="${RUN_FCCACHE} ${FCCACHE_WARN} ; fi)" 1972227fc13Smrg fi 1982227fc13Smrg AC_SUBST([RUN_FCCACHE]) 1992227fc13Smrg]) 200644fc5c1Stron 201644fc5c1Stron 2022227fc13Smrg# XORG_FONT_COMMON_UTILS() 2032227fc13Smrg# ------------------------ 2042227fc13Smrg# Minimum version: 1.1.0 2052227fc13Smrg# 2062227fc13Smrg# Call XORG_FONT_REQUIRED_PROG for programs needed for all font types 207644fc5c1Stron 2082227fc13SmrgAC_DEFUN([XORG_FONT_COMMON_UTILS],[ 2092227fc13Smrg XORG_FONT_FCCACHE 2102227fc13Smrg XORG_FONT_REQUIRED_PROG(MKFONTDIR, mkfontdir) 2112227fc13Smrg]) 212644fc5c1Stron 2132227fc13Smrg# XORG_FONT_SCALED_UTILS() 2142227fc13Smrg# ------------------------ 2152227fc13Smrg# Minimum version: 1.1.0 2162227fc13Smrg# 2172227fc13Smrg# Call XORG_FONT_REQUIRED_PROG for programs needed for scalable fonts 2182227fc13Smrg# (TrueType, OpenType, Type1) 219644fc5c1Stron 2202227fc13SmrgAC_DEFUN([XORG_FONT_SCALED_UTILS],[ 2212227fc13Smrg XORG_FONT_COMMON_UTILS 2222227fc13Smrg XORG_FONT_REQUIRED_PROG(MKFONTSCALE, mkfontscale) 2232227fc13Smrg]) 224644fc5c1Stron 2252227fc13Smrg# XORG_FONT_BDF_UTILS() 2262227fc13Smrg# --------------------- 2272227fc13Smrg# Minimum version: 1.1.0 2282227fc13Smrg# 2292227fc13Smrg# Call XORG_FONT_REQUIRED_PROG for programs needed for BDF format bitmap fonts 2302227fc13Smrg# Also call XORG_FONT_CHECK_COMPRESSION to determine how to compress the 2312227fc13Smrg# PCF output files created by bdftopcf 2322227fc13Smrg 2332227fc13SmrgAC_DEFUN([XORG_FONT_BDF_UTILS],[ 2342227fc13Smrg XORG_FONT_COMMON_UTILS 2352227fc13Smrg XORG_FONT_REQUIRED_PROG(BDFTOPCF, bdftopcf) 2362227fc13Smrg XORG_FONT_CHECK_COMPRESSION 2372227fc13Smrg]) 238644fc5c1Stron 2392227fc13Smrg# XORG_FONT_CHECK_COMPRESSION() 2402227fc13Smrg# ----------------------------- 2412227fc13Smrg# Minimum version: 1.1.0 2422227fc13Smrg# 2432227fc13Smrg# Offer a --with-compression flag to control what compression method is 2442227fc13Smrg# used for pcf font files. Offers all the methods currently supported 2452227fc13Smrg# by libXfont, including no compression. 2462227fc13Smrg 2472227fc13SmrgAC_DEFUN([XORG_FONT_CHECK_COMPRESSION],[ 2482227fc13Smrg AC_MSG_CHECKING([font compression method]) 2492227fc13Smrg AC_ARG_WITH(compression, 2502227fc13Smrg [AS_HELP_STRING([--with-compression=<no|compress|gzip|bzip2>], 2512227fc13Smrg [compression method to use on pcf fonts])], 2522227fc13Smrg [compression="$withval"], [compression="yes"]) 2532227fc13Smrg if test x"$compression" = "xyes" ; then 2542227fc13Smrg compression="gzip" 2552227fc13Smrg fi 2562227fc13Smrg AC_MSG_RESULT([${compression}]) 2572227fc13Smrg case ${compression} in 2582227fc13Smrg *compress) COMPRESS_SUFFIX=".Z" ;; 2592227fc13Smrg *gzip) COMPRESS_SUFFIX=".gz" ;; 2602227fc13Smrg *bzip2) COMPRESS_SUFFIX=".bz2" ;; 2612227fc13Smrg no|none) COMPRESS_SUFFIX="" ; COMPRESS="cat" ;; 2622227fc13Smrg *) AC_MSG_ERROR([${compression} is not a supported compression method]) ;; 2632227fc13Smrg esac 2642227fc13Smrg if test x"$COMPRESS_SUFFIX" != "x" ; then 2652227fc13Smrg XORG_FONT_REQUIRED_PROG(COMPRESS, ${compression}) 2662227fc13Smrg fi 2672227fc13Smrg AC_SUBST([COMPRESS_SUFFIX]) 2682227fc13Smrg]) 269644fc5c1Stron 2702227fc13Smrg# XORG_FONT_UCS2ANY() 2712227fc13Smrg# ------------------- 2722227fc13Smrg# Minimum version: 1.1.0 2732227fc13Smrg# 2742227fc13Smrg# Call XORG_FONT_REQUIRED_PROG for ucs2any program needed for splitting 2752227fc13Smrg# Unicode-encoded BDF format bitmap fonts into subsets for older encodings. 2762227fc13Smrg# Also call pkg-config to find the directory with the encoding files needed 2772227fc13Smrg# by ucs2any, and export it as MAPFILES_PATH to the Makefiles 2782227fc13Smrg 2792227fc13SmrgAC_DEFUN([XORG_FONT_UCS2ANY],[ 2802227fc13Smrg XORG_FONT_REQUIRED_PROG(UCS2ANY, ucs2any) 2812227fc13Smrg PKG_CHECK_MODULES(MAPS, [fontutil]) 2822227fc13Smrg AC_MSG_CHECKING([for ucs2any encoding data files]) 2832227fc13Smrg MAPFILES_PATH=`pkg-config --variable=mapdir fontutil` 2842227fc13Smrg AC_SUBST(MAPFILES_PATH) 2852227fc13Smrg AC_MSG_RESULT([${MAPFILES_PATH}]) 286644fc5c1Stron]) 2872227fc13Smrg 2882227fc13Smrg 2892227fc13Smrg 2902227fc13Smrg# XORG_FONT_FC_CONFDIR() 2912227fc13Smrg# -------------------- 2922227fc13Smrg# Minimum version: 1.2.0 2932227fc13Smrg# 2942227fc13Smrg# Sets FC_CONFDIR to the fontconfig config directory 2952227fc13Smrg# (which should be --with-confdir=... when building fontconfig) 2962227fc13Smrg# found from: 2972227fc13Smrg# --with-fc-confdir=... 2982227fc13Smrg# pkg-config --variable=confdir fontconfig 2992227fc13Smrg# ${sysconfdir}/fonts 3002227fc13Smrg 3012227fc13SmrgAC_DEFUN([XORG_FONT_FC_CONFDIR],[ 3022227fc13Smrg dnl Ensure $PKG_CONFIG is set first 3032227fc13Smrg AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 3042227fc13Smrg 3052227fc13Smrg AC_MSG_CHECKING([for fontconfig's configuration directory]) 3062227fc13Smrg AC_ARG_WITH(fc-confdir, 3072227fc13Smrg AS_HELP_STRING([--with-fc-confdir=DIR], 3082227fc13Smrg [Path to fontconfig's configuration directory]), 3092227fc13Smrg [FC_CONFDIR="$withval"]) 3102227fc13Smrg # if --with-fc-confdir was not specified 3112227fc13Smrg if test "x${FC_CONFDIR}" = "x"; then 3122227fc13Smrg FC_CONFDIR=`$PKG_CONFIG --variable=confdir fontconfig` 3132227fc13Smrg fi 3142227fc13Smrg # ...and if pkg-config didn't find confdir in fontconfig.pc... 3152227fc13Smrg if test "x${FC_CONFDIR}" = "x"; then 3162227fc13Smrg FC_CONFDIR="${sysconfdir}/fonts" 3172227fc13Smrg fi 3182227fc13Smrg AC_SUBST(FC_CONFDIR) 3192227fc13Smrg AC_MSG_RESULT([${FC_CONFDIR}]) 320644fc5c1Stron]) 321644fc5c1Stron 322644fc5c1Stron 323644fc5c1Stron 3242227fc13Smrg# XORG_FONTROOTDIR() 3252227fc13Smrg# -------------------- 3262227fc13Smrg# Minimum version: 1.1.0 3272227fc13Smrg# 3282227fc13Smrg# Sets FONTROOTDIR to the root directory for font files. Uses the first 3292227fc13Smrg# found from: 3302227fc13Smrg# --with-fontrootdir 3312227fc13Smrg# pkg-config --variable=fontrootdir fontutil 3322227fc13Smrg# ${datadir}/fonts/X11 3332227fc13Smrg 3342227fc13SmrgAC_DEFUN([XORG_FONTROOTDIR],[ 3352227fc13Smrg dnl Ensure $PKG_CONFIG is set first 3362227fc13Smrg AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 3372227fc13Smrg 3382227fc13Smrg AC_MSG_CHECKING([for root directory for font files]) 3392227fc13Smrg AC_ARG_WITH(fontrootdir, 3402227fc13Smrg AS_HELP_STRING([--with-fontrootdir=DIR], 3412227fc13Smrg [Path to root directory for font files]), 3422227fc13Smrg [FONTROOTDIR="$withval"]) 3432227fc13Smrg # if --with-fontrootdir not specified... 3442227fc13Smrg if test "x${FONTROOTDIR}" = "x"; then 3452227fc13Smrg FONTROOTDIR=`$PKG_CONFIG --variable=fontrootdir fontutil` 3462227fc13Smrg fi 3472227fc13Smrg # ...and if pkg-config didn't find fontdir in fontutil.pc... 3482227fc13Smrg if test "x${FONTROOTDIR}" = "x"; then 3492227fc13Smrg FONTROOTDIR="${datadir}/fonts/X11" 3502227fc13Smrg fi 3512227fc13Smrg AC_SUBST(FONTROOTDIR) 3522227fc13Smrg AC_MSG_RESULT([${FONTROOTDIR}]) 3532227fc13Smrg]) 3542227fc13Smrg 3552227fc13Smrg# XORG_FONTSUBDIR(variable, flag, subdir) 3562227fc13Smrg# --------------------------------------- 3572227fc13Smrg# Minimum version: 1.1.0 3582227fc13Smrg# 3592227fc13Smrg# Offer a --with-<flag> flag to control directory for font installation 3602227fc13Smrg# Default is the specified <subdir> of the font root directory. 3612227fc13Smrg# Sets <variable> to the selected directory 3622227fc13Smrg 3632227fc13SmrgAC_DEFUN([XORG_FONTSUBDIR],[ 3642227fc13Smrg AC_REQUIRE([XORG_FONTROOTDIR]) 3652227fc13Smrg 3662227fc13Smrg AC_MSG_CHECKING([for directory for $3 files]) 3672227fc13Smrg AC_ARG_WITH($2, 3682227fc13Smrg [AS_HELP_STRING([--with-$2=DIR], 3692227fc13Smrg [Path to $3 files [FONTROOTDIR/$3]])], 3702227fc13Smrg [$1="${withval}"], [$1='${FONTROOTDIR}/$3']) 3712227fc13Smrg AC_SUBST($1) 3722227fc13Smrg AC_MSG_RESULT([${$1}]) 3732227fc13Smrg]) # XORG_FONTSUBDIR 3742227fc13Smrg 3752227fc13Smrg# XORG_FONTDIR(subdir) 3762227fc13Smrg# -------------------- 3772227fc13Smrg# Minimum version: 1.1.0 3782227fc13Smrg# 3792227fc13Smrg# Offer a --with-fontdir flag to control directory for font installation 3802227fc13Smrg# Default is the specified subdir of the font root directory. 3812227fc13Smrg# Sets FONTDIR to the selected directory 382644fc5c1Stron 3832227fc13SmrgAC_DEFUN([XORG_FONTDIR],[XORG_FONTSUBDIR([FONTDIR], [fontdir], [$1])]) 384644fc5c1Stron 3852227fc13Smrg# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- 3862227fc13Smrg# serial 1 (pkg-config-0.24) 3872227fc13Smrg# 3882227fc13Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>. 3892227fc13Smrg# 390644fc5c1Stron# This program is free software; you can redistribute it and/or modify 391644fc5c1Stron# it under the terms of the GNU General Public License as published by 3922227fc13Smrg# the Free Software Foundation; either version 2 of the License, or 3932227fc13Smrg# (at your option) any later version. 3942227fc13Smrg# 3952227fc13Smrg# This program is distributed in the hope that it will be useful, but 3962227fc13Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of 3972227fc13Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 3982227fc13Smrg# General Public License for more details. 3992227fc13Smrg# 400644fc5c1Stron# You should have received a copy of the GNU General Public License 401644fc5c1Stron# along with this program; if not, write to the Free Software 4022227fc13Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 4032227fc13Smrg# 4042227fc13Smrg# As a special exception to the GNU General Public License, if you 4052227fc13Smrg# distribute this file as part of a program that contains a 4062227fc13Smrg# configuration script generated by Autoconf, you may include it under 4072227fc13Smrg# the same distribution terms that you use for the rest of that program. 408644fc5c1Stron 4092227fc13Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION]) 4102227fc13Smrg# ---------------------------------- 4112227fc13SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG], 4122227fc13Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) 4132227fc13Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$]) 4142227fc13SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) 4152227fc13SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) 4162227fc13SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) 4172227fc13Smrg 4182227fc13Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then 4192227fc13Smrg AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) 4202227fc13Smrgfi 4212227fc13Smrgif test -n "$PKG_CONFIG"; then 4222227fc13Smrg _pkg_min_version=m4_default([$1], [0.9.0]) 4232227fc13Smrg AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) 4242227fc13Smrg if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then 4252227fc13Smrg AC_MSG_RESULT([yes]) 4262227fc13Smrg else 4272227fc13Smrg AC_MSG_RESULT([no]) 4282227fc13Smrg PKG_CONFIG="" 4292227fc13Smrg fi 4302227fc13Smrgfi[]dnl 4312227fc13Smrg])# PKG_PROG_PKG_CONFIG 432644fc5c1Stron 4332227fc13Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 4342227fc13Smrg# 4352227fc13Smrg# Check to see whether a particular set of modules exists. Similar 4362227fc13Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors. 4372227fc13Smrg# 4382227fc13Smrg# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 4392227fc13Smrg# only at the first occurence in configure.ac, so if the first place 4402227fc13Smrg# it's called might be skipped (such as if it is within an "if", you 4412227fc13Smrg# have to call PKG_CHECK_EXISTS manually 4422227fc13Smrg# -------------------------------------------------------------- 4432227fc13SmrgAC_DEFUN([PKG_CHECK_EXISTS], 4442227fc13Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 4452227fc13Smrgif test -n "$PKG_CONFIG" && \ 4462227fc13Smrg AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then 4472227fc13Smrg m4_default([$2], [:]) 4482227fc13Smrgm4_ifvaln([$3], [else 4492227fc13Smrg $3])dnl 4502227fc13Smrgfi]) 4512227fc13Smrg 4522227fc13Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) 4532227fc13Smrg# --------------------------------------------- 4542227fc13Smrgm4_define([_PKG_CONFIG], 4552227fc13Smrg[if test -n "$$1"; then 4562227fc13Smrg pkg_cv_[]$1="$$1" 4572227fc13Smrg elif test -n "$PKG_CONFIG"; then 4582227fc13Smrg PKG_CHECK_EXISTS([$3], 4592227fc13Smrg [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], 4602227fc13Smrg [pkg_failed=yes]) 4612227fc13Smrg else 4622227fc13Smrg pkg_failed=untried 4632227fc13Smrgfi[]dnl 4642227fc13Smrg])# _PKG_CONFIG 4652227fc13Smrg 4662227fc13Smrg# _PKG_SHORT_ERRORS_SUPPORTED 4672227fc13Smrg# ----------------------------- 4682227fc13SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], 4692227fc13Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 4702227fc13Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then 4712227fc13Smrg _pkg_short_errors_supported=yes 4722227fc13Smrgelse 4732227fc13Smrg _pkg_short_errors_supported=no 4742227fc13Smrgfi[]dnl 4752227fc13Smrg])# _PKG_SHORT_ERRORS_SUPPORTED 476644fc5c1Stron 477644fc5c1Stron 4782227fc13Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], 4792227fc13Smrg# [ACTION-IF-NOT-FOUND]) 4802227fc13Smrg# 4812227fc13Smrg# 4822227fc13Smrg# Note that if there is a possibility the first call to 4832227fc13Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an 4842227fc13Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac 4852227fc13Smrg# 4862227fc13Smrg# 4872227fc13Smrg# -------------------------------------------------------------- 4882227fc13SmrgAC_DEFUN([PKG_CHECK_MODULES], 4892227fc13Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 4902227fc13SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl 4912227fc13SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl 4922227fc13Smrg 4932227fc13Smrgpkg_failed=no 4942227fc13SmrgAC_MSG_CHECKING([for $1]) 4952227fc13Smrg 4962227fc13Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) 4972227fc13Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2]) 4982227fc13Smrg 4992227fc13Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS 5002227fc13Smrgand $1[]_LIBS to avoid the need to call pkg-config. 5012227fc13SmrgSee the pkg-config man page for more details.]) 5022227fc13Smrg 5032227fc13Smrgif test $pkg_failed = yes; then 5042227fc13Smrg AC_MSG_RESULT([no]) 5052227fc13Smrg _PKG_SHORT_ERRORS_SUPPORTED 5062227fc13Smrg if test $_pkg_short_errors_supported = yes; then 5072227fc13Smrg $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` 5082227fc13Smrg else 5092227fc13Smrg $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` 5102227fc13Smrg fi 5112227fc13Smrg # Put the nasty error message in config.log where it belongs 5122227fc13Smrg echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD 5132227fc13Smrg 5142227fc13Smrg m4_default([$4], [AC_MSG_ERROR( 5152227fc13Smrg[Package requirements ($2) were not met: 5162227fc13Smrg 5172227fc13Smrg$$1_PKG_ERRORS 5182227fc13Smrg 5192227fc13SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you 5202227fc13Smrginstalled software in a non-standard prefix. 5212227fc13Smrg 5222227fc13Smrg_PKG_TEXT])[]dnl 5232227fc13Smrg ]) 5242227fc13Smrgelif test $pkg_failed = untried; then 5252227fc13Smrg AC_MSG_RESULT([no]) 5262227fc13Smrg m4_default([$4], [AC_MSG_FAILURE( 5272227fc13Smrg[The pkg-config script could not be found or is too old. Make sure it 5282227fc13Smrgis in your PATH or set the PKG_CONFIG environment variable to the full 5292227fc13Smrgpath to pkg-config. 5302227fc13Smrg 5312227fc13Smrg_PKG_TEXT 5322227fc13Smrg 5332227fc13SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])dnl 5342227fc13Smrg ]) 5352227fc13Smrgelse 5362227fc13Smrg $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS 5372227fc13Smrg $1[]_LIBS=$pkg_cv_[]$1[]_LIBS 5382227fc13Smrg AC_MSG_RESULT([yes]) 5392227fc13Smrg $3 5402227fc13Smrgfi[]dnl 5412227fc13Smrg])# PKG_CHECK_MODULES 5422227fc13Smrg 5432227fc13Smrgdnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. 5442227fc13Smrgdnl 5452227fc13Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. 5462227fc13Smrgdnl 5472227fc13Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a 5482227fc13Smrgdnl copy of this software and associated documentation files (the "Software"), 5492227fc13Smrgdnl to deal in the Software without restriction, including without limitation 5502227fc13Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense, 5512227fc13Smrgdnl and/or sell copies of the Software, and to permit persons to whom the 5522227fc13Smrgdnl Software is furnished to do so, subject to the following conditions: 5532227fc13Smrgdnl 5542227fc13Smrgdnl The above copyright notice and this permission notice (including the next 5552227fc13Smrgdnl paragraph) shall be included in all copies or substantial portions of the 5562227fc13Smrgdnl Software. 5572227fc13Smrgdnl 5582227fc13Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 5592227fc13Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 5602227fc13Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 5612227fc13Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 5622227fc13Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 5632227fc13Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 5642227fc13Smrgdnl DEALINGS IN THE SOFTWARE. 5652227fc13Smrg 5662227fc13Smrg# XORG_MACROS_VERSION(required-version) 5672227fc13Smrg# ------------------------------------- 5682227fc13Smrg# Minimum version: 1.1.0 5692227fc13Smrg# 5702227fc13Smrg# If you're using a macro added in Version 1.1 or newer, include this in 5712227fc13Smrg# your configure.ac with the minimum required version, such as: 5722227fc13Smrg# XORG_MACROS_VERSION(1.1) 5732227fc13Smrg# 5742227fc13Smrg# To ensure that this macro is defined, also add: 5752227fc13Smrg# m4_ifndef([XORG_MACROS_VERSION], 5762227fc13Smrg# [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])]) 5772227fc13Smrg# 5782227fc13Smrg# 5792227fc13Smrg# See the "minimum version" comment for each macro you use to see what 5802227fc13Smrg# version you require. 5812227fc13Smrgm4_defun([XORG_MACROS_VERSION],[ 5822227fc13Smrgm4_define([vers_have], [1.11.0]) 5832227fc13Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) 5842227fc13Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) 5852227fc13Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,, 5862227fc13Smrg [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])]) 5872227fc13Smrgm4_if(m4_version_compare(vers_have, [$1]), -1, 5882227fc13Smrg [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])]) 5892227fc13Smrgm4_undefine([vers_have]) 5902227fc13Smrgm4_undefine([maj_have]) 5912227fc13Smrgm4_undefine([maj_needed]) 5922227fc13Smrg]) # XORG_MACROS_VERSION 5932227fc13Smrg 5942227fc13Smrg# XORG_PROG_RAWCPP() 5952227fc13Smrg# ------------------ 5962227fc13Smrg# Minimum version: 1.0.0 5972227fc13Smrg# 5982227fc13Smrg# Find cpp program and necessary flags for use in pre-processing text files 5992227fc13Smrg# such as man pages and config files 6002227fc13SmrgAC_DEFUN([XORG_PROG_RAWCPP],[ 6012227fc13SmrgAC_REQUIRE([AC_PROG_CPP]) 6022227fc13SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 6032227fc13Smrg [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) 6042227fc13Smrg 6052227fc13Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined, 6062227fc13Smrg# which is not the best choice for supporting other OS'es, but covers most 6072227fc13Smrg# of the ones we need for now. 6082227fc13SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef]) 6092227fc13SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?]) 6102227fc13Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 6112227fc13Smrg AC_MSG_RESULT([no]) 6122227fc13Smrgelse 6132227fc13Smrg if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 6142227fc13Smrg RAWCPPFLAGS=-undef 6152227fc13Smrg AC_MSG_RESULT([yes]) 6162227fc13Smrg # under Cygwin unix is still defined even with -undef 6172227fc13Smrg elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 6182227fc13Smrg RAWCPPFLAGS="-undef -ansi" 6192227fc13Smrg AC_MSG_RESULT([yes, with -ansi]) 6202227fc13Smrg else 6212227fc13Smrg AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.]) 6222227fc13Smrg fi 6232227fc13Smrgfi 6242227fc13Smrgrm -f conftest.$ac_ext 625644fc5c1Stron 6262227fc13SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional]) 6272227fc13SmrgAC_LANG_CONFTEST([Does cpp preserve "whitespace"?]) 6282227fc13Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 6292227fc13Smrg AC_MSG_RESULT([no]) 6302227fc13Smrgelse 6312227fc13Smrg if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 6322227fc13Smrg RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" 6332227fc13Smrg AC_MSG_RESULT([yes]) 6342227fc13Smrg else 6352227fc13Smrg AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) 6362227fc13Smrg fi 6372227fc13Smrgfi 6382227fc13Smrgrm -f conftest.$ac_ext 6392227fc13SmrgAC_SUBST(RAWCPPFLAGS) 6402227fc13Smrg]) # XORG_PROG_RAWCPP 641644fc5c1Stron 6422227fc13Smrg# XORG_MANPAGE_SECTIONS() 6432227fc13Smrg# ----------------------- 6442227fc13Smrg# Minimum version: 1.0.0 6452227fc13Smrg# 6462227fc13Smrg# Determine which sections man pages go in for the different man page types 6472227fc13Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. 6482227fc13Smrg# Not sure if there's any better way than just hardcoding by OS name. 6492227fc13Smrg# Override default settings by setting environment variables 6502227fc13Smrg# Added MAN_SUBSTS in version 1.8 6512227fc13Smrg# Added AC_PROG_SED in version 1.8 6522227fc13Smrg 6532227fc13SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[ 6542227fc13SmrgAC_REQUIRE([AC_CANONICAL_HOST]) 6552227fc13SmrgAC_REQUIRE([AC_PROG_SED]) 6562227fc13Smrg 6572227fc13Smrgif test x$APP_MAN_SUFFIX = x ; then 6582227fc13Smrg APP_MAN_SUFFIX=1 6592227fc13Smrgfi 6602227fc13Smrgif test x$APP_MAN_DIR = x ; then 6612227fc13Smrg APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' 6622227fc13Smrgfi 663644fc5c1Stron 6642227fc13Smrgif test x$LIB_MAN_SUFFIX = x ; then 6652227fc13Smrg LIB_MAN_SUFFIX=3 6662227fc13Smrgfi 6672227fc13Smrgif test x$LIB_MAN_DIR = x ; then 6682227fc13Smrg LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' 6692227fc13Smrgfi 670644fc5c1Stron 6712227fc13Smrgif test x$FILE_MAN_SUFFIX = x ; then 6722227fc13Smrg case $host_os in 6732227fc13Smrg solaris*) FILE_MAN_SUFFIX=4 ;; 6742227fc13Smrg *) FILE_MAN_SUFFIX=5 ;; 6752227fc13Smrg esac 6762227fc13Smrgfi 6772227fc13Smrgif test x$FILE_MAN_DIR = x ; then 6782227fc13Smrg FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' 6792227fc13Smrgfi 680644fc5c1Stron 6812227fc13Smrgif test x$MISC_MAN_SUFFIX = x ; then 6822227fc13Smrg case $host_os in 6832227fc13Smrg solaris*) MISC_MAN_SUFFIX=5 ;; 6842227fc13Smrg *) MISC_MAN_SUFFIX=7 ;; 6852227fc13Smrg esac 6862227fc13Smrgfi 6872227fc13Smrgif test x$MISC_MAN_DIR = x ; then 6882227fc13Smrg MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' 6892227fc13Smrgfi 690644fc5c1Stron 6912227fc13Smrgif test x$DRIVER_MAN_SUFFIX = x ; then 6922227fc13Smrg case $host_os in 6932227fc13Smrg solaris*) DRIVER_MAN_SUFFIX=7 ;; 6942227fc13Smrg *) DRIVER_MAN_SUFFIX=4 ;; 6952227fc13Smrg esac 6962227fc13Smrgfi 6972227fc13Smrgif test x$DRIVER_MAN_DIR = x ; then 6982227fc13Smrg DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' 6992227fc13Smrgfi 700644fc5c1Stron 7012227fc13Smrgif test x$ADMIN_MAN_SUFFIX = x ; then 7022227fc13Smrg case $host_os in 7032227fc13Smrg solaris*) ADMIN_MAN_SUFFIX=1m ;; 7042227fc13Smrg *) ADMIN_MAN_SUFFIX=8 ;; 7052227fc13Smrg esac 7062227fc13Smrgfi 7072227fc13Smrgif test x$ADMIN_MAN_DIR = x ; then 7082227fc13Smrg ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' 7092227fc13Smrgfi 710644fc5c1Stron 711644fc5c1Stron 7122227fc13SmrgAC_SUBST([APP_MAN_SUFFIX]) 7132227fc13SmrgAC_SUBST([LIB_MAN_SUFFIX]) 7142227fc13SmrgAC_SUBST([FILE_MAN_SUFFIX]) 7152227fc13SmrgAC_SUBST([MISC_MAN_SUFFIX]) 7162227fc13SmrgAC_SUBST([DRIVER_MAN_SUFFIX]) 7172227fc13SmrgAC_SUBST([ADMIN_MAN_SUFFIX]) 7182227fc13SmrgAC_SUBST([APP_MAN_DIR]) 7192227fc13SmrgAC_SUBST([LIB_MAN_DIR]) 7202227fc13SmrgAC_SUBST([FILE_MAN_DIR]) 7212227fc13SmrgAC_SUBST([MISC_MAN_DIR]) 7222227fc13SmrgAC_SUBST([DRIVER_MAN_DIR]) 7232227fc13SmrgAC_SUBST([ADMIN_MAN_DIR]) 7242227fc13Smrg 7252227fc13SmrgXORG_MAN_PAGE="X Version 11" 7262227fc13SmrgAC_SUBST([XORG_MAN_PAGE]) 7272227fc13SmrgMAN_SUBSTS="\ 7282227fc13Smrg -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ 7292227fc13Smrg -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ 7302227fc13Smrg -e 's|__xservername__|Xorg|g' \ 7312227fc13Smrg -e 's|__xconfigfile__|xorg.conf|g' \ 7322227fc13Smrg -e 's|__projectroot__|\$(prefix)|g' \ 7332227fc13Smrg -e 's|__apploaddir__|\$(appdefaultdir)|g' \ 7342227fc13Smrg -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \ 7352227fc13Smrg -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \ 7362227fc13Smrg -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \ 7372227fc13Smrg -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \ 7382227fc13Smrg -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \ 7392227fc13Smrg -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'" 7402227fc13SmrgAC_SUBST([MAN_SUBSTS]) 7412227fc13Smrg 7422227fc13Smrg]) # XORG_MANPAGE_SECTIONS 7432227fc13Smrg 7442227fc13Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION]) 7452227fc13Smrg# ------------------------ 7462227fc13Smrg# Minimum version: 1.7.0 747644fc5c1Stron# 7482227fc13Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent 7492227fc13Smrg# provided by xorg-sgml-doctools, if installed. 7502227fc13SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[ 7512227fc13SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])]) 7522227fc13SmrgXORG_SGML_PATH= 7532227fc13SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])], 7542227fc13Smrg [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`], 7552227fc13Smrg [m4_ifval([$1],[:], 7562227fc13Smrg [if test x"$cross_compiling" != x"yes" ; then 7572227fc13Smrg AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent], 7582227fc13Smrg [XORG_SGML_PATH=$prefix/share/sgml]) 7592227fc13Smrg fi]) 7602227fc13Smrg ]) 7612227fc13Smrg 7622227fc13Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing 7632227fc13Smrg# the path and the name of the doc stylesheet 7642227fc13Smrgif test "x$XORG_SGML_PATH" != "x" ; then 7652227fc13Smrg AC_MSG_RESULT([$XORG_SGML_PATH]) 7662227fc13Smrg STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11 7672227fc13Smrg XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl 7682227fc13Smrgelse 7692227fc13Smrg AC_MSG_RESULT([no]) 7702227fc13Smrgfi 7712227fc13Smrg 7722227fc13SmrgAC_SUBST(XORG_SGML_PATH) 7732227fc13SmrgAC_SUBST(STYLESHEET_SRCDIR) 7742227fc13SmrgAC_SUBST(XSL_STYLESHEET) 7752227fc13SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"]) 7762227fc13Smrg]) # XORG_CHECK_SGML_DOCTOOLS 7772227fc13Smrg 7782227fc13Smrg# XORG_CHECK_LINUXDOC 7792227fc13Smrg# ------------------- 7802227fc13Smrg# Minimum version: 1.0.0 781644fc5c1Stron# 7822227fc13Smrg# Defines the variable MAKE_TEXT if the necessary tools and 7832227fc13Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. 7842227fc13Smrg# Whether or not the necessary tools and files are found can be checked 7852227fc13Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC" 7862227fc13SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[ 7872227fc13SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) 7882227fc13SmrgAC_REQUIRE([XORG_WITH_PS2PDF]) 789644fc5c1Stron 7902227fc13SmrgAC_PATH_PROG(LINUXDOC, linuxdoc) 791644fc5c1Stron 7922227fc13SmrgAC_MSG_CHECKING([whether to build documentation]) 793644fc5c1Stron 7942227fc13Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then 7952227fc13Smrg BUILDDOC=yes 7962227fc13Smrgelse 7972227fc13Smrg BUILDDOC=no 7982227fc13Smrgfi 799644fc5c1Stron 8002227fc13SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) 801644fc5c1Stron 8022227fc13SmrgAC_MSG_RESULT([$BUILDDOC]) 803644fc5c1Stron 8042227fc13SmrgAC_MSG_CHECKING([whether to build pdf documentation]) 805644fc5c1Stron 8062227fc13Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then 8072227fc13Smrg BUILDPDFDOC=yes 808644fc5c1Stronelse 8092227fc13Smrg BUILDPDFDOC=no 810644fc5c1Stronfi 811644fc5c1Stron 8122227fc13SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 813644fc5c1Stron 8142227fc13SmrgAC_MSG_RESULT([$BUILDPDFDOC]) 815644fc5c1Stron 8162227fc13SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f" 8172227fc13SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps" 8182227fc13SmrgMAKE_PDF="$PS2PDF" 8192227fc13SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0" 820644fc5c1Stron 8212227fc13SmrgAC_SUBST(MAKE_TEXT) 8222227fc13SmrgAC_SUBST(MAKE_PS) 8232227fc13SmrgAC_SUBST(MAKE_PDF) 8242227fc13SmrgAC_SUBST(MAKE_HTML) 8252227fc13Smrg]) # XORG_CHECK_LINUXDOC 826644fc5c1Stron 8272227fc13Smrg# XORG_CHECK_DOCBOOK 8282227fc13Smrg# ------------------- 8292227fc13Smrg# Minimum version: 1.0.0 8302227fc13Smrg# 8312227fc13Smrg# Checks for the ability to build output formats from SGML DocBook source. 8322227fc13Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC" 8332227fc13Smrg# indicates whether the necessary tools and files are found and, if set, 8342227fc13Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx. 8352227fc13SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[ 8362227fc13SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) 8372227fc13Smrg 8382227fc13SmrgBUILDTXTDOC=no 8392227fc13SmrgBUILDPDFDOC=no 8402227fc13SmrgBUILDPSDOC=no 8412227fc13SmrgBUILDHTMLDOC=no 8422227fc13Smrg 8432227fc13SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps) 8442227fc13SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf) 8452227fc13SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html) 8462227fc13SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt) 8472227fc13Smrg 8482227fc13SmrgAC_MSG_CHECKING([whether to build text documentation]) 8492227fc13Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x && 8502227fc13Smrg test x$BUILD_TXTDOC != xno; then 8512227fc13Smrg BUILDTXTDOC=yes 8522227fc13Smrgfi 8532227fc13SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes]) 8542227fc13SmrgAC_MSG_RESULT([$BUILDTXTDOC]) 855644fc5c1Stron 8562227fc13SmrgAC_MSG_CHECKING([whether to build PDF documentation]) 8572227fc13Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x && 8582227fc13Smrg test x$BUILD_PDFDOC != xno; then 8592227fc13Smrg BUILDPDFDOC=yes 8602227fc13Smrgfi 8612227fc13SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 8622227fc13SmrgAC_MSG_RESULT([$BUILDPDFDOC]) 863644fc5c1Stron 8642227fc13SmrgAC_MSG_CHECKING([whether to build PostScript documentation]) 8652227fc13Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x && 8662227fc13Smrg test x$BUILD_PSDOC != xno; then 8672227fc13Smrg BUILDPSDOC=yes 8682227fc13Smrgfi 8692227fc13SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes]) 8702227fc13SmrgAC_MSG_RESULT([$BUILDPSDOC]) 871644fc5c1Stron 8722227fc13SmrgAC_MSG_CHECKING([whether to build HTML documentation]) 8732227fc13Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x && 8742227fc13Smrg test x$BUILD_HTMLDOC != xno; then 8752227fc13Smrg BUILDHTMLDOC=yes 8762227fc13Smrgfi 8772227fc13SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes]) 8782227fc13SmrgAC_MSG_RESULT([$BUILDHTMLDOC]) 8792227fc13Smrg 8802227fc13SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT" 8812227fc13SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS" 8822227fc13SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF" 8832227fc13SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML" 8842227fc13Smrg 8852227fc13SmrgAC_SUBST(MAKE_TEXT) 8862227fc13SmrgAC_SUBST(MAKE_PS) 8872227fc13SmrgAC_SUBST(MAKE_PDF) 8882227fc13SmrgAC_SUBST(MAKE_HTML) 8892227fc13Smrg]) # XORG_CHECK_DOCBOOK 8902227fc13Smrg 8912227fc13Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT]) 8922227fc13Smrg# ---------------- 8932227fc13Smrg# Minimum version: 1.5.0 8942227fc13Smrg# Minimum version for optional DEFAULT argument: 1.11.0 8952227fc13Smrg# 8962227fc13Smrg# Documentation tools are not always available on all platforms and sometimes 8972227fc13Smrg# not at the appropriate level. This macro enables a module to test for the 8982227fc13Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 8992227fc13Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions 9002227fc13Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified, 9012227fc13Smrg# --with-xmlto assumes 'auto'. 9022227fc13Smrg# 9032227fc13Smrg# Interface to module: 9042227fc13Smrg# HAVE_XMLTO: used in makefiles to conditionally generate documentation 9052227fc13Smrg# XMLTO: returns the path of the xmlto program found 9062227fc13Smrg# returns the path set by the user in the environment 9072227fc13Smrg# --with-xmlto: 'yes' user instructs the module to use xmlto 9082227fc13Smrg# 'no' user instructs the module not to use xmlto 9092227fc13Smrg# 9102227fc13Smrg# Added in version 1.10.0 9112227fc13Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation 9122227fc13Smrg# xmlto for text output requires either lynx, links, or w3m browsers 9132227fc13Smrg# 9142227fc13Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path. 9152227fc13Smrg# 9162227fc13SmrgAC_DEFUN([XORG_WITH_XMLTO],[ 9172227fc13SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command]) 9182227fc13Smrgm4_define([_defopt], m4_default([$2], [auto])) 9192227fc13SmrgAC_ARG_WITH(xmlto, 9202227fc13Smrg AS_HELP_STRING([--with-xmlto], 9212227fc13Smrg [Use xmlto to regenerate documentation (default: ]_defopt[)]), 9222227fc13Smrg [use_xmlto=$withval], [use_xmlto=]_defopt) 9232227fc13Smrgm4_undefine([_defopt]) 9242227fc13Smrg 9252227fc13Smrgif test "x$use_xmlto" = x"auto"; then 9262227fc13Smrg AC_PATH_PROG([XMLTO], [xmlto]) 9272227fc13Smrg if test "x$XMLTO" = "x"; then 9282227fc13Smrg AC_MSG_WARN([xmlto not found - documentation targets will be skipped]) 9292227fc13Smrg have_xmlto=no 9302227fc13Smrg else 9312227fc13Smrg have_xmlto=yes 9322227fc13Smrg fi 9332227fc13Smrgelif test "x$use_xmlto" = x"yes" ; then 9342227fc13Smrg AC_PATH_PROG([XMLTO], [xmlto]) 9352227fc13Smrg if test "x$XMLTO" = "x"; then 9362227fc13Smrg AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH]) 9372227fc13Smrg fi 9382227fc13Smrg have_xmlto=yes 9392227fc13Smrgelif test "x$use_xmlto" = x"no" ; then 9402227fc13Smrg if test "x$XMLTO" != "x"; then 9412227fc13Smrg AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified]) 9422227fc13Smrg fi 9432227fc13Smrg have_xmlto=no 944644fc5c1Stronelse 9452227fc13Smrg AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no']) 946644fc5c1Stronfi 947644fc5c1Stron 9482227fc13Smrg# Test for a minimum version of xmlto, if provided. 9492227fc13Smrgm4_ifval([$1], 9502227fc13Smrg[if test "$have_xmlto" = yes; then 9512227fc13Smrg # scrape the xmlto version 9522227fc13Smrg AC_MSG_CHECKING([the xmlto version]) 9532227fc13Smrg xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3` 9542227fc13Smrg AC_MSG_RESULT([$xmlto_version]) 9552227fc13Smrg AS_VERSION_COMPARE([$xmlto_version], [$1], 9562227fc13Smrg [if test "x$use_xmlto" = xauto; then 9572227fc13Smrg AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed]) 9582227fc13Smrg have_xmlto=no 9592227fc13Smrg else 9602227fc13Smrg AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed]) 9612227fc13Smrg fi]) 9622227fc13Smrgfi]) 9632227fc13Smrg 9642227fc13Smrg# Test for the ability of xmlto to generate a text target 9652227fc13Smrghave_xmlto_text=no 9662227fc13Smrgcat > conftest.xml << "EOF" 9672227fc13SmrgEOF 9682227fc13SmrgAS_IF([test "$have_xmlto" = yes], 9692227fc13Smrg [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1], 9702227fc13Smrg [have_xmlto_text=yes], 9712227fc13Smrg [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])]) 9722227fc13Smrgrm -f conftest.xml 9732227fc13SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes]) 9742227fc13SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes]) 9752227fc13Smrg]) # XORG_WITH_XMLTO 9762227fc13Smrg 9772227fc13Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT]) 9782227fc13Smrg# ---------------- 9792227fc13Smrg# Minimum version: 1.5.0 9802227fc13Smrg# Minimum version for optional DEFAULT argument: 1.11.0 9812227fc13Smrg# 9822227fc13Smrg# Documentation tools are not always available on all platforms and sometimes 9832227fc13Smrg# not at the appropriate level. This macro enables a module to test for the 9842227fc13Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 9852227fc13Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions 9862227fc13Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified, 9872227fc13Smrg# --with-asciidoc assumes 'auto'. 9882227fc13Smrg# 9892227fc13Smrg# Interface to module: 9902227fc13Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation 9912227fc13Smrg# ASCIIDOC: returns the path of the asciidoc program found 9922227fc13Smrg# returns the path set by the user in the environment 9932227fc13Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc 9942227fc13Smrg# 'no' user instructs the module not to use asciidoc 9952227fc13Smrg# 9962227fc13Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path. 9972227fc13Smrg# 9982227fc13SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[ 9992227fc13SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command]) 10002227fc13Smrgm4_define([_defopt], m4_default([$2], [auto])) 10012227fc13SmrgAC_ARG_WITH(asciidoc, 10022227fc13Smrg AS_HELP_STRING([--with-asciidoc], 10032227fc13Smrg [Use asciidoc to regenerate documentation (default: ]_defopt[)]), 10042227fc13Smrg [use_asciidoc=$withval], [use_asciidoc=]_defopt) 10052227fc13Smrgm4_undefine([_defopt]) 10062227fc13Smrg 10072227fc13Smrgif test "x$use_asciidoc" = x"auto"; then 10082227fc13Smrg AC_PATH_PROG([ASCIIDOC], [asciidoc]) 10092227fc13Smrg if test "x$ASCIIDOC" = "x"; then 10102227fc13Smrg AC_MSG_WARN([asciidoc not found - documentation targets will be skipped]) 10112227fc13Smrg have_asciidoc=no 10122227fc13Smrg else 10132227fc13Smrg have_asciidoc=yes 10142227fc13Smrg fi 10152227fc13Smrgelif test "x$use_asciidoc" = x"yes" ; then 10162227fc13Smrg AC_PATH_PROG([ASCIIDOC], [asciidoc]) 10172227fc13Smrg if test "x$ASCIIDOC" = "x"; then 10182227fc13Smrg AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH]) 10192227fc13Smrg fi 10202227fc13Smrg have_asciidoc=yes 10212227fc13Smrgelif test "x$use_asciidoc" = x"no" ; then 10222227fc13Smrg if test "x$ASCIIDOC" != "x"; then 10232227fc13Smrg AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified]) 10242227fc13Smrg fi 10252227fc13Smrg have_asciidoc=no 10262227fc13Smrgelse 10272227fc13Smrg AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no']) 10282227fc13Smrgfi 10292227fc13Smrgm4_ifval([$1], 10302227fc13Smrg[if test "$have_asciidoc" = yes; then 10312227fc13Smrg # scrape the asciidoc version 10322227fc13Smrg AC_MSG_CHECKING([the asciidoc version]) 10332227fc13Smrg asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2` 10342227fc13Smrg AC_MSG_RESULT([$asciidoc_version]) 10352227fc13Smrg AS_VERSION_COMPARE([$asciidoc_version], [$1], 10362227fc13Smrg [if test "x$use_asciidoc" = xauto; then 10372227fc13Smrg AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed]) 10382227fc13Smrg have_asciidoc=no 10392227fc13Smrg else 10402227fc13Smrg AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed]) 10412227fc13Smrg fi]) 10422227fc13Smrgfi]) 10432227fc13SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes]) 10442227fc13Smrg]) # XORG_WITH_ASCIIDOC 10452227fc13Smrg 10462227fc13Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT]) 10472227fc13Smrg# -------------------------------- 10482227fc13Smrg# Minimum version: 1.5.0 10492227fc13Smrg# Minimum version for optional DEFAULT argument: 1.11.0 10502227fc13Smrg# 10512227fc13Smrg# Documentation tools are not always available on all platforms and sometimes 10522227fc13Smrg# not at the appropriate level. This macro enables a module to test for the 10532227fc13Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 10542227fc13Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions 10552227fc13Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified, 10562227fc13Smrg# --with-doxygen assumes 'auto'. 10572227fc13Smrg# 10582227fc13Smrg# Interface to module: 10592227fc13Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation 10602227fc13Smrg# DOXYGEN: returns the path of the doxygen program found 10612227fc13Smrg# returns the path set by the user in the environment 10622227fc13Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen 10632227fc13Smrg# 'no' user instructs the module not to use doxygen 10642227fc13Smrg# 10652227fc13Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path. 10662227fc13Smrg# 10672227fc13SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[ 10682227fc13SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command]) 10692227fc13Smrgm4_define([_defopt], m4_default([$2], [auto])) 10702227fc13SmrgAC_ARG_WITH(doxygen, 10712227fc13Smrg AS_HELP_STRING([--with-doxygen], 10722227fc13Smrg [Use doxygen to regenerate documentation (default: ]_defopt[)]), 10732227fc13Smrg [use_doxygen=$withval], [use_doxygen=]_defopt) 10742227fc13Smrgm4_undefine([_defopt]) 10752227fc13Smrg 10762227fc13Smrgif test "x$use_doxygen" = x"auto"; then 10772227fc13Smrg AC_PATH_PROG([DOXYGEN], [doxygen]) 10782227fc13Smrg if test "x$DOXYGEN" = "x"; then 10792227fc13Smrg AC_MSG_WARN([doxygen not found - documentation targets will be skipped]) 10802227fc13Smrg have_doxygen=no 10812227fc13Smrg else 10822227fc13Smrg have_doxygen=yes 10832227fc13Smrg fi 10842227fc13Smrgelif test "x$use_doxygen" = x"yes" ; then 10852227fc13Smrg AC_PATH_PROG([DOXYGEN], [doxygen]) 10862227fc13Smrg if test "x$DOXYGEN" = "x"; then 10872227fc13Smrg AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH]) 10882227fc13Smrg fi 10892227fc13Smrg have_doxygen=yes 10902227fc13Smrgelif test "x$use_doxygen" = x"no" ; then 10912227fc13Smrg if test "x$DOXYGEN" != "x"; then 10922227fc13Smrg AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified]) 10932227fc13Smrg fi 10942227fc13Smrg have_doxygen=no 10952227fc13Smrgelse 10962227fc13Smrg AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no']) 10972227fc13Smrgfi 10982227fc13Smrgm4_ifval([$1], 10992227fc13Smrg[if test "$have_doxygen" = yes; then 11002227fc13Smrg # scrape the doxygen version 11012227fc13Smrg AC_MSG_CHECKING([the doxygen version]) 11022227fc13Smrg doxygen_version=`$DOXYGEN --version 2>/dev/null` 11032227fc13Smrg AC_MSG_RESULT([$doxygen_version]) 11042227fc13Smrg AS_VERSION_COMPARE([$doxygen_version], [$1], 11052227fc13Smrg [if test "x$use_doxygen" = xauto; then 11062227fc13Smrg AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed]) 11072227fc13Smrg have_doxygen=no 11082227fc13Smrg else 11092227fc13Smrg AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed]) 11102227fc13Smrg fi]) 11112227fc13Smrgfi]) 11122227fc13SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes]) 11132227fc13Smrg]) # XORG_WITH_DOXYGEN 11142227fc13Smrg 11152227fc13Smrg# XORG_WITH_GROFF([DEFAULT]) 11162227fc13Smrg# ---------------- 11172227fc13Smrg# Minimum version: 1.6.0 11182227fc13Smrg# Minimum version for optional DEFAULT argument: 1.11.0 11192227fc13Smrg# 11202227fc13Smrg# Documentation tools are not always available on all platforms and sometimes 11212227fc13Smrg# not at the appropriate level. This macro enables a module to test for the 11222227fc13Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 11232227fc13Smrg# the --with-groff option, it allows maximum flexibilty in making decisions 11242227fc13Smrg# as whether or not to use the groff package. When DEFAULT is not specified, 11252227fc13Smrg# --with-groff assumes 'auto'. 11262227fc13Smrg# 11272227fc13Smrg# Interface to module: 11282227fc13Smrg# HAVE_GROFF: used in makefiles to conditionally generate documentation 11292227fc13Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package 11302227fc13Smrg# HAVE_GROFF_MS: the -ms macros package 11312227fc13Smrg# GROFF: returns the path of the groff program found 11322227fc13Smrg# returns the path set by the user in the environment 11332227fc13Smrg# --with-groff: 'yes' user instructs the module to use groff 11342227fc13Smrg# 'no' user instructs the module not to use groff 11352227fc13Smrg# 11362227fc13Smrg# Added in version 1.9.0: 11372227fc13Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format: 11382227fc13Smrg# pnmcut pnmcrop pnmtopng pnmtops from the netpbm package. 11392227fc13Smrg# psselect from the psutils package. 11402227fc13Smrg# the ghostcript package. Refer to the grohtml man pages 11412227fc13Smrg# 11422227fc13Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path. 11432227fc13Smrg# 11442227fc13Smrg# OS and distros often splits groff in a basic and full package, the former 11452227fc13Smrg# having the groff program and the later having devices, fonts and macros 11462227fc13Smrg# Checking for the groff executable is not enough. 11472227fc13Smrg# 11482227fc13Smrg# If macros are missing, we cannot assume that groff is useless, so we don't 11492227fc13Smrg# unset HAVE_GROFF or GROFF env variables. 11502227fc13Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false. 11512227fc13Smrg# 11522227fc13SmrgAC_DEFUN([XORG_WITH_GROFF],[ 11532227fc13SmrgAC_ARG_VAR([GROFF], [Path to groff command]) 11542227fc13Smrgm4_define([_defopt], m4_default([$1], [auto])) 11552227fc13SmrgAC_ARG_WITH(groff, 11562227fc13Smrg AS_HELP_STRING([--with-groff], 11572227fc13Smrg [Use groff to regenerate documentation (default: ]_defopt[)]), 11582227fc13Smrg [use_groff=$withval], [use_groff=]_defopt) 11592227fc13Smrgm4_undefine([_defopt]) 11602227fc13Smrg 11612227fc13Smrgif test "x$use_groff" = x"auto"; then 11622227fc13Smrg AC_PATH_PROG([GROFF], [groff]) 11632227fc13Smrg if test "x$GROFF" = "x"; then 11642227fc13Smrg AC_MSG_WARN([groff not found - documentation targets will be skipped]) 11652227fc13Smrg have_groff=no 11662227fc13Smrg else 11672227fc13Smrg have_groff=yes 11682227fc13Smrg fi 11692227fc13Smrgelif test "x$use_groff" = x"yes" ; then 11702227fc13Smrg AC_PATH_PROG([GROFF], [groff]) 11712227fc13Smrg if test "x$GROFF" = "x"; then 11722227fc13Smrg AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH]) 11732227fc13Smrg fi 11742227fc13Smrg have_groff=yes 11752227fc13Smrgelif test "x$use_groff" = x"no" ; then 11762227fc13Smrg if test "x$GROFF" != "x"; then 11772227fc13Smrg AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified]) 11782227fc13Smrg fi 11792227fc13Smrg have_groff=no 11802227fc13Smrgelse 11812227fc13Smrg AC_MSG_ERROR([--with-groff expects 'yes' or 'no']) 11822227fc13Smrgfi 1183644fc5c1Stron 11842227fc13Smrg# We have groff, test for the presence of the macro packages 11852227fc13Smrgif test "x$have_groff" = x"yes"; then 11862227fc13Smrg AC_MSG_CHECKING([for ${GROFF} -ms macros]) 11872227fc13Smrg if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then 11882227fc13Smrg groff_ms_works=yes 11892227fc13Smrg else 11902227fc13Smrg groff_ms_works=no 11912227fc13Smrg fi 11922227fc13Smrg AC_MSG_RESULT([$groff_ms_works]) 11932227fc13Smrg AC_MSG_CHECKING([for ${GROFF} -mm macros]) 11942227fc13Smrg if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then 11952227fc13Smrg groff_mm_works=yes 11962227fc13Smrg else 11972227fc13Smrg groff_mm_works=no 11982227fc13Smrg fi 11992227fc13Smrg AC_MSG_RESULT([$groff_mm_works]) 12002227fc13Smrgfi 1201644fc5c1Stron 12022227fc13Smrg# We have groff, test for HTML dependencies, one command per package 12032227fc13Smrgif test "x$have_groff" = x"yes"; then 12042227fc13Smrg AC_PATH_PROGS(GS_PATH, [gs gswin32c]) 12052227fc13Smrg AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng]) 12062227fc13Smrg AC_PATH_PROG(PSSELECT_PATH, [psselect]) 12072227fc13Smrg if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then 12082227fc13Smrg have_groff_html=yes 12092227fc13Smrg else 12102227fc13Smrg have_groff_html=no 12112227fc13Smrg AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages]) 12122227fc13Smrg fi 12132227fc13Smrgfi 1214644fc5c1Stron 12152227fc13Smrg# Set Automake conditionals for Makefiles 12162227fc13SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes]) 12172227fc13SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes]) 12182227fc13SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes]) 12192227fc13SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes]) 12202227fc13Smrg]) # XORG_WITH_GROFF 12212227fc13Smrg 12222227fc13Smrg# XORG_WITH_FOP([DEFAULT]) 12232227fc13Smrg# ---------------- 12242227fc13Smrg# Minimum version: 1.6.0 12252227fc13Smrg# Minimum version for optional DEFAULT argument: 1.11.0 12262227fc13Smrg# 12272227fc13Smrg# Documentation tools are not always available on all platforms and sometimes 12282227fc13Smrg# not at the appropriate level. This macro enables a module to test for the 12292227fc13Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 12302227fc13Smrg# the --with-fop option, it allows maximum flexibilty in making decisions 12312227fc13Smrg# as whether or not to use the fop package. When DEFAULT is not specified, 12322227fc13Smrg# --with-fop assumes 'auto'. 12332227fc13Smrg# 12342227fc13Smrg# Interface to module: 12352227fc13Smrg# HAVE_FOP: used in makefiles to conditionally generate documentation 12362227fc13Smrg# FOP: returns the path of the fop program found 12372227fc13Smrg# returns the path set by the user in the environment 12382227fc13Smrg# --with-fop: 'yes' user instructs the module to use fop 12392227fc13Smrg# 'no' user instructs the module not to use fop 12402227fc13Smrg# 12412227fc13Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path. 12422227fc13Smrg# 12432227fc13SmrgAC_DEFUN([XORG_WITH_FOP],[ 12442227fc13SmrgAC_ARG_VAR([FOP], [Path to fop command]) 12452227fc13Smrgm4_define([_defopt], m4_default([$1], [auto])) 12462227fc13SmrgAC_ARG_WITH(fop, 12472227fc13Smrg AS_HELP_STRING([--with-fop], 12482227fc13Smrg [Use fop to regenerate documentation (default: ]_defopt[)]), 12492227fc13Smrg [use_fop=$withval], [use_fop=]_defopt) 12502227fc13Smrgm4_undefine([_defopt]) 12512227fc13Smrg 12522227fc13Smrgif test "x$use_fop" = x"auto"; then 12532227fc13Smrg AC_PATH_PROG([FOP], [fop]) 12542227fc13Smrg if test "x$FOP" = "x"; then 12552227fc13Smrg AC_MSG_WARN([fop not found - documentation targets will be skipped]) 12562227fc13Smrg have_fop=no 12572227fc13Smrg else 12582227fc13Smrg have_fop=yes 12592227fc13Smrg fi 12602227fc13Smrgelif test "x$use_fop" = x"yes" ; then 12612227fc13Smrg AC_PATH_PROG([FOP], [fop]) 12622227fc13Smrg if test "x$FOP" = "x"; then 12632227fc13Smrg AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH]) 12642227fc13Smrg fi 12652227fc13Smrg have_fop=yes 12662227fc13Smrgelif test "x$use_fop" = x"no" ; then 12672227fc13Smrg if test "x$FOP" != "x"; then 12682227fc13Smrg AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified]) 12692227fc13Smrg fi 12702227fc13Smrg have_fop=no 12712227fc13Smrgelse 12722227fc13Smrg AC_MSG_ERROR([--with-fop expects 'yes' or 'no']) 12732227fc13Smrgfi 12742227fc13SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes]) 12752227fc13Smrg]) # XORG_WITH_FOP 1276644fc5c1Stron 12772227fc13Smrg# XORG_WITH_PS2PDF([DEFAULT]) 12782227fc13Smrg# ---------------- 12792227fc13Smrg# Minimum version: 1.6.0 12802227fc13Smrg# Minimum version for optional DEFAULT argument: 1.11.0 12812227fc13Smrg# 12822227fc13Smrg# Documentation tools are not always available on all platforms and sometimes 12832227fc13Smrg# not at the appropriate level. This macro enables a module to test for the 12842227fc13Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 12852227fc13Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions 12862227fc13Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified, 12872227fc13Smrg# --with-ps2pdf assumes 'auto'. 12882227fc13Smrg# 12892227fc13Smrg# Interface to module: 12902227fc13Smrg# HAVE_PS2PDF: used in makefiles to conditionally generate documentation 12912227fc13Smrg# PS2PDF: returns the path of the ps2pdf program found 12922227fc13Smrg# returns the path set by the user in the environment 12932227fc13Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf 12942227fc13Smrg# 'no' user instructs the module not to use ps2pdf 12952227fc13Smrg# 12962227fc13Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path. 12972227fc13Smrg# 12982227fc13SmrgAC_DEFUN([XORG_WITH_PS2PDF],[ 12992227fc13SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command]) 13002227fc13Smrgm4_define([_defopt], m4_default([$1], [auto])) 13012227fc13SmrgAC_ARG_WITH(ps2pdf, 13022227fc13Smrg AS_HELP_STRING([--with-ps2pdf], 13032227fc13Smrg [Use ps2pdf to regenerate documentation (default: ]_defopt[)]), 13042227fc13Smrg [use_ps2pdf=$withval], [use_ps2pdf=]_defopt) 13052227fc13Smrgm4_undefine([_defopt]) 13062227fc13Smrg 13072227fc13Smrgif test "x$use_ps2pdf" = x"auto"; then 13082227fc13Smrg AC_PATH_PROG([PS2PDF], [ps2pdf]) 13092227fc13Smrg if test "x$PS2PDF" = "x"; then 13102227fc13Smrg AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped]) 13112227fc13Smrg have_ps2pdf=no 13122227fc13Smrg else 13132227fc13Smrg have_ps2pdf=yes 13142227fc13Smrg fi 13152227fc13Smrgelif test "x$use_ps2pdf" = x"yes" ; then 13162227fc13Smrg AC_PATH_PROG([PS2PDF], [ps2pdf]) 13172227fc13Smrg if test "x$PS2PDF" = "x"; then 13182227fc13Smrg AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH]) 13192227fc13Smrg fi 13202227fc13Smrg have_ps2pdf=yes 13212227fc13Smrgelif test "x$use_ps2pdf" = x"no" ; then 13222227fc13Smrg if test "x$PS2PDF" != "x"; then 13232227fc13Smrg AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified]) 13242227fc13Smrg fi 13252227fc13Smrg have_ps2pdf=no 13262227fc13Smrgelse 13272227fc13Smrg AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no']) 13282227fc13Smrgfi 13292227fc13SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes]) 13302227fc13Smrg]) # XORG_WITH_PS2PDF 1331644fc5c1Stron 13322227fc13Smrg# XORG_ENABLE_DOCS (enable_docs=yes) 13332227fc13Smrg# ---------------- 13342227fc13Smrg# Minimum version: 1.6.0 1335644fc5c1Stron# 13362227fc13Smrg# Documentation tools are not always available on all platforms and sometimes 13372227fc13Smrg# not at the appropriate level. This macro enables a builder to skip all 13382227fc13Smrg# documentation targets except traditional man pages. 13392227fc13Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 13402227fc13Smrg# maximum flexibilty in controlling documentation building. 13412227fc13Smrg# Refer to: 13422227fc13Smrg# XORG_WITH_XMLTO --with-xmlto 13432227fc13Smrg# XORG_WITH_ASCIIDOC --with-asciidoc 13442227fc13Smrg# XORG_WITH_DOXYGEN --with-doxygen 13452227fc13Smrg# XORG_WITH_FOP --with-fop 13462227fc13Smrg# XORG_WITH_GROFF --with-groff 13472227fc13Smrg# XORG_WITH_PS2PDF --with-ps2pdf 1348644fc5c1Stron# 13492227fc13Smrg# Interface to module: 13502227fc13Smrg# ENABLE_DOCS: used in makefiles to conditionally generate documentation 13512227fc13Smrg# --enable-docs: 'yes' user instructs the module to generate docs 13522227fc13Smrg# 'no' user instructs the module not to generate docs 13532227fc13Smrg# parm1: specify the default value, yes or no. 1354644fc5c1Stron# 13552227fc13SmrgAC_DEFUN([XORG_ENABLE_DOCS],[ 13562227fc13Smrgm4_define([default], m4_default([$1], [yes])) 13572227fc13SmrgAC_ARG_ENABLE(docs, 13582227fc13Smrg AS_HELP_STRING([--enable-docs], 13592227fc13Smrg [Enable building the documentation (default: ]default[)]), 13602227fc13Smrg [build_docs=$enableval], [build_docs=]default) 13612227fc13Smrgm4_undefine([default]) 13622227fc13SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes]) 13632227fc13SmrgAC_MSG_CHECKING([whether to build documentation]) 13642227fc13SmrgAC_MSG_RESULT([$build_docs]) 13652227fc13Smrg]) # XORG_ENABLE_DOCS 13662227fc13Smrg 13672227fc13Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes) 13682227fc13Smrg# ---------------- 13692227fc13Smrg# Minimum version: 1.6.0 1370644fc5c1Stron# 13712227fc13Smrg# This macro enables a builder to skip all developer documentation. 13722227fc13Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 13732227fc13Smrg# maximum flexibilty in controlling documentation building. 13742227fc13Smrg# Refer to: 13752227fc13Smrg# XORG_WITH_XMLTO --with-xmlto 13762227fc13Smrg# XORG_WITH_ASCIIDOC --with-asciidoc 13772227fc13Smrg# XORG_WITH_DOXYGEN --with-doxygen 13782227fc13Smrg# XORG_WITH_FOP --with-fop 13792227fc13Smrg# XORG_WITH_GROFF --with-groff 13802227fc13Smrg# XORG_WITH_PS2PDF --with-ps2pdf 1381644fc5c1Stron# 13822227fc13Smrg# Interface to module: 13832227fc13Smrg# ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs 13842227fc13Smrg# --enable-devel-docs: 'yes' user instructs the module to generate developer docs 13852227fc13Smrg# 'no' user instructs the module not to generate developer docs 13862227fc13Smrg# parm1: specify the default value, yes or no. 13872227fc13Smrg# 13882227fc13SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[ 13892227fc13Smrgm4_define([devel_default], m4_default([$1], [yes])) 13902227fc13SmrgAC_ARG_ENABLE(devel-docs, 13912227fc13Smrg AS_HELP_STRING([--enable-devel-docs], 13922227fc13Smrg [Enable building the developer documentation (default: ]devel_default[)]), 13932227fc13Smrg [build_devel_docs=$enableval], [build_devel_docs=]devel_default) 13942227fc13Smrgm4_undefine([devel_default]) 13952227fc13SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes]) 13962227fc13SmrgAC_MSG_CHECKING([whether to build developer documentation]) 13972227fc13SmrgAC_MSG_RESULT([$build_devel_docs]) 13982227fc13Smrg]) # XORG_ENABLE_DEVEL_DOCS 13992227fc13Smrg 14002227fc13Smrg# XORG_ENABLE_SPECS (enable_specs=yes) 14012227fc13Smrg# ---------------- 14022227fc13Smrg# Minimum version: 1.6.0 14032227fc13Smrg# 14042227fc13Smrg# This macro enables a builder to skip all functional specification targets. 14052227fc13Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 14062227fc13Smrg# maximum flexibilty in controlling documentation building. 14072227fc13Smrg# Refer to: 14082227fc13Smrg# XORG_WITH_XMLTO --with-xmlto 14092227fc13Smrg# XORG_WITH_ASCIIDOC --with-asciidoc 14102227fc13Smrg# XORG_WITH_DOXYGEN --with-doxygen 14112227fc13Smrg# XORG_WITH_FOP --with-fop 14122227fc13Smrg# XORG_WITH_GROFF --with-groff 14132227fc13Smrg# XORG_WITH_PS2PDF --with-ps2pdf 14142227fc13Smrg# 14152227fc13Smrg# Interface to module: 14162227fc13Smrg# ENABLE_SPECS: used in makefiles to conditionally generate specs 14172227fc13Smrg# --enable-specs: 'yes' user instructs the module to generate specs 14182227fc13Smrg# 'no' user instructs the module not to generate specs 14192227fc13Smrg# parm1: specify the default value, yes or no. 14202227fc13Smrg# 14212227fc13SmrgAC_DEFUN([XORG_ENABLE_SPECS],[ 14222227fc13Smrgm4_define([spec_default], m4_default([$1], [yes])) 14232227fc13SmrgAC_ARG_ENABLE(specs, 14242227fc13Smrg AS_HELP_STRING([--enable-specs], 14252227fc13Smrg [Enable building the specs (default: ]spec_default[)]), 14262227fc13Smrg [build_specs=$enableval], [build_specs=]spec_default) 14272227fc13Smrgm4_undefine([spec_default]) 14282227fc13SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes]) 14292227fc13SmrgAC_MSG_CHECKING([whether to build functional specifications]) 14302227fc13SmrgAC_MSG_RESULT([$build_specs]) 14312227fc13Smrg]) # XORG_ENABLE_SPECS 14322227fc13Smrg 14332227fc13Smrg# XORG_CHECK_MALLOC_ZERO 14342227fc13Smrg# ---------------------- 14352227fc13Smrg# Minimum version: 1.0.0 14362227fc13Smrg# 14372227fc13Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if 14382227fc13Smrg# malloc(0) returns NULL. Packages should add one of these cflags to 14392227fc13Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. 14402227fc13SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[ 14412227fc13SmrgAC_ARG_ENABLE(malloc0returnsnull, 14422227fc13Smrg AS_HELP_STRING([--enable-malloc0returnsnull], 14432227fc13Smrg [malloc(0) returns NULL (default: auto)]), 14442227fc13Smrg [MALLOC_ZERO_RETURNS_NULL=$enableval], 14452227fc13Smrg [MALLOC_ZERO_RETURNS_NULL=auto]) 14462227fc13Smrg 14472227fc13SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL]) 14482227fc13Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then 14492227fc13Smrg AC_RUN_IFELSE([ 14502227fc13Smrgchar *malloc(); 14512227fc13Smrgchar *realloc(); 14522227fc13Smrgchar *calloc(); 14532227fc13Smrgmain() { 14542227fc13Smrg char *m0, *r0, *c0, *p; 14552227fc13Smrg m0 = malloc(0); 14562227fc13Smrg p = malloc(10); 14572227fc13Smrg r0 = realloc(p,0); 14582227fc13Smrg c0 = calloc(0); 14592227fc13Smrg exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1); 14602227fc13Smrg}], 14612227fc13Smrg [MALLOC_ZERO_RETURNS_NULL=yes], 14622227fc13Smrg [MALLOC_ZERO_RETURNS_NULL=no], 14632227fc13Smrg [MALLOC_ZERO_RETURNS_NULL=yes]) 14642227fc13Smrgfi 14652227fc13SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) 1466644fc5c1Stron 14672227fc13Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then 14682227fc13Smrg MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" 14692227fc13Smrg XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS 14702227fc13Smrg XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" 14712227fc13Smrgelse 14722227fc13Smrg MALLOC_ZERO_CFLAGS="" 14732227fc13Smrg XMALLOC_ZERO_CFLAGS="" 14742227fc13Smrg XTMALLOC_ZERO_CFLAGS="" 14752227fc13Smrgfi 1476644fc5c1Stron 14772227fc13SmrgAC_SUBST([MALLOC_ZERO_CFLAGS]) 14782227fc13SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS]) 14792227fc13SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS]) 14802227fc13Smrg]) # XORG_CHECK_MALLOC_ZERO 1481644fc5c1Stron 14822227fc13Smrg# XORG_WITH_LINT() 14832227fc13Smrg# ---------------- 14842227fc13Smrg# Minimum version: 1.1.0 14852227fc13Smrg# 14862227fc13Smrg# This macro enables the use of a tool that flags some suspicious and 14872227fc13Smrg# non-portable constructs (likely to be bugs) in C language source code. 14882227fc13Smrg# It will attempt to locate the tool and use appropriate options. 14892227fc13Smrg# There are various lint type tools on different platforms. 14902227fc13Smrg# 14912227fc13Smrg# Interface to module: 14922227fc13Smrg# LINT: returns the path to the tool found on the platform 14932227fc13Smrg# or the value set to LINT on the configure cmd line 14942227fc13Smrg# also an Automake conditional 14952227fc13Smrg# LINT_FLAGS: an Automake variable with appropriate flags 14962227fc13Smrg# 14972227fc13Smrg# --with-lint: 'yes' user instructs the module to use lint 14982227fc13Smrg# 'no' user instructs the module not to use lint (default) 14992227fc13Smrg# 15002227fc13Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path. 15012227fc13Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim. 15022227fc13Smrg# 15032227fc13SmrgAC_DEFUN([XORG_WITH_LINT],[ 15042227fc13Smrg 15052227fc13SmrgAC_ARG_VAR([LINT], [Path to a lint-style command]) 15062227fc13SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command]) 15072227fc13SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint], 15082227fc13Smrg [Use a lint-style source code checker (default: disabled)])], 15092227fc13Smrg [use_lint=$withval], [use_lint=no]) 15102227fc13Smrg 15112227fc13Smrg# Obtain platform specific info like program name and options 15122227fc13Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris 15132227fc13Smrgcase $host_os in 15142227fc13Smrg *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*) 15152227fc13Smrg lint_name=splint 15162227fc13Smrg lint_options="-badflag" 15172227fc13Smrg ;; 15182227fc13Smrg *freebsd* | *netbsd*) 15192227fc13Smrg lint_name=lint 15202227fc13Smrg lint_options="-u -b" 15212227fc13Smrg ;; 15222227fc13Smrg *solaris*) 15232227fc13Smrg lint_name=lint 15242227fc13Smrg lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2" 15252227fc13Smrg ;; 15262227fc13Smrgesac 15272227fc13Smrg 15282227fc13Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user) 15292227fc13Smrgif test "x$use_lint" = x"yes" ; then 15302227fc13Smrg AC_PATH_PROG([LINT], [$lint_name]) 15312227fc13Smrg if test "x$LINT" = "x"; then 15322227fc13Smrg AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH]) 15332227fc13Smrg fi 15342227fc13Smrgelif test "x$use_lint" = x"no" ; then 15352227fc13Smrg if test "x$LINT" != "x"; then 15362227fc13Smrg AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified]) 15372227fc13Smrg fi 15382227fc13Smrgelse 15392227fc13Smrg AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.]) 15402227fc13Smrgfi 1541644fc5c1Stron 15422227fc13Smrg# User supplied flags override default flags 15432227fc13Smrgif test "x$LINT_FLAGS" != "x"; then 15442227fc13Smrg lint_options=$LINT_FLAGS 15452227fc13Smrgfi 1546644fc5c1Stron 15472227fc13SmrgAC_SUBST([LINT_FLAGS],[$lint_options]) 15482227fc13SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x]) 1549644fc5c1Stron 15502227fc13Smrg]) # XORG_WITH_LINT 1551644fc5c1Stron 15522227fc13Smrg# XORG_LINT_LIBRARY(LIBNAME) 15532227fc13Smrg# -------------------------- 15542227fc13Smrg# Minimum version: 1.1.0 15552227fc13Smrg# 15562227fc13Smrg# Sets up flags for building lint libraries for checking programs that call 15572227fc13Smrg# functions in the library. 15582227fc13Smrg# 15592227fc13Smrg# Interface to module: 15602227fc13Smrg# LINTLIB - Automake variable with the name of lint library file to make 15612227fc13Smrg# MAKE_LINT_LIB - Automake conditional 15622227fc13Smrg# 15632227fc13Smrg# --enable-lint-library: - 'yes' user instructs the module to created a lint library 15642227fc13Smrg# - 'no' user instructs the module not to create a lint library (default) 15652227fc13Smrg 15662227fc13SmrgAC_DEFUN([XORG_LINT_LIBRARY],[ 15672227fc13SmrgAC_REQUIRE([XORG_WITH_LINT]) 15682227fc13SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library], 15692227fc13Smrg [Create lint library (default: disabled)])], 15702227fc13Smrg [make_lint_lib=$enableval], [make_lint_lib=no]) 15712227fc13Smrg 15722227fc13Smrgif test "x$make_lint_lib" = x"yes" ; then 15732227fc13Smrg LINTLIB=llib-l$1.ln 15742227fc13Smrg if test "x$LINT" = "x"; then 15752227fc13Smrg AC_MSG_ERROR([Cannot make lint library without --with-lint]) 15762227fc13Smrg fi 15772227fc13Smrgelif test "x$make_lint_lib" != x"no" ; then 15782227fc13Smrg AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.]) 15792227fc13Smrgfi 1580644fc5c1Stron 15812227fc13SmrgAC_SUBST(LINTLIB) 15822227fc13SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno]) 1583644fc5c1Stron 15842227fc13Smrg]) # XORG_LINT_LIBRARY 1585644fc5c1Stron 15862227fc13Smrg# XORG_CWARNFLAGS 15872227fc13Smrg# --------------- 15882227fc13Smrg# Minimum version: 1.2.0 15892227fc13Smrg# 15902227fc13Smrg# Defines CWARNFLAGS to enable C compiler warnings. 15912227fc13Smrg# 15922227fc13SmrgAC_DEFUN([XORG_CWARNFLAGS], [ 15932227fc13SmrgAC_REQUIRE([AC_PROG_CC_C99]) 15942227fc13Smrgif test "x$GCC" = xyes ; then 15952227fc13Smrg CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \ 15962227fc13Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \ 15972227fc13Smrg-Wbad-function-cast -Wformat=2" 15982227fc13Smrg case `$CC -dumpversion` in 15992227fc13Smrg 3.4.* | 4.*) 16002227fc13Smrg CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement" 16012227fc13Smrg ;; 16022227fc13Smrg esac 16032227fc13Smrgelse 16042227fc13Smrg AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) 16052227fc13Smrg if test "x$SUNCC" = "xyes"; then 16062227fc13Smrg CWARNFLAGS="-v" 16072227fc13Smrg fi 16082227fc13Smrgfi 16092227fc13SmrgAC_SUBST(CWARNFLAGS) 16102227fc13Smrg]) # XORG_CWARNFLAGS 1611644fc5c1Stron 16122227fc13Smrg# XORG_STRICT_OPTION 16132227fc13Smrg# ----------------------- 16142227fc13Smrg# Minimum version: 1.3.0 16152227fc13Smrg# 16162227fc13Smrg# Add configure option to enable strict compilation 16172227fc13SmrgAC_DEFUN([XORG_STRICT_OPTION], [ 16182227fc13Smrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89 16192227fc13SmrgAC_REQUIRE([AC_PROG_CC_C99]) 16202227fc13SmrgAC_REQUIRE([XORG_CWARNFLAGS]) 16212227fc13Smrg 16222227fc13SmrgAC_ARG_ENABLE(strict-compilation, 16232227fc13Smrg AS_HELP_STRING([--enable-strict-compilation], 16242227fc13Smrg [Enable all warnings from compiler and make them errors (default: disabled)]), 16252227fc13Smrg [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no]) 16262227fc13Smrgif test "x$STRICT_COMPILE" = "xyes"; then 16272227fc13Smrg AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) 16282227fc13Smrg AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"]) 16292227fc13Smrg if test "x$GCC" = xyes ; then 16302227fc13Smrg STRICT_CFLAGS="-pedantic -Werror" 16312227fc13Smrg elif test "x$SUNCC" = "xyes"; then 16322227fc13Smrg STRICT_CFLAGS="-errwarn" 16332227fc13Smrg elif test "x$INTELCC" = "xyes"; then 16342227fc13Smrg STRICT_CFLAGS="-Werror" 16352227fc13Smrg fi 16362227fc13Smrgfi 16372227fc13SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS" 16382227fc13SmrgAC_SUBST([CWARNFLAGS]) 16392227fc13Smrg]) # XORG_STRICT_OPTION 1640644fc5c1Stron 16412227fc13Smrg# XORG_DEFAULT_OPTIONS 16422227fc13Smrg# -------------------- 16432227fc13Smrg# Minimum version: 1.3.0 16442227fc13Smrg# 16452227fc13Smrg# Defines default options for X.Org modules. 16462227fc13Smrg# 16472227fc13SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [ 16482227fc13SmrgAC_REQUIRE([AC_PROG_INSTALL]) 16492227fc13SmrgXORG_CWARNFLAGS 16502227fc13SmrgXORG_STRICT_OPTION 16512227fc13SmrgXORG_RELEASE_VERSION 16522227fc13SmrgXORG_CHANGELOG 16532227fc13SmrgXORG_INSTALL 16542227fc13SmrgXORG_MANPAGE_SECTIONS 16552227fc13Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], 16562227fc13Smrg [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) 16572227fc13Smrg]) # XORG_DEFAULT_OPTIONS 16582227fc13Smrg 16592227fc13Smrg# XORG_INSTALL() 16602227fc13Smrg# ---------------- 16612227fc13Smrg# Minimum version: 1.4.0 16622227fc13Smrg# 16632227fc13Smrg# Defines the variable INSTALL_CMD as the command to copy 16642227fc13Smrg# INSTALL from $prefix/share/util-macros. 16652227fc13Smrg# 16662227fc13SmrgAC_DEFUN([XORG_INSTALL], [ 16672227fc13SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG]) 16682227fc13Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` 16692227fc13SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ 16702227fc13Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ 16712227fc13Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \ 16722227fc13Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)" 16732227fc13SmrgAC_SUBST([INSTALL_CMD]) 16742227fc13Smrg]) # XORG_INSTALL 16752227fc13Smrgdnl Copyright 2005 Red Hat, Inc 16762227fc13Smrgdnl 16772227fc13Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its 16782227fc13Smrgdnl documentation for any purpose is hereby granted without fee, provided that 16792227fc13Smrgdnl the above copyright notice appear in all copies and that both that 16802227fc13Smrgdnl copyright notice and this permission notice appear in supporting 16812227fc13Smrgdnl documentation. 16822227fc13Smrgdnl 16832227fc13Smrgdnl The above copyright notice and this permission notice shall be included 16842227fc13Smrgdnl in all copies or substantial portions of the Software. 16852227fc13Smrgdnl 16862227fc13Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 16872227fc13Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16882227fc13Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16892227fc13Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 16902227fc13Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 16912227fc13Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 16922227fc13Smrgdnl OTHER DEALINGS IN THE SOFTWARE. 16932227fc13Smrgdnl 16942227fc13Smrgdnl Except as contained in this notice, the name of the copyright holders shall 16952227fc13Smrgdnl not be used in advertising or otherwise to promote the sale, use or 16962227fc13Smrgdnl other dealings in this Software without prior written authorization 16972227fc13Smrgdnl from the copyright holders. 16982227fc13Smrgdnl 1699644fc5c1Stron 17002227fc13Smrg# XORG_RELEASE_VERSION 17012227fc13Smrg# -------------------- 17022227fc13Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use. 17032227fc13Smrg 17042227fc13SmrgAC_DEFUN([XORG_RELEASE_VERSION],[ 17052227fc13Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR], 17062227fc13Smrg [`echo $PACKAGE_VERSION | cut -d . -f 1`], 17072227fc13Smrg [Major version of this package]) 17082227fc13Smrg PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` 17092227fc13Smrg if test "x$PVM" = "x"; then 17102227fc13Smrg PVM="0" 17112227fc13Smrg fi 17122227fc13Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR], 17132227fc13Smrg [$PVM], 17142227fc13Smrg [Minor version of this package]) 17152227fc13Smrg PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` 17162227fc13Smrg if test "x$PVP" = "x"; then 17172227fc13Smrg PVP="0" 17182227fc13Smrg fi 17192227fc13Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL], 17202227fc13Smrg [$PVP], 17212227fc13Smrg [Patch version of this package]) 17222227fc13Smrg]) 1723644fc5c1Stron 17242227fc13Smrg# XORG_CHANGELOG() 17252227fc13Smrg# ---------------- 17262227fc13Smrg# Minimum version: 1.2.0 17272227fc13Smrg# 17282227fc13Smrg# Defines the variable CHANGELOG_CMD as the command to generate 17292227fc13Smrg# ChangeLog from git. 17302227fc13Smrg# 17312227fc13Smrg# 17322227fc13SmrgAC_DEFUN([XORG_CHANGELOG], [ 17332227fc13SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \ 17342227fc13Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ 17352227fc13Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \ 17362227fc13Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)" 17372227fc13SmrgAC_SUBST([CHANGELOG_CMD]) 17382227fc13Smrg]) # XORG_CHANGELOG 17392227fc13Smrg 17402227fc13Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. 17412227fc13Smrg# 17422227fc13Smrg# This file is free software; the Free Software Foundation 17432227fc13Smrg# gives unlimited permission to copy and/or distribute it, 17442227fc13Smrg# with or without modifications, as long as this notice is preserved. 17452227fc13Smrg 17462227fc13Smrg# AM_AUTOMAKE_VERSION(VERSION) 17472227fc13Smrg# ---------------------------- 17482227fc13Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been 17492227fc13Smrg# generated from the m4 files accompanying Automake X.Y. 17502227fc13Smrg# (This private macro should not be called outside this file.) 17512227fc13SmrgAC_DEFUN([AM_AUTOMAKE_VERSION], 17522227fc13Smrg[am__api_version='1.11' 17532227fc13Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to 17542227fc13Smrgdnl require some minimum version. Point them to the right macro. 17552227fc13Smrgm4_if([$1], [1.11.1], [], 17562227fc13Smrg [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl 17572227fc13Smrg]) 1758644fc5c1Stron 17592227fc13Smrg# _AM_AUTOCONF_VERSION(VERSION) 17602227fc13Smrg# ----------------------------- 17612227fc13Smrg# aclocal traces this macro to find the Autoconf version. 17622227fc13Smrg# This is a private macro too. Using m4_define simplifies 17632227fc13Smrg# the logic in aclocal, which can simply ignore this definition. 17642227fc13Smrgm4_define([_AM_AUTOCONF_VERSION], []) 1765644fc5c1Stron 17662227fc13Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION 17672227fc13Smrg# ------------------------------- 17682227fc13Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. 17692227fc13Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. 17702227fc13SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 17712227fc13Smrg[AM_AUTOMAKE_VERSION([1.11.1])dnl 17722227fc13Smrgm4_ifndef([AC_AUTOCONF_VERSION], 17732227fc13Smrg [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 17742227fc13Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) 1775644fc5c1Stron 17762227fc13Smrg# AM_AUX_DIR_EXPAND -*- Autoconf -*- 1777644fc5c1Stron 17782227fc13Smrg# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 17792227fc13Smrg# 17802227fc13Smrg# This file is free software; the Free Software Foundation 17812227fc13Smrg# gives unlimited permission to copy and/or distribute it, 17822227fc13Smrg# with or without modifications, as long as this notice is preserved. 1783644fc5c1Stron 17842227fc13Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 17852227fc13Smrg# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to 17862227fc13Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'. 17872227fc13Smrg# 17882227fc13Smrg# Of course, Automake must honor this variable whenever it calls a 17892227fc13Smrg# tool from the auxiliary directory. The problem is that $srcdir (and 17902227fc13Smrg# therefore $ac_aux_dir as well) can be either absolute or relative, 17912227fc13Smrg# depending on how configure is run. This is pretty annoying, since 17922227fc13Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top 17932227fc13Smrg# source directory, any form will work fine, but in subdirectories a 17942227fc13Smrg# relative path needs to be adjusted first. 17952227fc13Smrg# 17962227fc13Smrg# $ac_aux_dir/missing 17972227fc13Smrg# fails when called from a subdirectory if $ac_aux_dir is relative 17982227fc13Smrg# $top_srcdir/$ac_aux_dir/missing 17992227fc13Smrg# fails if $ac_aux_dir is absolute, 18002227fc13Smrg# fails when called from a subdirectory in a VPATH build with 18012227fc13Smrg# a relative $ac_aux_dir 18022227fc13Smrg# 18032227fc13Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir 18042227fc13Smrg# are both prefixed by $srcdir. In an in-source build this is usually 18052227fc13Smrg# harmless because $srcdir is `.', but things will broke when you 18062227fc13Smrg# start a VPATH build or use an absolute $srcdir. 18072227fc13Smrg# 18082227fc13Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 18092227fc13Smrg# iff we strip the leading $srcdir from $ac_aux_dir. That would be: 18102227fc13Smrg# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 18112227fc13Smrg# and then we would define $MISSING as 18122227fc13Smrg# MISSING="\${SHELL} $am_aux_dir/missing" 18132227fc13Smrg# This will work as long as MISSING is not called from configure, because 18142227fc13Smrg# unfortunately $(top_srcdir) has no meaning in configure. 18152227fc13Smrg# However there are other variables, like CC, which are often used in 18162227fc13Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir. 18172227fc13Smrg# 18182227fc13Smrg# Another solution, used here, is to always expand $ac_aux_dir to an 18192227fc13Smrg# absolute PATH. The drawback is that using absolute paths prevent a 18202227fc13Smrg# configured tree to be moved without reconfiguration. 1821644fc5c1Stron 18222227fc13SmrgAC_DEFUN([AM_AUX_DIR_EXPAND], 18232227fc13Smrg[dnl Rely on autoconf to set up CDPATH properly. 18242227fc13SmrgAC_PREREQ([2.50])dnl 18252227fc13Smrg# expand $ac_aux_dir to an absolute path 18262227fc13Smrgam_aux_dir=`cd $ac_aux_dir && pwd` 18272227fc13Smrg]) 1828644fc5c1Stron 18292227fc13Smrg# AM_CONDITIONAL -*- Autoconf -*- 1830644fc5c1Stron 18312227fc13Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 18322227fc13Smrg# Free Software Foundation, Inc. 18332227fc13Smrg# 18342227fc13Smrg# This file is free software; the Free Software Foundation 18352227fc13Smrg# gives unlimited permission to copy and/or distribute it, 18362227fc13Smrg# with or without modifications, as long as this notice is preserved. 1837644fc5c1Stron 18382227fc13Smrg# serial 9 1839644fc5c1Stron 18402227fc13Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION) 18412227fc13Smrg# ------------------------------------- 18422227fc13Smrg# Define a conditional. 18432227fc13SmrgAC_DEFUN([AM_CONDITIONAL], 18442227fc13Smrg[AC_PREREQ(2.52)dnl 18452227fc13Smrg ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 18462227fc13Smrg [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 18472227fc13SmrgAC_SUBST([$1_TRUE])dnl 18482227fc13SmrgAC_SUBST([$1_FALSE])dnl 18492227fc13Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl 18502227fc13Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl 18512227fc13Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl 18522227fc13Smrgif $2; then 18532227fc13Smrg $1_TRUE= 18542227fc13Smrg $1_FALSE='#' 18552227fc13Smrgelse 18562227fc13Smrg $1_TRUE='#' 18572227fc13Smrg $1_FALSE= 18582227fc13Smrgfi 18592227fc13SmrgAC_CONFIG_COMMANDS_PRE( 18602227fc13Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 18612227fc13Smrg AC_MSG_ERROR([[conditional "$1" was never defined. 18622227fc13SmrgUsually this means the macro was only invoked conditionally.]]) 18632227fc13Smrgfi])]) 1864644fc5c1Stron 18652227fc13Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 18662227fc13Smrg# Free Software Foundation, Inc. 18672227fc13Smrg# 18682227fc13Smrg# This file is free software; the Free Software Foundation 18692227fc13Smrg# gives unlimited permission to copy and/or distribute it, 18702227fc13Smrg# with or without modifications, as long as this notice is preserved. 1871644fc5c1Stron 18722227fc13Smrg# serial 10 1873644fc5c1Stron 1874644fc5c1Stron# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be 1875644fc5c1Stron# written in clear, in which case automake, when reading aclocal.m4, 1876644fc5c1Stron# will think it sees a *use*, and therefore will trigger all it's 1877644fc5c1Stron# C support machinery. Also note that it means that autoscan, seeing 1878644fc5c1Stron# CC etc. in the Makefile, will ask for an AC_PROG_CC use... 1879644fc5c1Stron 1880644fc5c1Stron 1881644fc5c1Stron# _AM_DEPENDENCIES(NAME) 1882644fc5c1Stron# ---------------------- 1883644fc5c1Stron# See how the compiler implements dependency checking. 1884644fc5c1Stron# NAME is "CC", "CXX", "GCJ", or "OBJC". 1885644fc5c1Stron# We try a few techniques and use that to set a single cache variable. 1886644fc5c1Stron# 1887644fc5c1Stron# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was 1888644fc5c1Stron# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular 1889644fc5c1Stron# dependency, and given that the user is not expected to run this macro, 1890644fc5c1Stron# just rely on AC_PROG_CC. 1891644fc5c1StronAC_DEFUN([_AM_DEPENDENCIES], 1892644fc5c1Stron[AC_REQUIRE([AM_SET_DEPDIR])dnl 1893644fc5c1StronAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl 1894644fc5c1StronAC_REQUIRE([AM_MAKE_INCLUDE])dnl 1895644fc5c1StronAC_REQUIRE([AM_DEP_TRACK])dnl 1896644fc5c1Stron 1897644fc5c1Stronifelse([$1], CC, [depcc="$CC" am_compiler_list=], 1898644fc5c1Stron [$1], CXX, [depcc="$CXX" am_compiler_list=], 1899644fc5c1Stron [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 19002227fc13Smrg [$1], UPC, [depcc="$UPC" am_compiler_list=], 1901644fc5c1Stron [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 1902644fc5c1Stron [depcc="$$1" am_compiler_list=]) 1903644fc5c1Stron 1904644fc5c1StronAC_CACHE_CHECK([dependency style of $depcc], 1905644fc5c1Stron [am_cv_$1_dependencies_compiler_type], 1906644fc5c1Stron[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then 1907644fc5c1Stron # We make a subdir and do the tests there. Otherwise we can end up 1908644fc5c1Stron # making bogus files that we don't know about and never remove. For 1909644fc5c1Stron # instance it was reported that on HP-UX the gcc test will end up 1910644fc5c1Stron # making a dummy file named `D' -- because `-MD' means `put the output 1911644fc5c1Stron # in D'. 1912644fc5c1Stron mkdir conftest.dir 1913644fc5c1Stron # Copy depcomp to subdir because otherwise we won't find it if we're 1914644fc5c1Stron # using a relative directory. 1915644fc5c1Stron cp "$am_depcomp" conftest.dir 1916644fc5c1Stron cd conftest.dir 1917644fc5c1Stron # We will build objects and dependencies in a subdirectory because 1918644fc5c1Stron # it helps to detect inapplicable dependency modes. For instance 1919644fc5c1Stron # both Tru64's cc and ICC support -MD to output dependencies as a 1920644fc5c1Stron # side effect of compilation, but ICC will put the dependencies in 1921644fc5c1Stron # the current directory while Tru64 will put them in the object 1922644fc5c1Stron # directory. 1923644fc5c1Stron mkdir sub 1924644fc5c1Stron 1925644fc5c1Stron am_cv_$1_dependencies_compiler_type=none 1926644fc5c1Stron if test "$am_compiler_list" = ""; then 1927644fc5c1Stron am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` 1928644fc5c1Stron fi 19292227fc13Smrg am__universal=false 19302227fc13Smrg m4_case([$1], [CC], 19312227fc13Smrg [case " $depcc " in #( 19322227fc13Smrg *\ -arch\ *\ -arch\ *) am__universal=true ;; 19332227fc13Smrg esac], 19342227fc13Smrg [CXX], 19352227fc13Smrg [case " $depcc " in #( 19362227fc13Smrg *\ -arch\ *\ -arch\ *) am__universal=true ;; 19372227fc13Smrg esac]) 19382227fc13Smrg 1939644fc5c1Stron for depmode in $am_compiler_list; do 1940644fc5c1Stron # Setup a source with many dependencies, because some compilers 1941644fc5c1Stron # like to wrap large dependency lists on column 80 (with \), and 1942644fc5c1Stron # we should not choose a depcomp mode which is confused by this. 1943644fc5c1Stron # 1944644fc5c1Stron # We need to recreate these files for each test, as the compiler may 1945644fc5c1Stron # overwrite some of them when testing with obscure command lines. 1946644fc5c1Stron # This happens at least with the AIX C compiler. 1947644fc5c1Stron : > sub/conftest.c 1948644fc5c1Stron for i in 1 2 3 4 5 6; do 1949644fc5c1Stron echo '#include "conftst'$i'.h"' >> sub/conftest.c 19502227fc13Smrg # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with 19512227fc13Smrg # Solaris 8's {/usr,}/bin/sh. 19522227fc13Smrg touch sub/conftst$i.h 1953644fc5c1Stron done 1954644fc5c1Stron echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 1955644fc5c1Stron 19562227fc13Smrg # We check with `-c' and `-o' for the sake of the "dashmstdout" 19572227fc13Smrg # mode. It turns out that the SunPro C++ compiler does not properly 19582227fc13Smrg # handle `-M -o', and we need to detect this. Also, some Intel 19592227fc13Smrg # versions had trouble with output in subdirs 19602227fc13Smrg am__obj=sub/conftest.${OBJEXT-o} 19612227fc13Smrg am__minus_obj="-o $am__obj" 1962644fc5c1Stron case $depmode in 19632227fc13Smrg gcc) 19642227fc13Smrg # This depmode causes a compiler race in universal mode. 19652227fc13Smrg test "$am__universal" = false || continue 19662227fc13Smrg ;; 1967644fc5c1Stron nosideeffect) 1968644fc5c1Stron # after this tag, mechanisms are not by side-effect, so they'll 1969644fc5c1Stron # only be used when explicitly requested 1970644fc5c1Stron if test "x$enable_dependency_tracking" = xyes; then 1971644fc5c1Stron continue 1972644fc5c1Stron else 1973644fc5c1Stron break 1974644fc5c1Stron fi 1975644fc5c1Stron ;; 19762227fc13Smrg msvisualcpp | msvcmsys) 19772227fc13Smrg # This compiler won't grok `-c -o', but also, the minuso test has 19782227fc13Smrg # not run yet. These depmodes are late enough in the game, and 19792227fc13Smrg # so weak that their functioning should not be impacted. 19802227fc13Smrg am__obj=conftest.${OBJEXT-o} 19812227fc13Smrg am__minus_obj= 19822227fc13Smrg ;; 1983644fc5c1Stron none) break ;; 1984644fc5c1Stron esac 1985644fc5c1Stron if depmode=$depmode \ 19862227fc13Smrg source=sub/conftest.c object=$am__obj \ 1987644fc5c1Stron depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ 19882227fc13Smrg $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ 1989644fc5c1Stron >/dev/null 2>conftest.err && 19902227fc13Smrg grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 1991644fc5c1Stron grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && 19922227fc13Smrg grep $am__obj sub/conftest.Po > /dev/null 2>&1 && 1993644fc5c1Stron ${MAKE-make} -s -f confmf > /dev/null 2>&1; then 1994644fc5c1Stron # icc doesn't choke on unknown options, it will just issue warnings 19952227fc13Smrg # or remarks (even with -Werror). So we grep stderr for any message 19962227fc13Smrg # that says an option was ignored or not supported. 19972227fc13Smrg # When given -MP, icc 7.0 and 7.1 complain thusly: 19982227fc13Smrg # icc: Command line warning: ignoring option '-M'; no argument required 19992227fc13Smrg # The diagnosis changed in icc 8.0: 20002227fc13Smrg # icc: Command line remark: option '-MP' not supported 20012227fc13Smrg if (grep 'ignoring option' conftest.err || 20022227fc13Smrg grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else 2003644fc5c1Stron am_cv_$1_dependencies_compiler_type=$depmode 2004644fc5c1Stron break 2005644fc5c1Stron fi 2006644fc5c1Stron fi 2007644fc5c1Stron done 2008644fc5c1Stron 2009644fc5c1Stron cd .. 2010644fc5c1Stron rm -rf conftest.dir 2011644fc5c1Stronelse 2012644fc5c1Stron am_cv_$1_dependencies_compiler_type=none 2013644fc5c1Stronfi 2014644fc5c1Stron]) 2015644fc5c1StronAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) 2016644fc5c1StronAM_CONDITIONAL([am__fastdep$1], [ 2017644fc5c1Stron test "x$enable_dependency_tracking" != xno \ 2018644fc5c1Stron && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) 2019644fc5c1Stron]) 2020644fc5c1Stron 2021644fc5c1Stron 2022644fc5c1Stron# AM_SET_DEPDIR 2023644fc5c1Stron# ------------- 2024644fc5c1Stron# Choose a directory name for dependency files. 2025644fc5c1Stron# This macro is AC_REQUIREd in _AM_DEPENDENCIES 2026644fc5c1StronAC_DEFUN([AM_SET_DEPDIR], 2027644fc5c1Stron[AC_REQUIRE([AM_SET_LEADING_DOT])dnl 2028644fc5c1StronAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl 2029644fc5c1Stron]) 2030644fc5c1Stron 2031644fc5c1Stron 2032644fc5c1Stron# AM_DEP_TRACK 2033644fc5c1Stron# ------------ 2034644fc5c1StronAC_DEFUN([AM_DEP_TRACK], 2035644fc5c1Stron[AC_ARG_ENABLE(dependency-tracking, 20362227fc13Smrg[ --disable-dependency-tracking speeds up one-time build 20372227fc13Smrg --enable-dependency-tracking do not reject slow dependency extractors]) 2038644fc5c1Stronif test "x$enable_dependency_tracking" != xno; then 2039644fc5c1Stron am_depcomp="$ac_aux_dir/depcomp" 2040644fc5c1Stron AMDEPBACKSLASH='\' 2041644fc5c1Stronfi 2042644fc5c1StronAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) 20432227fc13SmrgAC_SUBST([AMDEPBACKSLASH])dnl 20442227fc13Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl 2045644fc5c1Stron]) 2046644fc5c1Stron 20472227fc13Smrg# Generate code to set up dependency tracking. -*- Autoconf -*- 2048644fc5c1Stron 20492227fc13Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 20502227fc13Smrg# Free Software Foundation, Inc. 20512227fc13Smrg# 20522227fc13Smrg# This file is free software; the Free Software Foundation 20532227fc13Smrg# gives unlimited permission to copy and/or distribute it, 20542227fc13Smrg# with or without modifications, as long as this notice is preserved. 2055644fc5c1Stron 20562227fc13Smrg#serial 5 2057644fc5c1Stron 2058644fc5c1Stron# _AM_OUTPUT_DEPENDENCY_COMMANDS 2059644fc5c1Stron# ------------------------------ 2060644fc5c1StronAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], 20612227fc13Smrg[{ 20622227fc13Smrg # Autoconf 2.62 quotes --file arguments for eval, but not when files 20632227fc13Smrg # are listed without --file. Let's play safe and only enable the eval 20642227fc13Smrg # if we detect the quoting. 20652227fc13Smrg case $CONFIG_FILES in 20662227fc13Smrg *\'*) eval set x "$CONFIG_FILES" ;; 20672227fc13Smrg *) set x $CONFIG_FILES ;; 20682227fc13Smrg esac 20692227fc13Smrg shift 20702227fc13Smrg for mf 20712227fc13Smrg do 20722227fc13Smrg # Strip MF so we end up with the name of the file. 20732227fc13Smrg mf=`echo "$mf" | sed -e 's/:.*$//'` 20742227fc13Smrg # Check whether this is an Automake generated Makefile or not. 20752227fc13Smrg # We used to match only the files named `Makefile.in', but 20762227fc13Smrg # some people rename them; so instead we look at the file content. 20772227fc13Smrg # Grep'ing the first line is not enough: some people post-process 20782227fc13Smrg # each Makefile.in and add a new line on top of each file to say so. 20792227fc13Smrg # Grep'ing the whole file is not good either: AIX grep has a line 20802227fc13Smrg # limit of 2048, but all sed's we know have understand at least 4000. 20812227fc13Smrg if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then 20822227fc13Smrg dirpart=`AS_DIRNAME("$mf")` 20832227fc13Smrg else 20842227fc13Smrg continue 20852227fc13Smrg fi 20862227fc13Smrg # Extract the definition of DEPDIR, am__include, and am__quote 20872227fc13Smrg # from the Makefile without running `make'. 20882227fc13Smrg DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` 20892227fc13Smrg test -z "$DEPDIR" && continue 20902227fc13Smrg am__include=`sed -n 's/^am__include = //p' < "$mf"` 20912227fc13Smrg test -z "am__include" && continue 20922227fc13Smrg am__quote=`sed -n 's/^am__quote = //p' < "$mf"` 20932227fc13Smrg # When using ansi2knr, U may be empty or an underscore; expand it 20942227fc13Smrg U=`sed -n 's/^U = //p' < "$mf"` 20952227fc13Smrg # Find all dependency output files, they are included files with 20962227fc13Smrg # $(DEPDIR) in their names. We invoke sed twice because it is the 20972227fc13Smrg # simplest approach to changing $(DEPDIR) to its actual value in the 20982227fc13Smrg # expansion. 20992227fc13Smrg for file in `sed -n " 21002227fc13Smrg s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ 21012227fc13Smrg sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do 21022227fc13Smrg # Make sure the directory exists. 21032227fc13Smrg test -f "$dirpart/$file" && continue 21042227fc13Smrg fdir=`AS_DIRNAME(["$file"])` 21052227fc13Smrg AS_MKDIR_P([$dirpart/$fdir]) 21062227fc13Smrg # echo "creating $dirpart/$file" 21072227fc13Smrg echo '# dummy' > "$dirpart/$file" 21082227fc13Smrg done 21092227fc13Smrg done 21102227fc13Smrg} 21112227fc13Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS 21122227fc13Smrg 21132227fc13Smrg 21142227fc13Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS 21152227fc13Smrg# ----------------------------- 21162227fc13Smrg# This macro should only be invoked once -- use via AC_REQUIRE. 21172227fc13Smrg# 21182227fc13Smrg# This code is only required when automatic dependency tracking 21192227fc13Smrg# is enabled. FIXME. This creates each `.P' file that we will 21202227fc13Smrg# need in order to bootstrap the dependency handling code. 21212227fc13SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], 21222227fc13Smrg[AC_CONFIG_COMMANDS([depfiles], 21232227fc13Smrg [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], 21242227fc13Smrg [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) 21252227fc13Smrg]) 21262227fc13Smrg 21272227fc13Smrg# Do all the work for Automake. -*- Autoconf -*- 21282227fc13Smrg 21292227fc13Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 21302227fc13Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. 21312227fc13Smrg# 21322227fc13Smrg# This file is free software; the Free Software Foundation 21332227fc13Smrg# gives unlimited permission to copy and/or distribute it, 21342227fc13Smrg# with or without modifications, as long as this notice is preserved. 21352227fc13Smrg 21362227fc13Smrg# serial 16 21372227fc13Smrg 21382227fc13Smrg# This macro actually does too much. Some checks are only needed if 21392227fc13Smrg# your package does certain things. But this isn't really a big deal. 21402227fc13Smrg 21412227fc13Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 21422227fc13Smrg# AM_INIT_AUTOMAKE([OPTIONS]) 21432227fc13Smrg# ----------------------------------------------- 21442227fc13Smrg# The call with PACKAGE and VERSION arguments is the old style 21452227fc13Smrg# call (pre autoconf-2.50), which is being phased out. PACKAGE 21462227fc13Smrg# and VERSION should now be passed to AC_INIT and removed from 21472227fc13Smrg# the call to AM_INIT_AUTOMAKE. 21482227fc13Smrg# We support both call styles for the transition. After 21492227fc13Smrg# the next Automake release, Autoconf can make the AC_INIT 21502227fc13Smrg# arguments mandatory, and then we can depend on a new Autoconf 21512227fc13Smrg# release and drop the old call support. 21522227fc13SmrgAC_DEFUN([AM_INIT_AUTOMAKE], 21532227fc13Smrg[AC_PREREQ([2.62])dnl 21542227fc13Smrgdnl Autoconf wants to disallow AM_ names. We explicitly allow 21552227fc13Smrgdnl the ones we care about. 21562227fc13Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 21572227fc13SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 21582227fc13SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl 21592227fc13Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then 21602227fc13Smrg # Use -I$(srcdir) only when $(srcdir) != ., so that make's output 21612227fc13Smrg # is not polluted with repeated "-I." 21622227fc13Smrg AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl 21632227fc13Smrg # test to see if srcdir already configured 21642227fc13Smrg if test -f $srcdir/config.status; then 21652227fc13Smrg AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 21662227fc13Smrg fi 21672227fc13Smrgfi 21682227fc13Smrg 21692227fc13Smrg# test whether we have cygpath 21702227fc13Smrgif test -z "$CYGPATH_W"; then 21712227fc13Smrg if (cygpath --version) >/dev/null 2>/dev/null; then 21722227fc13Smrg CYGPATH_W='cygpath -w' 2173644fc5c1Stron else 21742227fc13Smrg CYGPATH_W=echo 2175644fc5c1Stron fi 21762227fc13Smrgfi 21772227fc13SmrgAC_SUBST([CYGPATH_W]) 21782227fc13Smrg 21792227fc13Smrg# Define the identity of the package. 21802227fc13Smrgdnl Distinguish between old-style and new-style calls. 21812227fc13Smrgm4_ifval([$2], 21822227fc13Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 21832227fc13Smrg AC_SUBST([PACKAGE], [$1])dnl 21842227fc13Smrg AC_SUBST([VERSION], [$2])], 21852227fc13Smrg[_AM_SET_OPTIONS([$1])dnl 21862227fc13Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. 21872227fc13Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, 21882227fc13Smrg [m4_fatal([AC_INIT should be called with package and version arguments])])dnl 21892227fc13Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl 21902227fc13Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl 21912227fc13Smrg 21922227fc13Smrg_AM_IF_OPTION([no-define],, 21932227fc13Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) 21942227fc13Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl 21952227fc13Smrg 21962227fc13Smrg# Some tools Automake needs. 21972227fc13SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl 21982227fc13SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl 21992227fc13SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) 22002227fc13SmrgAM_MISSING_PROG(AUTOCONF, autoconf) 22012227fc13SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) 22022227fc13SmrgAM_MISSING_PROG(AUTOHEADER, autoheader) 22032227fc13SmrgAM_MISSING_PROG(MAKEINFO, makeinfo) 22042227fc13SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl 22052227fc13SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl 22062227fc13SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl 22072227fc13Smrg# We need awk for the "check" target. The system "awk" is bad on 22082227fc13Smrg# some platforms. 22092227fc13SmrgAC_REQUIRE([AC_PROG_AWK])dnl 22102227fc13SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl 22112227fc13SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl 22122227fc13Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], 22132227fc13Smrg [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], 22142227fc13Smrg [_AM_PROG_TAR([v7])])]) 22152227fc13Smrg_AM_IF_OPTION([no-dependencies],, 22162227fc13Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC], 22172227fc13Smrg [_AM_DEPENDENCIES(CC)], 22182227fc13Smrg [define([AC_PROG_CC], 22192227fc13Smrg defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl 22202227fc13SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX], 22212227fc13Smrg [_AM_DEPENDENCIES(CXX)], 22222227fc13Smrg [define([AC_PROG_CXX], 22232227fc13Smrg defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl 22242227fc13SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC], 22252227fc13Smrg [_AM_DEPENDENCIES(OBJC)], 22262227fc13Smrg [define([AC_PROG_OBJC], 22272227fc13Smrg defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl 22282227fc13Smrg]) 22292227fc13Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl 22302227fc13Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the 22312227fc13Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro 22322227fc13Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below. 22332227fc13SmrgAC_CONFIG_COMMANDS_PRE(dnl 22342227fc13Smrg[m4_provide_if([_AM_COMPILER_EXEEXT], 22352227fc13Smrg [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl 22362227fc13Smrg]) 22372227fc13Smrg 22382227fc13Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not 22392227fc13Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further 22402227fc13Smrgdnl mangled by Autoconf and run in a shell conditional statement. 22412227fc13Smrgm4_define([_AC_COMPILER_EXEEXT], 22422227fc13Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) 22432227fc13Smrg 22442227fc13Smrg 22452227fc13Smrg# When config.status generates a header, we must update the stamp-h file. 22462227fc13Smrg# This file resides in the same directory as the config header 22472227fc13Smrg# that is generated. The stamp files are numbered to have different names. 22482227fc13Smrg 22492227fc13Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 22502227fc13Smrg# loop where config.status creates the headers, so we can generate 22512227fc13Smrg# our stamp files there. 22522227fc13SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 22532227fc13Smrg[# Compute $1's index in $config_headers. 22542227fc13Smrg_am_arg=$1 22552227fc13Smrg_am_stamp_count=1 22562227fc13Smrgfor _am_header in $config_headers :; do 22572227fc13Smrg case $_am_header in 22582227fc13Smrg $_am_arg | $_am_arg:* ) 22592227fc13Smrg break ;; 22602227fc13Smrg * ) 22612227fc13Smrg _am_stamp_count=`expr $_am_stamp_count + 1` ;; 22622227fc13Smrg esac 2263644fc5c1Strondone 22642227fc13Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) 22652227fc13Smrg 22662227fc13Smrg# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. 22672227fc13Smrg# 22682227fc13Smrg# This file is free software; the Free Software Foundation 22692227fc13Smrg# gives unlimited permission to copy and/or distribute it, 22702227fc13Smrg# with or without modifications, as long as this notice is preserved. 22712227fc13Smrg 22722227fc13Smrg# AM_PROG_INSTALL_SH 22732227fc13Smrg# ------------------ 22742227fc13Smrg# Define $install_sh. 22752227fc13SmrgAC_DEFUN([AM_PROG_INSTALL_SH], 22762227fc13Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 22772227fc13Smrgif test x"${install_sh}" != xset; then 22782227fc13Smrg case $am_aux_dir in 22792227fc13Smrg *\ * | *\ *) 22802227fc13Smrg install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; 22812227fc13Smrg *) 22822227fc13Smrg install_sh="\${SHELL} $am_aux_dir/install-sh" 22832227fc13Smrg esac 22842227fc13Smrgfi 22852227fc13SmrgAC_SUBST(install_sh)]) 22862227fc13Smrg 22872227fc13Smrg# Copyright (C) 2003, 2005 Free Software Foundation, Inc. 22882227fc13Smrg# 22892227fc13Smrg# This file is free software; the Free Software Foundation 22902227fc13Smrg# gives unlimited permission to copy and/or distribute it, 22912227fc13Smrg# with or without modifications, as long as this notice is preserved. 22922227fc13Smrg 22932227fc13Smrg# serial 2 22942227fc13Smrg 22952227fc13Smrg# Check whether the underlying file-system supports filenames 22962227fc13Smrg# with a leading dot. For instance MS-DOS doesn't. 22972227fc13SmrgAC_DEFUN([AM_SET_LEADING_DOT], 22982227fc13Smrg[rm -rf .tst 2>/dev/null 22992227fc13Smrgmkdir .tst 2>/dev/null 23002227fc13Smrgif test -d .tst; then 23012227fc13Smrg am__leading_dot=. 23022227fc13Smrgelse 23032227fc13Smrg am__leading_dot=_ 23042227fc13Smrgfi 23052227fc13Smrgrmdir .tst 2>/dev/null 23062227fc13SmrgAC_SUBST([am__leading_dot])]) 2307644fc5c1Stron 23082227fc13Smrg# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- 23092227fc13Smrg# From Jim Meyering 2310644fc5c1Stron 23112227fc13Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 23122227fc13Smrg# Free Software Foundation, Inc. 2313644fc5c1Stron# 23142227fc13Smrg# This file is free software; the Free Software Foundation 23152227fc13Smrg# gives unlimited permission to copy and/or distribute it, 23162227fc13Smrg# with or without modifications, as long as this notice is preserved. 2317644fc5c1Stron 23182227fc13Smrg# serial 5 2319644fc5c1Stron 23202227fc13Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE]) 23212227fc13Smrg# ---------------------------------- 23222227fc13Smrg# Control maintainer-specific portions of Makefiles. 23232227fc13Smrg# Default is to disable them, unless `enable' is passed literally. 23242227fc13Smrg# For symmetry, `disable' may be passed as well. Anyway, the user 23252227fc13Smrg# can override the default with the --enable/--disable switch. 23262227fc13SmrgAC_DEFUN([AM_MAINTAINER_MODE], 23272227fc13Smrg[m4_case(m4_default([$1], [disable]), 23282227fc13Smrg [enable], [m4_define([am_maintainer_other], [disable])], 23292227fc13Smrg [disable], [m4_define([am_maintainer_other], [enable])], 23302227fc13Smrg [m4_define([am_maintainer_other], [enable]) 23312227fc13Smrg m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) 23322227fc13SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) 23332227fc13Smrg dnl maintainer-mode's default is 'disable' unless 'enable' is passed 23342227fc13Smrg AC_ARG_ENABLE([maintainer-mode], 23352227fc13Smrg[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful 23362227fc13Smrg (and sometimes confusing) to the casual installer], 23372227fc13Smrg [USE_MAINTAINER_MODE=$enableval], 23382227fc13Smrg [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) 23392227fc13Smrg AC_MSG_RESULT([$USE_MAINTAINER_MODE]) 23402227fc13Smrg AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) 23412227fc13Smrg MAINT=$MAINTAINER_MODE_TRUE 23422227fc13Smrg AC_SUBST([MAINT])dnl 23432227fc13Smrg] 23442227fc13Smrg) 2345644fc5c1Stron 23462227fc13SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) 2347644fc5c1Stron 23482227fc13Smrg# Check to see how 'make' treats includes. -*- Autoconf -*- 2349644fc5c1Stron 23502227fc13Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. 23512227fc13Smrg# 23522227fc13Smrg# This file is free software; the Free Software Foundation 23532227fc13Smrg# gives unlimited permission to copy and/or distribute it, 23542227fc13Smrg# with or without modifications, as long as this notice is preserved. 2355644fc5c1Stron 23562227fc13Smrg# serial 4 2357644fc5c1Stron 2358644fc5c1Stron# AM_MAKE_INCLUDE() 2359644fc5c1Stron# ----------------- 2360644fc5c1Stron# Check to see how make treats includes. 2361644fc5c1StronAC_DEFUN([AM_MAKE_INCLUDE], 2362644fc5c1Stron[am_make=${MAKE-make} 2363644fc5c1Stroncat > confinc << 'END' 2364644fc5c1Stronam__doit: 23652227fc13Smrg @echo this is the am__doit target 2366644fc5c1Stron.PHONY: am__doit 2367644fc5c1StronEND 2368644fc5c1Stron# If we don't find an include directive, just comment out the code. 2369644fc5c1StronAC_MSG_CHECKING([for style of include used by $am_make]) 2370644fc5c1Stronam__include="#" 2371644fc5c1Stronam__quote= 2372644fc5c1Stron_am_result=none 2373644fc5c1Stron# First try GNU make style include. 2374644fc5c1Stronecho "include confinc" > confmf 23752227fc13Smrg# Ignore all kinds of additional output from `make'. 23762227fc13Smrgcase `$am_make -s -f confmf 2> /dev/null` in #( 23772227fc13Smrg*the\ am__doit\ target*) 23782227fc13Smrg am__include=include 23792227fc13Smrg am__quote= 23802227fc13Smrg _am_result=GNU 23812227fc13Smrg ;; 23822227fc13Smrgesac 2383644fc5c1Stron# Now try BSD make style include. 2384644fc5c1Stronif test "$am__include" = "#"; then 2385644fc5c1Stron echo '.include "confinc"' > confmf 23862227fc13Smrg case `$am_make -s -f confmf 2> /dev/null` in #( 23872227fc13Smrg *the\ am__doit\ target*) 23882227fc13Smrg am__include=.include 23892227fc13Smrg am__quote="\"" 23902227fc13Smrg _am_result=BSD 23912227fc13Smrg ;; 23922227fc13Smrg esac 2393644fc5c1Stronfi 2394644fc5c1StronAC_SUBST([am__include]) 2395644fc5c1StronAC_SUBST([am__quote]) 2396644fc5c1StronAC_MSG_RESULT([$_am_result]) 2397644fc5c1Stronrm -f confinc confmf 2398644fc5c1Stron]) 2399644fc5c1Stron 24002227fc13Smrg# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- 2401644fc5c1Stron 24022227fc13Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 24032227fc13Smrg# Free Software Foundation, Inc. 24042227fc13Smrg# 24052227fc13Smrg# This file is free software; the Free Software Foundation 24062227fc13Smrg# gives unlimited permission to copy and/or distribute it, 24072227fc13Smrg# with or without modifications, as long as this notice is preserved. 2408644fc5c1Stron 24092227fc13Smrg# serial 6 2410644fc5c1Stron 24112227fc13Smrg# AM_MISSING_PROG(NAME, PROGRAM) 24122227fc13Smrg# ------------------------------ 24132227fc13SmrgAC_DEFUN([AM_MISSING_PROG], 24142227fc13Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN]) 24152227fc13Smrg$1=${$1-"${am_missing_run}$2"} 24162227fc13SmrgAC_SUBST($1)]) 2417644fc5c1Stron 24182227fc13Smrg 24192227fc13Smrg# AM_MISSING_HAS_RUN 24202227fc13Smrg# ------------------ 24212227fc13Smrg# Define MISSING if not defined so far and test if it supports --run. 24222227fc13Smrg# If it does, set am_missing_run to use it, otherwise, to nothing. 24232227fc13SmrgAC_DEFUN([AM_MISSING_HAS_RUN], 24242227fc13Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 24252227fc13SmrgAC_REQUIRE_AUX_FILE([missing])dnl 24262227fc13Smrgif test x"${MISSING+set}" != xset; then 24272227fc13Smrg case $am_aux_dir in 24282227fc13Smrg *\ * | *\ *) 24292227fc13Smrg MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; 24302227fc13Smrg *) 24312227fc13Smrg MISSING="\${SHELL} $am_aux_dir/missing" ;; 24322227fc13Smrg esac 24332227fc13Smrgfi 24342227fc13Smrg# Use eval to expand $SHELL 24352227fc13Smrgif eval "$MISSING --run true"; then 24362227fc13Smrg am_missing_run="$MISSING --run " 24372227fc13Smrgelse 24382227fc13Smrg am_missing_run= 24392227fc13Smrg AC_MSG_WARN([`missing' script is too old or missing]) 24402227fc13Smrgfi 24412227fc13Smrg]) 24422227fc13Smrg 24432227fc13Smrg# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 24442227fc13Smrg# 24452227fc13Smrg# This file is free software; the Free Software Foundation 24462227fc13Smrg# gives unlimited permission to copy and/or distribute it, 24472227fc13Smrg# with or without modifications, as long as this notice is preserved. 24482227fc13Smrg 24492227fc13Smrg# AM_PROG_MKDIR_P 24502227fc13Smrg# --------------- 24512227fc13Smrg# Check for `mkdir -p'. 24522227fc13SmrgAC_DEFUN([AM_PROG_MKDIR_P], 24532227fc13Smrg[AC_PREREQ([2.60])dnl 24542227fc13SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl 24552227fc13Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, 24562227fc13Smrgdnl while keeping a definition of mkdir_p for backward compatibility. 24572227fc13Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. 24582227fc13Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of 24592227fc13Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own 24602227fc13Smrgdnl adjustment using top_builddir (which is defined more often than 24612227fc13Smrgdnl MKDIR_P). 24622227fc13SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl 24632227fc13Smrgcase $mkdir_p in 24642227fc13Smrg [[\\/$]]* | ?:[[\\/]]*) ;; 24652227fc13Smrg */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; 24662227fc13Smrgesac 24672227fc13Smrg]) 24682227fc13Smrg 24692227fc13Smrg# Helper functions for option handling. -*- Autoconf -*- 24702227fc13Smrg 24712227fc13Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. 24722227fc13Smrg# 24732227fc13Smrg# This file is free software; the Free Software Foundation 24742227fc13Smrg# gives unlimited permission to copy and/or distribute it, 24752227fc13Smrg# with or without modifications, as long as this notice is preserved. 24762227fc13Smrg 24772227fc13Smrg# serial 4 24782227fc13Smrg 24792227fc13Smrg# _AM_MANGLE_OPTION(NAME) 24802227fc13Smrg# ----------------------- 24812227fc13SmrgAC_DEFUN([_AM_MANGLE_OPTION], 24822227fc13Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 24832227fc13Smrg 24842227fc13Smrg# _AM_SET_OPTION(NAME) 24852227fc13Smrg# ------------------------------ 24862227fc13Smrg# Set option NAME. Presently that only means defining a flag for this option. 24872227fc13SmrgAC_DEFUN([_AM_SET_OPTION], 24882227fc13Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) 24892227fc13Smrg 24902227fc13Smrg# _AM_SET_OPTIONS(OPTIONS) 24912227fc13Smrg# ---------------------------------- 24922227fc13Smrg# OPTIONS is a space-separated list of Automake options. 24932227fc13SmrgAC_DEFUN([_AM_SET_OPTIONS], 24942227fc13Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 24952227fc13Smrg 24962227fc13Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 24972227fc13Smrg# ------------------------------------------- 24982227fc13Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 24992227fc13SmrgAC_DEFUN([_AM_IF_OPTION], 25002227fc13Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 25012227fc13Smrg 25022227fc13Smrg# Check to make sure that the build environment is sane. -*- Autoconf -*- 25032227fc13Smrg 25042227fc13Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 25052227fc13Smrg# Free Software Foundation, Inc. 25062227fc13Smrg# 25072227fc13Smrg# This file is free software; the Free Software Foundation 25082227fc13Smrg# gives unlimited permission to copy and/or distribute it, 25092227fc13Smrg# with or without modifications, as long as this notice is preserved. 2510644fc5c1Stron 2511644fc5c1Stron# serial 5 2512644fc5c1Stron 25132227fc13Smrg# AM_SANITY_CHECK 25142227fc13Smrg# --------------- 25152227fc13SmrgAC_DEFUN([AM_SANITY_CHECK], 25162227fc13Smrg[AC_MSG_CHECKING([whether build environment is sane]) 25172227fc13Smrg# Just in case 25182227fc13Smrgsleep 1 25192227fc13Smrgecho timestamp > conftest.file 25202227fc13Smrg# Reject unsafe characters in $srcdir or the absolute working directory 25212227fc13Smrg# name. Accept space and tab only in the latter. 25222227fc13Smrgam_lf=' 25232227fc13Smrg' 25242227fc13Smrgcase `pwd` in 25252227fc13Smrg *[[\\\"\#\$\&\'\`$am_lf]]*) 25262227fc13Smrg AC_MSG_ERROR([unsafe absolute working directory name]);; 25272227fc13Smrgesac 25282227fc13Smrgcase $srcdir in 25292227fc13Smrg *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) 25302227fc13Smrg AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; 25312227fc13Smrgesac 2532644fc5c1Stron 25332227fc13Smrg# Do `set' in a subshell so we don't clobber the current shell's 25342227fc13Smrg# arguments. Must try -L first in case configure is actually a 25352227fc13Smrg# symlink; some systems play weird games with the mod time of symlinks 25362227fc13Smrg# (eg FreeBSD returns the mod time of the symlink's containing 25372227fc13Smrg# directory). 25382227fc13Smrgif ( 25392227fc13Smrg set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` 25402227fc13Smrg if test "$[*]" = "X"; then 25412227fc13Smrg # -L didn't work. 25422227fc13Smrg set X `ls -t "$srcdir/configure" conftest.file` 25432227fc13Smrg fi 25442227fc13Smrg rm -f conftest.file 25452227fc13Smrg if test "$[*]" != "X $srcdir/configure conftest.file" \ 25462227fc13Smrg && test "$[*]" != "X conftest.file $srcdir/configure"; then 25472227fc13Smrg 25482227fc13Smrg # If neither matched, then we have a broken ls. This can happen 25492227fc13Smrg # if, for instance, CONFIG_SHELL is bash and it inherits a 25502227fc13Smrg # broken ls alias from the environment. This has actually 25512227fc13Smrg # happened. Such a system could not be considered "sane". 25522227fc13Smrg AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 25532227fc13Smrgalias in your environment]) 25542227fc13Smrg fi 25552227fc13Smrg 25562227fc13Smrg test "$[2]" = conftest.file 25572227fc13Smrg ) 25582227fc13Smrgthen 25592227fc13Smrg # Ok. 25602227fc13Smrg : 2561644fc5c1Stronelse 25622227fc13Smrg AC_MSG_ERROR([newly created file is older than distributed files! 25632227fc13SmrgCheck your system clock]) 2564644fc5c1Stronfi 25652227fc13SmrgAC_MSG_RESULT(yes)]) 2566644fc5c1Stron 25672227fc13Smrg# Copyright (C) 2009 Free Software Foundation, Inc. 25682227fc13Smrg# 25692227fc13Smrg# This file is free software; the Free Software Foundation 25702227fc13Smrg# gives unlimited permission to copy and/or distribute it, 25712227fc13Smrg# with or without modifications, as long as this notice is preserved. 2572644fc5c1Stron 25732227fc13Smrg# serial 1 2574644fc5c1Stron 25752227fc13Smrg# AM_SILENT_RULES([DEFAULT]) 25762227fc13Smrg# -------------------------- 25772227fc13Smrg# Enable less verbose build rules; with the default set to DEFAULT 25782227fc13Smrg# (`yes' being less verbose, `no' or empty being verbose). 25792227fc13SmrgAC_DEFUN([AM_SILENT_RULES], 25802227fc13Smrg[AC_ARG_ENABLE([silent-rules], 25812227fc13Smrg[ --enable-silent-rules less verbose build output (undo: `make V=1') 25822227fc13Smrg --disable-silent-rules verbose build output (undo: `make V=0')]) 25832227fc13Smrgcase $enable_silent_rules in 25842227fc13Smrgyes) AM_DEFAULT_VERBOSITY=0;; 25852227fc13Smrgno) AM_DEFAULT_VERBOSITY=1;; 25862227fc13Smrg*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; 25872227fc13Smrgesac 25882227fc13SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl 25892227fc13SmrgAM_BACKSLASH='\' 25902227fc13SmrgAC_SUBST([AM_BACKSLASH])dnl 25912227fc13Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl 25922227fc13Smrg]) 2593644fc5c1Stron 25942227fc13Smrg# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 25952227fc13Smrg# 25962227fc13Smrg# This file is free software; the Free Software Foundation 25972227fc13Smrg# gives unlimited permission to copy and/or distribute it, 25982227fc13Smrg# with or without modifications, as long as this notice is preserved. 2599644fc5c1Stron 26002227fc13Smrg# AM_PROG_INSTALL_STRIP 26012227fc13Smrg# --------------------- 26022227fc13Smrg# One issue with vendor `install' (even GNU) is that you can't 26032227fc13Smrg# specify the program used to strip binaries. This is especially 26042227fc13Smrg# annoying in cross-compiling environments, where the build's strip 26052227fc13Smrg# is unlikely to handle the host's binaries. 26062227fc13Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we 26072227fc13Smrg# always use install-sh in `make install-strip', and initialize 26082227fc13Smrg# STRIPPROG with the value of the STRIP variable (set by the user). 26092227fc13SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP], 26102227fc13Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 26112227fc13Smrg# Installed binaries are usually stripped using `strip' when the user 26122227fc13Smrg# run `make install-strip'. However `strip' might not be the right 26132227fc13Smrg# tool to use in cross-compilation environments, therefore Automake 26142227fc13Smrg# will honor the `STRIP' environment variable to overrule this program. 26152227fc13Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'. 26162227fc13Smrgif test "$cross_compiling" != no; then 26172227fc13Smrg AC_CHECK_TOOL([STRIP], [strip], :) 26182227fc13Smrgfi 26192227fc13SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" 26202227fc13SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])]) 26212227fc13Smrg 26222227fc13Smrg# Copyright (C) 2006, 2008 Free Software Foundation, Inc. 26232227fc13Smrg# 26242227fc13Smrg# This file is free software; the Free Software Foundation 26252227fc13Smrg# gives unlimited permission to copy and/or distribute it, 26262227fc13Smrg# with or without modifications, as long as this notice is preserved. 2627644fc5c1Stron 2628644fc5c1Stron# serial 2 2629644fc5c1Stron 26302227fc13Smrg# _AM_SUBST_NOTMAKE(VARIABLE) 26312227fc13Smrg# --------------------------- 26322227fc13Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. 26332227fc13Smrg# This macro is traced by Automake. 26342227fc13SmrgAC_DEFUN([_AM_SUBST_NOTMAKE]) 2635644fc5c1Stron 26362227fc13Smrg# AM_SUBST_NOTMAKE(VARIABLE) 26372227fc13Smrg# --------------------------- 26382227fc13Smrg# Public sister of _AM_SUBST_NOTMAKE. 26392227fc13SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) 2640644fc5c1Stron 26412227fc13Smrg# Check how to create a tarball. -*- Autoconf -*- 2642644fc5c1Stron 26432227fc13Smrg# Copyright (C) 2004, 2005 Free Software Foundation, Inc. 26442227fc13Smrg# 26452227fc13Smrg# This file is free software; the Free Software Foundation 26462227fc13Smrg# gives unlimited permission to copy and/or distribute it, 26472227fc13Smrg# with or without modifications, as long as this notice is preserved. 26482227fc13Smrg 26492227fc13Smrg# serial 2 26502227fc13Smrg 26512227fc13Smrg# _AM_PROG_TAR(FORMAT) 2652644fc5c1Stron# -------------------- 26532227fc13Smrg# Check how to create a tarball in format FORMAT. 26542227fc13Smrg# FORMAT should be one of `v7', `ustar', or `pax'. 26552227fc13Smrg# 26562227fc13Smrg# Substitute a variable $(am__tar) that is a command 26572227fc13Smrg# writing to stdout a FORMAT-tarball containing the directory 26582227fc13Smrg# $tardir. 26592227fc13Smrg# tardir=directory && $(am__tar) > result.tar 26602227fc13Smrg# 26612227fc13Smrg# Substitute a variable $(am__untar) that extract such 26622227fc13Smrg# a tarball read from stdin. 26632227fc13Smrg# $(am__untar) < result.tar 26642227fc13SmrgAC_DEFUN([_AM_PROG_TAR], 26652227fc13Smrg[# Always define AMTAR for backward compatibility. 26662227fc13SmrgAM_MISSING_PROG([AMTAR], [tar]) 26672227fc13Smrgm4_if([$1], [v7], 26682227fc13Smrg [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], 26692227fc13Smrg [m4_case([$1], [ustar],, [pax],, 26702227fc13Smrg [m4_fatal([Unknown tar format])]) 26712227fc13SmrgAC_MSG_CHECKING([how to create a $1 tar archive]) 26722227fc13Smrg# Loop over all known methods to create a tar archive until one works. 26732227fc13Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' 26742227fc13Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools} 26752227fc13Smrg# Do not fold the above two line into one, because Tru64 sh and 26762227fc13Smrg# Solaris sh will not grok spaces in the rhs of `-'. 26772227fc13Smrgfor _am_tool in $_am_tools 26782227fc13Smrgdo 26792227fc13Smrg case $_am_tool in 26802227fc13Smrg gnutar) 26812227fc13Smrg for _am_tar in tar gnutar gtar; 26822227fc13Smrg do 26832227fc13Smrg AM_RUN_LOG([$_am_tar --version]) && break 26842227fc13Smrg done 26852227fc13Smrg am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' 26862227fc13Smrg am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' 26872227fc13Smrg am__untar="$_am_tar -xf -" 26882227fc13Smrg ;; 26892227fc13Smrg plaintar) 26902227fc13Smrg # Must skip GNU tar: if it does not support --format= it doesn't create 26912227fc13Smrg # ustar tarball either. 26922227fc13Smrg (tar --version) >/dev/null 2>&1 && continue 26932227fc13Smrg am__tar='tar chf - "$$tardir"' 26942227fc13Smrg am__tar_='tar chf - "$tardir"' 26952227fc13Smrg am__untar='tar xf -' 26962227fc13Smrg ;; 26972227fc13Smrg pax) 26982227fc13Smrg am__tar='pax -L -x $1 -w "$$tardir"' 26992227fc13Smrg am__tar_='pax -L -x $1 -w "$tardir"' 27002227fc13Smrg am__untar='pax -r' 27012227fc13Smrg ;; 27022227fc13Smrg cpio) 27032227fc13Smrg am__tar='find "$$tardir" -print | cpio -o -H $1 -L' 27042227fc13Smrg am__tar_='find "$tardir" -print | cpio -o -H $1 -L' 27052227fc13Smrg am__untar='cpio -i -H $1 -d' 27062227fc13Smrg ;; 27072227fc13Smrg none) 27082227fc13Smrg am__tar=false 27092227fc13Smrg am__tar_=false 27102227fc13Smrg am__untar=false 27112227fc13Smrg ;; 27122227fc13Smrg esac 27132227fc13Smrg 27142227fc13Smrg # If the value was cached, stop now. We just wanted to have am__tar 27152227fc13Smrg # and am__untar set. 27162227fc13Smrg test -n "${am_cv_prog_tar_$1}" && break 27172227fc13Smrg 27182227fc13Smrg # tar/untar a dummy directory, and stop if the command works 27192227fc13Smrg rm -rf conftest.dir 27202227fc13Smrg mkdir conftest.dir 27212227fc13Smrg echo GrepMe > conftest.dir/file 27222227fc13Smrg AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) 27232227fc13Smrg rm -rf conftest.dir 27242227fc13Smrg if test -s conftest.tar; then 27252227fc13Smrg AM_RUN_LOG([$am__untar <conftest.tar]) 27262227fc13Smrg grep GrepMe conftest.dir/file >/dev/null 2>&1 && break 27272227fc13Smrg fi 27282227fc13Smrgdone 27292227fc13Smrgrm -rf conftest.dir 27302227fc13Smrg 27312227fc13SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) 27322227fc13SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])]) 27332227fc13SmrgAC_SUBST([am__tar]) 27342227fc13SmrgAC_SUBST([am__untar]) 27352227fc13Smrg]) # _AM_PROG_TAR 2736644fc5c1Stron 2737