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