2 AC_CONFIG_MACRO_DIR([build/m4])
4 AC_INIT([libsecret],[0.1],[http://bugzilla.gnome.org/enter_bug.cgi?product=libsecret])
6 AC_CONFIG_SRCDIR([library/secret-value.c])
7 AC_CONFIG_HEADERS([config.h])
9 dnl Other initialization
11 AM_MAINTAINER_MODE([enable])
12 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)
15 dnl Checks for programs.
22 # --------------------------------------------------------------------
26 IT_PROG_INTLTOOL([0.35.0])
27 GETTEXT_PACKAGE=libsecret
29 AC_SUBST([GETTEXT_PACKAGE])
30 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[The gettext domain name])
33 # --------------------------------------------------------------------
37 PKG_CHECK_MODULES(GLIB,
41 LIBS="$LIBS $GLIB_LIBS"
42 CFLAGS="$CFLAGS $GLIB_CFLAGS"
44 AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
46 # --------------------------------------------------------------------
54 [AC_HELP_STRING([--disable-gcrypt],
55 [without gcrypt and transport encryption])
58 if test "$enable_gcrypt" != "no"; then
59 AM_PATH_LIBGCRYPT($GCRYPT_LIBVER:$GCRYPT_VERSION,,
62 *** libgcrypt was not found. You may want to get it from
63 *** ftp://ftp.gnupg.org/gcrypt/libgcrypt/
67 AC_DEFINE(WITH_GCRYPT, 1, [Build with libgcypt and transport encryption])
68 AC_DEFINE_UNQUOTED(LIBGCRYPT_VERSION, "$GCRYPT_VERSION",
69 [Version of GCRYPT we expect])
71 AC_SUBST([LIBGCRYPT_CFLAGS])
72 AC_SUBST([LIBGCRYPT_LIBS])
74 gcrypt_status=$GCRYPT_VERSION
80 AM_CONDITIONAL(WITH_GCRYPT, test "$enable_gcrypt" = "yes")
82 # --------------------------------------------------------------------
86 AC_ARG_ENABLE(more-warnings,
87 AS_HELP_STRING([--disable-more-warnings], [Inhibit compiler warnings]),
90 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
92 -Wall -Wstrict-prototypes -Wmissing-declarations \
93 -Wmissing-prototypes -Wnested-externs -Wpointer-arith \
94 -Wdeclaration-after-statement -Wformat=2 -Winit-self \
95 -Waggregate-return -Wmissing-format-attribute"
97 for option in -Wmissing-include-dirs -Wundef; do
99 CFLAGS="$CFLAGS $option"
100 AC_MSG_CHECKING([whether gcc understands $option])
101 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])],
104 AC_MSG_RESULT($has_option)
105 if test $has_option = no; then
106 CFLAGS="$SAVE_CFLAGS"
111 AC_ARG_ENABLE(strict, [
112 AS_HELP_STRING([--enable-strict], [Strict code compilation])
115 AC_MSG_CHECKING([build strict])
117 if test "$enable_strict" = "yes"; then
118 CFLAGS="$CFLAGS -Werror \
119 -DGTK_DISABLE_DEPRECATED \
120 -DGDK_DISABLE_DEPRECATED \
121 -DG_DISABLE_DEPRECATED \
122 -DGDK_PIXBUF_DISABLE_DEPRECATED"
129 AC_MSG_RESULT($enable_strict)
132 AC_MSG_CHECKING([for debug mode])
134 AC_HELP_STRING([--enable-debug=no/default/yes],
135 [Turn on or off debugging])
138 if test "$enable_debug" != "no"; then
139 AC_DEFINE_UNQUOTED(WITH_DEBUG, 1, [Print debug output])
140 AC_DEFINE_UNQUOTED(_DEBUG, 1, [In debug mode])
143 if test "$enable_debug" = "yes"; then
146 elif test "$enable_debug" = "no"; then
148 AC_DEFINE_UNQUOTED(G_DISABLE_ASSERT, 1, [Disable glib assertions])
150 debug_status="default"
153 AC_MSG_RESULT($debug_status)
155 AC_MSG_CHECKING([whether to build with gcov testing])
156 AC_ARG_ENABLE([coverage],
157 AS_HELP_STRING([--enable-coverage],
158 [Whether to enable coverage testing ]),
159 [], [enable_coverage=no])
160 AC_MSG_RESULT([$enable_coverage])
162 if test "$enable_coverage" = "yes"; then
163 if test "$GCC" != "yes"; then
164 AC_MSG_ERROR(Coverage testing requires GCC)
167 AC_PATH_PROG(GCOV, gcov, no)
168 if test "$GCOV" = "no" ; then
169 AC_MSG_ERROR(gcov tool is not available)
172 AC_PATH_PROG(LCOV, lcov, no)
173 if test "$LCOV" = "no" ; then
174 AC_MSG_ERROR(lcov tool is not installed)
177 AC_PATH_PROG(GENHTML, genhtml, no)
178 if test "$GENHTML" = "no" ; then
179 AC_MSG_ERROR(lcov's genhtml tool is not installed)
182 CFLAGS="$CFLAGS -O0 -g -fprofile-arcs -ftest-coverage"
183 LDFLAGS="$LDFLAGS -lgcov"
186 AM_CONDITIONAL([WITH_COVERAGE], [test "$enable_coverage" = "yes"])
191 # ------------------------------------------------------------------------------
203 library/tests/Makefile
208 echo "CFLAGS: $CFLAGS"
211 echo " libgcrypt: $gcrypt_status"
212 echo " Debug: $debug_status"
213 echo " Coverage: $enable_coverage"