[oe-commits] Richard Purdie : gcc-package-sdk.inc: Allow executable extension to be overridden

git at git.openembedded.org git at git.openembedded.org
Thu Aug 22 17:20:10 UTC 2013


Module: openembedded-core.git
Branch: master-next
Commit: 8dcf0d95b654fa6cc56193168aaa744052ad8ffc
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=8dcf0d95b654fa6cc56193168aaa744052ad8ffc

Author: Richard Purdie <richard.purdie at linuxfoundation.org>
Date:   Tue Aug 20 21:14:02 2013 +0000

gcc-package-sdk.inc: Allow executable extension to be overridden

On platforms like windows, executables have extensions. Whilst I'm not proposing
we wholesale support windows extensions, this small tweak allows a cross compiler
targetting mingw to be built which does seem like a good use case.

The patch therefore adds an EXEEXT which the mingw layer can set for the libexec
symlinks.

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/recipes-devtools/gcc/gcc-package-sdk.inc |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-devtools/gcc/gcc-package-sdk.inc b/meta/recipes-devtools/gcc/gcc-package-sdk.inc
index b546d5c..21beccc 100644
--- a/meta/recipes-devtools/gcc/gcc-package-sdk.inc
+++ b/meta/recipes-devtools/gcc/gcc-package-sdk.inc
@@ -28,6 +28,8 @@ FILES_${PN}-doc = "\
     ${gcclibdir}/${TARGET_SYS}/${BINV}/include/README \
     "
 
+EXEEXT = ""
+
 # Compute how to get from libexecdir to bindir in python (easier than shell)
 BINRELPATH = "${@oe.path.relative(d.expand("${libexecdir}/gcc/${TARGET_SYS}/${BINV}"), d.expand("${bindir}"))}"
 
@@ -62,12 +64,13 @@ do_install () {
 	# found.
 	dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/
 	install -d $dest
+	suffix=${EXEEXT}
 	for t in ar as ld nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do
-		if [ "$t" = "g77" -o "$t" = "gfortran" ] && [ ! -e ${D}${bindir}/${TARGET_PREFIX}$t ]; then
+		if [ "$t" = "g77" -o "$t" = "gfortran" ] && [ ! -e ${D}${bindir}/${TARGET_PREFIX}$t$suffix ]; then
 			continue
 		fi
 
-		ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t
+		ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t$suffix $dest$t$suffix
 	done
 
 	chown -R root:root ${D}



More information about the Openembedded-commits mailing list