1 # generated automatically by aclocal 1.11.6 -*- 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 # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
24 # serial 1 (pkg-config-0.24)
26 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
28 # This program is free software; you can redistribute it and/or modify
29 # it under the terms of the GNU General Public License as published by
30 # the Free Software Foundation; either version 2 of the License, or
31 # (at your option) any later version.
33 # This program is distributed in the hope that it will be useful, but
34 # WITHOUT ANY WARRANTY; without even the implied warranty of
35 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
36 # General Public License for more details.
38 # You should have received a copy of the GNU General Public License
39 # along with this program; if not, write to the Free Software
40 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
42 # As a special exception to the GNU General Public License, if you
43 # distribute this file as part of a program that contains a
44 # configuration script generated by Autoconf, you may include it under
45 # the same distribution terms that you use for the rest of that program.
47 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
48 # ----------------------------------
49 AC_DEFUN([PKG_PROG_PKG_CONFIG],
50 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
51 m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
52 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
53 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
54 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
56 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
57 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
59 if test -n "$PKG_CONFIG"; then
60 _pkg_min_version=m4_default([$1], [0.9.0])
61 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
62 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
69 ])# PKG_PROG_PKG_CONFIG
71 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
73 # Check to see whether a particular set of modules exists. Similar
74 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
76 # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
77 # only at the first occurence in configure.ac, so if the first place
78 # it's called might be skipped (such as if it is within an "if", you
79 # have to call PKG_CHECK_EXISTS manually
80 # --------------------------------------------------------------
81 AC_DEFUN([PKG_CHECK_EXISTS],
82 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
83 if test -n "$PKG_CONFIG" && \
84 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
90 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
91 # ---------------------------------------------
92 m4_define([_PKG_CONFIG],
93 [if test -n "$$1"; then
95 elif test -n "$PKG_CONFIG"; then
96 PKG_CHECK_EXISTS([$3],
97 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
104 # _PKG_SHORT_ERRORS_SUPPORTED
105 # -----------------------------
106 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
107 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
108 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
109 _pkg_short_errors_supported=yes
111 _pkg_short_errors_supported=no
113 ])# _PKG_SHORT_ERRORS_SUPPORTED
116 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
117 # [ACTION-IF-NOT-FOUND])
120 # Note that if there is a possibility the first call to
121 # PKG_CHECK_MODULES might not happen, you should be sure to include an
122 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
125 # --------------------------------------------------------------
126 AC_DEFUN([PKG_CHECK_MODULES],
127 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
128 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
129 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
132 AC_MSG_CHECKING([for $1])
134 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
135 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
137 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
138 and $1[]_LIBS to avoid the need to call pkg-config.
139 See the pkg-config man page for more details.])
141 if test $pkg_failed = yes; then
143 _PKG_SHORT_ERRORS_SUPPORTED
144 if test $_pkg_short_errors_supported = yes; then
145 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
147 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
149 # Put the nasty error message in config.log where it belongs
150 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
152 m4_default([$4], [AC_MSG_ERROR(
153 [Package requirements ($2) were not met:
157 Consider adjusting the PKG_CONFIG_PATH environment variable if you
158 installed software in a non-standard prefix.
162 elif test $pkg_failed = untried; then
164 m4_default([$4], [AC_MSG_FAILURE(
165 [The pkg-config script could not be found or is too old. Make sure it
166 is in your PATH or set the PKG_CONFIG environment variable to the full
171 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])
174 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
175 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
179 ])# PKG_CHECK_MODULES
181 # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
184 # This file is free software; the Free Software Foundation
185 # gives unlimited permission to copy and/or distribute it,
186 # with or without modifications, as long as this notice is preserved.
190 # AM_AUTOMAKE_VERSION(VERSION)
191 # ----------------------------
192 # Automake X.Y traces this macro to ensure aclocal.m4 has been
193 # generated from the m4 files accompanying Automake X.Y.
194 # (This private macro should not be called outside this file.)
195 AC_DEFUN([AM_AUTOMAKE_VERSION],
196 [am__api_version='1.11'
197 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
198 dnl require some minimum version. Point them to the right macro.
199 m4_if([$1], [1.11.6], [],
200 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
203 # _AM_AUTOCONF_VERSION(VERSION)
204 # -----------------------------
205 # aclocal traces this macro to find the Autoconf version.
206 # This is a private macro too. Using m4_define simplifies
207 # the logic in aclocal, which can simply ignore this definition.
208 m4_define([_AM_AUTOCONF_VERSION], [])
210 # AM_SET_CURRENT_AUTOMAKE_VERSION
211 # -------------------------------
212 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
213 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
214 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
215 [AM_AUTOMAKE_VERSION([1.11.6])dnl
216 m4_ifndef([AC_AUTOCONF_VERSION],
217 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
218 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
220 # Figure out how to run the assembler. -*- Autoconf -*-
222 # Copyright (C) 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
224 # This file is free software; the Free Software Foundation
225 # gives unlimited permission to copy and/or distribute it,
226 # with or without modifications, as long as this notice is preserved.
232 AC_DEFUN([AM_PROG_AS],
233 [# By default we simply use the C compiler to build assembly code.
234 AC_REQUIRE([AC_PROG_CC])
235 test "${CCAS+set}" = set || CCAS=$CC
236 test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
237 AC_ARG_VAR([CCAS], [assembler compiler command (defaults to CC)])
238 AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)])
239 _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl
242 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
244 # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
246 # This file is free software; the Free Software Foundation
247 # gives unlimited permission to copy and/or distribute it,
248 # with or without modifications, as long as this notice is preserved.
252 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
253 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
254 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
256 # Of course, Automake must honor this variable whenever it calls a
257 # tool from the auxiliary directory. The problem is that $srcdir (and
258 # therefore $ac_aux_dir as well) can be either absolute or relative,
259 # depending on how configure is run. This is pretty annoying, since
260 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
261 # source directory, any form will work fine, but in subdirectories a
262 # relative path needs to be adjusted first.
264 # $ac_aux_dir/missing
265 # fails when called from a subdirectory if $ac_aux_dir is relative
266 # $top_srcdir/$ac_aux_dir/missing
267 # fails if $ac_aux_dir is absolute,
268 # fails when called from a subdirectory in a VPATH build with
269 # a relative $ac_aux_dir
271 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
272 # are both prefixed by $srcdir. In an in-source build this is usually
273 # harmless because $srcdir is `.', but things will broke when you
274 # start a VPATH build or use an absolute $srcdir.
276 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
277 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
278 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
279 # and then we would define $MISSING as
280 # MISSING="\${SHELL} $am_aux_dir/missing"
281 # This will work as long as MISSING is not called from configure, because
282 # unfortunately $(top_srcdir) has no meaning in configure.
283 # However there are other variables, like CC, which are often used in
284 # configure, and could therefore not use this "fixed" $ac_aux_dir.
286 # Another solution, used here, is to always expand $ac_aux_dir to an
287 # absolute PATH. The drawback is that using absolute paths prevent a
288 # configured tree to be moved without reconfiguration.
290 AC_DEFUN([AM_AUX_DIR_EXPAND],
291 [dnl Rely on autoconf to set up CDPATH properly.
293 # expand $ac_aux_dir to an absolute path
294 am_aux_dir=`cd $ac_aux_dir && pwd`
297 # AM_CONDITIONAL -*- Autoconf -*-
299 # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
300 # Free Software Foundation, Inc.
302 # This file is free software; the Free Software Foundation
303 # gives unlimited permission to copy and/or distribute it,
304 # with or without modifications, as long as this notice is preserved.
308 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
309 # -------------------------------------
310 # Define a conditional.
311 AC_DEFUN([AM_CONDITIONAL],
313 ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
314 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
315 AC_SUBST([$1_TRUE])dnl
316 AC_SUBST([$1_FALSE])dnl
317 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
318 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
319 m4_define([_AM_COND_VALUE_$1], [$2])dnl
327 AC_CONFIG_COMMANDS_PRE(
328 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
329 AC_MSG_ERROR([[conditional "$1" was never defined.
330 Usually this means the macro was only invoked conditionally.]])
333 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
334 # 2010, 2011 Free Software Foundation, Inc.
336 # This file is free software; the Free Software Foundation
337 # gives unlimited permission to copy and/or distribute it,
338 # with or without modifications, as long as this notice is preserved.
342 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
343 # written in clear, in which case automake, when reading aclocal.m4,
344 # will think it sees a *use*, and therefore will trigger all it's
345 # C support machinery. Also note that it means that autoscan, seeing
346 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
349 # _AM_DEPENDENCIES(NAME)
350 # ----------------------
351 # See how the compiler implements dependency checking.
352 # NAME is "CC", "CXX", "GCJ", or "OBJC".
353 # We try a few techniques and use that to set a single cache variable.
355 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
356 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
357 # dependency, and given that the user is not expected to run this macro,
358 # just rely on AC_PROG_CC.
359 AC_DEFUN([_AM_DEPENDENCIES],
360 [AC_REQUIRE([AM_SET_DEPDIR])dnl
361 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
362 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
363 AC_REQUIRE([AM_DEP_TRACK])dnl
365 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
366 [$1], CXX, [depcc="$CXX" am_compiler_list=],
367 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
368 [$1], UPC, [depcc="$UPC" am_compiler_list=],
369 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
370 [depcc="$$1" am_compiler_list=])
372 AC_CACHE_CHECK([dependency style of $depcc],
373 [am_cv_$1_dependencies_compiler_type],
374 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
375 # We make a subdir and do the tests there. Otherwise we can end up
376 # making bogus files that we don't know about and never remove. For
377 # instance it was reported that on HP-UX the gcc test will end up
378 # making a dummy file named `D' -- because `-MD' means `put the output
382 # Copy depcomp to subdir because otherwise we won't find it if we're
383 # using a relative directory.
384 cp "$am_depcomp" conftest.dir
386 # We will build objects and dependencies in a subdirectory because
387 # it helps to detect inapplicable dependency modes. For instance
388 # both Tru64's cc and ICC support -MD to output dependencies as a
389 # side effect of compilation, but ICC will put the dependencies in
390 # the current directory while Tru64 will put them in the object
394 am_cv_$1_dependencies_compiler_type=none
395 if test "$am_compiler_list" = ""; then
396 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
400 [case " $depcc " in #(
401 *\ -arch\ *\ -arch\ *) am__universal=true ;;
404 [case " $depcc " in #(
405 *\ -arch\ *\ -arch\ *) am__universal=true ;;
408 for depmode in $am_compiler_list; do
409 # Setup a source with many dependencies, because some compilers
410 # like to wrap large dependency lists on column 80 (with \), and
411 # we should not choose a depcomp mode which is confused by this.
413 # We need to recreate these files for each test, as the compiler may
414 # overwrite some of them when testing with obscure command lines.
415 # This happens at least with the AIX C compiler.
417 for i in 1 2 3 4 5 6; do
418 echo '#include "conftst'$i'.h"' >> sub/conftest.c
419 # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
420 # Solaris 8's {/usr,}/bin/sh.
421 touch sub/conftst$i.h
423 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
425 # We check with `-c' and `-o' for the sake of the "dashmstdout"
426 # mode. It turns out that the SunPro C++ compiler does not properly
427 # handle `-M -o', and we need to detect this. Also, some Intel
428 # versions had trouble with output in subdirs
429 am__obj=sub/conftest.${OBJEXT-o}
430 am__minus_obj="-o $am__obj"
433 # This depmode causes a compiler race in universal mode.
434 test "$am__universal" = false || continue
437 # after this tag, mechanisms are not by side-effect, so they'll
438 # only be used when explicitly requested
439 if test "x$enable_dependency_tracking" = xyes; then
445 msvc7 | msvc7msys | msvisualcpp | msvcmsys)
446 # This compiler won't grok `-c -o', but also, the minuso test has
447 # not run yet. These depmodes are late enough in the game, and
448 # so weak that their functioning should not be impacted.
449 am__obj=conftest.${OBJEXT-o}
454 if depmode=$depmode \
455 source=sub/conftest.c object=$am__obj \
456 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
457 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
458 >/dev/null 2>conftest.err &&
459 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
460 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
461 grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
462 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
463 # icc doesn't choke on unknown options, it will just issue warnings
464 # or remarks (even with -Werror). So we grep stderr for any message
465 # that says an option was ignored or not supported.
466 # When given -MP, icc 7.0 and 7.1 complain thusly:
467 # icc: Command line warning: ignoring option '-M'; no argument required
468 # The diagnosis changed in icc 8.0:
469 # icc: Command line remark: option '-MP' not supported
470 if (grep 'ignoring option' conftest.err ||
471 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
472 am_cv_$1_dependencies_compiler_type=$depmode
481 am_cv_$1_dependencies_compiler_type=none
484 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
485 AM_CONDITIONAL([am__fastdep$1], [
486 test "x$enable_dependency_tracking" != xno \
487 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
493 # Choose a directory name for dependency files.
494 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
495 AC_DEFUN([AM_SET_DEPDIR],
496 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
497 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
503 AC_DEFUN([AM_DEP_TRACK],
504 [AC_ARG_ENABLE(dependency-tracking,
505 [ --disable-dependency-tracking speeds up one-time build
506 --enable-dependency-tracking do not reject slow dependency extractors])
507 if test "x$enable_dependency_tracking" != xno; then
508 am_depcomp="$ac_aux_dir/depcomp"
512 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
513 AC_SUBST([AMDEPBACKSLASH])dnl
514 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
515 AC_SUBST([am__nodep])dnl
516 _AM_SUBST_NOTMAKE([am__nodep])dnl
519 # Generate code to set up dependency tracking. -*- Autoconf -*-
521 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
522 # Free Software Foundation, Inc.
524 # This file is free software; the Free Software Foundation
525 # gives unlimited permission to copy and/or distribute it,
526 # with or without modifications, as long as this notice is preserved.
530 # _AM_OUTPUT_DEPENDENCY_COMMANDS
531 # ------------------------------
532 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
534 # Autoconf 2.62 quotes --file arguments for eval, but not when files
535 # are listed without --file. Let's play safe and only enable the eval
536 # if we detect the quoting.
537 case $CONFIG_FILES in
538 *\'*) eval set x "$CONFIG_FILES" ;;
539 *) set x $CONFIG_FILES ;;
544 # Strip MF so we end up with the name of the file.
545 mf=`echo "$mf" | sed -e 's/:.*$//'`
546 # Check whether this is an Automake generated Makefile or not.
547 # We used to match only the files named `Makefile.in', but
548 # some people rename them; so instead we look at the file content.
549 # Grep'ing the first line is not enough: some people post-process
550 # each Makefile.in and add a new line on top of each file to say so.
551 # Grep'ing the whole file is not good either: AIX grep has a line
552 # limit of 2048, but all sed's we know have understand at least 4000.
553 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
554 dirpart=`AS_DIRNAME("$mf")`
558 # Extract the definition of DEPDIR, am__include, and am__quote
559 # from the Makefile without running `make'.
560 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
561 test -z "$DEPDIR" && continue
562 am__include=`sed -n 's/^am__include = //p' < "$mf"`
563 test -z "am__include" && continue
564 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
565 # When using ansi2knr, U may be empty or an underscore; expand it
566 U=`sed -n 's/^U = //p' < "$mf"`
567 # Find all dependency output files, they are included files with
568 # $(DEPDIR) in their names. We invoke sed twice because it is the
569 # simplest approach to changing $(DEPDIR) to its actual value in the
571 for file in `sed -n "
572 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
573 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
574 # Make sure the directory exists.
575 test -f "$dirpart/$file" && continue
576 fdir=`AS_DIRNAME(["$file"])`
577 AS_MKDIR_P([$dirpart/$fdir])
578 # echo "creating $dirpart/$file"
579 echo '# dummy' > "$dirpart/$file"
583 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
586 # AM_OUTPUT_DEPENDENCY_COMMANDS
587 # -----------------------------
588 # This macro should only be invoked once -- use via AC_REQUIRE.
590 # This code is only required when automatic dependency tracking
591 # is enabled. FIXME. This creates each `.P' file that we will
592 # need in order to bootstrap the dependency handling code.
593 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
594 [AC_CONFIG_COMMANDS([depfiles],
595 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
596 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
599 # Do all the work for Automake. -*- Autoconf -*-
601 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
602 # 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
604 # This file is free software; the Free Software Foundation
605 # gives unlimited permission to copy and/or distribute it,
606 # with or without modifications, as long as this notice is preserved.
610 # This macro actually does too much. Some checks are only needed if
611 # your package does certain things. But this isn't really a big deal.
613 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
614 # AM_INIT_AUTOMAKE([OPTIONS])
615 # -----------------------------------------------
616 # The call with PACKAGE and VERSION arguments is the old style
617 # call (pre autoconf-2.50), which is being phased out. PACKAGE
618 # and VERSION should now be passed to AC_INIT and removed from
619 # the call to AM_INIT_AUTOMAKE.
620 # We support both call styles for the transition. After
621 # the next Automake release, Autoconf can make the AC_INIT
622 # arguments mandatory, and then we can depend on a new Autoconf
623 # release and drop the old call support.
624 AC_DEFUN([AM_INIT_AUTOMAKE],
625 [AC_PREREQ([2.62])dnl
626 dnl Autoconf wants to disallow AM_ names. We explicitly allow
627 dnl the ones we care about.
628 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
629 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
630 AC_REQUIRE([AC_PROG_INSTALL])dnl
631 if test "`cd $srcdir && pwd`" != "`pwd`"; then
632 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
633 # is not polluted with repeated "-I."
634 AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
635 # test to see if srcdir already configured
636 if test -f $srcdir/config.status; then
637 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
641 # test whether we have cygpath
642 if test -z "$CYGPATH_W"; then
643 if (cygpath --version) >/dev/null 2>/dev/null; then
644 CYGPATH_W='cygpath -w'
649 AC_SUBST([CYGPATH_W])
651 # Define the identity of the package.
652 dnl Distinguish between old-style and new-style calls.
654 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
655 AC_SUBST([PACKAGE], [$1])dnl
656 AC_SUBST([VERSION], [$2])],
657 [_AM_SET_OPTIONS([$1])dnl
658 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
659 m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
660 [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
661 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
662 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
664 _AM_IF_OPTION([no-define],,
665 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
666 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
668 # Some tools Automake needs.
669 AC_REQUIRE([AM_SANITY_CHECK])dnl
670 AC_REQUIRE([AC_ARG_PROGRAM])dnl
671 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
672 AM_MISSING_PROG(AUTOCONF, autoconf)
673 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
674 AM_MISSING_PROG(AUTOHEADER, autoheader)
675 AM_MISSING_PROG(MAKEINFO, makeinfo)
676 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
677 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
678 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
679 # We need awk for the "check" target. The system "awk" is bad on
681 AC_REQUIRE([AC_PROG_AWK])dnl
682 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
683 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
684 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
685 [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
686 [_AM_PROG_TAR([v7])])])
687 _AM_IF_OPTION([no-dependencies],,
688 [AC_PROVIDE_IFELSE([AC_PROG_CC],
689 [_AM_DEPENDENCIES(CC)],
690 [define([AC_PROG_CC],
691 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
692 AC_PROVIDE_IFELSE([AC_PROG_CXX],
693 [_AM_DEPENDENCIES(CXX)],
694 [define([AC_PROG_CXX],
695 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
696 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
697 [_AM_DEPENDENCIES(OBJC)],
698 [define([AC_PROG_OBJC],
699 defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
701 _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
702 dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
703 dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
704 dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
705 AC_CONFIG_COMMANDS_PRE(dnl
706 [m4_provide_if([_AM_COMPILER_EXEEXT],
707 [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
710 dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
711 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
712 dnl mangled by Autoconf and run in a shell conditional statement.
713 m4_define([_AC_COMPILER_EXEEXT],
714 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
717 # When config.status generates a header, we must update the stamp-h file.
718 # This file resides in the same directory as the config header
719 # that is generated. The stamp files are numbered to have different names.
721 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
722 # loop where config.status creates the headers, so we can generate
723 # our stamp files there.
724 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
725 [# Compute $1's index in $config_headers.
728 for _am_header in $config_headers :; do
730 $_am_arg | $_am_arg:* )
733 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
736 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
738 # Copyright (C) 2001, 2003, 2005, 2008, 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 # Define $install_sh.
750 AC_DEFUN([AM_PROG_INSTALL_SH],
751 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
752 if test x"${install_sh}" != xset; then
755 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
757 install_sh="\${SHELL} $am_aux_dir/install-sh"
760 AC_SUBST(install_sh)])
762 # Copyright (C) 2003, 2005 Free Software Foundation, Inc.
764 # This file is free software; the Free Software Foundation
765 # gives unlimited permission to copy and/or distribute it,
766 # with or without modifications, as long as this notice is preserved.
770 # Check whether the underlying file-system supports filenames
771 # with a leading dot. For instance MS-DOS doesn't.
772 AC_DEFUN([AM_SET_LEADING_DOT],
773 [rm -rf .tst 2>/dev/null
774 mkdir .tst 2>/dev/null
775 if test -d .tst; then
780 rmdir .tst 2>/dev/null
781 AC_SUBST([am__leading_dot])])
783 # Check to see how 'make' treats includes. -*- Autoconf -*-
785 # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
787 # This file is free software; the Free Software Foundation
788 # gives unlimited permission to copy and/or distribute it,
789 # with or without modifications, as long as this notice is preserved.
795 # Check to see how make treats includes.
796 AC_DEFUN([AM_MAKE_INCLUDE],
797 [am_make=${MAKE-make}
798 cat > confinc << 'END'
800 @echo this is the am__doit target
803 # If we don't find an include directive, just comment out the code.
804 AC_MSG_CHECKING([for style of include used by $am_make])
808 # First try GNU make style include.
809 echo "include confinc" > confmf
810 # Ignore all kinds of additional output from `make'.
811 case `$am_make -s -f confmf 2> /dev/null` in #(
812 *the\ am__doit\ target*)
818 # Now try BSD make style include.
819 if test "$am__include" = "#"; then
820 echo '.include "confinc"' > confmf
821 case `$am_make -s -f confmf 2> /dev/null` in #(
822 *the\ am__doit\ target*)
829 AC_SUBST([am__include])
830 AC_SUBST([am__quote])
831 AC_MSG_RESULT([$_am_result])
835 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
837 # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
838 # Free Software Foundation, Inc.
840 # This file is free software; the Free Software Foundation
841 # gives unlimited permission to copy and/or distribute it,
842 # with or without modifications, as long as this notice is preserved.
846 # AM_MISSING_PROG(NAME, PROGRAM)
847 # ------------------------------
848 AC_DEFUN([AM_MISSING_PROG],
849 [AC_REQUIRE([AM_MISSING_HAS_RUN])
850 $1=${$1-"${am_missing_run}$2"}
856 # Define MISSING if not defined so far and test if it supports --run.
857 # If it does, set am_missing_run to use it, otherwise, to nothing.
858 AC_DEFUN([AM_MISSING_HAS_RUN],
859 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
860 AC_REQUIRE_AUX_FILE([missing])dnl
861 if test x"${MISSING+set}" != xset; then
864 MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
866 MISSING="\${SHELL} $am_aux_dir/missing" ;;
869 # Use eval to expand $SHELL
870 if eval "$MISSING --run true"; then
871 am_missing_run="$MISSING --run "
874 AC_MSG_WARN([`missing' script is too old or missing])
878 # Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
881 # This file is free software; the Free Software Foundation
882 # gives unlimited permission to copy and/or distribute it,
883 # with or without modifications, as long as this notice is preserved.
889 # Check for `mkdir -p'.
890 AC_DEFUN([AM_PROG_MKDIR_P],
891 [AC_PREREQ([2.60])dnl
892 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
893 dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
894 dnl while keeping a definition of mkdir_p for backward compatibility.
895 dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
896 dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
897 dnl Makefile.ins that do not define MKDIR_P, so we do our own
898 dnl adjustment using top_builddir (which is defined more often than
900 AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
902 [[\\/$]]* | ?:[[\\/]]*) ;;
903 */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
907 # Helper functions for option handling. -*- Autoconf -*-
909 # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
912 # This file is free software; the Free Software Foundation
913 # gives unlimited permission to copy and/or distribute it,
914 # with or without modifications, as long as this notice is preserved.
918 # _AM_MANGLE_OPTION(NAME)
919 # -----------------------
920 AC_DEFUN([_AM_MANGLE_OPTION],
921 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
923 # _AM_SET_OPTION(NAME)
924 # --------------------
925 # Set option NAME. Presently that only means defining a flag for this option.
926 AC_DEFUN([_AM_SET_OPTION],
927 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
929 # _AM_SET_OPTIONS(OPTIONS)
930 # ------------------------
931 # OPTIONS is a space-separated list of Automake options.
932 AC_DEFUN([_AM_SET_OPTIONS],
933 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
935 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
936 # -------------------------------------------
937 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
938 AC_DEFUN([_AM_IF_OPTION],
939 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
941 # Check to make sure that the build environment is sane. -*- Autoconf -*-
943 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
944 # 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.
954 AC_DEFUN([AM_SANITY_CHECK],
955 [AC_MSG_CHECKING([whether build environment is sane])
958 echo timestamp > conftest.file
959 # Reject unsafe characters in $srcdir or the absolute working directory
960 # name. Accept space and tab only in the latter.
964 *[[\\\"\#\$\&\'\`$am_lf]]*)
965 AC_MSG_ERROR([unsafe absolute working directory name]);;
968 *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
969 AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
972 # Do `set' in a subshell so we don't clobber the current shell's
973 # arguments. Must try -L first in case configure is actually a
974 # symlink; some systems play weird games with the mod time of symlinks
975 # (eg FreeBSD returns the mod time of the symlink's containing
978 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
979 if test "$[*]" = "X"; then
981 set X `ls -t "$srcdir/configure" conftest.file`
984 if test "$[*]" != "X $srcdir/configure conftest.file" \
985 && test "$[*]" != "X conftest.file $srcdir/configure"; then
987 # If neither matched, then we have a broken ls. This can happen
988 # if, for instance, CONFIG_SHELL is bash and it inherits a
989 # broken ls alias from the environment. This has actually
990 # happened. Such a system could not be considered "sane".
991 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
992 alias in your environment])
995 test "$[2]" = conftest.file
1001 AC_MSG_ERROR([newly created file is older than distributed files!
1002 Check your system clock])
1004 AC_MSG_RESULT(yes)])
1006 # Copyright (C) 2009, 2011 Free Software Foundation, Inc.
1008 # This file is free software; the Free Software Foundation
1009 # gives unlimited permission to copy and/or distribute it,
1010 # with or without modifications, as long as this notice is preserved.
1014 # AM_SILENT_RULES([DEFAULT])
1015 # --------------------------
1016 # Enable less verbose build rules; with the default set to DEFAULT
1017 # (`yes' being less verbose, `no' or empty being verbose).
1018 AC_DEFUN([AM_SILENT_RULES],
1019 [AC_ARG_ENABLE([silent-rules],
1020 [ --enable-silent-rules less verbose build output (undo: `make V=1')
1021 --disable-silent-rules verbose build output (undo: `make V=0')])
1022 case $enable_silent_rules in
1023 yes) AM_DEFAULT_VERBOSITY=0;;
1024 no) AM_DEFAULT_VERBOSITY=1;;
1025 *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
1028 dnl A few `make' implementations (e.g., NonStop OS and NextStep)
1029 dnl do not support nested variable expansions.
1030 dnl See automake bug#9928 and bug#10237.
1031 am_make=${MAKE-make}
1032 AC_CACHE_CHECK([whether $am_make supports nested variables],
1033 [am_cv_make_support_nested_variables],
1034 [if AS_ECHO([['TRUE=$(BAR$(V))
1040 .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
1041 am_cv_make_support_nested_variables=yes
1043 am_cv_make_support_nested_variables=no
1045 if test $am_cv_make_support_nested_variables = yes; then
1046 dnl Using `$V' instead of `$(V)' breaks IRIX make.
1048 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
1050 AM_V=$AM_DEFAULT_VERBOSITY
1051 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
1054 AM_SUBST_NOTMAKE([AM_V])dnl
1055 AC_SUBST([AM_DEFAULT_V])dnl
1056 AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
1057 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
1059 AC_SUBST([AM_BACKSLASH])dnl
1060 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
1063 # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
1065 # This file is free software; the Free Software Foundation
1066 # gives unlimited permission to copy and/or distribute it,
1067 # with or without modifications, as long as this notice is preserved.
1071 # AM_PROG_INSTALL_STRIP
1072 # ---------------------
1073 # One issue with vendor `install' (even GNU) is that you can't
1074 # specify the program used to strip binaries. This is especially
1075 # annoying in cross-compiling environments, where the build's strip
1076 # is unlikely to handle the host's binaries.
1077 # Fortunately install-sh will honor a STRIPPROG variable, so we
1078 # always use install-sh in `make install-strip', and initialize
1079 # STRIPPROG with the value of the STRIP variable (set by the user).
1080 AC_DEFUN([AM_PROG_INSTALL_STRIP],
1081 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1082 # Installed binaries are usually stripped using `strip' when the user
1083 # run `make install-strip'. However `strip' might not be the right
1084 # tool to use in cross-compilation environments, therefore Automake
1085 # will honor the `STRIP' environment variable to overrule this program.
1086 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
1087 if test "$cross_compiling" != no; then
1088 AC_CHECK_TOOL([STRIP], [strip], :)
1090 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1091 AC_SUBST([INSTALL_STRIP_PROGRAM])])
1093 # Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
1095 # This file is free software; the Free Software Foundation
1096 # gives unlimited permission to copy and/or distribute it,
1097 # with or without modifications, as long as this notice is preserved.
1101 # _AM_SUBST_NOTMAKE(VARIABLE)
1102 # ---------------------------
1103 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1104 # This macro is traced by Automake.
1105 AC_DEFUN([_AM_SUBST_NOTMAKE])
1107 # AM_SUBST_NOTMAKE(VARIABLE)
1108 # --------------------------
1109 # Public sister of _AM_SUBST_NOTMAKE.
1110 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1112 # Check how to create a tarball. -*- Autoconf -*-
1114 # Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
1116 # This file is free software; the Free Software Foundation
1117 # gives unlimited permission to copy and/or distribute it,
1118 # with or without modifications, as long as this notice is preserved.
1122 # _AM_PROG_TAR(FORMAT)
1123 # --------------------
1124 # Check how to create a tarball in format FORMAT.
1125 # FORMAT should be one of `v7', `ustar', or `pax'.
1127 # Substitute a variable $(am__tar) that is a command
1128 # writing to stdout a FORMAT-tarball containing the directory
1130 # tardir=directory && $(am__tar) > result.tar
1132 # Substitute a variable $(am__untar) that extract such
1133 # a tarball read from stdin.
1134 # $(am__untar) < result.tar
1135 AC_DEFUN([_AM_PROG_TAR],
1136 [# Always define AMTAR for backward compatibility. Yes, it's still used
1137 # in the wild :-( We should find a proper way to deprecate it ...
1138 AC_SUBST([AMTAR], ['$${TAR-tar}'])
1140 [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
1141 [m4_case([$1], [ustar],, [pax],,
1142 [m4_fatal([Unknown tar format])])
1143 AC_MSG_CHECKING([how to create a $1 tar archive])
1144 # Loop over all known methods to create a tar archive until one works.
1145 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1146 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
1147 # Do not fold the above two line into one, because Tru64 sh and
1148 # Solaris sh will not grok spaces in the rhs of `-'.
1149 for _am_tool in $_am_tools
1153 for _am_tar in tar gnutar gtar;
1155 AM_RUN_LOG([$_am_tar --version]) && break
1157 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1158 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1159 am__untar="$_am_tar -xf -"
1162 # Must skip GNU tar: if it does not support --format= it doesn't create
1163 # ustar tarball either.
1164 (tar --version) >/dev/null 2>&1 && continue
1165 am__tar='tar chf - "$$tardir"'
1166 am__tar_='tar chf - "$tardir"'
1167 am__untar='tar xf -'
1170 am__tar='pax -L -x $1 -w "$$tardir"'
1171 am__tar_='pax -L -x $1 -w "$tardir"'
1175 am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1176 am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1177 am__untar='cpio -i -H $1 -d'
1186 # If the value was cached, stop now. We just wanted to have am__tar
1187 # and am__untar set.
1188 test -n "${am_cv_prog_tar_$1}" && break
1190 # tar/untar a dummy directory, and stop if the command works
1193 echo GrepMe > conftest.dir/file
1194 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1196 if test -s conftest.tar; then
1197 AM_RUN_LOG([$am__untar <conftest.tar])
1198 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1203 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1204 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1206 AC_SUBST([am__untar])
1209 m4_include([m4/ac_define_dir.m4])
1210 m4_include([m4/libtool.m4])
1211 m4_include([m4/ltoptions.m4])
1212 m4_include([m4/ltsugar.m4])
1213 m4_include([m4/ltversion.m4])
1214 m4_include([m4/lt~obsolete.m4])
1215 m4_include([m4/xorg-tls.m4])
1216 dnl fontutil.m4. Generated from fontutil.m4.in by configure.
1218 dnl This file comes from X.Org's font-util 1.3.0
1220 dnl Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
1222 dnl Permission is hereby granted, free of charge, to any person obtaining a
1223 dnl copy of this software and associated documentation files (the "Software"),
1224 dnl to deal in the Software without restriction, including without limitation
1225 dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
1226 dnl and/or sell copies of the Software, and to permit persons to whom the
1227 dnl Software is furnished to do so, subject to the following conditions:
1229 dnl The above copyright notice and this permission notice (including the next
1230 dnl paragraph) shall be included in all copies or substantial portions of the
1233 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1234 dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1235 dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
1236 dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1237 dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1238 dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1239 dnl DEALINGS IN THE SOFTWARE.
1241 dnl --------------------------------------------------------------------
1243 dnl Copyright 2005 Red Hat, Inc
1245 dnl Permission to use, copy, modify, distribute, and sell this software and its
1246 dnl documentation for any purpose is hereby granted without fee, provided that
1247 dnl the above copyright notice appear in all copies and that both that
1248 dnl copyright notice and this permission notice appear in supporting
1251 dnl The above copyright notice and this permission notice shall be included
1252 dnl in all copies or substantial portions of the Software.
1254 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1255 dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1256 dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1257 dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1258 dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1259 dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1260 dnl OTHER DEALINGS IN THE SOFTWARE.
1262 dnl Except as contained in this notice, the name of the copyright holders shall
1263 dnl not be used in advertising or otherwise to promote the sale, use or
1264 dnl other dealings in this Software without prior written authorization
1265 dnl from the copyright holders.
1267 # XORG_FONT_MACROS_VERSION(required-version)
1268 # ------------------------------------------
1269 # Minimum version: 1.1.0
1271 # If you're using a macro added in Version 1.1 or newer, include this in
1272 # your configure.ac with the minimum required version, such as:
1273 # XORG_FONT_MACROS_VERSION(1.1)
1275 # To ensure that this macro is defined, also add:
1276 # m4_ifndef([XORG_FONT_MACROS_VERSION],
1277 # [m4_fatal([must install X.Org font-util 1.1 or later before running autoconf/autogen])])
1280 # See the "minimum version" comment for each macro you use to see what
1281 # version you require.
1282 m4_defun([XORG_FONT_MACROS_VERSION],[
1283 m4_define([vers_have], [1.3.0])
1284 m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1285 m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1286 m4_if(m4_cmp(maj_have, maj_needed), 0,,
1287 [m4_fatal([font-util major version ]maj_needed[ is required but ]vers_have[ found])])
1288 m4_if(m4_version_compare(vers_have, [$1]), -1,
1289 [m4_fatal([font-util version $1 or higher is required but ]vers_have[ found])])
1290 m4_undefine([vers_have])
1291 m4_undefine([maj_have])
1292 m4_undefine([maj_needed])
1293 ]) # XORG_FONT_MACROS_VERSION
1295 # XORG_FONT_CHECK_{maps}()
1296 # ------------------------
1297 # Minimum version: 1.0.0
1298 # These macros add --enable/disable-{maps} where {maps} are ISO8859-*,
1299 # JISX0201 or KOI8_R. By default, they are all enabled.
1301 AC_DEFUN([XORG_FONT_CHECK_ISO8859_1], [XORG_FONT_CHECK_ENCODING(ISO8859-1)])
1302 AC_DEFUN([XORG_FONT_CHECK_ISO8859_2], [XORG_FONT_CHECK_ENCODING(ISO8859-2)])
1303 AC_DEFUN([XORG_FONT_CHECK_ISO8859_3], [XORG_FONT_CHECK_ENCODING(ISO8859-3)])
1304 AC_DEFUN([XORG_FONT_CHECK_ISO8859_4], [XORG_FONT_CHECK_ENCODING(ISO8859-4)])
1305 AC_DEFUN([XORG_FONT_CHECK_ISO8859_5], [XORG_FONT_CHECK_ENCODING(ISO8859-5)])
1306 AC_DEFUN([XORG_FONT_CHECK_ISO8859_6], [XORG_FONT_CHECK_ENCODING(ISO8859-6)])
1307 AC_DEFUN([XORG_FONT_CHECK_ISO8859_7], [XORG_FONT_CHECK_ENCODING(ISO8859-7)])
1308 AC_DEFUN([XORG_FONT_CHECK_ISO8859_8], [XORG_FONT_CHECK_ENCODING(ISO8859-8)])
1309 AC_DEFUN([XORG_FONT_CHECK_ISO8859_9], [XORG_FONT_CHECK_ENCODING(ISO8859-9)])
1310 AC_DEFUN([XORG_FONT_CHECK_ISO8859_10],[XORG_FONT_CHECK_ENCODING(ISO8859-10)])
1311 AC_DEFUN([XORG_FONT_CHECK_ISO8859_11],[XORG_FONT_CHECK_ENCODING(ISO8859-11)])
1312 AC_DEFUN([XORG_FONT_CHECK_ISO8859_12],[XORG_FONT_CHECK_ENCODING(ISO8859-12)])
1313 AC_DEFUN([XORG_FONT_CHECK_ISO8859_13],[XORG_FONT_CHECK_ENCODING(ISO8859-13)])
1314 AC_DEFUN([XORG_FONT_CHECK_ISO8859_14],[XORG_FONT_CHECK_ENCODING(ISO8859-14)])
1315 AC_DEFUN([XORG_FONT_CHECK_ISO8859_15],[XORG_FONT_CHECK_ENCODING(ISO8859-15)])
1316 AC_DEFUN([XORG_FONT_CHECK_ISO8859_16],[XORG_FONT_CHECK_ENCODING(ISO8859-16)])
1317 AC_DEFUN([XORG_FONT_CHECK_JISX0201], [XORG_FONT_CHECK_ENCODING(JISX0201)])
1318 AC_DEFUN([XORG_FONT_CHECK_KOI8_R], [XORG_FONT_CHECK_ENCODING(KOI8-R)])
1320 # XORG_FONT_CHECK_ENCODING(encoding)
1321 # ----------------------------------
1322 # Minimum version: 1.1.0
1323 # This macro adds --enable/disable-<encoding>, enabled by default.
1324 # It replaced individual copies of this code in the above macros in 1.1.
1325 # Currently assumes encoding names will be all upper-case - add m4_toupper
1326 # calls if this is not true in the future.
1328 AC_DEFUN([XORG_FONT_CHECK_ENCODING],[
1329 AC_ARG_ENABLE(m4_tolower($1),
1330 AS_HELP_STRING(m4_join([-], [--disable], m4_tolower($1)),
1331 [Build $1 fonts (default: yes)]),
1332 [AS_TR_SH($1)=$enableval])
1333 AC_MSG_CHECKING([whether to build $1 fonts])
1334 AC_MSG_RESULT($[AS_TR_SH($1)])
1335 AM_CONDITIONAL(AS_TR_SH($1), [test "x$AS_TR_SH($1)" = xyes])
1336 ]) # XORG_FONT_CHECK_ENCODING
1338 # XORG_FONT_CHECK_ENCODING_LIST(encoding1 encoding2....)
1339 # -----------------------------------------------------
1340 # Minimum version: 1.1.0
1341 # Call XORG_FONT_CHECK_ENCODING for multiple encodings at once.
1342 # Add a shorthand --enable/disable-all-encodings option.
1344 AC_DEFUN([XORG_FONT_CHECK_ENCODING_LIST],[
1345 AC_ARG_ENABLE([all-encodings],
1346 AS_HELP_STRING([--disable-all-encodings],
1347 [Disable building of all font encodings]),
1348 [m4_foreach_w([enc], [$1], [
1349 AS_TR_SH(enc)=$enableval
1351 [m4_foreach_w([enc], [$1], [
1354 m4_foreach_w([enc], [$1], [XORG_FONT_CHECK_ENCODING(enc)])
1355 ]) # XORG_FONT_CHECK_ENCODING_LIST
1357 # XORG_FONT_REQUIRED_PROG(VARNAME, progname)
1358 # ------------------------------------------
1359 # Minimum version: 1.1.0
1361 # Simple wrapper around AC_PATH_PROG that errors if not found
1364 AC_DEFUN([XORG_FONT_REQUIRED_PROG],[
1365 AC_PATH_PROG($1, $2)
1366 if test x"$$1" = x; then
1367 AC_MSG_ERROR([$2 is required to build $PACKAGE_NAME.])
1372 # XORG_FONT_FCCACHE()
1373 # -------------------
1374 # Minimum version: 1.1.0
1376 # Set FCCACHE to path to fc-cache (fontconfig cache builder) if found
1377 # Set RUN_FCCACHE to a rule suitable for substituting into a makefile
1378 # to run fc-cache if found and not installing to $DESTDIR and not
1381 # fc-cache is optional, not required, and should be skipped when making
1382 # packages (installing to $DESTDIR) or cross-compiling
1384 AC_DEFUN([XORG_FONT_FCCACHE],[
1385 AC_PATH_PROG(FCCACHE, fc-cache)
1386 FCCACHE_WARN='echo "** Warning: fonts.cache not built" ; echo "** Generate this file manually on host system using fc-cache"'
1387 if test x"$FCCACHE" = x || test x"$cross_compiling" != x"no" ; then
1388 RUN_FCCACHE="${FCCACHE_WARN}"
1390 RUN_FCCACHE='@(if test -z "$(DESTDIR)"; then echo $(FCCACHE) $(fontdir); $(FCCACHE) $(fontdir); else'
1391 RUN_FCCACHE="${RUN_FCCACHE} ${FCCACHE_WARN} ; fi)"
1393 AC_SUBST([RUN_FCCACHE])
1396 # XORG_FONT_MKFONTDIR()
1397 # -------------------
1398 # Minimum version: 1.3.0
1400 # Set MKFONTDIR to path to mkfontdir.
1402 # If cross-compiling, and if mkdir is not found, use a shell command
1403 # which warns mkfontdir needs to be run on the target
1405 # If not cross-compiling, mkfontdir must be found
1407 AC_DEFUN([XORG_FONT_MKFONTDIR],[
1408 if test x"$cross_compiling" != x"no" ; then
1409 AC_PATH_PROG(MKFONTDIR, mkfontdir, "")
1410 MKFONTDIR_WARN='echo "** Warning: mkfontdir not run" ; echo "** Run mkfontdir manually on host system"'
1412 if test x"$MKFONTDIR" = x; then
1413 MKFONTDIR="${MKFONTDIR_WARN} ; echo '** mkfontdir'"
1416 XORG_FONT_REQUIRED_PROG(MKFONTDIR, mkfontdir)
1419 AC_SUBST([MKFONTDIR])
1422 # XORG_FONT_COMMON_UTILS()
1423 # ------------------------
1424 # Minimum version: 1.1.0
1426 # Call XORG_FONT_REQUIRED_PROG for programs needed for all font types
1428 AC_DEFUN([XORG_FONT_COMMON_UTILS],[
1433 # XORG_FONT_SCALED_UTILS()
1434 # ------------------------
1435 # Minimum version: 1.1.0
1437 # Call XORG_FONT_REQUIRED_PROG for programs needed for scalable fonts
1438 # (TrueType, OpenType, Type1)
1440 AC_DEFUN([XORG_FONT_SCALED_UTILS],[
1441 XORG_FONT_COMMON_UTILS
1442 XORG_FONT_REQUIRED_PROG(MKFONTSCALE, mkfontscale)
1445 # XORG_FONT_BDF_UTILS()
1446 # ---------------------
1447 # Minimum version: 1.1.0
1449 # Call XORG_FONT_REQUIRED_PROG for programs needed for BDF format bitmap fonts
1450 # Also call XORG_FONT_CHECK_COMPRESSION to determine how to compress the
1451 # PCF output files created by bdftopcf
1453 AC_DEFUN([XORG_FONT_BDF_UTILS],[
1454 XORG_FONT_COMMON_UTILS
1455 XORG_FONT_REQUIRED_PROG(BDFTOPCF, bdftopcf)
1456 XORG_FONT_CHECK_COMPRESSION
1459 # XORG_FONT_CHECK_COMPRESSION()
1460 # -----------------------------
1461 # Minimum version: 1.1.0
1463 # Offer a --with-compression flag to control what compression method is
1464 # used for pcf font files. Offers all the methods currently supported
1465 # by libXfont, including no compression.
1467 AC_DEFUN([XORG_FONT_CHECK_COMPRESSION],[
1468 AC_MSG_CHECKING([font compression method])
1469 AC_ARG_WITH(compression,
1470 [AS_HELP_STRING([--with-compression=<no|compress|gzip|bzip2>],
1471 [compression method to use on pcf fonts])],
1472 [compression="$withval"], [compression="yes"])
1473 if test x"$compression" = "xyes" ; then
1476 AC_MSG_RESULT([${compression}])
1477 case ${compression} in
1478 *compress) COMPRESS_SUFFIX=".Z" ;;
1479 *gzip) COMPRESS_SUFFIX=".gz" ;;
1480 *bzip2) COMPRESS_SUFFIX=".bz2" ;;
1481 no|none) COMPRESS_SUFFIX="" ; COMPRESS="cat" ;;
1482 *) AC_MSG_ERROR([${compression} is not a supported compression method]) ;;
1484 if test x"$COMPRESS_SUFFIX" != "x" ; then
1485 XORG_FONT_REQUIRED_PROG(COMPRESS, ${compression})
1487 AC_SUBST([COMPRESS_SUFFIX])
1490 # XORG_FONT_UCS2ANY()
1491 # -------------------
1492 # Minimum version: 1.1.0
1494 # Call XORG_FONT_REQUIRED_PROG for ucs2any program needed for splitting
1495 # Unicode-encoded BDF format bitmap fonts into subsets for older encodings.
1496 # Also call pkg-config to find the directory with the encoding files needed
1497 # by ucs2any, and export it as MAPFILES_PATH to the Makefiles
1499 AC_DEFUN([XORG_FONT_UCS2ANY],[
1500 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1501 XORG_FONT_REQUIRED_PROG(UCS2ANY, ucs2any)
1502 PKG_CHECK_MODULES(MAPS, [fontutil])
1503 AC_MSG_CHECKING([for ucs2any encoding data files])
1504 MAPFILES_PATH=`$PKG_CONFIG --variable=mapdir fontutil`
1505 AC_SUBST(MAPFILES_PATH)
1506 AC_MSG_RESULT([${MAPFILES_PATH}])
1511 # XORG_FONT_FC_CONFDIR()
1512 # --------------------
1513 # Minimum version: 1.2.0
1515 # Sets FC_CONFDIR to the fontconfig config directory
1516 # (which should be --with-confdir=... when building fontconfig)
1518 # --with-fc-confdir=...
1519 # pkg-config --variable=confdir fontconfig
1520 # ${sysconfdir}/fonts
1522 AC_DEFUN([XORG_FONT_FC_CONFDIR],[
1523 dnl Ensure $PKG_CONFIG is set first
1524 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1526 AC_MSG_CHECKING([for fontconfig's configuration directory])
1527 AC_ARG_WITH(fc-confdir,
1528 AS_HELP_STRING([--with-fc-confdir=DIR],
1529 [Path to fontconfig's configuration directory]),
1530 [FC_CONFDIR="$withval"])
1531 # if --with-fc-confdir was not specified
1532 if test "x${FC_CONFDIR}" = "x"; then
1533 FC_CONFDIR=`$PKG_CONFIG --variable=confdir fontconfig`
1535 # ...and if pkg-config didn't find confdir in fontconfig.pc...
1536 if test "x${FC_CONFDIR}" = "x"; then
1537 FC_CONFDIR="${sysconfdir}/fonts"
1539 AC_SUBST(FC_CONFDIR)
1540 AC_MSG_RESULT([${FC_CONFDIR}])
1545 # XORG_FONTROOTDIR()
1546 # --------------------
1547 # Minimum version: 1.1.0
1549 # Sets FONTROOTDIR to the root directory for font files. Uses the first
1551 # --with-fontrootdir
1552 # pkg-config --variable=fontrootdir fontutil
1553 # ${datadir}/fonts/X11
1555 AC_DEFUN([XORG_FONTROOTDIR],[
1556 dnl Ensure $PKG_CONFIG is set first
1557 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1559 AC_MSG_CHECKING([for root directory for font files])
1560 AC_ARG_WITH(fontrootdir,
1561 AS_HELP_STRING([--with-fontrootdir=DIR],
1562 [Path to root directory for font files]),
1563 [FONTROOTDIR="$withval"])
1564 # if --with-fontrootdir not specified...
1565 if test "x${FONTROOTDIR}" = "x"; then
1566 FONTROOTDIR=`$PKG_CONFIG --variable=fontrootdir fontutil`
1568 # ...and if pkg-config didn't find fontdir in fontutil.pc...
1569 if test "x${FONTROOTDIR}" = "x"; then
1570 FONTROOTDIR="${datadir}/fonts/X11"
1572 AC_SUBST(FONTROOTDIR)
1573 AC_MSG_RESULT([${FONTROOTDIR}])
1576 # XORG_FONTSUBDIR(variable, flag, subdir)
1577 # ---------------------------------------
1578 # Minimum version: 1.1.0
1580 # Offer a --with-<flag> flag to control directory for font installation
1581 # Default is the specified <subdir> of the font root directory.
1582 # Sets <variable> to the selected directory
1584 AC_DEFUN([XORG_FONTSUBDIR],[
1585 AC_REQUIRE([XORG_FONTROOTDIR])
1587 AC_MSG_CHECKING([for directory for $3 files])
1589 [AS_HELP_STRING([--with-$2=DIR],
1590 [Path to $3 files [FONTROOTDIR/$3]])],
1591 [$1="${withval}"], [$1='${FONTROOTDIR}/$3'])
1593 AC_MSG_RESULT([${$1}])
1594 ]) # XORG_FONTSUBDIR
1596 # XORG_FONTDIR(subdir)
1597 # --------------------
1598 # Minimum version: 1.1.0
1600 # Offer a --with-fontdir flag to control directory for font installation
1601 # Default is the specified subdir of the font root directory.
1602 # Sets FONTDIR to the selected directory
1604 AC_DEFUN([XORG_FONTDIR],[XORG_FONTSUBDIR([FONTDIR], [fontdir], [$1])])
1606 dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1608 dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
1610 dnl Permission is hereby granted, free of charge, to any person obtaining a
1611 dnl copy of this software and associated documentation files (the "Software"),
1612 dnl to deal in the Software without restriction, including without limitation
1613 dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
1614 dnl and/or sell copies of the Software, and to permit persons to whom the
1615 dnl Software is furnished to do so, subject to the following conditions:
1617 dnl The above copyright notice and this permission notice (including the next
1618 dnl paragraph) shall be included in all copies or substantial portions of the
1621 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1622 dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1623 dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
1624 dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1625 dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1626 dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1627 dnl DEALINGS IN THE SOFTWARE.
1629 # XORG_MACROS_VERSION(required-version)
1630 # -------------------------------------
1631 # Minimum version: 1.1.0
1633 # If you're using a macro added in Version 1.1 or newer, include this in
1634 # your configure.ac with the minimum required version, such as:
1635 # XORG_MACROS_VERSION(1.1)
1637 # To ensure that this macro is defined, also add:
1638 # m4_ifndef([XORG_MACROS_VERSION],
1639 # [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
1642 # See the "minimum version" comment for each macro you use to see what
1643 # version you require.
1644 m4_defun([XORG_MACROS_VERSION],[
1645 m4_define([vers_have], [1.18.0])
1646 m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1647 m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1648 m4_if(m4_cmp(maj_have, maj_needed), 0,,
1649 [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1650 m4_if(m4_version_compare(vers_have, [$1]), -1,
1651 [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1652 m4_undefine([vers_have])
1653 m4_undefine([maj_have])
1654 m4_undefine([maj_needed])
1655 ]) # XORG_MACROS_VERSION
1657 # XORG_PROG_RAWCPP()
1658 # ------------------
1659 # Minimum version: 1.0.0
1661 # Find cpp program and necessary flags for use in pre-processing text files
1662 # such as man pages and config files
1663 AC_DEFUN([XORG_PROG_RAWCPP],[
1664 AC_REQUIRE([AC_PROG_CPP])
1665 AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
1666 [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1668 # Check for flag to avoid builtin definitions - assumes unix is predefined,
1669 # which is not the best choice for supporting other OS'es, but covers most
1670 # of the ones we need for now.
1671 AC_MSG_CHECKING([if $RAWCPP requires -undef])
1672 AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
1673 if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1676 if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1678 AC_MSG_RESULT([yes])
1679 # under Cygwin unix is still defined even with -undef
1680 elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1681 RAWCPPFLAGS="-undef -ansi"
1682 AC_MSG_RESULT([yes, with -ansi])
1684 AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.])
1687 rm -f conftest.$ac_ext
1689 AC_MSG_CHECKING([if $RAWCPP requires -traditional])
1690 AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve "whitespace"?]])])
1691 if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
1694 if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
1695 RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1696 AC_MSG_RESULT([yes])
1698 AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.])
1701 rm -f conftest.$ac_ext
1702 AC_SUBST(RAWCPPFLAGS)
1703 ]) # XORG_PROG_RAWCPP
1705 # XORG_MANPAGE_SECTIONS()
1706 # -----------------------
1707 # Minimum version: 1.0.0
1709 # Determine which sections man pages go in for the different man page types
1710 # on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1711 # Not sure if there's any better way than just hardcoding by OS name.
1712 # Override default settings by setting environment variables
1713 # Added MAN_SUBSTS in version 1.8
1714 # Added AC_PROG_SED in version 1.8
1716 AC_DEFUN([XORG_MANPAGE_SECTIONS],[
1717 AC_REQUIRE([AC_CANONICAL_HOST])
1718 AC_REQUIRE([AC_PROG_SED])
1720 if test x$APP_MAN_SUFFIX = x ; then
1723 if test x$APP_MAN_DIR = x ; then
1724 APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1727 if test x$LIB_MAN_SUFFIX = x ; then
1730 if test x$LIB_MAN_DIR = x ; then
1731 LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1734 if test x$FILE_MAN_SUFFIX = x ; then
1736 solaris*) FILE_MAN_SUFFIX=4 ;;
1737 *) FILE_MAN_SUFFIX=5 ;;
1740 if test x$FILE_MAN_DIR = x ; then
1741 FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1744 if test x$MISC_MAN_SUFFIX = x ; then
1746 solaris*) MISC_MAN_SUFFIX=5 ;;
1747 *) MISC_MAN_SUFFIX=7 ;;
1750 if test x$MISC_MAN_DIR = x ; then
1751 MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1754 if test x$DRIVER_MAN_SUFFIX = x ; then
1756 solaris*) DRIVER_MAN_SUFFIX=7 ;;
1757 *) DRIVER_MAN_SUFFIX=4 ;;
1760 if test x$DRIVER_MAN_DIR = x ; then
1761 DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1764 if test x$ADMIN_MAN_SUFFIX = x ; then
1766 solaris*) ADMIN_MAN_SUFFIX=1m ;;
1767 *) ADMIN_MAN_SUFFIX=8 ;;
1770 if test x$ADMIN_MAN_DIR = x ; then
1771 ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1775 AC_SUBST([APP_MAN_SUFFIX])
1776 AC_SUBST([LIB_MAN_SUFFIX])
1777 AC_SUBST([FILE_MAN_SUFFIX])
1778 AC_SUBST([MISC_MAN_SUFFIX])
1779 AC_SUBST([DRIVER_MAN_SUFFIX])
1780 AC_SUBST([ADMIN_MAN_SUFFIX])
1781 AC_SUBST([APP_MAN_DIR])
1782 AC_SUBST([LIB_MAN_DIR])
1783 AC_SUBST([FILE_MAN_DIR])
1784 AC_SUBST([MISC_MAN_DIR])
1785 AC_SUBST([DRIVER_MAN_DIR])
1786 AC_SUBST([ADMIN_MAN_DIR])
1788 XORG_MAN_PAGE="X Version 11"
1789 AC_SUBST([XORG_MAN_PAGE])
1791 -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1792 -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1793 -e 's|__xservername__|Xorg|g' \
1794 -e 's|__xconfigfile__|xorg.conf|g' \
1795 -e 's|__projectroot__|\$(prefix)|g' \
1796 -e 's|__apploaddir__|\$(appdefaultdir)|g' \
1797 -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
1798 -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
1799 -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
1800 -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
1801 -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
1802 -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
1803 AC_SUBST([MAN_SUBSTS])
1805 ]) # XORG_MANPAGE_SECTIONS
1807 # XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
1808 # ------------------------
1809 # Minimum version: 1.7.0
1811 # Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
1812 # provided by xorg-sgml-doctools, if installed.
1813 AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
1814 AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
1816 PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
1817 [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
1819 [if test x"$cross_compiling" != x"yes" ; then
1820 AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
1821 [XORG_SGML_PATH=$prefix/share/sgml])
1825 # Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
1826 # the path and the name of the doc stylesheet
1827 if test "x$XORG_SGML_PATH" != "x" ; then
1828 AC_MSG_RESULT([$XORG_SGML_PATH])
1829 STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
1830 XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
1835 AC_SUBST(XORG_SGML_PATH)
1836 AC_SUBST(STYLESHEET_SRCDIR)
1837 AC_SUBST(XSL_STYLESHEET)
1838 AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
1839 ]) # XORG_CHECK_SGML_DOCTOOLS
1841 # XORG_CHECK_LINUXDOC
1842 # -------------------
1843 # Minimum version: 1.0.0
1845 # Defines the variable MAKE_TEXT if the necessary tools and
1846 # files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1847 # Whether or not the necessary tools and files are found can be checked
1848 # with the AM_CONDITIONAL "BUILD_LINUXDOC"
1849 AC_DEFUN([XORG_CHECK_LINUXDOC],[
1850 AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1851 AC_REQUIRE([XORG_WITH_PS2PDF])
1853 AC_PATH_PROG(LINUXDOC, linuxdoc)
1855 AC_MSG_CHECKING([whether to build documentation])
1857 if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
1863 AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1865 AC_MSG_RESULT([$BUILDDOC])
1867 AC_MSG_CHECKING([whether to build pdf documentation])
1869 if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
1875 AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1877 AC_MSG_RESULT([$BUILDPDFDOC])
1879 MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
1880 MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1882 MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0"
1888 ]) # XORG_CHECK_LINUXDOC
1890 # XORG_CHECK_DOCBOOK
1891 # -------------------
1892 # Minimum version: 1.0.0
1894 # Checks for the ability to build output formats from SGML DocBook source.
1895 # For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1896 # indicates whether the necessary tools and files are found and, if set,
1897 # $(MAKE_XXX) blah.sgml will produce blah.xxx.
1898 AC_DEFUN([XORG_CHECK_DOCBOOK],[
1899 AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1906 AC_PATH_PROG(DOCBOOKPS, docbook2ps)
1907 AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1908 AC_PATH_PROG(DOCBOOKHTML, docbook2html)
1909 AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1911 AC_MSG_CHECKING([whether to build text documentation])
1912 if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
1913 test x$BUILD_TXTDOC != xno; then
1916 AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1917 AC_MSG_RESULT([$BUILDTXTDOC])
1919 AC_MSG_CHECKING([whether to build PDF documentation])
1920 if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
1921 test x$BUILD_PDFDOC != xno; then
1924 AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1925 AC_MSG_RESULT([$BUILDPDFDOC])
1927 AC_MSG_CHECKING([whether to build PostScript documentation])
1928 if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
1929 test x$BUILD_PSDOC != xno; then
1932 AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1933 AC_MSG_RESULT([$BUILDPSDOC])
1935 AC_MSG_CHECKING([whether to build HTML documentation])
1936 if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
1937 test x$BUILD_HTMLDOC != xno; then
1940 AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1941 AC_MSG_RESULT([$BUILDHTMLDOC])
1943 MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1944 MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1945 MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1946 MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1952 ]) # XORG_CHECK_DOCBOOK
1954 # XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
1956 # Minimum version: 1.5.0
1957 # Minimum version for optional DEFAULT argument: 1.11.0
1959 # Documentation tools are not always available on all platforms and sometimes
1960 # not at the appropriate level. This macro enables a module to test for the
1961 # presence of the tool and obtain it's path in separate variables. Coupled with
1962 # the --with-xmlto option, it allows maximum flexibilty in making decisions
1963 # as whether or not to use the xmlto package. When DEFAULT is not specified,
1964 # --with-xmlto assumes 'auto'.
1966 # Interface to module:
1967 # HAVE_XMLTO: used in makefiles to conditionally generate documentation
1968 # XMLTO: returns the path of the xmlto program found
1969 # returns the path set by the user in the environment
1970 # --with-xmlto: 'yes' user instructs the module to use xmlto
1971 # 'no' user instructs the module not to use xmlto
1973 # Added in version 1.10.0
1974 # HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
1975 # xmlto for text output requires either lynx, links, or w3m browsers
1977 # If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
1979 AC_DEFUN([XORG_WITH_XMLTO],[
1980 AC_ARG_VAR([XMLTO], [Path to xmlto command])
1981 m4_define([_defopt], m4_default([$2], [auto]))
1983 AS_HELP_STRING([--with-xmlto],
1984 [Use xmlto to regenerate documentation (default: ]_defopt[)]),
1985 [use_xmlto=$withval], [use_xmlto=]_defopt)
1986 m4_undefine([_defopt])
1988 if test "x$use_xmlto" = x"auto"; then
1989 AC_PATH_PROG([XMLTO], [xmlto])
1990 if test "x$XMLTO" = "x"; then
1991 AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
1996 elif test "x$use_xmlto" = x"yes" ; then
1997 AC_PATH_PROG([XMLTO], [xmlto])
1998 if test "x$XMLTO" = "x"; then
1999 AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
2002 elif test "x$use_xmlto" = x"no" ; then
2003 if test "x$XMLTO" != "x"; then
2004 AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
2008 AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
2011 # Test for a minimum version of xmlto, if provided.
2013 [if test "$have_xmlto" = yes; then
2014 # scrape the xmlto version
2015 AC_MSG_CHECKING([the xmlto version])
2016 xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
2017 AC_MSG_RESULT([$xmlto_version])
2018 AS_VERSION_COMPARE([$xmlto_version], [$1],
2019 [if test "x$use_xmlto" = xauto; then
2020 AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
2023 AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
2027 # Test for the ability of xmlto to generate a text target
2029 cat > conftest.xml << "EOF"
2031 AS_IF([test "$have_xmlto" = yes],
2032 [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
2033 [have_xmlto_text=yes],
2034 [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
2036 AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
2037 AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
2038 ]) # XORG_WITH_XMLTO
2040 # XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
2041 # --------------------------------------------
2042 # Minimum version: 1.12.0
2043 # Minimum version for optional DEFAULT argument: 1.12.0
2045 # XSLT (Extensible Stylesheet Language Transformations) is a declarative,
2046 # XML-based language used for the transformation of XML documents.
2047 # The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
2048 # It is used under the cover by xmlto to generate html files from DocBook/XML.
2049 # The XSLT processor is often used as a standalone tool for transformations.
2050 # It should not be assumed that this tool is used only to work with documnetation.
2051 # When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
2053 # Interface to module:
2054 # HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
2055 # XSLTPROC: returns the path of the xsltproc program found
2056 # returns the path set by the user in the environment
2057 # --with-xsltproc: 'yes' user instructs the module to use xsltproc
2058 # 'no' user instructs the module not to use xsltproc
2059 # have_xsltproc: returns yes if xsltproc found in PATH or no
2061 # If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
2063 AC_DEFUN([XORG_WITH_XSLTPROC],[
2064 AC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
2065 # Preserves the interface, should it be implemented later
2066 m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
2067 m4_define([_defopt], m4_default([$2], [auto]))
2068 AC_ARG_WITH(xsltproc,
2069 AS_HELP_STRING([--with-xsltproc],
2070 [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
2071 [use_xsltproc=$withval], [use_xsltproc=]_defopt)
2072 m4_undefine([_defopt])
2074 if test "x$use_xsltproc" = x"auto"; then
2075 AC_PATH_PROG([XSLTPROC], [xsltproc])
2076 if test "x$XSLTPROC" = "x"; then
2077 AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
2082 elif test "x$use_xsltproc" = x"yes" ; then
2083 AC_PATH_PROG([XSLTPROC], [xsltproc])
2084 if test "x$XSLTPROC" = "x"; then
2085 AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
2088 elif test "x$use_xsltproc" = x"no" ; then
2089 if test "x$XSLTPROC" != "x"; then
2090 AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
2094 AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
2097 AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
2098 ]) # XORG_WITH_XSLTPROC
2100 # XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
2101 # ----------------------------------------
2102 # Minimum version: 1.15.0
2104 # PERL (Practical Extraction and Report Language) is a language optimized for
2105 # scanning arbitrary text files, extracting information from those text files,
2106 # and printing reports based on that information.
2108 # When DEFAULT is not specified, --with-perl assumes 'auto'.
2110 # Interface to module:
2111 # HAVE_PERL: used in makefiles to conditionally scan text files
2112 # PERL: returns the path of the perl program found
2113 # returns the path set by the user in the environment
2114 # --with-perl: 'yes' user instructs the module to use perl
2115 # 'no' user instructs the module not to use perl
2116 # have_perl: returns yes if perl found in PATH or no
2118 # If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
2120 AC_DEFUN([XORG_WITH_PERL],[
2121 AC_ARG_VAR([PERL], [Path to perl command])
2122 # Preserves the interface, should it be implemented later
2123 m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
2124 m4_define([_defopt], m4_default([$2], [auto]))
2126 AS_HELP_STRING([--with-perl],
2127 [Use perl for extracting information from files (default: ]_defopt[)]),
2128 [use_perl=$withval], [use_perl=]_defopt)
2129 m4_undefine([_defopt])
2131 if test "x$use_perl" = x"auto"; then
2132 AC_PATH_PROG([PERL], [perl])
2133 if test "x$PERL" = "x"; then
2134 AC_MSG_WARN([perl not found - cannot extract information and report])
2139 elif test "x$use_perl" = x"yes" ; then
2140 AC_PATH_PROG([PERL], [perl])
2141 if test "x$PERL" = "x"; then
2142 AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
2145 elif test "x$use_perl" = x"no" ; then
2146 if test "x$PERL" != "x"; then
2147 AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
2151 AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
2154 AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
2157 # XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
2159 # Minimum version: 1.5.0
2160 # Minimum version for optional DEFAULT argument: 1.11.0
2162 # Documentation tools are not always available on all platforms and sometimes
2163 # not at the appropriate level. This macro enables a module to test for the
2164 # presence of the tool and obtain it's path in separate variables. Coupled with
2165 # the --with-asciidoc option, it allows maximum flexibilty in making decisions
2166 # as whether or not to use the asciidoc package. When DEFAULT is not specified,
2167 # --with-asciidoc assumes 'auto'.
2169 # Interface to module:
2170 # HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
2171 # ASCIIDOC: returns the path of the asciidoc program found
2172 # returns the path set by the user in the environment
2173 # --with-asciidoc: 'yes' user instructs the module to use asciidoc
2174 # 'no' user instructs the module not to use asciidoc
2176 # If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
2178 AC_DEFUN([XORG_WITH_ASCIIDOC],[
2179 AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
2180 m4_define([_defopt], m4_default([$2], [auto]))
2181 AC_ARG_WITH(asciidoc,
2182 AS_HELP_STRING([--with-asciidoc],
2183 [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
2184 [use_asciidoc=$withval], [use_asciidoc=]_defopt)
2185 m4_undefine([_defopt])
2187 if test "x$use_asciidoc" = x"auto"; then
2188 AC_PATH_PROG([ASCIIDOC], [asciidoc])
2189 if test "x$ASCIIDOC" = "x"; then
2190 AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
2195 elif test "x$use_asciidoc" = x"yes" ; then
2196 AC_PATH_PROG([ASCIIDOC], [asciidoc])
2197 if test "x$ASCIIDOC" = "x"; then
2198 AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
2201 elif test "x$use_asciidoc" = x"no" ; then
2202 if test "x$ASCIIDOC" != "x"; then
2203 AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
2207 AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
2210 [if test "$have_asciidoc" = yes; then
2211 # scrape the asciidoc version
2212 AC_MSG_CHECKING([the asciidoc version])
2213 asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
2214 AC_MSG_RESULT([$asciidoc_version])
2215 AS_VERSION_COMPARE([$asciidoc_version], [$1],
2216 [if test "x$use_asciidoc" = xauto; then
2217 AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
2220 AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
2223 AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
2224 ]) # XORG_WITH_ASCIIDOC
2226 # XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
2227 # -------------------------------------------
2228 # Minimum version: 1.5.0
2229 # Minimum version for optional DEFAULT argument: 1.11.0
2230 # Minimum version for optional DOT checking: 1.18.0
2232 # Documentation tools are not always available on all platforms and sometimes
2233 # not at the appropriate level. This macro enables a module to test for the
2234 # presence of the tool and obtain it's path in separate variables. Coupled with
2235 # the --with-doxygen option, it allows maximum flexibilty in making decisions
2236 # as whether or not to use the doxygen package. When DEFAULT is not specified,
2237 # --with-doxygen assumes 'auto'.
2239 # Interface to module:
2240 # HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
2241 # DOXYGEN: returns the path of the doxygen program found
2242 # returns the path set by the user in the environment
2243 # --with-doxygen: 'yes' user instructs the module to use doxygen
2244 # 'no' user instructs the module not to use doxygen
2246 # If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
2248 AC_DEFUN([XORG_WITH_DOXYGEN],[
2249 AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
2250 AC_ARG_VAR([DOT], [Path to the dot graphics utility])
2251 m4_define([_defopt], m4_default([$2], [auto]))
2252 AC_ARG_WITH(doxygen,
2253 AS_HELP_STRING([--with-doxygen],
2254 [Use doxygen to regenerate documentation (default: ]_defopt[)]),
2255 [use_doxygen=$withval], [use_doxygen=]_defopt)
2256 m4_undefine([_defopt])
2258 if test "x$use_doxygen" = x"auto"; then
2259 AC_PATH_PROG([DOXYGEN], [doxygen])
2260 if test "x$DOXYGEN" = "x"; then
2261 AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
2266 elif test "x$use_doxygen" = x"yes" ; then
2267 AC_PATH_PROG([DOXYGEN], [doxygen])
2268 if test "x$DOXYGEN" = "x"; then
2269 AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
2272 elif test "x$use_doxygen" = x"no" ; then
2273 if test "x$DOXYGEN" != "x"; then
2274 AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
2278 AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
2281 [if test "$have_doxygen" = yes; then
2282 # scrape the doxygen version
2283 AC_MSG_CHECKING([the doxygen version])
2284 doxygen_version=`$DOXYGEN --version 2>/dev/null`
2285 AC_MSG_RESULT([$doxygen_version])
2286 AS_VERSION_COMPARE([$doxygen_version], [$1],
2287 [if test "x$use_doxygen" = xauto; then
2288 AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
2291 AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
2295 dnl Check for DOT if we have doxygen. The caller decides if it is mandatory
2296 dnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
2297 dnl HAVE_DOT = @HAVE_DOT@
2299 if test "x$have_doxygen" = "xyes"; then
2300 AC_PATH_PROG([DOT], [dot])
2301 if test "x$DOT" != "x"; then
2306 AC_SUBST([HAVE_DOT])
2307 AM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
2308 AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
2309 ]) # XORG_WITH_DOXYGEN
2311 # XORG_WITH_GROFF([DEFAULT])
2313 # Minimum version: 1.6.0
2314 # Minimum version for optional DEFAULT argument: 1.11.0
2316 # Documentation tools are not always available on all platforms and sometimes
2317 # not at the appropriate level. This macro enables a module to test for the
2318 # presence of the tool and obtain it's path in separate variables. Coupled with
2319 # the --with-groff option, it allows maximum flexibilty in making decisions
2320 # as whether or not to use the groff package. When DEFAULT is not specified,
2321 # --with-groff assumes 'auto'.
2323 # Interface to module:
2324 # HAVE_GROFF: used in makefiles to conditionally generate documentation
2325 # HAVE_GROFF_MM: the memorandum macros (-mm) package
2326 # HAVE_GROFF_MS: the -ms macros package
2327 # GROFF: returns the path of the groff program found
2328 # returns the path set by the user in the environment
2329 # --with-groff: 'yes' user instructs the module to use groff
2330 # 'no' user instructs the module not to use groff
2332 # Added in version 1.9.0:
2333 # HAVE_GROFF_HTML: groff has dependencies to output HTML format:
2334 # pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
2335 # psselect from the psutils package.
2336 # the ghostcript package. Refer to the grohtml man pages
2338 # If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
2340 # OS and distros often splits groff in a basic and full package, the former
2341 # having the groff program and the later having devices, fonts and macros
2342 # Checking for the groff executable is not enough.
2344 # If macros are missing, we cannot assume that groff is useless, so we don't
2345 # unset HAVE_GROFF or GROFF env variables.
2346 # HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
2348 AC_DEFUN([XORG_WITH_GROFF],[
2349 AC_ARG_VAR([GROFF], [Path to groff command])
2350 m4_define([_defopt], m4_default([$1], [auto]))
2352 AS_HELP_STRING([--with-groff],
2353 [Use groff to regenerate documentation (default: ]_defopt[)]),
2354 [use_groff=$withval], [use_groff=]_defopt)
2355 m4_undefine([_defopt])
2357 if test "x$use_groff" = x"auto"; then
2358 AC_PATH_PROG([GROFF], [groff])
2359 if test "x$GROFF" = "x"; then
2360 AC_MSG_WARN([groff not found - documentation targets will be skipped])
2365 elif test "x$use_groff" = x"yes" ; then
2366 AC_PATH_PROG([GROFF], [groff])
2367 if test "x$GROFF" = "x"; then
2368 AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
2371 elif test "x$use_groff" = x"no" ; then
2372 if test "x$GROFF" != "x"; then
2373 AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
2377 AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
2380 # We have groff, test for the presence of the macro packages
2381 if test "x$have_groff" = x"yes"; then
2382 AC_MSG_CHECKING([for ${GROFF} -ms macros])
2383 if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
2388 AC_MSG_RESULT([$groff_ms_works])
2389 AC_MSG_CHECKING([for ${GROFF} -mm macros])
2390 if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
2395 AC_MSG_RESULT([$groff_mm_works])
2398 # We have groff, test for HTML dependencies, one command per package
2399 if test "x$have_groff" = x"yes"; then
2400 AC_PATH_PROGS(GS_PATH, [gs gswin32c])
2401 AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
2402 AC_PATH_PROG(PSSELECT_PATH, [psselect])
2403 if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
2407 AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
2411 # Set Automake conditionals for Makefiles
2412 AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
2413 AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
2414 AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
2415 AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
2416 ]) # XORG_WITH_GROFF
2418 # XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
2419 # ---------------------------------------
2420 # Minimum version: 1.6.0
2421 # Minimum version for optional DEFAULT argument: 1.11.0
2422 # Minimum version for optional MIN-VERSION argument: 1.15.0
2424 # Documentation tools are not always available on all platforms and sometimes
2425 # not at the appropriate level. This macro enables a module to test for the
2426 # presence of the tool and obtain it's path in separate variables. Coupled with
2427 # the --with-fop option, it allows maximum flexibilty in making decisions
2428 # as whether or not to use the fop package. When DEFAULT is not specified,
2429 # --with-fop assumes 'auto'.
2431 # Interface to module:
2432 # HAVE_FOP: used in makefiles to conditionally generate documentation
2433 # FOP: returns the path of the fop program found
2434 # returns the path set by the user in the environment
2435 # --with-fop: 'yes' user instructs the module to use fop
2436 # 'no' user instructs the module not to use fop
2438 # If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
2440 AC_DEFUN([XORG_WITH_FOP],[
2441 AC_ARG_VAR([FOP], [Path to fop command])
2442 m4_define([_defopt], m4_default([$2], [auto]))
2444 AS_HELP_STRING([--with-fop],
2445 [Use fop to regenerate documentation (default: ]_defopt[)]),
2446 [use_fop=$withval], [use_fop=]_defopt)
2447 m4_undefine([_defopt])
2449 if test "x$use_fop" = x"auto"; then
2450 AC_PATH_PROG([FOP], [fop])
2451 if test "x$FOP" = "x"; then
2452 AC_MSG_WARN([fop not found - documentation targets will be skipped])
2457 elif test "x$use_fop" = x"yes" ; then
2458 AC_PATH_PROG([FOP], [fop])
2459 if test "x$FOP" = "x"; then
2460 AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
2463 elif test "x$use_fop" = x"no" ; then
2464 if test "x$FOP" != "x"; then
2465 AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
2469 AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
2472 # Test for a minimum version of fop, if provided.
2474 [if test "$have_fop" = yes; then
2475 # scrape the fop version
2476 AC_MSG_CHECKING([for fop minimum version])
2477 fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
2478 AC_MSG_RESULT([$fop_version])
2479 AS_VERSION_COMPARE([$fop_version], [$1],
2480 [if test "x$use_fop" = xauto; then
2481 AC_MSG_WARN([fop version $fop_version found, but $1 needed])
2484 AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
2487 AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
2490 # XORG_WITH_M4([MIN-VERSION])
2491 # ---------------------------
2492 # Minimum version: 1.19.0
2494 # This macro attempts to locate an m4 macro processor which supports
2495 # -I option and is only useful for modules relying on M4 in order to
2496 # expand macros in source code files.
2498 # Interface to module:
2499 # M4: returns the path of the m4 program found
2500 # returns the path set by the user in the environment
2502 AC_DEFUN([XORG_WITH_M4], [
2503 AC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
2504 [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
2505 [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
2506 ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
2507 [AC_MSG_ERROR([could not find m4 that supports -I option])],
2508 [$PATH:/usr/gnu/bin])])
2510 AC_SUBST([M4], [$ac_cv_path_M4])
2513 # XORG_WITH_PS2PDF([DEFAULT])
2515 # Minimum version: 1.6.0
2516 # Minimum version for optional DEFAULT argument: 1.11.0
2518 # Documentation tools are not always available on all platforms and sometimes
2519 # not at the appropriate level. This macro enables a module to test for the
2520 # presence of the tool and obtain it's path in separate variables. Coupled with
2521 # the --with-ps2pdf option, it allows maximum flexibilty in making decisions
2522 # as whether or not to use the ps2pdf package. When DEFAULT is not specified,
2523 # --with-ps2pdf assumes 'auto'.
2525 # Interface to module:
2526 # HAVE_PS2PDF: used in makefiles to conditionally generate documentation
2527 # PS2PDF: returns the path of the ps2pdf program found
2528 # returns the path set by the user in the environment
2529 # --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
2530 # 'no' user instructs the module not to use ps2pdf
2532 # If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
2534 AC_DEFUN([XORG_WITH_PS2PDF],[
2535 AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
2536 m4_define([_defopt], m4_default([$1], [auto]))
2538 AS_HELP_STRING([--with-ps2pdf],
2539 [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
2540 [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
2541 m4_undefine([_defopt])
2543 if test "x$use_ps2pdf" = x"auto"; then
2544 AC_PATH_PROG([PS2PDF], [ps2pdf])
2545 if test "x$PS2PDF" = "x"; then
2546 AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
2551 elif test "x$use_ps2pdf" = x"yes" ; then
2552 AC_PATH_PROG([PS2PDF], [ps2pdf])
2553 if test "x$PS2PDF" = "x"; then
2554 AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
2557 elif test "x$use_ps2pdf" = x"no" ; then
2558 if test "x$PS2PDF" != "x"; then
2559 AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
2563 AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
2565 AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
2566 ]) # XORG_WITH_PS2PDF
2568 # XORG_ENABLE_DOCS (enable_docs=yes)
2570 # Minimum version: 1.6.0
2572 # Documentation tools are not always available on all platforms and sometimes
2573 # not at the appropriate level. This macro enables a builder to skip all
2574 # documentation targets except traditional man pages.
2575 # Combined with the specific tool checking macros XORG_WITH_*, it provides
2576 # maximum flexibilty in controlling documentation building.
2578 # XORG_WITH_XMLTO --with-xmlto
2579 # XORG_WITH_ASCIIDOC --with-asciidoc
2580 # XORG_WITH_DOXYGEN --with-doxygen
2581 # XORG_WITH_FOP --with-fop
2582 # XORG_WITH_GROFF --with-groff
2583 # XORG_WITH_PS2PDF --with-ps2pdf
2585 # Interface to module:
2586 # ENABLE_DOCS: used in makefiles to conditionally generate documentation
2587 # --enable-docs: 'yes' user instructs the module to generate docs
2588 # 'no' user instructs the module not to generate docs
2589 # parm1: specify the default value, yes or no.
2591 AC_DEFUN([XORG_ENABLE_DOCS],[
2592 m4_define([docs_default], m4_default([$1], [yes]))
2594 AS_HELP_STRING([--enable-docs],
2595 [Enable building the documentation (default: ]docs_default[)]),
2596 [build_docs=$enableval], [build_docs=]docs_default)
2597 m4_undefine([docs_default])
2598 AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
2599 AC_MSG_CHECKING([whether to build documentation])
2600 AC_MSG_RESULT([$build_docs])
2601 ]) # XORG_ENABLE_DOCS
2603 # XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
2605 # Minimum version: 1.6.0
2607 # This macro enables a builder to skip all developer documentation.
2608 # Combined with the specific tool checking macros XORG_WITH_*, it provides
2609 # maximum flexibilty in controlling documentation building.
2611 # XORG_WITH_XMLTO --with-xmlto
2612 # XORG_WITH_ASCIIDOC --with-asciidoc
2613 # XORG_WITH_DOXYGEN --with-doxygen
2614 # XORG_WITH_FOP --with-fop
2615 # XORG_WITH_GROFF --with-groff
2616 # XORG_WITH_PS2PDF --with-ps2pdf
2618 # Interface to module:
2619 # ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs
2620 # --enable-devel-docs: 'yes' user instructs the module to generate developer docs
2621 # 'no' user instructs the module not to generate developer docs
2622 # parm1: specify the default value, yes or no.
2624 AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
2625 m4_define([devel_default], m4_default([$1], [yes]))
2626 AC_ARG_ENABLE(devel-docs,
2627 AS_HELP_STRING([--enable-devel-docs],
2628 [Enable building the developer documentation (default: ]devel_default[)]),
2629 [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
2630 m4_undefine([devel_default])
2631 AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
2632 AC_MSG_CHECKING([whether to build developer documentation])
2633 AC_MSG_RESULT([$build_devel_docs])
2634 ]) # XORG_ENABLE_DEVEL_DOCS
2636 # XORG_ENABLE_SPECS (enable_specs=yes)
2638 # Minimum version: 1.6.0
2640 # This macro enables a builder to skip all functional specification targets.
2641 # Combined with the specific tool checking macros XORG_WITH_*, it provides
2642 # maximum flexibilty in controlling documentation building.
2644 # XORG_WITH_XMLTO --with-xmlto
2645 # XORG_WITH_ASCIIDOC --with-asciidoc
2646 # XORG_WITH_DOXYGEN --with-doxygen
2647 # XORG_WITH_FOP --with-fop
2648 # XORG_WITH_GROFF --with-groff
2649 # XORG_WITH_PS2PDF --with-ps2pdf
2651 # Interface to module:
2652 # ENABLE_SPECS: used in makefiles to conditionally generate specs
2653 # --enable-specs: 'yes' user instructs the module to generate specs
2654 # 'no' user instructs the module not to generate specs
2655 # parm1: specify the default value, yes or no.
2657 AC_DEFUN([XORG_ENABLE_SPECS],[
2658 m4_define([spec_default], m4_default([$1], [yes]))
2659 AC_ARG_ENABLE(specs,
2660 AS_HELP_STRING([--enable-specs],
2661 [Enable building the specs (default: ]spec_default[)]),
2662 [build_specs=$enableval], [build_specs=]spec_default)
2663 m4_undefine([spec_default])
2664 AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
2665 AC_MSG_CHECKING([whether to build functional specifications])
2666 AC_MSG_RESULT([$build_specs])
2667 ]) # XORG_ENABLE_SPECS
2669 # XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
2670 # ----------------------------------------------
2671 # Minimum version: 1.13.0
2673 # This macro enables a builder to enable/disable unit testing
2674 # It makes no assumption about the test cases implementation
2675 # Test cases may or may not use Automake "Support for test suites"
2676 # They may or may not use the software utility library GLib
2678 # When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
2679 # ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
2680 # The variable enable_unit_tests is used by other macros in this file.
2682 # Interface to module:
2683 # ENABLE_UNIT_TESTS: used in makefiles to conditionally build tests
2684 # enable_unit_tests: used in configure.ac for additional configuration
2685 # --enable-unit-tests: 'yes' user instructs the module to build tests
2686 # 'no' user instructs the module not to build tests
2687 # parm1: specify the default value, yes or no.
2689 AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
2690 AC_BEFORE([$0], [XORG_WITH_GLIB])
2691 AC_BEFORE([$0], [XORG_LD_WRAP])
2692 AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
2693 m4_define([_defopt], m4_default([$1], [auto]))
2694 AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
2695 [Enable building unit test cases (default: ]_defopt[)]),
2696 [enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
2697 m4_undefine([_defopt])
2698 AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
2699 AC_MSG_CHECKING([whether to build unit test cases])
2700 AC_MSG_RESULT([$enable_unit_tests])
2701 ]) # XORG_ENABLE_UNIT_TESTS
2703 # XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
2704 # ------------------------------------------------------
2705 # Minimum version: 1.17.0
2707 # This macro enables a builder to enable/disable integration testing
2708 # It makes no assumption about the test cases' implementation
2709 # Test cases may or may not use Automake "Support for test suites"
2711 # Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
2712 # usually requires less dependencies and may be built and run under less
2713 # stringent environments than integration tests.
2715 # Interface to module:
2716 # ENABLE_INTEGRATION_TESTS: used in makefiles to conditionally build tests
2717 # enable_integration_tests: used in configure.ac for additional configuration
2718 # --enable-integration-tests: 'yes' user instructs the module to build tests
2719 # 'no' user instructs the module not to build tests
2720 # parm1: specify the default value, yes or no.
2722 AC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
2723 AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
2724 m4_define([_defopt], m4_default([$1], [auto]))
2725 AC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
2726 [Enable building integration test cases (default: ]_defopt[)]),
2727 [enable_integration_tests=$enableval],
2728 [enable_integration_tests=]_defopt)
2729 m4_undefine([_defopt])
2730 AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
2731 [test "x$enable_integration_tests" != xno])
2732 AC_MSG_CHECKING([whether to build unit test cases])
2733 AC_MSG_RESULT([$enable_integration_tests])
2734 ]) # XORG_ENABLE_INTEGRATION_TESTS
2736 # XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
2737 # ----------------------------------------
2738 # Minimum version: 1.13.0
2740 # GLib is a library which provides advanced data structures and functions.
2741 # This macro enables a module to test for the presence of Glib.
2743 # When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
2744 # Otherwise the value of $enable_unit_tests is blank.
2746 # Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
2747 # test support usually requires less dependencies and may be built and run under
2748 # less stringent environments than integration tests.
2750 # Interface to module:
2751 # HAVE_GLIB: used in makefiles to conditionally build targets
2752 # with_glib: used in configure.ac to know if GLib has been found
2753 # --with-glib: 'yes' user instructs the module to use glib
2754 # 'no' user instructs the module not to use glib
2756 AC_DEFUN([XORG_WITH_GLIB],[
2757 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2758 m4_define([_defopt], m4_default([$2], [auto]))
2759 AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
2760 [Use GLib library for unit testing (default: ]_defopt[)]),
2761 [with_glib=$withval], [with_glib=]_defopt)
2762 m4_undefine([_defopt])
2765 # Do not probe GLib if user explicitly disabled unit testing
2766 if test "x$enable_unit_tests" != x"no"; then
2767 # Do not probe GLib if user explicitly disabled it
2768 if test "x$with_glib" != x"no"; then
2771 [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
2772 [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
2777 # Not having GLib when unit testing has been explicitly requested is an error
2778 if test "x$enable_unit_tests" = x"yes"; then
2779 if test "x$have_glib" = x"no"; then
2780 AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
2784 # Having unit testing disabled when GLib has been explicitly requested is an error
2785 if test "x$enable_unit_tests" = x"no"; then
2786 if test "x$with_glib" = x"yes"; then
2787 AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
2791 # Not having GLib when it has been explicitly requested is an error
2792 if test "x$with_glib" = x"yes"; then
2793 if test "x$have_glib" = x"no"; then
2794 AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
2798 AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
2801 # XORG_LD_WRAP([required|optional])
2802 # ---------------------------------
2803 # Minimum version: 1.13.0
2805 # Check if linker supports -wrap, passed via compiler flags
2807 # When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
2808 # Otherwise the value of $enable_unit_tests is blank.
2810 # Argument added in 1.16.0 - default is "required", to match existing behavior
2811 # of returning an error if enable_unit_tests is yes, and ld -wrap is not
2812 # available, an argument of "optional" allows use when some unit tests require
2813 # ld -wrap and others do not.
2815 AC_DEFUN([XORG_LD_WRAP],[
2816 XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
2817 [AC_LANG_PROGRAM([#include <stdlib.h>
2818 void __wrap_exit(int status) { return; }],
2820 # Not having ld wrap when unit testing has been explicitly requested is an error
2821 if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
2822 if test "x$have_ld_wrap" = x"no"; then
2823 AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
2826 AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
2830 # XORG_CHECK_LINKER_FLAGS
2831 # -----------------------
2834 # XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
2838 # Check whether the given linker FLAGS work with the current language's
2839 # linker, or whether they give an error.
2841 # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
2844 # PROGRAM-SOURCE is the program source to link with, if needed
2846 # NOTE: Based on AX_CHECK_COMPILER_FLAGS.
2850 # Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
2851 # Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
2852 # Copyright (c) 2009 Matteo Frigo
2854 # This program is free software: you can redistribute it and/or modify it
2855 # under the terms of the GNU General Public License as published by the
2856 # Free Software Foundation, either version 3 of the License, or (at your
2857 # option) any later version.
2859 # This program is distributed in the hope that it will be useful, but
2860 # WITHOUT ANY WARRANTY; without even the implied warranty of
2861 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
2862 # Public License for more details.
2864 # You should have received a copy of the GNU General Public License along
2865 # with this program. If not, see <http://www.gnu.org/licenses/>.
2867 # As a special exception, the respective Autoconf Macro's copyright owner
2868 # gives unlimited permission to copy, distribute and modify the configure
2869 # scripts that are the output of Autoconf when processing the Macro. You
2870 # need not follow the terms of the GNU General Public License when using
2871 # or distributing such scripts, even though portions of the text of the
2872 # Macro appear in them. The GNU General Public License (GPL) does govern
2873 # all other use of the material that constitutes the Autoconf Macro.
2875 # This special exception to the GPL applies to versions of the Autoconf
2876 # Macro released by the Autoconf Archive. When you make and distribute a
2877 # modified version of the Autoconf Macro, you may extend this special
2878 # exception to the GPL to apply to your modified version as well.#
2879 AC_DEFUN([XORG_CHECK_LINKER_FLAGS],
2880 [AC_MSG_CHECKING([whether the linker accepts $1])
2881 dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
2883 [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
2884 ax_save_FLAGS=$LDFLAGS
2886 AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
2887 AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
2888 AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
2889 LDFLAGS=$ax_save_FLAGS])],
2890 [ax_save_FLAGS=$LDFLAGS
2892 AC_LINK_IFELSE([AC_LANG_PROGRAM()],
2893 eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
2894 eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
2895 LDFLAGS=$ax_save_FLAGS])
2896 eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
2897 AC_MSG_RESULT($xorg_check_linker_flags)
2898 if test "x$xorg_check_linker_flags" = xyes; then
2903 ]) # XORG_CHECK_LINKER_FLAGS
2905 # XORG_MEMORY_CHECK_FLAGS
2906 # -----------------------
2907 # Minimum version: 1.16.0
2909 # This macro attempts to find appropriate memory checking functionality
2910 # for various platforms which unit testing code may use to catch various
2911 # forms of memory allocation and access errors in testing.
2913 # Interface to module:
2914 # XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
2915 # Usually added to TESTS_ENVIRONMENT in Makefile.am
2917 # If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
2919 AC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
2921 AC_REQUIRE([AC_CANONICAL_HOST])
2922 AC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
2923 [Environment variables to enable memory checking in tests])
2925 # Check for different types of support on different platforms
2928 AC_CHECK_LIB([umem], [umem_alloc],
2929 [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
2931 *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
2932 # both directly and inverted, so should not be 0 or 255.
2933 malloc_debug_env='MALLOC_PERTURB_=15'
2936 malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
2939 malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
2943 # User supplied flags override default flags
2944 if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
2945 malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
2948 AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
2951 # XORG_CHECK_MALLOC_ZERO
2952 # ----------------------
2953 # Minimum version: 1.0.0
2955 # Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
2956 # malloc(0) returns NULL. Packages should add one of these cflags to
2957 # their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
2958 AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
2959 AC_ARG_ENABLE(malloc0returnsnull,
2960 AS_HELP_STRING([--enable-malloc0returnsnull],
2961 [malloc(0) returns NULL (default: auto)]),
2962 [MALLOC_ZERO_RETURNS_NULL=$enableval],
2963 [MALLOC_ZERO_RETURNS_NULL=auto])
2965 AC_MSG_CHECKING([whether malloc(0) returns NULL])
2966 if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
2967 AC_CACHE_VAL([xorg_cv_malloc0_returns_null],
2968 [AC_RUN_IFELSE([AC_LANG_PROGRAM([
2971 char *m0, *r0, *c0, *p;
2976 exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
2978 [xorg_cv_malloc0_returns_null=yes],
2979 [xorg_cv_malloc0_returns_null=no])])
2980 MALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
2982 AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
2984 if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
2985 MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
2986 XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
2987 XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
2989 MALLOC_ZERO_CFLAGS=""
2990 XMALLOC_ZERO_CFLAGS=""
2991 XTMALLOC_ZERO_CFLAGS=""
2994 AC_SUBST([MALLOC_ZERO_CFLAGS])
2995 AC_SUBST([XMALLOC_ZERO_CFLAGS])
2996 AC_SUBST([XTMALLOC_ZERO_CFLAGS])
2997 ]) # XORG_CHECK_MALLOC_ZERO
3001 # Minimum version: 1.1.0
3003 # This macro enables the use of a tool that flags some suspicious and
3004 # non-portable constructs (likely to be bugs) in C language source code.
3005 # It will attempt to locate the tool and use appropriate options.
3006 # There are various lint type tools on different platforms.
3008 # Interface to module:
3009 # LINT: returns the path to the tool found on the platform
3010 # or the value set to LINT on the configure cmd line
3011 # also an Automake conditional
3012 # LINT_FLAGS: an Automake variable with appropriate flags
3014 # --with-lint: 'yes' user instructs the module to use lint
3015 # 'no' user instructs the module not to use lint (default)
3017 # If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
3018 # If the user sets the value of LINT_FLAGS, they are used verbatim.
3020 AC_DEFUN([XORG_WITH_LINT],[
3022 AC_ARG_VAR([LINT], [Path to a lint-style command])
3023 AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
3024 AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
3025 [Use a lint-style source code checker (default: disabled)])],
3026 [use_lint=$withval], [use_lint=no])
3028 # Obtain platform specific info like program name and options
3029 # The lint program on FreeBSD and NetBSD is different from the one on Solaris
3031 *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
3033 lint_options="-badflag"
3035 *freebsd* | *netbsd*)
3037 lint_options="-u -b"
3041 lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
3045 # Test for the presence of the program (either guessed by the code or spelled out by the user)
3046 if test "x$use_lint" = x"yes" ; then
3047 AC_PATH_PROG([LINT], [$lint_name])
3048 if test "x$LINT" = "x"; then
3049 AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
3051 elif test "x$use_lint" = x"no" ; then
3052 if test "x$LINT" != "x"; then
3053 AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
3056 AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
3059 # User supplied flags override default flags
3060 if test "x$LINT_FLAGS" != "x"; then
3061 lint_options=$LINT_FLAGS
3064 AC_SUBST([LINT_FLAGS],[$lint_options])
3065 AM_CONDITIONAL(LINT, [test "x$LINT" != x])
3069 # XORG_LINT_LIBRARY(LIBNAME)
3070 # --------------------------
3071 # Minimum version: 1.1.0
3073 # Sets up flags for building lint libraries for checking programs that call
3074 # functions in the library.
3076 # Interface to module:
3077 # LINTLIB - Automake variable with the name of lint library file to make
3078 # MAKE_LINT_LIB - Automake conditional
3080 # --enable-lint-library: - 'yes' user instructs the module to created a lint library
3081 # - 'no' user instructs the module not to create a lint library (default)
3083 AC_DEFUN([XORG_LINT_LIBRARY],[
3084 AC_REQUIRE([XORG_WITH_LINT])
3085 AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
3086 [Create lint library (default: disabled)])],
3087 [make_lint_lib=$enableval], [make_lint_lib=no])
3089 if test "x$make_lint_lib" = x"yes" ; then
3091 if test "x$LINT" = "x"; then
3092 AC_MSG_ERROR([Cannot make lint library without --with-lint])
3094 elif test "x$make_lint_lib" != x"no" ; then
3095 AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
3099 AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
3101 ]) # XORG_LINT_LIBRARY
3103 # XORG_COMPILER_BRAND
3104 # -------------------
3105 # Minimum version: 1.14.0
3107 # Checks for various brands of compilers and sets flags as appropriate:
3108 # GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
3109 # GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
3110 # clang compiler - sets CLANGCC to "yes"
3111 # Intel compiler - sets INTELCC to "yes"
3112 # Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
3114 AC_DEFUN([XORG_COMPILER_BRAND], [
3117 AC_REQUIRE([AC_PROG_CC_C99])
3120 AC_REQUIRE([AC_PROG_CXX])
3123 AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
3124 AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
3125 AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
3126 ]) # XORG_COMPILER_BRAND
3128 # XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
3130 # Minimum version: 1.16.0
3132 # Test if the compiler works when passed the given flag as a command line argument.
3133 # If it succeeds, the flag is appeneded to the given variable. If not, it tries the
3134 # next flag in the list until there are no more options.
3136 # Note that this does not guarantee that the compiler supports the flag as some
3137 # compilers will simply ignore arguments that they do not understand, but we do
3138 # attempt to weed out false positives by using -Werror=unknown-warning-option and
3139 # -Werror=unused-command-line-argument
3141 AC_DEFUN([XORG_TESTSET_CFLAG], [
3142 m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
3143 m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
3145 AC_LANG_COMPILER_REQUIRE
3149 AC_REQUIRE([AC_PROG_CC_C99])
3150 define([PREFIX], [C])
3151 define([CACHE_PREFIX], [cc])
3152 define([COMPILER], [$CC])
3155 define([PREFIX], [CXX])
3156 define([CACHE_PREFIX], [cxx])
3157 define([COMPILER], [$CXX])
3161 [xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
3163 if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
3164 PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
3165 AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
3166 [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
3167 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
3168 [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
3169 [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
3170 [xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
3171 PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
3174 if test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
3175 if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
3176 PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
3178 PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
3179 AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
3180 [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
3181 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
3182 [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
3183 [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
3184 [xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
3185 PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
3189 m4_foreach([flag], m4_cdr($@), [
3190 if test $found = "no" ; then
3191 if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
3192 PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
3195 if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
3196 PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
3199 PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
3201 dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
3202 AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
3203 cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
3204 AC_CACHE_VAL($cacheid,
3205 [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
3206 [eval $cacheid=yes],
3207 [eval $cacheid=no])])
3209 PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
3211 eval supported=\$$cacheid
3212 AC_MSG_RESULT([$supported])
3213 if test "$supported" = "yes" ; then
3219 ]) # XORG_TESTSET_CFLAG
3221 # XORG_COMPILER_FLAGS
3223 # Minimum version: 1.16.0
3225 # Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
3226 # arguments supported by the selected compiler which do NOT alter the generated
3227 # code. These arguments will cause the compiler to print various warnings
3228 # during compilation AND turn a conservative set of warnings into errors.
3230 # The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
3231 # future versions of util-macros as options are added to new compilers.
3233 AC_DEFUN([XORG_COMPILER_FLAGS], [
3234 AC_REQUIRE([XORG_COMPILER_BRAND])
3236 AC_ARG_ENABLE(selective-werror,
3237 AS_HELP_STRING([--disable-selective-werror],
3238 [Turn off selective compiler errors. (default: enabled)]),
3239 [SELECTIVE_WERROR=$enableval],
3240 [SELECTIVE_WERROR=yes])
3244 define([PREFIX], [C])
3247 define([PREFIX], [CXX])
3250 # -v is too short to test reliably with XORG_TESTSET_CFLAG
3251 if test "x$SUNCC" = "xyes"; then
3252 [BASE_]PREFIX[FLAGS]="-v"
3254 [BASE_]PREFIX[FLAGS]=""
3257 # This chunk of warnings were those that existed in the legacy CWARNFLAGS
3258 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
3259 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
3260 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
3261 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
3265 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
3266 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
3267 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
3268 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
3269 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
3270 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
3274 # This chunk adds additional warnings that could catch undesired effects.
3275 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
3276 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
3277 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
3278 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
3279 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
3280 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
3281 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
3283 # These are currently disabled because they are noisy. They will be enabled
3284 # in the future once the codebase is sufficiently modernized to silence
3285 # them. For now, I don't want them to drown out the other warnings.
3286 # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
3287 # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
3288 # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
3290 # Turn some warnings into errors, so we don't accidently get successful builds
3291 # when there are problems that should be fixed.
3293 if test "x$SELECTIVE_WERROR" = "xyes" ; then
3294 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
3295 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
3296 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
3297 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
3298 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
3299 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
3300 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
3301 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
3302 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
3303 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
3304 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
3305 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
3306 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
3308 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])
3309 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
3310 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
3311 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
3312 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
3313 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
3314 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
3315 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
3316 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
3317 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
3318 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
3319 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
3320 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
3321 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
3324 AC_SUBST([BASE_]PREFIX[FLAGS])
3325 ]) # XORG_COMPILER_FLAGS
3329 # Minimum version: 1.2.0
3330 # Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
3332 # Defines CWARNFLAGS to enable C compiler warnings.
3334 # This function is deprecated because it defines -fno-strict-aliasing
3335 # which alters the code generated by the compiler. If -fno-strict-aliasing
3336 # is needed, then it should be added explicitly in the module when
3337 # it is updated to use BASE_CFLAGS.
3339 AC_DEFUN([XORG_CWARNFLAGS], [
3340 AC_REQUIRE([XORG_COMPILER_FLAGS])
3341 AC_REQUIRE([XORG_COMPILER_BRAND])
3344 CWARNFLAGS="$BASE_CFLAGS"
3345 if test "x$GCC" = xyes ; then
3346 CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
3348 AC_SUBST(CWARNFLAGS)
3351 ]) # XORG_CWARNFLAGS
3353 # XORG_STRICT_OPTION
3354 # -----------------------
3355 # Minimum version: 1.3.0
3357 # Add configure option to enable strict compilation flags, such as treating
3358 # warnings as fatal errors.
3359 # If --enable-strict-compilation is passed to configure, adds strict flags to
3360 # $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
3362 # Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
3363 # when strict compilation is unconditionally desired.
3364 AC_DEFUN([XORG_STRICT_OPTION], [
3365 AC_REQUIRE([XORG_CWARNFLAGS])
3366 AC_REQUIRE([XORG_COMPILER_FLAGS])
3368 AC_ARG_ENABLE(strict-compilation,
3369 AS_HELP_STRING([--enable-strict-compilation],
3370 [Enable all warnings from compiler and make them errors (default: disabled)]),
3371 [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
3375 define([PREFIX], [C])
3378 define([PREFIX], [CXX])
3382 [STRICT_]PREFIX[FLAGS]=""
3383 XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
3384 XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
3386 # Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
3387 # activate it with -Werror, so we add it here explicitly.
3388 XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
3390 if test "x$STRICT_COMPILE" = "xyes"; then
3391 [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
3392 AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
3394 AC_SUBST([STRICT_]PREFIX[FLAGS])
3395 AC_SUBST([BASE_]PREFIX[FLAGS])
3396 AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
3397 ]) # XORG_STRICT_OPTION
3399 # XORG_DEFAULT_OPTIONS
3400 # --------------------
3401 # Minimum version: 1.3.0
3403 # Defines default options for X.Org modules.
3405 AC_DEFUN([XORG_DEFAULT_OPTIONS], [
3406 AC_REQUIRE([AC_PROG_INSTALL])
3410 XORG_RELEASE_VERSION
3413 XORG_MANPAGE_SECTIONS
3414 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
3415 [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
3416 ]) # XORG_DEFAULT_OPTIONS
3420 # Minimum version: 1.4.0
3422 # Defines the variable INSTALL_CMD as the command to copy
3423 # INSTALL from $prefix/share/util-macros.
3425 AC_DEFUN([XORG_INSTALL], [
3426 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
3427 macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
3428 INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
3429 mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
3430 || (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
3431 echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
3432 AC_SUBST([INSTALL_CMD])
3434 dnl Copyright 2005 Red Hat, Inc
3436 dnl Permission to use, copy, modify, distribute, and sell this software and its
3437 dnl documentation for any purpose is hereby granted without fee, provided that
3438 dnl the above copyright notice appear in all copies and that both that
3439 dnl copyright notice and this permission notice appear in supporting
3442 dnl The above copyright notice and this permission notice shall be included
3443 dnl in all copies or substantial portions of the Software.
3445 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
3446 dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
3447 dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
3448 dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
3449 dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
3450 dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
3451 dnl OTHER DEALINGS IN THE SOFTWARE.
3453 dnl Except as contained in this notice, the name of the copyright holders shall
3454 dnl not be used in advertising or otherwise to promote the sale, use or
3455 dnl other dealings in this Software without prior written authorization
3456 dnl from the copyright holders.
3459 # XORG_RELEASE_VERSION
3460 # --------------------
3461 # Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
3463 AC_DEFUN([XORG_RELEASE_VERSION],[
3464 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
3465 [`echo $PACKAGE_VERSION | cut -d . -f 1`],
3466 [Major version of this package])
3467 PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
3468 if test "x$PVM" = "x"; then
3471 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
3473 [Minor version of this package])
3474 PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
3475 if test "x$PVP" = "x"; then
3478 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
3480 [Patch version of this package])
3485 # Minimum version: 1.2.0
3487 # Defines the variable CHANGELOG_CMD as the command to generate
3488 # ChangeLog from git.
3491 AC_DEFUN([XORG_CHANGELOG], [
3492 CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
3493 mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
3494 || (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
3495 echo 'git directory not found: installing possibly empty changelog.' >&2)"
3496 AC_SUBST([CHANGELOG_CMD])
3500 dnl Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
3502 dnl Permission is hereby granted, free of charge, to any person obtaining a
3503 dnl copy of this software and associated documentation files (the "Software"),
3504 dnl to deal in the Software without restriction, including without limitation
3505 dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
3506 dnl and/or sell copies of the Software, and to permit persons to whom the
3507 dnl Software is furnished to do so, subject to the following conditions:
3509 dnl The above copyright notice and this permission notice (including the next
3510 dnl paragraph) shall be included in all copies or substantial portions of the
3513 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
3514 dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
3515 dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
3516 dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
3517 dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
3518 dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
3519 dnl DEALINGS IN THE SOFTWARE.
3522 # XTRANS_TCP_FLAGS()
3523 # ------------------
3524 # Find needed libraries for TCP sockets, and check for IPv6 support
3525 AC_DEFUN([XTRANS_TCP_FLAGS],[
3526 # SVR4 hides these in libraries other than libc
3527 AC_SEARCH_LIBS(socket, [socket])
3528 AC_SEARCH_LIBS(gethostbyname, [nsl])
3529 if test "$ac_cv_search_socket$ac_cv_search_gethostbyname" = "nono"; then
3530 AC_CHECK_LIB([ws2_32],[main])
3533 # Needs to come after above checks for libsocket & libnsl for SVR4 systems
3535 AS_HELP_STRING([--enable-ipv6],[Enable IPv6 support]),
3536 [IPV6CONN=$enableval],
3537 [AC_CHECK_FUNC(getaddrinfo,[IPV6CONN=yes],[IPV6CONN=no])])
3538 AC_MSG_CHECKING([if IPv6 support should be built])
3539 if test "$IPV6CONN" = "yes"; then
3540 AC_DEFINE(IPv6,1,[Support IPv6 for TCP connections])
3542 AC_MSG_RESULT($IPV6CONN)
3544 # 4.3BSD-Reno added a new member to struct sockaddr_in
3545 AC_CHECK_MEMBER([struct sockaddr_in.sin_len],
3546 AC_DEFINE([BSD44SOCKETS],1,
3547 [Define to 1 if `struct sockaddr_in' has a `sin_len' member]), [], [
3548 #include <sys/types.h>
3549 #include <sys/socket.h>
3550 #include <netinet/in.h>
3553 # POSIX.1g changed the type of pointer passed to getsockname/getpeername/etc.
3554 AC_CHECK_TYPES([socklen_t], [], [], [
3556 #include <sys/socket.h>])
3558 # XPG4v2/UNIX95 added msg_control - check to see if we need to define
3559 # _XOPEN_SOURCE to get it (such as on Solaris)
3560 AC_CHECK_MEMBER([struct msghdr.msg_control], [], [],
3563 #include <sys/socket.h>
3565 # First try for Solaris in C99 compliant mode, which requires XPG6/UNIX03
3566 if test "x$ac_cv_member_struct_msghdr_msg_control" = xno; then
3567 unset ac_cv_member_struct_msghdr_msg_control
3568 AC_MSG_NOTICE([trying again with _XOPEN_SOURCE=600])
3569 AC_CHECK_MEMBER([struct msghdr.msg_control],
3570 [AC_DEFINE([_XOPEN_SOURCE], [600],
3571 [Defined if needed to expose struct msghdr.msg_control])
3573 #define _XOPEN_SOURCE 600
3575 #include <sys/socket.h>
3578 # If that didn't work, fall back to XPG5/UNIX98 with C89
3579 if test "x$ac_cv_member_struct_msghdr_msg_control" = xno; then
3580 unset ac_cv_member_struct_msghdr_msg_control
3581 AC_MSG_NOTICE([trying again with _XOPEN_SOURCE=500])
3582 AC_CHECK_MEMBER([struct msghdr.msg_control],
3583 [AC_DEFINE([_XOPEN_SOURCE], [500],
3584 [Defined if needed to expose struct msghdr.msg_control])
3586 #define _XOPEN_SOURCE 500
3588 #include <sys/socket.h>
3593 ]) # XTRANS_TCP_FLAGS
3595 # XTRANS_CONNECTION_FLAGS()
3596 # -------------------------
3597 # Standard checks for which Xtrans transports to use by the Xorg packages
3598 # that use Xtrans functions
3599 AC_DEFUN([XTRANS_CONNECTION_FLAGS],[
3600 AC_REQUIRE([AC_CANONICAL_HOST])
3602 mingw*) unixdef="no" ;;
3605 AC_ARG_ENABLE(unix-transport,
3606 AS_HELP_STRING([--enable-unix-transport],[Enable UNIX domain socket transport]),
3607 [UNIXCONN=$enableval], [UNIXCONN=$unixdef])
3608 AC_MSG_CHECKING([if Xtrans should support UNIX socket connections])
3609 if test "$UNIXCONN" = "yes"; then
3610 AC_DEFINE(UNIXCONN,1,[Support UNIX socket connections])
3612 AC_MSG_RESULT($UNIXCONN)
3613 AC_ARG_ENABLE(tcp-transport,
3614 AS_HELP_STRING([--enable-tcp-transport],[Enable TCP socket transport]),
3615 [TCPCONN=$enableval], [TCPCONN=yes])
3616 AC_MSG_CHECKING([if Xtrans should support TCP socket connections])
3617 AC_MSG_RESULT($TCPCONN)
3618 if test "$TCPCONN" = "yes"; then
3619 AC_DEFINE(TCPCONN,1,[Support TCP socket connections])
3623 solaris*|sco*|sysv4*) localdef="yes" ;;
3626 AC_ARG_ENABLE(local-transport,
3627 AS_HELP_STRING([--enable-local-transport],[Enable os-specific local transport]),
3628 [LOCALCONN=$enableval], [LOCALCONN=$localdef])
3629 AC_MSG_CHECKING([if Xtrans should support os-specific local connections])
3630 AC_MSG_RESULT($LOCALCONN)
3631 if test "$LOCALCONN" = "yes"; then
3632 AC_DEFINE(LOCALCONN,1,[Support os-specific local connections])
3635 ]) # XTRANS_CONNECTION_FLAGS
3638 # XTRANS_SECURE_RPC_FLAGS()
3639 # -------------------------
3640 # Check for Secure RPC functions - must come after XTRANS_TCP_FLAGS
3641 # so that any necessary networking libraries are already found
3642 AC_DEFUN([XTRANS_SECURE_RPC_FLAGS],
3643 [AC_REQUIRE([XTRANS_TCP_FLAGS])
3644 AC_ARG_ENABLE(secure-rpc,
3645 AS_HELP_STRING([--enable-secure-rpc],[Enable Secure RPC]),
3646 [SECURE_RPC=$enableval], [SECURE_RPC="try"])
3648 if test "x$SECURE_RPC" = "xyes" -o "x$SECURE_RPC" = "xtry" ; then
3649 FOUND_SECURE_RPC="no"
3650 AC_CHECK_FUNCS([authdes_seccreate authdes_create],
3651 [FOUND_SECURE_RPC="yes"])
3652 if test "x$FOUND_SECURE_RPC" = "xno" ; then
3653 if test "x$SECURE_RPC" = "xyes" ; then
3654 AC_MSG_ERROR([Secure RPC requested, but required functions not found])
3658 dnl FreeBSD keeps getsecretkey in librpcsvc
3659 AC_SEARCH_LIBS(getsecretkey, [rpcsvc])
3663 AC_MSG_CHECKING([if Secure RPC authentication ("SUN-DES-1") should be supported])
3664 if test "x$SECURE_RPC" = "xyes" ; then
3665 AC_DEFINE(SECURE_RPC, 1, [Support Secure RPC ("SUN-DES-1") authentication for X11 clients])
3667 AC_MSG_RESULT($SECURE_RPC)
3668 ]) # XTRANS_SECURE_RPC_FLAGS