2012-01-04 19:55:35 +04:00
|
|
|
# $NetBSD: Makefile,v 1.18 2012/01/04 15:55:36 drochner Exp $
|
Add new Makefile knob, USE_FORT, which extends USE_SSP by turning on the
FORTIFY_SOURCE feature of libssp, thus checking the size of arguments to
various string and memory copy and set functions (as well as a few system
calls and other miscellany) where known at function entry. RedHat has
evidently built all "core system packages" with this option for some time.
This option should be used at the top of Makefiles (or Makefile.inc where
this is used for subdirectories) but after any setting of LIB.
This is only useful for userland code, and cannot be used in libc or in
any code which includes the libc internals, because it overrides certain
libc functions with macros. Some effort has been made to make USE_FORT=yes
work correctly for a full-system build by having the bsd.sys.mk logic
disable the feature where it should not be used (libc, libssp iteself,
the kernel) but no attempt has been made to build the entire system with
USE_FORT and doing so will doubtless expose numerous bugs and misfeatures.
Adjust the system build so that all programs and libraries that are setuid,
directly handle network data (including serial comm data), perform
authentication, or appear likely to have (or have a history of having)
data-driven bugs (e.g. file(1)) are built with USE_FORT=yes by default,
with the exception of libc, which cannot use USE_FORT and thus uses
only USE_SSP by default. Tested on i386 with no ill results; USE_FORT=no
per-directory or in a system build will disable if desired.
2007-05-28 16:06:17 +04:00
|
|
|
|
|
|
|
USE_FORT?= yes # network protocol library
|
1999-07-02 00:15:26 +04:00
|
|
|
|
* 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
|
|
|
USE_SHLIBDIR= yes
|
2005-02-19 19:55:02 +03:00
|
|
|
WARNS= 0 # Will be fixed later
|
2002-08-19 18:55:14 +04:00
|
|
|
|
2005-01-10 05:58:58 +03:00
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
2005-02-19 19:55:02 +03:00
|
|
|
DIST= ${NETBSDSRCDIR}/crypto/dist/ipsec-tools
|
2002-08-19 18:55:14 +04:00
|
|
|
LIB= ipsec
|
2005-02-19 19:58:26 +03:00
|
|
|
CPPFLAGS+= -I${DIST}/src/libipsec -I. -DHAVE_CONFIG_H
|
2012-01-04 19:55:35 +04:00
|
|
|
CPPFLAGS+= -DIPSEC_DEBUG -I${.CURDIR}
|
2005-06-28 20:01:59 +04:00
|
|
|
# Don't worry about argument promotion for now.
|
|
|
|
LINTFLAGS+= -X 58
|
2005-01-10 05:58:58 +03:00
|
|
|
|
|
|
|
.if (${USE_INET6} != "no")
|
|
|
|
CPPFLAGS+=-DINET6
|
|
|
|
.endif
|
1999-07-02 00:15:26 +04:00
|
|
|
|
2005-02-19 19:55:02 +03:00
|
|
|
.PATH: ${DIST}/src/libipsec
|
2000-03-14 00:23:55 +03:00
|
|
|
|
2005-02-19 19:55:02 +03:00
|
|
|
SRCS= ipsec_dump_policy.c ipsec_get_policylen.c ipsec_strerror.c \
|
2005-12-16 19:25:07 +03:00
|
|
|
pfkey.c pfkey_dump.c policy_parse.y policy_token.l key_debug.c
|
|
|
|
|
|
|
|
LPREFIX+=__libipsec
|
|
|
|
YPREFIX+=__libipsec
|
|
|
|
YHEADER=policy_parse.h
|
1999-07-02 00:15:26 +04:00
|
|
|
|
|
|
|
MAN= ipsec_set_policy.3 ipsec_strerror.3
|
|
|
|
MLINKS+=ipsec_set_policy.3 ipsec_get_policylen.3 \
|
|
|
|
ipsec_set_policy.3 ipsec_dump_policy.3
|
|
|
|
|
|
|
|
.include <bsd.lib.mk>
|