tor-browser

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

platlibs.mk (7214B)


      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 ifeq ($(BUILD_SUN_PKG), 1)
      7 
      8 # set RPATH-type linker instructions here so they can be used in the shared
      9 # version and in the mixed (static nss libs/shared NSPR libs) version.
     10 
     11 ifeq ($(OS_ARCH), SunOS) 
     12 ifeq ($(USE_64), 1)
     13 EXTRA_SHARED_LIBS += -R '$$ORIGIN/../lib:/usr/lib/mps/secv1/64:/usr/lib/mps/64'
     14 else
     15 EXTRA_SHARED_LIBS += -R '$$ORIGIN/../lib:/usr/lib/mps/secv1:/usr/lib/mps'
     16 endif
     17 endif
     18 
     19 ifeq ($(OS_ARCH), Linux)
     20 ifeq ($(USE_64), 1)
     21 EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib64:/opt/sun/private/lib64:$$ORIGIN/../lib'
     22 else
     23 EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib:/opt/sun/private/lib'
     24 endif
     25 endif
     26 
     27 endif # BUILD_SUN_PKG
     28 
     29 ifdef NSS_DISABLE_DBM
     30 DBMLIB = $(NULL)
     31 else
     32 DBMLIB = $(DIST)/lib/$(LIB_PREFIX)dbm.$(LIB_SUFFIX) 
     33 endif
     34 
     35 ifeq ($(NSS_BUILD_UTIL_ONLY),1)
     36 SECTOOL_LIB = $(NULL)
     37 else
     38 SECTOOL_LIB = $(DIST)/lib/$(LIB_PREFIX)sectool.$(LIB_SUFFIX)
     39 endif
     40 
     41 ifdef USE_STATIC_LIBS
     42 
     43 DEFINES += -DNSS_USE_STATIC_LIBS
     44 # $(PROGRAM) has explicit dependencies on $(EXTRA_LIBS)
     45 ifndef NSS_USE_SYSTEM_FREEBL
     46 CRYPTOLIB=$(DIST)/lib/$(LIB_PREFIX)freebl.$(LIB_SUFFIX)
     47 SOFTOKENLIB=$(DIST)/lib/$(LIB_PREFIX)softokn.$(LIB_SUFFIX)
     48 else
     49 # Use the system installed freebl static library and set softoken one to empty.
     50 # Some tools need to link statically with freebl but none with softoken. Only
     51 # the softoken shared library, not the static one, is installed in the system.
     52 CRYPTOLIB=$(FREEBL_LIB_DIR)/$(LIB_PREFIX)freebl.$(LIB_SUFFIX)
     53 SOFTOKENLIB=
     54 EXTRA_SHARED_LIBS += \
     55 -L$(SOFTOKEN_LIB_DIR) \
     56 -lsoftokn3 \
     57 $(NULL)
     58 endif
     59 
     60 ifndef NSS_DISABLE_LIBPKIX
     61 ifndef NSS_BUILD_SOFTOKEN_ONLY
     62 PKIXLIB = \
     63 $(DIST)/lib/$(LIB_PREFIX)pkixtop.$(LIB_SUFFIX) \
     64 $(DIST)/lib/$(LIB_PREFIX)pkixutil.$(LIB_SUFFIX) \
     65 $(DIST)/lib/$(LIB_PREFIX)pkixsystem.$(LIB_SUFFIX) \
     66 $(DIST)/lib/$(LIB_PREFIX)pkixcrlsel.$(LIB_SUFFIX) \
     67 $(DIST)/lib/$(LIB_PREFIX)pkixmodule.$(LIB_SUFFIX) \
     68 $(DIST)/lib/$(LIB_PREFIX)pkixstore.$(LIB_SUFFIX) \
     69 $(DIST)/lib/$(LIB_PREFIX)pkixparams.$(LIB_SUFFIX) \
     70 $(DIST)/lib/$(LIB_PREFIX)pkixchecker.$(LIB_SUFFIX) \
     71 $(DIST)/lib/$(LIB_PREFIX)pkixpki.$(LIB_SUFFIX) \
     72 $(DIST)/lib/$(LIB_PREFIX)pkixtop.$(LIB_SUFFIX) \
     73 $(DIST)/lib/$(LIB_PREFIX)pkixresults.$(LIB_SUFFIX) \
     74 $(DIST)/lib/$(LIB_PREFIX)pkixcertsel.$(LIB_SUFFIX)
     75 endif
     76 endif
     77 
     78 NSS_LIBS_1=
     79 NSS_LIBS_2=
     80 NSS_LIBS_3=
     81 NSS_LIBS_4=
     82 
     83 ifneq ($(NSS_BUILD_SOFTOKEN_ONLY),1)
     84 ifeq ($(OS_ARCH), WINNT)
     85 # breakdown for windows
     86 NSS_LIBS_1 = \
     87 $(DIST)/lib/$(LIB_PREFIX)smime.$(LIB_SUFFIX) \
     88 $(DIST)/lib/$(LIB_PREFIX)ssl.$(LIB_SUFFIX) \
     89 $(DIST)/lib/$(LIB_PREFIX)nss.$(LIB_SUFFIX) \
     90 $(NULL)
     91 NSS_LIBS_2 = \
     92 $(DIST)/lib/$(LIB_PREFIX)pkcs12.$(LIB_SUFFIX) \
     93 $(DIST)/lib/$(LIB_PREFIX)pkcs7.$(LIB_SUFFIX) \
     94 $(DIST)/lib/$(LIB_PREFIX)certhi.$(LIB_SUFFIX) \
     95 $(DIST)/lib/$(LIB_PREFIX)cryptohi.$(LIB_SUFFIX) \
     96 $(DIST)/lib/$(LIB_PREFIX)pk11wrap.$(LIB_SUFFIX) \
     97 $(DIST)/lib/$(LIB_PREFIX)certdb.$(LIB_SUFFIX) \
     98 $(NULL)
     99 NSS_LIBS_3 = \
    100 $(DIST)/lib/$(LIB_PREFIX)nsspki.$(LIB_SUFFIX) \
    101 $(DIST)/lib/$(LIB_PREFIX)nssdev.$(LIB_SUFFIX) \
    102 $(DIST)/lib/$(LIB_PREFIX)nssb.$(LIB_SUFFIX) \
    103 $(PKIXLIB) \
    104 $(DBMLIB) \
    105 $(NULL)
    106 NSS_LIBS_4 = \
    107 $(SQLITE_LIB_DIR)/$(LIB_PREFIX)$(SQLITE_LIB_NAME).$(LIB_SUFFIX) \
    108 $(NSSUTIL_LIB_DIR)/$(LIB_PREFIX)nssutil3.$(LIB_SUFFIX) \
    109 $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)plc4.$(LIB_SUFFIX) \
    110 $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)plds4.$(LIB_SUFFIX) \
    111 $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)nspr4.$(LIB_SUFFIX) \
    112 $(NULL)
    113 else
    114 # breakdown for others
    115 NSS_LIBS_1 = \
    116 $(DIST)/lib/$(LIB_PREFIX)smime.$(LIB_SUFFIX) \
    117 $(DIST)/lib/$(LIB_PREFIX)ssl.$(LIB_SUFFIX) \
    118 $(DIST)/lib/$(LIB_PREFIX)nss.$(LIB_SUFFIX) \
    119 $(NULL)
    120 NSS_LIBS_2 = \
    121 $(DIST)/lib/$(LIB_PREFIX)pkcs12.$(LIB_SUFFIX) \
    122 $(DIST)/lib/$(LIB_PREFIX)pkcs7.$(LIB_SUFFIX) \
    123 $(DIST)/lib/$(LIB_PREFIX)certhi.$(LIB_SUFFIX) \
    124 $(DIST)/lib/$(LIB_PREFIX)cryptohi.$(LIB_SUFFIX) \
    125 $(DIST)/lib/$(LIB_PREFIX)pk11wrap.$(LIB_SUFFIX) \
    126 $(NULL)
    127 NSS_LIBS_3 = \
    128 $(DIST)/lib/$(LIB_PREFIX)certdb.$(LIB_SUFFIX) \
    129 $(DIST)/lib/$(LIB_PREFIX)nsspki.$(LIB_SUFFIX) \
    130 $(DIST)/lib/$(LIB_PREFIX)nssdev.$(LIB_SUFFIX) \
    131 $(DIST)/lib/$(LIB_PREFIX)nssb.$(LIB_SUFFIX) \
    132 $(NULL)
    133 NSS_LIBS_4 = \
    134 $(DBMLIB) \
    135 $(PKIXLIB) \
    136 $(DIST)/lib/$(LIB_PREFIX)nss.$(LIB_SUFFIX) \
    137 $(DIST)/lib/$(LIB_PREFIX)pk11wrap.$(LIB_SUFFIX) \
    138 $(DIST)/lib/$(LIB_PREFIX)certhi.$(LIB_SUFFIX) \
    139 $(NULL)
    140 endif
    141 endif
    142 
    143 # can't do this in manifest.mn because OS_ARCH isn't defined there.
    144 ifeq ($(OS_ARCH), WINNT)
    145 
    146 EXTRA_LIBS += \
    147 $(SECTOOL_LIB) \
    148 $(NSS_LIBS_1) \
    149 $(NSS_LIBS_2) \
    150 $(SOFTOKENLIB) \
    151 $(CRYPTOLIB) \
    152 $(NSS_LIBS_3) \
    153 $(NSS_LIBS_4) \
    154 $(NULL)
    155 
    156 # $(PROGRAM) has NO explicit dependencies on $(OS_LIBS)
    157 #OS_LIBS += \
    158 wsock32.lib \
    159 winmm.lib \
    160 $(NULL)
    161 else
    162 
    163 EXTRA_LIBS += \
    164 $(SECTOOL_LIB) \
    165 $(NSS_LIBS_1) \
    166 $(NSS_LIBS_2) \
    167 $(SOFTOKENLIB) \
    168 $(NSS_LIBS_3) \
    169 $(CRYPTOLIB) \
    170 $(NSS_LIBS_4) \
    171 $(NULL)
    172 
    173 ifeq ($(OS_ARCH), AIX) 
    174 EXTRA_SHARED_LIBS += -brtl 
    175 endif
    176 
    177 # $(PROGRAM) has NO explicit dependencies on $(EXTRA_SHARED_LIBS)
    178 # $(EXTRA_SHARED_LIBS) come before $(OS_LIBS), except on AIX.
    179 EXTRA_SHARED_LIBS += \
    180 -L$(SQLITE_LIB_DIR) \
    181 -l$(SQLITE_LIB_NAME) \
    182 -L$(NSSUTIL_LIB_DIR) \
    183 -lnssutil3 \
    184 -L$(NSPR_LIB_DIR) \
    185 -lplc4 \
    186 -lplds4 \
    187 -lnspr4 \
    188 $(NULL)
    189 endif
    190 
    191 else # USE_STATIC_LIBS
    192 # can't do this in manifest.mn because OS_ARCH isn't defined there.
    193 ifeq ($(OS_ARCH), WINNT)
    194 
    195 # $(PROGRAM) has explicit dependencies on $(EXTRA_LIBS)
    196 EXTRA_LIBS += \
    197 $(SECTOOL_LIB) \
    198 $(NSSUTIL_LIB_DIR)/$(IMPORT_LIB_PREFIX)nssutil3$(IMPORT_LIB_SUFFIX) \
    199 $(DIST)/lib/$(IMPORT_LIB_PREFIX)smime3$(IMPORT_LIB_SUFFIX) \
    200 $(DIST)/lib/$(IMPORT_LIB_PREFIX)ssl3$(IMPORT_LIB_SUFFIX) \
    201 $(DIST)/lib/$(IMPORT_LIB_PREFIX)nss3$(IMPORT_LIB_SUFFIX) \
    202 $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)plc4$(IMPORT_LIB_SUFFIX) \
    203 $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)plds4$(IMPORT_LIB_SUFFIX) \
    204 $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)nspr4$(IMPORT_LIB_SUFFIX) \
    205 $(NULL)
    206 
    207 # $(PROGRAM) has NO explicit dependencies on $(OS_LIBS)
    208 #OS_LIBS += \
    209 wsock32.lib \
    210 winmm.lib \
    211 $(NULL)
    212 else
    213 
    214 # $(PROGRAM) has explicit dependencies on $(EXTRA_LIBS)
    215 EXTRA_LIBS += \
    216 $(SECTOOL_LIB) \
    217 $(NULL)
    218 
    219 ifeq ($(OS_ARCH), AIX) 
    220 EXTRA_SHARED_LIBS += -brtl 
    221 endif
    222 
    223 # $(PROGRAM) has NO explicit dependencies on $(EXTRA_SHARED_LIBS)
    224 # $(EXTRA_SHARED_LIBS) come before $(OS_LIBS), except on AIX.
    225 EXTRA_SHARED_LIBS += \
    226 -L$(DIST)/lib \
    227 -L$(NSSUTIL_LIB_DIR) \
    228 -lnssutil3 \
    229 -L$(NSPR_LIB_DIR) \
    230 -lplc4 \
    231 -lplds4 \
    232 -lnspr4 \
    233 $(NULL)
    234 ifndef NSS_BUILD_UTIL_ONLY
    235 ifndef NSS_BUILD_SOFTOKEN_ONLY
    236 EXTRA_SHARED_LIBS += \
    237 -lssl3 \
    238 -lsmime3 \
    239 -lnss3
    240 endif
    241 endif
    242 endif
    243 
    244 ifdef SOFTOKEN_LIB_DIR
    245 ifdef NSS_USE_SYSTEM_FREEBL
    246 EXTRA_SHARED_LIBS += -L$(SOFTOKEN_LIB_DIR) -lsoftokn3
    247 endif
    248 endif
    249 
    250 endif # USE_STATIC_LIBS
    251 
    252 # If a platform has a system freebl, set USE_SYSTEM_FREEBL to 1 and
    253 # FREEBL_LIBS to the linker command-line arguments for the system nss-util
    254 # (for example, -lfreebl3 on fedora) in the platform's config file in coreconf.
    255 ifdef NSS_USE_SYSTEM_FREEBL
    256 FREEBL_LIBS = $(FREEBL_LIB_DIR)/$(LIB_PREFIX)freebl.$(LIB_SUFFIX)
    257 EXTRA_LIBS += $(FREEBL_LIBS)
    258 endif
    259 
    260 JAR_LIBS = $(DIST)/lib/$(LIB_PREFIX)jar.$(LIB_SUFFIX)