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