summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2016-07-21 17:17:14 +0200
committerMichał Górny <mgorny@gentoo.org>2016-09-03 13:05:53 +0200
commit9f670e5d23d09556e3b52916c896e2ea32508981 (patch)
tree14a60dbf65e0512aa47fdf63ed9d13910fe1cd0c
parentsys-devel/clang: Bump to 3.9.0 (diff)
downloadgentoo-9f670e5d23d09556e3b52916c896e2ea32508981.tar.gz
gentoo-9f670e5d23d09556e3b52916c896e2ea32508981.tar.bz2
gentoo-9f670e5d23d09556e3b52916c896e2ea32508981.zip
multilib.eclass: get_exeext for mingw/cygwin exe suffix, #588330
Add a get_exeext function that can be used to obtain executable program suffix specific to the platform, in line with get_libname and get_modname. It is necessary to correctly reference built programs on non-standard platforms where executables use some suffix (like .exe). Original author: Gerhard Bräunlich
-rw-r--r--eclass/multilib.eclass14
1 files changed, 14 insertions, 0 deletions
diff --git a/eclass/multilib.eclass b/eclass/multilib.eclass
index 8c953871a656..a80511c2ee52 100644
--- a/eclass/multilib.eclass
+++ b/eclass/multilib.eclass
@@ -225,6 +225,20 @@ number_abis() {
echo $#
}
+# @FUNCTION: get_exeext
+# @DESCRIPTION:
+# Returns standard executable program suffix (null, .exe, etc.)
+# for the current platform identified by CHOST.
+#
+# Example:
+# get_exeext
+# Returns: null string (almost everywhere) || .exe (mingw*) || ...
+get_exeext() {
+ case ${CHOST} in
+ *-cygwin*|mingw*|*-mingw*) echo ".exe";;
+ esac
+}
+
# @FUNCTION: get_libname
# @USAGE: [version]
# @DESCRIPTION: