aclocal.m4 revision 7e4fd55a
17e4fd55aSmrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*- 2b8f75c19Smrg 37e4fd55aSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 47e4fd55aSmrg# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. 5b8f75c19Smrg# This file is free software; the Free Software Foundation 6b8f75c19Smrg# gives unlimited permission to copy and/or distribute it, 7b8f75c19Smrg# with or without modifications, as long as this notice is preserved. 8b8f75c19Smrg 9b8f75c19Smrg# This program is distributed in the hope that it will be useful, 10b8f75c19Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without 11b8f75c19Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A 12b8f75c19Smrg# PARTICULAR PURPOSE. 13b8f75c19Smrg 147e4fd55aSmrgm4_ifndef([AC_AUTOCONF_VERSION], 157e4fd55aSmrg [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 167e4fd55aSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, 177e4fd55aSmrg[m4_warning([this file was generated for autoconf 2.68. 187e4fd55aSmrgYou have another version of autoconf. It may work, but is not guaranteed to. 197e4fd55aSmrgIf you have problems, you may need to regenerate the build system entirely. 207e4fd55aSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])]) 21b8f75c19Smrg 227e4fd55aSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. 237e4fd55aSmrg# 247e4fd55aSmrg# This file is free software; the Free Software Foundation 257e4fd55aSmrg# gives unlimited permission to copy and/or distribute it, 267e4fd55aSmrg# with or without modifications, as long as this notice is preserved. 27b8f75c19Smrg 28b8f75c19Smrg# AM_AUTOMAKE_VERSION(VERSION) 29b8f75c19Smrg# ---------------------------- 30b8f75c19Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been 31b8f75c19Smrg# generated from the m4 files accompanying Automake X.Y. 327e4fd55aSmrg# (This private macro should not be called outside this file.) 337e4fd55aSmrgAC_DEFUN([AM_AUTOMAKE_VERSION], 347e4fd55aSmrg[am__api_version='1.11' 357e4fd55aSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to 367e4fd55aSmrgdnl require some minimum version. Point them to the right macro. 377e4fd55aSmrgm4_if([$1], [1.11.1], [], 387e4fd55aSmrg [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl 397e4fd55aSmrg]) 407e4fd55aSmrg 417e4fd55aSmrg# _AM_AUTOCONF_VERSION(VERSION) 427e4fd55aSmrg# ----------------------------- 437e4fd55aSmrg# aclocal traces this macro to find the Autoconf version. 447e4fd55aSmrg# This is a private macro too. Using m4_define simplifies 457e4fd55aSmrg# the logic in aclocal, which can simply ignore this definition. 467e4fd55aSmrgm4_define([_AM_AUTOCONF_VERSION], []) 47b8f75c19Smrg 48b8f75c19Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION 49b8f75c19Smrg# ------------------------------- 507e4fd55aSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. 517e4fd55aSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. 52b8f75c19SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 537e4fd55aSmrg[AM_AUTOMAKE_VERSION([1.11.1])dnl 547e4fd55aSmrgm4_ifndef([AC_AUTOCONF_VERSION], 557e4fd55aSmrg [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 567e4fd55aSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) 57b8f75c19Smrg 587e4fd55aSmrg# AM_AUX_DIR_EXPAND -*- Autoconf -*- 59b8f75c19Smrg 607e4fd55aSmrg# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 61b8f75c19Smrg# 627e4fd55aSmrg# This file is free software; the Free Software Foundation 637e4fd55aSmrg# gives unlimited permission to copy and/or distribute it, 647e4fd55aSmrg# with or without modifications, as long as this notice is preserved. 65b8f75c19Smrg 66b8f75c19Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 67b8f75c19Smrg# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to 68b8f75c19Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'. 69b8f75c19Smrg# 70b8f75c19Smrg# Of course, Automake must honor this variable whenever it calls a 71b8f75c19Smrg# tool from the auxiliary directory. The problem is that $srcdir (and 72b8f75c19Smrg# therefore $ac_aux_dir as well) can be either absolute or relative, 73b8f75c19Smrg# depending on how configure is run. This is pretty annoying, since 74b8f75c19Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top 75b8f75c19Smrg# source directory, any form will work fine, but in subdirectories a 76b8f75c19Smrg# relative path needs to be adjusted first. 77b8f75c19Smrg# 78b8f75c19Smrg# $ac_aux_dir/missing 79b8f75c19Smrg# fails when called from a subdirectory if $ac_aux_dir is relative 80b8f75c19Smrg# $top_srcdir/$ac_aux_dir/missing 81b8f75c19Smrg# fails if $ac_aux_dir is absolute, 82b8f75c19Smrg# fails when called from a subdirectory in a VPATH build with 83b8f75c19Smrg# a relative $ac_aux_dir 84b8f75c19Smrg# 85b8f75c19Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir 86b8f75c19Smrg# are both prefixed by $srcdir. In an in-source build this is usually 87b8f75c19Smrg# harmless because $srcdir is `.', but things will broke when you 88b8f75c19Smrg# start a VPATH build or use an absolute $srcdir. 89b8f75c19Smrg# 90b8f75c19Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 91b8f75c19Smrg# iff we strip the leading $srcdir from $ac_aux_dir. That would be: 92b8f75c19Smrg# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 93b8f75c19Smrg# and then we would define $MISSING as 94b8f75c19Smrg# MISSING="\${SHELL} $am_aux_dir/missing" 95b8f75c19Smrg# This will work as long as MISSING is not called from configure, because 96b8f75c19Smrg# unfortunately $(top_srcdir) has no meaning in configure. 97b8f75c19Smrg# However there are other variables, like CC, which are often used in 98b8f75c19Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir. 99b8f75c19Smrg# 100b8f75c19Smrg# Another solution, used here, is to always expand $ac_aux_dir to an 101b8f75c19Smrg# absolute PATH. The drawback is that using absolute paths prevent a 102b8f75c19Smrg# configured tree to be moved without reconfiguration. 103b8f75c19Smrg 1047e4fd55aSmrgAC_DEFUN([AM_AUX_DIR_EXPAND], 1057e4fd55aSmrg[dnl Rely on autoconf to set up CDPATH properly. 1067e4fd55aSmrgAC_PREREQ([2.50])dnl 107b8f75c19Smrg# expand $ac_aux_dir to an absolute path 108b8f75c19Smrgam_aux_dir=`cd $ac_aux_dir && pwd` 109b8f75c19Smrg]) 110b8f75c19Smrg 1117e4fd55aSmrg# AM_CONDITIONAL -*- Autoconf -*- 112b8f75c19Smrg 1137e4fd55aSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 1147e4fd55aSmrg# Free Software Foundation, Inc. 1157e4fd55aSmrg# 1167e4fd55aSmrg# This file is free software; the Free Software Foundation 1177e4fd55aSmrg# gives unlimited permission to copy and/or distribute it, 1187e4fd55aSmrg# with or without modifications, as long as this notice is preserved. 119b8f75c19Smrg 1207e4fd55aSmrg# serial 9 121b8f75c19Smrg 1227e4fd55aSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION) 1237e4fd55aSmrg# ------------------------------------- 1247e4fd55aSmrg# Define a conditional. 1257e4fd55aSmrgAC_DEFUN([AM_CONDITIONAL], 1267e4fd55aSmrg[AC_PREREQ(2.52)dnl 1277e4fd55aSmrg ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 1287e4fd55aSmrg [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 1297e4fd55aSmrgAC_SUBST([$1_TRUE])dnl 1307e4fd55aSmrgAC_SUBST([$1_FALSE])dnl 1317e4fd55aSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl 1327e4fd55aSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl 1337e4fd55aSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl 1347e4fd55aSmrgif $2; then 1357e4fd55aSmrg $1_TRUE= 1367e4fd55aSmrg $1_FALSE='#' 137b8f75c19Smrgelse 1387e4fd55aSmrg $1_TRUE='#' 1397e4fd55aSmrg $1_FALSE= 140b8f75c19Smrgfi 1417e4fd55aSmrgAC_CONFIG_COMMANDS_PRE( 1427e4fd55aSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 1437e4fd55aSmrg AC_MSG_ERROR([[conditional "$1" was never defined. 1447e4fd55aSmrgUsually this means the macro was only invoked conditionally.]]) 1457e4fd55aSmrgfi])]) 146b8f75c19Smrg 1477e4fd55aSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 1487e4fd55aSmrg# Free Software Foundation, Inc. 1497e4fd55aSmrg# 1507e4fd55aSmrg# This file is free software; the Free Software Foundation 1517e4fd55aSmrg# gives unlimited permission to copy and/or distribute it, 1527e4fd55aSmrg# with or without modifications, as long as this notice is preserved. 153b8f75c19Smrg 1547e4fd55aSmrg# serial 10 155b8f75c19Smrg 156b8f75c19Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be 157b8f75c19Smrg# written in clear, in which case automake, when reading aclocal.m4, 158b8f75c19Smrg# will think it sees a *use*, and therefore will trigger all it's 159b8f75c19Smrg# C support machinery. Also note that it means that autoscan, seeing 160b8f75c19Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use... 161b8f75c19Smrg 162b8f75c19Smrg 163b8f75c19Smrg# _AM_DEPENDENCIES(NAME) 164b8f75c19Smrg# ---------------------- 165b8f75c19Smrg# See how the compiler implements dependency checking. 166b8f75c19Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC". 167b8f75c19Smrg# We try a few techniques and use that to set a single cache variable. 168b8f75c19Smrg# 169b8f75c19Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was 170b8f75c19Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular 171b8f75c19Smrg# dependency, and given that the user is not expected to run this macro, 172b8f75c19Smrg# just rely on AC_PROG_CC. 173b8f75c19SmrgAC_DEFUN([_AM_DEPENDENCIES], 174b8f75c19Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl 175b8f75c19SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl 176b8f75c19SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl 177b8f75c19SmrgAC_REQUIRE([AM_DEP_TRACK])dnl 178b8f75c19Smrg 179b8f75c19Smrgifelse([$1], CC, [depcc="$CC" am_compiler_list=], 180b8f75c19Smrg [$1], CXX, [depcc="$CXX" am_compiler_list=], 181b8f75c19Smrg [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 1827e4fd55aSmrg [$1], UPC, [depcc="$UPC" am_compiler_list=], 183b8f75c19Smrg [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 184b8f75c19Smrg [depcc="$$1" am_compiler_list=]) 185b8f75c19Smrg 186b8f75c19SmrgAC_CACHE_CHECK([dependency style of $depcc], 187b8f75c19Smrg [am_cv_$1_dependencies_compiler_type], 188b8f75c19Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then 189b8f75c19Smrg # We make a subdir and do the tests there. Otherwise we can end up 190b8f75c19Smrg # making bogus files that we don't know about and never remove. For 191b8f75c19Smrg # instance it was reported that on HP-UX the gcc test will end up 192b8f75c19Smrg # making a dummy file named `D' -- because `-MD' means `put the output 193b8f75c19Smrg # in D'. 194b8f75c19Smrg mkdir conftest.dir 195b8f75c19Smrg # Copy depcomp to subdir because otherwise we won't find it if we're 196b8f75c19Smrg # using a relative directory. 197b8f75c19Smrg cp "$am_depcomp" conftest.dir 198b8f75c19Smrg cd conftest.dir 199b8f75c19Smrg # We will build objects and dependencies in a subdirectory because 200b8f75c19Smrg # it helps to detect inapplicable dependency modes. For instance 201b8f75c19Smrg # both Tru64's cc and ICC support -MD to output dependencies as a 202b8f75c19Smrg # side effect of compilation, but ICC will put the dependencies in 203b8f75c19Smrg # the current directory while Tru64 will put them in the object 204b8f75c19Smrg # directory. 205b8f75c19Smrg mkdir sub 206b8f75c19Smrg 207b8f75c19Smrg am_cv_$1_dependencies_compiler_type=none 208b8f75c19Smrg if test "$am_compiler_list" = ""; then 209b8f75c19Smrg am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` 210b8f75c19Smrg fi 2117e4fd55aSmrg am__universal=false 2127e4fd55aSmrg m4_case([$1], [CC], 2137e4fd55aSmrg [case " $depcc " in #( 2147e4fd55aSmrg *\ -arch\ *\ -arch\ *) am__universal=true ;; 2157e4fd55aSmrg esac], 2167e4fd55aSmrg [CXX], 2177e4fd55aSmrg [case " $depcc " in #( 2187e4fd55aSmrg *\ -arch\ *\ -arch\ *) am__universal=true ;; 2197e4fd55aSmrg esac]) 2207e4fd55aSmrg 221b8f75c19Smrg for depmode in $am_compiler_list; do 222b8f75c19Smrg # Setup a source with many dependencies, because some compilers 223b8f75c19Smrg # like to wrap large dependency lists on column 80 (with \), and 224b8f75c19Smrg # we should not choose a depcomp mode which is confused by this. 225b8f75c19Smrg # 226b8f75c19Smrg # We need to recreate these files for each test, as the compiler may 227b8f75c19Smrg # overwrite some of them when testing with obscure command lines. 228b8f75c19Smrg # This happens at least with the AIX C compiler. 229b8f75c19Smrg : > sub/conftest.c 230b8f75c19Smrg for i in 1 2 3 4 5 6; do 231b8f75c19Smrg echo '#include "conftst'$i'.h"' >> sub/conftest.c 2327e4fd55aSmrg # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with 2337e4fd55aSmrg # Solaris 8's {/usr,}/bin/sh. 2347e4fd55aSmrg touch sub/conftst$i.h 235b8f75c19Smrg done 236b8f75c19Smrg echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 237b8f75c19Smrg 2387e4fd55aSmrg # We check with `-c' and `-o' for the sake of the "dashmstdout" 2397e4fd55aSmrg # mode. It turns out that the SunPro C++ compiler does not properly 2407e4fd55aSmrg # handle `-M -o', and we need to detect this. Also, some Intel 2417e4fd55aSmrg # versions had trouble with output in subdirs 2427e4fd55aSmrg am__obj=sub/conftest.${OBJEXT-o} 2437e4fd55aSmrg am__minus_obj="-o $am__obj" 244b8f75c19Smrg case $depmode in 2457e4fd55aSmrg gcc) 2467e4fd55aSmrg # This depmode causes a compiler race in universal mode. 2477e4fd55aSmrg test "$am__universal" = false || continue 2487e4fd55aSmrg ;; 249b8f75c19Smrg nosideeffect) 250b8f75c19Smrg # after this tag, mechanisms are not by side-effect, so they'll 251b8f75c19Smrg # only be used when explicitly requested 252b8f75c19Smrg if test "x$enable_dependency_tracking" = xyes; then 253b8f75c19Smrg continue 254b8f75c19Smrg else 255b8f75c19Smrg break 256b8f75c19Smrg fi 257b8f75c19Smrg ;; 2587e4fd55aSmrg msvisualcpp | msvcmsys) 2597e4fd55aSmrg # This compiler won't grok `-c -o', but also, the minuso test has 2607e4fd55aSmrg # not run yet. These depmodes are late enough in the game, and 2617e4fd55aSmrg # so weak that their functioning should not be impacted. 2627e4fd55aSmrg am__obj=conftest.${OBJEXT-o} 2637e4fd55aSmrg am__minus_obj= 2647e4fd55aSmrg ;; 265b8f75c19Smrg none) break ;; 266b8f75c19Smrg esac 267b8f75c19Smrg if depmode=$depmode \ 2687e4fd55aSmrg source=sub/conftest.c object=$am__obj \ 269b8f75c19Smrg depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ 2707e4fd55aSmrg $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ 271b8f75c19Smrg >/dev/null 2>conftest.err && 2727e4fd55aSmrg grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 273b8f75c19Smrg grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && 2747e4fd55aSmrg grep $am__obj sub/conftest.Po > /dev/null 2>&1 && 275b8f75c19Smrg ${MAKE-make} -s -f confmf > /dev/null 2>&1; then 276b8f75c19Smrg # icc doesn't choke on unknown options, it will just issue warnings 2777e4fd55aSmrg # or remarks (even with -Werror). So we grep stderr for any message 2787e4fd55aSmrg # that says an option was ignored or not supported. 2797e4fd55aSmrg # When given -MP, icc 7.0 and 7.1 complain thusly: 2807e4fd55aSmrg # icc: Command line warning: ignoring option '-M'; no argument required 2817e4fd55aSmrg # The diagnosis changed in icc 8.0: 2827e4fd55aSmrg # icc: Command line remark: option '-MP' not supported 2837e4fd55aSmrg if (grep 'ignoring option' conftest.err || 2847e4fd55aSmrg grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else 285b8f75c19Smrg am_cv_$1_dependencies_compiler_type=$depmode 286b8f75c19Smrg break 287b8f75c19Smrg fi 288b8f75c19Smrg fi 289b8f75c19Smrg done 290b8f75c19Smrg 291b8f75c19Smrg cd .. 292b8f75c19Smrg rm -rf conftest.dir 293b8f75c19Smrgelse 294b8f75c19Smrg am_cv_$1_dependencies_compiler_type=none 295b8f75c19Smrgfi 296b8f75c19Smrg]) 297b8f75c19SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) 298b8f75c19SmrgAM_CONDITIONAL([am__fastdep$1], [ 299b8f75c19Smrg test "x$enable_dependency_tracking" != xno \ 300b8f75c19Smrg && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) 301b8f75c19Smrg]) 302b8f75c19Smrg 303b8f75c19Smrg 304b8f75c19Smrg# AM_SET_DEPDIR 305b8f75c19Smrg# ------------- 306b8f75c19Smrg# Choose a directory name for dependency files. 307b8f75c19Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES 308b8f75c19SmrgAC_DEFUN([AM_SET_DEPDIR], 309b8f75c19Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl 310b8f75c19SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl 311b8f75c19Smrg]) 312b8f75c19Smrg 313b8f75c19Smrg 314b8f75c19Smrg# AM_DEP_TRACK 315b8f75c19Smrg# ------------ 316b8f75c19SmrgAC_DEFUN([AM_DEP_TRACK], 317b8f75c19Smrg[AC_ARG_ENABLE(dependency-tracking, 3187e4fd55aSmrg[ --disable-dependency-tracking speeds up one-time build 3197e4fd55aSmrg --enable-dependency-tracking do not reject slow dependency extractors]) 320b8f75c19Smrgif test "x$enable_dependency_tracking" != xno; then 321b8f75c19Smrg am_depcomp="$ac_aux_dir/depcomp" 322b8f75c19Smrg AMDEPBACKSLASH='\' 323b8f75c19Smrgfi 324b8f75c19SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) 3257e4fd55aSmrgAC_SUBST([AMDEPBACKSLASH])dnl 3267e4fd55aSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl 327b8f75c19Smrg]) 328b8f75c19Smrg 3297e4fd55aSmrg# Generate code to set up dependency tracking. -*- Autoconf -*- 330b8f75c19Smrg 3317e4fd55aSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 3327e4fd55aSmrg# Free Software Foundation, Inc. 3337e4fd55aSmrg# 3347e4fd55aSmrg# This file is free software; the Free Software Foundation 3357e4fd55aSmrg# gives unlimited permission to copy and/or distribute it, 3367e4fd55aSmrg# with or without modifications, as long as this notice is preserved. 337b8f75c19Smrg 3387e4fd55aSmrg#serial 5 339b8f75c19Smrg 340b8f75c19Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS 341b8f75c19Smrg# ------------------------------ 342b8f75c19SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], 3437e4fd55aSmrg[{ 3447e4fd55aSmrg # Autoconf 2.62 quotes --file arguments for eval, but not when files 3457e4fd55aSmrg # are listed without --file. Let's play safe and only enable the eval 3467e4fd55aSmrg # if we detect the quoting. 3477e4fd55aSmrg case $CONFIG_FILES in 3487e4fd55aSmrg *\'*) eval set x "$CONFIG_FILES" ;; 3497e4fd55aSmrg *) set x $CONFIG_FILES ;; 3507e4fd55aSmrg esac 3517e4fd55aSmrg shift 3527e4fd55aSmrg for mf 3537e4fd55aSmrg do 3547e4fd55aSmrg # Strip MF so we end up with the name of the file. 3557e4fd55aSmrg mf=`echo "$mf" | sed -e 's/:.*$//'` 3567e4fd55aSmrg # Check whether this is an Automake generated Makefile or not. 3577e4fd55aSmrg # We used to match only the files named `Makefile.in', but 3587e4fd55aSmrg # some people rename them; so instead we look at the file content. 3597e4fd55aSmrg # Grep'ing the first line is not enough: some people post-process 3607e4fd55aSmrg # each Makefile.in and add a new line on top of each file to say so. 3617e4fd55aSmrg # Grep'ing the whole file is not good either: AIX grep has a line 3627e4fd55aSmrg # limit of 2048, but all sed's we know have understand at least 4000. 3637e4fd55aSmrg if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then 3647e4fd55aSmrg dirpart=`AS_DIRNAME("$mf")` 3657e4fd55aSmrg else 3667e4fd55aSmrg continue 3677e4fd55aSmrg fi 3687e4fd55aSmrg # Extract the definition of DEPDIR, am__include, and am__quote 3697e4fd55aSmrg # from the Makefile without running `make'. 3707e4fd55aSmrg DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` 3717e4fd55aSmrg test -z "$DEPDIR" && continue 3727e4fd55aSmrg am__include=`sed -n 's/^am__include = //p' < "$mf"` 3737e4fd55aSmrg test -z "am__include" && continue 3747e4fd55aSmrg am__quote=`sed -n 's/^am__quote = //p' < "$mf"` 3757e4fd55aSmrg # When using ansi2knr, U may be empty or an underscore; expand it 3767e4fd55aSmrg U=`sed -n 's/^U = //p' < "$mf"` 3777e4fd55aSmrg # Find all dependency output files, they are included files with 3787e4fd55aSmrg # $(DEPDIR) in their names. We invoke sed twice because it is the 3797e4fd55aSmrg # simplest approach to changing $(DEPDIR) to its actual value in the 3807e4fd55aSmrg # expansion. 3817e4fd55aSmrg for file in `sed -n " 3827e4fd55aSmrg s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ 3837e4fd55aSmrg sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do 3847e4fd55aSmrg # Make sure the directory exists. 3857e4fd55aSmrg test -f "$dirpart/$file" && continue 3867e4fd55aSmrg fdir=`AS_DIRNAME(["$file"])` 3877e4fd55aSmrg AS_MKDIR_P([$dirpart/$fdir]) 3887e4fd55aSmrg # echo "creating $dirpart/$file" 3897e4fd55aSmrg echo '# dummy' > "$dirpart/$file" 3907e4fd55aSmrg done 391b8f75c19Smrg done 3927e4fd55aSmrg} 393b8f75c19Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS 394b8f75c19Smrg 395b8f75c19Smrg 396b8f75c19Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS 397b8f75c19Smrg# ----------------------------- 398b8f75c19Smrg# This macro should only be invoked once -- use via AC_REQUIRE. 399b8f75c19Smrg# 400b8f75c19Smrg# This code is only required when automatic dependency tracking 401b8f75c19Smrg# is enabled. FIXME. This creates each `.P' file that we will 402b8f75c19Smrg# need in order to bootstrap the dependency handling code. 403b8f75c19SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], 404b8f75c19Smrg[AC_CONFIG_COMMANDS([depfiles], 405b8f75c19Smrg [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], 406b8f75c19Smrg [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) 407b8f75c19Smrg]) 408b8f75c19Smrg 4097e4fd55aSmrg# Do all the work for Automake. -*- Autoconf -*- 410b8f75c19Smrg 4117e4fd55aSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 4127e4fd55aSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. 4137e4fd55aSmrg# 4147e4fd55aSmrg# This file is free software; the Free Software Foundation 4157e4fd55aSmrg# gives unlimited permission to copy and/or distribute it, 4167e4fd55aSmrg# with or without modifications, as long as this notice is preserved. 417b8f75c19Smrg 4187e4fd55aSmrg# serial 16 419b8f75c19Smrg 4207e4fd55aSmrg# This macro actually does too much. Some checks are only needed if 4217e4fd55aSmrg# your package does certain things. But this isn't really a big deal. 422b8f75c19Smrg 4237e4fd55aSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 4247e4fd55aSmrg# AM_INIT_AUTOMAKE([OPTIONS]) 4257e4fd55aSmrg# ----------------------------------------------- 4267e4fd55aSmrg# The call with PACKAGE and VERSION arguments is the old style 4277e4fd55aSmrg# call (pre autoconf-2.50), which is being phased out. PACKAGE 4287e4fd55aSmrg# and VERSION should now be passed to AC_INIT and removed from 4297e4fd55aSmrg# the call to AM_INIT_AUTOMAKE. 4307e4fd55aSmrg# We support both call styles for the transition. After 4317e4fd55aSmrg# the next Automake release, Autoconf can make the AC_INIT 4327e4fd55aSmrg# arguments mandatory, and then we can depend on a new Autoconf 4337e4fd55aSmrg# release and drop the old call support. 4347e4fd55aSmrgAC_DEFUN([AM_INIT_AUTOMAKE], 4357e4fd55aSmrg[AC_PREREQ([2.62])dnl 4367e4fd55aSmrgdnl Autoconf wants to disallow AM_ names. We explicitly allow 4377e4fd55aSmrgdnl the ones we care about. 4387e4fd55aSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 4397e4fd55aSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 4407e4fd55aSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl 4417e4fd55aSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then 4427e4fd55aSmrg # Use -I$(srcdir) only when $(srcdir) != ., so that make's output 4437e4fd55aSmrg # is not polluted with repeated "-I." 4447e4fd55aSmrg AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl 4457e4fd55aSmrg # test to see if srcdir already configured 4467e4fd55aSmrg if test -f $srcdir/config.status; then 4477e4fd55aSmrg AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 4487e4fd55aSmrg fi 4497e4fd55aSmrgfi 4507e4fd55aSmrg 4517e4fd55aSmrg# test whether we have cygpath 4527e4fd55aSmrgif test -z "$CYGPATH_W"; then 4537e4fd55aSmrg if (cygpath --version) >/dev/null 2>/dev/null; then 4547e4fd55aSmrg CYGPATH_W='cygpath -w' 4557e4fd55aSmrg else 4567e4fd55aSmrg CYGPATH_W=echo 4577e4fd55aSmrg fi 4587e4fd55aSmrgfi 4597e4fd55aSmrgAC_SUBST([CYGPATH_W]) 4607e4fd55aSmrg 4617e4fd55aSmrg# Define the identity of the package. 4627e4fd55aSmrgdnl Distinguish between old-style and new-style calls. 4637e4fd55aSmrgm4_ifval([$2], 4647e4fd55aSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 4657e4fd55aSmrg AC_SUBST([PACKAGE], [$1])dnl 4667e4fd55aSmrg AC_SUBST([VERSION], [$2])], 4677e4fd55aSmrg[_AM_SET_OPTIONS([$1])dnl 4687e4fd55aSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. 4697e4fd55aSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, 4707e4fd55aSmrg [m4_fatal([AC_INIT should be called with package and version arguments])])dnl 4717e4fd55aSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl 4727e4fd55aSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl 4737e4fd55aSmrg 4747e4fd55aSmrg_AM_IF_OPTION([no-define],, 4757e4fd55aSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) 4767e4fd55aSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl 4777e4fd55aSmrg 4787e4fd55aSmrg# Some tools Automake needs. 4797e4fd55aSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl 4807e4fd55aSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl 4817e4fd55aSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) 4827e4fd55aSmrgAM_MISSING_PROG(AUTOCONF, autoconf) 4837e4fd55aSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) 4847e4fd55aSmrgAM_MISSING_PROG(AUTOHEADER, autoheader) 4857e4fd55aSmrgAM_MISSING_PROG(MAKEINFO, makeinfo) 4867e4fd55aSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl 4877e4fd55aSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl 4887e4fd55aSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl 4897e4fd55aSmrg# We need awk for the "check" target. The system "awk" is bad on 4907e4fd55aSmrg# some platforms. 4917e4fd55aSmrgAC_REQUIRE([AC_PROG_AWK])dnl 4927e4fd55aSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl 4937e4fd55aSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl 4947e4fd55aSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], 4957e4fd55aSmrg [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], 4967e4fd55aSmrg [_AM_PROG_TAR([v7])])]) 4977e4fd55aSmrg_AM_IF_OPTION([no-dependencies],, 4987e4fd55aSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC], 4997e4fd55aSmrg [_AM_DEPENDENCIES(CC)], 5007e4fd55aSmrg [define([AC_PROG_CC], 5017e4fd55aSmrg defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl 5027e4fd55aSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX], 5037e4fd55aSmrg [_AM_DEPENDENCIES(CXX)], 5047e4fd55aSmrg [define([AC_PROG_CXX], 5057e4fd55aSmrg defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl 5067e4fd55aSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC], 5077e4fd55aSmrg [_AM_DEPENDENCIES(OBJC)], 5087e4fd55aSmrg [define([AC_PROG_OBJC], 5097e4fd55aSmrg defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl 5107e4fd55aSmrg]) 5117e4fd55aSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl 5127e4fd55aSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the 5137e4fd55aSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro 5147e4fd55aSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below. 5157e4fd55aSmrgAC_CONFIG_COMMANDS_PRE(dnl 5167e4fd55aSmrg[m4_provide_if([_AM_COMPILER_EXEEXT], 5177e4fd55aSmrg [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl 5187e4fd55aSmrg]) 5197e4fd55aSmrg 5207e4fd55aSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not 5217e4fd55aSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further 5227e4fd55aSmrgdnl mangled by Autoconf and run in a shell conditional statement. 5237e4fd55aSmrgm4_define([_AC_COMPILER_EXEEXT], 5247e4fd55aSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) 5257e4fd55aSmrg 5267e4fd55aSmrg 5277e4fd55aSmrg# When config.status generates a header, we must update the stamp-h file. 5287e4fd55aSmrg# This file resides in the same directory as the config header 5297e4fd55aSmrg# that is generated. The stamp files are numbered to have different names. 5307e4fd55aSmrg 5317e4fd55aSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 5327e4fd55aSmrg# loop where config.status creates the headers, so we can generate 5337e4fd55aSmrg# our stamp files there. 5347e4fd55aSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 5357e4fd55aSmrg[# Compute $1's index in $config_headers. 5367e4fd55aSmrg_am_arg=$1 5377e4fd55aSmrg_am_stamp_count=1 5387e4fd55aSmrgfor _am_header in $config_headers :; do 5397e4fd55aSmrg case $_am_header in 5407e4fd55aSmrg $_am_arg | $_am_arg:* ) 5417e4fd55aSmrg break ;; 5427e4fd55aSmrg * ) 5437e4fd55aSmrg _am_stamp_count=`expr $_am_stamp_count + 1` ;; 5447e4fd55aSmrg esac 5457e4fd55aSmrgdone 5467e4fd55aSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) 5477e4fd55aSmrg 5487e4fd55aSmrg# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. 5497e4fd55aSmrg# 5507e4fd55aSmrg# This file is free software; the Free Software Foundation 5517e4fd55aSmrg# gives unlimited permission to copy and/or distribute it, 5527e4fd55aSmrg# with or without modifications, as long as this notice is preserved. 5537e4fd55aSmrg 5547e4fd55aSmrg# AM_PROG_INSTALL_SH 5557e4fd55aSmrg# ------------------ 5567e4fd55aSmrg# Define $install_sh. 5577e4fd55aSmrgAC_DEFUN([AM_PROG_INSTALL_SH], 5587e4fd55aSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 5597e4fd55aSmrgif test x"${install_sh}" != xset; then 5607e4fd55aSmrg case $am_aux_dir in 5617e4fd55aSmrg *\ * | *\ *) 5627e4fd55aSmrg install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; 5637e4fd55aSmrg *) 5647e4fd55aSmrg install_sh="\${SHELL} $am_aux_dir/install-sh" 5657e4fd55aSmrg esac 5667e4fd55aSmrgfi 5677e4fd55aSmrgAC_SUBST(install_sh)]) 5687e4fd55aSmrg 5697e4fd55aSmrg# Copyright (C) 2003, 2005 Free Software Foundation, Inc. 5707e4fd55aSmrg# 5717e4fd55aSmrg# This file is free software; the Free Software Foundation 5727e4fd55aSmrg# gives unlimited permission to copy and/or distribute it, 5737e4fd55aSmrg# with or without modifications, as long as this notice is preserved. 574b8f75c19Smrg 575b8f75c19Smrg# serial 2 576b8f75c19Smrg 5777e4fd55aSmrg# Check whether the underlying file-system supports filenames 5787e4fd55aSmrg# with a leading dot. For instance MS-DOS doesn't. 5797e4fd55aSmrgAC_DEFUN([AM_SET_LEADING_DOT], 5807e4fd55aSmrg[rm -rf .tst 2>/dev/null 5817e4fd55aSmrgmkdir .tst 2>/dev/null 5827e4fd55aSmrgif test -d .tst; then 5837e4fd55aSmrg am__leading_dot=. 5847e4fd55aSmrgelse 5857e4fd55aSmrg am__leading_dot=_ 5867e4fd55aSmrgfi 5877e4fd55aSmrgrmdir .tst 2>/dev/null 5887e4fd55aSmrgAC_SUBST([am__leading_dot])]) 5897e4fd55aSmrg 5907e4fd55aSmrg# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- 5917e4fd55aSmrg# From Jim Meyering 5927e4fd55aSmrg 5937e4fd55aSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 5947e4fd55aSmrg# Free Software Foundation, Inc. 5957e4fd55aSmrg# 5967e4fd55aSmrg# This file is free software; the Free Software Foundation 5977e4fd55aSmrg# gives unlimited permission to copy and/or distribute it, 5987e4fd55aSmrg# with or without modifications, as long as this notice is preserved. 5997e4fd55aSmrg 6007e4fd55aSmrg# serial 5 6017e4fd55aSmrg 6027e4fd55aSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE]) 6037e4fd55aSmrg# ---------------------------------- 6047e4fd55aSmrg# Control maintainer-specific portions of Makefiles. 6057e4fd55aSmrg# Default is to disable them, unless `enable' is passed literally. 6067e4fd55aSmrg# For symmetry, `disable' may be passed as well. Anyway, the user 6077e4fd55aSmrg# can override the default with the --enable/--disable switch. 6087e4fd55aSmrgAC_DEFUN([AM_MAINTAINER_MODE], 6097e4fd55aSmrg[m4_case(m4_default([$1], [disable]), 6107e4fd55aSmrg [enable], [m4_define([am_maintainer_other], [disable])], 6117e4fd55aSmrg [disable], [m4_define([am_maintainer_other], [enable])], 6127e4fd55aSmrg [m4_define([am_maintainer_other], [enable]) 6137e4fd55aSmrg m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) 6147e4fd55aSmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) 6157e4fd55aSmrg dnl maintainer-mode's default is 'disable' unless 'enable' is passed 6167e4fd55aSmrg AC_ARG_ENABLE([maintainer-mode], 6177e4fd55aSmrg[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful 6187e4fd55aSmrg (and sometimes confusing) to the casual installer], 6197e4fd55aSmrg [USE_MAINTAINER_MODE=$enableval], 6207e4fd55aSmrg [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) 6217e4fd55aSmrg AC_MSG_RESULT([$USE_MAINTAINER_MODE]) 6227e4fd55aSmrg AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) 6237e4fd55aSmrg MAINT=$MAINTAINER_MODE_TRUE 6247e4fd55aSmrg AC_SUBST([MAINT])dnl 6257e4fd55aSmrg] 6267e4fd55aSmrg) 6277e4fd55aSmrg 6287e4fd55aSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) 6297e4fd55aSmrg 6307e4fd55aSmrg# Check to see how 'make' treats includes. -*- Autoconf -*- 6317e4fd55aSmrg 6327e4fd55aSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. 6337e4fd55aSmrg# 6347e4fd55aSmrg# This file is free software; the Free Software Foundation 6357e4fd55aSmrg# gives unlimited permission to copy and/or distribute it, 6367e4fd55aSmrg# with or without modifications, as long as this notice is preserved. 6377e4fd55aSmrg 6387e4fd55aSmrg# serial 4 6397e4fd55aSmrg 640b8f75c19Smrg# AM_MAKE_INCLUDE() 641b8f75c19Smrg# ----------------- 642b8f75c19Smrg# Check to see how make treats includes. 643b8f75c19SmrgAC_DEFUN([AM_MAKE_INCLUDE], 644b8f75c19Smrg[am_make=${MAKE-make} 645b8f75c19Smrgcat > confinc << 'END' 646b8f75c19Smrgam__doit: 6477e4fd55aSmrg @echo this is the am__doit target 648b8f75c19Smrg.PHONY: am__doit 649b8f75c19SmrgEND 650b8f75c19Smrg# If we don't find an include directive, just comment out the code. 651b8f75c19SmrgAC_MSG_CHECKING([for style of include used by $am_make]) 652b8f75c19Smrgam__include="#" 653b8f75c19Smrgam__quote= 654b8f75c19Smrg_am_result=none 655b8f75c19Smrg# First try GNU make style include. 656b8f75c19Smrgecho "include confinc" > confmf 6577e4fd55aSmrg# Ignore all kinds of additional output from `make'. 6587e4fd55aSmrgcase `$am_make -s -f confmf 2> /dev/null` in #( 6597e4fd55aSmrg*the\ am__doit\ target*) 6607e4fd55aSmrg am__include=include 6617e4fd55aSmrg am__quote= 6627e4fd55aSmrg _am_result=GNU 6637e4fd55aSmrg ;; 6647e4fd55aSmrgesac 665b8f75c19Smrg# Now try BSD make style include. 666b8f75c19Smrgif test "$am__include" = "#"; then 667b8f75c19Smrg echo '.include "confinc"' > confmf 6687e4fd55aSmrg case `$am_make -s -f confmf 2> /dev/null` in #( 6697e4fd55aSmrg *the\ am__doit\ target*) 6707e4fd55aSmrg am__include=.include 6717e4fd55aSmrg am__quote="\"" 6727e4fd55aSmrg _am_result=BSD 6737e4fd55aSmrg ;; 6747e4fd55aSmrg esac 675b8f75c19Smrgfi 676b8f75c19SmrgAC_SUBST([am__include]) 677b8f75c19SmrgAC_SUBST([am__quote]) 678b8f75c19SmrgAC_MSG_RESULT([$_am_result]) 679b8f75c19Smrgrm -f confinc confmf 680b8f75c19Smrg]) 681b8f75c19Smrg 6827e4fd55aSmrg# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- 683b8f75c19Smrg 6847e4fd55aSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 6857e4fd55aSmrg# Free Software Foundation, Inc. 6867e4fd55aSmrg# 6877e4fd55aSmrg# This file is free software; the Free Software Foundation 6887e4fd55aSmrg# gives unlimited permission to copy and/or distribute it, 6897e4fd55aSmrg# with or without modifications, as long as this notice is preserved. 690b8f75c19Smrg 6917e4fd55aSmrg# serial 6 692b8f75c19Smrg 6937e4fd55aSmrg# AM_MISSING_PROG(NAME, PROGRAM) 6947e4fd55aSmrg# ------------------------------ 6957e4fd55aSmrgAC_DEFUN([AM_MISSING_PROG], 6967e4fd55aSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN]) 6977e4fd55aSmrg$1=${$1-"${am_missing_run}$2"} 6987e4fd55aSmrgAC_SUBST($1)]) 699b8f75c19Smrg 700b8f75c19Smrg 7017e4fd55aSmrg# AM_MISSING_HAS_RUN 7027e4fd55aSmrg# ------------------ 7037e4fd55aSmrg# Define MISSING if not defined so far and test if it supports --run. 7047e4fd55aSmrg# If it does, set am_missing_run to use it, otherwise, to nothing. 7057e4fd55aSmrgAC_DEFUN([AM_MISSING_HAS_RUN], 7067e4fd55aSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 7077e4fd55aSmrgAC_REQUIRE_AUX_FILE([missing])dnl 7087e4fd55aSmrgif test x"${MISSING+set}" != xset; then 7097e4fd55aSmrg case $am_aux_dir in 7107e4fd55aSmrg *\ * | *\ *) 7117e4fd55aSmrg MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; 7127e4fd55aSmrg *) 7137e4fd55aSmrg MISSING="\${SHELL} $am_aux_dir/missing" ;; 7147e4fd55aSmrg esac 7157e4fd55aSmrgfi 7167e4fd55aSmrg# Use eval to expand $SHELL 7177e4fd55aSmrgif eval "$MISSING --run true"; then 7187e4fd55aSmrg am_missing_run="$MISSING --run " 719b8f75c19Smrgelse 7207e4fd55aSmrg am_missing_run= 7217e4fd55aSmrg AC_MSG_WARN([`missing' script is too old or missing]) 722b8f75c19Smrgfi 7237e4fd55aSmrg]) 724b8f75c19Smrg 7257e4fd55aSmrg# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 7267e4fd55aSmrg# 7277e4fd55aSmrg# This file is free software; the Free Software Foundation 7287e4fd55aSmrg# gives unlimited permission to copy and/or distribute it, 7297e4fd55aSmrg# with or without modifications, as long as this notice is preserved. 730b8f75c19Smrg 7317e4fd55aSmrg# AM_PROG_MKDIR_P 7327e4fd55aSmrg# --------------- 7337e4fd55aSmrg# Check for `mkdir -p'. 7347e4fd55aSmrgAC_DEFUN([AM_PROG_MKDIR_P], 7357e4fd55aSmrg[AC_PREREQ([2.60])dnl 7367e4fd55aSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl 7377e4fd55aSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, 7387e4fd55aSmrgdnl while keeping a definition of mkdir_p for backward compatibility. 7397e4fd55aSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. 7407e4fd55aSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of 7417e4fd55aSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own 7427e4fd55aSmrgdnl adjustment using top_builddir (which is defined more often than 7437e4fd55aSmrgdnl MKDIR_P). 7447e4fd55aSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl 7457e4fd55aSmrgcase $mkdir_p in 7467e4fd55aSmrg [[\\/$]]* | ?:[[\\/]]*) ;; 7477e4fd55aSmrg */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; 7487e4fd55aSmrgesac 7497e4fd55aSmrg]) 750b8f75c19Smrg 7517e4fd55aSmrg# Helper functions for option handling. -*- Autoconf -*- 752b8f75c19Smrg 7537e4fd55aSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. 7547e4fd55aSmrg# 7557e4fd55aSmrg# This file is free software; the Free Software Foundation 7567e4fd55aSmrg# gives unlimited permission to copy and/or distribute it, 7577e4fd55aSmrg# with or without modifications, as long as this notice is preserved. 758b8f75c19Smrg 7597e4fd55aSmrg# serial 4 760b8f75c19Smrg 7617e4fd55aSmrg# _AM_MANGLE_OPTION(NAME) 7627e4fd55aSmrg# ----------------------- 7637e4fd55aSmrgAC_DEFUN([_AM_MANGLE_OPTION], 7647e4fd55aSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 765b8f75c19Smrg 7667e4fd55aSmrg# _AM_SET_OPTION(NAME) 7677e4fd55aSmrg# ------------------------------ 7687e4fd55aSmrg# Set option NAME. Presently that only means defining a flag for this option. 7697e4fd55aSmrgAC_DEFUN([_AM_SET_OPTION], 7707e4fd55aSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) 771b8f75c19Smrg 7727e4fd55aSmrg# _AM_SET_OPTIONS(OPTIONS) 7737e4fd55aSmrg# ---------------------------------- 7747e4fd55aSmrg# OPTIONS is a space-separated list of Automake options. 7757e4fd55aSmrgAC_DEFUN([_AM_SET_OPTIONS], 7767e4fd55aSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 777b8f75c19Smrg 7787e4fd55aSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 7797e4fd55aSmrg# ------------------------------------------- 7807e4fd55aSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 7817e4fd55aSmrgAC_DEFUN([_AM_IF_OPTION], 7827e4fd55aSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 783b8f75c19Smrg 7847e4fd55aSmrg# Check to make sure that the build environment is sane. -*- Autoconf -*- 785b8f75c19Smrg 7867e4fd55aSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 7877e4fd55aSmrg# Free Software Foundation, Inc. 788b8f75c19Smrg# 7897e4fd55aSmrg# This file is free software; the Free Software Foundation 7907e4fd55aSmrg# gives unlimited permission to copy and/or distribute it, 7917e4fd55aSmrg# with or without modifications, as long as this notice is preserved. 792b8f75c19Smrg 7937e4fd55aSmrg# serial 5 794b8f75c19Smrg 7957e4fd55aSmrg# AM_SANITY_CHECK 7967e4fd55aSmrg# --------------- 7977e4fd55aSmrgAC_DEFUN([AM_SANITY_CHECK], 7987e4fd55aSmrg[AC_MSG_CHECKING([whether build environment is sane]) 7997e4fd55aSmrg# Just in case 8007e4fd55aSmrgsleep 1 8017e4fd55aSmrgecho timestamp > conftest.file 8027e4fd55aSmrg# Reject unsafe characters in $srcdir or the absolute working directory 8037e4fd55aSmrg# name. Accept space and tab only in the latter. 8047e4fd55aSmrgam_lf=' 8057e4fd55aSmrg' 8067e4fd55aSmrgcase `pwd` in 8077e4fd55aSmrg *[[\\\"\#\$\&\'\`$am_lf]]*) 8087e4fd55aSmrg AC_MSG_ERROR([unsafe absolute working directory name]);; 8097e4fd55aSmrgesac 8107e4fd55aSmrgcase $srcdir in 8117e4fd55aSmrg *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) 8127e4fd55aSmrg AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; 8137e4fd55aSmrgesac 8147e4fd55aSmrg 8157e4fd55aSmrg# Do `set' in a subshell so we don't clobber the current shell's 8167e4fd55aSmrg# arguments. Must try -L first in case configure is actually a 8177e4fd55aSmrg# symlink; some systems play weird games with the mod time of symlinks 8187e4fd55aSmrg# (eg FreeBSD returns the mod time of the symlink's containing 8197e4fd55aSmrg# directory). 8207e4fd55aSmrgif ( 8217e4fd55aSmrg set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` 8227e4fd55aSmrg if test "$[*]" = "X"; then 8237e4fd55aSmrg # -L didn't work. 8247e4fd55aSmrg set X `ls -t "$srcdir/configure" conftest.file` 8257e4fd55aSmrg fi 8267e4fd55aSmrg rm -f conftest.file 8277e4fd55aSmrg if test "$[*]" != "X $srcdir/configure conftest.file" \ 8287e4fd55aSmrg && test "$[*]" != "X conftest.file $srcdir/configure"; then 829b8f75c19Smrg 8307e4fd55aSmrg # If neither matched, then we have a broken ls. This can happen 8317e4fd55aSmrg # if, for instance, CONFIG_SHELL is bash and it inherits a 8327e4fd55aSmrg # broken ls alias from the environment. This has actually 8337e4fd55aSmrg # happened. Such a system could not be considered "sane". 8347e4fd55aSmrg AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 8357e4fd55aSmrgalias in your environment]) 8367e4fd55aSmrg fi 837b8f75c19Smrg 8387e4fd55aSmrg test "$[2]" = conftest.file 8397e4fd55aSmrg ) 8407e4fd55aSmrgthen 8417e4fd55aSmrg # Ok. 8427e4fd55aSmrg : 843b8f75c19Smrgelse 8447e4fd55aSmrg AC_MSG_ERROR([newly created file is older than distributed files! 8457e4fd55aSmrgCheck your system clock]) 8467e4fd55aSmrgfi 8477e4fd55aSmrgAC_MSG_RESULT(yes)]) 848b8f75c19Smrg 8497e4fd55aSmrg# Copyright (C) 2009 Free Software Foundation, Inc. 8507e4fd55aSmrg# 8517e4fd55aSmrg# This file is free software; the Free Software Foundation 8527e4fd55aSmrg# gives unlimited permission to copy and/or distribute it, 8537e4fd55aSmrg# with or without modifications, as long as this notice is preserved. 854b8f75c19Smrg 8557e4fd55aSmrg# serial 1 856b8f75c19Smrg 8577e4fd55aSmrg# AM_SILENT_RULES([DEFAULT]) 8587e4fd55aSmrg# -------------------------- 8597e4fd55aSmrg# Enable less verbose build rules; with the default set to DEFAULT 8607e4fd55aSmrg# (`yes' being less verbose, `no' or empty being verbose). 8617e4fd55aSmrgAC_DEFUN([AM_SILENT_RULES], 8627e4fd55aSmrg[AC_ARG_ENABLE([silent-rules], 8637e4fd55aSmrg[ --enable-silent-rules less verbose build output (undo: `make V=1') 8647e4fd55aSmrg --disable-silent-rules verbose build output (undo: `make V=0')]) 8657e4fd55aSmrgcase $enable_silent_rules in 8667e4fd55aSmrgyes) AM_DEFAULT_VERBOSITY=0;; 8677e4fd55aSmrgno) AM_DEFAULT_VERBOSITY=1;; 8687e4fd55aSmrg*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; 8697e4fd55aSmrgesac 8707e4fd55aSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl 8717e4fd55aSmrgAM_BACKSLASH='\' 8727e4fd55aSmrgAC_SUBST([AM_BACKSLASH])dnl 8737e4fd55aSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl 8747e4fd55aSmrg]) 8757e4fd55aSmrg 8767e4fd55aSmrg# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 877b8f75c19Smrg# 8787e4fd55aSmrg# This file is free software; the Free Software Foundation 8797e4fd55aSmrg# gives unlimited permission to copy and/or distribute it, 8807e4fd55aSmrg# with or without modifications, as long as this notice is preserved. 8817e4fd55aSmrg 8827e4fd55aSmrg# AM_PROG_INSTALL_STRIP 8837e4fd55aSmrg# --------------------- 8847e4fd55aSmrg# One issue with vendor `install' (even GNU) is that you can't 8857e4fd55aSmrg# specify the program used to strip binaries. This is especially 8867e4fd55aSmrg# annoying in cross-compiling environments, where the build's strip 8877e4fd55aSmrg# is unlikely to handle the host's binaries. 8887e4fd55aSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we 8897e4fd55aSmrg# always use install-sh in `make install-strip', and initialize 8907e4fd55aSmrg# STRIPPROG with the value of the STRIP variable (set by the user). 8917e4fd55aSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP], 8927e4fd55aSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 8937e4fd55aSmrg# Installed binaries are usually stripped using `strip' when the user 8947e4fd55aSmrg# run `make install-strip'. However `strip' might not be the right 8957e4fd55aSmrg# tool to use in cross-compilation environments, therefore Automake 8967e4fd55aSmrg# will honor the `STRIP' environment variable to overrule this program. 8977e4fd55aSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'. 8987e4fd55aSmrgif test "$cross_compiling" != no; then 8997e4fd55aSmrg AC_CHECK_TOOL([STRIP], [strip], :) 9007e4fd55aSmrgfi 9017e4fd55aSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" 9027e4fd55aSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])]) 9037e4fd55aSmrg 9047e4fd55aSmrg# Copyright (C) 2006, 2008 Free Software Foundation, Inc. 905b8f75c19Smrg# 9067e4fd55aSmrg# This file is free software; the Free Software Foundation 9077e4fd55aSmrg# gives unlimited permission to copy and/or distribute it, 9087e4fd55aSmrg# with or without modifications, as long as this notice is preserved. 909b8f75c19Smrg 9107e4fd55aSmrg# serial 2 911b8f75c19Smrg 9127e4fd55aSmrg# _AM_SUBST_NOTMAKE(VARIABLE) 9137e4fd55aSmrg# --------------------------- 9147e4fd55aSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. 9157e4fd55aSmrg# This macro is traced by Automake. 9167e4fd55aSmrgAC_DEFUN([_AM_SUBST_NOTMAKE]) 917b8f75c19Smrg 9187e4fd55aSmrg# AM_SUBST_NOTMAKE(VARIABLE) 9197e4fd55aSmrg# --------------------------- 9207e4fd55aSmrg# Public sister of _AM_SUBST_NOTMAKE. 9217e4fd55aSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) 922b8f75c19Smrg 9237e4fd55aSmrg# Check how to create a tarball. -*- Autoconf -*- 924b8f75c19Smrg 9257e4fd55aSmrg# Copyright (C) 2004, 2005 Free Software Foundation, Inc. 9267e4fd55aSmrg# 9277e4fd55aSmrg# This file is free software; the Free Software Foundation 9287e4fd55aSmrg# gives unlimited permission to copy and/or distribute it, 9297e4fd55aSmrg# with or without modifications, as long as this notice is preserved. 930b8f75c19Smrg 9317e4fd55aSmrg# serial 2 932b8f75c19Smrg 9337e4fd55aSmrg# _AM_PROG_TAR(FORMAT) 9347e4fd55aSmrg# -------------------- 9357e4fd55aSmrg# Check how to create a tarball in format FORMAT. 9367e4fd55aSmrg# FORMAT should be one of `v7', `ustar', or `pax'. 9377e4fd55aSmrg# 9387e4fd55aSmrg# Substitute a variable $(am__tar) that is a command 9397e4fd55aSmrg# writing to stdout a FORMAT-tarball containing the directory 9407e4fd55aSmrg# $tardir. 9417e4fd55aSmrg# tardir=directory && $(am__tar) > result.tar 9427e4fd55aSmrg# 9437e4fd55aSmrg# Substitute a variable $(am__untar) that extract such 9447e4fd55aSmrg# a tarball read from stdin. 9457e4fd55aSmrg# $(am__untar) < result.tar 9467e4fd55aSmrgAC_DEFUN([_AM_PROG_TAR], 9477e4fd55aSmrg[# Always define AMTAR for backward compatibility. 9487e4fd55aSmrgAM_MISSING_PROG([AMTAR], [tar]) 9497e4fd55aSmrgm4_if([$1], [v7], 9507e4fd55aSmrg [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], 9517e4fd55aSmrg [m4_case([$1], [ustar],, [pax],, 9527e4fd55aSmrg [m4_fatal([Unknown tar format])]) 9537e4fd55aSmrgAC_MSG_CHECKING([how to create a $1 tar archive]) 9547e4fd55aSmrg# Loop over all known methods to create a tar archive until one works. 9557e4fd55aSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' 9567e4fd55aSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools} 9577e4fd55aSmrg# Do not fold the above two line into one, because Tru64 sh and 9587e4fd55aSmrg# Solaris sh will not grok spaces in the rhs of `-'. 9597e4fd55aSmrgfor _am_tool in $_am_tools 9607e4fd55aSmrgdo 9617e4fd55aSmrg case $_am_tool in 9627e4fd55aSmrg gnutar) 9637e4fd55aSmrg for _am_tar in tar gnutar gtar; 9647e4fd55aSmrg do 9657e4fd55aSmrg AM_RUN_LOG([$_am_tar --version]) && break 9667e4fd55aSmrg done 9677e4fd55aSmrg am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' 9687e4fd55aSmrg am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' 9697e4fd55aSmrg am__untar="$_am_tar -xf -" 9707e4fd55aSmrg ;; 9717e4fd55aSmrg plaintar) 9727e4fd55aSmrg # Must skip GNU tar: if it does not support --format= it doesn't create 9737e4fd55aSmrg # ustar tarball either. 9747e4fd55aSmrg (tar --version) >/dev/null 2>&1 && continue 9757e4fd55aSmrg am__tar='tar chf - "$$tardir"' 9767e4fd55aSmrg am__tar_='tar chf - "$tardir"' 9777e4fd55aSmrg am__untar='tar xf -' 9787e4fd55aSmrg ;; 9797e4fd55aSmrg pax) 9807e4fd55aSmrg am__tar='pax -L -x $1 -w "$$tardir"' 9817e4fd55aSmrg am__tar_='pax -L -x $1 -w "$tardir"' 9827e4fd55aSmrg am__untar='pax -r' 9837e4fd55aSmrg ;; 9847e4fd55aSmrg cpio) 9857e4fd55aSmrg am__tar='find "$$tardir" -print | cpio -o -H $1 -L' 9867e4fd55aSmrg am__tar_='find "$tardir" -print | cpio -o -H $1 -L' 9877e4fd55aSmrg am__untar='cpio -i -H $1 -d' 9887e4fd55aSmrg ;; 9897e4fd55aSmrg none) 9907e4fd55aSmrg am__tar=false 9917e4fd55aSmrg am__tar_=false 9927e4fd55aSmrg am__untar=false 9937e4fd55aSmrg ;; 9947e4fd55aSmrg esac 995b8f75c19Smrg 9967e4fd55aSmrg # If the value was cached, stop now. We just wanted to have am__tar 9977e4fd55aSmrg # and am__untar set. 9987e4fd55aSmrg test -n "${am_cv_prog_tar_$1}" && break 999b8f75c19Smrg 10007e4fd55aSmrg # tar/untar a dummy directory, and stop if the command works 10017e4fd55aSmrg rm -rf conftest.dir 10027e4fd55aSmrg mkdir conftest.dir 10037e4fd55aSmrg echo GrepMe > conftest.dir/file 10047e4fd55aSmrg AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) 10057e4fd55aSmrg rm -rf conftest.dir 10067e4fd55aSmrg if test -s conftest.tar; then 10077e4fd55aSmrg AM_RUN_LOG([$am__untar <conftest.tar]) 10087e4fd55aSmrg grep GrepMe conftest.dir/file >/dev/null 2>&1 && break 10097e4fd55aSmrg fi 10107e4fd55aSmrgdone 10117e4fd55aSmrgrm -rf conftest.dir 1012b8f75c19Smrg 10137e4fd55aSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) 10147e4fd55aSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])]) 10157e4fd55aSmrgAC_SUBST([am__tar]) 10167e4fd55aSmrgAC_SUBST([am__untar]) 10177e4fd55aSmrg]) # _AM_PROG_TAR 1018b8f75c19Smrg 10197e4fd55aSmrgdnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. 1020b8f75c19Smrgdnl 10217e4fd55aSmrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. 1022b8f75c19Smrgdnl 10237e4fd55aSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a 10247e4fd55aSmrgdnl copy of this software and associated documentation files (the "Software"), 10257e4fd55aSmrgdnl to deal in the Software without restriction, including without limitation 10267e4fd55aSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense, 10277e4fd55aSmrgdnl and/or sell copies of the Software, and to permit persons to whom the 10287e4fd55aSmrgdnl Software is furnished to do so, subject to the following conditions: 10297e4fd55aSmrgdnl 10307e4fd55aSmrgdnl The above copyright notice and this permission notice (including the next 10317e4fd55aSmrgdnl paragraph) shall be included in all copies or substantial portions of the 10327e4fd55aSmrgdnl Software. 10337e4fd55aSmrgdnl 10347e4fd55aSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 10357e4fd55aSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 10367e4fd55aSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 10377e4fd55aSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 10387e4fd55aSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 10397e4fd55aSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 10407e4fd55aSmrgdnl DEALINGS IN THE SOFTWARE. 10417e4fd55aSmrg 10427e4fd55aSmrg# XORG_MACROS_VERSION(required-version) 10437e4fd55aSmrg# ------------------------------------- 10447e4fd55aSmrg# Minimum version: 1.1.0 10457e4fd55aSmrg# 10467e4fd55aSmrg# If you're using a macro added in Version 1.1 or newer, include this in 10477e4fd55aSmrg# your configure.ac with the minimum required version, such as: 10487e4fd55aSmrg# XORG_MACROS_VERSION(1.1) 10497e4fd55aSmrg# 10507e4fd55aSmrg# To ensure that this macro is defined, also add: 10517e4fd55aSmrg# m4_ifndef([XORG_MACROS_VERSION], 10527e4fd55aSmrg# [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])]) 10537e4fd55aSmrg# 10547e4fd55aSmrg# 10557e4fd55aSmrg# See the "minimum version" comment for each macro you use to see what 10567e4fd55aSmrg# version you require. 10577e4fd55aSmrgm4_defun([XORG_MACROS_VERSION],[ 10587e4fd55aSmrgm4_define([vers_have], [1.11.0]) 10597e4fd55aSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) 10607e4fd55aSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) 10617e4fd55aSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,, 10627e4fd55aSmrg [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])]) 10637e4fd55aSmrgm4_if(m4_version_compare(vers_have, [$1]), -1, 10647e4fd55aSmrg [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])]) 10657e4fd55aSmrgm4_undefine([vers_have]) 10667e4fd55aSmrgm4_undefine([maj_have]) 10677e4fd55aSmrgm4_undefine([maj_needed]) 10687e4fd55aSmrg]) # XORG_MACROS_VERSION 1069b8f75c19Smrg 1070b8f75c19Smrg# XORG_PROG_RAWCPP() 1071b8f75c19Smrg# ------------------ 10727e4fd55aSmrg# Minimum version: 1.0.0 10737e4fd55aSmrg# 1074b8f75c19Smrg# Find cpp program and necessary flags for use in pre-processing text files 1075b8f75c19Smrg# such as man pages and config files 1076b8f75c19SmrgAC_DEFUN([XORG_PROG_RAWCPP],[ 1077b8f75c19SmrgAC_REQUIRE([AC_PROG_CPP]) 1078b8f75c19SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 1079b8f75c19Smrg [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) 1080b8f75c19Smrg 1081b8f75c19Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined, 1082b8f75c19Smrg# which is not the best choice for supporting other OS'es, but covers most 1083b8f75c19Smrg# of the ones we need for now. 1084b8f75c19SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef]) 1085b8f75c19SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?]) 1086b8f75c19Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 1087b8f75c19Smrg AC_MSG_RESULT([no]) 1088b8f75c19Smrgelse 1089b8f75c19Smrg if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 1090b8f75c19Smrg RAWCPPFLAGS=-undef 1091b8f75c19Smrg AC_MSG_RESULT([yes]) 10927e4fd55aSmrg # under Cygwin unix is still defined even with -undef 10937e4fd55aSmrg elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 10947e4fd55aSmrg RAWCPPFLAGS="-undef -ansi" 10957e4fd55aSmrg AC_MSG_RESULT([yes, with -ansi]) 1096b8f75c19Smrg else 1097b8f75c19Smrg AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.]) 1098b8f75c19Smrg fi 1099b8f75c19Smrgfi 1100b8f75c19Smrgrm -f conftest.$ac_ext 1101b8f75c19Smrg 1102b8f75c19SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional]) 1103b8f75c19SmrgAC_LANG_CONFTEST([Does cpp preserve "whitespace"?]) 1104b8f75c19Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 1105b8f75c19Smrg AC_MSG_RESULT([no]) 1106b8f75c19Smrgelse 1107b8f75c19Smrg if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 1108b8f75c19Smrg RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" 1109b8f75c19Smrg AC_MSG_RESULT([yes]) 1110b8f75c19Smrg else 1111b8f75c19Smrg AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) 1112b8f75c19Smrg fi 1113b8f75c19Smrgfi 1114b8f75c19Smrgrm -f conftest.$ac_ext 1115b8f75c19SmrgAC_SUBST(RAWCPPFLAGS) 1116b8f75c19Smrg]) # XORG_PROG_RAWCPP 1117b8f75c19Smrg 1118b8f75c19Smrg# XORG_MANPAGE_SECTIONS() 1119b8f75c19Smrg# ----------------------- 11207e4fd55aSmrg# Minimum version: 1.0.0 11217e4fd55aSmrg# 1122b8f75c19Smrg# Determine which sections man pages go in for the different man page types 1123b8f75c19Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. 1124b8f75c19Smrg# Not sure if there's any better way than just hardcoding by OS name. 1125b8f75c19Smrg# Override default settings by setting environment variables 11267e4fd55aSmrg# Added MAN_SUBSTS in version 1.8 11277e4fd55aSmrg# Added AC_PROG_SED in version 1.8 1128b8f75c19Smrg 1129b8f75c19SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[ 1130b8f75c19SmrgAC_REQUIRE([AC_CANONICAL_HOST]) 11317e4fd55aSmrgAC_REQUIRE([AC_PROG_SED]) 1132b8f75c19Smrg 1133b8f75c19Smrgif test x$APP_MAN_SUFFIX = x ; then 11347e4fd55aSmrg APP_MAN_SUFFIX=1 1135b8f75c19Smrgfi 1136b8f75c19Smrgif test x$APP_MAN_DIR = x ; then 11377e4fd55aSmrg APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' 1138b8f75c19Smrgfi 1139b8f75c19Smrg 1140b8f75c19Smrgif test x$LIB_MAN_SUFFIX = x ; then 11417e4fd55aSmrg LIB_MAN_SUFFIX=3 1142b8f75c19Smrgfi 1143b8f75c19Smrgif test x$LIB_MAN_DIR = x ; then 11447e4fd55aSmrg LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' 1145b8f75c19Smrgfi 1146b8f75c19Smrg 1147b8f75c19Smrgif test x$FILE_MAN_SUFFIX = x ; then 1148b8f75c19Smrg case $host_os in 1149b8f75c19Smrg solaris*) FILE_MAN_SUFFIX=4 ;; 1150b8f75c19Smrg *) FILE_MAN_SUFFIX=5 ;; 1151b8f75c19Smrg esac 1152b8f75c19Smrgfi 1153b8f75c19Smrgif test x$FILE_MAN_DIR = x ; then 11547e4fd55aSmrg FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' 1155b8f75c19Smrgfi 1156b8f75c19Smrg 1157b8f75c19Smrgif test x$MISC_MAN_SUFFIX = x ; then 1158b8f75c19Smrg case $host_os in 1159b8f75c19Smrg solaris*) MISC_MAN_SUFFIX=5 ;; 1160b8f75c19Smrg *) MISC_MAN_SUFFIX=7 ;; 1161b8f75c19Smrg esac 1162b8f75c19Smrgfi 1163b8f75c19Smrgif test x$MISC_MAN_DIR = x ; then 11647e4fd55aSmrg MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' 1165b8f75c19Smrgfi 1166b8f75c19Smrg 1167b8f75c19Smrgif test x$DRIVER_MAN_SUFFIX = x ; then 1168b8f75c19Smrg case $host_os in 1169b8f75c19Smrg solaris*) DRIVER_MAN_SUFFIX=7 ;; 1170b8f75c19Smrg *) DRIVER_MAN_SUFFIX=4 ;; 1171b8f75c19Smrg esac 1172b8f75c19Smrgfi 1173b8f75c19Smrgif test x$DRIVER_MAN_DIR = x ; then 11747e4fd55aSmrg DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' 1175b8f75c19Smrgfi 1176b8f75c19Smrg 1177b8f75c19Smrgif test x$ADMIN_MAN_SUFFIX = x ; then 1178b8f75c19Smrg case $host_os in 1179b8f75c19Smrg solaris*) ADMIN_MAN_SUFFIX=1m ;; 1180b8f75c19Smrg *) ADMIN_MAN_SUFFIX=8 ;; 1181b8f75c19Smrg esac 1182b8f75c19Smrgfi 1183b8f75c19Smrgif test x$ADMIN_MAN_DIR = x ; then 1184b8f75c19Smrg ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' 1185b8f75c19Smrgfi 1186b8f75c19Smrg 1187b8f75c19Smrg 1188b8f75c19SmrgAC_SUBST([APP_MAN_SUFFIX]) 1189b8f75c19SmrgAC_SUBST([LIB_MAN_SUFFIX]) 1190b8f75c19SmrgAC_SUBST([FILE_MAN_SUFFIX]) 1191b8f75c19SmrgAC_SUBST([MISC_MAN_SUFFIX]) 1192b8f75c19SmrgAC_SUBST([DRIVER_MAN_SUFFIX]) 1193b8f75c19SmrgAC_SUBST([ADMIN_MAN_SUFFIX]) 1194b8f75c19SmrgAC_SUBST([APP_MAN_DIR]) 1195b8f75c19SmrgAC_SUBST([LIB_MAN_DIR]) 1196b8f75c19SmrgAC_SUBST([FILE_MAN_DIR]) 1197b8f75c19SmrgAC_SUBST([MISC_MAN_DIR]) 1198b8f75c19SmrgAC_SUBST([DRIVER_MAN_DIR]) 1199b8f75c19SmrgAC_SUBST([ADMIN_MAN_DIR]) 12007e4fd55aSmrg 12017e4fd55aSmrgXORG_MAN_PAGE="X Version 11" 12027e4fd55aSmrgAC_SUBST([XORG_MAN_PAGE]) 12037e4fd55aSmrgMAN_SUBSTS="\ 12047e4fd55aSmrg -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ 12057e4fd55aSmrg -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ 12067e4fd55aSmrg -e 's|__xservername__|Xorg|g' \ 12077e4fd55aSmrg -e 's|__xconfigfile__|xorg.conf|g' \ 12087e4fd55aSmrg -e 's|__projectroot__|\$(prefix)|g' \ 12097e4fd55aSmrg -e 's|__apploaddir__|\$(appdefaultdir)|g' \ 12107e4fd55aSmrg -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \ 12117e4fd55aSmrg -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \ 12127e4fd55aSmrg -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \ 12137e4fd55aSmrg -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \ 12147e4fd55aSmrg -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \ 12157e4fd55aSmrg -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'" 12167e4fd55aSmrgAC_SUBST([MAN_SUBSTS]) 12177e4fd55aSmrg 1218b8f75c19Smrg]) # XORG_MANPAGE_SECTIONS 1219b8f75c19Smrg 12207e4fd55aSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION]) 12217e4fd55aSmrg# ------------------------ 12227e4fd55aSmrg# Minimum version: 1.7.0 12237e4fd55aSmrg# 12247e4fd55aSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent 12257e4fd55aSmrg# provided by xorg-sgml-doctools, if installed. 12267e4fd55aSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[ 12277e4fd55aSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])]) 12287e4fd55aSmrgXORG_SGML_PATH= 12297e4fd55aSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])], 12307e4fd55aSmrg [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`], 12317e4fd55aSmrg [m4_ifval([$1],[:], 12327e4fd55aSmrg [if test x"$cross_compiling" != x"yes" ; then 12337e4fd55aSmrg AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent], 12347e4fd55aSmrg [XORG_SGML_PATH=$prefix/share/sgml]) 12357e4fd55aSmrg fi]) 12367e4fd55aSmrg ]) 12377e4fd55aSmrg 12387e4fd55aSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing 12397e4fd55aSmrg# the path and the name of the doc stylesheet 12407e4fd55aSmrgif test "x$XORG_SGML_PATH" != "x" ; then 12417e4fd55aSmrg AC_MSG_RESULT([$XORG_SGML_PATH]) 12427e4fd55aSmrg STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11 12437e4fd55aSmrg XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl 12447e4fd55aSmrgelse 12457e4fd55aSmrg AC_MSG_RESULT([no]) 12467e4fd55aSmrgfi 12477e4fd55aSmrg 12487e4fd55aSmrgAC_SUBST(XORG_SGML_PATH) 12497e4fd55aSmrgAC_SUBST(STYLESHEET_SRCDIR) 12507e4fd55aSmrgAC_SUBST(XSL_STYLESHEET) 12517e4fd55aSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"]) 12527e4fd55aSmrg]) # XORG_CHECK_SGML_DOCTOOLS 12537e4fd55aSmrg 1254b8f75c19Smrg# XORG_CHECK_LINUXDOC 1255b8f75c19Smrg# ------------------- 12567e4fd55aSmrg# Minimum version: 1.0.0 12577e4fd55aSmrg# 1258b8f75c19Smrg# Defines the variable MAKE_TEXT if the necessary tools and 1259b8f75c19Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. 1260b8f75c19Smrg# Whether or not the necessary tools and files are found can be checked 1261b8f75c19Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC" 1262b8f75c19SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[ 12637e4fd55aSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) 12647e4fd55aSmrgAC_REQUIRE([XORG_WITH_PS2PDF]) 1265b8f75c19Smrg 1266b8f75c19SmrgAC_PATH_PROG(LINUXDOC, linuxdoc) 1267b8f75c19Smrg 12687e4fd55aSmrgAC_MSG_CHECKING([whether to build documentation]) 1269b8f75c19Smrg 12707e4fd55aSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then 1271b8f75c19Smrg BUILDDOC=yes 1272b8f75c19Smrgelse 12737e4fd55aSmrg BUILDDOC=no 12747e4fd55aSmrgfi 12757e4fd55aSmrg 12767e4fd55aSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) 12777e4fd55aSmrg 12787e4fd55aSmrgAC_MSG_RESULT([$BUILDDOC]) 12797e4fd55aSmrg 12807e4fd55aSmrgAC_MSG_CHECKING([whether to build pdf documentation]) 12817e4fd55aSmrg 12827e4fd55aSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then 12837e4fd55aSmrg BUILDPDFDOC=yes 12847e4fd55aSmrgelse 12857e4fd55aSmrg BUILDPDFDOC=no 12867e4fd55aSmrgfi 12877e4fd55aSmrg 12887e4fd55aSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 12897e4fd55aSmrg 12907e4fd55aSmrgAC_MSG_RESULT([$BUILDPDFDOC]) 12917e4fd55aSmrg 12927e4fd55aSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f" 12937e4fd55aSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps" 12947e4fd55aSmrgMAKE_PDF="$PS2PDF" 12957e4fd55aSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0" 12967e4fd55aSmrg 12977e4fd55aSmrgAC_SUBST(MAKE_TEXT) 12987e4fd55aSmrgAC_SUBST(MAKE_PS) 12997e4fd55aSmrgAC_SUBST(MAKE_PDF) 13007e4fd55aSmrgAC_SUBST(MAKE_HTML) 13017e4fd55aSmrg]) # XORG_CHECK_LINUXDOC 13027e4fd55aSmrg 13037e4fd55aSmrg# XORG_CHECK_DOCBOOK 13047e4fd55aSmrg# ------------------- 13057e4fd55aSmrg# Minimum version: 1.0.0 13067e4fd55aSmrg# 13077e4fd55aSmrg# Checks for the ability to build output formats from SGML DocBook source. 13087e4fd55aSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC" 13097e4fd55aSmrg# indicates whether the necessary tools and files are found and, if set, 13107e4fd55aSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx. 13117e4fd55aSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[ 13127e4fd55aSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) 13137e4fd55aSmrg 13147e4fd55aSmrgBUILDTXTDOC=no 13157e4fd55aSmrgBUILDPDFDOC=no 13167e4fd55aSmrgBUILDPSDOC=no 13177e4fd55aSmrgBUILDHTMLDOC=no 13187e4fd55aSmrg 13197e4fd55aSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps) 13207e4fd55aSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf) 13217e4fd55aSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html) 13227e4fd55aSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt) 13237e4fd55aSmrg 13247e4fd55aSmrgAC_MSG_CHECKING([whether to build text documentation]) 13257e4fd55aSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x && 13267e4fd55aSmrg test x$BUILD_TXTDOC != xno; then 13277e4fd55aSmrg BUILDTXTDOC=yes 13287e4fd55aSmrgfi 13297e4fd55aSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes]) 13307e4fd55aSmrgAC_MSG_RESULT([$BUILDTXTDOC]) 13317e4fd55aSmrg 13327e4fd55aSmrgAC_MSG_CHECKING([whether to build PDF documentation]) 13337e4fd55aSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x && 13347e4fd55aSmrg test x$BUILD_PDFDOC != xno; then 13357e4fd55aSmrg BUILDPDFDOC=yes 13367e4fd55aSmrgfi 13377e4fd55aSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 13387e4fd55aSmrgAC_MSG_RESULT([$BUILDPDFDOC]) 13397e4fd55aSmrg 13407e4fd55aSmrgAC_MSG_CHECKING([whether to build PostScript documentation]) 13417e4fd55aSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x && 13427e4fd55aSmrg test x$BUILD_PSDOC != xno; then 13437e4fd55aSmrg BUILDPSDOC=yes 13447e4fd55aSmrgfi 13457e4fd55aSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes]) 13467e4fd55aSmrgAC_MSG_RESULT([$BUILDPSDOC]) 13477e4fd55aSmrg 13487e4fd55aSmrgAC_MSG_CHECKING([whether to build HTML documentation]) 13497e4fd55aSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x && 13507e4fd55aSmrg test x$BUILD_HTMLDOC != xno; then 13517e4fd55aSmrg BUILDHTMLDOC=yes 13527e4fd55aSmrgfi 13537e4fd55aSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes]) 13547e4fd55aSmrgAC_MSG_RESULT([$BUILDHTMLDOC]) 13557e4fd55aSmrg 13567e4fd55aSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT" 13577e4fd55aSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS" 13587e4fd55aSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF" 13597e4fd55aSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML" 13607e4fd55aSmrg 13617e4fd55aSmrgAC_SUBST(MAKE_TEXT) 13627e4fd55aSmrgAC_SUBST(MAKE_PS) 13637e4fd55aSmrgAC_SUBST(MAKE_PDF) 13647e4fd55aSmrgAC_SUBST(MAKE_HTML) 13657e4fd55aSmrg]) # XORG_CHECK_DOCBOOK 13667e4fd55aSmrg 13677e4fd55aSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT]) 13687e4fd55aSmrg# ---------------- 13697e4fd55aSmrg# Minimum version: 1.5.0 13707e4fd55aSmrg# Minimum version for optional DEFAULT argument: 1.11.0 13717e4fd55aSmrg# 13727e4fd55aSmrg# Documentation tools are not always available on all platforms and sometimes 13737e4fd55aSmrg# not at the appropriate level. This macro enables a module to test for the 13747e4fd55aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with 13757e4fd55aSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions 13767e4fd55aSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified, 13777e4fd55aSmrg# --with-xmlto assumes 'auto'. 13787e4fd55aSmrg# 13797e4fd55aSmrg# Interface to module: 13807e4fd55aSmrg# HAVE_XMLTO: used in makefiles to conditionally generate documentation 13817e4fd55aSmrg# XMLTO: returns the path of the xmlto program found 13827e4fd55aSmrg# returns the path set by the user in the environment 13837e4fd55aSmrg# --with-xmlto: 'yes' user instructs the module to use xmlto 13847e4fd55aSmrg# 'no' user instructs the module not to use xmlto 13857e4fd55aSmrg# 13867e4fd55aSmrg# Added in version 1.10.0 13877e4fd55aSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation 13887e4fd55aSmrg# xmlto for text output requires either lynx, links, or w3m browsers 13897e4fd55aSmrg# 13907e4fd55aSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path. 13917e4fd55aSmrg# 13927e4fd55aSmrgAC_DEFUN([XORG_WITH_XMLTO],[ 13937e4fd55aSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command]) 13947e4fd55aSmrgm4_define([_defopt], m4_default([$2], [auto])) 13957e4fd55aSmrgAC_ARG_WITH(xmlto, 13967e4fd55aSmrg AS_HELP_STRING([--with-xmlto], 13977e4fd55aSmrg [Use xmlto to regenerate documentation (default: ]_defopt[)]), 13987e4fd55aSmrg [use_xmlto=$withval], [use_xmlto=]_defopt) 13997e4fd55aSmrgm4_undefine([_defopt]) 14007e4fd55aSmrg 14017e4fd55aSmrgif test "x$use_xmlto" = x"auto"; then 14027e4fd55aSmrg AC_PATH_PROG([XMLTO], [xmlto]) 14037e4fd55aSmrg if test "x$XMLTO" = "x"; then 14047e4fd55aSmrg AC_MSG_WARN([xmlto not found - documentation targets will be skipped]) 14057e4fd55aSmrg have_xmlto=no 14067e4fd55aSmrg else 14077e4fd55aSmrg have_xmlto=yes 14087e4fd55aSmrg fi 14097e4fd55aSmrgelif test "x$use_xmlto" = x"yes" ; then 14107e4fd55aSmrg AC_PATH_PROG([XMLTO], [xmlto]) 14117e4fd55aSmrg if test "x$XMLTO" = "x"; then 14127e4fd55aSmrg AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH]) 14137e4fd55aSmrg fi 14147e4fd55aSmrg have_xmlto=yes 14157e4fd55aSmrgelif test "x$use_xmlto" = x"no" ; then 14167e4fd55aSmrg if test "x$XMLTO" != "x"; then 14177e4fd55aSmrg AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified]) 14187e4fd55aSmrg fi 14197e4fd55aSmrg have_xmlto=no 14207e4fd55aSmrgelse 14217e4fd55aSmrg AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no']) 14227e4fd55aSmrgfi 14237e4fd55aSmrg 14247e4fd55aSmrg# Test for a minimum version of xmlto, if provided. 14257e4fd55aSmrgm4_ifval([$1], 14267e4fd55aSmrg[if test "$have_xmlto" = yes; then 14277e4fd55aSmrg # scrape the xmlto version 14287e4fd55aSmrg AC_MSG_CHECKING([the xmlto version]) 14297e4fd55aSmrg xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3` 14307e4fd55aSmrg AC_MSG_RESULT([$xmlto_version]) 14317e4fd55aSmrg AS_VERSION_COMPARE([$xmlto_version], [$1], 14327e4fd55aSmrg [if test "x$use_xmlto" = xauto; then 14337e4fd55aSmrg AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed]) 14347e4fd55aSmrg have_xmlto=no 14357e4fd55aSmrg else 14367e4fd55aSmrg AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed]) 14377e4fd55aSmrg fi]) 14387e4fd55aSmrgfi]) 14397e4fd55aSmrg 14407e4fd55aSmrg# Test for the ability of xmlto to generate a text target 14417e4fd55aSmrghave_xmlto_text=no 14427e4fd55aSmrgcat > conftest.xml << "EOF" 14437e4fd55aSmrgEOF 14447e4fd55aSmrgAS_IF([test "$have_xmlto" = yes], 14457e4fd55aSmrg [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1], 14467e4fd55aSmrg [have_xmlto_text=yes], 14477e4fd55aSmrg [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])]) 14487e4fd55aSmrgrm -f conftest.xml 14497e4fd55aSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes]) 14507e4fd55aSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes]) 14517e4fd55aSmrg]) # XORG_WITH_XMLTO 14527e4fd55aSmrg 14537e4fd55aSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT]) 14547e4fd55aSmrg# ---------------- 14557e4fd55aSmrg# Minimum version: 1.5.0 14567e4fd55aSmrg# Minimum version for optional DEFAULT argument: 1.11.0 14577e4fd55aSmrg# 14587e4fd55aSmrg# Documentation tools are not always available on all platforms and sometimes 14597e4fd55aSmrg# not at the appropriate level. This macro enables a module to test for the 14607e4fd55aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with 14617e4fd55aSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions 14627e4fd55aSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified, 14637e4fd55aSmrg# --with-asciidoc assumes 'auto'. 14647e4fd55aSmrg# 14657e4fd55aSmrg# Interface to module: 14667e4fd55aSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation 14677e4fd55aSmrg# ASCIIDOC: returns the path of the asciidoc program found 14687e4fd55aSmrg# returns the path set by the user in the environment 14697e4fd55aSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc 14707e4fd55aSmrg# 'no' user instructs the module not to use asciidoc 14717e4fd55aSmrg# 14727e4fd55aSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path. 14737e4fd55aSmrg# 14747e4fd55aSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[ 14757e4fd55aSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command]) 14767e4fd55aSmrgm4_define([_defopt], m4_default([$2], [auto])) 14777e4fd55aSmrgAC_ARG_WITH(asciidoc, 14787e4fd55aSmrg AS_HELP_STRING([--with-asciidoc], 14797e4fd55aSmrg [Use asciidoc to regenerate documentation (default: ]_defopt[)]), 14807e4fd55aSmrg [use_asciidoc=$withval], [use_asciidoc=]_defopt) 14817e4fd55aSmrgm4_undefine([_defopt]) 14827e4fd55aSmrg 14837e4fd55aSmrgif test "x$use_asciidoc" = x"auto"; then 14847e4fd55aSmrg AC_PATH_PROG([ASCIIDOC], [asciidoc]) 14857e4fd55aSmrg if test "x$ASCIIDOC" = "x"; then 14867e4fd55aSmrg AC_MSG_WARN([asciidoc not found - documentation targets will be skipped]) 14877e4fd55aSmrg have_asciidoc=no 14887e4fd55aSmrg else 14897e4fd55aSmrg have_asciidoc=yes 14907e4fd55aSmrg fi 14917e4fd55aSmrgelif test "x$use_asciidoc" = x"yes" ; then 14927e4fd55aSmrg AC_PATH_PROG([ASCIIDOC], [asciidoc]) 14937e4fd55aSmrg if test "x$ASCIIDOC" = "x"; then 14947e4fd55aSmrg AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH]) 14957e4fd55aSmrg fi 14967e4fd55aSmrg have_asciidoc=yes 14977e4fd55aSmrgelif test "x$use_asciidoc" = x"no" ; then 14987e4fd55aSmrg if test "x$ASCIIDOC" != "x"; then 14997e4fd55aSmrg AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified]) 15007e4fd55aSmrg fi 15017e4fd55aSmrg have_asciidoc=no 15027e4fd55aSmrgelse 15037e4fd55aSmrg AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no']) 15047e4fd55aSmrgfi 15057e4fd55aSmrgm4_ifval([$1], 15067e4fd55aSmrg[if test "$have_asciidoc" = yes; then 15077e4fd55aSmrg # scrape the asciidoc version 15087e4fd55aSmrg AC_MSG_CHECKING([the asciidoc version]) 15097e4fd55aSmrg asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2` 15107e4fd55aSmrg AC_MSG_RESULT([$asciidoc_version]) 15117e4fd55aSmrg AS_VERSION_COMPARE([$asciidoc_version], [$1], 15127e4fd55aSmrg [if test "x$use_asciidoc" = xauto; then 15137e4fd55aSmrg AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed]) 15147e4fd55aSmrg have_asciidoc=no 15157e4fd55aSmrg else 15167e4fd55aSmrg AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed]) 15177e4fd55aSmrg fi]) 15187e4fd55aSmrgfi]) 15197e4fd55aSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes]) 15207e4fd55aSmrg]) # XORG_WITH_ASCIIDOC 15217e4fd55aSmrg 15227e4fd55aSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT]) 15237e4fd55aSmrg# -------------------------------- 15247e4fd55aSmrg# Minimum version: 1.5.0 15257e4fd55aSmrg# Minimum version for optional DEFAULT argument: 1.11.0 15267e4fd55aSmrg# 15277e4fd55aSmrg# Documentation tools are not always available on all platforms and sometimes 15287e4fd55aSmrg# not at the appropriate level. This macro enables a module to test for the 15297e4fd55aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with 15307e4fd55aSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions 15317e4fd55aSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified, 15327e4fd55aSmrg# --with-doxygen assumes 'auto'. 15337e4fd55aSmrg# 15347e4fd55aSmrg# Interface to module: 15357e4fd55aSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation 15367e4fd55aSmrg# DOXYGEN: returns the path of the doxygen program found 15377e4fd55aSmrg# returns the path set by the user in the environment 15387e4fd55aSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen 15397e4fd55aSmrg# 'no' user instructs the module not to use doxygen 15407e4fd55aSmrg# 15417e4fd55aSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path. 15427e4fd55aSmrg# 15437e4fd55aSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[ 15447e4fd55aSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command]) 15457e4fd55aSmrgm4_define([_defopt], m4_default([$2], [auto])) 15467e4fd55aSmrgAC_ARG_WITH(doxygen, 15477e4fd55aSmrg AS_HELP_STRING([--with-doxygen], 15487e4fd55aSmrg [Use doxygen to regenerate documentation (default: ]_defopt[)]), 15497e4fd55aSmrg [use_doxygen=$withval], [use_doxygen=]_defopt) 15507e4fd55aSmrgm4_undefine([_defopt]) 15517e4fd55aSmrg 15527e4fd55aSmrgif test "x$use_doxygen" = x"auto"; then 15537e4fd55aSmrg AC_PATH_PROG([DOXYGEN], [doxygen]) 15547e4fd55aSmrg if test "x$DOXYGEN" = "x"; then 15557e4fd55aSmrg AC_MSG_WARN([doxygen not found - documentation targets will be skipped]) 15567e4fd55aSmrg have_doxygen=no 15577e4fd55aSmrg else 15587e4fd55aSmrg have_doxygen=yes 15597e4fd55aSmrg fi 15607e4fd55aSmrgelif test "x$use_doxygen" = x"yes" ; then 15617e4fd55aSmrg AC_PATH_PROG([DOXYGEN], [doxygen]) 15627e4fd55aSmrg if test "x$DOXYGEN" = "x"; then 15637e4fd55aSmrg AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH]) 15647e4fd55aSmrg fi 15657e4fd55aSmrg have_doxygen=yes 15667e4fd55aSmrgelif test "x$use_doxygen" = x"no" ; then 15677e4fd55aSmrg if test "x$DOXYGEN" != "x"; then 15687e4fd55aSmrg AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified]) 15697e4fd55aSmrg fi 15707e4fd55aSmrg have_doxygen=no 15717e4fd55aSmrgelse 15727e4fd55aSmrg AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no']) 1573b8f75c19Smrgfi 15747e4fd55aSmrgm4_ifval([$1], 15757e4fd55aSmrg[if test "$have_doxygen" = yes; then 15767e4fd55aSmrg # scrape the doxygen version 15777e4fd55aSmrg AC_MSG_CHECKING([the doxygen version]) 15787e4fd55aSmrg doxygen_version=`$DOXYGEN --version 2>/dev/null` 15797e4fd55aSmrg AC_MSG_RESULT([$doxygen_version]) 15807e4fd55aSmrg AS_VERSION_COMPARE([$doxygen_version], [$1], 15817e4fd55aSmrg [if test "x$use_doxygen" = xauto; then 15827e4fd55aSmrg AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed]) 15837e4fd55aSmrg have_doxygen=no 15847e4fd55aSmrg else 15857e4fd55aSmrg AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed]) 15867e4fd55aSmrg fi]) 15877e4fd55aSmrgfi]) 15887e4fd55aSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes]) 15897e4fd55aSmrg]) # XORG_WITH_DOXYGEN 1590b8f75c19Smrg 15917e4fd55aSmrg# XORG_WITH_GROFF([DEFAULT]) 15927e4fd55aSmrg# ---------------- 15937e4fd55aSmrg# Minimum version: 1.6.0 15947e4fd55aSmrg# Minimum version for optional DEFAULT argument: 1.11.0 15957e4fd55aSmrg# 15967e4fd55aSmrg# Documentation tools are not always available on all platforms and sometimes 15977e4fd55aSmrg# not at the appropriate level. This macro enables a module to test for the 15987e4fd55aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with 15997e4fd55aSmrg# the --with-groff option, it allows maximum flexibilty in making decisions 16007e4fd55aSmrg# as whether or not to use the groff package. When DEFAULT is not specified, 16017e4fd55aSmrg# --with-groff assumes 'auto'. 16027e4fd55aSmrg# 16037e4fd55aSmrg# Interface to module: 16047e4fd55aSmrg# HAVE_GROFF: used in makefiles to conditionally generate documentation 16057e4fd55aSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package 16067e4fd55aSmrg# HAVE_GROFF_MS: the -ms macros package 16077e4fd55aSmrg# GROFF: returns the path of the groff program found 16087e4fd55aSmrg# returns the path set by the user in the environment 16097e4fd55aSmrg# --with-groff: 'yes' user instructs the module to use groff 16107e4fd55aSmrg# 'no' user instructs the module not to use groff 16117e4fd55aSmrg# 16127e4fd55aSmrg# Added in version 1.9.0: 16137e4fd55aSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format: 16147e4fd55aSmrg# pnmcut pnmcrop pnmtopng pnmtops from the netpbm package. 16157e4fd55aSmrg# psselect from the psutils package. 16167e4fd55aSmrg# the ghostcript package. Refer to the grohtml man pages 16177e4fd55aSmrg# 16187e4fd55aSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path. 16197e4fd55aSmrg# 16207e4fd55aSmrg# OS and distros often splits groff in a basic and full package, the former 16217e4fd55aSmrg# having the groff program and the later having devices, fonts and macros 16227e4fd55aSmrg# Checking for the groff executable is not enough. 16237e4fd55aSmrg# 16247e4fd55aSmrg# If macros are missing, we cannot assume that groff is useless, so we don't 16257e4fd55aSmrg# unset HAVE_GROFF or GROFF env variables. 16267e4fd55aSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false. 16277e4fd55aSmrg# 16287e4fd55aSmrgAC_DEFUN([XORG_WITH_GROFF],[ 16297e4fd55aSmrgAC_ARG_VAR([GROFF], [Path to groff command]) 16307e4fd55aSmrgm4_define([_defopt], m4_default([$1], [auto])) 16317e4fd55aSmrgAC_ARG_WITH(groff, 16327e4fd55aSmrg AS_HELP_STRING([--with-groff], 16337e4fd55aSmrg [Use groff to regenerate documentation (default: ]_defopt[)]), 16347e4fd55aSmrg [use_groff=$withval], [use_groff=]_defopt) 16357e4fd55aSmrgm4_undefine([_defopt]) 16367e4fd55aSmrg 16377e4fd55aSmrgif test "x$use_groff" = x"auto"; then 16387e4fd55aSmrg AC_PATH_PROG([GROFF], [groff]) 16397e4fd55aSmrg if test "x$GROFF" = "x"; then 16407e4fd55aSmrg AC_MSG_WARN([groff not found - documentation targets will be skipped]) 16417e4fd55aSmrg have_groff=no 16427e4fd55aSmrg else 16437e4fd55aSmrg have_groff=yes 16447e4fd55aSmrg fi 16457e4fd55aSmrgelif test "x$use_groff" = x"yes" ; then 16467e4fd55aSmrg AC_PATH_PROG([GROFF], [groff]) 16477e4fd55aSmrg if test "x$GROFF" = "x"; then 16487e4fd55aSmrg AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH]) 16497e4fd55aSmrg fi 16507e4fd55aSmrg have_groff=yes 16517e4fd55aSmrgelif test "x$use_groff" = x"no" ; then 16527e4fd55aSmrg if test "x$GROFF" != "x"; then 16537e4fd55aSmrg AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified]) 16547e4fd55aSmrg fi 16557e4fd55aSmrg have_groff=no 16567e4fd55aSmrgelse 16577e4fd55aSmrg AC_MSG_ERROR([--with-groff expects 'yes' or 'no']) 16587e4fd55aSmrgfi 1659b8f75c19Smrg 16607e4fd55aSmrg# We have groff, test for the presence of the macro packages 16617e4fd55aSmrgif test "x$have_groff" = x"yes"; then 16627e4fd55aSmrg AC_MSG_CHECKING([for ${GROFF} -ms macros]) 16637e4fd55aSmrg if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then 16647e4fd55aSmrg groff_ms_works=yes 16657e4fd55aSmrg else 16667e4fd55aSmrg groff_ms_works=no 16677e4fd55aSmrg fi 16687e4fd55aSmrg AC_MSG_RESULT([$groff_ms_works]) 16697e4fd55aSmrg AC_MSG_CHECKING([for ${GROFF} -mm macros]) 16707e4fd55aSmrg if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then 16717e4fd55aSmrg groff_mm_works=yes 16727e4fd55aSmrg else 16737e4fd55aSmrg groff_mm_works=no 16747e4fd55aSmrg fi 16757e4fd55aSmrg AC_MSG_RESULT([$groff_mm_works]) 16767e4fd55aSmrgfi 1677b8f75c19Smrg 16787e4fd55aSmrg# We have groff, test for HTML dependencies, one command per package 16797e4fd55aSmrgif test "x$have_groff" = x"yes"; then 16807e4fd55aSmrg AC_PATH_PROGS(GS_PATH, [gs gswin32c]) 16817e4fd55aSmrg AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng]) 16827e4fd55aSmrg AC_PATH_PROG(PSSELECT_PATH, [psselect]) 16837e4fd55aSmrg if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then 16847e4fd55aSmrg have_groff_html=yes 16857e4fd55aSmrg else 16867e4fd55aSmrg have_groff_html=no 16877e4fd55aSmrg AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages]) 16887e4fd55aSmrg fi 16897e4fd55aSmrgfi 1690b8f75c19Smrg 16917e4fd55aSmrg# Set Automake conditionals for Makefiles 16927e4fd55aSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes]) 16937e4fd55aSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes]) 16947e4fd55aSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes]) 16957e4fd55aSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes]) 16967e4fd55aSmrg]) # XORG_WITH_GROFF 16977e4fd55aSmrg 16987e4fd55aSmrg# XORG_WITH_FOP([DEFAULT]) 16997e4fd55aSmrg# ---------------- 17007e4fd55aSmrg# Minimum version: 1.6.0 17017e4fd55aSmrg# Minimum version for optional DEFAULT argument: 1.11.0 17027e4fd55aSmrg# 17037e4fd55aSmrg# Documentation tools are not always available on all platforms and sometimes 17047e4fd55aSmrg# not at the appropriate level. This macro enables a module to test for the 17057e4fd55aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with 17067e4fd55aSmrg# the --with-fop option, it allows maximum flexibilty in making decisions 17077e4fd55aSmrg# as whether or not to use the fop package. When DEFAULT is not specified, 17087e4fd55aSmrg# --with-fop assumes 'auto'. 17097e4fd55aSmrg# 17107e4fd55aSmrg# Interface to module: 17117e4fd55aSmrg# HAVE_FOP: used in makefiles to conditionally generate documentation 17127e4fd55aSmrg# FOP: returns the path of the fop program found 17137e4fd55aSmrg# returns the path set by the user in the environment 17147e4fd55aSmrg# --with-fop: 'yes' user instructs the module to use fop 17157e4fd55aSmrg# 'no' user instructs the module not to use fop 17167e4fd55aSmrg# 17177e4fd55aSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path. 17187e4fd55aSmrg# 17197e4fd55aSmrgAC_DEFUN([XORG_WITH_FOP],[ 17207e4fd55aSmrgAC_ARG_VAR([FOP], [Path to fop command]) 17217e4fd55aSmrgm4_define([_defopt], m4_default([$1], [auto])) 17227e4fd55aSmrgAC_ARG_WITH(fop, 17237e4fd55aSmrg AS_HELP_STRING([--with-fop], 17247e4fd55aSmrg [Use fop to regenerate documentation (default: ]_defopt[)]), 17257e4fd55aSmrg [use_fop=$withval], [use_fop=]_defopt) 17267e4fd55aSmrgm4_undefine([_defopt]) 17277e4fd55aSmrg 17287e4fd55aSmrgif test "x$use_fop" = x"auto"; then 17297e4fd55aSmrg AC_PATH_PROG([FOP], [fop]) 17307e4fd55aSmrg if test "x$FOP" = "x"; then 17317e4fd55aSmrg AC_MSG_WARN([fop not found - documentation targets will be skipped]) 17327e4fd55aSmrg have_fop=no 17337e4fd55aSmrg else 17347e4fd55aSmrg have_fop=yes 17357e4fd55aSmrg fi 17367e4fd55aSmrgelif test "x$use_fop" = x"yes" ; then 17377e4fd55aSmrg AC_PATH_PROG([FOP], [fop]) 17387e4fd55aSmrg if test "x$FOP" = "x"; then 17397e4fd55aSmrg AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH]) 17407e4fd55aSmrg fi 17417e4fd55aSmrg have_fop=yes 17427e4fd55aSmrgelif test "x$use_fop" = x"no" ; then 17437e4fd55aSmrg if test "x$FOP" != "x"; then 17447e4fd55aSmrg AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified]) 17457e4fd55aSmrg fi 17467e4fd55aSmrg have_fop=no 1747b8f75c19Smrgelse 17487e4fd55aSmrg AC_MSG_ERROR([--with-fop expects 'yes' or 'no']) 1749b8f75c19Smrgfi 17507e4fd55aSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes]) 17517e4fd55aSmrg]) # XORG_WITH_FOP 1752b8f75c19Smrg 17537e4fd55aSmrg# XORG_WITH_PS2PDF([DEFAULT]) 17547e4fd55aSmrg# ---------------- 17557e4fd55aSmrg# Minimum version: 1.6.0 17567e4fd55aSmrg# Minimum version for optional DEFAULT argument: 1.11.0 17577e4fd55aSmrg# 17587e4fd55aSmrg# Documentation tools are not always available on all platforms and sometimes 17597e4fd55aSmrg# not at the appropriate level. This macro enables a module to test for the 17607e4fd55aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with 17617e4fd55aSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions 17627e4fd55aSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified, 17637e4fd55aSmrg# --with-ps2pdf assumes 'auto'. 17647e4fd55aSmrg# 17657e4fd55aSmrg# Interface to module: 17667e4fd55aSmrg# HAVE_PS2PDF: used in makefiles to conditionally generate documentation 17677e4fd55aSmrg# PS2PDF: returns the path of the ps2pdf program found 17687e4fd55aSmrg# returns the path set by the user in the environment 17697e4fd55aSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf 17707e4fd55aSmrg# 'no' user instructs the module not to use ps2pdf 17717e4fd55aSmrg# 17727e4fd55aSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path. 17737e4fd55aSmrg# 17747e4fd55aSmrgAC_DEFUN([XORG_WITH_PS2PDF],[ 17757e4fd55aSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command]) 17767e4fd55aSmrgm4_define([_defopt], m4_default([$1], [auto])) 17777e4fd55aSmrgAC_ARG_WITH(ps2pdf, 17787e4fd55aSmrg AS_HELP_STRING([--with-ps2pdf], 17797e4fd55aSmrg [Use ps2pdf to regenerate documentation (default: ]_defopt[)]), 17807e4fd55aSmrg [use_ps2pdf=$withval], [use_ps2pdf=]_defopt) 17817e4fd55aSmrgm4_undefine([_defopt]) 17827e4fd55aSmrg 17837e4fd55aSmrgif test "x$use_ps2pdf" = x"auto"; then 17847e4fd55aSmrg AC_PATH_PROG([PS2PDF], [ps2pdf]) 17857e4fd55aSmrg if test "x$PS2PDF" = "x"; then 17867e4fd55aSmrg AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped]) 17877e4fd55aSmrg have_ps2pdf=no 17887e4fd55aSmrg else 17897e4fd55aSmrg have_ps2pdf=yes 17907e4fd55aSmrg fi 17917e4fd55aSmrgelif test "x$use_ps2pdf" = x"yes" ; then 17927e4fd55aSmrg AC_PATH_PROG([PS2PDF], [ps2pdf]) 17937e4fd55aSmrg if test "x$PS2PDF" = "x"; then 17947e4fd55aSmrg AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH]) 17957e4fd55aSmrg fi 17967e4fd55aSmrg have_ps2pdf=yes 17977e4fd55aSmrgelif test "x$use_ps2pdf" = x"no" ; then 17987e4fd55aSmrg if test "x$PS2PDF" != "x"; then 17997e4fd55aSmrg AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified]) 18007e4fd55aSmrg fi 18017e4fd55aSmrg have_ps2pdf=no 18027e4fd55aSmrgelse 18037e4fd55aSmrg AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no']) 18047e4fd55aSmrgfi 18057e4fd55aSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes]) 18067e4fd55aSmrg]) # XORG_WITH_PS2PDF 1807b8f75c19Smrg 18087e4fd55aSmrg# XORG_ENABLE_DOCS (enable_docs=yes) 18097e4fd55aSmrg# ---------------- 18107e4fd55aSmrg# Minimum version: 1.6.0 18117e4fd55aSmrg# 18127e4fd55aSmrg# Documentation tools are not always available on all platforms and sometimes 18137e4fd55aSmrg# not at the appropriate level. This macro enables a builder to skip all 18147e4fd55aSmrg# documentation targets except traditional man pages. 18157e4fd55aSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 18167e4fd55aSmrg# maximum flexibilty in controlling documentation building. 18177e4fd55aSmrg# Refer to: 18187e4fd55aSmrg# XORG_WITH_XMLTO --with-xmlto 18197e4fd55aSmrg# XORG_WITH_ASCIIDOC --with-asciidoc 18207e4fd55aSmrg# XORG_WITH_DOXYGEN --with-doxygen 18217e4fd55aSmrg# XORG_WITH_FOP --with-fop 18227e4fd55aSmrg# XORG_WITH_GROFF --with-groff 18237e4fd55aSmrg# XORG_WITH_PS2PDF --with-ps2pdf 18247e4fd55aSmrg# 18257e4fd55aSmrg# Interface to module: 18267e4fd55aSmrg# ENABLE_DOCS: used in makefiles to conditionally generate documentation 18277e4fd55aSmrg# --enable-docs: 'yes' user instructs the module to generate docs 18287e4fd55aSmrg# 'no' user instructs the module not to generate docs 18297e4fd55aSmrg# parm1: specify the default value, yes or no. 18307e4fd55aSmrg# 18317e4fd55aSmrgAC_DEFUN([XORG_ENABLE_DOCS],[ 18327e4fd55aSmrgm4_define([docs_default], m4_default([$1], [yes])) 18337e4fd55aSmrgAC_ARG_ENABLE(docs, 18347e4fd55aSmrg AS_HELP_STRING([--enable-docs], 18357e4fd55aSmrg [Enable building the documentation (default: ]docs_default[)]), 18367e4fd55aSmrg [build_docs=$enableval], [build_docs=]docs_default) 18377e4fd55aSmrgm4_undefine([docs_default]) 18387e4fd55aSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes]) 18397e4fd55aSmrgAC_MSG_CHECKING([whether to build documentation]) 18407e4fd55aSmrgAC_MSG_RESULT([$build_docs]) 18417e4fd55aSmrg]) # XORG_ENABLE_DOCS 18427e4fd55aSmrg 18437e4fd55aSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes) 18447e4fd55aSmrg# ---------------- 18457e4fd55aSmrg# Minimum version: 1.6.0 18467e4fd55aSmrg# 18477e4fd55aSmrg# This macro enables a builder to skip all developer documentation. 18487e4fd55aSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 18497e4fd55aSmrg# maximum flexibilty in controlling documentation building. 18507e4fd55aSmrg# Refer to: 18517e4fd55aSmrg# XORG_WITH_XMLTO --with-xmlto 18527e4fd55aSmrg# XORG_WITH_ASCIIDOC --with-asciidoc 18537e4fd55aSmrg# XORG_WITH_DOXYGEN --with-doxygen 18547e4fd55aSmrg# XORG_WITH_FOP --with-fop 18557e4fd55aSmrg# XORG_WITH_GROFF --with-groff 18567e4fd55aSmrg# XORG_WITH_PS2PDF --with-ps2pdf 18577e4fd55aSmrg# 18587e4fd55aSmrg# Interface to module: 18597e4fd55aSmrg# ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs 18607e4fd55aSmrg# --enable-devel-docs: 'yes' user instructs the module to generate developer docs 18617e4fd55aSmrg# 'no' user instructs the module not to generate developer docs 18627e4fd55aSmrg# parm1: specify the default value, yes or no. 18637e4fd55aSmrg# 18647e4fd55aSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[ 18657e4fd55aSmrgm4_define([devel_default], m4_default([$1], [yes])) 18667e4fd55aSmrgAC_ARG_ENABLE(devel-docs, 18677e4fd55aSmrg AS_HELP_STRING([--enable-devel-docs], 18687e4fd55aSmrg [Enable building the developer documentation (default: ]devel_default[)]), 18697e4fd55aSmrg [build_devel_docs=$enableval], [build_devel_docs=]devel_default) 18707e4fd55aSmrgm4_undefine([devel_default]) 18717e4fd55aSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes]) 18727e4fd55aSmrgAC_MSG_CHECKING([whether to build developer documentation]) 18737e4fd55aSmrgAC_MSG_RESULT([$build_devel_docs]) 18747e4fd55aSmrg]) # XORG_ENABLE_DEVEL_DOCS 18757e4fd55aSmrg 18767e4fd55aSmrg# XORG_ENABLE_SPECS (enable_specs=yes) 18777e4fd55aSmrg# ---------------- 18787e4fd55aSmrg# Minimum version: 1.6.0 18797e4fd55aSmrg# 18807e4fd55aSmrg# This macro enables a builder to skip all functional specification targets. 18817e4fd55aSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 18827e4fd55aSmrg# maximum flexibilty in controlling documentation building. 18837e4fd55aSmrg# Refer to: 18847e4fd55aSmrg# XORG_WITH_XMLTO --with-xmlto 18857e4fd55aSmrg# XORG_WITH_ASCIIDOC --with-asciidoc 18867e4fd55aSmrg# XORG_WITH_DOXYGEN --with-doxygen 18877e4fd55aSmrg# XORG_WITH_FOP --with-fop 18887e4fd55aSmrg# XORG_WITH_GROFF --with-groff 18897e4fd55aSmrg# XORG_WITH_PS2PDF --with-ps2pdf 18907e4fd55aSmrg# 18917e4fd55aSmrg# Interface to module: 18927e4fd55aSmrg# ENABLE_SPECS: used in makefiles to conditionally generate specs 18937e4fd55aSmrg# --enable-specs: 'yes' user instructs the module to generate specs 18947e4fd55aSmrg# 'no' user instructs the module not to generate specs 18957e4fd55aSmrg# parm1: specify the default value, yes or no. 18967e4fd55aSmrg# 18977e4fd55aSmrgAC_DEFUN([XORG_ENABLE_SPECS],[ 18987e4fd55aSmrgm4_define([spec_default], m4_default([$1], [yes])) 18997e4fd55aSmrgAC_ARG_ENABLE(specs, 19007e4fd55aSmrg AS_HELP_STRING([--enable-specs], 19017e4fd55aSmrg [Enable building the specs (default: ]spec_default[)]), 19027e4fd55aSmrg [build_specs=$enableval], [build_specs=]spec_default) 19037e4fd55aSmrgm4_undefine([spec_default]) 19047e4fd55aSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes]) 19057e4fd55aSmrgAC_MSG_CHECKING([whether to build functional specifications]) 19067e4fd55aSmrgAC_MSG_RESULT([$build_specs]) 19077e4fd55aSmrg]) # XORG_ENABLE_SPECS 1908b8f75c19Smrg 1909b8f75c19Smrg# XORG_CHECK_MALLOC_ZERO 1910b8f75c19Smrg# ---------------------- 19117e4fd55aSmrg# Minimum version: 1.0.0 19127e4fd55aSmrg# 1913b8f75c19Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if 1914b8f75c19Smrg# malloc(0) returns NULL. Packages should add one of these cflags to 1915b8f75c19Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. 1916b8f75c19SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[ 1917b8f75c19SmrgAC_ARG_ENABLE(malloc0returnsnull, 19187e4fd55aSmrg AS_HELP_STRING([--enable-malloc0returnsnull], 1919b8f75c19Smrg [malloc(0) returns NULL (default: auto)]), 1920b8f75c19Smrg [MALLOC_ZERO_RETURNS_NULL=$enableval], 1921b8f75c19Smrg [MALLOC_ZERO_RETURNS_NULL=auto]) 1922b8f75c19Smrg 1923b8f75c19SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL]) 1924b8f75c19Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then 19257e4fd55aSmrg AC_RUN_IFELSE([AC_LANG_PROGRAM([ 19267e4fd55aSmrg#include <stdlib.h> 19277e4fd55aSmrg],[ 1928b8f75c19Smrg char *m0, *r0, *c0, *p; 1929b8f75c19Smrg m0 = malloc(0); 1930b8f75c19Smrg p = malloc(10); 1931b8f75c19Smrg r0 = realloc(p,0); 19327e4fd55aSmrg c0 = calloc(0,10); 19337e4fd55aSmrg exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1); 19347e4fd55aSmrg])], 1935b8f75c19Smrg [MALLOC_ZERO_RETURNS_NULL=yes], 19367e4fd55aSmrg [MALLOC_ZERO_RETURNS_NULL=no], 19377e4fd55aSmrg [MALLOC_ZERO_RETURNS_NULL=yes]) 1938b8f75c19Smrgfi 1939b8f75c19SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) 1940b8f75c19Smrg 1941b8f75c19Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then 1942b8f75c19Smrg MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" 1943b8f75c19Smrg XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS 1944b8f75c19Smrg XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" 1945b8f75c19Smrgelse 1946b8f75c19Smrg MALLOC_ZERO_CFLAGS="" 1947b8f75c19Smrg XMALLOC_ZERO_CFLAGS="" 1948b8f75c19Smrg XTMALLOC_ZERO_CFLAGS="" 1949b8f75c19Smrgfi 1950b8f75c19Smrg 1951b8f75c19SmrgAC_SUBST([MALLOC_ZERO_CFLAGS]) 1952b8f75c19SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS]) 1953b8f75c19SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS]) 1954b8f75c19Smrg]) # XORG_CHECK_MALLOC_ZERO 1955b8f75c19Smrg 19567e4fd55aSmrg# XORG_WITH_LINT() 19577e4fd55aSmrg# ---------------- 19587e4fd55aSmrg# Minimum version: 1.1.0 19597e4fd55aSmrg# 19607e4fd55aSmrg# This macro enables the use of a tool that flags some suspicious and 19617e4fd55aSmrg# non-portable constructs (likely to be bugs) in C language source code. 19627e4fd55aSmrg# It will attempt to locate the tool and use appropriate options. 19637e4fd55aSmrg# There are various lint type tools on different platforms. 19647e4fd55aSmrg# 19657e4fd55aSmrg# Interface to module: 19667e4fd55aSmrg# LINT: returns the path to the tool found on the platform 19677e4fd55aSmrg# or the value set to LINT on the configure cmd line 19687e4fd55aSmrg# also an Automake conditional 19697e4fd55aSmrg# LINT_FLAGS: an Automake variable with appropriate flags 19707e4fd55aSmrg# 19717e4fd55aSmrg# --with-lint: 'yes' user instructs the module to use lint 19727e4fd55aSmrg# 'no' user instructs the module not to use lint (default) 19737e4fd55aSmrg# 19747e4fd55aSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path. 19757e4fd55aSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim. 19767e4fd55aSmrg# 19777e4fd55aSmrgAC_DEFUN([XORG_WITH_LINT],[ 19787e4fd55aSmrg 19797e4fd55aSmrgAC_ARG_VAR([LINT], [Path to a lint-style command]) 19807e4fd55aSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command]) 19817e4fd55aSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint], 19827e4fd55aSmrg [Use a lint-style source code checker (default: disabled)])], 19837e4fd55aSmrg [use_lint=$withval], [use_lint=no]) 19847e4fd55aSmrg 19857e4fd55aSmrg# Obtain platform specific info like program name and options 19867e4fd55aSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris 19877e4fd55aSmrgcase $host_os in 19887e4fd55aSmrg *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*) 19897e4fd55aSmrg lint_name=splint 19907e4fd55aSmrg lint_options="-badflag" 19917e4fd55aSmrg ;; 19927e4fd55aSmrg *freebsd* | *netbsd*) 19937e4fd55aSmrg lint_name=lint 19947e4fd55aSmrg lint_options="-u -b" 19957e4fd55aSmrg ;; 19967e4fd55aSmrg *solaris*) 19977e4fd55aSmrg lint_name=lint 19987e4fd55aSmrg lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2" 19997e4fd55aSmrg ;; 20007e4fd55aSmrgesac 20017e4fd55aSmrg 20027e4fd55aSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user) 20037e4fd55aSmrgif test "x$use_lint" = x"yes" ; then 20047e4fd55aSmrg AC_PATH_PROG([LINT], [$lint_name]) 20057e4fd55aSmrg if test "x$LINT" = "x"; then 20067e4fd55aSmrg AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH]) 20077e4fd55aSmrg fi 20087e4fd55aSmrgelif test "x$use_lint" = x"no" ; then 20097e4fd55aSmrg if test "x$LINT" != "x"; then 20107e4fd55aSmrg AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified]) 20117e4fd55aSmrg fi 20127e4fd55aSmrgelse 20137e4fd55aSmrg AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.]) 20147e4fd55aSmrgfi 20157e4fd55aSmrg 20167e4fd55aSmrg# User supplied flags override default flags 20177e4fd55aSmrgif test "x$LINT_FLAGS" != "x"; then 20187e4fd55aSmrg lint_options=$LINT_FLAGS 20197e4fd55aSmrgfi 20207e4fd55aSmrg 20217e4fd55aSmrgAC_SUBST([LINT_FLAGS],[$lint_options]) 20227e4fd55aSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x]) 20237e4fd55aSmrg 20247e4fd55aSmrg]) # XORG_WITH_LINT 20257e4fd55aSmrg 20267e4fd55aSmrg# XORG_LINT_LIBRARY(LIBNAME) 20277e4fd55aSmrg# -------------------------- 20287e4fd55aSmrg# Minimum version: 1.1.0 20297e4fd55aSmrg# 20307e4fd55aSmrg# Sets up flags for building lint libraries for checking programs that call 20317e4fd55aSmrg# functions in the library. 20327e4fd55aSmrg# 20337e4fd55aSmrg# Interface to module: 20347e4fd55aSmrg# LINTLIB - Automake variable with the name of lint library file to make 20357e4fd55aSmrg# MAKE_LINT_LIB - Automake conditional 20367e4fd55aSmrg# 20377e4fd55aSmrg# --enable-lint-library: - 'yes' user instructs the module to created a lint library 20387e4fd55aSmrg# - 'no' user instructs the module not to create a lint library (default) 20397e4fd55aSmrg 20407e4fd55aSmrgAC_DEFUN([XORG_LINT_LIBRARY],[ 20417e4fd55aSmrgAC_REQUIRE([XORG_WITH_LINT]) 20427e4fd55aSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library], 20437e4fd55aSmrg [Create lint library (default: disabled)])], 20447e4fd55aSmrg [make_lint_lib=$enableval], [make_lint_lib=no]) 20457e4fd55aSmrg 20467e4fd55aSmrgif test "x$make_lint_lib" = x"yes" ; then 20477e4fd55aSmrg LINTLIB=llib-l$1.ln 20487e4fd55aSmrg if test "x$LINT" = "x"; then 20497e4fd55aSmrg AC_MSG_ERROR([Cannot make lint library without --with-lint]) 20507e4fd55aSmrg fi 20517e4fd55aSmrgelif test "x$make_lint_lib" != x"no" ; then 20527e4fd55aSmrg AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.]) 20537e4fd55aSmrgfi 20547e4fd55aSmrg 20557e4fd55aSmrgAC_SUBST(LINTLIB) 20567e4fd55aSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno]) 20577e4fd55aSmrg 20587e4fd55aSmrg]) # XORG_LINT_LIBRARY 20597e4fd55aSmrg 20607e4fd55aSmrg# XORG_CWARNFLAGS 20617e4fd55aSmrg# --------------- 20627e4fd55aSmrg# Minimum version: 1.2.0 20637e4fd55aSmrg# 20647e4fd55aSmrg# Defines CWARNFLAGS to enable C compiler warnings. 20657e4fd55aSmrg# 20667e4fd55aSmrgAC_DEFUN([XORG_CWARNFLAGS], [ 20677e4fd55aSmrgAC_REQUIRE([AC_PROG_CC_C99]) 20687e4fd55aSmrgif test "x$GCC" = xyes ; then 20697e4fd55aSmrg CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \ 20707e4fd55aSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \ 20717e4fd55aSmrg-Wbad-function-cast -Wformat=2" 20727e4fd55aSmrg case `$CC -dumpversion` in 20737e4fd55aSmrg 3.4.* | 4.*) 20747e4fd55aSmrg CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement" 20757e4fd55aSmrg ;; 20767e4fd55aSmrg esac 20777e4fd55aSmrgelse 20787e4fd55aSmrg AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) 20797e4fd55aSmrg if test "x$SUNCC" = "xyes"; then 20807e4fd55aSmrg CWARNFLAGS="-v" 20817e4fd55aSmrg fi 20827e4fd55aSmrgfi 20837e4fd55aSmrgAC_SUBST(CWARNFLAGS) 20847e4fd55aSmrg]) # XORG_CWARNFLAGS 20857e4fd55aSmrg 20867e4fd55aSmrg# XORG_STRICT_OPTION 20877e4fd55aSmrg# ----------------------- 20887e4fd55aSmrg# Minimum version: 1.3.0 20897e4fd55aSmrg# 20907e4fd55aSmrg# Add configure option to enable strict compilation 20917e4fd55aSmrgAC_DEFUN([XORG_STRICT_OPTION], [ 20927e4fd55aSmrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89 20937e4fd55aSmrgAC_REQUIRE([AC_PROG_CC_C99]) 20947e4fd55aSmrgAC_REQUIRE([XORG_CWARNFLAGS]) 20957e4fd55aSmrg 20967e4fd55aSmrgAC_ARG_ENABLE(strict-compilation, 20977e4fd55aSmrg AS_HELP_STRING([--enable-strict-compilation], 20987e4fd55aSmrg [Enable all warnings from compiler and make them errors (default: disabled)]), 20997e4fd55aSmrg [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no]) 21007e4fd55aSmrgif test "x$STRICT_COMPILE" = "xyes"; then 21017e4fd55aSmrg AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) 21027e4fd55aSmrg AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"]) 21037e4fd55aSmrg if test "x$GCC" = xyes ; then 21047e4fd55aSmrg STRICT_CFLAGS="-pedantic -Werror" 21057e4fd55aSmrg elif test "x$SUNCC" = "xyes"; then 21067e4fd55aSmrg STRICT_CFLAGS="-errwarn" 21077e4fd55aSmrg elif test "x$INTELCC" = "xyes"; then 21087e4fd55aSmrg STRICT_CFLAGS="-Werror" 21097e4fd55aSmrg fi 21107e4fd55aSmrgfi 21117e4fd55aSmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS" 21127e4fd55aSmrgAC_SUBST([CWARNFLAGS]) 21137e4fd55aSmrg]) # XORG_STRICT_OPTION 21147e4fd55aSmrg 21157e4fd55aSmrg# XORG_DEFAULT_OPTIONS 21167e4fd55aSmrg# -------------------- 21177e4fd55aSmrg# Minimum version: 1.3.0 21187e4fd55aSmrg# 21197e4fd55aSmrg# Defines default options for X.Org modules. 21207e4fd55aSmrg# 21217e4fd55aSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [ 21227e4fd55aSmrgAC_REQUIRE([AC_PROG_INSTALL]) 21237e4fd55aSmrgXORG_CWARNFLAGS 21247e4fd55aSmrgXORG_STRICT_OPTION 21257e4fd55aSmrgXORG_RELEASE_VERSION 21267e4fd55aSmrgXORG_CHANGELOG 21277e4fd55aSmrgXORG_INSTALL 21287e4fd55aSmrgXORG_MANPAGE_SECTIONS 21297e4fd55aSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], 21307e4fd55aSmrg [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) 21317e4fd55aSmrg]) # XORG_DEFAULT_OPTIONS 21327e4fd55aSmrg 21337e4fd55aSmrg# XORG_INSTALL() 21347e4fd55aSmrg# ---------------- 21357e4fd55aSmrg# Minimum version: 1.4.0 21367e4fd55aSmrg# 21377e4fd55aSmrg# Defines the variable INSTALL_CMD as the command to copy 21387e4fd55aSmrg# INSTALL from $prefix/share/util-macros. 21397e4fd55aSmrg# 21407e4fd55aSmrgAC_DEFUN([XORG_INSTALL], [ 21417e4fd55aSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG]) 21427e4fd55aSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` 21437e4fd55aSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ 21447e4fd55aSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ 21457e4fd55aSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \ 21467e4fd55aSmrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)" 21477e4fd55aSmrgAC_SUBST([INSTALL_CMD]) 21487e4fd55aSmrg]) # XORG_INSTALL 2149b8f75c19Smrgdnl Copyright 2005 Red Hat, Inc 2150b8f75c19Smrgdnl 2151b8f75c19Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its 2152b8f75c19Smrgdnl documentation for any purpose is hereby granted without fee, provided that 2153b8f75c19Smrgdnl the above copyright notice appear in all copies and that both that 2154b8f75c19Smrgdnl copyright notice and this permission notice appear in supporting 2155b8f75c19Smrgdnl documentation. 2156b8f75c19Smrgdnl 2157b8f75c19Smrgdnl The above copyright notice and this permission notice shall be included 2158b8f75c19Smrgdnl in all copies or substantial portions of the Software. 2159b8f75c19Smrgdnl 2160b8f75c19Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 2161b8f75c19Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 2162b8f75c19Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 2163b8f75c19Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 2164b8f75c19Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 2165b8f75c19Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 2166b8f75c19Smrgdnl OTHER DEALINGS IN THE SOFTWARE. 2167b8f75c19Smrgdnl 2168b8f75c19Smrgdnl Except as contained in this notice, the name of the copyright holders shall 2169b8f75c19Smrgdnl not be used in advertising or otherwise to promote the sale, use or 2170b8f75c19Smrgdnl other dealings in this Software without prior written authorization 2171b8f75c19Smrgdnl from the copyright holders. 2172b8f75c19Smrgdnl 2173b8f75c19Smrg 2174b8f75c19Smrg# XORG_RELEASE_VERSION 2175b8f75c19Smrg# -------------------- 21767e4fd55aSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use. 2177b8f75c19Smrg 2178b8f75c19SmrgAC_DEFUN([XORG_RELEASE_VERSION],[ 21797e4fd55aSmrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR], 21807e4fd55aSmrg [`echo $PACKAGE_VERSION | cut -d . -f 1`], 21817e4fd55aSmrg [Major version of this package]) 21827e4fd55aSmrg PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` 21837e4fd55aSmrg if test "x$PVM" = "x"; then 21847e4fd55aSmrg PVM="0" 2185b8f75c19Smrg fi 21867e4fd55aSmrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR], 21877e4fd55aSmrg [$PVM], 21887e4fd55aSmrg [Minor version of this package]) 21897e4fd55aSmrg PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` 21907e4fd55aSmrg if test "x$PVP" = "x"; then 21917e4fd55aSmrg PVP="0" 21927e4fd55aSmrg fi 21937e4fd55aSmrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL], 21947e4fd55aSmrg [$PVP], 21957e4fd55aSmrg [Patch version of this package]) 2196b8f75c19Smrg]) 2197b8f75c19Smrg 21987e4fd55aSmrg# XORG_CHANGELOG() 21997e4fd55aSmrg# ---------------- 22007e4fd55aSmrg# Minimum version: 1.2.0 22017e4fd55aSmrg# 22027e4fd55aSmrg# Defines the variable CHANGELOG_CMD as the command to generate 22037e4fd55aSmrg# ChangeLog from git. 22047e4fd55aSmrg# 22057e4fd55aSmrg# 22067e4fd55aSmrgAC_DEFUN([XORG_CHANGELOG], [ 22077e4fd55aSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \ 22087e4fd55aSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ 22097e4fd55aSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \ 22107e4fd55aSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)" 22117e4fd55aSmrgAC_SUBST([CHANGELOG_CMD]) 22127e4fd55aSmrg]) # XORG_CHANGELOG 22137e4fd55aSmrg 22147e4fd55aSmrg# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- 22157e4fd55aSmrg# 22167e4fd55aSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>. 22177e4fd55aSmrg# 22187e4fd55aSmrg# This program is free software; you can redistribute it and/or modify 22197e4fd55aSmrg# it under the terms of the GNU General Public License as published by 22207e4fd55aSmrg# the Free Software Foundation; either version 2 of the License, or 22217e4fd55aSmrg# (at your option) any later version. 22227e4fd55aSmrg# 22237e4fd55aSmrg# This program is distributed in the hope that it will be useful, but 22247e4fd55aSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of 22257e4fd55aSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 22267e4fd55aSmrg# General Public License for more details. 22277e4fd55aSmrg# 22287e4fd55aSmrg# You should have received a copy of the GNU General Public License 22297e4fd55aSmrg# along with this program; if not, write to the Free Software 22307e4fd55aSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 22317e4fd55aSmrg# 22327e4fd55aSmrg# As a special exception to the GNU General Public License, if you 22337e4fd55aSmrg# distribute this file as part of a program that contains a 22347e4fd55aSmrg# configuration script generated by Autoconf, you may include it under 22357e4fd55aSmrg# the same distribution terms that you use for the rest of that program. 22367e4fd55aSmrg 22377e4fd55aSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION]) 22387e4fd55aSmrg# ---------------------------------- 22397e4fd55aSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG], 22407e4fd55aSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) 22417e4fd55aSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$]) 22427e4fd55aSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl 22437e4fd55aSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then 22447e4fd55aSmrg AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) 22457e4fd55aSmrgfi 22467e4fd55aSmrgif test -n "$PKG_CONFIG"; then 22477e4fd55aSmrg _pkg_min_version=m4_default([$1], [0.9.0]) 22487e4fd55aSmrg AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) 22497e4fd55aSmrg if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then 22507e4fd55aSmrg AC_MSG_RESULT([yes]) 22517e4fd55aSmrg else 22527e4fd55aSmrg AC_MSG_RESULT([no]) 22537e4fd55aSmrg PKG_CONFIG="" 22547e4fd55aSmrg fi 22557e4fd55aSmrg 22567e4fd55aSmrgfi[]dnl 22577e4fd55aSmrg])# PKG_PROG_PKG_CONFIG 22587e4fd55aSmrg 22597e4fd55aSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 22607e4fd55aSmrg# 22617e4fd55aSmrg# Check to see whether a particular set of modules exists. Similar 22627e4fd55aSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors. 22637e4fd55aSmrg# 22647e4fd55aSmrg# 22657e4fd55aSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of 22667e4fd55aSmrg# this or PKG_CHECK_MODULES is called, or make sure to call 22677e4fd55aSmrg# PKG_CHECK_EXISTS manually 22687e4fd55aSmrg# -------------------------------------------------------------- 22697e4fd55aSmrgAC_DEFUN([PKG_CHECK_EXISTS], 22707e4fd55aSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 22717e4fd55aSmrgif test -n "$PKG_CONFIG" && \ 22727e4fd55aSmrg AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then 22737e4fd55aSmrg m4_ifval([$2], [$2], [:]) 22747e4fd55aSmrgm4_ifvaln([$3], [else 22757e4fd55aSmrg $3])dnl 22767e4fd55aSmrgfi]) 22777e4fd55aSmrg 22787e4fd55aSmrg 22797e4fd55aSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) 22807e4fd55aSmrg# --------------------------------------------- 22817e4fd55aSmrgm4_define([_PKG_CONFIG], 22827e4fd55aSmrg[if test -n "$$1"; then 22837e4fd55aSmrg pkg_cv_[]$1="$$1" 22847e4fd55aSmrg elif test -n "$PKG_CONFIG"; then 22857e4fd55aSmrg PKG_CHECK_EXISTS([$3], 22867e4fd55aSmrg [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], 22877e4fd55aSmrg [pkg_failed=yes]) 22887e4fd55aSmrg else 22897e4fd55aSmrg pkg_failed=untried 22907e4fd55aSmrgfi[]dnl 22917e4fd55aSmrg])# _PKG_CONFIG 22927e4fd55aSmrg 22937e4fd55aSmrg# _PKG_SHORT_ERRORS_SUPPORTED 22947e4fd55aSmrg# ----------------------------- 22957e4fd55aSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], 22967e4fd55aSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 22977e4fd55aSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then 22987e4fd55aSmrg _pkg_short_errors_supported=yes 22997e4fd55aSmrgelse 23007e4fd55aSmrg _pkg_short_errors_supported=no 23017e4fd55aSmrgfi[]dnl 23027e4fd55aSmrg])# _PKG_SHORT_ERRORS_SUPPORTED 23037e4fd55aSmrg 23047e4fd55aSmrg 23057e4fd55aSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], 23067e4fd55aSmrg# [ACTION-IF-NOT-FOUND]) 23077e4fd55aSmrg# 23087e4fd55aSmrg# 23097e4fd55aSmrg# Note that if there is a possibility the first call to 23107e4fd55aSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an 23117e4fd55aSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac 23127e4fd55aSmrg# 23137e4fd55aSmrg# 23147e4fd55aSmrg# -------------------------------------------------------------- 23157e4fd55aSmrgAC_DEFUN([PKG_CHECK_MODULES], 23167e4fd55aSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 23177e4fd55aSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl 23187e4fd55aSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl 23197e4fd55aSmrg 23207e4fd55aSmrgpkg_failed=no 23217e4fd55aSmrgAC_MSG_CHECKING([for $1]) 23227e4fd55aSmrg 23237e4fd55aSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) 23247e4fd55aSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2]) 23257e4fd55aSmrg 23267e4fd55aSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS 23277e4fd55aSmrgand $1[]_LIBS to avoid the need to call pkg-config. 23287e4fd55aSmrgSee the pkg-config man page for more details.]) 23297e4fd55aSmrg 23307e4fd55aSmrgif test $pkg_failed = yes; then 23317e4fd55aSmrg _PKG_SHORT_ERRORS_SUPPORTED 23327e4fd55aSmrg if test $_pkg_short_errors_supported = yes; then 23337e4fd55aSmrg $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` 23347e4fd55aSmrg else 23357e4fd55aSmrg $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` 23367e4fd55aSmrg fi 23377e4fd55aSmrg # Put the nasty error message in config.log where it belongs 23387e4fd55aSmrg echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD 23397e4fd55aSmrg 23407e4fd55aSmrg ifelse([$4], , [AC_MSG_ERROR(dnl 23417e4fd55aSmrg[Package requirements ($2) were not met: 23427e4fd55aSmrg 23437e4fd55aSmrg$$1_PKG_ERRORS 23447e4fd55aSmrg 23457e4fd55aSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you 23467e4fd55aSmrginstalled software in a non-standard prefix. 23477e4fd55aSmrg 23487e4fd55aSmrg_PKG_TEXT 23497e4fd55aSmrg])], 23507e4fd55aSmrg [AC_MSG_RESULT([no]) 23517e4fd55aSmrg $4]) 23527e4fd55aSmrgelif test $pkg_failed = untried; then 23537e4fd55aSmrg ifelse([$4], , [AC_MSG_FAILURE(dnl 23547e4fd55aSmrg[The pkg-config script could not be found or is too old. Make sure it 23557e4fd55aSmrgis in your PATH or set the PKG_CONFIG environment variable to the full 23567e4fd55aSmrgpath to pkg-config. 23577e4fd55aSmrg 23587e4fd55aSmrg_PKG_TEXT 23597e4fd55aSmrg 23607e4fd55aSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])], 23617e4fd55aSmrg [$4]) 23627e4fd55aSmrgelse 23637e4fd55aSmrg $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS 23647e4fd55aSmrg $1[]_LIBS=$pkg_cv_[]$1[]_LIBS 23657e4fd55aSmrg AC_MSG_RESULT([yes]) 23667e4fd55aSmrg ifelse([$3], , :, [$3]) 23677e4fd55aSmrgfi[]dnl 23687e4fd55aSmrg])# PKG_CHECK_MODULES 23697e4fd55aSmrg 2370