Address Wan-Teh's insightful review feedback. Fixed release_md. NSS_PERFORMANCE_HACKS_BRANCH
authornelsonb%netscape.com
Sat, 27 Aug 2005 02:16:12 +0000
branchNSS_PERFORMANCE_HACKS_BRANCH
changeset 6062 979491a2a572860317a1bf5757e3382e94ef404d
parent 6060 a04e803f8b3c011cfa4414495fbc3cbf5e6f4feb
child 6063 b7a4906dc34e48d5817d14a3ffc89d29044ab525
push idunknown
push userunknown
push dateunknown
Address Wan-Teh's insightful review feedback. Fixed release_md.
security/nss/lib/freebl/Makefile
--- a/security/nss/lib/freebl/Makefile
+++ b/security/nss/lib/freebl/Makefile
@@ -59,17 +59,17 @@ include $(CORE_DEPTH)/coreconf/config.mk
 #######################################################################
 # (4) Include "local" platform-dependent assignments (OPTIONAL).      #
 #######################################################################
 
 -include config.mk
 
 # default for all platforms
 # unset this on those that have multiple libraries
-FREEBL_BUILD_SINGLE_SHLIB=1
+FREEBL_BUILD_SINGLE_SHLIB = 1
 
 ifdef USE_64
 	DEFINES += -DNSS_USE_64
 endif
 
 ifdef USE_ABI32_FPU
 	DEFINES += -DNSS_USE_ABI32_FPU
 endif
@@ -83,41 +83,42 @@ endif
 endif
 
 ifeq ($(OS_TARGET),OSF1)
     DEFINES += -DMP_ASSEMBLY_MULTIPLY -DMP_NO_MP_WORD
     MPI_SRCS += mpvalpha.c
 endif
 
 ifeq (OS2,$(OS_TARGET))
-LN_S     = cp
+    LN_S     = cp
 endif
 
 ifeq (,$(filter-out WINNT WIN95,$(OS_TARGET)))  #omits WIN16 and WINCE
+    LN_S     = cp
 ifdef NS_USE_GCC
 # Ideally, we want to use assembler
 #     ASFILES  = mpi_x86.s
 #     DEFINES += -DMP_ASSEMBLY_MULTIPLY -DMP_ASSEMBLY_SQUARE \
 #                -DMP_ASSEMBLY_DIV_2DX1D
 # but we haven't figured out how to make it work, so we are not
 # using assembler right now.
     ASFILES  =
     DEFINES += -DMP_NO_MP_WORD -DMP_USE_UINT_DIGIT
 else
-    LN_S     = cp
     ASFILES  = mpi_x86.asm
     DEFINES += -DMP_ASSEMBLY_MULTIPLY -DMP_ASSEMBLY_SQUARE 
     DEFINES += -DMP_ASSEMBLY_DIV_2DX1D -DMP_USE_UINT_DIGIT -DMP_NO_MP_WORD
     ifdef BUILD_OPT
 	OPTIMIZER += -Ox  # maximum optimization for freebl
     endif
 endif
 endif
 
 ifeq ($(OS_TARGET),WINCE)
+    LN_S     = cp
     DEFINES += -DMP_ARGCHK=0	# no assert in WinCE
     DEFINES += -DSHA_NO_LONG_LONG # avoid 64-bit arithmetic in SHA512
 endif
 
 ifdef XP_OS2_VACPP
     ASFILES  = mpi_x86.asm
     DEFINES += -DMP_ASSEMBLY_MULTIPLY -DMP_ASSEMBLY_SQUARE 
     DEFINES += -DMP_ASSEMBLY_DIV_2DX1D -DMP_USE_UINT_DIGIT -DMP_NO_MP_WORD
@@ -166,19 +167,19 @@ ifeq ($(OS_TARGET),AIX)
 	DEFINES += -DMP_NO_DIV_WORD -DMP_NO_ADD_WORD -DMP_NO_SUB_WORD
     endif
 endif # AIX
 
 ifeq ($(OS_TARGET), HP-UX)
 ifneq ($(OS_TEST), ia64)
 # PA-RISC
 ifndef USE_64
-FREEBL_BUILD_SINGLE_SHLIB=
-HAVE_ABI32_INT32=1
-HAVE_ABI32_FPU=1
+    FREEBL_BUILD_SINGLE_SHLIB = 
+    HAVE_ABI32_INT32 = 1
+    HAVE_ABI32_FPU = 1
 endif
 MKSHLIB += +k +vshlibunsats -u FREEBL_GetVector +e FREEBL_GetVector
 ifdef FREEBL_CHILD_BUILD
 ifdef USE_ABI32_INT32
 # build for DA1.1 (HP PA 1.1) pure 32 bit model
     DEFINES  += -DMP_USE_UINT_DIGIT -DMP_NO_MP_WORD
     DEFINES += -DSHA_NO_LONG_LONG # avoid 64-bit arithmetic in SHA512
 else
