aclocal.m4 revision 9e0146f7
19e0146f7Smrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*- 2492e1cfeSmrg 39e0146f7Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 49e0146f7Smrg# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. 5492e1cfeSmrg# This file is free software; the Free Software Foundation 6492e1cfeSmrg# gives unlimited permission to copy and/or distribute it, 7492e1cfeSmrg# with or without modifications, as long as this notice is preserved. 8492e1cfeSmrg 9492e1cfeSmrg# This program is distributed in the hope that it will be useful, 10492e1cfeSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without 11492e1cfeSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A 12492e1cfeSmrg# PARTICULAR PURPOSE. 13492e1cfeSmrg 149e0146f7Smrgm4_ifndef([AC_AUTOCONF_VERSION], 159e0146f7Smrg [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 169e0146f7Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, 179e0146f7Smrg[m4_warning([this file was generated for autoconf 2.68. 189e0146f7SmrgYou have another version of autoconf. It may work, but is not guaranteed to. 199e0146f7SmrgIf you have problems, you may need to regenerate the build system entirely. 209e0146f7SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])]) 21492e1cfeSmrg 229e0146f7Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. 239e0146f7Smrg# 249e0146f7Smrg# This file is free software; the Free Software Foundation 259e0146f7Smrg# gives unlimited permission to copy and/or distribute it, 269e0146f7Smrg# with or without modifications, as long as this notice is preserved. 27492e1cfeSmrg 28492e1cfeSmrg# AM_AUTOMAKE_VERSION(VERSION) 29492e1cfeSmrg# ---------------------------- 30492e1cfeSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been 31492e1cfeSmrg# generated from the m4 files accompanying Automake X.Y. 329e0146f7Smrg# (This private macro should not be called outside this file.) 339e0146f7SmrgAC_DEFUN([AM_AUTOMAKE_VERSION], 349e0146f7Smrg[am__api_version='1.11' 359e0146f7Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to 369e0146f7Smrgdnl require some minimum version. Point them to the right macro. 379e0146f7Smrgm4_if([$1], [1.11.1], [], 389e0146f7Smrg [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl 399e0146f7Smrg]) 409e0146f7Smrg 419e0146f7Smrg# _AM_AUTOCONF_VERSION(VERSION) 429e0146f7Smrg# ----------------------------- 439e0146f7Smrg# aclocal traces this macro to find the Autoconf version. 449e0146f7Smrg# This is a private macro too. Using m4_define simplifies 459e0146f7Smrg# the logic in aclocal, which can simply ignore this definition. 469e0146f7Smrgm4_define([_AM_AUTOCONF_VERSION], []) 47492e1cfeSmrg 48492e1cfeSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION 49492e1cfeSmrg# ------------------------------- 509e0146f7Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. 519e0146f7Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. 52492e1cfeSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 539e0146f7Smrg[AM_AUTOMAKE_VERSION([1.11.1])dnl 549e0146f7Smrgm4_ifndef([AC_AUTOCONF_VERSION], 559e0146f7Smrg [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 569e0146f7Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) 57492e1cfeSmrg 589e0146f7Smrg# AM_AUX_DIR_EXPAND -*- Autoconf -*- 59492e1cfeSmrg 609e0146f7Smrg# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 61492e1cfeSmrg# 629e0146f7Smrg# This file is free software; the Free Software Foundation 639e0146f7Smrg# gives unlimited permission to copy and/or distribute it, 649e0146f7Smrg# with or without modifications, as long as this notice is preserved. 65492e1cfeSmrg 66492e1cfeSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 67492e1cfeSmrg# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to 68492e1cfeSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'. 69492e1cfeSmrg# 70492e1cfeSmrg# Of course, Automake must honor this variable whenever it calls a 71492e1cfeSmrg# tool from the auxiliary directory. The problem is that $srcdir (and 72492e1cfeSmrg# therefore $ac_aux_dir as well) can be either absolute or relative, 73492e1cfeSmrg# depending on how configure is run. This is pretty annoying, since 74492e1cfeSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top 75492e1cfeSmrg# source directory, any form will work fine, but in subdirectories a 76492e1cfeSmrg# relative path needs to be adjusted first. 77492e1cfeSmrg# 78492e1cfeSmrg# $ac_aux_dir/missing 79492e1cfeSmrg# fails when called from a subdirectory if $ac_aux_dir is relative 80492e1cfeSmrg# $top_srcdir/$ac_aux_dir/missing 81492e1cfeSmrg# fails if $ac_aux_dir is absolute, 82492e1cfeSmrg# fails when called from a subdirectory in a VPATH build with 83492e1cfeSmrg# a relative $ac_aux_dir 84492e1cfeSmrg# 85492e1cfeSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir 86492e1cfeSmrg# are both prefixed by $srcdir. In an in-source build this is usually 87492e1cfeSmrg# harmless because $srcdir is `.', but things will broke when you 88492e1cfeSmrg# start a VPATH build or use an absolute $srcdir. 89492e1cfeSmrg# 90492e1cfeSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 91492e1cfeSmrg# iff we strip the leading $srcdir from $ac_aux_dir. That would be: 92492e1cfeSmrg# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 93492e1cfeSmrg# and then we would define $MISSING as 94492e1cfeSmrg# MISSING="\${SHELL} $am_aux_dir/missing" 95492e1cfeSmrg# This will work as long as MISSING is not called from configure, because 96492e1cfeSmrg# unfortunately $(top_srcdir) has no meaning in configure. 97492e1cfeSmrg# However there are other variables, like CC, which are often used in 98492e1cfeSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir. 99492e1cfeSmrg# 100492e1cfeSmrg# Another solution, used here, is to always expand $ac_aux_dir to an 101492e1cfeSmrg# absolute PATH. The drawback is that using absolute paths prevent a 102492e1cfeSmrg# configured tree to be moved without reconfiguration. 103492e1cfeSmrg 1049e0146f7SmrgAC_DEFUN([AM_AUX_DIR_EXPAND], 1059e0146f7Smrg[dnl Rely on autoconf to set up CDPATH properly. 1069e0146f7SmrgAC_PREREQ([2.50])dnl 107492e1cfeSmrg# expand $ac_aux_dir to an absolute path 108492e1cfeSmrgam_aux_dir=`cd $ac_aux_dir && pwd` 109492e1cfeSmrg]) 110492e1cfeSmrg 1119e0146f7Smrg# AM_CONDITIONAL -*- Autoconf -*- 112492e1cfeSmrg 1139e0146f7Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 1149e0146f7Smrg# Free Software Foundation, Inc. 1159e0146f7Smrg# 1169e0146f7Smrg# This file is free software; the Free Software Foundation 1179e0146f7Smrg# gives unlimited permission to copy and/or distribute it, 1189e0146f7Smrg# with or without modifications, as long as this notice is preserved. 119492e1cfeSmrg 1209e0146f7Smrg# serial 9 121492e1cfeSmrg 1229e0146f7Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION) 1239e0146f7Smrg# ------------------------------------- 1249e0146f7Smrg# Define a conditional. 1259e0146f7SmrgAC_DEFUN([AM_CONDITIONAL], 1269e0146f7Smrg[AC_PREREQ(2.52)dnl 1279e0146f7Smrg ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 1289e0146f7Smrg [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 1299e0146f7SmrgAC_SUBST([$1_TRUE])dnl 1309e0146f7SmrgAC_SUBST([$1_FALSE])dnl 1319e0146f7Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl 1329e0146f7Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl 1339e0146f7Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl 1349e0146f7Smrgif $2; then 1359e0146f7Smrg $1_TRUE= 1369e0146f7Smrg $1_FALSE='#' 137492e1cfeSmrgelse 1389e0146f7Smrg $1_TRUE='#' 1399e0146f7Smrg $1_FALSE= 140492e1cfeSmrgfi 1419e0146f7SmrgAC_CONFIG_COMMANDS_PRE( 1429e0146f7Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 1439e0146f7Smrg AC_MSG_ERROR([[conditional "$1" was never defined. 1449e0146f7SmrgUsually this means the macro was only invoked conditionally.]]) 1459e0146f7Smrgfi])]) 146492e1cfeSmrg 1479e0146f7Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 1489e0146f7Smrg# Free Software Foundation, Inc. 1499e0146f7Smrg# 1509e0146f7Smrg# This file is free software; the Free Software Foundation 1519e0146f7Smrg# gives unlimited permission to copy and/or distribute it, 1529e0146f7Smrg# with or without modifications, as long as this notice is preserved. 153492e1cfeSmrg 1549e0146f7Smrg# serial 10 155492e1cfeSmrg 156492e1cfeSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be 157492e1cfeSmrg# written in clear, in which case automake, when reading aclocal.m4, 158492e1cfeSmrg# will think it sees a *use*, and therefore will trigger all it's 159492e1cfeSmrg# C support machinery. Also note that it means that autoscan, seeing 160492e1cfeSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use... 161492e1cfeSmrg 162492e1cfeSmrg 163492e1cfeSmrg# _AM_DEPENDENCIES(NAME) 164492e1cfeSmrg# ---------------------- 165492e1cfeSmrg# See how the compiler implements dependency checking. 166492e1cfeSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC". 167492e1cfeSmrg# We try a few techniques and use that to set a single cache variable. 168492e1cfeSmrg# 169492e1cfeSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was 170492e1cfeSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular 171492e1cfeSmrg# dependency, and given that the user is not expected to run this macro, 172492e1cfeSmrg# just rely on AC_PROG_CC. 173492e1cfeSmrgAC_DEFUN([_AM_DEPENDENCIES], 174492e1cfeSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl 175492e1cfeSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl 176492e1cfeSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl 177492e1cfeSmrgAC_REQUIRE([AM_DEP_TRACK])dnl 178492e1cfeSmrg 179492e1cfeSmrgifelse([$1], CC, [depcc="$CC" am_compiler_list=], 180492e1cfeSmrg [$1], CXX, [depcc="$CXX" am_compiler_list=], 181492e1cfeSmrg [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 1829e0146f7Smrg [$1], UPC, [depcc="$UPC" am_compiler_list=], 183492e1cfeSmrg [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 184492e1cfeSmrg [depcc="$$1" am_compiler_list=]) 185492e1cfeSmrg 186492e1cfeSmrgAC_CACHE_CHECK([dependency style of $depcc], 187492e1cfeSmrg [am_cv_$1_dependencies_compiler_type], 188492e1cfeSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then 189492e1cfeSmrg # We make a subdir and do the tests there. Otherwise we can end up 190492e1cfeSmrg # making bogus files that we don't know about and never remove. For 191492e1cfeSmrg # instance it was reported that on HP-UX the gcc test will end up 192492e1cfeSmrg # making a dummy file named `D' -- because `-MD' means `put the output 193492e1cfeSmrg # in D'. 194492e1cfeSmrg mkdir conftest.dir 195492e1cfeSmrg # Copy depcomp to subdir because otherwise we won't find it if we're 196492e1cfeSmrg # using a relative directory. 197492e1cfeSmrg cp "$am_depcomp" conftest.dir 198492e1cfeSmrg cd conftest.dir 199492e1cfeSmrg # We will build objects and dependencies in a subdirectory because 200492e1cfeSmrg # it helps to detect inapplicable dependency modes. For instance 201492e1cfeSmrg # both Tru64's cc and ICC support -MD to output dependencies as a 202492e1cfeSmrg # side effect of compilation, but ICC will put the dependencies in 203492e1cfeSmrg # the current directory while Tru64 will put them in the object 204492e1cfeSmrg # directory. 205492e1cfeSmrg mkdir sub 206492e1cfeSmrg 207492e1cfeSmrg am_cv_$1_dependencies_compiler_type=none 208492e1cfeSmrg if test "$am_compiler_list" = ""; then 209492e1cfeSmrg am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` 210492e1cfeSmrg fi 2119e0146f7Smrg am__universal=false 2129e0146f7Smrg m4_case([$1], [CC], 2139e0146f7Smrg [case " $depcc " in #( 2149e0146f7Smrg *\ -arch\ *\ -arch\ *) am__universal=true ;; 2159e0146f7Smrg esac], 2169e0146f7Smrg [CXX], 2179e0146f7Smrg [case " $depcc " in #( 2189e0146f7Smrg *\ -arch\ *\ -arch\ *) am__universal=true ;; 2199e0146f7Smrg esac]) 2209e0146f7Smrg 221492e1cfeSmrg for depmode in $am_compiler_list; do 222492e1cfeSmrg # Setup a source with many dependencies, because some compilers 223492e1cfeSmrg # like to wrap large dependency lists on column 80 (with \), and 224492e1cfeSmrg # we should not choose a depcomp mode which is confused by this. 225492e1cfeSmrg # 226492e1cfeSmrg # We need to recreate these files for each test, as the compiler may 227492e1cfeSmrg # overwrite some of them when testing with obscure command lines. 228492e1cfeSmrg # This happens at least with the AIX C compiler. 229492e1cfeSmrg : > sub/conftest.c 230492e1cfeSmrg for i in 1 2 3 4 5 6; do 231492e1cfeSmrg echo '#include "conftst'$i'.h"' >> sub/conftest.c 2329e0146f7Smrg # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with 2339e0146f7Smrg # Solaris 8's {/usr,}/bin/sh. 2349e0146f7Smrg touch sub/conftst$i.h 235492e1cfeSmrg done 236492e1cfeSmrg echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 237492e1cfeSmrg 2389e0146f7Smrg # We check with `-c' and `-o' for the sake of the "dashmstdout" 2399e0146f7Smrg # mode. It turns out that the SunPro C++ compiler does not properly 2409e0146f7Smrg # handle `-M -o', and we need to detect this. Also, some Intel 2419e0146f7Smrg # versions had trouble with output in subdirs 2429e0146f7Smrg am__obj=sub/conftest.${OBJEXT-o} 2439e0146f7Smrg am__minus_obj="-o $am__obj" 244492e1cfeSmrg case $depmode in 2459e0146f7Smrg gcc) 2469e0146f7Smrg # This depmode causes a compiler race in universal mode. 2479e0146f7Smrg test "$am__universal" = false || continue 2489e0146f7Smrg ;; 249492e1cfeSmrg nosideeffect) 250492e1cfeSmrg # after this tag, mechanisms are not by side-effect, so they'll 251492e1cfeSmrg # only be used when explicitly requested 252492e1cfeSmrg if test "x$enable_dependency_tracking" = xyes; then 253492e1cfeSmrg continue 254492e1cfeSmrg else 255492e1cfeSmrg break 256492e1cfeSmrg fi 257492e1cfeSmrg ;; 2589e0146f7Smrg msvisualcpp | msvcmsys) 2599e0146f7Smrg # This compiler won't grok `-c -o', but also, the minuso test has 2609e0146f7Smrg # not run yet. These depmodes are late enough in the game, and 2619e0146f7Smrg # so weak that their functioning should not be impacted. 2629e0146f7Smrg am__obj=conftest.${OBJEXT-o} 2639e0146f7Smrg am__minus_obj= 2649e0146f7Smrg ;; 265492e1cfeSmrg none) break ;; 266492e1cfeSmrg esac 267492e1cfeSmrg if depmode=$depmode \ 2689e0146f7Smrg source=sub/conftest.c object=$am__obj \ 269492e1cfeSmrg depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ 2709e0146f7Smrg $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ 271492e1cfeSmrg >/dev/null 2>conftest.err && 2729e0146f7Smrg grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 273492e1cfeSmrg grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && 2749e0146f7Smrg grep $am__obj sub/conftest.Po > /dev/null 2>&1 && 275492e1cfeSmrg ${MAKE-make} -s -f confmf > /dev/null 2>&1; then 276492e1cfeSmrg # icc doesn't choke on unknown options, it will just issue warnings 2779e0146f7Smrg # or remarks (even with -Werror). So we grep stderr for any message 2789e0146f7Smrg # that says an option was ignored or not supported. 2799e0146f7Smrg # When given -MP, icc 7.0 and 7.1 complain thusly: 2809e0146f7Smrg # icc: Command line warning: ignoring option '-M'; no argument required 2819e0146f7Smrg # The diagnosis changed in icc 8.0: 2829e0146f7Smrg # icc: Command line remark: option '-MP' not supported 2839e0146f7Smrg if (grep 'ignoring option' conftest.err || 2849e0146f7Smrg grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else 285492e1cfeSmrg am_cv_$1_dependencies_compiler_type=$depmode 286492e1cfeSmrg break 287492e1cfeSmrg fi 288492e1cfeSmrg fi 289492e1cfeSmrg done 290492e1cfeSmrg 291492e1cfeSmrg cd .. 292492e1cfeSmrg rm -rf conftest.dir 293492e1cfeSmrgelse 294492e1cfeSmrg am_cv_$1_dependencies_compiler_type=none 295492e1cfeSmrgfi 296492e1cfeSmrg]) 297492e1cfeSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) 298492e1cfeSmrgAM_CONDITIONAL([am__fastdep$1], [ 299492e1cfeSmrg test "x$enable_dependency_tracking" != xno \ 300492e1cfeSmrg && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) 301492e1cfeSmrg]) 302492e1cfeSmrg 303492e1cfeSmrg 304492e1cfeSmrg# AM_SET_DEPDIR 305492e1cfeSmrg# ------------- 306492e1cfeSmrg# Choose a directory name for dependency files. 307492e1cfeSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES 308492e1cfeSmrgAC_DEFUN([AM_SET_DEPDIR], 309492e1cfeSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl 310492e1cfeSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl 311492e1cfeSmrg]) 312492e1cfeSmrg 313492e1cfeSmrg 314492e1cfeSmrg# AM_DEP_TRACK 315492e1cfeSmrg# ------------ 316492e1cfeSmrgAC_DEFUN([AM_DEP_TRACK], 317492e1cfeSmrg[AC_ARG_ENABLE(dependency-tracking, 3189e0146f7Smrg[ --disable-dependency-tracking speeds up one-time build 3199e0146f7Smrg --enable-dependency-tracking do not reject slow dependency extractors]) 320492e1cfeSmrgif test "x$enable_dependency_tracking" != xno; then 321492e1cfeSmrg am_depcomp="$ac_aux_dir/depcomp" 322492e1cfeSmrg AMDEPBACKSLASH='\' 323492e1cfeSmrgfi 324492e1cfeSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) 3259e0146f7SmrgAC_SUBST([AMDEPBACKSLASH])dnl 3269e0146f7Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl 327492e1cfeSmrg]) 328492e1cfeSmrg 3299e0146f7Smrg# Generate code to set up dependency tracking. -*- Autoconf -*- 330492e1cfeSmrg 3319e0146f7Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 3329e0146f7Smrg# Free Software Foundation, Inc. 3339e0146f7Smrg# 3349e0146f7Smrg# This file is free software; the Free Software Foundation 3359e0146f7Smrg# gives unlimited permission to copy and/or distribute it, 3369e0146f7Smrg# with or without modifications, as long as this notice is preserved. 337492e1cfeSmrg 3389e0146f7Smrg#serial 5 339492e1cfeSmrg 340492e1cfeSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS 341492e1cfeSmrg# ------------------------------ 342492e1cfeSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], 3439e0146f7Smrg[{ 3449e0146f7Smrg # Autoconf 2.62 quotes --file arguments for eval, but not when files 3459e0146f7Smrg # are listed without --file. Let's play safe and only enable the eval 3469e0146f7Smrg # if we detect the quoting. 3479e0146f7Smrg case $CONFIG_FILES in 3489e0146f7Smrg *\'*) eval set x "$CONFIG_FILES" ;; 3499e0146f7Smrg *) set x $CONFIG_FILES ;; 3509e0146f7Smrg esac 3519e0146f7Smrg shift 3529e0146f7Smrg for mf 3539e0146f7Smrg do 3549e0146f7Smrg # Strip MF so we end up with the name of the file. 3559e0146f7Smrg mf=`echo "$mf" | sed -e 's/:.*$//'` 3569e0146f7Smrg # Check whether this is an Automake generated Makefile or not. 3579e0146f7Smrg # We used to match only the files named `Makefile.in', but 3589e0146f7Smrg # some people rename them; so instead we look at the file content. 3599e0146f7Smrg # Grep'ing the first line is not enough: some people post-process 3609e0146f7Smrg # each Makefile.in and add a new line on top of each file to say so. 3619e0146f7Smrg # Grep'ing the whole file is not good either: AIX grep has a line 3629e0146f7Smrg # limit of 2048, but all sed's we know have understand at least 4000. 3639e0146f7Smrg if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then 3649e0146f7Smrg dirpart=`AS_DIRNAME("$mf")` 3659e0146f7Smrg else 3669e0146f7Smrg continue 3679e0146f7Smrg fi 3689e0146f7Smrg # Extract the definition of DEPDIR, am__include, and am__quote 3699e0146f7Smrg # from the Makefile without running `make'. 3709e0146f7Smrg DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` 3719e0146f7Smrg test -z "$DEPDIR" && continue 3729e0146f7Smrg am__include=`sed -n 's/^am__include = //p' < "$mf"` 3739e0146f7Smrg test -z "am__include" && continue 3749e0146f7Smrg am__quote=`sed -n 's/^am__quote = //p' < "$mf"` 3759e0146f7Smrg # When using ansi2knr, U may be empty or an underscore; expand it 3769e0146f7Smrg U=`sed -n 's/^U = //p' < "$mf"` 3779e0146f7Smrg # Find all dependency output files, they are included files with 3789e0146f7Smrg # $(DEPDIR) in their names. We invoke sed twice because it is the 3799e0146f7Smrg # simplest approach to changing $(DEPDIR) to its actual value in the 3809e0146f7Smrg # expansion. 3819e0146f7Smrg for file in `sed -n " 3829e0146f7Smrg s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ 3839e0146f7Smrg sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do 3849e0146f7Smrg # Make sure the directory exists. 3859e0146f7Smrg test -f "$dirpart/$file" && continue 3869e0146f7Smrg fdir=`AS_DIRNAME(["$file"])` 3879e0146f7Smrg AS_MKDIR_P([$dirpart/$fdir]) 3889e0146f7Smrg # echo "creating $dirpart/$file" 3899e0146f7Smrg echo '# dummy' > "$dirpart/$file" 3909e0146f7Smrg done 391492e1cfeSmrg done 3929e0146f7Smrg} 393492e1cfeSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS 394492e1cfeSmrg 395492e1cfeSmrg 396492e1cfeSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS 397492e1cfeSmrg# ----------------------------- 398492e1cfeSmrg# This macro should only be invoked once -- use via AC_REQUIRE. 399492e1cfeSmrg# 400492e1cfeSmrg# This code is only required when automatic dependency tracking 401492e1cfeSmrg# is enabled. FIXME. This creates each `.P' file that we will 402492e1cfeSmrg# need in order to bootstrap the dependency handling code. 403492e1cfeSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], 404492e1cfeSmrg[AC_CONFIG_COMMANDS([depfiles], 405492e1cfeSmrg [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], 406492e1cfeSmrg [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) 407492e1cfeSmrg]) 408492e1cfeSmrg 4099e0146f7Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 4109e0146f7Smrg# Free Software Foundation, Inc. 4119e0146f7Smrg# 4129e0146f7Smrg# This file is free software; the Free Software Foundation 4139e0146f7Smrg# gives unlimited permission to copy and/or distribute it, 4149e0146f7Smrg# with or without modifications, as long as this notice is preserved. 415492e1cfeSmrg 4169e0146f7Smrg# serial 8 417492e1cfeSmrg 4189e0146f7Smrg# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. 4199e0146f7SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) 420492e1cfeSmrg 4219e0146f7Smrg# Do all the work for Automake. -*- Autoconf -*- 422492e1cfeSmrg 4239e0146f7Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 4249e0146f7Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. 4259e0146f7Smrg# 4269e0146f7Smrg# This file is free software; the Free Software Foundation 4279e0146f7Smrg# gives unlimited permission to copy and/or distribute it, 4289e0146f7Smrg# with or without modifications, as long as this notice is preserved. 4299e0146f7Smrg 4309e0146f7Smrg# serial 16 4319e0146f7Smrg 4329e0146f7Smrg# This macro actually does too much. Some checks are only needed if 4339e0146f7Smrg# your package does certain things. But this isn't really a big deal. 4349e0146f7Smrg 4359e0146f7Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 4369e0146f7Smrg# AM_INIT_AUTOMAKE([OPTIONS]) 4379e0146f7Smrg# ----------------------------------------------- 4389e0146f7Smrg# The call with PACKAGE and VERSION arguments is the old style 4399e0146f7Smrg# call (pre autoconf-2.50), which is being phased out. PACKAGE 4409e0146f7Smrg# and VERSION should now be passed to AC_INIT and removed from 4419e0146f7Smrg# the call to AM_INIT_AUTOMAKE. 4429e0146f7Smrg# We support both call styles for the transition. After 4439e0146f7Smrg# the next Automake release, Autoconf can make the AC_INIT 4449e0146f7Smrg# arguments mandatory, and then we can depend on a new Autoconf 4459e0146f7Smrg# release and drop the old call support. 4469e0146f7SmrgAC_DEFUN([AM_INIT_AUTOMAKE], 4479e0146f7Smrg[AC_PREREQ([2.62])dnl 4489e0146f7Smrgdnl Autoconf wants to disallow AM_ names. We explicitly allow 4499e0146f7Smrgdnl the ones we care about. 4509e0146f7Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 4519e0146f7SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 4529e0146f7SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl 4539e0146f7Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then 4549e0146f7Smrg # Use -I$(srcdir) only when $(srcdir) != ., so that make's output 4559e0146f7Smrg # is not polluted with repeated "-I." 4569e0146f7Smrg AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl 4579e0146f7Smrg # test to see if srcdir already configured 4589e0146f7Smrg if test -f $srcdir/config.status; then 4599e0146f7Smrg AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 4609e0146f7Smrg fi 4619e0146f7Smrgfi 4629e0146f7Smrg 4639e0146f7Smrg# test whether we have cygpath 4649e0146f7Smrgif test -z "$CYGPATH_W"; then 4659e0146f7Smrg if (cygpath --version) >/dev/null 2>/dev/null; then 4669e0146f7Smrg CYGPATH_W='cygpath -w' 4679e0146f7Smrg else 4689e0146f7Smrg CYGPATH_W=echo 4699e0146f7Smrg fi 4709e0146f7Smrgfi 4719e0146f7SmrgAC_SUBST([CYGPATH_W]) 4729e0146f7Smrg 4739e0146f7Smrg# Define the identity of the package. 4749e0146f7Smrgdnl Distinguish between old-style and new-style calls. 4759e0146f7Smrgm4_ifval([$2], 4769e0146f7Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 4779e0146f7Smrg AC_SUBST([PACKAGE], [$1])dnl 4789e0146f7Smrg AC_SUBST([VERSION], [$2])], 4799e0146f7Smrg[_AM_SET_OPTIONS([$1])dnl 4809e0146f7Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. 4819e0146f7Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, 4829e0146f7Smrg [m4_fatal([AC_INIT should be called with package and version arguments])])dnl 4839e0146f7Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl 4849e0146f7Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl 4859e0146f7Smrg 4869e0146f7Smrg_AM_IF_OPTION([no-define],, 4879e0146f7Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) 4889e0146f7Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl 4899e0146f7Smrg 4909e0146f7Smrg# Some tools Automake needs. 4919e0146f7SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl 4929e0146f7SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl 4939e0146f7SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) 4949e0146f7SmrgAM_MISSING_PROG(AUTOCONF, autoconf) 4959e0146f7SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) 4969e0146f7SmrgAM_MISSING_PROG(AUTOHEADER, autoheader) 4979e0146f7SmrgAM_MISSING_PROG(MAKEINFO, makeinfo) 4989e0146f7SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl 4999e0146f7SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl 5009e0146f7SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl 5019e0146f7Smrg# We need awk for the "check" target. The system "awk" is bad on 5029e0146f7Smrg# some platforms. 5039e0146f7SmrgAC_REQUIRE([AC_PROG_AWK])dnl 5049e0146f7SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl 5059e0146f7SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl 5069e0146f7Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], 5079e0146f7Smrg [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], 5089e0146f7Smrg [_AM_PROG_TAR([v7])])]) 5099e0146f7Smrg_AM_IF_OPTION([no-dependencies],, 5109e0146f7Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC], 5119e0146f7Smrg [_AM_DEPENDENCIES(CC)], 5129e0146f7Smrg [define([AC_PROG_CC], 5139e0146f7Smrg defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl 5149e0146f7SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX], 5159e0146f7Smrg [_AM_DEPENDENCIES(CXX)], 5169e0146f7Smrg [define([AC_PROG_CXX], 5179e0146f7Smrg defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl 5189e0146f7SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC], 5199e0146f7Smrg [_AM_DEPENDENCIES(OBJC)], 5209e0146f7Smrg [define([AC_PROG_OBJC], 5219e0146f7Smrg defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl 5229e0146f7Smrg]) 5239e0146f7Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl 5249e0146f7Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the 5259e0146f7Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro 5269e0146f7Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below. 5279e0146f7SmrgAC_CONFIG_COMMANDS_PRE(dnl 5289e0146f7Smrg[m4_provide_if([_AM_COMPILER_EXEEXT], 5299e0146f7Smrg [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl 5309e0146f7Smrg]) 5319e0146f7Smrg 5329e0146f7Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not 5339e0146f7Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further 5349e0146f7Smrgdnl mangled by Autoconf and run in a shell conditional statement. 5359e0146f7Smrgm4_define([_AC_COMPILER_EXEEXT], 5369e0146f7Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) 5379e0146f7Smrg 5389e0146f7Smrg 5399e0146f7Smrg# When config.status generates a header, we must update the stamp-h file. 5409e0146f7Smrg# This file resides in the same directory as the config header 5419e0146f7Smrg# that is generated. The stamp files are numbered to have different names. 5429e0146f7Smrg 5439e0146f7Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 5449e0146f7Smrg# loop where config.status creates the headers, so we can generate 5459e0146f7Smrg# our stamp files there. 5469e0146f7SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 5479e0146f7Smrg[# Compute $1's index in $config_headers. 5489e0146f7Smrg_am_arg=$1 5499e0146f7Smrg_am_stamp_count=1 5509e0146f7Smrgfor _am_header in $config_headers :; do 5519e0146f7Smrg case $_am_header in 5529e0146f7Smrg $_am_arg | $_am_arg:* ) 5539e0146f7Smrg break ;; 5549e0146f7Smrg * ) 5559e0146f7Smrg _am_stamp_count=`expr $_am_stamp_count + 1` ;; 5569e0146f7Smrg esac 5579e0146f7Smrgdone 5589e0146f7Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) 5599e0146f7Smrg 5609e0146f7Smrg# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. 5619e0146f7Smrg# 5629e0146f7Smrg# This file is free software; the Free Software Foundation 5639e0146f7Smrg# gives unlimited permission to copy and/or distribute it, 5649e0146f7Smrg# with or without modifications, as long as this notice is preserved. 5659e0146f7Smrg 5669e0146f7Smrg# AM_PROG_INSTALL_SH 5679e0146f7Smrg# ------------------ 5689e0146f7Smrg# Define $install_sh. 5699e0146f7SmrgAC_DEFUN([AM_PROG_INSTALL_SH], 5709e0146f7Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 5719e0146f7Smrgif test x"${install_sh}" != xset; then 5729e0146f7Smrg case $am_aux_dir in 5739e0146f7Smrg *\ * | *\ *) 5749e0146f7Smrg install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; 5759e0146f7Smrg *) 5769e0146f7Smrg install_sh="\${SHELL} $am_aux_dir/install-sh" 5779e0146f7Smrg esac 5789e0146f7Smrgfi 5799e0146f7SmrgAC_SUBST(install_sh)]) 5809e0146f7Smrg 5819e0146f7Smrg# Copyright (C) 2003, 2005 Free Software Foundation, Inc. 5829e0146f7Smrg# 5839e0146f7Smrg# This file is free software; the Free Software Foundation 5849e0146f7Smrg# gives unlimited permission to copy and/or distribute it, 5859e0146f7Smrg# with or without modifications, as long as this notice is preserved. 586492e1cfeSmrg 587492e1cfeSmrg# serial 2 588492e1cfeSmrg 5899e0146f7Smrg# Check whether the underlying file-system supports filenames 5909e0146f7Smrg# with a leading dot. For instance MS-DOS doesn't. 5919e0146f7SmrgAC_DEFUN([AM_SET_LEADING_DOT], 5929e0146f7Smrg[rm -rf .tst 2>/dev/null 5939e0146f7Smrgmkdir .tst 2>/dev/null 5949e0146f7Smrgif test -d .tst; then 5959e0146f7Smrg am__leading_dot=. 5969e0146f7Smrgelse 5979e0146f7Smrg am__leading_dot=_ 5989e0146f7Smrgfi 5999e0146f7Smrgrmdir .tst 2>/dev/null 6009e0146f7SmrgAC_SUBST([am__leading_dot])]) 6019e0146f7Smrg 6029e0146f7Smrg# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- 6039e0146f7Smrg# From Jim Meyering 6049e0146f7Smrg 6059e0146f7Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 6069e0146f7Smrg# Free Software Foundation, Inc. 6079e0146f7Smrg# 6089e0146f7Smrg# This file is free software; the Free Software Foundation 6099e0146f7Smrg# gives unlimited permission to copy and/or distribute it, 6109e0146f7Smrg# with or without modifications, as long as this notice is preserved. 6119e0146f7Smrg 6129e0146f7Smrg# serial 5 6139e0146f7Smrg 6149e0146f7Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE]) 6159e0146f7Smrg# ---------------------------------- 6169e0146f7Smrg# Control maintainer-specific portions of Makefiles. 6179e0146f7Smrg# Default is to disable them, unless `enable' is passed literally. 6189e0146f7Smrg# For symmetry, `disable' may be passed as well. Anyway, the user 6199e0146f7Smrg# can override the default with the --enable/--disable switch. 6209e0146f7SmrgAC_DEFUN([AM_MAINTAINER_MODE], 6219e0146f7Smrg[m4_case(m4_default([$1], [disable]), 6229e0146f7Smrg [enable], [m4_define([am_maintainer_other], [disable])], 6239e0146f7Smrg [disable], [m4_define([am_maintainer_other], [enable])], 6249e0146f7Smrg [m4_define([am_maintainer_other], [enable]) 6259e0146f7Smrg m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) 6269e0146f7SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) 6279e0146f7Smrg dnl maintainer-mode's default is 'disable' unless 'enable' is passed 6289e0146f7Smrg AC_ARG_ENABLE([maintainer-mode], 6299e0146f7Smrg[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful 6309e0146f7Smrg (and sometimes confusing) to the casual installer], 6319e0146f7Smrg [USE_MAINTAINER_MODE=$enableval], 6329e0146f7Smrg [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) 6339e0146f7Smrg AC_MSG_RESULT([$USE_MAINTAINER_MODE]) 6349e0146f7Smrg AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) 6359e0146f7Smrg MAINT=$MAINTAINER_MODE_TRUE 6369e0146f7Smrg AC_SUBST([MAINT])dnl 6379e0146f7Smrg] 6389e0146f7Smrg) 6399e0146f7Smrg 6409e0146f7SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) 6419e0146f7Smrg 6429e0146f7Smrg# Check to see how 'make' treats includes. -*- Autoconf -*- 6439e0146f7Smrg 6449e0146f7Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. 6459e0146f7Smrg# 6469e0146f7Smrg# This file is free software; the Free Software Foundation 6479e0146f7Smrg# gives unlimited permission to copy and/or distribute it, 6489e0146f7Smrg# with or without modifications, as long as this notice is preserved. 6499e0146f7Smrg 6509e0146f7Smrg# serial 4 6519e0146f7Smrg 652492e1cfeSmrg# AM_MAKE_INCLUDE() 653492e1cfeSmrg# ----------------- 654492e1cfeSmrg# Check to see how make treats includes. 655492e1cfeSmrgAC_DEFUN([AM_MAKE_INCLUDE], 656492e1cfeSmrg[am_make=${MAKE-make} 657492e1cfeSmrgcat > confinc << 'END' 658492e1cfeSmrgam__doit: 6599e0146f7Smrg @echo this is the am__doit target 660492e1cfeSmrg.PHONY: am__doit 661492e1cfeSmrgEND 662492e1cfeSmrg# If we don't find an include directive, just comment out the code. 663492e1cfeSmrgAC_MSG_CHECKING([for style of include used by $am_make]) 664492e1cfeSmrgam__include="#" 665492e1cfeSmrgam__quote= 666492e1cfeSmrg_am_result=none 667492e1cfeSmrg# First try GNU make style include. 668492e1cfeSmrgecho "include confinc" > confmf 6699e0146f7Smrg# Ignore all kinds of additional output from `make'. 6709e0146f7Smrgcase `$am_make -s -f confmf 2> /dev/null` in #( 6719e0146f7Smrg*the\ am__doit\ target*) 6729e0146f7Smrg am__include=include 6739e0146f7Smrg am__quote= 6749e0146f7Smrg _am_result=GNU 6759e0146f7Smrg ;; 6769e0146f7Smrgesac 677492e1cfeSmrg# Now try BSD make style include. 678492e1cfeSmrgif test "$am__include" = "#"; then 679492e1cfeSmrg echo '.include "confinc"' > confmf 6809e0146f7Smrg case `$am_make -s -f confmf 2> /dev/null` in #( 6819e0146f7Smrg *the\ am__doit\ target*) 6829e0146f7Smrg am__include=.include 6839e0146f7Smrg am__quote="\"" 6849e0146f7Smrg _am_result=BSD 6859e0146f7Smrg ;; 6869e0146f7Smrg esac 687492e1cfeSmrgfi 688492e1cfeSmrgAC_SUBST([am__include]) 689492e1cfeSmrgAC_SUBST([am__quote]) 690492e1cfeSmrgAC_MSG_RESULT([$_am_result]) 691492e1cfeSmrgrm -f confinc confmf 692492e1cfeSmrg]) 693492e1cfeSmrg 6949e0146f7Smrg# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- 695492e1cfeSmrg 6969e0146f7Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 6979e0146f7Smrg# Free Software Foundation, Inc. 6989e0146f7Smrg# 6999e0146f7Smrg# This file is free software; the Free Software Foundation 7009e0146f7Smrg# gives unlimited permission to copy and/or distribute it, 7019e0146f7Smrg# with or without modifications, as long as this notice is preserved. 702492e1cfeSmrg 7039e0146f7Smrg# serial 6 704492e1cfeSmrg 7059e0146f7Smrg# AM_MISSING_PROG(NAME, PROGRAM) 7069e0146f7Smrg# ------------------------------ 7079e0146f7SmrgAC_DEFUN([AM_MISSING_PROG], 7089e0146f7Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN]) 7099e0146f7Smrg$1=${$1-"${am_missing_run}$2"} 7109e0146f7SmrgAC_SUBST($1)]) 711492e1cfeSmrg 712492e1cfeSmrg 7139e0146f7Smrg# AM_MISSING_HAS_RUN 7149e0146f7Smrg# ------------------ 7159e0146f7Smrg# Define MISSING if not defined so far and test if it supports --run. 7169e0146f7Smrg# If it does, set am_missing_run to use it, otherwise, to nothing. 7179e0146f7SmrgAC_DEFUN([AM_MISSING_HAS_RUN], 7189e0146f7Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 7199e0146f7SmrgAC_REQUIRE_AUX_FILE([missing])dnl 7209e0146f7Smrgif test x"${MISSING+set}" != xset; then 7219e0146f7Smrg case $am_aux_dir in 7229e0146f7Smrg *\ * | *\ *) 7239e0146f7Smrg MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; 7249e0146f7Smrg *) 7259e0146f7Smrg MISSING="\${SHELL} $am_aux_dir/missing" ;; 7269e0146f7Smrg esac 7279e0146f7Smrgfi 7289e0146f7Smrg# Use eval to expand $SHELL 7299e0146f7Smrgif eval "$MISSING --run true"; then 7309e0146f7Smrg am_missing_run="$MISSING --run " 731492e1cfeSmrgelse 7329e0146f7Smrg am_missing_run= 7339e0146f7Smrg AC_MSG_WARN([`missing' script is too old or missing]) 734492e1cfeSmrgfi 7359e0146f7Smrg]) 736492e1cfeSmrg 7379e0146f7Smrg# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 7389e0146f7Smrg# 7399e0146f7Smrg# This file is free software; the Free Software Foundation 7409e0146f7Smrg# gives unlimited permission to copy and/or distribute it, 7419e0146f7Smrg# with or without modifications, as long as this notice is preserved. 742492e1cfeSmrg 7439e0146f7Smrg# AM_PROG_MKDIR_P 7449e0146f7Smrg# --------------- 7459e0146f7Smrg# Check for `mkdir -p'. 7469e0146f7SmrgAC_DEFUN([AM_PROG_MKDIR_P], 7479e0146f7Smrg[AC_PREREQ([2.60])dnl 7489e0146f7SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl 7499e0146f7Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, 7509e0146f7Smrgdnl while keeping a definition of mkdir_p for backward compatibility. 7519e0146f7Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. 7529e0146f7Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of 7539e0146f7Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own 7549e0146f7Smrgdnl adjustment using top_builddir (which is defined more often than 7559e0146f7Smrgdnl MKDIR_P). 7569e0146f7SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl 7579e0146f7Smrgcase $mkdir_p in 7589e0146f7Smrg [[\\/$]]* | ?:[[\\/]]*) ;; 7599e0146f7Smrg */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; 7609e0146f7Smrgesac 7619e0146f7Smrg]) 762492e1cfeSmrg 7639e0146f7Smrg# Helper functions for option handling. -*- Autoconf -*- 764492e1cfeSmrg 7659e0146f7Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. 7669e0146f7Smrg# 7679e0146f7Smrg# This file is free software; the Free Software Foundation 7689e0146f7Smrg# gives unlimited permission to copy and/or distribute it, 7699e0146f7Smrg# with or without modifications, as long as this notice is preserved. 770492e1cfeSmrg 7719e0146f7Smrg# serial 4 772492e1cfeSmrg 7739e0146f7Smrg# _AM_MANGLE_OPTION(NAME) 7749e0146f7Smrg# ----------------------- 7759e0146f7SmrgAC_DEFUN([_AM_MANGLE_OPTION], 7769e0146f7Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 777492e1cfeSmrg 7789e0146f7Smrg# _AM_SET_OPTION(NAME) 7799e0146f7Smrg# ------------------------------ 7809e0146f7Smrg# Set option NAME. Presently that only means defining a flag for this option. 7819e0146f7SmrgAC_DEFUN([_AM_SET_OPTION], 7829e0146f7Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) 783492e1cfeSmrg 7849e0146f7Smrg# _AM_SET_OPTIONS(OPTIONS) 7859e0146f7Smrg# ---------------------------------- 7869e0146f7Smrg# OPTIONS is a space-separated list of Automake options. 7879e0146f7SmrgAC_DEFUN([_AM_SET_OPTIONS], 7889e0146f7Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 789492e1cfeSmrg 7909e0146f7Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 7919e0146f7Smrg# ------------------------------------------- 7929e0146f7Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 7939e0146f7SmrgAC_DEFUN([_AM_IF_OPTION], 7949e0146f7Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 795492e1cfeSmrg 7969e0146f7Smrg# Check to make sure that the build environment is sane. -*- Autoconf -*- 797492e1cfeSmrg 7989e0146f7Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 7999e0146f7Smrg# Free Software Foundation, Inc. 800492e1cfeSmrg# 8019e0146f7Smrg# This file is free software; the Free Software Foundation 8029e0146f7Smrg# gives unlimited permission to copy and/or distribute it, 8039e0146f7Smrg# with or without modifications, as long as this notice is preserved. 804492e1cfeSmrg 8059e0146f7Smrg# serial 5 806492e1cfeSmrg 8079e0146f7Smrg# AM_SANITY_CHECK 8089e0146f7Smrg# --------------- 8099e0146f7SmrgAC_DEFUN([AM_SANITY_CHECK], 8109e0146f7Smrg[AC_MSG_CHECKING([whether build environment is sane]) 8119e0146f7Smrg# Just in case 8129e0146f7Smrgsleep 1 8139e0146f7Smrgecho timestamp > conftest.file 8149e0146f7Smrg# Reject unsafe characters in $srcdir or the absolute working directory 8159e0146f7Smrg# name. Accept space and tab only in the latter. 8169e0146f7Smrgam_lf=' 8179e0146f7Smrg' 8189e0146f7Smrgcase `pwd` in 8199e0146f7Smrg *[[\\\"\#\$\&\'\`$am_lf]]*) 8209e0146f7Smrg AC_MSG_ERROR([unsafe absolute working directory name]);; 8219e0146f7Smrgesac 8229e0146f7Smrgcase $srcdir in 8239e0146f7Smrg *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) 8249e0146f7Smrg AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; 8259e0146f7Smrgesac 826492e1cfeSmrg 8279e0146f7Smrg# Do `set' in a subshell so we don't clobber the current shell's 8289e0146f7Smrg# arguments. Must try -L first in case configure is actually a 8299e0146f7Smrg# symlink; some systems play weird games with the mod time of symlinks 8309e0146f7Smrg# (eg FreeBSD returns the mod time of the symlink's containing 8319e0146f7Smrg# directory). 8329e0146f7Smrgif ( 8339e0146f7Smrg set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` 8349e0146f7Smrg if test "$[*]" = "X"; then 8359e0146f7Smrg # -L didn't work. 8369e0146f7Smrg set X `ls -t "$srcdir/configure" conftest.file` 8379e0146f7Smrg fi 8389e0146f7Smrg rm -f conftest.file 8399e0146f7Smrg if test "$[*]" != "X $srcdir/configure conftest.file" \ 8409e0146f7Smrg && test "$[*]" != "X conftest.file $srcdir/configure"; then 8419e0146f7Smrg 8429e0146f7Smrg # If neither matched, then we have a broken ls. This can happen 8439e0146f7Smrg # if, for instance, CONFIG_SHELL is bash and it inherits a 8449e0146f7Smrg # broken ls alias from the environment. This has actually 8459e0146f7Smrg # happened. Such a system could not be considered "sane". 8469e0146f7Smrg AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 8479e0146f7Smrgalias in your environment]) 8489e0146f7Smrg fi 849492e1cfeSmrg 8509e0146f7Smrg test "$[2]" = conftest.file 8519e0146f7Smrg ) 8529e0146f7Smrgthen 8539e0146f7Smrg # Ok. 8549e0146f7Smrg : 855492e1cfeSmrgelse 8569e0146f7Smrg AC_MSG_ERROR([newly created file is older than distributed files! 8579e0146f7SmrgCheck your system clock]) 8589e0146f7Smrgfi 8599e0146f7SmrgAC_MSG_RESULT(yes)]) 860492e1cfeSmrg 8619e0146f7Smrg# Copyright (C) 2009 Free Software Foundation, Inc. 8629e0146f7Smrg# 8639e0146f7Smrg# This file is free software; the Free Software Foundation 8649e0146f7Smrg# gives unlimited permission to copy and/or distribute it, 8659e0146f7Smrg# with or without modifications, as long as this notice is preserved. 866492e1cfeSmrg 8679e0146f7Smrg# serial 1 868492e1cfeSmrg 8699e0146f7Smrg# AM_SILENT_RULES([DEFAULT]) 8709e0146f7Smrg# -------------------------- 8719e0146f7Smrg# Enable less verbose build rules; with the default set to DEFAULT 8729e0146f7Smrg# (`yes' being less verbose, `no' or empty being verbose). 8739e0146f7SmrgAC_DEFUN([AM_SILENT_RULES], 8749e0146f7Smrg[AC_ARG_ENABLE([silent-rules], 8759e0146f7Smrg[ --enable-silent-rules less verbose build output (undo: `make V=1') 8769e0146f7Smrg --disable-silent-rules verbose build output (undo: `make V=0')]) 8779e0146f7Smrgcase $enable_silent_rules in 8789e0146f7Smrgyes) AM_DEFAULT_VERBOSITY=0;; 8799e0146f7Smrgno) AM_DEFAULT_VERBOSITY=1;; 8809e0146f7Smrg*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; 8819e0146f7Smrgesac 8829e0146f7SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl 8839e0146f7SmrgAM_BACKSLASH='\' 8849e0146f7SmrgAC_SUBST([AM_BACKSLASH])dnl 8859e0146f7Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl 8869e0146f7Smrg]) 8879e0146f7Smrg 8889e0146f7Smrg# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 889492e1cfeSmrg# 8909e0146f7Smrg# This file is free software; the Free Software Foundation 8919e0146f7Smrg# gives unlimited permission to copy and/or distribute it, 8929e0146f7Smrg# with or without modifications, as long as this notice is preserved. 8939e0146f7Smrg 8949e0146f7Smrg# AM_PROG_INSTALL_STRIP 8959e0146f7Smrg# --------------------- 8969e0146f7Smrg# One issue with vendor `install' (even GNU) is that you can't 8979e0146f7Smrg# specify the program used to strip binaries. This is especially 8989e0146f7Smrg# annoying in cross-compiling environments, where the build's strip 8999e0146f7Smrg# is unlikely to handle the host's binaries. 9009e0146f7Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we 9019e0146f7Smrg# always use install-sh in `make install-strip', and initialize 9029e0146f7Smrg# STRIPPROG with the value of the STRIP variable (set by the user). 9039e0146f7SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP], 9049e0146f7Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 9059e0146f7Smrg# Installed binaries are usually stripped using `strip' when the user 9069e0146f7Smrg# run `make install-strip'. However `strip' might not be the right 9079e0146f7Smrg# tool to use in cross-compilation environments, therefore Automake 9089e0146f7Smrg# will honor the `STRIP' environment variable to overrule this program. 9099e0146f7Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'. 9109e0146f7Smrgif test "$cross_compiling" != no; then 9119e0146f7Smrg AC_CHECK_TOOL([STRIP], [strip], :) 9129e0146f7Smrgfi 9139e0146f7SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" 9149e0146f7SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])]) 9159e0146f7Smrg 9169e0146f7Smrg# Copyright (C) 2006, 2008 Free Software Foundation, Inc. 917492e1cfeSmrg# 9189e0146f7Smrg# This file is free software; the Free Software Foundation 9199e0146f7Smrg# gives unlimited permission to copy and/or distribute it, 9209e0146f7Smrg# with or without modifications, as long as this notice is preserved. 921492e1cfeSmrg 9229e0146f7Smrg# serial 2 923492e1cfeSmrg 9249e0146f7Smrg# _AM_SUBST_NOTMAKE(VARIABLE) 9259e0146f7Smrg# --------------------------- 9269e0146f7Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. 9279e0146f7Smrg# This macro is traced by Automake. 9289e0146f7SmrgAC_DEFUN([_AM_SUBST_NOTMAKE]) 929492e1cfeSmrg 9309e0146f7Smrg# AM_SUBST_NOTMAKE(VARIABLE) 9319e0146f7Smrg# --------------------------- 9329e0146f7Smrg# Public sister of _AM_SUBST_NOTMAKE. 9339e0146f7SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) 934492e1cfeSmrg 9359e0146f7Smrg# Check how to create a tarball. -*- Autoconf -*- 936492e1cfeSmrg 9379e0146f7Smrg# Copyright (C) 2004, 2005 Free Software Foundation, Inc. 9389e0146f7Smrg# 9399e0146f7Smrg# This file is free software; the Free Software Foundation 9409e0146f7Smrg# gives unlimited permission to copy and/or distribute it, 9419e0146f7Smrg# with or without modifications, as long as this notice is preserved. 942492e1cfeSmrg 9439e0146f7Smrg# serial 2 944492e1cfeSmrg 9459e0146f7Smrg# _AM_PROG_TAR(FORMAT) 9469e0146f7Smrg# -------------------- 9479e0146f7Smrg# Check how to create a tarball in format FORMAT. 9489e0146f7Smrg# FORMAT should be one of `v7', `ustar', or `pax'. 9499e0146f7Smrg# 9509e0146f7Smrg# Substitute a variable $(am__tar) that is a command 9519e0146f7Smrg# writing to stdout a FORMAT-tarball containing the directory 9529e0146f7Smrg# $tardir. 9539e0146f7Smrg# tardir=directory && $(am__tar) > result.tar 9549e0146f7Smrg# 9559e0146f7Smrg# Substitute a variable $(am__untar) that extract such 9569e0146f7Smrg# a tarball read from stdin. 9579e0146f7Smrg# $(am__untar) < result.tar 9589e0146f7SmrgAC_DEFUN([_AM_PROG_TAR], 9599e0146f7Smrg[# Always define AMTAR for backward compatibility. 9609e0146f7SmrgAM_MISSING_PROG([AMTAR], [tar]) 9619e0146f7Smrgm4_if([$1], [v7], 9629e0146f7Smrg [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], 9639e0146f7Smrg [m4_case([$1], [ustar],, [pax],, 9649e0146f7Smrg [m4_fatal([Unknown tar format])]) 9659e0146f7SmrgAC_MSG_CHECKING([how to create a $1 tar archive]) 9669e0146f7Smrg# Loop over all known methods to create a tar archive until one works. 9679e0146f7Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' 9689e0146f7Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools} 9699e0146f7Smrg# Do not fold the above two line into one, because Tru64 sh and 9709e0146f7Smrg# Solaris sh will not grok spaces in the rhs of `-'. 9719e0146f7Smrgfor _am_tool in $_am_tools 9729e0146f7Smrgdo 9739e0146f7Smrg case $_am_tool in 9749e0146f7Smrg gnutar) 9759e0146f7Smrg for _am_tar in tar gnutar gtar; 9769e0146f7Smrg do 9779e0146f7Smrg AM_RUN_LOG([$_am_tar --version]) && break 9789e0146f7Smrg done 9799e0146f7Smrg am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' 9809e0146f7Smrg am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' 9819e0146f7Smrg am__untar="$_am_tar -xf -" 9829e0146f7Smrg ;; 9839e0146f7Smrg plaintar) 9849e0146f7Smrg # Must skip GNU tar: if it does not support --format= it doesn't create 9859e0146f7Smrg # ustar tarball either. 9869e0146f7Smrg (tar --version) >/dev/null 2>&1 && continue 9879e0146f7Smrg am__tar='tar chf - "$$tardir"' 9889e0146f7Smrg am__tar_='tar chf - "$tardir"' 9899e0146f7Smrg am__untar='tar xf -' 9909e0146f7Smrg ;; 9919e0146f7Smrg pax) 9929e0146f7Smrg am__tar='pax -L -x $1 -w "$$tardir"' 9939e0146f7Smrg am__tar_='pax -L -x $1 -w "$tardir"' 9949e0146f7Smrg am__untar='pax -r' 9959e0146f7Smrg ;; 9969e0146f7Smrg cpio) 9979e0146f7Smrg am__tar='find "$$tardir" -print | cpio -o -H $1 -L' 9989e0146f7Smrg am__tar_='find "$tardir" -print | cpio -o -H $1 -L' 9999e0146f7Smrg am__untar='cpio -i -H $1 -d' 10009e0146f7Smrg ;; 10019e0146f7Smrg none) 10029e0146f7Smrg am__tar=false 10039e0146f7Smrg am__tar_=false 10049e0146f7Smrg am__untar=false 10059e0146f7Smrg ;; 10069e0146f7Smrg esac 1007492e1cfeSmrg 10089e0146f7Smrg # If the value was cached, stop now. We just wanted to have am__tar 10099e0146f7Smrg # and am__untar set. 10109e0146f7Smrg test -n "${am_cv_prog_tar_$1}" && break 1011492e1cfeSmrg 10129e0146f7Smrg # tar/untar a dummy directory, and stop if the command works 10139e0146f7Smrg rm -rf conftest.dir 10149e0146f7Smrg mkdir conftest.dir 10159e0146f7Smrg echo GrepMe > conftest.dir/file 10169e0146f7Smrg AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) 10179e0146f7Smrg rm -rf conftest.dir 10189e0146f7Smrg if test -s conftest.tar; then 10199e0146f7Smrg AM_RUN_LOG([$am__untar <conftest.tar]) 10209e0146f7Smrg grep GrepMe conftest.dir/file >/dev/null 2>&1 && break 10219e0146f7Smrg fi 10229e0146f7Smrgdone 10239e0146f7Smrgrm -rf conftest.dir 1024492e1cfeSmrg 10259e0146f7SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) 10269e0146f7SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])]) 10279e0146f7SmrgAC_SUBST([am__tar]) 10289e0146f7SmrgAC_SUBST([am__untar]) 10299e0146f7Smrg]) # _AM_PROG_TAR 1030492e1cfeSmrg 10319e0146f7Smrgm4_include([m4/ax_define_dir.m4]) 10329e0146f7Smrgdnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. 1033492e1cfeSmrgdnl 10349e0146f7Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. 1035492e1cfeSmrgdnl 10369e0146f7Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a 10379e0146f7Smrgdnl copy of this software and associated documentation files (the "Software"), 10389e0146f7Smrgdnl to deal in the Software without restriction, including without limitation 10399e0146f7Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense, 10409e0146f7Smrgdnl and/or sell copies of the Software, and to permit persons to whom the 10419e0146f7Smrgdnl Software is furnished to do so, subject to the following conditions: 10429e0146f7Smrgdnl 10439e0146f7Smrgdnl The above copyright notice and this permission notice (including the next 10449e0146f7Smrgdnl paragraph) shall be included in all copies or substantial portions of the 10459e0146f7Smrgdnl Software. 10469e0146f7Smrgdnl 10479e0146f7Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 10489e0146f7Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 10499e0146f7Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 10509e0146f7Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 10519e0146f7Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 10529e0146f7Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 10539e0146f7Smrgdnl DEALINGS IN THE SOFTWARE. 10549e0146f7Smrg 10559e0146f7Smrg# XORG_MACROS_VERSION(required-version) 10569e0146f7Smrg# ------------------------------------- 10579e0146f7Smrg# Minimum version: 1.1.0 10589e0146f7Smrg# 10599e0146f7Smrg# If you're using a macro added in Version 1.1 or newer, include this in 10609e0146f7Smrg# your configure.ac with the minimum required version, such as: 10619e0146f7Smrg# XORG_MACROS_VERSION(1.1) 10629e0146f7Smrg# 10639e0146f7Smrg# To ensure that this macro is defined, also add: 10649e0146f7Smrg# m4_ifndef([XORG_MACROS_VERSION], 10659e0146f7Smrg# [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])]) 10669e0146f7Smrg# 10679e0146f7Smrg# 10689e0146f7Smrg# See the "minimum version" comment for each macro you use to see what 10699e0146f7Smrg# version you require. 10709e0146f7Smrgm4_defun([XORG_MACROS_VERSION],[ 10719e0146f7Smrgm4_define([vers_have], [1.10.1]) 10729e0146f7Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) 10739e0146f7Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) 10749e0146f7Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,, 10759e0146f7Smrg [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])]) 10769e0146f7Smrgm4_if(m4_version_compare(vers_have, [$1]), -1, 10779e0146f7Smrg [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])]) 10789e0146f7Smrgm4_undefine([vers_have]) 10799e0146f7Smrgm4_undefine([maj_have]) 10809e0146f7Smrgm4_undefine([maj_needed]) 10819e0146f7Smrg]) # XORG_MACROS_VERSION 1082492e1cfeSmrg 1083492e1cfeSmrg# XORG_PROG_RAWCPP() 1084492e1cfeSmrg# ------------------ 10859e0146f7Smrg# Minimum version: 1.0.0 10869e0146f7Smrg# 1087492e1cfeSmrg# Find cpp program and necessary flags for use in pre-processing text files 1088492e1cfeSmrg# such as man pages and config files 1089492e1cfeSmrgAC_DEFUN([XORG_PROG_RAWCPP],[ 1090492e1cfeSmrgAC_REQUIRE([AC_PROG_CPP]) 1091492e1cfeSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 1092492e1cfeSmrg [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) 1093492e1cfeSmrg 1094492e1cfeSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined, 1095492e1cfeSmrg# which is not the best choice for supporting other OS'es, but covers most 1096492e1cfeSmrg# of the ones we need for now. 1097492e1cfeSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef]) 1098492e1cfeSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?]) 1099492e1cfeSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 1100492e1cfeSmrg AC_MSG_RESULT([no]) 1101492e1cfeSmrgelse 1102492e1cfeSmrg if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 1103492e1cfeSmrg RAWCPPFLAGS=-undef 1104492e1cfeSmrg AC_MSG_RESULT([yes]) 11059e0146f7Smrg # under Cygwin unix is still defined even with -undef 11069e0146f7Smrg elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 11079e0146f7Smrg RAWCPPFLAGS="-undef -ansi" 11089e0146f7Smrg AC_MSG_RESULT([yes, with -ansi]) 1109492e1cfeSmrg else 1110492e1cfeSmrg AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.]) 1111492e1cfeSmrg fi 1112492e1cfeSmrgfi 1113492e1cfeSmrgrm -f conftest.$ac_ext 1114492e1cfeSmrg 1115492e1cfeSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional]) 1116492e1cfeSmrgAC_LANG_CONFTEST([Does cpp preserve "whitespace"?]) 1117492e1cfeSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 1118492e1cfeSmrg AC_MSG_RESULT([no]) 1119492e1cfeSmrgelse 1120492e1cfeSmrg if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 1121492e1cfeSmrg RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" 1122492e1cfeSmrg AC_MSG_RESULT([yes]) 1123492e1cfeSmrg else 1124492e1cfeSmrg AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) 1125492e1cfeSmrg fi 1126492e1cfeSmrgfi 1127492e1cfeSmrgrm -f conftest.$ac_ext 1128492e1cfeSmrgAC_SUBST(RAWCPPFLAGS) 1129492e1cfeSmrg]) # XORG_PROG_RAWCPP 1130492e1cfeSmrg 1131492e1cfeSmrg# XORG_MANPAGE_SECTIONS() 1132492e1cfeSmrg# ----------------------- 11339e0146f7Smrg# Minimum version: 1.0.0 11349e0146f7Smrg# 1135492e1cfeSmrg# Determine which sections man pages go in for the different man page types 1136492e1cfeSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. 1137492e1cfeSmrg# Not sure if there's any better way than just hardcoding by OS name. 1138492e1cfeSmrg# Override default settings by setting environment variables 11399e0146f7Smrg# Added MAN_SUBSTS in version 1.8 11409e0146f7Smrg# Added AC_PROG_SED in version 1.8 1141492e1cfeSmrg 1142492e1cfeSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[ 1143492e1cfeSmrgAC_REQUIRE([AC_CANONICAL_HOST]) 11449e0146f7SmrgAC_REQUIRE([AC_PROG_SED]) 1145492e1cfeSmrg 1146492e1cfeSmrgif test x$APP_MAN_SUFFIX = x ; then 11479e0146f7Smrg APP_MAN_SUFFIX=1 1148492e1cfeSmrgfi 1149492e1cfeSmrgif test x$APP_MAN_DIR = x ; then 11509e0146f7Smrg APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' 1151492e1cfeSmrgfi 1152492e1cfeSmrg 1153492e1cfeSmrgif test x$LIB_MAN_SUFFIX = x ; then 11549e0146f7Smrg LIB_MAN_SUFFIX=3 1155492e1cfeSmrgfi 1156492e1cfeSmrgif test x$LIB_MAN_DIR = x ; then 11579e0146f7Smrg LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' 1158492e1cfeSmrgfi 1159492e1cfeSmrg 1160492e1cfeSmrgif test x$FILE_MAN_SUFFIX = x ; then 1161492e1cfeSmrg case $host_os in 1162492e1cfeSmrg solaris*) FILE_MAN_SUFFIX=4 ;; 1163492e1cfeSmrg *) FILE_MAN_SUFFIX=5 ;; 1164492e1cfeSmrg esac 1165492e1cfeSmrgfi 1166492e1cfeSmrgif test x$FILE_MAN_DIR = x ; then 11679e0146f7Smrg FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' 1168492e1cfeSmrgfi 1169492e1cfeSmrg 1170492e1cfeSmrgif test x$MISC_MAN_SUFFIX = x ; then 1171492e1cfeSmrg case $host_os in 1172492e1cfeSmrg solaris*) MISC_MAN_SUFFIX=5 ;; 1173492e1cfeSmrg *) MISC_MAN_SUFFIX=7 ;; 1174492e1cfeSmrg esac 1175492e1cfeSmrgfi 1176492e1cfeSmrgif test x$MISC_MAN_DIR = x ; then 11779e0146f7Smrg MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' 1178492e1cfeSmrgfi 1179492e1cfeSmrg 1180492e1cfeSmrgif test x$DRIVER_MAN_SUFFIX = x ; then 1181492e1cfeSmrg case $host_os in 1182492e1cfeSmrg solaris*) DRIVER_MAN_SUFFIX=7 ;; 1183492e1cfeSmrg *) DRIVER_MAN_SUFFIX=4 ;; 1184492e1cfeSmrg esac 1185492e1cfeSmrgfi 1186492e1cfeSmrgif test x$DRIVER_MAN_DIR = x ; then 11879e0146f7Smrg DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' 1188492e1cfeSmrgfi 1189492e1cfeSmrg 1190492e1cfeSmrgif test x$ADMIN_MAN_SUFFIX = x ; then 1191492e1cfeSmrg case $host_os in 1192492e1cfeSmrg solaris*) ADMIN_MAN_SUFFIX=1m ;; 1193492e1cfeSmrg *) ADMIN_MAN_SUFFIX=8 ;; 1194492e1cfeSmrg esac 1195492e1cfeSmrgfi 1196492e1cfeSmrgif test x$ADMIN_MAN_DIR = x ; then 1197492e1cfeSmrg ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' 1198492e1cfeSmrgfi 1199492e1cfeSmrg 1200492e1cfeSmrg 1201492e1cfeSmrgAC_SUBST([APP_MAN_SUFFIX]) 1202492e1cfeSmrgAC_SUBST([LIB_MAN_SUFFIX]) 1203492e1cfeSmrgAC_SUBST([FILE_MAN_SUFFIX]) 1204492e1cfeSmrgAC_SUBST([MISC_MAN_SUFFIX]) 1205492e1cfeSmrgAC_SUBST([DRIVER_MAN_SUFFIX]) 1206492e1cfeSmrgAC_SUBST([ADMIN_MAN_SUFFIX]) 1207492e1cfeSmrgAC_SUBST([APP_MAN_DIR]) 1208492e1cfeSmrgAC_SUBST([LIB_MAN_DIR]) 1209492e1cfeSmrgAC_SUBST([FILE_MAN_DIR]) 1210492e1cfeSmrgAC_SUBST([MISC_MAN_DIR]) 1211492e1cfeSmrgAC_SUBST([DRIVER_MAN_DIR]) 1212492e1cfeSmrgAC_SUBST([ADMIN_MAN_DIR]) 12139e0146f7Smrg 12149e0146f7SmrgXORG_MAN_PAGE="X Version 11" 12159e0146f7SmrgAC_SUBST([XORG_MAN_PAGE]) 12169e0146f7SmrgMAN_SUBSTS="\ 12179e0146f7Smrg -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ 12189e0146f7Smrg -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ 12199e0146f7Smrg -e 's|__xservername__|Xorg|g' \ 12209e0146f7Smrg -e 's|__xconfigfile__|xorg.conf|g' \ 12219e0146f7Smrg -e 's|__projectroot__|\$(prefix)|g' \ 12229e0146f7Smrg -e 's|__apploaddir__|\$(appdefaultdir)|g' \ 12239e0146f7Smrg -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \ 12249e0146f7Smrg -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \ 12259e0146f7Smrg -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \ 12269e0146f7Smrg -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \ 12279e0146f7Smrg -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \ 12289e0146f7Smrg -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'" 12299e0146f7SmrgAC_SUBST([MAN_SUBSTS]) 12309e0146f7Smrg 1231492e1cfeSmrg]) # XORG_MANPAGE_SECTIONS 1232492e1cfeSmrg 12339e0146f7Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION]) 12349e0146f7Smrg# ------------------------ 12359e0146f7Smrg# Minimum version: 1.7.0 12369e0146f7Smrg# 12379e0146f7Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent 12389e0146f7Smrg# provided by xorg-sgml-doctools, if installed. 12399e0146f7SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[ 12409e0146f7SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])]) 12419e0146f7SmrgXORG_SGML_PATH= 12429e0146f7SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])], 12439e0146f7Smrg [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`], 12449e0146f7Smrg [m4_ifval([$1],[:], 12459e0146f7Smrg [if test x"$cross_compiling" != x"yes" ; then 12469e0146f7Smrg AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent], 12479e0146f7Smrg [XORG_SGML_PATH=$prefix/share/sgml]) 12489e0146f7Smrg fi]) 12499e0146f7Smrg ]) 12509e0146f7Smrg 12519e0146f7Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing 12529e0146f7Smrg# the path and the name of the doc stylesheet 12539e0146f7Smrgif test "x$XORG_SGML_PATH" != "x" ; then 12549e0146f7Smrg AC_MSG_RESULT([$XORG_SGML_PATH]) 12559e0146f7Smrg STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11 12569e0146f7Smrg XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl 12579e0146f7Smrgelse 12589e0146f7Smrg AC_MSG_RESULT([no]) 12599e0146f7Smrgfi 12609e0146f7Smrg 12619e0146f7SmrgAC_SUBST(XORG_SGML_PATH) 12629e0146f7SmrgAC_SUBST(STYLESHEET_SRCDIR) 12639e0146f7SmrgAC_SUBST(XSL_STYLESHEET) 12649e0146f7SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"]) 12659e0146f7Smrg]) # XORG_CHECK_SGML_DOCTOOLS 12669e0146f7Smrg 1267492e1cfeSmrg# XORG_CHECK_LINUXDOC 1268492e1cfeSmrg# ------------------- 12699e0146f7Smrg# Minimum version: 1.0.0 12709e0146f7Smrg# 1271492e1cfeSmrg# Defines the variable MAKE_TEXT if the necessary tools and 1272492e1cfeSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. 1273492e1cfeSmrg# Whether or not the necessary tools and files are found can be checked 1274492e1cfeSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC" 1275492e1cfeSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[ 12769e0146f7SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) 12779e0146f7SmrgAC_REQUIRE([XORG_WITH_PS2PDF]) 1278492e1cfeSmrg 1279492e1cfeSmrgAC_PATH_PROG(LINUXDOC, linuxdoc) 1280492e1cfeSmrg 12819e0146f7SmrgAC_MSG_CHECKING([whether to build documentation]) 12829e0146f7Smrg 12839e0146f7Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then 12849e0146f7Smrg BUILDDOC=yes 12859e0146f7Smrgelse 12869e0146f7Smrg BUILDDOC=no 12879e0146f7Smrgfi 12889e0146f7Smrg 12899e0146f7SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) 12909e0146f7Smrg 12919e0146f7SmrgAC_MSG_RESULT([$BUILDDOC]) 12929e0146f7Smrg 12939e0146f7SmrgAC_MSG_CHECKING([whether to build pdf documentation]) 12949e0146f7Smrg 12959e0146f7Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then 12969e0146f7Smrg BUILDPDFDOC=yes 12979e0146f7Smrgelse 12989e0146f7Smrg BUILDPDFDOC=no 12999e0146f7Smrgfi 13009e0146f7Smrg 13019e0146f7SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 13029e0146f7Smrg 13039e0146f7SmrgAC_MSG_RESULT([$BUILDPDFDOC]) 13049e0146f7Smrg 13059e0146f7SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f" 13069e0146f7SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps" 13079e0146f7SmrgMAKE_PDF="$PS2PDF" 13089e0146f7SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0" 13099e0146f7Smrg 13109e0146f7SmrgAC_SUBST(MAKE_TEXT) 13119e0146f7SmrgAC_SUBST(MAKE_PS) 13129e0146f7SmrgAC_SUBST(MAKE_PDF) 13139e0146f7SmrgAC_SUBST(MAKE_HTML) 13149e0146f7Smrg]) # XORG_CHECK_LINUXDOC 13159e0146f7Smrg 13169e0146f7Smrg# XORG_CHECK_DOCBOOK 13179e0146f7Smrg# ------------------- 13189e0146f7Smrg# Minimum version: 1.0.0 13199e0146f7Smrg# 13209e0146f7Smrg# Checks for the ability to build output formats from SGML DocBook source. 13219e0146f7Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC" 13229e0146f7Smrg# indicates whether the necessary tools and files are found and, if set, 13239e0146f7Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx. 13249e0146f7SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[ 13259e0146f7SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) 13269e0146f7Smrg 13279e0146f7SmrgBUILDTXTDOC=no 13289e0146f7SmrgBUILDPDFDOC=no 13299e0146f7SmrgBUILDPSDOC=no 13309e0146f7SmrgBUILDHTMLDOC=no 13319e0146f7Smrg 13329e0146f7SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps) 13339e0146f7SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf) 13349e0146f7SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html) 13359e0146f7SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt) 13369e0146f7Smrg 13379e0146f7SmrgAC_MSG_CHECKING([whether to build text documentation]) 13389e0146f7Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x && 13399e0146f7Smrg test x$BUILD_TXTDOC != xno; then 13409e0146f7Smrg BUILDTXTDOC=yes 13419e0146f7Smrgfi 13429e0146f7SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes]) 13439e0146f7SmrgAC_MSG_RESULT([$BUILDTXTDOC]) 13449e0146f7Smrg 13459e0146f7SmrgAC_MSG_CHECKING([whether to build PDF documentation]) 13469e0146f7Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x && 13479e0146f7Smrg test x$BUILD_PDFDOC != xno; then 13489e0146f7Smrg BUILDPDFDOC=yes 13499e0146f7Smrgfi 13509e0146f7SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 13519e0146f7SmrgAC_MSG_RESULT([$BUILDPDFDOC]) 13529e0146f7Smrg 13539e0146f7SmrgAC_MSG_CHECKING([whether to build PostScript documentation]) 13549e0146f7Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x && 13559e0146f7Smrg test x$BUILD_PSDOC != xno; then 13569e0146f7Smrg BUILDPSDOC=yes 13579e0146f7Smrgfi 13589e0146f7SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes]) 13599e0146f7SmrgAC_MSG_RESULT([$BUILDPSDOC]) 13609e0146f7Smrg 13619e0146f7SmrgAC_MSG_CHECKING([whether to build HTML documentation]) 13629e0146f7Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x && 13639e0146f7Smrg test x$BUILD_HTMLDOC != xno; then 13649e0146f7Smrg BUILDHTMLDOC=yes 13659e0146f7Smrgfi 13669e0146f7SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes]) 13679e0146f7SmrgAC_MSG_RESULT([$BUILDHTMLDOC]) 13689e0146f7Smrg 13699e0146f7SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT" 13709e0146f7SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS" 13719e0146f7SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF" 13729e0146f7SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML" 13739e0146f7Smrg 13749e0146f7SmrgAC_SUBST(MAKE_TEXT) 13759e0146f7SmrgAC_SUBST(MAKE_PS) 13769e0146f7SmrgAC_SUBST(MAKE_PDF) 13779e0146f7SmrgAC_SUBST(MAKE_HTML) 13789e0146f7Smrg]) # XORG_CHECK_DOCBOOK 13799e0146f7Smrg 13809e0146f7Smrg# XORG_WITH_XMLTO([MIN-VERSION]) 13819e0146f7Smrg# ---------------- 13829e0146f7Smrg# Minimum version: 1.5.0 13839e0146f7Smrg# 13849e0146f7Smrg# Documentation tools are not always available on all platforms and sometimes 13859e0146f7Smrg# not at the appropriate level. This macro enables a module to test for the 13869e0146f7Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 13879e0146f7Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions 13889e0146f7Smrg# as whether or not to use the xmlto package. 13899e0146f7Smrg# 13909e0146f7Smrg# Interface to module: 13919e0146f7Smrg# HAVE_XMLTO: used in makefiles to conditionally generate documentation 13929e0146f7Smrg# XMLTO: returns the path of the xmlto program found 13939e0146f7Smrg# returns the path set by the user in the environment 13949e0146f7Smrg# --with-xmlto: 'yes' user instructs the module to use xmlto 13959e0146f7Smrg# 'no' user instructs the module not to use xmlto 13969e0146f7Smrg# 13979e0146f7Smrg# Added in version 1.10.0 13989e0146f7Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation 13999e0146f7Smrg# xmlto for text output requires either lynx, links, or w3m browsers 14009e0146f7Smrg# 14019e0146f7Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path. 14029e0146f7Smrg# 14039e0146f7SmrgAC_DEFUN([XORG_WITH_XMLTO],[ 14049e0146f7SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command]) 14059e0146f7SmrgAC_ARG_WITH(xmlto, 14069e0146f7Smrg AS_HELP_STRING([--with-xmlto], 14079e0146f7Smrg [Use xmlto to regenerate documentation (default: yes, if installed)]), 14089e0146f7Smrg [use_xmlto=$withval], [use_xmlto=auto]) 14099e0146f7Smrg 14109e0146f7Smrgif test "x$use_xmlto" = x"auto"; then 14119e0146f7Smrg AC_PATH_PROG([XMLTO], [xmlto]) 14129e0146f7Smrg if test "x$XMLTO" = "x"; then 14139e0146f7Smrg AC_MSG_WARN([xmlto not found - documentation targets will be skipped]) 14149e0146f7Smrg have_xmlto=no 14159e0146f7Smrg else 14169e0146f7Smrg have_xmlto=yes 14179e0146f7Smrg fi 14189e0146f7Smrgelif test "x$use_xmlto" = x"yes" ; then 14199e0146f7Smrg AC_PATH_PROG([XMLTO], [xmlto]) 14209e0146f7Smrg if test "x$XMLTO" = "x"; then 14219e0146f7Smrg AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH]) 14229e0146f7Smrg fi 14239e0146f7Smrg have_xmlto=yes 14249e0146f7Smrgelif test "x$use_xmlto" = x"no" ; then 14259e0146f7Smrg if test "x$XMLTO" != "x"; then 14269e0146f7Smrg AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified]) 14279e0146f7Smrg fi 14289e0146f7Smrg have_xmlto=no 14299e0146f7Smrgelse 14309e0146f7Smrg AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no']) 14319e0146f7Smrgfi 14329e0146f7Smrg 14339e0146f7Smrg# Test for a minimum version of xmlto, if provided. 14349e0146f7Smrgm4_ifval([$1], 14359e0146f7Smrg[if test "$have_xmlto" = yes; then 14369e0146f7Smrg # scrape the xmlto version 14379e0146f7Smrg AC_MSG_CHECKING([the xmlto version]) 14389e0146f7Smrg xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3` 14399e0146f7Smrg AC_MSG_RESULT([$xmlto_version]) 14409e0146f7Smrg AS_VERSION_COMPARE([$xmlto_version], [$1], 14419e0146f7Smrg [if test "x$use_xmlto" = xauto; then 14429e0146f7Smrg AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed]) 14439e0146f7Smrg have_xmlto=no 14449e0146f7Smrg else 14459e0146f7Smrg AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed]) 14469e0146f7Smrg fi]) 14479e0146f7Smrgfi]) 14489e0146f7Smrg 14499e0146f7Smrg# Test for the ability of xmlto to generate a text target 14509e0146f7Smrghave_xmlto_text=no 14519e0146f7Smrgcat > conftest.xml << "EOF" 14529e0146f7SmrgEOF 14539e0146f7SmrgAS_IF([test "$have_xmlto" = yes], 14549e0146f7Smrg [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1], 14559e0146f7Smrg [have_xmlto_text=yes], 14569e0146f7Smrg [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])]) 14579e0146f7Smrgrm -f conftest.xml 14589e0146f7SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes]) 14599e0146f7SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes]) 14609e0146f7Smrg]) # XORG_WITH_XMLTO 14619e0146f7Smrg 14629e0146f7Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION]) 14639e0146f7Smrg# ---------------- 14649e0146f7Smrg# Minimum version: 1.5.0 14659e0146f7Smrg# 14669e0146f7Smrg# Documentation tools are not always available on all platforms and sometimes 14679e0146f7Smrg# not at the appropriate level. This macro enables a module to test for the 14689e0146f7Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 14699e0146f7Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions 14709e0146f7Smrg# as whether or not to use the asciidoc package. 14719e0146f7Smrg# 14729e0146f7Smrg# Interface to module: 14739e0146f7Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation 14749e0146f7Smrg# ASCIIDOC: returns the path of the asciidoc program found 14759e0146f7Smrg# returns the path set by the user in the environment 14769e0146f7Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc 14779e0146f7Smrg# 'no' user instructs the module not to use asciidoc 14789e0146f7Smrg# 14799e0146f7Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path. 14809e0146f7Smrg# 14819e0146f7SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[ 14829e0146f7SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command]) 14839e0146f7SmrgAC_ARG_WITH(asciidoc, 14849e0146f7Smrg AS_HELP_STRING([--with-asciidoc], 14859e0146f7Smrg [Use asciidoc to regenerate documentation (default: yes, if installed)]), 14869e0146f7Smrg [use_asciidoc=$withval], [use_asciidoc=auto]) 14879e0146f7Smrg 14889e0146f7Smrgif test "x$use_asciidoc" = x"auto"; then 14899e0146f7Smrg AC_PATH_PROG([ASCIIDOC], [asciidoc]) 14909e0146f7Smrg if test "x$ASCIIDOC" = "x"; then 14919e0146f7Smrg AC_MSG_WARN([asciidoc not found - documentation targets will be skipped]) 14929e0146f7Smrg have_asciidoc=no 14939e0146f7Smrg else 14949e0146f7Smrg have_asciidoc=yes 14959e0146f7Smrg fi 14969e0146f7Smrgelif test "x$use_asciidoc" = x"yes" ; then 14979e0146f7Smrg AC_PATH_PROG([ASCIIDOC], [asciidoc]) 14989e0146f7Smrg if test "x$ASCIIDOC" = "x"; then 14999e0146f7Smrg AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH]) 15009e0146f7Smrg fi 15019e0146f7Smrg have_asciidoc=yes 15029e0146f7Smrgelif test "x$use_asciidoc" = x"no" ; then 15039e0146f7Smrg if test "x$ASCIIDOC" != "x"; then 15049e0146f7Smrg AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified]) 15059e0146f7Smrg fi 15069e0146f7Smrg have_asciidoc=no 15079e0146f7Smrgelse 15089e0146f7Smrg AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no']) 15099e0146f7Smrgfi 15109e0146f7Smrgm4_ifval([$1], 15119e0146f7Smrg[if test "$have_asciidoc" = yes; then 15129e0146f7Smrg # scrape the asciidoc version 15139e0146f7Smrg AC_MSG_CHECKING([the asciidoc version]) 15149e0146f7Smrg asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2` 15159e0146f7Smrg AC_MSG_RESULT([$asciidoc_version]) 15169e0146f7Smrg AS_VERSION_COMPARE([$asciidoc_version], [$1], 15179e0146f7Smrg [if test "x$use_asciidoc" = xauto; then 15189e0146f7Smrg AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed]) 15199e0146f7Smrg have_asciidoc=no 15209e0146f7Smrg else 15219e0146f7Smrg AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed]) 15229e0146f7Smrg fi]) 15239e0146f7Smrgfi]) 15249e0146f7SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes]) 15259e0146f7Smrg]) # XORG_WITH_ASCIIDOC 15269e0146f7Smrg 15279e0146f7Smrg# XORG_WITH_DOXYGEN([MIN-VERSION]) 15289e0146f7Smrg# -------------------------------- 15299e0146f7Smrg# Minimum version: 1.5.0 15309e0146f7Smrg# 15319e0146f7Smrg# Documentation tools are not always available on all platforms and sometimes 15329e0146f7Smrg# not at the appropriate level. This macro enables a module to test for the 15339e0146f7Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 15349e0146f7Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions 15359e0146f7Smrg# as whether or not to use the doxygen package. 15369e0146f7Smrg# 15379e0146f7Smrg# Interface to module: 15389e0146f7Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation 15399e0146f7Smrg# DOXYGEN: returns the path of the doxygen program found 15409e0146f7Smrg# returns the path set by the user in the environment 15419e0146f7Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen 15429e0146f7Smrg# 'no' user instructs the module not to use doxygen 15439e0146f7Smrg# 15449e0146f7Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path. 15459e0146f7Smrg# 15469e0146f7SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[ 15479e0146f7SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command]) 15489e0146f7SmrgAC_ARG_WITH(doxygen, 15499e0146f7Smrg AS_HELP_STRING([--with-doxygen], 15509e0146f7Smrg [Use doxygen to regenerate documentation (default: yes, if installed)]), 15519e0146f7Smrg [use_doxygen=$withval], [use_doxygen=auto]) 15529e0146f7Smrg 15539e0146f7Smrgif test "x$use_doxygen" = x"auto"; then 15549e0146f7Smrg AC_PATH_PROG([DOXYGEN], [doxygen]) 15559e0146f7Smrg if test "x$DOXYGEN" = "x"; then 15569e0146f7Smrg AC_MSG_WARN([doxygen not found - documentation targets will be skipped]) 15579e0146f7Smrg have_doxygen=no 15589e0146f7Smrg else 15599e0146f7Smrg have_doxygen=yes 15609e0146f7Smrg fi 15619e0146f7Smrgelif test "x$use_doxygen" = x"yes" ; then 15629e0146f7Smrg AC_PATH_PROG([DOXYGEN], [doxygen]) 15639e0146f7Smrg if test "x$DOXYGEN" = "x"; then 15649e0146f7Smrg AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH]) 15659e0146f7Smrg fi 15669e0146f7Smrg have_doxygen=yes 15679e0146f7Smrgelif test "x$use_doxygen" = x"no" ; then 15689e0146f7Smrg if test "x$DOXYGEN" != "x"; then 15699e0146f7Smrg AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified]) 15709e0146f7Smrg fi 15719e0146f7Smrg have_doxygen=no 15729e0146f7Smrgelse 15739e0146f7Smrg AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no']) 15749e0146f7Smrgfi 15759e0146f7Smrgm4_ifval([$1], 15769e0146f7Smrg[if test "$have_doxygen" = yes; then 15779e0146f7Smrg # scrape the doxygen version 15789e0146f7Smrg AC_MSG_CHECKING([the doxygen version]) 15799e0146f7Smrg doxygen_version=`$DOXYGEN --version 2>/dev/null` 15809e0146f7Smrg AC_MSG_RESULT([$doxygen_version]) 15819e0146f7Smrg AS_VERSION_COMPARE([$doxygen_version], [$1], 15829e0146f7Smrg [if test "x$use_doxygen" = xauto; then 15839e0146f7Smrg AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed]) 15849e0146f7Smrg have_doxygen=no 15859e0146f7Smrg else 15869e0146f7Smrg AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed]) 15879e0146f7Smrg fi]) 15889e0146f7Smrgfi]) 15899e0146f7SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes]) 15909e0146f7Smrg]) # XORG_WITH_DOXYGEN 1591492e1cfeSmrg 15929e0146f7Smrg# XORG_WITH_GROFF 15939e0146f7Smrg# ---------------- 15949e0146f7Smrg# Minimum version: 1.6.0 15959e0146f7Smrg# 15969e0146f7Smrg# Documentation tools are not always available on all platforms and sometimes 15979e0146f7Smrg# not at the appropriate level. This macro enables a module to test for the 15989e0146f7Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 15999e0146f7Smrg# the --with-groff option, it allows maximum flexibilty in making decisions 16009e0146f7Smrg# as whether or not to use the groff package. 16019e0146f7Smrg# 16029e0146f7Smrg# Interface to module: 16039e0146f7Smrg# HAVE_GROFF: used in makefiles to conditionally generate documentation 16049e0146f7Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package 16059e0146f7Smrg# HAVE_GROFF_MS: the -ms macros package 16069e0146f7Smrg# GROFF: returns the path of the groff program found 16079e0146f7Smrg# returns the path set by the user in the environment 16089e0146f7Smrg# --with-groff: 'yes' user instructs the module to use groff 16099e0146f7Smrg# 'no' user instructs the module not to use groff 16109e0146f7Smrg# 16119e0146f7Smrg# Added in version 1.9.0: 16129e0146f7Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format: 16139e0146f7Smrg# pnmcut pnmcrop pnmtopng pnmtops from the netpbm package. 16149e0146f7Smrg# psselect from the psutils package. 16159e0146f7Smrg# the ghostcript package. Refer to the grohtml man pages 16169e0146f7Smrg# 16179e0146f7Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path. 16189e0146f7Smrg# 16199e0146f7Smrg# OS and distros often splits groff in a basic and full package, the former 16209e0146f7Smrg# having the groff program and the later having devices, fonts and macros 16219e0146f7Smrg# Checking for the groff executable is not enough. 16229e0146f7Smrg# 16239e0146f7Smrg# If macros are missing, we cannot assume that groff is useless, so we don't 16249e0146f7Smrg# unset HAVE_GROFF or GROFF env variables. 16259e0146f7Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false. 16269e0146f7Smrg# 16279e0146f7SmrgAC_DEFUN([XORG_WITH_GROFF],[ 16289e0146f7SmrgAC_ARG_VAR([GROFF], [Path to groff command]) 16299e0146f7SmrgAC_ARG_WITH(groff, 16309e0146f7Smrg AS_HELP_STRING([--with-groff], 16319e0146f7Smrg [Use groff to regenerate documentation (default: yes, if installed)]), 16329e0146f7Smrg [use_groff=$withval], [use_groff=auto]) 16339e0146f7Smrg 16349e0146f7Smrgif test "x$use_groff" = x"auto"; then 16359e0146f7Smrg AC_PATH_PROG([GROFF], [groff]) 16369e0146f7Smrg if test "x$GROFF" = "x"; then 16379e0146f7Smrg AC_MSG_WARN([groff not found - documentation targets will be skipped]) 16389e0146f7Smrg have_groff=no 16399e0146f7Smrg else 16409e0146f7Smrg have_groff=yes 16419e0146f7Smrg fi 16429e0146f7Smrgelif test "x$use_groff" = x"yes" ; then 16439e0146f7Smrg AC_PATH_PROG([GROFF], [groff]) 16449e0146f7Smrg if test "x$GROFF" = "x"; then 16459e0146f7Smrg AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH]) 16469e0146f7Smrg fi 16479e0146f7Smrg have_groff=yes 16489e0146f7Smrgelif test "x$use_groff" = x"no" ; then 16499e0146f7Smrg if test "x$GROFF" != "x"; then 16509e0146f7Smrg AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified]) 16519e0146f7Smrg fi 16529e0146f7Smrg have_groff=no 1653492e1cfeSmrgelse 16549e0146f7Smrg AC_MSG_ERROR([--with-groff expects 'yes' or 'no']) 1655492e1cfeSmrgfi 1656492e1cfeSmrg 16579e0146f7Smrg# We have groff, test for the presence of the macro packages 16589e0146f7Smrgif test "x$have_groff" = x"yes"; then 16599e0146f7Smrg AC_MSG_CHECKING([for ${GROFF} -ms macros]) 16609e0146f7Smrg if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then 16619e0146f7Smrg groff_ms_works=yes 16629e0146f7Smrg else 16639e0146f7Smrg groff_ms_works=no 16649e0146f7Smrg fi 16659e0146f7Smrg AC_MSG_RESULT([$groff_ms_works]) 16669e0146f7Smrg AC_MSG_CHECKING([for ${GROFF} -mm macros]) 16679e0146f7Smrg if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then 16689e0146f7Smrg groff_mm_works=yes 16699e0146f7Smrg else 16709e0146f7Smrg groff_mm_works=no 16719e0146f7Smrg fi 16729e0146f7Smrg AC_MSG_RESULT([$groff_mm_works]) 16739e0146f7Smrgfi 1674492e1cfeSmrg 16759e0146f7Smrg# We have groff, test for HTML dependencies, one command per package 16769e0146f7Smrgif test "x$have_groff" = x"yes"; then 16779e0146f7Smrg AC_PATH_PROGS(GS_PATH, [gs gswin32c]) 16789e0146f7Smrg AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng]) 16799e0146f7Smrg AC_PATH_PROG(PSSELECT_PATH, [psselect]) 16809e0146f7Smrg if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then 16819e0146f7Smrg have_groff_html=yes 16829e0146f7Smrg else 16839e0146f7Smrg have_groff_html=no 16849e0146f7Smrg AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages]) 16859e0146f7Smrg fi 16869e0146f7Smrgfi 1687492e1cfeSmrg 16889e0146f7Smrg# Set Automake conditionals for Makefiles 16899e0146f7SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes]) 16909e0146f7SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes]) 16919e0146f7SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes]) 16929e0146f7SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes]) 16939e0146f7Smrg]) # XORG_WITH_GROFF 1694492e1cfeSmrg 16959e0146f7Smrg# XORG_WITH_FOP 16969e0146f7Smrg# ---------------- 16979e0146f7Smrg# Minimum version: 1.6.0 16989e0146f7Smrg# 16999e0146f7Smrg# Documentation tools are not always available on all platforms and sometimes 17009e0146f7Smrg# not at the appropriate level. This macro enables a module to test for the 17019e0146f7Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 17029e0146f7Smrg# the --with-fop option, it allows maximum flexibilty in making decisions 17039e0146f7Smrg# as whether or not to use the fop package. 17049e0146f7Smrg# 17059e0146f7Smrg# Interface to module: 17069e0146f7Smrg# HAVE_FOP: used in makefiles to conditionally generate documentation 17079e0146f7Smrg# FOP: returns the path of the fop program found 17089e0146f7Smrg# returns the path set by the user in the environment 17099e0146f7Smrg# --with-fop: 'yes' user instructs the module to use fop 17109e0146f7Smrg# 'no' user instructs the module not to use fop 17119e0146f7Smrg# 17129e0146f7Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path. 17139e0146f7Smrg# 17149e0146f7SmrgAC_DEFUN([XORG_WITH_FOP],[ 17159e0146f7SmrgAC_ARG_VAR([FOP], [Path to fop command]) 17169e0146f7SmrgAC_ARG_WITH(fop, 17179e0146f7Smrg AS_HELP_STRING([--with-fop], 17189e0146f7Smrg [Use fop to regenerate documentation (default: yes, if installed)]), 17199e0146f7Smrg [use_fop=$withval], [use_fop=auto]) 17209e0146f7Smrg 17219e0146f7Smrgif test "x$use_fop" = x"auto"; then 17229e0146f7Smrg AC_PATH_PROG([FOP], [fop]) 17239e0146f7Smrg if test "x$FOP" = "x"; then 17249e0146f7Smrg AC_MSG_WARN([fop not found - documentation targets will be skipped]) 17259e0146f7Smrg have_fop=no 17269e0146f7Smrg else 17279e0146f7Smrg have_fop=yes 17289e0146f7Smrg fi 17299e0146f7Smrgelif test "x$use_fop" = x"yes" ; then 17309e0146f7Smrg AC_PATH_PROG([FOP], [fop]) 17319e0146f7Smrg if test "x$FOP" = "x"; then 17329e0146f7Smrg AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH]) 17339e0146f7Smrg fi 17349e0146f7Smrg have_fop=yes 17359e0146f7Smrgelif test "x$use_fop" = x"no" ; then 17369e0146f7Smrg if test "x$FOP" != "x"; then 17379e0146f7Smrg AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified]) 17389e0146f7Smrg fi 17399e0146f7Smrg have_fop=no 1740492e1cfeSmrgelse 17419e0146f7Smrg AC_MSG_ERROR([--with-fop expects 'yes' or 'no']) 1742492e1cfeSmrgfi 17439e0146f7SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes]) 17449e0146f7Smrg]) # XORG_WITH_FOP 1745492e1cfeSmrg 17469e0146f7Smrg# XORG_WITH_PS2PDF 17479e0146f7Smrg# ---------------- 17489e0146f7Smrg# Minimum version: 1.6.0 17499e0146f7Smrg# 17509e0146f7Smrg# Documentation tools are not always available on all platforms and sometimes 17519e0146f7Smrg# not at the appropriate level. This macro enables a module to test for the 17529e0146f7Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 17539e0146f7Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions 17549e0146f7Smrg# as whether or not to use the ps2pdf package. 17559e0146f7Smrg# 17569e0146f7Smrg# Interface to module: 17579e0146f7Smrg# HAVE_PS2PDF: used in makefiles to conditionally generate documentation 17589e0146f7Smrg# PS2PDF: returns the path of the ps2pdf program found 17599e0146f7Smrg# returns the path set by the user in the environment 17609e0146f7Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf 17619e0146f7Smrg# 'no' user instructs the module not to use ps2pdf 17629e0146f7Smrg# 17639e0146f7Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path. 17649e0146f7Smrg# 17659e0146f7SmrgAC_DEFUN([XORG_WITH_PS2PDF],[ 17669e0146f7SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command]) 17679e0146f7SmrgAC_ARG_WITH(ps2pdf, 17689e0146f7Smrg AS_HELP_STRING([--with-ps2pdf], 17699e0146f7Smrg [Use ps2pdf to regenerate documentation (default: yes, if installed)]), 17709e0146f7Smrg [use_ps2pdf=$withval], [use_ps2pdf=auto]) 17719e0146f7Smrg 17729e0146f7Smrgif test "x$use_ps2pdf" = x"auto"; then 17739e0146f7Smrg AC_PATH_PROG([PS2PDF], [ps2pdf]) 17749e0146f7Smrg if test "x$PS2PDF" = "x"; then 17759e0146f7Smrg AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped]) 17769e0146f7Smrg have_ps2pdf=no 17779e0146f7Smrg else 17789e0146f7Smrg have_ps2pdf=yes 17799e0146f7Smrg fi 17809e0146f7Smrgelif test "x$use_ps2pdf" = x"yes" ; then 17819e0146f7Smrg AC_PATH_PROG([PS2PDF], [ps2pdf]) 17829e0146f7Smrg if test "x$PS2PDF" = "x"; then 17839e0146f7Smrg AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH]) 17849e0146f7Smrg fi 17859e0146f7Smrg have_ps2pdf=yes 17869e0146f7Smrgelif test "x$use_ps2pdf" = x"no" ; then 17879e0146f7Smrg if test "x$PS2PDF" != "x"; then 17889e0146f7Smrg AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified]) 17899e0146f7Smrg fi 17909e0146f7Smrg have_ps2pdf=no 17919e0146f7Smrgelse 17929e0146f7Smrg AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no']) 17939e0146f7Smrgfi 17949e0146f7SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes]) 17959e0146f7Smrg]) # XORG_WITH_PS2PDF 1796492e1cfeSmrg 17979e0146f7Smrg# XORG_ENABLE_DOCS (enable_docs=yes) 17989e0146f7Smrg# ---------------- 17999e0146f7Smrg# Minimum version: 1.6.0 18009e0146f7Smrg# 18019e0146f7Smrg# Documentation tools are not always available on all platforms and sometimes 18029e0146f7Smrg# not at the appropriate level. This macro enables a builder to skip all 18039e0146f7Smrg# documentation targets except traditional man pages. 18049e0146f7Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 18059e0146f7Smrg# maximum flexibilty in controlling documentation building. 18069e0146f7Smrg# Refer to: 18079e0146f7Smrg# XORG_WITH_XMLTO --with-xmlto 18089e0146f7Smrg# XORG_WITH_ASCIIDOC --with-asciidoc 18099e0146f7Smrg# XORG_WITH_DOXYGEN --with-doxygen 18109e0146f7Smrg# XORG_WITH_FOP --with-fop 18119e0146f7Smrg# XORG_WITH_GROFF --with-groff 18129e0146f7Smrg# XORG_WITH_PS2PDF --with-ps2pdf 18139e0146f7Smrg# 18149e0146f7Smrg# Interface to module: 18159e0146f7Smrg# ENABLE_DOCS: used in makefiles to conditionally generate documentation 18169e0146f7Smrg# --enable-docs: 'yes' user instructs the module to generate docs 18179e0146f7Smrg# 'no' user instructs the module not to generate docs 18189e0146f7Smrg# parm1: specify the default value, yes or no. 18199e0146f7Smrg# 18209e0146f7SmrgAC_DEFUN([XORG_ENABLE_DOCS],[ 18219e0146f7Smrgdefault=$1 18229e0146f7Smrgif test "x$default" = x ; then 18239e0146f7Smrg default="yes" 18249e0146f7Smrgfi 18259e0146f7SmrgAC_ARG_ENABLE(docs, 18269e0146f7Smrg AS_HELP_STRING([--enable-docs], 18279e0146f7Smrg [Enable building the documentation (default: yes)]), 18289e0146f7Smrg [build_docs=$enableval], [build_docs=$default]) 18299e0146f7SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes]) 18309e0146f7SmrgAC_MSG_CHECKING([whether to build documentation]) 18319e0146f7SmrgAC_MSG_RESULT([$build_docs]) 18329e0146f7Smrg]) # XORG_ENABLE_DOCS 18339e0146f7Smrg 18349e0146f7Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes) 18359e0146f7Smrg# ---------------- 18369e0146f7Smrg# Minimum version: 1.6.0 18379e0146f7Smrg# 18389e0146f7Smrg# This macro enables a builder to skip all developer documentation. 18399e0146f7Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 18409e0146f7Smrg# maximum flexibilty in controlling documentation building. 18419e0146f7Smrg# Refer to: 18429e0146f7Smrg# XORG_WITH_XMLTO --with-xmlto 18439e0146f7Smrg# XORG_WITH_ASCIIDOC --with-asciidoc 18449e0146f7Smrg# XORG_WITH_DOXYGEN --with-doxygen 18459e0146f7Smrg# XORG_WITH_FOP --with-fop 18469e0146f7Smrg# XORG_WITH_GROFF --with-groff 18479e0146f7Smrg# XORG_WITH_PS2PDF --with-ps2pdf 18489e0146f7Smrg# 18499e0146f7Smrg# Interface to module: 18509e0146f7Smrg# ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs 18519e0146f7Smrg# --enable-devel-docs: 'yes' user instructs the module to generate developer docs 18529e0146f7Smrg# 'no' user instructs the module not to generate developer docs 18539e0146f7Smrg# parm1: specify the default value, yes or no. 18549e0146f7Smrg# 18559e0146f7SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[ 18569e0146f7Smrgdevel_default=$1 18579e0146f7Smrgif test "x$devel_default" = x ; then 18589e0146f7Smrg devel_default="yes" 18599e0146f7Smrgfi 18609e0146f7SmrgAC_ARG_ENABLE(devel-docs, 18619e0146f7Smrg AS_HELP_STRING([--enable-devel-docs], 18629e0146f7Smrg [Enable building the developer documentation (default: yes)]), 18639e0146f7Smrg [build_devel_docs=$enableval], [build_devel_docs=$devel_default]) 18649e0146f7SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes]) 18659e0146f7SmrgAC_MSG_CHECKING([whether to build developer documentation]) 18669e0146f7SmrgAC_MSG_RESULT([$build_devel_docs]) 18679e0146f7Smrg]) # XORG_ENABLE_DEVEL_DOCS 18689e0146f7Smrg 18699e0146f7Smrg# XORG_ENABLE_SPECS (enable_specs=yes) 18709e0146f7Smrg# ---------------- 18719e0146f7Smrg# Minimum version: 1.6.0 18729e0146f7Smrg# 18739e0146f7Smrg# This macro enables a builder to skip all functional specification targets. 18749e0146f7Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 18759e0146f7Smrg# maximum flexibilty in controlling documentation building. 18769e0146f7Smrg# Refer to: 18779e0146f7Smrg# XORG_WITH_XMLTO --with-xmlto 18789e0146f7Smrg# XORG_WITH_ASCIIDOC --with-asciidoc 18799e0146f7Smrg# XORG_WITH_DOXYGEN --with-doxygen 18809e0146f7Smrg# XORG_WITH_FOP --with-fop 18819e0146f7Smrg# XORG_WITH_GROFF --with-groff 18829e0146f7Smrg# XORG_WITH_PS2PDF --with-ps2pdf 18839e0146f7Smrg# 18849e0146f7Smrg# Interface to module: 18859e0146f7Smrg# ENABLE_SPECS: used in makefiles to conditionally generate specs 18869e0146f7Smrg# --enable-specs: 'yes' user instructs the module to generate specs 18879e0146f7Smrg# 'no' user instructs the module not to generate specs 18889e0146f7Smrg# parm1: specify the default value, yes or no. 18899e0146f7Smrg# 18909e0146f7SmrgAC_DEFUN([XORG_ENABLE_SPECS],[ 18919e0146f7Smrgspec_default=$1 18929e0146f7Smrgif test "x$spec_default" = x ; then 18939e0146f7Smrg spec_default="yes" 18949e0146f7Smrgfi 18959e0146f7SmrgAC_ARG_ENABLE(specs, 18969e0146f7Smrg AS_HELP_STRING([--enable-specs], 18979e0146f7Smrg [Enable building the specs (default: yes)]), 18989e0146f7Smrg [build_specs=$enableval], [build_specs=$spec_default]) 18999e0146f7SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes]) 19009e0146f7SmrgAC_MSG_CHECKING([whether to build functional specifications]) 19019e0146f7SmrgAC_MSG_RESULT([$build_specs]) 19029e0146f7Smrg]) # XORG_ENABLE_SPECS 1903492e1cfeSmrg 1904492e1cfeSmrg# XORG_CHECK_MALLOC_ZERO 1905492e1cfeSmrg# ---------------------- 19069e0146f7Smrg# Minimum version: 1.0.0 19079e0146f7Smrg# 1908492e1cfeSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if 1909492e1cfeSmrg# malloc(0) returns NULL. Packages should add one of these cflags to 1910492e1cfeSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. 1911492e1cfeSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[ 1912492e1cfeSmrgAC_ARG_ENABLE(malloc0returnsnull, 19139e0146f7Smrg AS_HELP_STRING([--enable-malloc0returnsnull], 1914492e1cfeSmrg [malloc(0) returns NULL (default: auto)]), 1915492e1cfeSmrg [MALLOC_ZERO_RETURNS_NULL=$enableval], 1916492e1cfeSmrg [MALLOC_ZERO_RETURNS_NULL=auto]) 1917492e1cfeSmrg 1918492e1cfeSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL]) 1919492e1cfeSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then 1920492e1cfeSmrg AC_RUN_IFELSE([ 1921492e1cfeSmrgchar *malloc(); 1922492e1cfeSmrgchar *realloc(); 1923492e1cfeSmrgchar *calloc(); 1924492e1cfeSmrgmain() { 1925492e1cfeSmrg char *m0, *r0, *c0, *p; 1926492e1cfeSmrg m0 = malloc(0); 1927492e1cfeSmrg p = malloc(10); 1928492e1cfeSmrg r0 = realloc(p,0); 1929492e1cfeSmrg c0 = calloc(0); 1930492e1cfeSmrg exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1); 1931492e1cfeSmrg}], 1932492e1cfeSmrg [MALLOC_ZERO_RETURNS_NULL=yes], 19339e0146f7Smrg [MALLOC_ZERO_RETURNS_NULL=no], 19349e0146f7Smrg [MALLOC_ZERO_RETURNS_NULL=yes]) 1935492e1cfeSmrgfi 1936492e1cfeSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) 1937492e1cfeSmrg 1938492e1cfeSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then 1939492e1cfeSmrg MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" 1940492e1cfeSmrg XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS 1941492e1cfeSmrg XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" 1942492e1cfeSmrgelse 1943492e1cfeSmrg MALLOC_ZERO_CFLAGS="" 1944492e1cfeSmrg XMALLOC_ZERO_CFLAGS="" 1945492e1cfeSmrg XTMALLOC_ZERO_CFLAGS="" 1946492e1cfeSmrgfi 1947492e1cfeSmrg 1948492e1cfeSmrgAC_SUBST([MALLOC_ZERO_CFLAGS]) 1949492e1cfeSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS]) 1950492e1cfeSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS]) 1951492e1cfeSmrg]) # XORG_CHECK_MALLOC_ZERO 1952492e1cfeSmrg 19539e0146f7Smrg# XORG_WITH_LINT() 19549e0146f7Smrg# ---------------- 19559e0146f7Smrg# Minimum version: 1.1.0 19569e0146f7Smrg# 19579e0146f7Smrg# This macro enables the use of a tool that flags some suspicious and 19589e0146f7Smrg# non-portable constructs (likely to be bugs) in C language source code. 19599e0146f7Smrg# It will attempt to locate the tool and use appropriate options. 19609e0146f7Smrg# There are various lint type tools on different platforms. 19619e0146f7Smrg# 19629e0146f7Smrg# Interface to module: 19639e0146f7Smrg# LINT: returns the path to the tool found on the platform 19649e0146f7Smrg# or the value set to LINT on the configure cmd line 19659e0146f7Smrg# also an Automake conditional 19669e0146f7Smrg# LINT_FLAGS: an Automake variable with appropriate flags 19679e0146f7Smrg# 19689e0146f7Smrg# --with-lint: 'yes' user instructs the module to use lint 19699e0146f7Smrg# 'no' user instructs the module not to use lint (default) 19709e0146f7Smrg# 19719e0146f7Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path. 19729e0146f7Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim. 19739e0146f7Smrg# 19749e0146f7SmrgAC_DEFUN([XORG_WITH_LINT],[ 19759e0146f7Smrg 19769e0146f7SmrgAC_ARG_VAR([LINT], [Path to a lint-style command]) 19779e0146f7SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command]) 19789e0146f7SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint], 19799e0146f7Smrg [Use a lint-style source code checker (default: disabled)])], 19809e0146f7Smrg [use_lint=$withval], [use_lint=no]) 19819e0146f7Smrg 19829e0146f7Smrg# Obtain platform specific info like program name and options 19839e0146f7Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris 19849e0146f7Smrgcase $host_os in 19859e0146f7Smrg *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*) 19869e0146f7Smrg lint_name=splint 19879e0146f7Smrg lint_options="-badflag" 19889e0146f7Smrg ;; 19899e0146f7Smrg *freebsd* | *netbsd*) 19909e0146f7Smrg lint_name=lint 19919e0146f7Smrg lint_options="-u -b" 19929e0146f7Smrg ;; 19939e0146f7Smrg *solaris*) 19949e0146f7Smrg lint_name=lint 19959e0146f7Smrg lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2" 19969e0146f7Smrg ;; 19979e0146f7Smrgesac 19989e0146f7Smrg 19999e0146f7Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user) 20009e0146f7Smrgif test "x$use_lint" = x"yes" ; then 20019e0146f7Smrg AC_PATH_PROG([LINT], [$lint_name]) 20029e0146f7Smrg if test "x$LINT" = "x"; then 20039e0146f7Smrg AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH]) 20049e0146f7Smrg fi 20059e0146f7Smrgelif test "x$use_lint" = x"no" ; then 20069e0146f7Smrg if test "x$LINT" != "x"; then 20079e0146f7Smrg AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified]) 20089e0146f7Smrg fi 20099e0146f7Smrgelse 20109e0146f7Smrg AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.]) 20119e0146f7Smrgfi 20129e0146f7Smrg 20139e0146f7Smrg# User supplied flags override default flags 20149e0146f7Smrgif test "x$LINT_FLAGS" != "x"; then 20159e0146f7Smrg lint_options=$LINT_FLAGS 20169e0146f7Smrgfi 20179e0146f7Smrg 20189e0146f7SmrgAC_SUBST([LINT_FLAGS],[$lint_options]) 20199e0146f7SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x]) 20209e0146f7Smrg 20219e0146f7Smrg]) # XORG_WITH_LINT 20229e0146f7Smrg 20239e0146f7Smrg# XORG_LINT_LIBRARY(LIBNAME) 20249e0146f7Smrg# -------------------------- 20259e0146f7Smrg# Minimum version: 1.1.0 20269e0146f7Smrg# 20279e0146f7Smrg# Sets up flags for building lint libraries for checking programs that call 20289e0146f7Smrg# functions in the library. 20299e0146f7Smrg# 20309e0146f7Smrg# Interface to module: 20319e0146f7Smrg# LINTLIB - Automake variable with the name of lint library file to make 20329e0146f7Smrg# MAKE_LINT_LIB - Automake conditional 20339e0146f7Smrg# 20349e0146f7Smrg# --enable-lint-library: - 'yes' user instructs the module to created a lint library 20359e0146f7Smrg# - 'no' user instructs the module not to create a lint library (default) 20369e0146f7Smrg 20379e0146f7SmrgAC_DEFUN([XORG_LINT_LIBRARY],[ 20389e0146f7SmrgAC_REQUIRE([XORG_WITH_LINT]) 20399e0146f7SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library], 20409e0146f7Smrg [Create lint library (default: disabled)])], 20419e0146f7Smrg [make_lint_lib=$enableval], [make_lint_lib=no]) 20429e0146f7Smrg 20439e0146f7Smrgif test "x$make_lint_lib" = x"yes" ; then 20449e0146f7Smrg LINTLIB=llib-l$1.ln 20459e0146f7Smrg if test "x$LINT" = "x"; then 20469e0146f7Smrg AC_MSG_ERROR([Cannot make lint library without --with-lint]) 20479e0146f7Smrg fi 20489e0146f7Smrgelif test "x$make_lint_lib" != x"no" ; then 20499e0146f7Smrg AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.]) 20509e0146f7Smrgfi 20519e0146f7Smrg 20529e0146f7SmrgAC_SUBST(LINTLIB) 20539e0146f7SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno]) 20549e0146f7Smrg 20559e0146f7Smrg]) # XORG_LINT_LIBRARY 20569e0146f7Smrg 20579e0146f7Smrg# XORG_CWARNFLAGS 20589e0146f7Smrg# --------------- 20599e0146f7Smrg# Minimum version: 1.2.0 20609e0146f7Smrg# 20619e0146f7Smrg# Defines CWARNFLAGS to enable C compiler warnings. 20629e0146f7Smrg# 20639e0146f7SmrgAC_DEFUN([XORG_CWARNFLAGS], [ 20649e0146f7SmrgAC_REQUIRE([AC_PROG_CC_C99]) 20659e0146f7Smrgif test "x$GCC" = xyes ; then 20669e0146f7Smrg CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \ 20679e0146f7Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \ 20689e0146f7Smrg-Wbad-function-cast -Wformat=2" 20699e0146f7Smrg case `$CC -dumpversion` in 20709e0146f7Smrg 3.4.* | 4.*) 20719e0146f7Smrg CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement" 20729e0146f7Smrg ;; 20739e0146f7Smrg esac 20749e0146f7Smrgelse 20759e0146f7Smrg AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) 20769e0146f7Smrg if test "x$SUNCC" = "xyes"; then 20779e0146f7Smrg CWARNFLAGS="-v" 20789e0146f7Smrg fi 20799e0146f7Smrgfi 20809e0146f7SmrgAC_SUBST(CWARNFLAGS) 20819e0146f7Smrg]) # XORG_CWARNFLAGS 20829e0146f7Smrg 20839e0146f7Smrg# XORG_STRICT_OPTION 20849e0146f7Smrg# ----------------------- 20859e0146f7Smrg# Minimum version: 1.3.0 20869e0146f7Smrg# 20879e0146f7Smrg# Add configure option to enable strict compilation 20889e0146f7SmrgAC_DEFUN([XORG_STRICT_OPTION], [ 20899e0146f7Smrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89 20909e0146f7SmrgAC_REQUIRE([AC_PROG_CC_C99]) 20919e0146f7SmrgAC_REQUIRE([XORG_CWARNFLAGS]) 20929e0146f7Smrg 20939e0146f7SmrgAC_ARG_ENABLE(strict-compilation, 20949e0146f7Smrg AS_HELP_STRING([--enable-strict-compilation], 20959e0146f7Smrg [Enable all warnings from compiler and make them errors (default: disabled)]), 20969e0146f7Smrg [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no]) 20979e0146f7Smrgif test "x$STRICT_COMPILE" = "xyes"; then 20989e0146f7Smrg AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) 20999e0146f7Smrg AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"]) 21009e0146f7Smrg if test "x$GCC" = xyes ; then 21019e0146f7Smrg STRICT_CFLAGS="-pedantic -Werror" 21029e0146f7Smrg elif test "x$SUNCC" = "xyes"; then 21039e0146f7Smrg STRICT_CFLAGS="-errwarn" 21049e0146f7Smrg elif test "x$INTELCC" = "xyes"; then 21059e0146f7Smrg STRICT_CFLAGS="-Werror" 21069e0146f7Smrg fi 21079e0146f7Smrgfi 21089e0146f7SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS" 21099e0146f7SmrgAC_SUBST([CWARNFLAGS]) 21109e0146f7Smrg]) # XORG_STRICT_OPTION 21119e0146f7Smrg 21129e0146f7Smrg# XORG_DEFAULT_OPTIONS 21139e0146f7Smrg# -------------------- 21149e0146f7Smrg# Minimum version: 1.3.0 21159e0146f7Smrg# 21169e0146f7Smrg# Defines default options for X.Org modules. 21179e0146f7Smrg# 21189e0146f7SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [ 21199e0146f7SmrgAC_REQUIRE([AC_PROG_INSTALL]) 21209e0146f7SmrgXORG_CWARNFLAGS 21219e0146f7SmrgXORG_STRICT_OPTION 21229e0146f7SmrgXORG_RELEASE_VERSION 21239e0146f7SmrgXORG_CHANGELOG 21249e0146f7SmrgXORG_INSTALL 21259e0146f7SmrgXORG_MANPAGE_SECTIONS 21269e0146f7Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], 21279e0146f7Smrg [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) 21289e0146f7Smrg]) # XORG_DEFAULT_OPTIONS 21299e0146f7Smrg 21309e0146f7Smrg# XORG_INSTALL() 21319e0146f7Smrg# ---------------- 21329e0146f7Smrg# Minimum version: 1.4.0 21339e0146f7Smrg# 21349e0146f7Smrg# Defines the variable INSTALL_CMD as the command to copy 21359e0146f7Smrg# INSTALL from $prefix/share/util-macros. 21369e0146f7Smrg# 21379e0146f7SmrgAC_DEFUN([XORG_INSTALL], [ 21389e0146f7SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG]) 21399e0146f7Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` 21409e0146f7SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ 21419e0146f7Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ 21429e0146f7Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \ 21439e0146f7Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)" 21449e0146f7SmrgAC_SUBST([INSTALL_CMD]) 21459e0146f7Smrg]) # XORG_INSTALL 2146492e1cfeSmrgdnl Copyright 2005 Red Hat, Inc 2147492e1cfeSmrgdnl 2148492e1cfeSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its 2149492e1cfeSmrgdnl documentation for any purpose is hereby granted without fee, provided that 2150492e1cfeSmrgdnl the above copyright notice appear in all copies and that both that 2151492e1cfeSmrgdnl copyright notice and this permission notice appear in supporting 2152492e1cfeSmrgdnl documentation. 2153492e1cfeSmrgdnl 2154492e1cfeSmrgdnl The above copyright notice and this permission notice shall be included 2155492e1cfeSmrgdnl in all copies or substantial portions of the Software. 2156492e1cfeSmrgdnl 2157492e1cfeSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 2158492e1cfeSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 2159492e1cfeSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 2160492e1cfeSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 2161492e1cfeSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 2162492e1cfeSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 2163492e1cfeSmrgdnl OTHER DEALINGS IN THE SOFTWARE. 2164492e1cfeSmrgdnl 2165492e1cfeSmrgdnl Except as contained in this notice, the name of the copyright holders shall 2166492e1cfeSmrgdnl not be used in advertising or otherwise to promote the sale, use or 2167492e1cfeSmrgdnl other dealings in this Software without prior written authorization 2168492e1cfeSmrgdnl from the copyright holders. 2169492e1cfeSmrgdnl 2170492e1cfeSmrg 2171492e1cfeSmrg# XORG_RELEASE_VERSION 2172492e1cfeSmrg# -------------------- 21739e0146f7Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use. 2174492e1cfeSmrg 2175492e1cfeSmrgAC_DEFUN([XORG_RELEASE_VERSION],[ 21769e0146f7Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR], 21779e0146f7Smrg [`echo $PACKAGE_VERSION | cut -d . -f 1`], 21789e0146f7Smrg [Major version of this package]) 21799e0146f7Smrg PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` 21809e0146f7Smrg if test "x$PVM" = "x"; then 21819e0146f7Smrg PVM="0" 2182492e1cfeSmrg fi 21839e0146f7Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR], 21849e0146f7Smrg [$PVM], 21859e0146f7Smrg [Minor version of this package]) 21869e0146f7Smrg PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` 21879e0146f7Smrg if test "x$PVP" = "x"; then 21889e0146f7Smrg PVP="0" 21899e0146f7Smrg fi 21909e0146f7Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL], 21919e0146f7Smrg [$PVP], 21929e0146f7Smrg [Patch version of this package]) 2193492e1cfeSmrg]) 2194492e1cfeSmrg 21959e0146f7Smrg# XORG_CHANGELOG() 21969e0146f7Smrg# ---------------- 21979e0146f7Smrg# Minimum version: 1.2.0 21989e0146f7Smrg# 21999e0146f7Smrg# Defines the variable CHANGELOG_CMD as the command to generate 22009e0146f7Smrg# ChangeLog from git. 22019e0146f7Smrg# 22029e0146f7Smrg# 22039e0146f7SmrgAC_DEFUN([XORG_CHANGELOG], [ 22049e0146f7SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \ 22059e0146f7Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ 22069e0146f7Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \ 22079e0146f7Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)" 22089e0146f7SmrgAC_SUBST([CHANGELOG_CMD]) 22099e0146f7Smrg]) # XORG_CHANGELOG 22109e0146f7Smrg 22119e0146f7Smrg# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- 22129e0146f7Smrg# 22139e0146f7Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>. 22149e0146f7Smrg# 22159e0146f7Smrg# This program is free software; you can redistribute it and/or modify 22169e0146f7Smrg# it under the terms of the GNU General Public License as published by 22179e0146f7Smrg# the Free Software Foundation; either version 2 of the License, or 22189e0146f7Smrg# (at your option) any later version. 22199e0146f7Smrg# 22209e0146f7Smrg# This program is distributed in the hope that it will be useful, but 22219e0146f7Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of 22229e0146f7Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 22239e0146f7Smrg# General Public License for more details. 22249e0146f7Smrg# 22259e0146f7Smrg# You should have received a copy of the GNU General Public License 22269e0146f7Smrg# along with this program; if not, write to the Free Software 22279e0146f7Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 22289e0146f7Smrg# 22299e0146f7Smrg# As a special exception to the GNU General Public License, if you 22309e0146f7Smrg# distribute this file as part of a program that contains a 22319e0146f7Smrg# configuration script generated by Autoconf, you may include it under 22329e0146f7Smrg# the same distribution terms that you use for the rest of that program. 22339e0146f7Smrg 22349e0146f7Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION]) 22359e0146f7Smrg# ---------------------------------- 22369e0146f7SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG], 22379e0146f7Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) 22389e0146f7Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$]) 22399e0146f7SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl 22409e0146f7Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then 22419e0146f7Smrg AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) 22429e0146f7Smrgfi 22439e0146f7Smrgif test -n "$PKG_CONFIG"; then 22449e0146f7Smrg _pkg_min_version=m4_default([$1], [0.9.0]) 22459e0146f7Smrg AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) 22469e0146f7Smrg if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then 22479e0146f7Smrg AC_MSG_RESULT([yes]) 22489e0146f7Smrg else 22499e0146f7Smrg AC_MSG_RESULT([no]) 22509e0146f7Smrg PKG_CONFIG="" 22519e0146f7Smrg fi 22529e0146f7Smrg 22539e0146f7Smrgfi[]dnl 22549e0146f7Smrg])# PKG_PROG_PKG_CONFIG 22559e0146f7Smrg 22569e0146f7Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 22579e0146f7Smrg# 22589e0146f7Smrg# Check to see whether a particular set of modules exists. Similar 22599e0146f7Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors. 22609e0146f7Smrg# 22619e0146f7Smrg# 22629e0146f7Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of 22639e0146f7Smrg# this or PKG_CHECK_MODULES is called, or make sure to call 22649e0146f7Smrg# PKG_CHECK_EXISTS manually 22659e0146f7Smrg# -------------------------------------------------------------- 22669e0146f7SmrgAC_DEFUN([PKG_CHECK_EXISTS], 22679e0146f7Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 22689e0146f7Smrgif test -n "$PKG_CONFIG" && \ 22699e0146f7Smrg AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then 22709e0146f7Smrg m4_ifval([$2], [$2], [:]) 22719e0146f7Smrgm4_ifvaln([$3], [else 22729e0146f7Smrg $3])dnl 22739e0146f7Smrgfi]) 22749e0146f7Smrg 22759e0146f7Smrg 22769e0146f7Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) 22779e0146f7Smrg# --------------------------------------------- 22789e0146f7Smrgm4_define([_PKG_CONFIG], 22799e0146f7Smrg[if test -n "$$1"; then 22809e0146f7Smrg pkg_cv_[]$1="$$1" 22819e0146f7Smrg elif test -n "$PKG_CONFIG"; then 22829e0146f7Smrg PKG_CHECK_EXISTS([$3], 22839e0146f7Smrg [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], 22849e0146f7Smrg [pkg_failed=yes]) 22859e0146f7Smrg else 22869e0146f7Smrg pkg_failed=untried 22879e0146f7Smrgfi[]dnl 22889e0146f7Smrg])# _PKG_CONFIG 22899e0146f7Smrg 22909e0146f7Smrg# _PKG_SHORT_ERRORS_SUPPORTED 22919e0146f7Smrg# ----------------------------- 22929e0146f7SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], 22939e0146f7Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 22949e0146f7Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then 22959e0146f7Smrg _pkg_short_errors_supported=yes 22969e0146f7Smrgelse 22979e0146f7Smrg _pkg_short_errors_supported=no 22989e0146f7Smrgfi[]dnl 22999e0146f7Smrg])# _PKG_SHORT_ERRORS_SUPPORTED 23009e0146f7Smrg 23019e0146f7Smrg 23029e0146f7Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], 23039e0146f7Smrg# [ACTION-IF-NOT-FOUND]) 23049e0146f7Smrg# 23059e0146f7Smrg# 23069e0146f7Smrg# Note that if there is a possibility the first call to 23079e0146f7Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an 23089e0146f7Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac 23099e0146f7Smrg# 23109e0146f7Smrg# 23119e0146f7Smrg# -------------------------------------------------------------- 23129e0146f7SmrgAC_DEFUN([PKG_CHECK_MODULES], 23139e0146f7Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 23149e0146f7SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl 23159e0146f7SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl 23169e0146f7Smrg 23179e0146f7Smrgpkg_failed=no 23189e0146f7SmrgAC_MSG_CHECKING([for $1]) 23199e0146f7Smrg 23209e0146f7Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) 23219e0146f7Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2]) 23229e0146f7Smrg 23239e0146f7Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS 23249e0146f7Smrgand $1[]_LIBS to avoid the need to call pkg-config. 23259e0146f7SmrgSee the pkg-config man page for more details.]) 23269e0146f7Smrg 23279e0146f7Smrgif test $pkg_failed = yes; then 23289e0146f7Smrg _PKG_SHORT_ERRORS_SUPPORTED 23299e0146f7Smrg if test $_pkg_short_errors_supported = yes; then 23309e0146f7Smrg $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` 23319e0146f7Smrg else 23329e0146f7Smrg $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` 23339e0146f7Smrg fi 23349e0146f7Smrg # Put the nasty error message in config.log where it belongs 23359e0146f7Smrg echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD 23369e0146f7Smrg 23379e0146f7Smrg ifelse([$4], , [AC_MSG_ERROR(dnl 23389e0146f7Smrg[Package requirements ($2) were not met: 23399e0146f7Smrg 23409e0146f7Smrg$$1_PKG_ERRORS 23419e0146f7Smrg 23429e0146f7SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you 23439e0146f7Smrginstalled software in a non-standard prefix. 23449e0146f7Smrg 23459e0146f7Smrg_PKG_TEXT 23469e0146f7Smrg])], 23479e0146f7Smrg [AC_MSG_RESULT([no]) 23489e0146f7Smrg $4]) 23499e0146f7Smrgelif test $pkg_failed = untried; then 23509e0146f7Smrg ifelse([$4], , [AC_MSG_FAILURE(dnl 23519e0146f7Smrg[The pkg-config script could not be found or is too old. Make sure it 23529e0146f7Smrgis in your PATH or set the PKG_CONFIG environment variable to the full 23539e0146f7Smrgpath to pkg-config. 23549e0146f7Smrg 23559e0146f7Smrg_PKG_TEXT 23569e0146f7Smrg 23579e0146f7SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])], 23589e0146f7Smrg [$4]) 23599e0146f7Smrgelse 23609e0146f7Smrg $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS 23619e0146f7Smrg $1[]_LIBS=$pkg_cv_[]$1[]_LIBS 23629e0146f7Smrg AC_MSG_RESULT([yes]) 23639e0146f7Smrg ifelse([$3], , :, [$3]) 23649e0146f7Smrgfi[]dnl 23659e0146f7Smrg])# PKG_CHECK_MODULES 23669e0146f7Smrg 2367