head	1.5;
access;
symbols
	netbsd-11-0-RC4:1.5
	netbsd-11-0-RC3:1.5
	netbsd-11-0-RC2:1.5
	netbsd-11-0-RC1:1.5
	perseant-exfatfs-base-20250801:1.5
	netbsd-11:1.5.0.4
	netbsd-11-base:1.5
	netbsd-10-1-RELEASE:1.4.20.1
	perseant-exfatfs-base-20240630:1.5
	perseant-exfatfs:1.5.0.2
	perseant-exfatfs-base:1.5
	netbsd-8-3-RELEASE:1.4
	netbsd-9-4-RELEASE:1.4
	netbsd-10-0-RELEASE:1.4.20.1
	netbsd-10-0-RC6:1.4.20.1
	netbsd-10-0-RC5:1.4.20.1
	netbsd-10-0-RC4:1.4.20.1
	netbsd-10-0-RC3:1.4.20.1
	netbsd-10-0-RC2:1.4.20.1
	netbsd-10-0-RC1:1.4.20.1
	netbsd-10:1.4.0.20
	netbsd-10-base:1.4
	netbsd-9-3-RELEASE:1.4
	cjep_sun2x-base1:1.4
	cjep_sun2x:1.4.0.18
	cjep_sun2x-base:1.4
	cjep_staticlib_x-base1:1.4
	netbsd-9-2-RELEASE:1.4
	cjep_staticlib_x:1.4.0.16
	cjep_staticlib_x-base:1.4
	netbsd-9-1-RELEASE:1.4
	phil-wifi-20200421:1.4
	phil-wifi-20200411:1.4
	is-mlppp:1.4.0.14
	is-mlppp-base:1.4
	phil-wifi-20200406:1.4
	netbsd-8-2-RELEASE:1.4
	netbsd-9-0-RELEASE:1.4
	netbsd-9-0-RC2:1.4
	netbsd-9-0-RC1:1.4
	phil-wifi-20191119:1.4
	netbsd-9:1.4.0.12
	netbsd-9-base:1.4
	phil-wifi-20190609:1.4
	netbsd-8-1-RELEASE:1.4
	netbsd-8-1-RC1:1.4
	pgoyette-compat-merge-20190127:1.4
	pgoyette-compat-20190127:1.4
	pgoyette-compat-20190118:1.4
	pgoyette-compat-1226:1.4
	pgoyette-compat-1126:1.4
	pgoyette-compat-1020:1.4
	pgoyette-compat-0930:1.4
	pgoyette-compat-0906:1.4
	netbsd-7-2-RELEASE:1.3
	pgoyette-compat-0728:1.4
	netbsd-8-0-RELEASE:1.4
	phil-wifi:1.4.0.10
	phil-wifi-base:1.4
	pgoyette-compat-0625:1.4
	netbsd-8-0-RC2:1.4
	pgoyette-compat-0521:1.4
	pgoyette-compat-0502:1.4
	pgoyette-compat-0422:1.4
	netbsd-8-0-RC1:1.4
	pgoyette-compat-0415:1.4
	pgoyette-compat-0407:1.4
	pgoyette-compat-0330:1.4
	pgoyette-compat-0322:1.4
	pgoyette-compat-0315:1.4
	netbsd-7-1-2-RELEASE:1.3
	pgoyette-compat:1.4.0.8
	pgoyette-compat-base:1.4
	netbsd-7-1-1-RELEASE:1.3
	matt-nb8-mediatek:1.4.0.6
	matt-nb8-mediatek-base:1.4
	perseant-stdc-iso10646:1.4.0.4
	perseant-stdc-iso10646-base:1.4
	netbsd-8:1.4.0.2
	netbsd-8-base:1.4
	prg-localcount2-base3:1.3
	prg-localcount2-base2:1.3
	prg-localcount2-base1:1.3
	prg-localcount2:1.3.0.16
	prg-localcount2-base:1.3
	pgoyette-localcount-20170426:1.3
	bouyer-socketcan-base1:1.3
	pgoyette-localcount-20170320:1.3
	netbsd-7-1:1.3.0.14
	netbsd-7-1-RELEASE:1.3
	netbsd-7-1-RC2:1.3
	netbsd-7-nhusb-base-20170116:1.3
	bouyer-socketcan:1.3.0.12
	bouyer-socketcan-base:1.3
	pgoyette-localcount-20170107:1.3
	netbsd-7-1-RC1:1.3
	pgoyette-localcount-20161104:1.3
	netbsd-7-0-2-RELEASE:1.3
	localcount-20160914:1.3
	netbsd-7-nhusb:1.3.0.10
	netbsd-7-nhusb-base:1.3
	pgoyette-localcount-20160806:1.3
	pgoyette-localcount-20160726:1.3
	pgoyette-localcount:1.3.0.8
	pgoyette-localcount-base:1.3
	netbsd-7-0-1-RELEASE:1.3
	netbsd-7-0:1.3.0.6
	netbsd-7-0-RELEASE:1.3
	netbsd-7-0-RC3:1.3
	netbsd-7-0-RC2:1.3
	netbsd-7-0-RC1:1.3
	netbsd-6-0-6-RELEASE:1.1
	netbsd-6-1-5-RELEASE:1.1
	netbsd-7:1.3.0.4
	netbsd-7-base:1.3
	yamt-pagecache-base9:1.3
	yamt-pagecache-tag8:1.1
	netbsd-6-1-4-RELEASE:1.1
	netbsd-6-0-5-RELEASE:1.1
	tls-earlyentropy:1.3.0.2
	tls-earlyentropy-base:1.3
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.3
	riastradh-drm2-base3:1.3
	netbsd-6-1-3-RELEASE:1.1
	netbsd-6-0-4-RELEASE:1.1
	netbsd-6-1-2-RELEASE:1.1
	netbsd-6-0-3-RELEASE:1.1
	netbsd-6-1-1-RELEASE:1.1
	riastradh-drm2-base2:1.2
	riastradh-drm2-base1:1.2
	riastradh-drm2:1.2.0.4
	riastradh-drm2-base:1.2
	netbsd-6-1:1.1.0.20
	netbsd-6-0-2-RELEASE:1.1
	netbsd-6-1-RELEASE:1.1
	khorben-n900:1.2.0.2
	netbsd-6-1-RC4:1.1
	netbsd-6-1-RC3:1.1
	agc-symver:1.1.0.18
	agc-symver-base:1.1
	netbsd-6-1-RC2:1.1
	netbsd-6-1-RC1:1.1
	yamt-pagecache-base8:1.1
	netbsd-6-0-1-RELEASE:1.1
	yamt-pagecache-base7:1.1
	matt-nb6-plus-nbase:1.1
	yamt-pagecache-base6:1.1
	netbsd-6-0:1.1.0.14
	netbsd-6-0-RELEASE:1.1
	netbsd-6-0-RC2:1.1
	tls-maxphys:1.1.0.12
	tls-maxphys-base:1.3
	matt-nb6-plus:1.1.0.10
	matt-nb6-plus-base:1.1
	netbsd-6-0-RC1:1.1
	yamt-pagecache-base5:1.1
	yamt-pagecache-base4:1.1
	netbsd-6:1.1.0.8
	netbsd-6-base:1.1
	yamt-pagecache-base3:1.1
	yamt-pagecache-base2:1.1
	yamt-pagecache:1.1.0.6
	yamt-pagecache-base:1.1
	cherry-xenmp:1.1.0.4
	cherry-xenmp-base:1.1
	bouyer-quota2-nbase:1.1
	bouyer-quota2:1.1.0.2
	bouyer-quota2-base:1.1
	matt-mips64-premerge-20101231:1.1
	matt-premerge-20091211:1.1;
locks; strict;
comment	@# @;


1.5
date	2023.09.06.23.44.43;	author riastradh;	state Exp;
branches;
next	1.4;
commitid	C2VmfkwDcsKXFLDE;

1.4
date	2017.05.21.15.28.39;	author riastradh;	state Exp;
branches
	1.4.20.1;
next	1.3;
commitid	qFvwLLy2KgFGNgSz;

1.3
date	2013.09.11.23.04.10;	author joerg;	state Exp;
branches;
next	1.2;
commitid	LfFxmAH008vTF45x;

1.2
date	2013.04.11.16.59.16;	author christos;	state Exp;
branches;
next	1.1;

1.1
date	2009.11.02.10.03.56;	author plunky;	state Exp;
branches
	1.1.6.1
	1.1.12.1;
next	;

1.4.20.1
date	2023.09.08.09.03.53;	author martin;	state Exp;
branches;
next	;
commitid	7jW3BeSPhuXNJWDE;

1.1.6.1
date	2014.05.22.15.48.11;	author yamt;	state Exp;
branches;
next	;
commitid	SywiCPEofZQm8yBx;

1.1.12.1
date	2013.06.23.06.28.18;	author tls;	state Exp;
branches;
next	1.1.12.2;
commitid	OnlO1cBgtQRcIHUw;

