~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/js/src/Makefile.in

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- Mode: makefile -*-
 
2
#
 
3
# ***** BEGIN LICENSE BLOCK *****
 
4
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
 
5
#
 
6
# The contents of this file are subject to the Mozilla Public License Version
 
7
# 1.1 (the "License"); you may not use this file except in compliance with
 
8
# the License. You may obtain a copy of the License at
 
9
# http://www.mozilla.org/MPL/
 
10
#
 
11
# Software distributed under the License is distributed on an "AS IS" basis,
 
12
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 
13
# for the specific language governing rights and limitations under the
 
14
# License.
 
15
#
 
16
# The Original Code is Mozilla Communicator client code, released
 
17
# March 31, 1998.
 
18
#
 
19
# The Initial Developer of the Original Code is
 
20
# Netscape Communications Corporation.
 
21
# Portions created by the Initial Developer are Copyright (C) 1998
 
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 of the GNU General Public License Version 2 or later (the "GPL"),
 
28
# or 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
DEPTH           = ../..
 
41
topsrcdir       = @top_srcdir@
 
42
srcdir          = @srcdir@
 
43
VPATH           = @srcdir@
 
44
 
 
45
include $(DEPTH)/config/autoconf.mk
 
46
 
 
47
MODULE          = js
 
48
LIBRARY_NAME    = mozjs
 
49
LIB_IS_C_ONLY   = 1
 
50
GRE_MODULE      = 1
 
51
 
 
52
ifeq ($(OS_ARCH),WINNT)
 
53
LIBRARY_NAME    = js$(MOZ_BITS)$(VERSION_NUMBER)
 
54
RESFILE         = js$(MOZ_BITS)40.res
 
55
endif
 
56
 
 
57
PACKAGE_FILE = js.pkg
 
58
 
 
59
# JavaScript must be built shared, even for static builds, as it is used by
 
60
# other modules which are always built shared. Failure to do so results in
 
61
# the js code getting copied into xpinstall and jsd as well as mozilla-bin,
 
62
# and then the static data cells used for locking no longer work.
 
63
FORCE_SHARED_LIB = 1
 
64
 
 
65
CSRCS           = \
 
66
                jsapi.c \
 
67
                jsarena.c \
 
68
                jsarray.c \
 
69
                jsatom.c \
 
70
                jsbool.c \
 
71
                jscntxt.c \
 
72
                jsdate.c \
 
73
                jsdbgapi.c \
 
74
                jsdhash.c \
 
75
                jsdtoa.c \
 
76
                jsemit.c \
 
77
                jsexn.c \
 
78
                jsfun.c \
 
79
                jsgc.c \
 
80
                jshash.c \
 
81
                jsinterp.c \
 
82
                jslock.c \
 
83
                jslog2.c \
 
84
                jslong.c \
 
85
                jsmath.c \
 
86
                jsnum.c \
 
87
                jsobj.c \
 
88
                jsopcode.c \
 
89
                jsparse.c \
 
90
                jsprf.c \
 
91
                jsregexp.c \
 
92
                jsscan.c \
 
93
                jsscope.c \
 
94
                jsscript.c \
 
95
                jsstr.c \
 
96
                jsutil.c \
 
97
                jsxdrapi.c \
 
98
                prmjtime.c \
 
99
                $(NULL)
 
100
 
 
101
EXPORTS         = \
 
102
                jsautocfg.h \
 
103
                js.msg \
 
104
                jsapi.h \
 
105
                jsarray.h \
 
106
                jsarena.h \
 
107
                jsatom.h \
 
108
                jsbit.h \
 
109
                jsbool.h \
 
110
                jsclist.h \
 
111
                jscntxt.h \
 
112
                jscompat.h \
 
113
                jsconfig.h \
 
114
                jsdate.h \
 
115
                jsdbgapi.h \
 
116
                jsdhash.h \
 
117
                jsemit.h \
 
118
                jsfun.h \
 
119
                jsgc.h \
 
120
                jshash.h \
 
121
                jsinterp.h \
 
122
                jslock.h \
 
123
                jslong.h \
 
124
                jsmath.h \
 
125
                jsnum.h \
 
126
                jsobj.h \
 
127
                jsopcode.tbl \
 
128
                jsopcode.h \
 
