forked from linux-rdma/opensm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
293 lines (257 loc) · 8.98 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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
AC_INIT(opensm, 3.3.23, [email protected])
AC_CONFIG_SRCDIR([opensm/osm_opensm.c])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR(config)
AC_CONFIG_HEADERS(include/config.h include/opensm/osm_config.h)
AM_INIT_AUTOMAKE([subdir-objects])
AC_SUBST(RELEASE, ${RELEASE:-${VERSION}})
AC_SUBST(TARBALL, ${TARBALL:-${PACKAGE}-${VERSION}.tar.gz})
default_rdma_service=openibd
AC_ARG_WITH([rdma_service],
AC_HELP_STRING([--with-rdma-service=name],
[name of the RDMA service: "rdma" when using /etc/init.d/rdma to start RDMA services; "openibd" when using /etc/init.d/openibd to start RDMA services [default=${default_rdma_service}]]))
AC_SUBST(RDMA_SERVICE, ${with_rdma_service:-${default_rdma_service}})
if { rpm -q sles-release || rpm -q openSUSE-release; } >/dev/null 2>&1; then
default_stop="0 1 4 6"
else
default_stop="0 1 6"
fi
default_start="null"
AC_SUBST(DEFAULT_START, $default_start)
AC_SUBST(DEFAULT_STOP, $default_stop)
dnl NOTE: AC_DEFINE's and AC_DEFINE_UNQUOTED's which are used in header files
dnl MUST have a corresponding entry in include/opensm/osm_config.h.in to
dnl ensure plugin compatibility.
AC_DEFINE(_OSM_CONFIG_H_, 1, mark config.h inclusion)
dnl Defines the Language
AC_LANG_C
dnl Required for cases make defines a MAKE=make ??? Why
AC_PROG_MAKE_SET
AC_PROG_CC
AC_PROG_LIBTOOL
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_YACC
AC_PROG_LEX
AC_CHECK_PROGS(_YACC_,$YACC,none)
if test "$_YACC_" = "none"
then
AC_MSG_ERROR([No bison/byacc/yacc found.])
fi
AC_CHECK_PROGS(_LEX_,$LEX,none)
if test "$_LEX_" = "none"
then
AC_MSG_ERROR([No flex/lex found.])
fi
dnl Checks for libraries
AC_CHECK_LIB(pthread, pthread_mutex_init, [],
AC_MSG_ERROR([pthread_mutex_init() not found. libosmcomp requires libpthread.]))
AC_CHECK_LIB(dl, dlopen, [],
AC_MSG_ERROR([dlopen() not found. OpenSM requires libdl.]))
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
AC_C_VOLATILE
dnl See if we have __builtin_expect
AC_MSG_CHECKING([if the compiler supports __builtin_expect])
AC_TRY_COMPILE(, [ return __builtin_expect(1, 1) ? 1 : 0],
[ have_builtin_expect=yes
AC_MSG_RESULT([yes]) ],
[ have_builtin_expect=no
AC_MSG_RESULT([no]) ])
if test "x_$have_builtin_expect" = "x_yes" ; then
AC_DEFINE([HAVE_BUILTIN_EXPECT], [1], [Define to 1 if the compiler supports __builtin_expect.])
fi
dnl We use --version-script with ld if possible
AC_CACHE_CHECK(whether ld accepts --version-script, ac_cv_version_script,
if test -n "`$LD --help < /dev/null 2>/dev/null | grep version-script`"; then
ac_cv_version_script=yes
else
ac_cv_version_script=no
fi)
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$ac_cv_version_script" = "yes")
dnl Define an input config option to control debug compile
AC_ARG_ENABLE(debug, [ --enable-debug Turn on debugging],
[case "${enableval}" in
yes) debug=true ;;
no) debug=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
esac],debug=false)
if test x$debug = xtrue ; then
AC_DEFINE(OSM_DEBUG, 1, [ define 1 if OpenSM build is in a debug mode ])
AC_DEFINE(_DEBUG_, 1, [ define 1 if OpenSM build is in a debug mode ])
fi
AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
AC_ARG_ENABLE(libcheck, [ --disable-libcheck do not test for presence of ib libraries],
[if test x$enableval = xno ; then
disable_libcheck=yes
fi])
dnl check if they want the socket console
OPENIB_OSM_CONSOLE_SOCKET_SEL
dnl select performance manager or not
OPENIB_OSM_PERF_MGR_SEL
dnl resolve <sysconfdir> config dir.
conf_dir_tmp1="`eval echo ${sysconfdir} | sed 's/^NONE/$ac_default_prefix/'`"
SYS_CONFIG_DIR="`eval echo $conf_dir_tmp1`"
dnl Check for a different subdir for the config files.
OPENSM_CONFIG_SUB_DIR=opensm
AC_MSG_CHECKING(for --with-opensm-conf-sub-dir)
AC_ARG_WITH(opensm-conf-sub-dir,
AC_HELP_STRING([--with-opensm-conf-sub-dir=dir],
[define a directory name for opensm's conf files <sysconfdir>/<dir> (default "opensm")]),
[ case "$withval" in
no)
;;
*)
OPENSM_CONFIG_SUB_DIR=$withval
;;
esac ]
)
dnl this needs to be configured for rpmbuilds separate from the full path
dnl "OPENSM_CONFIG_DIR"
AC_SUBST(OPENSM_CONFIG_SUB_DIR)
OPENSM_CONFIG_DIR=$SYS_CONFIG_DIR/$OPENSM_CONFIG_SUB_DIR
AC_MSG_RESULT($OPENSM_CONFIG_DIR)
AC_DEFINE_UNQUOTED(OPENSM_CONFIG_DIR,
["$OPENSM_CONFIG_DIR"],
[Define OpenSM config directory])
AC_SUBST(OPENSM_CONFIG_DIR)
dnl Check for a different default OpenSm config file
OPENSM_CONFIG_FILE=opensm.conf
AC_MSG_CHECKING(for --with-opensm-conf-file )
AC_ARG_WITH(opensm-conf-file,
AC_HELP_STRING([--with-opensm-conf-file=file],
[define a default OpenSM config file (default opensm.conf)]),
[ case "$withval" in
no)
;;
*)
OPENSM_CONFIG_FILE=$withval
;;
esac ]
)
AC_MSG_RESULT(${OPENSM_CONFIG_FILE})
AC_DEFINE_UNQUOTED(HAVE_DEFAULT_OPENSM_CONFIG_FILE,
["$OPENSM_CONFIG_DIR/$OPENSM_CONFIG_FILE"],
[Define a default OpenSM config file])
AC_SUBST(OPENSM_CONFIG_FILE)
dnl Check for a different default node name map file
NODENAMEMAPFILE=ib-node-name-map
AC_MSG_CHECKING(for --with-node-name-map )
AC_ARG_WITH(node-name-map,
AC_HELP_STRING([--with-node-name-map=file],
[define a default node name map file (default ib-node-name-map)]),
[ case "$withval" in
no)
;;
*)
NODENAMEMAPFILE=$withval
;;
esac ]
)
AC_MSG_RESULT($NODENAMEMAPFILE)
AC_DEFINE_UNQUOTED(HAVE_DEFAULT_NODENAME_MAP,
["$OPENSM_CONFIG_DIR/$NODENAMEMAPFILE"],
[Define a default node name map file])
AC_SUBST(NODENAMEMAPFILE)
dnl Check for a different partition conf file
PARTITION_CONFIG_FILE=partitions.conf
AC_MSG_CHECKING(for --with-partitions-conf)
AC_ARG_WITH(partitions-conf,
AC_HELP_STRING([--with-partitions-conf=file],
[define a partitions config file (default partitions.conf)]),
[ case "$withval" in
no)
;;
*)
PARTITION_CONFIG_FILE=$withval
;;
esac ]
)
AC_MSG_RESULT($PARTITION_CONFIG_FILE)
AC_DEFINE_UNQUOTED(HAVE_DEFAULT_PARTITION_CONFIG_FILE,
["$OPENSM_CONFIG_DIR/$PARTITION_CONFIG_FILE"],
[Define a Partition config file])
AC_SUBST(PARTITION_CONFIG_FILE)
dnl Check for a different QOS policy file
QOS_POLICY_FILE=qos-policy.conf
AC_MSG_CHECKING(for --with-qos-policy-conf)
AC_ARG_WITH(qos-policy-conf,
AC_HELP_STRING([--with-qos-policy-conf=file],
[define a QOS policy config file (default qos-policy.conf)]),
[ case "$withval" in
no)
;;
*)
QOS_POLICY_FILE=$withval
;;
esac ]
)
AC_MSG_RESULT($QOS_POLICY_FILE)
AC_DEFINE_UNQUOTED(HAVE_DEFAULT_QOS_POLICY_FILE,
["$OPENSM_CONFIG_DIR/$QOS_POLICY_FILE"],
[Define a QOS policy config file])
AC_SUBST(QOS_POLICY_FILE)
dnl For now, this does not need to be configurable
TORUS2QOS_CONF_FILE=torus-2QoS.conf
AC_SUBST(TORUS2QOS_CONF_FILE)
dnl Check for a different prefix-routes file
PREFIX_ROUTES_FILE=prefix-routes.conf
AC_MSG_CHECKING(for --with-prefix-routes-conf)
AC_ARG_WITH(prefix-routes-conf,
AC_HELP_STRING([--with-prefix-routes-conf=file],
[define a Prefix Routes config file (default is prefix-routes.conf)]),
[ case "$withval" in
no)
;;
*)
PREFIX_ROUTES_FILE=$withval
;;
esac ]
)
AC_MSG_RESULT($PREFIX_ROUTES_FILE)
AC_DEFINE_UNQUOTED(HAVE_DEFAULT_PREFIX_ROUTES_FILE,
["$OPENSM_CONFIG_DIR/$PREFIX_ROUTES_FILE"],
[Define a Prefix Routes config file])
AC_SUBST(PREFIX_ROUTES_FILE)
dnl Check for a different per-module-logging file
PER_MOD_LOGGING_FILE=per-module-logging.conf
AC_MSG_CHECKING(for --with-per-module-logging-conf)
AC_ARG_WITH(per-module-logging.conf,
AC_HELP_STRING([--with-per-module-logging-conf=file],
[define a Per Module Logging config file (default is per-module-logging.conf)]),
[ case "$withval" in
no)
;;
*)
PER_MOD_LOGGING_FILE=$withval
;;
esac ]
)
AC_MSG_RESULT($PER_MOD_LOGGING_FILE)
AC_DEFINE_UNQUOTED(HAVE_DEFAULT_PER_MOD_LOGGING_FILE,
["$OPENSM_CONFIG_DIR/$PER_MOD_LOGGING_FILE"],
[Define a Per Module Logging config file])
AC_SUBST(PER_MOD_LOGGING_FILE)
dnl select example event plugin or not
OPENIB_OSM_DEFAULT_EVENT_PLUGIN_SEL
dnl Provide user option to select vendor
OPENIB_APP_OSMV_SEL
dnl Checks for headers and libraries
OPENIB_APP_OSMV_CHECK_HEADER
OPENIB_APP_OSMV_CHECK_LIB
dnl Provide user option to enable metis support for nue
METIS_SEL
dnl Checks for headers and libraries
METIS_CHECK_HEADER
METIS_CHECK_LIB
AC_CONFIG_FILES([man/opensm.8 man/torus-2QoS.8 man/torus-2QoS.conf.5 scripts/opensm.init scripts/redhat-opensm.init scripts/sldd.sh])
dnl Create the following Makefiles
AC_OUTPUT([include/opensm/osm_version.h Makefile include/Makefile complib/Makefile libopensm/Makefile libvendor/Makefile opensm/Makefile osmeventplugin/Makefile osmroutingplugin/Makefile osmtest/Makefile opensm.spec])