Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: toolchain@g.o, "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH] multilib.eclass: get_exeext for mingw/cygwin exe suffix, #588330
Date: Thu, 21 Jul 2016 15:21:59
Message-Id: 20160721152123.24572-1-mgorny@gentoo.org
1 Add a get_exeext function that can be used to obtain executable program
2 suffix specific to the platform, in line with get_libname and
3 get_modname. It is necessary to correctly reference built programs on
4 non-standard platforms where executables use some suffix (like .exe).
5
6 Original author: Gerhard Bräunlich
7 ---
8 eclass/multilib.eclass | 14 ++++++++++++++
9 1 file changed, 14 insertions(+)
10
11 diff --git a/eclass/multilib.eclass b/eclass/multilib.eclass
12 index 8c95387..a80511c 100644
13 --- a/eclass/multilib.eclass
14 +++ b/eclass/multilib.eclass
15 @@ -225,6 +225,20 @@ number_abis() {
16 echo $#
17 }
18
19 +# @FUNCTION: get_exeext
20 +# @DESCRIPTION:
21 +# Returns standard executable program suffix (null, .exe, etc.)
22 +# for the current platform identified by CHOST.
23 +#
24 +# Example:
25 +# get_exeext
26 +# Returns: null string (almost everywhere) || .exe (mingw*) || ...
27 +get_exeext() {
28 + case ${CHOST} in
29 + *-cygwin*|mingw*|*-mingw*) echo ".exe";;
30 + esac
31 +}
32 +
33 # @FUNCTION: get_libname
34 # @USAGE: [version]
35 # @DESCRIPTION:
36 --
37 2.9.2

Replies