os-cmpi-xen

annotate configure.ac @ 121:4868ace2726b

Add initial consistence checks in test suite for Xen_MemoryPool, Xen_ProcessorPool and Xen_VirtualSystemManagementService.

Signed-off-by: Luke Szymanski <Lukasz.Szymanski@Unisys.com>
author Jim Fehlig <jfehlig@novell.com>
date Fri Jun 08 10:22:05 2007 -0600 (2007-06-08)
parents 30935f346520
children be22f410b2a3
rev   line source
jbulpin@0 1 # ============================================================================
jbulpin@0 2 # (C) Copyright IBM Corp. 2006
jbulpin@0 3 #
jbulpin@0 4 # This library is free software; you can redistribute it and/or
jbulpin@0 5 # modify it under the terms of the GNU Lesser General Public
jbulpin@0 6 # License as published by the Free Software Foundation; either
jbulpin@0 7 # version 2.1 of the License, or (at your option) any later version.
jbulpin@0 8 #
jbulpin@0 9 # This library is distributed in the hope that it will be useful,
jbulpin@0 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
jbulpin@0 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
jbulpin@0 12 # Lesser General Public License for more details.
jbulpin@0 13 #
jbulpin@0 14 # You should have received a copy of the GNU Lesser General Public
jbulpin@0 15 # License along with this library; if not, write to the Free Software
jbulpin@0 16 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
jbulpin@0 17 # ============================================================================
jbulpin@0 18 # Author: Dr. Gareth S. Bestor <bestor@us.ibm.com>
jbulpin@0 19 # Contributors: Viktor Mihajlovski <mihajlov@de.ibm.com>
jfehlig@28 20 # Jim Fehlig <jfehlig@novell.com>
jbulpin@0 21 # Summary: Autoconf input file for CMPI Xen Provider
jbulpin@0 22 # Description:
jbulpin@0 23 # This file is processed by autoconf to generate the configure script for
jbulpin@0 24 # building this SBLIM provider. This file must be customized for every
jbulpin@0 25 # SBLIM provider package.
jbulpin@0 26 # For more information about the SBLIM Project see:
jbulpin@0 27 # http://sblim.sourceforge.net/
jbulpin@0 28 # ============================================================================
jbulpin@0 29
jbulpin@0 30 # ----------------------------------------------------------------------------
jbulpin@0 31 # PROVIDER SPECIFIC CONFIGURATION VALUES
jbulpin@0 32 # ----------------------------------------------------------------------------
jbulpin@0 33
jbulpin@0 34 # Package information
jbulpin@0 35 # CHANGE THIS TO THE PACKAGE SUMMARY INFORMATION
jbulpin@0 36 # AC_INIT(<PACKAGE_NAME>, <PACKAGE_VERSION>, <PACKAGE_BUGREPORT>, <PACKAGE_TARBALL>)
jfehlig@32 37 AC_INIT(CMPI Xen Provider, 0.1.1, bestor@us.ibm.com, xen-cim-cmpi)
jbulpin@0 38
jbulpin@0 39 # Identify the source directory
jbulpin@0 40 # CHANGE THIS TO THE RELATIVE PATHNAME OF *ONE* OF THE SOURCE FILES
jbulpin@0 41 AC_CONFIG_SRCDIR([src/Xen_ComputerSystem.c])
jbulpin@0 42
jbulpin@0 43 # Create any necessary files from "<file>.in" templates
jbulpin@0 44 # CHANGE THIS TO THE NAME OF THE PACKAGE RPM SPEC FILE. E.G. "<PACKAGE_TARBALL>.spec"
jfehlig@17 45 AC_CONFIG_FILES([xen-cim-cmpi.spec])
jbulpin@0 46
jfehlig@116 47 # Version number for any versioned provider libraries
jfehlig@52 48 PROVIDER_CURRENT_VERSION=1
jfehlig@52 49 PROVIDER_REVISION_VERSION=0
jfehlig@52 50 PROVIDER_AGE_VERSION=0
jfehlig@52 51 PROVIDER_VERSION_INFO=$PROVIDER_CURRENT_VERSION:$PROVIDER_REVISION_VERSION:$PROVIDER_AGE_VERSION
jfehlig@52 52
jfehlig@52 53 AC_SUBST([PROVIDER_VERSION_INFO])
jfehlig@52 54
jfehlig@52 55
jbulpin@0 56 # Check for required programs, such as commands used in system() calls or
jbulpin@0 57 # any special tools required for building this package (e.g. lex, yacc, etc)
jbulpin@0 58 # ADD CHECKS FOR ANY REQUIRED PROGRAMS HERE
jbulpin@0 59 #AC_CHECK_PROG(PS,xm,[xm list])
jbulpin@0 60
jbulpin@0 61 # Check for required header files
jbulpin@0 62 # ADD CHECKS FOR ANY REQUIRED NON-CMPI HEADER FILES HERE
jfehlig@2 63 AC_CHECK_HEADERS([stdarg.h errno.h])
jbulpin@0 64
jbulpin@0 65 # Check for required library functions
jbulpin@0 66 # ADD CHECKS FOR ANY REQUIRED NON_CMPI LIBRARY FUNCTIONS HERE
jbulpin@0 67 AC_CHECK_FUNCS([popen pclose fgets vfprintf fprintf sprintf sscanf])
jbulpin@0 68
jfehlig@2 69 # Is pkg-config available?
jfehlig@2 70 AC_CHECK_PROG([HAVE_PKG_CONFIG], [pkg-config], [yes], [no])
jfehlig@2 71
jfehlig@33 72 # Check for libxen
jfehlig@46 73 AC_CHECK_LIB([xenapi], [xen_init],
jfehlig@36 74 [LIBXEN_LIBS="-lxenapi"
jfehlig@36 75 LIBXEN_CFLAGS="-I/usr/include/xen/api"],
jfehlig@33 76 [AC_MSG_ERROR([xen library not found])],
jfehlig@33 77 [-lxml2])
jfehlig@2 78
jfehlig@33 79 AC_SUBST([LIBXEN_LIBS])
jfehlig@36 80 AC_SUBST([LIBXEN_CFLAGS])
jfehlig@2 81
jfehlig@2 82 # Add argument for specifying location of libxml2
jfehlig@52 83 # NOTE: libxenapi uses libxml2 but does not link with it.
jfehlig@33 84 # Ensure libxml2 is available.
jfehlig@2 85 AC_ARG_WITH([libxml], [ --with-libxml=PREFIX libxml2 location])
jfehlig@2 86
jfehlig@2 87 # Ensure we have libxml2. Use pkg-config
jfehlig@2 88 LIBXML2_MIN_VERSION=2.5.0
jfehlig@2 89 LIBXML2_CONFIG="xml2-config"
jfehlig@2 90 LIBXML2_CFLAGS=""
jfehlig@2 91 LIBXML2_LIBS=""
jfehlig@2 92 LIBXML2_FOUND="no"
jfehlig@2 93
jfehlig@2 94 if test "x$with_libxml" = "xno" ; then
jfehlig@2 95 AC_MSG_CHECKING([for libxml2 libraries >= $LIBXML2_MIN_VERSION])
jfehlig@2 96 AC_MSG_ERROR(libxml2 >= $LIBXML2_MIN_VERSION is required for this package)
jfehlig@2 97 elif test "x$with_libxml" = "x" -a "x$HAVE_PKG_CONFIG" = "xyes" ; then
jfehlig@2 98 export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/lib/pkgconfig:/usr/local/lib/pkgconfig"
jfehlig@52 99 PKG_CHECK_MODULES([LIBXML2], [libxml-2.0 >= $LIBXML2_MIN_VERSION],
jfehlig@2 100 [LIBXML2_FOUND=yes],
jfehlig@2 101 [LIBXML2_FOUND=no])
jfehlig@2 102 fi
jfehlig@2 103
jfehlig@2 104 if test "x$LIBXML2_FOUND" = "xno" ; then
jfehlig@2 105 AC_MSG_CHECKING([for libxml2 libraries >= $LIBXML2_MIN_VERSION])
jfehlig@2 106 if test "x$with_libxml" != "x" ; then
jfehlig@2 107 LIBXML2_CONFIG=$with_libxml/bin/$LIBXML2_CONFIG
jfehlig@2 108 fi
jfehlig@2 109 if ! $LIBXML2_CONFIG --version > /dev/null 2>&1 ; then
jfehlig@2 110 AC_MSG_ERROR([Could not find libxml2 anywhere (see config.log for details).])
jfehlig@2 111 fi
jfehlig@2 112 vers=`$LIBXML2_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
jfehlig@2 113 minvers=`echo $LIBXML2_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
jfehlig@2 114 if test "$vers" -ge "$minvers" ; then
jfehlig@52 115 LIBXML2_LIBS="`$LIBXML2_CONFIG --libs`"
jfehlig@52 116 LIBXML2_CFLAGS="`$LIBXML2_CONFIG --cflags`"
jfehlig@2 117 AC_MSG_RESULT([yes])
jfehlig@2 118 else
jfehlig@2 119 AC_MSG_ERROR([You need at least libxml2 $LIBXML2_MIN_VERSION])
jfehlig@2 120 fi
jfehlig@2 121 fi
jfehlig@2 122
jfehlig@52 123 AC_SUBST([LIBXML2_CFLAGS])
jfehlig@52 124 AC_SUBST([LIBXML2_LIBS])
jfehlig@52 125
jfehlig@52 126
jfehlig@27 127 # Add argument to allow specifying which host instrumentation
jfehlig@27 128 # to use. omc or sblim are the options, omc is default.
jfehlig@27 129 HOST_INSTRUMENTATION="omc"
jfehlig@27 130 AC_ARG_WITH([host-instrumentation],
jfehlig@27 131 [ --with-host-instrumentation=TYPE supported types are omc and sblim],
jfehlig@27 132 [
jfehlig@27 133 if test "x$withval" != "xno" ; then
jfehlig@27 134
jfehlig@27 135 HOST_INSTRUMENTATION="$withval"
jfehlig@27 136 fi
jfehlig@27 137 ]
jfehlig@27 138 )
jfehlig@27 139
jfehlig@27 140 if test "x$HOST_INSTRUMENTATION" = "xomc" ; then
jfehlig@28 141 HOST_INSTRUMENTATION_NS="smash"
jfehlig@28 142 HOST_INSTRUMENTATION_PREFIX="OMC_"
jfehlig@27 143 elif test "x$HOST_INSTRUMENTATION" = "xsblim" ; then
jfehlig@28 144 HOST_INSTRUMENTATION_NS="root/cimv2"
jfehlig@28 145 HOST_INSTRUMENTATION_PREFIX="Linux__"
jfehlig@27 146 else
jfehlig@27 147 AC_MSG_ERROR([unrecognized host instrumentation $HOST_INSTRUMENTATION])
jfehlig@27 148 fi
jfehlig@27 149
jfehlig@28 150 AC_SUBST([HOST_INSTRUMENTATION_NS])
jfehlig@28 151 AC_SUBST([HOST_INSTRUMENTATION_PREFIX])
jfehlig@27 152
jbulpin@0 153 # Set compiler flag for CMPI API version compatibility
jbulpin@0 154 # SET THE PACKAGE CMPI_VERSION HERE
jbulpin@0 155 CPPFLAGS="$CPPFLAGS -DCMPI_VERSION=90"
jbulpin@0 156
jbulpin@0 157 # By default compile in SBLIM_TRACE support
jbulpin@0 158 # REMOVE THIS FLAG TO DISABLE SBLIM_TRACE SUPPORT IN THE PROVIDER
jbulpin@0 159 CPPFLAGS="$CPPFLAGS -DSBLIM_DEBUG"
jbulpin@0 160
jbulpin@0 161
jbulpin@0 162 ################### NO CHANGES SHOULD BE NECESSARY BELOW ######################
jbulpin@0 163
jbulpin@0 164 # Configure command line options
jbulpin@0 165 AC_ARG_VAR([CIMSERVER],[the target CIM server (pegasus|sfcb|openwbem|sniacimom).])
jbulpin@0 166 AC_ARG_VAR([PROVIDERDIR],[the directory where the CMPI providers will be installed.])
jbulpin@0 167 AC_ARG_VAR([TESTSUITEDIR],[the directory where the SBLIM testsuite is installed.])
jbulpin@0 168
jbulpin@0 169 # Autogenerate the autoconf header file to store build settings
jbulpin@0 170 AC_CONFIG_HEADER([config.h])
jbulpin@0 171
jfehlig@12 172 # Autogenerate the Makefiles
jfehlig@12 173 AC_CONFIG_FILES([Makefile
jfehlig@12 174 src/Makefile])
jfehlig@28 175
jbulpin@0 176 AM_INIT_AUTOMAKE
jbulpin@0 177
jbulpin@0 178 # Check for the required C compiler
jbulpin@0 179 AC_PROG_CC
jbulpin@0 180
jbulpin@0 181 # Check if the C compiler supports 'const'
jbulpin@0 182 AC_C_CONST
jbulpin@0 183
jbulpin@0 184 # Check for the required libtool
jbulpin@0 185 AC_PROG_LIBTOOL
jbulpin@0 186
jbulpin@0 187 # Check for the required install program
jbulpin@0 188 AC_PROG_INSTALL
jbulpin@0 189
jbulpin@0 190 # Check for some common required headers
jbulpin@0 191 AC_CHECK_HEADERS([stdlib.h string.h unistd.h])
jbulpin@0 192
jbulpin@0 193 # Check if the system headers conform to ANSI C
jbulpin@0 194 AC_HEADER_STDC
jbulpin@0 195
jbulpin@0 196 # Check for the required CMPI header files (this macro is defined in acinclude.m4)
jbulpin@0 197 CHECK_CMPI
jbulpin@0 198
jbulpin@0 199 # Check for where to install CMPI libraries (this macro is defined in acinclude.m4)
jbulpin@0 200 CHECK_PROVIDERDIR
jbulpin@0 201
jbulpin@0 202 # Check for presense of a CIM server (this macro is defined in acinclude.m4)
jbulpin@0 203 CHECK_CIMSERVER
jbulpin@0 204
jbulpin@0 205 # Check for the SBLIM testsuite (this macro is defined in acinclude.m4)
jbulpin@0 206 CHECK_TESTSUITE
jbulpin@0 207 if test x"$TESTSUITEDIR" == x; then
jbulpin@0 208 TESTSUITE_SUPPORT=Disabled
jbulpin@0 209 else
jbulpin@0 210 TESTSUITE_SUPPORT=Enabled
jbulpin@0 211 fi
jbulpin@0 212
jbulpin@0 213 # Display configuration options
jbulpin@0 214 echo "----------------------------------------------------------"
jbulpin@0 215 echo "Configuration for $PACKAGE complete."
jbulpin@0 216 echo ""
jbulpin@0 217 echo "The following configuration options have been selected:"
jbulpin@0 218 echo " CIMSERVER: " $CIMSERVER
jbulpin@0 219 echo " PROVIDERDIR: " $PROVIDERDIR
jbulpin@0 220 echo " TESTSUITE_SUPPORT: " $TESTSUITE_SUPPORT
jbulpin@0 221 if test x"$TESTSUITEDIR" != x; then
jbulpin@0 222 echo " TESTSUITEDIR: " $TESTSUITEDIR
jbulpin@0 223 fi
jfehlig@27 224 echo " HOST_INSTRUMENTATION: " $HOST_INSTRUMENTATION
jbulpin@0 225 echo " CPPFLAGS:" $CPPFLAGS
jbulpin@0 226 echo
jbulpin@0 227 echo "You can override these values by setting the corresponding"
jbulpin@0 228 echo "configure command-line option(s); e.g."
jbulpin@0 229 echo " ./configure PROVIDERDIR=/home/me/lib/sblim/"
jbulpin@0 230 echo "----------------------------------------------------------"
jbulpin@0 231
jbulpin@0 232 # Generate configure scripts for the Makefile
jbulpin@0 233 AC_OUTPUT
jbulpin@0 234
jbulpin@0 235 echo "You may now run make"
jbulpin@0 236