2013-06-28 16:32:24 +02:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# jimtcl
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
2021-04-03 14:42:30 +02:00
|
|
|
JIMTCL_VERSION = 0.80
|
2019-12-15 11:29:25 +01:00
|
|
|
JIMTCL_SITE = $(call github,msteveb,jimtcl,$(JIMTCL_VERSION))
|
2013-06-28 16:32:24 +02:00
|
|
|
JIMTCL_INSTALL_STAGING = YES
|
2017-03-30 15:43:39 +02:00
|
|
|
JIMTCL_LICENSE = BSD-2-Clause
|
2013-07-10 19:25:40 +02:00
|
|
|
JIMTCL_LICENSE_FILES = LICENSE
|
2013-06-28 16:32:24 +02:00
|
|
|
|
|
|
|
JIMTCL_HEADERS_TO_INSTALL = \
|
|
|
|
jim.h \
|
|
|
|
jim-eventloop.h \
|
|
|
|
jim-signal.h \
|
|
|
|
jim-subcmd.h \
|
|
|
|
jim-win32compat.h \
|
2017-04-05 00:50:14 +02:00
|
|
|
jim-config.h
|
2013-06-28 16:32:24 +02:00
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_TCL),)
|
|
|
|
define JIMTCL_LINK_TCLSH
|
|
|
|
ln -sf jimsh $(TARGET_DIR)/usr/bin/tclsh
|
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2014-12-03 22:41:29 +01:00
|
|
|
ifeq ($(BR2_STATIC_LIBS),y)
|
2015-04-01 23:14:38 +02:00
|
|
|
define JIMTCL_INSTALL_LIB
|
|
|
|
$(INSTALL) -m 0644 -D $(@D)/libjim.a $(1)/usr/lib/libjim.a
|
|
|
|
endef
|
2013-06-28 16:32:24 +02:00
|
|
|
else
|
|
|
|
JIMTCL_SHARED = --shared
|
2015-01-15 18:18:14 +01:00
|
|
|
define JIMTCL_INSTALL_LIB
|
2015-04-01 23:14:38 +02:00
|
|
|
$(INSTALL) -m 0755 -D $(@D)/libjim.so.$(JIMTCL_VERSION) \
|
2015-11-23 17:47:43 +01:00
|
|
|
$(1)/usr/lib/libjim.so.$(JIMTCL_VERSION)
|
|
|
|
ln -sf libjim.so.$(JIMTCL_VERSION) $(1)/usr/lib/libjim.so
|
2015-01-15 18:18:14 +01:00
|
|
|
endef
|
2013-06-28 16:32:24 +02:00
|
|
|
endif
|
|
|
|
|
2017-11-06 15:17:09 +01:00
|
|
|
# build system doesn't use autotools, but does use an old version of
|
|
|
|
# gnuconfig which doesn't know all the architectures supported by
|
|
|
|
# Buildroot, so update config.guess / config.sub like we do in
|
|
|
|
# pkg-autotools.mk
|
|
|
|
JIMTCL_POST_PATCH_HOOKS += UPDATE_CONFIG_HOOK
|
2019-12-22 15:02:36 +01:00
|
|
|
HOST_JIMTCL_POST_PATCH_HOOKS += UPDATE_CONFIG_HOOK
|
2017-11-06 15:17:09 +01:00
|
|
|
|
2018-03-31 09:20:19 +02:00
|
|
|
# jimtcl really wants to find a existing $CXX, so feed it false
|
|
|
|
# when we do not have one.
|
2013-06-28 16:32:24 +02:00
|
|
|
define JIMTCL_CONFIGURE_CMDS
|
|
|
|
(cd $(@D); \
|
2018-03-31 09:20:19 +02:00
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
|
|
|
CCACHE=none \
|
|
|
|
$(if $(BR2_INSTALL_LIBSTDCPP),,CXX=false) \
|
2013-06-28 16:32:24 +02:00
|
|
|
./configure --prefix=/usr \
|
2017-11-03 23:28:37 +01:00
|
|
|
--host=$(GNU_TARGET_NAME) \
|
|
|
|
--build=$(GNU_HOST_NAME) \
|
2013-06-28 16:32:24 +02:00
|
|
|
$(JIMTCL_SHARED) \
|
|
|
|
)
|
|
|
|
endef
|
|
|
|
|
2015-11-23 17:48:53 +01:00
|
|
|
# -fPIC is mandatory to build shared libraries on certain architectures
|
|
|
|
# (e.g. SPARC) and causes no harm or drawbacks on other architectures
|
2013-06-28 16:32:24 +02:00
|
|
|
define JIMTCL_BUILD_CMDS
|
2015-11-23 17:48:53 +01:00
|
|
|
SH_CFLAGS="-fPIC" \
|
|
|
|
SHOBJ_CFLAGS="-fPIC" \
|
2016-10-17 18:06:00 +02:00
|
|
|
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
|
2013-06-28 16:32:24 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define JIMTCL_INSTALL_STAGING_CMDS
|
|
|
|
for i in $(JIMTCL_HEADERS_TO_INSTALL); do \
|
2014-11-30 15:18:33 +01:00
|
|
|
cp -a $(@D)/$$i $(STAGING_DIR)/usr/include/ || exit 1 ; \
|
2013-06-28 16:32:24 +02:00
|
|
|
done; \
|
2015-04-01 23:14:38 +02:00
|
|
|
$(call JIMTCL_INSTALL_LIB,$(STAGING_DIR))
|
2013-06-28 16:32:24 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define JIMTCL_INSTALL_TARGET_CMDS
|
|
|
|
$(INSTALL) -D $(@D)/jimsh $(TARGET_DIR)/usr/bin/jimsh
|
2015-04-01 23:14:38 +02:00
|
|
|
$(call JIMTCL_INSTALL_LIB,$(TARGET_DIR))
|
2013-06-28 16:32:24 +02:00
|
|
|
$(JIMTCL_LINK_TCLSH)
|
|
|
|
endef
|
|
|
|
|
2019-12-22 15:02:36 +01:00
|
|
|
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
|
|
|
|
|
2013-06-28 16:32:24 +02:00
|
|
|
$(eval $(generic-package))
|
2019-12-22 15:02:36 +01:00
|
|
|
$(eval $(host-generic-package))
|