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