Subject: README: changes to the build system
To: None <current-users@netbsd.org>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: current-users
Date: 07/13/1999 11:27:09
Hi folks...

You may have noticed my mega-commit yesterday which completely reworks
the build system for integrated cryptography support.  These changes
are designed to make it easier to support multiple different crypto
code bases: one for the USA (crypto-us) and one for the free world
(crypto-intl).

Attached below is the relevant section from /usr/share/mk/bsd.README:

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

The include file <bsd.crypto.mk> contains variables related to building
cryptography support into the system.

It has no targets.

In order to get system-specific crypto configuration parameters,
bsd.crypto.mk will include <bsd.own.mk>, which in turn will include
the configuration file specified by the "MAKECONF" variable.  See
the <bsd.own.mk> section for more information.

bsd.crypto.mk requires the "SRCTOP" variable to be defined before
inclusion.  This variable contains the relative path to the top of
the source tree, with no trailing '/'.

The variable "CRYPTOBASE" may be set by the user to select which
cryptography code base will be used when building the system.  If
CRYPTOBASE is set to "none", no cryptography support will be built
into the system.  CRYPTOBASE should be set to the name of the crypto
sub-tree in the SRCTOP directory.  If CRYPTOBASE is not set,
bsd.crypto.mk will use the following algorithm to set the variable:

	.if exists(${SRCTOP}/crypto-us)
		CRYPTOBASE=crypto-us
	.elif exists(${SRCTOP}/crypto-intl)
		CRYPTOBASE=crypto-intl
	.else
		undef CRYPTOBASE
	.endif

Note that it is legal for the user to set CRYPTOBASE to a relative
path outside of the source directory.  For example:

	CRYPTOPATH= ../cryptosrc-intl/crypto-intl

If CRYPTOBASE is set and not set to "none", bsd.crypto.mk will use
CRYPTOBASE to set the "CRYPTOPATH" variable.  CRYPTOPATH is set to
the value "${SRCTOP}/${CRYPTOBASE}".

Once CRYPTOPATH is set by bsd.crypto.mk, it checks to see if the
path actually exists.  If it does not exist, the variable is undefined.
Program and library Makefiles may key off the definition of CRYPTOPATH
to determine if cryptography support is to be included in that program.
For example, a typical program Makefile should do the following:

	SRCTOP= ../..
	.include <bsd.crypto.mk>

	PROG= login
	SRCS= login.c
	.
	.
	.
	.if defined(CRYPTOPATH)
	.include "${CRYPTOPATH}/usr.bin/login/Makefile.frag"
	.endif

The Makefile.frag included will now influence the build of the login(1)
program, specifying additional source files, libraries, and CPP flags.

The "EXPORTABLE_SYSTEM" variable, if set, causes CRYPTOBASE to be set
to "none".  This is for compatibilty with older NetBSD build environments.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

WHAT THIS MEANS TO YOU:

The build process is now significantly less complex, and all of the wacky
kludges for building "src/domesic" are now gone.  Programs are built only
once, and programs that only exist in a crypto dir are build by make(1)
cd'ing into that "disconnected subdirectory".

Until the FTP/SUP server admins fix (long overdue, HINT HINT!) the
SUP'able trees to provide "src/crypto-us" instead of "src/domestic",
you will need to add the following to your /etc/mk.conf file, if you
are a USA resident and are using the USA crypto code (i.e. Kerberos IV):

CRYPTOBASE= domestic

...until you do your SUP again tomorrow; I'm going to add "domestic" to
bsd.crypto.mk's try list right now.

If you have any questions, please send mail here about it.  If you encounter
any problems, please send a bug report w/ send-pr(1), and I'll look into
it.

        -- Jason R. Thorpe <thorpej@nas.nasa.gov>