Debian Codegraph @

configure.ac

raw ◀ ▶
Source reconstructed at patch state 0 of 2 — not the installed (fully patched) source.
2 Debian patches touch this file
1 AC_PREREQ(2.65)
2
3 # For releases bump this version here,
4 # but also remember to bump the lib version as instructed below
5 # Don't forget to check also GIR_VERSION
6 m4_define([dee_major], [1])
7 m4_define([dee_minor], [2])
8 m4_define([dee_micro], [7])
9 m4_define([dee_api],
10 [dee_major.dee_minor])
11 m4_define([dee_version],
12 [dee_major.dee_minor.dee_micro])
13
14 AC_INIT([dee],[dee_version],[https://bugs.launchpad.net/dee])
15 AC_CONFIG_SRCDIR([src/dee.h])
16 AC_CONFIG_MACRO_DIR([build/autotools])
17
18 AC_CONFIG_HEADERS([config.h])
19
20 AM_INIT_AUTOMAKE([1.9])
21 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
22
23 AM_PATH_PYTHON
24
25 ###############################################
26 ### pygobject overrides directory detection ###
27 ###############################################
28
29 AC_ARG_WITH([pygi_overrides_dir],
30 AC_HELP_STRING([--with-pygi-overrides-dir], [Path to pygobject overrides directory]))
31
32 AC_MSG_CHECKING(for pygobject overrides directory)
33 if test "x$with_pygi_overrides_dir" = "x" ; then
34 overrides_dir="`$PYTHON -c 'import gi; print(gi._overridesdir)' 2>/dev/null`"
35 # fallback if the previous failed
36 if test "x$overrides_dir" = "x" ; then
37 overrides_dir="${pyexecdir}/gi/overrides"
38 fi
39 else
40 overrides_dir="$with_pygi_overrides_dir"
41 fi
42
43 PYGI_OVERRIDES_DIR="$overrides_dir"
44 AC_SUBST(PYGI_OVERRIDES_DIR)
45 AC_MSG_RESULT($PYGI_OVERRIDES_DIR)
46
47 DEE_MAJOR_VERSION=dee_major
48 DEE_MINOR_VERSION=dee_minor
49 DEE_MICRO_VERSION=dee_micro
50 DEE_VERSION=dee_version
51 AC_SUBST(DEE_MAJOR_VERSION)
52 AC_SUBST(DEE_MINOR_VERSION)
53 AC_SUBST(DEE_MICRO_VERSION)
54 AC_SUBST(DEE_VERSION)
55
56 m4_define([gir_version],
57 [dee_major.0])
58 GIR_VERSION=gir_version
59 AC_SUBST(GIR_VERSION)
60
61 # Before making a release, the DEE_LT_VERSION string should be updated.
62 # The string is of the form C:R:A.
63 # - If interfaces have been changed or added, but binary compatibility has
64 # been preserved, change to C+1:0:A+1
65 # - If binary compatibility has been broken (eg removed or changed interfaces)
66 # change to C+1:0:0
67 # - If the interface is the same as the previous version, change to C:R+1:A
68 DEE_LT_CURRENT=6
69 DEE_LT_REV=1
70 DEE_LT_AGE=2
71 DEE_LT_VERSION="$DEE_LT_CURRENT:$DEE_LT_REV:$DEE_LT_AGE"
72 DEE_LT_LDFLAGS="-version-info $DEE_LT_VERSION -export-symbols-regex '^dee_.*'"
73
74 AC_SUBST(DEE_LT_VERSION)
75 AC_SUBST(DEE_LT_LDFLAGS)
76
77 dnl ===========================================================================
78
79 # Checks for programs
80 AC_PROG_CC
81 AM_PROG_CC_C_O
82 AC_DISABLE_STATIC
83 LT_INIT
84
85 # Checks for header files
86 AC_HEADER_STDC
87 AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h])
88
89 # Checks for typedefs, structures and compiler charecteristics
90 AC_C_CONST
91
92 # Checks for library functions
93 AC_FUNC_MALLOC
94 AC_FUNC_MMAP
95 AC_CHECK_FUNCS([memset munmap strcasecmp strdup])
96
97 PKG_CHECK_MODULES(DEE,
98 glib-2.0 >= 2.32
99 gthread-2.0 >= 2.32
100 gobject-2.0 >= 2.32
101 gio-2.0 >= 2.32
102 gio-unix-2.0 >= 2.32
103 )
104 AC_SUBST(DEE_CFLAGS)
105 AC_SUBST(DEE_LIBS)
106
107 dnl ===========================================================================
108
109 if test "x$GCC" = "xyes"; then
110 GCC_FLAGS="-g -Wall"
111 fi
112 AC_SUBST(GCC_FLAGS)
113
114 dnl = use strict compiler flags only on development releases ==================
115 m4_define([maintainer_flags_default], [m4_if(m4_eval(dee_micro % 2), [1], [yes], [no])])
116 AC_ARG_ENABLE([maintainer-flags],
117 [AS_HELP_STRING([--enable-maintainer-flags=@<:@no/yes@:>@],[Use strict compiler flags @<:@default=no@:>@])],
118 [],
119 [enable_maintainer_flags=maintainer_flags_default])
120
121 MAINTAINER_CFLAGS=""
122 AS_IF([test "x$enable_maintainer_flags" = "xyes" && test "x$GCC" = "xyes"],
123 [
124 MAINTAINER_CFLAGS="-Werror -Wall -Wcast-align -Wno-uninitialized -Wempty-body -Wformat-security -Winit-self -Wno-error=deprecated-declarations"
125 ]
126 )
127
128 AC_SUBST(MAINTAINER_CFLAGS)
129
130 dnl = GObject Introspection Check =============================================
131 GOBJECT_INTROSPECTION_CHECK([0.10.2])
132
133 dnl = GTK Doc Check ===========================================================
134 GTK_DOC_CHECK([1.8])
135
136 dnl = Check if build tests ====================================================
137 AC_ARG_ENABLE([tests],
138 AS_HELP_STRING([--enable-tests=@<:@no/yes@:>@],[build tests suite @<:@default=yes@:>@]),,
139 [enable_tests=yes])
140
141 AM_CONDITIONAL([WANT_TESTS], [test "x$enable_tests" != "xno"])
142
143 ###########################
144 # gcov coverage reporting
145 ###########################
146 AC_TDD_GCOV
147 AM_CONDITIONAL([HAVE_GCOV], [test "x$ac_cv_check_gcov" = xyes])
148 AM_CONDITIONAL([HAVE_LCOV], [test "x$ac_cv_check_lcov" = xyes])
149 AM_CONDITIONAL([HAVE_GCOVR], [test "x$ac_cv_check_gcovr" = xyes])
150 AC_SUBST(COVERAGE_CFLAGS)
151 AC_SUBST(COVERAGE_LDFLAGS)
152
153 dnl = Check for GLib Test Extensions (GTX) ====================================
154 AC_ARG_ENABLE([extended-tests],
155 AS_HELP_STRING([--enable-extended-tests=@<:@no/yes@:>@],[build extended test suite (requires libgtx from lp:gtx) @<:@default=no@:>@]),,
156 [enable_extended_tests=no])
157
158 if test "x$enable_extended_tests" = "xyes"; then
159 AM_COND_IF([WANT_TESTS],,[
160 AC_MSG_ERROR([extended tests require tests support, please --enable-tests])
161 ])
162 AC_DEFINE(HAVE_GTX, 1, [Define to 1 if we have GLib Test Extensions (libgtx from lp:gtx)])
163
164 PKG_CHECK_MODULES(GTX, [ gtx >= 0.2.2 ])
165 AC_SUBST(GTX_CFLAGS)
166 AC_SUBST(GTX_LIBS)
167 fi
168
169 AM_CONDITIONAL(HAVE_GTX, test "$enable_extended_tests" = "yes")
170
171 dnl = Check if we should compile with trace logging ===========================
172 AC_ARG_ENABLE([trace-log],
173 AS_HELP_STRING([--enable-trace-log=@<:@no/yes@:>@],[build with very verbose logging @<:@default=no@:>@]),,
174 [enable_trace_log=no])
175
176 if test "x$enable_trace_log" = "xyes"; then
177 AC_DEFINE(ENABLE_TRACE_LOG, 1, [build with vert verbose logging])
178 fi
179
180 AM_CONDITIONAL(ENABLE_TRACE_LOG, test "$enable_trace_log" = "yes")
181
182 dnl ===========================================================================
183
184 AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
185 AC_SUBST(GLIB_MKENUMS)
186
187 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
188 AC_SUBST(GLIB_GENMARSHAL)
189
190 dnl ===========================================================================
191
192 AC_PATH_PROG([VALA_API_GEN], [vapigen])
193 AM_CONDITIONAL([HAVE_VAPIGEN], [test "x$VALA_API_GEN" != "x"])
194
195 dnl = Check for ICU ====================================
196 AC_ARG_ENABLE([icu],
197 AS_HELP_STRING([--enable-icu=@<:@no/yes@:>@],[build with advanced unicode text handling (requires ICU >= 4.6) @<:@default=yes@:>@]),,
198 [enable_icu=yes])
199
200 if test "x$enable_icu" = "xyes"; then
201 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
202 #include "unicode/uvernum.h"
203 #if U_ICU_VERSION_MAJOR_NUM < 4
204 #error Dee ICU requires at least ICU v4.6
205 #elif U_ICU_VERSION_MAJOR_NUM == 4 && U_ICU_VERSION_MINOR_NUM < 6
206 #error Dee ICU requires at least ICU v4.6
207 #endif]], [[]])],
208 [icu_available=yes],
209 [icu_available=no])
210
211 if test "x$icu_available" = "xyes"; then
212 AC_DEFINE(HAVE_ICU, 1, [Define to 1 if we have ICU])
213 ICU_CFLAGS="$(icu-config --cflags)"
214 ICU_LIBS="$(icu-config --ldflags-libsonly)"
215 AC_SUBST(ICU_CFLAGS)
216 AC_SUBST(ICU_LIBS)
217 AC_OUTPUT([dee-icu-1.0.pc])
218 else
219 AC_MSG_ERROR([Dee ICU support requires ICU >= 4.6])
220 fi
221 fi
222
223 AM_CONDITIONAL(HAVE_ICU, test "x$enable_icu" = "xyes")
224
225 dnl ===========================================================================
226 AC_OUTPUT([
227 Makefile
228 build/Makefile
229 build/autotools/Makefile
230 src/Makefile
231 bindings/Makefile
232 bindings/python/Makefile
233 doc/Makefile
234 doc/reference/Makefile
235 doc/reference/dee-1.0/Makefile
236 dee-1.0.pc
237 tests/Makefile
238 tools/Makefile
239 examples/Makefile
240 vapi/Makefile
241 ])
242
243 dnl Output the results
244 AC_MSG_NOTICE([
245
246 dee $VERSION
247 ----------------
248
249 Prefix : ${prefix}
250
251 ICU support : ${enable_icu}
252
253 Documentation : ${enable_gtk_doc}
254 Introspection : ${enable_introspection}
255 PyGi Overrides : ${overrides_dir}
256
257 Tests : ${enable_tests}
258 Extended Tests : ${enable_extended_tests}
259 Coverage : ${use_gcov}
260 Verbose logging: ${enable_trace_log}
261
262 Extra CFlags : ${CPPFLAGS} $MAINTAINER_CFLAGS
263 Extra ValaFlags: ${CPPFLAGS} $MAINTAINER_VALAFLAGS
264 ])