~scarneiro/ubuntu/oneiric/opendrim-lmp-recordlog/fix-for-756108

« back to all changes in this revision

Viewing changes to acinclude.m4

  • Committer: Bazaar Package Importer
  • Author(s): Guillaume BOTTEX
  • Date: 2009-08-19 17:08:36 UTC
  • Revision ID: james.westby@ubuntu.com-20090819170836-4pdxix40ulw5xqds
Tags: upstream-1.1.1
ImportĀ upstreamĀ versionĀ 1.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
################################################################################
 
2
# Linux Management Providers (LMP), OpenDRIM_RecordLogPackage provider package
 
3
# Copyright (C) 2007 Ilsoo Byun, ETRI <widepis@etri.re.kr, widepis@empal.com>
 
4
 
5
# This program is being developed under the "OpenDRIM" project.
 
6
# The "OpenDRIM" project web page: http://opendrim.sourceforge.net
 
7
# The "OpenDRIM" project mailing list: opendrim@googlegroups.com
 
8
 
9
# This program is free software; you can redistribute it and/or
 
10
# modify it under the terms of the GNU General Public License
 
11
# as published by the Free Software Foundation; version 2
 
12
# of the License.
 
13
 
14
# This program is distributed in the hope that it will be useful,
 
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
# GNU General Public License for more details.
 
18
 
19
# You should have received a copy of the GNU General Public License
 
20
# along with this program; if not, write to the Free Software
 
21
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
22
#################################################################################
 
23
 
 
24
#################################################################################
 
25
# To contributors, please leave your contact information in this section
 
26
# AND comment your changes in the source code.
 
27
 
28
# Modified by 2008 Guillaume BOTTEX, ETRI <guillaumebottex@etri.re.kr, guillaumebottex@gmail.com>
 
29
################################################################################
 
30
 
 
31
AC_DEFUN([SHOW_COPYRIGHT],
 
32
        [
 
33
        echo "#################################################################################
 
34
# Linux Management Providers (LMP), OpenDRIM_RecordLogPackage provider package
 
35
# Copyright (C) 2007 Ilsoo Byun <widepis@etri.re.kr>
 
36
 
37
# This program is being developed under the "OpenDRIM" project.
 
38
# The "OpenDRIM" project web page: http://opendrim.sourceforge.net
 
39
# The "OpenDRIM" project mailing list: opendrim@googlegroups.com
 
40
 
41
# This program is free software; you can redistribute it and/or
 
42
# modify it under the terms of the GNU General Public License
 
43
# as published by the Free Software Foundation; version 2
 
44
# of the License.
 
45
 
46
# This program is distributed in the hope that it will be useful,
 
47
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
48
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
49
# GNU General Public License for more details.
 
50
 
51
# You should have received a copy of the GNU General Public License
 
52
# along with this program; if not, write to the Free Software
 
53
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
54
#################################################################################
 
55
"
 
56
        ]
 
57
)
 
