aclocal.m4 revision d838582f
1d838582fSmrg# generated automatically by aclocal 1.10.1 -*- Autoconf -*- 2d838582fSmrg 3d838582fSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 4d838582fSmrg# 2005, 2006, 2007, 2008 Free Software Foundation, Inc. 5d838582fSmrg# This file is free software; the Free Software Foundation 6d838582fSmrg# gives unlimited permission to copy and/or distribute it, 7d838582fSmrg# with or without modifications, as long as this notice is preserved. 8d838582fSmrg 9d838582fSmrg# This program is distributed in the hope that it will be useful, 10d838582fSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without 11d838582fSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A 12d838582fSmrg# PARTICULAR PURPOSE. 13d838582fSmrg 14d838582fSmrgm4_ifndef([AC_AUTOCONF_VERSION], 15d838582fSmrg [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 16d838582fSmrgm4_if(AC_AUTOCONF_VERSION, [2.61],, 17d838582fSmrg[m4_warning([this file was generated for autoconf 2.61. 18d838582fSmrgYou have another version of autoconf. It may work, but is not guaranteed to. 19d838582fSmrgIf you have problems, you may need to regenerate the build system entirely. 20d838582fSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])]) 21d838582fSmrg 22d838582fSmrgdnl 23d838582fSmrgdnl Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved. 24d838582fSmrgdnl 25d838582fSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a 26d838582fSmrgdnl copy of this software and associated documentation files (the 27d838582fSmrgdnl "Software"), to deal in the Software without restriction, including 28d838582fSmrgdnl without limitation the rights to use, copy, modify, merge, publish, 29d838582fSmrgdnl distribute, and/or sell copies of the Software, and to permit persons 30d838582fSmrgdnl to whom the Software is furnished to do so, provided that the above 31d838582fSmrgdnl copyright notice(s) and this permission notice appear in all copies of 32d838582fSmrgdnl the Software and that both the above copyright notice(s) and this 33d838582fSmrgdnl permission notice appear in supporting documentation. 34d838582fSmrgdnl 35d838582fSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 36d838582fSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 37d838582fSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 38d838582fSmrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 39d838582fSmrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL 40d838582fSmrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING 41d838582fSmrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 42d838582fSmrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 43d838582fSmrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 44d838582fSmrgdnl 45d838582fSmrgdnl Except as contained in this notice, the name of a copyright holder 46d838582fSmrgdnl shall not be used in advertising or otherwise to promote the sale, use 47d838582fSmrgdnl or other dealings in this Software without prior written authorization 48d838582fSmrgdnl of the copyright holder. 49d838582fSmrg 50d838582fSmrg# XORG_MACROS_VERSION(required-version) 51d838582fSmrg# ------------------------------------- 52d838582fSmrg# Minimum version: 1.1.0 53d838582fSmrg# 54d838582fSmrg# If you're using a macro added in Version 1.1 or newer, include this in 55d838582fSmrg# your configure.ac with the minimum required version, such as: 56d838582fSmrg# XORG_MACROS_VERSION(1.1) 57d838582fSmrg# 58d838582fSmrg# To force at least a version with this macro defined, also add: 59d838582fSmrg# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])]) 60d838582fSmrg# 61d838582fSmrg# 62d838582fSmrg# See the "minimum version" comment for each macro you use to see what 63d838582fSmrg# version you require. 64d838582fSmrgAC_DEFUN([XORG_MACROS_VERSION],[ 65d838582fSmrg [XORG_MACROS_needed_version=$1 66d838582fSmrg XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'` 67d838582fSmrg XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`] 68d838582fSmrg AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}]) 69d838582fSmrg [XORG_MACROS_version=1.1.6 70d838582fSmrg XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'` 71d838582fSmrg XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`] 72d838582fSmrg if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then 73d838582fSmrg AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x]) 74d838582fSmrg fi 75d838582fSmrg if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then 76d838582fSmrg 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]) 77d838582fSmrg fi 78d838582fSmrg AC_MSG_RESULT([yes, $XORG_MACROS_version]) 79d838582fSmrg]) # XORG_MACROS_VERSION 80d838582fSmrg 81d838582fSmrg# XORG_PROG_RAWCPP() 82d838582fSmrg# ------------------ 83d838582fSmrg# Minimum version: 1.0.0 84d838582fSmrg# 85d838582fSmrg# Find cpp program and necessary flags for use in pre-processing text files 86d838582fSmrg# such as man pages and config files 87d838582fSmrgAC_DEFUN([XORG_PROG_RAWCPP],[ 88d838582fSmrgAC_REQUIRE([AC_PROG_CPP]) 89d838582fSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 90d838582fSmrg [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) 91d838582fSmrg 92d838582fSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined, 93d838582fSmrg# which is not the best choice for supporting other OS'es, but covers most 94d838582fSmrg# of the ones we need for now. 95d838582fSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef]) 96d838582fSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?]) 97d838582fSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 98d838582fSmrg AC_MSG_RESULT([no]) 99d838582fSmrgelse 100d838582fSmrg if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 101d838582fSmrg RAWCPPFLAGS=-undef 102d838582fSmrg AC_MSG_RESULT([yes]) 103d838582fSmrg else 104d838582fSmrg AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.]) 105d838582fSmrg fi 106d838582fSmrgfi 107d838582fSmrgrm -f conftest.$ac_ext 108d838582fSmrg 109d838582fSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional]) 110d838582fSmrgAC_LANG_CONFTEST([Does cpp preserve "whitespace"?]) 111d838582fSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 112d838582fSmrg AC_MSG_RESULT([no]) 113d838582fSmrgelse 114d838582fSmrg if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 115d838582fSmrg RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" 116d838582fSmrg AC_MSG_RESULT([yes]) 117d838582fSmrg else 118d838582fSmrg AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) 119d838582fSmrg fi 120d838582fSmrgfi 121d838582fSmrgrm -f conftest.$ac_ext 122d838582fSmrgAC_SUBST(RAWCPPFLAGS) 123d838582fSmrg]) # XORG_PROG_RAWCPP 124d838582fSmrg 125d838582fSmrg# XORG_MANPAGE_SECTIONS() 126d838582fSmrg# ----------------------- 127d838582fSmrg# Minimum version: 1.0.0 128d838582fSmrg# 129d838582fSmrg# Determine which sections man pages go in for the different man page types 130d838582fSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. 131d838582fSmrg# Not sure if there's any better way than just hardcoding by OS name. 132d838582fSmrg# Override default settings by setting environment variables 133d838582fSmrg 134d838582fSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[ 135d838582fSmrgAC_REQUIRE([AC_CANONICAL_HOST]) 136d838582fSmrg 137d838582fSmrgif test x$APP_MAN_SUFFIX = x ; then 138d838582fSmrg APP_MAN_SUFFIX=1 139d838582fSmrgfi 140d838582fSmrgif test x$APP_MAN_DIR = x ; then 141d838582fSmrg APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' 142d838582fSmrgfi 143d838582fSmrg 144d838582fSmrgif test x$LIB_MAN_SUFFIX = x ; then 145d838582fSmrg LIB_MAN_SUFFIX=3 146d838582fSmrgfi 147d838582fSmrgif test x$LIB_MAN_DIR = x ; then 148d838582fSmrg LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' 149d838582fSmrgfi 150d838582fSmrg 151d838582fSmrgif test x$FILE_MAN_SUFFIX = x ; then 152d838582fSmrg case $host_os in 153d838582fSmrg solaris*) FILE_MAN_SUFFIX=4 ;; 154d838582fSmrg *) FILE_MAN_SUFFIX=5 ;; 155d838582fSmrg esac 156d838582fSmrgfi 157d838582fSmrgif test x$FILE_MAN_DIR = x ; then 158d838582fSmrg FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' 159d838582fSmrgfi 160d838582fSmrg 161d838582fSmrgif test x$MISC_MAN_SUFFIX = x ; then 162d838582fSmrg case $host_os in 163d838582fSmrg solaris*) MISC_MAN_SUFFIX=5 ;; 164d838582fSmrg *) MISC_MAN_SUFFIX=7 ;; 165d838582fSmrg esac 166d838582fSmrgfi 167d838582fSmrgif test x$MISC_MAN_DIR = x ; then 168d838582fSmrg MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' 169d838582fSmrgfi 170d838582fSmrg 171d838582fSmrgif test x$DRIVER_MAN_SUFFIX = x ; then 172d838582fSmrg case $host_os in 173d838582fSmrg solaris*) DRIVER_MAN_SUFFIX=7 ;; 174d838582fSmrg *) DRIVER_MAN_SUFFIX=4 ;; 175d838582fSmrg esac 176d838582fSmrgfi 177d838582fSmrgif test x$DRIVER_MAN_DIR = x ; then 178d838582fSmrg DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' 179d838582fSmrgfi 180d838582fSmrg 181d838582fSmrgif test x$ADMIN_MAN_SUFFIX = x ; then 182d838582fSmrg case $host_os in 183d838582fSmrg solaris*) ADMIN_MAN_SUFFIX=1m ;; 184d838582fSmrg *) ADMIN_MAN_SUFFIX=8 ;; 185d838582fSmrg esac 186d838582fSmrgfi 187d838582fSmrgif test x$ADMIN_MAN_DIR = x ; then 188d838582fSmrg ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' 189d838582fSmrgfi 190d838582fSmrg 191d838582fSmrg 192d838582fSmrgAC_SUBST([APP_MAN_SUFFIX]) 193d838582fSmrgAC_SUBST([LIB_MAN_SUFFIX]) 194d838582fSmrgAC_SUBST([FILE_MAN_SUFFIX]) 195d838582fSmrgAC_SUBST([MISC_MAN_SUFFIX]) 196d838582fSmrgAC_SUBST([DRIVER_MAN_SUFFIX]) 197d838582fSmrgAC_SUBST([ADMIN_MAN_SUFFIX]) 198d838582fSmrgAC_SUBST([APP_MAN_DIR]) 199d838582fSmrgAC_SUBST([LIB_MAN_DIR]) 200d838582fSmrgAC_SUBST([FILE_MAN_DIR]) 201d838582fSmrgAC_SUBST([MISC_MAN_DIR]) 202d838582fSmrgAC_SUBST([DRIVER_MAN_DIR]) 203d838582fSmrgAC_SUBST([ADMIN_MAN_DIR]) 204d838582fSmrg]) # XORG_MANPAGE_SECTIONS 205d838582fSmrg 206d838582fSmrg# XORG_CHECK_LINUXDOC 207d838582fSmrg# ------------------- 208d838582fSmrg# Minimum version: 1.0.0 209d838582fSmrg# 210d838582fSmrg# Defines the variable MAKE_TEXT if the necessary tools and 211d838582fSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. 212d838582fSmrg# Whether or not the necessary tools and files are found can be checked 213d838582fSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC" 214d838582fSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[ 215d838582fSmrgXORG_SGML_PATH=$prefix/share/sgml 216d838582fSmrgHAVE_DEFS_ENT= 217d838582fSmrg 218d838582fSmrgif test x"$cross_compiling" = x"yes" ; then 219d838582fSmrg HAVE_DEFS_ENT=no 220d838582fSmrgelse 221d838582fSmrg AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes]) 222d838582fSmrgfi 223d838582fSmrg 224d838582fSmrgAC_PATH_PROG(LINUXDOC, linuxdoc) 225d838582fSmrgAC_PATH_PROG(PS2PDF, ps2pdf) 226d838582fSmrg 227d838582fSmrgAC_MSG_CHECKING([Whether to build documentation]) 228d838582fSmrg 229d838582fSmrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then 230d838582fSmrg BUILDDOC=yes 231d838582fSmrgelse 232d838582fSmrg BUILDDOC=no 233d838582fSmrgfi 234d838582fSmrg 235d838582fSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) 236d838582fSmrg 237d838582fSmrgAC_MSG_RESULT([$BUILDDOC]) 238d838582fSmrg 239d838582fSmrgAC_MSG_CHECKING([Whether to build pdf documentation]) 240d838582fSmrg 241d838582fSmrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then 242d838582fSmrg BUILDPDFDOC=yes 243d838582fSmrgelse 244d838582fSmrg BUILDPDFDOC=no 245d838582fSmrgfi 246d838582fSmrg 247d838582fSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 248d838582fSmrg 249d838582fSmrgAC_MSG_RESULT([$BUILDPDFDOC]) 250d838582fSmrg 251d838582fSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt" 252d838582fSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps" 253d838582fSmrgMAKE_PDF="$PS2PDF" 254d838582fSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0" 255d838582fSmrg 256d838582fSmrgAC_SUBST(MAKE_TEXT) 257d838582fSmrgAC_SUBST(MAKE_PS) 258d838582fSmrgAC_SUBST(MAKE_PDF) 259d838582fSmrgAC_SUBST(MAKE_HTML) 260d838582fSmrg]) # XORG_CHECK_LINUXDOC 261d838582fSmrg 262d838582fSmrg# XORG_CHECK_DOCBOOK 263d838582fSmrg# ------------------- 264d838582fSmrg# Minimum version: 1.0.0 265d838582fSmrg# 266d838582fSmrg# Checks for the ability to build output formats from SGML DocBook source. 267d838582fSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC" 268d838582fSmrg# indicates whether the necessary tools and files are found and, if set, 269d838582fSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx. 270d838582fSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[ 271d838582fSmrgXORG_SGML_PATH=$prefix/share/sgml 272d838582fSmrgHAVE_DEFS_ENT= 273d838582fSmrgBUILDTXTDOC=no 274d838582fSmrgBUILDPDFDOC=no 275d838582fSmrgBUILDPSDOC=no 276d838582fSmrgBUILDHTMLDOC=no 277d838582fSmrg 278d838582fSmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes]) 279d838582fSmrg 280d838582fSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps) 281d838582fSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf) 282d838582fSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html) 283d838582fSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt) 284d838582fSmrg 285d838582fSmrgAC_MSG_CHECKING([Whether to build text documentation]) 286d838582fSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x && 287d838582fSmrg test x$BUILD_TXTDOC != xno; then 288d838582fSmrg BUILDTXTDOC=yes 289d838582fSmrgfi 290d838582fSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes]) 291d838582fSmrgAC_MSG_RESULT([$BUILDTXTDOC]) 292d838582fSmrg 293d838582fSmrgAC_MSG_CHECKING([Whether to build PDF documentation]) 294d838582fSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x && 295d838582fSmrg test x$BUILD_PDFDOC != xno; then 296d838582fSmrg BUILDPDFDOC=yes 297d838582fSmrgfi 298d838582fSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 299d838582fSmrgAC_MSG_RESULT([$BUILDPDFDOC]) 300d838582fSmrg 301d838582fSmrgAC_MSG_CHECKING([Whether to build PostScript documentation]) 302d838582fSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x && 303d838582fSmrg test x$BUILD_PSDOC != xno; then 304d838582fSmrg BUILDPSDOC=yes 305d838582fSmrgfi 306d838582fSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes]) 307d838582fSmrgAC_MSG_RESULT([$BUILDPSDOC]) 308d838582fSmrg 309d838582fSmrgAC_MSG_CHECKING([Whether to build HTML documentation]) 310d838582fSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x && 311d838582fSmrg test x$BUILD_HTMLDOC != xno; then 312d838582fSmrg BUILDHTMLDOC=yes 313d838582fSmrgfi 314d838582fSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes]) 315d838582fSmrgAC_MSG_RESULT([$BUILDHTMLDOC]) 316d838582fSmrg 317d838582fSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT" 318d838582fSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS" 319d838582fSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF" 320d838582fSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML" 321d838582fSmrg 322d838582fSmrgAC_SUBST(MAKE_TEXT) 323d838582fSmrgAC_SUBST(MAKE_PS) 324d838582fSmrgAC_SUBST(MAKE_PDF) 325d838582fSmrgAC_SUBST(MAKE_HTML) 326d838582fSmrg]) # XORG_CHECK_DOCBOOK 327d838582fSmrg 328d838582fSmrg# XORG_CHECK_MALLOC_ZERO 329d838582fSmrg# ---------------------- 330d838582fSmrg# Minimum version: 1.0.0 331d838582fSmrg# 332d838582fSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if 333d838582fSmrg# malloc(0) returns NULL. Packages should add one of these cflags to 334d838582fSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. 335d838582fSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[ 336d838582fSmrgAC_ARG_ENABLE(malloc0returnsnull, 337d838582fSmrg AC_HELP_STRING([--enable-malloc0returnsnull], 338d838582fSmrg [malloc(0) returns NULL (default: auto)]), 339d838582fSmrg [MALLOC_ZERO_RETURNS_NULL=$enableval], 340d838582fSmrg [MALLOC_ZERO_RETURNS_NULL=auto]) 341d838582fSmrg 342d838582fSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL]) 343d838582fSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then 344d838582fSmrg AC_RUN_IFELSE([ 345d838582fSmrgchar *malloc(); 346d838582fSmrgchar *realloc(); 347d838582fSmrgchar *calloc(); 348d838582fSmrgmain() { 349d838582fSmrg char *m0, *r0, *c0, *p; 350d838582fSmrg m0 = malloc(0); 351d838582fSmrg p = malloc(10); 352d838582fSmrg r0 = realloc(p,0); 353d838582fSmrg c0 = calloc(0); 354d838582fSmrg exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1); 355d838582fSmrg}], 356d838582fSmrg [MALLOC_ZERO_RETURNS_NULL=yes], 357d838582fSmrg [MALLOC_ZERO_RETURNS_NULL=no]) 358d838582fSmrgfi 359d838582fSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) 360d838582fSmrg 361d838582fSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then 362d838582fSmrg MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" 363d838582fSmrg XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS 364d838582fSmrg XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" 365d838582fSmrgelse 366d838582fSmrg MALLOC_ZERO_CFLAGS="" 367d838582fSmrg XMALLOC_ZERO_CFLAGS="" 368d838582fSmrg XTMALLOC_ZERO_CFLAGS="" 369d838582fSmrgfi 370d838582fSmrg 371d838582fSmrgAC_SUBST([MALLOC_ZERO_CFLAGS]) 372d838582fSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS]) 373d838582fSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS]) 374d838582fSmrg]) # XORG_CHECK_MALLOC_ZERO 375d838582fSmrg 376d838582fSmrg# XORG_WITH_LINT() 377d838582fSmrg# ---------------- 378d838582fSmrg# Minimum version: 1.1.0 379d838582fSmrg# 380d838582fSmrg# Sets up flags for source checkers such as lint and sparse if --with-lint 381d838582fSmrg# is specified. (Use --with-lint=sparse for sparse.) 382d838582fSmrg# Sets $LINT to name of source checker passed with --with-lint (default: lint) 383d838582fSmrg# Sets $LINT_FLAGS to flags to pass to source checker 384d838582fSmrg# Sets LINT automake conditional if enabled (default: disabled) 385d838582fSmrg# 386d838582fSmrgAC_DEFUN([XORG_WITH_LINT],[ 387d838582fSmrg 388d838582fSmrg# Allow checking code with lint, sparse, etc. 389d838582fSmrgAC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint], 390d838582fSmrg [Use a lint-style source code checker (default: disabled)])], 391d838582fSmrg [use_lint=$withval], [use_lint=no]) 392d838582fSmrgif test "x$use_lint" = "xyes" ; then 393d838582fSmrg LINT="lint" 394d838582fSmrgelse 395d838582fSmrg LINT="$use_lint" 396d838582fSmrgfi 397d838582fSmrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then 398d838582fSmrg case $LINT in 399d838582fSmrg lint|*/lint) 400d838582fSmrg case $host_os in 401d838582fSmrg solaris*) 402d838582fSmrg LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2" 403d838582fSmrg ;; 404d838582fSmrg esac 405d838582fSmrg ;; 406d838582fSmrg esac 407d838582fSmrgfi 408d838582fSmrg 409d838582fSmrgAC_SUBST(LINT) 410d838582fSmrgAC_SUBST(LINT_FLAGS) 411d838582fSmrgAM_CONDITIONAL(LINT, [test x$LINT != xno]) 412d838582fSmrg 413d838582fSmrg]) # XORG_WITH_LINT 414d838582fSmrg 415d838582fSmrg# XORG_LINT_LIBRARY(LIBNAME) 416d838582fSmrg# -------------------------- 417d838582fSmrg# Minimum version: 1.1.0 418d838582fSmrg# 419d838582fSmrg# Sets up flags for building lint libraries for checking programs that call 420d838582fSmrg# functions in the library. 421d838582fSmrg# Disabled by default, enable with --enable-lint-library 422d838582fSmrg# Sets: 423d838582fSmrg# @LINTLIB@ - name of lint library file to make 424d838582fSmrg# MAKE_LINT_LIB - automake conditional 425d838582fSmrg# 426d838582fSmrg 427d838582fSmrgAC_DEFUN([XORG_LINT_LIBRARY],[ 428d838582fSmrgAC_REQUIRE([XORG_WITH_LINT]) 429d838582fSmrg# Build lint "library" for more indepth checks of programs calling this library 430d838582fSmrgAC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library], 431d838582fSmrg [Create lint library (default: disabled)])], 432d838582fSmrg [make_lint_lib=$enableval], [make_lint_lib=no]) 433d838582fSmrgif test "x$make_lint_lib" != "xno" ; then 434d838582fSmrg if test "x$LINT" = "xno" ; then 435d838582fSmrg AC_MSG_ERROR([Cannot make lint library without --with-lint]) 436d838582fSmrg fi 437d838582fSmrg if test "x$make_lint_lib" = "xyes" ; then 438d838582fSmrg LINTLIB=llib-l$1.ln 439d838582fSmrg else 440d838582fSmrg LINTLIB=$make_lint_lib 441d838582fSmrg fi 442d838582fSmrgfi 443d838582fSmrgAC_SUBST(LINTLIB) 444d838582fSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno]) 445d838582fSmrg 446d838582fSmrg]) # XORG_LINT_LIBRARY 447d838582fSmrg 448d838582fSmrgdnl Copyright 2005 Red Hat, Inc 449d838582fSmrgdnl 450d838582fSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its 451d838582fSmrgdnl documentation for any purpose is hereby granted without fee, provided that 452d838582fSmrgdnl the above copyright notice appear in all copies and that both that 453d838582fSmrgdnl copyright notice and this permission notice appear in supporting 454d838582fSmrgdnl documentation. 455d838582fSmrgdnl 456d838582fSmrgdnl The above copyright notice and this permission notice shall be included 457d838582fSmrgdnl in all copies or substantial portions of the Software. 458d838582fSmrgdnl 459d838582fSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 460d838582fSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 461d838582fSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 462d838582fSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 463d838582fSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 464d838582fSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 465d838582fSmrgdnl OTHER DEALINGS IN THE SOFTWARE. 466d838582fSmrgdnl 467d838582fSmrgdnl Except as contained in this notice, the name of the copyright holders shall 468d838582fSmrgdnl not be used in advertising or otherwise to promote the sale, use or 469d838582fSmrgdnl other dealings in this Software without prior written authorization 470d838582fSmrgdnl from the copyright holders. 471d838582fSmrgdnl 472d838582fSmrg 473d838582fSmrg# XORG_RELEASE_VERSION 474d838582fSmrg# -------------------- 475d838582fSmrg# Adds --with/without-release-string and changes the PACKAGE and 476d838582fSmrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION". If 477d838582fSmrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged. Also 478d838582fSmrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use. 479d838582fSmrg 480d838582fSmrgAC_DEFUN([XORG_RELEASE_VERSION],[ 481d838582fSmrg AC_ARG_WITH(release-version, 482d838582fSmrg AC_HELP_STRING([--with-release-version=STRING], 483d838582fSmrg [Use release version string in package name]), 484d838582fSmrg [RELEASE_VERSION="$withval"], 485d838582fSmrg [RELEASE_VERSION=""]) 486d838582fSmrg if test "x$RELEASE_VERSION" != "x"; then 487d838582fSmrg PACKAGE="$PACKAGE-$RELEASE_VERSION" 488d838582fSmrg PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION" 489d838582fSmrg AC_MSG_NOTICE([Building with package name set to $PACKAGE]) 490d838582fSmrg fi 491d838582fSmrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR], 492d838582fSmrg [`echo $PACKAGE_VERSION | cut -d . -f 1`], 493d838582fSmrg [Major version of this package]) 494d838582fSmrg PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` 495d838582fSmrg if test "x$PVM" = "x"; then 496d838582fSmrg PVM="0" 497d838582fSmrg fi 498d838582fSmrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR], 499d838582fSmrg [$PVM], 500d838582fSmrg [Minor version of this package]) 501d838582fSmrg PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` 502d838582fSmrg if test "x$PVP" = "x"; then 503d838582fSmrg PVP="0" 504d838582fSmrg fi 505d838582fSmrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL], 506d838582fSmrg [$PVP], 507d838582fSmrg [Patch version of this package]) 508d838582fSmrg]) 509d838582fSmrg 510d838582fSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. 511d838582fSmrg# 512d838582fSmrg# This file is free software; the Free Software Foundation 513d838582fSmrg# gives unlimited permission to copy and/or distribute it, 514d838582fSmrg# with or without modifications, as long as this notice is preserved. 515d838582fSmrg 516d838582fSmrg# AM_AUTOMAKE_VERSION(VERSION) 517d838582fSmrg# ---------------------------- 518d838582fSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been 519d838582fSmrg# generated from the m4 files accompanying Automake X.Y. 520d838582fSmrg# (This private macro should not be called outside this file.) 521d838582fSmrgAC_DEFUN([AM_AUTOMAKE_VERSION], 522d838582fSmrg[am__api_version='1.10' 523d838582fSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to 524d838582fSmrgdnl require some minimum version. Point them to the right macro. 525d838582fSmrgm4_if([$1], [1.10.1], [], 526d838582fSmrg [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl 527d838582fSmrg]) 528d838582fSmrg 529d838582fSmrg# _AM_AUTOCONF_VERSION(VERSION) 530d838582fSmrg# ----------------------------- 531d838582fSmrg# aclocal traces this macro to find the Autoconf version. 532d838582fSmrg# This is a private macro too. Using m4_define simplifies 533d838582fSmrg# the logic in aclocal, which can simply ignore this definition. 534d838582fSmrgm4_define([_AM_AUTOCONF_VERSION], []) 535d838582fSmrg 536d838582fSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION 537d838582fSmrg# ------------------------------- 538d838582fSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. 539d838582fSmrg# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. 540d838582fSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 541d838582fSmrg[AM_AUTOMAKE_VERSION([1.10.1])dnl 542d838582fSmrgm4_ifndef([AC_AUTOCONF_VERSION], 543d838582fSmrg [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 544d838582fSmrg_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) 545d838582fSmrg 546d838582fSmrg# AM_AUX_DIR_EXPAND -*- Autoconf -*- 547d838582fSmrg 548d838582fSmrg# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 549d838582fSmrg# 550d838582fSmrg# This file is free software; the Free Software Foundation 551d838582fSmrg# gives unlimited permission to copy and/or distribute it, 552d838582fSmrg# with or without modifications, as long as this notice is preserved. 553d838582fSmrg 554d838582fSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 555d838582fSmrg# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to 556d838582fSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'. 557d838582fSmrg# 558d838582fSmrg# Of course, Automake must honor this variable whenever it calls a 559d838582fSmrg# tool from the auxiliary directory. The problem is that $srcdir (and 560d838582fSmrg# therefore $ac_aux_dir as well) can be either absolute or relative, 561d838582fSmrg# depending on how configure is run. This is pretty annoying, since 562d838582fSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top 563d838582fSmrg# source directory, any form will work fine, but in subdirectories a 564d838582fSmrg# relative path needs to be adjusted first. 565d838582fSmrg# 566d838582fSmrg# $ac_aux_dir/missing 567d838582fSmrg# fails when called from a subdirectory if $ac_aux_dir is relative 568d838582fSmrg# $top_srcdir/$ac_aux_dir/missing 569d838582fSmrg# fails if $ac_aux_dir is absolute, 570d838582fSmrg# fails when called from a subdirectory in a VPATH build with 571d838582fSmrg# a relative $ac_aux_dir 572d838582fSmrg# 573d838582fSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir 574d838582fSmrg# are both prefixed by $srcdir. In an in-source build this is usually 575d838582fSmrg# harmless because $srcdir is `.', but things will broke when you 576d838582fSmrg# start a VPATH build or use an absolute $srcdir. 577d838582fSmrg# 578d838582fSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 579d838582fSmrg# iff we strip the leading $srcdir from $ac_aux_dir. That would be: 580d838582fSmrg# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 581d838582fSmrg# and then we would define $MISSING as 582d838582fSmrg# MISSING="\${SHELL} $am_aux_dir/missing" 583d838582fSmrg# This will work as long as MISSING is not called from configure, because 584d838582fSmrg# unfortunately $(top_srcdir) has no meaning in configure. 585d838582fSmrg# However there are other variables, like CC, which are often used in 586d838582fSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir. 587d838582fSmrg# 588d838582fSmrg# Another solution, used here, is to always expand $ac_aux_dir to an 589d838582fSmrg# absolute PATH. The drawback is that using absolute paths prevent a 590d838582fSmrg# configured tree to be moved without reconfiguration. 591d838582fSmrg 592d838582fSmrgAC_DEFUN([AM_AUX_DIR_EXPAND], 593d838582fSmrg[dnl Rely on autoconf to set up CDPATH properly. 594d838582fSmrgAC_PREREQ([2.50])dnl 595d838582fSmrg# expand $ac_aux_dir to an absolute path 596d838582fSmrgam_aux_dir=`cd $ac_aux_dir && pwd` 597d838582fSmrg]) 598d838582fSmrg 599d838582fSmrg# AM_CONDITIONAL -*- Autoconf -*- 600d838582fSmrg 601d838582fSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 602d838582fSmrg# Free Software Foundation, Inc. 603d838582fSmrg# 604d838582fSmrg# This file is free software; the Free Software Foundation 605d838582fSmrg# gives unlimited permission to copy and/or distribute it, 606d838582fSmrg# with or without modifications, as long as this notice is preserved. 607d838582fSmrg 608d838582fSmrg# serial 8 609d838582fSmrg 610d838582fSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION) 611d838582fSmrg# ------------------------------------- 612d838582fSmrg# Define a conditional. 613d838582fSmrgAC_DEFUN([AM_CONDITIONAL], 614d838582fSmrg[AC_PREREQ(2.52)dnl 615d838582fSmrg ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 616d838582fSmrg [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 617d838582fSmrgAC_SUBST([$1_TRUE])dnl 618d838582fSmrgAC_SUBST([$1_FALSE])dnl 619d838582fSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl 620d838582fSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl 621d838582fSmrgif $2; then 622d838582fSmrg $1_TRUE= 623d838582fSmrg $1_FALSE='#' 624d838582fSmrgelse 625d838582fSmrg $1_TRUE='#' 626d838582fSmrg $1_FALSE= 627d838582fSmrgfi 628d838582fSmrgAC_CONFIG_COMMANDS_PRE( 629d838582fSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 630d838582fSmrg AC_MSG_ERROR([[conditional "$1" was never defined. 631d838582fSmrgUsually this means the macro was only invoked conditionally.]]) 632d838582fSmrgfi])]) 633d838582fSmrg 634d838582fSmrg# Do all the work for Automake. -*- Autoconf -*- 635d838582fSmrg 636d838582fSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 637d838582fSmrg# 2005, 2006, 2008 Free Software Foundation, Inc. 638d838582fSmrg# 639d838582fSmrg# This file is free software; the Free Software Foundation 640d838582fSmrg# gives unlimited permission to copy and/or distribute it, 641d838582fSmrg# with or without modifications, as long as this notice is preserved. 642d838582fSmrg 643d838582fSmrg# serial 13 644d838582fSmrg 645d838582fSmrg# This macro actually does too much. Some checks are only needed if 646d838582fSmrg# your package does certain things. But this isn't really a big deal. 647d838582fSmrg 648d838582fSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 649d838582fSmrg# AM_INIT_AUTOMAKE([OPTIONS]) 650d838582fSmrg# ----------------------------------------------- 651d838582fSmrg# The call with PACKAGE and VERSION arguments is the old style 652d838582fSmrg# call (pre autoconf-2.50), which is being phased out. PACKAGE 653d838582fSmrg# and VERSION should now be passed to AC_INIT and removed from 654d838582fSmrg# the call to AM_INIT_AUTOMAKE. 655d838582fSmrg# We support both call styles for the transition. After 656d838582fSmrg# the next Automake release, Autoconf can make the AC_INIT 657d838582fSmrg# arguments mandatory, and then we can depend on a new Autoconf 658d838582fSmrg# release and drop the old call support. 659d838582fSmrgAC_DEFUN([AM_INIT_AUTOMAKE], 660d838582fSmrg[AC_PREREQ([2.60])dnl 661d838582fSmrgdnl Autoconf wants to disallow AM_ names. We explicitly allow 662d838582fSmrgdnl the ones we care about. 663d838582fSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 664d838582fSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 665d838582fSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl 666d838582fSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then 667d838582fSmrg # Use -I$(srcdir) only when $(srcdir) != ., so that make's output 668d838582fSmrg # is not polluted with repeated "-I." 669d838582fSmrg AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl 670d838582fSmrg # test to see if srcdir already configured 671d838582fSmrg if test -f $srcdir/config.status; then 672d838582fSmrg AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 673d838582fSmrg fi 674d838582fSmrgfi 675d838582fSmrg 676d838582fSmrg# test whether we have cygpath 677d838582fSmrgif test -z "$CYGPATH_W"; then 678d838582fSmrg if (cygpath --version) >/dev/null 2>/dev/null; then 679d838582fSmrg CYGPATH_W='cygpath -w' 680d838582fSmrg else 681d838582fSmrg CYGPATH_W=echo 682d838582fSmrg fi 683d838582fSmrgfi 684d838582fSmrgAC_SUBST([CYGPATH_W]) 685d838582fSmrg 686d838582fSmrg# Define the identity of the package. 687d838582fSmrgdnl Distinguish between old-style and new-style calls. 688d838582fSmrgm4_ifval([$2], 689d838582fSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 690d838582fSmrg AC_SUBST([PACKAGE], [$1])dnl 691d838582fSmrg AC_SUBST([VERSION], [$2])], 692d838582fSmrg[_AM_SET_OPTIONS([$1])dnl 693d838582fSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. 694d838582fSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, 695d838582fSmrg [m4_fatal([AC_INIT should be called with package and version arguments])])dnl 696d838582fSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl 697d838582fSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl 698d838582fSmrg 699d838582fSmrg_AM_IF_OPTION([no-define],, 700d838582fSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) 701d838582fSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl 702d838582fSmrg 703d838582fSmrg# Some tools Automake needs. 704d838582fSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl 705d838582fSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl 706d838582fSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) 707d838582fSmrgAM_MISSING_PROG(AUTOCONF, autoconf) 708d838582fSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) 709d838582fSmrgAM_MISSING_PROG(AUTOHEADER, autoheader) 710d838582fSmrgAM_MISSING_PROG(MAKEINFO, makeinfo) 711d838582fSmrgAM_PROG_INSTALL_SH 712d838582fSmrgAM_PROG_INSTALL_STRIP 713d838582fSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl 714d838582fSmrg# We need awk for the "check" target. The system "awk" is bad on 715d838582fSmrg# some platforms. 716d838582fSmrgAC_REQUIRE([AC_PROG_AWK])dnl 717d838582fSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl 718d838582fSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl 719d838582fSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], 720d838582fSmrg [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], 721d838582fSmrg [_AM_PROG_TAR([v7])])]) 722d838582fSmrg_AM_IF_OPTION([no-dependencies],, 723d838582fSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC], 724d838582fSmrg [_AM_DEPENDENCIES(CC)], 725d838582fSmrg [define([AC_PROG_CC], 726d838582fSmrg defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl 727d838582fSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX], 728d838582fSmrg [_AM_DEPENDENCIES(CXX)], 729d838582fSmrg [define([AC_PROG_CXX], 730d838582fSmrg defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl 731d838582fSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC], 732d838582fSmrg [_AM_DEPENDENCIES(OBJC)], 733d838582fSmrg [define([AC_PROG_OBJC], 734d838582fSmrg defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl 735d838582fSmrg]) 736d838582fSmrg]) 737d838582fSmrg 738d838582fSmrg 739d838582fSmrg# When config.status generates a header, we must update the stamp-h file. 740d838582fSmrg# This file resides in the same directory as the config header 741d838582fSmrg# that is generated. The stamp files are numbered to have different names. 742d838582fSmrg 743d838582fSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 744d838582fSmrg# loop where config.status creates the headers, so we can generate 745d838582fSmrg# our stamp files there. 746d838582fSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 747d838582fSmrg[# Compute $1's index in $config_headers. 748d838582fSmrg_am_arg=$1 749d838582fSmrg_am_stamp_count=1 750d838582fSmrgfor _am_header in $config_headers :; do 751d838582fSmrg case $_am_header in 752d838582fSmrg $_am_arg | $_am_arg:* ) 753d838582fSmrg break ;; 754d838582fSmrg * ) 755d838582fSmrg _am_stamp_count=`expr $_am_stamp_count + 1` ;; 756d838582fSmrg esac 757d838582fSmrgdone 758d838582fSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) 759d838582fSmrg 760d838582fSmrg# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 761d838582fSmrg# 762d838582fSmrg# This file is free software; the Free Software Foundation 763d838582fSmrg# gives unlimited permission to copy and/or distribute it, 764d838582fSmrg# with or without modifications, as long as this notice is preserved. 765d838582fSmrg 766d838582fSmrg# AM_PROG_INSTALL_SH 767d838582fSmrg# ------------------ 768d838582fSmrg# Define $install_sh. 769d838582fSmrgAC_DEFUN([AM_PROG_INSTALL_SH], 770d838582fSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 771d838582fSmrginstall_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} 772d838582fSmrgAC_SUBST(install_sh)]) 773d838582fSmrg 774d838582fSmrg# Copyright (C) 2003, 2005 Free Software Foundation, Inc. 775d838582fSmrg# 776d838582fSmrg# This file is free software; the Free Software Foundation 777d838582fSmrg# gives unlimited permission to copy and/or distribute it, 778d838582fSmrg# with or without modifications, as long as this notice is preserved. 779d838582fSmrg 780d838582fSmrg# serial 2 781d838582fSmrg 782d838582fSmrg# Check whether the underlying file-system supports filenames 783d838582fSmrg# with a leading dot. For instance MS-DOS doesn't. 784d838582fSmrgAC_DEFUN([AM_SET_LEADING_DOT], 785d838582fSmrg[rm -rf .tst 2>/dev/null 786d838582fSmrgmkdir .tst 2>/dev/null 787d838582fSmrgif test -d .tst; then 788d838582fSmrg am__leading_dot=. 789d838582fSmrgelse 790d838582fSmrg am__leading_dot=_ 791d838582fSmrgfi 792d838582fSmrgrmdir .tst 2>/dev/null 793d838582fSmrgAC_SUBST([am__leading_dot])]) 794d838582fSmrg 795d838582fSmrg# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- 796d838582fSmrg# From Jim Meyering 797d838582fSmrg 798d838582fSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005 799d838582fSmrg# Free Software Foundation, Inc. 800d838582fSmrg# 801d838582fSmrg# This file is free software; the Free Software Foundation 802d838582fSmrg# gives unlimited permission to copy and/or distribute it, 803d838582fSmrg# with or without modifications, as long as this notice is preserved. 804d838582fSmrg 805d838582fSmrg# serial 4 806d838582fSmrg 807d838582fSmrgAC_DEFUN([AM_MAINTAINER_MODE], 808d838582fSmrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) 809d838582fSmrg dnl maintainer-mode is disabled by default 810d838582fSmrg AC_ARG_ENABLE(maintainer-mode, 811d838582fSmrg[ --enable-maintainer-mode enable make rules and dependencies not useful 812d838582fSmrg (and sometimes confusing) to the casual installer], 813d838582fSmrg USE_MAINTAINER_MODE=$enableval, 814d838582fSmrg USE_MAINTAINER_MODE=no) 815d838582fSmrg AC_MSG_RESULT([$USE_MAINTAINER_MODE]) 816d838582fSmrg AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) 817d838582fSmrg MAINT=$MAINTAINER_MODE_TRUE 818d838582fSmrg AC_SUBST(MAINT)dnl 819d838582fSmrg] 820d838582fSmrg) 821d838582fSmrg 822d838582fSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) 823d838582fSmrg 824d838582fSmrg# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- 825d838582fSmrg 826d838582fSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 827d838582fSmrg# Free Software Foundation, Inc. 828d838582fSmrg# 829d838582fSmrg# This file is free software; the Free Software Foundation 830d838582fSmrg# gives unlimited permission to copy and/or distribute it, 831d838582fSmrg# with or without modifications, as long as this notice is preserved. 832d838582fSmrg 833d838582fSmrg# serial 5 834d838582fSmrg 835d838582fSmrg# AM_MISSING_PROG(NAME, PROGRAM) 836d838582fSmrg# ------------------------------ 837d838582fSmrgAC_DEFUN([AM_MISSING_PROG], 838d838582fSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN]) 839d838582fSmrg$1=${$1-"${am_missing_run}$2"} 840d838582fSmrgAC_SUBST($1)]) 841d838582fSmrg 842d838582fSmrg 843d838582fSmrg# AM_MISSING_HAS_RUN 844d838582fSmrg# ------------------ 845d838582fSmrg# Define MISSING if not defined so far and test if it supports --run. 846d838582fSmrg# If it does, set am_missing_run to use it, otherwise, to nothing. 847d838582fSmrgAC_DEFUN([AM_MISSING_HAS_RUN], 848d838582fSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 849d838582fSmrgAC_REQUIRE_AUX_FILE([missing])dnl 850d838582fSmrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" 851d838582fSmrg# Use eval to expand $SHELL 852d838582fSmrgif eval "$MISSING --run true"; then 853d838582fSmrg am_missing_run="$MISSING --run " 854d838582fSmrgelse 855d838582fSmrg am_missing_run= 856d838582fSmrg AC_MSG_WARN([`missing' script is too old or missing]) 857d838582fSmrgfi 858d838582fSmrg]) 859d838582fSmrg 860d838582fSmrg# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 861d838582fSmrg# 862d838582fSmrg# This file is free software; the Free Software Foundation 863d838582fSmrg# gives unlimited permission to copy and/or distribute it, 864d838582fSmrg# with or without modifications, as long as this notice is preserved. 865d838582fSmrg 866d838582fSmrg# AM_PROG_MKDIR_P 867d838582fSmrg# --------------- 868d838582fSmrg# Check for `mkdir -p'. 869d838582fSmrgAC_DEFUN([AM_PROG_MKDIR_P], 870d838582fSmrg[AC_PREREQ([2.60])dnl 871d838582fSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl 872d838582fSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, 873d838582fSmrgdnl while keeping a definition of mkdir_p for backward compatibility. 874d838582fSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. 875d838582fSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of 876d838582fSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own 877d838582fSmrgdnl adjustment using top_builddir (which is defined more often than 878d838582fSmrgdnl MKDIR_P). 879d838582fSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl 880d838582fSmrgcase $mkdir_p in 881d838582fSmrg [[\\/$]]* | ?:[[\\/]]*) ;; 882d838582fSmrg */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; 883d838582fSmrgesac 884d838582fSmrg]) 885d838582fSmrg 886d838582fSmrg# Helper functions for option handling. -*- Autoconf -*- 887d838582fSmrg 888d838582fSmrg# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. 889d838582fSmrg# 890d838582fSmrg# This file is free software; the Free Software Foundation 891d838582fSmrg# gives unlimited permission to copy and/or distribute it, 892d838582fSmrg# with or without modifications, as long as this notice is preserved. 893d838582fSmrg 894d838582fSmrg# serial 3 895d838582fSmrg 896d838582fSmrg# _AM_MANGLE_OPTION(NAME) 897d838582fSmrg# ----------------------- 898d838582fSmrgAC_DEFUN([_AM_MANGLE_OPTION], 899d838582fSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 900d838582fSmrg 901d838582fSmrg# _AM_SET_OPTION(NAME) 902d838582fSmrg# ------------------------------ 903d838582fSmrg# Set option NAME. Presently that only means defining a flag for this option. 904d838582fSmrgAC_DEFUN([_AM_SET_OPTION], 905d838582fSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) 906d838582fSmrg 907d838582fSmrg# _AM_SET_OPTIONS(OPTIONS) 908d838582fSmrg# ---------------------------------- 909d838582fSmrg# OPTIONS is a space-separated list of Automake options. 910d838582fSmrgAC_DEFUN([_AM_SET_OPTIONS], 911d838582fSmrg[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 912d838582fSmrg 913d838582fSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 914d838582fSmrg# ------------------------------------------- 915d838582fSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 916d838582fSmrgAC_DEFUN([_AM_IF_OPTION], 917d838582fSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 918d838582fSmrg 919d838582fSmrg# Check to make sure that the build environment is sane. -*- Autoconf -*- 920d838582fSmrg 921d838582fSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 922d838582fSmrg# Free Software Foundation, Inc. 923d838582fSmrg# 924d838582fSmrg# This file is free software; the Free Software Foundation 925d838582fSmrg# gives unlimited permission to copy and/or distribute it, 926d838582fSmrg# with or without modifications, as long as this notice is preserved. 927d838582fSmrg 928d838582fSmrg# serial 4 929d838582fSmrg 930d838582fSmrg# AM_SANITY_CHECK 931d838582fSmrg# --------------- 932d838582fSmrgAC_DEFUN([AM_SANITY_CHECK], 933d838582fSmrg[AC_MSG_CHECKING([whether build environment is sane]) 934d838582fSmrg# Just in case 935d838582fSmrgsleep 1 936d838582fSmrgecho timestamp > conftest.file 937d838582fSmrg# Do `set' in a subshell so we don't clobber the current shell's 938d838582fSmrg# arguments. Must try -L first in case configure is actually a 939d838582fSmrg# symlink; some systems play weird games with the mod time of symlinks 940d838582fSmrg# (eg FreeBSD returns the mod time of the symlink's containing 941d838582fSmrg# directory). 942d838582fSmrgif ( 943d838582fSmrg set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` 944d838582fSmrg if test "$[*]" = "X"; then 945d838582fSmrg # -L didn't work. 946d838582fSmrg set X `ls -t $srcdir/configure conftest.file` 947d838582fSmrg fi 948d838582fSmrg rm -f conftest.file 949d838582fSmrg if test "$[*]" != "X $srcdir/configure conftest.file" \ 950d838582fSmrg && test "$[*]" != "X conftest.file $srcdir/configure"; then 951d838582fSmrg 952d838582fSmrg # If neither matched, then we have a broken ls. This can happen 953d838582fSmrg # if, for instance, CONFIG_SHELL is bash and it inherits a 954d838582fSmrg # broken ls alias from the environment. This has actually 955d838582fSmrg # happened. Such a system could not be considered "sane". 956d838582fSmrg AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 957d838582fSmrgalias in your environment]) 958d838582fSmrg fi 959d838582fSmrg 960d838582fSmrg test "$[2]" = conftest.file 961d838582fSmrg ) 962d838582fSmrgthen 963d838582fSmrg # Ok. 964d838582fSmrg : 965d838582fSmrgelse 966d838582fSmrg AC_MSG_ERROR([newly created file is older than distributed files! 967d838582fSmrgCheck your system clock]) 968d838582fSmrgfi 969d838582fSmrgAC_MSG_RESULT(yes)]) 970d838582fSmrg 971d838582fSmrg# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 972d838582fSmrg# 973d838582fSmrg# This file is free software; the Free Software Foundation 974d838582fSmrg# gives unlimited permission to copy and/or distribute it, 975d838582fSmrg# with or without modifications, as long as this notice is preserved. 976d838582fSmrg 977d838582fSmrg# AM_PROG_INSTALL_STRIP 978d838582fSmrg# --------------------- 979d838582fSmrg# One issue with vendor `install' (even GNU) is that you can't 980d838582fSmrg# specify the program used to strip binaries. This is especially 981d838582fSmrg# annoying in cross-compiling environments, where the build's strip 982d838582fSmrg# is unlikely to handle the host's binaries. 983d838582fSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we 984d838582fSmrg# always use install-sh in `make install-strip', and initialize 985d838582fSmrg# STRIPPROG with the value of the STRIP variable (set by the user). 986d838582fSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP], 987d838582fSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 988d838582fSmrg# Installed binaries are usually stripped using `strip' when the user 989d838582fSmrg# run `make install-strip'. However `strip' might not be the right 990d838582fSmrg# tool to use in cross-compilation environments, therefore Automake 991d838582fSmrg# will honor the `STRIP' environment variable to overrule this program. 992d838582fSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'. 993d838582fSmrgif test "$cross_compiling" != no; then 994d838582fSmrg AC_CHECK_TOOL([STRIP], [strip], :) 995d838582fSmrgfi 996d838582fSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" 997d838582fSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])]) 998d838582fSmrg 999d838582fSmrg# Copyright (C) 2006 Free Software Foundation, Inc. 1000d838582fSmrg# 1001d838582fSmrg# This file is free software; the Free Software Foundation 1002d838582fSmrg# gives unlimited permission to copy and/or distribute it, 1003d838582fSmrg# with or without modifications, as long as this notice is preserved. 1004d838582fSmrg 1005d838582fSmrg# _AM_SUBST_NOTMAKE(VARIABLE) 1006d838582fSmrg# --------------------------- 1007d838582fSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. 1008d838582fSmrg# This macro is traced by Automake. 1009d838582fSmrgAC_DEFUN([_AM_SUBST_NOTMAKE]) 1010d838582fSmrg 1011d838582fSmrg# Check how to create a tarball. -*- Autoconf -*- 1012d838582fSmrg 1013d838582fSmrg# Copyright (C) 2004, 2005 Free Software Foundation, Inc. 1014d838582fSmrg# 1015d838582fSmrg# This file is free software; the Free Software Foundation 1016d838582fSmrg# gives unlimited permission to copy and/or distribute it, 1017d838582fSmrg# with or without modifications, as long as this notice is preserved. 1018d838582fSmrg 1019d838582fSmrg# serial 2 1020d838582fSmrg 1021d838582fSmrg# _AM_PROG_TAR(FORMAT) 1022d838582fSmrg# -------------------- 1023d838582fSmrg# Check how to create a tarball in format FORMAT. 1024d838582fSmrg# FORMAT should be one of `v7', `ustar', or `pax'. 1025d838582fSmrg# 1026d838582fSmrg# Substitute a variable $(am__tar) that is a command 1027d838582fSmrg# writing to stdout a FORMAT-tarball containing the directory 1028d838582fSmrg# $tardir. 1029d838582fSmrg# tardir=directory && $(am__tar) > result.tar 1030d838582fSmrg# 1031d838582fSmrg# Substitute a variable $(am__untar) that extract such 1032d838582fSmrg# a tarball read from stdin. 1033d838582fSmrg# $(am__untar) < result.tar 1034d838582fSmrgAC_DEFUN([_AM_PROG_TAR], 1035d838582fSmrg[# Always define AMTAR for backward compatibility. 1036d838582fSmrgAM_MISSING_PROG([AMTAR], [tar]) 1037d838582fSmrgm4_if([$1], [v7], 1038d838582fSmrg [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], 1039d838582fSmrg [m4_case([$1], [ustar],, [pax],, 1040d838582fSmrg [m4_fatal([Unknown tar format])]) 1041d838582fSmrgAC_MSG_CHECKING([how to create a $1 tar archive]) 1042d838582fSmrg# Loop over all known methods to create a tar archive until one works. 1043d838582fSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' 1044d838582fSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools} 1045d838582fSmrg# Do not fold the above two line into one, because Tru64 sh and 1046d838582fSmrg# Solaris sh will not grok spaces in the rhs of `-'. 1047d838582fSmrgfor _am_tool in $_am_tools 1048d838582fSmrgdo 1049d838582fSmrg case $_am_tool in 1050d838582fSmrg gnutar) 1051d838582fSmrg for _am_tar in tar gnutar gtar; 1052d838582fSmrg do 1053d838582fSmrg AM_RUN_LOG([$_am_tar --version]) && break 1054d838582fSmrg done 1055d838582fSmrg am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' 1056d838582fSmrg am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' 1057d838582fSmrg am__untar="$_am_tar -xf -" 1058d838582fSmrg ;; 1059d838582fSmrg plaintar) 1060d838582fSmrg # Must skip GNU tar: if it does not support --format= it doesn't create 1061d838582fSmrg # ustar tarball either. 1062d838582fSmrg (tar --version) >/dev/null 2>&1 && continue 1063d838582fSmrg am__tar='tar chf - "$$tardir"' 1064d838582fSmrg am__tar_='tar chf - "$tardir"' 1065d838582fSmrg am__untar='tar xf -' 1066d838582fSmrg ;; 1067d838582fSmrg pax) 1068d838582fSmrg am__tar='pax -L -x $1 -w "$$tardir"' 1069d838582fSmrg am__tar_='pax -L -x $1 -w "$tardir"' 1070d838582fSmrg am__untar='pax -r' 1071d838582fSmrg ;; 1072d838582fSmrg cpio) 1073d838582fSmrg am__tar='find "$$tardir" -print | cpio -o -H $1 -L' 1074d838582fSmrg am__tar_='find "$tardir" -print | cpio -o -H $1 -L' 1075d838582fSmrg am__untar='cpio -i -H $1 -d' 1076d838582fSmrg ;; 1077d838582fSmrg none) 1078d838582fSmrg am__tar=false 1079d838582fSmrg am__tar_=false 1080d838582fSmrg am__untar=false 1081d838582fSmrg ;; 1082d838582fSmrg esac 1083d838582fSmrg 1084d838582fSmrg # If the value was cached, stop now. We just wanted to have am__tar 1085d838582fSmrg # and am__untar set. 1086d838582fSmrg test -n "${am_cv_prog_tar_$1}" && break 1087d838582fSmrg 1088d838582fSmrg # tar/untar a dummy directory, and stop if the command works 1089d838582fSmrg rm -rf conftest.dir 1090d838582fSmrg mkdir conftest.dir 1091d838582fSmrg echo GrepMe > conftest.dir/file 1092d838582fSmrg AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) 1093d838582fSmrg rm -rf conftest.dir 1094d838582fSmrg if test -s conftest.tar; then 1095d838582fSmrg AM_RUN_LOG([$am__untar <conftest.tar]) 1096d838582fSmrg grep GrepMe conftest.dir/file >/dev/null 2>&1 && break 1097d838582fSmrg fi 1098d838582fSmrgdone 1099d838582fSmrgrm -rf conftest.dir 1100d838582fSmrg 1101d838582fSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) 1102d838582fSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])]) 1103d838582fSmrgAC_SUBST([am__tar]) 1104d838582fSmrgAC_SUBST([am__untar]) 1105d838582fSmrg]) # _AM_PROG_TAR 1106d838582fSmrg 1107