nsprpub/pr/src/Makefile.in

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 #
michael@0 2 # This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 # License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
michael@0 5
michael@0 6 #! gmake
michael@0 7
michael@0 8 MOD_DEPTH = ../..
michael@0 9 topsrcdir = @top_srcdir@
michael@0 10 srcdir = @srcdir@
michael@0 11 VPATH = @srcdir@
michael@0 12
michael@0 13 include $(MOD_DEPTH)/config/autoconf.mk
michael@0 14
michael@0 15 include $(topsrcdir)/config/config.mk
michael@0 16
michael@0 17 DIRS = io linking malloc md memory misc threads
michael@0 18
michael@0 19 ifeq ($(USE_PTHREADS), 1)
michael@0 20 DIRS += pthreads
michael@0 21 endif
michael@0 22
michael@0 23 ifeq ($(USE_BTHREADS), 1)
michael@0 24 DIRS += bthreads
michael@0 25 endif
michael@0 26
michael@0 27 ifeq ($(USE_CPLUS), 1)
michael@0 28 DIRS += cplus
michael@0 29 endif
michael@0 30
michael@0 31 #
michael@0 32 # Define platform-dependent OS_LIBS
michael@0 33 #
michael@0 34
michael@0 35 ifeq ($(OS_ARCH),SunOS)
michael@0 36 MAPFILE = $(OBJDIR)/nsprmap.sun
michael@0 37 GARBAGE += $(MAPFILE)
michael@0 38 ifdef NS_USE_GCC
michael@0 39 ifdef GCC_USE_GNU_LD
michael@0 40 MKSHLIB += -Wl,--version-script,$(MAPFILE)
michael@0 41 else
michael@0 42 MKSHLIB += -Wl,-M,$(MAPFILE)
michael@0 43 endif
michael@0 44 else
michael@0 45 MKSHLIB += -M $(MAPFILE)
michael@0 46 endif
michael@0 47 #
michael@0 48 # In Solaris 2.6 or earlier, -lrt is called -lposix4.
michael@0 49 #
michael@0 50 LIBRT_TEST=$(firstword $(sort 5.7 $(OS_RELEASE)))
michael@0 51 ifeq (5.7, $(LIBRT_TEST))
michael@0 52 LIBRT=-lrt
michael@0 53 else
michael@0 54 LIBRT=-lposix4
michael@0 55 endif
michael@0 56
michael@0 57 ifdef USE_PTHREADS
michael@0 58 OS_LIBS = -lpthread ${LIBRT} -lsocket -lnsl -ldl -lc
michael@0 59 else
michael@0 60 OS_LIBS = -lsocket -lnsl -ldl -lc
michael@0 61 endif # USE_PTHREADS
michael@0 62 ifeq ($(CPU_ARCH),sparc)
michael@0 63 ifndef USE_64
michael@0 64 DSO_LDOPTS += -Wl,-f,\$$ORIGIN/cpu/\$$ISALIST/lib$(ULTRASPARC_LIBRARY)$(LIBRARY_VERSION).so
michael@0 65 endif
michael@0 66 endif # sparc
michael@0 67 endif # SunOS
michael@0 68
michael@0 69 ifeq ($(OS_ARCH), IRIX)
michael@0 70 ifeq ($(USE_PTHREADS), 1)
michael@0 71 OS_LIBS = -lpthread
michael@0 72 endif
michael@0 73 OS_LIBS += -lc
michael@0 74 endif
michael@0 75
michael@0 76 ifeq ($(OS_ARCH),AIX)
michael@0 77 DSO_LDOPTS += -binitfini::_PR_Fini
michael@0 78 OS_LIBS = -lodm -lcfg
michael@0 79 ifeq ($(CLASSIC_NSPR),1)
michael@0 80 ifeq ($(OS_RELEASE),4.1)
michael@0 81 OS_LIBS += -lsvld -lc
michael@0 82 else
michael@0 83 OS_LIBS += -ldl -lc
michael@0 84 endif
michael@0 85 else
michael@0 86 ifeq ($(OS_RELEASE),4.1)
michael@0 87 OS_LIBS += -lpthreads -lsvld -lC_r -lC -lc_r -lm /usr/lib/libc.a
michael@0 88 else
michael@0 89 OS_LIBS += -lpthreads -ldl -lC_r -lC -lc_r -lm /usr/lib/libc.a
michael@0 90 endif
michael@0 91 endif
michael@0 92 endif
michael@0 93
michael@0 94 # On AIX, we override malloc in non-pthread versions. On AIX 4.2 or
michael@0 95 # above, this requires that we use the rtl-enabled version of libc.a.
michael@0 96 ifeq ($(OS_ARCH),AIX)
michael@0 97 ifneq (,$(filter-out 3.2 4.1,$(OS_RELEASE)))
michael@0 98 ifneq ($(USE_PTHREADS),1)
michael@0 99 BUILD_AIX_RTL_LIBC = 1
michael@0 100 AIX_RTL_LIBC = $(OBJDIR)/libc.a
michael@0 101 endif
michael@0 102 endif
michael@0 103 endif
michael@0 104
michael@0 105 ifeq ($(OS_ARCH),OS2)
michael@0 106 MAPFILE = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).def
michael@0 107 ADD_TO_DEF_FILE = cat $(srcdir)/os2extra.def >> $(MAPFILE)
michael@0 108 GARBAGE += $(MAPFILE)
michael@0 109 MKSHLIB += $(MAPFILE)
michael@0 110 endif
michael@0 111
michael@0 112 ifeq ($(OS_ARCH),OSF1)
michael@0 113 ifeq ($(USE_PTHREADS), 1)
michael@0 114 OS_LIBS = -lpthread -lrt
michael@0 115 endif
michael@0 116 ifneq ($(OS_RELEASE),V2.0)
michael@0 117 OS_LIBS += -lc_r
michael@0 118 endif
michael@0 119 endif
michael@0 120
michael@0 121 # Linux, GNU/Hurd, and GNU/kFreeBSD systems
michael@0 122 ifneq (,$(filter Linux GNU%,$(OS_ARCH)))
michael@0 123 ifeq ($(USE_PTHREADS), 1)
michael@0 124 ifeq ($(OS_TARGET),Android)
michael@0 125 # Android has no libpthread.so in NDK
michael@0 126 OS_LIBS = -ldl
michael@0 127 else
michael@0 128 OS_LIBS = -lpthread -ldl
michael@0 129 endif
michael@0 130 else
michael@0 131 OS_LIBS = -ldl
michael@0 132 endif
michael@0 133 ifneq ($(OS_TARGET),Android)
michael@0 134 # Android has no librt - realtime functions are in libc
michael@0 135 OS_LIBS += -lrt
michael@0 136 endif
michael@0 137 endif
michael@0 138
michael@0 139 ifeq ($(OS_ARCH),HP-UX)
michael@0 140 ifeq ($(USE_PTHREADS), 1)
michael@0 141 ifeq (,$(filter-out B.10.10 B.10.20,$(OS_RELEASE)))
michael@0 142 OS_LIBS = -ldce
michael@0 143 else
michael@0 144 OS_LIBS = -lpthread -lrt
michael@0 145 endif
michael@0 146 endif
michael@0 147 ifeq ($(PTHREADS_USER), 1)
michael@0 148 OS_LIBS = -lpthread
michael@0 149 endif
michael@0 150 ifeq ($(basename $(OS_RELEASE)),A.09)
michael@0 151 OS_LIBS += -ldld -L/lib/pa1.1 -lm
michael@0 152 else
michael@0 153 OS_LIBS += -ldld -lm -lc
michael@0 154 endif
michael@0 155 ifneq ($(OS_TEST),ia64)
michael@0 156 ifndef USE_64
michael@0 157 DSO_LDOPTS += +I PR_HPUX10xInit
michael@0 158 endif
michael@0 159 endif
michael@0 160 endif
michael@0 161
michael@0 162 ifeq ($(OS_ARCH),UNIXWARE)
michael@0 163 OS_LIBS = -lsocket -lc
michael@0 164 endif
michael@0 165
michael@0 166 ifeq ($(OS_ARCH),WINNT)
michael@0 167 ifdef NS_USE_GCC
michael@0 168 OS_LIBS = -ladvapi32 -lws2_32 -lwinmm
michael@0 169 else
michael@0 170 OS_LIBS = advapi32.lib ws2_32.lib winmm.lib
michael@0 171 endif
michael@0 172 endif
michael@0 173
michael@0 174 ifeq ($(OS_ARCH),WINCE)
michael@0 175 OS_LIBS = ws2.lib
michael@0 176 endif
michael@0 177
michael@0 178 ifeq ($(OS_TARGET),Android)
michael@0 179 OS_LIBS += -llog
michael@0 180 endif
michael@0 181
michael@0 182 ifeq ($(OS_TARGET),MacOSX)
michael@0 183 OS_LIBS = -framework CoreServices -framework CoreFoundation
michael@0 184 endif
michael@0 185
michael@0 186 EXTRA_LIBS += $(OS_LIBS)
michael@0 187
michael@0 188 #
michael@0 189 # Define platform-dependent OBJS
michael@0 190 #
michael@0 191
michael@0 192 OBJS = \
michael@0 193 $(OBJDIR)/prvrsion.$(OBJ_SUFFIX) \
michael@0 194 io/$(OBJDIR)/prfdcach.$(OBJ_SUFFIX) \
michael@0 195 io/$(OBJDIR)/prmwait.$(OBJ_SUFFIX) \
michael@0 196 io/$(OBJDIR)/prmapopt.$(OBJ_SUFFIX) \
michael@0 197 io/$(OBJDIR)/priometh.$(OBJ_SUFFIX) \
michael@0 198 io/$(OBJDIR)/pripv6.$(OBJ_SUFFIX) \
michael@0 199 io/$(OBJDIR)/prlayer.$(OBJ_SUFFIX) \
michael@0 200 io/$(OBJDIR)/prlog.$(OBJ_SUFFIX) \
michael@0 201 io/$(OBJDIR)/prmmap.$(OBJ_SUFFIX) \
michael@0 202 io/$(OBJDIR)/prpolevt.$(OBJ_SUFFIX) \
michael@0 203 io/$(OBJDIR)/prprf.$(OBJ_SUFFIX) \
michael@0 204 io/$(OBJDIR)/prscanf.$(OBJ_SUFFIX) \
michael@0 205 io/$(OBJDIR)/prstdio.$(OBJ_SUFFIX) \
michael@0 206 threads/$(OBJDIR)/prcmon.$(OBJ_SUFFIX) \
michael@0 207 threads/$(OBJDIR)/prrwlock.$(OBJ_SUFFIX) \
michael@0 208 threads/$(OBJDIR)/prtpd.$(OBJ_SUFFIX) \
michael@0 209 linking/$(OBJDIR)/prlink.$(OBJ_SUFFIX) \
michael@0 210 malloc/$(OBJDIR)/prmalloc.$(OBJ_SUFFIX) \
michael@0 211 malloc/$(OBJDIR)/prmem.$(OBJ_SUFFIX) \
michael@0 212 md/$(OBJDIR)/prosdep.$(OBJ_SUFFIX) \
michael@0 213 memory/$(OBJDIR)/prshm.$(OBJ_SUFFIX) \
michael@0 214 memory/$(OBJDIR)/prshma.$(OBJ_SUFFIX) \
michael@0 215 memory/$(OBJDIR)/prseg.$(OBJ_SUFFIX) \
michael@0 216 misc/$(OBJDIR)/pralarm.$(OBJ_SUFFIX) \
michael@0 217 misc/$(OBJDIR)/pratom.$(OBJ_SUFFIX) \
michael@0 218 misc/$(OBJDIR)/prcountr.$(OBJ_SUFFIX) \
michael@0 219 misc/$(OBJDIR)/prdtoa.$(OBJ_SUFFIX) \
michael@0 220 misc/$(OBJDIR)/prenv.$(OBJ_SUFFIX) \
michael@0 221 misc/$(OBJDIR)/prerr.$(OBJ_SUFFIX) \
michael@0 222 misc/$(OBJDIR)/prerror.$(OBJ_SUFFIX) \
michael@0 223 misc/$(OBJDIR)/prerrortable.$(OBJ_SUFFIX) \
michael@0 224 misc/$(OBJDIR)/prinit.$(OBJ_SUFFIX) \
michael@0 225 misc/$(OBJDIR)/prinrval.$(OBJ_SUFFIX) \
michael@0 226 misc/$(OBJDIR)/pripc.$(OBJ_SUFFIX) \
michael@0 227 misc/$(OBJDIR)/prlog2.$(OBJ_SUFFIX) \
michael@0 228 misc/$(OBJDIR)/prlong.$(OBJ_SUFFIX) \
michael@0 229 misc/$(OBJDIR)/prnetdb.$(OBJ_SUFFIX) \
michael@0 230 misc/$(OBJDIR)/praton.$(OBJ_SUFFIX) \
michael@0 231 misc/$(OBJDIR)/prolock.$(OBJ_SUFFIX) \
michael@0 232 misc/$(OBJDIR)/prrng.$(OBJ_SUFFIX) \
michael@0 233 misc/$(OBJDIR)/prsystem.$(OBJ_SUFFIX) \
michael@0 234 misc/$(OBJDIR)/prthinfo.$(OBJ_SUFFIX) \
michael@0 235 misc/$(OBJDIR)/prtpool.$(OBJ_SUFFIX) \
michael@0 236 misc/$(OBJDIR)/prtrace.$(OBJ_SUFFIX) \
michael@0 237 misc/$(OBJDIR)/prtime.$(OBJ_SUFFIX)
michael@0 238
michael@0 239 ifdef USE_PTHREADS
michael@0 240 OBJS += \
michael@0 241 pthreads/$(OBJDIR)/ptsynch.$(OBJ_SUFFIX) \
michael@0 242 pthreads/$(OBJDIR)/ptio.$(OBJ_SUFFIX) \
michael@0 243 pthreads/$(OBJDIR)/ptthread.$(OBJ_SUFFIX) \
michael@0 244 pthreads/$(OBJDIR)/ptmisc.$(OBJ_SUFFIX)
michael@0 245 else
michael@0 246 OBJS += \
michael@0 247 io/$(OBJDIR)/prdir.$(OBJ_SUFFIX) \
michael@0 248 io/$(OBJDIR)/prfile.$(OBJ_SUFFIX) \
michael@0 249 io/$(OBJDIR)/prio.$(OBJ_SUFFIX) \
michael@0 250 io/$(OBJDIR)/prsocket.$(OBJ_SUFFIX) \
michael@0 251 misc/$(OBJDIR)/pripcsem.$(OBJ_SUFFIX)
michael@0 252
michael@0 253 ifndef USE_BTHREADS
michael@0 254 OBJS += \
michael@0 255 threads/$(OBJDIR)/prcthr.$(OBJ_SUFFIX) \
michael@0 256 threads/$(OBJDIR)/prdump.$(OBJ_SUFFIX) \
michael@0 257 threads/$(OBJDIR)/prmon.$(OBJ_SUFFIX) \
michael@0 258 threads/$(OBJDIR)/prsem.$(OBJ_SUFFIX) \
michael@0 259 threads/combined/$(OBJDIR)/prucpu.$(OBJ_SUFFIX) \
michael@0 260 threads/combined/$(OBJDIR)/prucv.$(OBJ_SUFFIX) \
michael@0 261 threads/combined/$(OBJDIR)/prulock.$(OBJ_SUFFIX) \
michael@0 262 threads/combined/$(OBJDIR)/prustack.$(OBJ_SUFFIX) \
michael@0 263 threads/combined/$(OBJDIR)/pruthr.$(OBJ_SUFFIX)
michael@0 264 endif
michael@0 265
michael@0 266 endif
michael@0 267
michael@0 268 ifeq ($(USE_CPLUS), 1)
michael@0 269 OBJS += \
michael@0 270 cplus/$(OBJDIR)/rcbase.$(OBJ_SUFFIX) \
michael@0 271 cplus/$(OBJDIR)/rccv.$(OBJ_SUFFIX) \
michael@0 272 cplus/$(OBJDIR)/rcfileio.$(OBJ_SUFFIX) \
michael@0 273 cplus/$(OBJDIR)/rcinrval.$(OBJ_SUFFIX) \
michael@0 274 cplus/$(OBJDIR)/rcio.$(OBJ_SUFFIX) \
michael@0 275 cplus/$(OBJDIR)/rclock.$(OBJ_SUFFIX) \
michael@0 276 cplus/$(OBJDIR)/rcnetdb.$(OBJ_SUFFIX) \
michael@0 277 cplus/$(OBJDIR)/rcnetio.$(OBJ_SUFFIX) \
michael@0 278 cplus/$(OBJDIR)/rcthread.$(OBJ_SUFFIX) \
michael@0 279 cplus/$(OBJDIR)/rctime.$(OBJ_SUFFIX)
michael@0 280 endif
michael@0 281
michael@0 282 ifeq ($(OS_ARCH), WINNT)
michael@0 283 RES=$(OBJDIR)/nspr.res
michael@0 284 RESNAME=nspr.rc
michael@0 285 endif # WINNT
michael@0 286
michael@0 287 include $(srcdir)/md/$(PR_MD_ARCH_DIR)/objs.mk
michael@0 288 ifdef USE_BTHREADS
michael@0 289 include $(srcdir)/bthreads/objs.mk
michael@0 290 endif
michael@0 291
michael@0 292 LIBRARY_NAME = nspr
michael@0 293 LIBRARY_VERSION = $(MOD_MAJOR_VERSION)
michael@0 294
michael@0 295 RELEASE_LIBS = $(TARGETS)
michael@0 296
michael@0 297 include $(topsrcdir)/config/rules.mk
michael@0 298
michael@0 299 ifeq ($(BUILD_AIX_RTL_LIBC),1)
michael@0 300 TARGETS += $(AIX_RTL_LIBC)
michael@0 301 # XXX is this a shared library?
michael@0 302 endif
michael@0 303
michael@0 304 #
michael@0 305 # Version information generation (begin)
michael@0 306 #
michael@0 307 ECHO = echo
michael@0 308 INCLUDES = -I$(dist_includedir) -I$(topsrcdir)/pr/include -I$(topsrcdir)/pr/include/private
michael@0 309 TINC = $(OBJDIR)/_pr_bld.h
michael@0 310
michael@0 311 ifeq ($(OS_TARGET),OS2)
michael@0 312 PROD = nspr$(MOD_MAJOR_VERSION).$(DLL_SUFFIX)
michael@0 313 else
michael@0 314 PROD = $(notdir $(SHARED_LIBRARY))
michael@0 315 endif
michael@0 316
michael@0 317 NOW = $(MOD_DEPTH)/config/$(OBJDIR)/now
michael@0 318 SH_DATE = $(shell date "+%Y-%m-%d %T")
michael@0 319 SH_NOW = $(shell $(NOW))
michael@0 320
michael@0 321 ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
michael@0 322 SUF = i64
michael@0 323 else
michael@0 324 SUF = LL
michael@0 325 endif
michael@0 326
michael@0 327 DEFINES += -D_NSPR_BUILD_
michael@0 328
michael@0 329 GARBAGE += $(TINC)
michael@0 330
michael@0 331 $(TINC):
michael@0 332 @$(MAKE_OBJDIR)
michael@0 333 @$(ECHO) '#define _BUILD_STRING "$(SH_DATE)"' > $(TINC)
michael@0 334 @if test ! -z "$(SH_NOW)"; then \
michael@0 335 $(ECHO) '#define _BUILD_TIME $(SH_NOW)$(SUF)' >> $(TINC); \
michael@0 336 else \
michael@0 337 true; \
michael@0 338 fi
michael@0 339 @$(ECHO) '#define _PRODUCTION "$(PROD)"' >> $(TINC)
michael@0 340
michael@0 341
michael@0 342 $(OBJDIR)/prvrsion.$(OBJ_SUFFIX): prvrsion.c $(TINC)
michael@0 343 ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
michael@0 344 $(CC) -Fo$@ -c $(CFLAGS) -I$(OBJDIR) $<
michael@0 345 else
michael@0 346 $(CC) -o $@ -c $(CFLAGS) -I$(OBJDIR) $<
michael@0 347 endif
michael@0 348 #
michael@0 349 # Version information generation (end)
michael@0 350 #
michael@0 351
michael@0 352
michael@0 353 # We use a 'build' target here to ensure that we build $(TARGETS) after
michael@0 354 # looping over $(DIRS) to create the object files in a parallel build.
michael@0 355 # Recipe commands are executed sequentially in a parallel build while
michael@0 356 # target dependencies are executed in parallel.
michael@0 357 export::
michael@0 358 $(MAKE) build
michael@0 359
michael@0 360 #
michael@0 361 # The Client build wants the shared libraries in $(dist_bindir)
michael@0 362 # so we also install them there.
michael@0 363 #
michael@0 364
michael@0 365 build:: $(TARGETS)
michael@0 366 $(INSTALL) -m 444 $(TARGETS) $(dist_libdir)
michael@0 367 ifdef SHARED_LIBRARY
michael@0 368 ifeq ($(OS_ARCH),HP-UX)
michael@0 369 $(INSTALL) -m 755 $(SHARED_LIBRARY) $(dist_libdir)
michael@0 370 $(INSTALL) -m 755 $(SHARED_LIBRARY) $(dist_bindir)
michael@0 371 else
michael@0 372 $(INSTALL) -m 444 $(SHARED_LIBRARY) $(dist_bindir)
michael@0 373 endif
michael@0 374 endif
michael@0 375
michael@0 376 ifeq ($(BUILD_AIX_RTL_LIBC),1)
michael@0 377 $(AIX_RTL_LIBC): /usr/ccs/lib/libc.a
michael@0 378 rtl_enable -o $@ $<
michael@0 379 endif

mercurial