DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (a81015259a98)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#   Brian Ryner <bryner@brianryner.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****

DEPTH		= ../..
topsrcdir	= @top_srcdir@
srcdir		= @srcdir@
VPATH		= @srcdir@

include $(DEPTH)/config/autoconf.mk
CC_WRAPPER =
CXX_WRAPPER =
include $(topsrcdir)/config/config.mk

MODULE = psm

ifndef MOZ_NATIVE_NSS
LOADABLE_ROOT_MODULE = $(DLL_PREFIX)nssckbi$(DLL_SUFFIX)
endif

NSS3_LIB = $(DLL_PREFIX)nss3$(DLL_SUFFIX)
NSSUTIL3_LIB = $(DLL_PREFIX)nssutil3$(DLL_SUFFIX)
SMIME3_LIB = $(DLL_PREFIX)smime3$(DLL_SUFFIX)
SSL3_LIB =  $(DLL_PREFIX)ssl3$(DLL_SUFFIX)
SOFTOKEN3_LIB = $(DLL_PREFIX)softokn3$(DLL_SUFFIX)

ifndef NSS_DISABLE_DBM
NSSDBM3_LIB = $(DLL_PREFIX)nssdbm3$(DLL_SUFFIX)
else
NSSDBM3_LIB = 
endif

