1 dnl Process this file with autoconf to produce a configure script.
4 AC_INIT(opensm, 3.3.0, general@lists.openfabrics.org)
5 AC_CONFIG_SRCDIR([opensm/osm_opensm.c])
6 AC_CONFIG_AUX_DIR(config)
7 AC_CONFIG_HEADERS(include/config.h include/opensm/osm_config.h)
10 AC_SUBST(RELEASE, ${RELEASE:-unknown})
11 AC_SUBST(TARBALL, ${TARBALL:-${PACKAGE}-${VERSION}.tar.gz})
13 dnl NOTE: AC_DEFINE's and AC_DEFINE_UNQUOTED's which are used in header files
14 dnl MUST have a corresponding entry in include/opensm/osm_config.h.in to
15 dnl ensure plugin compatibility.
16 AC_DEFINE(_OSM_CONFIG_H_, 1, mark config.h inclusion)
18 dnl Defines the Language
21 dnl Required for cases make defines a MAKE=make ??? Why
31 AC_CHECK_PROGS(_YACC_,$YACC,none)
32 if test "$_YACC_" = "none"
34 AC_MSG_ERROR([No bison/byacc/yacc found.])
37 AC_CHECK_PROGS(_LEX_,$LEX,none)
38 if test "$_LEX_" = "none"
40 AC_MSG_ERROR([No flex/lex found.])
43 dnl Checks for libraries
44 AC_CHECK_LIB(pthread, pthread_mutex_init, [],
45 AC_MSG_ERROR([pthread_mutex_init() not found. libosmcomp requires libpthread.]))
46 AC_CHECK_LIB(dl, dlopen, [],
47 AC_MSG_ERROR([dlopen() not found. OpenSM requires libdl.]))
49 dnl Checks for typedefs, structures, and compiler characteristics.
58 dnl We use --version-script with ld if possible
59 AC_CACHE_CHECK(whether ld accepts --version-script, ac_cv_version_script,
60 if test -n "`$LD --help < /dev/null 2>/dev/null | grep version-script`"; then
61 ac_cv_version_script=yes
63 ac_cv_version_script=no
65 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$ac_cv_version_script" = "yes")
67 dnl Define an input config option to control debug compile
68 AC_ARG_ENABLE(debug, [ --enable-debug Turn on debugging],
69 [case "${enableval}" in
72 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
74 if test x$debug = xtrue ; then
75 AC_DEFINE(OSM_DEBUG, 1, [ define 1 if OpenSM build is in a debug mode ])
77 AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
79 AC_ARG_ENABLE(libcheck, [ --disable-libcheck do not test for presence of ib libraries],
80 [if test x$enableval = xno ; then
84 dnl check if they want the socket console
85 OPENIB_OSM_CONSOLE_SOCKET_SEL
87 dnl select performance manager or not
88 OPENIB_OSM_PERF_MGR_SEL
90 dnl resolve <sysconfdir> config dir.
91 conf_dir_tmp1="`eval echo ${sysconfdir} | sed 's/^NONE/$ac_default_prefix/'`"
92 SYS_CONFIG_DIR="`eval echo $conf_dir_tmp1`"
94 dnl Check for a different subdir for the config files.
95 OPENSM_CONFIG_SUB_DIR=opensm
96 AC_MSG_CHECKING(for --with-opensm-conf-sub-dir)
97 AC_ARG_WITH(opensm-conf-sub-dir,
98 AC_HELP_STRING([--with-opensm-conf-sub-dir=dir],
99 [define a directory name for opensm's conf files <sysconfdir>/<dir> (default "opensm")]),
104 OPENSM_CONFIG_SUB_DIR=$withval
108 dnl this needs to be configured for rpmbuilds separate from the full path
109 dnl "OPENSM_CONFIG_DIR"
110 AC_SUBST(OPENSM_CONFIG_SUB_DIR)
112 OPENSM_CONFIG_DIR=$SYS_CONFIG_DIR/$OPENSM_CONFIG_SUB_DIR
113 AC_MSG_RESULT($OPENSM_CONFIG_DIR)
114 AC_DEFINE_UNQUOTED(OPENSM_CONFIG_DIR,
115 ["$OPENSM_CONFIG_DIR"],
116 [Define OpenSM config directory])
117 AC_SUBST(OPENSM_CONFIG_DIR)
119 dnl Check for a different default OpenSm config file
120 OPENSM_CONFIG_FILE=opensm.conf
121 AC_MSG_CHECKING(for --with-opensm-conf-file )
122 AC_ARG_WITH(opensm-conf-file,
123 AC_HELP_STRING([--with-opensm-conf-file=file],
124 [define a default OpenSM config file (default opensm.conf)]),
129 OPENSM_CONFIG_FILE=$withval
133 AC_MSG_RESULT(${OPENSM_CONFIG_FILE})
134 AC_DEFINE_UNQUOTED(HAVE_DEFAULT_OPENSM_CONFIG_FILE,
135 ["$OPENSM_CONFIG_DIR/$OPENSM_CONFIG_FILE"],
136 [Define a default OpenSM config file])
137 AC_SUBST(OPENSM_CONFIG_FILE)
139 dnl Check for a different default node name map file
140 NODENAMEMAPFILE=ib-node-name-map
141 AC_MSG_CHECKING(for --with-node-name-map )
142 AC_ARG_WITH(node-name-map,
143 AC_HELP_STRING([--with-node-name-map=file],
144 [define a default node name map file (default ib-node-name-map)]),
149 NODENAMEMAPFILE=$withval
153 AC_MSG_RESULT($NODENAMEMAPFILE)
154 AC_DEFINE_UNQUOTED(HAVE_DEFAULT_NODENAME_MAP,
155 ["$OPENSM_CONFIG_DIR/$NODENAMEMAPFILE"],
156 [Define a default node name map file])
157 AC_SUBST(NODENAMEMAPFILE)
159 dnl Check for a different partition conf file
160 PARTITION_CONFIG_FILE=partitions.conf
161 AC_MSG_CHECKING(for --with-partitions-conf)
162 AC_ARG_WITH(partitions-conf,
163 AC_HELP_STRING([--with-partitions-conf=file],
164 [define a partitions config file (default partitions.conf)]),
169 PARTITION_CONFIG_FILE=$withval
173 AC_MSG_RESULT($PARTITION_CONFIG_FILE)
174 AC_DEFINE_UNQUOTED(HAVE_DEFAULT_PARTITION_CONFIG_FILE,
175 ["$OPENSM_CONFIG_DIR/$PARTITION_CONFIG_FILE"],
176 [Define a Partition config file])
177 AC_SUBST(PARTITION_CONFIG_FILE)
179 dnl Check for a different QOS policy file
180 QOS_POLICY_FILE=qos-policy.conf
181 AC_MSG_CHECKING(for --with-qos-policy-conf)
182 AC_ARG_WITH(qos-policy-conf,
183 AC_HELP_STRING([--with-qos-policy-conf=file],
184 [define a QOS policy config file (default qos-policy.conf)]),
189 QOS_POLICY_FILE=$withval
193 AC_MSG_RESULT($QOS_POLICY_FILE)
194 AC_DEFINE_UNQUOTED(HAVE_DEFAULT_QOS_POLICY_FILE,
195 ["$OPENSM_CONFIG_DIR/$QOS_POLICY_FILE"],
196 [Define a QOS policy config file])
197 AC_SUBST(QOS_POLICY_FILE)
199 dnl Check for a different prefix-routes file
200 PREFIX_ROUTES_FILE=prefix-routes.conf
201 AC_MSG_CHECKING(for --with-prefix-routes-conf)
202 AC_ARG_WITH(prefix-routes-conf,
203 AC_HELP_STRING([--with-prefix-routes-conf=file],
204 [define a Prefix Routes config file (default is prefix-routes.conf)]),
209 PREFIX_ROUTES_FILE=$withval
213 AC_MSG_RESULT($PREFIX_ROUTES_FILE)
214 AC_DEFINE_UNQUOTED(HAVE_DEFAULT_PREFIX_ROUTES_FILE,
215 ["$OPENSM_CONFIG_DIR/$PREFIX_ROUTES_FILE"],
216 [Define a Prefix Routes config file])
217 AC_SUBST(PREFIX_ROUTES_FILE)
219 dnl select example event plugin or not
220 OPENIB_OSM_DEFAULT_EVENT_PLUGIN_SEL
222 dnl Provide user option to select vendor
225 dnl Checks for headers and libraries
226 OPENIB_APP_OSMV_CHECK_HEADER
227 OPENIB_APP_OSMV_CHECK_LIB
229 AC_CONFIG_FILES([man/opensm.8 scripts/opensm.init scripts/redhat-opensm.init scripts/sldd.sh])
231 dnl Create the following Makefiles
232 AC_OUTPUT([include/opensm/osm_version.h Makefile include/Makefile complib/Makefile libvendor/Makefile opensm/Makefile osmeventplugin/Makefile osmtest/Makefile opensm.spec])