Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2012-04-03
16:42 • Closed ticket [3511806fff]: Compiler checks too early plus 7 other changes artifact: f41393bb38 user: nijtmans
2012-03-30
04:08 • Ticket [3511806fff]: 4 changes artifact: 731e11d90e user: nijtmans
2012-03-27
21:20 • Ticket [3511806fff]: 4 changes artifact: 26a9d6f146 user: nijtmans
21:06 • Ticket [3511806fff]: 4 changes artifact: cf9ce366f2 user: nijtmans
19:47 • Ticket [3511806fff]: 4 changes artifact: 541218e1b6 user: dkf
09:21 • New ticket [3511806fff]. artifact: adfb513096 user: nijtmans

Compiler checks too early

Closed / Fixed3511806fffffffffffffffffffffffffffffffffCreated 15 years agoUpdated 15 years ago
Descriptionplain2012-03-27 09:21:39
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.
dkfplain2012-03-27 19:47:43
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.)
nijtmansplain2012-03-27 21:06:24
Check 4) is actually done using <windows.h>, not <winnt.h>
so I see no problem at all.
nijtmansplain2012-03-27 21:20:47
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.
nijtmansplain2012-03-30 04:08:31
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
nijtmansplain2012-04-03 16:42:29
Now committed to core-8-5-branch and trunk as well.

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

So, closing.....
Log in (anonymous is fine) to add a comment.