tests: Move namespaces.vala into parser and merge its main methods
[vala-gnome.git] / configure.ac
blob8acaf0394403f99cf4d906af2b9cdc0138b6bffa
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 subdir-objects])
11 AM_MAINTAINER_MODE([enable])
13 API_VERSION=0.40
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}])
28 AC_SUBST(pkglibdir, [${libdir}/vala${PACKAGE_SUFFIX}])
30 # Checks for programs.
31 AC_PROG_CC
32 AM_PROG_CC_C_O
33 AC_PROG_LN_S
34 AC_PROG_INSTALL
35 AC_PROG_MKDIR_P
37 LT_PREREQ([2.2.6])
38 LT_INIT([disable-static])
39 PKG_PROG_PKG_CONFIG([0.21])
41 AC_PROG_LEX
42 if test "$LEX" = :; then
43         AC_MSG_ERROR([flex not found but required])
46 AC_CHECK_PROGS(YACC, 'bison -y' byacc yacc, :)
47 if test "$YACC" = :; then
48         AC_MSG_ERROR([bison not found but required])
51 AC_PATH_PROG(VALAC, valac, valac)
52 AC_SUBST(VALAC)
54 VALAC_BOOTSTRAP_REQUIRED=0.39.5.8
56 AS_IF([test "$VALAC" != valac], [FOUND_VALAC_VERION=`$VALAC --version | sed 's/Vala  *//'`
57         AS_VERSION_COMPARE(["$VALAC_BOOTSTRAP_REQUIRED"], ["$FOUND_VALAC_VERION"],
58                 [enable_boostrap=yes], [enable_boostrap=yes], [enable_boostrap=no])])
60 VALAFLAGS="$VALAFLAGS --disable-version-header"
61 if test x$enable_boostrap = xyes; then
62         VALAFLAGS="$VALAFLAGS --hide-internal --abi-stability"
65 AC_SUBST(VALAFLAGS)
66 AC_SUBST(CFLAGS)
67 AC_SUBST(CPPFLAGS)
68 AC_SUBST(LDFLAGS)
70 AC_ARG_ENABLE(unversioned, AS_HELP_STRING([--disable-unversioned], [Disable unversioned binaries]), enable_unversioned=$enableval, enable_unversioned=yes)
71 AM_CONDITIONAL(ENABLE_UNVERSIONED, test x$enable_unversioned = xyes)
73 AC_ARG_ENABLE(coverage, AS_HELP_STRING([--enable-coverage], [Enable coverage analysis]), enable_coverage=$enableval, enable_coverage=no)
74 AM_CONDITIONAL(ENABLE_COVERAGE, test x$enable_coverage = xyes)
76 if test "$enable_coverage" = "yes"; then
77         COVERAGE_VALAFLAGS="-g"
78         COVERAGE_CFLAGS="-fprofile-arcs -ftest-coverage"
79         COVERAGE_LIBS="-lgcov"
80 else
81         COVERAGE_VALAFLAGS=
82         COVERAGE_CFLAGS=
83         COVERAGE_LIBS=
85 AC_SUBST(COVERAGE_VALAFLAGS)
86 AC_SUBST(COVERAGE_CFLAGS)
87 AC_SUBST(COVERAGE_LIBS)
89 GLIB_REQUIRED=2.40.0
90 LIBGVC_REQUIRED=2.16
92 PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GLIB_REQUIRED)
94 AC_SUBST(GLIB_CFLAGS)
95 AC_SUBST(GLIB_LIBS)
97 PKG_CHECK_MODULES(GMODULE, gmodule-2.0 >= $GLIB_REQUIRED)
99 AC_SUBST(GMODULE_CFLAGS)
100 AC_SUBST(GMODULE_LIBS)
102 PKG_CHECK_MODULES(LIBGVC, libgvc >= $LIBGVC_REQUIRED)
103 AC_MSG_CHECKING([for CGRAPH])
104 cgraph_tmp_LIBADD="$LIBADD"
105 cgraph_tmp_CFLAGS="$CFLAGS"
106 LIBADD="$LIBADD $LIBGVC_LIBS"
107 CFLAGS="$CFLAGS $LIBGVC_CFLAGS"
108 AC_RUN_IFELSE(
109         [AC_LANG_SOURCE([
110                 #include <gvc.h>
112                 int main(void) {
113                         #ifdef WITH_CGRAPH
114                                 return 0;
115                         #else
116                                 return -1;
117                         #endif
118                 }
119         ])], [
120                 AC_MSG_RESULT([yes])
121                 VALAFLAGS="$VALAFLAGS -D WITH_CGRAPH"
122                 have_cgraph=yes
123         ], [
124                 AC_MSG_RESULT([no])
125                 have_cgraph=no
126         ]
128 LIBADD="$cgraph_tmp_LIBADD"
129 CFLAGS="$cgraph_tmp_CFLAGS"
130 AM_CONDITIONAL(HAVE_CGRAPH, test "$have_cgraph" = "yes")
132 AC_PATH_PROG([XSLTPROC], [xsltproc], :)
133 AM_CONDITIONAL(HAVE_XSLTPROC, test "$XSLTPROC" != :)
135 AC_CHECK_PROG([WEASYPRINT], [weasyprint], [weasyprint])
136 AM_CONDITIONAL(HAVE_WEASYPRINT, [test x$WEASYPRINT = xweasyprint])
138 AC_CHECK_PROG([HELP2MAN], [help2man], [help2man])
139 AM_CONDITIONAL([HAVE_HELP2MAN], [test x$HELP2MAN = xhelp2man])
141 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
143 AC_CONFIG_FILES([Makefile
144            libvala.pc
145            gee/Makefile
146            ccode/Makefile
147            vala/Makefile
148            codegen/Makefile
149            compiler/Makefile
150            vapi/Makefile
151            tests/Makefile
152            doc/Makefile
153            doc/manual/Makefile
154            doc/manual/version.xml
155            gobject-introspection/Makefile
156            vapigen/vapigen.pc
157            vapigen/Makefile
158            vapigen/vala-gen-introspect/Makefile
159            vapigen/vala-gen-introspect/vala-gen-introspect
160            libvaladoc/valadoc.pc
161            libvaladoc/valadoc.deps
162            libvaladoc/Makefile
163            valadoc/Makefile
164            valadoc/doclets/Makefile
165            valadoc/doclets/html/Makefile
166            valadoc/doclets/devhelp/Makefile
167            valadoc/doclets/gtkdoc/Makefile
168            valadoc/icons/Makefile
169            valadoc/tests/Makefile
172 AC_OUTPUT