1 | #
|
---|
2 | # ***** BEGIN LICENSE BLOCK *****
|
---|
3 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
---|
4 | #
|
---|
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/
|
---|
9 | #
|
---|
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.
|
---|
14 | #
|
---|
15 | # The Original Code is the Netscape Portable Runtime (NSPR).
|
---|
16 | #
|
---|
17 | # The Initial Developer of the Original Code is
|
---|
18 | # Netscape Communications Corporation.
|
---|
19 | # Portions created by the Initial Developer are Copyright (C) 1998-2000
|
---|
20 | # the Initial Developer. All Rights Reserved.
|
---|
21 | #
|
---|
22 | # Contributor(s):
|
---|
23 | #
|
---|
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.
|
---|
35 | #
|
---|
36 | # ***** END LICENSE BLOCK *****
|
---|
37 |
|
---|
38 | #! gmake
|
---|
39 |
|
---|
40 | MOD_DEPTH = ../..
|
---|
41 | topsrcdir = @top_srcdir@
|
---|
42 | srcdir = @srcdir@
|
---|
43 | VPATH = @srcdir@
|
---|
44 |
|
---|
45 | include $(MOD_DEPTH)/config/autoconf.mk
|
---|
46 |
|
---|
47 | include $(topsrcdir)/config/config.mk
|
---|
48 |
|
---|
49 | INCLUDES = -I$(dist_includedir) -I$(topsrcdir)/pr/include
|
---|
50 |
|
---|
51 | CSRCS = \
|
---|
52 | plarena.c \
|
---|
53 | plhash.c \
|
---|
54 | plvrsion.c \
|
---|
55 | $(NULL)
|
---|
56 |
|
---|
57 | HEADERS = \
|
---|
58 | plarenas.h \
|
---|
59 | plarena.h \
|
---|
60 | plhash.h \
|
---|
61 | $(NULL)
|
---|
62 |
|
---|
63 | HEADERS := $(addprefix $(srcdir)/, $(HEADERS))
|
---|
64 |
|
---|
65 | ifeq ($(OS_ARCH), WINNT)
|
---|
66 | ifdef NS_USE_GCC
|
---|
67 | DLLBASE=-Wl,--image-base -Wl,0x30000000
|
---|
68 | else
|
---|
69 | DLLBASE=/BASE:0x30000000
|
---|
70 | endif # GCC
|
---|
71 | RES=$(OBJDIR)/plds.res
|
---|
72 | RESNAME=plds.rc
|
---|
73 | endif # WINNT
|
---|
74 |
|
---|
75 | ifeq ($(OS_ARCH), AIX)
|
---|
76 | ifeq ($(CLASSIC_NSPR),1)
|
---|
77 | OS_LIBS = -lc
|
---|
78 | else
|
---|
79 | OS_LIBS = -lc_r
|
---|
80 | endif
|
---|
81 | endif
|
---|
82 |
|
---|
83 | ifeq ($(OS_ARCH),IRIX)
|
---|
84 | OS_LIBS = -lc
|
---|
85 | endif
|
---|
86 |
|
---|
87 | ifeq ($(OS_ARCH),SunOS)
|
---|
88 | OS_LIBS = -lc
|
---|
89 | MAPFILE = $(OBJDIR)/pldsmap.sun
|
---|
90 | GARBAGE += $(MAPFILE)
|
---|
91 | ifdef NS_USE_GCC
|
---|
92 | ifdef GCC_USE_GNU_LD
|
---|
93 | MKSHLIB += -Wl,--version-script,$(MAPFILE)
|
---|
94 | else
|
---|
95 | MKSHLIB += -Wl,-M,$(MAPFILE)
|
---|
96 | endif
|
---|
97 | else
|
---|
98 | MKSHLIB += -M $(MAPFILE)
|
---|
99 | endif
|
---|
100 | # The -R '$ORIGIN' linker option instructs this library to search for its
|
---|
101 | # dependencies in the same directory where it resides.
|
---|
102 | MKSHLIB += -R '$$ORIGIN'
|
---|
103 | endif
|
---|
104 |
|
---|
105 | ifeq ($(OS_ARCH),OS2)
|
---|
106 | MAPFILE = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).def
|
---|
107 | GARBAGE += $(MAPFILE)
|
---|
108 | MKSHLIB += $(MAPFILE)
|
---|
109 | endif
|
---|
110 |
|
---|
111 | EXTRA_LIBS = $(LIBNSPR)
|
---|
112 |
|
---|
113 | # On NCR and SCOOS, we can't link with extra libraries when
|
---|
114 | # we build a shared library. If we do so, the linker doesn't
|
---|
115 | # complain, but we would run into weird problems at run-time.
|
---|
116 | # Therefore on these platforms, we link just the .o files.
|
---|
117 | ifeq ($(OS_ARCH),NCR)
|
---|
118 | EXTRA_LIBS =
|
---|
119 | endif
|
---|
120 | ifeq ($(OS_ARCH),SCOOS)
|
---|
121 | EXTRA_LIBS =
|
---|
122 | endif
|
---|
123 |
|
---|
124 | ifdef RESOLVE_LINK_SYMBOLS
|
---|
125 | EXTRA_LIBS += $(OS_LIBS)
|
---|
126 | endif
|
---|
127 |
|
---|
128 | LIBRARY_NAME = plds
|
---|
129 | LIBRARY_VERSION = $(MOD_MAJOR_VERSION)
|
---|
130 |
|
---|
131 | RELEASE_HEADERS = $(HEADERS)
|
---|
132 | RELEASE_HEADERS_DEST = $(RELEASE_INCLUDE_DIR)
|
---|
133 | RELEASE_LIBS = $(TARGETS)
|
---|
134 |
|
---|
135 | include $(topsrcdir)/config/rules.mk
|
---|
136 |
|
---|
137 | #
|
---|
138 | # Version information generation (begin)
|
---|
139 | #
|
---|
140 | ECHO = echo
|
---|
141 | TINC = $(OBJDIR)/_pl_bld.h
|
---|
142 | PROD = $(notdir $(SHARED_LIBRARY))
|
---|
143 | NOW = $(MOD_DEPTH)/config/$(OBJDIR)/now
|
---|
144 | SH_DATE = $(shell date "+%Y-%m-%d %T")
|
---|
145 | SH_NOW = $(shell $(NOW))
|
---|
146 |
|
---|
147 | ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
|
---|
148 | SUF = i64
|
---|
149 | else
|
---|
150 | SUF = LL
|
---|
151 | endif
|
---|
152 |
|
---|
153 | GARBAGE += $(TINC)
|
---|
154 |
|
---|
155 | $(TINC):
|
---|
156 | @$(MAKE_OBJDIR)
|
---|
157 | @$(ECHO) '#define _BUILD_STRING "$(SH_DATE)"' > $(TINC)
|
---|
158 | @if test ! -z "$(SH_NOW)"; then \
|
---|
159 | $(ECHO) '#define _BUILD_TIME $(SH_NOW)$(SUF)' >> $(TINC); \
|
---|
160 | else \
|
---|
161 | true; \
|
---|
162 | fi
|
---|
163 | @$(ECHO) '#define _PRODUCTION "$(PROD)"' >> $(TINC)
|
---|
164 |
|
---|
165 |
|
---|
166 | $(OBJDIR)/plvrsion.$(OBJ_SUFFIX): plvrsion.c $(TINC)
|
---|
167 | ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
|
---|
168 | $(CC) -Fo$@ -c $(CFLAGS) -I$(OBJDIR) $<
|
---|
169 | else
|
---|
170 | ifeq ($(MOZ_OS2_TOOLS), VACPP)
|
---|
171 | $(CC) -Fo$@ -c $(CFLAGS) -I$(OBJDIR) $<
|
---|
172 | else
|
---|
173 | $(CC) -o $@ -c $(CFLAGS) -I$(OBJDIR) $<
|
---|
174 | endif
|
---|
175 | endif
|
---|
176 | #
|
---|
177 | # Version information generation (end)
|
---|
178 | #
|
---|
179 |
|
---|
180 | #
|
---|
181 | # The Client build wants the shared libraries in $(dist_bindir),
|
---|
182 | # so we also install them there.
|
---|
183 | #
|
---|
184 |
|
---|
185 | export:: $(TARGETS)
|
---|
186 | $(INSTALL) -m 444 $(HEADERS) $(dist_includedir)
|
---|
187 | $(INSTALL) -m 444 $(TARGETS) $(dist_libdir)
|
---|
188 | ifdef SHARED_LIBRARY
|
---|
189 | ifeq ($(OS_ARCH),HP-UX)
|
---|
190 | $(INSTALL) -m 755 $(SHARED_LIBRARY) $(dist_libdir)
|
---|
191 | $(INSTALL) -m 755 $(SHARED_LIBRARY) $(dist_bindir)
|
---|
192 | else
|
---|
193 | $(INSTALL) -m 444 $(SHARED_LIBRARY) $(dist_bindir)
|
---|
194 | endif
|
---|
195 | endif
|
---|
196 | ifeq ($(MOZ_BITS),16)
|
---|
197 | $(INSTALL) -m 444 $(HEADERS) $(MOZ_INCL)
|
---|
198 | $(INSTALL) -m 444 $(TARGETS) $(MOZ_DIST)/lib
|
---|
199 | $(INSTALL) -m 444 $(TARGETS) $(MOZ_DIST)/bin
|
---|
200 | endif
|
---|
201 |
|
---|
202 |
|
---|