Imported Upstream version 1.0.0
[platform/upstream/js.git] / js / src / jsconfig.mk
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-1999
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 ifndef OBJDIR
41   ifdef OBJDIR_NAME
42     OBJDIR = $(OBJDIR_NAME)
43   endif
44 endif
45
46 NSPR_VERSION = v4.0
47 NSPR_LIBSUFFIX = 4
48
49 NSPR_LOCAL       = $(MOZ_DEPTH)/dist/$(OBJDIR)/nspr
50 NSPR_DIST        = $(MOZ_DEPTH)/dist/$(OBJDIR)
51 NSPR_OBJDIR      = $(OBJDIR)
52 ifeq ($(OS_ARCH), SunOS)
53   NSPR_OBJDIR   := $(subst _sparc,,$(NSPR_OBJDIR))
54 endif
55 ifeq ($(OS_ARCH), Linux)
56   LINUX_REL     := $(shell uname -r)
57   ifneq (,$(findstring 2.0,$(LINUX_REL)))
58     NSPR_OBJDIR := $(subst _All,2.0_x86_glibc_PTH,$(NSPR_OBJDIR))
59   else
60     NSPR_OBJDIR := $(subst _All,2.2_x86_glibc_PTH,$(NSPR_OBJDIR))
61   endif
62 endif
63 ifeq ($(OS_ARCH), AIX)
64   NSPR_OBJDIR   := $(subst 4.1,4.2,$(NSPR_OBJDIR))
65 endif
66 ifeq ($(OS_CONFIG), IRIX6.2)
67   NSPR_OBJDIR   := $(subst 6.2,6.2_n32_PTH,$(NSPR_OBJDIR))
68 endif
69 ifeq ($(OS_CONFIG), IRIX6.5)
70   NSPR_OBJDIR   := $(subst 6.5,6.5_n32_PTH,$(NSPR_OBJDIR))
71 endif
72 ifeq ($(OS_ARCH), WINNT)
73   ifeq ($(OBJDIR), WIN32_D.OBJ)
74     NSPR_OBJDIR  = WINNT4.0_DBG.OBJ
75   endif
76   ifeq ($(OBJDIR), WIN32_O.OBJ)
77     NSPR_OBJDIR  = WINNT4.0_OPT.OBJ
78   endif
79 endif
80 NSPR_SHARED      = /share/builds/components/nspr20/$(NSPR_VERSION)/$(NSPR_OBJDIR)
81 ifeq ($(OS_ARCH), WINNT)
82   NSPR_SHARED    = nspr20/$(NSPR_VERSION)/$(NSPR_OBJDIR)
83 endif
84 NSPR_VERSIONFILE = $(NSPR_LOCAL)/Version
85 NSPR_CURVERSION := $(shell cat $(NSPR_VERSIONFILE) 2>/dev/null)
86
87 get_nspr:
88         @echo "Grabbing NSPR component..."
89 ifeq ($(NSPR_VERSION), $(NSPR_CURVERSION))
90         @echo "No need, NSPR is up to date in this tree (ver=$(NSPR_VERSION))."
91 else
92         mkdir -p $(NSPR_LOCAL)
93         mkdir -p $(NSPR_DIST)
94   ifneq ($(OS_ARCH), WINNT)
95         cp       $(NSPR_SHARED)/*.jar $(NSPR_LOCAL)
96   else
97         sh       $(MOZ_DEPTH)/../reltools/compftp.sh $(NSPR_SHARED) $(NSPR_LOCAL) *.jar
98   endif
99         unzip -o $(NSPR_LOCAL)/mdbinary.jar -d $(NSPR_DIST)
100         mkdir -p $(NSPR_DIST)/include
101         unzip -o $(NSPR_LOCAL)/mdheader.jar -d $(NSPR_DIST)/include
102         rm -rf   $(NSPR_DIST)/META-INF
103         rm -rf   $(NSPR_DIST)/include/META-INF
104         echo $(NSPR_VERSION) > $(NSPR_VERSIONFILE)
105 endif
106
107 SHIP_DIST  = $(MOZ_DEPTH)/dist/$(OBJDIR)
108 SHIP_DIR   = $(SHIP_DIST)/SHIP
109
110 SHIP_LIBS      = libjs.$(SO_SUFFIX) libjs.a
111 ifeq ($(OS_ARCH), WINNT)
112   SHIP_LIBS    = js32.dll js32.lib
113 endif
114 SHIP_LIBS     += $(LCJAR)
115 SHIP_LIBS     := $(addprefix $(SHIP_DIST)/lib/, $(SHIP_LIBS))
116
117 SHIP_INCS      = js*.h prmjtime.h resource.h *.msg *.tbl
118 SHIP_INCS     := $(addprefix $(SHIP_DIST)/include/, $(SHIP_INCS))
119
120 SHIP_BINS      = js
121 ifeq ($(OS_ARCH), WINNT)
122   SHIP_BINS   := $(addsuffix .exe, $(SHIP_BINS))
123 endif
124 SHIP_BINS     := $(addprefix $(SHIP_DIST)/bin/, $(SHIP_BINS))
125
126 ifdef BUILD_OPT
127   JSREFJAR = jsref_opt.jar
128 else
129 ifdef BUILD_IDG
130   JSREFJAR = jsref_idg.jar
131 else
132   JSREFJAR = jsref_dbg.jar
133 endif
134 endif
135
136 ship:
137         mkdir -p $(SHIP_DIR)/$(LIBDIR)
138         mkdir -p $(SHIP_DIR)/include
139         mkdir -p $(SHIP_DIR)/bin
140         cp $(SHIP_LIBS) $(SHIP_DIR)/$(LIBDIR)
141         cp $(SHIP_INCS) $(SHIP_DIR)/include
142         cp $(SHIP_BINS) $(SHIP_DIR)/bin
143         cd $(SHIP_DIR); \
144           zip -r $(JSREFJAR) bin lib include
145 ifdef BUILD_SHIP
146         cp $(SHIP_DIR)/$(JSREFJAR) $(BUILD_SHIP)
147 endif
148
149 CWD = $(shell pwd)
150 shipSource: $(SHIP_DIR)/jsref_src.lst .FORCE
151         mkdir -p $(SHIP_DIR)
152         cd $(MOZ_DEPTH)/.. ; \
153           zip $(CWD)/$(SHIP_DIR)/jsref_src.jar -@ < $(CWD)/$(SHIP_DIR)/jsref_src.lst
154 ifdef BUILD_SHIP
155         cp $(SHIP_DIR)/jsref_src.jar $(BUILD_SHIP)
156 endif
157
158 JSREFSRCDIRS := $(shell cat $(DEPTH)/SpiderMonkey.rsp)
159 $(SHIP_DIR)/jsref_src.lst: .FORCE
160         mkdir -p $(SHIP_DIR)
161         rm -f $@
162         touch $@
163         for d in $(JSREFSRCDIRS); do                                \
164           cd $(MOZ_DEPTH)/..;                                       \
165           ls -1 -d $$d | grep -v CVS | grep -v \.OBJ >> $(CWD)/$@;  \
166           cd $(CWD);                                                \
167         done
168
169 .FORCE: