public inbox for xconq7@sourceware.org
 help / color / mirror / Atom feed
From: Juergen Ruehle <j.ruehle@bmiag.de>
To: Eric McDonald <mcdonald@phy.cmich.edu>
Cc: xconq7@sources.redhat.com
Subject: Re: New Xconq Windows Executable
Date: Fri, 29 Aug 2003 15:22:00 -0000	[thread overview]
Message-ID: <16207.5970.363000.17518@lapjr.intranet.kiel.bmiag.de> (raw)
In-Reply-To: <Pine.LNX.4.44.0308282052300.19591-100000@leon.phy.cmich.edu>

Eric McDonald writes:
 > On Thu, 28 Aug 2003, Juergen Ruehle wrote:
 > > Eric McDonald writes:
 > >  > Yes, it does depend on the Cygwin XFree86 X libraries. We would 
 > >  > then need to have people install the Cygwin XFree86 stuff (which, 
 > >  > IMO, is much more stable than 2 years ago). And they would 
 > >  > essentially be playing Unix Xconq in an X display on their Windows 
 > >  > machine.
 > > 
 > > Actually no: the cygwin tk does not depend on X, but it doesn't
 > > contain the right headers either. 

First: sorry for the tone of my mail. I had the suspicion it might
sound patronizing, but English isn't my first language and I had no
better wording available. I very much appreciate the time and effort
you and others (especially Hans) are putting into xconq. I did not
intend to offend anybody.

 > Ok, I mounted my NTFS partition that has Cygwin.
 > I looked at tk.h and it says:
 > #ifndef _XLIB_H
 > #   ifdef MAC_TCL
 > #       include <Xlib.h>
 > #       include <X.h>
 > #   else
 > #       include <X11/Xlib.h>
 > #   endif
 > #endif
 > And the only X11/Xlib.h in my entire Cygwin filespace is under 
 > /usr/X11R6/include, which, of course, is the real thing, not a 
 > Tcl/Tk imitation.
 > 
 > So, if anyone was to build a Tcl/Tk-based app under this setup 
 > (and it is a relatively recent and fairly standard one), he/she 
 > would, in fact, end up depending on the real X11 stuff. From this 
 > standpoint, any Cygwin app built thusly would be a true X11 client 
 > in need of a true X11 server.

