File: configure.ac

package info (click to toggle)
certmonger 0.75.14-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 8,540 kB
  • ctags: 2,176
  • sloc: ansic: 41,340; sh: 9,551; makefile: 528; python: 207; xml: 190; sed: 16
file content (696 lines) | stat: -rw-r--r-- 28,827 bytes parent folder | download
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
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
AC_INIT(certmonger,0.75.14)
AM_INIT_AUTOMAKE([foreign subdir-objects])
AC_CONFIG_MACRO_DIR(m4)
AM_MAINTAINER_MODE([enable])
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_RANLIB
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION(0.17)
AM_ICONV
ALL_LINGUAS="`ls -1 $srcdir/po/*.po | xargs -n 1 basename | xargs -n 1 -I'{}' basename '{}' .po`"
if test x$GCC = xyes ; then
	CFLAGS="$CFLAGS -Wall -Wextra"
fi
AC_CONFIG_HEADER(src/config.h)

mysbindir="$sbindir"
mysbindir=`eval echo $mysbindir | sed "s,NONE,$prefix,g"`
mysbindir=`eval echo $mysbindir | sed "s,NONE,$exec_prefix,g"`
mysbindir=`eval echo $mysbindir | sed "s,NONE,$ac_default_prefix,g"`
mysbindir=`eval echo $mysbindir | sed "s,NONE,,g"`
AC_SUBST(mysbindir)

UPCASE_PACKAGE_NAME=`echo "${PACKAGE_NAME}" | tr '[a-z]' '[A-Z]'`
mysysconfdir="$sysconfdir"
mysysconfdir=`eval echo $mysysconfdir | sed "s,NONE,$prefix,g"`
mysysconfdir=`eval echo $mysysconfdir | sed "s,NONE,$ac_default_prefix,g"`
mysysconfdir=`eval echo $mysysconfdir | sed "s,NONE,,g"`
AC_DEFINE_UNQUOTED(CM_STORE_CONFIG_DIRECTORY,"$mysysconfdir/${PACKAGE_NAME}",
		   [Define to the directory which holds configuration files.])
AC_DEFINE_UNQUOTED(CM_STORE_SESSION_CONFIG_DIRECTORY,".config/" PACKAGE_NAME,
		   [Define to the directory which holds user configuration files.])
AC_DEFINE_UNQUOTED(CM_STORE_CONFIG_DIRECTORY_ENV,"${UPCASE_PACKAGE_NAME}_CONFIG_DIR",
		   [Define to the name of the environment variable which can specify the directory which holds configuration files.])
CM_STORE_CONFIG_DIRECTORY_ENV="${UPCASE_PACKAGE_NAME}_CONFIG_DIR"
AC_SUBST(CM_STORE_CONFIG_DIRECTORY_ENV)
mylibexecdir="$libexecdir/${PACKAGE_NAME}"
mylibexecdir=`eval echo $mylibexecdir | sed "s,NONE,$prefix,g"`
mylibexecdir=`eval echo $mylibexecdir | sed "s,NONE,$ac_default_prefix,g"`
mylibexecdir=`eval echo $mylibexecdir | sed "s,NONE,,g"`
AC_SUBST(mylibexecdir)
AC_ARG_WITH(file-store-dir,
AS_HELP_STRING([--with-file-store-dir=/var/lib/certmonger],[directory to use for storing data]),
mylocalstatedir=$withval,
mylocalstatedir="$localstatedir/lib/${PACKAGE_NAME}")
mylocalstatedir=`eval echo $mylocalstatedir | sed "s,NONE,$prefix,g"`
mylocalstatedir=`eval echo $mylocalstatedir | sed "s,NONE,$ac_default_prefix,g"`
mylocalstatedir=`eval echo $mylocalstatedir | sed "s,NONE,,g"`

CM_STORE_REQUESTS_DIRECTORY="$mylocalstatedir/requests"
CM_STORE_REQUESTS_DIRECTORY_ENV="${UPCASE_PACKAGE_NAME}_REQUESTS_DIR"
AC_SUBST(CM_STORE_REQUESTS_DIRECTORY)
AC_SUBST(CM_STORE_REQUESTS_DIRECTORY_ENV)
AC_DEFINE_UNQUOTED(CM_STORE_REQUESTS_DIRECTORY,"${CM_STORE_REQUESTS_DIRECTORY}",
		   [Define to the default path for request tracking files.])
AC_DEFINE_UNQUOTED(CM_STORE_SESSION_REQUESTS_DIRECTORY,".config/" PACKAGE_NAME "/requests",
		   [Define to the default path for user request tracking files.])
AC_DEFINE_UNQUOTED(CM_STORE_REQUESTS_DIRECTORY_ENV,"${CM_STORE_REQUESTS_DIRECTORY_ENV}",
		   [Define to the name of the environment variable which can specify the directory for tracking requests.])

CM_STORE_CAS_DIRECTORY="$mylocalstatedir/cas"
CM_STORE_CAS_DIRECTORY_ENV="${UPCASE_PACKAGE_NAME}_CAS_DIR"
AC_SUBST(CM_STORE_CAS_DIRECTORY)
AC_SUBST(CM_STORE_CAS_DIRECTORY_ENV)
AC_DEFINE_UNQUOTED(CM_STORE_CAS_DIRECTORY,"${CM_STORE_CAS_DIRECTORY}",
		   [Define to the default path for CA tracking files.])
AC_DEFINE_UNQUOTED(CM_STORE_SESSION_CAS_DIRECTORY,".config/" PACKAGE_NAME "/cas",
		   [Define to the default path for user CA tracking files.])
AC_DEFINE_UNQUOTED(CM_STORE_CAS_DIRECTORY_ENV,"${CM_STORE_CAS_DIRECTORY_ENV}",
		   [Define to the name of the environment variable which can specify the directory for tracking CAs.])

CM_STORE_LOCAL_CA_DIRECTORY="$mylocalstatedir/local"
CM_STORE_SESSION_LOCAL_CA_DIRECTORY=".config/${PACKAGE_NAME}/local"
CM_STORE_LOCAL_CA_DIRECTORY_ENV="${UPCASE_PACKAGE_NAME}_LOCAL_CA_DIR"
AC_SUBST(CM_STORE_LOCAL_CA_DIRECTORY)
AC_SUBST(CM_STORE_LOCAL_CA_DIRECTORY_ENV)
AC_DEFINE_UNQUOTED(CM_STORE_LOCAL_CA_DIRECTORY,"${CM_STORE_LOCAL_CA_DIRECTORY}",
		   [Define to the default path for data belonging to the local CA.])
AC_DEFINE_UNQUOTED(CM_STORE_SESSION_LOCAL_CA_DIRECTORY,"${CM_STORE_SESSION_LOCAL_CA_DIRECTORY}",
		   [Define to the default path for data belonging to the user CA.])
AC_DEFINE_UNQUOTED(CM_STORE_LOCAL_CA_DIRECTORY_ENV,"${CM_STORE_LOCAL_CA_DIRECTORY_ENV}",
		   [Define to the name of the environment variable which can specify the directory for the local CA.])

AC_ARG_WITH(homedir,
AS_HELP_STRING([--with-homedir=/],[directory to set as $HOME when running subprocesses as root]),
myhomedir=$withval,
myhomedir=/)
myhomedir=`eval echo $myhomedir | sed "s,NONE,$prefix,g"`
myhomedir=`eval echo $myhomedir | sed "s,NONE,$ac_default_prefix,g"`
myhomedir=`eval echo $myhomedir | sed "s,NONE,,g"`
CM_HOMEDIR="$myhomedir"
AM_CONDITIONAL(HOMEDIR,test x$CM_HOMEDIR != x)
AC_DEFINE_UNQUOTED(CM_HOMEDIR,"$CM_HOMEDIR",[Define to the default location to be used for storing temporary files.])
AC_SUBST(CM_HOMEDIR)

AC_ARG_WITH(tmpdir,
AS_HELP_STRING([--with-tmpdir=NONE],[directory to use for temporary storage]),
mytmpdir=$withval,
mytmpdir=)
mytmpdir=`eval echo $mytmpdir | sed "s,NONE,$prefix,g"`
mytmpdir=`eval echo $mytmpdir | sed "s,NONE,$ac_default_prefix,g"`
mytmpdir=`eval echo $mytmpdir | sed "s,NONE,,g"`
CM_TMPDIR="$mytmpdir"
AM_CONDITIONAL(TMPDIR,test x$CM_TMPDIR != x)
AC_DEFINE_UNQUOTED(CM_TMPDIR,"$CM_TMPDIR",[Define to the default location to be used for storing temporary files.])
CM_TMPDIR_ENV="${UPCASE_PACKAGE_NAME}_TMPDIR"
AC_DEFINE_UNQUOTED(CM_TMPDIR_ENV,"${CM_TMPDIR_ENV}",[Define to the default location to be used for storing temporary files.])
AC_SUBST(CM_TMPDIR)
AC_SUBST(CM_TMPDIR_ENV)

CM_NOTIFICATION_ENV="${UPCASE_PACKAGE_NAME}_NOTIFICATION"
AC_DEFINE_UNQUOTED(CM_NOTIFICATION_ENV,"${CM_NOTIFICATION_ENV}",[Define to the variable name to be used to hold a notification message.])
AC_SUBST(CM_NOTIFICATION_ENV)

mylocaledir="$localedir"
mylocaledir=`eval echo $mylocaledir | sed "s,NONE,$prefix,g"`
mylocaledir=`eval echo $mylocaledir | sed "s,NONE,$ac_default_prefix,g"`
mylocaledir=`eval echo $mylocaledir | sed "s,NONE,,g"`
AC_DEFINE_UNQUOTED(MYLOCALEDIR,"$mylocaledir",
		   [Define to the name of the directory under which locale data will be installed.])

CM_DBUS_NAME=org.fedorahosted.certmonger
AC_DEFINE_UNQUOTED(CM_DBUS_NAME,"$CM_DBUS_NAME",
		   [Define to the name of the certmonger service.])
AC_SUBST(CM_DBUS_NAME)
CM_DBUS_BASE_PATH=/org/fedorahosted/certmonger
AC_DEFINE_UNQUOTED(CM_DBUS_BASE_PATH,"$CM_DBUS_BASE_PATH",
		   [Define to the path of the certmonger main node.])
AC_DEFINE_UNQUOTED(CM_DBUS_RECONNECT_TIMEOUT,30,
		   [Define to the amount of time to wait between attempts to reconnect to the message bus if we get disconnected.])

