1 # generated automatically by aclocal 1.11.2 -*- Autoconf -*-
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
6 # This file is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
15 m4_ifndef([AC_AUTOCONF_VERSION],
16 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17 m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
18 [m4_warning([this file was generated for autoconf 2.68.
19 You have another version of autoconf. It may work, but is not guaranteed to.
20 If you have problems, you may need to regenerate the build system entirely.
21 To do so, use the procedure documented by the package, typically `autoreconf'.])])
23 # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
26 # This file is free software; the Free Software Foundation
27 # gives unlimited permission to copy and/or distribute it,
28 # with or without modifications, as long as this notice is preserved.
32 # AM_AUTOMAKE_VERSION(VERSION)
33 # ----------------------------
34 # Automake X.Y traces this macro to ensure aclocal.m4 has been
35 # generated from the m4 files accompanying Automake X.Y.
36 # (This private macro should not be called outside this file.)
37 AC_DEFUN([AM_AUTOMAKE_VERSION],
38 [am__api_version='1.11'
39 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
40 dnl require some minimum version. Point them to the right macro.
41 m4_if([$1], [1.11.2], [],
42 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
45 # _AM_AUTOCONF_VERSION(VERSION)
46 # -----------------------------
47 # aclocal traces this macro to find the Autoconf version.
48 # This is a private macro too. Using m4_define simplifies
49 # the logic in aclocal, which can simply ignore this definition.
50 m4_define([_AM_AUTOCONF_VERSION], [])
52 # AM_SET_CURRENT_AUTOMAKE_VERSION
53 # -------------------------------
54 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
55 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
56 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
57 [AM_AUTOMAKE_VERSION([1.11.2])dnl
58 m4_ifndef([AC_AUTOCONF_VERSION],
59 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
60 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
62 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
64 # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
66 # This file is free software; the Free Software Foundation
67 # gives unlimited permission to copy and/or distribute it,
68 # with or without modifications, as long as this notice is preserved.
72 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
73 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
74 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
76 # Of course, Automake must honor this variable whenever it calls a
77 # tool from the auxiliary directory. The problem is that $srcdir (and
78 # therefore $ac_aux_dir as well) can be either absolute or relative,
79 # depending on how configure is run. This is pretty annoying, since
80 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
81 # source directory, any form will work fine, but in subdirectories a
82 # relative path needs to be adjusted first.
85 # fails when called from a subdirectory if $ac_aux_dir is relative
86 # $top_srcdir/$ac_aux_dir/missing
87 # fails if $ac_aux_dir is absolute,
88 # fails when called from a subdirectory in a VPATH build with
89 # a relative $ac_aux_dir
91 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
92 # are both prefixed by $srcdir. In an in-source build this is usually
93 # harmless because $srcdir is `.', but things will broke when you
94 # start a VPATH build or use an absolute $srcdir.
96 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
97 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
98 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
99 # and then we would define $MISSING as
100 # MISSING="\${SHELL} $am_aux_dir/missing"
101 # This will work as long as MISSING is not called from configure, because
102 # unfortunately $(top_srcdir) has no meaning in configure.
103 # However there are other variables, like CC, which are often used in
104 # configure, and could therefore not use this "fixed" $ac_aux_dir.
106 # Another solution, used here, is to always expand $ac_aux_dir to an
107 # absolute PATH. The drawback is that using absolute paths prevent a
108 # configured tree to be moved without reconfiguration.
110 AC_DEFUN([AM_AUX_DIR_EXPAND],
111 [dnl Rely on autoconf to set up CDPATH properly.
113 # expand $ac_aux_dir to an absolute path
114 am_aux_dir=`cd $ac_aux_dir && pwd`
117 # AM_CONDITIONAL -*- Autoconf -*-
119 # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
120 # Free Software Foundation, Inc.
122 # This file is free software; the Free Software Foundation
123 # gives unlimited permission to copy and/or distribute it,
124 # with or without modifications, as long as this notice is preserved.
128 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
129 # -------------------------------------
130 # Define a conditional.
131 AC_DEFUN([AM_CONDITIONAL],
133 ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
134 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
135 AC_SUBST([$1_TRUE])dnl
136 AC_SUBST([$1_FALSE])dnl
137 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
138 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
139 m4_define([_AM_COND_VALUE_$1], [$2])dnl
147 AC_CONFIG_COMMANDS_PRE(
148 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
149 AC_MSG_ERROR([[conditional "$1" was never defined.
150 Usually this means the macro was only invoked conditionally.]])
153 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
154 # 2010, 2011 Free Software Foundation, Inc.
156 # This file is free software; the Free Software Foundation
157 # gives unlimited permission to copy and/or distribute it,
158 # with or without modifications, as long as this notice is preserved.
162 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
163 # written in clear, in which case automake, when reading aclocal.m4,
164 # will think it sees a *use*, and therefore will trigger all it's
165 # C support machinery. Also note that it means that autoscan, seeing
166 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
169 # _AM_DEPENDENCIES(NAME)
170 # ----------------------
171 # See how the compiler implements dependency checking.
172 # NAME is "CC", "CXX", "GCJ", or "OBJC".
173 # We try a few techniques and use that to set a single cache variable.
175 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
176 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
177 # dependency, and given that the user is not expected to run this macro,
178 # just rely on AC_PROG_CC.
179 AC_DEFUN([_AM_DEPENDENCIES],
180 [AC_REQUIRE([AM_SET_DEPDIR])dnl
181 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
182 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
183 AC_REQUIRE([AM_DEP_TRACK])dnl
185 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
186 [$1], CXX, [depcc="$CXX" am_compiler_list=],
187 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
188 [$1], UPC, [depcc="$UPC" am_compiler_list=],
189 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
190 [depcc="$$1" am_compiler_list=])
192 AC_CACHE_CHECK([dependency style of $depcc],
193 [am_cv_$1_dependencies_compiler_type],
194 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
195 # We make a subdir and do the tests there. Otherwise we can end up
196 # making bogus files that we don't know about and never remove. For
197 # instance it was reported that on HP-UX the gcc test will end up
198 # making a dummy file named `D' -- because `-MD' means `put the output
202 # Copy depcomp to subdir because otherwise we won't find it if we're
203 # using a relative directory.
204 cp "$am_depcomp" conftest.dir
206 # We will build objects and dependencies in a subdirectory because
207 # it helps to detect inapplicable dependency modes. For instance
208 # both Tru64's cc and ICC support -MD to output dependencies as a
209 # side effect of compilation, but ICC will put the dependencies in
210 # the current directory while Tru64 will put them in the object
214 am_cv_$1_dependencies_compiler_type=none
215 if test "$am_compiler_list" = ""; then
216 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
220 [case " $depcc " in #(
221 *\ -arch\ *\ -arch\ *) am__universal=true ;;
224 [case " $depcc " in #(
225 *\ -arch\ *\ -arch\ *) am__universal=true ;;
228 for depmode in $am_compiler_list; do
229 # Setup a source with many dependencies, because some compilers
230 # like to wrap large dependency lists on column 80 (with \), and
231 # we should not choose a depcomp mode which is confused by this.
233 # We need to recreate these files for each test, as the compiler may
234 # overwrite some of them when testing with obscure command lines.
235 # This happens at least with the AIX C compiler.
237 for i in 1 2 3 4 5 6; do
238 echo '#include "conftst'$i'.h"' >> sub/conftest.c
239 # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
240 # Solaris 8's {/usr,}/bin/sh.
241 touch sub/conftst$i.h
243 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
245 # We check with `-c' and `-o' for the sake of the "dashmstdout"
246 # mode. It turns out that the SunPro C++ compiler does not properly
247 # handle `-M -o', and we need to detect this. Also, some Intel
248 # versions had trouble with output in subdirs
249 am__obj=sub/conftest.${OBJEXT-o}
250 am__minus_obj="-o $am__obj"
253 # This depmode causes a compiler race in universal mode.
254 test "$am__universal" = false || continue
257 # after this tag, mechanisms are not by side-effect, so they'll
258 # only be used when explicitly requested
259 if test "x$enable_dependency_tracking" = xyes; then
265 msvc7 | msvc7msys | msvisualcpp | msvcmsys)
266 # This compiler won't grok `-c -o', but also, the minuso test has
267 # not run yet. These depmodes are late enough in the game, and
268 # so weak that their functioning should not be impacted.
269 am__obj=conftest.${OBJEXT-o}
274 if depmode=$depmode \
275 source=sub/conftest.c object=$am__obj \
276 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
277 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
278 >/dev/null 2>conftest.err &&
279 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
280 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
281 grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
282 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
283 # icc doesn't choke on unknown options, it will just issue warnings
284 # or remarks (even with -Werror). So we grep stderr for any message
285 # that says an option was ignored or not supported.
286 # When given -MP, icc 7.0 and 7.1 complain thusly:
287 # icc: Command line warning: ignoring option '-M'; no argument required
288 # The diagnosis changed in icc 8.0:
289 # icc: Command line remark: option '-MP' not supported
290 if (grep 'ignoring option' conftest.err ||
291 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
292 am_cv_$1_dependencies_compiler_type=$depmode
301 am_cv_$1_dependencies_compiler_type=none
304 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
305 AM_CONDITIONAL([am__fastdep$1], [
306 test "x$enable_dependency_tracking" != xno \
307 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
313 # Choose a directory name for dependency files.
314 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
315 AC_DEFUN([AM_SET_DEPDIR],
316 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
317 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
323 AC_DEFUN([AM_DEP_TRACK],
324 [AC_ARG_ENABLE(dependency-tracking,
325 [ --disable-dependency-tracking speeds up one-time build
326 --enable-dependency-tracking do not reject slow dependency extractors])
327 if test "x$enable_dependency_tracking" != xno; then
328 am_depcomp="$ac_aux_dir/depcomp"
332 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
333 AC_SUBST([AMDEPBACKSLASH])dnl
334 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
335 AC_SUBST([am__nodep])dnl
336 _AM_SUBST_NOTMAKE([am__nodep])dnl
339 # Generate code to set up dependency tracking. -*- Autoconf -*-
341 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
342 # Free Software Foundation, Inc.
344 # This file is free software; the Free Software Foundation
345 # gives unlimited permission to copy and/or distribute it,
346 # with or without modifications, as long as this notice is preserved.
350 # _AM_OUTPUT_DEPENDENCY_COMMANDS
351 # ------------------------------
352 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
354 # Autoconf 2.62 quotes --file arguments for eval, but not when files
355 # are listed without --file. Let's play safe and only enable the eval
356 # if we detect the quoting.
357 case $CONFIG_FILES in
358 *\'*) eval set x "$CONFIG_FILES" ;;
359 *) set x $CONFIG_FILES ;;
364 # Strip MF so we end up with the name of the file.
365 mf=`echo "$mf" | sed -e 's/:.*$//'`
366 # Check whether this is an Automake generated Makefile or not.
367 # We used to match only the files named `Makefile.in', but
368 # some people rename them; so instead we look at the file content.
369 # Grep'ing the first line is not enough: some people post-process
370 # each Makefile.in and add a new line on top of each file to say so.
371 # Grep'ing the whole file is not good either: AIX grep has a line
372 # limit of 2048, but all sed's we know have understand at least 4000.
373 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
374 dirpart=`AS_DIRNAME("$mf")`
378 # Extract the definition of DEPDIR, am__include, and am__quote
379 # from the Makefile without running `make'.
380 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
381 test -z "$DEPDIR" && continue
382 am__include=`sed -n 's/^am__include = //p' < "$mf"`
383 test -z "am__include" && continue
384 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
385 # When using ansi2knr, U may be empty or an underscore; expand it
386 U=`sed -n 's/^U = //p' < "$mf"`
387 # Find all dependency output files, they are included files with
388 # $(DEPDIR) in their names. We invoke sed twice because it is the
389 # simplest approach to changing $(DEPDIR) to its actual value in the
391 for file in `sed -n "
392 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
393 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
394 # Make sure the directory exists.
395 test -f "$dirpart/$file" && continue
396 fdir=`AS_DIRNAME(["$file"])`
397 AS_MKDIR_P([$dirpart/$fdir])
398 # echo "creating $dirpart/$file"
399 echo '# dummy' > "$dirpart/$file"
403 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
406 # AM_OUTPUT_DEPENDENCY_COMMANDS
407 # -----------------------------
408 # This macro should only be invoked once -- use via AC_REQUIRE.
410 # This code is only required when automatic dependency tracking
411 # is enabled. FIXME. This creates each `.P' file that we will
412 # need in order to bootstrap the dependency handling code.
413 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
414 [AC_CONFIG_COMMANDS([depfiles],
415 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
416 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
419 # Do all the work for Automake. -*- Autoconf -*-
421 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
422 # 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
424 # This file is free software; the Free Software Foundation
425 # gives unlimited permission to copy and/or distribute it,
426 # with or without modifications, as long as this notice is preserved.
430 # This macro actually does too much. Some checks are only needed if
431 # your package does certain things. But this isn't really a big deal.
433 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
434 # AM_INIT_AUTOMAKE([OPTIONS])
435 # -----------------------------------------------
436 # The call with PACKAGE and VERSION arguments is the old style
437 # call (pre autoconf-2.50), which is being phased out. PACKAGE
438 # and VERSION should now be passed to AC_INIT and removed from
439 # the call to AM_INIT_AUTOMAKE.
440 # We support both call styles for the transition. After
441 # the next Automake release, Autoconf can make the AC_INIT
442 # arguments mandatory, and then we can depend on a new Autoconf
443 # release and drop the old call support.
444 AC_DEFUN([AM_INIT_AUTOMAKE],
445 [AC_PREREQ([2.62])dnl
446 dnl Autoconf wants to disallow AM_ names. We explicitly allow
447 dnl the ones we care about.
448 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
449 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
450 AC_REQUIRE([AC_PROG_INSTALL])dnl
451 if test "`cd $srcdir && pwd`" != "`pwd`"; then
452 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
453 # is not polluted with repeated "-I."
454 AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
455 # test to see if srcdir already configured
456 if test -f $srcdir/config.status; then
457 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
461 # test whether we have cygpath
462 if test -z "$CYGPATH_W"; then
463 if (cygpath --version) >/dev/null 2>/dev/null; then
464 CYGPATH_W='cygpath -w'
469 AC_SUBST([CYGPATH_W])
471 # Define the identity of the package.
472 dnl Distinguish between old-style and new-style calls.
474 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
475 AC_SUBST([PACKAGE], [$1])dnl
476 AC_SUBST([VERSION], [$2])],
477 [_AM_SET_OPTIONS([$1])dnl
478 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
479 m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
480 [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
481 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
482 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
484 _AM_IF_OPTION([no-define],,
485 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
486 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
488 # Some tools Automake needs.
489 AC_REQUIRE([AM_SANITY_CHECK])dnl
490 AC_REQUIRE([AC_ARG_PROGRAM])dnl
491 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
492 AM_MISSING_PROG(AUTOCONF, autoconf)
493 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
494 AM_MISSING_PROG(AUTOHEADER, autoheader)
495 AM_MISSING_PROG(MAKEINFO, makeinfo)
496 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
497 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
498 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
499 # We need awk for the "check" target. The system "awk" is bad on
501 AC_REQUIRE([AC_PROG_AWK])dnl
502 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
503 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
504 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
505 [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
506 [_AM_PROG_TAR([v7])])])
507 _AM_IF_OPTION([no-dependencies],,
508 [AC_PROVIDE_IFELSE([AC_PROG_CC],
509 [_AM_DEPENDENCIES(CC)],
510 [define([AC_PROG_CC],
511 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
512 AC_PROVIDE_IFELSE([AC_PROG_CXX],
513 [_AM_DEPENDENCIES(CXX)],
514 [define([AC_PROG_CXX],
515 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
516 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
517 [_AM_DEPENDENCIES(OBJC)],
518 [define([AC_PROG_OBJC],
519 defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
521 _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
522 dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
523 dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
524 dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
525 AC_CONFIG_COMMANDS_PRE(dnl
526 [m4_provide_if([_AM_COMPILER_EXEEXT],
527 [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
530 dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
531 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
532 dnl mangled by Autoconf and run in a shell conditional statement.
533 m4_define([_AC_COMPILER_EXEEXT],
534 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
537 # When config.status generates a header, we must update the stamp-h file.
538 # This file resides in the same directory as the config header
539 # that is generated. The stamp files are numbered to have different names.
541 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
542 # loop where config.status creates the headers, so we can generate
543 # our stamp files there.
544 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
545 [# Compute $1's index in $config_headers.
548 for _am_header in $config_headers :; do
550 $_am_arg | $_am_arg:* )
553 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
556 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
558 # Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
561 # This file is free software; the Free Software Foundation
562 # gives unlimited permission to copy and/or distribute it,
563 # with or without modifications, as long as this notice is preserved.
569 # Define $install_sh.
570 AC_DEFUN([AM_PROG_INSTALL_SH],
571 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
572 if test x"${install_sh}" != xset; then
575 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
577 install_sh="\${SHELL} $am_aux_dir/install-sh"
580 AC_SUBST(install_sh)])
582 # Copyright (C) 2003, 2005 Free Software Foundation, Inc.
584 # This file is free software; the Free Software Foundation
585 # gives unlimited permission to copy and/or distribute it,
586 # with or without modifications, as long as this notice is preserved.
590 # Check whether the underlying file-system supports filenames
591 # with a leading dot. For instance MS-DOS doesn't.
592 AC_DEFUN([AM_SET_LEADING_DOT],
593 [rm -rf .tst 2>/dev/null
594 mkdir .tst 2>/dev/null
595 if test -d .tst; then
600 rmdir .tst 2>/dev/null
601 AC_SUBST([am__leading_dot])])
603 # Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
606 # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008,
607 # 2011 Free Software Foundation, Inc.
609 # This file is free software; the Free Software Foundation
610 # gives unlimited permission to copy and/or distribute it,
611 # with or without modifications, as long as this notice is preserved.
615 # AM_MAINTAINER_MODE([DEFAULT-MODE])
616 # ----------------------------------
617 # Control maintainer-specific portions of Makefiles.
618 # Default is to disable them, unless `enable' is passed literally.
619 # For symmetry, `disable' may be passed as well. Anyway, the user
620 # can override the default with the --enable/--disable switch.
621 AC_DEFUN([AM_MAINTAINER_MODE],
622 [m4_case(m4_default([$1], [disable]),
623 [enable], [m4_define([am_maintainer_other], [disable])],
624 [disable], [m4_define([am_maintainer_other], [enable])],
625 [m4_define([am_maintainer_other], [enable])
626 m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
627 AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
628 dnl maintainer-mode's default is 'disable' unless 'enable' is passed
629 AC_ARG_ENABLE([maintainer-mode],
630 [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful
631 (and sometimes confusing) to the casual installer],
632 [USE_MAINTAINER_MODE=$enableval],
633 [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
634 AC_MSG_RESULT([$USE_MAINTAINER_MODE])
635 AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
636 MAINT=$MAINTAINER_MODE_TRUE
641 AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
643 # Check to see how 'make' treats includes. -*- Autoconf -*-
645 # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
647 # This file is free software; the Free Software Foundation
648 # gives unlimited permission to copy and/or distribute it,
649 # with or without modifications, as long as this notice is preserved.
655 # Check to see how make treats includes.
656 AC_DEFUN([AM_MAKE_INCLUDE],
657 [am_make=${MAKE-make}
658 cat > confinc << 'END'
660 @echo this is the am__doit target
663 # If we don't find an include directive, just comment out the code.
664 AC_MSG_CHECKING([for style of include used by $am_make])
668 # First try GNU make style include.
669 echo "include confinc" > confmf
670 # Ignore all kinds of additional output from `make'.
671 case `$am_make -s -f confmf 2> /dev/null` in #(
672 *the\ am__doit\ target*)
678 # Now try BSD make style include.
679 if test "$am__include" = "#"; then
680 echo '.include "confinc"' > confmf
681 case `$am_make -s -f confmf 2> /dev/null` in #(
682 *the\ am__doit\ target*)
689 AC_SUBST([am__include])
690 AC_SUBST([am__quote])
691 AC_MSG_RESULT([$_am_result])
695 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
697 # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
698 # Free Software Foundation, Inc.
700 # This file is free software; the Free Software Foundation
701 # gives unlimited permission to copy and/or distribute it,
702 # with or without modifications, as long as this notice is preserved.
706 # AM_MISSING_PROG(NAME, PROGRAM)
707 # ------------------------------
708 AC_DEFUN([AM_MISSING_PROG],
709 [AC_REQUIRE([AM_MISSING_HAS_RUN])
710 $1=${$1-"${am_missing_run}$2"}
716 # Define MISSING if not defined so far and test if it supports --run.
717 # If it does, set am_missing_run to use it, otherwise, to nothing.
718 AC_DEFUN([AM_MISSING_HAS_RUN],
719 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
720 AC_REQUIRE_AUX_FILE([missing])dnl
721 if test x"${MISSING+set}" != xset; then
724 MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
726 MISSING="\${SHELL} $am_aux_dir/missing" ;;
729 # Use eval to expand $SHELL
730 if eval "$MISSING --run true"; then
731 am_missing_run="$MISSING --run "
734 AC_MSG_WARN([`missing' script is too old or missing])
738 # Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
741 # This file is free software; the Free Software Foundation
742 # gives unlimited permission to copy and/or distribute it,
743 # with or without modifications, as long as this notice is preserved.
749 # Check for `mkdir -p'.
750 AC_DEFUN([AM_PROG_MKDIR_P],
751 [AC_PREREQ([2.60])dnl
752 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
753 dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
754 dnl while keeping a definition of mkdir_p for backward compatibility.
755 dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
756 dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
757 dnl Makefile.ins that do not define MKDIR_P, so we do our own
758 dnl adjustment using top_builddir (which is defined more often than
760 AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
762 [[\\/$]]* | ?:[[\\/]]*) ;;
763 */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
767 # Helper functions for option handling. -*- Autoconf -*-
769 # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
772 # This file is free software; the Free Software Foundation
773 # gives unlimited permission to copy and/or distribute it,
774 # with or without modifications, as long as this notice is preserved.
778 # _AM_MANGLE_OPTION(NAME)
779 # -----------------------
780 AC_DEFUN([_AM_MANGLE_OPTION],
781 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
783 # _AM_SET_OPTION(NAME)
784 # --------------------
785 # Set option NAME. Presently that only means defining a flag for this option.
786 AC_DEFUN([_AM_SET_OPTION],
787 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
789 # _AM_SET_OPTIONS(OPTIONS)
790 # ------------------------
791 # OPTIONS is a space-separated list of Automake options.
792 AC_DEFUN([_AM_SET_OPTIONS],
793 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
795 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
796 # -------------------------------------------
797 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
798 AC_DEFUN([_AM_IF_OPTION],
799 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
801 # Check to make sure that the build environment is sane. -*- Autoconf -*-
803 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
804 # Free Software Foundation, Inc.
806 # This file is free software; the Free Software Foundation
807 # gives unlimited permission to copy and/or distribute it,
808 # with or without modifications, as long as this notice is preserved.
814 AC_DEFUN([AM_SANITY_CHECK],
815 [AC_MSG_CHECKING([whether build environment is sane])
818 echo timestamp > conftest.file
819 # Reject unsafe characters in $srcdir or the absolute working directory
820 # name. Accept space and tab only in the latter.
824 *[[\\\"\#\$\&\'\`$am_lf]]*)
825 AC_MSG_ERROR([unsafe absolute working directory name]);;
828 *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
829 AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
832 # Do `set' in a subshell so we don't clobber the current shell's
833 # arguments. Must try -L first in case configure is actually a
834 # symlink; some systems play weird games with the mod time of symlinks
835 # (eg FreeBSD returns the mod time of the symlink's containing
838 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
839 if test "$[*]" = "X"; then
841 set X `ls -t "$srcdir/configure" conftest.file`
844 if test "$[*]" != "X $srcdir/configure conftest.file" \
845 && test "$[*]" != "X conftest.file $srcdir/configure"; then
847 # If neither matched, then we have a broken ls. This can happen
848 # if, for instance, CONFIG_SHELL is bash and it inherits a
849 # broken ls alias from the environment. This has actually
850 # happened. Such a system could not be considered "sane".
851 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
852 alias in your environment])
855 test "$[2]" = conftest.file
861 AC_MSG_ERROR([newly created file is older than distributed files!
862 Check your system clock])
866 # Copyright (C) 2009 Free Software Foundation, Inc.
868 # This file is free software; the Free Software Foundation
869 # gives unlimited permission to copy and/or distribute it,
870 # with or without modifications, as long as this notice is preserved.
874 # AM_SILENT_RULES([DEFAULT])
875 # --------------------------
876 # Enable less verbose build rules; with the default set to DEFAULT
877 # (`yes' being less verbose, `no' or empty being verbose).
878 AC_DEFUN([AM_SILENT_RULES],
879 [AC_ARG_ENABLE([silent-rules],
880 [ --enable-silent-rules less verbose build output (undo: `make V=1')
881 --disable-silent-rules verbose build output (undo: `make V=0')])
882 case $enable_silent_rules in
883 yes) AM_DEFAULT_VERBOSITY=0;;
884 no) AM_DEFAULT_VERBOSITY=1;;
885 *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
887 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
889 AC_SUBST([AM_BACKSLASH])dnl
890 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
893 # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
895 # This file is free software; the Free Software Foundation
896 # gives unlimited permission to copy and/or distribute it,
897 # with or without modifications, as long as this notice is preserved.
901 # AM_PROG_INSTALL_STRIP
902 # ---------------------
903 # One issue with vendor `install' (even GNU) is that you can't
904 # specify the program used to strip binaries. This is especially
905 # annoying in cross-compiling environments, where the build's strip
906 # is unlikely to handle the host's binaries.
907 # Fortunately install-sh will honor a STRIPPROG variable, so we
908 # always use install-sh in `make install-strip', and initialize
909 # STRIPPROG with the value of the STRIP variable (set by the user).
910 AC_DEFUN([AM_PROG_INSTALL_STRIP],
911 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
912 # Installed binaries are usually stripped using `strip' when the user
913 # run `make install-strip'. However `strip' might not be the right
914 # tool to use in cross-compilation environments, therefore Automake
915 # will honor the `STRIP' environment variable to overrule this program.
916 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
917 if test "$cross_compiling" != no; then
918 AC_CHECK_TOOL([STRIP], [strip], :)
920 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
921 AC_SUBST([INSTALL_STRIP_PROGRAM])])
923 # Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
925 # This file is free software; the Free Software Foundation
926 # gives unlimited permission to copy and/or distribute it,
927 # with or without modifications, as long as this notice is preserved.
931 # _AM_SUBST_NOTMAKE(VARIABLE)
932 # ---------------------------
933 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
934 # This macro is traced by Automake.
935 AC_DEFUN([_AM_SUBST_NOTMAKE])
937 # AM_SUBST_NOTMAKE(VARIABLE)
938 # --------------------------
939 # Public sister of _AM_SUBST_NOTMAKE.
940 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
942 # Check how to create a tarball. -*- Autoconf -*-
944 # Copyright (C) 2004, 2005 Free Software Foundation, Inc.
946 # This file is free software; the Free Software Foundation
947 # gives unlimited permission to copy and/or distribute it,
948 # with or without modifications, as long as this notice is preserved.
952 # _AM_PROG_TAR(FORMAT)
953 # --------------------
954 # Check how to create a tarball in format FORMAT.
955 # FORMAT should be one of `v7', `ustar', or `pax'.
957 # Substitute a variable $(am__tar) that is a command
958 # writing to stdout a FORMAT-tarball containing the directory
960 # tardir=directory && $(am__tar) > result.tar
962 # Substitute a variable $(am__untar) that extract such
963 # a tarball read from stdin.
964 # $(am__untar) < result.tar
965 AC_DEFUN([_AM_PROG_TAR],
966 [# Always define AMTAR for backward compatibility.
967 AM_MISSING_PROG([AMTAR], [tar])
969 [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
970 [m4_case([$1], [ustar],, [pax],,
971 [m4_fatal([Unknown tar format])])
972 AC_MSG_CHECKING([how to create a $1 tar archive])
973 # Loop over all known methods to create a tar archive until one works.
974 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
975 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
976 # Do not fold the above two line into one, because Tru64 sh and
977 # Solaris sh will not grok spaces in the rhs of `-'.
978 for _am_tool in $_am_tools
982 for _am_tar in tar gnutar gtar;
984 AM_RUN_LOG([$_am_tar --version]) && break
986 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
987 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
988 am__untar="$_am_tar -xf -"
991 # Must skip GNU tar: if it does not support --format= it doesn't create
992 # ustar tarball either.
993 (tar --version) >/dev/null 2>&1 && continue
994 am__tar='tar chf - "$$tardir"'
995 am__tar_='tar chf - "$tardir"'
999 am__tar='pax -L -x $1 -w "$$tardir"'
1000 am__tar_='pax -L -x $1 -w "$tardir"'
1004 am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1005 am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1006 am__untar='cpio -i -H $1 -d'
1015 # If the value was cached, stop now. We just wanted to have am__tar
1016 # and am__untar set.
1017 test -n "${am_cv_prog_tar_$1}" && break
1019 # tar/untar a dummy directory, and stop if the command works
1022 echo GrepMe > conftest.dir/file
1023 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1025 if test -s conftest.tar; then
1026 AM_RUN_LOG([$am__untar <conftest.tar])
1027 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1032 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1033 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1035 AC_SUBST([am__untar])
1038 # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
1040 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1042 # This program is free software; you can redistribute it and/or modify
1043 # it under the terms of the GNU General Public License as published by
1044 # the Free Software Foundation; either version 2 of the License, or
1045 # (at your option) any later version.
1047 # This program is distributed in the hope that it will be useful, but
1048 # WITHOUT ANY WARRANTY; without even the implied warranty of
1049 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1050 # General Public License for more details.
1052 # You should have received a copy of the GNU General Public License
1053 # along with this program; if not, write to the Free Software
1054 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1056 # As a special exception to the GNU General Public License, if you
1057 # distribute this file as part of a program that contains a
1058 # configuration script generated by Autoconf, you may include it under
1059 # the same distribution terms that you use for the rest of that program.
1061 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
1062 # ----------------------------------
1063 AC_DEFUN([PKG_PROG_PKG_CONFIG],
1064 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1065 m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
1066 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
1067 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1068 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1070 if test -n "$PKG_CONFIG"; then
1071 _pkg_min_version=m4_default([$1], [0.9.0])
1072 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1073 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1074 AC_MSG_RESULT([yes])
1081 ])# PKG_PROG_PKG_CONFIG
1083 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1085 # Check to see whether a particular set of modules exists. Similar
1086 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
1089 # Similar to PKG_CHECK_MODULES, make sure that the first instance of
1090 # this or PKG_CHECK_MODULES is called, or make sure to call
1091 # PKG_CHECK_EXISTS manually
1092 # --------------------------------------------------------------
1093 AC_DEFUN([PKG_CHECK_EXISTS],
1094 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1095 if test -n "$PKG_CONFIG" && \
1096 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1097 m4_ifval([$2], [$2], [:])
1098 m4_ifvaln([$3], [else
1103 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1104 # ---------------------------------------------
1105 m4_define([_PKG_CONFIG],
1106 [if test -n "$$1"; then
1108 elif test -n "$PKG_CONFIG"; then
1109 PKG_CHECK_EXISTS([$3],
1110 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
1117 # _PKG_SHORT_ERRORS_SUPPORTED
1118 # -----------------------------
1119 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1120 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1121 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1122 _pkg_short_errors_supported=yes
1124 _pkg_short_errors_supported=no
1126 ])# _PKG_SHORT_ERRORS_SUPPORTED
1129 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1130 # [ACTION-IF-NOT-FOUND])
1133 # Note that if there is a possibility the first call to
1134 # PKG_CHECK_MODULES might not happen, you should be sure to include an
1135 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1138 # --------------------------------------------------------------
1139 AC_DEFUN([PKG_CHECK_MODULES],
1140 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1141 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1142 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1145 AC_MSG_CHECKING([for $1])
1147 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1148 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
1150 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1151 and $1[]_LIBS to avoid the need to call pkg-config.
1152 See the pkg-config man page for more details.])
1154 if test $pkg_failed = yes; then
1155 _PKG_SHORT_ERRORS_SUPPORTED
1156 if test $_pkg_short_errors_supported = yes; then
1157 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
1159 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
1161 # Put the nasty error message in config.log where it belongs
1162 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1164 ifelse([$4], , [AC_MSG_ERROR(dnl
1165 [Package requirements ($2) were not met:
1169 Consider adjusting the PKG_CONFIG_PATH environment variable if you
1170 installed software in a non-standard prefix.
1174 [AC_MSG_RESULT([no])
1176 elif test $pkg_failed = untried; then
1177 ifelse([$4], , [AC_MSG_FAILURE(dnl
1178 [The pkg-config script could not be found or is too old. Make sure it
1179 is in your PATH or set the PKG_CONFIG environment variable to the full
1184 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
1187 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1188 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1189 AC_MSG_RESULT([yes])
1190 ifelse([$3], , :, [$3])
1192 ])# PKG_CHECK_MODULES
1194 dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1196 dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
1198 dnl Permission is hereby granted, free of charge, to any person obtaining a
1199 dnl copy of this software and associated documentation files (the "Software"),
1200 dnl to deal in the Software without restriction, including without limitation
1201 dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
1202 dnl and/or sell copies of the Software, and to permit persons to whom the
1203 dnl Software is furnished to do so, subject to the following conditions:
1205 dnl The above copyright notice and this permission notice (including the next
1206 dnl paragraph) shall be included in all copies or substantial portions of the
1209 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1210 dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1211 dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
1212 dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1213 dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1214 dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1215 dnl DEALINGS IN THE SOFTWARE.
1217 # XORG_MACROS_VERSION(required-version)
1218 # -------------------------------------
1219 # Minimum version: 1.1.0
1221 # If you're using a macro added in Version 1.1 or newer, include this in
1222 # your configure.ac with the minimum required version, such as:
1223 # XORG_MACROS_VERSION(1.1)
1225 # To ensure that this macro is defined, also add:
1226 # m4_ifndef([XORG_MACROS_VERSION],
1227 # [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
1230 # See the "minimum version" comment for each macro you use to see what
1231 # version you require.
1232 m4_defun([XORG_MACROS_VERSION],[
1233 m4_define([vers_have], [1.17])
1234 m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1235 m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1236 m4_if(m4_cmp(maj_have, maj_needed), 0,,
1237 [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1238 m4_if(m4_version_compare(vers_have, [$1]), -1,
1239 [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1240 m4_undefine([vers_have])
1241 m4_undefine([maj_have])
1242 m4_undefine([maj_needed])
1243 ]) # XORG_MACROS_VERSION
1245 # XORG_PROG_RAWCPP()
1246 # ------------------
1247 # Minimum version: 1.0.0
1249 # Find cpp program and necessary flags for use in pre-processing text files
1250 # such as man pages and config files
1251 AC_DEFUN([XORG_PROG_RAWCPP],[
1252 AC_REQUIRE([AC_PROG_CPP])
1253 AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
1254 [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1256 # Check for flag to avoid builtin definitions - assumes unix is predefined,
1257 # which is not the best choice for supporting other OS'es, but covers most
1258 # of the ones we need for now.
1259 AC_MSG_CHECKING([if $RAWCPP requires -undef])
1260 AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
1261 if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1264 if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1266 AC_MSG_RESULT([yes])
1267 # under Cygwin unix is still defined even with -undef
1268 elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1269 RAWCPPFLAGS="-undef -ansi"
1270 AC_MSG_RESULT([yes, with -ansi])
1272 AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.])
1275 rm -f conftest.$ac_ext
1277 AC_MSG_CHECKING([if $RAWCPP requires -traditional])
1278 AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve "whitespace"?]])])
1279 if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
1282 if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
1283 RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1284 AC_MSG_RESULT([yes])
1286 AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.])
1289 rm -f conftest.$ac_ext
1290 AC_SUBST(RAWCPPFLAGS)
1291 ]) # XORG_PROG_RAWCPP
1293 # XORG_MANPAGE_SECTIONS()
1294 # -----------------------
1295 # Minimum version: 1.0.0
1297 # Determine which sections man pages go in for the different man page types
1298 # on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1299 # Not sure if there's any better way than just hardcoding by OS name.
1300 # Override default settings by setting environment variables
1301 # Added MAN_SUBSTS in version 1.8
1302 # Added AC_PROG_SED in version 1.8
1304 AC_DEFUN([XORG_MANPAGE_SECTIONS],[
1305 AC_REQUIRE([AC_CANONICAL_HOST])
1306 AC_REQUIRE([AC_PROG_SED])
1308 if test x$APP_MAN_SUFFIX = x ; then
1311 if test x$APP_MAN_DIR = x ; then
1312 APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1315 if test x$LIB_MAN_SUFFIX = x ; then
1318 if test x$LIB_MAN_DIR = x ; then
1319 LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1322 if test x$FILE_MAN_SUFFIX = x ; then
1324 solaris*) FILE_MAN_SUFFIX=4 ;;
1325 *) FILE_MAN_SUFFIX=5 ;;
1328 if test x$FILE_MAN_DIR = x ; then
1329 FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1332 if test x$MISC_MAN_SUFFIX = x ; then
1334 solaris*) MISC_MAN_SUFFIX=5 ;;
1335 *) MISC_MAN_SUFFIX=7 ;;
1338 if test x$MISC_MAN_DIR = x ; then
1339 MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1342 if test x$DRIVER_MAN_SUFFIX = x ; then
1344 solaris*) DRIVER_MAN_SUFFIX=7 ;;
1345 *) DRIVER_MAN_SUFFIX=4 ;;
1348 if test x$DRIVER_MAN_DIR = x ; then
1349 DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1352 if test x$ADMIN_MAN_SUFFIX = x ; then
1354 solaris*) ADMIN_MAN_SUFFIX=1m ;;
1355 *) ADMIN_MAN_SUFFIX=8 ;;
1358 if test x$ADMIN_MAN_DIR = x ; then
1359 ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1363 AC_SUBST([APP_MAN_SUFFIX])
1364 AC_SUBST([LIB_MAN_SUFFIX])
1365 AC_SUBST([FILE_MAN_SUFFIX])
1366 AC_SUBST([MISC_MAN_SUFFIX])
1367 AC_SUBST([DRIVER_MAN_SUFFIX])
1368 AC_SUBST([ADMIN_MAN_SUFFIX])
1369 AC_SUBST([APP_MAN_DIR])
1370 AC_SUBST([LIB_MAN_DIR])
1371 AC_SUBST([FILE_MAN_DIR])
1372 AC_SUBST([MISC_MAN_DIR])
1373 AC_SUBST([DRIVER_MAN_DIR])
1374 AC_SUBST([ADMIN_MAN_DIR])
1376 XORG_MAN_PAGE="X Version 11"
1377 AC_SUBST([XORG_MAN_PAGE])
1379 -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1380 -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1381 -e 's|__xservername__|Xorg|g' \
1382 -e 's|__xconfigfile__|xorg.conf|g' \
1383 -e 's|__projectroot__|\$(prefix)|g' \
1384 -e 's|__apploaddir__|\$(appdefaultdir)|g' \
1385 -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
1386 -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
1387 -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
1388 -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
1389 -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
1390 -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
1391 AC_SUBST([MAN_SUBSTS])
1393 ]) # XORG_MANPAGE_SECTIONS
1395 # XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
1396 # ------------------------
1397 # Minimum version: 1.7.0
1399 # Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
1400 # provided by xorg-sgml-doctools, if installed.
1401 AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
1402 AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
1404 PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
1405 [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
1407 [if test x"$cross_compiling" != x"yes" ; then
1408 AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
1409 [XORG_SGML_PATH=$prefix/share/sgml])
1413 # Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
1414 # the path and the name of the doc stylesheet
1415 if test "x$XORG_SGML_PATH" != "x" ; then
1416 AC_MSG_RESULT([$XORG_SGML_PATH])
1417 STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
1418 XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
1423 AC_SUBST(XORG_SGML_PATH)
1424 AC_SUBST(STYLESHEET_SRCDIR)
1425 AC_SUBST(XSL_STYLESHEET)
1426 AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
1427 ]) # XORG_CHECK_SGML_DOCTOOLS
1429 # XORG_CHECK_LINUXDOC
1430 # -------------------
1431 # Minimum version: 1.0.0
1433 # Defines the variable MAKE_TEXT if the necessary tools and
1434 # files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1435 # Whether or not the necessary tools and files are found can be checked
1436 # with the AM_CONDITIONAL "BUILD_LINUXDOC"
1437 AC_DEFUN([XORG_CHECK_LINUXDOC],[
1438 AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1439 AC_REQUIRE([XORG_WITH_PS2PDF])
1441 AC_PATH_PROG(LINUXDOC, linuxdoc)
1443 AC_MSG_CHECKING([whether to build documentation])
1445 if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
1451 AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1453 AC_MSG_RESULT([$BUILDDOC])
1455 AC_MSG_CHECKING([whether to build pdf documentation])
1457 if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
1463 AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1465 AC_MSG_RESULT([$BUILDPDFDOC])
1467 MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
1468 MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1470 MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0"
1476 ]) # XORG_CHECK_LINUXDOC
1478 # XORG_CHECK_DOCBOOK
1479 # -------------------
1480 # Minimum version: 1.0.0
1482 # Checks for the ability to build output formats from SGML DocBook source.
1483 # For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1484 # indicates whether the necessary tools and files are found and, if set,
1485 # $(MAKE_XXX) blah.sgml will produce blah.xxx.
1486 AC_DEFUN([XORG_CHECK_DOCBOOK],[
1487 AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1494 AC_PATH_PROG(DOCBOOKPS, docbook2ps)
1495 AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1496 AC_PATH_PROG(DOCBOOKHTML, docbook2html)
1497 AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1499 AC_MSG_CHECKING([whether to build text documentation])
1500 if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
1501 test x$BUILD_TXTDOC != xno; then
1504 AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1505 AC_MSG_RESULT([$BUILDTXTDOC])
1507 AC_MSG_CHECKING([whether to build PDF documentation])
1508 if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
1509 test x$BUILD_PDFDOC != xno; then
1512 AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1513 AC_MSG_RESULT([$BUILDPDFDOC])
1515 AC_MSG_CHECKING([whether to build PostScript documentation])
1516 if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
1517 test x$BUILD_PSDOC != xno; then
1520 AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1521 AC_MSG_RESULT([$BUILDPSDOC])
1523 AC_MSG_CHECKING([whether to build HTML documentation])
1524 if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
1525 test x$BUILD_HTMLDOC != xno; then
1528 AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1529 AC_MSG_RESULT([$BUILDHTMLDOC])
1531 MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1532 MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1533 MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1534 MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1540 ]) # XORG_CHECK_DOCBOOK
1542 # XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
1544 # Minimum version: 1.5.0
1545 # Minimum version for optional DEFAULT argument: 1.11.0
1547 # Documentation tools are not always available on all platforms and sometimes
1548 # not at the appropriate level. This macro enables a module to test for the
1549 # presence of the tool and obtain it's path in separate variables. Coupled with
1550 # the --with-xmlto option, it allows maximum flexibilty in making decisions
1551 # as whether or not to use the xmlto package. When DEFAULT is not specified,
1552 # --with-xmlto assumes 'auto'.
1554 # Interface to module:
1555 # HAVE_XMLTO: used in makefiles to conditionally generate documentation
1556 # XMLTO: returns the path of the xmlto program found
1557 # returns the path set by the user in the environment
1558 # --with-xmlto: 'yes' user instructs the module to use xmlto
1559 # 'no' user instructs the module not to use xmlto
1561 # Added in version 1.10.0
1562 # HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
1563 # xmlto for text output requires either lynx, links, or w3m browsers
1565 # If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
1567 AC_DEFUN([XORG_WITH_XMLTO],[
1568 AC_ARG_VAR([XMLTO], [Path to xmlto command])
1569 m4_define([_defopt], m4_default([$2], [auto]))
1571 AS_HELP_STRING([--with-xmlto],
1572 [Use xmlto to regenerate documentation (default: ]_defopt[)]),
1573 [use_xmlto=$withval], [use_xmlto=]_defopt)
1574 m4_undefine([_defopt])
1576 if test "x$use_xmlto" = x"auto"; then
1577 AC_PATH_PROG([XMLTO], [xmlto])
1578 if test "x$XMLTO" = "x"; then
1579 AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
1584 elif test "x$use_xmlto" = x"yes" ; then
1585 AC_PATH_PROG([XMLTO], [xmlto])
1586 if test "x$XMLTO" = "x"; then
1587 AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
1590 elif test "x$use_xmlto" = x"no" ; then
1591 if test "x$XMLTO" != "x"; then
1592 AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
1596 AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
1599 # Test for a minimum version of xmlto, if provided.
1601 [if test "$have_xmlto" = yes; then
1602 # scrape the xmlto version
1603 AC_MSG_CHECKING([the xmlto version])
1604 xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
1605 AC_MSG_RESULT([$xmlto_version])
1606 AS_VERSION_COMPARE([$xmlto_version], [$1],
1607 [if test "x$use_xmlto" = xauto; then
1608 AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
1611 AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
1615 # Test for the ability of xmlto to generate a text target
1617 cat > conftest.xml << "EOF"
1619 AS_IF([test "$have_xmlto" = yes],
1620 [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
1621 [have_xmlto_text=yes],
1622 [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
1624 AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
1625 AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
1626 ]) # XORG_WITH_XMLTO
1628 # XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
1629 # --------------------------------------------
1630 # Minimum version: 1.12.0
1631 # Minimum version for optional DEFAULT argument: 1.12.0
1633 # XSLT (Extensible Stylesheet Language Transformations) is a declarative,
1634 # XML-based language used for the transformation of XML documents.
1635 # The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
1636 # It is used under the cover by xmlto to generate html files from DocBook/XML.
1637 # The XSLT processor is often used as a standalone tool for transformations.
1638 # It should not be assumed that this tool is used only to work with documnetation.
1639 # When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
1641 # Interface to module:
1642 # HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
1643 # XSLTPROC: returns the path of the xsltproc program found
1644 # returns the path set by the user in the environment
1645 # --with-xsltproc: 'yes' user instructs the module to use xsltproc
1646 # 'no' user instructs the module not to use xsltproc
1647 # have_xsltproc: returns yes if xsltproc found in PATH or no
1649 # If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
1651 AC_DEFUN([XORG_WITH_XSLTPROC],[
1652 AC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
1653 # Preserves the interface, should it be implemented later
1654 m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
1655 m4_define([_defopt], m4_default([$2], [auto]))
1656 AC_ARG_WITH(xsltproc,
1657 AS_HELP_STRING([--with-xsltproc],
1658 [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
1659 [use_xsltproc=$withval], [use_xsltproc=]_defopt)
1660 m4_undefine([_defopt])
1662 if test "x$use_xsltproc" = x"auto"; then
1663 AC_PATH_PROG([XSLTPROC], [xsltproc])
1664 if test "x$XSLTPROC" = "x"; then
1665 AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
1670 elif test "x$use_xsltproc" = x"yes" ; then
1671 AC_PATH_PROG([XSLTPROC], [xsltproc])
1672 if test "x$XSLTPROC" = "x"; then
1673 AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
1676 elif test "x$use_xsltproc" = x"no" ; then
1677 if test "x$XSLTPROC" != "x"; then
1678 AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
1682 AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
1685 AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
1686 ]) # XORG_WITH_XSLTPROC
1688 # XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
1689 # ----------------------------------------
1690 # Minimum version: 1.15.0
1692 # PERL (Practical Extraction and Report Language) is a language optimized for
1693 # scanning arbitrary text files, extracting information from those text files,
1694 # and printing reports based on that information.
1696 # When DEFAULT is not specified, --with-perl assumes 'auto'.
1698 # Interface to module:
1699 # HAVE_PERL: used in makefiles to conditionally scan text files
1700 # PERL: returns the path of the perl program found
1701 # returns the path set by the user in the environment
1702 # --with-perl: 'yes' user instructs the module to use perl
1703 # 'no' user instructs the module not to use perl
1704 # have_perl: returns yes if perl found in PATH or no
1706 # If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
1708 AC_DEFUN([XORG_WITH_PERL],[
1709 AC_ARG_VAR([PERL], [Path to perl command])
1710 # Preserves the interface, should it be implemented later
1711 m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
1712 m4_define([_defopt], m4_default([$2], [auto]))
1714 AS_HELP_STRING([--with-perl],
1715 [Use perl for extracting information from files (default: ]_defopt[)]),
1716 [use_perl=$withval], [use_perl=]_defopt)
1717 m4_undefine([_defopt])
1719 if test "x$use_perl" = x"auto"; then
1720 AC_PATH_PROG([PERL], [perl])
1721 if test "x$PERL" = "x"; then
1722 AC_MSG_WARN([perl not found - cannot extract information and report])
1727 elif test "x$use_perl" = x"yes" ; then
1728 AC_PATH_PROG([PERL], [perl])
1729 if test "x$PERL" = "x"; then
1730 AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
1733 elif test "x$use_perl" = x"no" ; then
1734 if test "x$PERL" != "x"; then
1735 AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
1739 AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
1742 AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
1745 # XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
1747 # Minimum version: 1.5.0
1748 # Minimum version for optional DEFAULT argument: 1.11.0
1750 # Documentation tools are not always available on all platforms and sometimes
1751 # not at the appropriate level. This macro enables a module to test for the
1752 # presence of the tool and obtain it's path in separate variables. Coupled with
1753 # the --with-asciidoc option, it allows maximum flexibilty in making decisions
1754 # as whether or not to use the asciidoc package. When DEFAULT is not specified,
1755 # --with-asciidoc assumes 'auto'.
1757 # Interface to module:
1758 # HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
1759 # ASCIIDOC: returns the path of the asciidoc program found
1760 # returns the path set by the user in the environment
1761 # --with-asciidoc: 'yes' user instructs the module to use asciidoc
1762 # 'no' user instructs the module not to use asciidoc
1764 # If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
1766 AC_DEFUN([XORG_WITH_ASCIIDOC],[
1767 AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
1768 m4_define([_defopt], m4_default([$2], [auto]))
1769 AC_ARG_WITH(asciidoc,
1770 AS_HELP_STRING([--with-asciidoc],
1771 [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
1772 [use_asciidoc=$withval], [use_asciidoc=]_defopt)
1773 m4_undefine([_defopt])
1775 if test "x$use_asciidoc" = x"auto"; then
1776 AC_PATH_PROG([ASCIIDOC], [asciidoc])
1777 if test "x$ASCIIDOC" = "x"; then
1778 AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
1783 elif test "x$use_asciidoc" = x"yes" ; then
1784 AC_PATH_PROG([ASCIIDOC], [asciidoc])
1785 if test "x$ASCIIDOC" = "x"; then
1786 AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
1789 elif test "x$use_asciidoc" = x"no" ; then
1790 if test "x$ASCIIDOC" != "x"; then
1791 AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
1795 AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
1798 [if test "$have_asciidoc" = yes; then
1799 # scrape the asciidoc version
1800 AC_MSG_CHECKING([the asciidoc version])
1801 asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
1802 AC_MSG_RESULT([$asciidoc_version])
1803 AS_VERSION_COMPARE([$asciidoc_version], [$1],
1804 [if test "x$use_asciidoc" = xauto; then
1805 AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
1808 AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
1811 AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
1812 ]) # XORG_WITH_ASCIIDOC
1814 # XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
1815 # --------------------------------
1816 # Minimum version: 1.5.0
1817 # Minimum version for optional DEFAULT argument: 1.11.0
1819 # Documentation tools are not always available on all platforms and sometimes
1820 # not at the appropriate level. This macro enables a module to test for the
1821 # presence of the tool and obtain it's path in separate variables. Coupled with
1822 # the --with-doxygen option, it allows maximum flexibilty in making decisions
1823 # as whether or not to use the doxygen package. When DEFAULT is not specified,
1824 # --with-doxygen assumes 'auto'.
1826 # Interface to module:
1827 # HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
1828 # DOXYGEN: returns the path of the doxygen program found
1829 # returns the path set by the user in the environment
1830 # --with-doxygen: 'yes' user instructs the module to use doxygen
1831 # 'no' user instructs the module not to use doxygen
1833 # If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
1835 AC_DEFUN([XORG_WITH_DOXYGEN],[
1836 AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
1837 m4_define([_defopt], m4_default([$2], [auto]))
1838 AC_ARG_WITH(doxygen,
1839 AS_HELP_STRING([--with-doxygen],
1840 [Use doxygen to regenerate documentation (default: ]_defopt[)]),
1841 [use_doxygen=$withval], [use_doxygen=]_defopt)
1842 m4_undefine([_defopt])
1844 if test "x$use_doxygen" = x"auto"; then
1845 AC_PATH_PROG([DOXYGEN], [doxygen])
1846 if test "x$DOXYGEN" = "x"; then
1847 AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
1852 elif test "x$use_doxygen" = x"yes" ; then
1853 AC_PATH_PROG([DOXYGEN], [doxygen])
1854 if test "x$DOXYGEN" = "x"; then
1855 AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
1858 elif test "x$use_doxygen" = x"no" ; then
1859 if test "x$DOXYGEN" != "x"; then
1860 AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
1864 AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
1867 [if test "$have_doxygen" = yes; then
1868 # scrape the doxygen version
1869 AC_MSG_CHECKING([the doxygen version])
1870 doxygen_version=`$DOXYGEN --version 2>/dev/null`
1871 AC_MSG_RESULT([$doxygen_version])
1872 AS_VERSION_COMPARE([$doxygen_version], [$1],
1873 [if test "x$use_doxygen" = xauto; then
1874 AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
1877 AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
1880 AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
1881 ]) # XORG_WITH_DOXYGEN
1883 # XORG_WITH_GROFF([DEFAULT])
1885 # Minimum version: 1.6.0
1886 # Minimum version for optional DEFAULT argument: 1.11.0
1888 # Documentation tools are not always available on all platforms and sometimes
1889 # not at the appropriate level. This macro enables a module to test for the
1890 # presence of the tool and obtain it's path in separate variables. Coupled with
1891 # the --with-groff option, it allows maximum flexibilty in making decisions
1892 # as whether or not to use the groff package. When DEFAULT is not specified,
1893 # --with-groff assumes 'auto'.
1895 # Interface to module:
1896 # HAVE_GROFF: used in makefiles to conditionally generate documentation
1897 # HAVE_GROFF_MM: the memorandum macros (-mm) package
1898 # HAVE_GROFF_MS: the -ms macros package
1899 # GROFF: returns the path of the groff program found
1900 # returns the path set by the user in the environment
1901 # --with-groff: 'yes' user instructs the module to use groff
1902 # 'no' user instructs the module not to use groff
1904 # Added in version 1.9.0:
1905 # HAVE_GROFF_HTML: groff has dependencies to output HTML format:
1906 # pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
1907 # psselect from the psutils package.
1908 # the ghostcript package. Refer to the grohtml man pages
1910 # If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
1912 # OS and distros often splits groff in a basic and full package, the former
1913 # having the groff program and the later having devices, fonts and macros
1914 # Checking for the groff executable is not enough.
1916 # If macros are missing, we cannot assume that groff is useless, so we don't
1917 # unset HAVE_GROFF or GROFF env variables.
1918 # HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
1920 AC_DEFUN([XORG_WITH_GROFF],[
1921 AC_ARG_VAR([GROFF], [Path to groff command])
1922 m4_define([_defopt], m4_default([$1], [auto]))
1924 AS_HELP_STRING([--with-groff],
1925 [Use groff to regenerate documentation (default: ]_defopt[)]),
1926 [use_groff=$withval], [use_groff=]_defopt)
1927 m4_undefine([_defopt])
1929 if test "x$use_groff" = x"auto"; then
1930 AC_PATH_PROG([GROFF], [groff])
1931 if test "x$GROFF" = "x"; then
1932 AC_MSG_WARN([groff not found - documentation targets will be skipped])
1937 elif test "x$use_groff" = x"yes" ; then
1938 AC_PATH_PROG([GROFF], [groff])
1939 if test "x$GROFF" = "x"; then
1940 AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
1943 elif test "x$use_groff" = x"no" ; then
1944 if test "x$GROFF" != "x"; then
1945 AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
1949 AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
1952 # We have groff, test for the presence of the macro packages
1953 if test "x$have_groff" = x"yes"; then
1954 AC_MSG_CHECKING([for ${GROFF} -ms macros])
1955 if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
1960 AC_MSG_RESULT([$groff_ms_works])
1961 AC_MSG_CHECKING([for ${GROFF} -mm macros])
1962 if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
1967 AC_MSG_RESULT([$groff_mm_works])
1970 # We have groff, test for HTML dependencies, one command per package
1971 if test "x$have_groff" = x"yes"; then
1972 AC_PATH_PROGS(GS_PATH, [gs gswin32c])
1973 AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
1974 AC_PATH_PROG(PSSELECT_PATH, [psselect])
1975 if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
1979 AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
1983 # Set Automake conditionals for Makefiles
1984 AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
1985 AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
1986 AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
1987 AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
1988 ]) # XORG_WITH_GROFF
1990 # XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
1991 # ---------------------------------------
1992 # Minimum version: 1.6.0
1993 # Minimum version for optional DEFAULT argument: 1.11.0
1994 # Minimum version for optional MIN-VERSION argument: 1.15.0
1996 # Documentation tools are not always available on all platforms and sometimes
1997 # not at the appropriate level. This macro enables a module to test for the
1998 # presence of the tool and obtain it's path in separate variables. Coupled with
1999 # the --with-fop option, it allows maximum flexibilty in making decisions
2000 # as whether or not to use the fop package. When DEFAULT is not specified,
2001 # --with-fop assumes 'auto'.
2003 # Interface to module:
2004 # HAVE_FOP: used in makefiles to conditionally generate documentation
2005 # FOP: returns the path of the fop program found
2006 # returns the path set by the user in the environment
2007 # --with-fop: 'yes' user instructs the module to use fop
2008 # 'no' user instructs the module not to use fop
2010 # If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
2012 AC_DEFUN([XORG_WITH_FOP],[
2013 AC_ARG_VAR([FOP], [Path to fop command])
2014 m4_define([_defopt], m4_default([$2], [auto]))
2016 AS_HELP_STRING([--with-fop],
2017 [Use fop to regenerate documentation (default: ]_defopt[)]),
2018 [use_fop=$withval], [use_fop=]_defopt)
2019 m4_undefine([_defopt])
2021 if test "x$use_fop" = x"auto"; then
2022 AC_PATH_PROG([FOP], [fop])
2023 if test "x$FOP" = "x"; then
2024 AC_MSG_WARN([fop not found - documentation targets will be skipped])
2029 elif test "x$use_fop" = x"yes" ; then
2030 AC_PATH_PROG([FOP], [fop])
2031 if test "x$FOP" = "x"; then
2032 AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
2035 elif test "x$use_fop" = x"no" ; then
2036 if test "x$FOP" != "x"; then
2037 AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
2041 AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
2044 # Test for a minimum version of fop, if provided.
2046 [if test "$have_fop" = yes; then
2047 # scrape the fop version
2048 AC_MSG_CHECKING([for fop minimum version])
2049 fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
2050 AC_MSG_RESULT([$fop_version])
2051 AS_VERSION_COMPARE([$fop_version], [$1],
2052 [if test "x$use_fop" = xauto; then
2053 AC_MSG_WARN([fop version $fop_version found, but $1 needed])
2056 AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
2059 AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
2062 # XORG_WITH_PS2PDF([DEFAULT])
2064 # Minimum version: 1.6.0
2065 # Minimum version for optional DEFAULT argument: 1.11.0
2067 # Documentation tools are not always available on all platforms and sometimes
2068 # not at the appropriate level. This macro enables a module to test for the
2069 # presence of the tool and obtain it's path in separate variables. Coupled with
2070 # the --with-ps2pdf option, it allows maximum flexibilty in making decisions
2071 # as whether or not to use the ps2pdf package. When DEFAULT is not specified,
2072 # --with-ps2pdf assumes 'auto'.
2074 # Interface to module:
2075 # HAVE_PS2PDF: used in makefiles to conditionally generate documentation
2076 # PS2PDF: returns the path of the ps2pdf program found
2077 # returns the path set by the user in the environment
2078 # --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
2079 # 'no' user instructs the module not to use ps2pdf
2081 # If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
2083 AC_DEFUN([XORG_WITH_PS2PDF],[
2084 AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
2085 m4_define([_defopt], m4_default([$1], [auto]))
2087 AS_HELP_STRING([--with-ps2pdf],
2088 [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
2089 [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
2090 m4_undefine([_defopt])
2092 if test "x$use_ps2pdf" = x"auto"; then
2093 AC_PATH_PROG([PS2PDF], [ps2pdf])
2094 if test "x$PS2PDF" = "x"; then
2095 AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
2100 elif test "x$use_ps2pdf" = x"yes" ; then
2101 AC_PATH_PROG([PS2PDF], [ps2pdf])
2102 if test "x$PS2PDF" = "x"; then
2103 AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
2106 elif test "x$use_ps2pdf" = x"no" ; then
2107 if test "x$PS2PDF" != "x"; then
2108 AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
2112 AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
2114 AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
2115 ]) # XORG_WITH_PS2PDF
2117 # XORG_ENABLE_DOCS (enable_docs=yes)
2119 # Minimum version: 1.6.0
2121 # Documentation tools are not always available on all platforms and sometimes
2122 # not at the appropriate level. This macro enables a builder to skip all
2123 # documentation targets except traditional man pages.
2124 # Combined with the specific tool checking macros XORG_WITH_*, it provides
2125 # maximum flexibilty in controlling documentation building.
2127 # XORG_WITH_XMLTO --with-xmlto
2128 # XORG_WITH_ASCIIDOC --with-asciidoc
2129 # XORG_WITH_DOXYGEN --with-doxygen
2130 # XORG_WITH_FOP --with-fop
2131 # XORG_WITH_GROFF --with-groff
2132 # XORG_WITH_PS2PDF --with-ps2pdf
2134 # Interface to module:
2135 # ENABLE_DOCS: used in makefiles to conditionally generate documentation
2136 # --enable-docs: 'yes' user instructs the module to generate docs
2137 # 'no' user instructs the module not to generate docs
2138 # parm1: specify the default value, yes or no.
2140 AC_DEFUN([XORG_ENABLE_DOCS],[
2141 m4_define([docs_default], m4_default([$1], [yes]))
2143 AS_HELP_STRING([--enable-docs],
2144 [Enable building the documentation (default: ]docs_default[)]),
2145 [build_docs=$enableval], [build_docs=]docs_default)
2146 m4_undefine([docs_default])
2147 AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
2148 AC_MSG_CHECKING([whether to build documentation])
2149 AC_MSG_RESULT([$build_docs])
2150 ]) # XORG_ENABLE_DOCS
2152 # XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
2154 # Minimum version: 1.6.0
2156 # This macro enables a builder to skip all developer documentation.
2157 # Combined with the specific tool checking macros XORG_WITH_*, it provides
2158 # maximum flexibilty in controlling documentation building.
2160 # XORG_WITH_XMLTO --with-xmlto
2161 # XORG_WITH_ASCIIDOC --with-asciidoc
2162 # XORG_WITH_DOXYGEN --with-doxygen
2163 # XORG_WITH_FOP --with-fop
2164 # XORG_WITH_GROFF --with-groff
2165 # XORG_WITH_PS2PDF --with-ps2pdf
2167 # Interface to module:
2168 # ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs
2169 # --enable-devel-docs: 'yes' user instructs the module to generate developer docs
2170 # 'no' user instructs the module not to generate developer docs
2171 # parm1: specify the default value, yes or no.
2173 AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
2174 m4_define([devel_default], m4_default([$1], [yes]))
2175 AC_ARG_ENABLE(devel-docs,
2176 AS_HELP_STRING([--enable-devel-docs],
2177 [Enable building the developer documentation (default: ]devel_default[)]),
2178 [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
2179 m4_undefine([devel_default])
2180 AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
2181 AC_MSG_CHECKING([whether to build developer documentation])
2182 AC_MSG_RESULT([$build_devel_docs])
2183 ]) # XORG_ENABLE_DEVEL_DOCS
2185 # XORG_ENABLE_SPECS (enable_specs=yes)
2187 # Minimum version: 1.6.0
2189 # This macro enables a builder to skip all functional specification targets.
2190 # Combined with the specific tool checking macros XORG_WITH_*, it provides
2191 # maximum flexibilty in controlling documentation building.
2193 # XORG_WITH_XMLTO --with-xmlto
2194 # XORG_WITH_ASCIIDOC --with-asciidoc
2195 # XORG_WITH_DOXYGEN --with-doxygen
2196 # XORG_WITH_FOP --with-fop
2197 # XORG_WITH_GROFF --with-groff
2198 # XORG_WITH_PS2PDF --with-ps2pdf
2200 # Interface to module:
2201 # ENABLE_SPECS: used in makefiles to conditionally generate specs
2202 # --enable-specs: 'yes' user instructs the module to generate specs
2203 # 'no' user instructs the module not to generate specs
2204 # parm1: specify the default value, yes or no.
2206 AC_DEFUN([XORG_ENABLE_SPECS],[
2207 m4_define([spec_default], m4_default([$1], [yes]))
2208 AC_ARG_ENABLE(specs,
2209 AS_HELP_STRING([--enable-specs],
2210 [Enable building the specs (default: ]spec_default[)]),
2211 [build_specs=$enableval], [build_specs=]spec_default)
2212 m4_undefine([spec_default])
2213 AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
2214 AC_MSG_CHECKING([whether to build functional specifications])
2215 AC_MSG_RESULT([$build_specs])
2216 ]) # XORG_ENABLE_SPECS
2218 # XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
2219 # ----------------------------------------------
2220 # Minimum version: 1.13.0
2222 # This macro enables a builder to enable/disable unit testing
2223 # It makes no assumption about the test cases implementation
2224 # Test cases may or may not use Automake "Support for test suites"
2225 # They may or may not use the software utility library GLib
2227 # When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
2228 # ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
2229 # The variable enable_unit_tests is used by other macros in this file.
2231 # Interface to module:
2232 # ENABLE_UNIT_TESTS: used in makefiles to conditionally build tests
2233 # enable_unit_tests: used in configure.ac for additional configuration
2234 # --enable-unit-tests: 'yes' user instructs the module to build tests
2235 # 'no' user instructs the module not to build tests
2236 # parm1: specify the default value, yes or no.
2238 AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
2239 AC_BEFORE([$0], [XORG_WITH_GLIB])
2240 AC_BEFORE([$0], [XORG_LD_WRAP])
2241 AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
2242 m4_define([_defopt], m4_default([$1], [auto]))
2243 AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
2244 [Enable building unit test cases (default: ]_defopt[)]),
2245 [enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
2246 m4_undefine([_defopt])
2247 AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
2248 AC_MSG_CHECKING([whether to build unit test cases])
2249 AC_MSG_RESULT([$enable_unit_tests])
2250 ]) # XORG_ENABLE_UNIT_TESTS
2252 # XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
2253 # ------------------------------------------------------
2254 # Minimum version: 1.17.0
2256 # This macro enables a builder to enable/disable integration testing
2257 # It makes no assumption about the test cases' implementation
2258 # Test cases may or may not use Automake "Support for test suites"
2260 # Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
2261 # usually requires less dependencies and may be built and run under less
2262 # stringent environments than integration tests.
2264 # Interface to module:
2265 # ENABLE_INTEGRATION_TESTS: used in makefiles to conditionally build tests
2266 # enable_integration_tests: used in configure.ac for additional configuration
2267 # --enable-integration-tests: 'yes' user instructs the module to build tests
2268 # 'no' user instructs the module not to build tests
2269 # parm1: specify the default value, yes or no.
2271 AC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
2272 AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
2273 m4_define([_defopt], m4_default([$1], [auto]))
2274 AC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
2275 [Enable building integration test cases (default: ]_defopt[)]),
2276 [enable_integration_tests=$enableval],
2277 [enable_integration_tests=]_defopt)
2278 m4_undefine([_defopt])
2279 AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
2280 [test "x$enable_integration_tests" != xno])
2281 AC_MSG_CHECKING([whether to build unit test cases])
2282 AC_MSG_RESULT([$enable_integration_tests])
2283 ]) # XORG_ENABLE_INTEGRATION_TESTS
2285 # XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
2286 # ----------------------------------------
2287 # Minimum version: 1.13.0
2289 # GLib is a library which provides advanced data structures and functions.
2290 # This macro enables a module to test for the presence of Glib.
2292 # When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
2293 # Otherwise the value of $enable_unit_tests is blank.
2295 # Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
2296 # test support usually requires less dependencies and may be built and run under
2297 # less stringent environments than integration tests.
2299 # Interface to module:
2300 # HAVE_GLIB: used in makefiles to conditionally build targets
2301 # with_glib: used in configure.ac to know if GLib has been found
2302 # --with-glib: 'yes' user instructs the module to use glib
2303 # 'no' user instructs the module not to use glib
2305 AC_DEFUN([XORG_WITH_GLIB],[
2306 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2307 m4_define([_defopt], m4_default([$2], [auto]))
2308 AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
2309 [Use GLib library for unit testing (default: ]_defopt[)]),
2310 [with_glib=$withval], [with_glib=]_defopt)
2311 m4_undefine([_defopt])
2314 # Do not probe GLib if user explicitly disabled unit testing
2315 if test "x$enable_unit_tests" != x"no"; then
2316 # Do not probe GLib if user explicitly disabled it
2317 if test "x$with_glib" != x"no"; then
2320 [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
2321 [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
2326 # Not having GLib when unit testing has been explicitly requested is an error
2327 if test "x$enable_unit_tests" = x"yes"; then
2328 if test "x$have_glib" = x"no"; then
2329 AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
2333 # Having unit testing disabled when GLib has been explicitly requested is an error
2334 if test "x$enable_unit_tests" = x"no"; then
2335 if test "x$with_glib" = x"yes"; then
2336 AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
2340 # Not having GLib when it has been explicitly requested is an error
2341 if test "x$with_glib" = x"yes"; then
2342 if test "x$have_glib" = x"no"; then
2343 AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
2347 AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
2350 # XORG_LD_WRAP([required|optional])
2351 # ---------------------------------
2352 # Minimum version: 1.13.0
2354 # Check if linker supports -wrap, passed via compiler flags
2356 # When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
2357 # Otherwise the value of $enable_unit_tests is blank.
2359 # Argument added in 1.16.0 - default is "required", to match existing behavior
2360 # of returning an error if enable_unit_tests is yes, and ld -wrap is not
2361 # available, an argument of "optional" allows use when some unit tests require
2362 # ld -wrap and others do not.
2364 AC_DEFUN([XORG_LD_WRAP],[
2365 XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
2366 [AC_LANG_PROGRAM([#include <stdlib.h>
2367 void __wrap_exit(int status) { return; }],
2369 # Not having ld wrap when unit testing has been explicitly requested is an error
2370 if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
2371 if test "x$have_ld_wrap" = x"no"; then
2372 AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
2375 AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
2379 # XORG_CHECK_LINKER_FLAGS
2380 # -----------------------
2383 # XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
2387 # Check whether the given linker FLAGS work with the current language's
2388 # linker, or whether they give an error.
2390 # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
2393 # PROGRAM-SOURCE is the program source to link with, if needed
2395 # NOTE: Based on AX_CHECK_COMPILER_FLAGS.
2399 # Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
2400 # Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
2401 # Copyright (c) 2009 Matteo Frigo
2403 # This program is free software: you can redistribute it and/or modify it
2404 # under the terms of the GNU General Public License as published by the
2405 # Free Software Foundation, either version 3 of the License, or (at your
2406 # option) any later version.
2408 # This program is distributed in the hope that it will be useful, but
2409 # WITHOUT ANY WARRANTY; without even the implied warranty of
2410 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
2411 # Public License for more details.
2413 # You should have received a copy of the GNU General Public License along
2414 # with this program. If not, see <http://www.gnu.org/licenses/>.
2416 # As a special exception, the respective Autoconf Macro's copyright owner
2417 # gives unlimited permission to copy, distribute and modify the configure
2418 # scripts that are the output of Autoconf when processing the Macro. You
2419 # need not follow the terms of the GNU General Public License when using
2420 # or distributing such scripts, even though portions of the text of the
2421 # Macro appear in them. The GNU General Public License (GPL) does govern
2422 # all other use of the material that constitutes the Autoconf Macro.
2424 # This special exception to the GPL applies to versions of the Autoconf
2425 # Macro released by the Autoconf Archive. When you make and distribute a
2426 # modified version of the Autoconf Macro, you may extend this special
2427 # exception to the GPL to apply to your modified version as well.#
2428 AC_DEFUN([XORG_CHECK_LINKER_FLAGS],
2429 [AC_MSG_CHECKING([whether the linker accepts $1])
2430 dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
2432 [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
2433 ax_save_FLAGS=$LDFLAGS
2435 AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
2436 AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
2437 AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
2438 LDFLAGS=$ax_save_FLAGS])],
2439 [ax_save_FLAGS=$LDFLAGS
2441 AC_LINK_IFELSE([AC_LANG_PROGRAM()],
2442 eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
2443 eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
2444 LDFLAGS=$ax_save_FLAGS])
2445 eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
2446 AC_MSG_RESULT($xorg_check_linker_flags)
2447 if test "x$xorg_check_linker_flags" = xyes; then
2452 ]) # XORG_CHECK_LINKER_FLAGS
2454 # XORG_MEMORY_CHECK_FLAGS
2455 # -----------------------
2456 # Minimum version: 1.16.0
2458 # This macro attempts to find appropriate memory checking functionality
2459 # for various platforms which unit testing code may use to catch various
2460 # forms of memory allocation and access errors in testing.
2462 # Interface to module:
2463 # XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
2464 # Usually added to TESTS_ENVIRONMENT in Makefile.am
2466 # If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
2468 AC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
2470 AC_REQUIRE([AC_CANONICAL_HOST])
2471 AC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
2472 [Environment variables to enable memory checking in tests])
2474 # Check for different types of support on different platforms
2477 AC_CHECK_LIB([umem], [umem_alloc],
2478 [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
2480 *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
2481 # both directly and inverted, so should not be 0 or 255.
2482 malloc_debug_env='MALLOC_PERTURB_=15'
2485 malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
2488 malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
2492 # User supplied flags override default flags
2493 if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
2494 malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
2497 AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
2500 # XORG_CHECK_MALLOC_ZERO
2501 # ----------------------
2502 # Minimum version: 1.0.0
2504 # Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
2505 # malloc(0) returns NULL. Packages should add one of these cflags to
2506 # their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
2507 AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
2508 AC_ARG_ENABLE(malloc0returnsnull,
2509 AS_HELP_STRING([--enable-malloc0returnsnull],
2510 [malloc(0) returns NULL (default: auto)]),
2511 [MALLOC_ZERO_RETURNS_NULL=$enableval],
2512 [MALLOC_ZERO_RETURNS_NULL=auto])
2514 AC_MSG_CHECKING([whether malloc(0) returns NULL])
2515 if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
2516 AC_RUN_IFELSE([AC_LANG_PROGRAM([
2519 char *m0, *r0, *c0, *p;
2524 exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
2526 [MALLOC_ZERO_RETURNS_NULL=yes],
2527 [MALLOC_ZERO_RETURNS_NULL=no],
2528 [MALLOC_ZERO_RETURNS_NULL=yes])
2530 AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
2532 if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
2533 MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
2534 XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
2535 XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
2537 MALLOC_ZERO_CFLAGS=""
2538 XMALLOC_ZERO_CFLAGS=""
2539 XTMALLOC_ZERO_CFLAGS=""
2542 AC_SUBST([MALLOC_ZERO_CFLAGS])
2543 AC_SUBST([XMALLOC_ZERO_CFLAGS])
2544 AC_SUBST([XTMALLOC_ZERO_CFLAGS])
2545 ]) # XORG_CHECK_MALLOC_ZERO
2549 # Minimum version: 1.1.0
2551 # This macro enables the use of a tool that flags some suspicious and
2552 # non-portable constructs (likely to be bugs) in C language source code.
2553 # It will attempt to locate the tool and use appropriate options.
2554 # There are various lint type tools on different platforms.
2556 # Interface to module:
2557 # LINT: returns the path to the tool found on the platform
2558 # or the value set to LINT on the configure cmd line
2559 # also an Automake conditional
2560 # LINT_FLAGS: an Automake variable with appropriate flags
2562 # --with-lint: 'yes' user instructs the module to use lint
2563 # 'no' user instructs the module not to use lint (default)
2565 # If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
2566 # If the user sets the value of LINT_FLAGS, they are used verbatim.
2568 AC_DEFUN([XORG_WITH_LINT],[
2570 AC_ARG_VAR([LINT], [Path to a lint-style command])
2571 AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
2572 AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
2573 [Use a lint-style source code checker (default: disabled)])],
2574 [use_lint=$withval], [use_lint=no])
2576 # Obtain platform specific info like program name and options
2577 # The lint program on FreeBSD and NetBSD is different from the one on Solaris
2579 *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
2581 lint_options="-badflag"
2583 *freebsd* | *netbsd*)
2585 lint_options="-u -b"
2589 lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
2593 # Test for the presence of the program (either guessed by the code or spelled out by the user)
2594 if test "x$use_lint" = x"yes" ; then
2595 AC_PATH_PROG([LINT], [$lint_name])
2596 if test "x$LINT" = "x"; then
2597 AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
2599 elif test "x$use_lint" = x"no" ; then
2600 if test "x$LINT" != "x"; then
2601 AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
2604 AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
2607 # User supplied flags override default flags
2608 if test "x$LINT_FLAGS" != "x"; then
2609 lint_options=$LINT_FLAGS
2612 AC_SUBST([LINT_FLAGS],[$lint_options])
2613 AM_CONDITIONAL(LINT, [test "x$LINT" != x])
2617 # XORG_LINT_LIBRARY(LIBNAME)
2618 # --------------------------
2619 # Minimum version: 1.1.0
2621 # Sets up flags for building lint libraries for checking programs that call
2622 # functions in the library.
2624 # Interface to module:
2625 # LINTLIB - Automake variable with the name of lint library file to make
2626 # MAKE_LINT_LIB - Automake conditional
2628 # --enable-lint-library: - 'yes' user instructs the module to created a lint library
2629 # - 'no' user instructs the module not to create a lint library (default)
2631 AC_DEFUN([XORG_LINT_LIBRARY],[
2632 AC_REQUIRE([XORG_WITH_LINT])
2633 AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
2634 [Create lint library (default: disabled)])],
2635 [make_lint_lib=$enableval], [make_lint_lib=no])
2637 if test "x$make_lint_lib" = x"yes" ; then
2639 if test "x$LINT" = "x"; then
2640 AC_MSG_ERROR([Cannot make lint library without --with-lint])
2642 elif test "x$make_lint_lib" != x"no" ; then
2643 AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
2647 AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
2649 ]) # XORG_LINT_LIBRARY
2651 # XORG_COMPILER_BRAND
2652 # -------------------
2653 # Minimum version: 1.14.0
2655 # Checks for various brands of compilers and sets flags as appropriate:
2656 # GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
2657 # GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
2658 # clang compiler - sets CLANGCC to "yes"
2659 # Intel compiler - sets INTELCC to "yes"
2660 # Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
2662 AC_DEFUN([XORG_COMPILER_BRAND], [
2665 AC_REQUIRE([AC_PROG_CC_C99])
2668 AC_REQUIRE([AC_PROG_CXX])
2671 AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
2672 AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
2673 AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
2674 ]) # XORG_COMPILER_BRAND
2676 # XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
2678 # Minimum version: 1.16.0
2680 # Test if the compiler works when passed the given flag as a command line argument.
2681 # If it succeeds, the flag is appeneded to the given variable. If not, it tries the
2682 # next flag in the list until there are no more options.
2684 # Note that this does not guarantee that the compiler supports the flag as some
2685 # compilers will simply ignore arguments that they do not understand, but we do
2686 # attempt to weed out false positives by using -Werror=unknown-warning-option and
2687 # -Werror=unused-command-line-argument
2689 AC_DEFUN([XORG_TESTSET_CFLAG], [
2690 m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
2691 m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
2693 AC_LANG_COMPILER_REQUIRE
2697 AC_REQUIRE([AC_PROG_CC_C99])
2698 define([PREFIX], [C])
2699 define([CACHE_PREFIX], [cc])
2700 define([COMPILER], [$CC])
2703 define([PREFIX], [CXX])
2704 define([CACHE_PREFIX], [cxx])
2705 define([COMPILER], [$CXX])
2709 [xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
2711 if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
2712 PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
2713 AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
2714 [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
2715 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
2716 [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
2717 [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
2718 [xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
2719 PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
2722 if test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
2723 if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
2724 PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
2726 PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
2727 AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
2728 [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
2729 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
2730 [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
2731 [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
2732 [xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
2733 PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
2737 m4_foreach([flag], m4_cdr($@), [
2738 if test $found = "no" ; then
2739 if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
2740 PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
2743 if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
2744 PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
2747 PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
2749 dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
2750 AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
2751 cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
2752 AC_CACHE_VAL($cacheid,
2753 [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
2754 [eval $cacheid=yes],
2755 [eval $cacheid=no])])
2757 PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
2759 eval supported=\$$cacheid
2760 AC_MSG_RESULT([$supported])
2761 if test "$supported" = "yes" ; then
2767 ]) # XORG_TESTSET_CFLAG
2769 # XORG_COMPILER_FLAGS
2771 # Minimum version: 1.16.0
2773 # Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
2774 # arguments supported by the selected compiler which do NOT alter the generated
2775 # code. These arguments will cause the compiler to print various warnings
2776 # during compilation AND turn a conservative set of warnings into errors.
2778 # The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
2779 # future versions of util-macros as options are added to new compilers.
2781 AC_DEFUN([XORG_COMPILER_FLAGS], [
2782 AC_REQUIRE([XORG_COMPILER_BRAND])
2784 AC_ARG_ENABLE(selective-werror,
2785 AS_HELP_STRING([--disable-selective-werror],
2786 [Turn off selective compiler errors. (default: enabled)]),
2787 [SELECTIVE_WERROR=$enableval],
2788 [SELECTIVE_WERROR=yes])
2792 define([PREFIX], [C])
2795 define([PREFIX], [CXX])
2798 # -v is too short to test reliably with XORG_TESTSET_CFLAG
2799 if test "x$SUNCC" = "xyes"; then
2800 [BASE_]PREFIX[FLAGS]="-v"
2802 [BASE_]PREFIX[FLAGS]=""
2805 # This chunk of warnings were those that existed in the legacy CWARNFLAGS
2806 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
2807 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
2808 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
2809 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
2813 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
2814 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
2815 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
2816 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
2817 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition])
2818 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
2822 # This chunk adds additional warnings that could catch undesired effects.
2823 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
2824 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
2825 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
2826 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
2827 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
2828 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
2829 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
2831 # These are currently disabled because they are noisy. They will be enabled
2832 # in the future once the codebase is sufficiently modernized to silence
2833 # them. For now, I don't want them to drown out the other warnings.
2834 # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
2835 # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
2836 # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
2838 # Turn some warnings into errors, so we don't accidently get successful builds
2839 # when there are problems that should be fixed.
2841 if test "x$SELECTIVE_WERROR" = "xyes" ; then
2842 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
2843 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
2844 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
2845 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
2846 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
2847 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
2848 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
2849 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
2850 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
2851 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
2852 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
2853 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
2854 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
2856 AC_MSG_WARN([You have chosen not to turn some select compiler warnings into errors. This should not be necessary. Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT])
2857 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
2858 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
2859 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
2860 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
2861 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
2862 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
2863 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
2864 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
2865 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
2866 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
2867 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
2868 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
2869 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
2872 AC_SUBST([BASE_]PREFIX[FLAGS])
2873 ]) # XORG_COMPILER_FLAGS
2877 # Minimum version: 1.2.0
2878 # Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
2880 # Defines CWARNFLAGS to enable C compiler warnings.
2882 # This function is deprecated because it defines -fno-strict-aliasing
2883 # which alters the code generated by the compiler. If -fno-strict-aliasing
2884 # is needed, then it should be added explicitly in the module when
2885 # it is updated to use BASE_CFLAGS.
2887 AC_DEFUN([XORG_CWARNFLAGS], [
2888 AC_REQUIRE([XORG_COMPILER_FLAGS])
2889 AC_REQUIRE([XORG_COMPILER_BRAND])
2892 CWARNFLAGS="$BASE_CFLAGS"
2893 if test "x$GCC" = xyes ; then
2894 CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
2896 AC_SUBST(CWARNFLAGS)
2899 ]) # XORG_CWARNFLAGS
2901 # XORG_STRICT_OPTION
2902 # -----------------------
2903 # Minimum version: 1.3.0
2905 # Add configure option to enable strict compilation flags, such as treating
2906 # warnings as fatal errors.
2907 # If --enable-strict-compilation is passed to configure, adds strict flags to
2908 # $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
2910 # Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
2911 # when strict compilation is unconditionally desired.
2912 AC_DEFUN([XORG_STRICT_OPTION], [
2913 AC_REQUIRE([XORG_CWARNFLAGS])
2914 AC_REQUIRE([XORG_COMPILER_FLAGS])
2916 AC_ARG_ENABLE(strict-compilation,
2917 AS_HELP_STRING([--enable-strict-compilation],
2918 [Enable all warnings from compiler and make them errors (default: disabled)]),
2919 [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
2923 define([PREFIX], [C])
2926 define([PREFIX], [CXX])
2930 [STRICT_]PREFIX[FLAGS]=""
2931 XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
2932 XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
2934 # Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
2935 # activate it with -Werror, so we add it here explicitly.
2936 XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
2938 if test "x$STRICT_COMPILE" = "xyes"; then
2939 [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
2940 AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
2942 AC_SUBST([STRICT_]PREFIX[FLAGS])
2943 AC_SUBST([BASE_]PREFIX[FLAGS])
2944 AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
2945 ]) # XORG_STRICT_OPTION
2947 # XORG_DEFAULT_OPTIONS
2948 # --------------------
2949 # Minimum version: 1.3.0
2951 # Defines default options for X.Org modules.
2953 AC_DEFUN([XORG_DEFAULT_OPTIONS], [
2954 AC_REQUIRE([AC_PROG_INSTALL])
2958 XORG_RELEASE_VERSION
2961 XORG_MANPAGE_SECTIONS
2962 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
2963 [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
2964 ]) # XORG_DEFAULT_OPTIONS
2968 # Minimum version: 1.4.0
2970 # Defines the variable INSTALL_CMD as the command to copy
2971 # INSTALL from $prefix/share/util-macros.
2973 AC_DEFUN([XORG_INSTALL], [
2974 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2975 macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
2976 INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
2977 mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
2978 || (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
2979 echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
2980 AC_SUBST([INSTALL_CMD])
2982 dnl Copyright 2005 Red Hat, Inc
2984 dnl Permission to use, copy, modify, distribute, and sell this software and its
2985 dnl documentation for any purpose is hereby granted without fee, provided that
2986 dnl the above copyright notice appear in all copies and that both that
2987 dnl copyright notice and this permission notice appear in supporting
2990 dnl The above copyright notice and this permission notice shall be included
2991 dnl in all copies or substantial portions of the Software.
2993 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2994 dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2995 dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
2996 dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
2997 dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
2998 dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2999 dnl OTHER DEALINGS IN THE SOFTWARE.
3001 dnl Except as contained in this notice, the name of the copyright holders shall
3002 dnl not be used in advertising or otherwise to promote the sale, use or
3003 dnl other dealings in this Software without prior written authorization
3004 dnl from the copyright holders.
3007 # XORG_RELEASE_VERSION
3008 # --------------------
3009 # Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
3011 AC_DEFUN([XORG_RELEASE_VERSION],[
3012 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
3013 [`echo $PACKAGE_VERSION | cut -d . -f 1`],
3014 [Major version of this package])
3015 PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
3016 if test "x$PVM" = "x"; then
3019 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
3021 [Minor version of this package])
3022 PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
3023 if test "x$PVP" = "x"; then
3026 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
3028 [Patch version of this package])
3033 # Minimum version: 1.2.0
3035 # Defines the variable CHANGELOG_CMD as the command to generate
3036 # ChangeLog from git.
3039 AC_DEFUN([XORG_CHANGELOG], [
3040 CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
3041 mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
3042 || (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
3043 echo 'git directory not found: installing possibly empty changelog.' >&2)"
3044 AC_SUBST([CHANGELOG_CMD])