Sorry that I worded my explanation poorly. It is slightly more
complicated. You can compile it this way and with some fiddling you
can even link it to the X11 libraries, but it won't run. Tk's internal
structures unfortunately are directly derived from the corresponding
X11 structures. Access to these structures is through macros which are
(mostly) inherited from X and defined in X11/* headers. Now, X based
Tk uses the X structures directly while on Windows (and probably Mac
OS) the layout is slightly different. Linking code with different
opinions on the layout of structures (in this case cygwin tk84.dll
using the windows layout and xconq compiled with X11 headers using the
X11 layout) will result in a segmentation fault rather sooner than
later (I learned this the hard way:-). It would be nice if Win dows Tk
had some deliberate incompatibility with the X11 headers so this could
be detected at compile time.

Langer Rede kurzer Sinn:-)

  When compiling a Tk application for X11 nothing can go wrong, but if
  compiling a Tk app for windows or Mac Tk you have to make sure that
  the compiler doesn't accidently pick up original X11 headers.

 > But, I suppose this a wasted point, since what you prescribe seems 
 > like a good idea (it also devalues the AS Tcl/Tk in my eyes). 
 > It would be nice to build Tcl/Tk for Windows natively under 
 > Cygwin, and then statically link it into Xconq, removing the 
 > need of Tcl and Tk DLL's and whatnot. I'll look into it. Thanks.

There are two alternatives:

 - a cygwin based xconq: and the I think it is The Right Thing(TM) to
   use cygwin Tk in this case (because the installer is already in
   place; actually we could host it using a setup file for the net
   installer)

 - a non-cygwin xconq (either compiled using -mno-cygwin - which I've
   never attempted myself - or using VC++ - which works - or using
   CodeWarrior - which is what Hans is doing AFAIK): this will
   probably have no choice but to use AS Tk

 > > Also it seems there is still some tweaking of at least win/Makefile.in
 > > neccessary. it would be nice if somebody could commit something along
 > > the lines of (one still has to muck with TCLTKLIB, but I see no way to
 > > autodetect this):
 > 
 > Your patch looks fine. I was going to commit it later this 
 > evening, but I suppose I should boot into Windows first and 
 > actually test it.... I'll take care of it soon, but maybe not 
 > today.

It's not really a priority, there are few of us that actually build it
on windows. BTW I think I have posted this earlier, but I'll include
it again: my attempt at an INSTALL-win file. This is probably slightly
outdated by now. It would be nice, if you could review it and perhaps
commit it too. The major part missing is building with Visual C++,
since I currently don't have it installed.

=====================================================
BUILDING XCONQ ON WINDOWS FROM SOURCE

The xconq Tcl/Tk interface should run on most win32 based Systems (95, NT4.0 and
up). Currently (as of 02/08/16) it doesn't build right out of the box but needs
some minor tweaking. The following assumes you have downloaded and extracted the
source on your system and are familiar with building software. Since the windows
port isn't fully maintained, you might have to fix some problems yourself.

If you need further help, please contact the xconq mailing list on
'sources.redhat.com'.

NOTE: This document contains forward slashes as directory separators.

1. Building with cygwin (Net Release)

1.1 Install Cygwin

Install cygwin from http://sources.redhat.com/cygwin/ if you haven't done so
already. You will at least need the 'cygwin', 'ash', 'gcc', 'binutils', and
'make' packages. You also need a Tcl/Tk package as explained in the next
section.

1.2 Install Tcl/Tk Headers and Libraries

IMPORTANT: read this carefully to improve the chance the xconq will actually
build and run.

There are currently three cygwin packages containing Tcl/Tk libraries:

 - 'tcltk' (Version 20001125-1) contains Tcl/Tk Version 8.0
 - 'gdb' (Version 20010428-3) also contains Tcl/Tk Version 8.0
 - 'gdb' (Version 20020718-1) contains Tcl/Tk Version 8.3

If you don't want gdb grab the 'tcltk' package, otherwise install one of the
'gdb' packages.

NOTE: 'gdb' (20010428-3) contains exactly the same Tcl/Tk files as the 'tcltk'
package. So - due to a quirk in the cygwin setup - if you install both and later
deinstall one, it will delete the files, therefore you have to reinstall the
remaining package.

Unfortunately the binary packages do not contain all required header files,
namely Xlib.h and friends. These are only contained in the corresponding source
packages. So download and install (or simply extract it somewhere) the
appropriate source package.

It is important to use the header files that have been used to build the
libraries since crucial functions are implemented as macros. Especially DO NOT
use X11 headers (e.g. from one of the X11 packages). While the compile may
succeed the resulting executable will most probably crash (within expanded macro
code).

That said, it seems that the headers included in the 'tcltk' source package
actually work with all three binary packages (even so the Tcl/Tk versions
differ). This can significantly reduce download time, but YMMV.

1.3 Configure

Make sure that there are no directories named 'tcl' or 'tk' in the xconq source
directory. These are for the old cygwin beta releases. If they exist remove or
rename them. You just need the directory named 'tcltk'.

Start a cygwin shell (e.g. /bin/sh.exe), cd to the directory where you extracted
the source, and type

    ./configure --x-includes=<directory of the modified Tcl/Tk X includes>

This will try to guess the correct settings for your systems, select the Tcl/Tk
X headers, and create Makefiles in the appropriate directories.

The correct X include directory is the one from the Tcl/Tk source containing an
X11 sub directory that contains Xlib.h.

1.4 Make

Run 'make' (in the xconq source directory). Fix any errors that might occur.
This should produce 'win/xconq.exe'.

2. Building xconq using MS Visual C++

2.1 Get and install Tcl/Tk

...

2.2 Setup the project

Create a new project containing the following files:

...

Change the settings as follows:

...

2.3 Compile

Start the compile. Fix any errors that occur.

3. Running xconq

'xconq.exe' should be runnable when copied to the top level xconq source
directory. If it complains that it cannot find 'init.tcl' you have to set the
'TCL_LIBRARY' environment variable to the directory of the 'init.tcl' file (i.e.
'/usr/share/tcl8.0'). If it cannot find other tcl scripts you should try to add
them to the 'TCLLIBPATH' environment variable.

4. Installing xconq

Currently not supported by the build system, but you can copy the executable and
library directories to any directory you like and create a shortcut. You then
probably have to provide the directory of the game library using command line
parameter '-L <game library directory>'and possibly set TCLLIBPATH to the
directory of the 'tkconq.tcl' script.
=====================================================

  reply	other threads:[~2003-08-29  9:06 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-27  4:29 Eric McDonald
2003-08-27 16:17 ` Eric McDonald
2003-08-27 16:37 ` Jim Kingdon
2003-08-27 17:20   ` Eric McDonald
2003-08-27 18:40     ` Hans Ronne
2003-08-27 19:53       ` Eric McDonald
2003-08-28  3:26         ` Hans Ronne
2003-08-28 13:38     ` Juergen Ruehle
2003-08-29  0:44       ` Eric McDonald
2003-08-29  8:35       ` Eric McDonald
2003-08-29 15:22         ` Juergen Ruehle [this message]
2003-08-30  5:47           ` Eric McDonald
2003-08-29  9:06       ` Hans Ronne
2003-08-29 15:57         ` Eric McDonald
2003-09-05  4:54         ` Tcl/Tk Interface Unification (was Re: New Xconq Windows Executable) Eric McDonald
2003-09-05 15:06           ` Hans Ronne
2003-09-05 15:51             ` Eric McDonald
2003-09-06  6:05               ` Hans Ronne
2003-09-15  3:43             ` Tcl/Tk Interface Unification Eric McDonald
2003-09-15  3:50               ` Hans Ronne
2003-09-15 14:32                 ` Eric McDonald
2003-09-15 18:39                   ` Hans Ronne
2003-09-15 19:38                     ` Eric McDonald
2003-09-15 23:31                       ` Hans Ronne
2003-09-16 13:53                     ` Build system overhaul (Was: Tcl/Tk Interface Unification) Juergen Ruehle
2003-09-16 18:15                       ` Eric McDonald
2003-09-16 20:23                       ` Eric McDonald
2003-09-17 10:32                         ` Hans Ronne
2003-09-17 15:54                         ` Juergen Ruehle
2003-09-18  2:37                           ` Build system overhaul Eric McDonald
2003-09-08 17:46         ` Tcl/Tk Interface Unification (was Re: New Xconq Windows Executable) Eric McDonald
2003-08-27 18:04 New Xconq Windows Executable Bill Macon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16207.5970.363000.17518@lapjr.intranet.kiel.bmiag.de \
    --to=j.ruehle@bmiag.de \
    --cc=mcdonald@phy.cmich.edu \
    --cc=xconq7@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).