common.mk 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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.24
  11. PKG_RELEASE:=1
  12. PKG_SOURCE_PROTO:=git
  13. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  14. PKG_SOURCE_VERSION:=ea9525c8bcf6170df59364c4bcd616de1acf8703
  15. PKG_MIRROR_HASH:=6975c45b9bfe586ac00dbfcd1b1a13ab110af0528028ab3dee03e23e2c0763e5
  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. TARGET_CFLAGS+= $(if $(CONFIG_MUSL_DISABLE_CRYPT_SIZE_HACK),,-DCRYPT_SIZE_HACK)
  27. MUSL_CONFIGURE:= \
  28. $(TARGET_CONFIGURE_OPTS) \
  29. CFLAGS="$(TARGET_CFLAGS)" \
  30. CROSS_COMPILE="$(TARGET_CROSS)" \
  31. $(HOST_BUILD_DIR)/configure \
  32. --prefix=/ \
  33. --host=$(GNU_HOST_NAME) \
  34. --target=$(REAL_GNU_TARGET_NAME) \
  35. --disable-gcc-wrapper \
  36. --enable-debug \
  37. --enable-optimize
  38. define Host/Configure
  39. ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
  40. ( cd $(HOST_BUILD_DIR); rm -f config.cache; \
  41. $(MUSL_CONFIGURE) \
  42. );
  43. endef
  44. define Host/Clean
  45. rm -rf \
  46. $(HOST_BUILD_DIR) \
  47. $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) \
  48. $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev
  49. endef