<!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>Building New X Clients</TITLE>
</HEAD>
<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">

<A HREF="NetBSD.html"><EM>README for XFree86 on NetBSD</EM></A>
 <b>:</b> <EM>Building New X Clients</EM><BR>
<b>Previous:</b> <A HREF="NetBSD9.html"><EM>Rebuilding the XFree86 Distribution</EM></A><BR>
<b>Next:</b> <A HREF="NetBSD11.html"><EM>Thanks</EM></A>


<HR NOSHADE>
  <H2><A NAME="22"></A>10. Building New X Clients</H2>
<p>The easiest way to build a new client (X application) is to use
<code>xmkmf</code> if an <code>Imakefile</code> is included in the sources.  Type
``<code>xmkmf -a</code>'' to create the Makefiles, check the configuration if
necessary and type ``<code>make</code>''.  Whenever you install additional man
pages you should update <code>whatis.db</code> by running ``<code>makewhatis
/usr/X11R6/man</code>''.</p>
<p>To avoid the ``Virtual memory exhausted'' message from cc while
compiling, increase the data and stack size limits (in csh type ``<code>limit
datasize 32M</code>'' and ``<code>limit stacksize 16M</code>'').</p>
<p>Note: Starting with XFree86 2.1 and NetBSD 0.9A, the symbol
<b>__386BSD__</b> no longer gets defined either by the compiler or via the
X config files for *BSD systems.  When porting clients to *BSD
systems, make use of the symbol <b>BSD</b> for code which is truly
BSD-specific.  The value of the symbol can be used to distinguish
different BSD releases.  For example, code specific to the Net-2 and
later releases can use:</p>
<p>
<blockquote><code>
                   
#if (BSD &gt;= 199103)
</code></blockquote>
</p>
<p>To ensure that this symbol is correctly defined, include
<code>&lt;sys/param.h&gt;</code> in the source that requires it.  Note that
the symbol <b>CSRG_BASED</b> is defined for *BSD systems in XFree86 3.1.1
and later.  This should be used to protect the inclusion of
<code>&lt;sys/param.h&gt;</code>.</p>
<p>For code that really is specific to a particular i386 BSD port, use
<b>__FreeBSD__</b> for FreeBSD, <b>__NetBSD__</b> for NetBSD,
<b>__OpenBSD__</b> for OpenBSD,
<b>__386BSD__</b> for 386BSD, and <b>__bsdi__</b> for BSD/386.</p>
<p>Another note: If you get the message:</p>
<p>
<blockquote><code>
                   
ld.so: undefined symbol _XtCvtStringToFont 
</code></blockquote>
</p>
<p>at run-time, you've stumbled on a semantic weakness of the NetBSD 
dynamic linker. Applications that use libXmu also need libXt. If the
client uses a standard <code>Imakefile</code>, this dependency will probably by
included in the Makefile automagically -- you'll not see the
problem. Otherwise, just add ``<code>-lXt</code>'' to your library list in the
Imakefile or Makefile and relink.</p>

 <HR NOSHADE>
<A HREF="NetBSD.html"><EM>README for XFree86 on NetBSD</EM></A>
 <b>:</b> <EM>Building New X Clients</EM><BR>
<b>Previous:</b> <A HREF="NetBSD9.html"><EM>Rebuilding the XFree86 Distribution</EM></A><BR>
<b>Next:</b> <A HREF="NetBSD11.html"><EM>Thanks</EM></A>



</BODY>
</HTML>
