tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

Makefile.in (8392B)


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