diff options
author | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2015-04-01 23:14:38 +0200 |
---|---|---|
committer | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2015-04-01 23:14:38 +0200 |
commit | ef854d14f1eb8baed98014d216be3b97e6b44f06 (patch) | |
tree | 9b0ffc3fc9e19d04cb5c3fc4f7ceb0171ae8eb35 /package/jimtcl/jimtcl.mk | |
parent | a4c2843fbbd03c88457ae0ca37fb32fa9c80cb48 (diff) | |
download | buildroot-ef854d14f1eb8baed98014d216be3b97e6b44f06.tar.gz buildroot-ef854d14f1eb8baed98014d216be3b97e6b44f06.zip |
jimtcl: fix installation in BR2_STATIC_LIBS case
As noticed by Yann E. Morin in the review of
http://patchwork.ozlabs.org/patch/429533/, there was something fishy
in the jimtcl installation logic:
ln -s libjim.$(JIMTCL_LIB) $(STAGING_DIR)/usr/lib/libjim.so
where JIMTCL_LIB has the value 'a' for BR2_STATIC_LIBS=y builds. Which
means we're linking libjim.so to libjim.a. Not great.
This commit therefore reworks the installation logic of the jimtcl.mk
package to install the shared library when BR2_STATIC_LIBS is not set,
and the static library when BR2_STATIC_LIBS is enabled. The macro
JIMTCL_INSTALL_LIB now takes as argument where the library should be
installed, so that it can be used for both the target and staging
installations.
Note that we can only either build the shared library *or* the static
library with the jimtcl build system. There is no possibility of
building both.
Reported-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/jimtcl/jimtcl.mk')
-rw-r--r-- | package/jimtcl/jimtcl.mk | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/package/jimtcl/jimtcl.mk b/package/jimtcl/jimtcl.mk index c2e04ff5c5..e79e0f6951 100644 --- a/package/jimtcl/jimtcl.mk +++ b/package/jimtcl/jimtcl.mk @@ -26,16 +26,15 @@ endef endif ifeq ($(BR2_STATIC_LIBS),y) -JIMTCL_SHARED = -JIMTCL_LIB = a -JIMTCL_INSTALL_LIB = +define JIMTCL_INSTALL_LIB + $(INSTALL) -m 0644 -D $(@D)/libjim.a $(1)/usr/lib/libjim.a +endef else JIMTCL_SHARED = --shared -JIMTCL_LIB = so.$(JIMTCL_VERSION) define JIMTCL_INSTALL_LIB - $(INSTALL) -D $(@D)/libjim.$(JIMTCL_LIB) \ - $(TARGET_DIR)/usr/lib/libjim.$(JIMTCL_LIB) - ln -s libjim.$(JIMTCL_LIB) $(TARGET_DIR)/usr/lib/libjim.so + $(INSTALL) -m 0755 -D $(@D)/libjim.so.$(JIMTCL_VERSION) \ + $(1)/usr/lib/libjim.$(JIMTCL_VERSION) + ln -s libjim.$(JIMTCL_VERSION) $(1)/usr/lib/libjim.so endef endif @@ -55,13 +54,12 @@ define JIMTCL_INSTALL_STAGING_CMDS for i in $(JIMTCL_HEADERS_TO_INSTALL); do \ cp -a $(@D)/$$i $(STAGING_DIR)/usr/include/ || exit 1 ; \ done; \ - $(INSTALL) -D $(@D)/libjim.$(JIMTCL_LIB) $(STAGING_DIR)/usr/lib/libjim.$(JIMTCL_LIB); - ln -s libjim.$(JIMTCL_LIB) $(STAGING_DIR)/usr/lib/libjim.so + $(call JIMTCL_INSTALL_LIB,$(STAGING_DIR)) endef define JIMTCL_INSTALL_TARGET_CMDS $(INSTALL) -D $(@D)/jimsh $(TARGET_DIR)/usr/bin/jimsh - $(JIMTCL_INSTALL_LIB) + $(call JIMTCL_INSTALL_LIB,$(TARGET_DIR)) $(JIMTCL_LINK_TCLSH) endef |