package/jimtcl: add host variant
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Sun, 22 Dec 2019 14:02:36 +0000 (15:02 +0100)
committerYann E. MORIN <yann.morin.1998@free.fr>
Sun, 22 Dec 2019 15:01:00 +0000 (16:01 +0100)
host-jimtcl is needed for host-openocd

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
[yann.morin.1998@free.fr:
  - call hook to update config.{guess,sub}
  - reformat the build commands
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
package/jimtcl/jimtcl.mk

index 643a87d5c4823e3163c194ae4c3f15b3b67e8f05..e712dff0beb5e2b7eaf7ee96c22703c85ed72b90 100644 (file)
@@ -42,6 +42,7 @@ endif
 # Buildroot, so update config.guess / config.sub like we do in
 # pkg-autotools.mk
 JIMTCL_POST_PATCH_HOOKS += UPDATE_CONFIG_HOOK
+HOST_JIMTCL_POST_PATCH_HOOKS += UPDATE_CONFIG_HOOK
 
 # jimtcl really wants to find a existing $CXX, so feed it false
 # when we do not have one.
@@ -78,4 +79,25 @@ define JIMTCL_INSTALL_TARGET_CMDS
        $(JIMTCL_LINK_TCLSH)
 endef
 
+define HOST_JIMTCL_CONFIGURE_CMDS
+       cd $(@D) && \
+               $(HOST_CONFIGURE_OPTS) \
+               CCACHE=none \
+               ./configure --prefix=$(HOST_DIR) --shared
+endef
+
+define HOST_JIMTCL_BUILD_CMDS
+       $(HOST_MAKE_ENV) $(MAKE) -C $(@D)
+endef
+
+define HOST_JIMTCL_INSTALL_CMDS
+       for i in $(JIMTCL_HEADERS_TO_INSTALL); do \
+               cp -a $(@D)/$$i $(HOST_DIR)/usr/include/ || exit 1 ; \
+       done;
+       $(INSTALL) -m 0755 -D $(@D)/libjim.so.$(JIMTCL_VERSION) \
+               $(HOST_DIR)/usr/lib/libjim.so.$(JIMTCL_VERSION)
+       ln -sf libjim.so.$(JIMTCL_VERSION) $(HOST_DIR)/usr/lib/libjim.so
+endef
+
 $(eval $(generic-package))
+$(eval $(host-generic-package))