1dnl Process this file with autoconf to produce a configure script.
2
3AC_PREREQ(2.64)
4
5# Package version of the form 'major.minor.micro'.
6m4_define(amtk_package_version, 5.2.0)
7
8AC_INIT([Amtk],
9	[amtk_package_version],
10	[https://gitlab.gnome.org/GNOME/amtk/issues],
11	[amtk],
12	[https://wiki.gnome.org/Projects/Amtk])
13
14AX_REQUIRE_DEFINED([AX_IS_RELEASE])
15AX_IS_RELEASE([git-directory])
16
17# Libtool versioning
18#
19# For development releases (if the minor package version is odd), keep the same
20# Libtool version.
21#
22# For a new minor stable release (when incrementing the minor package version
23# to an even number), apply the following algorithm step by step:
24# 1. If the library source code has changed at all since the last
25#    update, then increment REVISION.
26# 2. If any exported functions or data have been added, removed, or
27#    changed since the last update, increment CURRENT and set REVISION
28#    to 0.
29# 3. If any exported functions or data have been added since the last
30#    public release, increment AGE.
31# 4. If any exported functions or data have been removed since the last
32#    public release, set AGE to 0.
33#
34# When incrementing the API version (usually for a new major package version),
35# set CURRENT, REVISION and AGE to 0 since it's like a new library.
36AMTK_LT_CURRENT=0
37AMTK_LT_REVISION=0
38AMTK_LT_AGE=0
39AMTK_LT_VERSION="$AMTK_LT_CURRENT:$AMTK_LT_REVISION:$AMTK_LT_AGE"
40AC_SUBST([AMTK_LT_VERSION])
41
42# API version, used for parallel installability.
43# Not used in:
44# - po/Makevars
45# - the docs/reference/amtk-5.0-sections.txt filename
46# Because as far as I've tested, it is not easily feasible to not hardcode the
47# API version in those places (swilmet).
48AMTK_API_VERSION=5
49AC_SUBST([AMTK_API_VERSION])
50
51# Dependencies
52glib_req=2.56
53gtk_req=3.22
54
55AC_CONFIG_SRCDIR([amtk/amtk.h])
56AC_CONFIG_HEADER([config.h])
57AC_CONFIG_MACRO_DIR([m4])
58
59# gnu strictness to generate the INSTALL file
60AM_INIT_AUTOMAKE([1.14 tar-ustar dist-xz no-dist-gzip gnu -Wno-portability])
61
62m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
63
64# Check for programs
65AC_PROG_CC
66AC_PROG_INSTALL
67
68AX_REQUIRE_DEFINED([PKG_PROG_PKG_CONFIG])
69AX_REQUIRE_DEFINED([PKG_INSTALLDIR])
70PKG_PROG_PKG_CONFIG
71PKG_INSTALLDIR
72
73AC_PATH_PROG([GLIB_MKENUMS], [glib-mkenums])
74
75# Initialize libtool
76LT_PREREQ([2.2.6])
77LT_INIT([disable-static])
78
79# Compile warnings. There can be deprecation warnings at any time, so disable
80# -Werror by default with the [yes] argument.
81AX_REQUIRE_DEFINED([AX_COMPILER_FLAGS])
82AX_COMPILER_FLAGS([WARN_CFLAGS], [WARN_LDFLAGS], [yes])
83
84# Dynamic linking dependencies
85AX_REQUIRE_DEFINED([AX_PKG_CHECK_MODULES])
86AX_PKG_CHECK_MODULES([AMTK_DEP],
87		     [glib-2.0 >= $glib_req  gtk+-3.0 >= $gtk_req],
88		     [])
89
90# i18n
91AM_GNU_GETTEXT([external])
92# FIXME: Remove AM_GNU_GETTEXT_VERSION once autoreconf supports AM_GNU_GETTEXT_REQUIRE_VERSION.
93AM_GNU_GETTEXT_VERSION([0.19.6])
94AM_GNU_GETTEXT_REQUIRE_VERSION([0.19.6])
95AC_SUBST([GETTEXT_PACKAGE], [amtk-$AMTK_API_VERSION])
96AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [Define to the gettext package name.])
97
98# Documentation
99AX_REQUIRE_DEFINED([GTK_DOC_CHECK])
100GTK_DOC_CHECK([1.25], [--flavour=no-tmpl])
101
102# Installed Tests for gnome continuous integration
103AC_ARG_ENABLE(installed_tests,
104	      AS_HELP_STRING([--enable-installed-tests],
105			     [Install test programs (default: no)]),,
106	      [enable_installed_tests=no])
107
108AM_CONDITIONAL(INSTALLED_TESTS, test "x$enable_installed_tests" = "xyes")
109
110# Introspection
111AX_REQUIRE_DEFINED([GOBJECT_INTROSPECTION_CHECK])
112GOBJECT_INTROSPECTION_CHECK([1.42.0])
113
114# Code coverage for unit tests
115AX_REQUIRE_DEFINED([AX_CODE_COVERAGE])
116AX_CODE_COVERAGE
117
118# Valgrind check
119AX_REQUIRE_DEFINED([AX_VALGRIND_CHECK])
120AX_VALGRIND_CHECK
121
122AX_REQUIRE_DEFINED([PKG_CHECK_VAR])
123PKG_CHECK_VAR([GLIB_PREFIX], [glib-2.0], [prefix])
124
125# Output files
126AC_CONFIG_FILES([
127	amtk-${AMTK_API_VERSION}.pc:amtk.pc.in
128	Makefile
129	amtk/Makefile
130	docs/Makefile
131	docs/reference/amtk-docs.xml
132	docs/reference/amtk-intro.xml
133	docs/reference/Makefile
134	po/Makefile.in
135	tests/Makefile
136	testsuite/Makefile
137	win32/config.h.win32
138	win32/config-msvc.mak
139	win32/Makefile
140])
141
142AC_OUTPUT
143
144echo "
145Configuration:
146
147	${PACKAGE_NAME} version ${PACKAGE_VERSION}
148
149	Source code location:	${srcdir}
150	Prefix:			${prefix}
151	Compiler:		${CC}
152	Documentation:		${enable_gtk_doc}
153	GObject introspection:	${found_introspection}
154	Code coverage:		${enable_code_coverage}
155	Valgrind check:		${enable_valgrind}
156	Installed tests:	${enable_installed_tests}
157"
158