aclocal.m4 revision 4028d71e
14028d71eSmrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
298049353Smrg
30ad07f78Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
40ad07f78Smrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
598049353Smrg# This file is free software; the Free Software Foundation
698049353Smrg# gives unlimited permission to copy and/or distribute it,
798049353Smrg# with or without modifications, as long as this notice is preserved.
898049353Smrg
998049353Smrg# This program is distributed in the hope that it will be useful,
1098049353Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1198049353Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1298049353Smrg# PARTICULAR PURPOSE.
1398049353Smrg
140ad07f78Smrgm4_ifndef([AC_AUTOCONF_VERSION],
150ad07f78Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
164028d71eSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
174028d71eSmrg[m4_warning([this file was generated for autoconf 2.68.
180ad07f78SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
190ad07f78SmrgIf you have problems, you may need to regenerate the build system entirely.
200ad07f78SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
2198049353Smrg
224028d71eSmrgdnl fontutil.m4.  Generated from fontutil.m4.in by configure.
234028d71eSmrgdnl
244028d71eSmrgdnl This file comes from X.Org's font-util 1.2.0
254028d71eSmrgdnl
264028d71eSmrgdnl Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
274028d71eSmrgdnl
284028d71eSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
294028d71eSmrgdnl copy of this software and associated documentation files (the "Software"),
304028d71eSmrgdnl to deal in the Software without restriction, including without limitation
314028d71eSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
324028d71eSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
334028d71eSmrgdnl Software is furnished to do so, subject to the following conditions:
344028d71eSmrgdnl
354028d71eSmrgdnl The above copyright notice and this permission notice (including the next
364028d71eSmrgdnl paragraph) shall be included in all copies or substantial portions of the
374028d71eSmrgdnl Software.
384028d71eSmrgdnl
394028d71eSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
404028d71eSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
414028d71eSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
424028d71eSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
434028d71eSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
444028d71eSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
454028d71eSmrgdnl DEALINGS IN THE SOFTWARE.
464028d71eSmrgdnl
474028d71eSmrgdnl --------------------------------------------------------------------
484028d71eSmrgdnl
494028d71eSmrgdnl Copyright 2005 Red Hat, Inc
504028d71eSmrgdnl
514028d71eSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
524028d71eSmrgdnl documentation for any purpose is hereby granted without fee, provided that
534028d71eSmrgdnl the above copyright notice appear in all copies and that both that
544028d71eSmrgdnl copyright notice and this permission notice appear in supporting
554028d71eSmrgdnl documentation.
564028d71eSmrgdnl
574028d71eSmrgdnl The above copyright notice and this permission notice shall be included
584028d71eSmrgdnl in all copies or substantial portions of the Software.
594028d71eSmrgdnl
604028d71eSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
614028d71eSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
624028d71eSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
634028d71eSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
644028d71eSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
654028d71eSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
664028d71eSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
674028d71eSmrgdnl
684028d71eSmrgdnl Except as contained in this notice, the name of the copyright holders shall
694028d71eSmrgdnl not be used in advertising or otherwise to promote the sale, use or
704028d71eSmrgdnl other dealings in this Software without prior written authorization
714028d71eSmrgdnl from the copyright holders.
724028d71eSmrg
734028d71eSmrg# XORG_FONT_MACROS_VERSION(required-version)
744028d71eSmrg# ------------------------------------------
754028d71eSmrg# Minimum version: 1.1.0
760ad07f78Smrg#
774028d71eSmrg# If you're using a macro added in Version 1.1 or newer, include this in
784028d71eSmrg# your configure.ac with the minimum required version, such as:
794028d71eSmrg# XORG_FONT_MACROS_VERSION(1.1)
804028d71eSmrg#
814028d71eSmrg# To ensure that this macro is defined, also add:
824028d71eSmrg# m4_ifndef([XORG_FONT_MACROS_VERSION],
834028d71eSmrg#     [m4_fatal([must install X.Org font-util 1.1 or later before running autoconf/autogen])])
844028d71eSmrg#
854028d71eSmrg#
864028d71eSmrg# See the "minimum version" comment for each macro you use to see what
874028d71eSmrg# version you require.
884028d71eSmrgm4_defun([XORG_FONT_MACROS_VERSION],[
894028d71eSmrgm4_define([vers_have], [1.2.0])
904028d71eSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
914028d71eSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
924028d71eSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
934028d71eSmrg    [m4_fatal([font-util major version ]maj_needed[ is required but ]vers_have[ found])])
944028d71eSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
954028d71eSmrg    [m4_fatal([font-util version $1 or higher is required but ]vers_have[ found])])
964028d71eSmrgm4_undefine([vers_have])
974028d71eSmrgm4_undefine([maj_have])
984028d71eSmrgm4_undefine([maj_needed])
994028d71eSmrg]) # XORG_FONT_MACROS_VERSION
10098049353Smrg
1014028d71eSmrg# XORG_FONT_CHECK_{maps}()
1024028d71eSmrg# ------------------------
1034028d71eSmrg# Minimum version: 1.0.0
1044028d71eSmrg# These macros add --enable/disable-{maps} where {maps} are ISO8859-*,
1054028d71eSmrg# JISX0201 or KOI8_R.  By default, they are all enabled.
1060ad07f78Smrg
1074028d71eSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_1], [XORG_FONT_CHECK_ENCODING(ISO8859-1)])
1084028d71eSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_2], [XORG_FONT_CHECK_ENCODING(ISO8859-2)])
1094028d71eSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_3], [XORG_FONT_CHECK_ENCODING(ISO8859-3)])
1104028d71eSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_4], [XORG_FONT_CHECK_ENCODING(ISO8859-4)])
1114028d71eSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_5], [XORG_FONT_CHECK_ENCODING(ISO8859-5)])
1124028d71eSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_6], [XORG_FONT_CHECK_ENCODING(ISO8859-6)])
1134028d71eSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_7], [XORG_FONT_CHECK_ENCODING(ISO8859-7)])
1144028d71eSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_8], [XORG_FONT_CHECK_ENCODING(ISO8859-8)])
1154028d71eSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_9], [XORG_FONT_CHECK_ENCODING(ISO8859-9)])
1164028d71eSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_10],[XORG_FONT_CHECK_ENCODING(ISO8859-10)])
1174028d71eSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_11],[XORG_FONT_CHECK_ENCODING(ISO8859-11)])
1184028d71eSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_12],[XORG_FONT_CHECK_ENCODING(ISO8859-12)])
1194028d71eSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_13],[XORG_FONT_CHECK_ENCODING(ISO8859-13)])
1204028d71eSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_14],[XORG_FONT_CHECK_ENCODING(ISO8859-14)])
1214028d71eSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_15],[XORG_FONT_CHECK_ENCODING(ISO8859-15)])
1224028d71eSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_16],[XORG_FONT_CHECK_ENCODING(ISO8859-16)])
1234028d71eSmrgAC_DEFUN([XORG_FONT_CHECK_JISX0201],  [XORG_FONT_CHECK_ENCODING(JISX0201)])
1244028d71eSmrgAC_DEFUN([XORG_FONT_CHECK_KOI8_R],    [XORG_FONT_CHECK_ENCODING(KOI8-R)])
12598049353Smrg
1264028d71eSmrg# XORG_FONT_CHECK_ENCODING(encoding)
1274028d71eSmrg# ----------------------------------
1284028d71eSmrg# Minimum version: 1.1.0
1294028d71eSmrg# This macro adds --enable/disable-<encoding>, enabled by default.
1304028d71eSmrg# It replaced individual copies of this code in the above macros in 1.1.
1314028d71eSmrg# Currently assumes encoding names will be all upper-case - add m4_toupper
1324028d71eSmrg# calls if this is not true in the future.
13398049353Smrg
1344028d71eSmrgAC_DEFUN([XORG_FONT_CHECK_ENCODING],[
1354028d71eSmrg	AC_ARG_ENABLE(m4_tolower($1),
1364028d71eSmrg		AS_HELP_STRING(m4_join([-], [--disable], m4_tolower($1)),
1374028d71eSmrg				[Build $1 fonts (default: yes)]),
1384028d71eSmrg		[AS_TR_SH($1)=$enableval])
1394028d71eSmrg	AC_MSG_CHECKING([whether to build $1 fonts])
1404028d71eSmrg	AC_MSG_RESULT($[AS_TR_SH($1)])
1414028d71eSmrg	AM_CONDITIONAL(AS_TR_SH($1), [test "x$AS_TR_SH($1)" = xyes])
1424028d71eSmrg]) # XORG_FONT_CHECK_ENCODING
14398049353Smrg
1444028d71eSmrg# XORG_FONT_CHECK_ENCODING_LIST(encoding1 encoding2....)
1454028d71eSmrg# -----------------------------------------------------
1464028d71eSmrg# Minimum version: 1.1.0
1474028d71eSmrg# Call XORG_FONT_CHECK_ENCODING for multiple encodings at once.
1484028d71eSmrg# Add a shorthand --enable/disable-all-encodings option.
14998049353Smrg
1504028d71eSmrgAC_DEFUN([XORG_FONT_CHECK_ENCODING_LIST],[
1514028d71eSmrg	AC_ARG_ENABLE([all-encodings],
1524028d71eSmrg		AS_HELP_STRING([--disable-all-encodings],
1534028d71eSmrg				[Disable building of all font encodings]),
1544028d71eSmrg		[m4_foreach_w([enc], [$1], [
1554028d71eSmrg			AS_TR_SH(enc)=$enableval
1564028d71eSmrg		])],
1574028d71eSmrg		[m4_foreach_w([enc], [$1], [
1584028d71eSmrg			AS_TR_SH(enc)=yes
1594028d71eSmrg		])])
1604028d71eSmrg	m4_foreach_w([enc], [$1], [XORG_FONT_CHECK_ENCODING(enc)])
1614028d71eSmrg]) # XORG_FONT_CHECK_ENCODING_LIST
1624028d71eSmrg
1634028d71eSmrg# XORG_FONT_REQUIRED_PROG(VARNAME, progname)
1644028d71eSmrg# ------------------------------------------
1654028d71eSmrg# Minimum version: 1.1.0
16698049353Smrg#
1674028d71eSmrg# Simple wrapper around AC_PATH_PROG that errors if not found
16898049353Smrg#
16998049353Smrg
1704028d71eSmrgAC_DEFUN([XORG_FONT_REQUIRED_PROG],[
1714028d71eSmrg	AC_PATH_PROG($1, $2)
1724028d71eSmrg	if test x"$$1" = x; then
1734028d71eSmrg		AC_MSG_ERROR([$2 is required to build $PACKAGE_NAME.])
1744028d71eSmrg	fi
17598049353Smrg])
17698049353Smrg
17798049353Smrg
1784028d71eSmrg# XORG_FONT_FCCACHE()
1794028d71eSmrg# -------------------
1804028d71eSmrg# Minimum version: 1.1.0
1810ad07f78Smrg#
1824028d71eSmrg# Set FCCACHE to path to fc-cache (fontconfig cache builder) if found
1834028d71eSmrg# Set RUN_FCCACHE to a rule suitable for substituting into a makefile
1844028d71eSmrg# to run fc-cache if found and not installing to $DESTDIR
1854028d71eSmrg#
1864028d71eSmrg# fc-cache is optional, not required, and should be skipped when making
1874028d71eSmrg# packages (installing to $DESTDIR).
1884028d71eSmrg#
1894028d71eSmrgAC_DEFUN([XORG_FONT_FCCACHE],[
1904028d71eSmrg	AC_PATH_PROG(FCCACHE, fc-cache)
1914028d71eSmrg	FCCACHE_WARN='echo "** Warning: fonts.cache not built" ; echo "** Generate this file manually on host system using fc-cache"'
1924028d71eSmrg	if test x"$FCCACHE" = x ; then
1934028d71eSmrg		RUN_FCCACHE="${FCCACHE_WARN}"
1944028d71eSmrg	else
1954028d71eSmrg		RUN_FCCACHE='@(if test -z "$(DESTDIR)"; then echo $(FCCACHE) $(fontdir); $(FCCACHE) $(fontdir); else'
1964028d71eSmrg		RUN_FCCACHE="${RUN_FCCACHE} ${FCCACHE_WARN} ; fi)"
1974028d71eSmrg	fi
1984028d71eSmrg	AC_SUBST([RUN_FCCACHE])
1994028d71eSmrg])
20098049353Smrg
20198049353Smrg
2024028d71eSmrg# XORG_FONT_COMMON_UTILS()
2034028d71eSmrg# ------------------------
2044028d71eSmrg# Minimum version: 1.1.0
2050ad07f78Smrg#
2064028d71eSmrg# Call XORG_FONT_REQUIRED_PROG for programs needed for all font types
20798049353Smrg
2084028d71eSmrgAC_DEFUN([XORG_FONT_COMMON_UTILS],[
2094028d71eSmrg	XORG_FONT_FCCACHE
2104028d71eSmrg	XORG_FONT_REQUIRED_PROG(MKFONTDIR, mkfontdir)
2114028d71eSmrg])
21298049353Smrg
2134028d71eSmrg# XORG_FONT_SCALED_UTILS()
2144028d71eSmrg# ------------------------
2154028d71eSmrg# Minimum version: 1.1.0
2164028d71eSmrg#
2174028d71eSmrg# Call XORG_FONT_REQUIRED_PROG for programs needed for scalable fonts
2184028d71eSmrg# (TrueType, OpenType, Type1)
21998049353Smrg
2204028d71eSmrgAC_DEFUN([XORG_FONT_SCALED_UTILS],[
2214028d71eSmrg	XORG_FONT_COMMON_UTILS
2224028d71eSmrg	XORG_FONT_REQUIRED_PROG(MKFONTSCALE, mkfontscale)
2234028d71eSmrg])
22498049353Smrg
2254028d71eSmrg# XORG_FONT_BDF_UTILS()
2264028d71eSmrg# ---------------------
2274028d71eSmrg# Minimum version: 1.1.0
22898049353Smrg#
2294028d71eSmrg# Call XORG_FONT_REQUIRED_PROG for programs needed for BDF format bitmap fonts
2304028d71eSmrg# Also call XORG_FONT_CHECK_COMPRESSION to determine how to compress the
2314028d71eSmrg# PCF output files created by bdftopcf
23298049353Smrg
2334028d71eSmrgAC_DEFUN([XORG_FONT_BDF_UTILS],[
2344028d71eSmrg	XORG_FONT_COMMON_UTILS
2354028d71eSmrg	XORG_FONT_REQUIRED_PROG(BDFTOPCF, bdftopcf)
2364028d71eSmrg	XORG_FONT_CHECK_COMPRESSION
2374028d71eSmrg])
23898049353Smrg
2394028d71eSmrg# XORG_FONT_CHECK_COMPRESSION()
2404028d71eSmrg# -----------------------------
2414028d71eSmrg# Minimum version: 1.1.0
2424028d71eSmrg#
2434028d71eSmrg# Offer a --with-compression flag to control what compression method is
2444028d71eSmrg# used for pcf font files.   Offers all the methods currently supported
2454028d71eSmrg# by libXfont, including no compression.
2460ad07f78Smrg
2474028d71eSmrgAC_DEFUN([XORG_FONT_CHECK_COMPRESSION],[
2484028d71eSmrg	AC_MSG_CHECKING([font compression method])
2494028d71eSmrg	AC_ARG_WITH(compression,
2504028d71eSmrg	 [AS_HELP_STRING([--with-compression=<no|compress|gzip|bzip2>],
2514028d71eSmrg			 [compression method to use on pcf fonts])],
2524028d71eSmrg         [compression="$withval"], [compression="yes"])
2534028d71eSmrg	if test x"$compression" = "xyes" ; then
2544028d71eSmrg		compression="gzip"
2554028d71eSmrg	fi
2564028d71eSmrg	AC_MSG_RESULT([${compression}])
2574028d71eSmrg	case ${compression} in
2584028d71eSmrg	 *compress)	COMPRESS_SUFFIX=".Z" ;;
2594028d71eSmrg	 *gzip)		COMPRESS_SUFFIX=".gz" ;;
2604028d71eSmrg	 *bzip2)	COMPRESS_SUFFIX=".bz2" ;;
2614028d71eSmrg	 no|none)	COMPRESS_SUFFIX="" ; COMPRESS="cat" ;;
2624028d71eSmrg	 *) AC_MSG_ERROR([${compression} is not a supported compression method]) ;;
2634028d71eSmrg	esac
2644028d71eSmrg	if test x"$COMPRESS_SUFFIX" != "x" ; then
2654028d71eSmrg	   XORG_FONT_REQUIRED_PROG(COMPRESS, ${compression})
2664028d71eSmrg	fi
2674028d71eSmrg	AC_SUBST([COMPRESS_SUFFIX])
2684028d71eSmrg])
26998049353Smrg
2704028d71eSmrg# XORG_FONT_UCS2ANY()
2714028d71eSmrg# -------------------
2724028d71eSmrg# Minimum version: 1.1.0
2734028d71eSmrg#
2744028d71eSmrg# Call XORG_FONT_REQUIRED_PROG for ucs2any program needed for splitting
2754028d71eSmrg# Unicode-encoded BDF format bitmap fonts into subsets for older encodings.
2764028d71eSmrg# Also call pkg-config to find the directory with the encoding files needed
2774028d71eSmrg# by ucs2any, and export it as MAPFILES_PATH to the Makefiles
27898049353Smrg
2794028d71eSmrgAC_DEFUN([XORG_FONT_UCS2ANY],[
2804028d71eSmrg	XORG_FONT_REQUIRED_PROG(UCS2ANY, ucs2any)
2814028d71eSmrg	PKG_CHECK_MODULES(MAPS, [fontutil])
2824028d71eSmrg	AC_MSG_CHECKING([for ucs2any encoding data files])
2834028d71eSmrg	MAPFILES_PATH=`pkg-config --variable=mapdir fontutil`
2844028d71eSmrg	AC_SUBST(MAPFILES_PATH)
2854028d71eSmrg	AC_MSG_RESULT([${MAPFILES_PATH}])
2860ad07f78Smrg])
2870ad07f78Smrg
2880ad07f78Smrg
2890ad07f78Smrg
2904028d71eSmrg# XORG_FONT_FC_CONFDIR()
2914028d71eSmrg# --------------------
2924028d71eSmrg# Minimum version: 1.2.0
2934028d71eSmrg#
2944028d71eSmrg# Sets FC_CONFDIR to the fontconfig config directory
2954028d71eSmrg# (which should be --with-confdir=... when building fontconfig)
2964028d71eSmrg# found from:
2974028d71eSmrg#	--with-fc-confdir=...
2984028d71eSmrg#	pkg-config --variable=confdir fontconfig
2994028d71eSmrg#	${sysconfdir}/fonts
3000ad07f78Smrg
3014028d71eSmrgAC_DEFUN([XORG_FONT_FC_CONFDIR],[
3024028d71eSmrg	dnl Ensure $PKG_CONFIG is set first
3034028d71eSmrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
3044028d71eSmrg
3054028d71eSmrg	AC_MSG_CHECKING([for fontconfig's configuration directory])
3064028d71eSmrg	AC_ARG_WITH(fc-confdir,
3074028d71eSmrg		    AS_HELP_STRING([--with-fc-confdir=DIR],
3084028d71eSmrg			   [Path to fontconfig's configuration directory]),
3094028d71eSmrg		    [FC_CONFDIR="$withval"])
3104028d71eSmrg	# if --with-fc-confdir was not specified
3114028d71eSmrg	if test "x${FC_CONFDIR}" = "x"; then
3124028d71eSmrg		FC_CONFDIR=`$PKG_CONFIG --variable=confdir fontconfig`
3134028d71eSmrg	fi
3144028d71eSmrg	# ...and if pkg-config didn't find confdir in fontconfig.pc...
3154028d71eSmrg	if test "x${FC_CONFDIR}" = "x"; then
3164028d71eSmrg		FC_CONFDIR="${sysconfdir}/fonts"
3174028d71eSmrg	fi
3184028d71eSmrg	AC_SUBST(FC_CONFDIR)
3194028d71eSmrg	AC_MSG_RESULT([${FC_CONFDIR}])
3200ad07f78Smrg])
3210ad07f78Smrg
3220ad07f78Smrg
3234028d71eSmrg
3244028d71eSmrg# XORG_FONTROOTDIR()
3254028d71eSmrg# --------------------
3264028d71eSmrg# Minimum version: 1.1.0
3270ad07f78Smrg#
3284028d71eSmrg# Sets FONTROOTDIR to the root directory for font files.  Uses the first
3294028d71eSmrg# found from:
3304028d71eSmrg#	--with-fontrootdir
3314028d71eSmrg#	pkg-config --variable=fontrootdir fontutil
3324028d71eSmrg#	${datadir}/fonts/X11
3330ad07f78Smrg
3344028d71eSmrgAC_DEFUN([XORG_FONTROOTDIR],[
3354028d71eSmrg	dnl Ensure $PKG_CONFIG is set first
3364028d71eSmrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
3370ad07f78Smrg
3384028d71eSmrg	AC_MSG_CHECKING([for root directory for font files])
3394028d71eSmrg	AC_ARG_WITH(fontrootdir,
3404028d71eSmrg		    AS_HELP_STRING([--with-fontrootdir=DIR],
3414028d71eSmrg			   [Path to root directory for font files]),
3424028d71eSmrg		    [FONTROOTDIR="$withval"])
3434028d71eSmrg	# if --with-fontrootdir not specified...
3444028d71eSmrg	if test "x${FONTROOTDIR}" = "x"; then
3454028d71eSmrg		FONTROOTDIR=`$PKG_CONFIG --variable=fontrootdir fontutil`
3464028d71eSmrg	fi
3474028d71eSmrg	# ...and if pkg-config didn't find fontdir in fontutil.pc...
3484028d71eSmrg	if test "x${FONTROOTDIR}" = "x"; then
3494028d71eSmrg		FONTROOTDIR="${datadir}/fonts/X11"
3504028d71eSmrg	fi
3514028d71eSmrg	AC_SUBST(FONTROOTDIR)
3524028d71eSmrg	AC_MSG_RESULT([${FONTROOTDIR}])
3534028d71eSmrg])
3540ad07f78Smrg
3554028d71eSmrg# XORG_FONTSUBDIR(variable, flag, subdir)
3564028d71eSmrg# ---------------------------------------
3574028d71eSmrg# Minimum version: 1.1.0
3580ad07f78Smrg#
3594028d71eSmrg# Offer a --with-<flag> flag to control directory for font installation
3604028d71eSmrg# Default is the specified <subdir> of the font root directory.
3614028d71eSmrg# Sets <variable> to the selected directory
3620ad07f78Smrg
3634028d71eSmrgAC_DEFUN([XORG_FONTSUBDIR],[
3644028d71eSmrg	AC_REQUIRE([XORG_FONTROOTDIR])
3650ad07f78Smrg
3664028d71eSmrg	AC_MSG_CHECKING([for directory for $3 files])
3674028d71eSmrg	AC_ARG_WITH($2,
3684028d71eSmrg		    [AS_HELP_STRING([--with-$2=DIR],
3694028d71eSmrg				    [Path to $3 files [FONTROOTDIR/$3]])],
3704028d71eSmrg		    [$1="${withval}"], [$1='${FONTROOTDIR}/$3'])
3714028d71eSmrg	AC_SUBST($1)
3724028d71eSmrg	AC_MSG_RESULT([${$1}])
3734028d71eSmrg]) # XORG_FONTSUBDIR
3744028d71eSmrg
3754028d71eSmrg# XORG_FONTDIR(subdir)
3764028d71eSmrg# --------------------
3774028d71eSmrg# Minimum version: 1.1.0
3780ad07f78Smrg#
3794028d71eSmrg# Offer a --with-fontdir flag to control directory for font installation
3804028d71eSmrg# Default is the specified subdir of the font root directory.
3814028d71eSmrg# Sets FONTDIR to the selected directory
3820ad07f78Smrg
3834028d71eSmrgAC_DEFUN([XORG_FONTDIR],[XORG_FONTSUBDIR([FONTDIR], [fontdir], [$1])])
3840ad07f78Smrg
3854028d71eSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
3864028d71eSmrg# serial 1 (pkg-config-0.24)
3874028d71eSmrg# 
3884028d71eSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
3894028d71eSmrg#
3904028d71eSmrg# This program is free software; you can redistribute it and/or modify
3914028d71eSmrg# it under the terms of the GNU General Public License as published by
3924028d71eSmrg# the Free Software Foundation; either version 2 of the License, or
3934028d71eSmrg# (at your option) any later version.
3944028d71eSmrg#
3954028d71eSmrg# This program is distributed in the hope that it will be useful, but
3964028d71eSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
3974028d71eSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
3984028d71eSmrg# General Public License for more details.
3994028d71eSmrg#
4004028d71eSmrg# You should have received a copy of the GNU General Public License
4014028d71eSmrg# along with this program; if not, write to the Free Software
4024028d71eSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
4034028d71eSmrg#
4044028d71eSmrg# As a special exception to the GNU General Public License, if you
4054028d71eSmrg# distribute this file as part of a program that contains a
4064028d71eSmrg# configuration script generated by Autoconf, you may include it under
4074028d71eSmrg# the same distribution terms that you use for the rest of that program.
4080ad07f78Smrg
4094028d71eSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
4104028d71eSmrg# ----------------------------------
4114028d71eSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
4124028d71eSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
4134028d71eSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
4144028d71eSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
4154028d71eSmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
4164028d71eSmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
4170ad07f78Smrg
4184028d71eSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
4194028d71eSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
4200ad07f78Smrgfi
4214028d71eSmrgif test -n "$PKG_CONFIG"; then
4224028d71eSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
4234028d71eSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
4244028d71eSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
4254028d71eSmrg		AC_MSG_RESULT([yes])
4264028d71eSmrg	else
4274028d71eSmrg		AC_MSG_RESULT([no])
4284028d71eSmrg		PKG_CONFIG=""
4294028d71eSmrg	fi
4304028d71eSmrgfi[]dnl
4314028d71eSmrg])# PKG_PROG_PKG_CONFIG
4320ad07f78Smrg
4334028d71eSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
4344028d71eSmrg#
4354028d71eSmrg# Check to see whether a particular set of modules exists.  Similar
4364028d71eSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
4374028d71eSmrg#
4384028d71eSmrg# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
4394028d71eSmrg# only at the first occurence in configure.ac, so if the first place
4404028d71eSmrg# it's called might be skipped (such as if it is within an "if", you
4414028d71eSmrg# have to call PKG_CHECK_EXISTS manually
4424028d71eSmrg# --------------------------------------------------------------
4434028d71eSmrgAC_DEFUN([PKG_CHECK_EXISTS],
4444028d71eSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
4454028d71eSmrgif test -n "$PKG_CONFIG" && \
4464028d71eSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
4474028d71eSmrg  m4_default([$2], [:])
4484028d71eSmrgm4_ifvaln([$3], [else
4494028d71eSmrg  $3])dnl
4504028d71eSmrgfi])
4510ad07f78Smrg
4524028d71eSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
4534028d71eSmrg# ---------------------------------------------
4544028d71eSmrgm4_define([_PKG_CONFIG],
4554028d71eSmrg[if test -n "$$1"; then
4564028d71eSmrg    pkg_cv_[]$1="$$1"
4574028d71eSmrg elif test -n "$PKG_CONFIG"; then
4584028d71eSmrg    PKG_CHECK_EXISTS([$3],
4594028d71eSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
4604028d71eSmrg		     [pkg_failed=yes])
4614028d71eSmrg else
4624028d71eSmrg    pkg_failed=untried
4634028d71eSmrgfi[]dnl
4644028d71eSmrg])# _PKG_CONFIG
4650ad07f78Smrg
4664028d71eSmrg# _PKG_SHORT_ERRORS_SUPPORTED
4674028d71eSmrg# -----------------------------
4684028d71eSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
4694028d71eSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
4704028d71eSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
4714028d71eSmrg        _pkg_short_errors_supported=yes
4724028d71eSmrgelse
4734028d71eSmrg        _pkg_short_errors_supported=no
4744028d71eSmrgfi[]dnl
4754028d71eSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
4760ad07f78Smrg
4770ad07f78Smrg
4784028d71eSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
4794028d71eSmrg# [ACTION-IF-NOT-FOUND])
4804028d71eSmrg#
4814028d71eSmrg#
4824028d71eSmrg# Note that if there is a possibility the first call to
4834028d71eSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
4844028d71eSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
4854028d71eSmrg#
4864028d71eSmrg#
4874028d71eSmrg# --------------------------------------------------------------
4884028d71eSmrgAC_DEFUN([PKG_CHECK_MODULES],
4894028d71eSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
4904028d71eSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
4914028d71eSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
4920ad07f78Smrg
4934028d71eSmrgpkg_failed=no
4944028d71eSmrgAC_MSG_CHECKING([for $1])
4954028d71eSmrg
4964028d71eSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
4974028d71eSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
4984028d71eSmrg
4994028d71eSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
5004028d71eSmrgand $1[]_LIBS to avoid the need to call pkg-config.
5014028d71eSmrgSee the pkg-config man page for more details.])
5024028d71eSmrg
5034028d71eSmrgif test $pkg_failed = yes; then
5044028d71eSmrg   	AC_MSG_RESULT([no])
5054028d71eSmrg        _PKG_SHORT_ERRORS_SUPPORTED
5064028d71eSmrg        if test $_pkg_short_errors_supported = yes; then
5074028d71eSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
5084028d71eSmrg        else 
5094028d71eSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
5104028d71eSmrg        fi
5114028d71eSmrg	# Put the nasty error message in config.log where it belongs
5124028d71eSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
5134028d71eSmrg
5144028d71eSmrg	m4_default([$4], [AC_MSG_ERROR(
5154028d71eSmrg[Package requirements ($2) were not met:
5164028d71eSmrg
5174028d71eSmrg$$1_PKG_ERRORS
5184028d71eSmrg
5194028d71eSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
5204028d71eSmrginstalled software in a non-standard prefix.
5214028d71eSmrg
5224028d71eSmrg_PKG_TEXT])[]dnl
5234028d71eSmrg        ])
5244028d71eSmrgelif test $pkg_failed = untried; then
5254028d71eSmrg     	AC_MSG_RESULT([no])
5264028d71eSmrg	m4_default([$4], [AC_MSG_FAILURE(
5274028d71eSmrg[The pkg-config script could not be found or is too old.  Make sure it
5284028d71eSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
5294028d71eSmrgpath to pkg-config.
5304028d71eSmrg
5314028d71eSmrg_PKG_TEXT
5324028d71eSmrg
5334028d71eSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])dnl
5344028d71eSmrg        ])
5354028d71eSmrgelse
5364028d71eSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
5374028d71eSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
5384028d71eSmrg        AC_MSG_RESULT([yes])
5394028d71eSmrg	$3
5404028d71eSmrgfi[]dnl
5414028d71eSmrg])# PKG_CHECK_MODULES
5420ad07f78Smrg
5434028d71eSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
5444028d71eSmrgdnl
5454028d71eSmrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
5464028d71eSmrgdnl 
5474028d71eSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
5484028d71eSmrgdnl copy of this software and associated documentation files (the "Software"),
5494028d71eSmrgdnl to deal in the Software without restriction, including without limitation
5504028d71eSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
5514028d71eSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
5524028d71eSmrgdnl Software is furnished to do so, subject to the following conditions:
5534028d71eSmrgdnl
5544028d71eSmrgdnl The above copyright notice and this permission notice (including the next
5554028d71eSmrgdnl paragraph) shall be included in all copies or substantial portions of the
5564028d71eSmrgdnl Software.
5574028d71eSmrgdnl
5584028d71eSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
5594028d71eSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
5604028d71eSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
5614028d71eSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
5624028d71eSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
5634028d71eSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
5644028d71eSmrgdnl DEALINGS IN THE SOFTWARE.
5650ad07f78Smrg
5664028d71eSmrg# XORG_MACROS_VERSION(required-version)
5674028d71eSmrg# -------------------------------------
5684028d71eSmrg# Minimum version: 1.1.0
5690ad07f78Smrg#
5704028d71eSmrg# If you're using a macro added in Version 1.1 or newer, include this in
5714028d71eSmrg# your configure.ac with the minimum required version, such as:
5724028d71eSmrg# XORG_MACROS_VERSION(1.1)
5734028d71eSmrg#
5744028d71eSmrg# To ensure that this macro is defined, also add:
5754028d71eSmrg# m4_ifndef([XORG_MACROS_VERSION],
5764028d71eSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
5774028d71eSmrg#
5784028d71eSmrg#
5794028d71eSmrg# See the "minimum version" comment for each macro you use to see what 
5804028d71eSmrg# version you require.
5814028d71eSmrgm4_defun([XORG_MACROS_VERSION],[
5824028d71eSmrgm4_define([vers_have], [1.11.0])
5834028d71eSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
5844028d71eSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
5854028d71eSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
5864028d71eSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
5874028d71eSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
5884028d71eSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
5894028d71eSmrgm4_undefine([vers_have])
5904028d71eSmrgm4_undefine([maj_have])
5914028d71eSmrgm4_undefine([maj_needed])
5924028d71eSmrg]) # XORG_MACROS_VERSION
5930ad07f78Smrg
5944028d71eSmrg# XORG_PROG_RAWCPP()
5950ad07f78Smrg# ------------------
5964028d71eSmrg# Minimum version: 1.0.0
5970ad07f78Smrg#
5984028d71eSmrg# Find cpp program and necessary flags for use in pre-processing text files
5994028d71eSmrg# such as man pages and config files
6004028d71eSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
6014028d71eSmrgAC_REQUIRE([AC_PROG_CPP])
6024028d71eSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
6034028d71eSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
6040ad07f78Smrg
6054028d71eSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
6064028d71eSmrg# which is not the best choice for supporting other OS'es, but covers most
6074028d71eSmrg# of the ones we need for now.
6084028d71eSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
6094028d71eSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
6104028d71eSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
6114028d71eSmrg	AC_MSG_RESULT([no])
6120ad07f78Smrgelse
6134028d71eSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
6144028d71eSmrg		RAWCPPFLAGS=-undef
6154028d71eSmrg		AC_MSG_RESULT([yes])
6164028d71eSmrg	# under Cygwin unix is still defined even with -undef
6174028d71eSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
6184028d71eSmrg		RAWCPPFLAGS="-undef -ansi"
6194028d71eSmrg		AC_MSG_RESULT([yes, with -ansi])
6204028d71eSmrg	else
6214028d71eSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
6224028d71eSmrg	fi
6230ad07f78Smrgfi
6244028d71eSmrgrm -f conftest.$ac_ext
6250ad07f78Smrg
6264028d71eSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
6274028d71eSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
6284028d71eSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
6294028d71eSmrg	AC_MSG_RESULT([no])
6304028d71eSmrgelse
6314028d71eSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
6324028d71eSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
6334028d71eSmrg		AC_MSG_RESULT([yes])
6344028d71eSmrg	else
6354028d71eSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
6364028d71eSmrg	fi
6374028d71eSmrgfi
6384028d71eSmrgrm -f conftest.$ac_ext
6394028d71eSmrgAC_SUBST(RAWCPPFLAGS)
6404028d71eSmrg]) # XORG_PROG_RAWCPP
6410ad07f78Smrg
6424028d71eSmrg# XORG_MANPAGE_SECTIONS()
6434028d71eSmrg# -----------------------
6444028d71eSmrg# Minimum version: 1.0.0
6450ad07f78Smrg#
6464028d71eSmrg# Determine which sections man pages go in for the different man page types
6474028d71eSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
6484028d71eSmrg# Not sure if there's any better way than just hardcoding by OS name.
6494028d71eSmrg# Override default settings by setting environment variables
6504028d71eSmrg# Added MAN_SUBSTS in version 1.8
6514028d71eSmrg# Added AC_PROG_SED in version 1.8
6520ad07f78Smrg
6534028d71eSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
6544028d71eSmrgAC_REQUIRE([AC_CANONICAL_HOST])
6554028d71eSmrgAC_REQUIRE([AC_PROG_SED])
6560ad07f78Smrg
6574028d71eSmrgif test x$APP_MAN_SUFFIX = x    ; then
6584028d71eSmrg    APP_MAN_SUFFIX=1
6594028d71eSmrgfi
6604028d71eSmrgif test x$APP_MAN_DIR = x    ; then
6614028d71eSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
6624028d71eSmrgfi
6630ad07f78Smrg
6644028d71eSmrgif test x$LIB_MAN_SUFFIX = x    ; then
6654028d71eSmrg    LIB_MAN_SUFFIX=3
6664028d71eSmrgfi
6674028d71eSmrgif test x$LIB_MAN_DIR = x    ; then
6684028d71eSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
6694028d71eSmrgfi
6700ad07f78Smrg
6714028d71eSmrgif test x$FILE_MAN_SUFFIX = x    ; then
6724028d71eSmrg    case $host_os in
6734028d71eSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
6744028d71eSmrg	*)		FILE_MAN_SUFFIX=5  ;;
6754028d71eSmrg    esac
6764028d71eSmrgfi
6774028d71eSmrgif test x$FILE_MAN_DIR = x    ; then
6784028d71eSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
6794028d71eSmrgfi
6800ad07f78Smrg
6814028d71eSmrgif test x$MISC_MAN_SUFFIX = x    ; then
6824028d71eSmrg    case $host_os in
6834028d71eSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
6844028d71eSmrg	*)		MISC_MAN_SUFFIX=7  ;;
6854028d71eSmrg    esac
6864028d71eSmrgfi
6874028d71eSmrgif test x$MISC_MAN_DIR = x    ; then
6884028d71eSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
6894028d71eSmrgfi
6900ad07f78Smrg
6914028d71eSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
6924028d71eSmrg    case $host_os in
6934028d71eSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
6944028d71eSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
6954028d71eSmrg    esac
6964028d71eSmrgfi
6974028d71eSmrgif test x$DRIVER_MAN_DIR = x    ; then
6984028d71eSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
6994028d71eSmrgfi
7000ad07f78Smrg
7014028d71eSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
7024028d71eSmrg    case $host_os in
7034028d71eSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
7044028d71eSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
7054028d71eSmrg    esac
7064028d71eSmrgfi
7074028d71eSmrgif test x$ADMIN_MAN_DIR = x    ; then
7084028d71eSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
7090ad07f78Smrgfi
7100ad07f78Smrg
7110ad07f78Smrg
7124028d71eSmrgAC_SUBST([APP_MAN_SUFFIX])
7134028d71eSmrgAC_SUBST([LIB_MAN_SUFFIX])
7144028d71eSmrgAC_SUBST([FILE_MAN_SUFFIX])
7154028d71eSmrgAC_SUBST([MISC_MAN_SUFFIX])
7164028d71eSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
7174028d71eSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
7184028d71eSmrgAC_SUBST([APP_MAN_DIR])
7194028d71eSmrgAC_SUBST([LIB_MAN_DIR])
7204028d71eSmrgAC_SUBST([FILE_MAN_DIR])
7214028d71eSmrgAC_SUBST([MISC_MAN_DIR])
7224028d71eSmrgAC_SUBST([DRIVER_MAN_DIR])
7234028d71eSmrgAC_SUBST([ADMIN_MAN_DIR])
7240ad07f78Smrg
7254028d71eSmrgXORG_MAN_PAGE="X Version 11"
7264028d71eSmrgAC_SUBST([XORG_MAN_PAGE])
7274028d71eSmrgMAN_SUBSTS="\
7284028d71eSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
7294028d71eSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
7304028d71eSmrg	-e 's|__xservername__|Xorg|g' \
7314028d71eSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
7324028d71eSmrg	-e 's|__projectroot__|\$(prefix)|g' \
7334028d71eSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
7344028d71eSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
7354028d71eSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
7364028d71eSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
7374028d71eSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
7384028d71eSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
7394028d71eSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
7404028d71eSmrgAC_SUBST([MAN_SUBSTS])
7410ad07f78Smrg
7424028d71eSmrg]) # XORG_MANPAGE_SECTIONS
7430ad07f78Smrg
7444028d71eSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
7454028d71eSmrg# ------------------------
7464028d71eSmrg# Minimum version: 1.7.0
7474028d71eSmrg#
7484028d71eSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
7494028d71eSmrg# provided by xorg-sgml-doctools, if installed.
7504028d71eSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
7514028d71eSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
7524028d71eSmrgXORG_SGML_PATH=
7534028d71eSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
7544028d71eSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
7554028d71eSmrg    [m4_ifval([$1],[:],
7564028d71eSmrg        [if test x"$cross_compiling" != x"yes" ; then
7574028d71eSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
7584028d71eSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
7594028d71eSmrg         fi])
7604028d71eSmrg    ])
7614028d71eSmrg
7624028d71eSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
7634028d71eSmrg# the path and the name of the doc stylesheet
7644028d71eSmrgif test "x$XORG_SGML_PATH" != "x" ; then
7654028d71eSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
7664028d71eSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
7674028d71eSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
7680ad07f78Smrgelse
7694028d71eSmrg   AC_MSG_RESULT([no])
7700ad07f78Smrgfi
7710ad07f78Smrg
7724028d71eSmrgAC_SUBST(XORG_SGML_PATH)
7734028d71eSmrgAC_SUBST(STYLESHEET_SRCDIR)
7744028d71eSmrgAC_SUBST(XSL_STYLESHEET)
7754028d71eSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
7764028d71eSmrg]) # XORG_CHECK_SGML_DOCTOOLS
7774028d71eSmrg
7784028d71eSmrg# XORG_CHECK_LINUXDOC
7794028d71eSmrg# -------------------
7804028d71eSmrg# Minimum version: 1.0.0
7810ad07f78Smrg#
7824028d71eSmrg# Defines the variable MAKE_TEXT if the necessary tools and
7834028d71eSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
7844028d71eSmrg# Whether or not the necessary tools and files are found can be checked
7854028d71eSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
7864028d71eSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
7874028d71eSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
7884028d71eSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
7890ad07f78Smrg
7904028d71eSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
7910ad07f78Smrg
7924028d71eSmrgAC_MSG_CHECKING([whether to build documentation])
7930ad07f78Smrg
7944028d71eSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
7954028d71eSmrg   BUILDDOC=yes
7964028d71eSmrgelse
7974028d71eSmrg   BUILDDOC=no
7984028d71eSmrgfi
7990ad07f78Smrg
8004028d71eSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
8010ad07f78Smrg
8024028d71eSmrgAC_MSG_RESULT([$BUILDDOC])
8030ad07f78Smrg
8044028d71eSmrgAC_MSG_CHECKING([whether to build pdf documentation])
8050ad07f78Smrg
8064028d71eSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
8074028d71eSmrg   BUILDPDFDOC=yes
8084028d71eSmrgelse
8094028d71eSmrg   BUILDPDFDOC=no
8104028d71eSmrgfi
8110ad07f78Smrg
8124028d71eSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
8130ad07f78Smrg
8144028d71eSmrgAC_MSG_RESULT([$BUILDPDFDOC])
8150ad07f78Smrg
8164028d71eSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
8174028d71eSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
8184028d71eSmrgMAKE_PDF="$PS2PDF"
8194028d71eSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
8200ad07f78Smrg
8214028d71eSmrgAC_SUBST(MAKE_TEXT)
8224028d71eSmrgAC_SUBST(MAKE_PS)
8234028d71eSmrgAC_SUBST(MAKE_PDF)
8244028d71eSmrgAC_SUBST(MAKE_HTML)
8254028d71eSmrg]) # XORG_CHECK_LINUXDOC
8260ad07f78Smrg
8274028d71eSmrg# XORG_CHECK_DOCBOOK
8284028d71eSmrg# -------------------
8294028d71eSmrg# Minimum version: 1.0.0
8304028d71eSmrg#
8314028d71eSmrg# Checks for the ability to build output formats from SGML DocBook source.
8324028d71eSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
8334028d71eSmrg# indicates whether the necessary tools and files are found and, if set,
8344028d71eSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
8354028d71eSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
8364028d71eSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
8370ad07f78Smrg
8384028d71eSmrgBUILDTXTDOC=no
8394028d71eSmrgBUILDPDFDOC=no
8404028d71eSmrgBUILDPSDOC=no
8414028d71eSmrgBUILDHTMLDOC=no
8420ad07f78Smrg
8434028d71eSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
8444028d71eSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
8454028d71eSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
8464028d71eSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
8470ad07f78Smrg
8484028d71eSmrgAC_MSG_CHECKING([whether to build text documentation])
8494028d71eSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
8504028d71eSmrg   test x$BUILD_TXTDOC != xno; then
8514028d71eSmrg	BUILDTXTDOC=yes
8520ad07f78Smrgfi
8534028d71eSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
8544028d71eSmrgAC_MSG_RESULT([$BUILDTXTDOC])
8550ad07f78Smrg
8564028d71eSmrgAC_MSG_CHECKING([whether to build PDF documentation])
8574028d71eSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
8584028d71eSmrg   test x$BUILD_PDFDOC != xno; then
8594028d71eSmrg	BUILDPDFDOC=yes
8604028d71eSmrgfi
8614028d71eSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
8624028d71eSmrgAC_MSG_RESULT([$BUILDPDFDOC])
8630ad07f78Smrg
8644028d71eSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
8654028d71eSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
8664028d71eSmrg   test x$BUILD_PSDOC != xno; then
8674028d71eSmrg	BUILDPSDOC=yes
8684028d71eSmrgfi
8694028d71eSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
8704028d71eSmrgAC_MSG_RESULT([$BUILDPSDOC])
8710ad07f78Smrg
8724028d71eSmrgAC_MSG_CHECKING([whether to build HTML documentation])
8734028d71eSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
8744028d71eSmrg   test x$BUILD_HTMLDOC != xno; then
8754028d71eSmrg	BUILDHTMLDOC=yes
8764028d71eSmrgfi
8774028d71eSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
8784028d71eSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
8794028d71eSmrg
8804028d71eSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
8814028d71eSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
8824028d71eSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
8834028d71eSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
8840ad07f78Smrg
8854028d71eSmrgAC_SUBST(MAKE_TEXT)
8864028d71eSmrgAC_SUBST(MAKE_PS)
8874028d71eSmrgAC_SUBST(MAKE_PDF)
8884028d71eSmrgAC_SUBST(MAKE_HTML)
8894028d71eSmrg]) # XORG_CHECK_DOCBOOK
8900ad07f78Smrg
8914028d71eSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
8924028d71eSmrg# ----------------
8934028d71eSmrg# Minimum version: 1.5.0
8944028d71eSmrg# Minimum version for optional DEFAULT argument: 1.11.0
8954028d71eSmrg#
8964028d71eSmrg# Documentation tools are not always available on all platforms and sometimes
8974028d71eSmrg# not at the appropriate level. This macro enables a module to test for the
8984028d71eSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
8994028d71eSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
9004028d71eSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
9014028d71eSmrg# --with-xmlto assumes 'auto'.
9024028d71eSmrg#
9034028d71eSmrg# Interface to module:
9044028d71eSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
9054028d71eSmrg# XMLTO:	returns the path of the xmlto program found
9064028d71eSmrg#		returns the path set by the user in the environment
9074028d71eSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
9084028d71eSmrg#		'no' user instructs the module not to use xmlto
9094028d71eSmrg#
9104028d71eSmrg# Added in version 1.10.0
9114028d71eSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
9124028d71eSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
9134028d71eSmrg#
9144028d71eSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
9154028d71eSmrg#
9164028d71eSmrgAC_DEFUN([XORG_WITH_XMLTO],[
9174028d71eSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
9184028d71eSmrgm4_define([_defopt], m4_default([$2], [auto]))
9194028d71eSmrgAC_ARG_WITH(xmlto,
9204028d71eSmrg	AS_HELP_STRING([--with-xmlto],
9214028d71eSmrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
9224028d71eSmrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
9234028d71eSmrgm4_undefine([_defopt])
9244028d71eSmrg
9254028d71eSmrgif test "x$use_xmlto" = x"auto"; then
9264028d71eSmrg   AC_PATH_PROG([XMLTO], [xmlto])
9274028d71eSmrg   if test "x$XMLTO" = "x"; then
9284028d71eSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
9294028d71eSmrg	have_xmlto=no
9304028d71eSmrg   else
9314028d71eSmrg        have_xmlto=yes
9324028d71eSmrg   fi
9334028d71eSmrgelif test "x$use_xmlto" = x"yes" ; then
9344028d71eSmrg   AC_PATH_PROG([XMLTO], [xmlto])
9354028d71eSmrg   if test "x$XMLTO" = "x"; then
9364028d71eSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
9374028d71eSmrg   fi
9384028d71eSmrg   have_xmlto=yes
9394028d71eSmrgelif test "x$use_xmlto" = x"no" ; then
9404028d71eSmrg   if test "x$XMLTO" != "x"; then
9414028d71eSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
9424028d71eSmrg   fi
9434028d71eSmrg   have_xmlto=no
9444028d71eSmrgelse
9454028d71eSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
9460ad07f78Smrgfi
9470ad07f78Smrg
9484028d71eSmrg# Test for a minimum version of xmlto, if provided.
9494028d71eSmrgm4_ifval([$1],
9504028d71eSmrg[if test "$have_xmlto" = yes; then
9514028d71eSmrg    # scrape the xmlto version
9524028d71eSmrg    AC_MSG_CHECKING([the xmlto version])
9534028d71eSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
9544028d71eSmrg    AC_MSG_RESULT([$xmlto_version])
9554028d71eSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
9564028d71eSmrg        [if test "x$use_xmlto" = xauto; then
9574028d71eSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
9584028d71eSmrg            have_xmlto=no
9594028d71eSmrg        else
9604028d71eSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
9614028d71eSmrg        fi])
9624028d71eSmrgfi])
9630ad07f78Smrg
9644028d71eSmrg# Test for the ability of xmlto to generate a text target
9654028d71eSmrghave_xmlto_text=no
9664028d71eSmrgcat > conftest.xml << "EOF"
9674028d71eSmrgEOF
9684028d71eSmrgAS_IF([test "$have_xmlto" = yes],
9694028d71eSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
9704028d71eSmrg             [have_xmlto_text=yes],
9714028d71eSmrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
9724028d71eSmrgrm -f conftest.xml
9734028d71eSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
9744028d71eSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
9754028d71eSmrg]) # XORG_WITH_XMLTO
9764028d71eSmrg
9774028d71eSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
9784028d71eSmrg# ----------------
9794028d71eSmrg# Minimum version: 1.5.0
9804028d71eSmrg# Minimum version for optional DEFAULT argument: 1.11.0
9814028d71eSmrg#
9824028d71eSmrg# Documentation tools are not always available on all platforms and sometimes
9834028d71eSmrg# not at the appropriate level. This macro enables a module to test for the
9844028d71eSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
9854028d71eSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
9864028d71eSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
9874028d71eSmrg# --with-asciidoc assumes 'auto'.
9884028d71eSmrg#
9894028d71eSmrg# Interface to module:
9904028d71eSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
9914028d71eSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
9924028d71eSmrg#		 returns the path set by the user in the environment
9934028d71eSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
9944028d71eSmrg#		  'no' user instructs the module not to use asciidoc
9954028d71eSmrg#
9964028d71eSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
9974028d71eSmrg#
9984028d71eSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
9994028d71eSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
10004028d71eSmrgm4_define([_defopt], m4_default([$2], [auto]))
10014028d71eSmrgAC_ARG_WITH(asciidoc,
10024028d71eSmrg	AS_HELP_STRING([--with-asciidoc],
10034028d71eSmrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
10044028d71eSmrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
10054028d71eSmrgm4_undefine([_defopt])
10064028d71eSmrg
10074028d71eSmrgif test "x$use_asciidoc" = x"auto"; then
10084028d71eSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
10094028d71eSmrg   if test "x$ASCIIDOC" = "x"; then
10104028d71eSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
10114028d71eSmrg	have_asciidoc=no
10124028d71eSmrg   else
10134028d71eSmrg        have_asciidoc=yes
10144028d71eSmrg   fi
10154028d71eSmrgelif test "x$use_asciidoc" = x"yes" ; then
10164028d71eSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
10174028d71eSmrg   if test "x$ASCIIDOC" = "x"; then
10184028d71eSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
10194028d71eSmrg   fi
10204028d71eSmrg   have_asciidoc=yes
10214028d71eSmrgelif test "x$use_asciidoc" = x"no" ; then
10224028d71eSmrg   if test "x$ASCIIDOC" != "x"; then
10234028d71eSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
10244028d71eSmrg   fi
10254028d71eSmrg   have_asciidoc=no
10264028d71eSmrgelse
10274028d71eSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
10284028d71eSmrgfi
10294028d71eSmrgm4_ifval([$1],
10304028d71eSmrg[if test "$have_asciidoc" = yes; then
10314028d71eSmrg    # scrape the asciidoc version
10324028d71eSmrg    AC_MSG_CHECKING([the asciidoc version])
10334028d71eSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
10344028d71eSmrg    AC_MSG_RESULT([$asciidoc_version])
10354028d71eSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
10364028d71eSmrg        [if test "x$use_asciidoc" = xauto; then
10374028d71eSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
10384028d71eSmrg            have_asciidoc=no
10394028d71eSmrg        else
10404028d71eSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
10414028d71eSmrg        fi])
10424028d71eSmrgfi])
10434028d71eSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
10444028d71eSmrg]) # XORG_WITH_ASCIIDOC
10454028d71eSmrg
10464028d71eSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
10474028d71eSmrg# --------------------------------
10484028d71eSmrg# Minimum version: 1.5.0
10494028d71eSmrg# Minimum version for optional DEFAULT argument: 1.11.0
10504028d71eSmrg#
10514028d71eSmrg# Documentation tools are not always available on all platforms and sometimes
10524028d71eSmrg# not at the appropriate level. This macro enables a module to test for the
10534028d71eSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
10544028d71eSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
10554028d71eSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
10564028d71eSmrg# --with-doxygen assumes 'auto'.
10574028d71eSmrg#
10584028d71eSmrg# Interface to module:
10594028d71eSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
10604028d71eSmrg# DOXYGEN:	 returns the path of the doxygen program found
10614028d71eSmrg#		 returns the path set by the user in the environment
10624028d71eSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
10634028d71eSmrg#		  'no' user instructs the module not to use doxygen
10644028d71eSmrg#
10654028d71eSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
10664028d71eSmrg#
10674028d71eSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
10684028d71eSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
10694028d71eSmrgm4_define([_defopt], m4_default([$2], [auto]))
10704028d71eSmrgAC_ARG_WITH(doxygen,
10714028d71eSmrg	AS_HELP_STRING([--with-doxygen],
10724028d71eSmrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
10734028d71eSmrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
10744028d71eSmrgm4_undefine([_defopt])
10754028d71eSmrg
10764028d71eSmrgif test "x$use_doxygen" = x"auto"; then
10774028d71eSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
10784028d71eSmrg   if test "x$DOXYGEN" = "x"; then
10794028d71eSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
10804028d71eSmrg	have_doxygen=no
10814028d71eSmrg   else
10824028d71eSmrg        have_doxygen=yes
10834028d71eSmrg   fi
10844028d71eSmrgelif test "x$use_doxygen" = x"yes" ; then
10854028d71eSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
10864028d71eSmrg   if test "x$DOXYGEN" = "x"; then
10874028d71eSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
10884028d71eSmrg   fi
10894028d71eSmrg   have_doxygen=yes
10904028d71eSmrgelif test "x$use_doxygen" = x"no" ; then
10914028d71eSmrg   if test "x$DOXYGEN" != "x"; then
10924028d71eSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
10934028d71eSmrg   fi
10944028d71eSmrg   have_doxygen=no
10954028d71eSmrgelse
10964028d71eSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
10974028d71eSmrgfi
10984028d71eSmrgm4_ifval([$1],
10994028d71eSmrg[if test "$have_doxygen" = yes; then
11004028d71eSmrg    # scrape the doxygen version
11014028d71eSmrg    AC_MSG_CHECKING([the doxygen version])
11024028d71eSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
11034028d71eSmrg    AC_MSG_RESULT([$doxygen_version])
11044028d71eSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
11054028d71eSmrg        [if test "x$use_doxygen" = xauto; then
11064028d71eSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
11074028d71eSmrg            have_doxygen=no
11084028d71eSmrg        else
11094028d71eSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
11104028d71eSmrg        fi])
11114028d71eSmrgfi])
11124028d71eSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
11134028d71eSmrg]) # XORG_WITH_DOXYGEN
11140ad07f78Smrg
11154028d71eSmrg# XORG_WITH_GROFF([DEFAULT])
11164028d71eSmrg# ----------------
11174028d71eSmrg# Minimum version: 1.6.0
11184028d71eSmrg# Minimum version for optional DEFAULT argument: 1.11.0
11194028d71eSmrg#
11204028d71eSmrg# Documentation tools are not always available on all platforms and sometimes
11214028d71eSmrg# not at the appropriate level. This macro enables a module to test for the
11224028d71eSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
11234028d71eSmrg# the --with-groff option, it allows maximum flexibilty in making decisions
11244028d71eSmrg# as whether or not to use the groff package. When DEFAULT is not specified,
11254028d71eSmrg# --with-groff assumes 'auto'.
11264028d71eSmrg#
11274028d71eSmrg# Interface to module:
11284028d71eSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
11294028d71eSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
11304028d71eSmrg# HAVE_GROFF_MS: the -ms macros package
11314028d71eSmrg# GROFF:	 returns the path of the groff program found
11324028d71eSmrg#		 returns the path set by the user in the environment
11334028d71eSmrg# --with-groff:	 'yes' user instructs the module to use groff
11344028d71eSmrg#		 'no' user instructs the module not to use groff
11354028d71eSmrg#
11364028d71eSmrg# Added in version 1.9.0:
11374028d71eSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
11384028d71eSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
11394028d71eSmrg#		   psselect from the psutils package.
11404028d71eSmrg#		   the ghostcript package. Refer to the grohtml man pages
11414028d71eSmrg#
11424028d71eSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
11434028d71eSmrg#
11444028d71eSmrg# OS and distros often splits groff in a basic and full package, the former
11454028d71eSmrg# having the groff program and the later having devices, fonts and macros
11464028d71eSmrg# Checking for the groff executable is not enough.
11474028d71eSmrg#
11484028d71eSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
11494028d71eSmrg# unset HAVE_GROFF or GROFF env variables.
11504028d71eSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
11514028d71eSmrg#
11524028d71eSmrgAC_DEFUN([XORG_WITH_GROFF],[
11534028d71eSmrgAC_ARG_VAR([GROFF], [Path to groff command])
11544028d71eSmrgm4_define([_defopt], m4_default([$1], [auto]))
11554028d71eSmrgAC_ARG_WITH(groff,
11564028d71eSmrg	AS_HELP_STRING([--with-groff],
11574028d71eSmrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
11584028d71eSmrg	   [use_groff=$withval], [use_groff=]_defopt)
11594028d71eSmrgm4_undefine([_defopt])
11604028d71eSmrg
11614028d71eSmrgif test "x$use_groff" = x"auto"; then
11624028d71eSmrg   AC_PATH_PROG([GROFF], [groff])
11634028d71eSmrg   if test "x$GROFF" = "x"; then
11644028d71eSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
11654028d71eSmrg	have_groff=no
11664028d71eSmrg   else
11674028d71eSmrg        have_groff=yes
11684028d71eSmrg   fi
11694028d71eSmrgelif test "x$use_groff" = x"yes" ; then
11704028d71eSmrg   AC_PATH_PROG([GROFF], [groff])
11714028d71eSmrg   if test "x$GROFF" = "x"; then
11724028d71eSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
11734028d71eSmrg   fi
11744028d71eSmrg   have_groff=yes
11754028d71eSmrgelif test "x$use_groff" = x"no" ; then
11764028d71eSmrg   if test "x$GROFF" != "x"; then
11774028d71eSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
11784028d71eSmrg   fi
11794028d71eSmrg   have_groff=no
11804028d71eSmrgelse
11814028d71eSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
11824028d71eSmrgfi
11830ad07f78Smrg
11844028d71eSmrg# We have groff, test for the presence of the macro packages
11854028d71eSmrgif test "x$have_groff" = x"yes"; then
11864028d71eSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
11874028d71eSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
11884028d71eSmrg        groff_ms_works=yes
11894028d71eSmrg    else
11904028d71eSmrg        groff_ms_works=no
11914028d71eSmrg    fi
11924028d71eSmrg    AC_MSG_RESULT([$groff_ms_works])
11934028d71eSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
11944028d71eSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
11954028d71eSmrg        groff_mm_works=yes
11964028d71eSmrg    else
11974028d71eSmrg        groff_mm_works=no
11984028d71eSmrg    fi
11994028d71eSmrg    AC_MSG_RESULT([$groff_mm_works])
12004028d71eSmrgfi
12010ad07f78Smrg
12024028d71eSmrg# We have groff, test for HTML dependencies, one command per package
12034028d71eSmrgif test "x$have_groff" = x"yes"; then
12044028d71eSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
12054028d71eSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
12064028d71eSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
12074028d71eSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
12084028d71eSmrg      have_groff_html=yes
12094028d71eSmrg   else
12104028d71eSmrg      have_groff_html=no
12114028d71eSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
12124028d71eSmrg   fi
12134028d71eSmrgfi
12140ad07f78Smrg
12154028d71eSmrg# Set Automake conditionals for Makefiles
12164028d71eSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
12174028d71eSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
12184028d71eSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
12194028d71eSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
12204028d71eSmrg]) # XORG_WITH_GROFF
12210ad07f78Smrg
12224028d71eSmrg# XORG_WITH_FOP([DEFAULT])
12234028d71eSmrg# ----------------
12244028d71eSmrg# Minimum version: 1.6.0
12254028d71eSmrg# Minimum version for optional DEFAULT argument: 1.11.0
12264028d71eSmrg#
12274028d71eSmrg# Documentation tools are not always available on all platforms and sometimes
12284028d71eSmrg# not at the appropriate level. This macro enables a module to test for the
12294028d71eSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
12304028d71eSmrg# the --with-fop option, it allows maximum flexibilty in making decisions
12314028d71eSmrg# as whether or not to use the fop package. When DEFAULT is not specified,
12324028d71eSmrg# --with-fop assumes 'auto'.
12334028d71eSmrg#
12344028d71eSmrg# Interface to module:
12354028d71eSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
12364028d71eSmrg# FOP:	 	returns the path of the fop program found
12374028d71eSmrg#		returns the path set by the user in the environment
12384028d71eSmrg# --with-fop: 	'yes' user instructs the module to use fop
12394028d71eSmrg#		'no' user instructs the module not to use fop
12404028d71eSmrg#
12414028d71eSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
12424028d71eSmrg#
12434028d71eSmrgAC_DEFUN([XORG_WITH_FOP],[
12444028d71eSmrgAC_ARG_VAR([FOP], [Path to fop command])
12454028d71eSmrgm4_define([_defopt], m4_default([$1], [auto]))
12464028d71eSmrgAC_ARG_WITH(fop,
12474028d71eSmrg	AS_HELP_STRING([--with-fop],
12484028d71eSmrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
12494028d71eSmrg	   [use_fop=$withval], [use_fop=]_defopt)
12504028d71eSmrgm4_undefine([_defopt])
12514028d71eSmrg
12524028d71eSmrgif test "x$use_fop" = x"auto"; then
12534028d71eSmrg   AC_PATH_PROG([FOP], [fop])
12544028d71eSmrg   if test "x$FOP" = "x"; then
12554028d71eSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
12564028d71eSmrg	have_fop=no
12574028d71eSmrg   else
12584028d71eSmrg        have_fop=yes
12594028d71eSmrg   fi
12604028d71eSmrgelif test "x$use_fop" = x"yes" ; then
12614028d71eSmrg   AC_PATH_PROG([FOP], [fop])
12624028d71eSmrg   if test "x$FOP" = "x"; then
12634028d71eSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
12644028d71eSmrg   fi
12654028d71eSmrg   have_fop=yes
12664028d71eSmrgelif test "x$use_fop" = x"no" ; then
12674028d71eSmrg   if test "x$FOP" != "x"; then
12684028d71eSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
12694028d71eSmrg   fi
12704028d71eSmrg   have_fop=no
12714028d71eSmrgelse
12724028d71eSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
12734028d71eSmrgfi
12744028d71eSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
12754028d71eSmrg]) # XORG_WITH_FOP
12760ad07f78Smrg
12774028d71eSmrg# XORG_WITH_PS2PDF([DEFAULT])
12784028d71eSmrg# ----------------
12794028d71eSmrg# Minimum version: 1.6.0
12804028d71eSmrg# Minimum version for optional DEFAULT argument: 1.11.0
12814028d71eSmrg#
12824028d71eSmrg# Documentation tools are not always available on all platforms and sometimes
12834028d71eSmrg# not at the appropriate level. This macro enables a module to test for the
12844028d71eSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
12854028d71eSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
12864028d71eSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
12874028d71eSmrg# --with-ps2pdf assumes 'auto'.
12884028d71eSmrg#
12894028d71eSmrg# Interface to module:
12904028d71eSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
12914028d71eSmrg# PS2PDF:	returns the path of the ps2pdf program found
12924028d71eSmrg#		returns the path set by the user in the environment
12934028d71eSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
12944028d71eSmrg#		 'no' user instructs the module not to use ps2pdf
12954028d71eSmrg#
12964028d71eSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
12974028d71eSmrg#
12984028d71eSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
12994028d71eSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
13004028d71eSmrgm4_define([_defopt], m4_default([$1], [auto]))
13014028d71eSmrgAC_ARG_WITH(ps2pdf,
13024028d71eSmrg	AS_HELP_STRING([--with-ps2pdf],
13034028d71eSmrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
13044028d71eSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
13054028d71eSmrgm4_undefine([_defopt])
13064028d71eSmrg
13074028d71eSmrgif test "x$use_ps2pdf" = x"auto"; then
13084028d71eSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
13094028d71eSmrg   if test "x$PS2PDF" = "x"; then
13104028d71eSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
13114028d71eSmrg	have_ps2pdf=no
13124028d71eSmrg   else
13134028d71eSmrg        have_ps2pdf=yes
13144028d71eSmrg   fi
13154028d71eSmrgelif test "x$use_ps2pdf" = x"yes" ; then
13164028d71eSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
13174028d71eSmrg   if test "x$PS2PDF" = "x"; then
13184028d71eSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
13194028d71eSmrg   fi
13204028d71eSmrg   have_ps2pdf=yes
13214028d71eSmrgelif test "x$use_ps2pdf" = x"no" ; then
13224028d71eSmrg   if test "x$PS2PDF" != "x"; then
13234028d71eSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
13244028d71eSmrg   fi
13254028d71eSmrg   have_ps2pdf=no
13264028d71eSmrgelse
13274028d71eSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
13284028d71eSmrgfi
13294028d71eSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
13304028d71eSmrg]) # XORG_WITH_PS2PDF
13310ad07f78Smrg
13324028d71eSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
13334028d71eSmrg# ----------------
13344028d71eSmrg# Minimum version: 1.6.0
13354028d71eSmrg#
13364028d71eSmrg# Documentation tools are not always available on all platforms and sometimes
13374028d71eSmrg# not at the appropriate level. This macro enables a builder to skip all
13384028d71eSmrg# documentation targets except traditional man pages.
13394028d71eSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
13404028d71eSmrg# maximum flexibilty in controlling documentation building.
13414028d71eSmrg# Refer to:
13424028d71eSmrg# XORG_WITH_XMLTO         --with-xmlto
13434028d71eSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
13444028d71eSmrg# XORG_WITH_DOXYGEN       --with-doxygen
13454028d71eSmrg# XORG_WITH_FOP           --with-fop
13464028d71eSmrg# XORG_WITH_GROFF         --with-groff
13474028d71eSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
13484028d71eSmrg#
13494028d71eSmrg# Interface to module:
13504028d71eSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
13514028d71eSmrg# --enable-docs: 'yes' user instructs the module to generate docs
13524028d71eSmrg#		 'no' user instructs the module not to generate docs
13534028d71eSmrg# parm1:	specify the default value, yes or no.
13544028d71eSmrg#
13554028d71eSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
13564028d71eSmrgm4_define([default], m4_default([$1], [yes]))
13574028d71eSmrgAC_ARG_ENABLE(docs,
13584028d71eSmrg	AS_HELP_STRING([--enable-docs],
13594028d71eSmrg	   [Enable building the documentation (default: ]default[)]),
13604028d71eSmrg	   [build_docs=$enableval], [build_docs=]default)
13614028d71eSmrgm4_undefine([default])
13624028d71eSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
13634028d71eSmrgAC_MSG_CHECKING([whether to build documentation])
13644028d71eSmrgAC_MSG_RESULT([$build_docs])
13654028d71eSmrg]) # XORG_ENABLE_DOCS
13664028d71eSmrg
13674028d71eSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
13684028d71eSmrg# ----------------
13694028d71eSmrg# Minimum version: 1.6.0
13704028d71eSmrg#
13714028d71eSmrg# This macro enables a builder to skip all developer documentation.
13724028d71eSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
13734028d71eSmrg# maximum flexibilty in controlling documentation building.
13744028d71eSmrg# Refer to:
13754028d71eSmrg# XORG_WITH_XMLTO         --with-xmlto
13764028d71eSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
13774028d71eSmrg# XORG_WITH_DOXYGEN       --with-doxygen
13784028d71eSmrg# XORG_WITH_FOP           --with-fop
13794028d71eSmrg# XORG_WITH_GROFF         --with-groff
13804028d71eSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
13814028d71eSmrg#
13824028d71eSmrg# Interface to module:
13834028d71eSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
13844028d71eSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
13854028d71eSmrg#			'no' user instructs the module not to generate developer docs
13864028d71eSmrg# parm1:		specify the default value, yes or no.
13874028d71eSmrg#
13884028d71eSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
13894028d71eSmrgm4_define([devel_default], m4_default([$1], [yes]))
13904028d71eSmrgAC_ARG_ENABLE(devel-docs,
13914028d71eSmrg	AS_HELP_STRING([--enable-devel-docs],
13924028d71eSmrg	   [Enable building the developer documentation (default: ]devel_default[)]),
13934028d71eSmrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
13944028d71eSmrgm4_undefine([devel_default])
13954028d71eSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
13964028d71eSmrgAC_MSG_CHECKING([whether to build developer documentation])
13974028d71eSmrgAC_MSG_RESULT([$build_devel_docs])
13984028d71eSmrg]) # XORG_ENABLE_DEVEL_DOCS
13994028d71eSmrg
14004028d71eSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
14014028d71eSmrg# ----------------
14024028d71eSmrg# Minimum version: 1.6.0
14034028d71eSmrg#
14044028d71eSmrg# This macro enables a builder to skip all functional specification targets.
14054028d71eSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
14064028d71eSmrg# maximum flexibilty in controlling documentation building.
14074028d71eSmrg# Refer to:
14084028d71eSmrg# XORG_WITH_XMLTO         --with-xmlto
14094028d71eSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
14104028d71eSmrg# XORG_WITH_DOXYGEN       --with-doxygen
14114028d71eSmrg# XORG_WITH_FOP           --with-fop
14124028d71eSmrg# XORG_WITH_GROFF         --with-groff
14134028d71eSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
14144028d71eSmrg#
14154028d71eSmrg# Interface to module:
14164028d71eSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
14174028d71eSmrg# --enable-specs:	'yes' user instructs the module to generate specs
14184028d71eSmrg#			'no' user instructs the module not to generate specs
14194028d71eSmrg# parm1:		specify the default value, yes or no.
14204028d71eSmrg#
14214028d71eSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
14224028d71eSmrgm4_define([spec_default], m4_default([$1], [yes]))
14234028d71eSmrgAC_ARG_ENABLE(specs,
14244028d71eSmrg	AS_HELP_STRING([--enable-specs],
14254028d71eSmrg	   [Enable building the specs (default: ]spec_default[)]),
14264028d71eSmrg	   [build_specs=$enableval], [build_specs=]spec_default)
14274028d71eSmrgm4_undefine([spec_default])
14284028d71eSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
14294028d71eSmrgAC_MSG_CHECKING([whether to build functional specifications])
14304028d71eSmrgAC_MSG_RESULT([$build_specs])
14314028d71eSmrg]) # XORG_ENABLE_SPECS
14320ad07f78Smrg
14334028d71eSmrg# XORG_CHECK_MALLOC_ZERO
14344028d71eSmrg# ----------------------
14354028d71eSmrg# Minimum version: 1.0.0
14364028d71eSmrg#
14374028d71eSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
14384028d71eSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
14394028d71eSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
14404028d71eSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
14414028d71eSmrgAC_ARG_ENABLE(malloc0returnsnull,
14424028d71eSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
14434028d71eSmrg		       [malloc(0) returns NULL (default: auto)]),
14444028d71eSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
14454028d71eSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
14460ad07f78Smrg
14474028d71eSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
14484028d71eSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
14494028d71eSmrg	AC_RUN_IFELSE([
14504028d71eSmrgchar *malloc();
14514028d71eSmrgchar *realloc();
14524028d71eSmrgchar *calloc();
14534028d71eSmrgmain() {
14544028d71eSmrg    char *m0, *r0, *c0, *p;
14554028d71eSmrg    m0 = malloc(0);
14564028d71eSmrg    p = malloc(10);
14574028d71eSmrg    r0 = realloc(p,0);
14584028d71eSmrg    c0 = calloc(0);
14594028d71eSmrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
14604028d71eSmrg}],
14614028d71eSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
14624028d71eSmrg		[MALLOC_ZERO_RETURNS_NULL=no],
14634028d71eSmrg		[MALLOC_ZERO_RETURNS_NULL=yes])
14644028d71eSmrgfi
14654028d71eSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
14660ad07f78Smrg
14674028d71eSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
14684028d71eSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
14694028d71eSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
14704028d71eSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
14714028d71eSmrgelse
14724028d71eSmrg	MALLOC_ZERO_CFLAGS=""
14734028d71eSmrg	XMALLOC_ZERO_CFLAGS=""
14744028d71eSmrg	XTMALLOC_ZERO_CFLAGS=""
14754028d71eSmrgfi
14764028d71eSmrg
14774028d71eSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
14784028d71eSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
14794028d71eSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
14804028d71eSmrg]) # XORG_CHECK_MALLOC_ZERO
14810ad07f78Smrg
14824028d71eSmrg# XORG_WITH_LINT()
14834028d71eSmrg# ----------------
14840ad07f78Smrg# Minimum version: 1.1.0
14850ad07f78Smrg#
14864028d71eSmrg# This macro enables the use of a tool that flags some suspicious and
14874028d71eSmrg# non-portable constructs (likely to be bugs) in C language source code.
14884028d71eSmrg# It will attempt to locate the tool and use appropriate options.
14894028d71eSmrg# There are various lint type tools on different platforms.
14900ad07f78Smrg#
14914028d71eSmrg# Interface to module:
14924028d71eSmrg# LINT:		returns the path to the tool found on the platform
14934028d71eSmrg#		or the value set to LINT on the configure cmd line
14944028d71eSmrg#		also an Automake conditional
14954028d71eSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
14960ad07f78Smrg#
14974028d71eSmrg# --with-lint:	'yes' user instructs the module to use lint
14984028d71eSmrg#		'no' user instructs the module not to use lint (default)
14990ad07f78Smrg#
15004028d71eSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
15014028d71eSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
15024028d71eSmrg#
15034028d71eSmrgAC_DEFUN([XORG_WITH_LINT],[
15040ad07f78Smrg
15054028d71eSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
15064028d71eSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
15074028d71eSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
15084028d71eSmrg		[Use a lint-style source code checker (default: disabled)])],
15094028d71eSmrg		[use_lint=$withval], [use_lint=no])
15100ad07f78Smrg
15114028d71eSmrg# Obtain platform specific info like program name and options
15124028d71eSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
15134028d71eSmrgcase $host_os in
15144028d71eSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
15154028d71eSmrg	lint_name=splint
15164028d71eSmrg	lint_options="-badflag"
15174028d71eSmrg	;;
15184028d71eSmrg  *freebsd* | *netbsd*)
15194028d71eSmrg	lint_name=lint
15204028d71eSmrg	lint_options="-u -b"
15214028d71eSmrg	;;
15224028d71eSmrg  *solaris*)
15234028d71eSmrg	lint_name=lint
15244028d71eSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
15254028d71eSmrg	;;
15264028d71eSmrgesac
15270ad07f78Smrg
15284028d71eSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
15294028d71eSmrgif test "x$use_lint" = x"yes" ; then
15304028d71eSmrg   AC_PATH_PROG([LINT], [$lint_name])
15314028d71eSmrg   if test "x$LINT" = "x"; then
15324028d71eSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
15334028d71eSmrg   fi
15344028d71eSmrgelif test "x$use_lint" = x"no" ; then
15354028d71eSmrg   if test "x$LINT" != "x"; then
15364028d71eSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
15374028d71eSmrg   fi
15384028d71eSmrgelse
15394028d71eSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
15404028d71eSmrgfi
15410ad07f78Smrg
15424028d71eSmrg# User supplied flags override default flags
15434028d71eSmrgif test "x$LINT_FLAGS" != "x"; then
15444028d71eSmrg   lint_options=$LINT_FLAGS
15454028d71eSmrgfi
15460ad07f78Smrg
15474028d71eSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
15484028d71eSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
15490ad07f78Smrg
15504028d71eSmrg]) # XORG_WITH_LINT
15510ad07f78Smrg
15524028d71eSmrg# XORG_LINT_LIBRARY(LIBNAME)
15534028d71eSmrg# --------------------------
15540ad07f78Smrg# Minimum version: 1.1.0
15550ad07f78Smrg#
15564028d71eSmrg# Sets up flags for building lint libraries for checking programs that call
15574028d71eSmrg# functions in the library.
15580ad07f78Smrg#
15594028d71eSmrg# Interface to module:
15604028d71eSmrg# LINTLIB		- Automake variable with the name of lint library file to make
15614028d71eSmrg# MAKE_LINT_LIB		- Automake conditional
15620ad07f78Smrg#
15634028d71eSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
15644028d71eSmrg#			  - 'no' user instructs the module not to create a lint library (default)
156598049353Smrg
15664028d71eSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
15674028d71eSmrgAC_REQUIRE([XORG_WITH_LINT])
15684028d71eSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
15694028d71eSmrg	[Create lint library (default: disabled)])],
15704028d71eSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
157198049353Smrg
15724028d71eSmrgif test "x$make_lint_lib" = x"yes" ; then
15734028d71eSmrg   LINTLIB=llib-l$1.ln
15744028d71eSmrg   if test "x$LINT" = "x"; then
15754028d71eSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
15764028d71eSmrg   fi
15774028d71eSmrgelif test "x$make_lint_lib" != x"no" ; then
15784028d71eSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
15794028d71eSmrgfi
158098049353Smrg
15814028d71eSmrgAC_SUBST(LINTLIB)
15824028d71eSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
158398049353Smrg
15844028d71eSmrg]) # XORG_LINT_LIBRARY
158598049353Smrg
15864028d71eSmrg# XORG_CWARNFLAGS
15874028d71eSmrg# ---------------
15884028d71eSmrg# Minimum version: 1.2.0
15890ad07f78Smrg#
15904028d71eSmrg# Defines CWARNFLAGS to enable C compiler warnings.
15910ad07f78Smrg#
15924028d71eSmrgAC_DEFUN([XORG_CWARNFLAGS], [
15934028d71eSmrgAC_REQUIRE([AC_PROG_CC_C99])
15944028d71eSmrgif  test "x$GCC" = xyes ; then
15954028d71eSmrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
15964028d71eSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
15974028d71eSmrg-Wbad-function-cast -Wformat=2"
15984028d71eSmrg    case `$CC -dumpversion` in
15994028d71eSmrg    3.4.* | 4.*)
16004028d71eSmrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
16014028d71eSmrg	;;
16024028d71eSmrg    esac
16034028d71eSmrgelse
16044028d71eSmrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
16054028d71eSmrg    if test "x$SUNCC" = "xyes"; then
16064028d71eSmrg	CWARNFLAGS="-v"
16074028d71eSmrg    fi
16084028d71eSmrgfi
16094028d71eSmrgAC_SUBST(CWARNFLAGS)
16104028d71eSmrg]) # XORG_CWARNFLAGS
161198049353Smrg
16124028d71eSmrg# XORG_STRICT_OPTION
16134028d71eSmrg# -----------------------
16144028d71eSmrg# Minimum version: 1.3.0
16150ad07f78Smrg#
16164028d71eSmrg# Add configure option to enable strict compilation
16174028d71eSmrgAC_DEFUN([XORG_STRICT_OPTION], [
16184028d71eSmrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
16194028d71eSmrgAC_REQUIRE([AC_PROG_CC_C99])
16204028d71eSmrgAC_REQUIRE([XORG_CWARNFLAGS])
162198049353Smrg
16224028d71eSmrgAC_ARG_ENABLE(strict-compilation,
16234028d71eSmrg			  AS_HELP_STRING([--enable-strict-compilation],
16244028d71eSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
16254028d71eSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
16264028d71eSmrgif test "x$STRICT_COMPILE" = "xyes"; then
16274028d71eSmrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
16284028d71eSmrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
16294028d71eSmrg	if test "x$GCC" = xyes ; then
16304028d71eSmrg		STRICT_CFLAGS="-pedantic -Werror"
16314028d71eSmrg	elif test "x$SUNCC" = "xyes"; then
16324028d71eSmrg		STRICT_CFLAGS="-errwarn"
16334028d71eSmrg    elif test "x$INTELCC" = "xyes"; then
16344028d71eSmrg		STRICT_CFLAGS="-Werror"
16354028d71eSmrg	fi
16364028d71eSmrgfi
16374028d71eSmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
16384028d71eSmrgAC_SUBST([CWARNFLAGS])
16394028d71eSmrg]) # XORG_STRICT_OPTION
164098049353Smrg
16414028d71eSmrg# XORG_DEFAULT_OPTIONS
16420ad07f78Smrg# --------------------
16434028d71eSmrg# Minimum version: 1.3.0
16440ad07f78Smrg#
16454028d71eSmrg# Defines default options for X.Org modules.
16464028d71eSmrg#
16474028d71eSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
16484028d71eSmrgAC_REQUIRE([AC_PROG_INSTALL])
16494028d71eSmrgXORG_CWARNFLAGS
16504028d71eSmrgXORG_STRICT_OPTION
16514028d71eSmrgXORG_RELEASE_VERSION
16524028d71eSmrgXORG_CHANGELOG
16534028d71eSmrgXORG_INSTALL
16544028d71eSmrgXORG_MANPAGE_SECTIONS
16554028d71eSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
16564028d71eSmrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
16574028d71eSmrg]) # XORG_DEFAULT_OPTIONS
16580ad07f78Smrg
16594028d71eSmrg# XORG_INSTALL()
16604028d71eSmrg# ----------------
16614028d71eSmrg# Minimum version: 1.4.0
16624028d71eSmrg#
16634028d71eSmrg# Defines the variable INSTALL_CMD as the command to copy
16644028d71eSmrg# INSTALL from $prefix/share/util-macros.
16654028d71eSmrg#
16664028d71eSmrgAC_DEFUN([XORG_INSTALL], [
16674028d71eSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
16684028d71eSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
16694028d71eSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
16704028d71eSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
16714028d71eSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
16724028d71eSmrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
16734028d71eSmrgAC_SUBST([INSTALL_CMD])
16744028d71eSmrg]) # XORG_INSTALL
16754028d71eSmrgdnl Copyright 2005 Red Hat, Inc
16764028d71eSmrgdnl
16774028d71eSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
16784028d71eSmrgdnl documentation for any purpose is hereby granted without fee, provided that
16794028d71eSmrgdnl the above copyright notice appear in all copies and that both that
16804028d71eSmrgdnl copyright notice and this permission notice appear in supporting
16814028d71eSmrgdnl documentation.
16824028d71eSmrgdnl
16834028d71eSmrgdnl The above copyright notice and this permission notice shall be included
16844028d71eSmrgdnl in all copies or substantial portions of the Software.
16854028d71eSmrgdnl
16864028d71eSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16874028d71eSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16884028d71eSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16894028d71eSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
16904028d71eSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
16914028d71eSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
16924028d71eSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
16934028d71eSmrgdnl
16944028d71eSmrgdnl Except as contained in this notice, the name of the copyright holders shall
16954028d71eSmrgdnl not be used in advertising or otherwise to promote the sale, use or
16964028d71eSmrgdnl other dealings in this Software without prior written authorization
16974028d71eSmrgdnl from the copyright holders.
16984028d71eSmrgdnl
16990ad07f78Smrg
17004028d71eSmrg# XORG_RELEASE_VERSION
17014028d71eSmrg# --------------------
17024028d71eSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
17034028d71eSmrg 
17044028d71eSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
17054028d71eSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
17064028d71eSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
17074028d71eSmrg		[Major version of this package])
17084028d71eSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
17094028d71eSmrg	if test "x$PVM" = "x"; then
17104028d71eSmrg		PVM="0"
17110ad07f78Smrg	fi
17124028d71eSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
17134028d71eSmrg		[$PVM],
17144028d71eSmrg		[Minor version of this package])
17154028d71eSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
17164028d71eSmrg	if test "x$PVP" = "x"; then
17174028d71eSmrg		PVP="0"
17180ad07f78Smrg	fi
17194028d71eSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
17204028d71eSmrg		[$PVP],
17214028d71eSmrg		[Patch version of this package])
17220ad07f78Smrg])
172398049353Smrg
17244028d71eSmrg# XORG_CHANGELOG()
17254028d71eSmrg# ----------------
17264028d71eSmrg# Minimum version: 1.2.0
17270ad07f78Smrg#
17284028d71eSmrg# Defines the variable CHANGELOG_CMD as the command to generate
17294028d71eSmrg# ChangeLog from git.
17304028d71eSmrg#
17314028d71eSmrg#
17324028d71eSmrgAC_DEFUN([XORG_CHANGELOG], [
17334028d71eSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
17344028d71eSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
17354028d71eSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
17364028d71eSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
17374028d71eSmrgAC_SUBST([CHANGELOG_CMD])
17384028d71eSmrg]) # XORG_CHANGELOG
17390ad07f78Smrg
17404028d71eSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
17414028d71eSmrg#
17424028d71eSmrg# This file is free software; the Free Software Foundation
17434028d71eSmrg# gives unlimited permission to copy and/or distribute it,
17444028d71eSmrg# with or without modifications, as long as this notice is preserved.
17450ad07f78Smrg
17464028d71eSmrg# AM_AUTOMAKE_VERSION(VERSION)
17474028d71eSmrg# ----------------------------
17484028d71eSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
17494028d71eSmrg# generated from the m4 files accompanying Automake X.Y.
17504028d71eSmrg# (This private macro should not be called outside this file.)
17514028d71eSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
17524028d71eSmrg[am__api_version='1.11'
17534028d71eSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
17544028d71eSmrgdnl require some minimum version.  Point them to the right macro.
17554028d71eSmrgm4_if([$1], [1.11.1], [],
17564028d71eSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
17574028d71eSmrg])
17580ad07f78Smrg
17594028d71eSmrg# _AM_AUTOCONF_VERSION(VERSION)
17604028d71eSmrg# -----------------------------
17614028d71eSmrg# aclocal traces this macro to find the Autoconf version.
17624028d71eSmrg# This is a private macro too.  Using m4_define simplifies
17634028d71eSmrg# the logic in aclocal, which can simply ignore this definition.
17644028d71eSmrgm4_define([_AM_AUTOCONF_VERSION], [])
176598049353Smrg
17664028d71eSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
17674028d71eSmrg# -------------------------------
17684028d71eSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
17694028d71eSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
17704028d71eSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
17714028d71eSmrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
17724028d71eSmrgm4_ifndef([AC_AUTOCONF_VERSION],
17734028d71eSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17744028d71eSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
177598049353Smrg
17764028d71eSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
17770ad07f78Smrg
17784028d71eSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
177998049353Smrg#
17804028d71eSmrg# This file is free software; the Free Software Foundation
17814028d71eSmrg# gives unlimited permission to copy and/or distribute it,
17824028d71eSmrg# with or without modifications, as long as this notice is preserved.
17834028d71eSmrg
17844028d71eSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
17854028d71eSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
17864028d71eSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
17870ad07f78Smrg#
17884028d71eSmrg# Of course, Automake must honor this variable whenever it calls a
17894028d71eSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
17904028d71eSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
17914028d71eSmrg# depending on how configure is run.  This is pretty annoying, since
17924028d71eSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
17934028d71eSmrg# source directory, any form will work fine, but in subdirectories a
17944028d71eSmrg# relative path needs to be adjusted first.
17950ad07f78Smrg#
17964028d71eSmrg# $ac_aux_dir/missing
17974028d71eSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
17984028d71eSmrg# $top_srcdir/$ac_aux_dir/missing
17994028d71eSmrg#    fails if $ac_aux_dir is absolute,
18004028d71eSmrg#    fails when called from a subdirectory in a VPATH build with
18014028d71eSmrg#          a relative $ac_aux_dir
18020ad07f78Smrg#
18034028d71eSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
18044028d71eSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
18054028d71eSmrg# harmless because $srcdir is `.', but things will broke when you
18064028d71eSmrg# start a VPATH build or use an absolute $srcdir.
18070ad07f78Smrg#
18084028d71eSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
18094028d71eSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
18104028d71eSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
18114028d71eSmrg# and then we would define $MISSING as
18124028d71eSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
18134028d71eSmrg# This will work as long as MISSING is not called from configure, because
18144028d71eSmrg# unfortunately $(top_srcdir) has no meaning in configure.
18154028d71eSmrg# However there are other variables, like CC, which are often used in
18164028d71eSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
18174028d71eSmrg#
18184028d71eSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
18194028d71eSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
18204028d71eSmrg# configured tree to be moved without reconfiguration.
18210ad07f78Smrg
18224028d71eSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
18234028d71eSmrg[dnl Rely on autoconf to set up CDPATH properly.
18244028d71eSmrgAC_PREREQ([2.50])dnl
18254028d71eSmrg# expand $ac_aux_dir to an absolute path
18264028d71eSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
18274028d71eSmrg])
18284028d71eSmrg
18294028d71eSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
18304028d71eSmrg
18314028d71eSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
18324028d71eSmrg# Free Software Foundation, Inc.
18334028d71eSmrg#
18344028d71eSmrg# This file is free software; the Free Software Foundation
18354028d71eSmrg# gives unlimited permission to copy and/or distribute it,
18364028d71eSmrg# with or without modifications, as long as this notice is preserved.
183798049353Smrg
18384028d71eSmrg# serial 9
18394028d71eSmrg
18404028d71eSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
18414028d71eSmrg# -------------------------------------
18424028d71eSmrg# Define a conditional.
18434028d71eSmrgAC_DEFUN([AM_CONDITIONAL],
18444028d71eSmrg[AC_PREREQ(2.52)dnl
18454028d71eSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
18464028d71eSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
18474028d71eSmrgAC_SUBST([$1_TRUE])dnl
18484028d71eSmrgAC_SUBST([$1_FALSE])dnl
18494028d71eSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
18504028d71eSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
18514028d71eSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
18524028d71eSmrgif $2; then
18534028d71eSmrg  $1_TRUE=
18544028d71eSmrg  $1_FALSE='#'
18550ad07f78Smrgelse
18564028d71eSmrg  $1_TRUE='#'
18574028d71eSmrg  $1_FALSE=
18580ad07f78Smrgfi
18594028d71eSmrgAC_CONFIG_COMMANDS_PRE(
18604028d71eSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
18614028d71eSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
18624028d71eSmrgUsually this means the macro was only invoked conditionally.]])
18634028d71eSmrgfi])])
186498049353Smrg
18654028d71eSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
18664028d71eSmrg# Free Software Foundation, Inc.
18670ad07f78Smrg#
18684028d71eSmrg# This file is free software; the Free Software Foundation
18694028d71eSmrg# gives unlimited permission to copy and/or distribute it,
18704028d71eSmrg# with or without modifications, as long as this notice is preserved.
187198049353Smrg
18724028d71eSmrg# serial 10
187398049353Smrg
18744028d71eSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
18754028d71eSmrg# written in clear, in which case automake, when reading aclocal.m4,
18764028d71eSmrg# will think it sees a *use*, and therefore will trigger all it's
18774028d71eSmrg# C support machinery.  Also note that it means that autoscan, seeing
18784028d71eSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
187998049353Smrg
188098049353Smrg
18814028d71eSmrg# _AM_DEPENDENCIES(NAME)
18824028d71eSmrg# ----------------------
18834028d71eSmrg# See how the compiler implements dependency checking.
18844028d71eSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
18854028d71eSmrg# We try a few techniques and use that to set a single cache variable.
18864028d71eSmrg#
18874028d71eSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
18884028d71eSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
18894028d71eSmrg# dependency, and given that the user is not expected to run this macro,
18904028d71eSmrg# just rely on AC_PROG_CC.
18914028d71eSmrgAC_DEFUN([_AM_DEPENDENCIES],
18924028d71eSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
18934028d71eSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
18944028d71eSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
18954028d71eSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
189698049353Smrg
18974028d71eSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
18984028d71eSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
18994028d71eSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
19004028d71eSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
19014028d71eSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
19024028d71eSmrg                   [depcc="$$1"   am_compiler_list=])
190398049353Smrg
19044028d71eSmrgAC_CACHE_CHECK([dependency style of $depcc],
19054028d71eSmrg               [am_cv_$1_dependencies_compiler_type],
19064028d71eSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
19074028d71eSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
19084028d71eSmrg  # making bogus files that we don't know about and never remove.  For
19094028d71eSmrg  # instance it was reported that on HP-UX the gcc test will end up
19104028d71eSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
19114028d71eSmrg  # in D'.
19124028d71eSmrg  mkdir conftest.dir
19134028d71eSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
19144028d71eSmrg  # using a relative directory.
19154028d71eSmrg  cp "$am_depcomp" conftest.dir
19164028d71eSmrg  cd conftest.dir
19174028d71eSmrg  # We will build objects and dependencies in a subdirectory because
19184028d71eSmrg  # it helps to detect inapplicable dependency modes.  For instance
19194028d71eSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
19204028d71eSmrg  # side effect of compilation, but ICC will put the dependencies in
19214028d71eSmrg  # the current directory while Tru64 will put them in the object
19224028d71eSmrg  # directory.
19234028d71eSmrg  mkdir sub
192498049353Smrg
19254028d71eSmrg  am_cv_$1_dependencies_compiler_type=none
19264028d71eSmrg  if test "$am_compiler_list" = ""; then
19274028d71eSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
19284028d71eSmrg  fi
19294028d71eSmrg  am__universal=false
19304028d71eSmrg  m4_case([$1], [CC],
19314028d71eSmrg    [case " $depcc " in #(
19324028d71eSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
19334028d71eSmrg     esac],
19344028d71eSmrg    [CXX],
19354028d71eSmrg    [case " $depcc " in #(
19364028d71eSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
19374028d71eSmrg     esac])
19384028d71eSmrg
19394028d71eSmrg  for depmode in $am_compiler_list; do
19404028d71eSmrg    # Setup a source with many dependencies, because some compilers
19414028d71eSmrg    # like to wrap large dependency lists on column 80 (with \), and
19424028d71eSmrg    # we should not choose a depcomp mode which is confused by this.
19434028d71eSmrg    #
19444028d71eSmrg    # We need to recreate these files for each test, as the compiler may
19454028d71eSmrg    # overwrite some of them when testing with obscure command lines.
19464028d71eSmrg    # This happens at least with the AIX C compiler.
19474028d71eSmrg    : > sub/conftest.c
19484028d71eSmrg    for i in 1 2 3 4 5 6; do
19494028d71eSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
19504028d71eSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
19514028d71eSmrg      # Solaris 8's {/usr,}/bin/sh.
19524028d71eSmrg      touch sub/conftst$i.h
19534028d71eSmrg    done
19544028d71eSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
19554028d71eSmrg
19564028d71eSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
19574028d71eSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
19584028d71eSmrg    # handle `-M -o', and we need to detect this.  Also, some Intel
19594028d71eSmrg    # versions had trouble with output in subdirs
19604028d71eSmrg    am__obj=sub/conftest.${OBJEXT-o}
19614028d71eSmrg    am__minus_obj="-o $am__obj"
19624028d71eSmrg    case $depmode in
19634028d71eSmrg    gcc)
19644028d71eSmrg      # This depmode causes a compiler race in universal mode.
19654028d71eSmrg      test "$am__universal" = false || continue
19664028d71eSmrg      ;;
19674028d71eSmrg    nosideeffect)
19684028d71eSmrg      # after this tag, mechanisms are not by side-effect, so they'll
19694028d71eSmrg      # only be used when explicitly requested
19704028d71eSmrg      if test "x$enable_dependency_tracking" = xyes; then
19714028d71eSmrg	continue
19724028d71eSmrg      else
19734028d71eSmrg	break
19744028d71eSmrg      fi
19754028d71eSmrg      ;;
19764028d71eSmrg    msvisualcpp | msvcmsys)
19774028d71eSmrg      # This compiler won't grok `-c -o', but also, the minuso test has
19784028d71eSmrg      # not run yet.  These depmodes are late enough in the game, and
19794028d71eSmrg      # so weak that their functioning should not be impacted.
19804028d71eSmrg      am__obj=conftest.${OBJEXT-o}
19814028d71eSmrg      am__minus_obj=
19824028d71eSmrg      ;;
19834028d71eSmrg    none) break ;;
19840ad07f78Smrg    esac
19854028d71eSmrg    if depmode=$depmode \
19864028d71eSmrg       source=sub/conftest.c object=$am__obj \
19874028d71eSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
19884028d71eSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
19894028d71eSmrg         >/dev/null 2>conftest.err &&
19904028d71eSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
19914028d71eSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
19924028d71eSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
19934028d71eSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
19944028d71eSmrg      # icc doesn't choke on unknown options, it will just issue warnings
19954028d71eSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
19964028d71eSmrg      # that says an option was ignored or not supported.
19974028d71eSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
19984028d71eSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
19994028d71eSmrg      # The diagnosis changed in icc 8.0:
20004028d71eSmrg      #   icc: Command line remark: option '-MP' not supported
20014028d71eSmrg      if (grep 'ignoring option' conftest.err ||
20024028d71eSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
20034028d71eSmrg        am_cv_$1_dependencies_compiler_type=$depmode
20044028d71eSmrg        break
20054028d71eSmrg      fi
20064028d71eSmrg    fi
20074028d71eSmrg  done
20084028d71eSmrg
20094028d71eSmrg  cd ..
20104028d71eSmrg  rm -rf conftest.dir
20114028d71eSmrgelse
20124028d71eSmrg  am_cv_$1_dependencies_compiler_type=none
20130ad07f78Smrgfi
20144028d71eSmrg])
20154028d71eSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
20164028d71eSmrgAM_CONDITIONAL([am__fastdep$1], [
20174028d71eSmrg  test "x$enable_dependency_tracking" != xno \
20184028d71eSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
20194028d71eSmrg])
20204028d71eSmrg
20214028d71eSmrg
20224028d71eSmrg# AM_SET_DEPDIR
20234028d71eSmrg# -------------
20244028d71eSmrg# Choose a directory name for dependency files.
20254028d71eSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
20264028d71eSmrgAC_DEFUN([AM_SET_DEPDIR],
20274028d71eSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
20284028d71eSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
20294028d71eSmrg])
20304028d71eSmrg
20314028d71eSmrg
20324028d71eSmrg# AM_DEP_TRACK
20334028d71eSmrg# ------------
20344028d71eSmrgAC_DEFUN([AM_DEP_TRACK],
20354028d71eSmrg[AC_ARG_ENABLE(dependency-tracking,
20364028d71eSmrg[  --disable-dependency-tracking  speeds up one-time build
20374028d71eSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
20384028d71eSmrgif test "x$enable_dependency_tracking" != xno; then
20394028d71eSmrg  am_depcomp="$ac_aux_dir/depcomp"
20404028d71eSmrg  AMDEPBACKSLASH='\'
20410ad07f78Smrgfi
20424028d71eSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
20434028d71eSmrgAC_SUBST([AMDEPBACKSLASH])dnl
20444028d71eSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
20454028d71eSmrg])
204698049353Smrg
20474028d71eSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
204898049353Smrg
20494028d71eSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
20504028d71eSmrg# Free Software Foundation, Inc.
20510ad07f78Smrg#
20524028d71eSmrg# This file is free software; the Free Software Foundation
20534028d71eSmrg# gives unlimited permission to copy and/or distribute it,
20544028d71eSmrg# with or without modifications, as long as this notice is preserved.
205598049353Smrg
20564028d71eSmrg#serial 5
205798049353Smrg
20584028d71eSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
20594028d71eSmrg# ------------------------------
20604028d71eSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
20614028d71eSmrg[{
20624028d71eSmrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
20634028d71eSmrg  # are listed without --file.  Let's play safe and only enable the eval
20644028d71eSmrg  # if we detect the quoting.
20654028d71eSmrg  case $CONFIG_FILES in
20664028d71eSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
20674028d71eSmrg  *)   set x $CONFIG_FILES ;;
20684028d71eSmrg  esac
20694028d71eSmrg  shift
20704028d71eSmrg  for mf
20714028d71eSmrg  do
20724028d71eSmrg    # Strip MF so we end up with the name of the file.
20734028d71eSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
20744028d71eSmrg    # Check whether this is an Automake generated Makefile or not.
20754028d71eSmrg    # We used to match only the files named `Makefile.in', but
20764028d71eSmrg    # some people rename them; so instead we look at the file content.
20774028d71eSmrg    # Grep'ing the first line is not enough: some people post-process
20784028d71eSmrg    # each Makefile.in and add a new line on top of each file to say so.
20794028d71eSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
20804028d71eSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
20814028d71eSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
20824028d71eSmrg      dirpart=`AS_DIRNAME("$mf")`
20834028d71eSmrg    else
20844028d71eSmrg      continue
20854028d71eSmrg    fi
20864028d71eSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
20874028d71eSmrg    # from the Makefile without running `make'.
20884028d71eSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
20894028d71eSmrg    test -z "$DEPDIR" && continue
20904028d71eSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
20914028d71eSmrg    test -z "am__include" && continue
20924028d71eSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
20934028d71eSmrg    # When using ansi2knr, U may be empty or an underscore; expand it
20944028d71eSmrg    U=`sed -n 's/^U = //p' < "$mf"`
20954028d71eSmrg    # Find all dependency output files, they are included files with
20964028d71eSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
20974028d71eSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
20984028d71eSmrg    # expansion.
20994028d71eSmrg    for file in `sed -n "
21004028d71eSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
21014028d71eSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
21024028d71eSmrg      # Make sure the directory exists.
21034028d71eSmrg      test -f "$dirpart/$file" && continue
21044028d71eSmrg      fdir=`AS_DIRNAME(["$file"])`
21054028d71eSmrg      AS_MKDIR_P([$dirpart/$fdir])
21064028d71eSmrg      # echo "creating $dirpart/$file"
21074028d71eSmrg      echo '# dummy' > "$dirpart/$file"
21084028d71eSmrg    done
21094028d71eSmrg  done
21104028d71eSmrg}
21114028d71eSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
211298049353Smrg
211398049353Smrg
21144028d71eSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
21154028d71eSmrg# -----------------------------
21164028d71eSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
21174028d71eSmrg#
21184028d71eSmrg# This code is only required when automatic dependency tracking
21194028d71eSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
21204028d71eSmrg# need in order to bootstrap the dependency handling code.
21214028d71eSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
21224028d71eSmrg[AC_CONFIG_COMMANDS([depfiles],
21234028d71eSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
21244028d71eSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
21254028d71eSmrg])
212698049353Smrg
21274028d71eSmrg# Do all the work for Automake.                             -*- Autoconf -*-
212898049353Smrg
21294028d71eSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
21304028d71eSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
21314028d71eSmrg#
21324028d71eSmrg# This file is free software; the Free Software Foundation
21334028d71eSmrg# gives unlimited permission to copy and/or distribute it,
21344028d71eSmrg# with or without modifications, as long as this notice is preserved.
21354028d71eSmrg
21364028d71eSmrg# serial 16
213798049353Smrg
21384028d71eSmrg# This macro actually does too much.  Some checks are only needed if
21394028d71eSmrg# your package does certain things.  But this isn't really a big deal.
214098049353Smrg
21414028d71eSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
21424028d71eSmrg# AM_INIT_AUTOMAKE([OPTIONS])
21434028d71eSmrg# -----------------------------------------------
21444028d71eSmrg# The call with PACKAGE and VERSION arguments is the old style
21454028d71eSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
21464028d71eSmrg# and VERSION should now be passed to AC_INIT and removed from
21474028d71eSmrg# the call to AM_INIT_AUTOMAKE.
21484028d71eSmrg# We support both call styles for the transition.  After
21494028d71eSmrg# the next Automake release, Autoconf can make the AC_INIT
21504028d71eSmrg# arguments mandatory, and then we can depend on a new Autoconf
21514028d71eSmrg# release and drop the old call support.
21524028d71eSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
21534028d71eSmrg[AC_PREREQ([2.62])dnl
21544028d71eSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
21554028d71eSmrgdnl the ones we care about.
21564028d71eSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
21574028d71eSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
21584028d71eSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
21594028d71eSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
21604028d71eSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
21614028d71eSmrg  # is not polluted with repeated "-I."
21624028d71eSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
21634028d71eSmrg  # test to see if srcdir already configured
21644028d71eSmrg  if test -f $srcdir/config.status; then
21654028d71eSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
21664028d71eSmrg  fi
21670ad07f78Smrgfi
216898049353Smrg
21694028d71eSmrg# test whether we have cygpath
21704028d71eSmrgif test -z "$CYGPATH_W"; then
21714028d71eSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
21724028d71eSmrg    CYGPATH_W='cygpath -w'
21734028d71eSmrg  else
21744028d71eSmrg    CYGPATH_W=echo
21754028d71eSmrg  fi
21764028d71eSmrgfi
21774028d71eSmrgAC_SUBST([CYGPATH_W])
217898049353Smrg
21794028d71eSmrg# Define the identity of the package.
21804028d71eSmrgdnl Distinguish between old-style and new-style calls.
21814028d71eSmrgm4_ifval([$2],
21824028d71eSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
21834028d71eSmrg AC_SUBST([PACKAGE], [$1])dnl
21844028d71eSmrg AC_SUBST([VERSION], [$2])],
21854028d71eSmrg[_AM_SET_OPTIONS([$1])dnl
21864028d71eSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
21874028d71eSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
21884028d71eSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
21894028d71eSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
21904028d71eSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
219198049353Smrg
21924028d71eSmrg_AM_IF_OPTION([no-define],,
21934028d71eSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
21944028d71eSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
219598049353Smrg
21964028d71eSmrg# Some tools Automake needs.
21974028d71eSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
21984028d71eSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
21994028d71eSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
22004028d71eSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
22014028d71eSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
22024028d71eSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
22034028d71eSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
22044028d71eSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
22054028d71eSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
22064028d71eSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
22074028d71eSmrg# We need awk for the "check" target.  The system "awk" is bad on
22084028d71eSmrg# some platforms.
22094028d71eSmrgAC_REQUIRE([AC_PROG_AWK])dnl
22104028d71eSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
22114028d71eSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
22124028d71eSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
22134028d71eSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
22144028d71eSmrg			     [_AM_PROG_TAR([v7])])])
22154028d71eSmrg_AM_IF_OPTION([no-dependencies],,
22164028d71eSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
22174028d71eSmrg		  [_AM_DEPENDENCIES(CC)],
22184028d71eSmrg		  [define([AC_PROG_CC],
22194028d71eSmrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
22204028d71eSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
22214028d71eSmrg		  [_AM_DEPENDENCIES(CXX)],
22224028d71eSmrg		  [define([AC_PROG_CXX],
22234028d71eSmrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
22244028d71eSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
22254028d71eSmrg		  [_AM_DEPENDENCIES(OBJC)],
22264028d71eSmrg		  [define([AC_PROG_OBJC],
22274028d71eSmrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
22284028d71eSmrg])
22294028d71eSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
22304028d71eSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
22314028d71eSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
22324028d71eSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
22334028d71eSmrgAC_CONFIG_COMMANDS_PRE(dnl
22344028d71eSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
22354028d71eSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
22364028d71eSmrg])
22370ad07f78Smrg
22384028d71eSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
22394028d71eSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
22404028d71eSmrgdnl mangled by Autoconf and run in a shell conditional statement.
22414028d71eSmrgm4_define([_AC_COMPILER_EXEEXT],
22424028d71eSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
22434028d71eSmrg
22444028d71eSmrg
22454028d71eSmrg# When config.status generates a header, we must update the stamp-h file.
22464028d71eSmrg# This file resides in the same directory as the config header
22474028d71eSmrg# that is generated.  The stamp files are numbered to have different names.
22484028d71eSmrg
22494028d71eSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
22504028d71eSmrg# loop where config.status creates the headers, so we can generate
22514028d71eSmrg# our stamp files there.
22524028d71eSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
22534028d71eSmrg[# Compute $1's index in $config_headers.
22544028d71eSmrg_am_arg=$1
22554028d71eSmrg_am_stamp_count=1
22564028d71eSmrgfor _am_header in $config_headers :; do
22574028d71eSmrg  case $_am_header in
22584028d71eSmrg    $_am_arg | $_am_arg:* )
22594028d71eSmrg      break ;;
22604028d71eSmrg    * )
22614028d71eSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
22624028d71eSmrg  esac
22634028d71eSmrgdone
22644028d71eSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
22654028d71eSmrg
22664028d71eSmrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
22670ad07f78Smrg#
22684028d71eSmrg# This file is free software; the Free Software Foundation
22694028d71eSmrg# gives unlimited permission to copy and/or distribute it,
22704028d71eSmrg# with or without modifications, as long as this notice is preserved.
22714028d71eSmrg
22724028d71eSmrg# AM_PROG_INSTALL_SH
22734028d71eSmrg# ------------------
22744028d71eSmrg# Define $install_sh.
22754028d71eSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
22764028d71eSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
22774028d71eSmrgif test x"${install_sh}" != xset; then
22784028d71eSmrg  case $am_aux_dir in
22794028d71eSmrg  *\ * | *\	*)
22804028d71eSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
22814028d71eSmrg  *)
22824028d71eSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
22834028d71eSmrg  esac
22840ad07f78Smrgfi
22854028d71eSmrgAC_SUBST(install_sh)])
22860ad07f78Smrg
22874028d71eSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
22884028d71eSmrg#
22894028d71eSmrg# This file is free software; the Free Software Foundation
22904028d71eSmrg# gives unlimited permission to copy and/or distribute it,
22914028d71eSmrg# with or without modifications, as long as this notice is preserved.
22920ad07f78Smrg
22934028d71eSmrg# serial 2
22940ad07f78Smrg
22954028d71eSmrg# Check whether the underlying file-system supports filenames
22964028d71eSmrg# with a leading dot.  For instance MS-DOS doesn't.
22974028d71eSmrgAC_DEFUN([AM_SET_LEADING_DOT],
22984028d71eSmrg[rm -rf .tst 2>/dev/null
22994028d71eSmrgmkdir .tst 2>/dev/null
23004028d71eSmrgif test -d .tst; then
23014028d71eSmrg  am__leading_dot=.
23024028d71eSmrgelse
23034028d71eSmrg  am__leading_dot=_
23040ad07f78Smrgfi
23054028d71eSmrgrmdir .tst 2>/dev/null
23064028d71eSmrgAC_SUBST([am__leading_dot])])
23070ad07f78Smrg
23084028d71eSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
23094028d71eSmrg# From Jim Meyering
23100ad07f78Smrg
23114028d71eSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
23124028d71eSmrg# Free Software Foundation, Inc.
23134028d71eSmrg#
23144028d71eSmrg# This file is free software; the Free Software Foundation
23154028d71eSmrg# gives unlimited permission to copy and/or distribute it,
23164028d71eSmrg# with or without modifications, as long as this notice is preserved.
23170ad07f78Smrg
23184028d71eSmrg# serial 5
23190ad07f78Smrg
23204028d71eSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
23214028d71eSmrg# ----------------------------------
23224028d71eSmrg# Control maintainer-specific portions of Makefiles.
23234028d71eSmrg# Default is to disable them, unless `enable' is passed literally.
23244028d71eSmrg# For symmetry, `disable' may be passed as well.  Anyway, the user
23254028d71eSmrg# can override the default with the --enable/--disable switch.
23264028d71eSmrgAC_DEFUN([AM_MAINTAINER_MODE],
23274028d71eSmrg[m4_case(m4_default([$1], [disable]),
23284028d71eSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
23294028d71eSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
23304028d71eSmrg       [m4_define([am_maintainer_other], [enable])
23314028d71eSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
23324028d71eSmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
23334028d71eSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
23344028d71eSmrg  AC_ARG_ENABLE([maintainer-mode],
23354028d71eSmrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
23364028d71eSmrg			  (and sometimes confusing) to the casual installer],
23374028d71eSmrg      [USE_MAINTAINER_MODE=$enableval],
23384028d71eSmrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
23394028d71eSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
23404028d71eSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
23414028d71eSmrg  MAINT=$MAINTAINER_MODE_TRUE
23424028d71eSmrg  AC_SUBST([MAINT])dnl
23434028d71eSmrg]
23444028d71eSmrg)
23450ad07f78Smrg
23464028d71eSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
23470ad07f78Smrg
23484028d71eSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
23494028d71eSmrg
23504028d71eSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
23510ad07f78Smrg#
23524028d71eSmrg# This file is free software; the Free Software Foundation
23534028d71eSmrg# gives unlimited permission to copy and/or distribute it,
23544028d71eSmrg# with or without modifications, as long as this notice is preserved.
23550ad07f78Smrg
23564028d71eSmrg# serial 4
23570ad07f78Smrg
23584028d71eSmrg# AM_MAKE_INCLUDE()
23594028d71eSmrg# -----------------
23604028d71eSmrg# Check to see how make treats includes.
23614028d71eSmrgAC_DEFUN([AM_MAKE_INCLUDE],
23624028d71eSmrg[am_make=${MAKE-make}
23634028d71eSmrgcat > confinc << 'END'
23644028d71eSmrgam__doit:
23654028d71eSmrg	@echo this is the am__doit target
23664028d71eSmrg.PHONY: am__doit
23674028d71eSmrgEND
23684028d71eSmrg# If we don't find an include directive, just comment out the code.
23694028d71eSmrgAC_MSG_CHECKING([for style of include used by $am_make])
23704028d71eSmrgam__include="#"
23714028d71eSmrgam__quote=
23724028d71eSmrg_am_result=none
23734028d71eSmrg# First try GNU make style include.
23744028d71eSmrgecho "include confinc" > confmf
23754028d71eSmrg# Ignore all kinds of additional output from `make'.
23764028d71eSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
23774028d71eSmrg*the\ am__doit\ target*)
23784028d71eSmrg  am__include=include
23794028d71eSmrg  am__quote=
23804028d71eSmrg  _am_result=GNU
23814028d71eSmrg  ;;
23824028d71eSmrgesac
23834028d71eSmrg# Now try BSD make style include.
23844028d71eSmrgif test "$am__include" = "#"; then
23854028d71eSmrg   echo '.include "confinc"' > confmf
23864028d71eSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
23874028d71eSmrg   *the\ am__doit\ target*)
23884028d71eSmrg     am__include=.include
23894028d71eSmrg     am__quote="\""
23904028d71eSmrg     _am_result=BSD
23914028d71eSmrg     ;;
23924028d71eSmrg   esac
23930ad07f78Smrgfi
23944028d71eSmrgAC_SUBST([am__include])
23954028d71eSmrgAC_SUBST([am__quote])
23964028d71eSmrgAC_MSG_RESULT([$_am_result])
23974028d71eSmrgrm -f confinc confmf
23984028d71eSmrg])
23990ad07f78Smrg
24004028d71eSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
240198049353Smrg
24024028d71eSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
24034028d71eSmrg# Free Software Foundation, Inc.
24040ad07f78Smrg#
24054028d71eSmrg# This file is free software; the Free Software Foundation
24064028d71eSmrg# gives unlimited permission to copy and/or distribute it,
24074028d71eSmrg# with or without modifications, as long as this notice is preserved.
24080ad07f78Smrg
24094028d71eSmrg# serial 6
24100ad07f78Smrg
24114028d71eSmrg# AM_MISSING_PROG(NAME, PROGRAM)
24124028d71eSmrg# ------------------------------
24134028d71eSmrgAC_DEFUN([AM_MISSING_PROG],
24144028d71eSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
24154028d71eSmrg$1=${$1-"${am_missing_run}$2"}
24164028d71eSmrgAC_SUBST($1)])
24170ad07f78Smrg
24180ad07f78Smrg
24194028d71eSmrg# AM_MISSING_HAS_RUN
24204028d71eSmrg# ------------------
24214028d71eSmrg# Define MISSING if not defined so far and test if it supports --run.
24224028d71eSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
24234028d71eSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
24244028d71eSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
24254028d71eSmrgAC_REQUIRE_AUX_FILE([missing])dnl
24264028d71eSmrgif test x"${MISSING+set}" != xset; then
24274028d71eSmrg  case $am_aux_dir in
24284028d71eSmrg  *\ * | *\	*)
24294028d71eSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
24304028d71eSmrg  *)
24314028d71eSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
24324028d71eSmrg  esac
24330ad07f78Smrgfi
24344028d71eSmrg# Use eval to expand $SHELL
24354028d71eSmrgif eval "$MISSING --run true"; then
24364028d71eSmrg  am_missing_run="$MISSING --run "
24374028d71eSmrgelse
24384028d71eSmrg  am_missing_run=
24394028d71eSmrg  AC_MSG_WARN([`missing' script is too old or missing])
24404028d71eSmrgfi
24414028d71eSmrg])
24420ad07f78Smrg
24434028d71eSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
24444028d71eSmrg#
24454028d71eSmrg# This file is free software; the Free Software Foundation
24464028d71eSmrg# gives unlimited permission to copy and/or distribute it,
24474028d71eSmrg# with or without modifications, as long as this notice is preserved.
24480ad07f78Smrg
24494028d71eSmrg# AM_PROG_MKDIR_P
24500ad07f78Smrg# ---------------
24514028d71eSmrg# Check for `mkdir -p'.
24524028d71eSmrgAC_DEFUN([AM_PROG_MKDIR_P],
24534028d71eSmrg[AC_PREREQ([2.60])dnl
24544028d71eSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
24554028d71eSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
24564028d71eSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
24574028d71eSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
24584028d71eSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
24594028d71eSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
24604028d71eSmrgdnl adjustment using top_builddir (which is defined more often than
24614028d71eSmrgdnl MKDIR_P).
24624028d71eSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
24634028d71eSmrgcase $mkdir_p in
24644028d71eSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
24654028d71eSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
24664028d71eSmrgesac
24674028d71eSmrg])
24684028d71eSmrg
24694028d71eSmrg# Helper functions for option handling.                     -*- Autoconf -*-
24704028d71eSmrg
24714028d71eSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
24720ad07f78Smrg#
24734028d71eSmrg# This file is free software; the Free Software Foundation
24744028d71eSmrg# gives unlimited permission to copy and/or distribute it,
24754028d71eSmrg# with or without modifications, as long as this notice is preserved.
24760ad07f78Smrg
24774028d71eSmrg# serial 4
24784028d71eSmrg
24794028d71eSmrg# _AM_MANGLE_OPTION(NAME)
24800ad07f78Smrg# -----------------------
24814028d71eSmrgAC_DEFUN([_AM_MANGLE_OPTION],
24824028d71eSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
24830ad07f78Smrg
24844028d71eSmrg# _AM_SET_OPTION(NAME)
24854028d71eSmrg# ------------------------------
24864028d71eSmrg# Set option NAME.  Presently that only means defining a flag for this option.
24874028d71eSmrgAC_DEFUN([_AM_SET_OPTION],
24884028d71eSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
24890ad07f78Smrg
24904028d71eSmrg# _AM_SET_OPTIONS(OPTIONS)
24914028d71eSmrg# ----------------------------------
24924028d71eSmrg# OPTIONS is a space-separated list of Automake options.
24934028d71eSmrgAC_DEFUN([_AM_SET_OPTIONS],
24944028d71eSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
249598049353Smrg
24964028d71eSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
24974028d71eSmrg# -------------------------------------------
24984028d71eSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
24994028d71eSmrgAC_DEFUN([_AM_IF_OPTION],
25004028d71eSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
250198049353Smrg
25024028d71eSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
25030ad07f78Smrg
25044028d71eSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
25054028d71eSmrg# Free Software Foundation, Inc.
25060ad07f78Smrg#
25074028d71eSmrg# This file is free software; the Free Software Foundation
25084028d71eSmrg# gives unlimited permission to copy and/or distribute it,
25094028d71eSmrg# with or without modifications, as long as this notice is preserved.
25100ad07f78Smrg
25114028d71eSmrg# serial 5
25124028d71eSmrg
25134028d71eSmrg# AM_SANITY_CHECK
25144028d71eSmrg# ---------------
25154028d71eSmrgAC_DEFUN([AM_SANITY_CHECK],
25164028d71eSmrg[AC_MSG_CHECKING([whether build environment is sane])
25174028d71eSmrg# Just in case
25184028d71eSmrgsleep 1
25194028d71eSmrgecho timestamp > conftest.file
25204028d71eSmrg# Reject unsafe characters in $srcdir or the absolute working directory
25214028d71eSmrg# name.  Accept space and tab only in the latter.
25224028d71eSmrgam_lf='
25234028d71eSmrg'
25244028d71eSmrgcase `pwd` in
25254028d71eSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
25264028d71eSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
25274028d71eSmrgesac
25284028d71eSmrgcase $srcdir in
25294028d71eSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
25304028d71eSmrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
25314028d71eSmrgesac
25324028d71eSmrg
25334028d71eSmrg# Do `set' in a subshell so we don't clobber the current shell's
25344028d71eSmrg# arguments.  Must try -L first in case configure is actually a
25354028d71eSmrg# symlink; some systems play weird games with the mod time of symlinks
25364028d71eSmrg# (eg FreeBSD returns the mod time of the symlink's containing
25374028d71eSmrg# directory).
25384028d71eSmrgif (
25394028d71eSmrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
25404028d71eSmrg   if test "$[*]" = "X"; then
25414028d71eSmrg      # -L didn't work.
25424028d71eSmrg      set X `ls -t "$srcdir/configure" conftest.file`
25434028d71eSmrg   fi
25444028d71eSmrg   rm -f conftest.file
25454028d71eSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
25464028d71eSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
25474028d71eSmrg
25484028d71eSmrg      # If neither matched, then we have a broken ls.  This can happen
25494028d71eSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
25504028d71eSmrg      # broken ls alias from the environment.  This has actually
25514028d71eSmrg      # happened.  Such a system could not be considered "sane".
25524028d71eSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
25534028d71eSmrgalias in your environment])
25544028d71eSmrg   fi
25554028d71eSmrg
25564028d71eSmrg   test "$[2]" = conftest.file
25574028d71eSmrg   )
25584028d71eSmrgthen
25594028d71eSmrg   # Ok.
25604028d71eSmrg   :
25614028d71eSmrgelse
25624028d71eSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
25634028d71eSmrgCheck your system clock])
25640ad07f78Smrgfi
25654028d71eSmrgAC_MSG_RESULT(yes)])
25660ad07f78Smrg
25674028d71eSmrg# Copyright (C) 2009  Free Software Foundation, Inc.
25680ad07f78Smrg#
25694028d71eSmrg# This file is free software; the Free Software Foundation
25704028d71eSmrg# gives unlimited permission to copy and/or distribute it,
25714028d71eSmrg# with or without modifications, as long as this notice is preserved.
25720ad07f78Smrg
25734028d71eSmrg# serial 1
25740ad07f78Smrg
25754028d71eSmrg# AM_SILENT_RULES([DEFAULT])
25764028d71eSmrg# --------------------------
25774028d71eSmrg# Enable less verbose build rules; with the default set to DEFAULT
25784028d71eSmrg# (`yes' being less verbose, `no' or empty being verbose).
25794028d71eSmrgAC_DEFUN([AM_SILENT_RULES],
25804028d71eSmrg[AC_ARG_ENABLE([silent-rules],
25814028d71eSmrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
25824028d71eSmrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
25834028d71eSmrgcase $enable_silent_rules in
25844028d71eSmrgyes) AM_DEFAULT_VERBOSITY=0;;
25854028d71eSmrgno)  AM_DEFAULT_VERBOSITY=1;;
25864028d71eSmrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
25874028d71eSmrgesac
25884028d71eSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
25894028d71eSmrgAM_BACKSLASH='\'
25904028d71eSmrgAC_SUBST([AM_BACKSLASH])dnl
25914028d71eSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
25924028d71eSmrg])
25930ad07f78Smrg
25944028d71eSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
25954028d71eSmrg#
25964028d71eSmrg# This file is free software; the Free Software Foundation
25974028d71eSmrg# gives unlimited permission to copy and/or distribute it,
25984028d71eSmrg# with or without modifications, as long as this notice is preserved.
25990ad07f78Smrg
26004028d71eSmrg# AM_PROG_INSTALL_STRIP
26014028d71eSmrg# ---------------------
26024028d71eSmrg# One issue with vendor `install' (even GNU) is that you can't
26034028d71eSmrg# specify the program used to strip binaries.  This is especially
26044028d71eSmrg# annoying in cross-compiling environments, where the build's strip
26054028d71eSmrg# is unlikely to handle the host's binaries.
26064028d71eSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
26074028d71eSmrg# always use install-sh in `make install-strip', and initialize
26084028d71eSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
26094028d71eSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
26104028d71eSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
26114028d71eSmrg# Installed binaries are usually stripped using `strip' when the user
26124028d71eSmrg# run `make install-strip'.  However `strip' might not be the right
26134028d71eSmrg# tool to use in cross-compilation environments, therefore Automake
26144028d71eSmrg# will honor the `STRIP' environment variable to overrule this program.
26154028d71eSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
26164028d71eSmrgif test "$cross_compiling" != no; then
26174028d71eSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
26184028d71eSmrgfi
26194028d71eSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
26204028d71eSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
26210ad07f78Smrg
26224028d71eSmrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
26230ad07f78Smrg#
26244028d71eSmrg# This file is free software; the Free Software Foundation
26254028d71eSmrg# gives unlimited permission to copy and/or distribute it,
26264028d71eSmrg# with or without modifications, as long as this notice is preserved.
26270ad07f78Smrg
26284028d71eSmrg# serial 2
26290ad07f78Smrg
26304028d71eSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
26314028d71eSmrg# ---------------------------
26324028d71eSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
26334028d71eSmrg# This macro is traced by Automake.
26344028d71eSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
26350ad07f78Smrg
26364028d71eSmrg# AM_SUBST_NOTMAKE(VARIABLE)
26374028d71eSmrg# ---------------------------
26384028d71eSmrg# Public sister of _AM_SUBST_NOTMAKE.
26394028d71eSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
26400ad07f78Smrg
26414028d71eSmrg# Check how to create a tarball.                            -*- Autoconf -*-
26420ad07f78Smrg
26434028d71eSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
26444028d71eSmrg#
26454028d71eSmrg# This file is free software; the Free Software Foundation
26464028d71eSmrg# gives unlimited permission to copy and/or distribute it,
26474028d71eSmrg# with or without modifications, as long as this notice is preserved.
26480ad07f78Smrg
26494028d71eSmrg# serial 2
26500ad07f78Smrg
26514028d71eSmrg# _AM_PROG_TAR(FORMAT)
26524028d71eSmrg# --------------------
26534028d71eSmrg# Check how to create a tarball in format FORMAT.
26544028d71eSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
26554028d71eSmrg#
26564028d71eSmrg# Substitute a variable $(am__tar) that is a command
26574028d71eSmrg# writing to stdout a FORMAT-tarball containing the directory
26584028d71eSmrg# $tardir.
26594028d71eSmrg#     tardir=directory && $(am__tar) > result.tar
26604028d71eSmrg#
26614028d71eSmrg# Substitute a variable $(am__untar) that extract such
26624028d71eSmrg# a tarball read from stdin.
26634028d71eSmrg#     $(am__untar) < result.tar
26644028d71eSmrgAC_DEFUN([_AM_PROG_TAR],
26654028d71eSmrg[# Always define AMTAR for backward compatibility.
26664028d71eSmrgAM_MISSING_PROG([AMTAR], [tar])
26674028d71eSmrgm4_if([$1], [v7],
26684028d71eSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
26694028d71eSmrg     [m4_case([$1], [ustar],, [pax],,
26704028d71eSmrg              [m4_fatal([Unknown tar format])])
26714028d71eSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
26724028d71eSmrg# Loop over all known methods to create a tar archive until one works.
26734028d71eSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
26744028d71eSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
26754028d71eSmrg# Do not fold the above two line into one, because Tru64 sh and
26764028d71eSmrg# Solaris sh will not grok spaces in the rhs of `-'.
26774028d71eSmrgfor _am_tool in $_am_tools
26784028d71eSmrgdo
26794028d71eSmrg  case $_am_tool in
26804028d71eSmrg  gnutar)
26814028d71eSmrg    for _am_tar in tar gnutar gtar;
26824028d71eSmrg    do
26834028d71eSmrg      AM_RUN_LOG([$_am_tar --version]) && break
26844028d71eSmrg    done
26854028d71eSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
26864028d71eSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
26874028d71eSmrg    am__untar="$_am_tar -xf -"
26884028d71eSmrg    ;;
26894028d71eSmrg  plaintar)
26904028d71eSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
26914028d71eSmrg    # ustar tarball either.
26924028d71eSmrg    (tar --version) >/dev/null 2>&1 && continue
26934028d71eSmrg    am__tar='tar chf - "$$tardir"'
26944028d71eSmrg    am__tar_='tar chf - "$tardir"'
26954028d71eSmrg    am__untar='tar xf -'
26964028d71eSmrg    ;;
26974028d71eSmrg  pax)
26984028d71eSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
26994028d71eSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
27004028d71eSmrg    am__untar='pax -r'
27014028d71eSmrg    ;;
27024028d71eSmrg  cpio)
27034028d71eSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
27044028d71eSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
27054028d71eSmrg    am__untar='cpio -i -H $1 -d'
27064028d71eSmrg    ;;
27074028d71eSmrg  none)
27084028d71eSmrg    am__tar=false
27094028d71eSmrg    am__tar_=false
27104028d71eSmrg    am__untar=false
27114028d71eSmrg    ;;
27124028d71eSmrg  esac
27130ad07f78Smrg
27144028d71eSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
27154028d71eSmrg  # and am__untar set.
27164028d71eSmrg  test -n "${am_cv_prog_tar_$1}" && break
27170ad07f78Smrg
27184028d71eSmrg  # tar/untar a dummy directory, and stop if the command works
27194028d71eSmrg  rm -rf conftest.dir
27204028d71eSmrg  mkdir conftest.dir
27214028d71eSmrg  echo GrepMe > conftest.dir/file
27224028d71eSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
27234028d71eSmrg  rm -rf conftest.dir
27244028d71eSmrg  if test -s conftest.tar; then
27254028d71eSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
27264028d71eSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
27274028d71eSmrg  fi
27284028d71eSmrgdone
27294028d71eSmrgrm -rf conftest.dir
27300ad07f78Smrg
27314028d71eSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
27324028d71eSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
27334028d71eSmrgAC_SUBST([am__tar])
27344028d71eSmrgAC_SUBST([am__untar])
27354028d71eSmrg]) # _AM_PROG_TAR
27360ad07f78Smrg
2737