os-cmpi-xen

view acinclude.m4 @ 6:7c8d92923475

Added '/usr/local/include/openwbem' path to CHECK_CMPI macro - submitted by Raj Subrahmanian.
author jfehlig@jfehlig1.provo.novell.com
date Fri May 19 15:23:59 2006 -0600 (2006-05-19)
parents 72b83cde6b72
children c0beaacf5b03
line source
1 dnl
2 dnl $Id: acinclude.m4,v 1.1.1.1 2005/08/30 23:08:51 bestor Exp $
3 dnl
4 dnl
5 dnl (C) Copyright IBM Corp. 2004, 2005
6 dnl
7 dnl THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE
8 dnl ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
9 dnl CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
10 dnl
11 dnl You can obtain a current copy of the Common Public License from
12 dnl http://www.opensource.org/licenses/cpl1.0.php
13 dnl
14 dnl Author: Konrad Rzeszutek <konradr@us.ibm.com>
15 dnl Contributors: Viktor Mihajlovski <mihajlov@de.ibm.com>
16 dnl Date : 09/20/2004
17 dnl
18 dnl
19 dnl CHECK_CMPI: Check for CMPI headers and set the CPPFLAGS
20 dnl with the -I<directory>
21 dnl
22 dnl CHECK_PEGASUS_2_3_2: Check for Pegasus 2.3.2 and set
23 dnl the HAVE_PEGASUS_2_3_2
24 dnl flag
25 dnl
27 AC_DEFUN([CHECK_PEGASUS_2_3_2],
28 [
29 AC_MSG_CHECKING(for Pegasus 2.3.2)
30 if which cimserver > /dev/null 2>&1
31 then
32 test_CIMSERVER=`cimserver -v`
33 fi
34 if test "$test_CIMSERVER" == "2.3.2"; then
35 AC_MSG_RESULT(yes)
36 AC_DEFINE_UNQUOTED(HAVE_PEGASUS_2_3_2,1,[Defined to 1 if Pegasus 2.3.2 is used])
37 else
38 AC_MSG_RESULT(no)
40 fi
41 ]
42 )
44 dnl
45 dnl CHECK_PEGASUS_2_4: Check for Pegasus 2.4 and set the
46 dnl the -DPEGASUS_USE_EXPERIMENTAL_INTERFACES flag
47 dnl
48 AC_DEFUN([CHECK_PEGASUS_2_4],
49 [
50 AC_MSG_CHECKING(for Pegasus 2.4)
51 if which cimserver > /dev/null 2>&1
52 then
53 test_CIMSERVER=`cimserver -v`
54 fi
55 if test "$test_CIMSERVER" == "2.4"; then
56 AC_MSG_RESULT(yes)
57 CPPFLAGS="$CPPFLAGS -DPEGASUS_USE_EXPERIMENTAL_INTERFACES"
58 AC_DEFINE_UNQUOTED(HAVE_PEGASUS_2_4,1,[Defined to 1 if Pegasus 2.4 is used])
59 else
60 AC_MSG_RESULT(no)
62 fi
63 ]
64 )
67 dnl
68 dnl Helper functions
69 dnl
70 AC_DEFUN([_CHECK_CMPI],
71 [
72 AC_MSG_CHECKING($1)
73 AC_TRY_LINK(
74 [
75 #include <cmpimacs.h>
76 #include <cmpidt.h>
77 #include <cmpift.h>
78 ],
79 [
80 CMPIBroker broker;
81 CMPIStatus status = {CMPI_RC_OK, NULL};
82 CMPIString *s = CMNewString(&broker, "TEST", &status);
83 ],
84 [
85 have_CMPI=yes
86 dnl AC_MSG_RESULT(yes)
87 ],
88 [
89 have_CMPI=no
90 dnl AC_MSG_RESULT(no)
91 ])
93 ])
95 AC_DEFUN([_CHECK_INDHELP_HEADER],
96 [
97 AC_MSG_CHECKING($1)
98 AC_TRY_COMPILE(
99 [
100 #include <stdio.h>
101 #include <ind_helper.h>
102 ],
103 [
104 CMPISelectExp *filter = NULL;
105 ind_set_select("/root/cimv2",NULL,filter);
106 ],
107 [
108 have_INDHELP=yes
109 dnl AC_MSG_RESULT(yes)
110 ],
111 [
112 have_INDHELP=no
113 dnl AC_MSG_RESULT(no)
114 ])
116 ])
118 dnl
119 dnl The main function to check for CMPI headers
120 dnl Modifies the CPPFLAGS with the right include directory and sets
121 dnl the 'have_CMPI' to either 'no' or 'yes'
122 dnl
124 AC_DEFUN([CHECK_CMPI],
125 [
126 AC_MSG_CHECKING(for CMPI headers)
127 dnl Check just with the standard include paths
128 CMPI_CPP_FLAGS="$CPPFLAGS"
129 _CHECK_CMPI(standard)
130 if test "$have_CMPI" == "yes"; then
131 dnl The standard include paths worked.
132 AC_MSG_RESULT(yes)
133 else
134 _DIRS_="/usr/include/cmpi \
135 /usr/local/include/cmpi \
136 $PEGASUS_ROOT/src/Pegasus/Provider/CMPI \
137 /opt/tog-pegasus/include/Pegasus/Provider/CMPI \
138 /usr/include/Pegasus/Provider/CMPI \
139 /usr/include/openwbem \
140 /usr/local/include/openwbem \
141 /usr/sniacimom/include"
142 for _DIR_ in $_DIRS_
143 do
144 _cppflags=$CPPFLAGS
145 _include_CMPI="$_DIR_"
146 CPPFLAGS="$CPPFLAGS -I$_include_CMPI"
147 _CHECK_CMPI($_DIR_)
148 if test "$have_CMPI" == "yes"; then
149 dnl Found it
150 AC_MSG_RESULT(yes)
151 dnl Save the new -I parameter
152 CMPI_CPP_FLAGS="$CPPFLAGS"
153 break
154 fi
155 CPPFLAGS=$_cppflags
156 done
157 fi
158 CPPFLAGS="$CMPI_CPP_FLAGS"
159 if test "$have_CMPI" == "no"; then
160 AC_MSG_ERROR(no. Sorry cannot find CMPI headers files.)
161 fi
162 ]
163 )
165 dnl
166 dnl The main function to check for the indication_helper header.
167 dnl Modifies the CPPFLAGS with the right include directory and sets
168 dnl the 'have_INDHELP' to either 'no' or 'yes'
169 dnl
171 AC_DEFUN([CHECK_INDHELP_HEADER],
172 [
173 INDHELP_CPP_FLAGS="$CPPFLAGS"
174 AC_MSG_CHECKING(for indication helper header)
175 dnl Check just with the standard include paths
176 _CHECK_INDHELP_HEADER(standard)
177 if test "$have_INDHELP" == "yes"; then
178 dnl The standard include paths worked.
179 AC_MSG_RESULT(yes)
180 else
181 _DIRS_="/usr/include/sblim \
182 /usr/local/include/sblim"
183 for _DIR_ in $_DIRS_
184 do
185 _cppflags=$CPPFLAGS
186 _include_INDHELP="$_DIR_"
187 CPPFLAGS="$CPPFLAGS -I$_include_INDHELP"
188 _CHECK_INDHELP_HEADER($_DIR_)
189 if test "$have_INDHELP" == "yes"; then
190 dnl Found it
191 AC_MSG_RESULT(yes)
192 dnl Save the new -I parameter
193 INDHELP_CPP_FLAGS="$CPPFLAGS"
194 break
195 fi
196 CPPFLAGS=$_cppflags
197 done
198 fi
199 CPPFLAGS="$INDHELP_CPP_FLAGS"
200 if test "$have_INDHELP" == "no"; then
201 AC_MSG_RESULT(no)
202 fi
203 ]
204 )
206 dnl
207 dnl The check for the CMPI provider directory
208 dnl Sets the PROVIDERDIR variable.
209 dnl
211 AC_DEFUN([CHECK_PROVIDERDIR],
212 [
213 AC_MSG_CHECKING(for CMPI provider directory)
214 _DIRS="$libdir/cmpi"
215 save_exec_prefix=${exec_prefix}
216 save_prefix=${prefix}
217 if test xNONE == x${prefix}; then
218 prefix=/usr/local
219 fi
220 if test xNONE == x${exec_prefix}; then
221 exec_prefix=$prefix
222 fi
223 for _dir in $_DIRS
224 do
225 _xdir=`eval echo $_dir`
226 AC_MSG_CHECKING( $_dir )
227 if test -d $_xdir ; then
228 dnl Found it
229 AC_MSG_RESULT(yes)
230 if test x"$PROVIDERDIR" == x ; then
231 PROVIDERDIR=$_dir
232 fi
233 break
234 fi
235 done
236 if test x"$PROVIDERDIR" == x ; then
237 PROVIDERDIR="$libdir"/cmpi
238 AC_MSG_RESULT(implied: $PROVIDERDIR)
239 fi
240 exec_prefix=$save_exec_prefix
241 prefix=$save_prefix
242 ]
243 )
245 dnl
246 dnl The "check" for the CIM server type
247 dnl Sets the CIMSERVER variable.
248 dnl
250 AC_DEFUN([CHECK_CIMSERVER],
251 [
252 AC_MSG_CHECKING(for CIM servers)
253 _SERVERS="sfcbd cimserver owcimomd"
254 for _name in $_SERVERS
255 do
256 AC_MSG_CHECKING( $_name )
257 which $_name > /dev/null 2>&1
258 if test $? == 0 ; then
259 dnl Found it
260 AC_MSG_RESULT(yes)
261 if test x"$CIMSERVER" == x ; then
262 case $_name in
263 sfcbd) CIMSERVER=sfcb;;
264 cimserver) CIMSERVER=pegasus;;
265 owcimomd) CIMSERVER=openwbem;;
266 esac
267 fi
268 break;
269 fi
270 done
271 if test x"$CIMSERVER" == x ; then
272 CIMSERVER=sfcb
273 AC_MSG_RESULT(implied: $CIMSERVER)
274 fi
275 ]
276 )
278 dnl
279 dnl The check for the SBLIM test suite
280 dnl Sets the TESTSUITEDIR variable and the TESTSUITE conditional
281 dnl
283 AC_DEFUN([CHECK_TESTSUITE],
284 [
285 AC_MSG_CHECKING(for SBLIM testsuite)
286 _DIRS="$datadir/sblim-testsuite"
287 save_exec_prefix=${exec_prefix}
288 save_prefix=${prefix}
289 if test xNONE == x${prefix}; then
290 prefix=/usr/local
291 fi
292 if test xNONE == x${exec_prefix}; then
293 exec_prefix=$prefix
294 fi
295 for _name in $_DIRS
296 do
297 AC_MSG_CHECKING( $_name )
298 _xname=`eval echo $_name`
299 if test -x $_xname/run.sh ; then
300 dnl Found it
301 AC_MSG_RESULT(yes)
302 if test x"$TESTSUITEDIR" == x; then
303 TESTSUITEDIR=$_name
304 fi
305 AC_SUBST(TESTSUITEDIR)
306 break;
307 fi
308 done
309 if test x"$TESTSUITEDIR" == x ; then
310 AC_MSG_RESULT(no)
311 fi
312 AM_CONDITIONAL(TESTSUITE,[test x"$TESTSUITEDIR" != x])
313 exec_prefix=$save_exec_prefix
314 prefix=$save_prefix
315 ]
316 )
318 dnl
319 dnl The main function to check for the cmpi-base common header
320 dnl Modifies the CPPFLAGS with the right include directory and sets
321 dnl the 'have_SBLIMBASE' to either 'no' or 'yes'
322 dnl
324 AC_DEFUN([CHECK_SBLIM_BASE],
325 [
326 AC_MSG_CHECKING(for SBLIM Base)
327 SBLIMBASE_CPP_FLAGS="$CPPFLAGS"
328 dnl Check just with the standard include paths
329 _CHECK_SBLIM_BASE(standard)
330 if test "$have_SBLIMBASE" == "yes"; then
331 dnl The standard include paths worked.
332 AC_MSG_RESULT(yes)
333 else
334 _DIRS_="/usr/include/sblim \
335 /usr/local/include/sblim"
336 for _DIR_ in $_DIRS_
337 do
338 _cppflags=$CPPFLAGS
339 _include_SBLIMBASE="$_DIR_"
340 CPPFLAGS="$CPPFLAGS -I$_include_SBLIMBASE"
341 _CHECK_SBLIM_BASE($_DIR_)
342 if test "$have_SBLIMBASE" == "yes"; then
343 dnl Found it
344 AC_MSG_RESULT(yes)
345 dnl Save the new -I parameter
346 SBLIMBASE_CPP_FLAGS="$CPPFLAGS"
347 LIBSBLIMBASE=-lcmpiOSBase_Common
348 break
349 fi
350 CPPFLAGS=$_cppflags
351 done
352 fi
353 CPPFLAGS=$SBLIMBASE_CPP_FLAGS
354 AC_SUBST(LIBSBLIMBASE)
355 if test "$have_SBLIMBASE" == "no"; then
356 AC_MSG_ERROR(no. The required SBLIM Base package is missing.)
357 fi
358 ]
359 )