Import from 1.9a8 tarball
[mozilla-nss.git] / security / coreconf / OS2.mk
blob507ebd1ae098c2dd155da448eb79b23d3111516b
2 # ***** BEGIN LICENSE BLOCK *****
3 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 # The contents of this file are subject to the Mozilla Public License Version
6 # 1.1 (the "License"); you may not use this file except in compliance with
7 # the License. You may obtain a copy of the License at
8 # http://www.mozilla.org/MPL/
10 # Software distributed under the License is distributed on an "AS IS" basis,
11 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 # for the specific language governing rights and limitations under the
13 # License.
15 # The Original Code is the Netscape security libraries.
17 # The Initial Developer of the Original Code is
18 # Netscape Communications Corporation.
19 # Portions created by the Initial Developer are Copyright (C) 1994-2000
20 # the Initial Developer. All Rights Reserved.
22 # Contributor(s):
24 # Alternatively, the contents of this file may be used under the terms of
25 # either the GNU General Public License Version 2 or later (the "GPL"), or
26 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 # in which case the provisions of the GPL or the LGPL are applicable instead
28 # of those above. If you wish to allow use of your version of this file only
29 # under the terms of either the GPL or the LGPL, and not to allow others to
30 # use your version of this file under the terms of the MPL, indicate your
31 # decision by deleting the provisions above and replace them with the notice
32 # and other provisions required by the GPL or the LGPL. If you do not delete
33 # the provisions above, a recipient may use your version of this file under
34 # the terms of any one of the MPL, the GPL or the LGPL.
36 # ***** END LICENSE BLOCK *****
38 MOZ_WIDGET_TOOLKIT = os2
40 # Specify toolset. Default to EMX.
41 ifeq ($(MOZ_OS2_TOOLS),VACPP)
42 XP_OS2_VACPP = 1
43 else
44 ifeq ($(MOZ_OS2_TOOLS),PGCC)
45 XP_OS2_EMX = 1
46 else
47 MOZ_OS2_TOOLS = EMX
48 XP_OS2_EMX = 1
49 endif
50 endif
52 # XP_PC is for Window and OS2 on Intel X86
53 # XP_OS2 is strictly for OS2 only
54 XP_DEFINE += -DXP_PC=1 -DXP_OS2=1
56 # Override prefix
57 LIB_PREFIX = $(NULL)
59 # Override suffix in suffix.mk
60 LIB_SUFFIX = lib
61 # the DLL_SUFFIX must be uppercase for FIPS mode to work. bugzilla 240784
62 DLL_SUFFIX = DLL
63 PROG_SUFFIX = .exe
66 ifdef XP_OS2_EMX
68 CCC = gcc
69 LINK = gcc
70 AR = emxomfar r $@
71 # Keep AR_FLAGS blank so that we do not have to change rules.mk
72 AR_FLAGS =
73 RANLIB = @echo OS2 RANLIB
74 BSDECHO = @echo OS2 BSDECHO
75 IMPLIB = emximp -o
76 FILTER = emxexp -o
78 # GCC for OS/2 currently predefines these, but we don't want them
79 DEFINES += -Uunix -U__unix -U__unix__
81 DEFINES += -DXP_OS2_EMX -DTCPV40HDRS
83 ifeq ($(MOZ_OS2_HIGH_MEMORY),1)
84 HIGHMEM_LDFLAG = -Zhigh-mem
85 endif
87 ifndef NO_SHARED_LIB
88 WRAP_MALLOC_LIB =
89 WRAP_MALLOC_CFLAGS =
90 DSO_CFLAGS =
91 DSO_PIC_CFLAGS =
92 MKSHLIB = $(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -o $@
93 MKCSHLIB = $(CC) $(CFLAGS) $(DSO_LDOPTS) -o $@
94 MKSHLIB_FORCE_ALL =
95 MKSHLIB_UNFORCE_ALL =
96 DSO_LDOPTS = -Zomf -Zdll -Zmap $(HIGHMEM_LDFLAG)
97 SHLIB_LDSTARTFILE =
98 SHLIB_LDENDFILE =
99 ifdef MAPFILE
100 MKSHLIB += $(MAPFILE)
101 endif
102 PROCESS_MAP_FILE = \
103 echo LIBRARY $(LIBRARY_NAME)$(LIBRARY_VERSION) INITINSTANCE TERMINSTANCE > $@; \
104 echo PROTMODE >> $@; \
105 echo CODE LOADONCALL MOVEABLE DISCARDABLE >> $@; \
106 echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $@; \
107 echo EXPORTS >> $@; \
108 grep -v ';+' $< | grep -v ';-' | \
109 sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' -e 's,\([\t ]*\),\1_,' | \
110 awk 'BEGIN {ord=1;} { print($$0 " @" ord " RESIDENTNAME"); ord++;}' >> $@
112 endif #NO_SHARED_LIB
114 OS_CFLAGS = -Wall -W -Wno-unused -Wpointer-arith -Wcast-align -Zomf -DDEBUG -DTRACING -g
116 ifdef BUILD_OPT
117 OPTIMIZER = -O2 -s
118 DEFINES += -UDEBUG -U_DEBUG -DNDEBUG
119 DLLFLAGS = -DLL -OUT:$@ -MAP:$(@:.dll=.map) $(HIGHMEM_LDFLAG)
120 EXEFLAGS = -PMTYPE:VIO -OUT:$@ -MAP:$(@:.exe=.map) -nologo -NOE $(HIGHMEM_LDFLAG)
121 OBJDIR_TAG = _OPT
122 else
123 #OPTIMIZER = -O+ -Oi
124 DEFINES += -DDEBUG -D_DEBUG -DDEBUGPRINTS #HCT Need += to avoid overidding manifest.mn
125 DLLFLAGS = -DEBUG -DLL -OUT:$@ -MAP:$(@:.dll=.map) $(HIGHMEM_LDFLAG)
126 EXEFLAGS = -DEBUG -PMTYPE:VIO -OUT:$@ -MAP:$(@:.exe=.map) -nologo -NOE $(HIGHMEM_LDFLAG)
127 OBJDIR_TAG = _DBG
128 LDFLAGS = -DEBUG $(HIGHMEM_LDFLAG)
129 endif # BUILD_OPT
131 else # XP_OS2_VACPP
133 # Override suffix in suffix.mk
134 OBJ_SUFFIX = .obj
135 ASM_SUFFIX = .asm
137 AS = alp.exe
138 ifdef BUILD_OPT
139 ASFLAGS = -Od
140 else
141 ASFLAGS = +Od
142 endif
143 CCC = icc -q -DXP_OS2 -DOS2=4 -N10
144 LINK = -ilink
145 AR = -ilib /NOL /NOI /O:$(subst /,\\,$@)
146 # Keep AR_FLAGS blank so that we do not have to change rules.mk
147 AR_FLAGS =
148 RANLIB = @echo OS2 RANLIB
149 BSDECHO = @echo OS2 BSDECHO
150 IMPLIB = implib /NOL /NOI
151 FILTER = cppfilt -b -p -q
153 ifndef NO_SHARED_LIB
154 WRAP_MALLOC_LIB =
155 WRAP_MALLOC_CFLAGS =
156 DSO_CFLAGS =
157 DSO_PIC_CFLAGS =
158 MKSHLIB = $(LD) $(DSO_LDOPTS)
159 MKCSHLIB = $(LD) $(DSO_LDOPTS)
160 MKSHLIB_FORCE_ALL =
161 MKSHLIB_UNFORCE_ALL =
162 DSO_LDOPTS =
163 # DLL_SUFFIX = .dll
164 SHLIB_LDSTARTFILE =
165 SHLIB_LDENDFILE =
166 ifdef MAPFILE
167 MKSHLIB += $(MAPFILE)
168 endif
169 PROCESS_MAP_FILE = \
170 echo LIBRARY $(LIBRARY_NAME)$(LIBRARY_VERSION) INITINSTANCE TERMINSTANCE > $@; \
171 echo PROTMODE >> $@; \
172 echo CODE LOADONCALL MOVEABLE DISCARDABLE >> $@; \
173 echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $@; \
174 echo EXPORTS >> $@; \
175 grep -v ';+' $< | grep -v ';-' | \
176 sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' >> $@
177 endif #NO_SHARED_LIB
179 OS_CFLAGS = /Q /qlibansi /Gd /Gm /Su4 /Mp /Tl-
180 INCLUDES += -I$(CORE_DEPTH)/../dist/include
181 DEFINES += -DXP_OS2_VACPP -DTCPV40HDRS
183 DLLFLAGS = /DLL /O:$@ /INC:_dllentry /MAP:$(@:.dll=.map)
184 EXEFLAGS = -PMTYPE:VIO -OUT:$@ -MAP:$(@:.exe=.map) -nologo -NOE
185 LDFLAGS = /FREE /NOE /LINENUMBERS /nologo
187 ifdef BUILD_OPT
188 OPTIMIZER = /O+ /Gl+ /G5 /qarch=pentium
189 DEFINES += -UDEBUG -U_DEBUG -DNDEBUG
190 OBJDIR_TAG = _OPT
191 LDFLAGS += /NODEBUG /OPTFUNC /EXEPACK:2 /PACKCODE /PACKDATA
192 else
193 OS_CFLAGS += /Ti+
194 DEFINES += -DDEBUG -D_DEBUG -DDEBUGPRINTS #HCT Need += to avoid overidding manifest.mn
195 DLLFLAGS += /DE
196 EXEFLAGS += /DE
197 OBJDIR_TAG = _DBG
198 LDFLAGS += /DE
199 endif # BUILD_OPT
201 endif # XP_OS2_VACPP
203 # OS/2 use nsinstall that is included in the toolkit.
204 # since we do not wish to support and maintain 3 version of nsinstall in mozilla, nspr and nss
206 ifdef BUILD_TREE
207 NSINSTALL_DIR = $(BUILD_TREE)/nss
208 else
209 NSINSTALL_DIR = $(CORE_DEPTH)/coreconf/nsinstall
210 endif
211 # NSINSTALL = $(NSINSTALL_DIR)/$(OBJDIR_NAME)/nsinstall
212 NSINSTALL = nsinstall # HCT4OS2
213 INSTALL = $(NSINSTALL)
215 MKDEPEND_DIR = $(CORE_DEPTH)/coreconf/mkdepend
216 MKDEPEND = $(MKDEPEND_DIR)/$(OBJDIR_NAME)/mkdepend
217 MKDEPENDENCIES = $(OBJDIR_NAME)/depend.mk
219 ####################################################################
221 # One can define the makefile variable NSDISTMODE to control
222 # how files are published to the 'dist' directory. If not
223 # defined, the default is "install using relative symbolic
224 # links". The two possible values are "copy", which copies files
225 # but preserves source mtime, and "absolute_symlink", which
226 # installs using absolute symbolic links.
227 # - THIS IS NOT PART OF THE NEW BINARY RELEASE PLAN for 9/30/97
228 # - WE'RE KEEPING IT ONLY FOR BACKWARDS COMPATIBILITY
229 ####################################################################
231 ifeq ($(NSDISTMODE),copy)
232 # copy files, but preserve source mtime
233 INSTALL = $(NSINSTALL)
234 INSTALL += -t
235 else
236 ifeq ($(NSDISTMODE),absolute_symlink)
237 # install using absolute symbolic links
238 INSTALL = $(NSINSTALL)
239 INSTALL += -L `pwd`
240 else
241 # install using relative symbolic links
242 INSTALL = $(NSINSTALL)
243 INSTALL += -R
244 endif
245 endif
247 define MAKE_OBJDIR
248 if test ! -d $(@D); then rm -rf $(@D); $(NSINSTALL) -D $(@D); fi
249 endef
252 # override the definition of DLL_PREFIX in prefix.mk
255 ifndef DLL_PREFIX
256 DLL_PREFIX = $(NULL)
257 endif
260 # override the TARGETS defined in ruleset.mk, adding IMPORT_LIBRARY
262 ifndef TARGETS
263 TARGETS = $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY) $(PROGRAM)
264 endif
267 ifdef LIBRARY_NAME
268 IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)$(JDK_DEBUG_SUFFIX).lib
269 endif