<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Compiling the XFree86 Distribution</TITLE>
</HEAD>
<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">

<A HREF="LynxOS.html"><EM>README for XFree86 on LynxOS</EM></A>
 <b>:</b> <EM>Compiling the XFree86 Distribution</EM><BR>
<b>Previous:</b> <A HREF="LynxOS5.html"><EM>Using XFree86 with Motif</EM></A><BR>
<b>Next:</b> <A HREF="LynxOS7.html"><EM>Building on microSPARC and PowerPC</EM></A>


<HR NOSHADE>
  <H2><A NAME="20"></A>6. Compiling the XFree86 Distribution</H2>

<p>Before trying to rebuild XFree86 from source read <A href="BUILD.html">Building XFree86</A> for a detailed description of the build
process. The next sections contain LynxOS specific notes with
respect to the build process.</p>


<H3><A NAME="21"></A>6.1. Disk space requirements</H3>
<p>Currently there is no support for shared libraries in the LynxOS
XFree86 port. A complete binary installation along with manual pages
will require approximately 90-100 MBytes of disk space. To compile
the system you will need at least 230 MBytes of free disk space.</p>

<H3><A NAME="22"></A>6.2. Changes to system environment (LynxOS AT)</H3>
<p>Before compiling the XFree86 distribution you will have to make a
few little adjustments to your system:</p>
<p>
<dl>
<dt><b>LynxOS AT 2.5</b><dd><p>
<ul>
<li>Create a shell script named <code>/lib/cpp</code> as follows:
<blockquote><code>
<pre>
    #!/bin/sh
    /usr/lib/gcc-lib/i386-unknown-lynxos2.5/2.7-96q1/cpp \
	      -traditional "$@"
  
</pre>
</code></blockquote>

On other platforms than the AT the paths for the compiler support
programs are different. You may use
<blockquote><code>
<pre>
	gcc -v
  
</pre>
</code></blockquote>

to find out the correct path. Set the file mode of <code>/lib/cpp</code> with
<blockquote><code>
<pre>
	# chown root /lib/cpp
	# chmod 755 /lib/cpp
  
</pre>
</code></blockquote>
</li>
<li>Modify <code>/lib/liblynx.a</code>. The X servers need the 
<code>smem_create()</code> system call to map the frame buffer into their 
address space. The system call is in <code>liblynx</code> library along
with other Lynx proprietary calls which (unfortunately) overlap
with calls in <code>libc</code>. To reduce confusion you should modify
<code>liblynx</code> as follows:
<blockquote><code>
<pre>
    # mv /lib/liblynx.a /lib/liblynx.a.ORG
    # mkdir /tmp/xx; cd /tmp/xx
    # ar xv /lib/liblynx.a.ORG
    # ar rv /lib/liblynx.a *smem*
    # ranlib /lib/liblynx.a
  
</pre>
</code></blockquote>

</li>
</ul>
</p>
<dt><b>LynxOS AT 2.4</b><dd><p>
<ul>
<li>Use the CYGNUS GNU-C Compiler to build XFree86. With LynxOS 
2.4.0 you must execute the shell script <code>/CYGNUS.bash</code> to 
apply the necessary changes to your environment.</li>
<li>Create a shell script named <code>/lib/cpp</code> as follows:
<blockquote><code>
<pre>
    #!/bin/sh
    /cygnus/94q4-lynxos-x86/lib/gcc-lib/i386-lynx/2.6-94q4/cpp \
	      -traditional "$@"
  
</pre>
</code></blockquote>

It is possible that future releases use a different path for
the CYGNUS compiler support programs. You may use
<blockquote><code>
<pre>
	gcc -v
  
</pre>
</code></blockquote>

to find out the correct path. Set the file mode of <code>/lib/cpp</code> with
<blockquote><code>
<pre>
	# chown root /lib/cpp
	# chmod 755 /lib/cpp
  
