~ubuntu-branches/ubuntu/gutsy/virtualbox-ose/gutsy

« back to all changes in this revision

Viewing changes to src/libs/xpcom18a4/nsprpub/pr/src/cplus/tests/Makefile.in

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kowalik
  • Date: 2007-09-08 16:44:58 UTC
  • Revision ID: james.westby@ubuntu.com-20070908164458-wao29470vqtr8ksy
Tags: upstream-1.5.0-dfsg2
ImportĀ upstreamĀ versionĀ 1.5.0-dfsg2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
41
MOD_DEPTH       = ../../../..
 
42
topsrcdir       = @top_srcdir@
 
43
srcdir          = @srcdir@
 
44
VPATH           = @srcdir@
 
45
 
 
46
include $(MOD_DEPTH)/config/autoconf.mk
 
47
 
 
48
include $(topsrcdir)/config/config.mk
 
49
 
 
50
ifeq ($(OS_TARGET), WIN16)
 
51
OS_CFLAGS = $(OS_EXE_CFLAGS)
 
52
endif
 
53
 
 
54
CXXSRCS =           \
 
55
        ranfile.cpp     \
 
56
        thread.cpp      \
 
57
        interval.cpp    \
 
58
        time.cpp        \
 
59
        fileio.cpp      \
 
60
        switch.cpp      \
 
61
        tpd.cpp         \
 
62
        $(NULL)
 
63
 
 
64
OBJS = $(addprefix $(OBJDIR)/,$(CXXSRCS:.cpp=.$(OBJ_SUFFIX)))
 
65
 
 
66
ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
 
67
PROG_SUFFIX = .exe
 
68
else
 
69
PROG_SUFFIX =
 
70
endif
 
71
 
 
72
PROGS = $(addprefix $(OBJDIR)/, $(CXXSRCS:.cpp=$(PROG_SUFFIX)))
 
73
 
 
74
TARGETS = $(PROGS) $(OBJS)
 
75
 
 
76
INCLUDES = -I.. -I$(dist_includedir)
 
77
 
 
78
# Setting the variables LDOPTS and LIBPR.  We first initialize
 
79
# them to the default values, then adjust them for some platforms.
 
80
LDOPTS = -L$(dist_libdir)
 
81
LIBPR = -lnspr$(MOD_MAJOR_VERSION)
 
82
LIBPL = -lplc$(MOD_MAJOR_VERSION)
 
83
 
 
84
ifeq ($(OS_ARCH), IRIX)
 
85
    LDOPTS += -rpath $(PWD)/$(dist_libdir) -rdata_shared
 
86
    # For 6.x machines, include this flag
 
87
    ifeq ($(basename $(OS_RELEASE)),6)
 
88
        ifeq ($(USE_N32),1)
 
89
            LDOPTS += -n32
 
90
        else
 
91
            LDOPTS += -32
 
92
        endif
 
93
 
 
94
        ifeq ($(USE_PTHREADS), 1)
 
95
            ifeq ($(OS_RELEASE), 6.2)
 
96
                LDOPTS += -Wl,-woff,85
 
97
            endif
 
98
        endif
 
99
    endif
 
100
endif
 
101
 
 
102
# Solaris
 
103
ifeq ($(OS_ARCH), SunOS)
 
104
    ifneq ($(OS_RELEASE), 4.1.3_U1)
 
105
        ifdef NS_USE_GCC
 
106
            LDOPTS += -Xlinker -R -Xlinker $(PWD)/$(dist_libdir)
 
107
        else
 
108
            LDOPTS += -R $(PWD)/$(dist_libdir)
 
109
        endif
 
110
    endif
 
111
 
 
112
    ifneq ($(LOCAL_THREADS_ONLY),1)
 
113
# SunOS 5.4 and 5.5 need to link with -lthread or -lpthread,
 
114
# even though we already linked with these system libraries
 
115
# when we built libnspr.so.
 
116
        ifeq ($(OS_RELEASE), 5.4)
 
117
            EXTRA_LIBS = -lthread
 
118
        endif
 
119
 
 
120
        ifeq ($(OS_RELEASE), 5.5)
 
