2002-10-07 04:53:31 +04:00
|
|
|
# $NetBSD: Makefile,v 1.27 2002/10/07 00:53:31 lukem Exp $
|
2000-06-16 08:21:31 +04:00
|
|
|
|
|
|
|
# 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
|
|
|
|
#
|
|
|
|
|
2002-10-07 04:53:31 +04:00
|
|
|
USE_SHLIBDIR= yes
|
|
|
|
|
2000-06-23 10:01:10 +04:00
|
|
|
.include <bsd.own.mk>
|
Only use the MKDYNAMICROOT semantics (i.e. -rpath=/lib,/usr/lib and
-dynamic-linker=/libexec/ld.elf_so) if the BINDIR of the program being
built is /bin or /sbin.
The reason we do this is because now all programs *except* those in
/bin and /sbin (i.e. the "special cases") match the default the compiler
uses, which is what is used for things in e.g. xsrc, pkgsrc, and other
random 3rd party programs.
This is done by decoupling where a shlib is installed from how it
is located. Two new variables, SHLIBINSTALLDIR and SHLINKINSTALLDIR,
contain the former information, and key off MKDYNAMICROOT only. SHLIBDIR
and SHLINKDIR contain the latter, and key off MKDYNAMICROOT and BINDIR.
The SHLIBINSTALLDIR, SHLIBDIR, _LIBSODIR, SHLINKINSTALLDIR, and
SHLINKDIR parameters are moved to a new <bsd.shlib.mk>; see bsd.README
for usage details.
2002-09-28 01:37:50 +04:00
|
|
|
.include <bsd.shlib.mk>
|
2000-06-23 10:01:10 +04:00
|
|
|
|
2000-06-16 10:16:37 +04:00
|
|
|
# XXX There's a bit of work to do before we can enable warnings.
|
|
|
|
WARNS=0
|
|
|
|
|
2000-06-16 08:21:31 +04:00
|
|
|
LIB= crypto
|
2002-08-31 14:46:36 +04:00
|
|
|
CPPFLAGS+= -Dlib${LIB} -I. -I${OPENSSLSRC}/crypto -I${OPENSSLSRC}
|
2000-06-16 08:21:31 +04:00
|
|
|
|
2002-08-19 13:41:27 +04:00
|
|
|
CRYPTODIST= ${NETBSDSRCDIR}/crypto/dist
|
2000-06-16 10:16:37 +04:00
|
|
|
|
2002-08-19 13:41:27 +04:00
|
|
|
.include "${NETBSDSRCDIR}/crypto/Makefile.openssl"
|
2000-06-16 08:21:31 +04:00
|
|
|
.PATH: ${OPENSSLSRC}
|
|
|
|
|
|
|
|
.include "srcs.inc"
|
|
|
|
|
2000-06-23 10:01:10 +04:00
|
|
|
# NetBSD local addition to des library.
|
|
|
|
SRCS+= rnd_keys.c
|
|
|
|
|
2000-06-16 08:21:31 +04:00
|
|
|
# XXX
|
|
|
|
.if ${OBJECT_FMT} == "ELF"
|
|
|
|
AFLAGS+=-DELF
|
|
|
|
.else
|
|
|
|
AFLAGS+=-DOUT
|
|
|
|
.endif
|
|
|
|
|
2002-06-16 21:57:29 +04:00
|
|
|
OS_VERSION!= sh ${NETBSDSRCDIR}/sys/conf/osrelease.sh
|
|
|
|
|
|
|
|
# XXX CFLAGS: While it would be nice to know which compiler flags
|
|
|
|
# XXX the library was built with, we don't want pathname information
|
|
|
|
# XXX for the host toolchain embedded in the image.
|
2000-06-16 08:21:31 +04:00
|
|
|
${SRCS}: buildinf.h
|
2002-06-16 21:57:29 +04:00
|
|
|
buildinf.h: Makefile
|
2000-06-16 08:21:31 +04:00
|
|
|
@echo "#ifndef MK1MF_BUILD" >buildinf.h
|
2002-06-16 21:57:29 +04:00
|
|
|
@echo "#define CFLAGS \"`${CC} -v 2>&1 | grep version`\"" >>buildinf.h
|
2000-06-16 08:21:31 +04:00
|
|
|
@echo "#define PLATFORM \"NetBSD-${MACHINE_ARCH}\"" >>buildinf.h
|
2002-06-16 21:57:29 +04:00
|
|
|
@echo "#define DATE \"NetBSD ${OS_VERSION}\"" >>buildinf.h
|
2000-06-16 08:21:31 +04:00
|
|
|
@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
|
2002-08-31 14:46:36 +04:00
|
|
|
INCS+= conf.h conf_api.h crypto.h des.h dh.h dsa.h dso.h e_os2.h
|
2001-05-02 17:06:14 +04:00
|
|
|
INCS+= ebcdic.h err.h evp.h hmac.h lhash.h md2.h md4.h
|
2001-04-12 11:48:03 +04:00
|
|
|
INCS+= md5.h mdc2.h obj_mac.h objects.h opensslconf.h opensslv.h pem.h
|
2001-05-02 17:06:14 +04:00
|
|
|
INCS+= pem2.h pkcs12.h pkcs7.h rand.h rc2.h rc4.h ripemd.h
|
2001-04-12 11:48:03 +04:00
|
|
|
INCS+= rsaref.h safestack.h sha.h stack.h
|
|
|
|
INCS+= symhacks.h tmdiff.h txt_db.h x509.h x509_vfy.h x509v3.h
|
2000-06-16 08:21:31 +04:00
|
|
|
|
2000-06-23 10:01:10 +04:00
|
|
|
INCS+= rsa.h rsaref.h
|
2000-06-16 08:21:31 +04:00
|
|
|
.PATH: ${OPENSSLSRC}/rsaref
|
|
|
|
|
2000-09-30 04:23:28 +04:00
|
|
|
# IDEA - patented, but we install the header anyways
|
2000-06-23 10:01:10 +04:00
|
|
|
INCS+= idea.h
|
|
|
|
|
2000-09-30 04:23:28 +04:00
|
|
|
# RC5 - patented, but we install the header anyways
|
2000-06-23 10:01:10 +04:00
|
|
|
INCS+= rc5.h
|
|
|
|
|
2000-06-16 10:16:37 +04:00
|
|
|
INCSDIR=/usr/include/openssl
|
|
|
|
|
2000-06-16 08:21:31 +04:00
|
|
|
# this rebuilds the `srcs.inc' and the .inc files it reads.
|
2000-06-23 10:01:10 +04:00
|
|
|
# note that the resulting `srcs.inc' file needs to be modified
|
|
|
|
# to deal with our MKCRYPTO_* configuration variables.
|
2000-06-16 08:21:31 +04:00
|
|
|
|
2000-06-16 10:16:37 +04:00
|
|
|
update_inc:
|
|
|
|
(cd ${.CURDIR}; find ${OPENSSLSRC}/crypto \
|
2000-06-16 08:21:31 +04:00
|
|
|
-name Makefile.ssl | \
|
2000-06-16 10:16:37 +04:00
|
|
|
perl ${OPENSSLSRC}/extsrcs.pl 2> srcs.inc )
|
2000-06-16 08:21:31 +04:00
|
|
|
|
2002-02-26 03:57:12 +03:00
|
|
|
SYMLINKS+= libcrypto.a ${LIBDIR}/libdes.a
|
2000-06-20 10:00:24 +04:00
|
|
|
|
|
|
|
.if ${MKPROFILE} != "no"
|
2002-02-26 03:57:12 +03:00
|
|
|
SYMLINKS+= libcrypto_p.a ${LIBDIR}/libdes_p.a
|
2000-06-20 10:00:24 +04:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if ${MKPIC} != "no"
|
|
|
|
|
2002-08-19 17:35:05 +04:00
|
|
|
DES_SHLIB_MAJOR != cd ${NETBSDSRCDIR}/lib/libdes && ${MAKE} -B print-shlib-major
|
|
|
|
DES_SHLIB_MINOR != cd ${NETBSDSRCDIR}/lib/libdes && ${MAKE} -B print-shlib-minor
|
2002-05-02 20:24:24 +04:00
|
|
|
|
2000-06-20 10:00:24 +04:00
|
|
|
.if ${MKPICINSTALL} != "no"
|
2002-02-26 03:57:12 +03:00
|
|
|
SYMLINKS+= libcrypto_pic.a ${LIBDIR}/libdes_pic.a
|
2000-06-20 10:00:24 +04:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if exists(${.CURDIR}/shlib_version)
|
2002-02-26 03:57:12 +03:00
|
|
|
SYMLINKS+= libcrypto.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
|
|
|
${_LIBSODIR}/libdes.so.${DES_SHLIB_MAJOR}.${DES_SHLIB_MINOR}
|
* 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 04:32:37 +03:00
|
|
|
.if ${_LIBSODIR} != ${LIBDIR}
|
2002-02-26 03:57:12 +03:00
|
|
|
SYMLINKS+= libcrypto.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
|
|
|
|
${LIBDIR}/libdes.so.${DES_SHLIB_MAJOR}.${DES_SHLIB_MINOR}
|
* 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 04:32:37 +03:00
|
|
|
.endif
|
2000-06-20 10:00:24 +04:00
|
|
|
|
|
|
|
.if (${OBJECT_FMT} == "ELF")
|
2002-02-26 03:57:12 +03:00
|
|
|
SYMLINKS+= libcrypto.so.${SHLIB_MAJOR} \
|
|
|
|
${_LIBSODIR}/libdes.so.${DES_SHLIB_MAJOR}
|
|
|
|
SYMLINKS+= libcrypto.so ${_LIBSODIR}/libdes.so
|
* 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 04:32:37 +03:00
|
|
|
.if ${_LIBSODIR} != ${LIBDIR}
|
2002-02-26 03:57:12 +03:00
|
|
|
SYMLINKS+= libcrypto.so.${SHLIB_MAJOR} \
|
* 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 04:32:37 +03:00
|
|
|
${LIBDIR}/libdes.so.${DES_SHLIB_MAJOR}
|
2002-02-26 03:57:12 +03:00
|
|
|
SYMLINKS+= libcrypto.so ${LIBDIR}/libdes.so
|
2000-06-20 10:00:24 +04:00
|
|
|
.endif
|
|
|
|
.endif
|
* 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 04:32:37 +03:00
|
|
|
.endif # exists shlib_version
|
2000-06-20 10:00:24 +04:00
|
|
|
|
|
|
|
.endif # ${MKPIC} != "no"
|
|
|
|
|
2000-06-16 08:21:31 +04:00
|
|
|
.include <bsd.lib.mk>
|