58
 
 
59
AC_DEFUN([CHECK_CIMSERVER],
 
60
        [
 
61
        AC_MSG_CHECKING(for CIM servers)
 
62
        
 
63
        if test x"$CIMSERVER" == x
 
64
        then
 
65
                AC_MSG_ERROR([[please define the CIMSERVER variable (see ./configure --help)]])
 
66
        fi
 
67
        
 
68
        if test "$CIMSERVER" != pegasus && test "$CIMSERVER" != sfcb && test "$CIMSERVER" != openwbem
 
69
        then
 
70
                AC_MSG_ERROR([[please define the CIMSERVER variable (see ./configure --help)]])
 
71
        fi
 
72
        
 
73
        if test "$CIMSERVER" == pegasus
 
74
        then
 
75
                if !( command -v cimmof > /dev/null )
 
76
                then
 
77
                        AC_MSG_ERROR([[no. the Pegasus mof compiler could not be found (cimmof)]])
 
78
                fi
 
79
        fi
 
80
        
 
81
        if test "$CIMSERVER" == openwbem
 
82
        then
 
83
                if !( command -v owmofc > /dev/null)
 
84
                then
 
85
                        AC_MSG_ERROR([[no. the OpenWBEM mof compiler could not be found (owmofc)]])
 
86
                fi
 
87
        fi
 
88
        
 
89
        if test "$CIMSERVER" == sfcb
 
90
        then
 
91
                if !( command -v sfcbd > /dev/null )
 
92
                then
 
93
                        AC_MSG_ERROR([[no. the SBLIM sfcb deamon could not be found (sfcbd)]])
 
94
                fi
 
95
                if !( command -v sfcbstage > /dev/null )
 
96
                then
 
97
                        AC_MSG_ERROR([[no. the SBLIM mof stager could not be found (sfcbstage)]])
 
98
                fi
 
99
                if !( command -v sfcbrepos > /dev/null )
 
100
                then
 
101
                        AC_MSG_ERROR([[no. the SBLIM repository builder could no be found (sfcbrepos)]])
 
102
                fi
 
103
        fi
 
104
        
 
105
        if test "$CIMSERVER" == pegasus
 
106
        then
 
107
                if test x"$prefix" == xNONE
 
108
                then
 
109
                        if test "$HW" == X86_64 || test "$HW" == IA64
 
110
                        then
 
111
                                PROVIDERDIR_TMP=/usr/lib64/Pegasus/providers
 
112
                                COMMONLIBDIR_TMP=/usr/lib64
 
113
                                OPENDRIMCOMMONLIBDIR_TMP=/usr/lib64
 
114
                        else
 
115
                                PROVIDERDIR_TMP=/usr/lib/Pegasus/providers
 
116
                                COMMONLIBDIR_TMP=/usr/lib
 
117
                                OPENDRIMCOMMONLIBDIR_TMP=/usr/lib
 
118
                        fi
 
119
                        OPENDRIMCOMMONINCLUDE_TMP=/usr/include/OpenDRIM
 
120
                else
 
121
                        if test "$HW" == X86_64 || test "$HW" == IA64
 
122
                        then
 
123
                                PROVIDERDIR_TMP=$prefix/lib64/Pegasus/providers
 
124
                                COMMONLIBDIR_TMP=$prefix/lib64
 
125
                                OPENDRIMCOMMONLIBDIR_TMP=$prefix/lib64
 
126
                        else
 
127
                                PROVIDERDIR_TMP=$prefix/lib/Pegasus/providers
 
128
                                COMMONLIBDIR_TMP=$prefix/lib
 
129
                                OPENDRIMCOMMONLIBDIR_TMP=$prefix/lib
 
130
                        fi
 
131
                        OPENDRIMCOMMONINCLUDE_TMP=$prefix/include/OpenDRIM
 
132
                fi
 
133
 
 
134
                if test x"$PEGASUS_HOME" != x
 
135
                then
 
136
                        PROVIDERDIR_TMP=$PEGASUS_HOME/lib
 
137
                        COMMONLIBDIR_TMP=$PEGASUS_HOME/lib
 
138
                        OPENDRIMCOMMONLIBDIR_TMP=$PEGASUS_HOME/lib
 
139
                        OPENDRIMCOMMONINCLUDE_TMP=$PEGASUS_HOME/include/OpenDRIM
 
140
                fi
 
141
        fi
 
142
        
 
143
        if test "$CIMSERVER" == sfcb
 
144
        then
 
145
                if test x"$prefix" == xNONE
 
146
                then
 
147
                        PROVIDERDIR_TMP=$ac_default_prefix/lib/cmpi
 
148
                        COMMONLIBDIR_TMP=$ac_default_prefix/lib
 
149
                        OPENDRIMCOMMONLIBDIR_TMP=$ac_default_prefix/lib
 
150
                        OPENDRIMCOMMONINCLUDE_TMP=$ac_default_prefix/include/OpenDRIM
 
151
                else
 
152
                        PROVIDERDIR_TMP=$prefix/lib/cmpi
 
153
                        COMMONLIBDIR_TMP=$prefix/lib
 
154
                        OPENDRIMCOMMONLIBDIR_TMP=$prefix/lib
 
155
                        OPENDRIMCOMMONINCLUDE_TMP=$prefix/include/OpenDRIM
 
156
                fi
 
157
        fi
 
158
        
 
159
        if test "$CIMSERVER" == openwbem
 
160
        then
 
161
                if test x"$prefix" == xNONE
 
162
                then
 
163
                        if test "$HW" == X86_64 || test "$HW" == IA64
 
164
                        then
 
165
                                PROVIDERDIR_TMP=/usr/lib64/openwbem/cmpiproviders
 
166
                                COMMONLIBDIR_TMP=/usr/lib64
 
167
                                OPENDRIMCOMMONLIBDIR_TMP=/usr/lib64
 
168
                        else
 
169
                                PROVIDERDIR_TMP=/usr/lib/openwbem/cmpiproviders
 
170
                                COMMONLIBDIR_TMP=/usr/lib
 
171
                                OPENDRIMCOMMONLIBDIR_TMP=/usr/lib
 
172
                        fi
 
173
                        OPENDRIMCOMMONINCLUDE_TMP=/usr/include/OpenDRIM
 
174
                else
 
175
                        PROVIDERDIR_TMP=$prefix/lib/openwbem/cmpiproviders
 
176
                        COMMONLIBDIR_TMP=$prefix/lib
 
177
                        OPENDRIMCOMMONLIBDIR_TMP=$prefix/lib
 
178
                        OPENDRIMCOMMONINCLUDE_TMP=$prefix/include/OpenDRIM
 
179
                fi
 
180
        fi
 
181
        
 
182
        if test x"$PROVIDERDIR" = x
 
183
        then
 
184
                PROVIDERDIR=$PROVIDERDIR_TMP
 
185
        fi
 
186
 
 
187
        if test x"$COMMONLIBDIR" = x
 
188
        then
 
189
                COMMONLIBDIR=$COMMONLIBDIR_TMP
 
190
        fi
 
191
 
 
192
        if test x"$OPENDRIMCOMMONLIBDIR" = x
 
193
        then
 
194
                OPENDRIMCOMMONLIBDIR=$OPENDRIMCOMMONLIBDIR_TMP
 
195
        fi
 
196
 
 
197
        if test x"$OPENDRIMCOMMONINCLUDE" = x
 
198
        then
 
199
                OPENDRIMCOMMONINCLUDE=$OPENDRIMCOMMONINCLUDE_TMP
 
200
        fi
 
201
        
 
202
        TEMP_CPPFLAGS="$CPPFLAGS -D_REENTRANT"
 
203
        CFLAGS="-Wall -Wunused -fPIC -O2 $CFLAGS"
 
204
        CXXFLAGS="-Wall -Wunused -fPIC -fno-rtti -fno-exceptions -O2 $CXXFLAGS"
 
205
        LDFLAGS="$LDFLAGS -L. -L$PROVIDERDIR -L$COMMONLIBDIR"
 
206
        
 
207
        AC_MSG_RESULT(yes)
 
208
        ]
 
209
)
 
