1
0

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.21
  11. PKG_RELEASE:=1
  12. PKG_SOURCE_PROTO:=git
  13. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  14. PKG_SOURCE_VERSION:=1691b23955590d1eb66a11158fdd91c86337e886
  15. PKG_MIRROR_HASH:=4fa312d0ca020d31603ced84a7103fb328c6ae9508239491a228be17e7807147
  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