lpeg: bump to version 1.0.1
[buildroot-gz.git] / package / libnss / libnss.mk
blob76532e8117a77cf1ef258b7350ca4527d32961ce
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 # --gc-sections triggers binutils ld segfault
17 # https://sourceware.org/bugzilla/show_bug.cgi?id=21180
18 ifeq ($(BR2_microblaze),y)
19 define LIBNSS_DROP_GC_SECTIONS
20 sed -i 's:-Wl,--gc-sections::g' $(@D)/nss/coreconf/Linux.mk
21 endef
23 LIBNSS_PRE_CONFIGURE_HOOKS += LIBNSS_DROP_GC_SECTIONS
24 endif
26 LIBNSS_BUILD_VARS = \
27 MOZILLA_CLIENT=1 \
28 NSPR_INCLUDE_DIR=$(STAGING_DIR)/usr/include/nspr \
29 NSPR_LIB_DIR=$(STAGING_DIR)/usr/lib \
30 BUILD_OPT=1 \
31 NS_USE_GCC=1 \
32 NSS_DISABLE_GTESTS=1 \
33 NSS_USE_SYSTEM_SQLITE=1 \
34 NSS_ENABLE_ECC=1 \
35 NATIVE_CC="$(HOSTCC)" \
36 TARGETCC="$(TARGET_CC)" \
37 TARGETCCC="$(TARGET_CXX)" \
38 TARGETRANLIB="$(TARGET_RANLIB)" \
39 OS_ARCH="Linux" \
40 OS_RELEASE="2.6" \
41 OS_TEST="$(ARCH)"
43 # #pragma usage needs gcc >= 4.8
44 # See https://bugzilla.mozilla.org/show_bug.cgi?id=1226179
45 ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_4_8),)
46 LIBNSS_BUILD_VARS += NSS_ENABLE_WERROR=0
47 endif
49 ifeq ($(BR2_ARCH_IS_64),y)
50 # MIPS64 n32 is treated as a 32-bit architecture by libnss.
51 # See: https://bugzilla.mozilla.org/show_bug.cgi?id=1010730
52 ifeq ($(BR2_MIPS_NABI32),)
53 LIBNSS_BUILD_VARS += USE_64=1
54 endif
55 endif
57 define LIBNSS_BUILD_CMDS
58 $(TARGET_MAKE_ENV) $(MAKE1) -C $(@D)/nss coreconf \
59 SOURCE_MD_DIR=$(@D)/$(LIBNSS_DISTDIR) \
60 DIST=$(@D)/$(LIBNSS_DISTDIR) \
61 CHECKLOC= \
62 $(LIBNSS_BUILD_VARS)
63 $(TARGET_MAKE_ENV) $(MAKE1) -C $(@D)/nss lib/dbm all \
64 SOURCE_MD_DIR=$(@D)/$(LIBNSS_DISTDIR) \
65 DIST=$(@D)/$(LIBNSS_DISTDIR) \
66 CHECKLOC= \
67 $(LIBNSS_BUILD_VARS) TARGET_OPTIMIZER="$(TARGET_CFLAGS)" \
68 NATIVE_FLAGS="$(HOST_CFLAGS)"
69 endef
71 define LIBNSS_INSTALL_STAGING_CMDS
72 $(INSTALL) -m 755 -t $(STAGING_DIR)/usr/lib/ \
73 $(@D)/$(LIBNSS_DISTDIR)/lib/*.so
74 $(INSTALL) -m 755 -d $(STAGING_DIR)/usr/include/nss
75 $(INSTALL) -m 644 -t $(STAGING_DIR)/usr/include/nss \
76 $(@D)/$(LIBNSS_DISTDIR)/public/nss/*
77 $(INSTALL) -m 755 -t $(STAGING_DIR)/usr/lib/ \
78 $(@D)/$(LIBNSS_DISTDIR)/lib/*.a
79 $(INSTALL) -D -m 0644 $(TOPDIR)/package/libnss/nss.pc.in \
80 $(STAGING_DIR)/usr/lib/pkgconfig/nss.pc
81 $(SED) 's/@VERSION@/$(LIBNSS_VERSION)/g;' \
82 $(STAGING_DIR)/usr/lib/pkgconfig/nss.pc
83 endef
85 define LIBNSS_INSTALL_TARGET_CMDS
86 $(INSTALL) -m 755 -t $(TARGET_DIR)/usr/lib/ \
87 $(@D)/$(LIBNSS_DISTDIR)/lib/*.so
88 $(INSTALL) -m 755 -d $(TARGET_DIR)/usr/include/nss
89 $(INSTALL) -m 644 -t $(TARGET_DIR)/usr/include/nss \
90 $(@D)/$(LIBNSS_DISTDIR)/public/nss/*
91 $(INSTALL) -m 755 -t $(TARGET_DIR)/usr/lib/ \
92 $(@D)/$(LIBNSS_DISTDIR)/lib/*.a
93 $(INSTALL) -D -m 0644 $(TOPDIR)/package/libnss/nss.pc.in \
94 $(TARGET_DIR)/usr/lib/pkgconfig/nss.pc
95 $(SED) 's/@VERSION@/$(LIBNSS_VERSION)/g;' \
96 $(TARGET_DIR)/usr/lib/pkgconfig/nss.pc
97 endef
99 $(eval $(generic-package))