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