tests: Add "while (false)" test to increase coverage
[vala-gnome.git] / configure.ac
blob3d7ddced8922baa2c0a7c8974ad9e15f272e3b6a
1 AC_PREREQ([2.65])
2 AC_INIT([vala], m4_esyscmd([build-aux/git-version-gen .tarball-version]),
3         [https://bugzilla.gnome.org/browse.cgi?product=vala],
4         [vala],
5         [https://wiki.gnome.org/Projects/Vala])
6 AC_CONFIG_SRCDIR([Makefile.am])
7 AC_CONFIG_AUX_DIR([build-aux])
8 AC_CONFIG_HEADERS(config.h)
9 AC_CONFIG_MACRO_DIR([m4])
10 AM_INIT_AUTOMAKE([1.11 dist-xz no-dist-gzip])
11 AM_MAINTAINER_MODE([enable])
13 API_VERSION=0.36
14 PACKAGE_SUFFIX="-$API_VERSION"
16 dnl http://people.gnome.org/~walters/docs/build-api.txt
17 dnl We don't support separate builddir when building from git
18 echo \#buildapi-variable-no-builddir >/dev/null
20 AC_SUBST(API_VERSION)
21 AC_DEFINE_UNQUOTED(API_VERSION, "$API_VERSION", [Define to the api-version of this package])
22 AC_SUBST(PACKAGE_SUFFIX)
23 AC_DEFINE_UNQUOTED(PACKAGE_SUFFIX, "$PACKAGE_SUFFIX", [Define to the suffix of this package])
25 program_transform_name="s,\$\$,${PACKAGE_SUFFIX},"
27 AC_SUBST(pkgdatadir, [${datadir}/vala${PACKAGE_SUFFIX}])
29 # Checks for programs.
30 AC_PROG_CC
31 AM_PROG_CC_C_O
32 AC_PROG_LN_S
33 AC_PROG_INSTALL
34 AC_PROG_MKDIR_P
36 LT_PREREQ([2.2.6])
37 LT_INIT([disable-static])
38 PKG_PROG_PKG_CONFIG([0.21])
40 AC_PROG_LEX
41 if test "$LEX" = :; then
42         AC_MSG_ERROR([flex not found but required])
45 AC_CHECK_PROGS(YACC, 'bison -y' byacc yacc, :)
46 if test "$YACC" = :; then
47         AC_MSG_ERROR([bison not found but required])
50 AC_PATH_PROG(VALAC, valac, valac)
51 AC_SUBST(VALAC)
53 VALAC_BOOTSTRAP_REQUIRED=0.25.1
55 AS_IF([test "$VALAC" != valac], [FOUND_VALAC_VERION=`$VALAC --version | sed 's/Vala  *//'`
56         AS_VERSION_COMPARE(["$VALAC_BOOTSTRAP_REQUIRED"], ["$FOUND_VALAC_VERION"],
57                 [enable_boostrap=yes], [enable_boostrap=yes], [enable_boostrap=no])])
59 VALAFLAGS="$VALAFLAGS --disable-version-header"
60 if test x$enable_boostrap = xyes; then
61         VALAFLAGS="$VALAFLAGS --hide-internal"
64 AC_SUBST(VALAFLAGS)
65 AC_SUBST(CFLAGS)
66 AC_SUBST(CPPFLAGS)
67 AC_SUBST(LDFLAGS)
69 AC_ARG_ENABLE(unversioned, AS_HELP_STRING([--disable-unversioned], [Disable unversioned binaries]), enable_unversioned=$enableval, enable_unversioned=yes)
70 AM_CONDITIONAL(ENABLE_UNVERSIONED, test x$enable_unversioned = xyes)
72 AC_ARG_ENABLE(coverage, AS_HELP_STRING([--enable-coverage], [Enable coverage analysis]), enable_coverage=$enableval, enable_coverage=no)
73 AM_CONDITIONAL(ENABLE_COVERAGE, test x$enable_coverage = xyes)
75 if test "$enable_coverage" = "yes"; then
76         COVERAGE_VALAFLAGS="-g"
77         COVERAGE_CFLAGS="-fprofile-arcs -ftest-coverage"
78         COVERAGE_LIBS="-lgcov"
79 else
80         COVERAGE_VALAFLAGS=
81         COVERAGE_CFLAGS=
82         COVERAGE_LIBS=
84 AC_SUBST(COVERAGE_VALAFLAGS)
85 AC_SUBST(COVERAGE_CFLAGS)
86 AC_SUBST(COVERAGE_LIBS)
88 GLIB_REQUIRED=2.32.0
90 PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GLIB_REQUIRED)
92 AC_SUBST(GLIB_CFLAGS)
93 AC_SUBST(GLIB_LIBS)
95 PKG_CHECK_MODULES(GMODULE, gmodule-2.0 >= $GLIB_REQUIRED)
97 AC_SUBST(GMODULE_CFLAGS)
98 AC_SUBST(GMODULE_LIBS)
100 AC_PATH_PROG([XSLTPROC], [xsltproc], :)
101 AM_CONDITIONAL(HAVE_XSLTPROC, test "$XSLTPROC" != :)
103 AC_CHECK_PROG([WEASYPRINT], [weasyprint], [weasyprint])
104 AM_CONDITIONAL(HAVE_WEASYPRINT, [test x$WEASYPRINT = xweasyprint])
106 AC_CHECK_PROG([HELP2MAN], [help2man], [help2man])
107 AM_CONDITIONAL([HAVE_HELP2MAN], [test x$HELP2MAN = xhelp2man])
109 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
111 AC_CONFIG_FILES([Makefile
112            libvala.pc
113            gee/Makefile
114            ccode/Makefile
115            vala/Makefile
116            codegen/Makefile
117            compiler/Makefile
118            vapi/Makefile
119            tests/Makefile
120            doc/Makefile
121            doc/manual/Makefile
122            doc/manual/version.xml
123            gobject-introspection/Makefile
124            vapigen/vapigen.pc
125            vapigen/Makefile
126            vapigen/vala-gen-introspect/Makefile
127            vapigen/vala-gen-introspect/vala-gen-introspect])
129 AC_OUTPUT