1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/nsprpub/lib/tests/Makefile.in Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,178 @@ 1.4 +# 1.5 +# This Source Code Form is subject to the terms of the Mozilla Public 1.6 +# License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 +# file, You can obtain one at http://mozilla.org/MPL/2.0/. 1.8 + 1.9 +#! gmake 1.10 + 1.11 +MOD_DEPTH = ../.. 1.12 +topsrcdir = @top_srcdir@ 1.13 +srcdir = @srcdir@ 1.14 +VPATH = @srcdir@ 1.15 + 1.16 +include $(MOD_DEPTH)/config/autoconf.mk 1.17 + 1.18 +include $(topsrcdir)/config/config.mk 1.19 + 1.20 +CSRCS = \ 1.21 + arena.c \ 1.22 + base64t.c \ 1.23 + getopt.c \ 1.24 + string.c 1.25 + 1.26 +ifeq (,$(filter-out WINCE WINNT OS2,$(OS_ARCH))) 1.27 +CSRCS += arena.c 1.28 +endif 1.29 + 1.30 +ifeq (,$(filter-out WINCE WINNT OS2,$(OS_ARCH))) 1.31 +PROG_SUFFIX = .exe 1.32 +else 1.33 +PROG_SUFFIX = 1.34 +endif 1.35 + 1.36 +PROGS = $(addprefix $(OBJDIR)/, $(CSRCS:.c=$(PROG_SUFFIX))) 1.37 + 1.38 +TARGETS = $(PROGS) $(OBJS) 1.39 + 1.40 +INCLUDES = -I$(dist_includedir) 1.41 + 1.42 +# Setting the variables LDOPTS and LIBPR. We first initialize 1.43 +# them to the default values, then adjust them for some platforms. 1.44 +LDOPTS = -L$(dist_libdir) 1.45 +LIBPR = -lnspr$(MOD_MAJOR_VERSION) 1.46 +LIBPLC = -lplc$(MOD_MAJOR_VERSION) 1.47 +LIBPLDS = -lplds$(MOD_MAJOR_VERSION) 1.48 + 1.49 +ifeq (,$(filter-out WINCE WINNT, $(OS_ARCH))) 1.50 + LDOPTS = -NOLOGO -DEBUG -INCREMENTAL:NO 1.51 + ifeq (,$(filter-out WIN95 WINCE WINMO, $(OS_TARGET))) 1.52 + LIBPR = $(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX) 1.53 + LIBPLC= $(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX) 1.54 + LIBPLDS= $(dist_libdir)/plds$(MOD_MAJOR_VERSION).$(LIB_SUFFIX) 1.55 + else 1.56 + LIBPR = $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX) 1.57 + LIBPLC= $(dist_libdir)/libplc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX) 1.58 + LIBPLDS= $(dist_libdir)/libplds$(MOD_MAJOR_VERSION).$(LIB_SUFFIX) 1.59 + endif 1.60 +endif 1.61 + 1.62 +ifeq ($(OS_ARCH),OS2) 1.63 +LDOPTS += -Zomf -Zlinker /PM:VIO 1.64 +endif 1.65 + 1.66 +ifneq ($(OS_ARCH), WINNT) 1.67 +PWD = $(shell pwd) 1.68 +endif 1.69 + 1.70 +ifeq ($(OS_ARCH), IRIX) 1.71 +LDOPTS += -rpath $(PWD)/$(dist_libdir) 1.72 +endif 1.73 + 1.74 +ifeq ($(OS_ARCH), Linux) 1.75 + ifeq ($(OS_RELEASE), 1.2) 1.76 + EXTRA_LIBS = -ldl 1.77 + else 1.78 + LDOPTS += -Xlinker -rpath $(PWD)/$(dist_libdir) 1.79 + ifeq ($(USE_PTHREADS),1) 1.80 + EXTRA_LIBS = -lpthread 1.81 + endif 1.82 + endif 1.83 +endif 1.84 + 1.85 +ifeq (,$(filter-out OpenBSD,$(OS_ARCH))) 1.86 + ifeq ($(USE_PTHREADS),1) 1.87 + EXTRA_LIBS = -lpthread 1.88 + endif 1.89 +endif 1.90 + 1.91 +ifeq ($(OS_ARCH), OSF1) 1.92 +LDOPTS += -rpath $(PWD)/$(dist_libdir) -lpthread 1.93 +endif 1.94 + 1.95 +ifeq ($(OS_ARCH), HP-UX) 1.96 +LDOPTS += -Wl,+s,+b,$(PWD)/$(dist_libdir) 1.97 +endif 1.98 + 1.99 +# AIX 1.100 +ifeq ($(OS_ARCH),AIX) 1.101 +LDOPTS += -blibpath:$(PWD)/$(dist_libdir):/usr/lib:/lib 1.102 +LIBPR = -lnspr$(MOD_MAJOR_VERSION)_shr 1.103 +LIBPLC = -lplc$(MOD_MAJOR_VERSION)_shr 1.104 +endif 1.105 + 1.106 +# Solaris 1.107 +ifeq ($(OS_ARCH), SunOS) 1.108 +ifdef NS_USE_GCC 1.109 +LDOPTS += -Xlinker -R -Xlinker $(PWD)/$(dist_libdir) 1.110 +else 1.111 +LDOPTS += -R $(PWD)/$(dist_libdir) 1.112 +endif 1.113 + 1.114 +# SunOS 5.5 needs to link with -lpthread, even though we already 1.115 +# linked with this system library when we built libnspr.so. 1.116 +ifeq ($(OS_RELEASE), 5.5) 1.117 +ifdef USE_PTHREADS 1.118 +EXTRA_LIBS = -lpthread 1.119 +endif 1.120 +endif 1.121 +endif # SunOS 1.122 + 1.123 +##################################################### 1.124 +# 1.125 +# The rules 1.126 +# 1.127 +##################################################### 1.128 + 1.129 +include $(topsrcdir)/config/rules.mk 1.130 + 1.131 +AIX_PRE_4_2 = 0 1.132 +ifeq ($(OS_ARCH),AIX) 1.133 +ifneq ($(OS_RELEASE),4.2) 1.134 +ifneq ($(USE_PTHREADS), 1) 1.135 +#AIX_PRE_4_2 = 1 1.136 +endif 1.137 +endif 1.138 +endif 1.139 + 1.140 +ifeq ($(AIX_PRE_4_2),1) 1.141 + 1.142 +# AIX releases prior to 4.2 need a special two-step linking hack 1.143 +# in order to both override the system select() and be able to 1.144 +# get at the original system select(). 1.145 +# 1.146 +# We use a pattern rule in ns/nspr20/config/rules.mk to generate 1.147 +# the .$(OBJ_SUFFIX) file from the .c source file, then do the 1.148 +# two-step linking hack below. 1.149 + 1.150 +$(OBJDIR)/%: $(OBJDIR)/%.$(OBJ_SUFFIX) 1.151 + @$(MAKE_OBJDIR) 1.152 + rm -f $@ $(AIX_TMP) 1.153 + $(CC) $(AIX_LINK_OPTS) -o $(AIX_TMP) $< $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).a 1.154 + $(CC) -o $@ $(AIX_TMP) $(AIX_WRAP) 1.155 + rm -f $(AIX_TMP) 1.156 + 1.157 +else 1.158 + 1.159 +# All platforms that are not AIX pre-4.2. 1.160 + 1.161 +$(OBJDIR)/%$(PROG_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX) 1.162 + @$(MAKE_OBJDIR) 1.163 + 1.164 +ifeq ($(OS_ARCH), WINNT) 1.165 + link $(LDOPTS) $< $(LIBPLC) $(LIBPLDS) $(LIBPR) ws2_32.lib -out:$@ 1.166 +else 1.167 +ifeq ($(OS_ARCH), WINCE) 1.168 + $(LD) $(LDOPTS) $< $(LIBPLC) $(LIBPLDS) $(LIBPR) ws2.lib -out:$@ 1.169 +else 1.170 +ifeq ($(OS_ARCH),OS2) 1.171 + $(LINK) $(EXEFLAGS) $(LDOPTS) $< $(LIBPLC) $(LIBPLDS) $(LIBPR) $(OS_LIBS) $(EXTRA_LIBS) 1.172 +else 1.173 + $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPLDS) $(LIBPR) $(EXTRA_LIBS) -o $@ 1.174 +endif 1.175 +endif 1.176 +endif 1.177 +endif 1.178 + 1.179 +export:: $(TARGETS) 1.180 +clean:: 1.181 + rm -f $(TARGETS)