aclocal.m4 revision 7978d3cd
17978d3cdSmrg# generated automatically by aclocal 1.10 -*- Autoconf -*-
2ea6ae205Smrg
3ea6ae205Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
47978d3cdSmrg# 2005, 2006  Free Software Foundation, Inc.
5ea6ae205Smrg# This file is free software; the Free Software Foundation
6ea6ae205Smrg# gives unlimited permission to copy and/or distribute it,
7ea6ae205Smrg# with or without modifications, as long as this notice is preserved.
8ea6ae205Smrg
9ea6ae205Smrg# This program is distributed in the hope that it will be useful,
10ea6ae205Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11ea6ae205Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12ea6ae205Smrg# PARTICULAR PURPOSE.
13ea6ae205Smrg
147978d3cdSmrgm4_if(m4_PACKAGE_VERSION, [2.61],,
157978d3cdSmrg[m4_fatal([this file was generated for autoconf 2.61.
167978d3cdSmrgYou have another version of autoconf.  If you want to use that,
177978d3cdSmrgyou should regenerate the build system entirely.], [63])])
18ea6ae205Smrg
197978d3cdSmrg# Copyright (C) 2002, 2003, 2005, 2006  Free Software Foundation, Inc.
20ea6ae205Smrg#
217978d3cdSmrg# This file is free software; the Free Software Foundation
227978d3cdSmrg# gives unlimited permission to copy and/or distribute it,
237978d3cdSmrg# with or without modifications, as long as this notice is preserved.
24ea6ae205Smrg
257978d3cdSmrg# AM_AUTOMAKE_VERSION(VERSION)
267978d3cdSmrg# ----------------------------
277978d3cdSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
287978d3cdSmrg# generated from the m4 files accompanying Automake X.Y.
297978d3cdSmrg# (This private macro should not be called outside this file.)
307978d3cdSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
317978d3cdSmrg[am__api_version='1.10'
327978d3cdSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
337978d3cdSmrgdnl require some minimum version.  Point them to the right macro.
347978d3cdSmrgm4_if([$1], [1.10], [],
357978d3cdSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
367978d3cdSmrg])
37ea6ae205Smrg
387978d3cdSmrg# _AM_AUTOCONF_VERSION(VERSION)
397978d3cdSmrg# -----------------------------
407978d3cdSmrg# aclocal traces this macro to find the Autoconf version.
417978d3cdSmrg# This is a private macro too.  Using m4_define simplifies
427978d3cdSmrg# the logic in aclocal, which can simply ignore this definition.
437978d3cdSmrgm4_define([_AM_AUTOCONF_VERSION], [])
44ea6ae205Smrg
457978d3cdSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
467978d3cdSmrg# -------------------------------
477978d3cdSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
487978d3cdSmrg# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
497978d3cdSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
507978d3cdSmrg[AM_AUTOMAKE_VERSION([1.10])dnl
517978d3cdSmrg_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
52ea6ae205Smrg
537978d3cdSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
54ea6ae205Smrg
557978d3cdSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
567978d3cdSmrg#
577978d3cdSmrg# This file is free software; the Free Software Foundation
587978d3cdSmrg# gives unlimited permission to copy and/or distribute it,
597978d3cdSmrg# with or without modifications, as long as this notice is preserved.
60ea6ae205Smrg
617978d3cdSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
627978d3cdSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
637978d3cdSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
647978d3cdSmrg#
657978d3cdSmrg# Of course, Automake must honor this variable whenever it calls a
667978d3cdSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
677978d3cdSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
687978d3cdSmrg# depending on how configure is run.  This is pretty annoying, since
697978d3cdSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
707978d3cdSmrg# source directory, any form will work fine, but in subdirectories a
717978d3cdSmrg# relative path needs to be adjusted first.
72ea6ae205Smrg#
737978d3cdSmrg# $ac_aux_dir/missing
747978d3cdSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
757978d3cdSmrg# $top_srcdir/$ac_aux_dir/missing
767978d3cdSmrg#    fails if $ac_aux_dir is absolute,
777978d3cdSmrg#    fails when called from a subdirectory in a VPATH build with
787978d3cdSmrg#          a relative $ac_aux_dir
79ea6ae205Smrg#
807978d3cdSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
817978d3cdSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
827978d3cdSmrg# harmless because $srcdir is `.', but things will broke when you
837978d3cdSmrg# start a VPATH build or use an absolute $srcdir.
84ea6ae205Smrg#
857978d3cdSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
867978d3cdSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
877978d3cdSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
887978d3cdSmrg# and then we would define $MISSING as
897978d3cdSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
907978d3cdSmrg# This will work as long as MISSING is not called from configure, because
917978d3cdSmrg# unfortunately $(top_srcdir) has no meaning in configure.
927978d3cdSmrg# However there are other variables, like CC, which are often used in
937978d3cdSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
94ea6ae205Smrg#
957978d3cdSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
967978d3cdSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
977978d3cdSmrg# configured tree to be moved without reconfiguration.
98ea6ae205Smrg
997978d3cdSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
1007978d3cdSmrg[dnl Rely on autoconf to set up CDPATH properly.
1017978d3cdSmrgAC_PREREQ([2.50])dnl
1027978d3cdSmrg# expand $ac_aux_dir to an absolute path
1037978d3cdSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
1047978d3cdSmrg])
105ea6ae205Smrg
1067978d3cdSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
107ea6ae205Smrg
1087978d3cdSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
1097978d3cdSmrg# Free Software Foundation, Inc.
1107978d3cdSmrg#
1117978d3cdSmrg# This file is free software; the Free Software Foundation
1127978d3cdSmrg# gives unlimited permission to copy and/or distribute it,
1137978d3cdSmrg# with or without modifications, as long as this notice is preserved.
114ea6ae205Smrg
1157978d3cdSmrg# serial 8
116ea6ae205Smrg
1177978d3cdSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
1187978d3cdSmrg# -------------------------------------
1197978d3cdSmrg# Define a conditional.
1207978d3cdSmrgAC_DEFUN([AM_CONDITIONAL],
1217978d3cdSmrg[AC_PREREQ(2.52)dnl
1227978d3cdSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1237978d3cdSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1247978d3cdSmrgAC_SUBST([$1_TRUE])dnl
1257978d3cdSmrgAC_SUBST([$1_FALSE])dnl
1267978d3cdSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
1277978d3cdSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
1287978d3cdSmrgif $2; then
1297978d3cdSmrg  $1_TRUE=
1307978d3cdSmrg  $1_FALSE='#'
1317978d3cdSmrgelse
1327978d3cdSmrg  $1_TRUE='#'
1337978d3cdSmrg  $1_FALSE=
1347978d3cdSmrgfi
1357978d3cdSmrgAC_CONFIG_COMMANDS_PRE(
1367978d3cdSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1377978d3cdSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
1387978d3cdSmrgUsually this means the macro was only invoked conditionally.]])
1397978d3cdSmrgfi])])
140ea6ae205Smrg
1417978d3cdSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
1427978d3cdSmrg# Free Software Foundation, Inc.
1437978d3cdSmrg#
1447978d3cdSmrg# This file is free software; the Free Software Foundation
1457978d3cdSmrg# gives unlimited permission to copy and/or distribute it,
1467978d3cdSmrg# with or without modifications, as long as this notice is preserved.
147ea6ae205Smrg
1487978d3cdSmrg# serial 9
149ea6ae205Smrg
1507978d3cdSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1517978d3cdSmrg# written in clear, in which case automake, when reading aclocal.m4,
1527978d3cdSmrg# will think it sees a *use*, and therefore will trigger all it's
1537978d3cdSmrg# C support machinery.  Also note that it means that autoscan, seeing
1547978d3cdSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
155ea6ae205Smrg
156ea6ae205Smrg
1577978d3cdSmrg# _AM_DEPENDENCIES(NAME)
1587978d3cdSmrg# ----------------------
1597978d3cdSmrg# See how the compiler implements dependency checking.
1607978d3cdSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
1617978d3cdSmrg# We try a few techniques and use that to set a single cache variable.
1627978d3cdSmrg#
1637978d3cdSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1647978d3cdSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1657978d3cdSmrg# dependency, and given that the user is not expected to run this macro,
1667978d3cdSmrg# just rely on AC_PROG_CC.
1677978d3cdSmrgAC_DEFUN([_AM_DEPENDENCIES],
1687978d3cdSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
1697978d3cdSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1707978d3cdSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
1717978d3cdSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
172ea6ae205Smrg
1737978d3cdSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
1747978d3cdSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
1757978d3cdSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1767978d3cdSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
1777978d3cdSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1787978d3cdSmrg                   [depcc="$$1"   am_compiler_list=])
179ea6ae205Smrg
1807978d3cdSmrgAC_CACHE_CHECK([dependency style of $depcc],
1817978d3cdSmrg               [am_cv_$1_dependencies_compiler_type],
1827978d3cdSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1837978d3cdSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
1847978d3cdSmrg  # making bogus files that we don't know about and never remove.  For
1857978d3cdSmrg  # instance it was reported that on HP-UX the gcc test will end up
1867978d3cdSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
1877978d3cdSmrg  # in D'.
1887978d3cdSmrg  mkdir conftest.dir
1897978d3cdSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
1907978d3cdSmrg  # using a relative directory.
1917978d3cdSmrg  cp "$am_depcomp" conftest.dir
1927978d3cdSmrg  cd conftest.dir
1937978d3cdSmrg  # We will build objects and dependencies in a subdirectory because
1947978d3cdSmrg  # it helps to detect inapplicable dependency modes.  For instance
1957978d3cdSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
1967978d3cdSmrg  # side effect of compilation, but ICC will put the dependencies in
1977978d3cdSmrg  # the current directory while Tru64 will put them in the object
1987978d3cdSmrg  # directory.
1997978d3cdSmrg  mkdir sub
200ea6ae205Smrg
2017978d3cdSmrg  am_cv_$1_dependencies_compiler_type=none
2027978d3cdSmrg  if test "$am_compiler_list" = ""; then
2037978d3cdSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2047978d3cdSmrg  fi
2057978d3cdSmrg  for depmode in $am_compiler_list; do
2067978d3cdSmrg    # Setup a source with many dependencies, because some compilers
2077978d3cdSmrg    # like to wrap large dependency lists on column 80 (with \), and
2087978d3cdSmrg    # we should not choose a depcomp mode which is confused by this.
2097978d3cdSmrg    #
2107978d3cdSmrg    # We need to recreate these files for each test, as the compiler may
2117978d3cdSmrg    # overwrite some of them when testing with obscure command lines.
2127978d3cdSmrg    # This happens at least with the AIX C compiler.
2137978d3cdSmrg    : > sub/conftest.c
2147978d3cdSmrg    for i in 1 2 3 4 5 6; do
2157978d3cdSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
2167978d3cdSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
2177978d3cdSmrg      # Solaris 8's {/usr,}/bin/sh.
2187978d3cdSmrg      touch sub/conftst$i.h
2197978d3cdSmrg    done
2207978d3cdSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
221ea6ae205Smrg
2227978d3cdSmrg    case $depmode in
2237978d3cdSmrg    nosideeffect)
2247978d3cdSmrg      # after this tag, mechanisms are not by side-effect, so they'll
2257978d3cdSmrg      # only be used when explicitly requested
2267978d3cdSmrg      if test "x$enable_dependency_tracking" = xyes; then
2277978d3cdSmrg	continue
2287978d3cdSmrg      else
2297978d3cdSmrg	break
2307978d3cdSmrg      fi
2317978d3cdSmrg      ;;
2327978d3cdSmrg    none) break ;;
233ea6ae205Smrg    esac
2347978d3cdSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
2357978d3cdSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
2367978d3cdSmrg    # handle `-M -o', and we need to detect this.
2377978d3cdSmrg    if depmode=$depmode \
2387978d3cdSmrg       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
2397978d3cdSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
2407978d3cdSmrg       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
2417978d3cdSmrg         >/dev/null 2>conftest.err &&
2427978d3cdSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
2437978d3cdSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
2447978d3cdSmrg       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
2457978d3cdSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
2467978d3cdSmrg      # icc doesn't choke on unknown options, it will just issue warnings
2477978d3cdSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
2487978d3cdSmrg      # that says an option was ignored or not supported.
2497978d3cdSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
2507978d3cdSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
2517978d3cdSmrg      # The diagnosis changed in icc 8.0:
2527978d3cdSmrg      #   icc: Command line remark: option '-MP' not supported
2537978d3cdSmrg      if (grep 'ignoring option' conftest.err ||
2547978d3cdSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
2557978d3cdSmrg        am_cv_$1_dependencies_compiler_type=$depmode
2567978d3cdSmrg        break
2577978d3cdSmrg      fi
2587978d3cdSmrg    fi
2597978d3cdSmrg  done
260ea6ae205Smrg
2617978d3cdSmrg  cd ..
2627978d3cdSmrg  rm -rf conftest.dir
2637978d3cdSmrgelse
2647978d3cdSmrg  am_cv_$1_dependencies_compiler_type=none
265ea6ae205Smrgfi
2667978d3cdSmrg])
2677978d3cdSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
2687978d3cdSmrgAM_CONDITIONAL([am__fastdep$1], [
2697978d3cdSmrg  test "x$enable_dependency_tracking" != xno \
2707978d3cdSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
2717978d3cdSmrg])
272ea6ae205Smrg
273ea6ae205Smrg
2747978d3cdSmrg# AM_SET_DEPDIR
2757978d3cdSmrg# -------------
2767978d3cdSmrg# Choose a directory name for dependency files.
2777978d3cdSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
2787978d3cdSmrgAC_DEFUN([AM_SET_DEPDIR],
2797978d3cdSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
2807978d3cdSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
2817978d3cdSmrg])
282ea6ae205Smrg
283ea6ae205Smrg
2847978d3cdSmrg# AM_DEP_TRACK
2857978d3cdSmrg# ------------
2867978d3cdSmrgAC_DEFUN([AM_DEP_TRACK],
2877978d3cdSmrg[AC_ARG_ENABLE(dependency-tracking,
2887978d3cdSmrg[  --disable-dependency-tracking  speeds up one-time build
2897978d3cdSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
2907978d3cdSmrgif test "x$enable_dependency_tracking" != xno; then
2917978d3cdSmrg  am_depcomp="$ac_aux_dir/depcomp"
2927978d3cdSmrg  AMDEPBACKSLASH='\'
293ea6ae205Smrgfi
2947978d3cdSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
2957978d3cdSmrgAC_SUBST([AMDEPBACKSLASH])dnl
2967978d3cdSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
2977978d3cdSmrg])
298ea6ae205Smrg
2997978d3cdSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
300ea6ae205Smrg
3017978d3cdSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
3027978d3cdSmrg# Free Software Foundation, Inc.
3037978d3cdSmrg#
3047978d3cdSmrg# This file is free software; the Free Software Foundation
3057978d3cdSmrg# gives unlimited permission to copy and/or distribute it,
3067978d3cdSmrg# with or without modifications, as long as this notice is preserved.
307ea6ae205Smrg
3087978d3cdSmrg#serial 3
309ea6ae205Smrg
3107978d3cdSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
3117978d3cdSmrg# ------------------------------
3127978d3cdSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
3137978d3cdSmrg[for mf in $CONFIG_FILES; do
3147978d3cdSmrg  # Strip MF so we end up with the name of the file.
3157978d3cdSmrg  mf=`echo "$mf" | sed -e 's/:.*$//'`
3167978d3cdSmrg  # Check whether this is an Automake generated Makefile or not.
3177978d3cdSmrg  # We used to match only the files named `Makefile.in', but
3187978d3cdSmrg  # some people rename them; so instead we look at the file content.
3197978d3cdSmrg  # Grep'ing the first line is not enough: some people post-process
3207978d3cdSmrg  # each Makefile.in and add a new line on top of each file to say so.
3217978d3cdSmrg  # Grep'ing the whole file is not good either: AIX grep has a line
3227978d3cdSmrg  # limit of 2048, but all sed's we know have understand at least 4000.
3237978d3cdSmrg  if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
3247978d3cdSmrg    dirpart=`AS_DIRNAME("$mf")`
3257978d3cdSmrg  else
3267978d3cdSmrg    continue
3277978d3cdSmrg  fi
3287978d3cdSmrg  # Extract the definition of DEPDIR, am__include, and am__quote
3297978d3cdSmrg  # from the Makefile without running `make'.
3307978d3cdSmrg  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
3317978d3cdSmrg  test -z "$DEPDIR" && continue
3327978d3cdSmrg  am__include=`sed -n 's/^am__include = //p' < "$mf"`
3337978d3cdSmrg  test -z "am__include" && continue
3347978d3cdSmrg  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
3357978d3cdSmrg  # When using ansi2knr, U may be empty or an underscore; expand it
3367978d3cdSmrg  U=`sed -n 's/^U = //p' < "$mf"`
3377978d3cdSmrg  # Find all dependency output files, they are included files with
3387978d3cdSmrg  # $(DEPDIR) in their names.  We invoke sed twice because it is the
3397978d3cdSmrg  # simplest approach to changing $(DEPDIR) to its actual value in the
3407978d3cdSmrg  # expansion.
3417978d3cdSmrg  for file in `sed -n "
3427978d3cdSmrg    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
3437978d3cdSmrg       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
3447978d3cdSmrg    # Make sure the directory exists.
3457978d3cdSmrg    test -f "$dirpart/$file" && continue
3467978d3cdSmrg    fdir=`AS_DIRNAME(["$file"])`
3477978d3cdSmrg    AS_MKDIR_P([$dirpart/$fdir])
3487978d3cdSmrg    # echo "creating $dirpart/$file"
3497978d3cdSmrg    echo '# dummy' > "$dirpart/$file"
3507978d3cdSmrg  done
3517978d3cdSmrgdone
3527978d3cdSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
353ea6ae205Smrg
354ea6ae205Smrg
3557978d3cdSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
3567978d3cdSmrg# -----------------------------
3577978d3cdSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
3587978d3cdSmrg#
3597978d3cdSmrg# This code is only required when automatic dependency tracking
3607978d3cdSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
3617978d3cdSmrg# need in order to bootstrap the dependency handling code.
3627978d3cdSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
3637978d3cdSmrg[AC_CONFIG_COMMANDS([depfiles],
3647978d3cdSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
3657978d3cdSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
3667978d3cdSmrg])
367ea6ae205Smrg
3687978d3cdSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
3697978d3cdSmrg# Free Software Foundation, Inc.
3707978d3cdSmrg#
3717978d3cdSmrg# This file is free software; the Free Software Foundation
3727978d3cdSmrg# gives unlimited permission to copy and/or distribute it,
3737978d3cdSmrg# with or without modifications, as long as this notice is preserved.
374ea6ae205Smrg
3757978d3cdSmrg# serial 8
376ea6ae205Smrg
3777978d3cdSmrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
3787978d3cdSmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
379ea6ae205Smrg
3807978d3cdSmrg# Do all the work for Automake.                             -*- Autoconf -*-
381ea6ae205Smrg
3827978d3cdSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
3837978d3cdSmrg# 2005, 2006 Free Software Foundation, Inc.
384ea6ae205Smrg#
3857978d3cdSmrg# This file is free software; the Free Software Foundation
3867978d3cdSmrg# gives unlimited permission to copy and/or distribute it,
3877978d3cdSmrg# with or without modifications, as long as this notice is preserved.
388ea6ae205Smrg
3897978d3cdSmrg# serial 12
390ea6ae205Smrg
3917978d3cdSmrg# This macro actually does too much.  Some checks are only needed if
3927978d3cdSmrg# your package does certain things.  But this isn't really a big deal.
393ea6ae205Smrg
3947978d3cdSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
3957978d3cdSmrg# AM_INIT_AUTOMAKE([OPTIONS])
3967978d3cdSmrg# -----------------------------------------------
3977978d3cdSmrg# The call with PACKAGE and VERSION arguments is the old style
3987978d3cdSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
3997978d3cdSmrg# and VERSION should now be passed to AC_INIT and removed from
4007978d3cdSmrg# the call to AM_INIT_AUTOMAKE.
4017978d3cdSmrg# We support both call styles for the transition.  After
4027978d3cdSmrg# the next Automake release, Autoconf can make the AC_INIT
4037978d3cdSmrg# arguments mandatory, and then we can depend on a new Autoconf
4047978d3cdSmrg# release and drop the old call support.
4057978d3cdSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
4067978d3cdSmrg[AC_PREREQ([2.60])dnl
4077978d3cdSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
4087978d3cdSmrgdnl the ones we care about.
4097978d3cdSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
4107978d3cdSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
4117978d3cdSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
4127978d3cdSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
4137978d3cdSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
4147978d3cdSmrg  # is not polluted with repeated "-I."
4157978d3cdSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
4167978d3cdSmrg  # test to see if srcdir already configured
4177978d3cdSmrg  if test -f $srcdir/config.status; then
4187978d3cdSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
4197978d3cdSmrg  fi
420ea6ae205Smrgfi
421ea6ae205Smrg
4227978d3cdSmrg# test whether we have cygpath
4237978d3cdSmrgif test -z "$CYGPATH_W"; then
4247978d3cdSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
4257978d3cdSmrg    CYGPATH_W='cygpath -w'
4267978d3cdSmrg  else
4277978d3cdSmrg    CYGPATH_W=echo
4287978d3cdSmrg  fi
429ea6ae205Smrgfi
4307978d3cdSmrgAC_SUBST([CYGPATH_W])
431ea6ae205Smrg
4327978d3cdSmrg# Define the identity of the package.
4337978d3cdSmrgdnl Distinguish between old-style and new-style calls.
4347978d3cdSmrgm4_ifval([$2],
4357978d3cdSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
4367978d3cdSmrg AC_SUBST([PACKAGE], [$1])dnl
4377978d3cdSmrg AC_SUBST([VERSION], [$2])],
4387978d3cdSmrg[_AM_SET_OPTIONS([$1])dnl
4397978d3cdSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
4407978d3cdSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
4417978d3cdSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
4427978d3cdSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
4437978d3cdSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
444ea6ae205Smrg
4457978d3cdSmrg_AM_IF_OPTION([no-define],,
4467978d3cdSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
4477978d3cdSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
448ea6ae205Smrg
4497978d3cdSmrg# Some tools Automake needs.
4507978d3cdSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
4517978d3cdSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
4527978d3cdSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
4537978d3cdSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
4547978d3cdSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
4557978d3cdSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
4567978d3cdSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
4577978d3cdSmrgAM_PROG_INSTALL_SH
4587978d3cdSmrgAM_PROG_INSTALL_STRIP
4597978d3cdSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
4607978d3cdSmrg# We need awk for the "check" target.  The system "awk" is bad on
4617978d3cdSmrg# some platforms.
4627978d3cdSmrgAC_REQUIRE([AC_PROG_AWK])dnl
4637978d3cdSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
4647978d3cdSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
4657978d3cdSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
4667978d3cdSmrg              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
4677978d3cdSmrg	      		     [_AM_PROG_TAR([v7])])])
4687978d3cdSmrg_AM_IF_OPTION([no-dependencies],,
4697978d3cdSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
4707978d3cdSmrg                  [_AM_DEPENDENCIES(CC)],
4717978d3cdSmrg                  [define([AC_PROG_CC],
4727978d3cdSmrg                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
4737978d3cdSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
4747978d3cdSmrg                  [_AM_DEPENDENCIES(CXX)],
4757978d3cdSmrg                  [define([AC_PROG_CXX],
4767978d3cdSmrg                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
4777978d3cdSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
4787978d3cdSmrg                  [_AM_DEPENDENCIES(OBJC)],
4797978d3cdSmrg                  [define([AC_PROG_OBJC],
4807978d3cdSmrg                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
4817978d3cdSmrg])
4827978d3cdSmrg])
4837978d3cdSmrg
4847978d3cdSmrg
4857978d3cdSmrg# When config.status generates a header, we must update the stamp-h file.
4867978d3cdSmrg# This file resides in the same directory as the config header
4877978d3cdSmrg# that is generated.  The stamp files are numbered to have different names.
4887978d3cdSmrg
4897978d3cdSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
4907978d3cdSmrg# loop where config.status creates the headers, so we can generate
4917978d3cdSmrg# our stamp files there.
4927978d3cdSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
4937978d3cdSmrg[# Compute $1's index in $config_headers.
4947978d3cdSmrg_am_stamp_count=1
4957978d3cdSmrgfor _am_header in $config_headers :; do
4967978d3cdSmrg  case $_am_header in
4977978d3cdSmrg    $1 | $1:* )
4987978d3cdSmrg      break ;;
4997978d3cdSmrg    * )
5007978d3cdSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
5017978d3cdSmrg  esac
5027978d3cdSmrgdone
5037978d3cdSmrgecho "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
5047978d3cdSmrg
5057978d3cdSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
5067978d3cdSmrg#
5077978d3cdSmrg# This file is free software; the Free Software Foundation
5087978d3cdSmrg# gives unlimited permission to copy and/or distribute it,
5097978d3cdSmrg# with or without modifications, as long as this notice is preserved.
510ea6ae205Smrg
5117978d3cdSmrg# AM_PROG_INSTALL_SH
5127978d3cdSmrg# ------------------
5137978d3cdSmrg# Define $install_sh.
5147978d3cdSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
5157978d3cdSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
5167978d3cdSmrginstall_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
5177978d3cdSmrgAC_SUBST(install_sh)])
518ea6ae205Smrg
5197978d3cdSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
520ea6ae205Smrg#
5217978d3cdSmrg# This file is free software; the Free Software Foundation
5227978d3cdSmrg# gives unlimited permission to copy and/or distribute it,
5237978d3cdSmrg# with or without modifications, as long as this notice is preserved.
524ea6ae205Smrg
5257978d3cdSmrg# serial 2
526ea6ae205Smrg
5277978d3cdSmrg# Check whether the underlying file-system supports filenames
5287978d3cdSmrg# with a leading dot.  For instance MS-DOS doesn't.
5297978d3cdSmrgAC_DEFUN([AM_SET_LEADING_DOT],
5307978d3cdSmrg[rm -rf .tst 2>/dev/null
5317978d3cdSmrgmkdir .tst 2>/dev/null
5327978d3cdSmrgif test -d .tst; then
5337978d3cdSmrg  am__leading_dot=.
534ea6ae205Smrgelse
5357978d3cdSmrg  am__leading_dot=_
536ea6ae205Smrgfi
5377978d3cdSmrgrmdir .tst 2>/dev/null
5387978d3cdSmrgAC_SUBST([am__leading_dot])])
539ea6ae205Smrg
5407978d3cdSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
5417978d3cdSmrg# From Jim Meyering
542ea6ae205Smrg
5437978d3cdSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
5447978d3cdSmrg# Free Software Foundation, Inc.
545ea6ae205Smrg#
5467978d3cdSmrg# This file is free software; the Free Software Foundation
5477978d3cdSmrg# gives unlimited permission to copy and/or distribute it,
5487978d3cdSmrg# with or without modifications, as long as this notice is preserved.
549ea6ae205Smrg
5507978d3cdSmrg# serial 4
551ea6ae205Smrg
5527978d3cdSmrgAC_DEFUN([AM_MAINTAINER_MODE],
5537978d3cdSmrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
5547978d3cdSmrg  dnl maintainer-mode is disabled by default
5557978d3cdSmrg  AC_ARG_ENABLE(maintainer-mode,
5567978d3cdSmrg[  --enable-maintainer-mode  enable make rules and dependencies not useful
5577978d3cdSmrg			  (and sometimes confusing) to the casual installer],
5587978d3cdSmrg      USE_MAINTAINER_MODE=$enableval,
5597978d3cdSmrg      USE_MAINTAINER_MODE=no)
5607978d3cdSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
5617978d3cdSmrg  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
5627978d3cdSmrg  MAINT=$MAINTAINER_MODE_TRUE
5637978d3cdSmrg  AC_SUBST(MAINT)dnl
5647978d3cdSmrg]
5657978d3cdSmrg)
566ea6ae205Smrg
5677978d3cdSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
568ea6ae205Smrg
5697978d3cdSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
570ea6ae205Smrg
5717978d3cdSmrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
5727978d3cdSmrg#
5737978d3cdSmrg# This file is free software; the Free Software Foundation
5747978d3cdSmrg# gives unlimited permission to copy and/or distribute it,
5757978d3cdSmrg# with or without modifications, as long as this notice is preserved.
576ea6ae205Smrg
5777978d3cdSmrg# serial 3
578ea6ae205Smrg
5797978d3cdSmrg# AM_MAKE_INCLUDE()
5807978d3cdSmrg# -----------------
5817978d3cdSmrg# Check to see how make treats includes.
5827978d3cdSmrgAC_DEFUN([AM_MAKE_INCLUDE],
5837978d3cdSmrg[am_make=${MAKE-make}
5847978d3cdSmrgcat > confinc << 'END'
5857978d3cdSmrgam__doit:
5867978d3cdSmrg	@echo done
5877978d3cdSmrg.PHONY: am__doit
5887978d3cdSmrgEND
5897978d3cdSmrg# If we don't find an include directive, just comment out the code.
5907978d3cdSmrgAC_MSG_CHECKING([for style of include used by $am_make])
5917978d3cdSmrgam__include="#"
5927978d3cdSmrgam__quote=
5937978d3cdSmrg_am_result=none
5947978d3cdSmrg# First try GNU make style include.
5957978d3cdSmrgecho "include confinc" > confmf
5967978d3cdSmrg# We grep out `Entering directory' and `Leaving directory'
5977978d3cdSmrg# messages which can occur if `w' ends up in MAKEFLAGS.
5987978d3cdSmrg# In particular we don't look at `^make:' because GNU make might
5997978d3cdSmrg# be invoked under some other name (usually "gmake"), in which
6007978d3cdSmrg# case it prints its new name instead of `make'.
6017978d3cdSmrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
6027978d3cdSmrg   am__include=include
6037978d3cdSmrg   am__quote=
6047978d3cdSmrg   _am_result=GNU
6057978d3cdSmrgfi
6067978d3cdSmrg# Now try BSD make style include.
6077978d3cdSmrgif test "$am__include" = "#"; then
6087978d3cdSmrg   echo '.include "confinc"' > confmf
6097978d3cdSmrg   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
6107978d3cdSmrg      am__include=.include
6117978d3cdSmrg      am__quote="\""
6127978d3cdSmrg      _am_result=BSD
6137978d3cdSmrg   fi
6147978d3cdSmrgfi
6157978d3cdSmrgAC_SUBST([am__include])
6167978d3cdSmrgAC_SUBST([am__quote])
6177978d3cdSmrgAC_MSG_RESULT([$_am_result])
6187978d3cdSmrgrm -f confinc confmf
619ea6ae205Smrg])
620ea6ae205Smrg
6217978d3cdSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
6227978d3cdSmrg
6237978d3cdSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
6247978d3cdSmrg# Free Software Foundation, Inc.
625ea6ae205Smrg#
626ea6ae205Smrg# This file is free software; the Free Software Foundation
627ea6ae205Smrg# gives unlimited permission to copy and/or distribute it,
628ea6ae205Smrg# with or without modifications, as long as this notice is preserved.
629ea6ae205Smrg
6307978d3cdSmrg# serial 5
631ea6ae205Smrg
6327978d3cdSmrg# AM_MISSING_PROG(NAME, PROGRAM)
6337978d3cdSmrg# ------------------------------
6347978d3cdSmrgAC_DEFUN([AM_MISSING_PROG],
6357978d3cdSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
6367978d3cdSmrg$1=${$1-"${am_missing_run}$2"}
6377978d3cdSmrgAC_SUBST($1)])
638ea6ae205Smrg
639ea6ae205Smrg
6407978d3cdSmrg# AM_MISSING_HAS_RUN
6417978d3cdSmrg# ------------------
6427978d3cdSmrg# Define MISSING if not defined so far and test if it supports --run.
6437978d3cdSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
6447978d3cdSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
6457978d3cdSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
6467978d3cdSmrgAC_REQUIRE_AUX_FILE([missing])dnl
6477978d3cdSmrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
6487978d3cdSmrg# Use eval to expand $SHELL
6497978d3cdSmrgif eval "$MISSING --run true"; then
6507978d3cdSmrg  am_missing_run="$MISSING --run "
6517978d3cdSmrgelse
6527978d3cdSmrg  am_missing_run=
6537978d3cdSmrg  AC_MSG_WARN([`missing' script is too old or missing])
6547978d3cdSmrgfi
6557978d3cdSmrg])
656ea6ae205Smrg
6577978d3cdSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
658ea6ae205Smrg#
659ea6ae205Smrg# This file is free software; the Free Software Foundation
660ea6ae205Smrg# gives unlimited permission to copy and/or distribute it,
661ea6ae205Smrg# with or without modifications, as long as this notice is preserved.
662ea6ae205Smrg
6637978d3cdSmrg# AM_PROG_MKDIR_P
6647978d3cdSmrg# ---------------
6657978d3cdSmrg# Check for `mkdir -p'.
6667978d3cdSmrgAC_DEFUN([AM_PROG_MKDIR_P],
6677978d3cdSmrg[AC_PREREQ([2.60])dnl
6687978d3cdSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
6697978d3cdSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
6707978d3cdSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
6717978d3cdSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
6727978d3cdSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
6737978d3cdSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
6747978d3cdSmrgdnl adjustment using top_builddir (which is defined more often than
6757978d3cdSmrgdnl MKDIR_P).
6767978d3cdSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
6777978d3cdSmrgcase $mkdir_p in
6787978d3cdSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
6797978d3cdSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
6807978d3cdSmrgesac
681ea6ae205Smrg])
682ea6ae205Smrg
6837978d3cdSmrg# Helper functions for option handling.                     -*- Autoconf -*-
684ea6ae205Smrg
6857978d3cdSmrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
686ea6ae205Smrg#
687ea6ae205Smrg# This file is free software; the Free Software Foundation
688ea6ae205Smrg# gives unlimited permission to copy and/or distribute it,
689ea6ae205Smrg# with or without modifications, as long as this notice is preserved.
690ea6ae205Smrg
6917978d3cdSmrg# serial 3
692ea6ae205Smrg
6937978d3cdSmrg# _AM_MANGLE_OPTION(NAME)
6947978d3cdSmrg# -----------------------
6957978d3cdSmrgAC_DEFUN([_AM_MANGLE_OPTION],
6967978d3cdSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
697ea6ae205Smrg
6987978d3cdSmrg# _AM_SET_OPTION(NAME)
6997978d3cdSmrg# ------------------------------
7007978d3cdSmrg# Set option NAME.  Presently that only means defining a flag for this option.
7017978d3cdSmrgAC_DEFUN([_AM_SET_OPTION],
7027978d3cdSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
703ea6ae205Smrg
7047978d3cdSmrg# _AM_SET_OPTIONS(OPTIONS)
7057978d3cdSmrg# ----------------------------------
7067978d3cdSmrg# OPTIONS is a space-separated list of Automake options.
7077978d3cdSmrgAC_DEFUN([_AM_SET_OPTIONS],
7087978d3cdSmrg[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
709ea6ae205Smrg
7107978d3cdSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
7117978d3cdSmrg# -------------------------------------------
7127978d3cdSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
7137978d3cdSmrgAC_DEFUN([_AM_IF_OPTION],
7147978d3cdSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
715ea6ae205Smrg
7167978d3cdSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
717ea6ae205Smrg
7187978d3cdSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
7197978d3cdSmrg# Free Software Foundation, Inc.
720ea6ae205Smrg#
7217978d3cdSmrg# This file is free software; the Free Software Foundation
7227978d3cdSmrg# gives unlimited permission to copy and/or distribute it,
7237978d3cdSmrg# with or without modifications, as long as this notice is preserved.
724ea6ae205Smrg
7257978d3cdSmrg# serial 4
726ea6ae205Smrg
7277978d3cdSmrg# AM_SANITY_CHECK
7287978d3cdSmrg# ---------------
7297978d3cdSmrgAC_DEFUN([AM_SANITY_CHECK],
7307978d3cdSmrg[AC_MSG_CHECKING([whether build environment is sane])
7317978d3cdSmrg# Just in case
7327978d3cdSmrgsleep 1
7337978d3cdSmrgecho timestamp > conftest.file
7347978d3cdSmrg# Do `set' in a subshell so we don't clobber the current shell's
7357978d3cdSmrg# arguments.  Must try -L first in case configure is actually a
7367978d3cdSmrg# symlink; some systems play weird games with the mod time of symlinks
7377978d3cdSmrg# (eg FreeBSD returns the mod time of the symlink's containing
7387978d3cdSmrg# directory).
7397978d3cdSmrgif (
7407978d3cdSmrg   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
7417978d3cdSmrg   if test "$[*]" = "X"; then
7427978d3cdSmrg      # -L didn't work.
7437978d3cdSmrg      set X `ls -t $srcdir/configure conftest.file`
7447978d3cdSmrg   fi
7457978d3cdSmrg   rm -f conftest.file
7467978d3cdSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
7477978d3cdSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
748ea6ae205Smrg
7497978d3cdSmrg      # If neither matched, then we have a broken ls.  This can happen
7507978d3cdSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
7517978d3cdSmrg      # broken ls alias from the environment.  This has actually
7527978d3cdSmrg      # happened.  Such a system could not be considered "sane".
7537978d3cdSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
7547978d3cdSmrgalias in your environment])
7557978d3cdSmrg   fi
756ea6ae205Smrg
7577978d3cdSmrg   test "$[2]" = conftest.file
7587978d3cdSmrg   )
7597978d3cdSmrgthen
7607978d3cdSmrg   # Ok.
7617978d3cdSmrg   :
762ea6ae205Smrgelse
7637978d3cdSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
7647978d3cdSmrgCheck your system clock])
765ea6ae205Smrgfi
7667978d3cdSmrgAC_MSG_RESULT(yes)])
767ea6ae205Smrg
7687978d3cdSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
7697978d3cdSmrg#
7707978d3cdSmrg# This file is free software; the Free Software Foundation
7717978d3cdSmrg# gives unlimited permission to copy and/or distribute it,
7727978d3cdSmrg# with or without modifications, as long as this notice is preserved.
773ea6ae205Smrg
7747978d3cdSmrg# AM_PROG_INSTALL_STRIP
7757978d3cdSmrg# ---------------------
7767978d3cdSmrg# One issue with vendor `install' (even GNU) is that you can't
7777978d3cdSmrg# specify the program used to strip binaries.  This is especially
7787978d3cdSmrg# annoying in cross-compiling environments, where the build's strip
7797978d3cdSmrg# is unlikely to handle the host's binaries.
7807978d3cdSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
7817978d3cdSmrg# always use install-sh in `make install-strip', and initialize
7827978d3cdSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
7837978d3cdSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
7847978d3cdSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
7857978d3cdSmrg# Installed binaries are usually stripped using `strip' when the user
7867978d3cdSmrg# run `make install-strip'.  However `strip' might not be the right
7877978d3cdSmrg# tool to use in cross-compilation environments, therefore Automake
7887978d3cdSmrg# will honor the `STRIP' environment variable to overrule this program.
7897978d3cdSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
7907978d3cdSmrgif test "$cross_compiling" != no; then
7917978d3cdSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
7927978d3cdSmrgfi
7937978d3cdSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
7947978d3cdSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
795ea6ae205Smrg
7967978d3cdSmrg# Copyright (C) 2006  Free Software Foundation, Inc.
7977978d3cdSmrg#
7987978d3cdSmrg# This file is free software; the Free Software Foundation
7997978d3cdSmrg# gives unlimited permission to copy and/or distribute it,
8007978d3cdSmrg# with or without modifications, as long as this notice is preserved.
801ea6ae205Smrg
8027978d3cdSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
8037978d3cdSmrg# ---------------------------
8047978d3cdSmrg# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.
8057978d3cdSmrg# This macro is traced by Automake.
8067978d3cdSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
807ea6ae205Smrg
8087978d3cdSmrg# Check how to create a tarball.                            -*- Autoconf -*-
809ea6ae205Smrg
8107978d3cdSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
811ea6ae205Smrg#
812ea6ae205Smrg# This file is free software; the Free Software Foundation
813ea6ae205Smrg# gives unlimited permission to copy and/or distribute it,
814ea6ae205Smrg# with or without modifications, as long as this notice is preserved.
815ea6ae205Smrg
8167978d3cdSmrg# serial 2
817ea6ae205Smrg
8187978d3cdSmrg# _AM_PROG_TAR(FORMAT)
8197978d3cdSmrg# --------------------
8207978d3cdSmrg# Check how to create a tarball in format FORMAT.
8217978d3cdSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
8227978d3cdSmrg#
8237978d3cdSmrg# Substitute a variable $(am__tar) that is a command
8247978d3cdSmrg# writing to stdout a FORMAT-tarball containing the directory
8257978d3cdSmrg# $tardir.
8267978d3cdSmrg#     tardir=directory && $(am__tar) > result.tar
8277978d3cdSmrg#
8287978d3cdSmrg# Substitute a variable $(am__untar) that extract such
8297978d3cdSmrg# a tarball read from stdin.
8307978d3cdSmrg#     $(am__untar) < result.tar
8317978d3cdSmrgAC_DEFUN([_AM_PROG_TAR],
8327978d3cdSmrg[# Always define AMTAR for backward compatibility.
8337978d3cdSmrgAM_MISSING_PROG([AMTAR], [tar])
8347978d3cdSmrgm4_if([$1], [v7],
8357978d3cdSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
8367978d3cdSmrg     [m4_case([$1], [ustar],, [pax],,
8377978d3cdSmrg              [m4_fatal([Unknown tar format])])
8387978d3cdSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
8397978d3cdSmrg# Loop over all known methods to create a tar archive until one works.
8407978d3cdSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
8417978d3cdSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
8427978d3cdSmrg# Do not fold the above two line into one, because Tru64 sh and
8437978d3cdSmrg# Solaris sh will not grok spaces in the rhs of `-'.
8447978d3cdSmrgfor _am_tool in $_am_tools
8457978d3cdSmrgdo
8467978d3cdSmrg  case $_am_tool in
8477978d3cdSmrg  gnutar)
8487978d3cdSmrg    for _am_tar in tar gnutar gtar;
8497978d3cdSmrg    do
8507978d3cdSmrg      AM_RUN_LOG([$_am_tar --version]) && break
8517978d3cdSmrg    done
8527978d3cdSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
8537978d3cdSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
8547978d3cdSmrg    am__untar="$_am_tar -xf -"
8557978d3cdSmrg    ;;
8567978d3cdSmrg  plaintar)
8577978d3cdSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
8587978d3cdSmrg    # ustar tarball either.
8597978d3cdSmrg    (tar --version) >/dev/null 2>&1 && continue
8607978d3cdSmrg    am__tar='tar chf - "$$tardir"'
8617978d3cdSmrg    am__tar_='tar chf - "$tardir"'
8627978d3cdSmrg    am__untar='tar xf -'
8637978d3cdSmrg    ;;
8647978d3cdSmrg  pax)
8657978d3cdSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
8667978d3cdSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
8677978d3cdSmrg    am__untar='pax -r'
8687978d3cdSmrg    ;;
8697978d3cdSmrg  cpio)
8707978d3cdSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
8717978d3cdSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
8727978d3cdSmrg    am__untar='cpio -i -H $1 -d'
8737978d3cdSmrg    ;;
8747978d3cdSmrg  none)
8757978d3cdSmrg    am__tar=false
8767978d3cdSmrg    am__tar_=false
8777978d3cdSmrg    am__untar=false
8787978d3cdSmrg    ;;
8797978d3cdSmrg  esac
8807978d3cdSmrg
8817978d3cdSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
8827978d3cdSmrg  # and am__untar set.
8837978d3cdSmrg  test -n "${am_cv_prog_tar_$1}" && break
8847978d3cdSmrg
8857978d3cdSmrg  # tar/untar a dummy directory, and stop if the command works
8867978d3cdSmrg  rm -rf conftest.dir
8877978d3cdSmrg  mkdir conftest.dir
8887978d3cdSmrg  echo GrepMe > conftest.dir/file
8897978d3cdSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
8907978d3cdSmrg  rm -rf conftest.dir
8917978d3cdSmrg  if test -s conftest.tar; then
8927978d3cdSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
8937978d3cdSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
8947978d3cdSmrg  fi
895ea6ae205Smrgdone
8967978d3cdSmrgrm -rf conftest.dir
897ea6ae205Smrg
8987978d3cdSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
8997978d3cdSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
9007978d3cdSmrgAC_SUBST([am__tar])
9017978d3cdSmrgAC_SUBST([am__untar])
9027978d3cdSmrg]) # _AM_PROG_TAR
903ea6ae205Smrg
9047978d3cdSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
9057978d3cdSmrgdnl
9067978d3cdSmrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
9077978d3cdSmrgdnl 
9087978d3cdSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
9097978d3cdSmrgdnl copy of this software and associated documentation files (the
9107978d3cdSmrgdnl "Software"), to deal in the Software without restriction, including
9117978d3cdSmrgdnl without limitation the rights to use, copy, modify, merge, publish,
9127978d3cdSmrgdnl distribute, and/or sell copies of the Software, and to permit persons
9137978d3cdSmrgdnl to whom the Software is furnished to do so, provided that the above
9147978d3cdSmrgdnl copyright notice(s) and this permission notice appear in all copies of
9157978d3cdSmrgdnl the Software and that both the above copyright notice(s) and this
9167978d3cdSmrgdnl permission notice appear in supporting documentation.
9177978d3cdSmrgdnl
9187978d3cdSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
9197978d3cdSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
9207978d3cdSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
9217978d3cdSmrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
9227978d3cdSmrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
9237978d3cdSmrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
9247978d3cdSmrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
9257978d3cdSmrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
9267978d3cdSmrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
9277978d3cdSmrgdnl
9287978d3cdSmrgdnl Except as contained in this notice, the name of a copyright holder
9297978d3cdSmrgdnl shall not be used in advertising or otherwise to promote the sale, use
9307978d3cdSmrgdnl or other dealings in this Software without prior written authorization
9317978d3cdSmrgdnl of the copyright holder.
932ea6ae205Smrg
9337978d3cdSmrg# XORG_MACROS_VERSION(required-version)
9347978d3cdSmrg# -------------------------------------
9357978d3cdSmrg# Minimum version: 1.1.0
936ea6ae205Smrg#
9377978d3cdSmrg# If you're using a macro added in Version 1.1 or newer, include this in
9387978d3cdSmrg# your configure.ac with the minimum required version, such as:
9397978d3cdSmrg# XORG_MACROS_VERSION(1.1)
9407978d3cdSmrg#
9417978d3cdSmrg# To force at least a version with this macro defined, also add:
9427978d3cdSmrg# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
9437978d3cdSmrg#
9447978d3cdSmrg#
9457978d3cdSmrg# See the "minimum version" comment for each macro you use to see what 
9467978d3cdSmrg# version you require.
9477978d3cdSmrgAC_DEFUN([XORG_MACROS_VERSION],[
9487978d3cdSmrg	[XORG_MACROS_needed_version=$1
9497978d3cdSmrg	XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
9507978d3cdSmrg	XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
9517978d3cdSmrg	AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
9527978d3cdSmrg	[XORG_MACROS_version=1.2.1
9537978d3cdSmrg	XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
9547978d3cdSmrg	XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
9557978d3cdSmrg	if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
9567978d3cdSmrg		AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x])
9577978d3cdSmrg	fi
9587978d3cdSmrg	if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
9597978d3cdSmrg		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])
9607978d3cdSmrg	fi
9617978d3cdSmrg	AC_MSG_RESULT([yes, $XORG_MACROS_version])
9627978d3cdSmrg]) # XORG_MACROS_VERSION
963ea6ae205Smrg
9647978d3cdSmrg# XORG_PROG_RAWCPP()
9657978d3cdSmrg# ------------------
9667978d3cdSmrg# Minimum version: 1.0.0
9677978d3cdSmrg#
9687978d3cdSmrg# Find cpp program and necessary flags for use in pre-processing text files
9697978d3cdSmrg# such as man pages and config files
9707978d3cdSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
9717978d3cdSmrgAC_REQUIRE([AC_PROG_CPP])
9727978d3cdSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
9737978d3cdSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
974ea6ae205Smrg
9757978d3cdSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
9767978d3cdSmrg# which is not the best choice for supporting other OS'es, but covers most
9777978d3cdSmrg# of the ones we need for now.
9787978d3cdSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
9797978d3cdSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
9807978d3cdSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9817978d3cdSmrg	AC_MSG_RESULT([no])
9827978d3cdSmrgelse
9837978d3cdSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9847978d3cdSmrg		RAWCPPFLAGS=-undef
9857978d3cdSmrg		AC_MSG_RESULT([yes])
9867978d3cdSmrg	# under Cygwin unix is still defined even with -undef
9877978d3cdSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9887978d3cdSmrg		RAWCPPFLAGS="-undef -ansi"
9897978d3cdSmrg		AC_MSG_RESULT([yes, with -ansi])
9907978d3cdSmrg	else
9917978d3cdSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
9927978d3cdSmrg	fi
9937978d3cdSmrgfi
9947978d3cdSmrgrm -f conftest.$ac_ext
995ea6ae205Smrg
9967978d3cdSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
9977978d3cdSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
9987978d3cdSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9997978d3cdSmrg	AC_MSG_RESULT([no])
10007978d3cdSmrgelse
10017978d3cdSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
10027978d3cdSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
10037978d3cdSmrg		AC_MSG_RESULT([yes])
10047978d3cdSmrg	else
10057978d3cdSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
10067978d3cdSmrg	fi
10077978d3cdSmrgfi
10087978d3cdSmrgrm -f conftest.$ac_ext
10097978d3cdSmrgAC_SUBST(RAWCPPFLAGS)
10107978d3cdSmrg]) # XORG_PROG_RAWCPP
1011ea6ae205Smrg
10127978d3cdSmrg# XORG_MANPAGE_SECTIONS()
10137978d3cdSmrg# -----------------------
10147978d3cdSmrg# Minimum version: 1.0.0
1015ea6ae205Smrg#
10167978d3cdSmrg# Determine which sections man pages go in for the different man page types
10177978d3cdSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
10187978d3cdSmrg# Not sure if there's any better way than just hardcoding by OS name.
10197978d3cdSmrg# Override default settings by setting environment variables
1020ea6ae205Smrg
10217978d3cdSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
10227978d3cdSmrgAC_REQUIRE([AC_CANONICAL_HOST])
1023ea6ae205Smrg
10247978d3cdSmrgif test x$APP_MAN_SUFFIX = x    ; then
10257978d3cdSmrg    APP_MAN_SUFFIX=1
10267978d3cdSmrgfi
10277978d3cdSmrgif test x$APP_MAN_DIR = x    ; then
10287978d3cdSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1029ea6ae205Smrgfi
1030ea6ae205Smrg
10317978d3cdSmrgif test x$LIB_MAN_SUFFIX = x    ; then
10327978d3cdSmrg    LIB_MAN_SUFFIX=3
10337978d3cdSmrgfi
10347978d3cdSmrgif test x$LIB_MAN_DIR = x    ; then
10357978d3cdSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1036ea6ae205Smrgfi
1037ea6ae205Smrg
10387978d3cdSmrgif test x$FILE_MAN_SUFFIX = x    ; then
10397978d3cdSmrg    case $host_os in
10407978d3cdSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
10417978d3cdSmrg	*)		FILE_MAN_SUFFIX=5  ;;
10427978d3cdSmrg    esac
10437978d3cdSmrgfi
10447978d3cdSmrgif test x$FILE_MAN_DIR = x    ; then
10457978d3cdSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
10467978d3cdSmrgfi
1047ea6ae205Smrg
10487978d3cdSmrgif test x$MISC_MAN_SUFFIX = x    ; then
10497978d3cdSmrg    case $host_os in
10507978d3cdSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
10517978d3cdSmrg	*)		MISC_MAN_SUFFIX=7  ;;
10527978d3cdSmrg    esac
10537978d3cdSmrgfi
10547978d3cdSmrgif test x$MISC_MAN_DIR = x    ; then
10557978d3cdSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
10567978d3cdSmrgfi
1057ea6ae205Smrg
10587978d3cdSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
10597978d3cdSmrg    case $host_os in
10607978d3cdSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
10617978d3cdSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
10627978d3cdSmrg    esac
10637978d3cdSmrgfi
10647978d3cdSmrgif test x$DRIVER_MAN_DIR = x    ; then
10657978d3cdSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
10667978d3cdSmrgfi
1067ea6ae205Smrg
10687978d3cdSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
10697978d3cdSmrg    case $host_os in
10707978d3cdSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
10717978d3cdSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
10727978d3cdSmrg    esac
10737978d3cdSmrgfi
10747978d3cdSmrgif test x$ADMIN_MAN_DIR = x    ; then
10757978d3cdSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
10767978d3cdSmrgfi
1077ea6ae205Smrg
1078ea6ae205Smrg
10797978d3cdSmrgAC_SUBST([APP_MAN_SUFFIX])
10807978d3cdSmrgAC_SUBST([LIB_MAN_SUFFIX])
10817978d3cdSmrgAC_SUBST([FILE_MAN_SUFFIX])
10827978d3cdSmrgAC_SUBST([MISC_MAN_SUFFIX])
10837978d3cdSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
10847978d3cdSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
10857978d3cdSmrgAC_SUBST([APP_MAN_DIR])
10867978d3cdSmrgAC_SUBST([LIB_MAN_DIR])
10877978d3cdSmrgAC_SUBST([FILE_MAN_DIR])
10887978d3cdSmrgAC_SUBST([MISC_MAN_DIR])
10897978d3cdSmrgAC_SUBST([DRIVER_MAN_DIR])
10907978d3cdSmrgAC_SUBST([ADMIN_MAN_DIR])
10917978d3cdSmrg]) # XORG_MANPAGE_SECTIONS
1092ea6ae205Smrg
10937978d3cdSmrg# XORG_CHECK_LINUXDOC
10947978d3cdSmrg# -------------------
10957978d3cdSmrg# Minimum version: 1.0.0
1096ea6ae205Smrg#
10977978d3cdSmrg# Defines the variable MAKE_TEXT if the necessary tools and
10987978d3cdSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
10997978d3cdSmrg# Whether or not the necessary tools and files are found can be checked
11007978d3cdSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
11017978d3cdSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
11027978d3cdSmrgif test x$XORG_SGML_PATH = x ; then
11037978d3cdSmrg    XORG_SGML_PATH=$prefix/share/sgml
11047978d3cdSmrgfi
11057978d3cdSmrgHAVE_DEFS_ENT=
1106ea6ae205Smrg
11077978d3cdSmrgif test x"$cross_compiling" = x"yes" ; then
11087978d3cdSmrg  HAVE_DEFS_ENT=no
11097978d3cdSmrgelse
11107978d3cdSmrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
11117978d3cdSmrgfi
1112ea6ae205Smrg
11137978d3cdSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
11147978d3cdSmrgAC_PATH_PROG(PS2PDF, ps2pdf)
1115ea6ae205Smrg
11167978d3cdSmrgAC_MSG_CHECKING([Whether to build documentation])
1117ea6ae205Smrg
11187978d3cdSmrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
11197978d3cdSmrg   BUILDDOC=yes
1120ea6ae205Smrgelse
11217978d3cdSmrg   BUILDDOC=no
1122ea6ae205Smrgfi
1123ea6ae205Smrg
11247978d3cdSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1125ea6ae205Smrg
11267978d3cdSmrgAC_MSG_RESULT([$BUILDDOC])
1127ea6ae205Smrg
11287978d3cdSmrgAC_MSG_CHECKING([Whether to build pdf documentation])
1129ea6ae205Smrg
11307978d3cdSmrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
11317978d3cdSmrg   BUILDPDFDOC=yes
11327978d3cdSmrgelse
11337978d3cdSmrg   BUILDPDFDOC=no
11347978d3cdSmrgfi
1135ea6ae205Smrg
11367978d3cdSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1137ea6ae205Smrg
11387978d3cdSmrgAC_MSG_RESULT([$BUILDPDFDOC])
1139ea6ae205Smrg
11407978d3cdSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
11417978d3cdSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
11427978d3cdSmrgMAKE_PDF="$PS2PDF"
11437978d3cdSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1144ea6ae205Smrg
11457978d3cdSmrgAC_SUBST(MAKE_TEXT)
11467978d3cdSmrgAC_SUBST(MAKE_PS)
11477978d3cdSmrgAC_SUBST(MAKE_PDF)
11487978d3cdSmrgAC_SUBST(MAKE_HTML)
11497978d3cdSmrg]) # XORG_CHECK_LINUXDOC
1150ea6ae205Smrg
11517978d3cdSmrg# XORG_CHECK_DOCBOOK
11527978d3cdSmrg# -------------------
11537978d3cdSmrg# Minimum version: 1.0.0
11547978d3cdSmrg#
11557978d3cdSmrg# Checks for the ability to build output formats from SGML DocBook source.
11567978d3cdSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
11577978d3cdSmrg# indicates whether the necessary tools and files are found and, if set,
11587978d3cdSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
11597978d3cdSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
11607978d3cdSmrgif test x$XORG_SGML_PATH = x ; then
11617978d3cdSmrg    XORG_SGML_PATH=$prefix/share/sgml
1162ea6ae205Smrgfi
11637978d3cdSmrgHAVE_DEFS_ENT=
11647978d3cdSmrgBUILDTXTDOC=no
11657978d3cdSmrgBUILDPDFDOC=no
11667978d3cdSmrgBUILDPSDOC=no
11677978d3cdSmrgBUILDHTMLDOC=no
1168ea6ae205Smrg
11697978d3cdSmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1170ea6ae205Smrg
11717978d3cdSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
11727978d3cdSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
11737978d3cdSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
11747978d3cdSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1175ea6ae205Smrg
11767978d3cdSmrgAC_MSG_CHECKING([Whether to build text documentation])
11777978d3cdSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
11787978d3cdSmrg   test x$BUILD_TXTDOC != xno; then
11797978d3cdSmrg	BUILDTXTDOC=yes
11807978d3cdSmrgfi
11817978d3cdSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
11827978d3cdSmrgAC_MSG_RESULT([$BUILDTXTDOC])
1183ea6ae205Smrg
11847978d3cdSmrgAC_MSG_CHECKING([Whether to build PDF documentation])
11857978d3cdSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
11867978d3cdSmrg   test x$BUILD_PDFDOC != xno; then
11877978d3cdSmrg	BUILDPDFDOC=yes
11887978d3cdSmrgfi
11897978d3cdSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
11907978d3cdSmrgAC_MSG_RESULT([$BUILDPDFDOC])
1191ea6ae205Smrg
11927978d3cdSmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
11937978d3cdSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
11947978d3cdSmrg   test x$BUILD_PSDOC != xno; then
11957978d3cdSmrg	BUILDPSDOC=yes
11967978d3cdSmrgfi
11977978d3cdSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
11987978d3cdSmrgAC_MSG_RESULT([$BUILDPSDOC])
1199ea6ae205Smrg
12007978d3cdSmrgAC_MSG_CHECKING([Whether to build HTML documentation])
12017978d3cdSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
12027978d3cdSmrg   test x$BUILD_HTMLDOC != xno; then
12037978d3cdSmrg	BUILDHTMLDOC=yes
1204ea6ae205Smrgfi
12057978d3cdSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
12067978d3cdSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
1207ea6ae205Smrg
12087978d3cdSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
12097978d3cdSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
12107978d3cdSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
12117978d3cdSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1212ea6ae205Smrg
12137978d3cdSmrgAC_SUBST(MAKE_TEXT)
12147978d3cdSmrgAC_SUBST(MAKE_PS)
12157978d3cdSmrgAC_SUBST(MAKE_PDF)
12167978d3cdSmrgAC_SUBST(MAKE_HTML)
12177978d3cdSmrg]) # XORG_CHECK_DOCBOOK
1218ea6ae205Smrg
12197978d3cdSmrg# XORG_CHECK_MALLOC_ZERO
12207978d3cdSmrg# ----------------------
12217978d3cdSmrg# Minimum version: 1.0.0
1222ea6ae205Smrg#
12237978d3cdSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
12247978d3cdSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
12257978d3cdSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
12267978d3cdSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
12277978d3cdSmrgAC_ARG_ENABLE(malloc0returnsnull,
12287978d3cdSmrg	AC_HELP_STRING([--enable-malloc0returnsnull],
12297978d3cdSmrg		       [malloc(0) returns NULL (default: auto)]),
12307978d3cdSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
12317978d3cdSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1232ea6ae205Smrg
12337978d3cdSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
12347978d3cdSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
12357978d3cdSmrg	AC_RUN_IFELSE([
12367978d3cdSmrgchar *malloc();
12377978d3cdSmrgchar *realloc();
12387978d3cdSmrgchar *calloc();
12397978d3cdSmrgmain() {
12407978d3cdSmrg    char *m0, *r0, *c0, *p;
12417978d3cdSmrg    m0 = malloc(0);
12427978d3cdSmrg    p = malloc(10);
12437978d3cdSmrg    r0 = realloc(p,0);
12447978d3cdSmrg    c0 = calloc(0);
12457978d3cdSmrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
12467978d3cdSmrg}],
12477978d3cdSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
12487978d3cdSmrg		[MALLOC_ZERO_RETURNS_NULL=no])
12497978d3cdSmrgfi
12507978d3cdSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1251ea6ae205Smrg
12527978d3cdSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
12537978d3cdSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
12547978d3cdSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
12557978d3cdSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
12567978d3cdSmrgelse
12577978d3cdSmrg	MALLOC_ZERO_CFLAGS=""
12587978d3cdSmrg	XMALLOC_ZERO_CFLAGS=""
12597978d3cdSmrg	XTMALLOC_ZERO_CFLAGS=""
12607978d3cdSmrgfi
1261ea6ae205Smrg
12627978d3cdSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
12637978d3cdSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
12647978d3cdSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
12657978d3cdSmrg]) # XORG_CHECK_MALLOC_ZERO
1266ea6ae205Smrg
12677978d3cdSmrg# XORG_WITH_LINT()
12687978d3cdSmrg# ----------------
12697978d3cdSmrg# Minimum version: 1.1.0
12707978d3cdSmrg#
12717978d3cdSmrg# Sets up flags for source checkers such as lint and sparse if --with-lint
12727978d3cdSmrg# is specified.   (Use --with-lint=sparse for sparse.)
12737978d3cdSmrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
12747978d3cdSmrg# Sets $LINT_FLAGS to flags to pass to source checker
12757978d3cdSmrg# Sets LINT automake conditional if enabled (default: disabled)
12767978d3cdSmrg#
12777978d3cdSmrgAC_DEFUN([XORG_WITH_LINT],[
1278ea6ae205Smrg
12797978d3cdSmrg# Allow checking code with lint, sparse, etc.
12807978d3cdSmrgAC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
12817978d3cdSmrg		[Use a lint-style source code checker (default: disabled)])],
12827978d3cdSmrg		[use_lint=$withval], [use_lint=no])
12837978d3cdSmrgif test "x$use_lint" = "xyes" ; then
12847978d3cdSmrg	LINT="lint"
12857978d3cdSmrgelse
12867978d3cdSmrg	LINT="$use_lint"
12877978d3cdSmrgfi
12887978d3cdSmrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
12897978d3cdSmrg    case $LINT in
12907978d3cdSmrg	lint|*/lint)
12917978d3cdSmrg	    case $host_os in
12927978d3cdSmrg		solaris*)
12937978d3cdSmrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
12947978d3cdSmrg			;;
12957978d3cdSmrg	    esac
12967978d3cdSmrg	    ;;
12977978d3cdSmrg    esac
12987978d3cdSmrgfi
1299ea6ae205Smrg
13007978d3cdSmrgAC_SUBST(LINT)
13017978d3cdSmrgAC_SUBST(LINT_FLAGS)
13027978d3cdSmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
1303ea6ae205Smrg
13047978d3cdSmrg]) # XORG_WITH_LINT
13057978d3cdSmrg
13067978d3cdSmrg# XORG_LINT_LIBRARY(LIBNAME)
13077978d3cdSmrg# --------------------------
13087978d3cdSmrg# Minimum version: 1.1.0
13097978d3cdSmrg#
13107978d3cdSmrg# Sets up flags for building lint libraries for checking programs that call
13117978d3cdSmrg# functions in the library.
13127978d3cdSmrg# Disabled by default, enable with --enable-lint-library
13137978d3cdSmrg# Sets: 
13147978d3cdSmrg#	@LINTLIB@		- name of lint library file to make
13157978d3cdSmrg#	MAKE_LINT_LIB		- automake conditional
1316ea6ae205Smrg#
1317ea6ae205Smrg
13187978d3cdSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
13197978d3cdSmrgAC_REQUIRE([XORG_WITH_LINT])
13207978d3cdSmrg# Build lint "library" for more indepth checks of programs calling this library
13217978d3cdSmrgAC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
13227978d3cdSmrg	[Create lint library (default: disabled)])],
13237978d3cdSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
13247978d3cdSmrgif test "x$make_lint_lib" != "xno" ; then
13257978d3cdSmrg	if test "x$LINT" = "xno" ; then
13267978d3cdSmrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
13277978d3cdSmrg	fi
13287978d3cdSmrg	if test "x$make_lint_lib" = "xyes" ; then
13297978d3cdSmrg		LINTLIB=llib-l$1.ln
13307978d3cdSmrg	else
13317978d3cdSmrg		LINTLIB=$make_lint_lib
13327978d3cdSmrg	fi
13337978d3cdSmrgfi
13347978d3cdSmrgAC_SUBST(LINTLIB)
13357978d3cdSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1336ea6ae205Smrg
13377978d3cdSmrg]) # XORG_LINT_LIBRARY
13387978d3cdSmrg
13397978d3cdSmrg# XORG_CWARNFLAGS
1340ea6ae205Smrg# ---------------
13417978d3cdSmrg# Minimum version: 1.2.0
13427978d3cdSmrg#
13437978d3cdSmrg# Defines CWARNFLAGS to enable C compiler warnings.
13447978d3cdSmrg#
13457978d3cdSmrgAC_DEFUN([XORG_CWARNFLAGS], [
13467978d3cdSmrgAC_REQUIRE([AC_PROG_CC])
13477978d3cdSmrgif  test "x$GCC" = xyes ; then
13487978d3cdSmrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
13497978d3cdSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
13507978d3cdSmrg-Wbad-function-cast"
13517978d3cdSmrg    case `gcc -dumpversion` in
13527978d3cdSmrg    3.4.* | 4.*)
13537978d3cdSmrg	CWARNFLAGS+=" -Wold-style-definition -Wdeclaration-after-statement"
13547978d3cdSmrg	;;
13557978d3cdSmrg    esac
13567978d3cdSmrgelse
13577978d3cdSmrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
13587978d3cdSmrg    if test "x$SUNCC" = "xyes"; then
13597978d3cdSmrg	CWARNFLAGS="-v"
13607978d3cdSmrg    fi
13617978d3cdSmrgfi
13627978d3cdSmrgAC_SUBST(CWARNFLAGS)
13637978d3cdSmrg]) # XORG_CWARNFLAGS
13647978d3cdSmrgdnl Copyright 2005 Red Hat, Inc
13657978d3cdSmrgdnl
13667978d3cdSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
13677978d3cdSmrgdnl documentation for any purpose is hereby granted without fee, provided that
13687978d3cdSmrgdnl the above copyright notice appear in all copies and that both that
13697978d3cdSmrgdnl copyright notice and this permission notice appear in supporting
13707978d3cdSmrgdnl documentation.
13717978d3cdSmrgdnl
13727978d3cdSmrgdnl The above copyright notice and this permission notice shall be included
13737978d3cdSmrgdnl in all copies or substantial portions of the Software.
13747978d3cdSmrgdnl
13757978d3cdSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
13767978d3cdSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
13777978d3cdSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
13787978d3cdSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
13797978d3cdSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
13807978d3cdSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
13817978d3cdSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
13827978d3cdSmrgdnl
13837978d3cdSmrgdnl Except as contained in this notice, the name of the copyright holders shall
13847978d3cdSmrgdnl not be used in advertising or otherwise to promote the sale, use or
13857978d3cdSmrgdnl other dealings in this Software without prior written authorization
13867978d3cdSmrgdnl from the copyright holders.
13877978d3cdSmrgdnl
1388ea6ae205Smrg
13897978d3cdSmrg# XORG_RELEASE_VERSION
13907978d3cdSmrg# --------------------
13917978d3cdSmrg# Adds --with/without-release-string and changes the PACKAGE and
13927978d3cdSmrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
13937978d3cdSmrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
13947978d3cdSmrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
13957978d3cdSmrg 
13967978d3cdSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
13977978d3cdSmrg	AC_ARG_WITH(release-version,
13987978d3cdSmrg			AC_HELP_STRING([--with-release-version=STRING],
13997978d3cdSmrg				[Use release version string in package name]),
14007978d3cdSmrg			[RELEASE_VERSION="$withval"],
14017978d3cdSmrg			[RELEASE_VERSION=""])
14027978d3cdSmrg	if test "x$RELEASE_VERSION" != "x"; then
14037978d3cdSmrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
14047978d3cdSmrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
14057978d3cdSmrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
14067978d3cdSmrg	fi
14077978d3cdSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
14087978d3cdSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
14097978d3cdSmrg		[Major version of this package])
14107978d3cdSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
14117978d3cdSmrg	if test "x$PVM" = "x"; then
14127978d3cdSmrg		PVM="0"
14137978d3cdSmrg	fi
14147978d3cdSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
14157978d3cdSmrg		[$PVM],
14167978d3cdSmrg		[Minor version of this package])
14177978d3cdSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
14187978d3cdSmrg	if test "x$PVP" = "x"; then
14197978d3cdSmrg		PVP="0"
14207978d3cdSmrg	fi
14217978d3cdSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
14227978d3cdSmrg		[$PVP],
14237978d3cdSmrg		[Patch version of this package])
14247978d3cdSmrg])
1425ea6ae205Smrg
14267978d3cdSmrg# XORG_CHANGELOG()
14277978d3cdSmrg# ----------------
14287978d3cdSmrg# Minimum version: 1.2.0
14297978d3cdSmrg#
14307978d3cdSmrg# Defines the variable CHANGELOG_CMD as the command to generate
14317978d3cdSmrg# ChangeLog from git.
14327978d3cdSmrg#
14337978d3cdSmrg# Arrange that distcleancheck ignores ChangeLog left over by distclean.
14347978d3cdSmrg#
14357978d3cdSmrgAC_DEFUN([XORG_CHANGELOG], [
14367978d3cdSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
14377978d3cdSmrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
14387978d3cdSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
14397978d3cdSmrgAC_SUBST([CHANGELOG_CMD])
14407978d3cdSmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
14417978d3cdSmrg]) # XORG_CHANGELOG
1442ea6ae205Smrg
14437978d3cdSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
14447978d3cdSmrg# 
14457978d3cdSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1446ea6ae205Smrg#
14477978d3cdSmrg# This program is free software; you can redistribute it and/or modify
14487978d3cdSmrg# it under the terms of the GNU General Public License as published by
14497978d3cdSmrg# the Free Software Foundation; either version 2 of the License, or
14507978d3cdSmrg# (at your option) any later version.
14517978d3cdSmrg#
14527978d3cdSmrg# This program is distributed in the hope that it will be useful, but
14537978d3cdSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
14547978d3cdSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14557978d3cdSmrg# General Public License for more details.
14567978d3cdSmrg#
14577978d3cdSmrg# You should have received a copy of the GNU General Public License
14587978d3cdSmrg# along with this program; if not, write to the Free Software
14597978d3cdSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
14607978d3cdSmrg#
14617978d3cdSmrg# As a special exception to the GNU General Public License, if you
14627978d3cdSmrg# distribute this file as part of a program that contains a
14637978d3cdSmrg# configuration script generated by Autoconf, you may include it under
14647978d3cdSmrg# the same distribution terms that you use for the rest of that program.
1465ea6ae205Smrg
14667978d3cdSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
14677978d3cdSmrg# ----------------------------------
14687978d3cdSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
14697978d3cdSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
14707978d3cdSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
14717978d3cdSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
14727978d3cdSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
14737978d3cdSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1474ea6ae205Smrgfi
14757978d3cdSmrgif test -n "$PKG_CONFIG"; then
14767978d3cdSmrg	_pkg_min_version=m4_ifval([$1], [$1], [0.9.0])
14777978d3cdSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
14787978d3cdSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
14797978d3cdSmrg		AC_MSG_RESULT([yes])
14807978d3cdSmrg	else
14817978d3cdSmrg		AC_MSG_RESULT([no])
14827978d3cdSmrg		PKG_CONFIG=""
14837978d3cdSmrg	fi
14847978d3cdSmrg		
14857978d3cdSmrgfi[]dnl
14867978d3cdSmrg])# PKG_PROG_PKG_CONFIG
1487ea6ae205Smrg
14887978d3cdSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1489ea6ae205Smrg#
14907978d3cdSmrg# Check to see whether a particular set of modules exists.  Similar
14917978d3cdSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
14927978d3cdSmrg#
14937978d3cdSmrg#
14947978d3cdSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
14957978d3cdSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
14967978d3cdSmrg# PKG_CHECK_EXISTS manually
14977978d3cdSmrg# --------------------------------------------------------------
14987978d3cdSmrgAC_DEFUN([PKG_CHECK_EXISTS],
14997978d3cdSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
15007978d3cdSmrgif test -n "$PKG_CONFIG" && \
15017978d3cdSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
15027978d3cdSmrg  m4_ifval([$2], [$2], [:])
15037978d3cdSmrgm4_ifvaln([$3], [else
15047978d3cdSmrg  $3])dnl
15057978d3cdSmrgfi])
1506ea6ae205Smrg
1507ea6ae205Smrg
15087978d3cdSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
15097978d3cdSmrg# ---------------------------------------------
15107978d3cdSmrgm4_define([_PKG_CONFIG],
15117978d3cdSmrg[if test -n "$PKG_CONFIG"; then
15127978d3cdSmrg        PKG_CHECK_EXISTS([$3],
15137978d3cdSmrg                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
15147978d3cdSmrg			 [pkg_failed=yes])
15157978d3cdSmrgelse
15167978d3cdSmrg	pkg_failed=untried
15177978d3cdSmrgfi[]dnl
15187978d3cdSmrg])# _PKG_CONFIG
1519ea6ae205Smrg
15207978d3cdSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
15217978d3cdSmrg# [ACTION-IF-NOT-FOUND])
1522ea6ae205Smrg#
1523ea6ae205Smrg#
15247978d3cdSmrg# Note that if there is a possibility the first call to
15257978d3cdSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
15267978d3cdSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1527ea6ae205Smrg#
15287978d3cdSmrg#
15297978d3cdSmrg# --------------------------------------------------------------
15307978d3cdSmrgAC_DEFUN([PKG_CHECK_MODULES],
15317978d3cdSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
15327978d3cdSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
15337978d3cdSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1534ea6ae205Smrg
15357978d3cdSmrgpkg_failed=no
15367978d3cdSmrgAC_MSG_CHECKING([for $1])
1537ea6ae205Smrg
15387978d3cdSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
15397978d3cdSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1540ea6ae205Smrg
15417978d3cdSmrgif test $pkg_failed = yes; then
15427978d3cdSmrg	$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
15437978d3cdSmrg	# Put the nasty error message in config.log where it belongs
15447978d3cdSmrg	echo "$$1[]_PKG_ERRORS" 1>&AS_MESSAGE_LOG_FD
15457978d3cdSmrg
15467978d3cdSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
15477978d3cdSmrg[Package requirements ($2) were not met.
15487978d3cdSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
15497978d3cdSmrginstalled software in a non-standard prefix.
15507978d3cdSmrg
15517978d3cdSmrgAlternatively you may set the $1_CFLAGS and $1_LIBS environment variables
15527978d3cdSmrgto avoid the need to call pkg-config.  See the pkg-config man page for
15537978d3cdSmrgmore details.])],
15547978d3cdSmrg		[$4])
15557978d3cdSmrgelif test $pkg_failed = untried; then
15567978d3cdSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
15577978d3cdSmrg[The pkg-config script could not be found or is too old.  Make sure it
15587978d3cdSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
15597978d3cdSmrgpath to pkg-config.
15607978d3cdSmrg
15617978d3cdSmrgAlternatively you may set the $1_CFLAGS and $1_LIBS environment variables
15627978d3cdSmrgto avoid the need to call pkg-config.  See the pkg-config man page for
15637978d3cdSmrgmore details.
15647978d3cdSmrg
15657978d3cdSmrgTo get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
15667978d3cdSmrg		[$4])
15677978d3cdSmrgelse
15687978d3cdSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
15697978d3cdSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
15707978d3cdSmrg        AC_MSG_RESULT([yes])
15717978d3cdSmrg	ifelse([$3], , :, [$3])
15727978d3cdSmrgfi[]dnl
15737978d3cdSmrg])# PKG_CHECK_MODULES
1574ea6ae205Smrg
1575