TEA (tclconfig) Source Code

View Ticket
Login
Ticket UUID: 06f1692bbe29449ac3f2161ebf9dd153d0349845
Title: cross compilation with native mingw compiler in Cygwin environment
Type: Patch Version:
Submitter: pooryorick Created on: 2015-10-05 05:40:38
Subsystem: 85. tclconfig Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2015-10-07 13:19:29
Resolution: Fixed Closed By: jan.nijtmans
    Closed on: 2015-10-07 13:19:29
Description:

With a few changes, tcl.m4 can cover the scenario of using a native minGW compiler from a cygwin shell/utilities environment. Since Cygwin is a target platform in its own right, this is a form of cross-compilation. The included patch seems to be sufficient to enable this mode of building Tcl. See Tcl issue d995ca52091dd8db7db415e4256e903093ee043a for a companion patch.

User Comments: jan.nijtmans added on 2015-10-07 13:19:29:

Applied (with some tweaking) to core-8-5-branch and trunk.


jan.nijtmans added on 2015-10-05 07:38:14:
Thanks! Actually, I have the building environment working to cross-compile with mingw under cygwin, but I tweaked the environment a little bit to accomplish this. Your patch looks like a better solution.

pooryorick added on 2015-10-05 05:44:14:

Index: tcl.m4
==================================================================
--- tcl.m4
+++ tcl.m4
@@ -2879,18 +2879,26 @@
 	CFLAGS=""
     fi
 
     case "`uname -s`" in
 	*win32*|*WIN32*|*MINGW32_*)
-	    AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo)
+	    AC_CHECK_PROG(CYGPATH, cygpath, cygpath -m, echo)
 	    EXEEXT=".exe"
 	    TEA_PLATFORM="windows"
 	    ;;
 	*CYGWIN_*)
-	    CYGPATH=echo
+	    # Maybe we are cross-compiling
 	    EXEEXT=".exe"
 	    # TEA_PLATFORM is determined later in LOAD_TCLCONFIG
+	    case ${host_alias} in
+		*mingw32*)
+		    AC_CHECK_PROG(CYGPATH, cygpath, cygpath -m, echo)
+		;;
+		*)
+		    CYGPATH=echo
+		;;
+	    esac
 	    ;;
 	*)
 	    CYGPATH=echo
 	    # Maybe we are cross-compiling....
 	    case ${host_alias} in
@@ -4095,15 +4103,15 @@
 	eval $1_STUB_LIB_FLAG="-l$1stub${PACKAGE_VERSION}${DBGX}"
     else
 	eval $1_LIB_FLAG="-l$1`echo ${PACKAGE_VERSION} | tr -d .`${DBGX}"
 	eval $1_STUB_LIB_FLAG="-l$1stub`echo ${PACKAGE_VERSION} | tr -d .`${DBGX}"
     fi
-    $1_BUILD_LIB_SPEC="-L`pwd` ${$1_LIB_FLAG}"
+    $1_BUILD_LIB_SPEC="-L`$CYGPATH $(pwd)` ${$1_LIB_FLAG}"
     $1_LIB_SPEC="-L${pkglibdir} ${$1_LIB_FLAG}"
-    $1_BUILD_STUB_LIB_SPEC="-L`pwd` [$]{$1_STUB_LIB_FLAG}"
+    $1_BUILD_STUB_LIB_SPEC="-L`$CYGPATH $(pwd)` [$]{$1_STUB_LIB_FLAG}"
     $1_STUB_LIB_SPEC="-L${pkglibdir} [$]{$1_STUB_LIB_FLAG}"
-    $1_BUILD_STUB_LIB_PATH="`pwd`/[$]{PKG_STUB_LIB_FILE}"
+    $1_BUILD_STUB_LIB_PATH="`$CYGPATH $(pwd)/[$]{PKG_STUB_LIB_FILE}`"
     $1_STUB_LIB_PATH="${pkglibdir}/[$]{PKG_STUB_LIB_FILE}"
 
     AC_SUBST($1_BUILD_LIB_SPEC)
     AC_SUBST($1_LIB_SPEC)
     AC_SUBST($1_BUILD_STUB_LIB_SPEC)