VirtualBox

source: vbox/trunk/src/libs/xpcom18a4/nsprpub/pr/tests/Makefile.in@ 55761

最後變更 在這個檔案從55761是 1,由 vboxsync 提交於 55 年 前

import

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 13.8 KB
 
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
39#! gmake
40
41MOD_DEPTH = ../..
42topsrcdir = @top_srcdir@
43srcdir = @srcdir@
44VPATH = @srcdir@
45
46include $(MOD_DEPTH)/config/autoconf.mk
47
48include $(topsrcdir)/config/config.mk
49
50DIRS = dll
51
52CSRCS = \
53 accept.c \
54 acceptread.c \
55 acceptreademu.c \
56 addrstr.c \
57 affinity.c \
58 alarm.c \
59 anonfm.c \
60 append.c \
61 atomic.c \
62 attach.c \
63 bigfile.c \
64 bigfile2.c \
65 bigfile3.c \
66 cleanup.c \
67 cltsrv.c \
68 concur.c \
69 cvar.c \
70 cvar2.c \
71 dceemu.c \
72 dlltest.c \
73 dtoa.c \
74 env.c \
75 errcodes.c \
76 errset.c \
77 exit.c \
78 fdcach.c \
79 fileio.c \
80 foreign.c \
81 forktest.c \
82 formattm.c \
83 fsync.c \
84 getai.c \
85 gethost.c \
86 getproto.c \
87 i2l.c \
88 initclk.c \
89 inrval.c \
90 instrumt.c \
91 intrio.c \
92 intrupt.c \
93 io_timeout.c \
94 ioconthr.c \
95 ipv6.c \
96 join.c \
97 joinkk.c \
98 joinku.c \
99 joinuk.c \
100 joinuu.c \
101 layer.c \
102 lazyinit.c \
103 libfilename.c \
104 lltest.c \
105 lock.c \
106 lockfile.c \
107 logger.c \
108 makedir.c \
109 mbcs.c \
110 multiacc.c \
111 multiwait.c \
112 many_cv.c \
113 nameshm1.c \
114 nbconn.c \
115 nblayer.c \
116 nonblock.c \
117 ntioto.c \
118 ntoh.c \
119 obsints.c \
120 op_2long.c \
121 op_excl.c \
122 op_filnf.c \
123 op_filok.c \
124 op_noacc.c \
125 op_nofil.c \
126 openfile.c \
127 parent.c \
128 peek.c \
129 perf.c \
130 pipeping.c \
131 pipeping2.c \
132 pipepong.c \
133 pipepong2.c \
134 pipeself.c \
135 poll_er.c \
136 poll_nm.c \
137 poll_to.c \
138 pollable.c \
139 prftest.c \
140 prftest1.c \
141 prftest2.c \
142 primblok.c \
143 priotest.c \
144 provider.c \
145 prpoll.c \
146 prpollml.c \
147 ranfile.c \
148 randseed.c \
149 rmdir.c \
150 rwlocktest.c \
151 sel_spd.c \
152 selct_er.c \
153 selct_nm.c \
154 selct_to.c \
155 select2.c \
156 selintr.c \
157 sem.c \
158 sema.c \
159 semaerr.c \
160 semaerr1.c \
161 semaping.c \
162 semapong.c \
163 sendzlf.c \
164 server_test.c \
165 servr_kk.c \
166 servr_ku.c \
167 servr_uk.c \
168 servr_uu.c \
169 short_thread.c \
170 sigpipe.c \
171 socket.c \
172 sockopt.c \
173 sockping.c \
174 sockpong.c \
175 sprintf.c \
176 sproc_ch.c \
177 sproc_p.c \
178 stack.c \
179 stdio.c \
180 str2addr.c \
181 strod.c \
182 suspend.c \
183 switch.c \
184 system.c \
185 testbit.c \
186 testfile.c \
187 thrpool_server.c \
188 thrpool_client.c \
189 threads.c \
190 thruput.c \
191 timemac.c \
192 timetest.c \
193 tmoacc.c \
194 tmocon.c \
195 tpd.c \
196 vercheck.c \
197 version.c \
198 udpsrv.c \
199 writev.c \
200 xnotify.c \
201 y2k.c \
202 y2ktmo.c \
203 zerolen.c \
204 $(NULL)
205
206ifeq ($(OS_TARGET),OS2)
207CSRCS += \
208 sleep.c \
209 stat.c \
210 yield.c \
211 $(NULL)
212endif
213
214ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
215PROG_SUFFIX = .exe
216else
217PROG_SUFFIX =
218endif
219
220PROGS = $(addprefix $(OBJDIR)/, $(CSRCS:.c=$(PROG_SUFFIX)))
221
222TARGETS = $(PROGS)
223
224INCLUDES = -I$(dist_includedir) -I$(topsrcdir)/pr/include -I$(topsrcdir)/pr/include/private
225
226ifeq ($(OS_ARCH), WINNT)
227ifdef NS_USE_GCC
228 EXTRA_LIBS += -lwsock32
229else
230 EXTRA_LIBS += wsock32.lib
231 LDOPTS = -NOLOGO -DEBUG -DEBUGTYPE:CV -INCREMENTAL:NO
232 ifdef PROFILE
233 LDOPTS += -PROFILE -MAP
234 endif # profile
235endif # NS_USE_GCC
236endif
237
238ifeq ($(OS_ARCH),OS2)
239ifeq ($(MOZ_OS2_TOOLS),VACPP)
240 LDOPTS = -NOE -DEBUG -nologo -PMTYPE:VIO
241else
242 EXTRA_LIBS = $(OS_LIBS)
243 LDOPTS = -Zomf -Zlinker /PM:VIO -Zlinker /ST:0x64000
244endif
245endif
246
247ifneq ($(OS_ARCH), WINNT)
248# Use an absolute pathname as the runtime library path (for the -R
249# or -rpath linker option or the LD_RUN_PATH environment variable).
250ifeq (,$(patsubst /%,,$(DIST)))
251# $(DIST) is already an absolute pathname.
252ABSOLUTE_LIB_DIR = $(dist_libdir)
253else
254# $(DIST) is a relative pathname: prepend the current directory.
255PWD = $(shell pwd)
256ABSOLUTE_LIB_DIR = $(PWD)/$(dist_libdir)
257endif
258endif
259
260ifeq ($(OS_ARCH), IRIX)
261 ifeq ($(USE_CPLUS), 1)
262 CC = CC
263 endif
264 LDOPTS += -rpath $(ABSOLUTE_LIB_DIR)
265 ifdef NS_USE_GCC
266 LDOPTS += -Wl,-rdata_shared
267 else
268 LDOPTS += -rdata_shared
269 endif
270# For 6.x machines, include this flag
271 ifeq ($(basename $(OS_RELEASE)),6)
272 ifndef NS_USE_GCC
273 ifeq ($(USE_N32),1)
274 LDOPTS += -n32
275 else
276 LDOPTS += -32
277 endif
278
279 ifeq ($(USE_PTHREADS), 1)
280 ifeq ($(OS_RELEASE), 6.2)
281 LDOPTS += -Wl,-woff,85
282 endif
283 endif
284 endif
285 endif
286endif
287
288ifeq ($(OS_ARCH), OSF1)
289 ifeq ($(USE_CPLUS), 1)
290 CC = cxx
291 endif
292# I haven't figured out how to pass -rpath to cc on OSF1 V3.2, so
293# we do static linking.
294 ifeq (,$(filter-out V2.0 V3.2,$(OS_RELEASE)))
295 LIBNSPR = $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).a
296 LIBPLC = $(dist_libdir)/libplc$(MOD_MAJOR_VERSION).a
297 EXTRA_LIBS = -lc_r
298 else
299 LDOPTS += -rpath $(ABSOLUTE_LIB_DIR)
300 endif
301endif
302
303ifeq ($(OS_ARCH), HP-UX)
304 LDOPTS += -z -Wl,+s,+b,$(ABSOLUTE_LIB_DIR)
305 ifeq ($(USE_64),1)
306 LDOPTS += +DD64
307 endif
308 ifeq ($(USE_PTHREADS),1)
309 EXTRA_LIBS = $(LIBPTHREAD)
310 endif
311endif
312
313# AIX
314ifeq ($(OS_ARCH),AIX)
315 LDOPTS += -blibpath:$(ABSOLUTE_LIB_DIR):/usr/lib:/lib
316 ifneq ($(OS_ARCH)$(OS_RELEASE),AIX4.1)
317 LDOPTS += -brtl
318 EXTRA_LIBS = -ldl
319 endif
320endif
321
322# Solaris
323ifeq ($(OS_ARCH), SunOS)
324 ifneq ($(OS_RELEASE), 4.1.3_U1)
325 ifdef NS_USE_GCC
326 LDOPTS += -Xlinker -R -Xlinker $(ABSOLUTE_LIB_DIR)
327 else
328 ifeq ($(USE_CPLUS), 1)
329 CC = CC
330 endif
331 LDOPTS += -R $(ABSOLUTE_LIB_DIR)
332 endif
333 endif
334
335 ifneq ($(LOCAL_THREADS_ONLY),1)
336 ifdef USE_PTHREADS
337 EXTRA_LIBS = -lpthread -lthread
338 else
339 EXTRA_LIBS = -lthread
340 endif
341 endif # LOCAL_THREADS_ONLY
342endif # SunOS
343
344ifeq ($(OS_ARCH), NEC)
345 EXTRA_LIBS = $(OS_LIBS)
346# This hardcodes in the executable programs the directory to find
347# libnspr.so etc. at program startup. Equivalent to the -R or -rpath
348# option for ld on other platforms.
349 export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
350endif
351
352ifeq ($(OS_ARCH), NCR)
353# NCR needs to link against -lsocket -lnsl -ldl (and -lc, which is
354# linked implicitly by $(CC)). Note that we did not link with these
355# system libraries when we built libnspr.so.
356 EXTRA_LIBS = -lsocket -lnsl -ldl
357# This hardcodes in the executable programs the directory to find
358# libnspr.so etc. at program startup. Equivalent to the -R or -rpath
359# option for ld on other platforms.
360 export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
361endif
362
363ifeq ($(OS_ARCH), NEXTSTEP)
364# [email protected]: linkage is done in a different pass in the `tests'
365# modeul, so we have to pass the `-posix' flag by "hand" to `ld'
366LDOPTS += -posix
367endif
368
369ifeq ($(OS_ARCH), NEWS-OS)
370# This hardcodes in the executable programs the directory to find
371# libnspr.so etc. at program startup. Equivalent to the -R or -rpath
372# option for ld on other platforms.
373#export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
374 LIBNSPR = $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).a
375 LIBPLC = $(dist_libdir)/libplc$(MOD_MAJOR_VERSION).a
376 EXTRA_LIBS = -lsocket -lnsl -lgen -lresolv
377endif
378
379ifeq ($(OS_ARCH), Linux)
380 ifeq ($(OS_RELEASE), 1.2)
381 EXTRA_LIBS = -ldl
382 else
383 LDOPTS += -Xlinker -rpath $(ABSOLUTE_LIB_DIR)
384 ifeq ($(USE_PTHREADS),1)
385 EXTRA_LIBS = -lpthread
386 endif
387 endif
388endif
389
390ifeq ($(OS_ARCH), SCOOS)
391# SCO Unix needs to link against -lsocket again even though we
392# already linked with these system libraries when we built libnspr.so.
393EXTRA_LIBS = -lsocket
394# This hardcodes in the executable programs the directory to find
395# libnspr.so etc. at program startup. Equivalent to the -R or -rpath
396# option for ld on other platforms.
397export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
398endif
399
400ifeq ($(OS_ARCH),SINIX)
401EXTRA_LIBS = -lsocket -lnsl -lresolv -ldl
402# This hardcodes in the executable programs the directory to find
403# libnspr.so etc. at program startup. Equivalent to the -R or -rpath
404# option for ld on other platforms.
405export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
406endif
407
408ifeq ($(OS_ARCH),OpenUNIX)
409export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
410ifeq ($(USE_PTHREADS),1)
411LDOPTS += -pthread
412endif
413endif
414
415ifeq ($(OS_ARCH), UNIXWARE)
416export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
417endif
418
419ifeq ($(OS_ARCH),FreeBSD)
420ifeq ($(USE_PTHREADS),1)
421LDOPTS += -pthread
422endif
423LDOPTS += -Xlinker -R $(ABSOLUTE_LIB_DIR)
424endif
425
426ifeq ($(OS_ARCH),OpenBSD)
427ifeq ($(USE_PTHREADS),1)
428LDOPTS += -pthread
429endif
430endif
431
432ifeq ($(OS_ARCH),BSD_OS)
433ifneq ($(OS_RELEASE),1.1)
434EXTRA_LIBS = -ldl
435endif
436endif
437
438ifeq ($(USE_PTHREADS),1)
439LIBPTHREAD = -lpthread
440ifeq ($(OS_ARCH),AIX)
441LIBPTHREAD = -lpthreads
442endif
443ifeq (,$(filter-out FreeBSD OpenBSD BSD_OS QNX Darwin OpenUNIX,$(OS_ARCH)))
444LIBPTHREAD =
445endif
446ifeq ($(OS_ARCH)$(basename $(OS_RELEASE)),HP-UXB.10)
447LIBPTHREAD = -ldce
448endif
449endif
450
451
452#####################################################
453#
454# The rules
455#
456#####################################################
457
458include $(topsrcdir)/config/rules.mk
459
460AIX_PRE_4_2 = 0
461ifeq ($(OS_ARCH),AIX)
462ifeq ($(OS_RELEASE),4.1)
463ifneq ($(USE_PTHREADS), 1)
464#AIX_PRE_4_2 = 1
465endif
466endif
467endif
468
469ifeq ($(AIX_PRE_4_2),1)
470
471# AIX releases prior to 4.2 need a special two-step linking hack
472# in order to both override the system select() and be able to
473# get at the original system select().
474#
475# We use a pattern rule in ns/nspr20/config/rules.mk to generate
476# the .$(OBJ_SUFFIX) file from the .c source file, then do the
477# two-step linking hack below.
478
479$(OBJDIR)/%: $(OBJDIR)/%.$(OBJ_SUFFIX)
480 @$(MAKE_OBJDIR)
481 rm -f $@ $(AIX_TMP)
482 $(CC) $(AIX_LINK_OPTS) -o $(AIX_TMP) $< $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).a
483 $(CC) -o $@ $(AIX_TMP) $(AIX_WRAP)
484 rm -f $(AIX_TMP)
485
486else
487
488# All platforms that are not AIX pre-4.2.
489
490$(OBJDIR)/%$(PROG_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX)
491 @$(MAKE_OBJDIR)
492ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
493 link $(LDOPTS) $(EXTRA_LDOPTS) $< $(LIBPLC) $(LIBNSPR) $(EXTRA_LIBS) -out:$@
494else
495ifeq ($(MOZ_OS2_TOOLS),VACPP)
496 $(LD) $(EXEFLAGS) $(LDOPTS) $< $(LIBPLC) $(LIBNSPR) $(OS_LIBS) $(EXTRA_LIBS)
497else
498 $(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(EXTRA_LIBS) -o $@
499endif # OS/2
500endif # WINNT
501endif # AIX_PRE_4_2
502
503export:: $(TARGETS)
504clean::
505 rm -f $(TARGETS)
506
507# The following tests call BSD socket functions, so they need to link
508# with -lsocket on some platforms.
509ifeq ($(OS_ARCH),SunOS)
510ifneq ($(OS_RELEASE),4.1.3_U1)
511ifeq ($(USE_IPV6),1)
512$(OBJDIR)/gethost: $(OBJDIR)/gethost.o
513 $(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) -lsocket $(EXTRA_LIBS) -o $@
514endif
515$(OBJDIR)/prpoll: $(OBJDIR)/prpoll.o
516 $(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) -lsocket $(EXTRA_LIBS) -o $@
517endif
518endif
519
520ifeq ($(USE_PTHREADS), 1)
521$(OBJDIR)/attach: $(OBJDIR)/attach.o
522 $(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
523$(OBJDIR)/foreign: $(OBJDIR)/foreign.o
524 $(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
525$(OBJDIR)/provider: $(OBJDIR)/provider.o
526 $(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
527$(OBJDIR)/socket: $(OBJDIR)/socket.o
528 $(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
529$(OBJDIR)/testfile: $(OBJDIR)/testfile.o
530 $(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
531endif
532
533#
534# Run the test programs with no arguments
535#
536# Test output goes to the file pointed to by the environment variable
537# NSPR_TEST_LOGFILE, if set, else to /dev/null
538#
539ECHO = echo
540PROGRAMS = $(notdir $(PROGS))
541ifdef NSPR_TEST_LOGFILE
542LOGFILE = $(NSPR_TEST_LOGFILE)
543else
544ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
545LOGFILE = nul
546else
547LOGFILE = /dev/null
548endif
549endif
550
551ifeq ($(OS_TARGET),Linux)
552ECHO = /bin/echo
553endif
554
555ALWAYS:
556
557runtests:: $(PROGS) ALWAYS
558 @$(ECHO) "\nNSPR Test Results - $(OBJDIR)\n"
559 @$(ECHO) "BEGIN\t\t\t`date`"
560 @$(ECHO) "NSPR_TEST_LOGFILE\t$(LOGFILE)\n"
561 @$(ECHO) "Test\t\t\tResult\n"
562 @cd $(OBJDIR); for i in $(PROGRAMS); do \
563 $(ECHO) "$$i\c"; \
564 ./$$i >> $(LOGFILE) 2>&1 ; \
565 if [ 0 = $$? ] ; then \
566 $(ECHO) "\t\t\tPassed"; \
567 else \
568 $(ECHO) "\t\t\tFAILED"; \
569 fi; \
570 done
571 @$(ECHO) "\nEND\t\t`date`\n"
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette