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