jimtcl.mk 2.2 KB

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