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

source: sessionauth/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: 2.5 KB
Line 
1#                                               -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ(2.61)
5AC_INIT(sessionauth, 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
17
18
19AC_CHECK_LIB([cppunit], [main])
20
21# Checks for header files.
22AC_HEADER_STDC
23AC_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])
24
25# Checks for typedefs, structures, and compiler characteristics.
26AC_HEADER_STDBOOL
27AC_C_CONST
28AC_C_INLINE
29AC_TYPE_MODE_T
30AC_TYPE_PID_T
31AC_TYPE_SIZE_T
32AC_TYPE_SSIZE_T
33AC_HEADER_TIME
34AC_STRUCT_TM
35AC_TYPE_UINT32_T
36
37# Checks for library functions.
38AC_FUNC_ERROR_AT_LINE
39AC_FUNC_MEMCMP
40AC_TYPE_SIGNAL
41AC_CHECK_FUNCS([gethostname gettimeofday memset socket strerror])
42
43AC_PROG_RANLIB
44AM_PROG_AR
45
46#check for unordered map
47[SAVECXXFLAGS=$CXXFLAGS; CXXFLAGS="-std=c++0x"]
48AC_LANG_CPLUSPLUS
49
50AC_CACHE_CHECK([whether unordered_map is available],
51                        [ac_cv_unordered_map_exists],
52[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unordered_map>]],
53                                [[std::unordered_map<int,int> testmap;]])],
54                                [ac_cv_unordered_map_exists=yes],
55                                [ac_cv_unordered_map_exists=no])])
56[CXXFLAGS=$SAVECXXFLAGS]
57
58AC_ARG_ENABLE([unorderedmap],
59        [AS_HELP_STRING([--disable-unorderedmap], [disable unorderedmap (default: unorderedmap enabled)])],
60        [sessionauth_unorderedmap=$enableval],
61        [sessionauth_unorderedmap=yes])
62
63AM_CONDITIONAL(NSIS_NO_WARN_HASHMAP, test "$ac_cv_unordered_map_exists" = yes)
64# enable use of UNORDERED_MAP if it exists and its use it not disabled
65AM_CONDITIONAL(USE_UNORDERED_MAP, [test "$ac_cv_unordered_map_exists" = yes -a "$sessionauth_unorderedmap" != no])
66
67
68# Logging
69AC_ARG_ENABLE([logging],
70        [AS_HELP_STRING([--disable-logging], [disable logging output (default: logging enabled)])],
71        [sauth_logging=$enableval],
72        [sauth_logging=yes])
73AM_CONDITIONAL(SAUTH_DISABLE_LOGGING, test "$sauth_logging" = no)
74
75# Benchmark
76AC_ARG_ENABLE([benchmark],
77        [AS_HELP_STRING([--enable-benchmark], [enable benchmark output (default: benchmark disabled)])],
78        [sauth_benchmark=$enableval],
79        [sauth_benchmark=no])
80AM_CONDITIONAL(SAUTH_ENABLE_BENCHMARK, test "$sauth_benchmark" = yes)
81
82
83#further CONFIG_FILES
84AC_CONFIG_FILES([Makefile
85                 src/Makefile
86                 test/Makefile])
87AC_OUTPUT
88
89# end configure.ac
Note: See TracBrowser for help on using the repository browser.