aclocal.m4 revision 64ce7165
164ce7165Smrg# generated automatically by aclocal 1.10 -*- Autoconf -*-
264ce7165Smrg
364ce7165Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
464ce7165Smrg# 2005, 2006  Free Software Foundation, Inc.
564ce7165Smrg# This file is free software; the Free Software Foundation
664ce7165Smrg# gives unlimited permission to copy and/or distribute it,
764ce7165Smrg# with or without modifications, as long as this notice is preserved.
864ce7165Smrg
964ce7165Smrg# This program is distributed in the hope that it will be useful,
1064ce7165Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1164ce7165Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1264ce7165Smrg# PARTICULAR PURPOSE.
1364ce7165Smrg
1464ce7165Smrgm4_if(m4_PACKAGE_VERSION, [2.61],,
1564ce7165Smrg[m4_fatal([this file was generated for autoconf 2.61.
1664ce7165SmrgYou have another version of autoconf.  If you want to use that,
1764ce7165Smrgyou should regenerate the build system entirely.], [63])])
1864ce7165Smrg
1964ce7165Smrg# Copyright (C) 2002, 2003, 2005, 2006  Free Software Foundation, Inc.
2064ce7165Smrg#
2164ce7165Smrg# This file is free software; the Free Software Foundation
2264ce7165Smrg# gives unlimited permission to copy and/or distribute it,
2364ce7165Smrg# with or without modifications, as long as this notice is preserved.
2464ce7165Smrg
2564ce7165Smrg# AM_AUTOMAKE_VERSION(VERSION)
2664ce7165Smrg# ----------------------------
2764ce7165Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
2864ce7165Smrg# generated from the m4 files accompanying Automake X.Y.
2964ce7165Smrg# (This private macro should not be called outside this file.)
3064ce7165SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
3164ce7165Smrg[am__api_version='1.10'
3264ce7165Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
3364ce7165Smrgdnl require some minimum version.  Point them to the right macro.
3464ce7165Smrgm4_if([$1], [1.10], [],
3564ce7165Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
3664ce7165Smrg])
3764ce7165Smrg
3864ce7165Smrg# _AM_AUTOCONF_VERSION(VERSION)
3964ce7165Smrg# -----------------------------
4064ce7165Smrg# aclocal traces this macro to find the Autoconf version.
4164ce7165Smrg# This is a private macro too.  Using m4_define simplifies
4264ce7165Smrg# the logic in aclocal, which can simply ignore this definition.
4364ce7165Smrgm4_define([_AM_AUTOCONF_VERSION], [])
4464ce7165Smrg
4564ce7165Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
4664ce7165Smrg# -------------------------------
4764ce7165Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
4864ce7165Smrg# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
4964ce7165SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
5064ce7165Smrg[AM_AUTOMAKE_VERSION([1.10])dnl
5164ce7165Smrg_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
5264ce7165Smrg
5364ce7165Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
5464ce7165Smrg
5564ce7165Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
5664ce7165Smrg#
5764ce7165Smrg# This file is free software; the Free Software Foundation
5864ce7165Smrg# gives unlimited permission to copy and/or distribute it,
5964ce7165Smrg# with or without modifications, as long as this notice is preserved.
6064ce7165Smrg
6164ce7165Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
6264ce7165Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
6364ce7165Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
6464ce7165Smrg#
6564ce7165Smrg# Of course, Automake must honor this variable whenever it calls a
6664ce7165Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
6764ce7165Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
6864ce7165Smrg# depending on how configure is run.  This is pretty annoying, since
6964ce7165Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
7064ce7165Smrg# source directory, any form will work fine, but in subdirectories a
7164ce7165Smrg# relative path needs to be adjusted first.
7264ce7165Smrg#
7364ce7165Smrg# $ac_aux_dir/missing
7464ce7165Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
7564ce7165Smrg# $top_srcdir/$ac_aux_dir/missing
7664ce7165Smrg#    fails if $ac_aux_dir is absolute,
7764ce7165Smrg#    fails when called from a subdirectory in a VPATH build with
7864ce7165Smrg#          a relative $ac_aux_dir
7964ce7165Smrg#
8064ce7165Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
8164ce7165Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
8264ce7165Smrg# harmless because $srcdir is `.', but things will broke when you
8364ce7165Smrg# start a VPATH build or use an absolute $srcdir.
8464ce7165Smrg#
8564ce7165Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
8664ce7165Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
8764ce7165Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
8864ce7165Smrg# and then we would define $MISSING as
8964ce7165Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
9064ce7165Smrg# This will work as long as MISSING is not called from configure, because
9164ce7165Smrg# unfortunately $(top_srcdir) has no meaning in configure.
9264ce7165Smrg# However there are other variables, like CC, which are often used in
9364ce7165Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
9464ce7165Smrg#
9564ce7165Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
9664ce7165Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
9764ce7165Smrg# configured tree to be moved without reconfiguration.
9864ce7165Smrg
9964ce7165SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
10064ce7165Smrg[dnl Rely on autoconf to set up CDPATH properly.
10164ce7165SmrgAC_PREREQ([2.50])dnl
10264ce7165Smrg# expand $ac_aux_dir to an absolute path
10364ce7165Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
10464ce7165Smrg])
10564ce7165Smrg
10664ce7165Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
10764ce7165Smrg
10864ce7165Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
10964ce7165Smrg# Free Software Foundation, Inc.
11064ce7165Smrg#
11164ce7165Smrg# This file is free software; the Free Software Foundation
11264ce7165Smrg# gives unlimited permission to copy and/or distribute it,
11364ce7165Smrg# with or without modifications, as long as this notice is preserved.
11464ce7165Smrg
11564ce7165Smrg# serial 8
11664ce7165Smrg
11764ce7165Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
11864ce7165Smrg# -------------------------------------
11964ce7165Smrg# Define a conditional.
12064ce7165SmrgAC_DEFUN([AM_CONDITIONAL],
12164ce7165Smrg[AC_PREREQ(2.52)dnl
12264ce7165Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
12364ce7165Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
12464ce7165SmrgAC_SUBST([$1_TRUE])dnl
12564ce7165SmrgAC_SUBST([$1_FALSE])dnl
12664ce7165Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
12764ce7165Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
12864ce7165Smrgif $2; then
12964ce7165Smrg  $1_TRUE=
13064ce7165Smrg  $1_FALSE='#'
13164ce7165Smrgelse
13264ce7165Smrg  $1_TRUE='#'
13364ce7165Smrg  $1_FALSE=
13464ce7165Smrgfi
13564ce7165SmrgAC_CONFIG_COMMANDS_PRE(
13664ce7165Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
13764ce7165Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
13864ce7165SmrgUsually this means the macro was only invoked conditionally.]])
13964ce7165Smrgfi])])
14064ce7165Smrg
14164ce7165Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
14264ce7165Smrg# Free Software Foundation, Inc.
14364ce7165Smrg#
14464ce7165Smrg# This file is free software; the Free Software Foundation
14564ce7165Smrg# gives unlimited permission to copy and/or distribute it,
14664ce7165Smrg# with or without modifications, as long as this notice is preserved.
14764ce7165Smrg
14864ce7165Smrg# serial 9
14964ce7165Smrg
15064ce7165Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
15164ce7165Smrg# written in clear, in which case automake, when reading aclocal.m4,
15264ce7165Smrg# will think it sees a *use*, and therefore will trigger all it's
15364ce7165Smrg# C support machinery.  Also note that it means that autoscan, seeing
15464ce7165Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
15564ce7165Smrg
15664ce7165Smrg
15764ce7165Smrg# _AM_DEPENDENCIES(NAME)
15864ce7165Smrg# ----------------------
15964ce7165Smrg# See how the compiler implements dependency checking.
16064ce7165Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
16164ce7165Smrg# We try a few techniques and use that to set a single cache variable.
16264ce7165Smrg#
16364ce7165Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
16464ce7165Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
16564ce7165Smrg# dependency, and given that the user is not expected to run this macro,
16664ce7165Smrg# just rely on AC_PROG_CC.
16764ce7165SmrgAC_DEFUN([_AM_DEPENDENCIES],
16864ce7165Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
16964ce7165SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
17064ce7165SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
17164ce7165SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
17264ce7165Smrg
17364ce7165Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
17464ce7165Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
17564ce7165Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
17664ce7165Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
17764ce7165Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
17864ce7165Smrg                   [depcc="$$1"   am_compiler_list=])
17964ce7165Smrg
18064ce7165SmrgAC_CACHE_CHECK([dependency style of $depcc],
18164ce7165Smrg               [am_cv_$1_dependencies_compiler_type],
18264ce7165Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
18364ce7165Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
18464ce7165Smrg  # making bogus files that we don't know about and never remove.  For
18564ce7165Smrg  # instance it was reported that on HP-UX the gcc test will end up
18664ce7165Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
18764ce7165Smrg  # in D'.
18864ce7165Smrg  mkdir conftest.dir
18964ce7165Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
19064ce7165Smrg  # using a relative directory.
19164ce7165Smrg  cp "$am_depcomp" conftest.dir
19264ce7165Smrg  cd conftest.dir
19364ce7165Smrg  # We will build objects and dependencies in a subdirectory because
19464ce7165Smrg  # it helps to detect inapplicable dependency modes.  For instance
19564ce7165Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
19664ce7165Smrg  # side effect of compilation, but ICC will put the dependencies in
19764ce7165Smrg  # the current directory while Tru64 will put them in the object
19864ce7165Smrg  # directory.
19964ce7165Smrg  mkdir sub
20064ce7165Smrg
20164ce7165Smrg  am_cv_$1_dependencies_compiler_type=none
20264ce7165Smrg  if test "$am_compiler_list" = ""; then
20364ce7165Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
20464ce7165Smrg  fi
20564ce7165Smrg  for depmode in $am_compiler_list; do
20664ce7165Smrg    # Setup a source with many dependencies, because some compilers
20764ce7165Smrg    # like to wrap large dependency lists on column 80 (with \), and
20864ce7165Smrg    # we should not choose a depcomp mode which is confused by this.
20964ce7165Smrg    #
21064ce7165Smrg    # We need to recreate these files for each test, as the compiler may
21164ce7165Smrg    # overwrite some of them when testing with obscure command lines.
21264ce7165Smrg    # This happens at least with the AIX C compiler.
21364ce7165Smrg    : > sub/conftest.c
21464ce7165Smrg    for i in 1 2 3 4 5 6; do
21564ce7165Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
21664ce7165Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
21764ce7165Smrg      # Solaris 8's {/usr,}/bin/sh.
21864ce7165Smrg      touch sub/conftst$i.h
21964ce7165Smrg    done
22064ce7165Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
22164ce7165Smrg
22264ce7165Smrg    case $depmode in
22364ce7165Smrg    nosideeffect)
22464ce7165Smrg      # after this tag, mechanisms are not by side-effect, so they'll
22564ce7165Smrg      # only be used when explicitly requested
22664ce7165Smrg      if test "x$enable_dependency_tracking" = xyes; then
22764ce7165Smrg	continue
22864ce7165Smrg      else
22964ce7165Smrg	break
23064ce7165Smrg      fi
23164ce7165Smrg      ;;
23264ce7165Smrg    none) break ;;
23364ce7165Smrg    esac
23464ce7165Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
23564ce7165Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
23664ce7165Smrg    # handle `-M -o', and we need to detect this.
23764ce7165Smrg    if depmode=$depmode \
23864ce7165Smrg       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
23964ce7165Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
24064ce7165Smrg       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
24164ce7165Smrg         >/dev/null 2>conftest.err &&
24264ce7165Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
24364ce7165Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
24464ce7165Smrg       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
24564ce7165Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
24664ce7165Smrg      # icc doesn't choke on unknown options, it will just issue warnings
24764ce7165Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
24864ce7165Smrg      # that says an option was ignored or not supported.
24964ce7165Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
25064ce7165Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
25164ce7165Smrg      # The diagnosis changed in icc 8.0:
25264ce7165Smrg      #   icc: Command line remark: option '-MP' not supported
25364ce7165Smrg      if (grep 'ignoring option' conftest.err ||
25464ce7165Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
25564ce7165Smrg        am_cv_$1_dependencies_compiler_type=$depmode
25664ce7165Smrg        break
25764ce7165Smrg      fi
25864ce7165Smrg    fi
25964ce7165Smrg  done
26064ce7165Smrg
26164ce7165Smrg  cd ..
26264ce7165Smrg  rm -rf conftest.dir
26364ce7165Smrgelse
26464ce7165Smrg  am_cv_$1_dependencies_compiler_type=none
26564ce7165Smrgfi
26664ce7165Smrg])
26764ce7165SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
26864ce7165SmrgAM_CONDITIONAL([am__fastdep$1], [
26964ce7165Smrg  test "x$enable_dependency_tracking" != xno \
27064ce7165Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
27164ce7165Smrg])
27264ce7165Smrg
27364ce7165Smrg
27464ce7165Smrg# AM_SET_DEPDIR
27564ce7165Smrg# -------------
27664ce7165Smrg# Choose a directory name for dependency files.
27764ce7165Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
27864ce7165SmrgAC_DEFUN([AM_SET_DEPDIR],
27964ce7165Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
28064ce7165SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
28164ce7165Smrg])
28264ce7165Smrg
28364ce7165Smrg
28464ce7165Smrg# AM_DEP_TRACK
28564ce7165Smrg# ------------
28664ce7165SmrgAC_DEFUN([AM_DEP_TRACK],
28764ce7165Smrg[AC_ARG_ENABLE(dependency-tracking,
28864ce7165Smrg[  --disable-dependency-tracking  speeds up one-time build
28964ce7165Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
29064ce7165Smrgif test "x$enable_dependency_tracking" != xno; then
29164ce7165Smrg  am_depcomp="$ac_aux_dir/depcomp"
29264ce7165Smrg  AMDEPBACKSLASH='\'
29364ce7165Smrgfi
29464ce7165SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
29564ce7165SmrgAC_SUBST([AMDEPBACKSLASH])dnl
29664ce7165Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
29764ce7165Smrg])
29864ce7165Smrg
29964ce7165Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
30064ce7165Smrg
30164ce7165Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
30264ce7165Smrg# Free Software Foundation, Inc.
30364ce7165Smrg#
30464ce7165Smrg# This file is free software; the Free Software Foundation
30564ce7165Smrg# gives unlimited permission to copy and/or distribute it,
30664ce7165Smrg# with or without modifications, as long as this notice is preserved.
30764ce7165Smrg
30864ce7165Smrg#serial 3
30964ce7165Smrg
31064ce7165Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
31164ce7165Smrg# ------------------------------
31264ce7165SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
31364ce7165Smrg[for mf in $CONFIG_FILES; do
31464ce7165Smrg  # Strip MF so we end up with the name of the file.
31564ce7165Smrg  mf=`echo "$mf" | sed -e 's/:.*$//'`
31664ce7165Smrg  # Check whether this is an Automake generated Makefile or not.
31764ce7165Smrg  # We used to match only the files named `Makefile.in', but
31864ce7165Smrg  # some people rename them; so instead we look at the file content.
31964ce7165Smrg  # Grep'ing the first line is not enough: some people post-process
32064ce7165Smrg  # each Makefile.in and add a new line on top of each file to say so.
32164ce7165Smrg  # Grep'ing the whole file is not good either: AIX grep has a line
32264ce7165Smrg  # limit of 2048, but all sed's we know have understand at least 4000.
32364ce7165Smrg  if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
32464ce7165Smrg    dirpart=`AS_DIRNAME("$mf")`
32564ce7165Smrg  else
32664ce7165Smrg    continue
32764ce7165Smrg  fi
32864ce7165Smrg  # Extract the definition of DEPDIR, am__include, and am__quote
32964ce7165Smrg  # from the Makefile without running `make'.
33064ce7165Smrg  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
33164ce7165Smrg  test -z "$DEPDIR" && continue
33264ce7165Smrg  am__include=`sed -n 's/^am__include = //p' < "$mf"`
33364ce7165Smrg  test -z "am__include" && continue
33464ce7165Smrg  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
33564ce7165Smrg  # When using ansi2knr, U may be empty or an underscore; expand it
33664ce7165Smrg  U=`sed -n 's/^U = //p' < "$mf"`
33764ce7165Smrg  # Find all dependency output files, they are included files with
33864ce7165Smrg  # $(DEPDIR) in their names.  We invoke sed twice because it is the
33964ce7165Smrg  # simplest approach to changing $(DEPDIR) to its actual value in the
34064ce7165Smrg  # expansion.
34164ce7165Smrg  for file in `sed -n "
34264ce7165Smrg    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
34364ce7165Smrg       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
34464ce7165Smrg    # Make sure the directory exists.
34564ce7165Smrg    test -f "$dirpart/$file" && continue
34664ce7165Smrg    fdir=`AS_DIRNAME(["$file"])`
34764ce7165Smrg    AS_MKDIR_P([$dirpart/$fdir])
34864ce7165Smrg    # echo "creating $dirpart/$file"
34964ce7165Smrg    echo '# dummy' > "$dirpart/$file"
35064ce7165Smrg  done
35164ce7165Smrgdone
35264ce7165Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
35364ce7165Smrg
35464ce7165Smrg
35564ce7165Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
35664ce7165Smrg# -----------------------------
35764ce7165Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
35864ce7165Smrg#
35964ce7165Smrg# This code is only required when automatic dependency tracking
36064ce7165Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
36164ce7165Smrg# need in order to bootstrap the dependency handling code.
36264ce7165SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
36364ce7165Smrg[AC_CONFIG_COMMANDS([depfiles],
36464ce7165Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
36564ce7165Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
36664ce7165Smrg])
36764ce7165Smrg
36864ce7165Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
36964ce7165Smrg# Free Software Foundation, Inc.
37064ce7165Smrg#
37164ce7165Smrg# This file is free software; the Free Software Foundation
37264ce7165Smrg# gives unlimited permission to copy and/or distribute it,
37364ce7165Smrg# with or without modifications, as long as this notice is preserved.
37464ce7165Smrg
37564ce7165Smrg# serial 8
37664ce7165Smrg
37764ce7165Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
37864ce7165SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
37964ce7165Smrg
38064ce7165Smrg# Do all the work for Automake.                             -*- Autoconf -*-
38164ce7165Smrg
38264ce7165Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
38364ce7165Smrg# 2005, 2006 Free Software Foundation, Inc.
38464ce7165Smrg#
38564ce7165Smrg# This file is free software; the Free Software Foundation
38664ce7165Smrg# gives unlimited permission to copy and/or distribute it,
38764ce7165Smrg# with or without modifications, as long as this notice is preserved.
38864ce7165Smrg
38964ce7165Smrg# serial 12
39064ce7165Smrg
39164ce7165Smrg# This macro actually does too much.  Some checks are only needed if
39264ce7165Smrg# your package does certain things.  But this isn't really a big deal.
39364ce7165Smrg
39464ce7165Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
39564ce7165Smrg# AM_INIT_AUTOMAKE([OPTIONS])
39664ce7165Smrg# -----------------------------------------------
39764ce7165Smrg# The call with PACKAGE and VERSION arguments is the old style
39864ce7165Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
39964ce7165Smrg# and VERSION should now be passed to AC_INIT and removed from
40064ce7165Smrg# the call to AM_INIT_AUTOMAKE.
40164ce7165Smrg# We support both call styles for the transition.  After
40264ce7165Smrg# the next Automake release, Autoconf can make the AC_INIT
40364ce7165Smrg# arguments mandatory, and then we can depend on a new Autoconf
40464ce7165Smrg# release and drop the old call support.
40564ce7165SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
40664ce7165Smrg[AC_PREREQ([2.60])dnl
40764ce7165Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
40864ce7165Smrgdnl the ones we care about.
40964ce7165Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
41064ce7165SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
41164ce7165SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
41264ce7165Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
41364ce7165Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
41464ce7165Smrg  # is not polluted with repeated "-I."
41564ce7165Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
41664ce7165Smrg  # test to see if srcdir already configured
41764ce7165Smrg  if test -f $srcdir/config.status; then
41864ce7165Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
41964ce7165Smrg  fi
42064ce7165Smrgfi
42164ce7165Smrg
42264ce7165Smrg# test whether we have cygpath
42364ce7165Smrgif test -z "$CYGPATH_W"; then
42464ce7165Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
42564ce7165Smrg    CYGPATH_W='cygpath -w'
42664ce7165Smrg  else
42764ce7165Smrg    CYGPATH_W=echo
42864ce7165Smrg  fi
42964ce7165Smrgfi
43064ce7165SmrgAC_SUBST([CYGPATH_W])
43164ce7165Smrg
43264ce7165Smrg# Define the identity of the package.
43364ce7165Smrgdnl Distinguish between old-style and new-style calls.
43464ce7165Smrgm4_ifval([$2],
43564ce7165Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
43664ce7165Smrg AC_SUBST([PACKAGE], [$1])dnl
43764ce7165Smrg AC_SUBST([VERSION], [$2])],
43864ce7165Smrg[_AM_SET_OPTIONS([$1])dnl
43964ce7165Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
44064ce7165Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
44164ce7165Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
44264ce7165Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
44364ce7165Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
44464ce7165Smrg
44564ce7165Smrg_AM_IF_OPTION([no-define],,
44664ce7165Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
44764ce7165Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
44864ce7165Smrg
44964ce7165Smrg# Some tools Automake needs.
45064ce7165SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
45164ce7165SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
45264ce7165SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
45364ce7165SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
45464ce7165SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
45564ce7165SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
45664ce7165SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
45764ce7165SmrgAM_PROG_INSTALL_SH
45864ce7165SmrgAM_PROG_INSTALL_STRIP
45964ce7165SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
46064ce7165Smrg# We need awk for the "check" target.  The system "awk" is bad on
46164ce7165Smrg# some platforms.
46264ce7165SmrgAC_REQUIRE([AC_PROG_AWK])dnl
46364ce7165SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
46464ce7165SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
46564ce7165Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
46664ce7165Smrg              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
46764ce7165Smrg	      		     [_AM_PROG_TAR([v7])])])
46864ce7165Smrg_AM_IF_OPTION([no-dependencies],,
46964ce7165Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
47064ce7165Smrg                  [_AM_DEPENDENCIES(CC)],
47164ce7165Smrg                  [define([AC_PROG_CC],
47264ce7165Smrg                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
47364ce7165SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
47464ce7165Smrg                  [_AM_DEPENDENCIES(CXX)],
47564ce7165Smrg                  [define([AC_PROG_CXX],
47664ce7165Smrg                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
47764ce7165SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
47864ce7165Smrg                  [_AM_DEPENDENCIES(OBJC)],
47964ce7165Smrg                  [define([AC_PROG_OBJC],
48064ce7165Smrg                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
48164ce7165Smrg])
48264ce7165Smrg])
48364ce7165Smrg
48464ce7165Smrg
48564ce7165Smrg# When config.status generates a header, we must update the stamp-h file.
48664ce7165Smrg# This file resides in the same directory as the config header
48764ce7165Smrg# that is generated.  The stamp files are numbered to have different names.
48864ce7165Smrg
48964ce7165Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
49064ce7165Smrg# loop where config.status creates the headers, so we can generate
49164ce7165Smrg# our stamp files there.
49264ce7165SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
49364ce7165Smrg[# Compute $1's index in $config_headers.
49464ce7165Smrg_am_stamp_count=1
49564ce7165Smrgfor _am_header in $config_headers :; do
49664ce7165Smrg  case $_am_header in
49764ce7165Smrg    $1 | $1:* )
49864ce7165Smrg      break ;;
49964ce7165Smrg    * )
50064ce7165Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
50164ce7165Smrg  esac
50264ce7165Smrgdone
50364ce7165Smrgecho "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
50464ce7165Smrg
50564ce7165Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
50664ce7165Smrg#
50764ce7165Smrg# This file is free software; the Free Software Foundation
50864ce7165Smrg# gives unlimited permission to copy and/or distribute it,
50964ce7165Smrg# with or without modifications, as long as this notice is preserved.
51064ce7165Smrg
51164ce7165Smrg# AM_PROG_INSTALL_SH
51264ce7165Smrg# ------------------
51364ce7165Smrg# Define $install_sh.
51464ce7165SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
51564ce7165Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
51664ce7165Smrginstall_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
51764ce7165SmrgAC_SUBST(install_sh)])
51864ce7165Smrg
51964ce7165Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
52064ce7165Smrg#
52164ce7165Smrg# This file is free software; the Free Software Foundation
52264ce7165Smrg# gives unlimited permission to copy and/or distribute it,
52364ce7165Smrg# with or without modifications, as long as this notice is preserved.
52464ce7165Smrg
52564ce7165Smrg# serial 2
52664ce7165Smrg
52764ce7165Smrg# Check whether the underlying file-system supports filenames
52864ce7165Smrg# with a leading dot.  For instance MS-DOS doesn't.
52964ce7165SmrgAC_DEFUN([AM_SET_LEADING_DOT],
53064ce7165Smrg[rm -rf .tst 2>/dev/null
53164ce7165Smrgmkdir .tst 2>/dev/null
53264ce7165Smrgif test -d .tst; then
53364ce7165Smrg  am__leading_dot=.
53464ce7165Smrgelse
53564ce7165Smrg  am__leading_dot=_
53664ce7165Smrgfi
53764ce7165Smrgrmdir .tst 2>/dev/null
53864ce7165SmrgAC_SUBST([am__leading_dot])])
53964ce7165Smrg
54064ce7165Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
54164ce7165Smrg# From Jim Meyering
54264ce7165Smrg
54364ce7165Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
54464ce7165Smrg# Free Software Foundation, Inc.
54564ce7165Smrg#
54664ce7165Smrg# This file is free software; the Free Software Foundation
54764ce7165Smrg# gives unlimited permission to copy and/or distribute it,
54864ce7165Smrg# with or without modifications, as long as this notice is preserved.
54964ce7165Smrg
55064ce7165Smrg# serial 4
55164ce7165Smrg
55264ce7165SmrgAC_DEFUN([AM_MAINTAINER_MODE],
55364ce7165Smrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
55464ce7165Smrg  dnl maintainer-mode is disabled by default
55564ce7165Smrg  AC_ARG_ENABLE(maintainer-mode,
55664ce7165Smrg[  --enable-maintainer-mode  enable make rules and dependencies not useful
55764ce7165Smrg			  (and sometimes confusing) to the casual installer],
55864ce7165Smrg      USE_MAINTAINER_MODE=$enableval,
55964ce7165Smrg      USE_MAINTAINER_MODE=no)
56064ce7165Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
56164ce7165Smrg  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
56264ce7165Smrg  MAINT=$MAINTAINER_MODE_TRUE
56364ce7165Smrg  AC_SUBST(MAINT)dnl
56464ce7165Smrg]
56564ce7165Smrg)
56664ce7165Smrg
56764ce7165SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
56864ce7165Smrg
56964ce7165Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
57064ce7165Smrg
57164ce7165Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
57264ce7165Smrg#
57364ce7165Smrg# This file is free software; the Free Software Foundation
57464ce7165Smrg# gives unlimited permission to copy and/or distribute it,
57564ce7165Smrg# with or without modifications, as long as this notice is preserved.
57664ce7165Smrg
57764ce7165Smrg# serial 3
57864ce7165Smrg
57964ce7165Smrg# AM_MAKE_INCLUDE()
58064ce7165Smrg# -----------------
58164ce7165Smrg# Check to see how make treats includes.
58264ce7165SmrgAC_DEFUN([AM_MAKE_INCLUDE],
58364ce7165Smrg[am_make=${MAKE-make}
58464ce7165Smrgcat > confinc << 'END'
58564ce7165Smrgam__doit:
58664ce7165Smrg	@echo done
58764ce7165Smrg.PHONY: am__doit
58864ce7165SmrgEND
58964ce7165Smrg# If we don't find an include directive, just comment out the code.
59064ce7165SmrgAC_MSG_CHECKING([for style of include used by $am_make])
59164ce7165Smrgam__include="#"
59264ce7165Smrgam__quote=
59364ce7165Smrg_am_result=none
59464ce7165Smrg# First try GNU make style include.
59564ce7165Smrgecho "include confinc" > confmf
59664ce7165Smrg# We grep out `Entering directory' and `Leaving directory'
59764ce7165Smrg# messages which can occur if `w' ends up in MAKEFLAGS.
59864ce7165Smrg# In particular we don't look at `^make:' because GNU make might
59964ce7165Smrg# be invoked under some other name (usually "gmake"), in which
60064ce7165Smrg# case it prints its new name instead of `make'.
60164ce7165Smrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
60264ce7165Smrg   am__include=include
60364ce7165Smrg   am__quote=
60464ce7165Smrg   _am_result=GNU
60564ce7165Smrgfi
60664ce7165Smrg# Now try BSD make style include.
60764ce7165Smrgif test "$am__include" = "#"; then
60864ce7165Smrg   echo '.include "confinc"' > confmf
60964ce7165Smrg   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
61064ce7165Smrg      am__include=.include
61164ce7165Smrg      am__quote="\""
61264ce7165Smrg      _am_result=BSD
61364ce7165Smrg   fi
61464ce7165Smrgfi
61564ce7165SmrgAC_SUBST([am__include])
61664ce7165SmrgAC_SUBST([am__quote])
61764ce7165SmrgAC_MSG_RESULT([$_am_result])
61864ce7165Smrgrm -f confinc confmf
61964ce7165Smrg])
62064ce7165Smrg
62164ce7165Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
62264ce7165Smrg
62364ce7165Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
62464ce7165Smrg# Free Software Foundation, Inc.
62564ce7165Smrg#
62664ce7165Smrg# This file is free software; the Free Software Foundation
62764ce7165Smrg# gives unlimited permission to copy and/or distribute it,
62864ce7165Smrg# with or without modifications, as long as this notice is preserved.
62964ce7165Smrg
63064ce7165Smrg# serial 5
63164ce7165Smrg
63264ce7165Smrg# AM_MISSING_PROG(NAME, PROGRAM)
63364ce7165Smrg# ------------------------------
63464ce7165SmrgAC_DEFUN([AM_MISSING_PROG],
63564ce7165Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
63664ce7165Smrg$1=${$1-"${am_missing_run}$2"}
63764ce7165SmrgAC_SUBST($1)])
63864ce7165Smrg
63964ce7165Smrg
64064ce7165Smrg# AM_MISSING_HAS_RUN
64164ce7165Smrg# ------------------
64264ce7165Smrg# Define MISSING if not defined so far and test if it supports --run.
64364ce7165Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
64464ce7165SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
64564ce7165Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
64664ce7165SmrgAC_REQUIRE_AUX_FILE([missing])dnl
64764ce7165Smrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
64864ce7165Smrg# Use eval to expand $SHELL
64964ce7165Smrgif eval "$MISSING --run true"; then
65064ce7165Smrg  am_missing_run="$MISSING --run "
65164ce7165Smrgelse
65264ce7165Smrg  am_missing_run=
65364ce7165Smrg  AC_MSG_WARN([`missing' script is too old or missing])
65464ce7165Smrgfi
65564ce7165Smrg])
65664ce7165Smrg
65764ce7165Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
65864ce7165Smrg#
65964ce7165Smrg# This file is free software; the Free Software Foundation
66064ce7165Smrg# gives unlimited permission to copy and/or distribute it,
66164ce7165Smrg# with or without modifications, as long as this notice is preserved.
66264ce7165Smrg
66364ce7165Smrg# AM_PROG_MKDIR_P
66464ce7165Smrg# ---------------
66564ce7165Smrg# Check for `mkdir -p'.
66664ce7165SmrgAC_DEFUN([AM_PROG_MKDIR_P],
66764ce7165Smrg[AC_PREREQ([2.60])dnl
66864ce7165SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
66964ce7165Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
67064ce7165Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
67164ce7165Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
67264ce7165Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
67364ce7165Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
67464ce7165Smrgdnl adjustment using top_builddir (which is defined more often than
67564ce7165Smrgdnl MKDIR_P).
67664ce7165SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
67764ce7165Smrgcase $mkdir_p in
67864ce7165Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
67964ce7165Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
68064ce7165Smrgesac
68164ce7165Smrg])
68264ce7165Smrg
68364ce7165Smrg# Helper functions for option handling.                     -*- Autoconf -*-
68464ce7165Smrg
68564ce7165Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
68664ce7165Smrg#
68764ce7165Smrg# This file is free software; the Free Software Foundation
68864ce7165Smrg# gives unlimited permission to copy and/or distribute it,
68964ce7165Smrg# with or without modifications, as long as this notice is preserved.
69064ce7165Smrg
69164ce7165Smrg# serial 3
69264ce7165Smrg
69364ce7165Smrg# _AM_MANGLE_OPTION(NAME)
69464ce7165Smrg# -----------------------
69564ce7165SmrgAC_DEFUN([_AM_MANGLE_OPTION],
69664ce7165Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
69764ce7165Smrg
69864ce7165Smrg# _AM_SET_OPTION(NAME)
69964ce7165Smrg# ------------------------------
70064ce7165Smrg# Set option NAME.  Presently that only means defining a flag for this option.
70164ce7165SmrgAC_DEFUN([_AM_SET_OPTION],
70264ce7165Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
70364ce7165Smrg
70464ce7165Smrg# _AM_SET_OPTIONS(OPTIONS)
70564ce7165Smrg# ----------------------------------
70664ce7165Smrg# OPTIONS is a space-separated list of Automake options.
70764ce7165SmrgAC_DEFUN([_AM_SET_OPTIONS],
70864ce7165Smrg[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
70964ce7165Smrg
71064ce7165Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
71164ce7165Smrg# -------------------------------------------
71264ce7165Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
71364ce7165SmrgAC_DEFUN([_AM_IF_OPTION],
71464ce7165Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
71564ce7165Smrg
71664ce7165Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
71764ce7165Smrg
71864ce7165Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
71964ce7165Smrg# Free Software Foundation, Inc.
72064ce7165Smrg#
72164ce7165Smrg# This file is free software; the Free Software Foundation
72264ce7165Smrg# gives unlimited permission to copy and/or distribute it,
72364ce7165Smrg# with or without modifications, as long as this notice is preserved.
72464ce7165Smrg
72564ce7165Smrg# serial 4
72664ce7165Smrg
72764ce7165Smrg# AM_SANITY_CHECK
72864ce7165Smrg# ---------------
72964ce7165SmrgAC_DEFUN([AM_SANITY_CHECK],
73064ce7165Smrg[AC_MSG_CHECKING([whether build environment is sane])
73164ce7165Smrg# Just in case
73264ce7165Smrgsleep 1
73364ce7165Smrgecho timestamp > conftest.file
73464ce7165Smrg# Do `set' in a subshell so we don't clobber the current shell's
73564ce7165Smrg# arguments.  Must try -L first in case configure is actually a
73664ce7165Smrg# symlink; some systems play weird games with the mod time of symlinks
73764ce7165Smrg# (eg FreeBSD returns the mod time of the symlink's containing
73864ce7165Smrg# directory).
73964ce7165Smrgif (
74064ce7165Smrg   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
74164ce7165Smrg   if test "$[*]" = "X"; then
74264ce7165Smrg      # -L didn't work.
74364ce7165Smrg      set X `ls -t $srcdir/configure conftest.file`
74464ce7165Smrg   fi
74564ce7165Smrg   rm -f conftest.file
74664ce7165Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
74764ce7165Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
74864ce7165Smrg
74964ce7165Smrg      # If neither matched, then we have a broken ls.  This can happen
75064ce7165Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
75164ce7165Smrg      # broken ls alias from the environment.  This has actually
75264ce7165Smrg      # happened.  Such a system could not be considered "sane".
75364ce7165Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
75464ce7165Smrgalias in your environment])
75564ce7165Smrg   fi
75664ce7165Smrg
75764ce7165Smrg   test "$[2]" = conftest.file
75864ce7165Smrg   )
75964ce7165Smrgthen
76064ce7165Smrg   # Ok.
76164ce7165Smrg   :
76264ce7165Smrgelse
76364ce7165Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
76464ce7165SmrgCheck your system clock])
76564ce7165Smrgfi
76664ce7165SmrgAC_MSG_RESULT(yes)])
76764ce7165Smrg
76864ce7165Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
76964ce7165Smrg#
77064ce7165Smrg# This file is free software; the Free Software Foundation
77164ce7165Smrg# gives unlimited permission to copy and/or distribute it,
77264ce7165Smrg# with or without modifications, as long as this notice is preserved.
77364ce7165Smrg
77464ce7165Smrg# AM_PROG_INSTALL_STRIP
77564ce7165Smrg# ---------------------
77664ce7165Smrg# One issue with vendor `install' (even GNU) is that you can't
77764ce7165Smrg# specify the program used to strip binaries.  This is especially
77864ce7165Smrg# annoying in cross-compiling environments, where the build's strip
77964ce7165Smrg# is unlikely to handle the host's binaries.
78064ce7165Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
78164ce7165Smrg# always use install-sh in `make install-strip', and initialize
78264ce7165Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
78364ce7165SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
78464ce7165Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
78564ce7165Smrg# Installed binaries are usually stripped using `strip' when the user
78664ce7165Smrg# run `make install-strip'.  However `strip' might not be the right
78764ce7165Smrg# tool to use in cross-compilation environments, therefore Automake
78864ce7165Smrg# will honor the `STRIP' environment variable to overrule this program.
78964ce7165Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
79064ce7165Smrgif test "$cross_compiling" != no; then
79164ce7165Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
79264ce7165Smrgfi
79364ce7165SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
79464ce7165SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
79564ce7165Smrg
79664ce7165Smrg# Copyright (C) 2006  Free Software Foundation, Inc.
79764ce7165Smrg#
79864ce7165Smrg# This file is free software; the Free Software Foundation
79964ce7165Smrg# gives unlimited permission to copy and/or distribute it,
80064ce7165Smrg# with or without modifications, as long as this notice is preserved.
80164ce7165Smrg
80264ce7165Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
80364ce7165Smrg# ---------------------------
80464ce7165Smrg# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.
80564ce7165Smrg# This macro is traced by Automake.
80664ce7165SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
80764ce7165Smrg
80864ce7165Smrg# Check how to create a tarball.                            -*- Autoconf -*-
80964ce7165Smrg
81064ce7165Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
81164ce7165Smrg#
81264ce7165Smrg# This file is free software; the Free Software Foundation
81364ce7165Smrg# gives unlimited permission to copy and/or distribute it,
81464ce7165Smrg# with or without modifications, as long as this notice is preserved.
81564ce7165Smrg
81664ce7165Smrg# serial 2
81764ce7165Smrg
81864ce7165Smrg# _AM_PROG_TAR(FORMAT)
81964ce7165Smrg# --------------------
82064ce7165Smrg# Check how to create a tarball in format FORMAT.
82164ce7165Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
82264ce7165Smrg#
82364ce7165Smrg# Substitute a variable $(am__tar) that is a command
82464ce7165Smrg# writing to stdout a FORMAT-tarball containing the directory
82564ce7165Smrg# $tardir.
82664ce7165Smrg#     tardir=directory && $(am__tar) > result.tar
82764ce7165Smrg#
82864ce7165Smrg# Substitute a variable $(am__untar) that extract such
82964ce7165Smrg# a tarball read from stdin.
83064ce7165Smrg#     $(am__untar) < result.tar
83164ce7165SmrgAC_DEFUN([_AM_PROG_TAR],
83264ce7165Smrg[# Always define AMTAR for backward compatibility.
83364ce7165SmrgAM_MISSING_PROG([AMTAR], [tar])
83464ce7165Smrgm4_if([$1], [v7],
83564ce7165Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
83664ce7165Smrg     [m4_case([$1], [ustar],, [pax],,
83764ce7165Smrg              [m4_fatal([Unknown tar format])])
83864ce7165SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
83964ce7165Smrg# Loop over all known methods to create a tar archive until one works.
84064ce7165Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
84164ce7165Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
84264ce7165Smrg# Do not fold the above two line into one, because Tru64 sh and
84364ce7165Smrg# Solaris sh will not grok spaces in the rhs of `-'.
84464ce7165Smrgfor _am_tool in $_am_tools
84564ce7165Smrgdo
84664ce7165Smrg  case $_am_tool in
84764ce7165Smrg  gnutar)
84864ce7165Smrg    for _am_tar in tar gnutar gtar;
84964ce7165Smrg    do
85064ce7165Smrg      AM_RUN_LOG([$_am_tar --version]) && break
85164ce7165Smrg    done
85264ce7165Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
85364ce7165Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
85464ce7165Smrg    am__untar="$_am_tar -xf -"
85564ce7165Smrg    ;;
85664ce7165Smrg  plaintar)
85764ce7165Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
85864ce7165Smrg    # ustar tarball either.
85964ce7165Smrg    (tar --version) >/dev/null 2>&1 && continue
86064ce7165Smrg    am__tar='tar chf - "$$tardir"'
86164ce7165Smrg    am__tar_='tar chf - "$tardir"'
86264ce7165Smrg    am__untar='tar xf -'
86364ce7165Smrg    ;;
86464ce7165Smrg  pax)
86564ce7165Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
86664ce7165Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
86764ce7165Smrg    am__untar='pax -r'
86864ce7165Smrg    ;;
86964ce7165Smrg  cpio)
87064ce7165Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
87164ce7165Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
87264ce7165Smrg    am__untar='cpio -i -H $1 -d'
87364ce7165Smrg    ;;
87464ce7165Smrg  none)
87564ce7165Smrg    am__tar=false
87664ce7165Smrg    am__tar_=false
87764ce7165Smrg    am__untar=false
87864ce7165Smrg    ;;
87964ce7165Smrg  esac
88064ce7165Smrg
88164ce7165Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
88264ce7165Smrg  # and am__untar set.
88364ce7165Smrg  test -n "${am_cv_prog_tar_$1}" && break
88464ce7165Smrg
88564ce7165Smrg  # tar/untar a dummy directory, and stop if the command works
88664ce7165Smrg  rm -rf conftest.dir
88764ce7165Smrg  mkdir conftest.dir
88864ce7165Smrg  echo GrepMe > conftest.dir/file
88964ce7165Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
89064ce7165Smrg  rm -rf conftest.dir
89164ce7165Smrg  if test -s conftest.tar; then
89264ce7165Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
89364ce7165Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
89464ce7165Smrg  fi
89564ce7165Smrgdone
89664ce7165Smrgrm -rf conftest.dir
89764ce7165Smrg
89864ce7165SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
89964ce7165SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
90064ce7165SmrgAC_SUBST([am__tar])
90164ce7165SmrgAC_SUBST([am__untar])
90264ce7165Smrg]) # _AM_PROG_TAR
90364ce7165Smrg
90464ce7165Smrgdnl
90564ce7165Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
90664ce7165Smrgdnl 
90764ce7165Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
90864ce7165Smrgdnl copy of this software and associated documentation files (the
90964ce7165Smrgdnl "Software"), to deal in the Software without restriction, including
91064ce7165Smrgdnl without limitation the rights to use, copy, modify, merge, publish,
91164ce7165Smrgdnl distribute, and/or sell copies of the Software, and to permit persons
91264ce7165Smrgdnl to whom the Software is furnished to do so, provided that the above
91364ce7165Smrgdnl copyright notice(s) and this permission notice appear in all copies of
91464ce7165Smrgdnl the Software and that both the above copyright notice(s) and this
91564ce7165Smrgdnl permission notice appear in supporting documentation.
91664ce7165Smrgdnl
91764ce7165Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
91864ce7165Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
91964ce7165Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
92064ce7165Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
92164ce7165Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
92264ce7165Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
92364ce7165Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
92464ce7165Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
92564ce7165Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
92664ce7165Smrgdnl
92764ce7165Smrgdnl Except as contained in this notice, the name of a copyright holder
92864ce7165Smrgdnl shall not be used in advertising or otherwise to promote the sale, use
92964ce7165Smrgdnl or other dealings in this Software without prior written authorization
93064ce7165Smrgdnl of the copyright holder.
93164ce7165Smrg
93264ce7165Smrg# XORG_MACROS_VERSION(required-version)
93364ce7165Smrg# -------------------------------------
93464ce7165Smrg# Minimum version: 1.1.0
93564ce7165Smrg#
93664ce7165Smrg# If you're using a macro added in Version 1.1 or newer, include this in
93764ce7165Smrg# your configure.ac with the minimum required version, such as:
93864ce7165Smrg# XORG_MACROS_VERSION(1.1)
93964ce7165Smrg#
94064ce7165Smrg# To force at least a version with this macro defined, also add:
94164ce7165Smrg# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
94264ce7165Smrg#
94364ce7165Smrg#
94464ce7165Smrg# See the "minimum version" comment for each macro you use to see what 
94564ce7165Smrg# version you require.
94664ce7165SmrgAC_DEFUN([XORG_MACROS_VERSION],[
94764ce7165Smrg	[XORG_MACROS_needed_version=$1
94864ce7165Smrg	XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
94964ce7165Smrg	XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
95064ce7165Smrg	AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
95164ce7165Smrg	[XORG_MACROS_version=1.1.5
95264ce7165Smrg	XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
95364ce7165Smrg	XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
95464ce7165Smrg	if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
95564ce7165Smrg		AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x])
95664ce7165Smrg	fi
95764ce7165Smrg	if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
95864ce7165Smrg		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])
95964ce7165Smrg	fi
96064ce7165Smrg	AC_MSG_RESULT([yes, $XORG_MACROS_version])
96164ce7165Smrg]) # XORG_MACROS_VERSION
96264ce7165Smrg
96364ce7165Smrg# XORG_PROG_RAWCPP()
96464ce7165Smrg# ------------------
96564ce7165Smrg# Minimum version: 1.0.0
96664ce7165Smrg#
96764ce7165Smrg# Find cpp program and necessary flags for use in pre-processing text files
96864ce7165Smrg# such as man pages and config files
96964ce7165SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
97064ce7165SmrgAC_REQUIRE([AC_PROG_CPP])
97164ce7165SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
97264ce7165Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
97364ce7165Smrg
97464ce7165Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
97564ce7165Smrg# which is not the best choice for supporting other OS'es, but covers most
97664ce7165Smrg# of the ones we need for now.
97764ce7165SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
97864ce7165SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
97964ce7165Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
98064ce7165Smrg	AC_MSG_RESULT([no])
98164ce7165Smrgelse
98264ce7165Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
98364ce7165Smrg		RAWCPPFLAGS=-undef
98464ce7165Smrg		AC_MSG_RESULT([yes])
98564ce7165Smrg	else
98664ce7165Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
98764ce7165Smrg	fi
98864ce7165Smrgfi
98964ce7165Smrgrm -f conftest.$ac_ext
99064ce7165Smrg
99164ce7165SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
99264ce7165SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
99364ce7165Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
99464ce7165Smrg	AC_MSG_RESULT([no])
99564ce7165Smrgelse
99664ce7165Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
99764ce7165Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
99864ce7165Smrg		AC_MSG_RESULT([yes])
99964ce7165Smrg	else
100064ce7165Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
100164ce7165Smrg	fi
100264ce7165Smrgfi
100364ce7165Smrgrm -f conftest.$ac_ext
100464ce7165SmrgAC_SUBST(RAWCPPFLAGS)
100564ce7165Smrg]) # XORG_PROG_RAWCPP
100664ce7165Smrg
100764ce7165Smrg# XORG_MANPAGE_SECTIONS()
100864ce7165Smrg# -----------------------
100964ce7165Smrg# Minimum version: 1.0.0
101064ce7165Smrg#
101164ce7165Smrg# Determine which sections man pages go in for the different man page types
101264ce7165Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
101364ce7165Smrg# Not sure if there's any better way than just hardcoding by OS name.
101464ce7165Smrg# Override default settings by setting environment variables
101564ce7165Smrg
101664ce7165SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
101764ce7165SmrgAC_REQUIRE([AC_CANONICAL_HOST])
101864ce7165Smrg
101964ce7165Smrgif test x$APP_MAN_SUFFIX = x    ; then
102064ce7165Smrg    APP_MAN_SUFFIX=1
102164ce7165Smrgfi
102264ce7165Smrgif test x$APP_MAN_DIR = x    ; then
102364ce7165Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
102464ce7165Smrgfi
102564ce7165Smrg
102664ce7165Smrgif test x$LIB_MAN_SUFFIX = x    ; then
102764ce7165Smrg    LIB_MAN_SUFFIX=3
102864ce7165Smrgfi
102964ce7165Smrgif test x$LIB_MAN_DIR = x    ; then
103064ce7165Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
103164ce7165Smrgfi
103264ce7165Smrg
103364ce7165Smrgif test x$FILE_MAN_SUFFIX = x    ; then
103464ce7165Smrg    case $host_os in
103564ce7165Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
103664ce7165Smrg	*)		FILE_MAN_SUFFIX=5  ;;
103764ce7165Smrg    esac
103864ce7165Smrgfi
103964ce7165Smrgif test x$FILE_MAN_DIR = x    ; then
104064ce7165Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
104164ce7165Smrgfi
104264ce7165Smrg
104364ce7165Smrgif test x$MISC_MAN_SUFFIX = x    ; then
104464ce7165Smrg    case $host_os in
104564ce7165Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
104664ce7165Smrg	*)		MISC_MAN_SUFFIX=7  ;;
104764ce7165Smrg    esac
104864ce7165Smrgfi
104964ce7165Smrgif test x$MISC_MAN_DIR = x    ; then
105064ce7165Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
105164ce7165Smrgfi
105264ce7165Smrg
105364ce7165Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
105464ce7165Smrg    case $host_os in
105564ce7165Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
105664ce7165Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
105764ce7165Smrg    esac
105864ce7165Smrgfi
105964ce7165Smrgif test x$DRIVER_MAN_DIR = x    ; then
106064ce7165Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
106164ce7165Smrgfi
106264ce7165Smrg
106364ce7165Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
106464ce7165Smrg    case $host_os in
106564ce7165Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
106664ce7165Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
106764ce7165Smrg    esac
106864ce7165Smrgfi
106964ce7165Smrgif test x$ADMIN_MAN_DIR = x    ; then
107064ce7165Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
107164ce7165Smrgfi
107264ce7165Smrg
107364ce7165Smrg
107464ce7165SmrgAC_SUBST([APP_MAN_SUFFIX])
107564ce7165SmrgAC_SUBST([LIB_MAN_SUFFIX])
107664ce7165SmrgAC_SUBST([FILE_MAN_SUFFIX])
107764ce7165SmrgAC_SUBST([MISC_MAN_SUFFIX])
107864ce7165SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
107964ce7165SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
108064ce7165SmrgAC_SUBST([APP_MAN_DIR])
108164ce7165SmrgAC_SUBST([LIB_MAN_DIR])
108264ce7165SmrgAC_SUBST([FILE_MAN_DIR])
108364ce7165SmrgAC_SUBST([MISC_MAN_DIR])
108464ce7165SmrgAC_SUBST([DRIVER_MAN_DIR])
108564ce7165SmrgAC_SUBST([ADMIN_MAN_DIR])
108664ce7165Smrg]) # XORG_MANPAGE_SECTIONS
108764ce7165Smrg
108864ce7165Smrg# XORG_CHECK_LINUXDOC
108964ce7165Smrg# -------------------
109064ce7165Smrg# Minimum version: 1.0.0
109164ce7165Smrg#
109264ce7165Smrg# Defines the variable MAKE_TEXT if the necessary tools and
109364ce7165Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
109464ce7165Smrg# Whether or not the necessary tools and files are found can be checked
109564ce7165Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
109664ce7165SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
109764ce7165SmrgXORG_SGML_PATH=$prefix/share/sgml
109864ce7165SmrgHAVE_DEFS_ENT=
109964ce7165Smrg
110064ce7165SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
110164ce7165Smrg
110264ce7165SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
110364ce7165SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
110464ce7165Smrg
110564ce7165SmrgAC_MSG_CHECKING([Whether to build documentation])
110664ce7165Smrg
110764ce7165Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
110864ce7165Smrg   BUILDDOC=yes
110964ce7165Smrgelse
111064ce7165Smrg   BUILDDOC=no
111164ce7165Smrgfi
111264ce7165Smrg
111364ce7165SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
111464ce7165Smrg
111564ce7165SmrgAC_MSG_RESULT([$BUILDDOC])
111664ce7165Smrg
111764ce7165SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
111864ce7165Smrg
111964ce7165Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
112064ce7165Smrg   BUILDPDFDOC=yes
112164ce7165Smrgelse
112264ce7165Smrg   BUILDPDFDOC=no
112364ce7165Smrgfi
112464ce7165Smrg
112564ce7165SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
112664ce7165Smrg
112764ce7165SmrgAC_MSG_RESULT([$BUILDPDFDOC])
112864ce7165Smrg
112964ce7165SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
113064ce7165SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
113164ce7165SmrgMAKE_PDF="$PS2PDF"
113264ce7165SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
113364ce7165Smrg
113464ce7165SmrgAC_SUBST(MAKE_TEXT)
113564ce7165SmrgAC_SUBST(MAKE_PS)
113664ce7165SmrgAC_SUBST(MAKE_PDF)
113764ce7165SmrgAC_SUBST(MAKE_HTML)
113864ce7165Smrg]) # XORG_CHECK_LINUXDOC
113964ce7165Smrg
114064ce7165Smrg# XORG_CHECK_DOCBOOK
114164ce7165Smrg# -------------------
114264ce7165Smrg# Minimum version: 1.0.0
114364ce7165Smrg#
114464ce7165Smrg# Checks for the ability to build output formats from SGML DocBook source.
114564ce7165Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
114664ce7165Smrg# indicates whether the necessary tools and files are found and, if set,
114764ce7165Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
114864ce7165SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
114964ce7165SmrgXORG_SGML_PATH=$prefix/share/sgml
115064ce7165SmrgHAVE_DEFS_ENT=
115164ce7165SmrgBUILDTXTDOC=no
115264ce7165SmrgBUILDPDFDOC=no
115364ce7165SmrgBUILDPSDOC=no
115464ce7165SmrgBUILDHTMLDOC=no
115564ce7165Smrg
115664ce7165SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
115764ce7165Smrg
115864ce7165SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
115964ce7165SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
116064ce7165SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
116164ce7165SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
116264ce7165Smrg
116364ce7165SmrgAC_MSG_CHECKING([Whether to build text documentation])
116464ce7165Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
116564ce7165Smrg   test x$BUILD_TXTDOC != xno; then
116664ce7165Smrg	BUILDTXTDOC=yes
116764ce7165Smrgfi
116864ce7165SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
116964ce7165SmrgAC_MSG_RESULT([$BUILDTXTDOC])
117064ce7165Smrg
117164ce7165SmrgAC_MSG_CHECKING([Whether to build PDF documentation])
117264ce7165Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
117364ce7165Smrg   test x$BUILD_PDFDOC != xno; then
117464ce7165Smrg	BUILDPDFDOC=yes
117564ce7165Smrgfi
117664ce7165SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
117764ce7165SmrgAC_MSG_RESULT([$BUILDPDFDOC])
117864ce7165Smrg
117964ce7165SmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
118064ce7165Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
118164ce7165Smrg   test x$BUILD_PSDOC != xno; then
118264ce7165Smrg	BUILDPSDOC=yes
118364ce7165Smrgfi
118464ce7165SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
118564ce7165SmrgAC_MSG_RESULT([$BUILDPSDOC])
118664ce7165Smrg
118764ce7165SmrgAC_MSG_CHECKING([Whether to build HTML documentation])
118864ce7165Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
118964ce7165Smrg   test x$BUILD_HTMLDOC != xno; then
119064ce7165Smrg	BUILDHTMLDOC=yes
119164ce7165Smrgfi
119264ce7165SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
119364ce7165SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
119464ce7165Smrg
119564ce7165SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
119664ce7165SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
119764ce7165SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
119864ce7165SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
119964ce7165Smrg
120064ce7165SmrgAC_SUBST(MAKE_TEXT)
120164ce7165SmrgAC_SUBST(MAKE_PS)
120264ce7165SmrgAC_SUBST(MAKE_PDF)
120364ce7165SmrgAC_SUBST(MAKE_HTML)
120464ce7165Smrg]) # XORG_CHECK_DOCBOOK
120564ce7165Smrg
120664ce7165Smrg# XORG_CHECK_MALLOC_ZERO
120764ce7165Smrg# ----------------------
120864ce7165Smrg# Minimum version: 1.0.0
120964ce7165Smrg#
121064ce7165Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
121164ce7165Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
121264ce7165Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
121364ce7165SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
121464ce7165SmrgAC_ARG_ENABLE(malloc0returnsnull,
121564ce7165Smrg	AC_HELP_STRING([--enable-malloc0returnsnull],
121664ce7165Smrg		       [malloc(0) returns NULL (default: auto)]),
121764ce7165Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
121864ce7165Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
121964ce7165Smrg
122064ce7165SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
122164ce7165Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
122264ce7165Smrg	AC_RUN_IFELSE([
122364ce7165Smrgchar *malloc();
122464ce7165Smrgchar *realloc();
122564ce7165Smrgchar *calloc();
122664ce7165Smrgmain() {
122764ce7165Smrg    char *m0, *r0, *c0, *p;
122864ce7165Smrg    m0 = malloc(0);
122964ce7165Smrg    p = malloc(10);
123064ce7165Smrg    r0 = realloc(p,0);
123164ce7165Smrg    c0 = calloc(0);
123264ce7165Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
123364ce7165Smrg}],
123464ce7165Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
123564ce7165Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
123664ce7165Smrgfi
123764ce7165SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
123864ce7165Smrg
123964ce7165Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
124064ce7165Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
124164ce7165Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
124264ce7165Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
124364ce7165Smrgelse
124464ce7165Smrg	MALLOC_ZERO_CFLAGS=""
124564ce7165Smrg	XMALLOC_ZERO_CFLAGS=""
124664ce7165Smrg	XTMALLOC_ZERO_CFLAGS=""
124764ce7165Smrgfi
124864ce7165Smrg
124964ce7165SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
125064ce7165SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
125164ce7165SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
125264ce7165Smrg]) # XORG_CHECK_MALLOC_ZERO
125364ce7165Smrg
125464ce7165Smrg# XORG_WITH_LINT()
125564ce7165Smrg# ----------------
125664ce7165Smrg# Minimum version: 1.1.0
125764ce7165Smrg#
125864ce7165Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint
125964ce7165Smrg# is specified.   (Use --with-lint=sparse for sparse.)
126064ce7165Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
126164ce7165Smrg# Sets $LINT_FLAGS to flags to pass to source checker
126264ce7165Smrg# Sets LINT automake conditional if enabled (default: disabled)
126364ce7165Smrg#
126464ce7165SmrgAC_DEFUN([XORG_WITH_LINT],[
126564ce7165Smrg
126664ce7165Smrg# Allow checking code with lint, sparse, etc.
126764ce7165SmrgAC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
126864ce7165Smrg		[Use a lint-style source code checker (default: disabled)])],
126964ce7165Smrg		[use_lint=$withval], [use_lint=no])
127064ce7165Smrgif test "x$use_lint" = "xyes" ; then
127164ce7165Smrg	LINT="lint"
127264ce7165Smrgelse
127364ce7165Smrg	LINT="$use_lint"
127464ce7165Smrgfi
127564ce7165Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
127664ce7165Smrg    case $LINT in
127764ce7165Smrg	lint|*/lint)
127864ce7165Smrg	    case $host_os in
127964ce7165Smrg		solaris*)
128064ce7165Smrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
128164ce7165Smrg			;;
128264ce7165Smrg	    esac
128364ce7165Smrg	    ;;
128464ce7165Smrg    esac
128564ce7165Smrgfi
128664ce7165Smrg
128764ce7165SmrgAC_SUBST(LINT)
128864ce7165SmrgAC_SUBST(LINT_FLAGS)
128964ce7165SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
129064ce7165Smrg
129164ce7165Smrg]) # XORG_WITH_LINT
129264ce7165Smrg
129364ce7165Smrg# XORG_LINT_LIBRARY(LIBNAME)
129464ce7165Smrg# --------------------------
129564ce7165Smrg# Minimum version: 1.1.0
129664ce7165Smrg#
129764ce7165Smrg# Sets up flags for building lint libraries for checking programs that call
129864ce7165Smrg# functions in the library.
129964ce7165Smrg# Disabled by default, enable with --enable-lint-library
130064ce7165Smrg# Sets: 
130164ce7165Smrg#	@LINTLIB@		- name of lint library file to make
130264ce7165Smrg#	MAKE_LINT_LIB		- automake conditional
130364ce7165Smrg#
130464ce7165Smrg
130564ce7165SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
130664ce7165SmrgAC_REQUIRE([XORG_WITH_LINT])
130764ce7165Smrg# Build lint "library" for more indepth checks of programs calling this library
130864ce7165SmrgAC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
130964ce7165Smrg	[Create lint library (default: disabled)])],
131064ce7165Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
131164ce7165Smrgif test "x$make_lint_lib" != "xno" ; then
131264ce7165Smrg	if test "x$LINT" = "xno" ; then
131364ce7165Smrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
131464ce7165Smrg	fi
131564ce7165Smrg	if test "x$make_lint_lib" = "xyes" ; then
131664ce7165Smrg		LINTLIB=llib-l$1.ln
131764ce7165Smrg	else
131864ce7165Smrg		LINTLIB=$make_lint_lib
131964ce7165Smrg	fi
132064ce7165Smrgfi
132164ce7165SmrgAC_SUBST(LINTLIB)
132264ce7165SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
132364ce7165Smrg
132464ce7165Smrg]) # XORG_LINT_LIBRARY
132564ce7165Smrg
132664ce7165Smrgdnl Copyright 2005 Red Hat, Inc
132764ce7165Smrgdnl
132864ce7165Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
132964ce7165Smrgdnl documentation for any purpose is hereby granted without fee, provided that
133064ce7165Smrgdnl the above copyright notice appear in all copies and that both that
133164ce7165Smrgdnl copyright notice and this permission notice appear in supporting
133264ce7165Smrgdnl documentation.
133364ce7165Smrgdnl
133464ce7165Smrgdnl The above copyright notice and this permission notice shall be included
133564ce7165Smrgdnl in all copies or substantial portions of the Software.
133664ce7165Smrgdnl
133764ce7165Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
133864ce7165Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
133964ce7165Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
134064ce7165Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
134164ce7165Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
134264ce7165Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
134364ce7165Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
134464ce7165Smrgdnl
134564ce7165Smrgdnl Except as contained in this notice, the name of the copyright holders shall
134664ce7165Smrgdnl not be used in advertising or otherwise to promote the sale, use or
134764ce7165Smrgdnl other dealings in this Software without prior written authorization
134864ce7165Smrgdnl from the copyright holders.
134964ce7165Smrgdnl
135064ce7165Smrg
135164ce7165Smrg# XORG_RELEASE_VERSION
135264ce7165Smrg# --------------------
135364ce7165Smrg# Adds --with/without-release-string and changes the PACKAGE and
135464ce7165Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
135564ce7165Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
135664ce7165Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
135764ce7165Smrg 
135864ce7165SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
135964ce7165Smrg	AC_ARG_WITH(release-version,
136064ce7165Smrg			AC_HELP_STRING([--with-release-version=STRING],
136164ce7165Smrg				[Use release version string in package name]),
136264ce7165Smrg			[RELEASE_VERSION="$withval"],
136364ce7165Smrg			[RELEASE_VERSION=""])
136464ce7165Smrg	if test "x$RELEASE_VERSION" != "x"; then
136564ce7165Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
136664ce7165Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
136764ce7165Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
136864ce7165Smrg	fi
136964ce7165Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
137064ce7165Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
137164ce7165Smrg		[Major version of this package])
137264ce7165Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2`
137364ce7165Smrg	if test "x$PVM" = "x"; then
137464ce7165Smrg		PVM="0"
137564ce7165Smrg	fi
137664ce7165Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
137764ce7165Smrg		[$PVM],
137864ce7165Smrg		[Minor version of this package])
137964ce7165Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3`
138064ce7165Smrg	if test "x$PVP" = "x"; then
138164ce7165Smrg		PVP="0"
138264ce7165Smrg	fi
138364ce7165Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
138464ce7165Smrg		[$PVP],
138564ce7165Smrg		[Patch version of this package])
138664ce7165Smrg])
138764ce7165Smrg
138864ce7165Smrgdnl $XdotOrg: lib/xtrans/xtrans.m4,v 1.6 2005/07/26 18:59:11 alanc Exp $
138964ce7165Smrgdnl
139064ce7165Smrgdnl Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
139164ce7165Smrgdnl 
139264ce7165Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
139364ce7165Smrgdnl documentation for any purpose is hereby granted without fee, provided that
139464ce7165Smrgdnl the above copyright notice appear in all copies and that both that
139564ce7165Smrgdnl copyright notice and this permission notice appear in supporting
139664ce7165Smrgdnl documentation.
139764ce7165Smrgdnl 
139864ce7165Smrgdnl The above copyright notice and this permission notice shall be included
139964ce7165Smrgdnl in all copies or substantial portions of the Software.
140064ce7165Smrgdnl 
140164ce7165Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
140264ce7165Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
140364ce7165Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
140464ce7165Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
140564ce7165Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
140664ce7165Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
140764ce7165Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
140864ce7165Smrgdnl 
140964ce7165Smrgdnl Except as contained in this notice, the name of the copyright holders shall
141064ce7165Smrgdnl not be used in advertising or otherwise to promote the sale, use or
141164ce7165Smrgdnl other dealings in this Software without prior written authorization
141264ce7165Smrgdnl from the copyright holders.
141364ce7165Smrgdnl 
141464ce7165Smrg
141564ce7165Smrg# XTRANS_TCP_FLAGS()
141664ce7165Smrg# ------------------
141764ce7165Smrg# Find needed libraries for TCP sockets, and check for IPv6 support
141864ce7165SmrgAC_DEFUN([XTRANS_TCP_FLAGS],[
141964ce7165Smrg # SVR4 hides these in libraries other than libc
142064ce7165Smrg AC_SEARCH_LIBS(socket, [socket])
142164ce7165Smrg AC_SEARCH_LIBS(gethostbyname, [nsl])
142264ce7165Smrg
142364ce7165Smrg # Needs to come after above checks for libsocket & libnsl for SVR4 systems
142464ce7165Smrg AC_ARG_ENABLE(ipv6, 
142564ce7165Smrg	AC_HELP_STRING([--enable-IPv6],[Enable IPv6 support]),
142664ce7165Smrg	[IPV6CONN=$enableval], 
142764ce7165Smrg	[AC_CHECK_FUNC(getaddrinfo,[IPV6CONN=yes],[IPV6CONN=no])])
142864ce7165Smrg AC_MSG_CHECKING([if IPv6 support should be built])
142964ce7165Smrg if test "$IPV6CONN" = "yes"; then
143064ce7165Smrg	AC_DEFINE(IPv6,1,[Support IPv6 for TCP connections])
143164ce7165Smrg fi
143264ce7165Smrg AC_MSG_RESULT($IPV6CONN)
143364ce7165Smrg
143464ce7165Smrg # 4.3BSD-Reno added a new member to struct sockaddr_in
143564ce7165Smrg AC_CHECK_MEMBER([struct sockaddr_in.sin_len], 
143664ce7165Smrg	AC_DEFINE([BSD44SOCKETS],1,
143764ce7165Smrg 	    [Define to 1 if `struct sockaddr_in' has a `sin_len' member]), [], [
143864ce7165Smrg#include <sys/types.h>
143964ce7165Smrg#include <sys/socket.h>
144064ce7165Smrg#include <netinet/in.h>
144164ce7165Smrg ])
144264ce7165Smrg]) # XTRANS_TCP_FLAGS
144364ce7165Smrg
144464ce7165Smrg# XTRANS_CONNECTION_FLAGS()
144564ce7165Smrg# -------------------------
144664ce7165Smrg# Standard checks for which Xtrans transports to use by the Xorg packages
144764ce7165Smrg# that use Xtrans functions
144864ce7165SmrgAC_DEFUN([XTRANS_CONNECTION_FLAGS],[
144964ce7165Smrg AC_REQUIRE([AC_CANONICAL_HOST])
145064ce7165Smrg AC_REQUIRE([AC_TYPE_SIGNAL])
145164ce7165Smrg AC_ARG_ENABLE(unix-transport,
145264ce7165Smrg	AC_HELP_STRING([--enable-unix-transport],[Enable UNIX domain socket transport]),
145364ce7165Smrg	[UNIXCONN=$enableval], [UNIXCONN=yes])
145464ce7165Smrg AC_ARG_ENABLE(tcp-transport, 
145564ce7165Smrg	AC_HELP_STRING([--enable-tcp-transport],[Enable TCP socket transport]),
145664ce7165Smrg	[TCPCONN=$enableval], [TCPCONN=yes])
145764ce7165Smrg AC_MSG_CHECKING([if Xtrans should support UNIX socket connections])
145864ce7165Smrg if test "$UNIXCONN" = "yes"; then
145964ce7165Smrg	AC_DEFINE(UNIXCONN,1,[Support UNIX socket connections])
146064ce7165Smrg fi
146164ce7165Smrg AC_MSG_RESULT($UNIXCONN)
146264ce7165Smrg AC_MSG_CHECKING([if Xtrans should support TCP socket connections])
146364ce7165Smrg AC_MSG_RESULT($TCPCONN)
146464ce7165Smrg if test "$TCPCONN" = "yes"; then
146564ce7165Smrg	AC_DEFINE(TCPCONN,1,[Support TCP socket connections])
146664ce7165Smrg	XTRANS_TCP_FLAGS
146764ce7165Smrg fi
146864ce7165Smrg [case $host_os in
146964ce7165Smrg	solaris*|sco*|sysv4*)	localdef="yes" ;;
147064ce7165Smrg	*)			localdef="no"  ;;
147164ce7165Smrg esac]
147264ce7165Smrg AC_ARG_ENABLE(local-transport,
147364ce7165Smrg	AC_HELP_STRING([--enable-local-transport],[Enable os-specific local transport]),
147464ce7165Smrg	[LOCALCONN=$enableval], [LOCALCONN=$localdef])
147564ce7165Smrg AC_MSG_CHECKING([if Xtrans should support os-specific local connections])
147664ce7165Smrg AC_MSG_RESULT($LOCALCONN)
147764ce7165Smrg if test "$LOCALCONN" = "yes"; then
147864ce7165Smrg	AC_DEFINE(LOCALCONN,1,[Support os-specific local connections])
147964ce7165Smrg fi
148064ce7165Smrg 
148164ce7165Smrg]) # XTRANS_CONNECTION_FLAGS
148264ce7165Smrg
148364ce7165Smrg
148464ce7165Smrg# XTRANS_SECURE_RPC_FLAGS()
148564ce7165Smrg# -------------------------
148664ce7165Smrg# Check for Secure RPC functions - must come after XTRANS_TCP_FLAGS
148764ce7165Smrg# so that any necessary networking libraries are already found
148864ce7165SmrgAC_DEFUN([XTRANS_SECURE_RPC_FLAGS],
148964ce7165Smrg[AC_REQUIRE([XTRANS_TCP_FLAGS])
149064ce7165Smrg AC_ARG_ENABLE(secure-rpc, 
149164ce7165Smrg	AC_HELP_STRING([--enable-secure-rpc],[Enable Secure RPC]),
149264ce7165Smrg        [SECURE_RPC=$enableval], [SECURE_RPC="try"])
149364ce7165Smrg
149464ce7165Smrg if test "x$SECURE_RPC" = "xyes" -o "x$SECURE_RPC" = "xtry" ; then
149564ce7165Smrg	FOUND_SECURE_RPC="no"
149664ce7165Smrg	AC_CHECK_FUNCS([authdes_seccreate authdes_create],
149764ce7165Smrg			[FOUND_SECURE_RPC="yes"])
149864ce7165Smrg	if test "x$FOUND_SECURE_RPC" = "xno" ; then
149964ce7165Smrg		if test "x$SECURE_RPC" = "xyes" ; then
150064ce7165Smrg	AC_MSG_ERROR([Secure RPC requested, but required functions not found])
150164ce7165Smrg		fi	
150264ce7165Smrg		SECURE_RPC="no"
150364ce7165Smrg	else
150464ce7165Smrg		dnl FreeBSD keeps getsecretkey in librpcsvc
150564ce7165Smrg		AC_SEARCH_LIBS(getsecretkey, [rpcsvc])
150664ce7165Smrg		SECURE_RPC="yes"
150764ce7165Smrg	fi
150864ce7165Smrg fi
150964ce7165Smrg AC_MSG_CHECKING([if Secure RPC authentication ("SUN-DES-1") should be supported])
151064ce7165Smrg if test "x$SECURE_RPC" = "xyes" ; then
151164ce7165Smrg	AC_DEFINE(SECURE_RPC, 1, [Support Secure RPC ("SUN-DES-1") authentication for X11 clients])
151264ce7165Smrg fi
151364ce7165Smrg AC_MSG_RESULT($SECURE_RPC)
151464ce7165Smrg]) # XTRANS_SECURE_RPC_FLAGS
151564ce7165Smrg
151664ce7165Smrg
151764ce7165Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
151864ce7165Smrg# 
151964ce7165Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
152064ce7165Smrg#
152164ce7165Smrg# This program is free software; you can redistribute it and/or modify
152264ce7165Smrg# it under the terms of the GNU General Public License as published by
152364ce7165Smrg# the Free Software Foundation; either version 2 of the License, or
152464ce7165Smrg# (at your option) any later version.
152564ce7165Smrg#
152664ce7165Smrg# This program is distributed in the hope that it will be useful, but
152764ce7165Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
152864ce7165Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
152964ce7165Smrg# General Public License for more details.
153064ce7165Smrg#
153164ce7165Smrg# You should have received a copy of the GNU General Public License
153264ce7165Smrg# along with this program; if not, write to the Free Software
153364ce7165Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
153464ce7165Smrg#
153564ce7165Smrg# As a special exception to the GNU General Public License, if you
153664ce7165Smrg# distribute this file as part of a program that contains a
153764ce7165Smrg# configuration script generated by Autoconf, you may include it under
153864ce7165Smrg# the same distribution terms that you use for the rest of that program.
153964ce7165Smrg
154064ce7165Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
154164ce7165Smrg# ----------------------------------
154264ce7165SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
154364ce7165Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
154464ce7165Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
154564ce7165SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
154664ce7165Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
154764ce7165Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
154864ce7165Smrgfi
154964ce7165Smrgif test -n "$PKG_CONFIG"; then
155064ce7165Smrg	_pkg_min_version=m4_ifval([$1], [$1], [0.9.0])
155164ce7165Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
155264ce7165Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
155364ce7165Smrg		AC_MSG_RESULT([yes])
155464ce7165Smrg	else
155564ce7165Smrg		AC_MSG_RESULT([no])
155664ce7165Smrg		PKG_CONFIG=""
155764ce7165Smrg	fi
155864ce7165Smrg		
155964ce7165Smrgfi[]dnl
156064ce7165Smrg])# PKG_PROG_PKG_CONFIG
156164ce7165Smrg
156264ce7165Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
156364ce7165Smrg#
156464ce7165Smrg# Check to see whether a particular set of modules exists.  Similar
156564ce7165Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
156664ce7165Smrg#
156764ce7165Smrg#
156864ce7165Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
156964ce7165Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
157064ce7165Smrg# PKG_CHECK_EXISTS manually
157164ce7165Smrg# --------------------------------------------------------------
157264ce7165SmrgAC_DEFUN([PKG_CHECK_EXISTS],
157364ce7165Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
157464ce7165Smrgif test -n "$PKG_CONFIG" && \
157564ce7165Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
157664ce7165Smrg  m4_ifval([$2], [$2], [:])
157764ce7165Smrgm4_ifvaln([$3], [else
157864ce7165Smrg  $3])dnl
157964ce7165Smrgfi])
158064ce7165Smrg
158164ce7165Smrg
158264ce7165Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
158364ce7165Smrg# ---------------------------------------------
158464ce7165Smrgm4_define([_PKG_CONFIG],
158564ce7165Smrg[if test -n "$PKG_CONFIG"; then
158664ce7165Smrg        PKG_CHECK_EXISTS([$3],
158764ce7165Smrg                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
158864ce7165Smrg			 [pkg_failed=yes])
158964ce7165Smrgelse
159064ce7165Smrg	pkg_failed=untried
159164ce7165Smrgfi[]dnl
159264ce7165Smrg])# _PKG_CONFIG
159364ce7165Smrg
159464ce7165Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
159564ce7165Smrg# [ACTION-IF-NOT-FOUND])
159664ce7165Smrg#
159764ce7165Smrg#
159864ce7165Smrg# Note that if there is a possibility the first call to
159964ce7165Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
160064ce7165Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
160164ce7165Smrg#
160264ce7165Smrg#
160364ce7165Smrg# --------------------------------------------------------------
160464ce7165SmrgAC_DEFUN([PKG_CHECK_MODULES],
160564ce7165Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
160664ce7165SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
160764ce7165SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
160864ce7165Smrg
160964ce7165Smrgpkg_failed=no
161064ce7165SmrgAC_MSG_CHECKING([for $1])
161164ce7165Smrg
161264ce7165Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
161364ce7165Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
161464ce7165Smrg
161564ce7165Smrgif test $pkg_failed = yes; then
161664ce7165Smrg	$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
161764ce7165Smrg	# Put the nasty error message in config.log where it belongs
161864ce7165Smrg	echo "$$1[]_PKG_ERRORS" 1>&AS_MESSAGE_LOG_FD
161964ce7165Smrg
162064ce7165Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
162164ce7165Smrg[Package requirements ($2) were not met.
162264ce7165SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
162364ce7165Smrginstalled software in a non-standard prefix.
162464ce7165Smrg
162564ce7165SmrgAlternatively you may set the $1_CFLAGS and $1_LIBS environment variables
162664ce7165Smrgto avoid the need to call pkg-config.  See the pkg-config man page for
162764ce7165Smrgmore details.])],
162864ce7165Smrg		[$4])
162964ce7165Smrgelif test $pkg_failed = untried; then
163064ce7165Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
163164ce7165Smrg[The pkg-config script could not be found or is too old.  Make sure it
163264ce7165Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
163364ce7165Smrgpath to pkg-config.
163464ce7165Smrg
163564ce7165SmrgAlternatively you may set the $1_CFLAGS and $1_LIBS environment variables
163664ce7165Smrgto avoid the need to call pkg-config.  See the pkg-config man page for
163764ce7165Smrgmore details.
163864ce7165Smrg
163964ce7165SmrgTo get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
164064ce7165Smrg		[$4])
164164ce7165Smrgelse
164264ce7165Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
164364ce7165Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
164464ce7165Smrg        AC_MSG_RESULT([yes])
164564ce7165Smrg	ifelse([$3], , :, [$3])
164664ce7165Smrgfi[]dnl
164764ce7165Smrg])# PKG_CHECK_MODULES
164864ce7165Smrg
1649