aclocal.m4 revision 8b22bf3f
18b22bf3fSmrg# generated automatically by aclocal 1.10 -*- Autoconf -*-
28b22bf3fSmrg
38b22bf3fSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
48b22bf3fSmrg# 2005, 2006  Free Software Foundation, Inc.
58b22bf3fSmrg# This file is free software; the Free Software Foundation
68b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
78b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
88b22bf3fSmrg
98b22bf3fSmrg# This program is distributed in the hope that it will be useful,
108b22bf3fSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
118b22bf3fSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
128b22bf3fSmrg# PARTICULAR PURPOSE.
138b22bf3fSmrg
148b22bf3fSmrgm4_if(m4_PACKAGE_VERSION, [2.61],,
158b22bf3fSmrg[m4_fatal([this file was generated for autoconf 2.61.
168b22bf3fSmrgYou have another version of autoconf.  If you want to use that,
178b22bf3fSmrgyou should regenerate the build system entirely.], [63])])
188b22bf3fSmrg
198b22bf3fSmrg# Copyright (C) 2002, 2003, 2005, 2006  Free Software Foundation, Inc.
208b22bf3fSmrg#
218b22bf3fSmrg# This file is free software; the Free Software Foundation
228b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
238b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
248b22bf3fSmrg
258b22bf3fSmrg# AM_AUTOMAKE_VERSION(VERSION)
268b22bf3fSmrg# ----------------------------
278b22bf3fSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
288b22bf3fSmrg# generated from the m4 files accompanying Automake X.Y.
298b22bf3fSmrg# (This private macro should not be called outside this file.)
308b22bf3fSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
318b22bf3fSmrg[am__api_version='1.10'
328b22bf3fSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
338b22bf3fSmrgdnl require some minimum version.  Point them to the right macro.
348b22bf3fSmrgm4_if([$1], [1.10], [],
358b22bf3fSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
368b22bf3fSmrg])
378b22bf3fSmrg
388b22bf3fSmrg# _AM_AUTOCONF_VERSION(VERSION)
398b22bf3fSmrg# -----------------------------
408b22bf3fSmrg# aclocal traces this macro to find the Autoconf version.
418b22bf3fSmrg# This is a private macro too.  Using m4_define simplifies
428b22bf3fSmrg# the logic in aclocal, which can simply ignore this definition.
438b22bf3fSmrgm4_define([_AM_AUTOCONF_VERSION], [])
448b22bf3fSmrg
458b22bf3fSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
468b22bf3fSmrg# -------------------------------
478b22bf3fSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
488b22bf3fSmrg# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
498b22bf3fSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
508b22bf3fSmrg[AM_AUTOMAKE_VERSION([1.10])dnl
518b22bf3fSmrg_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
528b22bf3fSmrg
538b22bf3fSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
548b22bf3fSmrg
558b22bf3fSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
568b22bf3fSmrg#
578b22bf3fSmrg# This file is free software; the Free Software Foundation
588b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
598b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
608b22bf3fSmrg
618b22bf3fSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
628b22bf3fSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
638b22bf3fSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
648b22bf3fSmrg#
658b22bf3fSmrg# Of course, Automake must honor this variable whenever it calls a
668b22bf3fSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
678b22bf3fSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
688b22bf3fSmrg# depending on how configure is run.  This is pretty annoying, since
698b22bf3fSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
708b22bf3fSmrg# source directory, any form will work fine, but in subdirectories a
718b22bf3fSmrg# relative path needs to be adjusted first.
728b22bf3fSmrg#
738b22bf3fSmrg# $ac_aux_dir/missing
748b22bf3fSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
758b22bf3fSmrg# $top_srcdir/$ac_aux_dir/missing
768b22bf3fSmrg#    fails if $ac_aux_dir is absolute,
778b22bf3fSmrg#    fails when called from a subdirectory in a VPATH build with
788b22bf3fSmrg#          a relative $ac_aux_dir
798b22bf3fSmrg#
808b22bf3fSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
818b22bf3fSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
828b22bf3fSmrg# harmless because $srcdir is `.', but things will broke when you
838b22bf3fSmrg# start a VPATH build or use an absolute $srcdir.
848b22bf3fSmrg#
858b22bf3fSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
868b22bf3fSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
878b22bf3fSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
888b22bf3fSmrg# and then we would define $MISSING as
898b22bf3fSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
908b22bf3fSmrg# This will work as long as MISSING is not called from configure, because
918b22bf3fSmrg# unfortunately $(top_srcdir) has no meaning in configure.
928b22bf3fSmrg# However there are other variables, like CC, which are often used in
938b22bf3fSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
948b22bf3fSmrg#
958b22bf3fSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
968b22bf3fSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
978b22bf3fSmrg# configured tree to be moved without reconfiguration.
988b22bf3fSmrg
998b22bf3fSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
1008b22bf3fSmrg[dnl Rely on autoconf to set up CDPATH properly.
1018b22bf3fSmrgAC_PREREQ([2.50])dnl
1028b22bf3fSmrg# expand $ac_aux_dir to an absolute path
1038b22bf3fSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
1048b22bf3fSmrg])
1058b22bf3fSmrg
1068b22bf3fSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
1078b22bf3fSmrg
1088b22bf3fSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
1098b22bf3fSmrg# Free Software Foundation, Inc.
1108b22bf3fSmrg#
1118b22bf3fSmrg# This file is free software; the Free Software Foundation
1128b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
1138b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
1148b22bf3fSmrg
1158b22bf3fSmrg# serial 8
1168b22bf3fSmrg
1178b22bf3fSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
1188b22bf3fSmrg# -------------------------------------
1198b22bf3fSmrg# Define a conditional.
1208b22bf3fSmrgAC_DEFUN([AM_CONDITIONAL],
1218b22bf3fSmrg[AC_PREREQ(2.52)dnl
1228b22bf3fSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1238b22bf3fSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1248b22bf3fSmrgAC_SUBST([$1_TRUE])dnl
1258b22bf3fSmrgAC_SUBST([$1_FALSE])dnl
1268b22bf3fSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
1278b22bf3fSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
1288b22bf3fSmrgif $2; then
1298b22bf3fSmrg  $1_TRUE=
1308b22bf3fSmrg  $1_FALSE='#'
1318b22bf3fSmrgelse
1328b22bf3fSmrg  $1_TRUE='#'
1338b22bf3fSmrg  $1_FALSE=
1348b22bf3fSmrgfi
1358b22bf3fSmrgAC_CONFIG_COMMANDS_PRE(
1368b22bf3fSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1378b22bf3fSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
1388b22bf3fSmrgUsually this means the macro was only invoked conditionally.]])
1398b22bf3fSmrgfi])])
1408b22bf3fSmrg
1418b22bf3fSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
1428b22bf3fSmrg# Free Software Foundation, Inc.
1438b22bf3fSmrg#
1448b22bf3fSmrg# This file is free software; the Free Software Foundation
1458b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
1468b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
1478b22bf3fSmrg
1488b22bf3fSmrg# serial 9
1498b22bf3fSmrg
1508b22bf3fSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1518b22bf3fSmrg# written in clear, in which case automake, when reading aclocal.m4,
1528b22bf3fSmrg# will think it sees a *use*, and therefore will trigger all it's
1538b22bf3fSmrg# C support machinery.  Also note that it means that autoscan, seeing
1548b22bf3fSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1558b22bf3fSmrg
1568b22bf3fSmrg
1578b22bf3fSmrg# _AM_DEPENDENCIES(NAME)
1588b22bf3fSmrg# ----------------------
1598b22bf3fSmrg# See how the compiler implements dependency checking.
1608b22bf3fSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
1618b22bf3fSmrg# We try a few techniques and use that to set a single cache variable.
1628b22bf3fSmrg#
1638b22bf3fSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1648b22bf3fSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1658b22bf3fSmrg# dependency, and given that the user is not expected to run this macro,
1668b22bf3fSmrg# just rely on AC_PROG_CC.
1678b22bf3fSmrgAC_DEFUN([_AM_DEPENDENCIES],
1688b22bf3fSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
1698b22bf3fSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1708b22bf3fSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
1718b22bf3fSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1728b22bf3fSmrg
1738b22bf3fSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
1748b22bf3fSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
1758b22bf3fSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1768b22bf3fSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
1778b22bf3fSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1788b22bf3fSmrg                   [depcc="$$1"   am_compiler_list=])
1798b22bf3fSmrg
1808b22bf3fSmrgAC_CACHE_CHECK([dependency style of $depcc],
1818b22bf3fSmrg               [am_cv_$1_dependencies_compiler_type],
1828b22bf3fSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1838b22bf3fSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
1848b22bf3fSmrg  # making bogus files that we don't know about and never remove.  For
1858b22bf3fSmrg  # instance it was reported that on HP-UX the gcc test will end up
1868b22bf3fSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
1878b22bf3fSmrg  # in D'.
1888b22bf3fSmrg  mkdir conftest.dir
1898b22bf3fSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
1908b22bf3fSmrg  # using a relative directory.
1918b22bf3fSmrg  cp "$am_depcomp" conftest.dir
1928b22bf3fSmrg  cd conftest.dir
1938b22bf3fSmrg  # We will build objects and dependencies in a subdirectory because
1948b22bf3fSmrg  # it helps to detect inapplicable dependency modes.  For instance
1958b22bf3fSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
1968b22bf3fSmrg  # side effect of compilation, but ICC will put the dependencies in
1978b22bf3fSmrg  # the current directory while Tru64 will put them in the object
1988b22bf3fSmrg  # directory.
1998b22bf3fSmrg  mkdir sub
2008b22bf3fSmrg
2018b22bf3fSmrg  am_cv_$1_dependencies_compiler_type=none
2028b22bf3fSmrg  if test "$am_compiler_list" = ""; then
2038b22bf3fSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2048b22bf3fSmrg  fi
2058b22bf3fSmrg  for depmode in $am_compiler_list; do
2068b22bf3fSmrg    # Setup a source with many dependencies, because some compilers
2078b22bf3fSmrg    # like to wrap large dependency lists on column 80 (with \), and
2088b22bf3fSmrg    # we should not choose a depcomp mode which is confused by this.
2098b22bf3fSmrg    #
2108b22bf3fSmrg    # We need to recreate these files for each test, as the compiler may
2118b22bf3fSmrg    # overwrite some of them when testing with obscure command lines.
2128b22bf3fSmrg    # This happens at least with the AIX C compiler.
2138b22bf3fSmrg    : > sub/conftest.c
2148b22bf3fSmrg    for i in 1 2 3 4 5 6; do
2158b22bf3fSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
2168b22bf3fSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
2178b22bf3fSmrg      # Solaris 8's {/usr,}/bin/sh.
2188b22bf3fSmrg      touch sub/conftst$i.h
2198b22bf3fSmrg    done
2208b22bf3fSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2218b22bf3fSmrg
2228b22bf3fSmrg    case $depmode in
2238b22bf3fSmrg    nosideeffect)
2248b22bf3fSmrg      # after this tag, mechanisms are not by side-effect, so they'll
2258b22bf3fSmrg      # only be used when explicitly requested
2268b22bf3fSmrg      if test "x$enable_dependency_tracking" = xyes; then
2278b22bf3fSmrg	continue
2288b22bf3fSmrg      else
2298b22bf3fSmrg	break
2308b22bf3fSmrg      fi
2318b22bf3fSmrg      ;;
2328b22bf3fSmrg    none) break ;;
2338b22bf3fSmrg    esac
2348b22bf3fSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
2358b22bf3fSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
2368b22bf3fSmrg    # handle `-M -o', and we need to detect this.
2378b22bf3fSmrg    if depmode=$depmode \
2388b22bf3fSmrg       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
2398b22bf3fSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
2408b22bf3fSmrg       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
2418b22bf3fSmrg         >/dev/null 2>conftest.err &&
2428b22bf3fSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
2438b22bf3fSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
2448b22bf3fSmrg       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
2458b22bf3fSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
2468b22bf3fSmrg      # icc doesn't choke on unknown options, it will just issue warnings
2478b22bf3fSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
2488b22bf3fSmrg      # that says an option was ignored or not supported.
2498b22bf3fSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
2508b22bf3fSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
2518b22bf3fSmrg      # The diagnosis changed in icc 8.0:
2528b22bf3fSmrg      #   icc: Command line remark: option '-MP' not supported
2538b22bf3fSmrg      if (grep 'ignoring option' conftest.err ||
2548b22bf3fSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
2558b22bf3fSmrg        am_cv_$1_dependencies_compiler_type=$depmode
2568b22bf3fSmrg        break
2578b22bf3fSmrg      fi
2588b22bf3fSmrg    fi
2598b22bf3fSmrg  done
2608b22bf3fSmrg
2618b22bf3fSmrg  cd ..
2628b22bf3fSmrg  rm -rf conftest.dir
2638b22bf3fSmrgelse
2648b22bf3fSmrg  am_cv_$1_dependencies_compiler_type=none
2658b22bf3fSmrgfi
2668b22bf3fSmrg])
2678b22bf3fSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
2688b22bf3fSmrgAM_CONDITIONAL([am__fastdep$1], [
2698b22bf3fSmrg  test "x$enable_dependency_tracking" != xno \
2708b22bf3fSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
2718b22bf3fSmrg])
2728b22bf3fSmrg
2738b22bf3fSmrg
2748b22bf3fSmrg# AM_SET_DEPDIR
2758b22bf3fSmrg# -------------
2768b22bf3fSmrg# Choose a directory name for dependency files.
2778b22bf3fSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
2788b22bf3fSmrgAC_DEFUN([AM_SET_DEPDIR],
2798b22bf3fSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
2808b22bf3fSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
2818b22bf3fSmrg])
2828b22bf3fSmrg
2838b22bf3fSmrg
2848b22bf3fSmrg# AM_DEP_TRACK
2858b22bf3fSmrg# ------------
2868b22bf3fSmrgAC_DEFUN([AM_DEP_TRACK],
2878b22bf3fSmrg[AC_ARG_ENABLE(dependency-tracking,
2888b22bf3fSmrg[  --disable-dependency-tracking  speeds up one-time build
2898b22bf3fSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
2908b22bf3fSmrgif test "x$enable_dependency_tracking" != xno; then
2918b22bf3fSmrg  am_depcomp="$ac_aux_dir/depcomp"
2928b22bf3fSmrg  AMDEPBACKSLASH='\'
2938b22bf3fSmrgfi
2948b22bf3fSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
2958b22bf3fSmrgAC_SUBST([AMDEPBACKSLASH])dnl
2968b22bf3fSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
2978b22bf3fSmrg])
2988b22bf3fSmrg
2998b22bf3fSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
3008b22bf3fSmrg
3018b22bf3fSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
3028b22bf3fSmrg# Free Software Foundation, Inc.
3038b22bf3fSmrg#
3048b22bf3fSmrg# This file is free software; the Free Software Foundation
3058b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
3068b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
3078b22bf3fSmrg
3088b22bf3fSmrg#serial 3
3098b22bf3fSmrg
3108b22bf3fSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
3118b22bf3fSmrg# ------------------------------
3128b22bf3fSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
3138b22bf3fSmrg[for mf in $CONFIG_FILES; do
3148b22bf3fSmrg  # Strip MF so we end up with the name of the file.
3158b22bf3fSmrg  mf=`echo "$mf" | sed -e 's/:.*$//'`
3168b22bf3fSmrg  # Check whether this is an Automake generated Makefile or not.
3178b22bf3fSmrg  # We used to match only the files named `Makefile.in', but
3188b22bf3fSmrg  # some people rename them; so instead we look at the file content.
3198b22bf3fSmrg  # Grep'ing the first line is not enough: some people post-process
3208b22bf3fSmrg  # each Makefile.in and add a new line on top of each file to say so.
3218b22bf3fSmrg  # Grep'ing the whole file is not good either: AIX grep has a line
3228b22bf3fSmrg  # limit of 2048, but all sed's we know have understand at least 4000.
3238b22bf3fSmrg  if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
3248b22bf3fSmrg    dirpart=`AS_DIRNAME("$mf")`
3258b22bf3fSmrg  else
3268b22bf3fSmrg    continue
3278b22bf3fSmrg  fi
3288b22bf3fSmrg  # Extract the definition of DEPDIR, am__include, and am__quote
3298b22bf3fSmrg  # from the Makefile without running `make'.
3308b22bf3fSmrg  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
3318b22bf3fSmrg  test -z "$DEPDIR" && continue
3328b22bf3fSmrg  am__include=`sed -n 's/^am__include = //p' < "$mf"`
3338b22bf3fSmrg  test -z "am__include" && continue
3348b22bf3fSmrg  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
3358b22bf3fSmrg  # When using ansi2knr, U may be empty or an underscore; expand it
3368b22bf3fSmrg  U=`sed -n 's/^U = //p' < "$mf"`
3378b22bf3fSmrg  # Find all dependency output files, they are included files with
3388b22bf3fSmrg  # $(DEPDIR) in their names.  We invoke sed twice because it is the
3398b22bf3fSmrg  # simplest approach to changing $(DEPDIR) to its actual value in the
3408b22bf3fSmrg  # expansion.
3418b22bf3fSmrg  for file in `sed -n "
3428b22bf3fSmrg    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
3438b22bf3fSmrg       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
3448b22bf3fSmrg    # Make sure the directory exists.
3458b22bf3fSmrg    test -f "$dirpart/$file" && continue
3468b22bf3fSmrg    fdir=`AS_DIRNAME(["$file"])`
3478b22bf3fSmrg    AS_MKDIR_P([$dirpart/$fdir])
3488b22bf3fSmrg    # echo "creating $dirpart/$file"
3498b22bf3fSmrg    echo '# dummy' > "$dirpart/$file"
3508b22bf3fSmrg  done
3518b22bf3fSmrgdone
3528b22bf3fSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
3538b22bf3fSmrg
3548b22bf3fSmrg
3558b22bf3fSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
3568b22bf3fSmrg# -----------------------------
3578b22bf3fSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
3588b22bf3fSmrg#
3598b22bf3fSmrg# This code is only required when automatic dependency tracking
3608b22bf3fSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
3618b22bf3fSmrg# need in order to bootstrap the dependency handling code.
3628b22bf3fSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
3638b22bf3fSmrg[AC_CONFIG_COMMANDS([depfiles],
3648b22bf3fSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
3658b22bf3fSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
3668b22bf3fSmrg])
3678b22bf3fSmrg
3688b22bf3fSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
3698b22bf3fSmrg# Free Software Foundation, Inc.
3708b22bf3fSmrg#
3718b22bf3fSmrg# This file is free software; the Free Software Foundation
3728b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
3738b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
3748b22bf3fSmrg
3758b22bf3fSmrg# serial 8
3768b22bf3fSmrg
3778b22bf3fSmrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
3788b22bf3fSmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
3798b22bf3fSmrg
3808b22bf3fSmrg# Do all the work for Automake.                             -*- Autoconf -*-
3818b22bf3fSmrg
3828b22bf3fSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
3838b22bf3fSmrg# 2005, 2006 Free Software Foundation, Inc.
3848b22bf3fSmrg#
3858b22bf3fSmrg# This file is free software; the Free Software Foundation
3868b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
3878b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
3888b22bf3fSmrg
3898b22bf3fSmrg# serial 12
3908b22bf3fSmrg
3918b22bf3fSmrg# This macro actually does too much.  Some checks are only needed if
3928b22bf3fSmrg# your package does certain things.  But this isn't really a big deal.
3938b22bf3fSmrg
3948b22bf3fSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
3958b22bf3fSmrg# AM_INIT_AUTOMAKE([OPTIONS])
3968b22bf3fSmrg# -----------------------------------------------
3978b22bf3fSmrg# The call with PACKAGE and VERSION arguments is the old style
3988b22bf3fSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
3998b22bf3fSmrg# and VERSION should now be passed to AC_INIT and removed from
4008b22bf3fSmrg# the call to AM_INIT_AUTOMAKE.
4018b22bf3fSmrg# We support both call styles for the transition.  After
4028b22bf3fSmrg# the next Automake release, Autoconf can make the AC_INIT
4038b22bf3fSmrg# arguments mandatory, and then we can depend on a new Autoconf
4048b22bf3fSmrg# release and drop the old call support.
4058b22bf3fSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
4068b22bf3fSmrg[AC_PREREQ([2.60])dnl
4078b22bf3fSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
4088b22bf3fSmrgdnl the ones we care about.
4098b22bf3fSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
4108b22bf3fSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
4118b22bf3fSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
4128b22bf3fSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
4138b22bf3fSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
4148b22bf3fSmrg  # is not polluted with repeated "-I."
4158b22bf3fSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
4168b22bf3fSmrg  # test to see if srcdir already configured
4178b22bf3fSmrg  if test -f $srcdir/config.status; then
4188b22bf3fSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
4198b22bf3fSmrg  fi
4208b22bf3fSmrgfi
4218b22bf3fSmrg
4228b22bf3fSmrg# test whether we have cygpath
4238b22bf3fSmrgif test -z "$CYGPATH_W"; then
4248b22bf3fSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
4258b22bf3fSmrg    CYGPATH_W='cygpath -w'
4268b22bf3fSmrg  else
4278b22bf3fSmrg    CYGPATH_W=echo
4288b22bf3fSmrg  fi
4298b22bf3fSmrgfi
4308b22bf3fSmrgAC_SUBST([CYGPATH_W])
4318b22bf3fSmrg
4328b22bf3fSmrg# Define the identity of the package.
4338b22bf3fSmrgdnl Distinguish between old-style and new-style calls.
4348b22bf3fSmrgm4_ifval([$2],
4358b22bf3fSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
4368b22bf3fSmrg AC_SUBST([PACKAGE], [$1])dnl
4378b22bf3fSmrg AC_SUBST([VERSION], [$2])],
4388b22bf3fSmrg[_AM_SET_OPTIONS([$1])dnl
4398b22bf3fSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
4408b22bf3fSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
4418b22bf3fSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
4428b22bf3fSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
4438b22bf3fSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
4448b22bf3fSmrg
4458b22bf3fSmrg_AM_IF_OPTION([no-define],,
4468b22bf3fSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
4478b22bf3fSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
4488b22bf3fSmrg
4498b22bf3fSmrg# Some tools Automake needs.
4508b22bf3fSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
4518b22bf3fSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
4528b22bf3fSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
4538b22bf3fSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
4548b22bf3fSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
4558b22bf3fSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
4568b22bf3fSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
4578b22bf3fSmrgAM_PROG_INSTALL_SH
4588b22bf3fSmrgAM_PROG_INSTALL_STRIP
4598b22bf3fSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
4608b22bf3fSmrg# We need awk for the "check" target.  The system "awk" is bad on
4618b22bf3fSmrg# some platforms.
4628b22bf3fSmrgAC_REQUIRE([AC_PROG_AWK])dnl
4638b22bf3fSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
4648b22bf3fSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
4658b22bf3fSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
4668b22bf3fSmrg              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
4678b22bf3fSmrg	      		     [_AM_PROG_TAR([v7])])])
4688b22bf3fSmrg_AM_IF_OPTION([no-dependencies],,
4698b22bf3fSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
4708b22bf3fSmrg                  [_AM_DEPENDENCIES(CC)],
4718b22bf3fSmrg                  [define([AC_PROG_CC],
4728b22bf3fSmrg                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
4738b22bf3fSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
4748b22bf3fSmrg                  [_AM_DEPENDENCIES(CXX)],
4758b22bf3fSmrg                  [define([AC_PROG_CXX],
4768b22bf3fSmrg                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
4778b22bf3fSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
4788b22bf3fSmrg                  [_AM_DEPENDENCIES(OBJC)],
4798b22bf3fSmrg                  [define([AC_PROG_OBJC],
4808b22bf3fSmrg                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
4818b22bf3fSmrg])
4828b22bf3fSmrg])
4838b22bf3fSmrg
4848b22bf3fSmrg
4858b22bf3fSmrg# When config.status generates a header, we must update the stamp-h file.
4868b22bf3fSmrg# This file resides in the same directory as the config header
4878b22bf3fSmrg# that is generated.  The stamp files are numbered to have different names.
4888b22bf3fSmrg
4898b22bf3fSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
4908b22bf3fSmrg# loop where config.status creates the headers, so we can generate
4918b22bf3fSmrg# our stamp files there.
4928b22bf3fSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
4938b22bf3fSmrg[# Compute $1's index in $config_headers.
4948b22bf3fSmrg_am_stamp_count=1
4958b22bf3fSmrgfor _am_header in $config_headers :; do
4968b22bf3fSmrg  case $_am_header in
4978b22bf3fSmrg    $1 | $1:* )
4988b22bf3fSmrg      break ;;
4998b22bf3fSmrg    * )
5008b22bf3fSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
5018b22bf3fSmrg  esac
5028b22bf3fSmrgdone
5038b22bf3fSmrgecho "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
5048b22bf3fSmrg
5058b22bf3fSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
5068b22bf3fSmrg#
5078b22bf3fSmrg# This file is free software; the Free Software Foundation
5088b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
5098b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
5108b22bf3fSmrg
5118b22bf3fSmrg# AM_PROG_INSTALL_SH
5128b22bf3fSmrg# ------------------
5138b22bf3fSmrg# Define $install_sh.
5148b22bf3fSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
5158b22bf3fSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
5168b22bf3fSmrginstall_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
5178b22bf3fSmrgAC_SUBST(install_sh)])
5188b22bf3fSmrg
5198b22bf3fSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
5208b22bf3fSmrg#
5218b22bf3fSmrg# This file is free software; the Free Software Foundation
5228b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
5238b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
5248b22bf3fSmrg
5258b22bf3fSmrg# serial 2
5268b22bf3fSmrg
5278b22bf3fSmrg# Check whether the underlying file-system supports filenames
5288b22bf3fSmrg# with a leading dot.  For instance MS-DOS doesn't.
5298b22bf3fSmrgAC_DEFUN([AM_SET_LEADING_DOT],
5308b22bf3fSmrg[rm -rf .tst 2>/dev/null
5318b22bf3fSmrgmkdir .tst 2>/dev/null
5328b22bf3fSmrgif test -d .tst; then
5338b22bf3fSmrg  am__leading_dot=.
5348b22bf3fSmrgelse
5358b22bf3fSmrg  am__leading_dot=_
5368b22bf3fSmrgfi
5378b22bf3fSmrgrmdir .tst 2>/dev/null
5388b22bf3fSmrgAC_SUBST([am__leading_dot])])
5398b22bf3fSmrg
5408b22bf3fSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
5418b22bf3fSmrg# From Jim Meyering
5428b22bf3fSmrg
5438b22bf3fSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
5448b22bf3fSmrg# Free Software Foundation, Inc.
5458b22bf3fSmrg#
5468b22bf3fSmrg# This file is free software; the Free Software Foundation
5478b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
5488b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
5498b22bf3fSmrg
5508b22bf3fSmrg# serial 4
5518b22bf3fSmrg
5528b22bf3fSmrgAC_DEFUN([AM_MAINTAINER_MODE],
5538b22bf3fSmrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
5548b22bf3fSmrg  dnl maintainer-mode is disabled by default
5558b22bf3fSmrg  AC_ARG_ENABLE(maintainer-mode,
5568b22bf3fSmrg[  --enable-maintainer-mode  enable make rules and dependencies not useful
5578b22bf3fSmrg			  (and sometimes confusing) to the casual installer],
5588b22bf3fSmrg      USE_MAINTAINER_MODE=$enableval,
5598b22bf3fSmrg      USE_MAINTAINER_MODE=no)
5608b22bf3fSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
5618b22bf3fSmrg  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
5628b22bf3fSmrg  MAINT=$MAINTAINER_MODE_TRUE
5638b22bf3fSmrg  AC_SUBST(MAINT)dnl
5648b22bf3fSmrg]
5658b22bf3fSmrg)
5668b22bf3fSmrg
5678b22bf3fSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
5688b22bf3fSmrg
5698b22bf3fSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
5708b22bf3fSmrg
5718b22bf3fSmrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
5728b22bf3fSmrg#
5738b22bf3fSmrg# This file is free software; the Free Software Foundation
5748b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
5758b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
5768b22bf3fSmrg
5778b22bf3fSmrg# serial 3
5788b22bf3fSmrg
5798b22bf3fSmrg# AM_MAKE_INCLUDE()
5808b22bf3fSmrg# -----------------
5818b22bf3fSmrg# Check to see how make treats includes.
5828b22bf3fSmrgAC_DEFUN([AM_MAKE_INCLUDE],
5838b22bf3fSmrg[am_make=${MAKE-make}
5848b22bf3fSmrgcat > confinc << 'END'
5858b22bf3fSmrgam__doit:
5868b22bf3fSmrg	@echo done
5878b22bf3fSmrg.PHONY: am__doit
5888b22bf3fSmrgEND
5898b22bf3fSmrg# If we don't find an include directive, just comment out the code.
5908b22bf3fSmrgAC_MSG_CHECKING([for style of include used by $am_make])
5918b22bf3fSmrgam__include="#"
5928b22bf3fSmrgam__quote=
5938b22bf3fSmrg_am_result=none
5948b22bf3fSmrg# First try GNU make style include.
5958b22bf3fSmrgecho "include confinc" > confmf
5968b22bf3fSmrg# We grep out `Entering directory' and `Leaving directory'
5978b22bf3fSmrg# messages which can occur if `w' ends up in MAKEFLAGS.
5988b22bf3fSmrg# In particular we don't look at `^make:' because GNU make might
5998b22bf3fSmrg# be invoked under some other name (usually "gmake"), in which
6008b22bf3fSmrg# case it prints its new name instead of `make'.
6018b22bf3fSmrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
6028b22bf3fSmrg   am__include=include
6038b22bf3fSmrg   am__quote=
6048b22bf3fSmrg   _am_result=GNU
6058b22bf3fSmrgfi
6068b22bf3fSmrg# Now try BSD make style include.
6078b22bf3fSmrgif test "$am__include" = "#"; then
6088b22bf3fSmrg   echo '.include "confinc"' > confmf
6098b22bf3fSmrg   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
6108b22bf3fSmrg      am__include=.include
6118b22bf3fSmrg      am__quote="\""
6128b22bf3fSmrg      _am_result=BSD
6138b22bf3fSmrg   fi
6148b22bf3fSmrgfi
6158b22bf3fSmrgAC_SUBST([am__include])
6168b22bf3fSmrgAC_SUBST([am__quote])
6178b22bf3fSmrgAC_MSG_RESULT([$_am_result])
6188b22bf3fSmrgrm -f confinc confmf
6198b22bf3fSmrg])
6208b22bf3fSmrg
6218b22bf3fSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
6228b22bf3fSmrg
6238b22bf3fSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
6248b22bf3fSmrg# Free Software Foundation, Inc.
6258b22bf3fSmrg#
6268b22bf3fSmrg# This file is free software; the Free Software Foundation
6278b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
6288b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
6298b22bf3fSmrg
6308b22bf3fSmrg# serial 5
6318b22bf3fSmrg
6328b22bf3fSmrg# AM_MISSING_PROG(NAME, PROGRAM)
6338b22bf3fSmrg# ------------------------------
6348b22bf3fSmrgAC_DEFUN([AM_MISSING_PROG],
6358b22bf3fSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
6368b22bf3fSmrg$1=${$1-"${am_missing_run}$2"}
6378b22bf3fSmrgAC_SUBST($1)])
6388b22bf3fSmrg
6398b22bf3fSmrg
6408b22bf3fSmrg# AM_MISSING_HAS_RUN
6418b22bf3fSmrg# ------------------
6428b22bf3fSmrg# Define MISSING if not defined so far and test if it supports --run.
6438b22bf3fSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
6448b22bf3fSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
6458b22bf3fSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
6468b22bf3fSmrgAC_REQUIRE_AUX_FILE([missing])dnl
6478b22bf3fSmrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
6488b22bf3fSmrg# Use eval to expand $SHELL
6498b22bf3fSmrgif eval "$MISSING --run true"; then
6508b22bf3fSmrg  am_missing_run="$MISSING --run "
6518b22bf3fSmrgelse
6528b22bf3fSmrg  am_missing_run=
6538b22bf3fSmrg  AC_MSG_WARN([`missing' script is too old or missing])
6548b22bf3fSmrgfi
6558b22bf3fSmrg])
6568b22bf3fSmrg
6578b22bf3fSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
6588b22bf3fSmrg#
6598b22bf3fSmrg# This file is free software; the Free Software Foundation
6608b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
6618b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
6628b22bf3fSmrg
6638b22bf3fSmrg# AM_PROG_MKDIR_P
6648b22bf3fSmrg# ---------------
6658b22bf3fSmrg# Check for `mkdir -p'.
6668b22bf3fSmrgAC_DEFUN([AM_PROG_MKDIR_P],
6678b22bf3fSmrg[AC_PREREQ([2.60])dnl
6688b22bf3fSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
6698b22bf3fSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
6708b22bf3fSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
6718b22bf3fSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
6728b22bf3fSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
6738b22bf3fSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
6748b22bf3fSmrgdnl adjustment using top_builddir (which is defined more often than
6758b22bf3fSmrgdnl MKDIR_P).
6768b22bf3fSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
6778b22bf3fSmrgcase $mkdir_p in
6788b22bf3fSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
6798b22bf3fSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
6808b22bf3fSmrgesac
6818b22bf3fSmrg])
6828b22bf3fSmrg
6838b22bf3fSmrg# Helper functions for option handling.                     -*- Autoconf -*-
6848b22bf3fSmrg
6858b22bf3fSmrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
6868b22bf3fSmrg#
6878b22bf3fSmrg# This file is free software; the Free Software Foundation
6888b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
6898b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
6908b22bf3fSmrg
6918b22bf3fSmrg# serial 3
6928b22bf3fSmrg
6938b22bf3fSmrg# _AM_MANGLE_OPTION(NAME)
6948b22bf3fSmrg# -----------------------
6958b22bf3fSmrgAC_DEFUN([_AM_MANGLE_OPTION],
6968b22bf3fSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
6978b22bf3fSmrg
6988b22bf3fSmrg# _AM_SET_OPTION(NAME)
6998b22bf3fSmrg# ------------------------------
7008b22bf3fSmrg# Set option NAME.  Presently that only means defining a flag for this option.
7018b22bf3fSmrgAC_DEFUN([_AM_SET_OPTION],
7028b22bf3fSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
7038b22bf3fSmrg
7048b22bf3fSmrg# _AM_SET_OPTIONS(OPTIONS)
7058b22bf3fSmrg# ----------------------------------
7068b22bf3fSmrg# OPTIONS is a space-separated list of Automake options.
7078b22bf3fSmrgAC_DEFUN([_AM_SET_OPTIONS],
7088b22bf3fSmrg[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
7098b22bf3fSmrg
7108b22bf3fSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
7118b22bf3fSmrg# -------------------------------------------
7128b22bf3fSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
7138b22bf3fSmrgAC_DEFUN([_AM_IF_OPTION],
7148b22bf3fSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
7158b22bf3fSmrg
7168b22bf3fSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
7178b22bf3fSmrg
7188b22bf3fSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
7198b22bf3fSmrg# Free Software Foundation, Inc.
7208b22bf3fSmrg#
7218b22bf3fSmrg# This file is free software; the Free Software Foundation
7228b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
7238b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
7248b22bf3fSmrg
7258b22bf3fSmrg# serial 4
7268b22bf3fSmrg
7278b22bf3fSmrg# AM_SANITY_CHECK
7288b22bf3fSmrg# ---------------
7298b22bf3fSmrgAC_DEFUN([AM_SANITY_CHECK],
7308b22bf3fSmrg[AC_MSG_CHECKING([whether build environment is sane])
7318b22bf3fSmrg# Just in case
7328b22bf3fSmrgsleep 1
7338b22bf3fSmrgecho timestamp > conftest.file
7348b22bf3fSmrg# Do `set' in a subshell so we don't clobber the current shell's
7358b22bf3fSmrg# arguments.  Must try -L first in case configure is actually a
7368b22bf3fSmrg# symlink; some systems play weird games with the mod time of symlinks
7378b22bf3fSmrg# (eg FreeBSD returns the mod time of the symlink's containing
7388b22bf3fSmrg# directory).
7398b22bf3fSmrgif (
7408b22bf3fSmrg   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
7418b22bf3fSmrg   if test "$[*]" = "X"; then
7428b22bf3fSmrg      # -L didn't work.
7438b22bf3fSmrg      set X `ls -t $srcdir/configure conftest.file`
7448b22bf3fSmrg   fi
7458b22bf3fSmrg   rm -f conftest.file
7468b22bf3fSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
7478b22bf3fSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
7488b22bf3fSmrg
7498b22bf3fSmrg      # If neither matched, then we have a broken ls.  This can happen
7508b22bf3fSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
7518b22bf3fSmrg      # broken ls alias from the environment.  This has actually
7528b22bf3fSmrg      # happened.  Such a system could not be considered "sane".
7538b22bf3fSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
7548b22bf3fSmrgalias in your environment])
7558b22bf3fSmrg   fi
7568b22bf3fSmrg
7578b22bf3fSmrg   test "$[2]" = conftest.file
7588b22bf3fSmrg   )
7598b22bf3fSmrgthen
7608b22bf3fSmrg   # Ok.
7618b22bf3fSmrg   :
7628b22bf3fSmrgelse
7638b22bf3fSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
7648b22bf3fSmrgCheck your system clock])
7658b22bf3fSmrgfi
7668b22bf3fSmrgAC_MSG_RESULT(yes)])
7678b22bf3fSmrg
7688b22bf3fSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
7698b22bf3fSmrg#
7708b22bf3fSmrg# This file is free software; the Free Software Foundation
7718b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
7728b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
7738b22bf3fSmrg
7748b22bf3fSmrg# AM_PROG_INSTALL_STRIP
7758b22bf3fSmrg# ---------------------
7768b22bf3fSmrg# One issue with vendor `install' (even GNU) is that you can't
7778b22bf3fSmrg# specify the program used to strip binaries.  This is especially
7788b22bf3fSmrg# annoying in cross-compiling environments, where the build's strip
7798b22bf3fSmrg# is unlikely to handle the host's binaries.
7808b22bf3fSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
7818b22bf3fSmrg# always use install-sh in `make install-strip', and initialize
7828b22bf3fSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
7838b22bf3fSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
7848b22bf3fSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
7858b22bf3fSmrg# Installed binaries are usually stripped using `strip' when the user
7868b22bf3fSmrg# run `make install-strip'.  However `strip' might not be the right
7878b22bf3fSmrg# tool to use in cross-compilation environments, therefore Automake
7888b22bf3fSmrg# will honor the `STRIP' environment variable to overrule this program.
7898b22bf3fSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
7908b22bf3fSmrgif test "$cross_compiling" != no; then
7918b22bf3fSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
7928b22bf3fSmrgfi
7938b22bf3fSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
7948b22bf3fSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
7958b22bf3fSmrg
7968b22bf3fSmrg# Copyright (C) 2006  Free Software Foundation, Inc.
7978b22bf3fSmrg#
7988b22bf3fSmrg# This file is free software; the Free Software Foundation
7998b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
8008b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
8018b22bf3fSmrg
8028b22bf3fSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
8038b22bf3fSmrg# ---------------------------
8048b22bf3fSmrg# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.
8058b22bf3fSmrg# This macro is traced by Automake.
8068b22bf3fSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
8078b22bf3fSmrg
8088b22bf3fSmrg# Check how to create a tarball.                            -*- Autoconf -*-
8098b22bf3fSmrg
8108b22bf3fSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
8118b22bf3fSmrg#
8128b22bf3fSmrg# This file is free software; the Free Software Foundation
8138b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
8148b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
8158b22bf3fSmrg
8168b22bf3fSmrg# serial 2
8178b22bf3fSmrg
8188b22bf3fSmrg# _AM_PROG_TAR(FORMAT)
8198b22bf3fSmrg# --------------------
8208b22bf3fSmrg# Check how to create a tarball in format FORMAT.
8218b22bf3fSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
8228b22bf3fSmrg#
8238b22bf3fSmrg# Substitute a variable $(am__tar) that is a command
8248b22bf3fSmrg# writing to stdout a FORMAT-tarball containing the directory
8258b22bf3fSmrg# $tardir.
8268b22bf3fSmrg#     tardir=directory && $(am__tar) > result.tar
8278b22bf3fSmrg#
8288b22bf3fSmrg# Substitute a variable $(am__untar) that extract such
8298b22bf3fSmrg# a tarball read from stdin.
8308b22bf3fSmrg#     $(am__untar) < result.tar
8318b22bf3fSmrgAC_DEFUN([_AM_PROG_TAR],
8328b22bf3fSmrg[# Always define AMTAR for backward compatibility.
8338b22bf3fSmrgAM_MISSING_PROG([AMTAR], [tar])
8348b22bf3fSmrgm4_if([$1], [v7],
8358b22bf3fSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
8368b22bf3fSmrg     [m4_case([$1], [ustar],, [pax],,
8378b22bf3fSmrg              [m4_fatal([Unknown tar format])])
8388b22bf3fSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
8398b22bf3fSmrg# Loop over all known methods to create a tar archive until one works.
8408b22bf3fSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
8418b22bf3fSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
8428b22bf3fSmrg# Do not fold the above two line into one, because Tru64 sh and
8438b22bf3fSmrg# Solaris sh will not grok spaces in the rhs of `-'.
8448b22bf3fSmrgfor _am_tool in $_am_tools
8458b22bf3fSmrgdo
8468b22bf3fSmrg  case $_am_tool in
8478b22bf3fSmrg  gnutar)
8488b22bf3fSmrg    for _am_tar in tar gnutar gtar;
8498b22bf3fSmrg    do
8508b22bf3fSmrg      AM_RUN_LOG([$_am_tar --version]) && break
8518b22bf3fSmrg    done
8528b22bf3fSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
8538b22bf3fSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
8548b22bf3fSmrg    am__untar="$_am_tar -xf -"
8558b22bf3fSmrg    ;;
8568b22bf3fSmrg  plaintar)
8578b22bf3fSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
8588b22bf3fSmrg    # ustar tarball either.
8598b22bf3fSmrg    (tar --version) >/dev/null 2>&1 && continue
8608b22bf3fSmrg    am__tar='tar chf - "$$tardir"'
8618b22bf3fSmrg    am__tar_='tar chf - "$tardir"'
8628b22bf3fSmrg    am__untar='tar xf -'
8638b22bf3fSmrg    ;;
8648b22bf3fSmrg  pax)
8658b22bf3fSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
8668b22bf3fSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
8678b22bf3fSmrg    am__untar='pax -r'
8688b22bf3fSmrg    ;;
8698b22bf3fSmrg  cpio)
8708b22bf3fSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
8718b22bf3fSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
8728b22bf3fSmrg    am__untar='cpio -i -H $1 -d'
8738b22bf3fSmrg    ;;
8748b22bf3fSmrg  none)
8758b22bf3fSmrg    am__tar=false
8768b22bf3fSmrg    am__tar_=false
8778b22bf3fSmrg    am__untar=false
8788b22bf3fSmrg    ;;
8798b22bf3fSmrg  esac
8808b22bf3fSmrg
8818b22bf3fSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
8828b22bf3fSmrg  # and am__untar set.
8838b22bf3fSmrg  test -n "${am_cv_prog_tar_$1}" && break
8848b22bf3fSmrg
8858b22bf3fSmrg  # tar/untar a dummy directory, and stop if the command works
8868b22bf3fSmrg  rm -rf conftest.dir
8878b22bf3fSmrg  mkdir conftest.dir
8888b22bf3fSmrg  echo GrepMe > conftest.dir/file
8898b22bf3fSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
8908b22bf3fSmrg  rm -rf conftest.dir
8918b22bf3fSmrg  if test -s conftest.tar; then
8928b22bf3fSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
8938b22bf3fSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
8948b22bf3fSmrg  fi
8958b22bf3fSmrgdone
8968b22bf3fSmrgrm -rf conftest.dir
8978b22bf3fSmrg
8988b22bf3fSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
8998b22bf3fSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
9008b22bf3fSmrgAC_SUBST([am__tar])
9018b22bf3fSmrgAC_SUBST([am__untar])
9028b22bf3fSmrg]) # _AM_PROG_TAR
9038b22bf3fSmrg
9048b22bf3fSmrgdnl
9058b22bf3fSmrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
9068b22bf3fSmrgdnl 
9078b22bf3fSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
9088b22bf3fSmrgdnl copy of this software and associated documentation files (the
9098b22bf3fSmrgdnl "Software"), to deal in the Software without restriction, including
9108b22bf3fSmrgdnl without limitation the rights to use, copy, modify, merge, publish,
9118b22bf3fSmrgdnl distribute, and/or sell copies of the Software, and to permit persons
9128b22bf3fSmrgdnl to whom the Software is furnished to do so, provided that the above
9138b22bf3fSmrgdnl copyright notice(s) and this permission notice appear in all copies of
9148b22bf3fSmrgdnl the Software and that both the above copyright notice(s) and this
9158b22bf3fSmrgdnl permission notice appear in supporting documentation.
9168b22bf3fSmrgdnl
9178b22bf3fSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
9188b22bf3fSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
9198b22bf3fSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
9208b22bf3fSmrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
9218b22bf3fSmrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
9228b22bf3fSmrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
9238b22bf3fSmrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
9248b22bf3fSmrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
9258b22bf3fSmrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
9268b22bf3fSmrgdnl
9278b22bf3fSmrgdnl Except as contained in this notice, the name of a copyright holder
9288b22bf3fSmrgdnl shall not be used in advertising or otherwise to promote the sale, use
9298b22bf3fSmrgdnl or other dealings in this Software without prior written authorization
9308b22bf3fSmrgdnl of the copyright holder.
9318b22bf3fSmrg
9328b22bf3fSmrg# XORG_MACROS_VERSION(required-version)
9338b22bf3fSmrg# -------------------------------------
9348b22bf3fSmrg# Minimum version: 1.1.0
9358b22bf3fSmrg#
9368b22bf3fSmrg# If you're using a macro added in Version 1.1 or newer, include this in
9378b22bf3fSmrg# your configure.ac with the minimum required version, such as:
9388b22bf3fSmrg# XORG_MACROS_VERSION(1.1)
9398b22bf3fSmrg#
9408b22bf3fSmrg# To force at least a version with this macro defined, also add:
9418b22bf3fSmrg# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
9428b22bf3fSmrg#
9438b22bf3fSmrg#
9448b22bf3fSmrg# See the "minimum version" comment for each macro you use to see what 
9458b22bf3fSmrg# version you require.
9468b22bf3fSmrgAC_DEFUN([XORG_MACROS_VERSION],[
9478b22bf3fSmrg	[XORG_MACROS_needed_version=$1
9488b22bf3fSmrg	XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
9498b22bf3fSmrg	XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
9508b22bf3fSmrg	AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
9518b22bf3fSmrg	[XORG_MACROS_version=1.1.5
9528b22bf3fSmrg	XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
9538b22bf3fSmrg	XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
9548b22bf3fSmrg	if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
9558b22bf3fSmrg		AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x])
9568b22bf3fSmrg	fi
9578b22bf3fSmrg	if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
9588b22bf3fSmrg		AC_MSG_ERROR([configure built with too old of a version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.${XORG_MACROS_minor}.0 or newer])
9598b22bf3fSmrg	fi
9608b22bf3fSmrg	AC_MSG_RESULT([yes, $XORG_MACROS_version])
9618b22bf3fSmrg]) # XORG_MACROS_VERSION
9628b22bf3fSmrg
9638b22bf3fSmrg# XORG_PROG_RAWCPP()
9648b22bf3fSmrg# ------------------
9658b22bf3fSmrg# Minimum version: 1.0.0
9668b22bf3fSmrg#
9678b22bf3fSmrg# Find cpp program and necessary flags for use in pre-processing text files
9688b22bf3fSmrg# such as man pages and config files
9698b22bf3fSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
9708b22bf3fSmrgAC_REQUIRE([AC_PROG_CPP])
9718b22bf3fSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
9728b22bf3fSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9738b22bf3fSmrg
9748b22bf3fSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
9758b22bf3fSmrg# which is not the best choice for supporting other OS'es, but covers most
9768b22bf3fSmrg# of the ones we need for now.
9778b22bf3fSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
9788b22bf3fSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
9798b22bf3fSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9808b22bf3fSmrg	AC_MSG_RESULT([no])
9818b22bf3fSmrgelse
9828b22bf3fSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9838b22bf3fSmrg		RAWCPPFLAGS=-undef
9848b22bf3fSmrg		AC_MSG_RESULT([yes])
9858b22bf3fSmrg	else
9868b22bf3fSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
9878b22bf3fSmrg	fi
9888b22bf3fSmrgfi
9898b22bf3fSmrgrm -f conftest.$ac_ext
9908b22bf3fSmrg
9918b22bf3fSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
9928b22bf3fSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
9938b22bf3fSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9948b22bf3fSmrg	AC_MSG_RESULT([no])
9958b22bf3fSmrgelse
9968b22bf3fSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9978b22bf3fSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
9988b22bf3fSmrg		AC_MSG_RESULT([yes])
9998b22bf3fSmrg	else
10008b22bf3fSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
10018b22bf3fSmrg	fi
10028b22bf3fSmrgfi
10038b22bf3fSmrgrm -f conftest.$ac_ext
10048b22bf3fSmrgAC_SUBST(RAWCPPFLAGS)
10058b22bf3fSmrg]) # XORG_PROG_RAWCPP
10068b22bf3fSmrg
10078b22bf3fSmrg# XORG_MANPAGE_SECTIONS()
10088b22bf3fSmrg# -----------------------
10098b22bf3fSmrg# Minimum version: 1.0.0
10108b22bf3fSmrg#
10118b22bf3fSmrg# Determine which sections man pages go in for the different man page types
10128b22bf3fSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
10138b22bf3fSmrg# Not sure if there's any better way than just hardcoding by OS name.
10148b22bf3fSmrg# Override default settings by setting environment variables
10158b22bf3fSmrg
10168b22bf3fSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
10178b22bf3fSmrgAC_REQUIRE([AC_CANONICAL_HOST])
10188b22bf3fSmrg
10198b22bf3fSmrgif test x$APP_MAN_SUFFIX = x    ; then
10208b22bf3fSmrg    APP_MAN_SUFFIX=1
10218b22bf3fSmrgfi
10228b22bf3fSmrgif test x$APP_MAN_DIR = x    ; then
10238b22bf3fSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
10248b22bf3fSmrgfi
10258b22bf3fSmrg
10268b22bf3fSmrgif test x$LIB_MAN_SUFFIX = x    ; then
10278b22bf3fSmrg    LIB_MAN_SUFFIX=3
10288b22bf3fSmrgfi
10298b22bf3fSmrgif test x$LIB_MAN_DIR = x    ; then
10308b22bf3fSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
10318b22bf3fSmrgfi
10328b22bf3fSmrg
10338b22bf3fSmrgif test x$FILE_MAN_SUFFIX = x    ; then
10348b22bf3fSmrg    case $host_os in
10358b22bf3fSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
10368b22bf3fSmrg	*)		FILE_MAN_SUFFIX=5  ;;
10378b22bf3fSmrg    esac
10388b22bf3fSmrgfi
10398b22bf3fSmrgif test x$FILE_MAN_DIR = x    ; then
10408b22bf3fSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
10418b22bf3fSmrgfi
10428b22bf3fSmrg
10438b22bf3fSmrgif test x$MISC_MAN_SUFFIX = x    ; then
10448b22bf3fSmrg    case $host_os in
10458b22bf3fSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
10468b22bf3fSmrg	*)		MISC_MAN_SUFFIX=7  ;;
10478b22bf3fSmrg    esac
10488b22bf3fSmrgfi
10498b22bf3fSmrgif test x$MISC_MAN_DIR = x    ; then
10508b22bf3fSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
10518b22bf3fSmrgfi
10528b22bf3fSmrg
10538b22bf3fSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
10548b22bf3fSmrg    case $host_os in
10558b22bf3fSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
10568b22bf3fSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
10578b22bf3fSmrg    esac
10588b22bf3fSmrgfi
10598b22bf3fSmrgif test x$DRIVER_MAN_DIR = x    ; then
10608b22bf3fSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
10618b22bf3fSmrgfi
10628b22bf3fSmrg
10638b22bf3fSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
10648b22bf3fSmrg    case $host_os in
10658b22bf3fSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
10668b22bf3fSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
10678b22bf3fSmrg    esac
10688b22bf3fSmrgfi
10698b22bf3fSmrgif test x$ADMIN_MAN_DIR = x    ; then
10708b22bf3fSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
10718b22bf3fSmrgfi
10728b22bf3fSmrg
10738b22bf3fSmrg
10748b22bf3fSmrgAC_SUBST([APP_MAN_SUFFIX])
10758b22bf3fSmrgAC_SUBST([LIB_MAN_SUFFIX])
10768b22bf3fSmrgAC_SUBST([FILE_MAN_SUFFIX])
10778b22bf3fSmrgAC_SUBST([MISC_MAN_SUFFIX])
10788b22bf3fSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
10798b22bf3fSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
10808b22bf3fSmrgAC_SUBST([APP_MAN_DIR])
10818b22bf3fSmrgAC_SUBST([LIB_MAN_DIR])
10828b22bf3fSmrgAC_SUBST([FILE_MAN_DIR])
10838b22bf3fSmrgAC_SUBST([MISC_MAN_DIR])
10848b22bf3fSmrgAC_SUBST([DRIVER_MAN_DIR])
10858b22bf3fSmrgAC_SUBST([ADMIN_MAN_DIR])
10868b22bf3fSmrg]) # XORG_MANPAGE_SECTIONS
10878b22bf3fSmrg
10888b22bf3fSmrg# XORG_CHECK_LINUXDOC
10898b22bf3fSmrg# -------------------
10908b22bf3fSmrg# Minimum version: 1.0.0
10918b22bf3fSmrg#
10928b22bf3fSmrg# Defines the variable MAKE_TEXT if the necessary tools and
10938b22bf3fSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
10948b22bf3fSmrg# Whether or not the necessary tools and files are found can be checked
10958b22bf3fSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
10968b22bf3fSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
10978b22bf3fSmrgXORG_SGML_PATH=$prefix/share/sgml
10988b22bf3fSmrgHAVE_DEFS_ENT=
10998b22bf3fSmrg
11008b22bf3fSmrgif test x"$cross_compiling" = x"yes" ; then
11018b22bf3fSmrg  HAVE_DEFS_ENT=no
11028b22bf3fSmrgelse
11038b22bf3fSmrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
11048b22bf3fSmrgfi
11058b22bf3fSmrg
11068b22bf3fSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
11078b22bf3fSmrgAC_PATH_PROG(PS2PDF, ps2pdf)
11088b22bf3fSmrg
11098b22bf3fSmrgAC_MSG_CHECKING([Whether to build documentation])
11108b22bf3fSmrg
11118b22bf3fSmrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
11128b22bf3fSmrg   BUILDDOC=yes
11138b22bf3fSmrgelse
11148b22bf3fSmrg   BUILDDOC=no
11158b22bf3fSmrgfi
11168b22bf3fSmrg
11178b22bf3fSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
11188b22bf3fSmrg
11198b22bf3fSmrgAC_MSG_RESULT([$BUILDDOC])
11208b22bf3fSmrg
11218b22bf3fSmrgAC_MSG_CHECKING([Whether to build pdf documentation])
11228b22bf3fSmrg
11238b22bf3fSmrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
11248b22bf3fSmrg   BUILDPDFDOC=yes
11258b22bf3fSmrgelse
11268b22bf3fSmrg   BUILDPDFDOC=no
11278b22bf3fSmrgfi
11288b22bf3fSmrg
11298b22bf3fSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
11308b22bf3fSmrg
11318b22bf3fSmrgAC_MSG_RESULT([$BUILDPDFDOC])
11328b22bf3fSmrg
11338b22bf3fSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
11348b22bf3fSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
11358b22bf3fSmrgMAKE_PDF="$PS2PDF"
11368b22bf3fSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
11378b22bf3fSmrg
11388b22bf3fSmrgAC_SUBST(MAKE_TEXT)
11398b22bf3fSmrgAC_SUBST(MAKE_PS)
11408b22bf3fSmrgAC_SUBST(MAKE_PDF)
11418b22bf3fSmrgAC_SUBST(MAKE_HTML)
11428b22bf3fSmrg]) # XORG_CHECK_LINUXDOC
11438b22bf3fSmrg
11448b22bf3fSmrg# XORG_CHECK_DOCBOOK
11458b22bf3fSmrg# -------------------
11468b22bf3fSmrg# Minimum version: 1.0.0
11478b22bf3fSmrg#
11488b22bf3fSmrg# Checks for the ability to build output formats from SGML DocBook source.
11498b22bf3fSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
11508b22bf3fSmrg# indicates whether the necessary tools and files are found and, if set,
11518b22bf3fSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
11528b22bf3fSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
11538b22bf3fSmrgXORG_SGML_PATH=$prefix/share/sgml
11548b22bf3fSmrgHAVE_DEFS_ENT=
11558b22bf3fSmrgBUILDTXTDOC=no
11568b22bf3fSmrgBUILDPDFDOC=no
11578b22bf3fSmrgBUILDPSDOC=no
11588b22bf3fSmrgBUILDHTMLDOC=no
11598b22bf3fSmrg
11608b22bf3fSmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
11618b22bf3fSmrg
11628b22bf3fSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
11638b22bf3fSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
11648b22bf3fSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
11658b22bf3fSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
11668b22bf3fSmrg
11678b22bf3fSmrgAC_MSG_CHECKING([Whether to build text documentation])
11688b22bf3fSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
11698b22bf3fSmrg   test x$BUILD_TXTDOC != xno; then
11708b22bf3fSmrg	BUILDTXTDOC=yes
11718b22bf3fSmrgfi
11728b22bf3fSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
11738b22bf3fSmrgAC_MSG_RESULT([$BUILDTXTDOC])
11748b22bf3fSmrg
11758b22bf3fSmrgAC_MSG_CHECKING([Whether to build PDF documentation])
11768b22bf3fSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
11778b22bf3fSmrg   test x$BUILD_PDFDOC != xno; then
11788b22bf3fSmrg	BUILDPDFDOC=yes
11798b22bf3fSmrgfi
11808b22bf3fSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
11818b22bf3fSmrgAC_MSG_RESULT([$BUILDPDFDOC])
11828b22bf3fSmrg
11838b22bf3fSmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
11848b22bf3fSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
11858b22bf3fSmrg   test x$BUILD_PSDOC != xno; then
11868b22bf3fSmrg	BUILDPSDOC=yes
11878b22bf3fSmrgfi
11888b22bf3fSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
11898b22bf3fSmrgAC_MSG_RESULT([$BUILDPSDOC])
11908b22bf3fSmrg
11918b22bf3fSmrgAC_MSG_CHECKING([Whether to build HTML documentation])
11928b22bf3fSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
11938b22bf3fSmrg   test x$BUILD_HTMLDOC != xno; then
11948b22bf3fSmrg	BUILDHTMLDOC=yes
11958b22bf3fSmrgfi
11968b22bf3fSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
11978b22bf3fSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
11988b22bf3fSmrg
11998b22bf3fSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
12008b22bf3fSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
12018b22bf3fSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
12028b22bf3fSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
12038b22bf3fSmrg
12048b22bf3fSmrgAC_SUBST(MAKE_TEXT)
12058b22bf3fSmrgAC_SUBST(MAKE_PS)
12068b22bf3fSmrgAC_SUBST(MAKE_PDF)
12078b22bf3fSmrgAC_SUBST(MAKE_HTML)
12088b22bf3fSmrg]) # XORG_CHECK_DOCBOOK
12098b22bf3fSmrg
12108b22bf3fSmrg# XORG_CHECK_MALLOC_ZERO
12118b22bf3fSmrg# ----------------------
12128b22bf3fSmrg# Minimum version: 1.0.0
12138b22bf3fSmrg#
12148b22bf3fSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
12158b22bf3fSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
12168b22bf3fSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
12178b22bf3fSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
12188b22bf3fSmrgAC_ARG_ENABLE(malloc0returnsnull,
12198b22bf3fSmrg	AC_HELP_STRING([--enable-malloc0returnsnull],
12208b22bf3fSmrg		       [malloc(0) returns NULL (default: auto)]),
12218b22bf3fSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
12228b22bf3fSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
12238b22bf3fSmrg
12248b22bf3fSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
12258b22bf3fSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
12268b22bf3fSmrg	AC_RUN_IFELSE([
12278b22bf3fSmrgchar *malloc();
12288b22bf3fSmrgchar *realloc();
12298b22bf3fSmrgchar *calloc();
12308b22bf3fSmrgmain() {
12318b22bf3fSmrg    char *m0, *r0, *c0, *p;
12328b22bf3fSmrg    m0 = malloc(0);
12338b22bf3fSmrg    p = malloc(10);
12348b22bf3fSmrg    r0 = realloc(p,0);
12358b22bf3fSmrg    c0 = calloc(0);
12368b22bf3fSmrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
12378b22bf3fSmrg}],
12388b22bf3fSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
12398b22bf3fSmrg		[MALLOC_ZERO_RETURNS_NULL=no])
12408b22bf3fSmrgfi
12418b22bf3fSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
12428b22bf3fSmrg
12438b22bf3fSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
12448b22bf3fSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
12458b22bf3fSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
12468b22bf3fSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
12478b22bf3fSmrgelse
12488b22bf3fSmrg	MALLOC_ZERO_CFLAGS=""
12498b22bf3fSmrg	XMALLOC_ZERO_CFLAGS=""
12508b22bf3fSmrg	XTMALLOC_ZERO_CFLAGS=""
12518b22bf3fSmrgfi
12528b22bf3fSmrg
12538b22bf3fSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
12548b22bf3fSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
12558b22bf3fSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
12568b22bf3fSmrg]) # XORG_CHECK_MALLOC_ZERO
12578b22bf3fSmrg
12588b22bf3fSmrg# XORG_WITH_LINT()
12598b22bf3fSmrg# ----------------
12608b22bf3fSmrg# Minimum version: 1.1.0
12618b22bf3fSmrg#
12628b22bf3fSmrg# Sets up flags for source checkers such as lint and sparse if --with-lint
12638b22bf3fSmrg# is specified.   (Use --with-lint=sparse for sparse.)
12648b22bf3fSmrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
12658b22bf3fSmrg# Sets $LINT_FLAGS to flags to pass to source checker
12668b22bf3fSmrg# Sets LINT automake conditional if enabled (default: disabled)
12678b22bf3fSmrg#
12688b22bf3fSmrgAC_DEFUN([XORG_WITH_LINT],[
12698b22bf3fSmrg
12708b22bf3fSmrg# Allow checking code with lint, sparse, etc.
12718b22bf3fSmrgAC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
12728b22bf3fSmrg		[Use a lint-style source code checker (default: disabled)])],
12738b22bf3fSmrg		[use_lint=$withval], [use_lint=no])
12748b22bf3fSmrgif test "x$use_lint" = "xyes" ; then
12758b22bf3fSmrg	LINT="lint"
12768b22bf3fSmrgelse
12778b22bf3fSmrg	LINT="$use_lint"
12788b22bf3fSmrgfi
12798b22bf3fSmrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
12808b22bf3fSmrg    case $LINT in
12818b22bf3fSmrg	lint|*/lint)
12828b22bf3fSmrg	    case $host_os in
12838b22bf3fSmrg		solaris*)
12848b22bf3fSmrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
12858b22bf3fSmrg			;;
12868b22bf3fSmrg	    esac
12878b22bf3fSmrg	    ;;
12888b22bf3fSmrg    esac
12898b22bf3fSmrgfi
12908b22bf3fSmrg
12918b22bf3fSmrgAC_SUBST(LINT)
12928b22bf3fSmrgAC_SUBST(LINT_FLAGS)
12938b22bf3fSmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
12948b22bf3fSmrg
12958b22bf3fSmrg]) # XORG_WITH_LINT
12968b22bf3fSmrg
12978b22bf3fSmrg# XORG_LINT_LIBRARY(LIBNAME)
12988b22bf3fSmrg# --------------------------
12998b22bf3fSmrg# Minimum version: 1.1.0
13008b22bf3fSmrg#
13018b22bf3fSmrg# Sets up flags for building lint libraries for checking programs that call
13028b22bf3fSmrg# functions in the library.
13038b22bf3fSmrg# Disabled by default, enable with --enable-lint-library
13048b22bf3fSmrg# Sets: 
13058b22bf3fSmrg#	@LINTLIB@		- name of lint library file to make
13068b22bf3fSmrg#	MAKE_LINT_LIB		- automake conditional
13078b22bf3fSmrg#
13088b22bf3fSmrg
13098b22bf3fSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
13108b22bf3fSmrgAC_REQUIRE([XORG_WITH_LINT])
13118b22bf3fSmrg# Build lint "library" for more indepth checks of programs calling this library
13128b22bf3fSmrgAC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
13138b22bf3fSmrg	[Create lint library (default: disabled)])],
13148b22bf3fSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
13158b22bf3fSmrgif test "x$make_lint_lib" != "xno" ; then
13168b22bf3fSmrg	if test "x$LINT" = "xno" ; then
13178b22bf3fSmrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
13188b22bf3fSmrg	fi
13198b22bf3fSmrg	if test "x$make_lint_lib" = "xyes" ; then
13208b22bf3fSmrg		LINTLIB=llib-l$1.ln
13218b22bf3fSmrg	else
13228b22bf3fSmrg		LINTLIB=$make_lint_lib
13238b22bf3fSmrg	fi
13248b22bf3fSmrgfi
13258b22bf3fSmrgAC_SUBST(LINTLIB)
13268b22bf3fSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
13278b22bf3fSmrg
13288b22bf3fSmrg]) # XORG_LINT_LIBRARY
13298b22bf3fSmrg
13308b22bf3fSmrgdnl Copyright 2005 Red Hat, Inc
13318b22bf3fSmrgdnl
13328b22bf3fSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
13338b22bf3fSmrgdnl documentation for any purpose is hereby granted without fee, provided that
13348b22bf3fSmrgdnl the above copyright notice appear in all copies and that both that
13358b22bf3fSmrgdnl copyright notice and this permission notice appear in supporting
13368b22bf3fSmrgdnl documentation.
13378b22bf3fSmrgdnl
13388b22bf3fSmrgdnl The above copyright notice and this permission notice shall be included
13398b22bf3fSmrgdnl in all copies or substantial portions of the Software.
13408b22bf3fSmrgdnl
13418b22bf3fSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
13428b22bf3fSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
13438b22bf3fSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
13448b22bf3fSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
13458b22bf3fSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
13468b22bf3fSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
13478b22bf3fSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
13488b22bf3fSmrgdnl
13498b22bf3fSmrgdnl Except as contained in this notice, the name of the copyright holders shall
13508b22bf3fSmrgdnl not be used in advertising or otherwise to promote the sale, use or
13518b22bf3fSmrgdnl other dealings in this Software without prior written authorization
13528b22bf3fSmrgdnl from the copyright holders.
13538b22bf3fSmrgdnl
13548b22bf3fSmrg
13558b22bf3fSmrg# XORG_RELEASE_VERSION
13568b22bf3fSmrg# --------------------
13578b22bf3fSmrg# Adds --with/without-release-string and changes the PACKAGE and
13588b22bf3fSmrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
13598b22bf3fSmrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
13608b22bf3fSmrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
13618b22bf3fSmrg 
13628b22bf3fSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
13638b22bf3fSmrg	AC_ARG_WITH(release-version,
13648b22bf3fSmrg			AC_HELP_STRING([--with-release-version=STRING],
13658b22bf3fSmrg				[Use release version string in package name]),
13668b22bf3fSmrg			[RELEASE_VERSION="$withval"],
13678b22bf3fSmrg			[RELEASE_VERSION=""])
13688b22bf3fSmrg	if test "x$RELEASE_VERSION" != "x"; then
13698b22bf3fSmrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
13708b22bf3fSmrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
13718b22bf3fSmrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
13728b22bf3fSmrg	fi
13738b22bf3fSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
13748b22bf3fSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
13758b22bf3fSmrg		[Major version of this package])
13768b22bf3fSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2`
13778b22bf3fSmrg	if test "x$PVM" = "x"; then
13788b22bf3fSmrg		PVM="0"
13798b22bf3fSmrg	fi
13808b22bf3fSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
13818b22bf3fSmrg		[$PVM],
13828b22bf3fSmrg		[Minor version of this package])
13838b22bf3fSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3`
13848b22bf3fSmrg	if test "x$PVP" = "x"; then
13858b22bf3fSmrg		PVP="0"
13868b22bf3fSmrg	fi
13878b22bf3fSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
13888b22bf3fSmrg		[$PVP],
13898b22bf3fSmrg		[Patch version of this package])
13908b22bf3fSmrg])
13918b22bf3fSmrg
13928b22bf3fSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
13938b22bf3fSmrg# 
13948b22bf3fSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
13958b22bf3fSmrg#
13968b22bf3fSmrg# This program is free software; you can redistribute it and/or modify
13978b22bf3fSmrg# it under the terms of the GNU General Public License as published by
13988b22bf3fSmrg# the Free Software Foundation; either version 2 of the License, or
13998b22bf3fSmrg# (at your option) any later version.
14008b22bf3fSmrg#
14018b22bf3fSmrg# This program is distributed in the hope that it will be useful, but
14028b22bf3fSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
14038b22bf3fSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14048b22bf3fSmrg# General Public License for more details.
14058b22bf3fSmrg#
14068b22bf3fSmrg# You should have received a copy of the GNU General Public License
14078b22bf3fSmrg# along with this program; if not, write to the Free Software
14088b22bf3fSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
14098b22bf3fSmrg#
14108b22bf3fSmrg# As a special exception to the GNU General Public License, if you
14118b22bf3fSmrg# distribute this file as part of a program that contains a
14128b22bf3fSmrg# configuration script generated by Autoconf, you may include it under
14138b22bf3fSmrg# the same distribution terms that you use for the rest of that program.
14148b22bf3fSmrg
14158b22bf3fSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
14168b22bf3fSmrg# ----------------------------------
14178b22bf3fSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
14188b22bf3fSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
14198b22bf3fSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
14208b22bf3fSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
14218b22bf3fSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
14228b22bf3fSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
14238b22bf3fSmrgfi
14248b22bf3fSmrgif test -n "$PKG_CONFIG"; then
14258b22bf3fSmrg	_pkg_min_version=m4_ifval([$1], [$1], [0.9.0])
14268b22bf3fSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
14278b22bf3fSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
14288b22bf3fSmrg		AC_MSG_RESULT([yes])
14298b22bf3fSmrg	else
14308b22bf3fSmrg		AC_MSG_RESULT([no])
14318b22bf3fSmrg		PKG_CONFIG=""
14328b22bf3fSmrg	fi
14338b22bf3fSmrg		
14348b22bf3fSmrgfi[]dnl
14358b22bf3fSmrg])# PKG_PROG_PKG_CONFIG
14368b22bf3fSmrg
14378b22bf3fSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
14388b22bf3fSmrg#
14398b22bf3fSmrg# Check to see whether a particular set of modules exists.  Similar
14408b22bf3fSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
14418b22bf3fSmrg#
14428b22bf3fSmrg#
14438b22bf3fSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
14448b22bf3fSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
14458b22bf3fSmrg# PKG_CHECK_EXISTS manually
14468b22bf3fSmrg# --------------------------------------------------------------
14478b22bf3fSmrgAC_DEFUN([PKG_CHECK_EXISTS],
14488b22bf3fSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
14498b22bf3fSmrgif test -n "$PKG_CONFIG" && \
14508b22bf3fSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
14518b22bf3fSmrg  m4_ifval([$2], [$2], [:])
14528b22bf3fSmrgm4_ifvaln([$3], [else
14538b22bf3fSmrg  $3])dnl
14548b22bf3fSmrgfi])
14558b22bf3fSmrg
14568b22bf3fSmrg
14578b22bf3fSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
14588b22bf3fSmrg# ---------------------------------------------
14598b22bf3fSmrgm4_define([_PKG_CONFIG],
14608b22bf3fSmrg[if test -n "$PKG_CONFIG"; then
14618b22bf3fSmrg        PKG_CHECK_EXISTS([$3],
14628b22bf3fSmrg                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
14638b22bf3fSmrg			 [pkg_failed=yes])
14648b22bf3fSmrgelse
14658b22bf3fSmrg	pkg_failed=untried
14668b22bf3fSmrgfi[]dnl
14678b22bf3fSmrg])# _PKG_CONFIG
14688b22bf3fSmrg
14698b22bf3fSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
14708b22bf3fSmrg# [ACTION-IF-NOT-FOUND])
14718b22bf3fSmrg#
14728b22bf3fSmrg#
14738b22bf3fSmrg# Note that if there is a possibility the first call to
14748b22bf3fSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
14758b22bf3fSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
14768b22bf3fSmrg#
14778b22bf3fSmrg#
14788b22bf3fSmrg# --------------------------------------------------------------
14798b22bf3fSmrgAC_DEFUN([PKG_CHECK_MODULES],
14808b22bf3fSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
14818b22bf3fSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
14828b22bf3fSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
14838b22bf3fSmrg
14848b22bf3fSmrgpkg_failed=no
14858b22bf3fSmrgAC_MSG_CHECKING([for $1])
14868b22bf3fSmrg
14878b22bf3fSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
14888b22bf3fSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
14898b22bf3fSmrg
14908b22bf3fSmrgif test $pkg_failed = yes; then
14918b22bf3fSmrg	$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
14928b22bf3fSmrg	# Put the nasty error message in config.log where it belongs
14938b22bf3fSmrg	echo "$$1[]_PKG_ERRORS" 1>&AS_MESSAGE_LOG_FD
14948b22bf3fSmrg
14958b22bf3fSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
14968b22bf3fSmrg[Package requirements ($2) were not met.
14978b22bf3fSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
14988b22bf3fSmrginstalled software in a non-standard prefix.
14998b22bf3fSmrg
15008b22bf3fSmrgAlternatively you may set the $1_CFLAGS and $1_LIBS environment variables
15018b22bf3fSmrgto avoid the need to call pkg-config.  See the pkg-config man page for
15028b22bf3fSmrgmore details.])],
15038b22bf3fSmrg		[$4])
15048b22bf3fSmrgelif test $pkg_failed = untried; then
15058b22bf3fSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
15068b22bf3fSmrg[The pkg-config script could not be found or is too old.  Make sure it
15078b22bf3fSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
15088b22bf3fSmrgpath to pkg-config.
15098b22bf3fSmrg
15108b22bf3fSmrgAlternatively you may set the $1_CFLAGS and $1_LIBS environment variables
15118b22bf3fSmrgto avoid the need to call pkg-config.  See the pkg-config man page for
15128b22bf3fSmrgmore details.
15138b22bf3fSmrg
15148b22bf3fSmrgTo get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
15158b22bf3fSmrg		[$4])
15168b22bf3fSmrgelse
15178b22bf3fSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
15188b22bf3fSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
15198b22bf3fSmrg        AC_MSG_RESULT([yes])
15208b22bf3fSmrg	ifelse([$3], , :, [$3])
15218b22bf3fSmrgfi[]dnl
15228b22bf3fSmrg])# PKG_CHECK_MODULES
15238b22bf3fSmrg
1524