configure.ac 5.3 KB
Newer Older
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 5
	[vala],
	[https://wiki.gnome.org/Projects/Vala])
Jürg Billeter's avatar
Jürg Billeter committed
6
AC_CONFIG_SRCDIR([Makefile.am])
7
AC_CONFIG_AUX_DIR([build-aux])
Jürg Billeter's avatar
Jürg Billeter committed
8
AC_CONFIG_HEADERS(config.h)
9
AC_CONFIG_MACRO_DIR([m4])
Rico Tzschichholz's avatar
Rico Tzschichholz committed
10
AM_INIT_AUTOMAKE([1.11 dist-xz no-dist-gzip subdir-objects])
11
AM_MAINTAINER_MODE([enable])
Jürg Billeter's avatar
Jürg Billeter committed
12

Rico Tzschichholz's avatar
Rico Tzschichholz committed
13
API_VERSION=0.42
14
PACKAGE_SUFFIX="-$API_VERSION"
15

16 17 18 19 20 21 22
VALA_MAJOR_VERSION=`echo $PACKAGE_VERSION | cut -d. -f1 | sed s/[a-zA-Z\-].*//g`
VALA_MINOR_VERSION=`echo $PACKAGE_VERSION | cut -d. -f2 | sed s/[a-zA-Z\-].*//g`
VALA_MICRO_VERSION=`echo $PACKAGE_VERSION | cut -d. -f3 | sed s/[a-zA-Z\-].*//g`
AC_SUBST(VALA_MAJOR_VERSION)
AC_SUBST(VALA_MINOR_VERSION)
AC_SUBST(VALA_MICRO_VERSION)

23 24 25 26
dnl http://people.gnome.org/~walters/docs/build-api.txt
dnl We don't support separate builddir when building from git
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 30 31 32 33 34
AC_SUBST(PACKAGE_SUFFIX)
AC_DEFINE_UNQUOTED(PACKAGE_SUFFIX, "$PACKAGE_SUFFIX", [Define to the suffix of this package])

program_transform_name="s,\$\$,${PACKAGE_SUFFIX},"

AC_SUBST(pkgdatadir, [${datadir}/vala${PACKAGE_SUFFIX}])
35
AC_SUBST(pkglibdir, [${libdir}/vala${PACKAGE_SUFFIX}])
36

Jürg Billeter's avatar
Jürg Billeter committed
37 38
# Checks for programs.
AC_PROG_CC
39
AM_PROG_CC_C_O
40
AC_PROG_LN_S
41
AC_PROG_INSTALL
42
AC_PROG_MKDIR_P
43

44 45 46 47 48 49 50 51 52 53 54 55 56
AC_CANONICAL_HOST

# Detect the target system
build_linux=no
case "${host_os}" in
    linux*)
        build_linux=yes
        ;;
    *)
        ;;
esac
AM_CONDITIONAL([HAVE_LINUX], [test "$build_linux" = "yes"])

57 58 59
LT_PREREQ([2.2.6])
LT_INIT([disable-static])
PKG_PROG_PKG_CONFIG([0.21])
60 61 62 63 64 65 66 67 68 69

AC_PROG_LEX
if test "$LEX" = :; then
	AC_MSG_ERROR([flex not found but required])
fi

AC_CHECK_PROGS(YACC, 'bison -y' byacc yacc, :)
if test "$YACC" = :; then
	AC_MSG_ERROR([bison not found but required])
fi
Jürg Billeter's avatar
Jürg Billeter committed
70

71 72 73
AC_PATH_PROG(VALAC, valac, valac)
AC_SUBST(VALAC)

74
VALAC_BOOTSTRAP_REQUIRED=0.39.5.8
75 76 77 78 79

