aclocal.m4 revision 7d5e3a19
17d5e3a19Smrg# generated automatically by aclocal 1.10 -*- Autoconf -*-
27d5e3a19Smrg
37d5e3a19Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
47d5e3a19Smrg# 2005, 2006  Free Software Foundation, Inc.
57d5e3a19Smrg# This file is free software; the Free Software Foundation
67d5e3a19Smrg# gives unlimited permission to copy and/or distribute it,
77d5e3a19Smrg# with or without modifications, as long as this notice is preserved.
87d5e3a19Smrg
97d5e3a19Smrg# This program is distributed in the hope that it will be useful,
107d5e3a19Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
117d5e3a19Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
127d5e3a19Smrg# PARTICULAR PURPOSE.
137d5e3a19Smrg
147d5e3a19Smrgm4_if(m4_PACKAGE_VERSION, [2.61],,
157d5e3a19Smrg[m4_fatal([this file was generated for autoconf 2.61.
167d5e3a19SmrgYou have another version of autoconf.  If you want to use that,
177d5e3a19Smrgyou should regenerate the build system entirely.], [63])])
187d5e3a19Smrg
197d5e3a19Smrg# Copyright (C) 2002, 2003, 2005, 2006  Free Software Foundation, Inc.
207d5e3a19Smrg#
217d5e3a19Smrg# This file is free software; the Free Software Foundation
227d5e3a19Smrg# gives unlimited permission to copy and/or distribute it,
237d5e3a19Smrg# with or without modifications, as long as this notice is preserved.
247d5e3a19Smrg
257d5e3a19Smrg# AM_AUTOMAKE_VERSION(VERSION)
267d5e3a19Smrg# ----------------------------
277d5e3a19Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
287d5e3a19Smrg# generated from the m4 files accompanying Automake X.Y.
297d5e3a19Smrg# (This private macro should not be called outside this file.)
307d5e3a19SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
317d5e3a19Smrg[am__api_version='1.10'
327d5e3a19Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
337d5e3a19Smrgdnl require some minimum version.  Point them to the right macro.
347d5e3a19Smrgm4_if([$1], [1.10], [],
357d5e3a19Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
367d5e3a19Smrg])
377d5e3a19Smrg
387d5e3a19Smrg# _AM_AUTOCONF_VERSION(VERSION)
397d5e3a19Smrg# -----------------------------
407d5e3a19Smrg# aclocal traces this macro to find the Autoconf version.
417d5e3a19Smrg# This is a private macro too.  Using m4_define simplifies
427d5e3a19Smrg# the logic in aclocal, which can simply ignore this definition.
437d5e3a19Smrgm4_define([_AM_AUTOCONF_VERSION], [])
447d5e3a19Smrg
457d5e3a19Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
467d5e3a19Smrg# -------------------------------
477d5e3a19Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
487d5e3a19Smrg# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
497d5e3a19SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
507d5e3a19Smrg[AM_AUTOMAKE_VERSION([1.10])dnl
517d5e3a19Smrg_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
527d5e3a19Smrg
537d5e3a19Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
547d5e3a19Smrg
557d5e3a19Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
567d5e3a19Smrg#
577d5e3a19Smrg# This file is free software; the Free Software Foundation
587d5e3a19Smrg# gives unlimited permission to copy and/or distribute it,
597d5e3a19Smrg# with or without modifications, as long as this notice is preserved.
607d5e3a19Smrg
617d5e3a19Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
627d5e3a19Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
637d5e3a19Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
647d5e3a19Smrg#
657d5e3a19Smrg# Of course, Automake must honor this variable whenever it calls a
667d5e3a19Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
677d5e3a19Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
687d5e3a19Smrg# depending on how configure is run.  This is pretty annoying, since
697d5e3a19Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
707d5e3a19Smrg# source directory, any form will work fine, but in subdirectories a
717d5e3a19Smrg# relative path needs to be adjusted first.
727d5e3a19Smrg#
737d5e3a19Smrg# $ac_aux_dir/missing
747d5e3a19Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
757d5e3a19Smrg# $top_srcdir/$ac_aux_dir/missing
767d5e3a19Smrg#    fails if $ac_aux_dir is absolute,
777d5e3a19Smrg#    fails when called from a subdirectory in a VPATH build with
787d5e3a19Smrg#          a relative $ac_aux_dir
797d5e3a19Smrg#
807d5e3a19Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
817d5e3a19Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
827d5e3a19Smrg# harmless because $srcdir is `.', but things will broke when you
837d5e3a19Smrg# start a VPATH build or use an absolute $srcdir.
847d5e3a19Smrg#
857d5e3a19Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
867d5e3a19Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
877d5e3a19Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
887d5e3a19Smrg# and then we would define $MISSING as
897d5e3a19Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
907d5e3a19Smrg# This will work as long as MISSING is not called from configure, because
917d5e3a19Smrg# unfortunately $(top_srcdir) has no meaning in configure.
927d5e3a19Smrg# However there are other variables, like CC, which are often used in
937d5e3a19Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
947d5e3a19Smrg#
957d5e3a19Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
967d5e3a19Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
977d5e3a19Smrg# configured tree to be moved without reconfiguration.
987d5e3a19Smrg
997d5e3a19SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
1007d5e3a19Smrg[dnl Rely on autoconf to set up CDPATH properly.
1017d5e3a19SmrgAC_PREREQ([2.50])dnl
1027d5e3a19Smrg# expand $ac_aux_dir to an absolute path
1037d5e3a19Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
1047d5e3a19Smrg])
1057d5e3a19Smrg
1067d5e3a19Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
1077d5e3a19Smrg
1087d5e3a19Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
1097d5e3a19Smrg# Free Software Foundation, Inc.
1107d5e3a19Smrg#
1117d5e3a19Smrg# This file is free software; the Free Software Foundation
1127d5e3a19Smrg# gives unlimited permission to copy and/or distribute it,
1137d5e3a19Smrg# with or without modifications, as long as this notice is preserved.
1147d5e3a19Smrg
1157d5e3a19Smrg# serial 8
1167d5e3a19Smrg
1177d5e3a19Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
1187d5e3a19Smrg# -------------------------------------
1197d5e3a19Smrg# Define a conditional.
1207d5e3a19SmrgAC_DEFUN([AM_CONDITIONAL],
1217d5e3a19Smrg[AC_PREREQ(2.52)dnl
1227d5e3a19Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1237d5e3a19Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1247d5e3a19SmrgAC_SUBST([$1_TRUE])dnl
1257d5e3a19SmrgAC_SUBST([$1_FALSE])dnl
1267d5e3a19Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
1277d5e3a19Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
1287d5e3a19Smrgif $2; then
1297d5e3a19Smrg  $1_TRUE=
1307d5e3a19Smrg  $1_FALSE='#'
1317d5e3a19Smrgelse
1327d5e3a19Smrg  $1_TRUE='#'
1337d5e3a19Smrg  $1_FALSE=
1347d5e3a19Smrgfi
1357d5e3a19SmrgAC_CONFIG_COMMANDS_PRE(
1367d5e3a19Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1377d5e3a19Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
1387d5e3a19SmrgUsually this means the macro was only invoked conditionally.]])
1397d5e3a19Smrgfi])])
1407d5e3a19Smrg
1417d5e3a19Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
1427d5e3a19Smrg# Free Software Foundation, Inc.
1437d5e3a19Smrg#
1447d5e3a19Smrg# This file is free software; the Free Software Foundation
1457d5e3a19Smrg# gives unlimited permission to copy and/or distribute it,
1467d5e3a19Smrg# with or without modifications, as long as this notice is preserved.
1477d5e3a19Smrg
1487d5e3a19Smrg# serial 9
1497d5e3a19Smrg
1507d5e3a19Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1517d5e3a19Smrg# written in clear, in which case automake, when reading aclocal.m4,
1527d5e3a19Smrg# will think it sees a *use*, and therefore will trigger all it's
1537d5e3a19Smrg# C support machinery.  Also note that it means that autoscan, seeing
1547d5e3a19Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1557d5e3a19Smrg
1567d5e3a19Smrg
1577d5e3a19Smrg# _AM_DEPENDENCIES(NAME)
1587d5e3a19Smrg# ----------------------
1597d5e3a19Smrg# See how the compiler implements dependency checking.
1607d5e3a19Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
1617d5e3a19Smrg# We try a few techniques and use that to set a single cache variable.
1627d5e3a19Smrg#
1637d5e3a19Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1647d5e3a19Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1657d5e3a19Smrg# dependency, and given that the user is not expected to run this macro,
1667d5e3a19Smrg# just rely on AC_PROG_CC.
1677d5e3a19SmrgAC_DEFUN([_AM_DEPENDENCIES],
1687d5e3a19Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
1697d5e3a19SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1707d5e3a19SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
1717d5e3a19SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1727d5e3a19Smrg
1737d5e3a19Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
1747d5e3a19Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
1757d5e3a19Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1767d5e3a19Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
1777d5e3a19Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1787d5e3a19Smrg                   [depcc="$$1"   am_compiler_list=])
1797d5e3a19Smrg
1807d5e3a19SmrgAC_CACHE_CHECK([dependency style of $depcc],
1817d5e3a19Smrg               [am_cv_$1_dependencies_compiler_type],
1827d5e3a19Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1837d5e3a19Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
1847d5e3a19Smrg  # making bogus files that we don't know about and never remove.  For
1857d5e3a19Smrg  # instance it was reported that on HP-UX the gcc test will end up
1867d5e3a19Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
1877d5e3a19Smrg  # in D'.
1887d5e3a19Smrg  mkdir conftest.dir
1897d5e3a19Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
1907d5e3a19Smrg  # using a relative directory.
1917d5e3a19Smrg  cp "$am_depcomp" conftest.dir
1927d5e3a19Smrg  cd conftest.dir
1937d5e3a19Smrg  # We will build objects and dependencies in a subdirectory because
1947d5e3a19Smrg  # it helps to detect inapplicable dependency modes.  For instance
1957d5e3a19Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
1967d5e3a19Smrg  # side effect of compilation, but ICC will put the dependencies in
1977d5e3a19Smrg  # the current directory while Tru64 will put them in the object
1987d5e3a19Smrg  # directory.
1997d5e3a19Smrg  mkdir sub
2007d5e3a19Smrg
2017d5e3a19Smrg  am_cv_$1_dependencies_compiler_type=none
2027d5e3a19Smrg  if test "$am_compiler_list" = ""; then
2037d5e3a19Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2047d5e3a19Smrg  fi
2057d5e3a19Smrg  for depmode in $am_compiler_list; do
2067d5e3a19Smrg    # Setup a source with many dependencies, because some compilers
2077d5e3a19Smrg    # like to wrap large dependency lists on column 80 (with \), and
2087d5e3a19Smrg    # we should not choose a depcomp mode which is confused by this.
2097d5e3a19Smrg    #
2107d5e3a19Smrg    # We need to recreate these files for each test, as the compiler may
2117d5e3a19Smrg    # overwrite some of them when testing with obscure command lines.
2127d5e3a19Smrg    # This happens at least with the AIX C compiler.
2137d5e3a19Smrg    : > sub/conftest.c
2147d5e3a19Smrg    for i in 1 2 3 4 5 6; do
2157d5e3a19Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
2167d5e3a19Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
2177d5e3a19Smrg      # Solaris 8's {/usr,}/bin/sh.
2187d5e3a19Smrg      touch sub/conftst$i.h
2197d5e3a19Smrg    done
2207d5e3a19Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2217d5e3a19Smrg
2227d5e3a19Smrg    case $depmode in
2237d5e3a19Smrg    nosideeffect)
2247d5e3a19Smrg      # after this tag, mechanisms are not by side-effect, so they'll
2257d5e3a19Smrg      # only be used when explicitly requested
2267d5e3a19Smrg      if test "x$enable_dependency_tracking" = xyes; then
2277d5e3a19Smrg	continue
2287d5e3a19Smrg      else
2297d5e3a19Smrg	break
2307d5e3a19Smrg      fi
2317d5e3a19Smrg      ;;
2327d5e3a19Smrg    none) break ;;
2337d5e3a19Smrg    esac
2347d5e3a19Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
2357d5e3a19Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
2367d5e3a19Smrg    # handle `-M -o', and we need to detect this.
2377d5e3a19Smrg    if depmode=$depmode \
2387d5e3a19Smrg       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
2397d5e3a19Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
2407d5e3a19Smrg       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
2417d5e3a19Smrg         >/dev/null 2>conftest.err &&
2427d5e3a19Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
2437d5e3a19Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
2447d5e3a19Smrg       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
2457d5e3a19Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
2467d5e3a19Smrg      # icc doesn't choke on unknown options, it will just issue warnings
2477d5e3a19Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
2487d5e3a19Smrg      # that says an option was ignored or not supported.
2497d5e3a19Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
2507d5e3a19Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
2517d5e3a19Smrg      # The diagnosis changed in icc 8.0:
2527d5e3a19Smrg      #   icc: Command line remark: option '-MP' not supported
2537d5e3a19Smrg      if (grep 'ignoring option' conftest.err ||
2547d5e3a19Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
2557d5e3a19Smrg        am_cv_$1_dependencies_compiler_type=$depmode
2567d5e3a19Smrg        break
2577d5e3a19Smrg      fi
2587d5e3a19Smrg    fi
2597d5e3a19Smrg  done
2607d5e3a19Smrg
2617d5e3a19Smrg  cd ..
2627d5e3a19Smrg  rm -rf conftest.dir
2637d5e3a19Smrgelse
2647d5e3a19Smrg  am_cv_$1_dependencies_compiler_type=none
2657d5e3a19Smrgfi
2667d5e3a19Smrg])
2677d5e3a19SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
2687d5e3a19SmrgAM_CONDITIONAL([am__fastdep$1], [
2697d5e3a19Smrg  test "x$enable_dependency_tracking" != xno \
2707d5e3a19Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
2717d5e3a19Smrg])
2727d5e3a19Smrg
2737d5e3a19Smrg
2747d5e3a19Smrg# AM_SET_DEPDIR
2757d5e3a19Smrg# -------------
2767d5e3a19Smrg# Choose a directory name for dependency files.
2777d5e3a19Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
2787d5e3a19SmrgAC_DEFUN([AM_SET_DEPDIR],
2797d5e3a19Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
2807d5e3a19SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
2817d5e3a19Smrg])
2827d5e3a19Smrg
2837d5e3a19Smrg
2847d5e3a19Smrg# AM_DEP_TRACK
2857d5e3a19Smrg# ------------
2867d5e3a19SmrgAC_DEFUN([AM_DEP_TRACK],
2877d5e3a19Smrg[AC_ARG_ENABLE(dependency-tracking,
2887d5e3a19Smrg[  --disable-dependency-tracking  speeds up one-time build
2897d5e3a19Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
2907d5e3a19Smrgif test "x$enable_dependency_tracking" != xno; then
2917d5e3a19Smrg  am_depcomp="$ac_aux_dir/depcomp"
2927d5e3a19Smrg  AMDEPBACKSLASH='\'
2937d5e3a19Smrgfi
2947d5e3a19SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
2957d5e3a19SmrgAC_SUBST([AMDEPBACKSLASH])dnl
2967d5e3a19Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
2977d5e3a19Smrg])
2987d5e3a19Smrg
2997d5e3a19Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
3007d5e3a19Smrg
3017d5e3a19Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
3027d5e3a19Smrg# Free Software Foundation, Inc.
3037d5e3a19Smrg#
3047d5e3a19Smrg# This file is free software; the Free Software Foundation
3057d5e3a19Smrg# gives unlimited permission to copy and/or distribute it,
3067d5e3a19Smrg# with or without modifications, as long as this notice is preserved.
3077d5e3a19Smrg
3087d5e3a19Smrg#serial 3
3097d5e3a19Smrg
3107d5e3a19Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
3117d5e3a19Smrg# ------------------------------
3127d5e3a19SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
3137d5e3a19Smrg[for mf in $CONFIG_FILES; do
3147d5e3a19Smrg  # Strip MF so we end up with the name of the file.
3157d5e3a19Smrg  mf=`echo "$mf" | sed -e 's/:.*$//'`
3167d5e3a19Smrg  # Check whether this is an Automake generated Makefile or not.
3177d5e3a19Smrg  # We used to match only the files named `Makefile.in', but
3187d5e3a19Smrg  # some people rename them; so instead we look at the file content.
3197d5e3a19Smrg  # Grep'ing the first line is not enough: some people post-process
3207d5e3a19Smrg  # each Makefile.in and add a new line on top of each file to say so.
3217d5e3a19Smrg  # Grep'ing the whole file is not good either: AIX grep has a line
3227d5e3a19Smrg  # limit of 2048, but all sed's we know have understand at least 4000.
3237d5e3a19Smrg  if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
3247d5e3a19Smrg    dirpart=`AS_DIRNAME("$mf")`
3257d5e3a19Smrg  else
3267d5e3a19Smrg    continue
3277d5e3a19Smrg  fi
3287d5e3a19Smrg  # Extract the definition of DEPDIR, am__include, and am__quote
3297d5e3a19Smrg  # from the Makefile without running `make'.
3307d5e3a19Smrg  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
3317d5e3a19Smrg  test -z "$DEPDIR" && continue
3327d5e3a19Smrg  am__include=`sed -n 's/^am__include = //p' < "$mf"`
3337d5e3a19Smrg  test -z "am__include" && continue
3347d5e3a19Smrg  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
3357d5e3a19Smrg  # When using ansi2knr, U may be empty or an underscore; expand it
3367d5e3a19Smrg  U=`sed -n 's/^U = //p' < "$mf"`
3377d5e3a19Smrg  # Find all dependency output files, they are included files with
3387d5e3a19Smrg  # $(DEPDIR) in their names.  We invoke sed twice because it is the
3397d5e3a19Smrg  # simplest approach to changing $(DEPDIR) to its actual value in the
3407d5e3a19Smrg  # expansion.
3417d5e3a19Smrg  for file in `sed -n "
3427d5e3a19Smrg    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
3437d5e3a19Smrg       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
3447d5e3a19Smrg    # Make sure the directory exists.
3457d5e3a19Smrg    test -f "$dirpart/$file" && continue
3467d5e3a19Smrg    fdir=`AS_DIRNAME(["$file"])`
3477d5e3a19Smrg    AS_MKDIR_P([$dirpart/$fdir])
3487d5e3a19Smrg    # echo "creating $dirpart/$file"
3497d5e3a19Smrg    echo '# dummy' > "$dirpart/$file"
3507d5e3a19Smrg  done
3517d5e3a19Smrgdone
3527d5e3a19Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
3537d5e3a19Smrg
3547d5e3a19Smrg
3557d5e3a19Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
3567d5e3a19Smrg# -----------------------------
3577d5e3a19Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
3587d5e3a19Smrg#
3597d5e3a19Smrg# This code is only required when automatic dependency tracking
3607d5e3a19Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
3617d5e3a19Smrg# need in order to bootstrap the dependency handling code.
3627d5e3a19SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
3637d5e3a19Smrg[AC_CONFIG_COMMANDS([depfiles],
3647d5e3a19Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
3657d5e3a19Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
3667d5e3a19Smrg])
3677d5e3a19Smrg
3687d5e3a19Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
3697d5e3a19Smrg# Free Software Foundation, Inc.
3707d5e3a19Smrg#
3717d5e3a19Smrg# This file is free software; the Free Software Foundation
3727d5e3a19Smrg# gives unlimited permission to copy and/or distribute it,
3737d5e3a19Smrg# with or without modifications, as long as this notice is preserved.
3747d5e3a19Smrg
3757d5e3a19Smrg# serial 8
3767d5e3a19Smrg
3777d5e3a19Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
3787d5e3a19SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
3797d5e3a19Smrg
3807d5e3a19Smrg# Do all the work for Automake.                             -*- Autoconf -*-
3817d5e3a19Smrg
3827d5e3a19Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
3837d5e3a19Smrg# 2005, 2006 Free Software Foundation, Inc.
3847d5e3a19Smrg#
3857d5e3a19Smrg# This file is free software; the Free Software Foundation
3867d5e3a19Smrg# gives unlimited permission to copy and/or distribute it,
3877d5e3a19Smrg# with or without modifications, as long as this notice is preserved.
3887d5e3a19Smrg
3897d5e3a19Smrg# serial 12
3907d5e3a19Smrg
3917d5e3a19Smrg# This macro actually does too much.  Some checks are only needed if
3927d5e3a19Smrg# your package does certain things.  But this isn't really a big deal.
3937d5e3a19Smrg
3947d5e3a19Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
3957d5e3a19Smrg# AM_INIT_AUTOMAKE([OPTIONS])
3967d5e3a19Smrg# -----------------------------------------------
3977d5e3a19Smrg# The call with PACKAGE and VERSION arguments is the old style
3987d5e3a19Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
3997d5e3a19Smrg# and VERSION should now be passed to AC_INIT and removed from
4007d5e3a19Smrg# the call to AM_INIT_AUTOMAKE.
4017d5e3a19Smrg# We support both call styles for the transition.  After
4027d5e3a19Smrg# the next Automake release, Autoconf can make the AC_INIT
4037d5e3a19Smrg# arguments mandatory, and then we can depend on a new Autoconf
4047d5e3a19Smrg# release and drop the old call support.
4057d5e3a19SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
4067d5e3a19Smrg[AC_PREREQ([2.60])dnl
4077d5e3a19Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
4087d5e3a19Smrgdnl the ones we care about.
4097d5e3a19Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
4107d5e3a19SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
4117d5e3a19SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
4127d5e3a19Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
4137d5e3a19Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
4147d5e3a19Smrg  # is not polluted with repeated "-I."
4157d5e3a19Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
4167d5e3a19Smrg  # test to see if srcdir already configured
4177d5e3a19Smrg  if test -f $srcdir/config.status; then
4187d5e3a19Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
4197d5e3a19Smrg  fi
4207d5e3a19Smrgfi
4217d5e3a19Smrg
4227d5e3a19Smrg# test whether we have cygpath
4237d5e3a19Smrgif test -z "$CYGPATH_W"; then
4247d5e3a19Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
4257d5e3a19Smrg    CYGPATH_W='cygpath -w'
4267d5e3a19Smrg  else
4277d5e3a19Smrg    CYGPATH_W=echo
4287d5e3a19Smrg  fi
4297d5e3a19Smrgfi
4307d5e3a19SmrgAC_SUBST([CYGPATH_W])
4317d5e3a19Smrg
4327d5e3a19Smrg# Define the identity of the package.
4337d5e3a19Smrgdnl Distinguish between old-style and new-style calls.
4347d5e3a19Smrgm4_ifval([$2],
4357d5e3a19Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
4367d5e3a19Smrg AC_SUBST([PACKAGE], [$1])dnl
4377d5e3a19Smrg AC_SUBST([VERSION], [$2])],
4387d5e3a19Smrg[_AM_SET_OPTIONS([$1])dnl
4397d5e3a19Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
4407d5e3a19Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
4417d5e3a19Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
4427d5e3a19Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
4437d5e3a19Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
4447d5e3a19Smrg
4457d5e3a19Smrg_AM_IF_OPTION([no-define],,
4467d5e3a19Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
4477d5e3a19Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
4487d5e3a19Smrg
4497d5e3a19Smrg# Some tools Automake needs.
4507d5e3a19SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
4517d5e3a19SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
4527d5e3a19SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
4537d5e3a19SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
4547d5e3a19SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
4557d5e3a19SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
4567d5e3a19SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
4577d5e3a19SmrgAM_PROG_INSTALL_SH
4587d5e3a19SmrgAM_PROG_INSTALL_STRIP
4597d5e3a19SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
4607d5e3a19Smrg# We need awk for the "check" target.  The system "awk" is bad on
4617d5e3a19Smrg# some platforms.
4627d5e3a19SmrgAC_REQUIRE([AC_PROG_AWK])dnl
4637d5e3a19SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
4647d5e3a19SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
4657d5e3a19Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
4667d5e3a19Smrg              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
4677d5e3a19Smrg	      		     [_AM_PROG_TAR([v7])])])
4687d5e3a19Smrg_AM_IF_OPTION([no-dependencies],,
4697d5e3a19Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
4707d5e3a19Smrg                  [_AM_DEPENDENCIES(CC)],
4717d5e3a19Smrg                  [define([AC_PROG_CC],
4727d5e3a19Smrg                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
4737d5e3a19SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
4747d5e3a19Smrg                  [_AM_DEPENDENCIES(CXX)],
4757d5e3a19Smrg                  [define([AC_PROG_CXX],
4767d5e3a19Smrg                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
4777d5e3a19SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
4787d5e3a19Smrg                  [_AM_DEPENDENCIES(OBJC)],
4797d5e3a19Smrg                  [define([AC_PROG_OBJC],
4807d5e3a19Smrg                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
4817d5e3a19Smrg])
4827d5e3a19Smrg])
4837d5e3a19Smrg
4847d5e3a19Smrg
4857d5e3a19Smrg# When config.status generates a header, we must update the stamp-h file.
4867d5e3a19Smrg# This file resides in the same directory as the config header
4877d5e3a19Smrg# that is generated.  The stamp files are numbered to have different names.
4887d5e3a19Smrg
4897d5e3a19Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
4907d5e3a19Smrg# loop where config.status creates the headers, so we can generate
4917d5e3a19Smrg# our stamp files there.
4927d5e3a19SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
4937d5e3a19Smrg[# Compute $1's index in $config_headers.
4947d5e3a19Smrg_am_stamp_count=1
4957d5e3a19Smrgfor _am_header in $config_headers :; do
4967d5e3a19Smrg  case $_am_header in
4977d5e3a19Smrg    $1 | $1:* )
4987d5e3a19Smrg      break ;;
4997d5e3a19Smrg    * )
5007d5e3a19Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
5017d5e3a19Smrg  esac
5027d5e3a19Smrgdone
5037d5e3a19Smrgecho "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
5047d5e3a19Smrg
5057d5e3a19Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
5067d5e3a19Smrg#
5077d5e3a19Smrg# This file is free software; the Free Software Foundation
5087d5e3a19Smrg# gives unlimited permission to copy and/or distribute it,
5097d5e3a19Smrg# with or without modifications, as long as this notice is preserved.
5107d5e3a19Smrg
5117d5e3a19Smrg# AM_PROG_INSTALL_SH
5127d5e3a19Smrg# ------------------
5137d5e3a19Smrg# Define $install_sh.
5147d5e3a19SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
5157d5e3a19Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
5167d5e3a19Smrginstall_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
5177d5e3a19SmrgAC_SUBST(install_sh)])
5187d5e3a19Smrg
5197d5e3a19Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
5207d5e3a19Smrg#
5217d5e3a19Smrg# This file is free software; the Free Software Foundation
5227d5e3a19Smrg# gives unlimited permission to copy and/or distribute it,
5237d5e3a19Smrg# with or without modifications, as long as this notice is preserved.
5247d5e3a19Smrg
5257d5e3a19Smrg# serial 2
5267d5e3a19Smrg
5277d5e3a19Smrg# Check whether the underlying file-system supports filenames
5287d5e3a19Smrg# with a leading dot.  For instance MS-DOS doesn't.
5297d5e3a19SmrgAC_DEFUN([AM_SET_LEADING_DOT],
5307d5e3a19Smrg[rm -rf .tst 2>/dev/null
5317d5e3a19Smrgmkdir .tst 2>/dev/null
5327d5e3a19Smrgif test -d .tst; then
5337d5e3a19Smrg  am__leading_dot=.
5347d5e3a19Smrgelse
5357d5e3a19Smrg  am__leading_dot=_
5367d5e3a19Smrgfi
5377d5e3a19Smrgrmdir .tst 2>/dev/null
5387d5e3a19SmrgAC_SUBST([am__leading_dot])])
5397d5e3a19Smrg
5407d5e3a19Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
5417d5e3a19Smrg# From Jim Meyering
5427d5e3a19Smrg
5437d5e3a19Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
5447d5e3a19Smrg# Free Software Foundation, Inc.
5457d5e3a19Smrg#
5467d5e3a19Smrg# This file is free software; the Free Software Foundation
5477d5e3a19Smrg# gives unlimited permission to copy and/or distribute it,
5487d5e3a19Smrg# with or without modifications, as long as this notice is preserved.
5497d5e3a19Smrg
5507d5e3a19Smrg# serial 4
5517d5e3a19Smrg
5527d5e3a19SmrgAC_DEFUN([AM_MAINTAINER_MODE],
5537d5e3a19Smrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
5547d5e3a19Smrg  dnl maintainer-mode is disabled by default
5557d5e3a19Smrg  AC_ARG_ENABLE(maintainer-mode,
5567d5e3a19Smrg[  --enable-maintainer-mode  enable make rules and dependencies not useful
5577d5e3a19Smrg			  (and sometimes confusing) to the casual installer],
5587d5e3a19Smrg      USE_MAINTAINER_MODE=$enableval,
5597d5e3a19Smrg      USE_MAINTAINER_MODE=no)
5607d5e3a19Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
5617d5e3a19Smrg  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
5627d5e3a19Smrg  MAINT=$MAINTAINER_MODE_TRUE
5637d5e3a19Smrg  AC_SUBST(MAINT)dnl
5647d5e3a19Smrg]
5657d5e3a19Smrg)
5667d5e3a19Smrg
5677d5e3a19SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
5687d5e3a19Smrg
5697d5e3a19Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
5707d5e3a19Smrg
5717d5e3a19Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
5727d5e3a19Smrg#
5737d5e3a19Smrg# This file is free software; the Free Software Foundation
5747d5e3a19Smrg# gives unlimited permission to copy and/or distribute it,
5757d5e3a19Smrg# with or without modifications, as long as this notice is preserved.
5767d5e3a19Smrg
5777d5e3a19Smrg# serial 3
5787d5e3a19Smrg
5797d5e3a19Smrg# AM_MAKE_INCLUDE()
5807d5e3a19Smrg# -----------------
5817d5e3a19Smrg# Check to see how make treats includes.
5827d5e3a19SmrgAC_DEFUN([AM_MAKE_INCLUDE],
5837d5e3a19Smrg[am_make=${MAKE-make}
5847d5e3a19Smrgcat > confinc << 'END'
5857d5e3a19Smrgam__doit:
5867d5e3a19Smrg	@echo done
5877d5e3a19Smrg.PHONY: am__doit
5887d5e3a19SmrgEND
5897d5e3a19Smrg# If we don't find an include directive, just comment out the code.
5907d5e3a19SmrgAC_MSG_CHECKING([for style of include used by $am_make])
5917d5e3a19Smrgam__include="#"
5927d5e3a19Smrgam__quote=
5937d5e3a19Smrg_am_result=none
5947d5e3a19Smrg# First try GNU make style include.
5957d5e3a19Smrgecho "include confinc" > confmf
5967d5e3a19Smrg# We grep out `Entering directory' and `Leaving directory'
5977d5e3a19Smrg# messages which can occur if `w' ends up in MAKEFLAGS.
5987d5e3a19Smrg# In particular we don't look at `^make:' because GNU make might
5997d5e3a19Smrg# be invoked under some other name (usually "gmake"), in which
6007d5e3a19Smrg# case it prints its new name instead of `make'.
6017d5e3a19Smrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
6027d5e3a19Smrg   am__include=include
6037d5e3a19Smrg   am__quote=
6047d5e3a19Smrg   _am_result=GNU
6057d5e3a19Smrgfi
6067d5e3a19Smrg# Now try BSD make style include.
6077d5e3a19Smrgif test "$am__include" = "#"; then
6087d5e3a19Smrg   echo '.include "confinc"' > confmf
6097d5e3a19Smrg   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
6107d5e3a19Smrg      am__include=.include
6117d5e3a19Smrg      am__quote="\""
6127d5e3a19Smrg      _am_result=BSD
6137d5e3a19Smrg   fi
6147d5e3a19Smrgfi
6157d5e3a19SmrgAC_SUBST([am__include])
6167d5e3a19SmrgAC_SUBST([am__quote])
6177d5e3a19SmrgAC_MSG_RESULT([$_am_result])
6187d5e3a19Smrgrm -f confinc confmf
6197d5e3a19Smrg])
6207d5e3a19Smrg
6217d5e3a19Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
6227d5e3a19Smrg
6237d5e3a19Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
6247d5e3a19Smrg# Free Software Foundation, Inc.
6257d5e3a19Smrg#
6267d5e3a19Smrg# This file is free software; the Free Software Foundation
6277d5e3a19Smrg# gives unlimited permission to copy and/or distribute it,
6287d5e3a19Smrg# with or without modifications, as long as this notice is preserved.
6297d5e3a19Smrg
6307d5e3a19Smrg# serial 5
6317d5e3a19Smrg
6327d5e3a19Smrg# AM_MISSING_PROG(NAME, PROGRAM)
6337d5e3a19Smrg# ------------------------------
6347d5e3a19SmrgAC_DEFUN([AM_MISSING_PROG],
6357d5e3a19Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
6367d5e3a19Smrg$1=${$1-"${am_missing_run}$2"}
6377d5e3a19SmrgAC_SUBST($1)])
6387d5e3a19Smrg
6397d5e3a19Smrg
6407d5e3a19Smrg# AM_MISSING_HAS_RUN
6417d5e3a19Smrg# ------------------
6427d5e3a19Smrg# Define MISSING if not defined so far and test if it supports --run.
6437d5e3a19Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
6447d5e3a19SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
6457d5e3a19Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
6467d5e3a19SmrgAC_REQUIRE_AUX_FILE([missing])dnl
6477d5e3a19Smrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
6487d5e3a19Smrg# Use eval to expand $SHELL
6497d5e3a19Smrgif eval "$MISSING --run true"; then
6507d5e3a19Smrg  am_missing_run="$MISSING --run "
6517d5e3a19Smrgelse
6527d5e3a19Smrg  am_missing_run=
6537d5e3a19Smrg  AC_MSG_WARN([`missing' script is too old or missing])
6547d5e3a19Smrgfi
6557d5e3a19Smrg])
6567d5e3a19Smrg
6577d5e3a19Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
6587d5e3a19Smrg#
6597d5e3a19Smrg# This file is free software; the Free Software Foundation
6607d5e3a19Smrg# gives unlimited permission to copy and/or distribute it,
6617d5e3a19Smrg# with or without modifications, as long as this notice is preserved.
6627d5e3a19Smrg
6637d5e3a19Smrg# AM_PROG_MKDIR_P
6647d5e3a19Smrg# ---------------
6657d5e3a19Smrg# Check for `mkdir -p'.
6667d5e3a19SmrgAC_DEFUN([AM_PROG_MKDIR_P],
6677d5e3a19Smrg[AC_PREREQ([2.60])dnl
6687d5e3a19SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
6697d5e3a19Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
6707d5e3a19Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
6717d5e3a19Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
6727d5e3a19Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
6737d5e3a19Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
6747d5e3a19Smrgdnl adjustment using top_builddir (which is defined more often than
6757d5e3a19Smrgdnl MKDIR_P).
6767d5e3a19SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
6777d5e3a19Smrgcase $mkdir_p in
6787d5e3a19Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
6797d5e3a19Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
6807d5e3a19Smrgesac
6817d5e3a19Smrg])
6827d5e3a19Smrg
6837d5e3a19Smrg# Helper functions for option handling.                     -*- Autoconf -*-
6847d5e3a19Smrg
6857d5e3a19Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
6867d5e3a19Smrg#
6877d5e3a19Smrg# This file is free software; the Free Software Foundation
6887d5e3a19Smrg# gives unlimited permission to copy and/or distribute it,
6897d5e3a19Smrg# with or without modifications, as long as this notice is preserved.
6907d5e3a19Smrg
6917d5e3a19Smrg# serial 3
6927d5e3a19Smrg
6937d5e3a19Smrg# _AM_MANGLE_OPTION(NAME)
6947d5e3a19Smrg# -----------------------
6957d5e3a19SmrgAC_DEFUN([_AM_MANGLE_OPTION],
6967d5e3a19Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
6977d5e3a19Smrg
6987d5e3a19Smrg# _AM_SET_OPTION(NAME)
6997d5e3a19Smrg# ------------------------------
7007d5e3a19Smrg# Set option NAME.  Presently that only means defining a flag for this option.
7017d5e3a19SmrgAC_DEFUN([_AM_SET_OPTION],
7027d5e3a19Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
7037d5e3a19Smrg
7047d5e3a19Smrg# _AM_SET_OPTIONS(OPTIONS)
7057d5e3a19Smrg# ----------------------------------
7067d5e3a19Smrg# OPTIONS is a space-separated list of Automake options.
7077d5e3a19SmrgAC_DEFUN([_AM_SET_OPTIONS],
7087d5e3a19Smrg[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
7097d5e3a19Smrg
7107d5e3a19Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
7117d5e3a19Smrg# -------------------------------------------
7127d5e3a19Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
7137d5e3a19SmrgAC_DEFUN([_AM_IF_OPTION],
7147d5e3a19Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
7157d5e3a19Smrg
7167d5e3a19Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
7177d5e3a19Smrg
7187d5e3a19Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
7197d5e3a19Smrg# Free Software Foundation, Inc.
7207d5e3a19Smrg#
7217d5e3a19Smrg# This file is free software; the Free Software Foundation
7227d5e3a19Smrg# gives unlimited permission to copy and/or distribute it,
7237d5e3a19Smrg# with or without modifications, as long as this notice is preserved.
7247d5e3a19Smrg
7257d5e3a19Smrg# serial 4
7267d5e3a19Smrg
7277d5e3a19Smrg# AM_SANITY_CHECK
7287d5e3a19Smrg# ---------------
7297d5e3a19SmrgAC_DEFUN([AM_SANITY_CHECK],
7307d5e3a19Smrg[AC_MSG_CHECKING([whether build environment is sane])
7317d5e3a19Smrg# Just in case
7327d5e3a19Smrgsleep 1
7337d5e3a19Smrgecho timestamp > conftest.file
7347d5e3a19Smrg# Do `set' in a subshell so we don't clobber the current shell's
7357d5e3a19Smrg# arguments.  Must try -L first in case configure is actually a
7367d5e3a19Smrg# symlink; some systems play weird games with the mod time of symlinks
7377d5e3a19Smrg# (eg FreeBSD returns the mod time of the symlink's containing
7387d5e3a19Smrg# directory).
7397d5e3a19Smrgif (
7407d5e3a19Smrg   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
7417d5e3a19Smrg   if test "$[*]" = "X"; then
7427d5e3a19Smrg      # -L didn't work.
7437d5e3a19Smrg      set X `ls -t $srcdir/configure conftest.file`
7447d5e3a19Smrg   fi
7457d5e3a19Smrg   rm -f conftest.file
7467d5e3a19Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
7477d5e3a19Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
7487d5e3a19Smrg
7497d5e3a19Smrg      # If neither matched, then we have a broken ls.  This can happen
7507d5e3a19Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
7517d5e3a19Smrg      # broken ls alias from the environment.  This has actually
7527d5e3a19Smrg      # happened.  Such a system could not be considered "sane".
7537d5e3a19Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
7547d5e3a19Smrgalias in your environment])
7557d5e3a19Smrg   fi
7567d5e3a19Smrg
7577d5e3a19Smrg   test "$[2]" = conftest.file
7587d5e3a19Smrg   )
7597d5e3a19Smrgthen
7607d5e3a19Smrg   # Ok.
7617d5e3a19Smrg   :
7627d5e3a19Smrgelse
7637d5e3a19Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
7647d5e3a19SmrgCheck your system clock])
7657d5e3a19Smrgfi
7667d5e3a19SmrgAC_MSG_RESULT(yes)])
7677d5e3a19Smrg
7687d5e3a19Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
7697d5e3a19Smrg#
7707d5e3a19Smrg# This file is free software; the Free Software Foundation
7717d5e3a19Smrg# gives unlimited permission to copy and/or distribute it,
7727d5e3a19Smrg# with or without modifications, as long as this notice is preserved.
7737d5e3a19Smrg
7747d5e3a19Smrg# AM_PROG_INSTALL_STRIP
7757d5e3a19Smrg# ---------------------
7767d5e3a19Smrg# One issue with vendor `install' (even GNU) is that you can't
7777d5e3a19Smrg# specify the program used to strip binaries.  This is especially
7787d5e3a19Smrg# annoying in cross-compiling environments, where the build's strip
7797d5e3a19Smrg# is unlikely to handle the host's binaries.
7807d5e3a19Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
7817d5e3a19Smrg# always use install-sh in `make install-strip', and initialize
7827d5e3a19Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
7837d5e3a19SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
7847d5e3a19Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
7857d5e3a19Smrg# Installed binaries are usually stripped using `strip' when the user
7867d5e3a19Smrg# run `make install-strip'.  However `strip' might not be the right
7877d5e3a19Smrg# tool to use in cross-compilation environments, therefore Automake
7887d5e3a19Smrg# will honor the `STRIP' environment variable to overrule this program.
7897d5e3a19Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
7907d5e3a19Smrgif test "$cross_compiling" != no; then
7917d5e3a19Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
7927d5e3a19Smrgfi
7937d5e3a19SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
7947d5e3a19SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
7957d5e3a19Smrg
7967d5e3a19Smrg# Copyright (C) 2006  Free Software Foundation, Inc.
7977d5e3a19Smrg#
7987d5e3a19Smrg# This file is free software; the Free Software Foundation
7997d5e3a19Smrg# gives unlimited permission to copy and/or distribute it,
8007d5e3a19Smrg# with or without modifications, as long as this notice is preserved.
8017d5e3a19Smrg
8027d5e3a19Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
8037d5e3a19Smrg# ---------------------------
8047d5e3a19Smrg# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.
8057d5e3a19Smrg# This macro is traced by Automake.
8067d5e3a19SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
8077d5e3a19Smrg
8087d5e3a19Smrg# Check how to create a tarball.                            -*- Autoconf -*-
8097d5e3a19Smrg
8107d5e3a19Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
8117d5e3a19Smrg#
8127d5e3a19Smrg# This file is free software; the Free Software Foundation
8137d5e3a19Smrg# gives unlimited permission to copy and/or distribute it,
8147d5e3a19Smrg# with or without modifications, as long as this notice is preserved.
8157d5e3a19Smrg
8167d5e3a19Smrg# serial 2
8177d5e3a19Smrg
8187d5e3a19Smrg# _AM_PROG_TAR(FORMAT)
8197d5e3a19Smrg# --------------------
8207d5e3a19Smrg# Check how to create a tarball in format FORMAT.
8217d5e3a19Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
8227d5e3a19Smrg#
8237d5e3a19Smrg# Substitute a variable $(am__tar) that is a command
8247d5e3a19Smrg# writing to stdout a FORMAT-tarball containing the directory
8257d5e3a19Smrg# $tardir.
8267d5e3a19Smrg#     tardir=directory && $(am__tar) > result.tar
8277d5e3a19Smrg#
8287d5e3a19Smrg# Substitute a variable $(am__untar) that extract such
8297d5e3a19Smrg# a tarball read from stdin.
8307d5e3a19Smrg#     $(am__untar) < result.tar
8317d5e3a19SmrgAC_DEFUN([_AM_PROG_TAR],
8327d5e3a19Smrg[# Always define AMTAR for backward compatibility.
8337d5e3a19SmrgAM_MISSING_PROG([AMTAR], [tar])
8347d5e3a19Smrgm4_if([$1], [v7],
8357d5e3a19Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
8367d5e3a19Smrg     [m4_case([$1], [ustar],, [pax],,
8377d5e3a19Smrg              [m4_fatal([Unknown tar format])])
8387d5e3a19SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
8397d5e3a19Smrg# Loop over all known methods to create a tar archive until one works.
8407d5e3a19Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
8417d5e3a19Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
8427d5e3a19Smrg# Do not fold the above two line into one, because Tru64 sh and
8437d5e3a19Smrg# Solaris sh will not grok spaces in the rhs of `-'.
8447d5e3a19Smrgfor _am_tool in $_am_tools
8457d5e3a19Smrgdo
8467d5e3a19Smrg  case $_am_tool in
8477d5e3a19Smrg  gnutar)
8487d5e3a19Smrg    for _am_tar in tar gnutar gtar;
8497d5e3a19Smrg    do
8507d5e3a19Smrg      AM_RUN_LOG([$_am_tar --version]) && break
8517d5e3a19Smrg    done
8527d5e3a19Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
8537d5e3a19Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
8547d5e3a19Smrg    am__untar="$_am_tar -xf -"
8557d5e3a19Smrg    ;;
8567d5e3a19Smrg  plaintar)
8577d5e3a19Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
8587d5e3a19Smrg    # ustar tarball either.
8597d5e3a19Smrg    (tar --version) >/dev/null 2>&1 && continue
8607d5e3a19Smrg    am__tar='tar chf - "$$tardir"'
8617d5e3a19Smrg    am__tar_='tar chf - "$tardir"'
8627d5e3a19Smrg    am__untar='tar xf -'
8637d5e3a19Smrg    ;;
8647d5e3a19Smrg  pax)
8657d5e3a19Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
8667d5e3a19Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
8677d5e3a19Smrg    am__untar='pax -r'
8687d5e3a19Smrg    ;;
8697d5e3a19Smrg  cpio)
8707d5e3a19Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
8717d5e3a19Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
8727d5e3a19Smrg    am__untar='cpio -i -H $1 -d'
8737d5e3a19Smrg    ;;
8747d5e3a19Smrg  none)
8757d5e3a19Smrg    am__tar=false
8767d5e3a19Smrg    am__tar_=false
8777d5e3a19Smrg    am__untar=false
8787d5e3a19Smrg    ;;
8797d5e3a19Smrg  esac
8807d5e3a19Smrg
8817d5e3a19Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
8827d5e3a19Smrg  # and am__untar set.
8837d5e3a19Smrg  test -n "${am_cv_prog_tar_$1}" && break
8847d5e3a19Smrg
8857d5e3a19Smrg  # tar/untar a dummy directory, and stop if the command works
8867d5e3a19Smrg  rm -rf conftest.dir
8877d5e3a19Smrg  mkdir conftest.dir
8887d5e3a19Smrg  echo GrepMe > conftest.dir/file
8897d5e3a19Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
8907d5e3a19Smrg  rm -rf conftest.dir
8917d5e3a19Smrg  if test -s conftest.tar; then
8927d5e3a19Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
8937d5e3a19Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
8947d5e3a19Smrg  fi
8957d5e3a19Smrgdone
8967d5e3a19Smrgrm -rf conftest.dir
8977d5e3a19Smrg
8987d5e3a19SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
8997d5e3a19SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
9007d5e3a19SmrgAC_SUBST([am__tar])
9017d5e3a19SmrgAC_SUBST([am__untar])
9027d5e3a19Smrg]) # _AM_PROG_TAR
9037d5e3a19Smrg
9047d5e3a19Smrgdnl
9057d5e3a19Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
9067d5e3a19Smrgdnl 
9077d5e3a19Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
9087d5e3a19Smrgdnl copy of this software and associated documentation files (the
9097d5e3a19Smrgdnl "Software"), to deal in the Software without restriction, including
9107d5e3a19Smrgdnl without limitation the rights to use, copy, modify, merge, publish,
9117d5e3a19Smrgdnl distribute, and/or sell copies of the Software, and to permit persons
9127d5e3a19Smrgdnl to whom the Software is furnished to do so, provided that the above
9137d5e3a19Smrgdnl copyright notice(s) and this permission notice appear in all copies of
9147d5e3a19Smrgdnl the Software and that both the above copyright notice(s) and this
9157d5e3a19Smrgdnl permission notice appear in supporting documentation.
9167d5e3a19Smrgdnl
9177d5e3a19Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
9187d5e3a19Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
9197d5e3a19Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
9207d5e3a19Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
9217d5e3a19Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
9227d5e3a19Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
9237d5e3a19Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
9247d5e3a19Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
9257d5e3a19Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
9267d5e3a19Smrgdnl
9277d5e3a19Smrgdnl Except as contained in this notice, the name of a copyright holder
9287d5e3a19Smrgdnl shall not be used in advertising or otherwise to promote the sale, use
9297d5e3a19Smrgdnl or other dealings in this Software without prior written authorization
9307d5e3a19Smrgdnl of the copyright holder.
9317d5e3a19Smrg
9327d5e3a19Smrg# XORG_MACROS_VERSION(required-version)
9337d5e3a19Smrg# -------------------------------------
9347d5e3a19Smrg# Minimum version: 1.1.0
9357d5e3a19Smrg#
9367d5e3a19Smrg# If you're using a macro added in Version 1.1 or newer, include this in
9377d5e3a19Smrg# your configure.ac with the minimum required version, such as:
9387d5e3a19Smrg# XORG_MACROS_VERSION(1.1)
9397d5e3a19Smrg#
9407d5e3a19Smrg# To force at least a version with this macro defined, also add:
9417d5e3a19Smrg# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
9427d5e3a19Smrg#
9437d5e3a19Smrg#
9447d5e3a19Smrg# See the "minimum version" comment for each macro you use to see what 
9457d5e3a19Smrg# version you require.
9467d5e3a19SmrgAC_DEFUN([XORG_MACROS_VERSION],[
9477d5e3a19Smrg	[XORG_MACROS_needed_version=$1
9487d5e3a19Smrg	XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
9497d5e3a19Smrg	XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
9507d5e3a19Smrg	AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
9517d5e3a19Smrg	[XORG_MACROS_version=1.1.5
9527d5e3a19Smrg	XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
9537d5e3a19Smrg	XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
9547d5e3a19Smrg	if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
9557d5e3a19Smrg		AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x])
9567d5e3a19Smrg	fi
9577d5e3a19Smrg	if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
9587d5e3a19Smrg		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])
9597d5e3a19Smrg	fi
9607d5e3a19Smrg	AC_MSG_RESULT([yes, $XORG_MACROS_version])
9617d5e3a19Smrg]) # XORG_MACROS_VERSION
9627d5e3a19Smrg
9637d5e3a19Smrg# XORG_PROG_RAWCPP()
9647d5e3a19Smrg# ------------------
9657d5e3a19Smrg# Minimum version: 1.0.0
9667d5e3a19Smrg#
9677d5e3a19Smrg# Find cpp program and necessary flags for use in pre-processing text files
9687d5e3a19Smrg# such as man pages and config files
9697d5e3a19SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
9707d5e3a19SmrgAC_REQUIRE([AC_PROG_CPP])
9717d5e3a19SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
9727d5e3a19Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9737d5e3a19Smrg
9747d5e3a19Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
9757d5e3a19Smrg# which is not the best choice for supporting other OS'es, but covers most
9767d5e3a19Smrg# of the ones we need for now.
9777d5e3a19SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
9787d5e3a19SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
9797d5e3a19Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9807d5e3a19Smrg	AC_MSG_RESULT([no])
9817d5e3a19Smrgelse
9827d5e3a19Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9837d5e3a19Smrg		RAWCPPFLAGS=-undef
9847d5e3a19Smrg		AC_MSG_RESULT([yes])
9857d5e3a19Smrg	else
9867d5e3a19Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
9877d5e3a19Smrg	fi
9887d5e3a19Smrgfi
9897d5e3a19Smrgrm -f conftest.$ac_ext
9907d5e3a19Smrg
9917d5e3a19SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
9927d5e3a19SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
9937d5e3a19Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9947d5e3a19Smrg	AC_MSG_RESULT([no])
9957d5e3a19Smrgelse
9967d5e3a19Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9977d5e3a19Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
9987d5e3a19Smrg		AC_MSG_RESULT([yes])
9997d5e3a19Smrg	else
10007d5e3a19Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
10017d5e3a19Smrg	fi
10027d5e3a19Smrgfi
10037d5e3a19Smrgrm -f conftest.$ac_ext
10047d5e3a19SmrgAC_SUBST(RAWCPPFLAGS)
10057d5e3a19Smrg]) # XORG_PROG_RAWCPP
10067d5e3a19Smrg
10077d5e3a19Smrg# XORG_MANPAGE_SECTIONS()
10087d5e3a19Smrg# -----------------------
10097d5e3a19Smrg# Minimum version: 1.0.0
10107d5e3a19Smrg#
10117d5e3a19Smrg# Determine which sections man pages go in for the different man page types
10127d5e3a19Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
10137d5e3a19Smrg# Not sure if there's any better way than just hardcoding by OS name.
10147d5e3a19Smrg# Override default settings by setting environment variables
10157d5e3a19Smrg
10167d5e3a19SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
10177d5e3a19SmrgAC_REQUIRE([AC_CANONICAL_HOST])
10187d5e3a19Smrg
10197d5e3a19Smrgif test x$APP_MAN_SUFFIX = x    ; then
10207d5e3a19Smrg    APP_MAN_SUFFIX=1
10217d5e3a19Smrgfi
10227d5e3a19Smrgif test x$APP_MAN_DIR = x    ; then
10237d5e3a19Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
10247d5e3a19Smrgfi
10257d5e3a19Smrg
10267d5e3a19Smrgif test x$LIB_MAN_SUFFIX = x    ; then
10277d5e3a19Smrg    LIB_MAN_SUFFIX=3
10287d5e3a19Smrgfi
10297d5e3a19Smrgif test x$LIB_MAN_DIR = x    ; then
10307d5e3a19Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
10317d5e3a19Smrgfi
10327d5e3a19Smrg
10337d5e3a19Smrgif test x$FILE_MAN_SUFFIX = x    ; then
10347d5e3a19Smrg    case $host_os in
10357d5e3a19Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
10367d5e3a19Smrg	*)		FILE_MAN_SUFFIX=5  ;;
10377d5e3a19Smrg    esac
10387d5e3a19Smrgfi
10397d5e3a19Smrgif test x$FILE_MAN_DIR = x    ; then
10407d5e3a19Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
10417d5e3a19Smrgfi
10427d5e3a19Smrg
10437d5e3a19Smrgif test x$MISC_MAN_SUFFIX = x    ; then
10447d5e3a19Smrg    case $host_os in
10457d5e3a19Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
10467d5e3a19Smrg	*)		MISC_MAN_SUFFIX=7  ;;
10477d5e3a19Smrg    esac
10487d5e3a19Smrgfi
10497d5e3a19Smrgif test x$MISC_MAN_DIR = x    ; then
10507d5e3a19Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
10517d5e3a19Smrgfi
10527d5e3a19Smrg
10537d5e3a19Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
10547d5e3a19Smrg    case $host_os in
10557d5e3a19Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
10567d5e3a19Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
10577d5e3a19Smrg    esac
10587d5e3a19Smrgfi
10597d5e3a19Smrgif test x$DRIVER_MAN_DIR = x    ; then
10607d5e3a19Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
10617d5e3a19Smrgfi
10627d5e3a19Smrg
10637d5e3a19Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
10647d5e3a19Smrg    case $host_os in
10657d5e3a19Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
10667d5e3a19Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
10677d5e3a19Smrg    esac
10687d5e3a19Smrgfi
10697d5e3a19Smrgif test x$ADMIN_MAN_DIR = x    ; then
10707d5e3a19Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
10717d5e3a19Smrgfi
10727d5e3a19Smrg
10737d5e3a19Smrg
10747d5e3a19SmrgAC_SUBST([APP_MAN_SUFFIX])
10757d5e3a19SmrgAC_SUBST([LIB_MAN_SUFFIX])
10767d5e3a19SmrgAC_SUBST([FILE_MAN_SUFFIX])
10777d5e3a19SmrgAC_SUBST([MISC_MAN_SUFFIX])
10787d5e3a19SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
10797d5e3a19SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
10807d5e3a19SmrgAC_SUBST([APP_MAN_DIR])
10817d5e3a19SmrgAC_SUBST([LIB_MAN_DIR])
10827d5e3a19SmrgAC_SUBST([FILE_MAN_DIR])
10837d5e3a19SmrgAC_SUBST([MISC_MAN_DIR])
10847d5e3a19SmrgAC_SUBST([DRIVER_MAN_DIR])
10857d5e3a19SmrgAC_SUBST([ADMIN_MAN_DIR])
10867d5e3a19Smrg]) # XORG_MANPAGE_SECTIONS
10877d5e3a19Smrg
10887d5e3a19Smrg# XORG_CHECK_LINUXDOC
10897d5e3a19Smrg# -------------------
10907d5e3a19Smrg# Minimum version: 1.0.0
10917d5e3a19Smrg#
10927d5e3a19Smrg# Defines the variable MAKE_TEXT if the necessary tools and
10937d5e3a19Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
10947d5e3a19Smrg# Whether or not the necessary tools and files are found can be checked
10957d5e3a19Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
10967d5e3a19SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
10977d5e3a19SmrgXORG_SGML_PATH=$prefix/share/sgml
10987d5e3a19SmrgHAVE_DEFS_ENT=
10997d5e3a19Smrg
11007d5e3a19SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
11017d5e3a19Smrg
11027d5e3a19SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
11037d5e3a19SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
11047d5e3a19Smrg
11057d5e3a19SmrgAC_MSG_CHECKING([Whether to build documentation])
11067d5e3a19Smrg
11077d5e3a19Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
11087d5e3a19Smrg   BUILDDOC=yes
11097d5e3a19Smrgelse
11107d5e3a19Smrg   BUILDDOC=no
11117d5e3a19Smrgfi
11127d5e3a19Smrg
11137d5e3a19SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
11147d5e3a19Smrg
11157d5e3a19SmrgAC_MSG_RESULT([$BUILDDOC])
11167d5e3a19Smrg
11177d5e3a19SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
11187d5e3a19Smrg
11197d5e3a19Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
11207d5e3a19Smrg   BUILDPDFDOC=yes
11217d5e3a19Smrgelse
11227d5e3a19Smrg   BUILDPDFDOC=no
11237d5e3a19Smrgfi
11247d5e3a19Smrg
11257d5e3a19SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
11267d5e3a19Smrg
11277d5e3a19SmrgAC_MSG_RESULT([$BUILDPDFDOC])
11287d5e3a19Smrg
11297d5e3a19SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
11307d5e3a19SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
11317d5e3a19SmrgMAKE_PDF="$PS2PDF"
11327d5e3a19SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
11337d5e3a19Smrg
11347d5e3a19SmrgAC_SUBST(MAKE_TEXT)
11357d5e3a19SmrgAC_SUBST(MAKE_PS)
11367d5e3a19SmrgAC_SUBST(MAKE_PDF)
11377d5e3a19SmrgAC_SUBST(MAKE_HTML)
11387d5e3a19Smrg]) # XORG_CHECK_LINUXDOC
11397d5e3a19Smrg
11407d5e3a19Smrg# XORG_CHECK_DOCBOOK
11417d5e3a19Smrg# -------------------
11427d5e3a19Smrg# Minimum version: 1.0.0
11437d5e3a19Smrg#
11447d5e3a19Smrg# Checks for the ability to build output formats from SGML DocBook source.
11457d5e3a19Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
11467d5e3a19Smrg# indicates whether the necessary tools and files are found and, if set,
11477d5e3a19Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
11487d5e3a19SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
11497d5e3a19SmrgXORG_SGML_PATH=$prefix/share/sgml
11507d5e3a19SmrgHAVE_DEFS_ENT=
11517d5e3a19SmrgBUILDTXTDOC=no
11527d5e3a19SmrgBUILDPDFDOC=no
11537d5e3a19SmrgBUILDPSDOC=no
11547d5e3a19SmrgBUILDHTMLDOC=no
11557d5e3a19Smrg
11567d5e3a19SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
11577d5e3a19Smrg
11587d5e3a19SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
11597d5e3a19SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
11607d5e3a19SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
11617d5e3a19SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
11627d5e3a19Smrg
11637d5e3a19SmrgAC_MSG_CHECKING([Whether to build text documentation])
11647d5e3a19Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
11657d5e3a19Smrg   test x$BUILD_TXTDOC != xno; then
11667d5e3a19Smrg	BUILDTXTDOC=yes
11677d5e3a19Smrgfi
11687d5e3a19SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
11697d5e3a19SmrgAC_MSG_RESULT([$BUILDTXTDOC])
11707d5e3a19Smrg
11717d5e3a19SmrgAC_MSG_CHECKING([Whether to build PDF documentation])
11727d5e3a19Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
11737d5e3a19Smrg   test x$BUILD_PDFDOC != xno; then
11747d5e3a19Smrg	BUILDPDFDOC=yes
11757d5e3a19Smrgfi
11767d5e3a19SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
11777d5e3a19SmrgAC_MSG_RESULT([$BUILDPDFDOC])
11787d5e3a19Smrg
11797d5e3a19SmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
11807d5e3a19Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
11817d5e3a19Smrg   test x$BUILD_PSDOC != xno; then
11827d5e3a19Smrg	BUILDPSDOC=yes
11837d5e3a19Smrgfi
11847d5e3a19SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
11857d5e3a19SmrgAC_MSG_RESULT([$BUILDPSDOC])
11867d5e3a19Smrg
11877d5e3a19SmrgAC_MSG_CHECKING([Whether to build HTML documentation])
11887d5e3a19Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
11897d5e3a19Smrg   test x$BUILD_HTMLDOC != xno; then
11907d5e3a19Smrg	BUILDHTMLDOC=yes
11917d5e3a19Smrgfi
11927d5e3a19SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
11937d5e3a19SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
11947d5e3a19Smrg
11957d5e3a19SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
11967d5e3a19SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
11977d5e3a19SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
11987d5e3a19SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
11997d5e3a19Smrg
12007d5e3a19SmrgAC_SUBST(MAKE_TEXT)
12017d5e3a19SmrgAC_SUBST(MAKE_PS)
12027d5e3a19SmrgAC_SUBST(MAKE_PDF)
12037d5e3a19SmrgAC_SUBST(MAKE_HTML)
12047d5e3a19Smrg]) # XORG_CHECK_DOCBOOK
12057d5e3a19Smrg
12067d5e3a19Smrg# XORG_CHECK_MALLOC_ZERO
12077d5e3a19Smrg# ----------------------
12087d5e3a19Smrg# Minimum version: 1.0.0
12097d5e3a19Smrg#
12107d5e3a19Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
12117d5e3a19Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
12127d5e3a19Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
12137d5e3a19SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
12147d5e3a19SmrgAC_ARG_ENABLE(malloc0returnsnull,
12157d5e3a19Smrg	AC_HELP_STRING([--enable-malloc0returnsnull],
12167d5e3a19Smrg		       [malloc(0) returns NULL (default: auto)]),
12177d5e3a19Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
12187d5e3a19Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
12197d5e3a19Smrg
12207d5e3a19SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
12217d5e3a19Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
12227d5e3a19Smrg	AC_RUN_IFELSE([
12237d5e3a19Smrgchar *malloc();
12247d5e3a19Smrgchar *realloc();
12257d5e3a19Smrgchar *calloc();
12267d5e3a19Smrgmain() {
12277d5e3a19Smrg    char *m0, *r0, *c0, *p;
12287d5e3a19Smrg    m0 = malloc(0);
12297d5e3a19Smrg    p = malloc(10);
12307d5e3a19Smrg    r0 = realloc(p,0);
12317d5e3a19Smrg    c0 = calloc(0);
12327d5e3a19Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
12337d5e3a19Smrg}],
12347d5e3a19Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
12357d5e3a19Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
12367d5e3a19Smrgfi
12377d5e3a19SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
12387d5e3a19Smrg
12397d5e3a19Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
12407d5e3a19Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
12417d5e3a19Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
12427d5e3a19Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
12437d5e3a19Smrgelse
12447d5e3a19Smrg	MALLOC_ZERO_CFLAGS=""
12457d5e3a19Smrg	XMALLOC_ZERO_CFLAGS=""
12467d5e3a19Smrg	XTMALLOC_ZERO_CFLAGS=""
12477d5e3a19Smrgfi
12487d5e3a19Smrg
12497d5e3a19SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
12507d5e3a19SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
12517d5e3a19SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
12527d5e3a19Smrg]) # XORG_CHECK_MALLOC_ZERO
12537d5e3a19Smrg
12547d5e3a19Smrg# XORG_WITH_LINT()
12557d5e3a19Smrg# ----------------
12567d5e3a19Smrg# Minimum version: 1.1.0
12577d5e3a19Smrg#
12587d5e3a19Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint
12597d5e3a19Smrg# is specified.   (Use --with-lint=sparse for sparse.)
12607d5e3a19Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
12617d5e3a19Smrg# Sets $LINT_FLAGS to flags to pass to source checker
12627d5e3a19Smrg# Sets LINT automake conditional if enabled (default: disabled)
12637d5e3a19Smrg#
12647d5e3a19SmrgAC_DEFUN([XORG_WITH_LINT],[
12657d5e3a19Smrg
12667d5e3a19Smrg# Allow checking code with lint, sparse, etc.
12677d5e3a19SmrgAC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
12687d5e3a19Smrg		[Use a lint-style source code checker (default: disabled)])],
12697d5e3a19Smrg		[use_lint=$withval], [use_lint=no])
12707d5e3a19Smrgif test "x$use_lint" = "xyes" ; then
12717d5e3a19Smrg	LINT="lint"
12727d5e3a19Smrgelse
12737d5e3a19Smrg	LINT="$use_lint"
12747d5e3a19Smrgfi
12757d5e3a19Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
12767d5e3a19Smrg    case $LINT in
12777d5e3a19Smrg	lint|*/lint)
12787d5e3a19Smrg	    case $host_os in
12797d5e3a19Smrg		solaris*)
12807d5e3a19Smrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
12817d5e3a19Smrg			;;
12827d5e3a19Smrg	    esac
12837d5e3a19Smrg	    ;;
12847d5e3a19Smrg    esac
12857d5e3a19Smrgfi
12867d5e3a19Smrg
12877d5e3a19SmrgAC_SUBST(LINT)
12887d5e3a19SmrgAC_SUBST(LINT_FLAGS)
12897d5e3a19SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
12907d5e3a19Smrg
12917d5e3a19Smrg]) # XORG_WITH_LINT
12927d5e3a19Smrg
12937d5e3a19Smrg# XORG_LINT_LIBRARY(LIBNAME)
12947d5e3a19Smrg# --------------------------
12957d5e3a19Smrg# Minimum version: 1.1.0
12967d5e3a19Smrg#
12977d5e3a19Smrg# Sets up flags for building lint libraries for checking programs that call
12987d5e3a19Smrg# functions in the library.
12997d5e3a19Smrg# Disabled by default, enable with --enable-lint-library
13007d5e3a19Smrg# Sets: 
13017d5e3a19Smrg#	@LINTLIB@		- name of lint library file to make
13027d5e3a19Smrg#	MAKE_LINT_LIB		- automake conditional
13037d5e3a19Smrg#
13047d5e3a19Smrg
13057d5e3a19SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
13067d5e3a19SmrgAC_REQUIRE([XORG_WITH_LINT])
13077d5e3a19Smrg# Build lint "library" for more indepth checks of programs calling this library
13087d5e3a19SmrgAC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
13097d5e3a19Smrg	[Create lint library (default: disabled)])],
13107d5e3a19Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
13117d5e3a19Smrgif test "x$make_lint_lib" != "xno" ; then
13127d5e3a19Smrg	if test "x$LINT" = "xno" ; then
13137d5e3a19Smrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
13147d5e3a19Smrg	fi
13157d5e3a19Smrg	if test "x$make_lint_lib" = "xyes" ; then
13167d5e3a19Smrg		LINTLIB=llib-l$1.ln
13177d5e3a19Smrg	else
13187d5e3a19Smrg		LINTLIB=$make_lint_lib
13197d5e3a19Smrg	fi
13207d5e3a19Smrgfi
13217d5e3a19SmrgAC_SUBST(LINTLIB)
13227d5e3a19SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
13237d5e3a19Smrg
13247d5e3a19Smrg]) # XORG_LINT_LIBRARY
13257d5e3a19Smrg
13267d5e3a19Smrgdnl Copyright 2005 Red Hat, Inc
13277d5e3a19Smrgdnl
13287d5e3a19Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
13297d5e3a19Smrgdnl documentation for any purpose is hereby granted without fee, provided that
13307d5e3a19Smrgdnl the above copyright notice appear in all copies and that both that
13317d5e3a19Smrgdnl copyright notice and this permission notice appear in supporting
13327d5e3a19Smrgdnl documentation.
13337d5e3a19Smrgdnl
13347d5e3a19Smrgdnl The above copyright notice and this permission notice shall be included
13357d5e3a19Smrgdnl in all copies or substantial portions of the Software.
13367d5e3a19Smrgdnl
13377d5e3a19Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
13387d5e3a19Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
13397d5e3a19Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
13407d5e3a19Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
13417d5e3a19Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
13427d5e3a19Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
13437d5e3a19Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
13447d5e3a19Smrgdnl
13457d5e3a19Smrgdnl Except as contained in this notice, the name of the copyright holders shall
13467d5e3a19Smrgdnl not be used in advertising or otherwise to promote the sale, use or
13477d5e3a19Smrgdnl other dealings in this Software without prior written authorization
13487d5e3a19Smrgdnl from the copyright holders.
13497d5e3a19Smrgdnl
13507d5e3a19Smrg
13517d5e3a19Smrg# XORG_RELEASE_VERSION
13527d5e3a19Smrg# --------------------
13537d5e3a19Smrg# Adds --with/without-release-string and changes the PACKAGE and
13547d5e3a19Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
13557d5e3a19Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
13567d5e3a19Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
13577d5e3a19Smrg 
13587d5e3a19SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
13597d5e3a19Smrg	AC_ARG_WITH(release-version,
13607d5e3a19Smrg			AC_HELP_STRING([--with-release-version=STRING],
13617d5e3a19Smrg				[Use release version string in package name]),
13627d5e3a19Smrg			[RELEASE_VERSION="$withval"],
13637d5e3a19Smrg			[RELEASE_VERSION=""])
13647d5e3a19Smrg	if test "x$RELEASE_VERSION" != "x"; then
13657d5e3a19Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
13667d5e3a19Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
13677d5e3a19Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
13687d5e3a19Smrg	fi
13697d5e3a19Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
13707d5e3a19Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
13717d5e3a19Smrg		[Major version of this package])
13727d5e3a19Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2`
13737d5e3a19Smrg	if test "x$PVM" = "x"; then
13747d5e3a19Smrg		PVM="0"
13757d5e3a19Smrg	fi
13767d5e3a19Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
13777d5e3a19Smrg		[$PVM],
13787d5e3a19Smrg		[Minor version of this package])
13797d5e3a19Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3`
13807d5e3a19Smrg	if test "x$PVP" = "x"; then
13817d5e3a19Smrg		PVP="0"
13827d5e3a19Smrg	fi
13837d5e3a19Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
13847d5e3a19Smrg		[$PVP],
13857d5e3a19Smrg		[Patch version of this package])
13867d5e3a19Smrg])
13877d5e3a19Smrg
13887d5e3a19Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
13897d5e3a19Smrg# 
13907d5e3a19Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
13917d5e3a19Smrg#
13927d5e3a19Smrg# This program is free software; you can redistribute it and/or modify
13937d5e3a19Smrg# it under the terms of the GNU General Public License as published by
13947d5e3a19Smrg# the Free Software Foundation; either version 2 of the License, or
13957d5e3a19Smrg# (at your option) any later version.
13967d5e3a19Smrg#
13977d5e3a19Smrg# This program is distributed in the hope that it will be useful, but
13987d5e3a19Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
13997d5e3a19Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14007d5e3a19Smrg# General Public License for more details.
14017d5e3a19Smrg#
14027d5e3a19Smrg# You should have received a copy of the GNU General Public License
14037d5e3a19Smrg# along with this program; if not, write to the Free Software
14047d5e3a19Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
14057d5e3a19Smrg#
14067d5e3a19Smrg# As a special exception to the GNU General Public License, if you
14077d5e3a19Smrg# distribute this file as part of a program that contains a
14087d5e3a19Smrg# configuration script generated by Autoconf, you may include it under
14097d5e3a19Smrg# the same distribution terms that you use for the rest of that program.
14107d5e3a19Smrg
14117d5e3a19Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
14127d5e3a19Smrg# ----------------------------------
14137d5e3a19SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
14147d5e3a19Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
14157d5e3a19Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
14167d5e3a19SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
14177d5e3a19Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
14187d5e3a19Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
14197d5e3a19Smrgfi
14207d5e3a19Smrgif test -n "$PKG_CONFIG"; then
14217d5e3a19Smrg	_pkg_min_version=m4_ifval([$1], [$1], [0.9.0])
14227d5e3a19Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
14237d5e3a19Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
14247d5e3a19Smrg		AC_MSG_RESULT([yes])
14257d5e3a19Smrg	else
14267d5e3a19Smrg		AC_MSG_RESULT([no])
14277d5e3a19Smrg		PKG_CONFIG=""
14287d5e3a19Smrg	fi
14297d5e3a19Smrg		
14307d5e3a19Smrgfi[]dnl
14317d5e3a19Smrg])# PKG_PROG_PKG_CONFIG
14327d5e3a19Smrg
14337d5e3a19Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
14347d5e3a19Smrg#
14357d5e3a19Smrg# Check to see whether a particular set of modules exists.  Similar
14367d5e3a19Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
14377d5e3a19Smrg#
14387d5e3a19Smrg#
14397d5e3a19Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
14407d5e3a19Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
14417d5e3a19Smrg# PKG_CHECK_EXISTS manually
14427d5e3a19Smrg# --------------------------------------------------------------
14437d5e3a19SmrgAC_DEFUN([PKG_CHECK_EXISTS],
14447d5e3a19Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
14457d5e3a19Smrgif test -n "$PKG_CONFIG" && \
14467d5e3a19Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
14477d5e3a19Smrg  m4_ifval([$2], [$2], [:])
14487d5e3a19Smrgm4_ifvaln([$3], [else
14497d5e3a19Smrg  $3])dnl
14507d5e3a19Smrgfi])
14517d5e3a19Smrg
14527d5e3a19Smrg
14537d5e3a19Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
14547d5e3a19Smrg# ---------------------------------------------
14557d5e3a19Smrgm4_define([_PKG_CONFIG],
14567d5e3a19Smrg[if test -n "$PKG_CONFIG"; then
14577d5e3a19Smrg        PKG_CHECK_EXISTS([$3],
14587d5e3a19Smrg                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
14597d5e3a19Smrg			 [pkg_failed=yes])
14607d5e3a19Smrgelse
14617d5e3a19Smrg	pkg_failed=untried
14627d5e3a19Smrgfi[]dnl
14637d5e3a19Smrg])# _PKG_CONFIG
14647d5e3a19Smrg
14657d5e3a19Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
14667d5e3a19Smrg# [ACTION-IF-NOT-FOUND])
14677d5e3a19Smrg#
14687d5e3a19Smrg#
14697d5e3a19Smrg# Note that if there is a possibility the first call to
14707d5e3a19Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
14717d5e3a19Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
14727d5e3a19Smrg#
14737d5e3a19Smrg#
14747d5e3a19Smrg# --------------------------------------------------------------
14757d5e3a19SmrgAC_DEFUN([PKG_CHECK_MODULES],
14767d5e3a19Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
14777d5e3a19SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
14787d5e3a19SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
14797d5e3a19Smrg
14807d5e3a19Smrgpkg_failed=no
14817d5e3a19SmrgAC_MSG_CHECKING([for $1])
14827d5e3a19Smrg
14837d5e3a19Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
14847d5e3a19Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
14857d5e3a19Smrg
14867d5e3a19Smrgif test $pkg_failed = yes; then
14877d5e3a19Smrg	$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
14887d5e3a19Smrg	# Put the nasty error message in config.log where it belongs
14897d5e3a19Smrg	echo "$$1[]_PKG_ERRORS" 1>&AS_MESSAGE_LOG_FD
14907d5e3a19Smrg
14917d5e3a19Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
14927d5e3a19Smrg[Package requirements ($2) were not met.
14937d5e3a19SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
14947d5e3a19Smrginstalled software in a non-standard prefix.
14957d5e3a19Smrg
14967d5e3a19SmrgAlternatively you may set the $1_CFLAGS and $1_LIBS environment variables
14977d5e3a19Smrgto avoid the need to call pkg-config.  See the pkg-config man page for
14987d5e3a19Smrgmore details.])],
14997d5e3a19Smrg		[$4])
15007d5e3a19Smrgelif test $pkg_failed = untried; then
15017d5e3a19Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
15027d5e3a19Smrg[The pkg-config script could not be found or is too old.  Make sure it
15037d5e3a19Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
15047d5e3a19Smrgpath to pkg-config.
15057d5e3a19Smrg
15067d5e3a19SmrgAlternatively you may set the $1_CFLAGS and $1_LIBS environment variables
15077d5e3a19Smrgto avoid the need to call pkg-config.  See the pkg-config man page for
15087d5e3a19Smrgmore details.
15097d5e3a19Smrg
15107d5e3a19SmrgTo get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
15117d5e3a19Smrg		[$4])
15127d5e3a19Smrgelse
15137d5e3a19Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
15147d5e3a19Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
15157d5e3a19Smrg        AC_MSG_RESULT([yes])
15167d5e3a19Smrg	ifelse([$3], , :, [$3])
15177d5e3a19Smrgfi[]dnl
15187d5e3a19Smrg])# PKG_CHECK_MODULES
15197d5e3a19Smrg
1520