| 1 |
# |
| 2 |
# This Source Code Form is subject to the terms of the Mozilla Public |
| 3 |
# License, v. 2.0. If a copy of the MPL was not distributed with this |
| 4 |
# file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 5 |
|
| 6 |
#! gmake |
| 7 |
|
| 8 |
MOD_DEPTH = ../.. |
| 9 |
topsrcdir = @top_srcdir@ |
| 10 |
srcdir = @srcdir@ |
| 11 |
VPATH = @srcdir@ |
| 12 |
|
| 13 |
include $(MOD_DEPTH)/config/autoconf.mk |
| 14 |
|
| 15 |
include $(topsrcdir)/config/config.mk |
| 16 |
|
| 17 |
INCLUDES = -I$(dist_includedir) -I$(topsrcdir)/pr/include |
| 18 |
|
| 19 |
CSRCS = \ |
| 20 |
plarena.c \ |
| 21 |
plhash.c \ |
| 22 |
plvrsion.c \ |
| 23 |
$(NULL) |
| 24 |
|
| 25 |
HEADERS = \ |
| 26 |
plarenas.h \ |
| 27 |
plarena.h \ |
| 28 |
plhash.h \ |
| 29 |
$(NULL) |
| 30 |
|
| 31 |
HEADERS := $(addprefix $(srcdir)/, $(HEADERS)) |
| 32 |
|
| 33 |
ifeq ($(OS_ARCH), WINNT) |
| 34 |
RES=$(OBJDIR)/plds.res |
| 35 |
RESNAME=plds.rc |
| 36 |
endif # WINNT |
| 37 |
|
| 38 |
ifeq ($(OS_ARCH), AIX) |
| 39 |
ifeq ($(CLASSIC_NSPR),1) |
| 40 |
OS_LIBS = -lc |
| 41 |
else |
| 42 |
OS_LIBS = -lc_r |
| 43 |
endif |
| 44 |
endif |
| 45 |
|
| 46 |
ifeq ($(OS_ARCH),SunOS) |
| 47 |
OS_LIBS = -lc |
| 48 |
MAPFILE = $(OBJDIR)/pldsmap.sun |
| 49 |
GARBAGE += $(MAPFILE) |
| 50 |
ifdef NS_USE_GCC |
| 51 |
ifdef GCC_USE_GNU_LD |
| 52 |
MKSHLIB += -Wl,--version-script,$(MAPFILE) |
| 53 |
else |
| 54 |
MKSHLIB += -Wl,-M,$(MAPFILE) |
| 55 |
endif |
| 56 |
else |
| 57 |
MKSHLIB += -M $(MAPFILE) |
| 58 |
endif |
| 59 |
# The -R '$ORIGIN' linker option instructs this library to search for its |
| 60 |
# dependencies in the same directory where it resides. |
| 61 |
MKSHLIB += -R '$$ORIGIN' |
| 62 |
endif |
| 63 |
|
| 64 |
EXTRA_LIBS = $(LIBNSPR) |
| 65 |
|
| 66 |
# On SCOOS, we can't link with extra libraries when |
| 67 |
# we build a shared library. If we do so, the linker doesn't |
| 68 |
# complain, but we would run into weird problems at run-time. |
| 69 |
# Therefore on these platforms, we link just the .o files. |
| 70 |
ifeq ($(OS_ARCH),SCOOS) |
| 71 |
EXTRA_LIBS = |
| 72 |
endif |
| 73 |
|
| 74 |
ifdef RESOLVE_LINK_SYMBOLS |
| 75 |
EXTRA_LIBS += $(OS_LIBS) |
| 76 |
endif |
| 77 |
|
| 78 |
LIBRARY_NAME = plds |
| 79 |
LIBRARY_VERSION = $(MOD_MAJOR_VERSION) |
| 80 |
|
| 81 |
RELEASE_HEADERS = $(HEADERS) |
| 82 |
RELEASE_HEADERS_DEST = $(RELEASE_INCLUDE_DIR) |
| 83 |
RELEASE_LIBS = $(TARGETS) |
| 84 |
|
| 85 |
include $(topsrcdir)/config/rules.mk |
| 86 |
|
| 87 |
# |
| 88 |
# Version information generation (begin) |
| 89 |
# |
| 90 |
ECHO = echo |
| 91 |
TINC = $(OBJDIR)/_pl_bld.h |
| 92 |
PROD = $(notdir $(SHARED_LIBRARY)) |
| 93 |
NOW = $(MOD_DEPTH)/config/$(OBJDIR)/now |
| 94 |
SH_DATE = $(shell date "+%Y-%m-%d %T") |
| 95 |
SH_NOW = $(shell $(NOW)) |
| 96 |
|
| 97 |
ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT) |
| 98 |
SUF = i64 |
| 99 |
else |
| 100 |
SUF = LL |
| 101 |
endif |
| 102 |
|
| 103 |
GARBAGE += $(TINC) |
| 104 |
|
| 105 |
$(TINC): |
| 106 |
@$(MAKE_OBJDIR) |
| 107 |
@$(ECHO) '#define _BUILD_STRING "$(SH_DATE)"' > $(TINC) |
| 108 |
@if test ! -z "$(SH_NOW)"; then \ |
| 109 |
$(ECHO) '#define _BUILD_TIME $(SH_NOW)$(SUF)' >> $(TINC); \ |
| 110 |
else \ |
| 111 |
true; \ |
| 112 |
fi |
| 113 |
@$(ECHO) '#define _PRODUCTION "$(PROD)"' >> $(TINC) |
| 114 |
|
| 115 |
|
| 116 |
$(OBJDIR)/plvrsion.$(OBJ_SUFFIX): plvrsion.c $(TINC) |
| 117 |
ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT) |
| 118 |
$(CC) -Fo$@ -c $(CFLAGS) -I$(OBJDIR) $< |
| 119 |
else |
| 120 |
$(CC) -o $@ -c $(CFLAGS) -I$(OBJDIR) $< |
| 121 |
endif |
| 122 |
# |
| 123 |
# Version information generation (end) |
| 124 |
# |
| 125 |
|
| 126 |
# |
| 127 |
# The Client build wants the shared libraries in $(dist_bindir), |
| 128 |
# so we also install them there. |
| 129 |
# |
| 130 |
|
| 131 |
export:: $(TARGETS) |
| 132 |
$(INSTALL) -m 444 $(HEADERS) $(dist_includedir) |
| 133 |
$(INSTALL) -m 444 $(TARGETS) $(dist_libdir) |
| 134 |
ifdef SHARED_LIBRARY |
| 135 |
ifeq ($(OS_ARCH),HP-UX) |
| 136 |
$(INSTALL) -m 755 $(SHARED_LIBRARY) $(dist_libdir) |
| 137 |
$(INSTALL) -m 755 $(SHARED_LIBRARY) $(dist_bindir) |
| 138 |
else |
| 139 |
$(INSTALL) -m 444 $(SHARED_LIBRARY) $(dist_bindir) |
| 140 |
endif |
| 141 |
endif |