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