This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] config.guess: Properly detect the *mingw32 targets


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]