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
15 # The Original Code is the Netscape Portable Runtime (NSPR).
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.
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 *****
41 topsrcdir
= @top_srcdir@
45 include $(MOD_DEPTH
)/config
/autoconf.mk
47 include $(topsrcdir
)/config
/config.mk
49 INCLUDES
= -I
$(dist_includedir
) -I
$(topsrcdir
)/pr
/include
63 HEADERS
:= $(addprefix $(srcdir)/, $(HEADERS
))
65 ifeq ($(OS_ARCH
), WINNT
)
66 RES
=$(OBJDIR
)/plds.res
70 ifeq ($(OS_ARCH
), AIX
)
71 ifeq ($(CLASSIC_NSPR
),1)
78 ifeq ($(OS_ARCH
),IRIX
)
82 ifeq ($(OS_ARCH
),SunOS
)
84 MAPFILE
= $(OBJDIR
)/pldsmap.sun
88 MKSHLIB
+= -Wl
,--version-script
,$(MAPFILE
)
90 MKSHLIB
+= -Wl
,-M
,$(MAPFILE
)
93 MKSHLIB
+= -M
$(MAPFILE
)
95 # The -R '$ORIGIN' linker option instructs this library to search for its
96 # dependencies in the same directory where it resides.
97 MKSHLIB
+= -R
'$$ORIGIN'
100 ifeq ($(OS_ARCH
),OS2
)
101 MAPFILE
= $(OBJDIR
)/$(LIBRARY_NAME
)$(LIBRARY_VERSION
).def
102 GARBAGE
+= $(MAPFILE
)
103 MKSHLIB
+= $(MAPFILE
)
106 EXTRA_LIBS
= $(LIBNSPR
)
108 # On NCR and SCOOS, we can't link with extra libraries when
109 # we build a shared library. If we do so, the linker doesn't
110 # complain, but we would run into weird problems at run-time.
111 # Therefore on these platforms, we link just the .o files.
112 ifeq ($(OS_ARCH
),NCR
)
115 ifeq ($(OS_ARCH
),SCOOS
)
119 ifdef RESOLVE_LINK_SYMBOLS
120 EXTRA_LIBS
+= $(OS_LIBS
)
124 LIBRARY_VERSION
= $(MOD_MAJOR_VERSION
)
126 RELEASE_HEADERS
= $(HEADERS
)
127 RELEASE_HEADERS_DEST
= $(RELEASE_INCLUDE_DIR
)
128 RELEASE_LIBS
= $(TARGETS
)
130 include $(topsrcdir
)/config
/rules.mk
133 # Version information generation (begin)
136 TINC
= $(OBJDIR
)/_pl_bld.h
137 PROD
= $(notdir $(SHARED_LIBRARY
))
138 NOW
= $(MOD_DEPTH
)/config
/$(OBJDIR
)/now
139 SH_DATE
= $(shell date
"+%Y-%m-%d %T")
140 SH_NOW
= $(shell $(NOW
))
142 ifeq ($(NS_USE_GCC
)_
$(OS_ARCH
),_WINNT
)
152 @
$(ECHO
) '#define _BUILD_STRING "$(SH_DATE)"' > $(TINC
)
153 @if
test ! -z
"$(SH_NOW)"; then \
154 $(ECHO
) '#define _BUILD_TIME $(SH_NOW)$(SUF)' >> $(TINC
); \
158 @
$(ECHO
) '#define _PRODUCTION "$(PROD)"' >> $(TINC
)
161 $(OBJDIR
)/plvrsion.
$(OBJ_SUFFIX
): plvrsion.c
$(TINC
)
162 ifeq ($(NS_USE_GCC
)_
$(OS_ARCH
),_WINNT
)
163 $(CC
) -Fo
$@
-c
$(CFLAGS
) -I
$(OBJDIR
) $<
165 $(CC
) -o
$@
-c
$(CFLAGS
) -I
$(OBJDIR
) $<
168 # Version information generation (end)
172 # The Client build wants the shared libraries in $(dist_bindir),
173 # so we also install them there.
177 $(INSTALL
) -m
444 $(HEADERS
) $(dist_includedir
)
178 $(INSTALL
) -m
444 $(TARGETS
) $(dist_libdir
)
180 ifeq ($(OS_ARCH
),HP-UX
)
181 $(INSTALL
) -m
755 $(SHARED_LIBRARY
) $(dist_libdir
)
182 $(INSTALL
) -m
755 $(SHARED_LIBRARY
) $(dist_bindir
)
184 $(INSTALL
) -m
444 $(SHARED_LIBRARY
) $(dist_bindir
)
187 ifeq ($(MOZ_BITS
),16)
188 $(INSTALL
) -m
444 $(HEADERS
) $(MOZ_INCL
)
189 $(INSTALL
) -m
444 $(TARGETS
) $(MOZ_DIST
)/lib
190 $(INSTALL
) -m
444 $(TARGETS
) $(MOZ_DIST
)/bin