Include a bugfix for GCC 4.4
[fedora-mingw.git] / nss / Cross.mk
1 # https://bugzilla.mozilla.org/show_bug.cgi?id=104541#c2
2
3 #
4 # ***** BEGIN LICENSE BLOCK *****
5 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 #
7 # The contents of this file are subject to the Mozilla Public License Version
8 # 1.1 (the "License"); you may not use this file except in compliance with
9 # the License. You may obtain a copy of the License at
10 # http://www.mozilla.org/MPL/
11 #
12 # Software distributed under the License is distributed on an "AS IS" basis,
13 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
14 # for the specific language governing rights and limitations under the
15 # License.
16 #
17 # The Original Code is the Netscape security libraries.
18 #
19 # The Initial Developer of the Original Code is
20 # Netscape Communications Corporation.
21 # Portions created by the Initial Developer are Copyright (C) 1994-2000
22 # the Initial Developer. All Rights Reserved.
23 #
24 # Contributor(s):
25 #
26 # Alternatively, the contents of this file may be used under the terms of
27 # either the GNU General Public License Version 2 or later (the "GPL"), or
28 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 # in which case the provisions of the GPL or the LGPL are applicable instead
30 # of those above. If you wish to allow use of your version of this file only
31 # under the terms of either the GPL or the LGPL, and not to allow others to
32 # use your version of this file under the terms of the MPL, indicate your
33 # decision by deleting the provisions above and replace them with the notice
34 # and other provisions required by the GPL or the LGPL. If you do not delete
35 # the provisions above, a recipient may use your version of this file under
36 # the terms of any one of the MPL, the GPL or the LGPL.
37 #
38 # ***** END LICENSE BLOCK *****
39
40 CC           = i686-pc-mingw32-gcc
41 CCC          = i686-pc-mingw32-g++
42 LINK         = i686-pc-mingw32-ld
43 AR           = i686-pc-mingw32-ar
44 AR          += cr $@
45 RANLIB       = i686-pc-mingw32-ranlib
46 BSDECHO      = echo
47 RC           = i686-pc-mingw32-windres -O coff --use-temp-file
48 LINK_DLL      = $(CC) $(OS_DLLFLAGS) $(DLLFLAGS)
49
50 XP_DEFINE  += -DXP_PC
51 LIB_SUFFIX  = a
52 DLL_SUFFIX  = dll
53 AR          = ar cr $@
54 LDOPTS     += -L$(SOURCE_LIB_DIR)
55
56 OPTIMIZER  += -O
57 DEFINES    += -UDEBUG -DNDEBUG
58
59 ifdef BUILD_TREE
60 NSINSTALL_DIR  = $(BUILD_TREE)/nss
61 NSINSTALL      = $(BUILD_TREE)/nss/nsinstall
62 else
63 NSINSTALL_DIR  = $(CORE_DEPTH)/coreconf/nsinstall
64 NSINSTALL      = $(NSINSTALL_DIR)/$(OBJDIR_NAME)/nsinstall
65 endif
66
67 MKDEPEND_DIR    = $(CORE_DEPTH)/coreconf/mkdepend
68 MKDEPEND        = $(MKDEPEND_DIR)/$(OBJDIR_NAME)/mkdepend
69 MKDEPENDENCIES  = $(OBJDIR_NAME)/depend.mk
70
71 ####################################################################
72 #
73 # One can define the makefile variable NSDISTMODE to control
74 # how files are published to the 'dist' directory.  If not
75 # defined, the default is "install using relative symbolic
76 # links".  The two possible values are "copy", which copies files
77 # but preserves source mtime, and "absolute_symlink", which
78 # installs using absolute symbolic links.
79 #   - THIS IS NOT PART OF THE NEW BINARY RELEASE PLAN for 9/30/97
80 #   - WE'RE KEEPING IT ONLY FOR BACKWARDS COMPATIBILITY
81 ####################################################################
82
83 ifeq ($(NSDISTMODE),copy)
84         # copy files, but preserve source mtime
85         INSTALL  = $(NSINSTALL)
86         INSTALL += -t
87 else
88         ifeq ($(NSDISTMODE),absolute_symlink)
89                 # install using absolute symbolic links
90                 INSTALL  = $(NSINSTALL)
91                 INSTALL += -L `pwd`
92         else
93                 # install using relative symbolic links
94                 INSTALL  = $(NSINSTALL)
95                 INSTALL += -R
96         endif
97 endif
98
99 define MAKE_OBJDIR
100 if test ! -d $(@D); then rm -rf $(@D); $(NSINSTALL) -D $(@D); fi
101 endef
102
103
104 # Not for Windows yet.
105 USE_PTHREADS =
106
107 ifeq ($(USE_PTHREADS),1)
108         IMPL_STRATEGY = _PTH
109 endif
110
111 DEFAULT_COMPILER = i686-pc-mingw32-gcc
112
113 CPU_ARCH        = x86
114
115 MKSHLIB         = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
116 ifdef MAPFILE
117         MKSHLIB += -Wl,--version-script,$(MAPFILE)
118 endif
119 PROCESS_MAP_FILE = grep -v ';-' $< | \
120          sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
121
122 ifdef BUILD_OPT
123 ifeq (11,$(ALLOW_OPT_CODE_SIZE)$(OPT_CODE_SIZE))
124         OPTIMIZER = -Os
125 else
126         OPTIMIZER = -O2
127 endif
128 endif
129
130 ifeq ($(USE_PTHREADS),1)
131 OS_PTHREAD = -lpthread 
132 endif
133
134 OS_CFLAGS               = $(DSO_CFLAGS) $(OS_REL_CFLAGS) $(ARCHFLAG) -Wall -Wno-switch -pipe -mms-bitfields -D_WINDOWS
135 OS_LIBS                 = $(OS_PTHREAD)
136
137 ifdef USE_PTHREADS
138         DEFINES         += -D_REENTRANT
139 endif
140
141 ARCH                    = linux
142
143 DSO_CFLAGS              =
144 DSO_LDOPTS              = -shared $(ARCHFLAG) -Wl,-z,defs
145 DSO_LDFLAGS             =
146 LDFLAGS                 += $(ARCHFLAG)
147
148 # INCLUDES += -I/usr/include -Y/usr/include/linux
149 G++INCLUDES             = -I/usr/i686-pc-mingw32/sys-root/mingw/include/g++
150
151 #
152 # Always set CPU_TAG on Linux, OpenVMS, WINCE.
153 #
154 CPU_TAG = _$(CPU_ARCH)
155
156 USE_SYSTEM_ZLIB = 1
157 ZLIB_LIBS = -lz
158
159