11cca5e29Smrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*- 2d838582fSmrg 3d838582fSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 4d466db85Smrg# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. 5d838582fSmrg# This file is free software; the Free Software Foundation 6d838582fSmrg# gives unlimited permission to copy and/or distribute it, 7d838582fSmrg# with or without modifications, as long as this notice is preserved. 8d838582fSmrg 9d838582fSmrg# This program is distributed in the hope that it will be useful, 10d838582fSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without 11d838582fSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A 12d838582fSmrg# PARTICULAR PURPOSE. 13d838582fSmrg 14d838582fSmrgm4_ifndef([AC_AUTOCONF_VERSION], 15d838582fSmrg [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 161cca5e29Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, 171cca5e29Smrg[m4_warning([this file was generated for autoconf 2.68. 18d838582fSmrgYou have another version of autoconf. It may work, but is not guaranteed to. 19d838582fSmrgIf you have problems, you may need to regenerate the build system entirely. 20d838582fSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])]) 21d838582fSmrg 22d466db85Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. 23d466db85Smrg# 24d466db85Smrg# This file is free software; the Free Software Foundation 25d466db85Smrg# gives unlimited permission to copy and/or distribute it, 26d466db85Smrg# with or without modifications, as long as this notice is preserved. 27d838582fSmrg 28d466db85Smrg# AM_AUTOMAKE_VERSION(VERSION) 29d466db85Smrg# ---------------------------- 30d466db85Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been 31d466db85Smrg# generated from the m4 files accompanying Automake X.Y. 32d466db85Smrg# (This private macro should not be called outside this file.) 33d466db85SmrgAC_DEFUN([AM_AUTOMAKE_VERSION], 34d466db85Smrg[am__api_version='1.11' 35d466db85Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to 36d466db85Smrgdnl require some minimum version. Point them to the right macro. 371cca5e29Smrgm4_if([$1], [1.11.1], [], 38d466db85Smrg [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl 39d466db85Smrg]) 40d466db85Smrg 41d466db85Smrg# _AM_AUTOCONF_VERSION(VERSION) 42d466db85Smrg# ----------------------------- 43d466db85Smrg# aclocal traces this macro to find the Autoconf version. 44d466db85Smrg# This is a private macro too. Using m4_define simplifies 45d466db85Smrg# the logic in aclocal, which can simply ignore this definition. 46d466db85Smrgm4_define([_AM_AUTOCONF_VERSION], []) 47d466db85Smrg 48d466db85Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION 49d466db85Smrg# ------------------------------- 50d466db85Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. 51d466db85Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. 52d466db85SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 531cca5e29Smrg[AM_AUTOMAKE_VERSION([1.11.1])dnl 54d466db85Smrgm4_ifndef([AC_AUTOCONF_VERSION], 55d466db85Smrg [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 56d466db85Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) 57d466db85Smrg 58d466db85Smrg# AM_AUX_DIR_EXPAND -*- Autoconf -*- 59d466db85Smrg 60d466db85Smrg# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 61d838582fSmrg# 62d466db85Smrg# This file is free software; the Free Software Foundation 63d466db85Smrg# gives unlimited permission to copy and/or distribute it, 64d466db85Smrg# with or without modifications, as long as this notice is preserved. 65d466db85Smrg 66d466db85Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 67d466db85Smrg# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to 68d466db85Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'. 69d466db85Smrg# 70d466db85Smrg# Of course, Automake must honor this variable whenever it calls a 71d466db85Smrg# tool from the auxiliary directory. The problem is that $srcdir (and 72d466db85Smrg# therefore $ac_aux_dir as well) can be either absolute or relative, 73d466db85Smrg# depending on how configure is run. This is pretty annoying, since 74d466db85Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top 75d466db85Smrg# source directory, any form will work fine, but in subdirectories a 76d466db85Smrg# relative path needs to be adjusted first. 77d838582fSmrg# 78d466db85Smrg# $ac_aux_dir/missing 79d466db85Smrg# fails when called from a subdirectory if $ac_aux_dir is relative 80d466db85Smrg# $top_srcdir/$ac_aux_dir/missing 81d466db85Smrg# fails if $ac_aux_dir is absolute, 82d466db85Smrg# fails when called from a subdirectory in a VPATH build with 83d466db85Smrg# a relative $ac_aux_dir 84d838582fSmrg# 85d466db85Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir 86d466db85Smrg# are both prefixed by $srcdir. In an in-source build this is usually 87d466db85Smrg# harmless because $srcdir is `.', but things will broke when you 88d466db85Smrg# start a VPATH build or use an absolute $srcdir. 89d838582fSmrg# 90d466db85Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 91d466db85Smrg# iff we strip the leading $srcdir from $ac_aux_dir. That would be: 92d466db85Smrg# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 93d466db85Smrg# and then we would define $MISSING as 94d466db85Smrg# MISSING="\${SHELL} $am_aux_dir/missing" 95d466db85Smrg# This will work as long as MISSING is not called from configure, because 96d466db85Smrg# unfortunately $(top_srcdir) has no meaning in configure. 97d466db85Smrg# However there are other variables, like CC, which are often used in 98d466db85Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir. 99d466db85Smrg# 100d466db85Smrg# Another solution, used here, is to always expand $ac_aux_dir to an 101d466db85Smrg# absolute PATH. The drawback is that using absolute paths prevent a 102d466db85Smrg# configured tree to be moved without reconfiguration. 103d838582fSmrg 104d466db85SmrgAC_DEFUN([AM_AUX_DIR_EXPAND], 105d466db85Smrg[dnl Rely on autoconf to set up CDPATH properly. 106d466db85SmrgAC_PREREQ([2.50])dnl 107d466db85Smrg# expand $ac_aux_dir to an absolute path 108d466db85Smrgam_aux_dir=`cd $ac_aux_dir && pwd` 109d466db85Smrg]) 110d466db85Smrg 111d466db85Smrg# AM_CONDITIONAL -*- Autoconf -*- 112d466db85Smrg 113d466db85Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 114d466db85Smrg# Free Software Foundation, Inc. 115d838582fSmrg# 116d466db85Smrg# This file is free software; the Free Software Foundation 117d466db85Smrg# gives unlimited permission to copy and/or distribute it, 118d466db85Smrg# with or without modifications, as long as this notice is preserved. 119d838582fSmrg 120d466db85Smrg# serial 9 121d838582fSmrg 122d466db85Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION) 123d466db85Smrg# ------------------------------------- 124d466db85Smrg# Define a conditional. 125d466db85SmrgAC_DEFUN([AM_CONDITIONAL], 126d466db85Smrg[AC_PREREQ(2.52)dnl 127d466db85Smrg ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 128d466db85Smrg [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 129d466db85SmrgAC_SUBST([$1_TRUE])dnl 130d466db85SmrgAC_SUBST([$1_FALSE])dnl 131d466db85Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl 132d466db85Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl 133d466db85Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl 134d466db85Smrgif $2; then 135d466db85Smrg $1_TRUE= 136d466db85Smrg $1_FALSE='#' 137d838582fSmrgelse 138d466db85Smrg $1_TRUE='#' 139d466db85Smrg $1_FALSE= 140d838582fSmrgfi 141d466db85SmrgAC_CONFIG_COMMANDS_PRE( 142d466db85Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 143d466db85Smrg AC_MSG_ERROR([[conditional "$1" was never defined. 144d466db85SmrgUsually this means the macro was only invoked conditionally.]]) 145d466db85Smrgfi])]) 146d838582fSmrg 147d466db85Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 148d466db85Smrg# Free Software Foundation, Inc. 149d838582fSmrg# 150d466db85Smrg# This file is free software; the Free Software Foundation 151d466db85Smrg# gives unlimited permission to copy and/or distribute it, 152d466db85Smrg# with or without modifications, as long as this notice is preserved. 153d838582fSmrg 154d466db85Smrg# serial 10 155d838582fSmrg 156d466db85Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be 157d466db85Smrg# written in clear, in which case automake, when reading aclocal.m4, 158d466db85Smrg# will think it sees a *use*, and therefore will trigger all it's 159d466db85Smrg# C support machinery. Also note that it means that autoscan, seeing 160d466db85Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use... 161d838582fSmrg 162d838582fSmrg 163d466db85Smrg# _AM_DEPENDENCIES(NAME) 164d466db85Smrg# ---------------------- 165d466db85Smrg# See how the compiler implements dependency checking. 166d466db85Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC". 167d466db85Smrg# We try a few techniques and use that to set a single cache variable. 168d466db85Smrg# 169d466db85Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was 170d466db85Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular 171d466db85Smrg# dependency, and given that the user is not expected to run this macro, 172d466db85Smrg# just rely on AC_PROG_CC. 173d466db85SmrgAC_DEFUN([_AM_DEPENDENCIES], 174d466db85Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl 175d466db85SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl 176d466db85SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl 177d466db85SmrgAC_REQUIRE([AM_DEP_TRACK])dnl 178d466db85Smrg 179d466db85Smrgifelse([$1], CC, [depcc="$CC" am_compiler_list=], 180d466db85Smrg [$1], CXX, [depcc="$CXX" am_compiler_list=], 181d466db85Smrg [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 182d466db85Smrg [$1], UPC, [depcc="$UPC" am_compiler_list=], 183d466db85Smrg [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 184d466db85Smrg [depcc="$$1" am_compiler_list=]) 185d466db85Smrg 186d466db85SmrgAC_CACHE_CHECK([dependency style of $depcc], 187d466db85Smrg [am_cv_$1_dependencies_compiler_type], 188d466db85Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then 189d466db85Smrg # We make a subdir and do the tests there. Otherwise we can end up 190d466db85Smrg # making bogus files that we don't know about and never remove. For 191d466db85Smrg # instance it was reported that on HP-UX the gcc test will end up 192d466db85Smrg # making a dummy file named `D' -- because `-MD' means `put the output 193d466db85Smrg # in D'. 194d466db85Smrg mkdir conftest.dir 195d466db85Smrg # Copy depcomp to subdir because otherwise we won't find it if we're 196d466db85Smrg # using a relative directory. 197d466db85Smrg cp "$am_depcomp" conftest.dir 198d466db85Smrg cd conftest.dir 199d466db85Smrg # We will build objects and dependencies in a subdirectory because 200d466db85Smrg # it helps to detect inapplicable dependency modes. For instance 201d466db85Smrg # both Tru64's cc and ICC support -MD to output dependencies as a 202d466db85Smrg # side effect of compilation, but ICC will put the dependencies in 203d466db85Smrg # the current directory while Tru64 will put them in the object 204d466db85Smrg # directory. 205d466db85Smrg mkdir sub 206d466db85Smrg 207d466db85Smrg am_cv_$1_dependencies_compiler_type=none 208d466db85Smrg if test "$am_compiler_list" = ""; then 209d466db85Smrg am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` 210d466db85Smrg fi 211d466db85Smrg am__universal=false 212d466db85Smrg m4_case([$1], [CC], 213d466db85Smrg [case " $depcc " in #( 214d466db85Smrg *\ -arch\ *\ -arch\ *) am__universal=true ;; 215d466db85Smrg esac], 216d466db85Smrg [CXX], 217d466db85Smrg [case " $depcc " in #( 218d466db85Smrg *\ -arch\ *\ -arch\ *) am__universal=true ;; 219d466db85Smrg esac]) 220d466db85Smrg 221d466db85Smrg for depmode in $am_compiler_list; do 222d466db85Smrg # Setup a source with many dependencies, because some compilers 223d466db85Smrg # like to wrap large dependency lists on column 80 (with \), and 224d466db85Smrg # we should not choose a depcomp mode which is confused by this. 225d466db85Smrg # 226d466db85Smrg # We need to recreate these files for each test, as the compiler may 227d466db85Smrg # overwrite some of them when testing with obscure command lines. 228d466db85Smrg # This happens at least with the AIX C compiler. 229d466db85Smrg : > sub/conftest.c 230d466db85Smrg for i in 1 2 3 4 5 6; do 231d466db85Smrg echo '#include "conftst'$i'.h"' >> sub/conftest.c 232d466db85Smrg # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with 233d466db85Smrg # Solaris 8's {/usr,}/bin/sh. 234d466db85Smrg touch sub/conftst$i.h 235d466db85Smrg done 236d466db85Smrg echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 237d466db85Smrg 238d466db85Smrg # We check with `-c' and `-o' for the sake of the "dashmstdout" 239d466db85Smrg # mode. It turns out that the SunPro C++ compiler does not properly 240d466db85Smrg # handle `-M -o', and we need to detect this. Also, some Intel 241d466db85Smrg # versions had trouble with output in subdirs 242d466db85Smrg am__obj=sub/conftest.${OBJEXT-o} 243d466db85Smrg am__minus_obj="-o $am__obj" 244d466db85Smrg case $depmode in 245d466db85Smrg gcc) 246d466db85Smrg # This depmode causes a compiler race in universal mode. 247d466db85Smrg test "$am__universal" = false || continue 248d466db85Smrg ;; 249d466db85Smrg nosideeffect) 250d466db85Smrg # after this tag, mechanisms are not by side-effect, so they'll 251d466db85Smrg # only be used when explicitly requested 252d466db85Smrg if test "x$enable_dependency_tracking" = xyes; then 253d466db85Smrg continue 254d466db85Smrg else 255d466db85Smrg break 256d466db85Smrg fi 257d466db85Smrg ;; 258d466db85Smrg msvisualcpp | msvcmsys) 259d466db85Smrg # This compiler won't grok `-c -o', but also, the minuso test has 260d466db85Smrg # not run yet. These depmodes are late enough in the game, and 261d466db85Smrg # so weak that their functioning should not be impacted. 262d466db85Smrg am__obj=conftest.${OBJEXT-o} 263d466db85Smrg am__minus_obj= 264d466db85Smrg ;; 265d466db85Smrg none) break ;; 266d838582fSmrg esac 267d466db85Smrg if depmode=$depmode \ 268d466db85Smrg source=sub/conftest.c object=$am__obj \ 269d466db85Smrg depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ 270d466db85Smrg $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ 271d466db85Smrg >/dev/null 2>conftest.err && 272d466db85Smrg grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 273d466db85Smrg grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && 274d466db85Smrg grep $am__obj sub/conftest.Po > /dev/null 2>&1 && 275d466db85Smrg ${MAKE-make} -s -f confmf > /dev/null 2>&1; then 276d466db85Smrg # icc doesn't choke on unknown options, it will just issue warnings 277d466db85Smrg # or remarks (even with -Werror). So we grep stderr for any message 278d466db85Smrg # that says an option was ignored or not supported. 279d466db85Smrg # When given -MP, icc 7.0 and 7.1 complain thusly: 280d466db85Smrg # icc: Command line warning: ignoring option '-M'; no argument required 281d466db85Smrg # The diagnosis changed in icc 8.0: 282d466db85Smrg # icc: Command line remark: option '-MP' not supported 283d466db85Smrg if (grep 'ignoring option' conftest.err || 284d466db85Smrg grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else 285d466db85Smrg am_cv_$1_dependencies_compiler_type=$depmode 286d466db85Smrg break 287d466db85Smrg fi 288d466db85Smrg fi 289d466db85Smrg done 290d466db85Smrg 291d466db85Smrg cd .. 292d466db85Smrg rm -rf conftest.dir 293d466db85Smrgelse 294d466db85Smrg am_cv_$1_dependencies_compiler_type=none 295d838582fSmrgfi 296d466db85Smrg]) 297d466db85SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) 298d466db85SmrgAM_CONDITIONAL([am__fastdep$1], [ 299d466db85Smrg test "x$enable_dependency_tracking" != xno \ 300d466db85Smrg && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) 301d466db85Smrg]) 302d838582fSmrg 303d838582fSmrg 304d466db85Smrg# AM_SET_DEPDIR 305d466db85Smrg# ------------- 306d466db85Smrg# Choose a directory name for dependency files. 307d466db85Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES 308d466db85SmrgAC_DEFUN([AM_SET_DEPDIR], 309d466db85Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl 310d466db85SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl 311d466db85Smrg]) 312d838582fSmrg 313d466db85Smrg 314d466db85Smrg# AM_DEP_TRACK 315d466db85Smrg# ------------ 316d466db85SmrgAC_DEFUN([AM_DEP_TRACK], 317d466db85Smrg[AC_ARG_ENABLE(dependency-tracking, 318d466db85Smrg[ --disable-dependency-tracking speeds up one-time build 319d466db85Smrg --enable-dependency-tracking do not reject slow dependency extractors]) 320d466db85Smrgif test "x$enable_dependency_tracking" != xno; then 321d466db85Smrg am_depcomp="$ac_aux_dir/depcomp" 322d466db85Smrg AMDEPBACKSLASH='\' 323d838582fSmrgfi 324d466db85SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) 325d466db85SmrgAC_SUBST([AMDEPBACKSLASH])dnl 326d466db85Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl 327d466db85Smrg]) 328d838582fSmrg 329d466db85Smrg# Generate code to set up dependency tracking. -*- Autoconf -*- 330d838582fSmrg 331d466db85Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 332d466db85Smrg# Free Software Foundation, Inc. 333d466db85Smrg# 334d466db85Smrg# This file is free software; the Free Software Foundation 335d466db85Smrg# gives unlimited permission to copy and/or distribute it, 336d466db85Smrg# with or without modifications, as long as this notice is preserved. 337d838582fSmrg 338d466db85Smrg#serial 5 339d466db85Smrg 340d466db85Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS 341d466db85Smrg# ------------------------------ 342d466db85SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], 343d466db85Smrg[{ 344d466db85Smrg # Autoconf 2.62 quotes --file arguments for eval, but not when files 345d466db85Smrg # are listed without --file. Let's play safe and only enable the eval 346d466db85Smrg # if we detect the quoting. 347d466db85Smrg case $CONFIG_FILES in 348d466db85Smrg *\'*) eval set x "$CONFIG_FILES" ;; 349d466db85Smrg *) set x $CONFIG_FILES ;; 350d466db85Smrg esac 351d466db85Smrg shift 352d466db85Smrg for mf 353d466db85Smrg do 354d466db85Smrg # Strip MF so we end up with the name of the file. 355d466db85Smrg mf=`echo "$mf" | sed -e 's/:.*$//'` 356d466db85Smrg # Check whether this is an Automake generated Makefile or not. 357d466db85Smrg # We used to match only the files named `Makefile.in', but 358d466db85Smrg # some people rename them; so instead we look at the file content. 359d466db85Smrg # Grep'ing the first line is not enough: some people post-process 360d466db85Smrg # each Makefile.in and add a new line on top of each file to say so. 361d466db85Smrg # Grep'ing the whole file is not good either: AIX grep has a line 362d466db85Smrg # limit of 2048, but all sed's we know have understand at least 4000. 363d466db85Smrg if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then 364d466db85Smrg dirpart=`AS_DIRNAME("$mf")` 365d466db85Smrg else 366d466db85Smrg continue 367d466db85Smrg fi 368d466db85Smrg # Extract the definition of DEPDIR, am__include, and am__quote 369d466db85Smrg # from the Makefile without running `make'. 370d466db85Smrg DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` 371d466db85Smrg test -z "$DEPDIR" && continue 372d466db85Smrg am__include=`sed -n 's/^am__include = //p' < "$mf"` 373d466db85Smrg test -z "am__include" && continue 374d466db85Smrg am__quote=`sed -n 's/^am__quote = //p' < "$mf"` 375d466db85Smrg # When using ansi2knr, U may be empty or an underscore; expand it 376d466db85Smrg U=`sed -n 's/^U = //p' < "$mf"` 377d466db85Smrg # Find all dependency output files, they are included files with 378d466db85Smrg # $(DEPDIR) in their names. We invoke sed twice because it is the 379d466db85Smrg # simplest approach to changing $(DEPDIR) to its actual value in the 380d466db85Smrg # expansion. 381d466db85Smrg for file in `sed -n " 382d466db85Smrg s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ 383d466db85Smrg sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do 384d466db85Smrg # Make sure the directory exists. 385d466db85Smrg test -f "$dirpart/$file" && continue 386d466db85Smrg fdir=`AS_DIRNAME(["$file"])` 387d466db85Smrg AS_MKDIR_P([$dirpart/$fdir]) 388d466db85Smrg # echo "creating $dirpart/$file" 389d466db85Smrg echo '# dummy' > "$dirpart/$file" 390d466db85Smrg done 391d466db85Smrg done 392d466db85Smrg} 393d466db85Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS 394d466db85Smrg 395d466db85Smrg 396d466db85Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS 397d466db85Smrg# ----------------------------- 398d466db85Smrg# This macro should only be invoked once -- use via AC_REQUIRE. 399d838582fSmrg# 400d466db85Smrg# This code is only required when automatic dependency tracking 401d466db85Smrg# is enabled. FIXME. This creates each `.P' file that we will 402d466db85Smrg# need in order to bootstrap the dependency handling code. 403d466db85SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], 404d466db85Smrg[AC_CONFIG_COMMANDS([depfiles], 405d466db85Smrg [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], 406d466db85Smrg [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) 407d466db85Smrg]) 408d838582fSmrg 409d466db85Smrg# Do all the work for Automake. -*- Autoconf -*- 410d838582fSmrg 411d466db85Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 412d466db85Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. 413d466db85Smrg# 414d466db85Smrg# This file is free software; the Free Software Foundation 415d466db85Smrg# gives unlimited permission to copy and/or distribute it, 416d466db85Smrg# with or without modifications, as long as this notice is preserved. 417d838582fSmrg 418d466db85Smrg# serial 16 419d838582fSmrg 420d466db85Smrg# This macro actually does too much. Some checks are only needed if 421d466db85Smrg# your package does certain things. But this isn't really a big deal. 422d466db85Smrg 423d466db85Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 424d466db85Smrg# AM_INIT_AUTOMAKE([OPTIONS]) 425d466db85Smrg# ----------------------------------------------- 426d466db85Smrg# The call with PACKAGE and VERSION arguments is the old style 427d466db85Smrg# call (pre autoconf-2.50), which is being phased out. PACKAGE 428d466db85Smrg# and VERSION should now be passed to AC_INIT and removed from 429d466db85Smrg# the call to AM_INIT_AUTOMAKE. 430d466db85Smrg# We support both call styles for the transition. After 431d466db85Smrg# the next Automake release, Autoconf can make the AC_INIT 432d466db85Smrg# arguments mandatory, and then we can depend on a new Autoconf 433d466db85Smrg# release and drop the old call support. 434d466db85SmrgAC_DEFUN([AM_INIT_AUTOMAKE], 435d466db85Smrg[AC_PREREQ([2.62])dnl 436d466db85Smrgdnl Autoconf wants to disallow AM_ names. We explicitly allow 437d466db85Smrgdnl the ones we care about. 438d466db85Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 439d466db85SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 440d466db85SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl 441d466db85Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then 442d466db85Smrg # Use -I$(srcdir) only when $(srcdir) != ., so that make's output 443d466db85Smrg # is not polluted with repeated "-I." 444d466db85Smrg AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl 445d466db85Smrg # test to see if srcdir already configured 446d466db85Smrg if test -f $srcdir/config.status; then 447d466db85Smrg AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 448d466db85Smrg fi 449d838582fSmrgfi 450d838582fSmrg 451d466db85Smrg# test whether we have cygpath 452d466db85Smrgif test -z "$CYGPATH_W"; then 453d466db85Smrg if (cygpath --version) >/dev/null 2>/dev/null; then 454d466db85Smrg CYGPATH_W='cygpath -w' 455d466db85Smrg else 456d466db85Smrg CYGPATH_W=echo 457d466db85Smrg fi 458d466db85Smrgfi 459d466db85SmrgAC_SUBST([CYGPATH_W]) 460d838582fSmrg 461d466db85Smrg# Define the identity of the package. 462d466db85Smrgdnl Distinguish between old-style and new-style calls. 463d466db85Smrgm4_ifval([$2], 464d466db85Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 465d466db85Smrg AC_SUBST([PACKAGE], [$1])dnl 466d466db85Smrg AC_SUBST([VERSION], [$2])], 467d466db85Smrg[_AM_SET_OPTIONS([$1])dnl 468d466db85Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. 469d466db85Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, 470d466db85Smrg [m4_fatal([AC_INIT should be called with package and version arguments])])dnl 471d466db85Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl 472d466db85Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl 473d838582fSmrg 474d466db85Smrg_AM_IF_OPTION([no-define],, 475d466db85Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) 476d466db85Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl 477d838582fSmrg 478d466db85Smrg# Some tools Automake needs. 479d466db85SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl 480d466db85SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl 481d466db85SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) 482d466db85SmrgAM_MISSING_PROG(AUTOCONF, autoconf) 483d466db85SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) 484d466db85SmrgAM_MISSING_PROG(AUTOHEADER, autoheader) 485d466db85SmrgAM_MISSING_PROG(MAKEINFO, makeinfo) 486d466db85SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl 487d466db85SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl 488d466db85SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl 489d466db85Smrg# We need awk for the "check" target. The system "awk" is bad on 490d466db85Smrg# some platforms. 491d466db85SmrgAC_REQUIRE([AC_PROG_AWK])dnl 492d466db85SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl 493d466db85SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl 494d466db85Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], 495d466db85Smrg [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], 496d466db85Smrg [_AM_PROG_TAR([v7])])]) 497d466db85Smrg_AM_IF_OPTION([no-dependencies],, 498d466db85Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC], 499d466db85Smrg [_AM_DEPENDENCIES(CC)], 500d466db85Smrg [define([AC_PROG_CC], 501d466db85Smrg defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl 502d466db85SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX], 503d466db85Smrg [_AM_DEPENDENCIES(CXX)], 504d466db85Smrg [define([AC_PROG_CXX], 505d466db85Smrg defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl 506d466db85SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC], 507d466db85Smrg [_AM_DEPENDENCIES(OBJC)], 508d466db85Smrg [define([AC_PROG_OBJC], 509d466db85Smrg defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl 510d466db85Smrg]) 511d466db85Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl 512d466db85Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the 513d466db85Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro 514d466db85Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below. 515d466db85SmrgAC_CONFIG_COMMANDS_PRE(dnl 516d466db85Smrg[m4_provide_if([_AM_COMPILER_EXEEXT], 517d466db85Smrg [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl 518d466db85Smrg]) 519d838582fSmrg 520d466db85Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not 521d466db85Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further 522d466db85Smrgdnl mangled by Autoconf and run in a shell conditional statement. 523d466db85Smrgm4_define([_AC_COMPILER_EXEEXT], 524d466db85Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) 525d838582fSmrg 526d838582fSmrg 527d466db85Smrg# When config.status generates a header, we must update the stamp-h file. 528d466db85Smrg# This file resides in the same directory as the config header 529d466db85Smrg# that is generated. The stamp files are numbered to have different names. 530d838582fSmrg 531d466db85Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 532d466db85Smrg# loop where config.status creates the headers, so we can generate 533d466db85Smrg# our stamp files there. 534d466db85SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 535d466db85Smrg[# Compute $1's index in $config_headers. 536d466db85Smrg_am_arg=$1 537d466db85Smrg_am_stamp_count=1 538d466db85Smrgfor _am_header in $config_headers :; do 539d466db85Smrg case $_am_header in 540d466db85Smrg $_am_arg | $_am_arg:* ) 541d466db85Smrg break ;; 542d466db85Smrg * ) 543d466db85Smrg _am_stamp_count=`expr $_am_stamp_count + 1` ;; 544d466db85Smrg esac 545d466db85Smrgdone 546d466db85Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) 547d838582fSmrg 548d466db85Smrg# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. 549d838582fSmrg# 550d466db85Smrg# This file is free software; the Free Software Foundation 551d466db85Smrg# gives unlimited permission to copy and/or distribute it, 552d466db85Smrg# with or without modifications, as long as this notice is preserved. 553d838582fSmrg 554d466db85Smrg# AM_PROG_INSTALL_SH 555d466db85Smrg# ------------------ 556d466db85Smrg# Define $install_sh. 557d466db85SmrgAC_DEFUN([AM_PROG_INSTALL_SH], 558d466db85Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 559d466db85Smrgif test x"${install_sh}" != xset; then 560d466db85Smrg case $am_aux_dir in 561d466db85Smrg *\ * | *\ *) 562d466db85Smrg install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; 563d466db85Smrg *) 564d466db85Smrg install_sh="\${SHELL} $am_aux_dir/install-sh" 565d466db85Smrg esac 566d466db85Smrgfi 567d466db85SmrgAC_SUBST(install_sh)]) 568d838582fSmrg 569d466db85Smrg# Copyright (C) 2003, 2005 Free Software Foundation, Inc. 570d466db85Smrg# 571d466db85Smrg# This file is free software; the Free Software Foundation 572d466db85Smrg# gives unlimited permission to copy and/or distribute it, 573d466db85Smrg# with or without modifications, as long as this notice is preserved. 574d838582fSmrg 575d466db85Smrg# serial 2 576d838582fSmrg 577d466db85Smrg# Check whether the underlying file-system supports filenames 578d466db85Smrg# with a leading dot. For instance MS-DOS doesn't. 579d466db85SmrgAC_DEFUN([AM_SET_LEADING_DOT], 580d466db85Smrg[rm -rf .tst 2>/dev/null 581d466db85Smrgmkdir .tst 2>/dev/null 582d466db85Smrgif test -d .tst; then 583d466db85Smrg am__leading_dot=. 584d466db85Smrgelse 585d466db85Smrg am__leading_dot=_ 586d838582fSmrgfi 587d466db85Smrgrmdir .tst 2>/dev/null 588d466db85SmrgAC_SUBST([am__leading_dot])]) 589d838582fSmrg 590d466db85Smrg# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- 591d466db85Smrg# From Jim Meyering 592d838582fSmrg 593d466db85Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 594d466db85Smrg# Free Software Foundation, Inc. 595d466db85Smrg# 596d466db85Smrg# This file is free software; the Free Software Foundation 597d466db85Smrg# gives unlimited permission to copy and/or distribute it, 598d466db85Smrg# with or without modifications, as long as this notice is preserved. 599d838582fSmrg 600d466db85Smrg# serial 5 601d838582fSmrg 602d466db85Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE]) 603d466db85Smrg# ---------------------------------- 604d466db85Smrg# Control maintainer-specific portions of Makefiles. 605d466db85Smrg# Default is to disable them, unless `enable' is passed literally. 606d466db85Smrg# For symmetry, `disable' may be passed as well. Anyway, the user 607d466db85Smrg# can override the default with the --enable/--disable switch. 608d466db85SmrgAC_DEFUN([AM_MAINTAINER_MODE], 609d466db85Smrg[m4_case(m4_default([$1], [disable]), 610d466db85Smrg [enable], [m4_define([am_maintainer_other], [disable])], 611d466db85Smrg [disable], [m4_define([am_maintainer_other], [enable])], 612d466db85Smrg [m4_define([am_maintainer_other], [enable]) 613d466db85Smrg m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) 614d466db85SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) 615d466db85Smrg dnl maintainer-mode's default is 'disable' unless 'enable' is passed 616d466db85Smrg AC_ARG_ENABLE([maintainer-mode], 617d466db85Smrg[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful 618d466db85Smrg (and sometimes confusing) to the casual installer], 619d466db85Smrg [USE_MAINTAINER_MODE=$enableval], 620d466db85Smrg [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) 621d466db85Smrg AC_MSG_RESULT([$USE_MAINTAINER_MODE]) 622d466db85Smrg AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) 623d466db85Smrg MAINT=$MAINTAINER_MODE_TRUE 624d466db85Smrg AC_SUBST([MAINT])dnl 625d466db85Smrg] 626d466db85Smrg) 627d838582fSmrg 628d466db85SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) 629d838582fSmrg 630d466db85Smrg# Check to see how 'make' treats includes. -*- Autoconf -*- 631d838582fSmrg 632d466db85Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. 633d838582fSmrg# 634d466db85Smrg# This file is free software; the Free Software Foundation 635d466db85Smrg# gives unlimited permission to copy and/or distribute it, 636d466db85Smrg# with or without modifications, as long as this notice is preserved. 637d838582fSmrg 638d466db85Smrg# serial 4 639d838582fSmrg 640d466db85Smrg# AM_MAKE_INCLUDE() 641d466db85Smrg# ----------------- 642d466db85Smrg# Check to see how make treats includes. 643d466db85SmrgAC_DEFUN([AM_MAKE_INCLUDE], 644d466db85Smrg[am_make=${MAKE-make} 645d466db85Smrgcat > confinc << 'END' 646d466db85Smrgam__doit: 647d466db85Smrg @echo this is the am__doit target 648d466db85Smrg.PHONY: am__doit 649d466db85SmrgEND 650d466db85Smrg# If we don't find an include directive, just comment out the code. 651d466db85SmrgAC_MSG_CHECKING([for style of include used by $am_make]) 652d466db85Smrgam__include="#" 653d466db85Smrgam__quote= 654d466db85Smrg_am_result=none 655d466db85Smrg# First try GNU make style include. 656d466db85Smrgecho "include confinc" > confmf 657d466db85Smrg# Ignore all kinds of additional output from `make'. 658d466db85Smrgcase `$am_make -s -f confmf 2> /dev/null` in #( 659d466db85Smrg*the\ am__doit\ target*) 660d466db85Smrg am__include=include 661d466db85Smrg am__quote= 662d466db85Smrg _am_result=GNU 663d466db85Smrg ;; 664d466db85Smrgesac 665d466db85Smrg# Now try BSD make style include. 666d466db85Smrgif test "$am__include" = "#"; then 667d466db85Smrg echo '.include "confinc"' > confmf 668d466db85Smrg case `$am_make -s -f confmf 2> /dev/null` in #( 669d466db85Smrg *the\ am__doit\ target*) 670d466db85Smrg am__include=.include 671d466db85Smrg am__quote="\"" 672d466db85Smrg _am_result=BSD 673d466db85Smrg ;; 674d466db85Smrg esac 675d466db85Smrgfi 676d466db85SmrgAC_SUBST([am__include]) 677d466db85SmrgAC_SUBST([am__quote]) 678d466db85SmrgAC_MSG_RESULT([$_am_result]) 679d466db85Smrgrm -f confinc confmf 680d466db85Smrg]) 681d838582fSmrg 682d466db85Smrg# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- 683d838582fSmrg 684d466db85Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 685d466db85Smrg# Free Software Foundation, Inc. 686d838582fSmrg# 687d466db85Smrg# This file is free software; the Free Software Foundation 688d466db85Smrg# gives unlimited permission to copy and/or distribute it, 689d466db85Smrg# with or without modifications, as long as this notice is preserved. 690d838582fSmrg 691d466db85Smrg# serial 6 692d838582fSmrg 693d466db85Smrg# AM_MISSING_PROG(NAME, PROGRAM) 694d466db85Smrg# ------------------------------ 695d466db85SmrgAC_DEFUN([AM_MISSING_PROG], 696d466db85Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN]) 697d466db85Smrg$1=${$1-"${am_missing_run}$2"} 698d466db85SmrgAC_SUBST($1)]) 699d838582fSmrg 700d838582fSmrg 701d466db85Smrg# AM_MISSING_HAS_RUN 702d466db85Smrg# ------------------ 703d466db85Smrg# Define MISSING if not defined so far and test if it supports --run. 704d466db85Smrg# If it does, set am_missing_run to use it, otherwise, to nothing. 705d466db85SmrgAC_DEFUN([AM_MISSING_HAS_RUN], 706d466db85Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 707d466db85SmrgAC_REQUIRE_AUX_FILE([missing])dnl 708d466db85Smrgif test x"${MISSING+set}" != xset; then 709d466db85Smrg case $am_aux_dir in 710d466db85Smrg *\ * | *\ *) 711d466db85Smrg MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; 712d466db85Smrg *) 713d466db85Smrg MISSING="\${SHELL} $am_aux_dir/missing" ;; 714d466db85Smrg esac 715d466db85Smrgfi 716d466db85Smrg# Use eval to expand $SHELL 717d466db85Smrgif eval "$MISSING --run true"; then 718d466db85Smrg am_missing_run="$MISSING --run " 719d466db85Smrgelse 720d466db85Smrg am_missing_run= 721d466db85Smrg AC_MSG_WARN([`missing' script is too old or missing]) 722d466db85Smrgfi 723d838582fSmrg]) 724d838582fSmrg 725d466db85Smrg# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 726d838582fSmrg# 727d838582fSmrg# This file is free software; the Free Software Foundation 728d838582fSmrg# gives unlimited permission to copy and/or distribute it, 729d838582fSmrg# with or without modifications, as long as this notice is preserved. 730d838582fSmrg 731d466db85Smrg# AM_PROG_MKDIR_P 732d466db85Smrg# --------------- 733d466db85Smrg# Check for `mkdir -p'. 734d466db85SmrgAC_DEFUN([AM_PROG_MKDIR_P], 735d466db85Smrg[AC_PREREQ([2.60])dnl 736d466db85SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl 737d466db85Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, 738d466db85Smrgdnl while keeping a definition of mkdir_p for backward compatibility. 739d466db85Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. 740d466db85Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of 741d466db85Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own 742d466db85Smrgdnl adjustment using top_builddir (which is defined more often than 743d466db85Smrgdnl MKDIR_P). 744d466db85SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl 745d466db85Smrgcase $mkdir_p in 746d466db85Smrg [[\\/$]]* | ?:[[\\/]]*) ;; 747d466db85Smrg */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; 748d466db85Smrgesac 749d838582fSmrg]) 750d838582fSmrg 751d466db85Smrg# Helper functions for option handling. -*- Autoconf -*- 752d838582fSmrg 753d466db85Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. 754d838582fSmrg# 755d838582fSmrg# This file is free software; the Free Software Foundation 756d838582fSmrg# gives unlimited permission to copy and/or distribute it, 757d838582fSmrg# with or without modifications, as long as this notice is preserved. 758d838582fSmrg 759d466db85Smrg# serial 4 760d838582fSmrg 761d466db85Smrg# _AM_MANGLE_OPTION(NAME) 762d466db85Smrg# ----------------------- 763d466db85SmrgAC_DEFUN([_AM_MANGLE_OPTION], 764d466db85Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 765d838582fSmrg 766d466db85Smrg# _AM_SET_OPTION(NAME) 767d466db85Smrg# ------------------------------ 768d466db85Smrg# Set option NAME. Presently that only means defining a flag for this option. 769d466db85SmrgAC_DEFUN([_AM_SET_OPTION], 770d466db85Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) 771d466db85Smrg 772d466db85Smrg# _AM_SET_OPTIONS(OPTIONS) 773d466db85Smrg# ---------------------------------- 774d466db85Smrg# OPTIONS is a space-separated list of Automake options. 775d466db85SmrgAC_DEFUN([_AM_SET_OPTIONS], 776d466db85Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 777d466db85Smrg 778d466db85Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 779d466db85Smrg# ------------------------------------------- 780d466db85Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 781d466db85SmrgAC_DEFUN([_AM_IF_OPTION], 782d466db85Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 783d838582fSmrg 784d466db85Smrg# Check to make sure that the build environment is sane. -*- Autoconf -*- 785d466db85Smrg 786d466db85Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 787d838582fSmrg# Free Software Foundation, Inc. 788d838582fSmrg# 789d838582fSmrg# This file is free software; the Free Software Foundation 790d838582fSmrg# gives unlimited permission to copy and/or distribute it, 791d838582fSmrg# with or without modifications, as long as this notice is preserved. 792d838582fSmrg 793d466db85Smrg# serial 5 794d838582fSmrg 795d466db85Smrg# AM_SANITY_CHECK 796d466db85Smrg# --------------- 797d466db85SmrgAC_DEFUN([AM_SANITY_CHECK], 798d466db85Smrg[AC_MSG_CHECKING([whether build environment is sane]) 799d466db85Smrg# Just in case 800d466db85Smrgsleep 1 801d466db85Smrgecho timestamp > conftest.file 802d466db85Smrg# Reject unsafe characters in $srcdir or the absolute working directory 803d466db85Smrg# name. Accept space and tab only in the latter. 804d466db85Smrgam_lf=' 805d466db85Smrg' 806d466db85Smrgcase `pwd` in 807d466db85Smrg *[[\\\"\#\$\&\'\`$am_lf]]*) 808d466db85Smrg AC_MSG_ERROR([unsafe absolute working directory name]);; 809d466db85Smrgesac 810d466db85Smrgcase $srcdir in 811d466db85Smrg *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) 812d466db85Smrg AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; 813d466db85Smrgesac 814d466db85Smrg 815d466db85Smrg# Do `set' in a subshell so we don't clobber the current shell's 816d466db85Smrg# arguments. Must try -L first in case configure is actually a 817d466db85Smrg# symlink; some systems play weird games with the mod time of symlinks 818d466db85Smrg# (eg FreeBSD returns the mod time of the symlink's containing 819d466db85Smrg# directory). 820d466db85Smrgif ( 821d466db85Smrg set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` 822d466db85Smrg if test "$[*]" = "X"; then 823d466db85Smrg # -L didn't work. 824d466db85Smrg set X `ls -t "$srcdir/configure" conftest.file` 825d466db85Smrg fi 826d466db85Smrg rm -f conftest.file 827d466db85Smrg if test "$[*]" != "X $srcdir/configure conftest.file" \ 828d466db85Smrg && test "$[*]" != "X conftest.file $srcdir/configure"; then 829d466db85Smrg 830d466db85Smrg # If neither matched, then we have a broken ls. This can happen 831d466db85Smrg # if, for instance, CONFIG_SHELL is bash and it inherits a 832d466db85Smrg # broken ls alias from the environment. This has actually 833d466db85Smrg # happened. Such a system could not be considered "sane". 834d466db85Smrg AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 835d466db85Smrgalias in your environment]) 836d466db85Smrg fi 837d466db85Smrg 838d466db85Smrg test "$[2]" = conftest.file 839d466db85Smrg ) 840d466db85Smrgthen 841d466db85Smrg # Ok. 842d466db85Smrg : 843d838582fSmrgelse 844d466db85Smrg AC_MSG_ERROR([newly created file is older than distributed files! 845d466db85SmrgCheck your system clock]) 846d838582fSmrgfi 847d466db85SmrgAC_MSG_RESULT(yes)]) 848d838582fSmrg 849d466db85Smrg# Copyright (C) 2009 Free Software Foundation, Inc. 850d838582fSmrg# 851d838582fSmrg# This file is free software; the Free Software Foundation 852d838582fSmrg# gives unlimited permission to copy and/or distribute it, 853d838582fSmrg# with or without modifications, as long as this notice is preserved. 854d838582fSmrg 855d466db85Smrg# serial 1 856d838582fSmrg 857d466db85Smrg# AM_SILENT_RULES([DEFAULT]) 858d466db85Smrg# -------------------------- 859d466db85Smrg# Enable less verbose build rules; with the default set to DEFAULT 860d466db85Smrg# (`yes' being less verbose, `no' or empty being verbose). 861d466db85SmrgAC_DEFUN([AM_SILENT_RULES], 862d466db85Smrg[AC_ARG_ENABLE([silent-rules], 863d466db85Smrg[ --enable-silent-rules less verbose build output (undo: `make V=1') 864d466db85Smrg --disable-silent-rules verbose build output (undo: `make V=0')]) 865d466db85Smrgcase $enable_silent_rules in 866d466db85Smrgyes) AM_DEFAULT_VERBOSITY=0;; 867d466db85Smrgno) AM_DEFAULT_VERBOSITY=1;; 868d466db85Smrg*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; 869d466db85Smrgesac 870d466db85SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl 871d466db85SmrgAM_BACKSLASH='\' 872d466db85SmrgAC_SUBST([AM_BACKSLASH])dnl 873d466db85Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl 874d838582fSmrg]) 875d838582fSmrg 876d838582fSmrg# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 877d838582fSmrg# 878d838582fSmrg# This file is free software; the Free Software Foundation 879d838582fSmrg# gives unlimited permission to copy and/or distribute it, 880d838582fSmrg# with or without modifications, as long as this notice is preserved. 881d838582fSmrg 882d466db85Smrg# AM_PROG_INSTALL_STRIP 883d466db85Smrg# --------------------- 884d466db85Smrg# One issue with vendor `install' (even GNU) is that you can't 885d466db85Smrg# specify the program used to strip binaries. This is especially 886d466db85Smrg# annoying in cross-compiling environments, where the build's strip 887d466db85Smrg# is unlikely to handle the host's binaries. 888d466db85Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we 889d466db85Smrg# always use install-sh in `make install-strip', and initialize 890d466db85Smrg# STRIPPROG with the value of the STRIP variable (set by the user). 891d466db85SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP], 892d466db85Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 893d466db85Smrg# Installed binaries are usually stripped using `strip' when the user 894d466db85Smrg# run `make install-strip'. However `strip' might not be the right 895d466db85Smrg# tool to use in cross-compilation environments, therefore Automake 896d466db85Smrg# will honor the `STRIP' environment variable to overrule this program. 897d466db85Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'. 898d466db85Smrgif test "$cross_compiling" != no; then 899d466db85Smrg AC_CHECK_TOOL([STRIP], [strip], :) 900d466db85Smrgfi 901d466db85SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" 902d466db85SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])]) 903d838582fSmrg 904d466db85Smrg# Copyright (C) 2006, 2008 Free Software Foundation, Inc. 905d838582fSmrg# 906d838582fSmrg# This file is free software; the Free Software Foundation 907d838582fSmrg# gives unlimited permission to copy and/or distribute it, 908d838582fSmrg# with or without modifications, as long as this notice is preserved. 909d838582fSmrg 910d838582fSmrg# serial 2 911d838582fSmrg 912d838582fSmrg# _AM_SUBST_NOTMAKE(VARIABLE) 913d838582fSmrg# --------------------------- 914d838582fSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. 915d838582fSmrg# This macro is traced by Automake. 916d838582fSmrgAC_DEFUN([_AM_SUBST_NOTMAKE]) 917d838582fSmrg 918d466db85Smrg# AM_SUBST_NOTMAKE(VARIABLE) 919d466db85Smrg# --------------------------- 920d466db85Smrg# Public sister of _AM_SUBST_NOTMAKE. 921d466db85SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) 922d466db85Smrg 923d838582fSmrg# Check how to create a tarball. -*- Autoconf -*- 924d838582fSmrg 925d838582fSmrg# Copyright (C) 2004, 2005 Free Software Foundation, Inc. 926d838582fSmrg# 927d838582fSmrg# This file is free software; the Free Software Foundation 928d838582fSmrg# gives unlimited permission to copy and/or distribute it, 929d838582fSmrg# with or without modifications, as long as this notice is preserved. 930d838582fSmrg 931d838582fSmrg# serial 2 932d838582fSmrg 933d838582fSmrg# _AM_PROG_TAR(FORMAT) 934d838582fSmrg# -------------------- 935d838582fSmrg# Check how to create a tarball in format FORMAT. 936d838582fSmrg# FORMAT should be one of `v7', `ustar', or `pax'. 937d838582fSmrg# 938d838582fSmrg# Substitute a variable $(am__tar) that is a command 939d838582fSmrg# writing to stdout a FORMAT-tarball containing the directory 940d838582fSmrg# $tardir. 941d838582fSmrg# tardir=directory && $(am__tar) > result.tar 942d838582fSmrg# 943d838582fSmrg# Substitute a variable $(am__untar) that extract such 944d838582fSmrg# a tarball read from stdin. 945d838582fSmrg# $(am__untar) < result.tar 946d838582fSmrgAC_DEFUN([_AM_PROG_TAR], 947d838582fSmrg[# Always define AMTAR for backward compatibility. 948d838582fSmrgAM_MISSING_PROG([AMTAR], [tar]) 949d838582fSmrgm4_if([$1], [v7], 950d838582fSmrg [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], 951d838582fSmrg [m4_case([$1], [ustar],, [pax],, 952d838582fSmrg [m4_fatal([Unknown tar format])]) 953d838582fSmrgAC_MSG_CHECKING([how to create a $1 tar archive]) 954d838582fSmrg# Loop over all known methods to create a tar archive until one works. 955d838582fSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' 956d838582fSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools} 957d838582fSmrg# Do not fold the above two line into one, because Tru64 sh and 958d838582fSmrg# Solaris sh will not grok spaces in the rhs of `-'. 959d838582fSmrgfor _am_tool in $_am_tools 960d838582fSmrgdo 961d838582fSmrg case $_am_tool in 962d838582fSmrg gnutar) 963d838582fSmrg for _am_tar in tar gnutar gtar; 964d838582fSmrg do 965d838582fSmrg AM_RUN_LOG([$_am_tar --version]) && break 966d838582fSmrg done 967d838582fSmrg am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' 968d838582fSmrg am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' 969d838582fSmrg am__untar="$_am_tar -xf -" 970d838582fSmrg ;; 971d838582fSmrg plaintar) 972d838582fSmrg # Must skip GNU tar: if it does not support --format= it doesn't create 973d838582fSmrg # ustar tarball either. 974d838582fSmrg (tar --version) >/dev/null 2>&1 && continue 975d838582fSmrg am__tar='tar chf - "$$tardir"' 976d838582fSmrg am__tar_='tar chf - "$tardir"' 977d838582fSmrg am__untar='tar xf -' 978d838582fSmrg ;; 979d838582fSmrg pax) 980d838582fSmrg am__tar='pax -L -x $1 -w "$$tardir"' 981d838582fSmrg am__tar_='pax -L -x $1 -w "$tardir"' 982d838582fSmrg am__untar='pax -r' 983d838582fSmrg ;; 984d838582fSmrg cpio) 985d838582fSmrg am__tar='find "$$tardir" -print | cpio -o -H $1 -L' 986d838582fSmrg am__tar_='find "$tardir" -print | cpio -o -H $1 -L' 987d838582fSmrg am__untar='cpio -i -H $1 -d' 988d838582fSmrg ;; 989d838582fSmrg none) 990d838582fSmrg am__tar=false 991d838582fSmrg am__tar_=false 992d838582fSmrg am__untar=false 993d838582fSmrg ;; 994d838582fSmrg esac 995d838582fSmrg 996d838582fSmrg # If the value was cached, stop now. We just wanted to have am__tar 997d838582fSmrg # and am__untar set. 998d838582fSmrg test -n "${am_cv_prog_tar_$1}" && break 999d838582fSmrg 1000d838582fSmrg # tar/untar a dummy directory, and stop if the command works 1001d838582fSmrg rm -rf conftest.dir 1002d838582fSmrg mkdir conftest.dir 1003d838582fSmrg echo GrepMe > conftest.dir/file 1004d838582fSmrg AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) 1005d838582fSmrg rm -rf conftest.dir 1006d838582fSmrg if test -s conftest.tar; then 1007d838582fSmrg AM_RUN_LOG([$am__untar <conftest.tar]) 1008d838582fSmrg grep GrepMe conftest.dir/file >/dev/null 2>&1 && break 1009d838582fSmrg fi 1010d838582fSmrgdone 1011d838582fSmrgrm -rf conftest.dir 1012d838582fSmrg 1013d838582fSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) 1014d838582fSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])]) 1015d838582fSmrgAC_SUBST([am__tar]) 1016d838582fSmrgAC_SUBST([am__untar]) 1017d838582fSmrg]) # _AM_PROG_TAR 1018d838582fSmrg 101955476c70Smrg# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- 102055476c70Smrg# 102155476c70Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>. 102255476c70Smrg# 102355476c70Smrg# This program is free software; you can redistribute it and/or modify 102455476c70Smrg# it under the terms of the GNU General Public License as published by 102555476c70Smrg# the Free Software Foundation; either version 2 of the License, or 102655476c70Smrg# (at your option) any later version. 102755476c70Smrg# 102855476c70Smrg# This program is distributed in the hope that it will be useful, but 102955476c70Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of 103055476c70Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 103155476c70Smrg# General Public License for more details. 103255476c70Smrg# 103355476c70Smrg# You should have received a copy of the GNU General Public License 103455476c70Smrg# along with this program; if not, write to the Free Software 103555476c70Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 103655476c70Smrg# 103755476c70Smrg# As a special exception to the GNU General Public License, if you 103855476c70Smrg# distribute this file as part of a program that contains a 103955476c70Smrg# configuration script generated by Autoconf, you may include it under 104055476c70Smrg# the same distribution terms that you use for the rest of that program. 104155476c70Smrg 104255476c70Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION]) 104355476c70Smrg# ---------------------------------- 104455476c70SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG], 104555476c70Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) 104655476c70Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$]) 104755476c70SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl 104855476c70Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then 104955476c70Smrg AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) 105055476c70Smrgfi 105155476c70Smrgif test -n "$PKG_CONFIG"; then 105255476c70Smrg _pkg_min_version=m4_default([$1], [0.9.0]) 105355476c70Smrg AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) 105455476c70Smrg if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then 105555476c70Smrg AC_MSG_RESULT([yes]) 105655476c70Smrg else 105755476c70Smrg AC_MSG_RESULT([no]) 105855476c70Smrg PKG_CONFIG="" 105955476c70Smrg fi 106055476c70Smrg 106155476c70Smrgfi[]dnl 106255476c70Smrg])# PKG_PROG_PKG_CONFIG 106355476c70Smrg 106455476c70Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 106555476c70Smrg# 106655476c70Smrg# Check to see whether a particular set of modules exists. Similar 106755476c70Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors. 106855476c70Smrg# 106955476c70Smrg# 107055476c70Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of 107155476c70Smrg# this or PKG_CHECK_MODULES is called, or make sure to call 107255476c70Smrg# PKG_CHECK_EXISTS manually 107355476c70Smrg# -------------------------------------------------------------- 107455476c70SmrgAC_DEFUN([PKG_CHECK_EXISTS], 107555476c70Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 107655476c70Smrgif test -n "$PKG_CONFIG" && \ 107755476c70Smrg AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then 107855476c70Smrg m4_ifval([$2], [$2], [:]) 107955476c70Smrgm4_ifvaln([$3], [else 108055476c70Smrg $3])dnl 108155476c70Smrgfi]) 108255476c70Smrg 108355476c70Smrg 108455476c70Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) 108555476c70Smrg# --------------------------------------------- 108655476c70Smrgm4_define([_PKG_CONFIG], 108755476c70Smrg[if test -n "$$1"; then 108855476c70Smrg pkg_cv_[]$1="$$1" 108955476c70Smrg elif test -n "$PKG_CONFIG"; then 109055476c70Smrg PKG_CHECK_EXISTS([$3], 109155476c70Smrg [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], 109255476c70Smrg [pkg_failed=yes]) 109355476c70Smrg else 109455476c70Smrg pkg_failed=untried 109555476c70Smrgfi[]dnl 109655476c70Smrg])# _PKG_CONFIG 109755476c70Smrg 109855476c70Smrg# _PKG_SHORT_ERRORS_SUPPORTED 109955476c70Smrg# ----------------------------- 110055476c70SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], 110155476c70Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 110255476c70Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then 110355476c70Smrg _pkg_short_errors_supported=yes 110455476c70Smrgelse 110555476c70Smrg _pkg_short_errors_supported=no 110655476c70Smrgfi[]dnl 110755476c70Smrg])# _PKG_SHORT_ERRORS_SUPPORTED 110855476c70Smrg 110955476c70Smrg 111055476c70Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], 111155476c70Smrg# [ACTION-IF-NOT-FOUND]) 111255476c70Smrg# 111355476c70Smrg# 111455476c70Smrg# Note that if there is a possibility the first call to 111555476c70Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an 111655476c70Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac 111755476c70Smrg# 111855476c70Smrg# 111955476c70Smrg# -------------------------------------------------------------- 112055476c70SmrgAC_DEFUN([PKG_CHECK_MODULES], 112155476c70Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 112255476c70SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl 112355476c70SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl 112455476c70Smrg 112555476c70Smrgpkg_failed=no 112655476c70SmrgAC_MSG_CHECKING([for $1]) 112755476c70Smrg 112855476c70Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) 112955476c70Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2]) 113055476c70Smrg 113155476c70Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS 113255476c70Smrgand $1[]_LIBS to avoid the need to call pkg-config. 113355476c70SmrgSee the pkg-config man page for more details.]) 113455476c70Smrg 113555476c70Smrgif test $pkg_failed = yes; then 113655476c70Smrg _PKG_SHORT_ERRORS_SUPPORTED 113755476c70Smrg if test $_pkg_short_errors_supported = yes; then 113855476c70Smrg $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` 113955476c70Smrg else 114055476c70Smrg $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` 114155476c70Smrg fi 114255476c70Smrg # Put the nasty error message in config.log where it belongs 114355476c70Smrg echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD 114455476c70Smrg 114555476c70Smrg ifelse([$4], , [AC_MSG_ERROR(dnl 114655476c70Smrg[Package requirements ($2) were not met: 114755476c70Smrg 114855476c70Smrg$$1_PKG_ERRORS 114955476c70Smrg 115055476c70SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you 115155476c70Smrginstalled software in a non-standard prefix. 115255476c70Smrg 115355476c70Smrg_PKG_TEXT 115455476c70Smrg])], 115555476c70Smrg [AC_MSG_RESULT([no]) 115655476c70Smrg $4]) 115755476c70Smrgelif test $pkg_failed = untried; then 115855476c70Smrg ifelse([$4], , [AC_MSG_FAILURE(dnl 115955476c70Smrg[The pkg-config script could not be found or is too old. Make sure it 116055476c70Smrgis in your PATH or set the PKG_CONFIG environment variable to the full 116155476c70Smrgpath to pkg-config. 116255476c70Smrg 116355476c70Smrg_PKG_TEXT 116455476c70Smrg 116555476c70SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])], 116655476c70Smrg [$4]) 116755476c70Smrgelse 116855476c70Smrg $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS 116955476c70Smrg $1[]_LIBS=$pkg_cv_[]$1[]_LIBS 117055476c70Smrg AC_MSG_RESULT([yes]) 117155476c70Smrg ifelse([$3], , :, [$3]) 117255476c70Smrgfi[]dnl 117355476c70Smrg])# PKG_CHECK_MODULES 117455476c70Smrg 1175d466db85Smrgdnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. 1176d466db85Smrgdnl 11771cca5e29Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. 1178d466db85Smrgdnl 1179d466db85Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a 11801cca5e29Smrgdnl copy of this software and associated documentation files (the "Software"), 11811cca5e29Smrgdnl to deal in the Software without restriction, including without limitation 11821cca5e29Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense, 11831cca5e29Smrgdnl and/or sell copies of the Software, and to permit persons to whom the 11841cca5e29Smrgdnl Software is furnished to do so, subject to the following conditions: 1185d466db85Smrgdnl 11861cca5e29Smrgdnl The above copyright notice and this permission notice (including the next 11871cca5e29Smrgdnl paragraph) shall be included in all copies or substantial portions of the 11881cca5e29Smrgdnl Software. 1189d466db85Smrgdnl 11901cca5e29Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 11911cca5e29Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 11921cca5e29Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 11931cca5e29Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 11941cca5e29Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 11951cca5e29Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 11961cca5e29Smrgdnl DEALINGS IN THE SOFTWARE. 1197d466db85Smrg 1198d466db85Smrg# XORG_MACROS_VERSION(required-version) 1199d466db85Smrg# ------------------------------------- 1200d466db85Smrg# Minimum version: 1.1.0 1201d466db85Smrg# 1202d466db85Smrg# If you're using a macro added in Version 1.1 or newer, include this in 1203d466db85Smrg# your configure.ac with the minimum required version, such as: 1204d466db85Smrg# XORG_MACROS_VERSION(1.1) 1205d466db85Smrg# 1206d466db85Smrg# To ensure that this macro is defined, also add: 1207d466db85Smrg# m4_ifndef([XORG_MACROS_VERSION], 1208d466db85Smrg# [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])]) 1209d466db85Smrg# 1210d466db85Smrg# 1211d466db85Smrg# See the "minimum version" comment for each macro you use to see what 1212d466db85Smrg# version you require. 1213d466db85Smrgm4_defun([XORG_MACROS_VERSION],[ 121455476c70Smrgm4_define([vers_have], [1.16.1]) 1215d466db85Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) 1216d466db85Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) 1217d466db85Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,, 1218d466db85Smrg [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])]) 1219d466db85Smrgm4_if(m4_version_compare(vers_have, [$1]), -1, 1220d466db85Smrg [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])]) 1221d466db85Smrgm4_undefine([vers_have]) 1222d466db85Smrgm4_undefine([maj_have]) 1223d466db85Smrgm4_undefine([maj_needed]) 1224d466db85Smrg]) # XORG_MACROS_VERSION 1225d466db85Smrg 1226d466db85Smrg# XORG_PROG_RAWCPP() 1227d466db85Smrg# ------------------ 1228d466db85Smrg# Minimum version: 1.0.0 1229d466db85Smrg# 1230d466db85Smrg# Find cpp program and necessary flags for use in pre-processing text files 1231d466db85Smrg# such as man pages and config files 1232d466db85SmrgAC_DEFUN([XORG_PROG_RAWCPP],[ 1233d466db85SmrgAC_REQUIRE([AC_PROG_CPP]) 1234d466db85SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 1235d466db85Smrg [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) 1236d466db85Smrg 1237d466db85Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined, 1238d466db85Smrg# which is not the best choice for supporting other OS'es, but covers most 1239d466db85Smrg# of the ones we need for now. 1240d466db85SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef]) 124155476c70SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])]) 1242d466db85Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 1243d466db85Smrg AC_MSG_RESULT([no]) 1244d466db85Smrgelse 1245d466db85Smrg if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 1246d466db85Smrg RAWCPPFLAGS=-undef 1247d466db85Smrg AC_MSG_RESULT([yes]) 1248d466db85Smrg # under Cygwin unix is still defined even with -undef 1249d466db85Smrg elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 1250d466db85Smrg RAWCPPFLAGS="-undef -ansi" 1251d466db85Smrg AC_MSG_RESULT([yes, with -ansi]) 1252d466db85Smrg else 1253d466db85Smrg AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.]) 1254d466db85Smrg fi 1255d466db85Smrgfi 1256d466db85Smrgrm -f conftest.$ac_ext 1257d466db85Smrg 1258d466db85SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional]) 125955476c70SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve "whitespace"?]])]) 1260d466db85Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 1261d466db85Smrg AC_MSG_RESULT([no]) 1262d466db85Smrgelse 1263d466db85Smrg if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 1264d466db85Smrg RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" 1265d466db85Smrg AC_MSG_RESULT([yes]) 1266d466db85Smrg else 1267d466db85Smrg AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) 1268d466db85Smrg fi 1269d466db85Smrgfi 1270d466db85Smrgrm -f conftest.$ac_ext 1271d466db85SmrgAC_SUBST(RAWCPPFLAGS) 1272d466db85Smrg]) # XORG_PROG_RAWCPP 1273d466db85Smrg 1274d466db85Smrg# XORG_MANPAGE_SECTIONS() 1275d466db85Smrg# ----------------------- 1276d466db85Smrg# Minimum version: 1.0.0 1277d466db85Smrg# 1278d466db85Smrg# Determine which sections man pages go in for the different man page types 1279d466db85Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. 1280d466db85Smrg# Not sure if there's any better way than just hardcoding by OS name. 1281d466db85Smrg# Override default settings by setting environment variables 12821cca5e29Smrg# Added MAN_SUBSTS in version 1.8 12831cca5e29Smrg# Added AC_PROG_SED in version 1.8 1284d466db85Smrg 1285d466db85SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[ 1286d466db85SmrgAC_REQUIRE([AC_CANONICAL_HOST]) 12871cca5e29SmrgAC_REQUIRE([AC_PROG_SED]) 1288d466db85Smrg 1289d466db85Smrgif test x$APP_MAN_SUFFIX = x ; then 1290d466db85Smrg APP_MAN_SUFFIX=1 1291d466db85Smrgfi 1292d466db85Smrgif test x$APP_MAN_DIR = x ; then 1293d466db85Smrg APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' 1294d466db85Smrgfi 1295d466db85Smrg 1296d466db85Smrgif test x$LIB_MAN_SUFFIX = x ; then 1297d466db85Smrg LIB_MAN_SUFFIX=3 1298d466db85Smrgfi 1299d466db85Smrgif test x$LIB_MAN_DIR = x ; then 1300d466db85Smrg LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' 1301d466db85Smrgfi 1302d466db85Smrg 1303d466db85Smrgif test x$FILE_MAN_SUFFIX = x ; then 1304d466db85Smrg case $host_os in 1305d466db85Smrg solaris*) FILE_MAN_SUFFIX=4 ;; 1306d466db85Smrg *) FILE_MAN_SUFFIX=5 ;; 1307d466db85Smrg esac 1308d466db85Smrgfi 1309d466db85Smrgif test x$FILE_MAN_DIR = x ; then 1310d466db85Smrg FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' 1311d466db85Smrgfi 1312d466db85Smrg 1313d466db85Smrgif test x$MISC_MAN_SUFFIX = x ; then 1314d466db85Smrg case $host_os in 1315d466db85Smrg solaris*) MISC_MAN_SUFFIX=5 ;; 1316d466db85Smrg *) MISC_MAN_SUFFIX=7 ;; 1317d466db85Smrg esac 1318d466db85Smrgfi 1319d466db85Smrgif test x$MISC_MAN_DIR = x ; then 1320d466db85Smrg MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' 1321d466db85Smrgfi 1322d466db85Smrg 1323d466db85Smrgif test x$DRIVER_MAN_SUFFIX = x ; then 1324d466db85Smrg case $host_os in 1325d466db85Smrg solaris*) DRIVER_MAN_SUFFIX=7 ;; 1326d466db85Smrg *) DRIVER_MAN_SUFFIX=4 ;; 1327d466db85Smrg esac 1328d466db85Smrgfi 1329d466db85Smrgif test x$DRIVER_MAN_DIR = x ; then 1330d466db85Smrg DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' 1331d466db85Smrgfi 1332d466db85Smrg 1333d466db85Smrgif test x$ADMIN_MAN_SUFFIX = x ; then 1334d466db85Smrg case $host_os in 1335d466db85Smrg solaris*) ADMIN_MAN_SUFFIX=1m ;; 1336d466db85Smrg *) ADMIN_MAN_SUFFIX=8 ;; 1337d466db85Smrg esac 1338d466db85Smrgfi 1339d466db85Smrgif test x$ADMIN_MAN_DIR = x ; then 1340d466db85Smrg ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' 1341d466db85Smrgfi 1342d466db85Smrg 1343d466db85Smrg 1344d466db85SmrgAC_SUBST([APP_MAN_SUFFIX]) 1345d466db85SmrgAC_SUBST([LIB_MAN_SUFFIX]) 1346d466db85SmrgAC_SUBST([FILE_MAN_SUFFIX]) 1347d466db85SmrgAC_SUBST([MISC_MAN_SUFFIX]) 1348d466db85SmrgAC_SUBST([DRIVER_MAN_SUFFIX]) 1349d466db85SmrgAC_SUBST([ADMIN_MAN_SUFFIX]) 1350d466db85SmrgAC_SUBST([APP_MAN_DIR]) 1351d466db85SmrgAC_SUBST([LIB_MAN_DIR]) 1352d466db85SmrgAC_SUBST([FILE_MAN_DIR]) 1353d466db85SmrgAC_SUBST([MISC_MAN_DIR]) 1354d466db85SmrgAC_SUBST([DRIVER_MAN_DIR]) 1355d466db85SmrgAC_SUBST([ADMIN_MAN_DIR]) 13561cca5e29Smrg 13571cca5e29SmrgXORG_MAN_PAGE="X Version 11" 13581cca5e29SmrgAC_SUBST([XORG_MAN_PAGE]) 13591cca5e29SmrgMAN_SUBSTS="\ 13601cca5e29Smrg -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ 13611cca5e29Smrg -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ 13621cca5e29Smrg -e 's|__xservername__|Xorg|g' \ 13631cca5e29Smrg -e 's|__xconfigfile__|xorg.conf|g' \ 13641cca5e29Smrg -e 's|__projectroot__|\$(prefix)|g' \ 13651cca5e29Smrg -e 's|__apploaddir__|\$(appdefaultdir)|g' \ 13661cca5e29Smrg -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \ 13671cca5e29Smrg -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \ 13681cca5e29Smrg -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \ 13691cca5e29Smrg -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \ 13701cca5e29Smrg -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \ 13711cca5e29Smrg -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'" 13721cca5e29SmrgAC_SUBST([MAN_SUBSTS]) 13731cca5e29Smrg 1374d466db85Smrg]) # XORG_MANPAGE_SECTIONS 1375d466db85Smrg 13761cca5e29Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION]) 13771cca5e29Smrg# ------------------------ 13781cca5e29Smrg# Minimum version: 1.7.0 13791cca5e29Smrg# 13801cca5e29Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent 13811cca5e29Smrg# provided by xorg-sgml-doctools, if installed. 13821cca5e29SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[ 13831cca5e29SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])]) 13841cca5e29SmrgXORG_SGML_PATH= 13851cca5e29SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])], 13861cca5e29Smrg [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`], 13871cca5e29Smrg [m4_ifval([$1],[:], 13881cca5e29Smrg [if test x"$cross_compiling" != x"yes" ; then 13891cca5e29Smrg AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent], 13901cca5e29Smrg [XORG_SGML_PATH=$prefix/share/sgml]) 13911cca5e29Smrg fi]) 13921cca5e29Smrg ]) 13931cca5e29Smrg 13941cca5e29Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing 13951cca5e29Smrg# the path and the name of the doc stylesheet 13961cca5e29Smrgif test "x$XORG_SGML_PATH" != "x" ; then 13971cca5e29Smrg AC_MSG_RESULT([$XORG_SGML_PATH]) 13981cca5e29Smrg STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11 13991cca5e29Smrg XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl 14001cca5e29Smrgelse 14011cca5e29Smrg AC_MSG_RESULT([no]) 14021cca5e29Smrgfi 14031cca5e29Smrg 14041cca5e29SmrgAC_SUBST(XORG_SGML_PATH) 14051cca5e29SmrgAC_SUBST(STYLESHEET_SRCDIR) 14061cca5e29SmrgAC_SUBST(XSL_STYLESHEET) 14071cca5e29SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"]) 14081cca5e29Smrg]) # XORG_CHECK_SGML_DOCTOOLS 14091cca5e29Smrg 1410d466db85Smrg# XORG_CHECK_LINUXDOC 1411d466db85Smrg# ------------------- 1412d466db85Smrg# Minimum version: 1.0.0 1413d466db85Smrg# 1414d466db85Smrg# Defines the variable MAKE_TEXT if the necessary tools and 1415d466db85Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. 1416d466db85Smrg# Whether or not the necessary tools and files are found can be checked 1417d466db85Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC" 1418d466db85SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[ 14191cca5e29SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) 14201cca5e29SmrgAC_REQUIRE([XORG_WITH_PS2PDF]) 1421d466db85Smrg 1422d466db85SmrgAC_PATH_PROG(LINUXDOC, linuxdoc) 1423d466db85Smrg 14241cca5e29SmrgAC_MSG_CHECKING([whether to build documentation]) 1425d466db85Smrg 14261cca5e29Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then 1427d466db85Smrg BUILDDOC=yes 1428d466db85Smrgelse 1429d466db85Smrg BUILDDOC=no 1430d466db85Smrgfi 1431d466db85Smrg 1432d466db85SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) 1433d466db85Smrg 1434d466db85SmrgAC_MSG_RESULT([$BUILDDOC]) 1435d466db85Smrg 14361cca5e29SmrgAC_MSG_CHECKING([whether to build pdf documentation]) 1437d466db85Smrg 14381cca5e29Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then 1439d466db85Smrg BUILDPDFDOC=yes 1440d466db85Smrgelse 1441d466db85Smrg BUILDPDFDOC=no 1442d466db85Smrgfi 1443d466db85Smrg 1444d466db85SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 1445d466db85Smrg 1446d466db85SmrgAC_MSG_RESULT([$BUILDPDFDOC]) 1447d466db85Smrg 14481cca5e29SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f" 1449d466db85SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps" 1450d466db85SmrgMAKE_PDF="$PS2PDF" 1451d466db85SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0" 1452d466db85Smrg 1453d466db85SmrgAC_SUBST(MAKE_TEXT) 1454d466db85SmrgAC_SUBST(MAKE_PS) 1455d466db85SmrgAC_SUBST(MAKE_PDF) 1456d466db85SmrgAC_SUBST(MAKE_HTML) 1457d466db85Smrg]) # XORG_CHECK_LINUXDOC 1458d466db85Smrg 1459d466db85Smrg# XORG_CHECK_DOCBOOK 1460d466db85Smrg# ------------------- 1461d466db85Smrg# Minimum version: 1.0.0 1462d466db85Smrg# 1463d466db85Smrg# Checks for the ability to build output formats from SGML DocBook source. 1464d466db85Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC" 1465d466db85Smrg# indicates whether the necessary tools and files are found and, if set, 1466d466db85Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx. 1467d466db85SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[ 14681cca5e29SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) 14691cca5e29Smrg 1470d466db85SmrgBUILDTXTDOC=no 1471d466db85SmrgBUILDPDFDOC=no 1472d466db85SmrgBUILDPSDOC=no 1473d466db85SmrgBUILDHTMLDOC=no 1474d466db85Smrg 1475d466db85SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps) 1476d466db85SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf) 1477d466db85SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html) 1478d466db85SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt) 1479d466db85Smrg 14801cca5e29SmrgAC_MSG_CHECKING([whether to build text documentation]) 14811cca5e29Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x && 1482d466db85Smrg test x$BUILD_TXTDOC != xno; then 1483d466db85Smrg BUILDTXTDOC=yes 1484d466db85Smrgfi 1485d466db85SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes]) 1486d466db85SmrgAC_MSG_RESULT([$BUILDTXTDOC]) 1487d466db85Smrg 14881cca5e29SmrgAC_MSG_CHECKING([whether to build PDF documentation]) 14891cca5e29Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x && 1490d466db85Smrg test x$BUILD_PDFDOC != xno; then 1491d466db85Smrg BUILDPDFDOC=yes 1492d466db85Smrgfi 1493d466db85SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 1494d466db85SmrgAC_MSG_RESULT([$BUILDPDFDOC]) 1495d466db85Smrg 14961cca5e29SmrgAC_MSG_CHECKING([whether to build PostScript documentation]) 14971cca5e29Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x && 1498d466db85Smrg test x$BUILD_PSDOC != xno; then 1499d466db85Smrg BUILDPSDOC=yes 1500d466db85Smrgfi 1501d466db85SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes]) 1502d466db85SmrgAC_MSG_RESULT([$BUILDPSDOC]) 1503d466db85Smrg 15041cca5e29SmrgAC_MSG_CHECKING([whether to build HTML documentation]) 15051cca5e29Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x && 1506d466db85Smrg test x$BUILD_HTMLDOC != xno; then 1507d466db85Smrg BUILDHTMLDOC=yes 1508d466db85Smrgfi 1509d466db85SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes]) 1510d466db85SmrgAC_MSG_RESULT([$BUILDHTMLDOC]) 1511d466db85Smrg 1512d466db85SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT" 1513d466db85SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS" 1514d466db85SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF" 1515d466db85SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML" 1516d466db85Smrg 1517d466db85SmrgAC_SUBST(MAKE_TEXT) 1518d466db85SmrgAC_SUBST(MAKE_PS) 1519d466db85SmrgAC_SUBST(MAKE_PDF) 1520d466db85SmrgAC_SUBST(MAKE_HTML) 1521d466db85Smrg]) # XORG_CHECK_DOCBOOK 1522d466db85Smrg 15231cca5e29Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT]) 15241cca5e29Smrg# ---------------- 15251cca5e29Smrg# Minimum version: 1.5.0 15261cca5e29Smrg# Minimum version for optional DEFAULT argument: 1.11.0 15271cca5e29Smrg# 15281cca5e29Smrg# Documentation tools are not always available on all platforms and sometimes 15291cca5e29Smrg# not at the appropriate level. This macro enables a module to test for the 15301cca5e29Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 15311cca5e29Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions 15321cca5e29Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified, 15331cca5e29Smrg# --with-xmlto assumes 'auto'. 15341cca5e29Smrg# 15351cca5e29Smrg# Interface to module: 15361cca5e29Smrg# HAVE_XMLTO: used in makefiles to conditionally generate documentation 15371cca5e29Smrg# XMLTO: returns the path of the xmlto program found 15381cca5e29Smrg# returns the path set by the user in the environment 15391cca5e29Smrg# --with-xmlto: 'yes' user instructs the module to use xmlto 15401cca5e29Smrg# 'no' user instructs the module not to use xmlto 15411cca5e29Smrg# 15421cca5e29Smrg# Added in version 1.10.0 15431cca5e29Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation 15441cca5e29Smrg# xmlto for text output requires either lynx, links, or w3m browsers 15451cca5e29Smrg# 15461cca5e29Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path. 15471cca5e29Smrg# 15481cca5e29SmrgAC_DEFUN([XORG_WITH_XMLTO],[ 15491cca5e29SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command]) 15501cca5e29Smrgm4_define([_defopt], m4_default([$2], [auto])) 15511cca5e29SmrgAC_ARG_WITH(xmlto, 15521cca5e29Smrg AS_HELP_STRING([--with-xmlto], 15531cca5e29Smrg [Use xmlto to regenerate documentation (default: ]_defopt[)]), 15541cca5e29Smrg [use_xmlto=$withval], [use_xmlto=]_defopt) 15551cca5e29Smrgm4_undefine([_defopt]) 15561cca5e29Smrg 15571cca5e29Smrgif test "x$use_xmlto" = x"auto"; then 15581cca5e29Smrg AC_PATH_PROG([XMLTO], [xmlto]) 15591cca5e29Smrg if test "x$XMLTO" = "x"; then 15601cca5e29Smrg AC_MSG_WARN([xmlto not found - documentation targets will be skipped]) 15611cca5e29Smrg have_xmlto=no 15621cca5e29Smrg else 15631cca5e29Smrg have_xmlto=yes 15641cca5e29Smrg fi 15651cca5e29Smrgelif test "x$use_xmlto" = x"yes" ; then 15661cca5e29Smrg AC_PATH_PROG([XMLTO], [xmlto]) 15671cca5e29Smrg if test "x$XMLTO" = "x"; then 15681cca5e29Smrg AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH]) 15691cca5e29Smrg fi 15701cca5e29Smrg have_xmlto=yes 15711cca5e29Smrgelif test "x$use_xmlto" = x"no" ; then 15721cca5e29Smrg if test "x$XMLTO" != "x"; then 15731cca5e29Smrg AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified]) 15741cca5e29Smrg fi 15751cca5e29Smrg have_xmlto=no 15761cca5e29Smrgelse 15771cca5e29Smrg AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no']) 15781cca5e29Smrgfi 15791cca5e29Smrg 15801cca5e29Smrg# Test for a minimum version of xmlto, if provided. 15811cca5e29Smrgm4_ifval([$1], 15821cca5e29Smrg[if test "$have_xmlto" = yes; then 15831cca5e29Smrg # scrape the xmlto version 15841cca5e29Smrg AC_MSG_CHECKING([the xmlto version]) 15851cca5e29Smrg xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3` 15861cca5e29Smrg AC_MSG_RESULT([$xmlto_version]) 15871cca5e29Smrg AS_VERSION_COMPARE([$xmlto_version], [$1], 15881cca5e29Smrg [if test "x$use_xmlto" = xauto; then 15891cca5e29Smrg AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed]) 15901cca5e29Smrg have_xmlto=no 15911cca5e29Smrg else 15921cca5e29Smrg AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed]) 15931cca5e29Smrg fi]) 15941cca5e29Smrgfi]) 15951cca5e29Smrg 15961cca5e29Smrg# Test for the ability of xmlto to generate a text target 15971cca5e29Smrghave_xmlto_text=no 15981cca5e29Smrgcat > conftest.xml << "EOF" 15991cca5e29SmrgEOF 16001cca5e29SmrgAS_IF([test "$have_xmlto" = yes], 16011cca5e29Smrg [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1], 16021cca5e29Smrg [have_xmlto_text=yes], 16031cca5e29Smrg [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])]) 16041cca5e29Smrgrm -f conftest.xml 16051cca5e29SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes]) 16061cca5e29SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes]) 16071cca5e29Smrg]) # XORG_WITH_XMLTO 16081cca5e29Smrg 160955476c70Smrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT]) 161055476c70Smrg# -------------------------------------------- 161155476c70Smrg# Minimum version: 1.12.0 161255476c70Smrg# Minimum version for optional DEFAULT argument: 1.12.0 161355476c70Smrg# 161455476c70Smrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative, 161555476c70Smrg# XML-based language used for the transformation of XML documents. 161655476c70Smrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents. 161755476c70Smrg# It is used under the cover by xmlto to generate html files from DocBook/XML. 161855476c70Smrg# The XSLT processor is often used as a standalone tool for transformations. 161955476c70Smrg# It should not be assumed that this tool is used only to work with documnetation. 162055476c70Smrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'. 162155476c70Smrg# 162255476c70Smrg# Interface to module: 162355476c70Smrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation 162455476c70Smrg# XSLTPROC: returns the path of the xsltproc program found 162555476c70Smrg# returns the path set by the user in the environment 162655476c70Smrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc 162755476c70Smrg# 'no' user instructs the module not to use xsltproc 162855476c70Smrg# have_xsltproc: returns yes if xsltproc found in PATH or no 162955476c70Smrg# 163055476c70Smrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path. 163155476c70Smrg# 163255476c70SmrgAC_DEFUN([XORG_WITH_XSLTPROC],[ 163355476c70SmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command]) 163455476c70Smrg# Preserves the interface, should it be implemented later 163555476c70Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])]) 163655476c70Smrgm4_define([_defopt], m4_default([$2], [auto])) 163755476c70SmrgAC_ARG_WITH(xsltproc, 163855476c70Smrg AS_HELP_STRING([--with-xsltproc], 163955476c70Smrg [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]), 164055476c70Smrg [use_xsltproc=$withval], [use_xsltproc=]_defopt) 164155476c70Smrgm4_undefine([_defopt]) 164255476c70Smrg 164355476c70Smrgif test "x$use_xsltproc" = x"auto"; then 164455476c70Smrg AC_PATH_PROG([XSLTPROC], [xsltproc]) 164555476c70Smrg if test "x$XSLTPROC" = "x"; then 164655476c70Smrg AC_MSG_WARN([xsltproc not found - cannot transform XML documents]) 164755476c70Smrg have_xsltproc=no 164855476c70Smrg else 164955476c70Smrg have_xsltproc=yes 165055476c70Smrg fi 165155476c70Smrgelif test "x$use_xsltproc" = x"yes" ; then 165255476c70Smrg AC_PATH_PROG([XSLTPROC], [xsltproc]) 165355476c70Smrg if test "x$XSLTPROC" = "x"; then 165455476c70Smrg AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH]) 165555476c70Smrg fi 165655476c70Smrg have_xsltproc=yes 165755476c70Smrgelif test "x$use_xsltproc" = x"no" ; then 165855476c70Smrg if test "x$XSLTPROC" != "x"; then 165955476c70Smrg AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified]) 166055476c70Smrg fi 166155476c70Smrg have_xsltproc=no 166255476c70Smrgelse 166355476c70Smrg AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no']) 166455476c70Smrgfi 166555476c70Smrg 166655476c70SmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes]) 166755476c70Smrg]) # XORG_WITH_XSLTPROC 166855476c70Smrg 166955476c70Smrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT]) 167055476c70Smrg# ---------------------------------------- 167155476c70Smrg# Minimum version: 1.15.0 167255476c70Smrg# 167355476c70Smrg# PERL (Practical Extraction and Report Language) is a language optimized for 167455476c70Smrg# scanning arbitrary text files, extracting information from those text files, 167555476c70Smrg# and printing reports based on that information. 167655476c70Smrg# 167755476c70Smrg# When DEFAULT is not specified, --with-perl assumes 'auto'. 167855476c70Smrg# 167955476c70Smrg# Interface to module: 168055476c70Smrg# HAVE_PERL: used in makefiles to conditionally scan text files 168155476c70Smrg# PERL: returns the path of the perl program found 168255476c70Smrg# returns the path set by the user in the environment 168355476c70Smrg# --with-perl: 'yes' user instructs the module to use perl 168455476c70Smrg# 'no' user instructs the module not to use perl 168555476c70Smrg# have_perl: returns yes if perl found in PATH or no 168655476c70Smrg# 168755476c70Smrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path. 168855476c70Smrg# 168955476c70SmrgAC_DEFUN([XORG_WITH_PERL],[ 169055476c70SmrgAC_ARG_VAR([PERL], [Path to perl command]) 169155476c70Smrg# Preserves the interface, should it be implemented later 169255476c70Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])]) 169355476c70Smrgm4_define([_defopt], m4_default([$2], [auto])) 169455476c70SmrgAC_ARG_WITH(perl, 169555476c70Smrg AS_HELP_STRING([--with-perl], 169655476c70Smrg [Use perl for extracting information from files (default: ]_defopt[)]), 169755476c70Smrg [use_perl=$withval], [use_perl=]_defopt) 169855476c70Smrgm4_undefine([_defopt]) 169955476c70Smrg 170055476c70Smrgif test "x$use_perl" = x"auto"; then 170155476c70Smrg AC_PATH_PROG([PERL], [perl]) 170255476c70Smrg if test "x$PERL" = "x"; then 170355476c70Smrg AC_MSG_WARN([perl not found - cannot extract information and report]) 170455476c70Smrg have_perl=no 170555476c70Smrg else 170655476c70Smrg have_perl=yes 170755476c70Smrg fi 170855476c70Smrgelif test "x$use_perl" = x"yes" ; then 170955476c70Smrg AC_PATH_PROG([PERL], [perl]) 171055476c70Smrg if test "x$PERL" = "x"; then 171155476c70Smrg AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH]) 171255476c70Smrg fi 171355476c70Smrg have_perl=yes 171455476c70Smrgelif test "x$use_perl" = x"no" ; then 171555476c70Smrg if test "x$PERL" != "x"; then 171655476c70Smrg AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified]) 171755476c70Smrg fi 171855476c70Smrg have_perl=no 171955476c70Smrgelse 172055476c70Smrg AC_MSG_ERROR([--with-perl expects 'yes' or 'no']) 172155476c70Smrgfi 172255476c70Smrg 172355476c70SmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes]) 172455476c70Smrg]) # XORG_WITH_PERL 172555476c70Smrg 17261cca5e29Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT]) 17271cca5e29Smrg# ---------------- 17281cca5e29Smrg# Minimum version: 1.5.0 17291cca5e29Smrg# Minimum version for optional DEFAULT argument: 1.11.0 17301cca5e29Smrg# 17311cca5e29Smrg# Documentation tools are not always available on all platforms and sometimes 17321cca5e29Smrg# not at the appropriate level. This macro enables a module to test for the 17331cca5e29Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 17341cca5e29Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions 17351cca5e29Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified, 17361cca5e29Smrg# --with-asciidoc assumes 'auto'. 17371cca5e29Smrg# 17381cca5e29Smrg# Interface to module: 17391cca5e29Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation 17401cca5e29Smrg# ASCIIDOC: returns the path of the asciidoc program found 17411cca5e29Smrg# returns the path set by the user in the environment 17421cca5e29Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc 17431cca5e29Smrg# 'no' user instructs the module not to use asciidoc 17441cca5e29Smrg# 17451cca5e29Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path. 17461cca5e29Smrg# 17471cca5e29SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[ 17481cca5e29SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command]) 17491cca5e29Smrgm4_define([_defopt], m4_default([$2], [auto])) 17501cca5e29SmrgAC_ARG_WITH(asciidoc, 17511cca5e29Smrg AS_HELP_STRING([--with-asciidoc], 17521cca5e29Smrg [Use asciidoc to regenerate documentation (default: ]_defopt[)]), 17531cca5e29Smrg [use_asciidoc=$withval], [use_asciidoc=]_defopt) 17541cca5e29Smrgm4_undefine([_defopt]) 17551cca5e29Smrg 17561cca5e29Smrgif test "x$use_asciidoc" = x"auto"; then 17571cca5e29Smrg AC_PATH_PROG([ASCIIDOC], [asciidoc]) 17581cca5e29Smrg if test "x$ASCIIDOC" = "x"; then 17591cca5e29Smrg AC_MSG_WARN([asciidoc not found - documentation targets will be skipped]) 17601cca5e29Smrg have_asciidoc=no 17611cca5e29Smrg else 17621cca5e29Smrg have_asciidoc=yes 17631cca5e29Smrg fi 17641cca5e29Smrgelif test "x$use_asciidoc" = x"yes" ; then 17651cca5e29Smrg AC_PATH_PROG([ASCIIDOC], [asciidoc]) 17661cca5e29Smrg if test "x$ASCIIDOC" = "x"; then 17671cca5e29Smrg AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH]) 17681cca5e29Smrg fi 17691cca5e29Smrg have_asciidoc=yes 17701cca5e29Smrgelif test "x$use_asciidoc" = x"no" ; then 17711cca5e29Smrg if test "x$ASCIIDOC" != "x"; then 17721cca5e29Smrg AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified]) 17731cca5e29Smrg fi 17741cca5e29Smrg have_asciidoc=no 17751cca5e29Smrgelse 17761cca5e29Smrg AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no']) 17771cca5e29Smrgfi 17781cca5e29Smrgm4_ifval([$1], 17791cca5e29Smrg[if test "$have_asciidoc" = yes; then 17801cca5e29Smrg # scrape the asciidoc version 17811cca5e29Smrg AC_MSG_CHECKING([the asciidoc version]) 17821cca5e29Smrg asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2` 17831cca5e29Smrg AC_MSG_RESULT([$asciidoc_version]) 17841cca5e29Smrg AS_VERSION_COMPARE([$asciidoc_version], [$1], 17851cca5e29Smrg [if test "x$use_asciidoc" = xauto; then 17861cca5e29Smrg AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed]) 17871cca5e29Smrg have_asciidoc=no 17881cca5e29Smrg else 17891cca5e29Smrg AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed]) 17901cca5e29Smrg fi]) 17911cca5e29Smrgfi]) 17921cca5e29SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes]) 17931cca5e29Smrg]) # XORG_WITH_ASCIIDOC 17941cca5e29Smrg 17951cca5e29Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT]) 17961cca5e29Smrg# -------------------------------- 17971cca5e29Smrg# Minimum version: 1.5.0 17981cca5e29Smrg# Minimum version for optional DEFAULT argument: 1.11.0 17991cca5e29Smrg# 18001cca5e29Smrg# Documentation tools are not always available on all platforms and sometimes 18011cca5e29Smrg# not at the appropriate level. This macro enables a module to test for the 18021cca5e29Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 18031cca5e29Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions 18041cca5e29Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified, 18051cca5e29Smrg# --with-doxygen assumes 'auto'. 18061cca5e29Smrg# 18071cca5e29Smrg# Interface to module: 18081cca5e29Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation 18091cca5e29Smrg# DOXYGEN: returns the path of the doxygen program found 18101cca5e29Smrg# returns the path set by the user in the environment 18111cca5e29Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen 18121cca5e29Smrg# 'no' user instructs the module not to use doxygen 18131cca5e29Smrg# 18141cca5e29Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path. 18151cca5e29Smrg# 18161cca5e29SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[ 18171cca5e29SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command]) 18181cca5e29Smrgm4_define([_defopt], m4_default([$2], [auto])) 18191cca5e29SmrgAC_ARG_WITH(doxygen, 18201cca5e29Smrg AS_HELP_STRING([--with-doxygen], 18211cca5e29Smrg [Use doxygen to regenerate documentation (default: ]_defopt[)]), 18221cca5e29Smrg [use_doxygen=$withval], [use_doxygen=]_defopt) 18231cca5e29Smrgm4_undefine([_defopt]) 18241cca5e29Smrg 18251cca5e29Smrgif test "x$use_doxygen" = x"auto"; then 18261cca5e29Smrg AC_PATH_PROG([DOXYGEN], [doxygen]) 18271cca5e29Smrg if test "x$DOXYGEN" = "x"; then 18281cca5e29Smrg AC_MSG_WARN([doxygen not found - documentation targets will be skipped]) 18291cca5e29Smrg have_doxygen=no 18301cca5e29Smrg else 18311cca5e29Smrg have_doxygen=yes 18321cca5e29Smrg fi 18331cca5e29Smrgelif test "x$use_doxygen" = x"yes" ; then 18341cca5e29Smrg AC_PATH_PROG([DOXYGEN], [doxygen]) 18351cca5e29Smrg if test "x$DOXYGEN" = "x"; then 18361cca5e29Smrg AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH]) 18371cca5e29Smrg fi 18381cca5e29Smrg have_doxygen=yes 18391cca5e29Smrgelif test "x$use_doxygen" = x"no" ; then 18401cca5e29Smrg if test "x$DOXYGEN" != "x"; then 18411cca5e29Smrg AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified]) 18421cca5e29Smrg fi 18431cca5e29Smrg have_doxygen=no 18441cca5e29Smrgelse 18451cca5e29Smrg AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no']) 18461cca5e29Smrgfi 18471cca5e29Smrgm4_ifval([$1], 18481cca5e29Smrg[if test "$have_doxygen" = yes; then 18491cca5e29Smrg # scrape the doxygen version 18501cca5e29Smrg AC_MSG_CHECKING([the doxygen version]) 18511cca5e29Smrg doxygen_version=`$DOXYGEN --version 2>/dev/null` 18521cca5e29Smrg AC_MSG_RESULT([$doxygen_version]) 18531cca5e29Smrg AS_VERSION_COMPARE([$doxygen_version], [$1], 18541cca5e29Smrg [if test "x$use_doxygen" = xauto; then 18551cca5e29Smrg AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed]) 18561cca5e29Smrg have_doxygen=no 18571cca5e29Smrg else 18581cca5e29Smrg AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed]) 18591cca5e29Smrg fi]) 18601cca5e29Smrgfi]) 18611cca5e29SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes]) 18621cca5e29Smrg]) # XORG_WITH_DOXYGEN 18631cca5e29Smrg 18641cca5e29Smrg# XORG_WITH_GROFF([DEFAULT]) 18651cca5e29Smrg# ---------------- 18661cca5e29Smrg# Minimum version: 1.6.0 18671cca5e29Smrg# Minimum version for optional DEFAULT argument: 1.11.0 18681cca5e29Smrg# 18691cca5e29Smrg# Documentation tools are not always available on all platforms and sometimes 18701cca5e29Smrg# not at the appropriate level. This macro enables a module to test for the 18711cca5e29Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 18721cca5e29Smrg# the --with-groff option, it allows maximum flexibilty in making decisions 18731cca5e29Smrg# as whether or not to use the groff package. When DEFAULT is not specified, 18741cca5e29Smrg# --with-groff assumes 'auto'. 18751cca5e29Smrg# 18761cca5e29Smrg# Interface to module: 18771cca5e29Smrg# HAVE_GROFF: used in makefiles to conditionally generate documentation 18781cca5e29Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package 18791cca5e29Smrg# HAVE_GROFF_MS: the -ms macros package 18801cca5e29Smrg# GROFF: returns the path of the groff program found 18811cca5e29Smrg# returns the path set by the user in the environment 18821cca5e29Smrg# --with-groff: 'yes' user instructs the module to use groff 18831cca5e29Smrg# 'no' user instructs the module not to use groff 18841cca5e29Smrg# 18851cca5e29Smrg# Added in version 1.9.0: 18861cca5e29Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format: 18871cca5e29Smrg# pnmcut pnmcrop pnmtopng pnmtops from the netpbm package. 18881cca5e29Smrg# psselect from the psutils package. 18891cca5e29Smrg# the ghostcript package. Refer to the grohtml man pages 18901cca5e29Smrg# 18911cca5e29Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path. 18921cca5e29Smrg# 18931cca5e29Smrg# OS and distros often splits groff in a basic and full package, the former 18941cca5e29Smrg# having the groff program and the later having devices, fonts and macros 18951cca5e29Smrg# Checking for the groff executable is not enough. 18961cca5e29Smrg# 18971cca5e29Smrg# If macros are missing, we cannot assume that groff is useless, so we don't 18981cca5e29Smrg# unset HAVE_GROFF or GROFF env variables. 18991cca5e29Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false. 19001cca5e29Smrg# 19011cca5e29SmrgAC_DEFUN([XORG_WITH_GROFF],[ 19021cca5e29SmrgAC_ARG_VAR([GROFF], [Path to groff command]) 19031cca5e29Smrgm4_define([_defopt], m4_default([$1], [auto])) 19041cca5e29SmrgAC_ARG_WITH(groff, 19051cca5e29Smrg AS_HELP_STRING([--with-groff], 19061cca5e29Smrg [Use groff to regenerate documentation (default: ]_defopt[)]), 19071cca5e29Smrg [use_groff=$withval], [use_groff=]_defopt) 19081cca5e29Smrgm4_undefine([_defopt]) 19091cca5e29Smrg 19101cca5e29Smrgif test "x$use_groff" = x"auto"; then 19111cca5e29Smrg AC_PATH_PROG([GROFF], [groff]) 19121cca5e29Smrg if test "x$GROFF" = "x"; then 19131cca5e29Smrg AC_MSG_WARN([groff not found - documentation targets will be skipped]) 19141cca5e29Smrg have_groff=no 19151cca5e29Smrg else 19161cca5e29Smrg have_groff=yes 19171cca5e29Smrg fi 19181cca5e29Smrgelif test "x$use_groff" = x"yes" ; then 19191cca5e29Smrg AC_PATH_PROG([GROFF], [groff]) 19201cca5e29Smrg if test "x$GROFF" = "x"; then 19211cca5e29Smrg AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH]) 19221cca5e29Smrg fi 19231cca5e29Smrg have_groff=yes 19241cca5e29Smrgelif test "x$use_groff" = x"no" ; then 19251cca5e29Smrg if test "x$GROFF" != "x"; then 19261cca5e29Smrg AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified]) 19271cca5e29Smrg fi 19281cca5e29Smrg have_groff=no 19291cca5e29Smrgelse 19301cca5e29Smrg AC_MSG_ERROR([--with-groff expects 'yes' or 'no']) 19311cca5e29Smrgfi 19321cca5e29Smrg 19331cca5e29Smrg# We have groff, test for the presence of the macro packages 19341cca5e29Smrgif test "x$have_groff" = x"yes"; then 19351cca5e29Smrg AC_MSG_CHECKING([for ${GROFF} -ms macros]) 19361cca5e29Smrg if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then 19371cca5e29Smrg groff_ms_works=yes 19381cca5e29Smrg else 19391cca5e29Smrg groff_ms_works=no 19401cca5e29Smrg fi 19411cca5e29Smrg AC_MSG_RESULT([$groff_ms_works]) 19421cca5e29Smrg AC_MSG_CHECKING([for ${GROFF} -mm macros]) 19431cca5e29Smrg if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then 19441cca5e29Smrg groff_mm_works=yes 19451cca5e29Smrg else 19461cca5e29Smrg groff_mm_works=no 19471cca5e29Smrg fi 19481cca5e29Smrg AC_MSG_RESULT([$groff_mm_works]) 19491cca5e29Smrgfi 19501cca5e29Smrg 19511cca5e29Smrg# We have groff, test for HTML dependencies, one command per package 19521cca5e29Smrgif test "x$have_groff" = x"yes"; then 19531cca5e29Smrg AC_PATH_PROGS(GS_PATH, [gs gswin32c]) 19541cca5e29Smrg AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng]) 19551cca5e29Smrg AC_PATH_PROG(PSSELECT_PATH, [psselect]) 19561cca5e29Smrg if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then 19571cca5e29Smrg have_groff_html=yes 19581cca5e29Smrg else 19591cca5e29Smrg have_groff_html=no 19601cca5e29Smrg AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages]) 19611cca5e29Smrg fi 19621cca5e29Smrgfi 19631cca5e29Smrg 19641cca5e29Smrg# Set Automake conditionals for Makefiles 19651cca5e29SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes]) 19661cca5e29SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes]) 19671cca5e29SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes]) 19681cca5e29SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes]) 19691cca5e29Smrg]) # XORG_WITH_GROFF 19701cca5e29Smrg 197155476c70Smrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT]) 197255476c70Smrg# --------------------------------------- 19731cca5e29Smrg# Minimum version: 1.6.0 19741cca5e29Smrg# Minimum version for optional DEFAULT argument: 1.11.0 197555476c70Smrg# Minimum version for optional MIN-VERSION argument: 1.15.0 19761cca5e29Smrg# 19771cca5e29Smrg# Documentation tools are not always available on all platforms and sometimes 19781cca5e29Smrg# not at the appropriate level. This macro enables a module to test for the 19791cca5e29Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 19801cca5e29Smrg# the --with-fop option, it allows maximum flexibilty in making decisions 19811cca5e29Smrg# as whether or not to use the fop package. When DEFAULT is not specified, 19821cca5e29Smrg# --with-fop assumes 'auto'. 19831cca5e29Smrg# 19841cca5e29Smrg# Interface to module: 19851cca5e29Smrg# HAVE_FOP: used in makefiles to conditionally generate documentation 19861cca5e29Smrg# FOP: returns the path of the fop program found 19871cca5e29Smrg# returns the path set by the user in the environment 19881cca5e29Smrg# --with-fop: 'yes' user instructs the module to use fop 19891cca5e29Smrg# 'no' user instructs the module not to use fop 19901cca5e29Smrg# 19911cca5e29Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path. 19921cca5e29Smrg# 19931cca5e29SmrgAC_DEFUN([XORG_WITH_FOP],[ 19941cca5e29SmrgAC_ARG_VAR([FOP], [Path to fop command]) 199555476c70Smrgm4_define([_defopt], m4_default([$2], [auto])) 19961cca5e29SmrgAC_ARG_WITH(fop, 19971cca5e29Smrg AS_HELP_STRING([--with-fop], 19981cca5e29Smrg [Use fop to regenerate documentation (default: ]_defopt[)]), 19991cca5e29Smrg [use_fop=$withval], [use_fop=]_defopt) 20001cca5e29Smrgm4_undefine([_defopt]) 20011cca5e29Smrg 20021cca5e29Smrgif test "x$use_fop" = x"auto"; then 20031cca5e29Smrg AC_PATH_PROG([FOP], [fop]) 20041cca5e29Smrg if test "x$FOP" = "x"; then 20051cca5e29Smrg AC_MSG_WARN([fop not found - documentation targets will be skipped]) 20061cca5e29Smrg have_fop=no 20071cca5e29Smrg else 20081cca5e29Smrg have_fop=yes 20091cca5e29Smrg fi 20101cca5e29Smrgelif test "x$use_fop" = x"yes" ; then 20111cca5e29Smrg AC_PATH_PROG([FOP], [fop]) 20121cca5e29Smrg if test "x$FOP" = "x"; then 20131cca5e29Smrg AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH]) 20141cca5e29Smrg fi 20151cca5e29Smrg have_fop=yes 20161cca5e29Smrgelif test "x$use_fop" = x"no" ; then 20171cca5e29Smrg if test "x$FOP" != "x"; then 20181cca5e29Smrg AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified]) 20191cca5e29Smrg fi 20201cca5e29Smrg have_fop=no 20211cca5e29Smrgelse 20221cca5e29Smrg AC_MSG_ERROR([--with-fop expects 'yes' or 'no']) 20231cca5e29Smrgfi 202455476c70Smrg 202555476c70Smrg# Test for a minimum version of fop, if provided. 202655476c70Smrgm4_ifval([$1], 202755476c70Smrg[if test "$have_fop" = yes; then 202855476c70Smrg # scrape the fop version 202955476c70Smrg AC_MSG_CHECKING([for fop minimum version]) 203055476c70Smrg fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3` 203155476c70Smrg AC_MSG_RESULT([$fop_version]) 203255476c70Smrg AS_VERSION_COMPARE([$fop_version], [$1], 203355476c70Smrg [if test "x$use_fop" = xauto; then 203455476c70Smrg AC_MSG_WARN([fop version $fop_version found, but $1 needed]) 203555476c70Smrg have_fop=no 203655476c70Smrg else 203755476c70Smrg AC_MSG_ERROR([fop version $fop_version found, but $1 needed]) 203855476c70Smrg fi]) 203955476c70Smrgfi]) 20401cca5e29SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes]) 20411cca5e29Smrg]) # XORG_WITH_FOP 20421cca5e29Smrg 20431cca5e29Smrg# XORG_WITH_PS2PDF([DEFAULT]) 20441cca5e29Smrg# ---------------- 20451cca5e29Smrg# Minimum version: 1.6.0 20461cca5e29Smrg# Minimum version for optional DEFAULT argument: 1.11.0 20471cca5e29Smrg# 20481cca5e29Smrg# Documentation tools are not always available on all platforms and sometimes 20491cca5e29Smrg# not at the appropriate level. This macro enables a module to test for the 20501cca5e29Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 20511cca5e29Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions 20521cca5e29Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified, 20531cca5e29Smrg# --with-ps2pdf assumes 'auto'. 20541cca5e29Smrg# 20551cca5e29Smrg# Interface to module: 20561cca5e29Smrg# HAVE_PS2PDF: used in makefiles to conditionally generate documentation 20571cca5e29Smrg# PS2PDF: returns the path of the ps2pdf program found 20581cca5e29Smrg# returns the path set by the user in the environment 20591cca5e29Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf 20601cca5e29Smrg# 'no' user instructs the module not to use ps2pdf 20611cca5e29Smrg# 20621cca5e29Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path. 20631cca5e29Smrg# 20641cca5e29SmrgAC_DEFUN([XORG_WITH_PS2PDF],[ 20651cca5e29SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command]) 20661cca5e29Smrgm4_define([_defopt], m4_default([$1], [auto])) 20671cca5e29SmrgAC_ARG_WITH(ps2pdf, 20681cca5e29Smrg AS_HELP_STRING([--with-ps2pdf], 20691cca5e29Smrg [Use ps2pdf to regenerate documentation (default: ]_defopt[)]), 20701cca5e29Smrg [use_ps2pdf=$withval], [use_ps2pdf=]_defopt) 20711cca5e29Smrgm4_undefine([_defopt]) 20721cca5e29Smrg 20731cca5e29Smrgif test "x$use_ps2pdf" = x"auto"; then 20741cca5e29Smrg AC_PATH_PROG([PS2PDF], [ps2pdf]) 20751cca5e29Smrg if test "x$PS2PDF" = "x"; then 20761cca5e29Smrg AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped]) 20771cca5e29Smrg have_ps2pdf=no 20781cca5e29Smrg else 20791cca5e29Smrg have_ps2pdf=yes 20801cca5e29Smrg fi 20811cca5e29Smrgelif test "x$use_ps2pdf" = x"yes" ; then 20821cca5e29Smrg AC_PATH_PROG([PS2PDF], [ps2pdf]) 20831cca5e29Smrg if test "x$PS2PDF" = "x"; then 20841cca5e29Smrg AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH]) 20851cca5e29Smrg fi 20861cca5e29Smrg have_ps2pdf=yes 20871cca5e29Smrgelif test "x$use_ps2pdf" = x"no" ; then 20881cca5e29Smrg if test "x$PS2PDF" != "x"; then 20891cca5e29Smrg AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified]) 20901cca5e29Smrg fi 20911cca5e29Smrg have_ps2pdf=no 20921cca5e29Smrgelse 20931cca5e29Smrg AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no']) 20941cca5e29Smrgfi 20951cca5e29SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes]) 20961cca5e29Smrg]) # XORG_WITH_PS2PDF 20971cca5e29Smrg 20981cca5e29Smrg# XORG_ENABLE_DOCS (enable_docs=yes) 20991cca5e29Smrg# ---------------- 21001cca5e29Smrg# Minimum version: 1.6.0 21011cca5e29Smrg# 21021cca5e29Smrg# Documentation tools are not always available on all platforms and sometimes 21031cca5e29Smrg# not at the appropriate level. This macro enables a builder to skip all 21041cca5e29Smrg# documentation targets except traditional man pages. 21051cca5e29Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 21061cca5e29Smrg# maximum flexibilty in controlling documentation building. 21071cca5e29Smrg# Refer to: 21081cca5e29Smrg# XORG_WITH_XMLTO --with-xmlto 21091cca5e29Smrg# XORG_WITH_ASCIIDOC --with-asciidoc 21101cca5e29Smrg# XORG_WITH_DOXYGEN --with-doxygen 21111cca5e29Smrg# XORG_WITH_FOP --with-fop 21121cca5e29Smrg# XORG_WITH_GROFF --with-groff 21131cca5e29Smrg# XORG_WITH_PS2PDF --with-ps2pdf 21141cca5e29Smrg# 21151cca5e29Smrg# Interface to module: 21161cca5e29Smrg# ENABLE_DOCS: used in makefiles to conditionally generate documentation 21171cca5e29Smrg# --enable-docs: 'yes' user instructs the module to generate docs 21181cca5e29Smrg# 'no' user instructs the module not to generate docs 21191cca5e29Smrg# parm1: specify the default value, yes or no. 21201cca5e29Smrg# 21211cca5e29SmrgAC_DEFUN([XORG_ENABLE_DOCS],[ 212255476c70Smrgm4_define([docs_default], m4_default([$1], [yes])) 21231cca5e29SmrgAC_ARG_ENABLE(docs, 21241cca5e29Smrg AS_HELP_STRING([--enable-docs], 212555476c70Smrg [Enable building the documentation (default: ]docs_default[)]), 212655476c70Smrg [build_docs=$enableval], [build_docs=]docs_default) 212755476c70Smrgm4_undefine([docs_default]) 21281cca5e29SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes]) 21291cca5e29SmrgAC_MSG_CHECKING([whether to build documentation]) 21301cca5e29SmrgAC_MSG_RESULT([$build_docs]) 21311cca5e29Smrg]) # XORG_ENABLE_DOCS 21321cca5e29Smrg 21331cca5e29Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes) 21341cca5e29Smrg# ---------------- 21351cca5e29Smrg# Minimum version: 1.6.0 21361cca5e29Smrg# 21371cca5e29Smrg# This macro enables a builder to skip all developer documentation. 21381cca5e29Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 21391cca5e29Smrg# maximum flexibilty in controlling documentation building. 21401cca5e29Smrg# Refer to: 21411cca5e29Smrg# XORG_WITH_XMLTO --with-xmlto 21421cca5e29Smrg# XORG_WITH_ASCIIDOC --with-asciidoc 21431cca5e29Smrg# XORG_WITH_DOXYGEN --with-doxygen 21441cca5e29Smrg# XORG_WITH_FOP --with-fop 21451cca5e29Smrg# XORG_WITH_GROFF --with-groff 21461cca5e29Smrg# XORG_WITH_PS2PDF --with-ps2pdf 21471cca5e29Smrg# 21481cca5e29Smrg# Interface to module: 21491cca5e29Smrg# ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs 21501cca5e29Smrg# --enable-devel-docs: 'yes' user instructs the module to generate developer docs 21511cca5e29Smrg# 'no' user instructs the module not to generate developer docs 21521cca5e29Smrg# parm1: specify the default value, yes or no. 21531cca5e29Smrg# 21541cca5e29SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[ 21551cca5e29Smrgm4_define([devel_default], m4_default([$1], [yes])) 21561cca5e29SmrgAC_ARG_ENABLE(devel-docs, 21571cca5e29Smrg AS_HELP_STRING([--enable-devel-docs], 21581cca5e29Smrg [Enable building the developer documentation (default: ]devel_default[)]), 21591cca5e29Smrg [build_devel_docs=$enableval], [build_devel_docs=]devel_default) 21601cca5e29Smrgm4_undefine([devel_default]) 21611cca5e29SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes]) 21621cca5e29SmrgAC_MSG_CHECKING([whether to build developer documentation]) 21631cca5e29SmrgAC_MSG_RESULT([$build_devel_docs]) 21641cca5e29Smrg]) # XORG_ENABLE_DEVEL_DOCS 21651cca5e29Smrg 21661cca5e29Smrg# XORG_ENABLE_SPECS (enable_specs=yes) 21671cca5e29Smrg# ---------------- 21681cca5e29Smrg# Minimum version: 1.6.0 21691cca5e29Smrg# 21701cca5e29Smrg# This macro enables a builder to skip all functional specification targets. 21711cca5e29Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 21721cca5e29Smrg# maximum flexibilty in controlling documentation building. 21731cca5e29Smrg# Refer to: 21741cca5e29Smrg# XORG_WITH_XMLTO --with-xmlto 21751cca5e29Smrg# XORG_WITH_ASCIIDOC --with-asciidoc 21761cca5e29Smrg# XORG_WITH_DOXYGEN --with-doxygen 21771cca5e29Smrg# XORG_WITH_FOP --with-fop 21781cca5e29Smrg# XORG_WITH_GROFF --with-groff 21791cca5e29Smrg# XORG_WITH_PS2PDF --with-ps2pdf 21801cca5e29Smrg# 21811cca5e29Smrg# Interface to module: 21821cca5e29Smrg# ENABLE_SPECS: used in makefiles to conditionally generate specs 21831cca5e29Smrg# --enable-specs: 'yes' user instructs the module to generate specs 21841cca5e29Smrg# 'no' user instructs the module not to generate specs 21851cca5e29Smrg# parm1: specify the default value, yes or no. 21861cca5e29Smrg# 21871cca5e29SmrgAC_DEFUN([XORG_ENABLE_SPECS],[ 21881cca5e29Smrgm4_define([spec_default], m4_default([$1], [yes])) 21891cca5e29SmrgAC_ARG_ENABLE(specs, 21901cca5e29Smrg AS_HELP_STRING([--enable-specs], 21911cca5e29Smrg [Enable building the specs (default: ]spec_default[)]), 21921cca5e29Smrg [build_specs=$enableval], [build_specs=]spec_default) 21931cca5e29Smrgm4_undefine([spec_default]) 21941cca5e29SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes]) 21951cca5e29SmrgAC_MSG_CHECKING([whether to build functional specifications]) 21961cca5e29SmrgAC_MSG_RESULT([$build_specs]) 21971cca5e29Smrg]) # XORG_ENABLE_SPECS 21981cca5e29Smrg 219955476c70Smrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto) 220055476c70Smrg# ---------------------------------------------- 220155476c70Smrg# Minimum version: 1.13.0 220255476c70Smrg# 220355476c70Smrg# This macro enables a builder to enable/disable unit testing 220455476c70Smrg# It makes no assumption about the test cases implementation 220555476c70Smrg# Test cases may or may not use Automake "Support for test suites" 220655476c70Smrg# They may or may not use the software utility library GLib 220755476c70Smrg# 220855476c70Smrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL 220955476c70Smrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib. 221055476c70Smrg# The variable enable_unit_tests is used by other macros in this file. 221155476c70Smrg# 221255476c70Smrg# Interface to module: 221355476c70Smrg# ENABLE_UNIT_TESTS: used in makefiles to conditionally build tests 221455476c70Smrg# enable_unit_tests: used in configure.ac for additional configuration 221555476c70Smrg# --enable-unit-tests: 'yes' user instructs the module to build tests 221655476c70Smrg# 'no' user instructs the module not to build tests 221755476c70Smrg# parm1: specify the default value, yes or no. 221855476c70Smrg# 221955476c70SmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[ 222055476c70SmrgAC_BEFORE([$0], [XORG_WITH_GLIB]) 222155476c70SmrgAC_BEFORE([$0], [XORG_LD_WRAP]) 222255476c70SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS]) 222355476c70Smrgm4_define([_defopt], m4_default([$1], [auto])) 222455476c70SmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests], 222555476c70Smrg [Enable building unit test cases (default: ]_defopt[)]), 222655476c70Smrg [enable_unit_tests=$enableval], [enable_unit_tests=]_defopt) 222755476c70Smrgm4_undefine([_defopt]) 222855476c70SmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno]) 222955476c70SmrgAC_MSG_CHECKING([whether to build unit test cases]) 223055476c70SmrgAC_MSG_RESULT([$enable_unit_tests]) 223155476c70Smrg]) # XORG_ENABLE_UNIT_TESTS 223255476c70Smrg 223355476c70Smrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT]) 223455476c70Smrg# ---------------------------------------- 223555476c70Smrg# Minimum version: 1.13.0 223655476c70Smrg# 223755476c70Smrg# GLib is a library which provides advanced data structures and functions. 223855476c70Smrg# This macro enables a module to test for the presence of Glib. 223955476c70Smrg# 224055476c70Smrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing. 224155476c70Smrg# Otherwise the value of $enable_unit_tests is blank. 224255476c70Smrg# 224355476c70Smrg# Interface to module: 224455476c70Smrg# HAVE_GLIB: used in makefiles to conditionally build targets 224555476c70Smrg# with_glib: used in configure.ac to know if GLib has been found 224655476c70Smrg# --with-glib: 'yes' user instructs the module to use glib 224755476c70Smrg# 'no' user instructs the module not to use glib 224855476c70Smrg# 224955476c70SmrgAC_DEFUN([XORG_WITH_GLIB],[ 225055476c70SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG]) 225155476c70Smrgm4_define([_defopt], m4_default([$2], [auto])) 225255476c70SmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib], 225355476c70Smrg [Use GLib library for unit testing (default: ]_defopt[)]), 225455476c70Smrg [with_glib=$withval], [with_glib=]_defopt) 225555476c70Smrgm4_undefine([_defopt]) 225655476c70Smrg 225755476c70Smrghave_glib=no 225855476c70Smrg# Do not probe GLib if user explicitly disabled unit testing 225955476c70Smrgif test "x$enable_unit_tests" != x"no"; then 226055476c70Smrg # Do not probe GLib if user explicitly disabled it 226155476c70Smrg if test "x$with_glib" != x"no"; then 226255476c70Smrg m4_ifval( 226355476c70Smrg [$1], 226455476c70Smrg [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])], 226555476c70Smrg [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])] 226655476c70Smrg ) 226755476c70Smrg fi 226855476c70Smrgfi 226955476c70Smrg 227055476c70Smrg# Not having GLib when unit testing has been explicitly requested is an error 227155476c70Smrgif test "x$enable_unit_tests" = x"yes"; then 227255476c70Smrg if test "x$have_glib" = x"no"; then 227355476c70Smrg AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found]) 227455476c70Smrg fi 227555476c70Smrgfi 227655476c70Smrg 227755476c70Smrg# Having unit testing disabled when GLib has been explicitly requested is an error 227855476c70Smrgif test "x$enable_unit_tests" = x"no"; then 227955476c70Smrg if test "x$with_glib" = x"yes"; then 228055476c70Smrg AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found]) 228155476c70Smrg fi 228255476c70Smrgfi 228355476c70Smrg 228455476c70Smrg# Not having GLib when it has been explicitly requested is an error 228555476c70Smrgif test "x$with_glib" = x"yes"; then 228655476c70Smrg if test "x$have_glib" = x"no"; then 228755476c70Smrg AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found]) 228855476c70Smrg fi 228955476c70Smrgfi 229055476c70Smrg 229155476c70SmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes]) 229255476c70Smrg]) # XORG_WITH_GLIB 229355476c70Smrg 229455476c70Smrg# XORG_LD_WRAP([required|optional]) 229555476c70Smrg# --------------------------------- 229655476c70Smrg# Minimum version: 1.13.0 229755476c70Smrg# 229855476c70Smrg# Check if linker supports -wrap, passed via compiler flags 229955476c70Smrg# 230055476c70Smrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing. 230155476c70Smrg# Otherwise the value of $enable_unit_tests is blank. 230255476c70Smrg# 230355476c70Smrg# Argument added in 1.16.0 - default is "required", to match existing behavior 230455476c70Smrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not 230555476c70Smrg# available, an argument of "optional" allows use when some unit tests require 230655476c70Smrg# ld -wrap and others do not. 230755476c70Smrg# 230855476c70SmrgAC_DEFUN([XORG_LD_WRAP],[ 230955476c70SmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no], 231055476c70Smrg [AC_LANG_PROGRAM([#include <stdlib.h> 231155476c70Smrg void __wrap_exit(int status) { return; }], 231255476c70Smrg [exit(0);])]) 231355476c70Smrg# Not having ld wrap when unit testing has been explicitly requested is an error 231455476c70Smrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then 231555476c70Smrg if test "x$have_ld_wrap" = x"no"; then 231655476c70Smrg AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available]) 231755476c70Smrg fi 231855476c70Smrgfi 231955476c70SmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes]) 232055476c70Smrg# 232155476c70Smrg]) # XORG_LD_WRAP 232255476c70Smrg 232355476c70Smrg# XORG_CHECK_LINKER_FLAGS 232455476c70Smrg# ----------------------- 232555476c70Smrg# SYNOPSIS 232655476c70Smrg# 232755476c70Smrg# XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE]) 232855476c70Smrg# 232955476c70Smrg# DESCRIPTION 233055476c70Smrg# 233155476c70Smrg# Check whether the given linker FLAGS work with the current language's 233255476c70Smrg# linker, or whether they give an error. 233355476c70Smrg# 233455476c70Smrg# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on 233555476c70Smrg# success/failure. 233655476c70Smrg# 233755476c70Smrg# PROGRAM-SOURCE is the program source to link with, if needed 233855476c70Smrg# 233955476c70Smrg# NOTE: Based on AX_CHECK_COMPILER_FLAGS. 234055476c70Smrg# 234155476c70Smrg# LICENSE 234255476c70Smrg# 234355476c70Smrg# Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org> 234455476c70Smrg# Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu> 234555476c70Smrg# Copyright (c) 2009 Matteo Frigo 234655476c70Smrg# 234755476c70Smrg# This program is free software: you can redistribute it and/or modify it 234855476c70Smrg# under the terms of the GNU General Public License as published by the 234955476c70Smrg# Free Software Foundation, either version 3 of the License, or (at your 235055476c70Smrg# option) any later version. 235155476c70Smrg# 235255476c70Smrg# This program is distributed in the hope that it will be useful, but 235355476c70Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of 235455476c70Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 235555476c70Smrg# Public License for more details. 235655476c70Smrg# 235755476c70Smrg# You should have received a copy of the GNU General Public License along 235855476c70Smrg# with this program. If not, see <http://www.gnu.org/licenses/>. 235955476c70Smrg# 236055476c70Smrg# As a special exception, the respective Autoconf Macro's copyright owner 236155476c70Smrg# gives unlimited permission to copy, distribute and modify the configure 236255476c70Smrg# scripts that are the output of Autoconf when processing the Macro. You 236355476c70Smrg# need not follow the terms of the GNU General Public License when using 236455476c70Smrg# or distributing such scripts, even though portions of the text of the 236555476c70Smrg# Macro appear in them. The GNU General Public License (GPL) does govern 236655476c70Smrg# all other use of the material that constitutes the Autoconf Macro. 236755476c70Smrg# 236855476c70Smrg# This special exception to the GPL applies to versions of the Autoconf 236955476c70Smrg# Macro released by the Autoconf Archive. When you make and distribute a 237055476c70Smrg# modified version of the Autoconf Macro, you may extend this special 237155476c70Smrg# exception to the GPL to apply to your modified version as well.# 237255476c70SmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS], 237355476c70Smrg[AC_MSG_CHECKING([whether the linker accepts $1]) 237455476c70Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname: 237555476c70SmrgAS_LITERAL_IF([$1], 237655476c70Smrg [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [ 237755476c70Smrg ax_save_FLAGS=$LDFLAGS 237855476c70Smrg LDFLAGS="$1" 237955476c70Smrg AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])], 238055476c70Smrg AS_TR_SH(xorg_cv_linker_flags_[$1])=yes, 238155476c70Smrg AS_TR_SH(xorg_cv_linker_flags_[$1])=no) 238255476c70Smrg LDFLAGS=$ax_save_FLAGS])], 238355476c70Smrg [ax_save_FLAGS=$LDFLAGS 238455476c70Smrg LDFLAGS="$1" 238555476c70Smrg AC_LINK_IFELSE([AC_LANG_PROGRAM()], 238655476c70Smrg eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes, 238755476c70Smrg eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no) 238855476c70Smrg LDFLAGS=$ax_save_FLAGS]) 238955476c70Smrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1]) 239055476c70SmrgAC_MSG_RESULT($xorg_check_linker_flags) 239155476c70Smrgif test "x$xorg_check_linker_flags" = xyes; then 239255476c70Smrg m4_default([$2], :) 239355476c70Smrgelse 239455476c70Smrg m4_default([$3], :) 239555476c70Smrgfi 239655476c70Smrg]) # XORG_CHECK_LINKER_FLAGS 239755476c70Smrg 239855476c70Smrg# XORG_MEMORY_CHECK_FLAGS 239955476c70Smrg# ----------------------- 240055476c70Smrg# Minimum version: 1.16.0 240155476c70Smrg# 240255476c70Smrg# This macro attempts to find appropriate memory checking functionality 240355476c70Smrg# for various platforms which unit testing code may use to catch various 240455476c70Smrg# forms of memory allocation and access errors in testing. 240555476c70Smrg# 240655476c70Smrg# Interface to module: 240755476c70Smrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging 240855476c70Smrg# Usually added to TESTS_ENVIRONMENT in Makefile.am 240955476c70Smrg# 241055476c70Smrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim. 241155476c70Smrg# 241255476c70SmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[ 241355476c70Smrg 241455476c70SmrgAC_REQUIRE([AC_CANONICAL_HOST]) 241555476c70SmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV], 241655476c70Smrg [Environment variables to enable memory checking in tests]) 241755476c70Smrg 241855476c70Smrg# Check for different types of support on different platforms 241955476c70Smrgcase $host_os in 242055476c70Smrg solaris*) 242155476c70Smrg AC_CHECK_LIB([umem], [umem_alloc], 242255476c70Smrg [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default']) 242355476c70Smrg ;; 242455476c70Smrg *-gnu*) # GNU libc - Value is used as a single byte bit pattern, 242555476c70Smrg # both directly and inverted, so should not be 0 or 255. 242655476c70Smrg malloc_debug_env='MALLOC_PERTURB_=15' 242755476c70Smrg ;; 242855476c70Smrg darwin*) 242955476c70Smrg malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib' 243055476c70Smrg ;; 243155476c70Smrg *bsd*) 243255476c70Smrg malloc_debug_env='MallocPreScribble=1 MallocScribble=1' 243355476c70Smrg ;; 243455476c70Smrgesac 243555476c70Smrg 243655476c70Smrg# User supplied flags override default flags 243755476c70Smrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then 243855476c70Smrg malloc_debug_env="$XORG_MALLOC_DEBUG_ENV" 243955476c70Smrgfi 244055476c70Smrg 244155476c70SmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env]) 244255476c70Smrg]) # XORG_WITH_LINT 244355476c70Smrg 2444d466db85Smrg# XORG_CHECK_MALLOC_ZERO 2445d466db85Smrg# ---------------------- 2446d466db85Smrg# Minimum version: 1.0.0 2447d466db85Smrg# 2448d466db85Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if 2449d466db85Smrg# malloc(0) returns NULL. Packages should add one of these cflags to 2450d466db85Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. 2451d466db85SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[ 2452d466db85SmrgAC_ARG_ENABLE(malloc0returnsnull, 2453d466db85Smrg AS_HELP_STRING([--enable-malloc0returnsnull], 2454d466db85Smrg [malloc(0) returns NULL (default: auto)]), 2455d466db85Smrg [MALLOC_ZERO_RETURNS_NULL=$enableval], 2456d466db85Smrg [MALLOC_ZERO_RETURNS_NULL=auto]) 2457d466db85Smrg 2458d466db85SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL]) 2459d466db85Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then 246055476c70Smrg AC_RUN_IFELSE([AC_LANG_PROGRAM([ 246155476c70Smrg#include <stdlib.h> 246255476c70Smrg],[ 2463d466db85Smrg char *m0, *r0, *c0, *p; 2464d466db85Smrg m0 = malloc(0); 2465d466db85Smrg p = malloc(10); 2466d466db85Smrg r0 = realloc(p,0); 246755476c70Smrg c0 = calloc(0,10); 246855476c70Smrg exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1); 246955476c70Smrg])], 2470d466db85Smrg [MALLOC_ZERO_RETURNS_NULL=yes], 24711cca5e29Smrg [MALLOC_ZERO_RETURNS_NULL=no], 24721cca5e29Smrg [MALLOC_ZERO_RETURNS_NULL=yes]) 2473d466db85Smrgfi 2474d466db85SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) 2475d466db85Smrg 2476d466db85Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then 2477d466db85Smrg MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" 2478d466db85Smrg XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS 2479d466db85Smrg XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" 2480d466db85Smrgelse 2481d466db85Smrg MALLOC_ZERO_CFLAGS="" 2482d466db85Smrg XMALLOC_ZERO_CFLAGS="" 2483d466db85Smrg XTMALLOC_ZERO_CFLAGS="" 2484d466db85Smrgfi 2485d466db85Smrg 2486d466db85SmrgAC_SUBST([MALLOC_ZERO_CFLAGS]) 2487d466db85SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS]) 2488d466db85SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS]) 2489d466db85Smrg]) # XORG_CHECK_MALLOC_ZERO 2490d466db85Smrg 2491d466db85Smrg# XORG_WITH_LINT() 2492d466db85Smrg# ---------------- 2493d466db85Smrg# Minimum version: 1.1.0 2494d466db85Smrg# 24951cca5e29Smrg# This macro enables the use of a tool that flags some suspicious and 24961cca5e29Smrg# non-portable constructs (likely to be bugs) in C language source code. 24971cca5e29Smrg# It will attempt to locate the tool and use appropriate options. 24981cca5e29Smrg# There are various lint type tools on different platforms. 24991cca5e29Smrg# 25001cca5e29Smrg# Interface to module: 25011cca5e29Smrg# LINT: returns the path to the tool found on the platform 25021cca5e29Smrg# or the value set to LINT on the configure cmd line 25031cca5e29Smrg# also an Automake conditional 25041cca5e29Smrg# LINT_FLAGS: an Automake variable with appropriate flags 25051cca5e29Smrg# 25061cca5e29Smrg# --with-lint: 'yes' user instructs the module to use lint 25071cca5e29Smrg# 'no' user instructs the module not to use lint (default) 25081cca5e29Smrg# 25091cca5e29Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path. 25101cca5e29Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim. 2511d466db85Smrg# 2512d466db85SmrgAC_DEFUN([XORG_WITH_LINT],[ 2513d466db85Smrg 25141cca5e29SmrgAC_ARG_VAR([LINT], [Path to a lint-style command]) 25151cca5e29SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command]) 2516d466db85SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint], 2517d466db85Smrg [Use a lint-style source code checker (default: disabled)])], 2518d466db85Smrg [use_lint=$withval], [use_lint=no]) 25191cca5e29Smrg 25201cca5e29Smrg# Obtain platform specific info like program name and options 25211cca5e29Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris 25221cca5e29Smrgcase $host_os in 25231cca5e29Smrg *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*) 25241cca5e29Smrg lint_name=splint 25251cca5e29Smrg lint_options="-badflag" 25261cca5e29Smrg ;; 25271cca5e29Smrg *freebsd* | *netbsd*) 25281cca5e29Smrg lint_name=lint 25291cca5e29Smrg lint_options="-u -b" 25301cca5e29Smrg ;; 25311cca5e29Smrg *solaris*) 25321cca5e29Smrg lint_name=lint 25331cca5e29Smrg lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2" 25341cca5e29Smrg ;; 25351cca5e29Smrgesac 25361cca5e29Smrg 25371cca5e29Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user) 25381cca5e29Smrgif test "x$use_lint" = x"yes" ; then 25391cca5e29Smrg AC_PATH_PROG([LINT], [$lint_name]) 25401cca5e29Smrg if test "x$LINT" = "x"; then 25411cca5e29Smrg AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH]) 25421cca5e29Smrg fi 25431cca5e29Smrgelif test "x$use_lint" = x"no" ; then 25441cca5e29Smrg if test "x$LINT" != "x"; then 25451cca5e29Smrg AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified]) 25461cca5e29Smrg fi 2547d466db85Smrgelse 25481cca5e29Smrg AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.]) 2549d466db85Smrgfi 25501cca5e29Smrg 25511cca5e29Smrg# User supplied flags override default flags 25521cca5e29Smrgif test "x$LINT_FLAGS" != "x"; then 25531cca5e29Smrg lint_options=$LINT_FLAGS 2554d466db85Smrgfi 2555d466db85Smrg 25561cca5e29SmrgAC_SUBST([LINT_FLAGS],[$lint_options]) 25571cca5e29SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x]) 2558d466db85Smrg 2559d466db85Smrg]) # XORG_WITH_LINT 2560d466db85Smrg 2561d466db85Smrg# XORG_LINT_LIBRARY(LIBNAME) 2562d466db85Smrg# -------------------------- 2563d466db85Smrg# Minimum version: 1.1.0 2564d466db85Smrg# 2565d466db85Smrg# Sets up flags for building lint libraries for checking programs that call 2566d466db85Smrg# functions in the library. 2567d466db85Smrg# 25681cca5e29Smrg# Interface to module: 25691cca5e29Smrg# LINTLIB - Automake variable with the name of lint library file to make 25701cca5e29Smrg# MAKE_LINT_LIB - Automake conditional 25711cca5e29Smrg# 25721cca5e29Smrg# --enable-lint-library: - 'yes' user instructs the module to created a lint library 25731cca5e29Smrg# - 'no' user instructs the module not to create a lint library (default) 2574d466db85Smrg 2575d466db85SmrgAC_DEFUN([XORG_LINT_LIBRARY],[ 2576d466db85SmrgAC_REQUIRE([XORG_WITH_LINT]) 2577d466db85SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library], 2578d466db85Smrg [Create lint library (default: disabled)])], 2579d466db85Smrg [make_lint_lib=$enableval], [make_lint_lib=no]) 25801cca5e29Smrg 25811cca5e29Smrgif test "x$make_lint_lib" = x"yes" ; then 25821cca5e29Smrg LINTLIB=llib-l$1.ln 25831cca5e29Smrg if test "x$LINT" = "x"; then 25841cca5e29Smrg AC_MSG_ERROR([Cannot make lint library without --with-lint]) 25851cca5e29Smrg fi 25861cca5e29Smrgelif test "x$make_lint_lib" != x"no" ; then 25871cca5e29Smrg AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.]) 2588d466db85Smrgfi 25891cca5e29Smrg 2590d466db85SmrgAC_SUBST(LINTLIB) 2591d466db85SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno]) 2592d466db85Smrg 2593d466db85Smrg]) # XORG_LINT_LIBRARY 2594d466db85Smrg 259555476c70Smrg# XORG_COMPILER_BRAND 259655476c70Smrg# ------------------- 259755476c70Smrg# Minimum version: 1.14.0 259855476c70Smrg# 259955476c70Smrg# Checks for various brands of compilers and sets flags as appropriate: 260055476c70Smrg# GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes" 260155476c70Smrg# clang compiler - sets CLANGCC to "yes" 260255476c70Smrg# Intel compiler - sets INTELCC to "yes" 260355476c70Smrg# Sun/Oracle Solaris Studio cc - sets SUNCC to "yes" 260455476c70Smrg# 260555476c70SmrgAC_DEFUN([XORG_COMPILER_BRAND], [ 260655476c70SmrgAC_REQUIRE([AC_PROG_CC_C99]) 260755476c70SmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"]) 260855476c70SmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"]) 260955476c70SmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) 261055476c70Smrg]) # XORG_COMPILER_BRAND 261155476c70Smrg 261255476c70Smrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...]) 261355476c70Smrg# --------------- 261455476c70Smrg# Minimum version: 1.16.0 261555476c70Smrg# 261655476c70Smrg# Test if the compiler works when passed the given flag as a command line argument. 261755476c70Smrg# If it succeeds, the flag is appeneded to the given variable. If not, it tries the 261855476c70Smrg# next flag in the list until there are no more options. 261955476c70Smrg# 262055476c70Smrg# Note that this does not guarantee that the compiler supports the flag as some 262155476c70Smrg# compilers will simply ignore arguments that they do not understand, but we do 262255476c70Smrg# attempt to weed out false positives by using -Werror=unknown-warning-option and 262355476c70Smrg# -Werror=unused-command-line-argument 262455476c70Smrg# 262555476c70SmrgAC_DEFUN([XORG_TESTSET_CFLAG], [ 262655476c70SmrgAC_REQUIRE([AC_PROG_CC_C99]) 262755476c70Smrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])]) 262855476c70Smrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])]) 262955476c70Smrg 263055476c70Smrgxorg_testset_save_CFLAGS="$CFLAGS" 263155476c70Smrg 263255476c70Smrgif test "x$xorg_testset_unknown_warning_option" = "x" ; then 263355476c70Smrg CFLAGS="$CFLAGS -Werror=unknown-warning-option" 263455476c70Smrg AC_CACHE_CHECK([if $CC supports -Werror=unknown-warning-option], 263555476c70Smrg xorg_cv_cc_flag_unknown_warning_option, 263655476c70Smrg AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])], 263755476c70Smrg [xorg_cv_cc_flag_unknown_warning_option=yes], 263855476c70Smrg [xorg_cv_cc_flag_unknown_warning_option=no])) 263955476c70Smrg xorg_testset_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option 264055476c70Smrg CFLAGS="$xorg_testset_save_CFLAGS" 264155476c70Smrgfi 264255476c70Smrg 264355476c70Smrgif test "x$xorg_testset_unused_command_line_argument" = "x" ; then 264455476c70Smrg if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then 264555476c70Smrg CFLAGS="$CFLAGS -Werror=unknown-warning-option" 264655476c70Smrg fi 264755476c70Smrg CFLAGS="$CFLAGS -Werror=unused-command-line-argument" 264855476c70Smrg AC_CACHE_CHECK([if $CC supports -Werror=unused-command-line-argument], 264955476c70Smrg xorg_cv_cc_flag_unused_command_line_argument, 265055476c70Smrg AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])], 265155476c70Smrg [xorg_cv_cc_flag_unused_command_line_argument=yes], 265255476c70Smrg [xorg_cv_cc_flag_unused_command_line_argument=no])) 265355476c70Smrg xorg_testset_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument 265455476c70Smrg CFLAGS="$xorg_testset_save_CFLAGS" 265555476c70Smrgfi 265655476c70Smrg 265755476c70Smrgfound="no" 265855476c70Smrgm4_foreach([flag], m4_cdr($@), [ 265955476c70Smrg if test $found = "no" ; then 266055476c70Smrg if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then 266155476c70Smrg CFLAGS="$CFLAGS -Werror=unknown-warning-option" 266255476c70Smrg fi 266355476c70Smrg 266455476c70Smrg if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then 266555476c70Smrg CFLAGS="$CFLAGS -Werror=unused-command-line-argument" 266655476c70Smrg fi 266755476c70Smrg 266855476c70Smrg CFLAGS="$CFLAGS ]flag[" 266955476c70Smrg 267055476c70Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname 267155476c70Smrg AC_MSG_CHECKING([if $CC supports ]flag[]) 267255476c70Smrg cacheid=`AS_ECHO_N([xorg_cv_cc_flag_]flag[])` 267355476c70Smrg AC_CACHE_VAL(AS_TR_SH($cacheid), 267455476c70Smrg [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])], 267555476c70Smrg [eval AS_TR_SH($cacheid)=yes], 267655476c70Smrg [eval AS_TR_SH($cacheid)=no])]) 267755476c70Smrg 267855476c70Smrg CFLAGS="$xorg_testset_save_CFLAGS" 267955476c70Smrg 268055476c70Smrg eval supported=$AS_TR_SH($cacheid) 268155476c70Smrg AC_MSG_RESULT([$supported]) 268255476c70Smrg if test "$supported" = "yes" ; then 268355476c70Smrg $1="$$1 ]flag[" 268455476c70Smrg found="yes" 268555476c70Smrg fi 268655476c70Smrg fi 268755476c70Smrg]) 268855476c70Smrg]) # XORG_TESTSET_CFLAG 268955476c70Smrg 269055476c70Smrg# XORG_COMPILER_FLAGS 269155476c70Smrg# --------------- 269255476c70Smrg# Minimum version: 1.16.0 269355476c70Smrg# 269455476c70Smrg# Defines BASE_CFLAGS to contain a set of command line arguments supported 269555476c70Smrg# by the selected compiler which do NOT alter the generated code. These 269655476c70Smrg# arguments will cause the compiler to print various warnings during 269755476c70Smrg# compilation AND turn a conservative set of warnings into errors. 269855476c70Smrg# 269955476c70Smrg# The set of flags supported by BASE_CFLAGS will grow in future 270055476c70Smrg# versions of util-macros as options are added to new compilers. 270155476c70Smrg# 270255476c70SmrgAC_DEFUN([XORG_COMPILER_FLAGS], [ 270355476c70SmrgAC_REQUIRE([XORG_COMPILER_BRAND]) 270455476c70Smrg 270555476c70SmrgAC_ARG_ENABLE(selective-werror, 270655476c70Smrg AS_HELP_STRING([--disable-selective-werror], 270755476c70Smrg [Turn off selective compiler errors. (default: enabled)]), 270855476c70Smrg [SELECTIVE_WERROR=$enableval], 270955476c70Smrg [SELECTIVE_WERROR=yes]) 271055476c70Smrg 271155476c70Smrg# -v is too short to test reliably with XORG_TESTSET_CFLAG 271255476c70Smrgif test "x$SUNCC" = "xyes"; then 271355476c70Smrg BASE_CFLAGS="-v" 271455476c70Smrgelse 271555476c70Smrg BASE_CFLAGS="" 271655476c70Smrgfi 271755476c70Smrg 271855476c70Smrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS 271955476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wall]) 272055476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wpointer-arith]) 272155476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wstrict-prototypes]) 272255476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wmissing-prototypes]) 272355476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wmissing-declarations]) 272455476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wnested-externs]) 272555476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wbad-function-cast]) 272655476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wformat=2], [-Wformat]) 272755476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wold-style-definition]) 272855476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wdeclaration-after-statement]) 272955476c70Smrg 273055476c70Smrg# This chunk adds additional warnings that could catch undesired effects. 273155476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wunused]) 273255476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wuninitialized]) 273355476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wshadow]) 273455476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wcast-qual]) 273555476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wmissing-noreturn]) 273655476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wmissing-format-attribute]) 273755476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wredundant-decls]) 273855476c70Smrg 273955476c70Smrg# These are currently disabled because they are noisy. They will be enabled 274055476c70Smrg# in the future once the codebase is sufficiently modernized to silence 274155476c70Smrg# them. For now, I don't want them to drown out the other warnings. 274255476c70Smrg# XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wlogical-op]) 274355476c70Smrg# XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wparentheses]) 274455476c70Smrg# XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wcast-align]) 274555476c70Smrg 274655476c70Smrg# Turn some warnings into errors, so we don't accidently get successful builds 274755476c70Smrg# when there are problems that should be fixed. 274855476c70Smrg 274955476c70Smrgif test "x$SELECTIVE_WERROR" = "xyes" ; then 275055476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED]) 275155476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=nonnull]) 275255476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=init-self]) 275355476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=main]) 275455476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=missing-braces]) 275555476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=sequence-point]) 275655476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT]) 275755476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=trigraphs]) 275855476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=array-bounds]) 275955476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=write-strings]) 276055476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=address]) 276155476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION]) 276255476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION 276355476c70Smrgelse 276455476c70SmrgAC_MSG_WARN([You have chosen not to turn some select compiler warnings into errors. This should not be necessary. Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT]) 276555476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wimplicit]) 276655476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wnonnull]) 276755476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Winit-self]) 276855476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wmain]) 276955476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wmissing-braces]) 277055476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wsequence-point]) 277155476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wreturn-type]) 277255476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wtrigraphs]) 277355476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Warray-bounds]) 277455476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wwrite-strings]) 277555476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Waddress]) 277655476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wint-to-pointer-cast]) 277755476c70SmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wpointer-to-int-cast]) 277855476c70Smrgfi 277955476c70Smrg 278055476c70SmrgAC_SUBST([BASE_CFLAGS]) 278155476c70Smrg]) # XORG_COMPILER_FLAGS 278255476c70Smrg 2783d466db85Smrg# XORG_CWARNFLAGS 2784d466db85Smrg# --------------- 2785d466db85Smrg# Minimum version: 1.2.0 278655476c70Smrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead) 2787d466db85Smrg# 2788d466db85Smrg# Defines CWARNFLAGS to enable C compiler warnings. 2789d466db85Smrg# 279055476c70Smrg# This function is deprecated because it defines -fno-strict-aliasing 279155476c70Smrg# which alters the code generated by the compiler. If -fno-strict-aliasing 279255476c70Smrg# is needed, then it should be added explicitly in the module when 279355476c70Smrg# it is updated to use BASE_CFLAGS. 279455476c70Smrg# 2795d466db85SmrgAC_DEFUN([XORG_CWARNFLAGS], [ 279655476c70SmrgAC_REQUIRE([XORG_COMPILER_FLAGS]) 279755476c70SmrgAC_REQUIRE([XORG_COMPILER_BRAND]) 279855476c70SmrgCWARNFLAGS="$BASE_CFLAGS" 2799d466db85Smrgif test "x$GCC" = xyes ; then 280055476c70Smrg CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing" 2801d466db85Smrgfi 2802d466db85SmrgAC_SUBST(CWARNFLAGS) 2803d466db85Smrg]) # XORG_CWARNFLAGS 2804d466db85Smrg 2805d466db85Smrg# XORG_STRICT_OPTION 2806d466db85Smrg# ----------------------- 2807d466db85Smrg# Minimum version: 1.3.0 2808d466db85Smrg# 280955476c70Smrg# Add configure option to enable strict compilation flags, such as treating 281055476c70Smrg# warnings as fatal errors. 281155476c70Smrg# If --enable-strict-compilation is passed to configure, adds strict flags to 281255476c70Smrg# $BASE_CFLAGS and the deprecated $CWARNFLAGS. 281355476c70Smrg# 281455476c70Smrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or 281555476c70Smrg# when strict compilation is unconditionally desired. 2816d466db85SmrgAC_DEFUN([XORG_STRICT_OPTION], [ 2817d466db85SmrgAC_REQUIRE([XORG_CWARNFLAGS]) 281855476c70SmrgAC_REQUIRE([XORG_COMPILER_FLAGS]) 2819d466db85Smrg 2820d466db85SmrgAC_ARG_ENABLE(strict-compilation, 2821d466db85Smrg AS_HELP_STRING([--enable-strict-compilation], 2822d466db85Smrg [Enable all warnings from compiler and make them errors (default: disabled)]), 2823d466db85Smrg [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no]) 282455476c70Smrg 282555476c70SmrgSTRICT_CFLAGS="" 282655476c70SmrgXORG_TESTSET_CFLAG([STRICT_CFLAGS], [-pedantic]) 282755476c70SmrgXORG_TESTSET_CFLAG([STRICT_CFLAGS], [-Werror], [-errwarn]) 282855476c70Smrg 282955476c70Smrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not 283055476c70Smrg# activate it with -Werror, so we add it here explicitly. 283155476c70SmrgXORG_TESTSET_CFLAG([STRICT_CFLAGS], [-Werror=attributes]) 283255476c70Smrg 2833d466db85Smrgif test "x$STRICT_COMPILE" = "xyes"; then 283455476c70Smrg BASE_CFLAGS="$BASE_CFLAGS $STRICT_CFLAGS" 283555476c70Smrg CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS" 2836d466db85Smrgfi 283755476c70SmrgAC_SUBST([STRICT_CFLAGS]) 283855476c70SmrgAC_SUBST([BASE_CFLAGS]) 2839d466db85SmrgAC_SUBST([CWARNFLAGS]) 2840d466db85Smrg]) # XORG_STRICT_OPTION 2841d466db85Smrg 2842d466db85Smrg# XORG_DEFAULT_OPTIONS 2843d466db85Smrg# -------------------- 2844d466db85Smrg# Minimum version: 1.3.0 2845d466db85Smrg# 2846d466db85Smrg# Defines default options for X.Org modules. 2847d466db85Smrg# 2848d466db85SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [ 28491cca5e29SmrgAC_REQUIRE([AC_PROG_INSTALL]) 285055476c70SmrgXORG_COMPILER_FLAGS 2851d466db85SmrgXORG_CWARNFLAGS 2852d466db85SmrgXORG_STRICT_OPTION 2853d466db85SmrgXORG_RELEASE_VERSION 2854d466db85SmrgXORG_CHANGELOG 28551cca5e29SmrgXORG_INSTALL 2856d466db85SmrgXORG_MANPAGE_SECTIONS 28571cca5e29Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], 28581cca5e29Smrg [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) 2859d466db85Smrg]) # XORG_DEFAULT_OPTIONS 28601cca5e29Smrg 28611cca5e29Smrg# XORG_INSTALL() 28621cca5e29Smrg# ---------------- 28631cca5e29Smrg# Minimum version: 1.4.0 28641cca5e29Smrg# 28651cca5e29Smrg# Defines the variable INSTALL_CMD as the command to copy 28661cca5e29Smrg# INSTALL from $prefix/share/util-macros. 28671cca5e29Smrg# 28681cca5e29SmrgAC_DEFUN([XORG_INSTALL], [ 28691cca5e29SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG]) 28701cca5e29Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` 28711cca5e29SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ 28721cca5e29Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ 28731cca5e29Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \ 28741cca5e29Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)" 28751cca5e29SmrgAC_SUBST([INSTALL_CMD]) 28761cca5e29Smrg]) # XORG_INSTALL 2877d466db85Smrgdnl Copyright 2005 Red Hat, Inc 2878d466db85Smrgdnl 2879d466db85Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its 2880d466db85Smrgdnl documentation for any purpose is hereby granted without fee, provided that 2881d466db85Smrgdnl the above copyright notice appear in all copies and that both that 2882d466db85Smrgdnl copyright notice and this permission notice appear in supporting 2883d466db85Smrgdnl documentation. 2884d466db85Smrgdnl 2885d466db85Smrgdnl The above copyright notice and this permission notice shall be included 2886d466db85Smrgdnl in all copies or substantial portions of the Software. 2887d466db85Smrgdnl 2888d466db85Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 2889d466db85Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 2890d466db85Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 2891d466db85Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 2892d466db85Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 2893d466db85Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 2894d466db85Smrgdnl OTHER DEALINGS IN THE SOFTWARE. 2895d466db85Smrgdnl 2896d466db85Smrgdnl Except as contained in this notice, the name of the copyright holders shall 2897d466db85Smrgdnl not be used in advertising or otherwise to promote the sale, use or 2898d466db85Smrgdnl other dealings in this Software without prior written authorization 2899d466db85Smrgdnl from the copyright holders. 2900d466db85Smrgdnl 2901d466db85Smrg 2902d466db85Smrg# XORG_RELEASE_VERSION 2903d466db85Smrg# -------------------- 29041cca5e29Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use. 2905d466db85Smrg 2906d466db85SmrgAC_DEFUN([XORG_RELEASE_VERSION],[ 2907d466db85Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR], 2908d466db85Smrg [`echo $PACKAGE_VERSION | cut -d . -f 1`], 2909d466db85Smrg [Major version of this package]) 2910d466db85Smrg PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` 2911d466db85Smrg if test "x$PVM" = "x"; then 2912d466db85Smrg PVM="0" 2913d466db85Smrg fi 2914d466db85Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR], 2915d466db85Smrg [$PVM], 2916d466db85Smrg [Minor version of this package]) 2917d466db85Smrg PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` 2918d466db85Smrg if test "x$PVP" = "x"; then 2919d466db85Smrg PVP="0" 2920d466db85Smrg fi 2921d466db85Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL], 2922d466db85Smrg [$PVP], 2923d466db85Smrg [Patch version of this package]) 2924d466db85Smrg]) 2925d466db85Smrg 2926d466db85Smrg# XORG_CHANGELOG() 2927d466db85Smrg# ---------------- 2928d466db85Smrg# Minimum version: 1.2.0 2929d466db85Smrg# 2930d466db85Smrg# Defines the variable CHANGELOG_CMD as the command to generate 2931d466db85Smrg# ChangeLog from git. 2932d466db85Smrg# 2933d466db85Smrg# 2934d466db85SmrgAC_DEFUN([XORG_CHANGELOG], [ 29351cca5e29SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \ 29361cca5e29Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ 29371cca5e29Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \ 2938d466db85Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)" 2939d466db85SmrgAC_SUBST([CHANGELOG_CMD]) 2940d466db85Smrg]) # XORG_CHANGELOG 2941d466db85Smrg 2942