aclocal.m4 revision 8255a313
18255a313Smrg# generated automatically by aclocal 1.11 -*- Autoconf -*-
292bb16f8Smrg
392bb16f8Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
48255a313Smrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
592bb16f8Smrg# This file is free software; the Free Software Foundation
692bb16f8Smrg# gives unlimited permission to copy and/or distribute it,
792bb16f8Smrg# with or without modifications, as long as this notice is preserved.
892bb16f8Smrg
992bb16f8Smrg# This program is distributed in the hope that it will be useful,
1092bb16f8Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1192bb16f8Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1292bb16f8Smrg# PARTICULAR PURPOSE.
1392bb16f8Smrg
148255a313Smrgm4_ifndef([AC_AUTOCONF_VERSION],
158255a313Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
168255a313Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
178255a313Smrg[m4_warning([this file was generated for autoconf 2.63.
188255a313SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
198255a313SmrgIf you have problems, you may need to regenerate the build system entirely.
208255a313SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
2192bb16f8Smrg
228255a313Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
2392bb16f8Smrg#
2492bb16f8Smrg# This file is free software; the Free Software Foundation
2592bb16f8Smrg# gives unlimited permission to copy and/or distribute it,
2692bb16f8Smrg# with or without modifications, as long as this notice is preserved.
2792bb16f8Smrg
2892bb16f8Smrg# AM_AUTOMAKE_VERSION(VERSION)
2992bb16f8Smrg# ----------------------------
3092bb16f8Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
3192bb16f8Smrg# generated from the m4 files accompanying Automake X.Y.
328255a313Smrg# (This private macro should not be called outside this file.)
338255a313SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
348255a313Smrg[am__api_version='1.11'
358255a313Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
368255a313Smrgdnl require some minimum version.  Point them to the right macro.
378255a313Smrgm4_if([$1], [1.11], [],
388255a313Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
398255a313Smrg])
408255a313Smrg
418255a313Smrg# _AM_AUTOCONF_VERSION(VERSION)
428255a313Smrg# -----------------------------
438255a313Smrg# aclocal traces this macro to find the Autoconf version.
448255a313Smrg# This is a private macro too.  Using m4_define simplifies
458255a313Smrg# the logic in aclocal, which can simply ignore this definition.
468255a313Smrgm4_define([_AM_AUTOCONF_VERSION], [])
4792bb16f8Smrg
4892bb16f8Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
4992bb16f8Smrg# -------------------------------
508255a313Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
518255a313Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
5292bb16f8SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
538255a313Smrg[AM_AUTOMAKE_VERSION([1.11])dnl
548255a313Smrgm4_ifndef([AC_AUTOCONF_VERSION],
558255a313Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
568255a313Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
5792bb16f8Smrg
5892bb16f8Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
5992bb16f8Smrg
6092bb16f8Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
6192bb16f8Smrg#
6292bb16f8Smrg# This file is free software; the Free Software Foundation
6392bb16f8Smrg# gives unlimited permission to copy and/or distribute it,
6492bb16f8Smrg# with or without modifications, as long as this notice is preserved.
6592bb16f8Smrg
6692bb16f8Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
6792bb16f8Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
6892bb16f8Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
6992bb16f8Smrg#
7092bb16f8Smrg# Of course, Automake must honor this variable whenever it calls a
7192bb16f8Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
7292bb16f8Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
7392bb16f8Smrg# depending on how configure is run.  This is pretty annoying, since
7492bb16f8Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
7592bb16f8Smrg# source directory, any form will work fine, but in subdirectories a
7692bb16f8Smrg# relative path needs to be adjusted first.
7792bb16f8Smrg#
7892bb16f8Smrg# $ac_aux_dir/missing
7992bb16f8Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
8092bb16f8Smrg# $top_srcdir/$ac_aux_dir/missing
8192bb16f8Smrg#    fails if $ac_aux_dir is absolute,
8292bb16f8Smrg#    fails when called from a subdirectory in a VPATH build with
8392bb16f8Smrg#          a relative $ac_aux_dir
8492bb16f8Smrg#
8592bb16f8Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
8692bb16f8Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
8792bb16f8Smrg# harmless because $srcdir is `.', but things will broke when you
8892bb16f8Smrg# start a VPATH build or use an absolute $srcdir.
8992bb16f8Smrg#
9092bb16f8Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
9192bb16f8Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
9292bb16f8Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
9392bb16f8Smrg# and then we would define $MISSING as
9492bb16f8Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
9592bb16f8Smrg# This will work as long as MISSING is not called from configure, because
9692bb16f8Smrg# unfortunately $(top_srcdir) has no meaning in configure.
9792bb16f8Smrg# However there are other variables, like CC, which are often used in
9892bb16f8Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
9992bb16f8Smrg#
10092bb16f8Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
10192bb16f8Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
10292bb16f8Smrg# configured tree to be moved without reconfiguration.
10392bb16f8Smrg
10492bb16f8SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
10592bb16f8Smrg[dnl Rely on autoconf to set up CDPATH properly.
10692bb16f8SmrgAC_PREREQ([2.50])dnl
10792bb16f8Smrg# expand $ac_aux_dir to an absolute path
10892bb16f8Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
10992bb16f8Smrg])
11092bb16f8Smrg
11192bb16f8Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
11292bb16f8Smrg
1138255a313Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
11492bb16f8Smrg# Free Software Foundation, Inc.
11592bb16f8Smrg#
11692bb16f8Smrg# This file is free software; the Free Software Foundation
11792bb16f8Smrg# gives unlimited permission to copy and/or distribute it,
11892bb16f8Smrg# with or without modifications, as long as this notice is preserved.
11992bb16f8Smrg
1208255a313Smrg# serial 9
12192bb16f8Smrg
12292bb16f8Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
12392bb16f8Smrg# -------------------------------------
12492bb16f8Smrg# Define a conditional.
12592bb16f8SmrgAC_DEFUN([AM_CONDITIONAL],
12692bb16f8Smrg[AC_PREREQ(2.52)dnl
12792bb16f8Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
12892bb16f8Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1298255a313SmrgAC_SUBST([$1_TRUE])dnl
1308255a313SmrgAC_SUBST([$1_FALSE])dnl
1318255a313Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
1328255a313Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
1338255a313Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
13492bb16f8Smrgif $2; then
13592bb16f8Smrg  $1_TRUE=
13692bb16f8Smrg  $1_FALSE='#'
13792bb16f8Smrgelse
13892bb16f8Smrg  $1_TRUE='#'
13992bb16f8Smrg  $1_FALSE=
14092bb16f8Smrgfi
14192bb16f8SmrgAC_CONFIG_COMMANDS_PRE(
14292bb16f8Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
14392bb16f8Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
14492bb16f8SmrgUsually this means the macro was only invoked conditionally.]])
14592bb16f8Smrgfi])])
14692bb16f8Smrg
1478255a313Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
1488255a313Smrg# Free Software Foundation, Inc.
1498255a313Smrg#
1508255a313Smrg# This file is free software; the Free Software Foundation
1518255a313Smrg# gives unlimited permission to copy and/or distribute it,
1528255a313Smrg# with or without modifications, as long as this notice is preserved.
1538255a313Smrg
1548255a313Smrg# serial 10
1558255a313Smrg
1568255a313Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1578255a313Smrg# written in clear, in which case automake, when reading aclocal.m4,
1588255a313Smrg# will think it sees a *use*, and therefore will trigger all it's
1598255a313Smrg# C support machinery.  Also note that it means that autoscan, seeing
1608255a313Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1618255a313Smrg
16292bb16f8Smrg
1638255a313Smrg# _AM_DEPENDENCIES(NAME)
1648255a313Smrg# ----------------------
1658255a313Smrg# See how the compiler implements dependency checking.
1668255a313Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
1678255a313Smrg# We try a few techniques and use that to set a single cache variable.
1688255a313Smrg#
1698255a313Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1708255a313Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1718255a313Smrg# dependency, and given that the user is not expected to run this macro,
1728255a313Smrg# just rely on AC_PROG_CC.
1738255a313SmrgAC_DEFUN([_AM_DEPENDENCIES],
1748255a313Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
1758255a313SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1768255a313SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
1778255a313SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1788255a313Smrg
1798255a313Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
1808255a313Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
1818255a313Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1828255a313Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
1838255a313Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1848255a313Smrg                   [depcc="$$1"   am_compiler_list=])
1858255a313Smrg
1868255a313SmrgAC_CACHE_CHECK([dependency style of $depcc],
1878255a313Smrg               [am_cv_$1_dependencies_compiler_type],
1888255a313Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1898255a313Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
1908255a313Smrg  # making bogus files that we don't know about and never remove.  For
1918255a313Smrg  # instance it was reported that on HP-UX the gcc test will end up
1928255a313Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
1938255a313Smrg  # in D'.
1948255a313Smrg  mkdir conftest.dir
1958255a313Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
1968255a313Smrg  # using a relative directory.
1978255a313Smrg  cp "$am_depcomp" conftest.dir
1988255a313Smrg  cd conftest.dir
1998255a313Smrg  # We will build objects and dependencies in a subdirectory because
2008255a313Smrg  # it helps to detect inapplicable dependency modes.  For instance
2018255a313Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
2028255a313Smrg  # side effect of compilation, but ICC will put the dependencies in
2038255a313Smrg  # the current directory while Tru64 will put them in the object
2048255a313Smrg  # directory.
2058255a313Smrg  mkdir sub
2068255a313Smrg
2078255a313Smrg  am_cv_$1_dependencies_compiler_type=none
2088255a313Smrg  if test "$am_compiler_list" = ""; then
2098255a313Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2108255a313Smrg  fi
2118255a313Smrg  am__universal=false
2128255a313Smrg  m4_case([$1], [CC],
2138255a313Smrg    [case " $depcc " in #(
2148255a313Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2158255a313Smrg     esac],
2168255a313Smrg    [CXX],
2178255a313Smrg    [case " $depcc " in #(
2188255a313Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2198255a313Smrg     esac])
2208255a313Smrg
2218255a313Smrg  for depmode in $am_compiler_list; do
2228255a313Smrg    # Setup a source with many dependencies, because some compilers
2238255a313Smrg    # like to wrap large dependency lists on column 80 (with \), and
2248255a313Smrg    # we should not choose a depcomp mode which is confused by this.
2258255a313Smrg    #
2268255a313Smrg    # We need to recreate these files for each test, as the compiler may
2278255a313Smrg    # overwrite some of them when testing with obscure command lines.
2288255a313Smrg    # This happens at least with the AIX C compiler.
2298255a313Smrg    : > sub/conftest.c
2308255a313Smrg    for i in 1 2 3 4 5 6; do
2318255a313Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
2328255a313Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
2338255a313Smrg      # Solaris 8's {/usr,}/bin/sh.
2348255a313Smrg      touch sub/conftst$i.h
2358255a313Smrg    done
2368255a313Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2378255a313Smrg
2388255a313Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
2398255a313Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
2408255a313Smrg    # handle `-M -o', and we need to detect this.  Also, some Intel
2418255a313Smrg    # versions had trouble with output in subdirs
2428255a313Smrg    am__obj=sub/conftest.${OBJEXT-o}
2438255a313Smrg    am__minus_obj="-o $am__obj"
2448255a313Smrg    case $depmode in
2458255a313Smrg    gcc)
2468255a313Smrg      # This depmode causes a compiler race in universal mode.
2478255a313Smrg      test "$am__universal" = false || continue
2488255a313Smrg      ;;
2498255a313Smrg    nosideeffect)
2508255a313Smrg      # after this tag, mechanisms are not by side-effect, so they'll
2518255a313Smrg      # only be used when explicitly requested
2528255a313Smrg      if test "x$enable_dependency_tracking" = xyes; then
2538255a313Smrg	continue
2548255a313Smrg      else
2558255a313Smrg	break
2568255a313Smrg      fi
2578255a313Smrg      ;;
2588255a313Smrg    msvisualcpp | msvcmsys)
2598255a313Smrg      # This compiler won't grok `-c -o', but also, the minuso test has
2608255a313Smrg      # not run yet.  These depmodes are late enough in the game, and
2618255a313Smrg      # so weak that their functioning should not be impacted.
2628255a313Smrg      am__obj=conftest.${OBJEXT-o}
2638255a313Smrg      am__minus_obj=
2648255a313Smrg      ;;
2658255a313Smrg    none) break ;;
2668255a313Smrg    esac
2678255a313Smrg    if depmode=$depmode \
2688255a313Smrg       source=sub/conftest.c object=$am__obj \
2698255a313Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
2708255a313Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
2718255a313Smrg         >/dev/null 2>conftest.err &&
2728255a313Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
2738255a313Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
2748255a313Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
2758255a313Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
2768255a313Smrg      # icc doesn't choke on unknown options, it will just issue warnings
2778255a313Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
2788255a313Smrg      # that says an option was ignored or not supported.
2798255a313Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
2808255a313Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
2818255a313Smrg      # The diagnosis changed in icc 8.0:
2828255a313Smrg      #   icc: Command line remark: option '-MP' not supported
2838255a313Smrg      if (grep 'ignoring option' conftest.err ||
2848255a313Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
2858255a313Smrg        am_cv_$1_dependencies_compiler_type=$depmode
2868255a313Smrg        break
2878255a313Smrg      fi
2888255a313Smrg    fi
2898255a313Smrg  done
2908255a313Smrg
2918255a313Smrg  cd ..
2928255a313Smrg  rm -rf conftest.dir
2938255a313Smrgelse
2948255a313Smrg  am_cv_$1_dependencies_compiler_type=none
2958255a313Smrgfi
2968255a313Smrg])
2978255a313SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
2988255a313SmrgAM_CONDITIONAL([am__fastdep$1], [
2998255a313Smrg  test "x$enable_dependency_tracking" != xno \
3008255a313Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
3018255a313Smrg])
3028255a313Smrg
3038255a313Smrg
3048255a313Smrg# AM_SET_DEPDIR
3058255a313Smrg# -------------
3068255a313Smrg# Choose a directory name for dependency files.
3078255a313Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
3088255a313SmrgAC_DEFUN([AM_SET_DEPDIR],
3098255a313Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
3108255a313SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
3118255a313Smrg])
3128255a313Smrg
3138255a313Smrg
3148255a313Smrg# AM_DEP_TRACK
3158255a313Smrg# ------------
3168255a313SmrgAC_DEFUN([AM_DEP_TRACK],
3178255a313Smrg[AC_ARG_ENABLE(dependency-tracking,
3188255a313Smrg[  --disable-dependency-tracking  speeds up one-time build
3198255a313Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
3208255a313Smrgif test "x$enable_dependency_tracking" != xno; then
3218255a313Smrg  am_depcomp="$ac_aux_dir/depcomp"
3228255a313Smrg  AMDEPBACKSLASH='\'
3238255a313Smrgfi
3248255a313SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
3258255a313SmrgAC_SUBST([AMDEPBACKSLASH])dnl
3268255a313Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
3278255a313Smrg])
3288255a313Smrg
3298255a313Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
3308255a313Smrg
3318255a313Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
33292bb16f8Smrg# Free Software Foundation, Inc.
33392bb16f8Smrg#
33492bb16f8Smrg# This file is free software; the Free Software Foundation
33592bb16f8Smrg# gives unlimited permission to copy and/or distribute it,
33692bb16f8Smrg# with or without modifications, as long as this notice is preserved.
33792bb16f8Smrg
3388255a313Smrg#serial 5
3398255a313Smrg
3408255a313Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
3418255a313Smrg# ------------------------------
3428255a313SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
3438255a313Smrg[{
3448255a313Smrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
3458255a313Smrg  # are listed without --file.  Let's play safe and only enable the eval
3468255a313Smrg  # if we detect the quoting.
3478255a313Smrg  case $CONFIG_FILES in
3488255a313Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
3498255a313Smrg  *)   set x $CONFIG_FILES ;;
3508255a313Smrg  esac
3518255a313Smrg  shift
3528255a313Smrg  for mf
3538255a313Smrg  do
3548255a313Smrg    # Strip MF so we end up with the name of the file.
3558255a313Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
3568255a313Smrg    # Check whether this is an Automake generated Makefile or not.
3578255a313Smrg    # We used to match only the files named `Makefile.in', but
3588255a313Smrg    # some people rename them; so instead we look at the file content.
3598255a313Smrg    # Grep'ing the first line is not enough: some people post-process
3608255a313Smrg    # each Makefile.in and add a new line on top of each file to say so.
3618255a313Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
3628255a313Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
3638255a313Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
3648255a313Smrg      dirpart=`AS_DIRNAME("$mf")`
3658255a313Smrg    else
3668255a313Smrg      continue
3678255a313Smrg    fi
3688255a313Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
3698255a313Smrg    # from the Makefile without running `make'.
3708255a313Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
3718255a313Smrg    test -z "$DEPDIR" && continue
3728255a313Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
3738255a313Smrg    test -z "am__include" && continue
3748255a313Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
3758255a313Smrg    # When using ansi2knr, U may be empty or an underscore; expand it
3768255a313Smrg    U=`sed -n 's/^U = //p' < "$mf"`
3778255a313Smrg    # Find all dependency output files, they are included files with
3788255a313Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
3798255a313Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
3808255a313Smrg    # expansion.
3818255a313Smrg    for file in `sed -n "
3828255a313Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
3838255a313Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
3848255a313Smrg      # Make sure the directory exists.
3858255a313Smrg      test -f "$dirpart/$file" && continue
3868255a313Smrg      fdir=`AS_DIRNAME(["$file"])`
3878255a313Smrg      AS_MKDIR_P([$dirpart/$fdir])
3888255a313Smrg      # echo "creating $dirpart/$file"
3898255a313Smrg      echo '# dummy' > "$dirpart/$file"
3908255a313Smrg    done
3918255a313Smrg  done
3928255a313Smrg}
3938255a313Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
3948255a313Smrg
3958255a313Smrg
3968255a313Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
3978255a313Smrg# -----------------------------
3988255a313Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
3998255a313Smrg#
4008255a313Smrg# This code is only required when automatic dependency tracking
4018255a313Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
4028255a313Smrg# need in order to bootstrap the dependency handling code.
4038255a313SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
4048255a313Smrg[AC_CONFIG_COMMANDS([depfiles],
4058255a313Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
4068255a313Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
4078255a313Smrg])
4088255a313Smrg
4098255a313Smrg# Do all the work for Automake.                             -*- Autoconf -*-
4108255a313Smrg
4118255a313Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4128255a313Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
4138255a313Smrg#
4148255a313Smrg# This file is free software; the Free Software Foundation
4158255a313Smrg# gives unlimited permission to copy and/or distribute it,
4168255a313Smrg# with or without modifications, as long as this notice is preserved.
4178255a313Smrg
4188255a313Smrg# serial 16
41992bb16f8Smrg
42092bb16f8Smrg# This macro actually does too much.  Some checks are only needed if
42192bb16f8Smrg# your package does certain things.  But this isn't really a big deal.
42292bb16f8Smrg
42392bb16f8Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
42492bb16f8Smrg# AM_INIT_AUTOMAKE([OPTIONS])
42592bb16f8Smrg# -----------------------------------------------
42692bb16f8Smrg# The call with PACKAGE and VERSION arguments is the old style
42792bb16f8Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
42892bb16f8Smrg# and VERSION should now be passed to AC_INIT and removed from
42992bb16f8Smrg# the call to AM_INIT_AUTOMAKE.
43092bb16f8Smrg# We support both call styles for the transition.  After
43192bb16f8Smrg# the next Automake release, Autoconf can make the AC_INIT
43292bb16f8Smrg# arguments mandatory, and then we can depend on a new Autoconf
43392bb16f8Smrg# release and drop the old call support.
43492bb16f8SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
4358255a313Smrg[AC_PREREQ([2.62])dnl
43692bb16f8Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
43792bb16f8Smrgdnl the ones we care about.
43892bb16f8Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
43992bb16f8SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
44092bb16f8SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
4418255a313Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
4428255a313Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
4438255a313Smrg  # is not polluted with repeated "-I."
4448255a313Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
4458255a313Smrg  # test to see if srcdir already configured
4468255a313Smrg  if test -f $srcdir/config.status; then
4478255a313Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
4488255a313Smrg  fi
44992bb16f8Smrgfi
45092bb16f8Smrg
45192bb16f8Smrg# test whether we have cygpath
45292bb16f8Smrgif test -z "$CYGPATH_W"; then
45392bb16f8Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
45492bb16f8Smrg    CYGPATH_W='cygpath -w'
45592bb16f8Smrg  else
45692bb16f8Smrg    CYGPATH_W=echo
45792bb16f8Smrg  fi
45892bb16f8Smrgfi
45992bb16f8SmrgAC_SUBST([CYGPATH_W])
46092bb16f8Smrg
46192bb16f8Smrg# Define the identity of the package.
46292bb16f8Smrgdnl Distinguish between old-style and new-style calls.
46392bb16f8Smrgm4_ifval([$2],
46492bb16f8Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
46592bb16f8Smrg AC_SUBST([PACKAGE], [$1])dnl
46692bb16f8Smrg AC_SUBST([VERSION], [$2])],
46792bb16f8Smrg[_AM_SET_OPTIONS([$1])dnl
4688255a313Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
4698255a313Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
4708255a313Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
47192bb16f8Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
47292bb16f8Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
47392bb16f8Smrg
47492bb16f8Smrg_AM_IF_OPTION([no-define],,
47592bb16f8Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
47692bb16f8Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
47792bb16f8Smrg
47892bb16f8Smrg# Some tools Automake needs.
47992bb16f8SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
48092bb16f8SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
48192bb16f8SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
48292bb16f8SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
48392bb16f8SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
48492bb16f8SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
48592bb16f8SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
4868255a313SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
4878255a313SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
48892bb16f8SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
48992bb16f8Smrg# We need awk for the "check" target.  The system "awk" is bad on
49092bb16f8Smrg# some platforms.
49192bb16f8SmrgAC_REQUIRE([AC_PROG_AWK])dnl
49292bb16f8SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
49392bb16f8SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
49492bb16f8Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
4958255a313Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
4968255a313Smrg			     [_AM_PROG_TAR([v7])])])
49792bb16f8Smrg_AM_IF_OPTION([no-dependencies],,
49892bb16f8Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
4998255a313Smrg		  [_AM_DEPENDENCIES(CC)],
5008255a313Smrg		  [define([AC_PROG_CC],
5018255a313Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
50292bb16f8SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
5038255a313Smrg		  [_AM_DEPENDENCIES(CXX)],
5048255a313Smrg		  [define([AC_PROG_CXX],
5058255a313Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
5068255a313SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
5078255a313Smrg		  [_AM_DEPENDENCIES(OBJC)],
5088255a313Smrg		  [define([AC_PROG_OBJC],
5098255a313Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
51092bb16f8Smrg])
5118255a313Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
5128255a313Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
5138255a313Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
5148255a313Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
5158255a313SmrgAC_CONFIG_COMMANDS_PRE(dnl
5168255a313Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
5178255a313Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
51892bb16f8Smrg])
51992bb16f8Smrg
5208255a313Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
5218255a313Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
5228255a313Smrgdnl mangled by Autoconf and run in a shell conditional statement.
5238255a313Smrgm4_define([_AC_COMPILER_EXEEXT],
5248255a313Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
5258255a313Smrg
52692bb16f8Smrg
52792bb16f8Smrg# When config.status generates a header, we must update the stamp-h file.
52892bb16f8Smrg# This file resides in the same directory as the config header
52992bb16f8Smrg# that is generated.  The stamp files are numbered to have different names.
53092bb16f8Smrg
53192bb16f8Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
53292bb16f8Smrg# loop where config.status creates the headers, so we can generate
53392bb16f8Smrg# our stamp files there.
53492bb16f8SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
53592bb16f8Smrg[# Compute $1's index in $config_headers.
5368255a313Smrg_am_arg=$1
53792bb16f8Smrg_am_stamp_count=1
53892bb16f8Smrgfor _am_header in $config_headers :; do
53992bb16f8Smrg  case $_am_header in
5408255a313Smrg    $_am_arg | $_am_arg:* )
54192bb16f8Smrg      break ;;
54292bb16f8Smrg    * )
54392bb16f8Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
54492bb16f8Smrg  esac
54592bb16f8Smrgdone
5468255a313Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
54792bb16f8Smrg
5488255a313Smrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
54992bb16f8Smrg#
55092bb16f8Smrg# This file is free software; the Free Software Foundation
55192bb16f8Smrg# gives unlimited permission to copy and/or distribute it,
55292bb16f8Smrg# with or without modifications, as long as this notice is preserved.
55392bb16f8Smrg
55492bb16f8Smrg# AM_PROG_INSTALL_SH
55592bb16f8Smrg# ------------------
55692bb16f8Smrg# Define $install_sh.
55792bb16f8SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
55892bb16f8Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
5598255a313Smrgif test x"${install_sh}" != xset; then
5608255a313Smrg  case $am_aux_dir in
5618255a313Smrg  *\ * | *\	*)
5628255a313Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
5638255a313Smrg  *)
5648255a313Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
5658255a313Smrg  esac
5668255a313Smrgfi
56792bb16f8SmrgAC_SUBST(install_sh)])
56892bb16f8Smrg
56992bb16f8Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
57092bb16f8Smrg#
57192bb16f8Smrg# This file is free software; the Free Software Foundation
57292bb16f8Smrg# gives unlimited permission to copy and/or distribute it,
57392bb16f8Smrg# with or without modifications, as long as this notice is preserved.
57492bb16f8Smrg
57592bb16f8Smrg# serial 2
57692bb16f8Smrg
57792bb16f8Smrg# Check whether the underlying file-system supports filenames
57892bb16f8Smrg# with a leading dot.  For instance MS-DOS doesn't.
57992bb16f8SmrgAC_DEFUN([AM_SET_LEADING_DOT],
58092bb16f8Smrg[rm -rf .tst 2>/dev/null
58192bb16f8Smrgmkdir .tst 2>/dev/null
58292bb16f8Smrgif test -d .tst; then
58392bb16f8Smrg  am__leading_dot=.
58492bb16f8Smrgelse
58592bb16f8Smrg  am__leading_dot=_
58692bb16f8Smrgfi
58792bb16f8Smrgrmdir .tst 2>/dev/null
58892bb16f8SmrgAC_SUBST([am__leading_dot])])
58992bb16f8Smrg
5908255a313Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
5918255a313Smrg
5928255a313Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
5938255a313Smrg#
5948255a313Smrg# This file is free software; the Free Software Foundation
5958255a313Smrg# gives unlimited permission to copy and/or distribute it,
5968255a313Smrg# with or without modifications, as long as this notice is preserved.
5978255a313Smrg
5988255a313Smrg# serial 4
5998255a313Smrg
6008255a313Smrg# AM_MAKE_INCLUDE()
6018255a313Smrg# -----------------
6028255a313Smrg# Check to see how make treats includes.
6038255a313SmrgAC_DEFUN([AM_MAKE_INCLUDE],
6048255a313Smrg[am_make=${MAKE-make}
6058255a313Smrgcat > confinc << 'END'
6068255a313Smrgam__doit:
6078255a313Smrg	@echo this is the am__doit target
6088255a313Smrg.PHONY: am__doit
6098255a313SmrgEND
6108255a313Smrg# If we don't find an include directive, just comment out the code.
6118255a313SmrgAC_MSG_CHECKING([for style of include used by $am_make])
6128255a313Smrgam__include="#"
6138255a313Smrgam__quote=
6148255a313Smrg_am_result=none
6158255a313Smrg# First try GNU make style include.
6168255a313Smrgecho "include confinc" > confmf
6178255a313Smrg# Ignore all kinds of additional output from `make'.
6188255a313Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
6198255a313Smrg*the\ am__doit\ target*)
6208255a313Smrg  am__include=include
6218255a313Smrg  am__quote=
6228255a313Smrg  _am_result=GNU
6238255a313Smrg  ;;
6248255a313Smrgesac
6258255a313Smrg# Now try BSD make style include.
6268255a313Smrgif test "$am__include" = "#"; then
6278255a313Smrg   echo '.include "confinc"' > confmf
6288255a313Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
6298255a313Smrg   *the\ am__doit\ target*)
6308255a313Smrg     am__include=.include
6318255a313Smrg     am__quote="\""
6328255a313Smrg     _am_result=BSD
6338255a313Smrg     ;;
6348255a313Smrg   esac
6358255a313Smrgfi
6368255a313SmrgAC_SUBST([am__include])
6378255a313SmrgAC_SUBST([am__quote])
6388255a313SmrgAC_MSG_RESULT([$_am_result])
6398255a313Smrgrm -f confinc confmf
6408255a313Smrg])
6418255a313Smrg
64292bb16f8Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
64392bb16f8Smrg
6448255a313Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
64592bb16f8Smrg# Free Software Foundation, Inc.
64692bb16f8Smrg#
64792bb16f8Smrg# This file is free software; the Free Software Foundation
64892bb16f8Smrg# gives unlimited permission to copy and/or distribute it,
64992bb16f8Smrg# with or without modifications, as long as this notice is preserved.
65092bb16f8Smrg
6518255a313Smrg# serial 6
65292bb16f8Smrg
65392bb16f8Smrg# AM_MISSING_PROG(NAME, PROGRAM)
65492bb16f8Smrg# ------------------------------
65592bb16f8SmrgAC_DEFUN([AM_MISSING_PROG],
65692bb16f8Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
65792bb16f8Smrg$1=${$1-"${am_missing_run}$2"}
65892bb16f8SmrgAC_SUBST($1)])
65992bb16f8Smrg
66092bb16f8Smrg
66192bb16f8Smrg# AM_MISSING_HAS_RUN
66292bb16f8Smrg# ------------------
66392bb16f8Smrg# Define MISSING if not defined so far and test if it supports --run.
66492bb16f8Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
66592bb16f8SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
66692bb16f8Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
6678255a313SmrgAC_REQUIRE_AUX_FILE([missing])dnl
6688255a313Smrgif test x"${MISSING+set}" != xset; then
6698255a313Smrg  case $am_aux_dir in
6708255a313Smrg  *\ * | *\	*)
6718255a313Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
6728255a313Smrg  *)
6738255a313Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
6748255a313Smrg  esac
6758255a313Smrgfi
67692bb16f8Smrg# Use eval to expand $SHELL
67792bb16f8Smrgif eval "$MISSING --run true"; then
67892bb16f8Smrg  am_missing_run="$MISSING --run "
67992bb16f8Smrgelse
68092bb16f8Smrg  am_missing_run=
68192bb16f8Smrg  AC_MSG_WARN([`missing' script is too old or missing])
68292bb16f8Smrgfi
68392bb16f8Smrg])
68492bb16f8Smrg
6858255a313Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
68692bb16f8Smrg#
68792bb16f8Smrg# This file is free software; the Free Software Foundation
68892bb16f8Smrg# gives unlimited permission to copy and/or distribute it,
68992bb16f8Smrg# with or without modifications, as long as this notice is preserved.
69092bb16f8Smrg
69192bb16f8Smrg# AM_PROG_MKDIR_P
69292bb16f8Smrg# ---------------
6938255a313Smrg# Check for `mkdir -p'.
69492bb16f8SmrgAC_DEFUN([AM_PROG_MKDIR_P],
6958255a313Smrg[AC_PREREQ([2.60])dnl
6968255a313SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
6978255a313Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
6988255a313Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
6998255a313Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
7008255a313Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
7018255a313Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
7028255a313Smrgdnl adjustment using top_builddir (which is defined more often than
7038255a313Smrgdnl MKDIR_P).
7048255a313SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
7058255a313Smrgcase $mkdir_p in
7068255a313Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
7078255a313Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
7088255a313Smrgesac
7098255a313Smrg])
71092bb16f8Smrg
71192bb16f8Smrg# Helper functions for option handling.                     -*- Autoconf -*-
71292bb16f8Smrg
7138255a313Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
71492bb16f8Smrg#
71592bb16f8Smrg# This file is free software; the Free Software Foundation
71692bb16f8Smrg# gives unlimited permission to copy and/or distribute it,
71792bb16f8Smrg# with or without modifications, as long as this notice is preserved.
71892bb16f8Smrg
7198255a313Smrg# serial 4
72092bb16f8Smrg
72192bb16f8Smrg# _AM_MANGLE_OPTION(NAME)
72292bb16f8Smrg# -----------------------
72392bb16f8SmrgAC_DEFUN([_AM_MANGLE_OPTION],
72492bb16f8Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
72592bb16f8Smrg
72692bb16f8Smrg# _AM_SET_OPTION(NAME)
72792bb16f8Smrg# ------------------------------
72892bb16f8Smrg# Set option NAME.  Presently that only means defining a flag for this option.
72992bb16f8SmrgAC_DEFUN([_AM_SET_OPTION],
73092bb16f8Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
73192bb16f8Smrg
73292bb16f8Smrg# _AM_SET_OPTIONS(OPTIONS)
73392bb16f8Smrg# ----------------------------------
73492bb16f8Smrg# OPTIONS is a space-separated list of Automake options.
73592bb16f8SmrgAC_DEFUN([_AM_SET_OPTIONS],
7368255a313Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
73792bb16f8Smrg
73892bb16f8Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
73992bb16f8Smrg# -------------------------------------------
74092bb16f8Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
74192bb16f8SmrgAC_DEFUN([_AM_IF_OPTION],
74292bb16f8Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
74392bb16f8Smrg
74492bb16f8Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
74592bb16f8Smrg
7468255a313Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
74792bb16f8Smrg# Free Software Foundation, Inc.
74892bb16f8Smrg#
74992bb16f8Smrg# This file is free software; the Free Software Foundation
75092bb16f8Smrg# gives unlimited permission to copy and/or distribute it,
75192bb16f8Smrg# with or without modifications, as long as this notice is preserved.
75292bb16f8Smrg
7538255a313Smrg# serial 5
75492bb16f8Smrg
75592bb16f8Smrg# AM_SANITY_CHECK
75692bb16f8Smrg# ---------------
75792bb16f8SmrgAC_DEFUN([AM_SANITY_CHECK],
75892bb16f8Smrg[AC_MSG_CHECKING([whether build environment is sane])
75992bb16f8Smrg# Just in case
76092bb16f8Smrgsleep 1
76192bb16f8Smrgecho timestamp > conftest.file
7628255a313Smrg# Reject unsafe characters in $srcdir or the absolute working directory
7638255a313Smrg# name.  Accept space and tab only in the latter.
7648255a313Smrgam_lf='
7658255a313Smrg'
7668255a313Smrgcase `pwd` in
7678255a313Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
7688255a313Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
7698255a313Smrgesac
7708255a313Smrgcase $srcdir in
7718255a313Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
7728255a313Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
7738255a313Smrgesac
7748255a313Smrg
77592bb16f8Smrg# Do `set' in a subshell so we don't clobber the current shell's
77692bb16f8Smrg# arguments.  Must try -L first in case configure is actually a
77792bb16f8Smrg# symlink; some systems play weird games with the mod time of symlinks
77892bb16f8Smrg# (eg FreeBSD returns the mod time of the symlink's containing
77992bb16f8Smrg# directory).
78092bb16f8Smrgif (
7818255a313Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
78292bb16f8Smrg   if test "$[*]" = "X"; then
78392bb16f8Smrg      # -L didn't work.
7848255a313Smrg      set X `ls -t "$srcdir/configure" conftest.file`
78592bb16f8Smrg   fi
78692bb16f8Smrg   rm -f conftest.file
78792bb16f8Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
78892bb16f8Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
78992bb16f8Smrg
79092bb16f8Smrg      # If neither matched, then we have a broken ls.  This can happen
79192bb16f8Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
79292bb16f8Smrg      # broken ls alias from the environment.  This has actually
79392bb16f8Smrg      # happened.  Such a system could not be considered "sane".
79492bb16f8Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
79592bb16f8Smrgalias in your environment])
79692bb16f8Smrg   fi
79792bb16f8Smrg
79892bb16f8Smrg   test "$[2]" = conftest.file
79992bb16f8Smrg   )
80092bb16f8Smrgthen
80192bb16f8Smrg   # Ok.
80292bb16f8Smrg   :
80392bb16f8Smrgelse
80492bb16f8Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
80592bb16f8SmrgCheck your system clock])
80692bb16f8Smrgfi
80792bb16f8SmrgAC_MSG_RESULT(yes)])
80892bb16f8Smrg
8098255a313Smrg# Copyright (C) 2009  Free Software Foundation, Inc.
8108255a313Smrg#
8118255a313Smrg# This file is free software; the Free Software Foundation
8128255a313Smrg# gives unlimited permission to copy and/or distribute it,
8138255a313Smrg# with or without modifications, as long as this notice is preserved.
8148255a313Smrg
8158255a313Smrg# serial 1
8168255a313Smrg
8178255a313Smrg# AM_SILENT_RULES([DEFAULT])
8188255a313Smrg# --------------------------
8198255a313Smrg# Enable less verbose build rules; with the default set to DEFAULT
8208255a313Smrg# (`yes' being less verbose, `no' or empty being verbose).
8218255a313SmrgAC_DEFUN([AM_SILENT_RULES],
8228255a313Smrg[AC_ARG_ENABLE([silent-rules],
8238255a313Smrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
8248255a313Smrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
8258255a313Smrgcase $enable_silent_rules in
8268255a313Smrgyes) AM_DEFAULT_VERBOSITY=0;;
8278255a313Smrgno)  AM_DEFAULT_VERBOSITY=1;;
8288255a313Smrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
8298255a313Smrgesac
8308255a313SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
8318255a313SmrgAM_BACKSLASH='\'
8328255a313SmrgAC_SUBST([AM_BACKSLASH])dnl
8338255a313Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
8348255a313Smrg])
8358255a313Smrg
83692bb16f8Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
83792bb16f8Smrg#
83892bb16f8Smrg# This file is free software; the Free Software Foundation
83992bb16f8Smrg# gives unlimited permission to copy and/or distribute it,
84092bb16f8Smrg# with or without modifications, as long as this notice is preserved.
84192bb16f8Smrg
84292bb16f8Smrg# AM_PROG_INSTALL_STRIP
84392bb16f8Smrg# ---------------------
84492bb16f8Smrg# One issue with vendor `install' (even GNU) is that you can't
84592bb16f8Smrg# specify the program used to strip binaries.  This is especially
84692bb16f8Smrg# annoying in cross-compiling environments, where the build's strip
84792bb16f8Smrg# is unlikely to handle the host's binaries.
84892bb16f8Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
84992bb16f8Smrg# always use install-sh in `make install-strip', and initialize
85092bb16f8Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
85192bb16f8SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
85292bb16f8Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
85392bb16f8Smrg# Installed binaries are usually stripped using `strip' when the user
85492bb16f8Smrg# run `make install-strip'.  However `strip' might not be the right
85592bb16f8Smrg# tool to use in cross-compilation environments, therefore Automake
85692bb16f8Smrg# will honor the `STRIP' environment variable to overrule this program.
85792bb16f8Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
85892bb16f8Smrgif test "$cross_compiling" != no; then
85992bb16f8Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
86092bb16f8Smrgfi
8618255a313SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
86292bb16f8SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
86392bb16f8Smrg
8648255a313Smrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
8658255a313Smrg#
8668255a313Smrg# This file is free software; the Free Software Foundation
8678255a313Smrg# gives unlimited permission to copy and/or distribute it,
8688255a313Smrg# with or without modifications, as long as this notice is preserved.
8698255a313Smrg
8708255a313Smrg# serial 2
8718255a313Smrg
8728255a313Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
8738255a313Smrg# ---------------------------
8748255a313Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
8758255a313Smrg# This macro is traced by Automake.
8768255a313SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
8778255a313Smrg
8788255a313Smrg# AM_SUBST_NOTMAKE(VARIABLE)
8798255a313Smrg# ---------------------------
8808255a313Smrg# Public sister of _AM_SUBST_NOTMAKE.
8818255a313SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
8828255a313Smrg
88392bb16f8Smrg# Check how to create a tarball.                            -*- Autoconf -*-
88492bb16f8Smrg
88592bb16f8Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
88692bb16f8Smrg#
88792bb16f8Smrg# This file is free software; the Free Software Foundation
88892bb16f8Smrg# gives unlimited permission to copy and/or distribute it,
88992bb16f8Smrg# with or without modifications, as long as this notice is preserved.
89092bb16f8Smrg
89192bb16f8Smrg# serial 2
89292bb16f8Smrg
89392bb16f8Smrg# _AM_PROG_TAR(FORMAT)
89492bb16f8Smrg# --------------------
89592bb16f8Smrg# Check how to create a tarball in format FORMAT.
89692bb16f8Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
89792bb16f8Smrg#
89892bb16f8Smrg# Substitute a variable $(am__tar) that is a command
89992bb16f8Smrg# writing to stdout a FORMAT-tarball containing the directory
90092bb16f8Smrg# $tardir.
90192bb16f8Smrg#     tardir=directory && $(am__tar) > result.tar
90292bb16f8Smrg#
90392bb16f8Smrg# Substitute a variable $(am__untar) that extract such
90492bb16f8Smrg# a tarball read from stdin.
90592bb16f8Smrg#     $(am__untar) < result.tar
90692bb16f8SmrgAC_DEFUN([_AM_PROG_TAR],
90792bb16f8Smrg[# Always define AMTAR for backward compatibility.
90892bb16f8SmrgAM_MISSING_PROG([AMTAR], [tar])
90992bb16f8Smrgm4_if([$1], [v7],
91092bb16f8Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
91192bb16f8Smrg     [m4_case([$1], [ustar],, [pax],,
91292bb16f8Smrg              [m4_fatal([Unknown tar format])])
91392bb16f8SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
91492bb16f8Smrg# Loop over all known methods to create a tar archive until one works.
91592bb16f8Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
91692bb16f8Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
91792bb16f8Smrg# Do not fold the above two line into one, because Tru64 sh and
91892bb16f8Smrg# Solaris sh will not grok spaces in the rhs of `-'.
91992bb16f8Smrgfor _am_tool in $_am_tools
92092bb16f8Smrgdo
92192bb16f8Smrg  case $_am_tool in
92292bb16f8Smrg  gnutar)
92392bb16f8Smrg    for _am_tar in tar gnutar gtar;
92492bb16f8Smrg    do
92592bb16f8Smrg      AM_RUN_LOG([$_am_tar --version]) && break
92692bb16f8Smrg    done
92792bb16f8Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
92892bb16f8Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
92992bb16f8Smrg    am__untar="$_am_tar -xf -"
93092bb16f8Smrg    ;;
93192bb16f8Smrg  plaintar)
93292bb16f8Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
93392bb16f8Smrg    # ustar tarball either.
93492bb16f8Smrg    (tar --version) >/dev/null 2>&1 && continue
93592bb16f8Smrg    am__tar='tar chf - "$$tardir"'
93692bb16f8Smrg    am__tar_='tar chf - "$tardir"'
93792bb16f8Smrg    am__untar='tar xf -'
93892bb16f8Smrg    ;;
93992bb16f8Smrg  pax)
94092bb16f8Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
94192bb16f8Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
94292bb16f8Smrg    am__untar='pax -r'
94392bb16f8Smrg    ;;
94492bb16f8Smrg  cpio)
94592bb16f8Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
94692bb16f8Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
94792bb16f8Smrg    am__untar='cpio -i -H $1 -d'
94892bb16f8Smrg    ;;
94992bb16f8Smrg  none)
95092bb16f8Smrg    am__tar=false
95192bb16f8Smrg    am__tar_=false
95292bb16f8Smrg    am__untar=false
95392bb16f8Smrg    ;;
95492bb16f8Smrg  esac
95592bb16f8Smrg
95692bb16f8Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
95792bb16f8Smrg  # and am__untar set.
95892bb16f8Smrg  test -n "${am_cv_prog_tar_$1}" && break
95992bb16f8Smrg
96092bb16f8Smrg  # tar/untar a dummy directory, and stop if the command works
96192bb16f8Smrg  rm -rf conftest.dir
96292bb16f8Smrg  mkdir conftest.dir
96392bb16f8Smrg  echo GrepMe > conftest.dir/file
96492bb16f8Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
96592bb16f8Smrg  rm -rf conftest.dir
96692bb16f8Smrg  if test -s conftest.tar; then
96792bb16f8Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
96892bb16f8Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
96992bb16f8Smrg  fi
97092bb16f8Smrgdone
97192bb16f8Smrgrm -rf conftest.dir
97292bb16f8Smrg
97392bb16f8SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
97492bb16f8SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
97592bb16f8SmrgAC_SUBST([am__tar])
97692bb16f8SmrgAC_SUBST([am__untar])
97792bb16f8Smrg]) # _AM_PROG_TAR
97892bb16f8Smrg
9798255a313Smrgdnl fontutil.m4.  Generated from fontutil.m4.in by configure.
9808255a313Smrgdnl
9818255a313Smrgdnl This file comes from X.Org's font-util 1.1.0
9828255a313Smrgdnl
9838255a313Smrgdnl Copyright 2005 Red Hat, Inc
9848255a313Smrgdnl
9858255a313Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
9868255a313Smrgdnl documentation for any purpose is hereby granted without fee, provided that
9878255a313Smrgdnl the above copyright notice appear in all copies and that both that
9888255a313Smrgdnl copyright notice and this permission notice appear in supporting
9898255a313Smrgdnl documentation.
9908255a313Smrgdnl
9918255a313Smrgdnl The above copyright notice and this permission notice shall be included
9928255a313Smrgdnl in all copies or substantial portions of the Software.
9938255a313Smrgdnl
9948255a313Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
9958255a313Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
9968255a313Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
9978255a313Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
9988255a313Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
9998255a313Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
10008255a313Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
10018255a313Smrgdnl
10028255a313Smrgdnl Except as contained in this notice, the name of the copyright holders shall
10038255a313Smrgdnl not be used in advertising or otherwise to promote the sale, use or
10048255a313Smrgdnl other dealings in this Software without prior written authorization
10058255a313Smrgdnl from the copyright holders.
10068255a313Smrgdnl
10078255a313Smrgdnl --------------------------------------------------------------------
10088255a313Smrgdnl
10098255a313Smrgdnl Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
10108255a313Smrgdnl
10118255a313Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
10128255a313Smrgdnl copy of this software and associated documentation files (the
10138255a313Smrgdnl "Software"), to deal in the Software without restriction, including
10148255a313Smrgdnl without limitation the rights to use, copy, modify, merge, publish,
10158255a313Smrgdnl distribute, and/or sell copies of the Software, and to permit persons
10168255a313Smrgdnl to whom the Software is furnished to do so, provided that the above
10178255a313Smrgdnl copyright notice(s) and this permission notice appear in all copies of
10188255a313Smrgdnl the Software and that both the above copyright notice(s) and this
10198255a313Smrgdnl permission notice appear in supporting documentation.
10208255a313Smrgdnl
10218255a313Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
10228255a313Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
10238255a313Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
10248255a313Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
10258255a313Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
10268255a313Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
10278255a313Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
10288255a313Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
10298255a313Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
10308255a313Smrgdnl
10318255a313Smrgdnl Except as contained in this notice, the name of a copyright holder
10328255a313Smrgdnl shall not be used in advertising or otherwise to promote the sale, use
10338255a313Smrgdnl or other dealings in this Software without prior written authorization
10348255a313Smrgdnl of the copyright holder.
10358255a313Smrg
10368255a313Smrg# XORG_FONT_MACROS_VERSION(required-version)
10378255a313Smrg# ------------------------------------------
10388255a313Smrg# Minimum version: 1.1.0
10398255a313Smrg#
10408255a313Smrg# If you're using a macro added in Version 1.1 or newer, include this in
10418255a313Smrg# your configure.ac with the minimum required version, such as:
10428255a313Smrg# XORG_FONT_MACROS_VERSION(1.1)
10438255a313Smrg#
10448255a313Smrg# To ensure that this macro is defined, also add:
10458255a313Smrg# m4_ifndef([XORG_FONT_MACROS_VERSION],
10468255a313Smrg#     [m4_fatal([must install X.Org font-util 1.1 or later before running autoconf/autogen])])
10478255a313Smrg#
10488255a313Smrg#
10498255a313Smrg# See the "minimum version" comment for each macro you use to see what
10508255a313Smrg# version you require.
10518255a313Smrgm4_defun([XORG_FONT_MACROS_VERSION],[
10528255a313Smrgm4_define([vers_have], [1.1.0])
10538255a313Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
10548255a313Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
10558255a313Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
10568255a313Smrg    [m4_fatal([font-util major version ]maj_needed[ is required but ]vers_have[ found])])
10578255a313Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
10588255a313Smrg    [m4_fatal([font-util version $1 or higher is required but ]vers_have[ found])])
10598255a313Smrgm4_undefine([vers_have])
10608255a313Smrgm4_undefine([maj_have])
10618255a313Smrgm4_undefine([maj_needed])
10628255a313Smrg]) # XORG_FONT_MACROS_VERSION
10638255a313Smrg
10648255a313Smrg# XORG_FONT_CHECK_{maps}()
10658255a313Smrg# ------------------------
10668255a313Smrg# Minimum version: 1.0.0
10678255a313Smrg# These macros add --enable/disable-{maps} where {maps} are ISO8859-*,
10688255a313Smrg# JISX0201 or KOI8_R.  By default, they are all enabled.
10698255a313Smrg
10708255a313SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_1], [XORG_FONT_CHECK_ENCODING(ISO8859-1)])
10718255a313SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_2], [XORG_FONT_CHECK_ENCODING(ISO8859-2)])
10728255a313SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_3], [XORG_FONT_CHECK_ENCODING(ISO8859-3)])
10738255a313SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_4], [XORG_FONT_CHECK_ENCODING(ISO8859-4)])
10748255a313SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_5], [XORG_FONT_CHECK_ENCODING(ISO8859-5)])
10758255a313SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_6], [XORG_FONT_CHECK_ENCODING(ISO8859-6)])
10768255a313SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_7], [XORG_FONT_CHECK_ENCODING(ISO8859-7)])
10778255a313SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_8], [XORG_FONT_CHECK_ENCODING(ISO8859-8)])
10788255a313SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_9], [XORG_FONT_CHECK_ENCODING(ISO8859-9)])
10798255a313SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_10],[XORG_FONT_CHECK_ENCODING(ISO8859-10)])
10808255a313SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_11],[XORG_FONT_CHECK_ENCODING(ISO8859-11)])
10818255a313SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_12],[XORG_FONT_CHECK_ENCODING(ISO8859-12)])
10828255a313SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_13],[XORG_FONT_CHECK_ENCODING(ISO8859-13)])
10838255a313SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_14],[XORG_FONT_CHECK_ENCODING(ISO8859-14)])
10848255a313SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_15],[XORG_FONT_CHECK_ENCODING(ISO8859-15)])
10858255a313SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_16],[XORG_FONT_CHECK_ENCODING(ISO8859-16)])
10868255a313SmrgAC_DEFUN([XORG_FONT_CHECK_JISX0201],  [XORG_FONT_CHECK_ENCODING(JISX0201)])
10878255a313SmrgAC_DEFUN([XORG_FONT_CHECK_KOI8_R],    [XORG_FONT_CHECK_ENCODING(KOI8-R)])
10888255a313Smrg
10898255a313Smrg# XORG_FONT_CHECK_ENCODING(encoding)
10908255a313Smrg# ----------------------------------
10918255a313Smrg# Minimum version: 1.1.0
10928255a313Smrg# This macro adds --enable/disable-<encoding>, enabled by default.
10938255a313Smrg# It replaced individual copies of this code in the above macros in 1.1.
10948255a313Smrg# Currently assumes encoding names will be all upper-case - add m4_toupper
10958255a313Smrg# calls if this is not true in the future.
10968255a313Smrg
10978255a313SmrgAC_DEFUN([XORG_FONT_CHECK_ENCODING],[
10988255a313Smrg	AC_ARG_ENABLE(m4_tolower($1),
10998255a313Smrg		AS_HELP_STRING(m4_join([-], [--disable], m4_tolower($1)),
11008255a313Smrg				[Build $1 fonts (default: yes)]),
11018255a313Smrg		[AS_TR_SH($1)=$enableval], [AS_TR_SH($1)=yes])
11028255a313Smrg	AC_MSG_CHECKING([whether to build $1 fonts])
11038255a313Smrg	AC_MSG_RESULT($[AS_TR_SH($1)])
11048255a313Smrg	AM_CONDITIONAL(AS_TR_SH($1), [test "x$AS_TR_SH($1)" = xyes])
11058255a313Smrg]) # XORG_FONT_CHECK_ENCODING
11068255a313Smrg
11078255a313Smrg# XORG_FONT_CHECK_ENCODING_LIST(encoding1 encoding2....)
11088255a313Smrg# -----------------------------------------------------
11098255a313Smrg# Minimum version: 1.1.0
11108255a313Smrg# Call XORG_FONT_CHECK_ENCODING for multiple encodings at once
11118255a313Smrg
11128255a313SmrgAC_DEFUN([XORG_FONT_CHECK_ENCODING_LIST],[
11138255a313Smrg	m4_foreach_w([enc], [$1], [XORG_FONT_CHECK_ENCODING(enc)])
11148255a313Smrg]) # XORG_FONT_CHECK_ENCODING_LIST
11158255a313Smrg
11168255a313Smrg# XORG_FONT_REQUIRED_PROG(VARNAME, progname)
11178255a313Smrg# ------------------------------------------
11188255a313Smrg# Minimum version: 1.1.0
11198255a313Smrg#
11208255a313Smrg# Simple wrapper around AC_PATH_PROG that errors if not found
11218255a313Smrg#
11228255a313Smrg
11238255a313SmrgAC_DEFUN([XORG_FONT_REQUIRED_PROG],[
11248255a313Smrg	AC_PATH_PROG($1, $2)
11258255a313Smrg	if test x"$1" = x; then
11268255a313Smrg		AC_MSG_ERROR([$2 is required to build $PACKAGE_NAME.])
11278255a313Smrg	fi
11288255a313Smrg])
11298255a313Smrg
11308255a313Smrg
11318255a313Smrg# XORG_FONT_FCCACHE()
11328255a313Smrg# -------------------
11338255a313Smrg# Minimum version: 1.1.0
11348255a313Smrg#
11358255a313Smrg# Set FCCACHE to path to fc-cache (fontconfig cache builder) if found
11368255a313Smrg# Set RUN_FCCACHE to a rule suitable for substituting into a makefile
11378255a313Smrg# to run fc-cache if found and not installing to $DESTDIR
11388255a313Smrg#
11398255a313Smrg# fc-cache is optional, not required, and should be skipped when making
11408255a313Smrg# packages (installing to $DESTDIR).
11418255a313Smrg#
11428255a313SmrgAC_DEFUN([XORG_FONT_FCCACHE],[
11438255a313Smrg	AC_PATH_PROG(FCCACHE, fc-cache)
11448255a313Smrg	FCCACHE_WARN='echo "** Warning: fonts.cache not built" ; echo "** Generate this file manually on host system using fc-cache"'
11458255a313Smrg	if test x"$FCCACHE" = x ; then
11468255a313Smrg		RUN_FCCACHE="${FCCACHE_WARN}"
11478255a313Smrg	else
11488255a313Smrg		RUN_FCCACHE='@(if test -z "$(DESTDIR)"; then echo $(FCCACHE) $(fontdir); $(FCCACHE) $(fontdir); else'
11498255a313Smrg		RUN_FCCACHE="${RUN_FCCACHE} ${FCCACHE_WARN} ; fi)"
11508255a313Smrg	fi
11518255a313Smrg	AC_SUBST([RUN_FCCACHE])
11528255a313Smrg])
11538255a313Smrg
11548255a313Smrg
11558255a313Smrg# XORG_FONT_COMMON_UTILS()
11568255a313Smrg# ------------------------
11578255a313Smrg# Minimum version: 1.1.0
11588255a313Smrg#
11598255a313Smrg# Call XORG_FONT_REQUIRED_PROG for programs needed for all font types
11608255a313Smrg
11618255a313SmrgAC_DEFUN([XORG_FONT_COMMON_UTILS],[
11628255a313Smrg	XORG_FONT_FCCACHE
11638255a313Smrg	XORG_FONT_REQUIRED_PROG(MKFONTDIR, mkfontdir)
11648255a313Smrg])
11658255a313Smrg
11668255a313Smrg# XORG_FONT_SCALED_UTILS()
11678255a313Smrg# ------------------------
11688255a313Smrg# Minimum version: 1.1.0
11698255a313Smrg#
11708255a313Smrg# Call XORG_FONT_REQUIRED_PROG for programs needed for scalable fonts
11718255a313Smrg# (TrueType, OpenType, Type1)
11728255a313Smrg
11738255a313SmrgAC_DEFUN([XORG_FONT_SCALED_UTILS],[
11748255a313Smrg	XORG_FONT_COMMON_UTILS
11758255a313Smrg	XORG_FONT_REQUIRED_PROG(MKFONTSCALE, mkfontscale)
11768255a313Smrg])
11778255a313Smrg
11788255a313Smrg# XORG_FONT_BDF_UTILS()
11798255a313Smrg# ---------------------
11808255a313Smrg# Minimum version: 1.1.0
11818255a313Smrg#
11828255a313Smrg# Call XORG_FONT_REQUIRED_PROG for programs needed for BDF format bitmap fonts
11838255a313Smrg# Also call XORG_FONT_CHECK_COMPRESSION to determine how to compress the
11848255a313Smrg# PCF output files created by bdftopcf
11858255a313Smrg
11868255a313SmrgAC_DEFUN([XORG_FONT_BDF_UTILS],[
11878255a313Smrg	XORG_FONT_COMMON_UTILS
11888255a313Smrg	XORG_FONT_REQUIRED_PROG(BDFTOPCF, bdftopcf)
11898255a313Smrg	XORG_FONT_CHECK_COMPRESSION
11908255a313Smrg])
11918255a313Smrg
11928255a313Smrg# XORG_FONT_CHECK_COMPRESSION()
11938255a313Smrg# -----------------------------
11948255a313Smrg# Minimum version: 1.1.0
11958255a313Smrg#
11968255a313Smrg# Offer a --with-compression flag to control what compression method is
11978255a313Smrg# used for pcf font files.   Offers all the methods currently supported
11988255a313Smrg# by libXfont, including no compression.
11998255a313Smrg
12008255a313SmrgAC_DEFUN([XORG_FONT_CHECK_COMPRESSION],[
12018255a313Smrg	AC_MSG_CHECKING([font compression method])
12028255a313Smrg	AC_ARG_WITH(compression,
12038255a313Smrg	 [AS_HELP_STRING([--with-compression=<no|compress|gzip|bzip2>],
12048255a313Smrg			 [compression method to use on pcf fonts])],
12058255a313Smrg         [compression="$withval"], [compression="yes"])
12068255a313Smrg	if test x"$compression" = "xyes" ; then
12078255a313Smrg		compression="gzip"
12088255a313Smrg	fi
12098255a313Smrg	AC_MSG_RESULT([${compression}])
12108255a313Smrg	case ${compression} in
12118255a313Smrg	 *compress)	COMPRESS_SUFFIX=".Z" ;;
12128255a313Smrg	 *gzip)		COMPRESS_SUFFIX=".gz" ;;
12138255a313Smrg	 *bzip2)	COMPRESS_SUFFIX=".bz2" ;;
12148255a313Smrg	 no|none)	COMPRESS_SUFFIX="" ; COMPRESS="cat" ;;
12158255a313Smrg	 *) AC_MSG_ERROR([${compression} is not a supported compression method]) ;;
12168255a313Smrg	esac
12178255a313Smrg	if test x"$COMPRESS_SUFFIX" != "x" ; then
12188255a313Smrg	   XORG_FONT_REQUIRED_PROG(COMPRESS, ${compression})
12198255a313Smrg	fi
12208255a313Smrg	AC_SUBST([COMPRESS_SUFFIX])
12218255a313Smrg])
12228255a313Smrg
12238255a313Smrg# XORG_FONT_UCS2ANY()
12248255a313Smrg# -------------------
12258255a313Smrg# Minimum version: 1.1.0
12268255a313Smrg#
12278255a313Smrg# Call XORG_FONT_REQUIRED_PROG for ucs2any program needed for splitting
12288255a313Smrg# Unicode-encoded BDF format bitmap fonts into subsets for older encodings.
12298255a313Smrg# Also call pkg-config to find the directory with the encoding files needed
12308255a313Smrg# by ucs2any, and export it as MAPFILES_PATH to the Makefiles
12318255a313Smrg
12328255a313SmrgAC_DEFUN([XORG_FONT_UCS2ANY],[
12338255a313Smrg	XORG_FONT_REQUIRED_PROG(UCS2ANY, ucs2any)
12348255a313Smrg	PKG_CHECK_MODULES(MAPS, [fontutil])
12358255a313Smrg	AC_MSG_CHECKING([for ucs2any encoding data files])
12368255a313Smrg	MAPFILES_PATH=`pkg-config --variable=mapdir fontutil`
12378255a313Smrg	AC_SUBST(MAPFILES_PATH)
12388255a313Smrg	AC_MSG_RESULT([${MAPFILES_PATH}])
12398255a313Smrg])
12408255a313Smrg
12418255a313Smrg
12428255a313Smrg
12438255a313Smrg# XORG_FONTROOTDIR()
12448255a313Smrg# --------------------
12458255a313Smrg# Minimum version: 1.1.0
12468255a313Smrg#
12478255a313Smrg# Sets FONTROOTDIR to the root directory for font files.  Uses the first
12488255a313Smrg# found from:
12498255a313Smrg#	--with-fontrootdir
12508255a313Smrg#	pkg-config --variable=fontrootdir fontutil
12518255a313Smrg#	${datadir}/fonts/X11
12528255a313Smrg
12538255a313SmrgAC_DEFUN([XORG_FONTROOTDIR],[
12548255a313Smrg	dnl Ensure $PKG_CONFIG is set first
12558255a313Smrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
12568255a313Smrg
12578255a313Smrg	AC_MSG_CHECKING([for root directory for font files])
12588255a313Smrg	AC_ARG_WITH(fontrootdir,
12598255a313Smrg		    AS_HELP_STRING([--with-fontrootdir=DIR],
12608255a313Smrg			   [Path to root directory for font files]),
12618255a313Smrg		    [FONTROOTDIR="$withval"])
12628255a313Smrg	# if --with-fontrootdir not specified...
12638255a313Smrg	if test "x${FONTROOTDIR}" = "x"; then
12648255a313Smrg		FONTROOTDIR=`$PKG_CONFIG --variable=fontrootdir fontutil`
12658255a313Smrg	fi
12668255a313Smrg	# ...and if pkg-config didn't find fontdir in fontutil.pc...
12678255a313Smrg	if test "x${FONTROOTDIR}" = "x"; then
12688255a313Smrg		FONTROOTDIR="${datadir}/fonts/X11"
12698255a313Smrg	fi
12708255a313Smrg	AC_SUBST(FONTROOTDIR)
12718255a313Smrg	AC_MSG_RESULT([${FONTROOTDIR}])
12728255a313Smrg])
12738255a313Smrg
12748255a313Smrg# XORG_FONTSUBDIR(variable, flag, subdir)
12758255a313Smrg# ---------------------------------------
12768255a313Smrg# Minimum version: 1.1.0
12778255a313Smrg#
12788255a313Smrg# Offer a --with-<flag> flag to control directory for font installation
12798255a313Smrg# Default is the specified <subdir> of the font root directory.
12808255a313Smrg# Sets <variable> to the selected directory
12818255a313Smrg
12828255a313SmrgAC_DEFUN([XORG_FONTSUBDIR],[
12838255a313Smrg	AC_REQUIRE([XORG_FONTROOTDIR])
12848255a313Smrg
12858255a313Smrg	AC_MSG_CHECKING([for directory for $3 files])
12868255a313Smrg	AC_ARG_WITH($2,
12878255a313Smrg		    [AS_HELP_STRING([--with-$2=DIR],
12888255a313Smrg		       		   [Path to $3 files [FONTROOTDIR/$3]])],
12898255a313Smrg		    [$1="${withval}"], [$1='${FONTROOTDIR}/$3'])
12908255a313Smrg	AC_SUBST($1)
12918255a313Smrg	AC_MSG_RESULT([${$1}])
12928255a313Smrg]) # XORG_FONTSUBDIR
12938255a313Smrg
12948255a313Smrg# XORG_FONTDIR(subdir)
12958255a313Smrg# --------------------
12968255a313Smrg# Minimum version: 1.1.0
12978255a313Smrg#
12988255a313Smrg# Offer a --with-fontdir flag to control directory for font installation
12998255a313Smrg# Default is the specified subdir of the font root directory.
13008255a313Smrg# Sets FONTDIR to the selected directory
13018255a313Smrg
13028255a313SmrgAC_DEFUN([XORG_FONTDIR],[XORG_FONTSUBDIR([FONTDIR], [fontdir], [$1])])
13038255a313Smrg
13048255a313Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
13058255a313Smrgdnl
13068255a313Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
13078255a313Smrgdnl 
13088255a313Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
13098255a313Smrgdnl copy of this software and associated documentation files (the
13108255a313Smrgdnl "Software"), to deal in the Software without restriction, including
13118255a313Smrgdnl without limitation the rights to use, copy, modify, merge, publish,
13128255a313Smrgdnl distribute, and/or sell copies of the Software, and to permit persons
13138255a313Smrgdnl to whom the Software is furnished to do so, provided that the above
13148255a313Smrgdnl copyright notice(s) and this permission notice appear in all copies of
13158255a313Smrgdnl the Software and that both the above copyright notice(s) and this
13168255a313Smrgdnl permission notice appear in supporting documentation.
13178255a313Smrgdnl
13188255a313Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
13198255a313Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
13208255a313Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
13218255a313Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
13228255a313Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
13238255a313Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
13248255a313Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
13258255a313Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
13268255a313Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
13278255a313Smrgdnl
13288255a313Smrgdnl Except as contained in this notice, the name of a copyright holder
13298255a313Smrgdnl shall not be used in advertising or otherwise to promote the sale, use
13308255a313Smrgdnl or other dealings in this Software without prior written authorization
13318255a313Smrgdnl of the copyright holder.
13328255a313Smrg
13338255a313Smrg# XORG_MACROS_VERSION(required-version)
13348255a313Smrg# -------------------------------------
13358255a313Smrg# Minimum version: 1.1.0
13368255a313Smrg#
13378255a313Smrg# If you're using a macro added in Version 1.1 or newer, include this in
13388255a313Smrg# your configure.ac with the minimum required version, such as:
13398255a313Smrg# XORG_MACROS_VERSION(1.1)
13408255a313Smrg#
13418255a313Smrg# To ensure that this macro is defined, also add:
13428255a313Smrg# m4_ifndef([XORG_MACROS_VERSION],
13438255a313Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
13448255a313Smrg#
13458255a313Smrg#
13468255a313Smrg# See the "minimum version" comment for each macro you use to see what 
13478255a313Smrg# version you require.
13488255a313Smrgm4_defun([XORG_MACROS_VERSION],[
13498255a313Smrgm4_define([vers_have], [1.3.0])
13508255a313Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
13518255a313Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
13528255a313Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
13538255a313Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
13548255a313Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
13558255a313Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
13568255a313Smrgm4_undefine([vers_have])
13578255a313Smrgm4_undefine([maj_have])
13588255a313Smrgm4_undefine([maj_needed])
13598255a313Smrg]) # XORG_MACROS_VERSION
13608255a313Smrg
13618255a313Smrg# XORG_PROG_RAWCPP()
13628255a313Smrg# ------------------
13638255a313Smrg# Minimum version: 1.0.0
13648255a313Smrg#
13658255a313Smrg# Find cpp program and necessary flags for use in pre-processing text files
13668255a313Smrg# such as man pages and config files
13678255a313SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
13688255a313SmrgAC_REQUIRE([AC_PROG_CPP])
13698255a313SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
13708255a313Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
13718255a313Smrg
13728255a313Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
13738255a313Smrg# which is not the best choice for supporting other OS'es, but covers most
13748255a313Smrg# of the ones we need for now.
13758255a313SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
13768255a313SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
13778255a313Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
13788255a313Smrg	AC_MSG_RESULT([no])
13798255a313Smrgelse
13808255a313Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
13818255a313Smrg		RAWCPPFLAGS=-undef
13828255a313Smrg		AC_MSG_RESULT([yes])
13838255a313Smrg	# under Cygwin unix is still defined even with -undef
13848255a313Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
13858255a313Smrg		RAWCPPFLAGS="-undef -ansi"
13868255a313Smrg		AC_MSG_RESULT([yes, with -ansi])
13878255a313Smrg	else
13888255a313Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
13898255a313Smrg	fi
13908255a313Smrgfi
13918255a313Smrgrm -f conftest.$ac_ext
13928255a313Smrg
13938255a313SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
13948255a313SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
13958255a313Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
13968255a313Smrg	AC_MSG_RESULT([no])
13978255a313Smrgelse
13988255a313Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
13998255a313Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
14008255a313Smrg		AC_MSG_RESULT([yes])
14018255a313Smrg	else
14028255a313Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
14038255a313Smrg	fi
14048255a313Smrgfi
14058255a313Smrgrm -f conftest.$ac_ext
14068255a313SmrgAC_SUBST(RAWCPPFLAGS)
14078255a313Smrg]) # XORG_PROG_RAWCPP
14088255a313Smrg
14098255a313Smrg# XORG_MANPAGE_SECTIONS()
14108255a313Smrg# -----------------------
14118255a313Smrg# Minimum version: 1.0.0
14128255a313Smrg#
14138255a313Smrg# Determine which sections man pages go in for the different man page types
14148255a313Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
14158255a313Smrg# Not sure if there's any better way than just hardcoding by OS name.
14168255a313Smrg# Override default settings by setting environment variables
14178255a313Smrg
14188255a313SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
14198255a313SmrgAC_REQUIRE([AC_CANONICAL_HOST])
14208255a313Smrg
14218255a313Smrgif test x$APP_MAN_SUFFIX = x    ; then
14228255a313Smrg    APP_MAN_SUFFIX=1
14238255a313Smrgfi
14248255a313Smrgif test x$APP_MAN_DIR = x    ; then
14258255a313Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
14268255a313Smrgfi
14278255a313Smrg
14288255a313Smrgif test x$LIB_MAN_SUFFIX = x    ; then
14298255a313Smrg    LIB_MAN_SUFFIX=3
14308255a313Smrgfi
14318255a313Smrgif test x$LIB_MAN_DIR = x    ; then
14328255a313Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
14338255a313Smrgfi
14348255a313Smrg
14358255a313Smrgif test x$FILE_MAN_SUFFIX = x    ; then
14368255a313Smrg    case $host_os in
14378255a313Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
14388255a313Smrg	*)		FILE_MAN_SUFFIX=5  ;;
14398255a313Smrg    esac
14408255a313Smrgfi
14418255a313Smrgif test x$FILE_MAN_DIR = x    ; then
14428255a313Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
14438255a313Smrgfi
14448255a313Smrg
14458255a313Smrgif test x$MISC_MAN_SUFFIX = x    ; then
14468255a313Smrg    case $host_os in
14478255a313Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
14488255a313Smrg	*)		MISC_MAN_SUFFIX=7  ;;
14498255a313Smrg    esac
14508255a313Smrgfi
14518255a313Smrgif test x$MISC_MAN_DIR = x    ; then
14528255a313Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
14538255a313Smrgfi
14548255a313Smrg
14558255a313Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
14568255a313Smrg    case $host_os in
14578255a313Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
14588255a313Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
14598255a313Smrg    esac
14608255a313Smrgfi
14618255a313Smrgif test x$DRIVER_MAN_DIR = x    ; then
14628255a313Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
14638255a313Smrgfi
14648255a313Smrg
14658255a313Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
14668255a313Smrg    case $host_os in
14678255a313Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
14688255a313Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
14698255a313Smrg    esac
14708255a313Smrgfi
14718255a313Smrgif test x$ADMIN_MAN_DIR = x    ; then
14728255a313Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
14738255a313Smrgfi
14748255a313Smrg
14758255a313Smrg
14768255a313SmrgAC_SUBST([APP_MAN_SUFFIX])
14778255a313SmrgAC_SUBST([LIB_MAN_SUFFIX])
14788255a313SmrgAC_SUBST([FILE_MAN_SUFFIX])
14798255a313SmrgAC_SUBST([MISC_MAN_SUFFIX])
14808255a313SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
14818255a313SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
14828255a313SmrgAC_SUBST([APP_MAN_DIR])
14838255a313SmrgAC_SUBST([LIB_MAN_DIR])
14848255a313SmrgAC_SUBST([FILE_MAN_DIR])
14858255a313SmrgAC_SUBST([MISC_MAN_DIR])
14868255a313SmrgAC_SUBST([DRIVER_MAN_DIR])
14878255a313SmrgAC_SUBST([ADMIN_MAN_DIR])
14888255a313Smrg]) # XORG_MANPAGE_SECTIONS
14898255a313Smrg
14908255a313Smrg# XORG_CHECK_LINUXDOC
14918255a313Smrg# -------------------
14928255a313Smrg# Minimum version: 1.0.0
14938255a313Smrg#
14948255a313Smrg# Defines the variable MAKE_TEXT if the necessary tools and
14958255a313Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
14968255a313Smrg# Whether or not the necessary tools and files are found can be checked
14978255a313Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
14988255a313SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
14998255a313Smrgif test x$XORG_SGML_PATH = x ; then
15008255a313Smrg    XORG_SGML_PATH=$prefix/share/sgml
15018255a313Smrgfi
15028255a313SmrgHAVE_DEFS_ENT=
15038255a313Smrg
15048255a313Smrgif test x"$cross_compiling" = x"yes" ; then
15058255a313Smrg  HAVE_DEFS_ENT=no
15068255a313Smrgelse
15078255a313Smrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
15088255a313Smrgfi
15098255a313Smrg
15108255a313SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
15118255a313SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
15128255a313Smrg
15138255a313SmrgAC_MSG_CHECKING([Whether to build documentation])
15148255a313Smrg
15158255a313Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
15168255a313Smrg   BUILDDOC=yes
15178255a313Smrgelse
15188255a313Smrg   BUILDDOC=no
15198255a313Smrgfi
15208255a313Smrg
15218255a313SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
15228255a313Smrg
15238255a313SmrgAC_MSG_RESULT([$BUILDDOC])
15248255a313Smrg
15258255a313SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
15268255a313Smrg
15278255a313Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
15288255a313Smrg   BUILDPDFDOC=yes
15298255a313Smrgelse
15308255a313Smrg   BUILDPDFDOC=no
15318255a313Smrgfi
15328255a313Smrg
15338255a313SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
15348255a313Smrg
15358255a313SmrgAC_MSG_RESULT([$BUILDPDFDOC])
15368255a313Smrg
15378255a313SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
15388255a313SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
15398255a313SmrgMAKE_PDF="$PS2PDF"
15408255a313SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
15418255a313Smrg
15428255a313SmrgAC_SUBST(MAKE_TEXT)
15438255a313SmrgAC_SUBST(MAKE_PS)
15448255a313SmrgAC_SUBST(MAKE_PDF)
15458255a313SmrgAC_SUBST(MAKE_HTML)
15468255a313Smrg]) # XORG_CHECK_LINUXDOC
15478255a313Smrg
15488255a313Smrg# XORG_CHECK_DOCBOOK
15498255a313Smrg# -------------------
15508255a313Smrg# Minimum version: 1.0.0
15518255a313Smrg#
15528255a313Smrg# Checks for the ability to build output formats from SGML DocBook source.
15538255a313Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
15548255a313Smrg# indicates whether the necessary tools and files are found and, if set,
15558255a313Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
15568255a313SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
15578255a313Smrgif test x$XORG_SGML_PATH = x ; then
15588255a313Smrg    XORG_SGML_PATH=$prefix/share/sgml
15598255a313Smrgfi
15608255a313SmrgHAVE_DEFS_ENT=
15618255a313SmrgBUILDTXTDOC=no
15628255a313SmrgBUILDPDFDOC=no
15638255a313SmrgBUILDPSDOC=no
15648255a313SmrgBUILDHTMLDOC=no
15658255a313Smrg
15668255a313SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
15678255a313Smrg
15688255a313SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
15698255a313SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
15708255a313SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
15718255a313SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
15728255a313Smrg
15738255a313SmrgAC_MSG_CHECKING([Whether to build text documentation])
15748255a313Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
15758255a313Smrg   test x$BUILD_TXTDOC != xno; then
15768255a313Smrg	BUILDTXTDOC=yes
15778255a313Smrgfi
15788255a313SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
15798255a313SmrgAC_MSG_RESULT([$BUILDTXTDOC])
15808255a313Smrg
15818255a313SmrgAC_MSG_CHECKING([Whether to build PDF documentation])
15828255a313Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
15838255a313Smrg   test x$BUILD_PDFDOC != xno; then
15848255a313Smrg	BUILDPDFDOC=yes
15858255a313Smrgfi
15868255a313SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
15878255a313SmrgAC_MSG_RESULT([$BUILDPDFDOC])
15888255a313Smrg
15898255a313SmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
15908255a313Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
15918255a313Smrg   test x$BUILD_PSDOC != xno; then
15928255a313Smrg	BUILDPSDOC=yes
15938255a313Smrgfi
15948255a313SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
15958255a313SmrgAC_MSG_RESULT([$BUILDPSDOC])
15968255a313Smrg
15978255a313SmrgAC_MSG_CHECKING([Whether to build HTML documentation])
15988255a313Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
15998255a313Smrg   test x$BUILD_HTMLDOC != xno; then
16008255a313Smrg	BUILDHTMLDOC=yes
16018255a313Smrgfi
16028255a313SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
16038255a313SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
16048255a313Smrg
16058255a313SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
16068255a313SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
16078255a313SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
16088255a313SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
16098255a313Smrg
16108255a313SmrgAC_SUBST(MAKE_TEXT)
16118255a313SmrgAC_SUBST(MAKE_PS)
16128255a313SmrgAC_SUBST(MAKE_PDF)
16138255a313SmrgAC_SUBST(MAKE_HTML)
16148255a313Smrg]) # XORG_CHECK_DOCBOOK
16158255a313Smrg
16168255a313Smrg# XORG_CHECK_MALLOC_ZERO
16178255a313Smrg# ----------------------
16188255a313Smrg# Minimum version: 1.0.0
16198255a313Smrg#
16208255a313Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
16218255a313Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
16228255a313Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
16238255a313SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
16248255a313SmrgAC_ARG_ENABLE(malloc0returnsnull,
16258255a313Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
16268255a313Smrg		       [malloc(0) returns NULL (default: auto)]),
16278255a313Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
16288255a313Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
16298255a313Smrg
16308255a313SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
16318255a313Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
16328255a313Smrg	AC_RUN_IFELSE([
16338255a313Smrgchar *malloc();
16348255a313Smrgchar *realloc();
16358255a313Smrgchar *calloc();
16368255a313Smrgmain() {
16378255a313Smrg    char *m0, *r0, *c0, *p;
16388255a313Smrg    m0 = malloc(0);
16398255a313Smrg    p = malloc(10);
16408255a313Smrg    r0 = realloc(p,0);
16418255a313Smrg    c0 = calloc(0);
16428255a313Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
16438255a313Smrg}],
16448255a313Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
16458255a313Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
16468255a313Smrgfi
16478255a313SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
16488255a313Smrg
16498255a313Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
16508255a313Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
16518255a313Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
16528255a313Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
16538255a313Smrgelse
16548255a313Smrg	MALLOC_ZERO_CFLAGS=""
16558255a313Smrg	XMALLOC_ZERO_CFLAGS=""
16568255a313Smrg	XTMALLOC_ZERO_CFLAGS=""
16578255a313Smrgfi
16588255a313Smrg
16598255a313SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
16608255a313SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
16618255a313SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
16628255a313Smrg]) # XORG_CHECK_MALLOC_ZERO
16638255a313Smrg
16648255a313Smrg# XORG_WITH_LINT()
16658255a313Smrg# ----------------
16668255a313Smrg# Minimum version: 1.1.0
16678255a313Smrg#
16688255a313Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint
16698255a313Smrg# is specified.   (Use --with-lint=sparse for sparse.)
16708255a313Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
16718255a313Smrg# Sets $LINT_FLAGS to flags to pass to source checker
16728255a313Smrg# Sets LINT automake conditional if enabled (default: disabled)
16738255a313Smrg#
16748255a313SmrgAC_DEFUN([XORG_WITH_LINT],[
16758255a313Smrg
16768255a313Smrg# Allow checking code with lint, sparse, etc.
16778255a313SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
16788255a313Smrg		[Use a lint-style source code checker (default: disabled)])],
16798255a313Smrg		[use_lint=$withval], [use_lint=no])
16808255a313Smrgif test "x$use_lint" = "xyes" ; then
16818255a313Smrg	LINT="lint"
16828255a313Smrgelse
16838255a313Smrg	LINT="$use_lint"
16848255a313Smrgfi
16858255a313Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
16868255a313Smrg    case $LINT in
16878255a313Smrg	lint|*/lint)
16888255a313Smrg	    case $host_os in
16898255a313Smrg		solaris*)
16908255a313Smrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
16918255a313Smrg			;;
16928255a313Smrg	    esac
16938255a313Smrg	    ;;
16948255a313Smrg    esac
16958255a313Smrgfi
16968255a313Smrg
16978255a313SmrgAC_SUBST(LINT)
16988255a313SmrgAC_SUBST(LINT_FLAGS)
16998255a313SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
17008255a313Smrg
17018255a313Smrg]) # XORG_WITH_LINT
17028255a313Smrg
17038255a313Smrg# XORG_LINT_LIBRARY(LIBNAME)
17048255a313Smrg# --------------------------
17058255a313Smrg# Minimum version: 1.1.0
17068255a313Smrg#
17078255a313Smrg# Sets up flags for building lint libraries for checking programs that call
17088255a313Smrg# functions in the library.
17098255a313Smrg# Disabled by default, enable with --enable-lint-library
17108255a313Smrg# Sets: 
17118255a313Smrg#	@LINTLIB@		- name of lint library file to make
17128255a313Smrg#	MAKE_LINT_LIB		- automake conditional
17138255a313Smrg#
17148255a313Smrg
17158255a313SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
17168255a313SmrgAC_REQUIRE([XORG_WITH_LINT])
17178255a313Smrg# Build lint "library" for more indepth checks of programs calling this library
17188255a313SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
17198255a313Smrg	[Create lint library (default: disabled)])],
17208255a313Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
17218255a313Smrgif test "x$make_lint_lib" != "xno" ; then
17228255a313Smrg	if test "x$LINT" = "xno" ; then
17238255a313Smrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
17248255a313Smrg	fi
17258255a313Smrg	if test "x$make_lint_lib" = "xyes" ; then
17268255a313Smrg		LINTLIB=llib-l$1.ln
17278255a313Smrg	else
17288255a313Smrg		LINTLIB=$make_lint_lib
17298255a313Smrg	fi
17308255a313Smrgfi
17318255a313SmrgAC_SUBST(LINTLIB)
17328255a313SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
17338255a313Smrg
17348255a313Smrg]) # XORG_LINT_LIBRARY
17358255a313Smrg
17368255a313Smrg# XORG_CWARNFLAGS
17378255a313Smrg# ---------------
17388255a313Smrg# Minimum version: 1.2.0
17398255a313Smrg#
17408255a313Smrg# Defines CWARNFLAGS to enable C compiler warnings.
17418255a313Smrg#
17428255a313SmrgAC_DEFUN([XORG_CWARNFLAGS], [
17438255a313SmrgAC_REQUIRE([AC_PROG_CC])
17448255a313Smrgif  test "x$GCC" = xyes ; then
17458255a313Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
17468255a313Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
17478255a313Smrg-Wbad-function-cast"
17488255a313Smrg    case `$CC -dumpversion` in
17498255a313Smrg    3.4.* | 4.*)
17508255a313Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
17518255a313Smrg	;;
17528255a313Smrg    esac
17538255a313Smrgelse
17548255a313Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
17558255a313Smrg    if test "x$SUNCC" = "xyes"; then
17568255a313Smrg	CWARNFLAGS="-v"
17578255a313Smrg    fi
17588255a313Smrgfi
17598255a313SmrgAC_SUBST(CWARNFLAGS)
17608255a313Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
17618255a313Smrg]) # XORG_CWARNFLAGS
17628255a313Smrg
17638255a313Smrg# XORG_STRICT_OPTION
17648255a313Smrg# -----------------------
17658255a313Smrg# Minimum version: 1.3.0
17668255a313Smrg#
17678255a313Smrg# Add configure option to enable strict compilation
17688255a313SmrgAC_DEFUN([XORG_STRICT_OPTION], [
17698255a313SmrgAC_REQUIRE([AC_PROG_CC])
17708255a313SmrgAC_REQUIRE([AC_PROG_CC_C99])
17718255a313SmrgAC_REQUIRE([XORG_CWARNFLAGS])
17728255a313Smrg
17738255a313SmrgAC_ARG_ENABLE(strict-compilation,
17748255a313Smrg			  AS_HELP_STRING([--enable-strict-compilation],
17758255a313Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
17768255a313Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
17778255a313Smrgif test "x$STRICT_COMPILE" = "xyes"; then
17788255a313Smrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
17798255a313Smrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
17808255a313Smrg	if test "x$GCC" = xyes ; then
17818255a313Smrg		STRICT_CFLAGS="-pedantic -Werror"
17828255a313Smrg	elif test "x$SUNCC" = "xyes"; then
17838255a313Smrg		STRICT_CFLAGS="-errwarn"
17848255a313Smrg    elif test "x$INTELCC" = "xyes"; then
17858255a313Smrg		STRICT_CFLAGS="-Werror"
17868255a313Smrg	fi
17878255a313Smrgfi
17888255a313SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
17898255a313SmrgAC_SUBST([CWARNFLAGS])
17908255a313Smrg]) # XORG_STRICT_OPTION
17918255a313Smrg
17928255a313Smrg# XORG_DEFAULT_OPTIONS
17938255a313Smrg# --------------------
17948255a313Smrg# Minimum version: 1.3.0
17958255a313Smrg#
17968255a313Smrg# Defines default options for X.Org modules.
17978255a313Smrg#
17988255a313SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
17998255a313SmrgXORG_CWARNFLAGS
18008255a313SmrgXORG_STRICT_OPTION
18018255a313SmrgXORG_RELEASE_VERSION
18028255a313SmrgXORG_CHANGELOG
18038255a313SmrgXORG_MANPAGE_SECTIONS
18048255a313Smrg]) # XORG_DEFAULT_OPTIONS
18058255a313Smrgdnl Copyright 2005 Red Hat, Inc
18068255a313Smrgdnl
18078255a313Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
18088255a313Smrgdnl documentation for any purpose is hereby granted without fee, provided that
18098255a313Smrgdnl the above copyright notice appear in all copies and that both that
18108255a313Smrgdnl copyright notice and this permission notice appear in supporting
18118255a313Smrgdnl documentation.
18128255a313Smrgdnl
18138255a313Smrgdnl The above copyright notice and this permission notice shall be included
18148255a313Smrgdnl in all copies or substantial portions of the Software.
18158255a313Smrgdnl
18168255a313Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18178255a313Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18188255a313Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18198255a313Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
18208255a313Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18218255a313Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
18228255a313Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
18238255a313Smrgdnl
18248255a313Smrgdnl Except as contained in this notice, the name of the copyright holders shall
18258255a313Smrgdnl not be used in advertising or otherwise to promote the sale, use or
18268255a313Smrgdnl other dealings in this Software without prior written authorization
18278255a313Smrgdnl from the copyright holders.
18288255a313Smrgdnl
18298255a313Smrg
18308255a313Smrg# XORG_RELEASE_VERSION
18318255a313Smrg# --------------------
18328255a313Smrg# Adds --with/without-release-string and changes the PACKAGE and
18338255a313Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
18348255a313Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
18358255a313Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
18368255a313Smrg 
18378255a313SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
18388255a313Smrg	AC_ARG_WITH(release-version,
18398255a313Smrg			AS_HELP_STRING([--with-release-version=STRING],
18408255a313Smrg				[Use release version string in package name]),
18418255a313Smrg			[RELEASE_VERSION="$withval"],
18428255a313Smrg			[RELEASE_VERSION=""])
18438255a313Smrg	if test "x$RELEASE_VERSION" != "x"; then
18448255a313Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
18458255a313Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
18468255a313Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
18478255a313Smrg	fi
18488255a313Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
18498255a313Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
18508255a313Smrg		[Major version of this package])
18518255a313Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
18528255a313Smrg	if test "x$PVM" = "x"; then
18538255a313Smrg		PVM="0"
18548255a313Smrg	fi
18558255a313Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
18568255a313Smrg		[$PVM],
18578255a313Smrg		[Minor version of this package])
18588255a313Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
18598255a313Smrg	if test "x$PVP" = "x"; then
18608255a313Smrg		PVP="0"
18618255a313Smrg	fi
18628255a313Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
18638255a313Smrg		[$PVP],
18648255a313Smrg		[Patch version of this package])
18658255a313Smrg])
18668255a313Smrg
18678255a313Smrg# XORG_CHANGELOG()
18688255a313Smrg# ----------------
18698255a313Smrg# Minimum version: 1.2.0
18708255a313Smrg#
18718255a313Smrg# Defines the variable CHANGELOG_CMD as the command to generate
18728255a313Smrg# ChangeLog from git.
18738255a313Smrg#
18748255a313Smrg# Arrange that distcleancheck ignores ChangeLog left over by distclean.
18758255a313Smrg#
18768255a313SmrgAC_DEFUN([XORG_CHANGELOG], [
18778255a313SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
18788255a313Smrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
18798255a313Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
18808255a313SmrgAC_SUBST([CHANGELOG_CMD])
18818255a313SmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
18828255a313Smrg]) # XORG_CHANGELOG
18838255a313Smrg
18848255a313Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
18858255a313Smrg# 
18868255a313Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
18878255a313Smrg#
18888255a313Smrg# This program is free software; you can redistribute it and/or modify
18898255a313Smrg# it under the terms of the GNU General Public License as published by
18908255a313Smrg# the Free Software Foundation; either version 2 of the License, or
18918255a313Smrg# (at your option) any later version.
18928255a313Smrg#
18938255a313Smrg# This program is distributed in the hope that it will be useful, but
18948255a313Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
18958255a313Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18968255a313Smrg# General Public License for more details.
18978255a313Smrg#
18988255a313Smrg# You should have received a copy of the GNU General Public License
18998255a313Smrg# along with this program; if not, write to the Free Software
19008255a313Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19018255a313Smrg#
19028255a313Smrg# As a special exception to the GNU General Public License, if you
19038255a313Smrg# distribute this file as part of a program that contains a
19048255a313Smrg# configuration script generated by Autoconf, you may include it under
19058255a313Smrg# the same distribution terms that you use for the rest of that program.
19068255a313Smrg
19078255a313Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
19088255a313Smrg# ----------------------------------
19098255a313SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
19108255a313Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
19118255a313Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
19128255a313SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
19138255a313Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
19148255a313Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
19158255a313Smrgfi
19168255a313Smrgif test -n "$PKG_CONFIG"; then
19178255a313Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
19188255a313Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
19198255a313Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
19208255a313Smrg		AC_MSG_RESULT([yes])
19218255a313Smrg	else
19228255a313Smrg		AC_MSG_RESULT([no])
19238255a313Smrg		PKG_CONFIG=""
19248255a313Smrg	fi
19258255a313Smrg		
19268255a313Smrgfi[]dnl
19278255a313Smrg])# PKG_PROG_PKG_CONFIG
19288255a313Smrg
19298255a313Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
19308255a313Smrg#
19318255a313Smrg# Check to see whether a particular set of modules exists.  Similar
19328255a313Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
19338255a313Smrg#
19348255a313Smrg#
19358255a313Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
19368255a313Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
19378255a313Smrg# PKG_CHECK_EXISTS manually
19388255a313Smrg# --------------------------------------------------------------
19398255a313SmrgAC_DEFUN([PKG_CHECK_EXISTS],
19408255a313Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
19418255a313Smrgif test -n "$PKG_CONFIG" && \
19428255a313Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
19438255a313Smrg  m4_ifval([$2], [$2], [:])
19448255a313Smrgm4_ifvaln([$3], [else
19458255a313Smrg  $3])dnl
19468255a313Smrgfi])
19478255a313Smrg
19488255a313Smrg
19498255a313Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
19508255a313Smrg# ---------------------------------------------
19518255a313Smrgm4_define([_PKG_CONFIG],
19528255a313Smrg[if test -n "$$1"; then
19538255a313Smrg    pkg_cv_[]$1="$$1"
19548255a313Smrg elif test -n "$PKG_CONFIG"; then
19558255a313Smrg    PKG_CHECK_EXISTS([$3],
19568255a313Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
19578255a313Smrg		     [pkg_failed=yes])
19588255a313Smrg else
19598255a313Smrg    pkg_failed=untried
19608255a313Smrgfi[]dnl
19618255a313Smrg])# _PKG_CONFIG
19628255a313Smrg
19638255a313Smrg# _PKG_SHORT_ERRORS_SUPPORTED
19648255a313Smrg# -----------------------------
19658255a313SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
19668255a313Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
19678255a313Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
19688255a313Smrg        _pkg_short_errors_supported=yes
19698255a313Smrgelse
19708255a313Smrg        _pkg_short_errors_supported=no
19718255a313Smrgfi[]dnl
19728255a313Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
19738255a313Smrg
19748255a313Smrg
19758255a313Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
19768255a313Smrg# [ACTION-IF-NOT-FOUND])
19778255a313Smrg#
19788255a313Smrg#
19798255a313Smrg# Note that if there is a possibility the first call to
19808255a313Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
19818255a313Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
19828255a313Smrg#
19838255a313Smrg#
19848255a313Smrg# --------------------------------------------------------------
19858255a313SmrgAC_DEFUN([PKG_CHECK_MODULES],
19868255a313Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
19878255a313SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
19888255a313SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
19898255a313Smrg
19908255a313Smrgpkg_failed=no
19918255a313SmrgAC_MSG_CHECKING([for $1])
19928255a313Smrg
19938255a313Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
19948255a313Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
19958255a313Smrg
19968255a313Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
19978255a313Smrgand $1[]_LIBS to avoid the need to call pkg-config.
19988255a313SmrgSee the pkg-config man page for more details.])
19998255a313Smrg
20008255a313Smrgif test $pkg_failed = yes; then
20018255a313Smrg        _PKG_SHORT_ERRORS_SUPPORTED
20028255a313Smrg        if test $_pkg_short_errors_supported = yes; then
20038255a313Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
20048255a313Smrg        else 
20058255a313Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
20068255a313Smrg        fi
20078255a313Smrg	# Put the nasty error message in config.log where it belongs
20088255a313Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
20098255a313Smrg
20108255a313Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
20118255a313Smrg[Package requirements ($2) were not met:
20128255a313Smrg
20138255a313Smrg$$1_PKG_ERRORS
20148255a313Smrg
20158255a313SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
20168255a313Smrginstalled software in a non-standard prefix.
20178255a313Smrg
20188255a313Smrg_PKG_TEXT
20198255a313Smrg])],
20208255a313Smrg		[AC_MSG_RESULT([no])
20218255a313Smrg                $4])
20228255a313Smrgelif test $pkg_failed = untried; then
20238255a313Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
20248255a313Smrg[The pkg-config script could not be found or is too old.  Make sure it
20258255a313Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
20268255a313Smrgpath to pkg-config.
20278255a313Smrg
20288255a313Smrg_PKG_TEXT
20298255a313Smrg
20308255a313SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
20318255a313Smrg		[$4])
20328255a313Smrgelse
20338255a313Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
20348255a313Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
20358255a313Smrg        AC_MSG_RESULT([yes])
20368255a313Smrg	ifelse([$3], , :, [$3])
20378255a313Smrgfi[]dnl
20388255a313Smrg])# PKG_CHECK_MODULES
20398255a313Smrg
2040