<HTML>
<TITLE>x3270 Build and Install Instructions</TITLE>
<H1>x3270 Build and Install Instructions</H1>

<H2>Vanilla X11R5 or X11R6</H2>

<B>x3270</B> was developed on a Sun workstation running SunOS 4.1.3_U1 and MIT
X11R5.
It is set up to build and install without modifications under any complete
X11R5 or X11R6 implementation.
<P>
A "complete" R5 or R6 implementation means that xmkmf and imake are configured
and installed on your system, and that the Xaw and Xmu libraries and header
files are installed.  Some vendors (HP and IBM in particular) consider these
optional software and do not always install them.
<P>
If you are running vanilla X11R5 or X11R6, then the build procedure is:
<P>
<PRE>
    xmkmf		# create a Makefile
    make depend		# add dependency information
    make		# build x3270 and its fonts
</PRE>
<P>
<B>x3270</B> prefers that its fonts be installed in order to run.  However, a
script
is provided for testing a local copy of <B>x3270</B> in the current directory:
<P>
<PRE>
    ./dryrun		# test x3270
</PRE>
<P>
Once you are satisfied that <B>x3270</B> is working, you can install it (as
root)
with the command:
<P>
<PRE>
    make install
</PRE>
<P>
Before running <B>x3270</B>, you will also need to (once):
<P>
<PRE>
    xset fp rehash
</PRE>
<P>
That's the easy way.  Here are the exceptions:

<H2>Vanilla X11R4</H2>

If you are running MIT X11R4 (subject to the same definition of "completeness"
above), the build procedure is almost as simple:
<P>
<PRE>
    mv Imakefile.R4 Imakefile	# use the R4 Imakefile instead
    xmkmf			# create a Makefile
    make depend			# add dependency information
    make			# build x3270 and its fonts
</PRE>
<P>
<B>x3270</B> prefers that its fonts be installed in order to run.  However, a
script
is provided for testing a local copy of <B>x3270</B> in the current directory:
<P>
<PRE>
    ./dryrun		# test x3270
</PRE>
<P>
Once you are satisfied that <B>x3270</B> is working, you can install it (as
root)
with the command:
<P>
<PRE>
    make install
</PRE>
<P>
Before running <B>x3270</B>, you will also need to (once):
<P>
<PRE>
    xset fp rehash
</PRE>
<P>
<H2>IBM RS/6000, AIX 3.2, X11R5</H2>

AIX X11R5 does not include does not include xmkmf or imake, but it includes
the source code for them.  If these have not been built and installed on
your system (e.g., if there is no such file as "/usr/bin/X11/imake"), you must
first build and install them by following the instructions in
/usr/lpp/X11/Xamples/README.
<P>
Once these have been installed, you can use the standard X11R5 build procedure
above.

<H2>IBM RS/6000, AIX 3.2, X11R4</H2>

AIX X11R4 does not include the Xaw libraries by default, and it does not
include xmkmf at all.  If the "Xample" clients and libraries have not been
installed on your system (e.g., if there is no such file as
"/usr/bin/X11/imake"), you must first build and install them by following the
instructions in /usr/lpp/X11/Xamples/README.
<P>
Once these have been installed, you can use a simple variation on the R4 build
procedure:
<P>
<PRE>
    mv Imakefile.R4 Imakefile	# use the R4 Imakefile instead
    imake -DUseInstalled -I/usr/lpp/X11/Xamples/config	# replacement for xmkmf
    make depend			# add dependency information
    make			# build x3270 and its fonts
</PRE>
<P>
<B>x3270</B> prefers that its fonts be installed in order to run.  However, a
script
is provided for testing a local copy of <B>x3270</B> in the current directory:
<P>
<PRE>
    ./dryrun		# test x3270
</PRE>
<P>
Once you are satisfied that <B>x3270</B> is working, you can install it (as
root)
with the command:
<P>
<PRE>
    make install
</PRE>
<P>
Before running <B>x3270</B>, you will also need to (once):
<P>
<PRE>
    xset fp rehash
</PRE>
<P>
<H2>HP-UX A9.01, X11R5</H2>

