configure.ac 17.8 KB
Newer Older
1
AC_INIT(gnome-keyring,
Daiki Ueno's avatar
Daiki Ueno committed
2
        3.27.4,
3 4 5
        [gnome-keyring-list@gnome.org],
        [gnome-keyring],
        [https://wiki.gnome.org/Projects/GnomeKeyring])
Stef Walter's avatar
Stef Walter committed
6

7 8 9
dnl ****************************************************************************
dnl Dependency versions

10 11
GLIB_REQ=2.38.0
GLIB_MIN=GLIB_VERSION_2_38
12 13 14 15 16 17 18
GLIB_MAX=GLIB_VERSION_2_38

GCK_REQ=3.3.4
GCR_REQ=3.5.3

GCRYPT_REQ=1.2.2
GCRYPT_LIBVER=1
19

20
dnl ****************************************************************************
21

22
GKR_MAJOR=3
23

24 25 26 27
version_bits=`echo $VERSION | tr '.' ' '`
full_version=`printf %03d%03d%03d $version_bits`
AC_DEFINE_UNQUOTED(GKR_VERSION, $full_version, [The gnome-keyring version as a number])

28 29
AC_CONFIG_MACRO_DIR([build/m4])
AC_CONFIG_AUX_DIR([build])
30
AC_CONFIG_HEADERS(config.h)
31
AC_CONFIG_SRCDIR([daemon/gkd-main.c])
32
AM_INIT_AUTOMAKE([1.12 foreign dist-xz no-dist-gzip parallel-tests subdir-objects])
33 34
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

Alexander Larsson's avatar
Alexander Larsson committed
35
AM_SANITY_CHECK
36
AM_MAINTAINER_MODE([enable])
Alexander Larsson's avatar
Alexander Larsson committed
37

38
AC_GNU_SOURCE
Alexander Larsson's avatar
Alexander Larsson committed
39 40 41
AC_ISC_POSIX
AC_PROG_CC
AC_PROG_CPP
42
AM_PROG_CC_C_O
Alexander Larsson's avatar
Alexander Larsson committed
43 44 45 46 47
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AM_DISABLE_STATIC
AM_PROG_LIBTOOL
Helmut Grohne's avatar
Helmut Grohne committed
48
PKG_PROG_PKG_CONFIG
Alexander Larsson's avatar
Alexander Larsson committed
49

50 51 52 53 54
AC_TYPE_PID_T
AC_TYPE_SIGNAL
AC_TYPE_SIZE_T
AC_TYPE_UID_T

55
DISTCHECK_CONFIGURE_FLAGS="--enable-doc"
56 57
AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)

58 59 60
PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQ)
GLIB_CFLAGS="$GLIB_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=$GLIB_MIN"
GLIB_CFLAGS="$GLIB_CFLAGS -DGLIB_VERSION_MAX_ALLOWED=$GLIB_MAX"
61 62
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
Stefan Walter's avatar
Stefan Walter committed
63

64
PKG_CHECK_MODULES(GMODULE, gmodule-no-export-2.0)
65 66
AC_SUBST(GMODULE_CFLAGS)
AC_SUBST(GMODULE_LIBS)
67

68
PKG_CHECK_MODULES(GOBJECT, glib-2.0 gobject-2.0)
69 70
AC_SUBST(GOBJECT_CFLAGS)
AC_SUBST(GOBJECT_LIBS)
Stefan Walter's avatar
Stefan Walter committed
71

72
PKG_CHECK_MODULES(GIO, glib-2.0 gio-2.0 gio-unix-2.0)
73 74 75
AC_SUBST(GIO_CFLAGS)
AC_SUBST(GIO_LIBS)

76 77 78
DAEMON_CFLAGS="$DAEMON_CFLAGS $GLIB_CFLAGS $GTHREAD_CFLAGS $GOBJECT_CFLAGS $GIO_CFLAGS"
DAEMON_LIBS="$DAEMON_LIBS $GLIB_LIBS $GTHREAD_LIBS $GOBJECT_LIBS $GIO_LIBS"