</pre>
</code></blockquote>
</li>
</ul>
</p>
<dt><b>LynxOS AT 2.3</b><dd><p>This has actually not been tested, but the steps for described
for 2.4 should apply to 2.3 as well.</p>
<dt><b>LynxOS AT 2.2.1</b><dd><p>This has actually never been tested, be prepared that the build will
fail somewhere!
<ul>
<li>Create a shell script named <code>/lib/cpp</code> as follows:
<blockquote><code>
<pre>
    #!/bin/sh
    /usr/local/lib/gcc-cpp -traditional "$@"
  
</pre>
</code></blockquote>
</li>
<li>The loader /bin/ld of LynxOS 2.2.1 does not support the -L option
which is heavily used by X11R6 makefiles. To work around this
problem you must install a small wrapper program which replaces
the original /bin/ld program. Use the following steps to install
it:
<blockquote><code>
<pre>
      # cd xc/programs/Xserver/hw/xfree/etc
      # cc -o ld ld-wrapper.c
      # mv /bin/ld /bin/ld.org
      # mv ld /bin/ld
      # chmod 511 /bin/ld
      # chown root /bin/ld
  
</pre>
</code></blockquote>
</li>
<li>Modify system header files as follows:
<dl>
<dt><b><code>/usr/include/uio.h</code></b><dd><p>surrounded by
<blockquote><code>
<pre>
          #ifndef _UIO_H
          #define _UIO_H
          ...
          #endif
     
</pre>
</code></blockquote>
</p>
<dt><b><code>/usr/include/utmp.h</code></b><dd><p>surrounded by
<blockquote><code>
<pre>
          #ifndef _UTMP_H
          #define _UTMP_H
          ...
          #endif
     
</pre>
</code></blockquote>
</p>
<dt><b><code>/usr/include/unistd.h</code></b><dd><p>add
<blockquote><code>
<pre>
          extern int read();
     
</pre>
</code></blockquote>
</p>
</dl>
</li>
</ul>
</p>
</dl>
</p>

<H3><A NAME="23"></A>6.3. make World</H3>

<p>Read <A href="BUILD.html">Building XFree86</A> before
trying to rebuild XFree86 from the source distribution.</p>
<p>You may then issue a</p>
<p>
<blockquote><code>
<pre>
     make World
  
</pre>
</code></blockquote>
</p>
<p>to compile XFree86. After a few hours (and hopefully a successful
build of the XFree86 system) you can install the software using</p>
<p>
<blockquote><code>
<pre>
     make install
  
</pre>
</code></blockquote>
</p>
<p>You must be logged in as super-user (root) when you invoke `make
install'.  Be sure to set your environment to use the same compiler
(LynxOS 2.3.0/2.4.0, CYGNUS GNU-C) as you did during the `make World'. To
install the LinkKit use</p>
<p>
<blockquote><code>
<pre>
     make install.linkkit
  
</pre>
</code></blockquote>
</p>
<p>With LynxOS 2.2.1 programs will not be stripped during
installation. This is due to a problem with the strip program which
shows up when installing across file system boundaries.</p>
<p>Refer to section 
<A HREF="LynxOS4.html#installman">Installing XFree86 manual pages</A> 
for manual page installation.</p>
<p>On LynxOS AT 2.5.0 you may encounter problems with <code>make</code> in
deeply nested subdirectories (eg core dumps, hangups). In this case
update to GNU make version 3.75 or higher.</p>

 <HR NOSHADE>
<A HREF="LynxOS.html"><EM>README for XFree86 on LynxOS</EM></A>
 <b>:</b> <EM>Compiling the XFree86 Distribution</EM><BR>
<b>Previous:</b> <A HREF="LynxOS5.html"><EM>Using XFree86 with Motif</EM></A><BR>
<b>Next:</b> <A HREF="LynxOS7.html"><EM>Building on microSPARC and PowerPC</EM></A>



</BODY>
</HTML>