210
 
 
211
AC_DEFUN([CHECK_CIMNAMESPACE],
 
212
        [
 
213
        if test x"$CIMNAMESPACE" == x
 
214
        then
 
215
                CIMNAMESPACE=root/cimv2
 
216
        fi
 
217
        TEMP_CPPFLAGS="$TEMP_CPPFLAGS -D_NAMESPACE=\\\"$CIMNAMESPACE\\\""
 
218
        ]       
 
219
)
 
220
 
 
221
AC_DEFUN([CHECK_INTEROPNAMESPACE],
 
222
        [
 
223
        if test x"$INTEROPNAMESPACE" == x
 
224
        then
 
225
                if test "$CIMSERVER" == pegasus
 
226
                then
 
227
                        INTEROPNAMESPACE=Interop
 
228
                fi
 
229
                if test "$CIMSERVER" == openwbem
 
230
                then
 
231
                        INTEROPNAMESPACE=root/Interop
 
232
                fi
 
233
                if test "$CIMSERVER" == sfcb
 
234
                then
 
235
                        INTEROPNAMESPACE=Interop
 
236
                fi
 
237
        fi
 
238
        TEMP_CPPFLAGS="$TEMP_CPPFLAGS -D_INTEROP_NAMESPACE=\\\"$INTEROPNAMESPACE\\\""
 
239
        ]       
 
240
)
 
