From dc3fdc08d25b618303a0bd1adef6823a2b3231cb Mon Sep 17 00:00:00 2001 From: mdejong Date: Fri, 6 Jul 2001 22:03:11 +0000 Subject: * win/configure: Regen. * win/tcl.m4 (SC_CONFIG_CFLAGS): Pass -e _WinMain@16 in addition to the -mwindows flag to work around a problem with ld when it incorrectly use main() as the executable entry point when both WinMain() and main() are available. --- ChangeLog | 10 +++++++++- win/configure | 31 +++++++++++++++++++------------ win/tcl.m4 | 9 ++++++++- 3 files changed, 36 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index da16a27..b7b9b31 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2001-07-06 Mo DeJong + + * win/configure: Regen. + * win/tcl.m4 (SC_CONFIG_CFLAGS): Pass -e _WinMain@16 in + addition to the -mwindows flag to work around a problem + with ld when it incorrectly use main() as the executable + entry point when both WinMain() and main() are available. + 2001-07-06 Donal K. Fellows * tests/cmdAH.test: Added leading zero to file modes to work @@ -8,7 +16,7 @@ * win/Makefile.in: Subst DEPARG directly instead of relying on a variable. This will make Cygwin - build faster since an extra exec will be avoided. + builds faster since an extra exec will be avoided. * win/configure: Regen. * win/configure.in: Subst DEPARG. * win/tcl.m4 (SC_CONFIG_CFLAGS): Move AC_MSG_CHECKING diff --git a/win/configure b/win/configure index 9c97ccc..65ed599 100755 --- a/win/configure +++ b/win/configure @@ -1243,8 +1243,15 @@ echo "configure:1171: checking compiler flags" >&5 # Specify linker flags depending on the type of app being # built -- Console vs. Window. + # + # We need to pass -e _WinMain@16 so that ld will use + # WinMain() instead of main() as the entry point. We can't + # use autoconf to check for this case since it would need + # to run an executable and that does not work when + # cross compiling. Remove this -e workaround once we + # require a gcc that does not have this bug. LDFLAGS_CONSOLE="-mconsole ${extra_ldflags}" - LDFLAGS_WINDOW="-mwindows ${extra_ldflags}" + LDFLAGS_WINDOW="-mwindows -e _WinMain@16 ${extra_ldflags}" else SHLIB_LD="link -dll -nologo -incremental:no" SHLIB_LD_LIBS="user32.lib advapi32.lib" @@ -1315,7 +1322,7 @@ echo "configure:1171: checking compiler flags" >&5 echo $ac_n "checking for build with symbols""... $ac_c" 1>&6 -echo "configure:1319: checking for build with symbols" >&5 +echo "configure:1326: checking for build with symbols" >&5 # Check whether --enable-symbols or --disable-symbols was given. if test "${enable_symbols+set}" = set; then enableval="$enable_symbols" @@ -1345,7 +1352,7 @@ TCL_DBGX=${DBGX} #-------------------------------------------------------------------- echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1349: checking how to run the C preprocessor" >&5 +echo "configure:1356: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1360,13 +1367,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1370: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1377: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1377,13 +1384,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1387: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1394: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1394,13 +1401,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1404: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1411: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1426,17 +1433,17 @@ echo "$ac_t""$CPP" 1>&6 ac_safe=`echo "errno.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for errno.h""... $ac_c" 1>&6 -echo "configure:1430: checking for errno.h" >&5 +echo "configure:1437: checking for errno.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1440: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1447: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* diff --git a/win/tcl.m4 b/win/tcl.m4 index 40ba286..add1a55 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -415,8 +415,15 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ # Specify linker flags depending on the type of app being # built -- Console vs. Window. + # + # We need to pass -e _WinMain@16 so that ld will use + # WinMain() instead of main() as the entry point. We can't + # use autoconf to check for this case since it would need + # to run an executable and that does not work when + # cross compiling. Remove this -e workaround once we + # require a gcc that does not have this bug. LDFLAGS_CONSOLE="-mconsole ${extra_ldflags}" - LDFLAGS_WINDOW="-mwindows ${extra_ldflags}" + LDFLAGS_WINDOW="-mwindows -e _WinMain@16 ${extra_ldflags}" else SHLIB_LD="link -dll -nologo -incremental:no" SHLIB_LD_LIBS="user32.lib advapi32.lib" -- cgit v0.12