-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfigure.ac
341 lines (293 loc) · 9.49 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
AC_PREREQ([2.60])
dnl lmiwbem version number
m4_define(lmiwbem_version_major, 0)
m4_define(lmiwbem_version_minor, 7)
m4_define(lmiwbem_version_patch, 2)
m4_define(lmiwbem_version, lmiwbem_version_major.lmiwbem_version_minor.lmiwbem_version_patch)
AC_INIT([python-lmiwbem], [lmiwbem_version], [[email protected]])
AC_CONFIG_MACRO_DIR([m4])
m4_include([m4/python_devel.m4])
m4_include([m4/boost_base.m4])
m4_include([m4/boost_python.m4])
AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects])
AM_SILENT_RULES([yes])
AC_CONFIG_HEADERS([config.h])
AC_DISABLE_STATIC
AC_PROG_CXX
AC_LANG([C++])
LT_INIT
dnl Check for platform and set TOG-Pegasus platform variable
dnl TODO: other platforms
AC_CANONICAL_HOST
case $host_os in
linux*)
case `uname -p` in
i*86)
PEGASUS_PLATFORM=PEGASUS_PLATFORM_LINUX_IX86_GNU
;;
x86_64)
PEGASUS_PLATFORM=PEGASUS_PLATFORM_LINUX_X86_64_GNU
;;
ppc)
PEGASUS_PLATFORM=PEGASUS_PLATFORM_LINUX_PPC_GNU
;;
ppc64*)
PEGASUS_PLATFORM=PEGASUS_PLATFORM_LINUX_PPC64_GNU
;;
s390)
PEGASUS_PLATFORM=PEGASUS_PLATFORM_LINUX_ZSERIES_GNU
;;
s390x)
PEGASUS_PLATFORM=PEGASUS_PLATFORM_LINUX_ZSERIES64_GNU
;;
arm*)
PEGASUS_PLATFORM=PEGASUS_PLATFORM_LINUX_XSCALE_GNU
;;
aarch64)
PEGASUS_PLATFORM=PEGASUS_PLATFORM_LINUX_AARCH64_GNU
;;
*)
AC_MSG_ERROR([Your platform is not currently supported])
;;
esac
;;
*)
AC_MSG_ERROR([Your platform is not currently supported])
;;
esac
AC_SUBST([PEGASUS_PLATFORM])
dnl Check for TOG-Pegasus Common library
SAVE_LIBS=$LIBS
LIBS="-lpegcommon"
AC_MSG_CHECKING([for libpegcommon])
AC_TRY_LINK([], [],
[AC_MSG_RESULT([yes]); PEGASUS_COMMON_LIB=-lpegcommon],
[AC_MSG_ERROR([TOG-Pegasus common library not found; install tog-pegasus-libs])]
)
dnl Check for TOG-Pegasus Client library
LIBS="$LIBS -lpegclient"
AC_MSG_CHECKING([for libpegclient])
AC_TRY_LINK([], [],
[AC_MSG_RESULT([yes]); PEGASUS_CLIENT_LIB=-lpegclient],
[AC_MSG_ERROR([TOG-Pegasus client library not found; install tog-pegasus-libs])]
)
dnl --with-listener
AC_ARG_WITH(
[listener],
[AS_HELP_STRING(
[--with-listener=@<:@yes/no@:>@],
[support CIMIndicationListener [default=yes]])],
[with_listener=$withval])
LIBS="-lpeglistener"
AC_MSG_CHECKING([for libpeglistener])
if test x"$with_listener" != x"no"; then
with_listener="yes"
dnl Check for TOG-Pegasus Listener library
AC_TRY_LINK([], [],
[AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_PEGASUS_LISTENER], [1], [Pegasus CIMListener])
PEGASUS_LISTENER_LIB=-lpeglistener],
[AC_MSG_ERROR([TOG-Pegasus indication listener library not found; install tog-pegasus-libs])]
)
else
AC_MSG_RESULT([skipped])
fi
AC_SUBST([WITH_LISTENER], ["$with_listener"])
AM_CONDITIONAL([BUILD_WITH_LISTENER], [test x"$with_listener" = x"yes"])
dnl Check for TOG-Pegasus headers
AC_MSG_CHECKING([for TOG-Pegasus headers])
AC_TRY_COMPILE(
[#define $PEGASUS_PLATFORM
#include <Pegasus/Common/Config.h>],
[], [AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_ERROR([TOG-Pegasus headers not found; install tog-pegasus-devel])]
)
dnl Check if TOG-Pegasus CIMListener supports bind address.
if test x"$with_listener" = x"yes"; then
LIBS="-lpeglistener"
AC_MSG_CHECKING([for TOG-Pegasus CIMListener with bind address])
AC_TRY_COMPILE(
[#define $PEGASUS_PLATFORM
#include <Pegasus/Listener/CIMListener.h>],
[Pegasus::CIMListener l(Pegasus::String("0.0.0.0"), 10240);],
[with_listener_bind_addr="yes"
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_PEGASUS_LISTENER_WITH_BIND_ADDRESS], [1],
[Pegasus CIMListener with bind address])],
[with_listener_bind_addr="no"
AC_MSG_RESULT([no])])
LIBS=""
else
with_listener_bind_addr="no"
fi
dnl Check for Pegasus verification callback capabilities
LIBS="-lpegcommon"
AC_MSG_CHECKING([for TOG-Pegasus X509 verification capabilities])
AC_TRY_LINK(
[#define $PEGASUS_PLATFORM
#include <Pegasus/Common/SSLContext.h>],
[Pegasus::SSLCertificateVerifyFunctionWithData cb;],
[with_x509_verif_cap="yes"
AC_MSG_RESULT([yes]);
AC_DEFINE(
[HAVE_PEGASUS_VERIFICATION_CALLBACK_WITH_DATA], [1],
[TOG-Pegasus supports X509 verification])],
[with_x509_verif_cap="no"
AC_MSG_RESULT([no])]
)
dnl Check for Pegasus enumeration context
LIBS="-lpegclient"
AC_MSG_CHECKING([for TOG-Pegasus Enumeration Content])
AC_TRY_LINK(
[#define $PEGASUS_PLATFORM
#include <Pegasus/Client/CIMEnumerationContext.h>],
[Pegasus::CIMEnumerationContext ctx;],
[with_enum_ctx="yes"
AC_MSG_RESULT([yes])
AC_DEFINE(
[HAVE_PEGASUS_ENUMERATION_CONTEXT], [1],[TOG-Pegasus Enumeration Context])],
[with_enum_ctx="no"
AC_MSG_RESULT([no])]
)
AC_SUBST([WITH_ENUM_CTX], ["$with_enum_ctx"])
AM_CONDITIONAL([BUILD_WITH_ENUM_CTX], [test x"$with_enum_ctx" = x"yes"])
dnl --with-slp
AC_ARG_WITH(
[slp],
[AS_HELP_STRING(
[--with-slp=@<:@yes/no@:>@],
[Support SLP])],
[with_slp=$withval])
LIBS="-lslp"
AC_MSG_CHECKING([for SLP])
if test x"$with_slp" != x"no"; then
with_slp="yes"
dnl Check for OpenSLP library.
AC_TRY_LINK([], [],
[AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_SLP], [1], [Support SLP])
SLP_LIB=-lslp],
[AC_MSG_ERROR([OpenSLP library not found; install openslp])]
)
else
AC_MSG_RESULT([skipping])
fi
AC_SUBST([WITH_SLP], ["$with_slp"])
AM_CONDITIONAL([BUILD_WITH_SLP], [test x"$with_slp" = x"yes"])
LIBS=$SAVE_LIBS
AC_SUBST([PEGASUS_COMMON_LIB])
AC_SUBST([PEGASUS_CLIENT_LIB])
AC_SUBST([PEGASUS_LISTENER_LIB])
AC_SUBST([SLP_LIB])
dnl --with-python
AC_ARG_WITH(
[python3],
[AS_HELP_STRING(
[--with-python3=@<:@yes/no@:>@],
[use Python 3 [default=no]])],
[with_python3=$withval])
if test x"$with_python3" = x"yes"; then
AM_PATH_PYTHON([3.0])
else
AM_PATH_PYTHON([2.6])
fi
dnl Check for python-devel
AX_PYTHON_DEVEL([$PYTHON_VERSION])
dnl Check for Boost::Python
AX_BOOST_BASE([1.40], [],
[AC_MSG_ERROR([Boost not found; install boost-devel])])
AX_BOOST_PYTHON([$PYTHON_VERSION])
if test x"$BOOST_PYTHON_LIB" = x""; then
if test x"${PYTHON_VERSION:0:1}" = x"3"; then
AC_MSG_ERROR(Boost::Python3 not found; install boost-python3)
else
AC_MSG_ERROR(Boost::Python not found; install boost-python)
fi
fi
dnl Note that AX_BOOST_PYTHON just gives us the name of the library (BOOST_PYTHON_LIB),
dnl and not the actual linker flag, so we must add the -l prefix manually
BOOST_PYTHON_LIB=-l$BOOST_PYTHON_LIB
AC_SUBST([BOOST_PYTHON_LIB])
dnl --with-default-namespace
AC_ARG_WITH(
[default-namespace],
[AS_HELP_STRING(
[--with-default-namespace=NAMESPACE],
[Default CIM namespace])],
[with_defns=$withval])
if test x"$with_defns" = x; then
with_defns="root/cimv2"
fi
dnl --with-wsman
AC_ARG_WITH(
[wsman],
[AS_HELP_STRING(
[with-wsman=@<:@yes/no@:>@],
[Support WSMAN [default=no]])],
[with_wsman=$withval])
if test x"$with_wsman" = x"yes"; then
PKG_CHECK_MODULES(
[OPENWSMAN],
[openwsman++], [
AC_DEFINE([HAVE_OPENWSMAN], [1], [OpenWSMAN support])
AC_SUBST([OPENWSMAN_CFLAGS])
AC_SUBST([OPENWSMAN_LIBS])
], [])
else
with_wsman="no"
fi
AC_SUBST([WITH_WSMAN], ["$with_wsman"])
AM_CONDITIONAL([BUILD_WITH_WSMAN], [test x"$with_wsman" = x"yes"])
AC_DEFINE_UNQUOTED([DEFAULT_NAMESPACE], ["$with_defns"], [Default CIM namespace])
dnl --with-default-trust-store
AC_ARG_WITH(
[default-trust-store],
[AS_HELP_STRING(
[--with-default-trust-store=DIR],
[Default trust store])],
[with_defts=$withval])
if test x"$with_defts" = x; then
with_defts="/etc/pki/ca-trust/source/anchors/"
fi
AC_DEFINE_UNQUOTED([DEFAULT_TRUST_STORE], ["$with_defts"], [Default trust store])
dnl --with-doc
AC_ARG_WITH(
[doc],
[AS_HELP_STRING(
[--with-doc=@<:@yes/no@:>@],
[Build documentation])],
[with_doc=$withval])
if test x"$with_doc" != x"yes"; then
with_doc="no"
fi
AM_CONDITIONAL([BUILD_WITH_DOC], [test x"$with_doc" = x"yes"])
AC_SUBST([SPECFILE_DATE], [$(date +"%a %b %e %G")])
dnl Substitute CXXFLAGS for setup.py.
AC_SUBST([CXXFLAGS], [$CXXFLAGS])
AC_OUTPUT(
[makefile
python-lmiwbem.spec
setup.py
doc/makefile
doc/src/conf.py
src/makefile
src/lmiwbem/__init__.py
src/lmiwbem/lmiwbem_types.py]
)
VERSION_RULE=$(printf "%$(echo ${#VERSION})s=" | tr " " "=")
AC_MSG_NOTICE([
python-lmiwbem $VERSION:
===============$VERSION_RULE
Python version : $PYTHON_VERSION
Default CIM namespace : $with_defns
Default trust store : $with_defts
Support SLP : $with_slp
Support CIMIndicationListener : $with_listener
Support CIMListener bind Address : $with_listener_bind_addr
Support X509 Verification Capabilities : $with_x509_verif_cap
Support Enumeration Context : $with_enum_ctx
Support WSMAN : $with_wsman
Build documentation : $with_doc
Now type 'make' to build $PACKAGE
])