nspr: import 3.0 RC1 cutoff from CVS
[mozilla-nspr.git] / nsprpub / lib / prstreams / Makefile.in
bloba29af95d7095c2adb8a7178f8149e276e86ba834
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 *****
38 #! gmake
40 MOD_DEPTH = ../..
41 topsrcdir = @top_srcdir@
42 srcdir = @srcdir@
43 VPATH = @srcdir@
45 include $(MOD_DEPTH)/config/autoconf.mk
47 include $(topsrcdir)/config/config.mk
49 # Disable optimization of the nspr on SunOS4.1.3
50 ifeq ($(OS_ARCH),SunOS)
51 ifeq ($(OS_RELEASE),4.1.3_U1)
52 OPTIMIZER =
53 else
54 # The C++ compiler in Workshop 5.0 uses standard
55 # iostreams as default. -library=iostream will
56 # allow Workshop 5.0 to work with classic iostreams.
57 ifndef NS_USE_GCC
58 CCC_VERSION := $(shell $(CCC) -V 2>&1)
59 ifneq (,$(findstring 5.0,$(CCC_VERSION)))
60 CCC_ONLY_FLAGS += -library=iostream
61 endif
62 endif
63 endif
64 endif
66 ifeq ($(OS_ARCH), IRIX)
67 ifneq ($(OS_RELEASE),5.3)
68 CCC_ONLY_FLAGS += -exceptions
69 endif
70 endif
72 ifeq ($(OS_ARCH), BeOS)
73 CFLAGS += -frtti -fexceptions
74 endif
76 INCLUDES = -I$(dist_includedir)
78 HEADERS = $(wildcard $(srcdir)/*.h)
80 CSRCS = \
81 plvrsion.c \
82 $(NULL)
84 CXXSRCS = \
85 prstrms.cpp \
86 $(NULL)
88 OBJS = $(addprefix $(OBJDIR)/,$(CSRCS:.c=.$(OBJ_SUFFIX)) $(CXXSRCS:.cpp=.$(OBJ_SUFFIX)))
90 ifeq ($(OS_ARCH), WINNT)
91 RES=$(OBJDIR)/prstrms.res
92 RESNAME=prstrms.rc
93 OS_LIBS = user32.lib
94 else
95 ifeq ($(OS_ARCH),OS2)
96 ifneq ($(MOZ_OS2_TOOLS),VACPP)
97 OS_LIBS = -lstdcpp
98 endif
99 else
100 ifeq ($(OS_ARCH), AIX)
101 ifeq ($(OS_RELEASE), 4.1)
102 ifeq ($(CLASSIC_NSPR),1)
103 OS_LIBS += -lC -lc
104 else
105 OS_LIBS += -lC_r -lc_r
106 endif
107 else
108 # makeC++SharedLib(_r) is in either /usr/lpp/xlC/bin
109 # or /usr/ibmcxx/bin.
110 ifeq ($(CLASSIC_NSPR),1)
111 MKSHLIB = makeC++SharedLib -p 0
112 else
113 MKSHLIB = makeC++SharedLib_r -p 0
114 endif
115 OS_LIBS += -ldl
116 endif
117 endif
118 endif
119 endif
121 ifeq ($(OS_ARCH),BeOS)
122 OS_LIBS = -lstdc++.r4
123 endif
125 ifeq ($(OS_ARCH), UNIXWARE)
126 OS_LIBS += -lC
127 endif
129 EXTRA_LIBS = $(LIBNSPR)
131 # On NCR and SCOOS, we can't link with extra libraries when
132 # we build a shared library. If we do so, the linker doesn't
133 # complain, but we would run into weird problems at run-time.
134 # Therefore on these platforms, we link just the object files.
135 ifeq ($(OS_ARCH),NCR)
136 EXTRA_LIBS =
137 endif
138 ifeq ($(OS_ARCH),SCOOS)
139 EXTRA_LIBS =
140 endif
142 ifdef RESOLVE_LINK_SYMBOLS
143 EXTRA_LIBS += $(OS_LIBS)
144 endif
146 LIBRARY_NAME = prstrms
147 LIBRARY_VERSION = $(MOD_MAJOR_VERSION)
149 RELEASE_HEADERS = $(HEADERS)
150 RELEASE_HEADERS_DEST = $(RELEASE_INCLUDE_DIR)
151 RELEASE_LIBS = $(TARGETS)
153 include $(topsrcdir)/config/rules.mk
156 # Version information generation (begin)
158 ECHO = echo
159 TINC = $(OBJDIR)/_pl_bld.h
160 PROD = $(notdir $(SHARED_LIBRARY))
161 NOW = $(MOD_DEPTH)/config/$(OBJDIR)/now
162 SH_DATE = $(shell date "+%Y-%m-%d %T")
163 SH_NOW = $(shell $(NOW))
165 ifeq ($(OS_ARCH), WINNT)
166 SUF = i64
167 else
168 SUF = LL
169 endif
171 $(TINC):
172 @$(MAKE_OBJDIR)
173 @$(ECHO) '#define _BUILD_STRING "$(SH_DATE)"' > $(TINC)
174 @if test ! -z "$(SH_NOW)"; then \
175 $(ECHO) '#define _BUILD_TIME $(SH_NOW)$(SUF)' >> $(TINC); \
176 else \
177 true; \
179 @$(ECHO) '#define _PRODUCTION "$(PROD)"' >> $(TINC)
182 $(OBJDIR)/plvrsion.$(OBJ_SUFFIX): plvrsion.c $(TINC)
183 ifeq ($(OS_ARCH), WINNT)
184 $(CC) -o $@ -c $(CFLAGS) -I$(OBJDIR) $<
185 else
186 ifeq ($(MOZ_OS2_TOOLS), VACPP)
187 $(CC) -Fo$@ -c $(CFLAGS) -I$(OBJDIR) $<
188 else
189 $(CC) -o $@ -c $(CFLAGS) -I$(OBJDIR) $<
190 endif
191 endif
193 # Version information generation (end)
196 export:: $(TARGETS) $(HEADERS)
197 $(INSTALL) -m 444 $(HEADERS) $(dist_includedir)
198 $(INSTALL) -m 444 $(TARGETS) $(dist_libdir)
199 ifeq ($(OS_ARCH),OS2)
200 $(INSTALL) -m 444 $(TARGETS) $(dist_bindir)
201 endif
202 ifeq ($(OS_ARCH),HP-UX)
203 ifdef SHARED_LIBRARY
204 $(INSTALL) -m 755 $(SHARED_LIBRARY) $(dist_libdir)
205 endif
206 endif