Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problems building Tcl and Expect in MinGW

123 views
Skip to first unread message

Wolfga...@gmx.de

unread,
Sep 28, 2006, 3:33:09 PM9/28/06
to
Hi everyone,

I'm currently trying to install Tcl and Expect in MinGW. My further
goal is to build Dejagnu and then to run the gcc test-procedure.
Unfortunately I'm a newbie to this and not used to handle things like
configure-scripts etc.

Here is what happened:
* Started with: Win2kSP4 (never touched by MinGW & Co before)
* Execute MinGW-5.0.3.exe, which installs previously
downloaded files to "C:\MinGW":
* binutils-2.15.91-20040904-1.tar.gz
* gcc-ada-3.4.2-20040916-1.tar.gz
* gcc-core-3.4.2-20040916-1.tar.gz
* gcc-g++-3.4.2-20040916-1.tar.gz
* gcc-g77-3.4.2-20040916-1.tar.gz
* gcc-java-3.4.2-20040916-1.tar.gz
* gcc-objc-3.4.2-20040916-1.tar.gz
* mingw32-make-3.80.0-3.tar.gz
* mingw-runtime-3.10.tar.gz
* w32api-3.7.tar.gz
* Execute MSys-1.0.10.exe, which installs itself into
"C:\msys\1.0". After that "post install":
* "Do you have MinGW installed?" -> "y"
* "Where is your MinGW installation?" -> "C:/MinGW"
* "You do not have C:/MinGW/bin/make.exe.
Keep it that way."
* Start MSYS
* Execute "cd tcl8.5a4/win/"
* Execute "./configure --prefix=/mingw"
* Execute "make"
* Execute "make install"
* Execute "make test"

Here occur some errors (I only quote the lines describing the errors):
----------------------------------------------------------------
==== clock-49.2 regression test - missing time zone file (Bug 1237907)
FAILED
==== Contents of test case:

list [::tcl::clock::GuessWindowsTimeZone] [clock format 0
-locale system -format "%X %Z"] [clock format -86400 -format "%Y"]

---- Result was:
<-0500>+05:00:00<-0400>+04:00:00,M4.1.0/02:00:00,M10.5.0/02:00:00 {
7:00:00 NACHM. -0500} 1969
---- Result should have been (exact matching):
<-0500>+05:00:00<-0400>+04:00:00,M4.1.0/02:00:00,M10.5.0/02:00:00 {
7:00:00 PM -0500} 1969
==== clock-49.2 FAILED
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
==== winFile-4.0 Enhanced NTFS user/group permissions: test no acccess
FAILED
==== Contents of test case:

# Clean out all well-known ACLs
catch {cacls $fname /E /R "Everyone"} result
catch {cacls $fname /E /R $user} result
catch {cacls $fname /E /R $owner} result
cacls $fname /E /P $user:N
test_access $fname 0 0

---- Test setup failed:
getuser: Owner not found in output of dir/q
---- errorInfo(setup): getuser: Owner not found in output of dir/q
while executing
"error "getuser: Owner not found in output of dir/q""
(procedure "getuser" line 17)
invoked from within
"getuser $fname"
invoked from within
"set owner [getuser $fname]"
("uplevel" body line 2)
invoked from within
"uplevel 1 $setup"
---- errorCode(setup): NONE
==== winFile-4.0 FAILED
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
all.tcl: Total 22484 Passed 21649 Skipped 833 Failed
2
Sourced 134 Test Files.
Files with failing tests: clock.test winFile.test
----------------------------------------------------------------

I ignored this and went on:
* Execute "cd ../../expect-5.43/"
* Execute "./configure --prefix=/mingw --verbose"

This gives "configure: error: Can't find Tcl private headers"

So I tried
* Execute "./configure --prefix=/mingw --verbose
--with-tcl=../tcl8.5a4/win --with-tclinclude=../tcl8.5a4/generic"
which seemd to work, but then
* Execute "make"
resulted in
----------------------------------------------------------------
gcc -c -I. -I. -I/home/Administrator/tcl8.5a4/generic
-DEXP_VERSION=\"5.43.0\" -DSCRIPTDIR=\"/mingw/lib/expect5.43\"
-DEXECSCRIPTDIR=\"/mingw/lib/expect5.43\" -DTCL_DEBUGGER
-DUSE_NON_CONST -DSTTY_BIN=\"/bin/stty\" -DDFLT_STTY="\"sane\""
exp_command.c
exp_command.c:24:23: sys/ioctl.h: No such file or directory
exp_command.c:210: warning: 'expStateFromChannelName' defined locally
after being referenced with dllimport linkage
exp_command.c: In function `expBusy':
exp_command.c:310: error: `F_DUPFD' undeclared (first use in this
function)
exp_command.c:310: error: (Each undeclared identifier is reported only
once
exp_command.c:310: error: for each function it appears in.)
exp_command.c: At top level:
exp_command.c:479: warning: 'expCloseOnExec' defined locally after
being referenced with dllimport linkage
exp_command.c: In function `expCloseOnExec':
exp_command.c:481: error: `F_SETFD' undeclared (first use in this
function)
exp_command.c: In function `Exp_SpawnCmd':
exp_command.c:1050: error: `F_DUPFD' undeclared (first use in this
function)
exp_command.c:1218: warning: passing arg 2 of `execvp' from
incompatible pointer type
exp_command.c: At top level:
exp_command.c:1721: warning: 'exp_i_update' defined locally after being
referenced with dllimport linkage
exp_command.c: In function `Exp_CloseObjCmd':
exp_command.c:2345: error: `F_SETFD' undeclared (first use in this
function)
exp_command.c: In function `Exp_DisconnectCmd':
exp_command.c:2761: error: `SIGHUP' undeclared (first use in this
function)
exp_command.c: In function `Exp_OverlayCmd':
exp_command.c:2881: error: `SIGQUIT' undeclared (first use in this
function)
exp_command.c:2882: warning: passing arg 2 of `execvp' from
incompatible pointer type
exp_command.c: At top level:
exp_command.c:3042: warning: 'exp_flageq_code' defined locally after
being referenced with dllimport linkage
make: *** [exp_command.o] Error 1
----------------------------------------------------------------