@@ -200,55 +201,56 @@ endif
 endif
 
 ifeq ($(OS_TARGET),SunOS)
 
 # The -R '$ORIGIN' linker option instructs this library to search for its
 # dependencies in the same directory where it resides.
 MKSHLIB += -R '$$ORIGIN'
 ifdef NS_USE_GCC
-  ifdef GCC_USE_GNU_LD
-    MKSHLIB += -Wl,-Bsymbolic,-z,defs,-z,now,-z,text,--version-script
-  else
-    MKSHLIB += -Wl,-B,symbolic,-z,defs,-z,now,-z,text
-  endif # GCC_USE_GNU_LD
+    ifdef GCC_USE_GNU_LD
+	MKSHLIB += -Wl,-Bsymbolic,-z,defs,-z,now,-z,text,--version-script
+    else
+	MKSHLIB += -Wl,-B,symbolic,-z,defs,-z,now,-z,text
+    endif # GCC_USE_GNU_LD
 else
-  MKSHLIB += -B symbolic -z defs -z now -z text
+    MKSHLIB += -B symbolic -z defs -z now -z text
 endif # NS_USE_GCC
 
 # Sun's WorkShop defines v8, v8plus and v9 architectures.
 # gcc on Solaris defines v8 and v9 "cpus".  
 # gcc's v9 is equivalent to Workshop's v8plus.
 # gcc's -m64 is equivalent to Workshop's v9
 # We always use Sun's assembler and linker, which use Sun's naming convention.
 ifeq ($(CPU_ARCH),sparc)
     FREEBL_BUILD_SINGLE_SHLIB=
     ifdef USE_64
-        HAVE_ABI64_INT=1
-        HAVE_ABI64_FPU=1
+        HAVE_ABI64_INT = 1
+        HAVE_ABI64_FPU = 1
     else
-        HAVE_ABI32_INT32=1
-        HAVE_ABI32_FPU=1
-        HAVE_ABI32_INT64=1
+        HAVE_ABI32_INT32 = 1
+        HAVE_ABI32_FPU = 1
+        HAVE_ABI32_INT64 = 1
     endif
-    SYSV_SPARC=1
+    SYSV_SPARC = 1
     SOLARIS_AS = /usr/ccs/bin/as
     #### set arch, asm, c flags
     ifdef NS_USE_GCC
 	ifdef USE_ABI32_INT32
 	    # default ARCHFLAG=-mcpu=v8 set by coreconf/sunOS5.mk
 	endif
 	ifdef USE_ABI32_INT64
 	    ARCHFLAG=-mcpu=v9 -Wa,-xarch=v8plus
 	endif
 	ifdef USE_ABI32_FPU
 	    ARCHFLAG=-mcpu=v9 -Wa,-xarch=v8plus
 	endif # USE_ABI32_FPU
 	ifdef USE_64
 	    #ARCHFLAG=-m64 set by coreconf/sunOS5.mk
+	    #This is correct for all solaris gcc 64b builds, unlike below
 	endif
     else # NS_USE_GCC
 	ifdef USE_ABI32_INT32
 	    #ARCHFLAG=-xarch=v8 set in coreconf/sunOS5.mk
 	endif
 	ifdef USE_ABI32_INT64
 	    # this builds for Sparc v8+a ABI32_FPU architecture, 64-bit registers, 
 	    # 32-bit ABI, it uses 64-bit words, integer arithmetic, no FPU
@@ -425,149 +427,142 @@ ifeq ($(SYSV_SPARC),1)
 	@$(MAKE_OBJDIR)
 	$(SOLARIS_AS) -o $@ $(SOLARIS_AS_FLAGS) $<
 
 $(OBJDIR)/mpmontg.o: mpmontg.c montmulf.h
 
 endif
 
 ifndef LN_S
-LN_S = ln -s
+    LN_S = ln -s
 endif
 
 ifndef FREEBL_CHILD_BUILD
 
 # Parent build. This is where we decide which shared libraries to build
 
 CDDIR := $(shell pwd)
