Bug 622328 - Fixup widget's UpdateTransparentRegion now that layout's transparent...
[mozilla-central.git] / security / coreconf / Linux.mk
blobcaf05a8657e57f9f186048cc9edc8fefd88cefcd
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 include $(CORE_DEPTH)/coreconf/UNIX.mk
41 # The default implementation strategy for Linux is now pthreads
43 USE_PTHREADS = 1
45 ifeq ($(USE_PTHREADS),1)
46 IMPL_STRATEGY = _PTH
47 endif
49 CC = gcc
50 CCC = g++
51 RANLIB = ranlib
53 DEFAULT_COMPILER = gcc
55 ifeq ($(OS_TEST),ppc64)
56 CPU_ARCH = ppc
57 ifeq ($(USE_64),1)
58 ARCHFLAG = -m64
59 endif
60 else
61 ifeq ($(OS_TEST),alpha)
62 OS_REL_CFLAGS = -D_ALPHA_
63 CPU_ARCH = alpha
64 else
65 ifeq ($(OS_TEST),x86_64)
66 ifeq ($(USE_64),1)
67 CPU_ARCH = x86_64
68 else
69 OS_REL_CFLAGS = -Di386
70 CPU_ARCH = x86
71 ARCHFLAG = -m32
72 endif
73 else
74 ifeq ($(OS_TEST),sparc64)
75 CPU_ARCH = sparc
76 else
77 ifeq (,$(filter-out arm% sa110,$(OS_TEST)))
78 CPU_ARCH = arm
79 else
80 ifeq (,$(filter-out parisc%,$(OS_TEST)))
81 CPU_ARCH = hppa
82 else
83 ifeq (,$(filter-out i%86,$(OS_TEST)))
84 OS_REL_CFLAGS = -Di386
85 CPU_ARCH = x86
86 else
87 ifeq ($(OS_TEST),sh4a)
88 CPU_ARCH = sh4
89 else
90 # $(OS_TEST) == m68k, ppc, ia64, sparc, s390, s390x, mips, sh3, sh4
91 CPU_ARCH = $(OS_TEST)
92 endif
93 endif
94 endif
95 endif
96 endif
97 endif
98 endif
99 endif
102 LIBC_TAG = _glibc
104 ifeq ($(OS_RELEASE),2.0)
105 OS_REL_CFLAGS += -DLINUX2_0
106 MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH)
107 ifdef MAPFILE
108 MKSHLIB += -Wl,--version-script,$(MAPFILE)
109 endif
110 PROCESS_MAP_FILE = grep -v ';-' $< | \
111 sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
112 endif
114 ifdef BUILD_OPT
115 ifeq (11,$(ALLOW_OPT_CODE_SIZE)$(OPT_CODE_SIZE))
116 OPTIMIZER = -Os
117 else
118 OPTIMIZER = -O2
119 endif
120 ifdef MOZ_DEBUG_SYMBOLS
121 ifdef MOZ_DEBUG_FLAGS
122 OPTIMIZER += $(MOZ_DEBUG_FLAGS)
123 else
124 OPTIMIZER += -gdwarf-2
125 endif
126 endif
127 endif
130 ifeq ($(USE_PTHREADS),1)
131 OS_PTHREAD = -lpthread
132 endif
134 # See bug 537829, in particular comment 23.
135 # Place -ansi and *_SOURCE before $(DSO_CFLAGS) so DSO_CFLAGS can override
136 # -ansi on platforms like Android where the system headers are C99 and do
137 # not build with -ansi.
138 STANDARDS_CFLAGS = -ansi -D_POSIX_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE
139 OS_CFLAGS = $(STANDARDS_CFLAGS) $(DSO_CFLAGS) $(OS_REL_CFLAGS) $(ARCHFLAG) -Wall -Werror-implicit-function-declaration -Wno-switch -pipe -DLINUX -Dlinux -DHAVE_STRERROR
140 OS_LIBS = $(OS_PTHREAD) -ldl -lc
142 ifdef USE_PTHREADS
143 DEFINES += -D_REENTRANT
144 endif
146 ARCH = linux
148 DSO_CFLAGS = -fPIC
149 DSO_LDOPTS = -shared $(ARCHFLAG)
150 # The linker on Red Hat Linux 7.2 and RHEL 2.1 (GNU ld version 2.11.90.0.8)
151 # incorrectly reports undefined references in the libraries we link with, so
152 # we don't use -z defs there.
153 ZDEFS_FLAG = -Wl,-z,defs
154 DSO_LDOPTS += $(if $(findstring 2.11.90.0.8,$(shell ld -v)),,$(ZDEFS_FLAG))
155 LDFLAGS += $(ARCHFLAG)
157 # On Maemo, we need to use the -rpath-link flag for even the standard system
158 # library directories.
159 ifdef _SBOX_DIR
160 LDFLAGS += -Wl,-rpath-link,/usr/lib:/lib
161 endif
163 # INCLUDES += -I/usr/include -Y/usr/include/linux
164 G++INCLUDES = -I/usr/include/g++
167 # Always set CPU_TAG on Linux, WINCE.
169 CPU_TAG = _$(CPU_ARCH)
172 # On Linux 2.6 or later, build libfreebl3.so with no NSPR and libnssutil3.so
173 # dependencies by default. Set FREEBL_NO_DEPEND to 0 in the environment to
174 # override this.
176 ifeq (2.6,$(firstword $(sort 2.6 $(OS_RELEASE))))
177 ifndef FREEBL_NO_DEPEND
178 FREEBL_NO_DEPEND = 1
179 endif
180 endif
182 USE_SYSTEM_ZLIB = 1
183 ZLIB_LIBS = -lz
185 # The -rpath '$$ORIGIN' linker option instructs this library to search for its
186 # dependencies in the same directory where it resides.
187 ifeq ($(BUILD_SUN_PKG), 1)
188 ifeq ($(USE_64), 1)
189 RPATH = -Wl,-rpath,'$$ORIGIN:/opt/sun/private/lib64:/opt/sun/private/lib'
190 else
191 RPATH = -Wl,-rpath,'$$ORIGIN:/opt/sun/private/lib'
192 endif
193 endif