HP's X11R5 distribution does not include the Xaw libraries or header files.  As
HP's X man page says,
<BLOCKQUOTE>
    A number of unsupported core MIT clients and miscellaneous utilities
    are provided in /usr/contrib/bin.  In addition, the entire core MIT
    distribution, compiled for Hewlett-Packard platforms, can be obtained
    from HP's users group INTERWORKS for a nominal fee.  See the release
    notes for details.
</BLOCKQUOTE>
What you need is the Xaw and Xmu libraries, imake, and xmkmf.  Then you can
follow the vanilla R5 build and install instructions.

<H2>Sun Solaris 2.3, 2.4 or 2.5, OpenWindows 3.3, 3.4 or 3.5</H2>

Follow the instructions for Vanilla X11R5, with the following two changes.
<P>
Sun's 'xmkmf' configuration puts some compiler flags in the Makefile
that are specific to Sun's unbundled C compiler.  If you are using a
different C compiler such as gcc, you may get a number of harmless, but
annoying error messages while compiling.
To eliminate these, use the command:
<P>
<PRE>
    make "CDEBUGFLAGS=-O" "CCOPTIONS=-DSYSV -DSVR4"
</PRE>
<P>
'xmkmf' also gets the path of the 'install' program wrong.
To install <B>x3270</B>, you must use the command:
<P>
<PRE>
    make INSTALL=/usr/ucb/install install
</PRE>
<H2>Sun SunOS 4.1.x, OpenWindows 3.0, 3.1, or 3.2</H2>

Sun OpenWindows under SunOS uses a proprietary font format that renders
standard Imakefiles useless.  A special Makefile is included in the
<B>x3270</B>
distribution to handle this.  (NOTE: The special Makefile must be run with Sun
make; Gnu make will not work).
<P>
To build <B>x3270</B>:
<P>
<PRE>
    make -f Makefile.openwin
</PRE>
<P>
If you get the following undefineds:
<PRE>
   _get_wmShellWidgetClass
   _get_applicationShellWidgetClass
</PRE>
<P>
This is a bug in Sun's X11 libraries, and can be corrected by obtaining
patches 100512-02 and 100573-03 from Sun.  As a short-term workaround,
there is a line in Makefile.openwin which you can uncomment.
<P>
Note:  When the fonts are being compiled, the "bldfamily" program will produce
output lines that look like:
<PRE>
    * 3270                 ./3270.ff (Encoding: unknown)
</PRE>
These "unknown" messages are harmless.
<P>
<B>x3270</B> prefers that its fonts be installed in order to run.  However, a
script
is provided for testing a local copy of <B>x3270</B> in the current directory:
<P>
<PRE>
    ./dryrun		# test x3270
</PRE>
<P>
To install:
<P>
<PRE>
    make -f Makefile.openwin install
</PRE>
<P>
Before running <B>x3270</B>, you will also need to (once):
<P>
<PRE>
    xset fp rehash
</PRE>
<P>
<H2>SunOS 4.1.x, OpenWindows 2</H2>

OpenWindows 2 does not include the the Athena Widgets (Xaw) or Xmu libraries,
so <B>x3270</B> cannot be built under it.

<H2>Systems Based on System V, Release 4</H2>

Before running xmkmf, you must uncomment a line in the Imakefile to include
the network libraries:
<PRE>
  EXTRA_LIBRARIES = -lnsl -lsocket
</PRE>

<H2>Mixed X Environments</H2>

If you are running a mixture of X environments, such as running a Sun XNews
server but using X11R5 libraries and header files, the supplied Imakefile
may not work properly, because it assumes that your server and libraries are
of the same type.  This is not an impossible situation, just a difficult one.
It generally means that you will have to build and install the fonts
separately, perhaps even by hand.
<P>
Some tools are available to help.  If you need to build fonts for an XNews
(Sun OpenWindows) server, but otherwise are using X11R4 or X11R5 libaries to
build <B>x3270</B>, you can build and install OpenWindows fonts separately with the
commands:
<P>
<PRE>
    make -f Makefile.openwin fonts
    make -f Makefile.openwin install.fonts
