common.mk 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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:=14e8c5ac74f887d53256b3dcaf9b4aaa
  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. MUSL_CONFIGURE:= \
  20. $(TARGET_CONFIGURE_OPTS) \
  21. CFLAGS="$(TARGET_CFLAGS)" \
  22. CROSS_COMPILE="$(TARGET_CROSS)" \
  23. $(HOST_BUILD_DIR)/configure \
  24. --prefix=/ \
  25. --host=$(GNU_HOST_NAME) \
  26. --target=$(REAL_GNU_TARGET_NAME) \
  27. --disable-gcc-wrapper
  28. ifeq ($(CONFIG_MUSL_ENABLE_DEBUG),y)
  29. MUSL_CONFIGURE+= \
  30. --enable-debug
  31. endif
  32. define Host/Prepare
  33. $(call Host/Prepare/Default)
  34. $(if $(strip $(QUILT)), \
  35. cd $(HOST_BUILD_DIR); \
  36. if $(QUILT_CMD) next >/dev/null 2>&1; then \
  37. $(QUILT_CMD) push -a; \
  38. fi
  39. )
  40. ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
  41. endef
  42. define Host/Configure
  43. ( cd $(HOST_BUILD_DIR); rm -f config.cache; \
  44. $(MUSL_CONFIGURE) \
  45. );
  46. endef
  47. define Host/Clean
  48. rm -rf \
  49. $(HOST_BUILD_DIR) \
  50. $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) \
  51. $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev
  52. endef