This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rpetrov
Recipients Jeffrey.Armstrong, Martin.Fiers, Pete.Forman, RubyTuesdayDONO, Seppo.Yli-Olli, alexis, cmcqueen1975, danmbox, doko, eric.araujo, geertj, jonforums, jwilk, loewis, oscarbenjamin, paul.moore, pje, rpetrov, rubenvb, santoso.wijaya, schmir, tarek
Date 2013-05-23.19:11:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In-reply-to <>
Oscar Benjamin wrote:
> Oscar Benjamin added the comment:
> I have written a function that can be used to determine if the gcc
> that distutils will use is from Cygwin or MinGW:
> def is_cygwingcc():
>      '''Try to determine if the gcc that would be used is from cygwin.'''
>      out = Popen(['gcc', '-dumpmachine'], shell=True, stdout=PIPE).stdout
>      try:
>          out_string =
>      finally:
>          out.close()
>      # out_string is the target triplet cpu-vendor-os
>      # Cygwin's gcc sets the os to 'cygwin'
>      return out_string.strip().endswith('cygwin')
> The idea is that 'gcc -dumpmachine' emits a string that always ends in
> 'cygwin' for the Cygwin gcc (please let me know if I'm wrong about
> that). Earnie Boyd at mingw-users described this method for
> distinguishing MinGW and Cygwin gcc as not being a bad idea:
> With this the Mingw32CCompiler.__init__ method can be modified to do:
> if self.gcc_version < '4' or is_cygwingcc():

It seems to me you try to find another method to detect support of some 
Where is written that compiler is gcc ? Yes this is current distutils 
code but please review my set of patches

>      no_cygwin = ' -mno-cygwin'
> else:
>      no_cygwin = ''
> self.set_executables(compiler='gcc%s -O -Wall' % no_cygwin,
>                       compiler_so='gcc%s -mdll -O -Wall' % no_cygwin,
>                       compiler_cxx='g++%s -O -Wall' % no_cygwin,
>                       linker_exe='gcc%s' % no_cygwin,
>                       linker_so='%s%s %s %s'
>                              % (self.linker_dll, no_cygwin,
>                                 shared_option, entry_point))

This will not work in new cygwin (1.7) environment  with true 
Reason is simple - executable is not gcc.

> This will fix the problem for MinGW, should not break existing
> no-cygwin/gcc 3.x setups and preserves the error message currently
> seen for no-cygwin with gcc 4.x. In other words it should satisfy
> users in all three groups A, B and C referred to above. In particular
> the is_cygwingcc() function hopefully addresses Martin's concern for
> users in group C.
> Is this approach acceptable?
It is not enough.

> Thanks,
> Oscar
> ----------

Date User Action Args
2013-05-23 19:11:39rpetrovsetrecipients: + rpetrov, loewis, doko, paul.moore, pje, geertj, schmir, tarek, jwilk, eric.araujo, cmcqueen1975, rubenvb, santoso.wijaya, alexis, Seppo.Yli-Olli, jonforums, RubyTuesdayDONO, Jeffrey.Armstrong, danmbox, Martin.Fiers, oscarbenjamin, Pete.Forman
2013-05-23 19:11:39rpetrovlinkissue12641 messages
2013-05-23 19:11:39rpetrovcreate