summaryrefslogtreecommitdiffstats
path: root/win/tcl.m4
diff options
context:
space:
mode:
authorhobbs <hobbs>2002-09-27 00:50:10 (GMT)
committerhobbs <hobbs>2002-09-27 00:50:10 (GMT)
commitb96b459a4907a164acb205a2b024c2c8419ea496 (patch)
tree7ecd449f330b92357eb4737a43574667df864290 /win/tcl.m4
parent4985043c6ed39477bf0abc04fe017cccfd090f62 (diff)
downloadtcl-b96b459a4907a164acb205a2b024c2c8419ea496.zip
tcl-b96b459a4907a164acb205a2b024c2c8419ea496.tar.gz
tcl-b96b459a4907a164acb205a2b024c2c8419ea496.tar.bz2
2002-09-18 Mumit Khan <khan@nanotech.wisc.edu>
Added basic Cygwin support. * win/tcl.m4 (SC_PATH_TCLCONFIG): Support one-tree build. (SC_PATH_TKCONFIG): Likewise. (SC_PROG_TCLSH): Likewise. (SC_CONFIG_CFLAGS): Assume real Cygwin port and remove -mno-cygwin flags. Add -mwin32 to extra_cflags and extra_ldflags. Remove ``-e _WinMain@16'' from LDFLAGS_WINDOW. * win/configure.in: Allow Cygwin build. (SEH test): Define to be 1 instead of empty value. (EXCEPTION_DISPOSITION): Add test. * win/configure: Regenerate. * generic/tcl.h: Don't explicitly define __WIN32__ for Cygwin, let the user decide whether to use Windows or POSIX personality. (TCL_WIDE_INT_TYPE, TCL_LL_MODIFIER, struct Tcl_StatBuf): Define for Cygwin. * generic/tclEnv.c (Tcl_CygwinPutenv): putenv replacement for Cygwin. * generic/tclFileName.c (Tcl_TranslateFileName): Convert POSIX to native format. (TclDoGlob): Likewise. * generic/tclPlatDecls.h (TCHAR): Define for Cygwin. * win/tclWinPort.h (putenv, TclpSysAlloc, TclpSysFree, TclpSysRealloc): Define for Cygwin.
Diffstat (limited to 'win/tcl.m4')
-rw-r--r--win/tcl.m448
1 files changed, 40 insertions, 8 deletions
diff --git a/win/tcl.m4 b/win/tcl.m4
index 71ce0a9..0f79dae 100644
--- a/win/tcl.m4
+++ b/win/tcl.m4
@@ -22,8 +22,10 @@ AC_DEFUN(SC_PATH_TCLCONFIG, [
if test -d ../../tcl8.4$1/win; then
TCL_BIN_DIR_DEFAULT=../../tcl8.4$1/win
- else
+ elif test -d ../../tcl8.4/win; then
TCL_BIN_DIR_DEFAULT=../../tcl8.4/win
+ else
+ TCL_BIN_DIR_DEFAULT=../../tcl/win
fi
AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.4 binaries from DIR],
@@ -60,8 +62,10 @@ AC_DEFUN(SC_PATH_TKCONFIG, [
if test -d ../../tk8.4$1/win; then
TK_BIN_DIR_DEFAULT=../../tk8.4$1/win
- else
+ elif test -d ../../tk8.4/win; then
TK_BIN_DIR_DEFAULT=../../tk8.4/win
+ else
+ TK_BIN_DIR_DEFAULT=../../tk/win
fi
AC_ARG_WITH(tk, [ --with-tk=DIR use Tk 8.4 binaries from DIR],
@@ -424,12 +428,30 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [
MAKE_EXE="\${CC} -o \[$]@"
LIBPREFIX="lib"
+ #if test "$ac_cv_cygwin" = "yes"; then
+ # extra_cflags="-mno-cygwin"
+ # extra_ldflags="-mno-cygwin"
+ #else
+ # extra_cflags=""
+ # extra_ldflags=""
+ #fi
+
if test "$ac_cv_cygwin" = "yes"; then
- extra_cflags="-mno-cygwin"
- extra_ldflags="-mno-cygwin"
+ touch ac$$.c
+ if ${CC} -c -mwin32 ac$$.c >/dev/null 2>&1; then
+ case "$extra_cflags" in
+ *-mwin32*) ;;
+ *) extra_cflags="-mwin32 $extra_cflags" ;;
+ esac
+ case "$extra_ldflags" in
+ *-mwin32*) ;;
+ *) extra_ldflags="-mwin32 $extra_ldflags" ;;
+ esac
+ fi
+ rm -f ac$$.o ac$$.c
else
- extra_cflags=""
- extra_ldflags=""
+ extra_cflags=''
+ extra_ldflags=''
fi
if test "${SHARED_BUILD}" = "0" ; then
@@ -482,14 +504,19 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [
# Specify linker flags depending on the type of app being
# built -- Console vs. Window.
#
+ # ORIGINAL COMMENT:
# 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.
+ #
+ # MK NOTE: Tk should use a different mechanism. This causes
+ # interesting problems, such as wish dying at startup.
+ #LDFLAGS_WINDOW="-mwindows -e _WinMain@16 ${extra_ldflags}"
LDFLAGS_CONSOLE="-mconsole ${extra_ldflags}"
- LDFLAGS_WINDOW="-mwindows -e _WinMain@16 ${extra_ldflags}"
+ LDFLAGS_WINDOW="-mwindows ${extra_ldflags}"
else
if test "${SHARED_BUILD}" = "0" ; then
# static
@@ -663,7 +690,12 @@ AC_DEFUN(SC_PROG_TCLSH, [
])
if test -f "$ac_cv_path_tclsh" ; then
- TCLSH_PROG=$ac_cv_path_tclsh
+ TCLSH_PROG="$ac_cv_path_tclsh"
+ AC_MSG_RESULT($TCLSH_PROG)
+ elif test -f "$TCL_BIN_DIR/tclConfig.sh" ; then
+ # One-tree build.
+ ac_cv_path_tclsh="$TCL_BIN_DIR/tclsh"
+ TCLSH_PROG="$ac_cv_path_tclsh"
AC_MSG_RESULT($TCLSH_PROG)
else
AC_MSG_ERROR(No tclsh found in PATH: $search_path)