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