2 AC_INIT([vala], m4_esyscmd([build-aux/git-version-gen .tarball-version]),
3 [https://gitlab.gnome.org/GNOME/vala/issues],
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])
14 PACKAGE_SUFFIX="-$API_VERSION"
16 VALA_MAJOR_VERSION=`echo $PACKAGE_VERSION | cut -d. -f1 | sed s/[[a-zA-Z\-]].*//g`
17 VALA_MINOR_VERSION=`echo $PACKAGE_VERSION | cut -d. -f2 | sed s/[[a-zA-Z\-]].*//g`
18 VALA_MICRO_VERSION=`echo $PACKAGE_VERSION | cut -d. -f3 | sed s/[[a-zA-Z\-]].*//g`
19 AC_SUBST(VALA_MAJOR_VERSION)
20 AC_SUBST(VALA_MINOR_VERSION)
21 AC_SUBST(VALA_MICRO_VERSION)
23 dnl http://people.gnome.org/~walters/docs/build-api.txt
24 dnl We don't support separate builddir when building from git
25 echo \#buildapi-variable-no-builddir >/dev/null
28 AC_DEFINE_UNQUOTED(API_VERSION, "$API_VERSION", [Define to the api-version of this package])
29 AC_SUBST(PACKAGE_SUFFIX)
30 AC_DEFINE_UNQUOTED(PACKAGE_SUFFIX, "$PACKAGE_SUFFIX", [Define to the suffix of this package])
32 program_transform_name="s,\$\$,${PACKAGE_SUFFIX},"
34 AC_SUBST(pkgdatadir, [${datadir}/vala${PACKAGE_SUFFIX}])
35 AC_SUBST(pkglibdir, [${libdir}/vala${PACKAGE_SUFFIX}])
37 # Checks for programs.
46 # Detect the target system
55 AM_CONDITIONAL([HAVE_LINUX], [test "$build_linux" = "yes"])
58 LT_INIT([disable-static])
59 PKG_PROG_PKG_CONFIG([0.21])
62 if test "$LEX" = :; then
63 AC_MSG_ERROR([flex not found but required])
66 AC_CHECK_PROGS(YACC, 'bison -y' byacc yacc, :)
67 if test "$YACC" = :; then
68 AC_MSG_ERROR([bison not found but required])
71 AC_PATH_PROG(VALAC, valac, valac)
74 VALAC_BOOTSTRAP_REQUIRED=0.39.5.8
76 AS_IF([test "$VALAC" != valac], [FOUND_VALAC_VERION=`$VALAC --version | sed 's/Vala *//'`
77 AS_VERSION_COMPARE(["$VALAC_BOOTSTRAP_REQUIRED"], ["$FOUND_VALAC_VERION"],
78 [enable_boostrap=yes], [enable_boostrap=yes], [enable_boostrap=no])])
80 VALAFLAGS="$VALAFLAGS --disable-version-header"
81 if test x$enable_boostrap = xyes; then
82 VALAFLAGS="$VALAFLAGS --hide-internal --abi-stability"
90 AC_ARG_ENABLE(unversioned, AS_HELP_STRING([--disable-unversioned], [Disable unversioned binaries]), enable_unversioned=$enableval, enable_unversioned=yes)
91 AM_CONDITIONAL(ENABLE_UNVERSIONED, test x$enable_unversioned = xyes)
93 AC_ARG_ENABLE(coverage, AS_HELP_STRING([--enable-coverage], [Enable coverage analysis]), enable_coverage=$enableval, enable_coverage=no)
94 AM_CONDITIONAL(ENABLE_COVERAGE, test x$enable_coverage = xyes)
96 if test "$enable_coverage" = "yes"; then
97 COVERAGE_VALAFLAGS="-g"
98 COVERAGE_CFLAGS="-fprofile-arcs -ftest-coverage"
99 COVERAGE_LIBS="-lgcov"
105 AC_SUBST(COVERAGE_VALAFLAGS)
106 AC_SUBST(COVERAGE_CFLAGS)
107 AC_SUBST(COVERAGE_LIBS)
112 PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GLIB_REQUIRED)
114 AC_SUBST(GLIB_CFLAGS)
117 PKG_CHECK_MODULES(GMODULE, gmodule-2.0 >= $GLIB_REQUIRED)
119 AC_SUBST(GMODULE_CFLAGS)
120 AC_SUBST(GMODULE_LIBS)
122 PKG_CHECK_MODULES(LIBGVC, libgvc >= $LIBGVC_REQUIRED)
123 AC_MSG_CHECKING([for CGRAPH])
124 cgraph_tmp_LIBADD="$LIBADD"
125 cgraph_tmp_CFLAGS="$CFLAGS"
126 LIBADD="$LIBADD $LIBGVC_LIBS"
127 CFLAGS="$CFLAGS $LIBGVC_CFLAGS"
141 VALAFLAGS="$VALAFLAGS -D WITH_CGRAPH"
148 LIBADD="$cgraph_tmp_LIBADD"
149 CFLAGS="$cgraph_tmp_CFLAGS"
150 AM_CONDITIONAL(HAVE_CGRAPH, test "$have_cgraph" = "yes")
152 AC_PATH_PROG([XSLTPROC], [xsltproc], :)
153 AM_CONDITIONAL(HAVE_XSLTPROC, test "$XSLTPROC" != :)
155 AC_CHECK_PROG([WEASYPRINT], [weasyprint], [weasyprint])
156 AM_CONDITIONAL(HAVE_WEASYPRINT, [test x$WEASYPRINT = xweasyprint])
158 AC_CHECK_PROG([HELP2MAN], [help2man], [help2man])
159 AM_CONDITIONAL([HAVE_HELP2MAN], [test x$HELP2MAN = xhelp2man])
161 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
163 AC_CONFIG_FILES([Makefile
172 tests/girwriter/Makefile
173 tests/gtktemplate/Makefile
176 doc/manual/version.xml
177 gobject-introspection/Makefile
180 vapigen/vala-gen-introspect/Makefile
181 vapigen/vala-gen-introspect/vala-gen-introspect
182 libvaladoc/valadoc.pc
183 libvaladoc/valadoc.deps
186 valadoc/doclets/Makefile
187 valadoc/doclets/html/Makefile
188 valadoc/doclets/devhelp/Makefile
189 valadoc/doclets/gtkdoc/Makefile
190 valadoc/icons/Makefile
191 valadoc/tests/Makefile