-FILES2LN = \
- Makefile manifest.mn config.mk
+FILES2LN = Makefile manifest.mn config.mk
 
 ifdef FREEBL_BUILD_SINGLE_SHLIB
 
 ################### Single ABI stuff #########################
 SINGLE_SHLIB_DIR = $(OBJDIR)/$(OS_TARGET)_SINGLE_SHLIB
 SINGLE_SHLIB_FILES = $(addprefix $(SINGLE_SHLIB_DIR)/, $(FILES2LN))
 ALL_TRASH += $(SINGLE_SHLIB_DIR) 
 
 $(SINGLE_SHLIB_DIR):
 	-mkdir $(SINGLE_SHLIB_DIR)
 
 $(SINGLE_SHLIB_FILES) : $(SINGLE_SHLIB_DIR)/% : % 
 	$(LN_S) $(CDDIR)/$* $(SINGLE_SHLIB_DIR)
 
-libs:: $(SINGLE_SHLIB_DIR) $(SINGLE_SHLIB_FILES)
+release_md libs:: $(SINGLE_SHLIB_DIR) $(SINGLE_SHLIB_FILES)
 	cd $(SINGLE_SHLIB_DIR) && $(MAKE) FREEBL_CHILD_BUILD=1 \
- FREEBL_PARENT=../.. CORE_DEPTH=../../$(CORE_DEPTH) libs
+ FREEBL_PARENT=../.. CORE_DEPTH=../../$(CORE_DEPTH) $@
 ######################## common stuff #########################
 
 else
 
 # multiple ABIs
 
 ifndef USE_64 
 
 ######################## ABI32_FPU stuff #########################
 ifdef HAVE_ABI32_FPU
 ABI32_FPU_DIR = $(OBJDIR)/$(OS_TARGET)_ABI32_FPU
 ABI32_FPU_FILES = $(addprefix $(ABI32_FPU_DIR)/, $(FILES2LN))
 ALL_TRASH += $(ABI32_FPU_DIR) 
 
 $(ABI32_FPU_DIR):
 	-mkdir $(ABI32_FPU_DIR)
-	-$(LN_S) $(CDDIR)/mpi $(ABI32_FPU_DIR)
 
 $(ABI32_FPU_FILES) : $(ABI32_FPU_DIR)/% : % 
 	$(LN_S) $(CDDIR)/$* $(ABI32_FPU_DIR)
 
-libs:: $(ABI32_FPU_DIR) $(ABI32_FPU_FILES)
+release_md libs:: $(ABI32_FPU_DIR) $(ABI32_FPU_FILES)
 	cd $(ABI32_FPU_DIR) && $(MAKE) FREEBL_CHILD_BUILD=1 USE_ABI32_FPU=1 \
- FREEBL_PARENT=$(CDDIR) CORE_DEPTH=$(CDDIR)/$(CORE_DEPTH) libs
+ FREEBL_PARENT=../.. CORE_DEPTH=../../$(CORE_DEPTH) $@
 endif
 
 ######################## ABI32_INT32 stuff #########################
 ifdef HAVE_ABI32_INT32
 ABI32_INT32_DIR = $(OBJDIR)/$(OS_TARGET)_ABI32_INT32
 ABI32_INT32_FILES = $(addprefix $(ABI32_INT32_DIR)/, $(FILES2LN))
 ALL_TRASH += $(ABI32_INT32_DIR) 
 
 $(ABI32_INT32_DIR):
 	-mkdir $(ABI32_INT32_DIR)
-	-$(LN_S) $(CDDIR)/mpi $(ABI32_INT32_DIR)
 
 $(ABI32_INT32_FILES) : $(ABI32_INT32_DIR)/% : % 
 	$(LN_S) $(CDDIR)/$* $(ABI32_INT32_DIR)
 
-libs:: $(ABI32_INT32_DIR) $(ABI32_INT32_FILES)
-	cd $(ABI32_INT32_DIR) && $(MAKE) FREEBL_CHILD_BUILD=1 USE_ABI32_INT32=1 \
- FREEBL_PARENT=$(CDDIR) CORE_DEPTH=$(CDDIR)/$(CORE_DEPTH) libs
+release_md libs:: $(ABI32_INT32_DIR) $(ABI32_INT32_FILES)
+	cd $(ABI32_INT32_DIR) && $(MAKE) FREEBL_CHILD_BUILD=1 \
+ USE_ABI32_INT32=1 FREEBL_PARENT=../.. CORE_DEPTH=../../$(CORE_DEPTH) $@
 endif
 
 ######################## ABI32_INT64 stuff #########################
 ifdef HAVE_ABI32_INT64
 ABI32_INT64_DIR = $(OBJDIR)/$(OS_TARGET)_ABI32_INT64
 ABI32_INT64_FILES = $(addprefix $(ABI32_INT64_DIR)/, $(FILES2LN))
 ALL_TRASH += $(ABI32_INT64_DIR) 
 
 $(ABI32_INT64_DIR):
 	-mkdir $(ABI32_INT64_DIR)
