aclocal.m4 revision 168023fe
1168023feSmrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*- 26ea72052Smrg 3168023feSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 4168023feSmrg# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. 56ea72052Smrg# This file is free software; the Free Software Foundation 66ea72052Smrg# gives unlimited permission to copy and/or distribute it, 76ea72052Smrg# with or without modifications, as long as this notice is preserved. 86ea72052Smrg 96ea72052Smrg# This program is distributed in the hope that it will be useful, 106ea72052Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without 116ea72052Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A 126ea72052Smrg# PARTICULAR PURPOSE. 136ea72052Smrg 14168023feSmrgm4_ifndef([AC_AUTOCONF_VERSION], 15168023feSmrg [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 16168023feSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, 17168023feSmrg[m4_warning([this file was generated for autoconf 2.68. 18168023feSmrgYou have another version of autoconf. It may work, but is not guaranteed to. 19168023feSmrgIf you have problems, you may need to regenerate the build system entirely. 20168023feSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])]) 216ea72052Smrg 22168023feSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. 23168023feSmrg# 24168023feSmrg# This file is free software; the Free Software Foundation 25168023feSmrg# gives unlimited permission to copy and/or distribute it, 26168023feSmrg# with or without modifications, as long as this notice is preserved. 276ea72052Smrg 286ea72052Smrg# AM_AUTOMAKE_VERSION(VERSION) 296ea72052Smrg# ---------------------------- 306ea72052Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been 316ea72052Smrg# generated from the m4 files accompanying Automake X.Y. 32168023feSmrg# (This private macro should not be called outside this file.) 33168023feSmrgAC_DEFUN([AM_AUTOMAKE_VERSION], 34168023feSmrg[am__api_version='1.11' 35168023feSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to 36168023feSmrgdnl require some minimum version. Point them to the right macro. 37168023feSmrgm4_if([$1], [1.11.1], [], 38168023feSmrg [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl 39168023feSmrg]) 40168023feSmrg 41168023feSmrg# _AM_AUTOCONF_VERSION(VERSION) 42168023feSmrg# ----------------------------- 43168023feSmrg# aclocal traces this macro to find the Autoconf version. 44168023feSmrg# This is a private macro too. Using m4_define simplifies 45168023feSmrg# the logic in aclocal, which can simply ignore this definition. 46168023feSmrgm4_define([_AM_AUTOCONF_VERSION], []) 476ea72052Smrg 486ea72052Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION 496ea72052Smrg# ------------------------------- 50168023feSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. 51168023feSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. 526ea72052SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 53168023feSmrg[AM_AUTOMAKE_VERSION([1.11.1])dnl 54168023feSmrgm4_ifndef([AC_AUTOCONF_VERSION], 55168023feSmrg [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 56168023feSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) 576ea72052Smrg 58168023feSmrg# AM_AUX_DIR_EXPAND -*- Autoconf -*- 596ea72052Smrg 60168023feSmrg# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 616ea72052Smrg# 62168023feSmrg# This file is free software; the Free Software Foundation 63168023feSmrg# gives unlimited permission to copy and/or distribute it, 64168023feSmrg# with or without modifications, as long as this notice is preserved. 656ea72052Smrg 666ea72052Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 676ea72052Smrg# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to 686ea72052Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'. 696ea72052Smrg# 706ea72052Smrg# Of course, Automake must honor this variable whenever it calls a 716ea72052Smrg# tool from the auxiliary directory. The problem is that $srcdir (and 726ea72052Smrg# therefore $ac_aux_dir as well) can be either absolute or relative, 736ea72052Smrg# depending on how configure is run. This is pretty annoying, since 746ea72052Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top 756ea72052Smrg# source directory, any form will work fine, but in subdirectories a 766ea72052Smrg# relative path needs to be adjusted first. 776ea72052Smrg# 786ea72052Smrg# $ac_aux_dir/missing 796ea72052Smrg# fails when called from a subdirectory if $ac_aux_dir is relative 806ea72052Smrg# $top_srcdir/$ac_aux_dir/missing 816ea72052Smrg# fails if $ac_aux_dir is absolute, 826ea72052Smrg# fails when called from a subdirectory in a VPATH build with 836ea72052Smrg# a relative $ac_aux_dir 846ea72052Smrg# 856ea72052Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir 866ea72052Smrg# are both prefixed by $srcdir. In an in-source build this is usually 876ea72052Smrg# harmless because $srcdir is `.', but things will broke when you 886ea72052Smrg# start a VPATH build or use an absolute $srcdir. 896ea72052Smrg# 906ea72052Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 916ea72052Smrg# iff we strip the leading $srcdir from $ac_aux_dir. That would be: 926ea72052Smrg# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 936ea72052Smrg# and then we would define $MISSING as 946ea72052Smrg# MISSING="\${SHELL} $am_aux_dir/missing" 956ea72052Smrg# This will work as long as MISSING is not called from configure, because 966ea72052Smrg# unfortunately $(top_srcdir) has no meaning in configure. 976ea72052Smrg# However there are other variables, like CC, which are often used in 986ea72052Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir. 996ea72052Smrg# 1006ea72052Smrg# Another solution, used here, is to always expand $ac_aux_dir to an 1016ea72052Smrg# absolute PATH. The drawback is that using absolute paths prevent a 1026ea72052Smrg# configured tree to be moved without reconfiguration. 1036ea72052Smrg 104168023feSmrgAC_DEFUN([AM_AUX_DIR_EXPAND], 105168023feSmrg[dnl Rely on autoconf to set up CDPATH properly. 106168023feSmrgAC_PREREQ([2.50])dnl 1076ea72052Smrg# expand $ac_aux_dir to an absolute path 1086ea72052Smrgam_aux_dir=`cd $ac_aux_dir && pwd` 1096ea72052Smrg]) 1106ea72052Smrg 111168023feSmrg# AM_CONDITIONAL -*- Autoconf -*- 1126ea72052Smrg 113168023feSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 114168023feSmrg# Free Software Foundation, Inc. 115168023feSmrg# 116168023feSmrg# This file is free software; the Free Software Foundation 117168023feSmrg# gives unlimited permission to copy and/or distribute it, 118168023feSmrg# with or without modifications, as long as this notice is preserved. 1196ea72052Smrg 120168023feSmrg# serial 9 1216ea72052Smrg 122168023feSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION) 123168023feSmrg# ------------------------------------- 124168023feSmrg# Define a conditional. 125168023feSmrgAC_DEFUN([AM_CONDITIONAL], 126168023feSmrg[AC_PREREQ(2.52)dnl 127168023feSmrg ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 128168023feSmrg [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 129168023feSmrgAC_SUBST([$1_TRUE])dnl 130168023feSmrgAC_SUBST([$1_FALSE])dnl 131168023feSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl 132168023feSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl 133168023feSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl 134168023feSmrgif $2; then 135168023feSmrg $1_TRUE= 136168023feSmrg $1_FALSE='#' 1376ea72052Smrgelse 138168023feSmrg $1_TRUE='#' 139168023feSmrg $1_FALSE= 1406ea72052Smrgfi 141168023feSmrgAC_CONFIG_COMMANDS_PRE( 142168023feSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 143168023feSmrg AC_MSG_ERROR([[conditional "$1" was never defined. 144168023feSmrgUsually this means the macro was only invoked conditionally.]]) 145168023feSmrgfi])]) 1466ea72052Smrg 147168023feSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 148168023feSmrg# Free Software Foundation, Inc. 149168023feSmrg# 150168023feSmrg# This file is free software; the Free Software Foundation 151168023feSmrg# gives unlimited permission to copy and/or distribute it, 152168023feSmrg# with or without modifications, as long as this notice is preserved. 1536ea72052Smrg 154168023feSmrg# serial 10 1556ea72052Smrg 1566ea72052Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be 1576ea72052Smrg# written in clear, in which case automake, when reading aclocal.m4, 1586ea72052Smrg# will think it sees a *use*, and therefore will trigger all it's 1596ea72052Smrg# C support machinery. Also note that it means that autoscan, seeing 1606ea72052Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use... 1616ea72052Smrg 1626ea72052Smrg 1636ea72052Smrg# _AM_DEPENDENCIES(NAME) 1646ea72052Smrg# ---------------------- 1656ea72052Smrg# See how the compiler implements dependency checking. 1666ea72052Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC". 1676ea72052Smrg# We try a few techniques and use that to set a single cache variable. 1686ea72052Smrg# 1696ea72052Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was 1706ea72052Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular 1716ea72052Smrg# dependency, and given that the user is not expected to run this macro, 1726ea72052Smrg# just rely on AC_PROG_CC. 1736ea72052SmrgAC_DEFUN([_AM_DEPENDENCIES], 1746ea72052Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl 1756ea72052SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl 1766ea72052SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl 1776ea72052SmrgAC_REQUIRE([AM_DEP_TRACK])dnl 1786ea72052Smrg 1796ea72052Smrgifelse([$1], CC, [depcc="$CC" am_compiler_list=], 1806ea72052Smrg [$1], CXX, [depcc="$CXX" am_compiler_list=], 1816ea72052Smrg [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 182168023feSmrg [$1], UPC, [depcc="$UPC" am_compiler_list=], 1836ea72052Smrg [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 1846ea72052Smrg [depcc="$$1" am_compiler_list=]) 1856ea72052Smrg 1866ea72052SmrgAC_CACHE_CHECK([dependency style of $depcc], 1876ea72052Smrg [am_cv_$1_dependencies_compiler_type], 1886ea72052Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then 1896ea72052Smrg # We make a subdir and do the tests there. Otherwise we can end up 1906ea72052Smrg # making bogus files that we don't know about and never remove. For 1916ea72052Smrg # instance it was reported that on HP-UX the gcc test will end up 1926ea72052Smrg # making a dummy file named `D' -- because `-MD' means `put the output 1936ea72052Smrg # in D'. 1946ea72052Smrg mkdir conftest.dir 1956ea72052Smrg # Copy depcomp to subdir because otherwise we won't find it if we're 1966ea72052Smrg # using a relative directory. 1976ea72052Smrg cp "$am_depcomp" conftest.dir 1986ea72052Smrg cd conftest.dir 1996ea72052Smrg # We will build objects and dependencies in a subdirectory because 2006ea72052Smrg # it helps to detect inapplicable dependency modes. For instance 2016ea72052Smrg # both Tru64's cc and ICC support -MD to output dependencies as a 2026ea72052Smrg # side effect of compilation, but ICC will put the dependencies in 2036ea72052Smrg # the current directory while Tru64 will put them in the object 2046ea72052Smrg # directory. 2056ea72052Smrg mkdir sub 2066ea72052Smrg 2076ea72052Smrg am_cv_$1_dependencies_compiler_type=none 2086ea72052Smrg if test "$am_compiler_list" = ""; then 2096ea72052Smrg am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` 2106ea72052Smrg fi 211168023feSmrg am__universal=false 212168023feSmrg m4_case([$1], [CC], 213168023feSmrg [case " $depcc " in #( 214168023feSmrg *\ -arch\ *\ -arch\ *) am__universal=true ;; 215168023feSmrg esac], 216168023feSmrg [CXX], 217168023feSmrg [case " $depcc " in #( 218168023feSmrg *\ -arch\ *\ -arch\ *) am__universal=true ;; 219168023feSmrg esac]) 220168023feSmrg 2216ea72052Smrg for depmode in $am_compiler_list; do 2226ea72052Smrg # Setup a source with many dependencies, because some compilers 2236ea72052Smrg # like to wrap large dependency lists on column 80 (with \), and 2246ea72052Smrg # we should not choose a depcomp mode which is confused by this. 2256ea72052Smrg # 2266ea72052Smrg # We need to recreate these files for each test, as the compiler may 2276ea72052Smrg # overwrite some of them when testing with obscure command lines. 2286ea72052Smrg # This happens at least with the AIX C compiler. 2296ea72052Smrg : > sub/conftest.c 2306ea72052Smrg for i in 1 2 3 4 5 6; do 2316ea72052Smrg echo '#include "conftst'$i'.h"' >> sub/conftest.c 232168023feSmrg # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with 233168023feSmrg # Solaris 8's {/usr,}/bin/sh. 234168023feSmrg touch sub/conftst$i.h 2356ea72052Smrg done 2366ea72052Smrg echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 2376ea72052Smrg 238168023feSmrg # We check with `-c' and `-o' for the sake of the "dashmstdout" 239168023feSmrg # mode. It turns out that the SunPro C++ compiler does not properly 240168023feSmrg # handle `-M -o', and we need to detect this. Also, some Intel 241168023feSmrg # versions had trouble with output in subdirs 242168023feSmrg am__obj=sub/conftest.${OBJEXT-o} 243168023feSmrg am__minus_obj="-o $am__obj" 2446ea72052Smrg case $depmode in 245168023feSmrg gcc) 246168023feSmrg # This depmode causes a compiler race in universal mode. 247168023feSmrg test "$am__universal" = false || continue 248168023feSmrg ;; 2496ea72052Smrg nosideeffect) 2506ea72052Smrg # after this tag, mechanisms are not by side-effect, so they'll 2516ea72052Smrg # only be used when explicitly requested 2526ea72052Smrg if test "x$enable_dependency_tracking" = xyes; then 2536ea72052Smrg continue 2546ea72052Smrg else 2556ea72052Smrg break 2566ea72052Smrg fi 2576ea72052Smrg ;; 258168023feSmrg msvisualcpp | msvcmsys) 259168023feSmrg # This compiler won't grok `-c -o', but also, the minuso test has 260168023feSmrg # not run yet. These depmodes are late enough in the game, and 261168023feSmrg # so weak that their functioning should not be impacted. 262168023feSmrg am__obj=conftest.${OBJEXT-o} 263168023feSmrg am__minus_obj= 264168023feSmrg ;; 2656ea72052Smrg none) break ;; 2666ea72052Smrg esac 2676ea72052Smrg if depmode=$depmode \ 268168023feSmrg source=sub/conftest.c object=$am__obj \ 2696ea72052Smrg depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ 270168023feSmrg $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ 2716ea72052Smrg >/dev/null 2>conftest.err && 272168023feSmrg grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 2736ea72052Smrg grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && 274168023feSmrg grep $am__obj sub/conftest.Po > /dev/null 2>&1 && 2756ea72052Smrg ${MAKE-make} -s -f confmf > /dev/null 2>&1; then 2766ea72052Smrg # icc doesn't choke on unknown options, it will just issue warnings 277168023feSmrg # or remarks (even with -Werror). So we grep stderr for any message 278168023feSmrg # that says an option was ignored or not supported. 279168023feSmrg # When given -MP, icc 7.0 and 7.1 complain thusly: 280168023feSmrg # icc: Command line warning: ignoring option '-M'; no argument required 281168023feSmrg # The diagnosis changed in icc 8.0: 282168023feSmrg # icc: Command line remark: option '-MP' not supported 283168023feSmrg if (grep 'ignoring option' conftest.err || 284168023feSmrg grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else 2856ea72052Smrg am_cv_$1_dependencies_compiler_type=$depmode 2866ea72052Smrg break 2876ea72052Smrg fi 2886ea72052Smrg fi 2896ea72052Smrg done 2906ea72052Smrg 2916ea72052Smrg cd .. 2926ea72052Smrg rm -rf conftest.dir 2936ea72052Smrgelse 2946ea72052Smrg am_cv_$1_dependencies_compiler_type=none 2956ea72052Smrgfi 2966ea72052Smrg]) 2976ea72052SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) 2986ea72052SmrgAM_CONDITIONAL([am__fastdep$1], [ 2996ea72052Smrg test "x$enable_dependency_tracking" != xno \ 3006ea72052Smrg && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) 3016ea72052Smrg]) 3026ea72052Smrg 3036ea72052Smrg 3046ea72052Smrg# AM_SET_DEPDIR 3056ea72052Smrg# ------------- 3066ea72052Smrg# Choose a directory name for dependency files. 3076ea72052Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES 3086ea72052SmrgAC_DEFUN([AM_SET_DEPDIR], 3096ea72052Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl 3106ea72052SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl 3116ea72052Smrg]) 3126ea72052Smrg 3136ea72052Smrg 3146ea72052Smrg# AM_DEP_TRACK 3156ea72052Smrg# ------------ 3166ea72052SmrgAC_DEFUN([AM_DEP_TRACK], 3176ea72052Smrg[AC_ARG_ENABLE(dependency-tracking, 318168023feSmrg[ --disable-dependency-tracking speeds up one-time build 319168023feSmrg --enable-dependency-tracking do not reject slow dependency extractors]) 3206ea72052Smrgif test "x$enable_dependency_tracking" != xno; then 3216ea72052Smrg am_depcomp="$ac_aux_dir/depcomp" 3226ea72052Smrg AMDEPBACKSLASH='\' 3236ea72052Smrgfi 3246ea72052SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) 325168023feSmrgAC_SUBST([AMDEPBACKSLASH])dnl 326168023feSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl 3276ea72052Smrg]) 3286ea72052Smrg 329168023feSmrg# Generate code to set up dependency tracking. -*- Autoconf -*- 3306ea72052Smrg 331168023feSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 332168023feSmrg# Free Software Foundation, Inc. 333168023feSmrg# 334168023feSmrg# This file is free software; the Free Software Foundation 335168023feSmrg# gives unlimited permission to copy and/or distribute it, 336168023feSmrg# with or without modifications, as long as this notice is preserved. 3376ea72052Smrg 338168023feSmrg#serial 5 3396ea72052Smrg 3406ea72052Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS 3416ea72052Smrg# ------------------------------ 3426ea72052SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], 343168023feSmrg[{ 344168023feSmrg # Autoconf 2.62 quotes --file arguments for eval, but not when files 345168023feSmrg # are listed without --file. Let's play safe and only enable the eval 346168023feSmrg # if we detect the quoting. 347168023feSmrg case $CONFIG_FILES in 348168023feSmrg *\'*) eval set x "$CONFIG_FILES" ;; 349168023feSmrg *) set x $CONFIG_FILES ;; 350168023feSmrg esac 351168023feSmrg shift 352168023feSmrg for mf 353168023feSmrg do 354168023feSmrg # Strip MF so we end up with the name of the file. 355168023feSmrg mf=`echo "$mf" | sed -e 's/:.*$//'` 356168023feSmrg # Check whether this is an Automake generated Makefile or not. 357168023feSmrg # We used to match only the files named `Makefile.in', but 358168023feSmrg # some people rename them; so instead we look at the file content. 359168023feSmrg # Grep'ing the first line is not enough: some people post-process 360168023feSmrg # each Makefile.in and add a new line on top of each file to say so. 361168023feSmrg # Grep'ing the whole file is not good either: AIX grep has a line 362168023feSmrg # limit of 2048, but all sed's we know have understand at least 4000. 363168023feSmrg if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then 364168023feSmrg dirpart=`AS_DIRNAME("$mf")` 365168023feSmrg else 366168023feSmrg continue 367168023feSmrg fi 368168023feSmrg # Extract the definition of DEPDIR, am__include, and am__quote 369168023feSmrg # from the Makefile without running `make'. 370168023feSmrg DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` 371168023feSmrg test -z "$DEPDIR" && continue 372168023feSmrg am__include=`sed -n 's/^am__include = //p' < "$mf"` 373168023feSmrg test -z "am__include" && continue 374168023feSmrg am__quote=`sed -n 's/^am__quote = //p' < "$mf"` 375168023feSmrg # When using ansi2knr, U may be empty or an underscore; expand it 376168023feSmrg U=`sed -n 's/^U = //p' < "$mf"` 377168023feSmrg # Find all dependency output files, they are included files with 378168023feSmrg # $(DEPDIR) in their names. We invoke sed twice because it is the 379168023feSmrg # simplest approach to changing $(DEPDIR) to its actual value in the 380168023feSmrg # expansion. 381168023feSmrg for file in `sed -n " 382168023feSmrg s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ 383168023feSmrg sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do 384168023feSmrg # Make sure the directory exists. 385168023feSmrg test -f "$dirpart/$file" && continue 386168023feSmrg fdir=`AS_DIRNAME(["$file"])` 387168023feSmrg AS_MKDIR_P([$dirpart/$fdir]) 388168023feSmrg # echo "creating $dirpart/$file" 389168023feSmrg echo '# dummy' > "$dirpart/$file" 390168023feSmrg done 3916ea72052Smrg done 392168023feSmrg} 3936ea72052Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS 3946ea72052Smrg 3956ea72052Smrg 3966ea72052Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS 3976ea72052Smrg# ----------------------------- 3986ea72052Smrg# This macro should only be invoked once -- use via AC_REQUIRE. 3996ea72052Smrg# 4006ea72052Smrg# This code is only required when automatic dependency tracking 4016ea72052Smrg# is enabled. FIXME. This creates each `.P' file that we will 4026ea72052Smrg# need in order to bootstrap the dependency handling code. 4036ea72052SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], 4046ea72052Smrg[AC_CONFIG_COMMANDS([depfiles], 4056ea72052Smrg [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], 4066ea72052Smrg [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) 4076ea72052Smrg]) 4086ea72052Smrg 409168023feSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 410168023feSmrg# Free Software Foundation, Inc. 411168023feSmrg# 412168023feSmrg# This file is free software; the Free Software Foundation 413168023feSmrg# gives unlimited permission to copy and/or distribute it, 414168023feSmrg# with or without modifications, as long as this notice is preserved. 4156ea72052Smrg 416168023feSmrg# serial 8 4176ea72052Smrg 418168023feSmrg# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. 419168023feSmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) 4206ea72052Smrg 421168023feSmrg# Do all the work for Automake. -*- Autoconf -*- 4226ea72052Smrg 423168023feSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 424168023feSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. 425168023feSmrg# 426168023feSmrg# This file is free software; the Free Software Foundation 427168023feSmrg# gives unlimited permission to copy and/or distribute it, 428168023feSmrg# with or without modifications, as long as this notice is preserved. 429168023feSmrg 430168023feSmrg# serial 16 431168023feSmrg 432168023feSmrg# This macro actually does too much. Some checks are only needed if 433168023feSmrg# your package does certain things. But this isn't really a big deal. 434168023feSmrg 435168023feSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 436168023feSmrg# AM_INIT_AUTOMAKE([OPTIONS]) 437168023feSmrg# ----------------------------------------------- 438168023feSmrg# The call with PACKAGE and VERSION arguments is the old style 439168023feSmrg# call (pre autoconf-2.50), which is being phased out. PACKAGE 440168023feSmrg# and VERSION should now be passed to AC_INIT and removed from 441168023feSmrg# the call to AM_INIT_AUTOMAKE. 442168023feSmrg# We support both call styles for the transition. After 443168023feSmrg# the next Automake release, Autoconf can make the AC_INIT 444168023feSmrg# arguments mandatory, and then we can depend on a new Autoconf 445168023feSmrg# release and drop the old call support. 446168023feSmrgAC_DEFUN([AM_INIT_AUTOMAKE], 447168023feSmrg[AC_PREREQ([2.62])dnl 448168023feSmrgdnl Autoconf wants to disallow AM_ names. We explicitly allow 449168023feSmrgdnl the ones we care about. 450168023feSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 451168023feSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 452168023feSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl 453168023feSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then 454168023feSmrg # Use -I$(srcdir) only when $(srcdir) != ., so that make's output 455168023feSmrg # is not polluted with repeated "-I." 456168023feSmrg AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl 457168023feSmrg # test to see if srcdir already configured 458168023feSmrg if test -f $srcdir/config.status; then 459168023feSmrg AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 460168023feSmrg fi 461168023feSmrgfi 462168023feSmrg 463168023feSmrg# test whether we have cygpath 464168023feSmrgif test -z "$CYGPATH_W"; then 465168023feSmrg if (cygpath --version) >/dev/null 2>/dev/null; then 466168023feSmrg CYGPATH_W='cygpath -w' 467168023feSmrg else 468168023feSmrg CYGPATH_W=echo 469168023feSmrg fi 470168023feSmrgfi 471168023feSmrgAC_SUBST([CYGPATH_W]) 472168023feSmrg 473168023feSmrg# Define the identity of the package. 474168023feSmrgdnl Distinguish between old-style and new-style calls. 475168023feSmrgm4_ifval([$2], 476168023feSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 477168023feSmrg AC_SUBST([PACKAGE], [$1])dnl 478168023feSmrg AC_SUBST([VERSION], [$2])], 479168023feSmrg[_AM_SET_OPTIONS([$1])dnl 480168023feSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. 481168023feSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, 482168023feSmrg [m4_fatal([AC_INIT should be called with package and version arguments])])dnl 483168023feSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl 484168023feSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl 485168023feSmrg 486168023feSmrg_AM_IF_OPTION([no-define],, 487168023feSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) 488168023feSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl 489168023feSmrg 490168023feSmrg# Some tools Automake needs. 491168023feSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl 492168023feSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl 493168023feSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) 494168023feSmrgAM_MISSING_PROG(AUTOCONF, autoconf) 495168023feSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) 496168023feSmrgAM_MISSING_PROG(AUTOHEADER, autoheader) 497168023feSmrgAM_MISSING_PROG(MAKEINFO, makeinfo) 498168023feSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl 499168023feSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl 500168023feSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl 501168023feSmrg# We need awk for the "check" target. The system "awk" is bad on 502168023feSmrg# some platforms. 503168023feSmrgAC_REQUIRE([AC_PROG_AWK])dnl 504168023feSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl 505168023feSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl 506168023feSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], 507168023feSmrg [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], 508168023feSmrg [_AM_PROG_TAR([v7])])]) 509168023feSmrg_AM_IF_OPTION([no-dependencies],, 510168023feSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC], 511168023feSmrg [_AM_DEPENDENCIES(CC)], 512168023feSmrg [define([AC_PROG_CC], 513168023feSmrg defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl 514168023feSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX], 515168023feSmrg [_AM_DEPENDENCIES(CXX)], 516168023feSmrg [define([AC_PROG_CXX], 517168023feSmrg defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl 518168023feSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC], 519168023feSmrg [_AM_DEPENDENCIES(OBJC)], 520168023feSmrg [define([AC_PROG_OBJC], 521168023feSmrg defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl 522168023feSmrg]) 523168023feSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl 524168023feSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the 525168023feSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro 526168023feSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below. 527168023feSmrgAC_CONFIG_COMMANDS_PRE(dnl 528168023feSmrg[m4_provide_if([_AM_COMPILER_EXEEXT], 529168023feSmrg [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl 530168023feSmrg]) 531168023feSmrg 532168023feSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not 533168023feSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further 534168023feSmrgdnl mangled by Autoconf and run in a shell conditional statement. 535168023feSmrgm4_define([_AC_COMPILER_EXEEXT], 536168023feSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) 537168023feSmrg 538168023feSmrg 539168023feSmrg# When config.status generates a header, we must update the stamp-h file. 540168023feSmrg# This file resides in the same directory as the config header 541168023feSmrg# that is generated. The stamp files are numbered to have different names. 542168023feSmrg 543168023feSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 544168023feSmrg# loop where config.status creates the headers, so we can generate 545168023feSmrg# our stamp files there. 546168023feSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 547168023feSmrg[# Compute $1's index in $config_headers. 548168023feSmrg_am_arg=$1 549168023feSmrg_am_stamp_count=1 550168023feSmrgfor _am_header in $config_headers :; do 551168023feSmrg case $_am_header in 552168023feSmrg $_am_arg | $_am_arg:* ) 553168023feSmrg break ;; 554168023feSmrg * ) 555168023feSmrg _am_stamp_count=`expr $_am_stamp_count + 1` ;; 556168023feSmrg esac 557168023feSmrgdone 558168023feSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) 559168023feSmrg 560168023feSmrg# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. 561168023feSmrg# 562168023feSmrg# This file is free software; the Free Software Foundation 563168023feSmrg# gives unlimited permission to copy and/or distribute it, 564168023feSmrg# with or without modifications, as long as this notice is preserved. 565168023feSmrg 566168023feSmrg# AM_PROG_INSTALL_SH 567168023feSmrg# ------------------ 568168023feSmrg# Define $install_sh. 569168023feSmrgAC_DEFUN([AM_PROG_INSTALL_SH], 570168023feSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 571168023feSmrgif test x"${install_sh}" != xset; then 572168023feSmrg case $am_aux_dir in 573168023feSmrg *\ * | *\ *) 574168023feSmrg install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; 575168023feSmrg *) 576168023feSmrg install_sh="\${SHELL} $am_aux_dir/install-sh" 577168023feSmrg esac 578168023feSmrgfi 579168023feSmrgAC_SUBST(install_sh)]) 580168023feSmrg 581168023feSmrg# Copyright (C) 2003, 2005 Free Software Foundation, Inc. 582168023feSmrg# 583168023feSmrg# This file is free software; the Free Software Foundation 584168023feSmrg# gives unlimited permission to copy and/or distribute it, 585168023feSmrg# with or without modifications, as long as this notice is preserved. 5866ea72052Smrg 5876ea72052Smrg# serial 2 5886ea72052Smrg 589168023feSmrg# Check whether the underlying file-system supports filenames 590168023feSmrg# with a leading dot. For instance MS-DOS doesn't. 591168023feSmrgAC_DEFUN([AM_SET_LEADING_DOT], 592168023feSmrg[rm -rf .tst 2>/dev/null 593168023feSmrgmkdir .tst 2>/dev/null 594168023feSmrgif test -d .tst; then 595168023feSmrg am__leading_dot=. 596168023feSmrgelse 597168023feSmrg am__leading_dot=_ 598168023feSmrgfi 599168023feSmrgrmdir .tst 2>/dev/null 600168023feSmrgAC_SUBST([am__leading_dot])]) 601168023feSmrg 602168023feSmrg# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- 603168023feSmrg# From Jim Meyering 604168023feSmrg 605168023feSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 606168023feSmrg# Free Software Foundation, Inc. 607168023feSmrg# 608168023feSmrg# This file is free software; the Free Software Foundation 609168023feSmrg# gives unlimited permission to copy and/or distribute it, 610168023feSmrg# with or without modifications, as long as this notice is preserved. 611168023feSmrg 612168023feSmrg# serial 5 613168023feSmrg 614168023feSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE]) 615168023feSmrg# ---------------------------------- 616168023feSmrg# Control maintainer-specific portions of Makefiles. 617168023feSmrg# Default is to disable them, unless `enable' is passed literally. 618168023feSmrg# For symmetry, `disable' may be passed as well. Anyway, the user 619168023feSmrg# can override the default with the --enable/--disable switch. 620168023feSmrgAC_DEFUN([AM_MAINTAINER_MODE], 621168023feSmrg[m4_case(m4_default([$1], [disable]), 622168023feSmrg [enable], [m4_define([am_maintainer_other], [disable])], 623168023feSmrg [disable], [m4_define([am_maintainer_other], [enable])], 624168023feSmrg [m4_define([am_maintainer_other], [enable]) 625168023feSmrg m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) 626168023feSmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) 627168023feSmrg dnl maintainer-mode's default is 'disable' unless 'enable' is passed 628168023feSmrg AC_ARG_ENABLE([maintainer-mode], 629168023feSmrg[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful 630168023feSmrg (and sometimes confusing) to the casual installer], 631168023feSmrg [USE_MAINTAINER_MODE=$enableval], 632168023feSmrg [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) 633168023feSmrg AC_MSG_RESULT([$USE_MAINTAINER_MODE]) 634168023feSmrg AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) 635168023feSmrg MAINT=$MAINTAINER_MODE_TRUE 636168023feSmrg AC_SUBST([MAINT])dnl 637168023feSmrg] 638168023feSmrg) 639168023feSmrg 640168023feSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) 641168023feSmrg 642168023feSmrg# Check to see how 'make' treats includes. -*- Autoconf -*- 643168023feSmrg 644168023feSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. 645168023feSmrg# 646168023feSmrg# This file is free software; the Free Software Foundation 647168023feSmrg# gives unlimited permission to copy and/or distribute it, 648168023feSmrg# with or without modifications, as long as this notice is preserved. 649168023feSmrg 650168023feSmrg# serial 4 651168023feSmrg 6526ea72052Smrg# AM_MAKE_INCLUDE() 6536ea72052Smrg# ----------------- 6546ea72052Smrg# Check to see how make treats includes. 6556ea72052SmrgAC_DEFUN([AM_MAKE_INCLUDE], 6566ea72052Smrg[am_make=${MAKE-make} 6576ea72052Smrgcat > confinc << 'END' 6586ea72052Smrgam__doit: 659168023feSmrg @echo this is the am__doit target 6606ea72052Smrg.PHONY: am__doit 6616ea72052SmrgEND 6626ea72052Smrg# If we don't find an include directive, just comment out the code. 6636ea72052SmrgAC_MSG_CHECKING([for style of include used by $am_make]) 6646ea72052Smrgam__include="#" 6656ea72052Smrgam__quote= 6666ea72052Smrg_am_result=none 6676ea72052Smrg# First try GNU make style include. 6686ea72052Smrgecho "include confinc" > confmf 669168023feSmrg# Ignore all kinds of additional output from `make'. 670168023feSmrgcase `$am_make -s -f confmf 2> /dev/null` in #( 671168023feSmrg*the\ am__doit\ target*) 672168023feSmrg am__include=include 673168023feSmrg am__quote= 674168023feSmrg _am_result=GNU 675168023feSmrg ;; 676168023feSmrgesac 6776ea72052Smrg# Now try BSD make style include. 6786ea72052Smrgif test "$am__include" = "#"; then 6796ea72052Smrg echo '.include "confinc"' > confmf 680168023feSmrg case `$am_make -s -f confmf 2> /dev/null` in #( 681168023feSmrg *the\ am__doit\ target*) 682168023feSmrg am__include=.include 683168023feSmrg am__quote="\"" 684168023feSmrg _am_result=BSD 685168023feSmrg ;; 686168023feSmrg esac 6876ea72052Smrgfi 6886ea72052SmrgAC_SUBST([am__include]) 6896ea72052SmrgAC_SUBST([am__quote]) 6906ea72052SmrgAC_MSG_RESULT([$_am_result]) 6916ea72052Smrgrm -f confinc confmf 6926ea72052Smrg]) 6936ea72052Smrg 694168023feSmrg# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- 6956ea72052Smrg 696168023feSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 697168023feSmrg# Free Software Foundation, Inc. 698168023feSmrg# 699168023feSmrg# This file is free software; the Free Software Foundation 700168023feSmrg# gives unlimited permission to copy and/or distribute it, 701168023feSmrg# with or without modifications, as long as this notice is preserved. 7026ea72052Smrg 703168023feSmrg# serial 6 7046ea72052Smrg 705168023feSmrg# AM_MISSING_PROG(NAME, PROGRAM) 706168023feSmrg# ------------------------------ 707168023feSmrgAC_DEFUN([AM_MISSING_PROG], 708168023feSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN]) 709168023feSmrg$1=${$1-"${am_missing_run}$2"} 710168023feSmrgAC_SUBST($1)]) 7116ea72052Smrg 7126ea72052Smrg 713168023feSmrg# AM_MISSING_HAS_RUN 714168023feSmrg# ------------------ 715168023feSmrg# Define MISSING if not defined so far and test if it supports --run. 716168023feSmrg# If it does, set am_missing_run to use it, otherwise, to nothing. 717168023feSmrgAC_DEFUN([AM_MISSING_HAS_RUN], 718168023feSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 719168023feSmrgAC_REQUIRE_AUX_FILE([missing])dnl 720168023feSmrgif test x"${MISSING+set}" != xset; then 721168023feSmrg case $am_aux_dir in 722168023feSmrg *\ * | *\ *) 723168023feSmrg MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; 724168023feSmrg *) 725168023feSmrg MISSING="\${SHELL} $am_aux_dir/missing" ;; 726168023feSmrg esac 727168023feSmrgfi 728168023feSmrg# Use eval to expand $SHELL 729168023feSmrgif eval "$MISSING --run true"; then 730168023feSmrg am_missing_run="$MISSING --run " 7316ea72052Smrgelse 732168023feSmrg am_missing_run= 733168023feSmrg AC_MSG_WARN([`missing' script is too old or missing]) 7346ea72052Smrgfi 735168023feSmrg]) 7366ea72052Smrg 737168023feSmrg# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 738168023feSmrg# 739168023feSmrg# This file is free software; the Free Software Foundation 740168023feSmrg# gives unlimited permission to copy and/or distribute it, 741168023feSmrg# with or without modifications, as long as this notice is preserved. 7426ea72052Smrg 743168023feSmrg# AM_PROG_MKDIR_P 744168023feSmrg# --------------- 745168023feSmrg# Check for `mkdir -p'. 746168023feSmrgAC_DEFUN([AM_PROG_MKDIR_P], 747168023feSmrg[AC_PREREQ([2.60])dnl 748168023feSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl 749168023feSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, 750168023feSmrgdnl while keeping a definition of mkdir_p for backward compatibility. 751168023feSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. 752168023feSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of 753168023feSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own 754168023feSmrgdnl adjustment using top_builddir (which is defined more often than 755168023feSmrgdnl MKDIR_P). 756168023feSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl 757168023feSmrgcase $mkdir_p in 758168023feSmrg [[\\/$]]* | ?:[[\\/]]*) ;; 759168023feSmrg */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; 760168023feSmrgesac 761168023feSmrg]) 7626ea72052Smrg 763168023feSmrg# Helper functions for option handling. -*- Autoconf -*- 7646ea72052Smrg 765168023feSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. 766168023feSmrg# 767168023feSmrg# This file is free software; the Free Software Foundation 768168023feSmrg# gives unlimited permission to copy and/or distribute it, 769168023feSmrg# with or without modifications, as long as this notice is preserved. 7706ea72052Smrg 771168023feSmrg# serial 4 7726ea72052Smrg 773168023feSmrg# _AM_MANGLE_OPTION(NAME) 774168023feSmrg# ----------------------- 775168023feSmrgAC_DEFUN([_AM_MANGLE_OPTION], 776168023feSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 7776ea72052Smrg 778168023feSmrg# _AM_SET_OPTION(NAME) 779168023feSmrg# ------------------------------ 780168023feSmrg# Set option NAME. Presently that only means defining a flag for this option. 781168023feSmrgAC_DEFUN([_AM_SET_OPTION], 782168023feSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) 7836ea72052Smrg 784168023feSmrg# _AM_SET_OPTIONS(OPTIONS) 785168023feSmrg# ---------------------------------- 786168023feSmrg# OPTIONS is a space-separated list of Automake options. 787168023feSmrgAC_DEFUN([_AM_SET_OPTIONS], 788168023feSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 7896ea72052Smrg 790168023feSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 791168023feSmrg# ------------------------------------------- 792168023feSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 793168023feSmrgAC_DEFUN([_AM_IF_OPTION], 794168023feSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 7956ea72052Smrg 796168023feSmrg# Check to make sure that the build environment is sane. -*- Autoconf -*- 7976ea72052Smrg 798168023feSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 799168023feSmrg# Free Software Foundation, Inc. 8006ea72052Smrg# 801168023feSmrg# This file is free software; the Free Software Foundation 802168023feSmrg# gives unlimited permission to copy and/or distribute it, 803168023feSmrg# with or without modifications, as long as this notice is preserved. 8046ea72052Smrg 805168023feSmrg# serial 5 8066ea72052Smrg 807168023feSmrg# AM_SANITY_CHECK 808168023feSmrg# --------------- 809168023feSmrgAC_DEFUN([AM_SANITY_CHECK], 810168023feSmrg[AC_MSG_CHECKING([whether build environment is sane]) 811168023feSmrg# Just in case 812168023feSmrgsleep 1 813168023feSmrgecho timestamp > conftest.file 814168023feSmrg# Reject unsafe characters in $srcdir or the absolute working directory 815168023feSmrg# name. Accept space and tab only in the latter. 816168023feSmrgam_lf=' 817168023feSmrg' 818168023feSmrgcase `pwd` in 819168023feSmrg *[[\\\"\#\$\&\'\`$am_lf]]*) 820168023feSmrg AC_MSG_ERROR([unsafe absolute working directory name]);; 821168023feSmrgesac 822168023feSmrgcase $srcdir in 823168023feSmrg *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) 824168023feSmrg AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; 825168023feSmrgesac 826168023feSmrg 827168023feSmrg# Do `set' in a subshell so we don't clobber the current shell's 828168023feSmrg# arguments. Must try -L first in case configure is actually a 829168023feSmrg# symlink; some systems play weird games with the mod time of symlinks 830168023feSmrg# (eg FreeBSD returns the mod time of the symlink's containing 831168023feSmrg# directory). 832168023feSmrgif ( 833168023feSmrg set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` 834168023feSmrg if test "$[*]" = "X"; then 835168023feSmrg # -L didn't work. 836168023feSmrg set X `ls -t "$srcdir/configure" conftest.file` 837168023feSmrg fi 838168023feSmrg rm -f conftest.file 839168023feSmrg if test "$[*]" != "X $srcdir/configure conftest.file" \ 840168023feSmrg && test "$[*]" != "X conftest.file $srcdir/configure"; then 8416ea72052Smrg 842168023feSmrg # If neither matched, then we have a broken ls. This can happen 843168023feSmrg # if, for instance, CONFIG_SHELL is bash and it inherits a 844168023feSmrg # broken ls alias from the environment. This has actually 845168023feSmrg # happened. Such a system could not be considered "sane". 846168023feSmrg AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 847168023feSmrgalias in your environment]) 848168023feSmrg fi 8496ea72052Smrg 850168023feSmrg test "$[2]" = conftest.file 851168023feSmrg ) 852168023feSmrgthen 853168023feSmrg # Ok. 854168023feSmrg : 8556ea72052Smrgelse 856168023feSmrg AC_MSG_ERROR([newly created file is older than distributed files! 857168023feSmrgCheck your system clock]) 858168023feSmrgfi 859168023feSmrgAC_MSG_RESULT(yes)]) 8606ea72052Smrg 861168023feSmrg# Copyright (C) 2009 Free Software Foundation, Inc. 862168023feSmrg# 863168023feSmrg# This file is free software; the Free Software Foundation 864168023feSmrg# gives unlimited permission to copy and/or distribute it, 865168023feSmrg# with or without modifications, as long as this notice is preserved. 8666ea72052Smrg 867168023feSmrg# serial 1 8686ea72052Smrg 869168023feSmrg# AM_SILENT_RULES([DEFAULT]) 870168023feSmrg# -------------------------- 871168023feSmrg# Enable less verbose build rules; with the default set to DEFAULT 872168023feSmrg# (`yes' being less verbose, `no' or empty being verbose). 873168023feSmrgAC_DEFUN([AM_SILENT_RULES], 874168023feSmrg[AC_ARG_ENABLE([silent-rules], 875168023feSmrg[ --enable-silent-rules less verbose build output (undo: `make V=1') 876168023feSmrg --disable-silent-rules verbose build output (undo: `make V=0')]) 877168023feSmrgcase $enable_silent_rules in 878168023feSmrgyes) AM_DEFAULT_VERBOSITY=0;; 879168023feSmrgno) AM_DEFAULT_VERBOSITY=1;; 880168023feSmrg*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; 881168023feSmrgesac 882168023feSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl 883168023feSmrgAM_BACKSLASH='\' 884168023feSmrgAC_SUBST([AM_BACKSLASH])dnl 885168023feSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl 886168023feSmrg]) 887168023feSmrg 888168023feSmrg# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 8896ea72052Smrg# 890168023feSmrg# This file is free software; the Free Software Foundation 891168023feSmrg# gives unlimited permission to copy and/or distribute it, 892168023feSmrg# with or without modifications, as long as this notice is preserved. 893168023feSmrg 894168023feSmrg# AM_PROG_INSTALL_STRIP 895168023feSmrg# --------------------- 896168023feSmrg# One issue with vendor `install' (even GNU) is that you can't 897168023feSmrg# specify the program used to strip binaries. This is especially 898168023feSmrg# annoying in cross-compiling environments, where the build's strip 899168023feSmrg# is unlikely to handle the host's binaries. 900168023feSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we 901168023feSmrg# always use install-sh in `make install-strip', and initialize 902168023feSmrg# STRIPPROG with the value of the STRIP variable (set by the user). 903168023feSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP], 904168023feSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 905168023feSmrg# Installed binaries are usually stripped using `strip' when the user 906168023feSmrg# run `make install-strip'. However `strip' might not be the right 907168023feSmrg# tool to use in cross-compilation environments, therefore Automake 908168023feSmrg# will honor the `STRIP' environment variable to overrule this program. 909168023feSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'. 910168023feSmrgif test "$cross_compiling" != no; then 911168023feSmrg AC_CHECK_TOOL([STRIP], [strip], :) 912168023feSmrgfi 913168023feSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" 914168023feSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])]) 915168023feSmrg 916168023feSmrg# Copyright (C) 2006, 2008 Free Software Foundation, Inc. 9176ea72052Smrg# 918168023feSmrg# This file is free software; the Free Software Foundation 919168023feSmrg# gives unlimited permission to copy and/or distribute it, 920168023feSmrg# with or without modifications, as long as this notice is preserved. 9216ea72052Smrg 922168023feSmrg# serial 2 9236ea72052Smrg 924168023feSmrg# _AM_SUBST_NOTMAKE(VARIABLE) 925168023feSmrg# --------------------------- 926168023feSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. 927168023feSmrg# This macro is traced by Automake. 928168023feSmrgAC_DEFUN([_AM_SUBST_NOTMAKE]) 9296ea72052Smrg 930168023feSmrg# AM_SUBST_NOTMAKE(VARIABLE) 931168023feSmrg# --------------------------- 932168023feSmrg# Public sister of _AM_SUBST_NOTMAKE. 933168023feSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) 9346ea72052Smrg 935168023feSmrg# Check how to create a tarball. -*- Autoconf -*- 9366ea72052Smrg 937168023feSmrg# Copyright (C) 2004, 2005 Free Software Foundation, Inc. 938168023feSmrg# 939168023feSmrg# This file is free software; the Free Software Foundation 940168023feSmrg# gives unlimited permission to copy and/or distribute it, 941168023feSmrg# with or without modifications, as long as this notice is preserved. 9426ea72052Smrg 943168023feSmrg# serial 2 9446ea72052Smrg 945168023feSmrg# _AM_PROG_TAR(FORMAT) 946168023feSmrg# -------------------- 947168023feSmrg# Check how to create a tarball in format FORMAT. 948168023feSmrg# FORMAT should be one of `v7', `ustar', or `pax'. 949168023feSmrg# 950168023feSmrg# Substitute a variable $(am__tar) that is a command 951168023feSmrg# writing to stdout a FORMAT-tarball containing the directory 952168023feSmrg# $tardir. 953168023feSmrg# tardir=directory && $(am__tar) > result.tar 954168023feSmrg# 955168023feSmrg# Substitute a variable $(am__untar) that extract such 956168023feSmrg# a tarball read from stdin. 957168023feSmrg# $(am__untar) < result.tar 958168023feSmrgAC_DEFUN([_AM_PROG_TAR], 959168023feSmrg[# Always define AMTAR for backward compatibility. 960168023feSmrgAM_MISSING_PROG([AMTAR], [tar]) 961168023feSmrgm4_if([$1], [v7], 962168023feSmrg [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], 963168023feSmrg [m4_case([$1], [ustar],, [pax],, 964168023feSmrg [m4_fatal([Unknown tar format])]) 965168023feSmrgAC_MSG_CHECKING([how to create a $1 tar archive]) 966168023feSmrg# Loop over all known methods to create a tar archive until one works. 967168023feSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' 968168023feSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools} 969168023feSmrg# Do not fold the above two line into one, because Tru64 sh and 970168023feSmrg# Solaris sh will not grok spaces in the rhs of `-'. 971168023feSmrgfor _am_tool in $_am_tools 972168023feSmrgdo 973168023feSmrg case $_am_tool in 974168023feSmrg gnutar) 975168023feSmrg for _am_tar in tar gnutar gtar; 976168023feSmrg do 977168023feSmrg AM_RUN_LOG([$_am_tar --version]) && break 978168023feSmrg done 979168023feSmrg am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' 980168023feSmrg am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' 981168023feSmrg am__untar="$_am_tar -xf -" 982168023feSmrg ;; 983168023feSmrg plaintar) 984168023feSmrg # Must skip GNU tar: if it does not support --format= it doesn't create 985168023feSmrg # ustar tarball either. 986168023feSmrg (tar --version) >/dev/null 2>&1 && continue 987168023feSmrg am__tar='tar chf - "$$tardir"' 988168023feSmrg am__tar_='tar chf - "$tardir"' 989168023feSmrg am__untar='tar xf -' 990168023feSmrg ;; 991168023feSmrg pax) 992168023feSmrg am__tar='pax -L -x $1 -w "$$tardir"' 993168023feSmrg am__tar_='pax -L -x $1 -w "$tardir"' 994168023feSmrg am__untar='pax -r' 995168023feSmrg ;; 996168023feSmrg cpio) 997168023feSmrg am__tar='find "$$tardir" -print | cpio -o -H $1 -L' 998168023feSmrg am__tar_='find "$tardir" -print | cpio -o -H $1 -L' 999168023feSmrg am__untar='cpio -i -H $1 -d' 1000168023feSmrg ;; 1001168023feSmrg none) 1002168023feSmrg am__tar=false 1003168023feSmrg am__tar_=false 1004168023feSmrg am__untar=false 1005168023feSmrg ;; 1006168023feSmrg esac 10076ea72052Smrg 1008168023feSmrg # If the value was cached, stop now. We just wanted to have am__tar 1009168023feSmrg # and am__untar set. 1010168023feSmrg test -n "${am_cv_prog_tar_$1}" && break 10116ea72052Smrg 1012168023feSmrg # tar/untar a dummy directory, and stop if the command works 1013168023feSmrg rm -rf conftest.dir 1014168023feSmrg mkdir conftest.dir 1015168023feSmrg echo GrepMe > conftest.dir/file 1016168023feSmrg AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) 1017168023feSmrg rm -rf conftest.dir 1018168023feSmrg if test -s conftest.tar; then 1019168023feSmrg AM_RUN_LOG([$am__untar <conftest.tar]) 1020168023feSmrg grep GrepMe conftest.dir/file >/dev/null 2>&1 && break 1021168023feSmrg fi 1022168023feSmrgdone 1023168023feSmrgrm -rf conftest.dir 10246ea72052Smrg 1025168023feSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) 1026168023feSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])]) 1027168023feSmrgAC_SUBST([am__tar]) 1028168023feSmrgAC_SUBST([am__untar]) 1029168023feSmrg]) # _AM_PROG_TAR 10306ea72052Smrg 1031168023feSmrgdnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. 10326ea72052Smrgdnl 1033168023feSmrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. 10346ea72052Smrgdnl 1035168023feSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a 1036168023feSmrgdnl copy of this software and associated documentation files (the "Software"), 1037168023feSmrgdnl to deal in the Software without restriction, including without limitation 1038168023feSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense, 1039168023feSmrgdnl and/or sell copies of the Software, and to permit persons to whom the 1040168023feSmrgdnl Software is furnished to do so, subject to the following conditions: 1041168023feSmrgdnl 1042168023feSmrgdnl The above copyright notice and this permission notice (including the next 1043168023feSmrgdnl paragraph) shall be included in all copies or substantial portions of the 1044168023feSmrgdnl Software. 1045168023feSmrgdnl 1046168023feSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1047168023feSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1048168023feSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 1049168023feSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 1050168023feSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 1051168023feSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 1052168023feSmrgdnl DEALINGS IN THE SOFTWARE. 1053168023feSmrg 1054168023feSmrg# XORG_MACROS_VERSION(required-version) 1055168023feSmrg# ------------------------------------- 1056168023feSmrg# Minimum version: 1.1.0 1057168023feSmrg# 1058168023feSmrg# If you're using a macro added in Version 1.1 or newer, include this in 1059168023feSmrg# your configure.ac with the minimum required version, such as: 1060168023feSmrg# XORG_MACROS_VERSION(1.1) 1061168023feSmrg# 1062168023feSmrg# To ensure that this macro is defined, also add: 1063168023feSmrg# m4_ifndef([XORG_MACROS_VERSION], 1064168023feSmrg# [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])]) 1065168023feSmrg# 1066168023feSmrg# 1067168023feSmrg# See the "minimum version" comment for each macro you use to see what 1068168023feSmrg# version you require. 1069168023feSmrgm4_defun([XORG_MACROS_VERSION],[ 1070168023feSmrgm4_define([vers_have], [1.10.0]) 1071168023feSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) 1072168023feSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) 1073168023feSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,, 1074168023feSmrg [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])]) 1075168023feSmrgm4_if(m4_version_compare(vers_have, [$1]), -1, 1076168023feSmrg [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])]) 1077168023feSmrgm4_undefine([vers_have]) 1078168023feSmrgm4_undefine([maj_have]) 1079168023feSmrgm4_undefine([maj_needed]) 1080168023feSmrg]) # XORG_MACROS_VERSION 10816ea72052Smrg 10826ea72052Smrg# XORG_PROG_RAWCPP() 10836ea72052Smrg# ------------------ 1084168023feSmrg# Minimum version: 1.0.0 1085168023feSmrg# 10866ea72052Smrg# Find cpp program and necessary flags for use in pre-processing text files 10876ea72052Smrg# such as man pages and config files 10886ea72052SmrgAC_DEFUN([XORG_PROG_RAWCPP],[ 10896ea72052SmrgAC_REQUIRE([AC_PROG_CPP]) 10906ea72052SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 10916ea72052Smrg [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) 10926ea72052Smrg 10936ea72052Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined, 10946ea72052Smrg# which is not the best choice for supporting other OS'es, but covers most 10956ea72052Smrg# of the ones we need for now. 10966ea72052SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef]) 10976ea72052SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?]) 10986ea72052Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 10996ea72052Smrg AC_MSG_RESULT([no]) 11006ea72052Smrgelse 11016ea72052Smrg if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 11026ea72052Smrg RAWCPPFLAGS=-undef 11036ea72052Smrg AC_MSG_RESULT([yes]) 1104168023feSmrg # under Cygwin unix is still defined even with -undef 1105168023feSmrg elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 1106168023feSmrg RAWCPPFLAGS="-undef -ansi" 1107168023feSmrg AC_MSG_RESULT([yes, with -ansi]) 11086ea72052Smrg else 11096ea72052Smrg AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.]) 11106ea72052Smrg fi 11116ea72052Smrgfi 11126ea72052Smrgrm -f conftest.$ac_ext 11136ea72052Smrg 11146ea72052SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional]) 11156ea72052SmrgAC_LANG_CONFTEST([Does cpp preserve "whitespace"?]) 11166ea72052Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 11176ea72052Smrg AC_MSG_RESULT([no]) 11186ea72052Smrgelse 11196ea72052Smrg if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 11206ea72052Smrg RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" 11216ea72052Smrg AC_MSG_RESULT([yes]) 11226ea72052Smrg else 11236ea72052Smrg AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) 11246ea72052Smrg fi 11256ea72052Smrgfi 11266ea72052Smrgrm -f conftest.$ac_ext 11276ea72052SmrgAC_SUBST(RAWCPPFLAGS) 11286ea72052Smrg]) # XORG_PROG_RAWCPP 11296ea72052Smrg 11306ea72052Smrg# XORG_MANPAGE_SECTIONS() 11316ea72052Smrg# ----------------------- 1132168023feSmrg# Minimum version: 1.0.0 1133168023feSmrg# 11346ea72052Smrg# Determine which sections man pages go in for the different man page types 11356ea72052Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. 11366ea72052Smrg# Not sure if there's any better way than just hardcoding by OS name. 11376ea72052Smrg# Override default settings by setting environment variables 1138168023feSmrg# Added MAN_SUBSTS in version 1.8 1139168023feSmrg# Added AC_PROG_SED in version 1.8 11406ea72052Smrg 11416ea72052SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[ 11426ea72052SmrgAC_REQUIRE([AC_CANONICAL_HOST]) 1143168023feSmrgAC_REQUIRE([AC_PROG_SED]) 11446ea72052Smrg 11456ea72052Smrgif test x$APP_MAN_SUFFIX = x ; then 1146168023feSmrg APP_MAN_SUFFIX=1 11476ea72052Smrgfi 11486ea72052Smrgif test x$APP_MAN_DIR = x ; then 1149168023feSmrg APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' 11506ea72052Smrgfi 11516ea72052Smrg 11526ea72052Smrgif test x$LIB_MAN_SUFFIX = x ; then 1153168023feSmrg LIB_MAN_SUFFIX=3 11546ea72052Smrgfi 11556ea72052Smrgif test x$LIB_MAN_DIR = x ; then 1156168023feSmrg LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' 11576ea72052Smrgfi 11586ea72052Smrg 11596ea72052Smrgif test x$FILE_MAN_SUFFIX = x ; then 11606ea72052Smrg case $host_os in 11616ea72052Smrg solaris*) FILE_MAN_SUFFIX=4 ;; 11626ea72052Smrg *) FILE_MAN_SUFFIX=5 ;; 11636ea72052Smrg esac 11646ea72052Smrgfi 11656ea72052Smrgif test x$FILE_MAN_DIR = x ; then 1166168023feSmrg FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' 11676ea72052Smrgfi 11686ea72052Smrg 11696ea72052Smrgif test x$MISC_MAN_SUFFIX = x ; then 11706ea72052Smrg case $host_os in 11716ea72052Smrg solaris*) MISC_MAN_SUFFIX=5 ;; 11726ea72052Smrg *) MISC_MAN_SUFFIX=7 ;; 11736ea72052Smrg esac 11746ea72052Smrgfi 11756ea72052Smrgif test x$MISC_MAN_DIR = x ; then 1176168023feSmrg MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' 11776ea72052Smrgfi 11786ea72052Smrg 11796ea72052Smrgif test x$DRIVER_MAN_SUFFIX = x ; then 11806ea72052Smrg case $host_os in 11816ea72052Smrg solaris*) DRIVER_MAN_SUFFIX=7 ;; 11826ea72052Smrg *) DRIVER_MAN_SUFFIX=4 ;; 11836ea72052Smrg esac 11846ea72052Smrgfi 11856ea72052Smrgif test x$DRIVER_MAN_DIR = x ; then 1186168023feSmrg DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' 11876ea72052Smrgfi 11886ea72052Smrg 11896ea72052Smrgif test x$ADMIN_MAN_SUFFIX = x ; then 11906ea72052Smrg case $host_os in 11916ea72052Smrg solaris*) ADMIN_MAN_SUFFIX=1m ;; 11926ea72052Smrg *) ADMIN_MAN_SUFFIX=8 ;; 11936ea72052Smrg esac 11946ea72052Smrgfi 11956ea72052Smrgif test x$ADMIN_MAN_DIR = x ; then 11966ea72052Smrg ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' 11976ea72052Smrgfi 11986ea72052Smrg 11996ea72052Smrg 12006ea72052SmrgAC_SUBST([APP_MAN_SUFFIX]) 12016ea72052SmrgAC_SUBST([LIB_MAN_SUFFIX]) 12026ea72052SmrgAC_SUBST([FILE_MAN_SUFFIX]) 12036ea72052SmrgAC_SUBST([MISC_MAN_SUFFIX]) 12046ea72052SmrgAC_SUBST([DRIVER_MAN_SUFFIX]) 12056ea72052SmrgAC_SUBST([ADMIN_MAN_SUFFIX]) 12066ea72052SmrgAC_SUBST([APP_MAN_DIR]) 12076ea72052SmrgAC_SUBST([LIB_MAN_DIR]) 12086ea72052SmrgAC_SUBST([FILE_MAN_DIR]) 12096ea72052SmrgAC_SUBST([MISC_MAN_DIR]) 12106ea72052SmrgAC_SUBST([DRIVER_MAN_DIR]) 12116ea72052SmrgAC_SUBST([ADMIN_MAN_DIR]) 1212168023feSmrg 1213168023feSmrgXORG_MAN_PAGE="X Version 11" 1214168023feSmrgAC_SUBST([XORG_MAN_PAGE]) 1215168023feSmrgMAN_SUBSTS="\ 1216168023feSmrg -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ 1217168023feSmrg -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ 1218168023feSmrg -e 's|__xservername__|Xorg|g' \ 1219168023feSmrg -e 's|__xconfigfile__|xorg.conf|g' \ 1220168023feSmrg -e 's|__projectroot__|\$(prefix)|g' \ 1221168023feSmrg -e 's|__apploaddir__|\$(appdefaultdir)|g' \ 1222168023feSmrg -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \ 1223168023feSmrg -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \ 1224168023feSmrg -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \ 1225168023feSmrg -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \ 1226168023feSmrg -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \ 1227168023feSmrg -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'" 1228168023feSmrgAC_SUBST([MAN_SUBSTS]) 1229168023feSmrg 12306ea72052Smrg]) # XORG_MANPAGE_SECTIONS 12316ea72052Smrg 1232168023feSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION]) 1233168023feSmrg# ------------------------ 1234168023feSmrg# Minimum version: 1.7.0 1235168023feSmrg# 1236168023feSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent 1237168023feSmrg# provided by xorg-sgml-doctools, if installed. 1238168023feSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[ 1239168023feSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])]) 1240168023feSmrgXORG_SGML_PATH= 1241168023feSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])], 1242168023feSmrg [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`], 1243168023feSmrg [m4_ifval([$1],[:], 1244168023feSmrg [if test x"$cross_compiling" != x"yes" ; then 1245168023feSmrg AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent], 1246168023feSmrg [XORG_SGML_PATH=$prefix/share/sgml]) 1247168023feSmrg fi]) 1248168023feSmrg ]) 1249168023feSmrg 1250168023feSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing 1251168023feSmrg# the path and the name of the doc stylesheet 1252168023feSmrgif test "x$XORG_SGML_PATH" != "x" ; then 1253168023feSmrg AC_MSG_RESULT([$XORG_SGML_PATH]) 1254168023feSmrg STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11 1255168023feSmrg XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl 1256168023feSmrgelse 1257168023feSmrg AC_MSG_RESULT([no]) 1258168023feSmrgfi 1259168023feSmrg 1260168023feSmrgAC_SUBST(XORG_SGML_PATH) 1261168023feSmrgAC_SUBST(STYLESHEET_SRCDIR) 1262168023feSmrgAC_SUBST(XSL_STYLESHEET) 1263168023feSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"]) 1264168023feSmrg]) # XORG_CHECK_SGML_DOCTOOLS 1265168023feSmrg 12666ea72052Smrg# XORG_CHECK_LINUXDOC 12676ea72052Smrg# ------------------- 1268168023feSmrg# Minimum version: 1.0.0 1269168023feSmrg# 12706ea72052Smrg# Defines the variable MAKE_TEXT if the necessary tools and 12716ea72052Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. 12726ea72052Smrg# Whether or not the necessary tools and files are found can be checked 12736ea72052Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC" 12746ea72052SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[ 1275168023feSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) 1276168023feSmrgAC_REQUIRE([XORG_WITH_PS2PDF]) 12776ea72052Smrg 12786ea72052SmrgAC_PATH_PROG(LINUXDOC, linuxdoc) 12796ea72052Smrg 1280168023feSmrgAC_MSG_CHECKING([whether to build documentation]) 1281168023feSmrg 1282168023feSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then 1283168023feSmrg BUILDDOC=yes 1284168023feSmrgelse 1285168023feSmrg BUILDDOC=no 1286168023feSmrgfi 1287168023feSmrg 1288168023feSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) 1289168023feSmrg 1290168023feSmrgAC_MSG_RESULT([$BUILDDOC]) 1291168023feSmrg 1292168023feSmrgAC_MSG_CHECKING([whether to build pdf documentation]) 1293168023feSmrg 1294168023feSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then 1295168023feSmrg BUILDPDFDOC=yes 1296168023feSmrgelse 1297168023feSmrg BUILDPDFDOC=no 1298168023feSmrgfi 1299168023feSmrg 1300168023feSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 1301168023feSmrg 1302168023feSmrgAC_MSG_RESULT([$BUILDPDFDOC]) 1303168023feSmrg 1304168023feSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f" 1305168023feSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps" 1306168023feSmrgMAKE_PDF="$PS2PDF" 1307168023feSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0" 1308168023feSmrg 1309168023feSmrgAC_SUBST(MAKE_TEXT) 1310168023feSmrgAC_SUBST(MAKE_PS) 1311168023feSmrgAC_SUBST(MAKE_PDF) 1312168023feSmrgAC_SUBST(MAKE_HTML) 1313168023feSmrg]) # XORG_CHECK_LINUXDOC 1314168023feSmrg 1315168023feSmrg# XORG_CHECK_DOCBOOK 1316168023feSmrg# ------------------- 1317168023feSmrg# Minimum version: 1.0.0 1318168023feSmrg# 1319168023feSmrg# Checks for the ability to build output formats from SGML DocBook source. 1320168023feSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC" 1321168023feSmrg# indicates whether the necessary tools and files are found and, if set, 1322168023feSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx. 1323168023feSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[ 1324168023feSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) 1325168023feSmrg 1326168023feSmrgBUILDTXTDOC=no 1327168023feSmrgBUILDPDFDOC=no 1328168023feSmrgBUILDPSDOC=no 1329168023feSmrgBUILDHTMLDOC=no 1330168023feSmrg 1331168023feSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps) 1332168023feSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf) 1333168023feSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html) 1334168023feSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt) 1335168023feSmrg 1336168023feSmrgAC_MSG_CHECKING([whether to build text documentation]) 1337168023feSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x && 1338168023feSmrg test x$BUILD_TXTDOC != xno; then 1339168023feSmrg BUILDTXTDOC=yes 1340168023feSmrgfi 1341168023feSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes]) 1342168023feSmrgAC_MSG_RESULT([$BUILDTXTDOC]) 1343168023feSmrg 1344168023feSmrgAC_MSG_CHECKING([whether to build PDF documentation]) 1345168023feSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x && 1346168023feSmrg test x$BUILD_PDFDOC != xno; then 1347168023feSmrg BUILDPDFDOC=yes 1348168023feSmrgfi 1349168023feSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 1350168023feSmrgAC_MSG_RESULT([$BUILDPDFDOC]) 1351168023feSmrg 1352168023feSmrgAC_MSG_CHECKING([whether to build PostScript documentation]) 1353168023feSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x && 1354168023feSmrg test x$BUILD_PSDOC != xno; then 1355168023feSmrg BUILDPSDOC=yes 1356168023feSmrgfi 1357168023feSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes]) 1358168023feSmrgAC_MSG_RESULT([$BUILDPSDOC]) 1359168023feSmrg 1360168023feSmrgAC_MSG_CHECKING([whether to build HTML documentation]) 1361168023feSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x && 1362168023feSmrg test x$BUILD_HTMLDOC != xno; then 1363168023feSmrg BUILDHTMLDOC=yes 1364168023feSmrgfi 1365168023feSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes]) 1366168023feSmrgAC_MSG_RESULT([$BUILDHTMLDOC]) 1367168023feSmrg 1368168023feSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT" 1369168023feSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS" 1370168023feSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF" 1371168023feSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML" 1372168023feSmrg 1373168023feSmrgAC_SUBST(MAKE_TEXT) 1374168023feSmrgAC_SUBST(MAKE_PS) 1375168023feSmrgAC_SUBST(MAKE_PDF) 1376168023feSmrgAC_SUBST(MAKE_HTML) 1377168023feSmrg]) # XORG_CHECK_DOCBOOK 1378168023feSmrg 1379168023feSmrg# XORG_WITH_XMLTO([MIN-VERSION]) 1380168023feSmrg# ---------------- 1381168023feSmrg# Minimum version: 1.5.0 1382168023feSmrg# 1383168023feSmrg# Documentation tools are not always available on all platforms and sometimes 1384168023feSmrg# not at the appropriate level. This macro enables a module to test for the 1385168023feSmrg# presence of the tool and obtain it's path in separate variables. Coupled with 1386168023feSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions 1387168023feSmrg# as whether or not to use the xmlto package. 1388168023feSmrg# 1389168023feSmrg# Interface to module: 1390168023feSmrg# HAVE_XMLTO: used in makefiles to conditionally generate documentation 1391168023feSmrg# XMLTO: returns the path of the xmlto program found 1392168023feSmrg# returns the path set by the user in the environment 1393168023feSmrg# --with-xmlto: 'yes' user instructs the module to use xmlto 1394168023feSmrg# 'no' user instructs the module not to use xmlto 1395168023feSmrg# 1396168023feSmrg# Added in version 1.10.0 1397168023feSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation 1398168023feSmrg# xmlto for text output requires either lynx, links, or w3m browsers 1399168023feSmrg# 1400168023feSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path. 1401168023feSmrg# 1402168023feSmrgAC_DEFUN([XORG_WITH_XMLTO],[ 1403168023feSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command]) 1404168023feSmrgAC_ARG_WITH(xmlto, 1405168023feSmrg AS_HELP_STRING([--with-xmlto], 1406168023feSmrg [Use xmlto to regenerate documentation (default: yes, if installed)]), 1407168023feSmrg [use_xmlto=$withval], [use_xmlto=auto]) 1408168023feSmrg 1409168023feSmrgif test "x$use_xmlto" = x"auto"; then 1410168023feSmrg AC_PATH_PROG([XMLTO], [xmlto]) 1411168023feSmrg if test "x$XMLTO" = "x"; then 1412168023feSmrg AC_MSG_WARN([xmlto not found - documentation targets will be skipped]) 1413168023feSmrg have_xmlto=no 1414168023feSmrg else 1415168023feSmrg have_xmlto=yes 1416168023feSmrg fi 1417168023feSmrgelif test "x$use_xmlto" = x"yes" ; then 1418168023feSmrg AC_PATH_PROG([XMLTO], [xmlto]) 1419168023feSmrg if test "x$XMLTO" = "x"; then 1420168023feSmrg AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH]) 1421168023feSmrg fi 1422168023feSmrg have_xmlto=yes 1423168023feSmrgelif test "x$use_xmlto" = x"no" ; then 1424168023feSmrg if test "x$XMLTO" != "x"; then 1425168023feSmrg AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified]) 1426168023feSmrg fi 1427168023feSmrg have_xmlto=no 1428168023feSmrgelse 1429168023feSmrg AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no']) 1430168023feSmrgfi 1431168023feSmrg 1432168023feSmrg# Test for a minimum version of xmlto, if provided. 1433168023feSmrgm4_ifval([$1], 1434168023feSmrg[if test "$have_xmlto" = yes; then 1435168023feSmrg # scrape the xmlto version 1436168023feSmrg AC_MSG_CHECKING([the xmlto version]) 1437168023feSmrg xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3` 1438168023feSmrg AC_MSG_RESULT([$xmlto_version]) 1439168023feSmrg AS_VERSION_COMPARE([$xmlto_version], [$1], 1440168023feSmrg [if test "x$use_xmlto" = xauto; then 1441168023feSmrg AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed]) 1442168023feSmrg have_xmlto=no 1443168023feSmrg else 1444168023feSmrg AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed]) 1445168023feSmrg fi]) 1446168023feSmrgfi]) 1447168023feSmrg 1448168023feSmrg# Test for the ability of xmlto to generate a text target 1449168023feSmrghave_xmlto_text=no 1450168023feSmrgcat > conftest.xml << "EOF" 1451168023feSmrgEOF 1452168023feSmrgAS_IF([test "$have_xmlto" = yes], 1453168023feSmrg [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1], 1454168023feSmrg [have_xmlto_text=yes], 1455168023feSmrg [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])]) 1456168023feSmrgrm -f conftest.xml 1457168023feSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes]) 1458168023feSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes]) 1459168023feSmrg]) # XORG_WITH_XMLTO 1460168023feSmrg 1461168023feSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION]) 1462168023feSmrg# ---------------- 1463168023feSmrg# Minimum version: 1.5.0 1464168023feSmrg# 1465168023feSmrg# Documentation tools are not always available on all platforms and sometimes 1466168023feSmrg# not at the appropriate level. This macro enables a module to test for the 1467168023feSmrg# presence of the tool and obtain it's path in separate variables. Coupled with 1468168023feSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions 1469168023feSmrg# as whether or not to use the asciidoc package. 1470168023feSmrg# 1471168023feSmrg# Interface to module: 1472168023feSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation 1473168023feSmrg# ASCIIDOC: returns the path of the asciidoc program found 1474168023feSmrg# returns the path set by the user in the environment 1475168023feSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc 1476168023feSmrg# 'no' user instructs the module not to use asciidoc 1477168023feSmrg# 1478168023feSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path. 1479168023feSmrg# 1480168023feSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[ 1481168023feSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command]) 1482168023feSmrgAC_ARG_WITH(asciidoc, 1483168023feSmrg AS_HELP_STRING([--with-asciidoc], 1484168023feSmrg [Use asciidoc to regenerate documentation (default: yes, if installed)]), 1485168023feSmrg [use_asciidoc=$withval], [use_asciidoc=auto]) 1486168023feSmrg 1487168023feSmrgif test "x$use_asciidoc" = x"auto"; then 1488168023feSmrg AC_PATH_PROG([ASCIIDOC], [asciidoc]) 1489168023feSmrg if test "x$ASCIIDOC" = "x"; then 1490168023feSmrg AC_MSG_WARN([asciidoc not found - documentation targets will be skipped]) 1491168023feSmrg have_asciidoc=no 1492168023feSmrg else 1493168023feSmrg have_asciidoc=yes 1494168023feSmrg fi 1495168023feSmrgelif test "x$use_asciidoc" = x"yes" ; then 1496168023feSmrg AC_PATH_PROG([ASCIIDOC], [asciidoc]) 1497168023feSmrg if test "x$ASCIIDOC" = "x"; then 1498168023feSmrg AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH]) 1499168023feSmrg fi 1500168023feSmrg have_asciidoc=yes 1501168023feSmrgelif test "x$use_asciidoc" = x"no" ; then 1502168023feSmrg if test "x$ASCIIDOC" != "x"; then 1503168023feSmrg AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified]) 1504168023feSmrg fi 1505168023feSmrg have_asciidoc=no 1506168023feSmrgelse 1507168023feSmrg AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no']) 1508168023feSmrgfi 1509168023feSmrgm4_ifval([$1], 1510168023feSmrg[if test "$have_asciidoc" = yes; then 1511168023feSmrg # scrape the asciidoc version 1512168023feSmrg AC_MSG_CHECKING([the asciidoc version]) 1513168023feSmrg asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2` 1514168023feSmrg AC_MSG_RESULT([$asciidoc_version]) 1515168023feSmrg AS_VERSION_COMPARE([$asciidoc_version], [$1], 1516168023feSmrg [if test "x$use_asciidoc" = xauto; then 1517168023feSmrg AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed]) 1518168023feSmrg have_asciidoc=no 1519168023feSmrg else 1520168023feSmrg AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed]) 1521168023feSmrg fi]) 1522168023feSmrgfi]) 1523168023feSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes]) 1524168023feSmrg]) # XORG_WITH_ASCIIDOC 1525168023feSmrg 1526168023feSmrg# XORG_WITH_DOXYGEN([MIN-VERSION]) 1527168023feSmrg# -------------------------------- 1528168023feSmrg# Minimum version: 1.5.0 1529168023feSmrg# 1530168023feSmrg# Documentation tools are not always available on all platforms and sometimes 1531168023feSmrg# not at the appropriate level. This macro enables a module to test for the 1532168023feSmrg# presence of the tool and obtain it's path in separate variables. Coupled with 1533168023feSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions 1534168023feSmrg# as whether or not to use the doxygen package. 1535168023feSmrg# 1536168023feSmrg# Interface to module: 1537168023feSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation 1538168023feSmrg# DOXYGEN: returns the path of the doxygen program found 1539168023feSmrg# returns the path set by the user in the environment 1540168023feSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen 1541168023feSmrg# 'no' user instructs the module not to use doxygen 1542168023feSmrg# 1543168023feSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path. 1544168023feSmrg# 1545168023feSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[ 1546168023feSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command]) 1547168023feSmrgAC_ARG_WITH(doxygen, 1548168023feSmrg AS_HELP_STRING([--with-doxygen], 1549168023feSmrg [Use doxygen to regenerate documentation (default: yes, if installed)]), 1550168023feSmrg [use_doxygen=$withval], [use_doxygen=auto]) 1551168023feSmrg 1552168023feSmrgif test "x$use_doxygen" = x"auto"; then 1553168023feSmrg AC_PATH_PROG([DOXYGEN], [doxygen]) 1554168023feSmrg if test "x$DOXYGEN" = "x"; then 1555168023feSmrg AC_MSG_WARN([doxygen not found - documentation targets will be skipped]) 1556168023feSmrg have_doxygen=no 1557168023feSmrg else 1558168023feSmrg have_doxygen=yes 1559168023feSmrg fi 1560168023feSmrgelif test "x$use_doxygen" = x"yes" ; then 1561168023feSmrg AC_PATH_PROG([DOXYGEN], [doxygen]) 1562168023feSmrg if test "x$DOXYGEN" = "x"; then 1563168023feSmrg AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH]) 1564168023feSmrg fi 1565168023feSmrg have_doxygen=yes 1566168023feSmrgelif test "x$use_doxygen" = x"no" ; then 1567168023feSmrg if test "x$DOXYGEN" != "x"; then 1568168023feSmrg AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified]) 1569168023feSmrg fi 1570168023feSmrg have_doxygen=no 1571168023feSmrgelse 1572168023feSmrg AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no']) 1573168023feSmrgfi 1574168023feSmrgm4_ifval([$1], 1575168023feSmrg[if test "$have_doxygen" = yes; then 1576168023feSmrg # scrape the doxygen version 1577168023feSmrg AC_MSG_CHECKING([the doxygen version]) 1578168023feSmrg doxygen_version=`$DOXYGEN --version 2>/dev/null` 1579168023feSmrg AC_MSG_RESULT([$doxygen_version]) 1580168023feSmrg AS_VERSION_COMPARE([$doxygen_version], [$1], 1581168023feSmrg [if test "x$use_doxygen" = xauto; then 1582168023feSmrg AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed]) 1583168023feSmrg have_doxygen=no 1584168023feSmrg else 1585168023feSmrg AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed]) 1586168023feSmrg fi]) 1587168023feSmrgfi]) 1588168023feSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes]) 1589168023feSmrg]) # XORG_WITH_DOXYGEN 15906ea72052Smrg 1591168023feSmrg# XORG_WITH_GROFF 1592168023feSmrg# ---------------- 1593168023feSmrg# Minimum version: 1.6.0 1594168023feSmrg# 1595168023feSmrg# Documentation tools are not always available on all platforms and sometimes 1596168023feSmrg# not at the appropriate level. This macro enables a module to test for the 1597168023feSmrg# presence of the tool and obtain it's path in separate variables. Coupled with 1598168023feSmrg# the --with-groff option, it allows maximum flexibilty in making decisions 1599168023feSmrg# as whether or not to use the groff package. 1600168023feSmrg# 1601168023feSmrg# Interface to module: 1602168023feSmrg# HAVE_GROFF: used in makefiles to conditionally generate documentation 1603168023feSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package 1604168023feSmrg# HAVE_GROFF_MS: the -ms macros package 1605168023feSmrg# GROFF: returns the path of the groff program found 1606168023feSmrg# returns the path set by the user in the environment 1607168023feSmrg# --with-groff: 'yes' user instructs the module to use groff 1608168023feSmrg# 'no' user instructs the module not to use groff 1609168023feSmrg# 1610168023feSmrg# Added in version 1.9.0: 1611168023feSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format: 1612168023feSmrg# pnmcut pnmcrop pnmtopng pnmtops from the netpbm package. 1613168023feSmrg# psselect from the psutils package. 1614168023feSmrg# the ghostcript package. Refer to the grohtml man pages 1615168023feSmrg# 1616168023feSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path. 1617168023feSmrg# 1618168023feSmrg# OS and distros often splits groff in a basic and full package, the former 1619168023feSmrg# having the groff program and the later having devices, fonts and macros 1620168023feSmrg# Checking for the groff executable is not enough. 1621168023feSmrg# 1622168023feSmrg# If macros are missing, we cannot assume that groff is useless, so we don't 1623168023feSmrg# unset HAVE_GROFF or GROFF env variables. 1624168023feSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false. 1625168023feSmrg# 1626168023feSmrgAC_DEFUN([XORG_WITH_GROFF],[ 1627168023feSmrgAC_ARG_VAR([GROFF], [Path to groff command]) 1628168023feSmrgAC_ARG_WITH(groff, 1629168023feSmrg AS_HELP_STRING([--with-groff], 1630168023feSmrg [Use groff to regenerate documentation (default: yes, if installed)]), 1631168023feSmrg [use_groff=$withval], [use_groff=auto]) 1632168023feSmrg 1633168023feSmrgif test "x$use_groff" = x"auto"; then 1634168023feSmrg AC_PATH_PROG([GROFF], [groff]) 1635168023feSmrg if test "x$GROFF" = "x"; then 1636168023feSmrg AC_MSG_WARN([groff not found - documentation targets will be skipped]) 1637168023feSmrg have_groff=no 1638168023feSmrg else 1639168023feSmrg have_groff=yes 1640168023feSmrg fi 1641168023feSmrgelif test "x$use_groff" = x"yes" ; then 1642168023feSmrg AC_PATH_PROG([GROFF], [groff]) 1643168023feSmrg if test "x$GROFF" = "x"; then 1644168023feSmrg AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH]) 1645168023feSmrg fi 1646168023feSmrg have_groff=yes 1647168023feSmrgelif test "x$use_groff" = x"no" ; then 1648168023feSmrg if test "x$GROFF" != "x"; then 1649168023feSmrg AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified]) 1650168023feSmrg fi 1651168023feSmrg have_groff=no 16526ea72052Smrgelse 1653168023feSmrg AC_MSG_ERROR([--with-groff expects 'yes' or 'no']) 16546ea72052Smrgfi 16556ea72052Smrg 1656168023feSmrg# We have groff, test for the presence of the macro packages 1657168023feSmrgif test "x$have_groff" = x"yes"; then 1658168023feSmrg AC_MSG_CHECKING([for ${GROFF} -ms macros]) 1659168023feSmrg if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then 1660168023feSmrg groff_ms_works=yes 1661168023feSmrg else 1662168023feSmrg groff_ms_works=no 1663168023feSmrg fi 1664168023feSmrg AC_MSG_RESULT([$groff_ms_works]) 1665168023feSmrg AC_MSG_CHECKING([for ${GROFF} -mm macros]) 1666168023feSmrg if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then 1667168023feSmrg groff_mm_works=yes 1668168023feSmrg else 1669168023feSmrg groff_mm_works=no 1670168023feSmrg fi 1671168023feSmrg AC_MSG_RESULT([$groff_mm_works]) 1672168023feSmrgfi 16736ea72052Smrg 1674168023feSmrg# We have groff, test for HTML dependencies, one command per package 1675168023feSmrgif test "x$have_groff" = x"yes"; then 1676168023feSmrg AC_PATH_PROGS(GS_PATH, [gs gswin32c]) 1677168023feSmrg AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng]) 1678168023feSmrg AC_PATH_PROG(PSSELECT_PATH, [psselect]) 1679168023feSmrg if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then 1680168023feSmrg have_groff_html=yes 1681168023feSmrg else 1682168023feSmrg have_groff_html=no 1683168023feSmrg AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages]) 1684168023feSmrg fi 1685168023feSmrgfi 16866ea72052Smrg 1687168023feSmrg# Set Automake conditionals for Makefiles 1688168023feSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes]) 1689168023feSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes]) 1690168023feSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes]) 1691168023feSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes]) 1692168023feSmrg]) # XORG_WITH_GROFF 16936ea72052Smrg 1694168023feSmrg# XORG_WITH_FOP 1695168023feSmrg# ---------------- 1696168023feSmrg# Minimum version: 1.6.0 1697168023feSmrg# 1698168023feSmrg# Documentation tools are not always available on all platforms and sometimes 1699168023feSmrg# not at the appropriate level. This macro enables a module to test for the 1700168023feSmrg# presence of the tool and obtain it's path in separate variables. Coupled with 1701168023feSmrg# the --with-fop option, it allows maximum flexibilty in making decisions 1702168023feSmrg# as whether or not to use the fop package. 1703168023feSmrg# 1704168023feSmrg# Interface to module: 1705168023feSmrg# HAVE_FOP: used in makefiles to conditionally generate documentation 1706168023feSmrg# FOP: returns the path of the fop program found 1707168023feSmrg# returns the path set by the user in the environment 1708168023feSmrg# --with-fop: 'yes' user instructs the module to use fop 1709168023feSmrg# 'no' user instructs the module not to use fop 1710168023feSmrg# 1711168023feSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path. 1712168023feSmrg# 1713168023feSmrgAC_DEFUN([XORG_WITH_FOP],[ 1714168023feSmrgAC_ARG_VAR([FOP], [Path to fop command]) 1715168023feSmrgAC_ARG_WITH(fop, 1716168023feSmrg AS_HELP_STRING([--with-fop], 1717168023feSmrg [Use fop to regenerate documentation (default: yes, if installed)]), 1718168023feSmrg [use_fop=$withval], [use_fop=auto]) 1719168023feSmrg 1720168023feSmrgif test "x$use_fop" = x"auto"; then 1721168023feSmrg AC_PATH_PROG([FOP], [fop]) 1722168023feSmrg if test "x$FOP" = "x"; then 1723168023feSmrg AC_MSG_WARN([fop not found - documentation targets will be skipped]) 1724168023feSmrg have_fop=no 1725168023feSmrg else 1726168023feSmrg have_fop=yes 1727168023feSmrg fi 1728168023feSmrgelif test "x$use_fop" = x"yes" ; then 1729168023feSmrg AC_PATH_PROG([FOP], [fop]) 1730168023feSmrg if test "x$FOP" = "x"; then 1731168023feSmrg AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH]) 1732168023feSmrg fi 1733168023feSmrg have_fop=yes 1734168023feSmrgelif test "x$use_fop" = x"no" ; then 1735168023feSmrg if test "x$FOP" != "x"; then 1736168023feSmrg AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified]) 1737168023feSmrg fi 1738168023feSmrg have_fop=no 17396ea72052Smrgelse 1740168023feSmrg AC_MSG_ERROR([--with-fop expects 'yes' or 'no']) 17416ea72052Smrgfi 1742168023feSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes]) 1743168023feSmrg]) # XORG_WITH_FOP 17446ea72052Smrg 1745168023feSmrg# XORG_WITH_PS2PDF 1746168023feSmrg# ---------------- 1747168023feSmrg# Minimum version: 1.6.0 1748168023feSmrg# 1749168023feSmrg# Documentation tools are not always available on all platforms and sometimes 1750168023feSmrg# not at the appropriate level. This macro enables a module to test for the 1751168023feSmrg# presence of the tool and obtain it's path in separate variables. Coupled with 1752168023feSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions 1753168023feSmrg# as whether or not to use the ps2pdf package. 1754168023feSmrg# 1755168023feSmrg# Interface to module: 1756168023feSmrg# HAVE_PS2PDF: used in makefiles to conditionally generate documentation 1757168023feSmrg# PS2PDF: returns the path of the ps2pdf program found 1758168023feSmrg# returns the path set by the user in the environment 1759168023feSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf 1760168023feSmrg# 'no' user instructs the module not to use ps2pdf 1761168023feSmrg# 1762168023feSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path. 1763168023feSmrg# 1764168023feSmrgAC_DEFUN([XORG_WITH_PS2PDF],[ 1765168023feSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command]) 1766168023feSmrgAC_ARG_WITH(ps2pdf, 1767168023feSmrg AS_HELP_STRING([--with-ps2pdf], 1768168023feSmrg [Use ps2pdf to regenerate documentation (default: yes, if installed)]), 1769168023feSmrg [use_ps2pdf=$withval], [use_ps2pdf=auto]) 1770168023feSmrg 1771168023feSmrgif test "x$use_ps2pdf" = x"auto"; then 1772168023feSmrg AC_PATH_PROG([PS2PDF], [ps2pdf]) 1773168023feSmrg if test "x$PS2PDF" = "x"; then 1774168023feSmrg AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped]) 1775168023feSmrg have_ps2pdf=no 1776168023feSmrg else 1777168023feSmrg have_ps2pdf=yes 1778168023feSmrg fi 1779168023feSmrgelif test "x$use_ps2pdf" = x"yes" ; then 1780168023feSmrg AC_PATH_PROG([PS2PDF], [ps2pdf]) 1781168023feSmrg if test "x$PS2PDF" = "x"; then 1782168023feSmrg AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH]) 1783168023feSmrg fi 1784168023feSmrg have_ps2pdf=yes 1785168023feSmrgelif test "x$use_ps2pdf" = x"no" ; then 1786168023feSmrg if test "x$PS2PDF" != "x"; then 1787168023feSmrg AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified]) 1788168023feSmrg fi 1789168023feSmrg have_ps2pdf=no 1790168023feSmrgelse 1791168023feSmrg AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no']) 1792168023feSmrgfi 1793168023feSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes]) 1794168023feSmrg]) # XORG_WITH_PS2PDF 17956ea72052Smrg 1796168023feSmrg# XORG_ENABLE_DOCS (enable_docs=yes) 1797168023feSmrg# ---------------- 1798168023feSmrg# Minimum version: 1.6.0 1799168023feSmrg# 1800168023feSmrg# Documentation tools are not always available on all platforms and sometimes 1801168023feSmrg# not at the appropriate level. This macro enables a builder to skip all 1802168023feSmrg# documentation targets except traditional man pages. 1803168023feSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 1804168023feSmrg# maximum flexibilty in controlling documentation building. 1805168023feSmrg# Refer to: 1806168023feSmrg# XORG_WITH_XMLTO --with-xmlto 1807168023feSmrg# XORG_WITH_ASCIIDOC --with-asciidoc 1808168023feSmrg# XORG_WITH_DOXYGEN --with-doxygen 1809168023feSmrg# XORG_WITH_FOP --with-fop 1810168023feSmrg# XORG_WITH_GROFF --with-groff 1811168023feSmrg# XORG_WITH_PS2PDF --with-ps2pdf 1812168023feSmrg# 1813168023feSmrg# Interface to module: 1814168023feSmrg# ENABLE_DOCS: used in makefiles to conditionally generate documentation 1815168023feSmrg# --enable-docs: 'yes' user instructs the module to generate docs 1816168023feSmrg# 'no' user instructs the module not to generate docs 1817168023feSmrg# parm1: specify the default value, yes or no. 1818168023feSmrg# 1819168023feSmrgAC_DEFUN([XORG_ENABLE_DOCS],[ 1820168023feSmrgdefault=$1 1821168023feSmrgif test "x$default" = x ; then 1822168023feSmrg default="yes" 1823168023feSmrgfi 1824168023feSmrgAC_ARG_ENABLE(docs, 1825168023feSmrg AS_HELP_STRING([--enable-docs], 1826168023feSmrg [Enable building the documentation (default: yes)]), 1827168023feSmrg [build_docs=$enableval], [build_docs=$default]) 1828168023feSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes]) 1829168023feSmrgAC_MSG_CHECKING([whether to build documentation]) 1830168023feSmrgAC_MSG_RESULT([$build_docs]) 1831168023feSmrg]) # XORG_ENABLE_DOCS 1832168023feSmrg 1833168023feSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes) 1834168023feSmrg# ---------------- 1835168023feSmrg# Minimum version: 1.6.0 1836168023feSmrg# 1837168023feSmrg# This macro enables a builder to skip all developer documentation. 1838168023feSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 1839168023feSmrg# maximum flexibilty in controlling documentation building. 1840168023feSmrg# Refer to: 1841168023feSmrg# XORG_WITH_XMLTO --with-xmlto 1842168023feSmrg# XORG_WITH_ASCIIDOC --with-asciidoc 1843168023feSmrg# XORG_WITH_DOXYGEN --with-doxygen 1844168023feSmrg# XORG_WITH_FOP --with-fop 1845168023feSmrg# XORG_WITH_GROFF --with-groff 1846168023feSmrg# XORG_WITH_PS2PDF --with-ps2pdf 1847168023feSmrg# 1848168023feSmrg# Interface to module: 1849168023feSmrg# ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs 1850168023feSmrg# --enable-devel-docs: 'yes' user instructs the module to generate developer docs 1851168023feSmrg# 'no' user instructs the module not to generate developer docs 1852168023feSmrg# parm1: specify the default value, yes or no. 1853168023feSmrg# 1854168023feSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[ 1855168023feSmrgdevel_default=$1 1856168023feSmrgif test "x$devel_default" = x ; then 1857168023feSmrg devel_default="yes" 1858168023feSmrgfi 1859168023feSmrgAC_ARG_ENABLE(devel-docs, 1860168023feSmrg AS_HELP_STRING([--enable-devel-docs], 1861168023feSmrg [Enable building the developer documentation (default: yes)]), 1862168023feSmrg [build_devel_docs=$enableval], [build_devel_docs=$devel_default]) 1863168023feSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes]) 1864168023feSmrgAC_MSG_CHECKING([whether to build developer documentation]) 1865168023feSmrgAC_MSG_RESULT([$build_devel_docs]) 1866168023feSmrg]) # XORG_ENABLE_DEVEL_DOCS 1867168023feSmrg 1868168023feSmrg# XORG_ENABLE_SPECS (enable_specs=yes) 1869168023feSmrg# ---------------- 1870168023feSmrg# Minimum version: 1.6.0 1871168023feSmrg# 1872168023feSmrg# This macro enables a builder to skip all functional specification targets. 1873168023feSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 1874168023feSmrg# maximum flexibilty in controlling documentation building. 1875168023feSmrg# Refer to: 1876168023feSmrg# XORG_WITH_XMLTO --with-xmlto 1877168023feSmrg# XORG_WITH_ASCIIDOC --with-asciidoc 1878168023feSmrg# XORG_WITH_DOXYGEN --with-doxygen 1879168023feSmrg# XORG_WITH_FOP --with-fop 1880168023feSmrg# XORG_WITH_GROFF --with-groff 1881168023feSmrg# XORG_WITH_PS2PDF --with-ps2pdf 1882168023feSmrg# 1883168023feSmrg# Interface to module: 1884168023feSmrg# ENABLE_SPECS: used in makefiles to conditionally generate specs 1885168023feSmrg# --enable-specs: 'yes' user instructs the module to generate specs 1886168023feSmrg# 'no' user instructs the module not to generate specs 1887168023feSmrg# parm1: specify the default value, yes or no. 1888168023feSmrg# 1889168023feSmrgAC_DEFUN([XORG_ENABLE_SPECS],[ 1890168023feSmrgspec_default=$1 1891168023feSmrgif test "x$spec_default" = x ; then 1892168023feSmrg spec_default="yes" 1893168023feSmrgfi 1894168023feSmrgAC_ARG_ENABLE(specs, 1895168023feSmrg AS_HELP_STRING([--enable-specs], 1896168023feSmrg [Enable building the specs (default: yes)]), 1897168023feSmrg [build_specs=$enableval], [build_specs=$spec_default]) 1898168023feSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes]) 1899168023feSmrgAC_MSG_CHECKING([whether to build functional specifications]) 1900168023feSmrgAC_MSG_RESULT([$build_specs]) 1901168023feSmrg]) # XORG_ENABLE_SPECS 19026ea72052Smrg 19036ea72052Smrg# XORG_CHECK_MALLOC_ZERO 19046ea72052Smrg# ---------------------- 1905168023feSmrg# Minimum version: 1.0.0 1906168023feSmrg# 19076ea72052Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if 19086ea72052Smrg# malloc(0) returns NULL. Packages should add one of these cflags to 19096ea72052Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. 19106ea72052SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[ 19116ea72052SmrgAC_ARG_ENABLE(malloc0returnsnull, 1912168023feSmrg AS_HELP_STRING([--enable-malloc0returnsnull], 19136ea72052Smrg [malloc(0) returns NULL (default: auto)]), 19146ea72052Smrg [MALLOC_ZERO_RETURNS_NULL=$enableval], 19156ea72052Smrg [MALLOC_ZERO_RETURNS_NULL=auto]) 19166ea72052Smrg 19176ea72052SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL]) 19186ea72052Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then 19196ea72052Smrg AC_RUN_IFELSE([ 19206ea72052Smrgchar *malloc(); 19216ea72052Smrgchar *realloc(); 19226ea72052Smrgchar *calloc(); 19236ea72052Smrgmain() { 19246ea72052Smrg char *m0, *r0, *c0, *p; 19256ea72052Smrg m0 = malloc(0); 19266ea72052Smrg p = malloc(10); 19276ea72052Smrg r0 = realloc(p,0); 19286ea72052Smrg c0 = calloc(0); 19296ea72052Smrg exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1); 19306ea72052Smrg}], 19316ea72052Smrg [MALLOC_ZERO_RETURNS_NULL=yes], 1932168023feSmrg [MALLOC_ZERO_RETURNS_NULL=no], 1933168023feSmrg [MALLOC_ZERO_RETURNS_NULL=yes]) 19346ea72052Smrgfi 19356ea72052SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) 19366ea72052Smrg 19376ea72052Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then 19386ea72052Smrg MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" 19396ea72052Smrg XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS 19406ea72052Smrg XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" 19416ea72052Smrgelse 19426ea72052Smrg MALLOC_ZERO_CFLAGS="" 19436ea72052Smrg XMALLOC_ZERO_CFLAGS="" 19446ea72052Smrg XTMALLOC_ZERO_CFLAGS="" 19456ea72052Smrgfi 19466ea72052Smrg 19476ea72052SmrgAC_SUBST([MALLOC_ZERO_CFLAGS]) 19486ea72052SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS]) 19496ea72052SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS]) 19506ea72052Smrg]) # XORG_CHECK_MALLOC_ZERO 19516ea72052Smrg 1952168023feSmrg# XORG_WITH_LINT() 1953168023feSmrg# ---------------- 1954168023feSmrg# Minimum version: 1.1.0 1955168023feSmrg# 1956168023feSmrg# This macro enables the use of a tool that flags some suspicious and 1957168023feSmrg# non-portable constructs (likely to be bugs) in C language source code. 1958168023feSmrg# It will attempt to locate the tool and use appropriate options. 1959168023feSmrg# There are various lint type tools on different platforms. 1960168023feSmrg# 1961168023feSmrg# Interface to module: 1962168023feSmrg# LINT: returns the path to the tool found on the platform 1963168023feSmrg# or the value set to LINT on the configure cmd line 1964168023feSmrg# also an Automake conditional 1965168023feSmrg# LINT_FLAGS: an Automake variable with appropriate flags 1966168023feSmrg# 1967168023feSmrg# --with-lint: 'yes' user instructs the module to use lint 1968168023feSmrg# 'no' user instructs the module not to use lint (default) 1969168023feSmrg# 1970168023feSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path. 1971168023feSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim. 1972168023feSmrg# 1973168023feSmrgAC_DEFUN([XORG_WITH_LINT],[ 1974168023feSmrg 1975168023feSmrgAC_ARG_VAR([LINT], [Path to a lint-style command]) 1976168023feSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command]) 1977168023feSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint], 1978168023feSmrg [Use a lint-style source code checker (default: disabled)])], 1979168023feSmrg [use_lint=$withval], [use_lint=no]) 1980168023feSmrg 1981168023feSmrg# Obtain platform specific info like program name and options 1982168023feSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris 1983168023feSmrgcase $host_os in 1984168023feSmrg *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*) 1985168023feSmrg lint_name=splint 1986168023feSmrg lint_options="-badflag" 1987168023feSmrg ;; 1988168023feSmrg *freebsd* | *netbsd*) 1989168023feSmrg lint_name=lint 1990168023feSmrg lint_options="-u -b" 1991168023feSmrg ;; 1992168023feSmrg *solaris*) 1993168023feSmrg lint_name=lint 1994168023feSmrg lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2" 1995168023feSmrg ;; 1996168023feSmrgesac 1997168023feSmrg 1998168023feSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user) 1999168023feSmrgif test "x$use_lint" = x"yes" ; then 2000168023feSmrg AC_PATH_PROG([LINT], [$lint_name]) 2001168023feSmrg if test "x$LINT" = "x"; then 2002168023feSmrg AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH]) 2003168023feSmrg fi 2004168023feSmrgelif test "x$use_lint" = x"no" ; then 2005168023feSmrg if test "x$LINT" != "x"; then 2006168023feSmrg AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified]) 2007168023feSmrg fi 2008168023feSmrgelse 2009168023feSmrg AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.]) 2010168023feSmrgfi 2011168023feSmrg 2012168023feSmrg# User supplied flags override default flags 2013168023feSmrgif test "x$LINT_FLAGS" != "x"; then 2014168023feSmrg lint_options=$LINT_FLAGS 2015168023feSmrgfi 2016168023feSmrg 2017168023feSmrgAC_SUBST([LINT_FLAGS],[$lint_options]) 2018168023feSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x]) 2019168023feSmrg 2020168023feSmrg]) # XORG_WITH_LINT 2021168023feSmrg 2022168023feSmrg# XORG_LINT_LIBRARY(LIBNAME) 2023168023feSmrg# -------------------------- 2024168023feSmrg# Minimum version: 1.1.0 2025168023feSmrg# 2026168023feSmrg# Sets up flags for building lint libraries for checking programs that call 2027168023feSmrg# functions in the library. 2028168023feSmrg# 2029168023feSmrg# Interface to module: 2030168023feSmrg# LINTLIB - Automake variable with the name of lint library file to make 2031168023feSmrg# MAKE_LINT_LIB - Automake conditional 2032168023feSmrg# 2033168023feSmrg# --enable-lint-library: - 'yes' user instructs the module to created a lint library 2034168023feSmrg# - 'no' user instructs the module not to create a lint library (default) 2035168023feSmrg 2036168023feSmrgAC_DEFUN([XORG_LINT_LIBRARY],[ 2037168023feSmrgAC_REQUIRE([XORG_WITH_LINT]) 2038168023feSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library], 2039168023feSmrg [Create lint library (default: disabled)])], 2040168023feSmrg [make_lint_lib=$enableval], [make_lint_lib=no]) 2041168023feSmrg 2042168023feSmrgif test "x$make_lint_lib" = x"yes" ; then 2043168023feSmrg LINTLIB=llib-l$1.ln 2044168023feSmrg if test "x$LINT" = "x"; then 2045168023feSmrg AC_MSG_ERROR([Cannot make lint library without --with-lint]) 2046168023feSmrg fi 2047168023feSmrgelif test "x$make_lint_lib" != x"no" ; then 2048168023feSmrg AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.]) 2049168023feSmrgfi 2050168023feSmrg 2051168023feSmrgAC_SUBST(LINTLIB) 2052168023feSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno]) 2053168023feSmrg 2054168023feSmrg]) # XORG_LINT_LIBRARY 2055168023feSmrg 2056168023feSmrg# XORG_CWARNFLAGS 2057168023feSmrg# --------------- 2058168023feSmrg# Minimum version: 1.2.0 2059168023feSmrg# 2060168023feSmrg# Defines CWARNFLAGS to enable C compiler warnings. 2061168023feSmrg# 2062168023feSmrgAC_DEFUN([XORG_CWARNFLAGS], [ 2063168023feSmrgAC_REQUIRE([AC_PROG_CC_C99]) 2064168023feSmrgif test "x$GCC" = xyes ; then 2065168023feSmrg CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \ 2066168023feSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \ 2067168023feSmrg-Wbad-function-cast -Wformat=2" 2068168023feSmrg case `$CC -dumpversion` in 2069168023feSmrg 3.4.* | 4.*) 2070168023feSmrg CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement" 2071168023feSmrg ;; 2072168023feSmrg esac 2073168023feSmrgelse 2074168023feSmrg AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) 2075168023feSmrg if test "x$SUNCC" = "xyes"; then 2076168023feSmrg CWARNFLAGS="-v" 2077168023feSmrg fi 2078168023feSmrgfi 2079168023feSmrgAC_SUBST(CWARNFLAGS) 2080168023feSmrg]) # XORG_CWARNFLAGS 2081168023feSmrg 2082168023feSmrg# XORG_STRICT_OPTION 2083168023feSmrg# ----------------------- 2084168023feSmrg# Minimum version: 1.3.0 2085168023feSmrg# 2086168023feSmrg# Add configure option to enable strict compilation 2087168023feSmrgAC_DEFUN([XORG_STRICT_OPTION], [ 2088168023feSmrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89 2089168023feSmrgAC_REQUIRE([AC_PROG_CC_C99]) 2090168023feSmrgAC_REQUIRE([XORG_CWARNFLAGS]) 2091168023feSmrg 2092168023feSmrgAC_ARG_ENABLE(strict-compilation, 2093168023feSmrg AS_HELP_STRING([--enable-strict-compilation], 2094168023feSmrg [Enable all warnings from compiler and make them errors (default: disabled)]), 2095168023feSmrg [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no]) 2096168023feSmrgif test "x$STRICT_COMPILE" = "xyes"; then 2097168023feSmrg AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) 2098168023feSmrg AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"]) 2099168023feSmrg if test "x$GCC" = xyes ; then 2100168023feSmrg STRICT_CFLAGS="-pedantic -Werror" 2101168023feSmrg elif test "x$SUNCC" = "xyes"; then 2102168023feSmrg STRICT_CFLAGS="-errwarn" 2103168023feSmrg elif test "x$INTELCC" = "xyes"; then 2104168023feSmrg STRICT_CFLAGS="-Werror" 2105168023feSmrg fi 2106168023feSmrgfi 2107168023feSmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS" 2108168023feSmrgAC_SUBST([CWARNFLAGS]) 2109168023feSmrg]) # XORG_STRICT_OPTION 2110168023feSmrg 2111168023feSmrg# XORG_DEFAULT_OPTIONS 2112168023feSmrg# -------------------- 2113168023feSmrg# Minimum version: 1.3.0 2114168023feSmrg# 2115168023feSmrg# Defines default options for X.Org modules. 2116168023feSmrg# 2117168023feSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [ 2118168023feSmrgAC_REQUIRE([AC_PROG_INSTALL]) 2119168023feSmrgXORG_CWARNFLAGS 2120168023feSmrgXORG_STRICT_OPTION 2121168023feSmrgXORG_RELEASE_VERSION 2122168023feSmrgXORG_CHANGELOG 2123168023feSmrgXORG_INSTALL 2124168023feSmrgXORG_MANPAGE_SECTIONS 2125168023feSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], 2126168023feSmrg [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) 2127168023feSmrg]) # XORG_DEFAULT_OPTIONS 2128168023feSmrg 2129168023feSmrg# XORG_INSTALL() 2130168023feSmrg# ---------------- 2131168023feSmrg# Minimum version: 1.4.0 2132168023feSmrg# 2133168023feSmrg# Defines the variable INSTALL_CMD as the command to copy 2134168023feSmrg# INSTALL from $prefix/share/util-macros. 2135168023feSmrg# 2136168023feSmrgAC_DEFUN([XORG_INSTALL], [ 2137168023feSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG]) 2138168023feSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` 2139168023feSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ 2140168023feSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ 2141168023feSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \ 2142168023feSmrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)" 2143168023feSmrgAC_SUBST([INSTALL_CMD]) 2144168023feSmrg]) # XORG_INSTALL 21456ea72052Smrgdnl Copyright 2005 Red Hat, Inc 21466ea72052Smrgdnl 21476ea72052Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its 21486ea72052Smrgdnl documentation for any purpose is hereby granted without fee, provided that 21496ea72052Smrgdnl the above copyright notice appear in all copies and that both that 21506ea72052Smrgdnl copyright notice and this permission notice appear in supporting 21516ea72052Smrgdnl documentation. 21526ea72052Smrgdnl 21536ea72052Smrgdnl The above copyright notice and this permission notice shall be included 21546ea72052Smrgdnl in all copies or substantial portions of the Software. 21556ea72052Smrgdnl 21566ea72052Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 21576ea72052Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21586ea72052Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21596ea72052Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 21606ea72052Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21616ea72052Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 21626ea72052Smrgdnl OTHER DEALINGS IN THE SOFTWARE. 21636ea72052Smrgdnl 21646ea72052Smrgdnl Except as contained in this notice, the name of the copyright holders shall 21656ea72052Smrgdnl not be used in advertising or otherwise to promote the sale, use or 21666ea72052Smrgdnl other dealings in this Software without prior written authorization 21676ea72052Smrgdnl from the copyright holders. 21686ea72052Smrgdnl 21696ea72052Smrg 21706ea72052Smrg# XORG_RELEASE_VERSION 21716ea72052Smrg# -------------------- 2172168023feSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use. 21736ea72052Smrg 21746ea72052SmrgAC_DEFUN([XORG_RELEASE_VERSION],[ 2175168023feSmrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR], 2176168023feSmrg [`echo $PACKAGE_VERSION | cut -d . -f 1`], 2177168023feSmrg [Major version of this package]) 2178168023feSmrg PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` 2179168023feSmrg if test "x$PVM" = "x"; then 2180168023feSmrg PVM="0" 21816ea72052Smrg fi 2182168023feSmrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR], 2183168023feSmrg [$PVM], 2184168023feSmrg [Minor version of this package]) 2185168023feSmrg PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` 2186168023feSmrg if test "x$PVP" = "x"; then 2187168023feSmrg PVP="0" 2188168023feSmrg fi 2189168023feSmrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL], 2190168023feSmrg [$PVP], 2191168023feSmrg [Patch version of this package]) 21926ea72052Smrg]) 21936ea72052Smrg 2194168023feSmrg# XORG_CHANGELOG() 2195168023feSmrg# ---------------- 2196168023feSmrg# Minimum version: 1.2.0 2197168023feSmrg# 2198168023feSmrg# Defines the variable CHANGELOG_CMD as the command to generate 2199168023feSmrg# ChangeLog from git. 2200168023feSmrg# 2201168023feSmrg# 2202168023feSmrgAC_DEFUN([XORG_CHANGELOG], [ 2203168023feSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \ 2204168023feSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ 2205168023feSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \ 2206168023feSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)" 2207168023feSmrgAC_SUBST([CHANGELOG_CMD]) 2208168023feSmrg]) # XORG_CHANGELOG 2209168023feSmrg 2210168023feSmrg# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- 2211168023feSmrg# 2212168023feSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>. 2213168023feSmrg# 2214168023feSmrg# This program is free software; you can redistribute it and/or modify 2215168023feSmrg# it under the terms of the GNU General Public License as published by 2216168023feSmrg# the Free Software Foundation; either version 2 of the License, or 2217168023feSmrg# (at your option) any later version. 2218168023feSmrg# 2219168023feSmrg# This program is distributed in the hope that it will be useful, but 2220168023feSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of 2221168023feSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 2222168023feSmrg# General Public License for more details. 2223168023feSmrg# 2224168023feSmrg# You should have received a copy of the GNU General Public License 2225168023feSmrg# along with this program; if not, write to the Free Software 2226168023feSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 2227168023feSmrg# 2228168023feSmrg# As a special exception to the GNU General Public License, if you 2229168023feSmrg# distribute this file as part of a program that contains a 2230168023feSmrg# configuration script generated by Autoconf, you may include it under 2231168023feSmrg# the same distribution terms that you use for the rest of that program. 2232168023feSmrg 2233168023feSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION]) 2234168023feSmrg# ---------------------------------- 2235168023feSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG], 2236168023feSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) 2237168023feSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$]) 2238168023feSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl 2239168023feSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then 2240168023feSmrg AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) 2241168023feSmrgfi 2242168023feSmrgif test -n "$PKG_CONFIG"; then 2243168023feSmrg _pkg_min_version=m4_default([$1], [0.9.0]) 2244168023feSmrg AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) 2245168023feSmrg if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then 2246168023feSmrg AC_MSG_RESULT([yes]) 2247168023feSmrg else 2248168023feSmrg AC_MSG_RESULT([no]) 2249168023feSmrg PKG_CONFIG="" 2250168023feSmrg fi 2251168023feSmrg 2252168023feSmrgfi[]dnl 2253168023feSmrg])# PKG_PROG_PKG_CONFIG 2254168023feSmrg 2255168023feSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 2256168023feSmrg# 2257168023feSmrg# Check to see whether a particular set of modules exists. Similar 2258168023feSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors. 2259168023feSmrg# 2260168023feSmrg# 2261168023feSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of 2262168023feSmrg# this or PKG_CHECK_MODULES is called, or make sure to call 2263168023feSmrg# PKG_CHECK_EXISTS manually 2264168023feSmrg# -------------------------------------------------------------- 2265168023feSmrgAC_DEFUN([PKG_CHECK_EXISTS], 2266168023feSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 2267168023feSmrgif test -n "$PKG_CONFIG" && \ 2268168023feSmrg AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then 2269168023feSmrg m4_ifval([$2], [$2], [:]) 2270168023feSmrgm4_ifvaln([$3], [else 2271168023feSmrg $3])dnl 2272168023feSmrgfi]) 2273168023feSmrg 2274168023feSmrg 2275168023feSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) 2276168023feSmrg# --------------------------------------------- 2277168023feSmrgm4_define([_PKG_CONFIG], 2278168023feSmrg[if test -n "$$1"; then 2279168023feSmrg pkg_cv_[]$1="$$1" 2280168023feSmrg elif test -n "$PKG_CONFIG"; then 2281168023feSmrg PKG_CHECK_EXISTS([$3], 2282168023feSmrg [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], 2283168023feSmrg [pkg_failed=yes]) 2284168023feSmrg else 2285168023feSmrg pkg_failed=untried 2286168023feSmrgfi[]dnl 2287168023feSmrg])# _PKG_CONFIG 2288168023feSmrg 2289168023feSmrg# _PKG_SHORT_ERRORS_SUPPORTED 2290168023feSmrg# ----------------------------- 2291168023feSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], 2292168023feSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 2293168023feSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then 2294168023feSmrg _pkg_short_errors_supported=yes 2295168023feSmrgelse 2296168023feSmrg _pkg_short_errors_supported=no 2297168023feSmrgfi[]dnl 2298168023feSmrg])# _PKG_SHORT_ERRORS_SUPPORTED 2299168023feSmrg 2300168023feSmrg 2301168023feSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], 2302168023feSmrg# [ACTION-IF-NOT-FOUND]) 2303168023feSmrg# 2304168023feSmrg# 2305168023feSmrg# Note that if there is a possibility the first call to 2306168023feSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an 2307168023feSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac 2308168023feSmrg# 2309168023feSmrg# 2310168023feSmrg# -------------------------------------------------------------- 2311168023feSmrgAC_DEFUN([PKG_CHECK_MODULES], 2312168023feSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 2313168023feSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl 2314168023feSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl 2315168023feSmrg 2316168023feSmrgpkg_failed=no 2317168023feSmrgAC_MSG_CHECKING([for $1]) 2318168023feSmrg 2319168023feSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) 2320168023feSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2]) 2321168023feSmrg 2322168023feSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS 2323168023feSmrgand $1[]_LIBS to avoid the need to call pkg-config. 2324168023feSmrgSee the pkg-config man page for more details.]) 2325168023feSmrg 2326168023feSmrgif test $pkg_failed = yes; then 2327168023feSmrg _PKG_SHORT_ERRORS_SUPPORTED 2328168023feSmrg if test $_pkg_short_errors_supported = yes; then 2329168023feSmrg $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` 2330168023feSmrg else 2331168023feSmrg $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` 2332168023feSmrg fi 2333168023feSmrg # Put the nasty error message in config.log where it belongs 2334168023feSmrg echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD 2335168023feSmrg 2336168023feSmrg ifelse([$4], , [AC_MSG_ERROR(dnl 2337168023feSmrg[Package requirements ($2) were not met: 2338168023feSmrg 2339168023feSmrg$$1_PKG_ERRORS 2340168023feSmrg 2341168023feSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you 2342168023feSmrginstalled software in a non-standard prefix. 2343168023feSmrg 2344168023feSmrg_PKG_TEXT 2345168023feSmrg])], 2346168023feSmrg [AC_MSG_RESULT([no]) 2347168023feSmrg $4]) 2348168023feSmrgelif test $pkg_failed = untried; then 2349168023feSmrg ifelse([$4], , [AC_MSG_FAILURE(dnl 2350168023feSmrg[The pkg-config script could not be found or is too old. Make sure it 2351168023feSmrgis in your PATH or set the PKG_CONFIG environment variable to the full 2352168023feSmrgpath to pkg-config. 2353168023feSmrg 2354168023feSmrg_PKG_TEXT 2355168023feSmrg 2356168023feSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])], 2357168023feSmrg [$4]) 2358168023feSmrgelse 2359168023feSmrg $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS 2360168023feSmrg $1[]_LIBS=$pkg_cv_[]$1[]_LIBS 2361168023feSmrg AC_MSG_RESULT([yes]) 2362168023feSmrg ifelse([$3], , :, [$3]) 2363168023feSmrgfi[]dnl 2364168023feSmrg])# PKG_CHECK_MODULES 2365168023feSmrg 2366