-
Notifications
You must be signed in to change notification settings - Fork 4
/
configure.ac
116 lines (93 loc) · 3.19 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([abcip],[m4_esyscmd(build-aux/git-version-gen .tarball-version)],[crc181@gmail.com])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_SRCDIR([src/])
AC_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE([-Wall -Wno-extra-portability -Werror foreign])
AC_CONFIG_MACRO_DIR([m4])
# Checks for programs.
AC_PROG_CXX
AC_PROG_GREP
AC_PROG_INSTALL
LT_INIT
# Set default language to C++
AC_LANG([C++])
AX_CXX_COMPILE_STDCXX_11
# Checks for libraries.
AC_CHECK_LIB([pcap], [pcap_lib_version],,AC_MSG_ERROR(Missing libpcap >= 1.0.0))
# Checks for header files.
AC_HEADER_STDBOOL
AC_CHECK_HEADERS([arpa/inet.h netinet/in.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
# Visibility foo (enable it if we can)
gl_VISIBILITY()
CPPFLAGS="$CFLAG_VISIBILITY $CPPFLAGS"
# Checks for library functions.
AC_CHECK_FUNCS([gettimeofday memset strcasecmp strncasecmp strtol])
# Enable address sanitizer
AC_ARG_ENABLE(address-sanitizer,
AS_HELP_STRING([--enable-address-sanitizer],[enable address sanitizer support]),
[
AX_CHECK_COMPILE_FLAG([-fsanitize=address], [SANITIZER_CXXFLAGS="$SANITIZER_CXXFLAGS -fsanitize=address"])
AX_CHECK_COMPILE_FLAG([-fno-omit-frame-pointer], [SANITIZER_CXXFLAGS="$SANITIZER_CXXFLAGS -fno-omit-frame-pointer"])
AX_CHECK_LINK_FLAG([-fsanitize=address], [SANITIZER_LDFLAGS="$SANITIZER_LDFLAGS -fsanitize=address"], [], [$SANITIZER_LDFLAGS])
])
# abc daq
AC_ARG_ENABLE([daq],
AS_HELP_STRING([--disable-daq],[disable building the abcip DAQ module (default=auto)]))
if test "x$enable_daq" != "xno" ; then
# Checks for the LibDAQ headers.
AC_CHECK_DAQ_HEADERS
if test "x$HAVE_DAQ_HEADERS" != "xyes"; then
AC_MSG_WARN([Could not find LibDAQ headers, disabling DAQ module build...])
enable_daq=no
else
enable_daq=yes
fi
fi
AM_CONDITIONAL([BUILD_DAQ], [test "x$enable_daq" = "xyes"])
# Check for asciidoc. If it's present, enable rebuilding the HTML documentation.
AC_CHECK_PROG([have_asciidoc], [asciidoc], yes)
AM_CONDITIONAL([HAVE_ASCIIDOC], [test "x$have_asciidoc" = "xyes"])
AM_CPPFLAGS="-Wall -Wextra -Wformat -Wformat-security -pedantic ${LIBDAQ_CPPFLAGS}"
if test -n "$SANITIZER_CXXFLAGS" ; then
CXXFLAGS="$SANITIZER_CXXFLAGS $CXXFLAGS"
fi
if test -n "$SANITIZER_LDFLAGS" ; then
LDFLAGS="$SANITIZER_LDFLAGS $LDFLAGS"
fi
AC_SUBST([AM_CPPFLAGS])
AC_CONFIG_FILES([ \
Makefile \
src/Makefile \
src/common/Makefile \
src/protos/Makefile \
src/app/Makefile \
src/daq/Makefile \
doc/Makefile \
test/Makefile \
])
AC_OUTPUT
AC_MSG_RESULT([
$PACKAGE $VERSION
prefix: ${prefix}
sysconfdir: ${sysconfdir}
libdir: ${libdir}
includedir: ${includedir}
compiler++: ${CXX}
cppflags: ${CPPFLAGS}
am_cppflags: ${AM_CPPFLAGS}
cxxflags: ${CXXFLAGS}
am_cxxflags: ${AM_CXXFLAGS}
ldflags: ${LDFLAGS}
am_ldflags: ${AM_LDFLAGS}
libs: ${LIBS}
Build DAQ module : $enable_daq
])