129
                jsosdep.h \
 
130
                jsotypes.h \
 
131
                jsparse.h \
 
132
                jsprf.h \
 
133
                jsprvtd.h \
 
134
                jspubtd.h \
 
135
                jsregexp.h \
 
136
                jsscan.h \
 
137
                jsscope.h \
 
138
                jsscript.h \
 
139
                jsstr.h \
 
140
                jstypes.h \
 
141
                jsutil.h \
 
142
                jsxdrapi.h \
 
143
                jsstddef.h \
 
144
                $(NULL)
 
145
 
 
146
ifeq ($(OS_ARCH),WINNT)
 
147
EXPORTS         += jscpucfg.h
 
148
endif
 
149
 
 
150
FDLIBM_LIBRARY  = fdlibm/$(LIB_PREFIX)fdm.$(LIB_SUFFIX)
 
151
JSMATH_PRELINK  = jsmathtemp.o
 
152
JS_SAFE_ARENA   = 1
 
153
 
 
154
DASH_R          = -r
 
155
 
 
156
include $(topsrcdir)/config/config.mk
 
157
 
 
158
EXTRA_DSO_LDOPTS += $(NSPR_LIBS)
 
159
 
 
160
ifeq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
 
161
SHARED_LIBRARY_LIBS += $(FDLIBM_LIBRARY)
 
162
endif
 
163
 
 
164
# When using gcc the assembly is inlined in the C-file (see jslock.c)
 
165
ifeq ($(OS_ARCH),SunOS)
 
166
ifneq ($(OS_TEST),i86pc)
 
167
ifndef GNU_CC
 
168
ASFILES         = lock_$(OS_ARCH).s
 
169
endif
 
170
endif
 
171
endif
 
172
 
 
173
ifndef BUILD_OPT
 
174
MOCHAFILE       = 1
 
175
endif
 
176
 
 
177
ifndef NSBUILDROOT
 
178
JSJAVA_STUBHEADERS = \
 
179
                -I$(topsrcdir)/sun-java/include/_gen \
 
180
                -I$(topsrcdir)/sun-java/netscape/javascript/_jri \
 
181
                -I$(topsrcdir)/sun-java/netscape/security/_jri
 
182
else
 
183
JSJAVA_STUBHEADERS = -I$(JRI_GEN_DIR) -I$(JDK_GEN_DIR)
 
184
endif
 
185
 
 
186
JSJAVA_CFLAGS   = \
 
187
                -I$(topsrcdir)/sun-java/md-include \
 
188
                -I$(topsrcdir)/sun-java/include \
 
189
                $(JSJAVA_STUBHEADERS)
 
190
 
 
191
include $(topsrcdir)/config/rules.mk
 
192
 
 
193
DEFINES         += -DEXPORT_JS_API 
 
194
 
 
195
INCLUDES        += -I$(srcdir)
 
196
 
 
197
# MSVC '-Gy' cc flag and '/OPT:REF' linker flag cause JS_GetArgument and
 
198
# JS_GetLocalVariable to be folded to the same address by the linker, 
 
199
# leading to a crash on startup. See bug 151066. So, in optimized builds,
 
200
# add the /OPT:NOICF flag, which turns off 'identical COMDAT folding'.
 
201
#
 
202
# N.B.: 'identical COMDAT folding' that folds functions whose addresses
 
203
# are taken violates the ISO C and C++ standards.
 
204
ifndef MOZ_DEBUG
 
205
ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
 
206
LDFLAGS         += /OPT:NOICF
 
207
endif
 
208
endif
 
209
 
 
210
GARBAGE         += $(JSMATH_PRELINK) jscpucfg.o jsautocfg.h jsautocfg.tmp jscpucfg
 
211
 
 
212
ifneq (,$(CROSS_COMPILE)$(filter-out WINNT,$(OS_ARCH)))
 
213
TARGETS         += jscpucfg$(HOST_BIN_SUFFIX)
 
214
endif
 
215
 
 
216
ifdef JS_SAFE_ARENA
 
217
DEFINES         += -DJS_USE_SAFE_ARENA
 
218
endif
 
219
 
 
220
ifdef JS_THREADSAFE
 
221
DEFINES         += -DJS_THREADSAFE
 
222
endif
 
