Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2012-08-07
17:29 • Closed ticket [3554282fff]: Checkin [30736d63f0] broke CFLAGS plus 6 other c... artifact: 1ca27cb314 user: nijtmans
15:58 • Open ticket [3554282fff]. artifact: 03d7e238d7 user: stwo
14:06 • Pending ticket [3554282fff]. artifact: 54f86e4cd8 user: nijtmans
2012-08-06
20:39 • Ticket [3554282fff]: 5 changes artifact: 27dd199644 user: nijtmans
2012-08-05
02:30 • Ticket [3554282fff]: 5 changes artifact: 7a89501378 user: nijtmans
00:17 • Ticket [3554282fff]: 5 changes artifact: 27d472d675 user: ferrieux
2012-08-04
15:03 • New ticket [3554282fff]. artifact: 5868a9f665 user: stwo

Checkin [30736d63f0] broke CFLAGS

Closed / Fixed3554282fffffffffffffffffffffffffffffffffCreated 14 years agoUpdated 14 years ago
Descriptionplain2012-08-04 15:03:18
As of checkin 30736d63f0, CFLAGS is getting set to "-g -O2" and we are trying to avoid that.
In tcl.m4,TEA_SETUP_COMPILER_CC:
# If the user did not set CFLAGS, set it now to keep
# the AC_PROG_CC macro from adding "-g -O2".
if test "${CFLAGS+set}" != "set" ; then
    CFLAGS=""
fi
ferrieuxplain2012-08-05 00:17:42
Upping the prio. That should not happen.
nijtmansplain2012-08-05 02:30:28
I'm  sorry, but I don't see how checkin 30736d63f0 changed
anything about CFLAGS, nor I really understand the
problem. So, Stuart, please just make the modifications
you would want, and I will check whether it breaks
any of the cross-compiling support that 30736d63f0
adds. That probably is the fastest way to resolve this
issue. I don't have any objections to setting
CFLAGS to empty if it is not set.

Regards,
        Jan Nijtmans
nijtmansplain2012-08-06 20:39:47
Assigning back to me, because I'm starting to see the problem.

Normally, configure scripts to the following:
TEA_INIT
....
TEA_LOAD_TCLCONFIG
...
TEA_SETUP_COMPILER

(just the relevant ones for this analysis)

One of the difficulties in cross-compilation support is that TEA_INIT
no longer is able to determine whether we are on win32 or unix,
so it was moved to TEA_LOAD_TCLCONFIG. Doing that
it needs AC_TRY_COMPILE, determining whether the
compiler sets _WIN32 or not, that's the only reliable way
to determine that.

Previously,  TEA_SETUP_COMPILER was the first
macro which called the compiler, that;s where the
CFLAGS were set for the first time.

So, possible solution: repeat the given lines
in the TEA_LOAD_TCLCONFIG macro as
well, that should fix this.
nijtmansplain2012-08-07 14:06:43
> So, possible solution: repeat the given lines
> in the TEA_LOAD_TCLCONFIG macro as
> well, that should fix this.
That approach didn't work, it's not clear to me why. But
found a simpler solution. The problem here was that
the AC_TRY_COMPILE simply did too much things
we don't want, so I replaced the AC_TRY_COMPILE
macro call with just the small part we need.

Stuart, please verify that things are correct now.
So thread/Itcl/tdbc's configure scripts can all
be regenerated for inclusion in Tcl 8.6b3.
stwoplain2012-08-07 15:58:07
I've moved the CFLAGS test/set to TEA_INIT and restored your previous code.
Doing the check as early as possible should be the best way though sadly the code had a fine and better home in TEA_SETUP_COMPILER_CC.
Tcl and Tk also do the check early.
This is more fallout from the cygwin changes; I hope it's worth it. /:
nijtmansplain2012-08-07 17:29:55
allow_comments - 1

>This is more fallout from the cygwin changes; I hope it's worth it. /:
It's not only Cygwin, you can now cross-compile win32
TEA extesnions on Darwin or Linux as well, just
out-of-the-box ;-) So, yes it's worth it.

Anyway, tried it on Cygwin, and it appears to work fine.
Thanks! Didn't expect it to be that simple.....
Log in (anonymous is fine) to add a comment.