#5013 Compiler checks too early

obsolete: 8.5.11
closed-fixed
5
2012-04-03
2012-03-27
No

configure.in for Tcl contains 6 compiler checks:
1) Support for SEH
2) EXCEPTION_DISPOSITION support
3) LPFN_ACCEPT in winsock2.h
4) winnt.h that ignores VOID define
5) missing alloca declaration in malloc.h
6) casting to union type

All of those checks are meant to detect
defects/features in some mingw/cygwin
versions. However, SC_CONFIG_CFLAGS
is able to switch compiler, e.g. for ms
win64/wince or for cygwin. So those checks
are done with the wrong compiler.

Proposed solution: move those checks
after SC_CONFIG_CFLAGS. For
MS win64/wince that wouldn't work
because of spaces in the replacement
$CC, but lucky enough those checks
are only meant for gcc. So, putting a
if test "$GCC" = "yes"; then
around it should work for all
known compilers.

Even better: check 1), 4) and 6)
could be moved from configure.in
to tcl.m4, as part of the
SC_CONFIG_CFLAGS macro.
Then TEA can benefit from it as well.

Discussion

  • Donal K. Fellows

    I'm not sure that check 4 belongs there (not unless you can make it conditional on the existence of winnt.h at all) but 1 and 6 could work fine. (6 even makes sense on non-Windows.)

     
  • Jan Nijtmans

    Jan Nijtmans - 2012-03-27

    Check 4) is actually done using <windows.h>, not <winnt.h>
    so I see no problem at all.

     
  • Jan Nijtmans

    Jan Nijtmans - 2012-03-27

    It turns out that 3) and 5) were only used for Tcl 8.4, so for
    >8.4 this check can just be removed.

    1) and 2) are used together, so that makes the set
    1), 2) 4) and 6).

    Yes, 6) makes sense on non-windows as well, the
    other 3 only make sense on windows.

     
  • Jan Nijtmans

    Jan Nijtmans - 2012-03-29

    Change committed in core-8-4-branch.

    This makes the mingw32 and cygwin ports
    compile out-of-the-box using a native
    or cross-compiler on any platform.

    Just (e.g. on Linux or cygwin with the
    appropriate mingw-w64 package installed):
    cd win
    configure
    make
    This will automatically use the i686-w64-mingw32-gcc
    compiler to build the mingw32 port.

    Or, the same, but then in stead
    configure --enable-64bit
    This will build the win64 version,
    using x86_64-w64-mingw32-gcc

    Finally, on cygwin:
    cd unix
    configure
    make
    This will build the cygwin port
    out-of-the-box

    core-8-5-branch and trunk still to be done

     
  • Jan Nijtmans

    Jan Nijtmans - 2012-04-03

    Now committed to core-8-5-branch and trunk as well.

    And - finally - to TEA (= tclconfig) to be taken over
    by extensions.

    So, closing.....

     
  • Jan Nijtmans

    Jan Nijtmans - 2012-04-03
    • status: open --> closed-fixed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks