public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* [Patch] Fixup tcl and expect build under Cygwin
@ 2002-05-04 19:51 Mo DeJong
  2002-05-09 12:36 ` Keith Seitz
  0 siblings, 1 reply; 4+ messages in thread
From: Mo DeJong @ 2002-05-04 19:51 UTC (permalink / raw)
  To: insight

Hi all.

It is not currently possible to build the Windows version of Source-Navigator against the CVS version of Tcl on sources. The problem appeared when Cygwin build support was readed after the Tcl 8.3 upgrade.

The first thing that needs fixing is expect. This patch will get the configure script to pickup the tclConfig.sh out of the tcl/win subdirectory instead of the fake one Tcl is currently generating in the tcl/unix subdirectory. One possible objection to this patch would be that a tclConfig.sh should be created in the tcl/cygwin subdirectory and then found there before checking tcl/win. That may be the "more correct" thing to do, but this patch just tries to do the "less wrong" thing since it is the minimal change that should get everything working again. It also fixes up the Itcl header search.

2002-05-04  Mo DeJong  <supermo@bayarea.net>

	* aclocal.m4 (CY_AC_PATH_TCLCONFIG, CY_AC_PATH_TKCONFIG,
	CY_AC_PATH_ITCLH): Update macros that search for tclConfig.sh
	and tkConfig.sh so that they also check the win/ subdirectory.
	Update macro that checks for itcl.h so that it looks in
	itcl/itcl/generic instead of itcl/src. These updates
	are needed to get things building correctly under Cygwin
	gcc and Tcl/Tk 8.3.
 	* configure: Regen.

Index: aclocal.m4
===================================================================
RCS file: /cvs/src/src/expect/aclocal.m4,v
retrieving revision 1.2
diff -u -r1.2 aclocal.m4
--- aclocal.m4	11 Sep 2001 19:24:02 -0000	1.2
+++ aclocal.m4	5 May 2002 02:31:20 -0000
@@ -201,6 +201,10 @@
         ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
 	break
       fi
+      if test -f "$i/win/tclConfig.sh" ; then
+        ac_cv_c_tclconfig=`(cd $i/win; pwd)`
+	break
+      fi
     done
   fi
 changequote([,])
@@ -459,6 +463,10 @@
         ac_cv_c_tkconfig=`(cd $i/unix; pwd)`
 	break
       fi
+      if test -f "$i/win/tkConfig.sh" ; then
+        ac_cv_c_tkconfig=`(cd $i/win; pwd)`
+	break
+      fi
     done
   fi
 changequote([,])
@@ -533,8 +541,8 @@
 AC_MSG_CHECKING(for Itcl private headers. srcdir=${srcdir})
 if test x"${ac_cv_c_itclh}" = x ; then
   for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ; do
-    if test -f $i/src/itcl.h ; then
-      ac_cv_c_itclh=`(cd $i/src; pwd)`
+    if test -f $i/itcl/generic/itcl.h ; then
+      ac_cv_c_itclh=`(cd $i/itcl/generic; pwd)`
       break
     fi
   done


Now for the Tcl changes. The first change is needed because mkfifo is not supported under Cygwin. Here is the linker error I get when trying to build expect with Cygwin gcc.

gcc -g -O2 -mno-win32  -DCYGWIN_ALTTCL  -o expect.exe exp_main_exp.o libexpect526.a ../tcl/cygwin/libtcl_cygwin.a   -luser32 
../tcl/cygwin/libtcl_cygwin.a(tclUnixFCmd.o)(.text+0x3be): undefined reference to `mkfifo'
collect2: ld returned 1 exit status
make: *** [expect.exe] Error 1

The second change to Tcl is related to the expect patch above. We don't need to emit a fake tcl/unix/tclConfig.sh after the expect configure script is fixed up. This change also gets
Source-Navigator building again under Windows.

2002-05-04  Mo DeJong  <supermo@bayarea.net>

	* unix/tclUnixFCmd.c (DoCopyFile): Don't use mkfifo
	when compiling with Cygwin, since it is not supported.
 	* win/configure: Regen.
	* win/configure.in: Don't emit ../unix/tclConfig.sh.
	This hack was breaking the snavigator build and was
	only needed because the expect build process was
	out of date.