79 80
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.19.8])
Alexander Larsson's avatar
Alexander Larsson committed
81 82 83 84
GETTEXT_PACKAGE=gnome-keyring
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [The gettext domain name])
AC_SUBST(GETTEXT_PACKAGE)

85 86
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)

87 88
GLIB_GSETTINGS

89 90
# --------------------------------------------------------------------
# Check for socklen_t
91
#
92

Alexander Larsson's avatar
Alexander Larsson committed
93 94 95 96 97 98 99 100
AC_MSG_CHECKING(whether socklen_t is defined)
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
],[
socklen_t foo;
foo = 1;
Stef Walter's avatar
Stef Walter committed
101
foo = foo;
102 103
],have_socklen_t=yes,have_socklen_t=no)
AC_MSG_RESULT($have_socklen_t)
Alexander Larsson's avatar
Alexander Larsson committed
104

105
if test "x$have_socklen_t" = "xyes"; then
Alexander Larsson's avatar
Alexander Larsson committed
106 107 108
    AC_DEFINE(HAVE_SOCKLEN_T,1,[Have socklen_t type])
fi

109 110
# --------------------------------------------------------------------
# Check for various credentials.
111
#
112

Alexander Larsson's avatar
Alexander Larsson committed
113 114 115 116 117 118 119 120
AC_MSG_CHECKING(for struct cmsgcred)
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/socket.h>
],[
struct cmsgcred cred;

cred.cmcred_pid = 0;
121 122
],have_struct_cmsgcred=yes,have_struct_cmsgcred=no)
AC_MSG_RESULT($have_struct_cmsgcred)
Alexander Larsson's avatar
Alexander Larsson committed
123

124
if test x$have_struct_cmsgcred = xyes; then
Alexander Larsson's avatar
Alexander Larsson committed
125 126 127
    AC_DEFINE(HAVE_CMSGCRED,1,[Have cmsgcred structure])
fi

128
# --------------------------------------------------------------------
129 130
# Check for getpeerucred
#
131

132 133
AC_CHECK_FUNCS(getpeerucred, AC_DEFINE(HAVE_GETPEERUCRED,1,[Have getpeerucred]))

134 135
# --------------------------------------------------------------------
# Check for getpeereid
136
#
137 138 139

AC_CHECK_FUNCS(getpeereid, AC_DEFINE(HAVE_GETPEEREID, 1, [Have getpeereid function]))

140 141 142 143 144 145 146
# --------------------------------------------------------------------
# Check for flock
#

AC_CHECK_FUNCS(flock, AC_DEFINE(HAVE_FLOCK,1,[Have flock]))

# --------------------------------------------------------------------
147
# Check for timegm
148 149 150 151
#

AC_CHECK_FUNCS(timegm, AC_DEFINE(HAVE_TIMEGM,1,[Have timegm]))

152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
AC_STAT_MACROS_BROKEN
  AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
  [AC_TRY_COMPILE(
    [#include <sys/types.h>
#include <inttypes.h>],
    [uintmax_t i = (uintmax_t) -1;],
    jm_ac_cv_header_inttypes_h=yes,
    jm_ac_cv_header_inttypes_h=no)])
  if test $jm_ac_cv_header_inttypes_h = yes; then
    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
[Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
   and declares uintmax_t. ])
  fi
  AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
  [AC_TRY_COMPILE(
    [#include <sys/types.h>
#include <stdint.h>],
    [uintmax_t i = (uintmax_t) -1;],
    jm_ac_cv_header_stdint_h=yes,
    jm_ac_cv_header_stdint_h=no)])
  if test $jm_ac_cv_header_stdint_h = yes; then
    AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
[Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
   and declares uintmax_t. ])
  fi
AC_CHECK_HEADERS(fcntl.h sys/time.h time.h unistd.h)
178
AC_CHECK_FUNCS(gettimeofday fsync)
179

180 181 182 183 184
# --------------------------------------------------------------------
# Memory locking
#

AC_CHECK_FUNCS(mlock)
185 186 187