241
 
 
242
AC_DEFUN([CHECK_OPENDRIMCOMMONHEADERS],
 
243
        [
 
244
        AC_MSG_CHECKING(for OpenDRIM Common headers)
 
245
        _HEADERS="Common.h Datastore.h CMPIBroking.h Association.h Indication.h Instance.h Objectpath.h Transtype.h"
 
246
        for _HEADER in $_HEADERS
 
247
        do
 
248
                if !( test -e $OPENDRIMCOMMONINCLUDE/$_HEADER )
 
249
                then
 
250
                        AC_MSG_ERROR([[no. Could not find OpenDRIM Common headers:] $_HEADER])
 
251
                fi
 
252
        done
 
253
        AC_MSG_RESULT(yes)
 
254
        ]
 
255
)
 
256
 
 
257
AC_DEFUN([CHECK_OPENDRIMCOMMONLIBRARY],
 
258
        [
 
259
        AC_MSG_CHECKING(for OpenDRIM Common library)
 
260
 
 
261
        if test -e $OPENDRIMCOMMONLIBDIR/libopendrim.so
 
262
        then
 
263
                AC_MSG_RESULT(yes)
 
264
        else
 
265
                AC_MSG_ERROR([[no. The OpenDRIM Common library could not be found (libopendrim.so)]])
 
266
        fi
 
267
        ]
 
268
)
 
269
 
 
270
AC_DEFUN([_CHECK_CMPIHEADERS],
 
271
        [
 
272
        AC_MSG_CHECKING($1)
 
273
        AC_TRY_LINK(
 
274
        [
 
275
                #include <cmpimacs.h>
 
276
                #include <cmpidt.h>
 
277
                #include <cmpift.h>
 
278
        ],
 
279
        [
 
280
                CMPIBroker broker;
 
281
                CMPIStatus status = {CMPI_RC_OK, NULL};
 
282
                CMPIString *s = CMNewString(&broker, "TEST", &status);
 
283
        ],
 
284
        [
 
285
                have_CMPI=yes
 
286
        ],
 
287
        [
 
288
                have_CMPI=no
 
289
        ])
 
290
 
 
291
])
 
292
 
 
293
AC_DEFUN([CHECK_CMPIHEADERS],
 
294
        [
 
295
        AC_MSG_CHECKING(for CMPI headers)
 
296
        
 
297
        CPPFLAGS="$TEMP_CPPFLAGS -DCMPI_PLATFORM_LINUX_GENERIC_GNU -I$OPENDRIMCOMMONINCLUDE/cmpi"
 
298
        _CHECK_CMPIHEADERS($OPENDRIMCOMMONINCLUDE)
 
299
        if test "$have_CMPI" == "yes"
 
300
        then
 
301
                CPPFLAGS="$TEMP_CPPFLAGS"
 
302
                AC_MSG_RESULT(yes)
 
303
        else
 
304
                _CHECK_CMPIHEADERS(standard)
 
305
                if test "$have_CMPI" == "yes"
 
306
                then
 
307
                        CPPFLAGS="$TEMP_CPPFLAGS"
 
308
                        AC_MSG_RESULT(yes)
 
309
                fi
 
310
        fi
 
311
        
 
312
        if test "$have_CMPI" == "no"
 
313
        then
 
314
                AC_MSG_ERROR([[no. The CMPI headers could not be found (cmpidt.h, cmpimacs.h, cmpift.h)]])
 
315
        fi
 
316
 
 
317
        ]
 
318
)