1AC_INIT(gnome-keyring,
2        40.0,
3        [gnome-keyring-list@gnome.org],
4        [gnome-keyring],
5        [https://wiki.gnome.org/Projects/GnomeKeyring])
6
7dnl ****************************************************************************
8dnl Dependency versions
9
10GLIB_REQ=2.44.0
11GLIB_MIN=GLIB_VERSION_2_44
12GLIB_MAX=GLIB_VERSION_2_44
13
14GCK_REQ=3.3.4
15GCR_REQ=3.27.90
16
17GCRYPT_REQ=1.2.2
18GCRYPT_LIBVER=1
19
20dnl ****************************************************************************
21
22GKR_MAJOR=3
23
24version_bits=`echo $VERSION | tr '.' ' '`
25full_version=`printf %03d%03d%03d $version_bits`
26AC_DEFINE_UNQUOTED(GKR_VERSION, $full_version, [The gnome-keyring version as a number])
27
28AC_CONFIG_MACRO_DIR([build/m4])
29AC_CONFIG_AUX_DIR([build])
30AC_CONFIG_HEADERS(config.h)
31AC_CONFIG_SRCDIR([daemon/gkd-main.c])
32AM_INIT_AUTOMAKE([1.12 foreign dist-xz no-dist-gzip parallel-tests subdir-objects])
33m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
34
35AM_SANITY_CHECK
36AM_MAINTAINER_MODE([enable])
37
38AC_GNU_SOURCE
39AC_ISC_POSIX
40AC_PROG_CC
41AC_PROG_CPP
42AM_PROG_CC_C_O
43AC_PROG_INSTALL
44AC_PROG_LN_S
45AC_PROG_MAKE_SET
46AM_DISABLE_STATIC
47AM_PROG_LIBTOOL
48PKG_PROG_PKG_CONFIG
49
50AC_TYPE_PID_T
51AC_TYPE_SIGNAL
52AC_TYPE_SIZE_T
53AC_TYPE_UID_T
54
55DISTCHECK_CONFIGURE_FLAGS="--enable-doc"
56AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)
57
58PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQ)
59GLIB_CFLAGS="$GLIB_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=$GLIB_MIN"
60GLIB_CFLAGS="$GLIB_CFLAGS -DGLIB_VERSION_MAX_ALLOWED=$GLIB_MAX"
61AC_SUBST(GLIB_CFLAGS)
62AC_SUBST(GLIB_LIBS)
63
64PKG_CHECK_MODULES(GMODULE, gmodule-no-export-2.0)
65AC_SUBST(GMODULE_CFLAGS)
66AC_SUBST(GMODULE_LIBS)
67
68PKG_CHECK_MODULES(GOBJECT, glib-2.0 gobject-2.0)
69AC_SUBST(GOBJECT_CFLAGS)
70AC_SUBST(GOBJECT_LIBS)
71
72PKG_CHECK_MODULES(GIO, glib-2.0 gio-2.0 gio-unix-2.0)
73AC_SUBST(GIO_CFLAGS)
74AC_SUBST(GIO_LIBS)
75
76DAEMON_CFLAGS="$DAEMON_CFLAGS $GLIB_CFLAGS $GTHREAD_CFLAGS $GOBJECT_CFLAGS $GIO_CFLAGS"
77DAEMON_LIBS="$DAEMON_LIBS $GLIB_LIBS $GTHREAD_LIBS $GOBJECT_LIBS $GIO_LIBS"
78
79AM_GNU_GETTEXT([external])
80AM_GNU_GETTEXT_VERSION([0.19.8])
81GETTEXT_PACKAGE=gnome-keyring
82AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [The gettext domain name])
83AC_SUBST(GETTEXT_PACKAGE)
84
85AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
86
87GLIB_GSETTINGS
88
89# --------------------------------------------------------------------
90# Check for socklen_t
91#
92
93AC_MSG_CHECKING(whether socklen_t is defined)
94AC_TRY_COMPILE([
95#include <sys/types.h>
96#include <sys/socket.h>
97#include <netdb.h>
98],[
99socklen_t foo;
100foo = 1;
101foo = foo;
102],have_socklen_t=yes,have_socklen_t=no)
103AC_MSG_RESULT($have_socklen_t)
104
105if test "x$have_socklen_t" = "xyes"; then
106    AC_DEFINE(HAVE_SOCKLEN_T,1,[Have socklen_t type])
107fi
108
109# --------------------------------------------------------------------
110# Check for various credentials.
111#
112
113AC_MSG_CHECKING(for struct cmsgcred)
114AC_TRY_COMPILE([
115#include <sys/types.h>
116#include <sys/socket.h>
117],[
118struct cmsgcred cred;
119
120cred.cmcred_pid = 0;
121],have_struct_cmsgcred=yes,have_struct_cmsgcred=no)
122AC_MSG_RESULT($have_struct_cmsgcred)
123
124if test x$have_struct_cmsgcred = xyes; then
125    AC_DEFINE(HAVE_CMSGCRED,1,[Have cmsgcred structure])
126fi
127
128# --------------------------------------------------------------------
129# Check for getpeerucred
130#
131
132AC_CHECK_FUNCS(getpeerucred, AC_DEFINE(HAVE_GETPEERUCRED,1,[Have getpeerucred]))
133
134# --------------------------------------------------------------------
135# Check for getpeereid
136#
137
138AC_CHECK_FUNCS(getpeereid, AC_DEFINE(HAVE_GETPEEREID, 1, [Have getpeereid function]))
139
140# --------------------------------------------------------------------
141# Check for flock
142#
143
144AC_CHECK_FUNCS(flock, AC_DEFINE(HAVE_FLOCK,1,[Have flock]))
145
146# --------------------------------------------------------------------
147# Check for timegm
148#
149
150AC_CHECK_FUNCS(timegm, AC_DEFINE(HAVE_TIMEGM,1,[Have timegm]))
151
152AC_STAT_MACROS_BROKEN
153  AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
154  [AC_TRY_COMPILE(
155    [#include <sys/types.h>
156#include <inttypes.h>],
157    [uintmax_t i = (uintmax_t) -1;],
158    jm_ac_cv_header_inttypes_h=yes,
159    jm_ac_cv_header_inttypes_h=no)])
160  if test $jm_ac_cv_header_inttypes_h = yes; then
161    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
162[Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
163   and declares uintmax_t. ])
164  fi
165  AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
166  [AC_TRY_COMPILE(
167    [#include <sys/types.h>
168#include <stdint.h>],
169    [uintmax_t i = (uintmax_t) -1;],
170    jm_ac_cv_header_stdint_h=yes,
171    jm_ac_cv_header_stdint_h=no)])
172  if test $jm_ac_cv_header_stdint_h = yes; then
173    AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
174[Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
175   and declares uintmax_t. ])
176  fi
177AC_CHECK_HEADERS(fcntl.h sys/time.h time.h unistd.h)
178AC_CHECK_FUNCS(gettimeofday fsync)
179
180# --------------------------------------------------------------------
181# Memory locking
182#
183
184AC_CHECK_FUNCS(mlock)
185
186# --------------------------------------------------------------------
187# socket()
188#
189
190AC_CHECK_LIB(socket, socket)
191
192have_socket=no
193AC_CHECK_FUNCS(socket, have_socket=yes)
194if test $have_socket = no; then
195  # socket is not in the default libraries.  See if it's in some other.
196  for lib in bsd socket inet; do
197    AC_CHECK_LIB($lib, socket, [
198	  DAEMON_LIBS="$DAEMON_LIBS -l$lib"
199	  have_socket=yes
200	  AC_DEFINE(HAVE_SOCKET)
201	  break])
202  done
203fi
204
205# --------------------------------------------------------------------
206# GCR and GCK libraries
207
208PKG_CHECK_MODULES(GCK, gck-1 >= $GCK_REQ)
209PKG_CHECK_MODULES(GCR, gcr-3 >= $GCR_REQ)
210PKG_CHECK_MODULES(GCR_BASE, gcr-base-3 >= $GCR_REQ)
211
212DAEMON_CFLAGS="$DAEMON_CFLAGS $GCK_CFLAGS $GCR_BASE_CFLAGS"
213DAEMON_LIBS="$DAEMON_LIBS $GCK_LIBS $GCR_BASE_LIBS"
214
215AC_SUBST(GCK_CFLAGS)
216AC_SUBST(GCR_CFLAGS)
217AC_SUBST(GCR_BASE_CFLAGS)
218AC_SUBST(GCK_LIBS)
219AC_SUBST(GCR_LIBS)
220AC_SUBST(GCR_BASE_LIBS)
221
222AC_DEFINE(GCK_API_SUBJECT_TO_CHANGE, 1, [Nod nod])
223AC_DEFINE(GCR_API_SUBJECT_TO_CHANGE, 1, [Nod nod])
224
225# --------------------------------------------------------------------
226# DBus Checks
227#
228
229AC_ARG_WITH(dbus-services,
230		  [AC_HELP_STRING([--with-dbus-services=<dir>],
231		  [where D-BUS session services directory is])])
232if ! test -z "$with_dbus_services" ; then
233	DBUS_SERVICES_DIR="$with_dbus_services"
234else
235	DBUS_SERVICES_DIR="$datadir/dbus-1/services"
236fi
237
238AC_SUBST(DBUS_SERVICES_DIR)
239
240# --------------------------------------------------------------------
241# PAM Checks
242
243AC_ARG_ENABLE(pam,
244	    AC_HELP_STRING([--disable-pam],
245	    [Build GNOME keyring PAM helper]))
246
247pam_status="no"
248if test "$enable_pam" != "no"; then
249	AC_CHECK_HEADERS(security/pam_modules.h pam/pam_modules.h, [have_pam=yes; break], have_pam=no)
250	if test "$enable_pam" = "yes" -a "$have_pam" = "no"; then
251		AC_MSG_ERROR(The PAM headers are missing)
252	elif test "$have_pam" = "yes"; then
253		old_LIBS=$LIBS
254		AC_CHECK_LIB(pam, pam_start, have_pam=yes, have_pam=no)
255		if test "$enable_pam" = "yes" -a "$have_pam" = "no"; then
256			AC_MSG_ERROR(The PAM library is missing)
257		fi
258		LIBS=$old_LIBS
259	fi
260fi
261
262# --------------------------------------------------------------------
263# Find DL functionality
264
265dnl *** dlopen() and dlsym() in system libraries
266AS_IF([ test -z "$HAVE_DL"], [
267	AC_CHECK_FUNC(dlopen,
268		      [AC_CHECK_FUNC(dlsym,
269			             [HAVE_DL=c],[])],
270		      [])
271])
272
273dnl *** dlopen() and dlsym() in libdl
274AS_IF([ test -z "$HAVE_DL"], [
275	AC_CHECK_LIB(dl, dlopen,
276		     [AC_CHECK_LIB(dl, dlsym,
277			           [DL_LIBS=-ldl
278		                   HAVE_DL=dl],[])],
279		     [])
280])
281
282AS_IF([ test -z "$HAVE_DL"], [
283	AC_MSG_ERROR([Could not find a library with the dlopen and dlsym functions])
284])
285
286AC_SUBST(DL_LIBS)
287
288# --------------------------------------------------------------------
289# p11-kit
290
291AC_MSG_CHECKING([where to put pkcs11 module configuration])
292AC_ARG_WITH(pkcs11-config, [
293            AC_HELP_STRING([--with-pkcs11-config=<dir>],
294                           [directory to install PKCS#11 config])
295            ])
296if test -z "$with_pkcs11_config" ; then
297	P11_SYSTEM_CONFIG_MODULES=$($PKG_CONFIG p11-kit-1 --variable=p11_system_config_modules)
298else
299	P11_SYSTEM_CONFIG_MODULES="$with_pkcs11_config"
300fi
301if test "$P11_SYSTEM_CONFIG_MODULES" = ""; then
302	AC_MSG_ERROR([Could not find location for pkcs11 module config])
303fi
304AC_MSG_RESULT($P11_SYSTEM_CONFIG_MODULES)
305AC_SUBST(P11_SYSTEM_CONFIG_MODULES)
306
307AC_MSG_CHECKING([module path to install pkcs11 modules])
308AC_ARG_WITH(pkcs11-modules, [
309            AC_HELP_STRING([--with-pkcs11-modules=<dir>],
310                           [directory to install PKCS#11 modules])
311            ])
312if test -z "$with_pkcs11_modules" ; then
313	P11_MODULE_PATH=$($PKG_CONFIG p11-kit-1 --variable=p11_module_path)
314else
315	P11_MODULE_PATH="$with_pkcs11_modules"
316fi
317if test "$P11_MODULE_PATH" = ""; then
318	AC_MSG_ERROR([Could not find directory to install pkcs11 modules])
319fi
320AC_MSG_RESULT($P11_MODULE_PATH)
321AC_SUBST(P11_MODULE_PATH)
322
323pkcs11standalonedir="${libdir}/gnome-keyring/devel"
324AC_SUBST(pkcs11standalonedir)
325
326# --------------------------------------------------------------------
327# PAM Module Directory
328
329AC_ARG_WITH([pam-dir],
330            [AC_HELP_STRING([--with-pam-dir=DIR],
331                             [directory to install pam modules in])],
332             [], [with_pam_dir='${libdir}/security'])
333PAM_DEST_DIR="$with_pam_dir"
334AC_SUBST(PAM_DEST_DIR)
335
336AM_CONDITIONAL(WITH_PAM, test "$have_pam" = "yes")
337
338if test "$have_pam" = "yes"; then
339	pam_status="yes ($with_pam_dir)"
340fi
341
342# --------------------------------------------------------------------
343# SSH Agent support
344#
345
346AC_ARG_ENABLE([ssh-agent],
347		AC_HELP_STRING([--disable-ssh-agent],
348		[Don't include SSH agent in gnome-keyring]))
349
350if test "$enable_ssh_agent" = "no"; then
351	SSH_AGENT=false
352	SSH_ADD=false
353else
354	AC_PATH_PROG([SSH_AGENT], [ssh-agent], [no])
355	AC_PATH_PROG([SSH_ADD], [ssh-add], [no])
356	if test "$SSH_AGENT" = "no" -o "$SSH_ADD" = "no"; then
357		AC_MSG_ERROR([the ssh-agent and ssh-add commands were not found])
358	else
359		enable_ssh_agent=yes
360		AC_DEFINE(WITH_SSH, 1, [Whether to build SSH agent or not])
361	fi
362fi
363
364AC_DEFINE_UNQUOTED(SSH_AGENT, "$SSH_AGENT", [The path to ssh-agent])
365AC_DEFINE_UNQUOTED(SSH_ADD, "$SSH_ADD", [The path to ssh-add])
366
367AM_CONDITIONAL(WITH_SSH, test "$enable_ssh_agent" != "no")
368ssh_status="$enable_ssh_agent"
369
370# --------------------------------------------------------------------
371# libgcrypt
372#
373
374AM_PATH_LIBGCRYPT($GCRYPT_LIBVER:$GCRYPT_REQ,,
375	AC_MSG_ERROR([[
376***
377*** libgcrypt was not found. You may want to get it from
378*** ftp://ftp.gnupg.org/gcrypt/libgcrypt/
379***
380]]))
381libgcrypt=yes
382AC_DEFINE_UNQUOTED(LIBGCRYPT_VERSION, "$GCRYPT_REQ", [Version of GCRYPT we expect])
383
384DAEMON_CFLAGS="$DAEMON_CFLAGS $LIBGCRYPT_CFLAGS"
385DAEMON_LIBS="$DAEMON_LIBS $LIBGCRYPT_LIBS"
386
387AC_SUBST([LIBGCRYPT_CFLAGS])
388AC_SUBST([LIBGCRYPT_LIBS])
389
390# -------------------------------------------------------------------
391# libcap-ng
392#
393
394AC_ARG_WITH([libcap-ng],
395            [AC_HELP_STRING([--without-libcap-ng],
396                            [build without libcap-ng (disables Linux capabilities support)])],,
397            [with_libcap_ng=auto])
398
399if test x"$with_libcap_ng" != x"no" ; then
400    AC_CHECK_LIB([cap-ng], [capng_clear],
401                 [
402                   with_libcap_ng="yes"
403                   AC_DEFINE([HAVE_LIBCAPNG], [1], [have libcap-ng headers and library])
404                   DAEMON_LIBS="$DAEMON_LIBS -lcap-ng"
405                 ],
406                 [
407                   if test x"$with_libcap_ng" = x"yes" ; then
408                     AC_MSG_ERROR([libcap-ng support requested, but package not found])
409                   else
410                     AC_MSG_WARN([libcap-ng headers not installed])
411                   fi
412                   with_libcap_ng="no"
413                 ])
414fi
415
416AM_CONDITIONAL([WITH_CAPS], [test x"$with_libcap_ng" = x"yes"])
417libcapng_status="$with_libcap_ng"
418
419# ----------------------------------------------------------------------
420# selinux
421
422LIBSELINUX=""
423selinux_status="no"
424AC_ARG_ENABLE([selinux],
425        AC_HELP_STRING([--disable-selinux],[do not use SELinux]))
426if test "x$enable_selinux" != "xno"; then
427    AC_CHECK_LIB([selinux],[getfilecon],
428        [AC_CHECK_LIB([selinux],[setexeccon],
429            [AC_DEFINE([WITH_SELINUX], 1, [Defined if SE Linux support is compiled in])
430             LIBSELINUX="-lselinux"
431             selinux_status="yes"])
432        ])
433fi
434AC_SUBST(LIBSELINUX)
435AM_CONDITIONAL([HAVE_LIBSELINUX], [test ! -z "$LIBSELINUX"])
436
437# ----------------------------------------------------------------------
438# dotlock.c support
439
440AC_DEFINE(DOTLOCK_USE_PTHREAD,1,[Define if POSIX threads are in use.])
441AC_DEFINE(DOTLOCK_GLIB_LOGGING,1,[Define this to use Glib logging functions.])
442AC_DEFINE_UNQUOTED(DOTLOCK_EXT_SYM_PREFIX,[_gkm_],
443                  [Prefix used for external functions of dotlock.])
444
445# ----------------------------------------------------------------------
446# p11-tests
447
448AC_ARG_ENABLE(p11_tests,
449	AC_HELP_STRING([--disable-p11-tests],
450	[Build in p11-tests for testing PKCS#11 modules]))
451
452p11_tests_status="no"
453
454if test "$enable_p11_tests" != "no"; then
455	PKG_CHECK_MODULES(P11_TESTS, p11-tests >= 0.1,
456	                  p11_tests_status=yes, p11_tests_status=no)
457fi
458
459AM_CONDITIONAL(WITH_P11_TESTS, test "$p11_tests_status" = "yes")
460
461if test "$p11_tests_status" = "yes"; then
462	AC_DEFINE_UNQUOTED(WITH_P11_TESTS, 1, [Run p11-tests module testing])
463fi
464
465# --------------------------------------------------------------------
466# Documentation options
467
468AC_MSG_CHECKING([whether to build documentation])
469AC_ARG_ENABLE(doc,
470              AC_HELP_STRING([--enable-doc],
471                             [Disable building documentation])
472             )
473
474if test "$enable_doc" = "no"; then
475	AC_MSG_RESULT($enable_doc)
476
477else
478	if test "$enable_doc" = ""; then
479		disable_msg="(perhaps --disable-doc)"
480	fi
481
482	enable_doc="yes"
483	AC_MSG_RESULT($enable_doc)
484
485	AC_PATH_PROG([XSLTPROC], [xsltproc], [no])
486	if test "$XSLTPROC" = "no"; then
487		AC_MSG_ERROR([the xsltproc command was not found $disable_msg])
488	fi
489
490	AC_SUBST(XSLTPROC)
491fi
492
493AM_CONDITIONAL([ENABLE_DOC], [test "$enable_doc" = "yes"])
494doc_status=$enable_doc
495
496# --------------------------------------------------------------------
497# Compilation and linking options
498#
499
500AC_MSG_CHECKING([for debug mode])
501AC_ARG_ENABLE(debug,
502              AC_HELP_STRING([--enable-debug=no/default/yes],
503              [Turn on or off debugging]))
504
505if test "$enable_debug" != "no"; then
506	AC_DEFINE_UNQUOTED(WITH_DEBUG, 1, [Print debug output])
507	AC_DEFINE_UNQUOTED(_DEBUG, 1, [In debug mode])
508	CFLAGS="$CFLAGS -g"
509fi
510
511if test "$enable_debug" = "yes"; then
512	debug_status="yes (-g, -O0, debug output, testable)"
513	CFLAGS="$CFLAGS -O0"
514elif test "$enable_debug" = "no"; then
515	debug_status="no (no debug output, not testable, G_DISABLE_ASSERT)"
516	AC_DEFINE_UNQUOTED(G_DISABLE_ASSERT, 1, [Disable glib assertions])
517else
518	debug_status="default (-g, debug output, testable)"
519fi
520
521AC_MSG_RESULT($debug_status)
522
523AC_MSG_CHECKING(for more warnings)
524if test "$GCC" = "yes"; then
525	AC_MSG_RESULT(yes)
526	CFLAGS="\
527	-Wall \
528	-Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
529	-Wnested-externs -Wpointer-arith \
530	-Wcast-align -Wsign-compare \
531	$CFLAGS"
532
533	for option in -Wno-strict-aliasing -Wno-sign-compare; do
534		SAVE_CFLAGS="$CFLAGS"
535		CFLAGS="$CFLAGS $option"
536		AC_MSG_CHECKING([whether gcc understands $option])
537		AC_TRY_COMPILE([], [],
538			has_option=yes,
539			has_option=no,)
540		if test $has_option = no; then
541			CFLAGS="$SAVE_CFLAGS"
542		fi
543		AC_MSG_RESULT($has_option)
544		unset has_option
545		unset SAVE_CFLAGS
546	done
547	unset option
548else
549	AC_MSG_RESULT(no)
550fi
551
552AC_ARG_ENABLE(strict, [
553               AS_HELP_STRING([--enable-strict], [Strict code compilation])
554             ])
555
556AC_MSG_CHECKING([build strict])
557
558if test "$enable_strict" = "yes"; then
559	CFLAGS="$CFLAGS -Werror \
560		-DGDK_DISABLE_DEPRECATED \
561		-DG_DISABLE_DEPRECATED \
562		-DGDK_PIXBUF_DISABLE_DEPRECATED"
563	TEST_MODE="thorough"
564	INTROSPECTION_FLAGS="--warn-error"
565	AC_DEFINE_UNQUOTED(WITH_STRICT, 1, [More strict checks])
566	strict_status="yes (-Werror, thorough tests, fatals, no deprecations)"
567else
568	TEST_MODE="quick"
569	INTROSPECTION_FLAGS=""
570	strict_status="no (quick tests, non-fatal warnings)"
571fi
572
573AC_MSG_RESULT($strict_status)
574AC_SUBST(INTROSPECTION_FLAGS)
575AC_SUBST(TEST_MODE)
576
577AC_MSG_CHECKING([whether to build with gcov testing])
578AC_ARG_ENABLE([coverage],
579		AS_HELP_STRING([--enable-coverage],
580			[Whether to enable coverage testing ]),
581		[],
582		[enable_coverage=no])
583
584AC_MSG_RESULT([$enable_coverage])
585
586if test "$enable_coverage" = "yes"; then
587	if test "$GCC" != "yes"; then
588		AC_MSG_ERROR(Coverage testing requires GCC)
589	fi
590
591	AC_PATH_PROG(GCOV, gcov, no)
592	if test "$GCOV" = "no" ; then
593		AC_MSG_ERROR(gcov tool is not available)
594	fi
595
596	AC_PATH_PROG(LCOV, lcov, no)
597	if test "$LCOV" = "no" ; then
598		AC_MSG_ERROR(lcov tool is not installed)
599	fi
600
601	AC_PATH_PROG(GENHTML, genhtml, no)
602	if test "$GENHTML" = "no" ; then
603		AC_MSG_ERROR(lcov's genhtml tool is not installed)
604	fi
605
606	CFLAGS="$CFLAGS -O0 -g -fprofile-arcs -ftest-coverage"
607	LDFLAGS="$LDFLAGS -lgcov"
608fi
609
610AM_CONDITIONAL([WITH_COVERAGE], [test "$enable_coverage" = "yes"])
611AC_SUBST(LCOV)
612AC_SUBST(GCOV)
613AC_SUBST(GENHTML)
614
615AC_ARG_ENABLE(valgrind,
616	AC_HELP_STRING([--enable-valgrind],
617	[Run gnome-keyring-daemon using valgrind]))
618
619AC_MSG_CHECKING([valgrind])
620valgrind_status="yes"
621
622AM_CONDITIONAL(WITH_VALGRIND, test "$enable_valgrind" = "run")
623
624# Build valgrind support into code
625if test "$enable_valgrind" = "yes"; then
626	AC_CHECK_HEADER([valgrind/valgrind.h], have_valgrind=yes, have_valgrind=no)
627	if test "$have_valgrind" = "no"; then
628		AC_MSG_ERROR(The valgrind headers are missing)
629	fi
630	AC_DEFINE_UNQUOTED(WITH_VALGRIND, 1, [Run under valgrind])
631	AC_MSG_RESULT(yes)
632
633
634# No valgrind
635else
636	AC_MSG_RESULT(no)
637	valgrind_status="no"
638fi
639
640# ----------------------------------------------------------------------
641
642AC_SUBST(GKR_MAJOR)
643
644AC_SUBST(DAEMON_CFLAGS)
645AC_SUBST(DAEMON_LIBS)
646
647AC_SUBST(P11_TESTS_CFLAGS)
648AC_SUBST(P11_TESTS_LIBS)
649
650AC_OUTPUT([
651Makefile
652pkcs11/rpc-layer/gnome-keyring.module
653po/Makefile.in
654])
655
656# ------------------------------------------------------------------------------
657# Summary
658#
659
660echo
661echo "OPTIONAL DEPENDENCIES"
662echo "  PAM:                  $pam_status"
663echo "  Linux capabilities:   $libcapng_status"
664echo "  SELinux:              $selinux_status"
665echo
666echo "CONFIGURATION"
667echo "  SSH Agent:            $ssh_status"
668echo
669echo "BUILD"
670echo "  Debug Build:          $debug_status"
671echo "  Strict Compilation:   $strict_status"
672echo "  Valgrind:             $valgrind_status"
673echo "  PKCS#11 Tests         $p11_tests_status"
674echo "  Test Coverage:        $enable_coverage"
675echo "  Documentation:        $doc_status"
676echo
677