forked from accelio/accelio
-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
201 lines (164 loc) · 6.61 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
189
190
191
192
193
194
195
196
197
198
199
200
201
# this is example-file: configure.ac
# initial information about the project
AC_INIT([libxio],[1.0],[[email protected]])
AM_INIT_AUTOMAKE
# Checks for language
AC_LANG_C
# Checks for programs
LT_INIT
AC_PROG_LIBTOOL
# store current user given compiler flags to avoid default setup via AC_PROG_CC
#OLD_CFLAGS=$CFLAGS
# check for C compiler and the library compiler
AC_PROG_CC
#AC_PROG_CC([gcc])
# reset compiler flags to initial flags
#CFLAGS=$OLD_CFLAGS
# automake initialisation (mandatory) and check for minimal automake API version 1.9
AM_INIT_AUTOMAKE([1.9])
# use the C compiler for the following checks
AC_LANG([C])
# Checks for header files.
AC_CHECK_HEADERS([infiniband/verbs.h rdma/rdma_cma.h],
[mypj_found_verbs_headers=yes; break;])
AC_CHECK_HEADERS([numa.h],
[mypj_found_numa_headers=yes; break;])
AS_IF([test "x$mypj_found_verbs_headers" != "xyes"],
[AC_MSG_ERROR([Unable to find the infiniband header files])])
AS_IF([test "x$mypj_found_numa_headers" != "xyes"],
[AC_MSG_ERROR([Unable to find the numactl-devel header files])])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
AC_CHECK_LIB(numa, numa_available)
##########################################################################
# perf support
##########################################################################
# usage: ./configure --enable-perf=yes
#
AC_MSG_CHECKING([whether to build with debug information])
AC_ARG_ENABLE([perf],
[AS_HELP_STRING([--enable-perf],
[enable perf profiling])],
[enable_perf="$enableval"],
[enable_perf=no])
AC_MSG_RESULT([$enable_perf])
if test "$enable_perf" = "yes"; then
AM_CFLAGS="$AM_CFLAGS -fno-omit-frame-pointer"
fi
##########################################################################
# debug compilation support
##########################################################################
# usage: ./configure --enable-debug=yes
#
AC_MSG_CHECKING([whether to build with debug information])
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug],
[enable debug data generation])],
[enable_debug="$enableval"],
[enable_debug=no])
AC_MSG_RESULT([$enable_debug])
if test "$enable_debug" = "yes"; then
AC_DEFINE([DEBUG],[],[Debug Mode])
AM_CFLAGS="$AM_CFLAGS -g -ggdb -Wall -Werror -Wdeclaration-after-statement \
-fno-omit-frame-pointer -O0 -D_REENTRANT -D_GNU_SOURCE"
else
AC_DEFINE([NDEBUG],[],[No-debug Mode])
AM_CFLAGS="$AM_CFLAGS -g -ggdb -Wall -Werror -Wpadded -Wdeclaration-after-statement \
-O3 -D_REENTRANT -D_GNU_SOURCE"
fi
##########################################################################
# raio compilation support
##########################################################################
# usage: ./configure --disable-raio-build
#
AC_MSG_CHECKING([whether to build with raio example library])
AC_ARG_ENABLE([raio_build],
[AS_HELP_STRING([--enable-raio-build],
[enable raio library generation - default:yes ])],
[enable_raio_build=$enableval],
[enable_raio_build=yes])
AC_MSG_RESULT([$enable_raio_build])
##########################################################################
# fio compilation support
##########################################################################
# usage: ./configure --enable-fio-build=yes
#
AC_MSG_CHECKING([whether to build with fio ioengine])
AC_ARG_ENABLE([fio_build],
[AS_HELP_STRING([--enable-fio-build],
[enable fio ioengine generation ])],
[enable_fio_build="$enableval"],
[enable_fio_build=no])
AC_MSG_RESULT([$enable_fio_build])
AM_CONDITIONAL([FIO_ROOT],[test "$FIO_ROOT" != 0])
AC_ARG_VAR([FIO_ROOT],[The root directory of the fio suite])
AC_SUBST([FIO_ROOT])
##########################################################################
AC_MSG_CHECKING([whether to build kernel module])
AC_ARG_ENABLE(kernel-module,
[ --enable-kernel-module Compile kernel module ],
[enable_kernel_module="$enableval"],
[enable_kernel_module=no])
AC_MSG_RESULT([$enable_kernel_module])
if test "$enable_kernel_module" != "no"; then
AC_CONFIG_SUBDIRS([src/kernel/hello])
fi
if test "$enable_kernel_module" != "no"; then
subdirs2="";
else
subdirs2="src/usr";
subdirs2="$subdirs2 examples/usr/hello_world";
subdirs2="$subdirs2 examples/usr/hello_world_mt";
if test "$enable_raio_build" != "no"; then
subdirs2="$subdirs2 examples/usr/raio";
if test "$enable_fio_build" != "no"; then
subdirs2="$subdirs2 examples/usr/fio";
fi
fi
subdirs2="$subdirs2 tests/usr/hello_test";
subdirs2="$subdirs2 tests/usr/hello_test_mt";
subdirs2="$subdirs2 tests/usr/hello_test_bidi";
subdirs2="$subdirs2 tests/usr/hello_test_lat";
subdirs2="$subdirs2 tests/usr/hello_test_oneway";
fi
# distribute additional compiler and linker flags
# --> set these variables instead of CFLAGS or LDFLAGS
AC_SUBST([AM_CFLAGS])
AC_SUBST([AM_LDFLAGS])
AC_SUBST([LIBS])
AC_SUBST([subdirs2])
# files to generate via autotools (.am or .in source files)
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([src/usr/Makefile])
AC_CONFIG_FILES([examples/usr/hello_world/Makefile])
AC_CONFIG_FILES([examples/usr/hello_world_mt/Makefile])
AC_CONFIG_FILES([examples/usr/raio/Makefile])
if test "$enable_fio_build" != "no"; then
AC_CONFIG_FILES([examples/usr/fio/Makefile])
fi
AC_CONFIG_FILES([tests/usr/hello_test/Makefile])
AC_CONFIG_FILES([tests/usr/hello_test_mt/Makefile])
AC_CONFIG_FILES([tests/usr/hello_test_bidi/Makefile])
AC_CONFIG_FILES([tests/usr/hello_test_lat/Makefile])
AC_CONFIG_FILES([tests/usr/hello_test_oneway/Makefile])
# generate the final Makefile etc.
AC_OUTPUT
# print warning if tests are enabled but gccxml not found
if test "$enable_fio_build" = "yes"; then
if (! test "$FIO_ROOT") ; then
AC_MSG_WARN([
*********************************************************************************
!!!! There is a problem with the current configuration environment !!!!
To run the tests of this package, the following variable(s) need to be defined :
FIO_ROOT : The root directory of the fio package
installation: git clone git://git.kernel.dk/fio.git. run make for
build
tested version: fio-2.1.1
The variables can be defined as environment variables (eg. with bash "export") or
passed to the configure command (e.g. ./configure FIO_ROOT=/opt/fio/ ).
The variables should point to the directory which contain
/engines,/examples,etcsubdirs.
*********************************************************************************
])
fi
fi