Installation
============

Usually, you can just use the typical incantation of:

	$ ./configure
	$ make
	$ make install

If you are however on some less typical system, when some part of this does not
work, this document should hopefully guide you in the right direction.

Dependencies
------------

Required dependencies are POSIX-like system (linux in particular is enough), C
compiler (with C99 support) and libressl/openssl. What variant of ssl library
are you using is autodetected.

If you need to use non-standard paths for ssl libraries, you can select the
location using --with-openssl=DIR command line option. If you don't provide it,
pkg-config is tried. If that does not succeed, some standard locations are
tried.

Openssl 3.0 by default does not install libraries into lib directory (it uses
arch-specific one, for example lib64). You will need to either use pkg-config
or install them into lib (symlink or --libdir).

Optional dependencies are libtls and bsd's queue.h header.

You can request usage of libtls (and therefore get as close as reasonable to
the original source code in OpenBSD's version) by using --enable-libtls option.
Same lookup process is used as for ssl libraries (except the option is called
--with-libtls). --with-libtls implies --enable-libtls, so providing just the
first one is enough.

If there is a header bsd/sys/queue.h available, it is preferred, however
vendored version is provided as well.

Examples:
---------

Use libressl, without libtls:

	$ SSLDIR=/tmp/libressl/install-full
	$ ./configure \
		--with-openssl="$SSLDIR" \
		LDFLAGS="-Wl,-rpath $SSLDIR/lib"

Use libressl, with libtls:

	$ SSLDIR=/tmp/libressl/install-full
	$ ./configure \
		--with-libtls="$SSLDIR" \
		--with-openssl="$SSLDIR" \
		LDFLAGS="-Wl,-rpath $SSLDIR/lib"

Use openssl, with libts:

	$ SSLDIR=/tmp/openssl-1.1.1/install
	$ TLSDIR=/tmp/libressl/install-libtls-only
	$ ./configure \
		--with-libtls="$TLSDIR" \
		--with-openssl="$SSLDIR" \
		LDFLAGS="-Wl,-rpath $SSLDIR/lib -Wl,-rpath $TLSDIR/lib"
