aclocal.m4 revision 165cb819
1165cb819Smrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*- 2100ae103Smrg 3100ae103Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 4165cb819Smrg# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. 5100ae103Smrg# This file is free software; the Free Software Foundation 6100ae103Smrg# gives unlimited permission to copy and/or distribute it, 7100ae103Smrg# with or without modifications, as long as this notice is preserved. 8100ae103Smrg 9100ae103Smrg# This program is distributed in the hope that it will be useful, 10100ae103Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without 11100ae103Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A 12100ae103Smrg# PARTICULAR PURPOSE. 13100ae103Smrg 14165cb819Smrgm4_ifndef([AC_AUTOCONF_VERSION], 15165cb819Smrg [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 16165cb819Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],, 17165cb819Smrg[m4_warning([this file was generated for autoconf 2.65. 18165cb819SmrgYou have another version of autoconf. It may work, but is not guaranteed to. 19165cb819SmrgIf you have problems, you may need to regenerate the build system entirely. 20165cb819SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])]) 21100ae103Smrg 22165cb819Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. 23100ae103Smrg# 24100ae103Smrg# This file is free software; the Free Software Foundation 25100ae103Smrg# gives unlimited permission to copy and/or distribute it, 26100ae103Smrg# with or without modifications, as long as this notice is preserved. 27100ae103Smrg 28100ae103Smrg# AM_AUTOMAKE_VERSION(VERSION) 29100ae103Smrg# ---------------------------- 30100ae103Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been 31100ae103Smrg# generated from the m4 files accompanying Automake X.Y. 32165cb819Smrg# (This private macro should not be called outside this file.) 33165cb819SmrgAC_DEFUN([AM_AUTOMAKE_VERSION], 34165cb819Smrg[am__api_version='1.11' 35165cb819Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to 36165cb819Smrgdnl require some minimum version. Point them to the right macro. 37165cb819Smrgm4_if([$1], [1.11.1], [], 38165cb819Smrg [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl 39165cb819Smrg]) 40165cb819Smrg 41165cb819Smrg# _AM_AUTOCONF_VERSION(VERSION) 42165cb819Smrg# ----------------------------- 43165cb819Smrg# aclocal traces this macro to find the Autoconf version. 44165cb819Smrg# This is a private macro too. Using m4_define simplifies 45165cb819Smrg# the logic in aclocal, which can simply ignore this definition. 46165cb819Smrgm4_define([_AM_AUTOCONF_VERSION], []) 47100ae103Smrg 48100ae103Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION 49100ae103Smrg# ------------------------------- 50165cb819Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. 51165cb819Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. 52100ae103SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 53165cb819Smrg[AM_AUTOMAKE_VERSION([1.11.1])dnl 54165cb819Smrgm4_ifndef([AC_AUTOCONF_VERSION], 55165cb819Smrg [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 56165cb819Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) 57100ae103Smrg 58100ae103Smrg# AM_AUX_DIR_EXPAND -*- Autoconf -*- 59100ae103Smrg 60100ae103Smrg# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 61100ae103Smrg# 62100ae103Smrg# This file is free software; the Free Software Foundation 63100ae103Smrg# gives unlimited permission to copy and/or distribute it, 64100ae103Smrg# with or without modifications, as long as this notice is preserved. 65100ae103Smrg 66100ae103Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 67100ae103Smrg# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to 68100ae103Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'. 69100ae103Smrg# 70100ae103Smrg# Of course, Automake must honor this variable whenever it calls a 71100ae103Smrg# tool from the auxiliary directory. The problem is that $srcdir (and 72100ae103Smrg# therefore $ac_aux_dir as well) can be either absolute or relative, 73100ae103Smrg# depending on how configure is run. This is pretty annoying, since 74100ae103Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top 75100ae103Smrg# source directory, any form will work fine, but in subdirectories a 76100ae103Smrg# relative path needs to be adjusted first. 77100ae103Smrg# 78100ae103Smrg# $ac_aux_dir/missing 79100ae103Smrg# fails when called from a subdirectory if $ac_aux_dir is relative 80100ae103Smrg# $top_srcdir/$ac_aux_dir/missing 81100ae103Smrg# fails if $ac_aux_dir is absolute, 82100ae103Smrg# fails when called from a subdirectory in a VPATH build with 83100ae103Smrg# a relative $ac_aux_dir 84100ae103Smrg# 85100ae103Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir 86100ae103Smrg# are both prefixed by $srcdir. In an in-source build this is usually 87100ae103Smrg# harmless because $srcdir is `.', but things will broke when you 88100ae103Smrg# start a VPATH build or use an absolute $srcdir. 89100ae103Smrg# 90100ae103Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 91100ae103Smrg# iff we strip the leading $srcdir from $ac_aux_dir. That would be: 92100ae103Smrg# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 93100ae103Smrg# and then we would define $MISSING as 94100ae103Smrg# MISSING="\${SHELL} $am_aux_dir/missing" 95100ae103Smrg# This will work as long as MISSING is not called from configure, because 96100ae103Smrg# unfortunately $(top_srcdir) has no meaning in configure. 97100ae103Smrg# However there are other variables, like CC, which are often used in 98100ae103Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir. 99100ae103Smrg# 100100ae103Smrg# Another solution, used here, is to always expand $ac_aux_dir to an 101100ae103Smrg# absolute PATH. The drawback is that using absolute paths prevent a 102100ae103Smrg# configured tree to be moved without reconfiguration. 103100ae103Smrg 104100ae103SmrgAC_DEFUN([AM_AUX_DIR_EXPAND], 105100ae103Smrg[dnl Rely on autoconf to set up CDPATH properly. 106100ae103SmrgAC_PREREQ([2.50])dnl 107100ae103Smrg# expand $ac_aux_dir to an absolute path 108100ae103Smrgam_aux_dir=`cd $ac_aux_dir && pwd` 109100ae103Smrg]) 110100ae103Smrg 111100ae103Smrg# AM_CONDITIONAL -*- Autoconf -*- 112100ae103Smrg 113165cb819Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 114100ae103Smrg# Free Software Foundation, Inc. 115100ae103Smrg# 116100ae103Smrg# This file is free software; the Free Software Foundation 117100ae103Smrg# gives unlimited permission to copy and/or distribute it, 118100ae103Smrg# with or without modifications, as long as this notice is preserved. 119100ae103Smrg 120165cb819Smrg# serial 9 121100ae103Smrg 122100ae103Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION) 123100ae103Smrg# ------------------------------------- 124100ae103Smrg# Define a conditional. 125100ae103SmrgAC_DEFUN([AM_CONDITIONAL], 126100ae103Smrg[AC_PREREQ(2.52)dnl 127100ae103Smrg ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 128100ae103Smrg [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 129165cb819SmrgAC_SUBST([$1_TRUE])dnl 130165cb819SmrgAC_SUBST([$1_FALSE])dnl 131165cb819Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl 132165cb819Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl 133165cb819Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl 134100ae103Smrgif $2; then 135100ae103Smrg $1_TRUE= 136100ae103Smrg $1_FALSE='#' 137100ae103Smrgelse 138100ae103Smrg $1_TRUE='#' 139100ae103Smrg $1_FALSE= 140100ae103Smrgfi 141100ae103SmrgAC_CONFIG_COMMANDS_PRE( 142100ae103Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 143100ae103Smrg AC_MSG_ERROR([[conditional "$1" was never defined. 144100ae103SmrgUsually this means the macro was only invoked conditionally.]]) 145100ae103Smrgfi])]) 146100ae103Smrg 147165cb819Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 148100ae103Smrg# Free Software Foundation, Inc. 149100ae103Smrg# 150100ae103Smrg# This file is free software; the Free Software Foundation 151100ae103Smrg# gives unlimited permission to copy and/or distribute it, 152100ae103Smrg# with or without modifications, as long as this notice is preserved. 153100ae103Smrg 154165cb819Smrg# serial 10 155100ae103Smrg 156100ae103Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be 157100ae103Smrg# written in clear, in which case automake, when reading aclocal.m4, 158100ae103Smrg# will think it sees a *use*, and therefore will trigger all it's 159100ae103Smrg# C support machinery. Also note that it means that autoscan, seeing 160100ae103Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use... 161100ae103Smrg 162100ae103Smrg 163100ae103Smrg# _AM_DEPENDENCIES(NAME) 164100ae103Smrg# ---------------------- 165100ae103Smrg# See how the compiler implements dependency checking. 166100ae103Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC". 167100ae103Smrg# We try a few techniques and use that to set a single cache variable. 168100ae103Smrg# 169100ae103Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was 170100ae103Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular 171100ae103Smrg# dependency, and given that the user is not expected to run this macro, 172100ae103Smrg# just rely on AC_PROG_CC. 173100ae103SmrgAC_DEFUN([_AM_DEPENDENCIES], 174100ae103Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl 175100ae103SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl 176100ae103SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl 177100ae103SmrgAC_REQUIRE([AM_DEP_TRACK])dnl 178100ae103Smrg 179100ae103Smrgifelse([$1], CC, [depcc="$CC" am_compiler_list=], 180100ae103Smrg [$1], CXX, [depcc="$CXX" am_compiler_list=], 181100ae103Smrg [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 182165cb819Smrg [$1], UPC, [depcc="$UPC" am_compiler_list=], 183100ae103Smrg [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 184100ae103Smrg [depcc="$$1" am_compiler_list=]) 185100ae103Smrg 186100ae103SmrgAC_CACHE_CHECK([dependency style of $depcc], 187100ae103Smrg [am_cv_$1_dependencies_compiler_type], 188100ae103Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then 189100ae103Smrg # We make a subdir and do the tests there. Otherwise we can end up 190100ae103Smrg # making bogus files that we don't know about and never remove. For 191100ae103Smrg # instance it was reported that on HP-UX the gcc test will end up 192100ae103Smrg # making a dummy file named `D' -- because `-MD' means `put the output 193100ae103Smrg # in D'. 194100ae103Smrg mkdir conftest.dir 195100ae103Smrg # Copy depcomp to subdir because otherwise we won't find it if we're 196100ae103Smrg # using a relative directory. 197100ae103Smrg cp "$am_depcomp" conftest.dir 198100ae103Smrg cd conftest.dir 199100ae103Smrg # We will build objects and dependencies in a subdirectory because 200100ae103Smrg # it helps to detect inapplicable dependency modes. For instance 201100ae103Smrg # both Tru64's cc and ICC support -MD to output dependencies as a 202100ae103Smrg # side effect of compilation, but ICC will put the dependencies in 203100ae103Smrg # the current directory while Tru64 will put them in the object 204100ae103Smrg # directory. 205100ae103Smrg mkdir sub 206100ae103Smrg 207100ae103Smrg am_cv_$1_dependencies_compiler_type=none 208100ae103Smrg if test "$am_compiler_list" = ""; then 209100ae103Smrg am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` 210100ae103Smrg fi 211165cb819Smrg am__universal=false 212165cb819Smrg m4_case([$1], [CC], 213165cb819Smrg [case " $depcc " in #( 214165cb819Smrg *\ -arch\ *\ -arch\ *) am__universal=true ;; 215165cb819Smrg esac], 216165cb819Smrg [CXX], 217165cb819Smrg [case " $depcc " in #( 218165cb819Smrg *\ -arch\ *\ -arch\ *) am__universal=true ;; 219165cb819Smrg esac]) 220165cb819Smrg 221100ae103Smrg for depmode in $am_compiler_list; do 222100ae103Smrg # Setup a source with many dependencies, because some compilers 223100ae103Smrg # like to wrap large dependency lists on column 80 (with \), and 224100ae103Smrg # we should not choose a depcomp mode which is confused by this. 225100ae103Smrg # 226100ae103Smrg # We need to recreate these files for each test, as the compiler may 227100ae103Smrg # overwrite some of them when testing with obscure command lines. 228100ae103Smrg # This happens at least with the AIX C compiler. 229100ae103Smrg : > sub/conftest.c 230100ae103Smrg for i in 1 2 3 4 5 6; do 231100ae103Smrg echo '#include "conftst'$i'.h"' >> sub/conftest.c 232100ae103Smrg # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with 233100ae103Smrg # Solaris 8's {/usr,}/bin/sh. 234100ae103Smrg touch sub/conftst$i.h 235100ae103Smrg done 236100ae103Smrg echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 237100ae103Smrg 238165cb819Smrg # We check with `-c' and `-o' for the sake of the "dashmstdout" 239165cb819Smrg # mode. It turns out that the SunPro C++ compiler does not properly 240165cb819Smrg # handle `-M -o', and we need to detect this. Also, some Intel 241165cb819Smrg # versions had trouble with output in subdirs 242165cb819Smrg am__obj=sub/conftest.${OBJEXT-o} 243165cb819Smrg am__minus_obj="-o $am__obj" 244100ae103Smrg case $depmode in 245165cb819Smrg gcc) 246165cb819Smrg # This depmode causes a compiler race in universal mode. 247165cb819Smrg test "$am__universal" = false || continue 248165cb819Smrg ;; 249100ae103Smrg nosideeffect) 250100ae103Smrg # after this tag, mechanisms are not by side-effect, so they'll 251100ae103Smrg # only be used when explicitly requested 252100ae103Smrg if test "x$enable_dependency_tracking" = xyes; then 253100ae103Smrg continue 254100ae103Smrg else 255100ae103Smrg break 256100ae103Smrg fi 257100ae103Smrg ;; 258165cb819Smrg msvisualcpp | msvcmsys) 259165cb819Smrg # This compiler won't grok `-c -o', but also, the minuso test has 260165cb819Smrg # not run yet. These depmodes are late enough in the game, and 261165cb819Smrg # so weak that their functioning should not be impacted. 262165cb819Smrg am__obj=conftest.${OBJEXT-o} 263165cb819Smrg am__minus_obj= 264165cb819Smrg ;; 265100ae103Smrg none) break ;; 266100ae103Smrg esac 267100ae103Smrg if depmode=$depmode \ 268165cb819Smrg source=sub/conftest.c object=$am__obj \ 269100ae103Smrg depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ 270165cb819Smrg $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ 271100ae103Smrg >/dev/null 2>conftest.err && 272165cb819Smrg grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 273100ae103Smrg grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && 274165cb819Smrg grep $am__obj sub/conftest.Po > /dev/null 2>&1 && 275100ae103Smrg ${MAKE-make} -s -f confmf > /dev/null 2>&1; then 276100ae103Smrg # icc doesn't choke on unknown options, it will just issue warnings 277100ae103Smrg # or remarks (even with -Werror). So we grep stderr for any message 278100ae103Smrg # that says an option was ignored or not supported. 279100ae103Smrg # When given -MP, icc 7.0 and 7.1 complain thusly: 280100ae103Smrg # icc: Command line warning: ignoring option '-M'; no argument required 281100ae103Smrg # The diagnosis changed in icc 8.0: 282100ae103Smrg # icc: Command line remark: option '-MP' not supported 283100ae103Smrg if (grep 'ignoring option' conftest.err || 284100ae103Smrg grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else 285100ae103Smrg am_cv_$1_dependencies_compiler_type=$depmode 286100ae103Smrg break 287100ae103Smrg fi 288100ae103Smrg fi 289100ae103Smrg done 290100ae103Smrg 291100ae103Smrg cd .. 292100ae103Smrg rm -rf conftest.dir 293100ae103Smrgelse 294100ae103Smrg am_cv_$1_dependencies_compiler_type=none 295100ae103Smrgfi 296100ae103Smrg]) 297100ae103SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) 298100ae103SmrgAM_CONDITIONAL([am__fastdep$1], [ 299100ae103Smrg test "x$enable_dependency_tracking" != xno \ 300100ae103Smrg && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) 301100ae103Smrg]) 302100ae103Smrg 303100ae103Smrg 304100ae103Smrg# AM_SET_DEPDIR 305100ae103Smrg# ------------- 306100ae103Smrg# Choose a directory name for dependency files. 307100ae103Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES 308100ae103SmrgAC_DEFUN([AM_SET_DEPDIR], 309100ae103Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl 310100ae103SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl 311100ae103Smrg]) 312100ae103Smrg 313100ae103Smrg 314100ae103Smrg# AM_DEP_TRACK 315100ae103Smrg# ------------ 316100ae103SmrgAC_DEFUN([AM_DEP_TRACK], 317100ae103Smrg[AC_ARG_ENABLE(dependency-tracking, 318100ae103Smrg[ --disable-dependency-tracking speeds up one-time build 319100ae103Smrg --enable-dependency-tracking do not reject slow dependency extractors]) 320100ae103Smrgif test "x$enable_dependency_tracking" != xno; then 321100ae103Smrg am_depcomp="$ac_aux_dir/depcomp" 322100ae103Smrg AMDEPBACKSLASH='\' 323100ae103Smrgfi 324100ae103SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) 325165cb819SmrgAC_SUBST([AMDEPBACKSLASH])dnl 326165cb819Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl 327100ae103Smrg]) 328100ae103Smrg 329100ae103Smrg# Generate code to set up dependency tracking. -*- Autoconf -*- 330100ae103Smrg 331165cb819Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 332100ae103Smrg# Free Software Foundation, Inc. 333100ae103Smrg# 334100ae103Smrg# This file is free software; the Free Software Foundation 335100ae103Smrg# gives unlimited permission to copy and/or distribute it, 336100ae103Smrg# with or without modifications, as long as this notice is preserved. 337100ae103Smrg 338165cb819Smrg#serial 5 339100ae103Smrg 340100ae103Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS 341100ae103Smrg# ------------------------------ 342100ae103SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], 343165cb819Smrg[{ 344165cb819Smrg # Autoconf 2.62 quotes --file arguments for eval, but not when files 345165cb819Smrg # are listed without --file. Let's play safe and only enable the eval 346165cb819Smrg # if we detect the quoting. 347165cb819Smrg case $CONFIG_FILES in 348165cb819Smrg *\'*) eval set x "$CONFIG_FILES" ;; 349165cb819Smrg *) set x $CONFIG_FILES ;; 350165cb819Smrg esac 351165cb819Smrg shift 352165cb819Smrg for mf 353165cb819Smrg do 354165cb819Smrg # Strip MF so we end up with the name of the file. 355165cb819Smrg mf=`echo "$mf" | sed -e 's/:.*$//'` 356165cb819Smrg # Check whether this is an Automake generated Makefile or not. 357165cb819Smrg # We used to match only the files named `Makefile.in', but 358165cb819Smrg # some people rename them; so instead we look at the file content. 359165cb819Smrg # Grep'ing the first line is not enough: some people post-process 360165cb819Smrg # each Makefile.in and add a new line on top of each file to say so. 361165cb819Smrg # Grep'ing the whole file is not good either: AIX grep has a line 362165cb819Smrg # limit of 2048, but all sed's we know have understand at least 4000. 363165cb819Smrg if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then 364165cb819Smrg dirpart=`AS_DIRNAME("$mf")` 365165cb819Smrg else 366165cb819Smrg continue 367165cb819Smrg fi 368165cb819Smrg # Extract the definition of DEPDIR, am__include, and am__quote 369165cb819Smrg # from the Makefile without running `make'. 370165cb819Smrg DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` 371165cb819Smrg test -z "$DEPDIR" && continue 372165cb819Smrg am__include=`sed -n 's/^am__include = //p' < "$mf"` 373165cb819Smrg test -z "am__include" && continue 374165cb819Smrg am__quote=`sed -n 's/^am__quote = //p' < "$mf"` 375165cb819Smrg # When using ansi2knr, U may be empty or an underscore; expand it 376165cb819Smrg U=`sed -n 's/^U = //p' < "$mf"` 377165cb819Smrg # Find all dependency output files, they are included files with 378165cb819Smrg # $(DEPDIR) in their names. We invoke sed twice because it is the 379165cb819Smrg # simplest approach to changing $(DEPDIR) to its actual value in the 380165cb819Smrg # expansion. 381165cb819Smrg for file in `sed -n " 382165cb819Smrg s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ 383165cb819Smrg sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do 384165cb819Smrg # Make sure the directory exists. 385165cb819Smrg test -f "$dirpart/$file" && continue 386165cb819Smrg fdir=`AS_DIRNAME(["$file"])` 387165cb819Smrg AS_MKDIR_P([$dirpart/$fdir]) 388165cb819Smrg # echo "creating $dirpart/$file" 389165cb819Smrg echo '# dummy' > "$dirpart/$file" 390165cb819Smrg done 391100ae103Smrg done 392165cb819Smrg} 393100ae103Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS 394100ae103Smrg 395100ae103Smrg 396100ae103Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS 397100ae103Smrg# ----------------------------- 398100ae103Smrg# This macro should only be invoked once -- use via AC_REQUIRE. 399100ae103Smrg# 400100ae103Smrg# This code is only required when automatic dependency tracking 401100ae103Smrg# is enabled. FIXME. This creates each `.P' file that we will 402100ae103Smrg# need in order to bootstrap the dependency handling code. 403100ae103SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], 404100ae103Smrg[AC_CONFIG_COMMANDS([depfiles], 405100ae103Smrg [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], 406100ae103Smrg [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) 407100ae103Smrg]) 408100ae103Smrg 409100ae103Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 410100ae103Smrg# Free Software Foundation, Inc. 411100ae103Smrg# 412100ae103Smrg# This file is free software; the Free Software Foundation 413100ae103Smrg# gives unlimited permission to copy and/or distribute it, 414100ae103Smrg# with or without modifications, as long as this notice is preserved. 415100ae103Smrg 416100ae103Smrg# serial 8 417100ae103Smrg 418100ae103Smrg# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. 419100ae103SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) 420100ae103Smrg 421100ae103Smrg# Do all the work for Automake. -*- Autoconf -*- 422100ae103Smrg 423165cb819Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 424165cb819Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. 425100ae103Smrg# 426100ae103Smrg# This file is free software; the Free Software Foundation 427100ae103Smrg# gives unlimited permission to copy and/or distribute it, 428100ae103Smrg# with or without modifications, as long as this notice is preserved. 429100ae103Smrg 430165cb819Smrg# serial 16 431100ae103Smrg 432100ae103Smrg# This macro actually does too much. Some checks are only needed if 433100ae103Smrg# your package does certain things. But this isn't really a big deal. 434100ae103Smrg 435100ae103Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 436100ae103Smrg# AM_INIT_AUTOMAKE([OPTIONS]) 437100ae103Smrg# ----------------------------------------------- 438100ae103Smrg# The call with PACKAGE and VERSION arguments is the old style 439100ae103Smrg# call (pre autoconf-2.50), which is being phased out. PACKAGE 440100ae103Smrg# and VERSION should now be passed to AC_INIT and removed from 441100ae103Smrg# the call to AM_INIT_AUTOMAKE. 442100ae103Smrg# We support both call styles for the transition. After 443100ae103Smrg# the next Automake release, Autoconf can make the AC_INIT 444100ae103Smrg# arguments mandatory, and then we can depend on a new Autoconf 445100ae103Smrg# release and drop the old call support. 446100ae103SmrgAC_DEFUN([AM_INIT_AUTOMAKE], 447165cb819Smrg[AC_PREREQ([2.62])dnl 448100ae103Smrgdnl Autoconf wants to disallow AM_ names. We explicitly allow 449100ae103Smrgdnl the ones we care about. 450100ae103Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 451100ae103SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 452100ae103SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl 453165cb819Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then 454165cb819Smrg # Use -I$(srcdir) only when $(srcdir) != ., so that make's output 455165cb819Smrg # is not polluted with repeated "-I." 456165cb819Smrg AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl 457165cb819Smrg # test to see if srcdir already configured 458165cb819Smrg if test -f $srcdir/config.status; then 459165cb819Smrg AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 460165cb819Smrg fi 461100ae103Smrgfi 462100ae103Smrg 463100ae103Smrg# test whether we have cygpath 464100ae103Smrgif test -z "$CYGPATH_W"; then 465100ae103Smrg if (cygpath --version) >/dev/null 2>/dev/null; then 466100ae103Smrg CYGPATH_W='cygpath -w' 467100ae103Smrg else 468100ae103Smrg CYGPATH_W=echo 469100ae103Smrg fi 470100ae103Smrgfi 471100ae103SmrgAC_SUBST([CYGPATH_W]) 472100ae103Smrg 473100ae103Smrg# Define the identity of the package. 474100ae103Smrgdnl Distinguish between old-style and new-style calls. 475100ae103Smrgm4_ifval([$2], 476100ae103Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 477100ae103Smrg AC_SUBST([PACKAGE], [$1])dnl 478100ae103Smrg AC_SUBST([VERSION], [$2])], 479100ae103Smrg[_AM_SET_OPTIONS([$1])dnl 480165cb819Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. 481165cb819Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, 482165cb819Smrg [m4_fatal([AC_INIT should be called with package and version arguments])])dnl 483100ae103Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl 484100ae103Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl 485100ae103Smrg 486100ae103Smrg_AM_IF_OPTION([no-define],, 487100ae103Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) 488100ae103Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl 489100ae103Smrg 490100ae103Smrg# Some tools Automake needs. 491100ae103SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl 492100ae103SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl 493100ae103SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) 494100ae103SmrgAM_MISSING_PROG(AUTOCONF, autoconf) 495100ae103SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) 496100ae103SmrgAM_MISSING_PROG(AUTOHEADER, autoheader) 497100ae103SmrgAM_MISSING_PROG(MAKEINFO, makeinfo) 498165cb819SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl 499165cb819SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl 500100ae103SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl 501100ae103Smrg# We need awk for the "check" target. The system "awk" is bad on 502100ae103Smrg# some platforms. 503100ae103SmrgAC_REQUIRE([AC_PROG_AWK])dnl 504100ae103SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl 505100ae103SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl 506100ae103Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], 507165cb819Smrg [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], 508165cb819Smrg [_AM_PROG_TAR([v7])])]) 509100ae103Smrg_AM_IF_OPTION([no-dependencies],, 510100ae103Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC], 511165cb819Smrg [_AM_DEPENDENCIES(CC)], 512165cb819Smrg [define([AC_PROG_CC], 513165cb819Smrg defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl 514100ae103SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX], 515165cb819Smrg [_AM_DEPENDENCIES(CXX)], 516165cb819Smrg [define([AC_PROG_CXX], 517165cb819Smrg defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl 518165cb819SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC], 519165cb819Smrg [_AM_DEPENDENCIES(OBJC)], 520165cb819Smrg [define([AC_PROG_OBJC], 521165cb819Smrg defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl 522100ae103Smrg]) 523165cb819Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl 524165cb819Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the 525165cb819Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro 526165cb819Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below. 527165cb819SmrgAC_CONFIG_COMMANDS_PRE(dnl 528165cb819Smrg[m4_provide_if([_AM_COMPILER_EXEEXT], 529165cb819Smrg [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl 530100ae103Smrg]) 531100ae103Smrg 532165cb819Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not 533165cb819Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further 534165cb819Smrgdnl mangled by Autoconf and run in a shell conditional statement. 535165cb819Smrgm4_define([_AC_COMPILER_EXEEXT], 536165cb819Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) 537165cb819Smrg 538100ae103Smrg 539100ae103Smrg# When config.status generates a header, we must update the stamp-h file. 540100ae103Smrg# This file resides in the same directory as the config header 541100ae103Smrg# that is generated. The stamp files are numbered to have different names. 542100ae103Smrg 543100ae103Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 544100ae103Smrg# loop where config.status creates the headers, so we can generate 545100ae103Smrg# our stamp files there. 546100ae103SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 547100ae103Smrg[# Compute $1's index in $config_headers. 548165cb819Smrg_am_arg=$1 549100ae103Smrg_am_stamp_count=1 550100ae103Smrgfor _am_header in $config_headers :; do 551100ae103Smrg case $_am_header in 552165cb819Smrg $_am_arg | $_am_arg:* ) 553100ae103Smrg break ;; 554100ae103Smrg * ) 555100ae103Smrg _am_stamp_count=`expr $_am_stamp_count + 1` ;; 556100ae103Smrg esac 557100ae103Smrgdone 558165cb819Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) 559100ae103Smrg 560165cb819Smrg# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. 561100ae103Smrg# 562100ae103Smrg# This file is free software; the Free Software Foundation 563100ae103Smrg# gives unlimited permission to copy and/or distribute it, 564100ae103Smrg# with or without modifications, as long as this notice is preserved. 565100ae103Smrg 566100ae103Smrg# AM_PROG_INSTALL_SH 567100ae103Smrg# ------------------ 568100ae103Smrg# Define $install_sh. 569100ae103SmrgAC_DEFUN([AM_PROG_INSTALL_SH], 570100ae103Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 571165cb819Smrgif test x"${install_sh}" != xset; then 572165cb819Smrg case $am_aux_dir in 573165cb819Smrg *\ * | *\ *) 574165cb819Smrg install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; 575165cb819Smrg *) 576165cb819Smrg install_sh="\${SHELL} $am_aux_dir/install-sh" 577165cb819Smrg esac 578165cb819Smrgfi 579100ae103SmrgAC_SUBST(install_sh)]) 580100ae103Smrg 581100ae103Smrg# Copyright (C) 2003, 2005 Free Software Foundation, Inc. 582100ae103Smrg# 583100ae103Smrg# This file is free software; the Free Software Foundation 584100ae103Smrg# gives unlimited permission to copy and/or distribute it, 585100ae103Smrg# with or without modifications, as long as this notice is preserved. 586100ae103Smrg 587100ae103Smrg# serial 2 588100ae103Smrg 589100ae103Smrg# Check whether the underlying file-system supports filenames 590100ae103Smrg# with a leading dot. For instance MS-DOS doesn't. 591100ae103SmrgAC_DEFUN([AM_SET_LEADING_DOT], 592100ae103Smrg[rm -rf .tst 2>/dev/null 593100ae103Smrgmkdir .tst 2>/dev/null 594100ae103Smrgif test -d .tst; then 595100ae103Smrg am__leading_dot=. 596100ae103Smrgelse 597100ae103Smrg am__leading_dot=_ 598100ae103Smrgfi 599100ae103Smrgrmdir .tst 2>/dev/null 600100ae103SmrgAC_SUBST([am__leading_dot])]) 601100ae103Smrg 602100ae103Smrg# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- 603100ae103Smrg# From Jim Meyering 604100ae103Smrg 605165cb819Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 606100ae103Smrg# Free Software Foundation, Inc. 607100ae103Smrg# 608100ae103Smrg# This file is free software; the Free Software Foundation 609100ae103Smrg# gives unlimited permission to copy and/or distribute it, 610100ae103Smrg# with or without modifications, as long as this notice is preserved. 611100ae103Smrg 612165cb819Smrg# serial 5 613100ae103Smrg 614165cb819Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE]) 615165cb819Smrg# ---------------------------------- 616165cb819Smrg# Control maintainer-specific portions of Makefiles. 617165cb819Smrg# Default is to disable them, unless `enable' is passed literally. 618165cb819Smrg# For symmetry, `disable' may be passed as well. Anyway, the user 619165cb819Smrg# can override the default with the --enable/--disable switch. 620100ae103SmrgAC_DEFUN([AM_MAINTAINER_MODE], 621165cb819Smrg[m4_case(m4_default([$1], [disable]), 622165cb819Smrg [enable], [m4_define([am_maintainer_other], [disable])], 623165cb819Smrg [disable], [m4_define([am_maintainer_other], [enable])], 624165cb819Smrg [m4_define([am_maintainer_other], [enable]) 625165cb819Smrg m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) 626165cb819SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) 627165cb819Smrg dnl maintainer-mode's default is 'disable' unless 'enable' is passed 628165cb819Smrg AC_ARG_ENABLE([maintainer-mode], 629165cb819Smrg[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful 630100ae103Smrg (and sometimes confusing) to the casual installer], 631165cb819Smrg [USE_MAINTAINER_MODE=$enableval], 632165cb819Smrg [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) 633100ae103Smrg AC_MSG_RESULT([$USE_MAINTAINER_MODE]) 634165cb819Smrg AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) 635100ae103Smrg MAINT=$MAINTAINER_MODE_TRUE 636165cb819Smrg AC_SUBST([MAINT])dnl 637100ae103Smrg] 638100ae103Smrg) 639100ae103Smrg 640100ae103SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) 641100ae103Smrg 642100ae103Smrg# Check to see how 'make' treats includes. -*- Autoconf -*- 643100ae103Smrg 644165cb819Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. 645100ae103Smrg# 646100ae103Smrg# This file is free software; the Free Software Foundation 647100ae103Smrg# gives unlimited permission to copy and/or distribute it, 648100ae103Smrg# with or without modifications, as long as this notice is preserved. 649100ae103Smrg 650165cb819Smrg# serial 4 651100ae103Smrg 652100ae103Smrg# AM_MAKE_INCLUDE() 653100ae103Smrg# ----------------- 654100ae103Smrg# Check to see how make treats includes. 655100ae103SmrgAC_DEFUN([AM_MAKE_INCLUDE], 656100ae103Smrg[am_make=${MAKE-make} 657100ae103Smrgcat > confinc << 'END' 658100ae103Smrgam__doit: 659165cb819Smrg @echo this is the am__doit target 660100ae103Smrg.PHONY: am__doit 661100ae103SmrgEND 662100ae103Smrg# If we don't find an include directive, just comment out the code. 663100ae103SmrgAC_MSG_CHECKING([for style of include used by $am_make]) 664100ae103Smrgam__include="#" 665100ae103Smrgam__quote= 666100ae103Smrg_am_result=none 667100ae103Smrg# First try GNU make style include. 668100ae103Smrgecho "include confinc" > confmf 669165cb819Smrg# Ignore all kinds of additional output from `make'. 670165cb819Smrgcase `$am_make -s -f confmf 2> /dev/null` in #( 671165cb819Smrg*the\ am__doit\ target*) 672165cb819Smrg am__include=include 673165cb819Smrg am__quote= 674165cb819Smrg _am_result=GNU 675165cb819Smrg ;; 676165cb819Smrgesac 677100ae103Smrg# Now try BSD make style include. 678100ae103Smrgif test "$am__include" = "#"; then 679100ae103Smrg echo '.include "confinc"' > confmf 680165cb819Smrg case `$am_make -s -f confmf 2> /dev/null` in #( 681165cb819Smrg *the\ am__doit\ target*) 682165cb819Smrg am__include=.include 683165cb819Smrg am__quote="\"" 684165cb819Smrg _am_result=BSD 685165cb819Smrg ;; 686165cb819Smrg esac 687100ae103Smrgfi 688100ae103SmrgAC_SUBST([am__include]) 689100ae103SmrgAC_SUBST([am__quote]) 690100ae103SmrgAC_MSG_RESULT([$_am_result]) 691100ae103Smrgrm -f confinc confmf 692100ae103Smrg]) 693100ae103Smrg 694100ae103Smrg# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- 695100ae103Smrg 696165cb819Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 697100ae103Smrg# Free Software Foundation, Inc. 698100ae103Smrg# 699100ae103Smrg# This file is free software; the Free Software Foundation 700100ae103Smrg# gives unlimited permission to copy and/or distribute it, 701100ae103Smrg# with or without modifications, as long as this notice is preserved. 702100ae103Smrg 703165cb819Smrg# serial 6 704100ae103Smrg 705100ae103Smrg# AM_MISSING_PROG(NAME, PROGRAM) 706100ae103Smrg# ------------------------------ 707100ae103SmrgAC_DEFUN([AM_MISSING_PROG], 708100ae103Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN]) 709100ae103Smrg$1=${$1-"${am_missing_run}$2"} 710100ae103SmrgAC_SUBST($1)]) 711100ae103Smrg 712100ae103Smrg 713100ae103Smrg# AM_MISSING_HAS_RUN 714100ae103Smrg# ------------------ 715100ae103Smrg# Define MISSING if not defined so far and test if it supports --run. 716100ae103Smrg# If it does, set am_missing_run to use it, otherwise, to nothing. 717100ae103SmrgAC_DEFUN([AM_MISSING_HAS_RUN], 718100ae103Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 719165cb819SmrgAC_REQUIRE_AUX_FILE([missing])dnl 720165cb819Smrgif test x"${MISSING+set}" != xset; then 721165cb819Smrg case $am_aux_dir in 722165cb819Smrg *\ * | *\ *) 723165cb819Smrg MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; 724165cb819Smrg *) 725165cb819Smrg MISSING="\${SHELL} $am_aux_dir/missing" ;; 726165cb819Smrg esac 727165cb819Smrgfi 728100ae103Smrg# Use eval to expand $SHELL 729100ae103Smrgif eval "$MISSING --run true"; then 730100ae103Smrg am_missing_run="$MISSING --run " 731100ae103Smrgelse 732100ae103Smrg am_missing_run= 733100ae103Smrg AC_MSG_WARN([`missing' script is too old or missing]) 734100ae103Smrgfi 735100ae103Smrg]) 736100ae103Smrg 737165cb819Smrg# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 738100ae103Smrg# 739100ae103Smrg# This file is free software; the Free Software Foundation 740100ae103Smrg# gives unlimited permission to copy and/or distribute it, 741100ae103Smrg# with or without modifications, as long as this notice is preserved. 742100ae103Smrg 743100ae103Smrg# AM_PROG_MKDIR_P 744100ae103Smrg# --------------- 745165cb819Smrg# Check for `mkdir -p'. 746100ae103SmrgAC_DEFUN([AM_PROG_MKDIR_P], 747165cb819Smrg[AC_PREREQ([2.60])dnl 748165cb819SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl 749165cb819Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, 750165cb819Smrgdnl while keeping a definition of mkdir_p for backward compatibility. 751165cb819Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. 752165cb819Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of 753165cb819Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own 754165cb819Smrgdnl adjustment using top_builddir (which is defined more often than 755165cb819Smrgdnl MKDIR_P). 756165cb819SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl 757165cb819Smrgcase $mkdir_p in 758165cb819Smrg [[\\/$]]* | ?:[[\\/]]*) ;; 759165cb819Smrg */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; 760165cb819Smrgesac 761165cb819Smrg]) 762100ae103Smrg 763100ae103Smrg# Helper functions for option handling. -*- Autoconf -*- 764100ae103Smrg 765165cb819Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. 766100ae103Smrg# 767100ae103Smrg# This file is free software; the Free Software Foundation 768100ae103Smrg# gives unlimited permission to copy and/or distribute it, 769100ae103Smrg# with or without modifications, as long as this notice is preserved. 770100ae103Smrg 771165cb819Smrg# serial 4 772100ae103Smrg 773100ae103Smrg# _AM_MANGLE_OPTION(NAME) 774100ae103Smrg# ----------------------- 775100ae103SmrgAC_DEFUN([_AM_MANGLE_OPTION], 776100ae103Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 777100ae103Smrg 778100ae103Smrg# _AM_SET_OPTION(NAME) 779100ae103Smrg# ------------------------------ 780100ae103Smrg# Set option NAME. Presently that only means defining a flag for this option. 781100ae103SmrgAC_DEFUN([_AM_SET_OPTION], 782100ae103Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) 783100ae103Smrg 784100ae103Smrg# _AM_SET_OPTIONS(OPTIONS) 785100ae103Smrg# ---------------------------------- 786100ae103Smrg# OPTIONS is a space-separated list of Automake options. 787100ae103SmrgAC_DEFUN([_AM_SET_OPTIONS], 788165cb819Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 789100ae103Smrg 790100ae103Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 791100ae103Smrg# ------------------------------------------- 792100ae103Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 793100ae103SmrgAC_DEFUN([_AM_IF_OPTION], 794100ae103Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 795100ae103Smrg 796100ae103Smrg# Check to make sure that the build environment is sane. -*- Autoconf -*- 797100ae103Smrg 798165cb819Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 799100ae103Smrg# Free Software Foundation, Inc. 800100ae103Smrg# 801100ae103Smrg# This file is free software; the Free Software Foundation 802100ae103Smrg# gives unlimited permission to copy and/or distribute it, 803100ae103Smrg# with or without modifications, as long as this notice is preserved. 804100ae103Smrg 805165cb819Smrg# serial 5 806100ae103Smrg 807100ae103Smrg# AM_SANITY_CHECK 808100ae103Smrg# --------------- 809100ae103SmrgAC_DEFUN([AM_SANITY_CHECK], 810100ae103Smrg[AC_MSG_CHECKING([whether build environment is sane]) 811100ae103Smrg# Just in case 812100ae103Smrgsleep 1 813100ae103Smrgecho timestamp > conftest.file 814165cb819Smrg# Reject unsafe characters in $srcdir or the absolute working directory 815165cb819Smrg# name. Accept space and tab only in the latter. 816165cb819Smrgam_lf=' 817165cb819Smrg' 818165cb819Smrgcase `pwd` in 819165cb819Smrg *[[\\\"\#\$\&\'\`$am_lf]]*) 820165cb819Smrg AC_MSG_ERROR([unsafe absolute working directory name]);; 821165cb819Smrgesac 822165cb819Smrgcase $srcdir in 823165cb819Smrg *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) 824165cb819Smrg AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; 825165cb819Smrgesac 826165cb819Smrg 827100ae103Smrg# Do `set' in a subshell so we don't clobber the current shell's 828100ae103Smrg# arguments. Must try -L first in case configure is actually a 829100ae103Smrg# symlink; some systems play weird games with the mod time of symlinks 830100ae103Smrg# (eg FreeBSD returns the mod time of the symlink's containing 831100ae103Smrg# directory). 832100ae103Smrgif ( 833165cb819Smrg set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` 834100ae103Smrg if test "$[*]" = "X"; then 835100ae103Smrg # -L didn't work. 836165cb819Smrg set X `ls -t "$srcdir/configure" conftest.file` 837100ae103Smrg fi 838100ae103Smrg rm -f conftest.file 839100ae103Smrg if test "$[*]" != "X $srcdir/configure conftest.file" \ 840100ae103Smrg && test "$[*]" != "X conftest.file $srcdir/configure"; then 841100ae103Smrg 842100ae103Smrg # If neither matched, then we have a broken ls. This can happen 843100ae103Smrg # if, for instance, CONFIG_SHELL is bash and it inherits a 844100ae103Smrg # broken ls alias from the environment. This has actually 845100ae103Smrg # happened. Such a system could not be considered "sane". 846100ae103Smrg AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 847100ae103Smrgalias in your environment]) 848100ae103Smrg fi 849100ae103Smrg 850100ae103Smrg test "$[2]" = conftest.file 851100ae103Smrg ) 852100ae103Smrgthen 853100ae103Smrg # Ok. 854100ae103Smrg : 855100ae103Smrgelse 856100ae103Smrg AC_MSG_ERROR([newly created file is older than distributed files! 857100ae103SmrgCheck your system clock]) 858100ae103Smrgfi 859100ae103SmrgAC_MSG_RESULT(yes)]) 860100ae103Smrg 861165cb819Smrg# Copyright (C) 2009 Free Software Foundation, Inc. 862165cb819Smrg# 863165cb819Smrg# This file is free software; the Free Software Foundation 864165cb819Smrg# gives unlimited permission to copy and/or distribute it, 865165cb819Smrg# with or without modifications, as long as this notice is preserved. 866165cb819Smrg 867165cb819Smrg# serial 1 868165cb819Smrg 869165cb819Smrg# AM_SILENT_RULES([DEFAULT]) 870165cb819Smrg# -------------------------- 871165cb819Smrg# Enable less verbose build rules; with the default set to DEFAULT 872165cb819Smrg# (`yes' being less verbose, `no' or empty being verbose). 873165cb819SmrgAC_DEFUN([AM_SILENT_RULES], 874165cb819Smrg[AC_ARG_ENABLE([silent-rules], 875165cb819Smrg[ --enable-silent-rules less verbose build output (undo: `make V=1') 876165cb819Smrg --disable-silent-rules verbose build output (undo: `make V=0')]) 877165cb819Smrgcase $enable_silent_rules in 878165cb819Smrgyes) AM_DEFAULT_VERBOSITY=0;; 879165cb819Smrgno) AM_DEFAULT_VERBOSITY=1;; 880165cb819Smrg*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; 881165cb819Smrgesac 882165cb819SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl 883165cb819SmrgAM_BACKSLASH='\' 884165cb819SmrgAC_SUBST([AM_BACKSLASH])dnl 885165cb819Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl 886165cb819Smrg]) 887165cb819Smrg 888100ae103Smrg# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 889100ae103Smrg# 890100ae103Smrg# This file is free software; the Free Software Foundation 891100ae103Smrg# gives unlimited permission to copy and/or distribute it, 892100ae103Smrg# with or without modifications, as long as this notice is preserved. 893100ae103Smrg 894100ae103Smrg# AM_PROG_INSTALL_STRIP 895100ae103Smrg# --------------------- 896100ae103Smrg# One issue with vendor `install' (even GNU) is that you can't 897100ae103Smrg# specify the program used to strip binaries. This is especially 898100ae103Smrg# annoying in cross-compiling environments, where the build's strip 899100ae103Smrg# is unlikely to handle the host's binaries. 900100ae103Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we 901100ae103Smrg# always use install-sh in `make install-strip', and initialize 902100ae103Smrg# STRIPPROG with the value of the STRIP variable (set by the user). 903100ae103SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP], 904100ae103Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 905100ae103Smrg# Installed binaries are usually stripped using `strip' when the user 906100ae103Smrg# run `make install-strip'. However `strip' might not be the right 907100ae103Smrg# tool to use in cross-compilation environments, therefore Automake 908100ae103Smrg# will honor the `STRIP' environment variable to overrule this program. 909100ae103Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'. 910100ae103Smrgif test "$cross_compiling" != no; then 911100ae103Smrg AC_CHECK_TOOL([STRIP], [strip], :) 912100ae103Smrgfi 913165cb819SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" 914100ae103SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])]) 915100ae103Smrg 916165cb819Smrg# Copyright (C) 2006, 2008 Free Software Foundation, Inc. 917165cb819Smrg# 918165cb819Smrg# This file is free software; the Free Software Foundation 919165cb819Smrg# gives unlimited permission to copy and/or distribute it, 920165cb819Smrg# with or without modifications, as long as this notice is preserved. 921165cb819Smrg 922165cb819Smrg# serial 2 923165cb819Smrg 924165cb819Smrg# _AM_SUBST_NOTMAKE(VARIABLE) 925165cb819Smrg# --------------------------- 926165cb819Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. 927165cb819Smrg# This macro is traced by Automake. 928165cb819SmrgAC_DEFUN([_AM_SUBST_NOTMAKE]) 929165cb819Smrg 930165cb819Smrg# AM_SUBST_NOTMAKE(VARIABLE) 931165cb819Smrg# --------------------------- 932165cb819Smrg# Public sister of _AM_SUBST_NOTMAKE. 933165cb819SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) 934165cb819Smrg 935100ae103Smrg# Check how to create a tarball. -*- Autoconf -*- 936100ae103Smrg 937100ae103Smrg# Copyright (C) 2004, 2005 Free Software Foundation, Inc. 938100ae103Smrg# 939100ae103Smrg# This file is free software; the Free Software Foundation 940100ae103Smrg# gives unlimited permission to copy and/or distribute it, 941100ae103Smrg# with or without modifications, as long as this notice is preserved. 942100ae103Smrg 943100ae103Smrg# serial 2 944100ae103Smrg 945100ae103Smrg# _AM_PROG_TAR(FORMAT) 946100ae103Smrg# -------------------- 947100ae103Smrg# Check how to create a tarball in format FORMAT. 948100ae103Smrg# FORMAT should be one of `v7', `ustar', or `pax'. 949100ae103Smrg# 950100ae103Smrg# Substitute a variable $(am__tar) that is a command 951100ae103Smrg# writing to stdout a FORMAT-tarball containing the directory 952100ae103Smrg# $tardir. 953100ae103Smrg# tardir=directory && $(am__tar) > result.tar 954100ae103Smrg# 955100ae103Smrg# Substitute a variable $(am__untar) that extract such 956100ae103Smrg# a tarball read from stdin. 957100ae103Smrg# $(am__untar) < result.tar 958100ae103SmrgAC_DEFUN([_AM_PROG_TAR], 959100ae103Smrg[# Always define AMTAR for backward compatibility. 960100ae103SmrgAM_MISSING_PROG([AMTAR], [tar]) 961100ae103Smrgm4_if([$1], [v7], 962100ae103Smrg [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], 963100ae103Smrg [m4_case([$1], [ustar],, [pax],, 964100ae103Smrg [m4_fatal([Unknown tar format])]) 965100ae103SmrgAC_MSG_CHECKING([how to create a $1 tar archive]) 966100ae103Smrg# Loop over all known methods to create a tar archive until one works. 967100ae103Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' 968100ae103Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools} 969100ae103Smrg# Do not fold the above two line into one, because Tru64 sh and 970100ae103Smrg# Solaris sh will not grok spaces in the rhs of `-'. 971100ae103Smrgfor _am_tool in $_am_tools 972100ae103Smrgdo 973100ae103Smrg case $_am_tool in 974100ae103Smrg gnutar) 975100ae103Smrg for _am_tar in tar gnutar gtar; 976100ae103Smrg do 977100ae103Smrg AM_RUN_LOG([$_am_tar --version]) && break 978100ae103Smrg done 979100ae103Smrg am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' 980100ae103Smrg am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' 981100ae103Smrg am__untar="$_am_tar -xf -" 982100ae103Smrg ;; 983100ae103Smrg plaintar) 984100ae103Smrg # Must skip GNU tar: if it does not support --format= it doesn't create 985100ae103Smrg # ustar tarball either. 986100ae103Smrg (tar --version) >/dev/null 2>&1 && continue 987100ae103Smrg am__tar='tar chf - "$$tardir"' 988100ae103Smrg am__tar_='tar chf - "$tardir"' 989100ae103Smrg am__untar='tar xf -' 990100ae103Smrg ;; 991100ae103Smrg pax) 992100ae103Smrg am__tar='pax -L -x $1 -w "$$tardir"' 993100ae103Smrg am__tar_='pax -L -x $1 -w "$tardir"' 994100ae103Smrg am__untar='pax -r' 995100ae103Smrg ;; 996100ae103Smrg cpio) 997100ae103Smrg am__tar='find "$$tardir" -print | cpio -o -H $1 -L' 998100ae103Smrg am__tar_='find "$tardir" -print | cpio -o -H $1 -L' 999100ae103Smrg am__untar='cpio -i -H $1 -d' 1000100ae103Smrg ;; 1001100ae103Smrg none) 1002100ae103Smrg am__tar=false 1003100ae103Smrg am__tar_=false 1004100ae103Smrg am__untar=false 1005100ae103Smrg ;; 1006100ae103Smrg esac 1007100ae103Smrg 1008100ae103Smrg # If the value was cached, stop now. We just wanted to have am__tar 1009100ae103Smrg # and am__untar set. 1010100ae103Smrg test -n "${am_cv_prog_tar_$1}" && break 1011100ae103Smrg 1012100ae103Smrg # tar/untar a dummy directory, and stop if the command works 1013100ae103Smrg rm -rf conftest.dir 1014100ae103Smrg mkdir conftest.dir 1015100ae103Smrg echo GrepMe > conftest.dir/file 1016100ae103Smrg AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) 1017100ae103Smrg rm -rf conftest.dir 1018100ae103Smrg if test -s conftest.tar; then 1019100ae103Smrg AM_RUN_LOG([$am__untar <conftest.tar]) 1020100ae103Smrg grep GrepMe conftest.dir/file >/dev/null 2>&1 && break 1021100ae103Smrg fi 1022100ae103Smrgdone 1023100ae103Smrgrm -rf conftest.dir 1024100ae103Smrg 1025100ae103SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) 1026100ae103SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])]) 1027100ae103SmrgAC_SUBST([am__tar]) 1028100ae103SmrgAC_SUBST([am__untar]) 1029100ae103Smrg]) # _AM_PROG_TAR 1030100ae103Smrg 1031165cb819Smrgdnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. 1032100ae103Smrgdnl 1033100ae103Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved. 1034100ae103Smrgdnl 1035100ae103Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a 1036165cb819Smrgdnl copy of this software and associated documentation files (the "Software"), 1037165cb819Smrgdnl to deal in the Software without restriction, including without limitation 1038165cb819Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense, 1039165cb819Smrgdnl and/or sell copies of the Software, and to permit persons to whom the 1040165cb819Smrgdnl Software is furnished to do so, subject to the following conditions: 1041100ae103Smrgdnl 1042165cb819Smrgdnl The above copyright notice and this permission notice (including the next 1043165cb819Smrgdnl paragraph) shall be included in all copies or substantial portions of the 1044165cb819Smrgdnl Software. 1045100ae103Smrgdnl 1046165cb819Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1047165cb819Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1048165cb819Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 1049165cb819Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 1050165cb819Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 1051165cb819Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 1052165cb819Smrgdnl DEALINGS IN THE SOFTWARE. 1053100ae103Smrg 1054100ae103Smrg# XORG_MACROS_VERSION(required-version) 1055100ae103Smrg# ------------------------------------- 1056100ae103Smrg# Minimum version: 1.1.0 1057100ae103Smrg# 1058100ae103Smrg# If you're using a macro added in Version 1.1 or newer, include this in 1059100ae103Smrg# your configure.ac with the minimum required version, such as: 1060100ae103Smrg# XORG_MACROS_VERSION(1.1) 1061100ae103Smrg# 1062165cb819Smrg# To ensure that this macro is defined, also add: 1063165cb819Smrg# m4_ifndef([XORG_MACROS_VERSION], 1064165cb819Smrg# [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])]) 1065100ae103Smrg# 1066100ae103Smrg# 1067100ae103Smrg# See the "minimum version" comment for each macro you use to see what 1068100ae103Smrg# version you require. 1069165cb819Smrgm4_defun([XORG_MACROS_VERSION],[ 1070165cb819Smrgm4_define([vers_have], [1.5.0]) 1071165cb819Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) 1072165cb819Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) 1073165cb819Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,, 1074165cb819Smrg [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])]) 1075165cb819Smrgm4_if(m4_version_compare(vers_have, [$1]), -1, 1076165cb819Smrg [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])]) 1077165cb819Smrgm4_undefine([vers_have]) 1078165cb819Smrgm4_undefine([maj_have]) 1079165cb819Smrgm4_undefine([maj_needed]) 1080100ae103Smrg]) # XORG_MACROS_VERSION 1081100ae103Smrg 1082100ae103Smrg# XORG_PROG_RAWCPP() 1083100ae103Smrg# ------------------ 1084100ae103Smrg# Minimum version: 1.0.0 1085100ae103Smrg# 1086100ae103Smrg# Find cpp program and necessary flags for use in pre-processing text files 1087100ae103Smrg# such as man pages and config files 1088100ae103SmrgAC_DEFUN([XORG_PROG_RAWCPP],[ 1089100ae103SmrgAC_REQUIRE([AC_PROG_CPP]) 1090100ae103SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 1091100ae103Smrg [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) 1092100ae103Smrg 1093100ae103Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined, 1094100ae103Smrg# which is not the best choice for supporting other OS'es, but covers most 1095100ae103Smrg# of the ones we need for now. 1096100ae103SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef]) 1097100ae103SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?]) 1098100ae103Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 1099100ae103Smrg AC_MSG_RESULT([no]) 1100100ae103Smrgelse 1101100ae103Smrg if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 1102100ae103Smrg RAWCPPFLAGS=-undef 1103100ae103Smrg AC_MSG_RESULT([yes]) 1104165cb819Smrg # under Cygwin unix is still defined even with -undef 1105165cb819Smrg elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 1106165cb819Smrg RAWCPPFLAGS="-undef -ansi" 1107165cb819Smrg AC_MSG_RESULT([yes, with -ansi]) 1108100ae103Smrg else 1109100ae103Smrg AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.]) 1110100ae103Smrg fi 1111100ae103Smrgfi 1112100ae103Smrgrm -f conftest.$ac_ext 1113100ae103Smrg 1114100ae103SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional]) 1115100ae103SmrgAC_LANG_CONFTEST([Does cpp preserve "whitespace"?]) 1116100ae103Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 1117100ae103Smrg AC_MSG_RESULT([no]) 1118100ae103Smrgelse 1119100ae103Smrg if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 1120100ae103Smrg RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" 1121100ae103Smrg AC_MSG_RESULT([yes]) 1122100ae103Smrg else 1123100ae103Smrg AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) 1124100ae103Smrg fi 1125100ae103Smrgfi 1126100ae103Smrgrm -f conftest.$ac_ext 1127100ae103SmrgAC_SUBST(RAWCPPFLAGS) 1128100ae103Smrg]) # XORG_PROG_RAWCPP 1129100ae103Smrg 1130100ae103Smrg# XORG_MANPAGE_SECTIONS() 1131100ae103Smrg# ----------------------- 1132100ae103Smrg# Minimum version: 1.0.0 1133100ae103Smrg# 1134100ae103Smrg# Determine which sections man pages go in for the different man page types 1135100ae103Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. 1136100ae103Smrg# Not sure if there's any better way than just hardcoding by OS name. 1137100ae103Smrg# Override default settings by setting environment variables 1138100ae103Smrg 1139100ae103SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[ 1140100ae103SmrgAC_REQUIRE([AC_CANONICAL_HOST]) 1141100ae103Smrg 1142100ae103Smrgif test x$APP_MAN_SUFFIX = x ; then 1143100ae103Smrg APP_MAN_SUFFIX=1 1144100ae103Smrgfi 1145100ae103Smrgif test x$APP_MAN_DIR = x ; then 1146100ae103Smrg APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' 1147100ae103Smrgfi 1148100ae103Smrg 1149100ae103Smrgif test x$LIB_MAN_SUFFIX = x ; then 1150100ae103Smrg LIB_MAN_SUFFIX=3 1151100ae103Smrgfi 1152100ae103Smrgif test x$LIB_MAN_DIR = x ; then 1153100ae103Smrg LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' 1154100ae103Smrgfi 1155100ae103Smrg 1156100ae103Smrgif test x$FILE_MAN_SUFFIX = x ; then 1157100ae103Smrg case $host_os in 1158100ae103Smrg solaris*) FILE_MAN_SUFFIX=4 ;; 1159100ae103Smrg *) FILE_MAN_SUFFIX=5 ;; 1160100ae103Smrg esac 1161100ae103Smrgfi 1162100ae103Smrgif test x$FILE_MAN_DIR = x ; then 1163100ae103Smrg FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' 1164100ae103Smrgfi 1165100ae103Smrg 1166100ae103Smrgif test x$MISC_MAN_SUFFIX = x ; then 1167100ae103Smrg case $host_os in 1168100ae103Smrg solaris*) MISC_MAN_SUFFIX=5 ;; 1169100ae103Smrg *) MISC_MAN_SUFFIX=7 ;; 1170100ae103Smrg esac 1171100ae103Smrgfi 1172100ae103Smrgif test x$MISC_MAN_DIR = x ; then 1173100ae103Smrg MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' 1174100ae103Smrgfi 1175100ae103Smrg 1176100ae103Smrgif test x$DRIVER_MAN_SUFFIX = x ; then 1177100ae103Smrg case $host_os in 1178100ae103Smrg solaris*) DRIVER_MAN_SUFFIX=7 ;; 1179100ae103Smrg *) DRIVER_MAN_SUFFIX=4 ;; 1180100ae103Smrg esac 1181100ae103Smrgfi 1182100ae103Smrgif test x$DRIVER_MAN_DIR = x ; then 1183100ae103Smrg DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' 1184100ae103Smrgfi 1185100ae103Smrg 1186100ae103Smrgif test x$ADMIN_MAN_SUFFIX = x ; then 1187100ae103Smrg case $host_os in 1188100ae103Smrg solaris*) ADMIN_MAN_SUFFIX=1m ;; 1189100ae103Smrg *) ADMIN_MAN_SUFFIX=8 ;; 1190100ae103Smrg esac 1191100ae103Smrgfi 1192100ae103Smrgif test x$ADMIN_MAN_DIR = x ; then 1193100ae103Smrg ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' 1194100ae103Smrgfi 1195100ae103Smrg 1196100ae103Smrg 1197100ae103SmrgAC_SUBST([APP_MAN_SUFFIX]) 1198100ae103SmrgAC_SUBST([LIB_MAN_SUFFIX]) 1199100ae103SmrgAC_SUBST([FILE_MAN_SUFFIX]) 1200100ae103SmrgAC_SUBST([MISC_MAN_SUFFIX]) 1201100ae103SmrgAC_SUBST([DRIVER_MAN_SUFFIX]) 1202100ae103SmrgAC_SUBST([ADMIN_MAN_SUFFIX]) 1203100ae103SmrgAC_SUBST([APP_MAN_DIR]) 1204100ae103SmrgAC_SUBST([LIB_MAN_DIR]) 1205100ae103SmrgAC_SUBST([FILE_MAN_DIR]) 1206100ae103SmrgAC_SUBST([MISC_MAN_DIR]) 1207100ae103SmrgAC_SUBST([DRIVER_MAN_DIR]) 1208100ae103SmrgAC_SUBST([ADMIN_MAN_DIR]) 1209100ae103Smrg]) # XORG_MANPAGE_SECTIONS 1210100ae103Smrg 1211100ae103Smrg# XORG_CHECK_LINUXDOC 1212100ae103Smrg# ------------------- 1213100ae103Smrg# Minimum version: 1.0.0 1214100ae103Smrg# 1215100ae103Smrg# Defines the variable MAKE_TEXT if the necessary tools and 1216100ae103Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. 1217100ae103Smrg# Whether or not the necessary tools and files are found can be checked 1218100ae103Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC" 1219100ae103SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[ 1220165cb819Smrgif test x$XORG_SGML_PATH = x ; then 1221165cb819Smrg XORG_SGML_PATH=$prefix/share/sgml 1222165cb819Smrgfi 1223100ae103SmrgHAVE_DEFS_ENT= 1224100ae103Smrg 1225165cb819Smrgif test x"$cross_compiling" = x"yes" ; then 1226165cb819Smrg HAVE_DEFS_ENT=no 1227165cb819Smrgelse 1228165cb819Smrg AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes]) 1229165cb819Smrgfi 1230100ae103Smrg 1231100ae103SmrgAC_PATH_PROG(LINUXDOC, linuxdoc) 1232100ae103SmrgAC_PATH_PROG(PS2PDF, ps2pdf) 1233100ae103Smrg 1234100ae103SmrgAC_MSG_CHECKING([Whether to build documentation]) 1235100ae103Smrg 1236100ae103Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then 1237100ae103Smrg BUILDDOC=yes 1238100ae103Smrgelse 1239100ae103Smrg BUILDDOC=no 1240100ae103Smrgfi 1241100ae103Smrg 1242100ae103SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) 1243100ae103Smrg 1244100ae103SmrgAC_MSG_RESULT([$BUILDDOC]) 1245100ae103Smrg 1246100ae103SmrgAC_MSG_CHECKING([Whether to build pdf documentation]) 1247100ae103Smrg 1248100ae103Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then 1249100ae103Smrg BUILDPDFDOC=yes 1250100ae103Smrgelse 1251100ae103Smrg BUILDPDFDOC=no 1252100ae103Smrgfi 1253100ae103Smrg 1254100ae103SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 1255100ae103Smrg 1256100ae103SmrgAC_MSG_RESULT([$BUILDPDFDOC]) 1257100ae103Smrg 1258100ae103SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt" 1259100ae103SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps" 1260100ae103SmrgMAKE_PDF="$PS2PDF" 1261100ae103SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0" 1262100ae103Smrg 1263100ae103SmrgAC_SUBST(MAKE_TEXT) 1264100ae103SmrgAC_SUBST(MAKE_PS) 1265100ae103SmrgAC_SUBST(MAKE_PDF) 1266100ae103SmrgAC_SUBST(MAKE_HTML) 1267100ae103Smrg]) # XORG_CHECK_LINUXDOC 1268100ae103Smrg 1269100ae103Smrg# XORG_CHECK_DOCBOOK 1270100ae103Smrg# ------------------- 1271100ae103Smrg# Minimum version: 1.0.0 1272100ae103Smrg# 1273100ae103Smrg# Checks for the ability to build output formats from SGML DocBook source. 1274100ae103Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC" 1275100ae103Smrg# indicates whether the necessary tools and files are found and, if set, 1276100ae103Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx. 1277100ae103SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[ 1278165cb819Smrgif test x$XORG_SGML_PATH = x ; then 1279165cb819Smrg XORG_SGML_PATH=$prefix/share/sgml 1280165cb819Smrgfi 1281100ae103SmrgHAVE_DEFS_ENT= 1282100ae103SmrgBUILDTXTDOC=no 1283100ae103SmrgBUILDPDFDOC=no 1284100ae103SmrgBUILDPSDOC=no 1285100ae103SmrgBUILDHTMLDOC=no 1286100ae103Smrg 1287100ae103SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes]) 1288100ae103Smrg 1289100ae103SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps) 1290100ae103SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf) 1291100ae103SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html) 1292100ae103SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt) 1293100ae103Smrg 1294100ae103SmrgAC_MSG_CHECKING([Whether to build text documentation]) 1295100ae103Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x && 1296100ae103Smrg test x$BUILD_TXTDOC != xno; then 1297100ae103Smrg BUILDTXTDOC=yes 1298100ae103Smrgfi 1299100ae103SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes]) 1300100ae103SmrgAC_MSG_RESULT([$BUILDTXTDOC]) 1301100ae103Smrg 1302100ae103SmrgAC_MSG_CHECKING([Whether to build PDF documentation]) 1303100ae103Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x && 1304100ae103Smrg test x$BUILD_PDFDOC != xno; then 1305100ae103Smrg BUILDPDFDOC=yes 1306100ae103Smrgfi 1307100ae103SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 1308100ae103SmrgAC_MSG_RESULT([$BUILDPDFDOC]) 1309100ae103Smrg 1310100ae103SmrgAC_MSG_CHECKING([Whether to build PostScript documentation]) 1311100ae103Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x && 1312100ae103Smrg test x$BUILD_PSDOC != xno; then 1313100ae103Smrg BUILDPSDOC=yes 1314100ae103Smrgfi 1315100ae103SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes]) 1316100ae103SmrgAC_MSG_RESULT([$BUILDPSDOC]) 1317100ae103Smrg 1318100ae103SmrgAC_MSG_CHECKING([Whether to build HTML documentation]) 1319100ae103Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x && 1320100ae103Smrg test x$BUILD_HTMLDOC != xno; then 1321100ae103Smrg BUILDHTMLDOC=yes 1322100ae103Smrgfi 1323100ae103SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes]) 1324100ae103SmrgAC_MSG_RESULT([$BUILDHTMLDOC]) 1325100ae103Smrg 1326100ae103SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT" 1327100ae103SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS" 1328100ae103SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF" 1329100ae103SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML" 1330100ae103Smrg 1331100ae103SmrgAC_SUBST(MAKE_TEXT) 1332100ae103SmrgAC_SUBST(MAKE_PS) 1333100ae103SmrgAC_SUBST(MAKE_PDF) 1334100ae103SmrgAC_SUBST(MAKE_HTML) 1335100ae103Smrg]) # XORG_CHECK_DOCBOOK 1336100ae103Smrg 1337165cb819Smrg# XORG_WITH_XMLTO 1338165cb819Smrg# ---------------- 1339165cb819Smrg# Minimum version: 1.5.0 1340165cb819Smrg# 1341165cb819Smrg# Documentation tools are not always available on all platforms and sometimes 1342165cb819Smrg# not at the appropriate level. This macro enables a module to test for the 1343165cb819Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 1344165cb819Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions 1345165cb819Smrg# as whether or not to use the xmlto package. 1346165cb819Smrg# 1347165cb819Smrg# Interface to module: 1348165cb819Smrg# HAVE_XMLTO: used in makefiles to conditionally generate documentation 1349165cb819Smrg# XMLTO: returns the path of the xmlto program found 1350165cb819Smrg# returns the path set by the user in the environment 1351165cb819Smrg# --with-xmlto: 'yes' user instructs the module to use xmlto 1352165cb819Smrg# 'no' user instructs the module not to use xmlto 1353165cb819Smrg# 1354165cb819Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path. 1355165cb819Smrg# 1356165cb819SmrgAC_DEFUN([XORG_WITH_XMLTO],[ 1357165cb819SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command]) 1358165cb819SmrgAC_ARG_WITH(xmlto, 1359165cb819Smrg AS_HELP_STRING([--with-xmlto], 1360165cb819Smrg [Use xmlto to regenerate documentation (default: yes, if installed)]), 1361165cb819Smrg [use_xmlto=$withval], [use_xmlto=auto]) 1362165cb819Smrg 1363165cb819Smrgif test "x$use_xmlto" = x"auto"; then 1364165cb819Smrg AC_PATH_PROG([XMLTO], [xmlto]) 1365165cb819Smrg if test "x$XMLTO" = "x"; then 1366165cb819Smrg AC_MSG_WARN([xmlto not found - documentation targets will be skipped]) 1367165cb819Smrg have_xmlto=no 1368165cb819Smrg else 1369165cb819Smrg have_xmlto=yes 1370165cb819Smrg fi 1371165cb819Smrgelif test "x$use_xmlto" = x"yes" ; then 1372165cb819Smrg AC_PATH_PROG([XMLTO], [xmlto]) 1373165cb819Smrg if test "x$XMLTO" = "x"; then 1374165cb819Smrg AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH]) 1375165cb819Smrg fi 1376165cb819Smrg have_xmlto=yes 1377165cb819Smrgelif test "x$use_xmlto" = x"no" ; then 1378165cb819Smrg if test "x$XMLTO" != "x"; then 1379165cb819Smrg AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified]) 1380165cb819Smrg fi 1381165cb819Smrg have_xmlto=no 1382165cb819Smrgelse 1383165cb819Smrg AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no']) 1384165cb819Smrgfi 1385165cb819SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes]) 1386165cb819Smrg]) # XORG_CHECK_XMLTO 1387165cb819Smrg 1388165cb819Smrg# XORG_WITH_ASCIIDOC 1389165cb819Smrg# ---------------- 1390165cb819Smrg# Minimum version: 1.5.0 1391165cb819Smrg# 1392165cb819Smrg# Documentation tools are not always available on all platforms and sometimes 1393165cb819Smrg# not at the appropriate level. This macro enables a module to test for the 1394165cb819Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 1395165cb819Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions 1396165cb819Smrg# as whether or not to use the asciidoc package. 1397165cb819Smrg# 1398165cb819Smrg# Interface to module: 1399165cb819Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation 1400165cb819Smrg# ASCIIDOC: returns the path of the asciidoc program found 1401165cb819Smrg# returns the path set by the user in the environment 1402165cb819Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc 1403165cb819Smrg# 'no' user instructs the module not to use asciidoc 1404165cb819Smrg# 1405165cb819Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path. 1406165cb819Smrg# 1407165cb819SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[ 1408165cb819SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command]) 1409165cb819SmrgAC_ARG_WITH(asciidoc, 1410165cb819Smrg AS_HELP_STRING([--with-asciidoc], 1411165cb819Smrg [Use asciidoc to regenerate documentation (default: yes, if installed)]), 1412165cb819Smrg [use_asciidoc=$withval], [use_asciidoc=auto]) 1413165cb819Smrg 1414165cb819Smrgif test "x$use_asciidoc" = x"auto"; then 1415165cb819Smrg AC_PATH_PROG([ASCIIDOC], [asciidoc]) 1416165cb819Smrg if test "x$ASCIIDOC" = "x"; then 1417165cb819Smrg AC_MSG_WARN([asciidoc not found - documentation targets will be skipped]) 1418165cb819Smrg have_asciidoc=no 1419165cb819Smrg else 1420165cb819Smrg have_asciidoc=yes 1421165cb819Smrg fi 1422165cb819Smrgelif test "x$use_asciidoc" = x"yes" ; then 1423165cb819Smrg AC_PATH_PROG([ASCIIDOC], [asciidoc]) 1424165cb819Smrg if test "x$ASCIIDOC" = "x"; then 1425165cb819Smrg AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH]) 1426165cb819Smrg fi 1427165cb819Smrg have_asciidoc=yes 1428165cb819Smrgelif test "x$use_asciidoc" = x"no" ; then 1429165cb819Smrg if test "x$ASCIIDOC" != "x"; then 1430165cb819Smrg AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified]) 1431165cb819Smrg fi 1432165cb819Smrg have_asciidoc=no 1433165cb819Smrgelse 1434165cb819Smrg AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no']) 1435165cb819Smrgfi 1436165cb819SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes]) 1437165cb819Smrg]) # XORG_CHECK_ASCIIDOC 1438165cb819Smrg 1439165cb819Smrg# XORG_WITH_DOXYGEN 1440165cb819Smrg# ---------------- 1441165cb819Smrg# Minimum version: 1.5.0 1442165cb819Smrg# 1443165cb819Smrg# Documentation tools are not always available on all platforms and sometimes 1444165cb819Smrg# not at the appropriate level. This macro enables a module to test for the 1445165cb819Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 1446165cb819Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions 1447165cb819Smrg# as whether or not to use the doxygen package. 1448165cb819Smrg# 1449165cb819Smrg# Interface to module: 1450165cb819Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation 1451165cb819Smrg# DOXYGEN: returns the path of the doxygen program found 1452165cb819Smrg# returns the path set by the user in the environment 1453165cb819Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen 1454165cb819Smrg# 'no' user instructs the module not to use doxygen 1455165cb819Smrg# 1456165cb819Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path. 1457165cb819Smrg# 1458165cb819SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[ 1459165cb819SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command]) 1460165cb819SmrgAC_ARG_WITH(doxygen, 1461165cb819Smrg AS_HELP_STRING([--with-doxygen], 1462165cb819Smrg [Use doxygen to regenerate documentation (default: yes, if installed)]), 1463165cb819Smrg [use_doxygen=$withval], [use_doxygen=auto]) 1464165cb819Smrg 1465165cb819Smrgif test "x$use_doxygen" = x"auto"; then 1466165cb819Smrg AC_PATH_PROG([DOXYGEN], [doxygen]) 1467165cb819Smrg if test "x$DOXYGEN" = "x"; then 1468165cb819Smrg AC_MSG_WARN([doxygen not found - documentation targets will be skipped]) 1469165cb819Smrg have_doxygen=no 1470165cb819Smrg else 1471165cb819Smrg have_doxygen=yes 1472165cb819Smrg fi 1473165cb819Smrgelif test "x$use_doxygen" = x"yes" ; then 1474165cb819Smrg AC_PATH_PROG([DOXYGEN], [doxygen]) 1475165cb819Smrg if test "x$DOXYGEN" = "x"; then 1476165cb819Smrg AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH]) 1477165cb819Smrg fi 1478165cb819Smrg have_doxygen=yes 1479165cb819Smrgelif test "x$use_doxygen" = x"no" ; then 1480165cb819Smrg if test "x$DOXYGEN" != "x"; then 1481165cb819Smrg AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified]) 1482165cb819Smrg fi 1483165cb819Smrg have_doxygen=no 1484165cb819Smrgelse 1485165cb819Smrg AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no']) 1486165cb819Smrgfi 1487165cb819SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes]) 1488165cb819Smrg]) # XORG_CHECK_DOXYGEN 1489165cb819Smrg 1490100ae103Smrg# XORG_CHECK_MALLOC_ZERO 1491100ae103Smrg# ---------------------- 1492100ae103Smrg# Minimum version: 1.0.0 1493100ae103Smrg# 1494100ae103Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if 1495100ae103Smrg# malloc(0) returns NULL. Packages should add one of these cflags to 1496100ae103Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. 1497100ae103SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[ 1498100ae103SmrgAC_ARG_ENABLE(malloc0returnsnull, 1499165cb819Smrg AS_HELP_STRING([--enable-malloc0returnsnull], 1500100ae103Smrg [malloc(0) returns NULL (default: auto)]), 1501100ae103Smrg [MALLOC_ZERO_RETURNS_NULL=$enableval], 1502100ae103Smrg [MALLOC_ZERO_RETURNS_NULL=auto]) 1503100ae103Smrg 1504100ae103SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL]) 1505100ae103Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then 1506100ae103Smrg AC_RUN_IFELSE([ 1507100ae103Smrgchar *malloc(); 1508100ae103Smrgchar *realloc(); 1509100ae103Smrgchar *calloc(); 1510100ae103Smrgmain() { 1511100ae103Smrg char *m0, *r0, *c0, *p; 1512100ae103Smrg m0 = malloc(0); 1513100ae103Smrg p = malloc(10); 1514100ae103Smrg r0 = realloc(p,0); 1515100ae103Smrg c0 = calloc(0); 1516100ae103Smrg exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1); 1517100ae103Smrg}], 1518100ae103Smrg [MALLOC_ZERO_RETURNS_NULL=yes], 1519165cb819Smrg [MALLOC_ZERO_RETURNS_NULL=no], 1520165cb819Smrg [MALLOC_ZERO_RETURNS_NULL=yes]) 1521100ae103Smrgfi 1522100ae103SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) 1523100ae103Smrg 1524100ae103Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then 1525100ae103Smrg MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" 1526100ae103Smrg XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS 1527100ae103Smrg XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" 1528100ae103Smrgelse 1529100ae103Smrg MALLOC_ZERO_CFLAGS="" 1530100ae103Smrg XMALLOC_ZERO_CFLAGS="" 1531100ae103Smrg XTMALLOC_ZERO_CFLAGS="" 1532100ae103Smrgfi 1533100ae103Smrg 1534100ae103SmrgAC_SUBST([MALLOC_ZERO_CFLAGS]) 1535100ae103SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS]) 1536100ae103SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS]) 1537100ae103Smrg]) # XORG_CHECK_MALLOC_ZERO 1538100ae103Smrg 1539100ae103Smrg# XORG_WITH_LINT() 1540100ae103Smrg# ---------------- 1541100ae103Smrg# Minimum version: 1.1.0 1542100ae103Smrg# 1543100ae103Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint 1544100ae103Smrg# is specified. (Use --with-lint=sparse for sparse.) 1545100ae103Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint) 1546100ae103Smrg# Sets $LINT_FLAGS to flags to pass to source checker 1547100ae103Smrg# Sets LINT automake conditional if enabled (default: disabled) 1548100ae103Smrg# 1549100ae103SmrgAC_DEFUN([XORG_WITH_LINT],[ 1550100ae103Smrg 1551100ae103Smrg# Allow checking code with lint, sparse, etc. 1552165cb819SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint], 1553100ae103Smrg [Use a lint-style source code checker (default: disabled)])], 1554100ae103Smrg [use_lint=$withval], [use_lint=no]) 1555100ae103Smrgif test "x$use_lint" = "xyes" ; then 1556100ae103Smrg LINT="lint" 1557100ae103Smrgelse 1558100ae103Smrg LINT="$use_lint" 1559100ae103Smrgfi 1560100ae103Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then 1561100ae103Smrg case $LINT in 1562100ae103Smrg lint|*/lint) 1563100ae103Smrg case $host_os in 1564100ae103Smrg solaris*) 1565100ae103Smrg LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2" 1566100ae103Smrg ;; 1567100ae103Smrg esac 1568100ae103Smrg ;; 1569100ae103Smrg esac 1570100ae103Smrgfi 1571100ae103Smrg 1572100ae103SmrgAC_SUBST(LINT) 1573100ae103SmrgAC_SUBST(LINT_FLAGS) 1574100ae103SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno]) 1575100ae103Smrg 1576100ae103Smrg]) # XORG_WITH_LINT 1577100ae103Smrg 1578100ae103Smrg# XORG_LINT_LIBRARY(LIBNAME) 1579100ae103Smrg# -------------------------- 1580100ae103Smrg# Minimum version: 1.1.0 1581100ae103Smrg# 1582100ae103Smrg# Sets up flags for building lint libraries for checking programs that call 1583100ae103Smrg# functions in the library. 1584100ae103Smrg# Disabled by default, enable with --enable-lint-library 1585100ae103Smrg# Sets: 1586100ae103Smrg# @LINTLIB@ - name of lint library file to make 1587100ae103Smrg# MAKE_LINT_LIB - automake conditional 1588100ae103Smrg# 1589100ae103Smrg 1590100ae103SmrgAC_DEFUN([XORG_LINT_LIBRARY],[ 1591100ae103SmrgAC_REQUIRE([XORG_WITH_LINT]) 1592100ae103Smrg# Build lint "library" for more indepth checks of programs calling this library 1593165cb819SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library], 1594100ae103Smrg [Create lint library (default: disabled)])], 1595100ae103Smrg [make_lint_lib=$enableval], [make_lint_lib=no]) 1596100ae103Smrgif test "x$make_lint_lib" != "xno" ; then 1597100ae103Smrg if test "x$LINT" = "xno" ; then 1598100ae103Smrg AC_MSG_ERROR([Cannot make lint library without --with-lint]) 1599100ae103Smrg fi 1600100ae103Smrg if test "x$make_lint_lib" = "xyes" ; then 1601100ae103Smrg LINTLIB=llib-l$1.ln 1602100ae103Smrg else 1603100ae103Smrg LINTLIB=$make_lint_lib 1604100ae103Smrg fi 1605100ae103Smrgfi 1606100ae103SmrgAC_SUBST(LINTLIB) 1607100ae103SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno]) 1608100ae103Smrg 1609100ae103Smrg]) # XORG_LINT_LIBRARY 1610100ae103Smrg 1611165cb819Smrg# XORG_CWARNFLAGS 1612165cb819Smrg# --------------- 1613165cb819Smrg# Minimum version: 1.2.0 1614165cb819Smrg# 1615165cb819Smrg# Defines CWARNFLAGS to enable C compiler warnings. 1616165cb819Smrg# 1617165cb819SmrgAC_DEFUN([XORG_CWARNFLAGS], [ 1618165cb819SmrgAC_REQUIRE([AC_PROG_CC]) 1619165cb819Smrgif test "x$GCC" = xyes ; then 1620165cb819Smrg CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \ 1621165cb819Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \ 1622165cb819Smrg-Wbad-function-cast" 1623165cb819Smrg case `$CC -dumpversion` in 1624165cb819Smrg 3.4.* | 4.*) 1625165cb819Smrg CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement" 1626165cb819Smrg ;; 1627165cb819Smrg esac 1628165cb819Smrgelse 1629165cb819Smrg AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) 1630165cb819Smrg if test "x$SUNCC" = "xyes"; then 1631165cb819Smrg CWARNFLAGS="-v" 1632165cb819Smrg fi 1633165cb819Smrgfi 1634165cb819SmrgAC_SUBST(CWARNFLAGS) 1635165cb819Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) 1636165cb819Smrg]) # XORG_CWARNFLAGS 1637165cb819Smrg 1638165cb819Smrg# XORG_STRICT_OPTION 1639165cb819Smrg# ----------------------- 1640165cb819Smrg# Minimum version: 1.3.0 1641165cb819Smrg# 1642165cb819Smrg# Add configure option to enable strict compilation 1643165cb819SmrgAC_DEFUN([XORG_STRICT_OPTION], [ 1644165cb819SmrgAC_REQUIRE([AC_PROG_CC]) 1645165cb819SmrgAC_REQUIRE([AC_PROG_CC_C99]) 1646165cb819SmrgAC_REQUIRE([XORG_CWARNFLAGS]) 1647165cb819Smrg 1648165cb819SmrgAC_ARG_ENABLE(strict-compilation, 1649165cb819Smrg AS_HELP_STRING([--enable-strict-compilation], 1650165cb819Smrg [Enable all warnings from compiler and make them errors (default: disabled)]), 1651165cb819Smrg [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no]) 1652165cb819Smrgif test "x$STRICT_COMPILE" = "xyes"; then 1653165cb819Smrg AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) 1654165cb819Smrg AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"]) 1655165cb819Smrg if test "x$GCC" = xyes ; then 1656165cb819Smrg STRICT_CFLAGS="-pedantic -Werror" 1657165cb819Smrg elif test "x$SUNCC" = "xyes"; then 1658165cb819Smrg STRICT_CFLAGS="-errwarn" 1659165cb819Smrg elif test "x$INTELCC" = "xyes"; then 1660165cb819Smrg STRICT_CFLAGS="-Werror" 1661165cb819Smrg fi 1662165cb819Smrgfi 1663165cb819SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS" 1664165cb819SmrgAC_SUBST([CWARNFLAGS]) 1665165cb819Smrg]) # XORG_STRICT_OPTION 1666165cb819Smrg 1667165cb819Smrg# XORG_DEFAULT_OPTIONS 1668165cb819Smrg# -------------------- 1669165cb819Smrg# Minimum version: 1.3.0 1670165cb819Smrg# 1671165cb819Smrg# Defines default options for X.Org modules. 1672165cb819Smrg# 1673165cb819SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [ 1674165cb819SmrgXORG_CWARNFLAGS 1675165cb819SmrgXORG_STRICT_OPTION 1676165cb819SmrgXORG_RELEASE_VERSION 1677165cb819SmrgXORG_CHANGELOG 1678165cb819SmrgXORG_INSTALL 1679165cb819SmrgXORG_MANPAGE_SECTIONS 1680165cb819Smrg]) # XORG_DEFAULT_OPTIONS 1681165cb819Smrg 1682165cb819Smrg# XORG_INSTALL() 1683165cb819Smrg# ---------------- 1684165cb819Smrg# Minimum version: 1.4.0 1685165cb819Smrg# 1686165cb819Smrg# Defines the variable INSTALL_CMD as the command to copy 1687165cb819Smrg# INSTALL from $prefix/share/util-macros. 1688165cb819Smrg# 1689165cb819SmrgAC_DEFUN([XORG_INSTALL], [ 1690165cb819SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG]) 1691165cb819Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` 1692165cb819SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ 1693165cb819Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ 1694165cb819Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \ 1695165cb819Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)" 1696165cb819SmrgAC_SUBST([INSTALL_CMD]) 1697165cb819Smrg]) # XORG_INSTALL 1698100ae103Smrgdnl Copyright 2005 Red Hat, Inc 1699100ae103Smrgdnl 1700100ae103Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its 1701100ae103Smrgdnl documentation for any purpose is hereby granted without fee, provided that 1702100ae103Smrgdnl the above copyright notice appear in all copies and that both that 1703100ae103Smrgdnl copyright notice and this permission notice appear in supporting 1704100ae103Smrgdnl documentation. 1705100ae103Smrgdnl 1706100ae103Smrgdnl The above copyright notice and this permission notice shall be included 1707100ae103Smrgdnl in all copies or substantial portions of the Software. 1708100ae103Smrgdnl 1709100ae103Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 1710100ae103Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 1711100ae103Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 1712100ae103Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 1713100ae103Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 1714100ae103Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 1715100ae103Smrgdnl OTHER DEALINGS IN THE SOFTWARE. 1716100ae103Smrgdnl 1717100ae103Smrgdnl Except as contained in this notice, the name of the copyright holders shall 1718100ae103Smrgdnl not be used in advertising or otherwise to promote the sale, use or 1719100ae103Smrgdnl other dealings in this Software without prior written authorization 1720100ae103Smrgdnl from the copyright holders. 1721100ae103Smrgdnl 1722100ae103Smrg 1723100ae103Smrg# XORG_RELEASE_VERSION 1724100ae103Smrg# -------------------- 1725100ae103Smrg# Adds --with/without-release-string and changes the PACKAGE and 1726100ae103Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION". If 1727100ae103Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged. Also 1728100ae103Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use. 1729100ae103Smrg 1730100ae103SmrgAC_DEFUN([XORG_RELEASE_VERSION],[ 1731100ae103Smrg AC_ARG_WITH(release-version, 1732165cb819Smrg AS_HELP_STRING([--with-release-version=STRING], 1733100ae103Smrg [Use release version string in package name]), 1734100ae103Smrg [RELEASE_VERSION="$withval"], 1735100ae103Smrg [RELEASE_VERSION=""]) 1736100ae103Smrg if test "x$RELEASE_VERSION" != "x"; then 1737100ae103Smrg PACKAGE="$PACKAGE-$RELEASE_VERSION" 1738100ae103Smrg PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION" 1739100ae103Smrg AC_MSG_NOTICE([Building with package name set to $PACKAGE]) 1740100ae103Smrg fi 1741100ae103Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR], 1742100ae103Smrg [`echo $PACKAGE_VERSION | cut -d . -f 1`], 1743100ae103Smrg [Major version of this package]) 1744165cb819Smrg PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` 1745100ae103Smrg if test "x$PVM" = "x"; then 1746100ae103Smrg PVM="0" 1747100ae103Smrg fi 1748100ae103Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR], 1749100ae103Smrg [$PVM], 1750100ae103Smrg [Minor version of this package]) 1751165cb819Smrg PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` 1752100ae103Smrg if test "x$PVP" = "x"; then 1753100ae103Smrg PVP="0" 1754100ae103Smrg fi 1755100ae103Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL], 1756100ae103Smrg [$PVP], 1757100ae103Smrg [Patch version of this package]) 1758100ae103Smrg]) 1759100ae103Smrg 1760165cb819Smrg# XORG_CHANGELOG() 1761165cb819Smrg# ---------------- 1762165cb819Smrg# Minimum version: 1.2.0 1763165cb819Smrg# 1764165cb819Smrg# Defines the variable CHANGELOG_CMD as the command to generate 1765165cb819Smrg# ChangeLog from git. 1766165cb819Smrg# 1767165cb819Smrg# 1768165cb819SmrgAC_DEFUN([XORG_CHANGELOG], [ 1769165cb819SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \ 1770165cb819Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ 1771165cb819Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \ 1772165cb819Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)" 1773165cb819SmrgAC_SUBST([CHANGELOG_CMD]) 1774165cb819Smrg]) # XORG_CHANGELOG 1775165cb819Smrg 1776165cb819Smrg# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- 1777165cb819Smrg# 1778165cb819Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>. 1779165cb819Smrg# 1780165cb819Smrg# This program is free software; you can redistribute it and/or modify 1781165cb819Smrg# it under the terms of the GNU General Public License as published by 1782165cb819Smrg# the Free Software Foundation; either version 2 of the License, or 1783165cb819Smrg# (at your option) any later version. 1784165cb819Smrg# 1785165cb819Smrg# This program is distributed in the hope that it will be useful, but 1786165cb819Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of 1787165cb819Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1788165cb819Smrg# General Public License for more details. 1789165cb819Smrg# 1790165cb819Smrg# You should have received a copy of the GNU General Public License 1791165cb819Smrg# along with this program; if not, write to the Free Software 1792165cb819Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 1793165cb819Smrg# 1794165cb819Smrg# As a special exception to the GNU General Public License, if you 1795165cb819Smrg# distribute this file as part of a program that contains a 1796165cb819Smrg# configuration script generated by Autoconf, you may include it under 1797165cb819Smrg# the same distribution terms that you use for the rest of that program. 1798165cb819Smrg 1799165cb819Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION]) 1800165cb819Smrg# ---------------------------------- 1801165cb819SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG], 1802165cb819Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) 1803165cb819Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$]) 1804165cb819SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl 1805165cb819Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then 1806165cb819Smrg AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) 1807165cb819Smrgfi 1808165cb819Smrgif test -n "$PKG_CONFIG"; then 1809165cb819Smrg _pkg_min_version=m4_default([$1], [0.9.0]) 1810165cb819Smrg AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) 1811165cb819Smrg if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then 1812165cb819Smrg AC_MSG_RESULT([yes]) 1813165cb819Smrg else 1814165cb819Smrg AC_MSG_RESULT([no]) 1815165cb819Smrg PKG_CONFIG="" 1816165cb819Smrg fi 1817165cb819Smrg 1818165cb819Smrgfi[]dnl 1819165cb819Smrg])# PKG_PROG_PKG_CONFIG 1820165cb819Smrg 1821165cb819Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 1822165cb819Smrg# 1823165cb819Smrg# Check to see whether a particular set of modules exists. Similar 1824165cb819Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors. 1825165cb819Smrg# 1826165cb819Smrg# 1827165cb819Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of 1828165cb819Smrg# this or PKG_CHECK_MODULES is called, or make sure to call 1829165cb819Smrg# PKG_CHECK_EXISTS manually 1830165cb819Smrg# -------------------------------------------------------------- 1831165cb819SmrgAC_DEFUN([PKG_CHECK_EXISTS], 1832165cb819Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 1833165cb819Smrgif test -n "$PKG_CONFIG" && \ 1834165cb819Smrg AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then 1835165cb819Smrg m4_ifval([$2], [$2], [:]) 1836165cb819Smrgm4_ifvaln([$3], [else 1837165cb819Smrg $3])dnl 1838165cb819Smrgfi]) 1839165cb819Smrg 1840165cb819Smrg 1841165cb819Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) 1842165cb819Smrg# --------------------------------------------- 1843165cb819Smrgm4_define([_PKG_CONFIG], 1844165cb819Smrg[if test -n "$$1"; then 1845165cb819Smrg pkg_cv_[]$1="$$1" 1846165cb819Smrg elif test -n "$PKG_CONFIG"; then 1847165cb819Smrg PKG_CHECK_EXISTS([$3], 1848165cb819Smrg [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], 1849165cb819Smrg [pkg_failed=yes]) 1850165cb819Smrg else 1851165cb819Smrg pkg_failed=untried 1852165cb819Smrgfi[]dnl 1853165cb819Smrg])# _PKG_CONFIG 1854165cb819Smrg 1855165cb819Smrg# _PKG_SHORT_ERRORS_SUPPORTED 1856165cb819Smrg# ----------------------------- 1857165cb819SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], 1858165cb819Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 1859165cb819Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then 1860165cb819Smrg _pkg_short_errors_supported=yes 1861165cb819Smrgelse 1862165cb819Smrg _pkg_short_errors_supported=no 1863165cb819Smrgfi[]dnl 1864165cb819Smrg])# _PKG_SHORT_ERRORS_SUPPORTED 1865165cb819Smrg 1866165cb819Smrg 1867165cb819Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], 1868165cb819Smrg# [ACTION-IF-NOT-FOUND]) 1869165cb819Smrg# 1870165cb819Smrg# 1871165cb819Smrg# Note that if there is a possibility the first call to 1872165cb819Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an 1873165cb819Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac 1874165cb819Smrg# 1875165cb819Smrg# 1876165cb819Smrg# -------------------------------------------------------------- 1877165cb819SmrgAC_DEFUN([PKG_CHECK_MODULES], 1878165cb819Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 1879165cb819SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl 1880165cb819SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl 1881165cb819Smrg 1882165cb819Smrgpkg_failed=no 1883165cb819SmrgAC_MSG_CHECKING([for $1]) 1884165cb819Smrg 1885165cb819Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) 1886165cb819Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2]) 1887165cb819Smrg 1888165cb819Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS 1889165cb819Smrgand $1[]_LIBS to avoid the need to call pkg-config. 1890165cb819SmrgSee the pkg-config man page for more details.]) 1891165cb819Smrg 1892165cb819Smrgif test $pkg_failed = yes; then 1893165cb819Smrg _PKG_SHORT_ERRORS_SUPPORTED 1894165cb819Smrg if test $_pkg_short_errors_supported = yes; then 1895165cb819Smrg $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` 1896165cb819Smrg else 1897165cb819Smrg $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` 1898165cb819Smrg fi 1899165cb819Smrg # Put the nasty error message in config.log where it belongs 1900165cb819Smrg echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD 1901165cb819Smrg 1902165cb819Smrg ifelse([$4], , [AC_MSG_ERROR(dnl 1903165cb819Smrg[Package requirements ($2) were not met: 1904165cb819Smrg 1905165cb819Smrg$$1_PKG_ERRORS 1906165cb819Smrg 1907165cb819SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you 1908165cb819Smrginstalled software in a non-standard prefix. 1909165cb819Smrg 1910165cb819Smrg_PKG_TEXT 1911165cb819Smrg])], 1912165cb819Smrg [AC_MSG_RESULT([no]) 1913165cb819Smrg $4]) 1914165cb819Smrgelif test $pkg_failed = untried; then 1915165cb819Smrg ifelse([$4], , [AC_MSG_FAILURE(dnl 1916165cb819Smrg[The pkg-config script could not be found or is too old. Make sure it 1917165cb819Smrgis in your PATH or set the PKG_CONFIG environment variable to the full 1918165cb819Smrgpath to pkg-config. 1919165cb819Smrg 1920165cb819Smrg_PKG_TEXT 1921165cb819Smrg 1922165cb819SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])], 1923165cb819Smrg [$4]) 1924165cb819Smrgelse 1925165cb819Smrg $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS 1926165cb819Smrg $1[]_LIBS=$pkg_cv_[]$1[]_LIBS 1927165cb819Smrg AC_MSG_RESULT([yes]) 1928165cb819Smrg ifelse([$3], , :, [$3]) 1929165cb819Smrgfi[]dnl 1930165cb819Smrg])# PKG_CHECK_MODULES 1931165cb819Smrg 1932