aclocal.m4 revision 8ff16396
18ff16396Smrg# generated automatically by aclocal 1.11 -*- Autoconf -*-
20bd0e222Smrg
38ff16396Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
48ff16396Smrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
50bd0e222Smrg# This file is free software; the Free Software Foundation
60bd0e222Smrg# gives unlimited permission to copy and/or distribute it,
70bd0e222Smrg# with or without modifications, as long as this notice is preserved.
80bd0e222Smrg
90bd0e222Smrg# This program is distributed in the hope that it will be useful,
100bd0e222Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
110bd0e222Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
120bd0e222Smrg# PARTICULAR PURPOSE.
130bd0e222Smrg
148ff16396Smrgm4_ifndef([AC_AUTOCONF_VERSION],
158ff16396Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
168ff16396Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
178ff16396Smrg[m4_warning([this file was generated for autoconf 2.63.
188ff16396SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
198ff16396SmrgIf you have problems, you may need to regenerate the build system entirely.
208ff16396SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
210bd0e222Smrg
228ff16396Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
238ff16396Smrg#
248ff16396Smrg# This file is free software; the Free Software Foundation
258ff16396Smrg# gives unlimited permission to copy and/or distribute it,
268ff16396Smrg# with or without modifications, as long as this notice is preserved.
270bd0e222Smrg
280bd0e222Smrg# AM_AUTOMAKE_VERSION(VERSION)
290bd0e222Smrg# ----------------------------
300bd0e222Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
310bd0e222Smrg# generated from the m4 files accompanying Automake X.Y.
328ff16396Smrg# (This private macro should not be called outside this file.)
338ff16396SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
348ff16396Smrg[am__api_version='1.11'
358ff16396Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
368ff16396Smrgdnl require some minimum version.  Point them to the right macro.
378ff16396Smrgm4_if([$1], [1.11], [],
388ff16396Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
398ff16396Smrg])
408ff16396Smrg
418ff16396Smrg# _AM_AUTOCONF_VERSION(VERSION)
428ff16396Smrg# -----------------------------
438ff16396Smrg# aclocal traces this macro to find the Autoconf version.
448ff16396Smrg# This is a private macro too.  Using m4_define simplifies
458ff16396Smrg# the logic in aclocal, which can simply ignore this definition.
468ff16396Smrgm4_define([_AM_AUTOCONF_VERSION], [])
470bd0e222Smrg
480bd0e222Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
490bd0e222Smrg# -------------------------------
508ff16396Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
518ff16396Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
520bd0e222SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
538ff16396Smrg[AM_AUTOMAKE_VERSION([1.11])dnl
548ff16396Smrgm4_ifndef([AC_AUTOCONF_VERSION],
558ff16396Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
568ff16396Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
570bd0e222Smrg
588ff16396Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
590bd0e222Smrg
608ff16396Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
610bd0e222Smrg#
628ff16396Smrg# This file is free software; the Free Software Foundation
638ff16396Smrg# gives unlimited permission to copy and/or distribute it,
648ff16396Smrg# with or without modifications, as long as this notice is preserved.
650bd0e222Smrg
660bd0e222Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
670bd0e222Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
680bd0e222Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
690bd0e222Smrg#
700bd0e222Smrg# Of course, Automake must honor this variable whenever it calls a
710bd0e222Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
720bd0e222Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
730bd0e222Smrg# depending on how configure is run.  This is pretty annoying, since
740bd0e222Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
750bd0e222Smrg# source directory, any form will work fine, but in subdirectories a
760bd0e222Smrg# relative path needs to be adjusted first.
770bd0e222Smrg#
780bd0e222Smrg# $ac_aux_dir/missing
790bd0e222Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
800bd0e222Smrg# $top_srcdir/$ac_aux_dir/missing
810bd0e222Smrg#    fails if $ac_aux_dir is absolute,
820bd0e222Smrg#    fails when called from a subdirectory in a VPATH build with
830bd0e222Smrg#          a relative $ac_aux_dir
840bd0e222Smrg#
850bd0e222Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
860bd0e222Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
870bd0e222Smrg# harmless because $srcdir is `.', but things will broke when you
880bd0e222Smrg# start a VPATH build or use an absolute $srcdir.
890bd0e222Smrg#
900bd0e222Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
910bd0e222Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
920bd0e222Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
930bd0e222Smrg# and then we would define $MISSING as
940bd0e222Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
950bd0e222Smrg# This will work as long as MISSING is not called from configure, because
960bd0e222Smrg# unfortunately $(top_srcdir) has no meaning in configure.
970bd0e222Smrg# However there are other variables, like CC, which are often used in
980bd0e222Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
990bd0e222Smrg#
1000bd0e222Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
1010bd0e222Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
1020bd0e222Smrg# configured tree to be moved without reconfiguration.
1030bd0e222Smrg
1048ff16396SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
1058ff16396Smrg[dnl Rely on autoconf to set up CDPATH properly.
1068ff16396SmrgAC_PREREQ([2.50])dnl
1070bd0e222Smrg# expand $ac_aux_dir to an absolute path
1080bd0e222Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
1090bd0e222Smrg])
1100bd0e222Smrg
1118ff16396Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
1120bd0e222Smrg
1138ff16396Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
1148ff16396Smrg# Free Software Foundation, Inc.
1158ff16396Smrg#
1168ff16396Smrg# This file is free software; the Free Software Foundation
1178ff16396Smrg# gives unlimited permission to copy and/or distribute it,
1188ff16396Smrg# with or without modifications, as long as this notice is preserved.
1190bd0e222Smrg
1208ff16396Smrg# serial 9
1210bd0e222Smrg
1228ff16396Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
1238ff16396Smrg# -------------------------------------
1248ff16396Smrg# Define a conditional.
1258ff16396SmrgAC_DEFUN([AM_CONDITIONAL],
1268ff16396Smrg[AC_PREREQ(2.52)dnl
1278ff16396Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1288ff16396Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1298ff16396SmrgAC_SUBST([$1_TRUE])dnl
1308ff16396SmrgAC_SUBST([$1_FALSE])dnl
1318ff16396Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
1328ff16396Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
1338ff16396Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
1348ff16396Smrgif $2; then
1358ff16396Smrg  $1_TRUE=
1368ff16396Smrg  $1_FALSE='#'
1370bd0e222Smrgelse
1388ff16396Smrg  $1_TRUE='#'
1398ff16396Smrg  $1_FALSE=
1400bd0e222Smrgfi
1418ff16396SmrgAC_CONFIG_COMMANDS_PRE(
1428ff16396Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1438ff16396Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
1448ff16396SmrgUsually this means the macro was only invoked conditionally.]])
1458ff16396Smrgfi])])
1460bd0e222Smrg
1478ff16396Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
1488ff16396Smrg# Free Software Foundation, Inc.
1498ff16396Smrg#
1508ff16396Smrg# This file is free software; the Free Software Foundation
1518ff16396Smrg# gives unlimited permission to copy and/or distribute it,
1528ff16396Smrg# with or without modifications, as long as this notice is preserved.
1530bd0e222Smrg
1548ff16396Smrg# serial 10
1550bd0e222Smrg
1560bd0e222Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1570bd0e222Smrg# written in clear, in which case automake, when reading aclocal.m4,
1580bd0e222Smrg# will think it sees a *use*, and therefore will trigger all it's
1590bd0e222Smrg# C support machinery.  Also note that it means that autoscan, seeing
1600bd0e222Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1610bd0e222Smrg
1620bd0e222Smrg
1630bd0e222Smrg# _AM_DEPENDENCIES(NAME)
1640bd0e222Smrg# ----------------------
1650bd0e222Smrg# See how the compiler implements dependency checking.
1660bd0e222Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
1670bd0e222Smrg# We try a few techniques and use that to set a single cache variable.
1680bd0e222Smrg#
1690bd0e222Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1700bd0e222Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1710bd0e222Smrg# dependency, and given that the user is not expected to run this macro,
1720bd0e222Smrg# just rely on AC_PROG_CC.
1730bd0e222SmrgAC_DEFUN([_AM_DEPENDENCIES],
1740bd0e222Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
1750bd0e222SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1760bd0e222SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
1770bd0e222SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1780bd0e222Smrg
1790bd0e222Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
1800bd0e222Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
1810bd0e222Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1828ff16396Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
1830bd0e222Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1840bd0e222Smrg                   [depcc="$$1"   am_compiler_list=])
1850bd0e222Smrg
1860bd0e222SmrgAC_CACHE_CHECK([dependency style of $depcc],
1870bd0e222Smrg               [am_cv_$1_dependencies_compiler_type],
1880bd0e222Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1890bd0e222Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
1900bd0e222Smrg  # making bogus files that we don't know about and never remove.  For
1910bd0e222Smrg  # instance it was reported that on HP-UX the gcc test will end up
1920bd0e222Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
1930bd0e222Smrg  # in D'.
1940bd0e222Smrg  mkdir conftest.dir
1950bd0e222Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
1960bd0e222Smrg  # using a relative directory.
1970bd0e222Smrg  cp "$am_depcomp" conftest.dir
1980bd0e222Smrg  cd conftest.dir
1990bd0e222Smrg  # We will build objects and dependencies in a subdirectory because
2000bd0e222Smrg  # it helps to detect inapplicable dependency modes.  For instance
2010bd0e222Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
2020bd0e222Smrg  # side effect of compilation, but ICC will put the dependencies in
2030bd0e222Smrg  # the current directory while Tru64 will put them in the object
2040bd0e222Smrg  # directory.
2050bd0e222Smrg  mkdir sub
2060bd0e222Smrg
2070bd0e222Smrg  am_cv_$1_dependencies_compiler_type=none
2080bd0e222Smrg  if test "$am_compiler_list" = ""; then
2090bd0e222Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2100bd0e222Smrg  fi
2118ff16396Smrg  am__universal=false
2128ff16396Smrg  m4_case([$1], [CC],
2138ff16396Smrg    [case " $depcc " in #(
2148ff16396Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2158ff16396Smrg     esac],
2168ff16396Smrg    [CXX],
2178ff16396Smrg    [case " $depcc " in #(
2188ff16396Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2198ff16396Smrg     esac])
2208ff16396Smrg
2210bd0e222Smrg  for depmode in $am_compiler_list; do
2220bd0e222Smrg    # Setup a source with many dependencies, because some compilers
2230bd0e222Smrg    # like to wrap large dependency lists on column 80 (with \), and
2240bd0e222Smrg    # we should not choose a depcomp mode which is confused by this.
2250bd0e222Smrg    #
2260bd0e222Smrg    # We need to recreate these files for each test, as the compiler may
2270bd0e222Smrg    # overwrite some of them when testing with obscure command lines.
2280bd0e222Smrg    # This happens at least with the AIX C compiler.
2290bd0e222Smrg    : > sub/conftest.c
2300bd0e222Smrg    for i in 1 2 3 4 5 6; do
2310bd0e222Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
2328ff16396Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
2338ff16396Smrg      # Solaris 8's {/usr,}/bin/sh.
2348ff16396Smrg      touch sub/conftst$i.h
2350bd0e222Smrg    done
2360bd0e222Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2370bd0e222Smrg
2388ff16396Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
2398ff16396Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
2408ff16396Smrg    # handle `-M -o', and we need to detect this.  Also, some Intel
2418ff16396Smrg    # versions had trouble with output in subdirs
2428ff16396Smrg    am__obj=sub/conftest.${OBJEXT-o}
2438ff16396Smrg    am__minus_obj="-o $am__obj"
2440bd0e222Smrg    case $depmode in
2458ff16396Smrg    gcc)
2468ff16396Smrg      # This depmode causes a compiler race in universal mode.
2478ff16396Smrg      test "$am__universal" = false || continue
2488ff16396Smrg      ;;
2490bd0e222Smrg    nosideeffect)
2500bd0e222Smrg      # after this tag, mechanisms are not by side-effect, so they'll
2510bd0e222Smrg      # only be used when explicitly requested
2520bd0e222Smrg      if test "x$enable_dependency_tracking" = xyes; then
2530bd0e222Smrg	continue
2540bd0e222Smrg      else
2550bd0e222Smrg	break
2560bd0e222Smrg      fi
2570bd0e222Smrg      ;;
2588ff16396Smrg    msvisualcpp | msvcmsys)
2598ff16396Smrg      # This compiler won't grok `-c -o', but also, the minuso test has
2608ff16396Smrg      # not run yet.  These depmodes are late enough in the game, and
2618ff16396Smrg      # so weak that their functioning should not be impacted.
2628ff16396Smrg      am__obj=conftest.${OBJEXT-o}
2638ff16396Smrg      am__minus_obj=
2648ff16396Smrg      ;;
2650bd0e222Smrg    none) break ;;
2660bd0e222Smrg    esac
2670bd0e222Smrg    if depmode=$depmode \
2688ff16396Smrg       source=sub/conftest.c object=$am__obj \
2690bd0e222Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
2708ff16396Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
2710bd0e222Smrg         >/dev/null 2>conftest.err &&
2728ff16396Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
2730bd0e222Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
2748ff16396Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
2750bd0e222Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
2760bd0e222Smrg      # icc doesn't choke on unknown options, it will just issue warnings
2778ff16396Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
2788ff16396Smrg      # that says an option was ignored or not supported.
2798ff16396Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
2808ff16396Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
2818ff16396Smrg      # The diagnosis changed in icc 8.0:
2828ff16396Smrg      #   icc: Command line remark: option '-MP' not supported
2838ff16396Smrg      if (grep 'ignoring option' conftest.err ||
2848ff16396Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
2850bd0e222Smrg        am_cv_$1_dependencies_compiler_type=$depmode
2860bd0e222Smrg        break
2870bd0e222Smrg      fi
2880bd0e222Smrg    fi
2890bd0e222Smrg  done
2900bd0e222Smrg
2910bd0e222Smrg  cd ..
2920bd0e222Smrg  rm -rf conftest.dir
2930bd0e222Smrgelse
2940bd0e222Smrg  am_cv_$1_dependencies_compiler_type=none
2950bd0e222Smrgfi
2960bd0e222Smrg])
2978ff16396SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
2988ff16396SmrgAM_CONDITIONAL([am__fastdep$1], [
2998ff16396Smrg  test "x$enable_dependency_tracking" != xno \
3008ff16396Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
3018ff16396Smrg])
3028ff16396Smrg
3038ff16396Smrg
3048ff16396Smrg# AM_SET_DEPDIR
3058ff16396Smrg# -------------
3068ff16396Smrg# Choose a directory name for dependency files.
3078ff16396Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
3088ff16396SmrgAC_DEFUN([AM_SET_DEPDIR],
3098ff16396Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
3108ff16396SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
3118ff16396Smrg])
3128ff16396Smrg
3138ff16396Smrg
3148ff16396Smrg# AM_DEP_TRACK
3158ff16396Smrg# ------------
3168ff16396SmrgAC_DEFUN([AM_DEP_TRACK],
3178ff16396Smrg[AC_ARG_ENABLE(dependency-tracking,
3188ff16396Smrg[  --disable-dependency-tracking  speeds up one-time build
3198ff16396Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
3208ff16396Smrgif test "x$enable_dependency_tracking" != xno; then
3218ff16396Smrg  am_depcomp="$ac_aux_dir/depcomp"
3228ff16396Smrg  AMDEPBACKSLASH='\'
3238ff16396Smrgfi
3248ff16396SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
3258ff16396SmrgAC_SUBST([AMDEPBACKSLASH])dnl
3268ff16396Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
3278ff16396Smrg])
3288ff16396Smrg
3298ff16396Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
3308ff16396Smrg
3318ff16396Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
3328ff16396Smrg# Free Software Foundation, Inc.
3338ff16396Smrg#
3348ff16396Smrg# This file is free software; the Free Software Foundation
3358ff16396Smrg# gives unlimited permission to copy and/or distribute it,
3368ff16396Smrg# with or without modifications, as long as this notice is preserved.
3378ff16396Smrg
3388ff16396Smrg#serial 5
3398ff16396Smrg
3408ff16396Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
3418ff16396Smrg# ------------------------------
3428ff16396SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
3438ff16396Smrg[{
3448ff16396Smrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
3458ff16396Smrg  # are listed without --file.  Let's play safe and only enable the eval
3468ff16396Smrg  # if we detect the quoting.
3478ff16396Smrg  case $CONFIG_FILES in
3488ff16396Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
3498ff16396Smrg  *)   set x $CONFIG_FILES ;;
3508ff16396Smrg  esac
3518ff16396Smrg  shift
3528ff16396Smrg  for mf
3538ff16396Smrg  do
3548ff16396Smrg    # Strip MF so we end up with the name of the file.
3558ff16396Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
3568ff16396Smrg    # Check whether this is an Automake generated Makefile or not.
3578ff16396Smrg    # We used to match only the files named `Makefile.in', but
3588ff16396Smrg    # some people rename them; so instead we look at the file content.
3598ff16396Smrg    # Grep'ing the first line is not enough: some people post-process
3608ff16396Smrg    # each Makefile.in and add a new line on top of each file to say so.
3618ff16396Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
3628ff16396Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
3638ff16396Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
3648ff16396Smrg      dirpart=`AS_DIRNAME("$mf")`
3658ff16396Smrg    else
3668ff16396Smrg      continue
3678ff16396Smrg    fi
3688ff16396Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
3698ff16396Smrg    # from the Makefile without running `make'.
3708ff16396Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
3718ff16396Smrg    test -z "$DEPDIR" && continue
3728ff16396Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
3738ff16396Smrg    test -z "am__include" && continue
3748ff16396Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
3758ff16396Smrg    # When using ansi2knr, U may be empty or an underscore; expand it
3768ff16396Smrg    U=`sed -n 's/^U = //p' < "$mf"`
3778ff16396Smrg    # Find all dependency output files, they are included files with
3788ff16396Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
3798ff16396Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
3808ff16396Smrg    # expansion.
3818ff16396Smrg    for file in `sed -n "
3828ff16396Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
3838ff16396Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
3848ff16396Smrg      # Make sure the directory exists.
3858ff16396Smrg      test -f "$dirpart/$file" && continue
3868ff16396Smrg      fdir=`AS_DIRNAME(["$file"])`
3878ff16396Smrg      AS_MKDIR_P([$dirpart/$fdir])
3888ff16396Smrg      # echo "creating $dirpart/$file"
3898ff16396Smrg      echo '# dummy' > "$dirpart/$file"
3908ff16396Smrg    done
3918ff16396Smrg  done
3928ff16396Smrg}
3938ff16396Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
3948ff16396Smrg
3958ff16396Smrg
3968ff16396Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
3978ff16396Smrg# -----------------------------
3988ff16396Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
3998ff16396Smrg#
4008ff16396Smrg# This code is only required when automatic dependency tracking
4018ff16396Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
4028ff16396Smrg# need in order to bootstrap the dependency handling code.
4038ff16396SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
4048ff16396Smrg[AC_CONFIG_COMMANDS([depfiles],
4058ff16396Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
4068ff16396Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
4078ff16396Smrg])
4088ff16396Smrg
4098ff16396Smrg# Do all the work for Automake.                             -*- Autoconf -*-
4108ff16396Smrg
4118ff16396Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4128ff16396Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
4138ff16396Smrg#
4148ff16396Smrg# This file is free software; the Free Software Foundation
4158ff16396Smrg# gives unlimited permission to copy and/or distribute it,
4168ff16396Smrg# with or without modifications, as long as this notice is preserved.
4178ff16396Smrg
4188ff16396Smrg# serial 16
4198ff16396Smrg
4208ff16396Smrg# This macro actually does too much.  Some checks are only needed if
4218ff16396Smrg# your package does certain things.  But this isn't really a big deal.
4228ff16396Smrg
4238ff16396Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
4248ff16396Smrg# AM_INIT_AUTOMAKE([OPTIONS])
4258ff16396Smrg# -----------------------------------------------
4268ff16396Smrg# The call with PACKAGE and VERSION arguments is the old style
4278ff16396Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
4288ff16396Smrg# and VERSION should now be passed to AC_INIT and removed from
4298ff16396Smrg# the call to AM_INIT_AUTOMAKE.
4308ff16396Smrg# We support both call styles for the transition.  After
4318ff16396Smrg# the next Automake release, Autoconf can make the AC_INIT
4328ff16396Smrg# arguments mandatory, and then we can depend on a new Autoconf
4338ff16396Smrg# release and drop the old call support.
4348ff16396SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
4358ff16396Smrg[AC_PREREQ([2.62])dnl
4368ff16396Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
4378ff16396Smrgdnl the ones we care about.
4388ff16396Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
4398ff16396SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
4408ff16396SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
4418ff16396Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
4428ff16396Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
4438ff16396Smrg  # is not polluted with repeated "-I."
4448ff16396Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
4458ff16396Smrg  # test to see if srcdir already configured
4468ff16396Smrg  if test -f $srcdir/config.status; then
4478ff16396Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
4488ff16396Smrg  fi
4498ff16396Smrgfi
4508ff16396Smrg
4518ff16396Smrg# test whether we have cygpath
4528ff16396Smrgif test -z "$CYGPATH_W"; then
4538ff16396Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
4548ff16396Smrg    CYGPATH_W='cygpath -w'
4558ff16396Smrg  else
4568ff16396Smrg    CYGPATH_W=echo
4578ff16396Smrg  fi
4588ff16396Smrgfi
4598ff16396SmrgAC_SUBST([CYGPATH_W])
4608ff16396Smrg
4618ff16396Smrg# Define the identity of the package.
4628ff16396Smrgdnl Distinguish between old-style and new-style calls.
4638ff16396Smrgm4_ifval([$2],
4648ff16396Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
4658ff16396Smrg AC_SUBST([PACKAGE], [$1])dnl
4668ff16396Smrg AC_SUBST([VERSION], [$2])],
4678ff16396Smrg[_AM_SET_OPTIONS([$1])dnl
4688ff16396Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
4698ff16396Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
4708ff16396Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
4718ff16396Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
4728ff16396Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
4738ff16396Smrg
4748ff16396Smrg_AM_IF_OPTION([no-define],,
4758ff16396Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
4768ff16396Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
4778ff16396Smrg
4788ff16396Smrg# Some tools Automake needs.
4798ff16396SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
4808ff16396SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
4818ff16396SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
4828ff16396SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
4838ff16396SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
4848ff16396SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
4858ff16396SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
4868ff16396SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
4878ff16396SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
4888ff16396SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
4898ff16396Smrg# We need awk for the "check" target.  The system "awk" is bad on
4908ff16396Smrg# some platforms.
4918ff16396SmrgAC_REQUIRE([AC_PROG_AWK])dnl
4928ff16396SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
4938ff16396SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
4948ff16396Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
4958ff16396Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
4968ff16396Smrg			     [_AM_PROG_TAR([v7])])])
4978ff16396Smrg_AM_IF_OPTION([no-dependencies],,
4988ff16396Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
4998ff16396Smrg		  [_AM_DEPENDENCIES(CC)],
5008ff16396Smrg		  [define([AC_PROG_CC],
5018ff16396Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
5028ff16396SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
5038ff16396Smrg		  [_AM_DEPENDENCIES(CXX)],
5048ff16396Smrg		  [define([AC_PROG_CXX],
5058ff16396Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
5068ff16396SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
5078ff16396Smrg		  [_AM_DEPENDENCIES(OBJC)],
5088ff16396Smrg		  [define([AC_PROG_OBJC],
5098ff16396Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
5108ff16396Smrg])
5118ff16396Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
5128ff16396Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
5138ff16396Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
5148ff16396Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
5158ff16396SmrgAC_CONFIG_COMMANDS_PRE(dnl
5168ff16396Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
5178ff16396Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
5188ff16396Smrg])
5198ff16396Smrg
5208ff16396Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
5218ff16396Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
5228ff16396Smrgdnl mangled by Autoconf and run in a shell conditional statement.
5238ff16396Smrgm4_define([_AC_COMPILER_EXEEXT],
5248ff16396Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
5258ff16396Smrg
5268ff16396Smrg
5278ff16396Smrg# When config.status generates a header, we must update the stamp-h file.
5288ff16396Smrg# This file resides in the same directory as the config header
5298ff16396Smrg# that is generated.  The stamp files are numbered to have different names.
5308ff16396Smrg
5318ff16396Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
5328ff16396Smrg# loop where config.status creates the headers, so we can generate
5338ff16396Smrg# our stamp files there.
5348ff16396SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
5358ff16396Smrg[# Compute $1's index in $config_headers.
5368ff16396Smrg_am_arg=$1
5378ff16396Smrg_am_stamp_count=1
5388ff16396Smrgfor _am_header in $config_headers :; do
5398ff16396Smrg  case $_am_header in
5408ff16396Smrg    $_am_arg | $_am_arg:* )
5418ff16396Smrg      break ;;
5428ff16396Smrg    * )
5438ff16396Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
5448ff16396Smrg  esac
5458ff16396Smrgdone
5468ff16396Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
5478ff16396Smrg
5488ff16396Smrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
5498ff16396Smrg#
5508ff16396Smrg# This file is free software; the Free Software Foundation
5518ff16396Smrg# gives unlimited permission to copy and/or distribute it,
5528ff16396Smrg# with or without modifications, as long as this notice is preserved.
5538ff16396Smrg
5548ff16396Smrg# AM_PROG_INSTALL_SH
5558ff16396Smrg# ------------------
5568ff16396Smrg# Define $install_sh.
5578ff16396SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
5588ff16396Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
5598ff16396Smrgif test x"${install_sh}" != xset; then
5608ff16396Smrg  case $am_aux_dir in
5618ff16396Smrg  *\ * | *\	*)
5628ff16396Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
5638ff16396Smrg  *)
5648ff16396Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
5658ff16396Smrg  esac
5668ff16396Smrgfi
5678ff16396SmrgAC_SUBST(install_sh)])
5688ff16396Smrg
5698ff16396Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
5708ff16396Smrg#
5718ff16396Smrg# This file is free software; the Free Software Foundation
5728ff16396Smrg# gives unlimited permission to copy and/or distribute it,
5738ff16396Smrg# with or without modifications, as long as this notice is preserved.
5748ff16396Smrg
5758ff16396Smrg# serial 2
5768ff16396Smrg
5778ff16396Smrg# Check whether the underlying file-system supports filenames
5788ff16396Smrg# with a leading dot.  For instance MS-DOS doesn't.
5798ff16396SmrgAC_DEFUN([AM_SET_LEADING_DOT],
5808ff16396Smrg[rm -rf .tst 2>/dev/null
5818ff16396Smrgmkdir .tst 2>/dev/null
5828ff16396Smrgif test -d .tst; then
5838ff16396Smrg  am__leading_dot=.
5848ff16396Smrgelse
5858ff16396Smrg  am__leading_dot=_
5868ff16396Smrgfi
5878ff16396Smrgrmdir .tst 2>/dev/null
5888ff16396SmrgAC_SUBST([am__leading_dot])])
5898ff16396Smrg
5908ff16396Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
5918ff16396Smrg# From Jim Meyering
5928ff16396Smrg
5938ff16396Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
5948ff16396Smrg# Free Software Foundation, Inc.
5958ff16396Smrg#
5968ff16396Smrg# This file is free software; the Free Software Foundation
5978ff16396Smrg# gives unlimited permission to copy and/or distribute it,
5988ff16396Smrg# with or without modifications, as long as this notice is preserved.
5998ff16396Smrg
6008ff16396Smrg# serial 5
6018ff16396Smrg
6028ff16396Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
6038ff16396Smrg# ----------------------------------
6048ff16396Smrg# Control maintainer-specific portions of Makefiles.
6058ff16396Smrg# Default is to disable them, unless `enable' is passed literally.
6068ff16396Smrg# For symmetry, `disable' may be passed as well.  Anyway, the user
6078ff16396Smrg# can override the default with the --enable/--disable switch.
6088ff16396SmrgAC_DEFUN([AM_MAINTAINER_MODE],
6098ff16396Smrg[m4_case(m4_default([$1], [disable]),
6108ff16396Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
6118ff16396Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
6128ff16396Smrg       [m4_define([am_maintainer_other], [enable])
6138ff16396Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
6148ff16396SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
6158ff16396Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
6168ff16396Smrg  AC_ARG_ENABLE([maintainer-mode],
6178ff16396Smrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
6188ff16396Smrg			  (and sometimes confusing) to the casual installer],
6198ff16396Smrg      [USE_MAINTAINER_MODE=$enableval],
6208ff16396Smrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
6218ff16396Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
6228ff16396Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
6238ff16396Smrg  MAINT=$MAINTAINER_MODE_TRUE
6248ff16396Smrg  AC_SUBST([MAINT])dnl
6258ff16396Smrg]
6268ff16396Smrg)
6278ff16396Smrg
6288ff16396SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
6298ff16396Smrg
6308ff16396Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
6318ff16396Smrg
6328ff16396Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
6338ff16396Smrg#
6348ff16396Smrg# This file is free software; the Free Software Foundation
6358ff16396Smrg# gives unlimited permission to copy and/or distribute it,
6368ff16396Smrg# with or without modifications, as long as this notice is preserved.
6378ff16396Smrg
6388ff16396Smrg# serial 4
6398ff16396Smrg
6408ff16396Smrg# AM_MAKE_INCLUDE()
6418ff16396Smrg# -----------------
6428ff16396Smrg# Check to see how make treats includes.
6438ff16396SmrgAC_DEFUN([AM_MAKE_INCLUDE],
6448ff16396Smrg[am_make=${MAKE-make}
6458ff16396Smrgcat > confinc << 'END'
6468ff16396Smrgam__doit:
6478ff16396Smrg	@echo this is the am__doit target
6488ff16396Smrg.PHONY: am__doit
6498ff16396SmrgEND
6508ff16396Smrg# If we don't find an include directive, just comment out the code.
6518ff16396SmrgAC_MSG_CHECKING([for style of include used by $am_make])
6528ff16396Smrgam__include="#"
6538ff16396Smrgam__quote=
6548ff16396Smrg_am_result=none
6558ff16396Smrg# First try GNU make style include.
6568ff16396Smrgecho "include confinc" > confmf
6578ff16396Smrg# Ignore all kinds of additional output from `make'.
6588ff16396Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
6598ff16396Smrg*the\ am__doit\ target*)
6608ff16396Smrg  am__include=include
6618ff16396Smrg  am__quote=
6628ff16396Smrg  _am_result=GNU
6638ff16396Smrg  ;;
6648ff16396Smrgesac
6658ff16396Smrg# Now try BSD make style include.
6668ff16396Smrgif test "$am__include" = "#"; then
6678ff16396Smrg   echo '.include "confinc"' > confmf
6688ff16396Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
6698ff16396Smrg   *the\ am__doit\ target*)
6708ff16396Smrg     am__include=.include
6718ff16396Smrg     am__quote="\""
6728ff16396Smrg     _am_result=BSD
6738ff16396Smrg     ;;
6748ff16396Smrg   esac
6758ff16396Smrgfi
6768ff16396SmrgAC_SUBST([am__include])
6778ff16396SmrgAC_SUBST([am__quote])
6788ff16396SmrgAC_MSG_RESULT([$_am_result])
6798ff16396Smrgrm -f confinc confmf
6808ff16396Smrg])
6818ff16396Smrg
6828ff16396Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
6838ff16396Smrg
6848ff16396Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
6858ff16396Smrg# Free Software Foundation, Inc.
6868ff16396Smrg#
6878ff16396Smrg# This file is free software; the Free Software Foundation
6888ff16396Smrg# gives unlimited permission to copy and/or distribute it,
6898ff16396Smrg# with or without modifications, as long as this notice is preserved.
6908ff16396Smrg
6918ff16396Smrg# serial 6
6928ff16396Smrg
6938ff16396Smrg# AM_MISSING_PROG(NAME, PROGRAM)
6948ff16396Smrg# ------------------------------
6958ff16396SmrgAC_DEFUN([AM_MISSING_PROG],
6968ff16396Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
6978ff16396Smrg$1=${$1-"${am_missing_run}$2"}
6988ff16396SmrgAC_SUBST($1)])
6998ff16396Smrg
7008ff16396Smrg
7018ff16396Smrg# AM_MISSING_HAS_RUN
7028ff16396Smrg# ------------------
7038ff16396Smrg# Define MISSING if not defined so far and test if it supports --run.
7048ff16396Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
7058ff16396SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
7068ff16396Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
7078ff16396SmrgAC_REQUIRE_AUX_FILE([missing])dnl
7088ff16396Smrgif test x"${MISSING+set}" != xset; then
7098ff16396Smrg  case $am_aux_dir in
7108ff16396Smrg  *\ * | *\	*)
7118ff16396Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
7128ff16396Smrg  *)
7138ff16396Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
7148ff16396Smrg  esac
7158ff16396Smrgfi
7168ff16396Smrg# Use eval to expand $SHELL
7178ff16396Smrgif eval "$MISSING --run true"; then
7188ff16396Smrg  am_missing_run="$MISSING --run "
7198ff16396Smrgelse
7208ff16396Smrg  am_missing_run=
7218ff16396Smrg  AC_MSG_WARN([`missing' script is too old or missing])
7228ff16396Smrgfi
7238ff16396Smrg])
7248ff16396Smrg
7258ff16396Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
7268ff16396Smrg#
7278ff16396Smrg# This file is free software; the Free Software Foundation
7288ff16396Smrg# gives unlimited permission to copy and/or distribute it,
7298ff16396Smrg# with or without modifications, as long as this notice is preserved.
7308ff16396Smrg
7318ff16396Smrg# AM_PROG_MKDIR_P
7328ff16396Smrg# ---------------
7338ff16396Smrg# Check for `mkdir -p'.
7348ff16396SmrgAC_DEFUN([AM_PROG_MKDIR_P],
7358ff16396Smrg[AC_PREREQ([2.60])dnl
7368ff16396SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
7378ff16396Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
7388ff16396Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
7398ff16396Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
7408ff16396Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
7418ff16396Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
7428ff16396Smrgdnl adjustment using top_builddir (which is defined more often than
7438ff16396Smrgdnl MKDIR_P).
7448ff16396SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
7458ff16396Smrgcase $mkdir_p in
7468ff16396Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
7478ff16396Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
7488ff16396Smrgesac
7498ff16396Smrg])
7508ff16396Smrg
7518ff16396Smrg# Helper functions for option handling.                     -*- Autoconf -*-
7528ff16396Smrg
7538ff16396Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
7548ff16396Smrg#
7558ff16396Smrg# This file is free software; the Free Software Foundation
7568ff16396Smrg# gives unlimited permission to copy and/or distribute it,
7578ff16396Smrg# with or without modifications, as long as this notice is preserved.
7588ff16396Smrg
7598ff16396Smrg# serial 4
7608ff16396Smrg
7618ff16396Smrg# _AM_MANGLE_OPTION(NAME)
7628ff16396Smrg# -----------------------
7638ff16396SmrgAC_DEFUN([_AM_MANGLE_OPTION],
7648ff16396Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
7658ff16396Smrg
7668ff16396Smrg# _AM_SET_OPTION(NAME)
7678ff16396Smrg# ------------------------------
7688ff16396Smrg# Set option NAME.  Presently that only means defining a flag for this option.
7698ff16396SmrgAC_DEFUN([_AM_SET_OPTION],
7708ff16396Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
7718ff16396Smrg
7728ff16396Smrg# _AM_SET_OPTIONS(OPTIONS)
7738ff16396Smrg# ----------------------------------
7748ff16396Smrg# OPTIONS is a space-separated list of Automake options.
7758ff16396SmrgAC_DEFUN([_AM_SET_OPTIONS],
7768ff16396Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
7778ff16396Smrg
7788ff16396Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
7798ff16396Smrg# -------------------------------------------
7808ff16396Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
7818ff16396SmrgAC_DEFUN([_AM_IF_OPTION],
7828ff16396Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
7838ff16396Smrg
7848ff16396Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
7858ff16396Smrg
7868ff16396Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
7878ff16396Smrg# Free Software Foundation, Inc.
7888ff16396Smrg#
7898ff16396Smrg# This file is free software; the Free Software Foundation
7908ff16396Smrg# gives unlimited permission to copy and/or distribute it,
7918ff16396Smrg# with or without modifications, as long as this notice is preserved.
7928ff16396Smrg
7938ff16396Smrg# serial 5
7948ff16396Smrg
7958ff16396Smrg# AM_SANITY_CHECK
7968ff16396Smrg# ---------------
7978ff16396SmrgAC_DEFUN([AM_SANITY_CHECK],
7988ff16396Smrg[AC_MSG_CHECKING([whether build environment is sane])
7998ff16396Smrg# Just in case
8008ff16396Smrgsleep 1
8018ff16396Smrgecho timestamp > conftest.file
8028ff16396Smrg# Reject unsafe characters in $srcdir or the absolute working directory
8038ff16396Smrg# name.  Accept space and tab only in the latter.
8048ff16396Smrgam_lf='
8058ff16396Smrg'
8068ff16396Smrgcase `pwd` in
8078ff16396Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
8088ff16396Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
8098ff16396Smrgesac
8108ff16396Smrgcase $srcdir in
8118ff16396Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
8128ff16396Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
8138ff16396Smrgesac
8148ff16396Smrg
8158ff16396Smrg# Do `set' in a subshell so we don't clobber the current shell's
8168ff16396Smrg# arguments.  Must try -L first in case configure is actually a
8178ff16396Smrg# symlink; some systems play weird games with the mod time of symlinks
8188ff16396Smrg# (eg FreeBSD returns the mod time of the symlink's containing
8198ff16396Smrg# directory).
8208ff16396Smrgif (
8218ff16396Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
8228ff16396Smrg   if test "$[*]" = "X"; then
8238ff16396Smrg      # -L didn't work.
8248ff16396Smrg      set X `ls -t "$srcdir/configure" conftest.file`
8258ff16396Smrg   fi
8268ff16396Smrg   rm -f conftest.file
8278ff16396Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
8288ff16396Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
8298ff16396Smrg
8308ff16396Smrg      # If neither matched, then we have a broken ls.  This can happen
8318ff16396Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
8328ff16396Smrg      # broken ls alias from the environment.  This has actually
8338ff16396Smrg      # happened.  Such a system could not be considered "sane".
8348ff16396Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
8358ff16396Smrgalias in your environment])
8368ff16396Smrg   fi
8378ff16396Smrg
8388ff16396Smrg   test "$[2]" = conftest.file
8398ff16396Smrg   )
8408ff16396Smrgthen
8418ff16396Smrg   # Ok.
8428ff16396Smrg   :
8438ff16396Smrgelse
8448ff16396Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
8458ff16396SmrgCheck your system clock])
8468ff16396Smrgfi
8478ff16396SmrgAC_MSG_RESULT(yes)])
8488ff16396Smrg
8498ff16396Smrg# Copyright (C) 2009  Free Software Foundation, Inc.
8508ff16396Smrg#
8518ff16396Smrg# This file is free software; the Free Software Foundation
8528ff16396Smrg# gives unlimited permission to copy and/or distribute it,
8538ff16396Smrg# with or without modifications, as long as this notice is preserved.
8548ff16396Smrg
8558ff16396Smrg# serial 1
8568ff16396Smrg
8578ff16396Smrg# AM_SILENT_RULES([DEFAULT])
8588ff16396Smrg# --------------------------
8598ff16396Smrg# Enable less verbose build rules; with the default set to DEFAULT
8608ff16396Smrg# (`yes' being less verbose, `no' or empty being verbose).
8618ff16396SmrgAC_DEFUN([AM_SILENT_RULES],
8628ff16396Smrg[AC_ARG_ENABLE([silent-rules],
8638ff16396Smrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
8648ff16396Smrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
8658ff16396Smrgcase $enable_silent_rules in
8668ff16396Smrgyes) AM_DEFAULT_VERBOSITY=0;;
8678ff16396Smrgno)  AM_DEFAULT_VERBOSITY=1;;
8688ff16396Smrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
8698ff16396Smrgesac
8708ff16396SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
8718ff16396SmrgAM_BACKSLASH='\'
8728ff16396SmrgAC_SUBST([AM_BACKSLASH])dnl
8738ff16396Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
8748ff16396Smrg])
8758ff16396Smrg
8768ff16396Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
8778ff16396Smrg#
8788ff16396Smrg# This file is free software; the Free Software Foundation
8798ff16396Smrg# gives unlimited permission to copy and/or distribute it,
8808ff16396Smrg# with or without modifications, as long as this notice is preserved.
8818ff16396Smrg
8828ff16396Smrg# AM_PROG_INSTALL_STRIP
8838ff16396Smrg# ---------------------
8848ff16396Smrg# One issue with vendor `install' (even GNU) is that you can't
8858ff16396Smrg# specify the program used to strip binaries.  This is especially
8868ff16396Smrg# annoying in cross-compiling environments, where the build's strip
8878ff16396Smrg# is unlikely to handle the host's binaries.
8888ff16396Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
8898ff16396Smrg# always use install-sh in `make install-strip', and initialize
8908ff16396Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
8918ff16396SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
8928ff16396Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
8938ff16396Smrg# Installed binaries are usually stripped using `strip' when the user
8948ff16396Smrg# run `make install-strip'.  However `strip' might not be the right
8958ff16396Smrg# tool to use in cross-compilation environments, therefore Automake
8968ff16396Smrg# will honor the `STRIP' environment variable to overrule this program.
8978ff16396Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
8988ff16396Smrgif test "$cross_compiling" != no; then
8998ff16396Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
9008ff16396Smrgfi
9018ff16396SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
9028ff16396SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
9038ff16396Smrg
9048ff16396Smrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
9058ff16396Smrg#
9068ff16396Smrg# This file is free software; the Free Software Foundation
9078ff16396Smrg# gives unlimited permission to copy and/or distribute it,
9088ff16396Smrg# with or without modifications, as long as this notice is preserved.
9098ff16396Smrg
9108ff16396Smrg# serial 2
9118ff16396Smrg
9128ff16396Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
9138ff16396Smrg# ---------------------------
9148ff16396Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
9158ff16396Smrg# This macro is traced by Automake.
9168ff16396SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
9178ff16396Smrg
9188ff16396Smrg# AM_SUBST_NOTMAKE(VARIABLE)
9198ff16396Smrg# ---------------------------
9208ff16396Smrg# Public sister of _AM_SUBST_NOTMAKE.
9218ff16396SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
9228ff16396Smrg
9238ff16396Smrg# Check how to create a tarball.                            -*- Autoconf -*-
9248ff16396Smrg
9258ff16396Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
9268ff16396Smrg#
9278ff16396Smrg# This file is free software; the Free Software Foundation
9288ff16396Smrg# gives unlimited permission to copy and/or distribute it,
9298ff16396Smrg# with or without modifications, as long as this notice is preserved.
9308ff16396Smrg
9318ff16396Smrg# serial 2
9328ff16396Smrg
9338ff16396Smrg# _AM_PROG_TAR(FORMAT)
9348ff16396Smrg# --------------------
9358ff16396Smrg# Check how to create a tarball in format FORMAT.
9368ff16396Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
9378ff16396Smrg#
9388ff16396Smrg# Substitute a variable $(am__tar) that is a command
9398ff16396Smrg# writing to stdout a FORMAT-tarball containing the directory
9408ff16396Smrg# $tardir.
9418ff16396Smrg#     tardir=directory && $(am__tar) > result.tar
9428ff16396Smrg#
9438ff16396Smrg# Substitute a variable $(am__untar) that extract such
9448ff16396Smrg# a tarball read from stdin.
9458ff16396Smrg#     $(am__untar) < result.tar
9468ff16396SmrgAC_DEFUN([_AM_PROG_TAR],
9478ff16396Smrg[# Always define AMTAR for backward compatibility.
9488ff16396SmrgAM_MISSING_PROG([AMTAR], [tar])
9498ff16396Smrgm4_if([$1], [v7],
9508ff16396Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
9518ff16396Smrg     [m4_case([$1], [ustar],, [pax],,
9528ff16396Smrg              [m4_fatal([Unknown tar format])])
9538ff16396SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
9548ff16396Smrg# Loop over all known methods to create a tar archive until one works.
9558ff16396Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
9568ff16396Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
9578ff16396Smrg# Do not fold the above two line into one, because Tru64 sh and
9588ff16396Smrg# Solaris sh will not grok spaces in the rhs of `-'.
9598ff16396Smrgfor _am_tool in $_am_tools
9608ff16396Smrgdo
9618ff16396Smrg  case $_am_tool in
9628ff16396Smrg  gnutar)
9638ff16396Smrg    for _am_tar in tar gnutar gtar;
9648ff16396Smrg    do
9658ff16396Smrg      AM_RUN_LOG([$_am_tar --version]) && break
9668ff16396Smrg    done
9678ff16396Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
9688ff16396Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
9698ff16396Smrg    am__untar="$_am_tar -xf -"
9708ff16396Smrg    ;;
9718ff16396Smrg  plaintar)
9728ff16396Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
9738ff16396Smrg    # ustar tarball either.
9748ff16396Smrg    (tar --version) >/dev/null 2>&1 && continue
9758ff16396Smrg    am__tar='tar chf - "$$tardir"'
9768ff16396Smrg    am__tar_='tar chf - "$tardir"'
9778ff16396Smrg    am__untar='tar xf -'
9788ff16396Smrg    ;;
9798ff16396Smrg  pax)
9808ff16396Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
9818ff16396Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
9828ff16396Smrg    am__untar='pax -r'
9838ff16396Smrg    ;;
9848ff16396Smrg  cpio)
9858ff16396Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
9868ff16396Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
9878ff16396Smrg    am__untar='cpio -i -H $1 -d'
9888ff16396Smrg    ;;
9898ff16396Smrg  none)
9908ff16396Smrg    am__tar=false
9918ff16396Smrg    am__tar_=false
9928ff16396Smrg    am__untar=false
9938ff16396Smrg    ;;
9948ff16396Smrg  esac
9958ff16396Smrg
9968ff16396Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
9978ff16396Smrg  # and am__untar set.
9988ff16396Smrg  test -n "${am_cv_prog_tar_$1}" && break
9998ff16396Smrg
10008ff16396Smrg  # tar/untar a dummy directory, and stop if the command works
10018ff16396Smrg  rm -rf conftest.dir
10028ff16396Smrg  mkdir conftest.dir
10038ff16396Smrg  echo GrepMe > conftest.dir/file
10048ff16396Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
10058ff16396Smrg  rm -rf conftest.dir
10068ff16396Smrg  if test -s conftest.tar; then
10078ff16396Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
10088ff16396Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
10098ff16396Smrg  fi
10108ff16396Smrgdone
10118ff16396Smrgrm -rf conftest.dir
10128ff16396Smrg
10138ff16396SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
10148ff16396SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
10158ff16396SmrgAC_SUBST([am__tar])
10168ff16396SmrgAC_SUBST([am__untar])
10178ff16396Smrg]) # _AM_PROG_TAR
10188ff16396Smrg
10198ff16396Smrgdnl fontutil.m4.  Generated from fontutil.m4.in by configure.
10208ff16396Smrgdnl
10218ff16396Smrgdnl This file comes from X.Org's font-util 1.1.0
10228ff16396Smrgdnl
10238ff16396Smrgdnl Copyright 2005 Red Hat, Inc
10248ff16396Smrgdnl
10258ff16396Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
10268ff16396Smrgdnl documentation for any purpose is hereby granted without fee, provided that
10278ff16396Smrgdnl the above copyright notice appear in all copies and that both that
10288ff16396Smrgdnl copyright notice and this permission notice appear in supporting
10298ff16396Smrgdnl documentation.
10308ff16396Smrgdnl
10318ff16396Smrgdnl The above copyright notice and this permission notice shall be included
10328ff16396Smrgdnl in all copies or substantial portions of the Software.
10338ff16396Smrgdnl
10348ff16396Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
10358ff16396Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
10368ff16396Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
10378ff16396Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
10388ff16396Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
10398ff16396Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
10408ff16396Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
10418ff16396Smrgdnl
10428ff16396Smrgdnl Except as contained in this notice, the name of the copyright holders shall
10438ff16396Smrgdnl not be used in advertising or otherwise to promote the sale, use or
10448ff16396Smrgdnl other dealings in this Software without prior written authorization
10458ff16396Smrgdnl from the copyright holders.
10468ff16396Smrgdnl
10478ff16396Smrgdnl --------------------------------------------------------------------
10488ff16396Smrgdnl
10498ff16396Smrgdnl Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
10508ff16396Smrgdnl
10518ff16396Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
10528ff16396Smrgdnl copy of this software and associated documentation files (the
10538ff16396Smrgdnl "Software"), to deal in the Software without restriction, including
10548ff16396Smrgdnl without limitation the rights to use, copy, modify, merge, publish,
10558ff16396Smrgdnl distribute, and/or sell copies of the Software, and to permit persons
10568ff16396Smrgdnl to whom the Software is furnished to do so, provided that the above
10578ff16396Smrgdnl copyright notice(s) and this permission notice appear in all copies of
10588ff16396Smrgdnl the Software and that both the above copyright notice(s) and this
10598ff16396Smrgdnl permission notice appear in supporting documentation.
10608ff16396Smrgdnl
10618ff16396Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
10628ff16396Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
10638ff16396Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
10648ff16396Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
10658ff16396Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
10668ff16396Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
10678ff16396Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
10688ff16396Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
10698ff16396Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
10708ff16396Smrgdnl
10718ff16396Smrgdnl Except as contained in this notice, the name of a copyright holder
10728ff16396Smrgdnl shall not be used in advertising or otherwise to promote the sale, use
10738ff16396Smrgdnl or other dealings in this Software without prior written authorization
10748ff16396Smrgdnl of the copyright holder.
10758ff16396Smrg
10768ff16396Smrg# XORG_FONT_MACROS_VERSION(required-version)
10778ff16396Smrg# ------------------------------------------
10788ff16396Smrg# Minimum version: 1.1.0
10798ff16396Smrg#
10808ff16396Smrg# If you're using a macro added in Version 1.1 or newer, include this in
10818ff16396Smrg# your configure.ac with the minimum required version, such as:
10828ff16396Smrg# XORG_FONT_MACROS_VERSION(1.1)
10838ff16396Smrg#
10848ff16396Smrg# To ensure that this macro is defined, also add:
10858ff16396Smrg# m4_ifndef([XORG_FONT_MACROS_VERSION],
10868ff16396Smrg#     [m4_fatal([must install X.Org font-util 1.1 or later before running autoconf/autogen])])
10878ff16396Smrg#
10888ff16396Smrg#
10898ff16396Smrg# See the "minimum version" comment for each macro you use to see what
10908ff16396Smrg# version you require.
10918ff16396Smrgm4_defun([XORG_FONT_MACROS_VERSION],[
10928ff16396Smrgm4_define([vers_have], [1.1.0])
10938ff16396Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
10948ff16396Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
10958ff16396Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
10968ff16396Smrg    [m4_fatal([font-util major version ]maj_needed[ is required but ]vers_have[ found])])
10978ff16396Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
10988ff16396Smrg    [m4_fatal([font-util version $1 or higher is required but ]vers_have[ found])])
10998ff16396Smrgm4_undefine([vers_have])
11008ff16396Smrgm4_undefine([maj_have])
11018ff16396Smrgm4_undefine([maj_needed])
11028ff16396Smrg]) # XORG_FONT_MACROS_VERSION
11038ff16396Smrg
11048ff16396Smrg# XORG_FONT_CHECK_{maps}()
11058ff16396Smrg# ------------------------
11068ff16396Smrg# Minimum version: 1.0.0
11078ff16396Smrg# These macros add --enable/disable-{maps} where {maps} are ISO8859-*,
11088ff16396Smrg# JISX0201 or KOI8_R.  By default, they are all enabled.
11098ff16396Smrg
11108ff16396SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_1], [XORG_FONT_CHECK_ENCODING(ISO8859-1)])
11118ff16396SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_2], [XORG_FONT_CHECK_ENCODING(ISO8859-2)])
11128ff16396SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_3], [XORG_FONT_CHECK_ENCODING(ISO8859-3)])
11138ff16396SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_4], [XORG_FONT_CHECK_ENCODING(ISO8859-4)])
11148ff16396SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_5], [XORG_FONT_CHECK_ENCODING(ISO8859-5)])
11158ff16396SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_6], [XORG_FONT_CHECK_ENCODING(ISO8859-6)])
11168ff16396SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_7], [XORG_FONT_CHECK_ENCODING(ISO8859-7)])
11178ff16396SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_8], [XORG_FONT_CHECK_ENCODING(ISO8859-8)])
11188ff16396SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_9], [XORG_FONT_CHECK_ENCODING(ISO8859-9)])
11198ff16396SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_10],[XORG_FONT_CHECK_ENCODING(ISO8859-10)])
11208ff16396SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_11],[XORG_FONT_CHECK_ENCODING(ISO8859-11)])
11218ff16396SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_12],[XORG_FONT_CHECK_ENCODING(ISO8859-12)])
11228ff16396SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_13],[XORG_FONT_CHECK_ENCODING(ISO8859-13)])
11238ff16396SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_14],[XORG_FONT_CHECK_ENCODING(ISO8859-14)])
11248ff16396SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_15],[XORG_FONT_CHECK_ENCODING(ISO8859-15)])
11258ff16396SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_16],[XORG_FONT_CHECK_ENCODING(ISO8859-16)])
11268ff16396SmrgAC_DEFUN([XORG_FONT_CHECK_JISX0201],  [XORG_FONT_CHECK_ENCODING(JISX0201)])
11278ff16396SmrgAC_DEFUN([XORG_FONT_CHECK_KOI8_R],    [XORG_FONT_CHECK_ENCODING(KOI8-R)])
11288ff16396Smrg
11298ff16396Smrg# XORG_FONT_CHECK_ENCODING(encoding)
11308ff16396Smrg# ----------------------------------
11318ff16396Smrg# Minimum version: 1.1.0
11328ff16396Smrg# This macro adds --enable/disable-<encoding>, enabled by default.
11338ff16396Smrg# It replaced individual copies of this code in the above macros in 1.1.
11348ff16396Smrg# Currently assumes encoding names will be all upper-case - add m4_toupper
11358ff16396Smrg# calls if this is not true in the future.
11368ff16396Smrg
11378ff16396SmrgAC_DEFUN([XORG_FONT_CHECK_ENCODING],[
11388ff16396Smrg	AC_ARG_ENABLE(m4_tolower($1),
11398ff16396Smrg		AS_HELP_STRING(m4_join([-], [--disable], m4_tolower($1)),
11408ff16396Smrg				[Build $1 fonts (default: yes)]),
11418ff16396Smrg		[AS_TR_SH($1)=$enableval], [AS_TR_SH($1)=yes])
11428ff16396Smrg	AC_MSG_CHECKING([whether to build $1 fonts])
11438ff16396Smrg	AC_MSG_RESULT($[AS_TR_SH($1)])
11448ff16396Smrg	AM_CONDITIONAL(AS_TR_SH($1), [test "x$AS_TR_SH($1)" = xyes])
11458ff16396Smrg]) # XORG_FONT_CHECK_ENCODING
11468ff16396Smrg
11478ff16396Smrg# XORG_FONT_CHECK_ENCODING_LIST(encoding1 encoding2....)
11488ff16396Smrg# -----------------------------------------------------
11498ff16396Smrg# Minimum version: 1.1.0
11508ff16396Smrg# Call XORG_FONT_CHECK_ENCODING for multiple encodings at once
11518ff16396Smrg
11528ff16396SmrgAC_DEFUN([XORG_FONT_CHECK_ENCODING_LIST],[
11538ff16396Smrg	m4_foreach_w([enc], [$1], [XORG_FONT_CHECK_ENCODING(enc)])
11548ff16396Smrg]) # XORG_FONT_CHECK_ENCODING_LIST
11558ff16396Smrg
11568ff16396Smrg# XORG_FONT_REQUIRED_PROG(VARNAME, progname)
11578ff16396Smrg# ------------------------------------------
11588ff16396Smrg# Minimum version: 1.1.0
11598ff16396Smrg#
11608ff16396Smrg# Simple wrapper around AC_PATH_PROG that errors if not found
11618ff16396Smrg#
11628ff16396Smrg
11638ff16396SmrgAC_DEFUN([XORG_FONT_REQUIRED_PROG],[
11648ff16396Smrg	AC_PATH_PROG($1, $2)
11658ff16396Smrg	if test x"$1" = x; then
11668ff16396Smrg		AC_MSG_ERROR([$2 is required to build $PACKAGE_NAME.])
11678ff16396Smrg	fi
11688ff16396Smrg])
11698ff16396Smrg
11708ff16396Smrg
11718ff16396Smrg# XORG_FONT_FCCACHE()
11728ff16396Smrg# -------------------
11738ff16396Smrg# Minimum version: 1.1.0
11748ff16396Smrg#
11758ff16396Smrg# Set FCCACHE to path to fc-cache (fontconfig cache builder) if found
11768ff16396Smrg# Set RUN_FCCACHE to a rule suitable for substituting into a makefile
11778ff16396Smrg# to run fc-cache if found and not installing to $DESTDIR
11788ff16396Smrg#
11798ff16396Smrg# fc-cache is optional, not required, and should be skipped when making
11808ff16396Smrg# packages (installing to $DESTDIR).
11818ff16396Smrg#
11828ff16396SmrgAC_DEFUN([XORG_FONT_FCCACHE],[
11838ff16396Smrg	AC_PATH_PROG(FCCACHE, fc-cache)
11848ff16396Smrg	FCCACHE_WARN='echo "** Warning: fonts.cache not built" ; echo "** Generate this file manually on host system using fc-cache"'
11858ff16396Smrg	if test x"$FCCACHE" = x ; then
11868ff16396Smrg		RUN_FCCACHE="${FCCACHE_WARN}"
11878ff16396Smrg	else
11888ff16396Smrg		RUN_FCCACHE='@(if test -z "$(DESTDIR)"; then echo $(FCCACHE) $(fontdir); $(FCCACHE) $(fontdir); else'
11898ff16396Smrg		RUN_FCCACHE="${RUN_FCCACHE} ${FCCACHE_WARN} ; fi)"
11908ff16396Smrg	fi
11918ff16396Smrg	AC_SUBST([RUN_FCCACHE])
11920bd0e222Smrg])
11930bd0e222Smrg
11940bd0e222Smrg
11958ff16396Smrg# XORG_FONT_COMMON_UTILS()
11968ff16396Smrg# ------------------------
11978ff16396Smrg# Minimum version: 1.1.0
11988ff16396Smrg#
11998ff16396Smrg# Call XORG_FONT_REQUIRED_PROG for programs needed for all font types
12008ff16396Smrg
12018ff16396SmrgAC_DEFUN([XORG_FONT_COMMON_UTILS],[
12028ff16396Smrg	XORG_FONT_FCCACHE
12038ff16396Smrg	XORG_FONT_REQUIRED_PROG(MKFONTDIR, mkfontdir)
12040bd0e222Smrg])
12050bd0e222Smrg
12068ff16396Smrg# XORG_FONT_SCALED_UTILS()
12078ff16396Smrg# ------------------------
12088ff16396Smrg# Minimum version: 1.1.0
12098ff16396Smrg#
12108ff16396Smrg# Call XORG_FONT_REQUIRED_PROG for programs needed for scalable fonts
12118ff16396Smrg# (TrueType, OpenType, Type1)
12120bd0e222Smrg
12138ff16396SmrgAC_DEFUN([XORG_FONT_SCALED_UTILS],[
12148ff16396Smrg	XORG_FONT_COMMON_UTILS
12158ff16396Smrg	XORG_FONT_REQUIRED_PROG(MKFONTSCALE, mkfontscale)
12160bd0e222Smrg])
12170bd0e222Smrg
12188ff16396Smrg# XORG_FONT_BDF_UTILS()
12198ff16396Smrg# ---------------------
12208ff16396Smrg# Minimum version: 1.1.0
12218ff16396Smrg#
12228ff16396Smrg# Call XORG_FONT_REQUIRED_PROG for programs needed for BDF format bitmap fonts
12238ff16396Smrg# Also call XORG_FONT_CHECK_COMPRESSION to determine how to compress the
12248ff16396Smrg# PCF output files created by bdftopcf
12258ff16396Smrg
12268ff16396SmrgAC_DEFUN([XORG_FONT_BDF_UTILS],[
12278ff16396Smrg	XORG_FONT_COMMON_UTILS
12288ff16396Smrg	XORG_FONT_REQUIRED_PROG(BDFTOPCF, bdftopcf)
12298ff16396Smrg	XORG_FONT_CHECK_COMPRESSION
12308ff16396Smrg])
12310bd0e222Smrg
12328ff16396Smrg# XORG_FONT_CHECK_COMPRESSION()
12338ff16396Smrg# -----------------------------
12348ff16396Smrg# Minimum version: 1.1.0
12358ff16396Smrg#
12368ff16396Smrg# Offer a --with-compression flag to control what compression method is
12378ff16396Smrg# used for pcf font files.   Offers all the methods currently supported
12388ff16396Smrg# by libXfont, including no compression.
12398ff16396Smrg
12408ff16396SmrgAC_DEFUN([XORG_FONT_CHECK_COMPRESSION],[
12418ff16396Smrg	AC_MSG_CHECKING([font compression method])
12428ff16396Smrg	AC_ARG_WITH(compression,
12438ff16396Smrg	 [AS_HELP_STRING([--with-compression=<no|compress|gzip|bzip2>],
12448ff16396Smrg			 [compression method to use on pcf fonts])],
12458ff16396Smrg         [compression="$withval"], [compression="yes"])
12468ff16396Smrg	if test x"$compression" = "xyes" ; then
12478ff16396Smrg		compression="gzip"
12488ff16396Smrg	fi
12498ff16396Smrg	AC_MSG_RESULT([${compression}])
12508ff16396Smrg	case ${compression} in
12518ff16396Smrg	 *compress)	COMPRESS_SUFFIX=".Z" ;;
12528ff16396Smrg	 *gzip)		COMPRESS_SUFFIX=".gz" ;;
12538ff16396Smrg	 *bzip2)	COMPRESS_SUFFIX=".bz2" ;;
12548ff16396Smrg	 no|none)	COMPRESS_SUFFIX="" ; COMPRESS="cat" ;;
12558ff16396Smrg	 *) AC_MSG_ERROR([${compression} is not a supported compression method]) ;;
12568ff16396Smrg	esac
12578ff16396Smrg	if test x"$COMPRESS_SUFFIX" != "x" ; then
12588ff16396Smrg	   XORG_FONT_REQUIRED_PROG(COMPRESS, ${compression})
12598ff16396Smrg	fi
12608ff16396Smrg	AC_SUBST([COMPRESS_SUFFIX])
12618ff16396Smrg])
12620bd0e222Smrg
12638ff16396Smrg# XORG_FONT_UCS2ANY()
12648ff16396Smrg# -------------------
12658ff16396Smrg# Minimum version: 1.1.0
12668ff16396Smrg#
12678ff16396Smrg# Call XORG_FONT_REQUIRED_PROG for ucs2any program needed for splitting
12688ff16396Smrg# Unicode-encoded BDF format bitmap fonts into subsets for older encodings.
12698ff16396Smrg# Also call pkg-config to find the directory with the encoding files needed
12708ff16396Smrg# by ucs2any, and export it as MAPFILES_PATH to the Makefiles
12718ff16396Smrg
12728ff16396SmrgAC_DEFUN([XORG_FONT_UCS2ANY],[
12738ff16396Smrg	XORG_FONT_REQUIRED_PROG(UCS2ANY, ucs2any)
12748ff16396Smrg	PKG_CHECK_MODULES(MAPS, [fontutil])
12758ff16396Smrg	AC_MSG_CHECKING([for ucs2any encoding data files])
12768ff16396Smrg	MAPFILES_PATH=`pkg-config --variable=mapdir fontutil`
12778ff16396Smrg	AC_SUBST(MAPFILES_PATH)
12788ff16396Smrg	AC_MSG_RESULT([${MAPFILES_PATH}])
12798ff16396Smrg])
12800bd0e222Smrg
12810bd0e222Smrg
12820bd0e222Smrg
12838ff16396Smrg# XORG_FONTROOTDIR()
12848ff16396Smrg# --------------------
12858ff16396Smrg# Minimum version: 1.1.0
12868ff16396Smrg#
12878ff16396Smrg# Sets FONTROOTDIR to the root directory for font files.  Uses the first
12888ff16396Smrg# found from:
12898ff16396Smrg#	--with-fontrootdir
12908ff16396Smrg#	pkg-config --variable=fontrootdir fontutil
12918ff16396Smrg#	${datadir}/fonts/X11
12928ff16396Smrg
12938ff16396SmrgAC_DEFUN([XORG_FONTROOTDIR],[
12948ff16396Smrg	dnl Ensure $PKG_CONFIG is set first
12958ff16396Smrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
12968ff16396Smrg
12978ff16396Smrg	AC_MSG_CHECKING([for root directory for font files])
12988ff16396Smrg	AC_ARG_WITH(fontrootdir,
12998ff16396Smrg		    AS_HELP_STRING([--with-fontrootdir=DIR],
13008ff16396Smrg			   [Path to root directory for font files]),
13018ff16396Smrg		    [FONTROOTDIR="$withval"])
13028ff16396Smrg	# if --with-fontrootdir not specified...
13038ff16396Smrg	if test "x${FONTROOTDIR}" = "x"; then
13048ff16396Smrg		FONTROOTDIR=`$PKG_CONFIG --variable=fontrootdir fontutil`
13058ff16396Smrg	fi
13068ff16396Smrg	# ...and if pkg-config didn't find fontdir in fontutil.pc...
13078ff16396Smrg	if test "x${FONTROOTDIR}" = "x"; then
13088ff16396Smrg		FONTROOTDIR="${datadir}/fonts/X11"
13098ff16396Smrg	fi
13108ff16396Smrg	AC_SUBST(FONTROOTDIR)
13118ff16396Smrg	AC_MSG_RESULT([${FONTROOTDIR}])
13128ff16396Smrg])
13130bd0e222Smrg
13148ff16396Smrg# XORG_FONTSUBDIR(variable, flag, subdir)
13158ff16396Smrg# ---------------------------------------
13168ff16396Smrg# Minimum version: 1.1.0
13178ff16396Smrg#
13188ff16396Smrg# Offer a --with-<flag> flag to control directory for font installation
13198ff16396Smrg# Default is the specified <subdir> of the font root directory.
13208ff16396Smrg# Sets <variable> to the selected directory
13218ff16396Smrg
13228ff16396SmrgAC_DEFUN([XORG_FONTSUBDIR],[
13238ff16396Smrg	AC_REQUIRE([XORG_FONTROOTDIR])
13248ff16396Smrg
13258ff16396Smrg	AC_MSG_CHECKING([for directory for $3 files])
13268ff16396Smrg	AC_ARG_WITH($2,
13278ff16396Smrg		    [AS_HELP_STRING([--with-$2=DIR],
13288ff16396Smrg		       		   [Path to $3 files [FONTROOTDIR/$3]])],
13298ff16396Smrg		    [$1="${withval}"], [$1='${FONTROOTDIR}/$3'])
13308ff16396Smrg	AC_SUBST($1)
13318ff16396Smrg	AC_MSG_RESULT([${$1}])
13328ff16396Smrg]) # XORG_FONTSUBDIR
13338ff16396Smrg
13348ff16396Smrg# XORG_FONTDIR(subdir)
13358ff16396Smrg# --------------------
13368ff16396Smrg# Minimum version: 1.1.0
13378ff16396Smrg#
13388ff16396Smrg# Offer a --with-fontdir flag to control directory for font installation
13398ff16396Smrg# Default is the specified subdir of the font root directory.
13408ff16396Smrg# Sets FONTDIR to the selected directory
13410bd0e222Smrg
13428ff16396SmrgAC_DEFUN([XORG_FONTDIR],[XORG_FONTSUBDIR([FONTDIR], [fontdir], [$1])])
13430bd0e222Smrg
13448ff16396Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
13458ff16396Smrgdnl
13468ff16396Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
13478ff16396Smrgdnl 
13488ff16396Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
13498ff16396Smrgdnl copy of this software and associated documentation files (the
13508ff16396Smrgdnl "Software"), to deal in the Software without restriction, including
13518ff16396Smrgdnl without limitation the rights to use, copy, modify, merge, publish,
13528ff16396Smrgdnl distribute, and/or sell copies of the Software, and to permit persons
13538ff16396Smrgdnl to whom the Software is furnished to do so, provided that the above
13548ff16396Smrgdnl copyright notice(s) and this permission notice appear in all copies of
13558ff16396Smrgdnl the Software and that both the above copyright notice(s) and this
13568ff16396Smrgdnl permission notice appear in supporting documentation.
13578ff16396Smrgdnl
13588ff16396Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
13598ff16396Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
13608ff16396Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
13618ff16396Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
13628ff16396Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
13638ff16396Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
13648ff16396Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
13658ff16396Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
13668ff16396Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
13678ff16396Smrgdnl
13688ff16396Smrgdnl Except as contained in this notice, the name of a copyright holder
13698ff16396Smrgdnl shall not be used in advertising or otherwise to promote the sale, use
13708ff16396Smrgdnl or other dealings in this Software without prior written authorization
13718ff16396Smrgdnl of the copyright holder.
13728ff16396Smrg
13738ff16396Smrg# XORG_MACROS_VERSION(required-version)
13748ff16396Smrg# -------------------------------------
13758ff16396Smrg# Minimum version: 1.1.0
13760bd0e222Smrg#
13778ff16396Smrg# If you're using a macro added in Version 1.1 or newer, include this in
13788ff16396Smrg# your configure.ac with the minimum required version, such as:
13798ff16396Smrg# XORG_MACROS_VERSION(1.1)
13808ff16396Smrg#
13818ff16396Smrg# To ensure that this macro is defined, also add:
13828ff16396Smrg# m4_ifndef([XORG_MACROS_VERSION],
13838ff16396Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
13848ff16396Smrg#
13858ff16396Smrg#
13868ff16396Smrg# See the "minimum version" comment for each macro you use to see what 
13878ff16396Smrg# version you require.
13888ff16396Smrgm4_defun([XORG_MACROS_VERSION],[
13898ff16396Smrgm4_define([vers_have], [1.3.0])
13908ff16396Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
13918ff16396Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
13928ff16396Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
13938ff16396Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
13948ff16396Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
13958ff16396Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
13968ff16396Smrgm4_undefine([vers_have])
13978ff16396Smrgm4_undefine([maj_have])
13988ff16396Smrgm4_undefine([maj_needed])
13998ff16396Smrg]) # XORG_MACROS_VERSION
14008ff16396Smrg
14018ff16396Smrg# XORG_PROG_RAWCPP()
14028ff16396Smrg# ------------------
14038ff16396Smrg# Minimum version: 1.0.0
14048ff16396Smrg#
14058ff16396Smrg# Find cpp program and necessary flags for use in pre-processing text files
14068ff16396Smrg# such as man pages and config files
14078ff16396SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
14088ff16396SmrgAC_REQUIRE([AC_PROG_CPP])
14098ff16396SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
14108ff16396Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
14118ff16396Smrg
14128ff16396Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
14138ff16396Smrg# which is not the best choice for supporting other OS'es, but covers most
14148ff16396Smrg# of the ones we need for now.
14158ff16396SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
14168ff16396SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
14178ff16396Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
14188ff16396Smrg	AC_MSG_RESULT([no])
14198ff16396Smrgelse
14208ff16396Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
14218ff16396Smrg		RAWCPPFLAGS=-undef
14228ff16396Smrg		AC_MSG_RESULT([yes])
14238ff16396Smrg	# under Cygwin unix is still defined even with -undef
14248ff16396Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
14258ff16396Smrg		RAWCPPFLAGS="-undef -ansi"
14268ff16396Smrg		AC_MSG_RESULT([yes, with -ansi])
14278ff16396Smrg	else
14288ff16396Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
14298ff16396Smrg	fi
14308ff16396Smrgfi
14318ff16396Smrgrm -f conftest.$ac_ext
14320bd0e222Smrg
14338ff16396SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
14348ff16396SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
14358ff16396Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
14368ff16396Smrg	AC_MSG_RESULT([no])
14378ff16396Smrgelse
14388ff16396Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
14398ff16396Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
14408ff16396Smrg		AC_MSG_RESULT([yes])
14418ff16396Smrg	else
14428ff16396Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
14438ff16396Smrg	fi
14448ff16396Smrgfi
14458ff16396Smrgrm -f conftest.$ac_ext
14468ff16396SmrgAC_SUBST(RAWCPPFLAGS)
14478ff16396Smrg]) # XORG_PROG_RAWCPP
14480bd0e222Smrg
14498ff16396Smrg# XORG_MANPAGE_SECTIONS()
14508ff16396Smrg# -----------------------
14518ff16396Smrg# Minimum version: 1.0.0
14528ff16396Smrg#
14538ff16396Smrg# Determine which sections man pages go in for the different man page types
14548ff16396Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
14558ff16396Smrg# Not sure if there's any better way than just hardcoding by OS name.
14568ff16396Smrg# Override default settings by setting environment variables
14570bd0e222Smrg
14588ff16396SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
14598ff16396SmrgAC_REQUIRE([AC_CANONICAL_HOST])
14600bd0e222Smrg
14618ff16396Smrgif test x$APP_MAN_SUFFIX = x    ; then
14628ff16396Smrg    APP_MAN_SUFFIX=1
14638ff16396Smrgfi
14648ff16396Smrgif test x$APP_MAN_DIR = x    ; then
14658ff16396Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
14668ff16396Smrgfi
14670bd0e222Smrg
14688ff16396Smrgif test x$LIB_MAN_SUFFIX = x    ; then
14698ff16396Smrg    LIB_MAN_SUFFIX=3
14708ff16396Smrgfi
14718ff16396Smrgif test x$LIB_MAN_DIR = x    ; then
14728ff16396Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
14738ff16396Smrgfi
14740bd0e222Smrg
14758ff16396Smrgif test x$FILE_MAN_SUFFIX = x    ; then
14768ff16396Smrg    case $host_os in
14778ff16396Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
14788ff16396Smrg	*)		FILE_MAN_SUFFIX=5  ;;
14798ff16396Smrg    esac
14808ff16396Smrgfi
14818ff16396Smrgif test x$FILE_MAN_DIR = x    ; then
14828ff16396Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
14838ff16396Smrgfi
14840bd0e222Smrg
14858ff16396Smrgif test x$MISC_MAN_SUFFIX = x    ; then
14868ff16396Smrg    case $host_os in
14878ff16396Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
14888ff16396Smrg	*)		MISC_MAN_SUFFIX=7  ;;
14898ff16396Smrg    esac
14900bd0e222Smrgfi
14918ff16396Smrgif test x$MISC_MAN_DIR = x    ; then
14928ff16396Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
14930bd0e222Smrgfi
14940bd0e222Smrg
14958ff16396Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
14968ff16396Smrg    case $host_os in
14978ff16396Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
14988ff16396Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
14998ff16396Smrg    esac
15008ff16396Smrgfi
15018ff16396Smrgif test x$DRIVER_MAN_DIR = x    ; then
15028ff16396Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
15038ff16396Smrgfi
15040bd0e222Smrg
15058ff16396Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
15068ff16396Smrg    case $host_os in
15078ff16396Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
15088ff16396Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
15098ff16396Smrg    esac
15108ff16396Smrgfi
15118ff16396Smrgif test x$ADMIN_MAN_DIR = x    ; then
15128ff16396Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
15138ff16396Smrgfi
15140bd0e222Smrg
15150bd0e222Smrg
15168ff16396SmrgAC_SUBST([APP_MAN_SUFFIX])
15178ff16396SmrgAC_SUBST([LIB_MAN_SUFFIX])
15188ff16396SmrgAC_SUBST([FILE_MAN_SUFFIX])
15198ff16396SmrgAC_SUBST([MISC_MAN_SUFFIX])
15208ff16396SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
15218ff16396SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
15228ff16396SmrgAC_SUBST([APP_MAN_DIR])
15238ff16396SmrgAC_SUBST([LIB_MAN_DIR])
15248ff16396SmrgAC_SUBST([FILE_MAN_DIR])
15258ff16396SmrgAC_SUBST([MISC_MAN_DIR])
15268ff16396SmrgAC_SUBST([DRIVER_MAN_DIR])
15278ff16396SmrgAC_SUBST([ADMIN_MAN_DIR])
15288ff16396Smrg]) # XORG_MANPAGE_SECTIONS
15298ff16396Smrg
15308ff16396Smrg# XORG_CHECK_LINUXDOC
15318ff16396Smrg# -------------------
15328ff16396Smrg# Minimum version: 1.0.0
15338ff16396Smrg#
15348ff16396Smrg# Defines the variable MAKE_TEXT if the necessary tools and
15358ff16396Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
15368ff16396Smrg# Whether or not the necessary tools and files are found can be checked
15378ff16396Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
15388ff16396SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
15398ff16396Smrgif test x$XORG_SGML_PATH = x ; then
15408ff16396Smrg    XORG_SGML_PATH=$prefix/share/sgml
15418ff16396Smrgfi
15428ff16396SmrgHAVE_DEFS_ENT=
15430bd0e222Smrg
15448ff16396Smrgif test x"$cross_compiling" = x"yes" ; then
15458ff16396Smrg  HAVE_DEFS_ENT=no
15468ff16396Smrgelse
15478ff16396Smrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
15488ff16396Smrgfi
15490bd0e222Smrg
15508ff16396SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
15518ff16396SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
15520bd0e222Smrg
15538ff16396SmrgAC_MSG_CHECKING([Whether to build documentation])
15540bd0e222Smrg
15558ff16396Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
15568ff16396Smrg   BUILDDOC=yes
15570bd0e222Smrgelse
15588ff16396Smrg   BUILDDOC=no
15590bd0e222Smrgfi
15600bd0e222Smrg
15618ff16396SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
15620bd0e222Smrg
15638ff16396SmrgAC_MSG_RESULT([$BUILDDOC])
15640bd0e222Smrg
15658ff16396SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
15660bd0e222Smrg
15678ff16396Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
15688ff16396Smrg   BUILDPDFDOC=yes
15698ff16396Smrgelse
15708ff16396Smrg   BUILDPDFDOC=no
15718ff16396Smrgfi
15720bd0e222Smrg
15738ff16396SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
15740bd0e222Smrg
15758ff16396SmrgAC_MSG_RESULT([$BUILDPDFDOC])
15760bd0e222Smrg
15778ff16396SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
15788ff16396SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
15798ff16396SmrgMAKE_PDF="$PS2PDF"
15808ff16396SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
15810bd0e222Smrg
15828ff16396SmrgAC_SUBST(MAKE_TEXT)
15838ff16396SmrgAC_SUBST(MAKE_PS)
15848ff16396SmrgAC_SUBST(MAKE_PDF)
15858ff16396SmrgAC_SUBST(MAKE_HTML)
15868ff16396Smrg]) # XORG_CHECK_LINUXDOC
15878ff16396Smrg
15888ff16396Smrg# XORG_CHECK_DOCBOOK
15898ff16396Smrg# -------------------
15908ff16396Smrg# Minimum version: 1.0.0
15918ff16396Smrg#
15928ff16396Smrg# Checks for the ability to build output formats from SGML DocBook source.
15938ff16396Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
15948ff16396Smrg# indicates whether the necessary tools and files are found and, if set,
15958ff16396Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
15968ff16396SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
15978ff16396Smrgif test x$XORG_SGML_PATH = x ; then
15988ff16396Smrg    XORG_SGML_PATH=$prefix/share/sgml
15998ff16396Smrgfi
16008ff16396SmrgHAVE_DEFS_ENT=
16018ff16396SmrgBUILDTXTDOC=no
16028ff16396SmrgBUILDPDFDOC=no
16038ff16396SmrgBUILDPSDOC=no
16048ff16396SmrgBUILDHTMLDOC=no
16058ff16396Smrg
16068ff16396SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
16078ff16396Smrg
16088ff16396SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
16098ff16396SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
16108ff16396SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
16118ff16396SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
16128ff16396Smrg
16138ff16396SmrgAC_MSG_CHECKING([Whether to build text documentation])
16148ff16396Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
16158ff16396Smrg   test x$BUILD_TXTDOC != xno; then
16168ff16396Smrg	BUILDTXTDOC=yes
16178ff16396Smrgfi
16188ff16396SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
16198ff16396SmrgAC_MSG_RESULT([$BUILDTXTDOC])
16208ff16396Smrg
16218ff16396SmrgAC_MSG_CHECKING([Whether to build PDF documentation])
16228ff16396Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
16238ff16396Smrg   test x$BUILD_PDFDOC != xno; then
16248ff16396Smrg	BUILDPDFDOC=yes
16258ff16396Smrgfi
16268ff16396SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
16278ff16396SmrgAC_MSG_RESULT([$BUILDPDFDOC])
16288ff16396Smrg
16298ff16396SmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
16308ff16396Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
16318ff16396Smrg   test x$BUILD_PSDOC != xno; then
16328ff16396Smrg	BUILDPSDOC=yes
16338ff16396Smrgfi
16348ff16396SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
16358ff16396SmrgAC_MSG_RESULT([$BUILDPSDOC])
16368ff16396Smrg
16378ff16396SmrgAC_MSG_CHECKING([Whether to build HTML documentation])
16388ff16396Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
16398ff16396Smrg   test x$BUILD_HTMLDOC != xno; then
16408ff16396Smrg	BUILDHTMLDOC=yes
16418ff16396Smrgfi
16428ff16396SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
16438ff16396SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
16448ff16396Smrg
16458ff16396SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
16468ff16396SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
16478ff16396SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
16488ff16396SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
16498ff16396Smrg
16508ff16396SmrgAC_SUBST(MAKE_TEXT)
16518ff16396SmrgAC_SUBST(MAKE_PS)
16528ff16396SmrgAC_SUBST(MAKE_PDF)
16538ff16396SmrgAC_SUBST(MAKE_HTML)
16548ff16396Smrg]) # XORG_CHECK_DOCBOOK
16558ff16396Smrg
16568ff16396Smrg# XORG_CHECK_MALLOC_ZERO
16578ff16396Smrg# ----------------------
16588ff16396Smrg# Minimum version: 1.0.0
16598ff16396Smrg#
16608ff16396Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
16618ff16396Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
16628ff16396Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
16638ff16396SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
16648ff16396SmrgAC_ARG_ENABLE(malloc0returnsnull,
16658ff16396Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
16668ff16396Smrg		       [malloc(0) returns NULL (default: auto)]),
16678ff16396Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
16688ff16396Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
16698ff16396Smrg
16708ff16396SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
16718ff16396Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
16728ff16396Smrg	AC_RUN_IFELSE([
16738ff16396Smrgchar *malloc();
16748ff16396Smrgchar *realloc();
16758ff16396Smrgchar *calloc();
16768ff16396Smrgmain() {
16778ff16396Smrg    char *m0, *r0, *c0, *p;
16788ff16396Smrg    m0 = malloc(0);
16798ff16396Smrg    p = malloc(10);
16808ff16396Smrg    r0 = realloc(p,0);
16818ff16396Smrg    c0 = calloc(0);
16828ff16396Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
16838ff16396Smrg}],
16848ff16396Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
16858ff16396Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
16868ff16396Smrgfi
16878ff16396SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
16888ff16396Smrg
16898ff16396Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
16908ff16396Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
16918ff16396Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
16928ff16396Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
16938ff16396Smrgelse
16948ff16396Smrg	MALLOC_ZERO_CFLAGS=""
16958ff16396Smrg	XMALLOC_ZERO_CFLAGS=""
16968ff16396Smrg	XTMALLOC_ZERO_CFLAGS=""
16978ff16396Smrgfi
16988ff16396Smrg
16998ff16396SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
17008ff16396SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
17018ff16396SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
17028ff16396Smrg]) # XORG_CHECK_MALLOC_ZERO
17030bd0e222Smrg
17048ff16396Smrg# XORG_WITH_LINT()
17058ff16396Smrg# ----------------
17068ff16396Smrg# Minimum version: 1.1.0
17078ff16396Smrg#
17088ff16396Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint
17098ff16396Smrg# is specified.   (Use --with-lint=sparse for sparse.)
17108ff16396Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
17118ff16396Smrg# Sets $LINT_FLAGS to flags to pass to source checker
17128ff16396Smrg# Sets LINT automake conditional if enabled (default: disabled)
17138ff16396Smrg#
17148ff16396SmrgAC_DEFUN([XORG_WITH_LINT],[
17158ff16396Smrg
17168ff16396Smrg# Allow checking code with lint, sparse, etc.
17178ff16396SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
17188ff16396Smrg		[Use a lint-style source code checker (default: disabled)])],
17198ff16396Smrg		[use_lint=$withval], [use_lint=no])
17208ff16396Smrgif test "x$use_lint" = "xyes" ; then
17218ff16396Smrg	LINT="lint"
17228ff16396Smrgelse
17238ff16396Smrg	LINT="$use_lint"
17248ff16396Smrgfi
17258ff16396Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
17268ff16396Smrg    case $LINT in
17278ff16396Smrg	lint|*/lint)
17288ff16396Smrg	    case $host_os in
17298ff16396Smrg		solaris*)
17308ff16396Smrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
17318ff16396Smrg			;;
17328ff16396Smrg	    esac
17338ff16396Smrg	    ;;
17348ff16396Smrg    esac
17358ff16396Smrgfi
17368ff16396Smrg
17378ff16396SmrgAC_SUBST(LINT)
17388ff16396SmrgAC_SUBST(LINT_FLAGS)
17398ff16396SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
17408ff16396Smrg
17418ff16396Smrg]) # XORG_WITH_LINT
17428ff16396Smrg
17438ff16396Smrg# XORG_LINT_LIBRARY(LIBNAME)
17448ff16396Smrg# --------------------------
17458ff16396Smrg# Minimum version: 1.1.0
17468ff16396Smrg#
17478ff16396Smrg# Sets up flags for building lint libraries for checking programs that call
17488ff16396Smrg# functions in the library.
17498ff16396Smrg# Disabled by default, enable with --enable-lint-library
17508ff16396Smrg# Sets: 
17518ff16396Smrg#	@LINTLIB@		- name of lint library file to make
17528ff16396Smrg#	MAKE_LINT_LIB		- automake conditional
17538ff16396Smrg#
17548ff16396Smrg
17558ff16396SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
17568ff16396SmrgAC_REQUIRE([XORG_WITH_LINT])
17578ff16396Smrg# Build lint "library" for more indepth checks of programs calling this library
17588ff16396SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
17598ff16396Smrg	[Create lint library (default: disabled)])],
17608ff16396Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
17618ff16396Smrgif test "x$make_lint_lib" != "xno" ; then
17628ff16396Smrg	if test "x$LINT" = "xno" ; then
17638ff16396Smrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
17648ff16396Smrg	fi
17658ff16396Smrg	if test "x$make_lint_lib" = "xyes" ; then
17668ff16396Smrg		LINTLIB=llib-l$1.ln
17678ff16396Smrg	else
17688ff16396Smrg		LINTLIB=$make_lint_lib
17698ff16396Smrg	fi
17708ff16396Smrgfi
17718ff16396SmrgAC_SUBST(LINTLIB)
17728ff16396SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
17738ff16396Smrg
17748ff16396Smrg]) # XORG_LINT_LIBRARY
17758ff16396Smrg
17768ff16396Smrg# XORG_CWARNFLAGS
17778ff16396Smrg# ---------------
17788ff16396Smrg# Minimum version: 1.2.0
17798ff16396Smrg#
17808ff16396Smrg# Defines CWARNFLAGS to enable C compiler warnings.
17818ff16396Smrg#
17828ff16396SmrgAC_DEFUN([XORG_CWARNFLAGS], [
17838ff16396SmrgAC_REQUIRE([AC_PROG_CC])
17848ff16396Smrgif  test "x$GCC" = xyes ; then
17858ff16396Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
17868ff16396Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
17878ff16396Smrg-Wbad-function-cast"
17888ff16396Smrg    case `$CC -dumpversion` in
17898ff16396Smrg    3.4.* | 4.*)
17908ff16396Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
17918ff16396Smrg	;;
17928ff16396Smrg    esac
17938ff16396Smrgelse
17948ff16396Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
17958ff16396Smrg    if test "x$SUNCC" = "xyes"; then
17968ff16396Smrg	CWARNFLAGS="-v"
17978ff16396Smrg    fi
17988ff16396Smrgfi
17998ff16396SmrgAC_SUBST(CWARNFLAGS)
18008ff16396Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
18018ff16396Smrg]) # XORG_CWARNFLAGS
18028ff16396Smrg
18038ff16396Smrg# XORG_STRICT_OPTION
18048ff16396Smrg# -----------------------
18058ff16396Smrg# Minimum version: 1.3.0
18068ff16396Smrg#
18078ff16396Smrg# Add configure option to enable strict compilation
18088ff16396SmrgAC_DEFUN([XORG_STRICT_OPTION], [
18098ff16396SmrgAC_REQUIRE([AC_PROG_CC])
18108ff16396SmrgAC_REQUIRE([AC_PROG_CC_C99])
18118ff16396SmrgAC_REQUIRE([XORG_CWARNFLAGS])
18128ff16396Smrg
18138ff16396SmrgAC_ARG_ENABLE(strict-compilation,
18148ff16396Smrg			  AS_HELP_STRING([--enable-strict-compilation],
18158ff16396Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
18168ff16396Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
18178ff16396Smrgif test "x$STRICT_COMPILE" = "xyes"; then
18188ff16396Smrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
18198ff16396Smrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
18208ff16396Smrg	if test "x$GCC" = xyes ; then
18218ff16396Smrg		STRICT_CFLAGS="-pedantic -Werror"
18228ff16396Smrg	elif test "x$SUNCC" = "xyes"; then
18238ff16396Smrg		STRICT_CFLAGS="-errwarn"
18248ff16396Smrg    elif test "x$INTELCC" = "xyes"; then
18258ff16396Smrg		STRICT_CFLAGS="-Werror"
18268ff16396Smrg	fi
18278ff16396Smrgfi
18288ff16396SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
18298ff16396SmrgAC_SUBST([CWARNFLAGS])
18308ff16396Smrg]) # XORG_STRICT_OPTION
18318ff16396Smrg
18328ff16396Smrg# XORG_DEFAULT_OPTIONS
18338ff16396Smrg# --------------------
18348ff16396Smrg# Minimum version: 1.3.0
18358ff16396Smrg#
18368ff16396Smrg# Defines default options for X.Org modules.
18378ff16396Smrg#
18388ff16396SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
18398ff16396SmrgXORG_CWARNFLAGS
18408ff16396SmrgXORG_STRICT_OPTION
18418ff16396SmrgXORG_RELEASE_VERSION
18428ff16396SmrgXORG_CHANGELOG
18438ff16396SmrgXORG_MANPAGE_SECTIONS
18448ff16396Smrg]) # XORG_DEFAULT_OPTIONS
18450bd0e222Smrgdnl Copyright 2005 Red Hat, Inc
18460bd0e222Smrgdnl
18470bd0e222Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
18480bd0e222Smrgdnl documentation for any purpose is hereby granted without fee, provided that
18490bd0e222Smrgdnl the above copyright notice appear in all copies and that both that
18500bd0e222Smrgdnl copyright notice and this permission notice appear in supporting
18510bd0e222Smrgdnl documentation.
18520bd0e222Smrgdnl
18530bd0e222Smrgdnl The above copyright notice and this permission notice shall be included
18540bd0e222Smrgdnl in all copies or substantial portions of the Software.
18550bd0e222Smrgdnl
18560bd0e222Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18570bd0e222Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18580bd0e222Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18590bd0e222Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
18600bd0e222Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18610bd0e222Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
18620bd0e222Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
18630bd0e222Smrgdnl
18640bd0e222Smrgdnl Except as contained in this notice, the name of the copyright holders shall
18650bd0e222Smrgdnl not be used in advertising or otherwise to promote the sale, use or
18660bd0e222Smrgdnl other dealings in this Software without prior written authorization
18670bd0e222Smrgdnl from the copyright holders.
18680bd0e222Smrgdnl
18690bd0e222Smrg
18700bd0e222Smrg# XORG_RELEASE_VERSION
18710bd0e222Smrg# --------------------
18720bd0e222Smrg# Adds --with/without-release-string and changes the PACKAGE and
18730bd0e222Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
18748ff16396Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
18758ff16396Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
18760bd0e222Smrg 
18770bd0e222SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
18780bd0e222Smrg	AC_ARG_WITH(release-version,
18798ff16396Smrg			AS_HELP_STRING([--with-release-version=STRING],
18800bd0e222Smrg				[Use release version string in package name]),
18810bd0e222Smrg			[RELEASE_VERSION="$withval"],
18820bd0e222Smrg			[RELEASE_VERSION=""])
18830bd0e222Smrg	if test "x$RELEASE_VERSION" != "x"; then
18840bd0e222Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
18850bd0e222Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
18860bd0e222Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
18870bd0e222Smrg	fi
18888ff16396Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
18898ff16396Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
18908ff16396Smrg		[Major version of this package])
18918ff16396Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
18928ff16396Smrg	if test "x$PVM" = "x"; then
18938ff16396Smrg		PVM="0"
18948ff16396Smrg	fi
18958ff16396Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
18968ff16396Smrg		[$PVM],
18978ff16396Smrg		[Minor version of this package])
18988ff16396Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
18998ff16396Smrg	if test "x$PVP" = "x"; then
19008ff16396Smrg		PVP="0"
19018ff16396Smrg	fi
19028ff16396Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
19038ff16396Smrg		[$PVP],
19048ff16396Smrg		[Patch version of this package])
19050bd0e222Smrg])
19060bd0e222Smrg
19078ff16396Smrg# XORG_CHANGELOG()
19088ff16396Smrg# ----------------
19098ff16396Smrg# Minimum version: 1.2.0
19108ff16396Smrg#
19118ff16396Smrg# Defines the variable CHANGELOG_CMD as the command to generate
19128ff16396Smrg# ChangeLog from git.
19138ff16396Smrg#
19148ff16396Smrg# Arrange that distcleancheck ignores ChangeLog left over by distclean.
19158ff16396Smrg#
19168ff16396SmrgAC_DEFUN([XORG_CHANGELOG], [
19178ff16396SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
19188ff16396Smrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
19198ff16396Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
19208ff16396SmrgAC_SUBST([CHANGELOG_CMD])
19218ff16396SmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
19228ff16396Smrg]) # XORG_CHANGELOG
19238ff16396Smrg
19248ff16396Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
19258ff16396Smrg# 
19268ff16396Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
19278ff16396Smrg#
19288ff16396Smrg# This program is free software; you can redistribute it and/or modify
19298ff16396Smrg# it under the terms of the GNU General Public License as published by
19308ff16396Smrg# the Free Software Foundation; either version 2 of the License, or
19318ff16396Smrg# (at your option) any later version.
19328ff16396Smrg#
19338ff16396Smrg# This program is distributed in the hope that it will be useful, but
19348ff16396Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
19358ff16396Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19368ff16396Smrg# General Public License for more details.
19378ff16396Smrg#
19388ff16396Smrg# You should have received a copy of the GNU General Public License
19398ff16396Smrg# along with this program; if not, write to the Free Software
19408ff16396Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19418ff16396Smrg#
19428ff16396Smrg# As a special exception to the GNU General Public License, if you
19438ff16396Smrg# distribute this file as part of a program that contains a
19448ff16396Smrg# configuration script generated by Autoconf, you may include it under
19458ff16396Smrg# the same distribution terms that you use for the rest of that program.
19468ff16396Smrg
19478ff16396Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
19488ff16396Smrg# ----------------------------------
19498ff16396SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
19508ff16396Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
19518ff16396Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
19528ff16396SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
19538ff16396Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
19548ff16396Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
19558ff16396Smrgfi
19568ff16396Smrgif test -n "$PKG_CONFIG"; then
19578ff16396Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
19588ff16396Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
19598ff16396Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
19608ff16396Smrg		AC_MSG_RESULT([yes])
19618ff16396Smrg	else
19628ff16396Smrg		AC_MSG_RESULT([no])
19638ff16396Smrg		PKG_CONFIG=""
19648ff16396Smrg	fi
19658ff16396Smrg		
19668ff16396Smrgfi[]dnl
19678ff16396Smrg])# PKG_PROG_PKG_CONFIG
19688ff16396Smrg
19698ff16396Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
19708ff16396Smrg#
19718ff16396Smrg# Check to see whether a particular set of modules exists.  Similar
19728ff16396Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
19738ff16396Smrg#
19748ff16396Smrg#
19758ff16396Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
19768ff16396Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
19778ff16396Smrg# PKG_CHECK_EXISTS manually
19788ff16396Smrg# --------------------------------------------------------------
19798ff16396SmrgAC_DEFUN([PKG_CHECK_EXISTS],
19808ff16396Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
19818ff16396Smrgif test -n "$PKG_CONFIG" && \
19828ff16396Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
19838ff16396Smrg  m4_ifval([$2], [$2], [:])
19848ff16396Smrgm4_ifvaln([$3], [else
19858ff16396Smrg  $3])dnl
19868ff16396Smrgfi])
19878ff16396Smrg
19888ff16396Smrg
19898ff16396Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
19908ff16396Smrg# ---------------------------------------------
19918ff16396Smrgm4_define([_PKG_CONFIG],
19928ff16396Smrg[if test -n "$$1"; then
19938ff16396Smrg    pkg_cv_[]$1="$$1"
19948ff16396Smrg elif test -n "$PKG_CONFIG"; then
19958ff16396Smrg    PKG_CHECK_EXISTS([$3],
19968ff16396Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
19978ff16396Smrg		     [pkg_failed=yes])
19988ff16396Smrg else
19998ff16396Smrg    pkg_failed=untried
20008ff16396Smrgfi[]dnl
20018ff16396Smrg])# _PKG_CONFIG
20028ff16396Smrg
20038ff16396Smrg# _PKG_SHORT_ERRORS_SUPPORTED
20048ff16396Smrg# -----------------------------
20058ff16396SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
20068ff16396Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
20078ff16396Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
20088ff16396Smrg        _pkg_short_errors_supported=yes
20098ff16396Smrgelse
20108ff16396Smrg        _pkg_short_errors_supported=no
20118ff16396Smrgfi[]dnl
20128ff16396Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
20138ff16396Smrg
20148ff16396Smrg
20158ff16396Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
20168ff16396Smrg# [ACTION-IF-NOT-FOUND])
20178ff16396Smrg#
20188ff16396Smrg#
20198ff16396Smrg# Note that if there is a possibility the first call to
20208ff16396Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
20218ff16396Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
20228ff16396Smrg#
20238ff16396Smrg#
20248ff16396Smrg# --------------------------------------------------------------
20258ff16396SmrgAC_DEFUN([PKG_CHECK_MODULES],
20268ff16396Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
20278ff16396SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
20288ff16396SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
20298ff16396Smrg
20308ff16396Smrgpkg_failed=no
20318ff16396SmrgAC_MSG_CHECKING([for $1])
20328ff16396Smrg
20338ff16396Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
20348ff16396Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
20358ff16396Smrg
20368ff16396Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
20378ff16396Smrgand $1[]_LIBS to avoid the need to call pkg-config.
20388ff16396SmrgSee the pkg-config man page for more details.])
20398ff16396Smrg
20408ff16396Smrgif test $pkg_failed = yes; then
20418ff16396Smrg        _PKG_SHORT_ERRORS_SUPPORTED
20428ff16396Smrg        if test $_pkg_short_errors_supported = yes; then
20438ff16396Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
20448ff16396Smrg        else 
20458ff16396Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
20468ff16396Smrg        fi
20478ff16396Smrg	# Put the nasty error message in config.log where it belongs
20488ff16396Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
20498ff16396Smrg
20508ff16396Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
20518ff16396Smrg[Package requirements ($2) were not met:
20528ff16396Smrg
20538ff16396Smrg$$1_PKG_ERRORS
20548ff16396Smrg
20558ff16396SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
20568ff16396Smrginstalled software in a non-standard prefix.
20578ff16396Smrg
20588ff16396Smrg_PKG_TEXT
20598ff16396Smrg])],
20608ff16396Smrg		[AC_MSG_RESULT([no])
20618ff16396Smrg                $4])
20628ff16396Smrgelif test $pkg_failed = untried; then
20638ff16396Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
20648ff16396Smrg[The pkg-config script could not be found or is too old.  Make sure it
20658ff16396Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
20668ff16396Smrgpath to pkg-config.
20678ff16396Smrg
20688ff16396Smrg_PKG_TEXT
20698ff16396Smrg
20708ff16396SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
20718ff16396Smrg		[$4])
20728ff16396Smrgelse
20738ff16396Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
20748ff16396Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
20758ff16396Smrg        AC_MSG_RESULT([yes])
20768ff16396Smrg	ifelse([$3], , :, [$3])
20778ff16396Smrgfi[]dnl
20788ff16396Smrg])# PKG_CHECK_MODULES
20798ff16396Smrg
2080