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