# c3270 Build and Install Instructions

To build c3270, type:

        ./configure
        make

To install c3270 in the default install directory (`/usr/local`), type:

        make install

## Wide Curses Requirement

c3270 needs a 'wide' version of the curses or ncurses library (one that supports multi-byte character encodings). Without wide curses or ncurses, c3270 will be restricted to using the 7-bit basic ASCII character set.

On some platforms, the standard curses or ncurses library is the wide version and no extra packages need be installed. On others, a special wide ncurses package is needed. On still others (such as on Solaris, documented below) the wide curses library is installed in a special location and `configure` must be told where to locate it using CPPFLAGS and LDFLAGS.

## Notes for Cygwin

The minimum set of Cygwin packages needed to compile c3270 are:

- The default set (bash, etc.)
- The make package from the Devel group
- The gcc-core package from the Devel group
- The libncurses-devel package from the Devel group

Optional features require some additional packages:

- For SSL support, you need the openssl-devel package from the Devel group
- For command-line editing and history, you need the readline package from the Devel group
- To build a standalone ZIP file (see below), you need the zip package from the Archive group

To build a standalone version of c3270 (a ZIP file containing `c3270.exe` and the minimum set of Cygwin libraries and configuration files -- thus allowing c3270 to be installed and run without a full Cygwin installation), type:

        make c3270-standalone-zip

## Notes for Sun's C Compiler

Do not use Sun's BSD-compatibility compiler, `/usr/ucb/cc`. This is good advice in general, but in particular, c3270 will not build with it. In general, you must have a directory containing `gcc` (preferred) or Sun's ANSI C compiler (usually in `/usr/ccs/bin`) in your $PATH ahead of `/usr/ucb`.

## Notes for Solaris

c3270 prefers wide curses, which on Solaris is in the `/usr/xpg4` directory. To use this version of curses, set CPPFLAGS and LDFLAGS when running `configure`:

        ./configure CPPFLAGS=-I/usr/xpg4/include LDFLAGS=-L/usr/xpg4/lib

## Building on FreeBSD

FreeBSD's iconv library is installed in `/usr/local`, so the the following options must be passed to the `configure` script:

           ./configure LDFLAGS=-L/usr/local/lib CPPFLAGS=-I/usr/local/include

## Summary of `configure` Options

The c3270 `configure` script accepts the following options:

`--help` | Print a help message.
`--prefix=prefix` | Install architecture-independent files under prefix (defaults to `/usr/local`)
`--exec-prefix=eprefix` | Install architecture-dependent files (executables) under eprefix (defaults to same as prefix)
`--bindir=dir` | Install user executables (c3270, x3270if, pr3287) in dir (defaults to eprefix`/bin`)
`--sysconfdir=dir` | Install configuration files (`ibm_hosts`, character sets) in dir (defaults to prefix`/etc`).
`--without-readline` | Don't use the readline command-line editing library, even if it is found on the system.
`--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.
`--disable-ansi` | Leave out NVT (ANSI) support. Note that NVT support is required for TN3270E support.
`--disable-apl` | Leave out APL character support.
`--enable-dbcs` | Build in DBCS (Double Byte Character Set) support.
`--disable-ft` | Leave out IND$FILE file transfer 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-printer` | Leave out printer session (pr3287) support.
`--disable-script` | Leave out scripting support.
`--disable-ssl` | Leave out SSL (Secure Sockets Layer) support. SSL support requires the OpenSSL library.
`--with-ssl=dir` | Specify the directory where the OpenSSL library is installed.
`--disable-tn3270e` | Leave out TN3270E support.
`--disable-trace` | Leave out tracing support.

Leaving out all of the optional features will result in a smaller binary.