This repository has been archived by the owner on Jan 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 78
/
configure.ac
110 lines (91 loc) · 3.74 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
AC_INIT([cve-check-tool], 5.6.4, [[email protected]], [cve-check-tool], [https://github.com/ikeydoherty/cve-check-tool])
AM_INIT_AUTOMAKE([-Wno-portability no-dist-gzip dist-xz foreign subdir-objects])
AC_PROG_CC
AC_PROG_CC_STDC
LT_PREREQ(2.2)
AC_CONFIG_HEADERS([config.h])
AC_PREFIX_DEFAULT(/usr/local)
AM_SILENT_RULES([yes])
LT_INIT([disable-static])
AC_CONFIG_MACRO_DIR([m4])
AX_VALGRIND_CHECK
m4_define([glib_required_version], [2.36.0])
m4_define([libxml2_required_version], [2.9.1])
m4_define([curl_required_version], [7.29.0])
m4_define([gobject_required_version], [2.0])
m4_define([check_required_version], [0.9])
m4_define([json_required_version], [0.16.0])
m4_define([openssl_required_version],[1.0.0])
# TODO: Set minimum sqlite
AC_CHECK_FUNCS_ONCE(malloc_trim)
PKG_CHECK_MODULES(CVE_CHECK_TOOL,
[
glib-2.0 >= glib_required_version,
gio-2.0 >= glib_required_version,
libxml-2.0 >= libxml2_required_version,
libcurl >= curl_required_version,
gobject-2.0 >= gobject_required_version,
sqlite3,
openssl >= openssl_required_version
])
PKG_CHECK_MODULES(MODULE_COMMON,
[
libxml-2.0 >= libxml2_required_version,
glib-2.0 >= glib_required_version
])
PKG_CHECK_MODULES(CHECK,
check >= check_required_version,
[have_check=yes], [have_check=no]
)
AM_CONDITIONAL(ENABLE_UNIT_TESTS, test x$have_check = xyes)
have_coverage=no
AC_ARG_ENABLE(coverage, AS_HELP_STRING([--enable-coverage], [enable test coverage]))
if test "x$enable_coverage" = "xyes" ; then
AC_CHECK_PROG(lcov_found, [lcov], [yes], [no])
if test "x$lcov_found" = xno ; then
AC_MSG_ERROR([*** lcov support requested but the program was not found])
else
lcov_version_major="`lcov --version | cut -d ' ' -f 4 | cut -d '.' -f 1`"
lcov_version_minor="`lcov --version | cut -d ' ' -f 4 | cut -d '.' -f 2`"
if test "$lcov_version_major" -eq 1 -a "$lcov_version_minor" -lt 10; then
AC_MSG_ERROR([*** lcov version is too old. 1.10 required])
else
have_coverage=yes
AC_DEFINE([COVERAGE], [1], [Coverage enabled])
fi
fi
fi
AM_CONDITIONAL([COVERAGE], [test "$have_coverage" = "yes"])
AC_ARG_ENABLE(run_in_tree, AS_HELP_STRING([--enable-run-in-tree], [enable running from git tree]))
if test "x$enable_run_in_tree" = "xyes" ; then
AC_DEFINE([INTREE], [1], [In-tree usage enabled])
else
enable_run_in_tree="no"
fi
AM_CONDITIONAL([INTREE], [test "$enable_run_in_tree" = "yes"])
AC_ARG_ENABLE(relative_plugins, AS_HELP_STRING([--enable-relative-plugins], [enable relative plugin location lookup]))
if test "x$enable_relative_plugins" = "xyes" ; then
AC_DEFINE([RELATIVE_PLUGINS], [1], [Relative plugin location lookup])
else
enable_relative_plugins="no"
fi
AM_CONDITIONAL([RELATIVE_PLUGINS], [test "$enable_relative_plugins" = "yes"])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
AC_MSG_RESULT([
cve-check-tool $VERSION
========
prefix: ${prefix}
libdir: ${libdir}
sysconfdir: ${sysconfdir}
exec_prefix: ${exec_prefix}
bindir: ${bindir}
datarootdir: ${datarootdir}
coverage: ${have_coverage}
unit-tests: ${have_check}
run-in-tree: ${enable_run_in_tree}
compiler: ${CC}
cflags: ${CFLAGS}
ldflags: ${LDFLAGS}
Relative plugins: ${enable_relative_plugins}
])