aclocal.m4 revision 7973f115
17973f115Smrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
2ed029a5fSmrg
3dd519f38Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4dd519f38Smrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5ed029a5fSmrg# This file is free software; the Free Software Foundation
6ed029a5fSmrg# gives unlimited permission to copy and/or distribute it,
7ed029a5fSmrg# with or without modifications, as long as this notice is preserved.
8ed029a5fSmrg
9ed029a5fSmrg# This program is distributed in the hope that it will be useful,
10ed029a5fSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11ed029a5fSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12ed029a5fSmrg# PARTICULAR PURPOSE.
13ed029a5fSmrg
14dd519f38Smrgm4_ifndef([AC_AUTOCONF_VERSION],
15dd519f38Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
167973f115Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
177973f115Smrg[m4_warning([this file was generated for autoconf 2.68.
18dd519f38SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19dd519f38SmrgIf you have problems, you may need to regenerate the build system entirely.
20dd519f38SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21ed029a5fSmrg
227973f115Smrgdnl fontutil.m4.  Generated from fontutil.m4.in by configure.
237973f115Smrgdnl
247973f115Smrgdnl This file comes from X.Org's font-util 1.2.0
257973f115Smrgdnl
267973f115Smrgdnl Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
277973f115Smrgdnl
287973f115Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
297973f115Smrgdnl copy of this software and associated documentation files (the "Software"),
307973f115Smrgdnl to deal in the Software without restriction, including without limitation
317973f115Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
327973f115Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
337973f115Smrgdnl Software is furnished to do so, subject to the following conditions:
347973f115Smrgdnl
357973f115Smrgdnl The above copyright notice and this permission notice (including the next
367973f115Smrgdnl paragraph) shall be included in all copies or substantial portions of the
377973f115Smrgdnl Software.
387973f115Smrgdnl
397973f115Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
407973f115Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
417973f115Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
427973f115Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
437973f115Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
447973f115Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
457973f115Smrgdnl DEALINGS IN THE SOFTWARE.
467973f115Smrgdnl
477973f115Smrgdnl --------------------------------------------------------------------
487973f115Smrgdnl
497973f115Smrgdnl Copyright 2005 Red Hat, Inc
507973f115Smrgdnl
517973f115Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
527973f115Smrgdnl documentation for any purpose is hereby granted without fee, provided that
537973f115Smrgdnl the above copyright notice appear in all copies and that both that
547973f115Smrgdnl copyright notice and this permission notice appear in supporting
557973f115Smrgdnl documentation.
567973f115Smrgdnl
577973f115Smrgdnl The above copyright notice and this permission notice shall be included
587973f115Smrgdnl in all copies or substantial portions of the Software.
597973f115Smrgdnl
607973f115Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
617973f115Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
627973f115Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
637973f115Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
647973f115Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
657973f115Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
667973f115Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
677973f115Smrgdnl
687973f115Smrgdnl Except as contained in this notice, the name of the copyright holders shall
697973f115Smrgdnl not be used in advertising or otherwise to promote the sale, use or
707973f115Smrgdnl other dealings in this Software without prior written authorization
717973f115Smrgdnl from the copyright holders.
727973f115Smrg
737973f115Smrg# XORG_FONT_MACROS_VERSION(required-version)
747973f115Smrg# ------------------------------------------
757973f115Smrg# Minimum version: 1.1.0
76dd519f38Smrg#
777973f115Smrg# If you're using a macro added in Version 1.1 or newer, include this in
787973f115Smrg# your configure.ac with the minimum required version, such as:
797973f115Smrg# XORG_FONT_MACROS_VERSION(1.1)
807973f115Smrg#
817973f115Smrg# To ensure that this macro is defined, also add:
827973f115Smrg# m4_ifndef([XORG_FONT_MACROS_VERSION],
837973f115Smrg#     [m4_fatal([must install X.Org font-util 1.1 or later before running autoconf/autogen])])
847973f115Smrg#
857973f115Smrg#
867973f115Smrg# See the "minimum version" comment for each macro you use to see what
877973f115Smrg# version you require.
887973f115Smrgm4_defun([XORG_FONT_MACROS_VERSION],[
897973f115Smrgm4_define([vers_have], [1.2.0])
907973f115Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
917973f115Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
927973f115Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
937973f115Smrg    [m4_fatal([font-util major version ]maj_needed[ is required but ]vers_have[ found])])
947973f115Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
957973f115Smrg    [m4_fatal([font-util version $1 or higher is required but ]vers_have[ found])])
967973f115Smrgm4_undefine([vers_have])
977973f115Smrgm4_undefine([maj_have])
987973f115Smrgm4_undefine([maj_needed])
997973f115Smrg]) # XORG_FONT_MACROS_VERSION
100ed029a5fSmrg
1017973f115Smrg# XORG_FONT_CHECK_{maps}()
1027973f115Smrg# ------------------------
1037973f115Smrg# Minimum version: 1.0.0
1047973f115Smrg# These macros add --enable/disable-{maps} where {maps} are ISO8859-*,
1057973f115Smrg# JISX0201 or KOI8_R.  By default, they are all enabled.
106dd519f38Smrg
1077973f115SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_1], [XORG_FONT_CHECK_ENCODING(ISO8859-1)])
1087973f115SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_2], [XORG_FONT_CHECK_ENCODING(ISO8859-2)])
1097973f115SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_3], [XORG_FONT_CHECK_ENCODING(ISO8859-3)])
1107973f115SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_4], [XORG_FONT_CHECK_ENCODING(ISO8859-4)])
1117973f115SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_5], [XORG_FONT_CHECK_ENCODING(ISO8859-5)])
1127973f115SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_6], [XORG_FONT_CHECK_ENCODING(ISO8859-6)])
1137973f115SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_7], [XORG_FONT_CHECK_ENCODING(ISO8859-7)])
1147973f115SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_8], [XORG_FONT_CHECK_ENCODING(ISO8859-8)])
1157973f115SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_9], [XORG_FONT_CHECK_ENCODING(ISO8859-9)])
1167973f115SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_10],[XORG_FONT_CHECK_ENCODING(ISO8859-10)])
1177973f115SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_11],[XORG_FONT_CHECK_ENCODING(ISO8859-11)])
1187973f115SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_12],[XORG_FONT_CHECK_ENCODING(ISO8859-12)])
1197973f115SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_13],[XORG_FONT_CHECK_ENCODING(ISO8859-13)])
1207973f115SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_14],[XORG_FONT_CHECK_ENCODING(ISO8859-14)])
1217973f115SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_15],[XORG_FONT_CHECK_ENCODING(ISO8859-15)])
1227973f115SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_16],[XORG_FONT_CHECK_ENCODING(ISO8859-16)])
1237973f115SmrgAC_DEFUN([XORG_FONT_CHECK_JISX0201],  [XORG_FONT_CHECK_ENCODING(JISX0201)])
1247973f115SmrgAC_DEFUN([XORG_FONT_CHECK_KOI8_R],    [XORG_FONT_CHECK_ENCODING(KOI8-R)])
125ed029a5fSmrg
1267973f115Smrg# XORG_FONT_CHECK_ENCODING(encoding)
1277973f115Smrg# ----------------------------------
1287973f115Smrg# Minimum version: 1.1.0
1297973f115Smrg# This macro adds --enable/disable-<encoding>, enabled by default.
1307973f115Smrg# It replaced individual copies of this code in the above macros in 1.1.
1317973f115Smrg# Currently assumes encoding names will be all upper-case - add m4_toupper
1327973f115Smrg# calls if this is not true in the future.
133ed029a5fSmrg
1347973f115SmrgAC_DEFUN([XORG_FONT_CHECK_ENCODING],[
1357973f115Smrg	AC_ARG_ENABLE(m4_tolower($1),
1367973f115Smrg		AS_HELP_STRING(m4_join([-], [--disable], m4_tolower($1)),
1377973f115Smrg				[Build $1 fonts (default: yes)]),
1387973f115Smrg		[AS_TR_SH($1)=$enableval])
1397973f115Smrg	AC_MSG_CHECKING([whether to build $1 fonts])
1407973f115Smrg	AC_MSG_RESULT($[AS_TR_SH($1)])
1417973f115Smrg	AM_CONDITIONAL(AS_TR_SH($1), [test "x$AS_TR_SH($1)" = xyes])
1427973f115Smrg]) # XORG_FONT_CHECK_ENCODING
143ed029a5fSmrg
1447973f115Smrg# XORG_FONT_CHECK_ENCODING_LIST(encoding1 encoding2....)
1457973f115Smrg# -----------------------------------------------------
1467973f115Smrg# Minimum version: 1.1.0
1477973f115Smrg# Call XORG_FONT_CHECK_ENCODING for multiple encodings at once.
1487973f115Smrg# Add a shorthand --enable/disable-all-encodings option.
149ed029a5fSmrg
1507973f115SmrgAC_DEFUN([XORG_FONT_CHECK_ENCODING_LIST],[
1517973f115Smrg	AC_ARG_ENABLE([all-encodings],
1527973f115Smrg		AS_HELP_STRING([--disable-all-encodings],
1537973f115Smrg				[Disable building of all font encodings]),
1547973f115Smrg		[m4_foreach_w([enc], [$1], [
1557973f115Smrg			AS_TR_SH(enc)=$enableval
1567973f115Smrg		])],
1577973f115Smrg		[m4_foreach_w([enc], [$1], [
1587973f115Smrg			AS_TR_SH(enc)=yes
1597973f115Smrg		])])
1607973f115Smrg	m4_foreach_w([enc], [$1], [XORG_FONT_CHECK_ENCODING(enc)])
1617973f115Smrg]) # XORG_FONT_CHECK_ENCODING_LIST
1627973f115Smrg
1637973f115Smrg# XORG_FONT_REQUIRED_PROG(VARNAME, progname)
1647973f115Smrg# ------------------------------------------
1657973f115Smrg# Minimum version: 1.1.0
166ed029a5fSmrg#
1677973f115Smrg# Simple wrapper around AC_PATH_PROG that errors if not found
168ed029a5fSmrg#
169ed029a5fSmrg
1707973f115SmrgAC_DEFUN([XORG_FONT_REQUIRED_PROG],[
1717973f115Smrg	AC_PATH_PROG($1, $2)
1727973f115Smrg	if test x"$$1" = x; then
1737973f115Smrg		AC_MSG_ERROR([$2 is required to build $PACKAGE_NAME.])
1747973f115Smrg	fi
175ed029a5fSmrg])
176ed029a5fSmrg
177ed029a5fSmrg
1787973f115Smrg# XORG_FONT_FCCACHE()
1797973f115Smrg# -------------------
1807973f115Smrg# Minimum version: 1.1.0
181dd519f38Smrg#
1827973f115Smrg# Set FCCACHE to path to fc-cache (fontconfig cache builder) if found
1837973f115Smrg# Set RUN_FCCACHE to a rule suitable for substituting into a makefile
1847973f115Smrg# to run fc-cache if found and not installing to $DESTDIR
1857973f115Smrg#
1867973f115Smrg# fc-cache is optional, not required, and should be skipped when making
1877973f115Smrg# packages (installing to $DESTDIR).
1887973f115Smrg#
1897973f115SmrgAC_DEFUN([XORG_FONT_FCCACHE],[
1907973f115Smrg	AC_PATH_PROG(FCCACHE, fc-cache)
1917973f115Smrg	FCCACHE_WARN='echo "** Warning: fonts.cache not built" ; echo "** Generate this file manually on host system using fc-cache"'
1927973f115Smrg	if test x"$FCCACHE" = x ; then
1937973f115Smrg		RUN_FCCACHE="${FCCACHE_WARN}"
1947973f115Smrg	else
1957973f115Smrg		RUN_FCCACHE='@(if test -z "$(DESTDIR)"; then echo $(FCCACHE) $(fontdir); $(FCCACHE) $(fontdir); else'
1967973f115Smrg		RUN_FCCACHE="${RUN_FCCACHE} ${FCCACHE_WARN} ; fi)"
1977973f115Smrg	fi
1987973f115Smrg	AC_SUBST([RUN_FCCACHE])
1997973f115Smrg])
200ed029a5fSmrg
201ed029a5fSmrg
2027973f115Smrg# XORG_FONT_COMMON_UTILS()
2037973f115Smrg# ------------------------
2047973f115Smrg# Minimum version: 1.1.0
205dd519f38Smrg#
2067973f115Smrg# Call XORG_FONT_REQUIRED_PROG for programs needed for all font types
207ed029a5fSmrg
2087973f115SmrgAC_DEFUN([XORG_FONT_COMMON_UTILS],[
2097973f115Smrg	XORG_FONT_FCCACHE
2107973f115Smrg	XORG_FONT_REQUIRED_PROG(MKFONTDIR, mkfontdir)
2117973f115Smrg])
212ed029a5fSmrg
2137973f115Smrg# XORG_FONT_SCALED_UTILS()
2147973f115Smrg# ------------------------
2157973f115Smrg# Minimum version: 1.1.0
2167973f115Smrg#
2177973f115Smrg# Call XORG_FONT_REQUIRED_PROG for programs needed for scalable fonts
2187973f115Smrg# (TrueType, OpenType, Type1)
219ed029a5fSmrg
2207973f115SmrgAC_DEFUN([XORG_FONT_SCALED_UTILS],[
2217973f115Smrg	XORG_FONT_COMMON_UTILS
2227973f115Smrg	XORG_FONT_REQUIRED_PROG(MKFONTSCALE, mkfontscale)
2237973f115Smrg])
224ed029a5fSmrg
2257973f115Smrg# XORG_FONT_BDF_UTILS()
2267973f115Smrg# ---------------------
2277973f115Smrg# Minimum version: 1.1.0
228ed029a5fSmrg#
2297973f115Smrg# Call XORG_FONT_REQUIRED_PROG for programs needed for BDF format bitmap fonts
2307973f115Smrg# Also call XORG_FONT_CHECK_COMPRESSION to determine how to compress the
2317973f115Smrg# PCF output files created by bdftopcf
232ed029a5fSmrg
2337973f115SmrgAC_DEFUN([XORG_FONT_BDF_UTILS],[
2347973f115Smrg	XORG_FONT_COMMON_UTILS
2357973f115Smrg	XORG_FONT_REQUIRED_PROG(BDFTOPCF, bdftopcf)
2367973f115Smrg	XORG_FONT_CHECK_COMPRESSION
2377973f115Smrg])
238ed029a5fSmrg
2397973f115Smrg# XORG_FONT_CHECK_COMPRESSION()
2407973f115Smrg# -----------------------------
2417973f115Smrg# Minimum version: 1.1.0
2427973f115Smrg#
2437973f115Smrg# Offer a --with-compression flag to control what compression method is
2447973f115Smrg# used for pcf font files.   Offers all the methods currently supported
2457973f115Smrg# by libXfont, including no compression.
246dd519f38Smrg
2477973f115SmrgAC_DEFUN([XORG_FONT_CHECK_COMPRESSION],[
2487973f115Smrg	AC_MSG_CHECKING([font compression method])
2497973f115Smrg	AC_ARG_WITH(compression,
2507973f115Smrg	 [AS_HELP_STRING([--with-compression=<no|compress|gzip|bzip2>],
2517973f115Smrg			 [compression method to use on pcf fonts])],
2527973f115Smrg         [compression="$withval"], [compression="yes"])
2537973f115Smrg	if test x"$compression" = "xyes" ; then
2547973f115Smrg		compression="gzip"
2557973f115Smrg	fi
2567973f115Smrg	AC_MSG_RESULT([${compression}])
2577973f115Smrg	case ${compression} in
2587973f115Smrg	 *compress)	COMPRESS_SUFFIX=".Z" ;;
2597973f115Smrg	 *gzip)		COMPRESS_SUFFIX=".gz" ;;
2607973f115Smrg	 *bzip2)	COMPRESS_SUFFIX=".bz2" ;;
2617973f115Smrg	 no|none)	COMPRESS_SUFFIX="" ; COMPRESS="cat" ;;
2627973f115Smrg	 *) AC_MSG_ERROR([${compression} is not a supported compression method]) ;;
2637973f115Smrg	esac
2647973f115Smrg	if test x"$COMPRESS_SUFFIX" != "x" ; then
2657973f115Smrg	   XORG_FONT_REQUIRED_PROG(COMPRESS, ${compression})
2667973f115Smrg	fi
2677973f115Smrg	AC_SUBST([COMPRESS_SUFFIX])
2687973f115Smrg])
269ed029a5fSmrg
2707973f115Smrg# XORG_FONT_UCS2ANY()
2717973f115Smrg# -------------------
2727973f115Smrg# Minimum version: 1.1.0
2737973f115Smrg#
2747973f115Smrg# Call XORG_FONT_REQUIRED_PROG for ucs2any program needed for splitting
2757973f115Smrg# Unicode-encoded BDF format bitmap fonts into subsets for older encodings.
2767973f115Smrg# Also call pkg-config to find the directory with the encoding files needed
2777973f115Smrg# by ucs2any, and export it as MAPFILES_PATH to the Makefiles
278ed029a5fSmrg
2797973f115SmrgAC_DEFUN([XORG_FONT_UCS2ANY],[
2807973f115Smrg	XORG_FONT_REQUIRED_PROG(UCS2ANY, ucs2any)
2817973f115Smrg	PKG_CHECK_MODULES(MAPS, [fontutil])
2827973f115Smrg	AC_MSG_CHECKING([for ucs2any encoding data files])
2837973f115Smrg	MAPFILES_PATH=`pkg-config --variable=mapdir fontutil`
2847973f115Smrg	AC_SUBST(MAPFILES_PATH)
2857973f115Smrg	AC_MSG_RESULT([${MAPFILES_PATH}])
286ed029a5fSmrg])
287ed029a5fSmrg
288ed029a5fSmrg
289ed029a5fSmrg
2907973f115Smrg# XORG_FONT_FC_CONFDIR()
2917973f115Smrg# --------------------
2927973f115Smrg# Minimum version: 1.2.0
2937973f115Smrg#
2947973f115Smrg# Sets FC_CONFDIR to the fontconfig config directory
2957973f115Smrg# (which should be --with-confdir=... when building fontconfig)
2967973f115Smrg# found from:
2977973f115Smrg#	--with-fc-confdir=...
2987973f115Smrg#	pkg-config --variable=confdir fontconfig
2997973f115Smrg#	${sysconfdir}/fonts
300ed029a5fSmrg
3017973f115SmrgAC_DEFUN([XORG_FONT_FC_CONFDIR],[
3027973f115Smrg	dnl Ensure $PKG_CONFIG is set first
3037973f115Smrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
3047973f115Smrg
3057973f115Smrg	AC_MSG_CHECKING([for fontconfig's configuration directory])
3067973f115Smrg	AC_ARG_WITH(fc-confdir,
3077973f115Smrg		    AS_HELP_STRING([--with-fc-confdir=DIR],
3087973f115Smrg			   [Path to fontconfig's configuration directory]),
3097973f115Smrg		    [FC_CONFDIR="$withval"])
3107973f115Smrg	# if --with-fc-confdir was not specified
3117973f115Smrg	if test "x${FC_CONFDIR}" = "x"; then
3127973f115Smrg		FC_CONFDIR=`$PKG_CONFIG --variable=confdir fontconfig`
3137973f115Smrg	fi
3147973f115Smrg	# ...and if pkg-config didn't find confdir in fontconfig.pc...
3157973f115Smrg	if test "x${FC_CONFDIR}" = "x"; then
3167973f115Smrg		FC_CONFDIR="${sysconfdir}/fonts"
3177973f115Smrg	fi
3187973f115Smrg	AC_SUBST(FC_CONFDIR)
3197973f115Smrg	AC_MSG_RESULT([${FC_CONFDIR}])
320ed029a5fSmrg])
321ed029a5fSmrg
322ed029a5fSmrg
3237973f115Smrg
3247973f115Smrg# XORG_FONTROOTDIR()
3257973f115Smrg# --------------------
3267973f115Smrg# Minimum version: 1.1.0
327dd519f38Smrg#
3287973f115Smrg# Sets FONTROOTDIR to the root directory for font files.  Uses the first
3297973f115Smrg# found from:
3307973f115Smrg#	--with-fontrootdir
3317973f115Smrg#	pkg-config --variable=fontrootdir fontutil
3327973f115Smrg#	${datadir}/fonts/X11
333ed029a5fSmrg
3347973f115SmrgAC_DEFUN([XORG_FONTROOTDIR],[
3357973f115Smrg	dnl Ensure $PKG_CONFIG is set first
3367973f115Smrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
337ed029a5fSmrg
3387973f115Smrg	AC_MSG_CHECKING([for root directory for font files])
3397973f115Smrg	AC_ARG_WITH(fontrootdir,
3407973f115Smrg		    AS_HELP_STRING([--with-fontrootdir=DIR],
3417973f115Smrg			   [Path to root directory for font files]),
3427973f115Smrg		    [FONTROOTDIR="$withval"])
3437973f115Smrg	# if --with-fontrootdir not specified...
3447973f115Smrg	if test "x${FONTROOTDIR}" = "x"; then
3457973f115Smrg		FONTROOTDIR=`$PKG_CONFIG --variable=fontrootdir fontutil`
3467973f115Smrg	fi
3477973f115Smrg	# ...and if pkg-config didn't find fontdir in fontutil.pc...
3487973f115Smrg	if test "x${FONTROOTDIR}" = "x"; then
3497973f115Smrg		FONTROOTDIR="${datadir}/fonts/X11"
3507973f115Smrg	fi
3517973f115Smrg	AC_SUBST(FONTROOTDIR)
3527973f115Smrg	AC_MSG_RESULT([${FONTROOTDIR}])
3537973f115Smrg])
354ed029a5fSmrg
3557973f115Smrg# XORG_FONTSUBDIR(variable, flag, subdir)
3567973f115Smrg# ---------------------------------------
3577973f115Smrg# Minimum version: 1.1.0
358ed029a5fSmrg#
3597973f115Smrg# Offer a --with-<flag> flag to control directory for font installation
3607973f115Smrg# Default is the specified <subdir> of the font root directory.
3617973f115Smrg# Sets <variable> to the selected directory
362ed029a5fSmrg
3637973f115SmrgAC_DEFUN([XORG_FONTSUBDIR],[
3647973f115Smrg	AC_REQUIRE([XORG_FONTROOTDIR])
365dd519f38Smrg
3667973f115Smrg	AC_MSG_CHECKING([for directory for $3 files])
3677973f115Smrg	AC_ARG_WITH($2,
3687973f115Smrg		    [AS_HELP_STRING([--with-$2=DIR],
3697973f115Smrg				    [Path to $3 files [FONTROOTDIR/$3]])],
3707973f115Smrg		    [$1="${withval}"], [$1='${FONTROOTDIR}/$3'])
3717973f115Smrg	AC_SUBST($1)
3727973f115Smrg	AC_MSG_RESULT([${$1}])
3737973f115Smrg]) # XORG_FONTSUBDIR
3747973f115Smrg
3757973f115Smrg# XORG_FONTDIR(subdir)
3767973f115Smrg# --------------------
3777973f115Smrg# Minimum version: 1.1.0
378dd519f38Smrg#
3797973f115Smrg# Offer a --with-fontdir flag to control directory for font installation
3807973f115Smrg# Default is the specified subdir of the font root directory.
3817973f115Smrg# Sets FONTDIR to the selected directory
382dd519f38Smrg
3837973f115SmrgAC_DEFUN([XORG_FONTDIR],[XORG_FONTSUBDIR([FONTDIR], [fontdir], [$1])])
384dd519f38Smrg
3857973f115Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
3867973f115Smrg# serial 1 (pkg-config-0.24)
3877973f115Smrg# 
3887973f115Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
3897973f115Smrg#
3907973f115Smrg# This program is free software; you can redistribute it and/or modify
3917973f115Smrg# it under the terms of the GNU General Public License as published by
3927973f115Smrg# the Free Software Foundation; either version 2 of the License, or
3937973f115Smrg# (at your option) any later version.
3947973f115Smrg#
3957973f115Smrg# This program is distributed in the hope that it will be useful, but
3967973f115Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
3977973f115Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
3987973f115Smrg# General Public License for more details.
3997973f115Smrg#
4007973f115Smrg# You should have received a copy of the GNU General Public License
4017973f115Smrg# along with this program; if not, write to the Free Software
4027973f115Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
4037973f115Smrg#
4047973f115Smrg# As a special exception to the GNU General Public License, if you
4057973f115Smrg# distribute this file as part of a program that contains a
4067973f115Smrg# configuration script generated by Autoconf, you may include it under
4077973f115Smrg# the same distribution terms that you use for the rest of that program.
408dd519f38Smrg
4097973f115Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
4107973f115Smrg# ----------------------------------
4117973f115SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
4127973f115Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
4137973f115Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
4147973f115SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
4157973f115SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
4167973f115SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
417dd519f38Smrg
4187973f115Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
4197973f115Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
420dd519f38Smrgfi
4217973f115Smrgif test -n "$PKG_CONFIG"; then
4227973f115Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
4237973f115Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
4247973f115Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
4257973f115Smrg		AC_MSG_RESULT([yes])
4267973f115Smrg	else
4277973f115Smrg		AC_MSG_RESULT([no])
4287973f115Smrg		PKG_CONFIG=""
4297973f115Smrg	fi
4307973f115Smrgfi[]dnl
4317973f115Smrg])# PKG_PROG_PKG_CONFIG
432dd519f38Smrg
4337973f115Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
4347973f115Smrg#
4357973f115Smrg# Check to see whether a particular set of modules exists.  Similar
4367973f115Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
4377973f115Smrg#
4387973f115Smrg# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
4397973f115Smrg# only at the first occurence in configure.ac, so if the first place
4407973f115Smrg# it's called might be skipped (such as if it is within an "if", you
4417973f115Smrg# have to call PKG_CHECK_EXISTS manually
4427973f115Smrg# --------------------------------------------------------------
4437973f115SmrgAC_DEFUN([PKG_CHECK_EXISTS],
4447973f115Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
4457973f115Smrgif test -n "$PKG_CONFIG" && \
4467973f115Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
4477973f115Smrg  m4_default([$2], [:])
4487973f115Smrgm4_ifvaln([$3], [else
4497973f115Smrg  $3])dnl
4507973f115Smrgfi])
451dd519f38Smrg
4527973f115Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
4537973f115Smrg# ---------------------------------------------
4547973f115Smrgm4_define([_PKG_CONFIG],
4557973f115Smrg[if test -n "$$1"; then
4567973f115Smrg    pkg_cv_[]$1="$$1"
4577973f115Smrg elif test -n "$PKG_CONFIG"; then
4587973f115Smrg    PKG_CHECK_EXISTS([$3],
4597973f115Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
4607973f115Smrg		     [pkg_failed=yes])
4617973f115Smrg else
4627973f115Smrg    pkg_failed=untried
4637973f115Smrgfi[]dnl
4647973f115Smrg])# _PKG_CONFIG
465dd519f38Smrg
4667973f115Smrg# _PKG_SHORT_ERRORS_SUPPORTED
4677973f115Smrg# -----------------------------
4687973f115SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
4697973f115Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
4707973f115Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
4717973f115Smrg        _pkg_short_errors_supported=yes
4727973f115Smrgelse
4737973f115Smrg        _pkg_short_errors_supported=no
4747973f115Smrgfi[]dnl
4757973f115Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
476dd519f38Smrg
477dd519f38Smrg
4787973f115Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
4797973f115Smrg# [ACTION-IF-NOT-FOUND])
4807973f115Smrg#
4817973f115Smrg#
4827973f115Smrg# Note that if there is a possibility the first call to
4837973f115Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
4847973f115Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
4857973f115Smrg#
4867973f115Smrg#
4877973f115Smrg# --------------------------------------------------------------
4887973f115SmrgAC_DEFUN([PKG_CHECK_MODULES],
4897973f115Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
4907973f115SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
4917973f115SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
492dd519f38Smrg
4937973f115Smrgpkg_failed=no
4947973f115SmrgAC_MSG_CHECKING([for $1])
4957973f115Smrg
4967973f115Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
4977973f115Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
4987973f115Smrg
4997973f115Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
5007973f115Smrgand $1[]_LIBS to avoid the need to call pkg-config.
5017973f115SmrgSee the pkg-config man page for more details.])
5027973f115Smrg
5037973f115Smrgif test $pkg_failed = yes; then
5047973f115Smrg   	AC_MSG_RESULT([no])
5057973f115Smrg        _PKG_SHORT_ERRORS_SUPPORTED
5067973f115Smrg        if test $_pkg_short_errors_supported = yes; then
5077973f115Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
5087973f115Smrg        else 
5097973f115Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
5107973f115Smrg        fi
5117973f115Smrg	# Put the nasty error message in config.log where it belongs
5127973f115Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
5137973f115Smrg
5147973f115Smrg	m4_default([$4], [AC_MSG_ERROR(
5157973f115Smrg[Package requirements ($2) were not met:
5167973f115Smrg
5177973f115Smrg$$1_PKG_ERRORS
5187973f115Smrg
5197973f115SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
5207973f115Smrginstalled software in a non-standard prefix.
5217973f115Smrg
5227973f115Smrg_PKG_TEXT])[]dnl
5237973f115Smrg        ])
5247973f115Smrgelif test $pkg_failed = untried; then
5257973f115Smrg     	AC_MSG_RESULT([no])
5267973f115Smrg	m4_default([$4], [AC_MSG_FAILURE(
5277973f115Smrg[The pkg-config script could not be found or is too old.  Make sure it
5287973f115Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
5297973f115Smrgpath to pkg-config.
5307973f115Smrg
5317973f115Smrg_PKG_TEXT
5327973f115Smrg
5337973f115SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])dnl
5347973f115Smrg        ])
5357973f115Smrgelse
5367973f115Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
5377973f115Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
5387973f115Smrg        AC_MSG_RESULT([yes])
5397973f115Smrg	$3
5407973f115Smrgfi[]dnl
5417973f115Smrg])# PKG_CHECK_MODULES
542dd519f38Smrg
5437973f115Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
5447973f115Smrgdnl
5457973f115Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
5467973f115Smrgdnl 
5477973f115Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
5487973f115Smrgdnl copy of this software and associated documentation files (the "Software"),
5497973f115Smrgdnl to deal in the Software without restriction, including without limitation
5507973f115Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
5517973f115Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
5527973f115Smrgdnl Software is furnished to do so, subject to the following conditions:
5537973f115Smrgdnl
5547973f115Smrgdnl The above copyright notice and this permission notice (including the next
5557973f115Smrgdnl paragraph) shall be included in all copies or substantial portions of the
5567973f115Smrgdnl Software.
5577973f115Smrgdnl
5587973f115Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
5597973f115Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
5607973f115Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
5617973f115Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
5627973f115Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
5637973f115Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
5647973f115Smrgdnl DEALINGS IN THE SOFTWARE.
565dd519f38Smrg
5667973f115Smrg# XORG_MACROS_VERSION(required-version)
5677973f115Smrg# -------------------------------------
5687973f115Smrg# Minimum version: 1.1.0
569dd519f38Smrg#
5707973f115Smrg# If you're using a macro added in Version 1.1 or newer, include this in
5717973f115Smrg# your configure.ac with the minimum required version, such as:
5727973f115Smrg# XORG_MACROS_VERSION(1.1)
5737973f115Smrg#
5747973f115Smrg# To ensure that this macro is defined, also add:
5757973f115Smrg# m4_ifndef([XORG_MACROS_VERSION],
5767973f115Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
5777973f115Smrg#
5787973f115Smrg#
5797973f115Smrg# See the "minimum version" comment for each macro you use to see what 
5807973f115Smrg# version you require.
5817973f115Smrgm4_defun([XORG_MACROS_VERSION],[
5827973f115Smrgm4_define([vers_have], [1.11.0])
5837973f115Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
5847973f115Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
5857973f115Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
5867973f115Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
5877973f115Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
5887973f115Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
5897973f115Smrgm4_undefine([vers_have])
5907973f115Smrgm4_undefine([maj_have])
5917973f115Smrgm4_undefine([maj_needed])
5927973f115Smrg]) # XORG_MACROS_VERSION
593dd519f38Smrg
5947973f115Smrg# XORG_PROG_RAWCPP()
595dd519f38Smrg# ------------------
5967973f115Smrg# Minimum version: 1.0.0
597dd519f38Smrg#
5987973f115Smrg# Find cpp program and necessary flags for use in pre-processing text files
5997973f115Smrg# such as man pages and config files
6007973f115SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
6017973f115SmrgAC_REQUIRE([AC_PROG_CPP])
6027973f115SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
6037973f115Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
604dd519f38Smrg
6057973f115Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
6067973f115Smrg# which is not the best choice for supporting other OS'es, but covers most
6077973f115Smrg# of the ones we need for now.
6087973f115SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
6097973f115SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
6107973f115Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
6117973f115Smrg	AC_MSG_RESULT([no])
612dd519f38Smrgelse
6137973f115Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
6147973f115Smrg		RAWCPPFLAGS=-undef
6157973f115Smrg		AC_MSG_RESULT([yes])
6167973f115Smrg	# under Cygwin unix is still defined even with -undef
6177973f115Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
6187973f115Smrg		RAWCPPFLAGS="-undef -ansi"
6197973f115Smrg		AC_MSG_RESULT([yes, with -ansi])
6207973f115Smrg	else
6217973f115Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
6227973f115Smrg	fi
623dd519f38Smrgfi
6247973f115Smrgrm -f conftest.$ac_ext
625dd519f38Smrg
6267973f115SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
6277973f115SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
6287973f115Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
6297973f115Smrg	AC_MSG_RESULT([no])
6307973f115Smrgelse
6317973f115Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
6327973f115Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
6337973f115Smrg		AC_MSG_RESULT([yes])
6347973f115Smrg	else
6357973f115Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
6367973f115Smrg	fi
6377973f115Smrgfi
6387973f115Smrgrm -f conftest.$ac_ext
6397973f115SmrgAC_SUBST(RAWCPPFLAGS)
6407973f115Smrg]) # XORG_PROG_RAWCPP
641dd519f38Smrg
6427973f115Smrg# XORG_MANPAGE_SECTIONS()
6437973f115Smrg# -----------------------
6447973f115Smrg# Minimum version: 1.0.0
645dd519f38Smrg#
6467973f115Smrg# Determine which sections man pages go in for the different man page types
6477973f115Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
6487973f115Smrg# Not sure if there's any better way than just hardcoding by OS name.
6497973f115Smrg# Override default settings by setting environment variables
6507973f115Smrg# Added MAN_SUBSTS in version 1.8
6517973f115Smrg# Added AC_PROG_SED in version 1.8
652dd519f38Smrg
6537973f115SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
6547973f115SmrgAC_REQUIRE([AC_CANONICAL_HOST])
6557973f115SmrgAC_REQUIRE([AC_PROG_SED])
656dd519f38Smrg
6577973f115Smrgif test x$APP_MAN_SUFFIX = x    ; then
6587973f115Smrg    APP_MAN_SUFFIX=1
6597973f115Smrgfi
6607973f115Smrgif test x$APP_MAN_DIR = x    ; then
6617973f115Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
6627973f115Smrgfi
663dd519f38Smrg
6647973f115Smrgif test x$LIB_MAN_SUFFIX = x    ; then
6657973f115Smrg    LIB_MAN_SUFFIX=3
6667973f115Smrgfi
6677973f115Smrgif test x$LIB_MAN_DIR = x    ; then
6687973f115Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
6697973f115Smrgfi
670dd519f38Smrg
6717973f115Smrgif test x$FILE_MAN_SUFFIX = x    ; then
6727973f115Smrg    case $host_os in
6737973f115Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
6747973f115Smrg	*)		FILE_MAN_SUFFIX=5  ;;
6757973f115Smrg    esac
6767973f115Smrgfi
6777973f115Smrgif test x$FILE_MAN_DIR = x    ; then
6787973f115Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
6797973f115Smrgfi
680ed029a5fSmrg
6817973f115Smrgif test x$MISC_MAN_SUFFIX = x    ; then
6827973f115Smrg    case $host_os in
6837973f115Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
6847973f115Smrg	*)		MISC_MAN_SUFFIX=7  ;;
6857973f115Smrg    esac
6867973f115Smrgfi
6877973f115Smrgif test x$MISC_MAN_DIR = x    ; then
6887973f115Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
6897973f115Smrgfi
690dd519f38Smrg
6917973f115Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
6927973f115Smrg    case $host_os in
6937973f115Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
6947973f115Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
6957973f115Smrg    esac
6967973f115Smrgfi
6977973f115Smrgif test x$DRIVER_MAN_DIR = x    ; then
6987973f115Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
6997973f115Smrgfi
700dd519f38Smrg
7017973f115Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
7027973f115Smrg    case $host_os in
7037973f115Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
7047973f115Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
7057973f115Smrg    esac
7067973f115Smrgfi
7077973f115Smrgif test x$ADMIN_MAN_DIR = x    ; then
7087973f115Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
709dd519f38Smrgfi
710dd519f38Smrg
711dd519f38Smrg
7127973f115SmrgAC_SUBST([APP_MAN_SUFFIX])
7137973f115SmrgAC_SUBST([LIB_MAN_SUFFIX])
7147973f115SmrgAC_SUBST([FILE_MAN_SUFFIX])
7157973f115SmrgAC_SUBST([MISC_MAN_SUFFIX])
7167973f115SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
7177973f115SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
7187973f115SmrgAC_SUBST([APP_MAN_DIR])
7197973f115SmrgAC_SUBST([LIB_MAN_DIR])
7207973f115SmrgAC_SUBST([FILE_MAN_DIR])
7217973f115SmrgAC_SUBST([MISC_MAN_DIR])
7227973f115SmrgAC_SUBST([DRIVER_MAN_DIR])
7237973f115SmrgAC_SUBST([ADMIN_MAN_DIR])
724dd519f38Smrg
7257973f115SmrgXORG_MAN_PAGE="X Version 11"
7267973f115SmrgAC_SUBST([XORG_MAN_PAGE])
7277973f115SmrgMAN_SUBSTS="\
7287973f115Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
7297973f115Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
7307973f115Smrg	-e 's|__xservername__|Xorg|g' \
7317973f115Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
7327973f115Smrg	-e 's|__projectroot__|\$(prefix)|g' \
7337973f115Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
7347973f115Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
7357973f115Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
7367973f115Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
7377973f115Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
7387973f115Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
7397973f115Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
7407973f115SmrgAC_SUBST([MAN_SUBSTS])
741dd519f38Smrg
7427973f115Smrg]) # XORG_MANPAGE_SECTIONS
743dd519f38Smrg
7447973f115Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
7457973f115Smrg# ------------------------
7467973f115Smrg# Minimum version: 1.7.0
7477973f115Smrg#
7487973f115Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
7497973f115Smrg# provided by xorg-sgml-doctools, if installed.
7507973f115SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
7517973f115SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
7527973f115SmrgXORG_SGML_PATH=
7537973f115SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
7547973f115Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
7557973f115Smrg    [m4_ifval([$1],[:],
7567973f115Smrg        [if test x"$cross_compiling" != x"yes" ; then
7577973f115Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
7587973f115Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
7597973f115Smrg         fi])
7607973f115Smrg    ])
7617973f115Smrg
7627973f115Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
7637973f115Smrg# the path and the name of the doc stylesheet
7647973f115Smrgif test "x$XORG_SGML_PATH" != "x" ; then
7657973f115Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
7667973f115Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
7677973f115Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
768dd519f38Smrgelse
7697973f115Smrg   AC_MSG_RESULT([no])
770dd519f38Smrgfi
771dd519f38Smrg
7727973f115SmrgAC_SUBST(XORG_SGML_PATH)
7737973f115SmrgAC_SUBST(STYLESHEET_SRCDIR)
7747973f115SmrgAC_SUBST(XSL_STYLESHEET)
7757973f115SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
7767973f115Smrg]) # XORG_CHECK_SGML_DOCTOOLS
7777973f115Smrg
7787973f115Smrg# XORG_CHECK_LINUXDOC
7797973f115Smrg# -------------------
7807973f115Smrg# Minimum version: 1.0.0
781dd519f38Smrg#
7827973f115Smrg# Defines the variable MAKE_TEXT if the necessary tools and
7837973f115Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
7847973f115Smrg# Whether or not the necessary tools and files are found can be checked
7857973f115Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
7867973f115SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
7877973f115SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
7887973f115SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
789dd519f38Smrg
7907973f115SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
791dd519f38Smrg
7927973f115SmrgAC_MSG_CHECKING([whether to build documentation])
793dd519f38Smrg
7947973f115Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
7957973f115Smrg   BUILDDOC=yes
7967973f115Smrgelse
7977973f115Smrg   BUILDDOC=no
7987973f115Smrgfi
799dd519f38Smrg
8007973f115SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
801dd519f38Smrg
8027973f115SmrgAC_MSG_RESULT([$BUILDDOC])
803dd519f38Smrg
8047973f115SmrgAC_MSG_CHECKING([whether to build pdf documentation])
805dd519f38Smrg
8067973f115Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
8077973f115Smrg   BUILDPDFDOC=yes
8087973f115Smrgelse
8097973f115Smrg   BUILDPDFDOC=no
8107973f115Smrgfi
811dd519f38Smrg
8127973f115SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
813dd519f38Smrg
8147973f115SmrgAC_MSG_RESULT([$BUILDPDFDOC])
815dd519f38Smrg
8167973f115SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
8177973f115SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
8187973f115SmrgMAKE_PDF="$PS2PDF"
8197973f115SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
820dd519f38Smrg
8217973f115SmrgAC_SUBST(MAKE_TEXT)
8227973f115SmrgAC_SUBST(MAKE_PS)
8237973f115SmrgAC_SUBST(MAKE_PDF)
8247973f115SmrgAC_SUBST(MAKE_HTML)
8257973f115Smrg]) # XORG_CHECK_LINUXDOC
826dd519f38Smrg
8277973f115Smrg# XORG_CHECK_DOCBOOK
8287973f115Smrg# -------------------
8297973f115Smrg# Minimum version: 1.0.0
8307973f115Smrg#
8317973f115Smrg# Checks for the ability to build output formats from SGML DocBook source.
8327973f115Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
8337973f115Smrg# indicates whether the necessary tools and files are found and, if set,
8347973f115Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
8357973f115SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
8367973f115SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
837dd519f38Smrg
8387973f115SmrgBUILDTXTDOC=no
8397973f115SmrgBUILDPDFDOC=no
8407973f115SmrgBUILDPSDOC=no
8417973f115SmrgBUILDHTMLDOC=no
842dd519f38Smrg
8437973f115SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
8447973f115SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
8457973f115SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
8467973f115SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
847dd519f38Smrg
8487973f115SmrgAC_MSG_CHECKING([whether to build text documentation])
8497973f115Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
8507973f115Smrg   test x$BUILD_TXTDOC != xno; then
8517973f115Smrg	BUILDTXTDOC=yes
852dd519f38Smrgfi
8537973f115SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
8547973f115SmrgAC_MSG_RESULT([$BUILDTXTDOC])
855dd519f38Smrg
8567973f115SmrgAC_MSG_CHECKING([whether to build PDF documentation])
8577973f115Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
8587973f115Smrg   test x$BUILD_PDFDOC != xno; then
8597973f115Smrg	BUILDPDFDOC=yes
8607973f115Smrgfi
8617973f115SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
8627973f115SmrgAC_MSG_RESULT([$BUILDPDFDOC])
863dd519f38Smrg
8647973f115SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
8657973f115Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
8667973f115Smrg   test x$BUILD_PSDOC != xno; then
8677973f115Smrg	BUILDPSDOC=yes
8687973f115Smrgfi
8697973f115SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
8707973f115SmrgAC_MSG_RESULT([$BUILDPSDOC])
871dd519f38Smrg
8727973f115SmrgAC_MSG_CHECKING([whether to build HTML documentation])
8737973f115Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
8747973f115Smrg   test x$BUILD_HTMLDOC != xno; then
8757973f115Smrg	BUILDHTMLDOC=yes
8767973f115Smrgfi
8777973f115SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
8787973f115SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
8797973f115Smrg
8807973f115SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
8817973f115SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
8827973f115SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
8837973f115SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
884dd519f38Smrg
8857973f115SmrgAC_SUBST(MAKE_TEXT)
8867973f115SmrgAC_SUBST(MAKE_PS)
8877973f115SmrgAC_SUBST(MAKE_PDF)
8887973f115SmrgAC_SUBST(MAKE_HTML)
8897973f115Smrg]) # XORG_CHECK_DOCBOOK
890dd519f38Smrg
8917973f115Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
8927973f115Smrg# ----------------
8937973f115Smrg# Minimum version: 1.5.0
8947973f115Smrg# Minimum version for optional DEFAULT argument: 1.11.0
8957973f115Smrg#
8967973f115Smrg# Documentation tools are not always available on all platforms and sometimes
8977973f115Smrg# not at the appropriate level. This macro enables a module to test for the
8987973f115Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
8997973f115Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
9007973f115Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
9017973f115Smrg# --with-xmlto assumes 'auto'.
9027973f115Smrg#
9037973f115Smrg# Interface to module:
9047973f115Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
9057973f115Smrg# XMLTO:	returns the path of the xmlto program found
9067973f115Smrg#		returns the path set by the user in the environment
9077973f115Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
9087973f115Smrg#		'no' user instructs the module not to use xmlto
9097973f115Smrg#
9107973f115Smrg# Added in version 1.10.0
9117973f115Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
9127973f115Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
9137973f115Smrg#
9147973f115Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
9157973f115Smrg#
9167973f115SmrgAC_DEFUN([XORG_WITH_XMLTO],[
9177973f115SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
9187973f115Smrgm4_define([_defopt], m4_default([$2], [auto]))
9197973f115SmrgAC_ARG_WITH(xmlto,
9207973f115Smrg	AS_HELP_STRING([--with-xmlto],
9217973f115Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
9227973f115Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
9237973f115Smrgm4_undefine([_defopt])
9247973f115Smrg
9257973f115Smrgif test "x$use_xmlto" = x"auto"; then
9267973f115Smrg   AC_PATH_PROG([XMLTO], [xmlto])
9277973f115Smrg   if test "x$XMLTO" = "x"; then
9287973f115Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
9297973f115Smrg	have_xmlto=no
9307973f115Smrg   else
9317973f115Smrg        have_xmlto=yes
9327973f115Smrg   fi
9337973f115Smrgelif test "x$use_xmlto" = x"yes" ; then
9347973f115Smrg   AC_PATH_PROG([XMLTO], [xmlto])
9357973f115Smrg   if test "x$XMLTO" = "x"; then
9367973f115Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
9377973f115Smrg   fi
9387973f115Smrg   have_xmlto=yes
9397973f115Smrgelif test "x$use_xmlto" = x"no" ; then
9407973f115Smrg   if test "x$XMLTO" != "x"; then
9417973f115Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
9427973f115Smrg   fi
9437973f115Smrg   have_xmlto=no
9447973f115Smrgelse
9457973f115Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
946dd519f38Smrgfi
947dd519f38Smrg
9487973f115Smrg# Test for a minimum version of xmlto, if provided.
9497973f115Smrgm4_ifval([$1],
9507973f115Smrg[if test "$have_xmlto" = yes; then
9517973f115Smrg    # scrape the xmlto version
9527973f115Smrg    AC_MSG_CHECKING([the xmlto version])
9537973f115Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
9547973f115Smrg    AC_MSG_RESULT([$xmlto_version])
9557973f115Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
9567973f115Smrg        [if test "x$use_xmlto" = xauto; then
9577973f115Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
9587973f115Smrg            have_xmlto=no
9597973f115Smrg        else
9607973f115Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
9617973f115Smrg        fi])
9627973f115Smrgfi])
963dd519f38Smrg
9647973f115Smrg# Test for the ability of xmlto to generate a text target
9657973f115Smrghave_xmlto_text=no
9667973f115Smrgcat > conftest.xml << "EOF"
9677973f115SmrgEOF
9687973f115SmrgAS_IF([test "$have_xmlto" = yes],
9697973f115Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
9707973f115Smrg             [have_xmlto_text=yes],
9717973f115Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
9727973f115Smrgrm -f conftest.xml
9737973f115SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
9747973f115SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
9757973f115Smrg]) # XORG_WITH_XMLTO
9767973f115Smrg
9777973f115Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
9787973f115Smrg# ----------------
9797973f115Smrg# Minimum version: 1.5.0
9807973f115Smrg# Minimum version for optional DEFAULT argument: 1.11.0
9817973f115Smrg#
9827973f115Smrg# Documentation tools are not always available on all platforms and sometimes
9837973f115Smrg# not at the appropriate level. This macro enables a module to test for the
9847973f115Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
9857973f115Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
9867973f115Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
9877973f115Smrg# --with-asciidoc assumes 'auto'.
9887973f115Smrg#
9897973f115Smrg# Interface to module:
9907973f115Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
9917973f115Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
9927973f115Smrg#		 returns the path set by the user in the environment
9937973f115Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
9947973f115Smrg#		  'no' user instructs the module not to use asciidoc
9957973f115Smrg#
9967973f115Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
9977973f115Smrg#
9987973f115SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
9997973f115SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
10007973f115Smrgm4_define([_defopt], m4_default([$2], [auto]))
10017973f115SmrgAC_ARG_WITH(asciidoc,
10027973f115Smrg	AS_HELP_STRING([--with-asciidoc],
10037973f115Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
10047973f115Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
10057973f115Smrgm4_undefine([_defopt])
10067973f115Smrg
10077973f115Smrgif test "x$use_asciidoc" = x"auto"; then
10087973f115Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
10097973f115Smrg   if test "x$ASCIIDOC" = "x"; then
10107973f115Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
10117973f115Smrg	have_asciidoc=no
10127973f115Smrg   else
10137973f115Smrg        have_asciidoc=yes
10147973f115Smrg   fi
10157973f115Smrgelif test "x$use_asciidoc" = x"yes" ; then
10167973f115Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
10177973f115Smrg   if test "x$ASCIIDOC" = "x"; then
10187973f115Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
10197973f115Smrg   fi
10207973f115Smrg   have_asciidoc=yes
10217973f115Smrgelif test "x$use_asciidoc" = x"no" ; then
10227973f115Smrg   if test "x$ASCIIDOC" != "x"; then
10237973f115Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
10247973f115Smrg   fi
10257973f115Smrg   have_asciidoc=no
10267973f115Smrgelse
10277973f115Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
10287973f115Smrgfi
10297973f115Smrgm4_ifval([$1],
10307973f115Smrg[if test "$have_asciidoc" = yes; then
10317973f115Smrg    # scrape the asciidoc version
10327973f115Smrg    AC_MSG_CHECKING([the asciidoc version])
10337973f115Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
10347973f115Smrg    AC_MSG_RESULT([$asciidoc_version])
10357973f115Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
10367973f115Smrg        [if test "x$use_asciidoc" = xauto; then
10377973f115Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
10387973f115Smrg            have_asciidoc=no
10397973f115Smrg        else
10407973f115Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
10417973f115Smrg        fi])
10427973f115Smrgfi])
10437973f115SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
10447973f115Smrg]) # XORG_WITH_ASCIIDOC
10457973f115Smrg
10467973f115Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
10477973f115Smrg# --------------------------------
10487973f115Smrg# Minimum version: 1.5.0
10497973f115Smrg# Minimum version for optional DEFAULT argument: 1.11.0
10507973f115Smrg#
10517973f115Smrg# Documentation tools are not always available on all platforms and sometimes
10527973f115Smrg# not at the appropriate level. This macro enables a module to test for the
10537973f115Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
10547973f115Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
10557973f115Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
10567973f115Smrg# --with-doxygen assumes 'auto'.
10577973f115Smrg#
10587973f115Smrg# Interface to module:
10597973f115Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
10607973f115Smrg# DOXYGEN:	 returns the path of the doxygen program found
10617973f115Smrg#		 returns the path set by the user in the environment
10627973f115Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
10637973f115Smrg#		  'no' user instructs the module not to use doxygen
10647973f115Smrg#
10657973f115Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
10667973f115Smrg#
10677973f115SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
10687973f115SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
10697973f115Smrgm4_define([_defopt], m4_default([$2], [auto]))
10707973f115SmrgAC_ARG_WITH(doxygen,
10717973f115Smrg	AS_HELP_STRING([--with-doxygen],
10727973f115Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
10737973f115Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
10747973f115Smrgm4_undefine([_defopt])
10757973f115Smrg
10767973f115Smrgif test "x$use_doxygen" = x"auto"; then
10777973f115Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
10787973f115Smrg   if test "x$DOXYGEN" = "x"; then
10797973f115Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
10807973f115Smrg	have_doxygen=no
10817973f115Smrg   else
10827973f115Smrg        have_doxygen=yes
10837973f115Smrg   fi
10847973f115Smrgelif test "x$use_doxygen" = x"yes" ; then
10857973f115Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
10867973f115Smrg   if test "x$DOXYGEN" = "x"; then
10877973f115Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
10887973f115Smrg   fi
10897973f115Smrg   have_doxygen=yes
10907973f115Smrgelif test "x$use_doxygen" = x"no" ; then
10917973f115Smrg   if test "x$DOXYGEN" != "x"; then
10927973f115Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
10937973f115Smrg   fi
10947973f115Smrg   have_doxygen=no
10957973f115Smrgelse
10967973f115Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
10977973f115Smrgfi
10987973f115Smrgm4_ifval([$1],
10997973f115Smrg[if test "$have_doxygen" = yes; then
11007973f115Smrg    # scrape the doxygen version
11017973f115Smrg    AC_MSG_CHECKING([the doxygen version])
11027973f115Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
11037973f115Smrg    AC_MSG_RESULT([$doxygen_version])
11047973f115Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
11057973f115Smrg        [if test "x$use_doxygen" = xauto; then
11067973f115Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
11077973f115Smrg            have_doxygen=no
11087973f115Smrg        else
11097973f115Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
11107973f115Smrg        fi])
11117973f115Smrgfi])
11127973f115SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
11137973f115Smrg]) # XORG_WITH_DOXYGEN
1114dd519f38Smrg
11157973f115Smrg# XORG_WITH_GROFF([DEFAULT])
11167973f115Smrg# ----------------
11177973f115Smrg# Minimum version: 1.6.0
11187973f115Smrg# Minimum version for optional DEFAULT argument: 1.11.0
11197973f115Smrg#
11207973f115Smrg# Documentation tools are not always available on all platforms and sometimes
11217973f115Smrg# not at the appropriate level. This macro enables a module to test for the
11227973f115Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
11237973f115Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
11247973f115Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
11257973f115Smrg# --with-groff assumes 'auto'.
11267973f115Smrg#
11277973f115Smrg# Interface to module:
11287973f115Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
11297973f115Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
11307973f115Smrg# HAVE_GROFF_MS: the -ms macros package
11317973f115Smrg# GROFF:	 returns the path of the groff program found
11327973f115Smrg#		 returns the path set by the user in the environment
11337973f115Smrg# --with-groff:	 'yes' user instructs the module to use groff
11347973f115Smrg#		 'no' user instructs the module not to use groff
11357973f115Smrg#
11367973f115Smrg# Added in version 1.9.0:
11377973f115Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
11387973f115Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
11397973f115Smrg#		   psselect from the psutils package.
11407973f115Smrg#		   the ghostcript package. Refer to the grohtml man pages
11417973f115Smrg#
11427973f115Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
11437973f115Smrg#
11447973f115Smrg# OS and distros often splits groff in a basic and full package, the former
11457973f115Smrg# having the groff program and the later having devices, fonts and macros
11467973f115Smrg# Checking for the groff executable is not enough.
11477973f115Smrg#
11487973f115Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
11497973f115Smrg# unset HAVE_GROFF or GROFF env variables.
11507973f115Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
11517973f115Smrg#
11527973f115SmrgAC_DEFUN([XORG_WITH_GROFF],[
11537973f115SmrgAC_ARG_VAR([GROFF], [Path to groff command])
11547973f115Smrgm4_define([_defopt], m4_default([$1], [auto]))
11557973f115SmrgAC_ARG_WITH(groff,
11567973f115Smrg	AS_HELP_STRING([--with-groff],
11577973f115Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
11587973f115Smrg	   [use_groff=$withval], [use_groff=]_defopt)
11597973f115Smrgm4_undefine([_defopt])
11607973f115Smrg
11617973f115Smrgif test "x$use_groff" = x"auto"; then
11627973f115Smrg   AC_PATH_PROG([GROFF], [groff])
11637973f115Smrg   if test "x$GROFF" = "x"; then
11647973f115Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
11657973f115Smrg	have_groff=no
11667973f115Smrg   else
11677973f115Smrg        have_groff=yes
11687973f115Smrg   fi
11697973f115Smrgelif test "x$use_groff" = x"yes" ; then
11707973f115Smrg   AC_PATH_PROG([GROFF], [groff])
11717973f115Smrg   if test "x$GROFF" = "x"; then
11727973f115Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
11737973f115Smrg   fi
11747973f115Smrg   have_groff=yes
11757973f115Smrgelif test "x$use_groff" = x"no" ; then
11767973f115Smrg   if test "x$GROFF" != "x"; then
11777973f115Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
11787973f115Smrg   fi
11797973f115Smrg   have_groff=no
11807973f115Smrgelse
11817973f115Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
11827973f115Smrgfi
1183dd519f38Smrg
11847973f115Smrg# We have groff, test for the presence of the macro packages
11857973f115Smrgif test "x$have_groff" = x"yes"; then
11867973f115Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
11877973f115Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
11887973f115Smrg        groff_ms_works=yes
11897973f115Smrg    else
11907973f115Smrg        groff_ms_works=no
11917973f115Smrg    fi
11927973f115Smrg    AC_MSG_RESULT([$groff_ms_works])
11937973f115Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
11947973f115Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
11957973f115Smrg        groff_mm_works=yes
11967973f115Smrg    else
11977973f115Smrg        groff_mm_works=no
11987973f115Smrg    fi
11997973f115Smrg    AC_MSG_RESULT([$groff_mm_works])
12007973f115Smrgfi
1201dd519f38Smrg
12027973f115Smrg# We have groff, test for HTML dependencies, one command per package
12037973f115Smrgif test "x$have_groff" = x"yes"; then
12047973f115Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
12057973f115Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
12067973f115Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
12077973f115Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
12087973f115Smrg      have_groff_html=yes
12097973f115Smrg   else
12107973f115Smrg      have_groff_html=no
12117973f115Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
12127973f115Smrg   fi
12137973f115Smrgfi
1214dd519f38Smrg
12157973f115Smrg# Set Automake conditionals for Makefiles
12167973f115SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
12177973f115SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
12187973f115SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
12197973f115SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
12207973f115Smrg]) # XORG_WITH_GROFF
1221dd519f38Smrg
12227973f115Smrg# XORG_WITH_FOP([DEFAULT])
12237973f115Smrg# ----------------
12247973f115Smrg# Minimum version: 1.6.0
12257973f115Smrg# Minimum version for optional DEFAULT argument: 1.11.0
12267973f115Smrg#
12277973f115Smrg# Documentation tools are not always available on all platforms and sometimes
12287973f115Smrg# not at the appropriate level. This macro enables a module to test for the
12297973f115Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
12307973f115Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
12317973f115Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
12327973f115Smrg# --with-fop assumes 'auto'.
12337973f115Smrg#
12347973f115Smrg# Interface to module:
12357973f115Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
12367973f115Smrg# FOP:	 	returns the path of the fop program found
12377973f115Smrg#		returns the path set by the user in the environment
12387973f115Smrg# --with-fop: 	'yes' user instructs the module to use fop
12397973f115Smrg#		'no' user instructs the module not to use fop
12407973f115Smrg#
12417973f115Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
12427973f115Smrg#
12437973f115SmrgAC_DEFUN([XORG_WITH_FOP],[
12447973f115SmrgAC_ARG_VAR([FOP], [Path to fop command])
12457973f115Smrgm4_define([_defopt], m4_default([$1], [auto]))
12467973f115SmrgAC_ARG_WITH(fop,
12477973f115Smrg	AS_HELP_STRING([--with-fop],
12487973f115Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
12497973f115Smrg	   [use_fop=$withval], [use_fop=]_defopt)
12507973f115Smrgm4_undefine([_defopt])
12517973f115Smrg
12527973f115Smrgif test "x$use_fop" = x"auto"; then
12537973f115Smrg   AC_PATH_PROG([FOP], [fop])
12547973f115Smrg   if test "x$FOP" = "x"; then
12557973f115Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
12567973f115Smrg	have_fop=no
12577973f115Smrg   else
12587973f115Smrg        have_fop=yes
12597973f115Smrg   fi
12607973f115Smrgelif test "x$use_fop" = x"yes" ; then
12617973f115Smrg   AC_PATH_PROG([FOP], [fop])
12627973f115Smrg   if test "x$FOP" = "x"; then
12637973f115Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
12647973f115Smrg   fi
12657973f115Smrg   have_fop=yes
12667973f115Smrgelif test "x$use_fop" = x"no" ; then
12677973f115Smrg   if test "x$FOP" != "x"; then
12687973f115Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
12697973f115Smrg   fi
12707973f115Smrg   have_fop=no
12717973f115Smrgelse
12727973f115Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
12737973f115Smrgfi
12747973f115SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
12757973f115Smrg]) # XORG_WITH_FOP
1276dd519f38Smrg
12777973f115Smrg# XORG_WITH_PS2PDF([DEFAULT])
12787973f115Smrg# ----------------
12797973f115Smrg# Minimum version: 1.6.0
12807973f115Smrg# Minimum version for optional DEFAULT argument: 1.11.0
12817973f115Smrg#
12827973f115Smrg# Documentation tools are not always available on all platforms and sometimes
12837973f115Smrg# not at the appropriate level. This macro enables a module to test for the
12847973f115Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
12857973f115Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
12867973f115Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
12877973f115Smrg# --with-ps2pdf assumes 'auto'.
12887973f115Smrg#
12897973f115Smrg# Interface to module:
12907973f115Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
12917973f115Smrg# PS2PDF:	returns the path of the ps2pdf program found
12927973f115Smrg#		returns the path set by the user in the environment
12937973f115Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
12947973f115Smrg#		 'no' user instructs the module not to use ps2pdf
12957973f115Smrg#
12967973f115Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
12977973f115Smrg#
12987973f115SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
12997973f115SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
13007973f115Smrgm4_define([_defopt], m4_default([$1], [auto]))
13017973f115SmrgAC_ARG_WITH(ps2pdf,
13027973f115Smrg	AS_HELP_STRING([--with-ps2pdf],
13037973f115Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
13047973f115Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
13057973f115Smrgm4_undefine([_defopt])
13067973f115Smrg
13077973f115Smrgif test "x$use_ps2pdf" = x"auto"; then
13087973f115Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
13097973f115Smrg   if test "x$PS2PDF" = "x"; then
13107973f115Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
13117973f115Smrg	have_ps2pdf=no
13127973f115Smrg   else
13137973f115Smrg        have_ps2pdf=yes
13147973f115Smrg   fi
13157973f115Smrgelif test "x$use_ps2pdf" = x"yes" ; then
13167973f115Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
13177973f115Smrg   if test "x$PS2PDF" = "x"; then
13187973f115Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
13197973f115Smrg   fi
13207973f115Smrg   have_ps2pdf=yes
13217973f115Smrgelif test "x$use_ps2pdf" = x"no" ; then
13227973f115Smrg   if test "x$PS2PDF" != "x"; then
13237973f115Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
13247973f115Smrg   fi
13257973f115Smrg   have_ps2pdf=no
13267973f115Smrgelse
13277973f115Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
13287973f115Smrgfi
13297973f115SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
13307973f115Smrg]) # XORG_WITH_PS2PDF
1331dd519f38Smrg
13327973f115Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
13337973f115Smrg# ----------------
13347973f115Smrg# Minimum version: 1.6.0
13357973f115Smrg#
13367973f115Smrg# Documentation tools are not always available on all platforms and sometimes
13377973f115Smrg# not at the appropriate level. This macro enables a builder to skip all
13387973f115Smrg# documentation targets except traditional man pages.
13397973f115Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
13407973f115Smrg# maximum flexibilty in controlling documentation building.
13417973f115Smrg# Refer to:
13427973f115Smrg# XORG_WITH_XMLTO         --with-xmlto
13437973f115Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
13447973f115Smrg# XORG_WITH_DOXYGEN       --with-doxygen
13457973f115Smrg# XORG_WITH_FOP           --with-fop
13467973f115Smrg# XORG_WITH_GROFF         --with-groff
13477973f115Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
13487973f115Smrg#
13497973f115Smrg# Interface to module:
13507973f115Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
13517973f115Smrg# --enable-docs: 'yes' user instructs the module to generate docs
13527973f115Smrg#		 'no' user instructs the module not to generate docs
13537973f115Smrg# parm1:	specify the default value, yes or no.
13547973f115Smrg#
13557973f115SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
13567973f115Smrgm4_define([default], m4_default([$1], [yes]))
13577973f115SmrgAC_ARG_ENABLE(docs,
13587973f115Smrg	AS_HELP_STRING([--enable-docs],
13597973f115Smrg	   [Enable building the documentation (default: ]default[)]),
13607973f115Smrg	   [build_docs=$enableval], [build_docs=]default)
13617973f115Smrgm4_undefine([default])
13627973f115SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
13637973f115SmrgAC_MSG_CHECKING([whether to build documentation])
13647973f115SmrgAC_MSG_RESULT([$build_docs])
13657973f115Smrg]) # XORG_ENABLE_DOCS
13667973f115Smrg
13677973f115Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
13687973f115Smrg# ----------------
13697973f115Smrg# Minimum version: 1.6.0
13707973f115Smrg#
13717973f115Smrg# This macro enables a builder to skip all developer documentation.
13727973f115Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
13737973f115Smrg# maximum flexibilty in controlling documentation building.
13747973f115Smrg# Refer to:
13757973f115Smrg# XORG_WITH_XMLTO         --with-xmlto
13767973f115Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
13777973f115Smrg# XORG_WITH_DOXYGEN       --with-doxygen
13787973f115Smrg# XORG_WITH_FOP           --with-fop
13797973f115Smrg# XORG_WITH_GROFF         --with-groff
13807973f115Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
13817973f115Smrg#
13827973f115Smrg# Interface to module:
13837973f115Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
13847973f115Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
13857973f115Smrg#			'no' user instructs the module not to generate developer docs
13867973f115Smrg# parm1:		specify the default value, yes or no.
13877973f115Smrg#
13887973f115SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
13897973f115Smrgm4_define([devel_default], m4_default([$1], [yes]))
13907973f115SmrgAC_ARG_ENABLE(devel-docs,
13917973f115Smrg	AS_HELP_STRING([--enable-devel-docs],
13927973f115Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
13937973f115Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
13947973f115Smrgm4_undefine([devel_default])
13957973f115SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
13967973f115SmrgAC_MSG_CHECKING([whether to build developer documentation])
13977973f115SmrgAC_MSG_RESULT([$build_devel_docs])
13987973f115Smrg]) # XORG_ENABLE_DEVEL_DOCS
13997973f115Smrg
14007973f115Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
14017973f115Smrg# ----------------
14027973f115Smrg# Minimum version: 1.6.0
14037973f115Smrg#
14047973f115Smrg# This macro enables a builder to skip all functional specification targets.
14057973f115Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
14067973f115Smrg# maximum flexibilty in controlling documentation building.
14077973f115Smrg# Refer to:
14087973f115Smrg# XORG_WITH_XMLTO         --with-xmlto
14097973f115Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
14107973f115Smrg# XORG_WITH_DOXYGEN       --with-doxygen
14117973f115Smrg# XORG_WITH_FOP           --with-fop
14127973f115Smrg# XORG_WITH_GROFF         --with-groff
14137973f115Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
14147973f115Smrg#
14157973f115Smrg# Interface to module:
14167973f115Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
14177973f115Smrg# --enable-specs:	'yes' user instructs the module to generate specs
14187973f115Smrg#			'no' user instructs the module not to generate specs
14197973f115Smrg# parm1:		specify the default value, yes or no.
14207973f115Smrg#
14217973f115SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
14227973f115Smrgm4_define([spec_default], m4_default([$1], [yes]))
14237973f115SmrgAC_ARG_ENABLE(specs,
14247973f115Smrg	AS_HELP_STRING([--enable-specs],
14257973f115Smrg	   [Enable building the specs (default: ]spec_default[)]),
14267973f115Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
14277973f115Smrgm4_undefine([spec_default])
14287973f115SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
14297973f115SmrgAC_MSG_CHECKING([whether to build functional specifications])
14307973f115SmrgAC_MSG_RESULT([$build_specs])
14317973f115Smrg]) # XORG_ENABLE_SPECS
1432dd519f38Smrg
14337973f115Smrg# XORG_CHECK_MALLOC_ZERO
14347973f115Smrg# ----------------------
14357973f115Smrg# Minimum version: 1.0.0
14367973f115Smrg#
14377973f115Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
14387973f115Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
14397973f115Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
14407973f115SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
14417973f115SmrgAC_ARG_ENABLE(malloc0returnsnull,
14427973f115Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
14437973f115Smrg		       [malloc(0) returns NULL (default: auto)]),
14447973f115Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
14457973f115Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1446dd519f38Smrg
14477973f115SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
14487973f115Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
14497973f115Smrg	AC_RUN_IFELSE([
14507973f115Smrgchar *malloc();
14517973f115Smrgchar *realloc();
14527973f115Smrgchar *calloc();
14537973f115Smrgmain() {
14547973f115Smrg    char *m0, *r0, *c0, *p;
14557973f115Smrg    m0 = malloc(0);
14567973f115Smrg    p = malloc(10);
14577973f115Smrg    r0 = realloc(p,0);
14587973f115Smrg    c0 = calloc(0);
14597973f115Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
14607973f115Smrg}],
14617973f115Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
14627973f115Smrg		[MALLOC_ZERO_RETURNS_NULL=no],
14637973f115Smrg		[MALLOC_ZERO_RETURNS_NULL=yes])
14647973f115Smrgfi
14657973f115SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1466dd519f38Smrg
14677973f115Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
14687973f115Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
14697973f115Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
14707973f115Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
14717973f115Smrgelse
14727973f115Smrg	MALLOC_ZERO_CFLAGS=""
14737973f115Smrg	XMALLOC_ZERO_CFLAGS=""
14747973f115Smrg	XTMALLOC_ZERO_CFLAGS=""
14757973f115Smrgfi
14767973f115Smrg
14777973f115SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
14787973f115SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
14797973f115SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
14807973f115Smrg]) # XORG_CHECK_MALLOC_ZERO
1481dd519f38Smrg
14827973f115Smrg# XORG_WITH_LINT()
14837973f115Smrg# ----------------
1484dd519f38Smrg# Minimum version: 1.1.0
1485dd519f38Smrg#
14867973f115Smrg# This macro enables the use of a tool that flags some suspicious and
14877973f115Smrg# non-portable constructs (likely to be bugs) in C language source code.
14887973f115Smrg# It will attempt to locate the tool and use appropriate options.
14897973f115Smrg# There are various lint type tools on different platforms.
1490dd519f38Smrg#
14917973f115Smrg# Interface to module:
14927973f115Smrg# LINT:		returns the path to the tool found on the platform
14937973f115Smrg#		or the value set to LINT on the configure cmd line
14947973f115Smrg#		also an Automake conditional
14957973f115Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
1496dd519f38Smrg#
14977973f115Smrg# --with-lint:	'yes' user instructs the module to use lint
14987973f115Smrg#		'no' user instructs the module not to use lint (default)
1499dd519f38Smrg#
15007973f115Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
15017973f115Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
15027973f115Smrg#
15037973f115SmrgAC_DEFUN([XORG_WITH_LINT],[
1504dd519f38Smrg
15057973f115SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
15067973f115SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
15077973f115SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
15087973f115Smrg		[Use a lint-style source code checker (default: disabled)])],
15097973f115Smrg		[use_lint=$withval], [use_lint=no])
1510dd519f38Smrg
15117973f115Smrg# Obtain platform specific info like program name and options
15127973f115Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
15137973f115Smrgcase $host_os in
15147973f115Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
15157973f115Smrg	lint_name=splint
15167973f115Smrg	lint_options="-badflag"
15177973f115Smrg	;;
15187973f115Smrg  *freebsd* | *netbsd*)
15197973f115Smrg	lint_name=lint
15207973f115Smrg	lint_options="-u -b"
15217973f115Smrg	;;
15227973f115Smrg  *solaris*)
15237973f115Smrg	lint_name=lint
15247973f115Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
15257973f115Smrg	;;
15267973f115Smrgesac
1527dd519f38Smrg
15287973f115Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
15297973f115Smrgif test "x$use_lint" = x"yes" ; then
15307973f115Smrg   AC_PATH_PROG([LINT], [$lint_name])
15317973f115Smrg   if test "x$LINT" = "x"; then
15327973f115Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
15337973f115Smrg   fi
15347973f115Smrgelif test "x$use_lint" = x"no" ; then
15357973f115Smrg   if test "x$LINT" != "x"; then
15367973f115Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
15377973f115Smrg   fi
15387973f115Smrgelse
15397973f115Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
15407973f115Smrgfi
1541dd519f38Smrg
15427973f115Smrg# User supplied flags override default flags
15437973f115Smrgif test "x$LINT_FLAGS" != "x"; then
15447973f115Smrg   lint_options=$LINT_FLAGS
15457973f115Smrgfi
1546dd519f38Smrg
15477973f115SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
15487973f115SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
1549dd519f38Smrg
15507973f115Smrg]) # XORG_WITH_LINT
1551dd519f38Smrg
15527973f115Smrg# XORG_LINT_LIBRARY(LIBNAME)
15537973f115Smrg# --------------------------
1554dd519f38Smrg# Minimum version: 1.1.0
1555dd519f38Smrg#
15567973f115Smrg# Sets up flags for building lint libraries for checking programs that call
15577973f115Smrg# functions in the library.
1558dd519f38Smrg#
15597973f115Smrg# Interface to module:
15607973f115Smrg# LINTLIB		- Automake variable with the name of lint library file to make
15617973f115Smrg# MAKE_LINT_LIB		- Automake conditional
1562dd519f38Smrg#
15637973f115Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
15647973f115Smrg#			  - 'no' user instructs the module not to create a lint library (default)
1565dd519f38Smrg
15667973f115SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
15677973f115SmrgAC_REQUIRE([XORG_WITH_LINT])
15687973f115SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
15697973f115Smrg	[Create lint library (default: disabled)])],
15707973f115Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
1571dd519f38Smrg
15727973f115Smrgif test "x$make_lint_lib" = x"yes" ; then
15737973f115Smrg   LINTLIB=llib-l$1.ln
15747973f115Smrg   if test "x$LINT" = "x"; then
15757973f115Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
15767973f115Smrg   fi
15777973f115Smrgelif test "x$make_lint_lib" != x"no" ; then
15787973f115Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
15797973f115Smrgfi
1580dd519f38Smrg
15817973f115SmrgAC_SUBST(LINTLIB)
15827973f115SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1583dd519f38Smrg
15847973f115Smrg]) # XORG_LINT_LIBRARY
1585dd519f38Smrg
15867973f115Smrg# XORG_CWARNFLAGS
15877973f115Smrg# ---------------
15887973f115Smrg# Minimum version: 1.2.0
1589dd519f38Smrg#
15907973f115Smrg# Defines CWARNFLAGS to enable C compiler warnings.
1591dd519f38Smrg#
15927973f115SmrgAC_DEFUN([XORG_CWARNFLAGS], [
15937973f115SmrgAC_REQUIRE([AC_PROG_CC_C99])
15947973f115Smrgif  test "x$GCC" = xyes ; then
15957973f115Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
15967973f115Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
15977973f115Smrg-Wbad-function-cast -Wformat=2"
15987973f115Smrg    case `$CC -dumpversion` in
15997973f115Smrg    3.4.* | 4.*)
16007973f115Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
16017973f115Smrg	;;
16027973f115Smrg    esac
16037973f115Smrgelse
16047973f115Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
16057973f115Smrg    if test "x$SUNCC" = "xyes"; then
16067973f115Smrg	CWARNFLAGS="-v"
16077973f115Smrg    fi
16087973f115Smrgfi
16097973f115SmrgAC_SUBST(CWARNFLAGS)
16107973f115Smrg]) # XORG_CWARNFLAGS
1611dd519f38Smrg
16127973f115Smrg# XORG_STRICT_OPTION
16137973f115Smrg# -----------------------
16147973f115Smrg# Minimum version: 1.3.0
1615dd519f38Smrg#
16167973f115Smrg# Add configure option to enable strict compilation
16177973f115SmrgAC_DEFUN([XORG_STRICT_OPTION], [
16187973f115Smrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
16197973f115SmrgAC_REQUIRE([AC_PROG_CC_C99])
16207973f115SmrgAC_REQUIRE([XORG_CWARNFLAGS])
1621dd519f38Smrg
16227973f115SmrgAC_ARG_ENABLE(strict-compilation,
16237973f115Smrg			  AS_HELP_STRING([--enable-strict-compilation],
16247973f115Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
16257973f115Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
16267973f115Smrgif test "x$STRICT_COMPILE" = "xyes"; then
16277973f115Smrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
16287973f115Smrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
16297973f115Smrg	if test "x$GCC" = xyes ; then
16307973f115Smrg		STRICT_CFLAGS="-pedantic -Werror"
16317973f115Smrg	elif test "x$SUNCC" = "xyes"; then
16327973f115Smrg		STRICT_CFLAGS="-errwarn"
16337973f115Smrg    elif test "x$INTELCC" = "xyes"; then
16347973f115Smrg		STRICT_CFLAGS="-Werror"
16357973f115Smrg	fi
16367973f115Smrgfi
16377973f115SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
16387973f115SmrgAC_SUBST([CWARNFLAGS])
16397973f115Smrg]) # XORG_STRICT_OPTION
1640dd519f38Smrg
16417973f115Smrg# XORG_DEFAULT_OPTIONS
1642dd519f38Smrg# --------------------
16437973f115Smrg# Minimum version: 1.3.0
1644dd519f38Smrg#
16457973f115Smrg# Defines default options for X.Org modules.
16467973f115Smrg#
16477973f115SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
16487973f115SmrgAC_REQUIRE([AC_PROG_INSTALL])
16497973f115SmrgXORG_CWARNFLAGS
16507973f115SmrgXORG_STRICT_OPTION
16517973f115SmrgXORG_RELEASE_VERSION
16527973f115SmrgXORG_CHANGELOG
16537973f115SmrgXORG_INSTALL
16547973f115SmrgXORG_MANPAGE_SECTIONS
16557973f115Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
16567973f115Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
16577973f115Smrg]) # XORG_DEFAULT_OPTIONS
1658dd519f38Smrg
16597973f115Smrg# XORG_INSTALL()
16607973f115Smrg# ----------------
16617973f115Smrg# Minimum version: 1.4.0
16627973f115Smrg#
16637973f115Smrg# Defines the variable INSTALL_CMD as the command to copy
16647973f115Smrg# INSTALL from $prefix/share/util-macros.
16657973f115Smrg#
16667973f115SmrgAC_DEFUN([XORG_INSTALL], [
16677973f115SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
16687973f115Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
16697973f115SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
16707973f115Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
16717973f115Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
16727973f115Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
16737973f115SmrgAC_SUBST([INSTALL_CMD])
16747973f115Smrg]) # XORG_INSTALL
16757973f115Smrgdnl Copyright 2005 Red Hat, Inc
16767973f115Smrgdnl
16777973f115Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
16787973f115Smrgdnl documentation for any purpose is hereby granted without fee, provided that
16797973f115Smrgdnl the above copyright notice appear in all copies and that both that
16807973f115Smrgdnl copyright notice and this permission notice appear in supporting
16817973f115Smrgdnl documentation.
16827973f115Smrgdnl
16837973f115Smrgdnl The above copyright notice and this permission notice shall be included
16847973f115Smrgdnl in all copies or substantial portions of the Software.
16857973f115Smrgdnl
16867973f115Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16877973f115Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16887973f115Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16897973f115Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
16907973f115Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
16917973f115Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
16927973f115Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
16937973f115Smrgdnl
16947973f115Smrgdnl Except as contained in this notice, the name of the copyright holders shall
16957973f115Smrgdnl not be used in advertising or otherwise to promote the sale, use or
16967973f115Smrgdnl other dealings in this Software without prior written authorization
16977973f115Smrgdnl from the copyright holders.
16987973f115Smrgdnl
1699dd519f38Smrg
17007973f115Smrg# XORG_RELEASE_VERSION
17017973f115Smrg# --------------------
17027973f115Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
17037973f115Smrg 
17047973f115SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
17057973f115Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
17067973f115Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
17077973f115Smrg		[Major version of this package])
17087973f115Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
17097973f115Smrg	if test "x$PVM" = "x"; then
17107973f115Smrg		PVM="0"
1711dd519f38Smrg	fi
17127973f115Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
17137973f115Smrg		[$PVM],
17147973f115Smrg		[Minor version of this package])
17157973f115Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
17167973f115Smrg	if test "x$PVP" = "x"; then
17177973f115Smrg		PVP="0"
1718dd519f38Smrg	fi
17197973f115Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
17207973f115Smrg		[$PVP],
17217973f115Smrg		[Patch version of this package])
1722dd519f38Smrg])
1723dd519f38Smrg
17247973f115Smrg# XORG_CHANGELOG()
17257973f115Smrg# ----------------
17267973f115Smrg# Minimum version: 1.2.0
1727dd519f38Smrg#
17287973f115Smrg# Defines the variable CHANGELOG_CMD as the command to generate
17297973f115Smrg# ChangeLog from git.
17307973f115Smrg#
17317973f115Smrg#
17327973f115SmrgAC_DEFUN([XORG_CHANGELOG], [
17337973f115SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
17347973f115Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
17357973f115Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
17367973f115Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
17377973f115SmrgAC_SUBST([CHANGELOG_CMD])
17387973f115Smrg]) # XORG_CHANGELOG
1739dd519f38Smrg
17407973f115Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
17417973f115Smrg#
17427973f115Smrg# This file is free software; the Free Software Foundation
17437973f115Smrg# gives unlimited permission to copy and/or distribute it,
17447973f115Smrg# with or without modifications, as long as this notice is preserved.
1745dd519f38Smrg
17467973f115Smrg# AM_AUTOMAKE_VERSION(VERSION)
17477973f115Smrg# ----------------------------
17487973f115Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
17497973f115Smrg# generated from the m4 files accompanying Automake X.Y.
17507973f115Smrg# (This private macro should not be called outside this file.)
17517973f115SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
17527973f115Smrg[am__api_version='1.11'
17537973f115Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
17547973f115Smrgdnl require some minimum version.  Point them to the right macro.
17557973f115Smrgm4_if([$1], [1.11.1], [],
17567973f115Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
17577973f115Smrg])
1758dd519f38Smrg
17597973f115Smrg# _AM_AUTOCONF_VERSION(VERSION)
17607973f115Smrg# -----------------------------
17617973f115Smrg# aclocal traces this macro to find the Autoconf version.
17627973f115Smrg# This is a private macro too.  Using m4_define simplifies
17637973f115Smrg# the logic in aclocal, which can simply ignore this definition.
17647973f115Smrgm4_define([_AM_AUTOCONF_VERSION], [])
1765dd519f38Smrg
17667973f115Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
17677973f115Smrg# -------------------------------
17687973f115Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
17697973f115Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
17707973f115SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
17717973f115Smrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
17727973f115Smrgm4_ifndef([AC_AUTOCONF_VERSION],
17737973f115Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17747973f115Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
1775dd519f38Smrg
17767973f115Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
1777dd519f38Smrg
17787973f115Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
1779dd519f38Smrg#
17807973f115Smrg# This file is free software; the Free Software Foundation
17817973f115Smrg# gives unlimited permission to copy and/or distribute it,
17827973f115Smrg# with or without modifications, as long as this notice is preserved.
17837973f115Smrg
17847973f115Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
17857973f115Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
17867973f115Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
1787dd519f38Smrg#
17887973f115Smrg# Of course, Automake must honor this variable whenever it calls a
17897973f115Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
17907973f115Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
17917973f115Smrg# depending on how configure is run.  This is pretty annoying, since
17927973f115Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
17937973f115Smrg# source directory, any form will work fine, but in subdirectories a
17947973f115Smrg# relative path needs to be adjusted first.
1795dd519f38Smrg#
17967973f115Smrg# $ac_aux_dir/missing
17977973f115Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
17987973f115Smrg# $top_srcdir/$ac_aux_dir/missing
17997973f115Smrg#    fails if $ac_aux_dir is absolute,
18007973f115Smrg#    fails when called from a subdirectory in a VPATH build with
18017973f115Smrg#          a relative $ac_aux_dir
1802dd519f38Smrg#
18037973f115Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
18047973f115Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
18057973f115Smrg# harmless because $srcdir is `.', but things will broke when you
18067973f115Smrg# start a VPATH build or use an absolute $srcdir.
1807dd519f38Smrg#
18087973f115Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
18097973f115Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
18107973f115Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
18117973f115Smrg# and then we would define $MISSING as
18127973f115Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
18137973f115Smrg# This will work as long as MISSING is not called from configure, because
18147973f115Smrg# unfortunately $(top_srcdir) has no meaning in configure.
18157973f115Smrg# However there are other variables, like CC, which are often used in
18167973f115Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
18177973f115Smrg#
18187973f115Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
18197973f115Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
18207973f115Smrg# configured tree to be moved without reconfiguration.
1821dd519f38Smrg
18227973f115SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
18237973f115Smrg[dnl Rely on autoconf to set up CDPATH properly.
18247973f115SmrgAC_PREREQ([2.50])dnl
18257973f115Smrg# expand $ac_aux_dir to an absolute path
18267973f115Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
18277973f115Smrg])
18287973f115Smrg
18297973f115Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
18307973f115Smrg
18317973f115Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
18327973f115Smrg# Free Software Foundation, Inc.
18337973f115Smrg#
18347973f115Smrg# This file is free software; the Free Software Foundation
18357973f115Smrg# gives unlimited permission to copy and/or distribute it,
18367973f115Smrg# with or without modifications, as long as this notice is preserved.
1837dd519f38Smrg
18387973f115Smrg# serial 9
18397973f115Smrg
18407973f115Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
18417973f115Smrg# -------------------------------------
18427973f115Smrg# Define a conditional.
18437973f115SmrgAC_DEFUN([AM_CONDITIONAL],
18447973f115Smrg[AC_PREREQ(2.52)dnl
18457973f115Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
18467973f115Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
18477973f115SmrgAC_SUBST([$1_TRUE])dnl
18487973f115SmrgAC_SUBST([$1_FALSE])dnl
18497973f115Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
18507973f115Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
18517973f115Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
18527973f115Smrgif $2; then
18537973f115Smrg  $1_TRUE=
18547973f115Smrg  $1_FALSE='#'
1855dd519f38Smrgelse
18567973f115Smrg  $1_TRUE='#'
18577973f115Smrg  $1_FALSE=
1858dd519f38Smrgfi
18597973f115SmrgAC_CONFIG_COMMANDS_PRE(
18607973f115Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
18617973f115Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
18627973f115SmrgUsually this means the macro was only invoked conditionally.]])
18637973f115Smrgfi])])
1864dd519f38Smrg
18657973f115Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
18667973f115Smrg# Free Software Foundation, Inc.
1867dd519f38Smrg#
18687973f115Smrg# This file is free software; the Free Software Foundation
18697973f115Smrg# gives unlimited permission to copy and/or distribute it,
18707973f115Smrg# with or without modifications, as long as this notice is preserved.
1871dd519f38Smrg
18727973f115Smrg# serial 10
1873dd519f38Smrg
18747973f115Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
18757973f115Smrg# written in clear, in which case automake, when reading aclocal.m4,
18767973f115Smrg# will think it sees a *use*, and therefore will trigger all it's
18777973f115Smrg# C support machinery.  Also note that it means that autoscan, seeing
18787973f115Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1879dd519f38Smrg
1880dd519f38Smrg
18817973f115Smrg# _AM_DEPENDENCIES(NAME)
18827973f115Smrg# ----------------------
18837973f115Smrg# See how the compiler implements dependency checking.
18847973f115Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
18857973f115Smrg# We try a few techniques and use that to set a single cache variable.
18867973f115Smrg#
18877973f115Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
18887973f115Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
18897973f115Smrg# dependency, and given that the user is not expected to run this macro,
18907973f115Smrg# just rely on AC_PROG_CC.
18917973f115SmrgAC_DEFUN([_AM_DEPENDENCIES],
18927973f115Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
18937973f115SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
18947973f115SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
18957973f115SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1896dd519f38Smrg
18977973f115Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
18987973f115Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
18997973f115Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
19007973f115Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
19017973f115Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
19027973f115Smrg                   [depcc="$$1"   am_compiler_list=])
1903dd519f38Smrg
19047973f115SmrgAC_CACHE_CHECK([dependency style of $depcc],
19057973f115Smrg               [am_cv_$1_dependencies_compiler_type],
19067973f115Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
19077973f115Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
19087973f115Smrg  # making bogus files that we don't know about and never remove.  For
19097973f115Smrg  # instance it was reported that on HP-UX the gcc test will end up
19107973f115Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
19117973f115Smrg  # in D'.
19127973f115Smrg  mkdir conftest.dir
19137973f115Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
19147973f115Smrg  # using a relative directory.
19157973f115Smrg  cp "$am_depcomp" conftest.dir
19167973f115Smrg  cd conftest.dir
19177973f115Smrg  # We will build objects and dependencies in a subdirectory because
19187973f115Smrg  # it helps to detect inapplicable dependency modes.  For instance
19197973f115Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
19207973f115Smrg  # side effect of compilation, but ICC will put the dependencies in
19217973f115Smrg  # the current directory while Tru64 will put them in the object
19227973f115Smrg  # directory.
19237973f115Smrg  mkdir sub
1924dd519f38Smrg
19257973f115Smrg  am_cv_$1_dependencies_compiler_type=none
19267973f115Smrg  if test "$am_compiler_list" = ""; then
19277973f115Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
19287973f115Smrg  fi
19297973f115Smrg  am__universal=false
19307973f115Smrg  m4_case([$1], [CC],
19317973f115Smrg    [case " $depcc " in #(
19327973f115Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
19337973f115Smrg     esac],
19347973f115Smrg    [CXX],
19357973f115Smrg    [case " $depcc " in #(
19367973f115Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
19377973f115Smrg     esac])
19387973f115Smrg
19397973f115Smrg  for depmode in $am_compiler_list; do
19407973f115Smrg    # Setup a source with many dependencies, because some compilers
19417973f115Smrg    # like to wrap large dependency lists on column 80 (with \), and
19427973f115Smrg    # we should not choose a depcomp mode which is confused by this.
19437973f115Smrg    #
19447973f115Smrg    # We need to recreate these files for each test, as the compiler may
19457973f115Smrg    # overwrite some of them when testing with obscure command lines.
19467973f115Smrg    # This happens at least with the AIX C compiler.
19477973f115Smrg    : > sub/conftest.c
19487973f115Smrg    for i in 1 2 3 4 5 6; do
19497973f115Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
19507973f115Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
19517973f115Smrg      # Solaris 8's {/usr,}/bin/sh.
19527973f115Smrg      touch sub/conftst$i.h
19537973f115Smrg    done
19547973f115Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
19557973f115Smrg
19567973f115Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
19577973f115Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
19587973f115Smrg    # handle `-M -o', and we need to detect this.  Also, some Intel
19597973f115Smrg    # versions had trouble with output in subdirs
19607973f115Smrg    am__obj=sub/conftest.${OBJEXT-o}
19617973f115Smrg    am__minus_obj="-o $am__obj"
19627973f115Smrg    case $depmode in
19637973f115Smrg    gcc)
19647973f115Smrg      # This depmode causes a compiler race in universal mode.
19657973f115Smrg      test "$am__universal" = false || continue
19667973f115Smrg      ;;
19677973f115Smrg    nosideeffect)
19687973f115Smrg      # after this tag, mechanisms are not by side-effect, so they'll
19697973f115Smrg      # only be used when explicitly requested
19707973f115Smrg      if test "x$enable_dependency_tracking" = xyes; then
19717973f115Smrg	continue
19727973f115Smrg      else
19737973f115Smrg	break
19747973f115Smrg      fi
19757973f115Smrg      ;;
19767973f115Smrg    msvisualcpp | msvcmsys)
19777973f115Smrg      # This compiler won't grok `-c -o', but also, the minuso test has
19787973f115Smrg      # not run yet.  These depmodes are late enough in the game, and
19797973f115Smrg      # so weak that their functioning should not be impacted.
19807973f115Smrg      am__obj=conftest.${OBJEXT-o}
19817973f115Smrg      am__minus_obj=
19827973f115Smrg      ;;
19837973f115Smrg    none) break ;;
1984dd519f38Smrg    esac
19857973f115Smrg    if depmode=$depmode \
19867973f115Smrg       source=sub/conftest.c object=$am__obj \
19877973f115Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
19887973f115Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
19897973f115Smrg         >/dev/null 2>conftest.err &&
19907973f115Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
19917973f115Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
19927973f115Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
19937973f115Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
19947973f115Smrg      # icc doesn't choke on unknown options, it will just issue warnings
19957973f115Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
19967973f115Smrg      # that says an option was ignored or not supported.
19977973f115Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
19987973f115Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
19997973f115Smrg      # The diagnosis changed in icc 8.0:
20007973f115Smrg      #   icc: Command line remark: option '-MP' not supported
20017973f115Smrg      if (grep 'ignoring option' conftest.err ||
20027973f115Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
20037973f115Smrg        am_cv_$1_dependencies_compiler_type=$depmode
20047973f115Smrg        break
20057973f115Smrg      fi
20067973f115Smrg    fi
20077973f115Smrg  done
20087973f115Smrg
20097973f115Smrg  cd ..
20107973f115Smrg  rm -rf conftest.dir
20117973f115Smrgelse
20127973f115Smrg  am_cv_$1_dependencies_compiler_type=none
2013dd519f38Smrgfi
20147973f115Smrg])
20157973f115SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
20167973f115SmrgAM_CONDITIONAL([am__fastdep$1], [
20177973f115Smrg  test "x$enable_dependency_tracking" != xno \
20187973f115Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
20197973f115Smrg])
20207973f115Smrg
20217973f115Smrg
20227973f115Smrg# AM_SET_DEPDIR
20237973f115Smrg# -------------
20247973f115Smrg# Choose a directory name for dependency files.
20257973f115Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
20267973f115SmrgAC_DEFUN([AM_SET_DEPDIR],
20277973f115Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
20287973f115SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
20297973f115Smrg])
20307973f115Smrg
20317973f115Smrg
20327973f115Smrg# AM_DEP_TRACK
20337973f115Smrg# ------------
20347973f115SmrgAC_DEFUN([AM_DEP_TRACK],
20357973f115Smrg[AC_ARG_ENABLE(dependency-tracking,
20367973f115Smrg[  --disable-dependency-tracking  speeds up one-time build
20377973f115Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
20387973f115Smrgif test "x$enable_dependency_tracking" != xno; then
20397973f115Smrg  am_depcomp="$ac_aux_dir/depcomp"
20407973f115Smrg  AMDEPBACKSLASH='\'
2041dd519f38Smrgfi
20427973f115SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
20437973f115SmrgAC_SUBST([AMDEPBACKSLASH])dnl
20447973f115Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
20457973f115Smrg])
2046dd519f38Smrg
20477973f115Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
2048dd519f38Smrg
20497973f115Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
20507973f115Smrg# Free Software Foundation, Inc.
2051dd519f38Smrg#
20527973f115Smrg# This file is free software; the Free Software Foundation
20537973f115Smrg# gives unlimited permission to copy and/or distribute it,
20547973f115Smrg# with or without modifications, as long as this notice is preserved.
2055dd519f38Smrg
20567973f115Smrg#serial 5
2057dd519f38Smrg
20587973f115Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
20597973f115Smrg# ------------------------------
20607973f115SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
20617973f115Smrg[{
20627973f115Smrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
20637973f115Smrg  # are listed without --file.  Let's play safe and only enable the eval
20647973f115Smrg  # if we detect the quoting.
20657973f115Smrg  case $CONFIG_FILES in
20667973f115Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
20677973f115Smrg  *)   set x $CONFIG_FILES ;;
20687973f115Smrg  esac
20697973f115Smrg  shift
20707973f115Smrg  for mf
20717973f115Smrg  do
20727973f115Smrg    # Strip MF so we end up with the name of the file.
20737973f115Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
20747973f115Smrg    # Check whether this is an Automake generated Makefile or not.
20757973f115Smrg    # We used to match only the files named `Makefile.in', but
20767973f115Smrg    # some people rename them; so instead we look at the file content.
20777973f115Smrg    # Grep'ing the first line is not enough: some people post-process
20787973f115Smrg    # each Makefile.in and add a new line on top of each file to say so.
20797973f115Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
20807973f115Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
20817973f115Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
20827973f115Smrg      dirpart=`AS_DIRNAME("$mf")`
20837973f115Smrg    else
20847973f115Smrg      continue
20857973f115Smrg    fi
20867973f115Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
20877973f115Smrg    # from the Makefile without running `make'.
20887973f115Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
20897973f115Smrg    test -z "$DEPDIR" && continue
20907973f115Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
20917973f115Smrg    test -z "am__include" && continue
20927973f115Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
20937973f115Smrg    # When using ansi2knr, U may be empty or an underscore; expand it
20947973f115Smrg    U=`sed -n 's/^U = //p' < "$mf"`
20957973f115Smrg    # Find all dependency output files, they are included files with
20967973f115Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
20977973f115Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
20987973f115Smrg    # expansion.
20997973f115Smrg    for file in `sed -n "
21007973f115Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
21017973f115Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
21027973f115Smrg      # Make sure the directory exists.
21037973f115Smrg      test -f "$dirpart/$file" && continue
21047973f115Smrg      fdir=`AS_DIRNAME(["$file"])`
21057973f115Smrg      AS_MKDIR_P([$dirpart/$fdir])
21067973f115Smrg      # echo "creating $dirpart/$file"
21077973f115Smrg      echo '# dummy' > "$dirpart/$file"
21087973f115Smrg    done
21097973f115Smrg  done
21107973f115Smrg}
21117973f115Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
2112dd519f38Smrg
2113dd519f38Smrg
21147973f115Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
21157973f115Smrg# -----------------------------
21167973f115Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
21177973f115Smrg#
21187973f115Smrg# This code is only required when automatic dependency tracking
21197973f115Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
21207973f115Smrg# need in order to bootstrap the dependency handling code.
21217973f115SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
21227973f115Smrg[AC_CONFIG_COMMANDS([depfiles],
21237973f115Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
21247973f115Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
21257973f115Smrg])
2126dd519f38Smrg
21277973f115Smrg# Do all the work for Automake.                             -*- Autoconf -*-
2128dd519f38Smrg
21297973f115Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
21307973f115Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
21317973f115Smrg#
21327973f115Smrg# This file is free software; the Free Software Foundation
21337973f115Smrg# gives unlimited permission to copy and/or distribute it,
21347973f115Smrg# with or without modifications, as long as this notice is preserved.
21357973f115Smrg
21367973f115Smrg# serial 16
2137dd519f38Smrg
21387973f115Smrg# This macro actually does too much.  Some checks are only needed if
21397973f115Smrg# your package does certain things.  But this isn't really a big deal.
2140dd519f38Smrg
21417973f115Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
21427973f115Smrg# AM_INIT_AUTOMAKE([OPTIONS])
21437973f115Smrg# -----------------------------------------------
21447973f115Smrg# The call with PACKAGE and VERSION arguments is the old style
21457973f115Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
21467973f115Smrg# and VERSION should now be passed to AC_INIT and removed from
21477973f115Smrg# the call to AM_INIT_AUTOMAKE.
21487973f115Smrg# We support both call styles for the transition.  After
21497973f115Smrg# the next Automake release, Autoconf can make the AC_INIT
21507973f115Smrg# arguments mandatory, and then we can depend on a new Autoconf
21517973f115Smrg# release and drop the old call support.
21527973f115SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
21537973f115Smrg[AC_PREREQ([2.62])dnl
21547973f115Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
21557973f115Smrgdnl the ones we care about.
21567973f115Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
21577973f115SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
21587973f115SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
21597973f115Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
21607973f115Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
21617973f115Smrg  # is not polluted with repeated "-I."
21627973f115Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
21637973f115Smrg  # test to see if srcdir already configured
21647973f115Smrg  if test -f $srcdir/config.status; then
21657973f115Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
21667973f115Smrg  fi
2167dd519f38Smrgfi
2168ed029a5fSmrg
21697973f115Smrg# test whether we have cygpath
21707973f115Smrgif test -z "$CYGPATH_W"; then
21717973f115Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
21727973f115Smrg    CYGPATH_W='cygpath -w'
21737973f115Smrg  else
21747973f115Smrg    CYGPATH_W=echo
21757973f115Smrg  fi
21767973f115Smrgfi
21777973f115SmrgAC_SUBST([CYGPATH_W])
2178ed029a5fSmrg
21797973f115Smrg# Define the identity of the package.
21807973f115Smrgdnl Distinguish between old-style and new-style calls.
21817973f115Smrgm4_ifval([$2],
21827973f115Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
21837973f115Smrg AC_SUBST([PACKAGE], [$1])dnl
21847973f115Smrg AC_SUBST([VERSION], [$2])],
21857973f115Smrg[_AM_SET_OPTIONS([$1])dnl
21867973f115Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
21877973f115Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
21887973f115Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
21897973f115Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
21907973f115Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
2191ed029a5fSmrg
21927973f115Smrg_AM_IF_OPTION([no-define],,
21937973f115Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
21947973f115Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
2195ed029a5fSmrg
21967973f115Smrg# Some tools Automake needs.
21977973f115SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
21987973f115SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
21997973f115SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
22007973f115SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
22017973f115SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
22027973f115SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
22037973f115SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
22047973f115SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
22057973f115SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
22067973f115SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
22077973f115Smrg# We need awk for the "check" target.  The system "awk" is bad on
22087973f115Smrg# some platforms.
22097973f115SmrgAC_REQUIRE([AC_PROG_AWK])dnl
22107973f115SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
22117973f115SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
22127973f115Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
22137973f115Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
22147973f115Smrg			     [_AM_PROG_TAR([v7])])])
22157973f115Smrg_AM_IF_OPTION([no-dependencies],,
22167973f115Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
22177973f115Smrg		  [_AM_DEPENDENCIES(CC)],
22187973f115Smrg		  [define([AC_PROG_CC],
22197973f115Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
22207973f115SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
22217973f115Smrg		  [_AM_DEPENDENCIES(CXX)],
22227973f115Smrg		  [define([AC_PROG_CXX],
22237973f115Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
22247973f115SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
22257973f115Smrg		  [_AM_DEPENDENCIES(OBJC)],
22267973f115Smrg		  [define([AC_PROG_OBJC],
22277973f115Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
22287973f115Smrg])
22297973f115Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
22307973f115Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
22317973f115Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
22327973f115Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
22337973f115SmrgAC_CONFIG_COMMANDS_PRE(dnl
22347973f115Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
22357973f115Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
22367973f115Smrg])
2237ed029a5fSmrg
22387973f115Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
22397973f115Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
22407973f115Smrgdnl mangled by Autoconf and run in a shell conditional statement.
22417973f115Smrgm4_define([_AC_COMPILER_EXEEXT],
22427973f115Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
22437973f115Smrg
22447973f115Smrg
22457973f115Smrg# When config.status generates a header, we must update the stamp-h file.
22467973f115Smrg# This file resides in the same directory as the config header
22477973f115Smrg# that is generated.  The stamp files are numbered to have different names.
22487973f115Smrg
22497973f115Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
22507973f115Smrg# loop where config.status creates the headers, so we can generate
22517973f115Smrg# our stamp files there.
22527973f115SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
22537973f115Smrg[# Compute $1's index in $config_headers.
22547973f115Smrg_am_arg=$1
22557973f115Smrg_am_stamp_count=1
22567973f115Smrgfor _am_header in $config_headers :; do
22577973f115Smrg  case $_am_header in
22587973f115Smrg    $_am_arg | $_am_arg:* )
22597973f115Smrg      break ;;
22607973f115Smrg    * )
22617973f115Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
22627973f115Smrg  esac
22637973f115Smrgdone
22647973f115Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
22657973f115Smrg
22667973f115Smrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
2267dd519f38Smrg#
22687973f115Smrg# This file is free software; the Free Software Foundation
22697973f115Smrg# gives unlimited permission to copy and/or distribute it,
22707973f115Smrg# with or without modifications, as long as this notice is preserved.
22717973f115Smrg
22727973f115Smrg# AM_PROG_INSTALL_SH
22737973f115Smrg# ------------------
22747973f115Smrg# Define $install_sh.
22757973f115SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
22767973f115Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
22777973f115Smrgif test x"${install_sh}" != xset; then
22787973f115Smrg  case $am_aux_dir in
22797973f115Smrg  *\ * | *\	*)
22807973f115Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
22817973f115Smrg  *)
22827973f115Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
22837973f115Smrg  esac
2284ed029a5fSmrgfi
22857973f115SmrgAC_SUBST(install_sh)])
2286dd519f38Smrg
22877973f115Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
22887973f115Smrg#
22897973f115Smrg# This file is free software; the Free Software Foundation
22907973f115Smrg# gives unlimited permission to copy and/or distribute it,
22917973f115Smrg# with or without modifications, as long as this notice is preserved.
2292dd519f38Smrg
22937973f115Smrg# serial 2
2294dd519f38Smrg
22957973f115Smrg# Check whether the underlying file-system supports filenames
22967973f115Smrg# with a leading dot.  For instance MS-DOS doesn't.
22977973f115SmrgAC_DEFUN([AM_SET_LEADING_DOT],
22987973f115Smrg[rm -rf .tst 2>/dev/null
22997973f115Smrgmkdir .tst 2>/dev/null
23007973f115Smrgif test -d .tst; then
23017973f115Smrg  am__leading_dot=.
23027973f115Smrgelse
23037973f115Smrg  am__leading_dot=_
2304ed029a5fSmrgfi
23057973f115Smrgrmdir .tst 2>/dev/null
23067973f115SmrgAC_SUBST([am__leading_dot])])
2307ed029a5fSmrg
23087973f115Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
23097973f115Smrg# From Jim Meyering
2310ed029a5fSmrg
23117973f115Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
23127973f115Smrg# Free Software Foundation, Inc.
23137973f115Smrg#
23147973f115Smrg# This file is free software; the Free Software Foundation
23157973f115Smrg# gives unlimited permission to copy and/or distribute it,
23167973f115Smrg# with or without modifications, as long as this notice is preserved.
2317ed029a5fSmrg
23187973f115Smrg# serial 5
2319ed029a5fSmrg
23207973f115Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
23217973f115Smrg# ----------------------------------
23227973f115Smrg# Control maintainer-specific portions of Makefiles.
23237973f115Smrg# Default is to disable them, unless `enable' is passed literally.
23247973f115Smrg# For symmetry, `disable' may be passed as well.  Anyway, the user
23257973f115Smrg# can override the default with the --enable/--disable switch.
23267973f115SmrgAC_DEFUN([AM_MAINTAINER_MODE],
23277973f115Smrg[m4_case(m4_default([$1], [disable]),
23287973f115Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
23297973f115Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
23307973f115Smrg       [m4_define([am_maintainer_other], [enable])
23317973f115Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
23327973f115SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
23337973f115Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
23347973f115Smrg  AC_ARG_ENABLE([maintainer-mode],
23357973f115Smrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
23367973f115Smrg			  (and sometimes confusing) to the casual installer],
23377973f115Smrg      [USE_MAINTAINER_MODE=$enableval],
23387973f115Smrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
23397973f115Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
23407973f115Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
23417973f115Smrg  MAINT=$MAINTAINER_MODE_TRUE
23427973f115Smrg  AC_SUBST([MAINT])dnl
23437973f115Smrg]
23447973f115Smrg)
2345ed029a5fSmrg
23467973f115SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
2347ed029a5fSmrg
23487973f115Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
23497973f115Smrg
23507973f115Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
2351dd519f38Smrg#
23527973f115Smrg# This file is free software; the Free Software Foundation
23537973f115Smrg# gives unlimited permission to copy and/or distribute it,
23547973f115Smrg# with or without modifications, as long as this notice is preserved.
2355dd519f38Smrg
23567973f115Smrg# serial 4
2357ed029a5fSmrg
23587973f115Smrg# AM_MAKE_INCLUDE()
23597973f115Smrg# -----------------
23607973f115Smrg# Check to see how make treats includes.
23617973f115SmrgAC_DEFUN([AM_MAKE_INCLUDE],
23627973f115Smrg[am_make=${MAKE-make}
23637973f115Smrgcat > confinc << 'END'
23647973f115Smrgam__doit:
23657973f115Smrg	@echo this is the am__doit target
23667973f115Smrg.PHONY: am__doit
23677973f115SmrgEND
23687973f115Smrg# If we don't find an include directive, just comment out the code.
23697973f115SmrgAC_MSG_CHECKING([for style of include used by $am_make])
23707973f115Smrgam__include="#"
23717973f115Smrgam__quote=
23727973f115Smrg_am_result=none
23737973f115Smrg# First try GNU make style include.
23747973f115Smrgecho "include confinc" > confmf
23757973f115Smrg# Ignore all kinds of additional output from `make'.
23767973f115Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
23777973f115Smrg*the\ am__doit\ target*)
23787973f115Smrg  am__include=include
23797973f115Smrg  am__quote=
23807973f115Smrg  _am_result=GNU
23817973f115Smrg  ;;
23827973f115Smrgesac
23837973f115Smrg# Now try BSD make style include.
23847973f115Smrgif test "$am__include" = "#"; then
23857973f115Smrg   echo '.include "confinc"' > confmf
23867973f115Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
23877973f115Smrg   *the\ am__doit\ target*)
23887973f115Smrg     am__include=.include
23897973f115Smrg     am__quote="\""
23907973f115Smrg     _am_result=BSD
23917973f115Smrg     ;;
23927973f115Smrg   esac
2393dd519f38Smrgfi
23947973f115SmrgAC_SUBST([am__include])
23957973f115SmrgAC_SUBST([am__quote])
23967973f115SmrgAC_MSG_RESULT([$_am_result])
23977973f115Smrgrm -f confinc confmf
23987973f115Smrg])
2399ed029a5fSmrg
24007973f115Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
2401dd519f38Smrg
24027973f115Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
24037973f115Smrg# Free Software Foundation, Inc.
2404dd519f38Smrg#
24057973f115Smrg# This file is free software; the Free Software Foundation
24067973f115Smrg# gives unlimited permission to copy and/or distribute it,
24077973f115Smrg# with or without modifications, as long as this notice is preserved.
2408ed029a5fSmrg
24097973f115Smrg# serial 6
2410ed029a5fSmrg
24117973f115Smrg# AM_MISSING_PROG(NAME, PROGRAM)
24127973f115Smrg# ------------------------------
24137973f115SmrgAC_DEFUN([AM_MISSING_PROG],
24147973f115Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
24157973f115Smrg$1=${$1-"${am_missing_run}$2"}
24167973f115SmrgAC_SUBST($1)])
2417ed029a5fSmrg
2418ed029a5fSmrg
24197973f115Smrg# AM_MISSING_HAS_RUN
24207973f115Smrg# ------------------
24217973f115Smrg# Define MISSING if not defined so far and test if it supports --run.
24227973f115Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
24237973f115SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
24247973f115Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
24257973f115SmrgAC_REQUIRE_AUX_FILE([missing])dnl
24267973f115Smrgif test x"${MISSING+set}" != xset; then
24277973f115Smrg  case $am_aux_dir in
24287973f115Smrg  *\ * | *\	*)
24297973f115Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
24307973f115Smrg  *)
24317973f115Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
24327973f115Smrg  esac
2433dd519f38Smrgfi
24347973f115Smrg# Use eval to expand $SHELL
24357973f115Smrgif eval "$MISSING --run true"; then
24367973f115Smrg  am_missing_run="$MISSING --run "
24377973f115Smrgelse
24387973f115Smrg  am_missing_run=
24397973f115Smrg  AC_MSG_WARN([`missing' script is too old or missing])
24407973f115Smrgfi
24417973f115Smrg])
2442ed029a5fSmrg
24437973f115Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
24447973f115Smrg#
24457973f115Smrg# This file is free software; the Free Software Foundation
24467973f115Smrg# gives unlimited permission to copy and/or distribute it,
24477973f115Smrg# with or without modifications, as long as this notice is preserved.
2448ed029a5fSmrg
24497973f115Smrg# AM_PROG_MKDIR_P
2450dd519f38Smrg# ---------------
24517973f115Smrg# Check for `mkdir -p'.
24527973f115SmrgAC_DEFUN([AM_PROG_MKDIR_P],
24537973f115Smrg[AC_PREREQ([2.60])dnl
24547973f115SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
24557973f115Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
24567973f115Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
24577973f115Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
24587973f115Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
24597973f115Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
24607973f115Smrgdnl adjustment using top_builddir (which is defined more often than
24617973f115Smrgdnl MKDIR_P).
24627973f115SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
24637973f115Smrgcase $mkdir_p in
24647973f115Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
24657973f115Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
24667973f115Smrgesac
24677973f115Smrg])
24687973f115Smrg
24697973f115Smrg# Helper functions for option handling.                     -*- Autoconf -*-
24707973f115Smrg
24717973f115Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
2472dd519f38Smrg#
24737973f115Smrg# This file is free software; the Free Software Foundation
24747973f115Smrg# gives unlimited permission to copy and/or distribute it,
24757973f115Smrg# with or without modifications, as long as this notice is preserved.
2476ed029a5fSmrg
24777973f115Smrg# serial 4
24787973f115Smrg
24797973f115Smrg# _AM_MANGLE_OPTION(NAME)
2480dd519f38Smrg# -----------------------
24817973f115SmrgAC_DEFUN([_AM_MANGLE_OPTION],
24827973f115Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
2483dd519f38Smrg
24847973f115Smrg# _AM_SET_OPTION(NAME)
24857973f115Smrg# ------------------------------
24867973f115Smrg# Set option NAME.  Presently that only means defining a flag for this option.
24877973f115SmrgAC_DEFUN([_AM_SET_OPTION],
24887973f115Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
2489ed029a5fSmrg
24907973f115Smrg# _AM_SET_OPTIONS(OPTIONS)
24917973f115Smrg# ----------------------------------
24927973f115Smrg# OPTIONS is a space-separated list of Automake options.
24937973f115SmrgAC_DEFUN([_AM_SET_OPTIONS],
24947973f115Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
2495dd519f38Smrg
24967973f115Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
24977973f115Smrg# -------------------------------------------
24987973f115Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
24997973f115SmrgAC_DEFUN([_AM_IF_OPTION],
25007973f115Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
2501dd519f38Smrg
25027973f115Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
2503ed029a5fSmrg
25047973f115Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
25057973f115Smrg# Free Software Foundation, Inc.
2506ed029a5fSmrg#
25077973f115Smrg# This file is free software; the Free Software Foundation
25087973f115Smrg# gives unlimited permission to copy and/or distribute it,
25097973f115Smrg# with or without modifications, as long as this notice is preserved.
2510ed029a5fSmrg
25117973f115Smrg# serial 5
25127973f115Smrg
25137973f115Smrg# AM_SANITY_CHECK
25147973f115Smrg# ---------------
25157973f115SmrgAC_DEFUN([AM_SANITY_CHECK],
25167973f115Smrg[AC_MSG_CHECKING([whether build environment is sane])
25177973f115Smrg# Just in case
25187973f115Smrgsleep 1
25197973f115Smrgecho timestamp > conftest.file
25207973f115Smrg# Reject unsafe characters in $srcdir or the absolute working directory
25217973f115Smrg# name.  Accept space and tab only in the latter.
25227973f115Smrgam_lf='
25237973f115Smrg'
25247973f115Smrgcase `pwd` in
25257973f115Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
25267973f115Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
25277973f115Smrgesac
25287973f115Smrgcase $srcdir in
25297973f115Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
25307973f115Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
25317973f115Smrgesac
25327973f115Smrg
25337973f115Smrg# Do `set' in a subshell so we don't clobber the current shell's
25347973f115Smrg# arguments.  Must try -L first in case configure is actually a
25357973f115Smrg# symlink; some systems play weird games with the mod time of symlinks
25367973f115Smrg# (eg FreeBSD returns the mod time of the symlink's containing
25377973f115Smrg# directory).
25387973f115Smrgif (
25397973f115Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
25407973f115Smrg   if test "$[*]" = "X"; then
25417973f115Smrg      # -L didn't work.
25427973f115Smrg      set X `ls -t "$srcdir/configure" conftest.file`
25437973f115Smrg   fi
25447973f115Smrg   rm -f conftest.file
25457973f115Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
25467973f115Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
25477973f115Smrg
25487973f115Smrg      # If neither matched, then we have a broken ls.  This can happen
25497973f115Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
25507973f115Smrg      # broken ls alias from the environment.  This has actually
25517973f115Smrg      # happened.  Such a system could not be considered "sane".
25527973f115Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
25537973f115Smrgalias in your environment])
25547973f115Smrg   fi
25557973f115Smrg
25567973f115Smrg   test "$[2]" = conftest.file
25577973f115Smrg   )
25587973f115Smrgthen
25597973f115Smrg   # Ok.
25607973f115Smrg   :
25617973f115Smrgelse
25627973f115Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
25637973f115SmrgCheck your system clock])
2564ed029a5fSmrgfi
25657973f115SmrgAC_MSG_RESULT(yes)])
2566ed029a5fSmrg
25677973f115Smrg# Copyright (C) 2009  Free Software Foundation, Inc.
2568ed029a5fSmrg#
25697973f115Smrg# This file is free software; the Free Software Foundation
25707973f115Smrg# gives unlimited permission to copy and/or distribute it,
25717973f115Smrg# with or without modifications, as long as this notice is preserved.
2572ed029a5fSmrg
25737973f115Smrg# serial 1
2574ed029a5fSmrg
25757973f115Smrg# AM_SILENT_RULES([DEFAULT])
25767973f115Smrg# --------------------------
25777973f115Smrg# Enable less verbose build rules; with the default set to DEFAULT
25787973f115Smrg# (`yes' being less verbose, `no' or empty being verbose).
25797973f115SmrgAC_DEFUN([AM_SILENT_RULES],
25807973f115Smrg[AC_ARG_ENABLE([silent-rules],
25817973f115Smrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
25827973f115Smrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
25837973f115Smrgcase $enable_silent_rules in
25847973f115Smrgyes) AM_DEFAULT_VERBOSITY=0;;
25857973f115Smrgno)  AM_DEFAULT_VERBOSITY=1;;
25867973f115Smrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
25877973f115Smrgesac
25887973f115SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
25897973f115SmrgAM_BACKSLASH='\'
25907973f115SmrgAC_SUBST([AM_BACKSLASH])dnl
25917973f115Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
25927973f115Smrg])
2593ed029a5fSmrg
25947973f115Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
25957973f115Smrg#
25967973f115Smrg# This file is free software; the Free Software Foundation
25977973f115Smrg# gives unlimited permission to copy and/or distribute it,
25987973f115Smrg# with or without modifications, as long as this notice is preserved.
2599ed029a5fSmrg
26007973f115Smrg# AM_PROG_INSTALL_STRIP
26017973f115Smrg# ---------------------
26027973f115Smrg# One issue with vendor `install' (even GNU) is that you can't
26037973f115Smrg# specify the program used to strip binaries.  This is especially
26047973f115Smrg# annoying in cross-compiling environments, where the build's strip
26057973f115Smrg# is unlikely to handle the host's binaries.
26067973f115Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
26077973f115Smrg# always use install-sh in `make install-strip', and initialize
26087973f115Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
26097973f115SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
26107973f115Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
26117973f115Smrg# Installed binaries are usually stripped using `strip' when the user
26127973f115Smrg# run `make install-strip'.  However `strip' might not be the right
26137973f115Smrg# tool to use in cross-compilation environments, therefore Automake
26147973f115Smrg# will honor the `STRIP' environment variable to overrule this program.
26157973f115Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
26167973f115Smrgif test "$cross_compiling" != no; then
26177973f115Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
26187973f115Smrgfi
26197973f115SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
26207973f115SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
2621ed029a5fSmrg
26227973f115Smrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
2623ed029a5fSmrg#
26247973f115Smrg# This file is free software; the Free Software Foundation
26257973f115Smrg# gives unlimited permission to copy and/or distribute it,
26267973f115Smrg# with or without modifications, as long as this notice is preserved.
2627ed029a5fSmrg
26287973f115Smrg# serial 2
2629ed029a5fSmrg
26307973f115Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
26317973f115Smrg# ---------------------------
26327973f115Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
26337973f115Smrg# This macro is traced by Automake.
26347973f115SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
2635ed029a5fSmrg
26367973f115Smrg# AM_SUBST_NOTMAKE(VARIABLE)
26377973f115Smrg# ---------------------------
26387973f115Smrg# Public sister of _AM_SUBST_NOTMAKE.
26397973f115SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
2640ed029a5fSmrg
26417973f115Smrg# Check how to create a tarball.                            -*- Autoconf -*-
2642ed029a5fSmrg
26437973f115Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
26447973f115Smrg#
26457973f115Smrg# This file is free software; the Free Software Foundation
26467973f115Smrg# gives unlimited permission to copy and/or distribute it,
26477973f115Smrg# with or without modifications, as long as this notice is preserved.
2648ed029a5fSmrg
26497973f115Smrg# serial 2
2650ed029a5fSmrg
26517973f115Smrg# _AM_PROG_TAR(FORMAT)
26527973f115Smrg# --------------------
26537973f115Smrg# Check how to create a tarball in format FORMAT.
26547973f115Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
26557973f115Smrg#
26567973f115Smrg# Substitute a variable $(am__tar) that is a command
26577973f115Smrg# writing to stdout a FORMAT-tarball containing the directory
26587973f115Smrg# $tardir.
26597973f115Smrg#     tardir=directory && $(am__tar) > result.tar
26607973f115Smrg#
26617973f115Smrg# Substitute a variable $(am__untar) that extract such
26627973f115Smrg# a tarball read from stdin.
26637973f115Smrg#     $(am__untar) < result.tar
26647973f115SmrgAC_DEFUN([_AM_PROG_TAR],
26657973f115Smrg[# Always define AMTAR for backward compatibility.
26667973f115SmrgAM_MISSING_PROG([AMTAR], [tar])
26677973f115Smrgm4_if([$1], [v7],
26687973f115Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
26697973f115Smrg     [m4_case([$1], [ustar],, [pax],,
26707973f115Smrg              [m4_fatal([Unknown tar format])])
26717973f115SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
26727973f115Smrg# Loop over all known methods to create a tar archive until one works.
26737973f115Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
26747973f115Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
26757973f115Smrg# Do not fold the above two line into one, because Tru64 sh and
26767973f115Smrg# Solaris sh will not grok spaces in the rhs of `-'.
26777973f115Smrgfor _am_tool in $_am_tools
26787973f115Smrgdo
26797973f115Smrg  case $_am_tool in
26807973f115Smrg  gnutar)
26817973f115Smrg    for _am_tar in tar gnutar gtar;
26827973f115Smrg    do
26837973f115Smrg      AM_RUN_LOG([$_am_tar --version]) && break
26847973f115Smrg    done
26857973f115Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
26867973f115Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
26877973f115Smrg    am__untar="$_am_tar -xf -"
26887973f115Smrg    ;;
26897973f115Smrg  plaintar)
26907973f115Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
26917973f115Smrg    # ustar tarball either.
26927973f115Smrg    (tar --version) >/dev/null 2>&1 && continue
26937973f115Smrg    am__tar='tar chf - "$$tardir"'
26947973f115Smrg    am__tar_='tar chf - "$tardir"'
26957973f115Smrg    am__untar='tar xf -'
26967973f115Smrg    ;;
26977973f115Smrg  pax)
26987973f115Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
26997973f115Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
27007973f115Smrg    am__untar='pax -r'
27017973f115Smrg    ;;
27027973f115Smrg  cpio)
27037973f115Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
27047973f115Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
27057973f115Smrg    am__untar='cpio -i -H $1 -d'
27067973f115Smrg    ;;
27077973f115Smrg  none)
27087973f115Smrg    am__tar=false
27097973f115Smrg    am__tar_=false
27107973f115Smrg    am__untar=false
27117973f115Smrg    ;;
27127973f115Smrg  esac
2713ed029a5fSmrg
27147973f115Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
27157973f115Smrg  # and am__untar set.
27167973f115Smrg  test -n "${am_cv_prog_tar_$1}" && break
2717ed029a5fSmrg
27187973f115Smrg  # tar/untar a dummy directory, and stop if the command works
27197973f115Smrg  rm -rf conftest.dir
27207973f115Smrg  mkdir conftest.dir
27217973f115Smrg  echo GrepMe > conftest.dir/file
27227973f115Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
27237973f115Smrg  rm -rf conftest.dir
27247973f115Smrg  if test -s conftest.tar; then
27257973f115Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
27267973f115Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
27277973f115Smrg  fi
27287973f115Smrgdone
27297973f115Smrgrm -rf conftest.dir
2730ed029a5fSmrg
27317973f115SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
27327973f115SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
27337973f115SmrgAC_SUBST([am__tar])
27347973f115SmrgAC_SUBST([am__untar])
27357973f115Smrg]) # _AM_PROG_TAR
2736ed029a5fSmrg
2737