~ubuntu-branches/ubuntu/oneiric/seahorse/oneiric-proposed-201111150713

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
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
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
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
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
dnl Process this file with autoconf to produce a configure script.

AC_PREREQ(2.52)

dnl ****************************************************************************
dnl MAIN SEAHORSE VERSION (update after release)

AC_INIT(seahorse, 3.0.2)

dnl ****************************************************************************
dnl LIBCRYPTUI libtool versioning
dnl CURRENT : REVISION : AGE
dnl   +1    :     0    : +1   == new interface that does not break old one.
dnl   +1    :     0    :  0   == removed an interface. Breaks old apps.
dnl    ?    :    +1    :  ?   == internal changes that doesn't break anything.

LIBCRYPTUI_CURRENT=0
LIBCRYPTUI_REVISION=0
LIBCRYPTUI_AGE=0

dnl ****************************************************************************

AC_CONFIG_SRCDIR(src/seahorse-main.c)
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
AM_CONFIG_HEADER(config.h)
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AM_MAINTAINER_MODE
AC_CONFIG_MACRO_DIR([m4])

AC_PROG_CC
AC_PROG_CXX
AC_PROG_INTLTOOL([0.35.0])
AM_PROG_LIBTOOL
AM_GCONF_SOURCE_2
GNOME_DOC_INIT
GTK_DOC_CHECK([1.9])

dnl Get the off_t size right
AC_SYS_LARGEFILE
AC_TYPE_OFF_T
AC_FUNC_FSEEKO

AC_CHECK_FUNCS(setresuid setresgid)
AC_CHECK_FUNCS(strsep)

AC_PATH_PROG(PKG_CONFIG, pkg-config, no)

AC_MSG_CHECKING([which GTK+ version to compile against])
AC_ARG_WITH([gtk],
	[AS_HELP_STRING([--with-gtk=2|3],[which GTK+ version to compile against (default: 3)])],
	[case "$with_gtk" in
		2*|3*) ;;
		*) AC_MSG_ERROR([invalid GTK+ version specified]) ;;
	esac],
	[with_gtk=3])
AC_MSG_RESULT([$with_gtk])

case "$with_gtk" in
	2*)
		GCR_LIBRARY=gcr-0
		GTK_API_VERSION=2.0
		GTK_REQUIRED=2.20.0
		with_gtk=2.0
	;;
	3*)
		GCR_LIBRARY=gcr-3
		GTK_API_VERSION=3.0
		GTK_REQUIRED=2.90.0
		with_gtk=3.0
	;;
esac

AC_SUBST(GTK_API_VERSION)
AM_CONDITIONAL([WITH_GTK3],[test "$with_gtk" = "3.0"])

PKG_CHECK_MODULES(GTK, gtk+-$GTK_API_VERSION >= $GTK_REQUIRED)
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)

PKG_CHECK_MODULES(SEAHORSE, gmodule-2.0 gio-2.0 gconf-2.0 gthread-2.0 gtk+-$GTK_API_VERSION >= $GTK_REQUIRED launchpad-integration-3.0)

AC_MSG_CHECKING([for some Win32 platform])
case "$host" in
  *-*-cygwin*|*-*-mingw*)
    platform_win32=yes
    ;;
  *)
    platform_win32=no
    ;;
esac
AC_MSG_RESULT([$platform_win32])
AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")

AC_MSG_CHECKING([for native Win32])
case "$host" in
  *-*-mingw*)
    os_win32=yes
    ;;
  *)
    os_win32=no
    ;;
esac
AC_MSG_RESULT([$os_win32])
AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")

if test "$platform_win32" = "yes" ; then
	PLUGIN_LIBTOOL_FLAGS="-module -avoid-version -no-undefined"
else
	PLUGIN_LIBTOOL_FLAGS="-module -avoid-version"
fi
AC_SUBST(PLUGIN_LIBTOOL_FLAGS)

dnl **************************************************************
dnl GPG / GPGME CHECKS
dnl **************************************************************

AC_ARG_ENABLE(pgp,
	AC_HELP_STRING([--enable-pgp], [enable PGP support (default is auto)]))
	
have_gpg=""
have_gpgme=""

if test "$enable_pgp" = "no"; then
	echo "disabling PGP support"