-	-$(LN_S) $(CDDIR)/mpi $(ABI32_INT64_DIR)
 
 $(ABI32_INT64_FILES) : $(ABI32_INT64_DIR)/% : % 
 	$(LN_S) $(CDDIR)/$* $(ABI32_INT64_DIR)
 
-libs:: $(ABI32_INT64_DIR) $(ABI32_INT64_FILES)
-	cd $(ABI32_INT64_DIR) && $(MAKE) FREEBL_CHILD_BUILD=1 USE_ABI32_INT64=1 \
- FREEBL_PARENT=$(CDDIR) CORE_DEPTH=$(CDDIR)/$(CORE_DEPTH) libs
+release_md libs:: $(ABI32_INT64_DIR) $(ABI32_INT64_FILES)
+	cd $(ABI32_INT64_DIR) && $(MAKE) FREEBL_CHILD_BUILD=1 \
+ USE_ABI32_INT64=1 FREEBL_PARENT=../.. CORE_DEPTH=../../$(CORE_DEPTH) $@
 endif
 
 ######################## END of 32-bit stuff #########################
 
 else # above is 32-bit builds, below is 64-bit builds
 
 ######################## ABI64_FPU stuff #########################
 ifdef HAVE_ABI64_FPU
 ABI64_FPU_DIR = $(OBJDIR)/$(OS_TARGET)_ABI64_FPU
 ABI64_FPU_FILES = $(addprefix $(ABI64_FPU_DIR)/, $(FILES2LN))
 ALL_TRASH += $(ABI64_FPU_DIR) 
 
 $(ABI64_FPU_DIR):
 	-mkdir $(ABI64_FPU_DIR)
-	-$(LN_S) $(CDDIR)/mpi $(ABI64_FPU_DIR)
 
 $(ABI64_FPU_FILES) : $(ABI64_FPU_DIR)/% : % 
 	$(LN_S) $(CDDIR)/$* $(ABI64_FPU_DIR)
 
-libs:: $(ABI64_FPU_DIR) $(ABI64_FPU_FILES)
+release_md libs:: $(ABI64_FPU_DIR) $(ABI64_FPU_FILES)
 	cd $(ABI64_FPU_DIR) && $(MAKE) FREEBL_CHILD_BUILD=1 USE_ABI64_FPU=1 \
- FREEBL_PARENT=$(CDDIR) CORE_DEPTH=$(CDDIR)/$(CORE_DEPTH) libs
+ FREEBL_PARENT=../.. CORE_DEPTH=../../$(CORE_DEPTH) $@
 endif
 
 ######################## ABI64_INT stuff #########################
 ifdef HAVE_ABI64_INT
 ABI64_INT_DIR = $(OBJDIR)/$(OS_TARGET)_ABI64_INT
 ABI64_INT_FILES = $(addprefix $(ABI64_INT_DIR)/, $(FILES2LN))
 ALL_TRASH += $(ABI64_INT_DIR) 
 
 $(ABI64_INT_DIR):
 	-mkdir $(ABI64_INT_DIR)
-	-$(LN_S) $(CDDIR)/mpi $(ABI64_INT_DIR)
 
 $(ABI64_INT_FILES) : $(ABI64_INT_DIR)/% : % 
 	$(LN_S) $(CDDIR)/$* $(ABI64_INT_DIR)
 
-libs:: $(ABI64_INT_DIR) $(ABI64_INT_FILES)
+release_md libs:: $(ABI64_INT_DIR) $(ABI64_INT_FILES)
 	cd $(ABI64_INT_DIR) && $(MAKE) FREEBL_CHILD_BUILD=1 USE_ABI64_INT=1 \
- FREEBL_PARENT=$(CDDIR) CORE_DEPTH=$(CDDIR)/$(CORE_DEPTH) libs
+ FREEBL_PARENT=../.. CORE_DEPTH=../../$(CORE_DEPTH) $@
 endif
 
 endif # 32b or 64b recursive builds
 
 endif # FREEBL_BUILD_SINGLE_SHLIB
-release_md:: $(libs)
 
 endif  # FREEBL_CHILD_BUILD
 
 # Bugzilla Bug 209827: disable optimization to work around what appears
 # to be a VACPP optimizer bug.
 ifdef XP_OS2_VACPP
 $(OBJDIR)/alg2268.obj: alg2268.c
 	@$(MAKE_OBJDIR)