1From 46ab1ca6e6fb8e1196e0665a54506dff370f8f2a Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Wed, 22 Feb 2017 11:36:11 +0200
4Subject: [PATCH] nss: fix support cross compiling
5
6Let some make variables be assigned from outside makefile.
7
8Upstream-Status: Inappropriate [configuration]
9Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
10Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
11
12---
13 nss/coreconf/arch.mk    | 4 ++--
14 nss/lib/freebl/Makefile | 6 ++++++
15 2 files changed, 8 insertions(+), 2 deletions(-)
16
17diff --git a/nss/coreconf/arch.mk b/nss/coreconf/arch.mk
18index 17e9fae..bc4180a 100644
19--- a/nss/coreconf/arch.mk
20+++ b/nss/coreconf/arch.mk
21@@ -26,11 +26,11 @@ OS_ARCH := $(subst /,_,$(shell uname -s))
22 # Attempt to differentiate between sparc and x86 Solaris
23 #
24
25-OS_TEST := $(shell uname -m)
26+OS_TEST ?= $(shell uname -m)
27 ifeq ($(OS_TEST),i86pc)
28     OS_RELEASE := $(shell uname -r)_$(OS_TEST)
29 else
30-    OS_RELEASE := $(shell uname -r)
31+    OS_RELEASE ?= $(shell uname -r)
32 endif
33
34
35diff --git a/nss/lib/freebl/Makefile b/nss/lib/freebl/Makefile
36index eeee90a..7ee8736 100644
37--- a/nss/lib/freebl/Makefile
38+++ b/nss/lib/freebl/Makefile
39@@ -36,6 +36,12 @@ ifdef USE_64
40 	DEFINES += -DNSS_USE_64
41 endif
42
43+ifeq ($(OS_TEST),mips)
44+ifndef USE_64
45+       DEFINES += -DNS_PTR_LE_32
46+endif
47+endif
48+
49 ifdef USE_ABI32_FPU
50 	DEFINES += -DNSS_USE_ABI32_FPU
51 endif
52