Build and install instructions for etsh!

--------
SYNOPSIS
	env [variable=value ...] make [target ...]
	make [variable=value ...] [target ...]

If the defaults described below match your desires and/or the
requirements of your system, you can build and install the etsh
package (binaries and manual pages) by doing the following.

	% ./configure
	% make
	% make exp
	# make install install-exp

...
NOTE: You can do `./configure -h' for help.

Otherwise, continue reading for full build and install details.
See the EXAMPLES section at the end of this file for additional
help if needed.

---------
VARIABLES
The Makefile defines the following configuration variables (default
value listed).  The user can modify the default configuration by
passing the desired variable=value pair(s) on the command line.

	DESTDIR		Unset by default.  This may be used as a
			target directory for building/packaging
			binary packages if needed.

	PREFIX		Defaults to /usr/local.  This is the target directory
			where BINDIR, LIBEXECDIR*, DOCDIR, EXPDIR, MANDIR,
			and SYSCONFDIR are located by default.

	BINDIR		Defaults to $(PREFIX)/bin.
			This is the target directory where
			the etsh and tsh binaries are installed.

	LIBEXECDIR	Defaults to $(PREFIX)/libexec/$(ETSH_VERSION).
			This is the target directory that contains two
			subdirectories, etsh and tsh.

	LIBEXECDIRETSH	Defaults to $(PREFIX)/libexec/$(ETSH_VERSION)/etsh.
			This is the target directory for etsh(1) support
			scripts and files.

	LIBEXECDIRTSH	Defaults to $(PREFIX)/libexec/$(ETSH_VERSION)/tsh.
			This is the target directory where tsh(1) external
			utilities (glob, if, goto, and fd2) are installed
			and where tsh(1) expects to find them.

	DOCDIR		Defaults to $(PREFIX)/share/doc/etsh.
			This is the target directory for the - README,
			NOTES, LICENSE, DEDICATIONS, and AUTHORS - files.

	EXPDIR		Defaults to $(PREFIX)/share/examples/etsh.  This is the
			target directory for the examples/.* & examples/* files.

	MANDIR		Defaults to $(PREFIX)/man/man1.  This is the
			target directory where the manual pages are
			installed.

	SYSCONFDIR	Defaults to $(PREFIX)/etc.  This is the target
			directory where etsh searches for its system-wide
			rc (init and logout) files if such files are
			available on the system.  See also:

				https://etsh.io/rc_files

			...
			for example rc files.

	INSTALL		Defaults to /usr/bin/install.  The install(1)
			utility is used to copy the resulting binaries,
			manual pages, and other files to final targets.

(Mac) OS X only:
The following configuration variables specify the desired target
architecture(s) for compiling universal binaries and/or 64-bit
binaries and/or 32-bit binaries for (Mac) OS X running on Intel
and PowerPC Macs.

	OSXCFLAGS	Unset by default.

	OSXLDFLAGS	Unset by default.

			Possible value(s) for OSXCFLAGS and OSXLDFLAGS may
			include one or more of the following on supported
			systems:

				-arch x86_64, -arch ppc64, -arch i386, -arch ppc

			...
			See also EXAMPLES.

-------
TARGETS
The following targets are available.

	all		Default target is the same as typing `make'.
			Compiles everything and generates manual pages.

	etshall		Compiles etsh and generates manual pages.

	tshall		Compiles tsh, glob, if, goto, fd2 and
			generates manual pages.

	exp		Prepares and/or readies examples for installation.

	check		Runs the regression test suite with etsh and tsh.
	check-etsh	...                                 etsh.
	check-etshall	...                                 etsh.
	check-tsh	...                                          tsh.
	check-tshall	...                                          tsh.

	check-newlog	Generates new test logs for the etsh and tsh
			regression test suite.

	install		Installs all binaries and manual pages.

	install-etshall	Installs etsh binary and manual pages.

	install-tshall	Installs tshall binaries and manual pages.

	install-doc	Installs package documentation.

	install-exp	Installs examples.

	clean-obj	Removes all object files.

	clean		Removes all binaries, object files, and other
			files generated during the build.

--------
EXAMPLES
The following configures and compiles tsh and its external utilities
(glob, if, goto, and fd2) for /usr/pkg.  Then, it installs the tsh
binary into /usr/pkg/bin, its external utilities into LIBEXECDIRTSH,
and the manual pages into /usr/pkg/man/man1.

	% ./configure
	% make PREFIX=/usr/pkg tshall
	# make PREFIX=/usr/pkg install-tshall

If you build on OpenBSD or NetBSD with BSD make and the default CFLAGS=-O2
suites your needs, then don't specify CFLAGS.  On the other hand, if you
use GNU make (gmake) on OpenBSD or GNU/Linux, you will want to specify
your optimization via CFLAGS or have it unspecified for your build.

If you want to specify any -O (optimization) flags/options, you can
use env and CFLAGS=-O2 (or the optimization level you prefer), as
illustrated below.  [1]...

The following configures and compiles everything, setting up etsh to
search for its system-wide rc files in /etc instead of /usr/local/etc
by default.  Then, it installs the entire etsh package, including
package documentation and examples, into the default locations.

	% ./configure
	% env CFLAGS=-O2 make SYSCONFDIR=/etc
	% make SYSCONFDIR=/etc exp
	# make install install-doc install-exp

The following is the same as above, but with statically-linked binaries,
instead of dynamically-linked, which is the default.  [2]...

	% ./configure
	% env CFLAGS=-O2 LDFLAGS=-static make SYSCONFDIR=/etc
	% make SYSCONFDIR=/etc exp
	# make install install-doc install-exp

The following configures and compiles each program as a 2-way 64/32-bit
universal binary for (Mac) OS X running on Intel Macs.  Then, it installs
the entire etsh package, including package documentation and examples,
into the default locations.
 
	% ./configure
	% make OSXCFLAGS='-arch x86_64 -arch i386' \
	       OSXLDFLAGS='-arch x86_64 -arch i386'
	% make exp
	# make install install-doc install-exp

The following may or may not work on OpenIndiana.  Please send me
your feedback about installing etsh there, if you would be so kind.
I haven't tested it there myself, but (minus the `./configure' and
`gmake exp' steps) this is what used to work for me on OpenSolaris.

	% ./configure
	% uname -srvm
	SunOS 5.11 snv_111b i86pc
	% which cc gmake ginstall
	/usr/gnu/bin/cc
	/usr/bin/gmake
	/usr/bin/ginstall
	% gmake
	% gmake exp
	# gmake INSTALL=/usr/bin/ginstall install install-doc install-exp

Footnotes:

1. ... It's not unimportant, since I haven't specified any optimization
   level in the Makefile at all.  Perhaps I should, but I don't know;
   I've heard that doing so can interfere with packaging systems.

2. ... But you may ask...  Why would you want to statically link etsh
   and/or tsh & its utilities??  For me, being able to run etsh in single-
   user mode is 1 reason!!  There are noticeable performance improvements
   too ( according to time(1) )!  Yes, I have a statically linked etsh
   installed as /bin/etsh; it's faster without a doubt... =)

Jeffrey Allen Neitzel						2018/06/14

@(#)$Id: INSTALL,v 1.1 2018/06/14 00:00:00 jneitzel $
