x3270 Build and Install Instructions

Vanilla X11R6 or X11R5

x3270 is set up to build and install without modifications under any complete X11R6 or X11R5 implementation.

A "complete" R6 or R5 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, IBM, SCO) consider these optional software and do not always install them.

If you are running vanilla X11R6 or X11R5, then the build procedure is to ensure that your X11 bin directory is in your $PATH, then:

    ./configure         # probe for system dependencies and create the Makefile
    make depend         # add dependency information
    make                # build x3270 and its fonts
x3270 prefers that its fonts be installed in order to run. However, a script is provided for testing a local copy of x3270 in the current directory:
    ./dryrun            # test x3270
Once you are satisfied that x3270 is working, you can install it (as root) with the command:
    make install
    make install.man
Before running x3270, you will also need to (once):
    xset fp rehash
That's the easy way. Here are the exceptions:

IBM RS/6000, AIX 4.3.3 and 4.2.1

There is a bug in the X11.tmpl file in the X11 config directory, which causes the Makefile produced by imake to have an extra @ character in it.

After running configure, edit the Makefile and change:

@@for
to:
@for
(there's only one).

IBM RS/6000, AIX 3.2, X11R5

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.

Once these have been installed, you can use the standard X11R5 build procedure above.

HP-UX A9.01, X11R5

HP's X11R5 distribution does not include the Xaw libraries or header files. As HP's X man page says,
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.
What you need is the Xaw and Xmu libraries, imake, and xmkmf. Then you can follow the vanilla R5 build and install instructions.

Sun Solaris 2.x

Follow the instructions for Vanilla X11R6, with the following changes.

Do not use Sun's "BSD-compatibility" C compiler, /usr/ucb/cc. This is good advice in general, and in particular, x3270 will not build under it. Unfortunately, if you have installed Sun's unbundled C compiler, and have /usr/ucb in your $PATH ahead of /usr/ccs/bin, then you will get /usr/ucb/cc by default. The fix is to install gcc (much preferred) or to have /usr/ccs/bin ahead of /usr/ucb in your $PATH.

If you are using gcc, then Sun's xmkmf configuration puts some compiler flags in the Makefile that are specific to Sun's unbundled C compiler, and you may get a number of harmless, but annoying error messages while compiling. To eliminate these, use the command:

    make CDEBUGFLAGS=-O "CCOPTIONS=-DSYSV -DSVR4"
To run x3270, you must have your LD_LIBRARY_PATH environment variable set properly. First, it must include /usr/openwin/lib.

Cygwin with XFree86

There appears to be a bug in the Cygwin/XFree86 config that causes an unresolved symbol. The workaround is:
make XAWLIB="-lXaw -lXpm"

Mixed X Environments

If you are running a mixture of X environments, such as running a Sun XNews server but using X11R6 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.

Building Fonts for X Terminals

The Imakefile that comes with x3270 assumes that you plan to run the x3270 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 x3270 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:

SCO Open Desktop 3

x3270 requires the Athena Widgets library, which is available from sosco.sco.com.

Using an app-defaults File

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

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 x3270 finds the correct app-defaults file compounds the above problems.

Starting with version 3.1.0.0, x3270 no longer uses a separate app-defaults file. Instead, the file is compiled into x3270 itself. If however, you prefer to have a separate app-defaults file, you can compile x3270 to use it.

First, you must decide whether you want app-defaults for a color display or a monochrome display. For a color display, the commands are:

        ./configure --enable-app-defaults
        make clean
        make
For a monochrome display, the commands are:
        ./configure --enable-app-defaults=-UCOLOR
        make clean
        make

Summary of configure Options

The x3270 configure script accepts the following options:
 
--help Print a help message.
--prefix=prefix Install architecture-independent files under prefix (defaults to /usr/local).
Note that except for configuration files, this option is overridden by the --with-xinstall option.
--exec-prefix=eprefix Install architecture-dependent files (executables) under eprefix (defaults to same as prefix).
Note that this option is overridden by the --with-xinstall option.
--bindir=dir Install user executables (x3270, x3270if, pr3287) in dir (defaults to eprefix/bin).
Note that except for pr3287, this option is overridden by the --with-xinstall option.
--sysconfdir=dir Install configuration files (ibm_hosts, character sets) in dir/x3270 (defaults to prefix/etc).
--enable-app-defaults
--enable-app-defaults=-UCOLOR
Use a separate app-defaults file, instead of compiling one into the x3270 executable.
With the =-UCOLOR option, builds for a monochrome display.
--without-pr3287 Don't build pr3287.
Useful if you don't need printer session support, or if you want to build pr3287 separately or with different configuration options.
--with-xinstall Install x3270, x3270if, fonts and man pages in the system's X11 directory, rather than the directory specified by --prefix. This was the default behavior for previous versions of x3270.
--with-fontdir=/full-path
--with-fontdir=relative-path
Install fonts in an alternate directory.  The default is the misc subdirectory of the system's X11 font directory.
If the parameter starts with "/", it specifies the full pathname of a directory.
If not, it specifies a subdirectory of the system's X11 font directory.
--disable-ansi Leave out NVT (ANSI) support.
Note that NVT support is required for TN3270E support.
--disable-apl Leave out APL character support.
--disable-ft Leave out IND$FILE file transfer support.
--disable-keypad Leave out pop-up keypad support.
--disable-local-process Leave out local process (connecting to "-e shell_command") support.
This will be automatically disabled if the local system does not support the forkpty() library call.
--disable-menus Leave out menu support. This is helpful for building kiosk applications where the user cannot reconfigure x3270.
--disable-printer Leave out printer session (pr3287) support.
--disable-script Leave out scripting support.
--disable-tn3270e Leave out TN3270E support.
--disable-trace Leave out tracing support.

Leaving out all of the optional features will result in a binary that's about 40% smaller, and doesn't do a whole lot more than a single session of basic TN3270.

Note that despite what the help message says, the configure options  --prefix, --exec-prefix and --bindir have no effect on where x3270's files are installed, and just to confuse the matter, they do affect where pr3287's files are installed.

By default, x3270's files are installed under the system's X11 directory, e.g., /usr/X11R6/. To install binaries (x3270, x3270if) in a different directory, set the BINDIR make variable, e.g.:

make install BINDIR=/usr/local/bin
To install man pages in a different directory, set the MANDIR make variable, e.g.:
make install.man MANDIR=/usr/local/man
To install fonts and the ibm_hosts file under a different directory, set the LIBDIR make variable, e.g.:
make install LIBDIR=/usr/local
Note that fonts will be installed in the fonts/misc/ subdirectory of the specified directory, and the ibm_hosts file will be installed in the x3270/ subdirectory of the specified directory.