aclocal.m4 revision 8650bb69
18650bb69Smrg# generated automatically by aclocal 1.11 -*- Autoconf -*- 22c7c4e3dSmrg 38650bb69Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 48650bb69Smrg# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. 52c7c4e3dSmrg# This file is free software; the Free Software Foundation 62c7c4e3dSmrg# gives unlimited permission to copy and/or distribute it, 72c7c4e3dSmrg# with or without modifications, as long as this notice is preserved. 82c7c4e3dSmrg 92c7c4e3dSmrg# This program is distributed in the hope that it will be useful, 102c7c4e3dSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without 112c7c4e3dSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A 122c7c4e3dSmrg# PARTICULAR PURPOSE. 132c7c4e3dSmrg 148650bb69Smrgm4_ifndef([AC_AUTOCONF_VERSION], 158650bb69Smrg [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 168650bb69Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],, 178650bb69Smrg[m4_warning([this file was generated for autoconf 2.63. 188650bb69SmrgYou have another version of autoconf. It may work, but is not guaranteed to. 198650bb69SmrgIf you have problems, you may need to regenerate the build system entirely. 208650bb69SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])]) 212c7c4e3dSmrg 228650bb69Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. 238650bb69Smrg# 248650bb69Smrg# This file is free software; the Free Software Foundation 258650bb69Smrg# gives unlimited permission to copy and/or distribute it, 268650bb69Smrg# with or without modifications, as long as this notice is preserved. 272c7c4e3dSmrg 282c7c4e3dSmrg# AM_AUTOMAKE_VERSION(VERSION) 292c7c4e3dSmrg# ---------------------------- 302c7c4e3dSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been 312c7c4e3dSmrg# generated from the m4 files accompanying Automake X.Y. 328650bb69Smrg# (This private macro should not be called outside this file.) 338650bb69SmrgAC_DEFUN([AM_AUTOMAKE_VERSION], 348650bb69Smrg[am__api_version='1.11' 358650bb69Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to 368650bb69Smrgdnl require some minimum version. Point them to the right macro. 378650bb69Smrgm4_if([$1], [1.11], [], 388650bb69Smrg [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl 398650bb69Smrg]) 408650bb69Smrg 418650bb69Smrg# _AM_AUTOCONF_VERSION(VERSION) 428650bb69Smrg# ----------------------------- 438650bb69Smrg# aclocal traces this macro to find the Autoconf version. 448650bb69Smrg# This is a private macro too. Using m4_define simplifies 458650bb69Smrg# the logic in aclocal, which can simply ignore this definition. 468650bb69Smrgm4_define([_AM_AUTOCONF_VERSION], []) 472c7c4e3dSmrg 482c7c4e3dSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION 492c7c4e3dSmrg# ------------------------------- 508650bb69Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. 518650bb69Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. 522c7c4e3dSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 538650bb69Smrg[AM_AUTOMAKE_VERSION([1.11])dnl 548650bb69Smrgm4_ifndef([AC_AUTOCONF_VERSION], 558650bb69Smrg [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 568650bb69Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) 572c7c4e3dSmrg 588650bb69Smrg# AM_AUX_DIR_EXPAND -*- Autoconf -*- 592c7c4e3dSmrg 608650bb69Smrg# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 612c7c4e3dSmrg# 628650bb69Smrg# This file is free software; the Free Software Foundation 638650bb69Smrg# gives unlimited permission to copy and/or distribute it, 648650bb69Smrg# with or without modifications, as long as this notice is preserved. 652c7c4e3dSmrg 662c7c4e3dSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 672c7c4e3dSmrg# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to 682c7c4e3dSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'. 692c7c4e3dSmrg# 702c7c4e3dSmrg# Of course, Automake must honor this variable whenever it calls a 712c7c4e3dSmrg# tool from the auxiliary directory. The problem is that $srcdir (and 722c7c4e3dSmrg# therefore $ac_aux_dir as well) can be either absolute or relative, 732c7c4e3dSmrg# depending on how configure is run. This is pretty annoying, since 742c7c4e3dSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top 752c7c4e3dSmrg# source directory, any form will work fine, but in subdirectories a 762c7c4e3dSmrg# relative path needs to be adjusted first. 772c7c4e3dSmrg# 782c7c4e3dSmrg# $ac_aux_dir/missing 792c7c4e3dSmrg# fails when called from a subdirectory if $ac_aux_dir is relative 802c7c4e3dSmrg# $top_srcdir/$ac_aux_dir/missing 812c7c4e3dSmrg# fails if $ac_aux_dir is absolute, 822c7c4e3dSmrg# fails when called from a subdirectory in a VPATH build with 832c7c4e3dSmrg# a relative $ac_aux_dir 842c7c4e3dSmrg# 852c7c4e3dSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir 862c7c4e3dSmrg# are both prefixed by $srcdir. In an in-source build this is usually 872c7c4e3dSmrg# harmless because $srcdir is `.', but things will broke when you 882c7c4e3dSmrg# start a VPATH build or use an absolute $srcdir. 892c7c4e3dSmrg# 902c7c4e3dSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 912c7c4e3dSmrg# iff we strip the leading $srcdir from $ac_aux_dir. That would be: 922c7c4e3dSmrg# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 932c7c4e3dSmrg# and then we would define $MISSING as 942c7c4e3dSmrg# MISSING="\${SHELL} $am_aux_dir/missing" 952c7c4e3dSmrg# This will work as long as MISSING is not called from configure, because 962c7c4e3dSmrg# unfortunately $(top_srcdir) has no meaning in configure. 972c7c4e3dSmrg# However there are other variables, like CC, which are often used in 982c7c4e3dSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir. 992c7c4e3dSmrg# 1002c7c4e3dSmrg# Another solution, used here, is to always expand $ac_aux_dir to an 1012c7c4e3dSmrg# absolute PATH. The drawback is that using absolute paths prevent a 1022c7c4e3dSmrg# configured tree to be moved without reconfiguration. 1032c7c4e3dSmrg 1048650bb69SmrgAC_DEFUN([AM_AUX_DIR_EXPAND], 1058650bb69Smrg[dnl Rely on autoconf to set up CDPATH properly. 1068650bb69SmrgAC_PREREQ([2.50])dnl 1072c7c4e3dSmrg# expand $ac_aux_dir to an absolute path 1082c7c4e3dSmrgam_aux_dir=`cd $ac_aux_dir && pwd` 1092c7c4e3dSmrg]) 1102c7c4e3dSmrg 1118650bb69Smrg# AM_CONDITIONAL -*- Autoconf -*- 1122c7c4e3dSmrg 1138650bb69Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 1148650bb69Smrg# Free Software Foundation, Inc. 1158650bb69Smrg# 1168650bb69Smrg# This file is free software; the Free Software Foundation 1178650bb69Smrg# gives unlimited permission to copy and/or distribute it, 1188650bb69Smrg# with or without modifications, as long as this notice is preserved. 1192c7c4e3dSmrg 1208650bb69Smrg# serial 9 1212c7c4e3dSmrg 1228650bb69Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION) 1238650bb69Smrg# ------------------------------------- 1248650bb69Smrg# Define a conditional. 1258650bb69SmrgAC_DEFUN([AM_CONDITIONAL], 1268650bb69Smrg[AC_PREREQ(2.52)dnl 1278650bb69Smrg ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 1288650bb69Smrg [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 1298650bb69SmrgAC_SUBST([$1_TRUE])dnl 1308650bb69SmrgAC_SUBST([$1_FALSE])dnl 1318650bb69Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl 1328650bb69Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl 1338650bb69Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl 1348650bb69Smrgif $2; then 1358650bb69Smrg $1_TRUE= 1368650bb69Smrg $1_FALSE='#' 1372c7c4e3dSmrgelse 1388650bb69Smrg $1_TRUE='#' 1398650bb69Smrg $1_FALSE= 1402c7c4e3dSmrgfi 1418650bb69SmrgAC_CONFIG_COMMANDS_PRE( 1428650bb69Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 1438650bb69Smrg AC_MSG_ERROR([[conditional "$1" was never defined. 1448650bb69SmrgUsually this means the macro was only invoked conditionally.]]) 1458650bb69Smrgfi])]) 1462c7c4e3dSmrg 1478650bb69Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 1488650bb69Smrg# Free Software Foundation, Inc. 1498650bb69Smrg# 1508650bb69Smrg# This file is free software; the Free Software Foundation 1518650bb69Smrg# gives unlimited permission to copy and/or distribute it, 1528650bb69Smrg# with or without modifications, as long as this notice is preserved. 1532c7c4e3dSmrg 1548650bb69Smrg# serial 10 1552c7c4e3dSmrg 1562c7c4e3dSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be 1572c7c4e3dSmrg# written in clear, in which case automake, when reading aclocal.m4, 1582c7c4e3dSmrg# will think it sees a *use*, and therefore will trigger all it's 1592c7c4e3dSmrg# C support machinery. Also note that it means that autoscan, seeing 1602c7c4e3dSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use... 1612c7c4e3dSmrg 1622c7c4e3dSmrg 1632c7c4e3dSmrg# _AM_DEPENDENCIES(NAME) 1642c7c4e3dSmrg# ---------------------- 1652c7c4e3dSmrg# See how the compiler implements dependency checking. 1662c7c4e3dSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC". 1672c7c4e3dSmrg# We try a few techniques and use that to set a single cache variable. 1682c7c4e3dSmrg# 1692c7c4e3dSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was 1702c7c4e3dSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular 1712c7c4e3dSmrg# dependency, and given that the user is not expected to run this macro, 1722c7c4e3dSmrg# just rely on AC_PROG_CC. 1732c7c4e3dSmrgAC_DEFUN([_AM_DEPENDENCIES], 1742c7c4e3dSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl 1752c7c4e3dSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl 1762c7c4e3dSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl 1772c7c4e3dSmrgAC_REQUIRE([AM_DEP_TRACK])dnl 1782c7c4e3dSmrg 1792c7c4e3dSmrgifelse([$1], CC, [depcc="$CC" am_compiler_list=], 1802c7c4e3dSmrg [$1], CXX, [depcc="$CXX" am_compiler_list=], 1812c7c4e3dSmrg [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 1828650bb69Smrg [$1], UPC, [depcc="$UPC" am_compiler_list=], 1832c7c4e3dSmrg [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 1842c7c4e3dSmrg [depcc="$$1" am_compiler_list=]) 1852c7c4e3dSmrg 1862c7c4e3dSmrgAC_CACHE_CHECK([dependency style of $depcc], 1872c7c4e3dSmrg [am_cv_$1_dependencies_compiler_type], 1882c7c4e3dSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then 1892c7c4e3dSmrg # We make a subdir and do the tests there. Otherwise we can end up 1902c7c4e3dSmrg # making bogus files that we don't know about and never remove. For 1912c7c4e3dSmrg # instance it was reported that on HP-UX the gcc test will end up 1922c7c4e3dSmrg # making a dummy file named `D' -- because `-MD' means `put the output 1932c7c4e3dSmrg # in D'. 1942c7c4e3dSmrg mkdir conftest.dir 1952c7c4e3dSmrg # Copy depcomp to subdir because otherwise we won't find it if we're 1962c7c4e3dSmrg # using a relative directory. 1972c7c4e3dSmrg cp "$am_depcomp" conftest.dir 1982c7c4e3dSmrg cd conftest.dir 1992c7c4e3dSmrg # We will build objects and dependencies in a subdirectory because 2002c7c4e3dSmrg # it helps to detect inapplicable dependency modes. For instance 2012c7c4e3dSmrg # both Tru64's cc and ICC support -MD to output dependencies as a 2022c7c4e3dSmrg # side effect of compilation, but ICC will put the dependencies in 2032c7c4e3dSmrg # the current directory while Tru64 will put them in the object 2042c7c4e3dSmrg # directory. 2052c7c4e3dSmrg mkdir sub 2062c7c4e3dSmrg 2072c7c4e3dSmrg am_cv_$1_dependencies_compiler_type=none 2082c7c4e3dSmrg if test "$am_compiler_list" = ""; then 2092c7c4e3dSmrg am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` 2102c7c4e3dSmrg fi 2118650bb69Smrg am__universal=false 2128650bb69Smrg m4_case([$1], [CC], 2138650bb69Smrg [case " $depcc " in #( 2148650bb69Smrg *\ -arch\ *\ -arch\ *) am__universal=true ;; 2158650bb69Smrg esac], 2168650bb69Smrg [CXX], 2178650bb69Smrg [case " $depcc " in #( 2188650bb69Smrg *\ -arch\ *\ -arch\ *) am__universal=true ;; 2198650bb69Smrg esac]) 2208650bb69Smrg 2212c7c4e3dSmrg for depmode in $am_compiler_list; do 2222c7c4e3dSmrg # Setup a source with many dependencies, because some compilers 2232c7c4e3dSmrg # like to wrap large dependency lists on column 80 (with \), and 2242c7c4e3dSmrg # we should not choose a depcomp mode which is confused by this. 2252c7c4e3dSmrg # 2262c7c4e3dSmrg # We need to recreate these files for each test, as the compiler may 2272c7c4e3dSmrg # overwrite some of them when testing with obscure command lines. 2282c7c4e3dSmrg # This happens at least with the AIX C compiler. 2292c7c4e3dSmrg : > sub/conftest.c 2302c7c4e3dSmrg for i in 1 2 3 4 5 6; do 2312c7c4e3dSmrg echo '#include "conftst'$i'.h"' >> sub/conftest.c 2328650bb69Smrg # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with 2338650bb69Smrg # Solaris 8's {/usr,}/bin/sh. 2348650bb69Smrg touch sub/conftst$i.h 2352c7c4e3dSmrg done 2362c7c4e3dSmrg echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 2372c7c4e3dSmrg 2388650bb69Smrg # We check with `-c' and `-o' for the sake of the "dashmstdout" 2398650bb69Smrg # mode. It turns out that the SunPro C++ compiler does not properly 2408650bb69Smrg # handle `-M -o', and we need to detect this. Also, some Intel 2418650bb69Smrg # versions had trouble with output in subdirs 2428650bb69Smrg am__obj=sub/conftest.${OBJEXT-o} 2438650bb69Smrg am__minus_obj="-o $am__obj" 2442c7c4e3dSmrg case $depmode in 2458650bb69Smrg gcc) 2468650bb69Smrg # This depmode causes a compiler race in universal mode. 2478650bb69Smrg test "$am__universal" = false || continue 2488650bb69Smrg ;; 2492c7c4e3dSmrg nosideeffect) 2502c7c4e3dSmrg # after this tag, mechanisms are not by side-effect, so they'll 2512c7c4e3dSmrg # only be used when explicitly requested 2522c7c4e3dSmrg if test "x$enable_dependency_tracking" = xyes; then 2532c7c4e3dSmrg continue 2542c7c4e3dSmrg else 2552c7c4e3dSmrg break 2562c7c4e3dSmrg fi 2572c7c4e3dSmrg ;; 2588650bb69Smrg msvisualcpp | msvcmsys) 2598650bb69Smrg # This compiler won't grok `-c -o', but also, the minuso test has 2608650bb69Smrg # not run yet. These depmodes are late enough in the game, and 2618650bb69Smrg # so weak that their functioning should not be impacted. 2628650bb69Smrg am__obj=conftest.${OBJEXT-o} 2638650bb69Smrg am__minus_obj= 2648650bb69Smrg ;; 2652c7c4e3dSmrg none) break ;; 2662c7c4e3dSmrg esac 2672c7c4e3dSmrg if depmode=$depmode \ 2688650bb69Smrg source=sub/conftest.c object=$am__obj \ 2692c7c4e3dSmrg depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ 2708650bb69Smrg $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ 2712c7c4e3dSmrg >/dev/null 2>conftest.err && 2728650bb69Smrg grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 2732c7c4e3dSmrg grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && 2748650bb69Smrg grep $am__obj sub/conftest.Po > /dev/null 2>&1 && 2752c7c4e3dSmrg ${MAKE-make} -s -f confmf > /dev/null 2>&1; then 2762c7c4e3dSmrg # icc doesn't choke on unknown options, it will just issue warnings 2778650bb69Smrg # or remarks (even with -Werror). So we grep stderr for any message 2788650bb69Smrg # that says an option was ignored or not supported. 2798650bb69Smrg # When given -MP, icc 7.0 and 7.1 complain thusly: 2808650bb69Smrg # icc: Command line warning: ignoring option '-M'; no argument required 2818650bb69Smrg # The diagnosis changed in icc 8.0: 2828650bb69Smrg # icc: Command line remark: option '-MP' not supported 2838650bb69Smrg if (grep 'ignoring option' conftest.err || 2848650bb69Smrg grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else 2852c7c4e3dSmrg am_cv_$1_dependencies_compiler_type=$depmode 2862c7c4e3dSmrg break 2872c7c4e3dSmrg fi 2882c7c4e3dSmrg fi 2892c7c4e3dSmrg done 2902c7c4e3dSmrg 2912c7c4e3dSmrg cd .. 2922c7c4e3dSmrg rm -rf conftest.dir 2932c7c4e3dSmrgelse 2942c7c4e3dSmrg am_cv_$1_dependencies_compiler_type=none 2952c7c4e3dSmrgfi 2962c7c4e3dSmrg]) 2972c7c4e3dSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) 2982c7c4e3dSmrgAM_CONDITIONAL([am__fastdep$1], [ 2992c7c4e3dSmrg test "x$enable_dependency_tracking" != xno \ 3002c7c4e3dSmrg && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) 3012c7c4e3dSmrg]) 3022c7c4e3dSmrg 3032c7c4e3dSmrg 3042c7c4e3dSmrg# AM_SET_DEPDIR 3052c7c4e3dSmrg# ------------- 3062c7c4e3dSmrg# Choose a directory name for dependency files. 3072c7c4e3dSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES 3082c7c4e3dSmrgAC_DEFUN([AM_SET_DEPDIR], 3092c7c4e3dSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl 3102c7c4e3dSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl 3112c7c4e3dSmrg]) 3122c7c4e3dSmrg 3132c7c4e3dSmrg 3142c7c4e3dSmrg# AM_DEP_TRACK 3152c7c4e3dSmrg# ------------ 3162c7c4e3dSmrgAC_DEFUN([AM_DEP_TRACK], 3172c7c4e3dSmrg[AC_ARG_ENABLE(dependency-tracking, 3188650bb69Smrg[ --disable-dependency-tracking speeds up one-time build 3198650bb69Smrg --enable-dependency-tracking do not reject slow dependency extractors]) 3202c7c4e3dSmrgif test "x$enable_dependency_tracking" != xno; then 3212c7c4e3dSmrg am_depcomp="$ac_aux_dir/depcomp" 3222c7c4e3dSmrg AMDEPBACKSLASH='\' 3232c7c4e3dSmrgfi 3242c7c4e3dSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) 3258650bb69SmrgAC_SUBST([AMDEPBACKSLASH])dnl 3268650bb69Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl 3272c7c4e3dSmrg]) 3282c7c4e3dSmrg 3298650bb69Smrg# Generate code to set up dependency tracking. -*- Autoconf -*- 3302c7c4e3dSmrg 3318650bb69Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 3328650bb69Smrg# Free Software Foundation, Inc. 3338650bb69Smrg# 3348650bb69Smrg# This file is free software; the Free Software Foundation 3358650bb69Smrg# gives unlimited permission to copy and/or distribute it, 3368650bb69Smrg# with or without modifications, as long as this notice is preserved. 3372c7c4e3dSmrg 3388650bb69Smrg#serial 5 3392c7c4e3dSmrg 3402c7c4e3dSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS 3412c7c4e3dSmrg# ------------------------------ 3422c7c4e3dSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], 3438650bb69Smrg[{ 3448650bb69Smrg # Autoconf 2.62 quotes --file arguments for eval, but not when files 3458650bb69Smrg # are listed without --file. Let's play safe and only enable the eval 3468650bb69Smrg # if we detect the quoting. 3478650bb69Smrg case $CONFIG_FILES in 3488650bb69Smrg *\'*) eval set x "$CONFIG_FILES" ;; 3498650bb69Smrg *) set x $CONFIG_FILES ;; 3508650bb69Smrg esac 3518650bb69Smrg shift 3528650bb69Smrg for mf 3538650bb69Smrg do 3548650bb69Smrg # Strip MF so we end up with the name of the file. 3558650bb69Smrg mf=`echo "$mf" | sed -e 's/:.*$//'` 3568650bb69Smrg # Check whether this is an Automake generated Makefile or not. 3578650bb69Smrg # We used to match only the files named `Makefile.in', but 3588650bb69Smrg # some people rename them; so instead we look at the file content. 3598650bb69Smrg # Grep'ing the first line is not enough: some people post-process 3608650bb69Smrg # each Makefile.in and add a new line on top of each file to say so. 3618650bb69Smrg # Grep'ing the whole file is not good either: AIX grep has a line 3628650bb69Smrg # limit of 2048, but all sed's we know have understand at least 4000. 3638650bb69Smrg if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then 3648650bb69Smrg dirpart=`AS_DIRNAME("$mf")` 3658650bb69Smrg else 3668650bb69Smrg continue 3678650bb69Smrg fi 3688650bb69Smrg # Extract the definition of DEPDIR, am__include, and am__quote 3698650bb69Smrg # from the Makefile without running `make'. 3708650bb69Smrg DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` 3718650bb69Smrg test -z "$DEPDIR" && continue 3728650bb69Smrg am__include=`sed -n 's/^am__include = //p' < "$mf"` 3738650bb69Smrg test -z "am__include" && continue 3748650bb69Smrg am__quote=`sed -n 's/^am__quote = //p' < "$mf"` 3758650bb69Smrg # When using ansi2knr, U may be empty or an underscore; expand it 3768650bb69Smrg U=`sed -n 's/^U = //p' < "$mf"` 3778650bb69Smrg # Find all dependency output files, they are included files with 3788650bb69Smrg # $(DEPDIR) in their names. We invoke sed twice because it is the 3798650bb69Smrg # simplest approach to changing $(DEPDIR) to its actual value in the 3808650bb69Smrg # expansion. 3818650bb69Smrg for file in `sed -n " 3828650bb69Smrg s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ 3838650bb69Smrg sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do 3848650bb69Smrg # Make sure the directory exists. 3858650bb69Smrg test -f "$dirpart/$file" && continue 3868650bb69Smrg fdir=`AS_DIRNAME(["$file"])` 3878650bb69Smrg AS_MKDIR_P([$dirpart/$fdir]) 3888650bb69Smrg # echo "creating $dirpart/$file" 3898650bb69Smrg echo '# dummy' > "$dirpart/$file" 3908650bb69Smrg done 3912c7c4e3dSmrg done 3928650bb69Smrg} 3932c7c4e3dSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS 3942c7c4e3dSmrg 3952c7c4e3dSmrg 3962c7c4e3dSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS 3972c7c4e3dSmrg# ----------------------------- 3982c7c4e3dSmrg# This macro should only be invoked once -- use via AC_REQUIRE. 3992c7c4e3dSmrg# 4002c7c4e3dSmrg# This code is only required when automatic dependency tracking 4012c7c4e3dSmrg# is enabled. FIXME. This creates each `.P' file that we will 4022c7c4e3dSmrg# need in order to bootstrap the dependency handling code. 4032c7c4e3dSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], 4042c7c4e3dSmrg[AC_CONFIG_COMMANDS([depfiles], 4052c7c4e3dSmrg [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], 4062c7c4e3dSmrg [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) 4072c7c4e3dSmrg]) 4082c7c4e3dSmrg 4098650bb69Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 4108650bb69Smrg# Free Software Foundation, Inc. 4118650bb69Smrg# 4128650bb69Smrg# This file is free software; the Free Software Foundation 4138650bb69Smrg# gives unlimited permission to copy and/or distribute it, 4148650bb69Smrg# with or without modifications, as long as this notice is preserved. 4152c7c4e3dSmrg 4168650bb69Smrg# serial 8 4172c7c4e3dSmrg 4188650bb69Smrg# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. 4198650bb69SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) 4202c7c4e3dSmrg 4218650bb69Smrg# Do all the work for Automake. -*- Autoconf -*- 4222c7c4e3dSmrg 4238650bb69Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 4248650bb69Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. 4258650bb69Smrg# 4268650bb69Smrg# This file is free software; the Free Software Foundation 4278650bb69Smrg# gives unlimited permission to copy and/or distribute it, 4288650bb69Smrg# with or without modifications, as long as this notice is preserved. 4292c7c4e3dSmrg 4308650bb69Smrg# serial 16 4312c7c4e3dSmrg 4328650bb69Smrg# This macro actually does too much. Some checks are only needed if 4338650bb69Smrg# your package does certain things. But this isn't really a big deal. 4348650bb69Smrg 4358650bb69Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 4368650bb69Smrg# AM_INIT_AUTOMAKE([OPTIONS]) 4378650bb69Smrg# ----------------------------------------------- 4388650bb69Smrg# The call with PACKAGE and VERSION arguments is the old style 4398650bb69Smrg# call (pre autoconf-2.50), which is being phased out. PACKAGE 4408650bb69Smrg# and VERSION should now be passed to AC_INIT and removed from 4418650bb69Smrg# the call to AM_INIT_AUTOMAKE. 4428650bb69Smrg# We support both call styles for the transition. After 4438650bb69Smrg# the next Automake release, Autoconf can make the AC_INIT 4448650bb69Smrg# arguments mandatory, and then we can depend on a new Autoconf 4458650bb69Smrg# release and drop the old call support. 4468650bb69SmrgAC_DEFUN([AM_INIT_AUTOMAKE], 4478650bb69Smrg[AC_PREREQ([2.62])dnl 4488650bb69Smrgdnl Autoconf wants to disallow AM_ names. We explicitly allow 4498650bb69Smrgdnl the ones we care about. 4508650bb69Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 4518650bb69SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 4528650bb69SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl 4538650bb69Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then 4548650bb69Smrg # Use -I$(srcdir) only when $(srcdir) != ., so that make's output 4558650bb69Smrg # is not polluted with repeated "-I." 4568650bb69Smrg AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl 4578650bb69Smrg # test to see if srcdir already configured 4588650bb69Smrg if test -f $srcdir/config.status; then 4598650bb69Smrg AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 4608650bb69Smrg fi 4612c7c4e3dSmrgfi 4628650bb69Smrg 4638650bb69Smrg# test whether we have cygpath 4648650bb69Smrgif test -z "$CYGPATH_W"; then 4658650bb69Smrg if (cygpath --version) >/dev/null 2>/dev/null; then 4668650bb69Smrg CYGPATH_W='cygpath -w' 4678650bb69Smrg else 4688650bb69Smrg CYGPATH_W=echo 4698650bb69Smrg fi 4702c7c4e3dSmrgfi 4718650bb69SmrgAC_SUBST([CYGPATH_W]) 4722c7c4e3dSmrg 4738650bb69Smrg# Define the identity of the package. 4748650bb69Smrgdnl Distinguish between old-style and new-style calls. 4758650bb69Smrgm4_ifval([$2], 4768650bb69Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 4778650bb69Smrg AC_SUBST([PACKAGE], [$1])dnl 4788650bb69Smrg AC_SUBST([VERSION], [$2])], 4798650bb69Smrg[_AM_SET_OPTIONS([$1])dnl 4808650bb69Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. 4818650bb69Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, 4828650bb69Smrg [m4_fatal([AC_INIT should be called with package and version arguments])])dnl 4838650bb69Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl 4848650bb69Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl 4852c7c4e3dSmrg 4868650bb69Smrg_AM_IF_OPTION([no-define],, 4878650bb69Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) 4888650bb69Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl 4892c7c4e3dSmrg 4908650bb69Smrg# Some tools Automake needs. 4918650bb69SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl 4928650bb69SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl 4938650bb69SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) 4948650bb69SmrgAM_MISSING_PROG(AUTOCONF, autoconf) 4958650bb69SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) 4968650bb69SmrgAM_MISSING_PROG(AUTOHEADER, autoheader) 4978650bb69SmrgAM_MISSING_PROG(MAKEINFO, makeinfo) 4988650bb69SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl 4998650bb69SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl 5008650bb69SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl 5018650bb69Smrg# We need awk for the "check" target. The system "awk" is bad on 5028650bb69Smrg# some platforms. 5038650bb69SmrgAC_REQUIRE([AC_PROG_AWK])dnl 5048650bb69SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl 5058650bb69SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl 5068650bb69Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], 5078650bb69Smrg [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], 5088650bb69Smrg [_AM_PROG_TAR([v7])])]) 5098650bb69Smrg_AM_IF_OPTION([no-dependencies],, 5108650bb69Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC], 5118650bb69Smrg [_AM_DEPENDENCIES(CC)], 5128650bb69Smrg [define([AC_PROG_CC], 5138650bb69Smrg defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl 5148650bb69SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX], 5158650bb69Smrg [_AM_DEPENDENCIES(CXX)], 5168650bb69Smrg [define([AC_PROG_CXX], 5178650bb69Smrg defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl 5188650bb69SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC], 5198650bb69Smrg [_AM_DEPENDENCIES(OBJC)], 5208650bb69Smrg [define([AC_PROG_OBJC], 5218650bb69Smrg defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl 5228650bb69Smrg]) 5238650bb69Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl 5248650bb69Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the 5258650bb69Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro 5268650bb69Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below. 5278650bb69SmrgAC_CONFIG_COMMANDS_PRE(dnl 5288650bb69Smrg[m4_provide_if([_AM_COMPILER_EXEEXT], 5298650bb69Smrg [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl 5308650bb69Smrg]) 5312c7c4e3dSmrg 5328650bb69Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not 5338650bb69Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further 5348650bb69Smrgdnl mangled by Autoconf and run in a shell conditional statement. 5358650bb69Smrgm4_define([_AC_COMPILER_EXEEXT], 5368650bb69Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) 5372c7c4e3dSmrg 5382c7c4e3dSmrg 5398650bb69Smrg# When config.status generates a header, we must update the stamp-h file. 5408650bb69Smrg# This file resides in the same directory as the config header 5418650bb69Smrg# that is generated. The stamp files are numbered to have different names. 5428650bb69Smrg 5438650bb69Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 5448650bb69Smrg# loop where config.status creates the headers, so we can generate 5458650bb69Smrg# our stamp files there. 5468650bb69SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 5478650bb69Smrg[# Compute $1's index in $config_headers. 5488650bb69Smrg_am_arg=$1 5498650bb69Smrg_am_stamp_count=1 5508650bb69Smrgfor _am_header in $config_headers :; do 5518650bb69Smrg case $_am_header in 5528650bb69Smrg $_am_arg | $_am_arg:* ) 5538650bb69Smrg break ;; 5548650bb69Smrg * ) 5558650bb69Smrg _am_stamp_count=`expr $_am_stamp_count + 1` ;; 5568650bb69Smrg esac 5578650bb69Smrgdone 5588650bb69Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) 5592c7c4e3dSmrg 5608650bb69Smrg# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. 5618650bb69Smrg# 5628650bb69Smrg# This file is free software; the Free Software Foundation 5638650bb69Smrg# gives unlimited permission to copy and/or distribute it, 5648650bb69Smrg# with or without modifications, as long as this notice is preserved. 5652c7c4e3dSmrg 5668650bb69Smrg# AM_PROG_INSTALL_SH 5678650bb69Smrg# ------------------ 5688650bb69Smrg# Define $install_sh. 5698650bb69SmrgAC_DEFUN([AM_PROG_INSTALL_SH], 5708650bb69Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 5718650bb69Smrgif test x"${install_sh}" != xset; then 5728650bb69Smrg case $am_aux_dir in 5738650bb69Smrg *\ * | *\ *) 5748650bb69Smrg install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; 5758650bb69Smrg *) 5768650bb69Smrg install_sh="\${SHELL} $am_aux_dir/install-sh" 5778650bb69Smrg esac 5782c7c4e3dSmrgfi 5798650bb69SmrgAC_SUBST(install_sh)]) 5802c7c4e3dSmrg 5818650bb69Smrg# Copyright (C) 2003, 2005 Free Software Foundation, Inc. 5828650bb69Smrg# 5838650bb69Smrg# This file is free software; the Free Software Foundation 5848650bb69Smrg# gives unlimited permission to copy and/or distribute it, 5858650bb69Smrg# with or without modifications, as long as this notice is preserved. 5862c7c4e3dSmrg 5878650bb69Smrg# serial 2 5882c7c4e3dSmrg 5898650bb69Smrg# Check whether the underlying file-system supports filenames 5908650bb69Smrg# with a leading dot. For instance MS-DOS doesn't. 5918650bb69SmrgAC_DEFUN([AM_SET_LEADING_DOT], 5928650bb69Smrg[rm -rf .tst 2>/dev/null 5938650bb69Smrgmkdir .tst 2>/dev/null 5948650bb69Smrgif test -d .tst; then 5958650bb69Smrg am__leading_dot=. 5968650bb69Smrgelse 5978650bb69Smrg am__leading_dot=_ 5988650bb69Smrgfi 5998650bb69Smrgrmdir .tst 2>/dev/null 6008650bb69SmrgAC_SUBST([am__leading_dot])]) 6012c7c4e3dSmrg 6028650bb69Smrg# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- 6038650bb69Smrg# From Jim Meyering 6042c7c4e3dSmrg 6058650bb69Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 6068650bb69Smrg# Free Software Foundation, Inc. 6078650bb69Smrg# 6088650bb69Smrg# This file is free software; the Free Software Foundation 6098650bb69Smrg# gives unlimited permission to copy and/or distribute it, 6108650bb69Smrg# with or without modifications, as long as this notice is preserved. 6112c7c4e3dSmrg 6128650bb69Smrg# serial 5 6132c7c4e3dSmrg 6148650bb69Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE]) 6158650bb69Smrg# ---------------------------------- 6168650bb69Smrg# Control maintainer-specific portions of Makefiles. 6178650bb69Smrg# Default is to disable them, unless `enable' is passed literally. 6188650bb69Smrg# For symmetry, `disable' may be passed as well. Anyway, the user 6198650bb69Smrg# can override the default with the --enable/--disable switch. 6202c7c4e3dSmrgAC_DEFUN([AM_MAINTAINER_MODE], 6218650bb69Smrg[m4_case(m4_default([$1], [disable]), 6228650bb69Smrg [enable], [m4_define([am_maintainer_other], [disable])], 6238650bb69Smrg [disable], [m4_define([am_maintainer_other], [enable])], 6248650bb69Smrg [m4_define([am_maintainer_other], [enable]) 6258650bb69Smrg m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) 6268650bb69SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) 6278650bb69Smrg dnl maintainer-mode's default is 'disable' unless 'enable' is passed 6288650bb69Smrg AC_ARG_ENABLE([maintainer-mode], 6298650bb69Smrg[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful 6308650bb69Smrg (and sometimes confusing) to the casual installer], 6318650bb69Smrg [USE_MAINTAINER_MODE=$enableval], 6328650bb69Smrg [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) 6332c7c4e3dSmrg AC_MSG_RESULT([$USE_MAINTAINER_MODE]) 6348650bb69Smrg AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) 6352c7c4e3dSmrg MAINT=$MAINTAINER_MODE_TRUE 6368650bb69Smrg AC_SUBST([MAINT])dnl 6372c7c4e3dSmrg] 6382c7c4e3dSmrg) 6392c7c4e3dSmrg 6402c7c4e3dSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) 6412c7c4e3dSmrg 6428650bb69Smrg# Check to see how 'make' treats includes. -*- Autoconf -*- 6432c7c4e3dSmrg 6448650bb69Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. 6458650bb69Smrg# 6468650bb69Smrg# This file is free software; the Free Software Foundation 6478650bb69Smrg# gives unlimited permission to copy and/or distribute it, 6488650bb69Smrg# with or without modifications, as long as this notice is preserved. 6492c7c4e3dSmrg 6508650bb69Smrg# serial 4 6512c7c4e3dSmrg 6528650bb69Smrg# AM_MAKE_INCLUDE() 6538650bb69Smrg# ----------------- 6548650bb69Smrg# Check to see how make treats includes. 6558650bb69SmrgAC_DEFUN([AM_MAKE_INCLUDE], 6568650bb69Smrg[am_make=${MAKE-make} 6578650bb69Smrgcat > confinc << 'END' 6588650bb69Smrgam__doit: 6598650bb69Smrg @echo this is the am__doit target 6608650bb69Smrg.PHONY: am__doit 6618650bb69SmrgEND 6628650bb69Smrg# If we don't find an include directive, just comment out the code. 6638650bb69SmrgAC_MSG_CHECKING([for style of include used by $am_make]) 6648650bb69Smrgam__include="#" 6658650bb69Smrgam__quote= 6668650bb69Smrg_am_result=none 6678650bb69Smrg# First try GNU make style include. 6688650bb69Smrgecho "include confinc" > confmf 6698650bb69Smrg# Ignore all kinds of additional output from `make'. 6708650bb69Smrgcase `$am_make -s -f confmf 2> /dev/null` in #( 6718650bb69Smrg*the\ am__doit\ target*) 6728650bb69Smrg am__include=include 6738650bb69Smrg am__quote= 6748650bb69Smrg _am_result=GNU 6758650bb69Smrg ;; 6768650bb69Smrgesac 6778650bb69Smrg# Now try BSD make style include. 6788650bb69Smrgif test "$am__include" = "#"; then 6798650bb69Smrg echo '.include "confinc"' > confmf 6808650bb69Smrg case `$am_make -s -f confmf 2> /dev/null` in #( 6818650bb69Smrg *the\ am__doit\ target*) 6828650bb69Smrg am__include=.include 6838650bb69Smrg am__quote="\"" 6848650bb69Smrg _am_result=BSD 6858650bb69Smrg ;; 6868650bb69Smrg esac 6878650bb69Smrgfi 6888650bb69SmrgAC_SUBST([am__include]) 6898650bb69SmrgAC_SUBST([am__quote]) 6908650bb69SmrgAC_MSG_RESULT([$_am_result]) 6918650bb69Smrgrm -f confinc confmf 6928650bb69Smrg]) 6932c7c4e3dSmrg 6948650bb69Smrg# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- 6952c7c4e3dSmrg 6968650bb69Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 6978650bb69Smrg# Free Software Foundation, Inc. 6988650bb69Smrg# 6998650bb69Smrg# This file is free software; the Free Software Foundation 7008650bb69Smrg# gives unlimited permission to copy and/or distribute it, 7018650bb69Smrg# with or without modifications, as long as this notice is preserved. 7022c7c4e3dSmrg 7032c7c4e3dSmrg# serial 6 7042c7c4e3dSmrg 7058650bb69Smrg# AM_MISSING_PROG(NAME, PROGRAM) 7068650bb69Smrg# ------------------------------ 7078650bb69SmrgAC_DEFUN([AM_MISSING_PROG], 7088650bb69Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN]) 7098650bb69Smrg$1=${$1-"${am_missing_run}$2"} 7108650bb69SmrgAC_SUBST($1)]) 7112c7c4e3dSmrg 7122c7c4e3dSmrg 7138650bb69Smrg# AM_MISSING_HAS_RUN 7148650bb69Smrg# ------------------ 7158650bb69Smrg# Define MISSING if not defined so far and test if it supports --run. 7168650bb69Smrg# If it does, set am_missing_run to use it, otherwise, to nothing. 7178650bb69SmrgAC_DEFUN([AM_MISSING_HAS_RUN], 7188650bb69Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 7198650bb69SmrgAC_REQUIRE_AUX_FILE([missing])dnl 7208650bb69Smrgif test x"${MISSING+set}" != xset; then 7218650bb69Smrg case $am_aux_dir in 7228650bb69Smrg *\ * | *\ *) 7238650bb69Smrg MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; 7248650bb69Smrg *) 7258650bb69Smrg MISSING="\${SHELL} $am_aux_dir/missing" ;; 7268650bb69Smrg esac 7272c7c4e3dSmrgfi 7288650bb69Smrg# Use eval to expand $SHELL 7298650bb69Smrgif eval "$MISSING --run true"; then 7308650bb69Smrg am_missing_run="$MISSING --run " 7318650bb69Smrgelse 7328650bb69Smrg am_missing_run= 7338650bb69Smrg AC_MSG_WARN([`missing' script is too old or missing]) 7348650bb69Smrgfi 7358650bb69Smrg]) 7362c7c4e3dSmrg 7378650bb69Smrg# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 7382c7c4e3dSmrg# 7398650bb69Smrg# This file is free software; the Free Software Foundation 7408650bb69Smrg# gives unlimited permission to copy and/or distribute it, 7418650bb69Smrg# with or without modifications, as long as this notice is preserved. 7428650bb69Smrg 7438650bb69Smrg# AM_PROG_MKDIR_P 7448650bb69Smrg# --------------- 7458650bb69Smrg# Check for `mkdir -p'. 7468650bb69SmrgAC_DEFUN([AM_PROG_MKDIR_P], 7478650bb69Smrg[AC_PREREQ([2.60])dnl 7488650bb69SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl 7498650bb69Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, 7508650bb69Smrgdnl while keeping a definition of mkdir_p for backward compatibility. 7518650bb69Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. 7528650bb69Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of 7538650bb69Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own 7548650bb69Smrgdnl adjustment using top_builddir (which is defined more often than 7558650bb69Smrgdnl MKDIR_P). 7568650bb69SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl 7578650bb69Smrgcase $mkdir_p in 7588650bb69Smrg [[\\/$]]* | ?:[[\\/]]*) ;; 7598650bb69Smrg */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; 7608650bb69Smrgesac 7618650bb69Smrg]) 7628650bb69Smrg 7638650bb69Smrg# Helper functions for option handling. -*- Autoconf -*- 7648650bb69Smrg 7658650bb69Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. 7662c7c4e3dSmrg# 7678650bb69Smrg# This file is free software; the Free Software Foundation 7688650bb69Smrg# gives unlimited permission to copy and/or distribute it, 7698650bb69Smrg# with or without modifications, as long as this notice is preserved. 7702c7c4e3dSmrg 7718650bb69Smrg# serial 4 7722c7c4e3dSmrg 7738650bb69Smrg# _AM_MANGLE_OPTION(NAME) 7748650bb69Smrg# ----------------------- 7758650bb69SmrgAC_DEFUN([_AM_MANGLE_OPTION], 7768650bb69Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 7772c7c4e3dSmrg 7788650bb69Smrg# _AM_SET_OPTION(NAME) 7798650bb69Smrg# ------------------------------ 7808650bb69Smrg# Set option NAME. Presently that only means defining a flag for this option. 7818650bb69SmrgAC_DEFUN([_AM_SET_OPTION], 7828650bb69Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) 7832c7c4e3dSmrg 7848650bb69Smrg# _AM_SET_OPTIONS(OPTIONS) 7858650bb69Smrg# ---------------------------------- 7868650bb69Smrg# OPTIONS is a space-separated list of Automake options. 7878650bb69SmrgAC_DEFUN([_AM_SET_OPTIONS], 7888650bb69Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 7892c7c4e3dSmrg 7908650bb69Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 7918650bb69Smrg# ------------------------------------------- 7928650bb69Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 7938650bb69SmrgAC_DEFUN([_AM_IF_OPTION], 7948650bb69Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 7958650bb69Smrg 7968650bb69Smrg# Check to make sure that the build environment is sane. -*- Autoconf -*- 7978650bb69Smrg 7988650bb69Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 7998650bb69Smrg# Free Software Foundation, Inc. 8002c7c4e3dSmrg# 8018650bb69Smrg# This file is free software; the Free Software Foundation 8028650bb69Smrg# gives unlimited permission to copy and/or distribute it, 8038650bb69Smrg# with or without modifications, as long as this notice is preserved. 8048650bb69Smrg 8058650bb69Smrg# serial 5 8068650bb69Smrg 8078650bb69Smrg# AM_SANITY_CHECK 8088650bb69Smrg# --------------- 8098650bb69SmrgAC_DEFUN([AM_SANITY_CHECK], 8108650bb69Smrg[AC_MSG_CHECKING([whether build environment is sane]) 8118650bb69Smrg# Just in case 8128650bb69Smrgsleep 1 8138650bb69Smrgecho timestamp > conftest.file 8148650bb69Smrg# Reject unsafe characters in $srcdir or the absolute working directory 8158650bb69Smrg# name. Accept space and tab only in the latter. 8168650bb69Smrgam_lf=' 8178650bb69Smrg' 8188650bb69Smrgcase `pwd` in 8198650bb69Smrg *[[\\\"\#\$\&\'\`$am_lf]]*) 8208650bb69Smrg AC_MSG_ERROR([unsafe absolute working directory name]);; 8218650bb69Smrgesac 8228650bb69Smrgcase $srcdir in 8238650bb69Smrg *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) 8248650bb69Smrg AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; 8258650bb69Smrgesac 8268650bb69Smrg 8278650bb69Smrg# Do `set' in a subshell so we don't clobber the current shell's 8288650bb69Smrg# arguments. Must try -L first in case configure is actually a 8298650bb69Smrg# symlink; some systems play weird games with the mod time of symlinks 8308650bb69Smrg# (eg FreeBSD returns the mod time of the symlink's containing 8318650bb69Smrg# directory). 8328650bb69Smrgif ( 8338650bb69Smrg set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` 8348650bb69Smrg if test "$[*]" = "X"; then 8358650bb69Smrg # -L didn't work. 8368650bb69Smrg set X `ls -t "$srcdir/configure" conftest.file` 8378650bb69Smrg fi 8388650bb69Smrg rm -f conftest.file 8398650bb69Smrg if test "$[*]" != "X $srcdir/configure conftest.file" \ 8408650bb69Smrg && test "$[*]" != "X conftest.file $srcdir/configure"; then 8418650bb69Smrg 8428650bb69Smrg # If neither matched, then we have a broken ls. This can happen 8438650bb69Smrg # if, for instance, CONFIG_SHELL is bash and it inherits a 8448650bb69Smrg # broken ls alias from the environment. This has actually 8458650bb69Smrg # happened. Such a system could not be considered "sane". 8468650bb69Smrg AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 8478650bb69Smrgalias in your environment]) 8488650bb69Smrg fi 8498650bb69Smrg 8508650bb69Smrg test "$[2]" = conftest.file 8518650bb69Smrg ) 8528650bb69Smrgthen 8538650bb69Smrg # Ok. 8548650bb69Smrg : 8558650bb69Smrgelse 8568650bb69Smrg AC_MSG_ERROR([newly created file is older than distributed files! 8578650bb69SmrgCheck your system clock]) 8588650bb69Smrgfi 8598650bb69SmrgAC_MSG_RESULT(yes)]) 8608650bb69Smrg 8618650bb69Smrg# Copyright (C) 2009 Free Software Foundation, Inc. 8622c7c4e3dSmrg# 8638650bb69Smrg# This file is free software; the Free Software Foundation 8648650bb69Smrg# gives unlimited permission to copy and/or distribute it, 8658650bb69Smrg# with or without modifications, as long as this notice is preserved. 8668650bb69Smrg 8678650bb69Smrg# serial 1 8688650bb69Smrg 8698650bb69Smrg# AM_SILENT_RULES([DEFAULT]) 8708650bb69Smrg# -------------------------- 8718650bb69Smrg# Enable less verbose build rules; with the default set to DEFAULT 8728650bb69Smrg# (`yes' being less verbose, `no' or empty being verbose). 8738650bb69SmrgAC_DEFUN([AM_SILENT_RULES], 8748650bb69Smrg[AC_ARG_ENABLE([silent-rules], 8758650bb69Smrg[ --enable-silent-rules less verbose build output (undo: `make V=1') 8768650bb69Smrg --disable-silent-rules verbose build output (undo: `make V=0')]) 8778650bb69Smrgcase $enable_silent_rules in 8788650bb69Smrgyes) AM_DEFAULT_VERBOSITY=0;; 8798650bb69Smrgno) AM_DEFAULT_VERBOSITY=1;; 8808650bb69Smrg*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; 8818650bb69Smrgesac 8828650bb69SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl 8838650bb69SmrgAM_BACKSLASH='\' 8848650bb69SmrgAC_SUBST([AM_BACKSLASH])dnl 8858650bb69Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl 8868650bb69Smrg]) 8878650bb69Smrg 8888650bb69Smrg# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 8892c7c4e3dSmrg# 8908650bb69Smrg# This file is free software; the Free Software Foundation 8918650bb69Smrg# gives unlimited permission to copy and/or distribute it, 8928650bb69Smrg# with or without modifications, as long as this notice is preserved. 8932c7c4e3dSmrg 8948650bb69Smrg# AM_PROG_INSTALL_STRIP 8958650bb69Smrg# --------------------- 8968650bb69Smrg# One issue with vendor `install' (even GNU) is that you can't 8978650bb69Smrg# specify the program used to strip binaries. This is especially 8988650bb69Smrg# annoying in cross-compiling environments, where the build's strip 8998650bb69Smrg# is unlikely to handle the host's binaries. 9008650bb69Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we 9018650bb69Smrg# always use install-sh in `make install-strip', and initialize 9028650bb69Smrg# STRIPPROG with the value of the STRIP variable (set by the user). 9038650bb69SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP], 9048650bb69Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 9058650bb69Smrg# Installed binaries are usually stripped using `strip' when the user 9068650bb69Smrg# run `make install-strip'. However `strip' might not be the right 9078650bb69Smrg# tool to use in cross-compilation environments, therefore Automake 9088650bb69Smrg# will honor the `STRIP' environment variable to overrule this program. 9098650bb69Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'. 9108650bb69Smrgif test "$cross_compiling" != no; then 9118650bb69Smrg AC_CHECK_TOOL([STRIP], [strip], :) 9128650bb69Smrgfi 9138650bb69SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" 9148650bb69SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])]) 9152c7c4e3dSmrg 9168650bb69Smrg# Copyright (C) 2006, 2008 Free Software Foundation, Inc. 9178650bb69Smrg# 9188650bb69Smrg# This file is free software; the Free Software Foundation 9198650bb69Smrg# gives unlimited permission to copy and/or distribute it, 9208650bb69Smrg# with or without modifications, as long as this notice is preserved. 9212c7c4e3dSmrg 9228650bb69Smrg# serial 2 9232c7c4e3dSmrg 9248650bb69Smrg# _AM_SUBST_NOTMAKE(VARIABLE) 9258650bb69Smrg# --------------------------- 9268650bb69Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. 9278650bb69Smrg# This macro is traced by Automake. 9288650bb69SmrgAC_DEFUN([_AM_SUBST_NOTMAKE]) 9292c7c4e3dSmrg 9308650bb69Smrg# AM_SUBST_NOTMAKE(VARIABLE) 9318650bb69Smrg# --------------------------- 9328650bb69Smrg# Public sister of _AM_SUBST_NOTMAKE. 9338650bb69SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) 9342c7c4e3dSmrg 9358650bb69Smrg# Check how to create a tarball. -*- Autoconf -*- 9362c7c4e3dSmrg 9378650bb69Smrg# Copyright (C) 2004, 2005 Free Software Foundation, Inc. 9388650bb69Smrg# 9398650bb69Smrg# This file is free software; the Free Software Foundation 9408650bb69Smrg# gives unlimited permission to copy and/or distribute it, 9418650bb69Smrg# with or without modifications, as long as this notice is preserved. 9422c7c4e3dSmrg 9438650bb69Smrg# serial 2 9442c7c4e3dSmrg 9458650bb69Smrg# _AM_PROG_TAR(FORMAT) 9468650bb69Smrg# -------------------- 9478650bb69Smrg# Check how to create a tarball in format FORMAT. 9488650bb69Smrg# FORMAT should be one of `v7', `ustar', or `pax'. 9498650bb69Smrg# 9508650bb69Smrg# Substitute a variable $(am__tar) that is a command 9518650bb69Smrg# writing to stdout a FORMAT-tarball containing the directory 9528650bb69Smrg# $tardir. 9538650bb69Smrg# tardir=directory && $(am__tar) > result.tar 9548650bb69Smrg# 9558650bb69Smrg# Substitute a variable $(am__untar) that extract such 9568650bb69Smrg# a tarball read from stdin. 9578650bb69Smrg# $(am__untar) < result.tar 9588650bb69SmrgAC_DEFUN([_AM_PROG_TAR], 9598650bb69Smrg[# Always define AMTAR for backward compatibility. 9608650bb69SmrgAM_MISSING_PROG([AMTAR], [tar]) 9618650bb69Smrgm4_if([$1], [v7], 9628650bb69Smrg [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], 9638650bb69Smrg [m4_case([$1], [ustar],, [pax],, 9648650bb69Smrg [m4_fatal([Unknown tar format])]) 9658650bb69SmrgAC_MSG_CHECKING([how to create a $1 tar archive]) 9668650bb69Smrg# Loop over all known methods to create a tar archive until one works. 9678650bb69Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' 9688650bb69Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools} 9698650bb69Smrg# Do not fold the above two line into one, because Tru64 sh and 9708650bb69Smrg# Solaris sh will not grok spaces in the rhs of `-'. 9718650bb69Smrgfor _am_tool in $_am_tools 9728650bb69Smrgdo 9738650bb69Smrg case $_am_tool in 9748650bb69Smrg gnutar) 9758650bb69Smrg for _am_tar in tar gnutar gtar; 9768650bb69Smrg do 9778650bb69Smrg AM_RUN_LOG([$_am_tar --version]) && break 9788650bb69Smrg done 9798650bb69Smrg am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' 9808650bb69Smrg am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' 9818650bb69Smrg am__untar="$_am_tar -xf -" 9828650bb69Smrg ;; 9838650bb69Smrg plaintar) 9848650bb69Smrg # Must skip GNU tar: if it does not support --format= it doesn't create 9858650bb69Smrg # ustar tarball either. 9868650bb69Smrg (tar --version) >/dev/null 2>&1 && continue 9878650bb69Smrg am__tar='tar chf - "$$tardir"' 9888650bb69Smrg am__tar_='tar chf - "$tardir"' 9898650bb69Smrg am__untar='tar xf -' 9908650bb69Smrg ;; 9918650bb69Smrg pax) 9928650bb69Smrg am__tar='pax -L -x $1 -w "$$tardir"' 9938650bb69Smrg am__tar_='pax -L -x $1 -w "$tardir"' 9948650bb69Smrg am__untar='pax -r' 9958650bb69Smrg ;; 9968650bb69Smrg cpio) 9978650bb69Smrg am__tar='find "$$tardir" -print | cpio -o -H $1 -L' 9988650bb69Smrg am__tar_='find "$tardir" -print | cpio -o -H $1 -L' 9998650bb69Smrg am__untar='cpio -i -H $1 -d' 10008650bb69Smrg ;; 10018650bb69Smrg none) 10028650bb69Smrg am__tar=false 10038650bb69Smrg am__tar_=false 10048650bb69Smrg am__untar=false 10058650bb69Smrg ;; 10068650bb69Smrg esac 10072c7c4e3dSmrg 10088650bb69Smrg # If the value was cached, stop now. We just wanted to have am__tar 10098650bb69Smrg # and am__untar set. 10108650bb69Smrg test -n "${am_cv_prog_tar_$1}" && break 10118650bb69Smrg 10128650bb69Smrg # tar/untar a dummy directory, and stop if the command works 10138650bb69Smrg rm -rf conftest.dir 10148650bb69Smrg mkdir conftest.dir 10158650bb69Smrg echo GrepMe > conftest.dir/file 10168650bb69Smrg AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) 10178650bb69Smrg rm -rf conftest.dir 10188650bb69Smrg if test -s conftest.tar; then 10198650bb69Smrg AM_RUN_LOG([$am__untar <conftest.tar]) 10208650bb69Smrg grep GrepMe conftest.dir/file >/dev/null 2>&1 && break 10218650bb69Smrg fi 10228650bb69Smrgdone 10238650bb69Smrgrm -rf conftest.dir 10242c7c4e3dSmrg 10258650bb69SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) 10268650bb69SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])]) 10278650bb69SmrgAC_SUBST([am__tar]) 10288650bb69SmrgAC_SUBST([am__untar]) 10298650bb69Smrg]) # _AM_PROG_TAR 10308650bb69Smrg 10318650bb69Smrgdnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. 10322c7c4e3dSmrgdnl 10338650bb69Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved. 10342c7c4e3dSmrgdnl 10358650bb69Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a 10368650bb69Smrgdnl copy of this software and associated documentation files (the 10378650bb69Smrgdnl "Software"), to deal in the Software without restriction, including 10388650bb69Smrgdnl without limitation the rights to use, copy, modify, merge, publish, 10398650bb69Smrgdnl distribute, and/or sell copies of the Software, and to permit persons 10408650bb69Smrgdnl to whom the Software is furnished to do so, provided that the above 10418650bb69Smrgdnl copyright notice(s) and this permission notice appear in all copies of 10428650bb69Smrgdnl the Software and that both the above copyright notice(s) and this 10438650bb69Smrgdnl permission notice appear in supporting documentation. 10448650bb69Smrgdnl 10452c7c4e3dSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 10462c7c4e3dSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 10478650bb69Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 10488650bb69Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 10498650bb69Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL 10508650bb69Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING 10518650bb69Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 10528650bb69Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 10538650bb69Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 10548650bb69Smrgdnl 10558650bb69Smrgdnl Except as contained in this notice, the name of a copyright holder 10568650bb69Smrgdnl shall not be used in advertising or otherwise to promote the sale, use 10578650bb69Smrgdnl or other dealings in this Software without prior written authorization 10588650bb69Smrgdnl of the copyright holder. 10598650bb69Smrg 10608650bb69Smrg# XORG_MACROS_VERSION(required-version) 10618650bb69Smrg# ------------------------------------- 10628650bb69Smrg# Minimum version: 1.1.0 10638650bb69Smrg# 10648650bb69Smrg# If you're using a macro added in Version 1.1 or newer, include this in 10658650bb69Smrg# your configure.ac with the minimum required version, such as: 10668650bb69Smrg# XORG_MACROS_VERSION(1.1) 10678650bb69Smrg# 10688650bb69Smrg# To ensure that this macro is defined, also add: 10698650bb69Smrg# m4_ifndef([XORG_MACROS_VERSION], 10708650bb69Smrg# [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])]) 10718650bb69Smrg# 10728650bb69Smrg# 10738650bb69Smrg# See the "minimum version" comment for each macro you use to see what 10748650bb69Smrg# version you require. 10758650bb69Smrgm4_defun([XORG_MACROS_VERSION],[ 10768650bb69Smrgm4_define([vers_have], [1.3.0]) 10778650bb69Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) 10788650bb69Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) 10798650bb69Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,, 10808650bb69Smrg [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])]) 10818650bb69Smrgm4_if(m4_version_compare(vers_have, [$1]), -1, 10828650bb69Smrg [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])]) 10838650bb69Smrgm4_undefine([vers_have]) 10848650bb69Smrgm4_undefine([maj_have]) 10858650bb69Smrgm4_undefine([maj_needed]) 10868650bb69Smrg]) # XORG_MACROS_VERSION 10872c7c4e3dSmrg 10882c7c4e3dSmrg# XORG_PROG_RAWCPP() 10892c7c4e3dSmrg# ------------------ 10908650bb69Smrg# Minimum version: 1.0.0 10918650bb69Smrg# 10922c7c4e3dSmrg# Find cpp program and necessary flags for use in pre-processing text files 10932c7c4e3dSmrg# such as man pages and config files 10942c7c4e3dSmrgAC_DEFUN([XORG_PROG_RAWCPP],[ 10952c7c4e3dSmrgAC_REQUIRE([AC_PROG_CPP]) 10962c7c4e3dSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 10972c7c4e3dSmrg [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) 10982c7c4e3dSmrg 10992c7c4e3dSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined, 11002c7c4e3dSmrg# which is not the best choice for supporting other OS'es, but covers most 11012c7c4e3dSmrg# of the ones we need for now. 11022c7c4e3dSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef]) 11032c7c4e3dSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?]) 11042c7c4e3dSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 11052c7c4e3dSmrg AC_MSG_RESULT([no]) 11062c7c4e3dSmrgelse 11072c7c4e3dSmrg if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 11082c7c4e3dSmrg RAWCPPFLAGS=-undef 11092c7c4e3dSmrg AC_MSG_RESULT([yes]) 11108650bb69Smrg # under Cygwin unix is still defined even with -undef 11118650bb69Smrg elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 11128650bb69Smrg RAWCPPFLAGS="-undef -ansi" 11138650bb69Smrg AC_MSG_RESULT([yes, with -ansi]) 11142c7c4e3dSmrg else 11152c7c4e3dSmrg AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.]) 11162c7c4e3dSmrg fi 11172c7c4e3dSmrgfi 11182c7c4e3dSmrgrm -f conftest.$ac_ext 11192c7c4e3dSmrg 11202c7c4e3dSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional]) 11212c7c4e3dSmrgAC_LANG_CONFTEST([Does cpp preserve "whitespace"?]) 11222c7c4e3dSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 11232c7c4e3dSmrg AC_MSG_RESULT([no]) 11242c7c4e3dSmrgelse 11252c7c4e3dSmrg if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 11262c7c4e3dSmrg RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" 11272c7c4e3dSmrg AC_MSG_RESULT([yes]) 11282c7c4e3dSmrg else 11292c7c4e3dSmrg AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) 11302c7c4e3dSmrg fi 11312c7c4e3dSmrgfi 11322c7c4e3dSmrgrm -f conftest.$ac_ext 11332c7c4e3dSmrgAC_SUBST(RAWCPPFLAGS) 11342c7c4e3dSmrg]) # XORG_PROG_RAWCPP 11352c7c4e3dSmrg 11362c7c4e3dSmrg# XORG_MANPAGE_SECTIONS() 11372c7c4e3dSmrg# ----------------------- 11388650bb69Smrg# Minimum version: 1.0.0 11398650bb69Smrg# 11402c7c4e3dSmrg# Determine which sections man pages go in for the different man page types 11412c7c4e3dSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. 11422c7c4e3dSmrg# Not sure if there's any better way than just hardcoding by OS name. 11432c7c4e3dSmrg# Override default settings by setting environment variables 11442c7c4e3dSmrg 11452c7c4e3dSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[ 11462c7c4e3dSmrgAC_REQUIRE([AC_CANONICAL_HOST]) 11472c7c4e3dSmrg 11482c7c4e3dSmrgif test x$APP_MAN_SUFFIX = x ; then 11498650bb69Smrg APP_MAN_SUFFIX=1 11502c7c4e3dSmrgfi 11512c7c4e3dSmrgif test x$APP_MAN_DIR = x ; then 11528650bb69Smrg APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' 11532c7c4e3dSmrgfi 11542c7c4e3dSmrg 11552c7c4e3dSmrgif test x$LIB_MAN_SUFFIX = x ; then 11568650bb69Smrg LIB_MAN_SUFFIX=3 11572c7c4e3dSmrgfi 11582c7c4e3dSmrgif test x$LIB_MAN_DIR = x ; then 11598650bb69Smrg LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' 11602c7c4e3dSmrgfi 11612c7c4e3dSmrg 11622c7c4e3dSmrgif test x$FILE_MAN_SUFFIX = x ; then 11632c7c4e3dSmrg case $host_os in 11642c7c4e3dSmrg solaris*) FILE_MAN_SUFFIX=4 ;; 11652c7c4e3dSmrg *) FILE_MAN_SUFFIX=5 ;; 11662c7c4e3dSmrg esac 11672c7c4e3dSmrgfi 11682c7c4e3dSmrgif test x$FILE_MAN_DIR = x ; then 11698650bb69Smrg FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' 11702c7c4e3dSmrgfi 11712c7c4e3dSmrg 11722c7c4e3dSmrgif test x$MISC_MAN_SUFFIX = x ; then 11732c7c4e3dSmrg case $host_os in 11742c7c4e3dSmrg solaris*) MISC_MAN_SUFFIX=5 ;; 11752c7c4e3dSmrg *) MISC_MAN_SUFFIX=7 ;; 11762c7c4e3dSmrg esac 11772c7c4e3dSmrgfi 11782c7c4e3dSmrgif test x$MISC_MAN_DIR = x ; then 11798650bb69Smrg MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' 11802c7c4e3dSmrgfi 11812c7c4e3dSmrg 11822c7c4e3dSmrgif test x$DRIVER_MAN_SUFFIX = x ; then 11832c7c4e3dSmrg case $host_os in 11842c7c4e3dSmrg solaris*) DRIVER_MAN_SUFFIX=7 ;; 11852c7c4e3dSmrg *) DRIVER_MAN_SUFFIX=4 ;; 11862c7c4e3dSmrg esac 11872c7c4e3dSmrgfi 11882c7c4e3dSmrgif test x$DRIVER_MAN_DIR = x ; then 11898650bb69Smrg DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' 11902c7c4e3dSmrgfi 11912c7c4e3dSmrg 11922c7c4e3dSmrgif test x$ADMIN_MAN_SUFFIX = x ; then 11932c7c4e3dSmrg case $host_os in 11942c7c4e3dSmrg solaris*) ADMIN_MAN_SUFFIX=1m ;; 11952c7c4e3dSmrg *) ADMIN_MAN_SUFFIX=8 ;; 11962c7c4e3dSmrg esac 11972c7c4e3dSmrgfi 11982c7c4e3dSmrgif test x$ADMIN_MAN_DIR = x ; then 11992c7c4e3dSmrg ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' 12002c7c4e3dSmrgfi 12012c7c4e3dSmrg 12022c7c4e3dSmrg 12032c7c4e3dSmrgAC_SUBST([APP_MAN_SUFFIX]) 12042c7c4e3dSmrgAC_SUBST([LIB_MAN_SUFFIX]) 12052c7c4e3dSmrgAC_SUBST([FILE_MAN_SUFFIX]) 12062c7c4e3dSmrgAC_SUBST([MISC_MAN_SUFFIX]) 12072c7c4e3dSmrgAC_SUBST([DRIVER_MAN_SUFFIX]) 12082c7c4e3dSmrgAC_SUBST([ADMIN_MAN_SUFFIX]) 12092c7c4e3dSmrgAC_SUBST([APP_MAN_DIR]) 12102c7c4e3dSmrgAC_SUBST([LIB_MAN_DIR]) 12112c7c4e3dSmrgAC_SUBST([FILE_MAN_DIR]) 12122c7c4e3dSmrgAC_SUBST([MISC_MAN_DIR]) 12132c7c4e3dSmrgAC_SUBST([DRIVER_MAN_DIR]) 12142c7c4e3dSmrgAC_SUBST([ADMIN_MAN_DIR]) 12152c7c4e3dSmrg]) # XORG_MANPAGE_SECTIONS 12162c7c4e3dSmrg 12172c7c4e3dSmrg# XORG_CHECK_LINUXDOC 12182c7c4e3dSmrg# ------------------- 12198650bb69Smrg# Minimum version: 1.0.0 12208650bb69Smrg# 12212c7c4e3dSmrg# Defines the variable MAKE_TEXT if the necessary tools and 12222c7c4e3dSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. 12232c7c4e3dSmrg# Whether or not the necessary tools and files are found can be checked 12242c7c4e3dSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC" 12252c7c4e3dSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[ 12268650bb69Smrgif test x$XORG_SGML_PATH = x ; then 12278650bb69Smrg XORG_SGML_PATH=$prefix/share/sgml 12288650bb69Smrgfi 12298650bb69SmrgHAVE_DEFS_ENT= 12308650bb69Smrg 12318650bb69Smrgif test x"$cross_compiling" = x"yes" ; then 12328650bb69Smrg HAVE_DEFS_ENT=no 12338650bb69Smrgelse 12348650bb69Smrg AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes]) 12358650bb69Smrgfi 12362c7c4e3dSmrg 12372c7c4e3dSmrgAC_PATH_PROG(LINUXDOC, linuxdoc) 12382c7c4e3dSmrgAC_PATH_PROG(PS2PDF, ps2pdf) 12392c7c4e3dSmrg 12402c7c4e3dSmrgAC_MSG_CHECKING([Whether to build documentation]) 12412c7c4e3dSmrg 12428650bb69Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then 12432c7c4e3dSmrg BUILDDOC=yes 12442c7c4e3dSmrgelse 12452c7c4e3dSmrg BUILDDOC=no 12462c7c4e3dSmrgfi 12472c7c4e3dSmrg 12482c7c4e3dSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) 12492c7c4e3dSmrg 12502c7c4e3dSmrgAC_MSG_RESULT([$BUILDDOC]) 12512c7c4e3dSmrg 12522c7c4e3dSmrgAC_MSG_CHECKING([Whether to build pdf documentation]) 12532c7c4e3dSmrg 12548650bb69Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then 12552c7c4e3dSmrg BUILDPDFDOC=yes 12562c7c4e3dSmrgelse 12572c7c4e3dSmrg BUILDPDFDOC=no 12582c7c4e3dSmrgfi 12592c7c4e3dSmrg 12602c7c4e3dSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 12612c7c4e3dSmrg 12622c7c4e3dSmrgAC_MSG_RESULT([$BUILDPDFDOC]) 12632c7c4e3dSmrg 12648650bb69SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt" 12658650bb69SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps" 12662c7c4e3dSmrgMAKE_PDF="$PS2PDF" 12678650bb69SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0" 12682c7c4e3dSmrg 12692c7c4e3dSmrgAC_SUBST(MAKE_TEXT) 12702c7c4e3dSmrgAC_SUBST(MAKE_PS) 12712c7c4e3dSmrgAC_SUBST(MAKE_PDF) 12722c7c4e3dSmrgAC_SUBST(MAKE_HTML) 12732c7c4e3dSmrg]) # XORG_CHECK_LINUXDOC 12742c7c4e3dSmrg 12758650bb69Smrg# XORG_CHECK_DOCBOOK 12768650bb69Smrg# ------------------- 12778650bb69Smrg# Minimum version: 1.0.0 12788650bb69Smrg# 12798650bb69Smrg# Checks for the ability to build output formats from SGML DocBook source. 12808650bb69Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC" 12818650bb69Smrg# indicates whether the necessary tools and files are found and, if set, 12828650bb69Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx. 12838650bb69SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[ 12848650bb69Smrgif test x$XORG_SGML_PATH = x ; then 12858650bb69Smrg XORG_SGML_PATH=$prefix/share/sgml 12868650bb69Smrgfi 12878650bb69SmrgHAVE_DEFS_ENT= 12888650bb69SmrgBUILDTXTDOC=no 12898650bb69SmrgBUILDPDFDOC=no 12908650bb69SmrgBUILDPSDOC=no 12918650bb69SmrgBUILDHTMLDOC=no 12928650bb69Smrg 12938650bb69SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes]) 12948650bb69Smrg 12958650bb69SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps) 12968650bb69SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf) 12978650bb69SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html) 12988650bb69SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt) 12998650bb69Smrg 13008650bb69SmrgAC_MSG_CHECKING([Whether to build text documentation]) 13018650bb69Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x && 13028650bb69Smrg test x$BUILD_TXTDOC != xno; then 13038650bb69Smrg BUILDTXTDOC=yes 13048650bb69Smrgfi 13058650bb69SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes]) 13068650bb69SmrgAC_MSG_RESULT([$BUILDTXTDOC]) 13078650bb69Smrg 13088650bb69SmrgAC_MSG_CHECKING([Whether to build PDF documentation]) 13098650bb69Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x && 13108650bb69Smrg test x$BUILD_PDFDOC != xno; then 13118650bb69Smrg BUILDPDFDOC=yes 13128650bb69Smrgfi 13138650bb69SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 13148650bb69SmrgAC_MSG_RESULT([$BUILDPDFDOC]) 13158650bb69Smrg 13168650bb69SmrgAC_MSG_CHECKING([Whether to build PostScript documentation]) 13178650bb69Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x && 13188650bb69Smrg test x$BUILD_PSDOC != xno; then 13198650bb69Smrg BUILDPSDOC=yes 13208650bb69Smrgfi 13218650bb69SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes]) 13228650bb69SmrgAC_MSG_RESULT([$BUILDPSDOC]) 13238650bb69Smrg 13248650bb69SmrgAC_MSG_CHECKING([Whether to build HTML documentation]) 13258650bb69Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x && 13268650bb69Smrg test x$BUILD_HTMLDOC != xno; then 13278650bb69Smrg BUILDHTMLDOC=yes 13288650bb69Smrgfi 13298650bb69SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes]) 13308650bb69SmrgAC_MSG_RESULT([$BUILDHTMLDOC]) 13318650bb69Smrg 13328650bb69SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT" 13338650bb69SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS" 13348650bb69SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF" 13358650bb69SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML" 13368650bb69Smrg 13378650bb69SmrgAC_SUBST(MAKE_TEXT) 13388650bb69SmrgAC_SUBST(MAKE_PS) 13398650bb69SmrgAC_SUBST(MAKE_PDF) 13408650bb69SmrgAC_SUBST(MAKE_HTML) 13418650bb69Smrg]) # XORG_CHECK_DOCBOOK 13428650bb69Smrg 13432c7c4e3dSmrg# XORG_CHECK_MALLOC_ZERO 13442c7c4e3dSmrg# ---------------------- 13458650bb69Smrg# Minimum version: 1.0.0 13468650bb69Smrg# 13472c7c4e3dSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if 13482c7c4e3dSmrg# malloc(0) returns NULL. Packages should add one of these cflags to 13492c7c4e3dSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. 13502c7c4e3dSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[ 13512c7c4e3dSmrgAC_ARG_ENABLE(malloc0returnsnull, 13528650bb69Smrg AS_HELP_STRING([--enable-malloc0returnsnull], 13532c7c4e3dSmrg [malloc(0) returns NULL (default: auto)]), 13542c7c4e3dSmrg [MALLOC_ZERO_RETURNS_NULL=$enableval], 13552c7c4e3dSmrg [MALLOC_ZERO_RETURNS_NULL=auto]) 13562c7c4e3dSmrg 13572c7c4e3dSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL]) 13582c7c4e3dSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then 13592c7c4e3dSmrg AC_RUN_IFELSE([ 13602c7c4e3dSmrgchar *malloc(); 13612c7c4e3dSmrgchar *realloc(); 13622c7c4e3dSmrgchar *calloc(); 13632c7c4e3dSmrgmain() { 13642c7c4e3dSmrg char *m0, *r0, *c0, *p; 13652c7c4e3dSmrg m0 = malloc(0); 13662c7c4e3dSmrg p = malloc(10); 13672c7c4e3dSmrg r0 = realloc(p,0); 13682c7c4e3dSmrg c0 = calloc(0); 13692c7c4e3dSmrg exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1); 13702c7c4e3dSmrg}], 13712c7c4e3dSmrg [MALLOC_ZERO_RETURNS_NULL=yes], 13722c7c4e3dSmrg [MALLOC_ZERO_RETURNS_NULL=no]) 13732c7c4e3dSmrgfi 13742c7c4e3dSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) 13752c7c4e3dSmrg 13762c7c4e3dSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then 13772c7c4e3dSmrg MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" 13782c7c4e3dSmrg XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS 13792c7c4e3dSmrg XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" 13802c7c4e3dSmrgelse 13812c7c4e3dSmrg MALLOC_ZERO_CFLAGS="" 13822c7c4e3dSmrg XMALLOC_ZERO_CFLAGS="" 13832c7c4e3dSmrg XTMALLOC_ZERO_CFLAGS="" 13842c7c4e3dSmrgfi 13852c7c4e3dSmrg 13862c7c4e3dSmrgAC_SUBST([MALLOC_ZERO_CFLAGS]) 13872c7c4e3dSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS]) 13882c7c4e3dSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS]) 13892c7c4e3dSmrg]) # XORG_CHECK_MALLOC_ZERO 13902c7c4e3dSmrg 13918650bb69Smrg# XORG_WITH_LINT() 13928650bb69Smrg# ---------------- 13938650bb69Smrg# Minimum version: 1.1.0 13948650bb69Smrg# 13958650bb69Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint 13968650bb69Smrg# is specified. (Use --with-lint=sparse for sparse.) 13978650bb69Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint) 13988650bb69Smrg# Sets $LINT_FLAGS to flags to pass to source checker 13998650bb69Smrg# Sets LINT automake conditional if enabled (default: disabled) 14008650bb69Smrg# 14018650bb69SmrgAC_DEFUN([XORG_WITH_LINT],[ 14028650bb69Smrg 14038650bb69Smrg# Allow checking code with lint, sparse, etc. 14048650bb69SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint], 14058650bb69Smrg [Use a lint-style source code checker (default: disabled)])], 14068650bb69Smrg [use_lint=$withval], [use_lint=no]) 14078650bb69Smrgif test "x$use_lint" = "xyes" ; then 14088650bb69Smrg LINT="lint" 14098650bb69Smrgelse 14108650bb69Smrg LINT="$use_lint" 14118650bb69Smrgfi 14128650bb69Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then 14138650bb69Smrg case $LINT in 14148650bb69Smrg lint|*/lint) 14158650bb69Smrg case $host_os in 14168650bb69Smrg solaris*) 14178650bb69Smrg LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2" 14188650bb69Smrg ;; 14198650bb69Smrg esac 14208650bb69Smrg ;; 14218650bb69Smrg esac 14228650bb69Smrgfi 14238650bb69Smrg 14248650bb69SmrgAC_SUBST(LINT) 14258650bb69SmrgAC_SUBST(LINT_FLAGS) 14268650bb69SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno]) 14278650bb69Smrg 14288650bb69Smrg]) # XORG_WITH_LINT 14298650bb69Smrg 14308650bb69Smrg# XORG_LINT_LIBRARY(LIBNAME) 14318650bb69Smrg# -------------------------- 14328650bb69Smrg# Minimum version: 1.1.0 14338650bb69Smrg# 14348650bb69Smrg# Sets up flags for building lint libraries for checking programs that call 14358650bb69Smrg# functions in the library. 14368650bb69Smrg# Disabled by default, enable with --enable-lint-library 14378650bb69Smrg# Sets: 14388650bb69Smrg# @LINTLIB@ - name of lint library file to make 14398650bb69Smrg# MAKE_LINT_LIB - automake conditional 14408650bb69Smrg# 14418650bb69Smrg 14428650bb69SmrgAC_DEFUN([XORG_LINT_LIBRARY],[ 14438650bb69SmrgAC_REQUIRE([XORG_WITH_LINT]) 14448650bb69Smrg# Build lint "library" for more indepth checks of programs calling this library 14458650bb69SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library], 14468650bb69Smrg [Create lint library (default: disabled)])], 14478650bb69Smrg [make_lint_lib=$enableval], [make_lint_lib=no]) 14488650bb69Smrgif test "x$make_lint_lib" != "xno" ; then 14498650bb69Smrg if test "x$LINT" = "xno" ; then 14508650bb69Smrg AC_MSG_ERROR([Cannot make lint library without --with-lint]) 14518650bb69Smrg fi 14528650bb69Smrg if test "x$make_lint_lib" = "xyes" ; then 14538650bb69Smrg LINTLIB=llib-l$1.ln 14548650bb69Smrg else 14558650bb69Smrg LINTLIB=$make_lint_lib 14568650bb69Smrg fi 14578650bb69Smrgfi 14588650bb69SmrgAC_SUBST(LINTLIB) 14598650bb69SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno]) 14608650bb69Smrg 14618650bb69Smrg]) # XORG_LINT_LIBRARY 14628650bb69Smrg 14638650bb69Smrg# XORG_CWARNFLAGS 14648650bb69Smrg# --------------- 14658650bb69Smrg# Minimum version: 1.2.0 14668650bb69Smrg# 14678650bb69Smrg# Defines CWARNFLAGS to enable C compiler warnings. 14688650bb69Smrg# 14698650bb69SmrgAC_DEFUN([XORG_CWARNFLAGS], [ 14708650bb69SmrgAC_REQUIRE([AC_PROG_CC]) 14718650bb69Smrgif test "x$GCC" = xyes ; then 14728650bb69Smrg CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \ 14738650bb69Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \ 14748650bb69Smrg-Wbad-function-cast" 14758650bb69Smrg case `$CC -dumpversion` in 14768650bb69Smrg 3.4.* | 4.*) 14778650bb69Smrg CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement" 14788650bb69Smrg ;; 14798650bb69Smrg esac 14808650bb69Smrgelse 14818650bb69Smrg AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) 14828650bb69Smrg if test "x$SUNCC" = "xyes"; then 14838650bb69Smrg CWARNFLAGS="-v" 14848650bb69Smrg fi 14858650bb69Smrgfi 14868650bb69SmrgAC_SUBST(CWARNFLAGS) 14878650bb69Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) 14888650bb69Smrg]) # XORG_CWARNFLAGS 14898650bb69Smrg 14908650bb69Smrg# XORG_STRICT_OPTION 14918650bb69Smrg# ----------------------- 14928650bb69Smrg# Minimum version: 1.3.0 14938650bb69Smrg# 14948650bb69Smrg# Add configure option to enable strict compilation 14958650bb69SmrgAC_DEFUN([XORG_STRICT_OPTION], [ 14968650bb69SmrgAC_REQUIRE([AC_PROG_CC]) 14978650bb69SmrgAC_REQUIRE([AC_PROG_CC_C99]) 14988650bb69SmrgAC_REQUIRE([XORG_CWARNFLAGS]) 14998650bb69Smrg 15008650bb69SmrgAC_ARG_ENABLE(strict-compilation, 15018650bb69Smrg AS_HELP_STRING([--enable-strict-compilation], 15028650bb69Smrg [Enable all warnings from compiler and make them errors (default: disabled)]), 15038650bb69Smrg [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no]) 15048650bb69Smrgif test "x$STRICT_COMPILE" = "xyes"; then 15058650bb69Smrg AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) 15068650bb69Smrg AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"]) 15078650bb69Smrg if test "x$GCC" = xyes ; then 15088650bb69Smrg STRICT_CFLAGS="-pedantic -Werror" 15098650bb69Smrg elif test "x$SUNCC" = "xyes"; then 15108650bb69Smrg STRICT_CFLAGS="-errwarn" 15118650bb69Smrg elif test "x$INTELCC" = "xyes"; then 15128650bb69Smrg STRICT_CFLAGS="-Werror" 15138650bb69Smrg fi 15148650bb69Smrgfi 15158650bb69SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS" 15168650bb69SmrgAC_SUBST([CWARNFLAGS]) 15178650bb69Smrg]) # XORG_STRICT_OPTION 15188650bb69Smrg 15198650bb69Smrg# XORG_DEFAULT_OPTIONS 15208650bb69Smrg# -------------------- 15218650bb69Smrg# Minimum version: 1.3.0 15228650bb69Smrg# 15238650bb69Smrg# Defines default options for X.Org modules. 15248650bb69Smrg# 15258650bb69SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [ 15268650bb69SmrgXORG_CWARNFLAGS 15278650bb69SmrgXORG_STRICT_OPTION 15288650bb69SmrgXORG_RELEASE_VERSION 15298650bb69SmrgXORG_CHANGELOG 15308650bb69SmrgXORG_MANPAGE_SECTIONS 15318650bb69Smrg]) # XORG_DEFAULT_OPTIONS 15322c7c4e3dSmrgdnl Copyright 2005 Red Hat, Inc 15332c7c4e3dSmrgdnl 15342c7c4e3dSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its 15352c7c4e3dSmrgdnl documentation for any purpose is hereby granted without fee, provided that 15362c7c4e3dSmrgdnl the above copyright notice appear in all copies and that both that 15372c7c4e3dSmrgdnl copyright notice and this permission notice appear in supporting 15382c7c4e3dSmrgdnl documentation. 15392c7c4e3dSmrgdnl 15402c7c4e3dSmrgdnl The above copyright notice and this permission notice shall be included 15412c7c4e3dSmrgdnl in all copies or substantial portions of the Software. 15422c7c4e3dSmrgdnl 15432c7c4e3dSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15442c7c4e3dSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 15452c7c4e3dSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15462c7c4e3dSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 15472c7c4e3dSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 15482c7c4e3dSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 15492c7c4e3dSmrgdnl OTHER DEALINGS IN THE SOFTWARE. 15502c7c4e3dSmrgdnl 15512c7c4e3dSmrgdnl Except as contained in this notice, the name of the copyright holders shall 15522c7c4e3dSmrgdnl not be used in advertising or otherwise to promote the sale, use or 15532c7c4e3dSmrgdnl other dealings in this Software without prior written authorization 15542c7c4e3dSmrgdnl from the copyright holders. 15552c7c4e3dSmrgdnl 15562c7c4e3dSmrg 15572c7c4e3dSmrg# XORG_RELEASE_VERSION 15582c7c4e3dSmrg# -------------------- 15592c7c4e3dSmrg# Adds --with/without-release-string and changes the PACKAGE and 15602c7c4e3dSmrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION". If 15618650bb69Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged. Also 15628650bb69Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use. 15632c7c4e3dSmrg 15642c7c4e3dSmrgAC_DEFUN([XORG_RELEASE_VERSION],[ 15652c7c4e3dSmrg AC_ARG_WITH(release-version, 15668650bb69Smrg AS_HELP_STRING([--with-release-version=STRING], 15672c7c4e3dSmrg [Use release version string in package name]), 15682c7c4e3dSmrg [RELEASE_VERSION="$withval"], 15692c7c4e3dSmrg [RELEASE_VERSION=""]) 15702c7c4e3dSmrg if test "x$RELEASE_VERSION" != "x"; then 15712c7c4e3dSmrg PACKAGE="$PACKAGE-$RELEASE_VERSION" 15722c7c4e3dSmrg PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION" 15732c7c4e3dSmrg AC_MSG_NOTICE([Building with package name set to $PACKAGE]) 15742c7c4e3dSmrg fi 15758650bb69Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR], 15768650bb69Smrg [`echo $PACKAGE_VERSION | cut -d . -f 1`], 15778650bb69Smrg [Major version of this package]) 15788650bb69Smrg PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` 15798650bb69Smrg if test "x$PVM" = "x"; then 15808650bb69Smrg PVM="0" 15818650bb69Smrg fi 15828650bb69Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR], 15838650bb69Smrg [$PVM], 15848650bb69Smrg [Minor version of this package]) 15858650bb69Smrg PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` 15868650bb69Smrg if test "x$PVP" = "x"; then 15878650bb69Smrg PVP="0" 15888650bb69Smrg fi 15898650bb69Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL], 15908650bb69Smrg [$PVP], 15918650bb69Smrg [Patch version of this package]) 15922c7c4e3dSmrg]) 15932c7c4e3dSmrg 15948650bb69Smrg# XORG_CHANGELOG() 15958650bb69Smrg# ---------------- 15968650bb69Smrg# Minimum version: 1.2.0 15978650bb69Smrg# 15988650bb69Smrg# Defines the variable CHANGELOG_CMD as the command to generate 15998650bb69Smrg# ChangeLog from git. 16008650bb69Smrg# 16018650bb69Smrg# Arrange that distcleancheck ignores ChangeLog left over by distclean. 16028650bb69Smrg# 16038650bb69SmrgAC_DEFUN([XORG_CHANGELOG], [ 16048650bb69SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \ 16058650bb69Smrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \ 16068650bb69Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)" 16078650bb69SmrgAC_SUBST([CHANGELOG_CMD]) 16088650bb69SmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print']) 16098650bb69Smrg]) # XORG_CHANGELOG 16108650bb69Smrg 16118650bb69Smrg# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- 16128650bb69Smrg# 16138650bb69Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>. 16148650bb69Smrg# 16158650bb69Smrg# This program is free software; you can redistribute it and/or modify 16168650bb69Smrg# it under the terms of the GNU General Public License as published by 16178650bb69Smrg# the Free Software Foundation; either version 2 of the License, or 16188650bb69Smrg# (at your option) any later version. 16198650bb69Smrg# 16208650bb69Smrg# This program is distributed in the hope that it will be useful, but 16218650bb69Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of 16228650bb69Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16238650bb69Smrg# General Public License for more details. 16248650bb69Smrg# 16258650bb69Smrg# You should have received a copy of the GNU General Public License 16268650bb69Smrg# along with this program; if not, write to the Free Software 16278650bb69Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 16288650bb69Smrg# 16298650bb69Smrg# As a special exception to the GNU General Public License, if you 16308650bb69Smrg# distribute this file as part of a program that contains a 16318650bb69Smrg# configuration script generated by Autoconf, you may include it under 16328650bb69Smrg# the same distribution terms that you use for the rest of that program. 16338650bb69Smrg 16348650bb69Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION]) 16358650bb69Smrg# ---------------------------------- 16368650bb69SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG], 16378650bb69Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) 16388650bb69Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$]) 16398650bb69SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl 16408650bb69Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then 16418650bb69Smrg AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) 16428650bb69Smrgfi 16438650bb69Smrgif test -n "$PKG_CONFIG"; then 16448650bb69Smrg _pkg_min_version=m4_default([$1], [0.9.0]) 16458650bb69Smrg AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) 16468650bb69Smrg if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then 16478650bb69Smrg AC_MSG_RESULT([yes]) 16488650bb69Smrg else 16498650bb69Smrg AC_MSG_RESULT([no]) 16508650bb69Smrg PKG_CONFIG="" 16518650bb69Smrg fi 16528650bb69Smrg 16538650bb69Smrgfi[]dnl 16548650bb69Smrg])# PKG_PROG_PKG_CONFIG 16558650bb69Smrg 16568650bb69Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 16578650bb69Smrg# 16588650bb69Smrg# Check to see whether a particular set of modules exists. Similar 16598650bb69Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors. 16608650bb69Smrg# 16618650bb69Smrg# 16628650bb69Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of 16638650bb69Smrg# this or PKG_CHECK_MODULES is called, or make sure to call 16648650bb69Smrg# PKG_CHECK_EXISTS manually 16658650bb69Smrg# -------------------------------------------------------------- 16668650bb69SmrgAC_DEFUN([PKG_CHECK_EXISTS], 16678650bb69Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 16688650bb69Smrgif test -n "$PKG_CONFIG" && \ 16698650bb69Smrg AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then 16708650bb69Smrg m4_ifval([$2], [$2], [:]) 16718650bb69Smrgm4_ifvaln([$3], [else 16728650bb69Smrg $3])dnl 16738650bb69Smrgfi]) 16748650bb69Smrg 16758650bb69Smrg 16768650bb69Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) 16778650bb69Smrg# --------------------------------------------- 16788650bb69Smrgm4_define([_PKG_CONFIG], 16798650bb69Smrg[if test -n "$$1"; then 16808650bb69Smrg pkg_cv_[]$1="$$1" 16818650bb69Smrg elif test -n "$PKG_CONFIG"; then 16828650bb69Smrg PKG_CHECK_EXISTS([$3], 16838650bb69Smrg [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], 16848650bb69Smrg [pkg_failed=yes]) 16858650bb69Smrg else 16868650bb69Smrg pkg_failed=untried 16878650bb69Smrgfi[]dnl 16888650bb69Smrg])# _PKG_CONFIG 16898650bb69Smrg 16908650bb69Smrg# _PKG_SHORT_ERRORS_SUPPORTED 16918650bb69Smrg# ----------------------------- 16928650bb69SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], 16938650bb69Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 16948650bb69Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then 16958650bb69Smrg _pkg_short_errors_supported=yes 16968650bb69Smrgelse 16978650bb69Smrg _pkg_short_errors_supported=no 16988650bb69Smrgfi[]dnl 16998650bb69Smrg])# _PKG_SHORT_ERRORS_SUPPORTED 17008650bb69Smrg 17018650bb69Smrg 17028650bb69Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], 17038650bb69Smrg# [ACTION-IF-NOT-FOUND]) 17048650bb69Smrg# 17058650bb69Smrg# 17068650bb69Smrg# Note that if there is a possibility the first call to 17078650bb69Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an 17088650bb69Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac 17098650bb69Smrg# 17108650bb69Smrg# 17118650bb69Smrg# -------------------------------------------------------------- 17128650bb69SmrgAC_DEFUN([PKG_CHECK_MODULES], 17138650bb69Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 17148650bb69SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl 17158650bb69SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl 17168650bb69Smrg 17178650bb69Smrgpkg_failed=no 17188650bb69SmrgAC_MSG_CHECKING([for $1]) 17198650bb69Smrg 17208650bb69Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) 17218650bb69Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2]) 17228650bb69Smrg 17238650bb69Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS 17248650bb69Smrgand $1[]_LIBS to avoid the need to call pkg-config. 17258650bb69SmrgSee the pkg-config man page for more details.]) 17268650bb69Smrg 17278650bb69Smrgif test $pkg_failed = yes; then 17288650bb69Smrg _PKG_SHORT_ERRORS_SUPPORTED 17298650bb69Smrg if test $_pkg_short_errors_supported = yes; then 17308650bb69Smrg $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` 17318650bb69Smrg else 17328650bb69Smrg $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` 17338650bb69Smrg fi 17348650bb69Smrg # Put the nasty error message in config.log where it belongs 17358650bb69Smrg echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD 17368650bb69Smrg 17378650bb69Smrg ifelse([$4], , [AC_MSG_ERROR(dnl 17388650bb69Smrg[Package requirements ($2) were not met: 17398650bb69Smrg 17408650bb69Smrg$$1_PKG_ERRORS 17418650bb69Smrg 17428650bb69SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you 17438650bb69Smrginstalled software in a non-standard prefix. 17448650bb69Smrg 17458650bb69Smrg_PKG_TEXT 17468650bb69Smrg])], 17478650bb69Smrg [AC_MSG_RESULT([no]) 17488650bb69Smrg $4]) 17498650bb69Smrgelif test $pkg_failed = untried; then 17508650bb69Smrg ifelse([$4], , [AC_MSG_FAILURE(dnl 17518650bb69Smrg[The pkg-config script could not be found or is too old. Make sure it 17528650bb69Smrgis in your PATH or set the PKG_CONFIG environment variable to the full 17538650bb69Smrgpath to pkg-config. 17548650bb69Smrg 17558650bb69Smrg_PKG_TEXT 17568650bb69Smrg 17578650bb69SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])], 17588650bb69Smrg [$4]) 17598650bb69Smrgelse 17608650bb69Smrg $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS 17618650bb69Smrg $1[]_LIBS=$pkg_cv_[]$1[]_LIBS 17628650bb69Smrg AC_MSG_RESULT([yes]) 17638650bb69Smrg ifelse([$3], , :, [$3]) 17648650bb69Smrgfi[]dnl 17658650bb69Smrg])# PKG_CHECK_MODULES 17668650bb69Smrg 1767