3 AC_INIT([libsecret],[0.5],
4 [http://bugzilla.gnome.org/enter_bug.cgi?product=libsecret],
7 dnl ****************************************************************************
8 dnl Library package and libtool versioning
10 dnl Updating the libtool versions, follow these instructions sequentially:
11 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’).
12 dnl 2. If any interfaces have been added, removed, or changed since the last update, increment current, and set revision to 0.
13 dnl 3. If any interfaces have been added since the last public release, then increment age.
14 dnl 4. If any interfaces have been removed or changed since the last public release, then set age to 0.
24 # -----------------------------------------------------------------------------
26 AC_CONFIG_MACRO_DIR([build/m4])
27 AM_INIT_AUTOMAKE([1.11 tar-ustar foreign -Wno-portability])
29 AM_CONFIG_HEADER(config.h)
30 AC_CONFIG_SRCDIR([libsecret/secret-value.c])
31 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
32 AM_MAINTAINER_MODE([enable])
34 # -----------------------------------------------------------------------------
46 IT_PROG_INTLTOOL([0.35.0])
47 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
49 GETTEXT_PACKAGE=libsecret
50 AC_SUBST([GETTEXT_PACKAGE])
51 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[The gettext domain name])
54 # --------------------------------------------------------------------
55 # Checks for functions
59 # --------------------------------------------------------------------
62 PKG_CHECK_MODULES(GLIB,
66 LIBS="$LIBS $GLIB_LIBS"
67 CFLAGS="$CFLAGS $GLIB_CFLAGS"
71 GOBJECT_INTROSPECTION_CHECK([1.29])
72 AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
74 # --------------------------------------------------------------------
77 VALA_REQUIRED=0.17.2.12
79 VAPIGEN_CHECK($VALA_REQUIRED)
81 if test "$enable_vala" != "no"; then
82 AC_PATH_PROG([VALAC], [valac], [])
84 AM_CONDITIONAL(HAVE_VALAC, test "x$VALAC" != "x")
86 # --------------------------------------------------------------------
93 [AC_HELP_STRING([--disable-gcrypt],
94 [without gcrypt and transport encryption])
97 if test "$enable_gcrypt" != "no"; then
98 AM_PATH_LIBGCRYPT($GCRYPT_LIBVER:$GCRYPT_VERSION,,
101 *** libgcrypt was not found. You may want to get it from
102 *** ftp://ftp.gnupg.org/gcrypt/libgcrypt/
106 AC_DEFINE(WITH_GCRYPT, 1, [Build with libgcypt and transport encryption])
107 AC_DEFINE_UNQUOTED(LIBGCRYPT_VERSION, "$GCRYPT_VERSION",
108 [Version of GCRYPT we expect])
110 AC_SUBST([LIBGCRYPT_CFLAGS])
111 AC_SUBST([LIBGCRYPT_LIBS])
113 gcrypt_status=$GCRYPT_VERSION
119 AM_CONDITIONAL(WITH_GCRYPT, test "$enable_gcrypt" = "yes")
121 # --------------------------------------------------------------------
122 # Compilation options
124 if test "$GCC" = "yes"; then
126 -Wall -Wmissing-declarations \
127 -Wmissing-prototypes -Wnested-externs -Wpointer-arith \
128 -Wdeclaration-after-statement -Wformat=2 -Winit-self \
129 -Waggregate-return -Wmissing-format-attribute"
131 for option in -Wmissing-include-dirs -Wundef; do
132 SAVE_CFLAGS="$CFLAGS"
133 CFLAGS="$CFLAGS $option"
134 AC_MSG_CHECKING([whether gcc understands $option])
135 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])],
138 AC_MSG_RESULT($has_option)
139 if test $has_option = no; then
140 CFLAGS="$SAVE_CFLAGS"
145 AC_ARG_ENABLE(strict, [
146 AS_HELP_STRING([--enable-strict], [Strict code compilation])
149 AC_MSG_CHECKING([build strict])
151 if test "$enable_strict" = "yes"; then
152 CFLAGS="$CFLAGS -Werror \
153 -DGTK_DISABLE_DEPRECATED \
154 -DGDK_DISABLE_DEPRECATED \
155 -DG_DISABLE_DEPRECATED \
156 -DGDK_PIXBUF_DISABLE_DEPRECATED"
157 INTROSPECTION_FLAGS="--warn-error"
160 CFLAGS="$CFLAGS -Wno-error"
162 INTROSPECTION_FLAGS=""
166 AC_MSG_RESULT($enable_strict)
167 AC_SUBST(INTROSPECTION_FLAGS)
170 AC_MSG_CHECKING([for debug mode])
172 AC_HELP_STRING([--enable-debug=no/default/yes],
173 [Turn on or off debugging])
176 if test "$enable_debug" != "no"; then
177 AC_DEFINE_UNQUOTED(WITH_DEBUG, 1, [Print debug output])
178 AC_DEFINE_UNQUOTED(_DEBUG, 1, [In debug mode])
181 if test "$enable_debug" = "yes"; then
184 elif test "$enable_debug" = "no"; then
187 AC_DEFINE_UNQUOTED(G_DISABLE_ASSERT, 1, [Disable glib assertions])
189 debug_status="default"
192 AC_MSG_RESULT($debug_status)
194 AC_MSG_CHECKING([whether to build with gcov testing])
195 AC_ARG_ENABLE([coverage],
196 AS_HELP_STRING([--enable-coverage],
197 [Whether to enable coverage testing ]),
198 [], [enable_coverage=no])
199 AC_MSG_RESULT([$enable_coverage])
201 if test "$enable_coverage" = "yes"; then
202 if test "$GCC" != "yes"; then
203 AC_MSG_ERROR(Coverage testing requires GCC)
206 AC_PATH_PROG(GCOV, gcov, no)
207 if test "$GCOV" = "no" ; then
208 AC_MSG_ERROR(gcov tool is not available)
211 AC_PATH_PROG(LCOV, lcov, no)
212 if test "$LCOV" = "no" ; then
213 AC_MSG_ERROR(lcov tool is not installed)
216 AC_PATH_PROG(GENHTML, genhtml, no)
217 if test "$GENHTML" = "no" ; then
218 AC_MSG_ERROR(lcov's genhtml tool is not installed)
221 CFLAGS="$CFLAGS -O0 -g -fprofile-arcs -ftest-coverage"
222 LDFLAGS="$LDFLAGS -lgcov"
225 AM_CONDITIONAL([WITH_COVERAGE], [test "$enable_coverage" = "yes"])
230 # ------------------------------------------------------------------------------
234 SECRET_LT_RELEASE=$SECRET_CURRENT:$SECRET_REVISION:$SECRET_AGE
235 AC_SUBST(SECRET_LT_RELEASE)
236 AC_SUBST(SECRET_MAJOR)
237 AC_SUBST(SECRET_MINOR)
243 docs/reference/Makefile
244 docs/reference/libsecret/Makefile
245 docs/reference/libsecret/version.xml
246 docs/reference/libsecret/version-major.xml
252 libsecret/libsecret.pc
253 libsecret/libsecret-unstable.pc
254 libsecret/tests/Makefile
260 echo "CFLAGS: $CFLAGS"
263 echo " libgcrypt: $gcrypt_status"
264 echo " Debug: $debug_status"
265 echo " Coverage: $enable_coverage"