common.mk 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. PKG_NAME:=musl
  10. PKG_VERSION:=1.1.20
  11. PKG_RELEASE:=2
  12. PKG_SOURCE_PROTO:=git
  13. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  14. PKG_SOURCE_VERSION:=0fa1e638e87cf257e9f96b4019b2076afd674a19
  15. PKG_MIRROR_HASH:=0a49559e845f51aaf006539176a36d6527957affd2838e71fd43275b737e90fe
  16. PKG_SOURCE_URL:=git://git.musl-libc.org/musl
  17. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
  18. LIBC_SO_VERSION:=$(PKG_VERSION)
  19. PATCH_DIR:=$(PATH_PREFIX)/patches
  20. BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN)
  21. HOST_BUILD_PREFIX:=$(TOOLCHAIN_DIR)
  22. HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)-$(PKG_VERSION)
  23. include $(INCLUDE_DIR)/host-build.mk
  24. include $(INCLUDE_DIR)/hardening.mk
  25. TARGET_CFLAGS:= $(filter-out -O%,$(TARGET_CFLAGS))
  26. MUSL_CONFIGURE:= \
  27. $(TARGET_CONFIGURE_OPTS) \
  28. CFLAGS="$(TARGET_CFLAGS)" \
  29. CROSS_COMPILE="$(TARGET_CROSS)" \
  30. $(HOST_BUILD_DIR)/configure \
  31. --prefix=/ \
  32. --host=$(GNU_HOST_NAME) \
  33. --target=$(REAL_GNU_TARGET_NAME) \
  34. --disable-gcc-wrapper \
  35. --enable-debug \
  36. --enable-optimize
  37. define Host/Configure
  38. ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
  39. ( cd $(HOST_BUILD_DIR); rm -f config.cache; \
  40. $(MUSL_CONFIGURE) \
  41. );
  42. endef
  43. define Host/Clean
  44. rm -rf \
  45. $(HOST_BUILD_DIR) \
  46. $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) \
  47. $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev
  48. endef