I tried to be brief, but the error messages are quite long.
I also found this article:
http://groups.google.com/group/comp.lang.tcl/browse_thread/thread/924e0197f82edc21/2faf2e3169396929
This describes a similar problem, but I don't understand everything of
that.

Does anyone know how to build and install Tcl and Expect (and maybe
Dejagnu) in MinGW?

Thanks in advance for any help!
Sorry for my crappy english!

Wolfgang

sp...@controlq.com

unread,
Sep 28, 2006, 4:55:23 PM9/28/06
to
On Thu, 28 Sep 2006 Wolfga...@gmx.de wrote:

> Does anyone know how to build and install Tcl and Expect (and maybe
> Dejagnu) in MinGW?
>
> Thanks in advance for any help!
> Sorry for my crappy english!
>
> Wolfgang

It appears that your configure is looking to a Unix build ...

I'd suggest that you go to the tcl source tree, and in the "win"
subdirectory, create a subdir called MingW (or similar). Then,
cd into the MingW subdir (under the "win" directory), and execute:
(eg: in the ./Tcl/tcl8.4.13/win/MingW subdir)

../configure

You may have to specify additional params (for includes, target etc), but
once you get configure running to completion and Tcl installed, you're off
to the races ...

I typically build on FreeBSD using the ports X development system for
MingW, and your mileage may differ, but in the past I've used MSYS to
compile and link a tcl/tk successfully on a windows box directly.

HTH: good luck.
Rob.

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----

Kevin Kenny

unread,
Sep 28, 2006, 10:23:34 PM9/28/06
to
Wolfga...@gmx.de wrote:
> Hi everyone,
>
> I'm currently trying to install Tcl and Expect in MinGW. My further
> goal is to build Dejagnu and then to run the gcc test-procedure.
> Unfortunately I'm a newbie to this and not used to handle things like
> configure-scripts etc.

Please log a bug about clock-49.2 at SourceForge.

For whatever it's worth, the bug is in the test suite, and not in
[clock] - it's failed to set up a complete simulation for the 'system'
locale, and it's getting Vormittag and Nachmittag instead of A.M.
and P.M.

--
73 de ke9tv/2, Kevin

David Gravereaux

unread,
Oct 1, 2006, 11:40:06 AM10/1/06
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Wolfga...@gmx.de wrote:

> Does anyone know how to build and install Tcl and Expect (and maybe
> Dejagnu) in MinGW?

The source for the *working* windows port is available here:
ftp://tcl.activestate.com/pub/incoming/expect-src.zip

It works with Tcl 8.4 and 8.5.

It does not contain a GNU style Makefile.in and configure script. It
could build with MinGW as the code builds a real native extension, if
one added them. That code also has not been merged with the official
source..

Or you could just get the latest ActiveTcl distro, and you get an
already built binary all ready to go.
http://www.activestate.com/Products/ActiveTcl/

- --
David Gravereaux <davy...@pobox.com>
[species:human; planet:earth,milkyway(western spiral arm),alpha sector]

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)

iD8DBQFFH+FWlZadkQh/RmERAsRnAJ9LYytSBtFzALVOriwL1DJUQFkv9gCgmRav
OknvPRuT6VTSTT9pXqlscmU=
=ZD5u
-----END PGP SIGNATURE-----

Wolfga...@gmx.de

unread,
Oct 17, 2006, 5:58:54 PM10/17/06
to
Hi everyone,

> Please log a bug about clock-49.2 at SourceForge.

Done.

Now, as I realized I was using development versions, I changed to
tcl8.4.13-src.tar.gz. With this the following happened:
* Execute "cd /tcl8.4.13/win/"


* Execute "./configure --prefix=/mingw"
* Execute "make"
* Execute "make install"
* Execute "make test"