Index: unix/tclUnixFCmd.c
===================================================================
RCS file: /cvs/src/src/tcl/unix/tclUnixFCmd.c,v
retrieving revision 1.2
diff -u -r1.2 tclUnixFCmd.c
--- unix/tclUnixFCmd.c	9 Sep 2001 23:56:09 -0000	1.2
+++ unix/tclUnixFCmd.c	5 May 2002 02:22:45 -0000
@@ -391,12 +391,18 @@
 	    }
 	    return CopyFileAtts(src, dst, &srcStatBuf);
 	}
+#ifndef __CYGWIN__
+        /*
+         * mkfifo is not supported under Cygwin even though it is prototyped
+         * in newlib headers.
+         */
         case S_IFIFO: {
 	    if (mkfifo(dst, srcStatBuf.st_mode) < 0) {	/* INTL: Native. */
 		return TCL_ERROR;
 	    }
 	    return CopyFileAtts(src, dst, &srcStatBuf);
 	}
+#endif /* __CYGWIN__ */
         default: {
 	    return CopyFile(src, dst, &srcStatBuf);
 	}
Index: win/configure.in
===================================================================
RCS file: /cvs/src/src/tcl/win/configure.in,v
retrieving revision 1.7
diff -u -r1.7 configure.in
--- win/configure.in	28 Oct 2001 16:26:29 -0000	1.7
+++ win/configure.in	5 May 2002 02:22:45 -0000
@@ -247,5 +247,5 @@
 AC_SUBST(MAKE_DLL)
 AC_SUBST(MAKE_EXE)
 
-AC_OUTPUT(Makefile tclConfig.sh tcl.hpj ../unix/tclConfig.sh)
+AC_OUTPUT(Makefile tclConfig.sh tcl.hpj)
 

cheers
Mo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Patch] Fixup tcl and expect build under Cygwin
  2002-05-04 19:51 [Patch] Fixup tcl and expect build under Cygwin Mo DeJong
@ 2002-05-09 12:36 ` Keith Seitz
  2002-05-09 14:15   ` Mo DeJong
  0 siblings, 1 reply; 4+ messages in thread
From: Keith Seitz @ 2002-05-09 12:36 UTC (permalink / raw)
  To: Mo DeJong; +Cc: insight

Sorry for the delay...

On Sat, 4 May 2002, Mo DeJong wrote:

> 2002-05-04  Mo DeJong  <supermo@bayarea.net>
>
> 	* aclocal.m4 (CY_AC_PATH_TCLCONFIG, CY_AC_PATH_TKCONFIG,
> 	CY_AC_PATH_ITCLH): Update macros that search for tclConfig.sh
> 	and tkConfig.sh so that they also check the win/ subdirectory.
> 	Update macro that checks for itcl.h so that it looks in
> 	itcl/itcl/generic instead of itcl/src. These updates
> 	are needed to get things building correctly under Cygwin
> 	gcc and Tcl/Tk 8.3.
>  	* configure: Regen.

I cannot approve this (not really sure who can), but I remember doing
something similar in a sandbox to fix all the tcl/tk problems on cygwin.
There are several problems with our tcl/tk builds now;
tcl/generic/tclIntDecls.h has bugs, cygtcl.m4 wants to link with
"-e_WinMain@16", which is wrong, and a bunch more that I haven't found.
:-(

I'm trying to package these all up and check them in, but I keep getting
side-tracked. (You worked for Red Hat: you know how that goes.)

> 2002-05-04  Mo DeJong  <supermo@bayarea.net>
>
> 	* unix/tclUnixFCmd.c (DoCopyFile): Don't use mkfifo
> 	when compiling with Cygwin, since it is not supported.
>  	* win/configure: Regen.
> 	* win/configure.in: Don't emit ../unix/tclConfig.sh.
> 	This hack was breaking the snavigator build and was
> 	only needed because the expect build process was
> 	out of date.

Otherwise, as far as I can approve the tcl changes, I've only one
question... Why can I build with cygwin without build problems? (Ok,
expect doesn't build, but tcl/tk were "fine".)

I'll definitely approve the unix/tclConfig.sh thing, though. I never
understood why that was done.

Keith



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Patch] Fixup tcl and expect build under Cygwin
  2002-05-09 12:36 ` Keith Seitz
@ 2002-05-09 14:15   ` Mo DeJong
  2002-05-09 14:21     ` Keith Seitz
  0 siblings, 1 reply; 4+ messages in thread
From: Mo DeJong @ 2002-05-09 14:15 UTC (permalink / raw)
  To: insight

On Thu, 9 May 2002 12:36:55 -0700 (PDT)
Keith Seitz <keiths@redhat.com> wrote:

> I cannot approve this (not really sure who can), but I remember doing
> something similar in a sandbox to fix all the tcl/tk problems on cygwin.

Is there some other list that this patch should be submitted to?

> There are several problems with our tcl/tk builds now;
> tcl/generic/tclIntDecls.h has bugs, cygtcl.m4 wants to link with
> "-e_WinMain@16", which is wrong, and a bunch more that I haven't found.
> :-(

That -e flag is kind of interesting because it was to work around a bug in gcc. When both a WinMain() and a main() are found gcc incorrectly picks main() as the entry point even though -mwindows is passed. If this problem no longer exists in Cygwin gcc then the -e could be removed. I know it is required to build with Mingw 2.95.2, but I don't know about later releases. If this problem does exist, it manifests itself as a wish.exe that pops up the . window but no console.

> Otherwise, as far as I can approve the tcl changes, I've only one
> question... Why can I build with cygwin without build problems? (Ok,
> expect doesn't build, but tcl/tk were "fine".)

It should break down when building Itcl under Windows. I have no idea why you would not run into this problem aside from something obvious like using an older config.cache that had tcl/win/tclConfig.sh cached. You might try looking at the output of configure when the Itcl configure is being run to see if it detects the config file in tcl/unix or tcl/win.

> I'll definitely approve the unix/tclConfig.sh thing, though. I never
> understood why that was done.

As far as I can tell, it was to avoid an error configuring expect. The expect patch fixes that problem so I can't see any reason not to apply the patch.

Mo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Patch] Fixup tcl and expect build under Cygwin
  2002-05-09 14:15   ` Mo DeJong
@ 2002-05-09 14:21     ` Keith Seitz
  0 siblings, 0 replies; 4+ messages in thread
From: Keith Seitz @ 2002-05-09 14:21 UTC (permalink / raw)
  To: Mo DeJong; +Cc: insight

On Thu, 9 May 2002, Mo DeJong wrote:

> Is there some other list that this patch should be submitted to?

All the big expect users: binutils, gcc, gdb.

> That -e flag is kind of interesting because it was to work around a bug
> in gcc. When both a WinMain() and a main() are found gcc incorrectly
> picks main() as the entry point even though -mwindows is passed. If this
> problem no longer exists in Cygwin gcc then the -e could be removed. I
> know it is required to build with Mingw 2.95.2, but I don't know about
> later releases. If this problem does exist, it manifests itself as a
> wish.exe that pops up the . window but no console.

Odd. When I build with this, wish just crashes. When I remove it, wish
appears. I think I ifdef'd out main() in my local sources (, which I
really need to check in!)

> It should break down when building Itcl under Windows. I have no idea
> why you would not run into this problem aside from something obvious
> like using an older config.cache that had tcl/win/tclConfig.sh cached.
> You might try looking at the output of configure when the Itcl configure
> is being run to see if it detects the config file in tcl/unix or
> tcl/win.

Maybe I already fixed this (the same way you did) in my local tree! :-)

> > I'll definitely approve the unix/tclConfig.sh thing, though. I never
> > understood why that was done.
>
> As far as I can tell, it was to avoid an error configuring expect. The
> expect patch fixes that problem so I can't see any reason not to apply
> the patch.

Ok, cool. Well, at least apply your two tcl changes. Good luck on the
expect patch. I guess if cgf is around, he would have definitive say on
it. (It is, after all, a pretty simple change.)

Keith


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-05-09 21:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-04 19:51 [Patch] Fixup tcl and expect build under Cygwin Mo DeJong
2002-05-09 12:36 ` Keith Seitz
2002-05-09 14:15   ` Mo DeJong
2002-05-09 14:21     ` Keith Seitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).