BUG#: 8353
[tpot/pegasus/.git] / src / Pegasus / Common / Makefile
1 #//%LICENSE////////////////////////////////////////////////////////////////
2 #//
3 #// Licensed to The Open Group (TOG) under one or more contributor license
4 #// agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
5 #// this work for additional information regarding copyright ownership.
6 #// Each contributor licenses this file to you under the OpenPegasus Open
7 #// Source License; you may not use this file except in compliance with the
8 #// License.
9 #//
10 #// Permission is hereby granted, free of charge, to any person obtaining a
11 #// copy of this software and associated documentation files (the "Software"),
12 #// to deal in the Software without restriction, including without limitation
13 #// the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 #// and/or sell copies of the Software, and to permit persons to whom the
15 #// Software is furnished to do so, subject to the following conditions:
16 #//
17 #// The above copyright notice and this permission notice shall be included
18 #// in all copies or substantial portions of the Software.
19 #//
20 #// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 #// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 #// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 #// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 #// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 #// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 #// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 #//
28 #//////////////////////////////////////////////////////////////////////////
29 ROOT = ../../..
30
31 DIR = Pegasus/Common
32
33 HAS_PAM_DEPENDENCY=true
34 HAS_ICU_DEPENDENCY=true
35
36 include $(ROOT)/mak/config.mak
37
38 ifdef PEGASUS_HAS_SSL
39     ifdef OPENSSL_HOME
40         SYS_INCLUDES += -I$(OPENSSL_HOME)/include
41     endif
42 endif
43
44 LOCAL_DEFINES = -DPEGASUS_COMMON_INTERNAL -DPEGASUS_INTERNALONLY
45
46 ifeq ($(OS_TYPE),vms)
47     STATIC=1
48 endif
49
50 LIBRARY = pegcommon
51
52 ifeq ($(PEGASUS_PLATFORM),PASE_ISERIES_IBMCXX)
53     LIBRARIES = ILEWrapperUtils
54 endif
55
56 ##
57 ## CAUTION: the source files are divided evenly (more or less) between SOURCES1
58 ## and SOURCES2. This avoids a command line buffer overflow on Windows 2000
59 ## (see bug #2754 for details). As a precaution, limit SOURCES1 and SOURCES2
60 ## to 75 source files each.
61 ##
62
63 SOURCES1 = \
64     Print.cpp \
65     Executor.cpp \
66     CIMError.cpp \
67     PropertyAccessor.cpp \
68     Once.cpp \
69     Time.cpp \
70     Threads.cpp \
71     TSDKey.cpp \
72     Semaphore.cpp \
73     ReadWriteSem.cpp \
74     Condition.cpp \
75     AnonymousPipe.cpp \
76     Array.cpp \
77     AsyncOpNode.cpp \
78     AtomicInt.cpp \
79     AuthenticationInfoRep.cpp \
80     AutoStreamer.cpp \
81     Base64.cpp \
82     BinaryStreamer.cpp \
83     Buffer.cpp \
84     CharSet.cpp \
85     LanguageParser.cpp \
86     AcceptLanguageList.cpp \
87     ContentLanguageList.cpp \
88     LanguageTag.cpp \
89     MessageLoader.cpp \
90     Char16Inline.cpp \
91     CIMClass.cpp \
92     CIMClassRep.cpp \
93     CIMDateTime.cpp \
94     CIMFlavor.cpp \
95     CIMInstance.cpp \
96     CIMInstanceRep.cpp \
97     CIMMessage.cpp \
98     CIMMethod.cpp \
99     CIMMethodRep.cpp \
100     CIMName.cpp \
101     CIMNameInline.cpp \
102     CIMObject.cpp \
103     CIMObjectRep.cpp \
104     CIMObjectPath.cpp \
105     Cimom.cpp \
106     CimomMessage.cpp \
107     CIMParameter.cpp \
108     CIMParameterRep.cpp \
109     CIMParamValue.cpp \
110     CIMParamValueRep.cpp \
111     CIMProperty.cpp \
112     CIMPropertyList.cpp \
113     CIMPropertyRep.cpp \
114     CIMQualifier.cpp \
115     CIMQualifierDecl.cpp \
116     CIMQualifierDeclRep.cpp \
117     CIMQualifierList.cpp \
118     CIMQualifierNames.cpp \
119     CIMQualifierRep.cpp \
120     CIMScope.cpp \
121     CIMStatusCode.cpp \
122     CIMType.cpp \
123     CIMValue.cpp \
124     CIMValueInline.cpp \
125     Config.cpp \
126     DeclContext.cpp \
127     Dir.cpp \
128     List.cpp \
129     AsyncQueue.cpp \
130     IDFactory.cpp \
131     AuditLogger.cpp \
132     Magic.cpp
133
134 SOURCES2 = \
135     DynamicLibrary.cpp \
136     Exception.cpp \
137     InternalException.cpp \
138     FileSystem.cpp \
139     Formatter.cpp \
140     HashTable.cpp \
141     HTTPAcceptor.cpp \
142     HTTPConnection.cpp \
143     HTTPConnector.cpp  \
144     HTTPMessage.cpp \
145     IndicationFormatter.cpp \
146     Logger.cpp \
147     Memory.cpp \
148     Message.cpp \
149     MessageQueue.cpp \
150     MessageQueueService.cpp \
151     ModuleController.cpp \
152     Monitor.cpp \
153     Mutex.cpp \
154     ObjectNormalizer.cpp \
155     OperationContext.cpp \
156     OperationContextInternal.cpp \
157     OptionManager.cpp \
158     Packer.cpp \
159     Pair.cpp \
160     QueryExpressionRep.cpp \
161     Resolver.cpp \
162     ResponseHandler.cpp \
163     ResponseHandlerRep.cpp \
164     Sharable.cpp \
165     Signal.cpp \
166     Socket.cpp \
167     SpinLock.cpp \
168     Stack.cpp \
169     StatisticalData.cpp \
170     Stopwatch.cpp \
171     String.cpp \
172     StringConversion.cpp \
173     StringInline.cpp \
174     System.cpp \
175     TimeValue.cpp \
176     SSLContext.cpp \
177     SSLContextManager.cpp \
178     TLS.cpp \
179     TraceFileHandler.cpp \
180     TraceLogHandler.cpp \
181     TraceMemoryHandler.cpp \
182     Tracer.cpp \
183     Thread.cpp \
184     ThreadPool.cpp \
185     Union.cpp \
186     XmlGenerator.cpp \
187     XmlParser.cpp \
188     XmlReader.cpp \
189     XmlStreamer.cpp \
190     XmlWriter.cpp \
191     MofWriter.cpp \
192     CommonUTF.cpp \
193     Constants.cpp \
194     HostAddress.cpp \
195     HostLocator.cpp \
196     BinaryCodec.cpp
197
198 ifeq ($(PEGASUS_PLATFORM),PASE_ISERIES_IBMCXX)
199     SOURCES2 += PaseCcsid.cpp
200 endif
201
202 SOURCES_SLP = Attribute.cpp \
203     CIMServerDescription.cpp
204
205 ifeq ($(PEGASUS_ENABLE_SLP),true)
206     SOURCES2 += $(SOURCES_SLP)
207 endif
208
209 ifeq ($(PEGASUS_PLATFORM),HPUX_PARISC_ACC)
210     SOURCES2 += LoadAndClearWord_HPUX_PARISC_ACC.s
211 endif
212
213 ifeq ($(PEGASUS_ENABLE_PROTOCOL_INTERNAL_BINARY),true)
214     SOURCES2 += CIMBuffer.cpp
215     SOURCES2 += CIMBinMsgSerializer.cpp
216     SOURCES2 += CIMBinMsgDeserializer.cpp
217 else
218     SOURCES2 += CIMMessageSerializer.cpp
219     SOURCES2 += CIMMessageDeserializer.cpp
220 endif
221
222 SOURCES = $(SOURCES1) $(SOURCES2)
223
224 ifdef PEGASUS_HAS_SSL
225     ifeq ($(OS_TYPE),windows)
226         SYS_LIBS += /libpath:$(OPENSSL_HOME)/lib libeay32.lib ssleay32.lib
227     else
228         ifeq ($(OS_TYPE), vms)
229             EXTRA_LIBRARIES += -L$(OPENSSL_LIB) \
230                 -lssl$$libssl_shr32 -lssl$$libcrypto_shr32
231         else
232             ifdef OPENSSL_HOME
233                 EXTRA_LIBRARIES += -L$(OPENSSL_HOME)/lib
234             endif
235             EXTRA_LIBRARIES += -lssl -lcrypto
236         endif
237     endif
238 endif
239
240 ifeq ($(OS_TYPE),vms)
241     ifeq ($(PEGASUS_USE_STATIC_LIBRARIES),false)
242         SYS_LIBS += tcpip$$library:tcpip$$lib/lib
243         LIBRARIES = vms/include=(vms_crtl_init)
244         LINK_OPT1 = COLLECT=crtl_init,lib$$initializdz,lib$$initializd_,
245         LINK_OPT2 = lib$$initialize,lib$$initialize$$
246         LINKER_OPTIONS = $(LINK_OPT1)$(LINK_OPT2)
247     endif
248 endif
249
250 ifeq ($(OS),zos)
251     SOURCES2 += Audit_zOS_SMF.cpp \
252         PegasusAssertZOS.cpp
253 endif
254
255 ifeq ($(PEGASUS_PLATFORM),AIX_RS_IBMCXX)
256     AIX_LIB_PRIORITY=-20
257 endif
258
259 ifeq ($(PEGASUS_PLATFORM),PASE_ISERIES_IBMCXX)
260     AIX_LIB_PRIORITY=-20
261 endif
262
263 # Note that PEGASUS_WINDOWS_SDK_HOME only needs to be specified if using VC6.
264 ifeq ($(OS_TYPE),windows)
265     SYS_LIBS += ws2_32.lib advapi32.lib netapi32.lib
266     ifdef PEGASUS_WINDOWS_SDK_HOME
267         FLAGS += -DPEGASUS_WINDOWS_SDK_HOME
268         SYS_LIBS += /libpath:$(PEGASUS_WINDOWS_SDK_HOME)/lib secur32.lib
269     else
270         ifneq ($(CL_MAJOR_VERSION), 12)
271             SYS_LIBS += secur32.lib
272         endif
273     endif
274 endif
275
276 include $(ROOT)/mak/dynamic-library.mak
277 # DO NOT DELETE