1.1.12.2
date	2014.08.19.23.47.16;	author tls;	state Exp;
branches;
next	;
commitid	jTnpym9Qu0o4R1Nx;


desc
@@


1.5
log
@lib: Handle various external lib directories with build_install.

This way, update builds track shlib major bumps correctly.

For example, suppose you had built Heimdal's libkrb5.so.27 and
libgssapi.so.11 linked against it, and then you updated past the recent
shlib major bump raising them to libkrb5.so.28 and libgssapi.so.12.

Without this change, the build will make the following sequence of
targets (interleaved with some others):

1. make dependall in libkrb5
2. make dependall in libgssapi
3. make install in libkrb5
4. make install in libgssapi

The existing .WAIT tags in SUBDIR ensure that (1) happens before (2)
and (3) happens before (4).  Unfortunately, this sequence is wrong,
because it will produce the following effect:

1. make dependall in libkrb5 builds libkrb5.so.28
2. make dependall in libgssapi builds libgssapi.so.12, linked against
   libkrb5.so.27
3. make install in libkrb5 installs libkrb5.so.28
4. make install in libgssapi installs libgssapi.so.12

Why the out-of-date libkrb5.so.27 in step (2)?  Because we just pass
-L${DESTDIR}/usr/lib -lkrb5 to the linker (or the equivalent with
--sysroot and implied -L/usr/lib), and ${DESTDIR}/usr/lib still has
only libkrb5.so.27 by the time of step (2), not libkrb5.so.28.

Now any applications that link against libkrb5.so _and_ libgssapi.so
will get libkrb5.so.28 and libgssapi.so.12 -- but transitively, via
libgssapi.so.12, they will also get libkrb5.so.27, which is a recipe
for disaster.

Splicing the Heimdal library subdirectories into lib/Makefile, as
this does, ensures that we run make dependall _and_ make install in
libkrb5 _before_ make dependall in libgssapi, giving the following
correct sequence:

1. make dependall in libkrb5 builds libkrb5.so.28
2. make install in libkrb5 installs libkrb5.so.28
3. make dependall in libgssapi builds libgssapi.so.12, linked against
   libkrb5.so.28
4. make install in libgssapi installs libgssapi.so.12

Note that LIBDPLIBS isn't enough here, as implemented.  LIBDPLIBS
ensures that the incremental build will remake libgssapi.so.  But it
doesn't ensure that the new libkrb5.so.28 is available before then,
so it doesn't prevent this problem.

We use the same mechanism for crypto/external/bsd/openssl/lib
already; this just extends it to other external library collections.

As an alternative, in principle perhaps we could teach LIBDPLIBS to
ensure that libkrb5.so comes out of the libkrb5 objdir, and not out
of ${DESTDIR}/usr/lib.  But that requires some work to make happen,
and make it reliable, whereas this approach we've already confirmed
works without other adverse consequences (besides leaving
grody-looking mechanism lying around) for the libcrypto major bump
already.  We need to get this pulled up to the branch so all the
other major bumps it required are handled correctly by update builds.

XXX pullup-10
@
text
@#	$NetBSD: Makefile,v 1.4 2017/05/21 15:28:39 riastradh Exp $

.include "Makefile.subdir"

