-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfigure.ac
72 lines (58 loc) · 1.95 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
#
# configure.in for the attest-tools project
#
AC_INIT(attest-tools, 0.1.0, <[email protected]>)
AM_INIT_AUTOMAKE([-Wall foreign subdir-objects])
# Enable debug.
AC_ARG_ENABLE([debug], [ --enable-debug Turn on debugging],
[debug=${enableval}], [debug=no])
if test -z "$CFLAGS"; then
if test "$debug" == yes; then
CFLAGS="-O0 -g"
else
CFLAGS="-O2"
fi
fi
if test "$debug" == yes; then
CFLAGS="$CFLAGS -DDEBUG"
fi
AC_USE_SYSTEM_EXTENSIONS
AM_PROG_AR
AC_DISABLE_STATIC
AC_PROG_CC_STDC
AM_PROG_CC_C_O
AC_SYS_LARGEFILE
AC_PROG_LIBTOOL
# Debugging support
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug], [turn on all debugging flags [default is off]]),
[enable_debug="yes"
AC_MSG_RESULT([*** Enabling debugging at user request ***])],)
AC_SEARCH_LIBS([SHA256_Init], [crypto], [],
AC_MSG_ERROR([Unable to find the OpenSSL library]))
AC_SEARCH_LIBS([curl_easy_setopt], [curl], [],
AC_MSG_ERROR([Unable to find the curl library]))
AC_SEARCH_LIBS([json_object_new_object], [json-c], [],
AC_MSG_ERROR([Unable to find the json-c library]))
AC_SEARCH_LIBS([TSS_Create], [tss ibmtss], [],
AC_MSG_ERROR([Unable to find the TSS2 library]))
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h])
AC_CHECK_HEADER([openssl/evp.h])
AC_CHECK_HEADER([curl/curl.h])
AC_CHECK_HEADER([json-c/json.h])
#AC_CHECK_HEADER([tss2/tss.h],[AC_DEFINE(TSS_INCLUDE,tss2)],
# AC_CHECK_HEADER([ibmtss/tss.h],[AC_DEFINE(TSS_INCLUDE,ibmtss)],
# AC_MSG_ERROR([No TSS2 include directory found])))
AC_DEFINE(TSS_INCLUDE,ibmtss)
AC_CHECK_LIB([digestlists], [ima_init_gpgme],[digestlists=true],[],[])
AM_CONDITIONAL([DIGESTLISTS], [test x$digestlists = xtrue])
CFLAGS="$CFLAGS -Wall -Werror -DTPM_POSIX"
AC_SUBST(CFLAGS)
AC_SUBST(TSS_INCLUDE)
AC_OUTPUT([Makefile libs/Makefile libs/event_log/Makefile
verifiers/Makefile src/Makefile scripts/Makefile
tests/Makefile])
cat <<EOF
CFLAGS: ${CFLAGS}
EOF