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,
41 LIBS="$LIBS $GLIB_LIBS"
42 CFLAGS="$CFLAGS $GLIB_CFLAGS"
44 # --------------------------------------------------------------------
52 [AC_HELP_STRING([--disable-gcrypt],
53 [without gcrypt and transport encryption])
56 if test "$enable_gcrypt" != "no"; then
57 AM_PATH_LIBGCRYPT($GCRYPT_LIBVER:$GCRYPT_VERSION,,
60 *** libgcrypt was not found. You may want to get it from
61 *** ftp://ftp.gnupg.org/gcrypt/libgcrypt/
65 AC_DEFINE(WITH_GCRYPT, 1, [Build with libgcypt and transport encryption])
66 AC_DEFINE_UNQUOTED(LIBGCRYPT_VERSION, "$GCRYPT_VERSION",
67 [Version of GCRYPT we expect])
69 AC_SUBST([LIBGCRYPT_CFLAGS])
70 AC_SUBST([LIBGCRYPT_LIBS])
72 gcrypt_status=$GCRYPT_VERSION
78 AM_CONDITIONAL(WITH_GCRYPT, test "$enable_gcrypt" = "yes")
80 # --------------------------------------------------------------------
84 AC_ARG_ENABLE(more-warnings,
85 AS_HELP_STRING([--disable-more-warnings], [Inhibit compiler warnings]),
88 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
90 -Wall -Wstrict-prototypes -Wmissing-declarations \
91 -Wmissing-prototypes -Wnested-externs -Wpointer-arith \
92 -Wdeclaration-after-statement -Wformat=2 -Winit-self \
93 -Waggregate-return -Wmissing-format-attribute"
95 for option in -Wmissing-include-dirs -Wundef; do
97 CFLAGS="$CFLAGS $option"
98 AC_MSG_CHECKING([whether gcc understands $option])
99 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])],
102 AC_MSG_RESULT($has_option)
103 if test $has_option = no; then
104 CFLAGS="$SAVE_CFLAGS"
109 AC_ARG_ENABLE(strict, [
110 AS_HELP_STRING([--enable-strict], [Strict code compilation])
113 AC_MSG_CHECKING([build strict])
115 if test "$enable_strict" = "yes"; then
116 CFLAGS="$CFLAGS -Werror \
117 -DGTK_DISABLE_DEPRECATED \
118 -DGDK_DISABLE_DEPRECATED \
119 -DG_DISABLE_DEPRECATED \
120 -DGDK_PIXBUF_DISABLE_DEPRECATED"
127 AC_MSG_RESULT($enable_strict)
130 AC_MSG_CHECKING([for debug mode])
132 AC_HELP_STRING([--enable-debug=no/default/yes],
133 [Turn on or off debugging])
136 if test "$enable_debug" != "no"; then
137 AC_DEFINE_UNQUOTED(WITH_DEBUG, 1, [Print debug output])
138 AC_DEFINE_UNQUOTED(_DEBUG, 1, [In debug mode])
141 if test "$enable_debug" = "yes"; then
144 elif test "$enable_debug" = "no"; then
146 AC_DEFINE_UNQUOTED(G_DISABLE_ASSERT, 1, [Disable glib assertions])
148 debug_status="default"
151 AC_MSG_RESULT($debug_status)
153 AC_MSG_CHECKING([whether to build with gcov testing])
154 AC_ARG_ENABLE([coverage],
155 AS_HELP_STRING([--enable-coverage],
156 [Whether to enable coverage testing ]),
157 [], [enable_coverage=no])
158 AC_MSG_RESULT([$enable_coverage])
160 if test "$enable_coverage" = "yes"; then
161 if test "$GCC" != "yes"; then
162 AC_MSG_ERROR(Coverage testing requires GCC)
165 AC_PATH_PROG(GCOV, gcov, no)
166 if test "$GCOV" = "no" ; then
167 AC_MSG_ERROR(gcov tool is not available)
170 AC_PATH_PROG(LCOV, lcov, no)
171 if test "$LCOV" = "no" ; then
172 AC_MSG_ERROR(lcov tool is not installed)
175 AC_PATH_PROG(GENHTML, genhtml, no)
176 if test "$GENHTML" = "no" ; then
177 AC_MSG_ERROR(lcov's genhtml tool is not installed)
180 CFLAGS="$CFLAGS -O0 -g -fprofile-arcs -ftest-coverage"
181 LDFLAGS="$LDFLAGS -lgcov"
184 AM_CONDITIONAL([WITH_COVERAGE], [test "$enable_coverage" = "yes"])
189 # ------------------------------------------------------------------------------
200 library/tests/Makefile
205 echo "CFLAGS: $CFLAGS"
208 echo " libgcrypt: $gcrypt_status"
209 echo " Debug: $debug_status"
210 echo " Coverage: $enable_coverage"