This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] config.guess: Properly detect the *mingw32 targets
- From: Ralf Wildenhues <Ralf dot Wildenhues at gmx dot de>
- To: Rainer Emrich <rainer at emrich-ebersheim dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 11 Nov 2009 22:45:43 +0100
- Subject: Re: [PATCH] config.guess: Properly detect the *mingw32 targets
- References: <4AFB1869.5070907@emrich-ebersheim.de>
Hello Rainer,
* Rainer Emrich wrote on Wed, Nov 11, 2009 at 09:02:49PM CET:
> Here's a simple patch for config.guess to detect the different mingw32
> targets. If it is ok., somone with write permissions may commit.
config.guess is maintained by the address listed in its --help output.
Which targets are detected wrongly?
> *:MINGW*:*)
> - echo ${UNAME_MACHINE}-pc-mingw32
> + eval $set_cc_for_build
> + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
> + if [ `$CC_FOR_BUILD --version | head -c 3` == "gcc" ] ; then
This has several problems:
test with == is not portable, use = instead. head -c is not Posix.
Using the compiler for detecting the system is not desirable in
config.guess unless absolutely necessary (if I understood Ben
correctly). Is there some other method to distinguish between systems?
> + echo `$CC_FOR_BUILD -dumpmachine`
> + else
> + echo ${UNAME_MACHINE}-pc-mingw32
> + fi
> + else
> + echo ${UNAME_MACHINE}-pc-mingw32
> + fi
Cheers,
Ralf