[ANNOUNCEMENT] Cygwin/XFree86 DocBook-based FAQ Draft 4

Suhaib M. Siddiqi ssiddiqi@nc.rr.com
Thu May 24 17:24:00 GMT 2001


Are we going to include the missing points from present FAQ  ( am giving
below a few important examples)?  Or is it something Rob will do?




Are there static versions of the X libraries?
NO. 
3.13
Will there be Xaw.DLL, Xt.DLL and Xmu.DLL?

There are no plans for them at this pont. GCC is free software, and most
stuff written for it is also freely available. Recompile Xaw, Xt and Xmu
if you want. However, keep the following in mind:
"One of the biggest issues with X on Win32 is the moronic DLL format.
Specifically - it is not possible to export data from a Win32 DLL in a
form that can be used to statically initialize another global variable.
Data access from a DLL requires at least one pointer indirection, and
hence executable code. This is why X11R6 doesn't have DLLs for
Xt/Xmu/Xaw (and Motif) on Win32", quoted from XFree86-developers Mailing
List - David E. Wexelblat (dwex@datafocus.com) Wed, 25 Mar 1998 10:08:27
-0500.
NB: See the mailing list page and the cygwin mailing list for
discussions on libtool, which is facing the same issue and may generate
a successful workaround. If that is done then you should have a
relatively easy time porting Xt/Xmu/Xaw. 

Will the DLLs link with Watcom, Borland, MSVC, and VAC++?
 
The patched source code for Cygwin/GCC compilers is available via cvs.
You will need to consult Mumit Khan's URL at
http://www.xraylith.wisc.edu/~khan/software/gnu-win32 and edit cygwin.cf
and cygwin.rules in xc/cf directory as needed and compile them yourself.

3.17
 Are there special porting considerations?
 
Below are few basic rules I follow and are derived from XFree86 source
code: 

Use the Imakefile and do not try to handcraft or patch a Makefile.
Things will go wrong!  
Read about the macros ProgramTargetName() and LibraryTargetName() and
use them in the Imakefile, rather than hacking .exe and .lib names. The
above will work, hacking won't.  
Use #ifdef cygwinArchitecture in an Imakefile to specify an CYGWIN
dependent part.  
In source or header files, exclusively use #ifdef __CYGWIN__ for CYGWIN
specific parts. Don't use other symbols, such as "WIN32", "__WIN32__",
"i386", "__GNUC__", or "__32BIT__". Use only #ifdef, #else, #endif, not
#elif, as some other compilers don't support this.  
If you think there is a bug in the provided X11 include files, you are
doing something wrong.  
Many Imakefiles silently assume they are running under Unix, and
therefore have program and library names hardcoded in. Use the
LibraryTargetName and ProgramTargetName macros to wrap libs and
programs, such as in 

EXTRA_LIBRARIES = ../Xpmlib/LibraryTargetName(Xpm) 
PROGRAMS = ProgramTargetName(xterm) ProgramTargetName(resize) 

Don't reinvent the wheel concerning environment variables. Use the ones
that are described in the installation file README, rather than invent
yet another variable name for USERs, HOME directories, TMP> directories,
etc.  
Try to make your filenames comply with the 8.3 file name convention, so
that users may relocate them to elsewhere.  
The libraries are DLLs for certain reasons.  
Much software from Unix assumes that lines have '\n' as a line
delimiter. Don't change this, some code relies on this. Rather rewrite
the code to accept \r\n as a line delimiter.  
Code that relies on Unix security, job control, tty/pty handling, does
not need major rewriting because Cygwin1.dll offers this functionality.

If you want to contribute other software, please follow these guidelines
for making your distribution zip file:  
Use Cygwin tar and gzip or bzip2 for packing, even if some foobar packer
gives you 1 % better compression. Don't use Windows Winzip or other
non-cygwin aware tools. 
If you use an Imakefile (which is common practice with X apps), set the
X11ROOT variable to another letter than the one where you have your X11
tree. This makes it easier for you to combine all necessary files into a
distribution.  
Use exactly the same tree structure as Cygwin/XFree86 is using don't
reinvent wheels and install to /usr/X11R6/bin or similar.  
The last section means that the directories in your archive should be
rooted to /usr/X11R6.  
Put sources in a separate archive, not in the binary release, and root
this archive at /usr/X11R6/src/PACKAGENAME, e.g.
/usr/X11R6/src/xfoo-0.99.  
The reason for all that is that there are plans for a Software Installer
in the future to improve the installation procedure. This should
integrate all contribution packages as well. Non-conforming
contributions will be rejected without warning.  

3.23 

 
 I compiled an X/MOTIF client foo.exe.  My foo.exe executes but I cannot
use keyboard and my console dumps Xt Warnings: 

Warning: translation table syntax error: Unknown event type :
BtnMotion
Warning: ... found while parsing ' <BtnMotion>:  ManagerGadgetButtonM…
<SNIP> …

What is wrong?
 
You need to set XKeysymDB and XErrorDB Environment.  XKeysymDB and
XErrorDB files usually resides in /usr/X11R6/lib/X11 directory.

For example:

SET XKeysymDB=C:\usr\X11R6\lib\X11\XKeysymDB
SET XErrorDB =C:\usr\X11R6\lib\X11\XErrorDB 
3.24 Can I use DLLs and libraries with MSVC (Microsoft Visual C++) to
compile my source code? 

No!  You cannot use Cygwin/XFree86 libraries with MSVC. You need latest
version of Cygwin and GCC which comes with Cygwin.  However, you can
check out http://sources.redhat.com/win32-x11 for  MSVC.

 




More information about the Cygwin-xfree mailing list