forked from linux-rdma/infiniband-diags
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
261 lines (235 loc) · 7.39 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
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
AC_INIT(infiniband-diags, 2.1.0, linux-rdma@vger.kernel.org)
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR(config)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE([subdir-objects])
AC_SUBST(RELEASE, ${RELEASE:-unknown})
AC_SUBST(TARBALL, ${TARBALL:-${PACKAGE}-${VERSION}.tar.gz})
dnl support debug mode
AC_ARG_ENABLE(debug,
[ --enable-debug Turn on debug mode],
[case "${enableval}" in
yes) debug=true ;;
no) debug=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
esac],[debug=false])
AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
dnl Checks for programs
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_LIBTOOL
AC_CHECK_PROG(have_dash, [dash], true, false)
AM_CONDITIONAL(HAVE_DASH, test x$have_dash = xtrue)
dnl Checks for libraries
AC_CHECK_LIB(ibumad, umad_init, [],
AC_MSG_ERROR([umad_init() not found. diags require libibumad.]))
AC_CHECK_MEMBER([struct umad_port.link_layer],
[ac_have_umad_port_link_layer=yes],
[ac_have_umad_port_link_layer=no],
[#include <infiniband/umad.h>])
if test "$ac_have_umad_port_link_layer" = "yes"; then
AC_DEFINE([HAVE_UMAD_PORT_LINK_LAYER], 1, [Define to 1 if struct umad_port has link_layer member])
fi
AC_CHECK_LIB(osmcomp, cl_qmap_insert, [],
AC_MSG_ERROR([cl_qmap_insert() not found. diags require libosmcomp.]))
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h string.h unistd.h fcntl.h inttypes.h netinet/in.h sys/ioctl.h sys/time.h])
AC_CHECK_HEADER(infiniband/umad.h, [],
AC_MSG_ERROR([<infiniband/umad.h> not found. diags require libibumad.])
)
dnl Checks for library functions
AC_FUNC_ERROR_AT_LINE
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([strchr strrchr strtol strtoul memset strtoull])
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
dnl Define a configure directory
IBDIAG_CONFIG_PATH_TMP1="`eval echo ${sysconfdir}`"
IBDIAG_CONFIG_PATH_TMP2="`echo $IBDIAG_CONFIG_PATH_TMP1 | sed 's/^NONE/$ac_default_prefix/'`"
IBDIAG_CONFIG_PATH="`eval echo $IBDIAG_CONFIG_PATH_TMP2`/infiniband-diags"
AC_SUBST(IBDIAG_CONFIG_PATH)
AC_DEFINE_UNQUOTED([IBDIAG_CONFIG_PATH], "$IBDIAG_CONFIG_PATH", [Define the path to configurations])
dnl Check if we should include test utilities
AC_MSG_CHECKING(for --enable-test-utils)
AC_ARG_ENABLE(test-utils,
[ --enable-test-utils build additional test utilities (default=no)],
[case "${enableval}" in
yes) tutils=yes ;;
no) tutils=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-test-utils) ;;
esac],[tutils=no])
AM_CONDITIONAL(ENABLE_TEST_UTILS, test x$tutils = xyes)
AC_MSG_RESULT(${tutils=no})
dnl Check if we should include compat utils
AC_MSG_CHECKING(for --enable-compat-utils)
AC_ARG_ENABLE(compat-utils,
[ --enable-compat-utils build deprecated compatibility utilities (default=no)],
[case "${enableval}" in
yes) cutils=yes ;;
no) cutils=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-compat-utils) ;;
esac],[cutils=no])
AM_CONDITIONAL(ENABLE_COMPAT_UTILS, test x$cutils = xyes)
AC_MSG_RESULT(${cutils=no})
dnl Check for perl and perl install location
AC_MSG_CHECKING(for --with-perl-path )
AC_ARG_WITH(perl-path,
AC_HELP_STRING([--with-perl-path=path],
[define perl location]),
[ case "$withval" in
no)
;;
*)
withperlpath=yes
PERL=$withval
;;
esac ]
)
AC_MSG_RESULT(${withperlpath=no})
AC_SUBST(PERL)
if test $withperlpath = "no"
then
AC_PATH_PROG([PERL], [perl])
fi
AC_SUBST(PERL)
AC_MSG_CHECKING(for --with-perl-installdir )
AC_ARG_WITH(perl-installdir,
AC_HELP_STRING([--with-perl-installdir=path],
[define perl install path]),
[ case "$withval" in
no)
;;
*)
withperlinstalldir=yes
PERL_INSTALLDIR=$withval
;;
esac ]
)
AC_MSG_RESULT(${withperlinstalldir=no})
AC_SUBST(PERL_INSTALLDIR)
if test $withperlinstalldir = "no"
then
PERL_INSTALLDIR=`$PERL -e 'use Config; $T=$Config{installvendorlib}; print $T;'`
fi
AC_SUBST(PERL_INSTALLDIR)
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 override for IBPATH
AC_ARG_WITH(ibpath_override,
[ --with-ibpath_override=<path> define ib binaries path],
AC_MSG_NOTICE(Using IBPATH : $with_ibpath_override),
with_ibpath_override=)
dnl Make appropriate substitution for IB script path
dnl Must expand nested unquoting
IBSCRIPTPATH_TMP1="`eval echo ${sbindir}`"
IBSCRIPTPATH_TMP2="`echo $IBSCRIPTPATH_TMP1 | sed 's/^NONE/$ac_default_prefix/'`"
IBSCRIPTPATH="${with_ibpath_override:-`eval echo $IBSCRIPTPATH_TMP2`}"
AC_SUBST(IBSCRIPTPATH)
dnl check for glib
PKG_CHECK_MODULES([GLIB], [glib-2.0], ac_glib=yes, ac_glib=no)
AM_CONDITIONAL([HAVE_GLIB], test "$ac_glib" = "yes")
if test "$ac_glib" = "yes"; then
AC_DEFINE([HAVE_GLIB], 1, [Define to 1 to indicate GLIB support])
else
AC_MSG_ERROR(glib not found; glib2 is required)
fi
dnl Begin libibnetdisc stuff
ibnetdisc_api_version=`grep LIBVERSION $srcdir/libibnetdisc/libibnetdisc.ver | sed 's/LIBVERSION=//'`
if test -z $ibnetdisc_api_version; then
echo "FAILED to find $srcdir/libibnetdisc/libibnetdisc.ver"
exit 1
fi
AC_SUBST(ibnetdisc_api_version)
dnl End libibnetdisc stuff
dnl Begin libibmad stuff
ibmad_api_version=`grep LIBVERSION $srcdir/libibmad/libibmad.ver | sed 's/LIBVERSION=//'`
if test -z $ibmad_api_version; then
ibmad_api_version=1:0:0
fi
AC_SUBST(ibmad_api_version)
dnl End libibmad stuff
dnl Generate doc/man/*.in files if possible
DOC_DATE="`date +%Y-%m-%d`"
AC_SUBST(BUILD_DATE)
AC_CHECK_PROG(have_rst2man, rst2man, "yes")
if test x$have_rst2man != xyes; then
AC_CHECK_PROG(have_rst2man, rst2man.py, "yes")
fi
if test x$have_rst2man == xyes; then
$srcdir/doc/generate
else
if test -f $srcdir/doc/man/infiniband-diags.8.in; then
echo "WARNING: 'rst2man' not found; using premade man pages"
else
echo "FAILED to find 'rst2man' required to build man pages"
exit 1
fi
fi
dnl
AC_CONFIG_FILES([\
Makefile \
infiniband-diags.spec \
include/ibdiag_version.h \
scripts/ibcheckerrors \
scripts/ibcheckerrs \
scripts/ibchecknet \
scripts/ibchecknode \
scripts/ibcheckport \
scripts/ibcheckportstate \
scripts/ibcheckportwidth \
scripts/ibcheckstate \
scripts/ibcheckwidth \
scripts/ibclearcounters \
scripts/ibclearerrors \
scripts/ibdatacounts \
scripts/ibdatacounters \
scripts/ibhosts \
scripts/ibnodes \
scripts/ibswitches \
scripts/ibrouters \
scripts/iblinkinfo.pl \
scripts/ibqueryerrors.pl \
scripts/dump_lfts.sh \
scripts/dump_mfts.sh \
doc/man/ibaddr.8 \
doc/man/check_lft_balance.8 \
doc/man/ibcacheedit.8 \
doc/man/ibccconfig.8 \
doc/man/ibccquery.8 \
doc/man/dump_fts.8 \
doc/man/ibhosts.8 \
doc/man/ibidsverify.8 \
doc/man/iblinkinfo.8 \
doc/man/ibfindnodesusing.8 \
doc/man/ibnetdiscover.8 \
doc/man/ibnodes.8 \
doc/man/ibping.8 \
doc/man/ibportstate.8 \
doc/man/ibqueryerrors.8 \
doc/man/ibroute.8 \
doc/man/ibrouters.8 \
doc/man/ibstat.8 \
doc/man/ibstatus.8 \
doc/man/ibswitches.8 \
doc/man/ibsysstat.8 \
doc/man/ibtracert.8 \
doc/man/perfquery.8 \
doc/man/saquery.8 \
doc/man/sminfo.8 \
doc/man/smpdump.8 \
doc/man/smpquery.8 \
doc/man/vendstat.8 \
doc/man/infiniband-diags.8 \
libibnetdisc/Makefile \
libibmad/Makefile \
])
AC_OUTPUT