aclocal.m4 revision 89d09728
1# generated automatically by aclocal 1.10.2 -*- Autoconf -*-
2
3# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4# 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12# PARTICULAR PURPOSE.
13
14m4_ifndef([AC_AUTOCONF_VERSION],
15  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.64],,
17[m4_warning([this file was generated for autoconf 2.64.
18You have another version of autoconf.  It may work, but is not guaranteed to.
19If you have problems, you may need to regenerate the build system entirely.
20To do so, use the procedure documented by the package, typically `autoreconf'.])])
21
22dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
23dnl
24dnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
25dnl 
26dnl Permission is hereby granted, free of charge, to any person obtaining a
27dnl copy of this software and associated documentation files (the
28dnl "Software"), to deal in the Software without restriction, including
29dnl without limitation the rights to use, copy, modify, merge, publish,
30dnl distribute, and/or sell copies of the Software, and to permit persons
31dnl to whom the Software is furnished to do so, provided that the above
32dnl copyright notice(s) and this permission notice appear in all copies of
33dnl the Software and that both the above copyright notice(s) and this
34dnl permission notice appear in supporting documentation.
35dnl
36dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
37dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
38dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
39dnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
40dnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
41dnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
42dnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
43dnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
44dnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
45dnl
46dnl Except as contained in this notice, the name of a copyright holder
47dnl shall not be used in advertising or otherwise to promote the sale, use
48dnl or other dealings in this Software without prior written authorization
49dnl of the copyright holder.
50
51# XORG_MACROS_VERSION(required-version)
52# -------------------------------------
53# Minimum version: 1.1.0
54#
55# If you're using a macro added in Version 1.1 or newer, include this in
56# your configure.ac with the minimum required version, such as:
57# XORG_MACROS_VERSION(1.1)
58#
59# To force at least a version with this macro defined, also add:
60# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
61#
62#
63# See the "minimum version" comment for each macro you use to see what 
64# version you require.
65AC_DEFUN([XORG_MACROS_VERSION],[
66	[XORG_MACROS_needed_version=$1
67	XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
68	XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
69	AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
70	[XORG_MACROS_version=1.2.1
71	XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
72	XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
73	if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
74		AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x])
75	fi
76	if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
77		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])
78	fi
79	AC_MSG_RESULT([yes, $XORG_MACROS_version])
80]) # XORG_MACROS_VERSION
81
82# XORG_PROG_RAWCPP()
83# ------------------
84# Minimum version: 1.0.0
85#
86# Find cpp program and necessary flags for use in pre-processing text files
87# such as man pages and config files
88AC_DEFUN([XORG_PROG_RAWCPP],[
89AC_REQUIRE([AC_PROG_CPP])
90AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
91   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
92
93# Check for flag to avoid builtin definitions - assumes unix is predefined,
94# which is not the best choice for supporting other OS'es, but covers most
95# of the ones we need for now.
96AC_MSG_CHECKING([if $RAWCPP requires -undef])
97AC_LANG_CONFTEST([Does cpp redefine unix ?])
98if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
99	AC_MSG_RESULT([no])
100else
101	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
102		RAWCPPFLAGS=-undef
103		AC_MSG_RESULT([yes])
104	# under Cygwin unix is still defined even with -undef
105	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
106		RAWCPPFLAGS="-undef -ansi"
107		AC_MSG_RESULT([yes, with -ansi])
108	else
109		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
110	fi
111fi
112rm -f conftest.$ac_ext
113
114AC_MSG_CHECKING([if $RAWCPP requires -traditional])
115AC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
116if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
117	AC_MSG_RESULT([no])
118else
119	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
120		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
121		AC_MSG_RESULT([yes])
122	else
123		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
124	fi
125fi
126rm -f conftest.$ac_ext
127AC_SUBST(RAWCPPFLAGS)
128]) # XORG_PROG_RAWCPP
129
130# XORG_MANPAGE_SECTIONS()
131# -----------------------
132# Minimum version: 1.0.0
133#
134# Determine which sections man pages go in for the different man page types
135# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
136# Not sure if there's any better way than just hardcoding by OS name.
137# Override default settings by setting environment variables
138
139AC_DEFUN([XORG_MANPAGE_SECTIONS],[
140AC_REQUIRE([AC_CANONICAL_HOST])
141
142if test x$APP_MAN_SUFFIX = x    ; then
143    APP_MAN_SUFFIX=1
144fi
145if test x$APP_MAN_DIR = x    ; then
146    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
147fi
148
149if test x$LIB_MAN_SUFFIX = x    ; then
150    LIB_MAN_SUFFIX=3
151fi
152if test x$LIB_MAN_DIR = x    ; then
153    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
154fi
155
156if test x$FILE_MAN_SUFFIX = x    ; then
157    case $host_os in
158	solaris*)	FILE_MAN_SUFFIX=4  ;;
159	*)		FILE_MAN_SUFFIX=5  ;;
160    esac
161fi
162if test x$FILE_MAN_DIR = x    ; then
163    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
164fi
165
166if test x$MISC_MAN_SUFFIX = x    ; then
167    case $host_os in
168	solaris*)	MISC_MAN_SUFFIX=5  ;;
169	*)		MISC_MAN_SUFFIX=7  ;;
170    esac
171fi
172if test x$MISC_MAN_DIR = x    ; then
173    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
174fi
175
176if test x$DRIVER_MAN_SUFFIX = x    ; then
177    case $host_os in
178	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
179	*)		DRIVER_MAN_SUFFIX=4  ;;
180    esac
181fi
182if test x$DRIVER_MAN_DIR = x    ; then
183    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
184fi
185
186if test x$ADMIN_MAN_SUFFIX = x    ; then
187    case $host_os in
188	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
189	*)		ADMIN_MAN_SUFFIX=8  ;;
190    esac
191fi
192if test x$ADMIN_MAN_DIR = x    ; then
193    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
194fi
195
196
197AC_SUBST([APP_MAN_SUFFIX])
198AC_SUBST([LIB_MAN_SUFFIX])
199AC_SUBST([FILE_MAN_SUFFIX])
200AC_SUBST([MISC_MAN_SUFFIX])
201AC_SUBST([DRIVER_MAN_SUFFIX])
202AC_SUBST([ADMIN_MAN_SUFFIX])
203AC_SUBST([APP_MAN_DIR])
204AC_SUBST([LIB_MAN_DIR])
205AC_SUBST([FILE_MAN_DIR])
206AC_SUBST([MISC_MAN_DIR])
207AC_SUBST([DRIVER_MAN_DIR])
208AC_SUBST([ADMIN_MAN_DIR])
209]) # XORG_MANPAGE_SECTIONS
210
211# XORG_CHECK_LINUXDOC
212# -------------------
213# Minimum version: 1.0.0
214#
215# Defines the variable MAKE_TEXT if the necessary tools and
216# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
217# Whether or not the necessary tools and files are found can be checked
218# with the AM_CONDITIONAL "BUILD_LINUXDOC"
219AC_DEFUN([XORG_CHECK_LINUXDOC],[
220if test x$XORG_SGML_PATH = x ; then
221    XORG_SGML_PATH=$prefix/share/sgml
222fi
223HAVE_DEFS_ENT=
224
225if test x"$cross_compiling" = x"yes" ; then
226  HAVE_DEFS_ENT=no
227else
228  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
229fi
230
231AC_PATH_PROG(LINUXDOC, linuxdoc)
232AC_PATH_PROG(PS2PDF, ps2pdf)
233
234AC_MSG_CHECKING([Whether to build documentation])
235
236if test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
237   BUILDDOC=yes
238else
239   BUILDDOC=no
240fi
241
242AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
243
244AC_MSG_RESULT([$BUILDDOC])
245
246AC_MSG_CHECKING([Whether to build pdf documentation])
247
248if test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
249   BUILDPDFDOC=yes
250else
251   BUILDPDFDOC=no
252fi
253
254AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
255
256AC_MSG_RESULT([$BUILDPDFDOC])
257
258MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
259MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
260MAKE_PDF="$PS2PDF"
261MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
262
263AC_SUBST(MAKE_TEXT)
264AC_SUBST(MAKE_PS)
265AC_SUBST(MAKE_PDF)
266AC_SUBST(MAKE_HTML)
267]) # XORG_CHECK_LINUXDOC
268
269# XORG_CHECK_DOCBOOK
270# -------------------
271# Minimum version: 1.0.0
272#
273# Checks for the ability to build output formats from SGML DocBook source.
274# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
275# indicates whether the necessary tools and files are found and, if set,
276# $(MAKE_XXX) blah.sgml will produce blah.xxx.
277AC_DEFUN([XORG_CHECK_DOCBOOK],[
278if test x$XORG_SGML_PATH = x ; then
279    XORG_SGML_PATH=$prefix/share/sgml
280fi
281HAVE_DEFS_ENT=
282BUILDTXTDOC=no
283BUILDPDFDOC=no
284BUILDPSDOC=no
285BUILDHTMLDOC=no
286
287AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
288
289AC_PATH_PROG(DOCBOOKPS, docbook2ps)
290AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
291AC_PATH_PROG(DOCBOOKHTML, docbook2html)
292AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
293
294AC_MSG_CHECKING([Whether to build text documentation])
295if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
296   test x$BUILD_TXTDOC != xno; then
297	BUILDTXTDOC=yes
298fi
299AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
300AC_MSG_RESULT([$BUILDTXTDOC])
301
302AC_MSG_CHECKING([Whether to build PDF documentation])
303if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
304   test x$BUILD_PDFDOC != xno; then
305	BUILDPDFDOC=yes
306fi
307AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
308AC_MSG_RESULT([$BUILDPDFDOC])
309
310AC_MSG_CHECKING([Whether to build PostScript documentation])
311if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
312   test x$BUILD_PSDOC != xno; then
313	BUILDPSDOC=yes
314fi
315AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
316AC_MSG_RESULT([$BUILDPSDOC])
317
318AC_MSG_CHECKING([Whether to build HTML documentation])
319if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
320   test x$BUILD_HTMLDOC != xno; then
321	BUILDHTMLDOC=yes
322fi
323AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
324AC_MSG_RESULT([$BUILDHTMLDOC])
325
326MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
327MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
328MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
329MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
330
331AC_SUBST(MAKE_TEXT)
332AC_SUBST(MAKE_PS)
333AC_SUBST(MAKE_PDF)
334AC_SUBST(MAKE_HTML)
335]) # XORG_CHECK_DOCBOOK
336
337# XORG_CHECK_MALLOC_ZERO
338# ----------------------
339# Minimum version: 1.0.0
340#
341# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
342# malloc(0) returns NULL.  Packages should add one of these cflags to
343# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
344AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
345AC_ARG_ENABLE(malloc0returnsnull,
346	AC_HELP_STRING([--enable-malloc0returnsnull],
347		       [malloc(0) returns NULL (default: auto)]),
348	[MALLOC_ZERO_RETURNS_NULL=$enableval],
349	[MALLOC_ZERO_RETURNS_NULL=auto])
350
351AC_MSG_CHECKING([whether malloc(0) returns NULL])
352if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
353	AC_RUN_IFELSE([
354char *malloc();
355char *realloc();
356char *calloc();
357main() {
358    char *m0, *r0, *c0, *p;
359    m0 = malloc(0);
360    p = malloc(10);
361    r0 = realloc(p,0);
362    c0 = calloc(0);
363    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
364}],
365		[MALLOC_ZERO_RETURNS_NULL=yes],
366		[MALLOC_ZERO_RETURNS_NULL=no])
367fi
368AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
369
370if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
371	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
372	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
373	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
374else
375	MALLOC_ZERO_CFLAGS=""
376	XMALLOC_ZERO_CFLAGS=""
377	XTMALLOC_ZERO_CFLAGS=""
378fi
379
380AC_SUBST([MALLOC_ZERO_CFLAGS])
381AC_SUBST([XMALLOC_ZERO_CFLAGS])
382AC_SUBST([XTMALLOC_ZERO_CFLAGS])
383]) # XORG_CHECK_MALLOC_ZERO
384
385# XORG_WITH_LINT()
386# ----------------
387# Minimum version: 1.1.0
388#
389# Sets up flags for source checkers such as lint and sparse if --with-lint
390# is specified.   (Use --with-lint=sparse for sparse.)
391# Sets $LINT to name of source checker passed with --with-lint (default: lint)
392# Sets $LINT_FLAGS to flags to pass to source checker
393# Sets LINT automake conditional if enabled (default: disabled)
394#
395AC_DEFUN([XORG_WITH_LINT],[
396
397# Allow checking code with lint, sparse, etc.
398AC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
399		[Use a lint-style source code checker (default: disabled)])],
400		[use_lint=$withval], [use_lint=no])
401if test "x$use_lint" = "xyes" ; then
402	LINT="lint"
403else
404	LINT="$use_lint"
405fi
406if test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
407    case $LINT in
408	lint|*/lint)
409	    case $host_os in
410		solaris*)
411			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
412			;;
413	    esac
414	    ;;
415    esac
416fi
417
418AC_SUBST(LINT)
419AC_SUBST(LINT_FLAGS)
420AM_CONDITIONAL(LINT, [test x$LINT != xno])
421
422]) # XORG_WITH_LINT
423
424# XORG_LINT_LIBRARY(LIBNAME)
425# --------------------------
426# Minimum version: 1.1.0
427#
428# Sets up flags for building lint libraries for checking programs that call
429# functions in the library.
430# Disabled by default, enable with --enable-lint-library
431# Sets: 
432#	@LINTLIB@		- name of lint library file to make
433#	MAKE_LINT_LIB		- automake conditional
434#
435
436AC_DEFUN([XORG_LINT_LIBRARY],[
437AC_REQUIRE([XORG_WITH_LINT])
438# Build lint "library" for more indepth checks of programs calling this library
439AC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
440	[Create lint library (default: disabled)])],
441	[make_lint_lib=$enableval], [make_lint_lib=no])
442if test "x$make_lint_lib" != "xno" ; then
443	if test "x$LINT" = "xno" ; then
444		AC_MSG_ERROR([Cannot make lint library without --with-lint])
445	fi
446	if test "x$make_lint_lib" = "xyes" ; then
447		LINTLIB=llib-l$1.ln
448	else
449		LINTLIB=$make_lint_lib
450	fi
451fi
452AC_SUBST(LINTLIB)
453AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
454
455]) # XORG_LINT_LIBRARY
456
457# XORG_CWARNFLAGS
458# ---------------
459# Minimum version: 1.2.0
460#
461# Defines CWARNFLAGS to enable C compiler warnings.
462#
463AC_DEFUN([XORG_CWARNFLAGS], [
464AC_REQUIRE([AC_PROG_CC])
465if  test "x$GCC" = xyes ; then
466    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
467-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
468-Wbad-function-cast"
469    case `gcc -dumpversion` in
470    3.4.* | 4.*)
471	CWARNFLAGS+=" -Wold-style-definition -Wdeclaration-after-statement"
472	;;
473    esac
474else
475    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
476    if test "x$SUNCC" = "xyes"; then
477	CWARNFLAGS="-v"
478    fi
479fi
480AC_SUBST(CWARNFLAGS)
481]) # XORG_CWARNFLAGS
482dnl Copyright 2005 Red Hat, Inc
483dnl
484dnl Permission to use, copy, modify, distribute, and sell this software and its
485dnl documentation for any purpose is hereby granted without fee, provided that
486dnl the above copyright notice appear in all copies and that both that
487dnl copyright notice and this permission notice appear in supporting
488dnl documentation.
489dnl
490dnl The above copyright notice and this permission notice shall be included
491dnl in all copies or substantial portions of the Software.
492dnl
493dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
494dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
495dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
496dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
497dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
498dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
499dnl OTHER DEALINGS IN THE SOFTWARE.
500dnl
501dnl Except as contained in this notice, the name of the copyright holders shall
502dnl not be used in advertising or otherwise to promote the sale, use or
503dnl other dealings in this Software without prior written authorization
504dnl from the copyright holders.
505dnl
506
507# XORG_RELEASE_VERSION
508# --------------------
509# Adds --with/without-release-string and changes the PACKAGE and
510# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
511# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
512# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
513 
514AC_DEFUN([XORG_RELEASE_VERSION],[
515	AC_ARG_WITH(release-version,
516			AC_HELP_STRING([--with-release-version=STRING],
517				[Use release version string in package name]),
518			[RELEASE_VERSION="$withval"],
519			[RELEASE_VERSION=""])
520	if test "x$RELEASE_VERSION" != "x"; then
521		PACKAGE="$PACKAGE-$RELEASE_VERSION"
522		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
523		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
524	fi
525	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
526		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
527		[Major version of this package])
528	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
529	if test "x$PVM" = "x"; then
530		PVM="0"
531	fi
532	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
533		[$PVM],
534		[Minor version of this package])
535	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
536	if test "x$PVP" = "x"; then
537		PVP="0"
538	fi
539	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
540		[$PVP],
541		[Patch version of this package])
542])
543
544# XORG_CHANGELOG()
545# ----------------
546# Minimum version: 1.2.0
547#
548# Defines the variable CHANGELOG_CMD as the command to generate
549# ChangeLog from git.
550#
551# Arrange that distcleancheck ignores ChangeLog left over by distclean.
552#
553AC_DEFUN([XORG_CHANGELOG], [
554CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
555mv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
556echo 'git directory not found: installing possibly empty changelog.' >&2)"
557AC_SUBST([CHANGELOG_CMD])
558AC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
559]) # XORG_CHANGELOG
560
561# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
562#
563# This file is free software; the Free Software Foundation
564# gives unlimited permission to copy and/or distribute it,
565# with or without modifications, as long as this notice is preserved.
566
567# AM_AUTOMAKE_VERSION(VERSION)
568# ----------------------------
569# Automake X.Y traces this macro to ensure aclocal.m4 has been
570# generated from the m4 files accompanying Automake X.Y.
571# (This private macro should not be called outside this file.)
572AC_DEFUN([AM_AUTOMAKE_VERSION],
573[am__api_version='1.10'
574dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
575dnl require some minimum version.  Point them to the right macro.
576m4_if([$1], [1.10.2], [],
577      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
578])
579
580# _AM_AUTOCONF_VERSION(VERSION)
581# -----------------------------
582# aclocal traces this macro to find the Autoconf version.
583# This is a private macro too.  Using m4_define simplifies
584# the logic in aclocal, which can simply ignore this definition.
585m4_define([_AM_AUTOCONF_VERSION], [])
586
587# AM_SET_CURRENT_AUTOMAKE_VERSION
588# -------------------------------
589# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
590# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
591AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
592[AM_AUTOMAKE_VERSION([1.10.2])dnl
593m4_ifndef([AC_AUTOCONF_VERSION],
594  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
595_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
596
597# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
598
599# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
600#
601# This file is free software; the Free Software Foundation
602# gives unlimited permission to copy and/or distribute it,
603# with or without modifications, as long as this notice is preserved.
604
605# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
606# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
607# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
608#
609# Of course, Automake must honor this variable whenever it calls a
610# tool from the auxiliary directory.  The problem is that $srcdir (and
611# therefore $ac_aux_dir as well) can be either absolute or relative,
612# depending on how configure is run.  This is pretty annoying, since
613# it makes $ac_aux_dir quite unusable in subdirectories: in the top
614# source directory, any form will work fine, but in subdirectories a
615# relative path needs to be adjusted first.
616#
617# $ac_aux_dir/missing
618#    fails when called from a subdirectory if $ac_aux_dir is relative
619# $top_srcdir/$ac_aux_dir/missing
620#    fails if $ac_aux_dir is absolute,
621#    fails when called from a subdirectory in a VPATH build with
622#          a relative $ac_aux_dir
623#
624# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
625# are both prefixed by $srcdir.  In an in-source build this is usually
626# harmless because $srcdir is `.', but things will broke when you
627# start a VPATH build or use an absolute $srcdir.
628#
629# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
630# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
631#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
632# and then we would define $MISSING as
633#   MISSING="\${SHELL} $am_aux_dir/missing"
634# This will work as long as MISSING is not called from configure, because
635# unfortunately $(top_srcdir) has no meaning in configure.
636# However there are other variables, like CC, which are often used in
637# configure, and could therefore not use this "fixed" $ac_aux_dir.
638#
639# Another solution, used here, is to always expand $ac_aux_dir to an
640# absolute PATH.  The drawback is that using absolute paths prevent a
641# configured tree to be moved without reconfiguration.
642
643AC_DEFUN([AM_AUX_DIR_EXPAND],
644[dnl Rely on autoconf to set up CDPATH properly.
645AC_PREREQ([2.50])dnl
646# expand $ac_aux_dir to an absolute path
647am_aux_dir=`cd $ac_aux_dir && pwd`
648])
649
650# AM_CONDITIONAL                                            -*- Autoconf -*-
651
652# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
653# Free Software Foundation, Inc.
654#
655# This file is free software; the Free Software Foundation
656# gives unlimited permission to copy and/or distribute it,
657# with or without modifications, as long as this notice is preserved.
658
659# serial 8
660
661# AM_CONDITIONAL(NAME, SHELL-CONDITION)
662# -------------------------------------
663# Define a conditional.
664AC_DEFUN([AM_CONDITIONAL],
665[AC_PREREQ(2.52)dnl
666 ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
667	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
668AC_SUBST([$1_TRUE])dnl
669AC_SUBST([$1_FALSE])dnl
670_AM_SUBST_NOTMAKE([$1_TRUE])dnl
671_AM_SUBST_NOTMAKE([$1_FALSE])dnl
672if $2; then
673  $1_TRUE=
674  $1_FALSE='#'
675else
676  $1_TRUE='#'
677  $1_FALSE=
678fi
679AC_CONFIG_COMMANDS_PRE(
680[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
681  AC_MSG_ERROR([[conditional "$1" was never defined.
682Usually this means the macro was only invoked conditionally.]])
683fi])])
684
685# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
686# Free Software Foundation, Inc.
687#
688# This file is free software; the Free Software Foundation
689# gives unlimited permission to copy and/or distribute it,
690# with or without modifications, as long as this notice is preserved.
691
692# serial 9
693
694# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
695# written in clear, in which case automake, when reading aclocal.m4,
696# will think it sees a *use*, and therefore will trigger all it's
697# C support machinery.  Also note that it means that autoscan, seeing
698# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
699
700
701# _AM_DEPENDENCIES(NAME)
702# ----------------------
703# See how the compiler implements dependency checking.
704# NAME is "CC", "CXX", "GCJ", or "OBJC".
705# We try a few techniques and use that to set a single cache variable.
706#
707# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
708# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
709# dependency, and given that the user is not expected to run this macro,
710# just rely on AC_PROG_CC.
711AC_DEFUN([_AM_DEPENDENCIES],
712[AC_REQUIRE([AM_SET_DEPDIR])dnl
713AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
714AC_REQUIRE([AM_MAKE_INCLUDE])dnl
715AC_REQUIRE([AM_DEP_TRACK])dnl
716
717ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
718       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
719       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
720       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
721       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
722                   [depcc="$$1"   am_compiler_list=])
723
724AC_CACHE_CHECK([dependency style of $depcc],
725               [am_cv_$1_dependencies_compiler_type],
726[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
727  # We make a subdir and do the tests there.  Otherwise we can end up
728  # making bogus files that we don't know about and never remove.  For
729  # instance it was reported that on HP-UX the gcc test will end up
730  # making a dummy file named `D' -- because `-MD' means `put the output
731  # in D'.
732  mkdir conftest.dir
733  # Copy depcomp to subdir because otherwise we won't find it if we're
734  # using a relative directory.
735  cp "$am_depcomp" conftest.dir
736  cd conftest.dir
737  # We will build objects and dependencies in a subdirectory because
738  # it helps to detect inapplicable dependency modes.  For instance
739  # both Tru64's cc and ICC support -MD to output dependencies as a
740  # side effect of compilation, but ICC will put the dependencies in
741  # the current directory while Tru64 will put them in the object
742  # directory.
743  mkdir sub
744
745  am_cv_$1_dependencies_compiler_type=none
746  if test "$am_compiler_list" = ""; then
747     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
748  fi
749  for depmode in $am_compiler_list; do
750    # Setup a source with many dependencies, because some compilers
751    # like to wrap large dependency lists on column 80 (with \), and
752    # we should not choose a depcomp mode which is confused by this.
753    #
754    # We need to recreate these files for each test, as the compiler may
755    # overwrite some of them when testing with obscure command lines.
756    # This happens at least with the AIX C compiler.
757    : > sub/conftest.c
758    for i in 1 2 3 4 5 6; do
759      echo '#include "conftst'$i'.h"' >> sub/conftest.c
760      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
761      # Solaris 8's {/usr,}/bin/sh.
762      touch sub/conftst$i.h
763    done
764    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
765
766    case $depmode in
767    nosideeffect)
768      # after this tag, mechanisms are not by side-effect, so they'll
769      # only be used when explicitly requested
770      if test "x$enable_dependency_tracking" = xyes; then
771	continue
772      else
773	break
774      fi
775      ;;
776    none) break ;;
777    esac
778    # We check with `-c' and `-o' for the sake of the "dashmstdout"
779    # mode.  It turns out that the SunPro C++ compiler does not properly
780    # handle `-M -o', and we need to detect this.
781    if depmode=$depmode \
782       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
783       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
784       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
785         >/dev/null 2>conftest.err &&
786       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
787       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
788       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
789       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
790      # icc doesn't choke on unknown options, it will just issue warnings
791      # or remarks (even with -Werror).  So we grep stderr for any message
792      # that says an option was ignored or not supported.
793      # When given -MP, icc 7.0 and 7.1 complain thusly:
794      #   icc: Command line warning: ignoring option '-M'; no argument required
795      # The diagnosis changed in icc 8.0:
796      #   icc: Command line remark: option '-MP' not supported
797      if (grep 'ignoring option' conftest.err ||
798          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
799        am_cv_$1_dependencies_compiler_type=$depmode
800        break
801      fi
802    fi
803  done
804
805  cd ..
806  rm -rf conftest.dir
807else
808  am_cv_$1_dependencies_compiler_type=none
809fi
810])
811AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
812AM_CONDITIONAL([am__fastdep$1], [
813  test "x$enable_dependency_tracking" != xno \
814  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
815])
816
817
818# AM_SET_DEPDIR
819# -------------
820# Choose a directory name for dependency files.
821# This macro is AC_REQUIREd in _AM_DEPENDENCIES
822AC_DEFUN([AM_SET_DEPDIR],
823[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
824AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
825])
826
827
828# AM_DEP_TRACK
829# ------------
830AC_DEFUN([AM_DEP_TRACK],
831[AC_ARG_ENABLE(dependency-tracking,
832[  --disable-dependency-tracking  speeds up one-time build
833  --enable-dependency-tracking   do not reject slow dependency extractors])
834if test "x$enable_dependency_tracking" != xno; then
835  am_depcomp="$ac_aux_dir/depcomp"
836  AMDEPBACKSLASH='\'
837fi
838AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
839AC_SUBST([AMDEPBACKSLASH])dnl
840_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
841])
842
843# Generate code to set up dependency tracking.              -*- Autoconf -*-
844
845# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
846# Free Software Foundation, Inc.
847#
848# This file is free software; the Free Software Foundation
849# gives unlimited permission to copy and/or distribute it,
850# with or without modifications, as long as this notice is preserved.
851
852#serial 4
853
854# _AM_OUTPUT_DEPENDENCY_COMMANDS
855# ------------------------------
856AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
857[# Autoconf 2.62 quotes --file arguments for eval, but not when files
858# are listed without --file.  Let's play safe and only enable the eval
859# if we detect the quoting.
860case $CONFIG_FILES in
861*\'*) eval set x "$CONFIG_FILES" ;;
862*)   set x $CONFIG_FILES ;;
863esac
864shift
865for mf
866do
867  # Strip MF so we end up with the name of the file.
868  mf=`echo "$mf" | sed -e 's/:.*$//'`
869  # Check whether this is an Automake generated Makefile or not.
870  # We used to match only the files named `Makefile.in', but
871  # some people rename them; so instead we look at the file content.
872  # Grep'ing the first line is not enough: some people post-process
873  # each Makefile.in and add a new line on top of each file to say so.
874  # Grep'ing the whole file is not good either: AIX grep has a line
875  # limit of 2048, but all sed's we know have understand at least 4000.
876  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
877    dirpart=`AS_DIRNAME("$mf")`
878  else
879    continue
880  fi
881  # Extract the definition of DEPDIR, am__include, and am__quote
882  # from the Makefile without running `make'.
883  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
884  test -z "$DEPDIR" && continue
885  am__include=`sed -n 's/^am__include = //p' < "$mf"`
886  test -z "am__include" && continue
887  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
888  # When using ansi2knr, U may be empty or an underscore; expand it
889  U=`sed -n 's/^U = //p' < "$mf"`
890  # Find all dependency output files, they are included files with
891  # $(DEPDIR) in their names.  We invoke sed twice because it is the
892  # simplest approach to changing $(DEPDIR) to its actual value in the
893  # expansion.
894  for file in `sed -n "
895    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
896       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
897    # Make sure the directory exists.
898    test -f "$dirpart/$file" && continue
899    fdir=`AS_DIRNAME(["$file"])`
900    AS_MKDIR_P([$dirpart/$fdir])
901    # echo "creating $dirpart/$file"
902    echo '# dummy' > "$dirpart/$file"
903  done
904done
905])# _AM_OUTPUT_DEPENDENCY_COMMANDS
906
907
908# AM_OUTPUT_DEPENDENCY_COMMANDS
909# -----------------------------
910# This macro should only be invoked once -- use via AC_REQUIRE.
911#
912# This code is only required when automatic dependency tracking
913# is enabled.  FIXME.  This creates each `.P' file that we will
914# need in order to bootstrap the dependency handling code.
915AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
916[AC_CONFIG_COMMANDS([depfiles],
917     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
918     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
919])
920
921# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
922# Free Software Foundation, Inc.
923#
924# This file is free software; the Free Software Foundation
925# gives unlimited permission to copy and/or distribute it,
926# with or without modifications, as long as this notice is preserved.
927
928# serial 8
929
930# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
931AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
932
933# Do all the work for Automake.                             -*- Autoconf -*-
934
935# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
936# 2005, 2006, 2008 Free Software Foundation, Inc.
937#
938# This file is free software; the Free Software Foundation
939# gives unlimited permission to copy and/or distribute it,
940# with or without modifications, as long as this notice is preserved.
941
942# serial 13
943
944# This macro actually does too much.  Some checks are only needed if
945# your package does certain things.  But this isn't really a big deal.
946
947# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
948# AM_INIT_AUTOMAKE([OPTIONS])
949# -----------------------------------------------
950# The call with PACKAGE and VERSION arguments is the old style
951# call (pre autoconf-2.50), which is being phased out.  PACKAGE
952# and VERSION should now be passed to AC_INIT and removed from
953# the call to AM_INIT_AUTOMAKE.
954# We support both call styles for the transition.  After
955# the next Automake release, Autoconf can make the AC_INIT
956# arguments mandatory, and then we can depend on a new Autoconf
957# release and drop the old call support.
958AC_DEFUN([AM_INIT_AUTOMAKE],
959[AC_PREREQ([2.60])dnl
960dnl Autoconf wants to disallow AM_ names.  We explicitly allow
961dnl the ones we care about.
962m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
963AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
964AC_REQUIRE([AC_PROG_INSTALL])dnl
965if test "`cd $srcdir && pwd`" != "`pwd`"; then
966  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
967  # is not polluted with repeated "-I."
968  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
969  # test to see if srcdir already configured
970  if test -f $srcdir/config.status; then
971    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
972  fi
973fi
974
975# test whether we have cygpath
976if test -z "$CYGPATH_W"; then
977  if (cygpath --version) >/dev/null 2>/dev/null; then
978    CYGPATH_W='cygpath -w'
979  else
980    CYGPATH_W=echo
981  fi
982fi
983AC_SUBST([CYGPATH_W])
984
985# Define the identity of the package.
986dnl Distinguish between old-style and new-style calls.
987m4_ifval([$2],
988[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
989 AC_SUBST([PACKAGE], [$1])dnl
990 AC_SUBST([VERSION], [$2])],
991[_AM_SET_OPTIONS([$1])dnl
992dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
993m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
994  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
995 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
996 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
997
998_AM_IF_OPTION([no-define],,
999[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1000 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
1001
1002# Some tools Automake needs.
1003AC_REQUIRE([AM_SANITY_CHECK])dnl
1004AC_REQUIRE([AC_ARG_PROGRAM])dnl
1005AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
1006AM_MISSING_PROG(AUTOCONF, autoconf)
1007AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
1008AM_MISSING_PROG(AUTOHEADER, autoheader)
1009AM_MISSING_PROG(MAKEINFO, makeinfo)
1010AM_PROG_INSTALL_SH
1011AM_PROG_INSTALL_STRIP
1012AC_REQUIRE([AM_PROG_MKDIR_P])dnl
1013# We need awk for the "check" target.  The system "awk" is bad on
1014# some platforms.
1015AC_REQUIRE([AC_PROG_AWK])dnl
1016AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1017AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1018_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
1019              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
1020	      		     [_AM_PROG_TAR([v7])])])
1021_AM_IF_OPTION([no-dependencies],,
1022[AC_PROVIDE_IFELSE([AC_PROG_CC],
1023                  [_AM_DEPENDENCIES(CC)],
1024                  [define([AC_PROG_CC],
1025                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
1026AC_PROVIDE_IFELSE([AC_PROG_CXX],
1027                  [_AM_DEPENDENCIES(CXX)],
1028                  [define([AC_PROG_CXX],
1029                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
1030AC_PROVIDE_IFELSE([AC_PROG_OBJC],
1031                  [_AM_DEPENDENCIES(OBJC)],
1032                  [define([AC_PROG_OBJC],
1033                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
1034])
1035])
1036
1037
1038# When config.status generates a header, we must update the stamp-h file.
1039# This file resides in the same directory as the config header
1040# that is generated.  The stamp files are numbered to have different names.
1041
1042# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
1043# loop where config.status creates the headers, so we can generate
1044# our stamp files there.
1045AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
1046[# Compute $1's index in $config_headers.
1047_am_arg=$1
1048_am_stamp_count=1
1049for _am_header in $config_headers :; do
1050  case $_am_header in
1051    $_am_arg | $_am_arg:* )
1052      break ;;
1053    * )
1054      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
1055  esac
1056done
1057echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
1058
1059# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
1060#
1061# This file is free software; the Free Software Foundation
1062# gives unlimited permission to copy and/or distribute it,
1063# with or without modifications, as long as this notice is preserved.
1064
1065# AM_PROG_INSTALL_SH
1066# ------------------
1067# Define $install_sh.
1068AC_DEFUN([AM_PROG_INSTALL_SH],
1069[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1070install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
1071AC_SUBST(install_sh)])
1072
1073# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
1074#
1075# This file is free software; the Free Software Foundation
1076# gives unlimited permission to copy and/or distribute it,
1077# with or without modifications, as long as this notice is preserved.
1078
1079# serial 2
1080
1081# Check whether the underlying file-system supports filenames
1082# with a leading dot.  For instance MS-DOS doesn't.
1083AC_DEFUN([AM_SET_LEADING_DOT],
1084[rm -rf .tst 2>/dev/null
1085mkdir .tst 2>/dev/null
1086if test -d .tst; then
1087  am__leading_dot=.
1088else
1089  am__leading_dot=_
1090fi
1091rmdir .tst 2>/dev/null
1092AC_SUBST([am__leading_dot])])
1093
1094# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
1095# From Jim Meyering
1096
1097# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
1098# Free Software Foundation, Inc.
1099#
1100# This file is free software; the Free Software Foundation
1101# gives unlimited permission to copy and/or distribute it,
1102# with or without modifications, as long as this notice is preserved.
1103
1104# serial 4
1105
1106AC_DEFUN([AM_MAINTAINER_MODE],
1107[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
1108  dnl maintainer-mode is disabled by default
1109  AC_ARG_ENABLE(maintainer-mode,
1110[  --enable-maintainer-mode  enable make rules and dependencies not useful
1111			  (and sometimes confusing) to the casual installer],
1112      USE_MAINTAINER_MODE=$enableval,
1113      USE_MAINTAINER_MODE=no)
1114  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
1115  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
1116  MAINT=$MAINTAINER_MODE_TRUE
1117  AC_SUBST(MAINT)dnl
1118]
1119)
1120
1121AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
1122
1123# Check to see how 'make' treats includes.	            -*- Autoconf -*-
1124
1125# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
1126#
1127# This file is free software; the Free Software Foundation
1128# gives unlimited permission to copy and/or distribute it,
1129# with or without modifications, as long as this notice is preserved.
1130
1131# serial 3
1132
1133# AM_MAKE_INCLUDE()
1134# -----------------
1135# Check to see how make treats includes.
1136AC_DEFUN([AM_MAKE_INCLUDE],
1137[am_make=${MAKE-make}
1138cat > confinc << 'END'
1139am__doit:
1140	@echo done
1141.PHONY: am__doit
1142END
1143# If we don't find an include directive, just comment out the code.
1144AC_MSG_CHECKING([for style of include used by $am_make])
1145am__include="#"
1146am__quote=
1147_am_result=none
1148# First try GNU make style include.
1149echo "include confinc" > confmf
1150# We grep out `Entering directory' and `Leaving directory'
1151# messages which can occur if `w' ends up in MAKEFLAGS.
1152# In particular we don't look at `^make:' because GNU make might
1153# be invoked under some other name (usually "gmake"), in which
1154# case it prints its new name instead of `make'.
1155if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
1156   am__include=include
1157   am__quote=
1158   _am_result=GNU
1159fi
1160# Now try BSD make style include.
1161if test "$am__include" = "#"; then
1162   echo '.include "confinc"' > confmf
1163   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
1164      am__include=.include
1165      am__quote="\""
1166      _am_result=BSD
1167   fi
1168fi
1169AC_SUBST([am__include])
1170AC_SUBST([am__quote])
1171AC_MSG_RESULT([$_am_result])
1172rm -f confinc confmf
1173])
1174
1175# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
1176
1177# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
1178# Free Software Foundation, Inc.
1179#
1180# This file is free software; the Free Software Foundation
1181# gives unlimited permission to copy and/or distribute it,
1182# with or without modifications, as long as this notice is preserved.
1183
1184# serial 5
1185
1186# AM_MISSING_PROG(NAME, PROGRAM)
1187# ------------------------------
1188AC_DEFUN([AM_MISSING_PROG],
1189[AC_REQUIRE([AM_MISSING_HAS_RUN])
1190$1=${$1-"${am_missing_run}$2"}
1191AC_SUBST($1)])
1192
1193
1194# AM_MISSING_HAS_RUN
1195# ------------------
1196# Define MISSING if not defined so far and test if it supports --run.
1197# If it does, set am_missing_run to use it, otherwise, to nothing.
1198AC_DEFUN([AM_MISSING_HAS_RUN],
1199[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1200AC_REQUIRE_AUX_FILE([missing])dnl
1201test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
1202# Use eval to expand $SHELL
1203if eval "$MISSING --run true"; then
1204  am_missing_run="$MISSING --run "
1205else
1206  am_missing_run=
1207  AC_MSG_WARN([`missing' script is too old or missing])
1208fi
1209])
1210
1211# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
1212#
1213# This file is free software; the Free Software Foundation
1214# gives unlimited permission to copy and/or distribute it,
1215# with or without modifications, as long as this notice is preserved.
1216
1217# AM_PROG_MKDIR_P
1218# ---------------
1219# Check for `mkdir -p'.
1220AC_DEFUN([AM_PROG_MKDIR_P],
1221[AC_PREREQ([2.60])dnl
1222AC_REQUIRE([AC_PROG_MKDIR_P])dnl
1223dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
1224dnl while keeping a definition of mkdir_p for backward compatibility.
1225dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
1226dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
1227dnl Makefile.ins that do not define MKDIR_P, so we do our own
1228dnl adjustment using top_builddir (which is defined more often than
1229dnl MKDIR_P).
1230AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
1231case $mkdir_p in
1232  [[\\/$]]* | ?:[[\\/]]*) ;;
1233  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
1234esac
1235])
1236
1237# Helper functions for option handling.                     -*- Autoconf -*-
1238
1239# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
1240#
1241# This file is free software; the Free Software Foundation
1242# gives unlimited permission to copy and/or distribute it,
1243# with or without modifications, as long as this notice is preserved.
1244
1245# serial 4
1246
1247# _AM_MANGLE_OPTION(NAME)
1248# -----------------------
1249AC_DEFUN([_AM_MANGLE_OPTION],
1250[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
1251
1252# _AM_SET_OPTION(NAME)
1253# ------------------------------
1254# Set option NAME.  Presently that only means defining a flag for this option.
1255AC_DEFUN([_AM_SET_OPTION],
1256[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
1257
1258# _AM_SET_OPTIONS(OPTIONS)
1259# ----------------------------------
1260# OPTIONS is a space-separated list of Automake options.
1261AC_DEFUN([_AM_SET_OPTIONS],
1262[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
1263
1264# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
1265# -------------------------------------------
1266# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
1267AC_DEFUN([_AM_IF_OPTION],
1268[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
1269
1270# Check to make sure that the build environment is sane.    -*- Autoconf -*-
1271
1272# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
1273# Free Software Foundation, Inc.
1274#
1275# This file is free software; the Free Software Foundation
1276# gives unlimited permission to copy and/or distribute it,
1277# with or without modifications, as long as this notice is preserved.
1278
1279# serial 4
1280
1281# AM_SANITY_CHECK
1282# ---------------
1283AC_DEFUN([AM_SANITY_CHECK],
1284[AC_MSG_CHECKING([whether build environment is sane])
1285# Just in case
1286sleep 1
1287echo timestamp > conftest.file
1288# Do `set' in a subshell so we don't clobber the current shell's
1289# arguments.  Must try -L first in case configure is actually a
1290# symlink; some systems play weird games with the mod time of symlinks
1291# (eg FreeBSD returns the mod time of the symlink's containing
1292# directory).
1293if (
1294   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
1295   if test "$[*]" = "X"; then
1296      # -L didn't work.
1297      set X `ls -t $srcdir/configure conftest.file`
1298   fi
1299   rm -f conftest.file
1300   if test "$[*]" != "X $srcdir/configure conftest.file" \
1301      && test "$[*]" != "X conftest.file $srcdir/configure"; then
1302
1303      # If neither matched, then we have a broken ls.  This can happen
1304      # if, for instance, CONFIG_SHELL is bash and it inherits a
1305      # broken ls alias from the environment.  This has actually
1306      # happened.  Such a system could not be considered "sane".
1307      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
1308alias in your environment])
1309   fi
1310
1311   test "$[2]" = conftest.file
1312   )
1313then
1314   # Ok.
1315   :
1316else
1317   AC_MSG_ERROR([newly created file is older than distributed files!
1318Check your system clock])
1319fi
1320AC_MSG_RESULT(yes)])
1321
1322# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
1323#
1324# This file is free software; the Free Software Foundation
1325# gives unlimited permission to copy and/or distribute it,
1326# with or without modifications, as long as this notice is preserved.
1327
1328# AM_PROG_INSTALL_STRIP
1329# ---------------------
1330# One issue with vendor `install' (even GNU) is that you can't
1331# specify the program used to strip binaries.  This is especially
1332# annoying in cross-compiling environments, where the build's strip
1333# is unlikely to handle the host's binaries.
1334# Fortunately install-sh will honor a STRIPPROG variable, so we
1335# always use install-sh in `make install-strip', and initialize
1336# STRIPPROG with the value of the STRIP variable (set by the user).
1337AC_DEFUN([AM_PROG_INSTALL_STRIP],
1338[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1339# Installed binaries are usually stripped using `strip' when the user
1340# run `make install-strip'.  However `strip' might not be the right
1341# tool to use in cross-compilation environments, therefore Automake
1342# will honor the `STRIP' environment variable to overrule this program.
1343dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
1344if test "$cross_compiling" != no; then
1345  AC_CHECK_TOOL([STRIP], [strip], :)
1346fi
1347INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1348AC_SUBST([INSTALL_STRIP_PROGRAM])])
1349
1350# Copyright (C) 2006  Free Software Foundation, Inc.
1351#
1352# This file is free software; the Free Software Foundation
1353# gives unlimited permission to copy and/or distribute it,
1354# with or without modifications, as long as this notice is preserved.
1355
1356# _AM_SUBST_NOTMAKE(VARIABLE)
1357# ---------------------------
1358# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1359# This macro is traced by Automake.
1360AC_DEFUN([_AM_SUBST_NOTMAKE])
1361
1362# Check how to create a tarball.                            -*- Autoconf -*-
1363
1364# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
1365#
1366# This file is free software; the Free Software Foundation
1367# gives unlimited permission to copy and/or distribute it,
1368# with or without modifications, as long as this notice is preserved.
1369
1370# serial 2
1371
1372# _AM_PROG_TAR(FORMAT)
1373# --------------------
1374# Check how to create a tarball in format FORMAT.
1375# FORMAT should be one of `v7', `ustar', or `pax'.
1376#
1377# Substitute a variable $(am__tar) that is a command
1378# writing to stdout a FORMAT-tarball containing the directory
1379# $tardir.
1380#     tardir=directory && $(am__tar) > result.tar
1381#
1382# Substitute a variable $(am__untar) that extract such
1383# a tarball read from stdin.
1384#     $(am__untar) < result.tar
1385AC_DEFUN([_AM_PROG_TAR],
1386[# Always define AMTAR for backward compatibility.
1387AM_MISSING_PROG([AMTAR], [tar])
1388m4_if([$1], [v7],
1389     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
1390     [m4_case([$1], [ustar],, [pax],,
1391              [m4_fatal([Unknown tar format])])
1392AC_MSG_CHECKING([how to create a $1 tar archive])
1393# Loop over all known methods to create a tar archive until one works.
1394_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1395_am_tools=${am_cv_prog_tar_$1-$_am_tools}
1396# Do not fold the above two line into one, because Tru64 sh and
1397# Solaris sh will not grok spaces in the rhs of `-'.
1398for _am_tool in $_am_tools
1399do
1400  case $_am_tool in
1401  gnutar)
1402    for _am_tar in tar gnutar gtar;
1403    do
1404      AM_RUN_LOG([$_am_tar --version]) && break
1405    done
1406    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1407    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1408    am__untar="$_am_tar -xf -"
1409    ;;
1410  plaintar)
1411    # Must skip GNU tar: if it does not support --format= it doesn't create
1412    # ustar tarball either.
1413    (tar --version) >/dev/null 2>&1 && continue
1414    am__tar='tar chf - "$$tardir"'
1415    am__tar_='tar chf - "$tardir"'
1416    am__untar='tar xf -'
1417    ;;
1418  pax)
1419    am__tar='pax -L -x $1 -w "$$tardir"'
1420    am__tar_='pax -L -x $1 -w "$tardir"'
1421    am__untar='pax -r'
1422    ;;
1423  cpio)
1424    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1425    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1426    am__untar='cpio -i -H $1 -d'
1427    ;;
1428  none)
1429    am__tar=false
1430    am__tar_=false
1431    am__untar=false
1432    ;;
1433  esac
1434
1435  # If the value was cached, stop now.  We just wanted to have am__tar
1436  # and am__untar set.
1437  test -n "${am_cv_prog_tar_$1}" && break
1438
1439  # tar/untar a dummy directory, and stop if the command works
1440  rm -rf conftest.dir
1441  mkdir conftest.dir
1442  echo GrepMe > conftest.dir/file
1443  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1444  rm -rf conftest.dir
1445  if test -s conftest.tar; then
1446    AM_RUN_LOG([$am__untar <conftest.tar])
1447    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1448  fi
1449done
1450rm -rf conftest.dir
1451
1452AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1453AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1454AC_SUBST([am__tar])
1455AC_SUBST([am__untar])
1456]) # _AM_PROG_TAR
1457
1458