# --------------------------------------------------------------------
# socket()
188
#
189 190 191 192 193 194 195 196 197

AC_CHECK_LIB(socket, socket)

have_socket=no
AC_CHECK_FUNCS(socket, have_socket=yes)
if test $have_socket = no; then
  # socket is not in the default libraries.  See if it's in some other.
  for lib in bsd socket inet; do
    AC_CHECK_LIB($lib, socket, [
198
	  DAEMON_LIBS="$DAEMON_LIBS -l$lib"
199 200 201 202 203
	  have_socket=yes
	  AC_DEFINE(HAVE_SOCKET)
	  break])
  done
fi
204

205 206 207
# --------------------------------------------------------------------
# GCR and GCK libraries

208 209 210
PKG_CHECK_MODULES(GCK, gck-1 >= $GCK_REQ)
PKG_CHECK_MODULES(GCR, gcr-3 >= $GCR_REQ)
PKG_CHECK_MODULES(GCR_BASE, gcr-base-3 >= $GCR_REQ)
211 212

DAEMON_CFLAGS="$DAEMON_CFLAGS $GCK_CFLAGS $GCR_BASE_CFLAGS"
213
DAEMON_LIBS="$DAEMON_LIBS $GCK_LIBS $GCR_BASE_LIBS"
214 215 216 217 218 219 220 221

AC_SUBST(GCK_CFLAGS)
AC_SUBST(GCR_CFLAGS)
AC_SUBST(GCR_BASE_CFLAGS)
AC_SUBST(GCK_LIBS)
AC_SUBST(GCR_LIBS)
AC_SUBST(GCR_BASE_LIBS)

222 223 224
AC_DEFINE(GCK_API_SUBJECT_TO_CHANGE, 1, [Nod nod])
AC_DEFINE(GCR_API_SUBJECT_TO_CHANGE, 1, [Nod nod])

225 226
# --------------------------------------------------------------------
# DBus Checks
227
#
228

229 230 231 232 233 234 235
AC_ARG_WITH(dbus-services,
		  [AC_HELP_STRING([--with-dbus-services=<dir>],
		  [where D-BUS session services directory is])])
if ! test -z "$with_dbus_services" ; then
	DBUS_SERVICES_DIR="$with_dbus_services"
else
	DBUS_SERVICES_DIR="$datadir/dbus-1/services"
236
fi
237 238

AC_SUBST(DBUS_SERVICES_DIR)
239

240 241
# --------------------------------------------------------------------
# PAM Checks
242

243
AC_ARG_ENABLE(pam,
244 245 246
	    AC_HELP_STRING([--disable-pam],
	    [Build GNOME keyring PAM helper]))

247
pam_status="no"
248
if 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 251
	if test "$enable_pam" = "yes" -a "$have_pam" = "no"; then
		AC_MSG_ERROR(The PAM headers are missing)
252 253 254 255 256 257 258
	elif test "$have_pam" = "yes"; then
		old_LIBS=$LIBS
		AC_CHECK_LIB(pam, pam_start, have_pam=yes, have_pam=no)
		if test "$enable_pam" = "yes" -a "$have_pam" = "no"; then
			AC_MSG_ERROR(The PAM library is missing)
		fi
		LIBS=$old_LIBS
259 260
	fi
fi
261

262 263 264
# --------------------------------------------------------------------
# Find DL functionality

265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284
dnl *** dlopen() and dlsym() in system libraries
AS_IF([ test -z "$HAVE_DL"], [
	AC_CHECK_FUNC(dlopen,
		      [AC_CHECK_FUNC(dlsym,
			             [HAVE_DL=c],[])],
		      [])
])

dnl *** dlopen() and dlsym() in libdl
AS_IF([ test -z "$HAVE_DL"], [
	AC_CHECK_LIB(dl, dlopen,
		     [AC_CHECK_LIB(dl, dlsym,
			           [DL_LIBS=-ldl
		                   HAVE_DL=dl],[])],
		     [])
])

