]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/ofed/management/opensm/configure.in
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / ofed / management / opensm / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2
3 AC_PREREQ(2.57)
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)
8 AM_INIT_AUTOMAKE
9
10 AC_SUBST(RELEASE, ${RELEASE:-unknown})
11 AC_SUBST(TARBALL, ${TARBALL:-${PACKAGE}-${VERSION}.tar.gz})
12
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)
17
18 dnl Defines the Language
19 AC_LANG_C
20
21 dnl Required for cases make defines a MAKE=make ??? Why
22 AC_PROG_MAKE_SET
23 AC_PROG_CC
24 AC_PROG_LIBTOOL
25 AC_PROG_INSTALL
26 AC_PROG_LN_S
27 AC_PROG_MAKE_SET
28 AC_PROG_YACC
29 AC_PROG_LEX
30
31 AC_CHECK_PROGS(_YACC_,$YACC,none)
32 if test "$_YACC_" = "none"
33 then
34   AC_MSG_ERROR([No bison/byacc/yacc found.])
35 fi
36
37 AC_CHECK_PROGS(_LEX_,$LEX,none)
38 if test "$_LEX_" = "none"
39 then
40   AC_MSG_ERROR([No flex/lex found.])
41 fi
42
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.]))
48
49 dnl Checks for typedefs, structures, and compiler characteristics.
50 AC_C_CONST
51 AC_C_INLINE
52 AC_TYPE_PID_T
53 AC_TYPE_SIZE_T
54 AC_HEADER_TIME
55 AC_STRUCT_TM
56 AC_C_VOLATILE
57
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
62 else
63         ac_cv_version_script=no
64 fi)
65 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$ac_cv_version_script" = "yes")
66
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
70         yes) debug=true ;;
71         no)  debug=false ;;
72         *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
73 esac],debug=false)
74 if test x$debug = xtrue ; then
75         AC_DEFINE(OSM_DEBUG, 1, [ define 1 if OpenSM build is in a debug mode ])
76 fi
77 AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
78
79 AC_ARG_ENABLE(libcheck, [  --disable-libcheck      do not test for presence of ib libraries],
80 [if test x$enableval = xno ; then
81         disable_libcheck=yes
82 fi])
83
84 dnl check if they want the socket console
85 OPENIB_OSM_CONSOLE_SOCKET_SEL
86
87 dnl select performance manager or not
88 OPENIB_OSM_PERF_MGR_SEL
89
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`"
93
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")]),
100     [ case "$withval" in
101     no)
102         ;;
103     *)
104         OPENSM_CONFIG_SUB_DIR=$withval
105         ;;
106     esac ]
107 )
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)
111
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)
118
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)]),
125     [ case "$withval" in
126     no)
127         ;;
128     *)
129         OPENSM_CONFIG_FILE=$withval
130         ;;
131     esac ]
132 )
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)
138
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)]),
145     [ case "$withval" in
146     no)
147         ;;
148     *)
149         NODENAMEMAPFILE=$withval
150         ;;
151     esac ]
152 )
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)
158
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)]),
165     [ case "$withval" in
166     no)
167         ;;
168     *)
169         PARTITION_CONFIG_FILE=$withval
170         ;;
171     esac ]
172 )
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)
178
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)]),
185     [ case "$withval" in
186     no)
187         ;;
188     *)
189         QOS_POLICY_FILE=$withval
190         ;;
191     esac ]
192 )
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)
198
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)]),
205     [ case "$withval" in
206     no)
207         ;;
208     *)
209         PREFIX_ROUTES_FILE=$withval
210         ;;
211     esac ]
212 )
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)
218
219 dnl select example event plugin or not
220 OPENIB_OSM_DEFAULT_EVENT_PLUGIN_SEL
221
222 dnl Provide user option to select vendor
223 OPENIB_APP_OSMV_SEL
224
225 dnl Checks for headers and libraries
226 OPENIB_APP_OSMV_CHECK_HEADER
227 OPENIB_APP_OSMV_CHECK_LIB
228
229 AC_CONFIG_FILES([man/opensm.8 scripts/opensm.init scripts/redhat-opensm.init scripts/sldd.sh])
230
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])