]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/ofed/management/infiniband-diags/configure.in
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / ofed / management / infiniband-diags / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2
3 AC_PREREQ(2.57)
4 AC_INIT(infiniband-diags, 1.5.0, general@lists.openfabrics.org)
5 AC_CONFIG_AUX_DIR(config)
6 AM_CONFIG_HEADER(config.h)
7 AM_INIT_AUTOMAKE
8
9 AC_SUBST(RELEASE, ${RELEASE:-unknown})
10 AC_SUBST(TARBALL, ${TARBALL:-${PACKAGE}-${VERSION}.tar.gz})
11
12 AC_ARG_ENABLE(libcheck, [  --disable-libcheck      do not test for presence of ib libraries],
13 [       if test x$enableval = xno ; then
14                 disable_libcheck=yes
15         fi
16 ])
17
18 dnl support debug mode
19 AC_ARG_ENABLE(debug,
20 [  --enable-debug Turn on debug mode],
21 [case "${enableval}" in
22   yes) debug=true ;;
23   no)  debug=false ;;
24   *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
25 esac],[debug=false])
26 AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
27
28 dnl Checks for programs
29 AC_PROG_CC
30 AC_PROG_LIBTOOL
31
32 if test "$disable_libcheck" != "yes"
33 then
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.]))
49 fi
50
51 dnl Checks for header files.
52 AC_HEADER_STDC
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"
55 then
56 AC_CHECK_HEADER(infiniband/common.h, [],
57         AC_MSG_ERROR([<infiniband/common.h> not found. diags require libibcommon.])
58 )
59 AC_CHECK_HEADER(infiniband/umad.h, [],
60         AC_MSG_ERROR([<infiniband/umad.h> not found. diags require libibumad.])
61 )
62 AC_CHECK_HEADER(infiniband/mad.h, [],
63         AC_MSG_ERROR([<infiniband/mad.h> not found. diags require libibmad.])
64 )
65 fi
66
67 dnl Checks for library functions
68 AC_FUNC_ERROR_AT_LINE
69 AC_FUNC_VPRINTF
70 AC_CHECK_FUNCS([strchr strrchr strtol strtoul memset])
71
72 dnl Checks for typedefs, structures, and compiler characteristics.
73 AC_C_CONST
74
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
80   yes) tutils=yes ;;
81   no)  tutils=no ;;
82   *) AC_MSG_ERROR(bad value ${enableval} for --enable-test-utils) ;;
83 esac],[tutils=no])
84 AM_CONDITIONAL(ENABLE_TEST_UTILS, test x$tutils = xyes)
85 AC_MSG_RESULT(${tutils=no})
86
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]),
92     [ case "$withval" in
93     no)
94         ;;
95     *)
96         withperlpath=yes
97         PERL=$withval
98         ;;
99     esac ]
100 )
101 AC_MSG_RESULT(${withperlpath=no})
102 AC_SUBST(PERL)
103
104 if test $withperlpath = "no"
105 then
106     AC_PATH_PROG([PERL], [perl])
107 fi
108 AC_SUBST(PERL)
109
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]),
114     [ case "$withval" in
115     no)
116         ;;
117     *)
118         withperlinstalldir=yes
119         PERL_INSTALLDIR=$withval
120         ;;
121     esac ]
122 )
123 AC_MSG_RESULT(${withperlinstalldir=no})
124 AC_SUBST(PERL_INSTALLDIR)
125
126 if test $withperlinstalldir = "no"
127 then
128     PERL_INSTALLDIR=`$PERL -e 'use Config; $T=$Config{installsitearch}; print $T;'`
129 fi
130 AC_SUBST(PERL_INSTALLDIR)
131
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
135     else
136         ac_cv_version_script=no
137     fi)
138
139 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$ac_cv_version_script" = "yes")
140
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)
147
148 AC_CONFIG_FILES([\
149         Makefile \
150         infiniband-diags.spec \
151         include/ibdiag_version.h \
152         scripts/ibcheckerrors \
153         scripts/ibcheckerrs \
154         scripts/ibchecknet \
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 \
165         scripts/ibhosts \
166         scripts/ibnodes \
167         scripts/ibswitches \
168         scripts/ibrouters
169 ])
170 AC_OUTPUT