2 # Process this file with autoconf to produce a configure script.
7 AC_INIT([Check], [0.9.8], [check-devel at lists dot sourceforge dot net])
11 CHECK_VERSION=$CHECK_MAJOR_VERSION.$CHECK_MINOR_VERSION.$CHECK_MICRO_VERSION
13 # unique source file --- primitive safety check
14 AC_CONFIG_SRCDIR([src/check.c])
16 # place where extra autoconf macros are kept
17 AC_CONFIG_MACRO_DIR([m4])
19 # place where portability library functions are kept
20 AC_CONFIG_LIBOBJ_DIR([lib])
22 # place to put some extra build scripts installed
23 AC_CONFIG_AUX_DIR([build-aux])
25 # define things like _GNU_SOURCE appropriately
26 AC_USE_SYSTEM_EXTENSIONS
28 # really severe build strictness
29 AM_INIT_AUTOMAKE([-Wall -Werror gnits 1.9.6])
31 # FIXME: find the other places this stuff is used
33 AC_SUBST(CHECK_MAJOR_VERSION)
34 AC_SUBST(CHECK_MINOR_VERSION)
35 AC_SUBST(CHECK_MICRO_VERSION)
36 AC_SUBST(CHECK_VERSION)
41 AC_HELP_STRING([--enable-gcov],
42 [turn on test coverage @<:@default=no@:>@]),
43 [case "${enableval}" in
44 yes) enable_gcov=true ;;
45 no) enable_gcov=false ;;
46 *) AC_MSG_ERROR(bad value ${enableval} for --enable-gcov) ;;
47 esac], [enable_gcov=false ])
49 if test x$enable_gcov = xtrue ; then
50 if test -n "$GCC"; then
51 AC_MSG_ERROR([gcov only works if gcc is used])
54 GCOV_CFLAGS="-fprofile-arcs -ftest-coverage"
57 dnl libtool 1.5.22 and lower strip -fprofile-arcs from the flags
58 dnl passed to the linker, which is a bug; -fprofile-arcs implicitly
59 dnl links in -lgcov, so we do it explicitly here for the same effect
64 AM_CONDITIONAL(ENABLE_GCOV, test x"$enable_gcov" = "xtrue")
66 AC_ARG_ENABLE(timeout-tests,
67 AC_HELP_STRING([--enable-timeout-tests],
68 [turn on timeout tests @<:@default=yes@:>@]),
69 [case "${enableval}" in
70 yes) enable_timeout_tests=true ;;
71 no) enable_timeout_tests=false ;;
72 *) AC_MSG_ERROR(bad value ${enableval} for --enable-timeout-tests) ;;
73 esac], [enable_timeout_tests=true ])
75 AM_CONDITIONAL(NO_TIMEOUT_TESTS, test x"$enable_timeout_tests" = "xfalse")
77 AC_ARG_ENABLE(subunit,
78 AC_HELP_STRING([--enable-subunit],
79 [enable support for the subunit test protocol @<:@default=autodetect@:>@]),
80 [case "${enableval}" in
83 echo "Enabled subunit support"
87 echoo "Disabled subunit support"
90 echo "Subunit support will enable automatically."
92 *) AC_MSG_ERROR(bad value ${enableval} for --enable-subunit) ;;
94 [echo "Subunit support will enable automatically."
95 enable_subunit=autodetect])
97 # Checks for programs.
100 # Automake wants this for per-target CFLAGS
106 # add these options to CFLAGS if the compiler supports them
107 AC_DEFUN([AX_CFLAGS_ADD],[AX_C_CHECK_FLAG($1, , , CFLAGS="$CFLAGS $1")])
108 AX_CFLAGS_WARN_ALL_ANSI
109 AX_CFLAGS_ADD([-Wextra])
110 AX_CFLAGS_ADD([-Wstrict-prototypes])
111 AX_CFLAGS_ADD([-Wmissing-prototypes])
112 AX_CFLAGS_ADD([-Wwrite-strings])
113 AX_CFLAGS_ADD([-Wno-variadic-macros])
115 AC_CHECK_PROGS(GCOV, gcov, false)
116 AC_CHECK_PROGS(LCOV, lcov, false)
117 AC_CHECK_PROGS(GENHTML, genhtml, false)
118 AC_CHECK_PROGS(TEX, tex, false)
119 if test -n "$TEX"; then
120 # Make it [somewhat] clear to maintainers that tex is missing. Not an error
121 # though because 'make install' (which users need) does not build the docs
123 AC_MSG_WARN(tex not installed: cannot rebuild HTML documentation.)
126 # Checks for libraries.
128 # Checks for header files.
131 AC_CHECK_HEADERS([fcntl.h stddef.h stdint.h stdlib.h string.h sys/time.h unistd.h])
133 if test xfalse != x"$enable_subunit"; then
134 AC_CHECK_LIB(subunit, subunit_test_start, ,
135 [case "$enable_subunit" in
140 AC_MSG_ERROR([libsubunit is required for subunit protocol support. The homepage for subunit is https://launchpad.net/subunit/])
145 if test xfalse != x"$enable_subunit"; then
146 AC_CHECK_HEADER([subunit/child.h], ,
147 [case "$enable_subunit" in
152 AC_MSG_ERROR([The header subunit/child.h could not be succesfully included and is required for subunit protocol support. The homepage for subunit is https://launchpad.net/subunit/])
157 if test xfalse = x"$enable_subunit"; then
162 AC_SUBST(ENABLE_SUBUNIT)
163 AC_DEFINE_UNQUOTED(ENABLE_SUBUNIT, $ENABLE_SUBUNIT, [Subunit protocol result output])
165 AM_CONDITIONAL(SUBUNIT, test x"$enable_subunit" != "xfalse")
169 # Checks for typedefs, structures, and compiler characteristics.
176 AC_CHECK_SIZEOF(int, 4)
177 AC_CHECK_SIZEOF(short, 2)
178 AC_CHECK_SIZEOF(long, 4)
180 # Checks for library functions.
183 AC_REPLACE_FUNCS([fileno localtime_r pipe putenv setenv sleep strdup strsignal unsetenv])
184 AC_CHECK_DECLS([fileno, localtime_r, pipe, putenv, setenv, sleep, strdup, strsignal, unsetenv])
186 # Checks for pthread implementation.
191 AC_CONFIG_HEADERS([config.h])
193 AC_CONFIG_FILES([check.pc