nftables: bump to 1.0.1
[openwrt/openwrt.git] / toolchain / musl / common.mk
1 #
2 # Copyright (C) 2012-2013 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 include $(TOPDIR)/rules.mk
8 include $(INCLUDE_DIR)/target.mk
9
10 PKG_NAME:=musl
11 PKG_VERSION:=1.2.2
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=https://musl.libc.org/releases/
16 PKG_HASH:=9b969322012d796dc23dda27a35866034fa67d8fb67e0e2c45c913c3d43219dd
17
18 LIBC_SO_VERSION:=$(PKG_VERSION)
19 PATCH_DIR:=$(PATH_PREFIX)/patches
20
21 BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN)
22 HOST_BUILD_PREFIX:=$(TOOLCHAIN_DIR)
23 HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)-$(PKG_VERSION)
24
25 include $(INCLUDE_DIR)/host-build.mk
26 include $(INCLUDE_DIR)/hardening.mk
27
28 TARGET_CFLAGS:= $(filter-out -O%,$(TARGET_CFLAGS))
29 TARGET_CFLAGS+= $(if $(CONFIG_MUSL_DISABLE_CRYPT_SIZE_HACK),,-DCRYPT_SIZE_HACK)
30
31 MUSL_CONFIGURE:= \
32 $(TARGET_CONFIGURE_OPTS) \
33 CFLAGS="$(TARGET_CFLAGS)" \
34 CROSS_COMPILE="$(TARGET_CROSS)" \
35 $(HOST_BUILD_DIR)/configure \
36 --prefix=/ \
37 --host=$(GNU_HOST_NAME) \
38 --target=$(REAL_GNU_TARGET_NAME) \
39 --disable-gcc-wrapper \
40 --enable-debug \
41 --enable-optimize
42
43 define Host/Configure
44 ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
45 ( cd $(HOST_BUILD_DIR); rm -f config.cache; \
46 $(MUSL_CONFIGURE) \
47 );
48 endef
49
50 define Host/Clean
51 rm -rf \
52 $(HOST_BUILD_DIR) \
53 $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) \
54 $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev
55 endef