package/rpi-userland: don't install file in random location
[buildroot-gz.git] / package / jimtcl / jimtcl.mk
blob1c1a6b82a3711872a84b5946fc76f5e2d1d29262
1 ################################################################################
3 # jimtcl
5 ################################################################################
7 JIMTCL_VERSION = 0.75
8 JIMTCL_SITE = http://snapshot.debian.org/archive/debian/20141023T043132Z/pool/main/j/jimtcl
9 JIMTCL_SOURCE = jimtcl_$(JIMTCL_VERSION).orig.tar.xz
10 JIMTCL_INSTALL_STAGING = YES
11 JIMTCL_LICENSE = BSD-2c
12 JIMTCL_LICENSE_FILES = LICENSE
14 JIMTCL_HEADERS_TO_INSTALL = \
15 jim.h \
16 jim-eventloop.h \
17 jim-signal.h \
18 jim-subcmd.h \
19 jim-win32compat.h \
20 jim-config.h \
22 ifeq ($(BR2_PACKAGE_TCL),)
23 define JIMTCL_LINK_TCLSH
24 ln -sf jimsh $(TARGET_DIR)/usr/bin/tclsh
25 endef
26 endif
28 ifeq ($(BR2_STATIC_LIBS),y)
29 define JIMTCL_INSTALL_LIB
30 $(INSTALL) -m 0644 -D $(@D)/libjim.a $(1)/usr/lib/libjim.a
31 endef
32 else
33 JIMTCL_SHARED = --shared
34 define JIMTCL_INSTALL_LIB
35 $(INSTALL) -m 0755 -D $(@D)/libjim.so.$(JIMTCL_VERSION) \
36 $(1)/usr/lib/libjim.so.$(JIMTCL_VERSION)
37 ln -sf libjim.so.$(JIMTCL_VERSION) $(1)/usr/lib/libjim.so
38 endef
39 endif
41 define JIMTCL_CONFIGURE_CMDS
42 (cd $(@D); \
43 $(TARGET_CONFIGURE_OPTS) CCACHE=none \
44 ./configure --prefix=/usr \
45 $(JIMTCL_SHARED) \
47 endef
49 # -fPIC is mandatory to build shared libraries on certain architectures
50 # (e.g. SPARC) and causes no harm or drawbacks on other architectures
51 define JIMTCL_BUILD_CMDS
52 SH_CFLAGS="-fPIC" \
53 SHOBJ_CFLAGS="-fPIC" \
54 $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
55 endef
57 define JIMTCL_INSTALL_STAGING_CMDS
58 for i in $(JIMTCL_HEADERS_TO_INSTALL); do \
59 cp -a $(@D)/$$i $(STAGING_DIR)/usr/include/ || exit 1 ; \
60 done; \
61 $(call JIMTCL_INSTALL_LIB,$(STAGING_DIR))
62 endef
64 define JIMTCL_INSTALL_TARGET_CMDS
65 $(INSTALL) -D $(@D)/jimsh $(TARGET_DIR)/usr/bin/jimsh
66 $(call JIMTCL_INSTALL_LIB,$(TARGET_DIR))
67 $(JIMTCL_LINK_TCLSH)
68 endef
70 $(eval $(generic-package))