3 AC_INIT([libsecret],[0.1],
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([library/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"
69 GOBJECT_INTROSPECTION_CHECK([1.29])
70 AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
72 # --------------------------------------------------------------------
79 [AC_HELP_STRING([--disable-gcrypt],
80 [without gcrypt and transport encryption])
83 if test "$enable_gcrypt" != "no"; then
84 AM_PATH_LIBGCRYPT($GCRYPT_LIBVER:$GCRYPT_VERSION,,
87 *** libgcrypt was not found. You may want to get it from
88 *** ftp://ftp.gnupg.org/gcrypt/libgcrypt/
92 AC_DEFINE(WITH_GCRYPT, 1, [Build with libgcypt and transport encryption])
93 AC_DEFINE_UNQUOTED(LIBGCRYPT_VERSION, "$GCRYPT_VERSION",
94 [Version of GCRYPT we expect])
96 AC_SUBST([LIBGCRYPT_CFLAGS])
97 AC_SUBST([LIBGCRYPT_LIBS])
99 gcrypt_status=$GCRYPT_VERSION
105 AM_CONDITIONAL(WITH_GCRYPT, test "$enable_gcrypt" = "yes")
107 # --------------------------------------------------------------------
108 # Compilation options
110 if test "$GCC" = "yes"; then
112 -Wall -Wmissing-declarations \
113 -Wmissing-prototypes -Wnested-externs -Wpointer-arith \
114 -Wdeclaration-after-statement -Wformat=2 -Winit-self \
115 -Waggregate-return -Wmissing-format-attribute"
117 for option in -Wmissing-include-dirs -Wundef; do
118 SAVE_CFLAGS="$CFLAGS"
119 CFLAGS="$CFLAGS $option"
120 AC_MSG_CHECKING([whether gcc understands $option])
121 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])],
124 AC_MSG_RESULT($has_option)
125 if test $has_option = no; then
126 CFLAGS="$SAVE_CFLAGS"
131 AC_ARG_ENABLE(strict, [
132 AS_HELP_STRING([--enable-strict], [Strict code compilation])
135 AC_MSG_CHECKING([build strict])
137 if test "$enable_strict" = "yes"; then
138 CFLAGS="$CFLAGS -Werror \
139 -DGTK_DISABLE_DEPRECATED \
140 -DGDK_DISABLE_DEPRECATED \
141 -DG_DISABLE_DEPRECATED \
142 -DGDK_PIXBUF_DISABLE_DEPRECATED"
143 INTROSPECTION_FLAGS="--warn-error"
146 CFLAGS="$CFLAGS -Wno-error"
148 INTROSPECTION_FLAGS=""
152 AC_MSG_RESULT($enable_strict)
153 AC_SUBST(INTROSPECTION_FLAGS)
156 AC_MSG_CHECKING([for debug mode])
158 AC_HELP_STRING([--enable-debug=no/default/yes],
159 [Turn on or off debugging])
162 if test "$enable_debug" != "no"; then
163 AC_DEFINE_UNQUOTED(WITH_DEBUG, 1, [Print debug output])
164 AC_DEFINE_UNQUOTED(_DEBUG, 1, [In debug mode])
167 if test "$enable_debug" = "yes"; then
170 elif test "$enable_debug" = "no"; then
173 AC_DEFINE_UNQUOTED(G_DISABLE_ASSERT, 1, [Disable glib assertions])
175 debug_status="default"
178 AC_MSG_RESULT($debug_status)
180 AC_MSG_CHECKING([whether to build with gcov testing])
181 AC_ARG_ENABLE([coverage],
182 AS_HELP_STRING([--enable-coverage],
183 [Whether to enable coverage testing ]),
184 [], [enable_coverage=no])
185 AC_MSG_RESULT([$enable_coverage])
187 if test "$enable_coverage" = "yes"; then
188 if test "$GCC" != "yes"; then
189 AC_MSG_ERROR(Coverage testing requires GCC)
192 AC_PATH_PROG(GCOV, gcov, no)
193 if test "$GCOV" = "no" ; then
194 AC_MSG_ERROR(gcov tool is not available)
197 AC_PATH_PROG(LCOV, lcov, no)
198 if test "$LCOV" = "no" ; then
199 AC_MSG_ERROR(lcov tool is not installed)
202 AC_PATH_PROG(GENHTML, genhtml, no)
203 if test "$GENHTML" = "no" ; then
204 AC_MSG_ERROR(lcov's genhtml tool is not installed)
207 CFLAGS="$CFLAGS -O0 -g -fprofile-arcs -ftest-coverage"
208 LDFLAGS="$LDFLAGS -lgcov"
211 AM_CONDITIONAL([WITH_COVERAGE], [test "$enable_coverage" = "yes"])
216 # ------------------------------------------------------------------------------
220 SECRET_LT_RELEASE=$SECRET_CURRENT:$SECRET_REVISION:$SECRET_AGE
221 AC_SUBST(SECRET_LT_RELEASE)
222 AC_SUBST(SECRET_MAJOR)
223 AC_SUBST(SECRET_MINOR)
234 library/tests/Makefile
239 echo "CFLAGS: $CFLAGS"
242 echo " libgcrypt: $gcrypt_status"
243 echo " Debug: $debug_status"
244 echo " Coverage: $enable_coverage"