common.mk 1.4 KB

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