-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
304 lines (273 loc) · 8.33 KB
/
configure.ac
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
# $Id: configure.ac 6930 2013-01-08 12:31:16Z jakob $
m4_sinclude([version.m4])
AC_PREREQ(2.61)
AC_INIT([opendnssec], OPENDNSSEC_VERSION, [http://bugs.opendnssec.org/])
AM_INIT_AUTOMAKE
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE(foreign)
ACX_PREFIXHACK
OPENDNSSEC_COMMON
# extensions
AC_USE_SYSTEM_EXTENSIONS
# standard programs
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LIBTOOL
AC_PROG_MAKE_SET
AC_PROG_RANLIB
# additional programs
AC_PATH_PROG(XMLLINT, xmllint)
AC_PATH_PROG(XSLTPROC, xsltproc)
AC_PATH_PROG(JAVA, java)
AC_PATH_PROG(CP, cp)
AC_DEFINE_UNQUOTED(CP_COMMAND, "$CP", [System cp(3) command])
# building
ACX_ARG_RPATH
ACX_RUNTIME_PATH_ADD
ACX_PEDANTIC [produces lot of out of line warnings]
ACX_GPROF
ACX_STRICT
# compiler flags
CHECK_COMPILER_FLAG(std=c99, [C99FLAG="-std=c99"])
CHECK_COMPILER_FLAG(xc99, [C99FLAG="-xc99"])
CHECK_COMPILER_FLAG_NEEDED($C99FLAG, [#include <stdbool.h>], [CFLAGS="$CFLAGS $C99FLAG"])
CHECK_COMPILER_FLAG_NEEDED(-D__EXTENSIONS__,
[
#include "confdefs.h"
#include <stdlib.h>
#include <unistd.h>
int test() {
int a;
char **opts = NULL;
a = getopt(2, opts, "a");
return a;
}
], [CFLAGS="-D__EXTENSIONS__ $CFLAGS"])
# checks for header files
AC_HEADER_STDC
AC_HEADER_STDBOOL
AC_HEADER_TIME
AC_CHECK_HEADERS([fcntl.h inttypes.h stdio.h stdlib.h string.h syslog.h unistd.h])
AC_CHECK_HEADERS(getopt.h,, [AC_INCLUDES_DEFAULT])
AC_CHECK_HEADERS([errno.h getopt.h pthread.h signal.h stdarg.h stdint.h strings.h])
AC_CHECK_HEADERS([sys/select.h sys/socket.h sys/stat.h sys/time.h sys/types.h sys/wait.h])
AC_CHECK_HEADERS([libxml/parser.h libxml/relaxng.h libxml/xmlreader.h libxml/xpath.h])
# checks for typedefs, structures, and compiler characteristics
AC_C_CONST
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_UID_T
AC_TYPE_UINT16_T
AC_MSG_CHECKING(for union semun)
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>],
[union semun arg;],
[have_union_semun=1],
[have_union_semun=0]
)
if test $have_union_semun = 1; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_UNION_SEMUN, 1, [union semun is defined])
else
AC_MSG_RESULT(no)
fi
# pthread
ACX_PTHREAD
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC"
# checks for library functions
AC_CHECK_FUNCS([arc4random arc4random_uniform])
AC_CHECK_FUNCS([dup2 endpwent select strerror strtol])
AC_CHECK_FUNCS([getpass getpassphrase memset])
AC_CHECK_FUNCS([localtime_r memset strdup strerror strstr strtol strtoul])
AC_CHECK_FUNCS([setregid setreuid])
AC_CHECK_FUNCS([chown stat exit time atoi getpid waitpid sigfillset])
AC_CHECK_FUNCS([malloc calloc realloc free])
AC_CHECK_FUNCS([strlen strncmp strncat strncpy strerror strncasecmp strdup])
AC_CHECK_FUNCS([fgetc fopen fclose ferror fprintf vsnprintf fflush])
AC_CHECK_FUNCS([openlog closelog syslog])
AC_CHECK_FUNCS([openlog_r closelog_r syslog_r vsyslog_r])
AC_CHECK_FUNCS([chroot getgroups setgroups initgroups])
AC_CHECK_FUNCS([close unlink fcntl socket listen bzero])
AC_CHECK_FUNCS([va_start va_end])
AC_CHECK_FUNCS([xmlInitParser xmlCleanupParser xmlCleanupThreads])
AC_CHECK_FUNCS([pthread_mutex_init pthread_mutex_destroy pthread_mutex_lock pthread_mutex_unlock])
AC_CHECK_FUNCS([pthread_cond_init pthread_cond_signal pthread_cond_destroy pthread_cond_wait pthread_cond_timedwait])
AC_CHECK_FUNCS([pthread_create pthread_detach pthread_self pthread_join pthread_sigmask])
AC_FUNC_CHOWN
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_MKTIME
AC_FUNC_REALLOC
AC_FUNC_SELECT_ARGTYPES
AC_FUNC_VPRINTF
AC_REPLACE_FUNCS(strlcat)
AC_REPLACE_FUNCS(strlcpy)
AC_REPLACE_FUNCS(b64_pton)
AC_REPLACE_FUNCS(b64_ntop)
ACX_BROKEN_SETRES
AC_CHECK_STRPTIME
# check for some target-specific stuff
case "$host" in
*-*-darwin*)
AC_DEFINE(SETEUID_BREAKS_SETUID, 1,
[Define if your platform breaks doing a seteuid before a setuid])
AC_DEFINE(BROKEN_SETREUID, 1, [Define if your setreuid() is broken])
AC_DEFINE(BROKEN_SETREGID, 1, [Define if your setregid() is broken])
;;
esac
# check for the sockaddr_un.sun_len member
AC_CHECK_MEMBER([struct sockaddr_un.sun_len],
[AC_DEFINE(HAVE_SOCKADDR_SUN_LEN,1,[Have the sockaddr_un.sun_len member.])],
[],
[ #include <sys/types.h>
#include <sys/un.h>
])
# timeshift
AC_ARG_ENABLE(timeshift,
AC_HELP_STRING([--enable-timeshift], [Enable timeshift debug]),
[enable_timeshift="${enableval}"],
[enable_timeshift="no"])
AC_MSG_CHECKING(if we should enable timeshift debugging)
if test "x${enable_timeshift}" = "xyes"; then
AC_MSG_RESULT(yes)
AC_DEFINE_UNQUOTED(ENFORCER_TIMESHIFT, 1, [timeshift debug])
else
AC_MSG_RESULT(no)
fi
# common dependencies
ACX_LIBXML2
ACX_LDNS(1,6,12)
ACX_LDNS_NOT(1,6,14, [binary incompatibility, see http://open.nlnetlabs.nl/pipermail/ldns-users/2012-October/000564.html])
ACX_LDNS_NOT(1,6,15, [fail to create NSEC3 bitmap for empty non-terminals, see http://www.nlnetlabs.nl/pipermail/ldns-users/2012-November/000565.html])
ACX_PKCS11_MODULES
ACX_ATTRUNUSED
ACX_RT
ACX_LIBC
ACX_SSL
# libhsm
ACX_DLOPEN
AC_DEFINE_UNQUOTED([HSM_DEFAULT_CONFIG],["$OPENDNSSEC_CONFIG_FILE"],[Default configuration file.])
# enforcer
AC_PATH_PROG(PERL, perl)
if test -z "$PERL"; then
AC_MSG_ERROR([perl not found])
fi
ACX_DBPARAMS
ACX_DATABASE_BACKEND
ACX_CUNIT
AC_DEFINE_UNQUOTED(SIGNER_CLI_UPDATE, "$OPENDNSSEC_SIGNER_CLI update", [Path to the OpenDNSSEC signer engine cli])
AM_CONDITIONAL([ENABLE_ENFORCER], [test "${enable_signer}" = "yes"])
# cunit
AM_CONDITIONAL([WITH_CUNIT], [test "${with_cunit}" != "no" -a -n "$CUNIT_LIBS"])
# signer
AC_ARG_ENABLE(signer,
AC_HELP_STRING([--disable-signer],
[Disable signer build (default enabled)]),
[enable_signer="${enableval}"],
[enable_signer="yes"])
AH_BOTTOM([
/* define before includes as it specifies what standard to use. */
#if (defined(HAVE_PSELECT) && !defined (HAVE_PSELECT_PROTO)) \
|| !defined (HAVE_CTIME_R_PROTO) \
|| defined (STRPTIME_NEEDS_DEFINES)
# ifndef _XOPEN_SOURCE
# define _XOPEN_SOURCE 600
# endif
# ifndef _POSIX_C_SOURCE
# define _POSIX_C_SOURCE 200112
# endif
# ifndef _BSD_SOURCE
# define _BSD_SOURCE 1
# endif
# ifndef __EXTENSIONS__
# define __EXTENSIONS__ 1
# endif
# ifndef _STDC_C99
# define _STDC_C99 1
# endif
# ifndef _ALL_SOURCE
# define _ALL_SOURCE 1
# endif
#endif
#if defined(__cplusplus)
#define ATTR_UNUSED(x)
#elif defined(HAVE_ATTR_UNUSED)
#define ATTR_UNUSED(x) x __attribute__((unused))
#else /* !HAVE_ATTR_UNUSED */
#define ATTR_UNUSED(x) x
#endif /* !HAVE_ATTR_UNUSED */
])
AM_CONDITIONAL([ENABLE_SIGNER], [test "${enable_signer}" = "yes"])
# check for a green cucumber (but only if we can shift time)
if test "x${enable_timeshift}" = "xyes"; then
AC_PATH_PROG(CUCUMBER, cucumber)
fi
AM_CONDITIONAL([WITH_CUCUMBER], [test -x "${CUCUMBER}"])
# doxygen
DX_PDF_FEATURE(OFF)
DX_PS_FEATURE(OFF)
DX_INIT_DOXYGEN(${PACKAGE_NAME}, [Doxyfile], [doxygen-doc])
AC_CONFIG_HEADER([common/config.h])
AC_CONFIG_FILES([
Makefile
Doxyfile
common/Makefile
conf/Makefile
conf/addns.xml
conf/conf.xml
conf/enforcerstate.xml
conf/kasp.xml
conf/signconf.xml
conf/zonelist.xml
enforcer/Makefile
enforcer/common/Makefile
enforcer/enforcerd/Makefile
enforcer/enforcerd/ttods-enforcerd.8
enforcer/ksm/Makefile
enforcer/ksm/include/Makefile
enforcer/ksm/include/ksm/Makefile
enforcer/test/Makefile
enforcer/test/cucumber/Makefile
enforcer/test/cucumber/c_conf.xml
enforcer/test/cucumber/c_kasp.xml
enforcer/test/cucumber/c_zonelist.base.xml
enforcer/test/cunit/Makefile
enforcer/test/cunit/database_setup_mysql.sh
enforcer/test/cunit/database_setup_sqlite3.sh
enforcer/utils/Makefile
enforcer/utils/ttods-kaspcheck.1
enforcer/utils/ttods-ksmutil.1
libhsm/Makefile
libhsm/src/Makefile
libhsm/src/bin/Makefile
libhsm/src/bin/ttods-hsmspeed.1
libhsm/src/bin/ttods-hsmutil.1
libhsm/src/lib/Makefile
libhsm/checks/Makefile
libhsm/checks/conf-softhsm.xml
libhsm/checks/conf-sca6000.xml
libhsm/checks/conf-etoken.xml
libhsm/checks/conf-multi.xml
libhsm/checks/conf-opensc.xml
libhsm/checks/conf-ncipher.xml
libhsm/checks/conf-aepkeyper.xml
signer/Makefile
signer/man/Makefile
signer/man/ttods-signer.8
signer/man/ttods-signerd.8
signer/src/Makefile
tools/Makefile
tools/ttods-control
tools/solaris/Makefile
tools/solaris/ttods-enforcerd.init
tools/solaris/ttods-signerd.init
tools/ttods-timing.5
tools/ttods.7
tools/ttods-control.8
tools/ttods-kasp2html
])
AC_OUTPUT