3 AC_INIT([libsecret],[0.16],
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 AM_INIT_AUTOMAKE([1.11 tar-ustar foreign -Wno-portability])
50 AC_CONFIG_HEADERS(config.h)
51 AC_CONFIG_SRCDIR([libsecret/secret-value.c])
52 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
53 AM_MAINTAINER_MODE([enable])
55 # -----------------------------------------------------------------------------
67 IT_PROG_INTLTOOL($INTLTOOL_REQ)
68 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
70 GETTEXT_PACKAGE=libsecret
71 AC_SUBST([GETTEXT_PACKAGE])
72 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[The gettext domain name])
75 # --------------------------------------------------------------------
76 # Checks for functions
80 # --------------------------------------------------------------------
83 PKG_CHECK_MODULES(GLIB,
87 LIBS="$LIBS $GLIB_LIBS -DGLIB_VERSION_MIN_REQUIRED=$GLIB_MIN"
88 CFLAGS="$CFLAGS $GLIB_CFLAGS -DGLIB_VERSION_MAX_ALLOWED=$GLIB_MAX"
90 GTK_DOC_CHECK($GTKDOC_WANT)
92 GOBJECT_INTROSPECTION_CHECK($GIR_WANT)
93 AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
95 # --------------------------------------------------------------------
98 AC_ARG_ENABLE(manpages,
99 AC_HELP_STRING([--disable-manpages], [Build manual pages]))
100 if test "$enable_manpages" != "no"; then
101 enable_manpages="yes"
102 AC_PATH_PROG([XSLTPROC], [xsltproc])
103 if test x$XSLTPROC = x; then
104 AC_MSG_ERROR([xsltproc is required to build manual pages])
107 AM_CONDITIONAL(WITH_MANPAGES, test x$enable_manpages = xyes)
109 # --------------------------------------------------------------------
112 VAPIGEN_CHECK($VALA_WANT)
114 if test "$enable_vala" != "no"; then
115 AC_PATH_PROG([VALAC], [valac], [])
117 AM_CONDITIONAL(HAVE_VALAC, test "x$VALAC" != "x")
119 # --------------------------------------------------------------------
124 AC_ARG_ENABLE(gcrypt,
125 [AC_HELP_STRING([--disable-gcrypt],
126 [without gcrypt and transport encryption])
129 if test "$enable_gcrypt" != "no"; then
132 m4_ifdef([AM_PATH_LIBGCRYPT],
133 [AM_PATH_LIBGCRYPT($GCRYPT_LIBVER:$GCRYPT_WANT, have_gcrypt=yes)])
135 if test $have_gcrypt != "yes"; then
138 *** libgcrypt was not found. You may want to get it from
139 *** ftp://ftp.gnupg.org/gcrypt/libgcrypt/
144 AC_DEFINE(WITH_GCRYPT, 1, [Build with libgcypt and transport encryption])
145 AC_DEFINE_UNQUOTED(LIBGCRYPT_VERSION, "$GCRYPT_WANT",
146 [Version of GCRYPT we expect])
148 AC_SUBST([LIBGCRYPT_CFLAGS])
149 AC_SUBST([LIBGCRYPT_LIBS])
157 AM_CONDITIONAL(WITH_GCRYPT, test "$enable_gcrypt" = "yes")
159 # --------------------------------------------------------------------
160 # Compilation options
162 if test "$GCC" = "yes"; then
164 -Wall -Wmissing-declarations \
165 -Wmissing-prototypes -Wnested-externs -Wpointer-arith \
166 -Wdeclaration-after-statement -Wformat=2 -Winit-self \
169 for option in -Wmissing-include-dirs -Wundef; do
170 SAVE_CFLAGS="$CFLAGS"
171 CFLAGS="$CFLAGS $option"
172 AC_MSG_CHECKING([whether gcc understands $option])
173 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])],
176 AC_MSG_RESULT($has_option)
177 if test $has_option = no; then
178 CFLAGS="$SAVE_CFLAGS"
183 AC_ARG_ENABLE(strict, [
184 AS_HELP_STRING([--enable-strict], [Strict code compilation])
187 AC_MSG_CHECKING([build strict])
189 if test "$enable_strict" = "yes"; then
190 CFLAGS="$CFLAGS -Werror -DG_DISABLE_DEPRECATED"
191 INTROSPECTION_FLAGS="--warn-error"
194 CFLAGS="$CFLAGS -Wno-error"
196 INTROSPECTION_FLAGS=""
200 AC_MSG_RESULT($enable_strict)
201 AC_SUBST(INTROSPECTION_FLAGS)
204 AC_MSG_CHECKING([for debug mode])
206 AC_HELP_STRING([--enable-debug=no/default/yes],
207 [Turn on or off debugging])
210 if test "$enable_debug" != "no"; then
211 AC_DEFINE_UNQUOTED(WITH_DEBUG, 1, [Print debug output])
212 AC_DEFINE_UNQUOTED(_DEBUG, 1, [In debug mode])
215 if test "$enable_debug" = "yes"; then
218 elif test "$enable_debug" = "no"; then
221 AC_DEFINE_UNQUOTED(G_DISABLE_ASSERT, 1, [Disable glib assertions])
223 debug_status="default"
226 AC_MSG_RESULT($debug_status)
228 AC_MSG_CHECKING([whether to build with gcov testing])
229 AC_ARG_ENABLE([coverage],
230 AS_HELP_STRING([--enable-coverage],
231 [Whether to enable coverage testing ]),
232 [], [enable_coverage=no])
233 AC_MSG_RESULT([$enable_coverage])
235 if test "$enable_coverage" = "yes"; then
236 if test "$GCC" != "yes"; then
237 AC_MSG_ERROR(Coverage testing requires GCC)
240 AC_PATH_PROG(GCOV, gcov, no)
241 if test "$GCOV" = "no" ; then
242 AC_MSG_ERROR(gcov tool is not available)
245 AC_PATH_PROG(LCOV, lcov, no)
246 if test "$LCOV" = "no" ; then
247 AC_MSG_ERROR(lcov tool is not installed)
250 AC_PATH_PROG(GENHTML, genhtml, no)
251 if test "$GENHTML" = "no" ; then
252 AC_MSG_ERROR(lcov's genhtml tool is not installed)
255 CFLAGS="$CFLAGS -O0 -g -fprofile-arcs -ftest-coverage"
256 LDFLAGS="$LDFLAGS -lgcov"
259 AM_CONDITIONAL([WITH_COVERAGE], [test "$enable_coverage" = "yes"])
264 # ------------------------------------------------------------------------------
268 SECRET_LT_RELEASE=$SECRET_CURRENT:$SECRET_REVISION:$SECRET_AGE
269 AC_SUBST(SECRET_LT_RELEASE)
270 AC_SUBST(SECRET_MAJOR)
271 AC_SUBST(SECRET_MINOR)
278 docs/reference/Makefile
279 docs/reference/libsecret/Makefile
280 docs/reference/libsecret/version.xml
281 docs/reference/libsecret/version-major.xml
287 libsecret/libsecret.pc
288 libsecret/libsecret-unstable.pc
289 libsecret/tests/Makefile
295 echo "CFLAGS: $CFLAGS"
298 echo " libgcrypt: $gcrypt_status"
299 echo " vala: $enable_vala"
300 echo " Debug: $debug_status"
301 echo " Coverage: $enable_coverage"
302 echo " Manual Page: $enable_manpages"