aclocal.m4 revision ce6676db
1ce6676dbSmrg# generated automatically by aclocal 1.10 -*- Autoconf -*-
2bbe1b32bSmrg
3bbe1b32bSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4ce6676dbSmrg# 2005, 2006  Free Software Foundation, Inc.
5bbe1b32bSmrg# This file is free software; the Free Software Foundation
6bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
7bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
8bbe1b32bSmrg
9bbe1b32bSmrg# This program is distributed in the hope that it will be useful,
10bbe1b32bSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11bbe1b32bSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12bbe1b32bSmrg# PARTICULAR PURPOSE.
13bbe1b32bSmrg
14ce6676dbSmrgm4_if(m4_PACKAGE_VERSION, [2.61],,
15ce6676dbSmrg[m4_fatal([this file was generated for autoconf 2.61.
16ce6676dbSmrgYou have another version of autoconf.  If you want to use that,
17ce6676dbSmrgyou should regenerate the build system entirely.], [63])])
18bbe1b32bSmrg
19ce6676dbSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
20bbe1b32bSmrgdnl
21bbe1b32bSmrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
22bbe1b32bSmrgdnl 
23bbe1b32bSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
24bbe1b32bSmrgdnl copy of this software and associated documentation files (the
25bbe1b32bSmrgdnl "Software"), to deal in the Software without restriction, including
26bbe1b32bSmrgdnl without limitation the rights to use, copy, modify, merge, publish,
27bbe1b32bSmrgdnl distribute, and/or sell copies of the Software, and to permit persons
28bbe1b32bSmrgdnl to whom the Software is furnished to do so, provided that the above
29bbe1b32bSmrgdnl copyright notice(s) and this permission notice appear in all copies of
30bbe1b32bSmrgdnl the Software and that both the above copyright notice(s) and this
31bbe1b32bSmrgdnl permission notice appear in supporting documentation.
32bbe1b32bSmrgdnl
33bbe1b32bSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
34bbe1b32bSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
35bbe1b32bSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
36bbe1b32bSmrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
37bbe1b32bSmrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
38bbe1b32bSmrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
39bbe1b32bSmrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
40bbe1b32bSmrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
41bbe1b32bSmrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
42bbe1b32bSmrgdnl
43bbe1b32bSmrgdnl Except as contained in this notice, the name of a copyright holder
44bbe1b32bSmrgdnl shall not be used in advertising or otherwise to promote the sale, use
45bbe1b32bSmrgdnl or other dealings in this Software without prior written authorization
46bbe1b32bSmrgdnl of the copyright holder.
47bbe1b32bSmrg
48bbe1b32bSmrg# XORG_MACROS_VERSION(required-version)
49bbe1b32bSmrg# -------------------------------------
50bbe1b32bSmrg# Minimum version: 1.1.0
51bbe1b32bSmrg#
52bbe1b32bSmrg# If you're using a macro added in Version 1.1 or newer, include this in
53bbe1b32bSmrg# your configure.ac with the minimum required version, such as:
54bbe1b32bSmrg# XORG_MACROS_VERSION(1.1)
55bbe1b32bSmrg#
56bbe1b32bSmrg# To force at least a version with this macro defined, also add:
57bbe1b32bSmrg# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
58bbe1b32bSmrg#
59bbe1b32bSmrg#
60bbe1b32bSmrg# See the "minimum version" comment for each macro you use to see what 
61bbe1b32bSmrg# version you require.
62bbe1b32bSmrgAC_DEFUN([XORG_MACROS_VERSION],[
63bbe1b32bSmrg	[XORG_MACROS_needed_version=$1
64bbe1b32bSmrg	XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
65bbe1b32bSmrg	XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
66bbe1b32bSmrg	AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
67ce6676dbSmrg	[XORG_MACROS_version=1.2.1
68bbe1b32bSmrg	XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
69bbe1b32bSmrg	XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
70bbe1b32bSmrg	if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
71bbe1b32bSmrg		AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x])
72bbe1b32bSmrg	fi
73bbe1b32bSmrg	if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
74bbe1b32bSmrg		AC_MSG_ERROR([configure built with too old of a version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.${XORG_MACROS_minor}.0 or newer])
75bbe1b32bSmrg	fi
76bbe1b32bSmrg	AC_MSG_RESULT([yes, $XORG_MACROS_version])
77bbe1b32bSmrg]) # XORG_MACROS_VERSION
78bbe1b32bSmrg
79bbe1b32bSmrg# XORG_PROG_RAWCPP()
80bbe1b32bSmrg# ------------------
81bbe1b32bSmrg# Minimum version: 1.0.0
82bbe1b32bSmrg#
83bbe1b32bSmrg# Find cpp program and necessary flags for use in pre-processing text files
84bbe1b32bSmrg# such as man pages and config files
85bbe1b32bSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
86bbe1b32bSmrgAC_REQUIRE([AC_PROG_CPP])
87bbe1b32bSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
88bbe1b32bSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
89bbe1b32bSmrg
90bbe1b32bSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
91bbe1b32bSmrg# which is not the best choice for supporting other OS'es, but covers most
92bbe1b32bSmrg# of the ones we need for now.
93bbe1b32bSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
94bbe1b32bSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
95bbe1b32bSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
96bbe1b32bSmrg	AC_MSG_RESULT([no])
97bbe1b32bSmrgelse
98bbe1b32bSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
99bbe1b32bSmrg		RAWCPPFLAGS=-undef
100bbe1b32bSmrg		AC_MSG_RESULT([yes])
101ce6676dbSmrg	# under Cygwin unix is still defined even with -undef
102ce6676dbSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
103ce6676dbSmrg		RAWCPPFLAGS="-undef -ansi"
104ce6676dbSmrg		AC_MSG_RESULT([yes, with -ansi])
105bbe1b32bSmrg	else
106bbe1b32bSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
107bbe1b32bSmrg	fi
108bbe1b32bSmrgfi
109bbe1b32bSmrgrm -f conftest.$ac_ext
110bbe1b32bSmrg
111bbe1b32bSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
112bbe1b32bSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
113bbe1b32bSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
114bbe1b32bSmrg	AC_MSG_RESULT([no])
115bbe1b32bSmrgelse
116bbe1b32bSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
117bbe1b32bSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
118bbe1b32bSmrg		AC_MSG_RESULT([yes])
119bbe1b32bSmrg	else
120bbe1b32bSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
121bbe1b32bSmrg	fi
122bbe1b32bSmrgfi
123bbe1b32bSmrgrm -f conftest.$ac_ext
124bbe1b32bSmrgAC_SUBST(RAWCPPFLAGS)
125bbe1b32bSmrg]) # XORG_PROG_RAWCPP
126bbe1b32bSmrg
127bbe1b32bSmrg# XORG_MANPAGE_SECTIONS()
128bbe1b32bSmrg# -----------------------
129bbe1b32bSmrg# Minimum version: 1.0.0
130bbe1b32bSmrg#
131bbe1b32bSmrg# Determine which sections man pages go in for the different man page types
132bbe1b32bSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
133bbe1b32bSmrg# Not sure if there's any better way than just hardcoding by OS name.
134bbe1b32bSmrg# Override default settings by setting environment variables
135bbe1b32bSmrg
136bbe1b32bSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
137bbe1b32bSmrgAC_REQUIRE([AC_CANONICAL_HOST])
138bbe1b32bSmrg
139bbe1b32bSmrgif test x$APP_MAN_SUFFIX = x    ; then
140bbe1b32bSmrg    APP_MAN_SUFFIX=1
141bbe1b32bSmrgfi
142bbe1b32bSmrgif test x$APP_MAN_DIR = x    ; then
143bbe1b32bSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
144bbe1b32bSmrgfi
145bbe1b32bSmrg
146bbe1b32bSmrgif test x$LIB_MAN_SUFFIX = x    ; then
147bbe1b32bSmrg    LIB_MAN_SUFFIX=3
148bbe1b32bSmrgfi
149bbe1b32bSmrgif test x$LIB_MAN_DIR = x    ; then
150bbe1b32bSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
151bbe1b32bSmrgfi
152bbe1b32bSmrg
153bbe1b32bSmrgif test x$FILE_MAN_SUFFIX = x    ; then
154bbe1b32bSmrg    case $host_os in
155bbe1b32bSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
156bbe1b32bSmrg	*)		FILE_MAN_SUFFIX=5  ;;
157bbe1b32bSmrg    esac
158bbe1b32bSmrgfi
159bbe1b32bSmrgif test x$FILE_MAN_DIR = x    ; then
160bbe1b32bSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
161bbe1b32bSmrgfi
162bbe1b32bSmrg
163bbe1b32bSmrgif test x$MISC_MAN_SUFFIX = x    ; then
164bbe1b32bSmrg    case $host_os in
165bbe1b32bSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
166bbe1b32bSmrg	*)		MISC_MAN_SUFFIX=7  ;;
167bbe1b32bSmrg    esac
168bbe1b32bSmrgfi
169bbe1b32bSmrgif test x$MISC_MAN_DIR = x    ; then
170bbe1b32bSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
171bbe1b32bSmrgfi
172bbe1b32bSmrg
173bbe1b32bSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
174bbe1b32bSmrg    case $host_os in
175bbe1b32bSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
176bbe1b32bSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
177bbe1b32bSmrg    esac
178bbe1b32bSmrgfi
179bbe1b32bSmrgif test x$DRIVER_MAN_DIR = x    ; then
180bbe1b32bSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
181bbe1b32bSmrgfi
182bbe1b32bSmrg
183bbe1b32bSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
184bbe1b32bSmrg    case $host_os in
185bbe1b32bSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
186bbe1b32bSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
187bbe1b32bSmrg    esac
188bbe1b32bSmrgfi
189bbe1b32bSmrgif test x$ADMIN_MAN_DIR = x    ; then
190bbe1b32bSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
191bbe1b32bSmrgfi
192bbe1b32bSmrg
193bbe1b32bSmrg
194bbe1b32bSmrgAC_SUBST([APP_MAN_SUFFIX])
195bbe1b32bSmrgAC_SUBST([LIB_MAN_SUFFIX])
196bbe1b32bSmrgAC_SUBST([FILE_MAN_SUFFIX])
197bbe1b32bSmrgAC_SUBST([MISC_MAN_SUFFIX])
198bbe1b32bSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
199bbe1b32bSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
200bbe1b32bSmrgAC_SUBST([APP_MAN_DIR])
201bbe1b32bSmrgAC_SUBST([LIB_MAN_DIR])
202bbe1b32bSmrgAC_SUBST([FILE_MAN_DIR])
203bbe1b32bSmrgAC_SUBST([MISC_MAN_DIR])
204bbe1b32bSmrgAC_SUBST([DRIVER_MAN_DIR])
205bbe1b32bSmrgAC_SUBST([ADMIN_MAN_DIR])
206bbe1b32bSmrg]) # XORG_MANPAGE_SECTIONS
207bbe1b32bSmrg
208bbe1b32bSmrg# XORG_CHECK_LINUXDOC
209bbe1b32bSmrg# -------------------
210bbe1b32bSmrg# Minimum version: 1.0.0
211bbe1b32bSmrg#
212bbe1b32bSmrg# Defines the variable MAKE_TEXT if the necessary tools and
213bbe1b32bSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
214bbe1b32bSmrg# Whether or not the necessary tools and files are found can be checked
215bbe1b32bSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
216bbe1b32bSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
217ce6676dbSmrgif test x$XORG_SGML_PATH = x ; then
218ce6676dbSmrg    XORG_SGML_PATH=$prefix/share/sgml
219ce6676dbSmrgfi
220bbe1b32bSmrgHAVE_DEFS_ENT=
221bbe1b32bSmrg
222bbe1b32bSmrgif test x"$cross_compiling" = x"yes" ; then
223bbe1b32bSmrg  HAVE_DEFS_ENT=no
224bbe1b32bSmrgelse
225bbe1b32bSmrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
226bbe1b32bSmrgfi
227bbe1b32bSmrg
228bbe1b32bSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
229bbe1b32bSmrgAC_PATH_PROG(PS2PDF, ps2pdf)
230bbe1b32bSmrg
231bbe1b32bSmrgAC_MSG_CHECKING([Whether to build documentation])
232bbe1b32bSmrg
233bbe1b32bSmrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
234bbe1b32bSmrg   BUILDDOC=yes
235bbe1b32bSmrgelse
236bbe1b32bSmrg   BUILDDOC=no
237bbe1b32bSmrgfi
238bbe1b32bSmrg
239bbe1b32bSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
240bbe1b32bSmrg
241bbe1b32bSmrgAC_MSG_RESULT([$BUILDDOC])
242bbe1b32bSmrg
243bbe1b32bSmrgAC_MSG_CHECKING([Whether to build pdf documentation])
244bbe1b32bSmrg
245bbe1b32bSmrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
246bbe1b32bSmrg   BUILDPDFDOC=yes
247bbe1b32bSmrgelse
248bbe1b32bSmrg   BUILDPDFDOC=no
249bbe1b32bSmrgfi
250bbe1b32bSmrg
251bbe1b32bSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
252bbe1b32bSmrg
253bbe1b32bSmrgAC_MSG_RESULT([$BUILDPDFDOC])
254bbe1b32bSmrg
255bbe1b32bSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
256bbe1b32bSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
257bbe1b32bSmrgMAKE_PDF="$PS2PDF"
258bbe1b32bSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
259bbe1b32bSmrg
260bbe1b32bSmrgAC_SUBST(MAKE_TEXT)
261bbe1b32bSmrgAC_SUBST(MAKE_PS)
262bbe1b32bSmrgAC_SUBST(MAKE_PDF)
263bbe1b32bSmrgAC_SUBST(MAKE_HTML)
264bbe1b32bSmrg]) # XORG_CHECK_LINUXDOC
265bbe1b32bSmrg
266bbe1b32bSmrg# XORG_CHECK_DOCBOOK
267bbe1b32bSmrg# -------------------
268bbe1b32bSmrg# Minimum version: 1.0.0
269bbe1b32bSmrg#
270bbe1b32bSmrg# Checks for the ability to build output formats from SGML DocBook source.
271bbe1b32bSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
272bbe1b32bSmrg# indicates whether the necessary tools and files are found and, if set,
273bbe1b32bSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
274bbe1b32bSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
275ce6676dbSmrgif test x$XORG_SGML_PATH = x ; then
276ce6676dbSmrg    XORG_SGML_PATH=$prefix/share/sgml
277ce6676dbSmrgfi
278bbe1b32bSmrgHAVE_DEFS_ENT=
279bbe1b32bSmrgBUILDTXTDOC=no
280bbe1b32bSmrgBUILDPDFDOC=no
281bbe1b32bSmrgBUILDPSDOC=no
282bbe1b32bSmrgBUILDHTMLDOC=no
283bbe1b32bSmrg
284bbe1b32bSmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
285bbe1b32bSmrg
286bbe1b32bSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
287bbe1b32bSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
288bbe1b32bSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
289bbe1b32bSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
290bbe1b32bSmrg
291bbe1b32bSmrgAC_MSG_CHECKING([Whether to build text documentation])
292bbe1b32bSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
293bbe1b32bSmrg   test x$BUILD_TXTDOC != xno; then
294bbe1b32bSmrg	BUILDTXTDOC=yes
295bbe1b32bSmrgfi
296bbe1b32bSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
297bbe1b32bSmrgAC_MSG_RESULT([$BUILDTXTDOC])
298bbe1b32bSmrg
299bbe1b32bSmrgAC_MSG_CHECKING([Whether to build PDF documentation])
300bbe1b32bSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
301bbe1b32bSmrg   test x$BUILD_PDFDOC != xno; then
302bbe1b32bSmrg	BUILDPDFDOC=yes
303bbe1b32bSmrgfi
304bbe1b32bSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
305bbe1b32bSmrgAC_MSG_RESULT([$BUILDPDFDOC])
306bbe1b32bSmrg
307bbe1b32bSmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
308bbe1b32bSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
309bbe1b32bSmrg   test x$BUILD_PSDOC != xno; then
310bbe1b32bSmrg	BUILDPSDOC=yes
311bbe1b32bSmrgfi
312bbe1b32bSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
313bbe1b32bSmrgAC_MSG_RESULT([$BUILDPSDOC])
314bbe1b32bSmrg
315bbe1b32bSmrgAC_MSG_CHECKING([Whether to build HTML documentation])
316bbe1b32bSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
317bbe1b32bSmrg   test x$BUILD_HTMLDOC != xno; then
318bbe1b32bSmrg	BUILDHTMLDOC=yes
319bbe1b32bSmrgfi
320bbe1b32bSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
321bbe1b32bSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
322bbe1b32bSmrg
323bbe1b32bSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
324bbe1b32bSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
325bbe1b32bSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
326bbe1b32bSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
327bbe1b32bSmrg
328bbe1b32bSmrgAC_SUBST(MAKE_TEXT)
329bbe1b32bSmrgAC_SUBST(MAKE_PS)
330bbe1b32bSmrgAC_SUBST(MAKE_PDF)
331bbe1b32bSmrgAC_SUBST(MAKE_HTML)
332bbe1b32bSmrg]) # XORG_CHECK_DOCBOOK
333bbe1b32bSmrg
334bbe1b32bSmrg# XORG_CHECK_MALLOC_ZERO
335bbe1b32bSmrg# ----------------------
336bbe1b32bSmrg# Minimum version: 1.0.0
337bbe1b32bSmrg#
338bbe1b32bSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
339bbe1b32bSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
340bbe1b32bSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
341bbe1b32bSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
342bbe1b32bSmrgAC_ARG_ENABLE(malloc0returnsnull,
343bbe1b32bSmrg	AC_HELP_STRING([--enable-malloc0returnsnull],
344bbe1b32bSmrg		       [malloc(0) returns NULL (default: auto)]),
345bbe1b32bSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
346bbe1b32bSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
347bbe1b32bSmrg
348bbe1b32bSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
349bbe1b32bSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
350bbe1b32bSmrg	AC_RUN_IFELSE([
351bbe1b32bSmrgchar *malloc();
352bbe1b32bSmrgchar *realloc();
353bbe1b32bSmrgchar *calloc();
354bbe1b32bSmrgmain() {
355bbe1b32bSmrg    char *m0, *r0, *c0, *p;
356bbe1b32bSmrg    m0 = malloc(0);
357bbe1b32bSmrg    p = malloc(10);
358bbe1b32bSmrg    r0 = realloc(p,0);
359bbe1b32bSmrg    c0 = calloc(0);
360bbe1b32bSmrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
361bbe1b32bSmrg}],
362bbe1b32bSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
363bbe1b32bSmrg		[MALLOC_ZERO_RETURNS_NULL=no])
364bbe1b32bSmrgfi
365bbe1b32bSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
366bbe1b32bSmrg
367bbe1b32bSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
368bbe1b32bSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
369bbe1b32bSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
370bbe1b32bSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
371bbe1b32bSmrgelse
372bbe1b32bSmrg	MALLOC_ZERO_CFLAGS=""
373bbe1b32bSmrg	XMALLOC_ZERO_CFLAGS=""
374bbe1b32bSmrg	XTMALLOC_ZERO_CFLAGS=""
375bbe1b32bSmrgfi
376bbe1b32bSmrg
377bbe1b32bSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
378bbe1b32bSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
379bbe1b32bSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
380bbe1b32bSmrg]) # XORG_CHECK_MALLOC_ZERO
381bbe1b32bSmrg
382bbe1b32bSmrg# XORG_WITH_LINT()
383bbe1b32bSmrg# ----------------
384bbe1b32bSmrg# Minimum version: 1.1.0
385bbe1b32bSmrg#
386bbe1b32bSmrg# Sets up flags for source checkers such as lint and sparse if --with-lint
387bbe1b32bSmrg# is specified.   (Use --with-lint=sparse for sparse.)
388bbe1b32bSmrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
389bbe1b32bSmrg# Sets $LINT_FLAGS to flags to pass to source checker
390bbe1b32bSmrg# Sets LINT automake conditional if enabled (default: disabled)
391bbe1b32bSmrg#
392bbe1b32bSmrgAC_DEFUN([XORG_WITH_LINT],[
393bbe1b32bSmrg
394bbe1b32bSmrg# Allow checking code with lint, sparse, etc.
395bbe1b32bSmrgAC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
396bbe1b32bSmrg		[Use a lint-style source code checker (default: disabled)])],
397bbe1b32bSmrg		[use_lint=$withval], [use_lint=no])
398bbe1b32bSmrgif test "x$use_lint" = "xyes" ; then
399bbe1b32bSmrg	LINT="lint"
400bbe1b32bSmrgelse
401bbe1b32bSmrg	LINT="$use_lint"
402bbe1b32bSmrgfi
403bbe1b32bSmrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
404bbe1b32bSmrg    case $LINT in
405bbe1b32bSmrg	lint|*/lint)
406bbe1b32bSmrg	    case $host_os in
407bbe1b32bSmrg		solaris*)
408bbe1b32bSmrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
409bbe1b32bSmrg			;;
410bbe1b32bSmrg	    esac
411bbe1b32bSmrg	    ;;
412bbe1b32bSmrg    esac
413bbe1b32bSmrgfi
414bbe1b32bSmrg
415bbe1b32bSmrgAC_SUBST(LINT)
416bbe1b32bSmrgAC_SUBST(LINT_FLAGS)
417bbe1b32bSmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
418bbe1b32bSmrg
419bbe1b32bSmrg]) # XORG_WITH_LINT
420bbe1b32bSmrg
421bbe1b32bSmrg# XORG_LINT_LIBRARY(LIBNAME)
422bbe1b32bSmrg# --------------------------
423bbe1b32bSmrg# Minimum version: 1.1.0
424bbe1b32bSmrg#
425bbe1b32bSmrg# Sets up flags for building lint libraries for checking programs that call
426bbe1b32bSmrg# functions in the library.
427bbe1b32bSmrg# Disabled by default, enable with --enable-lint-library
428bbe1b32bSmrg# Sets: 
429bbe1b32bSmrg#	@LINTLIB@		- name of lint library file to make
430bbe1b32bSmrg#	MAKE_LINT_LIB		- automake conditional
431bbe1b32bSmrg#
432bbe1b32bSmrg
433bbe1b32bSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
434bbe1b32bSmrgAC_REQUIRE([XORG_WITH_LINT])
435bbe1b32bSmrg# Build lint "library" for more indepth checks of programs calling this library
436bbe1b32bSmrgAC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
437bbe1b32bSmrg	[Create lint library (default: disabled)])],
438bbe1b32bSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
439bbe1b32bSmrgif test "x$make_lint_lib" != "xno" ; then
440bbe1b32bSmrg	if test "x$LINT" = "xno" ; then
441bbe1b32bSmrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
442bbe1b32bSmrg	fi
443bbe1b32bSmrg	if test "x$make_lint_lib" = "xyes" ; then
444bbe1b32bSmrg		LINTLIB=llib-l$1.ln
445bbe1b32bSmrg	else
446bbe1b32bSmrg		LINTLIB=$make_lint_lib
447bbe1b32bSmrg	fi
448bbe1b32bSmrgfi
449bbe1b32bSmrgAC_SUBST(LINTLIB)
450bbe1b32bSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
451bbe1b32bSmrg
452bbe1b32bSmrg]) # XORG_LINT_LIBRARY
453bbe1b32bSmrg
454ce6676dbSmrg# XORG_CWARNFLAGS
455ce6676dbSmrg# ---------------
456ce6676dbSmrg# Minimum version: 1.2.0
457ce6676dbSmrg#
458ce6676dbSmrg# Defines CWARNFLAGS to enable C compiler warnings.
459ce6676dbSmrg#
460ce6676dbSmrgAC_DEFUN([XORG_CWARNFLAGS], [
461ce6676dbSmrgAC_REQUIRE([AC_PROG_CC])
462ce6676dbSmrgif  test "x$GCC" = xyes ; then
463ce6676dbSmrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
464ce6676dbSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
465ce6676dbSmrg-Wbad-function-cast"
466ce6676dbSmrg    case `gcc -dumpversion` in
467ce6676dbSmrg    3.4.* | 4.*)
468ce6676dbSmrg	CWARNFLAGS+=" -Wold-style-definition -Wdeclaration-after-statement"
469ce6676dbSmrg	;;
470ce6676dbSmrg    esac
471ce6676dbSmrgelse
472ce6676dbSmrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
473ce6676dbSmrg    if test "x$SUNCC" = "xyes"; then
474ce6676dbSmrg	CWARNFLAGS="-v"
475ce6676dbSmrg    fi
476ce6676dbSmrgfi
477ce6676dbSmrgAC_SUBST(CWARNFLAGS)
478ce6676dbSmrg]) # XORG_CWARNFLAGS
479bbe1b32bSmrgdnl Copyright 2005 Red Hat, Inc
480bbe1b32bSmrgdnl
481bbe1b32bSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
482bbe1b32bSmrgdnl documentation for any purpose is hereby granted without fee, provided that
483bbe1b32bSmrgdnl the above copyright notice appear in all copies and that both that
484bbe1b32bSmrgdnl copyright notice and this permission notice appear in supporting
485bbe1b32bSmrgdnl documentation.
486bbe1b32bSmrgdnl
487bbe1b32bSmrgdnl The above copyright notice and this permission notice shall be included
488bbe1b32bSmrgdnl in all copies or substantial portions of the Software.
489bbe1b32bSmrgdnl
490bbe1b32bSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
491bbe1b32bSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
492bbe1b32bSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
493bbe1b32bSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
494bbe1b32bSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
495bbe1b32bSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
496bbe1b32bSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
497bbe1b32bSmrgdnl
498bbe1b32bSmrgdnl Except as contained in this notice, the name of the copyright holders shall
499bbe1b32bSmrgdnl not be used in advertising or otherwise to promote the sale, use or
500bbe1b32bSmrgdnl other dealings in this Software without prior written authorization
501bbe1b32bSmrgdnl from the copyright holders.
502bbe1b32bSmrgdnl
503bbe1b32bSmrg
504bbe1b32bSmrg# XORG_RELEASE_VERSION
505bbe1b32bSmrg# --------------------
506bbe1b32bSmrg# Adds --with/without-release-string and changes the PACKAGE and
507bbe1b32bSmrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
508bbe1b32bSmrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
509bbe1b32bSmrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
510bbe1b32bSmrg 
511bbe1b32bSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
512bbe1b32bSmrg	AC_ARG_WITH(release-version,
513bbe1b32bSmrg			AC_HELP_STRING([--with-release-version=STRING],
514bbe1b32bSmrg				[Use release version string in package name]),
515bbe1b32bSmrg			[RELEASE_VERSION="$withval"],
516bbe1b32bSmrg			[RELEASE_VERSION=""])
517bbe1b32bSmrg	if test "x$RELEASE_VERSION" != "x"; then
518bbe1b32bSmrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
519bbe1b32bSmrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
520bbe1b32bSmrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
521bbe1b32bSmrg	fi
522bbe1b32bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
523bbe1b32bSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
524bbe1b32bSmrg		[Major version of this package])
525bbe1b32bSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
526bbe1b32bSmrg	if test "x$PVM" = "x"; then
527bbe1b32bSmrg		PVM="0"
528bbe1b32bSmrg	fi
529bbe1b32bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
530bbe1b32bSmrg		[$PVM],
531bbe1b32bSmrg		[Minor version of this package])
532bbe1b32bSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
533bbe1b32bSmrg	if test "x$PVP" = "x"; then
534bbe1b32bSmrg		PVP="0"
535bbe1b32bSmrg	fi
536bbe1b32bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
537bbe1b32bSmrg		[$PVP],
538bbe1b32bSmrg		[Patch version of this package])
539bbe1b32bSmrg])
540bbe1b32bSmrg
541ce6676dbSmrg# XORG_CHANGELOG()
542ce6676dbSmrg# ----------------
543ce6676dbSmrg# Minimum version: 1.2.0
544ce6676dbSmrg#
545ce6676dbSmrg# Defines the variable CHANGELOG_CMD as the command to generate
546ce6676dbSmrg# ChangeLog from git.
547ce6676dbSmrg#
548ce6676dbSmrg# Arrange that distcleancheck ignores ChangeLog left over by distclean.
549ce6676dbSmrg#
550ce6676dbSmrgAC_DEFUN([XORG_CHANGELOG], [
551ce6676dbSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
552ce6676dbSmrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
553ce6676dbSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
554ce6676dbSmrgAC_SUBST([CHANGELOG_CMD])
555ce6676dbSmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
556ce6676dbSmrg]) # XORG_CHANGELOG
557ce6676dbSmrg
558ce6676dbSmrg# Copyright (C) 2002, 2003, 2005, 2006  Free Software Foundation, Inc.
559ce6676dbSmrg#
560ce6676dbSmrg# This file is free software; the Free Software Foundation
561ce6676dbSmrg# gives unlimited permission to copy and/or distribute it,
562ce6676dbSmrg# with or without modifications, as long as this notice is preserved.
563bbe1b32bSmrg
564ce6676dbSmrg# AM_AUTOMAKE_VERSION(VERSION)
565ce6676dbSmrg# ----------------------------
566ce6676dbSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
567ce6676dbSmrg# generated from the m4 files accompanying Automake X.Y.
568ce6676dbSmrg# (This private macro should not be called outside this file.)
569ce6676dbSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
570ce6676dbSmrg[am__api_version='1.10'
571ce6676dbSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
572ce6676dbSmrgdnl require some minimum version.  Point them to the right macro.
573ce6676dbSmrgm4_if([$1], [1.10], [],
574ce6676dbSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
575ce6676dbSmrg])
576bbe1b32bSmrg
577ce6676dbSmrg# _AM_AUTOCONF_VERSION(VERSION)
578ce6676dbSmrg# -----------------------------
579ce6676dbSmrg# aclocal traces this macro to find the Autoconf version.
580ce6676dbSmrg# This is a private macro too.  Using m4_define simplifies
581ce6676dbSmrg# the logic in aclocal, which can simply ignore this definition.
582ce6676dbSmrgm4_define([_AM_AUTOCONF_VERSION], [])
583bbe1b32bSmrg
584ce6676dbSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
585ce6676dbSmrg# -------------------------------
586ce6676dbSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
587ce6676dbSmrg# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
588ce6676dbSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
589ce6676dbSmrg[AM_AUTOMAKE_VERSION([1.10])dnl
590ce6676dbSmrg_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
591bbe1b32bSmrg
592ce6676dbSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
593bbe1b32bSmrg
594bbe1b32bSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
595bbe1b32bSmrg#
596bbe1b32bSmrg# This file is free software; the Free Software Foundation
597bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
598bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
599bbe1b32bSmrg
600bbe1b32bSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
601bbe1b32bSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
602bbe1b32bSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
603bbe1b32bSmrg#
604bbe1b32bSmrg# Of course, Automake must honor this variable whenever it calls a
605bbe1b32bSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
606bbe1b32bSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
607bbe1b32bSmrg# depending on how configure is run.  This is pretty annoying, since
608bbe1b32bSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
609bbe1b32bSmrg# source directory, any form will work fine, but in subdirectories a
610bbe1b32bSmrg# relative path needs to be adjusted first.
611bbe1b32bSmrg#
612bbe1b32bSmrg# $ac_aux_dir/missing
613bbe1b32bSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
614bbe1b32bSmrg# $top_srcdir/$ac_aux_dir/missing
615bbe1b32bSmrg#    fails if $ac_aux_dir is absolute,
616bbe1b32bSmrg#    fails when called from a subdirectory in a VPATH build with
617bbe1b32bSmrg#          a relative $ac_aux_dir
618bbe1b32bSmrg#
619bbe1b32bSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
620bbe1b32bSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
621bbe1b32bSmrg# harmless because $srcdir is `.', but things will broke when you
622bbe1b32bSmrg# start a VPATH build or use an absolute $srcdir.
623bbe1b32bSmrg#
624bbe1b32bSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
625bbe1b32bSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
626bbe1b32bSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
627bbe1b32bSmrg# and then we would define $MISSING as
628bbe1b32bSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
629bbe1b32bSmrg# This will work as long as MISSING is not called from configure, because
630bbe1b32bSmrg# unfortunately $(top_srcdir) has no meaning in configure.
631bbe1b32bSmrg# However there are other variables, like CC, which are often used in
632bbe1b32bSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
633bbe1b32bSmrg#
634bbe1b32bSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
635bbe1b32bSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
636bbe1b32bSmrg# configured tree to be moved without reconfiguration.
637bbe1b32bSmrg
638bbe1b32bSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
639bbe1b32bSmrg[dnl Rely on autoconf to set up CDPATH properly.
640bbe1b32bSmrgAC_PREREQ([2.50])dnl
641bbe1b32bSmrg# expand $ac_aux_dir to an absolute path
642bbe1b32bSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
643bbe1b32bSmrg])
644bbe1b32bSmrg
645bbe1b32bSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
646bbe1b32bSmrg
647bbe1b32bSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
648bbe1b32bSmrg# Free Software Foundation, Inc.
649bbe1b32bSmrg#
650bbe1b32bSmrg# This file is free software; the Free Software Foundation
651bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
652bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
653bbe1b32bSmrg
654bbe1b32bSmrg# serial 8
655bbe1b32bSmrg
656bbe1b32bSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
657bbe1b32bSmrg# -------------------------------------
658bbe1b32bSmrg# Define a conditional.
659bbe1b32bSmrgAC_DEFUN([AM_CONDITIONAL],
660bbe1b32bSmrg[AC_PREREQ(2.52)dnl
661bbe1b32bSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
662bbe1b32bSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
663bbe1b32bSmrgAC_SUBST([$1_TRUE])dnl
664bbe1b32bSmrgAC_SUBST([$1_FALSE])dnl
665bbe1b32bSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
666bbe1b32bSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
667bbe1b32bSmrgif $2; then
668bbe1b32bSmrg  $1_TRUE=
669bbe1b32bSmrg  $1_FALSE='#'
670bbe1b32bSmrgelse
671bbe1b32bSmrg  $1_TRUE='#'
672bbe1b32bSmrg  $1_FALSE=
673bbe1b32bSmrgfi
674bbe1b32bSmrgAC_CONFIG_COMMANDS_PRE(
675bbe1b32bSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
676bbe1b32bSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
677bbe1b32bSmrgUsually this means the macro was only invoked conditionally.]])
678bbe1b32bSmrgfi])])
679bbe1b32bSmrg
680bbe1b32bSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
681bbe1b32bSmrg# Free Software Foundation, Inc.
682bbe1b32bSmrg#
683bbe1b32bSmrg# This file is free software; the Free Software Foundation
684bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
685bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
686bbe1b32bSmrg
687bbe1b32bSmrg# serial 9
688bbe1b32bSmrg
689bbe1b32bSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
690bbe1b32bSmrg# written in clear, in which case automake, when reading aclocal.m4,
691bbe1b32bSmrg# will think it sees a *use*, and therefore will trigger all it's
692bbe1b32bSmrg# C support machinery.  Also note that it means that autoscan, seeing
693bbe1b32bSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
694bbe1b32bSmrg
695bbe1b32bSmrg
696bbe1b32bSmrg# _AM_DEPENDENCIES(NAME)
697bbe1b32bSmrg# ----------------------
698bbe1b32bSmrg# See how the compiler implements dependency checking.
699bbe1b32bSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
700bbe1b32bSmrg# We try a few techniques and use that to set a single cache variable.
701bbe1b32bSmrg#
702bbe1b32bSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
703bbe1b32bSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
704bbe1b32bSmrg# dependency, and given that the user is not expected to run this macro,
705bbe1b32bSmrg# just rely on AC_PROG_CC.
706bbe1b32bSmrgAC_DEFUN([_AM_DEPENDENCIES],
707bbe1b32bSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
708bbe1b32bSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
709bbe1b32bSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
710bbe1b32bSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
711bbe1b32bSmrg
712bbe1b32bSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
713bbe1b32bSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
714bbe1b32bSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
715bbe1b32bSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
716bbe1b32bSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
717bbe1b32bSmrg                   [depcc="$$1"   am_compiler_list=])
718bbe1b32bSmrg
719bbe1b32bSmrgAC_CACHE_CHECK([dependency style of $depcc],
720bbe1b32bSmrg               [am_cv_$1_dependencies_compiler_type],
721bbe1b32bSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
722bbe1b32bSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
723bbe1b32bSmrg  # making bogus files that we don't know about and never remove.  For
724bbe1b32bSmrg  # instance it was reported that on HP-UX the gcc test will end up
725bbe1b32bSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
726bbe1b32bSmrg  # in D'.
727bbe1b32bSmrg  mkdir conftest.dir
728bbe1b32bSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
729bbe1b32bSmrg  # using a relative directory.
730bbe1b32bSmrg  cp "$am_depcomp" conftest.dir
731bbe1b32bSmrg  cd conftest.dir
732bbe1b32bSmrg  # We will build objects and dependencies in a subdirectory because
733bbe1b32bSmrg  # it helps to detect inapplicable dependency modes.  For instance
734bbe1b32bSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
735bbe1b32bSmrg  # side effect of compilation, but ICC will put the dependencies in
736bbe1b32bSmrg  # the current directory while Tru64 will put them in the object
737bbe1b32bSmrg  # directory.
738bbe1b32bSmrg  mkdir sub
739bbe1b32bSmrg
740bbe1b32bSmrg  am_cv_$1_dependencies_compiler_type=none
741bbe1b32bSmrg  if test "$am_compiler_list" = ""; then
742bbe1b32bSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
743bbe1b32bSmrg  fi
744bbe1b32bSmrg  for depmode in $am_compiler_list; do
745bbe1b32bSmrg    # Setup a source with many dependencies, because some compilers
746bbe1b32bSmrg    # like to wrap large dependency lists on column 80 (with \), and
747bbe1b32bSmrg    # we should not choose a depcomp mode which is confused by this.
748bbe1b32bSmrg    #
749bbe1b32bSmrg    # We need to recreate these files for each test, as the compiler may
750bbe1b32bSmrg    # overwrite some of them when testing with obscure command lines.
751bbe1b32bSmrg    # This happens at least with the AIX C compiler.
752bbe1b32bSmrg    : > sub/conftest.c
753bbe1b32bSmrg    for i in 1 2 3 4 5 6; do
754bbe1b32bSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
755bbe1b32bSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
756bbe1b32bSmrg      # Solaris 8's {/usr,}/bin/sh.
757bbe1b32bSmrg      touch sub/conftst$i.h
758bbe1b32bSmrg    done
759bbe1b32bSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
760bbe1b32bSmrg
761bbe1b32bSmrg    case $depmode in
762bbe1b32bSmrg    nosideeffect)
763bbe1b32bSmrg      # after this tag, mechanisms are not by side-effect, so they'll
764bbe1b32bSmrg      # only be used when explicitly requested
765bbe1b32bSmrg      if test "x$enable_dependency_tracking" = xyes; then
766bbe1b32bSmrg	continue
767bbe1b32bSmrg      else
768bbe1b32bSmrg	break
769bbe1b32bSmrg      fi
770bbe1b32bSmrg      ;;
771bbe1b32bSmrg    none) break ;;
772bbe1b32bSmrg    esac
773bbe1b32bSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
774bbe1b32bSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
775bbe1b32bSmrg    # handle `-M -o', and we need to detect this.
776bbe1b32bSmrg    if depmode=$depmode \
777bbe1b32bSmrg       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
778bbe1b32bSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
779bbe1b32bSmrg       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
780bbe1b32bSmrg         >/dev/null 2>conftest.err &&
781bbe1b32bSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
782bbe1b32bSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
783bbe1b32bSmrg       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
784bbe1b32bSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
785bbe1b32bSmrg      # icc doesn't choke on unknown options, it will just issue warnings
786bbe1b32bSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
787bbe1b32bSmrg      # that says an option was ignored or not supported.
788bbe1b32bSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
789bbe1b32bSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
790bbe1b32bSmrg      # The diagnosis changed in icc 8.0:
791bbe1b32bSmrg      #   icc: Command line remark: option '-MP' not supported
792bbe1b32bSmrg      if (grep 'ignoring option' conftest.err ||
793bbe1b32bSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
794bbe1b32bSmrg        am_cv_$1_dependencies_compiler_type=$depmode
795bbe1b32bSmrg        break
796bbe1b32bSmrg      fi
797bbe1b32bSmrg    fi
798bbe1b32bSmrg  done
799bbe1b32bSmrg
800bbe1b32bSmrg  cd ..
801bbe1b32bSmrg  rm -rf conftest.dir
802bbe1b32bSmrgelse
803bbe1b32bSmrg  am_cv_$1_dependencies_compiler_type=none
804bbe1b32bSmrgfi
805bbe1b32bSmrg])
806bbe1b32bSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
807bbe1b32bSmrgAM_CONDITIONAL([am__fastdep$1], [
808bbe1b32bSmrg  test "x$enable_dependency_tracking" != xno \
809bbe1b32bSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
810bbe1b32bSmrg])
811bbe1b32bSmrg
812bbe1b32bSmrg
813bbe1b32bSmrg# AM_SET_DEPDIR
814bbe1b32bSmrg# -------------
815bbe1b32bSmrg# Choose a directory name for dependency files.
816bbe1b32bSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
817bbe1b32bSmrgAC_DEFUN([AM_SET_DEPDIR],
818bbe1b32bSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
819bbe1b32bSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
820bbe1b32bSmrg])
821bbe1b32bSmrg
822bbe1b32bSmrg
823bbe1b32bSmrg# AM_DEP_TRACK
824bbe1b32bSmrg# ------------
825bbe1b32bSmrgAC_DEFUN([AM_DEP_TRACK],
826bbe1b32bSmrg[AC_ARG_ENABLE(dependency-tracking,
827bbe1b32bSmrg[  --disable-dependency-tracking  speeds up one-time build
828bbe1b32bSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
829bbe1b32bSmrgif test "x$enable_dependency_tracking" != xno; then
830bbe1b32bSmrg  am_depcomp="$ac_aux_dir/depcomp"
831bbe1b32bSmrg  AMDEPBACKSLASH='\'
832bbe1b32bSmrgfi
833bbe1b32bSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
834bbe1b32bSmrgAC_SUBST([AMDEPBACKSLASH])dnl
835bbe1b32bSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
836bbe1b32bSmrg])
837bbe1b32bSmrg
838bbe1b32bSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
839bbe1b32bSmrg
840bbe1b32bSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
841bbe1b32bSmrg# Free Software Foundation, Inc.
842bbe1b32bSmrg#
843bbe1b32bSmrg# This file is free software; the Free Software Foundation
844bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
845bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
846bbe1b32bSmrg
847bbe1b32bSmrg#serial 3
848bbe1b32bSmrg
849bbe1b32bSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
850bbe1b32bSmrg# ------------------------------
851bbe1b32bSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
852bbe1b32bSmrg[for mf in $CONFIG_FILES; do
853bbe1b32bSmrg  # Strip MF so we end up with the name of the file.
854bbe1b32bSmrg  mf=`echo "$mf" | sed -e 's/:.*$//'`
855bbe1b32bSmrg  # Check whether this is an Automake generated Makefile or not.
856bbe1b32bSmrg  # We used to match only the files named `Makefile.in', but
857bbe1b32bSmrg  # some people rename them; so instead we look at the file content.
858bbe1b32bSmrg  # Grep'ing the first line is not enough: some people post-process
859bbe1b32bSmrg  # each Makefile.in and add a new line on top of each file to say so.
860bbe1b32bSmrg  # Grep'ing the whole file is not good either: AIX grep has a line
861bbe1b32bSmrg  # limit of 2048, but all sed's we know have understand at least 4000.
862ce6676dbSmrg  if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
863bbe1b32bSmrg    dirpart=`AS_DIRNAME("$mf")`
864bbe1b32bSmrg  else
865bbe1b32bSmrg    continue
866bbe1b32bSmrg  fi
867bbe1b32bSmrg  # Extract the definition of DEPDIR, am__include, and am__quote
868bbe1b32bSmrg  # from the Makefile without running `make'.
869bbe1b32bSmrg  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
870bbe1b32bSmrg  test -z "$DEPDIR" && continue
871bbe1b32bSmrg  am__include=`sed -n 's/^am__include = //p' < "$mf"`
872bbe1b32bSmrg  test -z "am__include" && continue
873bbe1b32bSmrg  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
874bbe1b32bSmrg  # When using ansi2knr, U may be empty or an underscore; expand it
875bbe1b32bSmrg  U=`sed -n 's/^U = //p' < "$mf"`
876bbe1b32bSmrg  # Find all dependency output files, they are included files with
877bbe1b32bSmrg  # $(DEPDIR) in their names.  We invoke sed twice because it is the
878bbe1b32bSmrg  # simplest approach to changing $(DEPDIR) to its actual value in the
879bbe1b32bSmrg  # expansion.
880bbe1b32bSmrg  for file in `sed -n "
881bbe1b32bSmrg    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
882bbe1b32bSmrg       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
883bbe1b32bSmrg    # Make sure the directory exists.
884bbe1b32bSmrg    test -f "$dirpart/$file" && continue
885bbe1b32bSmrg    fdir=`AS_DIRNAME(["$file"])`
886bbe1b32bSmrg    AS_MKDIR_P([$dirpart/$fdir])
887bbe1b32bSmrg    # echo "creating $dirpart/$file"
888bbe1b32bSmrg    echo '# dummy' > "$dirpart/$file"
889bbe1b32bSmrg  done
890bbe1b32bSmrgdone
891bbe1b32bSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
892bbe1b32bSmrg
893bbe1b32bSmrg
894bbe1b32bSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
895bbe1b32bSmrg# -----------------------------
896bbe1b32bSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
897bbe1b32bSmrg#
898bbe1b32bSmrg# This code is only required when automatic dependency tracking
899bbe1b32bSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
900bbe1b32bSmrg# need in order to bootstrap the dependency handling code.
901bbe1b32bSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
902bbe1b32bSmrg[AC_CONFIG_COMMANDS([depfiles],
903bbe1b32bSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
904bbe1b32bSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
905bbe1b32bSmrg])
906bbe1b32bSmrg
907bbe1b32bSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
908bbe1b32bSmrg# Free Software Foundation, Inc.
909bbe1b32bSmrg#
910bbe1b32bSmrg# This file is free software; the Free Software Foundation
911bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
912bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
913bbe1b32bSmrg
914bbe1b32bSmrg# serial 8
915bbe1b32bSmrg
916bbe1b32bSmrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
917bbe1b32bSmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
918bbe1b32bSmrg
919bbe1b32bSmrg# Do all the work for Automake.                             -*- Autoconf -*-
920bbe1b32bSmrg
921bbe1b32bSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
922ce6676dbSmrg# 2005, 2006 Free Software Foundation, Inc.
923bbe1b32bSmrg#
924bbe1b32bSmrg# This file is free software; the Free Software Foundation
925bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
926bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
927bbe1b32bSmrg
928ce6676dbSmrg# serial 12
929bbe1b32bSmrg
930bbe1b32bSmrg# This macro actually does too much.  Some checks are only needed if
931bbe1b32bSmrg# your package does certain things.  But this isn't really a big deal.
932bbe1b32bSmrg
933bbe1b32bSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
934bbe1b32bSmrg# AM_INIT_AUTOMAKE([OPTIONS])
935bbe1b32bSmrg# -----------------------------------------------
936bbe1b32bSmrg# The call with PACKAGE and VERSION arguments is the old style
937bbe1b32bSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
938bbe1b32bSmrg# and VERSION should now be passed to AC_INIT and removed from
939bbe1b32bSmrg# the call to AM_INIT_AUTOMAKE.
940bbe1b32bSmrg# We support both call styles for the transition.  After
941bbe1b32bSmrg# the next Automake release, Autoconf can make the AC_INIT
942bbe1b32bSmrg# arguments mandatory, and then we can depend on a new Autoconf
943bbe1b32bSmrg# release and drop the old call support.
944bbe1b32bSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
945bbe1b32bSmrg[AC_PREREQ([2.60])dnl
946bbe1b32bSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
947bbe1b32bSmrgdnl the ones we care about.
948bbe1b32bSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
949bbe1b32bSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
950bbe1b32bSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
951bbe1b32bSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
952bbe1b32bSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
953bbe1b32bSmrg  # is not polluted with repeated "-I."
954bbe1b32bSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
955bbe1b32bSmrg  # test to see if srcdir already configured
956bbe1b32bSmrg  if test -f $srcdir/config.status; then
957bbe1b32bSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
958bbe1b32bSmrg  fi
959bbe1b32bSmrgfi
960bbe1b32bSmrg
961bbe1b32bSmrg# test whether we have cygpath
962bbe1b32bSmrgif test -z "$CYGPATH_W"; then
963bbe1b32bSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
964bbe1b32bSmrg    CYGPATH_W='cygpath -w'
965bbe1b32bSmrg  else
966bbe1b32bSmrg    CYGPATH_W=echo
967bbe1b32bSmrg  fi
968bbe1b32bSmrgfi
969bbe1b32bSmrgAC_SUBST([CYGPATH_W])
970bbe1b32bSmrg
971bbe1b32bSmrg# Define the identity of the package.
972bbe1b32bSmrgdnl Distinguish between old-style and new-style calls.
973bbe1b32bSmrgm4_ifval([$2],
974bbe1b32bSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
975bbe1b32bSmrg AC_SUBST([PACKAGE], [$1])dnl
976bbe1b32bSmrg AC_SUBST([VERSION], [$2])],
977bbe1b32bSmrg[_AM_SET_OPTIONS([$1])dnl
978bbe1b32bSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
979bbe1b32bSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
980bbe1b32bSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
981bbe1b32bSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
982bbe1b32bSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
983bbe1b32bSmrg
984bbe1b32bSmrg_AM_IF_OPTION([no-define],,
985bbe1b32bSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
986bbe1b32bSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
987bbe1b32bSmrg
988bbe1b32bSmrg# Some tools Automake needs.
989bbe1b32bSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
990bbe1b32bSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
991bbe1b32bSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
992bbe1b32bSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
993bbe1b32bSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
994bbe1b32bSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
995bbe1b32bSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
996bbe1b32bSmrgAM_PROG_INSTALL_SH
997bbe1b32bSmrgAM_PROG_INSTALL_STRIP
998bbe1b32bSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
999bbe1b32bSmrg# We need awk for the "check" target.  The system "awk" is bad on
1000bbe1b32bSmrg# some platforms.
1001bbe1b32bSmrgAC_REQUIRE([AC_PROG_AWK])dnl
1002bbe1b32bSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
1003bbe1b32bSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
1004bbe1b32bSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
1005bbe1b32bSmrg              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
1006bbe1b32bSmrg	      		     [_AM_PROG_TAR([v7])])])
1007bbe1b32bSmrg_AM_IF_OPTION([no-dependencies],,
1008bbe1b32bSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
1009bbe1b32bSmrg                  [_AM_DEPENDENCIES(CC)],
1010bbe1b32bSmrg                  [define([AC_PROG_CC],
1011bbe1b32bSmrg                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
1012bbe1b32bSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
1013bbe1b32bSmrg                  [_AM_DEPENDENCIES(CXX)],
1014bbe1b32bSmrg                  [define([AC_PROG_CXX],
1015bbe1b32bSmrg                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
1016bbe1b32bSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
1017bbe1b32bSmrg                  [_AM_DEPENDENCIES(OBJC)],
1018bbe1b32bSmrg                  [define([AC_PROG_OBJC],
1019bbe1b32bSmrg                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
1020bbe1b32bSmrg])
1021bbe1b32bSmrg])
1022bbe1b32bSmrg
1023bbe1b32bSmrg
1024bbe1b32bSmrg# When config.status generates a header, we must update the stamp-h file.
1025bbe1b32bSmrg# This file resides in the same directory as the config header
1026bbe1b32bSmrg# that is generated.  The stamp files are numbered to have different names.
1027bbe1b32bSmrg
1028bbe1b32bSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
1029bbe1b32bSmrg# loop where config.status creates the headers, so we can generate
1030bbe1b32bSmrg# our stamp files there.
1031bbe1b32bSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
1032bbe1b32bSmrg[# Compute $1's index in $config_headers.
1033bbe1b32bSmrg_am_stamp_count=1
1034bbe1b32bSmrgfor _am_header in $config_headers :; do
1035bbe1b32bSmrg  case $_am_header in
1036ce6676dbSmrg    $1 | $1:* )
1037bbe1b32bSmrg      break ;;
1038bbe1b32bSmrg    * )
1039bbe1b32bSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
1040bbe1b32bSmrg  esac
1041bbe1b32bSmrgdone
1042ce6676dbSmrgecho "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
1043bbe1b32bSmrg
1044bbe1b32bSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
1045bbe1b32bSmrg#
1046bbe1b32bSmrg# This file is free software; the Free Software Foundation
1047bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
1048bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
1049bbe1b32bSmrg
1050bbe1b32bSmrg# AM_PROG_INSTALL_SH
1051bbe1b32bSmrg# ------------------
1052bbe1b32bSmrg# Define $install_sh.
1053bbe1b32bSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
1054bbe1b32bSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1055bbe1b32bSmrginstall_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
1056bbe1b32bSmrgAC_SUBST(install_sh)])
1057bbe1b32bSmrg
1058bbe1b32bSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
1059bbe1b32bSmrg#
1060bbe1b32bSmrg# This file is free software; the Free Software Foundation
1061bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
1062bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
1063bbe1b32bSmrg
1064bbe1b32bSmrg# serial 2
1065bbe1b32bSmrg
1066bbe1b32bSmrg# Check whether the underlying file-system supports filenames
1067bbe1b32bSmrg# with a leading dot.  For instance MS-DOS doesn't.
1068bbe1b32bSmrgAC_DEFUN([AM_SET_LEADING_DOT],
1069bbe1b32bSmrg[rm -rf .tst 2>/dev/null
1070bbe1b32bSmrgmkdir .tst 2>/dev/null
1071bbe1b32bSmrgif test -d .tst; then
1072bbe1b32bSmrg  am__leading_dot=.
1073bbe1b32bSmrgelse
1074bbe1b32bSmrg  am__leading_dot=_
1075bbe1b32bSmrgfi
1076bbe1b32bSmrgrmdir .tst 2>/dev/null
1077bbe1b32bSmrgAC_SUBST([am__leading_dot])])
1078bbe1b32bSmrg
1079bbe1b32bSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
1080bbe1b32bSmrg# From Jim Meyering
1081bbe1b32bSmrg
1082bbe1b32bSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
1083bbe1b32bSmrg# Free Software Foundation, Inc.
1084bbe1b32bSmrg#
1085bbe1b32bSmrg# This file is free software; the Free Software Foundation
1086bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
1087bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
1088bbe1b32bSmrg
1089bbe1b32bSmrg# serial 4
1090bbe1b32bSmrg
1091bbe1b32bSmrgAC_DEFUN([AM_MAINTAINER_MODE],
1092bbe1b32bSmrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
1093bbe1b32bSmrg  dnl maintainer-mode is disabled by default
1094bbe1b32bSmrg  AC_ARG_ENABLE(maintainer-mode,
1095bbe1b32bSmrg[  --enable-maintainer-mode  enable make rules and dependencies not useful
1096bbe1b32bSmrg			  (and sometimes confusing) to the casual installer],
1097bbe1b32bSmrg      USE_MAINTAINER_MODE=$enableval,
1098bbe1b32bSmrg      USE_MAINTAINER_MODE=no)
1099bbe1b32bSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
1100bbe1b32bSmrg  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
1101bbe1b32bSmrg  MAINT=$MAINTAINER_MODE_TRUE
1102bbe1b32bSmrg  AC_SUBST(MAINT)dnl
1103bbe1b32bSmrg]
1104bbe1b32bSmrg)
1105bbe1b32bSmrg
1106bbe1b32bSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
1107bbe1b32bSmrg
1108bbe1b32bSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
1109bbe1b32bSmrg
1110bbe1b32bSmrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
1111bbe1b32bSmrg#
1112bbe1b32bSmrg# This file is free software; the Free Software Foundation
1113bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
1114bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
1115bbe1b32bSmrg
1116bbe1b32bSmrg# serial 3
1117bbe1b32bSmrg
1118bbe1b32bSmrg# AM_MAKE_INCLUDE()
1119bbe1b32bSmrg# -----------------
1120bbe1b32bSmrg# Check to see how make treats includes.
1121bbe1b32bSmrgAC_DEFUN([AM_MAKE_INCLUDE],
1122bbe1b32bSmrg[am_make=${MAKE-make}
1123bbe1b32bSmrgcat > confinc << 'END'
1124bbe1b32bSmrgam__doit:
1125bbe1b32bSmrg	@echo done
1126bbe1b32bSmrg.PHONY: am__doit
1127bbe1b32bSmrgEND
1128bbe1b32bSmrg# If we don't find an include directive, just comment out the code.
1129bbe1b32bSmrgAC_MSG_CHECKING([for style of include used by $am_make])
1130bbe1b32bSmrgam__include="#"
1131bbe1b32bSmrgam__quote=
1132bbe1b32bSmrg_am_result=none
1133bbe1b32bSmrg# First try GNU make style include.
1134bbe1b32bSmrgecho "include confinc" > confmf
1135bbe1b32bSmrg# We grep out `Entering directory' and `Leaving directory'
1136bbe1b32bSmrg# messages which can occur if `w' ends up in MAKEFLAGS.
1137bbe1b32bSmrg# In particular we don't look at `^make:' because GNU make might
1138bbe1b32bSmrg# be invoked under some other name (usually "gmake"), in which
1139bbe1b32bSmrg# case it prints its new name instead of `make'.
1140bbe1b32bSmrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
1141bbe1b32bSmrg   am__include=include
1142bbe1b32bSmrg   am__quote=
1143bbe1b32bSmrg   _am_result=GNU
1144bbe1b32bSmrgfi
1145bbe1b32bSmrg# Now try BSD make style include.
1146bbe1b32bSmrgif test "$am__include" = "#"; then
1147bbe1b32bSmrg   echo '.include "confinc"' > confmf
1148bbe1b32bSmrg   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
1149bbe1b32bSmrg      am__include=.include
1150bbe1b32bSmrg      am__quote="\""
1151bbe1b32bSmrg      _am_result=BSD
1152bbe1b32bSmrg   fi
1153bbe1b32bSmrgfi
1154bbe1b32bSmrgAC_SUBST([am__include])
1155bbe1b32bSmrgAC_SUBST([am__quote])
1156bbe1b32bSmrgAC_MSG_RESULT([$_am_result])
1157bbe1b32bSmrgrm -f confinc confmf
1158bbe1b32bSmrg])
1159bbe1b32bSmrg
1160bbe1b32bSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
1161bbe1b32bSmrg
1162bbe1b32bSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
1163bbe1b32bSmrg# Free Software Foundation, Inc.
1164bbe1b32bSmrg#
1165bbe1b32bSmrg# This file is free software; the Free Software Foundation
1166bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
1167bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
1168bbe1b32bSmrg
1169bbe1b32bSmrg# serial 5
1170bbe1b32bSmrg
1171bbe1b32bSmrg# AM_MISSING_PROG(NAME, PROGRAM)
1172bbe1b32bSmrg# ------------------------------
1173bbe1b32bSmrgAC_DEFUN([AM_MISSING_PROG],
1174bbe1b32bSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
1175bbe1b32bSmrg$1=${$1-"${am_missing_run}$2"}
1176bbe1b32bSmrgAC_SUBST($1)])
1177bbe1b32bSmrg
1178bbe1b32bSmrg
1179bbe1b32bSmrg# AM_MISSING_HAS_RUN
1180bbe1b32bSmrg# ------------------
1181bbe1b32bSmrg# Define MISSING if not defined so far and test if it supports --run.
1182bbe1b32bSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
1183bbe1b32bSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
1184bbe1b32bSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1185bbe1b32bSmrgAC_REQUIRE_AUX_FILE([missing])dnl
1186bbe1b32bSmrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
1187bbe1b32bSmrg# Use eval to expand $SHELL
1188bbe1b32bSmrgif eval "$MISSING --run true"; then
1189bbe1b32bSmrg  am_missing_run="$MISSING --run "
1190bbe1b32bSmrgelse
1191bbe1b32bSmrg  am_missing_run=
1192bbe1b32bSmrg  AC_MSG_WARN([`missing' script is too old or missing])
1193bbe1b32bSmrgfi
1194bbe1b32bSmrg])
1195bbe1b32bSmrg
1196bbe1b32bSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
1197bbe1b32bSmrg#
1198bbe1b32bSmrg# This file is free software; the Free Software Foundation
1199bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
1200bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
1201bbe1b32bSmrg
1202bbe1b32bSmrg# AM_PROG_MKDIR_P
1203bbe1b32bSmrg# ---------------
1204bbe1b32bSmrg# Check for `mkdir -p'.
1205bbe1b32bSmrgAC_DEFUN([AM_PROG_MKDIR_P],
1206bbe1b32bSmrg[AC_PREREQ([2.60])dnl
1207bbe1b32bSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
1208bbe1b32bSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
1209bbe1b32bSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
1210bbe1b32bSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
1211bbe1b32bSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
1212bbe1b32bSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
1213bbe1b32bSmrgdnl adjustment using top_builddir (which is defined more often than
1214bbe1b32bSmrgdnl MKDIR_P).
1215bbe1b32bSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
1216bbe1b32bSmrgcase $mkdir_p in
1217bbe1b32bSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
1218bbe1b32bSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
1219bbe1b32bSmrgesac
1220bbe1b32bSmrg])
1221bbe1b32bSmrg
1222bbe1b32bSmrg# Helper functions for option handling.                     -*- Autoconf -*-
1223bbe1b32bSmrg
1224bbe1b32bSmrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
1225bbe1b32bSmrg#
1226bbe1b32bSmrg# This file is free software; the Free Software Foundation
1227bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
1228bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
1229bbe1b32bSmrg
1230bbe1b32bSmrg# serial 3
1231bbe1b32bSmrg
1232bbe1b32bSmrg# _AM_MANGLE_OPTION(NAME)
1233bbe1b32bSmrg# -----------------------
1234bbe1b32bSmrgAC_DEFUN([_AM_MANGLE_OPTION],
1235bbe1b32bSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
1236bbe1b32bSmrg
1237bbe1b32bSmrg# _AM_SET_OPTION(NAME)
1238bbe1b32bSmrg# ------------------------------
1239bbe1b32bSmrg# Set option NAME.  Presently that only means defining a flag for this option.
1240bbe1b32bSmrgAC_DEFUN([_AM_SET_OPTION],
1241bbe1b32bSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
1242bbe1b32bSmrg
1243bbe1b32bSmrg# _AM_SET_OPTIONS(OPTIONS)
1244bbe1b32bSmrg# ----------------------------------
1245bbe1b32bSmrg# OPTIONS is a space-separated list of Automake options.
1246bbe1b32bSmrgAC_DEFUN([_AM_SET_OPTIONS],
1247bbe1b32bSmrg[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
1248bbe1b32bSmrg
1249bbe1b32bSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
1250bbe1b32bSmrg# -------------------------------------------
1251bbe1b32bSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
1252bbe1b32bSmrgAC_DEFUN([_AM_IF_OPTION],
1253bbe1b32bSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
1254bbe1b32bSmrg
1255bbe1b32bSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
1256bbe1b32bSmrg
1257bbe1b32bSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
1258bbe1b32bSmrg# Free Software Foundation, Inc.
1259bbe1b32bSmrg#
1260bbe1b32bSmrg# This file is free software; the Free Software Foundation
1261bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
1262bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
1263bbe1b32bSmrg
1264bbe1b32bSmrg# serial 4
1265bbe1b32bSmrg
1266bbe1b32bSmrg# AM_SANITY_CHECK
1267bbe1b32bSmrg# ---------------
1268bbe1b32bSmrgAC_DEFUN([AM_SANITY_CHECK],
1269bbe1b32bSmrg[AC_MSG_CHECKING([whether build environment is sane])
1270bbe1b32bSmrg# Just in case
1271bbe1b32bSmrgsleep 1
1272bbe1b32bSmrgecho timestamp > conftest.file
1273bbe1b32bSmrg# Do `set' in a subshell so we don't clobber the current shell's
1274bbe1b32bSmrg# arguments.  Must try -L first in case configure is actually a
1275bbe1b32bSmrg# symlink; some systems play weird games with the mod time of symlinks
1276bbe1b32bSmrg# (eg FreeBSD returns the mod time of the symlink's containing
1277bbe1b32bSmrg# directory).
1278bbe1b32bSmrgif (
1279bbe1b32bSmrg   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
1280bbe1b32bSmrg   if test "$[*]" = "X"; then
1281bbe1b32bSmrg      # -L didn't work.
1282bbe1b32bSmrg      set X `ls -t $srcdir/configure conftest.file`
1283bbe1b32bSmrg   fi
1284bbe1b32bSmrg   rm -f conftest.file
1285bbe1b32bSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
1286bbe1b32bSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
1287bbe1b32bSmrg
1288bbe1b32bSmrg      # If neither matched, then we have a broken ls.  This can happen
1289bbe1b32bSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
1290bbe1b32bSmrg      # broken ls alias from the environment.  This has actually
1291bbe1b32bSmrg      # happened.  Such a system could not be considered "sane".
1292bbe1b32bSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
1293bbe1b32bSmrgalias in your environment])
1294bbe1b32bSmrg   fi
1295bbe1b32bSmrg
1296bbe1b32bSmrg   test "$[2]" = conftest.file
1297bbe1b32bSmrg   )
1298bbe1b32bSmrgthen
1299bbe1b32bSmrg   # Ok.
1300bbe1b32bSmrg   :
1301bbe1b32bSmrgelse
1302bbe1b32bSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
1303bbe1b32bSmrgCheck your system clock])
1304bbe1b32bSmrgfi
1305bbe1b32bSmrgAC_MSG_RESULT(yes)])
1306bbe1b32bSmrg
1307bbe1b32bSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
1308bbe1b32bSmrg#
1309bbe1b32bSmrg# This file is free software; the Free Software Foundation
1310bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
1311bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
1312bbe1b32bSmrg
1313bbe1b32bSmrg# AM_PROG_INSTALL_STRIP
1314bbe1b32bSmrg# ---------------------
1315bbe1b32bSmrg# One issue with vendor `install' (even GNU) is that you can't
1316bbe1b32bSmrg# specify the program used to strip binaries.  This is especially
1317bbe1b32bSmrg# annoying in cross-compiling environments, where the build's strip
1318bbe1b32bSmrg# is unlikely to handle the host's binaries.
1319bbe1b32bSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
1320bbe1b32bSmrg# always use install-sh in `make install-strip', and initialize
1321bbe1b32bSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
1322bbe1b32bSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
1323bbe1b32bSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1324bbe1b32bSmrg# Installed binaries are usually stripped using `strip' when the user
1325bbe1b32bSmrg# run `make install-strip'.  However `strip' might not be the right
1326bbe1b32bSmrg# tool to use in cross-compilation environments, therefore Automake
1327bbe1b32bSmrg# will honor the `STRIP' environment variable to overrule this program.
1328bbe1b32bSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
1329bbe1b32bSmrgif test "$cross_compiling" != no; then
1330bbe1b32bSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
1331bbe1b32bSmrgfi
1332bbe1b32bSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1333bbe1b32bSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
1334bbe1b32bSmrg
1335bbe1b32bSmrg# Copyright (C) 2006  Free Software Foundation, Inc.
1336bbe1b32bSmrg#
1337bbe1b32bSmrg# This file is free software; the Free Software Foundation
1338bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
1339bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
1340bbe1b32bSmrg
1341bbe1b32bSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
1342bbe1b32bSmrg# ---------------------------
1343ce6676dbSmrg# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.
1344bbe1b32bSmrg# This macro is traced by Automake.
1345bbe1b32bSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
1346bbe1b32bSmrg
1347bbe1b32bSmrg# Check how to create a tarball.                            -*- Autoconf -*-
1348bbe1b32bSmrg
1349bbe1b32bSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
1350bbe1b32bSmrg#
1351bbe1b32bSmrg# This file is free software; the Free Software Foundation
1352bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
1353bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
1354bbe1b32bSmrg
1355bbe1b32bSmrg# serial 2
1356bbe1b32bSmrg
1357bbe1b32bSmrg# _AM_PROG_TAR(FORMAT)
1358bbe1b32bSmrg# --------------------
1359bbe1b32bSmrg# Check how to create a tarball in format FORMAT.
1360bbe1b32bSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
1361bbe1b32bSmrg#
1362bbe1b32bSmrg# Substitute a variable $(am__tar) that is a command
1363bbe1b32bSmrg# writing to stdout a FORMAT-tarball containing the directory
1364bbe1b32bSmrg# $tardir.
1365bbe1b32bSmrg#     tardir=directory && $(am__tar) > result.tar
1366bbe1b32bSmrg#
1367bbe1b32bSmrg# Substitute a variable $(am__untar) that extract such
1368bbe1b32bSmrg# a tarball read from stdin.
1369bbe1b32bSmrg#     $(am__untar) < result.tar
1370bbe1b32bSmrgAC_DEFUN([_AM_PROG_TAR],
1371bbe1b32bSmrg[# Always define AMTAR for backward compatibility.
1372bbe1b32bSmrgAM_MISSING_PROG([AMTAR], [tar])
1373bbe1b32bSmrgm4_if([$1], [v7],
1374bbe1b32bSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
1375bbe1b32bSmrg     [m4_case([$1], [ustar],, [pax],,
1376bbe1b32bSmrg              [m4_fatal([Unknown tar format])])
1377bbe1b32bSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
1378bbe1b32bSmrg# Loop over all known methods to create a tar archive until one works.
1379bbe1b32bSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1380bbe1b32bSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
1381bbe1b32bSmrg# Do not fold the above two line into one, because Tru64 sh and
1382bbe1b32bSmrg# Solaris sh will not grok spaces in the rhs of `-'.
1383bbe1b32bSmrgfor _am_tool in $_am_tools
1384bbe1b32bSmrgdo
1385bbe1b32bSmrg  case $_am_tool in
1386bbe1b32bSmrg  gnutar)
1387bbe1b32bSmrg    for _am_tar in tar gnutar gtar;
1388bbe1b32bSmrg    do
1389bbe1b32bSmrg      AM_RUN_LOG([$_am_tar --version]) && break
1390bbe1b32bSmrg    done
1391bbe1b32bSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1392bbe1b32bSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1393bbe1b32bSmrg    am__untar="$_am_tar -xf -"
1394bbe1b32bSmrg    ;;
1395bbe1b32bSmrg  plaintar)
1396bbe1b32bSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
1397bbe1b32bSmrg    # ustar tarball either.
1398bbe1b32bSmrg    (tar --version) >/dev/null 2>&1 && continue
1399bbe1b32bSmrg    am__tar='tar chf - "$$tardir"'
1400bbe1b32bSmrg    am__tar_='tar chf - "$tardir"'
1401bbe1b32bSmrg    am__untar='tar xf -'
1402bbe1b32bSmrg    ;;
1403bbe1b32bSmrg  pax)
1404bbe1b32bSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
1405bbe1b32bSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
1406bbe1b32bSmrg    am__untar='pax -r'
1407bbe1b32bSmrg    ;;
1408bbe1b32bSmrg  cpio)
1409bbe1b32bSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1410bbe1b32bSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1411bbe1b32bSmrg    am__untar='cpio -i -H $1 -d'
1412bbe1b32bSmrg    ;;
1413bbe1b32bSmrg  none)
1414bbe1b32bSmrg    am__tar=false
1415bbe1b32bSmrg    am__tar_=false
1416bbe1b32bSmrg    am__untar=false
1417bbe1b32bSmrg    ;;
1418bbe1b32bSmrg  esac
1419bbe1b32bSmrg
1420bbe1b32bSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
1421bbe1b32bSmrg  # and am__untar set.
1422bbe1b32bSmrg  test -n "${am_cv_prog_tar_$1}" && break
1423bbe1b32bSmrg
1424bbe1b32bSmrg  # tar/untar a dummy directory, and stop if the command works
1425bbe1b32bSmrg  rm -rf conftest.dir
1426bbe1b32bSmrg  mkdir conftest.dir
1427bbe1b32bSmrg  echo GrepMe > conftest.dir/file
1428bbe1b32bSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1429bbe1b32bSmrg  rm -rf conftest.dir
1430bbe1b32bSmrg  if test -s conftest.tar; then
1431bbe1b32bSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
1432bbe1b32bSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1433bbe1b32bSmrg  fi
1434bbe1b32bSmrgdone
1435bbe1b32bSmrgrm -rf conftest.dir
1436bbe1b32bSmrg
1437bbe1b32bSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1438bbe1b32bSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
1439bbe1b32bSmrgAC_SUBST([am__tar])
1440bbe1b32bSmrgAC_SUBST([am__untar])
1441bbe1b32bSmrg]) # _AM_PROG_TAR
1442bbe1b32bSmrg
1443ce6676dbSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1444ce6676dbSmrgdnl
1445ce6676dbSmrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
1446ce6676dbSmrgdnl 
1447ce6676dbSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
1448ce6676dbSmrgdnl copy of this software and associated documentation files (the
1449ce6676dbSmrgdnl "Software"), to deal in the Software without restriction, including
1450ce6676dbSmrgdnl without limitation the rights to use, copy, modify, merge, publish,
1451ce6676dbSmrgdnl distribute, and/or sell copies of the Software, and to permit persons
1452ce6676dbSmrgdnl to whom the Software is furnished to do so, provided that the above
1453ce6676dbSmrgdnl copyright notice(s) and this permission notice appear in all copies of
1454ce6676dbSmrgdnl the Software and that both the above copyright notice(s) and this
1455ce6676dbSmrgdnl permission notice appear in supporting documentation.
1456ce6676dbSmrgdnl
1457ce6676dbSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1458ce6676dbSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1459ce6676dbSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
1460ce6676dbSmrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
1461ce6676dbSmrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
1462ce6676dbSmrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
1463ce6676dbSmrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
1464ce6676dbSmrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
1465ce6676dbSmrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1466ce6676dbSmrgdnl
1467ce6676dbSmrgdnl Except as contained in this notice, the name of a copyright holder
1468ce6676dbSmrgdnl shall not be used in advertising or otherwise to promote the sale, use
1469ce6676dbSmrgdnl or other dealings in this Software without prior written authorization
1470ce6676dbSmrgdnl of the copyright holder.
1471ce6676dbSmrg
1472ce6676dbSmrg# XORG_MACROS_VERSION(required-version)
1473ce6676dbSmrg# -------------------------------------
1474ce6676dbSmrg# Minimum version: 1.1.0
1475ce6676dbSmrg#
1476ce6676dbSmrg# If you're using a macro added in Version 1.1 or newer, include this in
1477ce6676dbSmrg# your configure.ac with the minimum required version, such as:
1478ce6676dbSmrg# XORG_MACROS_VERSION(1.1)
1479ce6676dbSmrg#
1480ce6676dbSmrg# To ensure that this macro is defined, also add:
1481ce6676dbSmrg# m4_ifndef([XORG_MACROS_VERSION],
1482ce6676dbSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
1483ce6676dbSmrg#
1484ce6676dbSmrg#
1485ce6676dbSmrg# See the "minimum version" comment for each macro you use to see what 
1486ce6676dbSmrg# version you require.
1487ce6676dbSmrgm4_defun([XORG_MACROS_VERSION],[
1488ce6676dbSmrgm4_define([vers_have], [1.2.2])
1489ce6676dbSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1490ce6676dbSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1491ce6676dbSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
1492ce6676dbSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1493ce6676dbSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
1494ce6676dbSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1495ce6676dbSmrgm4_undefine([vers_have])
1496ce6676dbSmrgm4_undefine([maj_have])
1497ce6676dbSmrgm4_undefine([maj_needed])
1498ce6676dbSmrg]) # XORG_MACROS_VERSION
1499ce6676dbSmrg
1500ce6676dbSmrg# XORG_PROG_RAWCPP()
1501ce6676dbSmrg# ------------------
1502ce6676dbSmrg# Minimum version: 1.0.0
1503ce6676dbSmrg#
1504ce6676dbSmrg# Find cpp program and necessary flags for use in pre-processing text files
1505ce6676dbSmrg# such as man pages and config files
1506ce6676dbSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
1507ce6676dbSmrgAC_REQUIRE([AC_PROG_CPP])
1508ce6676dbSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
1509ce6676dbSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1510ce6676dbSmrg
1511ce6676dbSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
1512ce6676dbSmrg# which is not the best choice for supporting other OS'es, but covers most
1513ce6676dbSmrg# of the ones we need for now.
1514ce6676dbSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
1515ce6676dbSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
1516ce6676dbSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1517ce6676dbSmrg	AC_MSG_RESULT([no])
1518ce6676dbSmrgelse
1519ce6676dbSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1520ce6676dbSmrg		RAWCPPFLAGS=-undef
1521ce6676dbSmrg		AC_MSG_RESULT([yes])
1522ce6676dbSmrg	# under Cygwin unix is still defined even with -undef
1523ce6676dbSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1524ce6676dbSmrg		RAWCPPFLAGS="-undef -ansi"
1525ce6676dbSmrg		AC_MSG_RESULT([yes, with -ansi])
1526ce6676dbSmrg	else
1527ce6676dbSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1528ce6676dbSmrg	fi
1529ce6676dbSmrgfi
1530ce6676dbSmrgrm -f conftest.$ac_ext
1531ce6676dbSmrg
1532ce6676dbSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
1533ce6676dbSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
1534ce6676dbSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1535ce6676dbSmrg	AC_MSG_RESULT([no])
1536ce6676dbSmrgelse
1537ce6676dbSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1538ce6676dbSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1539ce6676dbSmrg		AC_MSG_RESULT([yes])
1540ce6676dbSmrg	else
1541ce6676dbSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1542ce6676dbSmrg	fi
1543ce6676dbSmrgfi
1544ce6676dbSmrgrm -f conftest.$ac_ext
1545ce6676dbSmrgAC_SUBST(RAWCPPFLAGS)
1546ce6676dbSmrg]) # XORG_PROG_RAWCPP
1547ce6676dbSmrg
1548ce6676dbSmrg# XORG_MANPAGE_SECTIONS()
1549ce6676dbSmrg# -----------------------
1550ce6676dbSmrg# Minimum version: 1.0.0
1551ce6676dbSmrg#
1552ce6676dbSmrg# Determine which sections man pages go in for the different man page types
1553ce6676dbSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1554ce6676dbSmrg# Not sure if there's any better way than just hardcoding by OS name.
1555ce6676dbSmrg# Override default settings by setting environment variables
1556ce6676dbSmrg
1557ce6676dbSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1558ce6676dbSmrgAC_REQUIRE([AC_CANONICAL_HOST])
1559ce6676dbSmrg
1560ce6676dbSmrgif test x$APP_MAN_SUFFIX = x    ; then
1561ce6676dbSmrg    APP_MAN_SUFFIX=1
1562ce6676dbSmrgfi
1563ce6676dbSmrgif test x$APP_MAN_DIR = x    ; then
1564ce6676dbSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1565ce6676dbSmrgfi
1566ce6676dbSmrg
1567ce6676dbSmrgif test x$LIB_MAN_SUFFIX = x    ; then
1568ce6676dbSmrg    LIB_MAN_SUFFIX=3
1569ce6676dbSmrgfi
1570ce6676dbSmrgif test x$LIB_MAN_DIR = x    ; then
1571ce6676dbSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1572ce6676dbSmrgfi
1573ce6676dbSmrg
1574ce6676dbSmrgif test x$FILE_MAN_SUFFIX = x    ; then
1575ce6676dbSmrg    case $host_os in
1576ce6676dbSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
1577ce6676dbSmrg	*)		FILE_MAN_SUFFIX=5  ;;
1578ce6676dbSmrg    esac
1579ce6676dbSmrgfi
1580ce6676dbSmrgif test x$FILE_MAN_DIR = x    ; then
1581ce6676dbSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1582ce6676dbSmrgfi
1583ce6676dbSmrg
1584ce6676dbSmrgif test x$MISC_MAN_SUFFIX = x    ; then
1585ce6676dbSmrg    case $host_os in
1586ce6676dbSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
1587ce6676dbSmrg	*)		MISC_MAN_SUFFIX=7  ;;
1588ce6676dbSmrg    esac
1589ce6676dbSmrgfi
1590ce6676dbSmrgif test x$MISC_MAN_DIR = x    ; then
1591ce6676dbSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1592ce6676dbSmrgfi
1593ce6676dbSmrg
1594ce6676dbSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
1595ce6676dbSmrg    case $host_os in
1596ce6676dbSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
1597ce6676dbSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
1598ce6676dbSmrg    esac
1599ce6676dbSmrgfi
1600ce6676dbSmrgif test x$DRIVER_MAN_DIR = x    ; then
1601ce6676dbSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1602ce6676dbSmrgfi
1603ce6676dbSmrg
1604ce6676dbSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
1605ce6676dbSmrg    case $host_os in
1606ce6676dbSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
1607ce6676dbSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
1608ce6676dbSmrg    esac
1609ce6676dbSmrgfi
1610ce6676dbSmrgif test x$ADMIN_MAN_DIR = x    ; then
1611ce6676dbSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1612ce6676dbSmrgfi
1613ce6676dbSmrg
1614ce6676dbSmrg
1615ce6676dbSmrgAC_SUBST([APP_MAN_SUFFIX])
1616ce6676dbSmrgAC_SUBST([LIB_MAN_SUFFIX])
1617ce6676dbSmrgAC_SUBST([FILE_MAN_SUFFIX])
1618ce6676dbSmrgAC_SUBST([MISC_MAN_SUFFIX])
1619ce6676dbSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
1620ce6676dbSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
1621ce6676dbSmrgAC_SUBST([APP_MAN_DIR])
1622ce6676dbSmrgAC_SUBST([LIB_MAN_DIR])
1623ce6676dbSmrgAC_SUBST([FILE_MAN_DIR])
1624ce6676dbSmrgAC_SUBST([MISC_MAN_DIR])
1625ce6676dbSmrgAC_SUBST([DRIVER_MAN_DIR])
1626ce6676dbSmrgAC_SUBST([ADMIN_MAN_DIR])
1627ce6676dbSmrg]) # XORG_MANPAGE_SECTIONS
1628ce6676dbSmrg
1629ce6676dbSmrg# XORG_CHECK_LINUXDOC
1630ce6676dbSmrg# -------------------
1631ce6676dbSmrg# Minimum version: 1.0.0
1632ce6676dbSmrg#
1633ce6676dbSmrg# Defines the variable MAKE_TEXT if the necessary tools and
1634ce6676dbSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1635ce6676dbSmrg# Whether or not the necessary tools and files are found can be checked
1636ce6676dbSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1637ce6676dbSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
1638ce6676dbSmrgif test x$XORG_SGML_PATH = x ; then
1639ce6676dbSmrg    XORG_SGML_PATH=$prefix/share/sgml
1640ce6676dbSmrgfi
1641ce6676dbSmrgHAVE_DEFS_ENT=
1642ce6676dbSmrg
1643ce6676dbSmrgif test x"$cross_compiling" = x"yes" ; then
1644ce6676dbSmrg  HAVE_DEFS_ENT=no
1645ce6676dbSmrgelse
1646ce6676dbSmrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1647ce6676dbSmrgfi
1648ce6676dbSmrg
1649ce6676dbSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
1650ce6676dbSmrgAC_PATH_PROG(PS2PDF, ps2pdf)
1651ce6676dbSmrg
1652ce6676dbSmrgAC_MSG_CHECKING([Whether to build documentation])
1653ce6676dbSmrg
1654ce6676dbSmrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
1655ce6676dbSmrg   BUILDDOC=yes
1656ce6676dbSmrgelse
1657ce6676dbSmrg   BUILDDOC=no
1658ce6676dbSmrgfi
1659ce6676dbSmrg
1660ce6676dbSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1661ce6676dbSmrg
1662ce6676dbSmrgAC_MSG_RESULT([$BUILDDOC])
1663ce6676dbSmrg
1664ce6676dbSmrgAC_MSG_CHECKING([Whether to build pdf documentation])
1665ce6676dbSmrg
1666ce6676dbSmrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
1667ce6676dbSmrg   BUILDPDFDOC=yes
1668ce6676dbSmrgelse
1669ce6676dbSmrg   BUILDPDFDOC=no
1670ce6676dbSmrgfi
1671ce6676dbSmrg
1672ce6676dbSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1673ce6676dbSmrg
1674ce6676dbSmrgAC_MSG_RESULT([$BUILDPDFDOC])
1675ce6676dbSmrg
1676ce6676dbSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
1677ce6676dbSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1678ce6676dbSmrgMAKE_PDF="$PS2PDF"
1679ce6676dbSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1680ce6676dbSmrg
1681ce6676dbSmrgAC_SUBST(MAKE_TEXT)
1682ce6676dbSmrgAC_SUBST(MAKE_PS)
1683ce6676dbSmrgAC_SUBST(MAKE_PDF)
1684ce6676dbSmrgAC_SUBST(MAKE_HTML)
1685ce6676dbSmrg]) # XORG_CHECK_LINUXDOC
1686ce6676dbSmrg
1687ce6676dbSmrg# XORG_CHECK_DOCBOOK
1688ce6676dbSmrg# -------------------
1689ce6676dbSmrg# Minimum version: 1.0.0
1690ce6676dbSmrg#
1691ce6676dbSmrg# Checks for the ability to build output formats from SGML DocBook source.
1692ce6676dbSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1693ce6676dbSmrg# indicates whether the necessary tools and files are found and, if set,
1694ce6676dbSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1695ce6676dbSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
1696ce6676dbSmrgif test x$XORG_SGML_PATH = x ; then
1697ce6676dbSmrg    XORG_SGML_PATH=$prefix/share/sgml
1698ce6676dbSmrgfi
1699ce6676dbSmrgHAVE_DEFS_ENT=
1700ce6676dbSmrgBUILDTXTDOC=no
1701ce6676dbSmrgBUILDPDFDOC=no
1702ce6676dbSmrgBUILDPSDOC=no
1703ce6676dbSmrgBUILDHTMLDOC=no
1704ce6676dbSmrg
1705ce6676dbSmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1706ce6676dbSmrg
1707ce6676dbSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
1708ce6676dbSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1709ce6676dbSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
1710ce6676dbSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1711ce6676dbSmrg
1712ce6676dbSmrgAC_MSG_CHECKING([Whether to build text documentation])
1713ce6676dbSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
1714ce6676dbSmrg   test x$BUILD_TXTDOC != xno; then
1715ce6676dbSmrg	BUILDTXTDOC=yes
1716ce6676dbSmrgfi
1717ce6676dbSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1718ce6676dbSmrgAC_MSG_RESULT([$BUILDTXTDOC])
1719ce6676dbSmrg
1720ce6676dbSmrgAC_MSG_CHECKING([Whether to build PDF documentation])
1721ce6676dbSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
1722ce6676dbSmrg   test x$BUILD_PDFDOC != xno; then
1723ce6676dbSmrg	BUILDPDFDOC=yes
1724ce6676dbSmrgfi
1725ce6676dbSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1726ce6676dbSmrgAC_MSG_RESULT([$BUILDPDFDOC])
1727ce6676dbSmrg
1728ce6676dbSmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
1729ce6676dbSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
1730ce6676dbSmrg   test x$BUILD_PSDOC != xno; then
1731ce6676dbSmrg	BUILDPSDOC=yes
1732ce6676dbSmrgfi
1733ce6676dbSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1734ce6676dbSmrgAC_MSG_RESULT([$BUILDPSDOC])
1735ce6676dbSmrg
1736ce6676dbSmrgAC_MSG_CHECKING([Whether to build HTML documentation])
1737ce6676dbSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
1738ce6676dbSmrg   test x$BUILD_HTMLDOC != xno; then
1739ce6676dbSmrg	BUILDHTMLDOC=yes
1740ce6676dbSmrgfi
1741ce6676dbSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1742ce6676dbSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
1743ce6676dbSmrg
1744ce6676dbSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1745ce6676dbSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1746ce6676dbSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1747ce6676dbSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1748ce6676dbSmrg
1749ce6676dbSmrgAC_SUBST(MAKE_TEXT)
1750ce6676dbSmrgAC_SUBST(MAKE_PS)
1751ce6676dbSmrgAC_SUBST(MAKE_PDF)
1752ce6676dbSmrgAC_SUBST(MAKE_HTML)
1753ce6676dbSmrg]) # XORG_CHECK_DOCBOOK
1754ce6676dbSmrg
1755ce6676dbSmrg# XORG_CHECK_MALLOC_ZERO
1756ce6676dbSmrg# ----------------------
1757ce6676dbSmrg# Minimum version: 1.0.0
1758ce6676dbSmrg#
1759ce6676dbSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1760ce6676dbSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1761ce6676dbSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1762ce6676dbSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1763ce6676dbSmrgAC_ARG_ENABLE(malloc0returnsnull,
1764ce6676dbSmrg	AC_HELP_STRING([--enable-malloc0returnsnull],
1765ce6676dbSmrg		       [malloc(0) returns NULL (default: auto)]),
1766ce6676dbSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1767ce6676dbSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1768ce6676dbSmrg
1769ce6676dbSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1770ce6676dbSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1771ce6676dbSmrg	AC_RUN_IFELSE([
1772ce6676dbSmrgchar *malloc();
1773ce6676dbSmrgchar *realloc();
1774ce6676dbSmrgchar *calloc();
1775ce6676dbSmrgmain() {
1776ce6676dbSmrg    char *m0, *r0, *c0, *p;
1777ce6676dbSmrg    m0 = malloc(0);
1778ce6676dbSmrg    p = malloc(10);
1779ce6676dbSmrg    r0 = realloc(p,0);
1780ce6676dbSmrg    c0 = calloc(0);
1781ce6676dbSmrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
1782ce6676dbSmrg}],
1783ce6676dbSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
1784ce6676dbSmrg		[MALLOC_ZERO_RETURNS_NULL=no])
1785ce6676dbSmrgfi
1786ce6676dbSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1787ce6676dbSmrg
1788ce6676dbSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1789ce6676dbSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1790ce6676dbSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1791ce6676dbSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1792ce6676dbSmrgelse
1793ce6676dbSmrg	MALLOC_ZERO_CFLAGS=""
1794ce6676dbSmrg	XMALLOC_ZERO_CFLAGS=""
1795ce6676dbSmrg	XTMALLOC_ZERO_CFLAGS=""
1796ce6676dbSmrgfi
1797ce6676dbSmrg
1798ce6676dbSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1799ce6676dbSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1800ce6676dbSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1801ce6676dbSmrg]) # XORG_CHECK_MALLOC_ZERO
1802ce6676dbSmrg
1803ce6676dbSmrg# XORG_WITH_LINT()
1804ce6676dbSmrg# ----------------
1805ce6676dbSmrg# Minimum version: 1.1.0
1806ce6676dbSmrg#
1807ce6676dbSmrg# Sets up flags for source checkers such as lint and sparse if --with-lint
1808ce6676dbSmrg# is specified.   (Use --with-lint=sparse for sparse.)
1809ce6676dbSmrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
1810ce6676dbSmrg# Sets $LINT_FLAGS to flags to pass to source checker
1811ce6676dbSmrg# Sets LINT automake conditional if enabled (default: disabled)
1812ce6676dbSmrg#
1813ce6676dbSmrgAC_DEFUN([XORG_WITH_LINT],[
1814ce6676dbSmrg
1815ce6676dbSmrg# Allow checking code with lint, sparse, etc.
1816ce6676dbSmrgAC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
1817ce6676dbSmrg		[Use a lint-style source code checker (default: disabled)])],
1818ce6676dbSmrg		[use_lint=$withval], [use_lint=no])
1819ce6676dbSmrgif test "x$use_lint" = "xyes" ; then
1820ce6676dbSmrg	LINT="lint"
1821ce6676dbSmrgelse
1822ce6676dbSmrg	LINT="$use_lint"
1823ce6676dbSmrgfi
1824ce6676dbSmrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
1825ce6676dbSmrg    case $LINT in
1826ce6676dbSmrg	lint|*/lint)
1827ce6676dbSmrg	    case $host_os in
1828ce6676dbSmrg		solaris*)
1829ce6676dbSmrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1830ce6676dbSmrg			;;
1831ce6676dbSmrg	    esac
1832ce6676dbSmrg	    ;;
1833ce6676dbSmrg    esac
1834ce6676dbSmrgfi
1835ce6676dbSmrg
1836ce6676dbSmrgAC_SUBST(LINT)
1837ce6676dbSmrgAC_SUBST(LINT_FLAGS)
1838ce6676dbSmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
1839ce6676dbSmrg
1840ce6676dbSmrg]) # XORG_WITH_LINT
1841ce6676dbSmrg
1842ce6676dbSmrg# XORG_LINT_LIBRARY(LIBNAME)
1843ce6676dbSmrg# --------------------------
1844ce6676dbSmrg# Minimum version: 1.1.0
1845ce6676dbSmrg#
1846ce6676dbSmrg# Sets up flags for building lint libraries for checking programs that call
1847ce6676dbSmrg# functions in the library.
1848ce6676dbSmrg# Disabled by default, enable with --enable-lint-library
1849ce6676dbSmrg# Sets: 
1850ce6676dbSmrg#	@LINTLIB@		- name of lint library file to make
1851ce6676dbSmrg#	MAKE_LINT_LIB		- automake conditional
1852ce6676dbSmrg#
1853ce6676dbSmrg
1854ce6676dbSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
1855ce6676dbSmrgAC_REQUIRE([XORG_WITH_LINT])
1856ce6676dbSmrg# Build lint "library" for more indepth checks of programs calling this library
1857ce6676dbSmrgAC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
1858ce6676dbSmrg	[Create lint library (default: disabled)])],
1859ce6676dbSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
1860ce6676dbSmrgif test "x$make_lint_lib" != "xno" ; then
1861ce6676dbSmrg	if test "x$LINT" = "xno" ; then
1862ce6676dbSmrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
1863ce6676dbSmrg	fi
1864ce6676dbSmrg	if test "x$make_lint_lib" = "xyes" ; then
1865ce6676dbSmrg		LINTLIB=llib-l$1.ln
1866ce6676dbSmrg	else
1867ce6676dbSmrg		LINTLIB=$make_lint_lib
1868ce6676dbSmrg	fi
1869ce6676dbSmrgfi
1870ce6676dbSmrgAC_SUBST(LINTLIB)
1871ce6676dbSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1872ce6676dbSmrg
1873ce6676dbSmrg]) # XORG_LINT_LIBRARY
1874ce6676dbSmrg
1875ce6676dbSmrg# XORG_CWARNFLAGS
1876ce6676dbSmrg# ---------------
1877ce6676dbSmrg# Minimum version: 1.2.0
1878ce6676dbSmrg#
1879ce6676dbSmrg# Defines CWARNFLAGS to enable C compiler warnings.
1880ce6676dbSmrg#
1881ce6676dbSmrgAC_DEFUN([XORG_CWARNFLAGS], [
1882ce6676dbSmrgAC_REQUIRE([AC_PROG_CC])
1883ce6676dbSmrgif  test "x$GCC" = xyes ; then
1884ce6676dbSmrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
1885ce6676dbSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
1886ce6676dbSmrg-Wbad-function-cast"
1887ce6676dbSmrg    case `$CC -dumpversion` in
1888ce6676dbSmrg    3.4.* | 4.*)
1889ce6676dbSmrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
1890ce6676dbSmrg	;;
1891ce6676dbSmrg    esac
1892ce6676dbSmrgelse
1893ce6676dbSmrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1894ce6676dbSmrg    if test "x$SUNCC" = "xyes"; then
1895ce6676dbSmrg	CWARNFLAGS="-v"
1896ce6676dbSmrg    fi
1897ce6676dbSmrgfi
1898ce6676dbSmrgAC_SUBST(CWARNFLAGS)
1899ce6676dbSmrg]) # XORG_CWARNFLAGS
1900ce6676dbSmrgdnl Copyright 2005 Red Hat, Inc
1901ce6676dbSmrgdnl
1902ce6676dbSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1903ce6676dbSmrgdnl documentation for any purpose is hereby granted without fee, provided that
1904ce6676dbSmrgdnl the above copyright notice appear in all copies and that both that
1905ce6676dbSmrgdnl copyright notice and this permission notice appear in supporting
1906ce6676dbSmrgdnl documentation.
1907ce6676dbSmrgdnl
1908ce6676dbSmrgdnl The above copyright notice and this permission notice shall be included
1909ce6676dbSmrgdnl in all copies or substantial portions of the Software.
1910ce6676dbSmrgdnl
1911ce6676dbSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1912ce6676dbSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1913ce6676dbSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1914ce6676dbSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1915ce6676dbSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1916ce6676dbSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1917ce6676dbSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
1918ce6676dbSmrgdnl
1919ce6676dbSmrgdnl Except as contained in this notice, the name of the copyright holders shall
1920ce6676dbSmrgdnl not be used in advertising or otherwise to promote the sale, use or
1921ce6676dbSmrgdnl other dealings in this Software without prior written authorization
1922ce6676dbSmrgdnl from the copyright holders.
1923ce6676dbSmrgdnl
1924ce6676dbSmrg
1925ce6676dbSmrg# XORG_RELEASE_VERSION
1926ce6676dbSmrg# --------------------
1927ce6676dbSmrg# Adds --with/without-release-string and changes the PACKAGE and
1928ce6676dbSmrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
1929ce6676dbSmrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
1930ce6676dbSmrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1931ce6676dbSmrg 
1932ce6676dbSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
1933ce6676dbSmrg	AC_ARG_WITH(release-version,
1934ce6676dbSmrg			AC_HELP_STRING([--with-release-version=STRING],
1935ce6676dbSmrg				[Use release version string in package name]),
1936ce6676dbSmrg			[RELEASE_VERSION="$withval"],
1937ce6676dbSmrg			[RELEASE_VERSION=""])
1938ce6676dbSmrg	if test "x$RELEASE_VERSION" != "x"; then
1939ce6676dbSmrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
1940ce6676dbSmrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
1941ce6676dbSmrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
1942ce6676dbSmrg	fi
1943ce6676dbSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1944ce6676dbSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
1945ce6676dbSmrg		[Major version of this package])
1946ce6676dbSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
1947ce6676dbSmrg	if test "x$PVM" = "x"; then
1948ce6676dbSmrg		PVM="0"
1949ce6676dbSmrg	fi
1950ce6676dbSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
1951ce6676dbSmrg		[$PVM],
1952ce6676dbSmrg		[Minor version of this package])
1953ce6676dbSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
1954ce6676dbSmrg	if test "x$PVP" = "x"; then
1955ce6676dbSmrg		PVP="0"
1956ce6676dbSmrg	fi
1957ce6676dbSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1958ce6676dbSmrg		[$PVP],
1959ce6676dbSmrg		[Patch version of this package])
1960ce6676dbSmrg])
1961ce6676dbSmrg
1962ce6676dbSmrg# XORG_CHANGELOG()
1963ce6676dbSmrg# ----------------
1964ce6676dbSmrg# Minimum version: 1.2.0
1965ce6676dbSmrg#
1966ce6676dbSmrg# Defines the variable CHANGELOG_CMD as the command to generate
1967ce6676dbSmrg# ChangeLog from git.
1968ce6676dbSmrg#
1969ce6676dbSmrg# Arrange that distcleancheck ignores ChangeLog left over by distclean.
1970ce6676dbSmrg#
1971ce6676dbSmrgAC_DEFUN([XORG_CHANGELOG], [
1972ce6676dbSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
1973ce6676dbSmrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
1974ce6676dbSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
1975ce6676dbSmrgAC_SUBST([CHANGELOG_CMD])
1976ce6676dbSmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
1977ce6676dbSmrg]) # XORG_CHANGELOG
1978ce6676dbSmrg
1979ce6676dbSmrgdnl $XdotOrg: lib/xtrans/xtrans.m4,v 1.6 2005/07/26 18:59:11 alanc Exp $
1980ce6676dbSmrgdnl
1981ce6676dbSmrgdnl Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
1982ce6676dbSmrgdnl 
1983ce6676dbSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1984ce6676dbSmrgdnl documentation for any purpose is hereby granted without fee, provided that
1985ce6676dbSmrgdnl the above copyright notice appear in all copies and that both that
1986ce6676dbSmrgdnl copyright notice and this permission notice appear in supporting
1987ce6676dbSmrgdnl documentation.
1988ce6676dbSmrgdnl 
1989ce6676dbSmrgdnl The above copyright notice and this permission notice shall be included
1990ce6676dbSmrgdnl in all copies or substantial portions of the Software.
1991ce6676dbSmrgdnl 
1992ce6676dbSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1993ce6676dbSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1994ce6676dbSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1995ce6676dbSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1996ce6676dbSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1997ce6676dbSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1998ce6676dbSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
1999ce6676dbSmrgdnl 
2000ce6676dbSmrgdnl Except as contained in this notice, the name of the copyright holders shall
2001ce6676dbSmrgdnl not be used in advertising or otherwise to promote the sale, use or
2002ce6676dbSmrgdnl other dealings in this Software without prior written authorization
2003ce6676dbSmrgdnl from the copyright holders.
2004ce6676dbSmrgdnl 
2005ce6676dbSmrg
2006ce6676dbSmrg# XTRANS_TCP_FLAGS()
2007ce6676dbSmrg# ------------------
2008ce6676dbSmrg# Find needed libraries for TCP sockets, and check for IPv6 support
2009ce6676dbSmrgAC_DEFUN([XTRANS_TCP_FLAGS],[
2010ce6676dbSmrg # SVR4 hides these in libraries other than libc
2011ce6676dbSmrg AC_SEARCH_LIBS(socket, [socket])
2012ce6676dbSmrg AC_SEARCH_LIBS(gethostbyname, [nsl])
2013ce6676dbSmrg AC_HAVE_LIBRARY([ws2_32])
2014ce6676dbSmrg
2015ce6676dbSmrg # Needs to come after above checks for libsocket & libnsl for SVR4 systems
2016ce6676dbSmrg AC_ARG_ENABLE(ipv6, 
2017ce6676dbSmrg	AC_HELP_STRING([--enable-ipv6],[Enable IPv6 support]),
2018ce6676dbSmrg	[IPV6CONN=$enableval], 
2019ce6676dbSmrg	[AC_CHECK_FUNC(getaddrinfo,[IPV6CONN=yes],[IPV6CONN=no])])
2020ce6676dbSmrg AC_MSG_CHECKING([if IPv6 support should be built])
2021ce6676dbSmrg if test "$IPV6CONN" = "yes"; then
2022ce6676dbSmrg	AC_DEFINE(IPv6,1,[Support IPv6 for TCP connections])
2023ce6676dbSmrg fi
2024ce6676dbSmrg AC_MSG_RESULT($IPV6CONN)
2025ce6676dbSmrg
2026ce6676dbSmrg # 4.3BSD-Reno added a new member to struct sockaddr_in
2027ce6676dbSmrg AC_CHECK_MEMBER([struct sockaddr_in.sin_len], 
2028ce6676dbSmrg	AC_DEFINE([BSD44SOCKETS],1,
2029ce6676dbSmrg 	    [Define to 1 if `struct sockaddr_in' has a `sin_len' member]), [], [
2030ce6676dbSmrg#include <sys/types.h>
2031ce6676dbSmrg#include <sys/socket.h>
2032ce6676dbSmrg#include <netinet/in.h>
2033ce6676dbSmrg ])
2034ce6676dbSmrg
2035ce6676dbSmrg # POSIX.1g changed the type of pointer passed to getsockname/getpeername/etc.
2036ce6676dbSmrg AC_CHECK_TYPES([socklen_t], [], [], [
2037ce6676dbSmrgAC_INCLUDES_DEFAULT
2038ce6676dbSmrg#include <sys/socket.h>])
2039ce6676dbSmrg 
2040ce6676dbSmrg]) # XTRANS_TCP_FLAGS
2041ce6676dbSmrg
2042ce6676dbSmrg# XTRANS_CONNECTION_FLAGS()
2043ce6676dbSmrg# -------------------------
2044ce6676dbSmrg# Standard checks for which Xtrans transports to use by the Xorg packages
2045ce6676dbSmrg# that use Xtrans functions
2046ce6676dbSmrgAC_DEFUN([XTRANS_CONNECTION_FLAGS],[
2047ce6676dbSmrg AC_REQUIRE([AC_CANONICAL_HOST])
2048ce6676dbSmrg AC_REQUIRE([AC_TYPE_SIGNAL])
2049ce6676dbSmrg [case $host_os in
2050ce6676dbSmrg	mingw*)	unixdef="no"   ;;
2051ce6676dbSmrg	*)	unixdef="yes"  ;;
2052ce6676dbSmrg esac]
2053ce6676dbSmrg AC_ARG_ENABLE(unix-transport,
2054ce6676dbSmrg	AC_HELP_STRING([--enable-unix-transport],[Enable UNIX domain socket transport]),
2055ce6676dbSmrg	[UNIXCONN=$enableval], [UNIXCONN=$unixdef])
2056ce6676dbSmrg AC_MSG_CHECKING([if Xtrans should support UNIX socket connections])
2057ce6676dbSmrg if test "$UNIXCONN" = "yes"; then
2058ce6676dbSmrg	AC_DEFINE(UNIXCONN,1,[Support UNIX socket connections])
2059ce6676dbSmrg fi
2060ce6676dbSmrg AC_MSG_RESULT($UNIXCONN)
2061ce6676dbSmrg AC_ARG_ENABLE(tcp-transport, 
2062ce6676dbSmrg	AC_HELP_STRING([--enable-tcp-transport],[Enable TCP socket transport]),
2063ce6676dbSmrg	[TCPCONN=$enableval], [TCPCONN=yes])
2064ce6676dbSmrg AC_MSG_CHECKING([if Xtrans should support TCP socket connections])
2065ce6676dbSmrg AC_MSG_RESULT($TCPCONN)
2066ce6676dbSmrg if test "$TCPCONN" = "yes"; then
2067ce6676dbSmrg	AC_DEFINE(TCPCONN,1,[Support TCP socket connections])
2068ce6676dbSmrg	XTRANS_TCP_FLAGS
2069ce6676dbSmrg fi
2070ce6676dbSmrg [case $host_os in
2071ce6676dbSmrg	solaris*|sco*|sysv4*)	localdef="yes" ;;
2072ce6676dbSmrg	*)			localdef="no"  ;;
2073ce6676dbSmrg esac]
2074ce6676dbSmrg AC_ARG_ENABLE(local-transport,
2075ce6676dbSmrg	AC_HELP_STRING([--enable-local-transport],[Enable os-specific local transport]),
2076ce6676dbSmrg	[LOCALCONN=$enableval], [LOCALCONN=$localdef])
2077ce6676dbSmrg AC_MSG_CHECKING([if Xtrans should support os-specific local connections])
2078ce6676dbSmrg AC_MSG_RESULT($LOCALCONN)
2079ce6676dbSmrg if test "$LOCALCONN" = "yes"; then
2080ce6676dbSmrg	AC_DEFINE(LOCALCONN,1,[Support os-specific local connections])
2081ce6676dbSmrg fi
2082ce6676dbSmrg 
2083ce6676dbSmrg]) # XTRANS_CONNECTION_FLAGS
2084ce6676dbSmrg
2085ce6676dbSmrg
2086ce6676dbSmrg# XTRANS_SECURE_RPC_FLAGS()
2087ce6676dbSmrg# -------------------------
2088ce6676dbSmrg# Check for Secure RPC functions - must come after XTRANS_TCP_FLAGS
2089ce6676dbSmrg# so that any necessary networking libraries are already found
2090ce6676dbSmrgAC_DEFUN([XTRANS_SECURE_RPC_FLAGS],
2091ce6676dbSmrg[AC_REQUIRE([XTRANS_TCP_FLAGS])
2092ce6676dbSmrg AC_ARG_ENABLE(secure-rpc, 
2093ce6676dbSmrg	AC_HELP_STRING([--enable-secure-rpc],[Enable Secure RPC]),
2094ce6676dbSmrg        [SECURE_RPC=$enableval], [SECURE_RPC="try"])
2095ce6676dbSmrg
2096ce6676dbSmrg if test "x$SECURE_RPC" = "xyes" -o "x$SECURE_RPC" = "xtry" ; then
2097ce6676dbSmrg	FOUND_SECURE_RPC="no"
2098ce6676dbSmrg	AC_CHECK_FUNCS([authdes_seccreate authdes_create],
2099ce6676dbSmrg			[FOUND_SECURE_RPC="yes"])
2100ce6676dbSmrg	if test "x$FOUND_SECURE_RPC" = "xno" ; then
2101ce6676dbSmrg		if test "x$SECURE_RPC" = "xyes" ; then
2102ce6676dbSmrg	AC_MSG_ERROR([Secure RPC requested, but required functions not found])
2103ce6676dbSmrg		fi	
2104ce6676dbSmrg		SECURE_RPC="no"
2105ce6676dbSmrg	else
2106ce6676dbSmrg		dnl FreeBSD keeps getsecretkey in librpcsvc
2107ce6676dbSmrg		AC_SEARCH_LIBS(getsecretkey, [rpcsvc])
2108ce6676dbSmrg		SECURE_RPC="yes"
2109ce6676dbSmrg	fi
2110ce6676dbSmrg fi
2111ce6676dbSmrg AC_MSG_CHECKING([if Secure RPC authentication ("SUN-DES-1") should be supported])
2112ce6676dbSmrg if test "x$SECURE_RPC" = "xyes" ; then
2113ce6676dbSmrg	AC_DEFINE(SECURE_RPC, 1, [Support Secure RPC ("SUN-DES-1") authentication for X11 clients])
2114ce6676dbSmrg fi
2115ce6676dbSmrg AC_MSG_RESULT($SECURE_RPC)
2116ce6676dbSmrg]) # XTRANS_SECURE_RPC_FLAGS
2117ce6676dbSmrg
2118ce6676dbSmrg
2119ce6676dbSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
2120ce6676dbSmrg# 
2121ce6676dbSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
2122ce6676dbSmrg#
2123ce6676dbSmrg# This program is free software; you can redistribute it and/or modify
2124ce6676dbSmrg# it under the terms of the GNU General Public License as published by
2125ce6676dbSmrg# the Free Software Foundation; either version 2 of the License, or
2126ce6676dbSmrg# (at your option) any later version.
2127ce6676dbSmrg#
2128ce6676dbSmrg# This program is distributed in the hope that it will be useful, but
2129ce6676dbSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
2130ce6676dbSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2131ce6676dbSmrg# General Public License for more details.
2132ce6676dbSmrg#
2133ce6676dbSmrg# You should have received a copy of the GNU General Public License
2134ce6676dbSmrg# along with this program; if not, write to the Free Software
2135ce6676dbSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2136ce6676dbSmrg#
2137ce6676dbSmrg# As a special exception to the GNU General Public License, if you
2138ce6676dbSmrg# distribute this file as part of a program that contains a
2139ce6676dbSmrg# configuration script generated by Autoconf, you may include it under
2140ce6676dbSmrg# the same distribution terms that you use for the rest of that program.
2141ce6676dbSmrg
2142ce6676dbSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
2143ce6676dbSmrg# ----------------------------------
2144ce6676dbSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
2145ce6676dbSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
2146ce6676dbSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
2147ce6676dbSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
2148ce6676dbSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
2149ce6676dbSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
2150ce6676dbSmrgfi
2151ce6676dbSmrgif test -n "$PKG_CONFIG"; then
2152ce6676dbSmrg	_pkg_min_version=m4_ifval([$1], [$1], [0.9.0])
2153ce6676dbSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
2154ce6676dbSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
2155ce6676dbSmrg		AC_MSG_RESULT([yes])
2156ce6676dbSmrg	else
2157ce6676dbSmrg		AC_MSG_RESULT([no])
2158ce6676dbSmrg		PKG_CONFIG=""
2159ce6676dbSmrg	fi
2160ce6676dbSmrg		
2161ce6676dbSmrgfi[]dnl
2162ce6676dbSmrg])# PKG_PROG_PKG_CONFIG
2163ce6676dbSmrg
2164ce6676dbSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2165ce6676dbSmrg#
2166ce6676dbSmrg# Check to see whether a particular set of modules exists.  Similar
2167ce6676dbSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
2168ce6676dbSmrg#
2169ce6676dbSmrg#
2170ce6676dbSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
2171ce6676dbSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
2172ce6676dbSmrg# PKG_CHECK_EXISTS manually
2173ce6676dbSmrg# --------------------------------------------------------------
2174ce6676dbSmrgAC_DEFUN([PKG_CHECK_EXISTS],
2175ce6676dbSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2176ce6676dbSmrgif test -n "$PKG_CONFIG" && \
2177ce6676dbSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
2178ce6676dbSmrg  m4_ifval([$2], [$2], [:])
2179ce6676dbSmrgm4_ifvaln([$3], [else
2180ce6676dbSmrg  $3])dnl
2181ce6676dbSmrgfi])
2182ce6676dbSmrg
2183ce6676dbSmrg
2184ce6676dbSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
2185ce6676dbSmrg# ---------------------------------------------
2186ce6676dbSmrgm4_define([_PKG_CONFIG],
2187ce6676dbSmrg[if test -n "$PKG_CONFIG"; then
2188ce6676dbSmrg        PKG_CHECK_EXISTS([$3],
2189ce6676dbSmrg                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
2190ce6676dbSmrg			 [pkg_failed=yes])
2191ce6676dbSmrgelse
2192ce6676dbSmrg	pkg_failed=untried
2193ce6676dbSmrgfi[]dnl
2194ce6676dbSmrg])# _PKG_CONFIG
2195ce6676dbSmrg
2196ce6676dbSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
2197ce6676dbSmrg# [ACTION-IF-NOT-FOUND])
2198ce6676dbSmrg#
2199ce6676dbSmrg#
2200ce6676dbSmrg# Note that if there is a possibility the first call to
2201ce6676dbSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
2202ce6676dbSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
2203ce6676dbSmrg#
2204ce6676dbSmrg#
2205ce6676dbSmrg# --------------------------------------------------------------
2206ce6676dbSmrgAC_DEFUN([PKG_CHECK_MODULES],
2207ce6676dbSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2208ce6676dbSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
2209ce6676dbSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
2210ce6676dbSmrg
2211ce6676dbSmrgpkg_failed=no
2212ce6676dbSmrgAC_MSG_CHECKING([for $1])
2213ce6676dbSmrg
2214ce6676dbSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
2215ce6676dbSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
2216ce6676dbSmrg
2217ce6676dbSmrgif test $pkg_failed = yes; then
2218ce6676dbSmrg	$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
2219ce6676dbSmrg	# Put the nasty error message in config.log where it belongs
2220ce6676dbSmrg	echo "$$1[]_PKG_ERRORS" 1>&AS_MESSAGE_LOG_FD
2221ce6676dbSmrg
2222ce6676dbSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
2223ce6676dbSmrg[Package requirements ($2) were not met.
2224ce6676dbSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
2225ce6676dbSmrginstalled software in a non-standard prefix.
2226ce6676dbSmrg
2227ce6676dbSmrgAlternatively you may set the $1_CFLAGS and $1_LIBS environment variables
2228ce6676dbSmrgto avoid the need to call pkg-config.  See the pkg-config man page for
2229ce6676dbSmrgmore details.])],
2230ce6676dbSmrg		[$4])
2231ce6676dbSmrgelif test $pkg_failed = untried; then
2232ce6676dbSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
2233ce6676dbSmrg[The pkg-config script could not be found or is too old.  Make sure it
2234ce6676dbSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
2235ce6676dbSmrgpath to pkg-config.
2236ce6676dbSmrg
2237ce6676dbSmrgAlternatively you may set the $1_CFLAGS and $1_LIBS environment variables
2238ce6676dbSmrgto avoid the need to call pkg-config.  See the pkg-config man page for
2239ce6676dbSmrgmore details.
2240ce6676dbSmrg
2241ce6676dbSmrgTo get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
2242ce6676dbSmrg		[$4])
2243ce6676dbSmrgelse
2244ce6676dbSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
2245ce6676dbSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
2246ce6676dbSmrg        AC_MSG_RESULT([yes])
2247ce6676dbSmrg	ifelse([$3], , :, [$3])
2248ce6676dbSmrgfi[]dnl
2249ce6676dbSmrg])# PKG_CHECK_MODULES
2250ce6676dbSmrg
2251bbe1b32bSmrgm4_include([acinclude.m4])
2252