os-cmpi-xen

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