<!doctype linuxdoc system>
<article>

<!-- TitleS information -->

<title>Information for SCO Users
<author>David McCullough
<date>14 December 1994


<!-- Table of contents -->
<toc>

<!-- Begin the document -->

<sect>Binary Distribution<p>

The following files are provided in the binary distribution, where XXX is
the new version and NNN is the previous version:
<quote>
<descrip>
<tag/README.SCO/            This file.
<tag/gunzip.Z/              The GNU <tt>uncompress</tt> utility.

<tag/*XFXXX-doc.tz/          The XFree86 specific documentation.

<tag/XFNNN-XXX.tz/          Files to upgrade from all NNN versions to XXX. 
This file may not be present if the upgrade is too substantial 
(ie., X11R5 -> X11R6).
<tag/XFXXX-Mono.tz/         The Mono server
<tag/XFXXX-VGA16.tz/        The 16 colour VGA server
<tag/XFXXX-SVGA.tz/         The Super VGA server
<tag/XFXXX-S3.tz/           The S3 server
</descrip>				
			There will most likely be more servers than
			listed here.  You should select the server you
			need.  Check the directory listing for any other
			servers that may be there.
<descrip>
<tag/*XFXXX-cfg.tz/          The local configuration files for 
<tt>xdm/fs/xinit</tt>.
<tag/*XFXXX-bin.tz/          The <tt>bin</tt> directory, contains most executables.
<tag/*XFXXX-lib.tz/          The shared and unshared libraries.
<tag/*XFXXX-fnt1.tz/         <tt>75dpi</tt> and <tt>misc</tt> fonts.
<tag/XFXXX-fnt2.tz/         <tt>100dpi</tt> and <tt>Speedo</tt> fonts.
<tag/*XFXXX-inc.tz/          The X11 include files.
<tag/XFXXX-man.tz/          The formatted man pages.
<tag/XFXXX-lkit.tz/         The server link kit (all drivers + PEX).
<tag/XFXXX-util.tz/         Lots of PD utilities provided as is.
<tag/XFXXX-pex.tz/          All files relating to PEX including libraries
                          and header files.  The LinkKit is required to
                          obtain servers capable of running PEX.
</descrip></quote>

To obtain a minimum XFree86 installation you will require the archives
marked with a '*' above, the server binary best suited to your machine
and optionally "<tt>gunzip.Z</tt>".  All the files are compressed 
with "<tt>gzip</tt>" except
of course "<tt>gunzip.Z</tt>" which is compressed using the 
conventional <tt>compress</tt>
program.<p>

To install the XFree86 binaries just follow these steps.
<enum>
<item> Obtain the files you require.<p>   
as root,<p>
<item> create a directory <tt>/usr/X11R6</tt>, permissions <tt>755</tt>
 should do nicely.
<item> cd <tt>/usr/X11R6</tt>
<item> extract the archives, for example:
<verb>
            gunzip < XFXXX-bin.tz | tar xvf -
</verb>    
<item> if you have installed man pages see the later section on
       setting up man pages.
<item> Look through <tt>/usr/X11R6/lib/X11/doc/INSTALL</tt>, 
	especially section 2
       on configuring and using XFree86.   This should allow you to get
       a server up and running.  Before starting the server check in
       the later section <ref id="sec-runxf86" name="Before Running XFree86">, 
	in this document, to
       see if there are any system requirements you have to make for the
       server to operate correctly.
</enum>
If you intend using the programs from the utilities archive then
you should be aware that they are provided as is.  They are not part of
the XFree86 distribution nor are they part of the standard MIT
distribution.  Every attempt is made to ensure that they work to a usable
degree but they are not perfect.  All programs in the utilities archive
come with a manual entry (which is also in the utilities archive).
Information on the author(s) can usually be located in the man page or by
running the executable.
<p>

<sect>Source Distribution<p>

The SCO port comes as part of the standard XFree86 distribution.  Consult
the XFree86 <tt>README</tt> for more information on the location of sources.


<sect>Before Running XFree86<p><label id="sec-runxf86">


Before you can run XFree86 with shared libraries enabled you must
up the shared library count in the kernel.  This is only required for
3.2.2 systems.  To accomplish this log in as root and run:
<tscreen><verb>
    cd /etc/conf/cf.d
    ./configure SHLBMAX=6
    cd ../bin
    ./idbuild
</verb></tscreen>
The SCO <tt/xterm/ terminfo description is not compatible with the <tt/xterm/
in the R5 distribution.<p>

To use a Bus/Keyboard or PS2 mouse you should configure the mouse drivers
under SCO as above using '<tt>mkdev mouse</tt>'. You may then use the 
<tt>OsMouse</tt> option
in your XF86Config to specify that XFree86 should use the SCO mouse drivers.
To do this, set the <tt>Protocol</tt> to "<tt>OsMouse</tt>" in the 
Pointer section of your
XF86Config file.  You can also use "<tt>OsMouse</tt>" for your 
serial mouse,
especially if you are having trouble getting your mouse to work using the
XFree86 mouse drivers.<p>

If you are using an Accelerated Localbus/EISA card you may wish to install
the "<tt>dmmap</tt>" driver.  This driver allows the server to use a linear 
address
mapping in high memory when accessing the card. The dmmap driver comes in
two forms, a binary archive which is supplied with the full binary
distribution and a source archive which is located in 
<tt>/usr/X11R6/lib/X11/etc</tt>.
Both distributions provide instructions for installation/removal within the
<tt>README file</tt>. <p>

<sect>Switching Consoles<p>

XFree86 uses similar console switching keys as the SCO R4 and R5
servers.  That is, <tt>Ctrl-PrntScr</tt> takes you to the next console along
from the one X is running on.  If this is the last console it will take
you to console 1.  Those interested in modifying the console switching
should look in <tt>xc/programs/Xserver/hw/xfree86/common/xf86Events.c</tt>.


<sect>Setting up Man Pages<p>

After compiling the tree, or after installing the binary distribution you
can get man to recognise the XFree86 man pages by adding 
<tt>/usr/X11R6/man</tt> to
the <tt>MANPATH</tt> in <tt>/etc/default/man</tt>, the line should 
look similar to:
<tscreen><verb>
    MANPATH=/usr/man:/usr/X11R6/man
</verb></tscreen>
This allows all users to view the X man pages.  You may change your own
<tt>MANPATH</tt> environment variable if you do not want everyone to access the
man pages.<p>

By default the man pages are compressed using "<tt>pack</tt>" under 3.2.2 and
"<tt>compress</tt>" under 3.2.4 to conserve space.  If you do not want to 
compress
the man pages change <tt>CompressManPages</tt> to <tt>NO</tt> in your 
<tt>xf86site.def</tt>.  Those
using the binary distribution can use "<tt>unpack</tt>" or 
"<tt>uncompress</tt>" as appropriate
to uncompress the man pages.


<sect>Using SCO binaries/servers.<p>

XFree86 will accept connections from SCO binaries (R3 upwards) and the
SCO R5 server will also accept connections from XFree86 binaries. This
means you may mix and match the two if you have ODT.  For example you may
still use the Motif window manager (mwm) if you prefer.


<sect>Compiling XFree86 under 3.2.2<p>

Currently XFree86 is configured to install under <tt>/usr/X11R6</tt>. 
The binary
distribution will be configured to go into this directory.  If you are
compiling your own XFree86 there is no reason why this cannot be changed.
Check in the X11 <tt>config/README</tt> on how to change your 
<tt>ProjectRoot</tt>.

The defaults are set such that you should only require minimal changes to
the <tt>site.def</tt> or the <tt>xf85site.def</tt> file.  
The <tt>BOOTSTRAPCFLAGS</tt> do most of the
work for you. The defaults will use gcc 2 or above and they also compile
for shared libraries and setup formatted man pages using compression. The
most likely Parameters you will be interested in changing are:
<enum>
<item>  What Fonts etc get compiled.
<item>  What gets installed (<tt>XdmConfig, FSConfig</tt>, &hellip)
</enum>
Use gcc, preferably 2.5.8 or later but an earlier version may still do the job.
Configure it with "<tt>./configure i386-*-sco</tt>".<p>

Make sure you do the fixincludes for gcc.<p>

In order to compile the current XFree86 version for SCO you will have to
create the following header files in the appropriate places.<p>
<quote>
A) create a <tt>/usr/include/sys/uio.h</tt> containing the following:
<verb>
    #ifndef _XFREE86_UIO_
    #define _XFREE86_UIO_ 1

    #ifndef __IOVEC__
    #define __IOVEC__ 1
    typedef struct iovec {
        caddr_t iov_base;
        int iov_len;
    } iovec_t;
    #endif /* __IOVEC__ */

    #endif /* _XFREE86_UIO_ */
</verb>
B) create a <tt>/usr/include/net/errno.h</tt> containing
<verb>    
    #ifndef _XFREE86_ERRNO_
    #define _XFREE86_ERRNO_ 1
    #include <errno.h>
    #endif /* _XFREE86_ERRNO_ */
</verb>
C) create a <tt>/usr/include/sys/bsdtypes.h</tt> which is empty for now.<p>
D) create a <tt>&lt sys/time.h &gt</tt> under the gnu include directory 
  containing the
   following (this protects the system header file from multiple inclusions)
   You do not have to change the system header file!
<verb>
    #ifndef _SYS_TIME_H_
    #define _SYS_TIME_H_ 1
    #include &lt /usr/include/sys/time.h &gt
    #endif /* _SYS_TIME_H_ */
</verb></quote>
<p>
You also need to obtain a copy of <tt>libcrypt</tt> or the international crypt
supplement from SCO.  The supplement is available on the SCO ftp site,
<em/sosco.sco.com/ (The name may have changed) as an SLS, lng225.  This is
required for the correct compilation of "xdm".<p>

To compile from here, follow the XFree86 <tt>README</tt>, basically after
obtaining X11r5, applying the XFree86 patches and completing the above
changes you should only need to run:
<tscreen><verb>
    make BOOTSTRAPCFLAGS="-DSYSV -Di386 -DSCO" World
</verb></tscreen>
The install script <tt>mit/util/scripts/bsdinst.sh</tt> will not set 's' bit
permissions when installing over the top of a previously installed
XFree86. To fix this apply the following patch from the directory
containing the '<tt>mit</tt>' directory.  This is personal taste only, if you
are installing through symbolic links then leave this one alone.
<verb>
----------8<-----------------8<------------------------------------
*** mit/util/scripts/bsdinst.sh%	Tue Mar  2 14:27:16 1993
--- mit/util/scripts/bsdinst.sh	Tue Mar  2 14:27:17 1993
***************
*** 150,154 ****
  # This rm is commented out because some people want to be able to
  # install through symbolic links.  Uncomment it if it offends you.
! # rm -f $dst/$srcbase
  (cd $srcdir ; $installcmd -f $dst $flags $src)
  
--- 150,154 ----
  # This rm is commented out because some people want to be able to
  # install through symbolic links.  Uncomment it if it offends you.
! rm -f $dst/$srcbase
  (cd $srcdir ; $installcmd -f $dst $flags $src)
----------8<-----------------8<------------------------------------
</verb>

<sect>Compiling XFree86 under 3.2.4<p>

Compiling gcc2.5.8 is accomplished after doing the following.
<tscreen><verb>
    ./configure i386-*-sco3.2v4.2
</verb></tscreen>
<bf/DO NOT USE/ "<tt>./configure i386-*-sco</tt>" it will not work.<p>

Make sure you run the "<tt>make fix-includes</tt>" after you have installed.<p>

It is recommended that you use a gcc compiled without any changes to the
value of <tt>__STDC__</tt>.  Some people may have compiled gcc by 
adding the define
"<tt>-DSTDC_VALUE=0</tt>" to their <tt>CPP_PREDEFINES</tt> flag.  
If you have done this and
are able to recompile gcc without this change then you should.  Otherwise
refer to the end of this section for instructions on how to fix the XFree86
tree so that it will still compile.<p>


Compiling XFree86,
<enum>
<item> Check that you have a "<tt>sys/uio.h</tt>" as there have been reports of
    systems which have it and systems which don't!  If you already have
    one it need not be changed.  Otherwise see the 3.2.2 section above on
	how to create one.

<item> Check the paragraph on <tt>site.def/xf86site.def</tt> in the compiling for
    3.2.2 section.

<item> Add a <tt>-DSCO324</tt> to the <tt>BOOTSTRAPCFLAGS</tt> when you do the make World.
<verb>
        make BOOTSTRAPCFLAGS="-DSYSV -Di386 -DSCO -DSCO324" World
</verb>
    Under 3.2.4 several different options become activated.
<itemize>
<item>Compress is used instead of pack for compressing the man pages.
<item>The default compile line will contain <tt>-D_NO_PROTOTYPE</tt> instead
      of <tt>-DNO_PROTOTYPE</tt> as this is what 3.2.4 expects.
</itemize>
<item> If you have problems with <tt>mkshlib</tt> reporting an error like
<verb>
        mkshlib: : cannot exec /bin/sh
 </verb>   
    when compiling <tt>libX11</tt>, then the following should fix it,
<verb>
        rm -f lib/X/libX11.a
        env - make
</verb>
    The error is related to a lack of environment space.
</enum>
<sect>Compiling with <tt>__STDC__=0</tt><p>

<bf>DO NOT</bf> make these changes unless you have gcc configured 
with <tt>STDC_VALUE=0</tt>.
You can test for this by compiling this small program.  If it prints out
<tt>STDC_VALUE=1</tt> do not make these changes.  If it prints out 
<tt>STDC_VALUE=0</tt> then
you will have to make the following changes.
<tscreen><verb>
    main() { printf("STDC_VALUE=%d\n", __STDC__); }
</verb></tscreen>
So now you have a gcc compiled with <tt>STDC_VALUE=0</tt> which 
cannot be recompiled
with a <tt>STDC_VALUE=</tt>1. To compile XFree86 with this compiler 
you will have to
edit <tt>mit/config/x386.cf</tt>.  Look for the pattern
<tt>GCC_STDC_VALUE</tt> and replace the
1 by a 0.  For example the line
<tscreen><verb>
    #define GCC_STDC_VALUE 1
</verb></tscreen>
should become,
<tscreen><verb>
    #define GCC_STDC_VALUE 0
</verb></tscreen>
It is recommended to use gcc compiled without the 
<tt>STDC_VALUE=0</tt> for building
XFree86.  It is, however, possible with the above changes.  These changes may
become obsolete or invalid in a later version of XFree86.<p>

<sect>Relevant Documentation<p>

Some relevant documentation for SCO Users and Developers can be found in
the following files.
<descrip>
<tag/README/       
the standard XFree86 <tt>README</tt> (<tt>/usr/X11R6/lib/X11/doc</tt>)
<tag/README.SVR3/  Although a lot of this readme is based on Interactive
                   a substantial proportion is still relevant.
<tag>All of the VGA/Config documentation.</tag>
       <tt>/usr/X11R6/lib/X11/doc/VideoModes.doc</tt> and the <tt>README</tt>
               files for particular video cards.
</descrip>

<sect>Known Problems<p>
<itemize>
<item>After running the server you may see some strange characters in your
input to the shell.  This is due to some unprocessed scancodes and is
of no concern.  This will be fixed in a future release.<p>
<item>Not all of the applications in <tt>/usr/X11R6/bin</tt> have 
been debugged.<p>
<item>Shared libraries are not implemented in XFree86 3.1 yet.<p>
</itemize>

