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