This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
[PATCH] Find MinGW in more places
- From: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- To: cygwin-patches at cygwin dot com
- Date: Sun, 09 Aug 2009 20:42:19 +0100
- Subject: [PATCH] Find MinGW in more places
Hi gang,
I often run into this problem when I'm using a compiler that I've installed in
a non-standard $prefix: the utils/mingw script expects to find the MinGW sysroot
in the same place the compiler's --print-prog-name= option finds ld.exe, which
won't be the case if you've got a binutils in your non-standard $prefix as well.
The attached patch simply falls back to looking in the same set of directories
relative to the root directory, which will locate anything installed with prefix
/ or /usr. It would also work if it only looked in /usr, but I decided to
mirror the existing behaviour only in a different prefix just for consistency; I
could always simplify it if wanted.
winsup/utils/ChangeLog:
* mingw: Add fallbacks to search for MinGW components in standard
install locations if not found in compiler's $prefix.
Ok?
cheers,
DaveK
Index: winsup/utils/mingw
===================================================================
RCS file: /cvs/src/src/winsup/utils/mingw,v
retrieving revision 1.5
diff -p -u -r1.5 mingw
--- winsup/utils/mingw 13 Oct 2008 00:56:09 -0000 1.5
+++ winsup/utils/mingw 9 Aug 2009 19:20:03 -0000
@@ -14,7 +14,8 @@ dir=$(cd $(dirname $("$compiler" -print-
#
[ "$dir" = '/' ] && dir=''
mingw_dir=''
-for d in "$dir"/*-mingw32 "$dir"/usr/*-mingw32 "$dir"/*-mingw* "$dir"/usr/*-mingw*; do
+for d in "$dir"/*-mingw32 "$dir"/usr/*-mingw32 "$dir"/*-mingw* "$dir"/usr/*-mingw* \
+ /*-mingw32 /usr/*-mingw32 /*-mingw* /usr/*-mingw*; do
case "$d" in
*\**) continue ;;
*) mingw_dir=$d; break;