aclocal.m4 revision 30f8ce46
130f8ce46Smrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
2bbe1b32bSmrg
3bbe1b32bSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
430f8ce46Smrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5bbe1b32bSmrg# This file is free software; the Free Software Foundation
6bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
7bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
8bbe1b32bSmrg
9bbe1b32bSmrg# This program is distributed in the hope that it will be useful,
10bbe1b32bSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11bbe1b32bSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12bbe1b32bSmrg# PARTICULAR PURPOSE.
13bbe1b32bSmrg
1430f8ce46Smrgm4_ifndef([AC_AUTOCONF_VERSION],
1530f8ce46Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1630f8ce46Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
1730f8ce46Smrg[m4_warning([this file was generated for autoconf 2.68.
1830f8ce46SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
1930f8ce46SmrgIf you have problems, you may need to regenerate the build system entirely.
2030f8ce46SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21bbe1b32bSmrg
2230f8ce46Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
23ce6676dbSmrg#
24ce6676dbSmrg# This file is free software; the Free Software Foundation
25ce6676dbSmrg# gives unlimited permission to copy and/or distribute it,
26ce6676dbSmrg# with or without modifications, as long as this notice is preserved.
27bbe1b32bSmrg
28ce6676dbSmrg# AM_AUTOMAKE_VERSION(VERSION)
29ce6676dbSmrg# ----------------------------
30ce6676dbSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
31ce6676dbSmrg# generated from the m4 files accompanying Automake X.Y.
32ce6676dbSmrg# (This private macro should not be called outside this file.)
33ce6676dbSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
3430f8ce46Smrg[am__api_version='1.11'
35ce6676dbSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
36ce6676dbSmrgdnl require some minimum version.  Point them to the right macro.
3730f8ce46Smrgm4_if([$1], [1.11.1], [],
38ce6676dbSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
39ce6676dbSmrg])
40bbe1b32bSmrg
41ce6676dbSmrg# _AM_AUTOCONF_VERSION(VERSION)
42ce6676dbSmrg# -----------------------------
43ce6676dbSmrg# aclocal traces this macro to find the Autoconf version.
44ce6676dbSmrg# This is a private macro too.  Using m4_define simplifies
45ce6676dbSmrg# the logic in aclocal, which can simply ignore this definition.
46ce6676dbSmrgm4_define([_AM_AUTOCONF_VERSION], [])
47bbe1b32bSmrg
48ce6676dbSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
49ce6676dbSmrg# -------------------------------
50ce6676dbSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
5130f8ce46Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
52ce6676dbSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
5330f8ce46Smrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
5430f8ce46Smrgm4_ifndef([AC_AUTOCONF_VERSION],
5530f8ce46Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
5630f8ce46Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
57bbe1b32bSmrg
58ce6676dbSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
59bbe1b32bSmrg
60bbe1b32bSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
61bbe1b32bSmrg#
62bbe1b32bSmrg# This file is free software; the Free Software Foundation
63bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
64bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
65bbe1b32bSmrg
66bbe1b32bSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
67bbe1b32bSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
68bbe1b32bSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
69bbe1b32bSmrg#
70bbe1b32bSmrg# Of course, Automake must honor this variable whenever it calls a
71bbe1b32bSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
72bbe1b32bSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
73bbe1b32bSmrg# depending on how configure is run.  This is pretty annoying, since
74bbe1b32bSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
75bbe1b32bSmrg# source directory, any form will work fine, but in subdirectories a
76bbe1b32bSmrg# relative path needs to be adjusted first.
77bbe1b32bSmrg#
78bbe1b32bSmrg# $ac_aux_dir/missing
79bbe1b32bSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
80bbe1b32bSmrg# $top_srcdir/$ac_aux_dir/missing
81bbe1b32bSmrg#    fails if $ac_aux_dir is absolute,
82bbe1b32bSmrg#    fails when called from a subdirectory in a VPATH build with
83bbe1b32bSmrg#          a relative $ac_aux_dir
84bbe1b32bSmrg#
85bbe1b32bSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
86bbe1b32bSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
87bbe1b32bSmrg# harmless because $srcdir is `.', but things will broke when you
88bbe1b32bSmrg# start a VPATH build or use an absolute $srcdir.
89bbe1b32bSmrg#
90bbe1b32bSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
91bbe1b32bSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
92bbe1b32bSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
93bbe1b32bSmrg# and then we would define $MISSING as
94bbe1b32bSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
95bbe1b32bSmrg# This will work as long as MISSING is not called from configure, because
96bbe1b32bSmrg# unfortunately $(top_srcdir) has no meaning in configure.
97bbe1b32bSmrg# However there are other variables, like CC, which are often used in
98bbe1b32bSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
99bbe1b32bSmrg#
100bbe1b32bSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
101bbe1b32bSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
102bbe1b32bSmrg# configured tree to be moved without reconfiguration.
103bbe1b32bSmrg
104bbe1b32bSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
105bbe1b32bSmrg[dnl Rely on autoconf to set up CDPATH properly.
106bbe1b32bSmrgAC_PREREQ([2.50])dnl
107bbe1b32bSmrg# expand $ac_aux_dir to an absolute path
108bbe1b32bSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
109bbe1b32bSmrg])
110bbe1b32bSmrg
111bbe1b32bSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
112bbe1b32bSmrg
11330f8ce46Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
114bbe1b32bSmrg# Free Software Foundation, Inc.
115bbe1b32bSmrg#
116bbe1b32bSmrg# This file is free software; the Free Software Foundation
117bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
118bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
119bbe1b32bSmrg
12030f8ce46Smrg# serial 9
121bbe1b32bSmrg
122bbe1b32bSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
123bbe1b32bSmrg# -------------------------------------
124bbe1b32bSmrg# Define a conditional.
125bbe1b32bSmrgAC_DEFUN([AM_CONDITIONAL],
126bbe1b32bSmrg[AC_PREREQ(2.52)dnl
127bbe1b32bSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
128bbe1b32bSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
129bbe1b32bSmrgAC_SUBST([$1_TRUE])dnl
130bbe1b32bSmrgAC_SUBST([$1_FALSE])dnl
131bbe1b32bSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
132bbe1b32bSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
13330f8ce46Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
134bbe1b32bSmrgif $2; then
135bbe1b32bSmrg  $1_TRUE=
136bbe1b32bSmrg  $1_FALSE='#'
137bbe1b32bSmrgelse
138bbe1b32bSmrg  $1_TRUE='#'
139bbe1b32bSmrg  $1_FALSE=
140bbe1b32bSmrgfi
141bbe1b32bSmrgAC_CONFIG_COMMANDS_PRE(
142bbe1b32bSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
143bbe1b32bSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
144bbe1b32bSmrgUsually this means the macro was only invoked conditionally.]])
145bbe1b32bSmrgfi])])
146bbe1b32bSmrg
14730f8ce46Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
148bbe1b32bSmrg# Free Software Foundation, Inc.
149bbe1b32bSmrg#
150bbe1b32bSmrg# This file is free software; the Free Software Foundation
151bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
152bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
153bbe1b32bSmrg
15430f8ce46Smrg# serial 10
155bbe1b32bSmrg
156bbe1b32bSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
157bbe1b32bSmrg# written in clear, in which case automake, when reading aclocal.m4,
158bbe1b32bSmrg# will think it sees a *use*, and therefore will trigger all it's
159bbe1b32bSmrg# C support machinery.  Also note that it means that autoscan, seeing
160bbe1b32bSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
161bbe1b32bSmrg
162bbe1b32bSmrg
163bbe1b32bSmrg# _AM_DEPENDENCIES(NAME)
164bbe1b32bSmrg# ----------------------
165bbe1b32bSmrg# See how the compiler implements dependency checking.
166bbe1b32bSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
167bbe1b32bSmrg# We try a few techniques and use that to set a single cache variable.
168bbe1b32bSmrg#
169bbe1b32bSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
170bbe1b32bSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
171bbe1b32bSmrg# dependency, and given that the user is not expected to run this macro,
172bbe1b32bSmrg# just rely on AC_PROG_CC.
173bbe1b32bSmrgAC_DEFUN([_AM_DEPENDENCIES],
174bbe1b32bSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
175bbe1b32bSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
176bbe1b32bSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
177bbe1b32bSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
178bbe1b32bSmrg
179bbe1b32bSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
180bbe1b32bSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
181bbe1b32bSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
182bbe1b32bSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
183bbe1b32bSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
184bbe1b32bSmrg                   [depcc="$$1"   am_compiler_list=])
185bbe1b32bSmrg
186bbe1b32bSmrgAC_CACHE_CHECK([dependency style of $depcc],
187bbe1b32bSmrg               [am_cv_$1_dependencies_compiler_type],
188bbe1b32bSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
189bbe1b32bSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
190bbe1b32bSmrg  # making bogus files that we don't know about and never remove.  For
191bbe1b32bSmrg  # instance it was reported that on HP-UX the gcc test will end up
192bbe1b32bSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
193bbe1b32bSmrg  # in D'.
194bbe1b32bSmrg  mkdir conftest.dir
195bbe1b32bSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
196bbe1b32bSmrg  # using a relative directory.
197bbe1b32bSmrg  cp "$am_depcomp" conftest.dir
198bbe1b32bSmrg  cd conftest.dir
199bbe1b32bSmrg  # We will build objects and dependencies in a subdirectory because
200bbe1b32bSmrg  # it helps to detect inapplicable dependency modes.  For instance
201bbe1b32bSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
202bbe1b32bSmrg  # side effect of compilation, but ICC will put the dependencies in
203bbe1b32bSmrg  # the current directory while Tru64 will put them in the object
204bbe1b32bSmrg  # directory.
205bbe1b32bSmrg  mkdir sub
206bbe1b32bSmrg
207bbe1b32bSmrg  am_cv_$1_dependencies_compiler_type=none
208bbe1b32bSmrg  if test "$am_compiler_list" = ""; then
209bbe1b32bSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
210bbe1b32bSmrg  fi
21130f8ce46Smrg  am__universal=false
21230f8ce46Smrg  m4_case([$1], [CC],
21330f8ce46Smrg    [case " $depcc " in #(
21430f8ce46Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
21530f8ce46Smrg     esac],
21630f8ce46Smrg    [CXX],
21730f8ce46Smrg    [case " $depcc " in #(
21830f8ce46Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
21930f8ce46Smrg     esac])
22030f8ce46Smrg
221bbe1b32bSmrg  for depmode in $am_compiler_list; do
222bbe1b32bSmrg    # Setup a source with many dependencies, because some compilers
223bbe1b32bSmrg    # like to wrap large dependency lists on column 80 (with \), and
224bbe1b32bSmrg    # we should not choose a depcomp mode which is confused by this.
225bbe1b32bSmrg    #
226bbe1b32bSmrg    # We need to recreate these files for each test, as the compiler may
227bbe1b32bSmrg    # overwrite some of them when testing with obscure command lines.
228bbe1b32bSmrg    # This happens at least with the AIX C compiler.
229bbe1b32bSmrg    : > sub/conftest.c
230bbe1b32bSmrg    for i in 1 2 3 4 5 6; do
231bbe1b32bSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
232bbe1b32bSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
233bbe1b32bSmrg      # Solaris 8's {/usr,}/bin/sh.
234bbe1b32bSmrg      touch sub/conftst$i.h
235bbe1b32bSmrg    done
236bbe1b32bSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
237bbe1b32bSmrg
23830f8ce46Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
23930f8ce46Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
24030f8ce46Smrg    # handle `-M -o', and we need to detect this.  Also, some Intel
24130f8ce46Smrg    # versions had trouble with output in subdirs
24230f8ce46Smrg    am__obj=sub/conftest.${OBJEXT-o}
24330f8ce46Smrg    am__minus_obj="-o $am__obj"
244bbe1b32bSmrg    case $depmode in
24530f8ce46Smrg    gcc)
24630f8ce46Smrg      # This depmode causes a compiler race in universal mode.
24730f8ce46Smrg      test "$am__universal" = false || continue
24830f8ce46Smrg      ;;
249bbe1b32bSmrg    nosideeffect)
250bbe1b32bSmrg      # after this tag, mechanisms are not by side-effect, so they'll
251bbe1b32bSmrg      # only be used when explicitly requested
252bbe1b32bSmrg      if test "x$enable_dependency_tracking" = xyes; then
253bbe1b32bSmrg	continue
254bbe1b32bSmrg      else
255bbe1b32bSmrg	break
256bbe1b32bSmrg      fi
257bbe1b32bSmrg      ;;
25830f8ce46Smrg    msvisualcpp | msvcmsys)
25930f8ce46Smrg      # This compiler won't grok `-c -o', but also, the minuso test has
26030f8ce46Smrg      # not run yet.  These depmodes are late enough in the game, and
26130f8ce46Smrg      # so weak that their functioning should not be impacted.
26230f8ce46Smrg      am__obj=conftest.${OBJEXT-o}
26330f8ce46Smrg      am__minus_obj=
26430f8ce46Smrg      ;;
265bbe1b32bSmrg    none) break ;;
266bbe1b32bSmrg    esac
267bbe1b32bSmrg    if depmode=$depmode \
26830f8ce46Smrg       source=sub/conftest.c object=$am__obj \
269bbe1b32bSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
27030f8ce46Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
271bbe1b32bSmrg         >/dev/null 2>conftest.err &&
272bbe1b32bSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
273bbe1b32bSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
27430f8ce46Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
275bbe1b32bSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
276bbe1b32bSmrg      # icc doesn't choke on unknown options, it will just issue warnings
277bbe1b32bSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
278bbe1b32bSmrg      # that says an option was ignored or not supported.
279bbe1b32bSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
280bbe1b32bSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
281bbe1b32bSmrg      # The diagnosis changed in icc 8.0:
282bbe1b32bSmrg      #   icc: Command line remark: option '-MP' not supported
283bbe1b32bSmrg      if (grep 'ignoring option' conftest.err ||
284bbe1b32bSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
285bbe1b32bSmrg        am_cv_$1_dependencies_compiler_type=$depmode
286bbe1b32bSmrg        break
287bbe1b32bSmrg      fi
288bbe1b32bSmrg    fi
289bbe1b32bSmrg  done
290bbe1b32bSmrg
291bbe1b32bSmrg  cd ..
292bbe1b32bSmrg  rm -rf conftest.dir
293bbe1b32bSmrgelse
294bbe1b32bSmrg  am_cv_$1_dependencies_compiler_type=none
295bbe1b32bSmrgfi
296bbe1b32bSmrg])
297bbe1b32bSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
298bbe1b32bSmrgAM_CONDITIONAL([am__fastdep$1], [
299bbe1b32bSmrg  test "x$enable_dependency_tracking" != xno \
300bbe1b32bSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
301bbe1b32bSmrg])
302bbe1b32bSmrg
303bbe1b32bSmrg
304bbe1b32bSmrg# AM_SET_DEPDIR
305bbe1b32bSmrg# -------------
306bbe1b32bSmrg# Choose a directory name for dependency files.
307bbe1b32bSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
308bbe1b32bSmrgAC_DEFUN([AM_SET_DEPDIR],
309bbe1b32bSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
310bbe1b32bSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
311bbe1b32bSmrg])
312bbe1b32bSmrg
313bbe1b32bSmrg
314bbe1b32bSmrg# AM_DEP_TRACK
315bbe1b32bSmrg# ------------
316bbe1b32bSmrgAC_DEFUN([AM_DEP_TRACK],
317bbe1b32bSmrg[AC_ARG_ENABLE(dependency-tracking,
318bbe1b32bSmrg[  --disable-dependency-tracking  speeds up one-time build
319bbe1b32bSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
320bbe1b32bSmrgif test "x$enable_dependency_tracking" != xno; then
321bbe1b32bSmrg  am_depcomp="$ac_aux_dir/depcomp"
322bbe1b32bSmrg  AMDEPBACKSLASH='\'
323bbe1b32bSmrgfi
324bbe1b32bSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
325bbe1b32bSmrgAC_SUBST([AMDEPBACKSLASH])dnl
326bbe1b32bSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
327bbe1b32bSmrg])
328bbe1b32bSmrg
329bbe1b32bSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
330bbe1b32bSmrg
33130f8ce46Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
332bbe1b32bSmrg# Free Software Foundation, Inc.
333bbe1b32bSmrg#
334bbe1b32bSmrg# This file is free software; the Free Software Foundation
335bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
336bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
337bbe1b32bSmrg
33830f8ce46Smrg#serial 5
339bbe1b32bSmrg
340bbe1b32bSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
341bbe1b32bSmrg# ------------------------------
342bbe1b32bSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
34330f8ce46Smrg[{
34430f8ce46Smrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
34530f8ce46Smrg  # are listed without --file.  Let's play safe and only enable the eval
34630f8ce46Smrg  # if we detect the quoting.
34730f8ce46Smrg  case $CONFIG_FILES in
34830f8ce46Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
34930f8ce46Smrg  *)   set x $CONFIG_FILES ;;
35030f8ce46Smrg  esac
35130f8ce46Smrg  shift
35230f8ce46Smrg  for mf
35330f8ce46Smrg  do
35430f8ce46Smrg    # Strip MF so we end up with the name of the file.
35530f8ce46Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
35630f8ce46Smrg    # Check whether this is an Automake generated Makefile or not.
35730f8ce46Smrg    # We used to match only the files named `Makefile.in', but
35830f8ce46Smrg    # some people rename them; so instead we look at the file content.
35930f8ce46Smrg    # Grep'ing the first line is not enough: some people post-process
36030f8ce46Smrg    # each Makefile.in and add a new line on top of each file to say so.
36130f8ce46Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
36230f8ce46Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
36330f8ce46Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
36430f8ce46Smrg      dirpart=`AS_DIRNAME("$mf")`
36530f8ce46Smrg    else
36630f8ce46Smrg      continue
36730f8ce46Smrg    fi
36830f8ce46Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
36930f8ce46Smrg    # from the Makefile without running `make'.
37030f8ce46Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
37130f8ce46Smrg    test -z "$DEPDIR" && continue
37230f8ce46Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
37330f8ce46Smrg    test -z "am__include" && continue
37430f8ce46Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
37530f8ce46Smrg    # When using ansi2knr, U may be empty or an underscore; expand it
37630f8ce46Smrg    U=`sed -n 's/^U = //p' < "$mf"`
37730f8ce46Smrg    # Find all dependency output files, they are included files with
37830f8ce46Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
37930f8ce46Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
38030f8ce46Smrg    # expansion.
38130f8ce46Smrg    for file in `sed -n "
38230f8ce46Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
38330f8ce46Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
38430f8ce46Smrg      # Make sure the directory exists.
38530f8ce46Smrg      test -f "$dirpart/$file" && continue
38630f8ce46Smrg      fdir=`AS_DIRNAME(["$file"])`
38730f8ce46Smrg      AS_MKDIR_P([$dirpart/$fdir])
38830f8ce46Smrg      # echo "creating $dirpart/$file"
38930f8ce46Smrg      echo '# dummy' > "$dirpart/$file"
39030f8ce46Smrg    done
391bbe1b32bSmrg  done
39230f8ce46Smrg}
393bbe1b32bSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
394bbe1b32bSmrg
395bbe1b32bSmrg
396bbe1b32bSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
397bbe1b32bSmrg# -----------------------------
398bbe1b32bSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
399bbe1b32bSmrg#
400bbe1b32bSmrg# This code is only required when automatic dependency tracking
401bbe1b32bSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
402bbe1b32bSmrg# need in order to bootstrap the dependency handling code.
403bbe1b32bSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
404bbe1b32bSmrg[AC_CONFIG_COMMANDS([depfiles],
405bbe1b32bSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
406bbe1b32bSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
407bbe1b32bSmrg])
408bbe1b32bSmrg
409bbe1b32bSmrg# Do all the work for Automake.                             -*- Autoconf -*-
410bbe1b32bSmrg
411bbe1b32bSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
41230f8ce46Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
413bbe1b32bSmrg#
414bbe1b32bSmrg# This file is free software; the Free Software Foundation
415bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
416bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
417bbe1b32bSmrg
41830f8ce46Smrg# serial 16
419bbe1b32bSmrg
420bbe1b32bSmrg# This macro actually does too much.  Some checks are only needed if
421bbe1b32bSmrg# your package does certain things.  But this isn't really a big deal.
422bbe1b32bSmrg
423bbe1b32bSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
424bbe1b32bSmrg# AM_INIT_AUTOMAKE([OPTIONS])
425bbe1b32bSmrg# -----------------------------------------------
426bbe1b32bSmrg# The call with PACKAGE and VERSION arguments is the old style
427bbe1b32bSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
428bbe1b32bSmrg# and VERSION should now be passed to AC_INIT and removed from
429bbe1b32bSmrg# the call to AM_INIT_AUTOMAKE.
430bbe1b32bSmrg# We support both call styles for the transition.  After
431bbe1b32bSmrg# the next Automake release, Autoconf can make the AC_INIT
432bbe1b32bSmrg# arguments mandatory, and then we can depend on a new Autoconf
433bbe1b32bSmrg# release and drop the old call support.
434bbe1b32bSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
43530f8ce46Smrg[AC_PREREQ([2.62])dnl
436bbe1b32bSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
437bbe1b32bSmrgdnl the ones we care about.
438bbe1b32bSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
439bbe1b32bSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
440bbe1b32bSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
441bbe1b32bSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
442bbe1b32bSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
443bbe1b32bSmrg  # is not polluted with repeated "-I."
444bbe1b32bSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
445bbe1b32bSmrg  # test to see if srcdir already configured
446bbe1b32bSmrg  if test -f $srcdir/config.status; then
447bbe1b32bSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
448bbe1b32bSmrg  fi
449bbe1b32bSmrgfi
450bbe1b32bSmrg
451bbe1b32bSmrg# test whether we have cygpath
452bbe1b32bSmrgif test -z "$CYGPATH_W"; then
453bbe1b32bSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
454bbe1b32bSmrg    CYGPATH_W='cygpath -w'
455bbe1b32bSmrg  else
456bbe1b32bSmrg    CYGPATH_W=echo
457bbe1b32bSmrg  fi
458bbe1b32bSmrgfi
459bbe1b32bSmrgAC_SUBST([CYGPATH_W])
460bbe1b32bSmrg
461bbe1b32bSmrg# Define the identity of the package.
462bbe1b32bSmrgdnl Distinguish between old-style and new-style calls.
463bbe1b32bSmrgm4_ifval([$2],
464bbe1b32bSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
465bbe1b32bSmrg AC_SUBST([PACKAGE], [$1])dnl
466bbe1b32bSmrg AC_SUBST([VERSION], [$2])],
467bbe1b32bSmrg[_AM_SET_OPTIONS([$1])dnl
468bbe1b32bSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
469bbe1b32bSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
470bbe1b32bSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
471bbe1b32bSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
472bbe1b32bSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
473bbe1b32bSmrg
474bbe1b32bSmrg_AM_IF_OPTION([no-define],,
475bbe1b32bSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
476bbe1b32bSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
477bbe1b32bSmrg
478bbe1b32bSmrg# Some tools Automake needs.
479bbe1b32bSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
480bbe1b32bSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
481bbe1b32bSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
482bbe1b32bSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
483bbe1b32bSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
484bbe1b32bSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
485bbe1b32bSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
48630f8ce46SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
48730f8ce46SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
488bbe1b32bSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
489bbe1b32bSmrg# We need awk for the "check" target.  The system "awk" is bad on
490bbe1b32bSmrg# some platforms.
491bbe1b32bSmrgAC_REQUIRE([AC_PROG_AWK])dnl
492bbe1b32bSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
493bbe1b32bSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
494bbe1b32bSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
49530f8ce46Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
49630f8ce46Smrg			     [_AM_PROG_TAR([v7])])])
497bbe1b32bSmrg_AM_IF_OPTION([no-dependencies],,
498bbe1b32bSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
49930f8ce46Smrg		  [_AM_DEPENDENCIES(CC)],
50030f8ce46Smrg		  [define([AC_PROG_CC],
50130f8ce46Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
502bbe1b32bSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
50330f8ce46Smrg		  [_AM_DEPENDENCIES(CXX)],
50430f8ce46Smrg		  [define([AC_PROG_CXX],
50530f8ce46Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
506bbe1b32bSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
50730f8ce46Smrg		  [_AM_DEPENDENCIES(OBJC)],
50830f8ce46Smrg		  [define([AC_PROG_OBJC],
50930f8ce46Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
510bbe1b32bSmrg])
51130f8ce46Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
51230f8ce46Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
51330f8ce46Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
51430f8ce46Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
51530f8ce46SmrgAC_CONFIG_COMMANDS_PRE(dnl
51630f8ce46Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
51730f8ce46Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
518bbe1b32bSmrg])
519bbe1b32bSmrg
52030f8ce46Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
52130f8ce46Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
52230f8ce46Smrgdnl mangled by Autoconf and run in a shell conditional statement.
52330f8ce46Smrgm4_define([_AC_COMPILER_EXEEXT],
52430f8ce46Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
52530f8ce46Smrg
526bbe1b32bSmrg
527bbe1b32bSmrg# When config.status generates a header, we must update the stamp-h file.
528bbe1b32bSmrg# This file resides in the same directory as the config header
529bbe1b32bSmrg# that is generated.  The stamp files are numbered to have different names.
530bbe1b32bSmrg
531bbe1b32bSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
532bbe1b32bSmrg# loop where config.status creates the headers, so we can generate
533bbe1b32bSmrg# our stamp files there.
534bbe1b32bSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
535bbe1b32bSmrg[# Compute $1's index in $config_headers.
53630f8ce46Smrg_am_arg=$1
537bbe1b32bSmrg_am_stamp_count=1
538bbe1b32bSmrgfor _am_header in $config_headers :; do
539bbe1b32bSmrg  case $_am_header in
54030f8ce46Smrg    $_am_arg | $_am_arg:* )
541bbe1b32bSmrg      break ;;
542bbe1b32bSmrg    * )
543bbe1b32bSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
544bbe1b32bSmrg  esac
545bbe1b32bSmrgdone
54630f8ce46Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
547bbe1b32bSmrg
54830f8ce46Smrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
549bbe1b32bSmrg#
550bbe1b32bSmrg# This file is free software; the Free Software Foundation
551bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
552bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
553bbe1b32bSmrg
554bbe1b32bSmrg# AM_PROG_INSTALL_SH
555bbe1b32bSmrg# ------------------
556bbe1b32bSmrg# Define $install_sh.
557bbe1b32bSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
558bbe1b32bSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
55930f8ce46Smrgif test x"${install_sh}" != xset; then
56030f8ce46Smrg  case $am_aux_dir in
56130f8ce46Smrg  *\ * | *\	*)
56230f8ce46Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
56330f8ce46Smrg  *)
56430f8ce46Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
56530f8ce46Smrg  esac
56630f8ce46Smrgfi
567bbe1b32bSmrgAC_SUBST(install_sh)])
568bbe1b32bSmrg
569bbe1b32bSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
570bbe1b32bSmrg#
571bbe1b32bSmrg# This file is free software; the Free Software Foundation
572bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
573bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
574bbe1b32bSmrg
575bbe1b32bSmrg# serial 2
576bbe1b32bSmrg
577bbe1b32bSmrg# Check whether the underlying file-system supports filenames
578bbe1b32bSmrg# with a leading dot.  For instance MS-DOS doesn't.
579bbe1b32bSmrgAC_DEFUN([AM_SET_LEADING_DOT],
580bbe1b32bSmrg[rm -rf .tst 2>/dev/null
581bbe1b32bSmrgmkdir .tst 2>/dev/null
582bbe1b32bSmrgif test -d .tst; then
583bbe1b32bSmrg  am__leading_dot=.
584bbe1b32bSmrgelse
585bbe1b32bSmrg  am__leading_dot=_
586bbe1b32bSmrgfi
587bbe1b32bSmrgrmdir .tst 2>/dev/null
588bbe1b32bSmrgAC_SUBST([am__leading_dot])])
589bbe1b32bSmrg
590bbe1b32bSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
591bbe1b32bSmrg# From Jim Meyering
592bbe1b32bSmrg
59330f8ce46Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
594bbe1b32bSmrg# Free Software Foundation, Inc.
595bbe1b32bSmrg#
596bbe1b32bSmrg# This file is free software; the Free Software Foundation
597bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
598bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
599bbe1b32bSmrg
60030f8ce46Smrg# serial 5
601bbe1b32bSmrg
60230f8ce46Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
60330f8ce46Smrg# ----------------------------------
60430f8ce46Smrg# Control maintainer-specific portions of Makefiles.
60530f8ce46Smrg# Default is to disable them, unless `enable' is passed literally.
60630f8ce46Smrg# For symmetry, `disable' may be passed as well.  Anyway, the user
60730f8ce46Smrg# can override the default with the --enable/--disable switch.
608bbe1b32bSmrgAC_DEFUN([AM_MAINTAINER_MODE],
60930f8ce46Smrg[m4_case(m4_default([$1], [disable]),
61030f8ce46Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
61130f8ce46Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
61230f8ce46Smrg       [m4_define([am_maintainer_other], [enable])
61330f8ce46Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
61430f8ce46SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
61530f8ce46Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
61630f8ce46Smrg  AC_ARG_ENABLE([maintainer-mode],
61730f8ce46Smrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
618bbe1b32bSmrg			  (and sometimes confusing) to the casual installer],
61930f8ce46Smrg      [USE_MAINTAINER_MODE=$enableval],
62030f8ce46Smrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
621bbe1b32bSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
62230f8ce46Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
623bbe1b32bSmrg  MAINT=$MAINTAINER_MODE_TRUE
62430f8ce46Smrg  AC_SUBST([MAINT])dnl
625bbe1b32bSmrg]
626bbe1b32bSmrg)
627bbe1b32bSmrg
628bbe1b32bSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
629bbe1b32bSmrg
630bbe1b32bSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
631bbe1b32bSmrg
63230f8ce46Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
633bbe1b32bSmrg#
634bbe1b32bSmrg# This file is free software; the Free Software Foundation
635bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
636bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
637bbe1b32bSmrg
63830f8ce46Smrg# serial 4
639bbe1b32bSmrg
640bbe1b32bSmrg# AM_MAKE_INCLUDE()
641bbe1b32bSmrg# -----------------
642bbe1b32bSmrg# Check to see how make treats includes.
643bbe1b32bSmrgAC_DEFUN([AM_MAKE_INCLUDE],
644bbe1b32bSmrg[am_make=${MAKE-make}
645bbe1b32bSmrgcat > confinc << 'END'
646bbe1b32bSmrgam__doit:
64730f8ce46Smrg	@echo this is the am__doit target
648bbe1b32bSmrg.PHONY: am__doit
649bbe1b32bSmrgEND
650bbe1b32bSmrg# If we don't find an include directive, just comment out the code.
651bbe1b32bSmrgAC_MSG_CHECKING([for style of include used by $am_make])
652bbe1b32bSmrgam__include="#"
653bbe1b32bSmrgam__quote=
654bbe1b32bSmrg_am_result=none
655bbe1b32bSmrg# First try GNU make style include.
656bbe1b32bSmrgecho "include confinc" > confmf
65730f8ce46Smrg# Ignore all kinds of additional output from `make'.
65830f8ce46Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
65930f8ce46Smrg*the\ am__doit\ target*)
66030f8ce46Smrg  am__include=include
66130f8ce46Smrg  am__quote=
66230f8ce46Smrg  _am_result=GNU
66330f8ce46Smrg  ;;
66430f8ce46Smrgesac
665bbe1b32bSmrg# Now try BSD make style include.
666bbe1b32bSmrgif test "$am__include" = "#"; then
667bbe1b32bSmrg   echo '.include "confinc"' > confmf
66830f8ce46Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
66930f8ce46Smrg   *the\ am__doit\ target*)
67030f8ce46Smrg     am__include=.include
67130f8ce46Smrg     am__quote="\""
67230f8ce46Smrg     _am_result=BSD
67330f8ce46Smrg     ;;
67430f8ce46Smrg   esac
675bbe1b32bSmrgfi
676bbe1b32bSmrgAC_SUBST([am__include])
677bbe1b32bSmrgAC_SUBST([am__quote])
678bbe1b32bSmrgAC_MSG_RESULT([$_am_result])
679bbe1b32bSmrgrm -f confinc confmf
680bbe1b32bSmrg])
681bbe1b32bSmrg
682bbe1b32bSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
683bbe1b32bSmrg
68430f8ce46Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
685bbe1b32bSmrg# Free Software Foundation, Inc.
686bbe1b32bSmrg#
687bbe1b32bSmrg# This file is free software; the Free Software Foundation
688bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
689bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
690bbe1b32bSmrg
69130f8ce46Smrg# serial 6
692bbe1b32bSmrg
693bbe1b32bSmrg# AM_MISSING_PROG(NAME, PROGRAM)
694bbe1b32bSmrg# ------------------------------
695bbe1b32bSmrgAC_DEFUN([AM_MISSING_PROG],
696bbe1b32bSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
697bbe1b32bSmrg$1=${$1-"${am_missing_run}$2"}
698bbe1b32bSmrgAC_SUBST($1)])
699bbe1b32bSmrg
700bbe1b32bSmrg
701bbe1b32bSmrg# AM_MISSING_HAS_RUN
702bbe1b32bSmrg# ------------------
703bbe1b32bSmrg# Define MISSING if not defined so far and test if it supports --run.
704bbe1b32bSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
705bbe1b32bSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
706bbe1b32bSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
707bbe1b32bSmrgAC_REQUIRE_AUX_FILE([missing])dnl
70830f8ce46Smrgif test x"${MISSING+set}" != xset; then
70930f8ce46Smrg  case $am_aux_dir in
71030f8ce46Smrg  *\ * | *\	*)
71130f8ce46Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
71230f8ce46Smrg  *)
71330f8ce46Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
71430f8ce46Smrg  esac
71530f8ce46Smrgfi
716bbe1b32bSmrg# Use eval to expand $SHELL
717bbe1b32bSmrgif eval "$MISSING --run true"; then
718bbe1b32bSmrg  am_missing_run="$MISSING --run "
719bbe1b32bSmrgelse
720bbe1b32bSmrg  am_missing_run=
721bbe1b32bSmrg  AC_MSG_WARN([`missing' script is too old or missing])
722bbe1b32bSmrgfi
723bbe1b32bSmrg])
724bbe1b32bSmrg
725bbe1b32bSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
726bbe1b32bSmrg#
727bbe1b32bSmrg# This file is free software; the Free Software Foundation
728bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
729bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
730bbe1b32bSmrg
731bbe1b32bSmrg# AM_PROG_MKDIR_P
732bbe1b32bSmrg# ---------------
733bbe1b32bSmrg# Check for `mkdir -p'.
734bbe1b32bSmrgAC_DEFUN([AM_PROG_MKDIR_P],
735bbe1b32bSmrg[AC_PREREQ([2.60])dnl
736bbe1b32bSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
737bbe1b32bSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
738bbe1b32bSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
739bbe1b32bSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
740bbe1b32bSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
741bbe1b32bSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
742bbe1b32bSmrgdnl adjustment using top_builddir (which is defined more often than
743bbe1b32bSmrgdnl MKDIR_P).
744bbe1b32bSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
745bbe1b32bSmrgcase $mkdir_p in
746bbe1b32bSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
747bbe1b32bSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
748bbe1b32bSmrgesac
749bbe1b32bSmrg])
750bbe1b32bSmrg
751bbe1b32bSmrg# Helper functions for option handling.                     -*- Autoconf -*-
752bbe1b32bSmrg
75330f8ce46Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
754bbe1b32bSmrg#
755bbe1b32bSmrg# This file is free software; the Free Software Foundation
756bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
757bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
758bbe1b32bSmrg
75930f8ce46Smrg# serial 4
760bbe1b32bSmrg
761bbe1b32bSmrg# _AM_MANGLE_OPTION(NAME)
762bbe1b32bSmrg# -----------------------
763bbe1b32bSmrgAC_DEFUN([_AM_MANGLE_OPTION],
764bbe1b32bSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
765bbe1b32bSmrg
766bbe1b32bSmrg# _AM_SET_OPTION(NAME)
767bbe1b32bSmrg# ------------------------------
768bbe1b32bSmrg# Set option NAME.  Presently that only means defining a flag for this option.
769bbe1b32bSmrgAC_DEFUN([_AM_SET_OPTION],
770bbe1b32bSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
771bbe1b32bSmrg
772bbe1b32bSmrg# _AM_SET_OPTIONS(OPTIONS)
773bbe1b32bSmrg# ----------------------------------
774bbe1b32bSmrg# OPTIONS is a space-separated list of Automake options.
775bbe1b32bSmrgAC_DEFUN([_AM_SET_OPTIONS],
77630f8ce46Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
777bbe1b32bSmrg
778bbe1b32bSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
779bbe1b32bSmrg# -------------------------------------------
780bbe1b32bSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
781bbe1b32bSmrgAC_DEFUN([_AM_IF_OPTION],
782bbe1b32bSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
783bbe1b32bSmrg
784bbe1b32bSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
785bbe1b32bSmrg
78630f8ce46Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
787bbe1b32bSmrg# Free Software Foundation, Inc.
788bbe1b32bSmrg#
789bbe1b32bSmrg# This file is free software; the Free Software Foundation
790bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
791bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
792bbe1b32bSmrg
79330f8ce46Smrg# serial 5
794bbe1b32bSmrg
795bbe1b32bSmrg# AM_SANITY_CHECK
796bbe1b32bSmrg# ---------------
797bbe1b32bSmrgAC_DEFUN([AM_SANITY_CHECK],
798bbe1b32bSmrg[AC_MSG_CHECKING([whether build environment is sane])
799bbe1b32bSmrg# Just in case
800bbe1b32bSmrgsleep 1
801bbe1b32bSmrgecho timestamp > conftest.file
80230f8ce46Smrg# Reject unsafe characters in $srcdir or the absolute working directory
80330f8ce46Smrg# name.  Accept space and tab only in the latter.
80430f8ce46Smrgam_lf='
80530f8ce46Smrg'
80630f8ce46Smrgcase `pwd` in
80730f8ce46Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
80830f8ce46Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
80930f8ce46Smrgesac
81030f8ce46Smrgcase $srcdir in
81130f8ce46Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
81230f8ce46Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
81330f8ce46Smrgesac
81430f8ce46Smrg
815bbe1b32bSmrg# Do `set' in a subshell so we don't clobber the current shell's
816bbe1b32bSmrg# arguments.  Must try -L first in case configure is actually a
817bbe1b32bSmrg# symlink; some systems play weird games with the mod time of symlinks
818bbe1b32bSmrg# (eg FreeBSD returns the mod time of the symlink's containing
819bbe1b32bSmrg# directory).
820bbe1b32bSmrgif (
82130f8ce46Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
822bbe1b32bSmrg   if test "$[*]" = "X"; then
823bbe1b32bSmrg      # -L didn't work.
82430f8ce46Smrg      set X `ls -t "$srcdir/configure" conftest.file`
825bbe1b32bSmrg   fi
826bbe1b32bSmrg   rm -f conftest.file
827bbe1b32bSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
828bbe1b32bSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
829bbe1b32bSmrg
830bbe1b32bSmrg      # If neither matched, then we have a broken ls.  This can happen
831bbe1b32bSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
832bbe1b32bSmrg      # broken ls alias from the environment.  This has actually
833bbe1b32bSmrg      # happened.  Such a system could not be considered "sane".
834bbe1b32bSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
835bbe1b32bSmrgalias in your environment])
836bbe1b32bSmrg   fi
837bbe1b32bSmrg
838bbe1b32bSmrg   test "$[2]" = conftest.file
839bbe1b32bSmrg   )
840bbe1b32bSmrgthen
841bbe1b32bSmrg   # Ok.
842bbe1b32bSmrg   :
843bbe1b32bSmrgelse
844bbe1b32bSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
845bbe1b32bSmrgCheck your system clock])
846bbe1b32bSmrgfi
847bbe1b32bSmrgAC_MSG_RESULT(yes)])
848bbe1b32bSmrg
84930f8ce46Smrg# Copyright (C) 2009  Free Software Foundation, Inc.
85030f8ce46Smrg#
85130f8ce46Smrg# This file is free software; the Free Software Foundation
85230f8ce46Smrg# gives unlimited permission to copy and/or distribute it,
85330f8ce46Smrg# with or without modifications, as long as this notice is preserved.
85430f8ce46Smrg
85530f8ce46Smrg# serial 1
85630f8ce46Smrg
85730f8ce46Smrg# AM_SILENT_RULES([DEFAULT])
85830f8ce46Smrg# --------------------------
85930f8ce46Smrg# Enable less verbose build rules; with the default set to DEFAULT
86030f8ce46Smrg# (`yes' being less verbose, `no' or empty being verbose).
86130f8ce46SmrgAC_DEFUN([AM_SILENT_RULES],
86230f8ce46Smrg[AC_ARG_ENABLE([silent-rules],
86330f8ce46Smrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
86430f8ce46Smrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
86530f8ce46Smrgcase $enable_silent_rules in
86630f8ce46Smrgyes) AM_DEFAULT_VERBOSITY=0;;
86730f8ce46Smrgno)  AM_DEFAULT_VERBOSITY=1;;
86830f8ce46Smrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
86930f8ce46Smrgesac
87030f8ce46SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
87130f8ce46SmrgAM_BACKSLASH='\'
87230f8ce46SmrgAC_SUBST([AM_BACKSLASH])dnl
87330f8ce46Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
87430f8ce46Smrg])
87530f8ce46Smrg
876bbe1b32bSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
877bbe1b32bSmrg#
878bbe1b32bSmrg# This file is free software; the Free Software Foundation
879bbe1b32bSmrg# gives unlimited permission to copy and/or distribute it,
880bbe1b32bSmrg# with or without modifications, as long as this notice is preserved.
881bbe1b32bSmrg
882bbe1b32bSmrg# AM_PROG_INSTALL_STRIP
883bbe1b32bSmrg# ---------------------
884bbe1b32bSmrg# One issue with vendor `install' (even GNU) is that you can't
885bbe1b32bSmrg# specify the program used to strip binaries.  This is especially
886bbe1b32bSmrg# annoying in cross-compiling environments, where the build's strip
887bbe1b32bSmrg# is unlikely to handle the host's binaries.
888bbe1b32bSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
889bbe1b32bSmrg# always use install-sh in `make install-strip', and initialize
890bbe1b32bSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
891bbe1b32bSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
892bbe1b32bSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
893bbe1b32bSmrg# Installed binaries are usually stripped using `strip' when the user
894bbe1b32bSmrg# run `make install-strip'.  However `strip' might not be the right
895bbe1b32bSmrg# tool to use in cross-compilation environments, therefore Automake
896bbe1b32bSmrg# will honor the `STRIP' environment variable to overrule this program.
897bbe1b32bSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
898bbe1b32bSmrgif test "$cross_compiling" != no; then
899bbe1b32bSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
900bbe1b32bSmrgfi
901bbe1b32bSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
902bbe1b32bSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
903bbe1b32bSmrg
90430f8ce46Smrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
90530f8ce46Smrg#
90630f8ce46Smrg# This file is free software; the Free Software Foundation
90730f8ce46Smrg# gives unlimited permission to copy and/or distribute it,
90830f8ce46Smrg# with or without modifications, as long as this notice is preserved.
90930f8ce46Smrg
91030f8ce46Smrg# serial 2
91130f8ce46Smrg
91230f8ce46Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
91330f8ce46Smrg# ---------------------------
91430f8ce46Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
91530f8ce46Smrg# This macro is traced by Automake.
91630f8ce46SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
91730f8ce46Smrg
91830f8ce46Smrg# AM_SUBST_NOTMAKE(VARIABLE)
91930f8ce46Smrg# ---------------------------
92030f8ce46Smrg# Public sister of _AM_SUBST_NOTMAKE.
92130f8ce46SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
92230f8ce46Smrg
92330f8ce46Smrg# Check how to create a tarball.                            -*- Autoconf -*-
92430f8ce46Smrg
92530f8ce46Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
92630f8ce46Smrg#
92730f8ce46Smrg# This file is free software; the Free Software Foundation
92830f8ce46Smrg# gives unlimited permission to copy and/or distribute it,
92930f8ce46Smrg# with or without modifications, as long as this notice is preserved.
93030f8ce46Smrg
93130f8ce46Smrg# serial 2
93230f8ce46Smrg
93330f8ce46Smrg# _AM_PROG_TAR(FORMAT)
93430f8ce46Smrg# --------------------
93530f8ce46Smrg# Check how to create a tarball in format FORMAT.
93630f8ce46Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
93730f8ce46Smrg#
93830f8ce46Smrg# Substitute a variable $(am__tar) that is a command
93930f8ce46Smrg# writing to stdout a FORMAT-tarball containing the directory
94030f8ce46Smrg# $tardir.
94130f8ce46Smrg#     tardir=directory && $(am__tar) > result.tar
94230f8ce46Smrg#
94330f8ce46Smrg# Substitute a variable $(am__untar) that extract such
94430f8ce46Smrg# a tarball read from stdin.
94530f8ce46Smrg#     $(am__untar) < result.tar
94630f8ce46SmrgAC_DEFUN([_AM_PROG_TAR],
94730f8ce46Smrg[# Always define AMTAR for backward compatibility.
94830f8ce46SmrgAM_MISSING_PROG([AMTAR], [tar])
94930f8ce46Smrgm4_if([$1], [v7],
95030f8ce46Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
95130f8ce46Smrg     [m4_case([$1], [ustar],, [pax],,
95230f8ce46Smrg              [m4_fatal([Unknown tar format])])
95330f8ce46SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
95430f8ce46Smrg# Loop over all known methods to create a tar archive until one works.
95530f8ce46Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
95630f8ce46Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
95730f8ce46Smrg# Do not fold the above two line into one, because Tru64 sh and
95830f8ce46Smrg# Solaris sh will not grok spaces in the rhs of `-'.
95930f8ce46Smrgfor _am_tool in $_am_tools
96030f8ce46Smrgdo
96130f8ce46Smrg  case $_am_tool in
96230f8ce46Smrg  gnutar)
96330f8ce46Smrg    for _am_tar in tar gnutar gtar;
96430f8ce46Smrg    do
96530f8ce46Smrg      AM_RUN_LOG([$_am_tar --version]) && break
96630f8ce46Smrg    done
96730f8ce46Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
96830f8ce46Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
96930f8ce46Smrg    am__untar="$_am_tar -xf -"
97030f8ce46Smrg    ;;
97130f8ce46Smrg  plaintar)
97230f8ce46Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
97330f8ce46Smrg    # ustar tarball either.
97430f8ce46Smrg    (tar --version) >/dev/null 2>&1 && continue
97530f8ce46Smrg    am__tar='tar chf - "$$tardir"'
97630f8ce46Smrg    am__tar_='tar chf - "$tardir"'
97730f8ce46Smrg    am__untar='tar xf -'
97830f8ce46Smrg    ;;
97930f8ce46Smrg  pax)
98030f8ce46Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
98130f8ce46Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
98230f8ce46Smrg    am__untar='pax -r'
98330f8ce46Smrg    ;;
98430f8ce46Smrg  cpio)
98530f8ce46Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
98630f8ce46Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
98730f8ce46Smrg    am__untar='cpio -i -H $1 -d'
98830f8ce46Smrg    ;;
98930f8ce46Smrg  none)
99030f8ce46Smrg    am__tar=false
99130f8ce46Smrg    am__tar_=false
99230f8ce46Smrg    am__untar=false
99330f8ce46Smrg    ;;
99430f8ce46Smrg  esac
99530f8ce46Smrg
99630f8ce46Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
99730f8ce46Smrg  # and am__untar set.
99830f8ce46Smrg  test -n "${am_cv_prog_tar_$1}" && break
99930f8ce46Smrg
100030f8ce46Smrg  # tar/untar a dummy directory, and stop if the command works
100130f8ce46Smrg  rm -rf conftest.dir
100230f8ce46Smrg  mkdir conftest.dir
100330f8ce46Smrg  echo GrepMe > conftest.dir/file
100430f8ce46Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
100530f8ce46Smrg  rm -rf conftest.dir
100630f8ce46Smrg  if test -s conftest.tar; then
100730f8ce46Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
100830f8ce46Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
100930f8ce46Smrg  fi
101030f8ce46Smrgdone
101130f8ce46Smrgrm -rf conftest.dir
101230f8ce46Smrg
101330f8ce46SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
101430f8ce46SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
101530f8ce46SmrgAC_SUBST([am__tar])
101630f8ce46SmrgAC_SUBST([am__untar])
101730f8ce46Smrg]) # _AM_PROG_TAR
101830f8ce46Smrg
101930f8ce46Smrgm4_include([m4/ax_define_dir.m4])
102030f8ce46Smrgdnl fontutil.m4.  Generated from fontutil.m4.in by configure.
102130f8ce46Smrgdnl
102230f8ce46Smrgdnl This file comes from X.Org's font-util 1.2.0
102330f8ce46Smrgdnl
102430f8ce46Smrgdnl Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
102530f8ce46Smrgdnl
102630f8ce46Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
102730f8ce46Smrgdnl copy of this software and associated documentation files (the "Software"),
102830f8ce46Smrgdnl to deal in the Software without restriction, including without limitation
102930f8ce46Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
103030f8ce46Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
103130f8ce46Smrgdnl Software is furnished to do so, subject to the following conditions:
103230f8ce46Smrgdnl
103330f8ce46Smrgdnl The above copyright notice and this permission notice (including the next
103430f8ce46Smrgdnl paragraph) shall be included in all copies or substantial portions of the
103530f8ce46Smrgdnl Software.
103630f8ce46Smrgdnl
103730f8ce46Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
103830f8ce46Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
103930f8ce46Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
104030f8ce46Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
104130f8ce46Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
104230f8ce46Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
104330f8ce46Smrgdnl DEALINGS IN THE SOFTWARE.
104430f8ce46Smrgdnl
104530f8ce46Smrgdnl --------------------------------------------------------------------
104630f8ce46Smrgdnl
104730f8ce46Smrgdnl Copyright 2005 Red Hat, Inc
104830f8ce46Smrgdnl
104930f8ce46Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
105030f8ce46Smrgdnl documentation for any purpose is hereby granted without fee, provided that
105130f8ce46Smrgdnl the above copyright notice appear in all copies and that both that
105230f8ce46Smrgdnl copyright notice and this permission notice appear in supporting
105330f8ce46Smrgdnl documentation.
105430f8ce46Smrgdnl
105530f8ce46Smrgdnl The above copyright notice and this permission notice shall be included
105630f8ce46Smrgdnl in all copies or substantial portions of the Software.
105730f8ce46Smrgdnl
105830f8ce46Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
105930f8ce46Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
106030f8ce46Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
106130f8ce46Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
106230f8ce46Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
106330f8ce46Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
106430f8ce46Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
106530f8ce46Smrgdnl
106630f8ce46Smrgdnl Except as contained in this notice, the name of the copyright holders shall
106730f8ce46Smrgdnl not be used in advertising or otherwise to promote the sale, use or
106830f8ce46Smrgdnl other dealings in this Software without prior written authorization
106930f8ce46Smrgdnl from the copyright holders.
107030f8ce46Smrg
107130f8ce46Smrg# XORG_FONT_MACROS_VERSION(required-version)
107230f8ce46Smrg# ------------------------------------------
107330f8ce46Smrg# Minimum version: 1.1.0
107430f8ce46Smrg#
107530f8ce46Smrg# If you're using a macro added in Version 1.1 or newer, include this in
107630f8ce46Smrg# your configure.ac with the minimum required version, such as:
107730f8ce46Smrg# XORG_FONT_MACROS_VERSION(1.1)
107830f8ce46Smrg#
107930f8ce46Smrg# To ensure that this macro is defined, also add:
108030f8ce46Smrg# m4_ifndef([XORG_FONT_MACROS_VERSION],
108130f8ce46Smrg#     [m4_fatal([must install X.Org font-util 1.1 or later before running autoconf/autogen])])
108230f8ce46Smrg#
108330f8ce46Smrg#
108430f8ce46Smrg# See the "minimum version" comment for each macro you use to see what
108530f8ce46Smrg# version you require.
108630f8ce46Smrgm4_defun([XORG_FONT_MACROS_VERSION],[
108730f8ce46Smrgm4_define([vers_have], [1.2.0])
108830f8ce46Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
108930f8ce46Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
109030f8ce46Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
109130f8ce46Smrg    [m4_fatal([font-util major version ]maj_needed[ is required but ]vers_have[ found])])
109230f8ce46Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
109330f8ce46Smrg    [m4_fatal([font-util version $1 or higher is required but ]vers_have[ found])])
109430f8ce46Smrgm4_undefine([vers_have])
109530f8ce46Smrgm4_undefine([maj_have])
109630f8ce46Smrgm4_undefine([maj_needed])
109730f8ce46Smrg]) # XORG_FONT_MACROS_VERSION
109830f8ce46Smrg
109930f8ce46Smrg# XORG_FONT_CHECK_{maps}()
110030f8ce46Smrg# ------------------------
110130f8ce46Smrg# Minimum version: 1.0.0
110230f8ce46Smrg# These macros add --enable/disable-{maps} where {maps} are ISO8859-*,
110330f8ce46Smrg# JISX0201 or KOI8_R.  By default, they are all enabled.
110430f8ce46Smrg
110530f8ce46SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_1], [XORG_FONT_CHECK_ENCODING(ISO8859-1)])
110630f8ce46SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_2], [XORG_FONT_CHECK_ENCODING(ISO8859-2)])
110730f8ce46SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_3], [XORG_FONT_CHECK_ENCODING(ISO8859-3)])
110830f8ce46SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_4], [XORG_FONT_CHECK_ENCODING(ISO8859-4)])
110930f8ce46SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_5], [XORG_FONT_CHECK_ENCODING(ISO8859-5)])
111030f8ce46SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_6], [XORG_FONT_CHECK_ENCODING(ISO8859-6)])
111130f8ce46SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_7], [XORG_FONT_CHECK_ENCODING(ISO8859-7)])
111230f8ce46SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_8], [XORG_FONT_CHECK_ENCODING(ISO8859-8)])
111330f8ce46SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_9], [XORG_FONT_CHECK_ENCODING(ISO8859-9)])
111430f8ce46SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_10],[XORG_FONT_CHECK_ENCODING(ISO8859-10)])
111530f8ce46SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_11],[XORG_FONT_CHECK_ENCODING(ISO8859-11)])
111630f8ce46SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_12],[XORG_FONT_CHECK_ENCODING(ISO8859-12)])
111730f8ce46SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_13],[XORG_FONT_CHECK_ENCODING(ISO8859-13)])
111830f8ce46SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_14],[XORG_FONT_CHECK_ENCODING(ISO8859-14)])
111930f8ce46SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_15],[XORG_FONT_CHECK_ENCODING(ISO8859-15)])
112030f8ce46SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_16],[XORG_FONT_CHECK_ENCODING(ISO8859-16)])
112130f8ce46SmrgAC_DEFUN([XORG_FONT_CHECK_JISX0201],  [XORG_FONT_CHECK_ENCODING(JISX0201)])
112230f8ce46SmrgAC_DEFUN([XORG_FONT_CHECK_KOI8_R],    [XORG_FONT_CHECK_ENCODING(KOI8-R)])
112330f8ce46Smrg
112430f8ce46Smrg# XORG_FONT_CHECK_ENCODING(encoding)
112530f8ce46Smrg# ----------------------------------
112630f8ce46Smrg# Minimum version: 1.1.0
112730f8ce46Smrg# This macro adds --enable/disable-<encoding>, enabled by default.
112830f8ce46Smrg# It replaced individual copies of this code in the above macros in 1.1.
112930f8ce46Smrg# Currently assumes encoding names will be all upper-case - add m4_toupper
113030f8ce46Smrg# calls if this is not true in the future.
113130f8ce46Smrg
113230f8ce46SmrgAC_DEFUN([XORG_FONT_CHECK_ENCODING],[
113330f8ce46Smrg	AC_ARG_ENABLE(m4_tolower($1),
113430f8ce46Smrg		AS_HELP_STRING(m4_join([-], [--disable], m4_tolower($1)),
113530f8ce46Smrg				[Build $1 fonts (default: yes)]),
113630f8ce46Smrg		[AS_TR_SH($1)=$enableval])
113730f8ce46Smrg	AC_MSG_CHECKING([whether to build $1 fonts])
113830f8ce46Smrg	AC_MSG_RESULT($[AS_TR_SH($1)])
113930f8ce46Smrg	AM_CONDITIONAL(AS_TR_SH($1), [test "x$AS_TR_SH($1)" = xyes])
114030f8ce46Smrg]) # XORG_FONT_CHECK_ENCODING
114130f8ce46Smrg
114230f8ce46Smrg# XORG_FONT_CHECK_ENCODING_LIST(encoding1 encoding2....)
114330f8ce46Smrg# -----------------------------------------------------
114430f8ce46Smrg# Minimum version: 1.1.0
114530f8ce46Smrg# Call XORG_FONT_CHECK_ENCODING for multiple encodings at once.
114630f8ce46Smrg# Add a shorthand --enable/disable-all-encodings option.
114730f8ce46Smrg
114830f8ce46SmrgAC_DEFUN([XORG_FONT_CHECK_ENCODING_LIST],[
114930f8ce46Smrg	AC_ARG_ENABLE([all-encodings],
115030f8ce46Smrg		AS_HELP_STRING([--disable-all-encodings],
115130f8ce46Smrg				[Disable building of all font encodings]),
115230f8ce46Smrg		[m4_foreach_w([enc], [$1], [
115330f8ce46Smrg			AS_TR_SH(enc)=$enableval
115430f8ce46Smrg		])],
115530f8ce46Smrg		[m4_foreach_w([enc], [$1], [
115630f8ce46Smrg			AS_TR_SH(enc)=yes
115730f8ce46Smrg		])])
115830f8ce46Smrg	m4_foreach_w([enc], [$1], [XORG_FONT_CHECK_ENCODING(enc)])
115930f8ce46Smrg]) # XORG_FONT_CHECK_ENCODING_LIST
116030f8ce46Smrg
116130f8ce46Smrg# XORG_FONT_REQUIRED_PROG(VARNAME, progname)
116230f8ce46Smrg# ------------------------------------------
116330f8ce46Smrg# Minimum version: 1.1.0
116430f8ce46Smrg#
116530f8ce46Smrg# Simple wrapper around AC_PATH_PROG that errors if not found
116630f8ce46Smrg#
116730f8ce46Smrg
116830f8ce46SmrgAC_DEFUN([XORG_FONT_REQUIRED_PROG],[
116930f8ce46Smrg	AC_PATH_PROG($1, $2)
117030f8ce46Smrg	if test x"$$1" = x; then
117130f8ce46Smrg		AC_MSG_ERROR([$2 is required to build $PACKAGE_NAME.])
117230f8ce46Smrg	fi
117330f8ce46Smrg])
117430f8ce46Smrg
117530f8ce46Smrg
117630f8ce46Smrg# XORG_FONT_FCCACHE()
117730f8ce46Smrg# -------------------
117830f8ce46Smrg# Minimum version: 1.1.0
117930f8ce46Smrg#
118030f8ce46Smrg# Set FCCACHE to path to fc-cache (fontconfig cache builder) if found
118130f8ce46Smrg# Set RUN_FCCACHE to a rule suitable for substituting into a makefile
118230f8ce46Smrg# to run fc-cache if found and not installing to $DESTDIR
118330f8ce46Smrg#
118430f8ce46Smrg# fc-cache is optional, not required, and should be skipped when making
118530f8ce46Smrg# packages (installing to $DESTDIR).
118630f8ce46Smrg#
118730f8ce46SmrgAC_DEFUN([XORG_FONT_FCCACHE],[
118830f8ce46Smrg	AC_PATH_PROG(FCCACHE, fc-cache)
118930f8ce46Smrg	FCCACHE_WARN='echo "** Warning: fonts.cache not built" ; echo "** Generate this file manually on host system using fc-cache"'
119030f8ce46Smrg	if test x"$FCCACHE" = x ; then
119130f8ce46Smrg		RUN_FCCACHE="${FCCACHE_WARN}"
119230f8ce46Smrg	else
119330f8ce46Smrg		RUN_FCCACHE='@(if test -z "$(DESTDIR)"; then echo $(FCCACHE) $(fontdir); $(FCCACHE) $(fontdir); else'
119430f8ce46Smrg		RUN_FCCACHE="${RUN_FCCACHE} ${FCCACHE_WARN} ; fi)"
119530f8ce46Smrg	fi
119630f8ce46Smrg	AC_SUBST([RUN_FCCACHE])
119730f8ce46Smrg])
119830f8ce46Smrg
119930f8ce46Smrg
120030f8ce46Smrg# XORG_FONT_COMMON_UTILS()
120130f8ce46Smrg# ------------------------
120230f8ce46Smrg# Minimum version: 1.1.0
120330f8ce46Smrg#
120430f8ce46Smrg# Call XORG_FONT_REQUIRED_PROG for programs needed for all font types
120530f8ce46Smrg
120630f8ce46SmrgAC_DEFUN([XORG_FONT_COMMON_UTILS],[
120730f8ce46Smrg	XORG_FONT_FCCACHE
120830f8ce46Smrg	XORG_FONT_REQUIRED_PROG(MKFONTDIR, mkfontdir)
120930f8ce46Smrg])
121030f8ce46Smrg
121130f8ce46Smrg# XORG_FONT_SCALED_UTILS()
121230f8ce46Smrg# ------------------------
121330f8ce46Smrg# Minimum version: 1.1.0
121430f8ce46Smrg#
121530f8ce46Smrg# Call XORG_FONT_REQUIRED_PROG for programs needed for scalable fonts
121630f8ce46Smrg# (TrueType, OpenType, Type1)
121730f8ce46Smrg
121830f8ce46SmrgAC_DEFUN([XORG_FONT_SCALED_UTILS],[
121930f8ce46Smrg	XORG_FONT_COMMON_UTILS
122030f8ce46Smrg	XORG_FONT_REQUIRED_PROG(MKFONTSCALE, mkfontscale)
122130f8ce46Smrg])
122230f8ce46Smrg
122330f8ce46Smrg# XORG_FONT_BDF_UTILS()
122430f8ce46Smrg# ---------------------
122530f8ce46Smrg# Minimum version: 1.1.0
1226bbe1b32bSmrg#
122730f8ce46Smrg# Call XORG_FONT_REQUIRED_PROG for programs needed for BDF format bitmap fonts
122830f8ce46Smrg# Also call XORG_FONT_CHECK_COMPRESSION to determine how to compress the
122930f8ce46Smrg# PCF output files created by bdftopcf
1230bbe1b32bSmrg
123130f8ce46SmrgAC_DEFUN([XORG_FONT_BDF_UTILS],[
123230f8ce46Smrg	XORG_FONT_COMMON_UTILS
123330f8ce46Smrg	XORG_FONT_REQUIRED_PROG(BDFTOPCF, bdftopcf)
123430f8ce46Smrg	XORG_FONT_CHECK_COMPRESSION
123530f8ce46Smrg])
1236bbe1b32bSmrg
123730f8ce46Smrg# XORG_FONT_CHECK_COMPRESSION()
123830f8ce46Smrg# -----------------------------
123930f8ce46Smrg# Minimum version: 1.1.0
124030f8ce46Smrg#
124130f8ce46Smrg# Offer a --with-compression flag to control what compression method is
124230f8ce46Smrg# used for pcf font files.   Offers all the methods currently supported
124330f8ce46Smrg# by libXfont, including no compression.
124430f8ce46Smrg
124530f8ce46SmrgAC_DEFUN([XORG_FONT_CHECK_COMPRESSION],[
124630f8ce46Smrg	AC_MSG_CHECKING([font compression method])
124730f8ce46Smrg	AC_ARG_WITH(compression,
124830f8ce46Smrg	 [AS_HELP_STRING([--with-compression=<no|compress|gzip|bzip2>],
124930f8ce46Smrg			 [compression method to use on pcf fonts])],
125030f8ce46Smrg         [compression="$withval"], [compression="yes"])
125130f8ce46Smrg	if test x"$compression" = "xyes" ; then
125230f8ce46Smrg		compression="gzip"
125330f8ce46Smrg	fi
125430f8ce46Smrg	AC_MSG_RESULT([${compression}])
125530f8ce46Smrg	case ${compression} in
125630f8ce46Smrg	 *compress)	COMPRESS_SUFFIX=".Z" ;;
125730f8ce46Smrg	 *gzip)		COMPRESS_SUFFIX=".gz" ;;
125830f8ce46Smrg	 *bzip2)	COMPRESS_SUFFIX=".bz2" ;;
125930f8ce46Smrg	 no|none)	COMPRESS_SUFFIX="" ; COMPRESS="cat" ;;
126030f8ce46Smrg	 *) AC_MSG_ERROR([${compression} is not a supported compression method]) ;;
126130f8ce46Smrg	esac
126230f8ce46Smrg	if test x"$COMPRESS_SUFFIX" != "x" ; then
126330f8ce46Smrg	   XORG_FONT_REQUIRED_PROG(COMPRESS, ${compression})
126430f8ce46Smrg	fi
126530f8ce46Smrg	AC_SUBST([COMPRESS_SUFFIX])
126630f8ce46Smrg])
1267bbe1b32bSmrg
126830f8ce46Smrg# XORG_FONT_UCS2ANY()
126930f8ce46Smrg# -------------------
127030f8ce46Smrg# Minimum version: 1.1.0
1271bbe1b32bSmrg#
127230f8ce46Smrg# Call XORG_FONT_REQUIRED_PROG for ucs2any program needed for splitting
127330f8ce46Smrg# Unicode-encoded BDF format bitmap fonts into subsets for older encodings.
127430f8ce46Smrg# Also call pkg-config to find the directory with the encoding files needed
127530f8ce46Smrg# by ucs2any, and export it as MAPFILES_PATH to the Makefiles
127630f8ce46Smrg
127730f8ce46SmrgAC_DEFUN([XORG_FONT_UCS2ANY],[
127830f8ce46Smrg	XORG_FONT_REQUIRED_PROG(UCS2ANY, ucs2any)
127930f8ce46Smrg	PKG_CHECK_MODULES(MAPS, [fontutil])
128030f8ce46Smrg	AC_MSG_CHECKING([for ucs2any encoding data files])
128130f8ce46Smrg	MAPFILES_PATH=`pkg-config --variable=mapdir fontutil`
128230f8ce46Smrg	AC_SUBST(MAPFILES_PATH)
128330f8ce46Smrg	AC_MSG_RESULT([${MAPFILES_PATH}])
128430f8ce46Smrg])
1285bbe1b32bSmrg
1286bbe1b32bSmrg
128730f8ce46Smrg
128830f8ce46Smrg# XORG_FONT_FC_CONFDIR()
1289bbe1b32bSmrg# --------------------
129030f8ce46Smrg# Minimum version: 1.2.0
1291bbe1b32bSmrg#
129230f8ce46Smrg# Sets FC_CONFDIR to the fontconfig config directory
129330f8ce46Smrg# (which should be --with-confdir=... when building fontconfig)
129430f8ce46Smrg# found from:
129530f8ce46Smrg#	--with-fc-confdir=...
129630f8ce46Smrg#	pkg-config --variable=confdir fontconfig
129730f8ce46Smrg#	${sysconfdir}/fonts
129830f8ce46Smrg
129930f8ce46SmrgAC_DEFUN([XORG_FONT_FC_CONFDIR],[
130030f8ce46Smrg	dnl Ensure $PKG_CONFIG is set first
130130f8ce46Smrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
130230f8ce46Smrg
130330f8ce46Smrg	AC_MSG_CHECKING([for fontconfig's configuration directory])
130430f8ce46Smrg	AC_ARG_WITH(fc-confdir,
130530f8ce46Smrg		    AS_HELP_STRING([--with-fc-confdir=DIR],
130630f8ce46Smrg			   [Path to fontconfig's configuration directory]),
130730f8ce46Smrg		    [FC_CONFDIR="$withval"])
130830f8ce46Smrg	# if --with-fc-confdir was not specified
130930f8ce46Smrg	if test "x${FC_CONFDIR}" = "x"; then
131030f8ce46Smrg		FC_CONFDIR=`$PKG_CONFIG --variable=confdir fontconfig`
131130f8ce46Smrg	fi
131230f8ce46Smrg	# ...and if pkg-config didn't find confdir in fontconfig.pc...
131330f8ce46Smrg	if test "x${FC_CONFDIR}" = "x"; then
131430f8ce46Smrg		FC_CONFDIR="${sysconfdir}/fonts"
131530f8ce46Smrg	fi
131630f8ce46Smrg	AC_SUBST(FC_CONFDIR)
131730f8ce46Smrg	AC_MSG_RESULT([${FC_CONFDIR}])
131830f8ce46Smrg])
131930f8ce46Smrg
132030f8ce46Smrg
132130f8ce46Smrg
132230f8ce46Smrg# XORG_FONTROOTDIR()
132330f8ce46Smrg# --------------------
132430f8ce46Smrg# Minimum version: 1.1.0
1325bbe1b32bSmrg#
132630f8ce46Smrg# Sets FONTROOTDIR to the root directory for font files.  Uses the first
132730f8ce46Smrg# found from:
132830f8ce46Smrg#	--with-fontrootdir
132930f8ce46Smrg#	pkg-config --variable=fontrootdir fontutil
133030f8ce46Smrg#	${datadir}/fonts/X11
133130f8ce46Smrg
133230f8ce46SmrgAC_DEFUN([XORG_FONTROOTDIR],[
133330f8ce46Smrg	dnl Ensure $PKG_CONFIG is set first
133430f8ce46Smrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
133530f8ce46Smrg
133630f8ce46Smrg	AC_MSG_CHECKING([for root directory for font files])
133730f8ce46Smrg	AC_ARG_WITH(fontrootdir,
133830f8ce46Smrg		    AS_HELP_STRING([--with-fontrootdir=DIR],
133930f8ce46Smrg			   [Path to root directory for font files]),
134030f8ce46Smrg		    [FONTROOTDIR="$withval"])
134130f8ce46Smrg	# if --with-fontrootdir not specified...
134230f8ce46Smrg	if test "x${FONTROOTDIR}" = "x"; then
134330f8ce46Smrg		FONTROOTDIR=`$PKG_CONFIG --variable=fontrootdir fontutil`
134430f8ce46Smrg	fi
134530f8ce46Smrg	# ...and if pkg-config didn't find fontdir in fontutil.pc...
134630f8ce46Smrg	if test "x${FONTROOTDIR}" = "x"; then
134730f8ce46Smrg		FONTROOTDIR="${datadir}/fonts/X11"
134830f8ce46Smrg	fi
134930f8ce46Smrg	AC_SUBST(FONTROOTDIR)
135030f8ce46Smrg	AC_MSG_RESULT([${FONTROOTDIR}])
135130f8ce46Smrg])
1352bbe1b32bSmrg
135330f8ce46Smrg# XORG_FONTSUBDIR(variable, flag, subdir)
135430f8ce46Smrg# ---------------------------------------
135530f8ce46Smrg# Minimum version: 1.1.0
135630f8ce46Smrg#
135730f8ce46Smrg# Offer a --with-<flag> flag to control directory for font installation
135830f8ce46Smrg# Default is the specified <subdir> of the font root directory.
135930f8ce46Smrg# Sets <variable> to the selected directory
1360bbe1b32bSmrg
136130f8ce46SmrgAC_DEFUN([XORG_FONTSUBDIR],[
136230f8ce46Smrg	AC_REQUIRE([XORG_FONTROOTDIR])
1363bbe1b32bSmrg
136430f8ce46Smrg	AC_MSG_CHECKING([for directory for $3 files])
136530f8ce46Smrg	AC_ARG_WITH($2,
136630f8ce46Smrg		    [AS_HELP_STRING([--with-$2=DIR],
136730f8ce46Smrg				    [Path to $3 files [FONTROOTDIR/$3]])],
136830f8ce46Smrg		    [$1="${withval}"], [$1='${FONTROOTDIR}/$3'])
136930f8ce46Smrg	AC_SUBST($1)
137030f8ce46Smrg	AC_MSG_RESULT([${$1}])
137130f8ce46Smrg]) # XORG_FONTSUBDIR
137230f8ce46Smrg
137330f8ce46Smrg# XORG_FONTDIR(subdir)
137430f8ce46Smrg# --------------------
137530f8ce46Smrg# Minimum version: 1.1.0
137630f8ce46Smrg#
137730f8ce46Smrg# Offer a --with-fontdir flag to control directory for font installation
137830f8ce46Smrg# Default is the specified subdir of the font root directory.
137930f8ce46Smrg# Sets FONTDIR to the selected directory
138030f8ce46Smrg
138130f8ce46SmrgAC_DEFUN([XORG_FONTDIR],[XORG_FONTSUBDIR([FONTDIR], [fontdir], [$1])])
1382bbe1b32bSmrg
1383ce6676dbSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1384ce6676dbSmrgdnl
138530f8ce46Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
1386ce6676dbSmrgdnl 
1387ce6676dbSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
138830f8ce46Smrgdnl copy of this software and associated documentation files (the "Software"),
138930f8ce46Smrgdnl to deal in the Software without restriction, including without limitation
139030f8ce46Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
139130f8ce46Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
139230f8ce46Smrgdnl Software is furnished to do so, subject to the following conditions:
1393ce6676dbSmrgdnl
139430f8ce46Smrgdnl The above copyright notice and this permission notice (including the next
139530f8ce46Smrgdnl paragraph) shall be included in all copies or substantial portions of the
139630f8ce46Smrgdnl Software.
1397ce6676dbSmrgdnl
139830f8ce46Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
139930f8ce46Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
140030f8ce46Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
140130f8ce46Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
140230f8ce46Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
140330f8ce46Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
140430f8ce46Smrgdnl DEALINGS IN THE SOFTWARE.
1405ce6676dbSmrg
1406ce6676dbSmrg# XORG_MACROS_VERSION(required-version)
1407ce6676dbSmrg# -------------------------------------
1408ce6676dbSmrg# Minimum version: 1.1.0
1409ce6676dbSmrg#
1410ce6676dbSmrg# If you're using a macro added in Version 1.1 or newer, include this in
1411ce6676dbSmrg# your configure.ac with the minimum required version, such as:
1412ce6676dbSmrg# XORG_MACROS_VERSION(1.1)
1413ce6676dbSmrg#
1414ce6676dbSmrg# To ensure that this macro is defined, also add:
1415ce6676dbSmrg# m4_ifndef([XORG_MACROS_VERSION],
1416ce6676dbSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
1417ce6676dbSmrg#
1418ce6676dbSmrg#
1419ce6676dbSmrg# See the "minimum version" comment for each macro you use to see what 
1420ce6676dbSmrg# version you require.
1421ce6676dbSmrgm4_defun([XORG_MACROS_VERSION],[
142230f8ce46Smrgm4_define([vers_have], [1.11.0])
1423ce6676dbSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1424ce6676dbSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1425ce6676dbSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
1426ce6676dbSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1427ce6676dbSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
1428ce6676dbSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1429ce6676dbSmrgm4_undefine([vers_have])
1430ce6676dbSmrgm4_undefine([maj_have])
1431ce6676dbSmrgm4_undefine([maj_needed])
1432ce6676dbSmrg]) # XORG_MACROS_VERSION
1433ce6676dbSmrg
1434ce6676dbSmrg# XORG_PROG_RAWCPP()
1435ce6676dbSmrg# ------------------
1436ce6676dbSmrg# Minimum version: 1.0.0
1437ce6676dbSmrg#
1438ce6676dbSmrg# Find cpp program and necessary flags for use in pre-processing text files
1439ce6676dbSmrg# such as man pages and config files
1440ce6676dbSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
1441ce6676dbSmrgAC_REQUIRE([AC_PROG_CPP])
1442ce6676dbSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
1443ce6676dbSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1444ce6676dbSmrg
1445ce6676dbSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
1446ce6676dbSmrg# which is not the best choice for supporting other OS'es, but covers most
1447ce6676dbSmrg# of the ones we need for now.
1448ce6676dbSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
1449ce6676dbSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
1450ce6676dbSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1451ce6676dbSmrg	AC_MSG_RESULT([no])
1452ce6676dbSmrgelse
1453ce6676dbSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1454ce6676dbSmrg		RAWCPPFLAGS=-undef
1455ce6676dbSmrg		AC_MSG_RESULT([yes])
1456ce6676dbSmrg	# under Cygwin unix is still defined even with -undef
1457ce6676dbSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1458ce6676dbSmrg		RAWCPPFLAGS="-undef -ansi"
1459ce6676dbSmrg		AC_MSG_RESULT([yes, with -ansi])
1460ce6676dbSmrg	else
1461ce6676dbSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1462ce6676dbSmrg	fi
1463ce6676dbSmrgfi
1464ce6676dbSmrgrm -f conftest.$ac_ext
1465ce6676dbSmrg
1466ce6676dbSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
1467ce6676dbSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
1468ce6676dbSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1469ce6676dbSmrg	AC_MSG_RESULT([no])
1470ce6676dbSmrgelse
1471ce6676dbSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1472ce6676dbSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1473ce6676dbSmrg		AC_MSG_RESULT([yes])
1474ce6676dbSmrg	else
1475ce6676dbSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1476ce6676dbSmrg	fi
1477ce6676dbSmrgfi
1478ce6676dbSmrgrm -f conftest.$ac_ext
1479ce6676dbSmrgAC_SUBST(RAWCPPFLAGS)
1480ce6676dbSmrg]) # XORG_PROG_RAWCPP
1481ce6676dbSmrg
1482ce6676dbSmrg# XORG_MANPAGE_SECTIONS()
1483ce6676dbSmrg# -----------------------
1484ce6676dbSmrg# Minimum version: 1.0.0
1485ce6676dbSmrg#
1486ce6676dbSmrg# Determine which sections man pages go in for the different man page types
1487ce6676dbSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1488ce6676dbSmrg# Not sure if there's any better way than just hardcoding by OS name.
1489ce6676dbSmrg# Override default settings by setting environment variables
149030f8ce46Smrg# Added MAN_SUBSTS in version 1.8
149130f8ce46Smrg# Added AC_PROG_SED in version 1.8
1492ce6676dbSmrg
1493ce6676dbSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1494ce6676dbSmrgAC_REQUIRE([AC_CANONICAL_HOST])
149530f8ce46SmrgAC_REQUIRE([AC_PROG_SED])
1496ce6676dbSmrg
1497ce6676dbSmrgif test x$APP_MAN_SUFFIX = x    ; then
1498ce6676dbSmrg    APP_MAN_SUFFIX=1
1499ce6676dbSmrgfi
1500ce6676dbSmrgif test x$APP_MAN_DIR = x    ; then
1501ce6676dbSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1502ce6676dbSmrgfi
1503ce6676dbSmrg
1504ce6676dbSmrgif test x$LIB_MAN_SUFFIX = x    ; then
1505ce6676dbSmrg    LIB_MAN_SUFFIX=3
1506ce6676dbSmrgfi
1507ce6676dbSmrgif test x$LIB_MAN_DIR = x    ; then
1508ce6676dbSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1509ce6676dbSmrgfi
1510ce6676dbSmrg
1511ce6676dbSmrgif test x$FILE_MAN_SUFFIX = x    ; then
1512ce6676dbSmrg    case $host_os in
1513ce6676dbSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
1514ce6676dbSmrg	*)		FILE_MAN_SUFFIX=5  ;;
1515ce6676dbSmrg    esac
1516ce6676dbSmrgfi
1517ce6676dbSmrgif test x$FILE_MAN_DIR = x    ; then
1518ce6676dbSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1519ce6676dbSmrgfi
1520ce6676dbSmrg
1521ce6676dbSmrgif test x$MISC_MAN_SUFFIX = x    ; then
1522ce6676dbSmrg    case $host_os in
1523ce6676dbSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
1524ce6676dbSmrg	*)		MISC_MAN_SUFFIX=7  ;;
1525ce6676dbSmrg    esac
1526ce6676dbSmrgfi
1527ce6676dbSmrgif test x$MISC_MAN_DIR = x    ; then
1528ce6676dbSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1529ce6676dbSmrgfi
1530ce6676dbSmrg
1531ce6676dbSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
1532ce6676dbSmrg    case $host_os in
1533ce6676dbSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
1534ce6676dbSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
1535ce6676dbSmrg    esac
1536ce6676dbSmrgfi
1537ce6676dbSmrgif test x$DRIVER_MAN_DIR = x    ; then
1538ce6676dbSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1539ce6676dbSmrgfi
1540ce6676dbSmrg
1541ce6676dbSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
1542ce6676dbSmrg    case $host_os in
1543ce6676dbSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
1544ce6676dbSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
1545ce6676dbSmrg    esac
1546ce6676dbSmrgfi
1547ce6676dbSmrgif test x$ADMIN_MAN_DIR = x    ; then
1548ce6676dbSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1549ce6676dbSmrgfi
1550ce6676dbSmrg
1551ce6676dbSmrg
1552ce6676dbSmrgAC_SUBST([APP_MAN_SUFFIX])
1553ce6676dbSmrgAC_SUBST([LIB_MAN_SUFFIX])
1554ce6676dbSmrgAC_SUBST([FILE_MAN_SUFFIX])
1555ce6676dbSmrgAC_SUBST([MISC_MAN_SUFFIX])
1556ce6676dbSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
1557ce6676dbSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
1558ce6676dbSmrgAC_SUBST([APP_MAN_DIR])
1559ce6676dbSmrgAC_SUBST([LIB_MAN_DIR])
1560ce6676dbSmrgAC_SUBST([FILE_MAN_DIR])
1561ce6676dbSmrgAC_SUBST([MISC_MAN_DIR])
1562ce6676dbSmrgAC_SUBST([DRIVER_MAN_DIR])
1563ce6676dbSmrgAC_SUBST([ADMIN_MAN_DIR])
156430f8ce46Smrg
156530f8ce46SmrgXORG_MAN_PAGE="X Version 11"
156630f8ce46SmrgAC_SUBST([XORG_MAN_PAGE])
156730f8ce46SmrgMAN_SUBSTS="\
156830f8ce46Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
156930f8ce46Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
157030f8ce46Smrg	-e 's|__xservername__|Xorg|g' \
157130f8ce46Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
157230f8ce46Smrg	-e 's|__projectroot__|\$(prefix)|g' \
157330f8ce46Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
157430f8ce46Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
157530f8ce46Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
157630f8ce46Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
157730f8ce46Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
157830f8ce46Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
157930f8ce46Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
158030f8ce46SmrgAC_SUBST([MAN_SUBSTS])
158130f8ce46Smrg
1582ce6676dbSmrg]) # XORG_MANPAGE_SECTIONS
1583ce6676dbSmrg
158430f8ce46Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
158530f8ce46Smrg# ------------------------
158630f8ce46Smrg# Minimum version: 1.7.0
158730f8ce46Smrg#
158830f8ce46Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
158930f8ce46Smrg# provided by xorg-sgml-doctools, if installed.
159030f8ce46SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
159130f8ce46SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
159230f8ce46SmrgXORG_SGML_PATH=
159330f8ce46SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
159430f8ce46Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
159530f8ce46Smrg    [m4_ifval([$1],[:],
159630f8ce46Smrg        [if test x"$cross_compiling" != x"yes" ; then
159730f8ce46Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
159830f8ce46Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
159930f8ce46Smrg         fi])
160030f8ce46Smrg    ])
160130f8ce46Smrg
160230f8ce46Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
160330f8ce46Smrg# the path and the name of the doc stylesheet
160430f8ce46Smrgif test "x$XORG_SGML_PATH" != "x" ; then
160530f8ce46Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
160630f8ce46Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
160730f8ce46Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
160830f8ce46Smrgelse
160930f8ce46Smrg   AC_MSG_RESULT([no])
161030f8ce46Smrgfi
161130f8ce46Smrg
161230f8ce46SmrgAC_SUBST(XORG_SGML_PATH)
161330f8ce46SmrgAC_SUBST(STYLESHEET_SRCDIR)
161430f8ce46SmrgAC_SUBST(XSL_STYLESHEET)
161530f8ce46SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
161630f8ce46Smrg]) # XORG_CHECK_SGML_DOCTOOLS
161730f8ce46Smrg
1618ce6676dbSmrg# XORG_CHECK_LINUXDOC
1619ce6676dbSmrg# -------------------
1620ce6676dbSmrg# Minimum version: 1.0.0
1621ce6676dbSmrg#
1622ce6676dbSmrg# Defines the variable MAKE_TEXT if the necessary tools and
1623ce6676dbSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1624ce6676dbSmrg# Whether or not the necessary tools and files are found can be checked
1625ce6676dbSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1626ce6676dbSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
162730f8ce46SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
162830f8ce46SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
1629ce6676dbSmrg
1630ce6676dbSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
1631ce6676dbSmrg
163230f8ce46SmrgAC_MSG_CHECKING([whether to build documentation])
1633ce6676dbSmrg
163430f8ce46Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
1635ce6676dbSmrg   BUILDDOC=yes
1636ce6676dbSmrgelse
1637ce6676dbSmrg   BUILDDOC=no
1638ce6676dbSmrgfi
1639ce6676dbSmrg
1640ce6676dbSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1641ce6676dbSmrg
1642ce6676dbSmrgAC_MSG_RESULT([$BUILDDOC])
1643ce6676dbSmrg
164430f8ce46SmrgAC_MSG_CHECKING([whether to build pdf documentation])
1645ce6676dbSmrg
164630f8ce46Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
1647ce6676dbSmrg   BUILDPDFDOC=yes
1648ce6676dbSmrgelse
1649ce6676dbSmrg   BUILDPDFDOC=no
1650ce6676dbSmrgfi
1651ce6676dbSmrg
1652ce6676dbSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1653ce6676dbSmrg
1654ce6676dbSmrgAC_MSG_RESULT([$BUILDPDFDOC])
1655ce6676dbSmrg
165630f8ce46SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
1657ce6676dbSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1658ce6676dbSmrgMAKE_PDF="$PS2PDF"
1659ce6676dbSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1660ce6676dbSmrg
1661ce6676dbSmrgAC_SUBST(MAKE_TEXT)
1662ce6676dbSmrgAC_SUBST(MAKE_PS)
1663ce6676dbSmrgAC_SUBST(MAKE_PDF)
1664ce6676dbSmrgAC_SUBST(MAKE_HTML)
1665ce6676dbSmrg]) # XORG_CHECK_LINUXDOC
1666ce6676dbSmrg
1667ce6676dbSmrg# XORG_CHECK_DOCBOOK
1668ce6676dbSmrg# -------------------
1669ce6676dbSmrg# Minimum version: 1.0.0
1670ce6676dbSmrg#
1671ce6676dbSmrg# Checks for the ability to build output formats from SGML DocBook source.
1672ce6676dbSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1673ce6676dbSmrg# indicates whether the necessary tools and files are found and, if set,
1674ce6676dbSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1675ce6676dbSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
167630f8ce46SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
167730f8ce46Smrg
1678ce6676dbSmrgBUILDTXTDOC=no
1679ce6676dbSmrgBUILDPDFDOC=no
1680ce6676dbSmrgBUILDPSDOC=no
1681ce6676dbSmrgBUILDHTMLDOC=no
1682ce6676dbSmrg
1683ce6676dbSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
1684ce6676dbSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1685ce6676dbSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
1686ce6676dbSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1687ce6676dbSmrg
168830f8ce46SmrgAC_MSG_CHECKING([whether to build text documentation])
168930f8ce46Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
1690ce6676dbSmrg   test x$BUILD_TXTDOC != xno; then
1691ce6676dbSmrg	BUILDTXTDOC=yes
1692ce6676dbSmrgfi
1693ce6676dbSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1694ce6676dbSmrgAC_MSG_RESULT([$BUILDTXTDOC])
1695ce6676dbSmrg
169630f8ce46SmrgAC_MSG_CHECKING([whether to build PDF documentation])
169730f8ce46Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
1698ce6676dbSmrg   test x$BUILD_PDFDOC != xno; then
1699ce6676dbSmrg	BUILDPDFDOC=yes
1700ce6676dbSmrgfi
1701ce6676dbSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1702ce6676dbSmrgAC_MSG_RESULT([$BUILDPDFDOC])
1703ce6676dbSmrg
170430f8ce46SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
170530f8ce46Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
1706ce6676dbSmrg   test x$BUILD_PSDOC != xno; then
1707ce6676dbSmrg	BUILDPSDOC=yes
1708ce6676dbSmrgfi
1709ce6676dbSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1710ce6676dbSmrgAC_MSG_RESULT([$BUILDPSDOC])
1711ce6676dbSmrg
171230f8ce46SmrgAC_MSG_CHECKING([whether to build HTML documentation])
171330f8ce46Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
1714ce6676dbSmrg   test x$BUILD_HTMLDOC != xno; then
1715ce6676dbSmrg	BUILDHTMLDOC=yes
1716ce6676dbSmrgfi
1717ce6676dbSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1718ce6676dbSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
1719ce6676dbSmrg
1720ce6676dbSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1721ce6676dbSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1722ce6676dbSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1723ce6676dbSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1724ce6676dbSmrg
1725ce6676dbSmrgAC_SUBST(MAKE_TEXT)
1726ce6676dbSmrgAC_SUBST(MAKE_PS)
1727ce6676dbSmrgAC_SUBST(MAKE_PDF)
1728ce6676dbSmrgAC_SUBST(MAKE_HTML)
1729ce6676dbSmrg]) # XORG_CHECK_DOCBOOK
1730ce6676dbSmrg
173130f8ce46Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
173230f8ce46Smrg# ----------------
173330f8ce46Smrg# Minimum version: 1.5.0
173430f8ce46Smrg# Minimum version for optional DEFAULT argument: 1.11.0
173530f8ce46Smrg#
173630f8ce46Smrg# Documentation tools are not always available on all platforms and sometimes
173730f8ce46Smrg# not at the appropriate level. This macro enables a module to test for the
173830f8ce46Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
173930f8ce46Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
174030f8ce46Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
174130f8ce46Smrg# --with-xmlto assumes 'auto'.
174230f8ce46Smrg#
174330f8ce46Smrg# Interface to module:
174430f8ce46Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
174530f8ce46Smrg# XMLTO:	returns the path of the xmlto program found
174630f8ce46Smrg#		returns the path set by the user in the environment
174730f8ce46Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
174830f8ce46Smrg#		'no' user instructs the module not to use xmlto
174930f8ce46Smrg#
175030f8ce46Smrg# Added in version 1.10.0
175130f8ce46Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
175230f8ce46Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
175330f8ce46Smrg#
175430f8ce46Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
175530f8ce46Smrg#
175630f8ce46SmrgAC_DEFUN([XORG_WITH_XMLTO],[
175730f8ce46SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
175830f8ce46Smrgm4_define([_defopt], m4_default([$2], [auto]))
175930f8ce46SmrgAC_ARG_WITH(xmlto,
176030f8ce46Smrg	AS_HELP_STRING([--with-xmlto],
176130f8ce46Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
176230f8ce46Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
176330f8ce46Smrgm4_undefine([_defopt])
176430f8ce46Smrg
176530f8ce46Smrgif test "x$use_xmlto" = x"auto"; then
176630f8ce46Smrg   AC_PATH_PROG([XMLTO], [xmlto])
176730f8ce46Smrg   if test "x$XMLTO" = "x"; then
176830f8ce46Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
176930f8ce46Smrg	have_xmlto=no
177030f8ce46Smrg   else
177130f8ce46Smrg        have_xmlto=yes
177230f8ce46Smrg   fi
177330f8ce46Smrgelif test "x$use_xmlto" = x"yes" ; then
177430f8ce46Smrg   AC_PATH_PROG([XMLTO], [xmlto])
177530f8ce46Smrg   if test "x$XMLTO" = "x"; then
177630f8ce46Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
177730f8ce46Smrg   fi
177830f8ce46Smrg   have_xmlto=yes
177930f8ce46Smrgelif test "x$use_xmlto" = x"no" ; then
178030f8ce46Smrg   if test "x$XMLTO" != "x"; then
178130f8ce46Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
178230f8ce46Smrg   fi
178330f8ce46Smrg   have_xmlto=no
178430f8ce46Smrgelse
178530f8ce46Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
178630f8ce46Smrgfi
178730f8ce46Smrg
178830f8ce46Smrg# Test for a minimum version of xmlto, if provided.
178930f8ce46Smrgm4_ifval([$1],
179030f8ce46Smrg[if test "$have_xmlto" = yes; then
179130f8ce46Smrg    # scrape the xmlto version
179230f8ce46Smrg    AC_MSG_CHECKING([the xmlto version])
179330f8ce46Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
179430f8ce46Smrg    AC_MSG_RESULT([$xmlto_version])
179530f8ce46Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
179630f8ce46Smrg        [if test "x$use_xmlto" = xauto; then
179730f8ce46Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
179830f8ce46Smrg            have_xmlto=no
179930f8ce46Smrg        else
180030f8ce46Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
180130f8ce46Smrg        fi])
180230f8ce46Smrgfi])
180330f8ce46Smrg
180430f8ce46Smrg# Test for the ability of xmlto to generate a text target
180530f8ce46Smrghave_xmlto_text=no
180630f8ce46Smrgcat > conftest.xml << "EOF"
180730f8ce46SmrgEOF
180830f8ce46SmrgAS_IF([test "$have_xmlto" = yes],
180930f8ce46Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
181030f8ce46Smrg             [have_xmlto_text=yes],
181130f8ce46Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
181230f8ce46Smrgrm -f conftest.xml
181330f8ce46SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
181430f8ce46SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
181530f8ce46Smrg]) # XORG_WITH_XMLTO
181630f8ce46Smrg
181730f8ce46Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
181830f8ce46Smrg# ----------------
181930f8ce46Smrg# Minimum version: 1.5.0
182030f8ce46Smrg# Minimum version for optional DEFAULT argument: 1.11.0
182130f8ce46Smrg#
182230f8ce46Smrg# Documentation tools are not always available on all platforms and sometimes
182330f8ce46Smrg# not at the appropriate level. This macro enables a module to test for the
182430f8ce46Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
182530f8ce46Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
182630f8ce46Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
182730f8ce46Smrg# --with-asciidoc assumes 'auto'.
182830f8ce46Smrg#
182930f8ce46Smrg# Interface to module:
183030f8ce46Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
183130f8ce46Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
183230f8ce46Smrg#		 returns the path set by the user in the environment
183330f8ce46Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
183430f8ce46Smrg#		  'no' user instructs the module not to use asciidoc
183530f8ce46Smrg#
183630f8ce46Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
183730f8ce46Smrg#
183830f8ce46SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
183930f8ce46SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
184030f8ce46Smrgm4_define([_defopt], m4_default([$2], [auto]))
184130f8ce46SmrgAC_ARG_WITH(asciidoc,
184230f8ce46Smrg	AS_HELP_STRING([--with-asciidoc],
184330f8ce46Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
184430f8ce46Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
184530f8ce46Smrgm4_undefine([_defopt])
184630f8ce46Smrg
184730f8ce46Smrgif test "x$use_asciidoc" = x"auto"; then
184830f8ce46Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
184930f8ce46Smrg   if test "x$ASCIIDOC" = "x"; then
185030f8ce46Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
185130f8ce46Smrg	have_asciidoc=no
185230f8ce46Smrg   else
185330f8ce46Smrg        have_asciidoc=yes
185430f8ce46Smrg   fi
185530f8ce46Smrgelif test "x$use_asciidoc" = x"yes" ; then
185630f8ce46Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
185730f8ce46Smrg   if test "x$ASCIIDOC" = "x"; then
185830f8ce46Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
185930f8ce46Smrg   fi
186030f8ce46Smrg   have_asciidoc=yes
186130f8ce46Smrgelif test "x$use_asciidoc" = x"no" ; then
186230f8ce46Smrg   if test "x$ASCIIDOC" != "x"; then
186330f8ce46Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
186430f8ce46Smrg   fi
186530f8ce46Smrg   have_asciidoc=no
186630f8ce46Smrgelse
186730f8ce46Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
186830f8ce46Smrgfi
186930f8ce46Smrgm4_ifval([$1],
187030f8ce46Smrg[if test "$have_asciidoc" = yes; then
187130f8ce46Smrg    # scrape the asciidoc version
187230f8ce46Smrg    AC_MSG_CHECKING([the asciidoc version])
187330f8ce46Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
187430f8ce46Smrg    AC_MSG_RESULT([$asciidoc_version])
187530f8ce46Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
187630f8ce46Smrg        [if test "x$use_asciidoc" = xauto; then
187730f8ce46Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
187830f8ce46Smrg            have_asciidoc=no
187930f8ce46Smrg        else
188030f8ce46Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
188130f8ce46Smrg        fi])
188230f8ce46Smrgfi])
188330f8ce46SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
188430f8ce46Smrg]) # XORG_WITH_ASCIIDOC
188530f8ce46Smrg
188630f8ce46Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
188730f8ce46Smrg# --------------------------------
188830f8ce46Smrg# Minimum version: 1.5.0
188930f8ce46Smrg# Minimum version for optional DEFAULT argument: 1.11.0
189030f8ce46Smrg#
189130f8ce46Smrg# Documentation tools are not always available on all platforms and sometimes
189230f8ce46Smrg# not at the appropriate level. This macro enables a module to test for the
189330f8ce46Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
189430f8ce46Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
189530f8ce46Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
189630f8ce46Smrg# --with-doxygen assumes 'auto'.
189730f8ce46Smrg#
189830f8ce46Smrg# Interface to module:
189930f8ce46Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
190030f8ce46Smrg# DOXYGEN:	 returns the path of the doxygen program found
190130f8ce46Smrg#		 returns the path set by the user in the environment
190230f8ce46Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
190330f8ce46Smrg#		  'no' user instructs the module not to use doxygen
190430f8ce46Smrg#
190530f8ce46Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
190630f8ce46Smrg#
190730f8ce46SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
190830f8ce46SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
190930f8ce46Smrgm4_define([_defopt], m4_default([$2], [auto]))
191030f8ce46SmrgAC_ARG_WITH(doxygen,
191130f8ce46Smrg	AS_HELP_STRING([--with-doxygen],
191230f8ce46Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
191330f8ce46Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
191430f8ce46Smrgm4_undefine([_defopt])
191530f8ce46Smrg
191630f8ce46Smrgif test "x$use_doxygen" = x"auto"; then
191730f8ce46Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
191830f8ce46Smrg   if test "x$DOXYGEN" = "x"; then
191930f8ce46Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
192030f8ce46Smrg	have_doxygen=no
192130f8ce46Smrg   else
192230f8ce46Smrg        have_doxygen=yes
192330f8ce46Smrg   fi
192430f8ce46Smrgelif test "x$use_doxygen" = x"yes" ; then
192530f8ce46Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
192630f8ce46Smrg   if test "x$DOXYGEN" = "x"; then
192730f8ce46Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
192830f8ce46Smrg   fi
192930f8ce46Smrg   have_doxygen=yes
193030f8ce46Smrgelif test "x$use_doxygen" = x"no" ; then
193130f8ce46Smrg   if test "x$DOXYGEN" != "x"; then
193230f8ce46Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
193330f8ce46Smrg   fi
193430f8ce46Smrg   have_doxygen=no
193530f8ce46Smrgelse
193630f8ce46Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
193730f8ce46Smrgfi
193830f8ce46Smrgm4_ifval([$1],
193930f8ce46Smrg[if test "$have_doxygen" = yes; then
194030f8ce46Smrg    # scrape the doxygen version
194130f8ce46Smrg    AC_MSG_CHECKING([the doxygen version])
194230f8ce46Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
194330f8ce46Smrg    AC_MSG_RESULT([$doxygen_version])
194430f8ce46Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
194530f8ce46Smrg        [if test "x$use_doxygen" = xauto; then
194630f8ce46Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
194730f8ce46Smrg            have_doxygen=no
194830f8ce46Smrg        else
194930f8ce46Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
195030f8ce46Smrg        fi])
195130f8ce46Smrgfi])
195230f8ce46SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
195330f8ce46Smrg]) # XORG_WITH_DOXYGEN
195430f8ce46Smrg
195530f8ce46Smrg# XORG_WITH_GROFF([DEFAULT])
195630f8ce46Smrg# ----------------
195730f8ce46Smrg# Minimum version: 1.6.0
195830f8ce46Smrg# Minimum version for optional DEFAULT argument: 1.11.0
195930f8ce46Smrg#
196030f8ce46Smrg# Documentation tools are not always available on all platforms and sometimes
196130f8ce46Smrg# not at the appropriate level. This macro enables a module to test for the
196230f8ce46Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
196330f8ce46Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
196430f8ce46Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
196530f8ce46Smrg# --with-groff assumes 'auto'.
196630f8ce46Smrg#
196730f8ce46Smrg# Interface to module:
196830f8ce46Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
196930f8ce46Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
197030f8ce46Smrg# HAVE_GROFF_MS: the -ms macros package
197130f8ce46Smrg# GROFF:	 returns the path of the groff program found
197230f8ce46Smrg#		 returns the path set by the user in the environment
197330f8ce46Smrg# --with-groff:	 'yes' user instructs the module to use groff
197430f8ce46Smrg#		 'no' user instructs the module not to use groff
197530f8ce46Smrg#
197630f8ce46Smrg# Added in version 1.9.0:
197730f8ce46Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
197830f8ce46Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
197930f8ce46Smrg#		   psselect from the psutils package.
198030f8ce46Smrg#		   the ghostcript package. Refer to the grohtml man pages
198130f8ce46Smrg#
198230f8ce46Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
198330f8ce46Smrg#
198430f8ce46Smrg# OS and distros often splits groff in a basic and full package, the former
198530f8ce46Smrg# having the groff program and the later having devices, fonts and macros
198630f8ce46Smrg# Checking for the groff executable is not enough.
198730f8ce46Smrg#
198830f8ce46Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
198930f8ce46Smrg# unset HAVE_GROFF or GROFF env variables.
199030f8ce46Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
199130f8ce46Smrg#
199230f8ce46SmrgAC_DEFUN([XORG_WITH_GROFF],[
199330f8ce46SmrgAC_ARG_VAR([GROFF], [Path to groff command])
199430f8ce46Smrgm4_define([_defopt], m4_default([$1], [auto]))
199530f8ce46SmrgAC_ARG_WITH(groff,
199630f8ce46Smrg	AS_HELP_STRING([--with-groff],
199730f8ce46Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
199830f8ce46Smrg	   [use_groff=$withval], [use_groff=]_defopt)
199930f8ce46Smrgm4_undefine([_defopt])
200030f8ce46Smrg
200130f8ce46Smrgif test "x$use_groff" = x"auto"; then
200230f8ce46Smrg   AC_PATH_PROG([GROFF], [groff])
200330f8ce46Smrg   if test "x$GROFF" = "x"; then
200430f8ce46Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
200530f8ce46Smrg	have_groff=no
200630f8ce46Smrg   else
200730f8ce46Smrg        have_groff=yes
200830f8ce46Smrg   fi
200930f8ce46Smrgelif test "x$use_groff" = x"yes" ; then
201030f8ce46Smrg   AC_PATH_PROG([GROFF], [groff])
201130f8ce46Smrg   if test "x$GROFF" = "x"; then
201230f8ce46Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
201330f8ce46Smrg   fi
201430f8ce46Smrg   have_groff=yes
201530f8ce46Smrgelif test "x$use_groff" = x"no" ; then
201630f8ce46Smrg   if test "x$GROFF" != "x"; then
201730f8ce46Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
201830f8ce46Smrg   fi
201930f8ce46Smrg   have_groff=no
202030f8ce46Smrgelse
202130f8ce46Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
202230f8ce46Smrgfi
202330f8ce46Smrg
202430f8ce46Smrg# We have groff, test for the presence of the macro packages
202530f8ce46Smrgif test "x$have_groff" = x"yes"; then
202630f8ce46Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
202730f8ce46Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
202830f8ce46Smrg        groff_ms_works=yes
202930f8ce46Smrg    else
203030f8ce46Smrg        groff_ms_works=no
203130f8ce46Smrg    fi
203230f8ce46Smrg    AC_MSG_RESULT([$groff_ms_works])
203330f8ce46Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
203430f8ce46Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
203530f8ce46Smrg        groff_mm_works=yes
203630f8ce46Smrg    else
203730f8ce46Smrg        groff_mm_works=no
203830f8ce46Smrg    fi
203930f8ce46Smrg    AC_MSG_RESULT([$groff_mm_works])
204030f8ce46Smrgfi
204130f8ce46Smrg
204230f8ce46Smrg# We have groff, test for HTML dependencies, one command per package
204330f8ce46Smrgif test "x$have_groff" = x"yes"; then
204430f8ce46Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
204530f8ce46Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
204630f8ce46Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
204730f8ce46Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
204830f8ce46Smrg      have_groff_html=yes
204930f8ce46Smrg   else
205030f8ce46Smrg      have_groff_html=no
205130f8ce46Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
205230f8ce46Smrg   fi
205330f8ce46Smrgfi
205430f8ce46Smrg
205530f8ce46Smrg# Set Automake conditionals for Makefiles
205630f8ce46SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
205730f8ce46SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
205830f8ce46SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
205930f8ce46SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
206030f8ce46Smrg]) # XORG_WITH_GROFF
206130f8ce46Smrg
206230f8ce46Smrg# XORG_WITH_FOP([DEFAULT])
206330f8ce46Smrg# ----------------
206430f8ce46Smrg# Minimum version: 1.6.0
206530f8ce46Smrg# Minimum version for optional DEFAULT argument: 1.11.0
206630f8ce46Smrg#
206730f8ce46Smrg# Documentation tools are not always available on all platforms and sometimes
206830f8ce46Smrg# not at the appropriate level. This macro enables a module to test for the
206930f8ce46Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
207030f8ce46Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
207130f8ce46Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
207230f8ce46Smrg# --with-fop assumes 'auto'.
207330f8ce46Smrg#
207430f8ce46Smrg# Interface to module:
207530f8ce46Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
207630f8ce46Smrg# FOP:	 	returns the path of the fop program found
207730f8ce46Smrg#		returns the path set by the user in the environment
207830f8ce46Smrg# --with-fop: 	'yes' user instructs the module to use fop
207930f8ce46Smrg#		'no' user instructs the module not to use fop
208030f8ce46Smrg#
208130f8ce46Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
208230f8ce46Smrg#
208330f8ce46SmrgAC_DEFUN([XORG_WITH_FOP],[
208430f8ce46SmrgAC_ARG_VAR([FOP], [Path to fop command])
208530f8ce46Smrgm4_define([_defopt], m4_default([$1], [auto]))
208630f8ce46SmrgAC_ARG_WITH(fop,
208730f8ce46Smrg	AS_HELP_STRING([--with-fop],
208830f8ce46Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
208930f8ce46Smrg	   [use_fop=$withval], [use_fop=]_defopt)
209030f8ce46Smrgm4_undefine([_defopt])
209130f8ce46Smrg
209230f8ce46Smrgif test "x$use_fop" = x"auto"; then
209330f8ce46Smrg   AC_PATH_PROG([FOP], [fop])
209430f8ce46Smrg   if test "x$FOP" = "x"; then
209530f8ce46Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
209630f8ce46Smrg	have_fop=no
209730f8ce46Smrg   else
209830f8ce46Smrg        have_fop=yes
209930f8ce46Smrg   fi
210030f8ce46Smrgelif test "x$use_fop" = x"yes" ; then
210130f8ce46Smrg   AC_PATH_PROG([FOP], [fop])
210230f8ce46Smrg   if test "x$FOP" = "x"; then
210330f8ce46Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
210430f8ce46Smrg   fi
210530f8ce46Smrg   have_fop=yes
210630f8ce46Smrgelif test "x$use_fop" = x"no" ; then
210730f8ce46Smrg   if test "x$FOP" != "x"; then
210830f8ce46Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
210930f8ce46Smrg   fi
211030f8ce46Smrg   have_fop=no
211130f8ce46Smrgelse
211230f8ce46Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
211330f8ce46Smrgfi
211430f8ce46SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
211530f8ce46Smrg]) # XORG_WITH_FOP
211630f8ce46Smrg
211730f8ce46Smrg# XORG_WITH_PS2PDF([DEFAULT])
211830f8ce46Smrg# ----------------
211930f8ce46Smrg# Minimum version: 1.6.0
212030f8ce46Smrg# Minimum version for optional DEFAULT argument: 1.11.0
212130f8ce46Smrg#
212230f8ce46Smrg# Documentation tools are not always available on all platforms and sometimes
212330f8ce46Smrg# not at the appropriate level. This macro enables a module to test for the
212430f8ce46Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
212530f8ce46Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
212630f8ce46Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
212730f8ce46Smrg# --with-ps2pdf assumes 'auto'.
212830f8ce46Smrg#
212930f8ce46Smrg# Interface to module:
213030f8ce46Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
213130f8ce46Smrg# PS2PDF:	returns the path of the ps2pdf program found
213230f8ce46Smrg#		returns the path set by the user in the environment
213330f8ce46Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
213430f8ce46Smrg#		 'no' user instructs the module not to use ps2pdf
213530f8ce46Smrg#
213630f8ce46Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
213730f8ce46Smrg#
213830f8ce46SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
213930f8ce46SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
214030f8ce46Smrgm4_define([_defopt], m4_default([$1], [auto]))
214130f8ce46SmrgAC_ARG_WITH(ps2pdf,
214230f8ce46Smrg	AS_HELP_STRING([--with-ps2pdf],
214330f8ce46Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
214430f8ce46Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
214530f8ce46Smrgm4_undefine([_defopt])
214630f8ce46Smrg
214730f8ce46Smrgif test "x$use_ps2pdf" = x"auto"; then
214830f8ce46Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
214930f8ce46Smrg   if test "x$PS2PDF" = "x"; then
215030f8ce46Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
215130f8ce46Smrg	have_ps2pdf=no
215230f8ce46Smrg   else
215330f8ce46Smrg        have_ps2pdf=yes
215430f8ce46Smrg   fi
215530f8ce46Smrgelif test "x$use_ps2pdf" = x"yes" ; then
215630f8ce46Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
215730f8ce46Smrg   if test "x$PS2PDF" = "x"; then
215830f8ce46Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
215930f8ce46Smrg   fi
216030f8ce46Smrg   have_ps2pdf=yes
216130f8ce46Smrgelif test "x$use_ps2pdf" = x"no" ; then
216230f8ce46Smrg   if test "x$PS2PDF" != "x"; then
216330f8ce46Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
216430f8ce46Smrg   fi
216530f8ce46Smrg   have_ps2pdf=no
216630f8ce46Smrgelse
216730f8ce46Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
216830f8ce46Smrgfi
216930f8ce46SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
217030f8ce46Smrg]) # XORG_WITH_PS2PDF
217130f8ce46Smrg
217230f8ce46Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
217330f8ce46Smrg# ----------------
217430f8ce46Smrg# Minimum version: 1.6.0
217530f8ce46Smrg#
217630f8ce46Smrg# Documentation tools are not always available on all platforms and sometimes
217730f8ce46Smrg# not at the appropriate level. This macro enables a builder to skip all
217830f8ce46Smrg# documentation targets except traditional man pages.
217930f8ce46Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
218030f8ce46Smrg# maximum flexibilty in controlling documentation building.
218130f8ce46Smrg# Refer to:
218230f8ce46Smrg# XORG_WITH_XMLTO         --with-xmlto
218330f8ce46Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
218430f8ce46Smrg# XORG_WITH_DOXYGEN       --with-doxygen
218530f8ce46Smrg# XORG_WITH_FOP           --with-fop
218630f8ce46Smrg# XORG_WITH_GROFF         --with-groff
218730f8ce46Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
218830f8ce46Smrg#
218930f8ce46Smrg# Interface to module:
219030f8ce46Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
219130f8ce46Smrg# --enable-docs: 'yes' user instructs the module to generate docs
219230f8ce46Smrg#		 'no' user instructs the module not to generate docs
219330f8ce46Smrg# parm1:	specify the default value, yes or no.
219430f8ce46Smrg#
219530f8ce46SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
219630f8ce46Smrgm4_define([default], m4_default([$1], [yes]))
219730f8ce46SmrgAC_ARG_ENABLE(docs,
219830f8ce46Smrg	AS_HELP_STRING([--enable-docs],
219930f8ce46Smrg	   [Enable building the documentation (default: ]default[)]),
220030f8ce46Smrg	   [build_docs=$enableval], [build_docs=]default)
220130f8ce46Smrgm4_undefine([default])
220230f8ce46SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
220330f8ce46SmrgAC_MSG_CHECKING([whether to build documentation])
220430f8ce46SmrgAC_MSG_RESULT([$build_docs])
220530f8ce46Smrg]) # XORG_ENABLE_DOCS
220630f8ce46Smrg
220730f8ce46Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
220830f8ce46Smrg# ----------------
220930f8ce46Smrg# Minimum version: 1.6.0
221030f8ce46Smrg#
221130f8ce46Smrg# This macro enables a builder to skip all developer documentation.
221230f8ce46Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
221330f8ce46Smrg# maximum flexibilty in controlling documentation building.
221430f8ce46Smrg# Refer to:
221530f8ce46Smrg# XORG_WITH_XMLTO         --with-xmlto
221630f8ce46Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
221730f8ce46Smrg# XORG_WITH_DOXYGEN       --with-doxygen
221830f8ce46Smrg# XORG_WITH_FOP           --with-fop
221930f8ce46Smrg# XORG_WITH_GROFF         --with-groff
222030f8ce46Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
222130f8ce46Smrg#
222230f8ce46Smrg# Interface to module:
222330f8ce46Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
222430f8ce46Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
222530f8ce46Smrg#			'no' user instructs the module not to generate developer docs
222630f8ce46Smrg# parm1:		specify the default value, yes or no.
222730f8ce46Smrg#
222830f8ce46SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
222930f8ce46Smrgm4_define([devel_default], m4_default([$1], [yes]))
223030f8ce46SmrgAC_ARG_ENABLE(devel-docs,
223130f8ce46Smrg	AS_HELP_STRING([--enable-devel-docs],
223230f8ce46Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
223330f8ce46Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
223430f8ce46Smrgm4_undefine([devel_default])
223530f8ce46SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
223630f8ce46SmrgAC_MSG_CHECKING([whether to build developer documentation])
223730f8ce46SmrgAC_MSG_RESULT([$build_devel_docs])
223830f8ce46Smrg]) # XORG_ENABLE_DEVEL_DOCS
223930f8ce46Smrg
224030f8ce46Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
224130f8ce46Smrg# ----------------
224230f8ce46Smrg# Minimum version: 1.6.0
224330f8ce46Smrg#
224430f8ce46Smrg# This macro enables a builder to skip all functional specification targets.
224530f8ce46Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
224630f8ce46Smrg# maximum flexibilty in controlling documentation building.
224730f8ce46Smrg# Refer to:
224830f8ce46Smrg# XORG_WITH_XMLTO         --with-xmlto
224930f8ce46Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
225030f8ce46Smrg# XORG_WITH_DOXYGEN       --with-doxygen
225130f8ce46Smrg# XORG_WITH_FOP           --with-fop
225230f8ce46Smrg# XORG_WITH_GROFF         --with-groff
225330f8ce46Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
225430f8ce46Smrg#
225530f8ce46Smrg# Interface to module:
225630f8ce46Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
225730f8ce46Smrg# --enable-specs:	'yes' user instructs the module to generate specs
225830f8ce46Smrg#			'no' user instructs the module not to generate specs
225930f8ce46Smrg# parm1:		specify the default value, yes or no.
226030f8ce46Smrg#
226130f8ce46SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
226230f8ce46Smrgm4_define([spec_default], m4_default([$1], [yes]))
226330f8ce46SmrgAC_ARG_ENABLE(specs,
226430f8ce46Smrg	AS_HELP_STRING([--enable-specs],
226530f8ce46Smrg	   [Enable building the specs (default: ]spec_default[)]),
226630f8ce46Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
226730f8ce46Smrgm4_undefine([spec_default])
226830f8ce46SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
226930f8ce46SmrgAC_MSG_CHECKING([whether to build functional specifications])
227030f8ce46SmrgAC_MSG_RESULT([$build_specs])
227130f8ce46Smrg]) # XORG_ENABLE_SPECS
227230f8ce46Smrg
2273ce6676dbSmrg# XORG_CHECK_MALLOC_ZERO
2274ce6676dbSmrg# ----------------------
2275ce6676dbSmrg# Minimum version: 1.0.0
2276ce6676dbSmrg#
2277ce6676dbSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
2278ce6676dbSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
2279ce6676dbSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
2280ce6676dbSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
2281ce6676dbSmrgAC_ARG_ENABLE(malloc0returnsnull,
228230f8ce46Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
2283ce6676dbSmrg		       [malloc(0) returns NULL (default: auto)]),
2284ce6676dbSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
2285ce6676dbSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
2286ce6676dbSmrg
2287ce6676dbSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
2288ce6676dbSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
2289ce6676dbSmrg	AC_RUN_IFELSE([
2290ce6676dbSmrgchar *malloc();
2291ce6676dbSmrgchar *realloc();
2292ce6676dbSmrgchar *calloc();
2293ce6676dbSmrgmain() {
2294ce6676dbSmrg    char *m0, *r0, *c0, *p;
2295ce6676dbSmrg    m0 = malloc(0);
2296ce6676dbSmrg    p = malloc(10);
2297ce6676dbSmrg    r0 = realloc(p,0);
2298ce6676dbSmrg    c0 = calloc(0);
2299ce6676dbSmrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
2300ce6676dbSmrg}],
2301ce6676dbSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
230230f8ce46Smrg		[MALLOC_ZERO_RETURNS_NULL=no],
230330f8ce46Smrg		[MALLOC_ZERO_RETURNS_NULL=yes])
2304ce6676dbSmrgfi
2305ce6676dbSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
2306ce6676dbSmrg
2307ce6676dbSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
2308ce6676dbSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
2309ce6676dbSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
2310ce6676dbSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
2311ce6676dbSmrgelse
2312ce6676dbSmrg	MALLOC_ZERO_CFLAGS=""
2313ce6676dbSmrg	XMALLOC_ZERO_CFLAGS=""
2314ce6676dbSmrg	XTMALLOC_ZERO_CFLAGS=""
2315ce6676dbSmrgfi
2316ce6676dbSmrg
2317ce6676dbSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
2318ce6676dbSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
2319ce6676dbSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
2320ce6676dbSmrg]) # XORG_CHECK_MALLOC_ZERO
2321ce6676dbSmrg
2322ce6676dbSmrg# XORG_WITH_LINT()
2323ce6676dbSmrg# ----------------
2324ce6676dbSmrg# Minimum version: 1.1.0
2325ce6676dbSmrg#
232630f8ce46Smrg# This macro enables the use of a tool that flags some suspicious and
232730f8ce46Smrg# non-portable constructs (likely to be bugs) in C language source code.
232830f8ce46Smrg# It will attempt to locate the tool and use appropriate options.
232930f8ce46Smrg# There are various lint type tools on different platforms.
233030f8ce46Smrg#
233130f8ce46Smrg# Interface to module:
233230f8ce46Smrg# LINT:		returns the path to the tool found on the platform
233330f8ce46Smrg#		or the value set to LINT on the configure cmd line
233430f8ce46Smrg#		also an Automake conditional
233530f8ce46Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
233630f8ce46Smrg#
233730f8ce46Smrg# --with-lint:	'yes' user instructs the module to use lint
233830f8ce46Smrg#		'no' user instructs the module not to use lint (default)
233930f8ce46Smrg#
234030f8ce46Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
234130f8ce46Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
2342ce6676dbSmrg#
2343ce6676dbSmrgAC_DEFUN([XORG_WITH_LINT],[
2344ce6676dbSmrg
234530f8ce46SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
234630f8ce46SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
234730f8ce46SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
2348ce6676dbSmrg		[Use a lint-style source code checker (default: disabled)])],
2349ce6676dbSmrg		[use_lint=$withval], [use_lint=no])
235030f8ce46Smrg
235130f8ce46Smrg# Obtain platform specific info like program name and options
235230f8ce46Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
235330f8ce46Smrgcase $host_os in
235430f8ce46Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
235530f8ce46Smrg	lint_name=splint
235630f8ce46Smrg	lint_options="-badflag"
235730f8ce46Smrg	;;
235830f8ce46Smrg  *freebsd* | *netbsd*)
235930f8ce46Smrg	lint_name=lint
236030f8ce46Smrg	lint_options="-u -b"
236130f8ce46Smrg	;;
236230f8ce46Smrg  *solaris*)
236330f8ce46Smrg	lint_name=lint
236430f8ce46Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
236530f8ce46Smrg	;;
236630f8ce46Smrgesac
236730f8ce46Smrg
236830f8ce46Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
236930f8ce46Smrgif test "x$use_lint" = x"yes" ; then
237030f8ce46Smrg   AC_PATH_PROG([LINT], [$lint_name])
237130f8ce46Smrg   if test "x$LINT" = "x"; then
237230f8ce46Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
237330f8ce46Smrg   fi
237430f8ce46Smrgelif test "x$use_lint" = x"no" ; then
237530f8ce46Smrg   if test "x$LINT" != "x"; then
237630f8ce46Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
237730f8ce46Smrg   fi
2378ce6676dbSmrgelse
237930f8ce46Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
2380ce6676dbSmrgfi
238130f8ce46Smrg
238230f8ce46Smrg# User supplied flags override default flags
238330f8ce46Smrgif test "x$LINT_FLAGS" != "x"; then
238430f8ce46Smrg   lint_options=$LINT_FLAGS
2385ce6676dbSmrgfi
2386ce6676dbSmrg
238730f8ce46SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
238830f8ce46SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
2389ce6676dbSmrg
2390ce6676dbSmrg]) # XORG_WITH_LINT
2391ce6676dbSmrg
2392ce6676dbSmrg# XORG_LINT_LIBRARY(LIBNAME)
2393ce6676dbSmrg# --------------------------
2394ce6676dbSmrg# Minimum version: 1.1.0
2395ce6676dbSmrg#
2396ce6676dbSmrg# Sets up flags for building lint libraries for checking programs that call
2397ce6676dbSmrg# functions in the library.
2398ce6676dbSmrg#
239930f8ce46Smrg# Interface to module:
240030f8ce46Smrg# LINTLIB		- Automake variable with the name of lint library file to make
240130f8ce46Smrg# MAKE_LINT_LIB		- Automake conditional
240230f8ce46Smrg#
240330f8ce46Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
240430f8ce46Smrg#			  - 'no' user instructs the module not to create a lint library (default)
2405ce6676dbSmrg
2406ce6676dbSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
2407ce6676dbSmrgAC_REQUIRE([XORG_WITH_LINT])
240830f8ce46SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
2409ce6676dbSmrg	[Create lint library (default: disabled)])],
2410ce6676dbSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
241130f8ce46Smrg
241230f8ce46Smrgif test "x$make_lint_lib" = x"yes" ; then
241330f8ce46Smrg   LINTLIB=llib-l$1.ln
241430f8ce46Smrg   if test "x$LINT" = "x"; then
241530f8ce46Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
241630f8ce46Smrg   fi
241730f8ce46Smrgelif test "x$make_lint_lib" != x"no" ; then
241830f8ce46Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
2419ce6676dbSmrgfi
242030f8ce46Smrg
2421ce6676dbSmrgAC_SUBST(LINTLIB)
2422ce6676dbSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
2423ce6676dbSmrg
2424ce6676dbSmrg]) # XORG_LINT_LIBRARY
2425ce6676dbSmrg
2426ce6676dbSmrg# XORG_CWARNFLAGS
2427ce6676dbSmrg# ---------------
2428ce6676dbSmrg# Minimum version: 1.2.0
2429ce6676dbSmrg#
2430ce6676dbSmrg# Defines CWARNFLAGS to enable C compiler warnings.
2431ce6676dbSmrg#
2432ce6676dbSmrgAC_DEFUN([XORG_CWARNFLAGS], [
243330f8ce46SmrgAC_REQUIRE([AC_PROG_CC_C99])
2434ce6676dbSmrgif  test "x$GCC" = xyes ; then
2435ce6676dbSmrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
2436ce6676dbSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
243730f8ce46Smrg-Wbad-function-cast -Wformat=2"
2438ce6676dbSmrg    case `$CC -dumpversion` in
2439ce6676dbSmrg    3.4.* | 4.*)
2440ce6676dbSmrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
2441ce6676dbSmrg	;;
2442ce6676dbSmrg    esac
2443ce6676dbSmrgelse
2444ce6676dbSmrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
2445ce6676dbSmrg    if test "x$SUNCC" = "xyes"; then
2446ce6676dbSmrg	CWARNFLAGS="-v"
2447ce6676dbSmrg    fi
2448ce6676dbSmrgfi
2449ce6676dbSmrgAC_SUBST(CWARNFLAGS)
2450ce6676dbSmrg]) # XORG_CWARNFLAGS
245130f8ce46Smrg
245230f8ce46Smrg# XORG_STRICT_OPTION
245330f8ce46Smrg# -----------------------
245430f8ce46Smrg# Minimum version: 1.3.0
245530f8ce46Smrg#
245630f8ce46Smrg# Add configure option to enable strict compilation
245730f8ce46SmrgAC_DEFUN([XORG_STRICT_OPTION], [
245830f8ce46Smrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
245930f8ce46SmrgAC_REQUIRE([AC_PROG_CC_C99])
246030f8ce46SmrgAC_REQUIRE([XORG_CWARNFLAGS])
246130f8ce46Smrg
246230f8ce46SmrgAC_ARG_ENABLE(strict-compilation,
246330f8ce46Smrg			  AS_HELP_STRING([--enable-strict-compilation],
246430f8ce46Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
246530f8ce46Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
246630f8ce46Smrgif test "x$STRICT_COMPILE" = "xyes"; then
246730f8ce46Smrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
246830f8ce46Smrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
246930f8ce46Smrg	if test "x$GCC" = xyes ; then
247030f8ce46Smrg		STRICT_CFLAGS="-pedantic -Werror"
247130f8ce46Smrg	elif test "x$SUNCC" = "xyes"; then
247230f8ce46Smrg		STRICT_CFLAGS="-errwarn"
247330f8ce46Smrg    elif test "x$INTELCC" = "xyes"; then
247430f8ce46Smrg		STRICT_CFLAGS="-Werror"
247530f8ce46Smrg	fi
247630f8ce46Smrgfi
247730f8ce46SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
247830f8ce46SmrgAC_SUBST([CWARNFLAGS])
247930f8ce46Smrg]) # XORG_STRICT_OPTION
248030f8ce46Smrg
248130f8ce46Smrg# XORG_DEFAULT_OPTIONS
248230f8ce46Smrg# --------------------
248330f8ce46Smrg# Minimum version: 1.3.0
248430f8ce46Smrg#
248530f8ce46Smrg# Defines default options for X.Org modules.
248630f8ce46Smrg#
248730f8ce46SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
248830f8ce46SmrgAC_REQUIRE([AC_PROG_INSTALL])
248930f8ce46SmrgXORG_CWARNFLAGS
249030f8ce46SmrgXORG_STRICT_OPTION
249130f8ce46SmrgXORG_RELEASE_VERSION
249230f8ce46SmrgXORG_CHANGELOG
249330f8ce46SmrgXORG_INSTALL
249430f8ce46SmrgXORG_MANPAGE_SECTIONS
249530f8ce46Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
249630f8ce46Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
249730f8ce46Smrg]) # XORG_DEFAULT_OPTIONS
249830f8ce46Smrg
249930f8ce46Smrg# XORG_INSTALL()
250030f8ce46Smrg# ----------------
250130f8ce46Smrg# Minimum version: 1.4.0
250230f8ce46Smrg#
250330f8ce46Smrg# Defines the variable INSTALL_CMD as the command to copy
250430f8ce46Smrg# INSTALL from $prefix/share/util-macros.
250530f8ce46Smrg#
250630f8ce46SmrgAC_DEFUN([XORG_INSTALL], [
250730f8ce46SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
250830f8ce46Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
250930f8ce46SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
251030f8ce46Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
251130f8ce46Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
251230f8ce46Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
251330f8ce46SmrgAC_SUBST([INSTALL_CMD])
251430f8ce46Smrg]) # XORG_INSTALL
2515ce6676dbSmrgdnl Copyright 2005 Red Hat, Inc
2516ce6676dbSmrgdnl
2517ce6676dbSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
2518ce6676dbSmrgdnl documentation for any purpose is hereby granted without fee, provided that
2519ce6676dbSmrgdnl the above copyright notice appear in all copies and that both that
2520ce6676dbSmrgdnl copyright notice and this permission notice appear in supporting
2521ce6676dbSmrgdnl documentation.
2522ce6676dbSmrgdnl
2523ce6676dbSmrgdnl The above copyright notice and this permission notice shall be included
2524ce6676dbSmrgdnl in all copies or substantial portions of the Software.
2525ce6676dbSmrgdnl
2526ce6676dbSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2527ce6676dbSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2528ce6676dbSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
2529ce6676dbSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
2530ce6676dbSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
2531ce6676dbSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2532ce6676dbSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
2533ce6676dbSmrgdnl
2534ce6676dbSmrgdnl Except as contained in this notice, the name of the copyright holders shall
2535ce6676dbSmrgdnl not be used in advertising or otherwise to promote the sale, use or
2536ce6676dbSmrgdnl other dealings in this Software without prior written authorization
2537ce6676dbSmrgdnl from the copyright holders.
2538ce6676dbSmrgdnl
2539ce6676dbSmrg
2540ce6676dbSmrg# XORG_RELEASE_VERSION
2541ce6676dbSmrg# --------------------
254230f8ce46Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
2543ce6676dbSmrg 
2544ce6676dbSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
2545ce6676dbSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
2546ce6676dbSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
2547ce6676dbSmrg		[Major version of this package])
2548ce6676dbSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
2549ce6676dbSmrg	if test "x$PVM" = "x"; then
2550ce6676dbSmrg		PVM="0"
2551ce6676dbSmrg	fi
2552ce6676dbSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
2553ce6676dbSmrg		[$PVM],
2554ce6676dbSmrg		[Minor version of this package])
2555ce6676dbSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
2556ce6676dbSmrg	if test "x$PVP" = "x"; then
2557ce6676dbSmrg		PVP="0"
2558ce6676dbSmrg	fi
2559ce6676dbSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
2560ce6676dbSmrg		[$PVP],
2561ce6676dbSmrg		[Patch version of this package])
2562ce6676dbSmrg])
2563ce6676dbSmrg
2564ce6676dbSmrg# XORG_CHANGELOG()
2565ce6676dbSmrg# ----------------
2566ce6676dbSmrg# Minimum version: 1.2.0
2567ce6676dbSmrg#
2568ce6676dbSmrg# Defines the variable CHANGELOG_CMD as the command to generate
2569ce6676dbSmrg# ChangeLog from git.
2570ce6676dbSmrg#
2571ce6676dbSmrg#
2572ce6676dbSmrgAC_DEFUN([XORG_CHANGELOG], [
257330f8ce46SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
257430f8ce46Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
257530f8ce46Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
2576ce6676dbSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
2577ce6676dbSmrgAC_SUBST([CHANGELOG_CMD])
2578ce6676dbSmrg]) # XORG_CHANGELOG
2579ce6676dbSmrg
2580ce6676dbSmrgdnl $XdotOrg: lib/xtrans/xtrans.m4,v 1.6 2005/07/26 18:59:11 alanc Exp $
2581ce6676dbSmrgdnl
2582ce6676dbSmrgdnl Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
258330f8ce46Smrgdnl
258430f8ce46Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
258530f8ce46Smrgdnl copy of this software and associated documentation files (the "Software"),
258630f8ce46Smrgdnl to deal in the Software without restriction, including without limitation
258730f8ce46Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
258830f8ce46Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
258930f8ce46Smrgdnl Software is furnished to do so, subject to the following conditions:
259030f8ce46Smrgdnl
259130f8ce46Smrgdnl The above copyright notice and this permission notice (including the next
259230f8ce46Smrgdnl paragraph) shall be included in all copies or substantial portions of the
259330f8ce46Smrgdnl Software.
259430f8ce46Smrgdnl
259530f8ce46Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
259630f8ce46Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
259730f8ce46Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
259830f8ce46Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
259930f8ce46Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
260030f8ce46Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
260130f8ce46Smrgdnl DEALINGS IN THE SOFTWARE.
2602ce6676dbSmrgdnl 
2603ce6676dbSmrg
2604ce6676dbSmrg# XTRANS_TCP_FLAGS()
2605ce6676dbSmrg# ------------------
2606ce6676dbSmrg# Find needed libraries for TCP sockets, and check for IPv6 support
2607ce6676dbSmrgAC_DEFUN([XTRANS_TCP_FLAGS],[
2608ce6676dbSmrg # SVR4 hides these in libraries other than libc
2609ce6676dbSmrg AC_SEARCH_LIBS(socket, [socket])
2610ce6676dbSmrg AC_SEARCH_LIBS(gethostbyname, [nsl])
261130f8ce46Smrg if test "$ac_cv_search_socket$ac_cv_search_gethostbyname" = "nono"; then
261230f8ce46Smrg   AC_HAVE_LIBRARY([ws2_32])
261330f8ce46Smrg fi
2614ce6676dbSmrg
2615ce6676dbSmrg # Needs to come after above checks for libsocket & libnsl for SVR4 systems
2616ce6676dbSmrg AC_ARG_ENABLE(ipv6, 
2617ce6676dbSmrg	AC_HELP_STRING([--enable-ipv6],[Enable IPv6 support]),
2618ce6676dbSmrg	[IPV6CONN=$enableval], 
2619ce6676dbSmrg	[AC_CHECK_FUNC(getaddrinfo,[IPV6CONN=yes],[IPV6CONN=no])])
2620ce6676dbSmrg AC_MSG_CHECKING([if IPv6 support should be built])
2621ce6676dbSmrg if test "$IPV6CONN" = "yes"; then
2622ce6676dbSmrg	AC_DEFINE(IPv6,1,[Support IPv6 for TCP connections])
2623ce6676dbSmrg fi
2624ce6676dbSmrg AC_MSG_RESULT($IPV6CONN)
2625ce6676dbSmrg
2626ce6676dbSmrg # 4.3BSD-Reno added a new member to struct sockaddr_in
2627ce6676dbSmrg AC_CHECK_MEMBER([struct sockaddr_in.sin_len], 
2628ce6676dbSmrg	AC_DEFINE([BSD44SOCKETS],1,
2629ce6676dbSmrg 	    [Define to 1 if `struct sockaddr_in' has a `sin_len' member]), [], [
2630ce6676dbSmrg#include <sys/types.h>
2631ce6676dbSmrg#include <sys/socket.h>
2632ce6676dbSmrg#include <netinet/in.h>
2633ce6676dbSmrg ])
2634ce6676dbSmrg
2635ce6676dbSmrg # POSIX.1g changed the type of pointer passed to getsockname/getpeername/etc.
2636ce6676dbSmrg AC_CHECK_TYPES([socklen_t], [], [], [
2637ce6676dbSmrgAC_INCLUDES_DEFAULT
2638ce6676dbSmrg#include <sys/socket.h>])
2639ce6676dbSmrg 
2640ce6676dbSmrg]) # XTRANS_TCP_FLAGS
2641ce6676dbSmrg
2642ce6676dbSmrg# XTRANS_CONNECTION_FLAGS()
2643ce6676dbSmrg# -------------------------
2644ce6676dbSmrg# Standard checks for which Xtrans transports to use by the Xorg packages
2645ce6676dbSmrg# that use Xtrans functions
2646ce6676dbSmrgAC_DEFUN([XTRANS_CONNECTION_FLAGS],[
2647ce6676dbSmrg AC_REQUIRE([AC_CANONICAL_HOST])
2648ce6676dbSmrg AC_REQUIRE([AC_TYPE_SIGNAL])
2649ce6676dbSmrg [case $host_os in
2650ce6676dbSmrg	mingw*)	unixdef="no"   ;;
2651ce6676dbSmrg	*)	unixdef="yes"  ;;
2652ce6676dbSmrg esac]
2653ce6676dbSmrg AC_ARG_ENABLE(unix-transport,
2654ce6676dbSmrg	AC_HELP_STRING([--enable-unix-transport],[Enable UNIX domain socket transport]),
2655ce6676dbSmrg	[UNIXCONN=$enableval], [UNIXCONN=$unixdef])
2656ce6676dbSmrg AC_MSG_CHECKING([if Xtrans should support UNIX socket connections])
2657ce6676dbSmrg if test "$UNIXCONN" = "yes"; then
2658ce6676dbSmrg	AC_DEFINE(UNIXCONN,1,[Support UNIX socket connections])
2659ce6676dbSmrg fi
2660ce6676dbSmrg AC_MSG_RESULT($UNIXCONN)
2661ce6676dbSmrg AC_ARG_ENABLE(tcp-transport, 
2662ce6676dbSmrg	AC_HELP_STRING([--enable-tcp-transport],[Enable TCP socket transport]),
2663ce6676dbSmrg	[TCPCONN=$enableval], [TCPCONN=yes])
2664ce6676dbSmrg AC_MSG_CHECKING([if Xtrans should support TCP socket connections])
2665ce6676dbSmrg AC_MSG_RESULT($TCPCONN)
2666ce6676dbSmrg if test "$TCPCONN" = "yes"; then
2667ce6676dbSmrg	AC_DEFINE(TCPCONN,1,[Support TCP socket connections])
2668ce6676dbSmrg	XTRANS_TCP_FLAGS
2669ce6676dbSmrg fi
2670ce6676dbSmrg [case $host_os in
2671ce6676dbSmrg	solaris*|sco*|sysv4*)	localdef="yes" ;;
2672ce6676dbSmrg	*)			localdef="no"  ;;
2673ce6676dbSmrg esac]
2674ce6676dbSmrg AC_ARG_ENABLE(local-transport,
2675ce6676dbSmrg	AC_HELP_STRING([--enable-local-transport],[Enable os-specific local transport]),
2676ce6676dbSmrg	[LOCALCONN=$enableval], [LOCALCONN=$localdef])
2677ce6676dbSmrg AC_MSG_CHECKING([if Xtrans should support os-specific local connections])
2678ce6676dbSmrg AC_MSG_RESULT($LOCALCONN)
2679ce6676dbSmrg if test "$LOCALCONN" = "yes"; then
2680ce6676dbSmrg	AC_DEFINE(LOCALCONN,1,[Support os-specific local connections])
2681ce6676dbSmrg fi
2682ce6676dbSmrg 
2683ce6676dbSmrg]) # XTRANS_CONNECTION_FLAGS
2684ce6676dbSmrg
2685ce6676dbSmrg
2686ce6676dbSmrg# XTRANS_SECURE_RPC_FLAGS()
2687ce6676dbSmrg# -------------------------
2688ce6676dbSmrg# Check for Secure RPC functions - must come after XTRANS_TCP_FLAGS
2689ce6676dbSmrg# so that any necessary networking libraries are already found
2690ce6676dbSmrgAC_DEFUN([XTRANS_SECURE_RPC_FLAGS],
2691ce6676dbSmrg[AC_REQUIRE([XTRANS_TCP_FLAGS])
2692ce6676dbSmrg AC_ARG_ENABLE(secure-rpc, 
2693ce6676dbSmrg	AC_HELP_STRING([--enable-secure-rpc],[Enable Secure RPC]),
2694ce6676dbSmrg        [SECURE_RPC=$enableval], [SECURE_RPC="try"])
2695ce6676dbSmrg
2696ce6676dbSmrg if test "x$SECURE_RPC" = "xyes" -o "x$SECURE_RPC" = "xtry" ; then
2697ce6676dbSmrg	FOUND_SECURE_RPC="no"
2698ce6676dbSmrg	AC_CHECK_FUNCS([authdes_seccreate authdes_create],
2699ce6676dbSmrg			[FOUND_SECURE_RPC="yes"])
2700ce6676dbSmrg	if test "x$FOUND_SECURE_RPC" = "xno" ; then
2701ce6676dbSmrg		if test "x$SECURE_RPC" = "xyes" ; then
2702ce6676dbSmrg	AC_MSG_ERROR([Secure RPC requested, but required functions not found])
2703ce6676dbSmrg		fi	
2704ce6676dbSmrg		SECURE_RPC="no"
2705ce6676dbSmrg	else
2706ce6676dbSmrg		dnl FreeBSD keeps getsecretkey in librpcsvc
2707ce6676dbSmrg		AC_SEARCH_LIBS(getsecretkey, [rpcsvc])
2708ce6676dbSmrg		SECURE_RPC="yes"
2709ce6676dbSmrg	fi
2710ce6676dbSmrg fi
2711ce6676dbSmrg AC_MSG_CHECKING([if Secure RPC authentication ("SUN-DES-1") should be supported])
2712ce6676dbSmrg if test "x$SECURE_RPC" = "xyes" ; then
2713ce6676dbSmrg	AC_DEFINE(SECURE_RPC, 1, [Support Secure RPC ("SUN-DES-1") authentication for X11 clients])
2714ce6676dbSmrg fi
2715ce6676dbSmrg AC_MSG_RESULT($SECURE_RPC)
2716ce6676dbSmrg]) # XTRANS_SECURE_RPC_FLAGS
2717ce6676dbSmrg
2718ce6676dbSmrg
2719ce6676dbSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
2720ce6676dbSmrg# 
2721ce6676dbSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
2722ce6676dbSmrg#
2723ce6676dbSmrg# This program is free software; you can redistribute it and/or modify
2724ce6676dbSmrg# it under the terms of the GNU General Public License as published by
2725ce6676dbSmrg# the Free Software Foundation; either version 2 of the License, or
2726ce6676dbSmrg# (at your option) any later version.
2727ce6676dbSmrg#
2728ce6676dbSmrg# This program is distributed in the hope that it will be useful, but
2729ce6676dbSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
2730ce6676dbSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2731ce6676dbSmrg# General Public License for more details.
2732ce6676dbSmrg#
2733ce6676dbSmrg# You should have received a copy of the GNU General Public License
2734ce6676dbSmrg# along with this program; if not, write to the Free Software
2735ce6676dbSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2736ce6676dbSmrg#
2737ce6676dbSmrg# As a special exception to the GNU General Public License, if you
2738ce6676dbSmrg# distribute this file as part of a program that contains a
2739ce6676dbSmrg# configuration script generated by Autoconf, you may include it under
2740ce6676dbSmrg# the same distribution terms that you use for the rest of that program.
2741ce6676dbSmrg
2742ce6676dbSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
2743ce6676dbSmrg# ----------------------------------
2744ce6676dbSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
2745ce6676dbSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
2746ce6676dbSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
2747ce6676dbSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
2748ce6676dbSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
2749ce6676dbSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
2750ce6676dbSmrgfi
2751ce6676dbSmrgif test -n "$PKG_CONFIG"; then
275230f8ce46Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
2753ce6676dbSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
2754ce6676dbSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
2755ce6676dbSmrg		AC_MSG_RESULT([yes])
2756ce6676dbSmrg	else
2757ce6676dbSmrg		AC_MSG_RESULT([no])
2758ce6676dbSmrg		PKG_CONFIG=""
2759ce6676dbSmrg	fi
2760ce6676dbSmrg		
2761ce6676dbSmrgfi[]dnl
2762ce6676dbSmrg])# PKG_PROG_PKG_CONFIG
2763ce6676dbSmrg
2764ce6676dbSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2765ce6676dbSmrg#
2766ce6676dbSmrg# Check to see whether a particular set of modules exists.  Similar
2767ce6676dbSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
2768ce6676dbSmrg#
2769ce6676dbSmrg#
2770ce6676dbSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
2771ce6676dbSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
2772ce6676dbSmrg# PKG_CHECK_EXISTS manually
2773ce6676dbSmrg# --------------------------------------------------------------
2774ce6676dbSmrgAC_DEFUN([PKG_CHECK_EXISTS],
2775ce6676dbSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2776ce6676dbSmrgif test -n "$PKG_CONFIG" && \
2777ce6676dbSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
2778ce6676dbSmrg  m4_ifval([$2], [$2], [:])
2779ce6676dbSmrgm4_ifvaln([$3], [else
2780ce6676dbSmrg  $3])dnl
2781ce6676dbSmrgfi])
2782ce6676dbSmrg
2783ce6676dbSmrg
2784ce6676dbSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
2785ce6676dbSmrg# ---------------------------------------------
2786ce6676dbSmrgm4_define([_PKG_CONFIG],
278730f8ce46Smrg[if test -n "$$1"; then
278830f8ce46Smrg    pkg_cv_[]$1="$$1"
278930f8ce46Smrg elif test -n "$PKG_CONFIG"; then
279030f8ce46Smrg    PKG_CHECK_EXISTS([$3],
279130f8ce46Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
279230f8ce46Smrg		     [pkg_failed=yes])
279330f8ce46Smrg else
279430f8ce46Smrg    pkg_failed=untried
2795ce6676dbSmrgfi[]dnl
2796ce6676dbSmrg])# _PKG_CONFIG
2797ce6676dbSmrg
279830f8ce46Smrg# _PKG_SHORT_ERRORS_SUPPORTED
279930f8ce46Smrg# -----------------------------
280030f8ce46SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
280130f8ce46Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
280230f8ce46Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
280330f8ce46Smrg        _pkg_short_errors_supported=yes
280430f8ce46Smrgelse
280530f8ce46Smrg        _pkg_short_errors_supported=no
280630f8ce46Smrgfi[]dnl
280730f8ce46Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
280830f8ce46Smrg
280930f8ce46Smrg
2810ce6676dbSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
2811ce6676dbSmrg# [ACTION-IF-NOT-FOUND])
2812ce6676dbSmrg#
2813ce6676dbSmrg#
2814ce6676dbSmrg# Note that if there is a possibility the first call to
2815ce6676dbSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
2816ce6676dbSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
2817ce6676dbSmrg#
2818ce6676dbSmrg#
2819ce6676dbSmrg# --------------------------------------------------------------
2820ce6676dbSmrgAC_DEFUN([PKG_CHECK_MODULES],
2821ce6676dbSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2822ce6676dbSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
2823ce6676dbSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
2824ce6676dbSmrg
2825ce6676dbSmrgpkg_failed=no
2826ce6676dbSmrgAC_MSG_CHECKING([for $1])
2827ce6676dbSmrg
2828ce6676dbSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
2829ce6676dbSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
2830ce6676dbSmrg
283130f8ce46Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
283230f8ce46Smrgand $1[]_LIBS to avoid the need to call pkg-config.
283330f8ce46SmrgSee the pkg-config man page for more details.])
283430f8ce46Smrg
2835ce6676dbSmrgif test $pkg_failed = yes; then
283630f8ce46Smrg        _PKG_SHORT_ERRORS_SUPPORTED
283730f8ce46Smrg        if test $_pkg_short_errors_supported = yes; then
283830f8ce46Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
283930f8ce46Smrg        else 
284030f8ce46Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
284130f8ce46Smrg        fi
2842ce6676dbSmrg	# Put the nasty error message in config.log where it belongs
284330f8ce46Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
2844ce6676dbSmrg
2845ce6676dbSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
284630f8ce46Smrg[Package requirements ($2) were not met:
284730f8ce46Smrg
284830f8ce46Smrg$$1_PKG_ERRORS
284930f8ce46Smrg
2850ce6676dbSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
2851ce6676dbSmrginstalled software in a non-standard prefix.
2852ce6676dbSmrg
285330f8ce46Smrg_PKG_TEXT
285430f8ce46Smrg])],
285530f8ce46Smrg		[AC_MSG_RESULT([no])
285630f8ce46Smrg                $4])
2857ce6676dbSmrgelif test $pkg_failed = untried; then
2858ce6676dbSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
2859ce6676dbSmrg[The pkg-config script could not be found or is too old.  Make sure it
2860ce6676dbSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
2861ce6676dbSmrgpath to pkg-config.
2862ce6676dbSmrg
286330f8ce46Smrg_PKG_TEXT
2864ce6676dbSmrg
286530f8ce46SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
2866ce6676dbSmrg		[$4])
2867ce6676dbSmrgelse
2868ce6676dbSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
2869ce6676dbSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
2870ce6676dbSmrg        AC_MSG_RESULT([yes])
2871ce6676dbSmrg	ifelse([$3], , :, [$3])
2872ce6676dbSmrgfi[]dnl
2873ce6676dbSmrg])# PKG_CHECK_MODULES
2874ce6676dbSmrg
2875