os-cmpi-xen

view acinclude.m4 @ 0:72b83cde6b72

Initial checkin
author jbulpin@ubuntu.eng.hq.xensource.com
date Wed Mar 22 14:05:14 2006 -0700 (2006-03-22)
parents
children 7c8d92923475
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/sniacimom/include"
141 for _DIR_ in $_DIRS_
142 do
143 _cppflags=$CPPFLAGS
144 _include_CMPI="$_DIR_"
145 CPPFLAGS="$CPPFLAGS -I$_include_CMPI"
146 _CHECK_CMPI($_DIR_)
147 if test "$have_CMPI" == "yes"; then
148 dnl Found it
149 AC_MSG_RESULT(yes)
150 dnl Save the new -I parameter
151 CMPI_CPP_FLAGS="$CPPFLAGS"
152 break
153 fi
154 CPPFLAGS=$_cppflags
155 done
156 fi
157 CPPFLAGS="$CMPI_CPP_FLAGS"
158 if test "$have_CMPI" == "no"; then
159 AC_MSG_ERROR(no. Sorry cannot find CMPI headers files.)
160 fi
161 ]
162 )
164 dnl
165 dnl The main function to check for the indication_helper header.
166 dnl Modifies the CPPFLAGS with the right include directory and sets
167 dnl the 'have_INDHELP' to either 'no' or 'yes'
168 dnl
170 AC_DEFUN([CHECK_INDHELP_HEADER],
171 [
172 INDHELP_CPP_FLAGS="$CPPFLAGS"
173 AC_MSG_CHECKING(for indication helper header)
174 dnl Check just with the standard include paths
175 _CHECK_INDHELP_HEADER(standard)
176 if test "$have_INDHELP" == "yes"; then
177 dnl The standard include paths worked.
178 AC_MSG_RESULT(yes)
179 else
180 _DIRS_="/usr/include/sblim \
181 /usr/local/include/sblim"
182 for _DIR_ in $_DIRS_
183 do
184 _cppflags=$CPPFLAGS
185 _include_INDHELP="$_DIR_"
186 CPPFLAGS="$CPPFLAGS -I$_include_INDHELP"
187 _CHECK_INDHELP_HEADER($_DIR_)
188 if test "$have_INDHELP" == "yes"; then
189 dnl Found it
190 AC_MSG_RESULT(yes)
191 dnl Save the new -I parameter
192 INDHELP_CPP_FLAGS="$CPPFLAGS"
193 break
194 fi
195 CPPFLAGS=$_cppflags
196 done
197 fi
198 CPPFLAGS="$INDHELP_CPP_FLAGS"
199 if test "$have_INDHELP" == "no"; then
200 AC_MSG_RESULT(no)
201 fi
202 ]
203 )
205 dnl
206 dnl The check for the CMPI provider directory
207 dnl Sets the PROVIDERDIR variable.
208 dnl
210 AC_DEFUN([CHECK_PROVIDERDIR],
211 [
212 AC_MSG_CHECKING(for CMPI provider directory)
213 _DIRS="$libdir/cmpi"
214 save_exec_prefix=${exec_prefix}
215 save_prefix=${prefix}
216 if test xNONE == x${prefix}; then
217 prefix=/usr/local
218 fi
219 if test xNONE == x${exec_prefix}; then
220 exec_prefix=$prefix
221 fi
222 for _dir in $_DIRS
223 do
224 _xdir=`eval echo $_dir`
225 AC_MSG_CHECKING( $_dir )
226 if test -d $_xdir ; then
227 dnl Found it
228 AC_MSG_RESULT(yes)
229 if test x"$PROVIDERDIR" == x ; then
230 PROVIDERDIR=$_dir
231 fi
232 break
233 fi
234 done
235 if test x"$PROVIDERDIR" == x ; then
236 PROVIDERDIR="$libdir"/cmpi
237 AC_MSG_RESULT(implied: $PROVIDERDIR)
238 fi
239 exec_prefix=$save_exec_prefix
240 prefix=$save_prefix
241 ]
242 )
244 dnl
245 dnl The "check" for the CIM server type
246 dnl Sets the CIMSERVER variable.
247 dnl
249 AC_DEFUN([CHECK_CIMSERVER],
250 [
251 AC_MSG_CHECKING(for CIM servers)
252 _SERVERS="sfcbd cimserver owcimomd"
253 for _name in $_SERVERS
254 do
255 AC_MSG_CHECKING( $_name )
256 which $_name > /dev/null 2>&1
257 if test $? == 0 ; then
258 dnl Found it
259 AC_MSG_RESULT(yes)
260 if test x"$CIMSERVER" == x ; then
261 case $_name in
262 sfcbd) CIMSERVER=sfcb;;
263 cimserver) CIMSERVER=pegasus;;
264 owcimomd) CIMSERVER=openwbem;;
265 esac
266 fi
267 break;
268 fi
269 done
270 if test x"$CIMSERVER" == x ; then
271 CIMSERVER=sfcb
272 AC_MSG_RESULT(implied: $CIMSERVER)
273 fi
274 ]
275 )
277 dnl
278 dnl The check for the SBLIM test suite
279 dnl Sets the TESTSUITEDIR variable and the TESTSUITE conditional
280 dnl
282 AC_DEFUN([CHECK_TESTSUITE],
283 [
284 AC_MSG_CHECKING(for SBLIM testsuite)
285 _DIRS="$datadir/sblim-testsuite"
286 save_exec_prefix=${exec_prefix}
287 save_prefix=${prefix}
288 if test xNONE == x${prefix}; then
289 prefix=/usr/local
290 fi
291 if test xNONE == x${exec_prefix}; then
292 exec_prefix=$prefix
293 fi
294 for _name in $_DIRS
295 do
296 AC_MSG_CHECKING( $_name )
297 _xname=`eval echo $_name`
298 if test -x $_xname/run.sh ; then
299 dnl Found it
300 AC_MSG_RESULT(yes)
301 if test x"$TESTSUITEDIR" == x; then
302 TESTSUITEDIR=$_name
303 fi
304 AC_SUBST(TESTSUITEDIR)
305 break;
306 fi
307 done
308 if test x"$TESTSUITEDIR" == x ; then
309 AC_MSG_RESULT(no)
310 fi
311 AM_CONDITIONAL(TESTSUITE,[test x"$TESTSUITEDIR" != x])
312 exec_prefix=$save_exec_prefix
313 prefix=$save_prefix
314 ]
315 )
317 dnl
318 dnl The main function to check for the cmpi-base common header
319 dnl Modifies the CPPFLAGS with the right include directory and sets
320 dnl the 'have_SBLIMBASE' to either 'no' or 'yes'
321 dnl
323 AC_DEFUN([CHECK_SBLIM_BASE],
324 [
325 AC_MSG_CHECKING(for SBLIM Base)
326 SBLIMBASE_CPP_FLAGS="$CPPFLAGS"
327 dnl Check just with the standard include paths
328 _CHECK_SBLIM_BASE(standard)
329 if test "$have_SBLIMBASE" == "yes"; then
330 dnl The standard include paths worked.
331 AC_MSG_RESULT(yes)
332 else
333 _DIRS_="/usr/include/sblim \
334 /usr/local/include/sblim"
335 for _DIR_ in $_DIRS_
336 do
337 _cppflags=$CPPFLAGS
338 _include_SBLIMBASE="$_DIR_"
339 CPPFLAGS="$CPPFLAGS -I$_include_SBLIMBASE"
340 _CHECK_SBLIM_BASE($_DIR_)
341 if test "$have_SBLIMBASE" == "yes"; then
342 dnl Found it
343 AC_MSG_RESULT(yes)
344 dnl Save the new -I parameter
345 SBLIMBASE_CPP_FLAGS="$CPPFLAGS"
346 LIBSBLIMBASE=-lcmpiOSBase_Common
347 break
348 fi
349 CPPFLAGS=$_cppflags
350 done
351 fi
352 CPPFLAGS=$SBLIMBASE_CPP_FLAGS
353 AC_SUBST(LIBSBLIMBASE)
354 if test "$have_SBLIMBASE" == "no"; then
355 AC_MSG_ERROR(no. The required SBLIM Base package is missing.)
356 fi
357 ]
358 )