ifndef MOZ_NATIVE_NSS
ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
SDK_LIBS = \
  $(DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \
  $(DIST)/lib/$(LIB_PREFIX)smime3.$(LIB_SUFFIX) \
  $(DIST)/lib/$(LIB_PREFIX)ssl3.$(LIB_SUFFIX) \
  $(DIST)/lib/$(LIB_PREFIX)nss3.$(LIB_SUFFIX) \
  $(DIST)/lib/$(LIB_PREFIX)nssutil3.$(LIB_SUFFIX) \
  $(NULL)
else
SDK_LIBS = \
  $(DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \
  $(DIST)/lib/$(LIB_PREFIX)smime.$(LIB_SUFFIX) \
  $(DIST)/lib/$(LIB_PREFIX)ssl.$(LIB_SUFFIX) \
  $(DIST)/lib/$(LIB_PREFIX)nss.$(LIB_SUFFIX) \
  $(DIST)/lib/$(LIB_PREFIX)nssutil.$(LIB_SUFFIX) \
  $(NULL)
endif
endif

# Default
HAVE_FREEBL_LIBS = 1

# 32-bit HP-UX PA-RISC
ifeq ($(OS_ARCH), HP-UX)
ifneq ($(OS_TEST), ia64)
ifndef HAVE_64BIT_OS
HAVE_FREEBL_LIBS =
HAVE_FREEBL_LIBS_32 = 1
endif
endif
endif

# SunOS SPARC
ifeq ($(OS_ARCH), SunOS)
ifneq (86,$(findstring 86,$(OS_TEST)))
ifdef HAVE_64BIT_OS
HAVE_FREEBL_LIBS =
HAVE_FREEBL_LIBS_64 = 1
else
HAVE_FREEBL_LIBS =
HAVE_FREEBL_LIBS_32 = 1
HAVE_FREEBL_LIBS_32INT64 = 1
endif
endif
endif

ifdef HAVE_FREEBL_LIBS
FREEBL_LIB = $(DLL_PREFIX)freebl3$(DLL_SUFFIX)
endif
ifdef HAVE_FREEBL_LIBS_32
FREEBL_32INT_LIB = libfreebl_32int_3$(DLL_SUFFIX)
FREEBL_32FPU_LIB = libfreebl_32fpu_3$(DLL_SUFFIX)
endif
ifdef HAVE_FREEBL_LIBS_32INT64
FREEBL_32INT64_LIB = libfreebl_32int64_3$(DLL_SUFFIX)
endif
ifdef HAVE_FREEBL_LIBS_64
FREEBL_64INT_LIB = libfreebl_64int_3$(DLL_SUFFIX)
FREEBL_64FPU_LIB = libfreebl_64fpu_3$(DLL_SUFFIX)
endif

ABS_DIST := $(call core_abspath,$(DIST))
ifeq ($(HOST_OS_ARCH),WINNT)
ifdef CYGDRIVE_MOUNT
ABS_DIST := $(shell cygpath -w $(ABS_DIST) | sed -e 's|\\|/|g')
endif
ifneq (,$(filter mingw%,$(host_os)))
ABS_DIST := $(shell cd $(DIST) && pwd -W)
endif
endif
# For all variables such as DLLFLAGS, that may contain $(DIST)
DIST := $(ABS_DIST)
NSPR_INCLUDE_DIR = $(firstword $(filter -I%,$(NSPR_CFLAGS)))
ifneq (,$(strip $(NSPR_INCLUDE_DIR)))
NSPR_INCLUDE_DIR := $(subst -I,,$(subst -I$(DIST),-I$(ABS_DIST),$(NSPR_INCLUDE_DIR)))
else
NSPR_INCLUDE_DIR = $(ABS_DIST)/include/nspr
endif
NSPR_LIB_DIR = $(firstword $(filter -L%,$(NSPR_LIBS)))
ifneq (,$(strip $(NSPR_LIB_DIR)))
NSPR_LIB_DIR := $(subst -L,,$(subst -L$(DIST),-L$(ABS_DIST),$(NSPR_LIB_DIR)))
else
NSPR_LIB_DIR = $(ABS_DIST)/lib
endif
# Can't pass this in DEFAULT_GMAKE_FLAGS because that overrides
# definitions in NSS, so just export it into the sub-make's environment.
ifeq (WINNT_1,$(OS_TARGET)_$(MOZ_MEMORY))
export DLLFLAGS
endif

# To get debug symbols from NSS
export MOZ_DEBUG_SYMBOLS

ifdef .PYMAKE
NSSMAKE = $(GMAKE)
else
NSSMAKE = $(MAKE)
endif

# NSS makefiles are not safe for parallel execution.
DEFAULT_GMAKE_FLAGS = MAKE="$(NSSMAKE) -j1" -j1
DEFAULT_GMAKE_FLAGS += CC="$(CC)"
DEFAULT_GMAKE_FLAGS += SOURCE_MD_DIR=$(ABS_DIST)
DEFAULT_GMAKE_FLAGS += SOURCE_MDHEADERS_DIR=$(NSPR_INCLUDE_DIR)
DEFAULT_GMAKE_FLAGS += DIST=$(ABS_DIST)
DEFAULT_GMAKE_FLAGS += NSPR_INCLUDE_DIR=$(NSPR_INCLUDE_DIR)
DEFAULT_GMAKE_FLAGS += NSPR_LIB_DIR=$(NSPR_LIB_DIR)
DEFAULT_GMAKE_FLAGS += MOZILLA_CLIENT=1
DEFAULT_GMAKE_FLAGS += NO_MDUPDATE=1
DEFAULT_GMAKE_FLAGS += NSS_ENABLE_ECC=1
DEFAULT_GMAKE_FLAGS += NSINSTALL="$(NSINSTALL)"
ifndef MOZ_NATIVE_SQLITE
DEFAULT_GMAKE_FLAGS += SQLITE_LIB_NAME=mozsqlite3
DEFAULT_GMAKE_FLAGS += SQLITE_INCLUDE_DIR=$(ABS_DIST)/include
endif
ifdef NSS_DISABLE_DBM 
DEFAULT_GMAKE_FLAGS += NSS_DISABLE_DBM=1
endif
ABS_topsrcdir   := $(call core_abspath,$(topsrcdir))
ifneq ($(ABS_topsrcdir),$(MOZ_BUILD_ROOT))
DEFAULT_GMAKE_FLAGS += BUILD_TREE=$(MOZ_BUILD_ROOT)
endif
ifndef MOZ_DEBUG
DEFAULT_GMAKE_FLAGS += BUILD_OPT=1 OPT_CODE_SIZE=1
endif
ifdef GNU_CC
DEFAULT_GMAKE_FLAGS += NS_USE_GCC=1
else
DEFAULT_GMAKE_FLAGS += NS_USE_GCC=
endif
ifdef USE_N32
# It is not really necessary to specify USE_PTHREADS=1.  USE_PTHREADS
# merely adds _PTH to coreconf's OBJDIR name.
DEFAULT_GMAKE_FLAGS += USE_N32=1 USE_PTHREADS=1
endif
ifdef HAVE_64BIT_OS
DEFAULT_GMAKE_FLAGS += USE_64=1
endif
ifeq ($(OS_ARCH),WINNT)
DEFAULT_GMAKE_FLAGS += OS_TARGET=WIN95
ifdef MOZ_DEBUG
ifndef MOZ_NO_DEBUG_RTL
DEFAULT_GMAKE_FLAGS += USE_DEBUG_RTL=1
endif
endif
endif # WINNT
ifeq ($(OS_ARCH),OS2)
ifdef MOZ_OS2_HIGH_MEMORY
DEFAULT_GMAKE_FLAGS += MOZ_OS2_HIGH_MEMORY=1
endif
endif # OS2
ifeq ($(OS_ARCH),Darwin)
# Make nsinstall use absolute symlinks by default when building NSS
# for Mozilla on Mac OS X. (Bugzilla bug 193164)
ifndef NSDISTMODE
DEFAULT_GMAKE_FLAGS += NSDISTMODE=absolute_symlink
endif
ifdef MACOS_SDK_DIR
DEFAULT_GMAKE_FLAGS += MACOS_SDK_DIR=$(MACOS_SDK_DIR)
endif
endif

# Turn off TLS compression support because it requires system zlib.
# See bug 580679 comment 18.
DEFAULT_GMAKE_FLAGS += NSS_ENABLE_ZLIB=

# Disable building of the test programs in security/nss/lib/zlib
DEFAULT_GMAKE_FLAGS += PROGRAMS=

# Disable creating .chk files. They will be generated from packager.mk
# When bug 681624 lands, we can replace CHECKLOC= with SKIP_SHLIBSIGN=1
DEFAULT_GMAKE_FLAGS += CHECKLOC=

ifdef CROSS_COMPILE

DEFAULT_GMAKE_FLAGS += \
	NATIVE_CC="$(HOST_CC)" \
	CC="$(CC)" \
	CCC="$(CXX)" \
	LINK="$(LD)" \
	AS="$(AS)" \
	AR='$(AR) $(AR_FLAGS:$@=$$@)' \
	RANLIB="$(RANLIB)" \
	RC="$(RC) $(RCFLAGS)" \
	OS_ARCH="$(OS_ARCH)" \
	OS_TEST="$(OS_TEST)" \
	CPU_ARCH="$(TARGET_CPU)" \
	$(NULL)

# Android has pthreads integrated into -lc, so OS_PTHREAD is set to nothing
ifeq ($(OS_TARGET), Android)
DEFAULT_GMAKE_FLAGS += \
	OS_RELEASE="2.6" \
	OS_PTHREAD= \
	STANDARDS_CFLAGS="-std=gnu89" \
	ARCHFLAG="$(CFLAGS) -DCHECK_FORK_GETPID -DRTLD_NOLOAD=0 -DANDROID_VERSION=$(ANDROID_VERSION) -include $(ABS_topsrcdir)/security/manager/android_stub.h" \
	$(NULL)
endif
endif

ifdef WRAP_LDFLAGS
DEFAULT_GMAKE_FLAGS += \
	LDFLAGS="$(LDFLAGS) $(WRAP_LDFLAGS)" \
	DSO_LDOPTS="-shared $(LDFLAGS) $(WRAP_LDFLAGS)" \
	$(NULL)
endif

SUBMAKEFILES = boot/Makefile ssl/Makefile pki/Makefile locales/Makefile

include $(topsrcdir)/config/rules.mk

ifdef MOZ_NSS_PATCH
# If we're applying a patch, we'll copy the NSS source to the objdir
# and build it from there.
NSS_SRCDIR = $(CURDIR)/nss

# This will copy and patch the NSS source for every build.
# Since we "cp -p", it won't force rebuilds for most files, just
# for patched files, but that's easier than trying to track
# dependencies for patched files.
export::
	rm -rf $(NSS_SRCDIR)
	$(NSINSTALL) -D $(NSS_SRCDIR)/security
	cp -Rp $(topsrcdir)/security/nss $(NSS_SRCDIR)/security
	cp -Rp $(topsrcdir)/security/coreconf $(NSS_SRCDIR)/security
	cp -Rp $(topsrcdir)/security/dbm $(NSS_SRCDIR)/security
	cp -Rp $(topsrcdir)/dbm $(NSS_SRCDIR)
	(cd $(NSS_SRCDIR) && patch -p1 < $(call core_abspath,$(MOZ_NSS_PATCH)))
else
NSS_SRCDIR = $(topsrcdir)
endif

dependclean export packages chrome::
	$(MAKE) -C boot $@
	$(MAKE) -C ssl $@
	$(MAKE) -C locales $@
ifdef MOZ_XUL
	$(MAKE) -C pki $@
endif

libs::
ifndef MOZ_NATIVE_NSS
ifndef NSS_DISABLE_DBM
	$(NSSMAKE) -C $(NSS_SRCDIR)/security/dbm $(DEFAULT_GMAKE_FLAGS) 
endif
	$(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/lib $(DEFAULT_GMAKE_FLAGS)
ifdef ENABLE_TESTS
# Need certutil binary for mochitest certificates generation
	$(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/cmd/lib $(DEFAULT_GMAKE_FLAGS)
	$(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/cmd/certutil $(DEFAULT_GMAKE_FLAGS)
	$(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/cmd/pk12util $(DEFAULT_GMAKE_FLAGS)
	$(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/cmd/modutil $(DEFAULT_GMAKE_FLAGS)
endif
ifndef ENABLE_TESTS # Just avoid secondary compile
	$(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/cmd/lib $(DEFAULT_GMAKE_FLAGS)
endif
	$(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/cmd/shlibsign $(DEFAULT_GMAKE_FLAGS)
	$(INSTALL) -m 755 $(DIST)/lib/$(LOADABLE_ROOT_MODULE) $(DIST)/bin
ifeq ($(OS_ARCH), SunOS)
# has to use copy mode on Solaris, see #665509
	$(NSINSTALL) -t -m 755 $(DIST)/lib/$(SOFTOKEN3_LIB) $(DIST)/bin
else
	$(INSTALL) -m 755 $(DIST)/lib/$(SOFTOKEN3_LIB) $(DIST)/bin
endif
ifndef NSS_DISABLE_DBM
	$(INSTALL) -m 755 $(DIST)/lib/$(NSSDBM3_LIB) $(DIST)/bin
endif
	$(INSTALL) -m 755 $(DIST)/lib/$(NSS3_LIB) $(DIST)/bin
	$(INSTALL) -m 755 $(DIST)/lib/$(NSSUTIL3_LIB) $(DIST)/bin
	$(INSTALL) -m 755 $(DIST)/lib/$(SSL3_LIB) $(DIST)/bin
	$(INSTALL) -m 755 $(DIST)/lib/$(SMIME3_LIB) $(DIST)/bin
	$(INSTALL) -m 755 $(SDK_LIBS) $(DIST)/sdk/lib
ifdef HAVE_FREEBL_LIBS
	$(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_LIB) $(DIST)/bin
endif
ifdef HAVE_FREEBL_LIBS_32
	$(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_32INT_LIB) $(DIST)/bin
	$(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_32FPU_LIB) $(DIST)/bin
endif
ifdef HAVE_FREEBL_LIBS_32INT64
	$(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_32INT64_LIB) $(DIST)/bin
endif
ifdef HAVE_FREEBL_LIBS_64
	$(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_64INT_LIB) $(DIST)/bin
	$(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_64FPU_LIB) $(DIST)/bin
endif
endif
ifndef MOZ_NATIVE_NSS
# NSS installs headers to dist/public and we want them in dist/include
	$(NSINSTALL) -D $(DIST)/include/nss
	(cd $(DIST)/public/nss && tar $(TAR_CREATE_FLAGS) - .) | \
	  (cd $(DIST)/include && tar -xf -)
endif
	$(MAKE) -C boot $@
	$(MAKE) -C ssl $@
	$(MAKE) -C locales $@
ifdef MOZ_XUL
	$(MAKE) -C pki $@
endif

check::
	$(MAKE) -C ssl $@

install::
ifndef MOZ_NATIVE_NSS
	$(SYSINSTALL) -m 755 $(DIST)/lib/$(LOADABLE_ROOT_MODULE) $(DESTDIR)$(mozappdir)
	$(SYSINSTALL) -m 755 $(DIST)/lib/$(SOFTOKEN3_LIB) $(DESTDIR)$(mozappdir)
	$(SYSINSTALL) -m 755 $(DIST)/lib/$(NSSDBM3_LIB) $(DESTDIR)$(mozappdir)
	$(SYSINSTALL) -m 755 $(DIST)/lib/$(NSS3_LIB) $(DESTDIR)$(mozappdir)
	$(SYSINSTALL) -m 755 $(DIST)/lib/$(NSSUTIL3_LIB) $(DESTDIR)$(mozappdir)
	$(SYSINSTALL) -m 755 $(DIST)/lib/$(SSL3_LIB) $(DESTDIR)$(mozappdir)
	$(SYSINSTALL) -m 755 $(DIST)/lib/$(SMIME3_LIB) $(DESTDIR)$(mozappdir)
ifdef HAVE_FREEBL_LIBS
	$(SYSINSTALL) -m 755 $(DIST)/lib/$(FREEBL_LIB) $(DESTDIR)$(mozappdir)
endif
ifdef HAVE_FREEBL_LIBS_32
	$(SYSINSTALL) -m 755 $(DIST)/lib/$(FREEBL_32INT_LIB) $(DESTDIR)$(mozappdir)
	$(SYSINSTALL) -m 755 $(DIST)/lib/$(FREEBL_32FPU_LIB) $(DESTDIR)$(mozappdir)
endif
ifdef HAVE_FREEBL_LIBS_32INT64
	$(SYSINSTALL) -m 755 $(DIST)/lib/$(FREEBL_32INT64_LIB) $(DESTDIR)$(mozappdir)
endif
ifdef HAVE_FREEBL_LIBS_64
	$(SYSINSTALL) -m 755 $(DIST)/lib/$(FREEBL_64INT_LIB) $(DESTDIR)$(mozappdir)
	$(SYSINSTALL) -m 755 $(DIST)/lib/$(FREEBL_64FPU_LIB) $(DESTDIR)$(mozappdir)
endif
endif
	$(MAKE) -C boot $@
	$(MAKE) -C ssl $@
	$(MAKE) -C locales $@
ifdef MOZ_XUL
	$(MAKE) -C pki $@
endif

clean clobber clobber_all realclean distclean depend::
	$(MAKE) -C boot $@
	$(MAKE) -C ssl $@
	$(MAKE) -C locales $@
ifdef MOZ_XUL
	$(MAKE) -C pki $@
endif
ifndef MOZ_NATIVE_NSS
	$(NSSMAKE) -C $(NSS_SRCDIR)/security/coreconf $(DEFAULT_GMAKE_FLAGS) clean
	$(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/lib $(DEFAULT_GMAKE_FLAGS) clean
	$(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/cmd/lib $(DEFAULT_GMAKE_FLAGS) clean
	$(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/cmd/shlibsign $(DEFAULT_GMAKE_FLAGS) clean
endif