NetBSD/lib/libcrypto/Makefile
lukem efcc9a4c9d * Add user-controlled mk.conf variables
- SHLIBDIR	Location to install shared libraries if ${USE_SHLIBDIR}
			is "yes".  Defaults to "/usr/lib".

	- USE_SHLIBDIR	If "yes", install shared libraries in ${SHLIBDIR}
			instead of ${LIBDIR}.  Defaults to "no".
			Sets ${_LIBSODIR} to the appropriate value.
			This may be set by individual Makefiles as well.

	- SHLINKDIR	Location of shared linker.  Defaults to "/usr/libexec".
			If != "/usr/libexec", change the dynamic-linker
			encoded in shared programs

* Set USE_SHLIBDIR for libraries used by /bin and /sbin:
	libc libcrypt libcrypto libedit libipsec libkvm libm libmi387
	libtermcap libutil libz

* If ${_LIBSODIR} != ${LIBDIR}, add symlinks from ${LIBDIR}/${LIB}.so*
  to ${_LIBSODIR}/${LIB}.so* for compatibility.

* Always install /sbin/init statically (for now)


The net effect of these changes depends on how the variables are set:

  1.)	If nothing is set or changed, there is no change from the
	current behaviour:
		- Static /bin, /sbin, and bits of /usr/*
		- Dynamic rest
		- Shared linker is /usr/libexec/ld*so

  2.)	If the following make variables are set:
		LDSTATIC=
		SHLINKDIR=/lib
		SHLIBDIR=/lib
	Then the behaviour becomes:
		- Dynamic tools
		- .so libraries used by /bin and /sbin are installed to /lib,
		  with symlinks from /usr/lib/lib*so to -> /lib/lib*so
		  where appropriate
		- Shared linker is /lib/ld*so

  3.)	As per 2.), but add the following variable:
		USE_SHLIBDIR=yes
	This forces all .so's to be instaleld in /lib (with compat
	symlinks), not just those tagged by their Makefiles to be.
	Again, compat symlinks are installed
2001-12-28 01:32:37 +00:00

123 lines
3.4 KiB
Makefile

# $NetBSD: Makefile,v 1.13 2001/12/28 01:32:38 lukem Exp $
# RCSid:
# Id: Makefile,v 1.33 1998/11/11 11:53:53 sjg Exp
#
# @(#) Copyright (c) 1994 Simon J. Gerraty
#
# This file is provided in the hope that it will
# be of use. There is absolutely NO WARRANTY.
# Permission to copy, redistribute or otherwise
# use this file is hereby granted provided that
# the above copyright notice and this notice are
# left intact.
#
# Please send copies of changes and bug-fixes to:
# sjg@quick.com.au
#
.include <bsd.own.mk>
# XXX There's a bit of work to do before we can enable warnings.
WARNS=0
LIB= crypto
CPPFLAGS+= -Dlib${LIB} -I. -I${OPENSSLSRC}/crypto
CRYPTODIST= ${.CURDIR}/../../crypto/dist
.include "../../crypto/Makefile.openssl"
.PATH: ${OPENSSLSRC}
.include "srcs.inc"
# NetBSD local addition to des library.
SRCS+= rnd_keys.c
# XXX
.if ${OBJECT_FMT} == "ELF"
AFLAGS+=-DELF
.else
AFLAGS+=-DOUT
.endif
# XXX
${SRCS}: buildinf.h
buildinf.h:
@echo "#ifndef MK1MF_BUILD" >buildinf.h
@echo "#define CFLAGS \"${CC} ${CFLAGS}\"" >>buildinf.h
@echo "#define PLATFORM \"NetBSD-${MACHINE_ARCH}\"" >>buildinf.h
@echo "#define DATE \"`date`\"" >>buildinf.h
@echo "#endif" >>buildinf.h
CLEANFILES+= buildinf.h
# This list is built from the contents of the include/openssl
# directory in the OpenSSL source distribution.
INCS+= asn1.h asn1_mac.h bio.h blowfish.h bn.h buffer.h cast.h comp.h
INCS+= conf.h conf_api.h crypto.h des.h dh.h dsa.h dso.h e_os.h e_os2.h
INCS+= ebcdic.h err.h evp.h hmac.h lhash.h md2.h md4.h
INCS+= md5.h mdc2.h obj_mac.h objects.h opensslconf.h opensslv.h pem.h
INCS+= pem2.h pkcs12.h pkcs7.h rand.h rc2.h rc4.h ripemd.h
INCS+= rsaref.h safestack.h sha.h stack.h
INCS+= symhacks.h tmdiff.h txt_db.h x509.h x509_vfy.h x509v3.h
INCS+= rsa.h rsaref.h
.PATH: ${OPENSSLSRC}/rsaref
# IDEA - patented, but we install the header anyways
INCS+= idea.h
# RC5 - patented, but we install the header anyways
INCS+= rc5.h
INCSDIR=/usr/include/openssl
# this rebuilds the `srcs.inc' and the .inc files it reads.
# note that the resulting `srcs.inc' file needs to be modified
# to deal with our MKCRYPTO_* configuration variables.
update_inc:
(cd ${.CURDIR}; find ${OPENSSLSRC}/crypto \
-name Makefile.ssl | \
perl ${OPENSSLSRC}/extsrcs.pl 2> srcs.inc )
DES_SHLIB_MAJOR != cd ${.CURDIR}/../libdes && ${MAKE} -B print-shlib-major
DES_SHLIB_MINOR != cd ${.CURDIR}/../libdes && ${MAKE} -B print-shlib-minor
LINKS+= ${LIBDIR}/libcrypto.a ${LIBDIR}/libdes.a
.if ${MKPROFILE} != "no"
LINKS+= ${LIBDIR}/libcrypto_p.a ${LIBDIR}/libdes_p.a
.endif
.if ${MKPIC} != "no"
.if ${MKPICINSTALL} != "no"
LINKS+= ${LIBDIR}/libcrypto_pic.a ${LIBDIR}/libdes_pic.a
.endif
.if exists(${.CURDIR}/shlib_version)
LINKS+= ${_LIBSODIR}/libcrypto.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
${_LIBSODIR}/libdes.so.${DES_SHLIB_MAJOR}.${DES_SHLIB_MINOR}
.if ${_LIBSODIR} != ${LIBDIR}
SYMLINKS+=${_LIBSODIR}/libcrypto.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
${LIBDIR}/libdes.so.${DES_SHLIB_MAJOR}.${DES_SHLIB_MINOR}
.endif
.if (${OBJECT_FMT} == "ELF")
LINKS+= ${_LIBSODIR}/libcrypto.so.${SHLIB_MAJOR} \
${_LIBSODIR}/libdes.so.${DES_SHLIB_MAJOR}
LINKS+= ${_LIBSODIR}/libcrypto.so ${_LIBSODIR}/libdes.so
.if ${_LIBSODIR} != ${LIBDIR}
SYMLINKS+= ${_LIBSODIR}/libcrypto.so.${SHLIB_MAJOR} \
${LIBDIR}/libdes.so.${DES_SHLIB_MAJOR}
SYMLINKS+= ${_LIBSODIR}/libcrypto.so ${LIBDIR}/libdes.so
.endif
.endif
.endif # exists shlib_version
.endif # ${MKPIC} != "no"
.include <bsd.lib.mk>