AS_IF([ test -z "$HAVE_DL"], [
	AC_MSG_ERROR([Could not find a library with the dlopen and dlsym functions])
])
285 286 287

AC_SUBST(DL_LIBS)

288 289 290
# --------------------------------------------------------------------
# p11-kit

291
AC_MSG_CHECKING([where to put pkcs11 module configuration])
Stef Walter's avatar
Stef Walter committed
292 293 294 295 296 297 298 299 300
AC_ARG_WITH(pkcs11-config, [
            AC_HELP_STRING([--with-pkcs11-config=<dir>],
                           [directory to install PKCS#11 config])
            ])
if test -z "$with_pkcs11_config" ; then
	P11_SYSTEM_CONFIG_MODULES=$($PKG_CONFIG p11-kit-1 --variable=p11_system_config_modules)
else
	P11_SYSTEM_CONFIG_MODULES="$with_pkcs11_config"
fi
301
if test "$P11_SYSTEM_CONFIG_MODULES" = ""; then
302 303
	AC_MSG_ERROR([Could not find location for pkcs11 module config])
fi
Stef Walter's avatar
Stef Walter committed
304 305
AC_MSG_RESULT($P11_SYSTEM_CONFIG_MODULES)
AC_SUBST(P11_SYSTEM_CONFIG_MODULES)
306

Stef Walter's avatar
Stef Walter committed
307 308 309 310 311 312 313 314 315 316
AC_MSG_CHECKING([module path to install pkcs11 modules])
AC_ARG_WITH(pkcs11-modules, [
            AC_HELP_STRING([--with-pkcs11-modules=<dir>],
                           [directory to install PKCS#11 modules])
            ])
if test -z "$with_pkcs11_modules" ; then
	P11_MODULE_PATH=$($PKG_CONFIG p11-kit-1 --variable=p11_module_path)
else
	P11_MODULE_PATH="$with_pkcs11_modules"
fi
317
if test "$P11_MODULE_PATH" = ""; then
Stef Walter's avatar
Stef Walter committed
318
	AC_MSG_ERROR([Could not find directory to install pkcs11 modules])
319
fi
Stef Walter's avatar
Stef Walter committed
320 321
AC_MSG_RESULT($P11_MODULE_PATH)
AC_SUBST(P11_MODULE_PATH)
322 323 324 325

pkcs11standalonedir="${libdir}/gnome-keyring/devel"
AC_SUBST(pkcs11standalonedir)

326 327 328
# --------------------------------------------------------------------
# PAM Module Directory

329 330 331
AC_ARG_WITH([pam-dir],
            [AC_HELP_STRING([--with-pam-dir=DIR],
                             [directory to install pam modules in])],
332
             [], [with_pam_dir='${libdir}/security'])
333 334
PAM_DEST_DIR="$with_pam_dir"
AC_SUBST(PAM_DEST_DIR)
335

336
AM_CONDITIONAL(WITH_PAM, test "$have_pam" = "yes")
337

338 339 340 341
if test "$have_pam" = "yes"; then
	pam_status="yes ($with_pam_dir)"
fi

342 343 344 345
# --------------------------------------------------------------------
# SSH Agent support
#

346
AC_ARG_ENABLE([ssh-agent],
347 348 349 350 351 352 353 354 355 356 357
		AC_HELP_STRING([--disable-ssh-agent],
		[Don't include SSH agent in gnome-keyring]))

if test "$enable_ssh_agent" != "no"; then
	AC_DEFINE(WITH_SSH, 1, [Whether to build SSH agent or not])
	ssh_status="yes"
else
	ssh_status="no"
fi

AM_CONDITIONAL(WITH_SSH, test "$enable_ssh_agent" != "no")
358

359 360
# --------------------------------------------------------------------
# libgcrypt
361
#
362

363
AM_PATH_LIBGCRYPT($GCRYPT_LIBVER:$GCRYPT_REQ,,
364 365
	AC_MSG_ERROR([[
***
366 367 368 369 370
*** libgcrypt was not found. You may want to get it from
*** ftp://ftp.gnupg.org/gcrypt/libgcrypt/
***
]]))
libgcrypt=yes
371
AC_DEFINE_UNQUOTED(LIBGCRYPT_VERSION, "$GCRYPT_REQ", [Version of GCRYPT we expect])
372

373 374
DAEMON_CFLAGS="$DAEMON_CFLAGS $LIBGCRYPT_CFLAGS"
DAEMON_LIBS="$DAEMON_LIBS $LIBGCRYPT_LIBS"
Stefan Walter's avatar
Stefan Walter committed
375

376 377 378
AC_SUBST([LIBGCRYPT_CFLAGS])
AC_SUBST([LIBGCRYPT_LIBS])

379
# -------------------------------------------------------------------
380
# libcap-ng
381 382
#

383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402
AC_ARG_WITH([libcap-ng],
            [AC_HELP_STRING([--without-libcap-ng],
                            [build without libcap-ng (disables Linux capabilities support)])],,
            [with_libcap_ng=auto])

if test x"$with_libcap_ng" != x"no" ; then
    AC_CHECK_LIB([cap-ng], [capng_clear],
                 [
                   with_libcap_ng="yes"
                   AC_DEFINE([HAVE_LIBCAPNG], [1], [have libcap-ng headers and library])
                   DAEMON_LIBS="$DAEMON_LIBS -lcap-ng"
                 ],
                 [
                   if test x"$with_libcap_ng" = x"yes" ; then
                     AC_MSG_ERROR([libcap-ng support requested, but package not found])
                   else
                     AC_MSG_WARN([libcap-ng headers not installed])
                   fi
                   with_libcap_ng="no"
                 ])
403 404
fi

405 406
AM_CONDITIONAL([WITH_CAPS], [test x"$with_libcap_ng" = x"yes"])
libcapng_status="$with_libcap_ng"
407

408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426
# ----------------------------------------------------------------------
# selinux

LIBSELINUX=""
selinux_status="no"
AC_ARG_ENABLE([selinux],
        AC_HELP_STRING([--disable-selinux],[do not use SELinux]))
if test "x$enable_selinux" != "xno"; then
    AC_CHECK_LIB([selinux],[getfilecon],
        [AC_CHECK_LIB([selinux],[setexeccon],
            [AC_DEFINE([WITH_SELINUX], 1, [Defined if SE Linux support is compiled in])
             LIBSELINUX="-lselinux"
             selinux_status="yes"])
        ])
fi
AC_SUBST(LIBSELINUX)
AM_CONDITIONAL([HAVE_LIBSELINUX], [test ! -z "$LIBSELINUX"])

# ----------------------------------------------------------------------
427 428 429 430 431 432 433 434
# dotlock.c support

AC_DEFINE(DOTLOCK_USE_PTHREAD,1,[Define if POSIX threads are in use.])
AC_DEFINE(DOTLOCK_GLIB_LOGGING,1,[Define this to use Glib logging functions.])
AC_DEFINE_UNQUOTED(DOTLOCK_EXT_SYM_PREFIX,[_gkm_],
                  [Prefix used for external functions of dotlock.])

# ----------------------------------------------------------------------
435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453
# p11-tests

AC_ARG_ENABLE(p11_tests,
	AC_HELP_STRING([--disable-p11-tests],
	[Build in p11-tests for testing PKCS#11 modules]))

p11_tests_status="no"

if test "$enable_p11_tests" != "no"; then
	PKG_CHECK_MODULES(P11_TESTS, p11-tests >= 0.1,
	                  p11_tests_status=yes, p11_tests_status=no)
fi

AM_CONDITIONAL(WITH_P11_TESTS, test "$p11_tests_status" = "yes")

if test "$p11_tests_status" = "yes"; then
	AC_DEFINE_UNQUOTED(WITH_P11_TESTS, 1, [Run p11-tests module testing])
fi

454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484
# --------------------------------------------------------------------
# Documentation options

AC_MSG_CHECKING([whether to build documentation])
AC_ARG_ENABLE(doc,
              AC_HELP_STRING([--enable-doc],
                             [Disable building documentation])
             )

if test "$enable_doc" = "no"; then
	AC_MSG_RESULT($enable_doc)

else
	if test "$enable_doc" = ""; then
		disable_msg="(perhaps --disable-doc)"
	fi

	enable_doc="yes"
	AC_MSG_RESULT($enable_doc)

	AC_PATH_PROG([XSLTPROC], [xsltproc], [no])
	if test "$XSLTPROC" = "no"; then
		AC_MSG_ERROR([the xsltproc command was not found $disable_msg])
	fi

	AC_SUBST(XSLTPROC)
fi

AM_CONDITIONAL([ENABLE_DOC], [test "$enable_doc" = "yes"])
doc_status=$enable_doc

485
# --------------------------------------------------------------------
486
# Compilation and linking options
487 488 489 490
#

AC_MSG_CHECKING([for debug mode])
AC_ARG_ENABLE(debug,
491
              AC_HELP_STRING([--enable-debug=no/default/yes],
492 493 494 495 496
              [Turn on or off debugging]))

if test "$enable_debug" != "no"; then
	AC_DEFINE_UNQUOTED(WITH_DEBUG, 1, [Print debug output])
	AC_DEFINE_UNQUOTED(_DEBUG, 1, [In debug mode])
497
	CFLAGS="$CFLAGS -g"
498
fi
499

500 501 502
if test "$enable_debug" = "yes"; then
	debug_status="yes (-g, -O0, debug output, testable)"
	CFLAGS="$CFLAGS -O0"
503
elif test "$enable_debug" = "no"; then
504
	debug_status="no (no debug output, not testable, G_DISABLE_ASSERT)"
505 506
	AC_DEFINE_UNQUOTED(G_DISABLE_ASSERT, 1, [Disable glib assertions])
else
507
	debug_status="default (-g, debug output, testable)"
508
fi
Alexander Larsson's avatar
Alexander Larsson committed
509

510 511
AC_MSG_RESULT($debug_status)

512 513
AC_MSG_CHECKING(for more warnings)
if test "$GCC" = "yes"; then
Alexander Larsson's avatar
Alexander Larsson committed
514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539
	AC_MSG_RESULT(yes)
	CFLAGS="\
	-Wall \
	-Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
	-Wnested-externs -Wpointer-arith \
	-Wcast-align -Wsign-compare \
	$CFLAGS"

	for option in -Wno-strict-aliasing -Wno-sign-compare; do
		SAVE_CFLAGS="$CFLAGS"
		CFLAGS="$CFLAGS $option"
		AC_MSG_CHECKING([whether gcc understands $option])
		AC_TRY_COMPILE([], [],
			has_option=yes,
			has_option=no,)
		if test $has_option = no; then
			CFLAGS="$SAVE_CFLAGS"
		fi
		AC_MSG_RESULT($has_option)
		unset has_option
		unset SAVE_CFLAGS
	done
	unset option
else
	AC_MSG_RESULT(no)
fi
540

541 542 543
AC_ARG_ENABLE(strict, [
               AS_HELP_STRING([--enable-strict], [Strict code compilation])
             ])
544

545
AC_MSG_CHECKING([build strict])
546

547 548 549 550 551
if test "$enable_strict" = "yes"; then
	CFLAGS="$CFLAGS -Werror \
		-DGDK_DISABLE_DEPRECATED \
		-DG_DISABLE_DEPRECATED \
		-DGDK_PIXBUF_DISABLE_DEPRECATED"
552
	TEST_MODE="thorough"
553
	INTROSPECTION_FLAGS="--warn-error"
554 555
	AC_DEFINE_UNQUOTED(WITH_STRICT, 1, [More strict checks])
	strict_status="yes (-Werror, thorough tests, fatals, no deprecations)"
556 557
else
	TEST_MODE="quick"
558
	INTROSPECTION_FLAGS=""
559
	strict_status="no (quick tests, non-fatal warnings)"
560 561
fi

562
AC_MSG_RESULT($strict_status)
563
AC_SUBST(INTROSPECTION_FLAGS)
564
AC_SUBST(TEST_MODE)
565 566

AC_MSG_CHECKING([whether to build with gcov testing])
567 568
AC_ARG_ENABLE([coverage],
		AS_HELP_STRING([--enable-coverage],
569 570
			[Whether to enable coverage testing ]),
		[],
571
		[enable_coverage=no])
572

573
AC_MSG_RESULT([$enable_coverage])
574

575
if test "$enable_coverage" = "yes"; then
576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596
	if test "$GCC" != "yes"; then
		AC_MSG_ERROR(Coverage testing requires GCC)
	fi

	AC_PATH_PROG(GCOV, gcov, no)
	if test "$GCOV" = "no" ; then
		AC_MSG_ERROR(gcov tool is not available)
	fi

	AC_PATH_PROG(LCOV, lcov, no)
	if test "$LCOV" = "no" ; then
		AC_MSG_ERROR(lcov tool is not installed)
	fi

	AC_PATH_PROG(GENHTML, genhtml, no)
	if test "$GENHTML" = "no" ; then
		AC_MSG_ERROR(lcov's genhtml tool is not installed)
	fi

	CFLAGS="$CFLAGS -O0 -g -fprofile-arcs -ftest-coverage"
	LDFLAGS="$LDFLAGS -lgcov"
597 598
fi

599
AM_CONDITIONAL([WITH_COVERAGE], [test "$enable_coverage" = "yes"])
600 601 602 603
AC_SUBST(LCOV)
AC_SUBST(GCOV)
AC_SUBST(GENHTML)

604 605 606
AC_ARG_ENABLE(valgrind,
	AC_HELP_STRING([--enable-valgrind],
	[Run gnome-keyring-daemon using valgrind]))
607

608 609 610
AC_MSG_CHECKING([valgrind])
valgrind_status="yes"

611
AM_CONDITIONAL(WITH_VALGRIND, test "$enable_valgrind" = "run")
612 613

# Build valgrind support into code
614
if test "$enable_valgrind" = "yes"; then
615
	AC_CHECK_HEADER([valgrind/valgrind.h], have_valgrind=yes, have_valgrind=no)
616
	if test "$have_valgrind" = "no"; then
617 618 619 620
		AC_MSG_ERROR(The valgrind headers are missing)
	fi
	AC_DEFINE_UNQUOTED(WITH_VALGRIND, 1, [Run under valgrind])
	AC_MSG_RESULT(yes)
621 622


623 624 625 626 627 628
# No valgrind
else
	AC_MSG_RESULT(no)
	valgrind_status="no"
fi

629 630
# ----------------------------------------------------------------------

631
AC_SUBST(GKR_MAJOR)
632

633 634 635
AC_SUBST(DAEMON_CFLAGS)
AC_SUBST(DAEMON_LIBS)

636 637 638
AC_SUBST(P11_TESTS_CFLAGS)
AC_SUBST(P11_TESTS_LIBS)

Alexander Larsson's avatar
Alexander Larsson committed
639 640
AC_OUTPUT([
Makefile
641
pkcs11/rpc-layer/gnome-keyring.module
Alexander Larsson's avatar
Alexander Larsson committed
642 643
po/Makefile.in
])
644 645 646

# ------------------------------------------------------------------------------
# Summary
647
#
648 649 650

echo
echo "OPTIONAL DEPENDENCIES"
651
echo "  PAM:                  $pam_status"
652
echo "  Linux capabilities:   $libcapng_status"
653
echo "  SELinux:              $selinux_status"
654 655
echo
echo "CONFIGURATION"
656
echo "  SSH Agent:            $ssh_status"
657 658 659
echo
echo "BUILD"
echo "  Debug Build:          $debug_status"
660
echo "  Strict Compilation:   $strict_status"
661
echo "  Valgrind:             $valgrind_status"
662
echo "  PKCS#11 Tests         $p11_tests_status"
663
echo "  Test Coverage:        $enable_coverage"
664
echo "  Documentation:        $doc_status"
665
echo