aclocal.m4 revision bc5f02f5
1bc5f02f5Smrg# generated automatically by aclocal 1.11 -*- Autoconf -*-
2439fab64Smrg
3bc5f02f5Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4bc5f02f5Smrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5439fab64Smrg# This file is free software; the Free Software Foundation
6439fab64Smrg# gives unlimited permission to copy and/or distribute it,
7439fab64Smrg# with or without modifications, as long as this notice is preserved.
8439fab64Smrg
9439fab64Smrg# This program is distributed in the hope that it will be useful,
10439fab64Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11439fab64Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12439fab64Smrg# PARTICULAR PURPOSE.
13439fab64Smrg
14bc5f02f5Smrgm4_ifndef([AC_AUTOCONF_VERSION],
15bc5f02f5Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16bc5f02f5Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
17bc5f02f5Smrg[m4_warning([this file was generated for autoconf 2.63.
18bc5f02f5SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19bc5f02f5SmrgIf you have problems, you may need to regenerate the build system entirely.
20bc5f02f5SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21439fab64Smrg
22bc5f02f5Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
23bc5f02f5Smrg#
24bc5f02f5Smrg# This file is free software; the Free Software Foundation
25bc5f02f5Smrg# gives unlimited permission to copy and/or distribute it,
26bc5f02f5Smrg# with or without modifications, as long as this notice is preserved.
27439fab64Smrg
28bc5f02f5Smrg# AM_AUTOMAKE_VERSION(VERSION)
29bc5f02f5Smrg# ----------------------------
30bc5f02f5Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
31bc5f02f5Smrg# generated from the m4 files accompanying Automake X.Y.
32bc5f02f5Smrg# (This private macro should not be called outside this file.)
33bc5f02f5SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
34bc5f02f5Smrg[am__api_version='1.11'
35bc5f02f5Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
36bc5f02f5Smrgdnl require some minimum version.  Point them to the right macro.
37bc5f02f5Smrgm4_if([$1], [1.11], [],
38bc5f02f5Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
39bc5f02f5Smrg])
40bc5f02f5Smrg
41bc5f02f5Smrg# _AM_AUTOCONF_VERSION(VERSION)
42bc5f02f5Smrg# -----------------------------
43bc5f02f5Smrg# aclocal traces this macro to find the Autoconf version.
44bc5f02f5Smrg# This is a private macro too.  Using m4_define simplifies
45bc5f02f5Smrg# the logic in aclocal, which can simply ignore this definition.
46bc5f02f5Smrgm4_define([_AM_AUTOCONF_VERSION], [])
47439fab64Smrg
48bc5f02f5Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
49bc5f02f5Smrg# -------------------------------
50bc5f02f5Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
51bc5f02f5Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
52bc5f02f5SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
53bc5f02f5Smrg[AM_AUTOMAKE_VERSION([1.11])dnl
54bc5f02f5Smrgm4_ifndef([AC_AUTOCONF_VERSION],
55bc5f02f5Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
56bc5f02f5Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
57439fab64Smrg
58bc5f02f5Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
59bc5f02f5Smrg
60bc5f02f5Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
61bc5f02f5Smrg#
62bc5f02f5Smrg# This file is free software; the Free Software Foundation
63bc5f02f5Smrg# gives unlimited permission to copy and/or distribute it,
64bc5f02f5Smrg# with or without modifications, as long as this notice is preserved.
65bc5f02f5Smrg
66bc5f02f5Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
67bc5f02f5Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
68bc5f02f5Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
69bc5f02f5Smrg#
70bc5f02f5Smrg# Of course, Automake must honor this variable whenever it calls a
71bc5f02f5Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
72bc5f02f5Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
73bc5f02f5Smrg# depending on how configure is run.  This is pretty annoying, since
74bc5f02f5Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
75bc5f02f5Smrg# source directory, any form will work fine, but in subdirectories a
76bc5f02f5Smrg# relative path needs to be adjusted first.
77bc5f02f5Smrg#
78bc5f02f5Smrg# $ac_aux_dir/missing
79bc5f02f5Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
80bc5f02f5Smrg# $top_srcdir/$ac_aux_dir/missing
81bc5f02f5Smrg#    fails if $ac_aux_dir is absolute,
82bc5f02f5Smrg#    fails when called from a subdirectory in a VPATH build with
83bc5f02f5Smrg#          a relative $ac_aux_dir
84bc5f02f5Smrg#
85bc5f02f5Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
86bc5f02f5Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
87bc5f02f5Smrg# harmless because $srcdir is `.', but things will broke when you
88bc5f02f5Smrg# start a VPATH build or use an absolute $srcdir.
89bc5f02f5Smrg#
90bc5f02f5Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
91bc5f02f5Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
92bc5f02f5Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
93bc5f02f5Smrg# and then we would define $MISSING as
94bc5f02f5Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
95bc5f02f5Smrg# This will work as long as MISSING is not called from configure, because
96bc5f02f5Smrg# unfortunately $(top_srcdir) has no meaning in configure.
97bc5f02f5Smrg# However there are other variables, like CC, which are often used in
98bc5f02f5Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
99bc5f02f5Smrg#
100bc5f02f5Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
101bc5f02f5Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
102bc5f02f5Smrg# configured tree to be moved without reconfiguration.
103bc5f02f5Smrg
104bc5f02f5SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
105bc5f02f5Smrg[dnl Rely on autoconf to set up CDPATH properly.
106bc5f02f5SmrgAC_PREREQ([2.50])dnl
107bc5f02f5Smrg# expand $ac_aux_dir to an absolute path
108bc5f02f5Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
109bc5f02f5Smrg])
110439fab64Smrg
111bc5f02f5Smrg# Do all the work for Automake.                             -*- Autoconf -*-
112439fab64Smrg
113bc5f02f5Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
114bc5f02f5Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
115bc5f02f5Smrg#
116bc5f02f5Smrg# This file is free software; the Free Software Foundation
117bc5f02f5Smrg# gives unlimited permission to copy and/or distribute it,
118bc5f02f5Smrg# with or without modifications, as long as this notice is preserved.
119439fab64Smrg
120bc5f02f5Smrg# serial 16
121439fab64Smrg
122bc5f02f5Smrg# This macro actually does too much.  Some checks are only needed if
123bc5f02f5Smrg# your package does certain things.  But this isn't really a big deal.
124439fab64Smrg
125439fab64Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
126439fab64Smrg# AM_INIT_AUTOMAKE([OPTIONS])
127439fab64Smrg# -----------------------------------------------
128439fab64Smrg# The call with PACKAGE and VERSION arguments is the old style
129439fab64Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
130439fab64Smrg# and VERSION should now be passed to AC_INIT and removed from
131439fab64Smrg# the call to AM_INIT_AUTOMAKE.
132439fab64Smrg# We support both call styles for the transition.  After
133439fab64Smrg# the next Automake release, Autoconf can make the AC_INIT
134439fab64Smrg# arguments mandatory, and then we can depend on a new Autoconf
135439fab64Smrg# release and drop the old call support.
136439fab64SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
137bc5f02f5Smrg[AC_PREREQ([2.62])dnl
138bc5f02f5Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
139bc5f02f5Smrgdnl the ones we care about.
140bc5f02f5Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
141bc5f02f5SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
142bc5f02f5SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
143bc5f02f5Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
144bc5f02f5Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
145bc5f02f5Smrg  # is not polluted with repeated "-I."
146bc5f02f5Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
147bc5f02f5Smrg  # test to see if srcdir already configured
148bc5f02f5Smrg  if test -f $srcdir/config.status; then
149bc5f02f5Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
150bc5f02f5Smrg  fi
151439fab64Smrgfi
152439fab64Smrg
153439fab64Smrg# test whether we have cygpath
154439fab64Smrgif test -z "$CYGPATH_W"; then
155439fab64Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
156439fab64Smrg    CYGPATH_W='cygpath -w'
157439fab64Smrg  else
158439fab64Smrg    CYGPATH_W=echo
159439fab64Smrg  fi
160439fab64Smrgfi
161439fab64SmrgAC_SUBST([CYGPATH_W])
162439fab64Smrg
163439fab64Smrg# Define the identity of the package.
164439fab64Smrgdnl Distinguish between old-style and new-style calls.
165439fab64Smrgm4_ifval([$2],
166439fab64Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
167439fab64Smrg AC_SUBST([PACKAGE], [$1])dnl
168439fab64Smrg AC_SUBST([VERSION], [$2])],
169439fab64Smrg[_AM_SET_OPTIONS([$1])dnl
170bc5f02f5Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
171bc5f02f5Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
172bc5f02f5Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
173439fab64Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
174439fab64Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
175439fab64Smrg
176439fab64Smrg_AM_IF_OPTION([no-define],,
177439fab64Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
178439fab64Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
179439fab64Smrg
180439fab64Smrg# Some tools Automake needs.
181439fab64SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
182439fab64SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
183439fab64SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
184439fab64SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
185439fab64SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
186439fab64SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
187439fab64SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
188bc5f02f5SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
189bc5f02f5SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
190bc5f02f5SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
191439fab64Smrg# We need awk for the "check" target.  The system "awk" is bad on
192439fab64Smrg# some platforms.
193439fab64SmrgAC_REQUIRE([AC_PROG_AWK])dnl
194439fab64SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
195439fab64SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
196bc5f02f5Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
197bc5f02f5Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
198bc5f02f5Smrg			     [_AM_PROG_TAR([v7])])])
199439fab64Smrg_AM_IF_OPTION([no-dependencies],,
200439fab64Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
201bc5f02f5Smrg		  [_AM_DEPENDENCIES(CC)],
202bc5f02f5Smrg		  [define([AC_PROG_CC],
203bc5f02f5Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
204439fab64SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
205bc5f02f5Smrg		  [_AM_DEPENDENCIES(CXX)],
206bc5f02f5Smrg		  [define([AC_PROG_CXX],
207bc5f02f5Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
208bc5f02f5SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
209bc5f02f5Smrg		  [_AM_DEPENDENCIES(OBJC)],
210bc5f02f5Smrg		  [define([AC_PROG_OBJC],
211bc5f02f5Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
212439fab64Smrg])
213bc5f02f5Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
214bc5f02f5Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
215bc5f02f5Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
216bc5f02f5Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
217bc5f02f5SmrgAC_CONFIG_COMMANDS_PRE(dnl
218bc5f02f5Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
219bc5f02f5Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
220439fab64Smrg])
221439fab64Smrg
222bc5f02f5Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
223bc5f02f5Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
224bc5f02f5Smrgdnl mangled by Autoconf and run in a shell conditional statement.
225bc5f02f5Smrgm4_define([_AC_COMPILER_EXEEXT],
226bc5f02f5Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
227bc5f02f5Smrg
228439fab64Smrg
229439fab64Smrg# When config.status generates a header, we must update the stamp-h file.
230439fab64Smrg# This file resides in the same directory as the config header
231439fab64Smrg# that is generated.  The stamp files are numbered to have different names.
232439fab64Smrg
233439fab64Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
234439fab64Smrg# loop where config.status creates the headers, so we can generate
235439fab64Smrg# our stamp files there.
236439fab64SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
237439fab64Smrg[# Compute $1's index in $config_headers.
238bc5f02f5Smrg_am_arg=$1
239439fab64Smrg_am_stamp_count=1
240439fab64Smrgfor _am_header in $config_headers :; do
241439fab64Smrg  case $_am_header in
242bc5f02f5Smrg    $_am_arg | $_am_arg:* )
243439fab64Smrg      break ;;
244439fab64Smrg    * )
245439fab64Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
246439fab64Smrg  esac
247439fab64Smrgdone
248bc5f02f5Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
249439fab64Smrg
250bc5f02f5Smrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
251bc5f02f5Smrg#
252bc5f02f5Smrg# This file is free software; the Free Software Foundation
253bc5f02f5Smrg# gives unlimited permission to copy and/or distribute it,
254bc5f02f5Smrg# with or without modifications, as long as this notice is preserved.
255439fab64Smrg
256bc5f02f5Smrg# AM_PROG_INSTALL_SH
257bc5f02f5Smrg# ------------------
258bc5f02f5Smrg# Define $install_sh.
259bc5f02f5SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
260bc5f02f5Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
261bc5f02f5Smrgif test x"${install_sh}" != xset; then
262bc5f02f5Smrg  case $am_aux_dir in
263bc5f02f5Smrg  *\ * | *\	*)
264bc5f02f5Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
265bc5f02f5Smrg  *)
266bc5f02f5Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
267bc5f02f5Smrg  esac
268bc5f02f5Smrgfi
269bc5f02f5SmrgAC_SUBST(install_sh)])
270439fab64Smrg
271bc5f02f5Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
272bc5f02f5Smrg#
273bc5f02f5Smrg# This file is free software; the Free Software Foundation
274bc5f02f5Smrg# gives unlimited permission to copy and/or distribute it,
275bc5f02f5Smrg# with or without modifications, as long as this notice is preserved.
276439fab64Smrg
277bc5f02f5Smrg# serial 2
278439fab64Smrg
279bc5f02f5Smrg# Check whether the underlying file-system supports filenames
280bc5f02f5Smrg# with a leading dot.  For instance MS-DOS doesn't.
281bc5f02f5SmrgAC_DEFUN([AM_SET_LEADING_DOT],
282bc5f02f5Smrg[rm -rf .tst 2>/dev/null
283bc5f02f5Smrgmkdir .tst 2>/dev/null
284bc5f02f5Smrgif test -d .tst; then
285bc5f02f5Smrg  am__leading_dot=.
286bc5f02f5Smrgelse
287bc5f02f5Smrg  am__leading_dot=_
288bc5f02f5Smrgfi
289bc5f02f5Smrgrmdir .tst 2>/dev/null
290bc5f02f5SmrgAC_SUBST([am__leading_dot])])
291439fab64Smrg
292bc5f02f5Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
293439fab64Smrg
294bc5f02f5Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
295bc5f02f5Smrg# Free Software Foundation, Inc.
296bc5f02f5Smrg#
297bc5f02f5Smrg# This file is free software; the Free Software Foundation
298bc5f02f5Smrg# gives unlimited permission to copy and/or distribute it,
299bc5f02f5Smrg# with or without modifications, as long as this notice is preserved.
300439fab64Smrg
301bc5f02f5Smrg# serial 6
302439fab64Smrg
303bc5f02f5Smrg# AM_MISSING_PROG(NAME, PROGRAM)
304bc5f02f5Smrg# ------------------------------
305bc5f02f5SmrgAC_DEFUN([AM_MISSING_PROG],
306bc5f02f5Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
307bc5f02f5Smrg$1=${$1-"${am_missing_run}$2"}
308bc5f02f5SmrgAC_SUBST($1)])
309439fab64Smrg
310439fab64Smrg
311bc5f02f5Smrg# AM_MISSING_HAS_RUN
312bc5f02f5Smrg# ------------------
313bc5f02f5Smrg# Define MISSING if not defined so far and test if it supports --run.
314bc5f02f5Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
315bc5f02f5SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
316bc5f02f5Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
317bc5f02f5SmrgAC_REQUIRE_AUX_FILE([missing])dnl
318bc5f02f5Smrgif test x"${MISSING+set}" != xset; then
319bc5f02f5Smrg  case $am_aux_dir in
320bc5f02f5Smrg  *\ * | *\	*)
321bc5f02f5Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
322bc5f02f5Smrg  *)
323bc5f02f5Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
324bc5f02f5Smrg  esac
325bc5f02f5Smrgfi
326bc5f02f5Smrg# Use eval to expand $SHELL
327bc5f02f5Smrgif eval "$MISSING --run true"; then
328bc5f02f5Smrg  am_missing_run="$MISSING --run "
329bc5f02f5Smrgelse
330bc5f02f5Smrg  am_missing_run=
331bc5f02f5Smrg  AC_MSG_WARN([`missing' script is too old or missing])
332bc5f02f5Smrgfi
333bc5f02f5Smrg])
334439fab64Smrg
335bc5f02f5Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
336bc5f02f5Smrg#
337bc5f02f5Smrg# This file is free software; the Free Software Foundation
338bc5f02f5Smrg# gives unlimited permission to copy and/or distribute it,
339bc5f02f5Smrg# with or without modifications, as long as this notice is preserved.
340bc5f02f5Smrg
341bc5f02f5Smrg# AM_PROG_MKDIR_P
342bc5f02f5Smrg# ---------------
343bc5f02f5Smrg# Check for `mkdir -p'.
344bc5f02f5SmrgAC_DEFUN([AM_PROG_MKDIR_P],
345bc5f02f5Smrg[AC_PREREQ([2.60])dnl
346bc5f02f5SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
347bc5f02f5Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
348bc5f02f5Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
349bc5f02f5Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
350bc5f02f5Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
351bc5f02f5Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
352bc5f02f5Smrgdnl adjustment using top_builddir (which is defined more often than
353bc5f02f5Smrgdnl MKDIR_P).
354bc5f02f5SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
355bc5f02f5Smrgcase $mkdir_p in
356bc5f02f5Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
357bc5f02f5Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
358bc5f02f5Smrgesac
359bc5f02f5Smrg])
360bc5f02f5Smrg
361bc5f02f5Smrg# Helper functions for option handling.                     -*- Autoconf -*-
362bc5f02f5Smrg
363bc5f02f5Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
364bc5f02f5Smrg#
365bc5f02f5Smrg# This file is free software; the Free Software Foundation
366bc5f02f5Smrg# gives unlimited permission to copy and/or distribute it,
367bc5f02f5Smrg# with or without modifications, as long as this notice is preserved.
368bc5f02f5Smrg
369bc5f02f5Smrg# serial 4
370439fab64Smrg
371439fab64Smrg# _AM_MANGLE_OPTION(NAME)
372439fab64Smrg# -----------------------
373439fab64SmrgAC_DEFUN([_AM_MANGLE_OPTION],
374439fab64Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
375439fab64Smrg
376439fab64Smrg# _AM_SET_OPTION(NAME)
377439fab64Smrg# ------------------------------
378439fab64Smrg# Set option NAME.  Presently that only means defining a flag for this option.
379439fab64SmrgAC_DEFUN([_AM_SET_OPTION],
380439fab64Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
381439fab64Smrg
382439fab64Smrg# _AM_SET_OPTIONS(OPTIONS)
383439fab64Smrg# ----------------------------------
384439fab64Smrg# OPTIONS is a space-separated list of Automake options.
385439fab64SmrgAC_DEFUN([_AM_SET_OPTIONS],
386bc5f02f5Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
387439fab64Smrg
388439fab64Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
389439fab64Smrg# -------------------------------------------
390439fab64Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
391439fab64SmrgAC_DEFUN([_AM_IF_OPTION],
392439fab64Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
393439fab64Smrg
394bc5f02f5Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
395439fab64Smrg
396bc5f02f5Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
397bc5f02f5Smrg# Free Software Foundation, Inc.
398bc5f02f5Smrg#
399bc5f02f5Smrg# This file is free software; the Free Software Foundation
400bc5f02f5Smrg# gives unlimited permission to copy and/or distribute it,
401bc5f02f5Smrg# with or without modifications, as long as this notice is preserved.
402439fab64Smrg
403bc5f02f5Smrg# serial 5
404439fab64Smrg
405439fab64Smrg# AM_SANITY_CHECK
406439fab64Smrg# ---------------
407439fab64SmrgAC_DEFUN([AM_SANITY_CHECK],
408439fab64Smrg[AC_MSG_CHECKING([whether build environment is sane])
409439fab64Smrg# Just in case
410439fab64Smrgsleep 1
411439fab64Smrgecho timestamp > conftest.file
412bc5f02f5Smrg# Reject unsafe characters in $srcdir or the absolute working directory
413bc5f02f5Smrg# name.  Accept space and tab only in the latter.
414bc5f02f5Smrgam_lf='
415bc5f02f5Smrg'
416bc5f02f5Smrgcase `pwd` in
417bc5f02f5Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
418bc5f02f5Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
419bc5f02f5Smrgesac
420bc5f02f5Smrgcase $srcdir in
421bc5f02f5Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
422bc5f02f5Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
423bc5f02f5Smrgesac
424bc5f02f5Smrg
425439fab64Smrg# Do `set' in a subshell so we don't clobber the current shell's
426439fab64Smrg# arguments.  Must try -L first in case configure is actually a
427439fab64Smrg# symlink; some systems play weird games with the mod time of symlinks
428439fab64Smrg# (eg FreeBSD returns the mod time of the symlink's containing
429439fab64Smrg# directory).
430439fab64Smrgif (
431bc5f02f5Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
432439fab64Smrg   if test "$[*]" = "X"; then
433439fab64Smrg      # -L didn't work.
434bc5f02f5Smrg      set X `ls -t "$srcdir/configure" conftest.file`
435439fab64Smrg   fi
436439fab64Smrg   rm -f conftest.file
437439fab64Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
438439fab64Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
439439fab64Smrg
440439fab64Smrg      # If neither matched, then we have a broken ls.  This can happen
441439fab64Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
442439fab64Smrg      # broken ls alias from the environment.  This has actually
443439fab64Smrg      # happened.  Such a system could not be considered "sane".
444439fab64Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
445439fab64Smrgalias in your environment])
446439fab64Smrg   fi
447439fab64Smrg
448439fab64Smrg   test "$[2]" = conftest.file
449439fab64Smrg   )
450439fab64Smrgthen
451439fab64Smrg   # Ok.
452439fab64Smrg   :
453439fab64Smrgelse
454439fab64Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
455439fab64SmrgCheck your system clock])
456439fab64Smrgfi
457439fab64SmrgAC_MSG_RESULT(yes)])
458439fab64Smrg
459bc5f02f5Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
460439fab64Smrg#
461bc5f02f5Smrg# This file is free software; the Free Software Foundation
462bc5f02f5Smrg# gives unlimited permission to copy and/or distribute it,
463bc5f02f5Smrg# with or without modifications, as long as this notice is preserved.
464439fab64Smrg
465439fab64Smrg# AM_PROG_INSTALL_STRIP
466bc5f02f5Smrg# ---------------------
467439fab64Smrg# One issue with vendor `install' (even GNU) is that you can't
468439fab64Smrg# specify the program used to strip binaries.  This is especially
469439fab64Smrg# annoying in cross-compiling environments, where the build's strip
470439fab64Smrg# is unlikely to handle the host's binaries.
471439fab64Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
472439fab64Smrg# always use install-sh in `make install-strip', and initialize
473439fab64Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
474439fab64SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
475439fab64Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
476439fab64Smrg# Installed binaries are usually stripped using `strip' when the user
477439fab64Smrg# run `make install-strip'.  However `strip' might not be the right
478439fab64Smrg# tool to use in cross-compilation environments, therefore Automake
479439fab64Smrg# will honor the `STRIP' environment variable to overrule this program.
480439fab64Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
481439fab64Smrgif test "$cross_compiling" != no; then
482439fab64Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
483439fab64Smrgfi
484bc5f02f5SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
485439fab64SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
486439fab64Smrg
487bc5f02f5Smrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
488bc5f02f5Smrg#
489bc5f02f5Smrg# This file is free software; the Free Software Foundation
490bc5f02f5Smrg# gives unlimited permission to copy and/or distribute it,
491bc5f02f5Smrg# with or without modifications, as long as this notice is preserved.
492439fab64Smrg
493bc5f02f5Smrg# serial 2
494439fab64Smrg
495bc5f02f5Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
496bc5f02f5Smrg# ---------------------------
497bc5f02f5Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
498bc5f02f5Smrg# This macro is traced by Automake.
499bc5f02f5SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
500439fab64Smrg
501bc5f02f5Smrg# AM_SUBST_NOTMAKE(VARIABLE)
502bc5f02f5Smrg# ---------------------------
503bc5f02f5Smrg# Public sister of _AM_SUBST_NOTMAKE.
504bc5f02f5SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
505439fab64Smrg
506bc5f02f5Smrg# Check how to create a tarball.                            -*- Autoconf -*-
507439fab64Smrg
508bc5f02f5Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
509bc5f02f5Smrg#
510bc5f02f5Smrg# This file is free software; the Free Software Foundation
511bc5f02f5Smrg# gives unlimited permission to copy and/or distribute it,
512bc5f02f5Smrg# with or without modifications, as long as this notice is preserved.
513bc5f02f5Smrg
514bc5f02f5Smrg# serial 2
515bc5f02f5Smrg
516bc5f02f5Smrg# _AM_PROG_TAR(FORMAT)
517bc5f02f5Smrg# --------------------
518bc5f02f5Smrg# Check how to create a tarball in format FORMAT.
519bc5f02f5Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
520bc5f02f5Smrg#
521bc5f02f5Smrg# Substitute a variable $(am__tar) that is a command
522bc5f02f5Smrg# writing to stdout a FORMAT-tarball containing the directory
523bc5f02f5Smrg# $tardir.
524bc5f02f5Smrg#     tardir=directory && $(am__tar) > result.tar
525bc5f02f5Smrg#
526bc5f02f5Smrg# Substitute a variable $(am__untar) that extract such
527bc5f02f5Smrg# a tarball read from stdin.
528bc5f02f5Smrg#     $(am__untar) < result.tar
529bc5f02f5SmrgAC_DEFUN([_AM_PROG_TAR],
530bc5f02f5Smrg[# Always define AMTAR for backward compatibility.
531bc5f02f5SmrgAM_MISSING_PROG([AMTAR], [tar])
532bc5f02f5Smrgm4_if([$1], [v7],
533bc5f02f5Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
534bc5f02f5Smrg     [m4_case([$1], [ustar],, [pax],,
535bc5f02f5Smrg              [m4_fatal([Unknown tar format])])
536bc5f02f5SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
537bc5f02f5Smrg# Loop over all known methods to create a tar archive until one works.
538bc5f02f5Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
539bc5f02f5Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
540bc5f02f5Smrg# Do not fold the above two line into one, because Tru64 sh and
541bc5f02f5Smrg# Solaris sh will not grok spaces in the rhs of `-'.
542bc5f02f5Smrgfor _am_tool in $_am_tools
543bc5f02f5Smrgdo
544bc5f02f5Smrg  case $_am_tool in
545bc5f02f5Smrg  gnutar)
546bc5f02f5Smrg    for _am_tar in tar gnutar gtar;
547bc5f02f5Smrg    do
548bc5f02f5Smrg      AM_RUN_LOG([$_am_tar --version]) && break
549bc5f02f5Smrg    done
550bc5f02f5Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
551bc5f02f5Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
552bc5f02f5Smrg    am__untar="$_am_tar -xf -"
553bc5f02f5Smrg    ;;
554bc5f02f5Smrg  plaintar)
555bc5f02f5Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
556bc5f02f5Smrg    # ustar tarball either.
557bc5f02f5Smrg    (tar --version) >/dev/null 2>&1 && continue
558bc5f02f5Smrg    am__tar='tar chf - "$$tardir"'
559bc5f02f5Smrg    am__tar_='tar chf - "$tardir"'
560bc5f02f5Smrg    am__untar='tar xf -'
561bc5f02f5Smrg    ;;
562bc5f02f5Smrg  pax)
563bc5f02f5Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
564bc5f02f5Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
565bc5f02f5Smrg    am__untar='pax -r'
566bc5f02f5Smrg    ;;
567bc5f02f5Smrg  cpio)
568bc5f02f5Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
569bc5f02f5Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
570bc5f02f5Smrg    am__untar='cpio -i -H $1 -d'
571bc5f02f5Smrg    ;;
572bc5f02f5Smrg  none)
573bc5f02f5Smrg    am__tar=false
574bc5f02f5Smrg    am__tar_=false
575bc5f02f5Smrg    am__untar=false
576bc5f02f5Smrg    ;;
577bc5f02f5Smrg  esac
578bc5f02f5Smrg
579bc5f02f5Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
580bc5f02f5Smrg  # and am__untar set.
581bc5f02f5Smrg  test -n "${am_cv_prog_tar_$1}" && break
582bc5f02f5Smrg
583bc5f02f5Smrg  # tar/untar a dummy directory, and stop if the command works
584bc5f02f5Smrg  rm -rf conftest.dir
585bc5f02f5Smrg  mkdir conftest.dir
586bc5f02f5Smrg  echo GrepMe > conftest.dir/file
587bc5f02f5Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
588bc5f02f5Smrg  rm -rf conftest.dir
589bc5f02f5Smrg  if test -s conftest.tar; then
590bc5f02f5Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
591bc5f02f5Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
592bc5f02f5Smrg  fi
593bc5f02f5Smrgdone
594bc5f02f5Smrgrm -rf conftest.dir
595bc5f02f5Smrg
596bc5f02f5SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
597bc5f02f5SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
598bc5f02f5SmrgAC_SUBST([am__tar])
599bc5f02f5SmrgAC_SUBST([am__untar])
600bc5f02f5Smrg]) # _AM_PROG_TAR
601bc5f02f5Smrg
602bc5f02f5Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
603bc5f02f5Smrgdnl
604bc5f02f5Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
605bc5f02f5Smrgdnl 
606bc5f02f5Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
607bc5f02f5Smrgdnl copy of this software and associated documentation files (the
608bc5f02f5Smrgdnl "Software"), to deal in the Software without restriction, including
609bc5f02f5Smrgdnl without limitation the rights to use, copy, modify, merge, publish,
610bc5f02f5Smrgdnl distribute, and/or sell copies of the Software, and to permit persons
611bc5f02f5Smrgdnl to whom the Software is furnished to do so, provided that the above
612bc5f02f5Smrgdnl copyright notice(s) and this permission notice appear in all copies of
613bc5f02f5Smrgdnl the Software and that both the above copyright notice(s) and this
614bc5f02f5Smrgdnl permission notice appear in supporting documentation.
615bc5f02f5Smrgdnl
616bc5f02f5Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
617bc5f02f5Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
618bc5f02f5Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
619bc5f02f5Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
620bc5f02f5Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
621bc5f02f5Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
622bc5f02f5Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
623bc5f02f5Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
624bc5f02f5Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
625bc5f02f5Smrgdnl
626bc5f02f5Smrgdnl Except as contained in this notice, the name of a copyright holder
627bc5f02f5Smrgdnl shall not be used in advertising or otherwise to promote the sale, use
628bc5f02f5Smrgdnl or other dealings in this Software without prior written authorization
629bc5f02f5Smrgdnl of the copyright holder.
630bc5f02f5Smrg
631bc5f02f5Smrg# XORG_MACROS_VERSION(required-version)
632bc5f02f5Smrg# -------------------------------------
633bc5f02f5Smrg# Minimum version: 1.1.0
634bc5f02f5Smrg#
635bc5f02f5Smrg# If you're using a macro added in Version 1.1 or newer, include this in
636bc5f02f5Smrg# your configure.ac with the minimum required version, such as:
637bc5f02f5Smrg# XORG_MACROS_VERSION(1.1)
638bc5f02f5Smrg#
639bc5f02f5Smrg# To ensure that this macro is defined, also add:
640bc5f02f5Smrg# m4_ifndef([XORG_MACROS_VERSION],
641bc5f02f5Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
642bc5f02f5Smrg#
643bc5f02f5Smrg#
644bc5f02f5Smrg# See the "minimum version" comment for each macro you use to see what 
645bc5f02f5Smrg# version you require.
646bc5f02f5Smrgm4_defun([XORG_MACROS_VERSION],[
647bc5f02f5Smrgm4_define([vers_have], [1.2.2])
648bc5f02f5Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
649bc5f02f5Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
650bc5f02f5Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
651bc5f02f5Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
652bc5f02f5Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
653bc5f02f5Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
654bc5f02f5Smrgm4_undefine([vers_have])
655bc5f02f5Smrgm4_undefine([maj_have])
656bc5f02f5Smrgm4_undefine([maj_needed])
657bc5f02f5Smrg]) # XORG_MACROS_VERSION
658bc5f02f5Smrg
659bc5f02f5Smrg# XORG_PROG_RAWCPP()
660bc5f02f5Smrg# ------------------
661bc5f02f5Smrg# Minimum version: 1.0.0
662bc5f02f5Smrg#
663bc5f02f5Smrg# Find cpp program and necessary flags for use in pre-processing text files
664bc5f02f5Smrg# such as man pages and config files
665bc5f02f5SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
666bc5f02f5SmrgAC_REQUIRE([AC_PROG_CPP])
667bc5f02f5SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
668bc5f02f5Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
669bc5f02f5Smrg
670bc5f02f5Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
671bc5f02f5Smrg# which is not the best choice for supporting other OS'es, but covers most
672bc5f02f5Smrg# of the ones we need for now.
673bc5f02f5SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
674bc5f02f5SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
675bc5f02f5Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
676bc5f02f5Smrg	AC_MSG_RESULT([no])
677439fab64Smrgelse
678bc5f02f5Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
679bc5f02f5Smrg		RAWCPPFLAGS=-undef
680bc5f02f5Smrg		AC_MSG_RESULT([yes])
681bc5f02f5Smrg	# under Cygwin unix is still defined even with -undef
682bc5f02f5Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
683bc5f02f5Smrg		RAWCPPFLAGS="-undef -ansi"
684bc5f02f5Smrg		AC_MSG_RESULT([yes, with -ansi])
685bc5f02f5Smrg	else
686bc5f02f5Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
687bc5f02f5Smrg	fi
688439fab64Smrgfi
689bc5f02f5Smrgrm -f conftest.$ac_ext
690439fab64Smrg
691bc5f02f5SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
692bc5f02f5SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
693bc5f02f5Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
694bc5f02f5Smrg	AC_MSG_RESULT([no])
695bc5f02f5Smrgelse
696bc5f02f5Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
697bc5f02f5Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
698bc5f02f5Smrg		AC_MSG_RESULT([yes])
699bc5f02f5Smrg	else
700bc5f02f5Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
701bc5f02f5Smrg	fi
702bc5f02f5Smrgfi
703bc5f02f5Smrgrm -f conftest.$ac_ext
704bc5f02f5SmrgAC_SUBST(RAWCPPFLAGS)
705bc5f02f5Smrg]) # XORG_PROG_RAWCPP
706439fab64Smrg
707bc5f02f5Smrg# XORG_MANPAGE_SECTIONS()
708bc5f02f5Smrg# -----------------------
709bc5f02f5Smrg# Minimum version: 1.0.0
710bc5f02f5Smrg#
711bc5f02f5Smrg# Determine which sections man pages go in for the different man page types
712bc5f02f5Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
713bc5f02f5Smrg# Not sure if there's any better way than just hardcoding by OS name.
714bc5f02f5Smrg# Override default settings by setting environment variables
715439fab64Smrg
716bc5f02f5SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
717bc5f02f5SmrgAC_REQUIRE([AC_CANONICAL_HOST])
718439fab64Smrg
719bc5f02f5Smrgif test x$APP_MAN_SUFFIX = x    ; then
720bc5f02f5Smrg    APP_MAN_SUFFIX=1
721bc5f02f5Smrgfi
722bc5f02f5Smrgif test x$APP_MAN_DIR = x    ; then
723bc5f02f5Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
724bc5f02f5Smrgfi
725439fab64Smrg
726bc5f02f5Smrgif test x$LIB_MAN_SUFFIX = x    ; then
727bc5f02f5Smrg    LIB_MAN_SUFFIX=3
728bc5f02f5Smrgfi
729bc5f02f5Smrgif test x$LIB_MAN_DIR = x    ; then
730bc5f02f5Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
731bc5f02f5Smrgfi
732439fab64Smrg
733bc5f02f5Smrgif test x$FILE_MAN_SUFFIX = x    ; then
734bc5f02f5Smrg    case $host_os in
735bc5f02f5Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
736bc5f02f5Smrg	*)		FILE_MAN_SUFFIX=5  ;;
737bc5f02f5Smrg    esac
738bc5f02f5Smrgfi
739bc5f02f5Smrgif test x$FILE_MAN_DIR = x    ; then
740bc5f02f5Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
741bc5f02f5Smrgfi
742439fab64Smrg
743bc5f02f5Smrgif test x$MISC_MAN_SUFFIX = x    ; then
744bc5f02f5Smrg    case $host_os in
745bc5f02f5Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
746bc5f02f5Smrg	*)		MISC_MAN_SUFFIX=7  ;;
747bc5f02f5Smrg    esac
748bc5f02f5Smrgfi
749bc5f02f5Smrgif test x$MISC_MAN_DIR = x    ; then
750bc5f02f5Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
751bc5f02f5Smrgfi
752439fab64Smrg
753bc5f02f5Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
754bc5f02f5Smrg    case $host_os in
755bc5f02f5Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
756bc5f02f5Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
757bc5f02f5Smrg    esac
758bc5f02f5Smrgfi
759bc5f02f5Smrgif test x$DRIVER_MAN_DIR = x    ; then
760bc5f02f5Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
761bc5f02f5Smrgfi
762439fab64Smrg
763bc5f02f5Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
764bc5f02f5Smrg    case $host_os in
765bc5f02f5Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
766bc5f02f5Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
767439fab64Smrg    esac
768bc5f02f5Smrgfi
769bc5f02f5Smrgif test x$ADMIN_MAN_DIR = x    ; then
770bc5f02f5Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
771bc5f02f5Smrgfi
772439fab64Smrg
773bc5f02f5Smrg
774bc5f02f5SmrgAC_SUBST([APP_MAN_SUFFIX])
775bc5f02f5SmrgAC_SUBST([LIB_MAN_SUFFIX])
776bc5f02f5SmrgAC_SUBST([FILE_MAN_SUFFIX])
777bc5f02f5SmrgAC_SUBST([MISC_MAN_SUFFIX])
778bc5f02f5SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
779bc5f02f5SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
780bc5f02f5SmrgAC_SUBST([APP_MAN_DIR])
781bc5f02f5SmrgAC_SUBST([LIB_MAN_DIR])
782bc5f02f5SmrgAC_SUBST([FILE_MAN_DIR])
783bc5f02f5SmrgAC_SUBST([MISC_MAN_DIR])
784bc5f02f5SmrgAC_SUBST([DRIVER_MAN_DIR])
785bc5f02f5SmrgAC_SUBST([ADMIN_MAN_DIR])
786bc5f02f5Smrg]) # XORG_MANPAGE_SECTIONS
787bc5f02f5Smrg
788bc5f02f5Smrg# XORG_CHECK_LINUXDOC
789bc5f02f5Smrg# -------------------
790bc5f02f5Smrg# Minimum version: 1.0.0
791bc5f02f5Smrg#
792bc5f02f5Smrg# Defines the variable MAKE_TEXT if the necessary tools and
793bc5f02f5Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
794bc5f02f5Smrg# Whether or not the necessary tools and files are found can be checked
795bc5f02f5Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
796bc5f02f5SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
797bc5f02f5Smrgif test x$XORG_SGML_PATH = x ; then
798bc5f02f5Smrg    XORG_SGML_PATH=$prefix/share/sgml
799439fab64Smrgfi
800bc5f02f5SmrgHAVE_DEFS_ENT=
801439fab64Smrg
802bc5f02f5Smrgif test x"$cross_compiling" = x"yes" ; then
803bc5f02f5Smrg  HAVE_DEFS_ENT=no
804bc5f02f5Smrgelse
805bc5f02f5Smrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
806bc5f02f5Smrgfi
807439fab64Smrg
808bc5f02f5SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
809bc5f02f5SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
810439fab64Smrg
811bc5f02f5SmrgAC_MSG_CHECKING([Whether to build documentation])
812439fab64Smrg
813bc5f02f5Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
814bc5f02f5Smrg   BUILDDOC=yes
815bc5f02f5Smrgelse
816bc5f02f5Smrg   BUILDDOC=no
817439fab64Smrgfi
818439fab64Smrg
819bc5f02f5SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
820439fab64Smrg
821bc5f02f5SmrgAC_MSG_RESULT([$BUILDDOC])
822439fab64Smrg
823bc5f02f5SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
824439fab64Smrg
825bc5f02f5Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
826bc5f02f5Smrg   BUILDPDFDOC=yes
827bc5f02f5Smrgelse
828bc5f02f5Smrg   BUILDPDFDOC=no
829bc5f02f5Smrgfi
830439fab64Smrg
831bc5f02f5SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
832439fab64Smrg
833bc5f02f5SmrgAC_MSG_RESULT([$BUILDPDFDOC])
834439fab64Smrg
835bc5f02f5SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
836bc5f02f5SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
837bc5f02f5SmrgMAKE_PDF="$PS2PDF"
838bc5f02f5SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
839439fab64Smrg
840bc5f02f5SmrgAC_SUBST(MAKE_TEXT)
841bc5f02f5SmrgAC_SUBST(MAKE_PS)
842bc5f02f5SmrgAC_SUBST(MAKE_PDF)
843bc5f02f5SmrgAC_SUBST(MAKE_HTML)
844bc5f02f5Smrg]) # XORG_CHECK_LINUXDOC
845439fab64Smrg
846bc5f02f5Smrg# XORG_CHECK_DOCBOOK
847bc5f02f5Smrg# -------------------
848bc5f02f5Smrg# Minimum version: 1.0.0
849bc5f02f5Smrg#
850bc5f02f5Smrg# Checks for the ability to build output formats from SGML DocBook source.
851bc5f02f5Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
852bc5f02f5Smrg# indicates whether the necessary tools and files are found and, if set,
853bc5f02f5Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
854bc5f02f5SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
855bc5f02f5Smrgif test x$XORG_SGML_PATH = x ; then
856bc5f02f5Smrg    XORG_SGML_PATH=$prefix/share/sgml
857bc5f02f5Smrgfi
858bc5f02f5SmrgHAVE_DEFS_ENT=
859bc5f02f5SmrgBUILDTXTDOC=no
860bc5f02f5SmrgBUILDPDFDOC=no
861bc5f02f5SmrgBUILDPSDOC=no
862bc5f02f5SmrgBUILDHTMLDOC=no
863bc5f02f5Smrg
864bc5f02f5SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
865bc5f02f5Smrg
866bc5f02f5SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
867bc5f02f5SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
868bc5f02f5SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
869bc5f02f5SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
870bc5f02f5Smrg
871bc5f02f5SmrgAC_MSG_CHECKING([Whether to build text documentation])
872bc5f02f5Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
873bc5f02f5Smrg   test x$BUILD_TXTDOC != xno; then
874bc5f02f5Smrg	BUILDTXTDOC=yes
875bc5f02f5Smrgfi
876bc5f02f5SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
877bc5f02f5SmrgAC_MSG_RESULT([$BUILDTXTDOC])
878439fab64Smrg
879bc5f02f5SmrgAC_MSG_CHECKING([Whether to build PDF documentation])
880bc5f02f5Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
881bc5f02f5Smrg   test x$BUILD_PDFDOC != xno; then
882bc5f02f5Smrg	BUILDPDFDOC=yes
883bc5f02f5Smrgfi
884bc5f02f5SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
885bc5f02f5SmrgAC_MSG_RESULT([$BUILDPDFDOC])
886439fab64Smrg
887bc5f02f5SmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
888bc5f02f5Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
889bc5f02f5Smrg   test x$BUILD_PSDOC != xno; then
890bc5f02f5Smrg	BUILDPSDOC=yes
891bc5f02f5Smrgfi
892bc5f02f5SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
893bc5f02f5SmrgAC_MSG_RESULT([$BUILDPSDOC])
894439fab64Smrg
895bc5f02f5SmrgAC_MSG_CHECKING([Whether to build HTML documentation])
896bc5f02f5Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
897bc5f02f5Smrg   test x$BUILD_HTMLDOC != xno; then
898bc5f02f5Smrg	BUILDHTMLDOC=yes
899bc5f02f5Smrgfi
900bc5f02f5SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
901bc5f02f5SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
902439fab64Smrg
903bc5f02f5SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
904bc5f02f5SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
905bc5f02f5SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
906bc5f02f5SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
907439fab64Smrg
908bc5f02f5SmrgAC_SUBST(MAKE_TEXT)
909bc5f02f5SmrgAC_SUBST(MAKE_PS)
910bc5f02f5SmrgAC_SUBST(MAKE_PDF)
911bc5f02f5SmrgAC_SUBST(MAKE_HTML)
912bc5f02f5Smrg]) # XORG_CHECK_DOCBOOK
913439fab64Smrg
914bc5f02f5Smrg# XORG_CHECK_MALLOC_ZERO
915bc5f02f5Smrg# ----------------------
916bc5f02f5Smrg# Minimum version: 1.0.0
917bc5f02f5Smrg#
918bc5f02f5Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
919bc5f02f5Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
920bc5f02f5Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
921bc5f02f5SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
922bc5f02f5SmrgAC_ARG_ENABLE(malloc0returnsnull,
923bc5f02f5Smrg	AC_HELP_STRING([--enable-malloc0returnsnull],
924bc5f02f5Smrg		       [malloc(0) returns NULL (default: auto)]),
925bc5f02f5Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
926bc5f02f5Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
927bc5f02f5Smrg
928bc5f02f5SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
929bc5f02f5Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
930bc5f02f5Smrg	AC_RUN_IFELSE([
931bc5f02f5Smrgchar *malloc();
932bc5f02f5Smrgchar *realloc();
933bc5f02f5Smrgchar *calloc();
934bc5f02f5Smrgmain() {
935bc5f02f5Smrg    char *m0, *r0, *c0, *p;
936bc5f02f5Smrg    m0 = malloc(0);
937bc5f02f5Smrg    p = malloc(10);
938bc5f02f5Smrg    r0 = realloc(p,0);
939bc5f02f5Smrg    c0 = calloc(0);
940bc5f02f5Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
941bc5f02f5Smrg}],
942bc5f02f5Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
943bc5f02f5Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
944bc5f02f5Smrgfi
945bc5f02f5SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
946439fab64Smrg
947bc5f02f5Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
948bc5f02f5Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
949bc5f02f5Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
950bc5f02f5Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
951bc5f02f5Smrgelse
952bc5f02f5Smrg	MALLOC_ZERO_CFLAGS=""
953bc5f02f5Smrg	XMALLOC_ZERO_CFLAGS=""
954bc5f02f5Smrg	XTMALLOC_ZERO_CFLAGS=""
955439fab64Smrgfi
956439fab64Smrg
957bc5f02f5SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
958bc5f02f5SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
959bc5f02f5SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
960bc5f02f5Smrg]) # XORG_CHECK_MALLOC_ZERO
961439fab64Smrg
962bc5f02f5Smrg# XORG_WITH_LINT()
963bc5f02f5Smrg# ----------------
964bc5f02f5Smrg# Minimum version: 1.1.0
965bc5f02f5Smrg#
966bc5f02f5Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint
967bc5f02f5Smrg# is specified.   (Use --with-lint=sparse for sparse.)
968bc5f02f5Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
969bc5f02f5Smrg# Sets $LINT_FLAGS to flags to pass to source checker
970bc5f02f5Smrg# Sets LINT automake conditional if enabled (default: disabled)
971bc5f02f5Smrg#
972bc5f02f5SmrgAC_DEFUN([XORG_WITH_LINT],[
973bc5f02f5Smrg
974bc5f02f5Smrg# Allow checking code with lint, sparse, etc.
975bc5f02f5SmrgAC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
976bc5f02f5Smrg		[Use a lint-style source code checker (default: disabled)])],
977bc5f02f5Smrg		[use_lint=$withval], [use_lint=no])
978bc5f02f5Smrgif test "x$use_lint" = "xyes" ; then
979bc5f02f5Smrg	LINT="lint"
980bc5f02f5Smrgelse
981bc5f02f5Smrg	LINT="$use_lint"
982bc5f02f5Smrgfi
983bc5f02f5Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
984bc5f02f5Smrg    case $LINT in
985bc5f02f5Smrg	lint|*/lint)
986bc5f02f5Smrg	    case $host_os in
987bc5f02f5Smrg		solaris*)
988bc5f02f5Smrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
989bc5f02f5Smrg			;;
990bc5f02f5Smrg	    esac
991bc5f02f5Smrg	    ;;
992bc5f02f5Smrg    esac
993bc5f02f5Smrgfi
994439fab64Smrg
995bc5f02f5SmrgAC_SUBST(LINT)
996bc5f02f5SmrgAC_SUBST(LINT_FLAGS)
997bc5f02f5SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
998439fab64Smrg
999bc5f02f5Smrg]) # XORG_WITH_LINT
1000439fab64Smrg
1001bc5f02f5Smrg# XORG_LINT_LIBRARY(LIBNAME)
1002bc5f02f5Smrg# --------------------------
1003bc5f02f5Smrg# Minimum version: 1.1.0
1004bc5f02f5Smrg#
1005bc5f02f5Smrg# Sets up flags for building lint libraries for checking programs that call
1006bc5f02f5Smrg# functions in the library.
1007bc5f02f5Smrg# Disabled by default, enable with --enable-lint-library
1008bc5f02f5Smrg# Sets: 
1009bc5f02f5Smrg#	@LINTLIB@		- name of lint library file to make
1010bc5f02f5Smrg#	MAKE_LINT_LIB		- automake conditional
1011bc5f02f5Smrg#
1012439fab64Smrg
1013bc5f02f5SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
1014bc5f02f5SmrgAC_REQUIRE([XORG_WITH_LINT])
1015bc5f02f5Smrg# Build lint "library" for more indepth checks of programs calling this library
1016bc5f02f5SmrgAC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
1017bc5f02f5Smrg	[Create lint library (default: disabled)])],
1018bc5f02f5Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
1019bc5f02f5Smrgif test "x$make_lint_lib" != "xno" ; then
1020bc5f02f5Smrg	if test "x$LINT" = "xno" ; then
1021bc5f02f5Smrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
1022bc5f02f5Smrg	fi
1023bc5f02f5Smrg	if test "x$make_lint_lib" = "xyes" ; then
1024bc5f02f5Smrg		LINTLIB=llib-l$1.ln
1025bc5f02f5Smrg	else
1026bc5f02f5Smrg		LINTLIB=$make_lint_lib
1027bc5f02f5Smrg	fi
1028bc5f02f5Smrgfi
1029bc5f02f5SmrgAC_SUBST(LINTLIB)
1030bc5f02f5SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1031439fab64Smrg
1032bc5f02f5Smrg]) # XORG_LINT_LIBRARY
1033439fab64Smrg
1034bc5f02f5Smrg# XORG_CWARNFLAGS
1035bc5f02f5Smrg# ---------------
1036bc5f02f5Smrg# Minimum version: 1.2.0
1037bc5f02f5Smrg#
1038bc5f02f5Smrg# Defines CWARNFLAGS to enable C compiler warnings.
1039bc5f02f5Smrg#
1040bc5f02f5SmrgAC_DEFUN([XORG_CWARNFLAGS], [
1041bc5f02f5SmrgAC_REQUIRE([AC_PROG_CC])
1042bc5f02f5Smrgif  test "x$GCC" = xyes ; then
1043bc5f02f5Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
1044bc5f02f5Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
1045bc5f02f5Smrg-Wbad-function-cast"
1046bc5f02f5Smrg    case `$CC -dumpversion` in
1047bc5f02f5Smrg    3.4.* | 4.*)
1048bc5f02f5Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
1049bc5f02f5Smrg	;;
1050bc5f02f5Smrg    esac
1051439fab64Smrgelse
1052bc5f02f5Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1053bc5f02f5Smrg    if test "x$SUNCC" = "xyes"; then
1054bc5f02f5Smrg	CWARNFLAGS="-v"
1055bc5f02f5Smrg    fi
1056439fab64Smrgfi
1057bc5f02f5SmrgAC_SUBST(CWARNFLAGS)
1058bc5f02f5Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
1059bc5f02f5Smrg]) # XORG_CWARNFLAGS
1060439fab64Smrgdnl Copyright 2005 Red Hat, Inc
1061439fab64Smrgdnl
1062439fab64Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1063439fab64Smrgdnl documentation for any purpose is hereby granted without fee, provided that
1064439fab64Smrgdnl the above copyright notice appear in all copies and that both that
1065439fab64Smrgdnl copyright notice and this permission notice appear in supporting
1066439fab64Smrgdnl documentation.
1067439fab64Smrgdnl
1068439fab64Smrgdnl The above copyright notice and this permission notice shall be included
1069439fab64Smrgdnl in all copies or substantial portions of the Software.
1070439fab64Smrgdnl
1071439fab64Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1072439fab64Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1073439fab64Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1074439fab64Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1075439fab64Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1076439fab64Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1077439fab64Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
1078439fab64Smrgdnl
1079439fab64Smrgdnl Except as contained in this notice, the name of the copyright holders shall
1080439fab64Smrgdnl not be used in advertising or otherwise to promote the sale, use or
1081439fab64Smrgdnl other dealings in this Software without prior written authorization
1082439fab64Smrgdnl from the copyright holders.
1083439fab64Smrgdnl
1084439fab64Smrg
1085439fab64Smrg# XORG_RELEASE_VERSION
1086439fab64Smrg# --------------------
1087439fab64Smrg# Adds --with/without-release-string and changes the PACKAGE and
1088439fab64Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
1089bc5f02f5Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
1090bc5f02f5Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1091439fab64Smrg 
1092439fab64SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
1093439fab64Smrg	AC_ARG_WITH(release-version,
1094439fab64Smrg			AC_HELP_STRING([--with-release-version=STRING],
1095439fab64Smrg				[Use release version string in package name]),
1096439fab64Smrg			[RELEASE_VERSION="$withval"],
1097439fab64Smrg			[RELEASE_VERSION=""])
1098439fab64Smrg	if test "x$RELEASE_VERSION" != "x"; then
1099439fab64Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
1100439fab64Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
1101439fab64Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
1102439fab64Smrg	fi
1103bc5f02f5Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1104bc5f02f5Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
1105bc5f02f5Smrg		[Major version of this package])
1106bc5f02f5Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
1107bc5f02f5Smrg	if test "x$PVM" = "x"; then
1108bc5f02f5Smrg		PVM="0"
1109bc5f02f5Smrg	fi
1110bc5f02f5Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
1111bc5f02f5Smrg		[$PVM],
1112bc5f02f5Smrg		[Minor version of this package])
1113bc5f02f5Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
1114bc5f02f5Smrg	if test "x$PVP" = "x"; then
1115bc5f02f5Smrg		PVP="0"
1116bc5f02f5Smrg	fi
1117bc5f02f5Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1118bc5f02f5Smrg		[$PVP],
1119bc5f02f5Smrg		[Patch version of this package])
1120439fab64Smrg])
1121439fab64Smrg
1122bc5f02f5Smrg# XORG_CHANGELOG()
1123bc5f02f5Smrg# ----------------
1124bc5f02f5Smrg# Minimum version: 1.2.0
1125bc5f02f5Smrg#
1126bc5f02f5Smrg# Defines the variable CHANGELOG_CMD as the command to generate
1127bc5f02f5Smrg# ChangeLog from git.
1128bc5f02f5Smrg#
1129bc5f02f5Smrg# Arrange that distcleancheck ignores ChangeLog left over by distclean.
1130bc5f02f5Smrg#
1131bc5f02f5SmrgAC_DEFUN([XORG_CHANGELOG], [
1132bc5f02f5SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
1133bc5f02f5Smrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
1134bc5f02f5Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
1135bc5f02f5SmrgAC_SUBST([CHANGELOG_CMD])
1136bc5f02f5SmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
1137bc5f02f5Smrg]) # XORG_CHANGELOG
1138bc5f02f5Smrg
1139