3 AC_INIT([libsecret],[0.18],
4 [http://bugzilla.gnome.org/enter_bug.cgi?product=libsecret],
7 dnl ****************************************************************************
8 dnl Dependency versions
13 GLIB_MIN=GLIB_VERSION_2_38
14 GLIB_MAX=GLIB_VERSION_2_38
28 dnl ****************************************************************************
29 dnl Library package and libtool versioning
31 dnl Updating the libtool versions, follow these instructions sequentially:
32 dnl 1. If the library source code has changed at all since the last update, then increment revision (‘c:r:a’ becomes ‘c:r+1:a’).
33 dnl 2. If any interfaces have been added, removed, or changed since the last update, increment current, and set revision to 0.
34 dnl 3. If any interfaces have been added since the last public release, then increment age.
35 dnl 4. If any interfaces have been removed or changed since the last public release, then set age to 0.
45 # -----------------------------------------------------------------------------
47 AC_CONFIG_MACRO_DIR([build/m4])
48 AC_CONFIG_AUX_DIR([build])
49 AM_INIT_AUTOMAKE([1.11 tar-ustar foreign -Wno-portability])
51 AC_CONFIG_HEADERS(config.h)
52 AC_CONFIG_SRCDIR([libsecret/secret-value.c])
53 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
54 AM_MAINTAINER_MODE([enable])
56 # -----------------------------------------------------------------------------
68 IT_PROG_INTLTOOL($INTLTOOL_REQ)
69 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
71 GETTEXT_PACKAGE=libsecret
72 AC_SUBST([GETTEXT_PACKAGE])
73 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[The gettext domain name])
76 # --------------------------------------------------------------------
77 # Checks for functions
81 # --------------------------------------------------------------------
84 PKG_CHECK_MODULES(GLIB,
88 LIBS="$LIBS $GLIB_LIBS"
89 CFLAGS="$CFLAGS $GLIB_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=$GLIB_MIN -DGLIB_VERSION_MAX_ALLOWED=$GLIB_MAX"
91 GTK_DOC_CHECK($GTKDOC_WANT)
93 GOBJECT_INTROSPECTION_CHECK($GIR_WANT)
94 AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
96 # --------------------------------------------------------------------
99 AC_ARG_ENABLE(manpages,
100 AC_HELP_STRING([--disable-manpages], [Build manual pages]))
101 if test "$enable_manpages" != "no"; then
102 enable_manpages="yes"
103 AC_PATH_PROG([XSLTPROC], [xsltproc])
104 if test x$XSLTPROC = x; then
105 AC_MSG_ERROR([xsltproc is required to build manual pages])
108 AM_CONDITIONAL(WITH_MANPAGES, test x$enable_manpages = xyes)
110 # --------------------------------------------------------------------
113 VAPIGEN_CHECK($VALA_WANT)
115 if test "$enable_vala" != "no"; then
116 AC_PATH_PROG([VALAC], [valac], [])
118 AM_CONDITIONAL(HAVE_VALAC, test "x$VALAC" != "x")
120 # --------------------------------------------------------------------
125 AC_ARG_ENABLE(gcrypt,
126 [AC_HELP_STRING([--disable-gcrypt],
127 [without gcrypt and transport encryption])
130 if test "$enable_gcrypt" != "no"; then
133 m4_ifdef([AM_PATH_LIBGCRYPT],
134 [AM_PATH_LIBGCRYPT($GCRYPT_LIBVER:$GCRYPT_WANT, have_gcrypt=yes)])
136 if test $have_gcrypt != "yes"; then
139 *** libgcrypt was not found. You may want to get it from
140 *** ftp://ftp.gnupg.org/gcrypt/libgcrypt/
145 AC_DEFINE(WITH_GCRYPT, 1, [Build with libgcypt and transport encryption])
146 AC_DEFINE_UNQUOTED(LIBGCRYPT_VERSION, "$GCRYPT_WANT",
147 [Version of GCRYPT we expect])
149 AC_SUBST([LIBGCRYPT_CFLAGS])
150 AC_SUBST([LIBGCRYPT_LIBS])
158 AM_CONDITIONAL(WITH_GCRYPT, test "$enable_gcrypt" = "yes")
160 # --------------------------------------------------------------------
161 # Compilation options
163 if test "$GCC" = "yes"; then
165 -Wall -Wmissing-declarations \
166 -Wmissing-prototypes -Wnested-externs -Wpointer-arith \
167 -Wdeclaration-after-statement -Wformat=2 -Winit-self \
170 for option in -Wmissing-include-dirs -Wundef; do
171 SAVE_CFLAGS="$CFLAGS"
172 CFLAGS="$CFLAGS $option"
173 AC_MSG_CHECKING([whether gcc understands $option])
174 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])],
177 AC_MSG_RESULT($has_option)
178 if test $has_option = no; then
179 CFLAGS="$SAVE_CFLAGS"
184 AC_ARG_ENABLE(strict, [
185 AS_HELP_STRING([--enable-strict], [Strict code compilation])
188 AC_MSG_CHECKING([build strict])
190 if test "$enable_strict" = "yes"; then
191 CFLAGS="$CFLAGS -Werror -DG_DISABLE_DEPRECATED"
192 INTROSPECTION_FLAGS="--warn-error"
195 CFLAGS="$CFLAGS -Wno-error"
197 INTROSPECTION_FLAGS=""
201 AC_MSG_RESULT($enable_strict)
202 AC_SUBST(INTROSPECTION_FLAGS)
205 AC_MSG_CHECKING([for debug mode])
207 AC_HELP_STRING([--enable-debug=no/default/yes],
208 [Turn on or off debugging])
211 if test "$enable_debug" != "no"; then
212 AC_DEFINE_UNQUOTED(WITH_DEBUG, 1, [Print debug output])
213 AC_DEFINE_UNQUOTED(_DEBUG, 1, [In debug mode])
216 if test "$enable_debug" = "yes"; then
219 elif test "$enable_debug" = "no"; then
222 AC_DEFINE_UNQUOTED(G_DISABLE_ASSERT, 1, [Disable glib assertions])
224 debug_status="default"
227 AC_MSG_RESULT($debug_status)
229 AC_MSG_CHECKING([whether to build with gcov testing])
230 AC_ARG_ENABLE([coverage],
231 AS_HELP_STRING([--enable-coverage],
232 [Whether to enable coverage testing ]),
233 [], [enable_coverage=no])
234 AC_MSG_RESULT([$enable_coverage])
236 if test "$enable_coverage" = "yes"; then
237 if test "$GCC" != "yes"; then
238 AC_MSG_ERROR(Coverage testing requires GCC)
241 AC_PATH_PROG(GCOV, gcov, no)
242 if test "$GCOV" = "no" ; then
243 AC_MSG_ERROR(gcov tool is not available)
246 AC_PATH_PROG(LCOV, lcov, no)
247 if test "$LCOV" = "no" ; then
248 AC_MSG_ERROR(lcov tool is not installed)
251 AC_PATH_PROG(GENHTML, genhtml, no)
252 if test "$GENHTML" = "no" ; then
253 AC_MSG_ERROR(lcov's genhtml tool is not installed)
256 CFLAGS="$CFLAGS -O0 -g -fprofile-arcs -ftest-coverage"
257 LDFLAGS="$LDFLAGS -lgcov"
260 AM_CONDITIONAL([WITH_COVERAGE], [test "$enable_coverage" = "yes"])
265 # ------------------------------------------------------------------------------
269 SECRET_LT_RELEASE=$SECRET_CURRENT:$SECRET_REVISION:$SECRET_AGE
270 AC_SUBST(SECRET_LT_RELEASE)
271 AC_SUBST(SECRET_MAJOR)
272 AC_SUBST(SECRET_MINOR)
278 libsecret/libsecret.pc
279 libsecret/libsecret-unstable.pc
284 echo "CFLAGS: $CFLAGS"
287 echo " libgcrypt: $gcrypt_status"
288 echo " vala: $enable_vala"
289 echo " Debug: $debug_status"
290 echo " Coverage: $enable_coverage"
291 echo " Manual Page: $enable_manpages"