forked from mtcp-stack/mtcp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
174 lines (151 loc) · 5.2 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([mtcp], [3], [[email protected]])
AC_CONFIG_SRCDIR([mtcp/src/eventpoll.c])
AC_CONFIG_HEADERS([config.h])
# Checks for programs.
AC_PROG_CC
AC_PROG_RANLIB
AC_LANG(C)
AC_DISABLE_OPTION_CHECKING
AC_CHECK_PROG(BC_CHECK,bc,yes)
if test x"$BC_CHECK" != x"yes" ; then
AC_MSG_ERROR([Please install bc before compiling mTCP.])
fi
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADER([linux/sched.h],,AC_MSG_ERROR([Could not find linux/sched.h]))
AC_CHECK_HEADER([pthread.h],,AC_MSG_ERROR([Could not find pthread.h]))
AC_CHECK_HEADER([numa.h],,AC_MSG_ERROR([Could not find numa.h]))
AC_CHECK_HEADER([arpa/inet.h],,AC_MSG_ERROR([Could not find arpa/inet.h]))
AC_CHECK_HEADER([fcntl.h],,AC_MSG_ERROR([Could not find fcntl.h]))
AC_CHECK_HEADER([limits.h],,AC_MSG_ERROR([Could not find limits.h]))
AC_CHECK_HEADER([netdb.h],,AC_MSG_ERROR([netdb.h]))
AC_CHECK_HEADER([netinet/in.h],,AC_MSG_ERROR([Could not find netinet/in.h]))
AC_CHECK_HEADER([stdint.h],,AC_MSG_ERROR([Could not find stdint.h]))
AC_CHECK_HEADER([stdlib.h],,AC_MSG_ERROR([Could not find stdlib.h]))
AC_CHECK_HEADER([string.h],,AC_MSG_ERROR([Could not find string.h]))
AC_CHECK_HEADER([sys/ioctl.h],,AC_MSG_ERROR([Could not find sys/ioctl.h]))
AC_CHECK_HEADER([sys/socket.h],,AC_MSG_ERROR([Could not find sys/socket.h]))
AC_CHECK_HEADER([sys/time.h],,AC_MSG_ERROR([Could not find sys/time.h]))
AC_CHECK_HEADER([unistd.h],,AC_MSG_ERROR([Could not find unistd.h]))
AC_CHECK_HEADER([gmp.h],,AC_MSG_ERROR([Could not find gmp.h]))
# Check for AC_PTHREAD [FC is preventing this to be enabled..]
#AX_PTHREAD( [
# AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.])
# CLIBS="$PTHREAD_LIBS $LIBS"
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# LDFLAGS="$LDFLAGS $PTHREAD_CFLAGS"
# CC="$PTHREAD_CC"],[])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_INT8_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_MMAP
AC_CHECK_FUNC([clock_gettime],,AC_MSG_ERROR([librt library is missing]))
AC_CHECK_FUNCS([bzero getpagesize gettimeofday memmove memset munmap select socket strchr strerror strstr strtol],,AC_MSG_ERROR([glibc library is missing]))
# Reset DPDK to 0
AC_SUBST(DPDK, 0)
# Reset enforcement value
AC_SUBST(ENFORCE_RX_IDLE, 0)
AC_SUBST(RX_IDLE_THRESH, 0)
# Reset DPDK's LRO to 0
AC_SUBST(LRO, 0)
# Reset PSIO to 0
AC_SUBST(PSIO, 0)
# Reset ONVM to 0
AC_SUBST(ONVM, 0)
# Reset NETMAP to 0
AC_SUBST(NETMAP, 0)
# Reset HWCSUM to 1
AC_SUBST(HWCSUM, 1)
AC_SUBST(DPDK, 1)
PKG_CHECK_MODULES(DPDK, [libdpdk])
# Check dpdk-17.08 path (lib & inc)
AC_ARG_WITH(stuff, [ --with-dpdk-lib path to the dpdk-17.08 install root])
if test "$with_dpdk_lib" != ""
then
AC_SUBST(DPDKLIBPATH, $with_dpdk_lib)
AC_SUBST(DPDK, 1)
AC_ARG_WITH(stuff, [ --with-rx-idle[=ARG] how much idle cycles needed before enforcing timeout (dpdk-only)])
if test "$with_rx_idle" != ""
then
AC_SUBST(ENFORCE_RX_IDLE, 1)
AC_SUBST(RX_IDLE_THRESH, $with_rx_idle)
fi
fi
AM_CONDITIONAL([DPDK], [test x$DPDK = x1])
dnl Example of default-disabled feature
AC_ARG_ENABLE([lro],
AS_HELP_STRING([--enable-lro], [Enable dpdk lro (for relevant NICs)]))
if test "$with_dpdk_lib" != ""
then
if test "x$enable_lro" = "xyes"
then
AC_SUBST(LRO, 1)
fi
fi
dnl Example of default-disabled feature
AC_ARG_ENABLE([ccp],
AS_HELP_STRING([--enable-ccp], [Enable Congestion Control Plane (CCP)]))
if test "x$enable_ccp" = "xyes"
then
AC_SUBST(CCP, 1)
fi
dnl Example of default-enabled feature
AC_ARG_ENABLE([hwcsum],
AS_HELP_STRING([--disable-hwcsum], [Disable h/w-based checksum offloading (for relevant NICs)]))
if test "x$enable_hwcsum" = "xno"
then
AC_SUBST(HWCSUM, 0)
fi
# Check psio path (lib & inc)
AC_ARG_WITH(stuff, [ --with-psio-lib path to the ioengine install root])
if test "$with_psio_lib" != ""
then
AC_SUBST(PSLIBPATH, $with_psio_lib)
AC_SUBST(PSIO, 1)
fi
dnl Example of default-disabled feature
AC_ARG_ENABLE([netmap],
AS_HELP_STRING([--enable-netmap], [Enable netmap module]))
AS_IF([test "x$enable_netmap" = "xyes"], [
AC_SUBST(NETMAP, 1)
])
# Check onvm lib path
AC_ARG_WITH(stuff, [ --with-onvm-lib path to the onvm install root])
if test "$with_onvm_lib" != ""
then
AC_SUBST(ONVMLIBPATH, $with_onvm_lib)
AC_SUBST(ONVM, 1)
fi
# if test "$with_psio_lib" == "" && test "$with_dpdk_lib" == "" && test "$enable_netmap" = ""
# then
# AC_MSG_ERROR([Packet I/O library is missing. Please set either dpdk or psio or netmap as your I/O lib.])
# fi
if test "x$enable_ccp" = "xyes"
then
AC_CHECK_LIB(startccp, libstartccp_run_forever, [echo "Found CCP library"], [
AC_MSG_ERROR(CCP library is missing. Please see README.md for instructions.)
])
fi
AM_INIT_AUTOMAKE(mtcp, 3)
AC_CONFIG_FILES([Makefile])
AC_OUTPUT(mtcp/src/Makefile)
AC_OUTPUT(apps/example/Makefile)
AC_OUTPUT(apps/perf/Makefile)
AC_OUTPUT(util/Makefile)
AC_OUTPUT(io_engine/lib/Makefile)
bash ./.check_hyperthreading.sh