Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Building sampleextension with gcc (cygwin/mingw) on Windows

Closed / Out of Date219330ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 25 years ago
Descriptionplain2000-10-26 05:10:50
OriginalBugID: 4468 RFE
Version: 8.3
SubmitDate: '2000-03-22'
LastModified: '2000-04-03'
Severity: MED
Status: UnAssn
Submitter: techsupp
ChangedBy: hobbs
OS: All Windows
FixedDate: '2000-10-25'
ClosedDate: '2000-10-25'


Name:
Jan Nijtmans

CVS:
March 17, 2000

DesiredBehavior:
Actually, this enhancement request is for the TEA sample-extension in
the Scriptics CVS server.

This patch, along with Mumit Kahn's patch set
<http://dev.scriptics.com/ticket/issue-view.tcl?msg_id=4234>
is enough to build the sampleextension with gcc-2.95.2-mingw.
It should work with cygwin B20.1 as well, but I didn't test that.

Patch:
*** tcl.m4.origWed Mar 22 21:42:00 2000
--- tcl.m4Wed Mar 22 22:31:19 2000
***************
*** 663,668 ****
--- 663,699 ----
      LD_SEARCH_FLAGS=""
      ;;
  *win32*|*WIN32*|CYGWIN_NT*|cygwin_nt*|*CYGWIN_98*|*CYGWIN_95*)
+   if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
+     if "$CC" -v 2>&1 | egrep '\/gcc-lib\/i[[3-6]]86[[^\/]]*-cygwin' >/dev/null; then
+ mno_cygwin="yes"
+ extra_cflags="-mno-cygwin"
+ extra_ldflags="-mno-cygwin"
+     else
+ mno_cygwin="no"
+ extra_cflags=""
+ extra_ldflags=""
+     fi
+ 
+     if test "$cross_compiling" = "yes" -o "$mno_cygwin" = "yes"; then
+ PATHTYPE=''
+ CYGPATH='echo '
+ VPSEP=':'
+     else
+ PATHTYPE='-w'
+ CYGPATH='cygpath'
+  VPSEP=';'
+     fi
+     CFLAGS_DEBUG="-g ${runtime}d"
+     CFLAGS_OPTIMIZE="-O2 ${runtime}"
+     LDFLAGS_CONSOLE="-mconsole ${extra_ldflags}"
+     LDFLAGS_WINDOW="-mwindows ${extra_ldflags}"
+     LDFLAGS_DEBUG="-g"
+     LDFLAGS_OPTIMIZE=""
+     EXTRA_CFLAGS="${extra_cflags}"
+     SHLIB_LD="dllwrap"
+     SHLIB_LD_LIBS="-luser32 -ladvapi32"
+     RC="windres"
+   else
      CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d"
      CFLAGS_OPTIMIZE="-nologo -Oti -Gs -GD ${runtime}"
      LDFLAGS_CONSOLE="-subsystem:console"
***************
*** 675,680 ****
--- 706,712 ----
      SHLIB_LD="link -dll -nologo"
      SHLIB_LD_LIBS="user32.lib advapi32.lib"
      RC="rc"
+   fi
      ;;
  dgux*)
      SHLIB_CFLAGS="-K PIC"
***************
*** 1796,1801 ****
--- 1828,1836 ----
      if test "${CC-cc}" = "cl"; then
  MAKE_STATIC_LIB="\${STLIB_LD} -out:\[$]@ \$(\[$]@_OBJECTS) "
  MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LDFLAGS} \${SHLIB_LD_LIBS} \$(LDFLAGS) -out:\[$]@ \$(\[$]@_OBJECTS) "
+     else
+ MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(\[$]@_OBJECTS)"
+ MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ --output-lib \[$](patsubst %.dll,lib%.a,\[$]@) \$(\[$]@_OBJECTS) \${SHLIB_LDFLAGS} \${SHLIB_LD_LIBS}"
      fi
      ;;
  *)

PatchFiles:
tcl.m4
dgp Ticket [219330ffff]: 1 change [History diff]2001-04-05 06:52:45
hobbs Ticket [219330ffff]: 1 change [History diff]2001-08-07 07:35:32
hobbsplain2002-03-23 04:46:45
Logged In: YES 
user_id=72656

The sample extension has been greatly revised such that 
this no longer applies, but I think the newer stuff in Tcl 
and the sample extension will make it easier to integrate 
whatever fixes are still required.
mdejongplain2002-04-19 04:59:07
Logged In: YES 
user_id=90858

I am assigning this one to hobbs since he has been working
in this area.
hobbsplain2002-04-20 03:16:33
Logged In: YES 
user_id=72656

This has been added with later patches from Andres Garcia 
(see also Patch 544203).
hobbs Ticket [219330ffff]: 2 changes [History diff]2002-04-20 03:16:34
Log in (anonymous is fine) to add a comment.