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