/
configure.ac
188 lines (160 loc) · 4.54 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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([mtcp], [3], [mtcp-user@list.ndsl.kaist.edu])
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
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([linux/sched.h pthread.h numa.h arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.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_FUNCS([bzero clock_gettime getpagesize gettimeofday memmove memset munmap select socket strchr strerror strstr strtol])
# Reset DPDK to 0
AC_SUBST(DPDK, 0)
# Reset DPDK's LRO to 0
AC_SUBST(LRO, 0)
# Reset PSIO to 0
AC_SUBST(PSIO, 0)
# Reset NETMAP to 0
AC_SUBST(NETMAP, 0)
# Reset HWCSUM to 1
AC_SUBST(HWCSUM, 1)
# Reset UCTX to 1
AC_SUBST(UCTX, 1)
# Reset VFIO to 0
AC_SUBST(VFIO, 0)
# Reset LOGGER to 0
AC_SUBST(LOGGER, 0)
# Reset APP_INTERRUPT to 0
AC_SUBST(APP_INTERRUPT, 0)
# Reset NFP to 0
AC_SUBST(NFP, 0)
# 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)
AM_CONDITIONAL([DPDK], [test x$DPDK = x1])
fi
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-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
#AC_ARG_ENABLE([uctx],
# AS_HELP_STRING([--enable-uctx], [Enable dpdk uctx (for relevant NICs)]))
#if test "$with_dpdk_lib" != ""
#then
# if test "x$enable_uctx" = "xyes"
# then
# AC_SUBST(UCTX, 1)
# fi
#fi
#AC_ARG_ENABLE([vfio],
# AS_HELP_STRING([--enable-vfio], [Enable DPDK VFIO for Netronome Agilio (NFP-6xxx) NICs)]))
#if test "$with_dpdk_lib" != ""
#then
# if test "x$enable_vfio" = "xyes"
# then
# AC_SUBST(VFIO, 1)
# fi
#fi
#AC_ARG_ENABLE([per_core],
# AS_HELP_STRING([--enable-percore], [Enable dpdk per core (for relevant NICs)]))
#if test "$with_dpdk_lib" != ""
#then
# if test "x$enable_percore" = "xyes"
# then
# AC_SUBST(PER_CORE, 1)
# fi
#fi
AC_ARG_ENABLE([logger],
AS_HELP_STRING([--enable-logger], [Enable logger thread]))
if test "x$enable_logger" = "xyes"
then
AC_SUBST(LOGGER, 1)
fi
AC_ARG_ENABLE([app_interrupt],
AS_HELP_STRING([--enable-app-interrupt], [Enable interrupting application context]))
if test "x$enable_uctx" = "xyes"
then
if test "x$enable_app_interrupt" = "xyes"
then
AC_SUBST(APP_INTERRUPT, 1)
fi
fi
AC_ARG_ENABLE([nfp],
AS_HELP_STRING([--enable-nfp], [Use Netronome Agilio NICs (e.g., NFP-6xxx)]))
if test "$with_dpdk_lib" != ""
then
if test "x$enable_nfp" = "xyes"
then
AC_SUBST(VFIO, 1)
AC_SUBST(HWCSUM, 0)
AC_SUBST(NFP, 1)
fi
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)
#])
if test "$with_dpdk_lib" == ""
then
#AC_MSG_ERROR([Packet I/O library is missing. Please set either dpdk or psio or netmap as your I/O lib.])
AC_MSG_ERROR([Please set the path to your dpdk lib (./configure --with-dpdk-lib=[path_to_dpdk]).])
fi
AM_INIT_AUTOMAKE(mtcp, 3)
AC_CONFIG_FILES([Makefile])
AC_OUTPUT(mtcp/src/Makefile)
AC_OUTPUT(apps/example/Makefile)
AC_OUTPUT(apps/epproxy/Makefile)
#AC_OUTPUT(io_engine/lib/Makefile)