121
            ifdef USE_PTHREADS
 
122
                EXTRA_LIBS = -lpthread
 
123
            else
 
124
                EXTRA_LIBS = -lthread
 
125
            endif
 
126
        endif
 
127
    endif # LOCAL_THREADS_ONLY
 
128
endif # SunOS
 
129
 
 
130
ifeq ($(OS_ARCH), WINNT)
 
131
ifeq ($(OS_TARGET), WIN16)
 
132
  LIBPR = $(dist_libdir)/nspr$(MOD_MAJOR_VERSION).lib
 
133
  LIBPL = $(dist_libdir)/plc$(MOD_MAJOR_VERSION).lib
 
134
else
 
135
  LDOPTS = -NOLOGO -DEBUG -DEBUGTYPE:CV -INCREMENTAL:NO
 
136
  LIBPR = $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
 
137
  LIBPL = $(dist_libdir)/libplc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
 
138
endif
 
139
endif
 
140
 
 
141
ifeq ($(OS_ARCH),OS2)
 
142
  ifeq ($(MOZ_OS2_TOOLS),VACPP)
 
143
    LDOPTS = -NOE -DEBUG -nologo -PMTYPE:VIO
 
144
    LIBPR = $(dist_libdir)/nspr$(MOD_MAJOR_VERSION).lib
 
145
    LIBPLC = $(dist_libdir)/plc$(MOD_MAJOR_VERSION).lib
 
146
  else
 
147
    LDOPTS += -Zomf -Zlinker /PM:VIO -lstdcpp
 
148
  endif
 
149
endif
 
150
 
 
151
ifneq ($(OS_ARCH), WINNT)
 
152
PWD = $(shell pwd)
 
153
endif
 
154
 
 
155
ifeq ($(OS_ARCH), OSF1)
 
156
LDOPTS += -rpath $(PWD)/$(dist_libdir)
 
157
endif
 
158
 
 
159
ifeq ($(OS_ARCH), HP-UX)
 
160
    LDOPTS += -Wl,+s,+b,$(PWD)/$(dist_libdir)
 
161
endif
 
162
 
 
163
# AIX
 
164
ifeq ($(OS_ARCH),AIX)
 
165
    LDOPTS += -blibpath:$(PWD)/$(dist_libdir):/usr/lib:/lib
 
166
    ifeq ($(OS_ARCH)$(OS_RELEASE),AIX4.1)
 
167
        LIBPR = -lnspr$(MOD_MAJOR_VERSION)_shr
 
168
        LIBPLC = -lplc$(MOD_MAJOR_VERSION)_shr
 
169
    else
 
170
        LDOPTS += -brtl
 
171
        EXTRA_LIBS = -ldl
 
172
    endif
 
173
endif
 
174
 
 
175
ifeq ($(OS_ARCH), Linux)
 
176
    ifeq ($(OS_RELEASE), 1.2)
 
177
        EXTRA_LIBS = -ldl
 
178
    else
 
179
        LDOPTS += -Xlinker -rpath $(PWD)/$(dist_libdir)
 
180
        ifeq ($(USE_PTHREADS),1)
 
181
            EXTRA_LIBS = -lpthread
 
182
        endif
 
183
    endif
 
184
endif
 
185
 
 
186
ifeq ($(OS_ARCH), NCR)
 
187
# XXX: We see some strange problems when we link with libnspr.so.
 
188
# So for now we use static libraries on NCR.  The shared library
 
189
# stuff below is commented out.
 
190
LIBPR = $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).a
 
191
LIBPL = $(dist_libdir)/libplc$(MOD_MAJOR_VERSION).a
 
192
EXTRA_LIBS = -lsocket -lnsl -ldl
 
193
 
 
194
# NCR needs to link against -lsocket -lnsl (and -lc, which is linked
 
195
# implicitly by $(CC)) again even though we already linked with these
 
196
# system libraries when we built libnspr.so.
 
197
#EXTRA_LIBS = -lsocket -lnsl
 
198
# This hardcodes in the executable programs the directory to find
 
199
# libnspr.so etc. at program startup.  Equivalent to the -R or -rpath 
 