223
 
 
224
ifdef JS_NO_THIN_LOCKS
 
225
DEFINES         += -DJS_USE_ONLY_NSPR_LOCKS
 
226
endif
 
227
 
 
228
ifdef JS_VERSION
 
229
DEFINES         += -DJS_VERSION=$(JS_VERSION)
 
230
endif
 
231
 
 
232
ifneq ($(findstring -L,$(NSPR_LIBS)),)
 
233
NSPR_STATIC_PATH = $(subst -L,,$(findstring -L,$(NSPR_LIBS)))
 
234
else
 
235
NSPR_STATIC_PATH = $(DIST)/lib
 
236
endif
 
237
 
 
238
LDFLAGS         += $(pathsubst -l%,$(NSPR_STATIC_PATH)/%.a,$(NSPR_LIBS))
 
239
 
 
240
# BeOS and HP-UX do not require the extra linking of "-lm"
 
241
ifeq (,$(filter BeOS HP-UX WINNT OpenVMS,$(OS_ARCH)))
 
242
LDFLAGS         += -lm
 
243
endif
 
244
 
 
245
# Prevent floating point errors caused by VC++ optimizations
 
246
ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_)
 
247
CFLAGS += /Op
 
248
endif # WINNT
 
249
 
 
250
ifeq ($(OS_ARCH),FreeBSD)
 
251
LDFLAGS         += -pthread
 
252
endif
 
253
ifeq ($(OS_ARCH),IRIX)
 
254
ifdef USE_N32
 
255
DASH_R          += -n32
 
256
endif
 
257
endif
 
258
ifeq ($(OS_ARCH),Linux)
 
259
LDFLAGS         += -ldl
 
260
endif
 
261
ifeq ($(OS_ARCH),OSF1)
 
262
LDFLAGS         += -lc_r
 
263
endif
 
264
ifeq ($(OS_ARCH),SunOS)
 
265
ifeq ($(TARGET_CPU),sparc)
 
266
 
 
267
ifdef JS_ULTRASPARC_OPTS
 
268
DEFINES += -DULTRA_SPARC
 
269
ifdef GNU_CC
 
270
CFLAGS   += -Wa,-xarch=v8plus,-DULTRA_SPARC,-P,-L,-D_ASM,-D__STDC__=0
 
271
CXXFLAGS += -Wa,-xarch=v8plus,-DULTRA_SPARC,-P,-L,-D_ASM,-D__STDC__=0,-K,PIC
 
272
else
 
273
ASFLAGS  += -xarch=v8plus -DULTRA_SPARC -P -L -D_ASM -D__STDC__=0 -K PIC
 
274
endif # GNU_CC
 
275
endif # JS_ULTRASPARC_OPTS
 
276
 
 
277
endif
 
278
ifeq ($(OS_RELEASE),4.1)
 
279
LDFLAGS         += -ldl -lnsl
 
280
else
 
281
LDFLAGS         += -lposix4 -ldl -lnsl -lsocket
 
282
endif
 
283
endif
 
284
 
 
285
ifeq ($(OS_ARCH),QNX)
 
286
ifneq ($(OS_TARGET),NTO)
 
287
# Don't use wildcard here, because we only want this resolved at link time.
 
288
OBJS            += fdlibm/*.o
 
289
endif
 
290
endif
 
291
 
 
292
ifeq ($(OS_ARCH),IRIX)
 
293
ifndef GNU_CC
 
294
_COMPILE_CFLAGS  = $(patsubst -O%,-O1,$(COMPILE_CFLAGS))
 
295
jsapi.o jsarena.o jsarray.o jsatom.o jsemit.o jsfun.o jsinterp.o jsregexp.o jsparse.o jsopcode.o jsscript.o: %.o: %.c Makefile.in
 
296
        $(REPORT_BUILD)
 
297
        @$(MAKE_DEPS_AUTO)
 
298
        $(CC) -o $@ -c $(_COMPILE_CFLAGS) $<
 
299
endif
 
300
endif
 
301
 
 
302
# On OS/2 & win32 we are already linking against fdlibm, so don't bother
 
303
# creating jsmathtemp
 
304
ifeq (,$(filter OS2 WINNT OpenVMS,$(OS_ARCH)))
 
305
# special rule for jsmath.o since we want to incrementally link
 
306
# against fdlibm to pull in only what is needed
 
307
# Do this in a single step to avoid dependency problems
 
308
jsmath.o: jsmath.c $(FDLIBM_LIBRARY) Makefile.in
 
309
        $(REPORT_BUILD)
 
310
        @$(MAKE_DEPS_AUTO)
 
311
        $(ELOG) $(CC) $(OUTOPTION)$(JSMATH_PRELINK) -c $(COMPILE_CFLAGS) $<
 
312
ifeq ($(OS_ARCH),QNX)
 
313
ifneq ($(OS_TARGET),NTO)
 
314
        @cp $(JSMATH_PRELINK) $@
 
315
else
 
316
        $(LD) $(DASH_R) -o $@ $(JSMATH_PRELINK) $(FDLIBM_LIBRARY)
 
317
endif
 
318
else
 
319
        $(LD) $(DASH_R) -o $@ $(JSMATH_PRELINK) $(FDLIBM_LIBRARY)
 
320
endif
 
321
        @$(RM) -f $(JSMATH_PRELINK)
 
322
else
 
323
# Create dependency so we build fdlibm
 
324
jsmath.o: $(FDLIBM_LIBRARY) Makefile.in
 
325
endif
 
326
 
 
327
# An AIX Optimization bug causes PR_dtoa() & JS_dtoa to produce wrong result.
 
328
# This suppresses optimization for this single compilation unit.
 
329
ifeq ($(OS_ARCH),AIX)
 
330
jsatom.o: jsatom.c Makefile.in
 
331
        $(REPORT_BUILD)
 
332
        @$(MAKE_DEPS_AUTO)
 
333
        $(CC) -o $@ -c $(filter-out $(MOZ_OPTIMIZE_FLAGS), $(COMPILE_CFLAGS)) $<
 
334
jsdtoa.o: jsdtoa.c Makefile.in
 
335
        $(REPORT_BUILD)
 
336
        @$(MAKE_DEPS_AUTO)
 
337
        $(CC) -o $@ -c $(filter-out $(MOZ_OPTIMIZE_FLAGS), $(COMPILE_CFLAGS)) $<
 
338
endif
 
339
 
 
340
$(FDLIBM_LIBRARY):
 
341
        $(MAKE) -C $(@D) $(@F)
 
342
 
 
343
jsopcode.h jsopcode.c: jsopcode.tbl
 
344
 
 
345
ifeq (,$(CROSS_COMPILE)$(filter-out WINNT,$(OS_ARCH)))
 
346
jsautocfg.h:
 
347
        touch $@
 
348
else
 
349
jsautocfg.h: jscpucfg$(HOST_BIN_SUFFIX)
 
350
        @rm -f $@ jsautocfg.tmp
 
351
        ./jscpucfg > jsautocfg.tmp
 
352
        mv jsautocfg.tmp $@
 
353
endif
 
354
 
 
355
# jscpucfg is a strange target
 
356
# Needs to be built with the host compiler but needs to include
 
357
# the mdcpucfg for the target so it needs the appropriate target defines
 
358
ifdef HOST_NSPR_MDCPUCFG
 
359
HOST_CC := $(HOST_CC) -DMDCPUCFG=$(TARGET_NSPR_MDCPUCFG)
 
360
endif
 
361
 
 
362
ifeq ($(OS_ARCH),QNX)
 
363
ifneq ($(OS_TARGET),NTO)
 
364
# QNX's compiler apparently can't build a binary directly from a source file.
 
365
jscpucfg.o: jscpucfg.c Makefile.in
 
366
        $(HOST_CC) $(HOST_CFLAGS) -c $(DEFINES) $(NSPR_CFLAGS) -o $@ $<
 
367
 
 
368
jscpucfg: jscpucfg.o
 
369
        $(HOST_CC) $(HOST_CFLAGS) $(DEFINES) -o $@ $<
 
370
endif
 
371
else
 
372
jscpucfg$(HOST_BIN_SUFFIX): jscpucfg.c Makefile.in
 
373
        $(HOST_CC) $(HOST_CFLAGS) $(DEFINES) $(NSPR_CFLAGS) $(OUTOPTION)$@ $<
 
374
endif
 
375