.include <bsd.subdir.mk>
@


1.4
log
@Remove MKCRYPTO option.

Originally, MKCRYPTO was introduced because the United States
classified cryptography as a munition and restricted its export.  The
export controls were substantially relaxed fifteen years ago, and are
essentially irrelevant for software with published source code.

In the intervening time, nobody bothered to remove the option after
its motivation -- the US export restriction -- was eliminated.  I'm
not aware of any other operating system that has a similar option; I
expect it is mainly out of apathy for churn that we still have it.
Today, cryptography is an essential part of modern computing -- you
can't use the internet responsibly without cryptography.

The position of the TNF board of directors is that TNF makes no
representation that MKCRYPTO=no satisfies any country's cryptography
regulations.

My personal position is that the availability of cryptography is a
basic human right; that any local laws restricting it to a privileged
few are fundamentally immoral; and that it is wrong for developers to
spend effort crippling cryptography to work around such laws.

As proposed on tech-crypto, tech-security, and tech-userlevel to no
objections:

https://mail-index.netbsd.org/tech-crypto/2017/05/06/msg000719.html
https://mail-index.netbsd.org/tech-security/2017/05/06/msg000928.html
https://mail-index.netbsd.org/tech-userlevel/2017/05/06/msg010547.html

P.S.  Reviewing all the uses of MKCRYPTO in src revealed a lot of
*bad* crypto that was conditional on it, e.g. DES in telnet...  That
should probably be removed too, but on the grounds that it is bad,
not on the grounds that it is (nominally) crypto.
@
text
@d1 1
a1 2
#	$NetBSD: Makefile,v 1.3 2013/09/11 23:04:10 joerg Exp $
.include <bsd.own.mk>
d3 1
a3 3
SUBDIR=	 libevent .WAIT
SUBDIR+=	libevent_openssl
SUBDIR+= libevent_pthreads
@