else
	AC_ARG_ENABLE(gpg-check, 
		AC_HELP_STRING([--disable-gpg-check], [check GPG version (default is yes)]),
		DO_CHECK=$enableval, DO_CHECK=yes)
	
	if test	"$DO_CHECK" = "yes"; then
		accepted_versions="1.2 1.4 2.0"
		AC_PATH_PROGS(GNUPG, [gpg gpg2], no)
		AC_DEFINE_UNQUOTED(GNUPG, "$GNUPG", [Path to gpg executable.])
		ok="no"
		if test "$GNUPG" != "no"; then
			AC_MSG_CHECKING(for appropriate GnuPG version)
			gnupg_version=`$GNUPG --version | grep gpg`
			major=`echo $gnupg_version | \
				sed 's/^gpg (GnuPG) \([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
			minor=`echo $gnupg_version | \
				sed 's/^gpg (GnuPG) \([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
			micro=`echo $gnupg_version | \
				sed 's/^gpg (GnuPG) \([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
    
			for ver in $accepted_versions; do
				if test "$ver" = "$major.$minor"; then
					AC_DEFINE_UNQUOTED(GPG_MAJOR, [$major], [GPG Major Version])
					AC_DEFINE_UNQUOTED(GPG_MINOR, [$minor], [GPG Minor Version])
					AC_DEFINE_UNQUOTED(GPG_MICRO, [$micro], [GPG Micro Version])
					ok="yes"
					break
				fi
			done
		fi
  
		if test "$ok" = "yes"; then
			AC_MSG_RESULT([yes])
			have_gpg="$gnupg_version"
		else
			AC_MSG_RESULT([no])
		fi
	fi


	ok="no"
	min_gpgme_version=1.0.0
	AC_PATH_PROG(GPGME_CONFIG, gpgme-config, "failed")
	if test $GPGME_CONFIG != "failed" ; then
      		AC_MSG_CHECKING(for GPGME - version >= $min_gpgme_version)
		req_major=`echo $min_gpgme_version | \
			sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
		req_minor=`echo $min_gpgme_version | \
			sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
		req_micro=`echo $min_gpgme_version | \
			sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
		gpgme_config_version=`$GPGME_CONFIG --version`
		major=`echo $gpgme_config_version | \
			sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
		minor=`echo $gpgme_config_version | \
			sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
		micro=`echo $gpgme_config_version | \
			sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`

		if test "$major" -eq "$req_major"; then
			if test "$minor" -ge "$req_minor"; then
				if test "$micro" -ge "$req_micro"; then
					ok="yes"
				fi
			fi
		fi
	fi

	if test $ok = "yes"; then
		GPGME_CFLAGS=`$GPGME_CONFIG --cflags`
		GPGME_LIBS=`$GPGME_CONFIG --libs`
		AC_MSG_RESULT(yes)
		have_gpgme="$gpgme_config_version"
	else
		AC_MSG_RESULT(no)
	fi
fi

if test "$enable_pgp" != "no" -a -n "$have_gpg" -a -n "$have_gpgme"; then
	enable_pgp="yes"
fi

if test "$enable_pgp" = "yes"; then
	if test -z "$have_gpg"; then
		AC_MSG_ERROR([Appropriate version of GnuPG not found. Please install one of versions: $accepted_versions])
	fi
			
	if test -z "$have_gpgme"; then
		AC_MSG_ERROR(GPGME $min_gpgme_version or later needed)
	fi

	SEAHORSE_CFLAGS="$SEAHORSE_CFLAGS $GPGME_CFLAGS"
	SEAHORSE_LIBS="$SEAHORSE_LIBS $GPGME_LIBS"
        AC_DEFINE(WITH_PGP, 1, [With PGP Support])
fi

AM_CONDITIONAL(WITH_PGP, test "$enable_pgp" = "yes")

dnl ******************************************************************************
dnl LDAP [from gpg]
dnl ******************************************************************************

AC_MSG_CHECKING([LDAP keyserver support])
AC_ARG_ENABLE(ldap,
[  --disable-ldap          disable LDAP keyserver interface],
    try_ldap=$enableval, try_ldap=yes)

if test "$enable_pgp" != "yes"; then
	echo "LDAP keyserver interface requires PGP support"
	try_ldap=no
fi

