NSIS-ka
A free C++ implementation of NSIS protocols

source: natfw-nslp/trunk/configure.ac @ 6768

Last change on this file since 6768 was 6768, checked in by bless@…, 4 years ago
  • better autotools checks for libraries
File size: 3.5 KB
Line 
1#                                               -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ(2.61)
5AC_INIT(natfw-nslp-ka, 0.98, roland.bless@kit.edu)
6AM_INIT_AUTOMAKE([1.11 silent-rules -Wall -Werror foreign])
7
8# silent build by default
9# override with ./configure --disable-silent-rules or make V=1
10AM_SILENT_RULES([yes])
11
12# Checks for programs.
13AC_PROG_CXX
14AC_PROG_CC
15AC_PROG_MAKE_SET
16AC_PROG_CPP
17AM_PROG_AR
18
19
20AC_CHECK_LIB([cppunit], [main])
21
22# Checks for header files.
23AC_HEADER_STDC
24AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h stdlib.h string.h sys/param.h sys/socket.h sys/time.h unistd.h])
25
26# Checks for typedefs, structures, and compiler characteristics.
27AC_HEADER_STDBOOL
28AC_C_CONST
29AC_C_INLINE
30AC_TYPE_MODE_T
31AC_TYPE_PID_T
32AC_TYPE_SIZE_T
33AC_TYPE_SSIZE_T
34AC_HEADER_TIME
35AC_STRUCT_TM
36AC_TYPE_UINT32_T
37
38# Checks for library functions.
39AC_FUNC_ERROR_AT_LINE
40AC_FUNC_MEMCMP
41AC_TYPE_SIGNAL
42AC_CHECK_FUNCS([gethostname gettimeofday memset socket strerror])
43
44AC_PROG_RANLIB
45
46#check for C libs
47AC_CHECK_LIB([ssl], [SSL_CTX_new],  , [AC_MSG_FAILURE("OpenSSL is not installed")])
48AC_CHECK_LIB([crypto], [EVP_PKEY_new],  , [AC_MSG_FAILURE("OpenSSL is not installed")])
49
50
51#check for unordered map
52[SAVECXXFLAGS=$CXXFLAGS; CXXFLAGS="-std=c++0x"]
53AC_LANG_CPLUSPLUS
54
55
56AC_CACHE_CHECK([whether unordered_map is available],
57                        [ac_cv_unordered_map_exists],
58[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unordered_map>]],
59                                [[std::unordered_map<int,int> testmap;]])],
60                                [ac_cv_unordered_map_exists=yes],
61                                [ac_cv_unordered_map_exists=no])])
62[CXXFLAGS=$SAVECXXFLAGS]
63
64AC_ARG_ENABLE([unorderedmap],
65        [AS_HELP_STRING([--disable-unorderedmap], [disable unorderedmap (default: unorderedmap enabled)])],
66        [natfwnslp_unorderedmap=$enableval],
67        [natfwnslp_unorderedmap=yes])
68# enable use of UNORDERED_MAP if it exists and its use it not disabled
69AM_CONDITIONAL(USE_UNORDERED_MAP, [test "$ac_cv_unordered_map_exists" = yes -a "$natfwnslp_unorderedmap" != no])
70
71AM_CONDITIONAL(NSIS_NO_WARN_HASHMAP, test "$ac_cv_unordered_map_exists" = yes)
72
73## libnetfilter_queue or obsolete libipq
74AC_ARG_ENABLE([nfq],
75        [AS_HELP_STRING([--enable-nfq], [compile with libnetfilter_queue support (default: disabled)])],
76        [protlib_with_nfq=$enableval],
77        [protlib_with_nfq=no])
78
79
80
81#LIB NETFILTER_QUEUE
82AM_CONDITIONAL(PROTLIB_WITH_NFQ, test "$protlib_with_nfq" = yes)
83if test $protlib_with_nfq = yes; then
84        AC_CHECK_LIB([netfilter_queue],[nfq_get_payload],,[AC_MSG_ERROR([cannot find libnetfilter_queue, probably you need to install libnetfilter-queue-dev first])])
85else
86        AC_CHECK_LIB([ipq], [ipq_get_packet],,[AC_MSG_ERROR([cannot find libipq, probably you need to install iptables-dev(el) first])])
87fi
88
89AC_ARG_ENABLE([sctp],
90        [AS_HELP_STRING([--enable-sctp], [include SCTP transport capability (default: enabled)])],
91        [enable_sctp=$enableval],
92        [enable_sctp=no])
93AM_CONDITIONAL(USE_WITH_SCTP, test "$enable_sctp" = yes)
94
95# Logging
96AC_ARG_ENABLE([logging],
97        [AS_HELP_STRING([--disable-logging], [disable logging output (default: logging enabled)])],
98        [natfwnslp_logging=$enableval],
99        [natfwnslp_logging=yes])
100AM_CONDITIONAL(NATFWNSLP_DISABLE_LOGGING, test "$natfwnslp_logging" = no)
101
102# Benchmark
103AC_ARG_ENABLE([benchmark],
104        [AS_HELP_STRING([--enable-benchmark], [enable benchmark output (default: benchmark disabled)])],
105        [natfwnslp_benchmark=$enableval],
106        [natfwnslp_benchmark=no])
107AM_CONDITIONAL(NATFWNSLP_ENABLE_BENCHMARK, test "$natfwnslp_benchmark" = yes)
108
109
110
111AC_CONFIG_FILES([Makefile
112                 src/msg/Makefile
113                 src/Makefile
114                 test/Makefile])
115
116
117AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.