os-cmpi-xen

annotate configure.ac @ 143:fc498265d293

Fixed warning (and bug) in Xen_DiskSettingData.

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