toolchain: bump Codescape IMG MIPS version to 2016.05-06
[buildroot-gz.git] / package / libnss / libnss.mk
blob4a40b0a8d726f8ea318be4b3aea7770829896801
1 ################################################################################
3 # libnss
5 ################################################################################
7 LIBNSS_VERSION = 3.27.2
8 LIBNSS_SOURCE = nss-$(LIBNSS_VERSION).tar.gz
9 LIBNSS_SITE = https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_$(subst .,_,$(LIBNSS_VERSION))_RTM/src
10 LIBNSS_DISTDIR = dist
11 LIBNSS_INSTALL_STAGING = YES
12 LIBNSS_DEPENDENCIES = libnspr sqlite zlib
13 LIBNSS_LICENSE = MPLv2.0
14 LIBNSS_LICENSE_FILES = nss/COPYING
16 LIBNSS_BUILD_VARS = \
17 MOZILLA_CLIENT=1 \
18 NSPR_INCLUDE_DIR=$(STAGING_DIR)/usr/include/nspr \
19 NSPR_LIB_DIR=$(STAGING_DIR)/usr/lib \
20 BUILD_OPT=1 \
21 NS_USE_GCC=1 \
22 NSS_DISABLE_GTESTS=1 \
23 NSS_USE_SYSTEM_SQLITE=1 \
24 NSS_ENABLE_ECC=1 \
25 NATIVE_CC="$(HOSTCC)" \
26 TARGETCC="$(TARGET_CC)" \
27 TARGETCCC="$(TARGET_CXX)" \
28 TARGETRANLIB="$(TARGET_RANLIB)" \
29 OS_ARCH="Linux" \
30 OS_RELEASE="2.6" \
31 OS_TEST="$(ARCH)"
33 # #pragma usage needs gcc >= 4.8
34 # See https://bugzilla.mozilla.org/show_bug.cgi?id=1226179
35 ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_4_8),)
36 LIBNSS_BUILD_VARS += NSS_ENABLE_WERROR=0
37 endif
39 ifeq ($(BR2_ARCH_IS_64),y)
40 # MIPS64 n32 is treated as a 32-bit architecture by libnss.
41 # See: https://bugzilla.mozilla.org/show_bug.cgi?id=1010730
42 ifeq ($(BR2_MIPS_NABI32),)
43 LIBNSS_BUILD_VARS += USE_64=1
44 endif
45 endif
47 define LIBNSS_BUILD_CMDS
48 $(TARGET_MAKE_ENV) $(MAKE1) -C $(@D)/nss coreconf \
49 SOURCE_MD_DIR=$(@D)/$(LIBNSS_DISTDIR) \
50 DIST=$(@D)/$(LIBNSS_DISTDIR) \
51 CHECKLOC= \
52 $(LIBNSS_BUILD_VARS)
53 $(TARGET_MAKE_ENV) $(MAKE1) -C $(@D)/nss lib/dbm all \
54 SOURCE_MD_DIR=$(@D)/$(LIBNSS_DISTDIR) \
55 DIST=$(@D)/$(LIBNSS_DISTDIR) \
56 CHECKLOC= \
57 $(LIBNSS_BUILD_VARS) TARGET_OPTIMIZER="$(TARGET_CFLAGS)" \
58 NATIVE_FLAGS="$(HOST_CFLAGS)"
59 endef
61 define LIBNSS_INSTALL_STAGING_CMDS
62 $(INSTALL) -m 755 -t $(STAGING_DIR)/usr/lib/ \
63 $(@D)/$(LIBNSS_DISTDIR)/lib/*.so
64 $(INSTALL) -m 755 -d $(STAGING_DIR)/usr/include/nss
65 $(INSTALL) -m 644 -t $(STAGING_DIR)/usr/include/nss \
66 $(@D)/$(LIBNSS_DISTDIR)/public/nss/*
67 $(INSTALL) -m 755 -t $(STAGING_DIR)/usr/lib/ \
68 $(@D)/$(LIBNSS_DISTDIR)/lib/*.a
69 $(INSTALL) -D -m 0644 $(TOPDIR)/package/libnss/nss.pc.in \
70 $(STAGING_DIR)/usr/lib/pkgconfig/nss.pc
71 $(SED) 's/@VERSION@/$(LIBNSS_VERSION)/g;' \
72 $(STAGING_DIR)/usr/lib/pkgconfig/nss.pc
73 endef
75 define LIBNSS_INSTALL_TARGET_CMDS
76 $(INSTALL) -m 755 -t $(TARGET_DIR)/usr/lib/ \
77 $(@D)/$(LIBNSS_DISTDIR)/lib/*.so
78 $(INSTALL) -m 755 -d $(TARGET_DIR)/usr/include/nss
79 $(INSTALL) -m 644 -t $(TARGET_DIR)/usr/include/nss \
80 $(@D)/$(LIBNSS_DISTDIR)/public/nss/*
81 $(INSTALL) -m 755 -t $(TARGET_DIR)/usr/lib/ \
82 $(@D)/$(LIBNSS_DISTDIR)/lib/*.a
83 $(INSTALL) -D -m 0644 $(TOPDIR)/package/libnss/nss.pc.in \
84 $(TARGET_DIR)/usr/lib/pkgconfig/nss.pc
85 $(SED) 's/@VERSION@/$(LIBNSS_VERSION)/g;' \
86 $(TARGET_DIR)/usr/lib/pkgconfig/nss.pc
87 endef
89 $(eval $(generic-package))