aclocal.m4 revision 576bae58
1576bae58Smrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*- 214c0a534Smrg 314c0a534Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 4bf2eeab3Smrg# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. 514c0a534Smrg# This file is free software; the Free Software Foundation 614c0a534Smrg# gives unlimited permission to copy and/or distribute it, 714c0a534Smrg# with or without modifications, as long as this notice is preserved. 814c0a534Smrg 914c0a534Smrg# This program is distributed in the hope that it will be useful, 1014c0a534Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without 1114c0a534Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A 1214c0a534Smrg# PARTICULAR PURPOSE. 1314c0a534Smrg 14bf2eeab3Smrgm4_ifndef([AC_AUTOCONF_VERSION], 15bf2eeab3Smrg [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 16576bae58Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, 17576bae58Smrg[m4_warning([this file was generated for autoconf 2.68. 18bf2eeab3SmrgYou have another version of autoconf. It may work, but is not guaranteed to. 19bf2eeab3SmrgIf you have problems, you may need to regenerate the build system entirely. 20bf2eeab3SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])]) 2114c0a534Smrg 22bf2eeab3Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. 2314c0a534Smrg# 24bf2eeab3Smrg# This file is free software; the Free Software Foundation 25bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it, 26bf2eeab3Smrg# with or without modifications, as long as this notice is preserved. 2714c0a534Smrg 28bf2eeab3Smrg# AM_AUTOMAKE_VERSION(VERSION) 29bf2eeab3Smrg# ---------------------------- 30bf2eeab3Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been 31bf2eeab3Smrg# generated from the m4 files accompanying Automake X.Y. 32bf2eeab3Smrg# (This private macro should not be called outside this file.) 33bf2eeab3SmrgAC_DEFUN([AM_AUTOMAKE_VERSION], 34bf2eeab3Smrg[am__api_version='1.11' 35bf2eeab3Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to 36bf2eeab3Smrgdnl require some minimum version. Point them to the right macro. 37576bae58Smrgm4_if([$1], [1.11.1], [], 38bf2eeab3Smrg [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl 39bf2eeab3Smrg]) 4014c0a534Smrg 41bf2eeab3Smrg# _AM_AUTOCONF_VERSION(VERSION) 4214c0a534Smrg# ----------------------------- 43bf2eeab3Smrg# aclocal traces this macro to find the Autoconf version. 44bf2eeab3Smrg# This is a private macro too. Using m4_define simplifies 45bf2eeab3Smrg# the logic in aclocal, which can simply ignore this definition. 46bf2eeab3Smrgm4_define([_AM_AUTOCONF_VERSION], []) 47bf2eeab3Smrg 48bf2eeab3Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION 49bf2eeab3Smrg# ------------------------------- 50bf2eeab3Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. 51bf2eeab3Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. 52bf2eeab3SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 53576bae58Smrg[AM_AUTOMAKE_VERSION([1.11.1])dnl 54bf2eeab3Smrgm4_ifndef([AC_AUTOCONF_VERSION], 55bf2eeab3Smrg [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 56bf2eeab3Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) 5714c0a534Smrg 58bf2eeab3Smrg# AM_AUX_DIR_EXPAND -*- Autoconf -*- 5914c0a534Smrg 60bf2eeab3Smrg# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 61bf2eeab3Smrg# 62bf2eeab3Smrg# This file is free software; the Free Software Foundation 63bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it, 64bf2eeab3Smrg# with or without modifications, as long as this notice is preserved. 65bf2eeab3Smrg 66bf2eeab3Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 67bf2eeab3Smrg# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to 68bf2eeab3Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'. 6914c0a534Smrg# 70bf2eeab3Smrg# Of course, Automake must honor this variable whenever it calls a 71bf2eeab3Smrg# tool from the auxiliary directory. The problem is that $srcdir (and 72bf2eeab3Smrg# therefore $ac_aux_dir as well) can be either absolute or relative, 73bf2eeab3Smrg# depending on how configure is run. This is pretty annoying, since 74bf2eeab3Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top 75bf2eeab3Smrg# source directory, any form will work fine, but in subdirectories a 76bf2eeab3Smrg# relative path needs to be adjusted first. 7714c0a534Smrg# 78bf2eeab3Smrg# $ac_aux_dir/missing 79bf2eeab3Smrg# fails when called from a subdirectory if $ac_aux_dir is relative 80bf2eeab3Smrg# $top_srcdir/$ac_aux_dir/missing 81bf2eeab3Smrg# fails if $ac_aux_dir is absolute, 82bf2eeab3Smrg# fails when called from a subdirectory in a VPATH build with 83bf2eeab3Smrg# a relative $ac_aux_dir 8414c0a534Smrg# 85bf2eeab3Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir 86bf2eeab3Smrg# are both prefixed by $srcdir. In an in-source build this is usually 87bf2eeab3Smrg# harmless because $srcdir is `.', but things will broke when you 88bf2eeab3Smrg# start a VPATH build or use an absolute $srcdir. 8914c0a534Smrg# 90bf2eeab3Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 91bf2eeab3Smrg# iff we strip the leading $srcdir from $ac_aux_dir. That would be: 92bf2eeab3Smrg# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 93bf2eeab3Smrg# and then we would define $MISSING as 94bf2eeab3Smrg# MISSING="\${SHELL} $am_aux_dir/missing" 95bf2eeab3Smrg# This will work as long as MISSING is not called from configure, because 96bf2eeab3Smrg# unfortunately $(top_srcdir) has no meaning in configure. 97bf2eeab3Smrg# However there are other variables, like CC, which are often used in 98bf2eeab3Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir. 99bf2eeab3Smrg# 100bf2eeab3Smrg# Another solution, used here, is to always expand $ac_aux_dir to an 101bf2eeab3Smrg# absolute PATH. The drawback is that using absolute paths prevent a 102bf2eeab3Smrg# configured tree to be moved without reconfiguration. 10314c0a534Smrg 104bf2eeab3SmrgAC_DEFUN([AM_AUX_DIR_EXPAND], 105bf2eeab3Smrg[dnl Rely on autoconf to set up CDPATH properly. 106bf2eeab3SmrgAC_PREREQ([2.50])dnl 107bf2eeab3Smrg# expand $ac_aux_dir to an absolute path 108bf2eeab3Smrgam_aux_dir=`cd $ac_aux_dir && pwd` 109bf2eeab3Smrg]) 11014c0a534Smrg 111bf2eeab3Smrg# AM_CONDITIONAL -*- Autoconf -*- 11214c0a534Smrg 113bf2eeab3Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 114bf2eeab3Smrg# Free Software Foundation, Inc. 115bf2eeab3Smrg# 116bf2eeab3Smrg# This file is free software; the Free Software Foundation 117bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it, 118bf2eeab3Smrg# with or without modifications, as long as this notice is preserved. 11914c0a534Smrg 120bf2eeab3Smrg# serial 9 12114c0a534Smrg 122bf2eeab3Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION) 123bf2eeab3Smrg# ------------------------------------- 124bf2eeab3Smrg# Define a conditional. 125bf2eeab3SmrgAC_DEFUN([AM_CONDITIONAL], 126bf2eeab3Smrg[AC_PREREQ(2.52)dnl 127bf2eeab3Smrg ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 128bf2eeab3Smrg [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 129bf2eeab3SmrgAC_SUBST([$1_TRUE])dnl 130bf2eeab3SmrgAC_SUBST([$1_FALSE])dnl 131bf2eeab3Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl 132bf2eeab3Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl 133bf2eeab3Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl 134bf2eeab3Smrgif $2; then 135bf2eeab3Smrg $1_TRUE= 136bf2eeab3Smrg $1_FALSE='#' 137bf2eeab3Smrgelse 138bf2eeab3Smrg $1_TRUE='#' 139bf2eeab3Smrg $1_FALSE= 140bf2eeab3Smrgfi 141bf2eeab3SmrgAC_CONFIG_COMMANDS_PRE( 142bf2eeab3Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 143bf2eeab3Smrg AC_MSG_ERROR([[conditional "$1" was never defined. 144bf2eeab3SmrgUsually this means the macro was only invoked conditionally.]]) 145bf2eeab3Smrgfi])]) 14614c0a534Smrg 147bf2eeab3Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 148bf2eeab3Smrg# Free Software Foundation, Inc. 149bf2eeab3Smrg# 150bf2eeab3Smrg# This file is free software; the Free Software Foundation 151bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it, 152bf2eeab3Smrg# with or without modifications, as long as this notice is preserved. 15314c0a534Smrg 154bf2eeab3Smrg# serial 10 15514c0a534Smrg 156bf2eeab3Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be 157bf2eeab3Smrg# written in clear, in which case automake, when reading aclocal.m4, 158bf2eeab3Smrg# will think it sees a *use*, and therefore will trigger all it's 159bf2eeab3Smrg# C support machinery. Also note that it means that autoscan, seeing 160bf2eeab3Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use... 16114c0a534Smrg 16214c0a534Smrg 163bf2eeab3Smrg# _AM_DEPENDENCIES(NAME) 164bf2eeab3Smrg# ---------------------- 165bf2eeab3Smrg# See how the compiler implements dependency checking. 166bf2eeab3Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC". 167bf2eeab3Smrg# We try a few techniques and use that to set a single cache variable. 168bf2eeab3Smrg# 169bf2eeab3Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was 170bf2eeab3Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular 171bf2eeab3Smrg# dependency, and given that the user is not expected to run this macro, 172bf2eeab3Smrg# just rely on AC_PROG_CC. 173bf2eeab3SmrgAC_DEFUN([_AM_DEPENDENCIES], 174bf2eeab3Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl 175bf2eeab3SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl 176bf2eeab3SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl 177bf2eeab3SmrgAC_REQUIRE([AM_DEP_TRACK])dnl 17814c0a534Smrg 179bf2eeab3Smrgifelse([$1], CC, [depcc="$CC" am_compiler_list=], 180bf2eeab3Smrg [$1], CXX, [depcc="$CXX" am_compiler_list=], 181bf2eeab3Smrg [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 182bf2eeab3Smrg [$1], UPC, [depcc="$UPC" am_compiler_list=], 183bf2eeab3Smrg [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 184bf2eeab3Smrg [depcc="$$1" am_compiler_list=]) 18514c0a534Smrg 186bf2eeab3SmrgAC_CACHE_CHECK([dependency style of $depcc], 187bf2eeab3Smrg [am_cv_$1_dependencies_compiler_type], 188bf2eeab3Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then 189bf2eeab3Smrg # We make a subdir and do the tests there. Otherwise we can end up 190bf2eeab3Smrg # making bogus files that we don't know about and never remove. For 191bf2eeab3Smrg # instance it was reported that on HP-UX the gcc test will end up 192bf2eeab3Smrg # making a dummy file named `D' -- because `-MD' means `put the output 193bf2eeab3Smrg # in D'. 194bf2eeab3Smrg mkdir conftest.dir 195bf2eeab3Smrg # Copy depcomp to subdir because otherwise we won't find it if we're 196bf2eeab3Smrg # using a relative directory. 197bf2eeab3Smrg cp "$am_depcomp" conftest.dir 198bf2eeab3Smrg cd conftest.dir 199bf2eeab3Smrg # We will build objects and dependencies in a subdirectory because 200bf2eeab3Smrg # it helps to detect inapplicable dependency modes. For instance 201bf2eeab3Smrg # both Tru64's cc and ICC support -MD to output dependencies as a 202bf2eeab3Smrg # side effect of compilation, but ICC will put the dependencies in 203bf2eeab3Smrg # the current directory while Tru64 will put them in the object 204bf2eeab3Smrg # directory. 205bf2eeab3Smrg mkdir sub 20614c0a534Smrg 207bf2eeab3Smrg am_cv_$1_dependencies_compiler_type=none 208bf2eeab3Smrg if test "$am_compiler_list" = ""; then 209bf2eeab3Smrg am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` 210bf2eeab3Smrg fi 211bf2eeab3Smrg am__universal=false 212bf2eeab3Smrg m4_case([$1], [CC], 213bf2eeab3Smrg [case " $depcc " in #( 214bf2eeab3Smrg *\ -arch\ *\ -arch\ *) am__universal=true ;; 215bf2eeab3Smrg esac], 216bf2eeab3Smrg [CXX], 217bf2eeab3Smrg [case " $depcc " in #( 218bf2eeab3Smrg *\ -arch\ *\ -arch\ *) am__universal=true ;; 219bf2eeab3Smrg esac]) 22014c0a534Smrg 221bf2eeab3Smrg for depmode in $am_compiler_list; do 222bf2eeab3Smrg # Setup a source with many dependencies, because some compilers 223bf2eeab3Smrg # like to wrap large dependency lists on column 80 (with \), and 224bf2eeab3Smrg # we should not choose a depcomp mode which is confused by this. 225bf2eeab3Smrg # 226bf2eeab3Smrg # We need to recreate these files for each test, as the compiler may 227bf2eeab3Smrg # overwrite some of them when testing with obscure command lines. 228bf2eeab3Smrg # This happens at least with the AIX C compiler. 229bf2eeab3Smrg : > sub/conftest.c 230bf2eeab3Smrg for i in 1 2 3 4 5 6; do 231bf2eeab3Smrg echo '#include "conftst'$i'.h"' >> sub/conftest.c 232bf2eeab3Smrg # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with 233bf2eeab3Smrg # Solaris 8's {/usr,}/bin/sh. 234bf2eeab3Smrg touch sub/conftst$i.h 235bf2eeab3Smrg done 236bf2eeab3Smrg echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 237bf2eeab3Smrg 238bf2eeab3Smrg # We check with `-c' and `-o' for the sake of the "dashmstdout" 239bf2eeab3Smrg # mode. It turns out that the SunPro C++ compiler does not properly 240bf2eeab3Smrg # handle `-M -o', and we need to detect this. Also, some Intel 241bf2eeab3Smrg # versions had trouble with output in subdirs 242bf2eeab3Smrg am__obj=sub/conftest.${OBJEXT-o} 243bf2eeab3Smrg am__minus_obj="-o $am__obj" 244bf2eeab3Smrg case $depmode in 245bf2eeab3Smrg gcc) 246bf2eeab3Smrg # This depmode causes a compiler race in universal mode. 247bf2eeab3Smrg test "$am__universal" = false || continue 248bf2eeab3Smrg ;; 249bf2eeab3Smrg nosideeffect) 250bf2eeab3Smrg # after this tag, mechanisms are not by side-effect, so they'll 251bf2eeab3Smrg # only be used when explicitly requested 252bf2eeab3Smrg if test "x$enable_dependency_tracking" = xyes; then 253bf2eeab3Smrg continue 254bf2eeab3Smrg else 255bf2eeab3Smrg break 256bf2eeab3Smrg fi 257bf2eeab3Smrg ;; 258bf2eeab3Smrg msvisualcpp | msvcmsys) 259bf2eeab3Smrg # This compiler won't grok `-c -o', but also, the minuso test has 260bf2eeab3Smrg # not run yet. These depmodes are late enough in the game, and 261bf2eeab3Smrg # so weak that their functioning should not be impacted. 262bf2eeab3Smrg am__obj=conftest.${OBJEXT-o} 263bf2eeab3Smrg am__minus_obj= 264bf2eeab3Smrg ;; 265bf2eeab3Smrg none) break ;; 266bf2eeab3Smrg esac 267bf2eeab3Smrg if depmode=$depmode \ 268bf2eeab3Smrg source=sub/conftest.c object=$am__obj \ 269bf2eeab3Smrg depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ 270bf2eeab3Smrg $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ 271bf2eeab3Smrg >/dev/null 2>conftest.err && 272bf2eeab3Smrg grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 273bf2eeab3Smrg grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && 274bf2eeab3Smrg grep $am__obj sub/conftest.Po > /dev/null 2>&1 && 275bf2eeab3Smrg ${MAKE-make} -s -f confmf > /dev/null 2>&1; then 276bf2eeab3Smrg # icc doesn't choke on unknown options, it will just issue warnings 277bf2eeab3Smrg # or remarks (even with -Werror). So we grep stderr for any message 278bf2eeab3Smrg # that says an option was ignored or not supported. 279bf2eeab3Smrg # When given -MP, icc 7.0 and 7.1 complain thusly: 280bf2eeab3Smrg # icc: Command line warning: ignoring option '-M'; no argument required 281bf2eeab3Smrg # The diagnosis changed in icc 8.0: 282bf2eeab3Smrg # icc: Command line remark: option '-MP' not supported 283bf2eeab3Smrg if (grep 'ignoring option' conftest.err || 284bf2eeab3Smrg grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else 285bf2eeab3Smrg am_cv_$1_dependencies_compiler_type=$depmode 286bf2eeab3Smrg break 287bf2eeab3Smrg fi 288bf2eeab3Smrg fi 289bf2eeab3Smrg done 290bf2eeab3Smrg 291bf2eeab3Smrg cd .. 292bf2eeab3Smrg rm -rf conftest.dir 29314c0a534Smrgelse 294bf2eeab3Smrg am_cv_$1_dependencies_compiler_type=none 29514c0a534Smrgfi 296bf2eeab3Smrg]) 297bf2eeab3SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) 298bf2eeab3SmrgAM_CONDITIONAL([am__fastdep$1], [ 299bf2eeab3Smrg test "x$enable_dependency_tracking" != xno \ 300bf2eeab3Smrg && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) 301bf2eeab3Smrg]) 30214c0a534Smrg 30314c0a534Smrg 304bf2eeab3Smrg# AM_SET_DEPDIR 305bf2eeab3Smrg# ------------- 306bf2eeab3Smrg# Choose a directory name for dependency files. 307bf2eeab3Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES 308bf2eeab3SmrgAC_DEFUN([AM_SET_DEPDIR], 309bf2eeab3Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl 310bf2eeab3SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl 311bf2eeab3Smrg]) 31214c0a534Smrg 31314c0a534Smrg 314bf2eeab3Smrg# AM_DEP_TRACK 315bf2eeab3Smrg# ------------ 316bf2eeab3SmrgAC_DEFUN([AM_DEP_TRACK], 317bf2eeab3Smrg[AC_ARG_ENABLE(dependency-tracking, 318bf2eeab3Smrg[ --disable-dependency-tracking speeds up one-time build 319bf2eeab3Smrg --enable-dependency-tracking do not reject slow dependency extractors]) 320bf2eeab3Smrgif test "x$enable_dependency_tracking" != xno; then 321bf2eeab3Smrg am_depcomp="$ac_aux_dir/depcomp" 322bf2eeab3Smrg AMDEPBACKSLASH='\' 32314c0a534Smrgfi 324bf2eeab3SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) 325bf2eeab3SmrgAC_SUBST([AMDEPBACKSLASH])dnl 326bf2eeab3Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl 327bf2eeab3Smrg]) 32814c0a534Smrg 329bf2eeab3Smrg# Generate code to set up dependency tracking. -*- Autoconf -*- 330bf2eeab3Smrg 331bf2eeab3Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 332bf2eeab3Smrg# Free Software Foundation, Inc. 333bf2eeab3Smrg# 334bf2eeab3Smrg# This file is free software; the Free Software Foundation 335bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it, 336bf2eeab3Smrg# with or without modifications, as long as this notice is preserved. 337bf2eeab3Smrg 338bf2eeab3Smrg#serial 5 339bf2eeab3Smrg 340bf2eeab3Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS 341bf2eeab3Smrg# ------------------------------ 342bf2eeab3SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], 343bf2eeab3Smrg[{ 344bf2eeab3Smrg # Autoconf 2.62 quotes --file arguments for eval, but not when files 345bf2eeab3Smrg # are listed without --file. Let's play safe and only enable the eval 346bf2eeab3Smrg # if we detect the quoting. 347bf2eeab3Smrg case $CONFIG_FILES in 348bf2eeab3Smrg *\'*) eval set x "$CONFIG_FILES" ;; 349bf2eeab3Smrg *) set x $CONFIG_FILES ;; 350bf2eeab3Smrg esac 351bf2eeab3Smrg shift 352bf2eeab3Smrg for mf 353bf2eeab3Smrg do 354bf2eeab3Smrg # Strip MF so we end up with the name of the file. 355bf2eeab3Smrg mf=`echo "$mf" | sed -e 's/:.*$//'` 356bf2eeab3Smrg # Check whether this is an Automake generated Makefile or not. 357bf2eeab3Smrg # We used to match only the files named `Makefile.in', but 358bf2eeab3Smrg # some people rename them; so instead we look at the file content. 359bf2eeab3Smrg # Grep'ing the first line is not enough: some people post-process 360bf2eeab3Smrg # each Makefile.in and add a new line on top of each file to say so. 361bf2eeab3Smrg # Grep'ing the whole file is not good either: AIX grep has a line 362bf2eeab3Smrg # limit of 2048, but all sed's we know have understand at least 4000. 363bf2eeab3Smrg if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then 364bf2eeab3Smrg dirpart=`AS_DIRNAME("$mf")` 365bf2eeab3Smrg else 366bf2eeab3Smrg continue 367bf2eeab3Smrg fi 368bf2eeab3Smrg # Extract the definition of DEPDIR, am__include, and am__quote 369bf2eeab3Smrg # from the Makefile without running `make'. 370bf2eeab3Smrg DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` 371bf2eeab3Smrg test -z "$DEPDIR" && continue 372bf2eeab3Smrg am__include=`sed -n 's/^am__include = //p' < "$mf"` 373bf2eeab3Smrg test -z "am__include" && continue 374bf2eeab3Smrg am__quote=`sed -n 's/^am__quote = //p' < "$mf"` 375bf2eeab3Smrg # When using ansi2knr, U may be empty or an underscore; expand it 376bf2eeab3Smrg U=`sed -n 's/^U = //p' < "$mf"` 377bf2eeab3Smrg # Find all dependency output files, they are included files with 378bf2eeab3Smrg # $(DEPDIR) in their names. We invoke sed twice because it is the 379bf2eeab3Smrg # simplest approach to changing $(DEPDIR) to its actual value in the 380bf2eeab3Smrg # expansion. 381bf2eeab3Smrg for file in `sed -n " 382bf2eeab3Smrg s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ 383bf2eeab3Smrg sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do 384bf2eeab3Smrg # Make sure the directory exists. 385bf2eeab3Smrg test -f "$dirpart/$file" && continue 386bf2eeab3Smrg fdir=`AS_DIRNAME(["$file"])` 387bf2eeab3Smrg AS_MKDIR_P([$dirpart/$fdir]) 388bf2eeab3Smrg # echo "creating $dirpart/$file" 389bf2eeab3Smrg echo '# dummy' > "$dirpart/$file" 390bf2eeab3Smrg done 391bf2eeab3Smrg done 392bf2eeab3Smrg} 393bf2eeab3Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS 394bf2eeab3Smrg 395bf2eeab3Smrg 396bf2eeab3Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS 397bf2eeab3Smrg# ----------------------------- 398bf2eeab3Smrg# This macro should only be invoked once -- use via AC_REQUIRE. 399bf2eeab3Smrg# 400bf2eeab3Smrg# This code is only required when automatic dependency tracking 401bf2eeab3Smrg# is enabled. FIXME. This creates each `.P' file that we will 402bf2eeab3Smrg# need in order to bootstrap the dependency handling code. 403bf2eeab3SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], 404bf2eeab3Smrg[AC_CONFIG_COMMANDS([depfiles], 405bf2eeab3Smrg [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], 406bf2eeab3Smrg [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) 407bf2eeab3Smrg]) 408bf2eeab3Smrg 409bf2eeab3Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 410bf2eeab3Smrg# Free Software Foundation, Inc. 411bf2eeab3Smrg# 412bf2eeab3Smrg# This file is free software; the Free Software Foundation 413bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it, 414bf2eeab3Smrg# with or without modifications, as long as this notice is preserved. 415bf2eeab3Smrg 416bf2eeab3Smrg# serial 8 417bf2eeab3Smrg 418bf2eeab3Smrg# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. 419bf2eeab3SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) 420bf2eeab3Smrg 421bf2eeab3Smrg# Do all the work for Automake. -*- Autoconf -*- 422bf2eeab3Smrg 423bf2eeab3Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 424bf2eeab3Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. 425bf2eeab3Smrg# 426bf2eeab3Smrg# This file is free software; the Free Software Foundation 427bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it, 428bf2eeab3Smrg# with or without modifications, as long as this notice is preserved. 429bf2eeab3Smrg 430bf2eeab3Smrg# serial 16 431bf2eeab3Smrg 432bf2eeab3Smrg# This macro actually does too much. Some checks are only needed if 433bf2eeab3Smrg# your package does certain things. But this isn't really a big deal. 434bf2eeab3Smrg 435bf2eeab3Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 436bf2eeab3Smrg# AM_INIT_AUTOMAKE([OPTIONS]) 437bf2eeab3Smrg# ----------------------------------------------- 438bf2eeab3Smrg# The call with PACKAGE and VERSION arguments is the old style 439bf2eeab3Smrg# call (pre autoconf-2.50), which is being phased out. PACKAGE 440bf2eeab3Smrg# and VERSION should now be passed to AC_INIT and removed from 441bf2eeab3Smrg# the call to AM_INIT_AUTOMAKE. 442bf2eeab3Smrg# We support both call styles for the transition. After 443bf2eeab3Smrg# the next Automake release, Autoconf can make the AC_INIT 444bf2eeab3Smrg# arguments mandatory, and then we can depend on a new Autoconf 445bf2eeab3Smrg# release and drop the old call support. 446bf2eeab3SmrgAC_DEFUN([AM_INIT_AUTOMAKE], 447bf2eeab3Smrg[AC_PREREQ([2.62])dnl 448bf2eeab3Smrgdnl Autoconf wants to disallow AM_ names. We explicitly allow 449bf2eeab3Smrgdnl the ones we care about. 450bf2eeab3Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 451bf2eeab3SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 452bf2eeab3SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl 453bf2eeab3Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then 454bf2eeab3Smrg # Use -I$(srcdir) only when $(srcdir) != ., so that make's output 455bf2eeab3Smrg # is not polluted with repeated "-I." 456bf2eeab3Smrg AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl 457bf2eeab3Smrg # test to see if srcdir already configured 458bf2eeab3Smrg if test -f $srcdir/config.status; then 459bf2eeab3Smrg AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 460bf2eeab3Smrg fi 46114c0a534Smrgfi 46214c0a534Smrg 463bf2eeab3Smrg# test whether we have cygpath 464bf2eeab3Smrgif test -z "$CYGPATH_W"; then 465bf2eeab3Smrg if (cygpath --version) >/dev/null 2>/dev/null; then 466bf2eeab3Smrg CYGPATH_W='cygpath -w' 467bf2eeab3Smrg else 468bf2eeab3Smrg CYGPATH_W=echo 469bf2eeab3Smrg fi 47014c0a534Smrgfi 471bf2eeab3SmrgAC_SUBST([CYGPATH_W]) 472bf2eeab3Smrg 473bf2eeab3Smrg# Define the identity of the package. 474bf2eeab3Smrgdnl Distinguish between old-style and new-style calls. 475bf2eeab3Smrgm4_ifval([$2], 476bf2eeab3Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 477bf2eeab3Smrg AC_SUBST([PACKAGE], [$1])dnl 478bf2eeab3Smrg AC_SUBST([VERSION], [$2])], 479bf2eeab3Smrg[_AM_SET_OPTIONS([$1])dnl 480bf2eeab3Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. 481bf2eeab3Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, 482bf2eeab3Smrg [m4_fatal([AC_INIT should be called with package and version arguments])])dnl 483bf2eeab3Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl 484bf2eeab3Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl 485bf2eeab3Smrg 486bf2eeab3Smrg_AM_IF_OPTION([no-define],, 487bf2eeab3Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) 488bf2eeab3Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl 489bf2eeab3Smrg 490bf2eeab3Smrg# Some tools Automake needs. 491bf2eeab3SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl 492bf2eeab3SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl 493bf2eeab3SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) 494bf2eeab3SmrgAM_MISSING_PROG(AUTOCONF, autoconf) 495bf2eeab3SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) 496bf2eeab3SmrgAM_MISSING_PROG(AUTOHEADER, autoheader) 497bf2eeab3SmrgAM_MISSING_PROG(MAKEINFO, makeinfo) 498bf2eeab3SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl 499bf2eeab3SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl 500bf2eeab3SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl 501bf2eeab3Smrg# We need awk for the "check" target. The system "awk" is bad on 502bf2eeab3Smrg# some platforms. 503bf2eeab3SmrgAC_REQUIRE([AC_PROG_AWK])dnl 504bf2eeab3SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl 505bf2eeab3SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl 506bf2eeab3Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], 507bf2eeab3Smrg [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], 508bf2eeab3Smrg [_AM_PROG_TAR([v7])])]) 509bf2eeab3Smrg_AM_IF_OPTION([no-dependencies],, 510bf2eeab3Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC], 511bf2eeab3Smrg [_AM_DEPENDENCIES(CC)], 512bf2eeab3Smrg [define([AC_PROG_CC], 513bf2eeab3Smrg defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl 514bf2eeab3SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX], 515bf2eeab3Smrg [_AM_DEPENDENCIES(CXX)], 516bf2eeab3Smrg [define([AC_PROG_CXX], 517bf2eeab3Smrg defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl 518bf2eeab3SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC], 519bf2eeab3Smrg [_AM_DEPENDENCIES(OBJC)], 520bf2eeab3Smrg [define([AC_PROG_OBJC], 521bf2eeab3Smrg defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl 522bf2eeab3Smrg]) 523bf2eeab3Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl 524bf2eeab3Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the 525bf2eeab3Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro 526bf2eeab3Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below. 527bf2eeab3SmrgAC_CONFIG_COMMANDS_PRE(dnl 528bf2eeab3Smrg[m4_provide_if([_AM_COMPILER_EXEEXT], 529bf2eeab3Smrg [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl 530bf2eeab3Smrg]) 531bf2eeab3Smrg 532bf2eeab3Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not 533bf2eeab3Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further 534bf2eeab3Smrgdnl mangled by Autoconf and run in a shell conditional statement. 535bf2eeab3Smrgm4_define([_AC_COMPILER_EXEEXT], 536bf2eeab3Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) 537bf2eeab3Smrg 538bf2eeab3Smrg 539bf2eeab3Smrg# When config.status generates a header, we must update the stamp-h file. 540bf2eeab3Smrg# This file resides in the same directory as the config header 541bf2eeab3Smrg# that is generated. The stamp files are numbered to have different names. 542bf2eeab3Smrg 543bf2eeab3Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 544bf2eeab3Smrg# loop where config.status creates the headers, so we can generate 545bf2eeab3Smrg# our stamp files there. 546bf2eeab3SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 547bf2eeab3Smrg[# Compute $1's index in $config_headers. 548bf2eeab3Smrg_am_arg=$1 549bf2eeab3Smrg_am_stamp_count=1 550bf2eeab3Smrgfor _am_header in $config_headers :; do 551bf2eeab3Smrg case $_am_header in 552bf2eeab3Smrg $_am_arg | $_am_arg:* ) 553bf2eeab3Smrg break ;; 554bf2eeab3Smrg * ) 555bf2eeab3Smrg _am_stamp_count=`expr $_am_stamp_count + 1` ;; 556bf2eeab3Smrg esac 557bf2eeab3Smrgdone 558bf2eeab3Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) 559bf2eeab3Smrg 560bf2eeab3Smrg# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. 561bf2eeab3Smrg# 562bf2eeab3Smrg# This file is free software; the Free Software Foundation 563bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it, 564bf2eeab3Smrg# with or without modifications, as long as this notice is preserved. 565bf2eeab3Smrg 566bf2eeab3Smrg# AM_PROG_INSTALL_SH 567bf2eeab3Smrg# ------------------ 568bf2eeab3Smrg# Define $install_sh. 569bf2eeab3SmrgAC_DEFUN([AM_PROG_INSTALL_SH], 570bf2eeab3Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 571bf2eeab3Smrgif test x"${install_sh}" != xset; then 572bf2eeab3Smrg case $am_aux_dir in 573bf2eeab3Smrg *\ * | *\ *) 574bf2eeab3Smrg install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; 575bf2eeab3Smrg *) 576bf2eeab3Smrg install_sh="\${SHELL} $am_aux_dir/install-sh" 577bf2eeab3Smrg esac 57814c0a534Smrgfi 579bf2eeab3SmrgAC_SUBST(install_sh)]) 58014c0a534Smrg 581bf2eeab3Smrg# Copyright (C) 2003, 2005 Free Software Foundation, Inc. 582bf2eeab3Smrg# 583bf2eeab3Smrg# This file is free software; the Free Software Foundation 584bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it, 585bf2eeab3Smrg# with or without modifications, as long as this notice is preserved. 586bf2eeab3Smrg 587bf2eeab3Smrg# serial 2 588bf2eeab3Smrg 589bf2eeab3Smrg# Check whether the underlying file-system supports filenames 590bf2eeab3Smrg# with a leading dot. For instance MS-DOS doesn't. 591bf2eeab3SmrgAC_DEFUN([AM_SET_LEADING_DOT], 592bf2eeab3Smrg[rm -rf .tst 2>/dev/null 593bf2eeab3Smrgmkdir .tst 2>/dev/null 594bf2eeab3Smrgif test -d .tst; then 595bf2eeab3Smrg am__leading_dot=. 596bf2eeab3Smrgelse 597bf2eeab3Smrg am__leading_dot=_ 59814c0a534Smrgfi 599bf2eeab3Smrgrmdir .tst 2>/dev/null 600bf2eeab3SmrgAC_SUBST([am__leading_dot])]) 601bf2eeab3Smrg 602bf2eeab3Smrg# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- 603bf2eeab3Smrg# From Jim Meyering 604bf2eeab3Smrg 605bf2eeab3Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 606bf2eeab3Smrg# Free Software Foundation, Inc. 607bf2eeab3Smrg# 608bf2eeab3Smrg# This file is free software; the Free Software Foundation 609bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it, 610bf2eeab3Smrg# with or without modifications, as long as this notice is preserved. 611bf2eeab3Smrg 612bf2eeab3Smrg# serial 5 613bf2eeab3Smrg 614bf2eeab3Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE]) 615bf2eeab3Smrg# ---------------------------------- 616bf2eeab3Smrg# Control maintainer-specific portions of Makefiles. 617bf2eeab3Smrg# Default is to disable them, unless `enable' is passed literally. 618bf2eeab3Smrg# For symmetry, `disable' may be passed as well. Anyway, the user 619bf2eeab3Smrg# can override the default with the --enable/--disable switch. 620bf2eeab3SmrgAC_DEFUN([AM_MAINTAINER_MODE], 621bf2eeab3Smrg[m4_case(m4_default([$1], [disable]), 622bf2eeab3Smrg [enable], [m4_define([am_maintainer_other], [disable])], 623bf2eeab3Smrg [disable], [m4_define([am_maintainer_other], [enable])], 624bf2eeab3Smrg [m4_define([am_maintainer_other], [enable]) 625bf2eeab3Smrg m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) 626bf2eeab3SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) 627bf2eeab3Smrg dnl maintainer-mode's default is 'disable' unless 'enable' is passed 628bf2eeab3Smrg AC_ARG_ENABLE([maintainer-mode], 629bf2eeab3Smrg[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful 630bf2eeab3Smrg (and sometimes confusing) to the casual installer], 631bf2eeab3Smrg [USE_MAINTAINER_MODE=$enableval], 632bf2eeab3Smrg [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) 633bf2eeab3Smrg AC_MSG_RESULT([$USE_MAINTAINER_MODE]) 634bf2eeab3Smrg AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) 635bf2eeab3Smrg MAINT=$MAINTAINER_MODE_TRUE 636bf2eeab3Smrg AC_SUBST([MAINT])dnl 637bf2eeab3Smrg] 638bf2eeab3Smrg) 639bf2eeab3Smrg 640bf2eeab3SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) 641bf2eeab3Smrg 642bf2eeab3Smrg# Check to see how 'make' treats includes. -*- Autoconf -*- 643bf2eeab3Smrg 644bf2eeab3Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. 645bf2eeab3Smrg# 646bf2eeab3Smrg# This file is free software; the Free Software Foundation 647bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it, 648bf2eeab3Smrg# with or without modifications, as long as this notice is preserved. 649bf2eeab3Smrg 650bf2eeab3Smrg# serial 4 651bf2eeab3Smrg 652bf2eeab3Smrg# AM_MAKE_INCLUDE() 653bf2eeab3Smrg# ----------------- 654bf2eeab3Smrg# Check to see how make treats includes. 655bf2eeab3SmrgAC_DEFUN([AM_MAKE_INCLUDE], 656bf2eeab3Smrg[am_make=${MAKE-make} 657bf2eeab3Smrgcat > confinc << 'END' 658bf2eeab3Smrgam__doit: 659bf2eeab3Smrg @echo this is the am__doit target 660bf2eeab3Smrg.PHONY: am__doit 661bf2eeab3SmrgEND 662bf2eeab3Smrg# If we don't find an include directive, just comment out the code. 663bf2eeab3SmrgAC_MSG_CHECKING([for style of include used by $am_make]) 664bf2eeab3Smrgam__include="#" 665bf2eeab3Smrgam__quote= 666bf2eeab3Smrg_am_result=none 667bf2eeab3Smrg# First try GNU make style include. 668bf2eeab3Smrgecho "include confinc" > confmf 669bf2eeab3Smrg# Ignore all kinds of additional output from `make'. 670bf2eeab3Smrgcase `$am_make -s -f confmf 2> /dev/null` in #( 671bf2eeab3Smrg*the\ am__doit\ target*) 672bf2eeab3Smrg am__include=include 673bf2eeab3Smrg am__quote= 674bf2eeab3Smrg _am_result=GNU 675bf2eeab3Smrg ;; 676bf2eeab3Smrgesac 677bf2eeab3Smrg# Now try BSD make style include. 678bf2eeab3Smrgif test "$am__include" = "#"; then 679bf2eeab3Smrg echo '.include "confinc"' > confmf 680bf2eeab3Smrg case `$am_make -s -f confmf 2> /dev/null` in #( 681bf2eeab3Smrg *the\ am__doit\ target*) 682bf2eeab3Smrg am__include=.include 683bf2eeab3Smrg am__quote="\"" 684bf2eeab3Smrg _am_result=BSD 685bf2eeab3Smrg ;; 686bf2eeab3Smrg esac 68714c0a534Smrgfi 688bf2eeab3SmrgAC_SUBST([am__include]) 689bf2eeab3SmrgAC_SUBST([am__quote]) 690bf2eeab3SmrgAC_MSG_RESULT([$_am_result]) 691bf2eeab3Smrgrm -f confinc confmf 692bf2eeab3Smrg]) 69314c0a534Smrg 694bf2eeab3Smrg# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- 695bf2eeab3Smrg 696bf2eeab3Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 697bf2eeab3Smrg# Free Software Foundation, Inc. 698bf2eeab3Smrg# 699bf2eeab3Smrg# This file is free software; the Free Software Foundation 700bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it, 701bf2eeab3Smrg# with or without modifications, as long as this notice is preserved. 702bf2eeab3Smrg 703bf2eeab3Smrg# serial 6 704bf2eeab3Smrg 705bf2eeab3Smrg# AM_MISSING_PROG(NAME, PROGRAM) 706bf2eeab3Smrg# ------------------------------ 707bf2eeab3SmrgAC_DEFUN([AM_MISSING_PROG], 708bf2eeab3Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN]) 709bf2eeab3Smrg$1=${$1-"${am_missing_run}$2"} 710bf2eeab3SmrgAC_SUBST($1)]) 711bf2eeab3Smrg 712bf2eeab3Smrg 713bf2eeab3Smrg# AM_MISSING_HAS_RUN 714bf2eeab3Smrg# ------------------ 715bf2eeab3Smrg# Define MISSING if not defined so far and test if it supports --run. 716bf2eeab3Smrg# If it does, set am_missing_run to use it, otherwise, to nothing. 717bf2eeab3SmrgAC_DEFUN([AM_MISSING_HAS_RUN], 718bf2eeab3Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 719bf2eeab3SmrgAC_REQUIRE_AUX_FILE([missing])dnl 720bf2eeab3Smrgif test x"${MISSING+set}" != xset; then 721bf2eeab3Smrg case $am_aux_dir in 722bf2eeab3Smrg *\ * | *\ *) 723bf2eeab3Smrg MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; 724bf2eeab3Smrg *) 725bf2eeab3Smrg MISSING="\${SHELL} $am_aux_dir/missing" ;; 726bf2eeab3Smrg esac 72714c0a534Smrgfi 728bf2eeab3Smrg# Use eval to expand $SHELL 729bf2eeab3Smrgif eval "$MISSING --run true"; then 730bf2eeab3Smrg am_missing_run="$MISSING --run " 731bf2eeab3Smrgelse 732bf2eeab3Smrg am_missing_run= 733bf2eeab3Smrg AC_MSG_WARN([`missing' script is too old or missing]) 73414c0a534Smrgfi 735bf2eeab3Smrg]) 73614c0a534Smrg 737bf2eeab3Smrg# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 738bf2eeab3Smrg# 739bf2eeab3Smrg# This file is free software; the Free Software Foundation 740bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it, 741bf2eeab3Smrg# with or without modifications, as long as this notice is preserved. 74214c0a534Smrg 743bf2eeab3Smrg# AM_PROG_MKDIR_P 744bf2eeab3Smrg# --------------- 745bf2eeab3Smrg# Check for `mkdir -p'. 746bf2eeab3SmrgAC_DEFUN([AM_PROG_MKDIR_P], 747bf2eeab3Smrg[AC_PREREQ([2.60])dnl 748bf2eeab3SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl 749bf2eeab3Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, 750bf2eeab3Smrgdnl while keeping a definition of mkdir_p for backward compatibility. 751bf2eeab3Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. 752bf2eeab3Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of 753bf2eeab3Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own 754bf2eeab3Smrgdnl adjustment using top_builddir (which is defined more often than 755bf2eeab3Smrgdnl MKDIR_P). 756bf2eeab3SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl 757bf2eeab3Smrgcase $mkdir_p in 758bf2eeab3Smrg [[\\/$]]* | ?:[[\\/]]*) ;; 759bf2eeab3Smrg */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; 760bf2eeab3Smrgesac 761bf2eeab3Smrg]) 76214c0a534Smrg 763bf2eeab3Smrg# Helper functions for option handling. -*- Autoconf -*- 764bf2eeab3Smrg 765bf2eeab3Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. 766bf2eeab3Smrg# 767bf2eeab3Smrg# This file is free software; the Free Software Foundation 768bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it, 769bf2eeab3Smrg# with or without modifications, as long as this notice is preserved. 770bf2eeab3Smrg 771bf2eeab3Smrg# serial 4 772bf2eeab3Smrg 773bf2eeab3Smrg# _AM_MANGLE_OPTION(NAME) 774bf2eeab3Smrg# ----------------------- 775bf2eeab3SmrgAC_DEFUN([_AM_MANGLE_OPTION], 776bf2eeab3Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 777bf2eeab3Smrg 778bf2eeab3Smrg# _AM_SET_OPTION(NAME) 779bf2eeab3Smrg# ------------------------------ 780bf2eeab3Smrg# Set option NAME. Presently that only means defining a flag for this option. 781bf2eeab3SmrgAC_DEFUN([_AM_SET_OPTION], 782bf2eeab3Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) 783bf2eeab3Smrg 784bf2eeab3Smrg# _AM_SET_OPTIONS(OPTIONS) 785bf2eeab3Smrg# ---------------------------------- 786bf2eeab3Smrg# OPTIONS is a space-separated list of Automake options. 787bf2eeab3SmrgAC_DEFUN([_AM_SET_OPTIONS], 788bf2eeab3Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 78914c0a534Smrg 790bf2eeab3Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 791bf2eeab3Smrg# ------------------------------------------- 792bf2eeab3Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 793bf2eeab3SmrgAC_DEFUN([_AM_IF_OPTION], 794bf2eeab3Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 79514c0a534Smrg 796bf2eeab3Smrg# Check to make sure that the build environment is sane. -*- Autoconf -*- 79714c0a534Smrg 798bf2eeab3Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 799bf2eeab3Smrg# Free Software Foundation, Inc. 800bf2eeab3Smrg# 801bf2eeab3Smrg# This file is free software; the Free Software Foundation 802bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it, 803bf2eeab3Smrg# with or without modifications, as long as this notice is preserved. 80414c0a534Smrg 805bf2eeab3Smrg# serial 5 80614c0a534Smrg 807bf2eeab3Smrg# AM_SANITY_CHECK 808bf2eeab3Smrg# --------------- 809bf2eeab3SmrgAC_DEFUN([AM_SANITY_CHECK], 810bf2eeab3Smrg[AC_MSG_CHECKING([whether build environment is sane]) 811bf2eeab3Smrg# Just in case 812bf2eeab3Smrgsleep 1 813bf2eeab3Smrgecho timestamp > conftest.file 814bf2eeab3Smrg# Reject unsafe characters in $srcdir or the absolute working directory 815bf2eeab3Smrg# name. Accept space and tab only in the latter. 816bf2eeab3Smrgam_lf=' 817bf2eeab3Smrg' 818bf2eeab3Smrgcase `pwd` in 819bf2eeab3Smrg *[[\\\"\#\$\&\'\`$am_lf]]*) 820bf2eeab3Smrg AC_MSG_ERROR([unsafe absolute working directory name]);; 821bf2eeab3Smrgesac 822bf2eeab3Smrgcase $srcdir in 823bf2eeab3Smrg *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) 824bf2eeab3Smrg AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; 825bf2eeab3Smrgesac 82614c0a534Smrg 827bf2eeab3Smrg# Do `set' in a subshell so we don't clobber the current shell's 828bf2eeab3Smrg# arguments. Must try -L first in case configure is actually a 829bf2eeab3Smrg# symlink; some systems play weird games with the mod time of symlinks 830bf2eeab3Smrg# (eg FreeBSD returns the mod time of the symlink's containing 831bf2eeab3Smrg# directory). 832bf2eeab3Smrgif ( 833bf2eeab3Smrg set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` 834bf2eeab3Smrg if test "$[*]" = "X"; then 835bf2eeab3Smrg # -L didn't work. 836bf2eeab3Smrg set X `ls -t "$srcdir/configure" conftest.file` 837bf2eeab3Smrg fi 838bf2eeab3Smrg rm -f conftest.file 839bf2eeab3Smrg if test "$[*]" != "X $srcdir/configure conftest.file" \ 840bf2eeab3Smrg && test "$[*]" != "X conftest.file $srcdir/configure"; then 84114c0a534Smrg 842bf2eeab3Smrg # If neither matched, then we have a broken ls. This can happen 843bf2eeab3Smrg # if, for instance, CONFIG_SHELL is bash and it inherits a 844bf2eeab3Smrg # broken ls alias from the environment. This has actually 845bf2eeab3Smrg # happened. Such a system could not be considered "sane". 846bf2eeab3Smrg AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 847bf2eeab3Smrgalias in your environment]) 848bf2eeab3Smrg fi 849bf2eeab3Smrg 850bf2eeab3Smrg test "$[2]" = conftest.file 851bf2eeab3Smrg ) 852bf2eeab3Smrgthen 853bf2eeab3Smrg # Ok. 854bf2eeab3Smrg : 85514c0a534Smrgelse 856bf2eeab3Smrg AC_MSG_ERROR([newly created file is older than distributed files! 857bf2eeab3SmrgCheck your system clock]) 85814c0a534Smrgfi 859bf2eeab3SmrgAC_MSG_RESULT(yes)]) 86014c0a534Smrg 861bf2eeab3Smrg# Copyright (C) 2009 Free Software Foundation, Inc. 862bf2eeab3Smrg# 863bf2eeab3Smrg# This file is free software; the Free Software Foundation 864bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it, 865bf2eeab3Smrg# with or without modifications, as long as this notice is preserved. 86614c0a534Smrg 867bf2eeab3Smrg# serial 1 868bf2eeab3Smrg 869bf2eeab3Smrg# AM_SILENT_RULES([DEFAULT]) 870bf2eeab3Smrg# -------------------------- 871bf2eeab3Smrg# Enable less verbose build rules; with the default set to DEFAULT 872bf2eeab3Smrg# (`yes' being less verbose, `no' or empty being verbose). 873bf2eeab3SmrgAC_DEFUN([AM_SILENT_RULES], 874bf2eeab3Smrg[AC_ARG_ENABLE([silent-rules], 875bf2eeab3Smrg[ --enable-silent-rules less verbose build output (undo: `make V=1') 876bf2eeab3Smrg --disable-silent-rules verbose build output (undo: `make V=0')]) 877bf2eeab3Smrgcase $enable_silent_rules in 878bf2eeab3Smrgyes) AM_DEFAULT_VERBOSITY=0;; 879bf2eeab3Smrgno) AM_DEFAULT_VERBOSITY=1;; 880bf2eeab3Smrg*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; 881bf2eeab3Smrgesac 882bf2eeab3SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl 883bf2eeab3SmrgAM_BACKSLASH='\' 884bf2eeab3SmrgAC_SUBST([AM_BACKSLASH])dnl 885bf2eeab3Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl 886bf2eeab3Smrg]) 88714c0a534Smrg 888bf2eeab3Smrg# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 889bf2eeab3Smrg# 890bf2eeab3Smrg# This file is free software; the Free Software Foundation 891bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it, 892bf2eeab3Smrg# with or without modifications, as long as this notice is preserved. 89314c0a534Smrg 894bf2eeab3Smrg# AM_PROG_INSTALL_STRIP 895bf2eeab3Smrg# --------------------- 896bf2eeab3Smrg# One issue with vendor `install' (even GNU) is that you can't 897bf2eeab3Smrg# specify the program used to strip binaries. This is especially 898bf2eeab3Smrg# annoying in cross-compiling environments, where the build's strip 899bf2eeab3Smrg# is unlikely to handle the host's binaries. 900bf2eeab3Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we 901bf2eeab3Smrg# always use install-sh in `make install-strip', and initialize 902bf2eeab3Smrg# STRIPPROG with the value of the STRIP variable (set by the user). 903bf2eeab3SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP], 904bf2eeab3Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 905bf2eeab3Smrg# Installed binaries are usually stripped using `strip' when the user 906bf2eeab3Smrg# run `make install-strip'. However `strip' might not be the right 907bf2eeab3Smrg# tool to use in cross-compilation environments, therefore Automake 908bf2eeab3Smrg# will honor the `STRIP' environment variable to overrule this program. 909bf2eeab3Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'. 910bf2eeab3Smrgif test "$cross_compiling" != no; then 911bf2eeab3Smrg AC_CHECK_TOOL([STRIP], [strip], :) 91214c0a534Smrgfi 913bf2eeab3SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" 914bf2eeab3SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])]) 91514c0a534Smrg 916bf2eeab3Smrg# Copyright (C) 2006, 2008 Free Software Foundation, Inc. 917bf2eeab3Smrg# 918bf2eeab3Smrg# This file is free software; the Free Software Foundation 919bf2eeab3Smrg# gives unlimited permission to copy and/or distribute it, 920bf2eeab3Smrg# with or without modifications, as long as this notice is preserved. 92114c0a534Smrg 922bf2eeab3Smrg# serial 2 92314c0a534Smrg 924bf2eeab3Smrg# _AM_SUBST_NOTMAKE(VARIABLE) 925bf2eeab3Smrg# --------------------------- 926bf2eeab3Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. 927bf2eeab3Smrg# This macro is traced by Automake. 928bf2eeab3SmrgAC_DEFUN([_AM_SUBST_NOTMAKE]) 92914c0a534Smrg 930bf2eeab3Smrg# AM_SUBST_NOTMAKE(VARIABLE) 931bf2eeab3Smrg# --------------------------- 932bf2eeab3Smrg# Public sister of _AM_SUBST_NOTMAKE. 933bf2eeab3SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) 93414c0a534Smrg 935bf2eeab3Smrg# Check how to create a tarball. -*- Autoconf -*- 936bf2eeab3Smrg 937bf2eeab3Smrg# Copyright (C) 2004, 2005 Free Software Foundation, Inc. 93814c0a534Smrg# 93914c0a534Smrg# This file is free software; the Free Software Foundation 94014c0a534Smrg# gives unlimited permission to copy and/or distribute it, 94114c0a534Smrg# with or without modifications, as long as this notice is preserved. 94214c0a534Smrg 943bf2eeab3Smrg# serial 2 944bf2eeab3Smrg 945bf2eeab3Smrg# _AM_PROG_TAR(FORMAT) 946bf2eeab3Smrg# -------------------- 947bf2eeab3Smrg# Check how to create a tarball in format FORMAT. 948bf2eeab3Smrg# FORMAT should be one of `v7', `ustar', or `pax'. 949bf2eeab3Smrg# 950bf2eeab3Smrg# Substitute a variable $(am__tar) that is a command 951bf2eeab3Smrg# writing to stdout a FORMAT-tarball containing the directory 952bf2eeab3Smrg# $tardir. 953bf2eeab3Smrg# tardir=directory && $(am__tar) > result.tar 954bf2eeab3Smrg# 955bf2eeab3Smrg# Substitute a variable $(am__untar) that extract such 956bf2eeab3Smrg# a tarball read from stdin. 957bf2eeab3Smrg# $(am__untar) < result.tar 958bf2eeab3SmrgAC_DEFUN([_AM_PROG_TAR], 959bf2eeab3Smrg[# Always define AMTAR for backward compatibility. 960bf2eeab3SmrgAM_MISSING_PROG([AMTAR], [tar]) 961bf2eeab3Smrgm4_if([$1], [v7], 962bf2eeab3Smrg [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], 963bf2eeab3Smrg [m4_case([$1], [ustar],, [pax],, 964bf2eeab3Smrg [m4_fatal([Unknown tar format])]) 965bf2eeab3SmrgAC_MSG_CHECKING([how to create a $1 tar archive]) 966bf2eeab3Smrg# Loop over all known methods to create a tar archive until one works. 967bf2eeab3Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' 968bf2eeab3Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools} 969bf2eeab3Smrg# Do not fold the above two line into one, because Tru64 sh and 970bf2eeab3Smrg# Solaris sh will not grok spaces in the rhs of `-'. 971bf2eeab3Smrgfor _am_tool in $_am_tools 972bf2eeab3Smrgdo 973bf2eeab3Smrg case $_am_tool in 974bf2eeab3Smrg gnutar) 975bf2eeab3Smrg for _am_tar in tar gnutar gtar; 976bf2eeab3Smrg do 977bf2eeab3Smrg AM_RUN_LOG([$_am_tar --version]) && break 978bf2eeab3Smrg done 979bf2eeab3Smrg am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' 980bf2eeab3Smrg am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' 981bf2eeab3Smrg am__untar="$_am_tar -xf -" 982bf2eeab3Smrg ;; 983bf2eeab3Smrg plaintar) 984bf2eeab3Smrg # Must skip GNU tar: if it does not support --format= it doesn't create 985bf2eeab3Smrg # ustar tarball either. 986bf2eeab3Smrg (tar --version) >/dev/null 2>&1 && continue 987bf2eeab3Smrg am__tar='tar chf - "$$tardir"' 988bf2eeab3Smrg am__tar_='tar chf - "$tardir"' 989bf2eeab3Smrg am__untar='tar xf -' 990bf2eeab3Smrg ;; 991bf2eeab3Smrg pax) 992bf2eeab3Smrg am__tar='pax -L -x $1 -w "$$tardir"' 993bf2eeab3Smrg am__tar_='pax -L -x $1 -w "$tardir"' 994bf2eeab3Smrg am__untar='pax -r' 995bf2eeab3Smrg ;; 996bf2eeab3Smrg cpio) 997bf2eeab3Smrg am__tar='find "$$tardir" -print | cpio -o -H $1 -L' 998bf2eeab3Smrg am__tar_='find "$tardir" -print | cpio -o -H $1 -L' 999bf2eeab3Smrg am__untar='cpio -i -H $1 -d' 1000bf2eeab3Smrg ;; 1001bf2eeab3Smrg none) 1002bf2eeab3Smrg am__tar=false 1003bf2eeab3Smrg am__tar_=false 1004bf2eeab3Smrg am__untar=false 1005bf2eeab3Smrg ;; 1006bf2eeab3Smrg esac 1007bf2eeab3Smrg 1008bf2eeab3Smrg # If the value was cached, stop now. We just wanted to have am__tar 1009bf2eeab3Smrg # and am__untar set. 1010bf2eeab3Smrg test -n "${am_cv_prog_tar_$1}" && break 101114c0a534Smrg 1012bf2eeab3Smrg # tar/untar a dummy directory, and stop if the command works 1013bf2eeab3Smrg rm -rf conftest.dir 1014bf2eeab3Smrg mkdir conftest.dir 1015bf2eeab3Smrg echo GrepMe > conftest.dir/file 1016bf2eeab3Smrg AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) 1017bf2eeab3Smrg rm -rf conftest.dir 1018bf2eeab3Smrg if test -s conftest.tar; then 1019bf2eeab3Smrg AM_RUN_LOG([$am__untar <conftest.tar]) 1020bf2eeab3Smrg grep GrepMe conftest.dir/file >/dev/null 2>&1 && break 1021bf2eeab3Smrg fi 1022bf2eeab3Smrgdone 1023bf2eeab3Smrgrm -rf conftest.dir 102414c0a534Smrg 1025bf2eeab3SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) 1026bf2eeab3SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])]) 1027bf2eeab3SmrgAC_SUBST([am__tar]) 1028bf2eeab3SmrgAC_SUBST([am__untar]) 1029bf2eeab3Smrg]) # _AM_PROG_TAR 103014c0a534Smrg 1031bf2eeab3Smrgdnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. 1032bf2eeab3Smrgdnl 1033576bae58Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. 1034bf2eeab3Smrgdnl 1035bf2eeab3Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a 1036576bae58Smrgdnl copy of this software and associated documentation files (the "Software"), 1037576bae58Smrgdnl to deal in the Software without restriction, including without limitation 1038576bae58Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense, 1039576bae58Smrgdnl and/or sell copies of the Software, and to permit persons to whom the 1040576bae58Smrgdnl Software is furnished to do so, subject to the following conditions: 1041bf2eeab3Smrgdnl 1042576bae58Smrgdnl The above copyright notice and this permission notice (including the next 1043576bae58Smrgdnl paragraph) shall be included in all copies or substantial portions of the 1044576bae58Smrgdnl Software. 1045bf2eeab3Smrgdnl 1046576bae58Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1047576bae58Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1048576bae58Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 1049576bae58Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 1050576bae58Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 1051576bae58Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 1052576bae58Smrgdnl DEALINGS IN THE SOFTWARE. 105314c0a534Smrg 1054bf2eeab3Smrg# XORG_MACROS_VERSION(required-version) 1055bf2eeab3Smrg# ------------------------------------- 1056bf2eeab3Smrg# Minimum version: 1.1.0 105714c0a534Smrg# 1058bf2eeab3Smrg# If you're using a macro added in Version 1.1 or newer, include this in 1059bf2eeab3Smrg# your configure.ac with the minimum required version, such as: 1060bf2eeab3Smrg# XORG_MACROS_VERSION(1.1) 106114c0a534Smrg# 1062bf2eeab3Smrg# To ensure that this macro is defined, also add: 1063bf2eeab3Smrg# m4_ifndef([XORG_MACROS_VERSION], 1064bf2eeab3Smrg# [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])]) 106514c0a534Smrg# 106614c0a534Smrg# 1067bf2eeab3Smrg# See the "minimum version" comment for each macro you use to see what 1068bf2eeab3Smrg# version you require. 1069bf2eeab3Smrgm4_defun([XORG_MACROS_VERSION],[ 1070576bae58Smrgm4_define([vers_have], [1.10.1]) 1071bf2eeab3Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) 1072bf2eeab3Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) 1073bf2eeab3Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,, 1074bf2eeab3Smrg [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])]) 1075bf2eeab3Smrgm4_if(m4_version_compare(vers_have, [$1]), -1, 1076bf2eeab3Smrg [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])]) 1077bf2eeab3Smrgm4_undefine([vers_have]) 1078bf2eeab3Smrgm4_undefine([maj_have]) 1079bf2eeab3Smrgm4_undefine([maj_needed]) 1080bf2eeab3Smrg]) # XORG_MACROS_VERSION 108114c0a534Smrg 1082bf2eeab3Smrg# XORG_PROG_RAWCPP() 1083bf2eeab3Smrg# ------------------ 1084bf2eeab3Smrg# Minimum version: 1.0.0 108514c0a534Smrg# 1086bf2eeab3Smrg# Find cpp program and necessary flags for use in pre-processing text files 1087bf2eeab3Smrg# such as man pages and config files 1088bf2eeab3SmrgAC_DEFUN([XORG_PROG_RAWCPP],[ 1089bf2eeab3SmrgAC_REQUIRE([AC_PROG_CPP]) 1090bf2eeab3SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 1091bf2eeab3Smrg [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) 109214c0a534Smrg 1093bf2eeab3Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined, 1094bf2eeab3Smrg# which is not the best choice for supporting other OS'es, but covers most 1095bf2eeab3Smrg# of the ones we need for now. 1096bf2eeab3SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef]) 1097bf2eeab3SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?]) 1098bf2eeab3Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 1099bf2eeab3Smrg AC_MSG_RESULT([no]) 110014c0a534Smrgelse 1101bf2eeab3Smrg if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 1102bf2eeab3Smrg RAWCPPFLAGS=-undef 1103bf2eeab3Smrg AC_MSG_RESULT([yes]) 1104bf2eeab3Smrg # under Cygwin unix is still defined even with -undef 1105bf2eeab3Smrg elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 1106bf2eeab3Smrg RAWCPPFLAGS="-undef -ansi" 1107bf2eeab3Smrg AC_MSG_RESULT([yes, with -ansi]) 1108bf2eeab3Smrg else 1109bf2eeab3Smrg AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.]) 1110bf2eeab3Smrg fi 111114c0a534Smrgfi 1112bf2eeab3Smrgrm -f conftest.$ac_ext 111314c0a534Smrg 1114bf2eeab3SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional]) 1115bf2eeab3SmrgAC_LANG_CONFTEST([Does cpp preserve "whitespace"?]) 1116bf2eeab3Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 1117bf2eeab3Smrg AC_MSG_RESULT([no]) 1118bf2eeab3Smrgelse 1119bf2eeab3Smrg if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 1120bf2eeab3Smrg RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" 1121bf2eeab3Smrg AC_MSG_RESULT([yes]) 1122bf2eeab3Smrg else 1123bf2eeab3Smrg AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) 1124bf2eeab3Smrg fi 1125bf2eeab3Smrgfi 1126bf2eeab3Smrgrm -f conftest.$ac_ext 1127bf2eeab3SmrgAC_SUBST(RAWCPPFLAGS) 1128bf2eeab3Smrg]) # XORG_PROG_RAWCPP 112914c0a534Smrg 1130bf2eeab3Smrg# XORG_MANPAGE_SECTIONS() 1131bf2eeab3Smrg# ----------------------- 1132bf2eeab3Smrg# Minimum version: 1.0.0 113314c0a534Smrg# 1134bf2eeab3Smrg# Determine which sections man pages go in for the different man page types 1135bf2eeab3Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. 1136bf2eeab3Smrg# Not sure if there's any better way than just hardcoding by OS name. 1137bf2eeab3Smrg# Override default settings by setting environment variables 1138576bae58Smrg# Added MAN_SUBSTS in version 1.8 1139576bae58Smrg# Added AC_PROG_SED in version 1.8 114014c0a534Smrg 1141bf2eeab3SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[ 1142bf2eeab3SmrgAC_REQUIRE([AC_CANONICAL_HOST]) 1143576bae58SmrgAC_REQUIRE([AC_PROG_SED]) 114414c0a534Smrg 1145bf2eeab3Smrgif test x$APP_MAN_SUFFIX = x ; then 1146bf2eeab3Smrg APP_MAN_SUFFIX=1 1147bf2eeab3Smrgfi 1148bf2eeab3Smrgif test x$APP_MAN_DIR = x ; then 1149bf2eeab3Smrg APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' 1150bf2eeab3Smrgfi 115114c0a534Smrg 1152bf2eeab3Smrgif test x$LIB_MAN_SUFFIX = x ; then 1153bf2eeab3Smrg LIB_MAN_SUFFIX=3 1154bf2eeab3Smrgfi 1155bf2eeab3Smrgif test x$LIB_MAN_DIR = x ; then 1156bf2eeab3Smrg LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' 115714c0a534Smrgfi 115814c0a534Smrg 1159bf2eeab3Smrgif test x$FILE_MAN_SUFFIX = x ; then 1160bf2eeab3Smrg case $host_os in 1161bf2eeab3Smrg solaris*) FILE_MAN_SUFFIX=4 ;; 1162bf2eeab3Smrg *) FILE_MAN_SUFFIX=5 ;; 1163bf2eeab3Smrg esac 1164bf2eeab3Smrgfi 1165bf2eeab3Smrgif test x$FILE_MAN_DIR = x ; then 1166bf2eeab3Smrg FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' 1167bf2eeab3Smrgfi 116814c0a534Smrg 1169bf2eeab3Smrgif test x$MISC_MAN_SUFFIX = x ; then 1170bf2eeab3Smrg case $host_os in 1171bf2eeab3Smrg solaris*) MISC_MAN_SUFFIX=5 ;; 1172bf2eeab3Smrg *) MISC_MAN_SUFFIX=7 ;; 1173bf2eeab3Smrg esac 1174bf2eeab3Smrgfi 1175bf2eeab3Smrgif test x$MISC_MAN_DIR = x ; then 1176bf2eeab3Smrg MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' 1177bf2eeab3Smrgfi 117814c0a534Smrg 1179bf2eeab3Smrgif test x$DRIVER_MAN_SUFFIX = x ; then 1180bf2eeab3Smrg case $host_os in 1181bf2eeab3Smrg solaris*) DRIVER_MAN_SUFFIX=7 ;; 1182bf2eeab3Smrg *) DRIVER_MAN_SUFFIX=4 ;; 1183bf2eeab3Smrg esac 1184bf2eeab3Smrgfi 1185bf2eeab3Smrgif test x$DRIVER_MAN_DIR = x ; then 1186bf2eeab3Smrg DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' 1187bf2eeab3Smrgfi 118814c0a534Smrg 1189bf2eeab3Smrgif test x$ADMIN_MAN_SUFFIX = x ; then 1190bf2eeab3Smrg case $host_os in 1191bf2eeab3Smrg solaris*) ADMIN_MAN_SUFFIX=1m ;; 1192bf2eeab3Smrg *) ADMIN_MAN_SUFFIX=8 ;; 1193bf2eeab3Smrg esac 1194bf2eeab3Smrgfi 1195bf2eeab3Smrgif test x$ADMIN_MAN_DIR = x ; then 1196bf2eeab3Smrg ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' 119714c0a534Smrgfi 119814c0a534Smrg 119914c0a534Smrg 1200bf2eeab3SmrgAC_SUBST([APP_MAN_SUFFIX]) 1201bf2eeab3SmrgAC_SUBST([LIB_MAN_SUFFIX]) 1202bf2eeab3SmrgAC_SUBST([FILE_MAN_SUFFIX]) 1203bf2eeab3SmrgAC_SUBST([MISC_MAN_SUFFIX]) 1204bf2eeab3SmrgAC_SUBST([DRIVER_MAN_SUFFIX]) 1205bf2eeab3SmrgAC_SUBST([ADMIN_MAN_SUFFIX]) 1206bf2eeab3SmrgAC_SUBST([APP_MAN_DIR]) 1207bf2eeab3SmrgAC_SUBST([LIB_MAN_DIR]) 1208bf2eeab3SmrgAC_SUBST([FILE_MAN_DIR]) 1209bf2eeab3SmrgAC_SUBST([MISC_MAN_DIR]) 1210bf2eeab3SmrgAC_SUBST([DRIVER_MAN_DIR]) 1211bf2eeab3SmrgAC_SUBST([ADMIN_MAN_DIR]) 1212576bae58Smrg 1213576bae58SmrgXORG_MAN_PAGE="X Version 11" 1214576bae58SmrgAC_SUBST([XORG_MAN_PAGE]) 1215576bae58SmrgMAN_SUBSTS="\ 1216576bae58Smrg -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ 1217576bae58Smrg -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ 1218576bae58Smrg -e 's|__xservername__|Xorg|g' \ 1219576bae58Smrg -e 's|__xconfigfile__|xorg.conf|g' \ 1220576bae58Smrg -e 's|__projectroot__|\$(prefix)|g' \ 1221576bae58Smrg -e 's|__apploaddir__|\$(appdefaultdir)|g' \ 1222576bae58Smrg -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \ 1223576bae58Smrg -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \ 1224576bae58Smrg -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \ 1225576bae58Smrg -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \ 1226576bae58Smrg -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \ 1227576bae58Smrg -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'" 1228576bae58SmrgAC_SUBST([MAN_SUBSTS]) 1229576bae58Smrg 1230bf2eeab3Smrg]) # XORG_MANPAGE_SECTIONS 1231bf2eeab3Smrg 1232576bae58Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION]) 1233576bae58Smrg# ------------------------ 1234576bae58Smrg# Minimum version: 1.7.0 1235576bae58Smrg# 1236576bae58Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent 1237576bae58Smrg# provided by xorg-sgml-doctools, if installed. 1238576bae58SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[ 1239576bae58SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])]) 1240576bae58SmrgXORG_SGML_PATH= 1241576bae58SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])], 1242576bae58Smrg [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`], 1243576bae58Smrg [m4_ifval([$1],[:], 1244576bae58Smrg [if test x"$cross_compiling" != x"yes" ; then 1245576bae58Smrg AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent], 1246576bae58Smrg [XORG_SGML_PATH=$prefix/share/sgml]) 1247576bae58Smrg fi]) 1248576bae58Smrg ]) 1249576bae58Smrg 1250576bae58Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing 1251576bae58Smrg# the path and the name of the doc stylesheet 1252576bae58Smrgif test "x$XORG_SGML_PATH" != "x" ; then 1253576bae58Smrg AC_MSG_RESULT([$XORG_SGML_PATH]) 1254576bae58Smrg STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11 1255576bae58Smrg XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl 1256576bae58Smrgelse 1257576bae58Smrg AC_MSG_RESULT([no]) 1258576bae58Smrgfi 1259576bae58Smrg 1260576bae58SmrgAC_SUBST(XORG_SGML_PATH) 1261576bae58SmrgAC_SUBST(STYLESHEET_SRCDIR) 1262576bae58SmrgAC_SUBST(XSL_STYLESHEET) 1263576bae58SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"]) 1264576bae58Smrg]) # XORG_CHECK_SGML_DOCTOOLS 1265576bae58Smrg 1266bf2eeab3Smrg# XORG_CHECK_LINUXDOC 1267bf2eeab3Smrg# ------------------- 1268bf2eeab3Smrg# Minimum version: 1.0.0 126914c0a534Smrg# 1270bf2eeab3Smrg# Defines the variable MAKE_TEXT if the necessary tools and 1271bf2eeab3Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. 1272bf2eeab3Smrg# Whether or not the necessary tools and files are found can be checked 1273bf2eeab3Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC" 1274bf2eeab3SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[ 1275576bae58SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) 1276576bae58SmrgAC_REQUIRE([XORG_WITH_PS2PDF]) 127714c0a534Smrg 1278bf2eeab3SmrgAC_PATH_PROG(LINUXDOC, linuxdoc) 127914c0a534Smrg 1280576bae58SmrgAC_MSG_CHECKING([whether to build documentation]) 128114c0a534Smrg 1282576bae58Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then 1283bf2eeab3Smrg BUILDDOC=yes 1284bf2eeab3Smrgelse 1285bf2eeab3Smrg BUILDDOC=no 1286bf2eeab3Smrgfi 128714c0a534Smrg 1288bf2eeab3SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) 128914c0a534Smrg 1290bf2eeab3SmrgAC_MSG_RESULT([$BUILDDOC]) 129114c0a534Smrg 1292576bae58SmrgAC_MSG_CHECKING([whether to build pdf documentation]) 129314c0a534Smrg 1294576bae58Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then 1295bf2eeab3Smrg BUILDPDFDOC=yes 1296bf2eeab3Smrgelse 1297bf2eeab3Smrg BUILDPDFDOC=no 1298bf2eeab3Smrgfi 129914c0a534Smrg 1300bf2eeab3SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 130114c0a534Smrg 1302bf2eeab3SmrgAC_MSG_RESULT([$BUILDPDFDOC]) 130314c0a534Smrg 1304576bae58SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f" 1305bf2eeab3SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps" 1306bf2eeab3SmrgMAKE_PDF="$PS2PDF" 1307bf2eeab3SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0" 130814c0a534Smrg 1309bf2eeab3SmrgAC_SUBST(MAKE_TEXT) 1310bf2eeab3SmrgAC_SUBST(MAKE_PS) 1311bf2eeab3SmrgAC_SUBST(MAKE_PDF) 1312bf2eeab3SmrgAC_SUBST(MAKE_HTML) 1313bf2eeab3Smrg]) # XORG_CHECK_LINUXDOC 1314bf2eeab3Smrg 1315bf2eeab3Smrg# XORG_CHECK_DOCBOOK 1316bf2eeab3Smrg# ------------------- 1317bf2eeab3Smrg# Minimum version: 1.0.0 1318bf2eeab3Smrg# 1319bf2eeab3Smrg# Checks for the ability to build output formats from SGML DocBook source. 1320bf2eeab3Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC" 1321bf2eeab3Smrg# indicates whether the necessary tools and files are found and, if set, 1322bf2eeab3Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx. 1323bf2eeab3SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[ 1324576bae58SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) 1325576bae58Smrg 1326bf2eeab3SmrgBUILDTXTDOC=no 1327bf2eeab3SmrgBUILDPDFDOC=no 1328bf2eeab3SmrgBUILDPSDOC=no 1329bf2eeab3SmrgBUILDHTMLDOC=no 1330bf2eeab3Smrg 1331bf2eeab3SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps) 1332bf2eeab3SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf) 1333bf2eeab3SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html) 1334bf2eeab3SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt) 1335bf2eeab3Smrg 1336576bae58SmrgAC_MSG_CHECKING([whether to build text documentation]) 1337576bae58Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x && 1338bf2eeab3Smrg test x$BUILD_TXTDOC != xno; then 1339bf2eeab3Smrg BUILDTXTDOC=yes 1340bf2eeab3Smrgfi 1341bf2eeab3SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes]) 1342bf2eeab3SmrgAC_MSG_RESULT([$BUILDTXTDOC]) 134314c0a534Smrg 1344576bae58SmrgAC_MSG_CHECKING([whether to build PDF documentation]) 1345576bae58Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x && 1346bf2eeab3Smrg test x$BUILD_PDFDOC != xno; then 1347bf2eeab3Smrg BUILDPDFDOC=yes 134814c0a534Smrgfi 1349bf2eeab3SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 1350bf2eeab3SmrgAC_MSG_RESULT([$BUILDPDFDOC]) 135114c0a534Smrg 1352576bae58SmrgAC_MSG_CHECKING([whether to build PostScript documentation]) 1353576bae58Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x && 1354bf2eeab3Smrg test x$BUILD_PSDOC != xno; then 1355bf2eeab3Smrg BUILDPSDOC=yes 1356bf2eeab3Smrgfi 1357bf2eeab3SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes]) 1358bf2eeab3SmrgAC_MSG_RESULT([$BUILDPSDOC]) 135914c0a534Smrg 1360576bae58SmrgAC_MSG_CHECKING([whether to build HTML documentation]) 1361576bae58Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x && 1362bf2eeab3Smrg test x$BUILD_HTMLDOC != xno; then 1363bf2eeab3Smrg BUILDHTMLDOC=yes 1364bf2eeab3Smrgfi 1365bf2eeab3SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes]) 1366bf2eeab3SmrgAC_MSG_RESULT([$BUILDHTMLDOC]) 136714c0a534Smrg 1368bf2eeab3SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT" 1369bf2eeab3SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS" 1370bf2eeab3SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF" 1371bf2eeab3SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML" 137214c0a534Smrg 1373bf2eeab3SmrgAC_SUBST(MAKE_TEXT) 1374bf2eeab3SmrgAC_SUBST(MAKE_PS) 1375bf2eeab3SmrgAC_SUBST(MAKE_PDF) 1376bf2eeab3SmrgAC_SUBST(MAKE_HTML) 1377bf2eeab3Smrg]) # XORG_CHECK_DOCBOOK 137814c0a534Smrg 1379576bae58Smrg# XORG_WITH_XMLTO([MIN-VERSION]) 1380576bae58Smrg# ---------------- 1381576bae58Smrg# Minimum version: 1.5.0 1382576bae58Smrg# 1383576bae58Smrg# Documentation tools are not always available on all platforms and sometimes 1384576bae58Smrg# not at the appropriate level. This macro enables a module to test for the 1385576bae58Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 1386576bae58Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions 1387576bae58Smrg# as whether or not to use the xmlto package. 1388576bae58Smrg# 1389576bae58Smrg# Interface to module: 1390576bae58Smrg# HAVE_XMLTO: used in makefiles to conditionally generate documentation 1391576bae58Smrg# XMLTO: returns the path of the xmlto program found 1392576bae58Smrg# returns the path set by the user in the environment 1393576bae58Smrg# --with-xmlto: 'yes' user instructs the module to use xmlto 1394576bae58Smrg# 'no' user instructs the module not to use xmlto 1395576bae58Smrg# 1396576bae58Smrg# Added in version 1.10.0 1397576bae58Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation 1398576bae58Smrg# xmlto for text output requires either lynx, links, or w3m browsers 1399576bae58Smrg# 1400576bae58Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path. 1401576bae58Smrg# 1402576bae58SmrgAC_DEFUN([XORG_WITH_XMLTO],[ 1403576bae58SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command]) 1404576bae58SmrgAC_ARG_WITH(xmlto, 1405576bae58Smrg AS_HELP_STRING([--with-xmlto], 1406576bae58Smrg [Use xmlto to regenerate documentation (default: yes, if installed)]), 1407576bae58Smrg [use_xmlto=$withval], [use_xmlto=auto]) 1408576bae58Smrg 1409576bae58Smrgif test "x$use_xmlto" = x"auto"; then 1410576bae58Smrg AC_PATH_PROG([XMLTO], [xmlto]) 1411576bae58Smrg if test "x$XMLTO" = "x"; then 1412576bae58Smrg AC_MSG_WARN([xmlto not found - documentation targets will be skipped]) 1413576bae58Smrg have_xmlto=no 1414576bae58Smrg else 1415576bae58Smrg have_xmlto=yes 1416576bae58Smrg fi 1417576bae58Smrgelif test "x$use_xmlto" = x"yes" ; then 1418576bae58Smrg AC_PATH_PROG([XMLTO], [xmlto]) 1419576bae58Smrg if test "x$XMLTO" = "x"; then 1420576bae58Smrg AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH]) 1421576bae58Smrg fi 1422576bae58Smrg have_xmlto=yes 1423576bae58Smrgelif test "x$use_xmlto" = x"no" ; then 1424576bae58Smrg if test "x$XMLTO" != "x"; then 1425576bae58Smrg AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified]) 1426576bae58Smrg fi 1427576bae58Smrg have_xmlto=no 1428576bae58Smrgelse 1429576bae58Smrg AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no']) 1430576bae58Smrgfi 1431576bae58Smrg 1432576bae58Smrg# Test for a minimum version of xmlto, if provided. 1433576bae58Smrgm4_ifval([$1], 1434576bae58Smrg[if test "$have_xmlto" = yes; then 1435576bae58Smrg # scrape the xmlto version 1436576bae58Smrg AC_MSG_CHECKING([the xmlto version]) 1437576bae58Smrg xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3` 1438576bae58Smrg AC_MSG_RESULT([$xmlto_version]) 1439576bae58Smrg AS_VERSION_COMPARE([$xmlto_version], [$1], 1440576bae58Smrg [if test "x$use_xmlto" = xauto; then 1441576bae58Smrg AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed]) 1442576bae58Smrg have_xmlto=no 1443576bae58Smrg else 1444576bae58Smrg AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed]) 1445576bae58Smrg fi]) 1446576bae58Smrgfi]) 1447576bae58Smrg 1448576bae58Smrg# Test for the ability of xmlto to generate a text target 1449576bae58Smrghave_xmlto_text=no 1450576bae58Smrgcat > conftest.xml << "EOF" 1451576bae58SmrgEOF 1452576bae58SmrgAS_IF([test "$have_xmlto" = yes], 1453576bae58Smrg [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1], 1454576bae58Smrg [have_xmlto_text=yes], 1455576bae58Smrg [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])]) 1456576bae58Smrgrm -f conftest.xml 1457576bae58SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes]) 1458576bae58SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes]) 1459576bae58Smrg]) # XORG_WITH_XMLTO 1460576bae58Smrg 1461576bae58Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION]) 1462576bae58Smrg# ---------------- 1463576bae58Smrg# Minimum version: 1.5.0 1464576bae58Smrg# 1465576bae58Smrg# Documentation tools are not always available on all platforms and sometimes 1466576bae58Smrg# not at the appropriate level. This macro enables a module to test for the 1467576bae58Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 1468576bae58Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions 1469576bae58Smrg# as whether or not to use the asciidoc package. 1470576bae58Smrg# 1471576bae58Smrg# Interface to module: 1472576bae58Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation 1473576bae58Smrg# ASCIIDOC: returns the path of the asciidoc program found 1474576bae58Smrg# returns the path set by the user in the environment 1475576bae58Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc 1476576bae58Smrg# 'no' user instructs the module not to use asciidoc 1477576bae58Smrg# 1478576bae58Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path. 1479576bae58Smrg# 1480576bae58SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[ 1481576bae58SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command]) 1482576bae58SmrgAC_ARG_WITH(asciidoc, 1483576bae58Smrg AS_HELP_STRING([--with-asciidoc], 1484576bae58Smrg [Use asciidoc to regenerate documentation (default: yes, if installed)]), 1485576bae58Smrg [use_asciidoc=$withval], [use_asciidoc=auto]) 1486576bae58Smrg 1487576bae58Smrgif test "x$use_asciidoc" = x"auto"; then 1488576bae58Smrg AC_PATH_PROG([ASCIIDOC], [asciidoc]) 1489576bae58Smrg if test "x$ASCIIDOC" = "x"; then 1490576bae58Smrg AC_MSG_WARN([asciidoc not found - documentation targets will be skipped]) 1491576bae58Smrg have_asciidoc=no 1492576bae58Smrg else 1493576bae58Smrg have_asciidoc=yes 1494576bae58Smrg fi 1495576bae58Smrgelif test "x$use_asciidoc" = x"yes" ; then 1496576bae58Smrg AC_PATH_PROG([ASCIIDOC], [asciidoc]) 1497576bae58Smrg if test "x$ASCIIDOC" = "x"; then 1498576bae58Smrg AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH]) 1499576bae58Smrg fi 1500576bae58Smrg have_asciidoc=yes 1501576bae58Smrgelif test "x$use_asciidoc" = x"no" ; then 1502576bae58Smrg if test "x$ASCIIDOC" != "x"; then 1503576bae58Smrg AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified]) 1504576bae58Smrg fi 1505576bae58Smrg have_asciidoc=no 1506576bae58Smrgelse 1507576bae58Smrg AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no']) 1508576bae58Smrgfi 1509576bae58Smrgm4_ifval([$1], 1510576bae58Smrg[if test "$have_asciidoc" = yes; then 1511576bae58Smrg # scrape the asciidoc version 1512576bae58Smrg AC_MSG_CHECKING([the asciidoc version]) 1513576bae58Smrg asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2` 1514576bae58Smrg AC_MSG_RESULT([$asciidoc_version]) 1515576bae58Smrg AS_VERSION_COMPARE([$asciidoc_version], [$1], 1516576bae58Smrg [if test "x$use_asciidoc" = xauto; then 1517576bae58Smrg AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed]) 1518576bae58Smrg have_asciidoc=no 1519576bae58Smrg else 1520576bae58Smrg AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed]) 1521576bae58Smrg fi]) 1522576bae58Smrgfi]) 1523576bae58SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes]) 1524576bae58Smrg]) # XORG_WITH_ASCIIDOC 1525576bae58Smrg 1526576bae58Smrg# XORG_WITH_DOXYGEN([MIN-VERSION]) 1527576bae58Smrg# -------------------------------- 1528576bae58Smrg# Minimum version: 1.5.0 1529576bae58Smrg# 1530576bae58Smrg# Documentation tools are not always available on all platforms and sometimes 1531576bae58Smrg# not at the appropriate level. This macro enables a module to test for the 1532576bae58Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 1533576bae58Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions 1534576bae58Smrg# as whether or not to use the doxygen package. 1535576bae58Smrg# 1536576bae58Smrg# Interface to module: 1537576bae58Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation 1538576bae58Smrg# DOXYGEN: returns the path of the doxygen program found 1539576bae58Smrg# returns the path set by the user in the environment 1540576bae58Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen 1541576bae58Smrg# 'no' user instructs the module not to use doxygen 1542576bae58Smrg# 1543576bae58Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path. 1544576bae58Smrg# 1545576bae58SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[ 1546576bae58SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command]) 1547576bae58SmrgAC_ARG_WITH(doxygen, 1548576bae58Smrg AS_HELP_STRING([--with-doxygen], 1549576bae58Smrg [Use doxygen to regenerate documentation (default: yes, if installed)]), 1550576bae58Smrg [use_doxygen=$withval], [use_doxygen=auto]) 1551576bae58Smrg 1552576bae58Smrgif test "x$use_doxygen" = x"auto"; then 1553576bae58Smrg AC_PATH_PROG([DOXYGEN], [doxygen]) 1554576bae58Smrg if test "x$DOXYGEN" = "x"; then 1555576bae58Smrg AC_MSG_WARN([doxygen not found - documentation targets will be skipped]) 1556576bae58Smrg have_doxygen=no 1557576bae58Smrg else 1558576bae58Smrg have_doxygen=yes 1559576bae58Smrg fi 1560576bae58Smrgelif test "x$use_doxygen" = x"yes" ; then 1561576bae58Smrg AC_PATH_PROG([DOXYGEN], [doxygen]) 1562576bae58Smrg if test "x$DOXYGEN" = "x"; then 1563576bae58Smrg AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH]) 1564576bae58Smrg fi 1565576bae58Smrg have_doxygen=yes 1566576bae58Smrgelif test "x$use_doxygen" = x"no" ; then 1567576bae58Smrg if test "x$DOXYGEN" != "x"; then 1568576bae58Smrg AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified]) 1569576bae58Smrg fi 1570576bae58Smrg have_doxygen=no 1571576bae58Smrgelse 1572576bae58Smrg AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no']) 1573576bae58Smrgfi 1574576bae58Smrgm4_ifval([$1], 1575576bae58Smrg[if test "$have_doxygen" = yes; then 1576576bae58Smrg # scrape the doxygen version 1577576bae58Smrg AC_MSG_CHECKING([the doxygen version]) 1578576bae58Smrg doxygen_version=`$DOXYGEN --version 2>/dev/null` 1579576bae58Smrg AC_MSG_RESULT([$doxygen_version]) 1580576bae58Smrg AS_VERSION_COMPARE([$doxygen_version], [$1], 1581576bae58Smrg [if test "x$use_doxygen" = xauto; then 1582576bae58Smrg AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed]) 1583576bae58Smrg have_doxygen=no 1584576bae58Smrg else 1585576bae58Smrg AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed]) 1586576bae58Smrg fi]) 1587576bae58Smrgfi]) 1588576bae58SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes]) 1589576bae58Smrg]) # XORG_WITH_DOXYGEN 1590576bae58Smrg 1591576bae58Smrg# XORG_WITH_GROFF 1592576bae58Smrg# ---------------- 1593576bae58Smrg# Minimum version: 1.6.0 1594576bae58Smrg# 1595576bae58Smrg# Documentation tools are not always available on all platforms and sometimes 1596576bae58Smrg# not at the appropriate level. This macro enables a module to test for the 1597576bae58Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 1598576bae58Smrg# the --with-groff option, it allows maximum flexibilty in making decisions 1599576bae58Smrg# as whether or not to use the groff package. 1600576bae58Smrg# 1601576bae58Smrg# Interface to module: 1602576bae58Smrg# HAVE_GROFF: used in makefiles to conditionally generate documentation 1603576bae58Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package 1604576bae58Smrg# HAVE_GROFF_MS: the -ms macros package 1605576bae58Smrg# GROFF: returns the path of the groff program found 1606576bae58Smrg# returns the path set by the user in the environment 1607576bae58Smrg# --with-groff: 'yes' user instructs the module to use groff 1608576bae58Smrg# 'no' user instructs the module not to use groff 1609576bae58Smrg# 1610576bae58Smrg# Added in version 1.9.0: 1611576bae58Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format: 1612576bae58Smrg# pnmcut pnmcrop pnmtopng pnmtops from the netpbm package. 1613576bae58Smrg# psselect from the psutils package. 1614576bae58Smrg# the ghostcript package. Refer to the grohtml man pages 1615576bae58Smrg# 1616576bae58Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path. 1617576bae58Smrg# 1618576bae58Smrg# OS and distros often splits groff in a basic and full package, the former 1619576bae58Smrg# having the groff program and the later having devices, fonts and macros 1620576bae58Smrg# Checking for the groff executable is not enough. 1621576bae58Smrg# 1622576bae58Smrg# If macros are missing, we cannot assume that groff is useless, so we don't 1623576bae58Smrg# unset HAVE_GROFF or GROFF env variables. 1624576bae58Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false. 1625576bae58Smrg# 1626576bae58SmrgAC_DEFUN([XORG_WITH_GROFF],[ 1627576bae58SmrgAC_ARG_VAR([GROFF], [Path to groff command]) 1628576bae58SmrgAC_ARG_WITH(groff, 1629576bae58Smrg AS_HELP_STRING([--with-groff], 1630576bae58Smrg [Use groff to regenerate documentation (default: yes, if installed)]), 1631576bae58Smrg [use_groff=$withval], [use_groff=auto]) 1632576bae58Smrg 1633576bae58Smrgif test "x$use_groff" = x"auto"; then 1634576bae58Smrg AC_PATH_PROG([GROFF], [groff]) 1635576bae58Smrg if test "x$GROFF" = "x"; then 1636576bae58Smrg AC_MSG_WARN([groff not found - documentation targets will be skipped]) 1637576bae58Smrg have_groff=no 1638576bae58Smrg else 1639576bae58Smrg have_groff=yes 1640576bae58Smrg fi 1641576bae58Smrgelif test "x$use_groff" = x"yes" ; then 1642576bae58Smrg AC_PATH_PROG([GROFF], [groff]) 1643576bae58Smrg if test "x$GROFF" = "x"; then 1644576bae58Smrg AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH]) 1645576bae58Smrg fi 1646576bae58Smrg have_groff=yes 1647576bae58Smrgelif test "x$use_groff" = x"no" ; then 1648576bae58Smrg if test "x$GROFF" != "x"; then 1649576bae58Smrg AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified]) 1650576bae58Smrg fi 1651576bae58Smrg have_groff=no 1652576bae58Smrgelse 1653576bae58Smrg AC_MSG_ERROR([--with-groff expects 'yes' or 'no']) 1654576bae58Smrgfi 1655576bae58Smrg 1656576bae58Smrg# We have groff, test for the presence of the macro packages 1657576bae58Smrgif test "x$have_groff" = x"yes"; then 1658576bae58Smrg AC_MSG_CHECKING([for ${GROFF} -ms macros]) 1659576bae58Smrg if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then 1660576bae58Smrg groff_ms_works=yes 1661576bae58Smrg else 1662576bae58Smrg groff_ms_works=no 1663576bae58Smrg fi 1664576bae58Smrg AC_MSG_RESULT([$groff_ms_works]) 1665576bae58Smrg AC_MSG_CHECKING([for ${GROFF} -mm macros]) 1666576bae58Smrg if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then 1667576bae58Smrg groff_mm_works=yes 1668576bae58Smrg else 1669576bae58Smrg groff_mm_works=no 1670576bae58Smrg fi 1671576bae58Smrg AC_MSG_RESULT([$groff_mm_works]) 1672576bae58Smrgfi 1673576bae58Smrg 1674576bae58Smrg# We have groff, test for HTML dependencies, one command per package 1675576bae58Smrgif test "x$have_groff" = x"yes"; then 1676576bae58Smrg AC_PATH_PROGS(GS_PATH, [gs gswin32c]) 1677576bae58Smrg AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng]) 1678576bae58Smrg AC_PATH_PROG(PSSELECT_PATH, [psselect]) 1679576bae58Smrg if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then 1680576bae58Smrg have_groff_html=yes 1681576bae58Smrg else 1682576bae58Smrg have_groff_html=no 1683576bae58Smrg AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages]) 1684576bae58Smrg fi 1685576bae58Smrgfi 1686576bae58Smrg 1687576bae58Smrg# Set Automake conditionals for Makefiles 1688576bae58SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes]) 1689576bae58SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes]) 1690576bae58SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes]) 1691576bae58SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes]) 1692576bae58Smrg]) # XORG_WITH_GROFF 1693576bae58Smrg 1694576bae58Smrg# XORG_WITH_FOP 1695576bae58Smrg# ---------------- 1696576bae58Smrg# Minimum version: 1.6.0 1697576bae58Smrg# 1698576bae58Smrg# Documentation tools are not always available on all platforms and sometimes 1699576bae58Smrg# not at the appropriate level. This macro enables a module to test for the 1700576bae58Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 1701576bae58Smrg# the --with-fop option, it allows maximum flexibilty in making decisions 1702576bae58Smrg# as whether or not to use the fop package. 1703576bae58Smrg# 1704576bae58Smrg# Interface to module: 1705576bae58Smrg# HAVE_FOP: used in makefiles to conditionally generate documentation 1706576bae58Smrg# FOP: returns the path of the fop program found 1707576bae58Smrg# returns the path set by the user in the environment 1708576bae58Smrg# --with-fop: 'yes' user instructs the module to use fop 1709576bae58Smrg# 'no' user instructs the module not to use fop 1710576bae58Smrg# 1711576bae58Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path. 1712576bae58Smrg# 1713576bae58SmrgAC_DEFUN([XORG_WITH_FOP],[ 1714576bae58SmrgAC_ARG_VAR([FOP], [Path to fop command]) 1715576bae58SmrgAC_ARG_WITH(fop, 1716576bae58Smrg AS_HELP_STRING([--with-fop], 1717576bae58Smrg [Use fop to regenerate documentation (default: yes, if installed)]), 1718576bae58Smrg [use_fop=$withval], [use_fop=auto]) 1719576bae58Smrg 1720576bae58Smrgif test "x$use_fop" = x"auto"; then 1721576bae58Smrg AC_PATH_PROG([FOP], [fop]) 1722576bae58Smrg if test "x$FOP" = "x"; then 1723576bae58Smrg AC_MSG_WARN([fop not found - documentation targets will be skipped]) 1724576bae58Smrg have_fop=no 1725576bae58Smrg else 1726576bae58Smrg have_fop=yes 1727576bae58Smrg fi 1728576bae58Smrgelif test "x$use_fop" = x"yes" ; then 1729576bae58Smrg AC_PATH_PROG([FOP], [fop]) 1730576bae58Smrg if test "x$FOP" = "x"; then 1731576bae58Smrg AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH]) 1732576bae58Smrg fi 1733576bae58Smrg have_fop=yes 1734576bae58Smrgelif test "x$use_fop" = x"no" ; then 1735576bae58Smrg if test "x$FOP" != "x"; then 1736576bae58Smrg AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified]) 1737576bae58Smrg fi 1738576bae58Smrg have_fop=no 1739576bae58Smrgelse 1740576bae58Smrg AC_MSG_ERROR([--with-fop expects 'yes' or 'no']) 1741576bae58Smrgfi 1742576bae58SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes]) 1743576bae58Smrg]) # XORG_WITH_FOP 1744576bae58Smrg 1745576bae58Smrg# XORG_WITH_PS2PDF 1746576bae58Smrg# ---------------- 1747576bae58Smrg# Minimum version: 1.6.0 1748576bae58Smrg# 1749576bae58Smrg# Documentation tools are not always available on all platforms and sometimes 1750576bae58Smrg# not at the appropriate level. This macro enables a module to test for the 1751576bae58Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 1752576bae58Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions 1753576bae58Smrg# as whether or not to use the ps2pdf package. 1754576bae58Smrg# 1755576bae58Smrg# Interface to module: 1756576bae58Smrg# HAVE_PS2PDF: used in makefiles to conditionally generate documentation 1757576bae58Smrg# PS2PDF: returns the path of the ps2pdf program found 1758576bae58Smrg# returns the path set by the user in the environment 1759576bae58Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf 1760576bae58Smrg# 'no' user instructs the module not to use ps2pdf 1761576bae58Smrg# 1762576bae58Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path. 1763576bae58Smrg# 1764576bae58SmrgAC_DEFUN([XORG_WITH_PS2PDF],[ 1765576bae58SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command]) 1766576bae58SmrgAC_ARG_WITH(ps2pdf, 1767576bae58Smrg AS_HELP_STRING([--with-ps2pdf], 1768576bae58Smrg [Use ps2pdf to regenerate documentation (default: yes, if installed)]), 1769576bae58Smrg [use_ps2pdf=$withval], [use_ps2pdf=auto]) 1770576bae58Smrg 1771576bae58Smrgif test "x$use_ps2pdf" = x"auto"; then 1772576bae58Smrg AC_PATH_PROG([PS2PDF], [ps2pdf]) 1773576bae58Smrg if test "x$PS2PDF" = "x"; then 1774576bae58Smrg AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped]) 1775576bae58Smrg have_ps2pdf=no 1776576bae58Smrg else 1777576bae58Smrg have_ps2pdf=yes 1778576bae58Smrg fi 1779576bae58Smrgelif test "x$use_ps2pdf" = x"yes" ; then 1780576bae58Smrg AC_PATH_PROG([PS2PDF], [ps2pdf]) 1781576bae58Smrg if test "x$PS2PDF" = "x"; then 1782576bae58Smrg AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH]) 1783576bae58Smrg fi 1784576bae58Smrg have_ps2pdf=yes 1785576bae58Smrgelif test "x$use_ps2pdf" = x"no" ; then 1786576bae58Smrg if test "x$PS2PDF" != "x"; then 1787576bae58Smrg AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified]) 1788576bae58Smrg fi 1789576bae58Smrg have_ps2pdf=no 1790576bae58Smrgelse 1791576bae58Smrg AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no']) 1792576bae58Smrgfi 1793576bae58SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes]) 1794576bae58Smrg]) # XORG_WITH_PS2PDF 1795576bae58Smrg 1796576bae58Smrg# XORG_ENABLE_DOCS (enable_docs=yes) 1797576bae58Smrg# ---------------- 1798576bae58Smrg# Minimum version: 1.6.0 1799576bae58Smrg# 1800576bae58Smrg# Documentation tools are not always available on all platforms and sometimes 1801576bae58Smrg# not at the appropriate level. This macro enables a builder to skip all 1802576bae58Smrg# documentation targets except traditional man pages. 1803576bae58Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 1804576bae58Smrg# maximum flexibilty in controlling documentation building. 1805576bae58Smrg# Refer to: 1806576bae58Smrg# XORG_WITH_XMLTO --with-xmlto 1807576bae58Smrg# XORG_WITH_ASCIIDOC --with-asciidoc 1808576bae58Smrg# XORG_WITH_DOXYGEN --with-doxygen 1809576bae58Smrg# XORG_WITH_FOP --with-fop 1810576bae58Smrg# XORG_WITH_GROFF --with-groff 1811576bae58Smrg# XORG_WITH_PS2PDF --with-ps2pdf 1812576bae58Smrg# 1813576bae58Smrg# Interface to module: 1814576bae58Smrg# ENABLE_DOCS: used in makefiles to conditionally generate documentation 1815576bae58Smrg# --enable-docs: 'yes' user instructs the module to generate docs 1816576bae58Smrg# 'no' user instructs the module not to generate docs 1817576bae58Smrg# parm1: specify the default value, yes or no. 1818576bae58Smrg# 1819576bae58SmrgAC_DEFUN([XORG_ENABLE_DOCS],[ 1820576bae58Smrgdefault=$1 1821576bae58Smrgif test "x$default" = x ; then 1822576bae58Smrg default="yes" 1823576bae58Smrgfi 1824576bae58SmrgAC_ARG_ENABLE(docs, 1825576bae58Smrg AS_HELP_STRING([--enable-docs], 1826576bae58Smrg [Enable building the documentation (default: yes)]), 1827576bae58Smrg [build_docs=$enableval], [build_docs=$default]) 1828576bae58SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes]) 1829576bae58SmrgAC_MSG_CHECKING([whether to build documentation]) 1830576bae58SmrgAC_MSG_RESULT([$build_docs]) 1831576bae58Smrg]) # XORG_ENABLE_DOCS 1832576bae58Smrg 1833576bae58Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes) 1834576bae58Smrg# ---------------- 1835576bae58Smrg# Minimum version: 1.6.0 1836576bae58Smrg# 1837576bae58Smrg# This macro enables a builder to skip all developer documentation. 1838576bae58Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 1839576bae58Smrg# maximum flexibilty in controlling documentation building. 1840576bae58Smrg# Refer to: 1841576bae58Smrg# XORG_WITH_XMLTO --with-xmlto 1842576bae58Smrg# XORG_WITH_ASCIIDOC --with-asciidoc 1843576bae58Smrg# XORG_WITH_DOXYGEN --with-doxygen 1844576bae58Smrg# XORG_WITH_FOP --with-fop 1845576bae58Smrg# XORG_WITH_GROFF --with-groff 1846576bae58Smrg# XORG_WITH_PS2PDF --with-ps2pdf 1847576bae58Smrg# 1848576bae58Smrg# Interface to module: 1849576bae58Smrg# ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs 1850576bae58Smrg# --enable-devel-docs: 'yes' user instructs the module to generate developer docs 1851576bae58Smrg# 'no' user instructs the module not to generate developer docs 1852576bae58Smrg# parm1: specify the default value, yes or no. 1853576bae58Smrg# 1854576bae58SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[ 1855576bae58Smrgdevel_default=$1 1856576bae58Smrgif test "x$devel_default" = x ; then 1857576bae58Smrg devel_default="yes" 1858576bae58Smrgfi 1859576bae58SmrgAC_ARG_ENABLE(devel-docs, 1860576bae58Smrg AS_HELP_STRING([--enable-devel-docs], 1861576bae58Smrg [Enable building the developer documentation (default: yes)]), 1862576bae58Smrg [build_devel_docs=$enableval], [build_devel_docs=$devel_default]) 1863576bae58SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes]) 1864576bae58SmrgAC_MSG_CHECKING([whether to build developer documentation]) 1865576bae58SmrgAC_MSG_RESULT([$build_devel_docs]) 1866576bae58Smrg]) # XORG_ENABLE_DEVEL_DOCS 1867576bae58Smrg 1868576bae58Smrg# XORG_ENABLE_SPECS (enable_specs=yes) 1869576bae58Smrg# ---------------- 1870576bae58Smrg# Minimum version: 1.6.0 1871576bae58Smrg# 1872576bae58Smrg# This macro enables a builder to skip all functional specification targets. 1873576bae58Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 1874576bae58Smrg# maximum flexibilty in controlling documentation building. 1875576bae58Smrg# Refer to: 1876576bae58Smrg# XORG_WITH_XMLTO --with-xmlto 1877576bae58Smrg# XORG_WITH_ASCIIDOC --with-asciidoc 1878576bae58Smrg# XORG_WITH_DOXYGEN --with-doxygen 1879576bae58Smrg# XORG_WITH_FOP --with-fop 1880576bae58Smrg# XORG_WITH_GROFF --with-groff 1881576bae58Smrg# XORG_WITH_PS2PDF --with-ps2pdf 1882576bae58Smrg# 1883576bae58Smrg# Interface to module: 1884576bae58Smrg# ENABLE_SPECS: used in makefiles to conditionally generate specs 1885576bae58Smrg# --enable-specs: 'yes' user instructs the module to generate specs 1886576bae58Smrg# 'no' user instructs the module not to generate specs 1887576bae58Smrg# parm1: specify the default value, yes or no. 1888576bae58Smrg# 1889576bae58SmrgAC_DEFUN([XORG_ENABLE_SPECS],[ 1890576bae58Smrgspec_default=$1 1891576bae58Smrgif test "x$spec_default" = x ; then 1892576bae58Smrg spec_default="yes" 1893576bae58Smrgfi 1894576bae58SmrgAC_ARG_ENABLE(specs, 1895576bae58Smrg AS_HELP_STRING([--enable-specs], 1896576bae58Smrg [Enable building the specs (default: yes)]), 1897576bae58Smrg [build_specs=$enableval], [build_specs=$spec_default]) 1898576bae58SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes]) 1899576bae58SmrgAC_MSG_CHECKING([whether to build functional specifications]) 1900576bae58SmrgAC_MSG_RESULT([$build_specs]) 1901576bae58Smrg]) # XORG_ENABLE_SPECS 1902576bae58Smrg 1903bf2eeab3Smrg# XORG_CHECK_MALLOC_ZERO 1904bf2eeab3Smrg# ---------------------- 1905bf2eeab3Smrg# Minimum version: 1.0.0 1906bf2eeab3Smrg# 1907bf2eeab3Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if 1908bf2eeab3Smrg# malloc(0) returns NULL. Packages should add one of these cflags to 1909bf2eeab3Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. 1910bf2eeab3SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[ 1911bf2eeab3SmrgAC_ARG_ENABLE(malloc0returnsnull, 1912bf2eeab3Smrg AS_HELP_STRING([--enable-malloc0returnsnull], 1913bf2eeab3Smrg [malloc(0) returns NULL (default: auto)]), 1914bf2eeab3Smrg [MALLOC_ZERO_RETURNS_NULL=$enableval], 1915bf2eeab3Smrg [MALLOC_ZERO_RETURNS_NULL=auto]) 191614c0a534Smrg 1917bf2eeab3SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL]) 1918bf2eeab3Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then 1919bf2eeab3Smrg AC_RUN_IFELSE([ 1920bf2eeab3Smrgchar *malloc(); 1921bf2eeab3Smrgchar *realloc(); 1922bf2eeab3Smrgchar *calloc(); 1923bf2eeab3Smrgmain() { 1924bf2eeab3Smrg char *m0, *r0, *c0, *p; 1925bf2eeab3Smrg m0 = malloc(0); 1926bf2eeab3Smrg p = malloc(10); 1927bf2eeab3Smrg r0 = realloc(p,0); 1928bf2eeab3Smrg c0 = calloc(0); 1929bf2eeab3Smrg exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1); 1930bf2eeab3Smrg}], 1931bf2eeab3Smrg [MALLOC_ZERO_RETURNS_NULL=yes], 1932576bae58Smrg [MALLOC_ZERO_RETURNS_NULL=no], 1933576bae58Smrg [MALLOC_ZERO_RETURNS_NULL=yes]) 1934bf2eeab3Smrgfi 1935bf2eeab3SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) 193614c0a534Smrg 1937bf2eeab3Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then 1938bf2eeab3Smrg MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" 1939bf2eeab3Smrg XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS 1940bf2eeab3Smrg XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" 1941bf2eeab3Smrgelse 1942bf2eeab3Smrg MALLOC_ZERO_CFLAGS="" 1943bf2eeab3Smrg XMALLOC_ZERO_CFLAGS="" 1944bf2eeab3Smrg XTMALLOC_ZERO_CFLAGS="" 1945bf2eeab3Smrgfi 194614c0a534Smrg 1947bf2eeab3SmrgAC_SUBST([MALLOC_ZERO_CFLAGS]) 1948bf2eeab3SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS]) 1949bf2eeab3SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS]) 1950bf2eeab3Smrg]) # XORG_CHECK_MALLOC_ZERO 195114c0a534Smrg 1952bf2eeab3Smrg# XORG_WITH_LINT() 1953bf2eeab3Smrg# ---------------- 1954bf2eeab3Smrg# Minimum version: 1.1.0 195514c0a534Smrg# 1956576bae58Smrg# This macro enables the use of a tool that flags some suspicious and 1957576bae58Smrg# non-portable constructs (likely to be bugs) in C language source code. 1958576bae58Smrg# It will attempt to locate the tool and use appropriate options. 1959576bae58Smrg# There are various lint type tools on different platforms. 1960576bae58Smrg# 1961576bae58Smrg# Interface to module: 1962576bae58Smrg# LINT: returns the path to the tool found on the platform 1963576bae58Smrg# or the value set to LINT on the configure cmd line 1964576bae58Smrg# also an Automake conditional 1965576bae58Smrg# LINT_FLAGS: an Automake variable with appropriate flags 1966576bae58Smrg# 1967576bae58Smrg# --with-lint: 'yes' user instructs the module to use lint 1968576bae58Smrg# 'no' user instructs the module not to use lint (default) 1969576bae58Smrg# 1970576bae58Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path. 1971576bae58Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim. 1972bf2eeab3Smrg# 1973bf2eeab3SmrgAC_DEFUN([XORG_WITH_LINT],[ 1974bf2eeab3Smrg 1975576bae58SmrgAC_ARG_VAR([LINT], [Path to a lint-style command]) 1976576bae58SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command]) 1977bf2eeab3SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint], 1978bf2eeab3Smrg [Use a lint-style source code checker (default: disabled)])], 1979bf2eeab3Smrg [use_lint=$withval], [use_lint=no]) 1980576bae58Smrg 1981576bae58Smrg# Obtain platform specific info like program name and options 1982576bae58Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris 1983576bae58Smrgcase $host_os in 1984576bae58Smrg *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*) 1985576bae58Smrg lint_name=splint 1986576bae58Smrg lint_options="-badflag" 1987576bae58Smrg ;; 1988576bae58Smrg *freebsd* | *netbsd*) 1989576bae58Smrg lint_name=lint 1990576bae58Smrg lint_options="-u -b" 1991576bae58Smrg ;; 1992576bae58Smrg *solaris*) 1993576bae58Smrg lint_name=lint 1994576bae58Smrg lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2" 1995576bae58Smrg ;; 1996576bae58Smrgesac 1997576bae58Smrg 1998576bae58Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user) 1999576bae58Smrgif test "x$use_lint" = x"yes" ; then 2000576bae58Smrg AC_PATH_PROG([LINT], [$lint_name]) 2001576bae58Smrg if test "x$LINT" = "x"; then 2002576bae58Smrg AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH]) 2003576bae58Smrg fi 2004576bae58Smrgelif test "x$use_lint" = x"no" ; then 2005576bae58Smrg if test "x$LINT" != "x"; then 2006576bae58Smrg AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified]) 2007576bae58Smrg fi 200814c0a534Smrgelse 2009576bae58Smrg AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.]) 2010bf2eeab3Smrgfi 2011576bae58Smrg 2012576bae58Smrg# User supplied flags override default flags 2013576bae58Smrgif test "x$LINT_FLAGS" != "x"; then 2014576bae58Smrg lint_options=$LINT_FLAGS 201514c0a534Smrgfi 201614c0a534Smrg 2017576bae58SmrgAC_SUBST([LINT_FLAGS],[$lint_options]) 2018576bae58SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x]) 201914c0a534Smrg 2020bf2eeab3Smrg]) # XORG_WITH_LINT 202114c0a534Smrg 2022bf2eeab3Smrg# XORG_LINT_LIBRARY(LIBNAME) 2023bf2eeab3Smrg# -------------------------- 2024bf2eeab3Smrg# Minimum version: 1.1.0 2025bf2eeab3Smrg# 2026bf2eeab3Smrg# Sets up flags for building lint libraries for checking programs that call 2027bf2eeab3Smrg# functions in the library. 2028bf2eeab3Smrg# 2029576bae58Smrg# Interface to module: 2030576bae58Smrg# LINTLIB - Automake variable with the name of lint library file to make 2031576bae58Smrg# MAKE_LINT_LIB - Automake conditional 2032576bae58Smrg# 2033576bae58Smrg# --enable-lint-library: - 'yes' user instructs the module to created a lint library 2034576bae58Smrg# - 'no' user instructs the module not to create a lint library (default) 203514c0a534Smrg 2036bf2eeab3SmrgAC_DEFUN([XORG_LINT_LIBRARY],[ 2037bf2eeab3SmrgAC_REQUIRE([XORG_WITH_LINT]) 2038bf2eeab3SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library], 2039bf2eeab3Smrg [Create lint library (default: disabled)])], 2040bf2eeab3Smrg [make_lint_lib=$enableval], [make_lint_lib=no]) 2041576bae58Smrg 2042576bae58Smrgif test "x$make_lint_lib" = x"yes" ; then 2043576bae58Smrg LINTLIB=llib-l$1.ln 2044576bae58Smrg if test "x$LINT" = "x"; then 2045576bae58Smrg AC_MSG_ERROR([Cannot make lint library without --with-lint]) 2046576bae58Smrg fi 2047576bae58Smrgelif test "x$make_lint_lib" != x"no" ; then 2048576bae58Smrg AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.]) 2049bf2eeab3Smrgfi 2050576bae58Smrg 2051bf2eeab3SmrgAC_SUBST(LINTLIB) 2052bf2eeab3SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno]) 205314c0a534Smrg 2054bf2eeab3Smrg]) # XORG_LINT_LIBRARY 205514c0a534Smrg 2056bf2eeab3Smrg# XORG_CWARNFLAGS 2057bf2eeab3Smrg# --------------- 2058bf2eeab3Smrg# Minimum version: 1.2.0 2059bf2eeab3Smrg# 2060bf2eeab3Smrg# Defines CWARNFLAGS to enable C compiler warnings. 2061bf2eeab3Smrg# 2062bf2eeab3SmrgAC_DEFUN([XORG_CWARNFLAGS], [ 2063576bae58SmrgAC_REQUIRE([AC_PROG_CC_C99]) 2064bf2eeab3Smrgif test "x$GCC" = xyes ; then 2065bf2eeab3Smrg CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \ 2066bf2eeab3Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \ 2067576bae58Smrg-Wbad-function-cast -Wformat=2" 2068bf2eeab3Smrg case `$CC -dumpversion` in 2069bf2eeab3Smrg 3.4.* | 4.*) 2070bf2eeab3Smrg CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement" 2071bf2eeab3Smrg ;; 2072bf2eeab3Smrg esac 2073bf2eeab3Smrgelse 2074bf2eeab3Smrg AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) 2075bf2eeab3Smrg if test "x$SUNCC" = "xyes"; then 2076bf2eeab3Smrg CWARNFLAGS="-v" 2077bf2eeab3Smrg fi 2078bf2eeab3Smrgfi 2079bf2eeab3SmrgAC_SUBST(CWARNFLAGS) 2080bf2eeab3Smrg]) # XORG_CWARNFLAGS 208114c0a534Smrg 2082bf2eeab3Smrg# XORG_STRICT_OPTION 2083bf2eeab3Smrg# ----------------------- 2084bf2eeab3Smrg# Minimum version: 1.3.0 208514c0a534Smrg# 2086bf2eeab3Smrg# Add configure option to enable strict compilation 2087bf2eeab3SmrgAC_DEFUN([XORG_STRICT_OPTION], [ 2088576bae58Smrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89 2089bf2eeab3SmrgAC_REQUIRE([AC_PROG_CC_C99]) 2090bf2eeab3SmrgAC_REQUIRE([XORG_CWARNFLAGS]) 2091bf2eeab3Smrg 2092bf2eeab3SmrgAC_ARG_ENABLE(strict-compilation, 2093bf2eeab3Smrg AS_HELP_STRING([--enable-strict-compilation], 2094bf2eeab3Smrg [Enable all warnings from compiler and make them errors (default: disabled)]), 2095bf2eeab3Smrg [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no]) 2096bf2eeab3Smrgif test "x$STRICT_COMPILE" = "xyes"; then 2097bf2eeab3Smrg AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) 2098bf2eeab3Smrg AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"]) 2099bf2eeab3Smrg if test "x$GCC" = xyes ; then 2100bf2eeab3Smrg STRICT_CFLAGS="-pedantic -Werror" 2101bf2eeab3Smrg elif test "x$SUNCC" = "xyes"; then 2102bf2eeab3Smrg STRICT_CFLAGS="-errwarn" 2103bf2eeab3Smrg elif test "x$INTELCC" = "xyes"; then 2104bf2eeab3Smrg STRICT_CFLAGS="-Werror" 2105bf2eeab3Smrg fi 2106bf2eeab3Smrgfi 2107bf2eeab3SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS" 2108bf2eeab3SmrgAC_SUBST([CWARNFLAGS]) 2109bf2eeab3Smrg]) # XORG_STRICT_OPTION 211014c0a534Smrg 2111bf2eeab3Smrg# XORG_DEFAULT_OPTIONS 2112bf2eeab3Smrg# -------------------- 2113bf2eeab3Smrg# Minimum version: 1.3.0 2114bf2eeab3Smrg# 2115bf2eeab3Smrg# Defines default options for X.Org modules. 2116bf2eeab3Smrg# 2117bf2eeab3SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [ 2118576bae58SmrgAC_REQUIRE([AC_PROG_INSTALL]) 2119bf2eeab3SmrgXORG_CWARNFLAGS 2120bf2eeab3SmrgXORG_STRICT_OPTION 2121bf2eeab3SmrgXORG_RELEASE_VERSION 2122bf2eeab3SmrgXORG_CHANGELOG 2123576bae58SmrgXORG_INSTALL 2124bf2eeab3SmrgXORG_MANPAGE_SECTIONS 2125576bae58Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], 2126576bae58Smrg [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) 2127bf2eeab3Smrg]) # XORG_DEFAULT_OPTIONS 2128576bae58Smrg 2129576bae58Smrg# XORG_INSTALL() 2130576bae58Smrg# ---------------- 2131576bae58Smrg# Minimum version: 1.4.0 2132576bae58Smrg# 2133576bae58Smrg# Defines the variable INSTALL_CMD as the command to copy 2134576bae58Smrg# INSTALL from $prefix/share/util-macros. 2135576bae58Smrg# 2136576bae58SmrgAC_DEFUN([XORG_INSTALL], [ 2137576bae58SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG]) 2138576bae58Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` 2139576bae58SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ 2140576bae58Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ 2141576bae58Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \ 2142576bae58Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)" 2143576bae58SmrgAC_SUBST([INSTALL_CMD]) 2144576bae58Smrg]) # XORG_INSTALL 2145bf2eeab3Smrgdnl Copyright 2005 Red Hat, Inc 2146bf2eeab3Smrgdnl 2147bf2eeab3Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its 2148bf2eeab3Smrgdnl documentation for any purpose is hereby granted without fee, provided that 2149bf2eeab3Smrgdnl the above copyright notice appear in all copies and that both that 2150bf2eeab3Smrgdnl copyright notice and this permission notice appear in supporting 2151bf2eeab3Smrgdnl documentation. 2152bf2eeab3Smrgdnl 2153bf2eeab3Smrgdnl The above copyright notice and this permission notice shall be included 2154bf2eeab3Smrgdnl in all copies or substantial portions of the Software. 2155bf2eeab3Smrgdnl 2156bf2eeab3Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 2157bf2eeab3Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 2158bf2eeab3Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 2159bf2eeab3Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 2160bf2eeab3Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 2161bf2eeab3Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 2162bf2eeab3Smrgdnl OTHER DEALINGS IN THE SOFTWARE. 2163bf2eeab3Smrgdnl 2164bf2eeab3Smrgdnl Except as contained in this notice, the name of the copyright holders shall 2165bf2eeab3Smrgdnl not be used in advertising or otherwise to promote the sale, use or 2166bf2eeab3Smrgdnl other dealings in this Software without prior written authorization 2167bf2eeab3Smrgdnl from the copyright holders. 2168bf2eeab3Smrgdnl 216914c0a534Smrg 2170bf2eeab3Smrg# XORG_RELEASE_VERSION 2171bf2eeab3Smrg# -------------------- 2172576bae58Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use. 2173bf2eeab3Smrg 2174bf2eeab3SmrgAC_DEFUN([XORG_RELEASE_VERSION],[ 2175bf2eeab3Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR], 2176bf2eeab3Smrg [`echo $PACKAGE_VERSION | cut -d . -f 1`], 2177bf2eeab3Smrg [Major version of this package]) 2178bf2eeab3Smrg PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` 2179bf2eeab3Smrg if test "x$PVM" = "x"; then 2180bf2eeab3Smrg PVM="0" 2181bf2eeab3Smrg fi 2182bf2eeab3Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR], 2183bf2eeab3Smrg [$PVM], 2184bf2eeab3Smrg [Minor version of this package]) 2185bf2eeab3Smrg PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` 2186bf2eeab3Smrg if test "x$PVP" = "x"; then 2187bf2eeab3Smrg PVP="0" 2188bf2eeab3Smrg fi 2189bf2eeab3Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL], 2190bf2eeab3Smrg [$PVP], 2191bf2eeab3Smrg [Patch version of this package]) 219214c0a534Smrg]) 219314c0a534Smrg 2194bf2eeab3Smrg# XORG_CHANGELOG() 2195bf2eeab3Smrg# ---------------- 2196bf2eeab3Smrg# Minimum version: 1.2.0 2197bf2eeab3Smrg# 2198bf2eeab3Smrg# Defines the variable CHANGELOG_CMD as the command to generate 2199bf2eeab3Smrg# ChangeLog from git. 2200bf2eeab3Smrg# 2201bf2eeab3Smrg# 2202bf2eeab3SmrgAC_DEFUN([XORG_CHANGELOG], [ 2203576bae58SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \ 2204576bae58Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ 2205576bae58Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \ 2206bf2eeab3Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)" 2207bf2eeab3SmrgAC_SUBST([CHANGELOG_CMD]) 2208bf2eeab3Smrg]) # XORG_CHANGELOG 220914c0a534Smrg 2210bf2eeab3Smrg# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- 2211bf2eeab3Smrg# 2212bf2eeab3Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>. 221314c0a534Smrg# 2214bf2eeab3Smrg# This program is free software; you can redistribute it and/or modify 2215bf2eeab3Smrg# it under the terms of the GNU General Public License as published by 2216bf2eeab3Smrg# the Free Software Foundation; either version 2 of the License, or 2217bf2eeab3Smrg# (at your option) any later version. 2218bf2eeab3Smrg# 2219bf2eeab3Smrg# This program is distributed in the hope that it will be useful, but 2220bf2eeab3Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of 2221bf2eeab3Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 2222bf2eeab3Smrg# General Public License for more details. 2223bf2eeab3Smrg# 2224bf2eeab3Smrg# You should have received a copy of the GNU General Public License 2225bf2eeab3Smrg# along with this program; if not, write to the Free Software 2226bf2eeab3Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 2227bf2eeab3Smrg# 2228bf2eeab3Smrg# As a special exception to the GNU General Public License, if you 2229bf2eeab3Smrg# distribute this file as part of a program that contains a 2230bf2eeab3Smrg# configuration script generated by Autoconf, you may include it under 2231bf2eeab3Smrg# the same distribution terms that you use for the rest of that program. 223214c0a534Smrg 2233bf2eeab3Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION]) 2234bf2eeab3Smrg# ---------------------------------- 2235bf2eeab3SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG], 2236bf2eeab3Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) 2237bf2eeab3Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$]) 2238bf2eeab3SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl 2239bf2eeab3Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then 2240bf2eeab3Smrg AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) 2241bf2eeab3Smrgfi 2242bf2eeab3Smrgif test -n "$PKG_CONFIG"; then 2243bf2eeab3Smrg _pkg_min_version=m4_default([$1], [0.9.0]) 2244bf2eeab3Smrg AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) 2245bf2eeab3Smrg if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then 2246bf2eeab3Smrg AC_MSG_RESULT([yes]) 2247bf2eeab3Smrg else 2248bf2eeab3Smrg AC_MSG_RESULT([no]) 2249bf2eeab3Smrg PKG_CONFIG="" 2250bf2eeab3Smrg fi 2251bf2eeab3Smrg 2252bf2eeab3Smrgfi[]dnl 2253bf2eeab3Smrg])# PKG_PROG_PKG_CONFIG 225414c0a534Smrg 2255bf2eeab3Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 2256bf2eeab3Smrg# 2257bf2eeab3Smrg# Check to see whether a particular set of modules exists. Similar 2258bf2eeab3Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors. 2259bf2eeab3Smrg# 2260bf2eeab3Smrg# 2261bf2eeab3Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of 2262bf2eeab3Smrg# this or PKG_CHECK_MODULES is called, or make sure to call 2263bf2eeab3Smrg# PKG_CHECK_EXISTS manually 2264bf2eeab3Smrg# -------------------------------------------------------------- 2265bf2eeab3SmrgAC_DEFUN([PKG_CHECK_EXISTS], 2266bf2eeab3Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 2267bf2eeab3Smrgif test -n "$PKG_CONFIG" && \ 2268bf2eeab3Smrg AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then 2269bf2eeab3Smrg m4_ifval([$2], [$2], [:]) 2270bf2eeab3Smrgm4_ifvaln([$3], [else 2271bf2eeab3Smrg $3])dnl 2272bf2eeab3Smrgfi]) 227314c0a534Smrg 227414c0a534Smrg 2275bf2eeab3Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) 2276bf2eeab3Smrg# --------------------------------------------- 2277bf2eeab3Smrgm4_define([_PKG_CONFIG], 2278bf2eeab3Smrg[if test -n "$$1"; then 2279bf2eeab3Smrg pkg_cv_[]$1="$$1" 2280bf2eeab3Smrg elif test -n "$PKG_CONFIG"; then 2281bf2eeab3Smrg PKG_CHECK_EXISTS([$3], 2282bf2eeab3Smrg [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], 2283bf2eeab3Smrg [pkg_failed=yes]) 2284bf2eeab3Smrg else 2285bf2eeab3Smrg pkg_failed=untried 2286bf2eeab3Smrgfi[]dnl 2287bf2eeab3Smrg])# _PKG_CONFIG 2288bf2eeab3Smrg 2289bf2eeab3Smrg# _PKG_SHORT_ERRORS_SUPPORTED 2290bf2eeab3Smrg# ----------------------------- 2291bf2eeab3SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], 2292bf2eeab3Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 2293bf2eeab3Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then 2294bf2eeab3Smrg _pkg_short_errors_supported=yes 229514c0a534Smrgelse 2296bf2eeab3Smrg _pkg_short_errors_supported=no 2297bf2eeab3Smrgfi[]dnl 2298bf2eeab3Smrg])# _PKG_SHORT_ERRORS_SUPPORTED 229914c0a534Smrg 230014c0a534Smrg 2301bf2eeab3Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], 2302bf2eeab3Smrg# [ACTION-IF-NOT-FOUND]) 230314c0a534Smrg# 230414c0a534Smrg# 2305bf2eeab3Smrg# Note that if there is a possibility the first call to 2306bf2eeab3Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an 2307bf2eeab3Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac 230814c0a534Smrg# 230914c0a534Smrg# 2310bf2eeab3Smrg# -------------------------------------------------------------- 2311bf2eeab3SmrgAC_DEFUN([PKG_CHECK_MODULES], 2312bf2eeab3Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 2313bf2eeab3SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl 2314bf2eeab3SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl 231514c0a534Smrg 2316bf2eeab3Smrgpkg_failed=no 2317bf2eeab3SmrgAC_MSG_CHECKING([for $1]) 231814c0a534Smrg 2319bf2eeab3Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) 2320bf2eeab3Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2]) 232114c0a534Smrg 2322bf2eeab3Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS 2323bf2eeab3Smrgand $1[]_LIBS to avoid the need to call pkg-config. 2324bf2eeab3SmrgSee the pkg-config man page for more details.]) 232514c0a534Smrg 2326bf2eeab3Smrgif test $pkg_failed = yes; then 2327bf2eeab3Smrg _PKG_SHORT_ERRORS_SUPPORTED 2328bf2eeab3Smrg if test $_pkg_short_errors_supported = yes; then 2329bf2eeab3Smrg $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` 2330bf2eeab3Smrg else 2331bf2eeab3Smrg $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` 2332bf2eeab3Smrg fi 2333bf2eeab3Smrg # Put the nasty error message in config.log where it belongs 2334bf2eeab3Smrg echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD 233514c0a534Smrg 2336bf2eeab3Smrg ifelse([$4], , [AC_MSG_ERROR(dnl 2337bf2eeab3Smrg[Package requirements ($2) were not met: 233814c0a534Smrg 2339bf2eeab3Smrg$$1_PKG_ERRORS 234014c0a534Smrg 2341bf2eeab3SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you 2342bf2eeab3Smrginstalled software in a non-standard prefix. 234314c0a534Smrg 2344bf2eeab3Smrg_PKG_TEXT 2345bf2eeab3Smrg])], 2346bf2eeab3Smrg [AC_MSG_RESULT([no]) 2347bf2eeab3Smrg $4]) 2348bf2eeab3Smrgelif test $pkg_failed = untried; then 2349bf2eeab3Smrg ifelse([$4], , [AC_MSG_FAILURE(dnl 2350bf2eeab3Smrg[The pkg-config script could not be found or is too old. Make sure it 2351bf2eeab3Smrgis in your PATH or set the PKG_CONFIG environment variable to the full 2352bf2eeab3Smrgpath to pkg-config. 235314c0a534Smrg 2354bf2eeab3Smrg_PKG_TEXT 235514c0a534Smrg 2356bf2eeab3SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])], 2357bf2eeab3Smrg [$4]) 235814c0a534Smrgelse 2359bf2eeab3Smrg $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS 2360bf2eeab3Smrg $1[]_LIBS=$pkg_cv_[]$1[]_LIBS 2361bf2eeab3Smrg AC_MSG_RESULT([yes]) 2362bf2eeab3Smrg ifelse([$3], , :, [$3]) 2363bf2eeab3Smrgfi[]dnl 2364bf2eeab3Smrg])# PKG_CHECK_MODULES 236514c0a534Smrg 2366