AS_IF([test "$VALAC" != valac], [FOUND_VALAC_VERION=`$VALAC --version | sed 's/Vala  *//'`
	AS_VERSION_COMPARE(["$VALAC_BOOTSTRAP_REQUIRED"], ["$FOUND_VALAC_VERION"],
		[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"
83
fi
84

Jaap A. Haitsma's avatar
Jaap A. Haitsma committed
85
AC_SUBST(VALAFLAGS)
Jürg Billeter's avatar
Jürg Billeter committed
86 87 88 89
AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)

90 91 92
AC_ARG_ENABLE(unversioned, AS_HELP_STRING([--disable-unversioned], [Disable unversioned binaries]), enable_unversioned=$enableval, enable_unversioned=yes)
AM_CONDITIONAL(ENABLE_UNVERSIONED, test x$enable_unversioned = xyes)

93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
AC_ARG_ENABLE(coverage, AS_HELP_STRING([--enable-coverage], [Enable coverage analysis]), enable_coverage=$enableval, enable_coverage=no)
AM_CONDITIONAL(ENABLE_COVERAGE, test x$enable_coverage = xyes)

if test "$enable_coverage" = "yes"; then
	COVERAGE_VALAFLAGS="-g"
	COVERAGE_CFLAGS="-fprofile-arcs -ftest-coverage"
	COVERAGE_LIBS="-lgcov"
else
	COVERAGE_VALAFLAGS=
	COVERAGE_CFLAGS=
	COVERAGE_LIBS=
fi
AC_SUBST(COVERAGE_VALAFLAGS)
AC_SUBST(COVERAGE_CFLAGS)
AC_SUBST(COVERAGE_LIBS)

109
GLIB_REQUIRED=2.40.0
Rico Tzschichholz's avatar
Rico Tzschichholz committed
110
LIBGVC_REQUIRED=2.16
Jürg Billeter's avatar
Jürg Billeter committed
111

112
PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GLIB_REQUIRED)
113

Jürg Billeter's avatar
Jürg Billeter committed
114 115 116
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)

117 118 119 120 121
PKG_CHECK_MODULES(GMODULE, gmodule-2.0 >= $GLIB_REQUIRED)

AC_SUBST(GMODULE_CFLAGS)
AC_SUBST(GMODULE_LIBS)

Rico Tzschichholz's avatar
Rico Tzschichholz committed
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
PKG_CHECK_MODULES(LIBGVC, libgvc >= $LIBGVC_REQUIRED)
AC_MSG_CHECKING([for CGRAPH])
cgraph_tmp_LIBADD="$LIBADD"
cgraph_tmp_CFLAGS="$CFLAGS"
LIBADD="$LIBADD $LIBGVC_LIBS"
CFLAGS="$CFLAGS $LIBGVC_CFLAGS"
AC_RUN_IFELSE(
	[AC_LANG_SOURCE([
		#include <gvc.h>

		int main(void) {
			#ifdef WITH_CGRAPH
				return 0;
			#else
				return -1;
			#endif
		}
	])], [
		AC_MSG_RESULT([yes])
		VALAFLAGS="$VALAFLAGS -D WITH_CGRAPH"
		have_cgraph=yes
	], [
		AC_MSG_RESULT([no])
		have_cgraph=no
	]
)
LIBADD="$cgraph_tmp_LIBADD"
CFLAGS="$cgraph_tmp_CFLAGS"
AM_CONDITIONAL(HAVE_CGRAPH, test "$have_cgraph" = "yes")

152 153 154
AC_PATH_PROG([XSLTPROC], [xsltproc], :)
AM_CONDITIONAL(HAVE_XSLTPROC, test "$XSLTPROC" != :)

155 156 157
AC_CHECK_PROG([WEASYPRINT], [weasyprint], [weasyprint])
AM_CONDITIONAL(HAVE_WEASYPRINT, [test x$WEASYPRINT = xweasyprint])

158 159 160
AC_CHECK_PROG([HELP2MAN], [help2man], [help2man])
AM_CONDITIONAL([HAVE_HELP2MAN], [test x$HELP2MAN = xhelp2man])

161 162
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])

Jürg Billeter's avatar
Jürg Billeter committed
163
AC_CONFIG_FILES([Makefile
164
           libvala.pc
165
           gee/Makefile
166 167
           ccode/Makefile
           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
Rico Tzschichholz's avatar
Rico Tzschichholz committed
181 182 183 184 185 186 187 188 189 190 191 192
           vapigen/vala-gen-introspect/vala-gen-introspect
           libvaladoc/valadoc.pc
           libvaladoc/valadoc.deps
           libvaladoc/Makefile
           valadoc/Makefile
           valadoc/doclets/Makefile
           valadoc/doclets/html/Makefile
           valadoc/doclets/devhelp/Makefile
           valadoc/doclets/gtkdoc/Makefile
           valadoc/icons/Makefile
           valadoc/tests/Makefile
])
Jürg Billeter's avatar
Jürg Billeter committed
193 194

AC_OUTPUT