diff options
author | Jeremy Rosen <jeremy.rosen@openwide.fr> | 2014-09-22 13:31:08 +0200 |
---|---|---|
committer | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2014-09-22 19:27:22 +0200 |
commit | 03ecca90d38448491f106c6555905de0d904fab0 (patch) | |
tree | 65ae2a5bc26b61504d2a94bbf6465d95a3f2f24d /package/swig | |
parent | 47e5ba9dfc756633b5304aac9485103dbcd9662b (diff) |
swig: add swig2.0 -> swig symlink
The cmake detection script provided with cmake will first look for a
binary called swig2.0 then for a binary called swig.
host-swig only installs a binary called swig, but if the host
distribution has instaled a binary called swig2.0, it will be
preferred over our swig, which isn't great. This patch creates a
symlink swig2.0 -> swig to prevent this from happening.
[Thomas: add comment in the code and improve the commit log]
Signed-off-by: Jérémy Rosen <jeremy.rosen@openwide.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/swig')
-rw-r--r-- | package/swig/swig.mk | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/package/swig/swig.mk b/package/swig/swig.mk index e9ef5219f..3558f9a9e 100644 --- a/package/swig/swig.mk +++ b/package/swig/swig.mk @@ -4,7 +4,8 @@ # ################################################################################ -SWIG_VERSION = 2.0.12 +SWIG_MAJOR = 2.0 +SWIG_VERSION = $(SWIG_MAJOR).12 SWIG_SITE = http://downloads.sourceforge.net/project/swig/swig/swig-$(SWIG_VERSION) SWIG_DEPENDENCIES = host-bison HOST_SWIG_CONF_OPT = \ @@ -14,4 +15,19 @@ HOST_SWIG_CONF_OPT = \ SWIG_LICENSE = GPLv3+ BSD-2c BSD-3c SWIG_LICENSE_FILES = LICENSE LICENSE-GPL LICENSE-UNIVERSITIES +# CMake looks first at swig2.0 and then swig. However, when doing the +# search, it will look into the PATH for swig2.0 first, and then for +# swig. While the PATH contains first our $(HOST_DIR)/usr/bin, it also +# contains /usr/bin and other system directories. Therefore, if there +# is an installed swig2.0 on the system, it will get the preference +# over the swig installed in $(HOST_DIR)/usr/bin, which isn't nice. To +# prevent this from happening we create a symbolic link swig2.0 -> +# swig, so that our swig always gets used. + +define HOST_SWIG_INSTALL_SYMLINK + ln -fs $(HOST_DIR)/usr/bin/swig $(HOST_DIR)/usr/bin/swig$(SWIG_MAJOR) +endef + +HOST_SWIG_POST_INSTALL_HOOKS += HOST_SWIG_INSTALL_SYMLINK + $(eval $(host-autotools-package)) |