1 dnl Process this file with autoconf to produce a configure script.
4 AC_INIT(infiniband-diags, 1.5.0, general@lists.openfabrics.org)
5 AC_CONFIG_AUX_DIR(config)
6 AM_CONFIG_HEADER(config.h)
9 AC_SUBST(RELEASE, ${RELEASE:-unknown})
10 AC_SUBST(TARBALL, ${TARBALL:-${PACKAGE}-${VERSION}.tar.gz})
12 AC_ARG_ENABLE(libcheck, [ --disable-libcheck do not test for presence of ib libraries],
13 [ if test x$enableval = xno ; then
18 dnl support debug mode
20 [ --enable-debug Turn on debug mode],
21 [case "${enableval}" in
24 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
26 AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
28 dnl Checks for programs
32 if test "$disable_libcheck" != "yes"
34 dnl Checks for libraries
35 AC_CHECK_LIB(ibcommon, sys_read_string, [],
36 AC_MSG_ERROR([sys_read_string() not found. diags require libibcommon.]))
37 AC_CHECK_LIB(ibumad, umad_init, [],
38 AC_MSG_ERROR([umad_init() not found. diags require libibumad.]))
39 AC_CHECK_LIB(ibmad, mad_dump_int, [],
40 AC_MSG_ERROR([mad_dump_int() not found. diags require libibmad.]))
41 AC_CHECK_LIB(ibmad, port_performance_ext_query, [],
42 AC_MSG_ERROR([port_performance_ext_query() not found. diags require more recent libibmad.]))
43 AC_CHECK_LIB(osmcomp, cl_thread_init, [],
44 AC_MSG_ERROR([cl_thread_init() not found. diags require libosmcomp.]))
45 AC_CHECK_LIB(osmvendor, osmv_query_sa, [],
46 AC_MSG_ERROR([osmv_query_sa() not found. diags require libosmvendor.]), [-lopensm])
47 AC_CHECK_LIB(opensm, osm_log_init_v2, [],
48 AC_MSG_ERROR([osm_log_init_v2() not found. diags require libopensm.]))
51 dnl Checks for header files.
53 AC_CHECK_HEADERS([stdlib.h string.h unistd.h fcntl.h inttypes.h netinet/in.h sys/ioctl.h syslog.h])
54 if test "$disable_libcheck" != "yes"
56 AC_CHECK_HEADER(infiniband/common.h, [],
57 AC_MSG_ERROR([<infiniband/common.h> not found. diags require libibcommon.])
59 AC_CHECK_HEADER(infiniband/umad.h, [],
60 AC_MSG_ERROR([<infiniband/umad.h> not found. diags require libibumad.])
62 AC_CHECK_HEADER(infiniband/mad.h, [],
63 AC_MSG_ERROR([<infiniband/mad.h> not found. diags require libibmad.])
67 dnl Checks for library functions
70 AC_CHECK_FUNCS([strchr strrchr strtol strtoul memset])
72 dnl Checks for typedefs, structures, and compiler characteristics.
75 dnl Check if we should include test utilities
76 AC_MSG_CHECKING(for --enable-test-utils)
77 AC_ARG_ENABLE(test-utils,
78 [ --enable-test-utils build additional test utilities],
79 [case "${enableval}" in
82 *) AC_MSG_ERROR(bad value ${enableval} for --enable-test-utils) ;;
84 AM_CONDITIONAL(ENABLE_TEST_UTILS, test x$tutils = xyes)
85 AC_MSG_RESULT(${tutils=no})
87 dnl Check for perl and perl install location
88 AC_MSG_CHECKING(for --with-perl-path )
89 AC_ARG_WITH(perl-path,
90 AC_HELP_STRING([--with-perl-path=path],
91 [define perl location]),
101 AC_MSG_RESULT(${withperlpath=no})
104 if test $withperlpath = "no"
106 AC_PATH_PROG([PERL], [perl])
110 AC_MSG_CHECKING(for --with-perl-installdir )
111 AC_ARG_WITH(perl-installdir,
112 AC_HELP_STRING([--with-perl-installdir=path],
113 [define perl install path]),
118 withperlinstalldir=yes
119 PERL_INSTALLDIR=$withval
123 AC_MSG_RESULT(${withperlinstalldir=no})
124 AC_SUBST(PERL_INSTALLDIR)
126 if test $withperlinstalldir = "no"
128 PERL_INSTALLDIR=`$PERL -e 'use Config; $T=$Config{installsitearch}; print $T;'`
130 AC_SUBST(PERL_INSTALLDIR)
132 AC_CACHE_CHECK(whether ld accepts --version-script, ac_cv_version_script,
133 if test -n "`$LD --help < /dev/null 2>/dev/null | grep version-script`"; then
134 ac_cv_version_script=yes
136 ac_cv_version_script=no
139 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$ac_cv_version_script" = "yes")
141 dnl Make appropriate substitution for IB script path
142 dnl Must expand nested unquoting
143 IBSCRIPTPATH_TMP1="`eval echo ${sbindir}`"
144 IBSCRIPTPATH_TMP2="`echo $IBSCRIPTPATH_TMP1 | sed 's/^NONE/$ac_default_prefix/'`"
145 IBSCRIPTPATH="`eval echo $IBSCRIPTPATH_TMP2`"
146 AC_SUBST(IBSCRIPTPATH)
150 infiniband-diags.spec \
151 include/ibdiag_version.h \
152 scripts/ibcheckerrors \
153 scripts/ibcheckerrs \
155 scripts/ibchecknode \
156 scripts/ibcheckport \
157 scripts/ibcheckportstate \
158 scripts/ibcheckportwidth \
159 scripts/ibcheckstate \
160 scripts/ibcheckwidth \
161 scripts/ibclearcounters \
162 scripts/ibclearerrors \
163 scripts/ibdatacounts \
164 scripts/ibdatacounters \