Revert "codegen: Don't emit g_type_add_instance_private() in *_register_type()"
[vala-gnome.git] / configure.ac
blob24b3bcd79991d7c30b291af790f11dcf61bd5afc
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 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 AC_CANONICAL_HOST
39 # Detect the target system
40 build_linux=no
41 case "${host_os}" in
42     linux*)
43         build_linux=yes
44         ;;
45     *)
46         ;;
47 esac
48 AM_CONDITIONAL([HAVE_LINUX], [test "$build_linux" = "yes"])
50 LT_PREREQ([2.2.6])
51 LT_INIT([disable-static])
52 PKG_PROG_PKG_CONFIG([0.21])
54 AC_PROG_LEX
55 if test "$LEX" = :; then
56         AC_MSG_ERROR([flex not found but required])
59 AC_CHECK_PROGS(YACC, 'bison -y' byacc yacc, :)
60 if test "$YACC" = :; then
61         AC_MSG_ERROR([bison not found but required])
64 AC_PATH_PROG(VALAC, valac, valac)
65 AC_SUBST(VALAC)
67 VALAC_BOOTSTRAP_REQUIRED=0.39.5.8
69 AS_IF([test "$VALAC" != valac], [FOUND_VALAC_VERION=`$VALAC --version | sed 's/Vala  *//'`
70         AS_VERSION_COMPARE(["$VALAC_BOOTSTRAP_REQUIRED"], ["$FOUND_VALAC_VERION"],
71                 [enable_boostrap=yes], [enable_boostrap=yes], [enable_boostrap=no])])
73 VALAFLAGS="$VALAFLAGS --disable-version-header"
74 if test x$enable_boostrap = xyes; then
75         VALAFLAGS="$VALAFLAGS --hide-internal --abi-stability"
78 AC_SUBST(VALAFLAGS)
79 AC_SUBST(CFLAGS)
80 AC_SUBST(CPPFLAGS)
81 AC_SUBST(LDFLAGS)
83 AC_ARG_ENABLE(unversioned, AS_HELP_STRING([--disable-unversioned], [Disable unversioned binaries]), enable_unversioned=$enableval, enable_unversioned=yes)
84 AM_CONDITIONAL(ENABLE_UNVERSIONED, test x$enable_unversioned = xyes)
86 AC_ARG_ENABLE(coverage, AS_HELP_STRING([--enable-coverage], [Enable coverage analysis]), enable_coverage=$enableval, enable_coverage=no)
87 AM_CONDITIONAL(ENABLE_COVERAGE, test x$enable_coverage = xyes)
89 if test "$enable_coverage" = "yes"; then
90         COVERAGE_VALAFLAGS="-g"
91         COVERAGE_CFLAGS="-fprofile-arcs -ftest-coverage"
92         COVERAGE_LIBS="-lgcov"
93 else
94         COVERAGE_VALAFLAGS=
95         COVERAGE_CFLAGS=
96         COVERAGE_LIBS=
98 AC_SUBST(COVERAGE_VALAFLAGS)
99 AC_SUBST(COVERAGE_CFLAGS)
100 AC_SUBST(COVERAGE_LIBS)
102 GLIB_REQUIRED=2.40.0
103 LIBGVC_REQUIRED=2.16
105 PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GLIB_REQUIRED)
107 AC_SUBST(GLIB_CFLAGS)
108 AC_SUBST(GLIB_LIBS)
110 PKG_CHECK_MODULES(GMODULE, gmodule-2.0 >= $GLIB_REQUIRED)
112 AC_SUBST(GMODULE_CFLAGS)
113 AC_SUBST(GMODULE_LIBS)
115 PKG_CHECK_MODULES(LIBGVC, libgvc >= $LIBGVC_REQUIRED)
116 AC_MSG_CHECKING([for CGRAPH])
117 cgraph_tmp_LIBADD="$LIBADD"
118 cgraph_tmp_CFLAGS="$CFLAGS"
119 LIBADD="$LIBADD $LIBGVC_LIBS"
120 CFLAGS="$CFLAGS $LIBGVC_CFLAGS"
121 AC_RUN_IFELSE(
122         [AC_LANG_SOURCE([
123                 #include <gvc.h>
125                 int main(void) {
126                         #ifdef WITH_CGRAPH
127                                 return 0;
128                         #else
129                                 return -1;
130                         #endif
131                 }
132         ])], [
133                 AC_MSG_RESULT([yes])
134                 VALAFLAGS="$VALAFLAGS -D WITH_CGRAPH"
135                 have_cgraph=yes
136         ], [
137                 AC_MSG_RESULT([no])
138                 have_cgraph=no
139         ]
141 LIBADD="$cgraph_tmp_LIBADD"
142 CFLAGS="$cgraph_tmp_CFLAGS"
143 AM_CONDITIONAL(HAVE_CGRAPH, test "$have_cgraph" = "yes")
145 AC_PATH_PROG([XSLTPROC], [xsltproc], :)
146 AM_CONDITIONAL(HAVE_XSLTPROC, test "$XSLTPROC" != :)
148 AC_CHECK_PROG([WEASYPRINT], [weasyprint], [weasyprint])
149 AM_CONDITIONAL(HAVE_WEASYPRINT, [test x$WEASYPRINT = xweasyprint])
151 AC_CHECK_PROG([HELP2MAN], [help2man], [help2man])
152 AM_CONDITIONAL([HAVE_HELP2MAN], [test x$HELP2MAN = xhelp2man])
154 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
156 AC_CONFIG_FILES([Makefile
157            libvala.pc
158            gee/Makefile
159            ccode/Makefile
160            vala/Makefile
161            codegen/Makefile
162            compiler/Makefile
163            vapi/Makefile
164            tests/Makefile
165            doc/Makefile
166            doc/manual/Makefile
167            doc/manual/version.xml
168            gobject-introspection/Makefile
169            vapigen/vapigen.pc
170            vapigen/Makefile
171            vapigen/vala-gen-introspect/Makefile
172            vapigen/vala-gen-introspect/vala-gen-introspect
173            libvaladoc/valadoc.pc
174            libvaladoc/valadoc.deps
175            libvaladoc/Makefile
176            valadoc/Makefile
177            valadoc/doclets/Makefile
178            valadoc/doclets/html/Makefile
179            valadoc/doclets/devhelp/Makefile
180            valadoc/doclets/gtkdoc/Makefile
181            valadoc/icons/Makefile
182            valadoc/tests/Makefile
185 AC_OUTPUT