-
Notifications
You must be signed in to change notification settings - Fork 3
/
configure.ac
111 lines (90 loc) · 2.68 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.67])
AC_INIT([libcuckoo], [0.1], [fawn-dev@mailman.srv.cs.cmu.edu])
AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
CPPFLAGS=""
CFLAGS=""
CXXFLAGS=""
dnl Regular debugging
dnl AX_CHECK_COMPILE_FLAG([-g], [CPPFLAGS="$CPPFLAGS -g"])
dnl AX_CHECK_COMPILE_FLAG([-gdwarf-2], [CPPFLAGS="$CPPFLAGS -gdwarf-2"])
dnl Profiling
dnl AX_CHECK_COMPILE_FLAG([-pg], [CPPFLAGS="$CPPFLAGS -pg"])
dnl Optimized
AX_CHECK_COMPILE_FLAG([-O4], [CPPFLAGS="$CPPFLAGS -O4"],
[AX_CHECK_COMPILE_FLAG([-O3], [CPPFLAGS="$CPPFLAGS -O3"])]
)
AX_CHECK_COMPILE_FLAG([-DNDEBUG], [CPPFLAGS="$CPPFLAGS -DNDEBUG"])
# Determine flags specific to C or C++
AC_LANG_PUSH([C])
AX_CHECK_COMPILE_FLAG([-std=c99], [CFLAGS="$CFLAGS -std=c99"])
AX_CHECK_COMPILE_FLAG([-Wall], [CFLAGS="$CFLAGS -Wall"])
#AX_CHECK_COMPILE_FLAG([-pthread], [CFLAGS="$CFLAGS -pthread"])
AC_LANG_POP([C])
AC_LANG_PUSH([C++])
AX_CHECK_COMPILE_FLAG([-std=c++0x], [CXXFLAGS="$CXXFLAGS -std=c++0x"])
AX_CHECK_COMPILE_FLAG([-stdlib=libc++], [CXXFLAGS="$CXXFLAGS -stdlib=libc++"])
AX_CHECK_COMPILE_FLAG([-Wall], [CXXFLAGS="$CXXFLAGS -Wall"])
#AX_CHECK_COMPILE_FLAG([-pthread], [CXXFLAGS="$CXXFLAGS -pthread"])
AC_LANG_POP([C++])
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
#AC_DISABLE_SHARED
AC_PROG_LIBTOOL
# Checks for libraries.
#AC_CHECK_LIB([pthread], [pthread_mutex_init], [], [echo "pthreads not found. Please install pthread library before proceeding"; exit -1])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_REALLOC
AC_CHECK_HEADERS([getopt.h])
dnl Check if we're a little-endian or a big-endian system, needed by hash code
AC_DEFUN([AC_C_ENDIAN],
[AC_CACHE_CHECK(for endianness, ac_cv_c_endian,
[
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([], [dnl
long val = 1;
char *c = (char *) &val;
exit(*c == 1);
])
],[
ac_cv_c_endian=big
],[
ac_cv_c_endian=little
])
])
if test $ac_cv_c_endian = big; then
AC_DEFINE(ENDIAN_BIG, 1, [machine is bigendian])
fi
if test $ac_cv_c_endian = little; then
AC_DEFINE(ENDIAN_LITTLE, 1, [machine is littleendian])
fi
])
AC_C_ENDIAN
dnl Check if we have stdbool
#AC_HEADER_STDBOOL
AH_BOTTOM([#if HAVE_STDBOOL_H
#include <stdbool.h>
#else
#define bool char
#define false 0
#define true 1
#endif ])
AC_CONFIG_FILES([ Makefile
lib/Makefile
testing/Makefile
])
AC_OUTPUT