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