</PRE>
<P>
<H2>Building Fonts for X Terminals</H2>

The Imakefile that comes with <B>x3270</B> assumes that you plan to run the
<B>x3270</B>
client on the same workstation as your X server.  Therefore it builds fonts
for that kind of X server.  Compiled fonts (.snf or .pcf files) are not
compatible between different servers, so if you run <B>x3270</B> with its
display
somewhere else (such as on an X Terminal), you will need to compile the fonts
for that server.  It is impossible to give comprehensive instructions here;
however, here is an outline for how to do it:
<UL>
    Copy all of the .bdf files from the <B>x3270</B> distribution into a new
     directory, say XXX.
<P>
    cd into XXX.
<P>
    For each .bdf file, run the server-specific version of bdftosnf to
     create a .snf file.  For example, for to build an NCD font on a
     Sun-4, the command is:
<PRE>
	/usr/local/NCD/binSun4/bdftosnf 3270.bdf >3270.snf
</PRE>
    Run the server-specific version of mkfontdir.  For example:
<PRE>
	/usr/local/NCD/binSun4/mkfontdir .
</PRE>
    Then tell your X server to use this directory:
<PRE>
	xset fp+ XXX
	xset fp rehash
</PRE>
</UL>
<H2>A Note About libXaw3d (The 3-Dimensional Athena Widget Library)</H2>
Because <B>x3270</B> defines its own Athena widgets, if you have
<B>libXaw3d</B> (the 3-dimensional Athena Widget Library) installed on
your system, you <I>must</I> also install the xaw3d header files.
<P>Note that with both xaw3d header files and libraries, <B>x3270</B> will
build and run, but it will be rather ugly.
<H2>SCO Open Desktop 3</H2>
You will need to edit a few files in order to build under SCO Open Desktop 3.
<P>
In globals.h, remove the "#define NO_SYS_TIME_H" that is defined for sco.
<P>
In Imakefile, add:
<PRE>
	EXTRA_LIBRARIES = -lnsl_s -lsocket
</PRE>
Also be aware that <B>x3270</B> requires the Athena Widgets library, which is
available from sosco.sco.com.

<H2>Using an app-defaults File</H2>
Earlier versions of <B>x3270</B> required a separate <B>app-defaults</B> file.
The app-defaults file contains definitions for options, text strings,
fonts, colors, etc.  The file allows <B>x3270</B> to be reconfigured without
recompiling by simply editing the file.

<P>Unfortunately, using an app-defaults file is a pain.  The mechanism
for finding the file is so flexible as to be almost incomprehensible, and it
is difficult to run the program without doing a full installation, requiring
root access to your system.  Also, the app-defaults file generally changes
whenever the program changes, and making sure that <B>x3270</B> finds the
<STRONG>correct</STRONG> app-defaults file compounds the above problems.

<P>Starting with version 3.1.0.0, <B>x3270</B> no longer uses a separate
app-defaults
file.  Instead, the file is compiled into <B>x3270</B> itself.  To change a
basic
resource definition, you edit a new file, <B>X3270.xad</B>, and recompile
<B>x3270</B>.

<P>If however, you prefer to have a separate app-defaults file, you can compile
<B>x3270</B> to use it.

<P>First, you must decide whether you want app-defaults for a color display
or a monochrome display.  The default is color; if you want monochrome
app-defaults you must edit Imakefile or Makefile.openwin (depending on which
you are using) and un-comment the line under the comment "Rule for building a
separate app-defaults file...".

<P>Then you need to edit Imakefile or Makefile.openwin, and un-comment the
lines under the comment "To use a separate app-defaults file...".  Then, if
you are using Imakefile, do the following:
<PRE>
	xmkmf
	make depend
	make clean
	make
</PRE>
If you are using Makefile.openwin, do the following instead:
<PRE>
	make -f Makefile.openwin clean
	make -f Makefile.openwin
</PRE>
With Makefile.openwin, there is also an extra install step:
<PRE>
	make -f Makefile.openwin install.app-defaults
</PRE>
Note that using a separate app-defaults file is not a supported configuration,
so if you have problems with such an installation, the first question will be,
"Why are you doing it that way?"
