aclocal.m4 revision e6232409
1# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
2
3# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4# 2005  Free Software Foundation, Inc.
5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12# PARTICULAR PURPOSE.
13
14# Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
15#
16# This file is free software; the Free Software Foundation
17# gives unlimited permission to copy and/or distribute it,
18# with or without modifications, as long as this notice is preserved.
19
20# AM_AUTOMAKE_VERSION(VERSION)
21# ----------------------------
22# Automake X.Y traces this macro to ensure aclocal.m4 has been
23# generated from the m4 files accompanying Automake X.Y.
24AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
25
26# AM_SET_CURRENT_AUTOMAKE_VERSION
27# -------------------------------
28# Call AM_AUTOMAKE_VERSION so it can be traced.
29# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
30AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
31	 [AM_AUTOMAKE_VERSION([1.9.6])])
32
33# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
34
35# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
36#
37# This file is free software; the Free Software Foundation
38# gives unlimited permission to copy and/or distribute it,
39# with or without modifications, as long as this notice is preserved.
40
41# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
42# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
43# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
44#
45# Of course, Automake must honor this variable whenever it calls a
46# tool from the auxiliary directory.  The problem is that $srcdir (and
47# therefore $ac_aux_dir as well) can be either absolute or relative,
48# depending on how configure is run.  This is pretty annoying, since
49# it makes $ac_aux_dir quite unusable in subdirectories: in the top
50# source directory, any form will work fine, but in subdirectories a
51# relative path needs to be adjusted first.
52#
53# $ac_aux_dir/missing
54#    fails when called from a subdirectory if $ac_aux_dir is relative
55# $top_srcdir/$ac_aux_dir/missing
56#    fails if $ac_aux_dir is absolute,
57#    fails when called from a subdirectory in a VPATH build with
58#          a relative $ac_aux_dir
59#
60# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
61# are both prefixed by $srcdir.  In an in-source build this is usually
62# harmless because $srcdir is `.', but things will broke when you
63# start a VPATH build or use an absolute $srcdir.
64#
65# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
66# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
67#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
68# and then we would define $MISSING as
69#   MISSING="\${SHELL} $am_aux_dir/missing"
70# This will work as long as MISSING is not called from configure, because
71# unfortunately $(top_srcdir) has no meaning in configure.
72# However there are other variables, like CC, which are often used in
73# configure, and could therefore not use this "fixed" $ac_aux_dir.
74#
75# Another solution, used here, is to always expand $ac_aux_dir to an
76# absolute PATH.  The drawback is that using absolute paths prevent a
77# configured tree to be moved without reconfiguration.
78
79AC_DEFUN([AM_AUX_DIR_EXPAND],
80[dnl Rely on autoconf to set up CDPATH properly.
81AC_PREREQ([2.50])dnl
82# expand $ac_aux_dir to an absolute path
83am_aux_dir=`cd $ac_aux_dir && pwd`
84])
85
86# AM_CONDITIONAL                                            -*- Autoconf -*-
87
88# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
89# Free Software Foundation, Inc.
90#
91# This file is free software; the Free Software Foundation
92# gives unlimited permission to copy and/or distribute it,
93# with or without modifications, as long as this notice is preserved.
94
95# serial 7
96
97# AM_CONDITIONAL(NAME, SHELL-CONDITION)
98# -------------------------------------
99# Define a conditional.
100AC_DEFUN([AM_CONDITIONAL],
101[AC_PREREQ(2.52)dnl
102 ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
103	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
104AC_SUBST([$1_TRUE])
105AC_SUBST([$1_FALSE])
106if $2; then
107  $1_TRUE=
108  $1_FALSE='#'
109else
110  $1_TRUE='#'
111  $1_FALSE=
112fi
113AC_CONFIG_COMMANDS_PRE(
114[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
115  AC_MSG_ERROR([[conditional "$1" was never defined.
116Usually this means the macro was only invoked conditionally.]])
117fi])])
118
119
120# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
121# Free Software Foundation, Inc.
122#
123# This file is free software; the Free Software Foundation
124# gives unlimited permission to copy and/or distribute it,
125# with or without modifications, as long as this notice is preserved.
126
127# serial 8
128
129# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
130# written in clear, in which case automake, when reading aclocal.m4,
131# will think it sees a *use*, and therefore will trigger all it's
132# C support machinery.  Also note that it means that autoscan, seeing
133# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
134
135
136# _AM_DEPENDENCIES(NAME)
137# ----------------------
138# See how the compiler implements dependency checking.
139# NAME is "CC", "CXX", "GCJ", or "OBJC".
140# We try a few techniques and use that to set a single cache variable.
141#
142# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
143# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
144# dependency, and given that the user is not expected to run this macro,
145# just rely on AC_PROG_CC.
146AC_DEFUN([_AM_DEPENDENCIES],
147[AC_REQUIRE([AM_SET_DEPDIR])dnl
148AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
149AC_REQUIRE([AM_MAKE_INCLUDE])dnl
150AC_REQUIRE([AM_DEP_TRACK])dnl
151
152ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
153       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
154       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
155       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
156                   [depcc="$$1"   am_compiler_list=])
157
158AC_CACHE_CHECK([dependency style of $depcc],
159               [am_cv_$1_dependencies_compiler_type],
160[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
161  # We make a subdir and do the tests there.  Otherwise we can end up
162  # making bogus files that we don't know about and never remove.  For
163  # instance it was reported that on HP-UX the gcc test will end up
164  # making a dummy file named `D' -- because `-MD' means `put the output
165  # in D'.
166  mkdir conftest.dir
167  # Copy depcomp to subdir because otherwise we won't find it if we're
168  # using a relative directory.
169  cp "$am_depcomp" conftest.dir
170  cd conftest.dir
171  # We will build objects and dependencies in a subdirectory because
172  # it helps to detect inapplicable dependency modes.  For instance
173  # both Tru64's cc and ICC support -MD to output dependencies as a
174  # side effect of compilation, but ICC will put the dependencies in
175  # the current directory while Tru64 will put them in the object
176  # directory.
177  mkdir sub
178
179  am_cv_$1_dependencies_compiler_type=none
180  if test "$am_compiler_list" = ""; then
181     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
182  fi
183  for depmode in $am_compiler_list; do
184    # Setup a source with many dependencies, because some compilers
185    # like to wrap large dependency lists on column 80 (with \), and
186    # we should not choose a depcomp mode which is confused by this.
187    #
188    # We need to recreate these files for each test, as the compiler may
189    # overwrite some of them when testing with obscure command lines.
190    # This happens at least with the AIX C compiler.
191    : > sub/conftest.c
192    for i in 1 2 3 4 5 6; do
193      echo '#include "conftst'$i'.h"' >> sub/conftest.c
194      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
195      # Solaris 8's {/usr,}/bin/sh.
196      touch sub/conftst$i.h
197    done
198    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
199
200    case $depmode in
201    nosideeffect)
202      # after this tag, mechanisms are not by side-effect, so they'll
203      # only be used when explicitly requested
204      if test "x$enable_dependency_tracking" = xyes; then
205	continue
206      else
207	break
208      fi
209      ;;
210    none) break ;;
211    esac
212    # We check with `-c' and `-o' for the sake of the "dashmstdout"
213    # mode.  It turns out that the SunPro C++ compiler does not properly
214    # handle `-M -o', and we need to detect this.
215    if depmode=$depmode \
216       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
217       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
218       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
219         >/dev/null 2>conftest.err &&
220       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
221       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
222       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
223      # icc doesn't choke on unknown options, it will just issue warnings
224      # or remarks (even with -Werror).  So we grep stderr for any message
225      # that says an option was ignored or not supported.
226      # When given -MP, icc 7.0 and 7.1 complain thusly:
227      #   icc: Command line warning: ignoring option '-M'; no argument required
228      # The diagnosis changed in icc 8.0:
229      #   icc: Command line remark: option '-MP' not supported
230      if (grep 'ignoring option' conftest.err ||
231          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
232        am_cv_$1_dependencies_compiler_type=$depmode
233        break
234      fi
235    fi
236  done
237
238  cd ..
239  rm -rf conftest.dir
240else
241  am_cv_$1_dependencies_compiler_type=none
242fi
243])
244AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
245AM_CONDITIONAL([am__fastdep$1], [
246  test "x$enable_dependency_tracking" != xno \
247  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
248])
249
250
251# AM_SET_DEPDIR
252# -------------
253# Choose a directory name for dependency files.
254# This macro is AC_REQUIREd in _AM_DEPENDENCIES
255AC_DEFUN([AM_SET_DEPDIR],
256[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
257AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
258])
259
260
261# AM_DEP_TRACK
262# ------------
263AC_DEFUN([AM_DEP_TRACK],
264[AC_ARG_ENABLE(dependency-tracking,
265[  --disable-dependency-tracking  speeds up one-time build
266  --enable-dependency-tracking   do not reject slow dependency extractors])
267if test "x$enable_dependency_tracking" != xno; then
268  am_depcomp="$ac_aux_dir/depcomp"
269  AMDEPBACKSLASH='\'
270fi
271AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
272AC_SUBST([AMDEPBACKSLASH])
273])
274
275# Generate code to set up dependency tracking.              -*- Autoconf -*-
276
277# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
278# Free Software Foundation, Inc.
279#
280# This file is free software; the Free Software Foundation
281# gives unlimited permission to copy and/or distribute it,
282# with or without modifications, as long as this notice is preserved.
283
284#serial 3
285
286# _AM_OUTPUT_DEPENDENCY_COMMANDS
287# ------------------------------
288AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
289[for mf in $CONFIG_FILES; do
290  # Strip MF so we end up with the name of the file.
291  mf=`echo "$mf" | sed -e 's/:.*$//'`
292  # Check whether this is an Automake generated Makefile or not.
293  # We used to match only the files named `Makefile.in', but
294  # some people rename them; so instead we look at the file content.
295  # Grep'ing the first line is not enough: some people post-process
296  # each Makefile.in and add a new line on top of each file to say so.
297  # So let's grep whole file.
298  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
299    dirpart=`AS_DIRNAME("$mf")`
300  else
301    continue
302  fi
303  # Extract the definition of DEPDIR, am__include, and am__quote
304  # from the Makefile without running `make'.
305  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
306  test -z "$DEPDIR" && continue
307  am__include=`sed -n 's/^am__include = //p' < "$mf"`
308  test -z "am__include" && continue
309  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
310  # When using ansi2knr, U may be empty or an underscore; expand it
311  U=`sed -n 's/^U = //p' < "$mf"`
312  # Find all dependency output files, they are included files with
313  # $(DEPDIR) in their names.  We invoke sed twice because it is the
314  # simplest approach to changing $(DEPDIR) to its actual value in the
315  # expansion.
316  for file in `sed -n "
317    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
318       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
319    # Make sure the directory exists.
320    test -f "$dirpart/$file" && continue
321    fdir=`AS_DIRNAME(["$file"])`
322    AS_MKDIR_P([$dirpart/$fdir])
323    # echo "creating $dirpart/$file"
324    echo '# dummy' > "$dirpart/$file"
325  done
326done
327])# _AM_OUTPUT_DEPENDENCY_COMMANDS
328
329
330# AM_OUTPUT_DEPENDENCY_COMMANDS
331# -----------------------------
332# This macro should only be invoked once -- use via AC_REQUIRE.
333#
334# This code is only required when automatic dependency tracking
335# is enabled.  FIXME.  This creates each `.P' file that we will
336# need in order to bootstrap the dependency handling code.
337AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
338[AC_CONFIG_COMMANDS([depfiles],
339     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
340     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
341])
342
343# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
344# Free Software Foundation, Inc.
345#
346# This file is free software; the Free Software Foundation
347# gives unlimited permission to copy and/or distribute it,
348# with or without modifications, as long as this notice is preserved.
349
350# serial 8
351
352# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
353AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
354
355# Do all the work for Automake.                             -*- Autoconf -*-
356
357# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
358# Free Software Foundation, Inc.
359#
360# This file is free software; the Free Software Foundation
361# gives unlimited permission to copy and/or distribute it,
362# with or without modifications, as long as this notice is preserved.
363
364# serial 12
365
366# This macro actually does too much.  Some checks are only needed if
367# your package does certain things.  But this isn't really a big deal.
368
369# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
370# AM_INIT_AUTOMAKE([OPTIONS])
371# -----------------------------------------------
372# The call with PACKAGE and VERSION arguments is the old style
373# call (pre autoconf-2.50), which is being phased out.  PACKAGE
374# and VERSION should now be passed to AC_INIT and removed from
375# the call to AM_INIT_AUTOMAKE.
376# We support both call styles for the transition.  After
377# the next Automake release, Autoconf can make the AC_INIT
378# arguments mandatory, and then we can depend on a new Autoconf
379# release and drop the old call support.
380AC_DEFUN([AM_INIT_AUTOMAKE],
381[AC_PREREQ([2.58])dnl
382dnl Autoconf wants to disallow AM_ names.  We explicitly allow
383dnl the ones we care about.
384m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
385AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
386AC_REQUIRE([AC_PROG_INSTALL])dnl
387# test to see if srcdir already configured
388if test "`cd $srcdir && pwd`" != "`pwd`" &&
389   test -f $srcdir/config.status; then
390  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
391fi
392
393# test whether we have cygpath
394if test -z "$CYGPATH_W"; then
395  if (cygpath --version) >/dev/null 2>/dev/null; then
396    CYGPATH_W='cygpath -w'
397  else
398    CYGPATH_W=echo
399  fi
400fi
401AC_SUBST([CYGPATH_W])
402
403# Define the identity of the package.
404dnl Distinguish between old-style and new-style calls.
405m4_ifval([$2],
406[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
407 AC_SUBST([PACKAGE], [$1])dnl
408 AC_SUBST([VERSION], [$2])],
409[_AM_SET_OPTIONS([$1])dnl
410 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
411 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
412
413_AM_IF_OPTION([no-define],,
414[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
415 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
416
417# Some tools Automake needs.
418AC_REQUIRE([AM_SANITY_CHECK])dnl
419AC_REQUIRE([AC_ARG_PROGRAM])dnl
420AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
421AM_MISSING_PROG(AUTOCONF, autoconf)
422AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
423AM_MISSING_PROG(AUTOHEADER, autoheader)
424AM_MISSING_PROG(MAKEINFO, makeinfo)
425AM_PROG_INSTALL_SH
426AM_PROG_INSTALL_STRIP
427AC_REQUIRE([AM_PROG_MKDIR_P])dnl
428# We need awk for the "check" target.  The system "awk" is bad on
429# some platforms.
430AC_REQUIRE([AC_PROG_AWK])dnl
431AC_REQUIRE([AC_PROG_MAKE_SET])dnl
432AC_REQUIRE([AM_SET_LEADING_DOT])dnl
433_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
434              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
435	      		     [_AM_PROG_TAR([v7])])])
436_AM_IF_OPTION([no-dependencies],,
437[AC_PROVIDE_IFELSE([AC_PROG_CC],
438                  [_AM_DEPENDENCIES(CC)],
439                  [define([AC_PROG_CC],
440                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
441AC_PROVIDE_IFELSE([AC_PROG_CXX],
442                  [_AM_DEPENDENCIES(CXX)],
443                  [define([AC_PROG_CXX],
444                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
445])
446])
447
448
449# When config.status generates a header, we must update the stamp-h file.
450# This file resides in the same directory as the config header
451# that is generated.  The stamp files are numbered to have different names.
452
453# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
454# loop where config.status creates the headers, so we can generate
455# our stamp files there.
456AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
457[# Compute $1's index in $config_headers.
458_am_stamp_count=1
459for _am_header in $config_headers :; do
460  case $_am_header in
461    $1 | $1:* )
462      break ;;
463    * )
464      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
465  esac
466done
467echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
468
469# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
470#
471# This file is free software; the Free Software Foundation
472# gives unlimited permission to copy and/or distribute it,
473# with or without modifications, as long as this notice is preserved.
474
475# AM_PROG_INSTALL_SH
476# ------------------
477# Define $install_sh.
478AC_DEFUN([AM_PROG_INSTALL_SH],
479[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
480install_sh=${install_sh-"$am_aux_dir/install-sh"}
481AC_SUBST(install_sh)])
482
483# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
484#
485# This file is free software; the Free Software Foundation
486# gives unlimited permission to copy and/or distribute it,
487# with or without modifications, as long as this notice is preserved.
488
489# serial 2
490
491# Check whether the underlying file-system supports filenames
492# with a leading dot.  For instance MS-DOS doesn't.
493AC_DEFUN([AM_SET_LEADING_DOT],
494[rm -rf .tst 2>/dev/null
495mkdir .tst 2>/dev/null
496if test -d .tst; then
497  am__leading_dot=.
498else
499  am__leading_dot=_
500fi
501rmdir .tst 2>/dev/null
502AC_SUBST([am__leading_dot])])
503
504# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
505# From Jim Meyering
506
507# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
508# Free Software Foundation, Inc.
509#
510# This file is free software; the Free Software Foundation
511# gives unlimited permission to copy and/or distribute it,
512# with or without modifications, as long as this notice is preserved.
513
514# serial 4
515
516AC_DEFUN([AM_MAINTAINER_MODE],
517[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
518  dnl maintainer-mode is disabled by default
519  AC_ARG_ENABLE(maintainer-mode,
520[  --enable-maintainer-mode  enable make rules and dependencies not useful
521			  (and sometimes confusing) to the casual installer],
522      USE_MAINTAINER_MODE=$enableval,
523      USE_MAINTAINER_MODE=no)
524  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
525  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
526  MAINT=$MAINTAINER_MODE_TRUE
527  AC_SUBST(MAINT)dnl
528]
529)
530
531AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
532
533# Check to see how 'make' treats includes.	            -*- Autoconf -*-
534
535# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
536#
537# This file is free software; the Free Software Foundation
538# gives unlimited permission to copy and/or distribute it,
539# with or without modifications, as long as this notice is preserved.
540
541# serial 3
542
543# AM_MAKE_INCLUDE()
544# -----------------
545# Check to see how make treats includes.
546AC_DEFUN([AM_MAKE_INCLUDE],
547[am_make=${MAKE-make}
548cat > confinc << 'END'
549am__doit:
550	@echo done
551.PHONY: am__doit
552END
553# If we don't find an include directive, just comment out the code.
554AC_MSG_CHECKING([for style of include used by $am_make])
555am__include="#"
556am__quote=
557_am_result=none
558# First try GNU make style include.
559echo "include confinc" > confmf
560# We grep out `Entering directory' and `Leaving directory'
561# messages which can occur if `w' ends up in MAKEFLAGS.
562# In particular we don't look at `^make:' because GNU make might
563# be invoked under some other name (usually "gmake"), in which
564# case it prints its new name instead of `make'.
565if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
566   am__include=include
567   am__quote=
568   _am_result=GNU
569fi
570# Now try BSD make style include.
571if test "$am__include" = "#"; then
572   echo '.include "confinc"' > confmf
573   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
574      am__include=.include
575      am__quote="\""
576      _am_result=BSD
577   fi
578fi
579AC_SUBST([am__include])
580AC_SUBST([am__quote])
581AC_MSG_RESULT([$_am_result])
582rm -f confinc confmf
583])
584
585# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
586
587# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
588# Free Software Foundation, Inc.
589#
590# This file is free software; the Free Software Foundation
591# gives unlimited permission to copy and/or distribute it,
592# with or without modifications, as long as this notice is preserved.
593
594# serial 4
595
596# AM_MISSING_PROG(NAME, PROGRAM)
597# ------------------------------
598AC_DEFUN([AM_MISSING_PROG],
599[AC_REQUIRE([AM_MISSING_HAS_RUN])
600$1=${$1-"${am_missing_run}$2"}
601AC_SUBST($1)])
602
603
604# AM_MISSING_HAS_RUN
605# ------------------
606# Define MISSING if not defined so far and test if it supports --run.
607# If it does, set am_missing_run to use it, otherwise, to nothing.
608AC_DEFUN([AM_MISSING_HAS_RUN],
609[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
610test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
611# Use eval to expand $SHELL
612if eval "$MISSING --run true"; then
613  am_missing_run="$MISSING --run "
614else
615  am_missing_run=
616  AC_MSG_WARN([`missing' script is too old or missing])
617fi
618])
619
620# Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
621#
622# This file is free software; the Free Software Foundation
623# gives unlimited permission to copy and/or distribute it,
624# with or without modifications, as long as this notice is preserved.
625
626# AM_PROG_MKDIR_P
627# ---------------
628# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
629#
630# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
631# created by `make install' are always world readable, even if the
632# installer happens to have an overly restrictive umask (e.g. 077).
633# This was a mistake.  There are at least two reasons why we must not
634# use `-m 0755':
635#   - it causes special bits like SGID to be ignored,
636#   - it may be too restrictive (some setups expect 775 directories).
637#
638# Do not use -m 0755 and let people choose whatever they expect by
639# setting umask.
640#
641# We cannot accept any implementation of `mkdir' that recognizes `-p'.
642# Some implementations (such as Solaris 8's) are not thread-safe: if a
643# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
644# concurrently, both version can detect that a/ is missing, but only
645# one can create it and the other will error out.  Consequently we
646# restrict ourselves to GNU make (using the --version option ensures
647# this.)
648AC_DEFUN([AM_PROG_MKDIR_P],
649[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
650  # We used to keeping the `.' as first argument, in order to
651  # allow $(mkdir_p) to be used without argument.  As in
652  #   $(mkdir_p) $(somedir)
653  # where $(somedir) is conditionally defined.  However this is wrong
654  # for two reasons:
655  #  1. if the package is installed by a user who cannot write `.'
656  #     make install will fail,
657  #  2. the above comment should most certainly read
658  #     $(mkdir_p) $(DESTDIR)$(somedir)
659  #     so it does not work when $(somedir) is undefined and
660  #     $(DESTDIR) is not.
661  #  To support the latter case, we have to write
662  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
663  #  so the `.' trick is pointless.
664  mkdir_p='mkdir -p --'
665else
666  # On NextStep and OpenStep, the `mkdir' command does not
667  # recognize any option.  It will interpret all options as
668  # directories to create, and then abort because `.' already
669  # exists.
670  for d in ./-p ./--version;
671  do
672    test -d $d && rmdir $d
673  done
674  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
675  if test -f "$ac_aux_dir/mkinstalldirs"; then
676    mkdir_p='$(mkinstalldirs)'
677  else
678    mkdir_p='$(install_sh) -d'
679  fi
680fi
681AC_SUBST([mkdir_p])])
682
683# Helper functions for option handling.                     -*- Autoconf -*-
684
685# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
686#
687# This file is free software; the Free Software Foundation
688# gives unlimited permission to copy and/or distribute it,
689# with or without modifications, as long as this notice is preserved.
690
691# serial 3
692
693# _AM_MANGLE_OPTION(NAME)
694# -----------------------
695AC_DEFUN([_AM_MANGLE_OPTION],
696[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
697
698# _AM_SET_OPTION(NAME)
699# ------------------------------
700# Set option NAME.  Presently that only means defining a flag for this option.
701AC_DEFUN([_AM_SET_OPTION],
702[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
703
704# _AM_SET_OPTIONS(OPTIONS)
705# ----------------------------------
706# OPTIONS is a space-separated list of Automake options.
707AC_DEFUN([_AM_SET_OPTIONS],
708[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
709
710# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
711# -------------------------------------------
712# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
713AC_DEFUN([_AM_IF_OPTION],
714[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
715
716# Check to make sure that the build environment is sane.    -*- Autoconf -*-
717
718# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
719# Free Software Foundation, Inc.
720#
721# This file is free software; the Free Software Foundation
722# gives unlimited permission to copy and/or distribute it,
723# with or without modifications, as long as this notice is preserved.
724
725# serial 4
726
727# AM_SANITY_CHECK
728# ---------------
729AC_DEFUN([AM_SANITY_CHECK],
730[AC_MSG_CHECKING([whether build environment is sane])
731# Just in case
732sleep 1
733echo timestamp > conftest.file
734# Do `set' in a subshell so we don't clobber the current shell's
735# arguments.  Must try -L first in case configure is actually a
736# symlink; some systems play weird games with the mod time of symlinks
737# (eg FreeBSD returns the mod time of the symlink's containing
738# directory).
739if (
740   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
741   if test "$[*]" = "X"; then
742      # -L didn't work.
743      set X `ls -t $srcdir/configure conftest.file`
744   fi
745   rm -f conftest.file
746   if test "$[*]" != "X $srcdir/configure conftest.file" \
747      && test "$[*]" != "X conftest.file $srcdir/configure"; then
748
749      # If neither matched, then we have a broken ls.  This can happen
750      # if, for instance, CONFIG_SHELL is bash and it inherits a
751      # broken ls alias from the environment.  This has actually
752      # happened.  Such a system could not be considered "sane".
753      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
754alias in your environment])
755   fi
756
757   test "$[2]" = conftest.file
758   )
759then
760   # Ok.
761   :
762else
763   AC_MSG_ERROR([newly created file is older than distributed files!
764Check your system clock])
765fi
766AC_MSG_RESULT(yes)])
767
768# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
769#
770# This file is free software; the Free Software Foundation
771# gives unlimited permission to copy and/or distribute it,
772# with or without modifications, as long as this notice is preserved.
773
774# AM_PROG_INSTALL_STRIP
775# ---------------------
776# One issue with vendor `install' (even GNU) is that you can't
777# specify the program used to strip binaries.  This is especially
778# annoying in cross-compiling environments, where the build's strip
779# is unlikely to handle the host's binaries.
780# Fortunately install-sh will honor a STRIPPROG variable, so we
781# always use install-sh in `make install-strip', and initialize
782# STRIPPROG with the value of the STRIP variable (set by the user).
783AC_DEFUN([AM_PROG_INSTALL_STRIP],
784[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
785# Installed binaries are usually stripped using `strip' when the user
786# run `make install-strip'.  However `strip' might not be the right
787# tool to use in cross-compilation environments, therefore Automake
788# will honor the `STRIP' environment variable to overrule this program.
789dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
790if test "$cross_compiling" != no; then
791  AC_CHECK_TOOL([STRIP], [strip], :)
792fi
793INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
794AC_SUBST([INSTALL_STRIP_PROGRAM])])
795
796# Check how to create a tarball.                            -*- Autoconf -*-
797
798# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
799#
800# This file is free software; the Free Software Foundation
801# gives unlimited permission to copy and/or distribute it,
802# with or without modifications, as long as this notice is preserved.
803
804# serial 2
805
806# _AM_PROG_TAR(FORMAT)
807# --------------------
808# Check how to create a tarball in format FORMAT.
809# FORMAT should be one of `v7', `ustar', or `pax'.
810#
811# Substitute a variable $(am__tar) that is a command
812# writing to stdout a FORMAT-tarball containing the directory
813# $tardir.
814#     tardir=directory && $(am__tar) > result.tar
815#
816# Substitute a variable $(am__untar) that extract such
817# a tarball read from stdin.
818#     $(am__untar) < result.tar
819AC_DEFUN([_AM_PROG_TAR],
820[# Always define AMTAR for backward compatibility.
821AM_MISSING_PROG([AMTAR], [tar])
822m4_if([$1], [v7],
823     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
824     [m4_case([$1], [ustar],, [pax],,
825              [m4_fatal([Unknown tar format])])
826AC_MSG_CHECKING([how to create a $1 tar archive])
827# Loop over all known methods to create a tar archive until one works.
828_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
829_am_tools=${am_cv_prog_tar_$1-$_am_tools}
830# Do not fold the above two line into one, because Tru64 sh and
831# Solaris sh will not grok spaces in the rhs of `-'.
832for _am_tool in $_am_tools
833do
834  case $_am_tool in
835  gnutar)
836    for _am_tar in tar gnutar gtar;
837    do
838      AM_RUN_LOG([$_am_tar --version]) && break
839    done
840    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
841    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
842    am__untar="$_am_tar -xf -"
843    ;;
844  plaintar)
845    # Must skip GNU tar: if it does not support --format= it doesn't create
846    # ustar tarball either.
847    (tar --version) >/dev/null 2>&1 && continue
848    am__tar='tar chf - "$$tardir"'
849    am__tar_='tar chf - "$tardir"'
850    am__untar='tar xf -'
851    ;;
852  pax)
853    am__tar='pax -L -x $1 -w "$$tardir"'
854    am__tar_='pax -L -x $1 -w "$tardir"'
855    am__untar='pax -r'
856    ;;
857  cpio)
858    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
859    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
860    am__untar='cpio -i -H $1 -d'
861    ;;
862  none)
863    am__tar=false
864    am__tar_=false
865    am__untar=false
866    ;;
867  esac
868
869  # If the value was cached, stop now.  We just wanted to have am__tar
870  # and am__untar set.
871  test -n "${am_cv_prog_tar_$1}" && break
872
873  # tar/untar a dummy directory, and stop if the command works
874  rm -rf conftest.dir
875  mkdir conftest.dir
876  echo GrepMe > conftest.dir/file
877  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
878  rm -rf conftest.dir
879  if test -s conftest.tar; then
880    AM_RUN_LOG([$am__untar <conftest.tar])
881    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
882  fi
883done
884rm -rf conftest.dir
885
886AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
887AC_MSG_RESULT([$am_cv_prog_tar_$1])])
888AC_SUBST([am__tar])
889AC_SUBST([am__untar])
890]) # _AM_PROG_TAR
891
892dnl
893dnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
894dnl 
895dnl Permission is hereby granted, free of charge, to any person obtaining a
896dnl copy of this software and associated documentation files (the
897dnl "Software"), to deal in the Software without restriction, including
898dnl without limitation the rights to use, copy, modify, merge, publish,
899dnl distribute, and/or sell copies of the Software, and to permit persons
900dnl to whom the Software is furnished to do so, provided that the above
901dnl copyright notice(s) and this permission notice appear in all copies of
902dnl the Software and that both the above copyright notice(s) and this
903dnl permission notice appear in supporting documentation.
904dnl
905dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
906dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
907dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
908dnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
909dnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
910dnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
911dnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
912dnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
913dnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
914dnl
915dnl Except as contained in this notice, the name of a copyright holder
916dnl shall not be used in advertising or otherwise to promote the sale, use
917dnl or other dealings in this Software without prior written authorization
918dnl of the copyright holder.
919
920# XORG_MACROS_VERSION(required-version)
921# -------------------------------------
922# Minimum version: 1.1.0
923#
924# If you're using a macro added in Version 1.1 or newer, include this in
925# your configure.ac with the minimum required version, such as:
926# XORG_MACROS_VERSION(1.1)
927#
928# To force at least a version with this macro defined, also add:
929# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
930#
931#
932# See the "minimum version" comment for each macro you use to see what 
933# version you require.
934AC_DEFUN([XORG_MACROS_VERSION],[
935	[XORG_MACROS_needed_version=$1
936	XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
937	XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
938	AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
939	[XORG_MACROS_version=1.1.5
940	XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
941	XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
942	if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
943		AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x])
944	fi
945	if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
946		AC_MSG_ERROR([configure built with too old of a version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.${XORG_MACROS_minor}.0 or newer])
947	fi
948	AC_MSG_RESULT([yes, $XORG_MACROS_version])
949]) # XORG_MACROS_VERSION
950
951# XORG_PROG_RAWCPP()
952# ------------------
953# Minimum version: 1.0.0
954#
955# Find cpp program and necessary flags for use in pre-processing text files
956# such as man pages and config files
957AC_DEFUN([XORG_PROG_RAWCPP],[
958AC_REQUIRE([AC_PROG_CPP])
959AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
960   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
961
962# Check for flag to avoid builtin definitions - assumes unix is predefined,
963# which is not the best choice for supporting other OS'es, but covers most
964# of the ones we need for now.
965AC_MSG_CHECKING([if $RAWCPP requires -undef])
966AC_LANG_CONFTEST([Does cpp redefine unix ?])
967if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
968	AC_MSG_RESULT([no])
969else
970	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
971		RAWCPPFLAGS=-undef
972		AC_MSG_RESULT([yes])
973	else
974		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
975	fi
976fi
977rm -f conftest.$ac_ext
978
979AC_MSG_CHECKING([if $RAWCPP requires -traditional])
980AC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
981if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
982	AC_MSG_RESULT([no])
983else
984	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
985		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
986		AC_MSG_RESULT([yes])
987	else
988		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
989	fi
990fi
991rm -f conftest.$ac_ext
992AC_SUBST(RAWCPPFLAGS)
993]) # XORG_PROG_RAWCPP
994
995# XORG_MANPAGE_SECTIONS()
996# -----------------------
997# Minimum version: 1.0.0
998#
999# Determine which sections man pages go in for the different man page types
1000# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1001# Not sure if there's any better way than just hardcoding by OS name.
1002# Override default settings by setting environment variables
1003
1004AC_DEFUN([XORG_MANPAGE_SECTIONS],[
1005AC_REQUIRE([AC_CANONICAL_HOST])
1006
1007if test x$APP_MAN_SUFFIX = x    ; then
1008    APP_MAN_SUFFIX=1
1009fi
1010if test x$APP_MAN_DIR = x    ; then
1011    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1012fi
1013
1014if test x$LIB_MAN_SUFFIX = x    ; then
1015    LIB_MAN_SUFFIX=3
1016fi
1017if test x$LIB_MAN_DIR = x    ; then
1018    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1019fi
1020
1021if test x$FILE_MAN_SUFFIX = x    ; then
1022    case $host_os in
1023	solaris*)	FILE_MAN_SUFFIX=4  ;;
1024	*)		FILE_MAN_SUFFIX=5  ;;
1025    esac
1026fi
1027if test x$FILE_MAN_DIR = x    ; then
1028    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1029fi
1030
1031if test x$MISC_MAN_SUFFIX = x    ; then
1032    case $host_os in
1033	solaris*)	MISC_MAN_SUFFIX=5  ;;
1034	*)		MISC_MAN_SUFFIX=7  ;;
1035    esac
1036fi
1037if test x$MISC_MAN_DIR = x    ; then
1038    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1039fi
1040
1041if test x$DRIVER_MAN_SUFFIX = x    ; then
1042    case $host_os in
1043	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
1044	*)		DRIVER_MAN_SUFFIX=4  ;;
1045    esac
1046fi
1047if test x$DRIVER_MAN_DIR = x    ; then
1048    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1049fi
1050
1051if test x$ADMIN_MAN_SUFFIX = x    ; then
1052    case $host_os in
1053	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
1054	*)		ADMIN_MAN_SUFFIX=8  ;;
1055    esac
1056fi
1057if test x$ADMIN_MAN_DIR = x    ; then
1058    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1059fi
1060
1061
1062AC_SUBST([APP_MAN_SUFFIX])
1063AC_SUBST([LIB_MAN_SUFFIX])
1064AC_SUBST([FILE_MAN_SUFFIX])
1065AC_SUBST([MISC_MAN_SUFFIX])
1066AC_SUBST([DRIVER_MAN_SUFFIX])
1067AC_SUBST([ADMIN_MAN_SUFFIX])
1068AC_SUBST([APP_MAN_DIR])
1069AC_SUBST([LIB_MAN_DIR])
1070AC_SUBST([FILE_MAN_DIR])
1071AC_SUBST([MISC_MAN_DIR])
1072AC_SUBST([DRIVER_MAN_DIR])
1073AC_SUBST([ADMIN_MAN_DIR])
1074]) # XORG_MANPAGE_SECTIONS
1075
1076# XORG_CHECK_LINUXDOC
1077# -------------------
1078# Minimum version: 1.0.0
1079#
1080# Defines the variable MAKE_TEXT if the necessary tools and
1081# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1082# Whether or not the necessary tools and files are found can be checked
1083# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1084AC_DEFUN([XORG_CHECK_LINUXDOC],[
1085XORG_SGML_PATH=$prefix/share/sgml
1086HAVE_DEFS_ENT=
1087
1088AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1089
1090AC_PATH_PROG(LINUXDOC, linuxdoc)
1091AC_PATH_PROG(PS2PDF, ps2pdf)
1092
1093AC_MSG_CHECKING([Whether to build documentation])
1094
1095if test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
1096   BUILDDOC=yes
1097else
1098   BUILDDOC=no
1099fi
1100
1101AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1102
1103AC_MSG_RESULT([$BUILDDOC])
1104
1105AC_MSG_CHECKING([Whether to build pdf documentation])
1106
1107if test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
1108   BUILDPDFDOC=yes
1109else
1110   BUILDPDFDOC=no
1111fi
1112
1113AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1114
1115AC_MSG_RESULT([$BUILDPDFDOC])
1116
1117MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
1118MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1119MAKE_PDF="$PS2PDF"
1120MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1121
1122AC_SUBST(MAKE_TEXT)
1123AC_SUBST(MAKE_PS)
1124AC_SUBST(MAKE_PDF)
1125AC_SUBST(MAKE_HTML)
1126]) # XORG_CHECK_LINUXDOC
1127
1128# XORG_CHECK_DOCBOOK
1129# -------------------
1130# Minimum version: 1.0.0
1131#
1132# Checks for the ability to build output formats from SGML DocBook source.
1133# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1134# indicates whether the necessary tools and files are found and, if set,
1135# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1136AC_DEFUN([XORG_CHECK_DOCBOOK],[
1137XORG_SGML_PATH=$prefix/share/sgml
1138HAVE_DEFS_ENT=
1139BUILDTXTDOC=no
1140BUILDPDFDOC=no
1141BUILDPSDOC=no
1142BUILDHTMLDOC=no
1143
1144AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1145
1146AC_PATH_PROG(DOCBOOKPS, docbook2ps)
1147AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1148AC_PATH_PROG(DOCBOOKHTML, docbook2html)
1149AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1150
1151AC_MSG_CHECKING([Whether to build text documentation])
1152if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
1153   test x$BUILD_TXTDOC != xno; then
1154	BUILDTXTDOC=yes
1155fi
1156AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1157AC_MSG_RESULT([$BUILDTXTDOC])
1158
1159AC_MSG_CHECKING([Whether to build PDF documentation])
1160if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
1161   test x$BUILD_PDFDOC != xno; then
1162	BUILDPDFDOC=yes
1163fi
1164AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1165AC_MSG_RESULT([$BUILDPDFDOC])
1166
1167AC_MSG_CHECKING([Whether to build PostScript documentation])
1168if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
1169   test x$BUILD_PSDOC != xno; then
1170	BUILDPSDOC=yes
1171fi
1172AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1173AC_MSG_RESULT([$BUILDPSDOC])
1174
1175AC_MSG_CHECKING([Whether to build HTML documentation])
1176if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
1177   test x$BUILD_HTMLDOC != xno; then
1178	BUILDHTMLDOC=yes
1179fi
1180AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1181AC_MSG_RESULT([$BUILDHTMLDOC])
1182
1183MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1184MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1185MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1186MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1187
1188AC_SUBST(MAKE_TEXT)
1189AC_SUBST(MAKE_PS)
1190AC_SUBST(MAKE_PDF)
1191AC_SUBST(MAKE_HTML)
1192]) # XORG_CHECK_DOCBOOK
1193
1194# XORG_CHECK_MALLOC_ZERO
1195# ----------------------
1196# Minimum version: 1.0.0
1197#
1198# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1199# malloc(0) returns NULL.  Packages should add one of these cflags to
1200# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1201AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1202AC_ARG_ENABLE(malloc0returnsnull,
1203	AC_HELP_STRING([--enable-malloc0returnsnull],
1204		       [malloc(0) returns NULL (default: auto)]),
1205	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1206	[MALLOC_ZERO_RETURNS_NULL=auto])
1207
1208AC_MSG_CHECKING([whether malloc(0) returns NULL])
1209if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1210	AC_RUN_IFELSE([
1211char *malloc();
1212char *realloc();
1213char *calloc();
1214main() {
1215    char *m0, *r0, *c0, *p;
1216    m0 = malloc(0);
1217    p = malloc(10);
1218    r0 = realloc(p,0);
1219    c0 = calloc(0);
1220    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
1221}],
1222		[MALLOC_ZERO_RETURNS_NULL=yes],
1223		[MALLOC_ZERO_RETURNS_NULL=no])
1224fi
1225AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1226
1227if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1228	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1229	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1230	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1231else
1232	MALLOC_ZERO_CFLAGS=""
1233	XMALLOC_ZERO_CFLAGS=""
1234	XTMALLOC_ZERO_CFLAGS=""
1235fi
1236
1237AC_SUBST([MALLOC_ZERO_CFLAGS])
1238AC_SUBST([XMALLOC_ZERO_CFLAGS])
1239AC_SUBST([XTMALLOC_ZERO_CFLAGS])
1240]) # XORG_CHECK_MALLOC_ZERO
1241
1242# XORG_WITH_LINT()
1243# ----------------
1244# Minimum version: 1.1.0
1245#
1246# Sets up flags for source checkers such as lint and sparse if --with-lint
1247# is specified.   (Use --with-lint=sparse for sparse.)
1248# Sets $LINT to name of source checker passed with --with-lint (default: lint)
1249# Sets $LINT_FLAGS to flags to pass to source checker
1250# Sets LINT automake conditional if enabled (default: disabled)
1251#
1252AC_DEFUN([XORG_WITH_LINT],[
1253
1254# Allow checking code with lint, sparse, etc.
1255AC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
1256		[Use a lint-style source code checker (default: disabled)])],
1257		[use_lint=$withval], [use_lint=no])
1258if test "x$use_lint" = "xyes" ; then
1259	LINT="lint"
1260else
1261	LINT="$use_lint"
1262fi
1263if test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
1264    case $LINT in
1265	lint|*/lint)
1266	    case $host_os in
1267		solaris*)
1268			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1269			;;
1270	    esac
1271	    ;;
1272    esac
1273fi
1274
1275AC_SUBST(LINT)
1276AC_SUBST(LINT_FLAGS)
1277AM_CONDITIONAL(LINT, [test x$LINT != xno])
1278
1279]) # XORG_WITH_LINT
1280
1281# XORG_LINT_LIBRARY(LIBNAME)
1282# --------------------------
1283# Minimum version: 1.1.0
1284#
1285# Sets up flags for building lint libraries for checking programs that call
1286# functions in the library.
1287# Disabled by default, enable with --enable-lint-library
1288# Sets: 
1289#	@LINTLIB@		- name of lint library file to make
1290#	MAKE_LINT_LIB		- automake conditional
1291#
1292
1293AC_DEFUN([XORG_LINT_LIBRARY],[
1294AC_REQUIRE([XORG_WITH_LINT])
1295# Build lint "library" for more indepth checks of programs calling this library
1296AC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
1297	[Create lint library (default: disabled)])],
1298	[make_lint_lib=$enableval], [make_lint_lib=no])
1299if test "x$make_lint_lib" != "xno" ; then
1300	if test "x$LINT" = "xno" ; then
1301		AC_MSG_ERROR([Cannot make lint library without --with-lint])
1302	fi
1303	if test "x$make_lint_lib" = "xyes" ; then
1304		LINTLIB=llib-l$1.ln
1305	else
1306		LINTLIB=$make_lint_lib
1307	fi
1308fi
1309AC_SUBST(LINTLIB)
1310AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1311
1312]) # XORG_LINT_LIBRARY
1313
1314dnl Copyright 2005 Red Hat, Inc
1315dnl
1316dnl Permission to use, copy, modify, distribute, and sell this software and its
1317dnl documentation for any purpose is hereby granted without fee, provided that
1318dnl the above copyright notice appear in all copies and that both that
1319dnl copyright notice and this permission notice appear in supporting
1320dnl documentation.
1321dnl
1322dnl The above copyright notice and this permission notice shall be included
1323dnl in all copies or substantial portions of the Software.
1324dnl
1325dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1326dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1327dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1328dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1329dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1330dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1331dnl OTHER DEALINGS IN THE SOFTWARE.
1332dnl
1333dnl Except as contained in this notice, the name of the copyright holders shall
1334dnl not be used in advertising or otherwise to promote the sale, use or
1335dnl other dealings in this Software without prior written authorization
1336dnl from the copyright holders.
1337dnl
1338
1339# XORG_RELEASE_VERSION
1340# --------------------
1341# Adds --with/without-release-string and changes the PACKAGE and
1342# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
1343# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
1344# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1345 
1346AC_DEFUN([XORG_RELEASE_VERSION],[
1347	AC_ARG_WITH(release-version,
1348			AC_HELP_STRING([--with-release-version=STRING],
1349				[Use release version string in package name]),
1350			[RELEASE_VERSION="$withval"],
1351			[RELEASE_VERSION=""])
1352	if test "x$RELEASE_VERSION" != "x"; then
1353		PACKAGE="$PACKAGE-$RELEASE_VERSION"
1354		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
1355		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
1356	fi
1357	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1358		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
1359		[Major version of this package])
1360	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2`
1361	if test "x$PVM" = "x"; then
1362		PVM="0"
1363	fi
1364	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
1365		[$PVM],
1366		[Minor version of this package])
1367	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3`
1368	if test "x$PVP" = "x"; then
1369		PVP="0"
1370	fi
1371	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1372		[$PVP],
1373		[Patch version of this package])
1374])
1375
1376# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
1377# 
1378# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1379#
1380# This program is free software; you can redistribute it and/or modify
1381# it under the terms of the GNU General Public License as published by
1382# the Free Software Foundation; either version 2 of the License, or
1383# (at your option) any later version.
1384#
1385# This program is distributed in the hope that it will be useful, but
1386# WITHOUT ANY WARRANTY; without even the implied warranty of
1387# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1388# General Public License for more details.
1389#
1390# You should have received a copy of the GNU General Public License
1391# along with this program; if not, write to the Free Software
1392# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1393#
1394# As a special exception to the GNU General Public License, if you
1395# distribute this file as part of a program that contains a
1396# configuration script generated by Autoconf, you may include it under
1397# the same distribution terms that you use for the rest of that program.
1398
1399# PKG_PROG_PKG_CONFIG([MIN-VERSION])
1400# ----------------------------------
1401AC_DEFUN([PKG_PROG_PKG_CONFIG],
1402[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1403m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
1404AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
1405if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1406	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1407fi
1408if test -n "$PKG_CONFIG"; then
1409	_pkg_min_version=m4_ifval([$1], [$1], [0.9.0])
1410	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1411	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1412		AC_MSG_RESULT([yes])
1413	else
1414		AC_MSG_RESULT([no])
1415		PKG_CONFIG=""
1416	fi
1417		
1418fi[]dnl
1419])# PKG_PROG_PKG_CONFIG
1420
1421# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1422#
1423# Check to see whether a particular set of modules exists.  Similar
1424# to PKG_CHECK_MODULES(), but does not set variables or print errors.
1425#
1426#
1427# Similar to PKG_CHECK_MODULES, make sure that the first instance of
1428# this or PKG_CHECK_MODULES is called, or make sure to call
1429# PKG_CHECK_EXISTS manually
1430# --------------------------------------------------------------
1431AC_DEFUN([PKG_CHECK_EXISTS],
1432[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1433if test -n "$PKG_CONFIG" && \
1434    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1435  m4_ifval([$2], [$2], [:])
1436m4_ifvaln([$3], [else
1437  $3])dnl
1438fi])
1439
1440
1441# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1442# ---------------------------------------------
1443m4_define([_PKG_CONFIG],
1444[if test -n "$PKG_CONFIG"; then
1445        PKG_CHECK_EXISTS([$3],
1446                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
1447			 [pkg_failed=yes])
1448else
1449	pkg_failed=untried
1450fi[]dnl
1451])# _PKG_CONFIG
1452
1453# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1454# [ACTION-IF-NOT-FOUND])
1455#
1456#
1457# Note that if there is a possibility the first call to
1458# PKG_CHECK_MODULES might not happen, you should be sure to include an
1459# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1460#
1461#
1462# --------------------------------------------------------------
1463AC_DEFUN([PKG_CHECK_MODULES],
1464[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1465AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1466AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1467
1468pkg_failed=no
1469AC_MSG_CHECKING([for $1])
1470
1471_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1472_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1473
1474if test $pkg_failed = yes; then
1475	$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
1476	# Put the nasty error message in config.log where it belongs
1477	echo "$$1[]_PKG_ERRORS" 1>&AS_MESSAGE_LOG_FD
1478
1479	ifelse([$4], , [AC_MSG_ERROR(dnl
1480[Package requirements ($2) were not met.
1481Consider adjusting the PKG_CONFIG_PATH environment variable if you
1482installed software in a non-standard prefix.
1483
1484Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables
1485to avoid the need to call pkg-config.  See the pkg-config man page for
1486more details.])],
1487		[$4])
1488elif test $pkg_failed = untried; then
1489	ifelse([$4], , [AC_MSG_FAILURE(dnl
1490[The pkg-config script could not be found or is too old.  Make sure it
1491is in your PATH or set the PKG_CONFIG environment variable to the full
1492path to pkg-config.
1493
1494Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables
1495to avoid the need to call pkg-config.  See the pkg-config man page for
1496more details.
1497
1498To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
1499		[$4])
1500else
1501	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1502	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1503        AC_MSG_RESULT([yes])
1504	ifelse([$3], , :, [$3])
1505fi[]dnl
1506])# PKG_CHECK_MODULES
1507
1508