AC_MSG_RESULT($try_ldap)
with_ldap=no

dnl Must check for network library requirements before doing link tests
dnl for ldap, for example. If ldap libs are static (or dynamic and without
dnl ELF runtime link paths), then link will fail and LDAP support won't
dnl be detected.

AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname,
	[NETLIBS="-lnsl $NETLIBS"]))
AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt,
	[NETLIBS="-lsocket $NETLIBS"]))
	
dnl Try and link a LDAP test program to weed out unusable LDAP
dnl libraries.  -lldap [-llber [-lresolv]] is for OpenLDAP.  OpenLDAP in
dnl general is terrible with creating weird dependencies.  If all else
dnl fails, the user can play guess-the-dependency by using something
dnl like LDAP_LIBS="-lfoo" ./configure

if test "$try_ldap" = yes ; then
  for MY_LDAPLIBS in ${LDAP_LIBS+"$LDAP_LIBS"} "-lldap" "-lldap -llber" "-lldap -llber -lresolv"; do
    _ldap_save_libs=$LIBS
    LIBS="$MY_LDAPLIBS $NETLIBS $LIBS"

    AC_MSG_CHECKING([whether LDAP via \"$MY_LDAPLIBS\" is present and sane])
    AC_TRY_LINK([#include <ldap.h>],[ldap_open("foobar",1234);],
                [cv_func_ldap_init=yes],[cv_func_ldap_init=no])
    AC_MSG_RESULT([$cv_func_ldap_init])

    if test $cv_func_ldap_init = no; then
      AC_MSG_CHECKING([whether I can make LDAP be sane with lber.h])
      AC_TRY_LINK([#include <lber.h>
#include <ldap.h>],[ldap_open("foobar",1234);],
         [cv_func_ldaplber_init=yes],[cv_func_ldaplber_init=no])
      AC_MSG_RESULT([$cv_func_ldaplber_init])
    fi

    if test "$cv_func_ldaplber_init" = yes ; then
       AC_DEFINE(NEED_LBER_H,1,[Define if the LDAP library requires including lber.h before ldap.h])
    fi

    if test "$cv_func_ldap_init" = yes || \
  	test "$cv_func_ldaplber_init" = yes ; then
       LDAP_LIBS=$MY_LDAPLIBS
    fi

    LIBS=$_ldap_save_libs

    if test "$LDAP_LIBS" != ""; then 
    	with_keyserver=yes
        with_ldap=yes
		AC_DEFINE(WITH_LDAP, 1, [Support for LDAP operations])
    	break
    fi
  done
fi	

AM_CONDITIONAL(WITH_LDAP, test "$with_ldap" = "yes")
SEAHORSE_LIBS="$SEAHORSE_LIBS $LDAP_LIBS"

AC_SUBST(NETLIBS)


dnl ****************************************************************************
dnl HKP (libsoup)
dnl ****************************************************************************

# Allow hkp to be disabled 
AC_ARG_ENABLE(hkp,
        AC_HELP_STRING([--disable-hkp],
        [disable HKP keyserver interface]))

# HKP tests
if test "$enable_pgp" != "yes"; then
	echo "HKP keyserver interface requires PGP support"
	enable_hkp=no
fi
 
if test "$enable_hkp" = "no"; then
    echo "disabling HKP keyserver interface"
else
    
    echo "checking for supported versions of libsoup..."

    PKG_CHECK_MODULES(SOUP, libsoup-2.4, 
        [enable_hkp=yes],  
        [enable_hkp=no])

    if test "$enable_hkp" = yes; then
        with_keyserver=yes
        
        AC_DEFINE(WITH_HKP, 1, [Support for HKP operations])
        SEAHORSE_LIBS="$SEAHORSE_LIBS $SOUP_LIBS"
        SEAHORSE_CFLAGS="$SEAHORSE_CFLAGS $SOUP_CFLAGS"
        
        # libsoup is also used for async lookups
        AC_DEFINE(WITH_SOUP, 1, [With libsoup])
    fi
fi

AM_CONDITIONAL(WITH_HKP, test "$enable_hkp" = "yes")


dnl ***************
dnl KEYSERVER
dnl ***************

AM_CONDITIONAL(WITH_KEYSERVER, test "$with_keyserver" = "yes")

if test "$with_keyserver" = "yes"; then
	echo "enabling key server support"
	AC_DEFINE(WITH_KEYSERVER, 1, [Support for key server actions])
else
    with_keyserver=no
	echo "disabling key server support"
fi


dnl ****************************************************************************
dnl GNOME-KEYRING
dnl ****************************************************************************

PKG_CHECK_MODULES([GNOME_KEYRING], gnome-keyring-1 >= 2.25.5,
                  [enable_gnome_keyring=yes],[enable_gnome_keyring=no])

if test "$enable_gnome_keyring" = "no"; then
    AC_MSG_ERROR([gnome-keyring library or headers not found.])
fi

SEAHORSE_CFLAGS="$SEAHORSE_CFLAGS $GNOME_KEYRING_CFLAGS"
SEAHORSE_LIBS="$SEAHORSE_LIBS $GNOME_KEYRING_LIBS"
        

dnl *******************
dnl KEY SHARING 
dnl *******************

AVAHI_GLIB_REQUIRED=0.6

# Allow sharing to be disabled
AC_ARG_ENABLE(sharing, 
        AC_HELP_STRING([--disable-sharing],
        [Don't compile in DNS-SD key sharing]))

if test "$enable_pgp" != "yes"; then
	echo "DNS-SD key sharing requires PGP support"
	enable_sharing=no
fi
	
if test "$enable_hkp" = "no"; then
    	echo "DNS-SD key sharing requires HKP support"
	enable_sharing=no
fi

if test "$enable_sharing" = "no"; then
    echo "disabling DNS-SD key sharing"
else

    PKG_CHECK_MODULES(SHARING, avahi-client avahi-glib >= $AVAHI_GLIB_REQUIRED, 
        [enable_sharing=yes],  
        [enable_sharing=no])
		
	if test "$enable_sharing" = "yes"; then
		echo "enabling key sharing"
		
		AC_DEFINE_UNQUOTED(WITH_SHARING, 1, [Compile bonjour key sharing code])
		SEAHORSE_CFLAGS="$SEAHORSE_CFLAGS $SHARING_CFLAGS"
		SEAHORSE_LIBS="$SEAHORSE_LIBS $SHARING_LIBS"
    fi
fi

AM_CONDITIONAL(WITH_SHARING, test "$enable_sharing" = "yes")


dnl ****************************************************************************
dnl DBUS
dnl ****************************************************************************

DBUS_GLIB_REQUIRED=0.35

PKG_CHECK_MODULES([DBUS], [dbus-glib-1 >= $DBUS_GLIB_REQUIRED], [enable_dbus=yes],[enable_dbus=no])
if test "$enable_dbus" = "no"; then
    AC_MSG_ERROR([dbus or dbus-glib-1 bindings not found.])
fi

AC_SUBST([DBUS_CFLAGS])
AC_SUBST([DBUS_LIBS])

AC_PATH_PROG([DBUS_BINDING_TOOL], [dbus-binding-tool], [no])
if test x$DBUS_BINDING_TOOL = "xno" ; then
    AC_MSG_ERROR([dbus-binding-tool executable not found in your path - should be installed with dbus glib bindings])
fi

SEAHORSE_CFLAGS="$SEAHORSE_CFLAGS $DBUS_CFLAGS"
SEAHORSE_LIBS="$SEAHORSE_LIBS $DBUS_LIBS"

dnl *******************
dnl LIBNOTIFY
dnl *******************

LIBNOTIFY_REQUIRED=0.3

# Allow libnotify to be disabled
AC_ARG_ENABLE(libnotify, 
        AC_HELP_STRING([--disable-libnotify],
        [Don't compile in libnotify support]))   
        
if test "x$enable_libnotify" = "xno"; then
    echo "disabling libnotify support"
else

    PKG_CHECK_MODULES(LIBNOTIFY, [libnotify >= $LIBNOTIFY_REQUIRED], 
                      enable_libnotify=yes, enable_libnotify=no)
    if test "$enable_libnotify" = "yes"; then
        
        AC_DEFINE(HAVE_LIBNOTIFY, 1, [libnotify available])
        
        SEAHORSE_CFLAGS="$SEAHORSE_CFLAGS $LIBNOTIFY_CFLAGS"
        SEAHORSE_LIBS="$SEAHORSE_LIBS $LIBNOTIFY_LIBS"
    fi
fi

dnl ****************************************************************************
dnl  PKCS11
dnl ****************************************************************************

AC_ARG_ENABLE(pkcs11,
	AC_HELP_STRING([--disable-pkcs11],
		[Support keys and certificates via PKCS#11]))

if test "$enable_pkcs11" = "no"; then
	echo "disabling pkcs11 support"
	enable_pkcs11="no"
else
	PKG_CHECK_MODULES(GCR, $GCR_LIBRARY >= 2.91.2, gcr_is_present="yes", gcr_is_present="no")
	if test "$gcr_is_present" = "no"; then
		echo "disabling pkcs11 support"
	fi
	PKG_CHECK_MODULES(GCK, gck-0 >= 2.91.2, enable_pkcs11="yes", enable_pkcs11="no")
	if test "$enable_pkcs11" = "yes" && test "$gcr_is_present" = "yes"; then
		AC_DEFINE(WITH_PKCS11, 1, [gck library available])
		SEAHORSE_CFLAGS="$SEAHORSE_CFLAGS $GCK_CFLAGS $GCR_CFLAGS"
		SEAHORSE_LIBS="$SEAHORSE_LIBS $GCK_LIBS $GCR_LIBS"
	else
		enable_pkcs11="no"
	fi
fi

AM_CONDITIONAL(WITH_PKCS11, test "$enable_pkcs11" = "yes")

dnl ****************************************************************************
dnl  SSH 
dnl ****************************************************************************

AC_ARG_ENABLE(ssh,
        AC_HELP_STRING([--disable-ssh], 
        [Support for managing SSH keys]))
        
if test "x$enable_ssh" = "xno"; then
    echo "disabling ssh support"
else

#    AC_PATH_PROG(SSH_KEYGEN_PATH, ssh-keygen, "failed")
#    AC_PATH_PROG(SSH_PATH, ssh, "failed")
    
#    if test $SSH_KEYGEN_PATH != "failed" && i
#       test $SSH_PATH != "failed"; then
        enable_ssh="yes"
        AC_DEFINE(WITH_SSH, 1, [With SSH Support])
        AC_DEFINE_UNQUOTED(SSH_KEYGEN_PATH, "/usr/bin/ssh-keygen", [Path to ssh-keygen])
        AC_DEFINE_UNQUOTED(SSH_PATH, "/usr/bin/ssh", [Path to ssh])
#    fi
    
fi

AM_CONDITIONAL(WITH_SSH, test "$enable_ssh" = "yes")

dnl ****************************************************************************

# Debug mode
AC_ARG_ENABLE(debug, 
	    AC_HELP_STRING([--enable-debug],
	    [Compile binaries in debug mode]))

if test "$enable_debug" = "yes"; then
  CFLAGS="$CFLAGS -g -O0 -DBONOBO_DISABLE_DEPRECATED -DG_DISABLE_DEPRECATED -Wall"
  AC_DEFINE_UNQUOTED(_DEBUG, 1, [In debug mode])
  echo "enabling debug compile mode"
else 
  dnl AC_DEFINE_UNQUOTED(G_DISABLE_ASSERT, 1, [Disable glib assertions])
  echo "disabling debug compile mode"
fi

# Fatal Messages mode
AC_ARG_ENABLE(fatal-messages, 
	    AC_HELP_STRING([--enable-fatal-messages],
	    [Don't make compile and or runtime messages fatal in debug mode.]))

if test "$enable_fatal_messages" = "yes" && test "$enable_debug" = "yes"; then
    CFLAGS="$CFLAGS -Wall -Werror"
    AC_DEFINE_UNQUOTED(FATAL_MESSAGES, 1, [Fatal runtime messages])
    echo "enabling fatal runtime messages"
fi

# Build Tests
AC_ARG_ENABLE(tests,
        AC_HELP_STRING([--enable-tests],
        [Compile Test Programs]))
        
if test "$enable_tests" != "yes"; then
    enable_tests="no"
fi

AM_CONDITIONAL(WITH_TESTS, test "$enable_tests" = "yes")

dnl ****************************************************************************
dnl LIBCRYPTUI
dnl ****************************************************************************
   
LIBCRYPTUI_LT_RELEASE=$LIBCRYPTUI_CURRENT:$LIBCRYPTUI_REVISION:$LIBCRYPTUI_AGE
AC_SUBST(LIBCRYPTUI_LT_RELEASE)

LIBCRYPTUI_MAJOR=$LIBCRYPTUI_CURRENT.$LIBCRYPTUI_REVISION
AC_SUBST(LIBCRYPTUI_MAJOR)

PKG_CHECK_MODULES(LIBCRYPTUI, gtk+-$GTK_API_VERSION >= $GTK_REQUIRED gconf-2.0)

cryptuitargetlib=libcryptui.la
AC_SUBST(cryptuitargetlib)

LIBCRYPTUI_CFLAGS="$LIBCRYPTUI_CFLAGS $DBUS_CFLAGS"
LIBCRYPTUI_LIBS="$LIBCRYPTUI_LIBS $DBUS_LIBS"
AC_SUBST(LIBCRYPTUI_CFLAGS)
AC_SUBST(LIBCRYPTUI_LIBS)

GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
ATK_PREFIX="`$PKG_CONFIG --variable=prefix atk`"
PANGO_PREFIX="`$PKG_CONFIG --variable=prefix pango`"
CAIRO_PREFIX="`pkg-config --variable=prefix cairo`" 

AC_SUBST(GLIB_PREFIX)
AC_SUBST(ATK_PREFIX)
AC_SUBST(PANGO_PREFIX)
AC_SUBST(CAIRO_PREFIX)

dnl ****************************************************************************
dnl GObject Introspection
dnl ****************************************************************************

GOBJECT_INTROSPECTION_CHECK([0.6.4])

dnl ****************************************************************************

AC_SUBST(SEAHORSE_CFLAGS)
AC_SUBST(SEAHORSE_LIBS)

AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)

AC_ARG_ENABLE(update-mime-database,
	AC_HELP_STRING([--disable-update-mime-database],
	[do not run the update-mime-database utility (mostly useful for package maintainers) ]))
AM_CONDITIONAL(UPDATE_MIME_DATABASE, test "$enable_update_mime_database" != "no")

dnl *******************
dnl ***** gettext *****
dnl *******************

GETTEXT_PACKAGE=seahorse
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of the gettext domain.])

AM_GLIB_GNU_GETTEXT

dnl ****************************************************************************
## here we get the flags we'll actually use
PKG_CHECK_MODULES(EGG, gtk+-$GTK_API_VERSION >= $GTK_REQUIRED)
AC_SUBST(EGG_LIBS)
AC_SUBST(EGG_CFLAGS)

PKG_CHECK_MODULES(EGG_SMCLIENT, gtk+-$GTK_API_VERSION)
AC_SUBST(EGG_SMCLIENT_LIBS)
AC_SUBST(EGG_SMCLIENT_CFLAGS)

dnl ****************************************************************************

AC_OUTPUT([
Makefile
seahorse.spec
common/Makefile
gkr/Makefile
libcryptui/cryptui.pc
libcryptui/Makefile
libcryptui/tests/Makefile
libegg/Makefile
libseahorse/Makefile
pgp/Makefile
po/Makefile.in
help/Makefile
data/Makefile
data/icons/Makefile
pixmaps/Makefile
pixmaps/22x22/Makefile
pixmaps/48x48/Makefile
pixmaps/scalable/Makefile
pkcs11/Makefile
src/Makefile
src/seahorse.desktop.in
ssh/Makefile
daemon/Makefile
reference/Makefile
reference/libcryptui/Makefile
reference/libcryptui/version.xml
reference/libseahorse/Makefile
reference/libseahorse/version.xml
])

dnl ****************************************************************************
dnl  SUMMARY
dnl ****************************************************************************

echo "
GTK+ Version:               $GTK_API_VERSION
PKCS11 Support:             $enable_pkcs11
PGP Support:                $enable_pgp
  GnuPG Version:            $have_gpg
  GPGME Version:            $have_gpgme
SSH Support:                $enable_ssh
Keyserver Support:          $with_keyserver
  LDAP:                     $with_ldap
  HKP:                      $enable_hkp
  Key Sharing:              $enable_sharing
Notification Support:       $enable_libnotify
Build introspection data:   ${enable_introspection}
"