jimtcl.mk 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. ################################################################################
  2. #
  3. # jimtcl
  4. #
  5. ################################################################################
  6. JIMTCL_VERSION = 0.79
  7. JIMTCL_SITE = $(call github,msteveb,jimtcl,$(JIMTCL_VERSION))
  8. JIMTCL_INSTALL_STAGING = YES
  9. JIMTCL_LICENSE = BSD-2-Clause
  10. JIMTCL_LICENSE_FILES = LICENSE
  11. JIMTCL_HEADERS_TO_INSTALL = \
  12. jim.h \
  13. jim-eventloop.h \
  14. jim-signal.h \
  15. jim-subcmd.h \
  16. jim-win32compat.h \
  17. jim-config.h
  18. ifeq ($(BR2_PACKAGE_TCL),)
  19. define JIMTCL_LINK_TCLSH
  20. ln -sf jimsh $(TARGET_DIR)/usr/bin/tclsh
  21. endef
  22. endif
  23. ifeq ($(BR2_STATIC_LIBS),y)
  24. define JIMTCL_INSTALL_LIB
  25. $(INSTALL) -m 0644 -D $(@D)/libjim.a $(1)/usr/lib/libjim.a
  26. endef
  27. else
  28. JIMTCL_SHARED = --shared
  29. define JIMTCL_INSTALL_LIB
  30. $(INSTALL) -m 0755 -D $(@D)/libjim.so.$(JIMTCL_VERSION) \
  31. $(1)/usr/lib/libjim.so.$(JIMTCL_VERSION)
  32. ln -sf libjim.so.$(JIMTCL_VERSION) $(1)/usr/lib/libjim.so
  33. endef
  34. endif
  35. # build system doesn't use autotools, but does use an old version of
  36. # gnuconfig which doesn't know all the architectures supported by
  37. # Buildroot, so update config.guess / config.sub like we do in
  38. # pkg-autotools.mk
  39. JIMTCL_POST_PATCH_HOOKS += UPDATE_CONFIG_HOOK
  40. # jimtcl really wants to find a existing $CXX, so feed it false
  41. # when we do not have one.
  42. define JIMTCL_CONFIGURE_CMDS
  43. (cd $(@D); \
  44. $(TARGET_CONFIGURE_OPTS) \
  45. CCACHE=none \
  46. $(if $(BR2_INSTALL_LIBSTDCPP),,CXX=false) \
  47. ./configure --prefix=/usr \
  48. --host=$(GNU_TARGET_NAME) \
  49. --build=$(GNU_HOST_NAME) \
  50. $(JIMTCL_SHARED) \
  51. )
  52. endef
  53. # -fPIC is mandatory to build shared libraries on certain architectures
  54. # (e.g. SPARC) and causes no harm or drawbacks on other architectures
  55. define JIMTCL_BUILD_CMDS
  56. SH_CFLAGS="-fPIC" \
  57. SHOBJ_CFLAGS="-fPIC" \
  58. $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
  59. endef
  60. define JIMTCL_INSTALL_STAGING_CMDS
  61. for i in $(JIMTCL_HEADERS_TO_INSTALL); do \
  62. cp -a $(@D)/$$i $(STAGING_DIR)/usr/include/ || exit 1 ; \
  63. done; \
  64. $(call JIMTCL_INSTALL_LIB,$(STAGING_DIR))
  65. endef
  66. define JIMTCL_INSTALL_TARGET_CMDS
  67. $(INSTALL) -D $(@D)/jimsh $(TARGET_DIR)/usr/bin/jimsh
  68. $(call JIMTCL_INSTALL_LIB,$(TARGET_DIR))
  69. $(JIMTCL_LINK_TCLSH)
  70. endef
  71. $(eval $(generic-package))