1.4.20.1
log
@Pull up following revision(s) (requested by riastradh in ticket #356):

	external/bsd/libevent/lib/Makefile: revision 1.5
	external/bsd/libevent/lib/Makefile.subdir: revision 1.1
	crypto/external/bsd/heimdal/lib/Makefile: revision 1.3
	lib/Makefile: revision 1.297
	external/bsd/openldap/lib/Makefile.subdir: revision 1.1
	crypto/external/bsd/netpgp/lib/Makefile.subdir: revision 1.1
	crypto/external/bsd/heimdal/lib/Makefile.subdir: revision 1.1
	external/bsd/elftoolchain/lib/Makefile: revision 1.3
	external/bsd/atf/lib/Makefile: revision 1.3
	external/bsd/openldap/lib/Makefile: revision 1.3
	external/bsd/atf/lib/Makefile.subdir: revision 1.1
	crypto/external/bsd/netpgp/lib/Makefile: revision 1.18
	external/bsd/elftoolchain/lib/Makefile.subdir: revision 1.1

lib: Handle various external lib directories with build_install.
This way, update builds track shlib major bumps correctly.

For example, suppose you had built Heimdal's libkrb5.so.27 and
libgssapi.so.11 linked against it, and then you updated past the recent
shlib major bump raising them to libkrb5.so.28 and libgssapi.so.12.

Without this change, the build will make the following sequence of
targets (interleaved with some others):
1. make dependall in libkrb5
2. make dependall in libgssapi
3. make install in libkrb5
4. make install in libgssapi

The existing .WAIT tags in SUBDIR ensure that (1) happens before (2)
and (3) happens before (4).  Unfortunately, this sequence is wrong,
because it will produce the following effect:
1. make dependall in libkrb5 builds libkrb5.so.28
2. make dependall in libgssapi builds libgssapi.so.12, linked against
   libkrb5.so.27
3. make install in libkrb5 installs libkrb5.so.28
4. make install in libgssapi installs libgssapi.so.12

Why the out-of-date libkrb5.so.27 in step (2)?  Because we just pass
-L${DESTDIR}/usr/lib -lkrb5 to the linker (or the equivalent with
--sysroot and implied -L/usr/lib), and ${DESTDIR}/usr/lib still has
only libkrb5.so.27 by the time of step (2), not libkrb5.so.28.

Now any applications that link against libkrb5.so _and_ libgssapi.so
will get libkrb5.so.28 and libgssapi.so.12 -- but transitively, via
libgssapi.so.12, they will also get libkrb5.so.27, which is a recipe
for disaster.

Splicing the Heimdal library subdirectories into lib/Makefile, as
this does, ensures that we run make dependall _and_ make install in
libkrb5 _before_ make dependall in libgssapi, giving the following
correct sequence:
1. make dependall in libkrb5 builds libkrb5.so.28
2. make install in libkrb5 installs libkrb5.so.28
3. make dependall in libgssapi builds libgssapi.so.12, linked against
   libkrb5.so.28
4. make install in libgssapi installs libgssapi.so.12

Note that LIBDPLIBS isn't enough here, as implemented.  LIBDPLIBS
ensures that the incremental build will remake libgssapi.so.  But it
doesn't ensure that the new libkrb5.so.28 is available before then,
so it doesn't prevent this problem.

We use the same mechanism for crypto/external/bsd/openssl/lib
already; this just extends it to other external library collections.

As an alternative, in principle perhaps we could teach LIBDPLIBS to
ensure that libkrb5.so comes out of the libkrb5 objdir, and not out
of ${DESTDIR}/usr/lib.  But that requires some work to make happen,
and make it reliable, whereas this approach we've already confirmed
works without other adverse consequences (besides leaving
grody-looking mechanism lying around) for the libcrypto major bump
already.  We need to get this pulled up to the branch so all the
other major bumps it required are handled correctly by update builds.
@
text
@d1 2
a2 1
#	$NetBSD: Makefile,v 1.4 2017/05/21 15:28:39 riastradh Exp $
d4 3
a6 1
.include "Makefile.subdir"
@


1.3
log
@If a library needs a symbol from another library, pull that library in
explicitly, even if the DT_NEEDED closure would normally already ensure
the presence.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.2 2013/04/11 16:59:16 christos Exp $
a4 1
.if ${MKCRYPTO} != "no"
a5 1
.endif
@


1.2
log
@the rest of the build glue.
@
text
@d1 1
a1 1
#	$NetBSD$
d4 1
a4 1
SUBDIR=	 libevent
@


1.1
log
@add external framework for libevent
@
text
@d1 2
a2 1
#	$NetBSD: Makefile$
d4 5
a8 1
.include <bsd.init.mk>
d10 1
a10 94
LIB=		event
USE_SHLIBDIR=	yes

SRCS=		buffer.c evbuffer.c evdns.c event.c event_tagging.c \
		evrpc.c evutil.c http.c kqueue.c log.c poll.c select.c \
		signal.c

CPPFLAGS+=	-fno-strict-aliasing

CPPFLAGS.evdns.c+=		-Wno-shadow -Wno-cast-qual
CPPFLAGS.event_tagging.c+=	-Wno-cast-qual
CPPFLAGS.evrpc.c+=		-Wno-cast-qual
CPPFLAGS.http.c+=		-Wno-cast-qual -Wno-sign-compare
CPPFLAGS.kqueue.c+=		-Wno-sign-compare
CPPFLAGS.select.c+=		-Wno-sign-compare

LINTFLAGS+=	-X 27	# http.c "redeclaration of %s"

MAN=		evdns.3 event.3

MLINKS+=	event.3 event_init.3
MLINKS+=	event.3 event_dispatch.3
MLINKS+=	event.3 event_loop.3
MLINKS+=	event.3 event_loopexit.3
MLINKS+=	event.3 event_loopbreak.3
MLINKS+=	event.3 event_base_dispatch.3
MLINKS+=	event.3 event_base_free.3
MLINKS+=	event.3 event_base_loop.3
MLINKS+=	event.3 event_base_loopexit.3
MLINKS+=	event.3 event_base_loopbreak.3
MLINKS+=	event.3 event_base_set.3
MLINKS+=	event.3 event_set.3
MLINKS+=	event.3 event_add.3
MLINKS+=	event.3 event_del.3
MLINKS+=	event.3 event_once.3
MLINKS+=	event.3 event_base_once.3
MLINKS+=	event.3 event_pending.3
MLINKS+=	event.3 event_initialized.3

MLINKS+=	event.3 evtimer_set.3
MLINKS+=	event.3 evtimer_add.3
MLINKS+=	event.3 evtimer_del.3
MLINKS+=	event.3 evtimer_pending.3
MLINKS+=	event.3 evtimer_initialized.3

MLINKS+=	event.3 signal_set.3
MLINKS+=	event.3 signal_add.3
MLINKS+=	event.3 signal_del.3
MLINKS+=	event.3 signal_pending.3
MLINKS+=	event.3 signal_initialized.3

MLINKS+=	event.3 bufferevent_new.3
MLINKS+=	event.3 bufferevent_free.3
MLINKS+=	event.3 bufferevent_write.3
MLINKS+=	event.3 bufferevent_write_buffer.3
MLINKS+=	event.3 bufferevent_read.3
MLINKS+=	event.3 bufferevent_enable.3
MLINKS+=	event.3 bufferevent_disable.3
MLINKS+=	event.3 bufferevent_settimeout.3
MLINKS+=	event.3 bufferevent_base_set.3

MLINKS+=	event.3 evbuffer_new.3
MLINKS+=	event.3 evbuffer_free.3
MLINKS+=	event.3 evbuffer_add.3
MLINKS+=	event.3 evbuffer_add_buffer.3
MLINKS+=	event.3 evbuffer_add_printf.3
MLINKS+=	event.3 evbuffer_add_vprintf.3
MLINKS+=	event.3 evbuffer_drain.3
MLINKS+=	event.3 evbuffer_write.3
MLINKS+=	event.3 evbuffer_read.3
MLINKS+=	event.3 evbuffer_find.3
MLINKS+=	event.3 evbuffer_readline.3

MLINKS+=	event.3 evhttp_new.3
MLINKS+=	event.3 evhttp_bind_socket.3
MLINKS+=	event.3 evhttp_free.3

MLINKS+=	evdns.3 evdns_init.3
MLINKS+=	evdns.3 evdns_shutdown.3
MLINKS+=	evdns.3 evdns_err_to_string.3
MLINKS+=	evdns.3 evdns_nameserver_add.3
MLINKS+=	evdns.3 evdns_count_nameservers.3
MLINKS+=	evdns.3 evdns_clear_nameservers_and_suspend.3
MLINKS+=	evdns.3 evdns_resume.3
MLINKS+=	evdns.3 evdns_nameserver_ip_add.3
MLINKS+=	evdns.3 evdns_resolve_ipv4.3
MLINKS+=	evdns.3 evdns_resolve_reverse.3
MLINKS+=	evdns.3 evdns_resolv_conf_parse.3
MLINKS+=	evdns.3 evdns_search_clear.3
MLINKS+=	evdns.3 evdns_search_add.3
MLINKS+=	evdns.3 evdns_search_ndots_set.3
MLINKS+=	evdns.3 evdns_set_log_fn.3

.include <bsd.lib.mk>
@


1.1.6.1
log
@sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")
@
text
@d1 1
a1 2
#	$NetBSD$
.include <bsd.own.mk>
d3 1
a3 5
SUBDIR=	 libevent .WAIT
.if ${MKCRYPTO} != "no"
SUBDIR+=	libevent_openssl
.endif
SUBDIR+= libevent_pthreads
d5 94
a98 1
.include <bsd.subdir.mk>
@


1.1.12.1
log
@resync from head
@
text
@d1 1
a1 2
#	$NetBSD$
.include <bsd.own.mk>
d3 1
a3 5
SUBDIR=	 libevent
.if ${MKCRYPTO} != "no"
SUBDIR+=	libevent_openssl
.endif
SUBDIR+= libevent_pthreads
d5 94
a98 1
.include <bsd.subdir.mk>
@


1.1.12.2
log
@Rebase to HEAD as of a few days ago.
@
text
@d4 1
a4 1
SUBDIR=	 libevent .WAIT
@


