aclocal.m4 revision dd519f38
1dd519f38Smrg# generated automatically by aclocal 1.11 -*- Autoconf -*-
2ed029a5fSmrg
3dd519f38Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4dd519f38Smrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5ed029a5fSmrg# This file is free software; the Free Software Foundation
6ed029a5fSmrg# gives unlimited permission to copy and/or distribute it,
7ed029a5fSmrg# with or without modifications, as long as this notice is preserved.
8ed029a5fSmrg
9ed029a5fSmrg# This program is distributed in the hope that it will be useful,
10ed029a5fSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11ed029a5fSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12ed029a5fSmrg# PARTICULAR PURPOSE.
13ed029a5fSmrg
14dd519f38Smrgm4_ifndef([AC_AUTOCONF_VERSION],
15dd519f38Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16dd519f38Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
17dd519f38Smrg[m4_warning([this file was generated for autoconf 2.63.
18dd519f38SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19dd519f38SmrgIf you have problems, you may need to regenerate the build system entirely.
20dd519f38SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21ed029a5fSmrg
22dd519f38Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
23dd519f38Smrg#
24dd519f38Smrg# This file is free software; the Free Software Foundation
25dd519f38Smrg# gives unlimited permission to copy and/or distribute it,
26dd519f38Smrg# with or without modifications, as long as this notice is preserved.
27ed029a5fSmrg
28ed029a5fSmrg# AM_AUTOMAKE_VERSION(VERSION)
29ed029a5fSmrg# ----------------------------
30ed029a5fSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
31ed029a5fSmrg# generated from the m4 files accompanying Automake X.Y.
32dd519f38Smrg# (This private macro should not be called outside this file.)
33dd519f38SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
34dd519f38Smrg[am__api_version='1.11'
35dd519f38Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
36dd519f38Smrgdnl require some minimum version.  Point them to the right macro.
37dd519f38Smrgm4_if([$1], [1.11], [],
38dd519f38Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
39dd519f38Smrg])
40dd519f38Smrg
41dd519f38Smrg# _AM_AUTOCONF_VERSION(VERSION)
42dd519f38Smrg# -----------------------------
43dd519f38Smrg# aclocal traces this macro to find the Autoconf version.
44dd519f38Smrg# This is a private macro too.  Using m4_define simplifies
45dd519f38Smrg# the logic in aclocal, which can simply ignore this definition.
46dd519f38Smrgm4_define([_AM_AUTOCONF_VERSION], [])
47ed029a5fSmrg
48ed029a5fSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
49ed029a5fSmrg# -------------------------------
50dd519f38Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
51dd519f38Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
52ed029a5fSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
53dd519f38Smrg[AM_AUTOMAKE_VERSION([1.11])dnl
54dd519f38Smrgm4_ifndef([AC_AUTOCONF_VERSION],
55dd519f38Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
56dd519f38Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
57ed029a5fSmrg
58dd519f38Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
59ed029a5fSmrg
60dd519f38Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
61ed029a5fSmrg#
62dd519f38Smrg# This file is free software; the Free Software Foundation
63dd519f38Smrg# gives unlimited permission to copy and/or distribute it,
64dd519f38Smrg# with or without modifications, as long as this notice is preserved.
65ed029a5fSmrg
66ed029a5fSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
67ed029a5fSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
68ed029a5fSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
69ed029a5fSmrg#
70ed029a5fSmrg# Of course, Automake must honor this variable whenever it calls a
71ed029a5fSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
72ed029a5fSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
73ed029a5fSmrg# depending on how configure is run.  This is pretty annoying, since
74ed029a5fSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
75ed029a5fSmrg# source directory, any form will work fine, but in subdirectories a
76ed029a5fSmrg# relative path needs to be adjusted first.
77ed029a5fSmrg#
78ed029a5fSmrg# $ac_aux_dir/missing
79ed029a5fSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
80ed029a5fSmrg# $top_srcdir/$ac_aux_dir/missing
81ed029a5fSmrg#    fails if $ac_aux_dir is absolute,
82ed029a5fSmrg#    fails when called from a subdirectory in a VPATH build with
83ed029a5fSmrg#          a relative $ac_aux_dir
84ed029a5fSmrg#
85ed029a5fSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
86ed029a5fSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
87ed029a5fSmrg# harmless because $srcdir is `.', but things will broke when you
88ed029a5fSmrg# start a VPATH build or use an absolute $srcdir.
89ed029a5fSmrg#
90ed029a5fSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
91ed029a5fSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
92ed029a5fSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
93ed029a5fSmrg# and then we would define $MISSING as
94ed029a5fSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
95ed029a5fSmrg# This will work as long as MISSING is not called from configure, because
96ed029a5fSmrg# unfortunately $(top_srcdir) has no meaning in configure.
97ed029a5fSmrg# However there are other variables, like CC, which are often used in
98ed029a5fSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
99ed029a5fSmrg#
100ed029a5fSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
101ed029a5fSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
102ed029a5fSmrg# configured tree to be moved without reconfiguration.
103ed029a5fSmrg
104dd519f38SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
105dd519f38Smrg[dnl Rely on autoconf to set up CDPATH properly.
106dd519f38SmrgAC_PREREQ([2.50])dnl
107ed029a5fSmrg# expand $ac_aux_dir to an absolute path
108ed029a5fSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
109ed029a5fSmrg])
110ed029a5fSmrg
111dd519f38Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
112ed029a5fSmrg
113dd519f38Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
114dd519f38Smrg# Free Software Foundation, Inc.
115dd519f38Smrg#
116dd519f38Smrg# This file is free software; the Free Software Foundation
117dd519f38Smrg# gives unlimited permission to copy and/or distribute it,
118dd519f38Smrg# with or without modifications, as long as this notice is preserved.
119ed029a5fSmrg
120dd519f38Smrg# serial 9
121ed029a5fSmrg
122dd519f38Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
123dd519f38Smrg# -------------------------------------
124dd519f38Smrg# Define a conditional.
125dd519f38SmrgAC_DEFUN([AM_CONDITIONAL],
126dd519f38Smrg[AC_PREREQ(2.52)dnl
127dd519f38Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
128dd519f38Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
129dd519f38SmrgAC_SUBST([$1_TRUE])dnl
130dd519f38SmrgAC_SUBST([$1_FALSE])dnl
131dd519f38Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
132dd519f38Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
133dd519f38Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
134dd519f38Smrgif $2; then
135dd519f38Smrg  $1_TRUE=
136dd519f38Smrg  $1_FALSE='#'
137ed029a5fSmrgelse
138dd519f38Smrg  $1_TRUE='#'
139dd519f38Smrg  $1_FALSE=
140ed029a5fSmrgfi
141dd519f38SmrgAC_CONFIG_COMMANDS_PRE(
142dd519f38Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
143dd519f38Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
144dd519f38SmrgUsually this means the macro was only invoked conditionally.]])
145dd519f38Smrgfi])])
146ed029a5fSmrg
147dd519f38Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
148dd519f38Smrg# Free Software Foundation, Inc.
149dd519f38Smrg#
150dd519f38Smrg# This file is free software; the Free Software Foundation
151dd519f38Smrg# gives unlimited permission to copy and/or distribute it,
152dd519f38Smrg# with or without modifications, as long as this notice is preserved.
153ed029a5fSmrg
154dd519f38Smrg# serial 10
155ed029a5fSmrg
156ed029a5fSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
157ed029a5fSmrg# written in clear, in which case automake, when reading aclocal.m4,
158ed029a5fSmrg# will think it sees a *use*, and therefore will trigger all it's
159ed029a5fSmrg# C support machinery.  Also note that it means that autoscan, seeing
160ed029a5fSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
161ed029a5fSmrg
162ed029a5fSmrg
163ed029a5fSmrg# _AM_DEPENDENCIES(NAME)
164ed029a5fSmrg# ----------------------
165ed029a5fSmrg# See how the compiler implements dependency checking.
166ed029a5fSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
167ed029a5fSmrg# We try a few techniques and use that to set a single cache variable.
168ed029a5fSmrg#
169ed029a5fSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
170ed029a5fSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
171ed029a5fSmrg# dependency, and given that the user is not expected to run this macro,
172ed029a5fSmrg# just rely on AC_PROG_CC.
173ed029a5fSmrgAC_DEFUN([_AM_DEPENDENCIES],
174ed029a5fSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
175ed029a5fSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
176ed029a5fSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
177ed029a5fSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
178ed029a5fSmrg
179ed029a5fSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
180ed029a5fSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
181ed029a5fSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
182dd519f38Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
183ed029a5fSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
184ed029a5fSmrg                   [depcc="$$1"   am_compiler_list=])
185ed029a5fSmrg
186ed029a5fSmrgAC_CACHE_CHECK([dependency style of $depcc],
187ed029a5fSmrg               [am_cv_$1_dependencies_compiler_type],
188ed029a5fSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
189ed029a5fSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
190ed029a5fSmrg  # making bogus files that we don't know about and never remove.  For
191ed029a5fSmrg  # instance it was reported that on HP-UX the gcc test will end up
192ed029a5fSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
193ed029a5fSmrg  # in D'.
194ed029a5fSmrg  mkdir conftest.dir
195ed029a5fSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
196ed029a5fSmrg  # using a relative directory.
197ed029a5fSmrg  cp "$am_depcomp" conftest.dir
198ed029a5fSmrg  cd conftest.dir
199ed029a5fSmrg  # We will build objects and dependencies in a subdirectory because
200ed029a5fSmrg  # it helps to detect inapplicable dependency modes.  For instance
201ed029a5fSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
202ed029a5fSmrg  # side effect of compilation, but ICC will put the dependencies in
203ed029a5fSmrg  # the current directory while Tru64 will put them in the object
204ed029a5fSmrg  # directory.
205ed029a5fSmrg  mkdir sub
206ed029a5fSmrg
207ed029a5fSmrg  am_cv_$1_dependencies_compiler_type=none
208ed029a5fSmrg  if test "$am_compiler_list" = ""; then
209ed029a5fSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
210ed029a5fSmrg  fi
211dd519f38Smrg  am__universal=false
212dd519f38Smrg  m4_case([$1], [CC],
213dd519f38Smrg    [case " $depcc " in #(
214dd519f38Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
215dd519f38Smrg     esac],
216dd519f38Smrg    [CXX],
217dd519f38Smrg    [case " $depcc " in #(
218dd519f38Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
219dd519f38Smrg     esac])
220dd519f38Smrg
221ed029a5fSmrg  for depmode in $am_compiler_list; do
222ed029a5fSmrg    # Setup a source with many dependencies, because some compilers
223ed029a5fSmrg    # like to wrap large dependency lists on column 80 (with \), and
224ed029a5fSmrg    # we should not choose a depcomp mode which is confused by this.
225ed029a5fSmrg    #
226ed029a5fSmrg    # We need to recreate these files for each test, as the compiler may
227ed029a5fSmrg    # overwrite some of them when testing with obscure command lines.
228ed029a5fSmrg    # This happens at least with the AIX C compiler.
229ed029a5fSmrg    : > sub/conftest.c
230ed029a5fSmrg    for i in 1 2 3 4 5 6; do
231ed029a5fSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
232dd519f38Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
233dd519f38Smrg      # Solaris 8's {/usr,}/bin/sh.
234dd519f38Smrg      touch sub/conftst$i.h
235ed029a5fSmrg    done
236ed029a5fSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
237ed029a5fSmrg
238dd519f38Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
239dd519f38Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
240dd519f38Smrg    # handle `-M -o', and we need to detect this.  Also, some Intel
241dd519f38Smrg    # versions had trouble with output in subdirs
242dd519f38Smrg    am__obj=sub/conftest.${OBJEXT-o}
243dd519f38Smrg    am__minus_obj="-o $am__obj"
244ed029a5fSmrg    case $depmode in
245dd519f38Smrg    gcc)
246dd519f38Smrg      # This depmode causes a compiler race in universal mode.
247dd519f38Smrg      test "$am__universal" = false || continue
248dd519f38Smrg      ;;
249ed029a5fSmrg    nosideeffect)
250ed029a5fSmrg      # after this tag, mechanisms are not by side-effect, so they'll
251ed029a5fSmrg      # only be used when explicitly requested
252ed029a5fSmrg      if test "x$enable_dependency_tracking" = xyes; then
253ed029a5fSmrg	continue
254ed029a5fSmrg      else
255ed029a5fSmrg	break
256ed029a5fSmrg      fi
257ed029a5fSmrg      ;;
258dd519f38Smrg    msvisualcpp | msvcmsys)
259dd519f38Smrg      # This compiler won't grok `-c -o', but also, the minuso test has
260dd519f38Smrg      # not run yet.  These depmodes are late enough in the game, and
261dd519f38Smrg      # so weak that their functioning should not be impacted.
262dd519f38Smrg      am__obj=conftest.${OBJEXT-o}
263dd519f38Smrg      am__minus_obj=
264dd519f38Smrg      ;;
265ed029a5fSmrg    none) break ;;
266ed029a5fSmrg    esac
267ed029a5fSmrg    if depmode=$depmode \
268dd519f38Smrg       source=sub/conftest.c object=$am__obj \
269ed029a5fSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
270dd519f38Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
271ed029a5fSmrg         >/dev/null 2>conftest.err &&
272dd519f38Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
273ed029a5fSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
274dd519f38Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
275ed029a5fSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
276ed029a5fSmrg      # icc doesn't choke on unknown options, it will just issue warnings
277dd519f38Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
278dd519f38Smrg      # that says an option was ignored or not supported.
279dd519f38Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
280dd519f38Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
281dd519f38Smrg      # The diagnosis changed in icc 8.0:
282dd519f38Smrg      #   icc: Command line remark: option '-MP' not supported
283dd519f38Smrg      if (grep 'ignoring option' conftest.err ||
284dd519f38Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
285ed029a5fSmrg        am_cv_$1_dependencies_compiler_type=$depmode
286ed029a5fSmrg        break
287ed029a5fSmrg      fi
288ed029a5fSmrg    fi
289ed029a5fSmrg  done
290ed029a5fSmrg
291ed029a5fSmrg  cd ..
292ed029a5fSmrg  rm -rf conftest.dir
293ed029a5fSmrgelse
294ed029a5fSmrg  am_cv_$1_dependencies_compiler_type=none
295ed029a5fSmrgfi
296ed029a5fSmrg])
297ed029a5fSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
298ed029a5fSmrgAM_CONDITIONAL([am__fastdep$1], [
299ed029a5fSmrg  test "x$enable_dependency_tracking" != xno \
300ed029a5fSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
301ed029a5fSmrg])
302ed029a5fSmrg
303ed029a5fSmrg
304ed029a5fSmrg# AM_SET_DEPDIR
305ed029a5fSmrg# -------------
306ed029a5fSmrg# Choose a directory name for dependency files.
307ed029a5fSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
308ed029a5fSmrgAC_DEFUN([AM_SET_DEPDIR],
309ed029a5fSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
310ed029a5fSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
311ed029a5fSmrg])
312ed029a5fSmrg
313ed029a5fSmrg
314ed029a5fSmrg# AM_DEP_TRACK
315ed029a5fSmrg# ------------
316ed029a5fSmrgAC_DEFUN([AM_DEP_TRACK],
317ed029a5fSmrg[AC_ARG_ENABLE(dependency-tracking,
318dd519f38Smrg[  --disable-dependency-tracking  speeds up one-time build
319dd519f38Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
320ed029a5fSmrgif test "x$enable_dependency_tracking" != xno; then
321ed029a5fSmrg  am_depcomp="$ac_aux_dir/depcomp"
322ed029a5fSmrg  AMDEPBACKSLASH='\'
323ed029a5fSmrgfi
324ed029a5fSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
325dd519f38SmrgAC_SUBST([AMDEPBACKSLASH])dnl
326dd519f38Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
327ed029a5fSmrg])
328ed029a5fSmrg
329dd519f38Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
330ed029a5fSmrg
331dd519f38Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
332dd519f38Smrg# Free Software Foundation, Inc.
333dd519f38Smrg#
334dd519f38Smrg# This file is free software; the Free Software Foundation
335dd519f38Smrg# gives unlimited permission to copy and/or distribute it,
336dd519f38Smrg# with or without modifications, as long as this notice is preserved.
337ed029a5fSmrg
338dd519f38Smrg#serial 5
339ed029a5fSmrg
340ed029a5fSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
341ed029a5fSmrg# ------------------------------
342ed029a5fSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
343dd519f38Smrg[{
344dd519f38Smrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
345dd519f38Smrg  # are listed without --file.  Let's play safe and only enable the eval
346dd519f38Smrg  # if we detect the quoting.
347dd519f38Smrg  case $CONFIG_FILES in
348dd519f38Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
349dd519f38Smrg  *)   set x $CONFIG_FILES ;;
350dd519f38Smrg  esac
351dd519f38Smrg  shift
352dd519f38Smrg  for mf
353dd519f38Smrg  do
354dd519f38Smrg    # Strip MF so we end up with the name of the file.
355dd519f38Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
356dd519f38Smrg    # Check whether this is an Automake generated Makefile or not.
357dd519f38Smrg    # We used to match only the files named `Makefile.in', but
358dd519f38Smrg    # some people rename them; so instead we look at the file content.
359dd519f38Smrg    # Grep'ing the first line is not enough: some people post-process
360dd519f38Smrg    # each Makefile.in and add a new line on top of each file to say so.
361dd519f38Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
362dd519f38Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
363dd519f38Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
364dd519f38Smrg      dirpart=`AS_DIRNAME("$mf")`
365dd519f38Smrg    else
366dd519f38Smrg      continue
367dd519f38Smrg    fi
368dd519f38Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
369dd519f38Smrg    # from the Makefile without running `make'.
370dd519f38Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
371dd519f38Smrg    test -z "$DEPDIR" && continue
372dd519f38Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
373dd519f38Smrg    test -z "am__include" && continue
374dd519f38Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
375dd519f38Smrg    # When using ansi2knr, U may be empty or an underscore; expand it
376dd519f38Smrg    U=`sed -n 's/^U = //p' < "$mf"`
377dd519f38Smrg    # Find all dependency output files, they are included files with
378dd519f38Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
379dd519f38Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
380dd519f38Smrg    # expansion.
381dd519f38Smrg    for file in `sed -n "
382dd519f38Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
383dd519f38Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
384dd519f38Smrg      # Make sure the directory exists.
385dd519f38Smrg      test -f "$dirpart/$file" && continue
386dd519f38Smrg      fdir=`AS_DIRNAME(["$file"])`
387dd519f38Smrg      AS_MKDIR_P([$dirpart/$fdir])
388dd519f38Smrg      # echo "creating $dirpart/$file"
389dd519f38Smrg      echo '# dummy' > "$dirpart/$file"
390dd519f38Smrg    done
391ed029a5fSmrg  done
392dd519f38Smrg}
393ed029a5fSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
394ed029a5fSmrg
395ed029a5fSmrg
396ed029a5fSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
397ed029a5fSmrg# -----------------------------
398ed029a5fSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
399ed029a5fSmrg#
400ed029a5fSmrg# This code is only required when automatic dependency tracking
401ed029a5fSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
402ed029a5fSmrg# need in order to bootstrap the dependency handling code.
403ed029a5fSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
404ed029a5fSmrg[AC_CONFIG_COMMANDS([depfiles],
405ed029a5fSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
406ed029a5fSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
407ed029a5fSmrg])
408ed029a5fSmrg
409dd519f38Smrg# Do all the work for Automake.                             -*- Autoconf -*-
410dd519f38Smrg
411dd519f38Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
412dd519f38Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
413dd519f38Smrg#
414dd519f38Smrg# This file is free software; the Free Software Foundation
415dd519f38Smrg# gives unlimited permission to copy and/or distribute it,
416dd519f38Smrg# with or without modifications, as long as this notice is preserved.
417dd519f38Smrg
418dd519f38Smrg# serial 16
419dd519f38Smrg
420dd519f38Smrg# This macro actually does too much.  Some checks are only needed if
421dd519f38Smrg# your package does certain things.  But this isn't really a big deal.
422dd519f38Smrg
423dd519f38Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
424dd519f38Smrg# AM_INIT_AUTOMAKE([OPTIONS])
425dd519f38Smrg# -----------------------------------------------
426dd519f38Smrg# The call with PACKAGE and VERSION arguments is the old style
427dd519f38Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
428dd519f38Smrg# and VERSION should now be passed to AC_INIT and removed from
429dd519f38Smrg# the call to AM_INIT_AUTOMAKE.
430dd519f38Smrg# We support both call styles for the transition.  After
431dd519f38Smrg# the next Automake release, Autoconf can make the AC_INIT
432dd519f38Smrg# arguments mandatory, and then we can depend on a new Autoconf
433dd519f38Smrg# release and drop the old call support.
434dd519f38SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
435dd519f38Smrg[AC_PREREQ([2.62])dnl
436dd519f38Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
437dd519f38Smrgdnl the ones we care about.
438dd519f38Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
439dd519f38SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
440dd519f38SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
441dd519f38Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
442dd519f38Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
443dd519f38Smrg  # is not polluted with repeated "-I."
444dd519f38Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
445dd519f38Smrg  # test to see if srcdir already configured
446dd519f38Smrg  if test -f $srcdir/config.status; then
447dd519f38Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
448dd519f38Smrg  fi
449dd519f38Smrgfi
450dd519f38Smrg
451dd519f38Smrg# test whether we have cygpath
452dd519f38Smrgif test -z "$CYGPATH_W"; then
453dd519f38Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
454dd519f38Smrg    CYGPATH_W='cygpath -w'
455dd519f38Smrg  else
456dd519f38Smrg    CYGPATH_W=echo
457dd519f38Smrg  fi
458dd519f38Smrgfi
459dd519f38SmrgAC_SUBST([CYGPATH_W])
460dd519f38Smrg
461dd519f38Smrg# Define the identity of the package.
462dd519f38Smrgdnl Distinguish between old-style and new-style calls.
463dd519f38Smrgm4_ifval([$2],
464dd519f38Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
465dd519f38Smrg AC_SUBST([PACKAGE], [$1])dnl
466dd519f38Smrg AC_SUBST([VERSION], [$2])],
467dd519f38Smrg[_AM_SET_OPTIONS([$1])dnl
468dd519f38Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
469dd519f38Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
470dd519f38Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
471dd519f38Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
472dd519f38Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
473dd519f38Smrg
474dd519f38Smrg_AM_IF_OPTION([no-define],,
475dd519f38Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
476dd519f38Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
477dd519f38Smrg
478dd519f38Smrg# Some tools Automake needs.
479dd519f38SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
480dd519f38SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
481dd519f38SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
482dd519f38SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
483dd519f38SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
484dd519f38SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
485dd519f38SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
486dd519f38SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
487dd519f38SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
488dd519f38SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
489dd519f38Smrg# We need awk for the "check" target.  The system "awk" is bad on
490dd519f38Smrg# some platforms.
491dd519f38SmrgAC_REQUIRE([AC_PROG_AWK])dnl
492dd519f38SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
493dd519f38SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
494dd519f38Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
495dd519f38Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
496dd519f38Smrg			     [_AM_PROG_TAR([v7])])])
497dd519f38Smrg_AM_IF_OPTION([no-dependencies],,
498dd519f38Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
499dd519f38Smrg		  [_AM_DEPENDENCIES(CC)],
500dd519f38Smrg		  [define([AC_PROG_CC],
501dd519f38Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
502dd519f38SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
503dd519f38Smrg		  [_AM_DEPENDENCIES(CXX)],
504dd519f38Smrg		  [define([AC_PROG_CXX],
505dd519f38Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
506dd519f38SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
507dd519f38Smrg		  [_AM_DEPENDENCIES(OBJC)],
508dd519f38Smrg		  [define([AC_PROG_OBJC],
509dd519f38Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
510dd519f38Smrg])
511dd519f38Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
512dd519f38Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
513dd519f38Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
514dd519f38Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
515dd519f38SmrgAC_CONFIG_COMMANDS_PRE(dnl
516dd519f38Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
517dd519f38Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
518dd519f38Smrg])
519dd519f38Smrg
520dd519f38Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
521dd519f38Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
522dd519f38Smrgdnl mangled by Autoconf and run in a shell conditional statement.
523dd519f38Smrgm4_define([_AC_COMPILER_EXEEXT],
524dd519f38Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
525dd519f38Smrg
526dd519f38Smrg
527dd519f38Smrg# When config.status generates a header, we must update the stamp-h file.
528dd519f38Smrg# This file resides in the same directory as the config header
529dd519f38Smrg# that is generated.  The stamp files are numbered to have different names.
530dd519f38Smrg
531dd519f38Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
532dd519f38Smrg# loop where config.status creates the headers, so we can generate
533dd519f38Smrg# our stamp files there.
534dd519f38SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
535dd519f38Smrg[# Compute $1's index in $config_headers.
536dd519f38Smrg_am_arg=$1
537dd519f38Smrg_am_stamp_count=1
538dd519f38Smrgfor _am_header in $config_headers :; do
539dd519f38Smrg  case $_am_header in
540dd519f38Smrg    $_am_arg | $_am_arg:* )
541dd519f38Smrg      break ;;
542dd519f38Smrg    * )
543dd519f38Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
544dd519f38Smrg  esac
545dd519f38Smrgdone
546dd519f38Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
547dd519f38Smrg
548dd519f38Smrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
549dd519f38Smrg#
550dd519f38Smrg# This file is free software; the Free Software Foundation
551dd519f38Smrg# gives unlimited permission to copy and/or distribute it,
552dd519f38Smrg# with or without modifications, as long as this notice is preserved.
553dd519f38Smrg
554dd519f38Smrg# AM_PROG_INSTALL_SH
555dd519f38Smrg# ------------------
556dd519f38Smrg# Define $install_sh.
557dd519f38SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
558dd519f38Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
559dd519f38Smrgif test x"${install_sh}" != xset; then
560dd519f38Smrg  case $am_aux_dir in
561dd519f38Smrg  *\ * | *\	*)
562dd519f38Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
563dd519f38Smrg  *)
564dd519f38Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
565dd519f38Smrg  esac
566dd519f38Smrgfi
567dd519f38SmrgAC_SUBST(install_sh)])
568dd519f38Smrg
569dd519f38Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
570dd519f38Smrg#
571dd519f38Smrg# This file is free software; the Free Software Foundation
572dd519f38Smrg# gives unlimited permission to copy and/or distribute it,
573dd519f38Smrg# with or without modifications, as long as this notice is preserved.
574dd519f38Smrg
575dd519f38Smrg# serial 2
576dd519f38Smrg
577dd519f38Smrg# Check whether the underlying file-system supports filenames
578dd519f38Smrg# with a leading dot.  For instance MS-DOS doesn't.
579dd519f38SmrgAC_DEFUN([AM_SET_LEADING_DOT],
580dd519f38Smrg[rm -rf .tst 2>/dev/null
581dd519f38Smrgmkdir .tst 2>/dev/null
582dd519f38Smrgif test -d .tst; then
583dd519f38Smrg  am__leading_dot=.
584dd519f38Smrgelse
585dd519f38Smrg  am__leading_dot=_
586dd519f38Smrgfi
587dd519f38Smrgrmdir .tst 2>/dev/null
588dd519f38SmrgAC_SUBST([am__leading_dot])])
589dd519f38Smrg
590dd519f38Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
591dd519f38Smrg# From Jim Meyering
592dd519f38Smrg
593dd519f38Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
594dd519f38Smrg# Free Software Foundation, Inc.
595dd519f38Smrg#
596dd519f38Smrg# This file is free software; the Free Software Foundation
597dd519f38Smrg# gives unlimited permission to copy and/or distribute it,
598dd519f38Smrg# with or without modifications, as long as this notice is preserved.
599dd519f38Smrg
600dd519f38Smrg# serial 5
601dd519f38Smrg
602dd519f38Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
603dd519f38Smrg# ----------------------------------
604dd519f38Smrg# Control maintainer-specific portions of Makefiles.
605dd519f38Smrg# Default is to disable them, unless `enable' is passed literally.
606dd519f38Smrg# For symmetry, `disable' may be passed as well.  Anyway, the user
607dd519f38Smrg# can override the default with the --enable/--disable switch.
608dd519f38SmrgAC_DEFUN([AM_MAINTAINER_MODE],
609dd519f38Smrg[m4_case(m4_default([$1], [disable]),
610dd519f38Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
611dd519f38Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
612dd519f38Smrg       [m4_define([am_maintainer_other], [enable])
613dd519f38Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
614dd519f38SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
615dd519f38Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
616dd519f38Smrg  AC_ARG_ENABLE([maintainer-mode],
617dd519f38Smrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
618dd519f38Smrg			  (and sometimes confusing) to the casual installer],
619dd519f38Smrg      [USE_MAINTAINER_MODE=$enableval],
620dd519f38Smrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
621dd519f38Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
622dd519f38Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
623dd519f38Smrg  MAINT=$MAINTAINER_MODE_TRUE
624dd519f38Smrg  AC_SUBST([MAINT])dnl
625dd519f38Smrg]
626dd519f38Smrg)
627dd519f38Smrg
628dd519f38SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
629dd519f38Smrg
630dd519f38Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
631ed029a5fSmrg
632dd519f38Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
633dd519f38Smrg#
634dd519f38Smrg# This file is free software; the Free Software Foundation
635dd519f38Smrg# gives unlimited permission to copy and/or distribute it,
636dd519f38Smrg# with or without modifications, as long as this notice is preserved.
637dd519f38Smrg
638dd519f38Smrg# serial 4
639dd519f38Smrg
640dd519f38Smrg# AM_MAKE_INCLUDE()
641dd519f38Smrg# -----------------
642dd519f38Smrg# Check to see how make treats includes.
643dd519f38SmrgAC_DEFUN([AM_MAKE_INCLUDE],
644dd519f38Smrg[am_make=${MAKE-make}
645dd519f38Smrgcat > confinc << 'END'
646dd519f38Smrgam__doit:
647dd519f38Smrg	@echo this is the am__doit target
648dd519f38Smrg.PHONY: am__doit
649dd519f38SmrgEND
650dd519f38Smrg# If we don't find an include directive, just comment out the code.
651dd519f38SmrgAC_MSG_CHECKING([for style of include used by $am_make])
652dd519f38Smrgam__include="#"
653dd519f38Smrgam__quote=
654dd519f38Smrg_am_result=none
655dd519f38Smrg# First try GNU make style include.
656dd519f38Smrgecho "include confinc" > confmf
657dd519f38Smrg# Ignore all kinds of additional output from `make'.
658dd519f38Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
659dd519f38Smrg*the\ am__doit\ target*)
660dd519f38Smrg  am__include=include
661dd519f38Smrg  am__quote=
662dd519f38Smrg  _am_result=GNU
663dd519f38Smrg  ;;
664dd519f38Smrgesac
665dd519f38Smrg# Now try BSD make style include.
666dd519f38Smrgif test "$am__include" = "#"; then
667dd519f38Smrg   echo '.include "confinc"' > confmf
668dd519f38Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
669dd519f38Smrg   *the\ am__doit\ target*)
670dd519f38Smrg     am__include=.include
671dd519f38Smrg     am__quote="\""
672dd519f38Smrg     _am_result=BSD
673dd519f38Smrg     ;;
674dd519f38Smrg   esac
675dd519f38Smrgfi
676dd519f38SmrgAC_SUBST([am__include])
677dd519f38SmrgAC_SUBST([am__quote])
678dd519f38SmrgAC_MSG_RESULT([$_am_result])
679dd519f38Smrgrm -f confinc confmf
680dd519f38Smrg])
681dd519f38Smrg
682dd519f38Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
683dd519f38Smrg
684dd519f38Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
685dd519f38Smrg# Free Software Foundation, Inc.
686dd519f38Smrg#
687dd519f38Smrg# This file is free software; the Free Software Foundation
688dd519f38Smrg# gives unlimited permission to copy and/or distribute it,
689dd519f38Smrg# with or without modifications, as long as this notice is preserved.
690dd519f38Smrg
691dd519f38Smrg# serial 6
692dd519f38Smrg
693dd519f38Smrg# AM_MISSING_PROG(NAME, PROGRAM)
694dd519f38Smrg# ------------------------------
695dd519f38SmrgAC_DEFUN([AM_MISSING_PROG],
696dd519f38Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
697dd519f38Smrg$1=${$1-"${am_missing_run}$2"}
698dd519f38SmrgAC_SUBST($1)])
699dd519f38Smrg
700dd519f38Smrg
701dd519f38Smrg# AM_MISSING_HAS_RUN
702dd519f38Smrg# ------------------
703dd519f38Smrg# Define MISSING if not defined so far and test if it supports --run.
704dd519f38Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
705dd519f38SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
706dd519f38Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
707dd519f38SmrgAC_REQUIRE_AUX_FILE([missing])dnl
708dd519f38Smrgif test x"${MISSING+set}" != xset; then
709dd519f38Smrg  case $am_aux_dir in
710dd519f38Smrg  *\ * | *\	*)
711dd519f38Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
712dd519f38Smrg  *)
713dd519f38Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
714dd519f38Smrg  esac
715dd519f38Smrgfi
716dd519f38Smrg# Use eval to expand $SHELL
717dd519f38Smrgif eval "$MISSING --run true"; then
718dd519f38Smrg  am_missing_run="$MISSING --run "
719dd519f38Smrgelse
720dd519f38Smrg  am_missing_run=
721dd519f38Smrg  AC_MSG_WARN([`missing' script is too old or missing])
722dd519f38Smrgfi
723dd519f38Smrg])
724dd519f38Smrg
725dd519f38Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
726dd519f38Smrg#
727dd519f38Smrg# This file is free software; the Free Software Foundation
728dd519f38Smrg# gives unlimited permission to copy and/or distribute it,
729dd519f38Smrg# with or without modifications, as long as this notice is preserved.
730dd519f38Smrg
731dd519f38Smrg# AM_PROG_MKDIR_P
732dd519f38Smrg# ---------------
733dd519f38Smrg# Check for `mkdir -p'.
734dd519f38SmrgAC_DEFUN([AM_PROG_MKDIR_P],
735dd519f38Smrg[AC_PREREQ([2.60])dnl
736dd519f38SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
737dd519f38Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
738dd519f38Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
739dd519f38Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
740dd519f38Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
741dd519f38Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
742dd519f38Smrgdnl adjustment using top_builddir (which is defined more often than
743dd519f38Smrgdnl MKDIR_P).
744dd519f38SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
745dd519f38Smrgcase $mkdir_p in
746dd519f38Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
747dd519f38Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
748dd519f38Smrgesac
749dd519f38Smrg])
750dd519f38Smrg
751dd519f38Smrg# Helper functions for option handling.                     -*- Autoconf -*-
752dd519f38Smrg
753dd519f38Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
754dd519f38Smrg#
755dd519f38Smrg# This file is free software; the Free Software Foundation
756dd519f38Smrg# gives unlimited permission to copy and/or distribute it,
757dd519f38Smrg# with or without modifications, as long as this notice is preserved.
758dd519f38Smrg
759dd519f38Smrg# serial 4
760dd519f38Smrg
761dd519f38Smrg# _AM_MANGLE_OPTION(NAME)
762dd519f38Smrg# -----------------------
763dd519f38SmrgAC_DEFUN([_AM_MANGLE_OPTION],
764dd519f38Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
765dd519f38Smrg
766dd519f38Smrg# _AM_SET_OPTION(NAME)
767dd519f38Smrg# ------------------------------
768dd519f38Smrg# Set option NAME.  Presently that only means defining a flag for this option.
769dd519f38SmrgAC_DEFUN([_AM_SET_OPTION],
770dd519f38Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
771dd519f38Smrg
772dd519f38Smrg# _AM_SET_OPTIONS(OPTIONS)
773dd519f38Smrg# ----------------------------------
774dd519f38Smrg# OPTIONS is a space-separated list of Automake options.
775dd519f38SmrgAC_DEFUN([_AM_SET_OPTIONS],
776dd519f38Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
777dd519f38Smrg
778dd519f38Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
779dd519f38Smrg# -------------------------------------------
780dd519f38Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
781dd519f38SmrgAC_DEFUN([_AM_IF_OPTION],
782dd519f38Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
783dd519f38Smrg
784dd519f38Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
785dd519f38Smrg
786dd519f38Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
787dd519f38Smrg# Free Software Foundation, Inc.
788dd519f38Smrg#
789dd519f38Smrg# This file is free software; the Free Software Foundation
790dd519f38Smrg# gives unlimited permission to copy and/or distribute it,
791dd519f38Smrg# with or without modifications, as long as this notice is preserved.
792dd519f38Smrg
793dd519f38Smrg# serial 5
794dd519f38Smrg
795dd519f38Smrg# AM_SANITY_CHECK
796dd519f38Smrg# ---------------
797dd519f38SmrgAC_DEFUN([AM_SANITY_CHECK],
798dd519f38Smrg[AC_MSG_CHECKING([whether build environment is sane])
799dd519f38Smrg# Just in case
800dd519f38Smrgsleep 1
801dd519f38Smrgecho timestamp > conftest.file
802dd519f38Smrg# Reject unsafe characters in $srcdir or the absolute working directory
803dd519f38Smrg# name.  Accept space and tab only in the latter.
804dd519f38Smrgam_lf='
805dd519f38Smrg'
806dd519f38Smrgcase `pwd` in
807dd519f38Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
808dd519f38Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
809dd519f38Smrgesac
810dd519f38Smrgcase $srcdir in
811dd519f38Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
812dd519f38Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
813dd519f38Smrgesac
814dd519f38Smrg
815dd519f38Smrg# Do `set' in a subshell so we don't clobber the current shell's
816dd519f38Smrg# arguments.  Must try -L first in case configure is actually a
817dd519f38Smrg# symlink; some systems play weird games with the mod time of symlinks
818dd519f38Smrg# (eg FreeBSD returns the mod time of the symlink's containing
819dd519f38Smrg# directory).
820dd519f38Smrgif (
821dd519f38Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
822dd519f38Smrg   if test "$[*]" = "X"; then
823dd519f38Smrg      # -L didn't work.
824dd519f38Smrg      set X `ls -t "$srcdir/configure" conftest.file`
825dd519f38Smrg   fi
826dd519f38Smrg   rm -f conftest.file
827dd519f38Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
828dd519f38Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
829dd519f38Smrg
830dd519f38Smrg      # If neither matched, then we have a broken ls.  This can happen
831dd519f38Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
832dd519f38Smrg      # broken ls alias from the environment.  This has actually
833dd519f38Smrg      # happened.  Such a system could not be considered "sane".
834dd519f38Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
835dd519f38Smrgalias in your environment])
836dd519f38Smrg   fi
837dd519f38Smrg
838dd519f38Smrg   test "$[2]" = conftest.file
839dd519f38Smrg   )
840dd519f38Smrgthen
841dd519f38Smrg   # Ok.
842dd519f38Smrg   :
843dd519f38Smrgelse
844dd519f38Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
845dd519f38SmrgCheck your system clock])
846dd519f38Smrgfi
847dd519f38SmrgAC_MSG_RESULT(yes)])
848dd519f38Smrg
849dd519f38Smrg# Copyright (C) 2009  Free Software Foundation, Inc.
850dd519f38Smrg#
851dd519f38Smrg# This file is free software; the Free Software Foundation
852dd519f38Smrg# gives unlimited permission to copy and/or distribute it,
853dd519f38Smrg# with or without modifications, as long as this notice is preserved.
854dd519f38Smrg
855dd519f38Smrg# serial 1
856dd519f38Smrg
857dd519f38Smrg# AM_SILENT_RULES([DEFAULT])
858dd519f38Smrg# --------------------------
859dd519f38Smrg# Enable less verbose build rules; with the default set to DEFAULT
860dd519f38Smrg# (`yes' being less verbose, `no' or empty being verbose).
861dd519f38SmrgAC_DEFUN([AM_SILENT_RULES],
862dd519f38Smrg[AC_ARG_ENABLE([silent-rules],
863dd519f38Smrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
864dd519f38Smrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
865dd519f38Smrgcase $enable_silent_rules in
866dd519f38Smrgyes) AM_DEFAULT_VERBOSITY=0;;
867dd519f38Smrgno)  AM_DEFAULT_VERBOSITY=1;;
868dd519f38Smrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
869dd519f38Smrgesac
870dd519f38SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
871dd519f38SmrgAM_BACKSLASH='\'
872dd519f38SmrgAC_SUBST([AM_BACKSLASH])dnl
873dd519f38Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
874dd519f38Smrg])
875dd519f38Smrg
876dd519f38Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
877dd519f38Smrg#
878dd519f38Smrg# This file is free software; the Free Software Foundation
879dd519f38Smrg# gives unlimited permission to copy and/or distribute it,
880dd519f38Smrg# with or without modifications, as long as this notice is preserved.
881dd519f38Smrg
882dd519f38Smrg# AM_PROG_INSTALL_STRIP
883dd519f38Smrg# ---------------------
884dd519f38Smrg# One issue with vendor `install' (even GNU) is that you can't
885dd519f38Smrg# specify the program used to strip binaries.  This is especially
886dd519f38Smrg# annoying in cross-compiling environments, where the build's strip
887dd519f38Smrg# is unlikely to handle the host's binaries.
888dd519f38Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
889dd519f38Smrg# always use install-sh in `make install-strip', and initialize
890dd519f38Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
891dd519f38SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
892dd519f38Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
893dd519f38Smrg# Installed binaries are usually stripped using `strip' when the user
894dd519f38Smrg# run `make install-strip'.  However `strip' might not be the right
895dd519f38Smrg# tool to use in cross-compilation environments, therefore Automake
896dd519f38Smrg# will honor the `STRIP' environment variable to overrule this program.
897dd519f38Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
898dd519f38Smrgif test "$cross_compiling" != no; then
899dd519f38Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
900dd519f38Smrgfi
901dd519f38SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
902dd519f38SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
903dd519f38Smrg
904dd519f38Smrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
905dd519f38Smrg#
906dd519f38Smrg# This file is free software; the Free Software Foundation
907dd519f38Smrg# gives unlimited permission to copy and/or distribute it,
908dd519f38Smrg# with or without modifications, as long as this notice is preserved.
909dd519f38Smrg
910dd519f38Smrg# serial 2
911dd519f38Smrg
912dd519f38Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
913dd519f38Smrg# ---------------------------
914dd519f38Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
915dd519f38Smrg# This macro is traced by Automake.
916dd519f38SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
917dd519f38Smrg
918dd519f38Smrg# AM_SUBST_NOTMAKE(VARIABLE)
919dd519f38Smrg# ---------------------------
920dd519f38Smrg# Public sister of _AM_SUBST_NOTMAKE.
921dd519f38SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
922dd519f38Smrg
923dd519f38Smrg# Check how to create a tarball.                            -*- Autoconf -*-
924dd519f38Smrg
925dd519f38Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
926dd519f38Smrg#
927dd519f38Smrg# This file is free software; the Free Software Foundation
928dd519f38Smrg# gives unlimited permission to copy and/or distribute it,
929dd519f38Smrg# with or without modifications, as long as this notice is preserved.
930dd519f38Smrg
931dd519f38Smrg# serial 2
932dd519f38Smrg
933dd519f38Smrg# _AM_PROG_TAR(FORMAT)
934dd519f38Smrg# --------------------
935dd519f38Smrg# Check how to create a tarball in format FORMAT.
936dd519f38Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
937dd519f38Smrg#
938dd519f38Smrg# Substitute a variable $(am__tar) that is a command
939dd519f38Smrg# writing to stdout a FORMAT-tarball containing the directory
940dd519f38Smrg# $tardir.
941dd519f38Smrg#     tardir=directory && $(am__tar) > result.tar
942dd519f38Smrg#
943dd519f38Smrg# Substitute a variable $(am__untar) that extract such
944dd519f38Smrg# a tarball read from stdin.
945dd519f38Smrg#     $(am__untar) < result.tar
946dd519f38SmrgAC_DEFUN([_AM_PROG_TAR],
947dd519f38Smrg[# Always define AMTAR for backward compatibility.
948dd519f38SmrgAM_MISSING_PROG([AMTAR], [tar])
949dd519f38Smrgm4_if([$1], [v7],
950dd519f38Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
951dd519f38Smrg     [m4_case([$1], [ustar],, [pax],,
952dd519f38Smrg              [m4_fatal([Unknown tar format])])
953dd519f38SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
954dd519f38Smrg# Loop over all known methods to create a tar archive until one works.
955dd519f38Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
956dd519f38Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
957dd519f38Smrg# Do not fold the above two line into one, because Tru64 sh and
958dd519f38Smrg# Solaris sh will not grok spaces in the rhs of `-'.
959dd519f38Smrgfor _am_tool in $_am_tools
960dd519f38Smrgdo
961dd519f38Smrg  case $_am_tool in
962dd519f38Smrg  gnutar)
963dd519f38Smrg    for _am_tar in tar gnutar gtar;
964dd519f38Smrg    do
965dd519f38Smrg      AM_RUN_LOG([$_am_tar --version]) && break
966dd519f38Smrg    done
967dd519f38Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
968dd519f38Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
969dd519f38Smrg    am__untar="$_am_tar -xf -"
970dd519f38Smrg    ;;
971dd519f38Smrg  plaintar)
972dd519f38Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
973dd519f38Smrg    # ustar tarball either.
974dd519f38Smrg    (tar --version) >/dev/null 2>&1 && continue
975dd519f38Smrg    am__tar='tar chf - "$$tardir"'
976dd519f38Smrg    am__tar_='tar chf - "$tardir"'
977dd519f38Smrg    am__untar='tar xf -'
978dd519f38Smrg    ;;
979dd519f38Smrg  pax)
980dd519f38Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
981dd519f38Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
982dd519f38Smrg    am__untar='pax -r'
983dd519f38Smrg    ;;
984dd519f38Smrg  cpio)
985dd519f38Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
986dd519f38Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
987dd519f38Smrg    am__untar='cpio -i -H $1 -d'
988dd519f38Smrg    ;;
989dd519f38Smrg  none)
990dd519f38Smrg    am__tar=false
991dd519f38Smrg    am__tar_=false
992dd519f38Smrg    am__untar=false
993dd519f38Smrg    ;;
994dd519f38Smrg  esac
995dd519f38Smrg
996dd519f38Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
997dd519f38Smrg  # and am__untar set.
998dd519f38Smrg  test -n "${am_cv_prog_tar_$1}" && break
999dd519f38Smrg
1000dd519f38Smrg  # tar/untar a dummy directory, and stop if the command works
1001dd519f38Smrg  rm -rf conftest.dir
1002dd519f38Smrg  mkdir conftest.dir
1003dd519f38Smrg  echo GrepMe > conftest.dir/file
1004dd519f38Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1005dd519f38Smrg  rm -rf conftest.dir
1006dd519f38Smrg  if test -s conftest.tar; then
1007dd519f38Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
1008dd519f38Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1009dd519f38Smrg  fi
1010dd519f38Smrgdone
1011dd519f38Smrgrm -rf conftest.dir
1012dd519f38Smrg
1013dd519f38SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1014dd519f38SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
1015dd519f38SmrgAC_SUBST([am__tar])
1016dd519f38SmrgAC_SUBST([am__untar])
1017dd519f38Smrg]) # _AM_PROG_TAR
1018dd519f38Smrg
1019dd519f38Smrgdnl fontutil.m4.  Generated from fontutil.m4.in by configure.
1020dd519f38Smrgdnl
1021dd519f38Smrgdnl This file comes from X.Org's font-util 1.1.0
1022dd519f38Smrgdnl
1023dd519f38Smrgdnl Copyright 2005 Red Hat, Inc
1024dd519f38Smrgdnl
1025dd519f38Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1026dd519f38Smrgdnl documentation for any purpose is hereby granted without fee, provided that
1027dd519f38Smrgdnl the above copyright notice appear in all copies and that both that
1028dd519f38Smrgdnl copyright notice and this permission notice appear in supporting
1029dd519f38Smrgdnl documentation.
1030dd519f38Smrgdnl
1031dd519f38Smrgdnl The above copyright notice and this permission notice shall be included
1032dd519f38Smrgdnl in all copies or substantial portions of the Software.
1033dd519f38Smrgdnl
1034dd519f38Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1035dd519f38Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1036dd519f38Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1037dd519f38Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1038dd519f38Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1039dd519f38Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1040dd519f38Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
1041dd519f38Smrgdnl
1042dd519f38Smrgdnl Except as contained in this notice, the name of the copyright holders shall
1043dd519f38Smrgdnl not be used in advertising or otherwise to promote the sale, use or
1044dd519f38Smrgdnl other dealings in this Software without prior written authorization
1045dd519f38Smrgdnl from the copyright holders.
1046dd519f38Smrgdnl
1047dd519f38Smrgdnl --------------------------------------------------------------------
1048dd519f38Smrgdnl
1049dd519f38Smrgdnl Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
1050dd519f38Smrgdnl
1051dd519f38Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
1052dd519f38Smrgdnl copy of this software and associated documentation files (the
1053dd519f38Smrgdnl "Software"), to deal in the Software without restriction, including
1054dd519f38Smrgdnl without limitation the rights to use, copy, modify, merge, publish,
1055dd519f38Smrgdnl distribute, and/or sell copies of the Software, and to permit persons
1056dd519f38Smrgdnl to whom the Software is furnished to do so, provided that the above
1057dd519f38Smrgdnl copyright notice(s) and this permission notice appear in all copies of
1058dd519f38Smrgdnl the Software and that both the above copyright notice(s) and this
1059dd519f38Smrgdnl permission notice appear in supporting documentation.
1060dd519f38Smrgdnl
1061dd519f38Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1062dd519f38Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1063dd519f38Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
1064dd519f38Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
1065dd519f38Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
1066dd519f38Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
1067dd519f38Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
1068dd519f38Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
1069dd519f38Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1070dd519f38Smrgdnl
1071dd519f38Smrgdnl Except as contained in this notice, the name of a copyright holder
1072dd519f38Smrgdnl shall not be used in advertising or otherwise to promote the sale, use
1073dd519f38Smrgdnl or other dealings in this Software without prior written authorization
1074dd519f38Smrgdnl of the copyright holder.
1075dd519f38Smrg
1076dd519f38Smrg# XORG_FONT_MACROS_VERSION(required-version)
1077dd519f38Smrg# ------------------------------------------
1078dd519f38Smrg# Minimum version: 1.1.0
1079dd519f38Smrg#
1080dd519f38Smrg# If you're using a macro added in Version 1.1 or newer, include this in
1081dd519f38Smrg# your configure.ac with the minimum required version, such as:
1082dd519f38Smrg# XORG_FONT_MACROS_VERSION(1.1)
1083dd519f38Smrg#
1084dd519f38Smrg# To ensure that this macro is defined, also add:
1085dd519f38Smrg# m4_ifndef([XORG_FONT_MACROS_VERSION],
1086dd519f38Smrg#     [m4_fatal([must install X.Org font-util 1.1 or later before running autoconf/autogen])])
1087dd519f38Smrg#
1088dd519f38Smrg#
1089dd519f38Smrg# See the "minimum version" comment for each macro you use to see what
1090dd519f38Smrg# version you require.
1091dd519f38Smrgm4_defun([XORG_FONT_MACROS_VERSION],[
1092dd519f38Smrgm4_define([vers_have], [1.1.0])
1093dd519f38Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1094dd519f38Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1095dd519f38Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
1096dd519f38Smrg    [m4_fatal([font-util major version ]maj_needed[ is required but ]vers_have[ found])])
1097dd519f38Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
1098dd519f38Smrg    [m4_fatal([font-util version $1 or higher is required but ]vers_have[ found])])
1099dd519f38Smrgm4_undefine([vers_have])
1100dd519f38Smrgm4_undefine([maj_have])
1101dd519f38Smrgm4_undefine([maj_needed])
1102dd519f38Smrg]) # XORG_FONT_MACROS_VERSION
1103dd519f38Smrg
1104dd519f38Smrg# XORG_FONT_CHECK_{maps}()
1105dd519f38Smrg# ------------------------
1106dd519f38Smrg# Minimum version: 1.0.0
1107dd519f38Smrg# These macros add --enable/disable-{maps} where {maps} are ISO8859-*,
1108dd519f38Smrg# JISX0201 or KOI8_R.  By default, they are all enabled.
1109dd519f38Smrg
1110dd519f38SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_1], [XORG_FONT_CHECK_ENCODING(ISO8859-1)])
1111dd519f38SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_2], [XORG_FONT_CHECK_ENCODING(ISO8859-2)])
1112dd519f38SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_3], [XORG_FONT_CHECK_ENCODING(ISO8859-3)])
1113dd519f38SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_4], [XORG_FONT_CHECK_ENCODING(ISO8859-4)])
1114dd519f38SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_5], [XORG_FONT_CHECK_ENCODING(ISO8859-5)])
1115dd519f38SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_6], [XORG_FONT_CHECK_ENCODING(ISO8859-6)])
1116dd519f38SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_7], [XORG_FONT_CHECK_ENCODING(ISO8859-7)])
1117dd519f38SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_8], [XORG_FONT_CHECK_ENCODING(ISO8859-8)])
1118dd519f38SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_9], [XORG_FONT_CHECK_ENCODING(ISO8859-9)])
1119dd519f38SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_10],[XORG_FONT_CHECK_ENCODING(ISO8859-10)])
1120dd519f38SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_11],[XORG_FONT_CHECK_ENCODING(ISO8859-11)])
1121dd519f38SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_12],[XORG_FONT_CHECK_ENCODING(ISO8859-12)])
1122dd519f38SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_13],[XORG_FONT_CHECK_ENCODING(ISO8859-13)])
1123dd519f38SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_14],[XORG_FONT_CHECK_ENCODING(ISO8859-14)])
1124dd519f38SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_15],[XORG_FONT_CHECK_ENCODING(ISO8859-15)])
1125dd519f38SmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_16],[XORG_FONT_CHECK_ENCODING(ISO8859-16)])
1126dd519f38SmrgAC_DEFUN([XORG_FONT_CHECK_JISX0201],  [XORG_FONT_CHECK_ENCODING(JISX0201)])
1127dd519f38SmrgAC_DEFUN([XORG_FONT_CHECK_KOI8_R],    [XORG_FONT_CHECK_ENCODING(KOI8-R)])
1128dd519f38Smrg
1129dd519f38Smrg# XORG_FONT_CHECK_ENCODING(encoding)
1130dd519f38Smrg# ----------------------------------
1131dd519f38Smrg# Minimum version: 1.1.0
1132dd519f38Smrg# This macro adds --enable/disable-<encoding>, enabled by default.
1133dd519f38Smrg# It replaced individual copies of this code in the above macros in 1.1.
1134dd519f38Smrg# Currently assumes encoding names will be all upper-case - add m4_toupper
1135dd519f38Smrg# calls if this is not true in the future.
1136dd519f38Smrg
1137dd519f38SmrgAC_DEFUN([XORG_FONT_CHECK_ENCODING],[
1138dd519f38Smrg	AC_ARG_ENABLE(m4_tolower($1),
1139dd519f38Smrg		AS_HELP_STRING(m4_join([-], [--disable], m4_tolower($1)),
1140dd519f38Smrg				[Build $1 fonts (default: yes)]),
1141dd519f38Smrg		[AS_TR_SH($1)=$enableval], [AS_TR_SH($1)=yes])
1142dd519f38Smrg	AC_MSG_CHECKING([whether to build $1 fonts])
1143dd519f38Smrg	AC_MSG_RESULT($[AS_TR_SH($1)])
1144dd519f38Smrg	AM_CONDITIONAL(AS_TR_SH($1), [test "x$AS_TR_SH($1)" = xyes])
1145dd519f38Smrg]) # XORG_FONT_CHECK_ENCODING
1146dd519f38Smrg
1147dd519f38Smrg# XORG_FONT_CHECK_ENCODING_LIST(encoding1 encoding2....)
1148dd519f38Smrg# -----------------------------------------------------
1149dd519f38Smrg# Minimum version: 1.1.0
1150dd519f38Smrg# Call XORG_FONT_CHECK_ENCODING for multiple encodings at once
1151dd519f38Smrg
1152dd519f38SmrgAC_DEFUN([XORG_FONT_CHECK_ENCODING_LIST],[
1153dd519f38Smrg	m4_foreach_w([enc], [$1], [XORG_FONT_CHECK_ENCODING(enc)])
1154dd519f38Smrg]) # XORG_FONT_CHECK_ENCODING_LIST
1155dd519f38Smrg
1156dd519f38Smrg# XORG_FONT_REQUIRED_PROG(VARNAME, progname)
1157dd519f38Smrg# ------------------------------------------
1158dd519f38Smrg# Minimum version: 1.1.0
1159dd519f38Smrg#
1160dd519f38Smrg# Simple wrapper around AC_PATH_PROG that errors if not found
1161dd519f38Smrg#
1162dd519f38Smrg
1163dd519f38SmrgAC_DEFUN([XORG_FONT_REQUIRED_PROG],[
1164dd519f38Smrg	AC_PATH_PROG($1, $2)
1165dd519f38Smrg	if test x"$1" = x; then
1166dd519f38Smrg		AC_MSG_ERROR([$2 is required to build $PACKAGE_NAME.])
1167dd519f38Smrg	fi
1168dd519f38Smrg])
1169dd519f38Smrg
1170dd519f38Smrg
1171dd519f38Smrg# XORG_FONT_FCCACHE()
1172dd519f38Smrg# -------------------
1173dd519f38Smrg# Minimum version: 1.1.0
1174dd519f38Smrg#
1175dd519f38Smrg# Set FCCACHE to path to fc-cache (fontconfig cache builder) if found
1176dd519f38Smrg# Set RUN_FCCACHE to a rule suitable for substituting into a makefile
1177dd519f38Smrg# to run fc-cache if found and not installing to $DESTDIR
1178dd519f38Smrg#
1179dd519f38Smrg# fc-cache is optional, not required, and should be skipped when making
1180dd519f38Smrg# packages (installing to $DESTDIR).
1181dd519f38Smrg#
1182dd519f38SmrgAC_DEFUN([XORG_FONT_FCCACHE],[
1183dd519f38Smrg	AC_PATH_PROG(FCCACHE, fc-cache)
1184dd519f38Smrg	FCCACHE_WARN='echo "** Warning: fonts.cache not built" ; echo "** Generate this file manually on host system using fc-cache"'
1185dd519f38Smrg	if test x"$FCCACHE" = x ; then
1186dd519f38Smrg		RUN_FCCACHE="${FCCACHE_WARN}"
1187dd519f38Smrg	else
1188dd519f38Smrg		RUN_FCCACHE='@(if test -z "$(DESTDIR)"; then echo $(FCCACHE) $(fontdir); $(FCCACHE) $(fontdir); else'
1189dd519f38Smrg		RUN_FCCACHE="${RUN_FCCACHE} ${FCCACHE_WARN} ; fi)"
1190dd519f38Smrg	fi
1191dd519f38Smrg	AC_SUBST([RUN_FCCACHE])
1192dd519f38Smrg])
1193dd519f38Smrg
1194dd519f38Smrg
1195dd519f38Smrg# XORG_FONT_COMMON_UTILS()
1196dd519f38Smrg# ------------------------
1197dd519f38Smrg# Minimum version: 1.1.0
1198dd519f38Smrg#
1199dd519f38Smrg# Call XORG_FONT_REQUIRED_PROG for programs needed for all font types
1200dd519f38Smrg
1201dd519f38SmrgAC_DEFUN([XORG_FONT_COMMON_UTILS],[
1202dd519f38Smrg	XORG_FONT_FCCACHE
1203dd519f38Smrg	XORG_FONT_REQUIRED_PROG(MKFONTDIR, mkfontdir)
1204dd519f38Smrg])
1205dd519f38Smrg
1206dd519f38Smrg# XORG_FONT_SCALED_UTILS()
1207dd519f38Smrg# ------------------------
1208dd519f38Smrg# Minimum version: 1.1.0
1209dd519f38Smrg#
1210dd519f38Smrg# Call XORG_FONT_REQUIRED_PROG for programs needed for scalable fonts
1211dd519f38Smrg# (TrueType, OpenType, Type1)
1212dd519f38Smrg
1213dd519f38SmrgAC_DEFUN([XORG_FONT_SCALED_UTILS],[
1214dd519f38Smrg	XORG_FONT_COMMON_UTILS
1215dd519f38Smrg	XORG_FONT_REQUIRED_PROG(MKFONTSCALE, mkfontscale)
1216dd519f38Smrg])
1217dd519f38Smrg
1218dd519f38Smrg# XORG_FONT_BDF_UTILS()
1219dd519f38Smrg# ---------------------
1220dd519f38Smrg# Minimum version: 1.1.0
1221dd519f38Smrg#
1222dd519f38Smrg# Call XORG_FONT_REQUIRED_PROG for programs needed for BDF format bitmap fonts
1223dd519f38Smrg# Also call XORG_FONT_CHECK_COMPRESSION to determine how to compress the
1224dd519f38Smrg# PCF output files created by bdftopcf
1225dd519f38Smrg
1226dd519f38SmrgAC_DEFUN([XORG_FONT_BDF_UTILS],[
1227dd519f38Smrg	XORG_FONT_COMMON_UTILS
1228dd519f38Smrg	XORG_FONT_REQUIRED_PROG(BDFTOPCF, bdftopcf)
1229dd519f38Smrg	XORG_FONT_CHECK_COMPRESSION
1230dd519f38Smrg])
1231dd519f38Smrg
1232dd519f38Smrg# XORG_FONT_CHECK_COMPRESSION()
1233dd519f38Smrg# -----------------------------
1234dd519f38Smrg# Minimum version: 1.1.0
1235dd519f38Smrg#
1236dd519f38Smrg# Offer a --with-compression flag to control what compression method is
1237dd519f38Smrg# used for pcf font files.   Offers all the methods currently supported
1238dd519f38Smrg# by libXfont, including no compression.
1239dd519f38Smrg
1240dd519f38SmrgAC_DEFUN([XORG_FONT_CHECK_COMPRESSION],[
1241dd519f38Smrg	AC_MSG_CHECKING([font compression method])
1242dd519f38Smrg	AC_ARG_WITH(compression,
1243dd519f38Smrg	 [AS_HELP_STRING([--with-compression=<no|compress|gzip|bzip2>],
1244dd519f38Smrg			 [compression method to use on pcf fonts])],
1245dd519f38Smrg         [compression="$withval"], [compression="yes"])
1246dd519f38Smrg	if test x"$compression" = "xyes" ; then
1247dd519f38Smrg		compression="gzip"
1248dd519f38Smrg	fi
1249dd519f38Smrg	AC_MSG_RESULT([${compression}])
1250dd519f38Smrg	case ${compression} in
1251dd519f38Smrg	 *compress)	COMPRESS_SUFFIX=".Z" ;;
1252dd519f38Smrg	 *gzip)		COMPRESS_SUFFIX=".gz" ;;
1253dd519f38Smrg	 *bzip2)	COMPRESS_SUFFIX=".bz2" ;;
1254dd519f38Smrg	 no|none)	COMPRESS_SUFFIX="" ; COMPRESS="cat" ;;
1255dd519f38Smrg	 *) AC_MSG_ERROR([${compression} is not a supported compression method]) ;;
1256dd519f38Smrg	esac
1257dd519f38Smrg	if test x"$COMPRESS_SUFFIX" != "x" ; then
1258dd519f38Smrg	   XORG_FONT_REQUIRED_PROG(COMPRESS, ${compression})
1259dd519f38Smrg	fi
1260dd519f38Smrg	AC_SUBST([COMPRESS_SUFFIX])
1261dd519f38Smrg])
1262dd519f38Smrg
1263dd519f38Smrg# XORG_FONT_UCS2ANY()
1264dd519f38Smrg# -------------------
1265dd519f38Smrg# Minimum version: 1.1.0
1266dd519f38Smrg#
1267dd519f38Smrg# Call XORG_FONT_REQUIRED_PROG for ucs2any program needed for splitting
1268dd519f38Smrg# Unicode-encoded BDF format bitmap fonts into subsets for older encodings.
1269dd519f38Smrg# Also call pkg-config to find the directory with the encoding files needed
1270dd519f38Smrg# by ucs2any, and export it as MAPFILES_PATH to the Makefiles
1271dd519f38Smrg
1272dd519f38SmrgAC_DEFUN([XORG_FONT_UCS2ANY],[
1273dd519f38Smrg	XORG_FONT_REQUIRED_PROG(UCS2ANY, ucs2any)
1274dd519f38Smrg	PKG_CHECK_MODULES(MAPS, [fontutil])
1275dd519f38Smrg	AC_MSG_CHECKING([for ucs2any encoding data files])
1276dd519f38Smrg	MAPFILES_PATH=`pkg-config --variable=mapdir fontutil`
1277dd519f38Smrg	AC_SUBST(MAPFILES_PATH)
1278dd519f38Smrg	AC_MSG_RESULT([${MAPFILES_PATH}])
1279dd519f38Smrg])
1280dd519f38Smrg
1281dd519f38Smrg
1282dd519f38Smrg
1283dd519f38Smrg# XORG_FONTROOTDIR()
1284dd519f38Smrg# --------------------
1285dd519f38Smrg# Minimum version: 1.1.0
1286dd519f38Smrg#
1287dd519f38Smrg# Sets FONTROOTDIR to the root directory for font files.  Uses the first
1288dd519f38Smrg# found from:
1289dd519f38Smrg#	--with-fontrootdir
1290dd519f38Smrg#	pkg-config --variable=fontrootdir fontutil
1291dd519f38Smrg#	${datadir}/fonts/X11
1292dd519f38Smrg
1293dd519f38SmrgAC_DEFUN([XORG_FONTROOTDIR],[
1294dd519f38Smrg	dnl Ensure $PKG_CONFIG is set first
1295dd519f38Smrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1296dd519f38Smrg
1297dd519f38Smrg	AC_MSG_CHECKING([for root directory for font files])
1298dd519f38Smrg	AC_ARG_WITH(fontrootdir,
1299dd519f38Smrg		    AS_HELP_STRING([--with-fontrootdir=DIR],
1300dd519f38Smrg			   [Path to root directory for font files]),
1301dd519f38Smrg		    [FONTROOTDIR="$withval"])
1302dd519f38Smrg	# if --with-fontrootdir not specified...
1303dd519f38Smrg	if test "x${FONTROOTDIR}" = "x"; then
1304dd519f38Smrg		FONTROOTDIR=`$PKG_CONFIG --variable=fontrootdir fontutil`
1305dd519f38Smrg	fi
1306dd519f38Smrg	# ...and if pkg-config didn't find fontdir in fontutil.pc...
1307dd519f38Smrg	if test "x${FONTROOTDIR}" = "x"; then
1308dd519f38Smrg		FONTROOTDIR="${datadir}/fonts/X11"
1309dd519f38Smrg	fi
1310dd519f38Smrg	AC_SUBST(FONTROOTDIR)
1311dd519f38Smrg	AC_MSG_RESULT([${FONTROOTDIR}])
1312dd519f38Smrg])
1313dd519f38Smrg
1314dd519f38Smrg# XORG_FONTSUBDIR(variable, flag, subdir)
1315dd519f38Smrg# ---------------------------------------
1316dd519f38Smrg# Minimum version: 1.1.0
1317dd519f38Smrg#
1318dd519f38Smrg# Offer a --with-<flag> flag to control directory for font installation
1319dd519f38Smrg# Default is the specified <subdir> of the font root directory.
1320dd519f38Smrg# Sets <variable> to the selected directory
1321dd519f38Smrg
1322dd519f38SmrgAC_DEFUN([XORG_FONTSUBDIR],[
1323dd519f38Smrg	AC_REQUIRE([XORG_FONTROOTDIR])
1324dd519f38Smrg
1325dd519f38Smrg	AC_MSG_CHECKING([for directory for $3 files])
1326dd519f38Smrg	AC_ARG_WITH($2,
1327dd519f38Smrg		    [AS_HELP_STRING([--with-$2=DIR],
1328dd519f38Smrg		       		   [Path to $3 files [FONTROOTDIR/$3]])],
1329dd519f38Smrg		    [$1="${withval}"], [$1='${FONTROOTDIR}/$3'])
1330dd519f38Smrg	AC_SUBST($1)
1331dd519f38Smrg	AC_MSG_RESULT([${$1}])
1332dd519f38Smrg]) # XORG_FONTSUBDIR
1333dd519f38Smrg
1334dd519f38Smrg# XORG_FONTDIR(subdir)
1335dd519f38Smrg# --------------------
1336dd519f38Smrg# Minimum version: 1.1.0
1337dd519f38Smrg#
1338dd519f38Smrg# Offer a --with-fontdir flag to control directory for font installation
1339dd519f38Smrg# Default is the specified subdir of the font root directory.
1340dd519f38Smrg# Sets FONTDIR to the selected directory
1341dd519f38Smrg
1342dd519f38SmrgAC_DEFUN([XORG_FONTDIR],[XORG_FONTSUBDIR([FONTDIR], [fontdir], [$1])])
1343dd519f38Smrg
1344dd519f38Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1345dd519f38Smrgdnl
1346dd519f38Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
1347dd519f38Smrgdnl 
1348dd519f38Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
1349dd519f38Smrgdnl copy of this software and associated documentation files (the
1350dd519f38Smrgdnl "Software"), to deal in the Software without restriction, including
1351dd519f38Smrgdnl without limitation the rights to use, copy, modify, merge, publish,
1352dd519f38Smrgdnl distribute, and/or sell copies of the Software, and to permit persons
1353dd519f38Smrgdnl to whom the Software is furnished to do so, provided that the above
1354dd519f38Smrgdnl copyright notice(s) and this permission notice appear in all copies of
1355dd519f38Smrgdnl the Software and that both the above copyright notice(s) and this
1356dd519f38Smrgdnl permission notice appear in supporting documentation.
1357dd519f38Smrgdnl
1358dd519f38Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1359dd519f38Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1360dd519f38Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
1361dd519f38Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
1362dd519f38Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
1363dd519f38Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
1364dd519f38Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
1365dd519f38Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
1366dd519f38Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1367dd519f38Smrgdnl
1368dd519f38Smrgdnl Except as contained in this notice, the name of a copyright holder
1369dd519f38Smrgdnl shall not be used in advertising or otherwise to promote the sale, use
1370dd519f38Smrgdnl or other dealings in this Software without prior written authorization
1371dd519f38Smrgdnl of the copyright holder.
1372dd519f38Smrg
1373dd519f38Smrg# XORG_MACROS_VERSION(required-version)
1374dd519f38Smrg# -------------------------------------
1375dd519f38Smrg# Minimum version: 1.1.0
1376dd519f38Smrg#
1377dd519f38Smrg# If you're using a macro added in Version 1.1 or newer, include this in
1378dd519f38Smrg# your configure.ac with the minimum required version, such as:
1379dd519f38Smrg# XORG_MACROS_VERSION(1.1)
1380dd519f38Smrg#
1381dd519f38Smrg# To ensure that this macro is defined, also add:
1382dd519f38Smrg# m4_ifndef([XORG_MACROS_VERSION],
1383dd519f38Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
1384dd519f38Smrg#
1385dd519f38Smrg#
1386dd519f38Smrg# See the "minimum version" comment for each macro you use to see what 
1387dd519f38Smrg# version you require.
1388dd519f38Smrgm4_defun([XORG_MACROS_VERSION],[
1389dd519f38Smrgm4_define([vers_have], [1.3.0])
1390dd519f38Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1391dd519f38Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1392dd519f38Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
1393dd519f38Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1394dd519f38Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
1395dd519f38Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1396dd519f38Smrgm4_undefine([vers_have])
1397dd519f38Smrgm4_undefine([maj_have])
1398dd519f38Smrgm4_undefine([maj_needed])
1399dd519f38Smrg]) # XORG_MACROS_VERSION
1400dd519f38Smrg
1401dd519f38Smrg# XORG_PROG_RAWCPP()
1402dd519f38Smrg# ------------------
1403dd519f38Smrg# Minimum version: 1.0.0
1404dd519f38Smrg#
1405dd519f38Smrg# Find cpp program and necessary flags for use in pre-processing text files
1406dd519f38Smrg# such as man pages and config files
1407dd519f38SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
1408dd519f38SmrgAC_REQUIRE([AC_PROG_CPP])
1409dd519f38SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
1410dd519f38Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1411dd519f38Smrg
1412dd519f38Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
1413dd519f38Smrg# which is not the best choice for supporting other OS'es, but covers most
1414dd519f38Smrg# of the ones we need for now.
1415dd519f38SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
1416dd519f38SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
1417dd519f38Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1418dd519f38Smrg	AC_MSG_RESULT([no])
1419dd519f38Smrgelse
1420dd519f38Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1421dd519f38Smrg		RAWCPPFLAGS=-undef
1422dd519f38Smrg		AC_MSG_RESULT([yes])
1423dd519f38Smrg	# under Cygwin unix is still defined even with -undef
1424dd519f38Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1425dd519f38Smrg		RAWCPPFLAGS="-undef -ansi"
1426dd519f38Smrg		AC_MSG_RESULT([yes, with -ansi])
1427dd519f38Smrg	else
1428dd519f38Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1429dd519f38Smrg	fi
1430dd519f38Smrgfi
1431dd519f38Smrgrm -f conftest.$ac_ext
1432dd519f38Smrg
1433dd519f38SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
1434dd519f38SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
1435dd519f38Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1436dd519f38Smrg	AC_MSG_RESULT([no])
1437dd519f38Smrgelse
1438dd519f38Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1439dd519f38Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1440dd519f38Smrg		AC_MSG_RESULT([yes])
1441dd519f38Smrg	else
1442dd519f38Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1443dd519f38Smrg	fi
1444dd519f38Smrgfi
1445dd519f38Smrgrm -f conftest.$ac_ext
1446dd519f38SmrgAC_SUBST(RAWCPPFLAGS)
1447dd519f38Smrg]) # XORG_PROG_RAWCPP
1448dd519f38Smrg
1449dd519f38Smrg# XORG_MANPAGE_SECTIONS()
1450dd519f38Smrg# -----------------------
1451dd519f38Smrg# Minimum version: 1.0.0
1452dd519f38Smrg#
1453dd519f38Smrg# Determine which sections man pages go in for the different man page types
1454dd519f38Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1455dd519f38Smrg# Not sure if there's any better way than just hardcoding by OS name.
1456dd519f38Smrg# Override default settings by setting environment variables
1457dd519f38Smrg
1458dd519f38SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1459dd519f38SmrgAC_REQUIRE([AC_CANONICAL_HOST])
1460dd519f38Smrg
1461dd519f38Smrgif test x$APP_MAN_SUFFIX = x    ; then
1462dd519f38Smrg    APP_MAN_SUFFIX=1
1463dd519f38Smrgfi
1464dd519f38Smrgif test x$APP_MAN_DIR = x    ; then
1465dd519f38Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1466dd519f38Smrgfi
1467dd519f38Smrg
1468dd519f38Smrgif test x$LIB_MAN_SUFFIX = x    ; then
1469dd519f38Smrg    LIB_MAN_SUFFIX=3
1470dd519f38Smrgfi
1471dd519f38Smrgif test x$LIB_MAN_DIR = x    ; then
1472dd519f38Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1473dd519f38Smrgfi
1474dd519f38Smrg
1475dd519f38Smrgif test x$FILE_MAN_SUFFIX = x    ; then
1476dd519f38Smrg    case $host_os in
1477dd519f38Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
1478dd519f38Smrg	*)		FILE_MAN_SUFFIX=5  ;;
1479dd519f38Smrg    esac
1480dd519f38Smrgfi
1481dd519f38Smrgif test x$FILE_MAN_DIR = x    ; then
1482dd519f38Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1483dd519f38Smrgfi
1484dd519f38Smrg
1485dd519f38Smrgif test x$MISC_MAN_SUFFIX = x    ; then
1486dd519f38Smrg    case $host_os in
1487dd519f38Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
1488dd519f38Smrg	*)		MISC_MAN_SUFFIX=7  ;;
1489dd519f38Smrg    esac
1490dd519f38Smrgfi
1491dd519f38Smrgif test x$MISC_MAN_DIR = x    ; then
1492dd519f38Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1493dd519f38Smrgfi
1494dd519f38Smrg
1495dd519f38Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
1496dd519f38Smrg    case $host_os in
1497dd519f38Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
1498dd519f38Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
1499dd519f38Smrg    esac
1500dd519f38Smrgfi
1501dd519f38Smrgif test x$DRIVER_MAN_DIR = x    ; then
1502dd519f38Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1503dd519f38Smrgfi
1504dd519f38Smrg
1505dd519f38Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
1506dd519f38Smrg    case $host_os in
1507dd519f38Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
1508dd519f38Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
1509dd519f38Smrg    esac
1510dd519f38Smrgfi
1511dd519f38Smrgif test x$ADMIN_MAN_DIR = x    ; then
1512dd519f38Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1513dd519f38Smrgfi
1514dd519f38Smrg
1515dd519f38Smrg
1516dd519f38SmrgAC_SUBST([APP_MAN_SUFFIX])
1517dd519f38SmrgAC_SUBST([LIB_MAN_SUFFIX])
1518dd519f38SmrgAC_SUBST([FILE_MAN_SUFFIX])
1519dd519f38SmrgAC_SUBST([MISC_MAN_SUFFIX])
1520dd519f38SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
1521dd519f38SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
1522dd519f38SmrgAC_SUBST([APP_MAN_DIR])
1523dd519f38SmrgAC_SUBST([LIB_MAN_DIR])
1524dd519f38SmrgAC_SUBST([FILE_MAN_DIR])
1525dd519f38SmrgAC_SUBST([MISC_MAN_DIR])
1526dd519f38SmrgAC_SUBST([DRIVER_MAN_DIR])
1527dd519f38SmrgAC_SUBST([ADMIN_MAN_DIR])
1528dd519f38Smrg]) # XORG_MANPAGE_SECTIONS
1529dd519f38Smrg
1530dd519f38Smrg# XORG_CHECK_LINUXDOC
1531dd519f38Smrg# -------------------
1532dd519f38Smrg# Minimum version: 1.0.0
1533dd519f38Smrg#
1534dd519f38Smrg# Defines the variable MAKE_TEXT if the necessary tools and
1535dd519f38Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1536dd519f38Smrg# Whether or not the necessary tools and files are found can be checked
1537dd519f38Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1538dd519f38SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
1539dd519f38Smrgif test x$XORG_SGML_PATH = x ; then
1540dd519f38Smrg    XORG_SGML_PATH=$prefix/share/sgml
1541dd519f38Smrgfi
1542dd519f38SmrgHAVE_DEFS_ENT=
1543dd519f38Smrg
1544dd519f38Smrgif test x"$cross_compiling" = x"yes" ; then
1545dd519f38Smrg  HAVE_DEFS_ENT=no
1546dd519f38Smrgelse
1547dd519f38Smrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1548dd519f38Smrgfi
1549dd519f38Smrg
1550dd519f38SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
1551dd519f38SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
1552dd519f38Smrg
1553dd519f38SmrgAC_MSG_CHECKING([Whether to build documentation])
1554dd519f38Smrg
1555dd519f38Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
1556dd519f38Smrg   BUILDDOC=yes
1557dd519f38Smrgelse
1558dd519f38Smrg   BUILDDOC=no
1559dd519f38Smrgfi
1560dd519f38Smrg
1561dd519f38SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1562dd519f38Smrg
1563dd519f38SmrgAC_MSG_RESULT([$BUILDDOC])
1564dd519f38Smrg
1565dd519f38SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
1566dd519f38Smrg
1567dd519f38Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
1568dd519f38Smrg   BUILDPDFDOC=yes
1569dd519f38Smrgelse
1570dd519f38Smrg   BUILDPDFDOC=no
1571dd519f38Smrgfi
1572ed029a5fSmrg
1573dd519f38SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1574ed029a5fSmrg
1575dd519f38SmrgAC_MSG_RESULT([$BUILDPDFDOC])
1576ed029a5fSmrg
1577dd519f38SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
1578dd519f38SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1579dd519f38SmrgMAKE_PDF="$PS2PDF"
1580dd519f38SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1581ed029a5fSmrg
1582dd519f38SmrgAC_SUBST(MAKE_TEXT)
1583dd519f38SmrgAC_SUBST(MAKE_PS)
1584dd519f38SmrgAC_SUBST(MAKE_PDF)
1585dd519f38SmrgAC_SUBST(MAKE_HTML)
1586dd519f38Smrg]) # XORG_CHECK_LINUXDOC
1587ed029a5fSmrg
1588dd519f38Smrg# XORG_CHECK_DOCBOOK
1589dd519f38Smrg# -------------------
1590dd519f38Smrg# Minimum version: 1.0.0
1591dd519f38Smrg#
1592dd519f38Smrg# Checks for the ability to build output formats from SGML DocBook source.
1593dd519f38Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1594dd519f38Smrg# indicates whether the necessary tools and files are found and, if set,
1595dd519f38Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1596dd519f38SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
1597dd519f38Smrgif test x$XORG_SGML_PATH = x ; then
1598dd519f38Smrg    XORG_SGML_PATH=$prefix/share/sgml
1599ed029a5fSmrgfi
1600dd519f38SmrgHAVE_DEFS_ENT=
1601dd519f38SmrgBUILDTXTDOC=no
1602dd519f38SmrgBUILDPDFDOC=no
1603dd519f38SmrgBUILDPSDOC=no
1604dd519f38SmrgBUILDHTMLDOC=no
1605dd519f38Smrg
1606dd519f38SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1607dd519f38Smrg
1608dd519f38SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
1609dd519f38SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1610dd519f38SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
1611dd519f38SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1612dd519f38Smrg
1613dd519f38SmrgAC_MSG_CHECKING([Whether to build text documentation])
1614dd519f38Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
1615dd519f38Smrg   test x$BUILD_TXTDOC != xno; then
1616dd519f38Smrg	BUILDTXTDOC=yes
1617ed029a5fSmrgfi
1618dd519f38SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1619dd519f38SmrgAC_MSG_RESULT([$BUILDTXTDOC])
1620ed029a5fSmrg
1621dd519f38SmrgAC_MSG_CHECKING([Whether to build PDF documentation])
1622dd519f38Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
1623dd519f38Smrg   test x$BUILD_PDFDOC != xno; then
1624dd519f38Smrg	BUILDPDFDOC=yes
1625dd519f38Smrgfi
1626dd519f38SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1627dd519f38SmrgAC_MSG_RESULT([$BUILDPDFDOC])
1628ed029a5fSmrg
1629dd519f38SmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
1630dd519f38Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
1631dd519f38Smrg   test x$BUILD_PSDOC != xno; then
1632dd519f38Smrg	BUILDPSDOC=yes
1633dd519f38Smrgfi
1634dd519f38SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1635dd519f38SmrgAC_MSG_RESULT([$BUILDPSDOC])
1636ed029a5fSmrg
1637dd519f38SmrgAC_MSG_CHECKING([Whether to build HTML documentation])
1638dd519f38Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
1639dd519f38Smrg   test x$BUILD_HTMLDOC != xno; then
1640dd519f38Smrg	BUILDHTMLDOC=yes
1641dd519f38Smrgfi
1642dd519f38SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1643dd519f38SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
1644ed029a5fSmrg
1645dd519f38SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1646dd519f38SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1647dd519f38SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1648dd519f38SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1649ed029a5fSmrg
1650dd519f38SmrgAC_SUBST(MAKE_TEXT)
1651dd519f38SmrgAC_SUBST(MAKE_PS)
1652dd519f38SmrgAC_SUBST(MAKE_PDF)
1653dd519f38SmrgAC_SUBST(MAKE_HTML)
1654dd519f38Smrg]) # XORG_CHECK_DOCBOOK
1655ed029a5fSmrg
1656dd519f38Smrg# XORG_CHECK_MALLOC_ZERO
1657dd519f38Smrg# ----------------------
1658dd519f38Smrg# Minimum version: 1.0.0
1659dd519f38Smrg#
1660dd519f38Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1661dd519f38Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1662dd519f38Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1663dd519f38SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1664dd519f38SmrgAC_ARG_ENABLE(malloc0returnsnull,
1665dd519f38Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
1666dd519f38Smrg		       [malloc(0) returns NULL (default: auto)]),
1667dd519f38Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1668dd519f38Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1669dd519f38Smrg
1670dd519f38SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1671dd519f38Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1672dd519f38Smrg	AC_RUN_IFELSE([
1673dd519f38Smrgchar *malloc();
1674dd519f38Smrgchar *realloc();
1675dd519f38Smrgchar *calloc();
1676dd519f38Smrgmain() {
1677dd519f38Smrg    char *m0, *r0, *c0, *p;
1678dd519f38Smrg    m0 = malloc(0);
1679dd519f38Smrg    p = malloc(10);
1680dd519f38Smrg    r0 = realloc(p,0);
1681dd519f38Smrg    c0 = calloc(0);
1682dd519f38Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
1683dd519f38Smrg}],
1684dd519f38Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
1685dd519f38Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
1686dd519f38Smrgfi
1687dd519f38SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1688ed029a5fSmrg
1689dd519f38Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1690dd519f38Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1691dd519f38Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1692dd519f38Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1693dd519f38Smrgelse
1694dd519f38Smrg	MALLOC_ZERO_CFLAGS=""
1695dd519f38Smrg	XMALLOC_ZERO_CFLAGS=""
1696dd519f38Smrg	XTMALLOC_ZERO_CFLAGS=""
1697dd519f38Smrgfi
1698ed029a5fSmrg
1699dd519f38SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1700dd519f38SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1701dd519f38SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1702dd519f38Smrg]) # XORG_CHECK_MALLOC_ZERO
1703dd519f38Smrg
1704dd519f38Smrg# XORG_WITH_LINT()
1705dd519f38Smrg# ----------------
1706dd519f38Smrg# Minimum version: 1.1.0
1707dd519f38Smrg#
1708dd519f38Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint
1709dd519f38Smrg# is specified.   (Use --with-lint=sparse for sparse.)
1710dd519f38Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
1711dd519f38Smrg# Sets $LINT_FLAGS to flags to pass to source checker
1712dd519f38Smrg# Sets LINT automake conditional if enabled (default: disabled)
1713dd519f38Smrg#
1714dd519f38SmrgAC_DEFUN([XORG_WITH_LINT],[
1715dd519f38Smrg
1716dd519f38Smrg# Allow checking code with lint, sparse, etc.
1717dd519f38SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1718dd519f38Smrg		[Use a lint-style source code checker (default: disabled)])],
1719dd519f38Smrg		[use_lint=$withval], [use_lint=no])
1720dd519f38Smrgif test "x$use_lint" = "xyes" ; then
1721dd519f38Smrg	LINT="lint"
1722ed029a5fSmrgelse
1723dd519f38Smrg	LINT="$use_lint"
1724dd519f38Smrgfi
1725dd519f38Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
1726dd519f38Smrg    case $LINT in
1727dd519f38Smrg	lint|*/lint)
1728dd519f38Smrg	    case $host_os in
1729dd519f38Smrg		solaris*)
1730dd519f38Smrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1731dd519f38Smrg			;;
1732dd519f38Smrg	    esac
1733dd519f38Smrg	    ;;
1734dd519f38Smrg    esac
1735ed029a5fSmrgfi
1736ed029a5fSmrg
1737dd519f38SmrgAC_SUBST(LINT)
1738dd519f38SmrgAC_SUBST(LINT_FLAGS)
1739dd519f38SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
1740ed029a5fSmrg
1741dd519f38Smrg]) # XORG_WITH_LINT
1742ed029a5fSmrg
1743dd519f38Smrg# XORG_LINT_LIBRARY(LIBNAME)
1744dd519f38Smrg# --------------------------
1745dd519f38Smrg# Minimum version: 1.1.0
1746dd519f38Smrg#
1747dd519f38Smrg# Sets up flags for building lint libraries for checking programs that call
1748dd519f38Smrg# functions in the library.
1749dd519f38Smrg# Disabled by default, enable with --enable-lint-library
1750dd519f38Smrg# Sets: 
1751dd519f38Smrg#	@LINTLIB@		- name of lint library file to make
1752dd519f38Smrg#	MAKE_LINT_LIB		- automake conditional
1753dd519f38Smrg#
1754ed029a5fSmrg
1755dd519f38SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
1756dd519f38SmrgAC_REQUIRE([XORG_WITH_LINT])
1757dd519f38Smrg# Build lint "library" for more indepth checks of programs calling this library
1758dd519f38SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
1759dd519f38Smrg	[Create lint library (default: disabled)])],
1760dd519f38Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
1761dd519f38Smrgif test "x$make_lint_lib" != "xno" ; then
1762dd519f38Smrg	if test "x$LINT" = "xno" ; then
1763dd519f38Smrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
1764dd519f38Smrg	fi
1765dd519f38Smrg	if test "x$make_lint_lib" = "xyes" ; then
1766dd519f38Smrg		LINTLIB=llib-l$1.ln
1767dd519f38Smrg	else
1768dd519f38Smrg		LINTLIB=$make_lint_lib
1769dd519f38Smrg	fi
1770dd519f38Smrgfi
1771dd519f38SmrgAC_SUBST(LINTLIB)
1772dd519f38SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1773ed029a5fSmrg
1774dd519f38Smrg]) # XORG_LINT_LIBRARY
1775ed029a5fSmrg
1776dd519f38Smrg# XORG_CWARNFLAGS
1777dd519f38Smrg# ---------------
1778dd519f38Smrg# Minimum version: 1.2.0
1779dd519f38Smrg#
1780dd519f38Smrg# Defines CWARNFLAGS to enable C compiler warnings.
1781dd519f38Smrg#
1782dd519f38SmrgAC_DEFUN([XORG_CWARNFLAGS], [
1783dd519f38SmrgAC_REQUIRE([AC_PROG_CC])
1784dd519f38Smrgif  test "x$GCC" = xyes ; then
1785dd519f38Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
1786dd519f38Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
1787dd519f38Smrg-Wbad-function-cast"
1788dd519f38Smrg    case `$CC -dumpversion` in
1789dd519f38Smrg    3.4.* | 4.*)
1790dd519f38Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
1791dd519f38Smrg	;;
1792dd519f38Smrg    esac
1793dd519f38Smrgelse
1794dd519f38Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1795dd519f38Smrg    if test "x$SUNCC" = "xyes"; then
1796dd519f38Smrg	CWARNFLAGS="-v"
1797dd519f38Smrg    fi
1798dd519f38Smrgfi
1799dd519f38SmrgAC_SUBST(CWARNFLAGS)
1800dd519f38Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
1801dd519f38Smrg]) # XORG_CWARNFLAGS
1802ed029a5fSmrg
1803dd519f38Smrg# XORG_STRICT_OPTION
1804dd519f38Smrg# -----------------------
1805dd519f38Smrg# Minimum version: 1.3.0
1806dd519f38Smrg#
1807dd519f38Smrg# Add configure option to enable strict compilation
1808dd519f38SmrgAC_DEFUN([XORG_STRICT_OPTION], [
1809dd519f38SmrgAC_REQUIRE([AC_PROG_CC])
1810dd519f38SmrgAC_REQUIRE([AC_PROG_CC_C99])
1811dd519f38SmrgAC_REQUIRE([XORG_CWARNFLAGS])
1812dd519f38Smrg
1813dd519f38SmrgAC_ARG_ENABLE(strict-compilation,
1814dd519f38Smrg			  AS_HELP_STRING([--enable-strict-compilation],
1815dd519f38Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
1816dd519f38Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
1817dd519f38Smrgif test "x$STRICT_COMPILE" = "xyes"; then
1818dd519f38Smrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1819dd519f38Smrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
1820dd519f38Smrg	if test "x$GCC" = xyes ; then
1821dd519f38Smrg		STRICT_CFLAGS="-pedantic -Werror"
1822dd519f38Smrg	elif test "x$SUNCC" = "xyes"; then
1823dd519f38Smrg		STRICT_CFLAGS="-errwarn"
1824dd519f38Smrg    elif test "x$INTELCC" = "xyes"; then
1825dd519f38Smrg		STRICT_CFLAGS="-Werror"
1826dd519f38Smrg	fi
1827dd519f38Smrgfi
1828dd519f38SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
1829dd519f38SmrgAC_SUBST([CWARNFLAGS])
1830dd519f38Smrg]) # XORG_STRICT_OPTION
1831ed029a5fSmrg
1832dd519f38Smrg# XORG_DEFAULT_OPTIONS
1833dd519f38Smrg# --------------------
1834dd519f38Smrg# Minimum version: 1.3.0
1835dd519f38Smrg#
1836dd519f38Smrg# Defines default options for X.Org modules.
1837dd519f38Smrg#
1838dd519f38SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
1839dd519f38SmrgXORG_CWARNFLAGS
1840dd519f38SmrgXORG_STRICT_OPTION
1841dd519f38SmrgXORG_RELEASE_VERSION
1842dd519f38SmrgXORG_CHANGELOG
1843dd519f38SmrgXORG_MANPAGE_SECTIONS
1844dd519f38Smrg]) # XORG_DEFAULT_OPTIONS
1845dd519f38Smrgdnl Copyright 2005 Red Hat, Inc
1846dd519f38Smrgdnl
1847dd519f38Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1848dd519f38Smrgdnl documentation for any purpose is hereby granted without fee, provided that
1849dd519f38Smrgdnl the above copyright notice appear in all copies and that both that
1850dd519f38Smrgdnl copyright notice and this permission notice appear in supporting
1851dd519f38Smrgdnl documentation.
1852dd519f38Smrgdnl
1853dd519f38Smrgdnl The above copyright notice and this permission notice shall be included
1854dd519f38Smrgdnl in all copies or substantial portions of the Software.
1855dd519f38Smrgdnl
1856dd519f38Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1857dd519f38Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1858dd519f38Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1859dd519f38Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1860dd519f38Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1861dd519f38Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1862dd519f38Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
1863dd519f38Smrgdnl
1864dd519f38Smrgdnl Except as contained in this notice, the name of the copyright holders shall
1865dd519f38Smrgdnl not be used in advertising or otherwise to promote the sale, use or
1866dd519f38Smrgdnl other dealings in this Software without prior written authorization
1867dd519f38Smrgdnl from the copyright holders.
1868dd519f38Smrgdnl
1869dd519f38Smrg
1870dd519f38Smrg# XORG_RELEASE_VERSION
1871dd519f38Smrg# --------------------
1872dd519f38Smrg# Adds --with/without-release-string and changes the PACKAGE and
1873dd519f38Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
1874dd519f38Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
1875dd519f38Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1876dd519f38Smrg 
1877dd519f38SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
1878dd519f38Smrg	AC_ARG_WITH(release-version,
1879dd519f38Smrg			AS_HELP_STRING([--with-release-version=STRING],
1880dd519f38Smrg				[Use release version string in package name]),
1881dd519f38Smrg			[RELEASE_VERSION="$withval"],
1882dd519f38Smrg			[RELEASE_VERSION=""])
1883dd519f38Smrg	if test "x$RELEASE_VERSION" != "x"; then
1884dd519f38Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
1885dd519f38Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
1886dd519f38Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
1887dd519f38Smrg	fi
1888dd519f38Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1889dd519f38Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
1890dd519f38Smrg		[Major version of this package])
1891dd519f38Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
1892dd519f38Smrg	if test "x$PVM" = "x"; then
1893dd519f38Smrg		PVM="0"
1894dd519f38Smrg	fi
1895dd519f38Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
1896dd519f38Smrg		[$PVM],
1897dd519f38Smrg		[Minor version of this package])
1898dd519f38Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
1899dd519f38Smrg	if test "x$PVP" = "x"; then
1900dd519f38Smrg		PVP="0"
1901dd519f38Smrg	fi
1902dd519f38Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1903dd519f38Smrg		[$PVP],
1904dd519f38Smrg		[Patch version of this package])
1905dd519f38Smrg])
1906dd519f38Smrg
1907dd519f38Smrg# XORG_CHANGELOG()
1908dd519f38Smrg# ----------------
1909dd519f38Smrg# Minimum version: 1.2.0
1910dd519f38Smrg#
1911dd519f38Smrg# Defines the variable CHANGELOG_CMD as the command to generate
1912dd519f38Smrg# ChangeLog from git.
1913dd519f38Smrg#
1914dd519f38Smrg# Arrange that distcleancheck ignores ChangeLog left over by distclean.
1915dd519f38Smrg#
1916dd519f38SmrgAC_DEFUN([XORG_CHANGELOG], [
1917dd519f38SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
1918dd519f38Smrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
1919dd519f38Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
1920dd519f38SmrgAC_SUBST([CHANGELOG_CMD])
1921dd519f38SmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
1922dd519f38Smrg]) # XORG_CHANGELOG
1923ed029a5fSmrg
1924ed029a5fSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
1925ed029a5fSmrg# 
1926ed029a5fSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1927ed029a5fSmrg#
1928ed029a5fSmrg# This program is free software; you can redistribute it and/or modify
1929ed029a5fSmrg# it under the terms of the GNU General Public License as published by
1930ed029a5fSmrg# the Free Software Foundation; either version 2 of the License, or
1931ed029a5fSmrg# (at your option) any later version.
1932ed029a5fSmrg#
1933ed029a5fSmrg# This program is distributed in the hope that it will be useful, but
1934ed029a5fSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
1935ed029a5fSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1936ed029a5fSmrg# General Public License for more details.
1937ed029a5fSmrg#
1938ed029a5fSmrg# You should have received a copy of the GNU General Public License
1939ed029a5fSmrg# along with this program; if not, write to the Free Software
1940ed029a5fSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1941ed029a5fSmrg#
1942ed029a5fSmrg# As a special exception to the GNU General Public License, if you
1943ed029a5fSmrg# distribute this file as part of a program that contains a
1944ed029a5fSmrg# configuration script generated by Autoconf, you may include it under
1945ed029a5fSmrg# the same distribution terms that you use for the rest of that program.
1946ed029a5fSmrg
1947ed029a5fSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
1948ed029a5fSmrg# ----------------------------------
1949ed029a5fSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
1950ed029a5fSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1951ed029a5fSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
1952ed029a5fSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
1953ed029a5fSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1954ed029a5fSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1955ed029a5fSmrgfi
1956ed029a5fSmrgif test -n "$PKG_CONFIG"; then
1957ed029a5fSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
1958ed029a5fSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1959ed029a5fSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1960ed029a5fSmrg		AC_MSG_RESULT([yes])
1961ed029a5fSmrg	else
1962ed029a5fSmrg		AC_MSG_RESULT([no])
1963ed029a5fSmrg		PKG_CONFIG=""
1964ed029a5fSmrg	fi
1965ed029a5fSmrg		
1966ed029a5fSmrgfi[]dnl
1967ed029a5fSmrg])# PKG_PROG_PKG_CONFIG
1968ed029a5fSmrg
1969ed029a5fSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1970ed029a5fSmrg#
1971ed029a5fSmrg# Check to see whether a particular set of modules exists.  Similar
1972ed029a5fSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
1973ed029a5fSmrg#
1974ed029a5fSmrg#
1975ed029a5fSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
1976ed029a5fSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
1977ed029a5fSmrg# PKG_CHECK_EXISTS manually
1978ed029a5fSmrg# --------------------------------------------------------------
1979ed029a5fSmrgAC_DEFUN([PKG_CHECK_EXISTS],
1980ed029a5fSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1981ed029a5fSmrgif test -n "$PKG_CONFIG" && \
1982ed029a5fSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1983ed029a5fSmrg  m4_ifval([$2], [$2], [:])
1984ed029a5fSmrgm4_ifvaln([$3], [else
1985ed029a5fSmrg  $3])dnl
1986ed029a5fSmrgfi])
1987ed029a5fSmrg
1988ed029a5fSmrg
1989ed029a5fSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1990ed029a5fSmrg# ---------------------------------------------
1991ed029a5fSmrgm4_define([_PKG_CONFIG],
1992dd519f38Smrg[if test -n "$$1"; then
1993dd519f38Smrg    pkg_cv_[]$1="$$1"
1994dd519f38Smrg elif test -n "$PKG_CONFIG"; then
1995dd519f38Smrg    PKG_CHECK_EXISTS([$3],
1996dd519f38Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
1997dd519f38Smrg		     [pkg_failed=yes])
1998dd519f38Smrg else
1999dd519f38Smrg    pkg_failed=untried
2000ed029a5fSmrgfi[]dnl
2001ed029a5fSmrg])# _PKG_CONFIG
2002ed029a5fSmrg
2003ed029a5fSmrg# _PKG_SHORT_ERRORS_SUPPORTED
2004ed029a5fSmrg# -----------------------------
2005ed029a5fSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
2006ed029a5fSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2007ed029a5fSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
2008ed029a5fSmrg        _pkg_short_errors_supported=yes
2009ed029a5fSmrgelse
2010ed029a5fSmrg        _pkg_short_errors_supported=no
2011ed029a5fSmrgfi[]dnl
2012ed029a5fSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
2013ed029a5fSmrg
2014ed029a5fSmrg
2015ed029a5fSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
2016ed029a5fSmrg# [ACTION-IF-NOT-FOUND])
2017ed029a5fSmrg#
2018ed029a5fSmrg#
2019ed029a5fSmrg# Note that if there is a possibility the first call to
2020ed029a5fSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
2021ed029a5fSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
2022ed029a5fSmrg#
2023ed029a5fSmrg#
2024ed029a5fSmrg# --------------------------------------------------------------
2025ed029a5fSmrgAC_DEFUN([PKG_CHECK_MODULES],
2026ed029a5fSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2027ed029a5fSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
2028ed029a5fSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
2029ed029a5fSmrg
2030ed029a5fSmrgpkg_failed=no
2031ed029a5fSmrgAC_MSG_CHECKING([for $1])
2032ed029a5fSmrg
2033ed029a5fSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
2034ed029a5fSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
2035ed029a5fSmrg
2036ed029a5fSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
2037ed029a5fSmrgand $1[]_LIBS to avoid the need to call pkg-config.
2038ed029a5fSmrgSee the pkg-config man page for more details.])
2039ed029a5fSmrg
2040ed029a5fSmrgif test $pkg_failed = yes; then
2041ed029a5fSmrg        _PKG_SHORT_ERRORS_SUPPORTED
2042ed029a5fSmrg        if test $_pkg_short_errors_supported = yes; then
2043dd519f38Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
2044ed029a5fSmrg        else 
2045dd519f38Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
2046ed029a5fSmrg        fi
2047ed029a5fSmrg	# Put the nasty error message in config.log where it belongs
2048ed029a5fSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
2049ed029a5fSmrg
2050ed029a5fSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
2051ed029a5fSmrg[Package requirements ($2) were not met:
2052ed029a5fSmrg
2053ed029a5fSmrg$$1_PKG_ERRORS
2054ed029a5fSmrg
2055ed029a5fSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
2056ed029a5fSmrginstalled software in a non-standard prefix.
2057ed029a5fSmrg
2058ed029a5fSmrg_PKG_TEXT
2059ed029a5fSmrg])],
2060dd519f38Smrg		[AC_MSG_RESULT([no])
2061dd519f38Smrg                $4])
2062ed029a5fSmrgelif test $pkg_failed = untried; then
2063ed029a5fSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
2064ed029a5fSmrg[The pkg-config script could not be found or is too old.  Make sure it
2065ed029a5fSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
2066ed029a5fSmrgpath to pkg-config.
2067ed029a5fSmrg
2068ed029a5fSmrg_PKG_TEXT
2069ed029a5fSmrg
2070dd519f38SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
2071ed029a5fSmrg		[$4])
2072ed029a5fSmrgelse
2073ed029a5fSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
2074ed029a5fSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
2075ed029a5fSmrg        AC_MSG_RESULT([yes])
2076ed029a5fSmrg	ifelse([$3], , :, [$3])
2077ed029a5fSmrgfi[]dnl
2078ed029a5fSmrg])# PKG_CHECK_MODULES
2079ed029a5fSmrg
2080