os-cmpi-xen

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