200
# option for ld on other platforms.
 
201
#export LD_RUN_PATH = $(PWD)/$(dist_libdir)
 
202
endif
 
203
 
 
204
ifeq ($(OS_ARCH), SCO_SV)
 
205
# SCO Unix needs to link against -lsocket again even though we
 
206
# already linked with these system libraries when we built libnspr.so.
 
207
EXTRA_LIBS = -lsocket
 
208
# This hardcodes in the executable programs the directory to find
 
209
# libnspr.so etc. at program startup.  Equivalent to the -R or -rpath
 
210
# option for ld on other platforms.
 
211
export LD_RUN_PATH = $(PWD)/$(dist_libdir)
 
212
endif
 
213
 
 
214
ifeq ($(OS_ARCH), UNIXWARE)
 
215
export LD_RUN_PATH = $(PWD)/$(dist_libdir)
 
216
endif
 
217
 
 
218
#####################################################
 
219
#
 
220
# The rules
 
221
#
 
222
#####################################################
 
223
 
 
224
include $(topsrcdir)/config/rules.mk
 
225
 
 
226
AIX_PRE_4_2 = 0
 
227
ifeq ($(OS_ARCH),AIX)
 
228
ifneq ($(OS_RELEASE),4.2)
 
229
ifneq ($(USE_PTHREADS), 1)
 
230
#AIX_PRE_4_2 = 1
 
231
endif
 
232
endif
 
233
endif
 
234
 
 
235
ifeq ($(AIX_PRE_4_2),1)
 
236
 
 
237
# AIX releases prior to 4.2 need a special two-step linking hack
 
238
# in order to both override the system select() and be able to 
 
239
# get at the original system select().
 
240
#
 
241
# We use a pattern rule in ns/nspr20/config/rules.mk to generate
 
242
# the .$(OBJ_SUFFIX) file from the .c source file, then do the
 
243
# two-step linking hack below.
 
244
 
 
245
$(OBJDIR)/%: $(OBJDIR)/%.$(OBJ_SUFFIX)
 
246
        @$(MAKE_OBJDIR)
 
247
        rm -f $@ $(AIX_TMP)
 
248
        $(CC) $(AIX_LINK_OPTS) -o $(AIX_TMP) $< $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).a
 
249
        $(CC) -o $@ $(AIX_TMP) $(AIX_WRAP)
 
250
        rm -f $(AIX_TMP)
 
251
 
 
252
else
 
253
 
 
254
# All platforms that are not AIX pre-4.2.
 
255
 
 
256
$(OBJDIR)/%$(PROG_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX)
 
257
        @$(MAKE_OBJDIR)
 
258
ifeq ($(OS_ARCH), WINNT)
 
259
ifeq ($(OS_TARGET),WIN16)
 
260
        echo system windows         >w16link
 
261
        echo option map             >>w16link
 
262
        echo option stack=10K       >>w16link
 
263
        echo option heapsize=32K    >>w16link
 
264
        echo debug $(DEBUGTYPE) all >>w16link
 
265
        echo name $@                >>w16link
 
266
        echo file                   >>w16link
 
267
        echo $<                     >>w16link
 
268
        echo library                >>w16link
 
269
        echo $(LIBPR),              >>w16link
 
270
        echo $(LIBPL),              >>w16link
 
271
        echo winsock.lib            >>w16link
 
272
        wlink @w16link.
 
273
else
 
274
        link $(LDOPTS) $< $(LIBPR) $(LIBPL) wsock32.lib -out:$@
 
275
endif
 
276
else
 
277
ifeq ($(OS_ARCH),OS2)
 
278
        $(LINK) $(LDOPTS) $< $(LIBGC) $(LIBPLC) $(LIBPR) $(OS_LIBS) $(EXTRA_LIBS) -o $@
 
279
else
 
280
        $(CCC) $(XCFLAGS) $< $(LDOPTS) $(LIBPR) $(LIBPL) $(EXTRA_LIBS) -o $@
 
281
endif
 
282
endif
 
283
endif
 
284
 
 
285
export:: $(TARGETS)
 
286
clean::
 
287
        rm -f $(TARGETS)
 
288