-
Notifications
You must be signed in to change notification settings - Fork 19
/
configure.ac
55 lines (39 loc) · 1.34 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
# Process this file with autoreconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([large-pcap-analyzer], [3.8.2], [[email protected]])
AC_CONFIG_SRCDIR([src])
AC_CONFIG_HEADERS([src/config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE
AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [Enable debug build; default is release]),[enable_debug=$enableval],[enable_debug=no])
# do not get the -g -O2 default CFLAGS:
: ${CFLAGS=""}
: ${CXXFLAGS=""}
# handle debug/release build
common_flags="-Wall -Wextra -Werror"
# useful for debug builds:
debug_flags="$common_flags -g -O0 -DDEBUG"
release_flags="$common_flags -O3"
AC_MSG_CHECKING([for debug build mode])
AS_IF([test "x$enable_debug" = "xyes"], [
CXXFLAGS="$CXXFLAGS $debug_flags"
AC_MSG_RESULT([debug mode enabled])
], [
CXXFLAGS="$CXXFLAGS $release_flags"
AC_MSG_RESULT([release mode enabled])
])
# Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AX_CXX_COMPILE_STDCXX_11([noext], [optional])
AC_PROG_INSTALL
AC_PROG_MAKE_SET
# Checks for libraries.
AC_CHECK_LIB([pcap], [pcap_open_live], [], [echo "PCAP library not found. Aborting." ; exit 1])
# Checks for header files.
AC_CHECK_HEADER([pcap.h])
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_CHECK_FUNCS([gettimeofday memset])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT