This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch] Fixup tcl and expect build under Cygwin


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]