os-cmpi-xen

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