2 AC_CONFIG_MACRO_DIR([m4])
4 AC_INIT([gsecret],[0.1],[http://bugzilla.gnome.org/enter_bug.cgi?product=gsecret])
6 AC_CONFIG_SRCDIR([library/gsecret-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=gsecret
29 AC_SUBST([GETTEXT_PACKAGE])
30 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[The gettext domain name])
33 # --------------------------------------------------------------------
37 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28.0 gio-2.0 >= 2.28.0 gthread-2.0 >= 2.16.0)
38 LIBS="$LIBS $GLIB_LIBS"
39 CFLAGS="$CFLAGS $GLIB_CFLAGS"
41 # --------------------------------------------------------------------
49 [AC_HELP_STRING([--disable-gcrypt],
50 [without gcrypt and transport encryption])
53 if test "$enable_gcrypt" != "no"; then
54 AM_PATH_LIBGCRYPT($GCRYPT_LIBVER:$GCRYPT_VERSION,,
57 *** libgcrypt was not found. You may want to get it from
58 *** ftp://ftp.gnupg.org/gcrypt/libgcrypt/
62 AC_DEFINE(WITH_GCRYPT, 1, [Build with libgcypt and transport encryption])
63 AC_DEFINE_UNQUOTED(LIBGCRYPT_VERSION, "$GCRYPT_VERSION",
64 [Version of GCRYPT we expect])
66 AC_SUBST([LIBGCRYPT_CFLAGS])
67 AC_SUBST([LIBGCRYPT_LIBS])
69 gcrypt_status=$GCRYPT_VERSION
75 AM_CONDITIONAL(WITH_GCRYPT, test "$enable_gcrypt" = "yes")
77 # --------------------------------------------------------------------
81 AC_ARG_ENABLE(more-warnings,
82 AS_HELP_STRING([--disable-more-warnings], [Inhibit compiler warnings]),
85 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
87 -Wall -Wstrict-prototypes -Wmissing-declarations \
88 -Wmissing-prototypes -Wnested-externs -Wpointer-arith \
89 -Wdeclaration-after-statement -Wformat=2 -Winit-self \
90 -Waggregate-return -Wmissing-format-attribute"
92 for option in -Wmissing-include-dirs -Wundef; do
94 CFLAGS="$CFLAGS $option"
95 AC_MSG_CHECKING([whether gcc understands $option])
96 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])],
99 AC_MSG_RESULT($has_option)
100 if test $has_option = no; then
101 CFLAGS="$SAVE_CFLAGS"
106 AC_ARG_ENABLE(strict, [
107 AS_HELP_STRING([--enable-strict], [Strict code compilation])
110 AC_MSG_CHECKING([build strict])
112 if test "$enable_strict" = "yes"; then
113 CFLAGS="$CFLAGS -Werror \
114 -DGTK_DISABLE_DEPRECATED \
115 -DGDK_DISABLE_DEPRECATED \
116 -DG_DISABLE_DEPRECATED \
117 -DGDK_PIXBUF_DISABLE_DEPRECATED"
124 AC_MSG_RESULT($enable_strict)
127 AC_MSG_CHECKING([for debug mode])
129 AC_HELP_STRING([--enable-debug=no/default/yes],
130 [Turn on or off debugging])
133 if test "$enable_debug" != "no"; then
134 AC_DEFINE_UNQUOTED(WITH_DEBUG, 1, [Print debug output])
135 AC_DEFINE_UNQUOTED(_DEBUG, 1, [In debug mode])
138 if test "$enable_debug" = "yes"; then
141 elif test "$enable_debug" = "no"; then
143 AC_DEFINE_UNQUOTED(G_DISABLE_ASSERT, 1, [Disable glib assertions])
145 debug_status="default"
148 AC_MSG_RESULT($debug_status)
150 AC_MSG_CHECKING([whether to build with gcov testing])
151 AC_ARG_ENABLE([coverage],
152 AS_HELP_STRING([--enable-coverage],
153 [Whether to enable coverage testing ]),
154 [], [enable_coverage=no])
155 AC_MSG_RESULT([$enable_coverage])
157 if test "$enable_coverage" = "yes"; then
158 if test "$GCC" != "yes"; then
159 AC_MSG_ERROR(Coverage testing requires GCC)
162 AC_PATH_PROG(GCOV, gcov, no)
163 if test "$GCOV" = "no" ; then
164 AC_MSG_ERROR(gcov tool is not available)
167 AC_PATH_PROG(LCOV, lcov, no)
168 if test "$LCOV" = "no" ; then
169 AC_MSG_ERROR(lcov tool is not installed)
172 AC_PATH_PROG(GENHTML, genhtml, no)
173 if test "$GENHTML" = "no" ; then
174 AC_MSG_ERROR(lcov's genhtml tool is not installed)
177 CFLAGS="$CFLAGS -O0 -g -fprofile-arcs -ftest-coverage"
178 LDFLAGS="$LDFLAGS -lgcov"
181 AM_CONDITIONAL([WITH_COVERAGE], [test "$enable_coverage" = "yes"])
186 # ------------------------------------------------------------------------------
197 library/tests/Makefile
202 echo "CFLAGS: $CFLAGS"
205 echo " libgcrypt: $gcrypt_status"
206 echo " Debug: $debug_status"
207 echo " Coverage: $enable_coverage"