if ! ${configure_dist_target_only:-false} ; then
	AC_CHECK_HEADERS(sys/types.h sys/socket.h linux/types.h linux/netlink.h linux/rtnetlink.h,,,[
		#ifdef HAVE_SYS_TYPES_H
		#include <sys/types.h>
		#endif
		#ifdef HAVE_SYS_SOCKET_H
		#include <sys/socket.h>
		#endif
		#ifdef HAVE_LINUX_TYPES_H
		#include <linux/types.h>
		#endif
		#ifdef HAVE_LINUX_NETLINK_H
		#include <linux/netlink.h>
		#endif
	])
	AC_CHECK_HEADERS(systemd/sd-login.h)

	PKG_CHECK_MODULES(TALLOC,talloc)
	PKG_CHECK_MODULES(TEVENT,tevent)
	PKG_CHECK_MODULES(DBUS,dbus-1 >= 1.0)
	SESSIONBUSSERVICESDIR=`pkg-config --variable=session_bus_services_dir dbus-1 2> /dev/null | sed -e "s|^${datadir}|\${datadir}|g" -e "s|^${datarootdir}|\${datarootdir}|g" -e "s|^${prefix}/share|\${datadir}|g"`
	AC_SUBST(SESSIONBUSSERVICESDIR)
	SYSTEMBUSSERVICESDIR=`pkg-config --variable=system_bus_services_dir dbus-1 2> /dev/null | sed -e "s|^${datadir}|\${datadir}|g" -e "s|^${datarootdir}|\${datarootdir}|g" -e "s|^${prefix}/share|\${datadir}|g"`
	AC_SUBST(SYSTEMBUSSERVICESDIR)

	AC_CHECK_FUNCS(clearenv)

	savedLIBS="$LIBS"
	LIBS="$DBUS_LIBS $LIBS"
	AC_CHECK_FUNCS(dbus_watch_get_unix_fd dbus_watch_get_fd)
	LIBS="$savedLIBS"
	PKG_CHECK_MODULES(CERTMONGER,dbus-1 talloc tevent nss)
	PKG_CHECK_MODULES(GETCERT,dbus-1 talloc)

	PKG_CHECK_MODULES(XML,libxml-2.0)
	have_libxml=true

	PKG_CHECK_MODULES(CURL,libcurl)
	have_libcurl=true

	savedCFLAGS="$CFLAGS"
	savedCPPFLAGS="$CPPFLAGS"
	savedLDFLAGS="$LDFLAGS"
	CFLAGS="$CFLAGS $CURL_CFLAGS"
	CPPFLAGS="$CPPFLAGS $CURL_CFLAGS"
	LDFLAGS="$LDFLAGS $CURL_LIBS"
	AC_CHECK_DECLS([CURLOPT_KEYPASSWD,CURLOPT_SSLKEYPASSWD,CURLOPT_SSLCERTPASSWD],,,[#include <curl/curl.h>])
	CFLAGS="$savedCFLAGS"
	CPPFLAGS="$savedCPPFLAGS"
	LDFLAGS="$savedLDFLAGS"

	dnl PKG_CHECK_MODULES(XMLRPC,xmlrpc_client) # Not provided in upstream versions.
	savedCFLAGS="$CFLAGS"
	CFLAGS=
	AC_ARG_VAR(XMLRPC_C_CONFIG,[the full path of the xmlrpc-c-config command])
	AC_PATH_PROG(XMLRPC_C_CONFIG,[xmlrpc-c-config],,[$PATH$PATH_SEPARATOR/usr/xmlrpc/bin$PATH_SEPARATOR/usr/xmlrpc-c/bin])
	if test -z "$XMLRPC_C_CONFIG" ; then
		AC_MSG_ERROR(xmlrpc-c-config not found)
	fi
	AC_MSG_CHECKING(for XMLRPC CFLAGS)
	XMLRPC_CFLAGS=`${XMLRPC_C_CONFIG} client --cflags`
	AC_MSG_RESULT([$XMLRPC_CFLAGS])
	AC_SUBST(XMLRPC_CFLAGS)
	AC_MSG_CHECKING(for XMLRPC LIBS)
	XMLRPC_LIBS=`${XMLRPC_C_CONFIG} client --libs`
	AC_MSG_RESULT([$XMLRPC_LIBS])
	AC_SUBST(XMLRPC_LIBS)
	CFLAGS="$CFLAGS $XMLRPC_CFLAGS"
	AC_CHECK_MEMBERS(struct xmlrpc_curl_xportparms.gssapi_delegation,,,
			 [
			 #include <xmlrpc-c/client.h>
			 #include <xmlrpc-c/transport.h>
			 ])
	CFLAGS="$savedCFLAGS"

	savedCFLAGS="$CFLAGS"
	savedCPPFLAGS="$CPPFLAGS"
	savedLDFLAGS="$LDFLAGS"
	CFLAGS=
	AC_ARG_VAR(KRB5_CONFIG,[the full path of the krb5-config command])
	AC_PATH_PROG(KRB5_CONFIG,[krb5-config],,[$PATH$PATH_SEPARATOR/usr/kerberos/bin$PATH_SEPARATOR/usr/krb5/bin])
	if test -z "$KRB5_CONFIG" ; then
		AC_MSG_ERROR(krb5-config not found)
	fi
	AC_MSG_CHECKING(for krb5 CFLAGS)
	KRB5_CFLAGS=`${KRB5_CONFIG} --cflags`
	AC_MSG_RESULT([$KRB5_CFLAGS])
	AC_SUBST(KRB5_CFLAGS)
	AC_MSG_CHECKING(for krb5 LIBS)
	KRB5_LIBS=`${KRB5_CONFIG} --libs`
	AC_MSG_RESULT([$KRB5_LIBS])
	AC_SUBST(KRB5_LIBS)
	CFLAGS="$CFLAGS $KRB5_CFLAGS"
	CPPFLAGS="$CPPFLAGS $KRB5_CFLAGS"
	LDFLAGS="$LDFLAGS $KRB5_LIBS"
	AC_CHECK_DECLS([krb5_princ_component,krb5_princ_name,krb5_princ_set_realm_length,krb5_princ_size,krb5_princ_type],,,[#include <krb5.h>])
	AC_CHECK_FUNCS(krb5_free_unparsed_name krb5_get_init_creds_opt_alloc)
	AC_CHECK_FUNCS(krb5_get_error_message)
	CFLAGS="$savedCFLAGS"
	CPPFLAGS="$savedCPPFLAGS"
	LDFLAGS="$savedLDFLAGS"

	AC_ARG_WITH(openssl,
		    AS_HELP_STRING(--without-openssl,
				   [build without support for storing keys and certificates in files]),
		    withopenssl=$withval,
		    withopenssl=yes)

	AM_CONDITIONAL(HAVE_OPENSSL,test x$withopenssl != xno)
	if test x$withopenssl != xno ; then
		if pkg-config libcrypto 2> /dev/null ; then
			PKG_CHECK_MODULES(OPENSSL,libcrypto)
			PKG_CHECK_MODULES(OPENSSL_SSL,libssl libcrypto)
		else
			PKG_CHECK_MODULES(OPENSSL,openssl)
			PKG_CHECK_MODULES(OPENSSL_SSL,openssl)
		fi
		AC_DEFINE(HAVE_OPENSSL,1,[Define if you have OpenSSL.])
		CFLAGSsave="$CFLAGS"
		LIBSsave="$LIBS"
		CFLAGS="$OPENSSL_CFLAGS $CFLAGS"
		LIBS="$OPENSSL_LIBS $LIBS"
		AC_CHECK_DECLS([OpenSSL_add_all_algorithms,OpenSSL_add_ssl_algorithms],,,[#include <openssl/ssl.h>])
		AC_CHECK_DECLS(OPENSSL_free,,,[#include <openssl/crypto.h>])
		CFLAGS="$CFLAGSsave"
		LIBS="$LIBSsave"
	fi

	AM_CONDITIONAL(HAVE_NSS,test x$withnss != xno)
	if test x$withnss != xno ; then
		if pkg-config mozilla-nss 2> /dev/null ; then
			PKG_CHECK_MODULES(NSS,mozilla-nss)
		else
			PKG_CHECK_MODULES(NSS,nss)
		fi
		AC_DEFINE(HAVE_NSS,1,[Define if you have NSS.])
		savedCFLAGS="$CFLAGS"
		savedCPPFLAGS="$CPPFLAGS"
		savedLDFLAGS="$LDFLAGS"
		CFLAGS="$CFLAGS $NSS_CFLAGS"
		CPPFLAGS="$CPPFLAGS $NSS_CFLAGS"
		LDFLAGS="$LDFLAGS $NSS_LIBS"
		AC_MSG_CHECKING([if NSS supports "sql:" databases])
		mkdir _nss_db_testdir || :
		AC_TRY_RUN([
				#include <stdio.h>
				#include <prerror.h>
				#include <nss.h>
				int
				main(int argc, char **argv)
				{
					SECStatus status;
					PRErrorCode err;
					status = NSS_InitReadWrite((argc > 1) ? argv[1] : "sql:_nss_db_testdir");
					if (status == SECSuccess) {
						return 0;
					}
					err = PR_GetError();
					printf("%s",
					       PR_ErrorToString(err,
								PR_LANGUAGE_I_DEFAULT));
					return 1;
				}
			],
			AC_DEFINE(HAVE_SQL_NSSDB,1,[Define if your copy of NSS supports SQLite databases.])
			have_sql_nssdb=yes,
			have_sql_nssdb=no,
			AC_DEFINE(HAVE_SQL_NSSDB,1,[Define if your copy of NSS supports SQLite databases.])
			have_sql_nssdb="guessing yes")
		rm -f -r _nss_db_testdir
		AC_MSG_RESULT($have_sql_nssdb)
		AM_CONDITIONAL(HAVE_SQL_NSSDB,[test "x$have_sql_nssdb" != xno])
		AC_MSG_CHECKING([if NSS supports "dbm:" databases])
		mkdir _nss_db_testdir || :
		AC_TRY_RUN([
				#include <stdio.h>
				#include <prerror.h>
				#include <nss.h>
				int
				main(int argc, char **argv)
				{
					SECStatus status;
					PRErrorCode err;
					status = NSS_InitReadWrite((argc > 1) ? argv[1] : "dbm:_nss_db_testdir");
					if (status == SECSuccess) {
						return 0;
					}
					err = PR_GetError();
					printf("%s",
					       PR_ErrorToString(err,
								PR_LANGUAGE_I_DEFAULT));
					return 1;
				}
			],
			AC_DEFINE(HAVE_DBM_NSSDB,1,[Define if your copy of NSS supports DBMite databases.])
			have_dbm_nssdb=yes,
			have_dbm_nssdb=no,
			AC_DEFINE(HAVE_DBM_NSSDB,1,[Define if your copy of NSS supports DBMite databases.])
			have_dbm_nssdb="guessing yes")
		rm -f -r _nss_db_testdir
		AC_MSG_RESULT($have_dbm_nssdb)
		AM_CONDITIONAL(HAVE_DBM_NSSDB,[test "x$have_dbm_nssdb" != xno])
		CFLAGS="$savedCFLAGS"
		CPPFLAGS="$savedCPPFLAGS"
		LDFLAGS="$savedLDFLAGS"
	fi

	AC_ARG_WITH(gmp,
		    AS_HELP_STRING(--with-gmp,
				   [use gmp for converting hex serial numbers to decimal]),
		    withgmp=$withval,
		    withgmp=no)
	if test $withgmp != no ; then
		CFLAGSsave="$CFLAGS"
		LIBSsave="$LIBS"
		if test $withgmp != yes ; then
			GMP_CFLAGS="-I$withgmp/include"
			GMP_LIBS="-L$withgmp/lib"
		else
			GMP_CFLAGS=
			GMP_LIBS=
		fi
		CFLAGS="$GMP_CFLAGS $CFLAGS"
		LIBS="$GMP_LIBS $LIBS"
		AC_CHECK_HEADERS(gmp.h)
		AC_CHECK_FUNC(mpz_set_str,,
			      LIBS="-lgmp $LIBS"
			      AC_LINK_IFELSE(AC_LANG_PROGRAM([
				#include <stdlib.h>
				#include <gmp.h>
			      ],[mpz_get_str(NULL,10,NULL);]),GMP_LIBS="$GMP_LIBS -lgmp"))
		AC_MSG_CHECKING([for GMP])
		if test $ac_cv_header_gmp_h = yes ; then
			AC_MSG_RESULT(found)
			AC_DEFINE(HAVE_GMP,1,[Define if you have GMP for hex-to-decimal conversions.])
		else
			AC_MSG_ERROR(not found)
		fi
		CFLAGS="$CFLAGSsave"
		LIBS="$LIBSsave"
	fi
	AC_SUBST(GMP_CFLAGS)
	AC_SUBST(GMP_LIBS)
	AM_CONDITIONAL(USE_GMP,test $withgmp != no)
	if test $withgmp = no && test $withopenssl = no ; then
		AC_MSG_ERROR([Need at least one of OpenSSL or GMP for big number operations.])
	fi

	SYSTEMD=no
	AC_ARG_ENABLE(systemd,
		      AS_HELP_STRING([--enable-systemd],[install unit files for systemd]),
		      SYSTEMD=$enableval,
		      SYSTEMD=no)
	AC_SUBST(SYSTEMD)
	AM_CONDITIONAL(SYSTEMD,test x$SYSTEMD != xno)
	AC_SUBST(SYSTEMDSYSTEMUNITDIR)
	if test x$SYSTEMD = xyes ; then
		SYSTEMDSYSTEMUNITDIR=`pkg-config --variable=systemdsystemunitdir systemd 2> /dev/null`
		AC_MSG_RESULT(will install systemd unit files)
	fi

	TMPFILES=no
	AC_ARG_ENABLE(tmpfiles,
		      AS_HELP_STRING([--enable-tmpfiles],[install systemd tmpfiles.d configuration file for systemd (default: same as --enable-systemd)]),
		      TMPFILES=$enableval,
		      TMPFILES=$SYSTEMD)
	AC_SUBST(TMPFILES)
	AM_CONDITIONAL(TMPFILES,test x$TMPFILES != xno)
	if test x$TMPFILES = xyes ; then
		AC_MSG_RESULT(will install systemd tmpfiles.d file to ${prefix}/lib/tmpfiles.d)
	fi

	SYSVINIT=no
	AC_ARG_ENABLE(sysvinit,
		      AS_HELP_STRING([--enable-sysvinit=/etc/init.d],[install sysvinit script in specified location]),
		      SYSVINIT=$enableval,
		      SYSVINIT=no)
	AC_SUBST(SYSVINIT)
	AM_CONDITIONAL(SYSVINIT,test x$SYSVINIT != xno)
	AC_MSG_RESULT(will install sysvinit init script to $SYSVINIT)

	AC_ARG_ENABLE(pie,
	AS_HELP_STRING(--enable-pie,[Build position-independent executables.]),
	pie=$enableval,
	pie=no)
	if test x$pie = xyes ; then
		AC_MSG_RESULT(building position-independent executables)
	else
		AC_MSG_RESULT(NOT building position-independent executables)
	fi
	AM_CONDITIONAL(PIE,[test x$pie = xyes])

	AC_ARG_ENABLE(now,
	AS_HELP_STRING(--enable-now,[Mark binaries with bind-now flag.]),
	now=$enableval,
	now=no)
	if test x$pie = xyes ; then
		AC_MSG_RESULT(building bind-now executables)
	else
		AC_MSG_RESULT(NOT building bind-now executables)
	fi
	AM_CONDITIONAL(NOW,[test x$now = xyes])

	AC_ARG_ENABLE(dsa,
	AS_HELP_STRING(--disable-dsa,[Disable DSA key support, even if available.]),
	dsa=$enableval,
	dsa=maybe)
	if test x$dsa != xno ; then
		CFLAGSsave="$CFLAGS"
		LIBSsave="$LIBS"
		CFLAGS="$OPENSSL_CFLAGS $CFLAGS"
		LIBS="$OPENSSL_LIBS $LIBS"
		AC_CHECK_LIB(crypto,DSA_new)
		CFLAGS="$NSS_CFLAGS $CFLAGS"
		LIBS="$NSS_LIBS $LIBS"
		AC_CHECK_TYPE(SECKEYDSAPublicKey,,,
			      [
			      AC_INCLUDES_DEFAULT
			      #include <nss3/keythi.h>
			      ])
		CFLAGS="$CFLAGSsave"
		LIBS="$LIBSsave"
		can_dsa=true
		if ! pkg-config --atleast-version=1.0 openssl ; then
			# CSR signing appears to be broken in 0.9.8e, so reject < 1.0
			can_dsa=false
		fi
		if test x$ac_cv_lib_crypto_DSA_new = xno ; then
			can_dsa=false
		fi
		if test x$ac_cv_type_SECKEYDSAPublicKey = xno ; then
			can_dsa=false
		fi
		AC_MSG_CHECKING([for DSA support])
		if $can_dsa ; then
			AC_MSG_RESULT(enabling DSA support)
			AC_DEFINE_UNQUOTED(CM_ENABLE_DSA,1,[Define to enable DSA support.])
			MAN_DSA=""
			NO_MAN_DSA=".\\\" "
			dsa=yes
		else
			if test x$dsa != xyes ; then
				AC_MSG_WARN([unavailable, disabling])
				dsa=no
			else
				AC_MSG_ERROR([unavailable])
			fi
			MAN_DSA=".\\\" "
			NO_MAN_DSA=""
		fi
	else
		AC_MSG_RESULT(NOT enabling DSA support)
		MAN_DSA=".\\\" "
		NO_MAN_DSA=""
		dsa=no
	fi
	AM_CONDITIONAL(HAVE_DSA,[test x$dsa = xyes])
	AC_SUBST(MAN_DSA)
	AC_SUBST(NO_MAN_DSA)

	AC_ARG_ENABLE(ec,
	AS_HELP_STRING(--disable-ec,[Disable EC key support, even if available.]),
	ec=$enableval,
	ec=maybe)
	if test x$ec != xno ; then
		CFLAGSsave="$CFLAGS"
		LIBSsave="$LIBS"
		CFLAGS="$OPENSSL_CFLAGS $CFLAGS"
		LIBS="$OPENSSL_LIBS $LIBS"
		AC_CHECK_LIB(crypto,EC_KEY_new_by_curve_name)
		CFLAGS="$NSS_CFLAGS $CFLAGS"
		LIBS="$NSS_LIBS $LIBS"
		AC_CHECK_FUNCS(SECKEY_CreateECPrivateKey)
		CFLAGS="$CFLAGSsave"
		LIBS="$LIBSsave"
		can_ec=true
		if test x$ac_cv_lib_crypto_EC_KEY_new_by_curve_name = xno ; then
			can_ec=false
		fi
		if test x$ac_cv_func_CreateECPrivateKey = xno ; then
			can_ec=false
		fi
		AC_MSG_CHECKING([for EC support])
		if $can_ec ; then
			AC_MSG_RESULT(enabling EC support)
			AC_DEFINE_UNQUOTED(CM_ENABLE_EC,1,[Define to enable EC support.])
			MAN_EC=""
			NO_MAN_EC=".\\\" "
			ec=yes
		else
			if test x$ec != xyes ; then
				AC_MSG_WARN([unavailable, disabling])
				ec=no
			else
				AC_MSG_ERROR([unavailable])
			fi
			MAN_EC=".\\\" "
			NO_MAN_EC=""
		fi
	else
		AC_MSG_RESULT(NOT enabling EC support)
		MAN_EC=".\\\" "
		NO_MAN_EC=""
		ec=no
	fi
	AM_CONDITIONAL(HAVE_EC,[test x$ec = xyes])
	AC_SUBST(MAN_EC)
	AC_SUBST(NO_MAN_EC)

	AC_DEFINE_UNQUOTED(CM_DEFAULT_KEY_STORAGE_TYPE,cm_key_storage_nssdb,[Define to the default type of storage used for keys.])
	AC_DEFINE_UNQUOTED(CM_DEFAULT_KEY_STORAGE_LOCATION,"/etc/pki/nssdb",[Define to the default location of storage used for keys.])
	AC_DEFINE_UNQUOTED(CM_DEFAULT_KEY_TOKEN,NULL,[Define to the default token used for holding keys.])
	AC_DEFINE_UNQUOTED(CM_DEFAULT_KEY_NICKNAME,"Server-Cert",[Define to the default nickname given to keys.])
	AC_DEFINE_UNQUOTED(CM_DEFAULT_CERT_STORAGE_TYPE,cm_cert_storage_nssdb,[Define to the default type of storage used for certificates.])
	AC_DEFINE_UNQUOTED(CM_DEFAULT_CERT_STORAGE_LOCATION,"/etc/pki/nssdb",[Define to the default location of storage used for certificates.])
	AC_DEFINE_UNQUOTED(CM_DEFAULT_CERT_TOKEN,NULL,[Define to the default token used to store certificates.])
	AC_DEFINE_UNQUOTED(CM_DEFAULT_CERT_NICKNAME,"Server-Cert",[Define to the default nickname given to certificates.])
	AC_DEFINE_UNQUOTED(CM_DEFAULT_PUBKEY_TYPE,cm_key_rsa,[Define to the default public key type.])
	AC_DEFINE_UNQUOTED(CM_DEFAULT_RSA_EXPONENT,0x10001,[Define to the default RSA key exponent.])
	AC_DEFINE_UNQUOTED(CM_DIGEST_MAX,(512/8),[Define to the maximum size (in bytes) of supported digests.])
	CM_DEFAULT_PUBKEY_SIZE=2048
	AC_DEFINE_UNQUOTED(CM_DEFAULT_PUBKEY_SIZE,$CM_DEFAULT_PUBKEY_SIZE,[Define to the default public key size.])
	AC_SUBST(CM_DEFAULT_PUBKEY_SIZE)
	CM_MINIMUM_RSA_KEY_SIZE=512
	CM_MINIMUM_DSA_KEY_SIZE=512
	CM_MINIMUM_EC_KEY_SIZE=256
	AC_DEFINE_UNQUOTED(CM_MINIMUM_RSA_KEY_SIZE,$CM_MINIMUM_RSA_KEY_SIZE,[Define to the minimum key size when generating RSA keys.  Requests to generate smaller keys will be forced to this key size.])
	AC_DEFINE_UNQUOTED(CM_MINIMUM_DSA_KEY_SIZE,$CM_MINIMUM_DSA_KEY_SIZE,[Define to the minimum key size when generating DSA parameters and keys.  Requests to generate smaller keys will be forced to this key size.])
	AC_DEFINE_UNQUOTED(CM_MINIMUM_EC_KEY_SIZE,$CM_MINIMUM_EC_KEY_SIZE,[Define to the minimum key size when selecting elliptic curve parameters.  Requests to generate smaller keys will be forced to this key size.])
	AC_SUBST(CM_MINIMUM_RSA_KEY_SIZE)
	AC_SUBST(CM_MINIMUM_DSA_KEY_SIZE)
	AC_SUBST(CM_MINIMUM_EC_KEY_SIZE)
	CM_DEFAULT_TTL_LIST="2419200, 604800, 259200, 172800, 86400"
	AC_DEFINE_UNQUOTED(CM_DEFAULT_TTL_LIST,[$CM_DEFAULT_TTL_LIST],[Define to the list of default time-left thresholds at which we need to warn the user.])
	AC_SUBST(CM_DEFAULT_TTL_LIST)
	AC_DEFINE_UNQUOTED(CM_DEFAULT_CERT_SUBJECT_CN,"localhost",[Define to the last-ditch default CN value for a signing request.])
	CM_DEFAULT_CERT_LIFETIME=1y
	AC_DEFINE_UNQUOTED(CM_DEFAULT_CERT_LIFETIME,"$CM_DEFAULT_CERT_LIFETIME",[Define to the default certificate lifetime for self-signed certificates.])
	AC_SUBST(CM_DEFAULT_CERT_LIFETIME)
	AC_DEFINE_UNQUOTED(CM_DEFAULT_CERT_SERIAL,"01",[Define to the default starting serial number for self-signed certificates.])
	AC_DEFINE_UNQUOTED(CM_DEFAULT_NOTIFICATION_METHOD,cm_notification_syslog,[Define to the default method of notification.])
	AC_DEFINE_UNQUOTED(CM_DEFAULT_NOTIFICATION_MAIL,"root",[Define to the address where notification mail should be sent by default.])
	CM_DEFAULT_NOTIFICATION_SYSLOG_PRIORITY=daemon.notice
	AC_SUBST(CM_DEFAULT_NOTIFICATION_SYSLOG_PRIORITY)
	AC_DEFINE_UNQUOTED(CM_DEFAULT_NOTIFICATION_SYSLOG_PRIORITY,"$CM_DEFAULT_NOTIFICATION_SYSLOG_PRIORITY",[Define to the syslog facility from which notification messages should be sent by default.])
	AC_DEFINE(CM_DELAY_SOON,5,[Define to the time to wait for something that will happen soon.])
	AC_DEFINE(CM_DELAY_SOONISH,30,[Define to the time to wait for something that will happen soon, but not that soon.])
	AC_DEFINE(CM_DELAY_CA_POLL,(7 * 24 * 60 * 60),[Define to the time to wait between attempts to see if the CA issued a certificate.])
	AC_DEFINE(CM_DELAY_CADATA_POLL,(6 * 60 * 60),[Define to the time to wait between attempts to fetch the CA certificate, if it was unreachable.])
	AC_DEFINE(CM_DELAY_CA_POLL_MINIMUM,(5 * 60),[Define to the absolute minimum time to wait between attempts to see if the CA issued a certificate.])
	AC_DEFINE(CM_DELAY_MONITOR_POLL,(24 * 60 * 60),[Define to the time to wait between attempts to re-read a certificate and check for expiration.])
	AC_DEFINE(CM_DELAY_MONITOR_POLL_MINIMUM,(30 * 60),[Define to the absolute minimum time to wait between attempts to re-read a certificate and check for expiration.])
	AC_DEFINE(CM_DELAY_NETLINK,(60),[Define to the time to wait after a netlink routing notification to retry submissions.])

	CM_SELF_SIGN_CA_NAME=SelfSign
	AC_SUBST(CM_SELF_SIGN_CA_NAME)
	AC_DEFINE_UNQUOTED(CM_SELF_SIGN_CA_NAME,"$CM_SELF_SIGN_CA_NAME",[Define to the name that the internal self-signing not-really-a-CA will be known by.])

	AC_DEFINE_UNQUOTED(CM_DEFAULT_HELPER_PATH,"$mylibexecdir",[Define to the default path of submission helpers.])

	AC_DEFINE(WITH_IPA,1,[Define to ensure that there's always an IPA CA defined.])
	CM_IPA_CA_NAME=IPA
	AC_SUBST(CM_IPA_CA_NAME)
	AC_DEFINE_UNQUOTED(CM_IPA_CA_NAME,"$CM_IPA_CA_NAME",[Define to the name that the default IPA CA will be known by.])
	AC_DEFINE_UNQUOTED(CM_IPA_HELPER_PATH,"$mylibexecdir/ipa-submit",[Define to the path of the IPA submission helper.])
	AM_CONDITIONAL(WITH_IPA,true)

	AC_DEFINE(WITH_CERTMASTER,1,[Define to ensure that there's always a CERTMASTER CA defined.])
	CM_CERTMASTER_CA_NAME=certmaster
	AC_SUBST(CM_CERTMASTER_CA_NAME)
	AC_DEFINE_UNQUOTED(CM_CERTMASTER_CA_NAME,"$CM_CERTMASTER_CA_NAME",[Define to the name that the default certmaster CA will be known by.])
	AC_DEFINE_UNQUOTED(CM_CERTMASTER_HELPER_PATH,"$mylibexecdir/certmaster-submit",[Define to the path of the CERTMASTER submission helper.])
	AM_CONDITIONAL(WITH_CERTMASTER,true)

	AC_DEFINE(WITH_LOCAL,1,[Define to ensure that there's always a local CA defined.])
	CM_LOCAL_CA_NAME=local
	AC_SUBST(CM_LOCAL_CA_NAME)
	AC_DEFINE_UNQUOTED(CM_LOCAL_CA_NAME,"$CM_LOCAL_CA_NAME",[Define to the name that the local CA will be known by.])
	AC_DEFINE_UNQUOTED(CM_LOCAL_HELPER_PATH,"$mylibexecdir/local-submit",[Define to the path of the local submission helper.])
	AM_CONDITIONAL(WITH_LOCAL,true)

	CM_DEFAULT_IDLE_TIMEOUT=300
	AC_SUBST(CM_DEFAULT_IDLE_TIMEOUT)
	AC_DEFINE_UNQUOTED(CM_DEFAULT_IDLE_TIMEOUT,$CM_DEFAULT_IDLE_TIMEOUT,[Define to the default idle-timeout when bus-activated.])

	CFLAGSsave="$CFLAGS"
	LIBSsave="$LIBS"
	AC_CHECK_HEADER(ldap.h,,AC_MSG_ERROR(ldap.h not found))
	AC_CHECK_FUNC(ldap_initialize,,AC_CHECK_LIB(ldap,ldap_initialize))
	AC_CHECK_FUNC(ldap_sasl_interactive_bind_s,,AC_CHECK_LIB(ldap,ldap_sasl_interactive_bind_s))
	LDAP_CFLAGS="$CFLAGS"
	LDAP_LIBS="$LIBS"
	CFLAGS="$CFLAGSsave"
	LIBS="$LIBSsave"
	AC_SUBST(LDAP_CFLAGS)
	AC_SUBST(LDAP_LIBS)

	AC_ARG_WITH(idn,
	AS_HELP_STRING([--without-idn],[do not handle international dnsName subjectAltNames]),
	if test x$with_idn = xno ; then
		idn=false
	else
		idn=true
	fi,
	idn=true)
	if $idn ; then
		PKG_CHECK_MODULES(IDN,libidn)
		AC_DEFINE(CM_USE_IDN,1,[Define if dnsName subjectAltNames should be encoded properly.])
	fi

	AC_ARG_WITH(uuid,
	AS_HELP_STRING([--with-uuid],[populate subjectUniqueID in self-signed certs]),
	[uuid=$with_uuid],
	[uuid=no])
	if test x$with_uuid = xyes ; then
		PKG_CHECK_MODULES(UUID,uuid)
	else
		if test x$with_uuid != xno ; then
			if pkg-config uuid ; then
				PKG_CHECK_MODULES(UUID,uuid)
				uuid=yes
			fi
		fi
	fi
	# Older uuid pkgconfig sets us up to need <uuid/uuid.h>.  Newer
	# versions set us up to need <uuid.h>.
	if test x$uuid = xyes ; then
		savedCFLAGS="$CFLAGS"
		CFLAGS="$UUID_CFLAGS"
		AC_CHECK_HEADERS(uuid.h uuid/uuid.h)
		CFLAGS="$savedCFLAGS"
		if test x$ac_cv_header_uuid_uuid_h = xno ; then
			if test x$ac_cv_header_uuid_h = xno ; then
				AC_MSG_ERROR(uuid.h header file not found)
			fi
		fi
		AC_DEFINE(HAVE_UUID,1,[Define to have the ability to populate subjectUniqueID in self-signed certs.])
	fi
	CM_DEFAULT_POPULATE_UNIQUE_ID=no
	AC_SUBST(CM_DEFAULT_POPULATE_UNIQUE_ID)
	AC_DEFINE_UNQUOTED(CM_DEFAULT_POPULATE_UNIQUE_ID,"$CM_DEFAULT_POPULATE_UNIQUE_ID",[Define to the default for the selfsign/populate_unique_id configuration setting.])
	AM_CONDITIONAL(HAVE_UUID,test x$uuid = xyes)
	AC_SUBST(UUID_CFLAGS)
	AC_SUBST(UUID_LIBS)
else
	AM_CONDITIONAL(HAVE_OPENSSL,false)
	AM_CONDITIONAL(HAVE_NSS,false)
	AM_CONDITIONAL(HAVE_SQL_NSSDB,false)
	AM_CONDITIONAL(HAVE_DBM_NSSDB,false)
	AM_CONDITIONAL(USE_GMP,false)
	AM_CONDITIONAL(SYSTEMD,false)
	AM_CONDITIONAL(TMPFILES,false)
	AM_CONDITIONAL(SYSVINIT,false)
	AM_CONDITIONAL(PIE,false)
	AM_CONDITIONAL(NOW,false)
	AM_CONDITIONAL(HAVE_DSA,false)
	AM_CONDITIONAL(HAVE_EC,false)
	AM_CONDITIONAL(WITH_IPA,false)
	AM_CONDITIONAL(WITH_CERTMASTER,false)
	AM_CONDITIONAL(WITH_LOCAL,false)
	AM_CONDITIONAL(HAVE_UUID,false)
fi

AC_CONFIG_COMMANDS(src_introspect_sh,[chmod +x src/introspect.sh])
AC_OUTPUT(Makefile src/Makefile dbus/Makefile systemd/Makefile sysvinit/Makefile sysvinit/certmonger tests/Makefile tests/tools/Makefile dbus/certmonger.conf dbus/certmonger.service src/introspect.sh src/certmonger.8 src/getcert.1 src/getcert-request.1 src/getcert-list.1 src/getcert-list-cas.1 src/getcert-start-tracking.1 src/getcert-stop-tracking.1 src/selfsign-getcert.1 src/ipa-getcert.1 src/getcert-resubmit.1 src/certmonger-certmaster-submit.8 src/certmonger-ipa-submit.8 src/certmonger-dogtag-ipa-renew-agent-submit.8 src/certmaster-getcert.1 src/certmonger.conf.5 po/Makefile.in src/certmonger.conf systemd/certmonger.service systemd/certmonger.path systemd/certmonger.conf systemd/org.fedorahosted.certmonger.service src/getcert-refresh.1 src/getcert-refresh-ca.1 src/local-getcert.1 src/certmonger-local-submit.8 src/getcert-status.1)