upgrade Linaro GCC 4.8 to 4.8-2013.11
[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:=$(call qstrip,$(CONFIG_MUSL_VERSION))
12 PKG_RELEASE=$(PKG_SOURCE_VERSION)
13
14 PKG_SOURCE_VERSION_0.9.8:=e6dcebd5efa2d390f0a24dc11444024e9fd1990c
15 PKG_SOURCE_VERSION_0.9.9:=a57ac9bf64ba202bd94d1b81bddd93b850c7b9d6
16 PKG_SOURCE_VERSION_0.9.10:=7bec92e793d4b8a349796848cf43c7329b0f2ed0
17 PKG_SOURCE_VERSION_0.9.11:=6688a778b0419eab32e715f269319248edee9da5
18
19 PKG_SOURCE_PROTO:=git
20 PKG_SOURCE_URL:=git://git.musl-libc.org/musl
21 PKG_SOURCE_SUBDIR=$(PKG_NAME)-$(PKG_VERSION)
22 PKG_SOURCE_VERSION:=$(PKG_SOURCE_VERSION_$(PKG_VERSION))
23 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
24 LIBC_SO_VERSION:=$(PKG_VERSION)
25 PATCH_DIR:=$(PATH_PREFIX)/patches-$(PKG_VERSION)
26 CONFIG_DIR:=$(PATH_PREFIX)/config-$(PKG_VERSION)
27
28 HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)-$(PKG_VERSION)
29
30 include $(INCLUDE_DIR)/toolchain-build.mk
31
32 MUSL_CONFIGURE:= \
33 $(TARGET_CONFIGURE_OPTS) \
34 CFLAGS="$(TARGET_CFLAGS)" \
35 CROSS_COMPILE="$(TARGET_CROSS)" \
36 $(HOST_BUILD_DIR)/configure \
37 --prefix=/ \
38 --host=$(GNU_HOST_NAME) \
39 --target=$(REAL_GNU_TARGET_NAME) \
40 --disable-gcc-wrapper
41
42 ifeq ($(CONFIG_MUSL_ENABLE_DEBUG),y)
43 MUSL_CONFIGURE+= \
44 --enable-debug
45 endif
46
47 define Host/Prepare
48 $(call Host/Prepare/Default)
49 $(if $(strip $(QUILT)), \
50 cd $(HOST_BUILD_DIR); \
51 if $(QUILT_CMD) next >/dev/null 2>&1; then \
52 $(QUILT_CMD) push -a; \
53 fi
54 )
55 ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
56 endef
57
58 define Host/Configure
59 ( cd $(HOST_BUILD_DIR); rm -f config.cache; \
60 $(MUSL_CONFIGURE) \
61 );
62 endef
63
64 define Host/Clean
65 rm -rf \
66 $(HOST_BUILD_DIR) \
67 $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) \
68 $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev
69 endef