Release 0.41.92
[vala-gnome.git] / configure.ac
blob730c72d7b96f327ca905578b7aaca72d7f178739
1 AC_PREREQ([2.65])
2 AC_INIT([vala], m4_esyscmd([build-aux/git-version-gen .tarball-version]),
3         [https://gitlab.gnome.org/GNOME/vala/issues],
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.42
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
27 AC_SUBST(API_VERSION)
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.
38 AC_PROG_CC
39 AM_PROG_CC_C_O
40 AC_PROG_LN_S
41 AC_PROG_INSTALL
42 AC_PROG_MKDIR_P
44 AC_CANONICAL_HOST
46 # Detect the target system
47 build_linux=no
48 case "${host_os}" in
49     linux*)
50         build_linux=yes
51         ;;
52     *)
53         ;;
54 esac
55 AM_CONDITIONAL([HAVE_LINUX], [test "$build_linux" = "yes"])
57 LT_PREREQ([2.2.6])
58 LT_INIT([disable-static])
59 PKG_PROG_PKG_CONFIG([0.21])
61 AC_PROG_LEX
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)
72 AC_SUBST(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"
85 AC_SUBST(VALAFLAGS)
86 AC_SUBST(CFLAGS)
87 AC_SUBST(CPPFLAGS)
88 AC_SUBST(LDFLAGS)
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"
100 else
101         COVERAGE_VALAFLAGS=
102         COVERAGE_CFLAGS=
103         COVERAGE_LIBS=
105 AC_SUBST(COVERAGE_VALAFLAGS)
106 AC_SUBST(COVERAGE_CFLAGS)
107 AC_SUBST(COVERAGE_LIBS)
109 GLIB_REQUIRED=2.40.0
110 LIBGVC_REQUIRED=2.16
112 PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GLIB_REQUIRED)
114 AC_SUBST(GLIB_CFLAGS)
115 AC_SUBST(GLIB_LIBS)
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"
128 AC_RUN_IFELSE(
129         [AC_LANG_SOURCE([
130                 #include <gvc.h>
132                 int main(void) {
133                         #ifdef WITH_CGRAPH
134                                 return 0;
135                         #else
136                                 return -1;
137                         #endif
138                 }
139         ])], [
140                 AC_MSG_RESULT([yes])
141                 VALAFLAGS="$VALAFLAGS -D WITH_CGRAPH"
142                 have_cgraph=yes
143         ], [
144                 AC_MSG_RESULT([no])
145                 have_cgraph=no
146         ]
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
164            libvala.pc
165            gee/Makefile
166            ccode/Makefile
167            vala/Makefile
168            codegen/Makefile
169            compiler/Makefile
170            vapi/Makefile
171            tests/Makefile
172            tests/girwriter/Makefile
173            tests/gtktemplate/Makefile
174            doc/Makefile
175            doc/manual/Makefile
176            doc/manual/version.xml
177            gobject-introspection/Makefile
178            vapigen/vapigen.pc
179            vapigen/Makefile
180            vapigen/vala-gen-introspect/Makefile
181            vapigen/vala-gen-introspect/vala-gen-introspect
182            libvaladoc/valadoc.pc
183            libvaladoc/valadoc.deps
184            libvaladoc/Makefile
185            valadoc/Makefile
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
194 AC_OUTPUT