common.mk 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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:=$(call qstrip,$(CONFIG_MUSL_VERSION))
  11. PKG_RELEASE=1
  12. PKG_MD5SUM:=ac52ccaec6b06ab0f289d37e8436859b
  13. PKG_SOURCE_URL:=http://www.musl-libc.org/releases
  14. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  15. LIBC_SO_VERSION:=$(PKG_VERSION)
  16. PATCH_DIR:=$(PATH_PREFIX)/patches
  17. HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)-$(PKG_VERSION)
  18. include $(INCLUDE_DIR)/toolchain-build.mk
  19. include $(INCLUDE_DIR)/hardening.mk
  20. MUSL_CONFIGURE:= \
  21. $(TARGET_CONFIGURE_OPTS) \
  22. CFLAGS="$(TARGET_CFLAGS)" \
  23. CROSS_COMPILE="$(TARGET_CROSS)" \
  24. $(HOST_BUILD_DIR)/configure \
  25. --prefix=/ \
  26. --host=$(GNU_HOST_NAME) \
  27. --target=$(REAL_GNU_TARGET_NAME) \
  28. --disable-gcc-wrapper \
  29. --enable-debug
  30. define Host/Prepare
  31. $(call Host/Prepare/Default)
  32. $(if $(strip $(QUILT)), \
  33. cd $(HOST_BUILD_DIR); \
  34. if $(QUILT_CMD) next >/dev/null 2>&1; then \
  35. $(QUILT_CMD) push -a; \
  36. fi
  37. )
  38. ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
  39. endef
  40. define Host/Configure
  41. ( cd $(HOST_BUILD_DIR); rm -f config.cache; \
  42. $(MUSL_CONFIGURE) \
  43. );
  44. endef
  45. define Host/Clean
  46. rm -rf \
  47. $(HOST_BUILD_DIR) \
  48. $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) \
  49. $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev
  50. endef