Bug 462294 - Add "View Video" to context menu for <video> elements. r=gavin, ui...
[wine-gecko.git] / nsprpub / pr / tests / Makefile.in
blobc55acf23339b64c442ab3f1738cb1d41a0559a79
1 #
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
13 # License.
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.
22 # Contributor(s):
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 *****
39 #! gmake
41 MOD_DEPTH = ../..
42 topsrcdir = @top_srcdir@
43 srcdir = @srcdir@
44 VPATH = @srcdir@
46 include $(MOD_DEPTH)/config/autoconf.mk
48 include $(topsrcdir)/config/config.mk
50 DIRS = dll
52 CSRCS = \
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)
206 ifeq ($(OS_TARGET),OS2)
207 CSRCS += \
208 sleep.c \
209 stat.c \
210 yield.c \
211 $(NULL)
212 endif
214 ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
215 PROG_SUFFIX = .exe
216 else
217 PROG_SUFFIX =
218 endif
220 PROGS = $(addprefix $(OBJDIR)/, $(CSRCS:.c=$(PROG_SUFFIX)))
222 TARGETS = $(PROGS)
224 INCLUDES = -I$(dist_includedir) -I$(topsrcdir)/pr/include -I$(topsrcdir)/pr/include/private
226 ifeq ($(OS_ARCH), WINNT)
227 ifdef NS_USE_GCC
228 EXTRA_LIBS += -lwsock32
229 else
230 EXTRA_LIBS += wsock32.lib
231 LDOPTS = -NOLOGO -DEBUG -DEBUGTYPE:CV -INCREMENTAL:NO
232 ifdef PROFILE
233 LDOPTS += -PROFILE -MAP
234 endif # profile
235 endif # NS_USE_GCC
236 endif
238 ifeq ($(OS_ARCH),OS2)
239 EXTRA_LIBS = $(OS_LIBS)
240 LDOPTS = -Zomf -Zlinker /PM:VIO -Zlinker /ST:0x64000
241 endif
243 ifneq ($(OS_ARCH), WINNT)
244 # Use an absolute pathname as the runtime library path (for the -R
245 # or -rpath linker option or the LD_RUN_PATH environment variable).
246 ifeq (,$(patsubst /%,,$(DIST)))
247 # $(DIST) is already an absolute pathname.
248 ABSOLUTE_LIB_DIR = $(dist_libdir)
249 else
250 # $(DIST) is a relative pathname: prepend the current directory.
251 PWD = $(shell pwd)
252 ABSOLUTE_LIB_DIR = $(PWD)/$(dist_libdir)
253 endif
254 endif
256 ifeq ($(OS_ARCH), IRIX)
257 ifeq ($(USE_CPLUS), 1)
258 CC = CC
259 endif
260 LDOPTS += -rpath $(ABSOLUTE_LIB_DIR)
261 ifdef NS_USE_GCC
262 LDOPTS += -Wl,-rdata_shared
263 else
264 LDOPTS += -rdata_shared
265 endif
266 # For 6.x machines, include this flag
267 ifeq ($(basename $(OS_RELEASE)),6)
268 ifndef NS_USE_GCC
269 ifeq ($(USE_N32),1)
270 LDOPTS += -n32
271 else
272 LDOPTS += -32
273 endif
275 ifeq ($(USE_PTHREADS), 1)
276 ifeq ($(OS_RELEASE), 6.2)
277 LDOPTS += -Wl,-woff,85
278 endif
279 endif
280 endif
281 endif
282 endif
284 ifeq ($(OS_ARCH), OSF1)
285 ifeq ($(USE_CPLUS), 1)
286 CC = cxx
287 endif
288 # I haven't figured out how to pass -rpath to cc on OSF1 V3.2, so
289 # we do static linking.
290 ifeq (,$(filter-out V2.0 V3.2,$(OS_RELEASE)))
291 LIBNSPR = $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).a
292 LIBPLC = $(dist_libdir)/libplc$(MOD_MAJOR_VERSION).a
293 EXTRA_LIBS = -lc_r
294 else
295 LDOPTS += -rpath $(ABSOLUTE_LIB_DIR)
296 endif
297 endif
299 ifeq ($(OS_ARCH), HP-UX)
300 LDOPTS += -z -Wl,+s,+b,$(ABSOLUTE_LIB_DIR)
301 ifeq ($(USE_64),1)
302 LDOPTS += +DD64
303 endif
304 ifeq ($(USE_PTHREADS),1)
305 EXTRA_LIBS = $(LIBPTHREAD)
306 endif
307 endif
309 # AIX
310 ifeq ($(OS_ARCH),AIX)
311 LDOPTS += -blibpath:$(ABSOLUTE_LIB_DIR):/usr/lib:/lib
312 ifneq ($(OS_ARCH)$(OS_RELEASE),AIX4.1)
313 LDOPTS += -brtl
314 EXTRA_LIBS = -ldl
315 endif
316 endif
318 # Solaris
319 ifeq ($(OS_ARCH), SunOS)
320 ifneq ($(OS_RELEASE), 4.1.3_U1)
321 ifdef NS_USE_GCC
322 LDOPTS += -Xlinker -R -Xlinker $(ABSOLUTE_LIB_DIR)
323 else
324 ifeq ($(USE_CPLUS), 1)
325 CC = CC
326 endif
327 LDOPTS += -R $(ABSOLUTE_LIB_DIR)
328 endif
329 endif
331 ifdef USE_PTHREADS
332 EXTRA_LIBS = -lpthread
333 endif
334 endif # SunOS
336 ifeq ($(OS_ARCH), NEC)
337 EXTRA_LIBS = $(OS_LIBS)
338 # This hardcodes in the executable programs the directory to find
339 # libnspr.so etc. at program startup. Equivalent to the -R or -rpath
340 # option for ld on other platforms.
341 export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
342 endif
344 ifeq ($(OS_ARCH), NCR)
345 # NCR needs to link against -lsocket -lnsl -ldl (and -lc, which is
346 # linked implicitly by $(CC)). Note that we did not link with these
347 # system libraries when we built libnspr.so.
348 EXTRA_LIBS = -lsocket -lnsl -ldl
349 # This hardcodes in the executable programs the directory to find
350 # libnspr.so etc. at program startup. Equivalent to the -R or -rpath
351 # option for ld on other platforms.
352 export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
353 endif
355 ifeq ($(OS_ARCH), NEXTSTEP)
356 # balazs.pataki@sztaki.hu: linkage is done in a different pass in the `tests'
357 # modeul, so we have to pass the `-posix' flag by "hand" to `ld'
358 LDOPTS += -posix
359 endif
361 ifeq ($(OS_ARCH), NEWS-OS)
362 # This hardcodes in the executable programs the directory to find
363 # libnspr.so etc. at program startup. Equivalent to the -R or -rpath
364 # option for ld on other platforms.
365 #export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
366 LIBNSPR = $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).a
367 LIBPLC = $(dist_libdir)/libplc$(MOD_MAJOR_VERSION).a
368 EXTRA_LIBS = -lsocket -lnsl -lgen -lresolv
369 endif
371 ifeq (,$(filter-out Linux GNU GNU_%,$(OS_ARCH)))
372 LDOPTS += -Xlinker -rpath $(ABSOLUTE_LIB_DIR)
373 ifeq ($(USE_PTHREADS),1)
374 EXTRA_LIBS = -lpthread
375 endif
376 endif
378 ifeq ($(OS_ARCH), SCOOS)
379 # SCO Unix needs to link against -lsocket again even though we
380 # already linked with these system libraries when we built libnspr.so.
381 EXTRA_LIBS = -lsocket
382 # This hardcodes in the executable programs the directory to find
383 # libnspr.so etc. at program startup. Equivalent to the -R or -rpath
384 # option for ld on other platforms.
385 export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
386 endif
388 ifeq ($(OS_ARCH),SINIX)
389 EXTRA_LIBS = -lsocket -lnsl -lresolv -ldl
390 # This hardcodes in the executable programs the directory to find
391 # libnspr.so etc. at program startup. Equivalent to the -R or -rpath
392 # option for ld on other platforms.
393 export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
394 endif
396 ifeq ($(OS_ARCH),OpenUNIX)
397 export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
398 ifeq ($(USE_PTHREADS),1)
399 LDOPTS += -pthread
400 endif
401 endif
403 ifeq ($(OS_ARCH), UNIXWARE)
404 export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
405 endif
407 ifeq ($(OS_ARCH),FreeBSD)
408 ifeq ($(USE_PTHREADS),1)
409 LDOPTS += -pthread
410 endif
411 LDOPTS += -Xlinker -R $(ABSOLUTE_LIB_DIR)
412 endif
414 ifeq ($(OS_ARCH),OpenBSD)
415 ifeq ($(USE_PTHREADS),1)
416 LDOPTS += -pthread
417 endif
418 endif
420 ifeq ($(OS_ARCH),BSD_OS)
421 ifneq ($(OS_RELEASE),1.1)
422 EXTRA_LIBS = -ldl
423 endif
424 endif
426 ifeq ($(USE_PTHREADS),1)
427 LIBPTHREAD = -lpthread
428 ifeq ($(OS_ARCH),AIX)
429 LIBPTHREAD = -lpthreads
430 endif
431 ifeq (,$(filter-out FreeBSD OpenBSD BSD_OS QNX Darwin OpenUNIX,$(OS_ARCH)))
432 LIBPTHREAD =
433 endif
434 ifeq ($(OS_ARCH)$(basename $(OS_RELEASE)),HP-UXB.10)
435 LIBPTHREAD = -ldce
436 endif
437 endif
440 #####################################################
442 # The rules
444 #####################################################
446 include $(topsrcdir)/config/rules.mk
448 AIX_PRE_4_2 = 0
449 ifeq ($(OS_ARCH),AIX)
450 ifeq ($(OS_RELEASE),4.1)
451 ifneq ($(USE_PTHREADS), 1)
452 #AIX_PRE_4_2 = 1
453 endif
454 endif
455 endif
457 ifeq ($(AIX_PRE_4_2),1)
459 # AIX releases prior to 4.2 need a special two-step linking hack
460 # in order to both override the system select() and be able to
461 # get at the original system select().
463 # We use a pattern rule in ns/nspr20/config/rules.mk to generate
464 # the .$(OBJ_SUFFIX) file from the .c source file, then do the
465 # two-step linking hack below.
467 $(OBJDIR)/%: $(OBJDIR)/%.$(OBJ_SUFFIX)
468 @$(MAKE_OBJDIR)
469 rm -f $@ $(AIX_TMP)
470 $(CC) $(AIX_LINK_OPTS) -o $(AIX_TMP) $< $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).a
471 $(CC) -o $@ $(AIX_TMP) $(AIX_WRAP)
472 rm -f $(AIX_TMP)
474 else
476 # All platforms that are not AIX pre-4.2.
478 $(OBJDIR)/%$(PROG_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX)
479 @$(MAKE_OBJDIR)
480 ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
481 link $(LDOPTS) $(EXTRA_LDOPTS) $< $(LIBPLC) $(LIBNSPR) $(EXTRA_LIBS) -out:$@
482 ifdef MT
483 @if test -f $@.manifest; then \
484 $(MT) -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
485 rm -f $@.manifest; \
487 endif
488 else
489 $(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(EXTRA_LIBS) -o $@
490 endif # WINNT
491 endif # AIX_PRE_4_2
493 export:: $(TARGETS)
494 clean::
495 rm -f $(TARGETS)
497 # The following tests call BSD socket functions, so they need to link
498 # with -lsocket on some platforms.
499 ifeq ($(OS_ARCH),SunOS)
500 ifneq ($(OS_RELEASE),4.1.3_U1)
501 ifeq ($(USE_IPV6),1)
502 $(OBJDIR)/gethost: $(OBJDIR)/gethost.o
503 $(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) -lsocket $(EXTRA_LIBS) -o $@
504 endif
505 $(OBJDIR)/prpoll: $(OBJDIR)/prpoll.o
506 $(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) -lsocket $(EXTRA_LIBS) -o $@
507 endif
508 endif
510 ifeq ($(USE_PTHREADS), 1)
511 $(OBJDIR)/attach: $(OBJDIR)/attach.o
512 $(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
513 $(OBJDIR)/foreign: $(OBJDIR)/foreign.o
514 $(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
515 $(OBJDIR)/provider: $(OBJDIR)/provider.o
516 $(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
517 $(OBJDIR)/socket: $(OBJDIR)/socket.o
518 $(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
519 $(OBJDIR)/testfile: $(OBJDIR)/testfile.o
520 $(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
521 endif
524 # Run the test programs with no arguments
526 # Test output goes to the file pointed to by the environment variable
527 # NSPR_TEST_LOGFILE, if set, else to /dev/null
529 ECHO = echo
530 PROGRAMS = $(notdir $(PROGS))
531 ifdef NSPR_TEST_LOGFILE
532 LOGFILE = $(NSPR_TEST_LOGFILE)
533 else
534 ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
535 LOGFILE = nul
536 else
537 LOGFILE = /dev/null
538 endif
539 endif
541 ifeq ($(OS_TARGET),Linux)
542 ECHO = /bin/echo
543 endif
545 ALWAYS:
547 runtests:: $(PROGS) ALWAYS
548 @$(ECHO) "\nNSPR Test Results - $(OBJDIR)\n"
549 @$(ECHO) "BEGIN\t\t\t`date`"
550 @$(ECHO) "NSPR_TEST_LOGFILE\t$(LOGFILE)\n"
551 @$(ECHO) "Test\t\t\tResult\n"
552 @cd $(OBJDIR); for i in $(PROGRAMS); do \
553 $(ECHO) "$$i\c"; \
554 ./$$i >> $(LOGFILE) 2>&1 ; \
555 if [ 0 = $$? ] ; then \
556 $(ECHO) "\t\t\tPassed"; \
557 else \
558 $(ECHO) "\t\t\tFAILED"; \
559 fi; \
560 done
561 @$(ECHO) "\nEND\t\t`date`\n"