-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.ac
190 lines (154 loc) · 5.61 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
AC_PREREQ(2.60)
m4_define(axa_major_version, 3)
m4_define(axa_minor_version, 0)
m4_define(axa_patchlevel_version, 2)
m4_define(axa_version,
axa_major_version.axa_minor_version.axa_patchlevel_version)
AC_INIT([axa],
[axa_version()],
[https://github.com/farsightsec/axa/issues],
[axa],
[https://github.com/farsightsec/axa])
PACKAGE_DESCRIPTION="Farsight Security Advanced Exchange Access (AXA)"
AC_SUBST(PACKAGE_DESCRIPTION)
AC_CONFIG_SRCDIR([axa/axa.h])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules subdir-objects])
AC_PROG_CC_STDC
AC_USE_SYSTEM_EXTENSIONS
AC_SYS_LARGEFILE
AC_CONFIG_MACRO_DIR([m4])
AM_SILENT_RULES([yes])
LT_INIT
AXA_MAJOR_VERSION=axa_major_version()
AXA_MINOR_VERSION=axa_minor_version()
AXA_PATCHLEVEL_VERSION=axa_patchlevel_version()
AXA_VERSION=axa_version()
AC_SUBST(AXA_MAJOR_VERSION)
AC_SUBST(AXA_MINOR_VERSION)
AC_SUBST(AXA_PATCHLEVEL_VERSION)
AC_SUBST(AXA_VERSION)
my_CFLAGS=" \
-Wextra -Wall -Wbad-function-cast -Wcast-align -Wmissing-noreturn \
-Wnested-externs -Wpointer-arith -Wshadow -Wwrite-strings \
-Wdeclaration-after-statement -Wswitch-enum \
-Wunused \
-Wunreachable-code \
-Wuninitialized \
-Wno-unknown-pragmas \
-Wmissing-declarations -Wmissing-prototypes \
-Wsign-compare -Wchar-subscripts \
-Wstrict-prototypes -Wshadow \
-Wformat-security \
-Wno-unused-command-line-argument"
AC_SUBST([my_CFLAGS])
AC_CHECK_FUNCS([floor gettimeofday])
AC_CONFIG_HEADERS(config.h)
PKG_PROG_PKG_CONFIG
if test -n "$PKG_CONFIG"; then
if $PKG_CONFIG --variable=pc_path pkg-config 2>/dev/null | grep -q /libdata/; then
PKG_INSTALLDIR(['${prefix}/libdata/pkgconfig'])
else
PKG_INSTALLDIR
fi
fi
LT_LIB_M
MY_CHECK_LIBPCAP
save_LIBS="$LIBS"
AC_SEARCH_LIBS([strlcpy],
[bsd],
[strlcpy_LIBS="$LIBS"],
[AC_MSG_ERROR([could not find libbsd, it can be downloaded here: http://libbsd.freedesktop.org/wiki/])]
)
LIBS="$save_LIBS"
AC_SUBST(strlcpy_LIBS)
PKG_CHECK_MODULES([libedit], [libedit], [], [MY_CHECK_LIBEDIT])
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$libedit_CFLAGS"
AC_MSG_CHECKING(libedit has unicode)
AC_CHECK_TYPES([el_rfunc_t],
AC_DEFINE([LIBEDIT_IS_UNICODE], [1],
[Define if libedit has unicode support.]),
[], [[#include <histedit.h>]])
CPPFLAGS="$save_CPPFLAGS"
PKG_CHECK_MODULES([libnmsg], [libnmsg >= 0.9.1])
#AC_CHECK_FUNCS([nmsg_get_version])
#AC_CHECK_FUNCS([wdns_get_version])
PKG_CHECK_MODULES([libwdns], [libwdns])
PKG_CHECK_MODULES([libssl], [libssl])
PKG_CHECK_MODULES([libcrypto], [libcrypto])
AC_CHECK_HEADERS([libgen.h])
AC_ARG_WITH([yajl], AS_HELP_STRING([--without-yajl], [Disable yajl support]))
if test "x$with_yajl" != "xno"; then
PKG_CHECK_MODULES([yajl], [yajl >= 2.1.0])
AC_DEFINE([HAVE_YAJL], [1], [Define to 1 if yajl support is enabled.])
use_yajl="true"
else
use_yajl="false"
fi
AM_CONDITIONAL([HAVE_YAJL], [test "$use_yajl" = "true"])
PKG_CHECK_MODULES([check], [check >= 0.9.10],
[CHECK_MOD_MSG="yes"], [CHECK_MOD_MSG="no"])
AC_PATH_PROG([DOXYGEN], [doxygen])
AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
if test -n "$DOXYGEN"; then
DOC_HTML_MSG="yes, doxygen available: $DOXYGEN"
AC_MSG_CHECKING(doxygen version)
installed_version=`$DOXYGEN --version 2>/dev/null`
AS_VERSION_COMPARE($installed_version, "1.8.3",
DOXYGEN_version="oldish",
DOXYGEN_version="newish",
DOXYGEN_version="newish")
AC_MSG_RESULT($DOXYGEN_version)
AC_CONFIG_FILES([Doxyfile])
DOXYGEN_INPUT="${srcdir}/axa ${srcdir}/README.md"
AC_SUBST(DOXYGEN_INPUT)
if test $DOXYGEN_version = "oldish"; then
AC_MSG_WARN(old Doxygen version found API documentation may not render as intended consider upgrading to version 1.8.3 or newer)
fi
else
DOC_HTML_MSG="no, doxygen not available"
fi
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$libnmsg_CFLAGS"
AC_CHECK_HEADERS([nmsg/base/dnsqr.pb-c.h nmsg/base/encode.pb-c.h nmsg/base/packet.pb-c.h nmsg/sie/newdomain.pb-c.h],
[],
[AC_MSG_ERROR([required header file not found])])
CPPFLAGS="$save_CPPFLAGS"
AX_DEFINE_DIR([CONFDIR], [sysconfdir/axa], [config dir for axa])
AC_DEFINE_UNQUOTED(AXACONFDIR,"$CONFDIR",[config dir for axa])
AC_CONFIG_FILES([Makefile axa/libaxa.pc axa/version.h])
AC_CONFIG_FILES([sratool/sratool.man sratool/radtool.man sratool/options.man
sratunnel/sratunnel.man sratunnel/radtunnel.man
tools/axa_link_certs.man tools/axa_make_cert.man
tools/axa_server_cert.man])
AC_CONFIG_FILES([tools/axa_link_certs],
[chmod +x tools/axa_link_certs])
AC_CONFIG_FILES([tools/axa_make_cert],
[chmod +x tools/axa_make_cert])
AC_CONFIG_FILES([tools/axa_server_cert],
[chmod +x tools/axa_server_cert])
AC_CONFIG_FILES([tests/test-tools-without-server.sh],
[chmod +x tests/test-tools-without-server.sh])
AC_CONFIG_FILES([tests/test-tools-with-server.sh],
[chmod +x tests/test-tools-with-server.sh])
AC_CONFIG_FILES([tests/test-config],
[chmod 600 tests/test-config])
AC_CONFIG_FILES([tests/test-config-badperms],
[chmod 640 tests/test-config-badperms])
AC_OUTPUT
AC_MSG_RESULT([
$PACKAGE $VERSION
compiler: ${CC}
cflags: ${CFLAGS}
ldflags: ${LDFLAGS}
libs: ${LIBS}
prefix: ${prefix}
sysconfdir: ${sysconfdir}
libdir: ${libdir}
includedir: ${includedir}
pkgconfigdir: ${pkgconfigdir}
building html docs: ${DOC_HTML_MSG}
yajl support: ${use_yajl}
make check available: ${CHECK_MOD_MSG}
])