* Execute "cd ../../expect-5.43/"
* Execute "./configure --prefix=/mingw

--with-tclinclude=/home/Administrator/tcl8.4.13/generic/"

All this works out fine without errors. Then

* Execute "make"

gives
----------------------------------------------------------------
gcc -c -I. -I. -I/home/Administrator/tcl8.4.13/generic


-DEXP_VERSION=\"5.43.0\" -DSCRIPTDIR=\"/mingw/lib/expect5.43\"
-DEXECSCRIPTDIR=\"/mingw/lib/expect5.43\" -DTCL_DEBUGGER
-DUSE_NON_CONST -DSTTY_BIN=\"/bin/stty\" -DDFLT_STTY="\"sane\""

exp_main_exp.c
if [ "xlibexpect543.a" != "xlibexpect543.a" ] ; then \
if [ ! -d shared ] ; then \
mkdir shared ; \
else true; fi ; \
gcc -c -I. -I. -I/home/Administrator/tcl8.4.13/generic


-DEXP_VERSION=\"5.43.0\" -DSCRIPTDIR=\"/mingw/lib/expect5.43\"
-DEXECSCRIPTDIR=\"/mingw/lib/expect5.43\" -DTCL_DEBUGGER
-DUSE_NON_CONST -DSTTY_BIN=\"/bin/stty\" -DDFLT_STTY="\"sane\""

exp_main_exp.c -o shared/exp_main_exp.o ; \
fi
gcc -c -I. -I. -I/home/Administrator/tcl8.4.13/generic

Does anybody know where I can find ioctl.h? It doesn't reside on my
harddisk.

Thanks again for your help

Wolfgang

David Gravereaux

unread,
Oct 21, 2006, 4:09:51 PM10/21/06
to
On 17 Oct 2006 14:58:54 -0700, Wolfga...@gmx.de wrote:

>exp_command.c:24:23: sys/ioctl.h: No such file or directory

It *IS NOT* possible to build Expect (using the sources that are for UNIX)
with MinGW (period). MinGW is not a cross-compiler the way cygwin is.
MinGW builds native executables. Think "#include <windows.h>". Get it?
No place in the Win32 platform SDK is a "sys/ioctl.h" file found. Why?
Because windows is not POSIX. MinGW builds native, not crossed through
the services of cygwin.

Get the windows source for Expect at:
ftp://tcl.activestate.com/pub/incoming/expect-src.zip . That can build
for windows, but lacks a Makefile.in. You will have to create one
yourself. Use makefile.vc as a starting point. These sources are not the
same as the ones on sourceforge for the Expect project. They are separate
and have not (yet) been merged into a single source tree.

Don't waste your time fighting a missing build system either, just get a
pre-built expect for windows with the ActiveTcl release... You're done.

http://www.activestate.com/Products/ActiveTcl/

Now stop asking how to build a UNIX project with a windows compiler.

Wolfga...@gmx.de

unread,
Oct 23, 2006, 8:36:14 AM10/23/06
to
Hi David,

> It *IS NOT* possible to build Expect (using the sources that are for UNIX)
> with MinGW (period).

Thanks - that's the information I needed.

> Now stop asking how to build a UNIX project with a windows compiler.

I'm just not an expert, maybe that's why I'm posting questions. I
didn't want to waste your time.

Yours,
Wolfgang

Eckhard Lehmann

unread,
Oct 23, 2006, 8:57:32 AM10/23/06
to

Wolfga...@gmx.de wrote:

you should state more clearly that

> * Execute "make"

was meant for the expect sources and not the Tcl sources ;-).

> exp_command.c
> exp_command.c:24:23: sys/ioctl.h: No such file or directory

[...]

All those messages tell you that certain things are not found in the
build environment. There is no ioctl.h in MinGW/include/sys, nor is it
in msys/local/include. These files as well as spawn(), fork() etc. are
unix/posix related. They are not available on windows and hence not in
MinGW. MinGW is just a posix wrapper around the things that are
available on windows (contrahery to cygwin).
As David G. said, the best is really to use the prebuilt Expect from
ActiveTcl, as long as you don't want to hack on expect itself...


Eckhard

David Gravereaux

unread,
Oct 23, 2006, 3:12:21 PM10/23/06
to

If it took me a second reply in this thread to say the same thing, then so
be it.

David Gravereaux

unread,
Oct 23, 2006, 3:16:38 PM10/23/06
to
On 23 Oct 2006 05:57:32 -0700, "Eckhard Lehmann" <eck...@web.de> wrote:

>As David G. said, the best is really to use the prebuilt Expect from
>ActiveTcl, as long as you don't want to hack on expect itself...

Now if one wants to hack away at Expect for windows, the Microsoft
compiler is needed for the existing build stuff (as is).

That code does need to get merged with the existing (formal) Expect
sources, if one wants to hack away at it. That work would be most welcome
by all :)

It won't be easy.. I forewarn.

0 new messages