<sect>Trouble Shooting<p>
<descrip>
<tag/Problem:/
<quote>
    Server aborts with the error message,
    "Failed to map video display memory".
</quote>
<tag/Causes:/
<quote>
    Your system does not have the correct <tt>/etc/conf/pack.d/cn/class.h</tt>,
    You can confirm this by editing the file and looking for the string
    "SVGA", if it is not there then you should re-install this file from
    the "Extended Utilities" diskettes provided with your OS.  If this is
    not possible then installing the "<tt>dmmap</tt>" driver from the 
    distribution
    may allow the server to operate correctly.
</quote>
<tag/Problem:/
<quote>
    <tt>xf86install</tt> does not work.
</quote>
<tag/Causes:/
<quote>
    You should not be running <tt>xf86install</tt> when using the 
    XFree86 server
    under SCO.  It is used for Interactive (ISC) installations.
</quote>
<tag/Problem:/
<quote>
    The server starts but the screen is not aligned correctly or is shaky
    and impossible to view.
</quote>
<tag/Causes:/
<quote>
    This is most likely due to an incorrect <tt>XF86Config</tt> setup.  
    Look for the
    files <tt>README.Config</tt>  <tt>VideoModes.doc</tt> (in 
    <tt>/usr/X11R6/lib/X11/doc</tt> with 
    the binary distribution).  These files explains how to fix up your 
    video modes.
</quote>
<tag/Problem:/
<enum>
<item> Can only run a limited number of xterms.
<item> <tt>xterm</tt> does not work but other programs like 
<tt>xclock</tt> do work.
</enum>

<tag/Causes:/
<quote>
    Not enough or no pseudo ttys devices are present on your system.
    Depending on which version of SCO you are using you will have to do
    different things.<p>
<descrip>
<tag/3.2.2/   <tt>cd /etc/conf/cf.d; ./configure</tt> and increase 
            the number of
            pseudo ttys.  Rebuild the kernel.
            "<tt>ls -al /dev/ttyp0 /dev/ptyp0</tt>" to 
            get the major numbers for the
            slave and master drivers.  Use <tt>mknod</tt> to create the extra
            devices using the naming schemes ttyp[0-9a-f] and ptyp[0-9a-f].
<tag/3.2.4/   Run "<tt>mkdev ptty</tt>" and increase the number of ptty's.
</descrip></quote>
<tag/Problem:/
<quote>
    When running curses/termcap applications in an <tt>xterm</tt>
     the output gets
    corrupted especially when scrolling.
</quote>
<tag/Causes:/
<enum>
<item>You are running an original 1.3 distribution of XFree86.  Update
       to the latest version (2.0 or greater).
<item>You have resized the window and not ran "<tt>eval `resize`</tt>" 
      before using
       your application.  The SCO operating system does not support dynamic
       resizing or xterms fully so this command must be run after resizing
       an <tt>xterm</tt> in order for curses/termcap applications to operate
       correctly.
</enum>
<tag/Problem:/
<enum>
<item>When starting X it dies with an error "Cannot access a needed shared
       library".
<item>When starting an X application is dies with the above error.
</enum>
<tag/Causes:/
<enum>
<item> You do not have the binaries installed in the correct directory.
       Check that they are in <tt>/usr/X11R6</tt>
<item> You have upgraded to a new binary distribution which has a new
       version of the shared libraries which are not compatible with your
       old binaries.  To fix this you will need to re-install the old
       shared libraries or recompile your application against the new
       libraries.
</enum>
<tag/Problem:/
<quote>    
    My SCO 3.2.4 system fails to build <tt>libXext.a</tt> for shared libraries.
</quote>
<tag/Causes:/
<quote>    
    This behaviour was observed when compiling with a 
    <tt>STDC_VALUE=0</tt> for gcc.
    mkshlib was core dumping on building the shared library in this case.
    Using a new gcc without the <tt>STDC_VALUE=0</tt> or using a 
    3.2.2 mkshlib
    appears to fix this problem.
