-
Notifications
You must be signed in to change notification settings - Fork 8
/
configure.ac
602 lines (517 loc) · 19.9 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
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
#
# Copyright 2023 United States Government
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
AC_INIT([maat], [2.0])
AC_CONFIG_AUX_DIR([build-aux])
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
AM_INIT_AUTOMAKE([foreign -Wall tar-pax subdir-objects])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_CONFIG_MACRO_DIR([m4])
AC_PROG_LIBTOOL
AM_MAINTAINER_MODE
PKG_PROG_PKG_CONFIG
AM_PATH_PYTHON([3.0],,[:])
LT_INIT
AC_PROG_CC
AM_PROG_CC_C_O
#AM_PROG_CC_STDC
AC_PROG_CXX
AC_PROG_AWK
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_MKDIR_P
AC_C_INLINE
AC_TYPE_SIZE_T
AC_TYPE_UID_T
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_INT8_T
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
AC_CHECK_TYPES([ptrdiff_t])
AC_CHECK_HEADER_STDBOOL
AC_CHECK_HEADERS([stdlib.h dlfcn.h arpa/inet.h fcntl.h inttypes.h limits.h mntent.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h strings.h sys/socket.h sys/time.h syslog.h unistd.h])
AC_FUNC_CHOWN
AC_FUNC_ERROR_AT_LINE
AC_FUNC_FORK
AC_FUNC_GETMNTENT
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_HEADER_MAJOR
AC_FUNC_MMAP
AC_CHECK_FUNCS([bzero dup2 ftruncate getdelim gethostbyname gethostname getmntent getpagesize gettimeofday inet_ntoa isascii memmove memset mkdir munmap select setenv socket strcasecmp strchr strdup strerror strncasecmp strndup strrchr strspn strstr strtol strtoul realpath floor])
AC_PATH_PROG([PERL], [perl], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
AC_PATH_PROG([GPERF], [gperf], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
AX_LIB_READLINE()
AX_CHECK_OPENSSL([],[AC_MSG_ERROR([OpenSSL devel libs not installed])])
XOPENSSL_MAJOR_VERSION=$(openssl version | awk '{print $2}' | awk -F'.' '{print $1}')
AS_IF([test "x$OPENSSL_MAJOR_VERSION" = "x3"],
[AC_DEFINE_UNQUOTED([OPENSSL_MAJOR_VERSION],[3],[The major version of openssl.])],
[AC_DEFINE_UNQUOTED([OPENSSL_MAJOR_VERSION],[1],[The major version of openssl.])])
AC_SEARCH_LIBS([dlopen], [dl])
AM_PATH_GLIB_2_0([2.0.0],[
CPPFLAGS="`pkg-config --cflags glib-2.0` $CPPFLAGS"
LDFLAGS="`pkg-config --libs glib-2.0` $LDFLAGS"
], AC_MSG_ERROR(You need glib > 2.0.0))
AM_PATH_XML2([2.0.0],[
CPPFLAGS="`pkg-config --cflags libxml-2.0` $CPPFLAGS"
LDFLAGS="`pkg-config --libs libxml-2.0` $LDFLAGS"
], [AC_MSG_ERROR(Need libxml2 devel package)])
PKG_CHECK_MODULES([UUID], [uuid])
PKG_CHECK_MODULES([JSON], [json-c])
AC_CHECK_PROGS([DOXYGEN], [doxygen])
AS_IF([test -z "$DOXYGEN" ],
AC_MSG_WARN([Doxygen not found - continuing without Doxygen support]))
AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
AM_COND_IF([HAVE_DOXYGEN],
[AC_CONFIG_FILES([src/types/target/Doxyfile
src/types/address_space/Doxyfile
src/types/measurement/Doxyfile
src/apbs/Doxyfile
src/asps/Doxyfile])])
AC_CHECK_PROGS([SPHINXBUILD], [sphinx-build])
AS_IF([test -z "$SPHINXBUILD" ],
AC_MSG_WARN(sphinx-build is required to build documentation))
AM_CONDITIONAL(SPHINX_SET, [test -n "$SPHINXBUILD" ])
AM_COND_IF([SPHINX_SET],
[AC_CONFIG_FILES([documentation/source/conf.py])
m4_include([documentation/source/doclinks.m4])
])
AX_PYTHON_MODULE([breathe],[])
AM_CONDITIONAL([HAVE_BREATHE], [test "x$HAVE_PYMOD_BREATHE" = xyes ])
AX_PYTHON_MODULE_VERSION([cloud_sptheme], [1.7.1])
AM_CONDITIONAL([HAVE_CLOUDSP], [test "x$HAVE_PYMOD_CLOUD_SPTHEME_VERSION" = xyes ])
AC_CHECK_PROGS([LATEXMK], [latexmk])
AS_IF([test -z "x$LATEXMK" ],
AC_MSG_WARN(latexmk is needed to build the documentation))
AM_CONDITIONAL([HAVE_LATEXMK], [test -n "$LATEXMK" ])
# Flags to link in the lib maat
LIBMAAT_CFLAGS=["-I\$(top_srcdir)/lib \$(UUID_CFLAGS)"]
LIBMAAT_UTIL_LIBS=["-L\$(top_builddir)/lib/util/ -lmaat_util-${PACKAGE_VERSION} \$(UUID_LIBS)"]
LIBMAAT_CLIENT_LIBS=["-L\$(top_builddir)/lib/client/ -lmaat_client-${PACKAGE_VERSION} ${LIBMAAT_UTIL_LIBS}"]
LIBMAAT_LDFLAGS=["-L\$(top_builddir)/lib/graph/ -lmaat_graph-${PACKAGE_VERSION} \
${LIBMAAT_CLIENT_LIBS} "]
LIBMAAT_APB_LIBS=["-L\$(top_builddir)/lib/apb/ -lmaat_apb-${PACKAGE_VERSION} ${LIBMAAT_LDFLAGS}"]
LIBMAAT_ASP_LIBS=["-L\$(top_builddir)/lib/asp/ -lmaat_asp-${PACKAGE_VERSION} ${LIBMAAT_LDFLAGS}"]
LIBMAAT_AM_LIBS=["-L\$(top_builddir)/lib/common -lcommon ${LIBMAAT_LDFLAGS}"]
AC_SUBST([LIBMAAT_CFLAGS])
AC_SUBST([LIBMAAT_UTIL_LIBS])
AC_SUBST([LIBMAAT_CLIENT_LIBS])
AC_SUBST([LIBMAAT_LDFLAGS])
AC_SUBST([LIBMAAT_APB_LIBS])
AC_SUBST([LIBMAAT_ASP_LIBS])
AC_SUBST([LIBMAAT_AM_LIBS])
# Libmaat options
AC_ARG_ENABLE([mongo-selector],
[AS_HELP_STRING([--enable-mongo-selector],[Enable the MongoDB selector.])],
[enable_aspmain_suid=yes],
[enable_aspmain_suid=$enableval])
AS_IF([test "x$enable_mongo_selector" = xyes], [
PKG_CHECK_MODULES(LIBMONGOC, libmongoc-1.0 >= 1.0)
PKG_CHECK_MODULES(LIBBSON, libbson-1.0 >= 1.0)
])
AM_CONDITIONAL([ENABLE_MONGO_SELECTOR], [test "x$enable_mongo_selector" = xyes])
AC_ARG_ENABLE([tpm],
[AS_HELP_STRING([--disable-tpm], [Disable the use of the TPM])],
[enable_tpm=$enableval],
[enable_tpm=yes])
AS_IF([test "x$enable_tpm" = xyes],[
AC_DEFINE([USE_TPM], [1], [Compile in support for using the TPM])
PKG_CHECK_MODULES([TSS2_ESYS_3_0], [tss2-esys >= 3.0.0],
[AC_DEFINE([ESYS_3_0], [1], [Esys3.0])]
[AC_SUBST([TSS2_ESYS_CFLAGS], [$TSS2_ESYS_3_0_CFLAGS])
AC_SUBST([TSS2_ESYS_LIBS], [$TSS2_ESYS_3_0_LIBS])],
[PKG_CHECK_MODULES([TSS2_ESYS_2_3], [tss2-esys >= 2.3.0],
[AC_DEFINE([ESYS_2_3], [1], [Esys2.3])]
[AC_SUBST([TSS2_ESYS_CFLAGS], [$TSS2_ESYS_2_3_CFLAGS])
AC_SUBST([TSS2_ESYS_LIBS], [$TSS2_ESYS_2_3_LIBS])])])
PKG_CHECK_MODULES([TSS2_TCTILDR], [tss2-tctildr])
PKG_CHECK_MODULES([TSS2_MU], [tss2-mu])
PKG_CHECK_MODULES([TSS2_RC], [tss2-rc])
PKG_CHECK_MODULES([CRYPTO], [libcrypto >= 1.0.2g])
])
AM_CONDITIONAL(USETPM, test "x$enable_tpm" = xyes)
AC_ARG_WITH(maat-user,
AC_HELP_STRING([--with-maat-user=USER],
[set the default maat owner to USER (default maat)]),
[ MAAT_USER="$with_maat_user" ],
[ MAAT_USER="maat" ])
AC_DEFINE_UNQUOTED(MAAT_USER, "$MAAT_USER", [default user (maat)])
AC_ARG_WITH(maat-group,
AC_HELP_STRING([--with-maat-group=GROUP],
[set the default maat group to GROUP (default maat)]),
[ MAAT_GROUP="$with_maat_group" ],
[ MAAT_GROUP="maat" ])
AC_DEFINE_UNQUOTED(MAAT_GROUP, "$MAAT_GROUP", [default group (maat)])
AC_ARG_WITH(nobody-user,
AC_HELP_STRING([--with-nobody-user=USER],
[set the default unpriveleged user (default nobody)]),
[ NOBODY_USER="$with_nobody_user" ],
[ NOBODY_USER="nobody" ] )
AC_DEFINE_UNQUOTED(NOBODY_USER, "$NOBODY_USER", [unprivileged user--e.g. nobody])
AC_ARG_WITH(nobody-group,
AC_HELP_STRING([--with-nobody-group=GROUP],
[set the default unprivileged group (default nobody or nogroup)]),
[ NOBODY_GROUP="$with_nobody_group" ])
if test x"$with_nobody_group" = x; then
AC_MSG_CHECKING([the group for user "nobody"])
if grep '^nobody:' /etc/group >/dev/null 2>&1; then
NOBODY_GROUP=nobody
elif grep '^nogroup:' /etc/group >/dev/null 2>&1; then
NOBODY_GROUP=nogroup
else
NOBODY_GROUP=nobody # test for others?
fi
AC_MSG_RESULT($NOBODY_GROUP)
fi
AC_DEFINE_UNQUOTED(NOBODY_GROUP, "$NOBODY_GROUP", [unprivileged group for unprivileged user])
AC_ARG_ENABLE([capabilities],
[AS_HELP_STRING([--disable-capabilities],[Do not attempt to set capabilities when spawning APBs/ASPs.])],
[enable_capabilities=$enableval],
[enable_capabilities=yes])
AS_IF([test "x$enable_capabilities" = xyes],[
AC_SEARCH_LIBS([cap_set_proc], [cap], [],
[AC_MSG_FAILURE([libcap not installed/unusable])])
AC_CHECK_HEADER([sys/capability.h], [],
[AC_MSG_FAILURE([libcap devel files not installed])], [])
AC_DEFINE([USE_LIBCAP],[1], [Set capabilities when spawning APBs/ASPS.])])
AM_CONDITIONAL([USE_LIBCAP], test "x$enable_capabilities" = xyes)
# Enable macros for each ASP
AC_DEFUN([DEFAULT_ASP],
[
AC_ARG_ENABLE([asp_$1],
[AS_HELP_STRING([--disable-asp-$1],
[Disable building the $1 ASP])],
[build_$1_asp=$enableval],
[build_$1_asp=yes])
AM_CONDITIONAL(BUILD_$1_ASP, test "x$build_$1_asp" = xyes)
AS_IF([test "x$build_$1_asp" = "xyes"], [AC_DEFINE([BUILD_$1_ASP], [1], [Build the $1 ASP])], [])
])
AC_DEFUN([EXTRA_ASP],
[
AC_ARG_ENABLE([asp_$1],
[AS_HELP_STRING([--enable-asp-$1],
[Enable building the $1 ASP])],
[build_$1_asp=$enableval],
[build_$1_asp=no])
AM_CONDITIONAL(BUILD_$1_ASP, test "x$build_$1_asp" = xyes)
AS_IF([test "x$build_$1_asp" = "xyes"], [AC_DEFINE([BUILD_$1_ASP], [1], [Build the $1 ASP])], [])
])
AC_DEFUN([IF_ASP],
[AS_IF([test "x$build_$1_asp" = "xyes"], [$2], m4_default([$3],[]))])
EXTRA_ASP(iot_uart)
EXTRA_ASP(iot_appraiser)
DEFAULT_ASP(procopenfiles)
DEFAULT_ASP(hashservice)
DEFAULT_ASP(hashfileservice)
DEFAULT_ASP(md5fileservice)
DEFAULT_ASP(procfds)
DEFAULT_ASP(elf_reader)
DEFAULT_ASP(elf_appraise)
DEFAULT_ASP(netstatunix)
DEFAULT_ASP(netstattcp)
DEFAULT_ASP(netstatudp)
DEFAULT_ASP(netstatraw)
DEFAULT_ASP(netstattcp6)
DEFAULT_ASP(netstatudp6)
DEFAULT_ASP(netstatraw6)
DEFAULT_ASP(listdirectoryservice)
DEFAULT_ASP(ima)
DEFAULT_ASP(memorymapping)
DEFAULT_ASP(memorymapping_appraise)
DEFAULT_ASP(mtab)
DEFAULT_ASP(dummy_appraisal)
DEFAULT_ASP(lsproc)
DEFAULT_ASP(procroot)
DEFAULT_ASP(procenv)
DEFAULT_ASP(procmem)
EXTRA_ASP(passport_retriever)
EXTRA_ASP(passport_storer)
DEFAULT_ASP(passport_maker)
DEFAULT_ASP(system)
DEFAULT_ASP(rpminv)
DEFAULT_ASP(rpm_details)
DEFAULT_ASP(dpkg_inv)
DEFAULT_ASP(dpkg_details)
DEFAULT_ASP(whitelist)
DEFAULT_ASP(blacklist)
DEFAULT_ASP(lsmod)
DEFAULT_ASP(system_appraise)
DEFAULT_ASP(dpkg_check)
DEFAULT_ASP(send_execute)
DEFAULT_ASP(send_execute_tcp)
DEFAULT_ASP(serialize_graph)
DEFAULT_ASP(compress)
DEFAULT_ASP(decompress)
DEFAULT_ASP(encrypt)
DEFAULT_ASP(decrypt)
DEFAULT_ASP(create_measurement_contract)
DEFAULT_ASP(verify_measurement_contract)
DEFAULT_ASP(send)
DEFAULT_ASP(receive)
DEFAULT_ASP(sign_send)
DEFAULT_ASP(proc_namespaces)
DEFAULT_ASP(got_measure)
DEFAULT_ASP(got_appraise)
DEFAULT_ASP(merge)
DEFAULT_ASP(split)
DEFAULT_ASP(kernel_msmt)
DEFAULT_ASP(send_request)
EXTRA_ASP(tlm_ret)
DEFAULT_ASP(md5_hashcheck)
DEFAULT_ASP(deleg_meas_skeleton)
DEFAULT_ASP(deleg_meas_appraise_skeleton)
# End asp enable macros.
IF_ASP([elf_reader],
[AC_CHECK_LIB([elf],[elf_version], [],
[AC_MSG_ERROR(Can't find libelf. Please install the libelf development package)])
AC_CHECK_HEADER([gelf.h], [],
[AC_MSG_FAILURE([Can't find gelf.h. Please install the libelf development package])])
])
IF_ASP([elf_appraise],
[AC_CHECK_LIB([elf],[elf_version], [],
[AC_MSG_ERROR(Can't find libelf. Please install the libelf development package)])
AC_CHECK_HEADER([gelf.h], [],
[AC_MSG_FAILURE([Can't find gelf.h. Please install the libelf development package])])
])
IF_ASP([passport_retriever],
[PKG_CHECK_MODULES(LIBMONGOC, libmongoc-1.0 >= 1.0)
PKG_CHECK_MODULES(LIBBSON, libbson-1.0 >= 1.0)]
)
IF_ASP([passport_storer],
[PKG_CHECK_MODULES(LIBMONGOC, libmongoc-1.0 >= 1.0)
PKG_CHECK_MODULES(LIBBSON, libbson-1.0 >= 1.0)]
)
# Enable macros for each APB
AC_DEFUN([DEFAULT_APB],
[
AC_ARG_ENABLE([apb_$1],
[AS_HELP_STRING([--disable-apb-$1],
[Disable building the $1 APB])],
[build_$1_apb=$enableval],
[build_$1_apb=yes])
AM_CONDITIONAL(BUILD_$1_APB, test "x$build_$1_apb" = xyes)
AS_IF([test "x$build_$1_apb" = "xyes"], [AC_DEFINE([BUILD_$1_APB], [1], [Build the $1 APB])], [])
])
AC_DEFUN([EXTRA_APB],
[
AC_ARG_ENABLE([apb_$1],
[AS_HELP_STRING([--enable-apb-$1],
[Enable building the $1 APB])],
[build_$1_apb=$enableval],
[build_$1_apb=no])
AM_CONDITIONAL(BUILD_$1_APB, test "x$build_$1_apb" = xyes)
AS_IF([test "x$build_$1_apb" = "xyes"], [AC_DEFINE([BUILD_$1_APB], [1], [Build the $1 APB])], [])
])
AC_DEFUN([IF_APB],
[AS_IF([test "x$build_$1_apb" = "xyes"], [$2], m4_default([$3],[]))])
EXTRA_APB([iot_uart])
EXTRA_APB([iot_appraiser])
DEFAULT_APB([process_measurement])
DEFAULT_APB([userspace])
DEFAULT_APB([appraiser])
DEFAULT_APB([hashdir])
DEFAULT_APB([complex_att])
DEFAULT_APB([layered_att])
EXTRA_APB([passport_ret])
EXTRA_APB([passport_appraiser])
EXTRA_APB([passport_storage])
DEFAULT_APB([request_passport])
DEFAULT_APB([passport_userspace_appraiser])
DEFAULT_APB([hashfile])
DEFAULT_APB([kim])
DEFAULT_APB([forwarding])
DEFAULT_APB([no_op])
DEFAULT_APB([userspace_appraiser])
DEFAULT_APB([layered_appraiser])
EXTRA_APB([quiot_tlm])
EXTRA_APB([quiot_tlm_appraiser])
DEFAULT_APB([deleg_meas_skeleton])
DEFAULT_APB([deleg_meas_appraise_skeleton])
IF_APB([passport_ret],
[PKG_CHECK_MODULES(LIBMONGOC, libmongoc-1.0 >= 1.0)
PKG_CHECK_MODULES(LIBBSON, libbson-1.0 >= 1.0)]
)
IF_APB([passport_storage],
[PKG_CHECK_MODULES(LIBMONGOC, libmongoc-1.0 >= 1.0)
PKG_CHECK_MODULES(LIBBSON, libbson-1.0 >= 1.0)]
)
IF_APB([passport_appraiser],
[PKG_CHECK_MODULES(LIBMONGOC, libmongoc-1.0 >= 1.0)
PKG_CHECK_MODULES(LIBBSON, libbson-1.0 >= 1.0)]
)
AC_ARG_WITH([apb-install-dir],
AS_HELP_STRING([Directory in which to install APBs default is [LIBDIR/maat/apbs]]),
[APB_INSTALL_DIR="$withval"],
[APB_INSTALL_DIR="\$(pkglibdir)/apbs"])
AC_SUBST([APB_INSTALL_DIR])
AC_ARG_WITH([apb-info-dir],
AS_HELP_STRING([Directory in which to install APB metadata files [DATADIR/maat/apbs]]),
[APB_INFO_DIR="$withval"],
[APB_INFO_DIR="\$(pkgdatadir)/apbs"])
AC_SUBST([APB_INFO_DIR])
AC_ARG_WITH([asp-install-dir],
AS_HELP_STRING([Directory in which to install ASPs default is [LIBDIR/maat/asps]]),
[ASP_INSTALL_DIR="$withval"],
[ASP_INSTALL_DIR="\$(pkglibdir)/asps"])
AC_SUBST([ASP_INSTALL_DIR])
AC_ARG_WITH([asp-info-dir],
AS_HELP_STRING([Directory in which to install ASP metadata files [DATADIR/maat/asps]]),
[ASP_INFO_DIR="$withval"],
[ASP_INFO_DIR="\$(pkgdatadir)/asps"])
AC_SUBST([ASP_INFO_DIR])
AC_ARG_WITH([spec-install-dir],
AS_HELP_STRING([Directory in which to install measurement specification files [DATADIR/maat/measurement-specifications]]),
[SPEC_INSTALL_DIR="$withval"],
[SPEC_INSTALL_DIR="\$(pkgdatadir)/measurement-specifications"])
AC_SUBST([SPEC_INSTALL_DIR])
AC_ARG_WITH([selector-install-dir],
AS_HELP_STRING([Directory in which to install selector configuration files [DATADIR/attestmgr/selector-configurations]]),
[SELECTOR_INSTALL_DIR="$withval"],
[SELECTOR_INSTALL_DIR="\$(pkgdatadir)/selector-configurations"])
AC_SUBST([SELECTOR_INSTALL_DIR])
AC_ARG_ENABLE([tests],
[AS_HELP_STRING([--enable-tests],
[Enable Unit tests and gcov information (default=no)])],
[build_tests=$enableval],
[build_tests=no])
AC_ARG_ENABLE([coverage],
[AS_HELP_STRING([--enable-coverage],
[Enable unit test coverage (default=no)])],
[build_coverage=$enableval],
[build_coverage=no])
AC_ARG_ENABLE([web-ui],
[AS_HELP_STRING([--enable-web-ui],
[Enable web user interface (default=no)])],
[build_web_ui=$enableval],
[build_web_ui=no])
AC_ARG_ENABLE([pam],
[AS_HELP_STRING([--enable-pam],
[Enable PAM MODULE (default=no)])],
[build_pam=$enableval],
[build_pam=no])
AC_ARG_ENABLE([selinux],
[AS_HELP_STRING([--disable-selinux], [Disable setting SELinux context on ASP/APB exec])],
[enable_selinux=$enableval],
[enable_selinux=yes])
AC_ARG_ENABLE([photon],
[AS_HELP_STRING([--enable-photon], [Specify target as Photon OS for SELinux policy selection (default=no)])],
[enable_photon=$enableval],
[enable_photon=no])
AM_CONDITIONAL(ENABLE_PHOTON, test "x$enable_photon" = xyes)
# Enable
AS_IF([test "x$enable_selinux" = xyes],[
AC_CHECK_FILE([/usr/share/selinux/devel/Makefile],[],[AC_MSG_ERROR([You must have the selinux policy developer package installed.])])
AC_CHECK_LIB([selinux], [setexeccon], [],
[AC_MSG_ERROR([You must have the libselinux (development) libraries installed.])])
AC_CHECK_HEADER([selinux/selinux.h], [],
[AC_MSG_FAILURE([SELinux devel files not installed.])])
AC_DEFINE([ENABLE_SELINUX], [1], [Set SELinux context on ASP/APB exec])
AC_SUBST([SELINUX_LIBS],[-lselinux])
])
AM_CONDITIONAL(ENABLE_SELINUX, test "x$enable_selinux" = xyes)
AC_ARG_ENABLE([selinux-libdir-mapping],
AS_HELP_STRING([Use /usr/lib as the library directory when generating SELinux file contexts]),
[selinux_libdir_mapping=$enableval],
[selinux_libdir_mapping=yes])
AS_IF([test "x$selinux_libdir_mapping" = xyes],
[AC_SUBST(SE_LIBDIR, [/usr/lib])
AC_SUBST(SE_ASP_INSTALL_DIR, [/usr/lib/maat/asps])
AC_SUBST(SE_APB_INSTALL_DIR, [/usr/lib/maat/apbs])],
[AC_SUBST(SE_LIBDIR, [$libdir])
AC_SUBST(SE_ASP_INSTALL_DIR, [$ASP_INSTALL_DIR])
AC_SUBST(SE_APB_INSTALL_DIR, [$APB_INSTALL_DIR])])
AS_IF([test "x$build_tests" = xyes],[
PKG_CHECK_MODULES([CHECK], [check >= 0.9.4])
])
AM_CONDITIONAL(BUILD_COVERAGE, test "x$build_coverage" = xyes)
AM_CONDITIONAL(WEB_INTERFACE, test "x$build_web_ui" = xyes)
AM_CONDITIONAL(ENABLE_TESTS, test "x$build_tests" = xyes)
AM_CONDITIONAL(ENABLE_PAM, test "x$build_pam" = xyes)
# Check for systemd
AC_MSG_CHECKING(for systemd)
AC_ARG_WITH([systemdsystemunitdir],
[AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],,
[with_systemdsystemunitdir=auto])
AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], [
def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
AS_IF([test "x$def_systemdsystemunitdir" = "x"],
[AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
[AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
with_systemdsystemunitdir=no],
[with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
[AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"])
AC_MSG_RESULT($systemdsystemunitdir)
# if you couldn't find systemd ...
AS_IF([test "x$with_systemdsystemunitdir" = "xno"],
# Check for /etc/init. If there, install upstart script.
[AC_CHECK_FILE([/etc/init/],
[install_upstart_init=yes],
[AC_MSG_WARN("upstart script will not be installed")])],
[])
AM_CONDITIONAL(INSTALL_UPSTART_INIT, test "x$install_upstart_init" = xyes)
m4_include(m4/macros/enable-disable.m4)
AC_CONFIG_HEADERS([src/include/config.h])
AC_CONFIG_FILES([lib/Makefile lib/util/Makefile lib/graph/Makefile lib/asp/Makefile
lib/apb/Makefile
lib/sgraph/Makefile
lib/test/Makefile
lib/util/tpm2/Makefile
lib/common/Makefile
lib/measurement_spec/Makefile
lib/client/Makefile
lib/libmaat.pc
lib/libmaat_util.pc lib/libmaat_asp.pc
lib/libmaat_apb.pc
lib/libmaat_graph.pc
lib/libmaat_client.pc
lib/libmaat_sgraph.pc
lib/libmaat_measurement_spec.pc
Makefile
management-ui/Makefile
pam/Makefile
src/Makefile
src/asps/Makefile
src/types/Makefile
src/types/maat_basetypes.pc
src/types/address_space/Makefile
src/types/target/Makefile
src/types/measurement/Makefile
src/apbs/Makefile
src/am/Makefile
src/test/Makefile
src/include/Makefile
src/measurement_spec/Makefile
measurement-specs/Makefile
selector-configs/Makefile
selinux/Makefile
rpm/Makefile
initscripts/Makefile
documentation/Makefile
documentation/source/Makefile
])
AC_OUTPUT