</quote>
<tag/Problem:/
<quote>    
    When linking against the SCO motif library I get an unresolved external
    for "<tt>XtDisplayStringConversionWarning</tt>" when using gcc.
</quote>
<tag/Causes:/
<quote>    
    The SCO library is compiled with limited length identifiers.  To work
    around this add the following code to your application when compiling
    under XFree86 with gcc and SCO motif.
<verb>
    #ifdef SCO
    void XtDisplayStringConversionWarnin(dpy, from, toType)
        Display*  dpy;
        String    from;
        String    toType;
    { XtDisplayStringConversionWarning(dpy, from, toType); }
    #endif
</verb></quote>
<tag/Problem:/
<quote>
    When compiling the XFree86 source under 3.2.4, libX11 fails to get
    built with an error like "<tt>mkshlib : : cannot exec /bin/sh</tt>"
</quote>
<tag/Causes:/
<quote>
    Read the section on compiling for 3.2.4.  To fix this use 
"<tt>env - make</tt>".
</quote>
<tag/Problem:/
<quote>
    The server fails to run and prints out a line similar to:<p>
<tt>XFree86: Cannot open /dev/spx for ???? listener: No such file or directory
</tt></quote>
<tag/Causes:/
<quote>    
    All SCO unix installations appear to have the Streams pseudo tty driver
    installed its just not all the devices are present.<p>
<enum>
<item> there should be a <tt>/etc/conf/pack.d/sp</tt> directory,
<item> <tt>/etc/conf/sdevice.d/sp</tt> should have a '<tt>Y</tt>' in it.
<item> You need a file in <tt>/etc/conf/node.d</tt>
       which contains something like:
<verb>
        clone	spx		c	sp
        sp	X0S		c	127
        sp	X0R		c	126
        sp	X1S		c	125
        sp	X1R		c	124
        sp	X2S		c	123
        sp	X2R		c	122
        sp	X3S		c	121
        sp	X3R		c	120
        sp	X4S		c	119
        sp	X4R		c	118
        sp	X5S		c	117
	sp	X5R		c	116
        sp	X6S		c	115
        sp	X6R		c	114
        sp	X7S		c	113
        sp	X7R		c	112
</verb>
</enum>
    if you don't have something like this (maybe called "Xsco") then create
    one and that should fix your problem.  As far as I can tell the streams
    pseudo tty driver should be there.<p>
    The simplest way to get the devices if you had to create this file is
    to rebuild the kernel and the environment.  If you don't want to do this
    then:
<verb>            
        touch /etc/.new_unix
        cd /etc/conf/bin
        ./idmkenv
 </verb> 
    and try it out.
</quote>
</descrip>
<sect>Acknowledgements<p>

Thanks to the Core team for their previous and continuing help with the SCO
work.  Many thanks to <bf/Stacey Campbell/ at SCO for all the advice and
insights provided.  Thanks to SCO in general for making information available
for XFree86 development.

Thanks also to <bf/Peter Eubert/ (<em/peter.eubert@iwb.mw.tu-muenchen.dbp.de/)
and <bf/Kent Hamilton/ (<em/kenth@stl.scscom.COM/) for 
input on compiling under 3.2.4 
systems.  <bf/Larry Plona/ (<em/faxi@world.std.com/) and 
<bf/Didier Poirot/ (<em/dp@chorus.fr/)
for their input on xdm and 3.2.4 compilation under 3.1.   And of course the
beta list for its input on everything.

Special thanks to <bf/Jerry Whelan/ (<em/guru@stasi.bradley.edu/) 
for providing an
ftp site for the binary distribution.

<verb>  
$XConsortium: SCO.sgml,v 1.4 95/01/27 16:14:31 kaleb Exp $
$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/SCO.sgml,v 3.5 1995/01/25 11:08:52 dawes Exp $
</verb>
</article>
