History log of /netbsd-current/share/mk/bsd.prog.mk
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.349 06-May-2024 mrg

use objcopy's --compress-debug-sections when creating debug files.

this reduces the size of the installed files by over half in most cases,
though the debug set size doesn't really change much (which looks like
close to 1GB of space on amd64 with xdebug installed, similar on arm64,
and about 600MB without xdebug.)

tested by running GDB on a few things, seems just as functional, on amd64,
arm64, and slightly on riscv64.

(first attempt for this feature used "gcc -gz=zlib", but that ends up
making CTF unhappy, but fortunately this works in binutils to create
the .debug files separate to any ctf usage of the main file.)


# 1.348 19-Feb-2024 christos

Add a hook that adds more libraries after PROGDPLIBS


# 1.347 11-Oct-2023 riastradh

heimdal: No need for -lm, was only added for -lsqlite3.

PR lib/57406

XXX pullup-10


# 1.346 11-Oct-2023 riastradh

bsd.prog.mk: krb5 stuff no longer needs to link against sqlite3.

(Why is this here? Seems like it should be a .mk fragment under
crypto/external/bsd/heimdal -- that way I would have found it for the
previous commit.)

PR lib/57406

XXX pullup-10


# 1.345 28-May-2023 lukem

share/mk: finish USE_COMBINE, NOCOMBINE deprecation

Remove the leftover remnants of deprecated USE_COMBINE and NOCOMBINE,
as gcc -combine has been EOL for many years.

Completes the work done by maya@ on 2019-05-10 in bsd.kmodule.mk rev 1.61.


# 1.344 24-May-2023 lukem

deprecate SHAREDSTRINGS build option

Hasn't worked for at least 20 years (and never in the cross-build environment,
nor did it work with parallel make), and has never been needed in NetBSD as we
don't have the older BSD programs (pascal, pre-nvi ex) that needed mkstr/xstr
on PDP-11.

PR toolchain/35964


# 1.343 08-May-2023 christos

remove stuff accidentally committed


# 1.342 07-May-2023 christos

Provide a hook to link in libraries statically in PROGDPLIBS.
OpenSSL protects the symbols in the shared object via a linker
script, but programs and tests need those protected symbols, so
they either must link against the archive, or I need to expose the
symbols. For now, I chose to expose the symbols. Note that we
cannot use -Bstatic -Lpath -llibrary -Bdynamic because this seems
to be broken with collect2 and so we use the path directly.


Revision tags: netbsd-10-base
# 1.341 14-Jul-2022 mrg

branches: 1.341.2;
add libxcvt.


# 1.340 28-Nov-2021 christos

When we build against DESTDIR, add the lint library path for DESTDIR during
the link phase for lint.


# 1.339 23-Aug-2021 mrg

define variables for the libxcb-* libraries.


# 1.338 15-Aug-2021 christos

Fix sun2 build for ldap/gssapi


# 1.337 14-Aug-2021 christos

Centralize the ldap libraries


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.336 12-Nov-2020 nia

Revert addition of pthread dependency on sqlite.

It is less trivial than expected and introduced some surprising breakage.


# 1.335 09-Nov-2020 christos

- make the CTFCONVERT command lines consistent and concise by putting all
the implementation stuff in a variable CTFCONVERT_RUN
- introduce an OBJECT_TARGET variable that contains the output object file
- when we need to run ctfconvert, go through an intermediate ${.TARGET}.o
file, instead of writing directly to ${.TARGET} and then overwriting
${.TARGET} with ctfconvert. This avoids build failures after a build
got interrupted (the "partially built from C" scourge).


# 1.334 09-Nov-2020 martin

Adapt for sqlite requiring pthreads now


# 1.333 30-Oct-2020 martin

libsqlite3 now requires -lm


# 1.332 16-Oct-2020 nia

share/mk: Define some missing X11 libraries.


# 1.331 15-Jun-2020 christos

Rename blacklist -> blocklist


# 1.330 30-May-2020 christos

Make libuv private, requested by joerg@


# 1.329 24-May-2020 christos

Add libuv


Revision tags: phil-wifi-20200421 phil-wifi-20200411 phil-wifi-20200406
# 1.328 04-Apr-2020 christos

Linker semantics have changed; we now don't automatically link dependent
libraries from other DSO's. For example in /usr/bin/passwd:
ld: krb5_passwd.o: undefined reference to symbol \
'UI_UTIL_read_pw_string@@OPENSSL_1_1_0'
ld: /usr/obj/amd64-x86_64/release/lib/libcrypto.so.14: error adding symbols: \
DSO missing from command line


# 1.327 04-Apr-2020 christos

Fix kerberos libraries order


# 1.326 04-Apr-2020 christos

Add libgnuctf


# 1.325 03-Mar-2020 christos

Add fido and cbor


Revision tags: is-mlppp-base phil-wifi-20191119
# 1.324 18-Nov-2019 christos

Improve the script to check for installed libraries, and fix the wrong
names and obsolete libraries it found.


# 1.323 27-Aug-2019 kamil

Enhance the support of LLVM sanitizers

Define _REENTRANT for MKSANITIZER build. This is needed for at least stdio
code. This caused new build issued with duplicated symbols in few places
and rump kernel code picking different code paths borrowed from libc.
Handle all this in one go.

Add bsd.sanitizer.mk to share common code used by programs and libraries.

Switch from realall to beforeinstall target in .syms files. This is more
reliable in MKSANITIZER.


# 1.322 17-Aug-2019 kamil

Add PAXCTL_FLAG rules for MKSANITIZER

Add per-program rules to disable ASLR for ASan, TSan and MSan in all
sanitized programs. This flag is not needed for other supported sanitizers.

Without this change, sanitized init(8) dies early on startup.

Approach originally suggested by <joerg>


# 1.321 15-Aug-2019 kamil

Add SANITIZER_RENAME_CLASSES in bsd.prog.mk

This adds a more flexible version of SANITIZER_RENAME_SYMBOL.

New symbol allows to specify MKSANITIZER specific renames on per-file and
per-symbol basis.


# 1.320 10-Aug-2019 christos

Make the X11 library lists consistent again.


Revision tags: netbsd-9-base phil-wifi-20190609 pgoyette-compat-20190127
# 1.319 21-Jan-2019 christos

branches: 1.319.2;
Most of the mv operations are to move temporary files to their final place.
Some use -f, others don't. This can lead to spurious build failures when
the user performing the build changes. Centralize, and always use -f.


Revision tags: pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.318 12-Aug-2018 christos

fix broken library variable definitions (inconsistencies between
bsd.README and bsd.prog.mk)


Revision tags: pgoyette-compat-0728
# 1.317 25-Jul-2018 kamil

Introduce MKLIBCSANITIZER in the share/mk rules

Add flags that are required to build a program and a dynamically loaded
library.

Propagade LIBCSANITIZERFLAGS to CFLAGS and CXXFLAGS.

LDFLAGS is not changed on purpose, as a libcsanitizer is inside libc
and no external dependencies are needed.

Register NOLIBCSANITIZER, as certain distribution parts will need to be
skipped.


# 1.316 12-Jul-2018 maxv

Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.


Revision tags: phil-wifi-base
# 1.315 25-Jun-2018 kamil

branches: 1.315.2;
Add a framework for renaming symbols in libc&co for MKSANITIZER

A new keyword SANITIZER_RENAME_SYMBOL. It's a variable that has specified
a list of symbols to be renamed in a processor in order to remove naming
conflicts with public symbols in libc/m/pthread/rt.

This renaming will occur for libraries and programs.
A symbol with a conflicting 'name', will be renamed to '__mksanitizer_name'.

Based on an idea by <christos>


Revision tags: pgoyette-compat-0625
# 1.314 21-Jun-2018 kamil

Refactor MKSANITIZER flags in mk rules

Introduce a new variable SANITIZERFLAGS that contains all the sanitizer
specific flags. These flags are designed to be passed to CFLAGS, CXXFLAGS
and LDFLAGS.

Pass SANITIZERFLAGS in bsd.prog.mk rules to CFLAGS, CXXFLAGS and LDFLAGS.

Pass SANITIZERFLAGS in bsd.lib.mk rules to *_pic.a build flags. The *_pic.a
libraries are designed to construct .so libraries. All .so libraries with
few exceptions are expected to be prebuilt with a sanitizer. Another
purpuse of *_pic.a files can be constructing static PIE programs, however
they are not supported as of now and there is no sanitization of static
programs either.

Once MKSTATICPIE will be supported, it will be initially incompatible with
MKSANITIZER.

This change also makes it easier to build other targets like kernel and
kernel modules without userland sanitizers.

No functional change intended for MKSANITIZER=no users.


# 1.313 02-Jun-2018 christos

Sanitizers don't support static linking.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315
# 1.312 11-Mar-2018 mrg

define LIBXFONT2.


Revision tags: pgoyette-compat-base
# 1.311 25-Feb-2018 mrg

branches: 1.311.2;
add LIBKRB5_LDADD/LIBKRB5_DPADD and their static counterparts
to bsd.prog.mk. use them instead of hard coding various lists
of libraries for krb5.

this fixes static builds.


# 1.310 11-Dec-2017 christos

Instead of checking for obj existance which can be empty for shuttle-rule
programs, check for .sh sources.


# 1.309 10-Dec-2017 christos

don't try to build .debug files for shell scripts.


# 1.308 10-Oct-2017 christos

Add general {DP,LD}ADD.rump variables


Revision tags: netbsd-8-3-RELEASE netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base
# 1.307 21-May-2017 riastradh

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.


# 1.306 21-May-2017 riastradh

Remove some vestiges of MKCRYPTO_IDEA/MKCRYPTO_MDC2.


# 1.305 21-May-2017 riastradh

Remove MKCRYPTO_RC5. Unconditionally include RC5 in libcrypto.so.

This option existed only because RC5 is covered by patents that, twenty
years ago, we had reason to suspect the patent holder, RSA, Inc., might
litigate. The two US patents in question are 5,724,428 and 5,835,600.

According to the USPTO Patent Term Calculator web site at
<https://www.uspto.gov/patent/laws-and-regulations/patent-term-calculator#heading-5>
(retrieved 2017-05-21), patents filed after 1995-06-07 expire twenty
years after the filing date.

number filing date
5,724,428 1995-11-01
5,835,600 1997-04-21

Thus, these patents appear to be expired.

As proposed on tech-crypto and tech-security:

https://mail-index.netbsd.org/tech-crypto/2017/05/05/msg000718.html
https://mail-index.netbsd.org/tech-security/2017/05/05/msg000927.html


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.304 19-Apr-2017 joerg

Add netpgpverify to the library list.


Revision tags: pgoyette-localcount-20170320
# 1.303 20-Feb-2017 rin

add missing LIBCXX


# 1.302 08-Feb-2017 kamil

libpthread_dbg(3) deletion from the base distribution

libpthread_dbg(3) is a remnant library from the M:N thread model
(pre-NetBSD-5.0) API to introspect threads within a process and for use
of debuggers.

Currently in the 1:1 model it's not used in GDB neither in LLDB and it's
not either planned to be used. It's current function to read pthread_t
structures is realizable within a regular debugger capable to
instrospect objects within a tracee (GDB, LLDB...).

Remaining users of this API can still use this library from
pkgsrc/devel/libpthread_dbg.

Sponsored by <The NetBSD Foundation>


# 1.301 29-Jan-2017 christos

add sqlite3 to statically linked libraries for pam.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914
# 1.300 20-Aug-2016 christos

branches: 1.300.2;
unbound additions


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.299 04-Apr-2016 joerg

branches: 1.299.2;
If the per-target LDSTATIC flag is set, don't include the PIE linker
flags as we currently don't support static PIE.


# 1.298 30-Mar-2016 martin

Pass -pie to cc, not -Wl,-pie. This way we have a chance to fix specs
for obscure corner cases like -pie -fPIE -static (used for
/usr/tests/lib/csu/h_initfini2 if building with MKPIE=yes).
While there also replace -fPIC with -fPIE for the PIE case, even if
it should be mostly equivalent.


# 1.297 12-Mar-2016 mrg

remove conditionals that are always true with GCC >= 4.8.


# 1.296 21-Feb-2016 christos

Add NODEBUG


# 1.295 31-Jan-2016 christos

Introduce NOPIE and NOCTF so that standalone programs build properly.


# 1.294 23-Jan-2016 christos

Define _KERNTYPES for things that need it.


# 1.293 07-Nov-2015 joerg

LIBEXECINFO


# 1.292 07-Jun-2015 matt

Make LIBCRT* depend on the right files if MLIBDIR from MKCOMPAT is defined.


# 1.291 01-Dec-2014 erh

PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilt
if any of their dependencies (i.e. the files they refer to) are changed.
This allows changes to transitive included headers to be handled properly.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.290 25-Mar-2014 ozaki-r

branches: 1.290.4;
Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.


Revision tags: riastradh-drm2-base3
# 1.289 09-Mar-2014 christos

let's see if the new dwarf library can handle dwarf 4


# 1.288 02-Mar-2014 christos

If we are compiling with -g and using gcc4.8 and dtrace downgrade
dwarf generation to version 2 for now.


# 1.287 15-Jan-2014 joerg

-Wl,-pie and -r don't agree with each other, so filter the former out.


# 1.286 11-Nov-2013 joerg

Relink binaries if crti.o changes.


# 1.285 29-Sep-2013 christos

Add libxcb


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.284 31-May-2013 mrg

add LIBX11_XCB; unfortunately since the library is named with a -
in it, we have to use an ugly hard coded assignment for now.
(could be cleaned up with more make variable magic i'm sure.)


# 1.283 04-Apr-2013 christos

ldopts should be before ldadd like everywhere else.


Revision tags: agc-symver-base
# 1.282 14-Feb-2013 christos

Since the libraries are produced with different MK flags than the programs,
we check for existance of the files instead of the MK flags.


# 1.281 14-Feb-2013 christos

Add PROGDPLIBS


# 1.280 26-Jan-2013 christos

CTFCONVERT me harder.


Revision tags: yamt-pagecache-base8
# 1.279 17-Jan-2013 christos

Now that we have separate debug sets, add -g if ${MKDEBUG} is set for
program builds since we don't need to install that symbol files.


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.278 24-Aug-2012 jmmv

branches: 1.278.2;
Allow DPADD to be specified on a per-program basis.


# 1.277 23-Aug-2012 joerg

Revert last, it breaks the tricks xsrc uses.


# 1.276 23-Aug-2012 joerg

Remove SHLIBINSTALLDIR and SHLINKINSTALLLIBDIR. Add rpath entries, if
SHLIBDIR differs from /usr/lib.


# 1.275 08-Aug-2012 christos

add MKRUMP by popular demand.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.274 29-Feb-2012 tron

Move "libexpat" from X11 into base which fixes PR lib/40346.
This change was approved by the Core Group.


# 1.273 21-Feb-2012 matt

Remove another ${SIZE}


# 1.272 20-Feb-2012 matt

Remove ${SIZE}


# 1.271 19-Feb-2012 matt

Add support for --combine with gcc.


Revision tags: netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2
# 1.270 05-Nov-2011 christos

branches: 1.270.2;
Add libtre


Revision tags: yamt-pagecache-base
# 1.269 16-Oct-2011 christos

branches: 1.269.2;
- no need to special-case libraries with weird characters.
- add a note about adding new libraries.


# 1.268 16-Oct-2011 christos

fix list of libraries to reflect reality.


# 1.267 10-Sep-2011 apb

Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.


# 1.266 27-Aug-2011 joerg

Add new "analyze" command to run clang's static analyzer in a directory
on all C/C++ files.


Revision tags: cherry-xenmp-base
# 1.265 26-Apr-2011 he

The new Heimdal adds -lwind and -lheimbase to the set of libraries,
so define the corresponding LIB* variables.
These are also needed in the PAM_STATIC_* variables, so add them there too.


# 1.264 11-Apr-2011 joerg

Adjust --sysroot related usage:
-Wl,-rpath does not expand =, so just drop it.

Drop -Wl,-rpath-link entries that duplicate the -Wl,-rpath entries, this
is done implicitly now that ld is built with sysroot support.

Use ${DESTDIR} explicitly for the remaining -Wl,-rpath-link entries.


# 1.263 10-Apr-2011 joerg

For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.


# 1.262 08-Mar-2011 jmmv

Revert previous (revision 1.261): it broke the build because PROG_CXX is
defined in terms of PROG, so later on we would end up with target duplicates
because both PROG_CXX and PROG were being converted to PROGS_CXX and PROGS.

Did not catch this earlier because the test build I did was not clean and
thus the duplicate targets did not have nasty effects.


# 1.261 07-Mar-2011 jmmv

Always convert PROG to its plural form independently of whether PROG_CXX
is defined or not. From Garrett Cooper in private mail.


Revision tags: bouyer-quota2-nbase
# 1.260 20-Feb-2011 jmmv

Define LIBATF_C and LIBATF_CXX to point to their corresponding .a files and
use these to properly set DPADD for test programs.


Revision tags: bouyer-quota2-base
# 1.259 13-Feb-2011 christos

add saslc


# 1.258 06-Feb-2011 joerg

Don't use -nostdinc or -nostdinc++ if this is included in a HOSTLIB.


# 1.257 17-Jan-2011 pooka

branches: 1.257.2;
Add rump bits to DPSRCS so that update builds work correctly.


Revision tags: matt-mips64-premerge-20101231
# 1.256 13-Dec-2010 pooka

befriend RUMPPRG with CRUNCHEDPRG


# 1.255 13-Dec-2010 pooka

Define RUMPPRG, which is just like PROG, except it additionally
builds a rump client with the name rump.${PROG}. The rump client
is not installed suid/sgid by default even if BINMODE is defined.


# 1.254 10-Dec-2010 joerg

Revert last, gcc(1) checks explicitly for -r on some platforms to disable
passing down --relax as well.


# 1.253 08-Dec-2010 joerg

gcc passes down -r directly to ld, so make it explicitly a linker option.


# 1.252 08-Dec-2010 joerg

Don't depend on ${CC} passing down -R to ld, use -Wl,-rpath explicitly.


# 1.251 08-Nov-2010 lukem

Preserve date on original shared library or program when stripping
the debug symbols and adding the debug-link to .debug.
Use '(rm -f file; false)' in the failure path to force failure.
Based on solution proposed by Nicolas Joly on tech-toolchain in July 2010.
Should fix PR toolchain/44046 from Andreas Gustafsson.


# 1.250 31-Oct-2010 mbalmer

Link Lua to the build and add the resulting files to the distribution sets.
Document the addition of Lua and the change we made to the default settings.


# 1.249 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.248 24-Apr-2010 lukem

When extracting separate debug symbols with MKDEBUG, there's no need
to leave the original file unstripped...


# 1.247 02-Mar-2010 darran

DTrace: Add CTF generation to the make framework. Only enabled when
MKDTRACE=yes.


# 1.246 14-Dec-2009 mrg

use "${CC} -r" not "${CC} -Wl,-r" as the latter fools GCC on some targets
and it ends up passing "-r -relax" to ld, which causes ld to barf.


# 1.245 14-Dec-2009 matt

Merge from matt-nb5-mips64


Revision tags: matt-premerge-20091211
# 1.244 08-Dec-2009 uebayasi

When PROGS / LIBS are used, you can pass each PROG / LIB specific parameters
to ${LD} via:

${LDADD.${PROG}}
${LDFLAGS.${PROG}}
${LDSTATIC.${PROG}}
${LDADD.${LIB}}
${LDFLAGS.${LIB}}

OTOH you can't pass parameters to ${CC}, because in suffix rules make(1) only
knows the name of ${.IMPSRC} and ${.TARGET}; it's users' responsivility to
define ${CC} parameters to all the sources of a given ${PROG} / ${LIB}.

Should address bin/42381.

(Bug in this commit log was pointed out by mrg@.)


# 1.243 27-Nov-2009 tsutsui

If CPPFLAGS or CXXFLAGS already contains -nostdinc or -nostdinc++,
don't add ${CPPFLAGS_ISYSTEM} or ${CPPFLAGS_ISYSTEMXX} to refer
${DESTDIR}/usr/include or ${DESTDIR}/usr/include/g++.

This change might cause errors on some MD stand dir, but in that case
each Makefile should be fixed to search proper system include paths
by -Ipath option in own CPPFLAGS.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.242 12-May-2009 plunky

remove libsdp as improved functionality has been enabled in libbluetooth.


# 1.241 10-Apr-2009 apb

Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links. They have no effect except when using a
metalog, in which case the information is added to the metalog. In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg. This should fix PR 24457 and PR 41155.


# 1.240 24-Nov-2008 cube

branches: 1.240.2;
Move cleanextra to the very ends in case another included file wants to add
to it even if it was initially empty.


Revision tags: netbsd-5-base matt-mips64-base2
# 1.239 19-Oct-2008 christos

branches: 1.239.2;
handle assembly files for MKPIE


# 1.238 16-Oct-2008 christos

Provide a way for a program to override the PIE flags.


# 1.237 15-Oct-2008 christos

don't compile/link libraries with pie


Revision tags: mjf-devfs2-base
# 1.236 02-Oct-2008 joerg

Hook up libfetch and pkg_install update.


Revision tags: wrstuden-revivesa-base-3
# 1.235 09-Sep-2008 joerg

Add MKSTRIPIDENT to remove the RCS IDs from binary programs and shared
libraries for space-constraint systems. The description is based on the
feedback of hubertf@, the logic on input from lukem@

This obsoletes the removal of LIBC_SCCS and SYSLIBC_SCCS for libc builds.


Revision tags: wrstuden-revivesa-base-2
# 1.234 28-Aug-2008 mrg

update a comment example


# 1.233 27-Aug-2008 rtr

use ${X11USRLIBDIR} instead of hard-coded /usr/X11R6/lib when building
${LIB.foo} vars


# 1.232 27-Aug-2008 lukem

Fix problem I introduced in rev 1.231 on 2008/08/25 where ${_PROGLDOPTS}
and -L${_GCC_LIBGCCDIR} were appearing in the link line before ${LDADD},
so -L${DESTDIR}/lib and -L${DESTDIR}/usr/lib were being used before
local -L library paths.
Fixes ntpd/ntpdate failure noticed by Valeriy E. Ushakov <uwe@NetBSD.org>


# 1.231 25-Aug-2008 lukem

Always link with: -Wl,-rpath-link,${DESTDIR}/usr/lib -L${DESTDIR}/usr/lib
Fixes problem with MKDYNAMICROOT=no triggered by libraries that depend
on other libraries.
Related to PR 33503.

Clean up setting of _CCLINK to always add the appropriate -B options.

Simplify the link rule for a program.


# 1.230 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.229 28-May-2008 lukem

add LIBLDAR_R (for completeness)


# 1.228 22-May-2008 lukem

Add MKLDAP, USE_LDAP, LIBLBER, LIBLDAP


Revision tags: hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-pf42-base
# 1.227 10-Apr-2008 tsutsui

branches: 1.227.2; 1.227.4;
Add libhx509 to PAM_STATIC_LDADD which is required by libkrb5.


# 1.226 22-Mar-2008 mlelstv

branches: 1.226.2;
Import Heimdal-1.1


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase matt-armv6-base hpcarm-cleanup-base
# 1.225 26-Dec-2007 jmmv

Make the clean target work when OBJS is set but PROG is not, as happens
for example in gnu/lib/crtstuff4. Reported by drochner@.


Revision tags: cube-autoconf-base
# 1.224 13-Nov-2007 jmmv

Fix typo that prevented MKDEBUG builds to work. Found by drochner@.


# 1.223 12-Nov-2007 jmmv

Add the ability to build multiple programs from a single directory

This adds support for a new set of variables, PROGS and PROGS_CXX, that
allow the developer to build multiple different programs from a single
source directory.


# 1.222 04-Nov-2007 tls

Remove MKPRIVATELIB from BIND libraries; move library reachover
directories and Makefiles from src/usr.sbin/bind to src/lib; make
BIND libraries build shared. Saves about 1MB-1.5MB per installed
executable, about 5MB for a base+etc minimal installation of NetBSD.


Revision tags: matt-mips64-base
# 1.221 29-Jul-2007 joerg

branches: 1.221.4; 1.221.6;
Add build glue for libarchive and update the various sets.


# 1.220 25-Jan-2007 perry

Before I completely forget the issue, convert "PROG_PAX" to the
better-named "PAXCTL_FLAGS".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.219 11-Nov-2006 christos

don't run paxctl if other commands were specified for that target.


# 1.218 10-Nov-2006 christos

if ${PROG_PAX} is defined, run paxctl on the binary after linking with
the value of the variable. This way, if you set:

PROG_PAX=+M

in /etc/mk.conf, you get what you deserve.


# 1.217 22-Oct-2006 pooka

libpuffs


# 1.216 09-Oct-2006 mrg

- clean up some comments to reality.
- retire LIBDCK, LIBG2C and (long broken) USE_LIBSTDCXX
- in bsd.hostprog.mk's LIBSTDCPP -> LIBSTDCC
- add LIBSUPCXX
- don't default USE_LIBSTDCXX or USE_GCC4 since they are
not used in the tree any where
- same with USE_XF86_4; retire it
- remove _SUPCXX handling in bsd.prog.mk

inspired by PR#26714.


Revision tags: abandoned-netbsd-4-base
# 1.215 23-Jul-2006 lukem

Implement MKDEBUG:
If "no", don't build and install separate debugging symbols
into /usr/libdata/debug.
Default: no


# 1.214 19-Jun-2006 gdamore

Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.


# 1.213 09-Jun-2006 christos

PR/33681: Scott Ellis: Building 'bc' with SHAREDSTRINGS=yes fails
We need CPPFLAGS too now.


# 1.212 11-May-2006 mrg

add support for ${OBJCOPTS} and ${OBJCOPTS}.<lib|prog|fn>.


# 1.211 20-Mar-2006 christos

There is always one more KRB4 thing to remove. (from Jukka Salmi)


# 1.210 20-Mar-2006 christos

Remove krb4 variables and libraries (Jukka Salmi)


# 1.209 16-Mar-2006 jwise

Now that we have real build system support for syspkgs, remove someone's
half-implemented idea of building `syspkgs' (really a few giant blobs of the
same granularity of the old sets) using install(1).


# 1.208 20-Jan-2006 christos

Add the world of libraries to the static pam build. Now static pam binaries
work.


# 1.207 09-Apr-2005 dsl

Report when we link a program into xxx.ro (before being crunched)


Revision tags: netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.206 04-Mar-2005 he

branches: 1.206.2; 1.206.4;
Introduce PAM_STATIC_LDADD and PAM_STATIC_DPADD. When compiling
with MKPIC=no, possibly because the target does not support shared
libraries, these include libraries required to resolve all symbols
which end up referenced from PAM-using applications. The libraries
presently required are -lcrypt, -lrpcsvc and -lutil.

Add use of these variables which are currently set up to use PAM,
so that they compile when MKPIC=no.

Also, in the telnetd case, reorder the order of the libraries, so
that libtelnet.a comes before -ltermcap and -lutil, again to fix
link error when MKPIC=no.

Discussed with thorpej and christos.


# 1.205 20-Feb-2005 christos

Add libradius


# 1.204 12-Jan-2005 lukem

If RESCUEDIR is defined, automatically add that to CPPFLAGS


# 1.203 08-Jan-2005 lukem

Implement <bsd.prog.mk> vars:
LIBASN1 LIBBSDMALLOC LIBG2C LIBPAM LIBSSH


# 1.202 04-Aug-2004 lukem

Revert most of previous, and move the LIB<libname>?= assignments
back to bsd.prog.mk from bsd.own.mk.

pkgsrc uses <bsd.own.mk>, and setting LIB<libname> in it causes
problems with various package builds.
This should fix PR #26542 submitted by Jim Bernard.

(I'll be implementing the DPADD for shared libraries in a different
manner that generally won't depend upon ${LIB<libname>}.)


# 1.201 30-Jul-2004 lukem

Move the LIB<libname>?= assignments from bsd.prog.mk to bsd.own.mk so
that they may be used by non PROGs (e.g., LIBs).

Improve some comments.


# 1.200 10-Jun-2004 lukem

Be consistent in handling YHEADER, similar to Christos' fix in bsd.lib.mk 1.253


# 1.199 21-May-2004 ross

If you add a library, you need to define its DPADD symbol here.

Add LIBMAGIC.


Revision tags: netbsd-2-0-base
# 1.198 15-Feb-2004 skrll

branches: 1.198.2;
Be more gcc like in the way we deal with libgcc so that sh3/hppa millicode
and exception handling have a chance of working properly.

- creates libgcc, libgcc_eh and libgcc_s

- updates LIBGCC_SPEC to use them appropriately.

There's a hack in here at the moment with respect to libgcc_so in that it
is preferable to link against libgcc_so will only when -shared-libgcc is
specified (the c++ frontend does this automatically.) Configurations where
LINK_EH_SPEC is defined already do this. The gcc configuration for
NetBSD/alpha and another NetBSD platform (I forget which) actually define
LINK_EH_SPEC probably by accident rather than design.

- updates share/mk to use the compiler's knowledge of what needs linking into
libraries and executables. This removes an hppa hack.

- updates the sets for the newly created libgcc* files.

- support for linking against the _pg version of libgcc has been removed.


# 1.197 29-Jan-2004 lukem

Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.


# 1.196 27-Jan-2004 lukem

Replace
:M-[IDU]*
with
:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)


# 1.195 23-Jan-2004 simonb

crt0.o lives in /usr/lib even on a.out.


# 1.194 16-Nov-2003 lukem

simplify with _MKTARGET_LINK


# 1.193 11-Nov-2003 dsl

Set MKDEP_SUFFIXES to get additional targets in .depend instead of using
sed in .afterdepend. I don't think .afterdepend is used anywhere any more.


# 1.192 21-Oct-2003 lukem

Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.


# 1.191 19-Oct-2003 lukem

Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} " ... {$.TARGET}" and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO


# 1.190 18-Oct-2003 lukem

Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command ("verbose")
This is the default, and is equivalent to the previous behaviour.


# 1.189 29-Sep-2003 lukem

Add LIBSTDCXX (for usr/lib/libstdc++.a).
Sync LIB* documentation with reality.


# 1.188 19-Sep-2003 martin

Drop explicit medlow model and default to -O2 for sparc64.


# 1.187 14-Sep-2003 lukem

Check ${SHLIBDIR} against "/usr/lib" instead of ${LIBDIR} when determining
if we need to add stuff (usually "/lib") to the rpath-link path before
"/usr/lib". Otherwise, this barfs if LIBDIR != /usr/lib or /lib, and
we're cross-building (e.g., in src/x11)


# 1.186 13-Sep-2003 erh

Also support per-program LDFLAGS and LDSTATIC.


# 1.185 13-Sep-2003 erh

Create a way to add additional flags to COPTS, CPPFLAGS, CXXFLAGS and LDADD
for particular libraries or programs by specifying the additions in mk.conf
instead of needing to go edit individual Makefiles.


# 1.184 12-Sep-2003 lukem

add infrastructure to support reach-over builds of xsrc


# 1.183 22-Aug-2003 dsl

Add a ${PROG}.ro target that does an 'ld -r' of the program object files.
Allows a much simplified build of 'crunched' binaries since crunchgen can
build prog.ro instead of having to deretmine the names of all the .o files.


# 1.182 01-Aug-2003 lukem

Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".


# 1.181 01-Aug-2003 lukem

simplify the ${PROG}: target to reduce duplication between the DESTDIR
and !DESTDIR cases...


# 1.180 31-Jul-2003 lukem

bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.


# 1.179 31-Jul-2003 lukem

Don't need -R/usr/lib; it will be searched at the end by ld.elf_so anyway.
Noted by matt green <mrg@>


# 1.178 28-Jul-2003 lukem

be consistent when adding *.y and *.l to DPSRCS


# 1.177 28-Jul-2003 lukem

replace MKCXXSUPCXX(!=no) with USE_LIBSTDCXX(==no)


# 1.176 28-Jul-2003 lukem

Change defined(CXX_SUPCXX) to MKCXXSUPCXX != "no".

Clarify that command-line overrides of the MKxxx variables should be
done via the environment rather than make(1) command-line variable
assignment, since the latter doesn't actually work as intended.


# 1.175 27-Jul-2003 mrg

introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes. for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)


# 1.174 26-Jul-2003 mrg

add a new bsd.own.mk variable: CXX_SUPCXX. from bsd.README:
+ CXX_SUPCXX If defined, the support libraries needed for this C++ program
+ are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.


# 1.173 20-Jul-2003 lukem

Consistently support the different C++ file extensions: .cc .cpp .cxx .C
Noted by Andrew White in PR toolchain/18246


# 1.172 18-Jul-2003 lukem

Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was defined.
Replace defined(UNPRIVED) tests with ${MKUNPRIVED} != "no"

Add MKUPDATE; if not no has the same semantics as if UPDATE was defined.
Replace defined(UPDATE) tests with ${MKUPDATE} != "no"

Improve documentation for these and other make flags.


# 1.171 16-Jul-2003 itojun

stop installing install libtelnet. build under lib/libtelnet and reference
it from usr.bin/telnet and libexec/telnetd.
(reason for separate build: compiler flags)


# 1.170 27-Jun-2003 drochner

For consistency, use "-R" instead of "-Wl,-rpath" to pass
a runtime search path to the linker.


# 1.169 13-Jun-2003 itojun

define LIBEVENT


# 1.168 11-Jun-2003 msaitoh

catch signal 1,2,3,13 and 15 to clean /tmp/_dependXXX


# 1.167 31-May-2003 thorpej

If EXTERNAL_TOOLCHAIN is defined, allow the compiler to define the
location of crt{begin,end}{,S}.o and libgcc.a. Encapsulate all of
this logic into the new bsd.gcc.mk, and use it in bsd.prog.mk and
bsd.lib.mk.


# 1.166 18-May-2003 lukem

make this a no-op if HOSTPROG is defined


# 1.165 30-Mar-2003 thorpej

If MACHINE_ARCH is powerpc and we HAVE_GCC3, add crtsaveres.o to the
endfile spec.


# 1.164 22-Feb-2003 uwe

Typo in comment.


# 1.163 24-Jan-2003 thorpej

Add LIBPTHREAD, LIBPTHREAD_DB, and LIBRT.


Revision tags: fvdl_fs64_base
# 1.162 22-Nov-2002 thorpej

Split crtbegin/crtend into crti/crtbegin/crtend/crtn. NetBSD-specific
things like the .note.netbsd.ident section are provided by crti/crtn.
crti/crtn also provide the _init() and _fini() routines.

crtbegin/crtend now only provide support for ctors/dtors. This paves
the way to using the "crtstuff" provided with GCC (when we upgrade to
GCC 3.3), which provides, among other things, much better C++/Java
exception handling.


# 1.161 12-Nov-2002 itohy

MKDYNAMICROOT for a.out


# 1.160 22-Oct-2002 perry

Pass 1 of SYSPKG changes to automatically add tags=pkgname_pkg to METALOG.
Not quite ready for prime time yet.


# 1.159 27-Sep-2002 thorpej

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.


# 1.158 26-Sep-2002 itojun

MDC2 is a patented algorithm; don't ship it in default libcrypto.
MKCRYPTO_MDC2 will build a separate library, libcrypto_mdc2.


# 1.157 08-Sep-2002 thorpej

Build a .gdbinit in the objdir when building a program. The .gdbinit
file sets the shared library prefix to ${DESTDIR}, and adds "sources"
directives for each file listed in the GDBINIT Makefile variable.


# 1.156 09-Aug-2002 thorpej

Add LIBPMC.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.155 27-Mar-2002 eeh

branches: 1.155.2;
Use the medium low model for sparc64 programs that don't 2GB of data segment.


# 1.154 11-Feb-2002 mycroft

Don't use .PHONY for targets that are actually installed. Instead use force
dependencies. (Among other things, `make -t install' does something vaguely
sensible now.)


# 1.153 07-Feb-2002 pk

Mark installed system libraries as .MADE only if we're actually establishing
their default variable values here.


# 1.152 04-Feb-2002 christos

s/.NOSUFF/.MADE/


# 1.151 03-Feb-2002 christos

Apply a .NOSUFF: directive to targets we don't want to have processed by
the suffix rules engine.


# 1.150 02-Feb-2002 veego

Ups, it is LIBUSBHID and not LIBUSBHIB.


# 1.149 02-Feb-2002 veego

Change LIBUSB to LIBUSBHIB, reflecting the library name change.


# 1.148 29-Jan-2002 enami

Mark the targets clean{extra,objs} as PHONY.


# 1.147 04-Jan-2002 thorpej

For PROG_CXX DESTDIR builds, pull in -lstdc++ and -lm regardless
of GCC version.


# 1.146 01-Jan-2002 thorpej

Per a suggestion from matthew green, PROG_CXX takes the place of
PROG for C++ programs.


# 1.145 01-Jan-2002 thorpej

* If PROG_CXX is set by the program's Makefile, use ${CXX} to link
the program rather than ${CC}.
* If HAVE_GCC3 is defined, pull in "-lstdc++ -lm" as additional C++
support libraries for DESTDIR builds.


# 1.144 28-Dec-2001 lukem

* 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


# 1.143 28-Nov-2001 tv

If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.


# 1.142 19-Nov-2001 thorpej

Use a little transitional hack to determine if we use -isystem
or -idirafter. Use the former only of USE_NEW_TOOLCHAIN, since
-isystem causes the old toolchain to bomb out when building
libstdc++.


# 1.141 14-Nov-2001 tv

C/..$/.c/ -> C/\..$/.c/


# 1.140 14-Nov-2001 tv

Move the DESTDIR-based nostdinc logic to bsd.lib.mk and bsd.prog.mk where
it belongs (with the native target compile rules).


# 1.139 02-Nov-2001 tv

Use INSTALL_FILE/INSTALL_DIR as appropriate.


# 1.138 02-Nov-2001 tv

Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.


# 1.137 19-Oct-2001 tv

Add .NOPATH for all files generated from .l or .y files in SRCS. Fixes PRs
bin/14187 and lib/14239.

Also simplify the handling of these transforms to .c and .h files a bit by
leveraging make's builtin macro operators.


# 1.136 25-Sep-2001 tv

Set .NOPATH on program to build to make sure it goes in .OBJDIR.
Problem noted by <seebs@plethora.net>.


# 1.135 24-Sep-2001 lukem

fix previous (hi thor!) - $OBJS and $CLEANFILES might be empty, and
rm needs some files to delete...


# 1.134 24-Sep-2001 tls

Split "cleanprog" target apart: now you can zap only object files or
CLEANFILES (needed to fix crunchgen lossage).


# 1.133 13-Sep-2001 thorpej

Add LIBPCI.


# 1.132 14-Aug-2001 tv

Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").


# 1.131 01-Jun-2001 tv

Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).


# 1.130 08-May-2001 sommerfeld

Suppress duplicate entries in ALLFILES, FILES, INCS, DEPINCS, INFOFILES,
NLSALL, CATPAGES, MANPAGES, HTMLPAGES, and SCRIPTS.


# 1.129 19-Feb-2001 jmc

Wrap target() checks around afterdepend rule as some Makefiles override this


# 1.128 26-Jan-2001 itojun

fix typo in LIBSSL decl. it made programs with DPADD+=${LIBSSL} to build
every time we type "make". From: bernd


# 1.127 14-Jan-2001 christos

use the new .if commands(<target>) directive so that we don't have to
change Makefiles.


# 1.126 14-Jan-2001 christos

fix thinko: test for the existance of the target before we define it...


# 1.125 14-Jan-2001 christos

Alter previous redefined target protection. If the ${PROG} target is defined,
add the dependencies as usual, but don't add the commands. This avoids
having to change all the Makefiles that redefine the PROG target.


# 1.124 14-Jan-2001 christos

allow programs to override the program target.


# 1.123 08-Jan-2001 mrg

add missing $LIBCRYPTO_RC5 and $LIBCRYPTO_IDEA


# 1.122 08-Jan-2001 mrg

add missing $LIBSSL


# 1.121 04-Jan-2001 garbled

Add LIBCDK and LIBFORM definitions


# 1.120 31-Oct-2000 itojun

add ${LIBINTL} for use with DPADD.


# 1.119 07-Oct-2000 deberg

fix typos, PR 11159


# 1.118 25-Jun-2000 erh

For the case when DESTDIR is set: move the -L${DESTDIR}/usr/lib after ${LDADD} so any -L directories set in LDADD are searched first to avoid possibly linking against old versions of libraries.


Revision tags: netbsd-1-5-base
# 1.117 19-Jun-2000 thorpej

branches: 1.117.2;
Sync up the LIB* list.


# 1.116 10-Jun-2000 mycroft

Use ${.ALLSRC:T} when doing the generated variable name lookups, so that it
DTRT for generated files in and obj directory (or accessed via .PATH).


# 1.115 06-Jun-2000 mycroft

Abuse .USE some more.


# 1.114 06-Jun-2000 mycroft

Minor rearrangement.


# 1.113 06-Jun-2000 mycroft

Use ODE make(1) features to eliminate extra variables and move several things
outside of .for loops. (Needs more work to completely eliminate .for.)

XXX Don't look at this stuff. It will make your head hurt.


Revision tags: minoura-xpg4dl-base
# 1.112 14-Apr-2000 mrg

branches: 1.112.2;
use -rpath-link rather than -R when linking objects using a DESTDIR.
this replaces the previous change as that ended up adding
$DESTDIR/usr/lib to the runtime path of every binary created, which
is bogus and dangerous.


# 1.111 25-Mar-2000 mycroft

When linking with $DESTDIR, use an explicit -R to get library dependencies
correct.


# 1.110 07-Mar-2000 veego

Remove unused libahdi.
It will be replaced in the future with a more generic libdisklabel.


# 1.109 05-Feb-2000 jdc

Add libahdi entries.


# 1.108 23-Jan-2000 eeh

Add some support for FCode binaries.


# 1.107 22-Jan-2000 mycroft

Make `dependall' play nicely with SUBDIR, using a hack similar to `realinstall'
for both `depend' and `all'.
Also, remove the old hack that invokes an extra shell for .depend, now that
make(1) has been fixed.


# 1.106 16-Jan-2000 assar

all: depend on ${SCRIPTS} so that they get generated if they need to


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.105 23-Nov-1999 blymn

Added libmenu library.


Revision tags: comdex-fall-1999-base
# 1.104 14-Sep-1999 perry

branches: 1.104.4;
Add a "dependall" target, which does a "make depend" and then "make all"
in a single directory. This is useful in "make build" because by doing
the build immediately after the depend, all sources will typically
still be in the buffer cache, thus saving significant time over doing
a "make depend" on all the directories and then a "make all".


# 1.103 04-Sep-1999 fredb

Permit "make all install", as well as "make foo install" (where foo would be
installed by "make install") without setting of BUILD. All cases where BUILD
is already set are unchanged from the old behavior.

"make all install" is now practically equivalent to "make BUILD= all install",
but without actually setting build.

Fixes pr's 8313, 3894.


# 1.102 21-Aug-1999 simonb

Add ${INSTPRIV} to ${INSTALL} commands.


# 1.101 01-Jul-1999 itojun

branches: 1.101.2;
add LIBIPSEC for use from DPADD.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.100 12-Feb-1999 lukem

branches: 1.100.2;
* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.99 10-Feb-1999 tv

libbfd_pic.a is no longer installed; remove ${LIBBFD} define.


# 1.98 04-Feb-1999 christos

PR/2936: Brian C. Grayson: Avoid truncating precious files when installing
and the filesystem is full. Added ${RENAME} flag to install, which when set
to -r installs on a temporary file and then renames to the final destination.
${RENAME} is currently set to nothing in bsd.own.mk, but one can turn it
on in /etc/mk.conf.


# 1.97 07-Nov-1998 jonathan

Do DESTDIR support for crtbegin/crtend on all ELF ports (adds mips).


# 1.96 28-Sep-1998 christos

Use preserve flag in install.


# 1.95 10-Sep-1998 ross

Define a LIBBZ2?=... for use in DPADD=... lines.


# 1.94 09-Aug-1998 lukem

add distclean as a synonym for cleandir


# 1.93 09-Apr-1998 tv

.y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.


# 1.92 01-Apr-1998 tv

Revert. This broke too much in the build tree, and a better solution
needs to be created. (The existing situation breaks a lot too.)


# 1.91 01-Apr-1998 tv

Fix .y rules to DTRT with possibly generated .h files. See mail on
tech-toolchain for a very detailed explanation of this. In short, add
a .y.h rule identical to the .y.c rule and make the .y.c rule rename
the .h file; also, clean the .h file in CLEANFILES.


# 1.90 03-Nov-1997 cgd

echo the lint command line when making 'lint'.


# 1.89 28-Oct-1997 lukem

add ${LIBOBJC}


Revision tags: netbsd-1-3-base
# 1.88 11-Oct-1997 mycroft

branches: 1.88.2;
Several changes:
* Allow bsd.man.mk to be included separately.
* Always include bsd.own.mk and bsd.obj.mk.
* Include bsd.man.mk and bsd.nls.mk even if NOMAN or NONLS; just turn off
building of the affected files instead.
* Require bsd.subdir.mk to be included explicitly.
(Will make appropriate changes to Makefiles shortly.)


# 1.87 29-Sep-1997 gwr

Add $LIBBFD


# 1.86 31-May-1997 cjs

Back out BUILDDIR and NOINSTALL changes.


# 1.85 26-May-1997 cjs

branches: 1.85.2;
These updates to the build allow building against include files
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.


# 1.84 18-May-1997 kleink

Add libposix.


# 1.83 17-May-1997 mycroft

Do LINKS and SYMLINKS after FILES and INCS.


# 1.82 17-May-1997 mycroft

Remove unneeded .SUFFIXES lines, and move .s and .S closer to .o to give the
right preferences.


# 1.81 09-May-1997 mycroft

Fix typo in previous.


# 1.80 09-May-1997 mycroft

Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.79 09-May-1997 mycroft

Remove cruft.


# 1.78 09-May-1997 mycroft

Oops; rearrange dependencies to get things built early enough.


# 1.77 09-May-1997 mycroft

Make sure INCS and SRCS are built if necessary.


# 1.76 08-May-1997 gwr

Set the .NOPATH flag for ${OBJS} (from Christos).


# 1.75 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.74 07-May-1997 mycroft

Various simplifications.


# 1.73 07-May-1997 mycroft

Shuffle some .PHONYs around, to work better with `-t'.


# 1.72 06-May-1997 mycroft

Make most of the install targets .PRECIOUS.


# 1.71 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.70 18-Apr-1997 christos

Add ${LIBNTP}


# 1.69 17-Apr-1997 thorpej

- Properly depend on crtbegin.o and crtend.o for platforms that use
them (currently Alpha and PowerPC)
- STRIP -> STRIPFLAG


# 1.68 03-Apr-1997 mikel

don't allow override of all: target


# 1.67 29-Mar-1997 mikel

merge lite-2 changes (mostly SCCSids)


# 1.66 27-Mar-1997 christos

Put the FILES generated rules in a separate .mk file since both bsd.prog.mk
and bsd.lib.mk use them.


# 1.65 27-Mar-1997 mycroft

Make the SCRIPTS case mimic the FILES case more closely, so we can override
the destination direectory, etc.


# 1.64 27-Mar-1997 mycroft

Remove knowledge of HIDEGAME from here.


# 1.63 24-Mar-1997 christos

make rules update:
- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation


# 1.62 22-Mar-1997 perry

Fix SYMLINKS not to include DESTDIR in the link itself


# 1.61 13-Mar-1997 perry

add SYMLINKS, by analogy to LINKS. Vetted by Christos.


# 1.60 22-Jan-1997 cgd

if 'clean' is not already defined, rather than simply defining it with
a bunch of rules, define a clean{kmod,lib,prog} target with the rules,
and have both clean and cleandir depend on that. That eliminates a bug
where 'cleandir' in a directory which included e.g. bsd.prog.mk but which
also had subdirs would 'make clean' all the subdirs and then 'make cleandir'
all ofthe subdirs. It also allows Makefiles to add more dependencies
to 'clean' after inclusion of the make template.

If 'clean' is already defined, the behaviour is the same as it used to be.


# 1.59 20-Dec-1996 cgd

add an afterdepend target (a la the one in bsd.lib.mk) that processes
the .depend file to add <filename>.ln for each <filename>.o as an
object file which has the given dependencies (in addition to
<filename>.po and <filename>.so, which were already there).


# 1.58 13-Dec-1996 mikel

add missing LIBPCAP definition.


# 1.57 26-Nov-1996 mrg

add libz and libwrap


# 1.56 18-Oct-1996 thorpej

Use ${INSTALL} rather than "install".
From Simon J. Gerraty <sjg@zen.void.oz.au>, PR #1458.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.55 08-Apr-1996 jtc

Sort LIBFOO definitions and add LIBY; Reported by Mike Long <mike.long@analog.com> in PR #2301.


# 1.54 22-Oct-1995 christos

Added include file <bsd.sys.mk> that contains lex and yacc "parallel aware"
rules. These rules are not turned on by default; they are enabled by setting
the PARALLEL variable.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.53 25-Jun-1995 cgd

oops; fix an rm that might be empty


# 1.52 24-Jun-1995 cgd

update lint rules, but keep linting disabled


# 1.51 10-Jun-1995 mycroft

Define LIBEDIT.


# 1.50 21-Apr-1995 jtc

.include <bsd.nls.mk> unless NONLS is defined.


# 1.49 22-Dec-1994 cgd

specify man pages differently, and document how.


# 1.48 24-Aug-1994 mycroft

Include bsd.own.mk earlier.


# 1.47 20-Jul-1994 cgd

fix from christos, for progs w/o objects


Revision tags: netbsd-1-0-base
# 1.46 06-Jul-1994 mycroft

branches: 1.46.2;
Pull libraries from ${DESTDIR} if set. Kill LDONLY, which is unused and
probably not useful anyway.


# 1.45 30-Jun-1994 cgd

fix modify-info-nothingness-then-substitute probelm that broke genclass build


# 1.44 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.43 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.42 28-Jun-1994 jtc

Strip *.sh when constructing OBJS from SRCS.
This will allow us to clean up makefiles that build a script by munging
a template (uusched, genclass, neqn, etc.).


# 1.41 18-Jun-1994 cgd

don't chown the symlink, when HIDEGAME causes a symlink to be made to dm.
4.4-based FS code _follows_ the symlinks on a chown(2) call.


# 1.40 24-May-1994 cgd

fix the last to do the right thing for dependencies


# 1.39 24-May-1994 deraadt

LIBSKEY


# 1.38 22-May-1994 jtc

Single source file programs are now compiled into object files before they
are linked. This change halves the time it takes to rebuild all of the
NetBSD sources when only the C library is "touched"; but only takes about
one percent more disk space.


# 1.37 06-Apr-1994 chopps

relink (recompile) single source programs when crt0.o is updated.


# 1.36 24-Mar-1994 mycroft

Remove *.core on clean.


# 1.35 09-Feb-1994 cgd

kill install -d's.


# 1.34 28-Jan-1994 cgd

add LIBKVM


# 1.33 10-Nov-1993 cgd

librpc doesn't exist anymore


# 1.32 08-Nov-1993 cgd

ad LDSTATIC flag, so static linking can be made one-stop shopping.
use "setenv LDSTATIC" to make *everything* dynamically linked,
setenv LDSTATIC -static for everything statically linked, or unset
it for default behavior.


# 1.31 07-Oct-1993 cgd

LIBTERM pointed at nothing, but was meant to point to libtermcap.a...


# 1.30 07-Oct-1993 cgd

always define LIBCRYPT


# 1.29 17-Aug-1993 mycroft

Make sure we don't recurse into subdirectories if Makefile specified `install'
target. (It's usually blank and is specifically to avoid doing this...)


# 1.28 15-Aug-1993 mycroft

Automatically include bsd.subdir.mk for backward compatibility.


# 1.27 15-Aug-1993 mycroft

Don't automatically include bsd.subdir.mk in bsd.prog.mk and bsd.lib.mk.
Put back .MAIN in bsd.man.mk, and be careful not to include ../Makefile.inc
a second time.


# 1.26 15-Aug-1993 mycroft

Move man rules to sys.mk.
Use bsd.subdir.mk for building subdirectories.
Don't forget to remove x.cc and x.C when using SHAREDSTRINGS.
Make ${PROG} always depend on ${LIBCRT0}.
Don't duplicate code between cleandir and clean.
Move tags target to bsd.dep.mk.
Move STRIP to bsd.own.mk.
Remove redundant definitions of {BIN,MAN}{DIR,GRP,OWN,MODE}.
Move {LIB,DOC}{DIR,GRP,OWN,MODE} defaults to bsd.own.mk.


# 1.25 15-Aug-1993 mycroft

Abstract out dependency stuff, and add RCS identifiers.


# 1.24 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


# 1.23 10-Aug-1993 mycroft

Put LINKS handling in `install' target, so it's the last thing executed, and
happens even if `realinstall' is user-defined.


# 1.22 30-Jul-1993 mycroft

When generating a default OBJS, ignore .h files.


# 1.21 29-Jul-1993 mycroft

Don't print the `making ...' message if an obj dir already exists.
Also, a minor cleanup.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.20 17-Jul-1993 mycroft

Fix C++ dependencies for good. `make depend' is now done in two passes--one
of C files and one for C++ files. No need to specify `-+' in your Makefile,
as it is now done automatically.


# 1.19 17-Jul-1993 cgd

do c++ dependencies the right way...


# 1.18 17-Jul-1993 mycroft

Add suffix rules for C++ files.


# 1.17 04-Jun-1993 brezak

Add LIBRPCSVC variable.


# 1.16 02-Jun-1993 cgd

add ability to specify c++ dependencies, by setting CFLAGS+=-+ for
the dependency make.


# 1.15 26-Apr-1993 cgd

added definition for DPADD library variable LIBCRYPT.


# 1.14 26-Apr-1993 mycroft

Don't redefine `realinstall' target if already defined.


# 1.13 25-Apr-1993 mycroft

Link with LDFLAGS even if one source module.


# 1.12 25-Apr-1993 mycroft

Don't lose if we include bsd.prog.mk only to build man pages.


# 1.11 25-Apr-1993 mycroft

Fix error in last change. (Oops.)


# 1.10 25-Apr-1993 mycroft

Don't build man pages if NOMAN set.


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.9 09-Apr-1993 cgd

various changes to default make rules. from patch 101.
note that only the "sensible" changes in patch 101 are implemented.


# 1.8 08-Apr-1993 cgd

try to do the right thing, in terms making directories before we
install into them, and get the manpage cleans _OUT_ of "clean".
they don't belong there, only in cleandir, WFJ be damned.


# 1.7 08-Apr-1993 cgd

fixed typos...


# 1.6 08-Apr-1993 cgd

(silently) make sure we have directories before installing


# 1.5 04-Apr-1993 cgd

make LIBRPC point to the right place


# 1.4 27-Mar-1993 nate

Fixed the doc macros to call troff, eqn,and tbl instead of ditroff,
deqn, and dtbl.
Fixed make clean to remove the man pages (Bill fixed this in the distribution,
but not in the original source)
Changed install to leave the original file around, by using 'cp' instead of
'mv'. "install -c ..."


# 1.3 23-Mar-1993 cgd

made .CURDIR be absolute, not relative, thereby eliminating
the need for some of the makefile trickery when making objects,
and fixing a few .PATH bugs


# 1.2 22-Mar-1993 cgd

fixed "make obj" for cases when sources not in /usr/src/...
if sources not there, it now mkdirs obj, but some trickery
is necessary, to avoid deleting cwd.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.348 19-Feb-2024 christos

Add a hook that adds more libraries after PROGDPLIBS


# 1.347 11-Oct-2023 riastradh

heimdal: No need for -lm, was only added for -lsqlite3.

PR lib/57406

XXX pullup-10


# 1.346 11-Oct-2023 riastradh

bsd.prog.mk: krb5 stuff no longer needs to link against sqlite3.

(Why is this here? Seems like it should be a .mk fragment under
crypto/external/bsd/heimdal -- that way I would have found it for the
previous commit.)

PR lib/57406

XXX pullup-10


# 1.345 28-May-2023 lukem

share/mk: finish USE_COMBINE, NOCOMBINE deprecation

Remove the leftover remnants of deprecated USE_COMBINE and NOCOMBINE,
as gcc -combine has been EOL for many years.

Completes the work done by maya@ on 2019-05-10 in bsd.kmodule.mk rev 1.61.


# 1.344 24-May-2023 lukem

deprecate SHAREDSTRINGS build option

Hasn't worked for at least 20 years (and never in the cross-build environment,
nor did it work with parallel make), and has never been needed in NetBSD as we
don't have the older BSD programs (pascal, pre-nvi ex) that needed mkstr/xstr
on PDP-11.

PR toolchain/35964


# 1.343 08-May-2023 christos

remove stuff accidentally committed


# 1.342 07-May-2023 christos

Provide a hook to link in libraries statically in PROGDPLIBS.
OpenSSL protects the symbols in the shared object via a linker
script, but programs and tests need those protected symbols, so
they either must link against the archive, or I need to expose the
symbols. For now, I chose to expose the symbols. Note that we
cannot use -Bstatic -Lpath -llibrary -Bdynamic because this seems
to be broken with collect2 and so we use the path directly.


Revision tags: netbsd-10-base
# 1.341 14-Jul-2022 mrg

branches: 1.341.2;
add libxcvt.


# 1.340 28-Nov-2021 christos

When we build against DESTDIR, add the lint library path for DESTDIR during
the link phase for lint.


# 1.339 23-Aug-2021 mrg

define variables for the libxcb-* libraries.


# 1.338 15-Aug-2021 christos

Fix sun2 build for ldap/gssapi


# 1.337 14-Aug-2021 christos

Centralize the ldap libraries


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.336 12-Nov-2020 nia

Revert addition of pthread dependency on sqlite.

It is less trivial than expected and introduced some surprising breakage.


# 1.335 09-Nov-2020 christos

- make the CTFCONVERT command lines consistent and concise by putting all
the implementation stuff in a variable CTFCONVERT_RUN
- introduce an OBJECT_TARGET variable that contains the output object file
- when we need to run ctfconvert, go through an intermediate ${.TARGET}.o
file, instead of writing directly to ${.TARGET} and then overwriting
${.TARGET} with ctfconvert. This avoids build failures after a build
got interrupted (the "partially built from C" scourge).


# 1.334 09-Nov-2020 martin

Adapt for sqlite requiring pthreads now


# 1.333 30-Oct-2020 martin

libsqlite3 now requires -lm


# 1.332 16-Oct-2020 nia

share/mk: Define some missing X11 libraries.


# 1.331 15-Jun-2020 christos

Rename blacklist -> blocklist


# 1.330 30-May-2020 christos

Make libuv private, requested by joerg@


# 1.329 24-May-2020 christos

Add libuv


Revision tags: phil-wifi-20200421 phil-wifi-20200411 phil-wifi-20200406
# 1.328 04-Apr-2020 christos

Linker semantics have changed; we now don't automatically link dependent
libraries from other DSO's. For example in /usr/bin/passwd:
ld: krb5_passwd.o: undefined reference to symbol \
'UI_UTIL_read_pw_string@@OPENSSL_1_1_0'
ld: /usr/obj/amd64-x86_64/release/lib/libcrypto.so.14: error adding symbols: \
DSO missing from command line


# 1.327 04-Apr-2020 christos

Fix kerberos libraries order


# 1.326 04-Apr-2020 christos

Add libgnuctf


# 1.325 03-Mar-2020 christos

Add fido and cbor


Revision tags: is-mlppp-base phil-wifi-20191119
# 1.324 18-Nov-2019 christos

Improve the script to check for installed libraries, and fix the wrong
names and obsolete libraries it found.


# 1.323 27-Aug-2019 kamil

Enhance the support of LLVM sanitizers

Define _REENTRANT for MKSANITIZER build. This is needed for at least stdio
code. This caused new build issued with duplicated symbols in few places
and rump kernel code picking different code paths borrowed from libc.
Handle all this in one go.

Add bsd.sanitizer.mk to share common code used by programs and libraries.

Switch from realall to beforeinstall target in .syms files. This is more
reliable in MKSANITIZER.


# 1.322 17-Aug-2019 kamil

Add PAXCTL_FLAG rules for MKSANITIZER

Add per-program rules to disable ASLR for ASan, TSan and MSan in all
sanitized programs. This flag is not needed for other supported sanitizers.

Without this change, sanitized init(8) dies early on startup.

Approach originally suggested by <joerg>


# 1.321 15-Aug-2019 kamil

Add SANITIZER_RENAME_CLASSES in bsd.prog.mk

This adds a more flexible version of SANITIZER_RENAME_SYMBOL.

New symbol allows to specify MKSANITIZER specific renames on per-file and
per-symbol basis.


# 1.320 10-Aug-2019 christos

Make the X11 library lists consistent again.


Revision tags: netbsd-9-base phil-wifi-20190609 pgoyette-compat-20190127
# 1.319 21-Jan-2019 christos

branches: 1.319.2;
Most of the mv operations are to move temporary files to their final place.
Some use -f, others don't. This can lead to spurious build failures when
the user performing the build changes. Centralize, and always use -f.


Revision tags: pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.318 12-Aug-2018 christos

fix broken library variable definitions (inconsistencies between
bsd.README and bsd.prog.mk)


Revision tags: pgoyette-compat-0728
# 1.317 25-Jul-2018 kamil

Introduce MKLIBCSANITIZER in the share/mk rules

Add flags that are required to build a program and a dynamically loaded
library.

Propagade LIBCSANITIZERFLAGS to CFLAGS and CXXFLAGS.

LDFLAGS is not changed on purpose, as a libcsanitizer is inside libc
and no external dependencies are needed.

Register NOLIBCSANITIZER, as certain distribution parts will need to be
skipped.


# 1.316 12-Jul-2018 maxv

Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.


Revision tags: phil-wifi-base
# 1.315 25-Jun-2018 kamil

branches: 1.315.2;
Add a framework for renaming symbols in libc&co for MKSANITIZER

A new keyword SANITIZER_RENAME_SYMBOL. It's a variable that has specified
a list of symbols to be renamed in a processor in order to remove naming
conflicts with public symbols in libc/m/pthread/rt.

This renaming will occur for libraries and programs.
A symbol with a conflicting 'name', will be renamed to '__mksanitizer_name'.

Based on an idea by <christos>


Revision tags: pgoyette-compat-0625
# 1.314 21-Jun-2018 kamil

Refactor MKSANITIZER flags in mk rules

Introduce a new variable SANITIZERFLAGS that contains all the sanitizer
specific flags. These flags are designed to be passed to CFLAGS, CXXFLAGS
and LDFLAGS.

Pass SANITIZERFLAGS in bsd.prog.mk rules to CFLAGS, CXXFLAGS and LDFLAGS.

Pass SANITIZERFLAGS in bsd.lib.mk rules to *_pic.a build flags. The *_pic.a
libraries are designed to construct .so libraries. All .so libraries with
few exceptions are expected to be prebuilt with a sanitizer. Another
purpuse of *_pic.a files can be constructing static PIE programs, however
they are not supported as of now and there is no sanitization of static
programs either.

Once MKSTATICPIE will be supported, it will be initially incompatible with
MKSANITIZER.

This change also makes it easier to build other targets like kernel and
kernel modules without userland sanitizers.

No functional change intended for MKSANITIZER=no users.


# 1.313 02-Jun-2018 christos

Sanitizers don't support static linking.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315
# 1.312 11-Mar-2018 mrg

define LIBXFONT2.


Revision tags: pgoyette-compat-base
# 1.311 25-Feb-2018 mrg

branches: 1.311.2;
add LIBKRB5_LDADD/LIBKRB5_DPADD and their static counterparts
to bsd.prog.mk. use them instead of hard coding various lists
of libraries for krb5.

this fixes static builds.


# 1.310 11-Dec-2017 christos

Instead of checking for obj existance which can be empty for shuttle-rule
programs, check for .sh sources.


# 1.309 10-Dec-2017 christos

don't try to build .debug files for shell scripts.


# 1.308 10-Oct-2017 christos

Add general {DP,LD}ADD.rump variables


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base
# 1.307 21-May-2017 riastradh

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.


# 1.306 21-May-2017 riastradh

Remove some vestiges of MKCRYPTO_IDEA/MKCRYPTO_MDC2.


# 1.305 21-May-2017 riastradh

Remove MKCRYPTO_RC5. Unconditionally include RC5 in libcrypto.so.

This option existed only because RC5 is covered by patents that, twenty
years ago, we had reason to suspect the patent holder, RSA, Inc., might
litigate. The two US patents in question are 5,724,428 and 5,835,600.

According to the USPTO Patent Term Calculator web site at
<https://www.uspto.gov/patent/laws-and-regulations/patent-term-calculator#heading-5>
(retrieved 2017-05-21), patents filed after 1995-06-07 expire twenty
years after the filing date.

number filing date
5,724,428 1995-11-01
5,835,600 1997-04-21

Thus, these patents appear to be expired.

As proposed on tech-crypto and tech-security:

https://mail-index.netbsd.org/tech-crypto/2017/05/05/msg000718.html
https://mail-index.netbsd.org/tech-security/2017/05/05/msg000927.html


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.304 19-Apr-2017 joerg

Add netpgpverify to the library list.


Revision tags: pgoyette-localcount-20170320
# 1.303 20-Feb-2017 rin

add missing LIBCXX


# 1.302 08-Feb-2017 kamil

libpthread_dbg(3) deletion from the base distribution

libpthread_dbg(3) is a remnant library from the M:N thread model
(pre-NetBSD-5.0) API to introspect threads within a process and for use
of debuggers.

Currently in the 1:1 model it's not used in GDB neither in LLDB and it's
not either planned to be used. It's current function to read pthread_t
structures is realizable within a regular debugger capable to
instrospect objects within a tracee (GDB, LLDB...).

Remaining users of this API can still use this library from
pkgsrc/devel/libpthread_dbg.

Sponsored by <The NetBSD Foundation>


# 1.301 29-Jan-2017 christos

add sqlite3 to statically linked libraries for pam.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914
# 1.300 20-Aug-2016 christos

branches: 1.300.2;
unbound additions


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.299 04-Apr-2016 joerg

branches: 1.299.2;
If the per-target LDSTATIC flag is set, don't include the PIE linker
flags as we currently don't support static PIE.


# 1.298 30-Mar-2016 martin

Pass -pie to cc, not -Wl,-pie. This way we have a chance to fix specs
for obscure corner cases like -pie -fPIE -static (used for
/usr/tests/lib/csu/h_initfini2 if building with MKPIE=yes).
While there also replace -fPIC with -fPIE for the PIE case, even if
it should be mostly equivalent.


# 1.297 12-Mar-2016 mrg

remove conditionals that are always true with GCC >= 4.8.


# 1.296 21-Feb-2016 christos

Add NODEBUG


# 1.295 31-Jan-2016 christos

Introduce NOPIE and NOCTF so that standalone programs build properly.


# 1.294 23-Jan-2016 christos

Define _KERNTYPES for things that need it.


# 1.293 07-Nov-2015 joerg

LIBEXECINFO


# 1.292 07-Jun-2015 matt

Make LIBCRT* depend on the right files if MLIBDIR from MKCOMPAT is defined.


# 1.291 01-Dec-2014 erh

PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilt
if any of their dependencies (i.e. the files they refer to) are changed.
This allows changes to transitive included headers to be handled properly.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.290 25-Mar-2014 ozaki-r

branches: 1.290.4;
Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.


Revision tags: riastradh-drm2-base3
# 1.289 09-Mar-2014 christos

let's see if the new dwarf library can handle dwarf 4


# 1.288 02-Mar-2014 christos

If we are compiling with -g and using gcc4.8 and dtrace downgrade
dwarf generation to version 2 for now.


# 1.287 15-Jan-2014 joerg

-Wl,-pie and -r don't agree with each other, so filter the former out.


# 1.286 11-Nov-2013 joerg

Relink binaries if crti.o changes.


# 1.285 29-Sep-2013 christos

Add libxcb


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.284 31-May-2013 mrg

add LIBX11_XCB; unfortunately since the library is named with a -
in it, we have to use an ugly hard coded assignment for now.
(could be cleaned up with more make variable magic i'm sure.)


# 1.283 04-Apr-2013 christos

ldopts should be before ldadd like everywhere else.


Revision tags: agc-symver-base
# 1.282 14-Feb-2013 christos

Since the libraries are produced with different MK flags than the programs,
we check for existance of the files instead of the MK flags.


# 1.281 14-Feb-2013 christos

Add PROGDPLIBS


# 1.280 26-Jan-2013 christos

CTFCONVERT me harder.


Revision tags: yamt-pagecache-base8
# 1.279 17-Jan-2013 christos

Now that we have separate debug sets, add -g if ${MKDEBUG} is set for
program builds since we don't need to install that symbol files.


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.278 24-Aug-2012 jmmv

branches: 1.278.2;
Allow DPADD to be specified on a per-program basis.


# 1.277 23-Aug-2012 joerg

Revert last, it breaks the tricks xsrc uses.


# 1.276 23-Aug-2012 joerg

Remove SHLIBINSTALLDIR and SHLINKINSTALLLIBDIR. Add rpath entries, if
SHLIBDIR differs from /usr/lib.


# 1.275 08-Aug-2012 christos

add MKRUMP by popular demand.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.274 29-Feb-2012 tron

Move "libexpat" from X11 into base which fixes PR lib/40346.
This change was approved by the Core Group.


# 1.273 21-Feb-2012 matt

Remove another ${SIZE}


# 1.272 20-Feb-2012 matt

Remove ${SIZE}


# 1.271 19-Feb-2012 matt

Add support for --combine with gcc.


Revision tags: netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2
# 1.270 05-Nov-2011 christos

branches: 1.270.2;
Add libtre


Revision tags: yamt-pagecache-base
# 1.269 16-Oct-2011 christos

branches: 1.269.2;
- no need to special-case libraries with weird characters.
- add a note about adding new libraries.


# 1.268 16-Oct-2011 christos

fix list of libraries to reflect reality.


# 1.267 10-Sep-2011 apb

Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.


# 1.266 27-Aug-2011 joerg

Add new "analyze" command to run clang's static analyzer in a directory
on all C/C++ files.


Revision tags: cherry-xenmp-base
# 1.265 26-Apr-2011 he

The new Heimdal adds -lwind and -lheimbase to the set of libraries,
so define the corresponding LIB* variables.
These are also needed in the PAM_STATIC_* variables, so add them there too.


# 1.264 11-Apr-2011 joerg

Adjust --sysroot related usage:
-Wl,-rpath does not expand =, so just drop it.

Drop -Wl,-rpath-link entries that duplicate the -Wl,-rpath entries, this
is done implicitly now that ld is built with sysroot support.

Use ${DESTDIR} explicitly for the remaining -Wl,-rpath-link entries.


# 1.263 10-Apr-2011 joerg

For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.


# 1.262 08-Mar-2011 jmmv

Revert previous (revision 1.261): it broke the build because PROG_CXX is
defined in terms of PROG, so later on we would end up with target duplicates
because both PROG_CXX and PROG were being converted to PROGS_CXX and PROGS.

Did not catch this earlier because the test build I did was not clean and
thus the duplicate targets did not have nasty effects.


# 1.261 07-Mar-2011 jmmv

Always convert PROG to its plural form independently of whether PROG_CXX
is defined or not. From Garrett Cooper in private mail.


Revision tags: bouyer-quota2-nbase
# 1.260 20-Feb-2011 jmmv

Define LIBATF_C and LIBATF_CXX to point to their corresponding .a files and
use these to properly set DPADD for test programs.


Revision tags: bouyer-quota2-base
# 1.259 13-Feb-2011 christos

add saslc


# 1.258 06-Feb-2011 joerg

Don't use -nostdinc or -nostdinc++ if this is included in a HOSTLIB.


# 1.257 17-Jan-2011 pooka

branches: 1.257.2;
Add rump bits to DPSRCS so that update builds work correctly.


Revision tags: matt-mips64-premerge-20101231
# 1.256 13-Dec-2010 pooka

befriend RUMPPRG with CRUNCHEDPRG


# 1.255 13-Dec-2010 pooka

Define RUMPPRG, which is just like PROG, except it additionally
builds a rump client with the name rump.${PROG}. The rump client
is not installed suid/sgid by default even if BINMODE is defined.


# 1.254 10-Dec-2010 joerg

Revert last, gcc(1) checks explicitly for -r on some platforms to disable
passing down --relax as well.


# 1.253 08-Dec-2010 joerg

gcc passes down -r directly to ld, so make it explicitly a linker option.


# 1.252 08-Dec-2010 joerg

Don't depend on ${CC} passing down -R to ld, use -Wl,-rpath explicitly.


# 1.251 08-Nov-2010 lukem

Preserve date on original shared library or program when stripping
the debug symbols and adding the debug-link to .debug.
Use '(rm -f file; false)' in the failure path to force failure.
Based on solution proposed by Nicolas Joly on tech-toolchain in July 2010.
Should fix PR toolchain/44046 from Andreas Gustafsson.


# 1.250 31-Oct-2010 mbalmer

Link Lua to the build and add the resulting files to the distribution sets.
Document the addition of Lua and the change we made to the default settings.


# 1.249 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.248 24-Apr-2010 lukem

When extracting separate debug symbols with MKDEBUG, there's no need
to leave the original file unstripped...


# 1.247 02-Mar-2010 darran

DTrace: Add CTF generation to the make framework. Only enabled when
MKDTRACE=yes.


# 1.246 14-Dec-2009 mrg

use "${CC} -r" not "${CC} -Wl,-r" as the latter fools GCC on some targets
and it ends up passing "-r -relax" to ld, which causes ld to barf.


# 1.245 14-Dec-2009 matt

Merge from matt-nb5-mips64


Revision tags: matt-premerge-20091211
# 1.244 08-Dec-2009 uebayasi

When PROGS / LIBS are used, you can pass each PROG / LIB specific parameters
to ${LD} via:

${LDADD.${PROG}}
${LDFLAGS.${PROG}}
${LDSTATIC.${PROG}}
${LDADD.${LIB}}
${LDFLAGS.${LIB}}

OTOH you can't pass parameters to ${CC}, because in suffix rules make(1) only
knows the name of ${.IMPSRC} and ${.TARGET}; it's users' responsivility to
define ${CC} parameters to all the sources of a given ${PROG} / ${LIB}.

Should address bin/42381.

(Bug in this commit log was pointed out by mrg@.)


# 1.243 27-Nov-2009 tsutsui

If CPPFLAGS or CXXFLAGS already contains -nostdinc or -nostdinc++,
don't add ${CPPFLAGS_ISYSTEM} or ${CPPFLAGS_ISYSTEMXX} to refer
${DESTDIR}/usr/include or ${DESTDIR}/usr/include/g++.

This change might cause errors on some MD stand dir, but in that case
each Makefile should be fixed to search proper system include paths
by -Ipath option in own CPPFLAGS.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.242 12-May-2009 plunky

remove libsdp as improved functionality has been enabled in libbluetooth.


# 1.241 10-Apr-2009 apb

Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links. They have no effect except when using a
metalog, in which case the information is added to the metalog. In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg. This should fix PR 24457 and PR 41155.


# 1.240 24-Nov-2008 cube

branches: 1.240.2;
Move cleanextra to the very ends in case another included file wants to add
to it even if it was initially empty.


Revision tags: netbsd-5-base matt-mips64-base2
# 1.239 19-Oct-2008 christos

branches: 1.239.2;
handle assembly files for MKPIE


# 1.238 16-Oct-2008 christos

Provide a way for a program to override the PIE flags.


# 1.237 15-Oct-2008 christos

don't compile/link libraries with pie


Revision tags: mjf-devfs2-base
# 1.236 02-Oct-2008 joerg

Hook up libfetch and pkg_install update.


Revision tags: wrstuden-revivesa-base-3
# 1.235 09-Sep-2008 joerg

Add MKSTRIPIDENT to remove the RCS IDs from binary programs and shared
libraries for space-constraint systems. The description is based on the
feedback of hubertf@, the logic on input from lukem@

This obsoletes the removal of LIBC_SCCS and SYSLIBC_SCCS for libc builds.


Revision tags: wrstuden-revivesa-base-2
# 1.234 28-Aug-2008 mrg

update a comment example


# 1.233 27-Aug-2008 rtr

use ${X11USRLIBDIR} instead of hard-coded /usr/X11R6/lib when building
${LIB.foo} vars


# 1.232 27-Aug-2008 lukem

Fix problem I introduced in rev 1.231 on 2008/08/25 where ${_PROGLDOPTS}
and -L${_GCC_LIBGCCDIR} were appearing in the link line before ${LDADD},
so -L${DESTDIR}/lib and -L${DESTDIR}/usr/lib were being used before
local -L library paths.
Fixes ntpd/ntpdate failure noticed by Valeriy E. Ushakov <uwe@NetBSD.org>


# 1.231 25-Aug-2008 lukem

Always link with: -Wl,-rpath-link,${DESTDIR}/usr/lib -L${DESTDIR}/usr/lib
Fixes problem with MKDYNAMICROOT=no triggered by libraries that depend
on other libraries.
Related to PR 33503.

Clean up setting of _CCLINK to always add the appropriate -B options.

Simplify the link rule for a program.


# 1.230 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.229 28-May-2008 lukem

add LIBLDAR_R (for completeness)


# 1.228 22-May-2008 lukem

Add MKLDAP, USE_LDAP, LIBLBER, LIBLDAP


Revision tags: hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-pf42-base
# 1.227 10-Apr-2008 tsutsui

branches: 1.227.2; 1.227.4;
Add libhx509 to PAM_STATIC_LDADD which is required by libkrb5.


# 1.226 22-Mar-2008 mlelstv

branches: 1.226.2;
Import Heimdal-1.1


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase matt-armv6-base hpcarm-cleanup-base
# 1.225 26-Dec-2007 jmmv

Make the clean target work when OBJS is set but PROG is not, as happens
for example in gnu/lib/crtstuff4. Reported by drochner@.


Revision tags: cube-autoconf-base
# 1.224 13-Nov-2007 jmmv

Fix typo that prevented MKDEBUG builds to work. Found by drochner@.


# 1.223 12-Nov-2007 jmmv

Add the ability to build multiple programs from a single directory

This adds support for a new set of variables, PROGS and PROGS_CXX, that
allow the developer to build multiple different programs from a single
source directory.


# 1.222 04-Nov-2007 tls

Remove MKPRIVATELIB from BIND libraries; move library reachover
directories and Makefiles from src/usr.sbin/bind to src/lib; make
BIND libraries build shared. Saves about 1MB-1.5MB per installed
executable, about 5MB for a base+etc minimal installation of NetBSD.


Revision tags: matt-mips64-base
# 1.221 29-Jul-2007 joerg

branches: 1.221.4; 1.221.6;
Add build glue for libarchive and update the various sets.


# 1.220 25-Jan-2007 perry

Before I completely forget the issue, convert "PROG_PAX" to the
better-named "PAXCTL_FLAGS".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.219 11-Nov-2006 christos

don't run paxctl if other commands were specified for that target.


# 1.218 10-Nov-2006 christos

if ${PROG_PAX} is defined, run paxctl on the binary after linking with
the value of the variable. This way, if you set:

PROG_PAX=+M

in /etc/mk.conf, you get what you deserve.


# 1.217 22-Oct-2006 pooka

libpuffs


# 1.216 09-Oct-2006 mrg

- clean up some comments to reality.
- retire LIBDCK, LIBG2C and (long broken) USE_LIBSTDCXX
- in bsd.hostprog.mk's LIBSTDCPP -> LIBSTDCC
- add LIBSUPCXX
- don't default USE_LIBSTDCXX or USE_GCC4 since they are
not used in the tree any where
- same with USE_XF86_4; retire it
- remove _SUPCXX handling in bsd.prog.mk

inspired by PR#26714.


Revision tags: abandoned-netbsd-4-base
# 1.215 23-Jul-2006 lukem

Implement MKDEBUG:
If "no", don't build and install separate debugging symbols
into /usr/libdata/debug.
Default: no


# 1.214 19-Jun-2006 gdamore

Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.


# 1.213 09-Jun-2006 christos

PR/33681: Scott Ellis: Building 'bc' with SHAREDSTRINGS=yes fails
We need CPPFLAGS too now.


# 1.212 11-May-2006 mrg

add support for ${OBJCOPTS} and ${OBJCOPTS}.<lib|prog|fn>.


# 1.211 20-Mar-2006 christos

There is always one more KRB4 thing to remove. (from Jukka Salmi)


# 1.210 20-Mar-2006 christos

Remove krb4 variables and libraries (Jukka Salmi)


# 1.209 16-Mar-2006 jwise

Now that we have real build system support for syspkgs, remove someone's
half-implemented idea of building `syspkgs' (really a few giant blobs of the
same granularity of the old sets) using install(1).


# 1.208 20-Jan-2006 christos

Add the world of libraries to the static pam build. Now static pam binaries
work.


# 1.207 09-Apr-2005 dsl

Report when we link a program into xxx.ro (before being crunched)


Revision tags: netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.206 04-Mar-2005 he

branches: 1.206.2; 1.206.4;
Introduce PAM_STATIC_LDADD and PAM_STATIC_DPADD. When compiling
with MKPIC=no, possibly because the target does not support shared
libraries, these include libraries required to resolve all symbols
which end up referenced from PAM-using applications. The libraries
presently required are -lcrypt, -lrpcsvc and -lutil.

Add use of these variables which are currently set up to use PAM,
so that they compile when MKPIC=no.

Also, in the telnetd case, reorder the order of the libraries, so
that libtelnet.a comes before -ltermcap and -lutil, again to fix
link error when MKPIC=no.

Discussed with thorpej and christos.


# 1.205 20-Feb-2005 christos

Add libradius


# 1.204 12-Jan-2005 lukem

If RESCUEDIR is defined, automatically add that to CPPFLAGS


# 1.203 08-Jan-2005 lukem

Implement <bsd.prog.mk> vars:
LIBASN1 LIBBSDMALLOC LIBG2C LIBPAM LIBSSH


# 1.202 04-Aug-2004 lukem

Revert most of previous, and move the LIB<libname>?= assignments
back to bsd.prog.mk from bsd.own.mk.

pkgsrc uses <bsd.own.mk>, and setting LIB<libname> in it causes
problems with various package builds.
This should fix PR #26542 submitted by Jim Bernard.

(I'll be implementing the DPADD for shared libraries in a different
manner that generally won't depend upon ${LIB<libname>}.)


# 1.201 30-Jul-2004 lukem

Move the LIB<libname>?= assignments from bsd.prog.mk to bsd.own.mk so
that they may be used by non PROGs (e.g., LIBs).

Improve some comments.


# 1.200 10-Jun-2004 lukem

Be consistent in handling YHEADER, similar to Christos' fix in bsd.lib.mk 1.253


# 1.199 21-May-2004 ross

If you add a library, you need to define its DPADD symbol here.

Add LIBMAGIC.


Revision tags: netbsd-2-0-base
# 1.198 15-Feb-2004 skrll

branches: 1.198.2;
Be more gcc like in the way we deal with libgcc so that sh3/hppa millicode
and exception handling have a chance of working properly.

- creates libgcc, libgcc_eh and libgcc_s

- updates LIBGCC_SPEC to use them appropriately.

There's a hack in here at the moment with respect to libgcc_so in that it
is preferable to link against libgcc_so will only when -shared-libgcc is
specified (the c++ frontend does this automatically.) Configurations where
LINK_EH_SPEC is defined already do this. The gcc configuration for
NetBSD/alpha and another NetBSD platform (I forget which) actually define
LINK_EH_SPEC probably by accident rather than design.

- updates share/mk to use the compiler's knowledge of what needs linking into
libraries and executables. This removes an hppa hack.

- updates the sets for the newly created libgcc* files.

- support for linking against the _pg version of libgcc has been removed.


# 1.197 29-Jan-2004 lukem

Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.


# 1.196 27-Jan-2004 lukem

Replace
:M-[IDU]*
with
:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)


# 1.195 23-Jan-2004 simonb

crt0.o lives in /usr/lib even on a.out.


# 1.194 16-Nov-2003 lukem

simplify with _MKTARGET_LINK


# 1.193 11-Nov-2003 dsl

Set MKDEP_SUFFIXES to get additional targets in .depend instead of using
sed in .afterdepend. I don't think .afterdepend is used anywhere any more.


# 1.192 21-Oct-2003 lukem

Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.


# 1.191 19-Oct-2003 lukem

Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} " ... {$.TARGET}" and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO


# 1.190 18-Oct-2003 lukem

Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command ("verbose")
This is the default, and is equivalent to the previous behaviour.


# 1.189 29-Sep-2003 lukem

Add LIBSTDCXX (for usr/lib/libstdc++.a).
Sync LIB* documentation with reality.


# 1.188 19-Sep-2003 martin

Drop explicit medlow model and default to -O2 for sparc64.


# 1.187 14-Sep-2003 lukem

Check ${SHLIBDIR} against "/usr/lib" instead of ${LIBDIR} when determining
if we need to add stuff (usually "/lib") to the rpath-link path before
"/usr/lib". Otherwise, this barfs if LIBDIR != /usr/lib or /lib, and
we're cross-building (e.g., in src/x11)


# 1.186 13-Sep-2003 erh

Also support per-program LDFLAGS and LDSTATIC.


# 1.185 13-Sep-2003 erh

Create a way to add additional flags to COPTS, CPPFLAGS, CXXFLAGS and LDADD
for particular libraries or programs by specifying the additions in mk.conf
instead of needing to go edit individual Makefiles.


# 1.184 12-Sep-2003 lukem

add infrastructure to support reach-over builds of xsrc


# 1.183 22-Aug-2003 dsl

Add a ${PROG}.ro target that does an 'ld -r' of the program object files.
Allows a much simplified build of 'crunched' binaries since crunchgen can
build prog.ro instead of having to deretmine the names of all the .o files.


# 1.182 01-Aug-2003 lukem

Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".


# 1.181 01-Aug-2003 lukem

simplify the ${PROG}: target to reduce duplication between the DESTDIR
and !DESTDIR cases...


# 1.180 31-Jul-2003 lukem

bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.


# 1.179 31-Jul-2003 lukem

Don't need -R/usr/lib; it will be searched at the end by ld.elf_so anyway.
Noted by matt green <mrg@>


# 1.178 28-Jul-2003 lukem

be consistent when adding *.y and *.l to DPSRCS


# 1.177 28-Jul-2003 lukem

replace MKCXXSUPCXX(!=no) with USE_LIBSTDCXX(==no)


# 1.176 28-Jul-2003 lukem

Change defined(CXX_SUPCXX) to MKCXXSUPCXX != "no".

Clarify that command-line overrides of the MKxxx variables should be
done via the environment rather than make(1) command-line variable
assignment, since the latter doesn't actually work as intended.


# 1.175 27-Jul-2003 mrg

introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes. for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)


# 1.174 26-Jul-2003 mrg

add a new bsd.own.mk variable: CXX_SUPCXX. from bsd.README:
+ CXX_SUPCXX If defined, the support libraries needed for this C++ program
+ are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.


# 1.173 20-Jul-2003 lukem

Consistently support the different C++ file extensions: .cc .cpp .cxx .C
Noted by Andrew White in PR toolchain/18246


# 1.172 18-Jul-2003 lukem

Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was defined.
Replace defined(UNPRIVED) tests with ${MKUNPRIVED} != "no"

Add MKUPDATE; if not no has the same semantics as if UPDATE was defined.
Replace defined(UPDATE) tests with ${MKUPDATE} != "no"

Improve documentation for these and other make flags.


# 1.171 16-Jul-2003 itojun

stop installing install libtelnet. build under lib/libtelnet and reference
it from usr.bin/telnet and libexec/telnetd.
(reason for separate build: compiler flags)


# 1.170 27-Jun-2003 drochner

For consistency, use "-R" instead of "-Wl,-rpath" to pass
a runtime search path to the linker.


# 1.169 13-Jun-2003 itojun

define LIBEVENT


# 1.168 11-Jun-2003 msaitoh

catch signal 1,2,3,13 and 15 to clean /tmp/_dependXXX


# 1.167 31-May-2003 thorpej

If EXTERNAL_TOOLCHAIN is defined, allow the compiler to define the
location of crt{begin,end}{,S}.o and libgcc.a. Encapsulate all of
this logic into the new bsd.gcc.mk, and use it in bsd.prog.mk and
bsd.lib.mk.


# 1.166 18-May-2003 lukem

make this a no-op if HOSTPROG is defined


# 1.165 30-Mar-2003 thorpej

If MACHINE_ARCH is powerpc and we HAVE_GCC3, add crtsaveres.o to the
endfile spec.


# 1.164 22-Feb-2003 uwe

Typo in comment.


# 1.163 24-Jan-2003 thorpej

Add LIBPTHREAD, LIBPTHREAD_DB, and LIBRT.


Revision tags: fvdl_fs64_base
# 1.162 22-Nov-2002 thorpej

Split crtbegin/crtend into crti/crtbegin/crtend/crtn. NetBSD-specific
things like the .note.netbsd.ident section are provided by crti/crtn.
crti/crtn also provide the _init() and _fini() routines.

crtbegin/crtend now only provide support for ctors/dtors. This paves
the way to using the "crtstuff" provided with GCC (when we upgrade to
GCC 3.3), which provides, among other things, much better C++/Java
exception handling.


# 1.161 12-Nov-2002 itohy

MKDYNAMICROOT for a.out


# 1.160 22-Oct-2002 perry

Pass 1 of SYSPKG changes to automatically add tags=pkgname_pkg to METALOG.
Not quite ready for prime time yet.


# 1.159 27-Sep-2002 thorpej

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.


# 1.158 26-Sep-2002 itojun

MDC2 is a patented algorithm; don't ship it in default libcrypto.
MKCRYPTO_MDC2 will build a separate library, libcrypto_mdc2.


# 1.157 08-Sep-2002 thorpej

Build a .gdbinit in the objdir when building a program. The .gdbinit
file sets the shared library prefix to ${DESTDIR}, and adds "sources"
directives for each file listed in the GDBINIT Makefile variable.


# 1.156 09-Aug-2002 thorpej

Add LIBPMC.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.155 27-Mar-2002 eeh

branches: 1.155.2;
Use the medium low model for sparc64 programs that don't 2GB of data segment.


# 1.154 11-Feb-2002 mycroft

Don't use .PHONY for targets that are actually installed. Instead use force
dependencies. (Among other things, `make -t install' does something vaguely
sensible now.)


# 1.153 07-Feb-2002 pk

Mark installed system libraries as .MADE only if we're actually establishing
their default variable values here.


# 1.152 04-Feb-2002 christos

s/.NOSUFF/.MADE/


# 1.151 03-Feb-2002 christos

Apply a .NOSUFF: directive to targets we don't want to have processed by
the suffix rules engine.


# 1.150 02-Feb-2002 veego

Ups, it is LIBUSBHID and not LIBUSBHIB.


# 1.149 02-Feb-2002 veego

Change LIBUSB to LIBUSBHIB, reflecting the library name change.


# 1.148 29-Jan-2002 enami

Mark the targets clean{extra,objs} as PHONY.


# 1.147 04-Jan-2002 thorpej

For PROG_CXX DESTDIR builds, pull in -lstdc++ and -lm regardless
of GCC version.


# 1.146 01-Jan-2002 thorpej

Per a suggestion from matthew green, PROG_CXX takes the place of
PROG for C++ programs.


# 1.145 01-Jan-2002 thorpej

* If PROG_CXX is set by the program's Makefile, use ${CXX} to link
the program rather than ${CC}.
* If HAVE_GCC3 is defined, pull in "-lstdc++ -lm" as additional C++
support libraries for DESTDIR builds.


# 1.144 28-Dec-2001 lukem

* 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


# 1.143 28-Nov-2001 tv

If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.


# 1.142 19-Nov-2001 thorpej

Use a little transitional hack to determine if we use -isystem
or -idirafter. Use the former only of USE_NEW_TOOLCHAIN, since
-isystem causes the old toolchain to bomb out when building
libstdc++.


# 1.141 14-Nov-2001 tv

C/..$/.c/ -> C/\..$/.c/


# 1.140 14-Nov-2001 tv

Move the DESTDIR-based nostdinc logic to bsd.lib.mk and bsd.prog.mk where
it belongs (with the native target compile rules).


# 1.139 02-Nov-2001 tv

Use INSTALL_FILE/INSTALL_DIR as appropriate.


# 1.138 02-Nov-2001 tv

Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.


# 1.137 19-Oct-2001 tv

Add .NOPATH for all files generated from .l or .y files in SRCS. Fixes PRs
bin/14187 and lib/14239.

Also simplify the handling of these transforms to .c and .h files a bit by
leveraging make's builtin macro operators.


# 1.136 25-Sep-2001 tv

Set .NOPATH on program to build to make sure it goes in .OBJDIR.
Problem noted by <seebs@plethora.net>.


# 1.135 24-Sep-2001 lukem

fix previous (hi thor!) - $OBJS and $CLEANFILES might be empty, and
rm needs some files to delete...


# 1.134 24-Sep-2001 tls

Split "cleanprog" target apart: now you can zap only object files or
CLEANFILES (needed to fix crunchgen lossage).


# 1.133 13-Sep-2001 thorpej

Add LIBPCI.


# 1.132 14-Aug-2001 tv

Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").


# 1.131 01-Jun-2001 tv

Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).


# 1.130 08-May-2001 sommerfeld

Suppress duplicate entries in ALLFILES, FILES, INCS, DEPINCS, INFOFILES,
NLSALL, CATPAGES, MANPAGES, HTMLPAGES, and SCRIPTS.


# 1.129 19-Feb-2001 jmc

Wrap target() checks around afterdepend rule as some Makefiles override this


# 1.128 26-Jan-2001 itojun

fix typo in LIBSSL decl. it made programs with DPADD+=${LIBSSL} to build
every time we type "make". From: bernd


# 1.127 14-Jan-2001 christos

use the new .if commands(<target>) directive so that we don't have to
change Makefiles.


# 1.126 14-Jan-2001 christos

fix thinko: test for the existance of the target before we define it...


# 1.125 14-Jan-2001 christos

Alter previous redefined target protection. If the ${PROG} target is defined,
add the dependencies as usual, but don't add the commands. This avoids
having to change all the Makefiles that redefine the PROG target.


# 1.124 14-Jan-2001 christos

allow programs to override the program target.


# 1.123 08-Jan-2001 mrg

add missing $LIBCRYPTO_RC5 and $LIBCRYPTO_IDEA


# 1.122 08-Jan-2001 mrg

add missing $LIBSSL


# 1.121 04-Jan-2001 garbled

Add LIBCDK and LIBFORM definitions


# 1.120 31-Oct-2000 itojun

add ${LIBINTL} for use with DPADD.


# 1.119 07-Oct-2000 deberg

fix typos, PR 11159


# 1.118 25-Jun-2000 erh

For the case when DESTDIR is set: move the -L${DESTDIR}/usr/lib after ${LDADD} so any -L directories set in LDADD are searched first to avoid possibly linking against old versions of libraries.


Revision tags: netbsd-1-5-base
# 1.117 19-Jun-2000 thorpej

branches: 1.117.2;
Sync up the LIB* list.


# 1.116 10-Jun-2000 mycroft

Use ${.ALLSRC:T} when doing the generated variable name lookups, so that it
DTRT for generated files in and obj directory (or accessed via .PATH).


# 1.115 06-Jun-2000 mycroft

Abuse .USE some more.


# 1.114 06-Jun-2000 mycroft

Minor rearrangement.


# 1.113 06-Jun-2000 mycroft

Use ODE make(1) features to eliminate extra variables and move several things
outside of .for loops. (Needs more work to completely eliminate .for.)

XXX Don't look at this stuff. It will make your head hurt.


Revision tags: minoura-xpg4dl-base
# 1.112 14-Apr-2000 mrg

branches: 1.112.2;
use -rpath-link rather than -R when linking objects using a DESTDIR.
this replaces the previous change as that ended up adding
$DESTDIR/usr/lib to the runtime path of every binary created, which
is bogus and dangerous.


# 1.111 25-Mar-2000 mycroft

When linking with $DESTDIR, use an explicit -R to get library dependencies
correct.


# 1.110 07-Mar-2000 veego

Remove unused libahdi.
It will be replaced in the future with a more generic libdisklabel.


# 1.109 05-Feb-2000 jdc

Add libahdi entries.


# 1.108 23-Jan-2000 eeh

Add some support for FCode binaries.


# 1.107 22-Jan-2000 mycroft

Make `dependall' play nicely with SUBDIR, using a hack similar to `realinstall'
for both `depend' and `all'.
Also, remove the old hack that invokes an extra shell for .depend, now that
make(1) has been fixed.


# 1.106 16-Jan-2000 assar

all: depend on ${SCRIPTS} so that they get generated if they need to


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.105 23-Nov-1999 blymn

Added libmenu library.


Revision tags: comdex-fall-1999-base
# 1.104 14-Sep-1999 perry

branches: 1.104.4;
Add a "dependall" target, which does a "make depend" and then "make all"
in a single directory. This is useful in "make build" because by doing
the build immediately after the depend, all sources will typically
still be in the buffer cache, thus saving significant time over doing
a "make depend" on all the directories and then a "make all".


# 1.103 04-Sep-1999 fredb

Permit "make all install", as well as "make foo install" (where foo would be
installed by "make install") without setting of BUILD. All cases where BUILD
is already set are unchanged from the old behavior.

"make all install" is now practically equivalent to "make BUILD= all install",
but without actually setting build.

Fixes pr's 8313, 3894.


# 1.102 21-Aug-1999 simonb

Add ${INSTPRIV} to ${INSTALL} commands.


# 1.101 01-Jul-1999 itojun

branches: 1.101.2;
add LIBIPSEC for use from DPADD.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.100 12-Feb-1999 lukem

branches: 1.100.2;
* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.99 10-Feb-1999 tv

libbfd_pic.a is no longer installed; remove ${LIBBFD} define.


# 1.98 04-Feb-1999 christos

PR/2936: Brian C. Grayson: Avoid truncating precious files when installing
and the filesystem is full. Added ${RENAME} flag to install, which when set
to -r installs on a temporary file and then renames to the final destination.
${RENAME} is currently set to nothing in bsd.own.mk, but one can turn it
on in /etc/mk.conf.


# 1.97 07-Nov-1998 jonathan

Do DESTDIR support for crtbegin/crtend on all ELF ports (adds mips).


# 1.96 28-Sep-1998 christos

Use preserve flag in install.


# 1.95 10-Sep-1998 ross

Define a LIBBZ2?=... for use in DPADD=... lines.


# 1.94 09-Aug-1998 lukem

add distclean as a synonym for cleandir


# 1.93 09-Apr-1998 tv

.y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.


# 1.92 01-Apr-1998 tv

Revert. This broke too much in the build tree, and a better solution
needs to be created. (The existing situation breaks a lot too.)


# 1.91 01-Apr-1998 tv

Fix .y rules to DTRT with possibly generated .h files. See mail on
tech-toolchain for a very detailed explanation of this. In short, add
a .y.h rule identical to the .y.c rule and make the .y.c rule rename
the .h file; also, clean the .h file in CLEANFILES.


# 1.90 03-Nov-1997 cgd

echo the lint command line when making 'lint'.


# 1.89 28-Oct-1997 lukem

add ${LIBOBJC}


Revision tags: netbsd-1-3-base
# 1.88 11-Oct-1997 mycroft

branches: 1.88.2;
Several changes:
* Allow bsd.man.mk to be included separately.
* Always include bsd.own.mk and bsd.obj.mk.
* Include bsd.man.mk and bsd.nls.mk even if NOMAN or NONLS; just turn off
building of the affected files instead.
* Require bsd.subdir.mk to be included explicitly.
(Will make appropriate changes to Makefiles shortly.)


# 1.87 29-Sep-1997 gwr

Add $LIBBFD


# 1.86 31-May-1997 cjs

Back out BUILDDIR and NOINSTALL changes.


# 1.85 26-May-1997 cjs

branches: 1.85.2;
These updates to the build allow building against include files
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.


# 1.84 18-May-1997 kleink

Add libposix.


# 1.83 17-May-1997 mycroft

Do LINKS and SYMLINKS after FILES and INCS.


# 1.82 17-May-1997 mycroft

Remove unneeded .SUFFIXES lines, and move .s and .S closer to .o to give the
right preferences.


# 1.81 09-May-1997 mycroft

Fix typo in previous.


# 1.80 09-May-1997 mycroft

Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.79 09-May-1997 mycroft

Remove cruft.


# 1.78 09-May-1997 mycroft

Oops; rearrange dependencies to get things built early enough.


# 1.77 09-May-1997 mycroft

Make sure INCS and SRCS are built if necessary.


# 1.76 08-May-1997 gwr

Set the .NOPATH flag for ${OBJS} (from Christos).


# 1.75 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.74 07-May-1997 mycroft

Various simplifications.


# 1.73 07-May-1997 mycroft

Shuffle some .PHONYs around, to work better with `-t'.


# 1.72 06-May-1997 mycroft

Make most of the install targets .PRECIOUS.


# 1.71 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.70 18-Apr-1997 christos

Add ${LIBNTP}


# 1.69 17-Apr-1997 thorpej

- Properly depend on crtbegin.o and crtend.o for platforms that use
them (currently Alpha and PowerPC)
- STRIP -> STRIPFLAG


# 1.68 03-Apr-1997 mikel

don't allow override of all: target


# 1.67 29-Mar-1997 mikel

merge lite-2 changes (mostly SCCSids)


# 1.66 27-Mar-1997 christos

Put the FILES generated rules in a separate .mk file since both bsd.prog.mk
and bsd.lib.mk use them.


# 1.65 27-Mar-1997 mycroft

Make the SCRIPTS case mimic the FILES case more closely, so we can override
the destination direectory, etc.


# 1.64 27-Mar-1997 mycroft

Remove knowledge of HIDEGAME from here.


# 1.63 24-Mar-1997 christos

make rules update:
- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation


# 1.62 22-Mar-1997 perry

Fix SYMLINKS not to include DESTDIR in the link itself


# 1.61 13-Mar-1997 perry

add SYMLINKS, by analogy to LINKS. Vetted by Christos.


# 1.60 22-Jan-1997 cgd

if 'clean' is not already defined, rather than simply defining it with
a bunch of rules, define a clean{kmod,lib,prog} target with the rules,
and have both clean and cleandir depend on that. That eliminates a bug
where 'cleandir' in a directory which included e.g. bsd.prog.mk but which
also had subdirs would 'make clean' all the subdirs and then 'make cleandir'
all ofthe subdirs. It also allows Makefiles to add more dependencies
to 'clean' after inclusion of the make template.

If 'clean' is already defined, the behaviour is the same as it used to be.


# 1.59 20-Dec-1996 cgd

add an afterdepend target (a la the one in bsd.lib.mk) that processes
the .depend file to add <filename>.ln for each <filename>.o as an
object file which has the given dependencies (in addition to
<filename>.po and <filename>.so, which were already there).


# 1.58 13-Dec-1996 mikel

add missing LIBPCAP definition.


# 1.57 26-Nov-1996 mrg

add libz and libwrap


# 1.56 18-Oct-1996 thorpej

Use ${INSTALL} rather than "install".
From Simon J. Gerraty <sjg@zen.void.oz.au>, PR #1458.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.55 08-Apr-1996 jtc

Sort LIBFOO definitions and add LIBY; Reported by Mike Long <mike.long@analog.com> in PR #2301.


# 1.54 22-Oct-1995 christos

Added include file <bsd.sys.mk> that contains lex and yacc "parallel aware"
rules. These rules are not turned on by default; they are enabled by setting
the PARALLEL variable.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.53 25-Jun-1995 cgd

oops; fix an rm that might be empty


# 1.52 24-Jun-1995 cgd

update lint rules, but keep linting disabled


# 1.51 10-Jun-1995 mycroft

Define LIBEDIT.


# 1.50 21-Apr-1995 jtc

.include <bsd.nls.mk> unless NONLS is defined.


# 1.49 22-Dec-1994 cgd

specify man pages differently, and document how.


# 1.48 24-Aug-1994 mycroft

Include bsd.own.mk earlier.


# 1.47 20-Jul-1994 cgd

fix from christos, for progs w/o objects


Revision tags: netbsd-1-0-base
# 1.46 06-Jul-1994 mycroft

branches: 1.46.2;
Pull libraries from ${DESTDIR} if set. Kill LDONLY, which is unused and
probably not useful anyway.


# 1.45 30-Jun-1994 cgd

fix modify-info-nothingness-then-substitute probelm that broke genclass build


# 1.44 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.43 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.42 28-Jun-1994 jtc

Strip *.sh when constructing OBJS from SRCS.
This will allow us to clean up makefiles that build a script by munging
a template (uusched, genclass, neqn, etc.).


# 1.41 18-Jun-1994 cgd

don't chown the symlink, when HIDEGAME causes a symlink to be made to dm.
4.4-based FS code _follows_ the symlinks on a chown(2) call.


# 1.40 24-May-1994 cgd

fix the last to do the right thing for dependencies


# 1.39 24-May-1994 deraadt

LIBSKEY


# 1.38 22-May-1994 jtc

Single source file programs are now compiled into object files before they
are linked. This change halves the time it takes to rebuild all of the
NetBSD sources when only the C library is "touched"; but only takes about
one percent more disk space.


# 1.37 06-Apr-1994 chopps

relink (recompile) single source programs when crt0.o is updated.


# 1.36 24-Mar-1994 mycroft

Remove *.core on clean.


# 1.35 09-Feb-1994 cgd

kill install -d's.


# 1.34 28-Jan-1994 cgd

add LIBKVM


# 1.33 10-Nov-1993 cgd

librpc doesn't exist anymore


# 1.32 08-Nov-1993 cgd

ad LDSTATIC flag, so static linking can be made one-stop shopping.
use "setenv LDSTATIC" to make *everything* dynamically linked,
setenv LDSTATIC -static for everything statically linked, or unset
it for default behavior.


# 1.31 07-Oct-1993 cgd

LIBTERM pointed at nothing, but was meant to point to libtermcap.a...


# 1.30 07-Oct-1993 cgd

always define LIBCRYPT


# 1.29 17-Aug-1993 mycroft

Make sure we don't recurse into subdirectories if Makefile specified `install'
target. (It's usually blank and is specifically to avoid doing this...)


# 1.28 15-Aug-1993 mycroft

Automatically include bsd.subdir.mk for backward compatibility.


# 1.27 15-Aug-1993 mycroft

Don't automatically include bsd.subdir.mk in bsd.prog.mk and bsd.lib.mk.
Put back .MAIN in bsd.man.mk, and be careful not to include ../Makefile.inc
a second time.


# 1.26 15-Aug-1993 mycroft

Move man rules to sys.mk.
Use bsd.subdir.mk for building subdirectories.
Don't forget to remove x.cc and x.C when using SHAREDSTRINGS.
Make ${PROG} always depend on ${LIBCRT0}.
Don't duplicate code between cleandir and clean.
Move tags target to bsd.dep.mk.
Move STRIP to bsd.own.mk.
Remove redundant definitions of {BIN,MAN}{DIR,GRP,OWN,MODE}.
Move {LIB,DOC}{DIR,GRP,OWN,MODE} defaults to bsd.own.mk.


# 1.25 15-Aug-1993 mycroft

Abstract out dependency stuff, and add RCS identifiers.


# 1.24 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


# 1.23 10-Aug-1993 mycroft

Put LINKS handling in `install' target, so it's the last thing executed, and
happens even if `realinstall' is user-defined.


# 1.22 30-Jul-1993 mycroft

When generating a default OBJS, ignore .h files.


# 1.21 29-Jul-1993 mycroft

Don't print the `making ...' message if an obj dir already exists.
Also, a minor cleanup.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.20 17-Jul-1993 mycroft

Fix C++ dependencies for good. `make depend' is now done in two passes--one
of C files and one for C++ files. No need to specify `-+' in your Makefile,
as it is now done automatically.


# 1.19 17-Jul-1993 cgd

do c++ dependencies the right way...


# 1.18 17-Jul-1993 mycroft

Add suffix rules for C++ files.


# 1.17 04-Jun-1993 brezak

Add LIBRPCSVC variable.


# 1.16 02-Jun-1993 cgd

add ability to specify c++ dependencies, by setting CFLAGS+=-+ for
the dependency make.


# 1.15 26-Apr-1993 cgd

added definition for DPADD library variable LIBCRYPT.


# 1.14 26-Apr-1993 mycroft

Don't redefine `realinstall' target if already defined.


# 1.13 25-Apr-1993 mycroft

Link with LDFLAGS even if one source module.


# 1.12 25-Apr-1993 mycroft

Don't lose if we include bsd.prog.mk only to build man pages.


# 1.11 25-Apr-1993 mycroft

Fix error in last change. (Oops.)


# 1.10 25-Apr-1993 mycroft

Don't build man pages if NOMAN set.


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.9 09-Apr-1993 cgd

various changes to default make rules. from patch 101.
note that only the "sensible" changes in patch 101 are implemented.


# 1.8 08-Apr-1993 cgd

try to do the right thing, in terms making directories before we
install into them, and get the manpage cleans _OUT_ of "clean".
they don't belong there, only in cleandir, WFJ be damned.


# 1.7 08-Apr-1993 cgd

fixed typos...


# 1.6 08-Apr-1993 cgd

(silently) make sure we have directories before installing


# 1.5 04-Apr-1993 cgd

make LIBRPC point to the right place


# 1.4 27-Mar-1993 nate

Fixed the doc macros to call troff, eqn,and tbl instead of ditroff,
deqn, and dtbl.
Fixed make clean to remove the man pages (Bill fixed this in the distribution,
but not in the original source)
Changed install to leave the original file around, by using 'cp' instead of
'mv'. "install -c ..."


# 1.3 23-Mar-1993 cgd

made .CURDIR be absolute, not relative, thereby eliminating
the need for some of the makefile trickery when making objects,
and fixing a few .PATH bugs


# 1.2 22-Mar-1993 cgd

fixed "make obj" for cases when sources not in /usr/src/...
if sources not there, it now mkdirs obj, but some trickery
is necessary, to avoid deleting cwd.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.347 11-Oct-2023 riastradh

heimdal: No need for -lm, was only added for -lsqlite3.

PR lib/57406

XXX pullup-10


# 1.346 11-Oct-2023 riastradh

bsd.prog.mk: krb5 stuff no longer needs to link against sqlite3.

(Why is this here? Seems like it should be a .mk fragment under
crypto/external/bsd/heimdal -- that way I would have found it for the
previous commit.)

PR lib/57406

XXX pullup-10


# 1.345 28-May-2023 lukem

share/mk: finish USE_COMBINE, NOCOMBINE deprecation

Remove the leftover remnants of deprecated USE_COMBINE and NOCOMBINE,
as gcc -combine has been EOL for many years.

Completes the work done by maya@ on 2019-05-10 in bsd.kmodule.mk rev 1.61.


# 1.344 24-May-2023 lukem

deprecate SHAREDSTRINGS build option

Hasn't worked for at least 20 years (and never in the cross-build environment,
nor did it work with parallel make), and has never been needed in NetBSD as we
don't have the older BSD programs (pascal, pre-nvi ex) that needed mkstr/xstr
on PDP-11.

PR toolchain/35964


# 1.343 08-May-2023 christos

remove stuff accidentally committed


# 1.342 07-May-2023 christos

Provide a hook to link in libraries statically in PROGDPLIBS.
OpenSSL protects the symbols in the shared object via a linker
script, but programs and tests need those protected symbols, so
they either must link against the archive, or I need to expose the
symbols. For now, I chose to expose the symbols. Note that we
cannot use -Bstatic -Lpath -llibrary -Bdynamic because this seems
to be broken with collect2 and so we use the path directly.


Revision tags: netbsd-10-base
# 1.341 14-Jul-2022 mrg

branches: 1.341.2;
add libxcvt.


# 1.340 28-Nov-2021 christos

When we build against DESTDIR, add the lint library path for DESTDIR during
the link phase for lint.


# 1.339 23-Aug-2021 mrg

define variables for the libxcb-* libraries.


# 1.338 15-Aug-2021 christos

Fix sun2 build for ldap/gssapi


# 1.337 14-Aug-2021 christos

Centralize the ldap libraries


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.336 12-Nov-2020 nia

Revert addition of pthread dependency on sqlite.

It is less trivial than expected and introduced some surprising breakage.


# 1.335 09-Nov-2020 christos

- make the CTFCONVERT command lines consistent and concise by putting all
the implementation stuff in a variable CTFCONVERT_RUN
- introduce an OBJECT_TARGET variable that contains the output object file
- when we need to run ctfconvert, go through an intermediate ${.TARGET}.o
file, instead of writing directly to ${.TARGET} and then overwriting
${.TARGET} with ctfconvert. This avoids build failures after a build
got interrupted (the "partially built from C" scourge).


# 1.334 09-Nov-2020 martin

Adapt for sqlite requiring pthreads now


# 1.333 30-Oct-2020 martin

libsqlite3 now requires -lm


# 1.332 16-Oct-2020 nia

share/mk: Define some missing X11 libraries.


# 1.331 15-Jun-2020 christos

Rename blacklist -> blocklist


# 1.330 30-May-2020 christos

Make libuv private, requested by joerg@


# 1.329 24-May-2020 christos

Add libuv


Revision tags: phil-wifi-20200421 phil-wifi-20200411 phil-wifi-20200406
# 1.328 04-Apr-2020 christos

Linker semantics have changed; we now don't automatically link dependent
libraries from other DSO's. For example in /usr/bin/passwd:
ld: krb5_passwd.o: undefined reference to symbol \
'UI_UTIL_read_pw_string@@OPENSSL_1_1_0'
ld: /usr/obj/amd64-x86_64/release/lib/libcrypto.so.14: error adding symbols: \
DSO missing from command line


# 1.327 04-Apr-2020 christos

Fix kerberos libraries order


# 1.326 04-Apr-2020 christos

Add libgnuctf


# 1.325 03-Mar-2020 christos

Add fido and cbor


Revision tags: is-mlppp-base phil-wifi-20191119
# 1.324 18-Nov-2019 christos

Improve the script to check for installed libraries, and fix the wrong
names and obsolete libraries it found.


# 1.323 27-Aug-2019 kamil

Enhance the support of LLVM sanitizers

Define _REENTRANT for MKSANITIZER build. This is needed for at least stdio
code. This caused new build issued with duplicated symbols in few places
and rump kernel code picking different code paths borrowed from libc.
Handle all this in one go.

Add bsd.sanitizer.mk to share common code used by programs and libraries.

Switch from realall to beforeinstall target in .syms files. This is more
reliable in MKSANITIZER.


# 1.322 17-Aug-2019 kamil

Add PAXCTL_FLAG rules for MKSANITIZER

Add per-program rules to disable ASLR for ASan, TSan and MSan in all
sanitized programs. This flag is not needed for other supported sanitizers.

Without this change, sanitized init(8) dies early on startup.

Approach originally suggested by <joerg>


# 1.321 15-Aug-2019 kamil

Add SANITIZER_RENAME_CLASSES in bsd.prog.mk

This adds a more flexible version of SANITIZER_RENAME_SYMBOL.

New symbol allows to specify MKSANITIZER specific renames on per-file and
per-symbol basis.


# 1.320 10-Aug-2019 christos

Make the X11 library lists consistent again.


Revision tags: netbsd-9-base phil-wifi-20190609 pgoyette-compat-20190127
# 1.319 21-Jan-2019 christos

branches: 1.319.2;
Most of the mv operations are to move temporary files to their final place.
Some use -f, others don't. This can lead to spurious build failures when
the user performing the build changes. Centralize, and always use -f.


Revision tags: pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.318 12-Aug-2018 christos

fix broken library variable definitions (inconsistencies between
bsd.README and bsd.prog.mk)


Revision tags: pgoyette-compat-0728
# 1.317 25-Jul-2018 kamil

Introduce MKLIBCSANITIZER in the share/mk rules

Add flags that are required to build a program and a dynamically loaded
library.

Propagade LIBCSANITIZERFLAGS to CFLAGS and CXXFLAGS.

LDFLAGS is not changed on purpose, as a libcsanitizer is inside libc
and no external dependencies are needed.

Register NOLIBCSANITIZER, as certain distribution parts will need to be
skipped.


# 1.316 12-Jul-2018 maxv

Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.


Revision tags: phil-wifi-base
# 1.315 25-Jun-2018 kamil

branches: 1.315.2;
Add a framework for renaming symbols in libc&co for MKSANITIZER

A new keyword SANITIZER_RENAME_SYMBOL. It's a variable that has specified
a list of symbols to be renamed in a processor in order to remove naming
conflicts with public symbols in libc/m/pthread/rt.

This renaming will occur for libraries and programs.
A symbol with a conflicting 'name', will be renamed to '__mksanitizer_name'.

Based on an idea by <christos>


Revision tags: pgoyette-compat-0625
# 1.314 21-Jun-2018 kamil

Refactor MKSANITIZER flags in mk rules

Introduce a new variable SANITIZERFLAGS that contains all the sanitizer
specific flags. These flags are designed to be passed to CFLAGS, CXXFLAGS
and LDFLAGS.

Pass SANITIZERFLAGS in bsd.prog.mk rules to CFLAGS, CXXFLAGS and LDFLAGS.

Pass SANITIZERFLAGS in bsd.lib.mk rules to *_pic.a build flags. The *_pic.a
libraries are designed to construct .so libraries. All .so libraries with
few exceptions are expected to be prebuilt with a sanitizer. Another
purpuse of *_pic.a files can be constructing static PIE programs, however
they are not supported as of now and there is no sanitization of static
programs either.

Once MKSTATICPIE will be supported, it will be initially incompatible with
MKSANITIZER.

This change also makes it easier to build other targets like kernel and
kernel modules without userland sanitizers.

No functional change intended for MKSANITIZER=no users.


# 1.313 02-Jun-2018 christos

Sanitizers don't support static linking.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315
# 1.312 11-Mar-2018 mrg

define LIBXFONT2.


Revision tags: pgoyette-compat-base
# 1.311 25-Feb-2018 mrg

branches: 1.311.2;
add LIBKRB5_LDADD/LIBKRB5_DPADD and their static counterparts
to bsd.prog.mk. use them instead of hard coding various lists
of libraries for krb5.

this fixes static builds.


# 1.310 11-Dec-2017 christos

Instead of checking for obj existance which can be empty for shuttle-rule
programs, check for .sh sources.


# 1.309 10-Dec-2017 christos

don't try to build .debug files for shell scripts.


# 1.308 10-Oct-2017 christos

Add general {DP,LD}ADD.rump variables


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base
# 1.307 21-May-2017 riastradh

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.


# 1.306 21-May-2017 riastradh

Remove some vestiges of MKCRYPTO_IDEA/MKCRYPTO_MDC2.


# 1.305 21-May-2017 riastradh

Remove MKCRYPTO_RC5. Unconditionally include RC5 in libcrypto.so.

This option existed only because RC5 is covered by patents that, twenty
years ago, we had reason to suspect the patent holder, RSA, Inc., might
litigate. The two US patents in question are 5,724,428 and 5,835,600.

According to the USPTO Patent Term Calculator web site at
<https://www.uspto.gov/patent/laws-and-regulations/patent-term-calculator#heading-5>
(retrieved 2017-05-21), patents filed after 1995-06-07 expire twenty
years after the filing date.

number filing date
5,724,428 1995-11-01
5,835,600 1997-04-21

Thus, these patents appear to be expired.

As proposed on tech-crypto and tech-security:

https://mail-index.netbsd.org/tech-crypto/2017/05/05/msg000718.html
https://mail-index.netbsd.org/tech-security/2017/05/05/msg000927.html


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.304 19-Apr-2017 joerg

Add netpgpverify to the library list.


Revision tags: pgoyette-localcount-20170320
# 1.303 20-Feb-2017 rin

add missing LIBCXX


# 1.302 08-Feb-2017 kamil

libpthread_dbg(3) deletion from the base distribution

libpthread_dbg(3) is a remnant library from the M:N thread model
(pre-NetBSD-5.0) API to introspect threads within a process and for use
of debuggers.

Currently in the 1:1 model it's not used in GDB neither in LLDB and it's
not either planned to be used. It's current function to read pthread_t
structures is realizable within a regular debugger capable to
instrospect objects within a tracee (GDB, LLDB...).

Remaining users of this API can still use this library from
pkgsrc/devel/libpthread_dbg.

Sponsored by <The NetBSD Foundation>


# 1.301 29-Jan-2017 christos

add sqlite3 to statically linked libraries for pam.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914
# 1.300 20-Aug-2016 christos

branches: 1.300.2;
unbound additions


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.299 04-Apr-2016 joerg

branches: 1.299.2;
If the per-target LDSTATIC flag is set, don't include the PIE linker
flags as we currently don't support static PIE.


# 1.298 30-Mar-2016 martin

Pass -pie to cc, not -Wl,-pie. This way we have a chance to fix specs
for obscure corner cases like -pie -fPIE -static (used for
/usr/tests/lib/csu/h_initfini2 if building with MKPIE=yes).
While there also replace -fPIC with -fPIE for the PIE case, even if
it should be mostly equivalent.


# 1.297 12-Mar-2016 mrg

remove conditionals that are always true with GCC >= 4.8.


# 1.296 21-Feb-2016 christos

Add NODEBUG


# 1.295 31-Jan-2016 christos

Introduce NOPIE and NOCTF so that standalone programs build properly.


# 1.294 23-Jan-2016 christos

Define _KERNTYPES for things that need it.


# 1.293 07-Nov-2015 joerg

LIBEXECINFO


# 1.292 07-Jun-2015 matt

Make LIBCRT* depend on the right files if MLIBDIR from MKCOMPAT is defined.


# 1.291 01-Dec-2014 erh

PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilt
if any of their dependencies (i.e. the files they refer to) are changed.
This allows changes to transitive included headers to be handled properly.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.290 25-Mar-2014 ozaki-r

branches: 1.290.4;
Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.


Revision tags: riastradh-drm2-base3
# 1.289 09-Mar-2014 christos

let's see if the new dwarf library can handle dwarf 4


# 1.288 02-Mar-2014 christos

If we are compiling with -g and using gcc4.8 and dtrace downgrade
dwarf generation to version 2 for now.


# 1.287 15-Jan-2014 joerg

-Wl,-pie and -r don't agree with each other, so filter the former out.


# 1.286 11-Nov-2013 joerg

Relink binaries if crti.o changes.


# 1.285 29-Sep-2013 christos

Add libxcb


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.284 31-May-2013 mrg

add LIBX11_XCB; unfortunately since the library is named with a -
in it, we have to use an ugly hard coded assignment for now.
(could be cleaned up with more make variable magic i'm sure.)


# 1.283 04-Apr-2013 christos

ldopts should be before ldadd like everywhere else.


Revision tags: agc-symver-base
# 1.282 14-Feb-2013 christos

Since the libraries are produced with different MK flags than the programs,
we check for existance of the files instead of the MK flags.


# 1.281 14-Feb-2013 christos

Add PROGDPLIBS


# 1.280 26-Jan-2013 christos

CTFCONVERT me harder.


Revision tags: yamt-pagecache-base8
# 1.279 17-Jan-2013 christos

Now that we have separate debug sets, add -g if ${MKDEBUG} is set for
program builds since we don't need to install that symbol files.


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.278 24-Aug-2012 jmmv

branches: 1.278.2;
Allow DPADD to be specified on a per-program basis.


# 1.277 23-Aug-2012 joerg

Revert last, it breaks the tricks xsrc uses.


# 1.276 23-Aug-2012 joerg

Remove SHLIBINSTALLDIR and SHLINKINSTALLLIBDIR. Add rpath entries, if
SHLIBDIR differs from /usr/lib.


# 1.275 08-Aug-2012 christos

add MKRUMP by popular demand.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.274 29-Feb-2012 tron

Move "libexpat" from X11 into base which fixes PR lib/40346.
This change was approved by the Core Group.


# 1.273 21-Feb-2012 matt

Remove another ${SIZE}


# 1.272 20-Feb-2012 matt

Remove ${SIZE}


# 1.271 19-Feb-2012 matt

Add support for --combine with gcc.


Revision tags: netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2
# 1.270 05-Nov-2011 christos

branches: 1.270.2;
Add libtre


Revision tags: yamt-pagecache-base
# 1.269 16-Oct-2011 christos

branches: 1.269.2;
- no need to special-case libraries with weird characters.
- add a note about adding new libraries.


# 1.268 16-Oct-2011 christos

fix list of libraries to reflect reality.


# 1.267 10-Sep-2011 apb

Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.


# 1.266 27-Aug-2011 joerg

Add new "analyze" command to run clang's static analyzer in a directory
on all C/C++ files.


Revision tags: cherry-xenmp-base
# 1.265 26-Apr-2011 he

The new Heimdal adds -lwind and -lheimbase to the set of libraries,
so define the corresponding LIB* variables.
These are also needed in the PAM_STATIC_* variables, so add them there too.


# 1.264 11-Apr-2011 joerg

Adjust --sysroot related usage:
-Wl,-rpath does not expand =, so just drop it.

Drop -Wl,-rpath-link entries that duplicate the -Wl,-rpath entries, this
is done implicitly now that ld is built with sysroot support.

Use ${DESTDIR} explicitly for the remaining -Wl,-rpath-link entries.


# 1.263 10-Apr-2011 joerg

For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.


# 1.262 08-Mar-2011 jmmv

Revert previous (revision 1.261): it broke the build because PROG_CXX is
defined in terms of PROG, so later on we would end up with target duplicates
because both PROG_CXX and PROG were being converted to PROGS_CXX and PROGS.

Did not catch this earlier because the test build I did was not clean and
thus the duplicate targets did not have nasty effects.


# 1.261 07-Mar-2011 jmmv

Always convert PROG to its plural form independently of whether PROG_CXX
is defined or not. From Garrett Cooper in private mail.


Revision tags: bouyer-quota2-nbase
# 1.260 20-Feb-2011 jmmv

Define LIBATF_C and LIBATF_CXX to point to their corresponding .a files and
use these to properly set DPADD for test programs.


Revision tags: bouyer-quota2-base
# 1.259 13-Feb-2011 christos

add saslc


# 1.258 06-Feb-2011 joerg

Don't use -nostdinc or -nostdinc++ if this is included in a HOSTLIB.


# 1.257 17-Jan-2011 pooka

branches: 1.257.2;
Add rump bits to DPSRCS so that update builds work correctly.


Revision tags: matt-mips64-premerge-20101231
# 1.256 13-Dec-2010 pooka

befriend RUMPPRG with CRUNCHEDPRG


# 1.255 13-Dec-2010 pooka

Define RUMPPRG, which is just like PROG, except it additionally
builds a rump client with the name rump.${PROG}. The rump client
is not installed suid/sgid by default even if BINMODE is defined.


# 1.254 10-Dec-2010 joerg

Revert last, gcc(1) checks explicitly for -r on some platforms to disable
passing down --relax as well.


# 1.253 08-Dec-2010 joerg

gcc passes down -r directly to ld, so make it explicitly a linker option.


# 1.252 08-Dec-2010 joerg

Don't depend on ${CC} passing down -R to ld, use -Wl,-rpath explicitly.


# 1.251 08-Nov-2010 lukem

Preserve date on original shared library or program when stripping
the debug symbols and adding the debug-link to .debug.
Use '(rm -f file; false)' in the failure path to force failure.
Based on solution proposed by Nicolas Joly on tech-toolchain in July 2010.
Should fix PR toolchain/44046 from Andreas Gustafsson.


# 1.250 31-Oct-2010 mbalmer

Link Lua to the build and add the resulting files to the distribution sets.
Document the addition of Lua and the change we made to the default settings.


# 1.249 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.248 24-Apr-2010 lukem

When extracting separate debug symbols with MKDEBUG, there's no need
to leave the original file unstripped...


# 1.247 02-Mar-2010 darran

DTrace: Add CTF generation to the make framework. Only enabled when
MKDTRACE=yes.


# 1.246 14-Dec-2009 mrg

use "${CC} -r" not "${CC} -Wl,-r" as the latter fools GCC on some targets
and it ends up passing "-r -relax" to ld, which causes ld to barf.


# 1.245 14-Dec-2009 matt

Merge from matt-nb5-mips64


Revision tags: matt-premerge-20091211
# 1.244 08-Dec-2009 uebayasi

When PROGS / LIBS are used, you can pass each PROG / LIB specific parameters
to ${LD} via:

${LDADD.${PROG}}
${LDFLAGS.${PROG}}
${LDSTATIC.${PROG}}
${LDADD.${LIB}}
${LDFLAGS.${LIB}}

OTOH you can't pass parameters to ${CC}, because in suffix rules make(1) only
knows the name of ${.IMPSRC} and ${.TARGET}; it's users' responsivility to
define ${CC} parameters to all the sources of a given ${PROG} / ${LIB}.

Should address bin/42381.

(Bug in this commit log was pointed out by mrg@.)


# 1.243 27-Nov-2009 tsutsui

If CPPFLAGS or CXXFLAGS already contains -nostdinc or -nostdinc++,
don't add ${CPPFLAGS_ISYSTEM} or ${CPPFLAGS_ISYSTEMXX} to refer
${DESTDIR}/usr/include or ${DESTDIR}/usr/include/g++.

This change might cause errors on some MD stand dir, but in that case
each Makefile should be fixed to search proper system include paths
by -Ipath option in own CPPFLAGS.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.242 12-May-2009 plunky

remove libsdp as improved functionality has been enabled in libbluetooth.


# 1.241 10-Apr-2009 apb

Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links. They have no effect except when using a
metalog, in which case the information is added to the metalog. In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg. This should fix PR 24457 and PR 41155.


# 1.240 24-Nov-2008 cube

branches: 1.240.2;
Move cleanextra to the very ends in case another included file wants to add
to it even if it was initially empty.


Revision tags: netbsd-5-base matt-mips64-base2
# 1.239 19-Oct-2008 christos

branches: 1.239.2;
handle assembly files for MKPIE


# 1.238 16-Oct-2008 christos

Provide a way for a program to override the PIE flags.


# 1.237 15-Oct-2008 christos

don't compile/link libraries with pie


Revision tags: mjf-devfs2-base
# 1.236 02-Oct-2008 joerg

Hook up libfetch and pkg_install update.


Revision tags: wrstuden-revivesa-base-3
# 1.235 09-Sep-2008 joerg

Add MKSTRIPIDENT to remove the RCS IDs from binary programs and shared
libraries for space-constraint systems. The description is based on the
feedback of hubertf@, the logic on input from lukem@

This obsoletes the removal of LIBC_SCCS and SYSLIBC_SCCS for libc builds.


Revision tags: wrstuden-revivesa-base-2
# 1.234 28-Aug-2008 mrg

update a comment example


# 1.233 27-Aug-2008 rtr

use ${X11USRLIBDIR} instead of hard-coded /usr/X11R6/lib when building
${LIB.foo} vars


# 1.232 27-Aug-2008 lukem

Fix problem I introduced in rev 1.231 on 2008/08/25 where ${_PROGLDOPTS}
and -L${_GCC_LIBGCCDIR} were appearing in the link line before ${LDADD},
so -L${DESTDIR}/lib and -L${DESTDIR}/usr/lib were being used before
local -L library paths.
Fixes ntpd/ntpdate failure noticed by Valeriy E. Ushakov <uwe@NetBSD.org>


# 1.231 25-Aug-2008 lukem

Always link with: -Wl,-rpath-link,${DESTDIR}/usr/lib -L${DESTDIR}/usr/lib
Fixes problem with MKDYNAMICROOT=no triggered by libraries that depend
on other libraries.
Related to PR 33503.

Clean up setting of _CCLINK to always add the appropriate -B options.

Simplify the link rule for a program.


# 1.230 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.229 28-May-2008 lukem

add LIBLDAR_R (for completeness)


# 1.228 22-May-2008 lukem

Add MKLDAP, USE_LDAP, LIBLBER, LIBLDAP


Revision tags: hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-pf42-base
# 1.227 10-Apr-2008 tsutsui

branches: 1.227.2; 1.227.4;
Add libhx509 to PAM_STATIC_LDADD which is required by libkrb5.


# 1.226 22-Mar-2008 mlelstv

branches: 1.226.2;
Import Heimdal-1.1


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase matt-armv6-base hpcarm-cleanup-base
# 1.225 26-Dec-2007 jmmv

Make the clean target work when OBJS is set but PROG is not, as happens
for example in gnu/lib/crtstuff4. Reported by drochner@.


Revision tags: cube-autoconf-base
# 1.224 13-Nov-2007 jmmv

Fix typo that prevented MKDEBUG builds to work. Found by drochner@.


# 1.223 12-Nov-2007 jmmv

Add the ability to build multiple programs from a single directory

This adds support for a new set of variables, PROGS and PROGS_CXX, that
allow the developer to build multiple different programs from a single
source directory.


# 1.222 04-Nov-2007 tls

Remove MKPRIVATELIB from BIND libraries; move library reachover
directories and Makefiles from src/usr.sbin/bind to src/lib; make
BIND libraries build shared. Saves about 1MB-1.5MB per installed
executable, about 5MB for a base+etc minimal installation of NetBSD.


Revision tags: matt-mips64-base
# 1.221 29-Jul-2007 joerg

branches: 1.221.4; 1.221.6;
Add build glue for libarchive and update the various sets.


# 1.220 25-Jan-2007 perry

Before I completely forget the issue, convert "PROG_PAX" to the
better-named "PAXCTL_FLAGS".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.219 11-Nov-2006 christos

don't run paxctl if other commands were specified for that target.


# 1.218 10-Nov-2006 christos

if ${PROG_PAX} is defined, run paxctl on the binary after linking with
the value of the variable. This way, if you set:

PROG_PAX=+M

in /etc/mk.conf, you get what you deserve.


# 1.217 22-Oct-2006 pooka

libpuffs


# 1.216 09-Oct-2006 mrg

- clean up some comments to reality.
- retire LIBDCK, LIBG2C and (long broken) USE_LIBSTDCXX
- in bsd.hostprog.mk's LIBSTDCPP -> LIBSTDCC
- add LIBSUPCXX
- don't default USE_LIBSTDCXX or USE_GCC4 since they are
not used in the tree any where
- same with USE_XF86_4; retire it
- remove _SUPCXX handling in bsd.prog.mk

inspired by PR#26714.


Revision tags: abandoned-netbsd-4-base
# 1.215 23-Jul-2006 lukem

Implement MKDEBUG:
If "no", don't build and install separate debugging symbols
into /usr/libdata/debug.
Default: no


# 1.214 19-Jun-2006 gdamore

Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.


# 1.213 09-Jun-2006 christos

PR/33681: Scott Ellis: Building 'bc' with SHAREDSTRINGS=yes fails
We need CPPFLAGS too now.


# 1.212 11-May-2006 mrg

add support for ${OBJCOPTS} and ${OBJCOPTS}.<lib|prog|fn>.


# 1.211 20-Mar-2006 christos

There is always one more KRB4 thing to remove. (from Jukka Salmi)


# 1.210 20-Mar-2006 christos

Remove krb4 variables and libraries (Jukka Salmi)


# 1.209 16-Mar-2006 jwise

Now that we have real build system support for syspkgs, remove someone's
half-implemented idea of building `syspkgs' (really a few giant blobs of the
same granularity of the old sets) using install(1).


# 1.208 20-Jan-2006 christos

Add the world of libraries to the static pam build. Now static pam binaries
work.


# 1.207 09-Apr-2005 dsl

Report when we link a program into xxx.ro (before being crunched)


Revision tags: netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.206 04-Mar-2005 he

branches: 1.206.2; 1.206.4;
Introduce PAM_STATIC_LDADD and PAM_STATIC_DPADD. When compiling
with MKPIC=no, possibly because the target does not support shared
libraries, these include libraries required to resolve all symbols
which end up referenced from PAM-using applications. The libraries
presently required are -lcrypt, -lrpcsvc and -lutil.

Add use of these variables which are currently set up to use PAM,
so that they compile when MKPIC=no.

Also, in the telnetd case, reorder the order of the libraries, so
that libtelnet.a comes before -ltermcap and -lutil, again to fix
link error when MKPIC=no.

Discussed with thorpej and christos.


# 1.205 20-Feb-2005 christos

Add libradius


# 1.204 12-Jan-2005 lukem

If RESCUEDIR is defined, automatically add that to CPPFLAGS


# 1.203 08-Jan-2005 lukem

Implement <bsd.prog.mk> vars:
LIBASN1 LIBBSDMALLOC LIBG2C LIBPAM LIBSSH


# 1.202 04-Aug-2004 lukem

Revert most of previous, and move the LIB<libname>?= assignments
back to bsd.prog.mk from bsd.own.mk.

pkgsrc uses <bsd.own.mk>, and setting LIB<libname> in it causes
problems with various package builds.
This should fix PR #26542 submitted by Jim Bernard.

(I'll be implementing the DPADD for shared libraries in a different
manner that generally won't depend upon ${LIB<libname>}.)


# 1.201 30-Jul-2004 lukem

Move the LIB<libname>?= assignments from bsd.prog.mk to bsd.own.mk so
that they may be used by non PROGs (e.g., LIBs).

Improve some comments.


# 1.200 10-Jun-2004 lukem

Be consistent in handling YHEADER, similar to Christos' fix in bsd.lib.mk 1.253


# 1.199 21-May-2004 ross

If you add a library, you need to define its DPADD symbol here.

Add LIBMAGIC.


Revision tags: netbsd-2-0-base
# 1.198 15-Feb-2004 skrll

branches: 1.198.2;
Be more gcc like in the way we deal with libgcc so that sh3/hppa millicode
and exception handling have a chance of working properly.

- creates libgcc, libgcc_eh and libgcc_s

- updates LIBGCC_SPEC to use them appropriately.

There's a hack in here at the moment with respect to libgcc_so in that it
is preferable to link against libgcc_so will only when -shared-libgcc is
specified (the c++ frontend does this automatically.) Configurations where
LINK_EH_SPEC is defined already do this. The gcc configuration for
NetBSD/alpha and another NetBSD platform (I forget which) actually define
LINK_EH_SPEC probably by accident rather than design.

- updates share/mk to use the compiler's knowledge of what needs linking into
libraries and executables. This removes an hppa hack.

- updates the sets for the newly created libgcc* files.

- support for linking against the _pg version of libgcc has been removed.


# 1.197 29-Jan-2004 lukem

Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.


# 1.196 27-Jan-2004 lukem

Replace
:M-[IDU]*
with
:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)


# 1.195 23-Jan-2004 simonb

crt0.o lives in /usr/lib even on a.out.


# 1.194 16-Nov-2003 lukem

simplify with _MKTARGET_LINK


# 1.193 11-Nov-2003 dsl

Set MKDEP_SUFFIXES to get additional targets in .depend instead of using
sed in .afterdepend. I don't think .afterdepend is used anywhere any more.


# 1.192 21-Oct-2003 lukem

Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.


# 1.191 19-Oct-2003 lukem

Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} " ... {$.TARGET}" and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO


# 1.190 18-Oct-2003 lukem

Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command ("verbose")
This is the default, and is equivalent to the previous behaviour.


# 1.189 29-Sep-2003 lukem

Add LIBSTDCXX (for usr/lib/libstdc++.a).
Sync LIB* documentation with reality.


# 1.188 19-Sep-2003 martin

Drop explicit medlow model and default to -O2 for sparc64.


# 1.187 14-Sep-2003 lukem

Check ${SHLIBDIR} against "/usr/lib" instead of ${LIBDIR} when determining
if we need to add stuff (usually "/lib") to the rpath-link path before
"/usr/lib". Otherwise, this barfs if LIBDIR != /usr/lib or /lib, and
we're cross-building (e.g., in src/x11)


# 1.186 13-Sep-2003 erh

Also support per-program LDFLAGS and LDSTATIC.


# 1.185 13-Sep-2003 erh

Create a way to add additional flags to COPTS, CPPFLAGS, CXXFLAGS and LDADD
for particular libraries or programs by specifying the additions in mk.conf
instead of needing to go edit individual Makefiles.


# 1.184 12-Sep-2003 lukem

add infrastructure to support reach-over builds of xsrc


# 1.183 22-Aug-2003 dsl

Add a ${PROG}.ro target that does an 'ld -r' of the program object files.
Allows a much simplified build of 'crunched' binaries since crunchgen can
build prog.ro instead of having to deretmine the names of all the .o files.


# 1.182 01-Aug-2003 lukem

Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".


# 1.181 01-Aug-2003 lukem

simplify the ${PROG}: target to reduce duplication between the DESTDIR
and !DESTDIR cases...


# 1.180 31-Jul-2003 lukem

bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.


# 1.179 31-Jul-2003 lukem

Don't need -R/usr/lib; it will be searched at the end by ld.elf_so anyway.
Noted by matt green <mrg@>


# 1.178 28-Jul-2003 lukem

be consistent when adding *.y and *.l to DPSRCS


# 1.177 28-Jul-2003 lukem

replace MKCXXSUPCXX(!=no) with USE_LIBSTDCXX(==no)


# 1.176 28-Jul-2003 lukem

Change defined(CXX_SUPCXX) to MKCXXSUPCXX != "no".

Clarify that command-line overrides of the MKxxx variables should be
done via the environment rather than make(1) command-line variable
assignment, since the latter doesn't actually work as intended.


# 1.175 27-Jul-2003 mrg

introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes. for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)


# 1.174 26-Jul-2003 mrg

add a new bsd.own.mk variable: CXX_SUPCXX. from bsd.README:
+ CXX_SUPCXX If defined, the support libraries needed for this C++ program
+ are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.


# 1.173 20-Jul-2003 lukem

Consistently support the different C++ file extensions: .cc .cpp .cxx .C
Noted by Andrew White in PR toolchain/18246


# 1.172 18-Jul-2003 lukem

Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was defined.
Replace defined(UNPRIVED) tests with ${MKUNPRIVED} != "no"

Add MKUPDATE; if not no has the same semantics as if UPDATE was defined.
Replace defined(UPDATE) tests with ${MKUPDATE} != "no"

Improve documentation for these and other make flags.


# 1.171 16-Jul-2003 itojun

stop installing install libtelnet. build under lib/libtelnet and reference
it from usr.bin/telnet and libexec/telnetd.
(reason for separate build: compiler flags)


# 1.170 27-Jun-2003 drochner

For consistency, use "-R" instead of "-Wl,-rpath" to pass
a runtime search path to the linker.


# 1.169 13-Jun-2003 itojun

define LIBEVENT


# 1.168 11-Jun-2003 msaitoh

catch signal 1,2,3,13 and 15 to clean /tmp/_dependXXX


# 1.167 31-May-2003 thorpej

If EXTERNAL_TOOLCHAIN is defined, allow the compiler to define the
location of crt{begin,end}{,S}.o and libgcc.a. Encapsulate all of
this logic into the new bsd.gcc.mk, and use it in bsd.prog.mk and
bsd.lib.mk.


# 1.166 18-May-2003 lukem

make this a no-op if HOSTPROG is defined


# 1.165 30-Mar-2003 thorpej

If MACHINE_ARCH is powerpc and we HAVE_GCC3, add crtsaveres.o to the
endfile spec.


# 1.164 22-Feb-2003 uwe

Typo in comment.


# 1.163 24-Jan-2003 thorpej

Add LIBPTHREAD, LIBPTHREAD_DB, and LIBRT.


Revision tags: fvdl_fs64_base
# 1.162 22-Nov-2002 thorpej

Split crtbegin/crtend into crti/crtbegin/crtend/crtn. NetBSD-specific
things like the .note.netbsd.ident section are provided by crti/crtn.
crti/crtn also provide the _init() and _fini() routines.

crtbegin/crtend now only provide support for ctors/dtors. This paves
the way to using the "crtstuff" provided with GCC (when we upgrade to
GCC 3.3), which provides, among other things, much better C++/Java
exception handling.


# 1.161 12-Nov-2002 itohy

MKDYNAMICROOT for a.out


# 1.160 22-Oct-2002 perry

Pass 1 of SYSPKG changes to automatically add tags=pkgname_pkg to METALOG.
Not quite ready for prime time yet.


# 1.159 27-Sep-2002 thorpej

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.


# 1.158 26-Sep-2002 itojun

MDC2 is a patented algorithm; don't ship it in default libcrypto.
MKCRYPTO_MDC2 will build a separate library, libcrypto_mdc2.


# 1.157 08-Sep-2002 thorpej

Build a .gdbinit in the objdir when building a program. The .gdbinit
file sets the shared library prefix to ${DESTDIR}, and adds "sources"
directives for each file listed in the GDBINIT Makefile variable.


# 1.156 09-Aug-2002 thorpej

Add LIBPMC.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.155 27-Mar-2002 eeh

branches: 1.155.2;
Use the medium low model for sparc64 programs that don't 2GB of data segment.


# 1.154 11-Feb-2002 mycroft

Don't use .PHONY for targets that are actually installed. Instead use force
dependencies. (Among other things, `make -t install' does something vaguely
sensible now.)


# 1.153 07-Feb-2002 pk

Mark installed system libraries as .MADE only if we're actually establishing
their default variable values here.


# 1.152 04-Feb-2002 christos

s/.NOSUFF/.MADE/


# 1.151 03-Feb-2002 christos

Apply a .NOSUFF: directive to targets we don't want to have processed by
the suffix rules engine.


# 1.150 02-Feb-2002 veego

Ups, it is LIBUSBHID and not LIBUSBHIB.


# 1.149 02-Feb-2002 veego

Change LIBUSB to LIBUSBHIB, reflecting the library name change.


# 1.148 29-Jan-2002 enami

Mark the targets clean{extra,objs} as PHONY.


# 1.147 04-Jan-2002 thorpej

For PROG_CXX DESTDIR builds, pull in -lstdc++ and -lm regardless
of GCC version.


# 1.146 01-Jan-2002 thorpej

Per a suggestion from matthew green, PROG_CXX takes the place of
PROG for C++ programs.


# 1.145 01-Jan-2002 thorpej

* If PROG_CXX is set by the program's Makefile, use ${CXX} to link
the program rather than ${CC}.
* If HAVE_GCC3 is defined, pull in "-lstdc++ -lm" as additional C++
support libraries for DESTDIR builds.


# 1.144 28-Dec-2001 lukem

* 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


# 1.143 28-Nov-2001 tv

If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.


# 1.142 19-Nov-2001 thorpej

Use a little transitional hack to determine if we use -isystem
or -idirafter. Use the former only of USE_NEW_TOOLCHAIN, since
-isystem causes the old toolchain to bomb out when building
libstdc++.


# 1.141 14-Nov-2001 tv

C/..$/.c/ -> C/\..$/.c/


# 1.140 14-Nov-2001 tv

Move the DESTDIR-based nostdinc logic to bsd.lib.mk and bsd.prog.mk where
it belongs (with the native target compile rules).


# 1.139 02-Nov-2001 tv

Use INSTALL_FILE/INSTALL_DIR as appropriate.


# 1.138 02-Nov-2001 tv

Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.


# 1.137 19-Oct-2001 tv

Add .NOPATH for all files generated from .l or .y files in SRCS. Fixes PRs
bin/14187 and lib/14239.

Also simplify the handling of these transforms to .c and .h files a bit by
leveraging make's builtin macro operators.


# 1.136 25-Sep-2001 tv

Set .NOPATH on program to build to make sure it goes in .OBJDIR.
Problem noted by <seebs@plethora.net>.


# 1.135 24-Sep-2001 lukem

fix previous (hi thor!) - $OBJS and $CLEANFILES might be empty, and
rm needs some files to delete...


# 1.134 24-Sep-2001 tls

Split "cleanprog" target apart: now you can zap only object files or
CLEANFILES (needed to fix crunchgen lossage).


# 1.133 13-Sep-2001 thorpej

Add LIBPCI.


# 1.132 14-Aug-2001 tv

Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").


# 1.131 01-Jun-2001 tv

Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).


# 1.130 08-May-2001 sommerfeld

Suppress duplicate entries in ALLFILES, FILES, INCS, DEPINCS, INFOFILES,
NLSALL, CATPAGES, MANPAGES, HTMLPAGES, and SCRIPTS.


# 1.129 19-Feb-2001 jmc

Wrap target() checks around afterdepend rule as some Makefiles override this


# 1.128 26-Jan-2001 itojun

fix typo in LIBSSL decl. it made programs with DPADD+=${LIBSSL} to build
every time we type "make". From: bernd


# 1.127 14-Jan-2001 christos

use the new .if commands(<target>) directive so that we don't have to
change Makefiles.


# 1.126 14-Jan-2001 christos

fix thinko: test for the existance of the target before we define it...


# 1.125 14-Jan-2001 christos

Alter previous redefined target protection. If the ${PROG} target is defined,
add the dependencies as usual, but don't add the commands. This avoids
having to change all the Makefiles that redefine the PROG target.


# 1.124 14-Jan-2001 christos

allow programs to override the program target.


# 1.123 08-Jan-2001 mrg

add missing $LIBCRYPTO_RC5 and $LIBCRYPTO_IDEA


# 1.122 08-Jan-2001 mrg

add missing $LIBSSL


# 1.121 04-Jan-2001 garbled

Add LIBCDK and LIBFORM definitions


# 1.120 31-Oct-2000 itojun

add ${LIBINTL} for use with DPADD.


# 1.119 07-Oct-2000 deberg

fix typos, PR 11159


# 1.118 25-Jun-2000 erh

For the case when DESTDIR is set: move the -L${DESTDIR}/usr/lib after ${LDADD} so any -L directories set in LDADD are searched first to avoid possibly linking against old versions of libraries.


Revision tags: netbsd-1-5-base
# 1.117 19-Jun-2000 thorpej

branches: 1.117.2;
Sync up the LIB* list.


# 1.116 10-Jun-2000 mycroft

Use ${.ALLSRC:T} when doing the generated variable name lookups, so that it
DTRT for generated files in and obj directory (or accessed via .PATH).


# 1.115 06-Jun-2000 mycroft

Abuse .USE some more.


# 1.114 06-Jun-2000 mycroft

Minor rearrangement.


# 1.113 06-Jun-2000 mycroft

Use ODE make(1) features to eliminate extra variables and move several things
outside of .for loops. (Needs more work to completely eliminate .for.)

XXX Don't look at this stuff. It will make your head hurt.


Revision tags: minoura-xpg4dl-base
# 1.112 14-Apr-2000 mrg

branches: 1.112.2;
use -rpath-link rather than -R when linking objects using a DESTDIR.
this replaces the previous change as that ended up adding
$DESTDIR/usr/lib to the runtime path of every binary created, which
is bogus and dangerous.


# 1.111 25-Mar-2000 mycroft

When linking with $DESTDIR, use an explicit -R to get library dependencies
correct.


# 1.110 07-Mar-2000 veego

Remove unused libahdi.
It will be replaced in the future with a more generic libdisklabel.


# 1.109 05-Feb-2000 jdc

Add libahdi entries.


# 1.108 23-Jan-2000 eeh

Add some support for FCode binaries.


# 1.107 22-Jan-2000 mycroft

Make `dependall' play nicely with SUBDIR, using a hack similar to `realinstall'
for both `depend' and `all'.
Also, remove the old hack that invokes an extra shell for .depend, now that
make(1) has been fixed.


# 1.106 16-Jan-2000 assar

all: depend on ${SCRIPTS} so that they get generated if they need to


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.105 23-Nov-1999 blymn

Added libmenu library.


Revision tags: comdex-fall-1999-base
# 1.104 14-Sep-1999 perry

branches: 1.104.4;
Add a "dependall" target, which does a "make depend" and then "make all"
in a single directory. This is useful in "make build" because by doing
the build immediately after the depend, all sources will typically
still be in the buffer cache, thus saving significant time over doing
a "make depend" on all the directories and then a "make all".


# 1.103 04-Sep-1999 fredb

Permit "make all install", as well as "make foo install" (where foo would be
installed by "make install") without setting of BUILD. All cases where BUILD
is already set are unchanged from the old behavior.

"make all install" is now practically equivalent to "make BUILD= all install",
but without actually setting build.

Fixes pr's 8313, 3894.


# 1.102 21-Aug-1999 simonb

Add ${INSTPRIV} to ${INSTALL} commands.


# 1.101 01-Jul-1999 itojun

branches: 1.101.2;
add LIBIPSEC for use from DPADD.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.100 12-Feb-1999 lukem

branches: 1.100.2;
* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.99 10-Feb-1999 tv

libbfd_pic.a is no longer installed; remove ${LIBBFD} define.


# 1.98 04-Feb-1999 christos

PR/2936: Brian C. Grayson: Avoid truncating precious files when installing
and the filesystem is full. Added ${RENAME} flag to install, which when set
to -r installs on a temporary file and then renames to the final destination.
${RENAME} is currently set to nothing in bsd.own.mk, but one can turn it
on in /etc/mk.conf.


# 1.97 07-Nov-1998 jonathan

Do DESTDIR support for crtbegin/crtend on all ELF ports (adds mips).


# 1.96 28-Sep-1998 christos

Use preserve flag in install.


# 1.95 10-Sep-1998 ross

Define a LIBBZ2?=... for use in DPADD=... lines.


# 1.94 09-Aug-1998 lukem

add distclean as a synonym for cleandir


# 1.93 09-Apr-1998 tv

.y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.


# 1.92 01-Apr-1998 tv

Revert. This broke too much in the build tree, and a better solution
needs to be created. (The existing situation breaks a lot too.)


# 1.91 01-Apr-1998 tv

Fix .y rules to DTRT with possibly generated .h files. See mail on
tech-toolchain for a very detailed explanation of this. In short, add
a .y.h rule identical to the .y.c rule and make the .y.c rule rename
the .h file; also, clean the .h file in CLEANFILES.


# 1.90 03-Nov-1997 cgd

echo the lint command line when making 'lint'.


# 1.89 28-Oct-1997 lukem

add ${LIBOBJC}


Revision tags: netbsd-1-3-base
# 1.88 11-Oct-1997 mycroft

branches: 1.88.2;
Several changes:
* Allow bsd.man.mk to be included separately.
* Always include bsd.own.mk and bsd.obj.mk.
* Include bsd.man.mk and bsd.nls.mk even if NOMAN or NONLS; just turn off
building of the affected files instead.
* Require bsd.subdir.mk to be included explicitly.
(Will make appropriate changes to Makefiles shortly.)


# 1.87 29-Sep-1997 gwr

Add $LIBBFD


# 1.86 31-May-1997 cjs

Back out BUILDDIR and NOINSTALL changes.


# 1.85 26-May-1997 cjs

branches: 1.85.2;
These updates to the build allow building against include files
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.


# 1.84 18-May-1997 kleink

Add libposix.


# 1.83 17-May-1997 mycroft

Do LINKS and SYMLINKS after FILES and INCS.


# 1.82 17-May-1997 mycroft

Remove unneeded .SUFFIXES lines, and move .s and .S closer to .o to give the
right preferences.


# 1.81 09-May-1997 mycroft

Fix typo in previous.


# 1.80 09-May-1997 mycroft

Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.79 09-May-1997 mycroft

Remove cruft.


# 1.78 09-May-1997 mycroft

Oops; rearrange dependencies to get things built early enough.


# 1.77 09-May-1997 mycroft

Make sure INCS and SRCS are built if necessary.


# 1.76 08-May-1997 gwr

Set the .NOPATH flag for ${OBJS} (from Christos).


# 1.75 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.74 07-May-1997 mycroft

Various simplifications.


# 1.73 07-May-1997 mycroft

Shuffle some .PHONYs around, to work better with `-t'.


# 1.72 06-May-1997 mycroft

Make most of the install targets .PRECIOUS.


# 1.71 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.70 18-Apr-1997 christos

Add ${LIBNTP}


# 1.69 17-Apr-1997 thorpej

- Properly depend on crtbegin.o and crtend.o for platforms that use
them (currently Alpha and PowerPC)
- STRIP -> STRIPFLAG


# 1.68 03-Apr-1997 mikel

don't allow override of all: target


# 1.67 29-Mar-1997 mikel

merge lite-2 changes (mostly SCCSids)


# 1.66 27-Mar-1997 christos

Put the FILES generated rules in a separate .mk file since both bsd.prog.mk
and bsd.lib.mk use them.


# 1.65 27-Mar-1997 mycroft

Make the SCRIPTS case mimic the FILES case more closely, so we can override
the destination direectory, etc.


# 1.64 27-Mar-1997 mycroft

Remove knowledge of HIDEGAME from here.


# 1.63 24-Mar-1997 christos

make rules update:
- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation


# 1.62 22-Mar-1997 perry

Fix SYMLINKS not to include DESTDIR in the link itself


# 1.61 13-Mar-1997 perry

add SYMLINKS, by analogy to LINKS. Vetted by Christos.


# 1.60 22-Jan-1997 cgd

if 'clean' is not already defined, rather than simply defining it with
a bunch of rules, define a clean{kmod,lib,prog} target with the rules,
and have both clean and cleandir depend on that. That eliminates a bug
where 'cleandir' in a directory which included e.g. bsd.prog.mk but which
also had subdirs would 'make clean' all the subdirs and then 'make cleandir'
all ofthe subdirs. It also allows Makefiles to add more dependencies
to 'clean' after inclusion of the make template.

If 'clean' is already defined, the behaviour is the same as it used to be.


# 1.59 20-Dec-1996 cgd

add an afterdepend target (a la the one in bsd.lib.mk) that processes
the .depend file to add <filename>.ln for each <filename>.o as an
object file which has the given dependencies (in addition to
<filename>.po and <filename>.so, which were already there).


# 1.58 13-Dec-1996 mikel

add missing LIBPCAP definition.


# 1.57 26-Nov-1996 mrg

add libz and libwrap


# 1.56 18-Oct-1996 thorpej

Use ${INSTALL} rather than "install".
From Simon J. Gerraty <sjg@zen.void.oz.au>, PR #1458.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.55 08-Apr-1996 jtc

Sort LIBFOO definitions and add LIBY; Reported by Mike Long <mike.long@analog.com> in PR #2301.


# 1.54 22-Oct-1995 christos

Added include file <bsd.sys.mk> that contains lex and yacc "parallel aware"
rules. These rules are not turned on by default; they are enabled by setting
the PARALLEL variable.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.53 25-Jun-1995 cgd

oops; fix an rm that might be empty


# 1.52 24-Jun-1995 cgd

update lint rules, but keep linting disabled


# 1.51 10-Jun-1995 mycroft

Define LIBEDIT.


# 1.50 21-Apr-1995 jtc

.include <bsd.nls.mk> unless NONLS is defined.


# 1.49 22-Dec-1994 cgd

specify man pages differently, and document how.


# 1.48 24-Aug-1994 mycroft

Include bsd.own.mk earlier.


# 1.47 20-Jul-1994 cgd

fix from christos, for progs w/o objects


Revision tags: netbsd-1-0-base
# 1.46 06-Jul-1994 mycroft

branches: 1.46.2;
Pull libraries from ${DESTDIR} if set. Kill LDONLY, which is unused and
probably not useful anyway.


# 1.45 30-Jun-1994 cgd

fix modify-info-nothingness-then-substitute probelm that broke genclass build


# 1.44 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.43 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.42 28-Jun-1994 jtc

Strip *.sh when constructing OBJS from SRCS.
This will allow us to clean up makefiles that build a script by munging
a template (uusched, genclass, neqn, etc.).


# 1.41 18-Jun-1994 cgd

don't chown the symlink, when HIDEGAME causes a symlink to be made to dm.
4.4-based FS code _follows_ the symlinks on a chown(2) call.


# 1.40 24-May-1994 cgd

fix the last to do the right thing for dependencies


# 1.39 24-May-1994 deraadt

LIBSKEY


# 1.38 22-May-1994 jtc

Single source file programs are now compiled into object files before they
are linked. This change halves the time it takes to rebuild all of the
NetBSD sources when only the C library is "touched"; but only takes about
one percent more disk space.


# 1.37 06-Apr-1994 chopps

relink (recompile) single source programs when crt0.o is updated.


# 1.36 24-Mar-1994 mycroft

Remove *.core on clean.


# 1.35 09-Feb-1994 cgd

kill install -d's.


# 1.34 28-Jan-1994 cgd

add LIBKVM


# 1.33 10-Nov-1993 cgd

librpc doesn't exist anymore


# 1.32 08-Nov-1993 cgd

ad LDSTATIC flag, so static linking can be made one-stop shopping.
use "setenv LDSTATIC" to make *everything* dynamically linked,
setenv LDSTATIC -static for everything statically linked, or unset
it for default behavior.


# 1.31 07-Oct-1993 cgd

LIBTERM pointed at nothing, but was meant to point to libtermcap.a...


# 1.30 07-Oct-1993 cgd

always define LIBCRYPT


# 1.29 17-Aug-1993 mycroft

Make sure we don't recurse into subdirectories if Makefile specified `install'
target. (It's usually blank and is specifically to avoid doing this...)


# 1.28 15-Aug-1993 mycroft

Automatically include bsd.subdir.mk for backward compatibility.


# 1.27 15-Aug-1993 mycroft

Don't automatically include bsd.subdir.mk in bsd.prog.mk and bsd.lib.mk.
Put back .MAIN in bsd.man.mk, and be careful not to include ../Makefile.inc
a second time.


# 1.26 15-Aug-1993 mycroft

Move man rules to sys.mk.
Use bsd.subdir.mk for building subdirectories.
Don't forget to remove x.cc and x.C when using SHAREDSTRINGS.
Make ${PROG} always depend on ${LIBCRT0}.
Don't duplicate code between cleandir and clean.
Move tags target to bsd.dep.mk.
Move STRIP to bsd.own.mk.
Remove redundant definitions of {BIN,MAN}{DIR,GRP,OWN,MODE}.
Move {LIB,DOC}{DIR,GRP,OWN,MODE} defaults to bsd.own.mk.


# 1.25 15-Aug-1993 mycroft

Abstract out dependency stuff, and add RCS identifiers.


# 1.24 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


# 1.23 10-Aug-1993 mycroft

Put LINKS handling in `install' target, so it's the last thing executed, and
happens even if `realinstall' is user-defined.


# 1.22 30-Jul-1993 mycroft

When generating a default OBJS, ignore .h files.


# 1.21 29-Jul-1993 mycroft

Don't print the `making ...' message if an obj dir already exists.
Also, a minor cleanup.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.20 17-Jul-1993 mycroft

Fix C++ dependencies for good. `make depend' is now done in two passes--one
of C files and one for C++ files. No need to specify `-+' in your Makefile,
as it is now done automatically.


# 1.19 17-Jul-1993 cgd

do c++ dependencies the right way...


# 1.18 17-Jul-1993 mycroft

Add suffix rules for C++ files.


# 1.17 04-Jun-1993 brezak

Add LIBRPCSVC variable.


# 1.16 02-Jun-1993 cgd

add ability to specify c++ dependencies, by setting CFLAGS+=-+ for
the dependency make.


# 1.15 26-Apr-1993 cgd

added definition for DPADD library variable LIBCRYPT.


# 1.14 26-Apr-1993 mycroft

Don't redefine `realinstall' target if already defined.


# 1.13 25-Apr-1993 mycroft

Link with LDFLAGS even if one source module.


# 1.12 25-Apr-1993 mycroft

Don't lose if we include bsd.prog.mk only to build man pages.


# 1.11 25-Apr-1993 mycroft

Fix error in last change. (Oops.)


# 1.10 25-Apr-1993 mycroft

Don't build man pages if NOMAN set.


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.9 09-Apr-1993 cgd

various changes to default make rules. from patch 101.
note that only the "sensible" changes in patch 101 are implemented.


# 1.8 08-Apr-1993 cgd

try to do the right thing, in terms making directories before we
install into them, and get the manpage cleans _OUT_ of "clean".
they don't belong there, only in cleandir, WFJ be damned.


# 1.7 08-Apr-1993 cgd

fixed typos...


# 1.6 08-Apr-1993 cgd

(silently) make sure we have directories before installing


# 1.5 04-Apr-1993 cgd

make LIBRPC point to the right place


# 1.4 27-Mar-1993 nate

Fixed the doc macros to call troff, eqn,and tbl instead of ditroff,
deqn, and dtbl.
Fixed make clean to remove the man pages (Bill fixed this in the distribution,
but not in the original source)
Changed install to leave the original file around, by using 'cp' instead of
'mv'. "install -c ..."


# 1.3 23-Mar-1993 cgd

made .CURDIR be absolute, not relative, thereby eliminating
the need for some of the makefile trickery when making objects,
and fixing a few .PATH bugs


# 1.2 22-Mar-1993 cgd

fixed "make obj" for cases when sources not in /usr/src/...
if sources not there, it now mkdirs obj, but some trickery
is necessary, to avoid deleting cwd.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.345 28-May-2023 lukem

share/mk: finish USE_COMBINE, NOCOMBINE deprecation

Remove the leftover remnants of deprecated USE_COMBINE and NOCOMBINE,
as gcc -combine has been EOL for many years.

Completes the work done by maya@ on 2019-05-10 in bsd.kmodule.mk rev 1.61.


# 1.344 24-May-2023 lukem

deprecate SHAREDSTRINGS build option

Hasn't worked for at least 20 years (and never in the cross-build environment,
nor did it work with parallel make), and has never been needed in NetBSD as we
don't have the older BSD programs (pascal, pre-nvi ex) that needed mkstr/xstr
on PDP-11.

PR toolchain/35964


# 1.343 08-May-2023 christos

remove stuff accidentally committed


# 1.342 07-May-2023 christos

Provide a hook to link in libraries statically in PROGDPLIBS.
OpenSSL protects the symbols in the shared object via a linker
script, but programs and tests need those protected symbols, so
they either must link against the archive, or I need to expose the
symbols. For now, I chose to expose the symbols. Note that we
cannot use -Bstatic -Lpath -llibrary -Bdynamic because this seems
to be broken with collect2 and so we use the path directly.


Revision tags: netbsd-10-base
# 1.341 14-Jul-2022 mrg

add libxcvt.


# 1.340 28-Nov-2021 christos

When we build against DESTDIR, add the lint library path for DESTDIR during
the link phase for lint.


# 1.339 23-Aug-2021 mrg

define variables for the libxcb-* libraries.


# 1.338 15-Aug-2021 christos

Fix sun2 build for ldap/gssapi


# 1.337 14-Aug-2021 christos

Centralize the ldap libraries


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.336 12-Nov-2020 nia

Revert addition of pthread dependency on sqlite.

It is less trivial than expected and introduced some surprising breakage.


# 1.335 09-Nov-2020 christos

- make the CTFCONVERT command lines consistent and concise by putting all
the implementation stuff in a variable CTFCONVERT_RUN
- introduce an OBJECT_TARGET variable that contains the output object file
- when we need to run ctfconvert, go through an intermediate ${.TARGET}.o
file, instead of writing directly to ${.TARGET} and then overwriting
${.TARGET} with ctfconvert. This avoids build failures after a build
got interrupted (the "partially built from C" scourge).


# 1.334 09-Nov-2020 martin

Adapt for sqlite requiring pthreads now


# 1.333 30-Oct-2020 martin

libsqlite3 now requires -lm


# 1.332 16-Oct-2020 nia

share/mk: Define some missing X11 libraries.


# 1.331 15-Jun-2020 christos

Rename blacklist -> blocklist


# 1.330 30-May-2020 christos

Make libuv private, requested by joerg@


# 1.329 24-May-2020 christos

Add libuv


Revision tags: phil-wifi-20200421 phil-wifi-20200411 phil-wifi-20200406
# 1.328 04-Apr-2020 christos

Linker semantics have changed; we now don't automatically link dependent
libraries from other DSO's. For example in /usr/bin/passwd:
ld: krb5_passwd.o: undefined reference to symbol \
'UI_UTIL_read_pw_string@@OPENSSL_1_1_0'
ld: /usr/obj/amd64-x86_64/release/lib/libcrypto.so.14: error adding symbols: \
DSO missing from command line


# 1.327 04-Apr-2020 christos

Fix kerberos libraries order


# 1.326 04-Apr-2020 christos

Add libgnuctf


# 1.325 03-Mar-2020 christos

Add fido and cbor


Revision tags: is-mlppp-base phil-wifi-20191119
# 1.324 18-Nov-2019 christos

Improve the script to check for installed libraries, and fix the wrong
names and obsolete libraries it found.


# 1.323 27-Aug-2019 kamil

Enhance the support of LLVM sanitizers

Define _REENTRANT for MKSANITIZER build. This is needed for at least stdio
code. This caused new build issued with duplicated symbols in few places
and rump kernel code picking different code paths borrowed from libc.
Handle all this in one go.

Add bsd.sanitizer.mk to share common code used by programs and libraries.

Switch from realall to beforeinstall target in .syms files. This is more
reliable in MKSANITIZER.


# 1.322 17-Aug-2019 kamil

Add PAXCTL_FLAG rules for MKSANITIZER

Add per-program rules to disable ASLR for ASan, TSan and MSan in all
sanitized programs. This flag is not needed for other supported sanitizers.

Without this change, sanitized init(8) dies early on startup.

Approach originally suggested by <joerg>


# 1.321 15-Aug-2019 kamil

Add SANITIZER_RENAME_CLASSES in bsd.prog.mk

This adds a more flexible version of SANITIZER_RENAME_SYMBOL.

New symbol allows to specify MKSANITIZER specific renames on per-file and
per-symbol basis.


# 1.320 10-Aug-2019 christos

Make the X11 library lists consistent again.


Revision tags: netbsd-9-base phil-wifi-20190609 pgoyette-compat-20190127
# 1.319 21-Jan-2019 christos

branches: 1.319.2;
Most of the mv operations are to move temporary files to their final place.
Some use -f, others don't. This can lead to spurious build failures when
the user performing the build changes. Centralize, and always use -f.


Revision tags: pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.318 12-Aug-2018 christos

fix broken library variable definitions (inconsistencies between
bsd.README and bsd.prog.mk)


Revision tags: pgoyette-compat-0728
# 1.317 25-Jul-2018 kamil

Introduce MKLIBCSANITIZER in the share/mk rules

Add flags that are required to build a program and a dynamically loaded
library.

Propagade LIBCSANITIZERFLAGS to CFLAGS and CXXFLAGS.

LDFLAGS is not changed on purpose, as a libcsanitizer is inside libc
and no external dependencies are needed.

Register NOLIBCSANITIZER, as certain distribution parts will need to be
skipped.


# 1.316 12-Jul-2018 maxv

Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.


Revision tags: phil-wifi-base
# 1.315 25-Jun-2018 kamil

branches: 1.315.2;
Add a framework for renaming symbols in libc&co for MKSANITIZER

A new keyword SANITIZER_RENAME_SYMBOL. It's a variable that has specified
a list of symbols to be renamed in a processor in order to remove naming
conflicts with public symbols in libc/m/pthread/rt.

This renaming will occur for libraries and programs.
A symbol with a conflicting 'name', will be renamed to '__mksanitizer_name'.

Based on an idea by <christos>


Revision tags: pgoyette-compat-0625
# 1.314 21-Jun-2018 kamil

Refactor MKSANITIZER flags in mk rules

Introduce a new variable SANITIZERFLAGS that contains all the sanitizer
specific flags. These flags are designed to be passed to CFLAGS, CXXFLAGS
and LDFLAGS.

Pass SANITIZERFLAGS in bsd.prog.mk rules to CFLAGS, CXXFLAGS and LDFLAGS.

Pass SANITIZERFLAGS in bsd.lib.mk rules to *_pic.a build flags. The *_pic.a
libraries are designed to construct .so libraries. All .so libraries with
few exceptions are expected to be prebuilt with a sanitizer. Another
purpuse of *_pic.a files can be constructing static PIE programs, however
they are not supported as of now and there is no sanitization of static
programs either.

Once MKSTATICPIE will be supported, it will be initially incompatible with
MKSANITIZER.

This change also makes it easier to build other targets like kernel and
kernel modules without userland sanitizers.

No functional change intended for MKSANITIZER=no users.


# 1.313 02-Jun-2018 christos

Sanitizers don't support static linking.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315
# 1.312 11-Mar-2018 mrg

define LIBXFONT2.


Revision tags: pgoyette-compat-base
# 1.311 25-Feb-2018 mrg

branches: 1.311.2;
add LIBKRB5_LDADD/LIBKRB5_DPADD and their static counterparts
to bsd.prog.mk. use them instead of hard coding various lists
of libraries for krb5.

this fixes static builds.


# 1.310 11-Dec-2017 christos

Instead of checking for obj existance which can be empty for shuttle-rule
programs, check for .sh sources.


# 1.309 10-Dec-2017 christos

don't try to build .debug files for shell scripts.


# 1.308 10-Oct-2017 christos

Add general {DP,LD}ADD.rump variables


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base
# 1.307 21-May-2017 riastradh

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.


# 1.306 21-May-2017 riastradh

Remove some vestiges of MKCRYPTO_IDEA/MKCRYPTO_MDC2.


# 1.305 21-May-2017 riastradh

Remove MKCRYPTO_RC5. Unconditionally include RC5 in libcrypto.so.

This option existed only because RC5 is covered by patents that, twenty
years ago, we had reason to suspect the patent holder, RSA, Inc., might
litigate. The two US patents in question are 5,724,428 and 5,835,600.

According to the USPTO Patent Term Calculator web site at
<https://www.uspto.gov/patent/laws-and-regulations/patent-term-calculator#heading-5>
(retrieved 2017-05-21), patents filed after 1995-06-07 expire twenty
years after the filing date.

number filing date
5,724,428 1995-11-01
5,835,600 1997-04-21

Thus, these patents appear to be expired.

As proposed on tech-crypto and tech-security:

https://mail-index.netbsd.org/tech-crypto/2017/05/05/msg000718.html
https://mail-index.netbsd.org/tech-security/2017/05/05/msg000927.html


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.304 19-Apr-2017 joerg

Add netpgpverify to the library list.


Revision tags: pgoyette-localcount-20170320
# 1.303 20-Feb-2017 rin

add missing LIBCXX


# 1.302 08-Feb-2017 kamil

libpthread_dbg(3) deletion from the base distribution

libpthread_dbg(3) is a remnant library from the M:N thread model
(pre-NetBSD-5.0) API to introspect threads within a process and for use
of debuggers.

Currently in the 1:1 model it's not used in GDB neither in LLDB and it's
not either planned to be used. It's current function to read pthread_t
structures is realizable within a regular debugger capable to
instrospect objects within a tracee (GDB, LLDB...).

Remaining users of this API can still use this library from
pkgsrc/devel/libpthread_dbg.

Sponsored by <The NetBSD Foundation>


# 1.301 29-Jan-2017 christos

add sqlite3 to statically linked libraries for pam.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914
# 1.300 20-Aug-2016 christos

branches: 1.300.2;
unbound additions


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.299 04-Apr-2016 joerg

branches: 1.299.2;
If the per-target LDSTATIC flag is set, don't include the PIE linker
flags as we currently don't support static PIE.


# 1.298 30-Mar-2016 martin

Pass -pie to cc, not -Wl,-pie. This way we have a chance to fix specs
for obscure corner cases like -pie -fPIE -static (used for
/usr/tests/lib/csu/h_initfini2 if building with MKPIE=yes).
While there also replace -fPIC with -fPIE for the PIE case, even if
it should be mostly equivalent.


# 1.297 12-Mar-2016 mrg

remove conditionals that are always true with GCC >= 4.8.


# 1.296 21-Feb-2016 christos

Add NODEBUG


# 1.295 31-Jan-2016 christos

Introduce NOPIE and NOCTF so that standalone programs build properly.


# 1.294 23-Jan-2016 christos

Define _KERNTYPES for things that need it.


# 1.293 07-Nov-2015 joerg

LIBEXECINFO


# 1.292 07-Jun-2015 matt

Make LIBCRT* depend on the right files if MLIBDIR from MKCOMPAT is defined.


# 1.291 01-Dec-2014 erh

PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilt
if any of their dependencies (i.e. the files they refer to) are changed.
This allows changes to transitive included headers to be handled properly.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.290 25-Mar-2014 ozaki-r

branches: 1.290.4;
Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.


Revision tags: riastradh-drm2-base3
# 1.289 09-Mar-2014 christos

let's see if the new dwarf library can handle dwarf 4


# 1.288 02-Mar-2014 christos

If we are compiling with -g and using gcc4.8 and dtrace downgrade
dwarf generation to version 2 for now.


# 1.287 15-Jan-2014 joerg

-Wl,-pie and -r don't agree with each other, so filter the former out.


# 1.286 11-Nov-2013 joerg

Relink binaries if crti.o changes.


# 1.285 29-Sep-2013 christos

Add libxcb


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.284 31-May-2013 mrg

add LIBX11_XCB; unfortunately since the library is named with a -
in it, we have to use an ugly hard coded assignment for now.
(could be cleaned up with more make variable magic i'm sure.)


# 1.283 04-Apr-2013 christos

ldopts should be before ldadd like everywhere else.


Revision tags: agc-symver-base
# 1.282 14-Feb-2013 christos

Since the libraries are produced with different MK flags than the programs,
we check for existance of the files instead of the MK flags.


# 1.281 14-Feb-2013 christos

Add PROGDPLIBS


# 1.280 26-Jan-2013 christos

CTFCONVERT me harder.


Revision tags: yamt-pagecache-base8
# 1.279 17-Jan-2013 christos

Now that we have separate debug sets, add -g if ${MKDEBUG} is set for
program builds since we don't need to install that symbol files.


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.278 24-Aug-2012 jmmv

branches: 1.278.2;
Allow DPADD to be specified on a per-program basis.


# 1.277 23-Aug-2012 joerg

Revert last, it breaks the tricks xsrc uses.


# 1.276 23-Aug-2012 joerg

Remove SHLIBINSTALLDIR and SHLINKINSTALLLIBDIR. Add rpath entries, if
SHLIBDIR differs from /usr/lib.


# 1.275 08-Aug-2012 christos

add MKRUMP by popular demand.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.274 29-Feb-2012 tron

Move "libexpat" from X11 into base which fixes PR lib/40346.
This change was approved by the Core Group.


# 1.273 21-Feb-2012 matt

Remove another ${SIZE}


# 1.272 20-Feb-2012 matt

Remove ${SIZE}


# 1.271 19-Feb-2012 matt

Add support for --combine with gcc.


Revision tags: netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2
# 1.270 05-Nov-2011 christos

branches: 1.270.2;
Add libtre


Revision tags: yamt-pagecache-base
# 1.269 16-Oct-2011 christos

branches: 1.269.2;
- no need to special-case libraries with weird characters.
- add a note about adding new libraries.


# 1.268 16-Oct-2011 christos

fix list of libraries to reflect reality.


# 1.267 10-Sep-2011 apb

Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.


# 1.266 27-Aug-2011 joerg

Add new "analyze" command to run clang's static analyzer in a directory
on all C/C++ files.


Revision tags: cherry-xenmp-base
# 1.265 26-Apr-2011 he

The new Heimdal adds -lwind and -lheimbase to the set of libraries,
so define the corresponding LIB* variables.
These are also needed in the PAM_STATIC_* variables, so add them there too.


# 1.264 11-Apr-2011 joerg

Adjust --sysroot related usage:
-Wl,-rpath does not expand =, so just drop it.

Drop -Wl,-rpath-link entries that duplicate the -Wl,-rpath entries, this
is done implicitly now that ld is built with sysroot support.

Use ${DESTDIR} explicitly for the remaining -Wl,-rpath-link entries.


# 1.263 10-Apr-2011 joerg

For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.


# 1.262 08-Mar-2011 jmmv

Revert previous (revision 1.261): it broke the build because PROG_CXX is
defined in terms of PROG, so later on we would end up with target duplicates
because both PROG_CXX and PROG were being converted to PROGS_CXX and PROGS.

Did not catch this earlier because the test build I did was not clean and
thus the duplicate targets did not have nasty effects.


# 1.261 07-Mar-2011 jmmv

Always convert PROG to its plural form independently of whether PROG_CXX
is defined or not. From Garrett Cooper in private mail.


Revision tags: bouyer-quota2-nbase
# 1.260 20-Feb-2011 jmmv

Define LIBATF_C and LIBATF_CXX to point to their corresponding .a files and
use these to properly set DPADD for test programs.


Revision tags: bouyer-quota2-base
# 1.259 13-Feb-2011 christos

add saslc


# 1.258 06-Feb-2011 joerg

Don't use -nostdinc or -nostdinc++ if this is included in a HOSTLIB.


# 1.257 17-Jan-2011 pooka

branches: 1.257.2;
Add rump bits to DPSRCS so that update builds work correctly.


Revision tags: matt-mips64-premerge-20101231
# 1.256 13-Dec-2010 pooka

befriend RUMPPRG with CRUNCHEDPRG


# 1.255 13-Dec-2010 pooka

Define RUMPPRG, which is just like PROG, except it additionally
builds a rump client with the name rump.${PROG}. The rump client
is not installed suid/sgid by default even if BINMODE is defined.


# 1.254 10-Dec-2010 joerg

Revert last, gcc(1) checks explicitly for -r on some platforms to disable
passing down --relax as well.


# 1.253 08-Dec-2010 joerg

gcc passes down -r directly to ld, so make it explicitly a linker option.


# 1.252 08-Dec-2010 joerg

Don't depend on ${CC} passing down -R to ld, use -Wl,-rpath explicitly.


# 1.251 08-Nov-2010 lukem

Preserve date on original shared library or program when stripping
the debug symbols and adding the debug-link to .debug.
Use '(rm -f file; false)' in the failure path to force failure.
Based on solution proposed by Nicolas Joly on tech-toolchain in July 2010.
Should fix PR toolchain/44046 from Andreas Gustafsson.


# 1.250 31-Oct-2010 mbalmer

Link Lua to the build and add the resulting files to the distribution sets.
Document the addition of Lua and the change we made to the default settings.


# 1.249 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.248 24-Apr-2010 lukem

When extracting separate debug symbols with MKDEBUG, there's no need
to leave the original file unstripped...


# 1.247 02-Mar-2010 darran

DTrace: Add CTF generation to the make framework. Only enabled when
MKDTRACE=yes.


# 1.246 14-Dec-2009 mrg

use "${CC} -r" not "${CC} -Wl,-r" as the latter fools GCC on some targets
and it ends up passing "-r -relax" to ld, which causes ld to barf.


# 1.245 14-Dec-2009 matt

Merge from matt-nb5-mips64


Revision tags: matt-premerge-20091211
# 1.244 08-Dec-2009 uebayasi

When PROGS / LIBS are used, you can pass each PROG / LIB specific parameters
to ${LD} via:

${LDADD.${PROG}}
${LDFLAGS.${PROG}}
${LDSTATIC.${PROG}}
${LDADD.${LIB}}
${LDFLAGS.${LIB}}

OTOH you can't pass parameters to ${CC}, because in suffix rules make(1) only
knows the name of ${.IMPSRC} and ${.TARGET}; it's users' responsivility to
define ${CC} parameters to all the sources of a given ${PROG} / ${LIB}.

Should address bin/42381.

(Bug in this commit log was pointed out by mrg@.)


# 1.243 27-Nov-2009 tsutsui

If CPPFLAGS or CXXFLAGS already contains -nostdinc or -nostdinc++,
don't add ${CPPFLAGS_ISYSTEM} or ${CPPFLAGS_ISYSTEMXX} to refer
${DESTDIR}/usr/include or ${DESTDIR}/usr/include/g++.

This change might cause errors on some MD stand dir, but in that case
each Makefile should be fixed to search proper system include paths
by -Ipath option in own CPPFLAGS.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.242 12-May-2009 plunky

remove libsdp as improved functionality has been enabled in libbluetooth.


# 1.241 10-Apr-2009 apb

Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links. They have no effect except when using a
metalog, in which case the information is added to the metalog. In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg. This should fix PR 24457 and PR 41155.


# 1.240 24-Nov-2008 cube

branches: 1.240.2;
Move cleanextra to the very ends in case another included file wants to add
to it even if it was initially empty.


Revision tags: netbsd-5-base matt-mips64-base2
# 1.239 19-Oct-2008 christos

branches: 1.239.2;
handle assembly files for MKPIE


# 1.238 16-Oct-2008 christos

Provide a way for a program to override the PIE flags.


# 1.237 15-Oct-2008 christos

don't compile/link libraries with pie


Revision tags: mjf-devfs2-base
# 1.236 02-Oct-2008 joerg

Hook up libfetch and pkg_install update.


Revision tags: wrstuden-revivesa-base-3
# 1.235 09-Sep-2008 joerg

Add MKSTRIPIDENT to remove the RCS IDs from binary programs and shared
libraries for space-constraint systems. The description is based on the
feedback of hubertf@, the logic on input from lukem@

This obsoletes the removal of LIBC_SCCS and SYSLIBC_SCCS for libc builds.


Revision tags: wrstuden-revivesa-base-2
# 1.234 28-Aug-2008 mrg

update a comment example


# 1.233 27-Aug-2008 rtr

use ${X11USRLIBDIR} instead of hard-coded /usr/X11R6/lib when building
${LIB.foo} vars


# 1.232 27-Aug-2008 lukem

Fix problem I introduced in rev 1.231 on 2008/08/25 where ${_PROGLDOPTS}
and -L${_GCC_LIBGCCDIR} were appearing in the link line before ${LDADD},
so -L${DESTDIR}/lib and -L${DESTDIR}/usr/lib were being used before
local -L library paths.
Fixes ntpd/ntpdate failure noticed by Valeriy E. Ushakov <uwe@NetBSD.org>


# 1.231 25-Aug-2008 lukem

Always link with: -Wl,-rpath-link,${DESTDIR}/usr/lib -L${DESTDIR}/usr/lib
Fixes problem with MKDYNAMICROOT=no triggered by libraries that depend
on other libraries.
Related to PR 33503.

Clean up setting of _CCLINK to always add the appropriate -B options.

Simplify the link rule for a program.


# 1.230 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.229 28-May-2008 lukem

add LIBLDAR_R (for completeness)


# 1.228 22-May-2008 lukem

Add MKLDAP, USE_LDAP, LIBLBER, LIBLDAP


Revision tags: hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-pf42-base
# 1.227 10-Apr-2008 tsutsui

branches: 1.227.2; 1.227.4;
Add libhx509 to PAM_STATIC_LDADD which is required by libkrb5.


# 1.226 22-Mar-2008 mlelstv

branches: 1.226.2;
Import Heimdal-1.1


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase matt-armv6-base hpcarm-cleanup-base
# 1.225 26-Dec-2007 jmmv

Make the clean target work when OBJS is set but PROG is not, as happens
for example in gnu/lib/crtstuff4. Reported by drochner@.


Revision tags: cube-autoconf-base
# 1.224 13-Nov-2007 jmmv

Fix typo that prevented MKDEBUG builds to work. Found by drochner@.


# 1.223 12-Nov-2007 jmmv

Add the ability to build multiple programs from a single directory

This adds support for a new set of variables, PROGS and PROGS_CXX, that
allow the developer to build multiple different programs from a single
source directory.


# 1.222 04-Nov-2007 tls

Remove MKPRIVATELIB from BIND libraries; move library reachover
directories and Makefiles from src/usr.sbin/bind to src/lib; make
BIND libraries build shared. Saves about 1MB-1.5MB per installed
executable, about 5MB for a base+etc minimal installation of NetBSD.


Revision tags: matt-mips64-base
# 1.221 29-Jul-2007 joerg

branches: 1.221.4; 1.221.6;
Add build glue for libarchive and update the various sets.


# 1.220 25-Jan-2007 perry

Before I completely forget the issue, convert "PROG_PAX" to the
better-named "PAXCTL_FLAGS".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.219 11-Nov-2006 christos

don't run paxctl if other commands were specified for that target.


# 1.218 10-Nov-2006 christos

if ${PROG_PAX} is defined, run paxctl on the binary after linking with
the value of the variable. This way, if you set:

PROG_PAX=+M

in /etc/mk.conf, you get what you deserve.


# 1.217 22-Oct-2006 pooka

libpuffs


# 1.216 09-Oct-2006 mrg

- clean up some comments to reality.
- retire LIBDCK, LIBG2C and (long broken) USE_LIBSTDCXX
- in bsd.hostprog.mk's LIBSTDCPP -> LIBSTDCC
- add LIBSUPCXX
- don't default USE_LIBSTDCXX or USE_GCC4 since they are
not used in the tree any where
- same with USE_XF86_4; retire it
- remove _SUPCXX handling in bsd.prog.mk

inspired by PR#26714.


Revision tags: abandoned-netbsd-4-base
# 1.215 23-Jul-2006 lukem

Implement MKDEBUG:
If "no", don't build and install separate debugging symbols
into /usr/libdata/debug.
Default: no


# 1.214 19-Jun-2006 gdamore

Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.


# 1.213 09-Jun-2006 christos

PR/33681: Scott Ellis: Building 'bc' with SHAREDSTRINGS=yes fails
We need CPPFLAGS too now.


# 1.212 11-May-2006 mrg

add support for ${OBJCOPTS} and ${OBJCOPTS}.<lib|prog|fn>.


# 1.211 20-Mar-2006 christos

There is always one more KRB4 thing to remove. (from Jukka Salmi)


# 1.210 20-Mar-2006 christos

Remove krb4 variables and libraries (Jukka Salmi)


# 1.209 16-Mar-2006 jwise

Now that we have real build system support for syspkgs, remove someone's
half-implemented idea of building `syspkgs' (really a few giant blobs of the
same granularity of the old sets) using install(1).


# 1.208 20-Jan-2006 christos

Add the world of libraries to the static pam build. Now static pam binaries
work.


# 1.207 09-Apr-2005 dsl

Report when we link a program into xxx.ro (before being crunched)


Revision tags: netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.206 04-Mar-2005 he

branches: 1.206.2; 1.206.4;
Introduce PAM_STATIC_LDADD and PAM_STATIC_DPADD. When compiling
with MKPIC=no, possibly because the target does not support shared
libraries, these include libraries required to resolve all symbols
which end up referenced from PAM-using applications. The libraries
presently required are -lcrypt, -lrpcsvc and -lutil.

Add use of these variables which are currently set up to use PAM,
so that they compile when MKPIC=no.

Also, in the telnetd case, reorder the order of the libraries, so
that libtelnet.a comes before -ltermcap and -lutil, again to fix
link error when MKPIC=no.

Discussed with thorpej and christos.


# 1.205 20-Feb-2005 christos

Add libradius


# 1.204 12-Jan-2005 lukem

If RESCUEDIR is defined, automatically add that to CPPFLAGS


# 1.203 08-Jan-2005 lukem

Implement <bsd.prog.mk> vars:
LIBASN1 LIBBSDMALLOC LIBG2C LIBPAM LIBSSH


# 1.202 04-Aug-2004 lukem

Revert most of previous, and move the LIB<libname>?= assignments
back to bsd.prog.mk from bsd.own.mk.

pkgsrc uses <bsd.own.mk>, and setting LIB<libname> in it causes
problems with various package builds.
This should fix PR #26542 submitted by Jim Bernard.

(I'll be implementing the DPADD for shared libraries in a different
manner that generally won't depend upon ${LIB<libname>}.)


# 1.201 30-Jul-2004 lukem

Move the LIB<libname>?= assignments from bsd.prog.mk to bsd.own.mk so
that they may be used by non PROGs (e.g., LIBs).

Improve some comments.


# 1.200 10-Jun-2004 lukem

Be consistent in handling YHEADER, similar to Christos' fix in bsd.lib.mk 1.253


# 1.199 21-May-2004 ross

If you add a library, you need to define its DPADD symbol here.

Add LIBMAGIC.


Revision tags: netbsd-2-0-base
# 1.198 15-Feb-2004 skrll

branches: 1.198.2;
Be more gcc like in the way we deal with libgcc so that sh3/hppa millicode
and exception handling have a chance of working properly.

- creates libgcc, libgcc_eh and libgcc_s

- updates LIBGCC_SPEC to use them appropriately.

There's a hack in here at the moment with respect to libgcc_so in that it
is preferable to link against libgcc_so will only when -shared-libgcc is
specified (the c++ frontend does this automatically.) Configurations where
LINK_EH_SPEC is defined already do this. The gcc configuration for
NetBSD/alpha and another NetBSD platform (I forget which) actually define
LINK_EH_SPEC probably by accident rather than design.

- updates share/mk to use the compiler's knowledge of what needs linking into
libraries and executables. This removes an hppa hack.

- updates the sets for the newly created libgcc* files.

- support for linking against the _pg version of libgcc has been removed.


# 1.197 29-Jan-2004 lukem

Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.


# 1.196 27-Jan-2004 lukem

Replace
:M-[IDU]*
with
:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)


# 1.195 23-Jan-2004 simonb

crt0.o lives in /usr/lib even on a.out.


# 1.194 16-Nov-2003 lukem

simplify with _MKTARGET_LINK


# 1.193 11-Nov-2003 dsl

Set MKDEP_SUFFIXES to get additional targets in .depend instead of using
sed in .afterdepend. I don't think .afterdepend is used anywhere any more.


# 1.192 21-Oct-2003 lukem

Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.


# 1.191 19-Oct-2003 lukem

Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} " ... {$.TARGET}" and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO


# 1.190 18-Oct-2003 lukem

Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command ("verbose")
This is the default, and is equivalent to the previous behaviour.


# 1.189 29-Sep-2003 lukem

Add LIBSTDCXX (for usr/lib/libstdc++.a).
Sync LIB* documentation with reality.


# 1.188 19-Sep-2003 martin

Drop explicit medlow model and default to -O2 for sparc64.


# 1.187 14-Sep-2003 lukem

Check ${SHLIBDIR} against "/usr/lib" instead of ${LIBDIR} when determining
if we need to add stuff (usually "/lib") to the rpath-link path before
"/usr/lib". Otherwise, this barfs if LIBDIR != /usr/lib or /lib, and
we're cross-building (e.g., in src/x11)


# 1.186 13-Sep-2003 erh

Also support per-program LDFLAGS and LDSTATIC.


# 1.185 13-Sep-2003 erh

Create a way to add additional flags to COPTS, CPPFLAGS, CXXFLAGS and LDADD
for particular libraries or programs by specifying the additions in mk.conf
instead of needing to go edit individual Makefiles.


# 1.184 12-Sep-2003 lukem

add infrastructure to support reach-over builds of xsrc


# 1.183 22-Aug-2003 dsl

Add a ${PROG}.ro target that does an 'ld -r' of the program object files.
Allows a much simplified build of 'crunched' binaries since crunchgen can
build prog.ro instead of having to deretmine the names of all the .o files.


# 1.182 01-Aug-2003 lukem

Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".


# 1.181 01-Aug-2003 lukem

simplify the ${PROG}: target to reduce duplication between the DESTDIR
and !DESTDIR cases...


# 1.180 31-Jul-2003 lukem

bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.


# 1.179 31-Jul-2003 lukem

Don't need -R/usr/lib; it will be searched at the end by ld.elf_so anyway.
Noted by matt green <mrg@>


# 1.178 28-Jul-2003 lukem

be consistent when adding *.y and *.l to DPSRCS


# 1.177 28-Jul-2003 lukem

replace MKCXXSUPCXX(!=no) with USE_LIBSTDCXX(==no)


# 1.176 28-Jul-2003 lukem

Change defined(CXX_SUPCXX) to MKCXXSUPCXX != "no".

Clarify that command-line overrides of the MKxxx variables should be
done via the environment rather than make(1) command-line variable
assignment, since the latter doesn't actually work as intended.


# 1.175 27-Jul-2003 mrg

introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes. for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)


# 1.174 26-Jul-2003 mrg

add a new bsd.own.mk variable: CXX_SUPCXX. from bsd.README:
+ CXX_SUPCXX If defined, the support libraries needed for this C++ program
+ are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.


# 1.173 20-Jul-2003 lukem

Consistently support the different C++ file extensions: .cc .cpp .cxx .C
Noted by Andrew White in PR toolchain/18246


# 1.172 18-Jul-2003 lukem

Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was defined.
Replace defined(UNPRIVED) tests with ${MKUNPRIVED} != "no"

Add MKUPDATE; if not no has the same semantics as if UPDATE was defined.
Replace defined(UPDATE) tests with ${MKUPDATE} != "no"

Improve documentation for these and other make flags.


# 1.171 16-Jul-2003 itojun

stop installing install libtelnet. build under lib/libtelnet and reference
it from usr.bin/telnet and libexec/telnetd.
(reason for separate build: compiler flags)


# 1.170 27-Jun-2003 drochner

For consistency, use "-R" instead of "-Wl,-rpath" to pass
a runtime search path to the linker.


# 1.169 13-Jun-2003 itojun

define LIBEVENT


# 1.168 11-Jun-2003 msaitoh

catch signal 1,2,3,13 and 15 to clean /tmp/_dependXXX


# 1.167 31-May-2003 thorpej

If EXTERNAL_TOOLCHAIN is defined, allow the compiler to define the
location of crt{begin,end}{,S}.o and libgcc.a. Encapsulate all of
this logic into the new bsd.gcc.mk, and use it in bsd.prog.mk and
bsd.lib.mk.


# 1.166 18-May-2003 lukem

make this a no-op if HOSTPROG is defined


# 1.165 30-Mar-2003 thorpej

If MACHINE_ARCH is powerpc and we HAVE_GCC3, add crtsaveres.o to the
endfile spec.


# 1.164 22-Feb-2003 uwe

Typo in comment.


# 1.163 24-Jan-2003 thorpej

Add LIBPTHREAD, LIBPTHREAD_DB, and LIBRT.


Revision tags: fvdl_fs64_base
# 1.162 22-Nov-2002 thorpej

Split crtbegin/crtend into crti/crtbegin/crtend/crtn. NetBSD-specific
things like the .note.netbsd.ident section are provided by crti/crtn.
crti/crtn also provide the _init() and _fini() routines.

crtbegin/crtend now only provide support for ctors/dtors. This paves
the way to using the "crtstuff" provided with GCC (when we upgrade to
GCC 3.3), which provides, among other things, much better C++/Java
exception handling.


# 1.161 12-Nov-2002 itohy

MKDYNAMICROOT for a.out


# 1.160 22-Oct-2002 perry

Pass 1 of SYSPKG changes to automatically add tags=pkgname_pkg to METALOG.
Not quite ready for prime time yet.


# 1.159 27-Sep-2002 thorpej

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.


# 1.158 26-Sep-2002 itojun

MDC2 is a patented algorithm; don't ship it in default libcrypto.
MKCRYPTO_MDC2 will build a separate library, libcrypto_mdc2.


# 1.157 08-Sep-2002 thorpej

Build a .gdbinit in the objdir when building a program. The .gdbinit
file sets the shared library prefix to ${DESTDIR}, and adds "sources"
directives for each file listed in the GDBINIT Makefile variable.


# 1.156 09-Aug-2002 thorpej

Add LIBPMC.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.155 27-Mar-2002 eeh

branches: 1.155.2;
Use the medium low model for sparc64 programs that don't 2GB of data segment.


# 1.154 11-Feb-2002 mycroft

Don't use .PHONY for targets that are actually installed. Instead use force
dependencies. (Among other things, `make -t install' does something vaguely
sensible now.)


# 1.153 07-Feb-2002 pk

Mark installed system libraries as .MADE only if we're actually establishing
their default variable values here.


# 1.152 04-Feb-2002 christos

s/.NOSUFF/.MADE/


# 1.151 03-Feb-2002 christos

Apply a .NOSUFF: directive to targets we don't want to have processed by
the suffix rules engine.


# 1.150 02-Feb-2002 veego

Ups, it is LIBUSBHID and not LIBUSBHIB.


# 1.149 02-Feb-2002 veego

Change LIBUSB to LIBUSBHIB, reflecting the library name change.


# 1.148 29-Jan-2002 enami

Mark the targets clean{extra,objs} as PHONY.


# 1.147 04-Jan-2002 thorpej

For PROG_CXX DESTDIR builds, pull in -lstdc++ and -lm regardless
of GCC version.


# 1.146 01-Jan-2002 thorpej

Per a suggestion from matthew green, PROG_CXX takes the place of
PROG for C++ programs.


# 1.145 01-Jan-2002 thorpej

* If PROG_CXX is set by the program's Makefile, use ${CXX} to link
the program rather than ${CC}.
* If HAVE_GCC3 is defined, pull in "-lstdc++ -lm" as additional C++
support libraries for DESTDIR builds.


# 1.144 28-Dec-2001 lukem

* 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


# 1.143 28-Nov-2001 tv

If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.


# 1.142 19-Nov-2001 thorpej

Use a little transitional hack to determine if we use -isystem
or -idirafter. Use the former only of USE_NEW_TOOLCHAIN, since
-isystem causes the old toolchain to bomb out when building
libstdc++.


# 1.141 14-Nov-2001 tv

C/..$/.c/ -> C/\..$/.c/


# 1.140 14-Nov-2001 tv

Move the DESTDIR-based nostdinc logic to bsd.lib.mk and bsd.prog.mk where
it belongs (with the native target compile rules).


# 1.139 02-Nov-2001 tv

Use INSTALL_FILE/INSTALL_DIR as appropriate.


# 1.138 02-Nov-2001 tv

Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.


# 1.137 19-Oct-2001 tv

Add .NOPATH for all files generated from .l or .y files in SRCS. Fixes PRs
bin/14187 and lib/14239.

Also simplify the handling of these transforms to .c and .h files a bit by
leveraging make's builtin macro operators.


# 1.136 25-Sep-2001 tv

Set .NOPATH on program to build to make sure it goes in .OBJDIR.
Problem noted by <seebs@plethora.net>.


# 1.135 24-Sep-2001 lukem

fix previous (hi thor!) - $OBJS and $CLEANFILES might be empty, and
rm needs some files to delete...


# 1.134 24-Sep-2001 tls

Split "cleanprog" target apart: now you can zap only object files or
CLEANFILES (needed to fix crunchgen lossage).


# 1.133 13-Sep-2001 thorpej

Add LIBPCI.


# 1.132 14-Aug-2001 tv

Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").


# 1.131 01-Jun-2001 tv

Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).


# 1.130 08-May-2001 sommerfeld

Suppress duplicate entries in ALLFILES, FILES, INCS, DEPINCS, INFOFILES,
NLSALL, CATPAGES, MANPAGES, HTMLPAGES, and SCRIPTS.


# 1.129 19-Feb-2001 jmc

Wrap target() checks around afterdepend rule as some Makefiles override this


# 1.128 26-Jan-2001 itojun

fix typo in LIBSSL decl. it made programs with DPADD+=${LIBSSL} to build
every time we type "make". From: bernd


# 1.127 14-Jan-2001 christos

use the new .if commands(<target>) directive so that we don't have to
change Makefiles.


# 1.126 14-Jan-2001 christos

fix thinko: test for the existance of the target before we define it...


# 1.125 14-Jan-2001 christos

Alter previous redefined target protection. If the ${PROG} target is defined,
add the dependencies as usual, but don't add the commands. This avoids
having to change all the Makefiles that redefine the PROG target.


# 1.124 14-Jan-2001 christos

allow programs to override the program target.


# 1.123 08-Jan-2001 mrg

add missing $LIBCRYPTO_RC5 and $LIBCRYPTO_IDEA


# 1.122 08-Jan-2001 mrg

add missing $LIBSSL


# 1.121 04-Jan-2001 garbled

Add LIBCDK and LIBFORM definitions


# 1.120 31-Oct-2000 itojun

add ${LIBINTL} for use with DPADD.


# 1.119 07-Oct-2000 deberg

fix typos, PR 11159


# 1.118 25-Jun-2000 erh

For the case when DESTDIR is set: move the -L${DESTDIR}/usr/lib after ${LDADD} so any -L directories set in LDADD are searched first to avoid possibly linking against old versions of libraries.


Revision tags: netbsd-1-5-base
# 1.117 19-Jun-2000 thorpej

branches: 1.117.2;
Sync up the LIB* list.


# 1.116 10-Jun-2000 mycroft

Use ${.ALLSRC:T} when doing the generated variable name lookups, so that it
DTRT for generated files in and obj directory (or accessed via .PATH).


# 1.115 06-Jun-2000 mycroft

Abuse .USE some more.


# 1.114 06-Jun-2000 mycroft

Minor rearrangement.


# 1.113 06-Jun-2000 mycroft

Use ODE make(1) features to eliminate extra variables and move several things
outside of .for loops. (Needs more work to completely eliminate .for.)

XXX Don't look at this stuff. It will make your head hurt.


Revision tags: minoura-xpg4dl-base
# 1.112 14-Apr-2000 mrg

branches: 1.112.2;
use -rpath-link rather than -R when linking objects using a DESTDIR.
this replaces the previous change as that ended up adding
$DESTDIR/usr/lib to the runtime path of every binary created, which
is bogus and dangerous.


# 1.111 25-Mar-2000 mycroft

When linking with $DESTDIR, use an explicit -R to get library dependencies
correct.


# 1.110 07-Mar-2000 veego

Remove unused libahdi.
It will be replaced in the future with a more generic libdisklabel.


# 1.109 05-Feb-2000 jdc

Add libahdi entries.


# 1.108 23-Jan-2000 eeh

Add some support for FCode binaries.


# 1.107 22-Jan-2000 mycroft

Make `dependall' play nicely with SUBDIR, using a hack similar to `realinstall'
for both `depend' and `all'.
Also, remove the old hack that invokes an extra shell for .depend, now that
make(1) has been fixed.


# 1.106 16-Jan-2000 assar

all: depend on ${SCRIPTS} so that they get generated if they need to


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.105 23-Nov-1999 blymn

Added libmenu library.


Revision tags: comdex-fall-1999-base
# 1.104 14-Sep-1999 perry

branches: 1.104.4;
Add a "dependall" target, which does a "make depend" and then "make all"
in a single directory. This is useful in "make build" because by doing
the build immediately after the depend, all sources will typically
still be in the buffer cache, thus saving significant time over doing
a "make depend" on all the directories and then a "make all".


# 1.103 04-Sep-1999 fredb

Permit "make all install", as well as "make foo install" (where foo would be
installed by "make install") without setting of BUILD. All cases where BUILD
is already set are unchanged from the old behavior.

"make all install" is now practically equivalent to "make BUILD= all install",
but without actually setting build.

Fixes pr's 8313, 3894.


# 1.102 21-Aug-1999 simonb

Add ${INSTPRIV} to ${INSTALL} commands.


# 1.101 01-Jul-1999 itojun

branches: 1.101.2;
add LIBIPSEC for use from DPADD.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.100 12-Feb-1999 lukem

branches: 1.100.2;
* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.99 10-Feb-1999 tv

libbfd_pic.a is no longer installed; remove ${LIBBFD} define.


# 1.98 04-Feb-1999 christos

PR/2936: Brian C. Grayson: Avoid truncating precious files when installing
and the filesystem is full. Added ${RENAME} flag to install, which when set
to -r installs on a temporary file and then renames to the final destination.
${RENAME} is currently set to nothing in bsd.own.mk, but one can turn it
on in /etc/mk.conf.


# 1.97 07-Nov-1998 jonathan

Do DESTDIR support for crtbegin/crtend on all ELF ports (adds mips).


# 1.96 28-Sep-1998 christos

Use preserve flag in install.


# 1.95 10-Sep-1998 ross

Define a LIBBZ2?=... for use in DPADD=... lines.


# 1.94 09-Aug-1998 lukem

add distclean as a synonym for cleandir


# 1.93 09-Apr-1998 tv

.y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.


# 1.92 01-Apr-1998 tv

Revert. This broke too much in the build tree, and a better solution
needs to be created. (The existing situation breaks a lot too.)


# 1.91 01-Apr-1998 tv

Fix .y rules to DTRT with possibly generated .h files. See mail on
tech-toolchain for a very detailed explanation of this. In short, add
a .y.h rule identical to the .y.c rule and make the .y.c rule rename
the .h file; also, clean the .h file in CLEANFILES.


# 1.90 03-Nov-1997 cgd

echo the lint command line when making 'lint'.


# 1.89 28-Oct-1997 lukem

add ${LIBOBJC}


Revision tags: netbsd-1-3-base
# 1.88 11-Oct-1997 mycroft

branches: 1.88.2;
Several changes:
* Allow bsd.man.mk to be included separately.
* Always include bsd.own.mk and bsd.obj.mk.
* Include bsd.man.mk and bsd.nls.mk even if NOMAN or NONLS; just turn off
building of the affected files instead.
* Require bsd.subdir.mk to be included explicitly.
(Will make appropriate changes to Makefiles shortly.)


# 1.87 29-Sep-1997 gwr

Add $LIBBFD


# 1.86 31-May-1997 cjs

Back out BUILDDIR and NOINSTALL changes.


# 1.85 26-May-1997 cjs

branches: 1.85.2;
These updates to the build allow building against include files
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.


# 1.84 18-May-1997 kleink

Add libposix.


# 1.83 17-May-1997 mycroft

Do LINKS and SYMLINKS after FILES and INCS.


# 1.82 17-May-1997 mycroft

Remove unneeded .SUFFIXES lines, and move .s and .S closer to .o to give the
right preferences.


# 1.81 09-May-1997 mycroft

Fix typo in previous.


# 1.80 09-May-1997 mycroft

Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.79 09-May-1997 mycroft

Remove cruft.


# 1.78 09-May-1997 mycroft

Oops; rearrange dependencies to get things built early enough.


# 1.77 09-May-1997 mycroft

Make sure INCS and SRCS are built if necessary.


# 1.76 08-May-1997 gwr

Set the .NOPATH flag for ${OBJS} (from Christos).


# 1.75 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.74 07-May-1997 mycroft

Various simplifications.


# 1.73 07-May-1997 mycroft

Shuffle some .PHONYs around, to work better with `-t'.


# 1.72 06-May-1997 mycroft

Make most of the install targets .PRECIOUS.


# 1.71 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.70 18-Apr-1997 christos

Add ${LIBNTP}


# 1.69 17-Apr-1997 thorpej

- Properly depend on crtbegin.o and crtend.o for platforms that use
them (currently Alpha and PowerPC)
- STRIP -> STRIPFLAG


# 1.68 03-Apr-1997 mikel

don't allow override of all: target


# 1.67 29-Mar-1997 mikel

merge lite-2 changes (mostly SCCSids)


# 1.66 27-Mar-1997 christos

Put the FILES generated rules in a separate .mk file since both bsd.prog.mk
and bsd.lib.mk use them.


# 1.65 27-Mar-1997 mycroft

Make the SCRIPTS case mimic the FILES case more closely, so we can override
the destination direectory, etc.


# 1.64 27-Mar-1997 mycroft

Remove knowledge of HIDEGAME from here.


# 1.63 24-Mar-1997 christos

make rules update:
- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation


# 1.62 22-Mar-1997 perry

Fix SYMLINKS not to include DESTDIR in the link itself


# 1.61 13-Mar-1997 perry

add SYMLINKS, by analogy to LINKS. Vetted by Christos.


# 1.60 22-Jan-1997 cgd

if 'clean' is not already defined, rather than simply defining it with
a bunch of rules, define a clean{kmod,lib,prog} target with the rules,
and have both clean and cleandir depend on that. That eliminates a bug
where 'cleandir' in a directory which included e.g. bsd.prog.mk but which
also had subdirs would 'make clean' all the subdirs and then 'make cleandir'
all ofthe subdirs. It also allows Makefiles to add more dependencies
to 'clean' after inclusion of the make template.

If 'clean' is already defined, the behaviour is the same as it used to be.


# 1.59 20-Dec-1996 cgd

add an afterdepend target (a la the one in bsd.lib.mk) that processes
the .depend file to add <filename>.ln for each <filename>.o as an
object file which has the given dependencies (in addition to
<filename>.po and <filename>.so, which were already there).


# 1.58 13-Dec-1996 mikel

add missing LIBPCAP definition.


# 1.57 26-Nov-1996 mrg

add libz and libwrap


# 1.56 18-Oct-1996 thorpej

Use ${INSTALL} rather than "install".
From Simon J. Gerraty <sjg@zen.void.oz.au>, PR #1458.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.55 08-Apr-1996 jtc

Sort LIBFOO definitions and add LIBY; Reported by Mike Long <mike.long@analog.com> in PR #2301.


# 1.54 22-Oct-1995 christos

Added include file <bsd.sys.mk> that contains lex and yacc "parallel aware"
rules. These rules are not turned on by default; they are enabled by setting
the PARALLEL variable.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.53 25-Jun-1995 cgd

oops; fix an rm that might be empty


# 1.52 24-Jun-1995 cgd

update lint rules, but keep linting disabled


# 1.51 10-Jun-1995 mycroft

Define LIBEDIT.


# 1.50 21-Apr-1995 jtc

.include <bsd.nls.mk> unless NONLS is defined.


# 1.49 22-Dec-1994 cgd

specify man pages differently, and document how.


# 1.48 24-Aug-1994 mycroft

Include bsd.own.mk earlier.


# 1.47 20-Jul-1994 cgd

fix from christos, for progs w/o objects


Revision tags: netbsd-1-0-base
# 1.46 06-Jul-1994 mycroft

branches: 1.46.2;
Pull libraries from ${DESTDIR} if set. Kill LDONLY, which is unused and
probably not useful anyway.


# 1.45 30-Jun-1994 cgd

fix modify-info-nothingness-then-substitute probelm that broke genclass build


# 1.44 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.43 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.42 28-Jun-1994 jtc

Strip *.sh when constructing OBJS from SRCS.
This will allow us to clean up makefiles that build a script by munging
a template (uusched, genclass, neqn, etc.).


# 1.41 18-Jun-1994 cgd

don't chown the symlink, when HIDEGAME causes a symlink to be made to dm.
4.4-based FS code _follows_ the symlinks on a chown(2) call.


# 1.40 24-May-1994 cgd

fix the last to do the right thing for dependencies


# 1.39 24-May-1994 deraadt

LIBSKEY


# 1.38 22-May-1994 jtc

Single source file programs are now compiled into object files before they
are linked. This change halves the time it takes to rebuild all of the
NetBSD sources when only the C library is "touched"; but only takes about
one percent more disk space.


# 1.37 06-Apr-1994 chopps

relink (recompile) single source programs when crt0.o is updated.


# 1.36 24-Mar-1994 mycroft

Remove *.core on clean.


# 1.35 09-Feb-1994 cgd

kill install -d's.


# 1.34 28-Jan-1994 cgd

add LIBKVM


# 1.33 10-Nov-1993 cgd

librpc doesn't exist anymore


# 1.32 08-Nov-1993 cgd

ad LDSTATIC flag, so static linking can be made one-stop shopping.
use "setenv LDSTATIC" to make *everything* dynamically linked,
setenv LDSTATIC -static for everything statically linked, or unset
it for default behavior.


# 1.31 07-Oct-1993 cgd

LIBTERM pointed at nothing, but was meant to point to libtermcap.a...


# 1.30 07-Oct-1993 cgd

always define LIBCRYPT


# 1.29 17-Aug-1993 mycroft

Make sure we don't recurse into subdirectories if Makefile specified `install'
target. (It's usually blank and is specifically to avoid doing this...)


# 1.28 15-Aug-1993 mycroft

Automatically include bsd.subdir.mk for backward compatibility.


# 1.27 15-Aug-1993 mycroft

Don't automatically include bsd.subdir.mk in bsd.prog.mk and bsd.lib.mk.
Put back .MAIN in bsd.man.mk, and be careful not to include ../Makefile.inc
a second time.


# 1.26 15-Aug-1993 mycroft

Move man rules to sys.mk.
Use bsd.subdir.mk for building subdirectories.
Don't forget to remove x.cc and x.C when using SHAREDSTRINGS.
Make ${PROG} always depend on ${LIBCRT0}.
Don't duplicate code between cleandir and clean.
Move tags target to bsd.dep.mk.
Move STRIP to bsd.own.mk.
Remove redundant definitions of {BIN,MAN}{DIR,GRP,OWN,MODE}.
Move {LIB,DOC}{DIR,GRP,OWN,MODE} defaults to bsd.own.mk.


# 1.25 15-Aug-1993 mycroft

Abstract out dependency stuff, and add RCS identifiers.


# 1.24 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


# 1.23 10-Aug-1993 mycroft

Put LINKS handling in `install' target, so it's the last thing executed, and
happens even if `realinstall' is user-defined.


# 1.22 30-Jul-1993 mycroft

When generating a default OBJS, ignore .h files.


# 1.21 29-Jul-1993 mycroft

Don't print the `making ...' message if an obj dir already exists.
Also, a minor cleanup.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.20 17-Jul-1993 mycroft

Fix C++ dependencies for good. `make depend' is now done in two passes--one
of C files and one for C++ files. No need to specify `-+' in your Makefile,
as it is now done automatically.


# 1.19 17-Jul-1993 cgd

do c++ dependencies the right way...


# 1.18 17-Jul-1993 mycroft

Add suffix rules for C++ files.


# 1.17 04-Jun-1993 brezak

Add LIBRPCSVC variable.


# 1.16 02-Jun-1993 cgd

add ability to specify c++ dependencies, by setting CFLAGS+=-+ for
the dependency make.


# 1.15 26-Apr-1993 cgd

added definition for DPADD library variable LIBCRYPT.


# 1.14 26-Apr-1993 mycroft

Don't redefine `realinstall' target if already defined.


# 1.13 25-Apr-1993 mycroft

Link with LDFLAGS even if one source module.


# 1.12 25-Apr-1993 mycroft

Don't lose if we include bsd.prog.mk only to build man pages.


# 1.11 25-Apr-1993 mycroft

Fix error in last change. (Oops.)


# 1.10 25-Apr-1993 mycroft

Don't build man pages if NOMAN set.


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.9 09-Apr-1993 cgd

various changes to default make rules. from patch 101.
note that only the "sensible" changes in patch 101 are implemented.


# 1.8 08-Apr-1993 cgd

try to do the right thing, in terms making directories before we
install into them, and get the manpage cleans _OUT_ of "clean".
they don't belong there, only in cleandir, WFJ be damned.


# 1.7 08-Apr-1993 cgd

fixed typos...


# 1.6 08-Apr-1993 cgd

(silently) make sure we have directories before installing


# 1.5 04-Apr-1993 cgd

make LIBRPC point to the right place


# 1.4 27-Mar-1993 nate

Fixed the doc macros to call troff, eqn,and tbl instead of ditroff,
deqn, and dtbl.
Fixed make clean to remove the man pages (Bill fixed this in the distribution,
but not in the original source)
Changed install to leave the original file around, by using 'cp' instead of
'mv'. "install -c ..."


# 1.3 23-Mar-1993 cgd

made .CURDIR be absolute, not relative, thereby eliminating
the need for some of the makefile trickery when making objects,
and fixing a few .PATH bugs


# 1.2 22-Mar-1993 cgd

fixed "make obj" for cases when sources not in /usr/src/...
if sources not there, it now mkdirs obj, but some trickery
is necessary, to avoid deleting cwd.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.341 14-Jul-2022 mrg

add libxcvt.


# 1.340 28-Nov-2021 christos

When we build against DESTDIR, add the lint library path for DESTDIR during
the link phase for lint.


# 1.339 23-Aug-2021 mrg

define variables for the libxcb-* libraries.


# 1.338 15-Aug-2021 christos

Fix sun2 build for ldap/gssapi


# 1.337 14-Aug-2021 christos

Centralize the ldap libraries


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.336 12-Nov-2020 nia

Revert addition of pthread dependency on sqlite.

It is less trivial than expected and introduced some surprising breakage.


# 1.335 09-Nov-2020 christos

- make the CTFCONVERT command lines consistent and concise by putting all
the implementation stuff in a variable CTFCONVERT_RUN
- introduce an OBJECT_TARGET variable that contains the output object file
- when we need to run ctfconvert, go through an intermediate ${.TARGET}.o
file, instead of writing directly to ${.TARGET} and then overwriting
${.TARGET} with ctfconvert. This avoids build failures after a build
got interrupted (the "partially built from C" scourge).


# 1.334 09-Nov-2020 martin

Adapt for sqlite requiring pthreads now


# 1.333 30-Oct-2020 martin

libsqlite3 now requires -lm


# 1.332 16-Oct-2020 nia

share/mk: Define some missing X11 libraries.


# 1.331 15-Jun-2020 christos

Rename blacklist -> blocklist


# 1.330 30-May-2020 christos

Make libuv private, requested by joerg@


# 1.329 24-May-2020 christos

Add libuv


Revision tags: phil-wifi-20200421 phil-wifi-20200411 phil-wifi-20200406
# 1.328 04-Apr-2020 christos

Linker semantics have changed; we now don't automatically link dependent
libraries from other DSO's. For example in /usr/bin/passwd:
ld: krb5_passwd.o: undefined reference to symbol \
'UI_UTIL_read_pw_string@@OPENSSL_1_1_0'
ld: /usr/obj/amd64-x86_64/release/lib/libcrypto.so.14: error adding symbols: \
DSO missing from command line


# 1.327 04-Apr-2020 christos

Fix kerberos libraries order


# 1.326 04-Apr-2020 christos

Add libgnuctf


# 1.325 03-Mar-2020 christos

Add fido and cbor


Revision tags: is-mlppp-base phil-wifi-20191119
# 1.324 18-Nov-2019 christos

Improve the script to check for installed libraries, and fix the wrong
names and obsolete libraries it found.


# 1.323 27-Aug-2019 kamil

Enhance the support of LLVM sanitizers

Define _REENTRANT for MKSANITIZER build. This is needed for at least stdio
code. This caused new build issued with duplicated symbols in few places
and rump kernel code picking different code paths borrowed from libc.
Handle all this in one go.

Add bsd.sanitizer.mk to share common code used by programs and libraries.

Switch from realall to beforeinstall target in .syms files. This is more
reliable in MKSANITIZER.


# 1.322 17-Aug-2019 kamil

Add PAXCTL_FLAG rules for MKSANITIZER

Add per-program rules to disable ASLR for ASan, TSan and MSan in all
sanitized programs. This flag is not needed for other supported sanitizers.

Without this change, sanitized init(8) dies early on startup.

Approach originally suggested by <joerg>


# 1.321 15-Aug-2019 kamil

Add SANITIZER_RENAME_CLASSES in bsd.prog.mk

This adds a more flexible version of SANITIZER_RENAME_SYMBOL.

New symbol allows to specify MKSANITIZER specific renames on per-file and
per-symbol basis.


# 1.320 10-Aug-2019 christos

Make the X11 library lists consistent again.


Revision tags: netbsd-9-base phil-wifi-20190609 pgoyette-compat-20190127
# 1.319 21-Jan-2019 christos

branches: 1.319.2;
Most of the mv operations are to move temporary files to their final place.
Some use -f, others don't. This can lead to spurious build failures when
the user performing the build changes. Centralize, and always use -f.


Revision tags: pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.318 12-Aug-2018 christos

fix broken library variable definitions (inconsistencies between
bsd.README and bsd.prog.mk)


Revision tags: pgoyette-compat-0728
# 1.317 25-Jul-2018 kamil

Introduce MKLIBCSANITIZER in the share/mk rules

Add flags that are required to build a program and a dynamically loaded
library.

Propagade LIBCSANITIZERFLAGS to CFLAGS and CXXFLAGS.

LDFLAGS is not changed on purpose, as a libcsanitizer is inside libc
and no external dependencies are needed.

Register NOLIBCSANITIZER, as certain distribution parts will need to be
skipped.


# 1.316 12-Jul-2018 maxv

Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.


Revision tags: phil-wifi-base
# 1.315 25-Jun-2018 kamil

branches: 1.315.2;
Add a framework for renaming symbols in libc&co for MKSANITIZER

A new keyword SANITIZER_RENAME_SYMBOL. It's a variable that has specified
a list of symbols to be renamed in a processor in order to remove naming
conflicts with public symbols in libc/m/pthread/rt.

This renaming will occur for libraries and programs.
A symbol with a conflicting 'name', will be renamed to '__mksanitizer_name'.

Based on an idea by <christos>


Revision tags: pgoyette-compat-0625
# 1.314 21-Jun-2018 kamil

Refactor MKSANITIZER flags in mk rules

Introduce a new variable SANITIZERFLAGS that contains all the sanitizer
specific flags. These flags are designed to be passed to CFLAGS, CXXFLAGS
and LDFLAGS.

Pass SANITIZERFLAGS in bsd.prog.mk rules to CFLAGS, CXXFLAGS and LDFLAGS.

Pass SANITIZERFLAGS in bsd.lib.mk rules to *_pic.a build flags. The *_pic.a
libraries are designed to construct .so libraries. All .so libraries with
few exceptions are expected to be prebuilt with a sanitizer. Another
purpuse of *_pic.a files can be constructing static PIE programs, however
they are not supported as of now and there is no sanitization of static
programs either.

Once MKSTATICPIE will be supported, it will be initially incompatible with
MKSANITIZER.

This change also makes it easier to build other targets like kernel and
kernel modules without userland sanitizers.

No functional change intended for MKSANITIZER=no users.


# 1.313 02-Jun-2018 christos

Sanitizers don't support static linking.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315
# 1.312 11-Mar-2018 mrg

define LIBXFONT2.


Revision tags: pgoyette-compat-base
# 1.311 25-Feb-2018 mrg

branches: 1.311.2;
add LIBKRB5_LDADD/LIBKRB5_DPADD and their static counterparts
to bsd.prog.mk. use them instead of hard coding various lists
of libraries for krb5.

this fixes static builds.


# 1.310 11-Dec-2017 christos

Instead of checking for obj existance which can be empty for shuttle-rule
programs, check for .sh sources.


# 1.309 10-Dec-2017 christos

don't try to build .debug files for shell scripts.


# 1.308 10-Oct-2017 christos

Add general {DP,LD}ADD.rump variables


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base
# 1.307 21-May-2017 riastradh

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.


# 1.306 21-May-2017 riastradh

Remove some vestiges of MKCRYPTO_IDEA/MKCRYPTO_MDC2.


# 1.305 21-May-2017 riastradh

Remove MKCRYPTO_RC5. Unconditionally include RC5 in libcrypto.so.

This option existed only because RC5 is covered by patents that, twenty
years ago, we had reason to suspect the patent holder, RSA, Inc., might
litigate. The two US patents in question are 5,724,428 and 5,835,600.

According to the USPTO Patent Term Calculator web site at
<https://www.uspto.gov/patent/laws-and-regulations/patent-term-calculator#heading-5>
(retrieved 2017-05-21), patents filed after 1995-06-07 expire twenty
years after the filing date.

number filing date
5,724,428 1995-11-01
5,835,600 1997-04-21

Thus, these patents appear to be expired.

As proposed on tech-crypto and tech-security:

https://mail-index.netbsd.org/tech-crypto/2017/05/05/msg000718.html
https://mail-index.netbsd.org/tech-security/2017/05/05/msg000927.html


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.304 19-Apr-2017 joerg

Add netpgpverify to the library list.


Revision tags: pgoyette-localcount-20170320
# 1.303 20-Feb-2017 rin

add missing LIBCXX


# 1.302 08-Feb-2017 kamil

libpthread_dbg(3) deletion from the base distribution

libpthread_dbg(3) is a remnant library from the M:N thread model
(pre-NetBSD-5.0) API to introspect threads within a process and for use
of debuggers.

Currently in the 1:1 model it's not used in GDB neither in LLDB and it's
not either planned to be used. It's current function to read pthread_t
structures is realizable within a regular debugger capable to
instrospect objects within a tracee (GDB, LLDB...).

Remaining users of this API can still use this library from
pkgsrc/devel/libpthread_dbg.

Sponsored by <The NetBSD Foundation>


# 1.301 29-Jan-2017 christos

add sqlite3 to statically linked libraries for pam.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914
# 1.300 20-Aug-2016 christos

branches: 1.300.2;
unbound additions


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.299 04-Apr-2016 joerg

branches: 1.299.2;
If the per-target LDSTATIC flag is set, don't include the PIE linker
flags as we currently don't support static PIE.


# 1.298 30-Mar-2016 martin

Pass -pie to cc, not -Wl,-pie. This way we have a chance to fix specs
for obscure corner cases like -pie -fPIE -static (used for
/usr/tests/lib/csu/h_initfini2 if building with MKPIE=yes).
While there also replace -fPIC with -fPIE for the PIE case, even if
it should be mostly equivalent.


# 1.297 12-Mar-2016 mrg

remove conditionals that are always true with GCC >= 4.8.


# 1.296 21-Feb-2016 christos

Add NODEBUG


# 1.295 31-Jan-2016 christos

Introduce NOPIE and NOCTF so that standalone programs build properly.


# 1.294 23-Jan-2016 christos

Define _KERNTYPES for things that need it.


# 1.293 07-Nov-2015 joerg

LIBEXECINFO


# 1.292 07-Jun-2015 matt

Make LIBCRT* depend on the right files if MLIBDIR from MKCOMPAT is defined.


# 1.291 01-Dec-2014 erh

PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilt
if any of their dependencies (i.e. the files they refer to) are changed.
This allows changes to transitive included headers to be handled properly.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.290 25-Mar-2014 ozaki-r

branches: 1.290.4;
Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.


Revision tags: riastradh-drm2-base3
# 1.289 09-Mar-2014 christos

let's see if the new dwarf library can handle dwarf 4


# 1.288 02-Mar-2014 christos

If we are compiling with -g and using gcc4.8 and dtrace downgrade
dwarf generation to version 2 for now.


# 1.287 15-Jan-2014 joerg

-Wl,-pie and -r don't agree with each other, so filter the former out.


# 1.286 11-Nov-2013 joerg

Relink binaries if crti.o changes.


# 1.285 29-Sep-2013 christos

Add libxcb


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.284 31-May-2013 mrg

add LIBX11_XCB; unfortunately since the library is named with a -
in it, we have to use an ugly hard coded assignment for now.
(could be cleaned up with more make variable magic i'm sure.)


# 1.283 04-Apr-2013 christos

ldopts should be before ldadd like everywhere else.


Revision tags: agc-symver-base
# 1.282 14-Feb-2013 christos

Since the libraries are produced with different MK flags than the programs,
we check for existance of the files instead of the MK flags.


# 1.281 14-Feb-2013 christos

Add PROGDPLIBS


# 1.280 26-Jan-2013 christos

CTFCONVERT me harder.


Revision tags: yamt-pagecache-base8
# 1.279 17-Jan-2013 christos

Now that we have separate debug sets, add -g if ${MKDEBUG} is set for
program builds since we don't need to install that symbol files.


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.278 24-Aug-2012 jmmv

branches: 1.278.2;
Allow DPADD to be specified on a per-program basis.


# 1.277 23-Aug-2012 joerg

Revert last, it breaks the tricks xsrc uses.


# 1.276 23-Aug-2012 joerg

Remove SHLIBINSTALLDIR and SHLINKINSTALLLIBDIR. Add rpath entries, if
SHLIBDIR differs from /usr/lib.


# 1.275 08-Aug-2012 christos

add MKRUMP by popular demand.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.274 29-Feb-2012 tron

Move "libexpat" from X11 into base which fixes PR lib/40346.
This change was approved by the Core Group.


# 1.273 21-Feb-2012 matt

Remove another ${SIZE}


# 1.272 20-Feb-2012 matt

Remove ${SIZE}


# 1.271 19-Feb-2012 matt

Add support for --combine with gcc.


Revision tags: netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2
# 1.270 05-Nov-2011 christos

branches: 1.270.2;
Add libtre


Revision tags: yamt-pagecache-base
# 1.269 16-Oct-2011 christos

branches: 1.269.2;
- no need to special-case libraries with weird characters.
- add a note about adding new libraries.


# 1.268 16-Oct-2011 christos

fix list of libraries to reflect reality.


# 1.267 10-Sep-2011 apb

Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.


# 1.266 27-Aug-2011 joerg

Add new "analyze" command to run clang's static analyzer in a directory
on all C/C++ files.


Revision tags: cherry-xenmp-base
# 1.265 26-Apr-2011 he

The new Heimdal adds -lwind and -lheimbase to the set of libraries,
so define the corresponding LIB* variables.
These are also needed in the PAM_STATIC_* variables, so add them there too.


# 1.264 11-Apr-2011 joerg

Adjust --sysroot related usage:
-Wl,-rpath does not expand =, so just drop it.

Drop -Wl,-rpath-link entries that duplicate the -Wl,-rpath entries, this
is done implicitly now that ld is built with sysroot support.

Use ${DESTDIR} explicitly for the remaining -Wl,-rpath-link entries.


# 1.263 10-Apr-2011 joerg

For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.


# 1.262 08-Mar-2011 jmmv

Revert previous (revision 1.261): it broke the build because PROG_CXX is
defined in terms of PROG, so later on we would end up with target duplicates
because both PROG_CXX and PROG were being converted to PROGS_CXX and PROGS.

Did not catch this earlier because the test build I did was not clean and
thus the duplicate targets did not have nasty effects.


# 1.261 07-Mar-2011 jmmv

Always convert PROG to its plural form independently of whether PROG_CXX
is defined or not. From Garrett Cooper in private mail.


Revision tags: bouyer-quota2-nbase
# 1.260 20-Feb-2011 jmmv

Define LIBATF_C and LIBATF_CXX to point to their corresponding .a files and
use these to properly set DPADD for test programs.


Revision tags: bouyer-quota2-base
# 1.259 13-Feb-2011 christos

add saslc


# 1.258 06-Feb-2011 joerg

Don't use -nostdinc or -nostdinc++ if this is included in a HOSTLIB.


# 1.257 17-Jan-2011 pooka

branches: 1.257.2;
Add rump bits to DPSRCS so that update builds work correctly.


Revision tags: matt-mips64-premerge-20101231
# 1.256 13-Dec-2010 pooka

befriend RUMPPRG with CRUNCHEDPRG


# 1.255 13-Dec-2010 pooka

Define RUMPPRG, which is just like PROG, except it additionally
builds a rump client with the name rump.${PROG}. The rump client
is not installed suid/sgid by default even if BINMODE is defined.


# 1.254 10-Dec-2010 joerg

Revert last, gcc(1) checks explicitly for -r on some platforms to disable
passing down --relax as well.


# 1.253 08-Dec-2010 joerg

gcc passes down -r directly to ld, so make it explicitly a linker option.


# 1.252 08-Dec-2010 joerg

Don't depend on ${CC} passing down -R to ld, use -Wl,-rpath explicitly.


# 1.251 08-Nov-2010 lukem

Preserve date on original shared library or program when stripping
the debug symbols and adding the debug-link to .debug.
Use '(rm -f file; false)' in the failure path to force failure.
Based on solution proposed by Nicolas Joly on tech-toolchain in July 2010.
Should fix PR toolchain/44046 from Andreas Gustafsson.


# 1.250 31-Oct-2010 mbalmer

Link Lua to the build and add the resulting files to the distribution sets.
Document the addition of Lua and the change we made to the default settings.


# 1.249 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.248 24-Apr-2010 lukem

When extracting separate debug symbols with MKDEBUG, there's no need
to leave the original file unstripped...


# 1.247 02-Mar-2010 darran

DTrace: Add CTF generation to the make framework. Only enabled when
MKDTRACE=yes.


# 1.246 14-Dec-2009 mrg

use "${CC} -r" not "${CC} -Wl,-r" as the latter fools GCC on some targets
and it ends up passing "-r -relax" to ld, which causes ld to barf.


# 1.245 14-Dec-2009 matt

Merge from matt-nb5-mips64


Revision tags: matt-premerge-20091211
# 1.244 08-Dec-2009 uebayasi

When PROGS / LIBS are used, you can pass each PROG / LIB specific parameters
to ${LD} via:

${LDADD.${PROG}}
${LDFLAGS.${PROG}}
${LDSTATIC.${PROG}}
${LDADD.${LIB}}
${LDFLAGS.${LIB}}

OTOH you can't pass parameters to ${CC}, because in suffix rules make(1) only
knows the name of ${.IMPSRC} and ${.TARGET}; it's users' responsivility to
define ${CC} parameters to all the sources of a given ${PROG} / ${LIB}.

Should address bin/42381.

(Bug in this commit log was pointed out by mrg@.)


# 1.243 27-Nov-2009 tsutsui

If CPPFLAGS or CXXFLAGS already contains -nostdinc or -nostdinc++,
don't add ${CPPFLAGS_ISYSTEM} or ${CPPFLAGS_ISYSTEMXX} to refer
${DESTDIR}/usr/include or ${DESTDIR}/usr/include/g++.

This change might cause errors on some MD stand dir, but in that case
each Makefile should be fixed to search proper system include paths
by -Ipath option in own CPPFLAGS.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.242 12-May-2009 plunky

remove libsdp as improved functionality has been enabled in libbluetooth.


# 1.241 10-Apr-2009 apb

Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links. They have no effect except when using a
metalog, in which case the information is added to the metalog. In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg. This should fix PR 24457 and PR 41155.


# 1.240 24-Nov-2008 cube

branches: 1.240.2;
Move cleanextra to the very ends in case another included file wants to add
to it even if it was initially empty.


Revision tags: netbsd-5-base matt-mips64-base2
# 1.239 19-Oct-2008 christos

branches: 1.239.2;
handle assembly files for MKPIE


# 1.238 16-Oct-2008 christos

Provide a way for a program to override the PIE flags.


# 1.237 15-Oct-2008 christos

don't compile/link libraries with pie


Revision tags: mjf-devfs2-base
# 1.236 02-Oct-2008 joerg

Hook up libfetch and pkg_install update.


Revision tags: wrstuden-revivesa-base-3
# 1.235 09-Sep-2008 joerg

Add MKSTRIPIDENT to remove the RCS IDs from binary programs and shared
libraries for space-constraint systems. The description is based on the
feedback of hubertf@, the logic on input from lukem@

This obsoletes the removal of LIBC_SCCS and SYSLIBC_SCCS for libc builds.


Revision tags: wrstuden-revivesa-base-2
# 1.234 28-Aug-2008 mrg

update a comment example


# 1.233 27-Aug-2008 rtr

use ${X11USRLIBDIR} instead of hard-coded /usr/X11R6/lib when building
${LIB.foo} vars


# 1.232 27-Aug-2008 lukem

Fix problem I introduced in rev 1.231 on 2008/08/25 where ${_PROGLDOPTS}
and -L${_GCC_LIBGCCDIR} were appearing in the link line before ${LDADD},
so -L${DESTDIR}/lib and -L${DESTDIR}/usr/lib were being used before
local -L library paths.
Fixes ntpd/ntpdate failure noticed by Valeriy E. Ushakov <uwe@NetBSD.org>


# 1.231 25-Aug-2008 lukem

Always link with: -Wl,-rpath-link,${DESTDIR}/usr/lib -L${DESTDIR}/usr/lib
Fixes problem with MKDYNAMICROOT=no triggered by libraries that depend
on other libraries.
Related to PR 33503.

Clean up setting of _CCLINK to always add the appropriate -B options.

Simplify the link rule for a program.


# 1.230 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.229 28-May-2008 lukem

add LIBLDAR_R (for completeness)


# 1.228 22-May-2008 lukem

Add MKLDAP, USE_LDAP, LIBLBER, LIBLDAP


Revision tags: hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-pf42-base
# 1.227 10-Apr-2008 tsutsui

branches: 1.227.2; 1.227.4;
Add libhx509 to PAM_STATIC_LDADD which is required by libkrb5.


# 1.226 22-Mar-2008 mlelstv

branches: 1.226.2;
Import Heimdal-1.1


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase matt-armv6-base hpcarm-cleanup-base
# 1.225 26-Dec-2007 jmmv

Make the clean target work when OBJS is set but PROG is not, as happens
for example in gnu/lib/crtstuff4. Reported by drochner@.


Revision tags: cube-autoconf-base
# 1.224 13-Nov-2007 jmmv

Fix typo that prevented MKDEBUG builds to work. Found by drochner@.


# 1.223 12-Nov-2007 jmmv

Add the ability to build multiple programs from a single directory

This adds support for a new set of variables, PROGS and PROGS_CXX, that
allow the developer to build multiple different programs from a single
source directory.


# 1.222 04-Nov-2007 tls

Remove MKPRIVATELIB from BIND libraries; move library reachover
directories and Makefiles from src/usr.sbin/bind to src/lib; make
BIND libraries build shared. Saves about 1MB-1.5MB per installed
executable, about 5MB for a base+etc minimal installation of NetBSD.


Revision tags: matt-mips64-base
# 1.221 29-Jul-2007 joerg

branches: 1.221.4; 1.221.6;
Add build glue for libarchive and update the various sets.


# 1.220 25-Jan-2007 perry

Before I completely forget the issue, convert "PROG_PAX" to the
better-named "PAXCTL_FLAGS".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.219 11-Nov-2006 christos

don't run paxctl if other commands were specified for that target.


# 1.218 10-Nov-2006 christos

if ${PROG_PAX} is defined, run paxctl on the binary after linking with
the value of the variable. This way, if you set:

PROG_PAX=+M

in /etc/mk.conf, you get what you deserve.


# 1.217 22-Oct-2006 pooka

libpuffs


# 1.216 09-Oct-2006 mrg

- clean up some comments to reality.
- retire LIBDCK, LIBG2C and (long broken) USE_LIBSTDCXX
- in bsd.hostprog.mk's LIBSTDCPP -> LIBSTDCC
- add LIBSUPCXX
- don't default USE_LIBSTDCXX or USE_GCC4 since they are
not used in the tree any where
- same with USE_XF86_4; retire it
- remove _SUPCXX handling in bsd.prog.mk

inspired by PR#26714.


Revision tags: abandoned-netbsd-4-base
# 1.215 23-Jul-2006 lukem

Implement MKDEBUG:
If "no", don't build and install separate debugging symbols
into /usr/libdata/debug.
Default: no


# 1.214 19-Jun-2006 gdamore

Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.


# 1.213 09-Jun-2006 christos

PR/33681: Scott Ellis: Building 'bc' with SHAREDSTRINGS=yes fails
We need CPPFLAGS too now.


# 1.212 11-May-2006 mrg

add support for ${OBJCOPTS} and ${OBJCOPTS}.<lib|prog|fn>.


# 1.211 20-Mar-2006 christos

There is always one more KRB4 thing to remove. (from Jukka Salmi)


# 1.210 20-Mar-2006 christos

Remove krb4 variables and libraries (Jukka Salmi)


# 1.209 16-Mar-2006 jwise

Now that we have real build system support for syspkgs, remove someone's
half-implemented idea of building `syspkgs' (really a few giant blobs of the
same granularity of the old sets) using install(1).


# 1.208 20-Jan-2006 christos

Add the world of libraries to the static pam build. Now static pam binaries
work.


# 1.207 09-Apr-2005 dsl

Report when we link a program into xxx.ro (before being crunched)


Revision tags: netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.206 04-Mar-2005 he

branches: 1.206.2; 1.206.4;
Introduce PAM_STATIC_LDADD and PAM_STATIC_DPADD. When compiling
with MKPIC=no, possibly because the target does not support shared
libraries, these include libraries required to resolve all symbols
which end up referenced from PAM-using applications. The libraries
presently required are -lcrypt, -lrpcsvc and -lutil.

Add use of these variables which are currently set up to use PAM,
so that they compile when MKPIC=no.

Also, in the telnetd case, reorder the order of the libraries, so
that libtelnet.a comes before -ltermcap and -lutil, again to fix
link error when MKPIC=no.

Discussed with thorpej and christos.


# 1.205 20-Feb-2005 christos

Add libradius


# 1.204 12-Jan-2005 lukem

If RESCUEDIR is defined, automatically add that to CPPFLAGS


# 1.203 08-Jan-2005 lukem

Implement <bsd.prog.mk> vars:
LIBASN1 LIBBSDMALLOC LIBG2C LIBPAM LIBSSH


# 1.202 04-Aug-2004 lukem

Revert most of previous, and move the LIB<libname>?= assignments
back to bsd.prog.mk from bsd.own.mk.

pkgsrc uses <bsd.own.mk>, and setting LIB<libname> in it causes
problems with various package builds.
This should fix PR #26542 submitted by Jim Bernard.

(I'll be implementing the DPADD for shared libraries in a different
manner that generally won't depend upon ${LIB<libname>}.)


# 1.201 30-Jul-2004 lukem

Move the LIB<libname>?= assignments from bsd.prog.mk to bsd.own.mk so
that they may be used by non PROGs (e.g., LIBs).

Improve some comments.


# 1.200 10-Jun-2004 lukem

Be consistent in handling YHEADER, similar to Christos' fix in bsd.lib.mk 1.253


# 1.199 21-May-2004 ross

If you add a library, you need to define its DPADD symbol here.

Add LIBMAGIC.


Revision tags: netbsd-2-0-base
# 1.198 15-Feb-2004 skrll

branches: 1.198.2;
Be more gcc like in the way we deal with libgcc so that sh3/hppa millicode
and exception handling have a chance of working properly.

- creates libgcc, libgcc_eh and libgcc_s

- updates LIBGCC_SPEC to use them appropriately.

There's a hack in here at the moment with respect to libgcc_so in that it
is preferable to link against libgcc_so will only when -shared-libgcc is
specified (the c++ frontend does this automatically.) Configurations where
LINK_EH_SPEC is defined already do this. The gcc configuration for
NetBSD/alpha and another NetBSD platform (I forget which) actually define
LINK_EH_SPEC probably by accident rather than design.

- updates share/mk to use the compiler's knowledge of what needs linking into
libraries and executables. This removes an hppa hack.

- updates the sets for the newly created libgcc* files.

- support for linking against the _pg version of libgcc has been removed.


# 1.197 29-Jan-2004 lukem

Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.


# 1.196 27-Jan-2004 lukem

Replace
:M-[IDU]*
with
:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)


# 1.195 23-Jan-2004 simonb

crt0.o lives in /usr/lib even on a.out.


# 1.194 16-Nov-2003 lukem

simplify with _MKTARGET_LINK


# 1.193 11-Nov-2003 dsl

Set MKDEP_SUFFIXES to get additional targets in .depend instead of using
sed in .afterdepend. I don't think .afterdepend is used anywhere any more.


# 1.192 21-Oct-2003 lukem

Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.


# 1.191 19-Oct-2003 lukem

Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} " ... {$.TARGET}" and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO


# 1.190 18-Oct-2003 lukem

Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command ("verbose")
This is the default, and is equivalent to the previous behaviour.


# 1.189 29-Sep-2003 lukem

Add LIBSTDCXX (for usr/lib/libstdc++.a).
Sync LIB* documentation with reality.


# 1.188 19-Sep-2003 martin

Drop explicit medlow model and default to -O2 for sparc64.


# 1.187 14-Sep-2003 lukem

Check ${SHLIBDIR} against "/usr/lib" instead of ${LIBDIR} when determining
if we need to add stuff (usually "/lib") to the rpath-link path before
"/usr/lib". Otherwise, this barfs if LIBDIR != /usr/lib or /lib, and
we're cross-building (e.g., in src/x11)


# 1.186 13-Sep-2003 erh

Also support per-program LDFLAGS and LDSTATIC.


# 1.185 13-Sep-2003 erh

Create a way to add additional flags to COPTS, CPPFLAGS, CXXFLAGS and LDADD
for particular libraries or programs by specifying the additions in mk.conf
instead of needing to go edit individual Makefiles.


# 1.184 12-Sep-2003 lukem

add infrastructure to support reach-over builds of xsrc


# 1.183 22-Aug-2003 dsl

Add a ${PROG}.ro target that does an 'ld -r' of the program object files.
Allows a much simplified build of 'crunched' binaries since crunchgen can
build prog.ro instead of having to deretmine the names of all the .o files.


# 1.182 01-Aug-2003 lukem

Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".


# 1.181 01-Aug-2003 lukem

simplify the ${PROG}: target to reduce duplication between the DESTDIR
and !DESTDIR cases...


# 1.180 31-Jul-2003 lukem

bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.


# 1.179 31-Jul-2003 lukem

Don't need -R/usr/lib; it will be searched at the end by ld.elf_so anyway.
Noted by matt green <mrg@>


# 1.178 28-Jul-2003 lukem

be consistent when adding *.y and *.l to DPSRCS


# 1.177 28-Jul-2003 lukem

replace MKCXXSUPCXX(!=no) with USE_LIBSTDCXX(==no)


# 1.176 28-Jul-2003 lukem

Change defined(CXX_SUPCXX) to MKCXXSUPCXX != "no".

Clarify that command-line overrides of the MKxxx variables should be
done via the environment rather than make(1) command-line variable
assignment, since the latter doesn't actually work as intended.


# 1.175 27-Jul-2003 mrg

introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes. for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)


# 1.174 26-Jul-2003 mrg

add a new bsd.own.mk variable: CXX_SUPCXX. from bsd.README:
+ CXX_SUPCXX If defined, the support libraries needed for this C++ program
+ are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.


# 1.173 20-Jul-2003 lukem

Consistently support the different C++ file extensions: .cc .cpp .cxx .C
Noted by Andrew White in PR toolchain/18246


# 1.172 18-Jul-2003 lukem

Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was defined.
Replace defined(UNPRIVED) tests with ${MKUNPRIVED} != "no"

Add MKUPDATE; if not no has the same semantics as if UPDATE was defined.
Replace defined(UPDATE) tests with ${MKUPDATE} != "no"

Improve documentation for these and other make flags.


# 1.171 16-Jul-2003 itojun

stop installing install libtelnet. build under lib/libtelnet and reference
it from usr.bin/telnet and libexec/telnetd.
(reason for separate build: compiler flags)


# 1.170 27-Jun-2003 drochner

For consistency, use "-R" instead of "-Wl,-rpath" to pass
a runtime search path to the linker.


# 1.169 13-Jun-2003 itojun

define LIBEVENT


# 1.168 11-Jun-2003 msaitoh

catch signal 1,2,3,13 and 15 to clean /tmp/_dependXXX


# 1.167 31-May-2003 thorpej

If EXTERNAL_TOOLCHAIN is defined, allow the compiler to define the
location of crt{begin,end}{,S}.o and libgcc.a. Encapsulate all of
this logic into the new bsd.gcc.mk, and use it in bsd.prog.mk and
bsd.lib.mk.


# 1.166 18-May-2003 lukem

make this a no-op if HOSTPROG is defined


# 1.165 30-Mar-2003 thorpej

If MACHINE_ARCH is powerpc and we HAVE_GCC3, add crtsaveres.o to the
endfile spec.


# 1.164 22-Feb-2003 uwe

Typo in comment.


# 1.163 24-Jan-2003 thorpej

Add LIBPTHREAD, LIBPTHREAD_DB, and LIBRT.


Revision tags: fvdl_fs64_base
# 1.162 22-Nov-2002 thorpej

Split crtbegin/crtend into crti/crtbegin/crtend/crtn. NetBSD-specific
things like the .note.netbsd.ident section are provided by crti/crtn.
crti/crtn also provide the _init() and _fini() routines.

crtbegin/crtend now only provide support for ctors/dtors. This paves
the way to using the "crtstuff" provided with GCC (when we upgrade to
GCC 3.3), which provides, among other things, much better C++/Java
exception handling.


# 1.161 12-Nov-2002 itohy

MKDYNAMICROOT for a.out


# 1.160 22-Oct-2002 perry

Pass 1 of SYSPKG changes to automatically add tags=pkgname_pkg to METALOG.
Not quite ready for prime time yet.


# 1.159 27-Sep-2002 thorpej

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.


# 1.158 26-Sep-2002 itojun

MDC2 is a patented algorithm; don't ship it in default libcrypto.
MKCRYPTO_MDC2 will build a separate library, libcrypto_mdc2.


# 1.157 08-Sep-2002 thorpej

Build a .gdbinit in the objdir when building a program. The .gdbinit
file sets the shared library prefix to ${DESTDIR}, and adds "sources"
directives for each file listed in the GDBINIT Makefile variable.


# 1.156 09-Aug-2002 thorpej

Add LIBPMC.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.155 27-Mar-2002 eeh

branches: 1.155.2;
Use the medium low model for sparc64 programs that don't 2GB of data segment.


# 1.154 11-Feb-2002 mycroft

Don't use .PHONY for targets that are actually installed. Instead use force
dependencies. (Among other things, `make -t install' does something vaguely
sensible now.)


# 1.153 07-Feb-2002 pk

Mark installed system libraries as .MADE only if we're actually establishing
their default variable values here.


# 1.152 04-Feb-2002 christos

s/.NOSUFF/.MADE/


# 1.151 03-Feb-2002 christos

Apply a .NOSUFF: directive to targets we don't want to have processed by
the suffix rules engine.


# 1.150 02-Feb-2002 veego

Ups, it is LIBUSBHID and not LIBUSBHIB.


# 1.149 02-Feb-2002 veego

Change LIBUSB to LIBUSBHIB, reflecting the library name change.


# 1.148 29-Jan-2002 enami

Mark the targets clean{extra,objs} as PHONY.


# 1.147 04-Jan-2002 thorpej

For PROG_CXX DESTDIR builds, pull in -lstdc++ and -lm regardless
of GCC version.


# 1.146 01-Jan-2002 thorpej

Per a suggestion from matthew green, PROG_CXX takes the place of
PROG for C++ programs.


# 1.145 01-Jan-2002 thorpej

* If PROG_CXX is set by the program's Makefile, use ${CXX} to link
the program rather than ${CC}.
* If HAVE_GCC3 is defined, pull in "-lstdc++ -lm" as additional C++
support libraries for DESTDIR builds.


# 1.144 28-Dec-2001 lukem

* 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


# 1.143 28-Nov-2001 tv

If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.


# 1.142 19-Nov-2001 thorpej

Use a little transitional hack to determine if we use -isystem
or -idirafter. Use the former only of USE_NEW_TOOLCHAIN, since
-isystem causes the old toolchain to bomb out when building
libstdc++.


# 1.141 14-Nov-2001 tv

C/..$/.c/ -> C/\..$/.c/


# 1.140 14-Nov-2001 tv

Move the DESTDIR-based nostdinc logic to bsd.lib.mk and bsd.prog.mk where
it belongs (with the native target compile rules).


# 1.139 02-Nov-2001 tv

Use INSTALL_FILE/INSTALL_DIR as appropriate.


# 1.138 02-Nov-2001 tv

Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.


# 1.137 19-Oct-2001 tv

Add .NOPATH for all files generated from .l or .y files in SRCS. Fixes PRs
bin/14187 and lib/14239.

Also simplify the handling of these transforms to .c and .h files a bit by
leveraging make's builtin macro operators.


# 1.136 25-Sep-2001 tv

Set .NOPATH on program to build to make sure it goes in .OBJDIR.
Problem noted by <seebs@plethora.net>.


# 1.135 24-Sep-2001 lukem

fix previous (hi thor!) - $OBJS and $CLEANFILES might be empty, and
rm needs some files to delete...


# 1.134 24-Sep-2001 tls

Split "cleanprog" target apart: now you can zap only object files or
CLEANFILES (needed to fix crunchgen lossage).


# 1.133 13-Sep-2001 thorpej

Add LIBPCI.


# 1.132 14-Aug-2001 tv

Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").


# 1.131 01-Jun-2001 tv

Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).


# 1.130 08-May-2001 sommerfeld

Suppress duplicate entries in ALLFILES, FILES, INCS, DEPINCS, INFOFILES,
NLSALL, CATPAGES, MANPAGES, HTMLPAGES, and SCRIPTS.


# 1.129 19-Feb-2001 jmc

Wrap target() checks around afterdepend rule as some Makefiles override this


# 1.128 26-Jan-2001 itojun

fix typo in LIBSSL decl. it made programs with DPADD+=${LIBSSL} to build
every time we type "make". From: bernd


# 1.127 14-Jan-2001 christos

use the new .if commands(<target>) directive so that we don't have to
change Makefiles.


# 1.126 14-Jan-2001 christos

fix thinko: test for the existance of the target before we define it...


# 1.125 14-Jan-2001 christos

Alter previous redefined target protection. If the ${PROG} target is defined,
add the dependencies as usual, but don't add the commands. This avoids
having to change all the Makefiles that redefine the PROG target.


# 1.124 14-Jan-2001 christos

allow programs to override the program target.


# 1.123 08-Jan-2001 mrg

add missing $LIBCRYPTO_RC5 and $LIBCRYPTO_IDEA


# 1.122 08-Jan-2001 mrg

add missing $LIBSSL


# 1.121 04-Jan-2001 garbled

Add LIBCDK and LIBFORM definitions


# 1.120 31-Oct-2000 itojun

add ${LIBINTL} for use with DPADD.


# 1.119 07-Oct-2000 deberg

fix typos, PR 11159


# 1.118 25-Jun-2000 erh

For the case when DESTDIR is set: move the -L${DESTDIR}/usr/lib after ${LDADD} so any -L directories set in LDADD are searched first to avoid possibly linking against old versions of libraries.


Revision tags: netbsd-1-5-base
# 1.117 19-Jun-2000 thorpej

branches: 1.117.2;
Sync up the LIB* list.


# 1.116 10-Jun-2000 mycroft

Use ${.ALLSRC:T} when doing the generated variable name lookups, so that it
DTRT for generated files in and obj directory (or accessed via .PATH).


# 1.115 06-Jun-2000 mycroft

Abuse .USE some more.


# 1.114 06-Jun-2000 mycroft

Minor rearrangement.


# 1.113 06-Jun-2000 mycroft

Use ODE make(1) features to eliminate extra variables and move several things
outside of .for loops. (Needs more work to completely eliminate .for.)

XXX Don't look at this stuff. It will make your head hurt.


Revision tags: minoura-xpg4dl-base
# 1.112 14-Apr-2000 mrg

branches: 1.112.2;
use -rpath-link rather than -R when linking objects using a DESTDIR.
this replaces the previous change as that ended up adding
$DESTDIR/usr/lib to the runtime path of every binary created, which
is bogus and dangerous.


# 1.111 25-Mar-2000 mycroft

When linking with $DESTDIR, use an explicit -R to get library dependencies
correct.


# 1.110 07-Mar-2000 veego

Remove unused libahdi.
It will be replaced in the future with a more generic libdisklabel.


# 1.109 05-Feb-2000 jdc

Add libahdi entries.


# 1.108 23-Jan-2000 eeh

Add some support for FCode binaries.


# 1.107 22-Jan-2000 mycroft

Make `dependall' play nicely with SUBDIR, using a hack similar to `realinstall'
for both `depend' and `all'.
Also, remove the old hack that invokes an extra shell for .depend, now that
make(1) has been fixed.


# 1.106 16-Jan-2000 assar

all: depend on ${SCRIPTS} so that they get generated if they need to


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.105 23-Nov-1999 blymn

Added libmenu library.


Revision tags: comdex-fall-1999-base
# 1.104 14-Sep-1999 perry

branches: 1.104.4;
Add a "dependall" target, which does a "make depend" and then "make all"
in a single directory. This is useful in "make build" because by doing
the build immediately after the depend, all sources will typically
still be in the buffer cache, thus saving significant time over doing
a "make depend" on all the directories and then a "make all".


# 1.103 04-Sep-1999 fredb

Permit "make all install", as well as "make foo install" (where foo would be
installed by "make install") without setting of BUILD. All cases where BUILD
is already set are unchanged from the old behavior.

"make all install" is now practically equivalent to "make BUILD= all install",
but without actually setting build.

Fixes pr's 8313, 3894.


# 1.102 21-Aug-1999 simonb

Add ${INSTPRIV} to ${INSTALL} commands.


# 1.101 01-Jul-1999 itojun

branches: 1.101.2;
add LIBIPSEC for use from DPADD.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.100 12-Feb-1999 lukem

branches: 1.100.2;
* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.99 10-Feb-1999 tv

libbfd_pic.a is no longer installed; remove ${LIBBFD} define.


# 1.98 04-Feb-1999 christos

PR/2936: Brian C. Grayson: Avoid truncating precious files when installing
and the filesystem is full. Added ${RENAME} flag to install, which when set
to -r installs on a temporary file and then renames to the final destination.
${RENAME} is currently set to nothing in bsd.own.mk, but one can turn it
on in /etc/mk.conf.


# 1.97 07-Nov-1998 jonathan

Do DESTDIR support for crtbegin/crtend on all ELF ports (adds mips).


# 1.96 28-Sep-1998 christos

Use preserve flag in install.


# 1.95 10-Sep-1998 ross

Define a LIBBZ2?=... for use in DPADD=... lines.


# 1.94 09-Aug-1998 lukem

add distclean as a synonym for cleandir


# 1.93 09-Apr-1998 tv

.y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.


# 1.92 01-Apr-1998 tv

Revert. This broke too much in the build tree, and a better solution
needs to be created. (The existing situation breaks a lot too.)


# 1.91 01-Apr-1998 tv

Fix .y rules to DTRT with possibly generated .h files. See mail on
tech-toolchain for a very detailed explanation of this. In short, add
a .y.h rule identical to the .y.c rule and make the .y.c rule rename
the .h file; also, clean the .h file in CLEANFILES.


# 1.90 03-Nov-1997 cgd

echo the lint command line when making 'lint'.


# 1.89 28-Oct-1997 lukem

add ${LIBOBJC}


Revision tags: netbsd-1-3-base
# 1.88 11-Oct-1997 mycroft

branches: 1.88.2;
Several changes:
* Allow bsd.man.mk to be included separately.
* Always include bsd.own.mk and bsd.obj.mk.
* Include bsd.man.mk and bsd.nls.mk even if NOMAN or NONLS; just turn off
building of the affected files instead.
* Require bsd.subdir.mk to be included explicitly.
(Will make appropriate changes to Makefiles shortly.)


# 1.87 29-Sep-1997 gwr

Add $LIBBFD


# 1.86 31-May-1997 cjs

Back out BUILDDIR and NOINSTALL changes.


# 1.85 26-May-1997 cjs

branches: 1.85.2;
These updates to the build allow building against include files
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.


# 1.84 18-May-1997 kleink

Add libposix.


# 1.83 17-May-1997 mycroft

Do LINKS and SYMLINKS after FILES and INCS.


# 1.82 17-May-1997 mycroft

Remove unneeded .SUFFIXES lines, and move .s and .S closer to .o to give the
right preferences.


# 1.81 09-May-1997 mycroft

Fix typo in previous.


# 1.80 09-May-1997 mycroft

Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.79 09-May-1997 mycroft

Remove cruft.


# 1.78 09-May-1997 mycroft

Oops; rearrange dependencies to get things built early enough.


# 1.77 09-May-1997 mycroft

Make sure INCS and SRCS are built if necessary.


# 1.76 08-May-1997 gwr

Set the .NOPATH flag for ${OBJS} (from Christos).


# 1.75 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.74 07-May-1997 mycroft

Various simplifications.


# 1.73 07-May-1997 mycroft

Shuffle some .PHONYs around, to work better with `-t'.


# 1.72 06-May-1997 mycroft

Make most of the install targets .PRECIOUS.


# 1.71 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.70 18-Apr-1997 christos

Add ${LIBNTP}


# 1.69 17-Apr-1997 thorpej

- Properly depend on crtbegin.o and crtend.o for platforms that use
them (currently Alpha and PowerPC)
- STRIP -> STRIPFLAG


# 1.68 03-Apr-1997 mikel

don't allow override of all: target


# 1.67 29-Mar-1997 mikel

merge lite-2 changes (mostly SCCSids)


# 1.66 27-Mar-1997 christos

Put the FILES generated rules in a separate .mk file since both bsd.prog.mk
and bsd.lib.mk use them.


# 1.65 27-Mar-1997 mycroft

Make the SCRIPTS case mimic the FILES case more closely, so we can override
the destination direectory, etc.


# 1.64 27-Mar-1997 mycroft

Remove knowledge of HIDEGAME from here.


# 1.63 24-Mar-1997 christos

make rules update:
- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation


# 1.62 22-Mar-1997 perry

Fix SYMLINKS not to include DESTDIR in the link itself


# 1.61 13-Mar-1997 perry

add SYMLINKS, by analogy to LINKS. Vetted by Christos.


# 1.60 22-Jan-1997 cgd

if 'clean' is not already defined, rather than simply defining it with
a bunch of rules, define a clean{kmod,lib,prog} target with the rules,
and have both clean and cleandir depend on that. That eliminates a bug
where 'cleandir' in a directory which included e.g. bsd.prog.mk but which
also had subdirs would 'make clean' all the subdirs and then 'make cleandir'
all ofthe subdirs. It also allows Makefiles to add more dependencies
to 'clean' after inclusion of the make template.

If 'clean' is already defined, the behaviour is the same as it used to be.


# 1.59 20-Dec-1996 cgd

add an afterdepend target (a la the one in bsd.lib.mk) that processes
the .depend file to add <filename>.ln for each <filename>.o as an
object file which has the given dependencies (in addition to
<filename>.po and <filename>.so, which were already there).


# 1.58 13-Dec-1996 mikel

add missing LIBPCAP definition.


# 1.57 26-Nov-1996 mrg

add libz and libwrap


# 1.56 18-Oct-1996 thorpej

Use ${INSTALL} rather than "install".
From Simon J. Gerraty <sjg@zen.void.oz.au>, PR #1458.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.55 08-Apr-1996 jtc

Sort LIBFOO definitions and add LIBY; Reported by Mike Long <mike.long@analog.com> in PR #2301.


# 1.54 22-Oct-1995 christos

Added include file <bsd.sys.mk> that contains lex and yacc "parallel aware"
rules. These rules are not turned on by default; they are enabled by setting
the PARALLEL variable.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.53 25-Jun-1995 cgd

oops; fix an rm that might be empty


# 1.52 24-Jun-1995 cgd

update lint rules, but keep linting disabled


# 1.51 10-Jun-1995 mycroft

Define LIBEDIT.


# 1.50 21-Apr-1995 jtc

.include <bsd.nls.mk> unless NONLS is defined.


# 1.49 22-Dec-1994 cgd

specify man pages differently, and document how.


# 1.48 24-Aug-1994 mycroft

Include bsd.own.mk earlier.


# 1.47 20-Jul-1994 cgd

fix from christos, for progs w/o objects


Revision tags: netbsd-1-0-base
# 1.46 06-Jul-1994 mycroft

branches: 1.46.2;
Pull libraries from ${DESTDIR} if set. Kill LDONLY, which is unused and
probably not useful anyway.


# 1.45 30-Jun-1994 cgd

fix modify-info-nothingness-then-substitute probelm that broke genclass build


# 1.44 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.43 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.42 28-Jun-1994 jtc

Strip *.sh when constructing OBJS from SRCS.
This will allow us to clean up makefiles that build a script by munging
a template (uusched, genclass, neqn, etc.).


# 1.41 18-Jun-1994 cgd

don't chown the symlink, when HIDEGAME causes a symlink to be made to dm.
4.4-based FS code _follows_ the symlinks on a chown(2) call.


# 1.40 24-May-1994 cgd

fix the last to do the right thing for dependencies


# 1.39 24-May-1994 deraadt

LIBSKEY


# 1.38 22-May-1994 jtc

Single source file programs are now compiled into object files before they
are linked. This change halves the time it takes to rebuild all of the
NetBSD sources when only the C library is "touched"; but only takes about
one percent more disk space.


# 1.37 06-Apr-1994 chopps

relink (recompile) single source programs when crt0.o is updated.


# 1.36 24-Mar-1994 mycroft

Remove *.core on clean.


# 1.35 09-Feb-1994 cgd

kill install -d's.


# 1.34 28-Jan-1994 cgd

add LIBKVM


# 1.33 10-Nov-1993 cgd

librpc doesn't exist anymore


# 1.32 08-Nov-1993 cgd

ad LDSTATIC flag, so static linking can be made one-stop shopping.
use "setenv LDSTATIC" to make *everything* dynamically linked,
setenv LDSTATIC -static for everything statically linked, or unset
it for default behavior.


# 1.31 07-Oct-1993 cgd

LIBTERM pointed at nothing, but was meant to point to libtermcap.a...


# 1.30 07-Oct-1993 cgd

always define LIBCRYPT


# 1.29 17-Aug-1993 mycroft

Make sure we don't recurse into subdirectories if Makefile specified `install'
target. (It's usually blank and is specifically to avoid doing this...)


# 1.28 15-Aug-1993 mycroft

Automatically include bsd.subdir.mk for backward compatibility.


# 1.27 15-Aug-1993 mycroft

Don't automatically include bsd.subdir.mk in bsd.prog.mk and bsd.lib.mk.
Put back .MAIN in bsd.man.mk, and be careful not to include ../Makefile.inc
a second time.


# 1.26 15-Aug-1993 mycroft

Move man rules to sys.mk.
Use bsd.subdir.mk for building subdirectories.
Don't forget to remove x.cc and x.C when using SHAREDSTRINGS.
Make ${PROG} always depend on ${LIBCRT0}.
Don't duplicate code between cleandir and clean.
Move tags target to bsd.dep.mk.
Move STRIP to bsd.own.mk.
Remove redundant definitions of {BIN,MAN}{DIR,GRP,OWN,MODE}.
Move {LIB,DOC}{DIR,GRP,OWN,MODE} defaults to bsd.own.mk.


# 1.25 15-Aug-1993 mycroft

Abstract out dependency stuff, and add RCS identifiers.


# 1.24 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


# 1.23 10-Aug-1993 mycroft

Put LINKS handling in `install' target, so it's the last thing executed, and
happens even if `realinstall' is user-defined.


# 1.22 30-Jul-1993 mycroft

When generating a default OBJS, ignore .h files.


# 1.21 29-Jul-1993 mycroft

Don't print the `making ...' message if an obj dir already exists.
Also, a minor cleanup.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.20 17-Jul-1993 mycroft

Fix C++ dependencies for good. `make depend' is now done in two passes--one
of C files and one for C++ files. No need to specify `-+' in your Makefile,
as it is now done automatically.


# 1.19 17-Jul-1993 cgd

do c++ dependencies the right way...


# 1.18 17-Jul-1993 mycroft

Add suffix rules for C++ files.


# 1.17 04-Jun-1993 brezak

Add LIBRPCSVC variable.


# 1.16 02-Jun-1993 cgd

add ability to specify c++ dependencies, by setting CFLAGS+=-+ for
the dependency make.


# 1.15 26-Apr-1993 cgd

added definition for DPADD library variable LIBCRYPT.


# 1.14 26-Apr-1993 mycroft

Don't redefine `realinstall' target if already defined.


# 1.13 25-Apr-1993 mycroft

Link with LDFLAGS even if one source module.


# 1.12 25-Apr-1993 mycroft

Don't lose if we include bsd.prog.mk only to build man pages.


# 1.11 25-Apr-1993 mycroft

Fix error in last change. (Oops.)


# 1.10 25-Apr-1993 mycroft

Don't build man pages if NOMAN set.


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.9 09-Apr-1993 cgd

various changes to default make rules. from patch 101.
note that only the "sensible" changes in patch 101 are implemented.


# 1.8 08-Apr-1993 cgd

try to do the right thing, in terms making directories before we
install into them, and get the manpage cleans _OUT_ of "clean".
they don't belong there, only in cleandir, WFJ be damned.


# 1.7 08-Apr-1993 cgd

fixed typos...


# 1.6 08-Apr-1993 cgd

(silently) make sure we have directories before installing


# 1.5 04-Apr-1993 cgd

make LIBRPC point to the right place


# 1.4 27-Mar-1993 nate

Fixed the doc macros to call troff, eqn,and tbl instead of ditroff,
deqn, and dtbl.
Fixed make clean to remove the man pages (Bill fixed this in the distribution,
but not in the original source)
Changed install to leave the original file around, by using 'cp' instead of
'mv'. "install -c ..."


# 1.3 23-Mar-1993 cgd

made .CURDIR be absolute, not relative, thereby eliminating
the need for some of the makefile trickery when making objects,
and fixing a few .PATH bugs


# 1.2 22-Mar-1993 cgd

fixed "make obj" for cases when sources not in /usr/src/...
if sources not there, it now mkdirs obj, but some trickery
is necessary, to avoid deleting cwd.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.340 28-Nov-2021 christos

When we build against DESTDIR, add the lint library path for DESTDIR during
the link phase for lint.


# 1.339 23-Aug-2021 mrg

define variables for the libxcb-* libraries.


# 1.338 15-Aug-2021 christos

Fix sun2 build for ldap/gssapi


# 1.337 14-Aug-2021 christos

Centralize the ldap libraries


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.336 12-Nov-2020 nia

Revert addition of pthread dependency on sqlite.

It is less trivial than expected and introduced some surprising breakage.


# 1.335 09-Nov-2020 christos

- make the CTFCONVERT command lines consistent and concise by putting all
the implementation stuff in a variable CTFCONVERT_RUN
- introduce an OBJECT_TARGET variable that contains the output object file
- when we need to run ctfconvert, go through an intermediate ${.TARGET}.o
file, instead of writing directly to ${.TARGET} and then overwriting
${.TARGET} with ctfconvert. This avoids build failures after a build
got interrupted (the "partially built from C" scourge).


# 1.334 09-Nov-2020 martin

Adapt for sqlite requiring pthreads now


# 1.333 30-Oct-2020 martin

libsqlite3 now requires -lm


# 1.332 16-Oct-2020 nia

share/mk: Define some missing X11 libraries.


# 1.331 15-Jun-2020 christos

Rename blacklist -> blocklist


# 1.330 30-May-2020 christos

Make libuv private, requested by joerg@


# 1.329 24-May-2020 christos

Add libuv


Revision tags: phil-wifi-20200421 phil-wifi-20200411 phil-wifi-20200406
# 1.328 04-Apr-2020 christos

Linker semantics have changed; we now don't automatically link dependent
libraries from other DSO's. For example in /usr/bin/passwd:
ld: krb5_passwd.o: undefined reference to symbol \
'UI_UTIL_read_pw_string@@OPENSSL_1_1_0'
ld: /usr/obj/amd64-x86_64/release/lib/libcrypto.so.14: error adding symbols: \
DSO missing from command line


# 1.327 04-Apr-2020 christos

Fix kerberos libraries order


# 1.326 04-Apr-2020 christos

Add libgnuctf


# 1.325 03-Mar-2020 christos

Add fido and cbor


Revision tags: is-mlppp-base phil-wifi-20191119
# 1.324 18-Nov-2019 christos

Improve the script to check for installed libraries, and fix the wrong
names and obsolete libraries it found.


# 1.323 27-Aug-2019 kamil

Enhance the support of LLVM sanitizers

Define _REENTRANT for MKSANITIZER build. This is needed for at least stdio
code. This caused new build issued with duplicated symbols in few places
and rump kernel code picking different code paths borrowed from libc.
Handle all this in one go.

Add bsd.sanitizer.mk to share common code used by programs and libraries.

Switch from realall to beforeinstall target in .syms files. This is more
reliable in MKSANITIZER.


# 1.322 17-Aug-2019 kamil

Add PAXCTL_FLAG rules for MKSANITIZER

Add per-program rules to disable ASLR for ASan, TSan and MSan in all
sanitized programs. This flag is not needed for other supported sanitizers.

Without this change, sanitized init(8) dies early on startup.

Approach originally suggested by <joerg>


# 1.321 15-Aug-2019 kamil

Add SANITIZER_RENAME_CLASSES in bsd.prog.mk

This adds a more flexible version of SANITIZER_RENAME_SYMBOL.

New symbol allows to specify MKSANITIZER specific renames on per-file and
per-symbol basis.


# 1.320 10-Aug-2019 christos

Make the X11 library lists consistent again.


Revision tags: netbsd-9-base phil-wifi-20190609 pgoyette-compat-20190127
# 1.319 21-Jan-2019 christos

branches: 1.319.2;
Most of the mv operations are to move temporary files to their final place.
Some use -f, others don't. This can lead to spurious build failures when
the user performing the build changes. Centralize, and always use -f.


Revision tags: pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.318 12-Aug-2018 christos

fix broken library variable definitions (inconsistencies between
bsd.README and bsd.prog.mk)


Revision tags: pgoyette-compat-0728
# 1.317 25-Jul-2018 kamil

Introduce MKLIBCSANITIZER in the share/mk rules

Add flags that are required to build a program and a dynamically loaded
library.

Propagade LIBCSANITIZERFLAGS to CFLAGS and CXXFLAGS.

LDFLAGS is not changed on purpose, as a libcsanitizer is inside libc
and no external dependencies are needed.

Register NOLIBCSANITIZER, as certain distribution parts will need to be
skipped.


# 1.316 12-Jul-2018 maxv

Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.


Revision tags: phil-wifi-base
# 1.315 25-Jun-2018 kamil

branches: 1.315.2;
Add a framework for renaming symbols in libc&co for MKSANITIZER

A new keyword SANITIZER_RENAME_SYMBOL. It's a variable that has specified
a list of symbols to be renamed in a processor in order to remove naming
conflicts with public symbols in libc/m/pthread/rt.

This renaming will occur for libraries and programs.
A symbol with a conflicting 'name', will be renamed to '__mksanitizer_name'.

Based on an idea by <christos>


Revision tags: pgoyette-compat-0625
# 1.314 21-Jun-2018 kamil

Refactor MKSANITIZER flags in mk rules

Introduce a new variable SANITIZERFLAGS that contains all the sanitizer
specific flags. These flags are designed to be passed to CFLAGS, CXXFLAGS
and LDFLAGS.

Pass SANITIZERFLAGS in bsd.prog.mk rules to CFLAGS, CXXFLAGS and LDFLAGS.

Pass SANITIZERFLAGS in bsd.lib.mk rules to *_pic.a build flags. The *_pic.a
libraries are designed to construct .so libraries. All .so libraries with
few exceptions are expected to be prebuilt with a sanitizer. Another
purpuse of *_pic.a files can be constructing static PIE programs, however
they are not supported as of now and there is no sanitization of static
programs either.

Once MKSTATICPIE will be supported, it will be initially incompatible with
MKSANITIZER.

This change also makes it easier to build other targets like kernel and
kernel modules without userland sanitizers.

No functional change intended for MKSANITIZER=no users.


# 1.313 02-Jun-2018 christos

Sanitizers don't support static linking.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315
# 1.312 11-Mar-2018 mrg

define LIBXFONT2.


Revision tags: pgoyette-compat-base
# 1.311 25-Feb-2018 mrg

branches: 1.311.2;
add LIBKRB5_LDADD/LIBKRB5_DPADD and their static counterparts
to bsd.prog.mk. use them instead of hard coding various lists
of libraries for krb5.

this fixes static builds.


# 1.310 11-Dec-2017 christos

Instead of checking for obj existance which can be empty for shuttle-rule
programs, check for .sh sources.


# 1.309 10-Dec-2017 christos

don't try to build .debug files for shell scripts.


# 1.308 10-Oct-2017 christos

Add general {DP,LD}ADD.rump variables


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base
# 1.307 21-May-2017 riastradh

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.


# 1.306 21-May-2017 riastradh

Remove some vestiges of MKCRYPTO_IDEA/MKCRYPTO_MDC2.


# 1.305 21-May-2017 riastradh

Remove MKCRYPTO_RC5. Unconditionally include RC5 in libcrypto.so.

This option existed only because RC5 is covered by patents that, twenty
years ago, we had reason to suspect the patent holder, RSA, Inc., might
litigate. The two US patents in question are 5,724,428 and 5,835,600.

According to the USPTO Patent Term Calculator web site at
<https://www.uspto.gov/patent/laws-and-regulations/patent-term-calculator#heading-5>
(retrieved 2017-05-21), patents filed after 1995-06-07 expire twenty
years after the filing date.

number filing date
5,724,428 1995-11-01
5,835,600 1997-04-21

Thus, these patents appear to be expired.

As proposed on tech-crypto and tech-security:

https://mail-index.netbsd.org/tech-crypto/2017/05/05/msg000718.html
https://mail-index.netbsd.org/tech-security/2017/05/05/msg000927.html


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.304 19-Apr-2017 joerg

Add netpgpverify to the library list.


Revision tags: pgoyette-localcount-20170320
# 1.303 20-Feb-2017 rin

add missing LIBCXX


# 1.302 08-Feb-2017 kamil

libpthread_dbg(3) deletion from the base distribution

libpthread_dbg(3) is a remnant library from the M:N thread model
(pre-NetBSD-5.0) API to introspect threads within a process and for use
of debuggers.

Currently in the 1:1 model it's not used in GDB neither in LLDB and it's
not either planned to be used. It's current function to read pthread_t
structures is realizable within a regular debugger capable to
instrospect objects within a tracee (GDB, LLDB...).

Remaining users of this API can still use this library from
pkgsrc/devel/libpthread_dbg.

Sponsored by <The NetBSD Foundation>


# 1.301 29-Jan-2017 christos

add sqlite3 to statically linked libraries for pam.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914
# 1.300 20-Aug-2016 christos

branches: 1.300.2;
unbound additions


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.299 04-Apr-2016 joerg

branches: 1.299.2;
If the per-target LDSTATIC flag is set, don't include the PIE linker
flags as we currently don't support static PIE.


# 1.298 30-Mar-2016 martin

Pass -pie to cc, not -Wl,-pie. This way we have a chance to fix specs
for obscure corner cases like -pie -fPIE -static (used for
/usr/tests/lib/csu/h_initfini2 if building with MKPIE=yes).
While there also replace -fPIC with -fPIE for the PIE case, even if
it should be mostly equivalent.


# 1.297 12-Mar-2016 mrg

remove conditionals that are always true with GCC >= 4.8.


# 1.296 21-Feb-2016 christos

Add NODEBUG


# 1.295 31-Jan-2016 christos

Introduce NOPIE and NOCTF so that standalone programs build properly.


# 1.294 23-Jan-2016 christos

Define _KERNTYPES for things that need it.


# 1.293 07-Nov-2015 joerg

LIBEXECINFO


# 1.292 07-Jun-2015 matt

Make LIBCRT* depend on the right files if MLIBDIR from MKCOMPAT is defined.


# 1.291 01-Dec-2014 erh

PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilt
if any of their dependencies (i.e. the files they refer to) are changed.
This allows changes to transitive included headers to be handled properly.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.290 25-Mar-2014 ozaki-r

branches: 1.290.4;
Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.


Revision tags: riastradh-drm2-base3
# 1.289 09-Mar-2014 christos

let's see if the new dwarf library can handle dwarf 4


# 1.288 02-Mar-2014 christos

If we are compiling with -g and using gcc4.8 and dtrace downgrade
dwarf generation to version 2 for now.


# 1.287 15-Jan-2014 joerg

-Wl,-pie and -r don't agree with each other, so filter the former out.


# 1.286 11-Nov-2013 joerg

Relink binaries if crti.o changes.


# 1.285 29-Sep-2013 christos

Add libxcb


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.284 31-May-2013 mrg

add LIBX11_XCB; unfortunately since the library is named with a -
in it, we have to use an ugly hard coded assignment for now.
(could be cleaned up with more make variable magic i'm sure.)


# 1.283 04-Apr-2013 christos

ldopts should be before ldadd like everywhere else.


Revision tags: agc-symver-base
# 1.282 14-Feb-2013 christos

Since the libraries are produced with different MK flags than the programs,
we check for existance of the files instead of the MK flags.


# 1.281 14-Feb-2013 christos

Add PROGDPLIBS


# 1.280 26-Jan-2013 christos

CTFCONVERT me harder.


Revision tags: yamt-pagecache-base8
# 1.279 17-Jan-2013 christos

Now that we have separate debug sets, add -g if ${MKDEBUG} is set for
program builds since we don't need to install that symbol files.


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.278 24-Aug-2012 jmmv

branches: 1.278.2;
Allow DPADD to be specified on a per-program basis.


# 1.277 23-Aug-2012 joerg

Revert last, it breaks the tricks xsrc uses.


# 1.276 23-Aug-2012 joerg

Remove SHLIBINSTALLDIR and SHLINKINSTALLLIBDIR. Add rpath entries, if
SHLIBDIR differs from /usr/lib.


# 1.275 08-Aug-2012 christos

add MKRUMP by popular demand.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.274 29-Feb-2012 tron

Move "libexpat" from X11 into base which fixes PR lib/40346.
This change was approved by the Core Group.


# 1.273 21-Feb-2012 matt

Remove another ${SIZE}


# 1.272 20-Feb-2012 matt

Remove ${SIZE}


# 1.271 19-Feb-2012 matt

Add support for --combine with gcc.


Revision tags: netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2
# 1.270 05-Nov-2011 christos

branches: 1.270.2;
Add libtre


Revision tags: yamt-pagecache-base
# 1.269 16-Oct-2011 christos

branches: 1.269.2;
- no need to special-case libraries with weird characters.
- add a note about adding new libraries.


# 1.268 16-Oct-2011 christos

fix list of libraries to reflect reality.


# 1.267 10-Sep-2011 apb

Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.


# 1.266 27-Aug-2011 joerg

Add new "analyze" command to run clang's static analyzer in a directory
on all C/C++ files.


Revision tags: cherry-xenmp-base
# 1.265 26-Apr-2011 he

The new Heimdal adds -lwind and -lheimbase to the set of libraries,
so define the corresponding LIB* variables.
These are also needed in the PAM_STATIC_* variables, so add them there too.


# 1.264 11-Apr-2011 joerg

Adjust --sysroot related usage:
-Wl,-rpath does not expand =, so just drop it.

Drop -Wl,-rpath-link entries that duplicate the -Wl,-rpath entries, this
is done implicitly now that ld is built with sysroot support.

Use ${DESTDIR} explicitly for the remaining -Wl,-rpath-link entries.


# 1.263 10-Apr-2011 joerg

For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.


# 1.262 08-Mar-2011 jmmv

Revert previous (revision 1.261): it broke the build because PROG_CXX is
defined in terms of PROG, so later on we would end up with target duplicates
because both PROG_CXX and PROG were being converted to PROGS_CXX and PROGS.

Did not catch this earlier because the test build I did was not clean and
thus the duplicate targets did not have nasty effects.


# 1.261 07-Mar-2011 jmmv

Always convert PROG to its plural form independently of whether PROG_CXX
is defined or not. From Garrett Cooper in private mail.


Revision tags: bouyer-quota2-nbase
# 1.260 20-Feb-2011 jmmv

Define LIBATF_C and LIBATF_CXX to point to their corresponding .a files and
use these to properly set DPADD for test programs.


Revision tags: bouyer-quota2-base
# 1.259 13-Feb-2011 christos

add saslc


# 1.258 06-Feb-2011 joerg

Don't use -nostdinc or -nostdinc++ if this is included in a HOSTLIB.


# 1.257 17-Jan-2011 pooka

branches: 1.257.2;
Add rump bits to DPSRCS so that update builds work correctly.


Revision tags: matt-mips64-premerge-20101231
# 1.256 13-Dec-2010 pooka

befriend RUMPPRG with CRUNCHEDPRG


# 1.255 13-Dec-2010 pooka

Define RUMPPRG, which is just like PROG, except it additionally
builds a rump client with the name rump.${PROG}. The rump client
is not installed suid/sgid by default even if BINMODE is defined.


# 1.254 10-Dec-2010 joerg

Revert last, gcc(1) checks explicitly for -r on some platforms to disable
passing down --relax as well.


# 1.253 08-Dec-2010 joerg

gcc passes down -r directly to ld, so make it explicitly a linker option.


# 1.252 08-Dec-2010 joerg

Don't depend on ${CC} passing down -R to ld, use -Wl,-rpath explicitly.


# 1.251 08-Nov-2010 lukem

Preserve date on original shared library or program when stripping
the debug symbols and adding the debug-link to .debug.
Use '(rm -f file; false)' in the failure path to force failure.
Based on solution proposed by Nicolas Joly on tech-toolchain in July 2010.
Should fix PR toolchain/44046 from Andreas Gustafsson.


# 1.250 31-Oct-2010 mbalmer

Link Lua to the build and add the resulting files to the distribution sets.
Document the addition of Lua and the change we made to the default settings.


# 1.249 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.248 24-Apr-2010 lukem

When extracting separate debug symbols with MKDEBUG, there's no need
to leave the original file unstripped...


# 1.247 02-Mar-2010 darran

DTrace: Add CTF generation to the make framework. Only enabled when
MKDTRACE=yes.


# 1.246 14-Dec-2009 mrg

use "${CC} -r" not "${CC} -Wl,-r" as the latter fools GCC on some targets
and it ends up passing "-r -relax" to ld, which causes ld to barf.


# 1.245 14-Dec-2009 matt

Merge from matt-nb5-mips64


Revision tags: matt-premerge-20091211
# 1.244 08-Dec-2009 uebayasi

When PROGS / LIBS are used, you can pass each PROG / LIB specific parameters
to ${LD} via:

${LDADD.${PROG}}
${LDFLAGS.${PROG}}
${LDSTATIC.${PROG}}
${LDADD.${LIB}}
${LDFLAGS.${LIB}}

OTOH you can't pass parameters to ${CC}, because in suffix rules make(1) only
knows the name of ${.IMPSRC} and ${.TARGET}; it's users' responsivility to
define ${CC} parameters to all the sources of a given ${PROG} / ${LIB}.

Should address bin/42381.

(Bug in this commit log was pointed out by mrg@.)


# 1.243 27-Nov-2009 tsutsui

If CPPFLAGS or CXXFLAGS already contains -nostdinc or -nostdinc++,
don't add ${CPPFLAGS_ISYSTEM} or ${CPPFLAGS_ISYSTEMXX} to refer
${DESTDIR}/usr/include or ${DESTDIR}/usr/include/g++.

This change might cause errors on some MD stand dir, but in that case
each Makefile should be fixed to search proper system include paths
by -Ipath option in own CPPFLAGS.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.242 12-May-2009 plunky

remove libsdp as improved functionality has been enabled in libbluetooth.


# 1.241 10-Apr-2009 apb

Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links. They have no effect except when using a
metalog, in which case the information is added to the metalog. In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg. This should fix PR 24457 and PR 41155.


# 1.240 24-Nov-2008 cube

branches: 1.240.2;
Move cleanextra to the very ends in case another included file wants to add
to it even if it was initially empty.


Revision tags: netbsd-5-base matt-mips64-base2
# 1.239 19-Oct-2008 christos

branches: 1.239.2;
handle assembly files for MKPIE


# 1.238 16-Oct-2008 christos

Provide a way for a program to override the PIE flags.


# 1.237 15-Oct-2008 christos

don't compile/link libraries with pie


Revision tags: mjf-devfs2-base
# 1.236 02-Oct-2008 joerg

Hook up libfetch and pkg_install update.


Revision tags: wrstuden-revivesa-base-3
# 1.235 09-Sep-2008 joerg

Add MKSTRIPIDENT to remove the RCS IDs from binary programs and shared
libraries for space-constraint systems. The description is based on the
feedback of hubertf@, the logic on input from lukem@

This obsoletes the removal of LIBC_SCCS and SYSLIBC_SCCS for libc builds.


Revision tags: wrstuden-revivesa-base-2
# 1.234 28-Aug-2008 mrg

update a comment example


# 1.233 27-Aug-2008 rtr

use ${X11USRLIBDIR} instead of hard-coded /usr/X11R6/lib when building
${LIB.foo} vars


# 1.232 27-Aug-2008 lukem

Fix problem I introduced in rev 1.231 on 2008/08/25 where ${_PROGLDOPTS}
and -L${_GCC_LIBGCCDIR} were appearing in the link line before ${LDADD},
so -L${DESTDIR}/lib and -L${DESTDIR}/usr/lib were being used before
local -L library paths.
Fixes ntpd/ntpdate failure noticed by Valeriy E. Ushakov <uwe@NetBSD.org>


# 1.231 25-Aug-2008 lukem

Always link with: -Wl,-rpath-link,${DESTDIR}/usr/lib -L${DESTDIR}/usr/lib
Fixes problem with MKDYNAMICROOT=no triggered by libraries that depend
on other libraries.
Related to PR 33503.

Clean up setting of _CCLINK to always add the appropriate -B options.

Simplify the link rule for a program.


# 1.230 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.229 28-May-2008 lukem

add LIBLDAR_R (for completeness)


# 1.228 22-May-2008 lukem

Add MKLDAP, USE_LDAP, LIBLBER, LIBLDAP


Revision tags: hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-pf42-base
# 1.227 10-Apr-2008 tsutsui

branches: 1.227.2; 1.227.4;
Add libhx509 to PAM_STATIC_LDADD which is required by libkrb5.


# 1.226 22-Mar-2008 mlelstv

branches: 1.226.2;
Import Heimdal-1.1


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase matt-armv6-base hpcarm-cleanup-base
# 1.225 26-Dec-2007 jmmv

Make the clean target work when OBJS is set but PROG is not, as happens
for example in gnu/lib/crtstuff4. Reported by drochner@.


Revision tags: cube-autoconf-base
# 1.224 13-Nov-2007 jmmv

Fix typo that prevented MKDEBUG builds to work. Found by drochner@.


# 1.223 12-Nov-2007 jmmv

Add the ability to build multiple programs from a single directory

This adds support for a new set of variables, PROGS and PROGS_CXX, that
allow the developer to build multiple different programs from a single
source directory.


# 1.222 04-Nov-2007 tls

Remove MKPRIVATELIB from BIND libraries; move library reachover
directories and Makefiles from src/usr.sbin/bind to src/lib; make
BIND libraries build shared. Saves about 1MB-1.5MB per installed
executable, about 5MB for a base+etc minimal installation of NetBSD.


Revision tags: matt-mips64-base
# 1.221 29-Jul-2007 joerg

branches: 1.221.4; 1.221.6;
Add build glue for libarchive and update the various sets.


# 1.220 25-Jan-2007 perry

Before I completely forget the issue, convert "PROG_PAX" to the
better-named "PAXCTL_FLAGS".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.219 11-Nov-2006 christos

don't run paxctl if other commands were specified for that target.


# 1.218 10-Nov-2006 christos

if ${PROG_PAX} is defined, run paxctl on the binary after linking with
the value of the variable. This way, if you set:

PROG_PAX=+M

in /etc/mk.conf, you get what you deserve.


# 1.217 22-Oct-2006 pooka

libpuffs


# 1.216 09-Oct-2006 mrg

- clean up some comments to reality.
- retire LIBDCK, LIBG2C and (long broken) USE_LIBSTDCXX
- in bsd.hostprog.mk's LIBSTDCPP -> LIBSTDCC
- add LIBSUPCXX
- don't default USE_LIBSTDCXX or USE_GCC4 since they are
not used in the tree any where
- same with USE_XF86_4; retire it
- remove _SUPCXX handling in bsd.prog.mk

inspired by PR#26714.


Revision tags: abandoned-netbsd-4-base
# 1.215 23-Jul-2006 lukem

Implement MKDEBUG:
If "no", don't build and install separate debugging symbols
into /usr/libdata/debug.
Default: no


# 1.214 19-Jun-2006 gdamore

Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.


# 1.213 09-Jun-2006 christos

PR/33681: Scott Ellis: Building 'bc' with SHAREDSTRINGS=yes fails
We need CPPFLAGS too now.


# 1.212 11-May-2006 mrg

add support for ${OBJCOPTS} and ${OBJCOPTS}.<lib|prog|fn>.


# 1.211 20-Mar-2006 christos

There is always one more KRB4 thing to remove. (from Jukka Salmi)


# 1.210 20-Mar-2006 christos

Remove krb4 variables and libraries (Jukka Salmi)


# 1.209 16-Mar-2006 jwise

Now that we have real build system support for syspkgs, remove someone's
half-implemented idea of building `syspkgs' (really a few giant blobs of the
same granularity of the old sets) using install(1).


# 1.208 20-Jan-2006 christos

Add the world of libraries to the static pam build. Now static pam binaries
work.


# 1.207 09-Apr-2005 dsl

Report when we link a program into xxx.ro (before being crunched)


Revision tags: netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.206 04-Mar-2005 he

branches: 1.206.2; 1.206.4;
Introduce PAM_STATIC_LDADD and PAM_STATIC_DPADD. When compiling
with MKPIC=no, possibly because the target does not support shared
libraries, these include libraries required to resolve all symbols
which end up referenced from PAM-using applications. The libraries
presently required are -lcrypt, -lrpcsvc and -lutil.

Add use of these variables which are currently set up to use PAM,
so that they compile when MKPIC=no.

Also, in the telnetd case, reorder the order of the libraries, so
that libtelnet.a comes before -ltermcap and -lutil, again to fix
link error when MKPIC=no.

Discussed with thorpej and christos.


# 1.205 20-Feb-2005 christos

Add libradius


# 1.204 12-Jan-2005 lukem

If RESCUEDIR is defined, automatically add that to CPPFLAGS


# 1.203 08-Jan-2005 lukem

Implement <bsd.prog.mk> vars:
LIBASN1 LIBBSDMALLOC LIBG2C LIBPAM LIBSSH


# 1.202 04-Aug-2004 lukem

Revert most of previous, and move the LIB<libname>?= assignments
back to bsd.prog.mk from bsd.own.mk.

pkgsrc uses <bsd.own.mk>, and setting LIB<libname> in it causes
problems with various package builds.
This should fix PR #26542 submitted by Jim Bernard.

(I'll be implementing the DPADD for shared libraries in a different
manner that generally won't depend upon ${LIB<libname>}.)


# 1.201 30-Jul-2004 lukem

Move the LIB<libname>?= assignments from bsd.prog.mk to bsd.own.mk so
that they may be used by non PROGs (e.g., LIBs).

Improve some comments.


# 1.200 10-Jun-2004 lukem

Be consistent in handling YHEADER, similar to Christos' fix in bsd.lib.mk 1.253


# 1.199 21-May-2004 ross

If you add a library, you need to define its DPADD symbol here.

Add LIBMAGIC.


Revision tags: netbsd-2-0-base
# 1.198 15-Feb-2004 skrll

branches: 1.198.2;
Be more gcc like in the way we deal with libgcc so that sh3/hppa millicode
and exception handling have a chance of working properly.

- creates libgcc, libgcc_eh and libgcc_s

- updates LIBGCC_SPEC to use them appropriately.

There's a hack in here at the moment with respect to libgcc_so in that it
is preferable to link against libgcc_so will only when -shared-libgcc is
specified (the c++ frontend does this automatically.) Configurations where
LINK_EH_SPEC is defined already do this. The gcc configuration for
NetBSD/alpha and another NetBSD platform (I forget which) actually define
LINK_EH_SPEC probably by accident rather than design.

- updates share/mk to use the compiler's knowledge of what needs linking into
libraries and executables. This removes an hppa hack.

- updates the sets for the newly created libgcc* files.

- support for linking against the _pg version of libgcc has been removed.


# 1.197 29-Jan-2004 lukem

Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.


# 1.196 27-Jan-2004 lukem

Replace
:M-[IDU]*
with
:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)


# 1.195 23-Jan-2004 simonb

crt0.o lives in /usr/lib even on a.out.


# 1.194 16-Nov-2003 lukem

simplify with _MKTARGET_LINK


# 1.193 11-Nov-2003 dsl

Set MKDEP_SUFFIXES to get additional targets in .depend instead of using
sed in .afterdepend. I don't think .afterdepend is used anywhere any more.


# 1.192 21-Oct-2003 lukem

Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.


# 1.191 19-Oct-2003 lukem

Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} " ... {$.TARGET}" and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO


# 1.190 18-Oct-2003 lukem

Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command ("verbose")
This is the default, and is equivalent to the previous behaviour.


# 1.189 29-Sep-2003 lukem

Add LIBSTDCXX (for usr/lib/libstdc++.a).
Sync LIB* documentation with reality.


# 1.188 19-Sep-2003 martin

Drop explicit medlow model and default to -O2 for sparc64.


# 1.187 14-Sep-2003 lukem

Check ${SHLIBDIR} against "/usr/lib" instead of ${LIBDIR} when determining
if we need to add stuff (usually "/lib") to the rpath-link path before
"/usr/lib". Otherwise, this barfs if LIBDIR != /usr/lib or /lib, and
we're cross-building (e.g., in src/x11)


# 1.186 13-Sep-2003 erh

Also support per-program LDFLAGS and LDSTATIC.


# 1.185 13-Sep-2003 erh

Create a way to add additional flags to COPTS, CPPFLAGS, CXXFLAGS and LDADD
for particular libraries or programs by specifying the additions in mk.conf
instead of needing to go edit individual Makefiles.


# 1.184 12-Sep-2003 lukem

add infrastructure to support reach-over builds of xsrc


# 1.183 22-Aug-2003 dsl

Add a ${PROG}.ro target that does an 'ld -r' of the program object files.
Allows a much simplified build of 'crunched' binaries since crunchgen can
build prog.ro instead of having to deretmine the names of all the .o files.


# 1.182 01-Aug-2003 lukem

Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".


# 1.181 01-Aug-2003 lukem

simplify the ${PROG}: target to reduce duplication between the DESTDIR
and !DESTDIR cases...


# 1.180 31-Jul-2003 lukem

bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.


# 1.179 31-Jul-2003 lukem

Don't need -R/usr/lib; it will be searched at the end by ld.elf_so anyway.
Noted by matt green <mrg@>


# 1.178 28-Jul-2003 lukem

be consistent when adding *.y and *.l to DPSRCS


# 1.177 28-Jul-2003 lukem

replace MKCXXSUPCXX(!=no) with USE_LIBSTDCXX(==no)


# 1.176 28-Jul-2003 lukem

Change defined(CXX_SUPCXX) to MKCXXSUPCXX != "no".

Clarify that command-line overrides of the MKxxx variables should be
done via the environment rather than make(1) command-line variable
assignment, since the latter doesn't actually work as intended.


# 1.175 27-Jul-2003 mrg

introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes. for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)


# 1.174 26-Jul-2003 mrg

add a new bsd.own.mk variable: CXX_SUPCXX. from bsd.README:
+ CXX_SUPCXX If defined, the support libraries needed for this C++ program
+ are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.


# 1.173 20-Jul-2003 lukem

Consistently support the different C++ file extensions: .cc .cpp .cxx .C
Noted by Andrew White in PR toolchain/18246


# 1.172 18-Jul-2003 lukem

Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was defined.
Replace defined(UNPRIVED) tests with ${MKUNPRIVED} != "no"

Add MKUPDATE; if not no has the same semantics as if UPDATE was defined.
Replace defined(UPDATE) tests with ${MKUPDATE} != "no"

Improve documentation for these and other make flags.


# 1.171 16-Jul-2003 itojun

stop installing install libtelnet. build under lib/libtelnet and reference
it from usr.bin/telnet and libexec/telnetd.
(reason for separate build: compiler flags)


# 1.170 27-Jun-2003 drochner

For consistency, use "-R" instead of "-Wl,-rpath" to pass
a runtime search path to the linker.


# 1.169 13-Jun-2003 itojun

define LIBEVENT


# 1.168 11-Jun-2003 msaitoh

catch signal 1,2,3,13 and 15 to clean /tmp/_dependXXX


# 1.167 31-May-2003 thorpej

If EXTERNAL_TOOLCHAIN is defined, allow the compiler to define the
location of crt{begin,end}{,S}.o and libgcc.a. Encapsulate all of
this logic into the new bsd.gcc.mk, and use it in bsd.prog.mk and
bsd.lib.mk.


# 1.166 18-May-2003 lukem

make this a no-op if HOSTPROG is defined


# 1.165 30-Mar-2003 thorpej

If MACHINE_ARCH is powerpc and we HAVE_GCC3, add crtsaveres.o to the
endfile spec.


# 1.164 22-Feb-2003 uwe

Typo in comment.


# 1.163 24-Jan-2003 thorpej

Add LIBPTHREAD, LIBPTHREAD_DB, and LIBRT.


Revision tags: fvdl_fs64_base
# 1.162 22-Nov-2002 thorpej

Split crtbegin/crtend into crti/crtbegin/crtend/crtn. NetBSD-specific
things like the .note.netbsd.ident section are provided by crti/crtn.
crti/crtn also provide the _init() and _fini() routines.

crtbegin/crtend now only provide support for ctors/dtors. This paves
the way to using the "crtstuff" provided with GCC (when we upgrade to
GCC 3.3), which provides, among other things, much better C++/Java
exception handling.


# 1.161 12-Nov-2002 itohy

MKDYNAMICROOT for a.out


# 1.160 22-Oct-2002 perry

Pass 1 of SYSPKG changes to automatically add tags=pkgname_pkg to METALOG.
Not quite ready for prime time yet.


# 1.159 27-Sep-2002 thorpej

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.


# 1.158 26-Sep-2002 itojun

MDC2 is a patented algorithm; don't ship it in default libcrypto.
MKCRYPTO_MDC2 will build a separate library, libcrypto_mdc2.


# 1.157 08-Sep-2002 thorpej

Build a .gdbinit in the objdir when building a program. The .gdbinit
file sets the shared library prefix to ${DESTDIR}, and adds "sources"
directives for each file listed in the GDBINIT Makefile variable.


# 1.156 09-Aug-2002 thorpej

Add LIBPMC.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.155 27-Mar-2002 eeh

branches: 1.155.2;
Use the medium low model for sparc64 programs that don't 2GB of data segment.


# 1.154 11-Feb-2002 mycroft

Don't use .PHONY for targets that are actually installed. Instead use force
dependencies. (Among other things, `make -t install' does something vaguely
sensible now.)


# 1.153 07-Feb-2002 pk

Mark installed system libraries as .MADE only if we're actually establishing
their default variable values here.


# 1.152 04-Feb-2002 christos

s/.NOSUFF/.MADE/


# 1.151 03-Feb-2002 christos

Apply a .NOSUFF: directive to targets we don't want to have processed by
the suffix rules engine.


# 1.150 02-Feb-2002 veego

Ups, it is LIBUSBHID and not LIBUSBHIB.


# 1.149 02-Feb-2002 veego

Change LIBUSB to LIBUSBHIB, reflecting the library name change.


# 1.148 29-Jan-2002 enami

Mark the targets clean{extra,objs} as PHONY.


# 1.147 04-Jan-2002 thorpej

For PROG_CXX DESTDIR builds, pull in -lstdc++ and -lm regardless
of GCC version.


# 1.146 01-Jan-2002 thorpej

Per a suggestion from matthew green, PROG_CXX takes the place of
PROG for C++ programs.


# 1.145 01-Jan-2002 thorpej

* If PROG_CXX is set by the program's Makefile, use ${CXX} to link
the program rather than ${CC}.
* If HAVE_GCC3 is defined, pull in "-lstdc++ -lm" as additional C++
support libraries for DESTDIR builds.


# 1.144 28-Dec-2001 lukem

* 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


# 1.143 28-Nov-2001 tv

If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.


# 1.142 19-Nov-2001 thorpej

Use a little transitional hack to determine if we use -isystem
or -idirafter. Use the former only of USE_NEW_TOOLCHAIN, since
-isystem causes the old toolchain to bomb out when building
libstdc++.


# 1.141 14-Nov-2001 tv

C/..$/.c/ -> C/\..$/.c/


# 1.140 14-Nov-2001 tv

Move the DESTDIR-based nostdinc logic to bsd.lib.mk and bsd.prog.mk where
it belongs (with the native target compile rules).


# 1.139 02-Nov-2001 tv

Use INSTALL_FILE/INSTALL_DIR as appropriate.


# 1.138 02-Nov-2001 tv

Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.


# 1.137 19-Oct-2001 tv

Add .NOPATH for all files generated from .l or .y files in SRCS. Fixes PRs
bin/14187 and lib/14239.

Also simplify the handling of these transforms to .c and .h files a bit by
leveraging make's builtin macro operators.


# 1.136 25-Sep-2001 tv

Set .NOPATH on program to build to make sure it goes in .OBJDIR.
Problem noted by <seebs@plethora.net>.


# 1.135 24-Sep-2001 lukem

fix previous (hi thor!) - $OBJS and $CLEANFILES might be empty, and
rm needs some files to delete...


# 1.134 24-Sep-2001 tls

Split "cleanprog" target apart: now you can zap only object files or
CLEANFILES (needed to fix crunchgen lossage).


# 1.133 13-Sep-2001 thorpej

Add LIBPCI.


# 1.132 14-Aug-2001 tv

Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").


# 1.131 01-Jun-2001 tv

Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).


# 1.130 08-May-2001 sommerfeld

Suppress duplicate entries in ALLFILES, FILES, INCS, DEPINCS, INFOFILES,
NLSALL, CATPAGES, MANPAGES, HTMLPAGES, and SCRIPTS.


# 1.129 19-Feb-2001 jmc

Wrap target() checks around afterdepend rule as some Makefiles override this


# 1.128 26-Jan-2001 itojun

fix typo in LIBSSL decl. it made programs with DPADD+=${LIBSSL} to build
every time we type "make". From: bernd


# 1.127 14-Jan-2001 christos

use the new .if commands(<target>) directive so that we don't have to
change Makefiles.


# 1.126 14-Jan-2001 christos

fix thinko: test for the existance of the target before we define it...


# 1.125 14-Jan-2001 christos

Alter previous redefined target protection. If the ${PROG} target is defined,
add the dependencies as usual, but don't add the commands. This avoids
having to change all the Makefiles that redefine the PROG target.


# 1.124 14-Jan-2001 christos

allow programs to override the program target.


# 1.123 08-Jan-2001 mrg

add missing $LIBCRYPTO_RC5 and $LIBCRYPTO_IDEA


# 1.122 08-Jan-2001 mrg

add missing $LIBSSL


# 1.121 04-Jan-2001 garbled

Add LIBCDK and LIBFORM definitions


# 1.120 31-Oct-2000 itojun

add ${LIBINTL} for use with DPADD.


# 1.119 07-Oct-2000 deberg

fix typos, PR 11159


# 1.118 25-Jun-2000 erh

For the case when DESTDIR is set: move the -L${DESTDIR}/usr/lib after ${LDADD} so any -L directories set in LDADD are searched first to avoid possibly linking against old versions of libraries.


Revision tags: netbsd-1-5-base
# 1.117 19-Jun-2000 thorpej

branches: 1.117.2;
Sync up the LIB* list.


# 1.116 10-Jun-2000 mycroft

Use ${.ALLSRC:T} when doing the generated variable name lookups, so that it
DTRT for generated files in and obj directory (or accessed via .PATH).


# 1.115 06-Jun-2000 mycroft

Abuse .USE some more.


# 1.114 06-Jun-2000 mycroft

Minor rearrangement.


# 1.113 06-Jun-2000 mycroft

Use ODE make(1) features to eliminate extra variables and move several things
outside of .for loops. (Needs more work to completely eliminate .for.)

XXX Don't look at this stuff. It will make your head hurt.


Revision tags: minoura-xpg4dl-base
# 1.112 14-Apr-2000 mrg

branches: 1.112.2;
use -rpath-link rather than -R when linking objects using a DESTDIR.
this replaces the previous change as that ended up adding
$DESTDIR/usr/lib to the runtime path of every binary created, which
is bogus and dangerous.


# 1.111 25-Mar-2000 mycroft

When linking with $DESTDIR, use an explicit -R to get library dependencies
correct.


# 1.110 07-Mar-2000 veego

Remove unused libahdi.
It will be replaced in the future with a more generic libdisklabel.


# 1.109 05-Feb-2000 jdc

Add libahdi entries.


# 1.108 23-Jan-2000 eeh

Add some support for FCode binaries.


# 1.107 22-Jan-2000 mycroft

Make `dependall' play nicely with SUBDIR, using a hack similar to `realinstall'
for both `depend' and `all'.
Also, remove the old hack that invokes an extra shell for .depend, now that
make(1) has been fixed.


# 1.106 16-Jan-2000 assar

all: depend on ${SCRIPTS} so that they get generated if they need to


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.105 23-Nov-1999 blymn

Added libmenu library.


Revision tags: comdex-fall-1999-base
# 1.104 14-Sep-1999 perry

branches: 1.104.4;
Add a "dependall" target, which does a "make depend" and then "make all"
in a single directory. This is useful in "make build" because by doing
the build immediately after the depend, all sources will typically
still be in the buffer cache, thus saving significant time over doing
a "make depend" on all the directories and then a "make all".


# 1.103 04-Sep-1999 fredb

Permit "make all install", as well as "make foo install" (where foo would be
installed by "make install") without setting of BUILD. All cases where BUILD
is already set are unchanged from the old behavior.

"make all install" is now practically equivalent to "make BUILD= all install",
but without actually setting build.

Fixes pr's 8313, 3894.


# 1.102 21-Aug-1999 simonb

Add ${INSTPRIV} to ${INSTALL} commands.


# 1.101 01-Jul-1999 itojun

branches: 1.101.2;
add LIBIPSEC for use from DPADD.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.100 12-Feb-1999 lukem

branches: 1.100.2;
* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.99 10-Feb-1999 tv

libbfd_pic.a is no longer installed; remove ${LIBBFD} define.


# 1.98 04-Feb-1999 christos

PR/2936: Brian C. Grayson: Avoid truncating precious files when installing
and the filesystem is full. Added ${RENAME} flag to install, which when set
to -r installs on a temporary file and then renames to the final destination.
${RENAME} is currently set to nothing in bsd.own.mk, but one can turn it
on in /etc/mk.conf.


# 1.97 07-Nov-1998 jonathan

Do DESTDIR support for crtbegin/crtend on all ELF ports (adds mips).


# 1.96 28-Sep-1998 christos

Use preserve flag in install.


# 1.95 10-Sep-1998 ross

Define a LIBBZ2?=... for use in DPADD=... lines.


# 1.94 09-Aug-1998 lukem

add distclean as a synonym for cleandir


# 1.93 09-Apr-1998 tv

.y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.


# 1.92 01-Apr-1998 tv

Revert. This broke too much in the build tree, and a better solution
needs to be created. (The existing situation breaks a lot too.)


# 1.91 01-Apr-1998 tv

Fix .y rules to DTRT with possibly generated .h files. See mail on
tech-toolchain for a very detailed explanation of this. In short, add
a .y.h rule identical to the .y.c rule and make the .y.c rule rename
the .h file; also, clean the .h file in CLEANFILES.


# 1.90 03-Nov-1997 cgd

echo the lint command line when making 'lint'.


# 1.89 28-Oct-1997 lukem

add ${LIBOBJC}


Revision tags: netbsd-1-3-base
# 1.88 11-Oct-1997 mycroft

branches: 1.88.2;
Several changes:
* Allow bsd.man.mk to be included separately.
* Always include bsd.own.mk and bsd.obj.mk.
* Include bsd.man.mk and bsd.nls.mk even if NOMAN or NONLS; just turn off
building of the affected files instead.
* Require bsd.subdir.mk to be included explicitly.
(Will make appropriate changes to Makefiles shortly.)


# 1.87 29-Sep-1997 gwr

Add $LIBBFD


# 1.86 31-May-1997 cjs

Back out BUILDDIR and NOINSTALL changes.


# 1.85 26-May-1997 cjs

branches: 1.85.2;
These updates to the build allow building against include files
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.


# 1.84 18-May-1997 kleink

Add libposix.


# 1.83 17-May-1997 mycroft

Do LINKS and SYMLINKS after FILES and INCS.


# 1.82 17-May-1997 mycroft

Remove unneeded .SUFFIXES lines, and move .s and .S closer to .o to give the
right preferences.


# 1.81 09-May-1997 mycroft

Fix typo in previous.


# 1.80 09-May-1997 mycroft

Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.79 09-May-1997 mycroft

Remove cruft.


# 1.78 09-May-1997 mycroft

Oops; rearrange dependencies to get things built early enough.


# 1.77 09-May-1997 mycroft

Make sure INCS and SRCS are built if necessary.


# 1.76 08-May-1997 gwr

Set the .NOPATH flag for ${OBJS} (from Christos).


# 1.75 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.74 07-May-1997 mycroft

Various simplifications.


# 1.73 07-May-1997 mycroft

Shuffle some .PHONYs around, to work better with `-t'.


# 1.72 06-May-1997 mycroft

Make most of the install targets .PRECIOUS.


# 1.71 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.70 18-Apr-1997 christos

Add ${LIBNTP}


# 1.69 17-Apr-1997 thorpej

- Properly depend on crtbegin.o and crtend.o for platforms that use
them (currently Alpha and PowerPC)
- STRIP -> STRIPFLAG


# 1.68 03-Apr-1997 mikel

don't allow override of all: target


# 1.67 29-Mar-1997 mikel

merge lite-2 changes (mostly SCCSids)


# 1.66 27-Mar-1997 christos

Put the FILES generated rules in a separate .mk file since both bsd.prog.mk
and bsd.lib.mk use them.


# 1.65 27-Mar-1997 mycroft

Make the SCRIPTS case mimic the FILES case more closely, so we can override
the destination direectory, etc.


# 1.64 27-Mar-1997 mycroft

Remove knowledge of HIDEGAME from here.


# 1.63 24-Mar-1997 christos

make rules update:
- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation


# 1.62 22-Mar-1997 perry

Fix SYMLINKS not to include DESTDIR in the link itself


# 1.61 13-Mar-1997 perry

add SYMLINKS, by analogy to LINKS. Vetted by Christos.


# 1.60 22-Jan-1997 cgd

if 'clean' is not already defined, rather than simply defining it with
a bunch of rules, define a clean{kmod,lib,prog} target with the rules,
and have both clean and cleandir depend on that. That eliminates a bug
where 'cleandir' in a directory which included e.g. bsd.prog.mk but which
also had subdirs would 'make clean' all the subdirs and then 'make cleandir'
all ofthe subdirs. It also allows Makefiles to add more dependencies
to 'clean' after inclusion of the make template.

If 'clean' is already defined, the behaviour is the same as it used to be.


# 1.59 20-Dec-1996 cgd

add an afterdepend target (a la the one in bsd.lib.mk) that processes
the .depend file to add <filename>.ln for each <filename>.o as an
object file which has the given dependencies (in addition to
<filename>.po and <filename>.so, which were already there).


# 1.58 13-Dec-1996 mikel

add missing LIBPCAP definition.


# 1.57 26-Nov-1996 mrg

add libz and libwrap


# 1.56 18-Oct-1996 thorpej

Use ${INSTALL} rather than "install".
From Simon J. Gerraty <sjg@zen.void.oz.au>, PR #1458.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.55 08-Apr-1996 jtc

Sort LIBFOO definitions and add LIBY; Reported by Mike Long <mike.long@analog.com> in PR #2301.


# 1.54 22-Oct-1995 christos

Added include file <bsd.sys.mk> that contains lex and yacc "parallel aware"
rules. These rules are not turned on by default; they are enabled by setting
the PARALLEL variable.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.53 25-Jun-1995 cgd

oops; fix an rm that might be empty


# 1.52 24-Jun-1995 cgd

update lint rules, but keep linting disabled


# 1.51 10-Jun-1995 mycroft

Define LIBEDIT.


# 1.50 21-Apr-1995 jtc

.include <bsd.nls.mk> unless NONLS is defined.


# 1.49 22-Dec-1994 cgd

specify man pages differently, and document how.


# 1.48 24-Aug-1994 mycroft

Include bsd.own.mk earlier.


# 1.47 20-Jul-1994 cgd

fix from christos, for progs w/o objects


Revision tags: netbsd-1-0-base
# 1.46 06-Jul-1994 mycroft

branches: 1.46.2;
Pull libraries from ${DESTDIR} if set. Kill LDONLY, which is unused and
probably not useful anyway.


# 1.45 30-Jun-1994 cgd

fix modify-info-nothingness-then-substitute probelm that broke genclass build


# 1.44 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.43 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.42 28-Jun-1994 jtc

Strip *.sh when constructing OBJS from SRCS.
This will allow us to clean up makefiles that build a script by munging
a template (uusched, genclass, neqn, etc.).


# 1.41 18-Jun-1994 cgd

don't chown the symlink, when HIDEGAME causes a symlink to be made to dm.
4.4-based FS code _follows_ the symlinks on a chown(2) call.


# 1.40 24-May-1994 cgd

fix the last to do the right thing for dependencies


# 1.39 24-May-1994 deraadt

LIBSKEY


# 1.38 22-May-1994 jtc

Single source file programs are now compiled into object files before they
are linked. This change halves the time it takes to rebuild all of the
NetBSD sources when only the C library is "touched"; but only takes about
one percent more disk space.


# 1.37 06-Apr-1994 chopps

relink (recompile) single source programs when crt0.o is updated.


# 1.36 24-Mar-1994 mycroft

Remove *.core on clean.


# 1.35 09-Feb-1994 cgd

kill install -d's.


# 1.34 28-Jan-1994 cgd

add LIBKVM


# 1.33 10-Nov-1993 cgd

librpc doesn't exist anymore


# 1.32 08-Nov-1993 cgd

ad LDSTATIC flag, so static linking can be made one-stop shopping.
use "setenv LDSTATIC" to make *everything* dynamically linked,
setenv LDSTATIC -static for everything statically linked, or unset
it for default behavior.


# 1.31 07-Oct-1993 cgd

LIBTERM pointed at nothing, but was meant to point to libtermcap.a...


# 1.30 07-Oct-1993 cgd

always define LIBCRYPT


# 1.29 17-Aug-1993 mycroft

Make sure we don't recurse into subdirectories if Makefile specified `install'
target. (It's usually blank and is specifically to avoid doing this...)


# 1.28 15-Aug-1993 mycroft

Automatically include bsd.subdir.mk for backward compatibility.


# 1.27 15-Aug-1993 mycroft

Don't automatically include bsd.subdir.mk in bsd.prog.mk and bsd.lib.mk.
Put back .MAIN in bsd.man.mk, and be careful not to include ../Makefile.inc
a second time.


# 1.26 15-Aug-1993 mycroft

Move man rules to sys.mk.
Use bsd.subdir.mk for building subdirectories.
Don't forget to remove x.cc and x.C when using SHAREDSTRINGS.
Make ${PROG} always depend on ${LIBCRT0}.
Don't duplicate code between cleandir and clean.
Move tags target to bsd.dep.mk.
Move STRIP to bsd.own.mk.
Remove redundant definitions of {BIN,MAN}{DIR,GRP,OWN,MODE}.
Move {LIB,DOC}{DIR,GRP,OWN,MODE} defaults to bsd.own.mk.


# 1.25 15-Aug-1993 mycroft

Abstract out dependency stuff, and add RCS identifiers.


# 1.24 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


# 1.23 10-Aug-1993 mycroft

Put LINKS handling in `install' target, so it's the last thing executed, and
happens even if `realinstall' is user-defined.


# 1.22 30-Jul-1993 mycroft

When generating a default OBJS, ignore .h files.


# 1.21 29-Jul-1993 mycroft

Don't print the `making ...' message if an obj dir already exists.
Also, a minor cleanup.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.20 17-Jul-1993 mycroft

Fix C++ dependencies for good. `make depend' is now done in two passes--one
of C files and one for C++ files. No need to specify `-+' in your Makefile,
as it is now done automatically.


# 1.19 17-Jul-1993 cgd

do c++ dependencies the right way...


# 1.18 17-Jul-1993 mycroft

Add suffix rules for C++ files.


# 1.17 04-Jun-1993 brezak

Add LIBRPCSVC variable.


# 1.16 02-Jun-1993 cgd

add ability to specify c++ dependencies, by setting CFLAGS+=-+ for
the dependency make.


# 1.15 26-Apr-1993 cgd

added definition for DPADD library variable LIBCRYPT.


# 1.14 26-Apr-1993 mycroft

Don't redefine `realinstall' target if already defined.


# 1.13 25-Apr-1993 mycroft

Link with LDFLAGS even if one source module.


# 1.12 25-Apr-1993 mycroft

Don't lose if we include bsd.prog.mk only to build man pages.


# 1.11 25-Apr-1993 mycroft

Fix error in last change. (Oops.)


# 1.10 25-Apr-1993 mycroft

Don't build man pages if NOMAN set.


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.9 09-Apr-1993 cgd

various changes to default make rules. from patch 101.
note that only the "sensible" changes in patch 101 are implemented.


# 1.8 08-Apr-1993 cgd

try to do the right thing, in terms making directories before we
install into them, and get the manpage cleans _OUT_ of "clean".
they don't belong there, only in cleandir, WFJ be damned.


# 1.7 08-Apr-1993 cgd

fixed typos...


# 1.6 08-Apr-1993 cgd

(silently) make sure we have directories before installing


# 1.5 04-Apr-1993 cgd

make LIBRPC point to the right place


# 1.4 27-Mar-1993 nate

Fixed the doc macros to call troff, eqn,and tbl instead of ditroff,
deqn, and dtbl.
Fixed make clean to remove the man pages (Bill fixed this in the distribution,
but not in the original source)
Changed install to leave the original file around, by using 'cp' instead of
'mv'. "install -c ..."


# 1.3 23-Mar-1993 cgd

made .CURDIR be absolute, not relative, thereby eliminating
the need for some of the makefile trickery when making objects,
and fixing a few .PATH bugs


# 1.2 22-Mar-1993 cgd

fixed "make obj" for cases when sources not in /usr/src/...
if sources not there, it now mkdirs obj, but some trickery
is necessary, to avoid deleting cwd.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.339 23-Aug-2021 mrg

define variables for the libxcb-* libraries.


# 1.338 15-Aug-2021 christos

Fix sun2 build for ldap/gssapi


# 1.337 14-Aug-2021 christos

Centralize the ldap libraries


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.336 12-Nov-2020 nia

Revert addition of pthread dependency on sqlite.

It is less trivial than expected and introduced some surprising breakage.


# 1.335 09-Nov-2020 christos

- make the CTFCONVERT command lines consistent and concise by putting all
the implementation stuff in a variable CTFCONVERT_RUN
- introduce an OBJECT_TARGET variable that contains the output object file
- when we need to run ctfconvert, go through an intermediate ${.TARGET}.o
file, instead of writing directly to ${.TARGET} and then overwriting
${.TARGET} with ctfconvert. This avoids build failures after a build
got interrupted (the "partially built from C" scourge).


# 1.334 09-Nov-2020 martin

Adapt for sqlite requiring pthreads now


# 1.333 30-Oct-2020 martin

libsqlite3 now requires -lm


# 1.332 16-Oct-2020 nia

share/mk: Define some missing X11 libraries.


# 1.331 15-Jun-2020 christos

Rename blacklist -> blocklist


# 1.330 30-May-2020 christos

Make libuv private, requested by joerg@


# 1.329 24-May-2020 christos

Add libuv


Revision tags: phil-wifi-20200421 phil-wifi-20200411 phil-wifi-20200406
# 1.328 04-Apr-2020 christos

Linker semantics have changed; we now don't automatically link dependent
libraries from other DSO's. For example in /usr/bin/passwd:
ld: krb5_passwd.o: undefined reference to symbol \
'UI_UTIL_read_pw_string@@OPENSSL_1_1_0'
ld: /usr/obj/amd64-x86_64/release/lib/libcrypto.so.14: error adding symbols: \
DSO missing from command line


# 1.327 04-Apr-2020 christos

Fix kerberos libraries order


# 1.326 04-Apr-2020 christos

Add libgnuctf


# 1.325 03-Mar-2020 christos

Add fido and cbor


Revision tags: is-mlppp-base phil-wifi-20191119
# 1.324 18-Nov-2019 christos

Improve the script to check for installed libraries, and fix the wrong
names and obsolete libraries it found.


# 1.323 27-Aug-2019 kamil

Enhance the support of LLVM sanitizers

Define _REENTRANT for MKSANITIZER build. This is needed for at least stdio
code. This caused new build issued with duplicated symbols in few places
and rump kernel code picking different code paths borrowed from libc.
Handle all this in one go.

Add bsd.sanitizer.mk to share common code used by programs and libraries.

Switch from realall to beforeinstall target in .syms files. This is more
reliable in MKSANITIZER.


# 1.322 17-Aug-2019 kamil

Add PAXCTL_FLAG rules for MKSANITIZER

Add per-program rules to disable ASLR for ASan, TSan and MSan in all
sanitized programs. This flag is not needed for other supported sanitizers.

Without this change, sanitized init(8) dies early on startup.

Approach originally suggested by <joerg>


# 1.321 15-Aug-2019 kamil

Add SANITIZER_RENAME_CLASSES in bsd.prog.mk

This adds a more flexible version of SANITIZER_RENAME_SYMBOL.

New symbol allows to specify MKSANITIZER specific renames on per-file and
per-symbol basis.


# 1.320 10-Aug-2019 christos

Make the X11 library lists consistent again.


Revision tags: netbsd-9-base phil-wifi-20190609 pgoyette-compat-20190127
# 1.319 21-Jan-2019 christos

branches: 1.319.2;
Most of the mv operations are to move temporary files to their final place.
Some use -f, others don't. This can lead to spurious build failures when
the user performing the build changes. Centralize, and always use -f.


Revision tags: pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.318 12-Aug-2018 christos

fix broken library variable definitions (inconsistencies between
bsd.README and bsd.prog.mk)


Revision tags: pgoyette-compat-0728
# 1.317 25-Jul-2018 kamil

Introduce MKLIBCSANITIZER in the share/mk rules

Add flags that are required to build a program and a dynamically loaded
library.

Propagade LIBCSANITIZERFLAGS to CFLAGS and CXXFLAGS.

LDFLAGS is not changed on purpose, as a libcsanitizer is inside libc
and no external dependencies are needed.

Register NOLIBCSANITIZER, as certain distribution parts will need to be
skipped.


# 1.316 12-Jul-2018 maxv

Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.


Revision tags: phil-wifi-base
# 1.315 25-Jun-2018 kamil

branches: 1.315.2;
Add a framework for renaming symbols in libc&co for MKSANITIZER

A new keyword SANITIZER_RENAME_SYMBOL. It's a variable that has specified
a list of symbols to be renamed in a processor in order to remove naming
conflicts with public symbols in libc/m/pthread/rt.

This renaming will occur for libraries and programs.
A symbol with a conflicting 'name', will be renamed to '__mksanitizer_name'.

Based on an idea by <christos>


Revision tags: pgoyette-compat-0625
# 1.314 21-Jun-2018 kamil

Refactor MKSANITIZER flags in mk rules

Introduce a new variable SANITIZERFLAGS that contains all the sanitizer
specific flags. These flags are designed to be passed to CFLAGS, CXXFLAGS
and LDFLAGS.

Pass SANITIZERFLAGS in bsd.prog.mk rules to CFLAGS, CXXFLAGS and LDFLAGS.

Pass SANITIZERFLAGS in bsd.lib.mk rules to *_pic.a build flags. The *_pic.a
libraries are designed to construct .so libraries. All .so libraries with
few exceptions are expected to be prebuilt with a sanitizer. Another
purpuse of *_pic.a files can be constructing static PIE programs, however
they are not supported as of now and there is no sanitization of static
programs either.

Once MKSTATICPIE will be supported, it will be initially incompatible with
MKSANITIZER.

This change also makes it easier to build other targets like kernel and
kernel modules without userland sanitizers.

No functional change intended for MKSANITIZER=no users.


# 1.313 02-Jun-2018 christos

Sanitizers don't support static linking.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315
# 1.312 11-Mar-2018 mrg

define LIBXFONT2.


Revision tags: pgoyette-compat-base
# 1.311 25-Feb-2018 mrg

branches: 1.311.2;
add LIBKRB5_LDADD/LIBKRB5_DPADD and their static counterparts
to bsd.prog.mk. use them instead of hard coding various lists
of libraries for krb5.

this fixes static builds.


# 1.310 11-Dec-2017 christos

Instead of checking for obj existance which can be empty for shuttle-rule
programs, check for .sh sources.


# 1.309 10-Dec-2017 christos

don't try to build .debug files for shell scripts.


# 1.308 10-Oct-2017 christos

Add general {DP,LD}ADD.rump variables


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base
# 1.307 21-May-2017 riastradh

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.


# 1.306 21-May-2017 riastradh

Remove some vestiges of MKCRYPTO_IDEA/MKCRYPTO_MDC2.


# 1.305 21-May-2017 riastradh

Remove MKCRYPTO_RC5. Unconditionally include RC5 in libcrypto.so.

This option existed only because RC5 is covered by patents that, twenty
years ago, we had reason to suspect the patent holder, RSA, Inc., might
litigate. The two US patents in question are 5,724,428 and 5,835,600.

According to the USPTO Patent Term Calculator web site at
<https://www.uspto.gov/patent/laws-and-regulations/patent-term-calculator#heading-5>
(retrieved 2017-05-21), patents filed after 1995-06-07 expire twenty
years after the filing date.

number filing date
5,724,428 1995-11-01
5,835,600 1997-04-21

Thus, these patents appear to be expired.

As proposed on tech-crypto and tech-security:

https://mail-index.netbsd.org/tech-crypto/2017/05/05/msg000718.html
https://mail-index.netbsd.org/tech-security/2017/05/05/msg000927.html


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.304 19-Apr-2017 joerg

Add netpgpverify to the library list.


Revision tags: pgoyette-localcount-20170320
# 1.303 20-Feb-2017 rin

add missing LIBCXX


# 1.302 08-Feb-2017 kamil

libpthread_dbg(3) deletion from the base distribution

libpthread_dbg(3) is a remnant library from the M:N thread model
(pre-NetBSD-5.0) API to introspect threads within a process and for use
of debuggers.

Currently in the 1:1 model it's not used in GDB neither in LLDB and it's
not either planned to be used. It's current function to read pthread_t
structures is realizable within a regular debugger capable to
instrospect objects within a tracee (GDB, LLDB...).

Remaining users of this API can still use this library from
pkgsrc/devel/libpthread_dbg.

Sponsored by <The NetBSD Foundation>


# 1.301 29-Jan-2017 christos

add sqlite3 to statically linked libraries for pam.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914
# 1.300 20-Aug-2016 christos

branches: 1.300.2;
unbound additions


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.299 04-Apr-2016 joerg

branches: 1.299.2;
If the per-target LDSTATIC flag is set, don't include the PIE linker
flags as we currently don't support static PIE.


# 1.298 30-Mar-2016 martin

Pass -pie to cc, not -Wl,-pie. This way we have a chance to fix specs
for obscure corner cases like -pie -fPIE -static (used for
/usr/tests/lib/csu/h_initfini2 if building with MKPIE=yes).
While there also replace -fPIC with -fPIE for the PIE case, even if
it should be mostly equivalent.


# 1.297 12-Mar-2016 mrg

remove conditionals that are always true with GCC >= 4.8.


# 1.296 21-Feb-2016 christos

Add NODEBUG


# 1.295 31-Jan-2016 christos

Introduce NOPIE and NOCTF so that standalone programs build properly.


# 1.294 23-Jan-2016 christos

Define _KERNTYPES for things that need it.


# 1.293 07-Nov-2015 joerg

LIBEXECINFO


# 1.292 07-Jun-2015 matt

Make LIBCRT* depend on the right files if MLIBDIR from MKCOMPAT is defined.


# 1.291 01-Dec-2014 erh

PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilt
if any of their dependencies (i.e. the files they refer to) are changed.
This allows changes to transitive included headers to be handled properly.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.290 25-Mar-2014 ozaki-r

branches: 1.290.4;
Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.


Revision tags: riastradh-drm2-base3
# 1.289 09-Mar-2014 christos

let's see if the new dwarf library can handle dwarf 4


# 1.288 02-Mar-2014 christos

If we are compiling with -g and using gcc4.8 and dtrace downgrade
dwarf generation to version 2 for now.


# 1.287 15-Jan-2014 joerg

-Wl,-pie and -r don't agree with each other, so filter the former out.


# 1.286 11-Nov-2013 joerg

Relink binaries if crti.o changes.


# 1.285 29-Sep-2013 christos

Add libxcb


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.284 31-May-2013 mrg

add LIBX11_XCB; unfortunately since the library is named with a -
in it, we have to use an ugly hard coded assignment for now.
(could be cleaned up with more make variable magic i'm sure.)


# 1.283 04-Apr-2013 christos

ldopts should be before ldadd like everywhere else.


Revision tags: agc-symver-base
# 1.282 14-Feb-2013 christos

Since the libraries are produced with different MK flags than the programs,
we check for existance of the files instead of the MK flags.


# 1.281 14-Feb-2013 christos

Add PROGDPLIBS


# 1.280 26-Jan-2013 christos

CTFCONVERT me harder.


Revision tags: yamt-pagecache-base8
# 1.279 17-Jan-2013 christos

Now that we have separate debug sets, add -g if ${MKDEBUG} is set for
program builds since we don't need to install that symbol files.


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.278 24-Aug-2012 jmmv

branches: 1.278.2;
Allow DPADD to be specified on a per-program basis.


# 1.277 23-Aug-2012 joerg

Revert last, it breaks the tricks xsrc uses.


# 1.276 23-Aug-2012 joerg

Remove SHLIBINSTALLDIR and SHLINKINSTALLLIBDIR. Add rpath entries, if
SHLIBDIR differs from /usr/lib.


# 1.275 08-Aug-2012 christos

add MKRUMP by popular demand.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.274 29-Feb-2012 tron

Move "libexpat" from X11 into base which fixes PR lib/40346.
This change was approved by the Core Group.


# 1.273 21-Feb-2012 matt

Remove another ${SIZE}


# 1.272 20-Feb-2012 matt

Remove ${SIZE}


# 1.271 19-Feb-2012 matt

Add support for --combine with gcc.


Revision tags: netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2
# 1.270 05-Nov-2011 christos

branches: 1.270.2;
Add libtre


Revision tags: yamt-pagecache-base
# 1.269 16-Oct-2011 christos

branches: 1.269.2;
- no need to special-case libraries with weird characters.
- add a note about adding new libraries.


# 1.268 16-Oct-2011 christos

fix list of libraries to reflect reality.


# 1.267 10-Sep-2011 apb

Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.


# 1.266 27-Aug-2011 joerg

Add new "analyze" command to run clang's static analyzer in a directory
on all C/C++ files.


Revision tags: cherry-xenmp-base
# 1.265 26-Apr-2011 he

The new Heimdal adds -lwind and -lheimbase to the set of libraries,
so define the corresponding LIB* variables.
These are also needed in the PAM_STATIC_* variables, so add them there too.


# 1.264 11-Apr-2011 joerg

Adjust --sysroot related usage:
-Wl,-rpath does not expand =, so just drop it.

Drop -Wl,-rpath-link entries that duplicate the -Wl,-rpath entries, this
is done implicitly now that ld is built with sysroot support.

Use ${DESTDIR} explicitly for the remaining -Wl,-rpath-link entries.


# 1.263 10-Apr-2011 joerg

For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.


# 1.262 08-Mar-2011 jmmv

Revert previous (revision 1.261): it broke the build because PROG_CXX is
defined in terms of PROG, so later on we would end up with target duplicates
because both PROG_CXX and PROG were being converted to PROGS_CXX and PROGS.

Did not catch this earlier because the test build I did was not clean and
thus the duplicate targets did not have nasty effects.


# 1.261 07-Mar-2011 jmmv

Always convert PROG to its plural form independently of whether PROG_CXX
is defined or not. From Garrett Cooper in private mail.


Revision tags: bouyer-quota2-nbase
# 1.260 20-Feb-2011 jmmv

Define LIBATF_C and LIBATF_CXX to point to their corresponding .a files and
use these to properly set DPADD for test programs.


Revision tags: bouyer-quota2-base
# 1.259 13-Feb-2011 christos

add saslc


# 1.258 06-Feb-2011 joerg

Don't use -nostdinc or -nostdinc++ if this is included in a HOSTLIB.


# 1.257 17-Jan-2011 pooka

branches: 1.257.2;
Add rump bits to DPSRCS so that update builds work correctly.


Revision tags: matt-mips64-premerge-20101231
# 1.256 13-Dec-2010 pooka

befriend RUMPPRG with CRUNCHEDPRG


# 1.255 13-Dec-2010 pooka

Define RUMPPRG, which is just like PROG, except it additionally
builds a rump client with the name rump.${PROG}. The rump client
is not installed suid/sgid by default even if BINMODE is defined.


# 1.254 10-Dec-2010 joerg

Revert last, gcc(1) checks explicitly for -r on some platforms to disable
passing down --relax as well.


# 1.253 08-Dec-2010 joerg

gcc passes down -r directly to ld, so make it explicitly a linker option.


# 1.252 08-Dec-2010 joerg

Don't depend on ${CC} passing down -R to ld, use -Wl,-rpath explicitly.


# 1.251 08-Nov-2010 lukem

Preserve date on original shared library or program when stripping
the debug symbols and adding the debug-link to .debug.
Use '(rm -f file; false)' in the failure path to force failure.
Based on solution proposed by Nicolas Joly on tech-toolchain in July 2010.
Should fix PR toolchain/44046 from Andreas Gustafsson.


# 1.250 31-Oct-2010 mbalmer

Link Lua to the build and add the resulting files to the distribution sets.
Document the addition of Lua and the change we made to the default settings.


# 1.249 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.248 24-Apr-2010 lukem

When extracting separate debug symbols with MKDEBUG, there's no need
to leave the original file unstripped...


# 1.247 02-Mar-2010 darran

DTrace: Add CTF generation to the make framework. Only enabled when
MKDTRACE=yes.


# 1.246 14-Dec-2009 mrg

use "${CC} -r" not "${CC} -Wl,-r" as the latter fools GCC on some targets
and it ends up passing "-r -relax" to ld, which causes ld to barf.


# 1.245 14-Dec-2009 matt

Merge from matt-nb5-mips64


Revision tags: matt-premerge-20091211
# 1.244 08-Dec-2009 uebayasi

When PROGS / LIBS are used, you can pass each PROG / LIB specific parameters
to ${LD} via:

${LDADD.${PROG}}
${LDFLAGS.${PROG}}
${LDSTATIC.${PROG}}
${LDADD.${LIB}}
${LDFLAGS.${LIB}}

OTOH you can't pass parameters to ${CC}, because in suffix rules make(1) only
knows the name of ${.IMPSRC} and ${.TARGET}; it's users' responsivility to
define ${CC} parameters to all the sources of a given ${PROG} / ${LIB}.

Should address bin/42381.

(Bug in this commit log was pointed out by mrg@.)


# 1.243 27-Nov-2009 tsutsui

If CPPFLAGS or CXXFLAGS already contains -nostdinc or -nostdinc++,
don't add ${CPPFLAGS_ISYSTEM} or ${CPPFLAGS_ISYSTEMXX} to refer
${DESTDIR}/usr/include or ${DESTDIR}/usr/include/g++.

This change might cause errors on some MD stand dir, but in that case
each Makefile should be fixed to search proper system include paths
by -Ipath option in own CPPFLAGS.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.242 12-May-2009 plunky

remove libsdp as improved functionality has been enabled in libbluetooth.


# 1.241 10-Apr-2009 apb

Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links. They have no effect except when using a
metalog, in which case the information is added to the metalog. In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg. This should fix PR 24457 and PR 41155.


# 1.240 24-Nov-2008 cube

branches: 1.240.2;
Move cleanextra to the very ends in case another included file wants to add
to it even if it was initially empty.


Revision tags: netbsd-5-base matt-mips64-base2
# 1.239 19-Oct-2008 christos

branches: 1.239.2;
handle assembly files for MKPIE


# 1.238 16-Oct-2008 christos

Provide a way for a program to override the PIE flags.


# 1.237 15-Oct-2008 christos

don't compile/link libraries with pie


Revision tags: mjf-devfs2-base
# 1.236 02-Oct-2008 joerg

Hook up libfetch and pkg_install update.


Revision tags: wrstuden-revivesa-base-3
# 1.235 09-Sep-2008 joerg

Add MKSTRIPIDENT to remove the RCS IDs from binary programs and shared
libraries for space-constraint systems. The description is based on the
feedback of hubertf@, the logic on input from lukem@

This obsoletes the removal of LIBC_SCCS and SYSLIBC_SCCS for libc builds.


Revision tags: wrstuden-revivesa-base-2
# 1.234 28-Aug-2008 mrg

update a comment example


# 1.233 27-Aug-2008 rtr

use ${X11USRLIBDIR} instead of hard-coded /usr/X11R6/lib when building
${LIB.foo} vars


# 1.232 27-Aug-2008 lukem

Fix problem I introduced in rev 1.231 on 2008/08/25 where ${_PROGLDOPTS}
and -L${_GCC_LIBGCCDIR} were appearing in the link line before ${LDADD},
so -L${DESTDIR}/lib and -L${DESTDIR}/usr/lib were being used before
local -L library paths.
Fixes ntpd/ntpdate failure noticed by Valeriy E. Ushakov <uwe@NetBSD.org>


# 1.231 25-Aug-2008 lukem

Always link with: -Wl,-rpath-link,${DESTDIR}/usr/lib -L${DESTDIR}/usr/lib
Fixes problem with MKDYNAMICROOT=no triggered by libraries that depend
on other libraries.
Related to PR 33503.

Clean up setting of _CCLINK to always add the appropriate -B options.

Simplify the link rule for a program.


# 1.230 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.229 28-May-2008 lukem

add LIBLDAR_R (for completeness)


# 1.228 22-May-2008 lukem

Add MKLDAP, USE_LDAP, LIBLBER, LIBLDAP


Revision tags: hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-pf42-base
# 1.227 10-Apr-2008 tsutsui

branches: 1.227.2; 1.227.4;
Add libhx509 to PAM_STATIC_LDADD which is required by libkrb5.


# 1.226 22-Mar-2008 mlelstv

branches: 1.226.2;
Import Heimdal-1.1


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase matt-armv6-base hpcarm-cleanup-base
# 1.225 26-Dec-2007 jmmv

Make the clean target work when OBJS is set but PROG is not, as happens
for example in gnu/lib/crtstuff4. Reported by drochner@.


Revision tags: cube-autoconf-base
# 1.224 13-Nov-2007 jmmv

Fix typo that prevented MKDEBUG builds to work. Found by drochner@.


# 1.223 12-Nov-2007 jmmv

Add the ability to build multiple programs from a single directory

This adds support for a new set of variables, PROGS and PROGS_CXX, that
allow the developer to build multiple different programs from a single
source directory.


# 1.222 04-Nov-2007 tls

Remove MKPRIVATELIB from BIND libraries; move library reachover
directories and Makefiles from src/usr.sbin/bind to src/lib; make
BIND libraries build shared. Saves about 1MB-1.5MB per installed
executable, about 5MB for a base+etc minimal installation of NetBSD.


Revision tags: matt-mips64-base
# 1.221 29-Jul-2007 joerg

branches: 1.221.4; 1.221.6;
Add build glue for libarchive and update the various sets.


# 1.220 25-Jan-2007 perry

Before I completely forget the issue, convert "PROG_PAX" to the
better-named "PAXCTL_FLAGS".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.219 11-Nov-2006 christos

don't run paxctl if other commands were specified for that target.


# 1.218 10-Nov-2006 christos

if ${PROG_PAX} is defined, run paxctl on the binary after linking with
the value of the variable. This way, if you set:

PROG_PAX=+M

in /etc/mk.conf, you get what you deserve.


# 1.217 22-Oct-2006 pooka

libpuffs


# 1.216 09-Oct-2006 mrg

- clean up some comments to reality.
- retire LIBDCK, LIBG2C and (long broken) USE_LIBSTDCXX
- in bsd.hostprog.mk's LIBSTDCPP -> LIBSTDCC
- add LIBSUPCXX
- don't default USE_LIBSTDCXX or USE_GCC4 since they are
not used in the tree any where
- same with USE_XF86_4; retire it
- remove _SUPCXX handling in bsd.prog.mk

inspired by PR#26714.


Revision tags: abandoned-netbsd-4-base
# 1.215 23-Jul-2006 lukem

Implement MKDEBUG:
If "no", don't build and install separate debugging symbols
into /usr/libdata/debug.
Default: no


# 1.214 19-Jun-2006 gdamore

Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.


# 1.213 09-Jun-2006 christos

PR/33681: Scott Ellis: Building 'bc' with SHAREDSTRINGS=yes fails
We need CPPFLAGS too now.


# 1.212 11-May-2006 mrg

add support for ${OBJCOPTS} and ${OBJCOPTS}.<lib|prog|fn>.


# 1.211 20-Mar-2006 christos

There is always one more KRB4 thing to remove. (from Jukka Salmi)


# 1.210 20-Mar-2006 christos

Remove krb4 variables and libraries (Jukka Salmi)


# 1.209 16-Mar-2006 jwise

Now that we have real build system support for syspkgs, remove someone's
half-implemented idea of building `syspkgs' (really a few giant blobs of the
same granularity of the old sets) using install(1).


# 1.208 20-Jan-2006 christos

Add the world of libraries to the static pam build. Now static pam binaries
work.


# 1.207 09-Apr-2005 dsl

Report when we link a program into xxx.ro (before being crunched)


Revision tags: netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.206 04-Mar-2005 he

branches: 1.206.2; 1.206.4;
Introduce PAM_STATIC_LDADD and PAM_STATIC_DPADD. When compiling
with MKPIC=no, possibly because the target does not support shared
libraries, these include libraries required to resolve all symbols
which end up referenced from PAM-using applications. The libraries
presently required are -lcrypt, -lrpcsvc and -lutil.

Add use of these variables which are currently set up to use PAM,
so that they compile when MKPIC=no.

Also, in the telnetd case, reorder the order of the libraries, so
that libtelnet.a comes before -ltermcap and -lutil, again to fix
link error when MKPIC=no.

Discussed with thorpej and christos.


# 1.205 20-Feb-2005 christos

Add libradius


# 1.204 12-Jan-2005 lukem

If RESCUEDIR is defined, automatically add that to CPPFLAGS


# 1.203 08-Jan-2005 lukem

Implement <bsd.prog.mk> vars:
LIBASN1 LIBBSDMALLOC LIBG2C LIBPAM LIBSSH


# 1.202 04-Aug-2004 lukem

Revert most of previous, and move the LIB<libname>?= assignments
back to bsd.prog.mk from bsd.own.mk.

pkgsrc uses <bsd.own.mk>, and setting LIB<libname> in it causes
problems with various package builds.
This should fix PR #26542 submitted by Jim Bernard.

(I'll be implementing the DPADD for shared libraries in a different
manner that generally won't depend upon ${LIB<libname>}.)


# 1.201 30-Jul-2004 lukem

Move the LIB<libname>?= assignments from bsd.prog.mk to bsd.own.mk so
that they may be used by non PROGs (e.g., LIBs).

Improve some comments.


# 1.200 10-Jun-2004 lukem

Be consistent in handling YHEADER, similar to Christos' fix in bsd.lib.mk 1.253


# 1.199 21-May-2004 ross

If you add a library, you need to define its DPADD symbol here.

Add LIBMAGIC.


Revision tags: netbsd-2-0-base
# 1.198 15-Feb-2004 skrll

branches: 1.198.2;
Be more gcc like in the way we deal with libgcc so that sh3/hppa millicode
and exception handling have a chance of working properly.

- creates libgcc, libgcc_eh and libgcc_s

- updates LIBGCC_SPEC to use them appropriately.

There's a hack in here at the moment with respect to libgcc_so in that it
is preferable to link against libgcc_so will only when -shared-libgcc is
specified (the c++ frontend does this automatically.) Configurations where
LINK_EH_SPEC is defined already do this. The gcc configuration for
NetBSD/alpha and another NetBSD platform (I forget which) actually define
LINK_EH_SPEC probably by accident rather than design.

- updates share/mk to use the compiler's knowledge of what needs linking into
libraries and executables. This removes an hppa hack.

- updates the sets for the newly created libgcc* files.

- support for linking against the _pg version of libgcc has been removed.


# 1.197 29-Jan-2004 lukem

Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.


# 1.196 27-Jan-2004 lukem

Replace
:M-[IDU]*
with
:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)


# 1.195 23-Jan-2004 simonb

crt0.o lives in /usr/lib even on a.out.


# 1.194 16-Nov-2003 lukem

simplify with _MKTARGET_LINK


# 1.193 11-Nov-2003 dsl

Set MKDEP_SUFFIXES to get additional targets in .depend instead of using
sed in .afterdepend. I don't think .afterdepend is used anywhere any more.


# 1.192 21-Oct-2003 lukem

Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.


# 1.191 19-Oct-2003 lukem

Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} " ... {$.TARGET}" and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO


# 1.190 18-Oct-2003 lukem

Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command ("verbose")
This is the default, and is equivalent to the previous behaviour.


# 1.189 29-Sep-2003 lukem

Add LIBSTDCXX (for usr/lib/libstdc++.a).
Sync LIB* documentation with reality.


# 1.188 19-Sep-2003 martin

Drop explicit medlow model and default to -O2 for sparc64.


# 1.187 14-Sep-2003 lukem

Check ${SHLIBDIR} against "/usr/lib" instead of ${LIBDIR} when determining
if we need to add stuff (usually "/lib") to the rpath-link path before
"/usr/lib". Otherwise, this barfs if LIBDIR != /usr/lib or /lib, and
we're cross-building (e.g., in src/x11)


# 1.186 13-Sep-2003 erh

Also support per-program LDFLAGS and LDSTATIC.


# 1.185 13-Sep-2003 erh

Create a way to add additional flags to COPTS, CPPFLAGS, CXXFLAGS and LDADD
for particular libraries or programs by specifying the additions in mk.conf
instead of needing to go edit individual Makefiles.


# 1.184 12-Sep-2003 lukem

add infrastructure to support reach-over builds of xsrc


# 1.183 22-Aug-2003 dsl

Add a ${PROG}.ro target that does an 'ld -r' of the program object files.
Allows a much simplified build of 'crunched' binaries since crunchgen can
build prog.ro instead of having to deretmine the names of all the .o files.


# 1.182 01-Aug-2003 lukem

Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".


# 1.181 01-Aug-2003 lukem

simplify the ${PROG}: target to reduce duplication between the DESTDIR
and !DESTDIR cases...


# 1.180 31-Jul-2003 lukem

bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.


# 1.179 31-Jul-2003 lukem

Don't need -R/usr/lib; it will be searched at the end by ld.elf_so anyway.
Noted by matt green <mrg@>


# 1.178 28-Jul-2003 lukem

be consistent when adding *.y and *.l to DPSRCS


# 1.177 28-Jul-2003 lukem

replace MKCXXSUPCXX(!=no) with USE_LIBSTDCXX(==no)


# 1.176 28-Jul-2003 lukem

Change defined(CXX_SUPCXX) to MKCXXSUPCXX != "no".

Clarify that command-line overrides of the MKxxx variables should be
done via the environment rather than make(1) command-line variable
assignment, since the latter doesn't actually work as intended.


# 1.175 27-Jul-2003 mrg

introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes. for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)


# 1.174 26-Jul-2003 mrg

add a new bsd.own.mk variable: CXX_SUPCXX. from bsd.README:
+ CXX_SUPCXX If defined, the support libraries needed for this C++ program
+ are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.


# 1.173 20-Jul-2003 lukem

Consistently support the different C++ file extensions: .cc .cpp .cxx .C
Noted by Andrew White in PR toolchain/18246


# 1.172 18-Jul-2003 lukem

Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was defined.
Replace defined(UNPRIVED) tests with ${MKUNPRIVED} != "no"

Add MKUPDATE; if not no has the same semantics as if UPDATE was defined.
Replace defined(UPDATE) tests with ${MKUPDATE} != "no"

Improve documentation for these and other make flags.


# 1.171 16-Jul-2003 itojun

stop installing install libtelnet. build under lib/libtelnet and reference
it from usr.bin/telnet and libexec/telnetd.
(reason for separate build: compiler flags)


# 1.170 27-Jun-2003 drochner

For consistency, use "-R" instead of "-Wl,-rpath" to pass
a runtime search path to the linker.


# 1.169 13-Jun-2003 itojun

define LIBEVENT


# 1.168 11-Jun-2003 msaitoh

catch signal 1,2,3,13 and 15 to clean /tmp/_dependXXX


# 1.167 31-May-2003 thorpej

If EXTERNAL_TOOLCHAIN is defined, allow the compiler to define the
location of crt{begin,end}{,S}.o and libgcc.a. Encapsulate all of
this logic into the new bsd.gcc.mk, and use it in bsd.prog.mk and
bsd.lib.mk.


# 1.166 18-May-2003 lukem

make this a no-op if HOSTPROG is defined


# 1.165 30-Mar-2003 thorpej

If MACHINE_ARCH is powerpc and we HAVE_GCC3, add crtsaveres.o to the
endfile spec.


# 1.164 22-Feb-2003 uwe

Typo in comment.


# 1.163 24-Jan-2003 thorpej

Add LIBPTHREAD, LIBPTHREAD_DB, and LIBRT.


Revision tags: fvdl_fs64_base
# 1.162 22-Nov-2002 thorpej

Split crtbegin/crtend into crti/crtbegin/crtend/crtn. NetBSD-specific
things like the .note.netbsd.ident section are provided by crti/crtn.
crti/crtn also provide the _init() and _fini() routines.

crtbegin/crtend now only provide support for ctors/dtors. This paves
the way to using the "crtstuff" provided with GCC (when we upgrade to
GCC 3.3), which provides, among other things, much better C++/Java
exception handling.


# 1.161 12-Nov-2002 itohy

MKDYNAMICROOT for a.out


# 1.160 22-Oct-2002 perry

Pass 1 of SYSPKG changes to automatically add tags=pkgname_pkg to METALOG.
Not quite ready for prime time yet.


# 1.159 27-Sep-2002 thorpej

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.


# 1.158 26-Sep-2002 itojun

MDC2 is a patented algorithm; don't ship it in default libcrypto.
MKCRYPTO_MDC2 will build a separate library, libcrypto_mdc2.


# 1.157 08-Sep-2002 thorpej

Build a .gdbinit in the objdir when building a program. The .gdbinit
file sets the shared library prefix to ${DESTDIR}, and adds "sources"
directives for each file listed in the GDBINIT Makefile variable.


# 1.156 09-Aug-2002 thorpej

Add LIBPMC.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.155 27-Mar-2002 eeh

branches: 1.155.2;
Use the medium low model for sparc64 programs that don't 2GB of data segment.


# 1.154 11-Feb-2002 mycroft

Don't use .PHONY for targets that are actually installed. Instead use force
dependencies. (Among other things, `make -t install' does something vaguely
sensible now.)


# 1.153 07-Feb-2002 pk

Mark installed system libraries as .MADE only if we're actually establishing
their default variable values here.


# 1.152 04-Feb-2002 christos

s/.NOSUFF/.MADE/


# 1.151 03-Feb-2002 christos

Apply a .NOSUFF: directive to targets we don't want to have processed by
the suffix rules engine.


# 1.150 02-Feb-2002 veego

Ups, it is LIBUSBHID and not LIBUSBHIB.


# 1.149 02-Feb-2002 veego

Change LIBUSB to LIBUSBHIB, reflecting the library name change.


# 1.148 29-Jan-2002 enami

Mark the targets clean{extra,objs} as PHONY.


# 1.147 04-Jan-2002 thorpej

For PROG_CXX DESTDIR builds, pull in -lstdc++ and -lm regardless
of GCC version.


# 1.146 01-Jan-2002 thorpej

Per a suggestion from matthew green, PROG_CXX takes the place of
PROG for C++ programs.


# 1.145 01-Jan-2002 thorpej

* If PROG_CXX is set by the program's Makefile, use ${CXX} to link
the program rather than ${CC}.
* If HAVE_GCC3 is defined, pull in "-lstdc++ -lm" as additional C++
support libraries for DESTDIR builds.


# 1.144 28-Dec-2001 lukem

* 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


# 1.143 28-Nov-2001 tv

If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.


# 1.142 19-Nov-2001 thorpej

Use a little transitional hack to determine if we use -isystem
or -idirafter. Use the former only of USE_NEW_TOOLCHAIN, since
-isystem causes the old toolchain to bomb out when building
libstdc++.


# 1.141 14-Nov-2001 tv

C/..$/.c/ -> C/\..$/.c/


# 1.140 14-Nov-2001 tv

Move the DESTDIR-based nostdinc logic to bsd.lib.mk and bsd.prog.mk where
it belongs (with the native target compile rules).


# 1.139 02-Nov-2001 tv

Use INSTALL_FILE/INSTALL_DIR as appropriate.


# 1.138 02-Nov-2001 tv

Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.


# 1.137 19-Oct-2001 tv

Add .NOPATH for all files generated from .l or .y files in SRCS. Fixes PRs
bin/14187 and lib/14239.

Also simplify the handling of these transforms to .c and .h files a bit by
leveraging make's builtin macro operators.


# 1.136 25-Sep-2001 tv

Set .NOPATH on program to build to make sure it goes in .OBJDIR.
Problem noted by <seebs@plethora.net>.


# 1.135 24-Sep-2001 lukem

fix previous (hi thor!) - $OBJS and $CLEANFILES might be empty, and
rm needs some files to delete...


# 1.134 24-Sep-2001 tls

Split "cleanprog" target apart: now you can zap only object files or
CLEANFILES (needed to fix crunchgen lossage).


# 1.133 13-Sep-2001 thorpej

Add LIBPCI.


# 1.132 14-Aug-2001 tv

Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").


# 1.131 01-Jun-2001 tv

Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).


# 1.130 08-May-2001 sommerfeld

Suppress duplicate entries in ALLFILES, FILES, INCS, DEPINCS, INFOFILES,
NLSALL, CATPAGES, MANPAGES, HTMLPAGES, and SCRIPTS.


# 1.129 19-Feb-2001 jmc

Wrap target() checks around afterdepend rule as some Makefiles override this


# 1.128 26-Jan-2001 itojun

fix typo in LIBSSL decl. it made programs with DPADD+=${LIBSSL} to build
every time we type "make". From: bernd


# 1.127 14-Jan-2001 christos

use the new .if commands(<target>) directive so that we don't have to
change Makefiles.


# 1.126 14-Jan-2001 christos

fix thinko: test for the existance of the target before we define it...


# 1.125 14-Jan-2001 christos

Alter previous redefined target protection. If the ${PROG} target is defined,
add the dependencies as usual, but don't add the commands. This avoids
having to change all the Makefiles that redefine the PROG target.


# 1.124 14-Jan-2001 christos

allow programs to override the program target.


# 1.123 08-Jan-2001 mrg

add missing $LIBCRYPTO_RC5 and $LIBCRYPTO_IDEA


# 1.122 08-Jan-2001 mrg

add missing $LIBSSL


# 1.121 04-Jan-2001 garbled

Add LIBCDK and LIBFORM definitions


# 1.120 31-Oct-2000 itojun

add ${LIBINTL} for use with DPADD.


# 1.119 07-Oct-2000 deberg

fix typos, PR 11159


# 1.118 25-Jun-2000 erh

For the case when DESTDIR is set: move the -L${DESTDIR}/usr/lib after ${LDADD} so any -L directories set in LDADD are searched first to avoid possibly linking against old versions of libraries.


Revision tags: netbsd-1-5-base
# 1.117 19-Jun-2000 thorpej

branches: 1.117.2;
Sync up the LIB* list.


# 1.116 10-Jun-2000 mycroft

Use ${.ALLSRC:T} when doing the generated variable name lookups, so that it
DTRT for generated files in and obj directory (or accessed via .PATH).


# 1.115 06-Jun-2000 mycroft

Abuse .USE some more.


# 1.114 06-Jun-2000 mycroft

Minor rearrangement.


# 1.113 06-Jun-2000 mycroft

Use ODE make(1) features to eliminate extra variables and move several things
outside of .for loops. (Needs more work to completely eliminate .for.)

XXX Don't look at this stuff. It will make your head hurt.


Revision tags: minoura-xpg4dl-base
# 1.112 14-Apr-2000 mrg

branches: 1.112.2;
use -rpath-link rather than -R when linking objects using a DESTDIR.
this replaces the previous change as that ended up adding
$DESTDIR/usr/lib to the runtime path of every binary created, which
is bogus and dangerous.


# 1.111 25-Mar-2000 mycroft

When linking with $DESTDIR, use an explicit -R to get library dependencies
correct.


# 1.110 07-Mar-2000 veego

Remove unused libahdi.
It will be replaced in the future with a more generic libdisklabel.


# 1.109 05-Feb-2000 jdc

Add libahdi entries.


# 1.108 23-Jan-2000 eeh

Add some support for FCode binaries.


# 1.107 22-Jan-2000 mycroft

Make `dependall' play nicely with SUBDIR, using a hack similar to `realinstall'
for both `depend' and `all'.
Also, remove the old hack that invokes an extra shell for .depend, now that
make(1) has been fixed.


# 1.106 16-Jan-2000 assar

all: depend on ${SCRIPTS} so that they get generated if they need to


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.105 23-Nov-1999 blymn

Added libmenu library.


Revision tags: comdex-fall-1999-base
# 1.104 14-Sep-1999 perry

branches: 1.104.4;
Add a "dependall" target, which does a "make depend" and then "make all"
in a single directory. This is useful in "make build" because by doing
the build immediately after the depend, all sources will typically
still be in the buffer cache, thus saving significant time over doing
a "make depend" on all the directories and then a "make all".


# 1.103 04-Sep-1999 fredb

Permit "make all install", as well as "make foo install" (where foo would be
installed by "make install") without setting of BUILD. All cases where BUILD
is already set are unchanged from the old behavior.

"make all install" is now practically equivalent to "make BUILD= all install",
but without actually setting build.

Fixes pr's 8313, 3894.


# 1.102 21-Aug-1999 simonb

Add ${INSTPRIV} to ${INSTALL} commands.


# 1.101 01-Jul-1999 itojun

branches: 1.101.2;
add LIBIPSEC for use from DPADD.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.100 12-Feb-1999 lukem

branches: 1.100.2;
* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.99 10-Feb-1999 tv

libbfd_pic.a is no longer installed; remove ${LIBBFD} define.


# 1.98 04-Feb-1999 christos

PR/2936: Brian C. Grayson: Avoid truncating precious files when installing
and the filesystem is full. Added ${RENAME} flag to install, which when set
to -r installs on a temporary file and then renames to the final destination.
${RENAME} is currently set to nothing in bsd.own.mk, but one can turn it
on in /etc/mk.conf.


# 1.97 07-Nov-1998 jonathan

Do DESTDIR support for crtbegin/crtend on all ELF ports (adds mips).


# 1.96 28-Sep-1998 christos

Use preserve flag in install.


# 1.95 10-Sep-1998 ross

Define a LIBBZ2?=... for use in DPADD=... lines.


# 1.94 09-Aug-1998 lukem

add distclean as a synonym for cleandir


# 1.93 09-Apr-1998 tv

.y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.


# 1.92 01-Apr-1998 tv

Revert. This broke too much in the build tree, and a better solution
needs to be created. (The existing situation breaks a lot too.)


# 1.91 01-Apr-1998 tv

Fix .y rules to DTRT with possibly generated .h files. See mail on
tech-toolchain for a very detailed explanation of this. In short, add
a .y.h rule identical to the .y.c rule and make the .y.c rule rename
the .h file; also, clean the .h file in CLEANFILES.


# 1.90 03-Nov-1997 cgd

echo the lint command line when making 'lint'.


# 1.89 28-Oct-1997 lukem

add ${LIBOBJC}


Revision tags: netbsd-1-3-base
# 1.88 11-Oct-1997 mycroft

branches: 1.88.2;
Several changes:
* Allow bsd.man.mk to be included separately.
* Always include bsd.own.mk and bsd.obj.mk.
* Include bsd.man.mk and bsd.nls.mk even if NOMAN or NONLS; just turn off
building of the affected files instead.
* Require bsd.subdir.mk to be included explicitly.
(Will make appropriate changes to Makefiles shortly.)


# 1.87 29-Sep-1997 gwr

Add $LIBBFD


# 1.86 31-May-1997 cjs

Back out BUILDDIR and NOINSTALL changes.


# 1.85 26-May-1997 cjs

branches: 1.85.2;
These updates to the build allow building against include files
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.


# 1.84 18-May-1997 kleink

Add libposix.


# 1.83 17-May-1997 mycroft

Do LINKS and SYMLINKS after FILES and INCS.


# 1.82 17-May-1997 mycroft

Remove unneeded .SUFFIXES lines, and move .s and .S closer to .o to give the
right preferences.


# 1.81 09-May-1997 mycroft

Fix typo in previous.


# 1.80 09-May-1997 mycroft

Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.79 09-May-1997 mycroft

Remove cruft.


# 1.78 09-May-1997 mycroft

Oops; rearrange dependencies to get things built early enough.


# 1.77 09-May-1997 mycroft

Make sure INCS and SRCS are built if necessary.


# 1.76 08-May-1997 gwr

Set the .NOPATH flag for ${OBJS} (from Christos).


# 1.75 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.74 07-May-1997 mycroft

Various simplifications.


# 1.73 07-May-1997 mycroft

Shuffle some .PHONYs around, to work better with `-t'.


# 1.72 06-May-1997 mycroft

Make most of the install targets .PRECIOUS.


# 1.71 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.70 18-Apr-1997 christos

Add ${LIBNTP}


# 1.69 17-Apr-1997 thorpej

- Properly depend on crtbegin.o and crtend.o for platforms that use
them (currently Alpha and PowerPC)
- STRIP -> STRIPFLAG


# 1.68 03-Apr-1997 mikel

don't allow override of all: target


# 1.67 29-Mar-1997 mikel

merge lite-2 changes (mostly SCCSids)


# 1.66 27-Mar-1997 christos

Put the FILES generated rules in a separate .mk file since both bsd.prog.mk
and bsd.lib.mk use them.


# 1.65 27-Mar-1997 mycroft

Make the SCRIPTS case mimic the FILES case more closely, so we can override
the destination direectory, etc.


# 1.64 27-Mar-1997 mycroft

Remove knowledge of HIDEGAME from here.


# 1.63 24-Mar-1997 christos

make rules update:
- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation


# 1.62 22-Mar-1997 perry

Fix SYMLINKS not to include DESTDIR in the link itself


# 1.61 13-Mar-1997 perry

add SYMLINKS, by analogy to LINKS. Vetted by Christos.


# 1.60 22-Jan-1997 cgd

if 'clean' is not already defined, rather than simply defining it with
a bunch of rules, define a clean{kmod,lib,prog} target with the rules,
and have both clean and cleandir depend on that. That eliminates a bug
where 'cleandir' in a directory which included e.g. bsd.prog.mk but which
also had subdirs would 'make clean' all the subdirs and then 'make cleandir'
all ofthe subdirs. It also allows Makefiles to add more dependencies
to 'clean' after inclusion of the make template.

If 'clean' is already defined, the behaviour is the same as it used to be.


# 1.59 20-Dec-1996 cgd

add an afterdepend target (a la the one in bsd.lib.mk) that processes
the .depend file to add <filename>.ln for each <filename>.o as an
object file which has the given dependencies (in addition to
<filename>.po and <filename>.so, which were already there).


# 1.58 13-Dec-1996 mikel

add missing LIBPCAP definition.


# 1.57 26-Nov-1996 mrg

add libz and libwrap


# 1.56 18-Oct-1996 thorpej

Use ${INSTALL} rather than "install".
From Simon J. Gerraty <sjg@zen.void.oz.au>, PR #1458.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.55 08-Apr-1996 jtc

Sort LIBFOO definitions and add LIBY; Reported by Mike Long <mike.long@analog.com> in PR #2301.


# 1.54 22-Oct-1995 christos

Added include file <bsd.sys.mk> that contains lex and yacc "parallel aware"
rules. These rules are not turned on by default; they are enabled by setting
the PARALLEL variable.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.53 25-Jun-1995 cgd

oops; fix an rm that might be empty


# 1.52 24-Jun-1995 cgd

update lint rules, but keep linting disabled


# 1.51 10-Jun-1995 mycroft

Define LIBEDIT.


# 1.50 21-Apr-1995 jtc

.include <bsd.nls.mk> unless NONLS is defined.


# 1.49 22-Dec-1994 cgd

specify man pages differently, and document how.


# 1.48 24-Aug-1994 mycroft

Include bsd.own.mk earlier.


# 1.47 20-Jul-1994 cgd

fix from christos, for progs w/o objects


Revision tags: netbsd-1-0-base
# 1.46 06-Jul-1994 mycroft

branches: 1.46.2;
Pull libraries from ${DESTDIR} if set. Kill LDONLY, which is unused and
probably not useful anyway.


# 1.45 30-Jun-1994 cgd

fix modify-info-nothingness-then-substitute probelm that broke genclass build


# 1.44 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.43 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.42 28-Jun-1994 jtc

Strip *.sh when constructing OBJS from SRCS.
This will allow us to clean up makefiles that build a script by munging
a template (uusched, genclass, neqn, etc.).


# 1.41 18-Jun-1994 cgd

don't chown the symlink, when HIDEGAME causes a symlink to be made to dm.
4.4-based FS code _follows_ the symlinks on a chown(2) call.


# 1.40 24-May-1994 cgd

fix the last to do the right thing for dependencies


# 1.39 24-May-1994 deraadt

LIBSKEY


# 1.38 22-May-1994 jtc

Single source file programs are now compiled into object files before they
are linked. This change halves the time it takes to rebuild all of the
NetBSD sources when only the C library is "touched"; but only takes about
one percent more disk space.


# 1.37 06-Apr-1994 chopps

relink (recompile) single source programs when crt0.o is updated.


# 1.36 24-Mar-1994 mycroft

Remove *.core on clean.


# 1.35 09-Feb-1994 cgd

kill install -d's.


# 1.34 28-Jan-1994 cgd

add LIBKVM


# 1.33 10-Nov-1993 cgd

librpc doesn't exist anymore


# 1.32 08-Nov-1993 cgd

ad LDSTATIC flag, so static linking can be made one-stop shopping.
use "setenv LDSTATIC" to make *everything* dynamically linked,
setenv LDSTATIC -static for everything statically linked, or unset
it for default behavior.


# 1.31 07-Oct-1993 cgd

LIBTERM pointed at nothing, but was meant to point to libtermcap.a...


# 1.30 07-Oct-1993 cgd

always define LIBCRYPT


# 1.29 17-Aug-1993 mycroft

Make sure we don't recurse into subdirectories if Makefile specified `install'
target. (It's usually blank and is specifically to avoid doing this...)


# 1.28 15-Aug-1993 mycroft

Automatically include bsd.subdir.mk for backward compatibility.


# 1.27 15-Aug-1993 mycroft

Don't automatically include bsd.subdir.mk in bsd.prog.mk and bsd.lib.mk.
Put back .MAIN in bsd.man.mk, and be careful not to include ../Makefile.inc
a second time.


# 1.26 15-Aug-1993 mycroft

Move man rules to sys.mk.
Use bsd.subdir.mk for building subdirectories.
Don't forget to remove x.cc and x.C when using SHAREDSTRINGS.
Make ${PROG} always depend on ${LIBCRT0}.
Don't duplicate code between cleandir and clean.
Move tags target to bsd.dep.mk.
Move STRIP to bsd.own.mk.
Remove redundant definitions of {BIN,MAN}{DIR,GRP,OWN,MODE}.
Move {LIB,DOC}{DIR,GRP,OWN,MODE} defaults to bsd.own.mk.


# 1.25 15-Aug-1993 mycroft

Abstract out dependency stuff, and add RCS identifiers.


# 1.24 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


# 1.23 10-Aug-1993 mycroft

Put LINKS handling in `install' target, so it's the last thing executed, and
happens even if `realinstall' is user-defined.


# 1.22 30-Jul-1993 mycroft

When generating a default OBJS, ignore .h files.


# 1.21 29-Jul-1993 mycroft

Don't print the `making ...' message if an obj dir already exists.
Also, a minor cleanup.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.20 17-Jul-1993 mycroft

Fix C++ dependencies for good. `make depend' is now done in two passes--one
of C files and one for C++ files. No need to specify `-+' in your Makefile,
as it is now done automatically.


# 1.19 17-Jul-1993 cgd

do c++ dependencies the right way...


# 1.18 17-Jul-1993 mycroft

Add suffix rules for C++ files.


# 1.17 04-Jun-1993 brezak

Add LIBRPCSVC variable.


# 1.16 02-Jun-1993 cgd

add ability to specify c++ dependencies, by setting CFLAGS+=-+ for
the dependency make.


# 1.15 26-Apr-1993 cgd

added definition for DPADD library variable LIBCRYPT.


# 1.14 26-Apr-1993 mycroft

Don't redefine `realinstall' target if already defined.


# 1.13 25-Apr-1993 mycroft

Link with LDFLAGS even if one source module.


# 1.12 25-Apr-1993 mycroft

Don't lose if we include bsd.prog.mk only to build man pages.


# 1.11 25-Apr-1993 mycroft

Fix error in last change. (Oops.)


# 1.10 25-Apr-1993 mycroft

Don't build man pages if NOMAN set.


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.9 09-Apr-1993 cgd

various changes to default make rules. from patch 101.
note that only the "sensible" changes in patch 101 are implemented.


# 1.8 08-Apr-1993 cgd

try to do the right thing, in terms making directories before we
install into them, and get the manpage cleans _OUT_ of "clean".
they don't belong there, only in cleandir, WFJ be damned.


# 1.7 08-Apr-1993 cgd

fixed typos...


# 1.6 08-Apr-1993 cgd

(silently) make sure we have directories before installing


# 1.5 04-Apr-1993 cgd

make LIBRPC point to the right place


# 1.4 27-Mar-1993 nate

Fixed the doc macros to call troff, eqn,and tbl instead of ditroff,
deqn, and dtbl.
Fixed make clean to remove the man pages (Bill fixed this in the distribution,
but not in the original source)
Changed install to leave the original file around, by using 'cp' instead of
'mv'. "install -c ..."


# 1.3 23-Mar-1993 cgd

made .CURDIR be absolute, not relative, thereby eliminating
the need for some of the makefile trickery when making objects,
and fixing a few .PATH bugs


# 1.2 22-Mar-1993 cgd

fixed "make obj" for cases when sources not in /usr/src/...
if sources not there, it now mkdirs obj, but some trickery
is necessary, to avoid deleting cwd.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.338 15-Aug-2021 christos

Fix sun2 build for ldap/gssapi


# 1.337 14-Aug-2021 christos

Centralize the ldap libraries


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.336 12-Nov-2020 nia

Revert addition of pthread dependency on sqlite.

It is less trivial than expected and introduced some surprising breakage.


# 1.335 09-Nov-2020 christos

- make the CTFCONVERT command lines consistent and concise by putting all
the implementation stuff in a variable CTFCONVERT_RUN
- introduce an OBJECT_TARGET variable that contains the output object file
- when we need to run ctfconvert, go through an intermediate ${.TARGET}.o
file, instead of writing directly to ${.TARGET} and then overwriting
${.TARGET} with ctfconvert. This avoids build failures after a build
got interrupted (the "partially built from C" scourge).


# 1.334 09-Nov-2020 martin

Adapt for sqlite requiring pthreads now


# 1.333 30-Oct-2020 martin

libsqlite3 now requires -lm


# 1.332 16-Oct-2020 nia

share/mk: Define some missing X11 libraries.


# 1.331 15-Jun-2020 christos

Rename blacklist -> blocklist


# 1.330 30-May-2020 christos

Make libuv private, requested by joerg@


# 1.329 24-May-2020 christos

Add libuv


Revision tags: phil-wifi-20200421 phil-wifi-20200411 phil-wifi-20200406
# 1.328 04-Apr-2020 christos

Linker semantics have changed; we now don't automatically link dependent
libraries from other DSO's. For example in /usr/bin/passwd:
ld: krb5_passwd.o: undefined reference to symbol \
'UI_UTIL_read_pw_string@@OPENSSL_1_1_0'
ld: /usr/obj/amd64-x86_64/release/lib/libcrypto.so.14: error adding symbols: \
DSO missing from command line


# 1.327 04-Apr-2020 christos

Fix kerberos libraries order


# 1.326 04-Apr-2020 christos

Add libgnuctf


# 1.325 03-Mar-2020 christos

Add fido and cbor


Revision tags: is-mlppp-base phil-wifi-20191119
# 1.324 18-Nov-2019 christos

Improve the script to check for installed libraries, and fix the wrong
names and obsolete libraries it found.


# 1.323 27-Aug-2019 kamil

Enhance the support of LLVM sanitizers

Define _REENTRANT for MKSANITIZER build. This is needed for at least stdio
code. This caused new build issued with duplicated symbols in few places
and rump kernel code picking different code paths borrowed from libc.
Handle all this in one go.

Add bsd.sanitizer.mk to share common code used by programs and libraries.

Switch from realall to beforeinstall target in .syms files. This is more
reliable in MKSANITIZER.


# 1.322 17-Aug-2019 kamil

Add PAXCTL_FLAG rules for MKSANITIZER

Add per-program rules to disable ASLR for ASan, TSan and MSan in all
sanitized programs. This flag is not needed for other supported sanitizers.

Without this change, sanitized init(8) dies early on startup.

Approach originally suggested by <joerg>


# 1.321 15-Aug-2019 kamil

Add SANITIZER_RENAME_CLASSES in bsd.prog.mk

This adds a more flexible version of SANITIZER_RENAME_SYMBOL.

New symbol allows to specify MKSANITIZER specific renames on per-file and
per-symbol basis.


# 1.320 10-Aug-2019 christos

Make the X11 library lists consistent again.


Revision tags: netbsd-9-base phil-wifi-20190609 pgoyette-compat-20190127
# 1.319 21-Jan-2019 christos

branches: 1.319.2;
Most of the mv operations are to move temporary files to their final place.
Some use -f, others don't. This can lead to spurious build failures when
the user performing the build changes. Centralize, and always use -f.


Revision tags: pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.318 12-Aug-2018 christos

fix broken library variable definitions (inconsistencies between
bsd.README and bsd.prog.mk)


Revision tags: pgoyette-compat-0728
# 1.317 25-Jul-2018 kamil

Introduce MKLIBCSANITIZER in the share/mk rules

Add flags that are required to build a program and a dynamically loaded
library.

Propagade LIBCSANITIZERFLAGS to CFLAGS and CXXFLAGS.

LDFLAGS is not changed on purpose, as a libcsanitizer is inside libc
and no external dependencies are needed.

Register NOLIBCSANITIZER, as certain distribution parts will need to be
skipped.


# 1.316 12-Jul-2018 maxv

Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.


Revision tags: phil-wifi-base
# 1.315 25-Jun-2018 kamil

branches: 1.315.2;
Add a framework for renaming symbols in libc&co for MKSANITIZER

A new keyword SANITIZER_RENAME_SYMBOL. It's a variable that has specified
a list of symbols to be renamed in a processor in order to remove naming
conflicts with public symbols in libc/m/pthread/rt.

This renaming will occur for libraries and programs.
A symbol with a conflicting 'name', will be renamed to '__mksanitizer_name'.

Based on an idea by <christos>


Revision tags: pgoyette-compat-0625
# 1.314 21-Jun-2018 kamil

Refactor MKSANITIZER flags in mk rules

Introduce a new variable SANITIZERFLAGS that contains all the sanitizer
specific flags. These flags are designed to be passed to CFLAGS, CXXFLAGS
and LDFLAGS.

Pass SANITIZERFLAGS in bsd.prog.mk rules to CFLAGS, CXXFLAGS and LDFLAGS.

Pass SANITIZERFLAGS in bsd.lib.mk rules to *_pic.a build flags. The *_pic.a
libraries are designed to construct .so libraries. All .so libraries with
few exceptions are expected to be prebuilt with a sanitizer. Another
purpuse of *_pic.a files can be constructing static PIE programs, however
they are not supported as of now and there is no sanitization of static
programs either.

Once MKSTATICPIE will be supported, it will be initially incompatible with
MKSANITIZER.

This change also makes it easier to build other targets like kernel and
kernel modules without userland sanitizers.

No functional change intended for MKSANITIZER=no users.


# 1.313 02-Jun-2018 christos

Sanitizers don't support static linking.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315
# 1.312 11-Mar-2018 mrg

define LIBXFONT2.


Revision tags: pgoyette-compat-base
# 1.311 25-Feb-2018 mrg

branches: 1.311.2;
add LIBKRB5_LDADD/LIBKRB5_DPADD and their static counterparts
to bsd.prog.mk. use them instead of hard coding various lists
of libraries for krb5.

this fixes static builds.


# 1.310 11-Dec-2017 christos

Instead of checking for obj existance which can be empty for shuttle-rule
programs, check for .sh sources.


# 1.309 10-Dec-2017 christos

don't try to build .debug files for shell scripts.


# 1.308 10-Oct-2017 christos

Add general {DP,LD}ADD.rump variables


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base
# 1.307 21-May-2017 riastradh

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.


# 1.306 21-May-2017 riastradh

Remove some vestiges of MKCRYPTO_IDEA/MKCRYPTO_MDC2.


# 1.305 21-May-2017 riastradh

Remove MKCRYPTO_RC5. Unconditionally include RC5 in libcrypto.so.

This option existed only because RC5 is covered by patents that, twenty
years ago, we had reason to suspect the patent holder, RSA, Inc., might
litigate. The two US patents in question are 5,724,428 and 5,835,600.

According to the USPTO Patent Term Calculator web site at
<https://www.uspto.gov/patent/laws-and-regulations/patent-term-calculator#heading-5>
(retrieved 2017-05-21), patents filed after 1995-06-07 expire twenty
years after the filing date.

number filing date
5,724,428 1995-11-01
5,835,600 1997-04-21

Thus, these patents appear to be expired.

As proposed on tech-crypto and tech-security:

https://mail-index.netbsd.org/tech-crypto/2017/05/05/msg000718.html
https://mail-index.netbsd.org/tech-security/2017/05/05/msg000927.html


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.304 19-Apr-2017 joerg

Add netpgpverify to the library list.


Revision tags: pgoyette-localcount-20170320
# 1.303 20-Feb-2017 rin

add missing LIBCXX


# 1.302 08-Feb-2017 kamil

libpthread_dbg(3) deletion from the base distribution

libpthread_dbg(3) is a remnant library from the M:N thread model
(pre-NetBSD-5.0) API to introspect threads within a process and for use
of debuggers.

Currently in the 1:1 model it's not used in GDB neither in LLDB and it's
not either planned to be used. It's current function to read pthread_t
structures is realizable within a regular debugger capable to
instrospect objects within a tracee (GDB, LLDB...).

Remaining users of this API can still use this library from
pkgsrc/devel/libpthread_dbg.

Sponsored by <The NetBSD Foundation>


# 1.301 29-Jan-2017 christos

add sqlite3 to statically linked libraries for pam.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914
# 1.300 20-Aug-2016 christos

branches: 1.300.2;
unbound additions


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.299 04-Apr-2016 joerg

branches: 1.299.2;
If the per-target LDSTATIC flag is set, don't include the PIE linker
flags as we currently don't support static PIE.


# 1.298 30-Mar-2016 martin

Pass -pie to cc, not -Wl,-pie. This way we have a chance to fix specs
for obscure corner cases like -pie -fPIE -static (used for
/usr/tests/lib/csu/h_initfini2 if building with MKPIE=yes).
While there also replace -fPIC with -fPIE for the PIE case, even if
it should be mostly equivalent.


# 1.297 12-Mar-2016 mrg

remove conditionals that are always true with GCC >= 4.8.


# 1.296 21-Feb-2016 christos

Add NODEBUG


# 1.295 31-Jan-2016 christos

Introduce NOPIE and NOCTF so that standalone programs build properly.


# 1.294 23-Jan-2016 christos

Define _KERNTYPES for things that need it.


# 1.293 07-Nov-2015 joerg

LIBEXECINFO


# 1.292 07-Jun-2015 matt

Make LIBCRT* depend on the right files if MLIBDIR from MKCOMPAT is defined.


# 1.291 01-Dec-2014 erh

PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilt
if any of their dependencies (i.e. the files they refer to) are changed.
This allows changes to transitive included headers to be handled properly.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.290 25-Mar-2014 ozaki-r

branches: 1.290.4;
Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.


Revision tags: riastradh-drm2-base3
# 1.289 09-Mar-2014 christos

let's see if the new dwarf library can handle dwarf 4


# 1.288 02-Mar-2014 christos

If we are compiling with -g and using gcc4.8 and dtrace downgrade
dwarf generation to version 2 for now.


# 1.287 15-Jan-2014 joerg

-Wl,-pie and -r don't agree with each other, so filter the former out.


# 1.286 11-Nov-2013 joerg

Relink binaries if crti.o changes.


# 1.285 29-Sep-2013 christos

Add libxcb


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.284 31-May-2013 mrg

add LIBX11_XCB; unfortunately since the library is named with a -
in it, we have to use an ugly hard coded assignment for now.
(could be cleaned up with more make variable magic i'm sure.)


# 1.283 04-Apr-2013 christos

ldopts should be before ldadd like everywhere else.


Revision tags: agc-symver-base
# 1.282 14-Feb-2013 christos

Since the libraries are produced with different MK flags than the programs,
we check for existance of the files instead of the MK flags.


# 1.281 14-Feb-2013 christos

Add PROGDPLIBS


# 1.280 26-Jan-2013 christos

CTFCONVERT me harder.


Revision tags: yamt-pagecache-base8
# 1.279 17-Jan-2013 christos

Now that we have separate debug sets, add -g if ${MKDEBUG} is set for
program builds since we don't need to install that symbol files.


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.278 24-Aug-2012 jmmv

branches: 1.278.2;
Allow DPADD to be specified on a per-program basis.


# 1.277 23-Aug-2012 joerg

Revert last, it breaks the tricks xsrc uses.


# 1.276 23-Aug-2012 joerg

Remove SHLIBINSTALLDIR and SHLINKINSTALLLIBDIR. Add rpath entries, if
SHLIBDIR differs from /usr/lib.


# 1.275 08-Aug-2012 christos

add MKRUMP by popular demand.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.274 29-Feb-2012 tron

Move "libexpat" from X11 into base which fixes PR lib/40346.
This change was approved by the Core Group.


# 1.273 21-Feb-2012 matt

Remove another ${SIZE}


# 1.272 20-Feb-2012 matt

Remove ${SIZE}


# 1.271 19-Feb-2012 matt

Add support for --combine with gcc.


Revision tags: netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2
# 1.270 05-Nov-2011 christos

branches: 1.270.2;
Add libtre


Revision tags: yamt-pagecache-base
# 1.269 16-Oct-2011 christos

branches: 1.269.2;
- no need to special-case libraries with weird characters.
- add a note about adding new libraries.


# 1.268 16-Oct-2011 christos

fix list of libraries to reflect reality.


# 1.267 10-Sep-2011 apb

Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.


# 1.266 27-Aug-2011 joerg

Add new "analyze" command to run clang's static analyzer in a directory
on all C/C++ files.


Revision tags: cherry-xenmp-base
# 1.265 26-Apr-2011 he

The new Heimdal adds -lwind and -lheimbase to the set of libraries,
so define the corresponding LIB* variables.
These are also needed in the PAM_STATIC_* variables, so add them there too.


# 1.264 11-Apr-2011 joerg

Adjust --sysroot related usage:
-Wl,-rpath does not expand =, so just drop it.

Drop -Wl,-rpath-link entries that duplicate the -Wl,-rpath entries, this
is done implicitly now that ld is built with sysroot support.

Use ${DESTDIR} explicitly for the remaining -Wl,-rpath-link entries.


# 1.263 10-Apr-2011 joerg

For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.


# 1.262 08-Mar-2011 jmmv

Revert previous (revision 1.261): it broke the build because PROG_CXX is
defined in terms of PROG, so later on we would end up with target duplicates
because both PROG_CXX and PROG were being converted to PROGS_CXX and PROGS.

Did not catch this earlier because the test build I did was not clean and
thus the duplicate targets did not have nasty effects.


# 1.261 07-Mar-2011 jmmv

Always convert PROG to its plural form independently of whether PROG_CXX
is defined or not. From Garrett Cooper in private mail.


Revision tags: bouyer-quota2-nbase
# 1.260 20-Feb-2011 jmmv

Define LIBATF_C and LIBATF_CXX to point to their corresponding .a files and
use these to properly set DPADD for test programs.


Revision tags: bouyer-quota2-base
# 1.259 13-Feb-2011 christos

add saslc


# 1.258 06-Feb-2011 joerg

Don't use -nostdinc or -nostdinc++ if this is included in a HOSTLIB.


# 1.257 17-Jan-2011 pooka

branches: 1.257.2;
Add rump bits to DPSRCS so that update builds work correctly.


Revision tags: matt-mips64-premerge-20101231
# 1.256 13-Dec-2010 pooka

befriend RUMPPRG with CRUNCHEDPRG


# 1.255 13-Dec-2010 pooka

Define RUMPPRG, which is just like PROG, except it additionally
builds a rump client with the name rump.${PROG}. The rump client
is not installed suid/sgid by default even if BINMODE is defined.


# 1.254 10-Dec-2010 joerg

Revert last, gcc(1) checks explicitly for -r on some platforms to disable
passing down --relax as well.


# 1.253 08-Dec-2010 joerg

gcc passes down -r directly to ld, so make it explicitly a linker option.


# 1.252 08-Dec-2010 joerg

Don't depend on ${CC} passing down -R to ld, use -Wl,-rpath explicitly.


# 1.251 08-Nov-2010 lukem

Preserve date on original shared library or program when stripping
the debug symbols and adding the debug-link to .debug.
Use '(rm -f file; false)' in the failure path to force failure.
Based on solution proposed by Nicolas Joly on tech-toolchain in July 2010.
Should fix PR toolchain/44046 from Andreas Gustafsson.


# 1.250 31-Oct-2010 mbalmer

Link Lua to the build and add the resulting files to the distribution sets.
Document the addition of Lua and the change we made to the default settings.


# 1.249 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.248 24-Apr-2010 lukem

When extracting separate debug symbols with MKDEBUG, there's no need
to leave the original file unstripped...


# 1.247 02-Mar-2010 darran

DTrace: Add CTF generation to the make framework. Only enabled when
MKDTRACE=yes.


# 1.246 14-Dec-2009 mrg

use "${CC} -r" not "${CC} -Wl,-r" as the latter fools GCC on some targets
and it ends up passing "-r -relax" to ld, which causes ld to barf.


# 1.245 14-Dec-2009 matt

Merge from matt-nb5-mips64


Revision tags: matt-premerge-20091211
# 1.244 08-Dec-2009 uebayasi

When PROGS / LIBS are used, you can pass each PROG / LIB specific parameters
to ${LD} via:

${LDADD.${PROG}}
${LDFLAGS.${PROG}}
${LDSTATIC.${PROG}}
${LDADD.${LIB}}
${LDFLAGS.${LIB}}

OTOH you can't pass parameters to ${CC}, because in suffix rules make(1) only
knows the name of ${.IMPSRC} and ${.TARGET}; it's users' responsivility to
define ${CC} parameters to all the sources of a given ${PROG} / ${LIB}.

Should address bin/42381.

(Bug in this commit log was pointed out by mrg@.)


# 1.243 27-Nov-2009 tsutsui

If CPPFLAGS or CXXFLAGS already contains -nostdinc or -nostdinc++,
don't add ${CPPFLAGS_ISYSTEM} or ${CPPFLAGS_ISYSTEMXX} to refer
${DESTDIR}/usr/include or ${DESTDIR}/usr/include/g++.

This change might cause errors on some MD stand dir, but in that case
each Makefile should be fixed to search proper system include paths
by -Ipath option in own CPPFLAGS.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.242 12-May-2009 plunky

remove libsdp as improved functionality has been enabled in libbluetooth.


# 1.241 10-Apr-2009 apb

Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links. They have no effect except when using a
metalog, in which case the information is added to the metalog. In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg. This should fix PR 24457 and PR 41155.


# 1.240 24-Nov-2008 cube

branches: 1.240.2;
Move cleanextra to the very ends in case another included file wants to add
to it even if it was initially empty.


Revision tags: netbsd-5-base matt-mips64-base2
# 1.239 19-Oct-2008 christos

branches: 1.239.2;
handle assembly files for MKPIE


# 1.238 16-Oct-2008 christos

Provide a way for a program to override the PIE flags.


# 1.237 15-Oct-2008 christos

don't compile/link libraries with pie


Revision tags: mjf-devfs2-base
# 1.236 02-Oct-2008 joerg

Hook up libfetch and pkg_install update.


Revision tags: wrstuden-revivesa-base-3
# 1.235 09-Sep-2008 joerg

Add MKSTRIPIDENT to remove the RCS IDs from binary programs and shared
libraries for space-constraint systems. The description is based on the
feedback of hubertf@, the logic on input from lukem@

This obsoletes the removal of LIBC_SCCS and SYSLIBC_SCCS for libc builds.


Revision tags: wrstuden-revivesa-base-2
# 1.234 28-Aug-2008 mrg

update a comment example


# 1.233 27-Aug-2008 rtr

use ${X11USRLIBDIR} instead of hard-coded /usr/X11R6/lib when building
${LIB.foo} vars


# 1.232 27-Aug-2008 lukem

Fix problem I introduced in rev 1.231 on 2008/08/25 where ${_PROGLDOPTS}
and -L${_GCC_LIBGCCDIR} were appearing in the link line before ${LDADD},
so -L${DESTDIR}/lib and -L${DESTDIR}/usr/lib were being used before
local -L library paths.
Fixes ntpd/ntpdate failure noticed by Valeriy E. Ushakov <uwe@NetBSD.org>


# 1.231 25-Aug-2008 lukem

Always link with: -Wl,-rpath-link,${DESTDIR}/usr/lib -L${DESTDIR}/usr/lib
Fixes problem with MKDYNAMICROOT=no triggered by libraries that depend
on other libraries.
Related to PR 33503.

Clean up setting of _CCLINK to always add the appropriate -B options.

Simplify the link rule for a program.


# 1.230 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.229 28-May-2008 lukem

add LIBLDAR_R (for completeness)


# 1.228 22-May-2008 lukem

Add MKLDAP, USE_LDAP, LIBLBER, LIBLDAP


Revision tags: hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-pf42-base
# 1.227 10-Apr-2008 tsutsui

branches: 1.227.2; 1.227.4;
Add libhx509 to PAM_STATIC_LDADD which is required by libkrb5.


# 1.226 22-Mar-2008 mlelstv

branches: 1.226.2;
Import Heimdal-1.1


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase matt-armv6-base hpcarm-cleanup-base
# 1.225 26-Dec-2007 jmmv

Make the clean target work when OBJS is set but PROG is not, as happens
for example in gnu/lib/crtstuff4. Reported by drochner@.


Revision tags: cube-autoconf-base
# 1.224 13-Nov-2007 jmmv

Fix typo that prevented MKDEBUG builds to work. Found by drochner@.


# 1.223 12-Nov-2007 jmmv

Add the ability to build multiple programs from a single directory

This adds support for a new set of variables, PROGS and PROGS_CXX, that
allow the developer to build multiple different programs from a single
source directory.


# 1.222 04-Nov-2007 tls

Remove MKPRIVATELIB from BIND libraries; move library reachover
directories and Makefiles from src/usr.sbin/bind to src/lib; make
BIND libraries build shared. Saves about 1MB-1.5MB per installed
executable, about 5MB for a base+etc minimal installation of NetBSD.


Revision tags: matt-mips64-base
# 1.221 29-Jul-2007 joerg

branches: 1.221.4; 1.221.6;
Add build glue for libarchive and update the various sets.


# 1.220 25-Jan-2007 perry

Before I completely forget the issue, convert "PROG_PAX" to the
better-named "PAXCTL_FLAGS".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.219 11-Nov-2006 christos

don't run paxctl if other commands were specified for that target.


# 1.218 10-Nov-2006 christos

if ${PROG_PAX} is defined, run paxctl on the binary after linking with
the value of the variable. This way, if you set:

PROG_PAX=+M

in /etc/mk.conf, you get what you deserve.


# 1.217 22-Oct-2006 pooka

libpuffs


# 1.216 09-Oct-2006 mrg

- clean up some comments to reality.
- retire LIBDCK, LIBG2C and (long broken) USE_LIBSTDCXX
- in bsd.hostprog.mk's LIBSTDCPP -> LIBSTDCC
- add LIBSUPCXX
- don't default USE_LIBSTDCXX or USE_GCC4 since they are
not used in the tree any where
- same with USE_XF86_4; retire it
- remove _SUPCXX handling in bsd.prog.mk

inspired by PR#26714.


Revision tags: abandoned-netbsd-4-base
# 1.215 23-Jul-2006 lukem

Implement MKDEBUG:
If "no", don't build and install separate debugging symbols
into /usr/libdata/debug.
Default: no


# 1.214 19-Jun-2006 gdamore

Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.


# 1.213 09-Jun-2006 christos

PR/33681: Scott Ellis: Building 'bc' with SHAREDSTRINGS=yes fails
We need CPPFLAGS too now.


# 1.212 11-May-2006 mrg

add support for ${OBJCOPTS} and ${OBJCOPTS}.<lib|prog|fn>.


# 1.211 20-Mar-2006 christos

There is always one more KRB4 thing to remove. (from Jukka Salmi)


# 1.210 20-Mar-2006 christos

Remove krb4 variables and libraries (Jukka Salmi)


# 1.209 16-Mar-2006 jwise

Now that we have real build system support for syspkgs, remove someone's
half-implemented idea of building `syspkgs' (really a few giant blobs of the
same granularity of the old sets) using install(1).


# 1.208 20-Jan-2006 christos

Add the world of libraries to the static pam build. Now static pam binaries
work.


# 1.207 09-Apr-2005 dsl

Report when we link a program into xxx.ro (before being crunched)


Revision tags: netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.206 04-Mar-2005 he

branches: 1.206.2; 1.206.4;
Introduce PAM_STATIC_LDADD and PAM_STATIC_DPADD. When compiling
with MKPIC=no, possibly because the target does not support shared
libraries, these include libraries required to resolve all symbols
which end up referenced from PAM-using applications. The libraries
presently required are -lcrypt, -lrpcsvc and -lutil.

Add use of these variables which are currently set up to use PAM,
so that they compile when MKPIC=no.

Also, in the telnetd case, reorder the order of the libraries, so
that libtelnet.a comes before -ltermcap and -lutil, again to fix
link error when MKPIC=no.

Discussed with thorpej and christos.


# 1.205 20-Feb-2005 christos

Add libradius


# 1.204 12-Jan-2005 lukem

If RESCUEDIR is defined, automatically add that to CPPFLAGS


# 1.203 08-Jan-2005 lukem

Implement <bsd.prog.mk> vars:
LIBASN1 LIBBSDMALLOC LIBG2C LIBPAM LIBSSH


# 1.202 04-Aug-2004 lukem

Revert most of previous, and move the LIB<libname>?= assignments
back to bsd.prog.mk from bsd.own.mk.

pkgsrc uses <bsd.own.mk>, and setting LIB<libname> in it causes
problems with various package builds.
This should fix PR #26542 submitted by Jim Bernard.

(I'll be implementing the DPADD for shared libraries in a different
manner that generally won't depend upon ${LIB<libname>}.)


# 1.201 30-Jul-2004 lukem

Move the LIB<libname>?= assignments from bsd.prog.mk to bsd.own.mk so
that they may be used by non PROGs (e.g., LIBs).

Improve some comments.


# 1.200 10-Jun-2004 lukem

Be consistent in handling YHEADER, similar to Christos' fix in bsd.lib.mk 1.253


# 1.199 21-May-2004 ross

If you add a library, you need to define its DPADD symbol here.

Add LIBMAGIC.


Revision tags: netbsd-2-0-base
# 1.198 15-Feb-2004 skrll

branches: 1.198.2;
Be more gcc like in the way we deal with libgcc so that sh3/hppa millicode
and exception handling have a chance of working properly.

- creates libgcc, libgcc_eh and libgcc_s

- updates LIBGCC_SPEC to use them appropriately.

There's a hack in here at the moment with respect to libgcc_so in that it
is preferable to link against libgcc_so will only when -shared-libgcc is
specified (the c++ frontend does this automatically.) Configurations where
LINK_EH_SPEC is defined already do this. The gcc configuration for
NetBSD/alpha and another NetBSD platform (I forget which) actually define
LINK_EH_SPEC probably by accident rather than design.

- updates share/mk to use the compiler's knowledge of what needs linking into
libraries and executables. This removes an hppa hack.

- updates the sets for the newly created libgcc* files.

- support for linking against the _pg version of libgcc has been removed.


# 1.197 29-Jan-2004 lukem

Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.


# 1.196 27-Jan-2004 lukem

Replace
:M-[IDU]*
with
:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)


# 1.195 23-Jan-2004 simonb

crt0.o lives in /usr/lib even on a.out.


# 1.194 16-Nov-2003 lukem

simplify with _MKTARGET_LINK


# 1.193 11-Nov-2003 dsl

Set MKDEP_SUFFIXES to get additional targets in .depend instead of using
sed in .afterdepend. I don't think .afterdepend is used anywhere any more.


# 1.192 21-Oct-2003 lukem

Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.


# 1.191 19-Oct-2003 lukem

Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} " ... {$.TARGET}" and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO


# 1.190 18-Oct-2003 lukem

Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command ("verbose")
This is the default, and is equivalent to the previous behaviour.


# 1.189 29-Sep-2003 lukem

Add LIBSTDCXX (for usr/lib/libstdc++.a).
Sync LIB* documentation with reality.


# 1.188 19-Sep-2003 martin

Drop explicit medlow model and default to -O2 for sparc64.


# 1.187 14-Sep-2003 lukem

Check ${SHLIBDIR} against "/usr/lib" instead of ${LIBDIR} when determining
if we need to add stuff (usually "/lib") to the rpath-link path before
"/usr/lib". Otherwise, this barfs if LIBDIR != /usr/lib or /lib, and
we're cross-building (e.g., in src/x11)


# 1.186 13-Sep-2003 erh

Also support per-program LDFLAGS and LDSTATIC.


# 1.185 13-Sep-2003 erh

Create a way to add additional flags to COPTS, CPPFLAGS, CXXFLAGS and LDADD
for particular libraries or programs by specifying the additions in mk.conf
instead of needing to go edit individual Makefiles.


# 1.184 12-Sep-2003 lukem

add infrastructure to support reach-over builds of xsrc


# 1.183 22-Aug-2003 dsl

Add a ${PROG}.ro target that does an 'ld -r' of the program object files.
Allows a much simplified build of 'crunched' binaries since crunchgen can
build prog.ro instead of having to deretmine the names of all the .o files.


# 1.182 01-Aug-2003 lukem

Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".


# 1.181 01-Aug-2003 lukem

simplify the ${PROG}: target to reduce duplication between the DESTDIR
and !DESTDIR cases...


# 1.180 31-Jul-2003 lukem

bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.


# 1.179 31-Jul-2003 lukem

Don't need -R/usr/lib; it will be searched at the end by ld.elf_so anyway.
Noted by matt green <mrg@>


# 1.178 28-Jul-2003 lukem

be consistent when adding *.y and *.l to DPSRCS


# 1.177 28-Jul-2003 lukem

replace MKCXXSUPCXX(!=no) with USE_LIBSTDCXX(==no)


# 1.176 28-Jul-2003 lukem

Change defined(CXX_SUPCXX) to MKCXXSUPCXX != "no".

Clarify that command-line overrides of the MKxxx variables should be
done via the environment rather than make(1) command-line variable
assignment, since the latter doesn't actually work as intended.


# 1.175 27-Jul-2003 mrg

introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes. for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)


# 1.174 26-Jul-2003 mrg

add a new bsd.own.mk variable: CXX_SUPCXX. from bsd.README:
+ CXX_SUPCXX If defined, the support libraries needed for this C++ program
+ are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.


# 1.173 20-Jul-2003 lukem

Consistently support the different C++ file extensions: .cc .cpp .cxx .C
Noted by Andrew White in PR toolchain/18246


# 1.172 18-Jul-2003 lukem

Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was defined.
Replace defined(UNPRIVED) tests with ${MKUNPRIVED} != "no"

Add MKUPDATE; if not no has the same semantics as if UPDATE was defined.
Replace defined(UPDATE) tests with ${MKUPDATE} != "no"

Improve documentation for these and other make flags.


# 1.171 16-Jul-2003 itojun

stop installing install libtelnet. build under lib/libtelnet and reference
it from usr.bin/telnet and libexec/telnetd.
(reason for separate build: compiler flags)


# 1.170 27-Jun-2003 drochner

For consistency, use "-R" instead of "-Wl,-rpath" to pass
a runtime search path to the linker.


# 1.169 13-Jun-2003 itojun

define LIBEVENT


# 1.168 11-Jun-2003 msaitoh

catch signal 1,2,3,13 and 15 to clean /tmp/_dependXXX


# 1.167 31-May-2003 thorpej

If EXTERNAL_TOOLCHAIN is defined, allow the compiler to define the
location of crt{begin,end}{,S}.o and libgcc.a. Encapsulate all of
this logic into the new bsd.gcc.mk, and use it in bsd.prog.mk and
bsd.lib.mk.


# 1.166 18-May-2003 lukem

make this a no-op if HOSTPROG is defined


# 1.165 30-Mar-2003 thorpej

If MACHINE_ARCH is powerpc and we HAVE_GCC3, add crtsaveres.o to the
endfile spec.


# 1.164 22-Feb-2003 uwe

Typo in comment.


# 1.163 24-Jan-2003 thorpej

Add LIBPTHREAD, LIBPTHREAD_DB, and LIBRT.


Revision tags: fvdl_fs64_base
# 1.162 22-Nov-2002 thorpej

Split crtbegin/crtend into crti/crtbegin/crtend/crtn. NetBSD-specific
things like the .note.netbsd.ident section are provided by crti/crtn.
crti/crtn also provide the _init() and _fini() routines.

crtbegin/crtend now only provide support for ctors/dtors. This paves
the way to using the "crtstuff" provided with GCC (when we upgrade to
GCC 3.3), which provides, among other things, much better C++/Java
exception handling.


# 1.161 12-Nov-2002 itohy

MKDYNAMICROOT for a.out


# 1.160 22-Oct-2002 perry

Pass 1 of SYSPKG changes to automatically add tags=pkgname_pkg to METALOG.
Not quite ready for prime time yet.


# 1.159 27-Sep-2002 thorpej

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.


# 1.158 26-Sep-2002 itojun

MDC2 is a patented algorithm; don't ship it in default libcrypto.
MKCRYPTO_MDC2 will build a separate library, libcrypto_mdc2.


# 1.157 08-Sep-2002 thorpej

Build a .gdbinit in the objdir when building a program. The .gdbinit
file sets the shared library prefix to ${DESTDIR}, and adds "sources"
directives for each file listed in the GDBINIT Makefile variable.


# 1.156 09-Aug-2002 thorpej

Add LIBPMC.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.155 27-Mar-2002 eeh

branches: 1.155.2;
Use the medium low model for sparc64 programs that don't 2GB of data segment.


# 1.154 11-Feb-2002 mycroft

Don't use .PHONY for targets that are actually installed. Instead use force
dependencies. (Among other things, `make -t install' does something vaguely
sensible now.)


# 1.153 07-Feb-2002 pk

Mark installed system libraries as .MADE only if we're actually establishing
their default variable values here.


# 1.152 04-Feb-2002 christos

s/.NOSUFF/.MADE/


# 1.151 03-Feb-2002 christos

Apply a .NOSUFF: directive to targets we don't want to have processed by
the suffix rules engine.


# 1.150 02-Feb-2002 veego

Ups, it is LIBUSBHID and not LIBUSBHIB.


# 1.149 02-Feb-2002 veego

Change LIBUSB to LIBUSBHIB, reflecting the library name change.


# 1.148 29-Jan-2002 enami

Mark the targets clean{extra,objs} as PHONY.


# 1.147 04-Jan-2002 thorpej

For PROG_CXX DESTDIR builds, pull in -lstdc++ and -lm regardless
of GCC version.


# 1.146 01-Jan-2002 thorpej

Per a suggestion from matthew green, PROG_CXX takes the place of
PROG for C++ programs.


# 1.145 01-Jan-2002 thorpej

* If PROG_CXX is set by the program's Makefile, use ${CXX} to link
the program rather than ${CC}.
* If HAVE_GCC3 is defined, pull in "-lstdc++ -lm" as additional C++
support libraries for DESTDIR builds.


# 1.144 28-Dec-2001 lukem

* 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


# 1.143 28-Nov-2001 tv

If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.


# 1.142 19-Nov-2001 thorpej

Use a little transitional hack to determine if we use -isystem
or -idirafter. Use the former only of USE_NEW_TOOLCHAIN, since
-isystem causes the old toolchain to bomb out when building
libstdc++.


# 1.141 14-Nov-2001 tv

C/..$/.c/ -> C/\..$/.c/


# 1.140 14-Nov-2001 tv

Move the DESTDIR-based nostdinc logic to bsd.lib.mk and bsd.prog.mk where
it belongs (with the native target compile rules).


# 1.139 02-Nov-2001 tv

Use INSTALL_FILE/INSTALL_DIR as appropriate.


# 1.138 02-Nov-2001 tv

Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.


# 1.137 19-Oct-2001 tv

Add .NOPATH for all files generated from .l or .y files in SRCS. Fixes PRs
bin/14187 and lib/14239.

Also simplify the handling of these transforms to .c and .h files a bit by
leveraging make's builtin macro operators.


# 1.136 25-Sep-2001 tv

Set .NOPATH on program to build to make sure it goes in .OBJDIR.
Problem noted by <seebs@plethora.net>.


# 1.135 24-Sep-2001 lukem

fix previous (hi thor!) - $OBJS and $CLEANFILES might be empty, and
rm needs some files to delete...


# 1.134 24-Sep-2001 tls

Split "cleanprog" target apart: now you can zap only object files or
CLEANFILES (needed to fix crunchgen lossage).


# 1.133 13-Sep-2001 thorpej

Add LIBPCI.


# 1.132 14-Aug-2001 tv

Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").


# 1.131 01-Jun-2001 tv

Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).


# 1.130 08-May-2001 sommerfeld

Suppress duplicate entries in ALLFILES, FILES, INCS, DEPINCS, INFOFILES,
NLSALL, CATPAGES, MANPAGES, HTMLPAGES, and SCRIPTS.


# 1.129 19-Feb-2001 jmc

Wrap target() checks around afterdepend rule as some Makefiles override this


# 1.128 26-Jan-2001 itojun

fix typo in LIBSSL decl. it made programs with DPADD+=${LIBSSL} to build
every time we type "make". From: bernd


# 1.127 14-Jan-2001 christos

use the new .if commands(<target>) directive so that we don't have to
change Makefiles.


# 1.126 14-Jan-2001 christos

fix thinko: test for the existance of the target before we define it...


# 1.125 14-Jan-2001 christos

Alter previous redefined target protection. If the ${PROG} target is defined,
add the dependencies as usual, but don't add the commands. This avoids
having to change all the Makefiles that redefine the PROG target.


# 1.124 14-Jan-2001 christos

allow programs to override the program target.


# 1.123 08-Jan-2001 mrg

add missing $LIBCRYPTO_RC5 and $LIBCRYPTO_IDEA


# 1.122 08-Jan-2001 mrg

add missing $LIBSSL


# 1.121 04-Jan-2001 garbled

Add LIBCDK and LIBFORM definitions


# 1.120 31-Oct-2000 itojun

add ${LIBINTL} for use with DPADD.


# 1.119 07-Oct-2000 deberg

fix typos, PR 11159


# 1.118 25-Jun-2000 erh

For the case when DESTDIR is set: move the -L${DESTDIR}/usr/lib after ${LDADD} so any -L directories set in LDADD are searched first to avoid possibly linking against old versions of libraries.


Revision tags: netbsd-1-5-base
# 1.117 19-Jun-2000 thorpej

branches: 1.117.2;
Sync up the LIB* list.


# 1.116 10-Jun-2000 mycroft

Use ${.ALLSRC:T} when doing the generated variable name lookups, so that it
DTRT for generated files in and obj directory (or accessed via .PATH).


# 1.115 06-Jun-2000 mycroft

Abuse .USE some more.


# 1.114 06-Jun-2000 mycroft

Minor rearrangement.


# 1.113 06-Jun-2000 mycroft

Use ODE make(1) features to eliminate extra variables and move several things
outside of .for loops. (Needs more work to completely eliminate .for.)

XXX Don't look at this stuff. It will make your head hurt.


Revision tags: minoura-xpg4dl-base
# 1.112 14-Apr-2000 mrg

branches: 1.112.2;
use -rpath-link rather than -R when linking objects using a DESTDIR.
this replaces the previous change as that ended up adding
$DESTDIR/usr/lib to the runtime path of every binary created, which
is bogus and dangerous.


# 1.111 25-Mar-2000 mycroft

When linking with $DESTDIR, use an explicit -R to get library dependencies
correct.


# 1.110 07-Mar-2000 veego

Remove unused libahdi.
It will be replaced in the future with a more generic libdisklabel.


# 1.109 05-Feb-2000 jdc

Add libahdi entries.


# 1.108 23-Jan-2000 eeh

Add some support for FCode binaries.


# 1.107 22-Jan-2000 mycroft

Make `dependall' play nicely with SUBDIR, using a hack similar to `realinstall'
for both `depend' and `all'.
Also, remove the old hack that invokes an extra shell for .depend, now that
make(1) has been fixed.


# 1.106 16-Jan-2000 assar

all: depend on ${SCRIPTS} so that they get generated if they need to


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.105 23-Nov-1999 blymn

Added libmenu library.


Revision tags: comdex-fall-1999-base
# 1.104 14-Sep-1999 perry

branches: 1.104.4;
Add a "dependall" target, which does a "make depend" and then "make all"
in a single directory. This is useful in "make build" because by doing
the build immediately after the depend, all sources will typically
still be in the buffer cache, thus saving significant time over doing
a "make depend" on all the directories and then a "make all".


# 1.103 04-Sep-1999 fredb

Permit "make all install", as well as "make foo install" (where foo would be
installed by "make install") without setting of BUILD. All cases where BUILD
is already set are unchanged from the old behavior.

"make all install" is now practically equivalent to "make BUILD= all install",
but without actually setting build.

Fixes pr's 8313, 3894.


# 1.102 21-Aug-1999 simonb

Add ${INSTPRIV} to ${INSTALL} commands.


# 1.101 01-Jul-1999 itojun

branches: 1.101.2;
add LIBIPSEC for use from DPADD.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.100 12-Feb-1999 lukem

branches: 1.100.2;
* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.99 10-Feb-1999 tv

libbfd_pic.a is no longer installed; remove ${LIBBFD} define.


# 1.98 04-Feb-1999 christos

PR/2936: Brian C. Grayson: Avoid truncating precious files when installing
and the filesystem is full. Added ${RENAME} flag to install, which when set
to -r installs on a temporary file and then renames to the final destination.
${RENAME} is currently set to nothing in bsd.own.mk, but one can turn it
on in /etc/mk.conf.


# 1.97 07-Nov-1998 jonathan

Do DESTDIR support for crtbegin/crtend on all ELF ports (adds mips).


# 1.96 28-Sep-1998 christos

Use preserve flag in install.


# 1.95 10-Sep-1998 ross

Define a LIBBZ2?=... for use in DPADD=... lines.


# 1.94 09-Aug-1998 lukem

add distclean as a synonym for cleandir


# 1.93 09-Apr-1998 tv

.y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.


# 1.92 01-Apr-1998 tv

Revert. This broke too much in the build tree, and a better solution
needs to be created. (The existing situation breaks a lot too.)


# 1.91 01-Apr-1998 tv

Fix .y rules to DTRT with possibly generated .h files. See mail on
tech-toolchain for a very detailed explanation of this. In short, add
a .y.h rule identical to the .y.c rule and make the .y.c rule rename
the .h file; also, clean the .h file in CLEANFILES.


# 1.90 03-Nov-1997 cgd

echo the lint command line when making 'lint'.


# 1.89 28-Oct-1997 lukem

add ${LIBOBJC}


Revision tags: netbsd-1-3-base
# 1.88 11-Oct-1997 mycroft

branches: 1.88.2;
Several changes:
* Allow bsd.man.mk to be included separately.
* Always include bsd.own.mk and bsd.obj.mk.
* Include bsd.man.mk and bsd.nls.mk even if NOMAN or NONLS; just turn off
building of the affected files instead.
* Require bsd.subdir.mk to be included explicitly.
(Will make appropriate changes to Makefiles shortly.)


# 1.87 29-Sep-1997 gwr

Add $LIBBFD


# 1.86 31-May-1997 cjs

Back out BUILDDIR and NOINSTALL changes.


# 1.85 26-May-1997 cjs

branches: 1.85.2;
These updates to the build allow building against include files
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.


# 1.84 18-May-1997 kleink

Add libposix.


# 1.83 17-May-1997 mycroft

Do LINKS and SYMLINKS after FILES and INCS.


# 1.82 17-May-1997 mycroft

Remove unneeded .SUFFIXES lines, and move .s and .S closer to .o to give the
right preferences.


# 1.81 09-May-1997 mycroft

Fix typo in previous.


# 1.80 09-May-1997 mycroft

Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.79 09-May-1997 mycroft

Remove cruft.


# 1.78 09-May-1997 mycroft

Oops; rearrange dependencies to get things built early enough.


# 1.77 09-May-1997 mycroft

Make sure INCS and SRCS are built if necessary.


# 1.76 08-May-1997 gwr

Set the .NOPATH flag for ${OBJS} (from Christos).


# 1.75 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.74 07-May-1997 mycroft

Various simplifications.


# 1.73 07-May-1997 mycroft

Shuffle some .PHONYs around, to work better with `-t'.


# 1.72 06-May-1997 mycroft

Make most of the install targets .PRECIOUS.


# 1.71 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.70 18-Apr-1997 christos

Add ${LIBNTP}


# 1.69 17-Apr-1997 thorpej

- Properly depend on crtbegin.o and crtend.o for platforms that use
them (currently Alpha and PowerPC)
- STRIP -> STRIPFLAG


# 1.68 03-Apr-1997 mikel

don't allow override of all: target


# 1.67 29-Mar-1997 mikel

merge lite-2 changes (mostly SCCSids)


# 1.66 27-Mar-1997 christos

Put the FILES generated rules in a separate .mk file since both bsd.prog.mk
and bsd.lib.mk use them.


# 1.65 27-Mar-1997 mycroft

Make the SCRIPTS case mimic the FILES case more closely, so we can override
the destination direectory, etc.


# 1.64 27-Mar-1997 mycroft

Remove knowledge of HIDEGAME from here.


# 1.63 24-Mar-1997 christos

make rules update:
- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation


# 1.62 22-Mar-1997 perry

Fix SYMLINKS not to include DESTDIR in the link itself


# 1.61 13-Mar-1997 perry

add SYMLINKS, by analogy to LINKS. Vetted by Christos.


# 1.60 22-Jan-1997 cgd

if 'clean' is not already defined, rather than simply defining it with
a bunch of rules, define a clean{kmod,lib,prog} target with the rules,
and have both clean and cleandir depend on that. That eliminates a bug
where 'cleandir' in a directory which included e.g. bsd.prog.mk but which
also had subdirs would 'make clean' all the subdirs and then 'make cleandir'
all ofthe subdirs. It also allows Makefiles to add more dependencies
to 'clean' after inclusion of the make template.

If 'clean' is already defined, the behaviour is the same as it used to be.


# 1.59 20-Dec-1996 cgd

add an afterdepend target (a la the one in bsd.lib.mk) that processes
the .depend file to add <filename>.ln for each <filename>.o as an
object file which has the given dependencies (in addition to
<filename>.po and <filename>.so, which were already there).


# 1.58 13-Dec-1996 mikel

add missing LIBPCAP definition.


# 1.57 26-Nov-1996 mrg

add libz and libwrap


# 1.56 18-Oct-1996 thorpej

Use ${INSTALL} rather than "install".
From Simon J. Gerraty <sjg@zen.void.oz.au>, PR #1458.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.55 08-Apr-1996 jtc

Sort LIBFOO definitions and add LIBY; Reported by Mike Long <mike.long@analog.com> in PR #2301.


# 1.54 22-Oct-1995 christos

Added include file <bsd.sys.mk> that contains lex and yacc "parallel aware"
rules. These rules are not turned on by default; they are enabled by setting
the PARALLEL variable.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.53 25-Jun-1995 cgd

oops; fix an rm that might be empty


# 1.52 24-Jun-1995 cgd

update lint rules, but keep linting disabled


# 1.51 10-Jun-1995 mycroft

Define LIBEDIT.


# 1.50 21-Apr-1995 jtc

.include <bsd.nls.mk> unless NONLS is defined.


# 1.49 22-Dec-1994 cgd

specify man pages differently, and document how.


# 1.48 24-Aug-1994 mycroft

Include bsd.own.mk earlier.


# 1.47 20-Jul-1994 cgd

fix from christos, for progs w/o objects


Revision tags: netbsd-1-0-base
# 1.46 06-Jul-1994 mycroft

branches: 1.46.2;
Pull libraries from ${DESTDIR} if set. Kill LDONLY, which is unused and
probably not useful anyway.


# 1.45 30-Jun-1994 cgd

fix modify-info-nothingness-then-substitute probelm that broke genclass build


# 1.44 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.43 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.42 28-Jun-1994 jtc

Strip *.sh when constructing OBJS from SRCS.
This will allow us to clean up makefiles that build a script by munging
a template (uusched, genclass, neqn, etc.).


# 1.41 18-Jun-1994 cgd

don't chown the symlink, when HIDEGAME causes a symlink to be made to dm.
4.4-based FS code _follows_ the symlinks on a chown(2) call.


# 1.40 24-May-1994 cgd

fix the last to do the right thing for dependencies


# 1.39 24-May-1994 deraadt

LIBSKEY


# 1.38 22-May-1994 jtc

Single source file programs are now compiled into object files before they
are linked. This change halves the time it takes to rebuild all of the
NetBSD sources when only the C library is "touched"; but only takes about
one percent more disk space.


# 1.37 06-Apr-1994 chopps

relink (recompile) single source programs when crt0.o is updated.


# 1.36 24-Mar-1994 mycroft

Remove *.core on clean.


# 1.35 09-Feb-1994 cgd

kill install -d's.


# 1.34 28-Jan-1994 cgd

add LIBKVM


# 1.33 10-Nov-1993 cgd

librpc doesn't exist anymore


# 1.32 08-Nov-1993 cgd

ad LDSTATIC flag, so static linking can be made one-stop shopping.
use "setenv LDSTATIC" to make *everything* dynamically linked,
setenv LDSTATIC -static for everything statically linked, or unset
it for default behavior.


# 1.31 07-Oct-1993 cgd

LIBTERM pointed at nothing, but was meant to point to libtermcap.a...


# 1.30 07-Oct-1993 cgd

always define LIBCRYPT


# 1.29 17-Aug-1993 mycroft

Make sure we don't recurse into subdirectories if Makefile specified `install'
target. (It's usually blank and is specifically to avoid doing this...)


# 1.28 15-Aug-1993 mycroft

Automatically include bsd.subdir.mk for backward compatibility.


# 1.27 15-Aug-1993 mycroft

Don't automatically include bsd.subdir.mk in bsd.prog.mk and bsd.lib.mk.
Put back .MAIN in bsd.man.mk, and be careful not to include ../Makefile.inc
a second time.


# 1.26 15-Aug-1993 mycroft

Move man rules to sys.mk.
Use bsd.subdir.mk for building subdirectories.
Don't forget to remove x.cc and x.C when using SHAREDSTRINGS.
Make ${PROG} always depend on ${LIBCRT0}.
Don't duplicate code between cleandir and clean.
Move tags target to bsd.dep.mk.
Move STRIP to bsd.own.mk.
Remove redundant definitions of {BIN,MAN}{DIR,GRP,OWN,MODE}.
Move {LIB,DOC}{DIR,GRP,OWN,MODE} defaults to bsd.own.mk.


# 1.25 15-Aug-1993 mycroft

Abstract out dependency stuff, and add RCS identifiers.


# 1.24 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


# 1.23 10-Aug-1993 mycroft

Put LINKS handling in `install' target, so it's the last thing executed, and
happens even if `realinstall' is user-defined.


# 1.22 30-Jul-1993 mycroft

When generating a default OBJS, ignore .h files.


# 1.21 29-Jul-1993 mycroft

Don't print the `making ...' message if an obj dir already exists.
Also, a minor cleanup.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.20 17-Jul-1993 mycroft

Fix C++ dependencies for good. `make depend' is now done in two passes--one
of C files and one for C++ files. No need to specify `-+' in your Makefile,
as it is now done automatically.


# 1.19 17-Jul-1993 cgd

do c++ dependencies the right way...


# 1.18 17-Jul-1993 mycroft

Add suffix rules for C++ files.


# 1.17 04-Jun-1993 brezak

Add LIBRPCSVC variable.


# 1.16 02-Jun-1993 cgd

add ability to specify c++ dependencies, by setting CFLAGS+=-+ for
the dependency make.


# 1.15 26-Apr-1993 cgd

added definition for DPADD library variable LIBCRYPT.


# 1.14 26-Apr-1993 mycroft

Don't redefine `realinstall' target if already defined.


# 1.13 25-Apr-1993 mycroft

Link with LDFLAGS even if one source module.


# 1.12 25-Apr-1993 mycroft

Don't lose if we include bsd.prog.mk only to build man pages.


# 1.11 25-Apr-1993 mycroft

Fix error in last change. (Oops.)


# 1.10 25-Apr-1993 mycroft

Don't build man pages if NOMAN set.


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.9 09-Apr-1993 cgd

various changes to default make rules. from patch 101.
note that only the "sensible" changes in patch 101 are implemented.


# 1.8 08-Apr-1993 cgd

try to do the right thing, in terms making directories before we
install into them, and get the manpage cleans _OUT_ of "clean".
they don't belong there, only in cleandir, WFJ be damned.


# 1.7 08-Apr-1993 cgd

fixed typos...


# 1.6 08-Apr-1993 cgd

(silently) make sure we have directories before installing


# 1.5 04-Apr-1993 cgd

make LIBRPC point to the right place


# 1.4 27-Mar-1993 nate

Fixed the doc macros to call troff, eqn,and tbl instead of ditroff,
deqn, and dtbl.
Fixed make clean to remove the man pages (Bill fixed this in the distribution,
but not in the original source)
Changed install to leave the original file around, by using 'cp' instead of
'mv'. "install -c ..."


# 1.3 23-Mar-1993 cgd

made .CURDIR be absolute, not relative, thereby eliminating
the need for some of the makefile trickery when making objects,
and fixing a few .PATH bugs


# 1.2 22-Mar-1993 cgd

fixed "make obj" for cases when sources not in /usr/src/...
if sources not there, it now mkdirs obj, but some trickery
is necessary, to avoid deleting cwd.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.336 12-Nov-2020 nia

Revert addition of pthread dependency on sqlite.

It is less trivial than expected and introduced some surprising breakage.


# 1.335 09-Nov-2020 christos

- make the CTFCONVERT command lines consistent and concise by putting all
the implementation stuff in a variable CTFCONVERT_RUN
- introduce an OBJECT_TARGET variable that contains the output object file
- when we need to run ctfconvert, go through an intermediate ${.TARGET}.o
file, instead of writing directly to ${.TARGET} and then overwriting
${.TARGET} with ctfconvert. This avoids build failures after a build
got interrupted (the "partially built from C" scourge).


# 1.334 09-Nov-2020 martin

Adapt for sqlite requiring pthreads now


# 1.333 30-Oct-2020 martin

libsqlite3 now requires -lm


# 1.332 16-Oct-2020 nia

share/mk: Define some missing X11 libraries.


# 1.331 15-Jun-2020 christos

Rename blacklist -> blocklist


# 1.330 30-May-2020 christos

Make libuv private, requested by joerg@


# 1.329 24-May-2020 christos

Add libuv


Revision tags: phil-wifi-20200421 phil-wifi-20200411 phil-wifi-20200406
# 1.328 04-Apr-2020 christos

Linker semantics have changed; we now don't automatically link dependent
libraries from other DSO's. For example in /usr/bin/passwd:
ld: krb5_passwd.o: undefined reference to symbol \
'UI_UTIL_read_pw_string@@OPENSSL_1_1_0'
ld: /usr/obj/amd64-x86_64/release/lib/libcrypto.so.14: error adding symbols: \
DSO missing from command line


# 1.327 04-Apr-2020 christos

Fix kerberos libraries order


# 1.326 04-Apr-2020 christos

Add libgnuctf


# 1.325 03-Mar-2020 christos

Add fido and cbor


Revision tags: is-mlppp-base phil-wifi-20191119
# 1.324 18-Nov-2019 christos

Improve the script to check for installed libraries, and fix the wrong
names and obsolete libraries it found.


# 1.323 27-Aug-2019 kamil

Enhance the support of LLVM sanitizers

Define _REENTRANT for MKSANITIZER build. This is needed for at least stdio
code. This caused new build issued with duplicated symbols in few places
and rump kernel code picking different code paths borrowed from libc.
Handle all this in one go.

Add bsd.sanitizer.mk to share common code used by programs and libraries.

Switch from realall to beforeinstall target in .syms files. This is more
reliable in MKSANITIZER.


# 1.322 17-Aug-2019 kamil

Add PAXCTL_FLAG rules for MKSANITIZER

Add per-program rules to disable ASLR for ASan, TSan and MSan in all
sanitized programs. This flag is not needed for other supported sanitizers.

Without this change, sanitized init(8) dies early on startup.

Approach originally suggested by <joerg>


# 1.321 15-Aug-2019 kamil

Add SANITIZER_RENAME_CLASSES in bsd.prog.mk

This adds a more flexible version of SANITIZER_RENAME_SYMBOL.

New symbol allows to specify MKSANITIZER specific renames on per-file and
per-symbol basis.


# 1.320 10-Aug-2019 christos

Make the X11 library lists consistent again.


Revision tags: netbsd-9-base phil-wifi-20190609 pgoyette-compat-20190127
# 1.319 21-Jan-2019 christos

branches: 1.319.2;
Most of the mv operations are to move temporary files to their final place.
Some use -f, others don't. This can lead to spurious build failures when
the user performing the build changes. Centralize, and always use -f.


Revision tags: pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.318 12-Aug-2018 christos

fix broken library variable definitions (inconsistencies between
bsd.README and bsd.prog.mk)


Revision tags: pgoyette-compat-0728
# 1.317 25-Jul-2018 kamil

Introduce MKLIBCSANITIZER in the share/mk rules

Add flags that are required to build a program and a dynamically loaded
library.

Propagade LIBCSANITIZERFLAGS to CFLAGS and CXXFLAGS.

LDFLAGS is not changed on purpose, as a libcsanitizer is inside libc
and no external dependencies are needed.

Register NOLIBCSANITIZER, as certain distribution parts will need to be
skipped.


# 1.316 12-Jul-2018 maxv

Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.


Revision tags: phil-wifi-base
# 1.315 25-Jun-2018 kamil

branches: 1.315.2;
Add a framework for renaming symbols in libc&co for MKSANITIZER

A new keyword SANITIZER_RENAME_SYMBOL. It's a variable that has specified
a list of symbols to be renamed in a processor in order to remove naming
conflicts with public symbols in libc/m/pthread/rt.

This renaming will occur for libraries and programs.
A symbol with a conflicting 'name', will be renamed to '__mksanitizer_name'.

Based on an idea by <christos>


Revision tags: pgoyette-compat-0625
# 1.314 21-Jun-2018 kamil

Refactor MKSANITIZER flags in mk rules

Introduce a new variable SANITIZERFLAGS that contains all the sanitizer
specific flags. These flags are designed to be passed to CFLAGS, CXXFLAGS
and LDFLAGS.

Pass SANITIZERFLAGS in bsd.prog.mk rules to CFLAGS, CXXFLAGS and LDFLAGS.

Pass SANITIZERFLAGS in bsd.lib.mk rules to *_pic.a build flags. The *_pic.a
libraries are designed to construct .so libraries. All .so libraries with
few exceptions are expected to be prebuilt with a sanitizer. Another
purpuse of *_pic.a files can be constructing static PIE programs, however
they are not supported as of now and there is no sanitization of static
programs either.

Once MKSTATICPIE will be supported, it will be initially incompatible with
MKSANITIZER.

This change also makes it easier to build other targets like kernel and
kernel modules without userland sanitizers.

No functional change intended for MKSANITIZER=no users.


# 1.313 02-Jun-2018 christos

Sanitizers don't support static linking.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315
# 1.312 11-Mar-2018 mrg

define LIBXFONT2.


Revision tags: pgoyette-compat-base
# 1.311 25-Feb-2018 mrg

branches: 1.311.2;
add LIBKRB5_LDADD/LIBKRB5_DPADD and their static counterparts
to bsd.prog.mk. use them instead of hard coding various lists
of libraries for krb5.

this fixes static builds.


# 1.310 11-Dec-2017 christos

Instead of checking for obj existance which can be empty for shuttle-rule
programs, check for .sh sources.


# 1.309 10-Dec-2017 christos

don't try to build .debug files for shell scripts.


# 1.308 10-Oct-2017 christos

Add general {DP,LD}ADD.rump variables


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base
# 1.307 21-May-2017 riastradh

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.


# 1.306 21-May-2017 riastradh

Remove some vestiges of MKCRYPTO_IDEA/MKCRYPTO_MDC2.


# 1.305 21-May-2017 riastradh

Remove MKCRYPTO_RC5. Unconditionally include RC5 in libcrypto.so.

This option existed only because RC5 is covered by patents that, twenty
years ago, we had reason to suspect the patent holder, RSA, Inc., might
litigate. The two US patents in question are 5,724,428 and 5,835,600.

According to the USPTO Patent Term Calculator web site at
<https://www.uspto.gov/patent/laws-and-regulations/patent-term-calculator#heading-5>
(retrieved 2017-05-21), patents filed after 1995-06-07 expire twenty
years after the filing date.

number filing date
5,724,428 1995-11-01
5,835,600 1997-04-21

Thus, these patents appear to be expired.

As proposed on tech-crypto and tech-security:

https://mail-index.netbsd.org/tech-crypto/2017/05/05/msg000718.html
https://mail-index.netbsd.org/tech-security/2017/05/05/msg000927.html


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.304 19-Apr-2017 joerg

Add netpgpverify to the library list.


Revision tags: pgoyette-localcount-20170320
# 1.303 20-Feb-2017 rin

add missing LIBCXX


# 1.302 08-Feb-2017 kamil

libpthread_dbg(3) deletion from the base distribution

libpthread_dbg(3) is a remnant library from the M:N thread model
(pre-NetBSD-5.0) API to introspect threads within a process and for use
of debuggers.

Currently in the 1:1 model it's not used in GDB neither in LLDB and it's
not either planned to be used. It's current function to read pthread_t
structures is realizable within a regular debugger capable to
instrospect objects within a tracee (GDB, LLDB...).

Remaining users of this API can still use this library from
pkgsrc/devel/libpthread_dbg.

Sponsored by <The NetBSD Foundation>


# 1.301 29-Jan-2017 christos

add sqlite3 to statically linked libraries for pam.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914
# 1.300 20-Aug-2016 christos

branches: 1.300.2;
unbound additions


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.299 04-Apr-2016 joerg

branches: 1.299.2;
If the per-target LDSTATIC flag is set, don't include the PIE linker
flags as we currently don't support static PIE.


# 1.298 30-Mar-2016 martin

Pass -pie to cc, not -Wl,-pie. This way we have a chance to fix specs
for obscure corner cases like -pie -fPIE -static (used for
/usr/tests/lib/csu/h_initfini2 if building with MKPIE=yes).
While there also replace -fPIC with -fPIE for the PIE case, even if
it should be mostly equivalent.


# 1.297 12-Mar-2016 mrg

remove conditionals that are always true with GCC >= 4.8.


# 1.296 21-Feb-2016 christos

Add NODEBUG


# 1.295 31-Jan-2016 christos

Introduce NOPIE and NOCTF so that standalone programs build properly.


# 1.294 23-Jan-2016 christos

Define _KERNTYPES for things that need it.


# 1.293 07-Nov-2015 joerg

LIBEXECINFO


# 1.292 07-Jun-2015 matt

Make LIBCRT* depend on the right files if MLIBDIR from MKCOMPAT is defined.


# 1.291 01-Dec-2014 erh

PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilt
if any of their dependencies (i.e. the files they refer to) are changed.
This allows changes to transitive included headers to be handled properly.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.290 25-Mar-2014 ozaki-r

branches: 1.290.4;
Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.


Revision tags: riastradh-drm2-base3
# 1.289 09-Mar-2014 christos

let's see if the new dwarf library can handle dwarf 4


# 1.288 02-Mar-2014 christos

If we are compiling with -g and using gcc4.8 and dtrace downgrade
dwarf generation to version 2 for now.


# 1.287 15-Jan-2014 joerg

-Wl,-pie and -r don't agree with each other, so filter the former out.


# 1.286 11-Nov-2013 joerg

Relink binaries if crti.o changes.


# 1.285 29-Sep-2013 christos

Add libxcb


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.284 31-May-2013 mrg

add LIBX11_XCB; unfortunately since the library is named with a -
in it, we have to use an ugly hard coded assignment for now.
(could be cleaned up with more make variable magic i'm sure.)


# 1.283 04-Apr-2013 christos

ldopts should be before ldadd like everywhere else.


Revision tags: agc-symver-base
# 1.282 14-Feb-2013 christos

Since the libraries are produced with different MK flags than the programs,
we check for existance of the files instead of the MK flags.


# 1.281 14-Feb-2013 christos

Add PROGDPLIBS


# 1.280 26-Jan-2013 christos

CTFCONVERT me harder.


Revision tags: yamt-pagecache-base8
# 1.279 17-Jan-2013 christos

Now that we have separate debug sets, add -g if ${MKDEBUG} is set for
program builds since we don't need to install that symbol files.


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.278 24-Aug-2012 jmmv

branches: 1.278.2;
Allow DPADD to be specified on a per-program basis.


# 1.277 23-Aug-2012 joerg

Revert last, it breaks the tricks xsrc uses.


# 1.276 23-Aug-2012 joerg

Remove SHLIBINSTALLDIR and SHLINKINSTALLLIBDIR. Add rpath entries, if
SHLIBDIR differs from /usr/lib.


# 1.275 08-Aug-2012 christos

add MKRUMP by popular demand.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.274 29-Feb-2012 tron

Move "libexpat" from X11 into base which fixes PR lib/40346.
This change was approved by the Core Group.


# 1.273 21-Feb-2012 matt

Remove another ${SIZE}


# 1.272 20-Feb-2012 matt

Remove ${SIZE}


# 1.271 19-Feb-2012 matt

Add support for --combine with gcc.


Revision tags: netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2
# 1.270 05-Nov-2011 christos

branches: 1.270.2;
Add libtre


Revision tags: yamt-pagecache-base
# 1.269 16-Oct-2011 christos

branches: 1.269.2;
- no need to special-case libraries with weird characters.
- add a note about adding new libraries.


# 1.268 16-Oct-2011 christos

fix list of libraries to reflect reality.


# 1.267 10-Sep-2011 apb

Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.


# 1.266 27-Aug-2011 joerg

Add new "analyze" command to run clang's static analyzer in a directory
on all C/C++ files.


Revision tags: cherry-xenmp-base
# 1.265 26-Apr-2011 he

The new Heimdal adds -lwind and -lheimbase to the set of libraries,
so define the corresponding LIB* variables.
These are also needed in the PAM_STATIC_* variables, so add them there too.


# 1.264 11-Apr-2011 joerg

Adjust --sysroot related usage:
-Wl,-rpath does not expand =, so just drop it.

Drop -Wl,-rpath-link entries that duplicate the -Wl,-rpath entries, this
is done implicitly now that ld is built with sysroot support.

Use ${DESTDIR} explicitly for the remaining -Wl,-rpath-link entries.


# 1.263 10-Apr-2011 joerg

For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.


# 1.262 08-Mar-2011 jmmv

Revert previous (revision 1.261): it broke the build because PROG_CXX is
defined in terms of PROG, so later on we would end up with target duplicates
because both PROG_CXX and PROG were being converted to PROGS_CXX and PROGS.

Did not catch this earlier because the test build I did was not clean and
thus the duplicate targets did not have nasty effects.


# 1.261 07-Mar-2011 jmmv

Always convert PROG to its plural form independently of whether PROG_CXX
is defined or not. From Garrett Cooper in private mail.


Revision tags: bouyer-quota2-nbase
# 1.260 20-Feb-2011 jmmv

Define LIBATF_C and LIBATF_CXX to point to their corresponding .a files and
use these to properly set DPADD for test programs.


Revision tags: bouyer-quota2-base
# 1.259 13-Feb-2011 christos

add saslc


# 1.258 06-Feb-2011 joerg

Don't use -nostdinc or -nostdinc++ if this is included in a HOSTLIB.


# 1.257 17-Jan-2011 pooka

branches: 1.257.2;
Add rump bits to DPSRCS so that update builds work correctly.


Revision tags: matt-mips64-premerge-20101231
# 1.256 13-Dec-2010 pooka

befriend RUMPPRG with CRUNCHEDPRG


# 1.255 13-Dec-2010 pooka

Define RUMPPRG, which is just like PROG, except it additionally
builds a rump client with the name rump.${PROG}. The rump client
is not installed suid/sgid by default even if BINMODE is defined.


# 1.254 10-Dec-2010 joerg

Revert last, gcc(1) checks explicitly for -r on some platforms to disable
passing down --relax as well.


# 1.253 08-Dec-2010 joerg

gcc passes down -r directly to ld, so make it explicitly a linker option.


# 1.252 08-Dec-2010 joerg

Don't depend on ${CC} passing down -R to ld, use -Wl,-rpath explicitly.


# 1.251 08-Nov-2010 lukem

Preserve date on original shared library or program when stripping
the debug symbols and adding the debug-link to .debug.
Use '(rm -f file; false)' in the failure path to force failure.
Based on solution proposed by Nicolas Joly on tech-toolchain in July 2010.
Should fix PR toolchain/44046 from Andreas Gustafsson.


# 1.250 31-Oct-2010 mbalmer

Link Lua to the build and add the resulting files to the distribution sets.
Document the addition of Lua and the change we made to the default settings.


# 1.249 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.248 24-Apr-2010 lukem

When extracting separate debug symbols with MKDEBUG, there's no need
to leave the original file unstripped...


# 1.247 02-Mar-2010 darran

DTrace: Add CTF generation to the make framework. Only enabled when
MKDTRACE=yes.


# 1.246 14-Dec-2009 mrg

use "${CC} -r" not "${CC} -Wl,-r" as the latter fools GCC on some targets
and it ends up passing "-r -relax" to ld, which causes ld to barf.


# 1.245 14-Dec-2009 matt

Merge from matt-nb5-mips64


Revision tags: matt-premerge-20091211
# 1.244 08-Dec-2009 uebayasi

When PROGS / LIBS are used, you can pass each PROG / LIB specific parameters
to ${LD} via:

${LDADD.${PROG}}
${LDFLAGS.${PROG}}
${LDSTATIC.${PROG}}
${LDADD.${LIB}}
${LDFLAGS.${LIB}}

OTOH you can't pass parameters to ${CC}, because in suffix rules make(1) only
knows the name of ${.IMPSRC} and ${.TARGET}; it's users' responsivility to
define ${CC} parameters to all the sources of a given ${PROG} / ${LIB}.

Should address bin/42381.

(Bug in this commit log was pointed out by mrg@.)


# 1.243 27-Nov-2009 tsutsui

If CPPFLAGS or CXXFLAGS already contains -nostdinc or -nostdinc++,
don't add ${CPPFLAGS_ISYSTEM} or ${CPPFLAGS_ISYSTEMXX} to refer
${DESTDIR}/usr/include or ${DESTDIR}/usr/include/g++.

This change might cause errors on some MD stand dir, but in that case
each Makefile should be fixed to search proper system include paths
by -Ipath option in own CPPFLAGS.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.242 12-May-2009 plunky

remove libsdp as improved functionality has been enabled in libbluetooth.


# 1.241 10-Apr-2009 apb

Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links. They have no effect except when using a
metalog, in which case the information is added to the metalog. In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg. This should fix PR 24457 and PR 41155.


# 1.240 24-Nov-2008 cube

branches: 1.240.2;
Move cleanextra to the very ends in case another included file wants to add
to it even if it was initially empty.


Revision tags: netbsd-5-base matt-mips64-base2
# 1.239 19-Oct-2008 christos

branches: 1.239.2;
handle assembly files for MKPIE


# 1.238 16-Oct-2008 christos

Provide a way for a program to override the PIE flags.


# 1.237 15-Oct-2008 christos

don't compile/link libraries with pie


Revision tags: mjf-devfs2-base
# 1.236 02-Oct-2008 joerg

Hook up libfetch and pkg_install update.


Revision tags: wrstuden-revivesa-base-3
# 1.235 09-Sep-2008 joerg

Add MKSTRIPIDENT to remove the RCS IDs from binary programs and shared
libraries for space-constraint systems. The description is based on the
feedback of hubertf@, the logic on input from lukem@

This obsoletes the removal of LIBC_SCCS and SYSLIBC_SCCS for libc builds.


Revision tags: wrstuden-revivesa-base-2
# 1.234 28-Aug-2008 mrg

update a comment example


# 1.233 27-Aug-2008 rtr

use ${X11USRLIBDIR} instead of hard-coded /usr/X11R6/lib when building
${LIB.foo} vars


# 1.232 27-Aug-2008 lukem

Fix problem I introduced in rev 1.231 on 2008/08/25 where ${_PROGLDOPTS}
and -L${_GCC_LIBGCCDIR} were appearing in the link line before ${LDADD},
so -L${DESTDIR}/lib and -L${DESTDIR}/usr/lib were being used before
local -L library paths.
Fixes ntpd/ntpdate failure noticed by Valeriy E. Ushakov <uwe@NetBSD.org>


# 1.231 25-Aug-2008 lukem

Always link with: -Wl,-rpath-link,${DESTDIR}/usr/lib -L${DESTDIR}/usr/lib
Fixes problem with MKDYNAMICROOT=no triggered by libraries that depend
on other libraries.
Related to PR 33503.

Clean up setting of _CCLINK to always add the appropriate -B options.

Simplify the link rule for a program.


# 1.230 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.229 28-May-2008 lukem

add LIBLDAR_R (for completeness)


# 1.228 22-May-2008 lukem

Add MKLDAP, USE_LDAP, LIBLBER, LIBLDAP


Revision tags: hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-pf42-base
# 1.227 10-Apr-2008 tsutsui

branches: 1.227.2; 1.227.4;
Add libhx509 to PAM_STATIC_LDADD which is required by libkrb5.


# 1.226 22-Mar-2008 mlelstv

branches: 1.226.2;
Import Heimdal-1.1


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase matt-armv6-base hpcarm-cleanup-base
# 1.225 26-Dec-2007 jmmv

Make the clean target work when OBJS is set but PROG is not, as happens
for example in gnu/lib/crtstuff4. Reported by drochner@.


Revision tags: cube-autoconf-base
# 1.224 13-Nov-2007 jmmv

Fix typo that prevented MKDEBUG builds to work. Found by drochner@.


# 1.223 12-Nov-2007 jmmv

Add the ability to build multiple programs from a single directory

This adds support for a new set of variables, PROGS and PROGS_CXX, that
allow the developer to build multiple different programs from a single
source directory.


# 1.222 04-Nov-2007 tls

Remove MKPRIVATELIB from BIND libraries; move library reachover
directories and Makefiles from src/usr.sbin/bind to src/lib; make
BIND libraries build shared. Saves about 1MB-1.5MB per installed
executable, about 5MB for a base+etc minimal installation of NetBSD.


Revision tags: matt-mips64-base
# 1.221 29-Jul-2007 joerg

branches: 1.221.4; 1.221.6;
Add build glue for libarchive and update the various sets.


# 1.220 25-Jan-2007 perry

Before I completely forget the issue, convert "PROG_PAX" to the
better-named "PAXCTL_FLAGS".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.219 11-Nov-2006 christos

don't run paxctl if other commands were specified for that target.


# 1.218 10-Nov-2006 christos

if ${PROG_PAX} is defined, run paxctl on the binary after linking with
the value of the variable. This way, if you set:

PROG_PAX=+M

in /etc/mk.conf, you get what you deserve.


# 1.217 22-Oct-2006 pooka

libpuffs


# 1.216 09-Oct-2006 mrg

- clean up some comments to reality.
- retire LIBDCK, LIBG2C and (long broken) USE_LIBSTDCXX
- in bsd.hostprog.mk's LIBSTDCPP -> LIBSTDCC
- add LIBSUPCXX
- don't default USE_LIBSTDCXX or USE_GCC4 since they are
not used in the tree any where
- same with USE_XF86_4; retire it
- remove _SUPCXX handling in bsd.prog.mk

inspired by PR#26714.


Revision tags: abandoned-netbsd-4-base
# 1.215 23-Jul-2006 lukem

Implement MKDEBUG:
If "no", don't build and install separate debugging symbols
into /usr/libdata/debug.
Default: no


# 1.214 19-Jun-2006 gdamore

Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.


# 1.213 09-Jun-2006 christos

PR/33681: Scott Ellis: Building 'bc' with SHAREDSTRINGS=yes fails
We need CPPFLAGS too now.


# 1.212 11-May-2006 mrg

add support for ${OBJCOPTS} and ${OBJCOPTS}.<lib|prog|fn>.


# 1.211 20-Mar-2006 christos

There is always one more KRB4 thing to remove. (from Jukka Salmi)


# 1.210 20-Mar-2006 christos

Remove krb4 variables and libraries (Jukka Salmi)


# 1.209 16-Mar-2006 jwise

Now that we have real build system support for syspkgs, remove someone's
half-implemented idea of building `syspkgs' (really a few giant blobs of the
same granularity of the old sets) using install(1).


# 1.208 20-Jan-2006 christos

Add the world of libraries to the static pam build. Now static pam binaries
work.


# 1.207 09-Apr-2005 dsl

Report when we link a program into xxx.ro (before being crunched)


Revision tags: netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.206 04-Mar-2005 he

branches: 1.206.2; 1.206.4;
Introduce PAM_STATIC_LDADD and PAM_STATIC_DPADD. When compiling
with MKPIC=no, possibly because the target does not support shared
libraries, these include libraries required to resolve all symbols
which end up referenced from PAM-using applications. The libraries
presently required are -lcrypt, -lrpcsvc and -lutil.

Add use of these variables which are currently set up to use PAM,
so that they compile when MKPIC=no.

Also, in the telnetd case, reorder the order of the libraries, so
that libtelnet.a comes before -ltermcap and -lutil, again to fix
link error when MKPIC=no.

Discussed with thorpej and christos.


# 1.205 20-Feb-2005 christos

Add libradius


# 1.204 12-Jan-2005 lukem

If RESCUEDIR is defined, automatically add that to CPPFLAGS


# 1.203 08-Jan-2005 lukem

Implement <bsd.prog.mk> vars:
LIBASN1 LIBBSDMALLOC LIBG2C LIBPAM LIBSSH


# 1.202 04-Aug-2004 lukem

Revert most of previous, and move the LIB<libname>?= assignments
back to bsd.prog.mk from bsd.own.mk.

pkgsrc uses <bsd.own.mk>, and setting LIB<libname> in it causes
problems with various package builds.
This should fix PR #26542 submitted by Jim Bernard.

(I'll be implementing the DPADD for shared libraries in a different
manner that generally won't depend upon ${LIB<libname>}.)


# 1.201 30-Jul-2004 lukem

Move the LIB<libname>?= assignments from bsd.prog.mk to bsd.own.mk so
that they may be used by non PROGs (e.g., LIBs).

Improve some comments.


# 1.200 10-Jun-2004 lukem

Be consistent in handling YHEADER, similar to Christos' fix in bsd.lib.mk 1.253


# 1.199 21-May-2004 ross

If you add a library, you need to define its DPADD symbol here.

Add LIBMAGIC.


Revision tags: netbsd-2-0-base
# 1.198 15-Feb-2004 skrll

branches: 1.198.2;
Be more gcc like in the way we deal with libgcc so that sh3/hppa millicode
and exception handling have a chance of working properly.

- creates libgcc, libgcc_eh and libgcc_s

- updates LIBGCC_SPEC to use them appropriately.

There's a hack in here at the moment with respect to libgcc_so in that it
is preferable to link against libgcc_so will only when -shared-libgcc is
specified (the c++ frontend does this automatically.) Configurations where
LINK_EH_SPEC is defined already do this. The gcc configuration for
NetBSD/alpha and another NetBSD platform (I forget which) actually define
LINK_EH_SPEC probably by accident rather than design.

- updates share/mk to use the compiler's knowledge of what needs linking into
libraries and executables. This removes an hppa hack.

- updates the sets for the newly created libgcc* files.

- support for linking against the _pg version of libgcc has been removed.


# 1.197 29-Jan-2004 lukem

Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.


# 1.196 27-Jan-2004 lukem

Replace
:M-[IDU]*
with
:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)


# 1.195 23-Jan-2004 simonb

crt0.o lives in /usr/lib even on a.out.


# 1.194 16-Nov-2003 lukem

simplify with _MKTARGET_LINK


# 1.193 11-Nov-2003 dsl

Set MKDEP_SUFFIXES to get additional targets in .depend instead of using
sed in .afterdepend. I don't think .afterdepend is used anywhere any more.


# 1.192 21-Oct-2003 lukem

Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.


# 1.191 19-Oct-2003 lukem

Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} " ... {$.TARGET}" and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO


# 1.190 18-Oct-2003 lukem

Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command ("verbose")
This is the default, and is equivalent to the previous behaviour.


# 1.189 29-Sep-2003 lukem

Add LIBSTDCXX (for usr/lib/libstdc++.a).
Sync LIB* documentation with reality.


# 1.188 19-Sep-2003 martin

Drop explicit medlow model and default to -O2 for sparc64.


# 1.187 14-Sep-2003 lukem

Check ${SHLIBDIR} against "/usr/lib" instead of ${LIBDIR} when determining
if we need to add stuff (usually "/lib") to the rpath-link path before
"/usr/lib". Otherwise, this barfs if LIBDIR != /usr/lib or /lib, and
we're cross-building (e.g., in src/x11)


# 1.186 13-Sep-2003 erh

Also support per-program LDFLAGS and LDSTATIC.


# 1.185 13-Sep-2003 erh

Create a way to add additional flags to COPTS, CPPFLAGS, CXXFLAGS and LDADD
for particular libraries or programs by specifying the additions in mk.conf
instead of needing to go edit individual Makefiles.


# 1.184 12-Sep-2003 lukem

add infrastructure to support reach-over builds of xsrc


# 1.183 22-Aug-2003 dsl

Add a ${PROG}.ro target that does an 'ld -r' of the program object files.
Allows a much simplified build of 'crunched' binaries since crunchgen can
build prog.ro instead of having to deretmine the names of all the .o files.


# 1.182 01-Aug-2003 lukem

Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".


# 1.181 01-Aug-2003 lukem

simplify the ${PROG}: target to reduce duplication between the DESTDIR
and !DESTDIR cases...


# 1.180 31-Jul-2003 lukem

bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.


# 1.179 31-Jul-2003 lukem

Don't need -R/usr/lib; it will be searched at the end by ld.elf_so anyway.
Noted by matt green <mrg@>


# 1.178 28-Jul-2003 lukem

be consistent when adding *.y and *.l to DPSRCS


# 1.177 28-Jul-2003 lukem

replace MKCXXSUPCXX(!=no) with USE_LIBSTDCXX(==no)


# 1.176 28-Jul-2003 lukem

Change defined(CXX_SUPCXX) to MKCXXSUPCXX != "no".

Clarify that command-line overrides of the MKxxx variables should be
done via the environment rather than make(1) command-line variable
assignment, since the latter doesn't actually work as intended.


# 1.175 27-Jul-2003 mrg

introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes. for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)


# 1.174 26-Jul-2003 mrg

add a new bsd.own.mk variable: CXX_SUPCXX. from bsd.README:
+ CXX_SUPCXX If defined, the support libraries needed for this C++ program
+ are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.


# 1.173 20-Jul-2003 lukem

Consistently support the different C++ file extensions: .cc .cpp .cxx .C
Noted by Andrew White in PR toolchain/18246


# 1.172 18-Jul-2003 lukem

Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was defined.
Replace defined(UNPRIVED) tests with ${MKUNPRIVED} != "no"

Add MKUPDATE; if not no has the same semantics as if UPDATE was defined.
Replace defined(UPDATE) tests with ${MKUPDATE} != "no"

Improve documentation for these and other make flags.


# 1.171 16-Jul-2003 itojun

stop installing install libtelnet. build under lib/libtelnet and reference
it from usr.bin/telnet and libexec/telnetd.
(reason for separate build: compiler flags)


# 1.170 27-Jun-2003 drochner

For consistency, use "-R" instead of "-Wl,-rpath" to pass
a runtime search path to the linker.


# 1.169 13-Jun-2003 itojun

define LIBEVENT


# 1.168 11-Jun-2003 msaitoh

catch signal 1,2,3,13 and 15 to clean /tmp/_dependXXX


# 1.167 31-May-2003 thorpej

If EXTERNAL_TOOLCHAIN is defined, allow the compiler to define the
location of crt{begin,end}{,S}.o and libgcc.a. Encapsulate all of
this logic into the new bsd.gcc.mk, and use it in bsd.prog.mk and
bsd.lib.mk.


# 1.166 18-May-2003 lukem

make this a no-op if HOSTPROG is defined


# 1.165 30-Mar-2003 thorpej

If MACHINE_ARCH is powerpc and we HAVE_GCC3, add crtsaveres.o to the
endfile spec.


# 1.164 22-Feb-2003 uwe

Typo in comment.


# 1.163 24-Jan-2003 thorpej

Add LIBPTHREAD, LIBPTHREAD_DB, and LIBRT.


Revision tags: fvdl_fs64_base
# 1.162 22-Nov-2002 thorpej

Split crtbegin/crtend into crti/crtbegin/crtend/crtn. NetBSD-specific
things like the .note.netbsd.ident section are provided by crti/crtn.
crti/crtn also provide the _init() and _fini() routines.

crtbegin/crtend now only provide support for ctors/dtors. This paves
the way to using the "crtstuff" provided with GCC (when we upgrade to
GCC 3.3), which provides, among other things, much better C++/Java
exception handling.


# 1.161 12-Nov-2002 itohy

MKDYNAMICROOT for a.out


# 1.160 22-Oct-2002 perry

Pass 1 of SYSPKG changes to automatically add tags=pkgname_pkg to METALOG.
Not quite ready for prime time yet.


# 1.159 27-Sep-2002 thorpej

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.


# 1.158 26-Sep-2002 itojun

MDC2 is a patented algorithm; don't ship it in default libcrypto.
MKCRYPTO_MDC2 will build a separate library, libcrypto_mdc2.


# 1.157 08-Sep-2002 thorpej

Build a .gdbinit in the objdir when building a program. The .gdbinit
file sets the shared library prefix to ${DESTDIR}, and adds "sources"
directives for each file listed in the GDBINIT Makefile variable.


# 1.156 09-Aug-2002 thorpej

Add LIBPMC.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.155 27-Mar-2002 eeh

branches: 1.155.2;
Use the medium low model for sparc64 programs that don't 2GB of data segment.


# 1.154 11-Feb-2002 mycroft

Don't use .PHONY for targets that are actually installed. Instead use force
dependencies. (Among other things, `make -t install' does something vaguely
sensible now.)


# 1.153 07-Feb-2002 pk

Mark installed system libraries as .MADE only if we're actually establishing
their default variable values here.


# 1.152 04-Feb-2002 christos

s/.NOSUFF/.MADE/


# 1.151 03-Feb-2002 christos

Apply a .NOSUFF: directive to targets we don't want to have processed by
the suffix rules engine.


# 1.150 02-Feb-2002 veego

Ups, it is LIBUSBHID and not LIBUSBHIB.


# 1.149 02-Feb-2002 veego

Change LIBUSB to LIBUSBHIB, reflecting the library name change.


# 1.148 29-Jan-2002 enami

Mark the targets clean{extra,objs} as PHONY.


# 1.147 04-Jan-2002 thorpej

For PROG_CXX DESTDIR builds, pull in -lstdc++ and -lm regardless
of GCC version.


# 1.146 01-Jan-2002 thorpej

Per a suggestion from matthew green, PROG_CXX takes the place of
PROG for C++ programs.


# 1.145 01-Jan-2002 thorpej

* If PROG_CXX is set by the program's Makefile, use ${CXX} to link
the program rather than ${CC}.
* If HAVE_GCC3 is defined, pull in "-lstdc++ -lm" as additional C++
support libraries for DESTDIR builds.


# 1.144 28-Dec-2001 lukem

* 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


# 1.143 28-Nov-2001 tv

If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.


# 1.142 19-Nov-2001 thorpej

Use a little transitional hack to determine if we use -isystem
or -idirafter. Use the former only of USE_NEW_TOOLCHAIN, since
-isystem causes the old toolchain to bomb out when building
libstdc++.


# 1.141 14-Nov-2001 tv

C/..$/.c/ -> C/\..$/.c/


# 1.140 14-Nov-2001 tv

Move the DESTDIR-based nostdinc logic to bsd.lib.mk and bsd.prog.mk where
it belongs (with the native target compile rules).


# 1.139 02-Nov-2001 tv

Use INSTALL_FILE/INSTALL_DIR as appropriate.


# 1.138 02-Nov-2001 tv

Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.


# 1.137 19-Oct-2001 tv

Add .NOPATH for all files generated from .l or .y files in SRCS. Fixes PRs
bin/14187 and lib/14239.

Also simplify the handling of these transforms to .c and .h files a bit by
leveraging make's builtin macro operators.


# 1.136 25-Sep-2001 tv

Set .NOPATH on program to build to make sure it goes in .OBJDIR.
Problem noted by <seebs@plethora.net>.


# 1.135 24-Sep-2001 lukem

fix previous (hi thor!) - $OBJS and $CLEANFILES might be empty, and
rm needs some files to delete...


# 1.134 24-Sep-2001 tls

Split "cleanprog" target apart: now you can zap only object files or
CLEANFILES (needed to fix crunchgen lossage).


# 1.133 13-Sep-2001 thorpej

Add LIBPCI.


# 1.132 14-Aug-2001 tv

Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").


# 1.131 01-Jun-2001 tv

Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).


# 1.130 08-May-2001 sommerfeld

Suppress duplicate entries in ALLFILES, FILES, INCS, DEPINCS, INFOFILES,
NLSALL, CATPAGES, MANPAGES, HTMLPAGES, and SCRIPTS.


# 1.129 19-Feb-2001 jmc

Wrap target() checks around afterdepend rule as some Makefiles override this


# 1.128 26-Jan-2001 itojun

fix typo in LIBSSL decl. it made programs with DPADD+=${LIBSSL} to build
every time we type "make". From: bernd


# 1.127 14-Jan-2001 christos

use the new .if commands(<target>) directive so that we don't have to
change Makefiles.


# 1.126 14-Jan-2001 christos

fix thinko: test for the existance of the target before we define it...


# 1.125 14-Jan-2001 christos

Alter previous redefined target protection. If the ${PROG} target is defined,
add the dependencies as usual, but don't add the commands. This avoids
having to change all the Makefiles that redefine the PROG target.


# 1.124 14-Jan-2001 christos

allow programs to override the program target.


# 1.123 08-Jan-2001 mrg

add missing $LIBCRYPTO_RC5 and $LIBCRYPTO_IDEA


# 1.122 08-Jan-2001 mrg

add missing $LIBSSL


# 1.121 04-Jan-2001 garbled

Add LIBCDK and LIBFORM definitions


# 1.120 31-Oct-2000 itojun

add ${LIBINTL} for use with DPADD.


# 1.119 07-Oct-2000 deberg

fix typos, PR 11159


# 1.118 25-Jun-2000 erh

For the case when DESTDIR is set: move the -L${DESTDIR}/usr/lib after ${LDADD} so any -L directories set in LDADD are searched first to avoid possibly linking against old versions of libraries.


Revision tags: netbsd-1-5-base
# 1.117 19-Jun-2000 thorpej

branches: 1.117.2;
Sync up the LIB* list.


# 1.116 10-Jun-2000 mycroft

Use ${.ALLSRC:T} when doing the generated variable name lookups, so that it
DTRT for generated files in and obj directory (or accessed via .PATH).


# 1.115 06-Jun-2000 mycroft

Abuse .USE some more.


# 1.114 06-Jun-2000 mycroft

Minor rearrangement.


# 1.113 06-Jun-2000 mycroft

Use ODE make(1) features to eliminate extra variables and move several things
outside of .for loops. (Needs more work to completely eliminate .for.)

XXX Don't look at this stuff. It will make your head hurt.


Revision tags: minoura-xpg4dl-base
# 1.112 14-Apr-2000 mrg

branches: 1.112.2;
use -rpath-link rather than -R when linking objects using a DESTDIR.
this replaces the previous change as that ended up adding
$DESTDIR/usr/lib to the runtime path of every binary created, which
is bogus and dangerous.


# 1.111 25-Mar-2000 mycroft

When linking with $DESTDIR, use an explicit -R to get library dependencies
correct.


# 1.110 07-Mar-2000 veego

Remove unused libahdi.
It will be replaced in the future with a more generic libdisklabel.


# 1.109 05-Feb-2000 jdc

Add libahdi entries.


# 1.108 23-Jan-2000 eeh

Add some support for FCode binaries.


# 1.107 22-Jan-2000 mycroft

Make `dependall' play nicely with SUBDIR, using a hack similar to `realinstall'
for both `depend' and `all'.
Also, remove the old hack that invokes an extra shell for .depend, now that
make(1) has been fixed.


# 1.106 16-Jan-2000 assar

all: depend on ${SCRIPTS} so that they get generated if they need to


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.105 23-Nov-1999 blymn

Added libmenu library.


Revision tags: comdex-fall-1999-base
# 1.104 14-Sep-1999 perry

branches: 1.104.4;
Add a "dependall" target, which does a "make depend" and then "make all"
in a single directory. This is useful in "make build" because by doing
the build immediately after the depend, all sources will typically
still be in the buffer cache, thus saving significant time over doing
a "make depend" on all the directories and then a "make all".


# 1.103 04-Sep-1999 fredb

Permit "make all install", as well as "make foo install" (where foo would be
installed by "make install") without setting of BUILD. All cases where BUILD
is already set are unchanged from the old behavior.

"make all install" is now practically equivalent to "make BUILD= all install",
but without actually setting build.

Fixes pr's 8313, 3894.


# 1.102 21-Aug-1999 simonb

Add ${INSTPRIV} to ${INSTALL} commands.


# 1.101 01-Jul-1999 itojun

branches: 1.101.2;
add LIBIPSEC for use from DPADD.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.100 12-Feb-1999 lukem

branches: 1.100.2;
* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.99 10-Feb-1999 tv

libbfd_pic.a is no longer installed; remove ${LIBBFD} define.


# 1.98 04-Feb-1999 christos

PR/2936: Brian C. Grayson: Avoid truncating precious files when installing
and the filesystem is full. Added ${RENAME} flag to install, which when set
to -r installs on a temporary file and then renames to the final destination.
${RENAME} is currently set to nothing in bsd.own.mk, but one can turn it
on in /etc/mk.conf.


# 1.97 07-Nov-1998 jonathan

Do DESTDIR support for crtbegin/crtend on all ELF ports (adds mips).


# 1.96 28-Sep-1998 christos

Use preserve flag in install.


# 1.95 10-Sep-1998 ross

Define a LIBBZ2?=... for use in DPADD=... lines.


# 1.94 09-Aug-1998 lukem

add distclean as a synonym for cleandir


# 1.93 09-Apr-1998 tv

.y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.


# 1.92 01-Apr-1998 tv

Revert. This broke too much in the build tree, and a better solution
needs to be created. (The existing situation breaks a lot too.)


# 1.91 01-Apr-1998 tv

Fix .y rules to DTRT with possibly generated .h files. See mail on
tech-toolchain for a very detailed explanation of this. In short, add
a .y.h rule identical to the .y.c rule and make the .y.c rule rename
the .h file; also, clean the .h file in CLEANFILES.


# 1.90 03-Nov-1997 cgd

echo the lint command line when making 'lint'.


# 1.89 28-Oct-1997 lukem

add ${LIBOBJC}


Revision tags: netbsd-1-3-base
# 1.88 11-Oct-1997 mycroft

branches: 1.88.2;
Several changes:
* Allow bsd.man.mk to be included separately.
* Always include bsd.own.mk and bsd.obj.mk.
* Include bsd.man.mk and bsd.nls.mk even if NOMAN or NONLS; just turn off
building of the affected files instead.
* Require bsd.subdir.mk to be included explicitly.
(Will make appropriate changes to Makefiles shortly.)


# 1.87 29-Sep-1997 gwr

Add $LIBBFD


# 1.86 31-May-1997 cjs

Back out BUILDDIR and NOINSTALL changes.


# 1.85 26-May-1997 cjs

branches: 1.85.2;
These updates to the build allow building against include files
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.


# 1.84 18-May-1997 kleink

Add libposix.


# 1.83 17-May-1997 mycroft

Do LINKS and SYMLINKS after FILES and INCS.


# 1.82 17-May-1997 mycroft

Remove unneeded .SUFFIXES lines, and move .s and .S closer to .o to give the
right preferences.


# 1.81 09-May-1997 mycroft

Fix typo in previous.


# 1.80 09-May-1997 mycroft

Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.79 09-May-1997 mycroft

Remove cruft.


# 1.78 09-May-1997 mycroft

Oops; rearrange dependencies to get things built early enough.


# 1.77 09-May-1997 mycroft

Make sure INCS and SRCS are built if necessary.


# 1.76 08-May-1997 gwr

Set the .NOPATH flag for ${OBJS} (from Christos).


# 1.75 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.74 07-May-1997 mycroft

Various simplifications.


# 1.73 07-May-1997 mycroft

Shuffle some .PHONYs around, to work better with `-t'.


# 1.72 06-May-1997 mycroft

Make most of the install targets .PRECIOUS.


# 1.71 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.70 18-Apr-1997 christos

Add ${LIBNTP}


# 1.69 17-Apr-1997 thorpej

- Properly depend on crtbegin.o and crtend.o for platforms that use
them (currently Alpha and PowerPC)
- STRIP -> STRIPFLAG


# 1.68 03-Apr-1997 mikel

don't allow override of all: target


# 1.67 29-Mar-1997 mikel

merge lite-2 changes (mostly SCCSids)


# 1.66 27-Mar-1997 christos

Put the FILES generated rules in a separate .mk file since both bsd.prog.mk
and bsd.lib.mk use them.


# 1.65 27-Mar-1997 mycroft

Make the SCRIPTS case mimic the FILES case more closely, so we can override
the destination direectory, etc.


# 1.64 27-Mar-1997 mycroft

Remove knowledge of HIDEGAME from here.


# 1.63 24-Mar-1997 christos

make rules update:
- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation


# 1.62 22-Mar-1997 perry

Fix SYMLINKS not to include DESTDIR in the link itself


# 1.61 13-Mar-1997 perry

add SYMLINKS, by analogy to LINKS. Vetted by Christos.


# 1.60 22-Jan-1997 cgd

if 'clean' is not already defined, rather than simply defining it with
a bunch of rules, define a clean{kmod,lib,prog} target with the rules,
and have both clean and cleandir depend on that. That eliminates a bug
where 'cleandir' in a directory which included e.g. bsd.prog.mk but which
also had subdirs would 'make clean' all the subdirs and then 'make cleandir'
all ofthe subdirs. It also allows Makefiles to add more dependencies
to 'clean' after inclusion of the make template.

If 'clean' is already defined, the behaviour is the same as it used to be.


# 1.59 20-Dec-1996 cgd

add an afterdepend target (a la the one in bsd.lib.mk) that processes
the .depend file to add <filename>.ln for each <filename>.o as an
object file which has the given dependencies (in addition to
<filename>.po and <filename>.so, which were already there).


# 1.58 13-Dec-1996 mikel

add missing LIBPCAP definition.


# 1.57 26-Nov-1996 mrg

add libz and libwrap


# 1.56 18-Oct-1996 thorpej

Use ${INSTALL} rather than "install".
From Simon J. Gerraty <sjg@zen.void.oz.au>, PR #1458.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.55 08-Apr-1996 jtc

Sort LIBFOO definitions and add LIBY; Reported by Mike Long <mike.long@analog.com> in PR #2301.


# 1.54 22-Oct-1995 christos

Added include file <bsd.sys.mk> that contains lex and yacc "parallel aware"
rules. These rules are not turned on by default; they are enabled by setting
the PARALLEL variable.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.53 25-Jun-1995 cgd

oops; fix an rm that might be empty


# 1.52 24-Jun-1995 cgd

update lint rules, but keep linting disabled


# 1.51 10-Jun-1995 mycroft

Define LIBEDIT.


# 1.50 21-Apr-1995 jtc

.include <bsd.nls.mk> unless NONLS is defined.


# 1.49 22-Dec-1994 cgd

specify man pages differently, and document how.


# 1.48 24-Aug-1994 mycroft

Include bsd.own.mk earlier.


# 1.47 20-Jul-1994 cgd

fix from christos, for progs w/o objects


Revision tags: netbsd-1-0-base
# 1.46 06-Jul-1994 mycroft

branches: 1.46.2;
Pull libraries from ${DESTDIR} if set. Kill LDONLY, which is unused and
probably not useful anyway.


# 1.45 30-Jun-1994 cgd

fix modify-info-nothingness-then-substitute probelm that broke genclass build


# 1.44 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.43 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.42 28-Jun-1994 jtc

Strip *.sh when constructing OBJS from SRCS.
This will allow us to clean up makefiles that build a script by munging
a template (uusched, genclass, neqn, etc.).


# 1.41 18-Jun-1994 cgd

don't chown the symlink, when HIDEGAME causes a symlink to be made to dm.
4.4-based FS code _follows_ the symlinks on a chown(2) call.


# 1.40 24-May-1994 cgd

fix the last to do the right thing for dependencies


# 1.39 24-May-1994 deraadt

LIBSKEY


# 1.38 22-May-1994 jtc

Single source file programs are now compiled into object files before they
are linked. This change halves the time it takes to rebuild all of the
NetBSD sources when only the C library is "touched"; but only takes about
one percent more disk space.


# 1.37 06-Apr-1994 chopps

relink (recompile) single source programs when crt0.o is updated.


# 1.36 24-Mar-1994 mycroft

Remove *.core on clean.


# 1.35 09-Feb-1994 cgd

kill install -d's.


# 1.34 28-Jan-1994 cgd

add LIBKVM


# 1.33 10-Nov-1993 cgd

librpc doesn't exist anymore


# 1.32 08-Nov-1993 cgd

ad LDSTATIC flag, so static linking can be made one-stop shopping.
use "setenv LDSTATIC" to make *everything* dynamically linked,
setenv LDSTATIC -static for everything statically linked, or unset
it for default behavior.


# 1.31 07-Oct-1993 cgd

LIBTERM pointed at nothing, but was meant to point to libtermcap.a...


# 1.30 07-Oct-1993 cgd

always define LIBCRYPT


# 1.29 17-Aug-1993 mycroft

Make sure we don't recurse into subdirectories if Makefile specified `install'
target. (It's usually blank and is specifically to avoid doing this...)


# 1.28 15-Aug-1993 mycroft

Automatically include bsd.subdir.mk for backward compatibility.


# 1.27 15-Aug-1993 mycroft

Don't automatically include bsd.subdir.mk in bsd.prog.mk and bsd.lib.mk.
Put back .MAIN in bsd.man.mk, and be careful not to include ../Makefile.inc
a second time.


# 1.26 15-Aug-1993 mycroft

Move man rules to sys.mk.
Use bsd.subdir.mk for building subdirectories.
Don't forget to remove x.cc and x.C when using SHAREDSTRINGS.
Make ${PROG} always depend on ${LIBCRT0}.
Don't duplicate code between cleandir and clean.
Move tags target to bsd.dep.mk.
Move STRIP to bsd.own.mk.
Remove redundant definitions of {BIN,MAN}{DIR,GRP,OWN,MODE}.
Move {LIB,DOC}{DIR,GRP,OWN,MODE} defaults to bsd.own.mk.


# 1.25 15-Aug-1993 mycroft

Abstract out dependency stuff, and add RCS identifiers.


# 1.24 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


# 1.23 10-Aug-1993 mycroft

Put LINKS handling in `install' target, so it's the last thing executed, and
happens even if `realinstall' is user-defined.


# 1.22 30-Jul-1993 mycroft

When generating a default OBJS, ignore .h files.


# 1.21 29-Jul-1993 mycroft

Don't print the `making ...' message if an obj dir already exists.
Also, a minor cleanup.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.20 17-Jul-1993 mycroft

Fix C++ dependencies for good. `make depend' is now done in two passes--one
of C files and one for C++ files. No need to specify `-+' in your Makefile,
as it is now done automatically.


# 1.19 17-Jul-1993 cgd

do c++ dependencies the right way...


# 1.18 17-Jul-1993 mycroft

Add suffix rules for C++ files.


# 1.17 04-Jun-1993 brezak

Add LIBRPCSVC variable.


# 1.16 02-Jun-1993 cgd

add ability to specify c++ dependencies, by setting CFLAGS+=-+ for
the dependency make.


# 1.15 26-Apr-1993 cgd

added definition for DPADD library variable LIBCRYPT.


# 1.14 26-Apr-1993 mycroft

Don't redefine `realinstall' target if already defined.


# 1.13 25-Apr-1993 mycroft

Link with LDFLAGS even if one source module.


# 1.12 25-Apr-1993 mycroft

Don't lose if we include bsd.prog.mk only to build man pages.


# 1.11 25-Apr-1993 mycroft

Fix error in last change. (Oops.)


# 1.10 25-Apr-1993 mycroft

Don't build man pages if NOMAN set.


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.9 09-Apr-1993 cgd

various changes to default make rules. from patch 101.
note that only the "sensible" changes in patch 101 are implemented.


# 1.8 08-Apr-1993 cgd

try to do the right thing, in terms making directories before we
install into them, and get the manpage cleans _OUT_ of "clean".
they don't belong there, only in cleandir, WFJ be damned.


# 1.7 08-Apr-1993 cgd

fixed typos...


# 1.6 08-Apr-1993 cgd

(silently) make sure we have directories before installing


# 1.5 04-Apr-1993 cgd

make LIBRPC point to the right place


# 1.4 27-Mar-1993 nate

Fixed the doc macros to call troff, eqn,and tbl instead of ditroff,
deqn, and dtbl.
Fixed make clean to remove the man pages (Bill fixed this in the distribution,
but not in the original source)
Changed install to leave the original file around, by using 'cp' instead of
'mv'. "install -c ..."


# 1.3 23-Mar-1993 cgd

made .CURDIR be absolute, not relative, thereby eliminating
the need for some of the makefile trickery when making objects,
and fixing a few .PATH bugs


# 1.2 22-Mar-1993 cgd

fixed "make obj" for cases when sources not in /usr/src/...
if sources not there, it now mkdirs obj, but some trickery
is necessary, to avoid deleting cwd.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.333 30-Oct-2020 martin

libsqlite3 now requires -lm


# 1.332 16-Oct-2020 nia

share/mk: Define some missing X11 libraries.


# 1.331 15-Jun-2020 christos

Rename blacklist -> blocklist


# 1.330 30-May-2020 christos

Make libuv private, requested by joerg@


# 1.329 24-May-2020 christos

Add libuv


Revision tags: phil-wifi-20200421 phil-wifi-20200411 phil-wifi-20200406
# 1.328 04-Apr-2020 christos

Linker semantics have changed; we now don't automatically link dependent
libraries from other DSO's. For example in /usr/bin/passwd:
ld: krb5_passwd.o: undefined reference to symbol \
'UI_UTIL_read_pw_string@@OPENSSL_1_1_0'
ld: /usr/obj/amd64-x86_64/release/lib/libcrypto.so.14: error adding symbols: \
DSO missing from command line


# 1.327 04-Apr-2020 christos

Fix kerberos libraries order


# 1.326 04-Apr-2020 christos

Add libgnuctf


# 1.325 03-Mar-2020 christos

Add fido and cbor


Revision tags: is-mlppp-base phil-wifi-20191119
# 1.324 18-Nov-2019 christos

Improve the script to check for installed libraries, and fix the wrong
names and obsolete libraries it found.


# 1.323 27-Aug-2019 kamil

Enhance the support of LLVM sanitizers

Define _REENTRANT for MKSANITIZER build. This is needed for at least stdio
code. This caused new build issued with duplicated symbols in few places
and rump kernel code picking different code paths borrowed from libc.
Handle all this in one go.

Add bsd.sanitizer.mk to share common code used by programs and libraries.

Switch from realall to beforeinstall target in .syms files. This is more
reliable in MKSANITIZER.


# 1.322 17-Aug-2019 kamil

Add PAXCTL_FLAG rules for MKSANITIZER

Add per-program rules to disable ASLR for ASan, TSan and MSan in all
sanitized programs. This flag is not needed for other supported sanitizers.

Without this change, sanitized init(8) dies early on startup.

Approach originally suggested by <joerg>


# 1.321 15-Aug-2019 kamil

Add SANITIZER_RENAME_CLASSES in bsd.prog.mk

This adds a more flexible version of SANITIZER_RENAME_SYMBOL.

New symbol allows to specify MKSANITIZER specific renames on per-file and
per-symbol basis.


# 1.320 10-Aug-2019 christos

Make the X11 library lists consistent again.


Revision tags: netbsd-9-base phil-wifi-20190609 pgoyette-compat-20190127
# 1.319 21-Jan-2019 christos

branches: 1.319.2;
Most of the mv operations are to move temporary files to their final place.
Some use -f, others don't. This can lead to spurious build failures when
the user performing the build changes. Centralize, and always use -f.


Revision tags: pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.318 12-Aug-2018 christos

fix broken library variable definitions (inconsistencies between
bsd.README and bsd.prog.mk)


Revision tags: pgoyette-compat-0728
# 1.317 25-Jul-2018 kamil

Introduce MKLIBCSANITIZER in the share/mk rules

Add flags that are required to build a program and a dynamically loaded
library.

Propagade LIBCSANITIZERFLAGS to CFLAGS and CXXFLAGS.

LDFLAGS is not changed on purpose, as a libcsanitizer is inside libc
and no external dependencies are needed.

Register NOLIBCSANITIZER, as certain distribution parts will need to be
skipped.


# 1.316 12-Jul-2018 maxv

Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.


Revision tags: phil-wifi-base
# 1.315 25-Jun-2018 kamil

branches: 1.315.2;
Add a framework for renaming symbols in libc&co for MKSANITIZER

A new keyword SANITIZER_RENAME_SYMBOL. It's a variable that has specified
a list of symbols to be renamed in a processor in order to remove naming
conflicts with public symbols in libc/m/pthread/rt.

This renaming will occur for libraries and programs.
A symbol with a conflicting 'name', will be renamed to '__mksanitizer_name'.

Based on an idea by <christos>


Revision tags: pgoyette-compat-0625
# 1.314 21-Jun-2018 kamil

Refactor MKSANITIZER flags in mk rules

Introduce a new variable SANITIZERFLAGS that contains all the sanitizer
specific flags. These flags are designed to be passed to CFLAGS, CXXFLAGS
and LDFLAGS.

Pass SANITIZERFLAGS in bsd.prog.mk rules to CFLAGS, CXXFLAGS and LDFLAGS.

Pass SANITIZERFLAGS in bsd.lib.mk rules to *_pic.a build flags. The *_pic.a
libraries are designed to construct .so libraries. All .so libraries with
few exceptions are expected to be prebuilt with a sanitizer. Another
purpuse of *_pic.a files can be constructing static PIE programs, however
they are not supported as of now and there is no sanitization of static
programs either.

Once MKSTATICPIE will be supported, it will be initially incompatible with
MKSANITIZER.

This change also makes it easier to build other targets like kernel and
kernel modules without userland sanitizers.

No functional change intended for MKSANITIZER=no users.


# 1.313 02-Jun-2018 christos

Sanitizers don't support static linking.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315
# 1.312 11-Mar-2018 mrg

define LIBXFONT2.


Revision tags: pgoyette-compat-base
# 1.311 25-Feb-2018 mrg

branches: 1.311.2;
add LIBKRB5_LDADD/LIBKRB5_DPADD and their static counterparts
to bsd.prog.mk. use them instead of hard coding various lists
of libraries for krb5.

this fixes static builds.


# 1.310 11-Dec-2017 christos

Instead of checking for obj existance which can be empty for shuttle-rule
programs, check for .sh sources.


# 1.309 10-Dec-2017 christos

don't try to build .debug files for shell scripts.


# 1.308 10-Oct-2017 christos

Add general {DP,LD}ADD.rump variables


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base
# 1.307 21-May-2017 riastradh

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.


# 1.306 21-May-2017 riastradh

Remove some vestiges of MKCRYPTO_IDEA/MKCRYPTO_MDC2.


# 1.305 21-May-2017 riastradh

Remove MKCRYPTO_RC5. Unconditionally include RC5 in libcrypto.so.

This option existed only because RC5 is covered by patents that, twenty
years ago, we had reason to suspect the patent holder, RSA, Inc., might
litigate. The two US patents in question are 5,724,428 and 5,835,600.

According to the USPTO Patent Term Calculator web site at
<https://www.uspto.gov/patent/laws-and-regulations/patent-term-calculator#heading-5>
(retrieved 2017-05-21), patents filed after 1995-06-07 expire twenty
years after the filing date.

number filing date
5,724,428 1995-11-01
5,835,600 1997-04-21

Thus, these patents appear to be expired.

As proposed on tech-crypto and tech-security:

https://mail-index.netbsd.org/tech-crypto/2017/05/05/msg000718.html
https://mail-index.netbsd.org/tech-security/2017/05/05/msg000927.html


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.304 19-Apr-2017 joerg

Add netpgpverify to the library list.


Revision tags: pgoyette-localcount-20170320
# 1.303 20-Feb-2017 rin

add missing LIBCXX


# 1.302 08-Feb-2017 kamil

libpthread_dbg(3) deletion from the base distribution

libpthread_dbg(3) is a remnant library from the M:N thread model
(pre-NetBSD-5.0) API to introspect threads within a process and for use
of debuggers.

Currently in the 1:1 model it's not used in GDB neither in LLDB and it's
not either planned to be used. It's current function to read pthread_t
structures is realizable within a regular debugger capable to
instrospect objects within a tracee (GDB, LLDB...).

Remaining users of this API can still use this library from
pkgsrc/devel/libpthread_dbg.

Sponsored by <The NetBSD Foundation>


# 1.301 29-Jan-2017 christos

add sqlite3 to statically linked libraries for pam.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914
# 1.300 20-Aug-2016 christos

branches: 1.300.2;
unbound additions


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.299 04-Apr-2016 joerg

branches: 1.299.2;
If the per-target LDSTATIC flag is set, don't include the PIE linker
flags as we currently don't support static PIE.


# 1.298 30-Mar-2016 martin

Pass -pie to cc, not -Wl,-pie. This way we have a chance to fix specs
for obscure corner cases like -pie -fPIE -static (used for
/usr/tests/lib/csu/h_initfini2 if building with MKPIE=yes).
While there also replace -fPIC with -fPIE for the PIE case, even if
it should be mostly equivalent.


# 1.297 12-Mar-2016 mrg

remove conditionals that are always true with GCC >= 4.8.


# 1.296 21-Feb-2016 christos

Add NODEBUG


# 1.295 31-Jan-2016 christos

Introduce NOPIE and NOCTF so that standalone programs build properly.


# 1.294 23-Jan-2016 christos

Define _KERNTYPES for things that need it.


# 1.293 07-Nov-2015 joerg

LIBEXECINFO


# 1.292 07-Jun-2015 matt

Make LIBCRT* depend on the right files if MLIBDIR from MKCOMPAT is defined.


# 1.291 01-Dec-2014 erh

PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilt
if any of their dependencies (i.e. the files they refer to) are changed.
This allows changes to transitive included headers to be handled properly.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.290 25-Mar-2014 ozaki-r

branches: 1.290.4;
Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.


Revision tags: riastradh-drm2-base3
# 1.289 09-Mar-2014 christos

let's see if the new dwarf library can handle dwarf 4


# 1.288 02-Mar-2014 christos

If we are compiling with -g and using gcc4.8 and dtrace downgrade
dwarf generation to version 2 for now.


# 1.287 15-Jan-2014 joerg

-Wl,-pie and -r don't agree with each other, so filter the former out.


# 1.286 11-Nov-2013 joerg

Relink binaries if crti.o changes.


# 1.285 29-Sep-2013 christos

Add libxcb


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.284 31-May-2013 mrg

add LIBX11_XCB; unfortunately since the library is named with a -
in it, we have to use an ugly hard coded assignment for now.
(could be cleaned up with more make variable magic i'm sure.)


# 1.283 04-Apr-2013 christos

ldopts should be before ldadd like everywhere else.


Revision tags: agc-symver-base
# 1.282 14-Feb-2013 christos

Since the libraries are produced with different MK flags than the programs,
we check for existance of the files instead of the MK flags.


# 1.281 14-Feb-2013 christos

Add PROGDPLIBS


# 1.280 26-Jan-2013 christos

CTFCONVERT me harder.


Revision tags: yamt-pagecache-base8
# 1.279 17-Jan-2013 christos

Now that we have separate debug sets, add -g if ${MKDEBUG} is set for
program builds since we don't need to install that symbol files.


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.278 24-Aug-2012 jmmv

branches: 1.278.2;
Allow DPADD to be specified on a per-program basis.


# 1.277 23-Aug-2012 joerg

Revert last, it breaks the tricks xsrc uses.


# 1.276 23-Aug-2012 joerg

Remove SHLIBINSTALLDIR and SHLINKINSTALLLIBDIR. Add rpath entries, if
SHLIBDIR differs from /usr/lib.


# 1.275 08-Aug-2012 christos

add MKRUMP by popular demand.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.274 29-Feb-2012 tron

Move "libexpat" from X11 into base which fixes PR lib/40346.
This change was approved by the Core Group.


# 1.273 21-Feb-2012 matt

Remove another ${SIZE}


# 1.272 20-Feb-2012 matt

Remove ${SIZE}


# 1.271 19-Feb-2012 matt

Add support for --combine with gcc.


Revision tags: netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2
# 1.270 05-Nov-2011 christos

branches: 1.270.2;
Add libtre


Revision tags: yamt-pagecache-base
# 1.269 16-Oct-2011 christos

branches: 1.269.2;
- no need to special-case libraries with weird characters.
- add a note about adding new libraries.


# 1.268 16-Oct-2011 christos

fix list of libraries to reflect reality.


# 1.267 10-Sep-2011 apb

Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.


# 1.266 27-Aug-2011 joerg

Add new "analyze" command to run clang's static analyzer in a directory
on all C/C++ files.


Revision tags: cherry-xenmp-base
# 1.265 26-Apr-2011 he

The new Heimdal adds -lwind and -lheimbase to the set of libraries,
so define the corresponding LIB* variables.
These are also needed in the PAM_STATIC_* variables, so add them there too.


# 1.264 11-Apr-2011 joerg

Adjust --sysroot related usage:
-Wl,-rpath does not expand =, so just drop it.

Drop -Wl,-rpath-link entries that duplicate the -Wl,-rpath entries, this
is done implicitly now that ld is built with sysroot support.

Use ${DESTDIR} explicitly for the remaining -Wl,-rpath-link entries.


# 1.263 10-Apr-2011 joerg

For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.


# 1.262 08-Mar-2011 jmmv

Revert previous (revision 1.261): it broke the build because PROG_CXX is
defined in terms of PROG, so later on we would end up with target duplicates
because both PROG_CXX and PROG were being converted to PROGS_CXX and PROGS.

Did not catch this earlier because the test build I did was not clean and
thus the duplicate targets did not have nasty effects.


# 1.261 07-Mar-2011 jmmv

Always convert PROG to its plural form independently of whether PROG_CXX
is defined or not. From Garrett Cooper in private mail.


Revision tags: bouyer-quota2-nbase
# 1.260 20-Feb-2011 jmmv

Define LIBATF_C and LIBATF_CXX to point to their corresponding .a files and
use these to properly set DPADD for test programs.


Revision tags: bouyer-quota2-base
# 1.259 13-Feb-2011 christos

add saslc


# 1.258 06-Feb-2011 joerg

Don't use -nostdinc or -nostdinc++ if this is included in a HOSTLIB.


# 1.257 17-Jan-2011 pooka

branches: 1.257.2;
Add rump bits to DPSRCS so that update builds work correctly.


Revision tags: matt-mips64-premerge-20101231
# 1.256 13-Dec-2010 pooka

befriend RUMPPRG with CRUNCHEDPRG


# 1.255 13-Dec-2010 pooka

Define RUMPPRG, which is just like PROG, except it additionally
builds a rump client with the name rump.${PROG}. The rump client
is not installed suid/sgid by default even if BINMODE is defined.


# 1.254 10-Dec-2010 joerg

Revert last, gcc(1) checks explicitly for -r on some platforms to disable
passing down --relax as well.


# 1.253 08-Dec-2010 joerg

gcc passes down -r directly to ld, so make it explicitly a linker option.


# 1.252 08-Dec-2010 joerg

Don't depend on ${CC} passing down -R to ld, use -Wl,-rpath explicitly.


# 1.251 08-Nov-2010 lukem

Preserve date on original shared library or program when stripping
the debug symbols and adding the debug-link to .debug.
Use '(rm -f file; false)' in the failure path to force failure.
Based on solution proposed by Nicolas Joly on tech-toolchain in July 2010.
Should fix PR toolchain/44046 from Andreas Gustafsson.


# 1.250 31-Oct-2010 mbalmer

Link Lua to the build and add the resulting files to the distribution sets.
Document the addition of Lua and the change we made to the default settings.


# 1.249 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.248 24-Apr-2010 lukem

When extracting separate debug symbols with MKDEBUG, there's no need
to leave the original file unstripped...


# 1.247 02-Mar-2010 darran

DTrace: Add CTF generation to the make framework. Only enabled when
MKDTRACE=yes.


# 1.246 14-Dec-2009 mrg

use "${CC} -r" not "${CC} -Wl,-r" as the latter fools GCC on some targets
and it ends up passing "-r -relax" to ld, which causes ld to barf.


# 1.245 14-Dec-2009 matt

Merge from matt-nb5-mips64


Revision tags: matt-premerge-20091211
# 1.244 08-Dec-2009 uebayasi

When PROGS / LIBS are used, you can pass each PROG / LIB specific parameters
to ${LD} via:

${LDADD.${PROG}}
${LDFLAGS.${PROG}}
${LDSTATIC.${PROG}}
${LDADD.${LIB}}
${LDFLAGS.${LIB}}

OTOH you can't pass parameters to ${CC}, because in suffix rules make(1) only
knows the name of ${.IMPSRC} and ${.TARGET}; it's users' responsivility to
define ${CC} parameters to all the sources of a given ${PROG} / ${LIB}.

Should address bin/42381.

(Bug in this commit log was pointed out by mrg@.)


# 1.243 27-Nov-2009 tsutsui

If CPPFLAGS or CXXFLAGS already contains -nostdinc or -nostdinc++,
don't add ${CPPFLAGS_ISYSTEM} or ${CPPFLAGS_ISYSTEMXX} to refer
${DESTDIR}/usr/include or ${DESTDIR}/usr/include/g++.

This change might cause errors on some MD stand dir, but in that case
each Makefile should be fixed to search proper system include paths
by -Ipath option in own CPPFLAGS.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.242 12-May-2009 plunky

remove libsdp as improved functionality has been enabled in libbluetooth.


# 1.241 10-Apr-2009 apb

Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links. They have no effect except when using a
metalog, in which case the information is added to the metalog. In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg. This should fix PR 24457 and PR 41155.


# 1.240 24-Nov-2008 cube

branches: 1.240.2;
Move cleanextra to the very ends in case another included file wants to add
to it even if it was initially empty.


Revision tags: netbsd-5-base matt-mips64-base2
# 1.239 19-Oct-2008 christos

branches: 1.239.2;
handle assembly files for MKPIE


# 1.238 16-Oct-2008 christos

Provide a way for a program to override the PIE flags.


# 1.237 15-Oct-2008 christos

don't compile/link libraries with pie


Revision tags: mjf-devfs2-base
# 1.236 02-Oct-2008 joerg

Hook up libfetch and pkg_install update.


Revision tags: wrstuden-revivesa-base-3
# 1.235 09-Sep-2008 joerg

Add MKSTRIPIDENT to remove the RCS IDs from binary programs and shared
libraries for space-constraint systems. The description is based on the
feedback of hubertf@, the logic on input from lukem@

This obsoletes the removal of LIBC_SCCS and SYSLIBC_SCCS for libc builds.


Revision tags: wrstuden-revivesa-base-2
# 1.234 28-Aug-2008 mrg

update a comment example


# 1.233 27-Aug-2008 rtr

use ${X11USRLIBDIR} instead of hard-coded /usr/X11R6/lib when building
${LIB.foo} vars


# 1.232 27-Aug-2008 lukem

Fix problem I introduced in rev 1.231 on 2008/08/25 where ${_PROGLDOPTS}
and -L${_GCC_LIBGCCDIR} were appearing in the link line before ${LDADD},
so -L${DESTDIR}/lib and -L${DESTDIR}/usr/lib were being used before
local -L library paths.
Fixes ntpd/ntpdate failure noticed by Valeriy E. Ushakov <uwe@NetBSD.org>


# 1.231 25-Aug-2008 lukem

Always link with: -Wl,-rpath-link,${DESTDIR}/usr/lib -L${DESTDIR}/usr/lib
Fixes problem with MKDYNAMICROOT=no triggered by libraries that depend
on other libraries.
Related to PR 33503.

Clean up setting of _CCLINK to always add the appropriate -B options.

Simplify the link rule for a program.


# 1.230 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.229 28-May-2008 lukem

add LIBLDAR_R (for completeness)


# 1.228 22-May-2008 lukem

Add MKLDAP, USE_LDAP, LIBLBER, LIBLDAP


Revision tags: hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-pf42-base
# 1.227 10-Apr-2008 tsutsui

branches: 1.227.2; 1.227.4;
Add libhx509 to PAM_STATIC_LDADD which is required by libkrb5.


# 1.226 22-Mar-2008 mlelstv

branches: 1.226.2;
Import Heimdal-1.1


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase matt-armv6-base hpcarm-cleanup-base
# 1.225 26-Dec-2007 jmmv

Make the clean target work when OBJS is set but PROG is not, as happens
for example in gnu/lib/crtstuff4. Reported by drochner@.


Revision tags: cube-autoconf-base
# 1.224 13-Nov-2007 jmmv

Fix typo that prevented MKDEBUG builds to work. Found by drochner@.


# 1.223 12-Nov-2007 jmmv

Add the ability to build multiple programs from a single directory

This adds support for a new set of variables, PROGS and PROGS_CXX, that
allow the developer to build multiple different programs from a single
source directory.


# 1.222 04-Nov-2007 tls

Remove MKPRIVATELIB from BIND libraries; move library reachover
directories and Makefiles from src/usr.sbin/bind to src/lib; make
BIND libraries build shared. Saves about 1MB-1.5MB per installed
executable, about 5MB for a base+etc minimal installation of NetBSD.


Revision tags: matt-mips64-base
# 1.221 29-Jul-2007 joerg

branches: 1.221.4; 1.221.6;
Add build glue for libarchive and update the various sets.


# 1.220 25-Jan-2007 perry

Before I completely forget the issue, convert "PROG_PAX" to the
better-named "PAXCTL_FLAGS".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.219 11-Nov-2006 christos

don't run paxctl if other commands were specified for that target.


# 1.218 10-Nov-2006 christos

if ${PROG_PAX} is defined, run paxctl on the binary after linking with
the value of the variable. This way, if you set:

PROG_PAX=+M

in /etc/mk.conf, you get what you deserve.


# 1.217 22-Oct-2006 pooka

libpuffs


# 1.216 09-Oct-2006 mrg

- clean up some comments to reality.
- retire LIBDCK, LIBG2C and (long broken) USE_LIBSTDCXX
- in bsd.hostprog.mk's LIBSTDCPP -> LIBSTDCC
- add LIBSUPCXX
- don't default USE_LIBSTDCXX or USE_GCC4 since they are
not used in the tree any where
- same with USE_XF86_4; retire it
- remove _SUPCXX handling in bsd.prog.mk

inspired by PR#26714.


Revision tags: abandoned-netbsd-4-base
# 1.215 23-Jul-2006 lukem

Implement MKDEBUG:
If "no", don't build and install separate debugging symbols
into /usr/libdata/debug.
Default: no


# 1.214 19-Jun-2006 gdamore

Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.


# 1.213 09-Jun-2006 christos

PR/33681: Scott Ellis: Building 'bc' with SHAREDSTRINGS=yes fails
We need CPPFLAGS too now.


# 1.212 11-May-2006 mrg

add support for ${OBJCOPTS} and ${OBJCOPTS}.<lib|prog|fn>.


# 1.211 20-Mar-2006 christos

There is always one more KRB4 thing to remove. (from Jukka Salmi)


# 1.210 20-Mar-2006 christos

Remove krb4 variables and libraries (Jukka Salmi)


# 1.209 16-Mar-2006 jwise

Now that we have real build system support for syspkgs, remove someone's
half-implemented idea of building `syspkgs' (really a few giant blobs of the
same granularity of the old sets) using install(1).


# 1.208 20-Jan-2006 christos

Add the world of libraries to the static pam build. Now static pam binaries
work.


# 1.207 09-Apr-2005 dsl

Report when we link a program into xxx.ro (before being crunched)


Revision tags: netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.206 04-Mar-2005 he

branches: 1.206.2; 1.206.4;
Introduce PAM_STATIC_LDADD and PAM_STATIC_DPADD. When compiling
with MKPIC=no, possibly because the target does not support shared
libraries, these include libraries required to resolve all symbols
which end up referenced from PAM-using applications. The libraries
presently required are -lcrypt, -lrpcsvc and -lutil.

Add use of these variables which are currently set up to use PAM,
so that they compile when MKPIC=no.

Also, in the telnetd case, reorder the order of the libraries, so
that libtelnet.a comes before -ltermcap and -lutil, again to fix
link error when MKPIC=no.

Discussed with thorpej and christos.


# 1.205 20-Feb-2005 christos

Add libradius


# 1.204 12-Jan-2005 lukem

If RESCUEDIR is defined, automatically add that to CPPFLAGS


# 1.203 08-Jan-2005 lukem

Implement <bsd.prog.mk> vars:
LIBASN1 LIBBSDMALLOC LIBG2C LIBPAM LIBSSH


# 1.202 04-Aug-2004 lukem

Revert most of previous, and move the LIB<libname>?= assignments
back to bsd.prog.mk from bsd.own.mk.

pkgsrc uses <bsd.own.mk>, and setting LIB<libname> in it causes
problems with various package builds.
This should fix PR #26542 submitted by Jim Bernard.

(I'll be implementing the DPADD for shared libraries in a different
manner that generally won't depend upon ${LIB<libname>}.)


# 1.201 30-Jul-2004 lukem

Move the LIB<libname>?= assignments from bsd.prog.mk to bsd.own.mk so
that they may be used by non PROGs (e.g., LIBs).

Improve some comments.


# 1.200 10-Jun-2004 lukem

Be consistent in handling YHEADER, similar to Christos' fix in bsd.lib.mk 1.253


# 1.199 21-May-2004 ross

If you add a library, you need to define its DPADD symbol here.

Add LIBMAGIC.


Revision tags: netbsd-2-0-base
# 1.198 15-Feb-2004 skrll

branches: 1.198.2;
Be more gcc like in the way we deal with libgcc so that sh3/hppa millicode
and exception handling have a chance of working properly.

- creates libgcc, libgcc_eh and libgcc_s

- updates LIBGCC_SPEC to use them appropriately.

There's a hack in here at the moment with respect to libgcc_so in that it
is preferable to link against libgcc_so will only when -shared-libgcc is
specified (the c++ frontend does this automatically.) Configurations where
LINK_EH_SPEC is defined already do this. The gcc configuration for
NetBSD/alpha and another NetBSD platform (I forget which) actually define
LINK_EH_SPEC probably by accident rather than design.

- updates share/mk to use the compiler's knowledge of what needs linking into
libraries and executables. This removes an hppa hack.

- updates the sets for the newly created libgcc* files.

- support for linking against the _pg version of libgcc has been removed.


# 1.197 29-Jan-2004 lukem

Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.


# 1.196 27-Jan-2004 lukem

Replace
:M-[IDU]*
with
:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)


# 1.195 23-Jan-2004 simonb

crt0.o lives in /usr/lib even on a.out.


# 1.194 16-Nov-2003 lukem

simplify with _MKTARGET_LINK


# 1.193 11-Nov-2003 dsl

Set MKDEP_SUFFIXES to get additional targets in .depend instead of using
sed in .afterdepend. I don't think .afterdepend is used anywhere any more.


# 1.192 21-Oct-2003 lukem

Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.


# 1.191 19-Oct-2003 lukem

Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} " ... {$.TARGET}" and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO


# 1.190 18-Oct-2003 lukem

Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command ("verbose")
This is the default, and is equivalent to the previous behaviour.


# 1.189 29-Sep-2003 lukem

Add LIBSTDCXX (for usr/lib/libstdc++.a).
Sync LIB* documentation with reality.


# 1.188 19-Sep-2003 martin

Drop explicit medlow model and default to -O2 for sparc64.


# 1.187 14-Sep-2003 lukem

Check ${SHLIBDIR} against "/usr/lib" instead of ${LIBDIR} when determining
if we need to add stuff (usually "/lib") to the rpath-link path before
"/usr/lib". Otherwise, this barfs if LIBDIR != /usr/lib or /lib, and
we're cross-building (e.g., in src/x11)


# 1.186 13-Sep-2003 erh

Also support per-program LDFLAGS and LDSTATIC.


# 1.185 13-Sep-2003 erh

Create a way to add additional flags to COPTS, CPPFLAGS, CXXFLAGS and LDADD
for particular libraries or programs by specifying the additions in mk.conf
instead of needing to go edit individual Makefiles.


# 1.184 12-Sep-2003 lukem

add infrastructure to support reach-over builds of xsrc


# 1.183 22-Aug-2003 dsl

Add a ${PROG}.ro target that does an 'ld -r' of the program object files.
Allows a much simplified build of 'crunched' binaries since crunchgen can
build prog.ro instead of having to deretmine the names of all the .o files.


# 1.182 01-Aug-2003 lukem

Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".


# 1.181 01-Aug-2003 lukem

simplify the ${PROG}: target to reduce duplication between the DESTDIR
and !DESTDIR cases...


# 1.180 31-Jul-2003 lukem

bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.


# 1.179 31-Jul-2003 lukem

Don't need -R/usr/lib; it will be searched at the end by ld.elf_so anyway.
Noted by matt green <mrg@>


# 1.178 28-Jul-2003 lukem

be consistent when adding *.y and *.l to DPSRCS


# 1.177 28-Jul-2003 lukem

replace MKCXXSUPCXX(!=no) with USE_LIBSTDCXX(==no)


# 1.176 28-Jul-2003 lukem

Change defined(CXX_SUPCXX) to MKCXXSUPCXX != "no".

Clarify that command-line overrides of the MKxxx variables should be
done via the environment rather than make(1) command-line variable
assignment, since the latter doesn't actually work as intended.


# 1.175 27-Jul-2003 mrg

introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes. for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)


# 1.174 26-Jul-2003 mrg

add a new bsd.own.mk variable: CXX_SUPCXX. from bsd.README:
+ CXX_SUPCXX If defined, the support libraries needed for this C++ program
+ are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.


# 1.173 20-Jul-2003 lukem

Consistently support the different C++ file extensions: .cc .cpp .cxx .C
Noted by Andrew White in PR toolchain/18246


# 1.172 18-Jul-2003 lukem

Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was defined.
Replace defined(UNPRIVED) tests with ${MKUNPRIVED} != "no"

Add MKUPDATE; if not no has the same semantics as if UPDATE was defined.
Replace defined(UPDATE) tests with ${MKUPDATE} != "no"

Improve documentation for these and other make flags.


# 1.171 16-Jul-2003 itojun

stop installing install libtelnet. build under lib/libtelnet and reference
it from usr.bin/telnet and libexec/telnetd.
(reason for separate build: compiler flags)


# 1.170 27-Jun-2003 drochner

For consistency, use "-R" instead of "-Wl,-rpath" to pass
a runtime search path to the linker.


# 1.169 13-Jun-2003 itojun

define LIBEVENT


# 1.168 11-Jun-2003 msaitoh

catch signal 1,2,3,13 and 15 to clean /tmp/_dependXXX


# 1.167 31-May-2003 thorpej

If EXTERNAL_TOOLCHAIN is defined, allow the compiler to define the
location of crt{begin,end}{,S}.o and libgcc.a. Encapsulate all of
this logic into the new bsd.gcc.mk, and use it in bsd.prog.mk and
bsd.lib.mk.


# 1.166 18-May-2003 lukem

make this a no-op if HOSTPROG is defined


# 1.165 30-Mar-2003 thorpej

If MACHINE_ARCH is powerpc and we HAVE_GCC3, add crtsaveres.o to the
endfile spec.


# 1.164 22-Feb-2003 uwe

Typo in comment.


# 1.163 24-Jan-2003 thorpej

Add LIBPTHREAD, LIBPTHREAD_DB, and LIBRT.


Revision tags: fvdl_fs64_base
# 1.162 22-Nov-2002 thorpej

Split crtbegin/crtend into crti/crtbegin/crtend/crtn. NetBSD-specific
things like the .note.netbsd.ident section are provided by crti/crtn.
crti/crtn also provide the _init() and _fini() routines.

crtbegin/crtend now only provide support for ctors/dtors. This paves
the way to using the "crtstuff" provided with GCC (when we upgrade to
GCC 3.3), which provides, among other things, much better C++/Java
exception handling.


# 1.161 12-Nov-2002 itohy

MKDYNAMICROOT for a.out


# 1.160 22-Oct-2002 perry

Pass 1 of SYSPKG changes to automatically add tags=pkgname_pkg to METALOG.
Not quite ready for prime time yet.


# 1.159 27-Sep-2002 thorpej

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.


# 1.158 26-Sep-2002 itojun

MDC2 is a patented algorithm; don't ship it in default libcrypto.
MKCRYPTO_MDC2 will build a separate library, libcrypto_mdc2.


# 1.157 08-Sep-2002 thorpej

Build a .gdbinit in the objdir when building a program. The .gdbinit
file sets the shared library prefix to ${DESTDIR}, and adds "sources"
directives for each file listed in the GDBINIT Makefile variable.


# 1.156 09-Aug-2002 thorpej

Add LIBPMC.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.155 27-Mar-2002 eeh

branches: 1.155.2;
Use the medium low model for sparc64 programs that don't 2GB of data segment.


# 1.154 11-Feb-2002 mycroft

Don't use .PHONY for targets that are actually installed. Instead use force
dependencies. (Among other things, `make -t install' does something vaguely
sensible now.)


# 1.153 07-Feb-2002 pk

Mark installed system libraries as .MADE only if we're actually establishing
their default variable values here.


# 1.152 04-Feb-2002 christos

s/.NOSUFF/.MADE/


# 1.151 03-Feb-2002 christos

Apply a .NOSUFF: directive to targets we don't want to have processed by
the suffix rules engine.


# 1.150 02-Feb-2002 veego

Ups, it is LIBUSBHID and not LIBUSBHIB.


# 1.149 02-Feb-2002 veego

Change LIBUSB to LIBUSBHIB, reflecting the library name change.


# 1.148 29-Jan-2002 enami

Mark the targets clean{extra,objs} as PHONY.


# 1.147 04-Jan-2002 thorpej

For PROG_CXX DESTDIR builds, pull in -lstdc++ and -lm regardless
of GCC version.


# 1.146 01-Jan-2002 thorpej

Per a suggestion from matthew green, PROG_CXX takes the place of
PROG for C++ programs.


# 1.145 01-Jan-2002 thorpej

* If PROG_CXX is set by the program's Makefile, use ${CXX} to link
the program rather than ${CC}.
* If HAVE_GCC3 is defined, pull in "-lstdc++ -lm" as additional C++
support libraries for DESTDIR builds.


# 1.144 28-Dec-2001 lukem

* 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


# 1.143 28-Nov-2001 tv

If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.


# 1.142 19-Nov-2001 thorpej

Use a little transitional hack to determine if we use -isystem
or -idirafter. Use the former only of USE_NEW_TOOLCHAIN, since
-isystem causes the old toolchain to bomb out when building
libstdc++.


# 1.141 14-Nov-2001 tv

C/..$/.c/ -> C/\..$/.c/


# 1.140 14-Nov-2001 tv

Move the DESTDIR-based nostdinc logic to bsd.lib.mk and bsd.prog.mk where
it belongs (with the native target compile rules).


# 1.139 02-Nov-2001 tv

Use INSTALL_FILE/INSTALL_DIR as appropriate.


# 1.138 02-Nov-2001 tv

Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.


# 1.137 19-Oct-2001 tv

Add .NOPATH for all files generated from .l or .y files in SRCS. Fixes PRs
bin/14187 and lib/14239.

Also simplify the handling of these transforms to .c and .h files a bit by
leveraging make's builtin macro operators.


# 1.136 25-Sep-2001 tv

Set .NOPATH on program to build to make sure it goes in .OBJDIR.
Problem noted by <seebs@plethora.net>.


# 1.135 24-Sep-2001 lukem

fix previous (hi thor!) - $OBJS and $CLEANFILES might be empty, and
rm needs some files to delete...


# 1.134 24-Sep-2001 tls

Split "cleanprog" target apart: now you can zap only object files or
CLEANFILES (needed to fix crunchgen lossage).


# 1.133 13-Sep-2001 thorpej

Add LIBPCI.


# 1.132 14-Aug-2001 tv

Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").


# 1.131 01-Jun-2001 tv

Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).


# 1.130 08-May-2001 sommerfeld

Suppress duplicate entries in ALLFILES, FILES, INCS, DEPINCS, INFOFILES,
NLSALL, CATPAGES, MANPAGES, HTMLPAGES, and SCRIPTS.


# 1.129 19-Feb-2001 jmc

Wrap target() checks around afterdepend rule as some Makefiles override this


# 1.128 26-Jan-2001 itojun

fix typo in LIBSSL decl. it made programs with DPADD+=${LIBSSL} to build
every time we type "make". From: bernd


# 1.127 14-Jan-2001 christos

use the new .if commands(<target>) directive so that we don't have to
change Makefiles.


# 1.126 14-Jan-2001 christos

fix thinko: test for the existance of the target before we define it...


# 1.125 14-Jan-2001 christos

Alter previous redefined target protection. If the ${PROG} target is defined,
add the dependencies as usual, but don't add the commands. This avoids
having to change all the Makefiles that redefine the PROG target.


# 1.124 14-Jan-2001 christos

allow programs to override the program target.


# 1.123 08-Jan-2001 mrg

add missing $LIBCRYPTO_RC5 and $LIBCRYPTO_IDEA


# 1.122 08-Jan-2001 mrg

add missing $LIBSSL


# 1.121 04-Jan-2001 garbled

Add LIBCDK and LIBFORM definitions


# 1.120 31-Oct-2000 itojun

add ${LIBINTL} for use with DPADD.


# 1.119 07-Oct-2000 deberg

fix typos, PR 11159


# 1.118 25-Jun-2000 erh

For the case when DESTDIR is set: move the -L${DESTDIR}/usr/lib after ${LDADD} so any -L directories set in LDADD are searched first to avoid possibly linking against old versions of libraries.


Revision tags: netbsd-1-5-base
# 1.117 19-Jun-2000 thorpej

branches: 1.117.2;
Sync up the LIB* list.


# 1.116 10-Jun-2000 mycroft

Use ${.ALLSRC:T} when doing the generated variable name lookups, so that it
DTRT for generated files in and obj directory (or accessed via .PATH).


# 1.115 06-Jun-2000 mycroft

Abuse .USE some more.


# 1.114 06-Jun-2000 mycroft

Minor rearrangement.


# 1.113 06-Jun-2000 mycroft

Use ODE make(1) features to eliminate extra variables and move several things
outside of .for loops. (Needs more work to completely eliminate .for.)

XXX Don't look at this stuff. It will make your head hurt.


Revision tags: minoura-xpg4dl-base
# 1.112 14-Apr-2000 mrg

branches: 1.112.2;
use -rpath-link rather than -R when linking objects using a DESTDIR.
this replaces the previous change as that ended up adding
$DESTDIR/usr/lib to the runtime path of every binary created, which
is bogus and dangerous.


# 1.111 25-Mar-2000 mycroft

When linking with $DESTDIR, use an explicit -R to get library dependencies
correct.


# 1.110 07-Mar-2000 veego

Remove unused libahdi.
It will be replaced in the future with a more generic libdisklabel.


# 1.109 05-Feb-2000 jdc

Add libahdi entries.


# 1.108 23-Jan-2000 eeh

Add some support for FCode binaries.


# 1.107 22-Jan-2000 mycroft

Make `dependall' play nicely with SUBDIR, using a hack similar to `realinstall'
for both `depend' and `all'.
Also, remove the old hack that invokes an extra shell for .depend, now that
make(1) has been fixed.


# 1.106 16-Jan-2000 assar

all: depend on ${SCRIPTS} so that they get generated if they need to


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.105 23-Nov-1999 blymn

Added libmenu library.


Revision tags: comdex-fall-1999-base
# 1.104 14-Sep-1999 perry

branches: 1.104.4;
Add a "dependall" target, which does a "make depend" and then "make all"
in a single directory. This is useful in "make build" because by doing
the build immediately after the depend, all sources will typically
still be in the buffer cache, thus saving significant time over doing
a "make depend" on all the directories and then a "make all".


# 1.103 04-Sep-1999 fredb

Permit "make all install", as well as "make foo install" (where foo would be
installed by "make install") without setting of BUILD. All cases where BUILD
is already set are unchanged from the old behavior.

"make all install" is now practically equivalent to "make BUILD= all install",
but without actually setting build.

Fixes pr's 8313, 3894.


# 1.102 21-Aug-1999 simonb

Add ${INSTPRIV} to ${INSTALL} commands.


# 1.101 01-Jul-1999 itojun

branches: 1.101.2;
add LIBIPSEC for use from DPADD.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.100 12-Feb-1999 lukem

branches: 1.100.2;
* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.99 10-Feb-1999 tv

libbfd_pic.a is no longer installed; remove ${LIBBFD} define.


# 1.98 04-Feb-1999 christos

PR/2936: Brian C. Grayson: Avoid truncating precious files when installing
and the filesystem is full. Added ${RENAME} flag to install, which when set
to -r installs on a temporary file and then renames to the final destination.
${RENAME} is currently set to nothing in bsd.own.mk, but one can turn it
on in /etc/mk.conf.


# 1.97 07-Nov-1998 jonathan

Do DESTDIR support for crtbegin/crtend on all ELF ports (adds mips).


# 1.96 28-Sep-1998 christos

Use preserve flag in install.


# 1.95 10-Sep-1998 ross

Define a LIBBZ2?=... for use in DPADD=... lines.


# 1.94 09-Aug-1998 lukem

add distclean as a synonym for cleandir


# 1.93 09-Apr-1998 tv

.y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.


# 1.92 01-Apr-1998 tv

Revert. This broke too much in the build tree, and a better solution
needs to be created. (The existing situation breaks a lot too.)


# 1.91 01-Apr-1998 tv

Fix .y rules to DTRT with possibly generated .h files. See mail on
tech-toolchain for a very detailed explanation of this. In short, add
a .y.h rule identical to the .y.c rule and make the .y.c rule rename
the .h file; also, clean the .h file in CLEANFILES.


# 1.90 03-Nov-1997 cgd

echo the lint command line when making 'lint'.


# 1.89 28-Oct-1997 lukem

add ${LIBOBJC}


Revision tags: netbsd-1-3-base
# 1.88 11-Oct-1997 mycroft

branches: 1.88.2;
Several changes:
* Allow bsd.man.mk to be included separately.
* Always include bsd.own.mk and bsd.obj.mk.
* Include bsd.man.mk and bsd.nls.mk even if NOMAN or NONLS; just turn off
building of the affected files instead.
* Require bsd.subdir.mk to be included explicitly.
(Will make appropriate changes to Makefiles shortly.)


# 1.87 29-Sep-1997 gwr

Add $LIBBFD


# 1.86 31-May-1997 cjs

Back out BUILDDIR and NOINSTALL changes.


# 1.85 26-May-1997 cjs

branches: 1.85.2;
These updates to the build allow building against include files
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.


# 1.84 18-May-1997 kleink

Add libposix.


# 1.83 17-May-1997 mycroft

Do LINKS and SYMLINKS after FILES and INCS.


# 1.82 17-May-1997 mycroft

Remove unneeded .SUFFIXES lines, and move .s and .S closer to .o to give the
right preferences.


# 1.81 09-May-1997 mycroft

Fix typo in previous.


# 1.80 09-May-1997 mycroft

Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.79 09-May-1997 mycroft

Remove cruft.


# 1.78 09-May-1997 mycroft

Oops; rearrange dependencies to get things built early enough.


# 1.77 09-May-1997 mycroft

Make sure INCS and SRCS are built if necessary.


# 1.76 08-May-1997 gwr

Set the .NOPATH flag for ${OBJS} (from Christos).


# 1.75 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.74 07-May-1997 mycroft

Various simplifications.


# 1.73 07-May-1997 mycroft

Shuffle some .PHONYs around, to work better with `-t'.


# 1.72 06-May-1997 mycroft

Make most of the install targets .PRECIOUS.


# 1.71 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.70 18-Apr-1997 christos

Add ${LIBNTP}


# 1.69 17-Apr-1997 thorpej

- Properly depend on crtbegin.o and crtend.o for platforms that use
them (currently Alpha and PowerPC)
- STRIP -> STRIPFLAG


# 1.68 03-Apr-1997 mikel

don't allow override of all: target


# 1.67 29-Mar-1997 mikel

merge lite-2 changes (mostly SCCSids)


# 1.66 27-Mar-1997 christos

Put the FILES generated rules in a separate .mk file since both bsd.prog.mk
and bsd.lib.mk use them.


# 1.65 27-Mar-1997 mycroft

Make the SCRIPTS case mimic the FILES case more closely, so we can override
the destination direectory, etc.


# 1.64 27-Mar-1997 mycroft

Remove knowledge of HIDEGAME from here.


# 1.63 24-Mar-1997 christos

make rules update:
- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation


# 1.62 22-Mar-1997 perry

Fix SYMLINKS not to include DESTDIR in the link itself


# 1.61 13-Mar-1997 perry

add SYMLINKS, by analogy to LINKS. Vetted by Christos.


# 1.60 22-Jan-1997 cgd

if 'clean' is not already defined, rather than simply defining it with
a bunch of rules, define a clean{kmod,lib,prog} target with the rules,
and have both clean and cleandir depend on that. That eliminates a bug
where 'cleandir' in a directory which included e.g. bsd.prog.mk but which
also had subdirs would 'make clean' all the subdirs and then 'make cleandir'
all ofthe subdirs. It also allows Makefiles to add more dependencies
to 'clean' after inclusion of the make template.

If 'clean' is already defined, the behaviour is the same as it used to be.


# 1.59 20-Dec-1996 cgd

add an afterdepend target (a la the one in bsd.lib.mk) that processes
the .depend file to add <filename>.ln for each <filename>.o as an
object file which has the given dependencies (in addition to
<filename>.po and <filename>.so, which were already there).


# 1.58 13-Dec-1996 mikel

add missing LIBPCAP definition.


# 1.57 26-Nov-1996 mrg

add libz and libwrap


# 1.56 18-Oct-1996 thorpej

Use ${INSTALL} rather than "install".
From Simon J. Gerraty <sjg@zen.void.oz.au>, PR #1458.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.55 08-Apr-1996 jtc

Sort LIBFOO definitions and add LIBY; Reported by Mike Long <mike.long@analog.com> in PR #2301.


# 1.54 22-Oct-1995 christos

Added include file <bsd.sys.mk> that contains lex and yacc "parallel aware"
rules. These rules are not turned on by default; they are enabled by setting
the PARALLEL variable.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.53 25-Jun-1995 cgd

oops; fix an rm that might be empty


# 1.52 24-Jun-1995 cgd

update lint rules, but keep linting disabled


# 1.51 10-Jun-1995 mycroft

Define LIBEDIT.


# 1.50 21-Apr-1995 jtc

.include <bsd.nls.mk> unless NONLS is defined.


# 1.49 22-Dec-1994 cgd

specify man pages differently, and document how.


# 1.48 24-Aug-1994 mycroft

Include bsd.own.mk earlier.


# 1.47 20-Jul-1994 cgd

fix from christos, for progs w/o objects


Revision tags: netbsd-1-0-base
# 1.46 06-Jul-1994 mycroft

branches: 1.46.2;
Pull libraries from ${DESTDIR} if set. Kill LDONLY, which is unused and
probably not useful anyway.


# 1.45 30-Jun-1994 cgd

fix modify-info-nothingness-then-substitute probelm that broke genclass build


# 1.44 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.43 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.42 28-Jun-1994 jtc

Strip *.sh when constructing OBJS from SRCS.
This will allow us to clean up makefiles that build a script by munging
a template (uusched, genclass, neqn, etc.).


# 1.41 18-Jun-1994 cgd

don't chown the symlink, when HIDEGAME causes a symlink to be made to dm.
4.4-based FS code _follows_ the symlinks on a chown(2) call.


# 1.40 24-May-1994 cgd

fix the last to do the right thing for dependencies


# 1.39 24-May-1994 deraadt

LIBSKEY


# 1.38 22-May-1994 jtc

Single source file programs are now compiled into object files before they
are linked. This change halves the time it takes to rebuild all of the
NetBSD sources when only the C library is "touched"; but only takes about
one percent more disk space.


# 1.37 06-Apr-1994 chopps

relink (recompile) single source programs when crt0.o is updated.


# 1.36 24-Mar-1994 mycroft

Remove *.core on clean.


# 1.35 09-Feb-1994 cgd

kill install -d's.


# 1.34 28-Jan-1994 cgd

add LIBKVM


# 1.33 10-Nov-1993 cgd

librpc doesn't exist anymore


# 1.32 08-Nov-1993 cgd

ad LDSTATIC flag, so static linking can be made one-stop shopping.
use "setenv LDSTATIC" to make *everything* dynamically linked,
setenv LDSTATIC -static for everything statically linked, or unset
it for default behavior.


# 1.31 07-Oct-1993 cgd

LIBTERM pointed at nothing, but was meant to point to libtermcap.a...


# 1.30 07-Oct-1993 cgd

always define LIBCRYPT


# 1.29 17-Aug-1993 mycroft

Make sure we don't recurse into subdirectories if Makefile specified `install'
target. (It's usually blank and is specifically to avoid doing this...)


# 1.28 15-Aug-1993 mycroft

Automatically include bsd.subdir.mk for backward compatibility.


# 1.27 15-Aug-1993 mycroft

Don't automatically include bsd.subdir.mk in bsd.prog.mk and bsd.lib.mk.
Put back .MAIN in bsd.man.mk, and be careful not to include ../Makefile.inc
a second time.


# 1.26 15-Aug-1993 mycroft

Move man rules to sys.mk.
Use bsd.subdir.mk for building subdirectories.
Don't forget to remove x.cc and x.C when using SHAREDSTRINGS.
Make ${PROG} always depend on ${LIBCRT0}.
Don't duplicate code between cleandir and clean.
Move tags target to bsd.dep.mk.
Move STRIP to bsd.own.mk.
Remove redundant definitions of {BIN,MAN}{DIR,GRP,OWN,MODE}.
Move {LIB,DOC}{DIR,GRP,OWN,MODE} defaults to bsd.own.mk.


# 1.25 15-Aug-1993 mycroft

Abstract out dependency stuff, and add RCS identifiers.


# 1.24 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


# 1.23 10-Aug-1993 mycroft

Put LINKS handling in `install' target, so it's the last thing executed, and
happens even if `realinstall' is user-defined.


# 1.22 30-Jul-1993 mycroft

When generating a default OBJS, ignore .h files.


# 1.21 29-Jul-1993 mycroft

Don't print the `making ...' message if an obj dir already exists.
Also, a minor cleanup.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.20 17-Jul-1993 mycroft

Fix C++ dependencies for good. `make depend' is now done in two passes--one
of C files and one for C++ files. No need to specify `-+' in your Makefile,
as it is now done automatically.


# 1.19 17-Jul-1993 cgd

do c++ dependencies the right way...


# 1.18 17-Jul-1993 mycroft

Add suffix rules for C++ files.


# 1.17 04-Jun-1993 brezak

Add LIBRPCSVC variable.


# 1.16 02-Jun-1993 cgd

add ability to specify c++ dependencies, by setting CFLAGS+=-+ for
the dependency make.


# 1.15 26-Apr-1993 cgd

added definition for DPADD library variable LIBCRYPT.


# 1.14 26-Apr-1993 mycroft

Don't redefine `realinstall' target if already defined.


# 1.13 25-Apr-1993 mycroft

Link with LDFLAGS even if one source module.


# 1.12 25-Apr-1993 mycroft

Don't lose if we include bsd.prog.mk only to build man pages.


# 1.11 25-Apr-1993 mycroft

Fix error in last change. (Oops.)


# 1.10 25-Apr-1993 mycroft

Don't build man pages if NOMAN set.


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.9 09-Apr-1993 cgd

various changes to default make rules. from patch 101.
note that only the "sensible" changes in patch 101 are implemented.


# 1.8 08-Apr-1993 cgd

try to do the right thing, in terms making directories before we
install into them, and get the manpage cleans _OUT_ of "clean".
they don't belong there, only in cleandir, WFJ be damned.


# 1.7 08-Apr-1993 cgd

fixed typos...


# 1.6 08-Apr-1993 cgd

(silently) make sure we have directories before installing


# 1.5 04-Apr-1993 cgd

make LIBRPC point to the right place


# 1.4 27-Mar-1993 nate

Fixed the doc macros to call troff, eqn,and tbl instead of ditroff,
deqn, and dtbl.
Fixed make clean to remove the man pages (Bill fixed this in the distribution,
but not in the original source)
Changed install to leave the original file around, by using 'cp' instead of
'mv'. "install -c ..."


# 1.3 23-Mar-1993 cgd

made .CURDIR be absolute, not relative, thereby eliminating
the need for some of the makefile trickery when making objects,
and fixing a few .PATH bugs


# 1.2 22-Mar-1993 cgd

fixed "make obj" for cases when sources not in /usr/src/...
if sources not there, it now mkdirs obj, but some trickery
is necessary, to avoid deleting cwd.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.332 16-Oct-2020 nia

share/mk: Define some missing X11 libraries.


# 1.331 15-Jun-2020 christos

Rename blacklist -> blocklist


# 1.330 30-May-2020 christos

Make libuv private, requested by joerg@


# 1.329 24-May-2020 christos

Add libuv


Revision tags: phil-wifi-20200421 phil-wifi-20200411 phil-wifi-20200406
# 1.328 04-Apr-2020 christos

Linker semantics have changed; we now don't automatically link dependent
libraries from other DSO's. For example in /usr/bin/passwd:
ld: krb5_passwd.o: undefined reference to symbol \
'UI_UTIL_read_pw_string@@OPENSSL_1_1_0'
ld: /usr/obj/amd64-x86_64/release/lib/libcrypto.so.14: error adding symbols: \
DSO missing from command line


# 1.327 04-Apr-2020 christos

Fix kerberos libraries order


# 1.326 04-Apr-2020 christos

Add libgnuctf


# 1.325 03-Mar-2020 christos

Add fido and cbor


Revision tags: is-mlppp-base phil-wifi-20191119
# 1.324 18-Nov-2019 christos

Improve the script to check for installed libraries, and fix the wrong
names and obsolete libraries it found.


# 1.323 27-Aug-2019 kamil

Enhance the support of LLVM sanitizers

Define _REENTRANT for MKSANITIZER build. This is needed for at least stdio
code. This caused new build issued with duplicated symbols in few places
and rump kernel code picking different code paths borrowed from libc.
Handle all this in one go.

Add bsd.sanitizer.mk to share common code used by programs and libraries.

Switch from realall to beforeinstall target in .syms files. This is more
reliable in MKSANITIZER.


# 1.322 17-Aug-2019 kamil

Add PAXCTL_FLAG rules for MKSANITIZER

Add per-program rules to disable ASLR for ASan, TSan and MSan in all
sanitized programs. This flag is not needed for other supported sanitizers.

Without this change, sanitized init(8) dies early on startup.

Approach originally suggested by <joerg>


# 1.321 15-Aug-2019 kamil

Add SANITIZER_RENAME_CLASSES in bsd.prog.mk

This adds a more flexible version of SANITIZER_RENAME_SYMBOL.

New symbol allows to specify MKSANITIZER specific renames on per-file and
per-symbol basis.


# 1.320 10-Aug-2019 christos

Make the X11 library lists consistent again.


Revision tags: netbsd-9-base phil-wifi-20190609 pgoyette-compat-20190127
# 1.319 21-Jan-2019 christos

branches: 1.319.2;
Most of the mv operations are to move temporary files to their final place.
Some use -f, others don't. This can lead to spurious build failures when
the user performing the build changes. Centralize, and always use -f.


Revision tags: pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.318 12-Aug-2018 christos

fix broken library variable definitions (inconsistencies between
bsd.README and bsd.prog.mk)


Revision tags: pgoyette-compat-0728
# 1.317 25-Jul-2018 kamil

Introduce MKLIBCSANITIZER in the share/mk rules

Add flags that are required to build a program and a dynamically loaded
library.

Propagade LIBCSANITIZERFLAGS to CFLAGS and CXXFLAGS.

LDFLAGS is not changed on purpose, as a libcsanitizer is inside libc
and no external dependencies are needed.

Register NOLIBCSANITIZER, as certain distribution parts will need to be
skipped.


# 1.316 12-Jul-2018 maxv

Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.


Revision tags: phil-wifi-base
# 1.315 25-Jun-2018 kamil

branches: 1.315.2;
Add a framework for renaming symbols in libc&co for MKSANITIZER

A new keyword SANITIZER_RENAME_SYMBOL. It's a variable that has specified
a list of symbols to be renamed in a processor in order to remove naming
conflicts with public symbols in libc/m/pthread/rt.

This renaming will occur for libraries and programs.
A symbol with a conflicting 'name', will be renamed to '__mksanitizer_name'.

Based on an idea by <christos>


Revision tags: pgoyette-compat-0625
# 1.314 21-Jun-2018 kamil

Refactor MKSANITIZER flags in mk rules

Introduce a new variable SANITIZERFLAGS that contains all the sanitizer
specific flags. These flags are designed to be passed to CFLAGS, CXXFLAGS
and LDFLAGS.

Pass SANITIZERFLAGS in bsd.prog.mk rules to CFLAGS, CXXFLAGS and LDFLAGS.

Pass SANITIZERFLAGS in bsd.lib.mk rules to *_pic.a build flags. The *_pic.a
libraries are designed to construct .so libraries. All .so libraries with
few exceptions are expected to be prebuilt with a sanitizer. Another
purpuse of *_pic.a files can be constructing static PIE programs, however
they are not supported as of now and there is no sanitization of static
programs either.

Once MKSTATICPIE will be supported, it will be initially incompatible with
MKSANITIZER.

This change also makes it easier to build other targets like kernel and
kernel modules without userland sanitizers.

No functional change intended for MKSANITIZER=no users.


# 1.313 02-Jun-2018 christos

Sanitizers don't support static linking.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315
# 1.312 11-Mar-2018 mrg

define LIBXFONT2.


Revision tags: pgoyette-compat-base
# 1.311 25-Feb-2018 mrg

branches: 1.311.2;
add LIBKRB5_LDADD/LIBKRB5_DPADD and their static counterparts
to bsd.prog.mk. use them instead of hard coding various lists
of libraries for krb5.

this fixes static builds.


# 1.310 11-Dec-2017 christos

Instead of checking for obj existance which can be empty for shuttle-rule
programs, check for .sh sources.


# 1.309 10-Dec-2017 christos

don't try to build .debug files for shell scripts.


# 1.308 10-Oct-2017 christos

Add general {DP,LD}ADD.rump variables


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base
# 1.307 21-May-2017 riastradh

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.


# 1.306 21-May-2017 riastradh

Remove some vestiges of MKCRYPTO_IDEA/MKCRYPTO_MDC2.


# 1.305 21-May-2017 riastradh

Remove MKCRYPTO_RC5. Unconditionally include RC5 in libcrypto.so.

This option existed only because RC5 is covered by patents that, twenty
years ago, we had reason to suspect the patent holder, RSA, Inc., might
litigate. The two US patents in question are 5,724,428 and 5,835,600.

According to the USPTO Patent Term Calculator web site at
<https://www.uspto.gov/patent/laws-and-regulations/patent-term-calculator#heading-5>
(retrieved 2017-05-21), patents filed after 1995-06-07 expire twenty
years after the filing date.

number filing date
5,724,428 1995-11-01
5,835,600 1997-04-21

Thus, these patents appear to be expired.

As proposed on tech-crypto and tech-security:

https://mail-index.netbsd.org/tech-crypto/2017/05/05/msg000718.html
https://mail-index.netbsd.org/tech-security/2017/05/05/msg000927.html


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.304 19-Apr-2017 joerg

Add netpgpverify to the library list.


Revision tags: pgoyette-localcount-20170320
# 1.303 20-Feb-2017 rin

add missing LIBCXX


# 1.302 08-Feb-2017 kamil

libpthread_dbg(3) deletion from the base distribution

libpthread_dbg(3) is a remnant library from the M:N thread model
(pre-NetBSD-5.0) API to introspect threads within a process and for use
of debuggers.

Currently in the 1:1 model it's not used in GDB neither in LLDB and it's
not either planned to be used. It's current function to read pthread_t
structures is realizable within a regular debugger capable to
instrospect objects within a tracee (GDB, LLDB...).

Remaining users of this API can still use this library from
pkgsrc/devel/libpthread_dbg.

Sponsored by <The NetBSD Foundation>


# 1.301 29-Jan-2017 christos

add sqlite3 to statically linked libraries for pam.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914
# 1.300 20-Aug-2016 christos

branches: 1.300.2;
unbound additions


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.299 04-Apr-2016 joerg

branches: 1.299.2;
If the per-target LDSTATIC flag is set, don't include the PIE linker
flags as we currently don't support static PIE.


# 1.298 30-Mar-2016 martin

Pass -pie to cc, not -Wl,-pie. This way we have a chance to fix specs
for obscure corner cases like -pie -fPIE -static (used for
/usr/tests/lib/csu/h_initfini2 if building with MKPIE=yes).
While there also replace -fPIC with -fPIE for the PIE case, even if
it should be mostly equivalent.


# 1.297 12-Mar-2016 mrg

remove conditionals that are always true with GCC >= 4.8.


# 1.296 21-Feb-2016 christos

Add NODEBUG


# 1.295 31-Jan-2016 christos

Introduce NOPIE and NOCTF so that standalone programs build properly.


# 1.294 23-Jan-2016 christos

Define _KERNTYPES for things that need it.


# 1.293 07-Nov-2015 joerg

LIBEXECINFO


# 1.292 07-Jun-2015 matt

Make LIBCRT* depend on the right files if MLIBDIR from MKCOMPAT is defined.


# 1.291 01-Dec-2014 erh

PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilt
if any of their dependencies (i.e. the files they refer to) are changed.
This allows changes to transitive included headers to be handled properly.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.290 25-Mar-2014 ozaki-r

branches: 1.290.4;
Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.


Revision tags: riastradh-drm2-base3
# 1.289 09-Mar-2014 christos

let's see if the new dwarf library can handle dwarf 4


# 1.288 02-Mar-2014 christos

If we are compiling with -g and using gcc4.8 and dtrace downgrade
dwarf generation to version 2 for now.


# 1.287 15-Jan-2014 joerg

-Wl,-pie and -r don't agree with each other, so filter the former out.


# 1.286 11-Nov-2013 joerg

Relink binaries if crti.o changes.


# 1.285 29-Sep-2013 christos

Add libxcb


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.284 31-May-2013 mrg

add LIBX11_XCB; unfortunately since the library is named with a -
in it, we have to use an ugly hard coded assignment for now.
(could be cleaned up with more make variable magic i'm sure.)


# 1.283 04-Apr-2013 christos

ldopts should be before ldadd like everywhere else.


Revision tags: agc-symver-base
# 1.282 14-Feb-2013 christos

Since the libraries are produced with different MK flags than the programs,
we check for existance of the files instead of the MK flags.


# 1.281 14-Feb-2013 christos

Add PROGDPLIBS


# 1.280 26-Jan-2013 christos

CTFCONVERT me harder.


Revision tags: yamt-pagecache-base8
# 1.279 17-Jan-2013 christos

Now that we have separate debug sets, add -g if ${MKDEBUG} is set for
program builds since we don't need to install that symbol files.


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.278 24-Aug-2012 jmmv

branches: 1.278.2;
Allow DPADD to be specified on a per-program basis.


# 1.277 23-Aug-2012 joerg

Revert last, it breaks the tricks xsrc uses.


# 1.276 23-Aug-2012 joerg

Remove SHLIBINSTALLDIR and SHLINKINSTALLLIBDIR. Add rpath entries, if
SHLIBDIR differs from /usr/lib.


# 1.275 08-Aug-2012 christos

add MKRUMP by popular demand.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.274 29-Feb-2012 tron

Move "libexpat" from X11 into base which fixes PR lib/40346.
This change was approved by the Core Group.


# 1.273 21-Feb-2012 matt

Remove another ${SIZE}


# 1.272 20-Feb-2012 matt

Remove ${SIZE}


# 1.271 19-Feb-2012 matt

Add support for --combine with gcc.


Revision tags: netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2
# 1.270 05-Nov-2011 christos

branches: 1.270.2;
Add libtre


Revision tags: yamt-pagecache-base
# 1.269 16-Oct-2011 christos

branches: 1.269.2;
- no need to special-case libraries with weird characters.
- add a note about adding new libraries.


# 1.268 16-Oct-2011 christos

fix list of libraries to reflect reality.


# 1.267 10-Sep-2011 apb

Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.


# 1.266 27-Aug-2011 joerg

Add new "analyze" command to run clang's static analyzer in a directory
on all C/C++ files.


Revision tags: cherry-xenmp-base
# 1.265 26-Apr-2011 he

The new Heimdal adds -lwind and -lheimbase to the set of libraries,
so define the corresponding LIB* variables.
These are also needed in the PAM_STATIC_* variables, so add them there too.


# 1.264 11-Apr-2011 joerg

Adjust --sysroot related usage:
-Wl,-rpath does not expand =, so just drop it.

Drop -Wl,-rpath-link entries that duplicate the -Wl,-rpath entries, this
is done implicitly now that ld is built with sysroot support.

Use ${DESTDIR} explicitly for the remaining -Wl,-rpath-link entries.


# 1.263 10-Apr-2011 joerg

For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.


# 1.262 08-Mar-2011 jmmv

Revert previous (revision 1.261): it broke the build because PROG_CXX is
defined in terms of PROG, so later on we would end up with target duplicates
because both PROG_CXX and PROG were being converted to PROGS_CXX and PROGS.

Did not catch this earlier because the test build I did was not clean and
thus the duplicate targets did not have nasty effects.


# 1.261 07-Mar-2011 jmmv

Always convert PROG to its plural form independently of whether PROG_CXX
is defined or not. From Garrett Cooper in private mail.


Revision tags: bouyer-quota2-nbase
# 1.260 20-Feb-2011 jmmv

Define LIBATF_C and LIBATF_CXX to point to their corresponding .a files and
use these to properly set DPADD for test programs.


Revision tags: bouyer-quota2-base
# 1.259 13-Feb-2011 christos

add saslc


# 1.258 06-Feb-2011 joerg

Don't use -nostdinc or -nostdinc++ if this is included in a HOSTLIB.


# 1.257 17-Jan-2011 pooka

branches: 1.257.2;
Add rump bits to DPSRCS so that update builds work correctly.


Revision tags: matt-mips64-premerge-20101231
# 1.256 13-Dec-2010 pooka

befriend RUMPPRG with CRUNCHEDPRG


# 1.255 13-Dec-2010 pooka

Define RUMPPRG, which is just like PROG, except it additionally
builds a rump client with the name rump.${PROG}. The rump client
is not installed suid/sgid by default even if BINMODE is defined.


# 1.254 10-Dec-2010 joerg

Revert last, gcc(1) checks explicitly for -r on some platforms to disable
passing down --relax as well.


# 1.253 08-Dec-2010 joerg

gcc passes down -r directly to ld, so make it explicitly a linker option.


# 1.252 08-Dec-2010 joerg

Don't depend on ${CC} passing down -R to ld, use -Wl,-rpath explicitly.


# 1.251 08-Nov-2010 lukem

Preserve date on original shared library or program when stripping
the debug symbols and adding the debug-link to .debug.
Use '(rm -f file; false)' in the failure path to force failure.
Based on solution proposed by Nicolas Joly on tech-toolchain in July 2010.
Should fix PR toolchain/44046 from Andreas Gustafsson.


# 1.250 31-Oct-2010 mbalmer

Link Lua to the build and add the resulting files to the distribution sets.
Document the addition of Lua and the change we made to the default settings.


# 1.249 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.248 24-Apr-2010 lukem

When extracting separate debug symbols with MKDEBUG, there's no need
to leave the original file unstripped...


# 1.247 02-Mar-2010 darran

DTrace: Add CTF generation to the make framework. Only enabled when
MKDTRACE=yes.


# 1.246 14-Dec-2009 mrg

use "${CC} -r" not "${CC} -Wl,-r" as the latter fools GCC on some targets
and it ends up passing "-r -relax" to ld, which causes ld to barf.


# 1.245 14-Dec-2009 matt

Merge from matt-nb5-mips64


Revision tags: matt-premerge-20091211
# 1.244 08-Dec-2009 uebayasi

When PROGS / LIBS are used, you can pass each PROG / LIB specific parameters
to ${LD} via:

${LDADD.${PROG}}
${LDFLAGS.${PROG}}
${LDSTATIC.${PROG}}
${LDADD.${LIB}}
${LDFLAGS.${LIB}}

OTOH you can't pass parameters to ${CC}, because in suffix rules make(1) only
knows the name of ${.IMPSRC} and ${.TARGET}; it's users' responsivility to
define ${CC} parameters to all the sources of a given ${PROG} / ${LIB}.

Should address bin/42381.

(Bug in this commit log was pointed out by mrg@.)


# 1.243 27-Nov-2009 tsutsui

If CPPFLAGS or CXXFLAGS already contains -nostdinc or -nostdinc++,
don't add ${CPPFLAGS_ISYSTEM} or ${CPPFLAGS_ISYSTEMXX} to refer
${DESTDIR}/usr/include or ${DESTDIR}/usr/include/g++.

This change might cause errors on some MD stand dir, but in that case
each Makefile should be fixed to search proper system include paths
by -Ipath option in own CPPFLAGS.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.242 12-May-2009 plunky

remove libsdp as improved functionality has been enabled in libbluetooth.


# 1.241 10-Apr-2009 apb

Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links. They have no effect except when using a
metalog, in which case the information is added to the metalog. In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg. This should fix PR 24457 and PR 41155.


# 1.240 24-Nov-2008 cube

branches: 1.240.2;
Move cleanextra to the very ends in case another included file wants to add
to it even if it was initially empty.


Revision tags: netbsd-5-base matt-mips64-base2
# 1.239 19-Oct-2008 christos

branches: 1.239.2;
handle assembly files for MKPIE


# 1.238 16-Oct-2008 christos

Provide a way for a program to override the PIE flags.


# 1.237 15-Oct-2008 christos

don't compile/link libraries with pie


Revision tags: mjf-devfs2-base
# 1.236 02-Oct-2008 joerg

Hook up libfetch and pkg_install update.


Revision tags: wrstuden-revivesa-base-3
# 1.235 09-Sep-2008 joerg

Add MKSTRIPIDENT to remove the RCS IDs from binary programs and shared
libraries for space-constraint systems. The description is based on the
feedback of hubertf@, the logic on input from lukem@

This obsoletes the removal of LIBC_SCCS and SYSLIBC_SCCS for libc builds.


Revision tags: wrstuden-revivesa-base-2
# 1.234 28-Aug-2008 mrg

update a comment example


# 1.233 27-Aug-2008 rtr

use ${X11USRLIBDIR} instead of hard-coded /usr/X11R6/lib when building
${LIB.foo} vars


# 1.232 27-Aug-2008 lukem

Fix problem I introduced in rev 1.231 on 2008/08/25 where ${_PROGLDOPTS}
and -L${_GCC_LIBGCCDIR} were appearing in the link line before ${LDADD},
so -L${DESTDIR}/lib and -L${DESTDIR}/usr/lib were being used before
local -L library paths.
Fixes ntpd/ntpdate failure noticed by Valeriy E. Ushakov <uwe@NetBSD.org>


# 1.231 25-Aug-2008 lukem

Always link with: -Wl,-rpath-link,${DESTDIR}/usr/lib -L${DESTDIR}/usr/lib
Fixes problem with MKDYNAMICROOT=no triggered by libraries that depend
on other libraries.
Related to PR 33503.

Clean up setting of _CCLINK to always add the appropriate -B options.

Simplify the link rule for a program.


# 1.230 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.229 28-May-2008 lukem

add LIBLDAR_R (for completeness)


# 1.228 22-May-2008 lukem

Add MKLDAP, USE_LDAP, LIBLBER, LIBLDAP


Revision tags: hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-pf42-base
# 1.227 10-Apr-2008 tsutsui

branches: 1.227.2; 1.227.4;
Add libhx509 to PAM_STATIC_LDADD which is required by libkrb5.


# 1.226 22-Mar-2008 mlelstv

branches: 1.226.2;
Import Heimdal-1.1


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase matt-armv6-base hpcarm-cleanup-base
# 1.225 26-Dec-2007 jmmv

Make the clean target work when OBJS is set but PROG is not, as happens
for example in gnu/lib/crtstuff4. Reported by drochner@.


Revision tags: cube-autoconf-base
# 1.224 13-Nov-2007 jmmv

Fix typo that prevented MKDEBUG builds to work. Found by drochner@.


# 1.223 12-Nov-2007 jmmv

Add the ability to build multiple programs from a single directory

This adds support for a new set of variables, PROGS and PROGS_CXX, that
allow the developer to build multiple different programs from a single
source directory.


# 1.222 04-Nov-2007 tls

Remove MKPRIVATELIB from BIND libraries; move library reachover
directories and Makefiles from src/usr.sbin/bind to src/lib; make
BIND libraries build shared. Saves about 1MB-1.5MB per installed
executable, about 5MB for a base+etc minimal installation of NetBSD.


Revision tags: matt-mips64-base
# 1.221 29-Jul-2007 joerg

branches: 1.221.4; 1.221.6;
Add build glue for libarchive and update the various sets.


# 1.220 25-Jan-2007 perry

Before I completely forget the issue, convert "PROG_PAX" to the
better-named "PAXCTL_FLAGS".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.219 11-Nov-2006 christos

don't run paxctl if other commands were specified for that target.


# 1.218 10-Nov-2006 christos

if ${PROG_PAX} is defined, run paxctl on the binary after linking with
the value of the variable. This way, if you set:

PROG_PAX=+M

in /etc/mk.conf, you get what you deserve.


# 1.217 22-Oct-2006 pooka

libpuffs


# 1.216 09-Oct-2006 mrg

- clean up some comments to reality.
- retire LIBDCK, LIBG2C and (long broken) USE_LIBSTDCXX
- in bsd.hostprog.mk's LIBSTDCPP -> LIBSTDCC
- add LIBSUPCXX
- don't default USE_LIBSTDCXX or USE_GCC4 since they are
not used in the tree any where
- same with USE_XF86_4; retire it
- remove _SUPCXX handling in bsd.prog.mk

inspired by PR#26714.


Revision tags: abandoned-netbsd-4-base
# 1.215 23-Jul-2006 lukem

Implement MKDEBUG:
If "no", don't build and install separate debugging symbols
into /usr/libdata/debug.
Default: no


# 1.214 19-Jun-2006 gdamore

Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.


# 1.213 09-Jun-2006 christos

PR/33681: Scott Ellis: Building 'bc' with SHAREDSTRINGS=yes fails
We need CPPFLAGS too now.


# 1.212 11-May-2006 mrg

add support for ${OBJCOPTS} and ${OBJCOPTS}.<lib|prog|fn>.


# 1.211 20-Mar-2006 christos

There is always one more KRB4 thing to remove. (from Jukka Salmi)


# 1.210 20-Mar-2006 christos

Remove krb4 variables and libraries (Jukka Salmi)


# 1.209 16-Mar-2006 jwise

Now that we have real build system support for syspkgs, remove someone's
half-implemented idea of building `syspkgs' (really a few giant blobs of the
same granularity of the old sets) using install(1).


# 1.208 20-Jan-2006 christos

Add the world of libraries to the static pam build. Now static pam binaries
work.


# 1.207 09-Apr-2005 dsl

Report when we link a program into xxx.ro (before being crunched)


Revision tags: netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.206 04-Mar-2005 he

branches: 1.206.2; 1.206.4;
Introduce PAM_STATIC_LDADD and PAM_STATIC_DPADD. When compiling
with MKPIC=no, possibly because the target does not support shared
libraries, these include libraries required to resolve all symbols
which end up referenced from PAM-using applications. The libraries
presently required are -lcrypt, -lrpcsvc and -lutil.

Add use of these variables which are currently set up to use PAM,
so that they compile when MKPIC=no.

Also, in the telnetd case, reorder the order of the libraries, so
that libtelnet.a comes before -ltermcap and -lutil, again to fix
link error when MKPIC=no.

Discussed with thorpej and christos.


# 1.205 20-Feb-2005 christos

Add libradius


# 1.204 12-Jan-2005 lukem

If RESCUEDIR is defined, automatically add that to CPPFLAGS


# 1.203 08-Jan-2005 lukem

Implement <bsd.prog.mk> vars:
LIBASN1 LIBBSDMALLOC LIBG2C LIBPAM LIBSSH


# 1.202 04-Aug-2004 lukem

Revert most of previous, and move the LIB<libname>?= assignments
back to bsd.prog.mk from bsd.own.mk.

pkgsrc uses <bsd.own.mk>, and setting LIB<libname> in it causes
problems with various package builds.
This should fix PR #26542 submitted by Jim Bernard.

(I'll be implementing the DPADD for shared libraries in a different
manner that generally won't depend upon ${LIB<libname>}.)


# 1.201 30-Jul-2004 lukem

Move the LIB<libname>?= assignments from bsd.prog.mk to bsd.own.mk so
that they may be used by non PROGs (e.g., LIBs).

Improve some comments.


# 1.200 10-Jun-2004 lukem

Be consistent in handling YHEADER, similar to Christos' fix in bsd.lib.mk 1.253


# 1.199 21-May-2004 ross

If you add a library, you need to define its DPADD symbol here.

Add LIBMAGIC.


Revision tags: netbsd-2-0-base
# 1.198 15-Feb-2004 skrll

branches: 1.198.2;
Be more gcc like in the way we deal with libgcc so that sh3/hppa millicode
and exception handling have a chance of working properly.

- creates libgcc, libgcc_eh and libgcc_s

- updates LIBGCC_SPEC to use them appropriately.

There's a hack in here at the moment with respect to libgcc_so in that it
is preferable to link against libgcc_so will only when -shared-libgcc is
specified (the c++ frontend does this automatically.) Configurations where
LINK_EH_SPEC is defined already do this. The gcc configuration for
NetBSD/alpha and another NetBSD platform (I forget which) actually define
LINK_EH_SPEC probably by accident rather than design.

- updates share/mk to use the compiler's knowledge of what needs linking into
libraries and executables. This removes an hppa hack.

- updates the sets for the newly created libgcc* files.

- support for linking against the _pg version of libgcc has been removed.


# 1.197 29-Jan-2004 lukem

Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.


# 1.196 27-Jan-2004 lukem

Replace
:M-[IDU]*
with
:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)


# 1.195 23-Jan-2004 simonb

crt0.o lives in /usr/lib even on a.out.


# 1.194 16-Nov-2003 lukem

simplify with _MKTARGET_LINK


# 1.193 11-Nov-2003 dsl

Set MKDEP_SUFFIXES to get additional targets in .depend instead of using
sed in .afterdepend. I don't think .afterdepend is used anywhere any more.


# 1.192 21-Oct-2003 lukem

Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.


# 1.191 19-Oct-2003 lukem

Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} " ... {$.TARGET}" and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO


# 1.190 18-Oct-2003 lukem

Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command ("verbose")
This is the default, and is equivalent to the previous behaviour.


# 1.189 29-Sep-2003 lukem

Add LIBSTDCXX (for usr/lib/libstdc++.a).
Sync LIB* documentation with reality.


# 1.188 19-Sep-2003 martin

Drop explicit medlow model and default to -O2 for sparc64.


# 1.187 14-Sep-2003 lukem

Check ${SHLIBDIR} against "/usr/lib" instead of ${LIBDIR} when determining
if we need to add stuff (usually "/lib") to the rpath-link path before
"/usr/lib". Otherwise, this barfs if LIBDIR != /usr/lib or /lib, and
we're cross-building (e.g., in src/x11)


# 1.186 13-Sep-2003 erh

Also support per-program LDFLAGS and LDSTATIC.


# 1.185 13-Sep-2003 erh

Create a way to add additional flags to COPTS, CPPFLAGS, CXXFLAGS and LDADD
for particular libraries or programs by specifying the additions in mk.conf
instead of needing to go edit individual Makefiles.


# 1.184 12-Sep-2003 lukem

add infrastructure to support reach-over builds of xsrc


# 1.183 22-Aug-2003 dsl

Add a ${PROG}.ro target that does an 'ld -r' of the program object files.
Allows a much simplified build of 'crunched' binaries since crunchgen can
build prog.ro instead of having to deretmine the names of all the .o files.


# 1.182 01-Aug-2003 lukem

Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".


# 1.181 01-Aug-2003 lukem

simplify the ${PROG}: target to reduce duplication between the DESTDIR
and !DESTDIR cases...


# 1.180 31-Jul-2003 lukem

bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.


# 1.179 31-Jul-2003 lukem

Don't need -R/usr/lib; it will be searched at the end by ld.elf_so anyway.
Noted by matt green <mrg@>


# 1.178 28-Jul-2003 lukem

be consistent when adding *.y and *.l to DPSRCS


# 1.177 28-Jul-2003 lukem

replace MKCXXSUPCXX(!=no) with USE_LIBSTDCXX(==no)


# 1.176 28-Jul-2003 lukem

Change defined(CXX_SUPCXX) to MKCXXSUPCXX != "no".

Clarify that command-line overrides of the MKxxx variables should be
done via the environment rather than make(1) command-line variable
assignment, since the latter doesn't actually work as intended.


# 1.175 27-Jul-2003 mrg

introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes. for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)


# 1.174 26-Jul-2003 mrg

add a new bsd.own.mk variable: CXX_SUPCXX. from bsd.README:
+ CXX_SUPCXX If defined, the support libraries needed for this C++ program
+ are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.


# 1.173 20-Jul-2003 lukem

Consistently support the different C++ file extensions: .cc .cpp .cxx .C
Noted by Andrew White in PR toolchain/18246


# 1.172 18-Jul-2003 lukem

Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was defined.
Replace defined(UNPRIVED) tests with ${MKUNPRIVED} != "no"

Add MKUPDATE; if not no has the same semantics as if UPDATE was defined.
Replace defined(UPDATE) tests with ${MKUPDATE} != "no"

Improve documentation for these and other make flags.


# 1.171 16-Jul-2003 itojun

stop installing install libtelnet. build under lib/libtelnet and reference
it from usr.bin/telnet and libexec/telnetd.
(reason for separate build: compiler flags)


# 1.170 27-Jun-2003 drochner

For consistency, use "-R" instead of "-Wl,-rpath" to pass
a runtime search path to the linker.


# 1.169 13-Jun-2003 itojun

define LIBEVENT


# 1.168 11-Jun-2003 msaitoh

catch signal 1,2,3,13 and 15 to clean /tmp/_dependXXX


# 1.167 31-May-2003 thorpej

If EXTERNAL_TOOLCHAIN is defined, allow the compiler to define the
location of crt{begin,end}{,S}.o and libgcc.a. Encapsulate all of
this logic into the new bsd.gcc.mk, and use it in bsd.prog.mk and
bsd.lib.mk.


# 1.166 18-May-2003 lukem

make this a no-op if HOSTPROG is defined


# 1.165 30-Mar-2003 thorpej

If MACHINE_ARCH is powerpc and we HAVE_GCC3, add crtsaveres.o to the
endfile spec.


# 1.164 22-Feb-2003 uwe

Typo in comment.


# 1.163 24-Jan-2003 thorpej

Add LIBPTHREAD, LIBPTHREAD_DB, and LIBRT.


Revision tags: fvdl_fs64_base
# 1.162 22-Nov-2002 thorpej

Split crtbegin/crtend into crti/crtbegin/crtend/crtn. NetBSD-specific
things like the .note.netbsd.ident section are provided by crti/crtn.
crti/crtn also provide the _init() and _fini() routines.

crtbegin/crtend now only provide support for ctors/dtors. This paves
the way to using the "crtstuff" provided with GCC (when we upgrade to
GCC 3.3), which provides, among other things, much better C++/Java
exception handling.


# 1.161 12-Nov-2002 itohy

MKDYNAMICROOT for a.out


# 1.160 22-Oct-2002 perry

Pass 1 of SYSPKG changes to automatically add tags=pkgname_pkg to METALOG.
Not quite ready for prime time yet.


# 1.159 27-Sep-2002 thorpej

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.


# 1.158 26-Sep-2002 itojun

MDC2 is a patented algorithm; don't ship it in default libcrypto.
MKCRYPTO_MDC2 will build a separate library, libcrypto_mdc2.


# 1.157 08-Sep-2002 thorpej

Build a .gdbinit in the objdir when building a program. The .gdbinit
file sets the shared library prefix to ${DESTDIR}, and adds "sources"
directives for each file listed in the GDBINIT Makefile variable.


# 1.156 09-Aug-2002 thorpej

Add LIBPMC.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.155 27-Mar-2002 eeh

branches: 1.155.2;
Use the medium low model for sparc64 programs that don't 2GB of data segment.


# 1.154 11-Feb-2002 mycroft

Don't use .PHONY for targets that are actually installed. Instead use force
dependencies. (Among other things, `make -t install' does something vaguely
sensible now.)


# 1.153 07-Feb-2002 pk

Mark installed system libraries as .MADE only if we're actually establishing
their default variable values here.


# 1.152 04-Feb-2002 christos

s/.NOSUFF/.MADE/


# 1.151 03-Feb-2002 christos

Apply a .NOSUFF: directive to targets we don't want to have processed by
the suffix rules engine.


# 1.150 02-Feb-2002 veego

Ups, it is LIBUSBHID and not LIBUSBHIB.


# 1.149 02-Feb-2002 veego

Change LIBUSB to LIBUSBHIB, reflecting the library name change.


# 1.148 29-Jan-2002 enami

Mark the targets clean{extra,objs} as PHONY.


# 1.147 04-Jan-2002 thorpej

For PROG_CXX DESTDIR builds, pull in -lstdc++ and -lm regardless
of GCC version.


# 1.146 01-Jan-2002 thorpej

Per a suggestion from matthew green, PROG_CXX takes the place of
PROG for C++ programs.


# 1.145 01-Jan-2002 thorpej

* If PROG_CXX is set by the program's Makefile, use ${CXX} to link
the program rather than ${CC}.
* If HAVE_GCC3 is defined, pull in "-lstdc++ -lm" as additional C++
support libraries for DESTDIR builds.


# 1.144 28-Dec-2001 lukem

* 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


# 1.143 28-Nov-2001 tv

If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.


# 1.142 19-Nov-2001 thorpej

Use a little transitional hack to determine if we use -isystem
or -idirafter. Use the former only of USE_NEW_TOOLCHAIN, since
-isystem causes the old toolchain to bomb out when building
libstdc++.


# 1.141 14-Nov-2001 tv

C/..$/.c/ -> C/\..$/.c/


# 1.140 14-Nov-2001 tv

Move the DESTDIR-based nostdinc logic to bsd.lib.mk and bsd.prog.mk where
it belongs (with the native target compile rules).


# 1.139 02-Nov-2001 tv

Use INSTALL_FILE/INSTALL_DIR as appropriate.


# 1.138 02-Nov-2001 tv

Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.


# 1.137 19-Oct-2001 tv

Add .NOPATH for all files generated from .l or .y files in SRCS. Fixes PRs
bin/14187 and lib/14239.

Also simplify the handling of these transforms to .c and .h files a bit by
leveraging make's builtin macro operators.


# 1.136 25-Sep-2001 tv

Set .NOPATH on program to build to make sure it goes in .OBJDIR.
Problem noted by <seebs@plethora.net>.


# 1.135 24-Sep-2001 lukem

fix previous (hi thor!) - $OBJS and $CLEANFILES might be empty, and
rm needs some files to delete...


# 1.134 24-Sep-2001 tls

Split "cleanprog" target apart: now you can zap only object files or
CLEANFILES (needed to fix crunchgen lossage).


# 1.133 13-Sep-2001 thorpej

Add LIBPCI.


# 1.132 14-Aug-2001 tv

Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").


# 1.131 01-Jun-2001 tv

Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).


# 1.130 08-May-2001 sommerfeld

Suppress duplicate entries in ALLFILES, FILES, INCS, DEPINCS, INFOFILES,
NLSALL, CATPAGES, MANPAGES, HTMLPAGES, and SCRIPTS.


# 1.129 19-Feb-2001 jmc

Wrap target() checks around afterdepend rule as some Makefiles override this


# 1.128 26-Jan-2001 itojun

fix typo in LIBSSL decl. it made programs with DPADD+=${LIBSSL} to build
every time we type "make". From: bernd


# 1.127 14-Jan-2001 christos

use the new .if commands(<target>) directive so that we don't have to
change Makefiles.


# 1.126 14-Jan-2001 christos

fix thinko: test for the existance of the target before we define it...


# 1.125 14-Jan-2001 christos

Alter previous redefined target protection. If the ${PROG} target is defined,
add the dependencies as usual, but don't add the commands. This avoids
having to change all the Makefiles that redefine the PROG target.


# 1.124 14-Jan-2001 christos

allow programs to override the program target.


# 1.123 08-Jan-2001 mrg

add missing $LIBCRYPTO_RC5 and $LIBCRYPTO_IDEA


# 1.122 08-Jan-2001 mrg

add missing $LIBSSL


# 1.121 04-Jan-2001 garbled

Add LIBCDK and LIBFORM definitions


# 1.120 31-Oct-2000 itojun

add ${LIBINTL} for use with DPADD.


# 1.119 07-Oct-2000 deberg

fix typos, PR 11159


# 1.118 25-Jun-2000 erh

For the case when DESTDIR is set: move the -L${DESTDIR}/usr/lib after ${LDADD} so any -L directories set in LDADD are searched first to avoid possibly linking against old versions of libraries.


Revision tags: netbsd-1-5-base
# 1.117 19-Jun-2000 thorpej

branches: 1.117.2;
Sync up the LIB* list.


# 1.116 10-Jun-2000 mycroft

Use ${.ALLSRC:T} when doing the generated variable name lookups, so that it
DTRT for generated files in and obj directory (or accessed via .PATH).


# 1.115 06-Jun-2000 mycroft

Abuse .USE some more.


# 1.114 06-Jun-2000 mycroft

Minor rearrangement.


# 1.113 06-Jun-2000 mycroft

Use ODE make(1) features to eliminate extra variables and move several things
outside of .for loops. (Needs more work to completely eliminate .for.)

XXX Don't look at this stuff. It will make your head hurt.


Revision tags: minoura-xpg4dl-base
# 1.112 14-Apr-2000 mrg

branches: 1.112.2;
use -rpath-link rather than -R when linking objects using a DESTDIR.
this replaces the previous change as that ended up adding
$DESTDIR/usr/lib to the runtime path of every binary created, which
is bogus and dangerous.


# 1.111 25-Mar-2000 mycroft

When linking with $DESTDIR, use an explicit -R to get library dependencies
correct.


# 1.110 07-Mar-2000 veego

Remove unused libahdi.
It will be replaced in the future with a more generic libdisklabel.


# 1.109 05-Feb-2000 jdc

Add libahdi entries.


# 1.108 23-Jan-2000 eeh

Add some support for FCode binaries.


# 1.107 22-Jan-2000 mycroft

Make `dependall' play nicely with SUBDIR, using a hack similar to `realinstall'
for both `depend' and `all'.
Also, remove the old hack that invokes an extra shell for .depend, now that
make(1) has been fixed.


# 1.106 16-Jan-2000 assar

all: depend on ${SCRIPTS} so that they get generated if they need to


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.105 23-Nov-1999 blymn

Added libmenu library.


Revision tags: comdex-fall-1999-base
# 1.104 14-Sep-1999 perry

branches: 1.104.4;
Add a "dependall" target, which does a "make depend" and then "make all"
in a single directory. This is useful in "make build" because by doing
the build immediately after the depend, all sources will typically
still be in the buffer cache, thus saving significant time over doing
a "make depend" on all the directories and then a "make all".


# 1.103 04-Sep-1999 fredb

Permit "make all install", as well as "make foo install" (where foo would be
installed by "make install") without setting of BUILD. All cases where BUILD
is already set are unchanged from the old behavior.

"make all install" is now practically equivalent to "make BUILD= all install",
but without actually setting build.

Fixes pr's 8313, 3894.


# 1.102 21-Aug-1999 simonb

Add ${INSTPRIV} to ${INSTALL} commands.


# 1.101 01-Jul-1999 itojun

branches: 1.101.2;
add LIBIPSEC for use from DPADD.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.100 12-Feb-1999 lukem

branches: 1.100.2;
* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.99 10-Feb-1999 tv

libbfd_pic.a is no longer installed; remove ${LIBBFD} define.


# 1.98 04-Feb-1999 christos

PR/2936: Brian C. Grayson: Avoid truncating precious files when installing
and the filesystem is full. Added ${RENAME} flag to install, which when set
to -r installs on a temporary file and then renames to the final destination.
${RENAME} is currently set to nothing in bsd.own.mk, but one can turn it
on in /etc/mk.conf.


# 1.97 07-Nov-1998 jonathan

Do DESTDIR support for crtbegin/crtend on all ELF ports (adds mips).


# 1.96 28-Sep-1998 christos

Use preserve flag in install.


# 1.95 10-Sep-1998 ross

Define a LIBBZ2?=... for use in DPADD=... lines.


# 1.94 09-Aug-1998 lukem

add distclean as a synonym for cleandir


# 1.93 09-Apr-1998 tv

.y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.


# 1.92 01-Apr-1998 tv

Revert. This broke too much in the build tree, and a better solution
needs to be created. (The existing situation breaks a lot too.)


# 1.91 01-Apr-1998 tv

Fix .y rules to DTRT with possibly generated .h files. See mail on
tech-toolchain for a very detailed explanation of this. In short, add
a .y.h rule identical to the .y.c rule and make the .y.c rule rename
the .h file; also, clean the .h file in CLEANFILES.


# 1.90 03-Nov-1997 cgd

echo the lint command line when making 'lint'.


# 1.89 28-Oct-1997 lukem

add ${LIBOBJC}


Revision tags: netbsd-1-3-base
# 1.88 11-Oct-1997 mycroft

branches: 1.88.2;
Several changes:
* Allow bsd.man.mk to be included separately.
* Always include bsd.own.mk and bsd.obj.mk.
* Include bsd.man.mk and bsd.nls.mk even if NOMAN or NONLS; just turn off
building of the affected files instead.
* Require bsd.subdir.mk to be included explicitly.
(Will make appropriate changes to Makefiles shortly.)


# 1.87 29-Sep-1997 gwr

Add $LIBBFD


# 1.86 31-May-1997 cjs

Back out BUILDDIR and NOINSTALL changes.


# 1.85 26-May-1997 cjs

branches: 1.85.2;
These updates to the build allow building against include files
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.


# 1.84 18-May-1997 kleink

Add libposix.


# 1.83 17-May-1997 mycroft

Do LINKS and SYMLINKS after FILES and INCS.


# 1.82 17-May-1997 mycroft

Remove unneeded .SUFFIXES lines, and move .s and .S closer to .o to give the
right preferences.


# 1.81 09-May-1997 mycroft

Fix typo in previous.


# 1.80 09-May-1997 mycroft

Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.79 09-May-1997 mycroft

Remove cruft.


# 1.78 09-May-1997 mycroft

Oops; rearrange dependencies to get things built early enough.


# 1.77 09-May-1997 mycroft

Make sure INCS and SRCS are built if necessary.


# 1.76 08-May-1997 gwr

Set the .NOPATH flag for ${OBJS} (from Christos).


# 1.75 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.74 07-May-1997 mycroft

Various simplifications.


# 1.73 07-May-1997 mycroft

Shuffle some .PHONYs around, to work better with `-t'.


# 1.72 06-May-1997 mycroft

Make most of the install targets .PRECIOUS.


# 1.71 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.70 18-Apr-1997 christos

Add ${LIBNTP}


# 1.69 17-Apr-1997 thorpej

- Properly depend on crtbegin.o and crtend.o for platforms that use
them (currently Alpha and PowerPC)
- STRIP -> STRIPFLAG


# 1.68 03-Apr-1997 mikel

don't allow override of all: target


# 1.67 29-Mar-1997 mikel

merge lite-2 changes (mostly SCCSids)


# 1.66 27-Mar-1997 christos

Put the FILES generated rules in a separate .mk file since both bsd.prog.mk
and bsd.lib.mk use them.


# 1.65 27-Mar-1997 mycroft

Make the SCRIPTS case mimic the FILES case more closely, so we can override
the destination direectory, etc.


# 1.64 27-Mar-1997 mycroft

Remove knowledge of HIDEGAME from here.


# 1.63 24-Mar-1997 christos

make rules update:
- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation


# 1.62 22-Mar-1997 perry

Fix SYMLINKS not to include DESTDIR in the link itself


# 1.61 13-Mar-1997 perry

add SYMLINKS, by analogy to LINKS. Vetted by Christos.


# 1.60 22-Jan-1997 cgd

if 'clean' is not already defined, rather than simply defining it with
a bunch of rules, define a clean{kmod,lib,prog} target with the rules,
and have both clean and cleandir depend on that. That eliminates a bug
where 'cleandir' in a directory which included e.g. bsd.prog.mk but which
also had subdirs would 'make clean' all the subdirs and then 'make cleandir'
all ofthe subdirs. It also allows Makefiles to add more dependencies
to 'clean' after inclusion of the make template.

If 'clean' is already defined, the behaviour is the same as it used to be.


# 1.59 20-Dec-1996 cgd

add an afterdepend target (a la the one in bsd.lib.mk) that processes
the .depend file to add <filename>.ln for each <filename>.o as an
object file which has the given dependencies (in addition to
<filename>.po and <filename>.so, which were already there).


# 1.58 13-Dec-1996 mikel

add missing LIBPCAP definition.


# 1.57 26-Nov-1996 mrg

add libz and libwrap


# 1.56 18-Oct-1996 thorpej

Use ${INSTALL} rather than "install".
From Simon J. Gerraty <sjg@zen.void.oz.au>, PR #1458.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.55 08-Apr-1996 jtc

Sort LIBFOO definitions and add LIBY; Reported by Mike Long <mike.long@analog.com> in PR #2301.


# 1.54 22-Oct-1995 christos

Added include file <bsd.sys.mk> that contains lex and yacc "parallel aware"
rules. These rules are not turned on by default; they are enabled by setting
the PARALLEL variable.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.53 25-Jun-1995 cgd

oops; fix an rm that might be empty


# 1.52 24-Jun-1995 cgd

update lint rules, but keep linting disabled


# 1.51 10-Jun-1995 mycroft

Define LIBEDIT.


# 1.50 21-Apr-1995 jtc

.include <bsd.nls.mk> unless NONLS is defined.


# 1.49 22-Dec-1994 cgd

specify man pages differently, and document how.


# 1.48 24-Aug-1994 mycroft

Include bsd.own.mk earlier.


# 1.47 20-Jul-1994 cgd

fix from christos, for progs w/o objects


Revision tags: netbsd-1-0-base
# 1.46 06-Jul-1994 mycroft

branches: 1.46.2;
Pull libraries from ${DESTDIR} if set. Kill LDONLY, which is unused and
probably not useful anyway.


# 1.45 30-Jun-1994 cgd

fix modify-info-nothingness-then-substitute probelm that broke genclass build


# 1.44 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.43 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.42 28-Jun-1994 jtc

Strip *.sh when constructing OBJS from SRCS.
This will allow us to clean up makefiles that build a script by munging
a template (uusched, genclass, neqn, etc.).


# 1.41 18-Jun-1994 cgd

don't chown the symlink, when HIDEGAME causes a symlink to be made to dm.
4.4-based FS code _follows_ the symlinks on a chown(2) call.


# 1.40 24-May-1994 cgd

fix the last to do the right thing for dependencies


# 1.39 24-May-1994 deraadt

LIBSKEY


# 1.38 22-May-1994 jtc

Single source file programs are now compiled into object files before they
are linked. This change halves the time it takes to rebuild all of the
NetBSD sources when only the C library is "touched"; but only takes about
one percent more disk space.


# 1.37 06-Apr-1994 chopps

relink (recompile) single source programs when crt0.o is updated.


# 1.36 24-Mar-1994 mycroft

Remove *.core on clean.


# 1.35 09-Feb-1994 cgd

kill install -d's.


# 1.34 28-Jan-1994 cgd

add LIBKVM


# 1.33 10-Nov-1993 cgd

librpc doesn't exist anymore


# 1.32 08-Nov-1993 cgd

ad LDSTATIC flag, so static linking can be made one-stop shopping.
use "setenv LDSTATIC" to make *everything* dynamically linked,
setenv LDSTATIC -static for everything statically linked, or unset
it for default behavior.


# 1.31 07-Oct-1993 cgd

LIBTERM pointed at nothing, but was meant to point to libtermcap.a...


# 1.30 07-Oct-1993 cgd

always define LIBCRYPT


# 1.29 17-Aug-1993 mycroft

Make sure we don't recurse into subdirectories if Makefile specified `install'
target. (It's usually blank and is specifically to avoid doing this...)


# 1.28 15-Aug-1993 mycroft

Automatically include bsd.subdir.mk for backward compatibility.


# 1.27 15-Aug-1993 mycroft

Don't automatically include bsd.subdir.mk in bsd.prog.mk and bsd.lib.mk.
Put back .MAIN in bsd.man.mk, and be careful not to include ../Makefile.inc
a second time.


# 1.26 15-Aug-1993 mycroft

Move man rules to sys.mk.
Use bsd.subdir.mk for building subdirectories.
Don't forget to remove x.cc and x.C when using SHAREDSTRINGS.
Make ${PROG} always depend on ${LIBCRT0}.
Don't duplicate code between cleandir and clean.
Move tags target to bsd.dep.mk.
Move STRIP to bsd.own.mk.
Remove redundant definitions of {BIN,MAN}{DIR,GRP,OWN,MODE}.
Move {LIB,DOC}{DIR,GRP,OWN,MODE} defaults to bsd.own.mk.


# 1.25 15-Aug-1993 mycroft

Abstract out dependency stuff, and add RCS identifiers.


# 1.24 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


# 1.23 10-Aug-1993 mycroft

Put LINKS handling in `install' target, so it's the last thing executed, and
happens even if `realinstall' is user-defined.


# 1.22 30-Jul-1993 mycroft

When generating a default OBJS, ignore .h files.


# 1.21 29-Jul-1993 mycroft

Don't print the `making ...' message if an obj dir already exists.
Also, a minor cleanup.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.20 17-Jul-1993 mycroft

Fix C++ dependencies for good. `make depend' is now done in two passes--one
of C files and one for C++ files. No need to specify `-+' in your Makefile,
as it is now done automatically.


# 1.19 17-Jul-1993 cgd

do c++ dependencies the right way...


# 1.18 17-Jul-1993 mycroft

Add suffix rules for C++ files.


# 1.17 04-Jun-1993 brezak

Add LIBRPCSVC variable.


# 1.16 02-Jun-1993 cgd

add ability to specify c++ dependencies, by setting CFLAGS+=-+ for
the dependency make.


# 1.15 26-Apr-1993 cgd

added definition for DPADD library variable LIBCRYPT.


# 1.14 26-Apr-1993 mycroft

Don't redefine `realinstall' target if already defined.


# 1.13 25-Apr-1993 mycroft

Link with LDFLAGS even if one source module.


# 1.12 25-Apr-1993 mycroft

Don't lose if we include bsd.prog.mk only to build man pages.


# 1.11 25-Apr-1993 mycroft

Fix error in last change. (Oops.)


# 1.10 25-Apr-1993 mycroft

Don't build man pages if NOMAN set.


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.9 09-Apr-1993 cgd

various changes to default make rules. from patch 101.
note that only the "sensible" changes in patch 101 are implemented.


# 1.8 08-Apr-1993 cgd

try to do the right thing, in terms making directories before we
install into them, and get the manpage cleans _OUT_ of "clean".
they don't belong there, only in cleandir, WFJ be damned.


# 1.7 08-Apr-1993 cgd

fixed typos...


# 1.6 08-Apr-1993 cgd

(silently) make sure we have directories before installing


# 1.5 04-Apr-1993 cgd

make LIBRPC point to the right place


# 1.4 27-Mar-1993 nate

Fixed the doc macros to call troff, eqn,and tbl instead of ditroff,
deqn, and dtbl.
Fixed make clean to remove the man pages (Bill fixed this in the distribution,
but not in the original source)
Changed install to leave the original file around, by using 'cp' instead of
'mv'. "install -c ..."


# 1.3 23-Mar-1993 cgd

made .CURDIR be absolute, not relative, thereby eliminating
the need for some of the makefile trickery when making objects,
and fixing a few .PATH bugs


# 1.2 22-Mar-1993 cgd

fixed "make obj" for cases when sources not in /usr/src/...
if sources not there, it now mkdirs obj, but some trickery
is necessary, to avoid deleting cwd.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.331 15-Jun-2020 christos

Rename blacklist -> blocklist


# 1.330 30-May-2020 christos

Make libuv private, requested by joerg@


# 1.329 24-May-2020 christos

Add libuv


Revision tags: phil-wifi-20200421 phil-wifi-20200411 phil-wifi-20200406
# 1.328 04-Apr-2020 christos

Linker semantics have changed; we now don't automatically link dependent
libraries from other DSO's. For example in /usr/bin/passwd:
ld: krb5_passwd.o: undefined reference to symbol \
'UI_UTIL_read_pw_string@@OPENSSL_1_1_0'
ld: /usr/obj/amd64-x86_64/release/lib/libcrypto.so.14: error adding symbols: \
DSO missing from command line


# 1.327 04-Apr-2020 christos

Fix kerberos libraries order


# 1.326 04-Apr-2020 christos

Add libgnuctf


# 1.325 03-Mar-2020 christos

Add fido and cbor


Revision tags: is-mlppp-base phil-wifi-20191119
# 1.324 18-Nov-2019 christos

Improve the script to check for installed libraries, and fix the wrong
names and obsolete libraries it found.


# 1.323 27-Aug-2019 kamil

Enhance the support of LLVM sanitizers

Define _REENTRANT for MKSANITIZER build. This is needed for at least stdio
code. This caused new build issued with duplicated symbols in few places
and rump kernel code picking different code paths borrowed from libc.
Handle all this in one go.

Add bsd.sanitizer.mk to share common code used by programs and libraries.

Switch from realall to beforeinstall target in .syms files. This is more
reliable in MKSANITIZER.


# 1.322 17-Aug-2019 kamil

Add PAXCTL_FLAG rules for MKSANITIZER

Add per-program rules to disable ASLR for ASan, TSan and MSan in all
sanitized programs. This flag is not needed for other supported sanitizers.

Without this change, sanitized init(8) dies early on startup.

Approach originally suggested by <joerg>


# 1.321 15-Aug-2019 kamil

Add SANITIZER_RENAME_CLASSES in bsd.prog.mk

This adds a more flexible version of SANITIZER_RENAME_SYMBOL.

New symbol allows to specify MKSANITIZER specific renames on per-file and
per-symbol basis.


# 1.320 10-Aug-2019 christos

Make the X11 library lists consistent again.


Revision tags: netbsd-9-base phil-wifi-20190609 pgoyette-compat-20190127
# 1.319 21-Jan-2019 christos

branches: 1.319.2;
Most of the mv operations are to move temporary files to their final place.
Some use -f, others don't. This can lead to spurious build failures when
the user performing the build changes. Centralize, and always use -f.


Revision tags: pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.318 12-Aug-2018 christos

fix broken library variable definitions (inconsistencies between
bsd.README and bsd.prog.mk)


Revision tags: pgoyette-compat-0728
# 1.317 25-Jul-2018 kamil

Introduce MKLIBCSANITIZER in the share/mk rules

Add flags that are required to build a program and a dynamically loaded
library.

Propagade LIBCSANITIZERFLAGS to CFLAGS and CXXFLAGS.

LDFLAGS is not changed on purpose, as a libcsanitizer is inside libc
and no external dependencies are needed.

Register NOLIBCSANITIZER, as certain distribution parts will need to be
skipped.


# 1.316 12-Jul-2018 maxv

Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.


Revision tags: phil-wifi-base
# 1.315 25-Jun-2018 kamil

branches: 1.315.2;
Add a framework for renaming symbols in libc&co for MKSANITIZER

A new keyword SANITIZER_RENAME_SYMBOL. It's a variable that has specified
a list of symbols to be renamed in a processor in order to remove naming
conflicts with public symbols in libc/m/pthread/rt.

This renaming will occur for libraries and programs.
A symbol with a conflicting 'name', will be renamed to '__mksanitizer_name'.

Based on an idea by <christos>


Revision tags: pgoyette-compat-0625
# 1.314 21-Jun-2018 kamil

Refactor MKSANITIZER flags in mk rules

Introduce a new variable SANITIZERFLAGS that contains all the sanitizer
specific flags. These flags are designed to be passed to CFLAGS, CXXFLAGS
and LDFLAGS.

Pass SANITIZERFLAGS in bsd.prog.mk rules to CFLAGS, CXXFLAGS and LDFLAGS.

Pass SANITIZERFLAGS in bsd.lib.mk rules to *_pic.a build flags. The *_pic.a
libraries are designed to construct .so libraries. All .so libraries with
few exceptions are expected to be prebuilt with a sanitizer. Another
purpuse of *_pic.a files can be constructing static PIE programs, however
they are not supported as of now and there is no sanitization of static
programs either.

Once MKSTATICPIE will be supported, it will be initially incompatible with
MKSANITIZER.

This change also makes it easier to build other targets like kernel and
kernel modules without userland sanitizers.

No functional change intended for MKSANITIZER=no users.


# 1.313 02-Jun-2018 christos

Sanitizers don't support static linking.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315
# 1.312 11-Mar-2018 mrg

define LIBXFONT2.


Revision tags: pgoyette-compat-base
# 1.311 25-Feb-2018 mrg

branches: 1.311.2;
add LIBKRB5_LDADD/LIBKRB5_DPADD and their static counterparts
to bsd.prog.mk. use them instead of hard coding various lists
of libraries for krb5.

this fixes static builds.


# 1.310 11-Dec-2017 christos

Instead of checking for obj existance which can be empty for shuttle-rule
programs, check for .sh sources.


# 1.309 10-Dec-2017 christos

don't try to build .debug files for shell scripts.


# 1.308 10-Oct-2017 christos

Add general {DP,LD}ADD.rump variables


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base
# 1.307 21-May-2017 riastradh

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.


# 1.306 21-May-2017 riastradh

Remove some vestiges of MKCRYPTO_IDEA/MKCRYPTO_MDC2.


# 1.305 21-May-2017 riastradh

Remove MKCRYPTO_RC5. Unconditionally include RC5 in libcrypto.so.

This option existed only because RC5 is covered by patents that, twenty
years ago, we had reason to suspect the patent holder, RSA, Inc., might
litigate. The two US patents in question are 5,724,428 and 5,835,600.

According to the USPTO Patent Term Calculator web site at
<https://www.uspto.gov/patent/laws-and-regulations/patent-term-calculator#heading-5>
(retrieved 2017-05-21), patents filed after 1995-06-07 expire twenty
years after the filing date.

number filing date
5,724,428 1995-11-01
5,835,600 1997-04-21

Thus, these patents appear to be expired.

As proposed on tech-crypto and tech-security:

https://mail-index.netbsd.org/tech-crypto/2017/05/05/msg000718.html
https://mail-index.netbsd.org/tech-security/2017/05/05/msg000927.html


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.304 19-Apr-2017 joerg

Add netpgpverify to the library list.


Revision tags: pgoyette-localcount-20170320
# 1.303 20-Feb-2017 rin

add missing LIBCXX


# 1.302 08-Feb-2017 kamil

libpthread_dbg(3) deletion from the base distribution

libpthread_dbg(3) is a remnant library from the M:N thread model
(pre-NetBSD-5.0) API to introspect threads within a process and for use
of debuggers.

Currently in the 1:1 model it's not used in GDB neither in LLDB and it's
not either planned to be used. It's current function to read pthread_t
structures is realizable within a regular debugger capable to
instrospect objects within a tracee (GDB, LLDB...).

Remaining users of this API can still use this library from
pkgsrc/devel/libpthread_dbg.

Sponsored by <The NetBSD Foundation>


# 1.301 29-Jan-2017 christos

add sqlite3 to statically linked libraries for pam.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914
# 1.300 20-Aug-2016 christos

branches: 1.300.2;
unbound additions


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.299 04-Apr-2016 joerg

branches: 1.299.2;
If the per-target LDSTATIC flag is set, don't include the PIE linker
flags as we currently don't support static PIE.


# 1.298 30-Mar-2016 martin

Pass -pie to cc, not -Wl,-pie. This way we have a chance to fix specs
for obscure corner cases like -pie -fPIE -static (used for
/usr/tests/lib/csu/h_initfini2 if building with MKPIE=yes).
While there also replace -fPIC with -fPIE for the PIE case, even if
it should be mostly equivalent.


# 1.297 12-Mar-2016 mrg

remove conditionals that are always true with GCC >= 4.8.


# 1.296 21-Feb-2016 christos

Add NODEBUG


# 1.295 31-Jan-2016 christos

Introduce NOPIE and NOCTF so that standalone programs build properly.


# 1.294 23-Jan-2016 christos

Define _KERNTYPES for things that need it.


# 1.293 07-Nov-2015 joerg

LIBEXECINFO


# 1.292 07-Jun-2015 matt

Make LIBCRT* depend on the right files if MLIBDIR from MKCOMPAT is defined.


# 1.291 01-Dec-2014 erh

PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilt
if any of their dependencies (i.e. the files they refer to) are changed.
This allows changes to transitive included headers to be handled properly.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.290 25-Mar-2014 ozaki-r

branches: 1.290.4;
Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.


Revision tags: riastradh-drm2-base3
# 1.289 09-Mar-2014 christos

let's see if the new dwarf library can handle dwarf 4


# 1.288 02-Mar-2014 christos

If we are compiling with -g and using gcc4.8 and dtrace downgrade
dwarf generation to version 2 for now.


# 1.287 15-Jan-2014 joerg

-Wl,-pie and -r don't agree with each other, so filter the former out.


# 1.286 11-Nov-2013 joerg

Relink binaries if crti.o changes.


# 1.285 29-Sep-2013 christos

Add libxcb


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.284 31-May-2013 mrg

add LIBX11_XCB; unfortunately since the library is named with a -
in it, we have to use an ugly hard coded assignment for now.
(could be cleaned up with more make variable magic i'm sure.)


# 1.283 04-Apr-2013 christos

ldopts should be before ldadd like everywhere else.


Revision tags: agc-symver-base
# 1.282 14-Feb-2013 christos

Since the libraries are produced with different MK flags than the programs,
we check for existance of the files instead of the MK flags.


# 1.281 14-Feb-2013 christos

Add PROGDPLIBS


# 1.280 26-Jan-2013 christos

CTFCONVERT me harder.


Revision tags: yamt-pagecache-base8
# 1.279 17-Jan-2013 christos

Now that we have separate debug sets, add -g if ${MKDEBUG} is set for
program builds since we don't need to install that symbol files.


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.278 24-Aug-2012 jmmv

branches: 1.278.2;
Allow DPADD to be specified on a per-program basis.


# 1.277 23-Aug-2012 joerg

Revert last, it breaks the tricks xsrc uses.


# 1.276 23-Aug-2012 joerg

Remove SHLIBINSTALLDIR and SHLINKINSTALLLIBDIR. Add rpath entries, if
SHLIBDIR differs from /usr/lib.


# 1.275 08-Aug-2012 christos

add MKRUMP by popular demand.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.274 29-Feb-2012 tron

Move "libexpat" from X11 into base which fixes PR lib/40346.
This change was approved by the Core Group.


# 1.273 21-Feb-2012 matt

Remove another ${SIZE}


# 1.272 20-Feb-2012 matt

Remove ${SIZE}


# 1.271 19-Feb-2012 matt

Add support for --combine with gcc.


Revision tags: netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2
# 1.270 05-Nov-2011 christos

branches: 1.270.2;
Add libtre


Revision tags: yamt-pagecache-base
# 1.269 16-Oct-2011 christos

branches: 1.269.2;
- no need to special-case libraries with weird characters.
- add a note about adding new libraries.


# 1.268 16-Oct-2011 christos

fix list of libraries to reflect reality.


# 1.267 10-Sep-2011 apb

Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.


# 1.266 27-Aug-2011 joerg

Add new "analyze" command to run clang's static analyzer in a directory
on all C/C++ files.


Revision tags: cherry-xenmp-base
# 1.265 26-Apr-2011 he

The new Heimdal adds -lwind and -lheimbase to the set of libraries,
so define the corresponding LIB* variables.
These are also needed in the PAM_STATIC_* variables, so add them there too.


# 1.264 11-Apr-2011 joerg

Adjust --sysroot related usage:
-Wl,-rpath does not expand =, so just drop it.

Drop -Wl,-rpath-link entries that duplicate the -Wl,-rpath entries, this
is done implicitly now that ld is built with sysroot support.

Use ${DESTDIR} explicitly for the remaining -Wl,-rpath-link entries.


# 1.263 10-Apr-2011 joerg

For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.


# 1.262 08-Mar-2011 jmmv

Revert previous (revision 1.261): it broke the build because PROG_CXX is
defined in terms of PROG, so later on we would end up with target duplicates
because both PROG_CXX and PROG were being converted to PROGS_CXX and PROGS.

Did not catch this earlier because the test build I did was not clean and
thus the duplicate targets did not have nasty effects.


# 1.261 07-Mar-2011 jmmv

Always convert PROG to its plural form independently of whether PROG_CXX
is defined or not. From Garrett Cooper in private mail.


Revision tags: bouyer-quota2-nbase
# 1.260 20-Feb-2011 jmmv

Define LIBATF_C and LIBATF_CXX to point to their corresponding .a files and
use these to properly set DPADD for test programs.


Revision tags: bouyer-quota2-base
# 1.259 13-Feb-2011 christos

add saslc


# 1.258 06-Feb-2011 joerg

Don't use -nostdinc or -nostdinc++ if this is included in a HOSTLIB.


# 1.257 17-Jan-2011 pooka

branches: 1.257.2;
Add rump bits to DPSRCS so that update builds work correctly.


Revision tags: matt-mips64-premerge-20101231
# 1.256 13-Dec-2010 pooka

befriend RUMPPRG with CRUNCHEDPRG


# 1.255 13-Dec-2010 pooka

Define RUMPPRG, which is just like PROG, except it additionally
builds a rump client with the name rump.${PROG}. The rump client
is not installed suid/sgid by default even if BINMODE is defined.


# 1.254 10-Dec-2010 joerg

Revert last, gcc(1) checks explicitly for -r on some platforms to disable
passing down --relax as well.


# 1.253 08-Dec-2010 joerg

gcc passes down -r directly to ld, so make it explicitly a linker option.


# 1.252 08-Dec-2010 joerg

Don't depend on ${CC} passing down -R to ld, use -Wl,-rpath explicitly.


# 1.251 08-Nov-2010 lukem

Preserve date on original shared library or program when stripping
the debug symbols and adding the debug-link to .debug.
Use '(rm -f file; false)' in the failure path to force failure.
Based on solution proposed by Nicolas Joly on tech-toolchain in July 2010.
Should fix PR toolchain/44046 from Andreas Gustafsson.


# 1.250 31-Oct-2010 mbalmer

Link Lua to the build and add the resulting files to the distribution sets.
Document the addition of Lua and the change we made to the default settings.


# 1.249 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.248 24-Apr-2010 lukem

When extracting separate debug symbols with MKDEBUG, there's no need
to leave the original file unstripped...


# 1.247 02-Mar-2010 darran

DTrace: Add CTF generation to the make framework. Only enabled when
MKDTRACE=yes.


# 1.246 14-Dec-2009 mrg

use "${CC} -r" not "${CC} -Wl,-r" as the latter fools GCC on some targets
and it ends up passing "-r -relax" to ld, which causes ld to barf.


# 1.245 14-Dec-2009 matt

Merge from matt-nb5-mips64


Revision tags: matt-premerge-20091211
# 1.244 08-Dec-2009 uebayasi

When PROGS / LIBS are used, you can pass each PROG / LIB specific parameters
to ${LD} via:

${LDADD.${PROG}}
${LDFLAGS.${PROG}}
${LDSTATIC.${PROG}}
${LDADD.${LIB}}
${LDFLAGS.${LIB}}

OTOH you can't pass parameters to ${CC}, because in suffix rules make(1) only
knows the name of ${.IMPSRC} and ${.TARGET}; it's users' responsivility to
define ${CC} parameters to all the sources of a given ${PROG} / ${LIB}.

Should address bin/42381.

(Bug in this commit log was pointed out by mrg@.)


# 1.243 27-Nov-2009 tsutsui

If CPPFLAGS or CXXFLAGS already contains -nostdinc or -nostdinc++,
don't add ${CPPFLAGS_ISYSTEM} or ${CPPFLAGS_ISYSTEMXX} to refer
${DESTDIR}/usr/include or ${DESTDIR}/usr/include/g++.

This change might cause errors on some MD stand dir, but in that case
each Makefile should be fixed to search proper system include paths
by -Ipath option in own CPPFLAGS.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.242 12-May-2009 plunky

remove libsdp as improved functionality has been enabled in libbluetooth.


# 1.241 10-Apr-2009 apb

Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links. They have no effect except when using a
metalog, in which case the information is added to the metalog. In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg. This should fix PR 24457 and PR 41155.


# 1.240 24-Nov-2008 cube

branches: 1.240.2;
Move cleanextra to the very ends in case another included file wants to add
to it even if it was initially empty.


Revision tags: netbsd-5-base matt-mips64-base2
# 1.239 19-Oct-2008 christos

branches: 1.239.2;
handle assembly files for MKPIE


# 1.238 16-Oct-2008 christos

Provide a way for a program to override the PIE flags.


# 1.237 15-Oct-2008 christos

don't compile/link libraries with pie


Revision tags: mjf-devfs2-base
# 1.236 02-Oct-2008 joerg

Hook up libfetch and pkg_install update.


Revision tags: wrstuden-revivesa-base-3
# 1.235 09-Sep-2008 joerg

Add MKSTRIPIDENT to remove the RCS IDs from binary programs and shared
libraries for space-constraint systems. The description is based on the
feedback of hubertf@, the logic on input from lukem@

This obsoletes the removal of LIBC_SCCS and SYSLIBC_SCCS for libc builds.


Revision tags: wrstuden-revivesa-base-2
# 1.234 28-Aug-2008 mrg

update a comment example


# 1.233 27-Aug-2008 rtr

use ${X11USRLIBDIR} instead of hard-coded /usr/X11R6/lib when building
${LIB.foo} vars


# 1.232 27-Aug-2008 lukem

Fix problem I introduced in rev 1.231 on 2008/08/25 where ${_PROGLDOPTS}
and -L${_GCC_LIBGCCDIR} were appearing in the link line before ${LDADD},
so -L${DESTDIR}/lib and -L${DESTDIR}/usr/lib were being used before
local -L library paths.
Fixes ntpd/ntpdate failure noticed by Valeriy E. Ushakov <uwe@NetBSD.org>


# 1.231 25-Aug-2008 lukem

Always link with: -Wl,-rpath-link,${DESTDIR}/usr/lib -L${DESTDIR}/usr/lib
Fixes problem with MKDYNAMICROOT=no triggered by libraries that depend
on other libraries.
Related to PR 33503.

Clean up setting of _CCLINK to always add the appropriate -B options.

Simplify the link rule for a program.


# 1.230 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.229 28-May-2008 lukem

add LIBLDAR_R (for completeness)


# 1.228 22-May-2008 lukem

Add MKLDAP, USE_LDAP, LIBLBER, LIBLDAP


Revision tags: hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-pf42-base
# 1.227 10-Apr-2008 tsutsui

branches: 1.227.2; 1.227.4;
Add libhx509 to PAM_STATIC_LDADD which is required by libkrb5.


# 1.226 22-Mar-2008 mlelstv

branches: 1.226.2;
Import Heimdal-1.1


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase matt-armv6-base hpcarm-cleanup-base
# 1.225 26-Dec-2007 jmmv

Make the clean target work when OBJS is set but PROG is not, as happens
for example in gnu/lib/crtstuff4. Reported by drochner@.


Revision tags: cube-autoconf-base
# 1.224 13-Nov-2007 jmmv

Fix typo that prevented MKDEBUG builds to work. Found by drochner@.


# 1.223 12-Nov-2007 jmmv

Add the ability to build multiple programs from a single directory

This adds support for a new set of variables, PROGS and PROGS_CXX, that
allow the developer to build multiple different programs from a single
source directory.


# 1.222 04-Nov-2007 tls

Remove MKPRIVATELIB from BIND libraries; move library reachover
directories and Makefiles from src/usr.sbin/bind to src/lib; make
BIND libraries build shared. Saves about 1MB-1.5MB per installed
executable, about 5MB for a base+etc minimal installation of NetBSD.


Revision tags: matt-mips64-base
# 1.221 29-Jul-2007 joerg

branches: 1.221.4; 1.221.6;
Add build glue for libarchive and update the various sets.


# 1.220 25-Jan-2007 perry

Before I completely forget the issue, convert "PROG_PAX" to the
better-named "PAXCTL_FLAGS".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.219 11-Nov-2006 christos

don't run paxctl if other commands were specified for that target.


# 1.218 10-Nov-2006 christos

if ${PROG_PAX} is defined, run paxctl on the binary after linking with
the value of the variable. This way, if you set:

PROG_PAX=+M

in /etc/mk.conf, you get what you deserve.


# 1.217 22-Oct-2006 pooka

libpuffs


# 1.216 09-Oct-2006 mrg

- clean up some comments to reality.
- retire LIBDCK, LIBG2C and (long broken) USE_LIBSTDCXX
- in bsd.hostprog.mk's LIBSTDCPP -> LIBSTDCC
- add LIBSUPCXX
- don't default USE_LIBSTDCXX or USE_GCC4 since they are
not used in the tree any where
- same with USE_XF86_4; retire it
- remove _SUPCXX handling in bsd.prog.mk

inspired by PR#26714.


Revision tags: abandoned-netbsd-4-base
# 1.215 23-Jul-2006 lukem

Implement MKDEBUG:
If "no", don't build and install separate debugging symbols
into /usr/libdata/debug.
Default: no


# 1.214 19-Jun-2006 gdamore

Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.


# 1.213 09-Jun-2006 christos

PR/33681: Scott Ellis: Building 'bc' with SHAREDSTRINGS=yes fails
We need CPPFLAGS too now.


# 1.212 11-May-2006 mrg

add support for ${OBJCOPTS} and ${OBJCOPTS}.<lib|prog|fn>.


# 1.211 20-Mar-2006 christos

There is always one more KRB4 thing to remove. (from Jukka Salmi)


# 1.210 20-Mar-2006 christos

Remove krb4 variables and libraries (Jukka Salmi)


# 1.209 16-Mar-2006 jwise

Now that we have real build system support for syspkgs, remove someone's
half-implemented idea of building `syspkgs' (really a few giant blobs of the
same granularity of the old sets) using install(1).


# 1.208 20-Jan-2006 christos

Add the world of libraries to the static pam build. Now static pam binaries
work.


# 1.207 09-Apr-2005 dsl

Report when we link a program into xxx.ro (before being crunched)


Revision tags: netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.206 04-Mar-2005 he

branches: 1.206.2; 1.206.4;
Introduce PAM_STATIC_LDADD and PAM_STATIC_DPADD. When compiling
with MKPIC=no, possibly because the target does not support shared
libraries, these include libraries required to resolve all symbols
which end up referenced from PAM-using applications. The libraries
presently required are -lcrypt, -lrpcsvc and -lutil.

Add use of these variables which are currently set up to use PAM,
so that they compile when MKPIC=no.

Also, in the telnetd case, reorder the order of the libraries, so
that libtelnet.a comes before -ltermcap and -lutil, again to fix
link error when MKPIC=no.

Discussed with thorpej and christos.


# 1.205 20-Feb-2005 christos

Add libradius


# 1.204 12-Jan-2005 lukem

If RESCUEDIR is defined, automatically add that to CPPFLAGS


# 1.203 08-Jan-2005 lukem

Implement <bsd.prog.mk> vars:
LIBASN1 LIBBSDMALLOC LIBG2C LIBPAM LIBSSH


# 1.202 04-Aug-2004 lukem

Revert most of previous, and move the LIB<libname>?= assignments
back to bsd.prog.mk from bsd.own.mk.

pkgsrc uses <bsd.own.mk>, and setting LIB<libname> in it causes
problems with various package builds.
This should fix PR #26542 submitted by Jim Bernard.

(I'll be implementing the DPADD for shared libraries in a different
manner that generally won't depend upon ${LIB<libname>}.)


# 1.201 30-Jul-2004 lukem

Move the LIB<libname>?= assignments from bsd.prog.mk to bsd.own.mk so
that they may be used by non PROGs (e.g., LIBs).

Improve some comments.


# 1.200 10-Jun-2004 lukem

Be consistent in handling YHEADER, similar to Christos' fix in bsd.lib.mk 1.253


# 1.199 21-May-2004 ross

If you add a library, you need to define its DPADD symbol here.

Add LIBMAGIC.


Revision tags: netbsd-2-0-base
# 1.198 15-Feb-2004 skrll

branches: 1.198.2;
Be more gcc like in the way we deal with libgcc so that sh3/hppa millicode
and exception handling have a chance of working properly.

- creates libgcc, libgcc_eh and libgcc_s

- updates LIBGCC_SPEC to use them appropriately.

There's a hack in here at the moment with respect to libgcc_so in that it
is preferable to link against libgcc_so will only when -shared-libgcc is
specified (the c++ frontend does this automatically.) Configurations where
LINK_EH_SPEC is defined already do this. The gcc configuration for
NetBSD/alpha and another NetBSD platform (I forget which) actually define
LINK_EH_SPEC probably by accident rather than design.

- updates share/mk to use the compiler's knowledge of what needs linking into
libraries and executables. This removes an hppa hack.

- updates the sets for the newly created libgcc* files.

- support for linking against the _pg version of libgcc has been removed.


# 1.197 29-Jan-2004 lukem

Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.


# 1.196 27-Jan-2004 lukem

Replace
:M-[IDU]*
with
:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)


# 1.195 23-Jan-2004 simonb

crt0.o lives in /usr/lib even on a.out.


# 1.194 16-Nov-2003 lukem

simplify with _MKTARGET_LINK


# 1.193 11-Nov-2003 dsl

Set MKDEP_SUFFIXES to get additional targets in .depend instead of using
sed in .afterdepend. I don't think .afterdepend is used anywhere any more.


# 1.192 21-Oct-2003 lukem

Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.


# 1.191 19-Oct-2003 lukem

Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} " ... {$.TARGET}" and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO


# 1.190 18-Oct-2003 lukem

Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command ("verbose")
This is the default, and is equivalent to the previous behaviour.


# 1.189 29-Sep-2003 lukem

Add LIBSTDCXX (for usr/lib/libstdc++.a).
Sync LIB* documentation with reality.


# 1.188 19-Sep-2003 martin

Drop explicit medlow model and default to -O2 for sparc64.


# 1.187 14-Sep-2003 lukem

Check ${SHLIBDIR} against "/usr/lib" instead of ${LIBDIR} when determining
if we need to add stuff (usually "/lib") to the rpath-link path before
"/usr/lib". Otherwise, this barfs if LIBDIR != /usr/lib or /lib, and
we're cross-building (e.g., in src/x11)


# 1.186 13-Sep-2003 erh

Also support per-program LDFLAGS and LDSTATIC.


# 1.185 13-Sep-2003 erh

Create a way to add additional flags to COPTS, CPPFLAGS, CXXFLAGS and LDADD
for particular libraries or programs by specifying the additions in mk.conf
instead of needing to go edit individual Makefiles.


# 1.184 12-Sep-2003 lukem

add infrastructure to support reach-over builds of xsrc


# 1.183 22-Aug-2003 dsl

Add a ${PROG}.ro target that does an 'ld -r' of the program object files.
Allows a much simplified build of 'crunched' binaries since crunchgen can
build prog.ro instead of having to deretmine the names of all the .o files.


# 1.182 01-Aug-2003 lukem

Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".


# 1.181 01-Aug-2003 lukem

simplify the ${PROG}: target to reduce duplication between the DESTDIR
and !DESTDIR cases...


# 1.180 31-Jul-2003 lukem

bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.


# 1.179 31-Jul-2003 lukem

Don't need -R/usr/lib; it will be searched at the end by ld.elf_so anyway.
Noted by matt green <mrg@>


# 1.178 28-Jul-2003 lukem

be consistent when adding *.y and *.l to DPSRCS


# 1.177 28-Jul-2003 lukem

replace MKCXXSUPCXX(!=no) with USE_LIBSTDCXX(==no)


# 1.176 28-Jul-2003 lukem

Change defined(CXX_SUPCXX) to MKCXXSUPCXX != "no".

Clarify that command-line overrides of the MKxxx variables should be
done via the environment rather than make(1) command-line variable
assignment, since the latter doesn't actually work as intended.


# 1.175 27-Jul-2003 mrg

introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes. for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)


# 1.174 26-Jul-2003 mrg

add a new bsd.own.mk variable: CXX_SUPCXX. from bsd.README:
+ CXX_SUPCXX If defined, the support libraries needed for this C++ program
+ are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.


# 1.173 20-Jul-2003 lukem

Consistently support the different C++ file extensions: .cc .cpp .cxx .C
Noted by Andrew White in PR toolchain/18246


# 1.172 18-Jul-2003 lukem

Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was defined.
Replace defined(UNPRIVED) tests with ${MKUNPRIVED} != "no"

Add MKUPDATE; if not no has the same semantics as if UPDATE was defined.
Replace defined(UPDATE) tests with ${MKUPDATE} != "no"

Improve documentation for these and other make flags.


# 1.171 16-Jul-2003 itojun

stop installing install libtelnet. build under lib/libtelnet and reference
it from usr.bin/telnet and libexec/telnetd.
(reason for separate build: compiler flags)


# 1.170 27-Jun-2003 drochner

For consistency, use "-R" instead of "-Wl,-rpath" to pass
a runtime search path to the linker.


# 1.169 13-Jun-2003 itojun

define LIBEVENT


# 1.168 11-Jun-2003 msaitoh

catch signal 1,2,3,13 and 15 to clean /tmp/_dependXXX


# 1.167 31-May-2003 thorpej

If EXTERNAL_TOOLCHAIN is defined, allow the compiler to define the
location of crt{begin,end}{,S}.o and libgcc.a. Encapsulate all of
this logic into the new bsd.gcc.mk, and use it in bsd.prog.mk and
bsd.lib.mk.


# 1.166 18-May-2003 lukem

make this a no-op if HOSTPROG is defined


# 1.165 30-Mar-2003 thorpej

If MACHINE_ARCH is powerpc and we HAVE_GCC3, add crtsaveres.o to the
endfile spec.


# 1.164 22-Feb-2003 uwe

Typo in comment.


# 1.163 24-Jan-2003 thorpej

Add LIBPTHREAD, LIBPTHREAD_DB, and LIBRT.


Revision tags: fvdl_fs64_base
# 1.162 22-Nov-2002 thorpej

Split crtbegin/crtend into crti/crtbegin/crtend/crtn. NetBSD-specific
things like the .note.netbsd.ident section are provided by crti/crtn.
crti/crtn also provide the _init() and _fini() routines.

crtbegin/crtend now only provide support for ctors/dtors. This paves
the way to using the "crtstuff" provided with GCC (when we upgrade to
GCC 3.3), which provides, among other things, much better C++/Java
exception handling.


# 1.161 12-Nov-2002 itohy

MKDYNAMICROOT for a.out


# 1.160 22-Oct-2002 perry

Pass 1 of SYSPKG changes to automatically add tags=pkgname_pkg to METALOG.
Not quite ready for prime time yet.


# 1.159 27-Sep-2002 thorpej

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.


# 1.158 26-Sep-2002 itojun

MDC2 is a patented algorithm; don't ship it in default libcrypto.
MKCRYPTO_MDC2 will build a separate library, libcrypto_mdc2.


# 1.157 08-Sep-2002 thorpej

Build a .gdbinit in the objdir when building a program. The .gdbinit
file sets the shared library prefix to ${DESTDIR}, and adds "sources"
directives for each file listed in the GDBINIT Makefile variable.


# 1.156 09-Aug-2002 thorpej

Add LIBPMC.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.155 27-Mar-2002 eeh

branches: 1.155.2;
Use the medium low model for sparc64 programs that don't 2GB of data segment.


# 1.154 11-Feb-2002 mycroft

Don't use .PHONY for targets that are actually installed. Instead use force
dependencies. (Among other things, `make -t install' does something vaguely
sensible now.)


# 1.153 07-Feb-2002 pk

Mark installed system libraries as .MADE only if we're actually establishing
their default variable values here.


# 1.152 04-Feb-2002 christos

s/.NOSUFF/.MADE/


# 1.151 03-Feb-2002 christos

Apply a .NOSUFF: directive to targets we don't want to have processed by
the suffix rules engine.


# 1.150 02-Feb-2002 veego

Ups, it is LIBUSBHID and not LIBUSBHIB.


# 1.149 02-Feb-2002 veego

Change LIBUSB to LIBUSBHIB, reflecting the library name change.


# 1.148 29-Jan-2002 enami

Mark the targets clean{extra,objs} as PHONY.


# 1.147 04-Jan-2002 thorpej

For PROG_CXX DESTDIR builds, pull in -lstdc++ and -lm regardless
of GCC version.


# 1.146 01-Jan-2002 thorpej

Per a suggestion from matthew green, PROG_CXX takes the place of
PROG for C++ programs.


# 1.145 01-Jan-2002 thorpej

* If PROG_CXX is set by the program's Makefile, use ${CXX} to link
the program rather than ${CC}.
* If HAVE_GCC3 is defined, pull in "-lstdc++ -lm" as additional C++
support libraries for DESTDIR builds.


# 1.144 28-Dec-2001 lukem

* 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


# 1.143 28-Nov-2001 tv

If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.


# 1.142 19-Nov-2001 thorpej

Use a little transitional hack to determine if we use -isystem
or -idirafter. Use the former only of USE_NEW_TOOLCHAIN, since
-isystem causes the old toolchain to bomb out when building
libstdc++.


# 1.141 14-Nov-2001 tv

C/..$/.c/ -> C/\..$/.c/


# 1.140 14-Nov-2001 tv

Move the DESTDIR-based nostdinc logic to bsd.lib.mk and bsd.prog.mk where
it belongs (with the native target compile rules).


# 1.139 02-Nov-2001 tv

Use INSTALL_FILE/INSTALL_DIR as appropriate.


# 1.138 02-Nov-2001 tv

Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.


# 1.137 19-Oct-2001 tv

Add .NOPATH for all files generated from .l or .y files in SRCS. Fixes PRs
bin/14187 and lib/14239.

Also simplify the handling of these transforms to .c and .h files a bit by
leveraging make's builtin macro operators.


# 1.136 25-Sep-2001 tv

Set .NOPATH on program to build to make sure it goes in .OBJDIR.
Problem noted by <seebs@plethora.net>.


# 1.135 24-Sep-2001 lukem

fix previous (hi thor!) - $OBJS and $CLEANFILES might be empty, and
rm needs some files to delete...


# 1.134 24-Sep-2001 tls

Split "cleanprog" target apart: now you can zap only object files or
CLEANFILES (needed to fix crunchgen lossage).


# 1.133 13-Sep-2001 thorpej

Add LIBPCI.


# 1.132 14-Aug-2001 tv

Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").


# 1.131 01-Jun-2001 tv

Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).


# 1.130 08-May-2001 sommerfeld

Suppress duplicate entries in ALLFILES, FILES, INCS, DEPINCS, INFOFILES,
NLSALL, CATPAGES, MANPAGES, HTMLPAGES, and SCRIPTS.


# 1.129 19-Feb-2001 jmc

Wrap target() checks around afterdepend rule as some Makefiles override this


# 1.128 26-Jan-2001 itojun

fix typo in LIBSSL decl. it made programs with DPADD+=${LIBSSL} to build
every time we type "make". From: bernd


# 1.127 14-Jan-2001 christos

use the new .if commands(<target>) directive so that we don't have to
change Makefiles.


# 1.126 14-Jan-2001 christos

fix thinko: test for the existance of the target before we define it...


# 1.125 14-Jan-2001 christos

Alter previous redefined target protection. If the ${PROG} target is defined,
add the dependencies as usual, but don't add the commands. This avoids
having to change all the Makefiles that redefine the PROG target.


# 1.124 14-Jan-2001 christos

allow programs to override the program target.


# 1.123 08-Jan-2001 mrg

add missing $LIBCRYPTO_RC5 and $LIBCRYPTO_IDEA


# 1.122 08-Jan-2001 mrg

add missing $LIBSSL


# 1.121 04-Jan-2001 garbled

Add LIBCDK and LIBFORM definitions


# 1.120 31-Oct-2000 itojun

add ${LIBINTL} for use with DPADD.


# 1.119 07-Oct-2000 deberg

fix typos, PR 11159


# 1.118 25-Jun-2000 erh

For the case when DESTDIR is set: move the -L${DESTDIR}/usr/lib after ${LDADD} so any -L directories set in LDADD are searched first to avoid possibly linking against old versions of libraries.


Revision tags: netbsd-1-5-base
# 1.117 19-Jun-2000 thorpej

branches: 1.117.2;
Sync up the LIB* list.


# 1.116 10-Jun-2000 mycroft

Use ${.ALLSRC:T} when doing the generated variable name lookups, so that it
DTRT for generated files in and obj directory (or accessed via .PATH).


# 1.115 06-Jun-2000 mycroft

Abuse .USE some more.


# 1.114 06-Jun-2000 mycroft

Minor rearrangement.


# 1.113 06-Jun-2000 mycroft

Use ODE make(1) features to eliminate extra variables and move several things
outside of .for loops. (Needs more work to completely eliminate .for.)

XXX Don't look at this stuff. It will make your head hurt.


Revision tags: minoura-xpg4dl-base
# 1.112 14-Apr-2000 mrg

branches: 1.112.2;
use -rpath-link rather than -R when linking objects using a DESTDIR.
this replaces the previous change as that ended up adding
$DESTDIR/usr/lib to the runtime path of every binary created, which
is bogus and dangerous.


# 1.111 25-Mar-2000 mycroft

When linking with $DESTDIR, use an explicit -R to get library dependencies
correct.


# 1.110 07-Mar-2000 veego

Remove unused libahdi.
It will be replaced in the future with a more generic libdisklabel.


# 1.109 05-Feb-2000 jdc

Add libahdi entries.


# 1.108 23-Jan-2000 eeh

Add some support for FCode binaries.


# 1.107 22-Jan-2000 mycroft

Make `dependall' play nicely with SUBDIR, using a hack similar to `realinstall'
for both `depend' and `all'.
Also, remove the old hack that invokes an extra shell for .depend, now that
make(1) has been fixed.


# 1.106 16-Jan-2000 assar

all: depend on ${SCRIPTS} so that they get generated if they need to


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.105 23-Nov-1999 blymn

Added libmenu library.


Revision tags: comdex-fall-1999-base
# 1.104 14-Sep-1999 perry

branches: 1.104.4;
Add a "dependall" target, which does a "make depend" and then "make all"
in a single directory. This is useful in "make build" because by doing
the build immediately after the depend, all sources will typically
still be in the buffer cache, thus saving significant time over doing
a "make depend" on all the directories and then a "make all".


# 1.103 04-Sep-1999 fredb

Permit "make all install", as well as "make foo install" (where foo would be
installed by "make install") without setting of BUILD. All cases where BUILD
is already set are unchanged from the old behavior.

"make all install" is now practically equivalent to "make BUILD= all install",
but without actually setting build.

Fixes pr's 8313, 3894.


# 1.102 21-Aug-1999 simonb

Add ${INSTPRIV} to ${INSTALL} commands.


# 1.101 01-Jul-1999 itojun

branches: 1.101.2;
add LIBIPSEC for use from DPADD.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.100 12-Feb-1999 lukem

branches: 1.100.2;
* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.99 10-Feb-1999 tv

libbfd_pic.a is no longer installed; remove ${LIBBFD} define.


# 1.98 04-Feb-1999 christos

PR/2936: Brian C. Grayson: Avoid truncating precious files when installing
and the filesystem is full. Added ${RENAME} flag to install, which when set
to -r installs on a temporary file and then renames to the final destination.
${RENAME} is currently set to nothing in bsd.own.mk, but one can turn it
on in /etc/mk.conf.


# 1.97 07-Nov-1998 jonathan

Do DESTDIR support for crtbegin/crtend on all ELF ports (adds mips).


# 1.96 28-Sep-1998 christos

Use preserve flag in install.


# 1.95 10-Sep-1998 ross

Define a LIBBZ2?=... for use in DPADD=... lines.


# 1.94 09-Aug-1998 lukem

add distclean as a synonym for cleandir


# 1.93 09-Apr-1998 tv

.y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.


# 1.92 01-Apr-1998 tv

Revert. This broke too much in the build tree, and a better solution
needs to be created. (The existing situation breaks a lot too.)


# 1.91 01-Apr-1998 tv

Fix .y rules to DTRT with possibly generated .h files. See mail on
tech-toolchain for a very detailed explanation of this. In short, add
a .y.h rule identical to the .y.c rule and make the .y.c rule rename
the .h file; also, clean the .h file in CLEANFILES.


# 1.90 03-Nov-1997 cgd

echo the lint command line when making 'lint'.


# 1.89 28-Oct-1997 lukem

add ${LIBOBJC}


Revision tags: netbsd-1-3-base
# 1.88 11-Oct-1997 mycroft

branches: 1.88.2;
Several changes:
* Allow bsd.man.mk to be included separately.
* Always include bsd.own.mk and bsd.obj.mk.
* Include bsd.man.mk and bsd.nls.mk even if NOMAN or NONLS; just turn off
building of the affected files instead.
* Require bsd.subdir.mk to be included explicitly.
(Will make appropriate changes to Makefiles shortly.)


# 1.87 29-Sep-1997 gwr

Add $LIBBFD


# 1.86 31-May-1997 cjs

Back out BUILDDIR and NOINSTALL changes.


# 1.85 26-May-1997 cjs

branches: 1.85.2;
These updates to the build allow building against include files
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.


# 1.84 18-May-1997 kleink

Add libposix.


# 1.83 17-May-1997 mycroft

Do LINKS and SYMLINKS after FILES and INCS.


# 1.82 17-May-1997 mycroft

Remove unneeded .SUFFIXES lines, and move .s and .S closer to .o to give the
right preferences.


# 1.81 09-May-1997 mycroft

Fix typo in previous.


# 1.80 09-May-1997 mycroft

Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.79 09-May-1997 mycroft

Remove cruft.


# 1.78 09-May-1997 mycroft

Oops; rearrange dependencies to get things built early enough.


# 1.77 09-May-1997 mycroft

Make sure INCS and SRCS are built if necessary.


# 1.76 08-May-1997 gwr

Set the .NOPATH flag for ${OBJS} (from Christos).


# 1.75 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.74 07-May-1997 mycroft

Various simplifications.


# 1.73 07-May-1997 mycroft

Shuffle some .PHONYs around, to work better with `-t'.


# 1.72 06-May-1997 mycroft

Make most of the install targets .PRECIOUS.


# 1.71 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.70 18-Apr-1997 christos

Add ${LIBNTP}


# 1.69 17-Apr-1997 thorpej

- Properly depend on crtbegin.o and crtend.o for platforms that use
them (currently Alpha and PowerPC)
- STRIP -> STRIPFLAG


# 1.68 03-Apr-1997 mikel

don't allow override of all: target


# 1.67 29-Mar-1997 mikel

merge lite-2 changes (mostly SCCSids)


# 1.66 27-Mar-1997 christos

Put the FILES generated rules in a separate .mk file since both bsd.prog.mk
and bsd.lib.mk use them.


# 1.65 27-Mar-1997 mycroft

Make the SCRIPTS case mimic the FILES case more closely, so we can override
the destination direectory, etc.


# 1.64 27-Mar-1997 mycroft

Remove knowledge of HIDEGAME from here.


# 1.63 24-Mar-1997 christos

make rules update:
- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation


# 1.62 22-Mar-1997 perry

Fix SYMLINKS not to include DESTDIR in the link itself


# 1.61 13-Mar-1997 perry

add SYMLINKS, by analogy to LINKS. Vetted by Christos.


# 1.60 22-Jan-1997 cgd

if 'clean' is not already defined, rather than simply defining it with
a bunch of rules, define a clean{kmod,lib,prog} target with the rules,
and have both clean and cleandir depend on that. That eliminates a bug
where 'cleandir' in a directory which included e.g. bsd.prog.mk but which
also had subdirs would 'make clean' all the subdirs and then 'make cleandir'
all ofthe subdirs. It also allows Makefiles to add more dependencies
to 'clean' after inclusion of the make template.

If 'clean' is already defined, the behaviour is the same as it used to be.


# 1.59 20-Dec-1996 cgd

add an afterdepend target (a la the one in bsd.lib.mk) that processes
the .depend file to add <filename>.ln for each <filename>.o as an
object file which has the given dependencies (in addition to
<filename>.po and <filename>.so, which were already there).


# 1.58 13-Dec-1996 mikel

add missing LIBPCAP definition.


# 1.57 26-Nov-1996 mrg

add libz and libwrap


# 1.56 18-Oct-1996 thorpej

Use ${INSTALL} rather than "install".
From Simon J. Gerraty <sjg@zen.void.oz.au>, PR #1458.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.55 08-Apr-1996 jtc

Sort LIBFOO definitions and add LIBY; Reported by Mike Long <mike.long@analog.com> in PR #2301.


# 1.54 22-Oct-1995 christos

Added include file <bsd.sys.mk> that contains lex and yacc "parallel aware"
rules. These rules are not turned on by default; they are enabled by setting
the PARALLEL variable.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.53 25-Jun-1995 cgd

oops; fix an rm that might be empty


# 1.52 24-Jun-1995 cgd

update lint rules, but keep linting disabled


# 1.51 10-Jun-1995 mycroft

Define LIBEDIT.


# 1.50 21-Apr-1995 jtc

.include <bsd.nls.mk> unless NONLS is defined.


# 1.49 22-Dec-1994 cgd

specify man pages differently, and document how.


# 1.48 24-Aug-1994 mycroft

Include bsd.own.mk earlier.


# 1.47 20-Jul-1994 cgd

fix from christos, for progs w/o objects


Revision tags: netbsd-1-0-base
# 1.46 06-Jul-1994 mycroft

branches: 1.46.2;
Pull libraries from ${DESTDIR} if set. Kill LDONLY, which is unused and
probably not useful anyway.


# 1.45 30-Jun-1994 cgd

fix modify-info-nothingness-then-substitute probelm that broke genclass build


# 1.44 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.43 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.42 28-Jun-1994 jtc

Strip *.sh when constructing OBJS from SRCS.
This will allow us to clean up makefiles that build a script by munging
a template (uusched, genclass, neqn, etc.).


# 1.41 18-Jun-1994 cgd

don't chown the symlink, when HIDEGAME causes a symlink to be made to dm.
4.4-based FS code _follows_ the symlinks on a chown(2) call.


# 1.40 24-May-1994 cgd

fix the last to do the right thing for dependencies


# 1.39 24-May-1994 deraadt

LIBSKEY


# 1.38 22-May-1994 jtc

Single source file programs are now compiled into object files before they
are linked. This change halves the time it takes to rebuild all of the
NetBSD sources when only the C library is "touched"; but only takes about
one percent more disk space.


# 1.37 06-Apr-1994 chopps

relink (recompile) single source programs when crt0.o is updated.


# 1.36 24-Mar-1994 mycroft

Remove *.core on clean.


# 1.35 09-Feb-1994 cgd

kill install -d's.


# 1.34 28-Jan-1994 cgd

add LIBKVM


# 1.33 10-Nov-1993 cgd

librpc doesn't exist anymore


# 1.32 08-Nov-1993 cgd

ad LDSTATIC flag, so static linking can be made one-stop shopping.
use "setenv LDSTATIC" to make *everything* dynamically linked,
setenv LDSTATIC -static for everything statically linked, or unset
it for default behavior.


# 1.31 07-Oct-1993 cgd

LIBTERM pointed at nothing, but was meant to point to libtermcap.a...


# 1.30 07-Oct-1993 cgd

always define LIBCRYPT


# 1.29 17-Aug-1993 mycroft

Make sure we don't recurse into subdirectories if Makefile specified `install'
target. (It's usually blank and is specifically to avoid doing this...)


# 1.28 15-Aug-1993 mycroft

Automatically include bsd.subdir.mk for backward compatibility.


# 1.27 15-Aug-1993 mycroft

Don't automatically include bsd.subdir.mk in bsd.prog.mk and bsd.lib.mk.
Put back .MAIN in bsd.man.mk, and be careful not to include ../Makefile.inc
a second time.


# 1.26 15-Aug-1993 mycroft

Move man rules to sys.mk.
Use bsd.subdir.mk for building subdirectories.
Don't forget to remove x.cc and x.C when using SHAREDSTRINGS.
Make ${PROG} always depend on ${LIBCRT0}.
Don't duplicate code between cleandir and clean.
Move tags target to bsd.dep.mk.
Move STRIP to bsd.own.mk.
Remove redundant definitions of {BIN,MAN}{DIR,GRP,OWN,MODE}.
Move {LIB,DOC}{DIR,GRP,OWN,MODE} defaults to bsd.own.mk.


# 1.25 15-Aug-1993 mycroft

Abstract out dependency stuff, and add RCS identifiers.


# 1.24 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


# 1.23 10-Aug-1993 mycroft

Put LINKS handling in `install' target, so it's the last thing executed, and
happens even if `realinstall' is user-defined.


# 1.22 30-Jul-1993 mycroft

When generating a default OBJS, ignore .h files.


# 1.21 29-Jul-1993 mycroft

Don't print the `making ...' message if an obj dir already exists.
Also, a minor cleanup.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.20 17-Jul-1993 mycroft

Fix C++ dependencies for good. `make depend' is now done in two passes--one
of C files and one for C++ files. No need to specify `-+' in your Makefile,
as it is now done automatically.


# 1.19 17-Jul-1993 cgd

do c++ dependencies the right way...


# 1.18 17-Jul-1993 mycroft

Add suffix rules for C++ files.


# 1.17 04-Jun-1993 brezak

Add LIBRPCSVC variable.


# 1.16 02-Jun-1993 cgd

add ability to specify c++ dependencies, by setting CFLAGS+=-+ for
the dependency make.


# 1.15 26-Apr-1993 cgd

added definition for DPADD library variable LIBCRYPT.


# 1.14 26-Apr-1993 mycroft

Don't redefine `realinstall' target if already defined.


# 1.13 25-Apr-1993 mycroft

Link with LDFLAGS even if one source module.


# 1.12 25-Apr-1993 mycroft

Don't lose if we include bsd.prog.mk only to build man pages.


# 1.11 25-Apr-1993 mycroft

Fix error in last change. (Oops.)


# 1.10 25-Apr-1993 mycroft

Don't build man pages if NOMAN set.


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.9 09-Apr-1993 cgd

various changes to default make rules. from patch 101.
note that only the "sensible" changes in patch 101 are implemented.


# 1.8 08-Apr-1993 cgd

try to do the right thing, in terms making directories before we
install into them, and get the manpage cleans _OUT_ of "clean".
they don't belong there, only in cleandir, WFJ be damned.


# 1.7 08-Apr-1993 cgd

fixed typos...


# 1.6 08-Apr-1993 cgd

(silently) make sure we have directories before installing


# 1.5 04-Apr-1993 cgd

make LIBRPC point to the right place


# 1.4 27-Mar-1993 nate

Fixed the doc macros to call troff, eqn,and tbl instead of ditroff,
deqn, and dtbl.
Fixed make clean to remove the man pages (Bill fixed this in the distribution,
but not in the original source)
Changed install to leave the original file around, by using 'cp' instead of
'mv'. "install -c ..."


# 1.3 23-Mar-1993 cgd

made .CURDIR be absolute, not relative, thereby eliminating
the need for some of the makefile trickery when making objects,
and fixing a few .PATH bugs


# 1.2 22-Mar-1993 cgd

fixed "make obj" for cases when sources not in /usr/src/...
if sources not there, it now mkdirs obj, but some trickery
is necessary, to avoid deleting cwd.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.330 30-May-2020 christos

Make libuv private, requested by joerg@


# 1.329 24-May-2020 christos

Add libuv


Revision tags: phil-wifi-20200421 phil-wifi-20200411 phil-wifi-20200406
# 1.328 04-Apr-2020 christos

Linker semantics have changed; we now don't automatically link dependent
libraries from other DSO's. For example in /usr/bin/passwd:
ld: krb5_passwd.o: undefined reference to symbol \
'UI_UTIL_read_pw_string@@OPENSSL_1_1_0'
ld: /usr/obj/amd64-x86_64/release/lib/libcrypto.so.14: error adding symbols: \
DSO missing from command line


# 1.327 04-Apr-2020 christos

Fix kerberos libraries order


# 1.326 04-Apr-2020 christos

Add libgnuctf


# 1.325 03-Mar-2020 christos

Add fido and cbor


Revision tags: is-mlppp-base phil-wifi-20191119
# 1.324 18-Nov-2019 christos

Improve the script to check for installed libraries, and fix the wrong
names and obsolete libraries it found.


# 1.323 27-Aug-2019 kamil

Enhance the support of LLVM sanitizers

Define _REENTRANT for MKSANITIZER build. This is needed for at least stdio
code. This caused new build issued with duplicated symbols in few places
and rump kernel code picking different code paths borrowed from libc.
Handle all this in one go.

Add bsd.sanitizer.mk to share common code used by programs and libraries.

Switch from realall to beforeinstall target in .syms files. This is more
reliable in MKSANITIZER.


# 1.322 17-Aug-2019 kamil

Add PAXCTL_FLAG rules for MKSANITIZER

Add per-program rules to disable ASLR for ASan, TSan and MSan in all
sanitized programs. This flag is not needed for other supported sanitizers.

Without this change, sanitized init(8) dies early on startup.

Approach originally suggested by <joerg>


# 1.321 15-Aug-2019 kamil

Add SANITIZER_RENAME_CLASSES in bsd.prog.mk

This adds a more flexible version of SANITIZER_RENAME_SYMBOL.

New symbol allows to specify MKSANITIZER specific renames on per-file and
per-symbol basis.


# 1.320 10-Aug-2019 christos

Make the X11 library lists consistent again.


Revision tags: netbsd-9-base phil-wifi-20190609 pgoyette-compat-20190127
# 1.319 21-Jan-2019 christos

branches: 1.319.2;
Most of the mv operations are to move temporary files to their final place.
Some use -f, others don't. This can lead to spurious build failures when
the user performing the build changes. Centralize, and always use -f.


Revision tags: pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.318 12-Aug-2018 christos

fix broken library variable definitions (inconsistencies between
bsd.README and bsd.prog.mk)


Revision tags: pgoyette-compat-0728
# 1.317 25-Jul-2018 kamil

Introduce MKLIBCSANITIZER in the share/mk rules

Add flags that are required to build a program and a dynamically loaded
library.

Propagade LIBCSANITIZERFLAGS to CFLAGS and CXXFLAGS.

LDFLAGS is not changed on purpose, as a libcsanitizer is inside libc
and no external dependencies are needed.

Register NOLIBCSANITIZER, as certain distribution parts will need to be
skipped.


# 1.316 12-Jul-2018 maxv

Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.


Revision tags: phil-wifi-base
# 1.315 25-Jun-2018 kamil

branches: 1.315.2;
Add a framework for renaming symbols in libc&co for MKSANITIZER

A new keyword SANITIZER_RENAME_SYMBOL. It's a variable that has specified
a list of symbols to be renamed in a processor in order to remove naming
conflicts with public symbols in libc/m/pthread/rt.

This renaming will occur for libraries and programs.
A symbol with a conflicting 'name', will be renamed to '__mksanitizer_name'.

Based on an idea by <christos>


Revision tags: pgoyette-compat-0625
# 1.314 21-Jun-2018 kamil

Refactor MKSANITIZER flags in mk rules

Introduce a new variable SANITIZERFLAGS that contains all the sanitizer
specific flags. These flags are designed to be passed to CFLAGS, CXXFLAGS
and LDFLAGS.

Pass SANITIZERFLAGS in bsd.prog.mk rules to CFLAGS, CXXFLAGS and LDFLAGS.

Pass SANITIZERFLAGS in bsd.lib.mk rules to *_pic.a build flags. The *_pic.a
libraries are designed to construct .so libraries. All .so libraries with
few exceptions are expected to be prebuilt with a sanitizer. Another
purpuse of *_pic.a files can be constructing static PIE programs, however
they are not supported as of now and there is no sanitization of static
programs either.

Once MKSTATICPIE will be supported, it will be initially incompatible with
MKSANITIZER.

This change also makes it easier to build other targets like kernel and
kernel modules without userland sanitizers.

No functional change intended for MKSANITIZER=no users.


# 1.313 02-Jun-2018 christos

Sanitizers don't support static linking.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315
# 1.312 11-Mar-2018 mrg

define LIBXFONT2.


Revision tags: pgoyette-compat-base
# 1.311 25-Feb-2018 mrg

branches: 1.311.2;
add LIBKRB5_LDADD/LIBKRB5_DPADD and their static counterparts
to bsd.prog.mk. use them instead of hard coding various lists
of libraries for krb5.

this fixes static builds.


# 1.310 11-Dec-2017 christos

Instead of checking for obj existance which can be empty for shuttle-rule
programs, check for .sh sources.


# 1.309 10-Dec-2017 christos

don't try to build .debug files for shell scripts.


# 1.308 10-Oct-2017 christos

Add general {DP,LD}ADD.rump variables


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base
# 1.307 21-May-2017 riastradh

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.


# 1.306 21-May-2017 riastradh

Remove some vestiges of MKCRYPTO_IDEA/MKCRYPTO_MDC2.


# 1.305 21-May-2017 riastradh

Remove MKCRYPTO_RC5. Unconditionally include RC5 in libcrypto.so.

This option existed only because RC5 is covered by patents that, twenty
years ago, we had reason to suspect the patent holder, RSA, Inc., might
litigate. The two US patents in question are 5,724,428 and 5,835,600.

According to the USPTO Patent Term Calculator web site at
<https://www.uspto.gov/patent/laws-and-regulations/patent-term-calculator#heading-5>
(retrieved 2017-05-21), patents filed after 1995-06-07 expire twenty
years after the filing date.

number filing date
5,724,428 1995-11-01
5,835,600 1997-04-21

Thus, these patents appear to be expired.

As proposed on tech-crypto and tech-security:

https://mail-index.netbsd.org/tech-crypto/2017/05/05/msg000718.html
https://mail-index.netbsd.org/tech-security/2017/05/05/msg000927.html


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.304 19-Apr-2017 joerg

Add netpgpverify to the library list.


Revision tags: pgoyette-localcount-20170320
# 1.303 20-Feb-2017 rin

add missing LIBCXX


# 1.302 08-Feb-2017 kamil

libpthread_dbg(3) deletion from the base distribution

libpthread_dbg(3) is a remnant library from the M:N thread model
(pre-NetBSD-5.0) API to introspect threads within a process and for use
of debuggers.

Currently in the 1:1 model it's not used in GDB neither in LLDB and it's
not either planned to be used. It's current function to read pthread_t
structures is realizable within a regular debugger capable to
instrospect objects within a tracee (GDB, LLDB...).

Remaining users of this API can still use this library from
pkgsrc/devel/libpthread_dbg.

Sponsored by <The NetBSD Foundation>


# 1.301 29-Jan-2017 christos

add sqlite3 to statically linked libraries for pam.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914
# 1.300 20-Aug-2016 christos

branches: 1.300.2;
unbound additions


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.299 04-Apr-2016 joerg

branches: 1.299.2;
If the per-target LDSTATIC flag is set, don't include the PIE linker
flags as we currently don't support static PIE.


# 1.298 30-Mar-2016 martin

Pass -pie to cc, not -Wl,-pie. This way we have a chance to fix specs
for obscure corner cases like -pie -fPIE -static (used for
/usr/tests/lib/csu/h_initfini2 if building with MKPIE=yes).
While there also replace -fPIC with -fPIE for the PIE case, even if
it should be mostly equivalent.


# 1.297 12-Mar-2016 mrg

remove conditionals that are always true with GCC >= 4.8.


# 1.296 21-Feb-2016 christos

Add NODEBUG


# 1.295 31-Jan-2016 christos

Introduce NOPIE and NOCTF so that standalone programs build properly.


# 1.294 23-Jan-2016 christos

Define _KERNTYPES for things that need it.


# 1.293 07-Nov-2015 joerg

LIBEXECINFO


# 1.292 07-Jun-2015 matt

Make LIBCRT* depend on the right files if MLIBDIR from MKCOMPAT is defined.


# 1.291 01-Dec-2014 erh

PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilt
if any of their dependencies (i.e. the files they refer to) are changed.
This allows changes to transitive included headers to be handled properly.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.290 25-Mar-2014 ozaki-r

branches: 1.290.4;
Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.


Revision tags: riastradh-drm2-base3
# 1.289 09-Mar-2014 christos

let's see if the new dwarf library can handle dwarf 4


# 1.288 02-Mar-2014 christos

If we are compiling with -g and using gcc4.8 and dtrace downgrade
dwarf generation to version 2 for now.


# 1.287 15-Jan-2014 joerg

-Wl,-pie and -r don't agree with each other, so filter the former out.


# 1.286 11-Nov-2013 joerg

Relink binaries if crti.o changes.


# 1.285 29-Sep-2013 christos

Add libxcb


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.284 31-May-2013 mrg

add LIBX11_XCB; unfortunately since the library is named with a -
in it, we have to use an ugly hard coded assignment for now.
(could be cleaned up with more make variable magic i'm sure.)


# 1.283 04-Apr-2013 christos

ldopts should be before ldadd like everywhere else.


Revision tags: agc-symver-base
# 1.282 14-Feb-2013 christos

Since the libraries are produced with different MK flags than the programs,
we check for existance of the files instead of the MK flags.


# 1.281 14-Feb-2013 christos

Add PROGDPLIBS


# 1.280 26-Jan-2013 christos

CTFCONVERT me harder.


Revision tags: yamt-pagecache-base8
# 1.279 17-Jan-2013 christos

Now that we have separate debug sets, add -g if ${MKDEBUG} is set for
program builds since we don't need to install that symbol files.


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.278 24-Aug-2012 jmmv

branches: 1.278.2;
Allow DPADD to be specified on a per-program basis.


# 1.277 23-Aug-2012 joerg

Revert last, it breaks the tricks xsrc uses.


# 1.276 23-Aug-2012 joerg

Remove SHLIBINSTALLDIR and SHLINKINSTALLLIBDIR. Add rpath entries, if
SHLIBDIR differs from /usr/lib.


# 1.275 08-Aug-2012 christos

add MKRUMP by popular demand.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.274 29-Feb-2012 tron

Move "libexpat" from X11 into base which fixes PR lib/40346.
This change was approved by the Core Group.


# 1.273 21-Feb-2012 matt

Remove another ${SIZE}


# 1.272 20-Feb-2012 matt

Remove ${SIZE}


# 1.271 19-Feb-2012 matt

Add support for --combine with gcc.


Revision tags: netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2
# 1.270 05-Nov-2011 christos

branches: 1.270.2;
Add libtre


Revision tags: yamt-pagecache-base
# 1.269 16-Oct-2011 christos

branches: 1.269.2;
- no need to special-case libraries with weird characters.
- add a note about adding new libraries.


# 1.268 16-Oct-2011 christos

fix list of libraries to reflect reality.


# 1.267 10-Sep-2011 apb

Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.


# 1.266 27-Aug-2011 joerg

Add new "analyze" command to run clang's static analyzer in a directory
on all C/C++ files.


Revision tags: cherry-xenmp-base
# 1.265 26-Apr-2011 he

The new Heimdal adds -lwind and -lheimbase to the set of libraries,
so define the corresponding LIB* variables.
These are also needed in the PAM_STATIC_* variables, so add them there too.


# 1.264 11-Apr-2011 joerg

Adjust --sysroot related usage:
-Wl,-rpath does not expand =, so just drop it.

Drop -Wl,-rpath-link entries that duplicate the -Wl,-rpath entries, this
is done implicitly now that ld is built with sysroot support.

Use ${DESTDIR} explicitly for the remaining -Wl,-rpath-link entries.


# 1.263 10-Apr-2011 joerg

For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.


# 1.262 08-Mar-2011 jmmv

Revert previous (revision 1.261): it broke the build because PROG_CXX is
defined in terms of PROG, so later on we would end up with target duplicates
because both PROG_CXX and PROG were being converted to PROGS_CXX and PROGS.

Did not catch this earlier because the test build I did was not clean and
thus the duplicate targets did not have nasty effects.


# 1.261 07-Mar-2011 jmmv

Always convert PROG to its plural form independently of whether PROG_CXX
is defined or not. From Garrett Cooper in private mail.


Revision tags: bouyer-quota2-nbase
# 1.260 20-Feb-2011 jmmv

Define LIBATF_C and LIBATF_CXX to point to their corresponding .a files and
use these to properly set DPADD for test programs.


Revision tags: bouyer-quota2-base
# 1.259 13-Feb-2011 christos

add saslc


# 1.258 06-Feb-2011 joerg

Don't use -nostdinc or -nostdinc++ if this is included in a HOSTLIB.


# 1.257 17-Jan-2011 pooka

branches: 1.257.2;
Add rump bits to DPSRCS so that update builds work correctly.


Revision tags: matt-mips64-premerge-20101231
# 1.256 13-Dec-2010 pooka

befriend RUMPPRG with CRUNCHEDPRG


# 1.255 13-Dec-2010 pooka

Define RUMPPRG, which is just like PROG, except it additionally
builds a rump client with the name rump.${PROG}. The rump client
is not installed suid/sgid by default even if BINMODE is defined.


# 1.254 10-Dec-2010 joerg

Revert last, gcc(1) checks explicitly for -r on some platforms to disable
passing down --relax as well.


# 1.253 08-Dec-2010 joerg

gcc passes down -r directly to ld, so make it explicitly a linker option.


# 1.252 08-Dec-2010 joerg

Don't depend on ${CC} passing down -R to ld, use -Wl,-rpath explicitly.


# 1.251 08-Nov-2010 lukem

Preserve date on original shared library or program when stripping
the debug symbols and adding the debug-link to .debug.
Use '(rm -f file; false)' in the failure path to force failure.
Based on solution proposed by Nicolas Joly on tech-toolchain in July 2010.
Should fix PR toolchain/44046 from Andreas Gustafsson.


# 1.250 31-Oct-2010 mbalmer

Link Lua to the build and add the resulting files to the distribution sets.
Document the addition of Lua and the change we made to the default settings.


# 1.249 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.248 24-Apr-2010 lukem

When extracting separate debug symbols with MKDEBUG, there's no need
to leave the original file unstripped...


# 1.247 02-Mar-2010 darran

DTrace: Add CTF generation to the make framework. Only enabled when
MKDTRACE=yes.


# 1.246 14-Dec-2009 mrg

use "${CC} -r" not "${CC} -Wl,-r" as the latter fools GCC on some targets
and it ends up passing "-r -relax" to ld, which causes ld to barf.


# 1.245 14-Dec-2009 matt

Merge from matt-nb5-mips64


Revision tags: matt-premerge-20091211
# 1.244 08-Dec-2009 uebayasi

When PROGS / LIBS are used, you can pass each PROG / LIB specific parameters
to ${LD} via:

${LDADD.${PROG}}
${LDFLAGS.${PROG}}
${LDSTATIC.${PROG}}
${LDADD.${LIB}}
${LDFLAGS.${LIB}}

OTOH you can't pass parameters to ${CC}, because in suffix rules make(1) only
knows the name of ${.IMPSRC} and ${.TARGET}; it's users' responsivility to
define ${CC} parameters to all the sources of a given ${PROG} / ${LIB}.

Should address bin/42381.

(Bug in this commit log was pointed out by mrg@.)


# 1.243 27-Nov-2009 tsutsui

If CPPFLAGS or CXXFLAGS already contains -nostdinc or -nostdinc++,
don't add ${CPPFLAGS_ISYSTEM} or ${CPPFLAGS_ISYSTEMXX} to refer
${DESTDIR}/usr/include or ${DESTDIR}/usr/include/g++.

This change might cause errors on some MD stand dir, but in that case
each Makefile should be fixed to search proper system include paths
by -Ipath option in own CPPFLAGS.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.242 12-May-2009 plunky

remove libsdp as improved functionality has been enabled in libbluetooth.


# 1.241 10-Apr-2009 apb

Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links. They have no effect except when using a
metalog, in which case the information is added to the metalog. In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg. This should fix PR 24457 and PR 41155.


# 1.240 24-Nov-2008 cube

branches: 1.240.2;
Move cleanextra to the very ends in case another included file wants to add
to it even if it was initially empty.


Revision tags: netbsd-5-base matt-mips64-base2
# 1.239 19-Oct-2008 christos

branches: 1.239.2;
handle assembly files for MKPIE


# 1.238 16-Oct-2008 christos

Provide a way for a program to override the PIE flags.


# 1.237 15-Oct-2008 christos

don't compile/link libraries with pie


Revision tags: mjf-devfs2-base
# 1.236 02-Oct-2008 joerg

Hook up libfetch and pkg_install update.


Revision tags: wrstuden-revivesa-base-3
# 1.235 09-Sep-2008 joerg

Add MKSTRIPIDENT to remove the RCS IDs from binary programs and shared
libraries for space-constraint systems. The description is based on the
feedback of hubertf@, the logic on input from lukem@

This obsoletes the removal of LIBC_SCCS and SYSLIBC_SCCS for libc builds.


Revision tags: wrstuden-revivesa-base-2
# 1.234 28-Aug-2008 mrg

update a comment example


# 1.233 27-Aug-2008 rtr

use ${X11USRLIBDIR} instead of hard-coded /usr/X11R6/lib when building
${LIB.foo} vars


# 1.232 27-Aug-2008 lukem

Fix problem I introduced in rev 1.231 on 2008/08/25 where ${_PROGLDOPTS}
and -L${_GCC_LIBGCCDIR} were appearing in the link line before ${LDADD},
so -L${DESTDIR}/lib and -L${DESTDIR}/usr/lib were being used before
local -L library paths.
Fixes ntpd/ntpdate failure noticed by Valeriy E. Ushakov <uwe@NetBSD.org>


# 1.231 25-Aug-2008 lukem

Always link with: -Wl,-rpath-link,${DESTDIR}/usr/lib -L${DESTDIR}/usr/lib
Fixes problem with MKDYNAMICROOT=no triggered by libraries that depend
on other libraries.
Related to PR 33503.

Clean up setting of _CCLINK to always add the appropriate -B options.

Simplify the link rule for a program.


# 1.230 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.229 28-May-2008 lukem

add LIBLDAR_R (for completeness)


# 1.228 22-May-2008 lukem

Add MKLDAP, USE_LDAP, LIBLBER, LIBLDAP


Revision tags: hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-pf42-base
# 1.227 10-Apr-2008 tsutsui

branches: 1.227.2; 1.227.4;
Add libhx509 to PAM_STATIC_LDADD which is required by libkrb5.


# 1.226 22-Mar-2008 mlelstv

branches: 1.226.2;
Import Heimdal-1.1


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase matt-armv6-base hpcarm-cleanup-base
# 1.225 26-Dec-2007 jmmv

Make the clean target work when OBJS is set but PROG is not, as happens
for example in gnu/lib/crtstuff4. Reported by drochner@.


Revision tags: cube-autoconf-base
# 1.224 13-Nov-2007 jmmv

Fix typo that prevented MKDEBUG builds to work. Found by drochner@.


# 1.223 12-Nov-2007 jmmv

Add the ability to build multiple programs from a single directory

This adds support for a new set of variables, PROGS and PROGS_CXX, that
allow the developer to build multiple different programs from a single
source directory.


# 1.222 04-Nov-2007 tls

Remove MKPRIVATELIB from BIND libraries; move library reachover
directories and Makefiles from src/usr.sbin/bind to src/lib; make
BIND libraries build shared. Saves about 1MB-1.5MB per installed
executable, about 5MB for a base+etc minimal installation of NetBSD.


Revision tags: matt-mips64-base
# 1.221 29-Jul-2007 joerg

branches: 1.221.4; 1.221.6;
Add build glue for libarchive and update the various sets.


# 1.220 25-Jan-2007 perry

Before I completely forget the issue, convert "PROG_PAX" to the
better-named "PAXCTL_FLAGS".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.219 11-Nov-2006 christos

don't run paxctl if other commands were specified for that target.


# 1.218 10-Nov-2006 christos

if ${PROG_PAX} is defined, run paxctl on the binary after linking with
the value of the variable. This way, if you set:

PROG_PAX=+M

in /etc/mk.conf, you get what you deserve.


# 1.217 22-Oct-2006 pooka

libpuffs


# 1.216 09-Oct-2006 mrg

- clean up some comments to reality.
- retire LIBDCK, LIBG2C and (long broken) USE_LIBSTDCXX
- in bsd.hostprog.mk's LIBSTDCPP -> LIBSTDCC
- add LIBSUPCXX
- don't default USE_LIBSTDCXX or USE_GCC4 since they are
not used in the tree any where
- same with USE_XF86_4; retire it
- remove _SUPCXX handling in bsd.prog.mk

inspired by PR#26714.


Revision tags: abandoned-netbsd-4-base
# 1.215 23-Jul-2006 lukem

Implement MKDEBUG:
If "no", don't build and install separate debugging symbols
into /usr/libdata/debug.
Default: no


# 1.214 19-Jun-2006 gdamore

Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.


# 1.213 09-Jun-2006 christos

PR/33681: Scott Ellis: Building 'bc' with SHAREDSTRINGS=yes fails
We need CPPFLAGS too now.


# 1.212 11-May-2006 mrg

add support for ${OBJCOPTS} and ${OBJCOPTS}.<lib|prog|fn>.


# 1.211 20-Mar-2006 christos

There is always one more KRB4 thing to remove. (from Jukka Salmi)


# 1.210 20-Mar-2006 christos

Remove krb4 variables and libraries (Jukka Salmi)


# 1.209 16-Mar-2006 jwise

Now that we have real build system support for syspkgs, remove someone's
half-implemented idea of building `syspkgs' (really a few giant blobs of the
same granularity of the old sets) using install(1).


# 1.208 20-Jan-2006 christos

Add the world of libraries to the static pam build. Now static pam binaries
work.


# 1.207 09-Apr-2005 dsl

Report when we link a program into xxx.ro (before being crunched)


Revision tags: netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.206 04-Mar-2005 he

branches: 1.206.2; 1.206.4;
Introduce PAM_STATIC_LDADD and PAM_STATIC_DPADD. When compiling
with MKPIC=no, possibly because the target does not support shared
libraries, these include libraries required to resolve all symbols
which end up referenced from PAM-using applications. The libraries
presently required are -lcrypt, -lrpcsvc and -lutil.

Add use of these variables which are currently set up to use PAM,
so that they compile when MKPIC=no.

Also, in the telnetd case, reorder the order of the libraries, so
that libtelnet.a comes before -ltermcap and -lutil, again to fix
link error when MKPIC=no.

Discussed with thorpej and christos.


# 1.205 20-Feb-2005 christos

Add libradius


# 1.204 12-Jan-2005 lukem

If RESCUEDIR is defined, automatically add that to CPPFLAGS


# 1.203 08-Jan-2005 lukem

Implement <bsd.prog.mk> vars:
LIBASN1 LIBBSDMALLOC LIBG2C LIBPAM LIBSSH


# 1.202 04-Aug-2004 lukem

Revert most of previous, and move the LIB<libname>?= assignments
back to bsd.prog.mk from bsd.own.mk.

pkgsrc uses <bsd.own.mk>, and setting LIB<libname> in it causes
problems with various package builds.
This should fix PR #26542 submitted by Jim Bernard.

(I'll be implementing the DPADD for shared libraries in a different
manner that generally won't depend upon ${LIB<libname>}.)


# 1.201 30-Jul-2004 lukem

Move the LIB<libname>?= assignments from bsd.prog.mk to bsd.own.mk so
that they may be used by non PROGs (e.g., LIBs).

Improve some comments.


# 1.200 10-Jun-2004 lukem

Be consistent in handling YHEADER, similar to Christos' fix in bsd.lib.mk 1.253


# 1.199 21-May-2004 ross

If you add a library, you need to define its DPADD symbol here.

Add LIBMAGIC.


Revision tags: netbsd-2-0-base
# 1.198 15-Feb-2004 skrll

branches: 1.198.2;
Be more gcc like in the way we deal with libgcc so that sh3/hppa millicode
and exception handling have a chance of working properly.

- creates libgcc, libgcc_eh and libgcc_s

- updates LIBGCC_SPEC to use them appropriately.

There's a hack in here at the moment with respect to libgcc_so in that it
is preferable to link against libgcc_so will only when -shared-libgcc is
specified (the c++ frontend does this automatically.) Configurations where
LINK_EH_SPEC is defined already do this. The gcc configuration for
NetBSD/alpha and another NetBSD platform (I forget which) actually define
LINK_EH_SPEC probably by accident rather than design.

- updates share/mk to use the compiler's knowledge of what needs linking into
libraries and executables. This removes an hppa hack.

- updates the sets for the newly created libgcc* files.

- support for linking against the _pg version of libgcc has been removed.


# 1.197 29-Jan-2004 lukem

Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.


# 1.196 27-Jan-2004 lukem

Replace
:M-[IDU]*
with
:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)


# 1.195 23-Jan-2004 simonb

crt0.o lives in /usr/lib even on a.out.


# 1.194 16-Nov-2003 lukem

simplify with _MKTARGET_LINK


# 1.193 11-Nov-2003 dsl

Set MKDEP_SUFFIXES to get additional targets in .depend instead of using
sed in .afterdepend. I don't think .afterdepend is used anywhere any more.


# 1.192 21-Oct-2003 lukem

Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.


# 1.191 19-Oct-2003 lukem

Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} " ... {$.TARGET}" and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO


# 1.190 18-Oct-2003 lukem

Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command ("verbose")
This is the default, and is equivalent to the previous behaviour.


# 1.189 29-Sep-2003 lukem

Add LIBSTDCXX (for usr/lib/libstdc++.a).
Sync LIB* documentation with reality.


# 1.188 19-Sep-2003 martin

Drop explicit medlow model and default to -O2 for sparc64.


# 1.187 14-Sep-2003 lukem

Check ${SHLIBDIR} against "/usr/lib" instead of ${LIBDIR} when determining
if we need to add stuff (usually "/lib") to the rpath-link path before
"/usr/lib". Otherwise, this barfs if LIBDIR != /usr/lib or /lib, and
we're cross-building (e.g., in src/x11)


# 1.186 13-Sep-2003 erh

Also support per-program LDFLAGS and LDSTATIC.


# 1.185 13-Sep-2003 erh

Create a way to add additional flags to COPTS, CPPFLAGS, CXXFLAGS and LDADD
for particular libraries or programs by specifying the additions in mk.conf
instead of needing to go edit individual Makefiles.


# 1.184 12-Sep-2003 lukem

add infrastructure to support reach-over builds of xsrc


# 1.183 22-Aug-2003 dsl

Add a ${PROG}.ro target that does an 'ld -r' of the program object files.
Allows a much simplified build of 'crunched' binaries since crunchgen can
build prog.ro instead of having to deretmine the names of all the .o files.


# 1.182 01-Aug-2003 lukem

Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".


# 1.181 01-Aug-2003 lukem

simplify the ${PROG}: target to reduce duplication between the DESTDIR
and !DESTDIR cases...


# 1.180 31-Jul-2003 lukem

bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.


# 1.179 31-Jul-2003 lukem

Don't need -R/usr/lib; it will be searched at the end by ld.elf_so anyway.
Noted by matt green <mrg@>


# 1.178 28-Jul-2003 lukem

be consistent when adding *.y and *.l to DPSRCS


# 1.177 28-Jul-2003 lukem

replace MKCXXSUPCXX(!=no) with USE_LIBSTDCXX(==no)


# 1.176 28-Jul-2003 lukem

Change defined(CXX_SUPCXX) to MKCXXSUPCXX != "no".

Clarify that command-line overrides of the MKxxx variables should be
done via the environment rather than make(1) command-line variable
assignment, since the latter doesn't actually work as intended.


# 1.175 27-Jul-2003 mrg

introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes. for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)


# 1.174 26-Jul-2003 mrg

add a new bsd.own.mk variable: CXX_SUPCXX. from bsd.README:
+ CXX_SUPCXX If defined, the support libraries needed for this C++ program
+ are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.


# 1.173 20-Jul-2003 lukem

Consistently support the different C++ file extensions: .cc .cpp .cxx .C
Noted by Andrew White in PR toolchain/18246


# 1.172 18-Jul-2003 lukem

Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was defined.
Replace defined(UNPRIVED) tests with ${MKUNPRIVED} != "no"

Add MKUPDATE; if not no has the same semantics as if UPDATE was defined.
Replace defined(UPDATE) tests with ${MKUPDATE} != "no"

Improve documentation for these and other make flags.


# 1.171 16-Jul-2003 itojun

stop installing install libtelnet. build under lib/libtelnet and reference
it from usr.bin/telnet and libexec/telnetd.
(reason for separate build: compiler flags)


# 1.170 27-Jun-2003 drochner

For consistency, use "-R" instead of "-Wl,-rpath" to pass
a runtime search path to the linker.


# 1.169 13-Jun-2003 itojun

define LIBEVENT


# 1.168 11-Jun-2003 msaitoh

catch signal 1,2,3,13 and 15 to clean /tmp/_dependXXX


# 1.167 31-May-2003 thorpej

If EXTERNAL_TOOLCHAIN is defined, allow the compiler to define the
location of crt{begin,end}{,S}.o and libgcc.a. Encapsulate all of
this logic into the new bsd.gcc.mk, and use it in bsd.prog.mk and
bsd.lib.mk.


# 1.166 18-May-2003 lukem

make this a no-op if HOSTPROG is defined


# 1.165 30-Mar-2003 thorpej

If MACHINE_ARCH is powerpc and we HAVE_GCC3, add crtsaveres.o to the
endfile spec.


# 1.164 22-Feb-2003 uwe

Typo in comment.


# 1.163 24-Jan-2003 thorpej

Add LIBPTHREAD, LIBPTHREAD_DB, and LIBRT.


Revision tags: fvdl_fs64_base
# 1.162 22-Nov-2002 thorpej

Split crtbegin/crtend into crti/crtbegin/crtend/crtn. NetBSD-specific
things like the .note.netbsd.ident section are provided by crti/crtn.
crti/crtn also provide the _init() and _fini() routines.

crtbegin/crtend now only provide support for ctors/dtors. This paves
the way to using the "crtstuff" provided with GCC (when we upgrade to
GCC 3.3), which provides, among other things, much better C++/Java
exception handling.


# 1.161 12-Nov-2002 itohy

MKDYNAMICROOT for a.out


# 1.160 22-Oct-2002 perry

Pass 1 of SYSPKG changes to automatically add tags=pkgname_pkg to METALOG.
Not quite ready for prime time yet.


# 1.159 27-Sep-2002 thorpej

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.


# 1.158 26-Sep-2002 itojun

MDC2 is a patented algorithm; don't ship it in default libcrypto.
MKCRYPTO_MDC2 will build a separate library, libcrypto_mdc2.


# 1.157 08-Sep-2002 thorpej

Build a .gdbinit in the objdir when building a program. The .gdbinit
file sets the shared library prefix to ${DESTDIR}, and adds "sources"
directives for each file listed in the GDBINIT Makefile variable.


# 1.156 09-Aug-2002 thorpej

Add LIBPMC.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.155 27-Mar-2002 eeh

branches: 1.155.2;
Use the medium low model for sparc64 programs that don't 2GB of data segment.


# 1.154 11-Feb-2002 mycroft

Don't use .PHONY for targets that are actually installed. Instead use force
dependencies. (Among other things, `make -t install' does something vaguely
sensible now.)


# 1.153 07-Feb-2002 pk

Mark installed system libraries as .MADE only if we're actually establishing
their default variable values here.


# 1.152 04-Feb-2002 christos

s/.NOSUFF/.MADE/


# 1.151 03-Feb-2002 christos

Apply a .NOSUFF: directive to targets we don't want to have processed by
the suffix rules engine.


# 1.150 02-Feb-2002 veego

Ups, it is LIBUSBHID and not LIBUSBHIB.


# 1.149 02-Feb-2002 veego

Change LIBUSB to LIBUSBHIB, reflecting the library name change.


# 1.148 29-Jan-2002 enami

Mark the targets clean{extra,objs} as PHONY.


# 1.147 04-Jan-2002 thorpej

For PROG_CXX DESTDIR builds, pull in -lstdc++ and -lm regardless
of GCC version.


# 1.146 01-Jan-2002 thorpej

Per a suggestion from matthew green, PROG_CXX takes the place of
PROG for C++ programs.


# 1.145 01-Jan-2002 thorpej

* If PROG_CXX is set by the program's Makefile, use ${CXX} to link
the program rather than ${CC}.
* If HAVE_GCC3 is defined, pull in "-lstdc++ -lm" as additional C++
support libraries for DESTDIR builds.


# 1.144 28-Dec-2001 lukem

* 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


# 1.143 28-Nov-2001 tv

If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.


# 1.142 19-Nov-2001 thorpej

Use a little transitional hack to determine if we use -isystem
or -idirafter. Use the former only of USE_NEW_TOOLCHAIN, since
-isystem causes the old toolchain to bomb out when building
libstdc++.


# 1.141 14-Nov-2001 tv

C/..$/.c/ -> C/\..$/.c/


# 1.140 14-Nov-2001 tv

Move the DESTDIR-based nostdinc logic to bsd.lib.mk and bsd.prog.mk where
it belongs (with the native target compile rules).


# 1.139 02-Nov-2001 tv

Use INSTALL_FILE/INSTALL_DIR as appropriate.


# 1.138 02-Nov-2001 tv

Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.


# 1.137 19-Oct-2001 tv

Add .NOPATH for all files generated from .l or .y files in SRCS. Fixes PRs
bin/14187 and lib/14239.

Also simplify the handling of these transforms to .c and .h files a bit by
leveraging make's builtin macro operators.


# 1.136 25-Sep-2001 tv

Set .NOPATH on program to build to make sure it goes in .OBJDIR.
Problem noted by <seebs@plethora.net>.


# 1.135 24-Sep-2001 lukem

fix previous (hi thor!) - $OBJS and $CLEANFILES might be empty, and
rm needs some files to delete...


# 1.134 24-Sep-2001 tls

Split "cleanprog" target apart: now you can zap only object files or
CLEANFILES (needed to fix crunchgen lossage).


# 1.133 13-Sep-2001 thorpej

Add LIBPCI.


# 1.132 14-Aug-2001 tv

Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").


# 1.131 01-Jun-2001 tv

Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).


# 1.130 08-May-2001 sommerfeld

Suppress duplicate entries in ALLFILES, FILES, INCS, DEPINCS, INFOFILES,
NLSALL, CATPAGES, MANPAGES, HTMLPAGES, and SCRIPTS.


# 1.129 19-Feb-2001 jmc

Wrap target() checks around afterdepend rule as some Makefiles override this


# 1.128 26-Jan-2001 itojun

fix typo in LIBSSL decl. it made programs with DPADD+=${LIBSSL} to build
every time we type "make". From: bernd


# 1.127 14-Jan-2001 christos

use the new .if commands(<target>) directive so that we don't have to
change Makefiles.


# 1.126 14-Jan-2001 christos

fix thinko: test for the existance of the target before we define it...


# 1.125 14-Jan-2001 christos

Alter previous redefined target protection. If the ${PROG} target is defined,
add the dependencies as usual, but don't add the commands. This avoids
having to change all the Makefiles that redefine the PROG target.


# 1.124 14-Jan-2001 christos

allow programs to override the program target.


# 1.123 08-Jan-2001 mrg

add missing $LIBCRYPTO_RC5 and $LIBCRYPTO_IDEA


# 1.122 08-Jan-2001 mrg

add missing $LIBSSL


# 1.121 04-Jan-2001 garbled

Add LIBCDK and LIBFORM definitions


# 1.120 31-Oct-2000 itojun

add ${LIBINTL} for use with DPADD.


# 1.119 07-Oct-2000 deberg

fix typos, PR 11159


# 1.118 25-Jun-2000 erh

For the case when DESTDIR is set: move the -L${DESTDIR}/usr/lib after ${LDADD} so any -L directories set in LDADD are searched first to avoid possibly linking against old versions of libraries.


Revision tags: netbsd-1-5-base
# 1.117 19-Jun-2000 thorpej

branches: 1.117.2;
Sync up the LIB* list.


# 1.116 10-Jun-2000 mycroft

Use ${.ALLSRC:T} when doing the generated variable name lookups, so that it
DTRT for generated files in and obj directory (or accessed via .PATH).


# 1.115 06-Jun-2000 mycroft

Abuse .USE some more.


# 1.114 06-Jun-2000 mycroft

Minor rearrangement.


# 1.113 06-Jun-2000 mycroft

Use ODE make(1) features to eliminate extra variables and move several things
outside of .for loops. (Needs more work to completely eliminate .for.)

XXX Don't look at this stuff. It will make your head hurt.


Revision tags: minoura-xpg4dl-base
# 1.112 14-Apr-2000 mrg

branches: 1.112.2;
use -rpath-link rather than -R when linking objects using a DESTDIR.
this replaces the previous change as that ended up adding
$DESTDIR/usr/lib to the runtime path of every binary created, which
is bogus and dangerous.


# 1.111 25-Mar-2000 mycroft

When linking with $DESTDIR, use an explicit -R to get library dependencies
correct.


# 1.110 07-Mar-2000 veego

Remove unused libahdi.
It will be replaced in the future with a more generic libdisklabel.


# 1.109 05-Feb-2000 jdc

Add libahdi entries.


# 1.108 23-Jan-2000 eeh

Add some support for FCode binaries.


# 1.107 22-Jan-2000 mycroft

Make `dependall' play nicely with SUBDIR, using a hack similar to `realinstall'
for both `depend' and `all'.
Also, remove the old hack that invokes an extra shell for .depend, now that
make(1) has been fixed.


# 1.106 16-Jan-2000 assar

all: depend on ${SCRIPTS} so that they get generated if they need to


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.105 23-Nov-1999 blymn

Added libmenu library.


Revision tags: comdex-fall-1999-base
# 1.104 14-Sep-1999 perry

branches: 1.104.4;
Add a "dependall" target, which does a "make depend" and then "make all"
in a single directory. This is useful in "make build" because by doing
the build immediately after the depend, all sources will typically
still be in the buffer cache, thus saving significant time over doing
a "make depend" on all the directories and then a "make all".


# 1.103 04-Sep-1999 fredb

Permit "make all install", as well as "make foo install" (where foo would be
installed by "make install") without setting of BUILD. All cases where BUILD
is already set are unchanged from the old behavior.

"make all install" is now practically equivalent to "make BUILD= all install",
but without actually setting build.

Fixes pr's 8313, 3894.


# 1.102 21-Aug-1999 simonb

Add ${INSTPRIV} to ${INSTALL} commands.


# 1.101 01-Jul-1999 itojun

branches: 1.101.2;
add LIBIPSEC for use from DPADD.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.100 12-Feb-1999 lukem

branches: 1.100.2;
* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.99 10-Feb-1999 tv

libbfd_pic.a is no longer installed; remove ${LIBBFD} define.


# 1.98 04-Feb-1999 christos

PR/2936: Brian C. Grayson: Avoid truncating precious files when installing
and the filesystem is full. Added ${RENAME} flag to install, which when set
to -r installs on a temporary file and then renames to the final destination.
${RENAME} is currently set to nothing in bsd.own.mk, but one can turn it
on in /etc/mk.conf.


# 1.97 07-Nov-1998 jonathan

Do DESTDIR support for crtbegin/crtend on all ELF ports (adds mips).


# 1.96 28-Sep-1998 christos

Use preserve flag in install.


# 1.95 10-Sep-1998 ross

Define a LIBBZ2?=... for use in DPADD=... lines.


# 1.94 09-Aug-1998 lukem

add distclean as a synonym for cleandir


# 1.93 09-Apr-1998 tv

.y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.


# 1.92 01-Apr-1998 tv

Revert. This broke too much in the build tree, and a better solution
needs to be created. (The existing situation breaks a lot too.)


# 1.91 01-Apr-1998 tv

Fix .y rules to DTRT with possibly generated .h files. See mail on
tech-toolchain for a very detailed explanation of this. In short, add
a .y.h rule identical to the .y.c rule and make the .y.c rule rename
the .h file; also, clean the .h file in CLEANFILES.


# 1.90 03-Nov-1997 cgd

echo the lint command line when making 'lint'.


# 1.89 28-Oct-1997 lukem

add ${LIBOBJC}


Revision tags: netbsd-1-3-base
# 1.88 11-Oct-1997 mycroft

branches: 1.88.2;
Several changes:
* Allow bsd.man.mk to be included separately.
* Always include bsd.own.mk and bsd.obj.mk.
* Include bsd.man.mk and bsd.nls.mk even if NOMAN or NONLS; just turn off
building of the affected files instead.
* Require bsd.subdir.mk to be included explicitly.
(Will make appropriate changes to Makefiles shortly.)


# 1.87 29-Sep-1997 gwr

Add $LIBBFD


# 1.86 31-May-1997 cjs

Back out BUILDDIR and NOINSTALL changes.


# 1.85 26-May-1997 cjs

branches: 1.85.2;
These updates to the build allow building against include files
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.


# 1.84 18-May-1997 kleink

Add libposix.


# 1.83 17-May-1997 mycroft

Do LINKS and SYMLINKS after FILES and INCS.


# 1.82 17-May-1997 mycroft

Remove unneeded .SUFFIXES lines, and move .s and .S closer to .o to give the
right preferences.


# 1.81 09-May-1997 mycroft

Fix typo in previous.


# 1.80 09-May-1997 mycroft

Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.79 09-May-1997 mycroft

Remove cruft.


# 1.78 09-May-1997 mycroft

Oops; rearrange dependencies to get things built early enough.


# 1.77 09-May-1997 mycroft

Make sure INCS and SRCS are built if necessary.


# 1.76 08-May-1997 gwr

Set the .NOPATH flag for ${OBJS} (from Christos).


# 1.75 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.74 07-May-1997 mycroft

Various simplifications.


# 1.73 07-May-1997 mycroft

Shuffle some .PHONYs around, to work better with `-t'.


# 1.72 06-May-1997 mycroft

Make most of the install targets .PRECIOUS.


# 1.71 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.70 18-Apr-1997 christos

Add ${LIBNTP}


# 1.69 17-Apr-1997 thorpej

- Properly depend on crtbegin.o and crtend.o for platforms that use
them (currently Alpha and PowerPC)
- STRIP -> STRIPFLAG


# 1.68 03-Apr-1997 mikel

don't allow override of all: target


# 1.67 29-Mar-1997 mikel

merge lite-2 changes (mostly SCCSids)


# 1.66 27-Mar-1997 christos

Put the FILES generated rules in a separate .mk file since both bsd.prog.mk
and bsd.lib.mk use them.


# 1.65 27-Mar-1997 mycroft

Make the SCRIPTS case mimic the FILES case more closely, so we can override
the destination direectory, etc.


# 1.64 27-Mar-1997 mycroft

Remove knowledge of HIDEGAME from here.


# 1.63 24-Mar-1997 christos

make rules update:
- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation


# 1.62 22-Mar-1997 perry

Fix SYMLINKS not to include DESTDIR in the link itself


# 1.61 13-Mar-1997 perry

add SYMLINKS, by analogy to LINKS. Vetted by Christos.


# 1.60 22-Jan-1997 cgd

if 'clean' is not already defined, rather than simply defining it with
a bunch of rules, define a clean{kmod,lib,prog} target with the rules,
and have both clean and cleandir depend on that. That eliminates a bug
where 'cleandir' in a directory which included e.g. bsd.prog.mk but which
also had subdirs would 'make clean' all the subdirs and then 'make cleandir'
all ofthe subdirs. It also allows Makefiles to add more dependencies
to 'clean' after inclusion of the make template.

If 'clean' is already defined, the behaviour is the same as it used to be.


# 1.59 20-Dec-1996 cgd

add an afterdepend target (a la the one in bsd.lib.mk) that processes
the .depend file to add <filename>.ln for each <filename>.o as an
object file which has the given dependencies (in addition to
<filename>.po and <filename>.so, which were already there).


# 1.58 13-Dec-1996 mikel

add missing LIBPCAP definition.


# 1.57 26-Nov-1996 mrg

add libz and libwrap


# 1.56 18-Oct-1996 thorpej

Use ${INSTALL} rather than "install".
From Simon J. Gerraty <sjg@zen.void.oz.au>, PR #1458.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.55 08-Apr-1996 jtc

Sort LIBFOO definitions and add LIBY; Reported by Mike Long <mike.long@analog.com> in PR #2301.


# 1.54 22-Oct-1995 christos

Added include file <bsd.sys.mk> that contains lex and yacc "parallel aware"
rules. These rules are not turned on by default; they are enabled by setting
the PARALLEL variable.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.53 25-Jun-1995 cgd

oops; fix an rm that might be empty


# 1.52 24-Jun-1995 cgd

update lint rules, but keep linting disabled


# 1.51 10-Jun-1995 mycroft

Define LIBEDIT.


# 1.50 21-Apr-1995 jtc

.include <bsd.nls.mk> unless NONLS is defined.


# 1.49 22-Dec-1994 cgd

specify man pages differently, and document how.


# 1.48 24-Aug-1994 mycroft

Include bsd.own.mk earlier.


# 1.47 20-Jul-1994 cgd

fix from christos, for progs w/o objects


Revision tags: netbsd-1-0-base
# 1.46 06-Jul-1994 mycroft

branches: 1.46.2;
Pull libraries from ${DESTDIR} if set. Kill LDONLY, which is unused and
probably not useful anyway.


# 1.45 30-Jun-1994 cgd

fix modify-info-nothingness-then-substitute probelm that broke genclass build


# 1.44 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.43 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.42 28-Jun-1994 jtc

Strip *.sh when constructing OBJS from SRCS.
This will allow us to clean up makefiles that build a script by munging
a template (uusched, genclass, neqn, etc.).


# 1.41 18-Jun-1994 cgd

don't chown the symlink, when HIDEGAME causes a symlink to be made to dm.
4.4-based FS code _follows_ the symlinks on a chown(2) call.


# 1.40 24-May-1994 cgd

fix the last to do the right thing for dependencies


# 1.39 24-May-1994 deraadt

LIBSKEY


# 1.38 22-May-1994 jtc

Single source file programs are now compiled into object files before they
are linked. This change halves the time it takes to rebuild all of the
NetBSD sources when only the C library is "touched"; but only takes about
one percent more disk space.


# 1.37 06-Apr-1994 chopps

relink (recompile) single source programs when crt0.o is updated.


# 1.36 24-Mar-1994 mycroft

Remove *.core on clean.


# 1.35 09-Feb-1994 cgd

kill install -d's.


# 1.34 28-Jan-1994 cgd

add LIBKVM


# 1.33 10-Nov-1993 cgd

librpc doesn't exist anymore


# 1.32 08-Nov-1993 cgd

ad LDSTATIC flag, so static linking can be made one-stop shopping.
use "setenv LDSTATIC" to make *everything* dynamically linked,
setenv LDSTATIC -static for everything statically linked, or unset
it for default behavior.


# 1.31 07-Oct-1993 cgd

LIBTERM pointed at nothing, but was meant to point to libtermcap.a...


# 1.30 07-Oct-1993 cgd

always define LIBCRYPT


# 1.29 17-Aug-1993 mycroft

Make sure we don't recurse into subdirectories if Makefile specified `install'
target. (It's usually blank and is specifically to avoid doing this...)


# 1.28 15-Aug-1993 mycroft

Automatically include bsd.subdir.mk for backward compatibility.


# 1.27 15-Aug-1993 mycroft

Don't automatically include bsd.subdir.mk in bsd.prog.mk and bsd.lib.mk.
Put back .MAIN in bsd.man.mk, and be careful not to include ../Makefile.inc
a second time.


# 1.26 15-Aug-1993 mycroft

Move man rules to sys.mk.
Use bsd.subdir.mk for building subdirectories.
Don't forget to remove x.cc and x.C when using SHAREDSTRINGS.
Make ${PROG} always depend on ${LIBCRT0}.
Don't duplicate code between cleandir and clean.
Move tags target to bsd.dep.mk.
Move STRIP to bsd.own.mk.
Remove redundant definitions of {BIN,MAN}{DIR,GRP,OWN,MODE}.
Move {LIB,DOC}{DIR,GRP,OWN,MODE} defaults to bsd.own.mk.


# 1.25 15-Aug-1993 mycroft

Abstract out dependency stuff, and add RCS identifiers.


# 1.24 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


# 1.23 10-Aug-1993 mycroft

Put LINKS handling in `install' target, so it's the last thing executed, and
happens even if `realinstall' is user-defined.


# 1.22 30-Jul-1993 mycroft

When generating a default OBJS, ignore .h files.


# 1.21 29-Jul-1993 mycroft

Don't print the `making ...' message if an obj dir already exists.
Also, a minor cleanup.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.20 17-Jul-1993 mycroft

Fix C++ dependencies for good. `make depend' is now done in two passes--one
of C files and one for C++ files. No need to specify `-+' in your Makefile,
as it is now done automatically.


# 1.19 17-Jul-1993 cgd

do c++ dependencies the right way...


# 1.18 17-Jul-1993 mycroft

Add suffix rules for C++ files.


# 1.17 04-Jun-1993 brezak

Add LIBRPCSVC variable.


# 1.16 02-Jun-1993 cgd

add ability to specify c++ dependencies, by setting CFLAGS+=-+ for
the dependency make.


# 1.15 26-Apr-1993 cgd

added definition for DPADD library variable LIBCRYPT.


# 1.14 26-Apr-1993 mycroft

Don't redefine `realinstall' target if already defined.


# 1.13 25-Apr-1993 mycroft

Link with LDFLAGS even if one source module.


# 1.12 25-Apr-1993 mycroft

Don't lose if we include bsd.prog.mk only to build man pages.


# 1.11 25-Apr-1993 mycroft

Fix error in last change. (Oops.)


# 1.10 25-Apr-1993 mycroft

Don't build man pages if NOMAN set.


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.9 09-Apr-1993 cgd

various changes to default make rules. from patch 101.
note that only the "sensible" changes in patch 101 are implemented.


# 1.8 08-Apr-1993 cgd

try to do the right thing, in terms making directories before we
install into them, and get the manpage cleans _OUT_ of "clean".
they don't belong there, only in cleandir, WFJ be damned.


# 1.7 08-Apr-1993 cgd

fixed typos...


# 1.6 08-Apr-1993 cgd

(silently) make sure we have directories before installing


# 1.5 04-Apr-1993 cgd

make LIBRPC point to the right place


# 1.4 27-Mar-1993 nate

Fixed the doc macros to call troff, eqn,and tbl instead of ditroff,
deqn, and dtbl.
Fixed make clean to remove the man pages (Bill fixed this in the distribution,
but not in the original source)
Changed install to leave the original file around, by using 'cp' instead of
'mv'. "install -c ..."


# 1.3 23-Mar-1993 cgd

made .CURDIR be absolute, not relative, thereby eliminating
the need for some of the makefile trickery when making objects,
and fixing a few .PATH bugs


# 1.2 22-Mar-1993 cgd

fixed "make obj" for cases when sources not in /usr/src/...
if sources not there, it now mkdirs obj, but some trickery
is necessary, to avoid deleting cwd.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.329 24-May-2020 christos

Add libuv


Revision tags: phil-wifi-20200421 phil-wifi-20200411 phil-wifi-20200406
# 1.328 04-Apr-2020 christos

Linker semantics have changed; we now don't automatically link dependent
libraries from other DSO's. For example in /usr/bin/passwd:
ld: krb5_passwd.o: undefined reference to symbol \
'UI_UTIL_read_pw_string@@OPENSSL_1_1_0'
ld: /usr/obj/amd64-x86_64/release/lib/libcrypto.so.14: error adding symbols: \
DSO missing from command line


# 1.327 04-Apr-2020 christos

Fix kerberos libraries order


# 1.326 04-Apr-2020 christos

Add libgnuctf


# 1.325 03-Mar-2020 christos

Add fido and cbor


Revision tags: is-mlppp-base phil-wifi-20191119
# 1.324 18-Nov-2019 christos

Improve the script to check for installed libraries, and fix the wrong
names and obsolete libraries it found.


# 1.323 27-Aug-2019 kamil

Enhance the support of LLVM sanitizers

Define _REENTRANT for MKSANITIZER build. This is needed for at least stdio
code. This caused new build issued with duplicated symbols in few places
and rump kernel code picking different code paths borrowed from libc.
Handle all this in one go.

Add bsd.sanitizer.mk to share common code used by programs and libraries.

Switch from realall to beforeinstall target in .syms files. This is more
reliable in MKSANITIZER.


# 1.322 17-Aug-2019 kamil

Add PAXCTL_FLAG rules for MKSANITIZER

Add per-program rules to disable ASLR for ASan, TSan and MSan in all
sanitized programs. This flag is not needed for other supported sanitizers.

Without this change, sanitized init(8) dies early on startup.

Approach originally suggested by <joerg>


# 1.321 15-Aug-2019 kamil

Add SANITIZER_RENAME_CLASSES in bsd.prog.mk

This adds a more flexible version of SANITIZER_RENAME_SYMBOL.

New symbol allows to specify MKSANITIZER specific renames on per-file and
per-symbol basis.


# 1.320 10-Aug-2019 christos

Make the X11 library lists consistent again.


Revision tags: netbsd-9-base phil-wifi-20190609 pgoyette-compat-20190127
# 1.319 21-Jan-2019 christos

branches: 1.319.2;
Most of the mv operations are to move temporary files to their final place.
Some use -f, others don't. This can lead to spurious build failures when
the user performing the build changes. Centralize, and always use -f.


Revision tags: pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.318 12-Aug-2018 christos

fix broken library variable definitions (inconsistencies between
bsd.README and bsd.prog.mk)


Revision tags: pgoyette-compat-0728
# 1.317 25-Jul-2018 kamil

Introduce MKLIBCSANITIZER in the share/mk rules

Add flags that are required to build a program and a dynamically loaded
library.

Propagade LIBCSANITIZERFLAGS to CFLAGS and CXXFLAGS.

LDFLAGS is not changed on purpose, as a libcsanitizer is inside libc
and no external dependencies are needed.

Register NOLIBCSANITIZER, as certain distribution parts will need to be
skipped.


# 1.316 12-Jul-2018 maxv

Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.


Revision tags: phil-wifi-base
# 1.315 25-Jun-2018 kamil

branches: 1.315.2;
Add a framework for renaming symbols in libc&co for MKSANITIZER

A new keyword SANITIZER_RENAME_SYMBOL. It's a variable that has specified
a list of symbols to be renamed in a processor in order to remove naming
conflicts with public symbols in libc/m/pthread/rt.

This renaming will occur for libraries and programs.
A symbol with a conflicting 'name', will be renamed to '__mksanitizer_name'.

Based on an idea by <christos>


Revision tags: pgoyette-compat-0625
# 1.314 21-Jun-2018 kamil

Refactor MKSANITIZER flags in mk rules

Introduce a new variable SANITIZERFLAGS that contains all the sanitizer
specific flags. These flags are designed to be passed to CFLAGS, CXXFLAGS
and LDFLAGS.

Pass SANITIZERFLAGS in bsd.prog.mk rules to CFLAGS, CXXFLAGS and LDFLAGS.

Pass SANITIZERFLAGS in bsd.lib.mk rules to *_pic.a build flags. The *_pic.a
libraries are designed to construct .so libraries. All .so libraries with
few exceptions are expected to be prebuilt with a sanitizer. Another
purpuse of *_pic.a files can be constructing static PIE programs, however
they are not supported as of now and there is no sanitization of static
programs either.

Once MKSTATICPIE will be supported, it will be initially incompatible with
MKSANITIZER.

This change also makes it easier to build other targets like kernel and
kernel modules without userland sanitizers.

No functional change intended for MKSANITIZER=no users.


# 1.313 02-Jun-2018 christos

Sanitizers don't support static linking.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315
# 1.312 11-Mar-2018 mrg

define LIBXFONT2.


Revision tags: pgoyette-compat-base
# 1.311 25-Feb-2018 mrg

branches: 1.311.2;
add LIBKRB5_LDADD/LIBKRB5_DPADD and their static counterparts
to bsd.prog.mk. use them instead of hard coding various lists
of libraries for krb5.

this fixes static builds.


# 1.310 11-Dec-2017 christos

Instead of checking for obj existance which can be empty for shuttle-rule
programs, check for .sh sources.


# 1.309 10-Dec-2017 christos

don't try to build .debug files for shell scripts.


# 1.308 10-Oct-2017 christos

Add general {DP,LD}ADD.rump variables


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base
# 1.307 21-May-2017 riastradh

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.


# 1.306 21-May-2017 riastradh

Remove some vestiges of MKCRYPTO_IDEA/MKCRYPTO_MDC2.


# 1.305 21-May-2017 riastradh

Remove MKCRYPTO_RC5. Unconditionally include RC5 in libcrypto.so.

This option existed only because RC5 is covered by patents that, twenty
years ago, we had reason to suspect the patent holder, RSA, Inc., might
litigate. The two US patents in question are 5,724,428 and 5,835,600.

According to the USPTO Patent Term Calculator web site at
<https://www.uspto.gov/patent/laws-and-regulations/patent-term-calculator#heading-5>
(retrieved 2017-05-21), patents filed after 1995-06-07 expire twenty
years after the filing date.

number filing date
5,724,428 1995-11-01
5,835,600 1997-04-21

Thus, these patents appear to be expired.

As proposed on tech-crypto and tech-security:

https://mail-index.netbsd.org/tech-crypto/2017/05/05/msg000718.html
https://mail-index.netbsd.org/tech-security/2017/05/05/msg000927.html


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.304 19-Apr-2017 joerg

Add netpgpverify to the library list.


Revision tags: pgoyette-localcount-20170320
# 1.303 20-Feb-2017 rin

add missing LIBCXX


# 1.302 08-Feb-2017 kamil

libpthread_dbg(3) deletion from the base distribution

libpthread_dbg(3) is a remnant library from the M:N thread model
(pre-NetBSD-5.0) API to introspect threads within a process and for use
of debuggers.

Currently in the 1:1 model it's not used in GDB neither in LLDB and it's
not either planned to be used. It's current function to read pthread_t
structures is realizable within a regular debugger capable to
instrospect objects within a tracee (GDB, LLDB...).

Remaining users of this API can still use this library from
pkgsrc/devel/libpthread_dbg.

Sponsored by <The NetBSD Foundation>


# 1.301 29-Jan-2017 christos

add sqlite3 to statically linked libraries for pam.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914
# 1.300 20-Aug-2016 christos

branches: 1.300.2;
unbound additions


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.299 04-Apr-2016 joerg

branches: 1.299.2;
If the per-target LDSTATIC flag is set, don't include the PIE linker
flags as we currently don't support static PIE.


# 1.298 30-Mar-2016 martin

Pass -pie to cc, not -Wl,-pie. This way we have a chance to fix specs
for obscure corner cases like -pie -fPIE -static (used for
/usr/tests/lib/csu/h_initfini2 if building with MKPIE=yes).
While there also replace -fPIC with -fPIE for the PIE case, even if
it should be mostly equivalent.


# 1.297 12-Mar-2016 mrg

remove conditionals that are always true with GCC >= 4.8.


# 1.296 21-Feb-2016 christos

Add NODEBUG


# 1.295 31-Jan-2016 christos

Introduce NOPIE and NOCTF so that standalone programs build properly.


# 1.294 23-Jan-2016 christos

Define _KERNTYPES for things that need it.


# 1.293 07-Nov-2015 joerg

LIBEXECINFO


# 1.292 07-Jun-2015 matt

Make LIBCRT* depend on the right files if MLIBDIR from MKCOMPAT is defined.


# 1.291 01-Dec-2014 erh

PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilt
if any of their dependencies (i.e. the files they refer to) are changed.
This allows changes to transitive included headers to be handled properly.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.290 25-Mar-2014 ozaki-r

branches: 1.290.4;
Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.


Revision tags: riastradh-drm2-base3
# 1.289 09-Mar-2014 christos

let's see if the new dwarf library can handle dwarf 4


# 1.288 02-Mar-2014 christos

If we are compiling with -g and using gcc4.8 and dtrace downgrade
dwarf generation to version 2 for now.


# 1.287 15-Jan-2014 joerg

-Wl,-pie and -r don't agree with each other, so filter the former out.


# 1.286 11-Nov-2013 joerg

Relink binaries if crti.o changes.


# 1.285 29-Sep-2013 christos

Add libxcb


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.284 31-May-2013 mrg

add LIBX11_XCB; unfortunately since the library is named with a -
in it, we have to use an ugly hard coded assignment for now.
(could be cleaned up with more make variable magic i'm sure.)


# 1.283 04-Apr-2013 christos

ldopts should be before ldadd like everywhere else.


Revision tags: agc-symver-base
# 1.282 14-Feb-2013 christos

Since the libraries are produced with different MK flags than the programs,
we check for existance of the files instead of the MK flags.


# 1.281 14-Feb-2013 christos

Add PROGDPLIBS


# 1.280 26-Jan-2013 christos

CTFCONVERT me harder.


Revision tags: yamt-pagecache-base8
# 1.279 17-Jan-2013 christos

Now that we have separate debug sets, add -g if ${MKDEBUG} is set for
program builds since we don't need to install that symbol files.


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.278 24-Aug-2012 jmmv

branches: 1.278.2;
Allow DPADD to be specified on a per-program basis.


# 1.277 23-Aug-2012 joerg

Revert last, it breaks the tricks xsrc uses.


# 1.276 23-Aug-2012 joerg

Remove SHLIBINSTALLDIR and SHLINKINSTALLLIBDIR. Add rpath entries, if
SHLIBDIR differs from /usr/lib.


# 1.275 08-Aug-2012 christos

add MKRUMP by popular demand.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.274 29-Feb-2012 tron

Move "libexpat" from X11 into base which fixes PR lib/40346.
This change was approved by the Core Group.


# 1.273 21-Feb-2012 matt

Remove another ${SIZE}


# 1.272 20-Feb-2012 matt

Remove ${SIZE}


# 1.271 19-Feb-2012 matt

Add support for --combine with gcc.


Revision tags: netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2
# 1.270 05-Nov-2011 christos

branches: 1.270.2;
Add libtre


Revision tags: yamt-pagecache-base
# 1.269 16-Oct-2011 christos

branches: 1.269.2;
- no need to special-case libraries with weird characters.
- add a note about adding new libraries.


# 1.268 16-Oct-2011 christos

fix list of libraries to reflect reality.


# 1.267 10-Sep-2011 apb

Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.


# 1.266 27-Aug-2011 joerg

Add new "analyze" command to run clang's static analyzer in a directory
on all C/C++ files.


Revision tags: cherry-xenmp-base
# 1.265 26-Apr-2011 he

The new Heimdal adds -lwind and -lheimbase to the set of libraries,
so define the corresponding LIB* variables.
These are also needed in the PAM_STATIC_* variables, so add them there too.


# 1.264 11-Apr-2011 joerg

Adjust --sysroot related usage:
-Wl,-rpath does not expand =, so just drop it.

Drop -Wl,-rpath-link entries that duplicate the -Wl,-rpath entries, this
is done implicitly now that ld is built with sysroot support.

Use ${DESTDIR} explicitly for the remaining -Wl,-rpath-link entries.


# 1.263 10-Apr-2011 joerg

For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.


# 1.262 08-Mar-2011 jmmv

Revert previous (revision 1.261): it broke the build because PROG_CXX is
defined in terms of PROG, so later on we would end up with target duplicates
because both PROG_CXX and PROG were being converted to PROGS_CXX and PROGS.

Did not catch this earlier because the test build I did was not clean and
thus the duplicate targets did not have nasty effects.


# 1.261 07-Mar-2011 jmmv

Always convert PROG to its plural form independently of whether PROG_CXX
is defined or not. From Garrett Cooper in private mail.


Revision tags: bouyer-quota2-nbase
# 1.260 20-Feb-2011 jmmv

Define LIBATF_C and LIBATF_CXX to point to their corresponding .a files and
use these to properly set DPADD for test programs.


Revision tags: bouyer-quota2-base
# 1.259 13-Feb-2011 christos

add saslc


# 1.258 06-Feb-2011 joerg

Don't use -nostdinc or -nostdinc++ if this is included in a HOSTLIB.


# 1.257 17-Jan-2011 pooka

branches: 1.257.2;
Add rump bits to DPSRCS so that update builds work correctly.


Revision tags: matt-mips64-premerge-20101231
# 1.256 13-Dec-2010 pooka

befriend RUMPPRG with CRUNCHEDPRG


# 1.255 13-Dec-2010 pooka

Define RUMPPRG, which is just like PROG, except it additionally
builds a rump client with the name rump.${PROG}. The rump client
is not installed suid/sgid by default even if BINMODE is defined.


# 1.254 10-Dec-2010 joerg

Revert last, gcc(1) checks explicitly for -r on some platforms to disable
passing down --relax as well.


# 1.253 08-Dec-2010 joerg

gcc passes down -r directly to ld, so make it explicitly a linker option.


# 1.252 08-Dec-2010 joerg

Don't depend on ${CC} passing down -R to ld, use -Wl,-rpath explicitly.


# 1.251 08-Nov-2010 lukem

Preserve date on original shared library or program when stripping
the debug symbols and adding the debug-link to .debug.
Use '(rm -f file; false)' in the failure path to force failure.
Based on solution proposed by Nicolas Joly on tech-toolchain in July 2010.
Should fix PR toolchain/44046 from Andreas Gustafsson.


# 1.250 31-Oct-2010 mbalmer

Link Lua to the build and add the resulting files to the distribution sets.
Document the addition of Lua and the change we made to the default settings.


# 1.249 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.248 24-Apr-2010 lukem

When extracting separate debug symbols with MKDEBUG, there's no need
to leave the original file unstripped...


# 1.247 02-Mar-2010 darran

DTrace: Add CTF generation to the make framework. Only enabled when
MKDTRACE=yes.


# 1.246 14-Dec-2009 mrg

use "${CC} -r" not "${CC} -Wl,-r" as the latter fools GCC on some targets
and it ends up passing "-r -relax" to ld, which causes ld to barf.


# 1.245 14-Dec-2009 matt

Merge from matt-nb5-mips64


Revision tags: matt-premerge-20091211
# 1.244 08-Dec-2009 uebayasi

When PROGS / LIBS are used, you can pass each PROG / LIB specific parameters
to ${LD} via:

${LDADD.${PROG}}
${LDFLAGS.${PROG}}
${LDSTATIC.${PROG}}
${LDADD.${LIB}}
${LDFLAGS.${LIB}}

OTOH you can't pass parameters to ${CC}, because in suffix rules make(1) only
knows the name of ${.IMPSRC} and ${.TARGET}; it's users' responsivility to
define ${CC} parameters to all the sources of a given ${PROG} / ${LIB}.

Should address bin/42381.

(Bug in this commit log was pointed out by mrg@.)


# 1.243 27-Nov-2009 tsutsui

If CPPFLAGS or CXXFLAGS already contains -nostdinc or -nostdinc++,
don't add ${CPPFLAGS_ISYSTEM} or ${CPPFLAGS_ISYSTEMXX} to refer
${DESTDIR}/usr/include or ${DESTDIR}/usr/include/g++.

This change might cause errors on some MD stand dir, but in that case
each Makefile should be fixed to search proper system include paths
by -Ipath option in own CPPFLAGS.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.242 12-May-2009 plunky

remove libsdp as improved functionality has been enabled in libbluetooth.


# 1.241 10-Apr-2009 apb

Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links. They have no effect except when using a
metalog, in which case the information is added to the metalog. In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg. This should fix PR 24457 and PR 41155.


# 1.240 24-Nov-2008 cube

branches: 1.240.2;
Move cleanextra to the very ends in case another included file wants to add
to it even if it was initially empty.


Revision tags: netbsd-5-base matt-mips64-base2
# 1.239 19-Oct-2008 christos

branches: 1.239.2;
handle assembly files for MKPIE


# 1.238 16-Oct-2008 christos

Provide a way for a program to override the PIE flags.


# 1.237 15-Oct-2008 christos

don't compile/link libraries with pie


Revision tags: mjf-devfs2-base
# 1.236 02-Oct-2008 joerg

Hook up libfetch and pkg_install update.


Revision tags: wrstuden-revivesa-base-3
# 1.235 09-Sep-2008 joerg

Add MKSTRIPIDENT to remove the RCS IDs from binary programs and shared
libraries for space-constraint systems. The description is based on the
feedback of hubertf@, the logic on input from lukem@

This obsoletes the removal of LIBC_SCCS and SYSLIBC_SCCS for libc builds.


Revision tags: wrstuden-revivesa-base-2
# 1.234 28-Aug-2008 mrg

update a comment example


# 1.233 27-Aug-2008 rtr

use ${X11USRLIBDIR} instead of hard-coded /usr/X11R6/lib when building
${LIB.foo} vars


# 1.232 27-Aug-2008 lukem

Fix problem I introduced in rev 1.231 on 2008/08/25 where ${_PROGLDOPTS}
and -L${_GCC_LIBGCCDIR} were appearing in the link line before ${LDADD},
so -L${DESTDIR}/lib and -L${DESTDIR}/usr/lib were being used before
local -L library paths.
Fixes ntpd/ntpdate failure noticed by Valeriy E. Ushakov <uwe@NetBSD.org>


# 1.231 25-Aug-2008 lukem

Always link with: -Wl,-rpath-link,${DESTDIR}/usr/lib -L${DESTDIR}/usr/lib
Fixes problem with MKDYNAMICROOT=no triggered by libraries that depend
on other libraries.
Related to PR 33503.

Clean up setting of _CCLINK to always add the appropriate -B options.

Simplify the link rule for a program.


# 1.230 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.229 28-May-2008 lukem

add LIBLDAR_R (for completeness)


# 1.228 22-May-2008 lukem

Add MKLDAP, USE_LDAP, LIBLBER, LIBLDAP


Revision tags: hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-pf42-base
# 1.227 10-Apr-2008 tsutsui

branches: 1.227.2; 1.227.4;
Add libhx509 to PAM_STATIC_LDADD which is required by libkrb5.


# 1.226 22-Mar-2008 mlelstv

branches: 1.226.2;
Import Heimdal-1.1


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase matt-armv6-base hpcarm-cleanup-base
# 1.225 26-Dec-2007 jmmv

Make the clean target work when OBJS is set but PROG is not, as happens
for example in gnu/lib/crtstuff4. Reported by drochner@.


Revision tags: cube-autoconf-base
# 1.224 13-Nov-2007 jmmv

Fix typo that prevented MKDEBUG builds to work. Found by drochner@.


# 1.223 12-Nov-2007 jmmv

Add the ability to build multiple programs from a single directory

This adds support for a new set of variables, PROGS and PROGS_CXX, that
allow the developer to build multiple different programs from a single
source directory.


# 1.222 04-Nov-2007 tls

Remove MKPRIVATELIB from BIND libraries; move library reachover
directories and Makefiles from src/usr.sbin/bind to src/lib; make
BIND libraries build shared. Saves about 1MB-1.5MB per installed
executable, about 5MB for a base+etc minimal installation of NetBSD.


Revision tags: matt-mips64-base
# 1.221 29-Jul-2007 joerg

branches: 1.221.4; 1.221.6;
Add build glue for libarchive and update the various sets.


# 1.220 25-Jan-2007 perry

Before I completely forget the issue, convert "PROG_PAX" to the
better-named "PAXCTL_FLAGS".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.219 11-Nov-2006 christos

don't run paxctl if other commands were specified for that target.


# 1.218 10-Nov-2006 christos

if ${PROG_PAX} is defined, run paxctl on the binary after linking with
the value of the variable. This way, if you set:

PROG_PAX=+M

in /etc/mk.conf, you get what you deserve.


# 1.217 22-Oct-2006 pooka

libpuffs


# 1.216 09-Oct-2006 mrg

- clean up some comments to reality.
- retire LIBDCK, LIBG2C and (long broken) USE_LIBSTDCXX
- in bsd.hostprog.mk's LIBSTDCPP -> LIBSTDCC
- add LIBSUPCXX
- don't default USE_LIBSTDCXX or USE_GCC4 since they are
not used in the tree any where
- same with USE_XF86_4; retire it
- remove _SUPCXX handling in bsd.prog.mk

inspired by PR#26714.


Revision tags: abandoned-netbsd-4-base
# 1.215 23-Jul-2006 lukem

Implement MKDEBUG:
If "no", don't build and install separate debugging symbols
into /usr/libdata/debug.
Default: no


# 1.214 19-Jun-2006 gdamore

Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.


# 1.213 09-Jun-2006 christos

PR/33681: Scott Ellis: Building 'bc' with SHAREDSTRINGS=yes fails
We need CPPFLAGS too now.


# 1.212 11-May-2006 mrg

add support for ${OBJCOPTS} and ${OBJCOPTS}.<lib|prog|fn>.


# 1.211 20-Mar-2006 christos

There is always one more KRB4 thing to remove. (from Jukka Salmi)


# 1.210 20-Mar-2006 christos

Remove krb4 variables and libraries (Jukka Salmi)


# 1.209 16-Mar-2006 jwise

Now that we have real build system support for syspkgs, remove someone's
half-implemented idea of building `syspkgs' (really a few giant blobs of the
same granularity of the old sets) using install(1).


# 1.208 20-Jan-2006 christos

Add the world of libraries to the static pam build. Now static pam binaries
work.


# 1.207 09-Apr-2005 dsl

Report when we link a program into xxx.ro (before being crunched)


Revision tags: netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.206 04-Mar-2005 he

branches: 1.206.2; 1.206.4;
Introduce PAM_STATIC_LDADD and PAM_STATIC_DPADD. When compiling
with MKPIC=no, possibly because the target does not support shared
libraries, these include libraries required to resolve all symbols
which end up referenced from PAM-using applications. The libraries
presently required are -lcrypt, -lrpcsvc and -lutil.

Add use of these variables which are currently set up to use PAM,
so that they compile when MKPIC=no.

Also, in the telnetd case, reorder the order of the libraries, so
that libtelnet.a comes before -ltermcap and -lutil, again to fix
link error when MKPIC=no.

Discussed with thorpej and christos.


# 1.205 20-Feb-2005 christos

Add libradius


# 1.204 12-Jan-2005 lukem

If RESCUEDIR is defined, automatically add that to CPPFLAGS


# 1.203 08-Jan-2005 lukem

Implement <bsd.prog.mk> vars:
LIBASN1 LIBBSDMALLOC LIBG2C LIBPAM LIBSSH


# 1.202 04-Aug-2004 lukem

Revert most of previous, and move the LIB<libname>?= assignments
back to bsd.prog.mk from bsd.own.mk.

pkgsrc uses <bsd.own.mk>, and setting LIB<libname> in it causes
problems with various package builds.
This should fix PR #26542 submitted by Jim Bernard.

(I'll be implementing the DPADD for shared libraries in a different
manner that generally won't depend upon ${LIB<libname>}.)


# 1.201 30-Jul-2004 lukem

Move the LIB<libname>?= assignments from bsd.prog.mk to bsd.own.mk so
that they may be used by non PROGs (e.g., LIBs).

Improve some comments.


# 1.200 10-Jun-2004 lukem

Be consistent in handling YHEADER, similar to Christos' fix in bsd.lib.mk 1.253


# 1.199 21-May-2004 ross

If you add a library, you need to define its DPADD symbol here.

Add LIBMAGIC.


Revision tags: netbsd-2-0-base
# 1.198 15-Feb-2004 skrll

branches: 1.198.2;
Be more gcc like in the way we deal with libgcc so that sh3/hppa millicode
and exception handling have a chance of working properly.

- creates libgcc, libgcc_eh and libgcc_s

- updates LIBGCC_SPEC to use them appropriately.

There's a hack in here at the moment with respect to libgcc_so in that it
is preferable to link against libgcc_so will only when -shared-libgcc is
specified (the c++ frontend does this automatically.) Configurations where
LINK_EH_SPEC is defined already do this. The gcc configuration for
NetBSD/alpha and another NetBSD platform (I forget which) actually define
LINK_EH_SPEC probably by accident rather than design.

- updates share/mk to use the compiler's knowledge of what needs linking into
libraries and executables. This removes an hppa hack.

- updates the sets for the newly created libgcc* files.

- support for linking against the _pg version of libgcc has been removed.


# 1.197 29-Jan-2004 lukem

Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.


# 1.196 27-Jan-2004 lukem

Replace
:M-[IDU]*
with
:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)


# 1.195 23-Jan-2004 simonb

crt0.o lives in /usr/lib even on a.out.


# 1.194 16-Nov-2003 lukem

simplify with _MKTARGET_LINK


# 1.193 11-Nov-2003 dsl

Set MKDEP_SUFFIXES to get additional targets in .depend instead of using
sed in .afterdepend. I don't think .afterdepend is used anywhere any more.


# 1.192 21-Oct-2003 lukem

Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.


# 1.191 19-Oct-2003 lukem

Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} " ... {$.TARGET}" and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO


# 1.190 18-Oct-2003 lukem

Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command ("verbose")
This is the default, and is equivalent to the previous behaviour.


# 1.189 29-Sep-2003 lukem

Add LIBSTDCXX (for usr/lib/libstdc++.a).
Sync LIB* documentation with reality.


# 1.188 19-Sep-2003 martin

Drop explicit medlow model and default to -O2 for sparc64.


# 1.187 14-Sep-2003 lukem

Check ${SHLIBDIR} against "/usr/lib" instead of ${LIBDIR} when determining
if we need to add stuff (usually "/lib") to the rpath-link path before
"/usr/lib". Otherwise, this barfs if LIBDIR != /usr/lib or /lib, and
we're cross-building (e.g., in src/x11)


# 1.186 13-Sep-2003 erh

Also support per-program LDFLAGS and LDSTATIC.


# 1.185 13-Sep-2003 erh

Create a way to add additional flags to COPTS, CPPFLAGS, CXXFLAGS and LDADD
for particular libraries or programs by specifying the additions in mk.conf
instead of needing to go edit individual Makefiles.


# 1.184 12-Sep-2003 lukem

add infrastructure to support reach-over builds of xsrc


# 1.183 22-Aug-2003 dsl

Add a ${PROG}.ro target that does an 'ld -r' of the program object files.
Allows a much simplified build of 'crunched' binaries since crunchgen can
build prog.ro instead of having to deretmine the names of all the .o files.


# 1.182 01-Aug-2003 lukem

Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".


# 1.181 01-Aug-2003 lukem

simplify the ${PROG}: target to reduce duplication between the DESTDIR
and !DESTDIR cases...


# 1.180 31-Jul-2003 lukem

bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.


# 1.179 31-Jul-2003 lukem

Don't need -R/usr/lib; it will be searched at the end by ld.elf_so anyway.
Noted by matt green <mrg@>


# 1.178 28-Jul-2003 lukem

be consistent when adding *.y and *.l to DPSRCS


# 1.177 28-Jul-2003 lukem

replace MKCXXSUPCXX(!=no) with USE_LIBSTDCXX(==no)


# 1.176 28-Jul-2003 lukem

Change defined(CXX_SUPCXX) to MKCXXSUPCXX != "no".

Clarify that command-line overrides of the MKxxx variables should be
done via the environment rather than make(1) command-line variable
assignment, since the latter doesn't actually work as intended.


# 1.175 27-Jul-2003 mrg

introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes. for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)


# 1.174 26-Jul-2003 mrg

add a new bsd.own.mk variable: CXX_SUPCXX. from bsd.README:
+ CXX_SUPCXX If defined, the support libraries needed for this C++ program
+ are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.


# 1.173 20-Jul-2003 lukem

Consistently support the different C++ file extensions: .cc .cpp .cxx .C
Noted by Andrew White in PR toolchain/18246


# 1.172 18-Jul-2003 lukem

Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was defined.
Replace defined(UNPRIVED) tests with ${MKUNPRIVED} != "no"

Add MKUPDATE; if not no has the same semantics as if UPDATE was defined.
Replace defined(UPDATE) tests with ${MKUPDATE} != "no"

Improve documentation for these and other make flags.


# 1.171 16-Jul-2003 itojun

stop installing install libtelnet. build under lib/libtelnet and reference
it from usr.bin/telnet and libexec/telnetd.
(reason for separate build: compiler flags)


# 1.170 27-Jun-2003 drochner

For consistency, use "-R" instead of "-Wl,-rpath" to pass
a runtime search path to the linker.


# 1.169 13-Jun-2003 itojun

define LIBEVENT


# 1.168 11-Jun-2003 msaitoh

catch signal 1,2,3,13 and 15 to clean /tmp/_dependXXX


# 1.167 31-May-2003 thorpej

If EXTERNAL_TOOLCHAIN is defined, allow the compiler to define the
location of crt{begin,end}{,S}.o and libgcc.a. Encapsulate all of
this logic into the new bsd.gcc.mk, and use it in bsd.prog.mk and
bsd.lib.mk.


# 1.166 18-May-2003 lukem

make this a no-op if HOSTPROG is defined


# 1.165 30-Mar-2003 thorpej

If MACHINE_ARCH is powerpc and we HAVE_GCC3, add crtsaveres.o to the
endfile spec.


# 1.164 22-Feb-2003 uwe

Typo in comment.


# 1.163 24-Jan-2003 thorpej

Add LIBPTHREAD, LIBPTHREAD_DB, and LIBRT.


Revision tags: fvdl_fs64_base
# 1.162 22-Nov-2002 thorpej

Split crtbegin/crtend into crti/crtbegin/crtend/crtn. NetBSD-specific
things like the .note.netbsd.ident section are provided by crti/crtn.
crti/crtn also provide the _init() and _fini() routines.

crtbegin/crtend now only provide support for ctors/dtors. This paves
the way to using the "crtstuff" provided with GCC (when we upgrade to
GCC 3.3), which provides, among other things, much better C++/Java
exception handling.


# 1.161 12-Nov-2002 itohy

MKDYNAMICROOT for a.out


# 1.160 22-Oct-2002 perry

Pass 1 of SYSPKG changes to automatically add tags=pkgname_pkg to METALOG.
Not quite ready for prime time yet.


# 1.159 27-Sep-2002 thorpej

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.


# 1.158 26-Sep-2002 itojun

MDC2 is a patented algorithm; don't ship it in default libcrypto.
MKCRYPTO_MDC2 will build a separate library, libcrypto_mdc2.


# 1.157 08-Sep-2002 thorpej

Build a .gdbinit in the objdir when building a program. The .gdbinit
file sets the shared library prefix to ${DESTDIR}, and adds "sources"
directives for each file listed in the GDBINIT Makefile variable.


# 1.156 09-Aug-2002 thorpej

Add LIBPMC.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.155 27-Mar-2002 eeh

branches: 1.155.2;
Use the medium low model for sparc64 programs that don't 2GB of data segment.


# 1.154 11-Feb-2002 mycroft

Don't use .PHONY for targets that are actually installed. Instead use force
dependencies. (Among other things, `make -t install' does something vaguely
sensible now.)


# 1.153 07-Feb-2002 pk

Mark installed system libraries as .MADE only if we're actually establishing
their default variable values here.


# 1.152 04-Feb-2002 christos

s/.NOSUFF/.MADE/


# 1.151 03-Feb-2002 christos

Apply a .NOSUFF: directive to targets we don't want to have processed by
the suffix rules engine.


# 1.150 02-Feb-2002 veego

Ups, it is LIBUSBHID and not LIBUSBHIB.


# 1.149 02-Feb-2002 veego

Change LIBUSB to LIBUSBHIB, reflecting the library name change.


# 1.148 29-Jan-2002 enami

Mark the targets clean{extra,objs} as PHONY.


# 1.147 04-Jan-2002 thorpej

For PROG_CXX DESTDIR builds, pull in -lstdc++ and -lm regardless
of GCC version.


# 1.146 01-Jan-2002 thorpej

Per a suggestion from matthew green, PROG_CXX takes the place of
PROG for C++ programs.


# 1.145 01-Jan-2002 thorpej

* If PROG_CXX is set by the program's Makefile, use ${CXX} to link
the program rather than ${CC}.
* If HAVE_GCC3 is defined, pull in "-lstdc++ -lm" as additional C++
support libraries for DESTDIR builds.


# 1.144 28-Dec-2001 lukem

* 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


# 1.143 28-Nov-2001 tv

If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.


# 1.142 19-Nov-2001 thorpej

Use a little transitional hack to determine if we use -isystem
or -idirafter. Use the former only of USE_NEW_TOOLCHAIN, since
-isystem causes the old toolchain to bomb out when building
libstdc++.


# 1.141 14-Nov-2001 tv

C/..$/.c/ -> C/\..$/.c/


# 1.140 14-Nov-2001 tv

Move the DESTDIR-based nostdinc logic to bsd.lib.mk and bsd.prog.mk where
it belongs (with the native target compile rules).


# 1.139 02-Nov-2001 tv

Use INSTALL_FILE/INSTALL_DIR as appropriate.


# 1.138 02-Nov-2001 tv

Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.


# 1.137 19-Oct-2001 tv

Add .NOPATH for all files generated from .l or .y files in SRCS. Fixes PRs
bin/14187 and lib/14239.

Also simplify the handling of these transforms to .c and .h files a bit by
leveraging make's builtin macro operators.


# 1.136 25-Sep-2001 tv

Set .NOPATH on program to build to make sure it goes in .OBJDIR.
Problem noted by <seebs@plethora.net>.


# 1.135 24-Sep-2001 lukem

fix previous (hi thor!) - $OBJS and $CLEANFILES might be empty, and
rm needs some files to delete...


# 1.134 24-Sep-2001 tls

Split "cleanprog" target apart: now you can zap only object files or
CLEANFILES (needed to fix crunchgen lossage).


# 1.133 13-Sep-2001 thorpej

Add LIBPCI.


# 1.132 14-Aug-2001 tv

Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").


# 1.131 01-Jun-2001 tv

Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).


# 1.130 08-May-2001 sommerfeld

Suppress duplicate entries in ALLFILES, FILES, INCS, DEPINCS, INFOFILES,
NLSALL, CATPAGES, MANPAGES, HTMLPAGES, and SCRIPTS.


# 1.129 19-Feb-2001 jmc

Wrap target() checks around afterdepend rule as some Makefiles override this


# 1.128 26-Jan-2001 itojun

fix typo in LIBSSL decl. it made programs with DPADD+=${LIBSSL} to build
every time we type "make". From: bernd


# 1.127 14-Jan-2001 christos

use the new .if commands(<target>) directive so that we don't have to
change Makefiles.


# 1.126 14-Jan-2001 christos

fix thinko: test for the existance of the target before we define it...


# 1.125 14-Jan-2001 christos

Alter previous redefined target protection. If the ${PROG} target is defined,
add the dependencies as usual, but don't add the commands. This avoids
having to change all the Makefiles that redefine the PROG target.


# 1.124 14-Jan-2001 christos

allow programs to override the program target.


# 1.123 08-Jan-2001 mrg

add missing $LIBCRYPTO_RC5 and $LIBCRYPTO_IDEA


# 1.122 08-Jan-2001 mrg

add missing $LIBSSL


# 1.121 04-Jan-2001 garbled

Add LIBCDK and LIBFORM definitions


# 1.120 31-Oct-2000 itojun

add ${LIBINTL} for use with DPADD.


# 1.119 07-Oct-2000 deberg

fix typos, PR 11159


# 1.118 25-Jun-2000 erh

For the case when DESTDIR is set: move the -L${DESTDIR}/usr/lib after ${LDADD} so any -L directories set in LDADD are searched first to avoid possibly linking against old versions of libraries.


Revision tags: netbsd-1-5-base
# 1.117 19-Jun-2000 thorpej

branches: 1.117.2;
Sync up the LIB* list.


# 1.116 10-Jun-2000 mycroft

Use ${.ALLSRC:T} when doing the generated variable name lookups, so that it
DTRT for generated files in and obj directory (or accessed via .PATH).


# 1.115 06-Jun-2000 mycroft

Abuse .USE some more.


# 1.114 06-Jun-2000 mycroft

Minor rearrangement.


# 1.113 06-Jun-2000 mycroft

Use ODE make(1) features to eliminate extra variables and move several things
outside of .for loops. (Needs more work to completely eliminate .for.)

XXX Don't look at this stuff. It will make your head hurt.


Revision tags: minoura-xpg4dl-base
# 1.112 14-Apr-2000 mrg

branches: 1.112.2;
use -rpath-link rather than -R when linking objects using a DESTDIR.
this replaces the previous change as that ended up adding
$DESTDIR/usr/lib to the runtime path of every binary created, which
is bogus and dangerous.


# 1.111 25-Mar-2000 mycroft

When linking with $DESTDIR, use an explicit -R to get library dependencies
correct.


# 1.110 07-Mar-2000 veego

Remove unused libahdi.
It will be replaced in the future with a more generic libdisklabel.


# 1.109 05-Feb-2000 jdc

Add libahdi entries.


# 1.108 23-Jan-2000 eeh

Add some support for FCode binaries.


# 1.107 22-Jan-2000 mycroft

Make `dependall' play nicely with SUBDIR, using a hack similar to `realinstall'
for both `depend' and `all'.
Also, remove the old hack that invokes an extra shell for .depend, now that
make(1) has been fixed.


# 1.106 16-Jan-2000 assar

all: depend on ${SCRIPTS} so that they get generated if they need to


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.105 23-Nov-1999 blymn

Added libmenu library.


Revision tags: comdex-fall-1999-base
# 1.104 14-Sep-1999 perry

branches: 1.104.4;
Add a "dependall" target, which does a "make depend" and then "make all"
in a single directory. This is useful in "make build" because by doing
the build immediately after the depend, all sources will typically
still be in the buffer cache, thus saving significant time over doing
a "make depend" on all the directories and then a "make all".


# 1.103 04-Sep-1999 fredb

Permit "make all install", as well as "make foo install" (where foo would be
installed by "make install") without setting of BUILD. All cases where BUILD
is already set are unchanged from the old behavior.

"make all install" is now practically equivalent to "make BUILD= all install",
but without actually setting build.

Fixes pr's 8313, 3894.


# 1.102 21-Aug-1999 simonb

Add ${INSTPRIV} to ${INSTALL} commands.


# 1.101 01-Jul-1999 itojun

branches: 1.101.2;
add LIBIPSEC for use from DPADD.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.100 12-Feb-1999 lukem

branches: 1.100.2;
* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.99 10-Feb-1999 tv

libbfd_pic.a is no longer installed; remove ${LIBBFD} define.


# 1.98 04-Feb-1999 christos

PR/2936: Brian C. Grayson: Avoid truncating precious files when installing
and the filesystem is full. Added ${RENAME} flag to install, which when set
to -r installs on a temporary file and then renames to the final destination.
${RENAME} is currently set to nothing in bsd.own.mk, but one can turn it
on in /etc/mk.conf.


# 1.97 07-Nov-1998 jonathan

Do DESTDIR support for crtbegin/crtend on all ELF ports (adds mips).


# 1.96 28-Sep-1998 christos

Use preserve flag in install.


# 1.95 10-Sep-1998 ross

Define a LIBBZ2?=... for use in DPADD=... lines.


# 1.94 09-Aug-1998 lukem

add distclean as a synonym for cleandir


# 1.93 09-Apr-1998 tv

.y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.


# 1.92 01-Apr-1998 tv

Revert. This broke too much in the build tree, and a better solution
needs to be created. (The existing situation breaks a lot too.)


# 1.91 01-Apr-1998 tv

Fix .y rules to DTRT with possibly generated .h files. See mail on
tech-toolchain for a very detailed explanation of this. In short, add
a .y.h rule identical to the .y.c rule and make the .y.c rule rename
the .h file; also, clean the .h file in CLEANFILES.


# 1.90 03-Nov-1997 cgd

echo the lint command line when making 'lint'.


# 1.89 28-Oct-1997 lukem

add ${LIBOBJC}


Revision tags: netbsd-1-3-base
# 1.88 11-Oct-1997 mycroft

branches: 1.88.2;
Several changes:
* Allow bsd.man.mk to be included separately.
* Always include bsd.own.mk and bsd.obj.mk.
* Include bsd.man.mk and bsd.nls.mk even if NOMAN or NONLS; just turn off
building of the affected files instead.
* Require bsd.subdir.mk to be included explicitly.
(Will make appropriate changes to Makefiles shortly.)


# 1.87 29-Sep-1997 gwr

Add $LIBBFD


# 1.86 31-May-1997 cjs

Back out BUILDDIR and NOINSTALL changes.


# 1.85 26-May-1997 cjs

branches: 1.85.2;
These updates to the build allow building against include files
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.


# 1.84 18-May-1997 kleink

Add libposix.


# 1.83 17-May-1997 mycroft

Do LINKS and SYMLINKS after FILES and INCS.


# 1.82 17-May-1997 mycroft

Remove unneeded .SUFFIXES lines, and move .s and .S closer to .o to give the
right preferences.


# 1.81 09-May-1997 mycroft

Fix typo in previous.


# 1.80 09-May-1997 mycroft

Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.79 09-May-1997 mycroft

Remove cruft.


# 1.78 09-May-1997 mycroft

Oops; rearrange dependencies to get things built early enough.


# 1.77 09-May-1997 mycroft

Make sure INCS and SRCS are built if necessary.


# 1.76 08-May-1997 gwr

Set the .NOPATH flag for ${OBJS} (from Christos).


# 1.75 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.74 07-May-1997 mycroft

Various simplifications.


# 1.73 07-May-1997 mycroft

Shuffle some .PHONYs around, to work better with `-t'.


# 1.72 06-May-1997 mycroft

Make most of the install targets .PRECIOUS.


# 1.71 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.70 18-Apr-1997 christos

Add ${LIBNTP}


# 1.69 17-Apr-1997 thorpej

- Properly depend on crtbegin.o and crtend.o for platforms that use
them (currently Alpha and PowerPC)
- STRIP -> STRIPFLAG


# 1.68 03-Apr-1997 mikel

don't allow override of all: target


# 1.67 29-Mar-1997 mikel

merge lite-2 changes (mostly SCCSids)


# 1.66 27-Mar-1997 christos

Put the FILES generated rules in a separate .mk file since both bsd.prog.mk
and bsd.lib.mk use them.


# 1.65 27-Mar-1997 mycroft

Make the SCRIPTS case mimic the FILES case more closely, so we can override
the destination direectory, etc.


# 1.64 27-Mar-1997 mycroft

Remove knowledge of HIDEGAME from here.


# 1.63 24-Mar-1997 christos

make rules update:
- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation


# 1.62 22-Mar-1997 perry

Fix SYMLINKS not to include DESTDIR in the link itself


# 1.61 13-Mar-1997 perry

add SYMLINKS, by analogy to LINKS. Vetted by Christos.


# 1.60 22-Jan-1997 cgd

if 'clean' is not already defined, rather than simply defining it with
a bunch of rules, define a clean{kmod,lib,prog} target with the rules,
and have both clean and cleandir depend on that. That eliminates a bug
where 'cleandir' in a directory which included e.g. bsd.prog.mk but which
also had subdirs would 'make clean' all the subdirs and then 'make cleandir'
all ofthe subdirs. It also allows Makefiles to add more dependencies
to 'clean' after inclusion of the make template.

If 'clean' is already defined, the behaviour is the same as it used to be.


# 1.59 20-Dec-1996 cgd

add an afterdepend target (a la the one in bsd.lib.mk) that processes
the .depend file to add <filename>.ln for each <filename>.o as an
object file which has the given dependencies (in addition to
<filename>.po and <filename>.so, which were already there).


# 1.58 13-Dec-1996 mikel

add missing LIBPCAP definition.


# 1.57 26-Nov-1996 mrg

add libz and libwrap


# 1.56 18-Oct-1996 thorpej

Use ${INSTALL} rather than "install".
From Simon J. Gerraty <sjg@zen.void.oz.au>, PR #1458.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.55 08-Apr-1996 jtc

Sort LIBFOO definitions and add LIBY; Reported by Mike Long <mike.long@analog.com> in PR #2301.


# 1.54 22-Oct-1995 christos

Added include file <bsd.sys.mk> that contains lex and yacc "parallel aware"
rules. These rules are not turned on by default; they are enabled by setting
the PARALLEL variable.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.53 25-Jun-1995 cgd

oops; fix an rm that might be empty


# 1.52 24-Jun-1995 cgd

update lint rules, but keep linting disabled


# 1.51 10-Jun-1995 mycroft

Define LIBEDIT.


# 1.50 21-Apr-1995 jtc

.include <bsd.nls.mk> unless NONLS is defined.


# 1.49 22-Dec-1994 cgd

specify man pages differently, and document how.


# 1.48 24-Aug-1994 mycroft

Include bsd.own.mk earlier.


# 1.47 20-Jul-1994 cgd

fix from christos, for progs w/o objects


Revision tags: netbsd-1-0-base
# 1.46 06-Jul-1994 mycroft

branches: 1.46.2;
Pull libraries from ${DESTDIR} if set. Kill LDONLY, which is unused and
probably not useful anyway.


# 1.45 30-Jun-1994 cgd

fix modify-info-nothingness-then-substitute probelm that broke genclass build


# 1.44 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.43 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.42 28-Jun-1994 jtc

Strip *.sh when constructing OBJS from SRCS.
This will allow us to clean up makefiles that build a script by munging
a template (uusched, genclass, neqn, etc.).


# 1.41 18-Jun-1994 cgd

don't chown the symlink, when HIDEGAME causes a symlink to be made to dm.
4.4-based FS code _follows_ the symlinks on a chown(2) call.


# 1.40 24-May-1994 cgd

fix the last to do the right thing for dependencies


# 1.39 24-May-1994 deraadt

LIBSKEY


# 1.38 22-May-1994 jtc

Single source file programs are now compiled into object files before they
are linked. This change halves the time it takes to rebuild all of the
NetBSD sources when only the C library is "touched"; but only takes about
one percent more disk space.


# 1.37 06-Apr-1994 chopps

relink (recompile) single source programs when crt0.o is updated.


# 1.36 24-Mar-1994 mycroft

Remove *.core on clean.


# 1.35 09-Feb-1994 cgd

kill install -d's.


# 1.34 28-Jan-1994 cgd

add LIBKVM


# 1.33 10-Nov-1993 cgd

librpc doesn't exist anymore


# 1.32 08-Nov-1993 cgd

ad LDSTATIC flag, so static linking can be made one-stop shopping.
use "setenv LDSTATIC" to make *everything* dynamically linked,
setenv LDSTATIC -static for everything statically linked, or unset
it for default behavior.


# 1.31 07-Oct-1993 cgd

LIBTERM pointed at nothing, but was meant to point to libtermcap.a...


# 1.30 07-Oct-1993 cgd

always define LIBCRYPT


# 1.29 17-Aug-1993 mycroft

Make sure we don't recurse into subdirectories if Makefile specified `install'
target. (It's usually blank and is specifically to avoid doing this...)


# 1.28 15-Aug-1993 mycroft

Automatically include bsd.subdir.mk for backward compatibility.


# 1.27 15-Aug-1993 mycroft

Don't automatically include bsd.subdir.mk in bsd.prog.mk and bsd.lib.mk.
Put back .MAIN in bsd.man.mk, and be careful not to include ../Makefile.inc
a second time.


# 1.26 15-Aug-1993 mycroft

Move man rules to sys.mk.
Use bsd.subdir.mk for building subdirectories.
Don't forget to remove x.cc and x.C when using SHAREDSTRINGS.
Make ${PROG} always depend on ${LIBCRT0}.
Don't duplicate code between cleandir and clean.
Move tags target to bsd.dep.mk.
Move STRIP to bsd.own.mk.
Remove redundant definitions of {BIN,MAN}{DIR,GRP,OWN,MODE}.
Move {LIB,DOC}{DIR,GRP,OWN,MODE} defaults to bsd.own.mk.


# 1.25 15-Aug-1993 mycroft

Abstract out dependency stuff, and add RCS identifiers.


# 1.24 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


# 1.23 10-Aug-1993 mycroft

Put LINKS handling in `install' target, so it's the last thing executed, and
happens even if `realinstall' is user-defined.


# 1.22 30-Jul-1993 mycroft

When generating a default OBJS, ignore .h files.


# 1.21 29-Jul-1993 mycroft

Don't print the `making ...' message if an obj dir already exists.
Also, a minor cleanup.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.20 17-Jul-1993 mycroft

Fix C++ dependencies for good. `make depend' is now done in two passes--one
of C files and one for C++ files. No need to specify `-+' in your Makefile,
as it is now done automatically.


# 1.19 17-Jul-1993 cgd

do c++ dependencies the right way...


# 1.18 17-Jul-1993 mycroft

Add suffix rules for C++ files.


# 1.17 04-Jun-1993 brezak

Add LIBRPCSVC variable.


# 1.16 02-Jun-1993 cgd

add ability to specify c++ dependencies, by setting CFLAGS+=-+ for
the dependency make.


# 1.15 26-Apr-1993 cgd

added definition for DPADD library variable LIBCRYPT.


# 1.14 26-Apr-1993 mycroft

Don't redefine `realinstall' target if already defined.


# 1.13 25-Apr-1993 mycroft

Link with LDFLAGS even if one source module.


# 1.12 25-Apr-1993 mycroft

Don't lose if we include bsd.prog.mk only to build man pages.


# 1.11 25-Apr-1993 mycroft

Fix error in last change. (Oops.)


# 1.10 25-Apr-1993 mycroft

Don't build man pages if NOMAN set.


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.9 09-Apr-1993 cgd

various changes to default make rules. from patch 101.
note that only the "sensible" changes in patch 101 are implemented.


# 1.8 08-Apr-1993 cgd

try to do the right thing, in terms making directories before we
install into them, and get the manpage cleans _OUT_ of "clean".
they don't belong there, only in cleandir, WFJ be damned.


# 1.7 08-Apr-1993 cgd

fixed typos...


# 1.6 08-Apr-1993 cgd

(silently) make sure we have directories before installing


# 1.5 04-Apr-1993 cgd

make LIBRPC point to the right place


# 1.4 27-Mar-1993 nate

Fixed the doc macros to call troff, eqn,and tbl instead of ditroff,
deqn, and dtbl.
Fixed make clean to remove the man pages (Bill fixed this in the distribution,
but not in the original source)
Changed install to leave the original file around, by using 'cp' instead of
'mv'. "install -c ..."


# 1.3 23-Mar-1993 cgd

made .CURDIR be absolute, not relative, thereby eliminating
the need for some of the makefile trickery when making objects,
and fixing a few .PATH bugs


# 1.2 22-Mar-1993 cgd

fixed "make obj" for cases when sources not in /usr/src/...
if sources not there, it now mkdirs obj, but some trickery
is necessary, to avoid deleting cwd.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.328 04-Apr-2020 christos

Linker semantics have changed; we now don't automatically link dependent
libraries from other DSO's. For example in /usr/bin/passwd:
ld: krb5_passwd.o: undefined reference to symbol \
'UI_UTIL_read_pw_string@@OPENSSL_1_1_0'
ld: /usr/obj/amd64-x86_64/release/lib/libcrypto.so.14: error adding symbols: \
DSO missing from command line


# 1.327 04-Apr-2020 christos

Fix kerberos libraries order


# 1.326 04-Apr-2020 christos

Add libgnuctf


# 1.325 03-Mar-2020 christos

Add fido and cbor


Revision tags: phil-wifi-20191119
# 1.324 18-Nov-2019 christos

Improve the script to check for installed libraries, and fix the wrong
names and obsolete libraries it found.


# 1.323 27-Aug-2019 kamil

Enhance the support of LLVM sanitizers

Define _REENTRANT for MKSANITIZER build. This is needed for at least stdio
code. This caused new build issued with duplicated symbols in few places
and rump kernel code picking different code paths borrowed from libc.
Handle all this in one go.

Add bsd.sanitizer.mk to share common code used by programs and libraries.

Switch from realall to beforeinstall target in .syms files. This is more
reliable in MKSANITIZER.


# 1.322 17-Aug-2019 kamil

Add PAXCTL_FLAG rules for MKSANITIZER

Add per-program rules to disable ASLR for ASan, TSan and MSan in all
sanitized programs. This flag is not needed for other supported sanitizers.

Without this change, sanitized init(8) dies early on startup.

Approach originally suggested by <joerg>


# 1.321 15-Aug-2019 kamil

Add SANITIZER_RENAME_CLASSES in bsd.prog.mk

This adds a more flexible version of SANITIZER_RENAME_SYMBOL.

New symbol allows to specify MKSANITIZER specific renames on per-file and
per-symbol basis.


# 1.320 10-Aug-2019 christos

Make the X11 library lists consistent again.


Revision tags: netbsd-9-base phil-wifi-20190609 pgoyette-compat-20190127
# 1.319 21-Jan-2019 christos

branches: 1.319.2;
Most of the mv operations are to move temporary files to their final place.
Some use -f, others don't. This can lead to spurious build failures when
the user performing the build changes. Centralize, and always use -f.


Revision tags: pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.318 12-Aug-2018 christos

fix broken library variable definitions (inconsistencies between
bsd.README and bsd.prog.mk)


Revision tags: pgoyette-compat-0728
# 1.317 25-Jul-2018 kamil

Introduce MKLIBCSANITIZER in the share/mk rules

Add flags that are required to build a program and a dynamically loaded
library.

Propagade LIBCSANITIZERFLAGS to CFLAGS and CXXFLAGS.

LDFLAGS is not changed on purpose, as a libcsanitizer is inside libc
and no external dependencies are needed.

Register NOLIBCSANITIZER, as certain distribution parts will need to be
skipped.


# 1.316 12-Jul-2018 maxv

Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.


Revision tags: phil-wifi-base
# 1.315 25-Jun-2018 kamil

branches: 1.315.2;
Add a framework for renaming symbols in libc&co for MKSANITIZER

A new keyword SANITIZER_RENAME_SYMBOL. It's a variable that has specified
a list of symbols to be renamed in a processor in order to remove naming
conflicts with public symbols in libc/m/pthread/rt.

This renaming will occur for libraries and programs.
A symbol with a conflicting 'name', will be renamed to '__mksanitizer_name'.

Based on an idea by <christos>


Revision tags: pgoyette-compat-0625
# 1.314 21-Jun-2018 kamil

Refactor MKSANITIZER flags in mk rules

Introduce a new variable SANITIZERFLAGS that contains all the sanitizer
specific flags. These flags are designed to be passed to CFLAGS, CXXFLAGS
and LDFLAGS.

Pass SANITIZERFLAGS in bsd.prog.mk rules to CFLAGS, CXXFLAGS and LDFLAGS.

Pass SANITIZERFLAGS in bsd.lib.mk rules to *_pic.a build flags. The *_pic.a
libraries are designed to construct .so libraries. All .so libraries with
few exceptions are expected to be prebuilt with a sanitizer. Another
purpuse of *_pic.a files can be constructing static PIE programs, however
they are not supported as of now and there is no sanitization of static
programs either.

Once MKSTATICPIE will be supported, it will be initially incompatible with
MKSANITIZER.

This change also makes it easier to build other targets like kernel and
kernel modules without userland sanitizers.

No functional change intended for MKSANITIZER=no users.


# 1.313 02-Jun-2018 christos

Sanitizers don't support static linking.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315
# 1.312 11-Mar-2018 mrg

define LIBXFONT2.


Revision tags: pgoyette-compat-base
# 1.311 25-Feb-2018 mrg

branches: 1.311.2;
add LIBKRB5_LDADD/LIBKRB5_DPADD and their static counterparts
to bsd.prog.mk. use them instead of hard coding various lists
of libraries for krb5.

this fixes static builds.


# 1.310 11-Dec-2017 christos

Instead of checking for obj existance which can be empty for shuttle-rule
programs, check for .sh sources.


# 1.309 10-Dec-2017 christos

don't try to build .debug files for shell scripts.


# 1.308 10-Oct-2017 christos

Add general {DP,LD}ADD.rump variables


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base
# 1.307 21-May-2017 riastradh

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.


# 1.306 21-May-2017 riastradh

Remove some vestiges of MKCRYPTO_IDEA/MKCRYPTO_MDC2.


# 1.305 21-May-2017 riastradh

Remove MKCRYPTO_RC5. Unconditionally include RC5 in libcrypto.so.

This option existed only because RC5 is covered by patents that, twenty
years ago, we had reason to suspect the patent holder, RSA, Inc., might
litigate. The two US patents in question are 5,724,428 and 5,835,600.

According to the USPTO Patent Term Calculator web site at
<https://www.uspto.gov/patent/laws-and-regulations/patent-term-calculator#heading-5>
(retrieved 2017-05-21), patents filed after 1995-06-07 expire twenty
years after the filing date.

number filing date
5,724,428 1995-11-01
5,835,600 1997-04-21

Thus, these patents appear to be expired.

As proposed on tech-crypto and tech-security:

https://mail-index.netbsd.org/tech-crypto/2017/05/05/msg000718.html
https://mail-index.netbsd.org/tech-security/2017/05/05/msg000927.html


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.304 19-Apr-2017 joerg

Add netpgpverify to the library list.


Revision tags: pgoyette-localcount-20170320
# 1.303 20-Feb-2017 rin

add missing LIBCXX


# 1.302 08-Feb-2017 kamil

libpthread_dbg(3) deletion from the base distribution

libpthread_dbg(3) is a remnant library from the M:N thread model
(pre-NetBSD-5.0) API to introspect threads within a process and for use
of debuggers.

Currently in the 1:1 model it's not used in GDB neither in LLDB and it's
not either planned to be used. It's current function to read pthread_t
structures is realizable within a regular debugger capable to
instrospect objects within a tracee (GDB, LLDB...).

Remaining users of this API can still use this library from
pkgsrc/devel/libpthread_dbg.

Sponsored by <The NetBSD Foundation>


# 1.301 29-Jan-2017 christos

add sqlite3 to statically linked libraries for pam.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914
# 1.300 20-Aug-2016 christos

branches: 1.300.2;
unbound additions


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.299 04-Apr-2016 joerg

branches: 1.299.2;
If the per-target LDSTATIC flag is set, don't include the PIE linker
flags as we currently don't support static PIE.


# 1.298 30-Mar-2016 martin

Pass -pie to cc, not -Wl,-pie. This way we have a chance to fix specs
for obscure corner cases like -pie -fPIE -static (used for
/usr/tests/lib/csu/h_initfini2 if building with MKPIE=yes).
While there also replace -fPIC with -fPIE for the PIE case, even if
it should be mostly equivalent.


# 1.297 12-Mar-2016 mrg

remove conditionals that are always true with GCC >= 4.8.


# 1.296 21-Feb-2016 christos

Add NODEBUG


# 1.295 31-Jan-2016 christos

Introduce NOPIE and NOCTF so that standalone programs build properly.


# 1.294 23-Jan-2016 christos

Define _KERNTYPES for things that need it.


# 1.293 07-Nov-2015 joerg

LIBEXECINFO


# 1.292 07-Jun-2015 matt

Make LIBCRT* depend on the right files if MLIBDIR from MKCOMPAT is defined.


# 1.291 01-Dec-2014 erh

PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilt
if any of their dependencies (i.e. the files they refer to) are changed.
This allows changes to transitive included headers to be handled properly.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.290 25-Mar-2014 ozaki-r

branches: 1.290.4;
Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.


Revision tags: riastradh-drm2-base3
# 1.289 09-Mar-2014 christos

let's see if the new dwarf library can handle dwarf 4


# 1.288 02-Mar-2014 christos

If we are compiling with -g and using gcc4.8 and dtrace downgrade
dwarf generation to version 2 for now.


# 1.287 15-Jan-2014 joerg

-Wl,-pie and -r don't agree with each other, so filter the former out.


# 1.286 11-Nov-2013 joerg

Relink binaries if crti.o changes.


# 1.285 29-Sep-2013 christos

Add libxcb


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.284 31-May-2013 mrg

add LIBX11_XCB; unfortunately since the library is named with a -
in it, we have to use an ugly hard coded assignment for now.
(could be cleaned up with more make variable magic i'm sure.)


# 1.283 04-Apr-2013 christos

ldopts should be before ldadd like everywhere else.


Revision tags: agc-symver-base
# 1.282 14-Feb-2013 christos

Since the libraries are produced with different MK flags than the programs,
we check for existance of the files instead of the MK flags.


# 1.281 14-Feb-2013 christos

Add PROGDPLIBS


# 1.280 26-Jan-2013 christos

CTFCONVERT me harder.


Revision tags: yamt-pagecache-base8
# 1.279 17-Jan-2013 christos

Now that we have separate debug sets, add -g if ${MKDEBUG} is set for
program builds since we don't need to install that symbol files.


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.278 24-Aug-2012 jmmv

branches: 1.278.2;
Allow DPADD to be specified on a per-program basis.


# 1.277 23-Aug-2012 joerg

Revert last, it breaks the tricks xsrc uses.


# 1.276 23-Aug-2012 joerg

Remove SHLIBINSTALLDIR and SHLINKINSTALLLIBDIR. Add rpath entries, if
SHLIBDIR differs from /usr/lib.


# 1.275 08-Aug-2012 christos

add MKRUMP by popular demand.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.274 29-Feb-2012 tron

Move "libexpat" from X11 into base which fixes PR lib/40346.
This change was approved by the Core Group.


# 1.273 21-Feb-2012 matt

Remove another ${SIZE}


# 1.272 20-Feb-2012 matt

Remove ${SIZE}


# 1.271 19-Feb-2012 matt

Add support for --combine with gcc.


Revision tags: netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2
# 1.270 05-Nov-2011 christos

branches: 1.270.2;
Add libtre


Revision tags: yamt-pagecache-base
# 1.269 16-Oct-2011 christos

branches: 1.269.2;
- no need to special-case libraries with weird characters.
- add a note about adding new libraries.


# 1.268 16-Oct-2011 christos

fix list of libraries to reflect reality.


# 1.267 10-Sep-2011 apb

Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.


# 1.266 27-Aug-2011 joerg

Add new "analyze" command to run clang's static analyzer in a directory
on all C/C++ files.


Revision tags: cherry-xenmp-base
# 1.265 26-Apr-2011 he

The new Heimdal adds -lwind and -lheimbase to the set of libraries,
so define the corresponding LIB* variables.
These are also needed in the PAM_STATIC_* variables, so add them there too.


# 1.264 11-Apr-2011 joerg

Adjust --sysroot related usage:
-Wl,-rpath does not expand =, so just drop it.

Drop -Wl,-rpath-link entries that duplicate the -Wl,-rpath entries, this
is done implicitly now that ld is built with sysroot support.

Use ${DESTDIR} explicitly for the remaining -Wl,-rpath-link entries.


# 1.263 10-Apr-2011 joerg

For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.


# 1.262 08-Mar-2011 jmmv

Revert previous (revision 1.261): it broke the build because PROG_CXX is
defined in terms of PROG, so later on we would end up with target duplicates
because both PROG_CXX and PROG were being converted to PROGS_CXX and PROGS.

Did not catch this earlier because the test build I did was not clean and
thus the duplicate targets did not have nasty effects.


# 1.261 07-Mar-2011 jmmv

Always convert PROG to its plural form independently of whether PROG_CXX
is defined or not. From Garrett Cooper in private mail.


Revision tags: bouyer-quota2-nbase
# 1.260 20-Feb-2011 jmmv

Define LIBATF_C and LIBATF_CXX to point to their corresponding .a files and
use these to properly set DPADD for test programs.


Revision tags: bouyer-quota2-base
# 1.259 13-Feb-2011 christos

add saslc


# 1.258 06-Feb-2011 joerg

Don't use -nostdinc or -nostdinc++ if this is included in a HOSTLIB.


# 1.257 17-Jan-2011 pooka

branches: 1.257.2;
Add rump bits to DPSRCS so that update builds work correctly.


Revision tags: matt-mips64-premerge-20101231
# 1.256 13-Dec-2010 pooka

befriend RUMPPRG with CRUNCHEDPRG


# 1.255 13-Dec-2010 pooka

Define RUMPPRG, which is just like PROG, except it additionally
builds a rump client with the name rump.${PROG}. The rump client
is not installed suid/sgid by default even if BINMODE is defined.


# 1.254 10-Dec-2010 joerg

Revert last, gcc(1) checks explicitly for -r on some platforms to disable
passing down --relax as well.


# 1.253 08-Dec-2010 joerg

gcc passes down -r directly to ld, so make it explicitly a linker option.


# 1.252 08-Dec-2010 joerg

Don't depend on ${CC} passing down -R to ld, use -Wl,-rpath explicitly.


# 1.251 08-Nov-2010 lukem

Preserve date on original shared library or program when stripping
the debug symbols and adding the debug-link to .debug.
Use '(rm -f file; false)' in the failure path to force failure.
Based on solution proposed by Nicolas Joly on tech-toolchain in July 2010.
Should fix PR toolchain/44046 from Andreas Gustafsson.


# 1.250 31-Oct-2010 mbalmer

Link Lua to the build and add the resulting files to the distribution sets.
Document the addition of Lua and the change we made to the default settings.


# 1.249 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.248 24-Apr-2010 lukem

When extracting separate debug symbols with MKDEBUG, there's no need
to leave the original file unstripped...


# 1.247 02-Mar-2010 darran

DTrace: Add CTF generation to the make framework. Only enabled when
MKDTRACE=yes.


# 1.246 14-Dec-2009 mrg

use "${CC} -r" not "${CC} -Wl,-r" as the latter fools GCC on some targets
and it ends up passing "-r -relax" to ld, which causes ld to barf.


# 1.245 14-Dec-2009 matt

Merge from matt-nb5-mips64


Revision tags: matt-premerge-20091211
# 1.244 08-Dec-2009 uebayasi

When PROGS / LIBS are used, you can pass each PROG / LIB specific parameters
to ${LD} via:

${LDADD.${PROG}}
${LDFLAGS.${PROG}}
${LDSTATIC.${PROG}}
${LDADD.${LIB}}
${LDFLAGS.${LIB}}

OTOH you can't pass parameters to ${CC}, because in suffix rules make(1) only
knows the name of ${.IMPSRC} and ${.TARGET}; it's users' responsivility to
define ${CC} parameters to all the sources of a given ${PROG} / ${LIB}.

Should address bin/42381.

(Bug in this commit log was pointed out by mrg@.)


# 1.243 27-Nov-2009 tsutsui

If CPPFLAGS or CXXFLAGS already contains -nostdinc or -nostdinc++,
don't add ${CPPFLAGS_ISYSTEM} or ${CPPFLAGS_ISYSTEMXX} to refer
${DESTDIR}/usr/include or ${DESTDIR}/usr/include/g++.

This change might cause errors on some MD stand dir, but in that case
each Makefile should be fixed to search proper system include paths
by -Ipath option in own CPPFLAGS.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.242 12-May-2009 plunky

remove libsdp as improved functionality has been enabled in libbluetooth.


# 1.241 10-Apr-2009 apb

Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links. They have no effect except when using a
metalog, in which case the information is added to the metalog. In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg. This should fix PR 24457 and PR 41155.


# 1.240 24-Nov-2008 cube

branches: 1.240.2;
Move cleanextra to the very ends in case another included file wants to add
to it even if it was initially empty.


Revision tags: netbsd-5-base matt-mips64-base2
# 1.239 19-Oct-2008 christos

branches: 1.239.2;
handle assembly files for MKPIE


# 1.238 16-Oct-2008 christos

Provide a way for a program to override the PIE flags.


# 1.237 15-Oct-2008 christos

don't compile/link libraries with pie


Revision tags: mjf-devfs2-base
# 1.236 02-Oct-2008 joerg

Hook up libfetch and pkg_install update.


Revision tags: wrstuden-revivesa-base-3
# 1.235 09-Sep-2008 joerg

Add MKSTRIPIDENT to remove the RCS IDs from binary programs and shared
libraries for space-constraint systems. The description is based on the
feedback of hubertf@, the logic on input from lukem@

This obsoletes the removal of LIBC_SCCS and SYSLIBC_SCCS for libc builds.


Revision tags: wrstuden-revivesa-base-2
# 1.234 28-Aug-2008 mrg

update a comment example


# 1.233 27-Aug-2008 rtr

use ${X11USRLIBDIR} instead of hard-coded /usr/X11R6/lib when building
${LIB.foo} vars


# 1.232 27-Aug-2008 lukem

Fix problem I introduced in rev 1.231 on 2008/08/25 where ${_PROGLDOPTS}
and -L${_GCC_LIBGCCDIR} were appearing in the link line before ${LDADD},
so -L${DESTDIR}/lib and -L${DESTDIR}/usr/lib were being used before
local -L library paths.
Fixes ntpd/ntpdate failure noticed by Valeriy E. Ushakov <uwe@NetBSD.org>


# 1.231 25-Aug-2008 lukem

Always link with: -Wl,-rpath-link,${DESTDIR}/usr/lib -L${DESTDIR}/usr/lib
Fixes problem with MKDYNAMICROOT=no triggered by libraries that depend
on other libraries.
Related to PR 33503.

Clean up setting of _CCLINK to always add the appropriate -B options.

Simplify the link rule for a program.


# 1.230 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.229 28-May-2008 lukem

add LIBLDAR_R (for completeness)


# 1.228 22-May-2008 lukem

Add MKLDAP, USE_LDAP, LIBLBER, LIBLDAP


Revision tags: hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-pf42-base
# 1.227 10-Apr-2008 tsutsui

branches: 1.227.2; 1.227.4;
Add libhx509 to PAM_STATIC_LDADD which is required by libkrb5.


# 1.226 22-Mar-2008 mlelstv

branches: 1.226.2;
Import Heimdal-1.1


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase matt-armv6-base hpcarm-cleanup-base
# 1.225 26-Dec-2007 jmmv

Make the clean target work when OBJS is set but PROG is not, as happens
for example in gnu/lib/crtstuff4. Reported by drochner@.


Revision tags: cube-autoconf-base
# 1.224 13-Nov-2007 jmmv

Fix typo that prevented MKDEBUG builds to work. Found by drochner@.


# 1.223 12-Nov-2007 jmmv

Add the ability to build multiple programs from a single directory

This adds support for a new set of variables, PROGS and PROGS_CXX, that
allow the developer to build multiple different programs from a single
source directory.


# 1.222 04-Nov-2007 tls

Remove MKPRIVATELIB from BIND libraries; move library reachover
directories and Makefiles from src/usr.sbin/bind to src/lib; make
BIND libraries build shared. Saves about 1MB-1.5MB per installed
executable, about 5MB for a base+etc minimal installation of NetBSD.


Revision tags: matt-mips64-base
# 1.221 29-Jul-2007 joerg

branches: 1.221.4; 1.221.6;
Add build glue for libarchive and update the various sets.


# 1.220 25-Jan-2007 perry

Before I completely forget the issue, convert "PROG_PAX" to the
better-named "PAXCTL_FLAGS".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.219 11-Nov-2006 christos

don't run paxctl if other commands were specified for that target.


# 1.218 10-Nov-2006 christos

if ${PROG_PAX} is defined, run paxctl on the binary after linking with
the value of the variable. This way, if you set:

PROG_PAX=+M

in /etc/mk.conf, you get what you deserve.


# 1.217 22-Oct-2006 pooka

libpuffs


# 1.216 09-Oct-2006 mrg

- clean up some comments to reality.
- retire LIBDCK, LIBG2C and (long broken) USE_LIBSTDCXX
- in bsd.hostprog.mk's LIBSTDCPP -> LIBSTDCC
- add LIBSUPCXX
- don't default USE_LIBSTDCXX or USE_GCC4 since they are
not used in the tree any where
- same with USE_XF86_4; retire it
- remove _SUPCXX handling in bsd.prog.mk

inspired by PR#26714.


Revision tags: abandoned-netbsd-4-base
# 1.215 23-Jul-2006 lukem

Implement MKDEBUG:
If "no", don't build and install separate debugging symbols
into /usr/libdata/debug.
Default: no


# 1.214 19-Jun-2006 gdamore

Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.


# 1.213 09-Jun-2006 christos

PR/33681: Scott Ellis: Building 'bc' with SHAREDSTRINGS=yes fails
We need CPPFLAGS too now.


# 1.212 11-May-2006 mrg

add support for ${OBJCOPTS} and ${OBJCOPTS}.<lib|prog|fn>.


# 1.211 20-Mar-2006 christos

There is always one more KRB4 thing to remove. (from Jukka Salmi)


# 1.210 20-Mar-2006 christos

Remove krb4 variables and libraries (Jukka Salmi)


# 1.209 16-Mar-2006 jwise

Now that we have real build system support for syspkgs, remove someone's
half-implemented idea of building `syspkgs' (really a few giant blobs of the
same granularity of the old sets) using install(1).


# 1.208 20-Jan-2006 christos

Add the world of libraries to the static pam build. Now static pam binaries
work.


# 1.207 09-Apr-2005 dsl

Report when we link a program into xxx.ro (before being crunched)


Revision tags: netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.206 04-Mar-2005 he

branches: 1.206.2; 1.206.4;
Introduce PAM_STATIC_LDADD and PAM_STATIC_DPADD. When compiling
with MKPIC=no, possibly because the target does not support shared
libraries, these include libraries required to resolve all symbols
which end up referenced from PAM-using applications. The libraries
presently required are -lcrypt, -lrpcsvc and -lutil.

Add use of these variables which are currently set up to use PAM,
so that they compile when MKPIC=no.

Also, in the telnetd case, reorder the order of the libraries, so
that libtelnet.a comes before -ltermcap and -lutil, again to fix
link error when MKPIC=no.

Discussed with thorpej and christos.


# 1.205 20-Feb-2005 christos

Add libradius


# 1.204 12-Jan-2005 lukem

If RESCUEDIR is defined, automatically add that to CPPFLAGS


# 1.203 08-Jan-2005 lukem

Implement <bsd.prog.mk> vars:
LIBASN1 LIBBSDMALLOC LIBG2C LIBPAM LIBSSH


# 1.202 04-Aug-2004 lukem

Revert most of previous, and move the LIB<libname>?= assignments
back to bsd.prog.mk from bsd.own.mk.

pkgsrc uses <bsd.own.mk>, and setting LIB<libname> in it causes
problems with various package builds.
This should fix PR #26542 submitted by Jim Bernard.

(I'll be implementing the DPADD for shared libraries in a different
manner that generally won't depend upon ${LIB<libname>}.)


# 1.201 30-Jul-2004 lukem

Move the LIB<libname>?= assignments from bsd.prog.mk to bsd.own.mk so
that they may be used by non PROGs (e.g., LIBs).

Improve some comments.


# 1.200 10-Jun-2004 lukem

Be consistent in handling YHEADER, similar to Christos' fix in bsd.lib.mk 1.253


# 1.199 21-May-2004 ross

If you add a library, you need to define its DPADD symbol here.

Add LIBMAGIC.


Revision tags: netbsd-2-0-base
# 1.198 15-Feb-2004 skrll

branches: 1.198.2;
Be more gcc like in the way we deal with libgcc so that sh3/hppa millicode
and exception handling have a chance of working properly.

- creates libgcc, libgcc_eh and libgcc_s

- updates LIBGCC_SPEC to use them appropriately.

There's a hack in here at the moment with respect to libgcc_so in that it
is preferable to link against libgcc_so will only when -shared-libgcc is
specified (the c++ frontend does this automatically.) Configurations where
LINK_EH_SPEC is defined already do this. The gcc configuration for
NetBSD/alpha and another NetBSD platform (I forget which) actually define
LINK_EH_SPEC probably by accident rather than design.

- updates share/mk to use the compiler's knowledge of what needs linking into
libraries and executables. This removes an hppa hack.

- updates the sets for the newly created libgcc* files.

- support for linking against the _pg version of libgcc has been removed.


# 1.197 29-Jan-2004 lukem

Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.


# 1.196 27-Jan-2004 lukem

Replace
:M-[IDU]*
with
:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)


# 1.195 23-Jan-2004 simonb

crt0.o lives in /usr/lib even on a.out.


# 1.194 16-Nov-2003 lukem

simplify with _MKTARGET_LINK


# 1.193 11-Nov-2003 dsl

Set MKDEP_SUFFIXES to get additional targets in .depend instead of using
sed in .afterdepend. I don't think .afterdepend is used anywhere any more.


# 1.192 21-Oct-2003 lukem

Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.


# 1.191 19-Oct-2003 lukem

Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} " ... {$.TARGET}" and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO


# 1.190 18-Oct-2003 lukem

Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command ("verbose")
This is the default, and is equivalent to the previous behaviour.


# 1.189 29-Sep-2003 lukem

Add LIBSTDCXX (for usr/lib/libstdc++.a).
Sync LIB* documentation with reality.


# 1.188 19-Sep-2003 martin

Drop explicit medlow model and default to -O2 for sparc64.


# 1.187 14-Sep-2003 lukem

Check ${SHLIBDIR} against "/usr/lib" instead of ${LIBDIR} when determining
if we need to add stuff (usually "/lib") to the rpath-link path before
"/usr/lib". Otherwise, this barfs if LIBDIR != /usr/lib or /lib, and
we're cross-building (e.g., in src/x11)


# 1.186 13-Sep-2003 erh

Also support per-program LDFLAGS and LDSTATIC.


# 1.185 13-Sep-2003 erh

Create a way to add additional flags to COPTS, CPPFLAGS, CXXFLAGS and LDADD
for particular libraries or programs by specifying the additions in mk.conf
instead of needing to go edit individual Makefiles.


# 1.184 12-Sep-2003 lukem

add infrastructure to support reach-over builds of xsrc


# 1.183 22-Aug-2003 dsl

Add a ${PROG}.ro target that does an 'ld -r' of the program object files.
Allows a much simplified build of 'crunched' binaries since crunchgen can
build prog.ro instead of having to deretmine the names of all the .o files.


# 1.182 01-Aug-2003 lukem

Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".


# 1.181 01-Aug-2003 lukem

simplify the ${PROG}: target to reduce duplication between the DESTDIR
and !DESTDIR cases...


# 1.180 31-Jul-2003 lukem

bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.


# 1.179 31-Jul-2003 lukem

Don't need -R/usr/lib; it will be searched at the end by ld.elf_so anyway.
Noted by matt green <mrg@>


# 1.178 28-Jul-2003 lukem

be consistent when adding *.y and *.l to DPSRCS


# 1.177 28-Jul-2003 lukem

replace MKCXXSUPCXX(!=no) with USE_LIBSTDCXX(==no)


# 1.176 28-Jul-2003 lukem

Change defined(CXX_SUPCXX) to MKCXXSUPCXX != "no".

Clarify that command-line overrides of the MKxxx variables should be
done via the environment rather than make(1) command-line variable
assignment, since the latter doesn't actually work as intended.


# 1.175 27-Jul-2003 mrg

introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes. for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)


# 1.174 26-Jul-2003 mrg

add a new bsd.own.mk variable: CXX_SUPCXX. from bsd.README:
+ CXX_SUPCXX If defined, the support libraries needed for this C++ program
+ are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.


# 1.173 20-Jul-2003 lukem

Consistently support the different C++ file extensions: .cc .cpp .cxx .C
Noted by Andrew White in PR toolchain/18246


# 1.172 18-Jul-2003 lukem

Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was defined.
Replace defined(UNPRIVED) tests with ${MKUNPRIVED} != "no"

Add MKUPDATE; if not no has the same semantics as if UPDATE was defined.
Replace defined(UPDATE) tests with ${MKUPDATE} != "no"

Improve documentation for these and other make flags.


# 1.171 16-Jul-2003 itojun

stop installing install libtelnet. build under lib/libtelnet and reference
it from usr.bin/telnet and libexec/telnetd.
(reason for separate build: compiler flags)


# 1.170 27-Jun-2003 drochner

For consistency, use "-R" instead of "-Wl,-rpath" to pass
a runtime search path to the linker.


# 1.169 13-Jun-2003 itojun

define LIBEVENT


# 1.168 11-Jun-2003 msaitoh

catch signal 1,2,3,13 and 15 to clean /tmp/_dependXXX


# 1.167 31-May-2003 thorpej

If EXTERNAL_TOOLCHAIN is defined, allow the compiler to define the
location of crt{begin,end}{,S}.o and libgcc.a. Encapsulate all of
this logic into the new bsd.gcc.mk, and use it in bsd.prog.mk and
bsd.lib.mk.


# 1.166 18-May-2003 lukem

make this a no-op if HOSTPROG is defined


# 1.165 30-Mar-2003 thorpej

If MACHINE_ARCH is powerpc and we HAVE_GCC3, add crtsaveres.o to the
endfile spec.


# 1.164 22-Feb-2003 uwe

Typo in comment.


# 1.163 24-Jan-2003 thorpej

Add LIBPTHREAD, LIBPTHREAD_DB, and LIBRT.


Revision tags: fvdl_fs64_base
# 1.162 22-Nov-2002 thorpej

Split crtbegin/crtend into crti/crtbegin/crtend/crtn. NetBSD-specific
things like the .note.netbsd.ident section are provided by crti/crtn.
crti/crtn also provide the _init() and _fini() routines.

crtbegin/crtend now only provide support for ctors/dtors. This paves
the way to using the "crtstuff" provided with GCC (when we upgrade to
GCC 3.3), which provides, among other things, much better C++/Java
exception handling.


# 1.161 12-Nov-2002 itohy

MKDYNAMICROOT for a.out


# 1.160 22-Oct-2002 perry

Pass 1 of SYSPKG changes to automatically add tags=pkgname_pkg to METALOG.
Not quite ready for prime time yet.


# 1.159 27-Sep-2002 thorpej

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.


# 1.158 26-Sep-2002 itojun

MDC2 is a patented algorithm; don't ship it in default libcrypto.
MKCRYPTO_MDC2 will build a separate library, libcrypto_mdc2.


# 1.157 08-Sep-2002 thorpej

Build a .gdbinit in the objdir when building a program. The .gdbinit
file sets the shared library prefix to ${DESTDIR}, and adds "sources"
directives for each file listed in the GDBINIT Makefile variable.


# 1.156 09-Aug-2002 thorpej

Add LIBPMC.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.155 27-Mar-2002 eeh

branches: 1.155.2;
Use the medium low model for sparc64 programs that don't 2GB of data segment.


# 1.154 11-Feb-2002 mycroft

Don't use .PHONY for targets that are actually installed. Instead use force
dependencies. (Among other things, `make -t install' does something vaguely
sensible now.)


# 1.153 07-Feb-2002 pk

Mark installed system libraries as .MADE only if we're actually establishing
their default variable values here.


# 1.152 04-Feb-2002 christos

s/.NOSUFF/.MADE/


# 1.151 03-Feb-2002 christos

Apply a .NOSUFF: directive to targets we don't want to have processed by
the suffix rules engine.


# 1.150 02-Feb-2002 veego

Ups, it is LIBUSBHID and not LIBUSBHIB.


# 1.149 02-Feb-2002 veego

Change LIBUSB to LIBUSBHIB, reflecting the library name change.


# 1.148 29-Jan-2002 enami

Mark the targets clean{extra,objs} as PHONY.


# 1.147 04-Jan-2002 thorpej

For PROG_CXX DESTDIR builds, pull in -lstdc++ and -lm regardless
of GCC version.


# 1.146 01-Jan-2002 thorpej

Per a suggestion from matthew green, PROG_CXX takes the place of
PROG for C++ programs.


# 1.145 01-Jan-2002 thorpej

* If PROG_CXX is set by the program's Makefile, use ${CXX} to link
the program rather than ${CC}.
* If HAVE_GCC3 is defined, pull in "-lstdc++ -lm" as additional C++
support libraries for DESTDIR builds.


# 1.144 28-Dec-2001 lukem

* 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


# 1.143 28-Nov-2001 tv

If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.


# 1.142 19-Nov-2001 thorpej

Use a little transitional hack to determine if we use -isystem
or -idirafter. Use the former only of USE_NEW_TOOLCHAIN, since
-isystem causes the old toolchain to bomb out when building
libstdc++.


# 1.141 14-Nov-2001 tv

C/..$/.c/ -> C/\..$/.c/


# 1.140 14-Nov-2001 tv

Move the DESTDIR-based nostdinc logic to bsd.lib.mk and bsd.prog.mk where
it belongs (with the native target compile rules).


# 1.139 02-Nov-2001 tv

Use INSTALL_FILE/INSTALL_DIR as appropriate.


# 1.138 02-Nov-2001 tv

Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.


# 1.137 19-Oct-2001 tv

Add .NOPATH for all files generated from .l or .y files in SRCS. Fixes PRs
bin/14187 and lib/14239.

Also simplify the handling of these transforms to .c and .h files a bit by
leveraging make's builtin macro operators.


# 1.136 25-Sep-2001 tv

Set .NOPATH on program to build to make sure it goes in .OBJDIR.
Problem noted by <seebs@plethora.net>.


# 1.135 24-Sep-2001 lukem

fix previous (hi thor!) - $OBJS and $CLEANFILES might be empty, and
rm needs some files to delete...


# 1.134 24-Sep-2001 tls

Split "cleanprog" target apart: now you can zap only object files or
CLEANFILES (needed to fix crunchgen lossage).


# 1.133 13-Sep-2001 thorpej

Add LIBPCI.


# 1.132 14-Aug-2001 tv

Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").


# 1.131 01-Jun-2001 tv

Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).


# 1.130 08-May-2001 sommerfeld

Suppress duplicate entries in ALLFILES, FILES, INCS, DEPINCS, INFOFILES,
NLSALL, CATPAGES, MANPAGES, HTMLPAGES, and SCRIPTS.


# 1.129 19-Feb-2001 jmc

Wrap target() checks around afterdepend rule as some Makefiles override this


# 1.128 26-Jan-2001 itojun

fix typo in LIBSSL decl. it made programs with DPADD+=${LIBSSL} to build
every time we type "make". From: bernd


# 1.127 14-Jan-2001 christos

use the new .if commands(<target>) directive so that we don't have to
change Makefiles.


# 1.126 14-Jan-2001 christos

fix thinko: test for the existance of the target before we define it...


# 1.125 14-Jan-2001 christos

Alter previous redefined target protection. If the ${PROG} target is defined,
add the dependencies as usual, but don't add the commands. This avoids
having to change all the Makefiles that redefine the PROG target.


# 1.124 14-Jan-2001 christos

allow programs to override the program target.


# 1.123 08-Jan-2001 mrg

add missing $LIBCRYPTO_RC5 and $LIBCRYPTO_IDEA


# 1.122 08-Jan-2001 mrg

add missing $LIBSSL


# 1.121 04-Jan-2001 garbled

Add LIBCDK and LIBFORM definitions


# 1.120 31-Oct-2000 itojun

add ${LIBINTL} for use with DPADD.


# 1.119 07-Oct-2000 deberg

fix typos, PR 11159


# 1.118 25-Jun-2000 erh

For the case when DESTDIR is set: move the -L${DESTDIR}/usr/lib after ${LDADD} so any -L directories set in LDADD are searched first to avoid possibly linking against old versions of libraries.


Revision tags: netbsd-1-5-base
# 1.117 19-Jun-2000 thorpej

branches: 1.117.2;
Sync up the LIB* list.


# 1.116 10-Jun-2000 mycroft

Use ${.ALLSRC:T} when doing the generated variable name lookups, so that it
DTRT for generated files in and obj directory (or accessed via .PATH).


# 1.115 06-Jun-2000 mycroft

Abuse .USE some more.


# 1.114 06-Jun-2000 mycroft

Minor rearrangement.


# 1.113 06-Jun-2000 mycroft

Use ODE make(1) features to eliminate extra variables and move several things
outside of .for loops. (Needs more work to completely eliminate .for.)

XXX Don't look at this stuff. It will make your head hurt.


Revision tags: minoura-xpg4dl-base
# 1.112 14-Apr-2000 mrg

branches: 1.112.2;
use -rpath-link rather than -R when linking objects using a DESTDIR.
this replaces the previous change as that ended up adding
$DESTDIR/usr/lib to the runtime path of every binary created, which
is bogus and dangerous.


# 1.111 25-Mar-2000 mycroft

When linking with $DESTDIR, use an explicit -R to get library dependencies
correct.


# 1.110 07-Mar-2000 veego

Remove unused libahdi.
It will be replaced in the future with a more generic libdisklabel.


# 1.109 05-Feb-2000 jdc

Add libahdi entries.


# 1.108 23-Jan-2000 eeh

Add some support for FCode binaries.


# 1.107 22-Jan-2000 mycroft

Make `dependall' play nicely with SUBDIR, using a hack similar to `realinstall'
for both `depend' and `all'.
Also, remove the old hack that invokes an extra shell for .depend, now that
make(1) has been fixed.


# 1.106 16-Jan-2000 assar

all: depend on ${SCRIPTS} so that they get generated if they need to


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.105 23-Nov-1999 blymn

Added libmenu library.


Revision tags: comdex-fall-1999-base
# 1.104 14-Sep-1999 perry

branches: 1.104.4;
Add a "dependall" target, which does a "make depend" and then "make all"
in a single directory. This is useful in "make build" because by doing
the build immediately after the depend, all sources will typically
still be in the buffer cache, thus saving significant time over doing
a "make depend" on all the directories and then a "make all".


# 1.103 04-Sep-1999 fredb

Permit "make all install", as well as "make foo install" (where foo would be
installed by "make install") without setting of BUILD. All cases where BUILD
is already set are unchanged from the old behavior.

"make all install" is now practically equivalent to "make BUILD= all install",
but without actually setting build.

Fixes pr's 8313, 3894.


# 1.102 21-Aug-1999 simonb

Add ${INSTPRIV} to ${INSTALL} commands.


# 1.101 01-Jul-1999 itojun

branches: 1.101.2;
add LIBIPSEC for use from DPADD.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.100 12-Feb-1999 lukem

branches: 1.100.2;
* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.99 10-Feb-1999 tv

libbfd_pic.a is no longer installed; remove ${LIBBFD} define.


# 1.98 04-Feb-1999 christos

PR/2936: Brian C. Grayson: Avoid truncating precious files when installing
and the filesystem is full. Added ${RENAME} flag to install, which when set
to -r installs on a temporary file and then renames to the final destination.
${RENAME} is currently set to nothing in bsd.own.mk, but one can turn it
on in /etc/mk.conf.


# 1.97 07-Nov-1998 jonathan

Do DESTDIR support for crtbegin/crtend on all ELF ports (adds mips).


# 1.96 28-Sep-1998 christos

Use preserve flag in install.


# 1.95 10-Sep-1998 ross

Define a LIBBZ2?=... for use in DPADD=... lines.


# 1.94 09-Aug-1998 lukem

add distclean as a synonym for cleandir


# 1.93 09-Apr-1998 tv

.y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.


# 1.92 01-Apr-1998 tv

Revert. This broke too much in the build tree, and a better solution
needs to be created. (The existing situation breaks a lot too.)


# 1.91 01-Apr-1998 tv

Fix .y rules to DTRT with possibly generated .h files. See mail on
tech-toolchain for a very detailed explanation of this. In short, add
a .y.h rule identical to the .y.c rule and make the .y.c rule rename
the .h file; also, clean the .h file in CLEANFILES.


# 1.90 03-Nov-1997 cgd

echo the lint command line when making 'lint'.


# 1.89 28-Oct-1997 lukem

add ${LIBOBJC}


Revision tags: netbsd-1-3-base
# 1.88 11-Oct-1997 mycroft

branches: 1.88.2;
Several changes:
* Allow bsd.man.mk to be included separately.
* Always include bsd.own.mk and bsd.obj.mk.
* Include bsd.man.mk and bsd.nls.mk even if NOMAN or NONLS; just turn off
building of the affected files instead.
* Require bsd.subdir.mk to be included explicitly.
(Will make appropriate changes to Makefiles shortly.)


# 1.87 29-Sep-1997 gwr

Add $LIBBFD


# 1.86 31-May-1997 cjs

Back out BUILDDIR and NOINSTALL changes.


# 1.85 26-May-1997 cjs

branches: 1.85.2;
These updates to the build allow building against include files
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.


# 1.84 18-May-1997 kleink

Add libposix.


# 1.83 17-May-1997 mycroft

Do LINKS and SYMLINKS after FILES and INCS.


# 1.82 17-May-1997 mycroft

Remove unneeded .SUFFIXES lines, and move .s and .S closer to .o to give the
right preferences.


# 1.81 09-May-1997 mycroft

Fix typo in previous.


# 1.80 09-May-1997 mycroft

Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.79 09-May-1997 mycroft

Remove cruft.


# 1.78 09-May-1997 mycroft

Oops; rearrange dependencies to get things built early enough.


# 1.77 09-May-1997 mycroft

Make sure INCS and SRCS are built if necessary.


# 1.76 08-May-1997 gwr

Set the .NOPATH flag for ${OBJS} (from Christos).


# 1.75 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.74 07-May-1997 mycroft

Various simplifications.


# 1.73 07-May-1997 mycroft

Shuffle some .PHONYs around, to work better with `-t'.


# 1.72 06-May-1997 mycroft

Make most of the install targets .PRECIOUS.


# 1.71 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.70 18-Apr-1997 christos

Add ${LIBNTP}


# 1.69 17-Apr-1997 thorpej

- Properly depend on crtbegin.o and crtend.o for platforms that use
them (currently Alpha and PowerPC)
- STRIP -> STRIPFLAG


# 1.68 03-Apr-1997 mikel

don't allow override of all: target


# 1.67 29-Mar-1997 mikel

merge lite-2 changes (mostly SCCSids)


# 1.66 27-Mar-1997 christos

Put the FILES generated rules in a separate .mk file since both bsd.prog.mk
and bsd.lib.mk use them.


# 1.65 27-Mar-1997 mycroft

Make the SCRIPTS case mimic the FILES case more closely, so we can override
the destination direectory, etc.


# 1.64 27-Mar-1997 mycroft

Remove knowledge of HIDEGAME from here.


# 1.63 24-Mar-1997 christos

make rules update:
- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation


# 1.62 22-Mar-1997 perry

Fix SYMLINKS not to include DESTDIR in the link itself


# 1.61 13-Mar-1997 perry

add SYMLINKS, by analogy to LINKS. Vetted by Christos.


# 1.60 22-Jan-1997 cgd

if 'clean' is not already defined, rather than simply defining it with
a bunch of rules, define a clean{kmod,lib,prog} target with the rules,
and have both clean and cleandir depend on that. That eliminates a bug
where 'cleandir' in a directory which included e.g. bsd.prog.mk but which
also had subdirs would 'make clean' all the subdirs and then 'make cleandir'
all ofthe subdirs. It also allows Makefiles to add more dependencies
to 'clean' after inclusion of the make template.

If 'clean' is already defined, the behaviour is the same as it used to be.


# 1.59 20-Dec-1996 cgd

add an afterdepend target (a la the one in bsd.lib.mk) that processes
the .depend file to add <filename>.ln for each <filename>.o as an
object file which has the given dependencies (in addition to
<filename>.po and <filename>.so, which were already there).


# 1.58 13-Dec-1996 mikel

add missing LIBPCAP definition.


# 1.57 26-Nov-1996 mrg

add libz and libwrap


# 1.56 18-Oct-1996 thorpej

Use ${INSTALL} rather than "install".
From Simon J. Gerraty <sjg@zen.void.oz.au>, PR #1458.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.55 08-Apr-1996 jtc

Sort LIBFOO definitions and add LIBY; Reported by Mike Long <mike.long@analog.com> in PR #2301.


# 1.54 22-Oct-1995 christos

Added include file <bsd.sys.mk> that contains lex and yacc "parallel aware"
rules. These rules are not turned on by default; they are enabled by setting
the PARALLEL variable.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.53 25-Jun-1995 cgd

oops; fix an rm that might be empty


# 1.52 24-Jun-1995 cgd

update lint rules, but keep linting disabled


# 1.51 10-Jun-1995 mycroft

Define LIBEDIT.


# 1.50 21-Apr-1995 jtc

.include <bsd.nls.mk> unless NONLS is defined.


# 1.49 22-Dec-1994 cgd

specify man pages differently, and document how.


# 1.48 24-Aug-1994 mycroft

Include bsd.own.mk earlier.


# 1.47 20-Jul-1994 cgd

fix from christos, for progs w/o objects


Revision tags: netbsd-1-0-base
# 1.46 06-Jul-1994 mycroft

branches: 1.46.2;
Pull libraries from ${DESTDIR} if set. Kill LDONLY, which is unused and
probably not useful anyway.


# 1.45 30-Jun-1994 cgd

fix modify-info-nothingness-then-substitute probelm that broke genclass build


# 1.44 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.43 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.42 28-Jun-1994 jtc

Strip *.sh when constructing OBJS from SRCS.
This will allow us to clean up makefiles that build a script by munging
a template (uusched, genclass, neqn, etc.).


# 1.41 18-Jun-1994 cgd

don't chown the symlink, when HIDEGAME causes a symlink to be made to dm.
4.4-based FS code _follows_ the symlinks on a chown(2) call.


# 1.40 24-May-1994 cgd

fix the last to do the right thing for dependencies


# 1.39 24-May-1994 deraadt

LIBSKEY


# 1.38 22-May-1994 jtc

Single source file programs are now compiled into object files before they
are linked. This change halves the time it takes to rebuild all of the
NetBSD sources when only the C library is "touched"; but only takes about
one percent more disk space.


# 1.37 06-Apr-1994 chopps

relink (recompile) single source programs when crt0.o is updated.


# 1.36 24-Mar-1994 mycroft

Remove *.core on clean.


# 1.35 09-Feb-1994 cgd

kill install -d's.


# 1.34 28-Jan-1994 cgd

add LIBKVM


# 1.33 10-Nov-1993 cgd

librpc doesn't exist anymore


# 1.32 08-Nov-1993 cgd

ad LDSTATIC flag, so static linking can be made one-stop shopping.
use "setenv LDSTATIC" to make *everything* dynamically linked,
setenv LDSTATIC -static for everything statically linked, or unset
it for default behavior.


# 1.31 07-Oct-1993 cgd

LIBTERM pointed at nothing, but was meant to point to libtermcap.a...


# 1.30 07-Oct-1993 cgd

always define LIBCRYPT


# 1.29 17-Aug-1993 mycroft

Make sure we don't recurse into subdirectories if Makefile specified `install'
target. (It's usually blank and is specifically to avoid doing this...)


# 1.28 15-Aug-1993 mycroft

Automatically include bsd.subdir.mk for backward compatibility.


# 1.27 15-Aug-1993 mycroft

Don't automatically include bsd.subdir.mk in bsd.prog.mk and bsd.lib.mk.
Put back .MAIN in bsd.man.mk, and be careful not to include ../Makefile.inc
a second time.


# 1.26 15-Aug-1993 mycroft

Move man rules to sys.mk.
Use bsd.subdir.mk for building subdirectories.
Don't forget to remove x.cc and x.C when using SHAREDSTRINGS.
Make ${PROG} always depend on ${LIBCRT0}.
Don't duplicate code between cleandir and clean.
Move tags target to bsd.dep.mk.
Move STRIP to bsd.own.mk.
Remove redundant definitions of {BIN,MAN}{DIR,GRP,OWN,MODE}.
Move {LIB,DOC}{DIR,GRP,OWN,MODE} defaults to bsd.own.mk.


# 1.25 15-Aug-1993 mycroft

Abstract out dependency stuff, and add RCS identifiers.


# 1.24 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


# 1.23 10-Aug-1993 mycroft

Put LINKS handling in `install' target, so it's the last thing executed, and
happens even if `realinstall' is user-defined.


# 1.22 30-Jul-1993 mycroft

When generating a default OBJS, ignore .h files.


# 1.21 29-Jul-1993 mycroft

Don't print the `making ...' message if an obj dir already exists.
Also, a minor cleanup.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.20 17-Jul-1993 mycroft

Fix C++ dependencies for good. `make depend' is now done in two passes--one
of C files and one for C++ files. No need to specify `-+' in your Makefile,
as it is now done automatically.


# 1.19 17-Jul-1993 cgd

do c++ dependencies the right way...


# 1.18 17-Jul-1993 mycroft

Add suffix rules for C++ files.


# 1.17 04-Jun-1993 brezak

Add LIBRPCSVC variable.


# 1.16 02-Jun-1993 cgd

add ability to specify c++ dependencies, by setting CFLAGS+=-+ for
the dependency make.


# 1.15 26-Apr-1993 cgd

added definition for DPADD library variable LIBCRYPT.


# 1.14 26-Apr-1993 mycroft

Don't redefine `realinstall' target if already defined.


# 1.13 25-Apr-1993 mycroft

Link with LDFLAGS even if one source module.


# 1.12 25-Apr-1993 mycroft

Don't lose if we include bsd.prog.mk only to build man pages.


# 1.11 25-Apr-1993 mycroft

Fix error in last change. (Oops.)


# 1.10 25-Apr-1993 mycroft

Don't build man pages if NOMAN set.


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.9 09-Apr-1993 cgd

various changes to default make rules. from patch 101.
note that only the "sensible" changes in patch 101 are implemented.


# 1.8 08-Apr-1993 cgd

try to do the right thing, in terms making directories before we
install into them, and get the manpage cleans _OUT_ of "clean".
they don't belong there, only in cleandir, WFJ be damned.


# 1.7 08-Apr-1993 cgd

fixed typos...


# 1.6 08-Apr-1993 cgd

(silently) make sure we have directories before installing


# 1.5 04-Apr-1993 cgd

make LIBRPC point to the right place


# 1.4 27-Mar-1993 nate

Fixed the doc macros to call troff, eqn,and tbl instead of ditroff,
deqn, and dtbl.
Fixed make clean to remove the man pages (Bill fixed this in the distribution,
but not in the original source)
Changed install to leave the original file around, by using 'cp' instead of
'mv'. "install -c ..."


# 1.3 23-Mar-1993 cgd

made .CURDIR be absolute, not relative, thereby eliminating
the need for some of the makefile trickery when making objects,
and fixing a few .PATH bugs


# 1.2 22-Mar-1993 cgd

fixed "make obj" for cases when sources not in /usr/src/...
if sources not there, it now mkdirs obj, but some trickery
is necessary, to avoid deleting cwd.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.328 04-Apr-2020 christos

Linker semantics have changed; we now don't automatically link dependent
libraries from other DSO's. For example in /usr/bin/passwd:
ld: krb5_passwd.o: undefined reference to symbol \
'UI_UTIL_read_pw_string@@OPENSSL_1_1_0'
ld: /usr/obj/amd64-x86_64/release/lib/libcrypto.so.14: error adding symbols: \
DSO missing from command line


# 1.327 04-Apr-2020 christos

Fix kerberos libraries order


# 1.326 04-Apr-2020 christos

Add libgnuctf


# 1.325 03-Mar-2020 christos

Add fido and cbor


Revision tags: phil-wifi-20191119
# 1.324 18-Nov-2019 christos

Improve the script to check for installed libraries, and fix the wrong
names and obsolete libraries it found.


# 1.323 27-Aug-2019 kamil

Enhance the support of LLVM sanitizers

Define _REENTRANT for MKSANITIZER build. This is needed for at least stdio
code. This caused new build issued with duplicated symbols in few places
and rump kernel code picking different code paths borrowed from libc.
Handle all this in one go.

Add bsd.sanitizer.mk to share common code used by programs and libraries.

Switch from realall to beforeinstall target in .syms files. This is more
reliable in MKSANITIZER.


# 1.322 17-Aug-2019 kamil

Add PAXCTL_FLAG rules for MKSANITIZER

Add per-program rules to disable ASLR for ASan, TSan and MSan in all
sanitized programs. This flag is not needed for other supported sanitizers.

Without this change, sanitized init(8) dies early on startup.

Approach originally suggested by <joerg>


# 1.321 15-Aug-2019 kamil

Add SANITIZER_RENAME_CLASSES in bsd.prog.mk

This adds a more flexible version of SANITIZER_RENAME_SYMBOL.

New symbol allows to specify MKSANITIZER specific renames on per-file and
per-symbol basis.


# 1.320 10-Aug-2019 christos

Make the X11 library lists consistent again.


Revision tags: netbsd-9-base phil-wifi-20190609 pgoyette-compat-20190127
# 1.319 21-Jan-2019 christos

branches: 1.319.2;
Most of the mv operations are to move temporary files to their final place.
Some use -f, others don't. This can lead to spurious build failures when
the user performing the build changes. Centralize, and always use -f.


Revision tags: pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.318 12-Aug-2018 christos

fix broken library variable definitions (inconsistencies between
bsd.README and bsd.prog.mk)


Revision tags: pgoyette-compat-0728
# 1.317 25-Jul-2018 kamil

Introduce MKLIBCSANITIZER in the share/mk rules

Add flags that are required to build a program and a dynamically loaded
library.

Propagade LIBCSANITIZERFLAGS to CFLAGS and CXXFLAGS.

LDFLAGS is not changed on purpose, as a libcsanitizer is inside libc
and no external dependencies are needed.

Register NOLIBCSANITIZER, as certain distribution parts will need to be
skipped.


# 1.316 12-Jul-2018 maxv

Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.


Revision tags: phil-wifi-base
# 1.315 25-Jun-2018 kamil

branches: 1.315.2;
Add a framework for renaming symbols in libc&co for MKSANITIZER

A new keyword SANITIZER_RENAME_SYMBOL. It's a variable that has specified
a list of symbols to be renamed in a processor in order to remove naming
conflicts with public symbols in libc/m/pthread/rt.

This renaming will occur for libraries and programs.
A symbol with a conflicting 'name', will be renamed to '__mksanitizer_name'.

Based on an idea by <christos>


Revision tags: pgoyette-compat-0625
# 1.314 21-Jun-2018 kamil

Refactor MKSANITIZER flags in mk rules

Introduce a new variable SANITIZERFLAGS that contains all the sanitizer
specific flags. These flags are designed to be passed to CFLAGS, CXXFLAGS
and LDFLAGS.

Pass SANITIZERFLAGS in bsd.prog.mk rules to CFLAGS, CXXFLAGS and LDFLAGS.

Pass SANITIZERFLAGS in bsd.lib.mk rules to *_pic.a build flags. The *_pic.a
libraries are designed to construct .so libraries. All .so libraries with
few exceptions are expected to be prebuilt with a sanitizer. Another
purpuse of *_pic.a files can be constructing static PIE programs, however
they are not supported as of now and there is no sanitization of static
programs either.

Once MKSTATICPIE will be supported, it will be initially incompatible with
MKSANITIZER.

This change also makes it easier to build other targets like kernel and
kernel modules without userland sanitizers.

No functional change intended for MKSANITIZER=no users.


# 1.313 02-Jun-2018 christos

Sanitizers don't support static linking.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315
# 1.312 11-Mar-2018 mrg

define LIBXFONT2.


Revision tags: pgoyette-compat-base
# 1.311 25-Feb-2018 mrg

branches: 1.311.2;
add LIBKRB5_LDADD/LIBKRB5_DPADD and their static counterparts
to bsd.prog.mk. use them instead of hard coding various lists
of libraries for krb5.

this fixes static builds.


# 1.310 11-Dec-2017 christos

Instead of checking for obj existance which can be empty for shuttle-rule
programs, check for .sh sources.


# 1.309 10-Dec-2017 christos

don't try to build .debug files for shell scripts.


# 1.308 10-Oct-2017 christos

Add general {DP,LD}ADD.rump variables


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base
# 1.307 21-May-2017 riastradh

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.


# 1.306 21-May-2017 riastradh

Remove some vestiges of MKCRYPTO_IDEA/MKCRYPTO_MDC2.


# 1.305 21-May-2017 riastradh

Remove MKCRYPTO_RC5. Unconditionally include RC5 in libcrypto.so.

This option existed only because RC5 is covered by patents that, twenty
years ago, we had reason to suspect the patent holder, RSA, Inc., might
litigate. The two US patents in question are 5,724,428 and 5,835,600.

According to the USPTO Patent Term Calculator web site at
<https://www.uspto.gov/patent/laws-and-regulations/patent-term-calculator#heading-5>
(retrieved 2017-05-21), patents filed after 1995-06-07 expire twenty
years after the filing date.

number filing date
5,724,428 1995-11-01
5,835,600 1997-04-21

Thus, these patents appear to be expired.

As proposed on tech-crypto and tech-security:

https://mail-index.netbsd.org/tech-crypto/2017/05/05/msg000718.html
https://mail-index.netbsd.org/tech-security/2017/05/05/msg000927.html


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.304 19-Apr-2017 joerg

Add netpgpverify to the library list.


Revision tags: pgoyette-localcount-20170320
# 1.303 20-Feb-2017 rin

add missing LIBCXX


# 1.302 08-Feb-2017 kamil

libpthread_dbg(3) deletion from the base distribution

libpthread_dbg(3) is a remnant library from the M:N thread model
(pre-NetBSD-5.0) API to introspect threads within a process and for use
of debuggers.

Currently in the 1:1 model it's not used in GDB neither in LLDB and it's
not either planned to be used. It's current function to read pthread_t
structures is realizable within a regular debugger capable to
instrospect objects within a tracee (GDB, LLDB...).

Remaining users of this API can still use this library from
pkgsrc/devel/libpthread_dbg.

Sponsored by <The NetBSD Foundation>


# 1.301 29-Jan-2017 christos

add sqlite3 to statically linked libraries for pam.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914
# 1.300 20-Aug-2016 christos

branches: 1.300.2;
unbound additions


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.299 04-Apr-2016 joerg

branches: 1.299.2;
If the per-target LDSTATIC flag is set, don't include the PIE linker
flags as we currently don't support static PIE.


# 1.298 30-Mar-2016 martin

Pass -pie to cc, not -Wl,-pie. This way we have a chance to fix specs
for obscure corner cases like -pie -fPIE -static (used for
/usr/tests/lib/csu/h_initfini2 if building with MKPIE=yes).
While there also replace -fPIC with -fPIE for the PIE case, even if
it should be mostly equivalent.


# 1.297 12-Mar-2016 mrg

remove conditionals that are always true with GCC >= 4.8.


# 1.296 21-Feb-2016 christos

Add NODEBUG


# 1.295 31-Jan-2016 christos

Introduce NOPIE and NOCTF so that standalone programs build properly.


# 1.294 23-Jan-2016 christos

Define _KERNTYPES for things that need it.


# 1.293 07-Nov-2015 joerg

LIBEXECINFO


# 1.292 07-Jun-2015 matt

Make LIBCRT* depend on the right files if MLIBDIR from MKCOMPAT is defined.


# 1.291 01-Dec-2014 erh

PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilt
if any of their dependencies (i.e. the files they refer to) are changed.
This allows changes to transitive included headers to be handled properly.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.290 25-Mar-2014 ozaki-r

branches: 1.290.4;
Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.


Revision tags: riastradh-drm2-base3
# 1.289 09-Mar-2014 christos

let's see if the new dwarf library can handle dwarf 4


# 1.288 02-Mar-2014 christos

If we are compiling with -g and using gcc4.8 and dtrace downgrade
dwarf generation to version 2 for now.


# 1.287 15-Jan-2014 joerg

-Wl,-pie and -r don't agree with each other, so filter the former out.


# 1.286 11-Nov-2013 joerg

Relink binaries if crti.o changes.


# 1.285 29-Sep-2013 christos

Add libxcb


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.284 31-May-2013 mrg

add LIBX11_XCB; unfortunately since the library is named with a -
in it, we have to use an ugly hard coded assignment for now.
(could be cleaned up with more make variable magic i'm sure.)


# 1.283 04-Apr-2013 christos

ldopts should be before ldadd like everywhere else.


Revision tags: agc-symver-base
# 1.282 14-Feb-2013 christos

Since the libraries are produced with different MK flags than the programs,
we check for existance of the files instead of the MK flags.


# 1.281 14-Feb-2013 christos

Add PROGDPLIBS


# 1.280 26-Jan-2013 christos

CTFCONVERT me harder.


Revision tags: yamt-pagecache-base8
# 1.279 17-Jan-2013 christos

Now that we have separate debug sets, add -g if ${MKDEBUG} is set for
program builds since we don't need to install that symbol files.


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.278 24-Aug-2012 jmmv

branches: 1.278.2;
Allow DPADD to be specified on a per-program basis.


# 1.277 23-Aug-2012 joerg

Revert last, it breaks the tricks xsrc uses.


# 1.276 23-Aug-2012 joerg

Remove SHLIBINSTALLDIR and SHLINKINSTALLLIBDIR. Add rpath entries, if
SHLIBDIR differs from /usr/lib.


# 1.275 08-Aug-2012 christos

add MKRUMP by popular demand.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.274 29-Feb-2012 tron

Move "libexpat" from X11 into base which fixes PR lib/40346.
This change was approved by the Core Group.


# 1.273 21-Feb-2012 matt

Remove another ${SIZE}


# 1.272 20-Feb-2012 matt

Remove ${SIZE}


# 1.271 19-Feb-2012 matt

Add support for --combine with gcc.


Revision tags: netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2
# 1.270 05-Nov-2011 christos

branches: 1.270.2;
Add libtre


Revision tags: yamt-pagecache-base
# 1.269 16-Oct-2011 christos

branches: 1.269.2;
- no need to special-case libraries with weird characters.
- add a note about adding new libraries.


# 1.268 16-Oct-2011 christos

fix list of libraries to reflect reality.


# 1.267 10-Sep-2011 apb

Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.


# 1.266 27-Aug-2011 joerg

Add new "analyze" command to run clang's static analyzer in a directory
on all C/C++ files.


Revision tags: cherry-xenmp-base
# 1.265 26-Apr-2011 he

The new Heimdal adds -lwind and -lheimbase to the set of libraries,
so define the corresponding LIB* variables.
These are also needed in the PAM_STATIC_* variables, so add them there too.


# 1.264 11-Apr-2011 joerg

Adjust --sysroot related usage:
-Wl,-rpath does not expand =, so just drop it.

Drop -Wl,-rpath-link entries that duplicate the -Wl,-rpath entries, this
is done implicitly now that ld is built with sysroot support.

Use ${DESTDIR} explicitly for the remaining -Wl,-rpath-link entries.


# 1.263 10-Apr-2011 joerg

For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.


# 1.262 08-Mar-2011 jmmv

Revert previous (revision 1.261): it broke the build because PROG_CXX is
defined in terms of PROG, so later on we would end up with target duplicates
because both PROG_CXX and PROG were being converted to PROGS_CXX and PROGS.

Did not catch this earlier because the test build I did was not clean and
thus the duplicate targets did not have nasty effects.


# 1.261 07-Mar-2011 jmmv

Always convert PROG to its plural form independently of whether PROG_CXX
is defined or not. From Garrett Cooper in private mail.


Revision tags: bouyer-quota2-nbase
# 1.260 20-Feb-2011 jmmv

Define LIBATF_C and LIBATF_CXX to point to their corresponding .a files and
use these to properly set DPADD for test programs.


Revision tags: bouyer-quota2-base
# 1.259 13-Feb-2011 christos

add saslc


# 1.258 06-Feb-2011 joerg

Don't use -nostdinc or -nostdinc++ if this is included in a HOSTLIB.


# 1.257 17-Jan-2011 pooka

branches: 1.257.2;
Add rump bits to DPSRCS so that update builds work correctly.


Revision tags: matt-mips64-premerge-20101231
# 1.256 13-Dec-2010 pooka

befriend RUMPPRG with CRUNCHEDPRG


# 1.255 13-Dec-2010 pooka

Define RUMPPRG, which is just like PROG, except it additionally
builds a rump client with the name rump.${PROG}. The rump client
is not installed suid/sgid by default even if BINMODE is defined.


# 1.254 10-Dec-2010 joerg

Revert last, gcc(1) checks explicitly for -r on some platforms to disable
passing down --relax as well.


# 1.253 08-Dec-2010 joerg

gcc passes down -r directly to ld, so make it explicitly a linker option.


# 1.252 08-Dec-2010 joerg

Don't depend on ${CC} passing down -R to ld, use -Wl,-rpath explicitly.


# 1.251 08-Nov-2010 lukem

Preserve date on original shared library or program when stripping
the debug symbols and adding the debug-link to .debug.
Use '(rm -f file; false)' in the failure path to force failure.
Based on solution proposed by Nicolas Joly on tech-toolchain in July 2010.
Should fix PR toolchain/44046 from Andreas Gustafsson.


# 1.250 31-Oct-2010 mbalmer

Link Lua to the build and add the resulting files to the distribution sets.
Document the addition of Lua and the change we made to the default settings.


# 1.249 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.248 24-Apr-2010 lukem

When extracting separate debug symbols with MKDEBUG, there's no need
to leave the original file unstripped...


# 1.247 02-Mar-2010 darran

DTrace: Add CTF generation to the make framework. Only enabled when
MKDTRACE=yes.


# 1.246 14-Dec-2009 mrg

use "${CC} -r" not "${CC} -Wl,-r" as the latter fools GCC on some targets
and it ends up passing "-r -relax" to ld, which causes ld to barf.


# 1.245 14-Dec-2009 matt

Merge from matt-nb5-mips64


Revision tags: matt-premerge-20091211
# 1.244 08-Dec-2009 uebayasi

When PROGS / LIBS are used, you can pass each PROG / LIB specific parameters
to ${LD} via:

${LDADD.${PROG}}
${LDFLAGS.${PROG}}
${LDSTATIC.${PROG}}
${LDADD.${LIB}}
${LDFLAGS.${LIB}}

OTOH you can't pass parameters to ${CC}, because in suffix rules make(1) only
knows the name of ${.IMPSRC} and ${.TARGET}; it's users' responsivility to
define ${CC} parameters to all the sources of a given ${PROG} / ${LIB}.

Should address bin/42381.

(Bug in this commit log was pointed out by mrg@.)


# 1.243 27-Nov-2009 tsutsui

If CPPFLAGS or CXXFLAGS already contains -nostdinc or -nostdinc++,
don't add ${CPPFLAGS_ISYSTEM} or ${CPPFLAGS_ISYSTEMXX} to refer
${DESTDIR}/usr/include or ${DESTDIR}/usr/include/g++.

This change might cause errors on some MD stand dir, but in that case
each Makefile should be fixed to search proper system include paths
by -Ipath option in own CPPFLAGS.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.242 12-May-2009 plunky

remove libsdp as improved functionality has been enabled in libbluetooth.


# 1.241 10-Apr-2009 apb

Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links. They have no effect except when using a
metalog, in which case the information is added to the metalog. In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg. This should fix PR 24457 and PR 41155.


# 1.240 24-Nov-2008 cube

branches: 1.240.2;
Move cleanextra to the very ends in case another included file wants to add
to it even if it was initially empty.


Revision tags: netbsd-5-base matt-mips64-base2
# 1.239 19-Oct-2008 christos

branches: 1.239.2;
handle assembly files for MKPIE


# 1.238 16-Oct-2008 christos

Provide a way for a program to override the PIE flags.


# 1.237 15-Oct-2008 christos

don't compile/link libraries with pie


Revision tags: mjf-devfs2-base
# 1.236 02-Oct-2008 joerg

Hook up libfetch and pkg_install update.


Revision tags: wrstuden-revivesa-base-3
# 1.235 09-Sep-2008 joerg

Add MKSTRIPIDENT to remove the RCS IDs from binary programs and shared
libraries for space-constraint systems. The description is based on the
feedback of hubertf@, the logic on input from lukem@

This obsoletes the removal of LIBC_SCCS and SYSLIBC_SCCS for libc builds.


Revision tags: wrstuden-revivesa-base-2
# 1.234 28-Aug-2008 mrg

update a comment example


# 1.233 27-Aug-2008 rtr

use ${X11USRLIBDIR} instead of hard-coded /usr/X11R6/lib when building
${LIB.foo} vars


# 1.232 27-Aug-2008 lukem

Fix problem I introduced in rev 1.231 on 2008/08/25 where ${_PROGLDOPTS}
and -L${_GCC_LIBGCCDIR} were appearing in the link line before ${LDADD},
so -L${DESTDIR}/lib and -L${DESTDIR}/usr/lib were being used before
local -L library paths.
Fixes ntpd/ntpdate failure noticed by Valeriy E. Ushakov <uwe@NetBSD.org>


# 1.231 25-Aug-2008 lukem

Always link with: -Wl,-rpath-link,${DESTDIR}/usr/lib -L${DESTDIR}/usr/lib
Fixes problem with MKDYNAMICROOT=no triggered by libraries that depend
on other libraries.
Related to PR 33503.

Clean up setting of _CCLINK to always add the appropriate -B options.

Simplify the link rule for a program.


# 1.230 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.229 28-May-2008 lukem

add LIBLDAR_R (for completeness)


# 1.228 22-May-2008 lukem

Add MKLDAP, USE_LDAP, LIBLBER, LIBLDAP


Revision tags: hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-pf42-base
# 1.227 10-Apr-2008 tsutsui

branches: 1.227.2; 1.227.4;
Add libhx509 to PAM_STATIC_LDADD which is required by libkrb5.


# 1.226 22-Mar-2008 mlelstv

branches: 1.226.2;
Import Heimdal-1.1


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase matt-armv6-base hpcarm-cleanup-base
# 1.225 26-Dec-2007 jmmv

Make the clean target work when OBJS is set but PROG is not, as happens
for example in gnu/lib/crtstuff4. Reported by drochner@.


Revision tags: cube-autoconf-base
# 1.224 13-Nov-2007 jmmv

Fix typo that prevented MKDEBUG builds to work. Found by drochner@.


# 1.223 12-Nov-2007 jmmv

Add the ability to build multiple programs from a single directory

This adds support for a new set of variables, PROGS and PROGS_CXX, that
allow the developer to build multiple different programs from a single
source directory.


# 1.222 04-Nov-2007 tls

Remove MKPRIVATELIB from BIND libraries; move library reachover
directories and Makefiles from src/usr.sbin/bind to src/lib; make
BIND libraries build shared. Saves about 1MB-1.5MB per installed
executable, about 5MB for a base+etc minimal installation of NetBSD.


Revision tags: matt-mips64-base
# 1.221 29-Jul-2007 joerg

branches: 1.221.4; 1.221.6;
Add build glue for libarchive and update the various sets.


# 1.220 25-Jan-2007 perry

Before I completely forget the issue, convert "PROG_PAX" to the
better-named "PAXCTL_FLAGS".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.219 11-Nov-2006 christos

don't run paxctl if other commands were specified for that target.


# 1.218 10-Nov-2006 christos

if ${PROG_PAX} is defined, run paxctl on the binary after linking with
the value of the variable. This way, if you set:

PROG_PAX=+M

in /etc/mk.conf, you get what you deserve.


# 1.217 22-Oct-2006 pooka

libpuffs


# 1.216 09-Oct-2006 mrg

- clean up some comments to reality.
- retire LIBDCK, LIBG2C and (long broken) USE_LIBSTDCXX
- in bsd.hostprog.mk's LIBSTDCPP -> LIBSTDCC
- add LIBSUPCXX
- don't default USE_LIBSTDCXX or USE_GCC4 since they are
not used in the tree any where
- same with USE_XF86_4; retire it
- remove _SUPCXX handling in bsd.prog.mk

inspired by PR#26714.


Revision tags: abandoned-netbsd-4-base
# 1.215 23-Jul-2006 lukem

Implement MKDEBUG:
If "no", don't build and install separate debugging symbols
into /usr/libdata/debug.
Default: no


# 1.214 19-Jun-2006 gdamore

Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.


# 1.213 09-Jun-2006 christos

PR/33681: Scott Ellis: Building 'bc' with SHAREDSTRINGS=yes fails
We need CPPFLAGS too now.


# 1.212 11-May-2006 mrg

add support for ${OBJCOPTS} and ${OBJCOPTS}.<lib|prog|fn>.


# 1.211 20-Mar-2006 christos

There is always one more KRB4 thing to remove. (from Jukka Salmi)


# 1.210 20-Mar-2006 christos

Remove krb4 variables and libraries (Jukka Salmi)


# 1.209 16-Mar-2006 jwise

Now that we have real build system support for syspkgs, remove someone's
half-implemented idea of building `syspkgs' (really a few giant blobs of the
same granularity of the old sets) using install(1).


# 1.208 20-Jan-2006 christos

Add the world of libraries to the static pam build. Now static pam binaries
work.


# 1.207 09-Apr-2005 dsl

Report when we link a program into xxx.ro (before being crunched)


Revision tags: netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.206 04-Mar-2005 he

branches: 1.206.2; 1.206.4;
Introduce PAM_STATIC_LDADD and PAM_STATIC_DPADD. When compiling
with MKPIC=no, possibly because the target does not support shared
libraries, these include libraries required to resolve all symbols
which end up referenced from PAM-using applications. The libraries
presently required are -lcrypt, -lrpcsvc and -lutil.

Add use of these variables which are currently set up to use PAM,
so that they compile when MKPIC=no.

Also, in the telnetd case, reorder the order of the libraries, so
that libtelnet.a comes before -ltermcap and -lutil, again to fix
link error when MKPIC=no.

Discussed with thorpej and christos.


# 1.205 20-Feb-2005 christos

Add libradius


# 1.204 12-Jan-2005 lukem

If RESCUEDIR is defined, automatically add that to CPPFLAGS


# 1.203 08-Jan-2005 lukem

Implement <bsd.prog.mk> vars:
LIBASN1 LIBBSDMALLOC LIBG2C LIBPAM LIBSSH


# 1.202 04-Aug-2004 lukem

Revert most of previous, and move the LIB<libname>?= assignments
back to bsd.prog.mk from bsd.own.mk.

pkgsrc uses <bsd.own.mk>, and setting LIB<libname> in it causes
problems with various package builds.
This should fix PR #26542 submitted by Jim Bernard.

(I'll be implementing the DPADD for shared libraries in a different
manner that generally won't depend upon ${LIB<libname>}.)


# 1.201 30-Jul-2004 lukem

Move the LIB<libname>?= assignments from bsd.prog.mk to bsd.own.mk so
that they may be used by non PROGs (e.g., LIBs).

Improve some comments.


# 1.200 10-Jun-2004 lukem

Be consistent in handling YHEADER, similar to Christos' fix in bsd.lib.mk 1.253


# 1.199 21-May-2004 ross

If you add a library, you need to define its DPADD symbol here.

Add LIBMAGIC.


Revision tags: netbsd-2-0-base
# 1.198 15-Feb-2004 skrll

branches: 1.198.2;
Be more gcc like in the way we deal with libgcc so that sh3/hppa millicode
and exception handling have a chance of working properly.

- creates libgcc, libgcc_eh and libgcc_s

- updates LIBGCC_SPEC to use them appropriately.

There's a hack in here at the moment with respect to libgcc_so in that it
is preferable to link against libgcc_so will only when -shared-libgcc is
specified (the c++ frontend does this automatically.) Configurations where
LINK_EH_SPEC is defined already do this. The gcc configuration for
NetBSD/alpha and another NetBSD platform (I forget which) actually define
LINK_EH_SPEC probably by accident rather than design.

- updates share/mk to use the compiler's knowledge of what needs linking into
libraries and executables. This removes an hppa hack.

- updates the sets for the newly created libgcc* files.

- support for linking against the _pg version of libgcc has been removed.


# 1.197 29-Jan-2004 lukem

Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.


# 1.196 27-Jan-2004 lukem

Replace
:M-[IDU]*
with
:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)


# 1.195 23-Jan-2004 simonb

crt0.o lives in /usr/lib even on a.out.


# 1.194 16-Nov-2003 lukem

simplify with _MKTARGET_LINK


# 1.193 11-Nov-2003 dsl

Set MKDEP_SUFFIXES to get additional targets in .depend instead of using
sed in .afterdepend. I don't think .afterdepend is used anywhere any more.


# 1.192 21-Oct-2003 lukem

Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.


# 1.191 19-Oct-2003 lukem

Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} " ... {$.TARGET}" and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO


# 1.190 18-Oct-2003 lukem

Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command ("verbose")
This is the default, and is equivalent to the previous behaviour.


# 1.189 29-Sep-2003 lukem

Add LIBSTDCXX (for usr/lib/libstdc++.a).
Sync LIB* documentation with reality.


# 1.188 19-Sep-2003 martin

Drop explicit medlow model and default to -O2 for sparc64.


# 1.187 14-Sep-2003 lukem

Check ${SHLIBDIR} against "/usr/lib" instead of ${LIBDIR} when determining
if we need to add stuff (usually "/lib") to the rpath-link path before
"/usr/lib". Otherwise, this barfs if LIBDIR != /usr/lib or /lib, and
we're cross-building (e.g., in src/x11)


# 1.186 13-Sep-2003 erh

Also support per-program LDFLAGS and LDSTATIC.


# 1.185 13-Sep-2003 erh

Create a way to add additional flags to COPTS, CPPFLAGS, CXXFLAGS and LDADD
for particular libraries or programs by specifying the additions in mk.conf
instead of needing to go edit individual Makefiles.


# 1.184 12-Sep-2003 lukem

add infrastructure to support reach-over builds of xsrc


# 1.183 22-Aug-2003 dsl

Add a ${PROG}.ro target that does an 'ld -r' of the program object files.
Allows a much simplified build of 'crunched' binaries since crunchgen can
build prog.ro instead of having to deretmine the names of all the .o files.


# 1.182 01-Aug-2003 lukem

Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".


# 1.181 01-Aug-2003 lukem

simplify the ${PROG}: target to reduce duplication between the DESTDIR
and !DESTDIR cases...


# 1.180 31-Jul-2003 lukem

bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.


# 1.179 31-Jul-2003 lukem

Don't need -R/usr/lib; it will be searched at the end by ld.elf_so anyway.
Noted by matt green <mrg@>


# 1.178 28-Jul-2003 lukem

be consistent when adding *.y and *.l to DPSRCS


# 1.177 28-Jul-2003 lukem

replace MKCXXSUPCXX(!=no) with USE_LIBSTDCXX(==no)


# 1.176 28-Jul-2003 lukem

Change defined(CXX_SUPCXX) to MKCXXSUPCXX != "no".

Clarify that command-line overrides of the MKxxx variables should be
done via the environment rather than make(1) command-line variable
assignment, since the latter doesn't actually work as intended.


# 1.175 27-Jul-2003 mrg

introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes. for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)


# 1.174 26-Jul-2003 mrg

add a new bsd.own.mk variable: CXX_SUPCXX. from bsd.README:
+ CXX_SUPCXX If defined, the support libraries needed for this C++ program
+ are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.


# 1.173 20-Jul-2003 lukem

Consistently support the different C++ file extensions: .cc .cpp .cxx .C
Noted by Andrew White in PR toolchain/18246


# 1.172 18-Jul-2003 lukem

Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was defined.
Replace defined(UNPRIVED) tests with ${MKUNPRIVED} != "no"

Add MKUPDATE; if not no has the same semantics as if UPDATE was defined.
Replace defined(UPDATE) tests with ${MKUPDATE} != "no"

Improve documentation for these and other make flags.


# 1.171 16-Jul-2003 itojun

stop installing install libtelnet. build under lib/libtelnet and reference
it from usr.bin/telnet and libexec/telnetd.
(reason for separate build: compiler flags)


# 1.170 27-Jun-2003 drochner

For consistency, use "-R" instead of "-Wl,-rpath" to pass
a runtime search path to the linker.


# 1.169 13-Jun-2003 itojun

define LIBEVENT


# 1.168 11-Jun-2003 msaitoh

catch signal 1,2,3,13 and 15 to clean /tmp/_dependXXX


# 1.167 31-May-2003 thorpej

If EXTERNAL_TOOLCHAIN is defined, allow the compiler to define the
location of crt{begin,end}{,S}.o and libgcc.a. Encapsulate all of
this logic into the new bsd.gcc.mk, and use it in bsd.prog.mk and
bsd.lib.mk.


# 1.166 18-May-2003 lukem

make this a no-op if HOSTPROG is defined


# 1.165 30-Mar-2003 thorpej

If MACHINE_ARCH is powerpc and we HAVE_GCC3, add crtsaveres.o to the
endfile spec.


# 1.164 22-Feb-2003 uwe

Typo in comment.


# 1.163 24-Jan-2003 thorpej

Add LIBPTHREAD, LIBPTHREAD_DB, and LIBRT.


Revision tags: fvdl_fs64_base
# 1.162 22-Nov-2002 thorpej

Split crtbegin/crtend into crti/crtbegin/crtend/crtn. NetBSD-specific
things like the .note.netbsd.ident section are provided by crti/crtn.
crti/crtn also provide the _init() and _fini() routines.

crtbegin/crtend now only provide support for ctors/dtors. This paves
the way to using the "crtstuff" provided with GCC (when we upgrade to
GCC 3.3), which provides, among other things, much better C++/Java
exception handling.


# 1.161 12-Nov-2002 itohy

MKDYNAMICROOT for a.out


# 1.160 22-Oct-2002 perry

Pass 1 of SYSPKG changes to automatically add tags=pkgname_pkg to METALOG.
Not quite ready for prime time yet.


# 1.159 27-Sep-2002 thorpej

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.


# 1.158 26-Sep-2002 itojun

MDC2 is a patented algorithm; don't ship it in default libcrypto.
MKCRYPTO_MDC2 will build a separate library, libcrypto_mdc2.


# 1.157 08-Sep-2002 thorpej

Build a .gdbinit in the objdir when building a program. The .gdbinit
file sets the shared library prefix to ${DESTDIR}, and adds "sources"
directives for each file listed in the GDBINIT Makefile variable.


# 1.156 09-Aug-2002 thorpej

Add LIBPMC.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.155 27-Mar-2002 eeh

branches: 1.155.2;
Use the medium low model for sparc64 programs that don't 2GB of data segment.


# 1.154 11-Feb-2002 mycroft

Don't use .PHONY for targets that are actually installed. Instead use force
dependencies. (Among other things, `make -t install' does something vaguely
sensible now.)


# 1.153 07-Feb-2002 pk

Mark installed system libraries as .MADE only if we're actually establishing
their default variable values here.


# 1.152 04-Feb-2002 christos

s/.NOSUFF/.MADE/


# 1.151 03-Feb-2002 christos

Apply a .NOSUFF: directive to targets we don't want to have processed by
the suffix rules engine.


# 1.150 02-Feb-2002 veego

Ups, it is LIBUSBHID and not LIBUSBHIB.


# 1.149 02-Feb-2002 veego

Change LIBUSB to LIBUSBHIB, reflecting the library name change.


# 1.148 29-Jan-2002 enami

Mark the targets clean{extra,objs} as PHONY.


# 1.147 04-Jan-2002 thorpej

For PROG_CXX DESTDIR builds, pull in -lstdc++ and -lm regardless
of GCC version.


# 1.146 01-Jan-2002 thorpej

Per a suggestion from matthew green, PROG_CXX takes the place of
PROG for C++ programs.


# 1.145 01-Jan-2002 thorpej

* If PROG_CXX is set by the program's Makefile, use ${CXX} to link
the program rather than ${CC}.
* If HAVE_GCC3 is defined, pull in "-lstdc++ -lm" as additional C++
support libraries for DESTDIR builds.


# 1.144 28-Dec-2001 lukem

* 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


# 1.143 28-Nov-2001 tv

If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.


# 1.142 19-Nov-2001 thorpej

Use a little transitional hack to determine if we use -isystem
or -idirafter. Use the former only of USE_NEW_TOOLCHAIN, since
-isystem causes the old toolchain to bomb out when building
libstdc++.


# 1.141 14-Nov-2001 tv

C/..$/.c/ -> C/\..$/.c/


# 1.140 14-Nov-2001 tv

Move the DESTDIR-based nostdinc logic to bsd.lib.mk and bsd.prog.mk where
it belongs (with the native target compile rules).


# 1.139 02-Nov-2001 tv

Use INSTALL_FILE/INSTALL_DIR as appropriate.


# 1.138 02-Nov-2001 tv

Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.


# 1.137 19-Oct-2001 tv

Add .NOPATH for all files generated from .l or .y files in SRCS. Fixes PRs
bin/14187 and lib/14239.

Also simplify the handling of these transforms to .c and .h files a bit by
leveraging make's builtin macro operators.


# 1.136 25-Sep-2001 tv

Set .NOPATH on program to build to make sure it goes in .OBJDIR.
Problem noted by <seebs@plethora.net>.


# 1.135 24-Sep-2001 lukem

fix previous (hi thor!) - $OBJS and $CLEANFILES might be empty, and
rm needs some files to delete...


# 1.134 24-Sep-2001 tls

Split "cleanprog" target apart: now you can zap only object files or
CLEANFILES (needed to fix crunchgen lossage).


# 1.133 13-Sep-2001 thorpej

Add LIBPCI.


# 1.132 14-Aug-2001 tv

Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").


# 1.131 01-Jun-2001 tv

Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).


# 1.130 08-May-2001 sommerfeld

Suppress duplicate entries in ALLFILES, FILES, INCS, DEPINCS, INFOFILES,
NLSALL, CATPAGES, MANPAGES, HTMLPAGES, and SCRIPTS.


# 1.129 19-Feb-2001 jmc

Wrap target() checks around afterdepend rule as some Makefiles override this


# 1.128 26-Jan-2001 itojun

fix typo in LIBSSL decl. it made programs with DPADD+=${LIBSSL} to build
every time we type "make". From: bernd


# 1.127 14-Jan-2001 christos

use the new .if commands(<target>) directive so that we don't have to
change Makefiles.


# 1.126 14-Jan-2001 christos

fix thinko: test for the existance of the target before we define it...


# 1.125 14-Jan-2001 christos

Alter previous redefined target protection. If the ${PROG} target is defined,
add the dependencies as usual, but don't add the commands. This avoids
having to change all the Makefiles that redefine the PROG target.


# 1.124 14-Jan-2001 christos

allow programs to override the program target.


# 1.123 08-Jan-2001 mrg

add missing $LIBCRYPTO_RC5 and $LIBCRYPTO_IDEA


# 1.122 08-Jan-2001 mrg

add missing $LIBSSL


# 1.121 04-Jan-2001 garbled

Add LIBCDK and LIBFORM definitions


# 1.120 31-Oct-2000 itojun

add ${LIBINTL} for use with DPADD.


# 1.119 07-Oct-2000 deberg

fix typos, PR 11159


# 1.118 25-Jun-2000 erh

For the case when DESTDIR is set: move the -L${DESTDIR}/usr/lib after ${LDADD} so any -L directories set in LDADD are searched first to avoid possibly linking against old versions of libraries.


Revision tags: netbsd-1-5-base
# 1.117 19-Jun-2000 thorpej

branches: 1.117.2;
Sync up the LIB* list.


# 1.116 10-Jun-2000 mycroft

Use ${.ALLSRC:T} when doing the generated variable name lookups, so that it
DTRT for generated files in and obj directory (or accessed via .PATH).


# 1.115 06-Jun-2000 mycroft

Abuse .USE some more.


# 1.114 06-Jun-2000 mycroft

Minor rearrangement.


# 1.113 06-Jun-2000 mycroft

Use ODE make(1) features to eliminate extra variables and move several things
outside of .for loops. (Needs more work to completely eliminate .for.)

XXX Don't look at this stuff. It will make your head hurt.


Revision tags: minoura-xpg4dl-base
# 1.112 14-Apr-2000 mrg

branches: 1.112.2;
use -rpath-link rather than -R when linking objects using a DESTDIR.
this replaces the previous change as that ended up adding
$DESTDIR/usr/lib to the runtime path of every binary created, which
is bogus and dangerous.


# 1.111 25-Mar-2000 mycroft

When linking with $DESTDIR, use an explicit -R to get library dependencies
correct.


# 1.110 07-Mar-2000 veego

Remove unused libahdi.
It will be replaced in the future with a more generic libdisklabel.


# 1.109 05-Feb-2000 jdc

Add libahdi entries.


# 1.108 23-Jan-2000 eeh

Add some support for FCode binaries.


# 1.107 22-Jan-2000 mycroft

Make `dependall' play nicely with SUBDIR, using a hack similar to `realinstall'
for both `depend' and `all'.
Also, remove the old hack that invokes an extra shell for .depend, now that
make(1) has been fixed.


# 1.106 16-Jan-2000 assar

all: depend on ${SCRIPTS} so that they get generated if they need to


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.105 23-Nov-1999 blymn

Added libmenu library.


Revision tags: comdex-fall-1999-base
# 1.104 14-Sep-1999 perry

branches: 1.104.4;
Add a "dependall" target, which does a "make depend" and then "make all"
in a single directory. This is useful in "make build" because by doing
the build immediately after the depend, all sources will typically
still be in the buffer cache, thus saving significant time over doing
a "make depend" on all the directories and then a "make all".


# 1.103 04-Sep-1999 fredb

Permit "make all install", as well as "make foo install" (where foo would be
installed by "make install") without setting of BUILD. All cases where BUILD
is already set are unchanged from the old behavior.

"make all install" is now practically equivalent to "make BUILD= all install",
but without actually setting build.

Fixes pr's 8313, 3894.


# 1.102 21-Aug-1999 simonb

Add ${INSTPRIV} to ${INSTALL} commands.


# 1.101 01-Jul-1999 itojun

branches: 1.101.2;
add LIBIPSEC for use from DPADD.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.100 12-Feb-1999 lukem

branches: 1.100.2;
* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.99 10-Feb-1999 tv

libbfd_pic.a is no longer installed; remove ${LIBBFD} define.


# 1.98 04-Feb-1999 christos

PR/2936: Brian C. Grayson: Avoid truncating precious files when installing
and the filesystem is full. Added ${RENAME} flag to install, which when set
to -r installs on a temporary file and then renames to the final destination.
${RENAME} is currently set to nothing in bsd.own.mk, but one can turn it
on in /etc/mk.conf.


# 1.97 07-Nov-1998 jonathan

Do DESTDIR support for crtbegin/crtend on all ELF ports (adds mips).


# 1.96 28-Sep-1998 christos

Use preserve flag in install.


# 1.95 10-Sep-1998 ross

Define a LIBBZ2?=... for use in DPADD=... lines.


# 1.94 09-Aug-1998 lukem

add distclean as a synonym for cleandir


# 1.93 09-Apr-1998 tv

.y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.


# 1.92 01-Apr-1998 tv

Revert. This broke too much in the build tree, and a better solution
needs to be created. (The existing situation breaks a lot too.)


# 1.91 01-Apr-1998 tv

Fix .y rules to DTRT with possibly generated .h files. See mail on
tech-toolchain for a very detailed explanation of this. In short, add
a .y.h rule identical to the .y.c rule and make the .y.c rule rename
the .h file; also, clean the .h file in CLEANFILES.


# 1.90 03-Nov-1997 cgd

echo the lint command line when making 'lint'.


# 1.89 28-Oct-1997 lukem

add ${LIBOBJC}


Revision tags: netbsd-1-3-base
# 1.88 11-Oct-1997 mycroft

branches: 1.88.2;
Several changes:
* Allow bsd.man.mk to be included separately.
* Always include bsd.own.mk and bsd.obj.mk.
* Include bsd.man.mk and bsd.nls.mk even if NOMAN or NONLS; just turn off
building of the affected files instead.
* Require bsd.subdir.mk to be included explicitly.
(Will make appropriate changes to Makefiles shortly.)


# 1.87 29-Sep-1997 gwr

Add $LIBBFD


# 1.86 31-May-1997 cjs

Back out BUILDDIR and NOINSTALL changes.


# 1.85 26-May-1997 cjs

branches: 1.85.2;
These updates to the build allow building against include files
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.


# 1.84 18-May-1997 kleink

Add libposix.


# 1.83 17-May-1997 mycroft

Do LINKS and SYMLINKS after FILES and INCS.


# 1.82 17-May-1997 mycroft

Remove unneeded .SUFFIXES lines, and move .s and .S closer to .o to give the
right preferences.


# 1.81 09-May-1997 mycroft

Fix typo in previous.


# 1.80 09-May-1997 mycroft

Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.79 09-May-1997 mycroft

Remove cruft.


# 1.78 09-May-1997 mycroft

Oops; rearrange dependencies to get things built early enough.


# 1.77 09-May-1997 mycroft

Make sure INCS and SRCS are built if necessary.


# 1.76 08-May-1997 gwr

Set the .NOPATH flag for ${OBJS} (from Christos).


# 1.75 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.74 07-May-1997 mycroft

Various simplifications.


# 1.73 07-May-1997 mycroft

Shuffle some .PHONYs around, to work better with `-t'.


# 1.72 06-May-1997 mycroft

Make most of the install targets .PRECIOUS.


# 1.71 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.70 18-Apr-1997 christos

Add ${LIBNTP}


# 1.69 17-Apr-1997 thorpej

- Properly depend on crtbegin.o and crtend.o for platforms that use
them (currently Alpha and PowerPC)
- STRIP -> STRIPFLAG


# 1.68 03-Apr-1997 mikel

don't allow override of all: target


# 1.67 29-Mar-1997 mikel

merge lite-2 changes (mostly SCCSids)


# 1.66 27-Mar-1997 christos

Put the FILES generated rules in a separate .mk file since both bsd.prog.mk
and bsd.lib.mk use them.


# 1.65 27-Mar-1997 mycroft

Make the SCRIPTS case mimic the FILES case more closely, so we can override
the destination direectory, etc.


# 1.64 27-Mar-1997 mycroft

Remove knowledge of HIDEGAME from here.


# 1.63 24-Mar-1997 christos

make rules update:
- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation


# 1.62 22-Mar-1997 perry

Fix SYMLINKS not to include DESTDIR in the link itself


# 1.61 13-Mar-1997 perry

add SYMLINKS, by analogy to LINKS. Vetted by Christos.


# 1.60 22-Jan-1997 cgd

if 'clean' is not already defined, rather than simply defining it with
a bunch of rules, define a clean{kmod,lib,prog} target with the rules,
and have both clean and cleandir depend on that. That eliminates a bug
where 'cleandir' in a directory which included e.g. bsd.prog.mk but which
also had subdirs would 'make clean' all the subdirs and then 'make cleandir'
all ofthe subdirs. It also allows Makefiles to add more dependencies
to 'clean' after inclusion of the make template.

If 'clean' is already defined, the behaviour is the same as it used to be.


# 1.59 20-Dec-1996 cgd

add an afterdepend target (a la the one in bsd.lib.mk) that processes
the .depend file to add <filename>.ln for each <filename>.o as an
object file which has the given dependencies (in addition to
<filename>.po and <filename>.so, which were already there).


# 1.58 13-Dec-1996 mikel

add missing LIBPCAP definition.


# 1.57 26-Nov-1996 mrg

add libz and libwrap


# 1.56 18-Oct-1996 thorpej

Use ${INSTALL} rather than "install".
From Simon J. Gerraty <sjg@zen.void.oz.au>, PR #1458.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.55 08-Apr-1996 jtc

Sort LIBFOO definitions and add LIBY; Reported by Mike Long <mike.long@analog.com> in PR #2301.


# 1.54 22-Oct-1995 christos

Added include file <bsd.sys.mk> that contains lex and yacc "parallel aware"
rules. These rules are not turned on by default; they are enabled by setting
the PARALLEL variable.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.53 25-Jun-1995 cgd

oops; fix an rm that might be empty


# 1.52 24-Jun-1995 cgd

update lint rules, but keep linting disabled


# 1.51 10-Jun-1995 mycroft

Define LIBEDIT.


# 1.50 21-Apr-1995 jtc

.include <bsd.nls.mk> unless NONLS is defined.


# 1.49 22-Dec-1994 cgd

specify man pages differently, and document how.


# 1.48 24-Aug-1994 mycroft

Include bsd.own.mk earlier.


# 1.47 20-Jul-1994 cgd

fix from christos, for progs w/o objects


Revision tags: netbsd-1-0-base
# 1.46 06-Jul-1994 mycroft

branches: 1.46.2;
Pull libraries from ${DESTDIR} if set. Kill LDONLY, which is unused and
probably not useful anyway.


# 1.45 30-Jun-1994 cgd

fix modify-info-nothingness-then-substitute probelm that broke genclass build


# 1.44 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.43 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.42 28-Jun-1994 jtc

Strip *.sh when constructing OBJS from SRCS.
This will allow us to clean up makefiles that build a script by munging
a template (uusched, genclass, neqn, etc.).


# 1.41 18-Jun-1994 cgd

don't chown the symlink, when HIDEGAME causes a symlink to be made to dm.
4.4-based FS code _follows_ the symlinks on a chown(2) call.


# 1.40 24-May-1994 cgd

fix the last to do the right thing for dependencies


# 1.39 24-May-1994 deraadt

LIBSKEY


# 1.38 22-May-1994 jtc

Single source file programs are now compiled into object files before they
are linked. This change halves the time it takes to rebuild all of the
NetBSD sources when only the C library is "touched"; but only takes about
one percent more disk space.


# 1.37 06-Apr-1994 chopps

relink (recompile) single source programs when crt0.o is updated.


# 1.36 24-Mar-1994 mycroft

Remove *.core on clean.


# 1.35 09-Feb-1994 cgd

kill install -d's.


# 1.34 28-Jan-1994 cgd

add LIBKVM


# 1.33 10-Nov-1993 cgd

librpc doesn't exist anymore


# 1.32 08-Nov-1993 cgd

ad LDSTATIC flag, so static linking can be made one-stop shopping.
use "setenv LDSTATIC" to make *everything* dynamically linked,
setenv LDSTATIC -static for everything statically linked, or unset
it for default behavior.


# 1.31 07-Oct-1993 cgd

LIBTERM pointed at nothing, but was meant to point to libtermcap.a...


# 1.30 07-Oct-1993 cgd

always define LIBCRYPT


# 1.29 17-Aug-1993 mycroft

Make sure we don't recurse into subdirectories if Makefile specified `install'
target. (It's usually blank and is specifically to avoid doing this...)


# 1.28 15-Aug-1993 mycroft

Automatically include bsd.subdir.mk for backward compatibility.


# 1.27 15-Aug-1993 mycroft

Don't automatically include bsd.subdir.mk in bsd.prog.mk and bsd.lib.mk.
Put back .MAIN in bsd.man.mk, and be careful not to include ../Makefile.inc
a second time.


# 1.26 15-Aug-1993 mycroft

Move man rules to sys.mk.
Use bsd.subdir.mk for building subdirectories.
Don't forget to remove x.cc and x.C when using SHAREDSTRINGS.
Make ${PROG} always depend on ${LIBCRT0}.
Don't duplicate code between cleandir and clean.
Move tags target to bsd.dep.mk.
Move STRIP to bsd.own.mk.
Remove redundant definitions of {BIN,MAN}{DIR,GRP,OWN,MODE}.
Move {LIB,DOC}{DIR,GRP,OWN,MODE} defaults to bsd.own.mk.


# 1.25 15-Aug-1993 mycroft

Abstract out dependency stuff, and add RCS identifiers.


# 1.24 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


# 1.23 10-Aug-1993 mycroft

Put LINKS handling in `install' target, so it's the last thing executed, and
happens even if `realinstall' is user-defined.


# 1.22 30-Jul-1993 mycroft

When generating a default OBJS, ignore .h files.


# 1.21 29-Jul-1993 mycroft

Don't print the `making ...' message if an obj dir already exists.
Also, a minor cleanup.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.20 17-Jul-1993 mycroft

Fix C++ dependencies for good. `make depend' is now done in two passes--one
of C files and one for C++ files. No need to specify `-+' in your Makefile,
as it is now done automatically.


# 1.19 17-Jul-1993 cgd

do c++ dependencies the right way...


# 1.18 17-Jul-1993 mycroft

Add suffix rules for C++ files.


# 1.17 04-Jun-1993 brezak

Add LIBRPCSVC variable.


# 1.16 02-Jun-1993 cgd

add ability to specify c++ dependencies, by setting CFLAGS+=-+ for
the dependency make.


# 1.15 26-Apr-1993 cgd

added definition for DPADD library variable LIBCRYPT.


# 1.14 26-Apr-1993 mycroft

Don't redefine `realinstall' target if already defined.


# 1.13 25-Apr-1993 mycroft

Link with LDFLAGS even if one source module.


# 1.12 25-Apr-1993 mycroft

Don't lose if we include bsd.prog.mk only to build man pages.


# 1.11 25-Apr-1993 mycroft

Fix error in last change. (Oops.)


# 1.10 25-Apr-1993 mycroft

Don't build man pages if NOMAN set.


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.9 09-Apr-1993 cgd

various changes to default make rules. from patch 101.
note that only the "sensible" changes in patch 101 are implemented.


# 1.8 08-Apr-1993 cgd

try to do the right thing, in terms making directories before we
install into them, and get the manpage cleans _OUT_ of "clean".
they don't belong there, only in cleandir, WFJ be damned.


# 1.7 08-Apr-1993 cgd

fixed typos...


# 1.6 08-Apr-1993 cgd

(silently) make sure we have directories before installing


# 1.5 04-Apr-1993 cgd

make LIBRPC point to the right place


# 1.4 27-Mar-1993 nate

Fixed the doc macros to call troff, eqn,and tbl instead of ditroff,
deqn, and dtbl.
Fixed make clean to remove the man pages (Bill fixed this in the distribution,
but not in the original source)
Changed install to leave the original file around, by using 'cp' instead of
'mv'. "install -c ..."


# 1.3 23-Mar-1993 cgd

made .CURDIR be absolute, not relative, thereby eliminating
the need for some of the makefile trickery when making objects,
and fixing a few .PATH bugs


# 1.2 22-Mar-1993 cgd

fixed "make obj" for cases when sources not in /usr/src/...
if sources not there, it now mkdirs obj, but some trickery
is necessary, to avoid deleting cwd.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.325 03-Mar-2020 christos

Add fido and cbor


Revision tags: phil-wifi-20191119
# 1.324 18-Nov-2019 christos

Improve the script to check for installed libraries, and fix the wrong
names and obsolete libraries it found.


# 1.323 27-Aug-2019 kamil

Enhance the support of LLVM sanitizers

Define _REENTRANT for MKSANITIZER build. This is needed for at least stdio
code. This caused new build issued with duplicated symbols in few places
and rump kernel code picking different code paths borrowed from libc.
Handle all this in one go.

Add bsd.sanitizer.mk to share common code used by programs and libraries.

Switch from realall to beforeinstall target in .syms files. This is more
reliable in MKSANITIZER.


# 1.322 17-Aug-2019 kamil

Add PAXCTL_FLAG rules for MKSANITIZER

Add per-program rules to disable ASLR for ASan, TSan and MSan in all
sanitized programs. This flag is not needed for other supported sanitizers.

Without this change, sanitized init(8) dies early on startup.

Approach originally suggested by <joerg>


# 1.321 15-Aug-2019 kamil

Add SANITIZER_RENAME_CLASSES in bsd.prog.mk

This adds a more flexible version of SANITIZER_RENAME_SYMBOL.

New symbol allows to specify MKSANITIZER specific renames on per-file and
per-symbol basis.


# 1.320 10-Aug-2019 christos

Make the X11 library lists consistent again.


Revision tags: netbsd-9-base phil-wifi-20190609 pgoyette-compat-20190127
# 1.319 21-Jan-2019 christos

branches: 1.319.2;
Most of the mv operations are to move temporary files to their final place.
Some use -f, others don't. This can lead to spurious build failures when
the user performing the build changes. Centralize, and always use -f.


Revision tags: pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.318 12-Aug-2018 christos

fix broken library variable definitions (inconsistencies between
bsd.README and bsd.prog.mk)


Revision tags: pgoyette-compat-0728
# 1.317 25-Jul-2018 kamil

Introduce MKLIBCSANITIZER in the share/mk rules

Add flags that are required to build a program and a dynamically loaded
library.

Propagade LIBCSANITIZERFLAGS to CFLAGS and CXXFLAGS.

LDFLAGS is not changed on purpose, as a libcsanitizer is inside libc
and no external dependencies are needed.

Register NOLIBCSANITIZER, as certain distribution parts will need to be
skipped.


# 1.316 12-Jul-2018 maxv

Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.


Revision tags: phil-wifi-base
# 1.315 25-Jun-2018 kamil

branches: 1.315.2;
Add a framework for renaming symbols in libc&co for MKSANITIZER

A new keyword SANITIZER_RENAME_SYMBOL. It's a variable that has specified
a list of symbols to be renamed in a processor in order to remove naming
conflicts with public symbols in libc/m/pthread/rt.

This renaming will occur for libraries and programs.
A symbol with a conflicting 'name', will be renamed to '__mksanitizer_name'.

Based on an idea by <christos>


Revision tags: pgoyette-compat-0625
# 1.314 21-Jun-2018 kamil

Refactor MKSANITIZER flags in mk rules

Introduce a new variable SANITIZERFLAGS that contains all the sanitizer
specific flags. These flags are designed to be passed to CFLAGS, CXXFLAGS
and LDFLAGS.

Pass SANITIZERFLAGS in bsd.prog.mk rules to CFLAGS, CXXFLAGS and LDFLAGS.

Pass SANITIZERFLAGS in bsd.lib.mk rules to *_pic.a build flags. The *_pic.a
libraries are designed to construct .so libraries. All .so libraries with
few exceptions are expected to be prebuilt with a sanitizer. Another
purpuse of *_pic.a files can be constructing static PIE programs, however
they are not supported as of now and there is no sanitization of static
programs either.

Once MKSTATICPIE will be supported, it will be initially incompatible with
MKSANITIZER.

This change also makes it easier to build other targets like kernel and
kernel modules without userland sanitizers.

No functional change intended for MKSANITIZER=no users.


# 1.313 02-Jun-2018 christos

Sanitizers don't support static linking.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315
# 1.312 11-Mar-2018 mrg

define LIBXFONT2.


Revision tags: pgoyette-compat-base
# 1.311 25-Feb-2018 mrg

branches: 1.311.2;
add LIBKRB5_LDADD/LIBKRB5_DPADD and their static counterparts
to bsd.prog.mk. use them instead of hard coding various lists
of libraries for krb5.

this fixes static builds.


# 1.310 11-Dec-2017 christos

Instead of checking for obj existance which can be empty for shuttle-rule
programs, check for .sh sources.


# 1.309 10-Dec-2017 christos

don't try to build .debug files for shell scripts.


# 1.308 10-Oct-2017 christos

Add general {DP,LD}ADD.rump variables


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base
# 1.307 21-May-2017 riastradh

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.


# 1.306 21-May-2017 riastradh

Remove some vestiges of MKCRYPTO_IDEA/MKCRYPTO_MDC2.


# 1.305 21-May-2017 riastradh

Remove MKCRYPTO_RC5. Unconditionally include RC5 in libcrypto.so.

This option existed only because RC5 is covered by patents that, twenty
years ago, we had reason to suspect the patent holder, RSA, Inc., might
litigate. The two US patents in question are 5,724,428 and 5,835,600.

According to the USPTO Patent Term Calculator web site at
<https://www.uspto.gov/patent/laws-and-regulations/patent-term-calculator#heading-5>
(retrieved 2017-05-21), patents filed after 1995-06-07 expire twenty
years after the filing date.

number filing date
5,724,428 1995-11-01
5,835,600 1997-04-21

Thus, these patents appear to be expired.

As proposed on tech-crypto and tech-security:

https://mail-index.netbsd.org/tech-crypto/2017/05/05/msg000718.html
https://mail-index.netbsd.org/tech-security/2017/05/05/msg000927.html


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.304 19-Apr-2017 joerg

Add netpgpverify to the library list.


Revision tags: pgoyette-localcount-20170320
# 1.303 20-Feb-2017 rin

add missing LIBCXX


# 1.302 08-Feb-2017 kamil

libpthread_dbg(3) deletion from the base distribution

libpthread_dbg(3) is a remnant library from the M:N thread model
(pre-NetBSD-5.0) API to introspect threads within a process and for use
of debuggers.

Currently in the 1:1 model it's not used in GDB neither in LLDB and it's
not either planned to be used. It's current function to read pthread_t
structures is realizable within a regular debugger capable to
instrospect objects within a tracee (GDB, LLDB...).

Remaining users of this API can still use this library from
pkgsrc/devel/libpthread_dbg.

Sponsored by <The NetBSD Foundation>


# 1.301 29-Jan-2017 christos

add sqlite3 to statically linked libraries for pam.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914
# 1.300 20-Aug-2016 christos

branches: 1.300.2;
unbound additions


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.299 04-Apr-2016 joerg

branches: 1.299.2;
If the per-target LDSTATIC flag is set, don't include the PIE linker
flags as we currently don't support static PIE.


# 1.298 30-Mar-2016 martin

Pass -pie to cc, not -Wl,-pie. This way we have a chance to fix specs
for obscure corner cases like -pie -fPIE -static (used for
/usr/tests/lib/csu/h_initfini2 if building with MKPIE=yes).
While there also replace -fPIC with -fPIE for the PIE case, even if
it should be mostly equivalent.


# 1.297 12-Mar-2016 mrg

remove conditionals that are always true with GCC >= 4.8.


# 1.296 21-Feb-2016 christos

Add NODEBUG


# 1.295 31-Jan-2016 christos

Introduce NOPIE and NOCTF so that standalone programs build properly.


# 1.294 23-Jan-2016 christos

Define _KERNTYPES for things that need it.


# 1.293 07-Nov-2015 joerg

LIBEXECINFO


# 1.292 07-Jun-2015 matt

Make LIBCRT* depend on the right files if MLIBDIR from MKCOMPAT is defined.


# 1.291 01-Dec-2014 erh

PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilt
if any of their dependencies (i.e. the files they refer to) are changed.
This allows changes to transitive included headers to be handled properly.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.290 25-Mar-2014 ozaki-r

branches: 1.290.4;
Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.


Revision tags: riastradh-drm2-base3
# 1.289 09-Mar-2014 christos

let's see if the new dwarf library can handle dwarf 4


# 1.288 02-Mar-2014 christos

If we are compiling with -g and using gcc4.8 and dtrace downgrade
dwarf generation to version 2 for now.


# 1.287 15-Jan-2014 joerg

-Wl,-pie and -r don't agree with each other, so filter the former out.


# 1.286 11-Nov-2013 joerg

Relink binaries if crti.o changes.


# 1.285 29-Sep-2013 christos

Add libxcb


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.284 31-May-2013 mrg

add LIBX11_XCB; unfortunately since the library is named with a -
in it, we have to use an ugly hard coded assignment for now.
(could be cleaned up with more make variable magic i'm sure.)


# 1.283 04-Apr-2013 christos

ldopts should be before ldadd like everywhere else.


Revision tags: agc-symver-base
# 1.282 14-Feb-2013 christos

Since the libraries are produced with different MK flags than the programs,
we check for existance of the files instead of the MK flags.


# 1.281 14-Feb-2013 christos

Add PROGDPLIBS


# 1.280 26-Jan-2013 christos

CTFCONVERT me harder.


Revision tags: yamt-pagecache-base8
# 1.279 17-Jan-2013 christos

Now that we have separate debug sets, add -g if ${MKDEBUG} is set for
program builds since we don't need to install that symbol files.


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.278 24-Aug-2012 jmmv

branches: 1.278.2;
Allow DPADD to be specified on a per-program basis.


# 1.277 23-Aug-2012 joerg

Revert last, it breaks the tricks xsrc uses.


# 1.276 23-Aug-2012 joerg

Remove SHLIBINSTALLDIR and SHLINKINSTALLLIBDIR. Add rpath entries, if
SHLIBDIR differs from /usr/lib.


# 1.275 08-Aug-2012 christos

add MKRUMP by popular demand.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.274 29-Feb-2012 tron

Move "libexpat" from X11 into base which fixes PR lib/40346.
This change was approved by the Core Group.


# 1.273 21-Feb-2012 matt

Remove another ${SIZE}


# 1.272 20-Feb-2012 matt

Remove ${SIZE}


# 1.271 19-Feb-2012 matt

Add support for --combine with gcc.


Revision tags: netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2
# 1.270 05-Nov-2011 christos

branches: 1.270.2;
Add libtre


Revision tags: yamt-pagecache-base
# 1.269 16-Oct-2011 christos

branches: 1.269.2;
- no need to special-case libraries with weird characters.
- add a note about adding new libraries.


# 1.268 16-Oct-2011 christos

fix list of libraries to reflect reality.


# 1.267 10-Sep-2011 apb

Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.


# 1.266 27-Aug-2011 joerg

Add new "analyze" command to run clang's static analyzer in a directory
on all C/C++ files.


Revision tags: cherry-xenmp-base
# 1.265 26-Apr-2011 he

The new Heimdal adds -lwind and -lheimbase to the set of libraries,
so define the corresponding LIB* variables.
These are also needed in the PAM_STATIC_* variables, so add them there too.


# 1.264 11-Apr-2011 joerg

Adjust --sysroot related usage:
-Wl,-rpath does not expand =, so just drop it.

Drop -Wl,-rpath-link entries that duplicate the -Wl,-rpath entries, this
is done implicitly now that ld is built with sysroot support.

Use ${DESTDIR} explicitly for the remaining -Wl,-rpath-link entries.


# 1.263 10-Apr-2011 joerg

For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.


# 1.262 08-Mar-2011 jmmv

Revert previous (revision 1.261): it broke the build because PROG_CXX is
defined in terms of PROG, so later on we would end up with target duplicates
because both PROG_CXX and PROG were being converted to PROGS_CXX and PROGS.

Did not catch this earlier because the test build I did was not clean and
thus the duplicate targets did not have nasty effects.


# 1.261 07-Mar-2011 jmmv

Always convert PROG to its plural form independently of whether PROG_CXX
is defined or not. From Garrett Cooper in private mail.


Revision tags: bouyer-quota2-nbase
# 1.260 20-Feb-2011 jmmv

Define LIBATF_C and LIBATF_CXX to point to their corresponding .a files and
use these to properly set DPADD for test programs.


Revision tags: bouyer-quota2-base
# 1.259 13-Feb-2011 christos

add saslc


# 1.258 06-Feb-2011 joerg

Don't use -nostdinc or -nostdinc++ if this is included in a HOSTLIB.


# 1.257 17-Jan-2011 pooka

branches: 1.257.2;
Add rump bits to DPSRCS so that update builds work correctly.


Revision tags: matt-mips64-premerge-20101231
# 1.256 13-Dec-2010 pooka

befriend RUMPPRG with CRUNCHEDPRG


# 1.255 13-Dec-2010 pooka

Define RUMPPRG, which is just like PROG, except it additionally
builds a rump client with the name rump.${PROG}. The rump client
is not installed suid/sgid by default even if BINMODE is defined.


# 1.254 10-Dec-2010 joerg

Revert last, gcc(1) checks explicitly for -r on some platforms to disable
passing down --relax as well.


# 1.253 08-Dec-2010 joerg

gcc passes down -r directly to ld, so make it explicitly a linker option.


# 1.252 08-Dec-2010 joerg

Don't depend on ${CC} passing down -R to ld, use -Wl,-rpath explicitly.


# 1.251 08-Nov-2010 lukem

Preserve date on original shared library or program when stripping
the debug symbols and adding the debug-link to .debug.
Use '(rm -f file; false)' in the failure path to force failure.
Based on solution proposed by Nicolas Joly on tech-toolchain in July 2010.
Should fix PR toolchain/44046 from Andreas Gustafsson.


# 1.250 31-Oct-2010 mbalmer

Link Lua to the build and add the resulting files to the distribution sets.
Document the addition of Lua and the change we made to the default settings.


# 1.249 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.248 24-Apr-2010 lukem

When extracting separate debug symbols with MKDEBUG, there's no need
to leave the original file unstripped...


# 1.247 02-Mar-2010 darran

DTrace: Add CTF generation to the make framework. Only enabled when
MKDTRACE=yes.


# 1.246 14-Dec-2009 mrg

use "${CC} -r" not "${CC} -Wl,-r" as the latter fools GCC on some targets
and it ends up passing "-r -relax" to ld, which causes ld to barf.


# 1.245 14-Dec-2009 matt

Merge from matt-nb5-mips64


Revision tags: matt-premerge-20091211
# 1.244 08-Dec-2009 uebayasi

When PROGS / LIBS are used, you can pass each PROG / LIB specific parameters
to ${LD} via:

${LDADD.${PROG}}
${LDFLAGS.${PROG}}
${LDSTATIC.${PROG}}
${LDADD.${LIB}}
${LDFLAGS.${LIB}}

OTOH you can't pass parameters to ${CC}, because in suffix rules make(1) only
knows the name of ${.IMPSRC} and ${.TARGET}; it's users' responsivility to
define ${CC} parameters to all the sources of a given ${PROG} / ${LIB}.

Should address bin/42381.

(Bug in this commit log was pointed out by mrg@.)


# 1.243 27-Nov-2009 tsutsui

If CPPFLAGS or CXXFLAGS already contains -nostdinc or -nostdinc++,
don't add ${CPPFLAGS_ISYSTEM} or ${CPPFLAGS_ISYSTEMXX} to refer
${DESTDIR}/usr/include or ${DESTDIR}/usr/include/g++.

This change might cause errors on some MD stand dir, but in that case
each Makefile should be fixed to search proper system include paths
by -Ipath option in own CPPFLAGS.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.242 12-May-2009 plunky

remove libsdp as improved functionality has been enabled in libbluetooth.


# 1.241 10-Apr-2009 apb

Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links. They have no effect except when using a
metalog, in which case the information is added to the metalog. In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg. This should fix PR 24457 and PR 41155.


# 1.240 24-Nov-2008 cube

branches: 1.240.2;
Move cleanextra to the very ends in case another included file wants to add
to it even if it was initially empty.


Revision tags: netbsd-5-base matt-mips64-base2
# 1.239 19-Oct-2008 christos

branches: 1.239.2;
handle assembly files for MKPIE


# 1.238 16-Oct-2008 christos

Provide a way for a program to override the PIE flags.


# 1.237 15-Oct-2008 christos

don't compile/link libraries with pie


Revision tags: mjf-devfs2-base
# 1.236 02-Oct-2008 joerg

Hook up libfetch and pkg_install update.


Revision tags: wrstuden-revivesa-base-3
# 1.235 09-Sep-2008 joerg

Add MKSTRIPIDENT to remove the RCS IDs from binary programs and shared
libraries for space-constraint systems. The description is based on the
feedback of hubertf@, the logic on input from lukem@

This obsoletes the removal of LIBC_SCCS and SYSLIBC_SCCS for libc builds.


Revision tags: wrstuden-revivesa-base-2
# 1.234 28-Aug-2008 mrg

update a comment example


# 1.233 27-Aug-2008 rtr

use ${X11USRLIBDIR} instead of hard-coded /usr/X11R6/lib when building
${LIB.foo} vars


# 1.232 27-Aug-2008 lukem

Fix problem I introduced in rev 1.231 on 2008/08/25 where ${_PROGLDOPTS}
and -L${_GCC_LIBGCCDIR} were appearing in the link line before ${LDADD},
so -L${DESTDIR}/lib and -L${DESTDIR}/usr/lib were being used before
local -L library paths.
Fixes ntpd/ntpdate failure noticed by Valeriy E. Ushakov <uwe@NetBSD.org>


# 1.231 25-Aug-2008 lukem

Always link with: -Wl,-rpath-link,${DESTDIR}/usr/lib -L${DESTDIR}/usr/lib
Fixes problem with MKDYNAMICROOT=no triggered by libraries that depend
on other libraries.
Related to PR 33503.

Clean up setting of _CCLINK to always add the appropriate -B options.

Simplify the link rule for a program.


# 1.230 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.229 28-May-2008 lukem

add LIBLDAR_R (for completeness)


# 1.228 22-May-2008 lukem

Add MKLDAP, USE_LDAP, LIBLBER, LIBLDAP


Revision tags: hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-pf42-base
# 1.227 10-Apr-2008 tsutsui

branches: 1.227.2; 1.227.4;
Add libhx509 to PAM_STATIC_LDADD which is required by libkrb5.


# 1.226 22-Mar-2008 mlelstv

branches: 1.226.2;
Import Heimdal-1.1


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase matt-armv6-base hpcarm-cleanup-base
# 1.225 26-Dec-2007 jmmv

Make the clean target work when OBJS is set but PROG is not, as happens
for example in gnu/lib/crtstuff4. Reported by drochner@.


Revision tags: cube-autoconf-base
# 1.224 13-Nov-2007 jmmv

Fix typo that prevented MKDEBUG builds to work. Found by drochner@.


# 1.223 12-Nov-2007 jmmv

Add the ability to build multiple programs from a single directory

This adds support for a new set of variables, PROGS and PROGS_CXX, that
allow the developer to build multiple different programs from a single
source directory.


# 1.222 04-Nov-2007 tls

Remove MKPRIVATELIB from BIND libraries; move library reachover
directories and Makefiles from src/usr.sbin/bind to src/lib; make
BIND libraries build shared. Saves about 1MB-1.5MB per installed
executable, about 5MB for a base+etc minimal installation of NetBSD.


Revision tags: matt-mips64-base
# 1.221 29-Jul-2007 joerg

branches: 1.221.4; 1.221.6;
Add build glue for libarchive and update the various sets.


# 1.220 25-Jan-2007 perry

Before I completely forget the issue, convert "PROG_PAX" to the
better-named "PAXCTL_FLAGS".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.219 11-Nov-2006 christos

don't run paxctl if other commands were specified for that target.


# 1.218 10-Nov-2006 christos

if ${PROG_PAX} is defined, run paxctl on the binary after linking with
the value of the variable. This way, if you set:

PROG_PAX=+M

in /etc/mk.conf, you get what you deserve.


# 1.217 22-Oct-2006 pooka

libpuffs


# 1.216 09-Oct-2006 mrg

- clean up some comments to reality.
- retire LIBDCK, LIBG2C and (long broken) USE_LIBSTDCXX
- in bsd.hostprog.mk's LIBSTDCPP -> LIBSTDCC
- add LIBSUPCXX
- don't default USE_LIBSTDCXX or USE_GCC4 since they are
not used in the tree any where
- same with USE_XF86_4; retire it
- remove _SUPCXX handling in bsd.prog.mk

inspired by PR#26714.


Revision tags: abandoned-netbsd-4-base
# 1.215 23-Jul-2006 lukem

Implement MKDEBUG:
If "no", don't build and install separate debugging symbols
into /usr/libdata/debug.
Default: no


# 1.214 19-Jun-2006 gdamore

Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.


# 1.213 09-Jun-2006 christos

PR/33681: Scott Ellis: Building 'bc' with SHAREDSTRINGS=yes fails
We need CPPFLAGS too now.


# 1.212 11-May-2006 mrg

add support for ${OBJCOPTS} and ${OBJCOPTS}.<lib|prog|fn>.


# 1.211 20-Mar-2006 christos

There is always one more KRB4 thing to remove. (from Jukka Salmi)


# 1.210 20-Mar-2006 christos

Remove krb4 variables and libraries (Jukka Salmi)


# 1.209 16-Mar-2006 jwise

Now that we have real build system support for syspkgs, remove someone's
half-implemented idea of building `syspkgs' (really a few giant blobs of the
same granularity of the old sets) using install(1).


# 1.208 20-Jan-2006 christos

Add the world of libraries to the static pam build. Now static pam binaries
work.


# 1.207 09-Apr-2005 dsl

Report when we link a program into xxx.ro (before being crunched)


Revision tags: netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.206 04-Mar-2005 he

branches: 1.206.2; 1.206.4;
Introduce PAM_STATIC_LDADD and PAM_STATIC_DPADD. When compiling
with MKPIC=no, possibly because the target does not support shared
libraries, these include libraries required to resolve all symbols
which end up referenced from PAM-using applications. The libraries
presently required are -lcrypt, -lrpcsvc and -lutil.

Add use of these variables which are currently set up to use PAM,
so that they compile when MKPIC=no.

Also, in the telnetd case, reorder the order of the libraries, so
that libtelnet.a comes before -ltermcap and -lutil, again to fix
link error when MKPIC=no.

Discussed with thorpej and christos.


# 1.205 20-Feb-2005 christos

Add libradius


# 1.204 12-Jan-2005 lukem

If RESCUEDIR is defined, automatically add that to CPPFLAGS


# 1.203 08-Jan-2005 lukem

Implement <bsd.prog.mk> vars:
LIBASN1 LIBBSDMALLOC LIBG2C LIBPAM LIBSSH


# 1.202 04-Aug-2004 lukem

Revert most of previous, and move the LIB<libname>?= assignments
back to bsd.prog.mk from bsd.own.mk.

pkgsrc uses <bsd.own.mk>, and setting LIB<libname> in it causes
problems with various package builds.
This should fix PR #26542 submitted by Jim Bernard.

(I'll be implementing the DPADD for shared libraries in a different
manner that generally won't depend upon ${LIB<libname>}.)


# 1.201 30-Jul-2004 lukem

Move the LIB<libname>?= assignments from bsd.prog.mk to bsd.own.mk so
that they may be used by non PROGs (e.g., LIBs).

Improve some comments.


# 1.200 10-Jun-2004 lukem

Be consistent in handling YHEADER, similar to Christos' fix in bsd.lib.mk 1.253


# 1.199 21-May-2004 ross

If you add a library, you need to define its DPADD symbol here.

Add LIBMAGIC.


Revision tags: netbsd-2-0-base
# 1.198 15-Feb-2004 skrll

branches: 1.198.2;
Be more gcc like in the way we deal with libgcc so that sh3/hppa millicode
and exception handling have a chance of working properly.

- creates libgcc, libgcc_eh and libgcc_s

- updates LIBGCC_SPEC to use them appropriately.

There's a hack in here at the moment with respect to libgcc_so in that it
is preferable to link against libgcc_so will only when -shared-libgcc is
specified (the c++ frontend does this automatically.) Configurations where
LINK_EH_SPEC is defined already do this. The gcc configuration for
NetBSD/alpha and another NetBSD platform (I forget which) actually define
LINK_EH_SPEC probably by accident rather than design.

- updates share/mk to use the compiler's knowledge of what needs linking into
libraries and executables. This removes an hppa hack.

- updates the sets for the newly created libgcc* files.

- support for linking against the _pg version of libgcc has been removed.


# 1.197 29-Jan-2004 lukem

Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.


# 1.196 27-Jan-2004 lukem

Replace
:M-[IDU]*
with
:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)


# 1.195 23-Jan-2004 simonb

crt0.o lives in /usr/lib even on a.out.


# 1.194 16-Nov-2003 lukem

simplify with _MKTARGET_LINK


# 1.193 11-Nov-2003 dsl

Set MKDEP_SUFFIXES to get additional targets in .depend instead of using
sed in .afterdepend. I don't think .afterdepend is used anywhere any more.


# 1.192 21-Oct-2003 lukem

Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.


# 1.191 19-Oct-2003 lukem

Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} " ... {$.TARGET}" and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO


# 1.190 18-Oct-2003 lukem

Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command ("verbose")
This is the default, and is equivalent to the previous behaviour.


# 1.189 29-Sep-2003 lukem

Add LIBSTDCXX (for usr/lib/libstdc++.a).
Sync LIB* documentation with reality.


# 1.188 19-Sep-2003 martin

Drop explicit medlow model and default to -O2 for sparc64.


# 1.187 14-Sep-2003 lukem

Check ${SHLIBDIR} against "/usr/lib" instead of ${LIBDIR} when determining
if we need to add stuff (usually "/lib") to the rpath-link path before
"/usr/lib". Otherwise, this barfs if LIBDIR != /usr/lib or /lib, and
we're cross-building (e.g., in src/x11)


# 1.186 13-Sep-2003 erh

Also support per-program LDFLAGS and LDSTATIC.


# 1.185 13-Sep-2003 erh

Create a way to add additional flags to COPTS, CPPFLAGS, CXXFLAGS and LDADD
for particular libraries or programs by specifying the additions in mk.conf
instead of needing to go edit individual Makefiles.


# 1.184 12-Sep-2003 lukem

add infrastructure to support reach-over builds of xsrc


# 1.183 22-Aug-2003 dsl

Add a ${PROG}.ro target that does an 'ld -r' of the program object files.
Allows a much simplified build of 'crunched' binaries since crunchgen can
build prog.ro instead of having to deretmine the names of all the .o files.


# 1.182 01-Aug-2003 lukem

Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".


# 1.181 01-Aug-2003 lukem

simplify the ${PROG}: target to reduce duplication between the DESTDIR
and !DESTDIR cases...


# 1.180 31-Jul-2003 lukem

bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.


# 1.179 31-Jul-2003 lukem

Don't need -R/usr/lib; it will be searched at the end by ld.elf_so anyway.
Noted by matt green <mrg@>


# 1.178 28-Jul-2003 lukem

be consistent when adding *.y and *.l to DPSRCS


# 1.177 28-Jul-2003 lukem

replace MKCXXSUPCXX(!=no) with USE_LIBSTDCXX(==no)


# 1.176 28-Jul-2003 lukem

Change defined(CXX_SUPCXX) to MKCXXSUPCXX != "no".

Clarify that command-line overrides of the MKxxx variables should be
done via the environment rather than make(1) command-line variable
assignment, since the latter doesn't actually work as intended.


# 1.175 27-Jul-2003 mrg

introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes. for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)


# 1.174 26-Jul-2003 mrg

add a new bsd.own.mk variable: CXX_SUPCXX. from bsd.README:
+ CXX_SUPCXX If defined, the support libraries needed for this C++ program
+ are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.


# 1.173 20-Jul-2003 lukem

Consistently support the different C++ file extensions: .cc .cpp .cxx .C
Noted by Andrew White in PR toolchain/18246


# 1.172 18-Jul-2003 lukem

Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was defined.
Replace defined(UNPRIVED) tests with ${MKUNPRIVED} != "no"

Add MKUPDATE; if not no has the same semantics as if UPDATE was defined.
Replace defined(UPDATE) tests with ${MKUPDATE} != "no"

Improve documentation for these and other make flags.


# 1.171 16-Jul-2003 itojun

stop installing install libtelnet. build under lib/libtelnet and reference
it from usr.bin/telnet and libexec/telnetd.
(reason for separate build: compiler flags)


# 1.170 27-Jun-2003 drochner

For consistency, use "-R" instead of "-Wl,-rpath" to pass
a runtime search path to the linker.


# 1.169 13-Jun-2003 itojun

define LIBEVENT


# 1.168 11-Jun-2003 msaitoh

catch signal 1,2,3,13 and 15 to clean /tmp/_dependXXX


# 1.167 31-May-2003 thorpej

If EXTERNAL_TOOLCHAIN is defined, allow the compiler to define the
location of crt{begin,end}{,S}.o and libgcc.a. Encapsulate all of
this logic into the new bsd.gcc.mk, and use it in bsd.prog.mk and
bsd.lib.mk.


# 1.166 18-May-2003 lukem

make this a no-op if HOSTPROG is defined


# 1.165 30-Mar-2003 thorpej

If MACHINE_ARCH is powerpc and we HAVE_GCC3, add crtsaveres.o to the
endfile spec.


# 1.164 22-Feb-2003 uwe

Typo in comment.


# 1.163 24-Jan-2003 thorpej

Add LIBPTHREAD, LIBPTHREAD_DB, and LIBRT.


Revision tags: fvdl_fs64_base
# 1.162 22-Nov-2002 thorpej

Split crtbegin/crtend into crti/crtbegin/crtend/crtn. NetBSD-specific
things like the .note.netbsd.ident section are provided by crti/crtn.
crti/crtn also provide the _init() and _fini() routines.

crtbegin/crtend now only provide support for ctors/dtors. This paves
the way to using the "crtstuff" provided with GCC (when we upgrade to
GCC 3.3), which provides, among other things, much better C++/Java
exception handling.


# 1.161 12-Nov-2002 itohy

MKDYNAMICROOT for a.out


# 1.160 22-Oct-2002 perry

Pass 1 of SYSPKG changes to automatically add tags=pkgname_pkg to METALOG.
Not quite ready for prime time yet.


# 1.159 27-Sep-2002 thorpej

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.


# 1.158 26-Sep-2002 itojun

MDC2 is a patented algorithm; don't ship it in default libcrypto.
MKCRYPTO_MDC2 will build a separate library, libcrypto_mdc2.


# 1.157 08-Sep-2002 thorpej

Build a .gdbinit in the objdir when building a program. The .gdbinit
file sets the shared library prefix to ${DESTDIR}, and adds "sources"
directives for each file listed in the GDBINIT Makefile variable.


# 1.156 09-Aug-2002 thorpej

Add LIBPMC.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.155 27-Mar-2002 eeh

branches: 1.155.2;
Use the medium low model for sparc64 programs that don't 2GB of data segment.


# 1.154 11-Feb-2002 mycroft

Don't use .PHONY for targets that are actually installed. Instead use force
dependencies. (Among other things, `make -t install' does something vaguely
sensible now.)


# 1.153 07-Feb-2002 pk

Mark installed system libraries as .MADE only if we're actually establishing
their default variable values here.


# 1.152 04-Feb-2002 christos

s/.NOSUFF/.MADE/


# 1.151 03-Feb-2002 christos

Apply a .NOSUFF: directive to targets we don't want to have processed by
the suffix rules engine.


# 1.150 02-Feb-2002 veego

Ups, it is LIBUSBHID and not LIBUSBHIB.


# 1.149 02-Feb-2002 veego

Change LIBUSB to LIBUSBHIB, reflecting the library name change.


# 1.148 29-Jan-2002 enami

Mark the targets clean{extra,objs} as PHONY.


# 1.147 04-Jan-2002 thorpej

For PROG_CXX DESTDIR builds, pull in -lstdc++ and -lm regardless
of GCC version.


# 1.146 01-Jan-2002 thorpej

Per a suggestion from matthew green, PROG_CXX takes the place of
PROG for C++ programs.


# 1.145 01-Jan-2002 thorpej

* If PROG_CXX is set by the program's Makefile, use ${CXX} to link
the program rather than ${CC}.
* If HAVE_GCC3 is defined, pull in "-lstdc++ -lm" as additional C++
support libraries for DESTDIR builds.


# 1.144 28-Dec-2001 lukem

* 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


# 1.143 28-Nov-2001 tv

If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.


# 1.142 19-Nov-2001 thorpej

Use a little transitional hack to determine if we use -isystem
or -idirafter. Use the former only of USE_NEW_TOOLCHAIN, since
-isystem causes the old toolchain to bomb out when building
libstdc++.


# 1.141 14-Nov-2001 tv

C/..$/.c/ -> C/\..$/.c/


# 1.140 14-Nov-2001 tv

Move the DESTDIR-based nostdinc logic to bsd.lib.mk and bsd.prog.mk where
it belongs (with the native target compile rules).


# 1.139 02-Nov-2001 tv

Use INSTALL_FILE/INSTALL_DIR as appropriate.


# 1.138 02-Nov-2001 tv

Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.


# 1.137 19-Oct-2001 tv

Add .NOPATH for all files generated from .l or .y files in SRCS. Fixes PRs
bin/14187 and lib/14239.

Also simplify the handling of these transforms to .c and .h files a bit by
leveraging make's builtin macro operators.


# 1.136 25-Sep-2001 tv

Set .NOPATH on program to build to make sure it goes in .OBJDIR.
Problem noted by <seebs@plethora.net>.


# 1.135 24-Sep-2001 lukem

fix previous (hi thor!) - $OBJS and $CLEANFILES might be empty, and
rm needs some files to delete...


# 1.134 24-Sep-2001 tls

Split "cleanprog" target apart: now you can zap only object files or
CLEANFILES (needed to fix crunchgen lossage).


# 1.133 13-Sep-2001 thorpej

Add LIBPCI.


# 1.132 14-Aug-2001 tv

Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").


# 1.131 01-Jun-2001 tv

Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).


# 1.130 08-May-2001 sommerfeld

Suppress duplicate entries in ALLFILES, FILES, INCS, DEPINCS, INFOFILES,
NLSALL, CATPAGES, MANPAGES, HTMLPAGES, and SCRIPTS.


# 1.129 19-Feb-2001 jmc

Wrap target() checks around afterdepend rule as some Makefiles override this


# 1.128 26-Jan-2001 itojun

fix typo in LIBSSL decl. it made programs with DPADD+=${LIBSSL} to build
every time we type "make". From: bernd


# 1.127 14-Jan-2001 christos

use the new .if commands(<target>) directive so that we don't have to
change Makefiles.


# 1.126 14-Jan-2001 christos

fix thinko: test for the existance of the target before we define it...


# 1.125 14-Jan-2001 christos

Alter previous redefined target protection. If the ${PROG} target is defined,
add the dependencies as usual, but don't add the commands. This avoids
having to change all the Makefiles that redefine the PROG target.


# 1.124 14-Jan-2001 christos

allow programs to override the program target.


# 1.123 08-Jan-2001 mrg

add missing $LIBCRYPTO_RC5 and $LIBCRYPTO_IDEA


# 1.122 08-Jan-2001 mrg

add missing $LIBSSL


# 1.121 04-Jan-2001 garbled

Add LIBCDK and LIBFORM definitions


# 1.120 31-Oct-2000 itojun

add ${LIBINTL} for use with DPADD.


# 1.119 07-Oct-2000 deberg

fix typos, PR 11159


# 1.118 25-Jun-2000 erh

For the case when DESTDIR is set: move the -L${DESTDIR}/usr/lib after ${LDADD} so any -L directories set in LDADD are searched first to avoid possibly linking against old versions of libraries.


Revision tags: netbsd-1-5-base
# 1.117 19-Jun-2000 thorpej

branches: 1.117.2;
Sync up the LIB* list.


# 1.116 10-Jun-2000 mycroft

Use ${.ALLSRC:T} when doing the generated variable name lookups, so that it
DTRT for generated files in and obj directory (or accessed via .PATH).


# 1.115 06-Jun-2000 mycroft

Abuse .USE some more.


# 1.114 06-Jun-2000 mycroft

Minor rearrangement.


# 1.113 06-Jun-2000 mycroft

Use ODE make(1) features to eliminate extra variables and move several things
outside of .for loops. (Needs more work to completely eliminate .for.)

XXX Don't look at this stuff. It will make your head hurt.


Revision tags: minoura-xpg4dl-base
# 1.112 14-Apr-2000 mrg

branches: 1.112.2;
use -rpath-link rather than -R when linking objects using a DESTDIR.
this replaces the previous change as that ended up adding
$DESTDIR/usr/lib to the runtime path of every binary created, which
is bogus and dangerous.


# 1.111 25-Mar-2000 mycroft

When linking with $DESTDIR, use an explicit -R to get library dependencies
correct.


# 1.110 07-Mar-2000 veego

Remove unused libahdi.
It will be replaced in the future with a more generic libdisklabel.


# 1.109 05-Feb-2000 jdc

Add libahdi entries.


# 1.108 23-Jan-2000 eeh

Add some support for FCode binaries.


# 1.107 22-Jan-2000 mycroft

Make `dependall' play nicely with SUBDIR, using a hack similar to `realinstall'
for both `depend' and `all'.
Also, remove the old hack that invokes an extra shell for .depend, now that
make(1) has been fixed.


# 1.106 16-Jan-2000 assar

all: depend on ${SCRIPTS} so that they get generated if they need to


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.105 23-Nov-1999 blymn

Added libmenu library.


Revision tags: comdex-fall-1999-base
# 1.104 14-Sep-1999 perry

branches: 1.104.4;
Add a "dependall" target, which does a "make depend" and then "make all"
in a single directory. This is useful in "make build" because by doing
the build immediately after the depend, all sources will typically
still be in the buffer cache, thus saving significant time over doing
a "make depend" on all the directories and then a "make all".


# 1.103 04-Sep-1999 fredb

Permit "make all install", as well as "make foo install" (where foo would be
installed by "make install") without setting of BUILD. All cases where BUILD
is already set are unchanged from the old behavior.

"make all install" is now practically equivalent to "make BUILD= all install",
but without actually setting build.

Fixes pr's 8313, 3894.


# 1.102 21-Aug-1999 simonb

Add ${INSTPRIV} to ${INSTALL} commands.


# 1.101 01-Jul-1999 itojun

branches: 1.101.2;
add LIBIPSEC for use from DPADD.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.100 12-Feb-1999 lukem

branches: 1.100.2;
* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.99 10-Feb-1999 tv

libbfd_pic.a is no longer installed; remove ${LIBBFD} define.


# 1.98 04-Feb-1999 christos

PR/2936: Brian C. Grayson: Avoid truncating precious files when installing
and the filesystem is full. Added ${RENAME} flag to install, which when set
to -r installs on a temporary file and then renames to the final destination.
${RENAME} is currently set to nothing in bsd.own.mk, but one can turn it
on in /etc/mk.conf.


# 1.97 07-Nov-1998 jonathan

Do DESTDIR support for crtbegin/crtend on all ELF ports (adds mips).


# 1.96 28-Sep-1998 christos

Use preserve flag in install.


# 1.95 10-Sep-1998 ross

Define a LIBBZ2?=... for use in DPADD=... lines.


# 1.94 09-Aug-1998 lukem

add distclean as a synonym for cleandir


# 1.93 09-Apr-1998 tv

.y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.


# 1.92 01-Apr-1998 tv

Revert. This broke too much in the build tree, and a better solution
needs to be created. (The existing situation breaks a lot too.)


# 1.91 01-Apr-1998 tv

Fix .y rules to DTRT with possibly generated .h files. See mail on
tech-toolchain for a very detailed explanation of this. In short, add
a .y.h rule identical to the .y.c rule and make the .y.c rule rename
the .h file; also, clean the .h file in CLEANFILES.


# 1.90 03-Nov-1997 cgd

echo the lint command line when making 'lint'.


# 1.89 28-Oct-1997 lukem

add ${LIBOBJC}


Revision tags: netbsd-1-3-base
# 1.88 11-Oct-1997 mycroft

branches: 1.88.2;
Several changes:
* Allow bsd.man.mk to be included separately.
* Always include bsd.own.mk and bsd.obj.mk.
* Include bsd.man.mk and bsd.nls.mk even if NOMAN or NONLS; just turn off
building of the affected files instead.
* Require bsd.subdir.mk to be included explicitly.
(Will make appropriate changes to Makefiles shortly.)


# 1.87 29-Sep-1997 gwr

Add $LIBBFD


# 1.86 31-May-1997 cjs

Back out BUILDDIR and NOINSTALL changes.


# 1.85 26-May-1997 cjs

branches: 1.85.2;
These updates to the build allow building against include files
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.


# 1.84 18-May-1997 kleink

Add libposix.


# 1.83 17-May-1997 mycroft

Do LINKS and SYMLINKS after FILES and INCS.


# 1.82 17-May-1997 mycroft

Remove unneeded .SUFFIXES lines, and move .s and .S closer to .o to give the
right preferences.


# 1.81 09-May-1997 mycroft

Fix typo in previous.


# 1.80 09-May-1997 mycroft

Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.79 09-May-1997 mycroft

Remove cruft.


# 1.78 09-May-1997 mycroft

Oops; rearrange dependencies to get things built early enough.


# 1.77 09-May-1997 mycroft

Make sure INCS and SRCS are built if necessary.


# 1.76 08-May-1997 gwr

Set the .NOPATH flag for ${OBJS} (from Christos).


# 1.75 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.74 07-May-1997 mycroft

Various simplifications.


# 1.73 07-May-1997 mycroft

Shuffle some .PHONYs around, to work better with `-t'.


# 1.72 06-May-1997 mycroft

Make most of the install targets .PRECIOUS.


# 1.71 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.70 18-Apr-1997 christos

Add ${LIBNTP}


# 1.69 17-Apr-1997 thorpej

- Properly depend on crtbegin.o and crtend.o for platforms that use
them (currently Alpha and PowerPC)
- STRIP -> STRIPFLAG


# 1.68 03-Apr-1997 mikel

don't allow override of all: target


# 1.67 29-Mar-1997 mikel

merge lite-2 changes (mostly SCCSids)


# 1.66 27-Mar-1997 christos

Put the FILES generated rules in a separate .mk file since both bsd.prog.mk
and bsd.lib.mk use them.


# 1.65 27-Mar-1997 mycroft

Make the SCRIPTS case mimic the FILES case more closely, so we can override
the destination direectory, etc.


# 1.64 27-Mar-1997 mycroft

Remove knowledge of HIDEGAME from here.


# 1.63 24-Mar-1997 christos

make rules update:
- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation


# 1.62 22-Mar-1997 perry

Fix SYMLINKS not to include DESTDIR in the link itself


# 1.61 13-Mar-1997 perry

add SYMLINKS, by analogy to LINKS. Vetted by Christos.


# 1.60 22-Jan-1997 cgd

if 'clean' is not already defined, rather than simply defining it with
a bunch of rules, define a clean{kmod,lib,prog} target with the rules,
and have both clean and cleandir depend on that. That eliminates a bug
where 'cleandir' in a directory which included e.g. bsd.prog.mk but which
also had subdirs would 'make clean' all the subdirs and then 'make cleandir'
all ofthe subdirs. It also allows Makefiles to add more dependencies
to 'clean' after inclusion of the make template.

If 'clean' is already defined, the behaviour is the same as it used to be.


# 1.59 20-Dec-1996 cgd

add an afterdepend target (a la the one in bsd.lib.mk) that processes
the .depend file to add <filename>.ln for each <filename>.o as an
object file which has the given dependencies (in addition to
<filename>.po and <filename>.so, which were already there).


# 1.58 13-Dec-1996 mikel

add missing LIBPCAP definition.


# 1.57 26-Nov-1996 mrg

add libz and libwrap


# 1.56 18-Oct-1996 thorpej

Use ${INSTALL} rather than "install".
From Simon J. Gerraty <sjg@zen.void.oz.au>, PR #1458.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.55 08-Apr-1996 jtc

Sort LIBFOO definitions and add LIBY; Reported by Mike Long <mike.long@analog.com> in PR #2301.


# 1.54 22-Oct-1995 christos

Added include file <bsd.sys.mk> that contains lex and yacc "parallel aware"
rules. These rules are not turned on by default; they are enabled by setting
the PARALLEL variable.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.53 25-Jun-1995 cgd

oops; fix an rm that might be empty


# 1.52 24-Jun-1995 cgd

update lint rules, but keep linting disabled


# 1.51 10-Jun-1995 mycroft

Define LIBEDIT.


# 1.50 21-Apr-1995 jtc

.include <bsd.nls.mk> unless NONLS is defined.


# 1.49 22-Dec-1994 cgd

specify man pages differently, and document how.


# 1.48 24-Aug-1994 mycroft

Include bsd.own.mk earlier.


# 1.47 20-Jul-1994 cgd

fix from christos, for progs w/o objects


Revision tags: netbsd-1-0-base
# 1.46 06-Jul-1994 mycroft

branches: 1.46.2;
Pull libraries from ${DESTDIR} if set. Kill LDONLY, which is unused and
probably not useful anyway.


# 1.45 30-Jun-1994 cgd

fix modify-info-nothingness-then-substitute probelm that broke genclass build


# 1.44 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.43 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.42 28-Jun-1994 jtc

Strip *.sh when constructing OBJS from SRCS.
This will allow us to clean up makefiles that build a script by munging
a template (uusched, genclass, neqn, etc.).


# 1.41 18-Jun-1994 cgd

don't chown the symlink, when HIDEGAME causes a symlink to be made to dm.
4.4-based FS code _follows_ the symlinks on a chown(2) call.


# 1.40 24-May-1994 cgd

fix the last to do the right thing for dependencies


# 1.39 24-May-1994 deraadt

LIBSKEY


# 1.38 22-May-1994 jtc

Single source file programs are now compiled into object files before they
are linked. This change halves the time it takes to rebuild all of the
NetBSD sources when only the C library is "touched"; but only takes about
one percent more disk space.


# 1.37 06-Apr-1994 chopps

relink (recompile) single source programs when crt0.o is updated.


# 1.36 24-Mar-1994 mycroft

Remove *.core on clean.


# 1.35 09-Feb-1994 cgd

kill install -d's.


# 1.34 28-Jan-1994 cgd

add LIBKVM


# 1.33 10-Nov-1993 cgd

librpc doesn't exist anymore


# 1.32 08-Nov-1993 cgd

ad LDSTATIC flag, so static linking can be made one-stop shopping.
use "setenv LDSTATIC" to make *everything* dynamically linked,
setenv LDSTATIC -static for everything statically linked, or unset
it for default behavior.


# 1.31 07-Oct-1993 cgd

LIBTERM pointed at nothing, but was meant to point to libtermcap.a...


# 1.30 07-Oct-1993 cgd

always define LIBCRYPT


# 1.29 17-Aug-1993 mycroft

Make sure we don't recurse into subdirectories if Makefile specified `install'
target. (It's usually blank and is specifically to avoid doing this...)


# 1.28 15-Aug-1993 mycroft

Automatically include bsd.subdir.mk for backward compatibility.


# 1.27 15-Aug-1993 mycroft

Don't automatically include bsd.subdir.mk in bsd.prog.mk and bsd.lib.mk.
Put back .MAIN in bsd.man.mk, and be careful not to include ../Makefile.inc
a second time.


# 1.26 15-Aug-1993 mycroft

Move man rules to sys.mk.
Use bsd.subdir.mk for building subdirectories.
Don't forget to remove x.cc and x.C when using SHAREDSTRINGS.
Make ${PROG} always depend on ${LIBCRT0}.
Don't duplicate code between cleandir and clean.
Move tags target to bsd.dep.mk.
Move STRIP to bsd.own.mk.
Remove redundant definitions of {BIN,MAN}{DIR,GRP,OWN,MODE}.
Move {LIB,DOC}{DIR,GRP,OWN,MODE} defaults to bsd.own.mk.


# 1.25 15-Aug-1993 mycroft

Abstract out dependency stuff, and add RCS identifiers.


# 1.24 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


# 1.23 10-Aug-1993 mycroft

Put LINKS handling in `install' target, so it's the last thing executed, and
happens even if `realinstall' is user-defined.


# 1.22 30-Jul-1993 mycroft

When generating a default OBJS, ignore .h files.


# 1.21 29-Jul-1993 mycroft

Don't print the `making ...' message if an obj dir already exists.
Also, a minor cleanup.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.20 17-Jul-1993 mycroft

Fix C++ dependencies for good. `make depend' is now done in two passes--one
of C files and one for C++ files. No need to specify `-+' in your Makefile,
as it is now done automatically.


# 1.19 17-Jul-1993 cgd

do c++ dependencies the right way...


# 1.18 17-Jul-1993 mycroft

Add suffix rules for C++ files.


# 1.17 04-Jun-1993 brezak

Add LIBRPCSVC variable.


# 1.16 02-Jun-1993 cgd

add ability to specify c++ dependencies, by setting CFLAGS+=-+ for
the dependency make.


# 1.15 26-Apr-1993 cgd

added definition for DPADD library variable LIBCRYPT.


# 1.14 26-Apr-1993 mycroft

Don't redefine `realinstall' target if already defined.


# 1.13 25-Apr-1993 mycroft

Link with LDFLAGS even if one source module.


# 1.12 25-Apr-1993 mycroft

Don't lose if we include bsd.prog.mk only to build man pages.


# 1.11 25-Apr-1993 mycroft

Fix error in last change. (Oops.)


# 1.10 25-Apr-1993 mycroft

Don't build man pages if NOMAN set.


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.9 09-Apr-1993 cgd

various changes to default make rules. from patch 101.
note that only the "sensible" changes in patch 101 are implemented.


# 1.8 08-Apr-1993 cgd

try to do the right thing, in terms making directories before we
install into them, and get the manpage cleans _OUT_ of "clean".
they don't belong there, only in cleandir, WFJ be damned.


# 1.7 08-Apr-1993 cgd

fixed typos...


# 1.6 08-Apr-1993 cgd

(silently) make sure we have directories before installing


# 1.5 04-Apr-1993 cgd

make LIBRPC point to the right place


# 1.4 27-Mar-1993 nate

Fixed the doc macros to call troff, eqn,and tbl instead of ditroff,
deqn, and dtbl.
Fixed make clean to remove the man pages (Bill fixed this in the distribution,
but not in the original source)
Changed install to leave the original file around, by using 'cp' instead of
'mv'. "install -c ..."


# 1.3 23-Mar-1993 cgd

made .CURDIR be absolute, not relative, thereby eliminating
the need for some of the makefile trickery when making objects,
and fixing a few .PATH bugs


# 1.2 22-Mar-1993 cgd

fixed "make obj" for cases when sources not in /usr/src/...
if sources not there, it now mkdirs obj, but some trickery
is necessary, to avoid deleting cwd.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.324 18-Nov-2019 christos

Improve the script to check for installed libraries, and fix the wrong
names and obsolete libraries it found.


# 1.323 27-Aug-2019 kamil

Enhance the support of LLVM sanitizers

Define _REENTRANT for MKSANITIZER build. This is needed for at least stdio
code. This caused new build issued with duplicated symbols in few places
and rump kernel code picking different code paths borrowed from libc.
Handle all this in one go.

Add bsd.sanitizer.mk to share common code used by programs and libraries.

Switch from realall to beforeinstall target in .syms files. This is more
reliable in MKSANITIZER.


# 1.322 17-Aug-2019 kamil

Add PAXCTL_FLAG rules for MKSANITIZER

Add per-program rules to disable ASLR for ASan, TSan and MSan in all
sanitized programs. This flag is not needed for other supported sanitizers.

Without this change, sanitized init(8) dies early on startup.

Approach originally suggested by <joerg>


# 1.321 15-Aug-2019 kamil

Add SANITIZER_RENAME_CLASSES in bsd.prog.mk

This adds a more flexible version of SANITIZER_RENAME_SYMBOL.

New symbol allows to specify MKSANITIZER specific renames on per-file and
per-symbol basis.


# 1.320 10-Aug-2019 christos

Make the X11 library lists consistent again.


Revision tags: netbsd-9-base phil-wifi-20190609 pgoyette-compat-20190127
# 1.319 21-Jan-2019 christos

branches: 1.319.2;
Most of the mv operations are to move temporary files to their final place.
Some use -f, others don't. This can lead to spurious build failures when
the user performing the build changes. Centralize, and always use -f.


Revision tags: pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.318 12-Aug-2018 christos

fix broken library variable definitions (inconsistencies between
bsd.README and bsd.prog.mk)


Revision tags: pgoyette-compat-0728
# 1.317 25-Jul-2018 kamil

Introduce MKLIBCSANITIZER in the share/mk rules

Add flags that are required to build a program and a dynamically loaded
library.

Propagade LIBCSANITIZERFLAGS to CFLAGS and CXXFLAGS.

LDFLAGS is not changed on purpose, as a libcsanitizer is inside libc
and no external dependencies are needed.

Register NOLIBCSANITIZER, as certain distribution parts will need to be
skipped.


# 1.316 12-Jul-2018 maxv

Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.


Revision tags: phil-wifi-base
# 1.315 25-Jun-2018 kamil

branches: 1.315.2;
Add a framework for renaming symbols in libc&co for MKSANITIZER

A new keyword SANITIZER_RENAME_SYMBOL. It's a variable that has specified
a list of symbols to be renamed in a processor in order to remove naming
conflicts with public symbols in libc/m/pthread/rt.

This renaming will occur for libraries and programs.
A symbol with a conflicting 'name', will be renamed to '__mksanitizer_name'.

Based on an idea by <christos>


Revision tags: pgoyette-compat-0625
# 1.314 21-Jun-2018 kamil

Refactor MKSANITIZER flags in mk rules

Introduce a new variable SANITIZERFLAGS that contains all the sanitizer
specific flags. These flags are designed to be passed to CFLAGS, CXXFLAGS
and LDFLAGS.

Pass SANITIZERFLAGS in bsd.prog.mk rules to CFLAGS, CXXFLAGS and LDFLAGS.

Pass SANITIZERFLAGS in bsd.lib.mk rules to *_pic.a build flags. The *_pic.a
libraries are designed to construct .so libraries. All .so libraries with
few exceptions are expected to be prebuilt with a sanitizer. Another
purpuse of *_pic.a files can be constructing static PIE programs, however
they are not supported as of now and there is no sanitization of static
programs either.

Once MKSTATICPIE will be supported, it will be initially incompatible with
MKSANITIZER.

This change also makes it easier to build other targets like kernel and
kernel modules without userland sanitizers.

No functional change intended for MKSANITIZER=no users.


# 1.313 02-Jun-2018 christos

Sanitizers don't support static linking.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315
# 1.312 11-Mar-2018 mrg

define LIBXFONT2.


Revision tags: pgoyette-compat-base
# 1.311 25-Feb-2018 mrg

branches: 1.311.2;
add LIBKRB5_LDADD/LIBKRB5_DPADD and their static counterparts
to bsd.prog.mk. use them instead of hard coding various lists
of libraries for krb5.

this fixes static builds.


# 1.310 11-Dec-2017 christos

Instead of checking for obj existance which can be empty for shuttle-rule
programs, check for .sh sources.


# 1.309 10-Dec-2017 christos

don't try to build .debug files for shell scripts.


# 1.308 10-Oct-2017 christos

Add general {DP,LD}ADD.rump variables


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base
# 1.307 21-May-2017 riastradh

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.


# 1.306 21-May-2017 riastradh

Remove some vestiges of MKCRYPTO_IDEA/MKCRYPTO_MDC2.


# 1.305 21-May-2017 riastradh

Remove MKCRYPTO_RC5. Unconditionally include RC5 in libcrypto.so.

This option existed only because RC5 is covered by patents that, twenty
years ago, we had reason to suspect the patent holder, RSA, Inc., might
litigate. The two US patents in question are 5,724,428 and 5,835,600.

According to the USPTO Patent Term Calculator web site at
<https://www.uspto.gov/patent/laws-and-regulations/patent-term-calculator#heading-5>
(retrieved 2017-05-21), patents filed after 1995-06-07 expire twenty
years after the filing date.

number filing date
5,724,428 1995-11-01
5,835,600 1997-04-21

Thus, these patents appear to be expired.

As proposed on tech-crypto and tech-security:

https://mail-index.netbsd.org/tech-crypto/2017/05/05/msg000718.html
https://mail-index.netbsd.org/tech-security/2017/05/05/msg000927.html


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.304 19-Apr-2017 joerg

Add netpgpverify to the library list.


Revision tags: pgoyette-localcount-20170320
# 1.303 20-Feb-2017 rin

add missing LIBCXX


# 1.302 08-Feb-2017 kamil

libpthread_dbg(3) deletion from the base distribution

libpthread_dbg(3) is a remnant library from the M:N thread model
(pre-NetBSD-5.0) API to introspect threads within a process and for use
of debuggers.

Currently in the 1:1 model it's not used in GDB neither in LLDB and it's
not either planned to be used. It's current function to read pthread_t
structures is realizable within a regular debugger capable to
instrospect objects within a tracee (GDB, LLDB...).

Remaining users of this API can still use this library from
pkgsrc/devel/libpthread_dbg.

Sponsored by <The NetBSD Foundation>


# 1.301 29-Jan-2017 christos

add sqlite3 to statically linked libraries for pam.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914
# 1.300 20-Aug-2016 christos

branches: 1.300.2;
unbound additions


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.299 04-Apr-2016 joerg

branches: 1.299.2;
If the per-target LDSTATIC flag is set, don't include the PIE linker
flags as we currently don't support static PIE.


# 1.298 30-Mar-2016 martin

Pass -pie to cc, not -Wl,-pie. This way we have a chance to fix specs
for obscure corner cases like -pie -fPIE -static (used for
/usr/tests/lib/csu/h_initfini2 if building with MKPIE=yes).
While there also replace -fPIC with -fPIE for the PIE case, even if
it should be mostly equivalent.


# 1.297 12-Mar-2016 mrg

remove conditionals that are always true with GCC >= 4.8.


# 1.296 21-Feb-2016 christos

Add NODEBUG


# 1.295 31-Jan-2016 christos

Introduce NOPIE and NOCTF so that standalone programs build properly.


# 1.294 23-Jan-2016 christos

Define _KERNTYPES for things that need it.


# 1.293 07-Nov-2015 joerg

LIBEXECINFO


# 1.292 07-Jun-2015 matt

Make LIBCRT* depend on the right files if MLIBDIR from MKCOMPAT is defined.


# 1.291 01-Dec-2014 erh

PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilt
if any of their dependencies (i.e. the files they refer to) are changed.
This allows changes to transitive included headers to be handled properly.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.290 25-Mar-2014 ozaki-r

branches: 1.290.4;
Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.


Revision tags: riastradh-drm2-base3
# 1.289 09-Mar-2014 christos

let's see if the new dwarf library can handle dwarf 4


# 1.288 02-Mar-2014 christos

If we are compiling with -g and using gcc4.8 and dtrace downgrade
dwarf generation to version 2 for now.


# 1.287 15-Jan-2014 joerg

-Wl,-pie and -r don't agree with each other, so filter the former out.


# 1.286 11-Nov-2013 joerg

Relink binaries if crti.o changes.


# 1.285 29-Sep-2013 christos

Add libxcb


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.284 31-May-2013 mrg

add LIBX11_XCB; unfortunately since the library is named with a -
in it, we have to use an ugly hard coded assignment for now.
(could be cleaned up with more make variable magic i'm sure.)


# 1.283 04-Apr-2013 christos

ldopts should be before ldadd like everywhere else.


Revision tags: agc-symver-base
# 1.282 14-Feb-2013 christos

Since the libraries are produced with different MK flags than the programs,
we check for existance of the files instead of the MK flags.


# 1.281 14-Feb-2013 christos

Add PROGDPLIBS


# 1.280 26-Jan-2013 christos

CTFCONVERT me harder.


Revision tags: yamt-pagecache-base8
# 1.279 17-Jan-2013 christos

Now that we have separate debug sets, add -g if ${MKDEBUG} is set for
program builds since we don't need to install that symbol files.


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.278 24-Aug-2012 jmmv

branches: 1.278.2;
Allow DPADD to be specified on a per-program basis.


# 1.277 23-Aug-2012 joerg

Revert last, it breaks the tricks xsrc uses.


# 1.276 23-Aug-2012 joerg

Remove SHLIBINSTALLDIR and SHLINKINSTALLLIBDIR. Add rpath entries, if
SHLIBDIR differs from /usr/lib.


# 1.275 08-Aug-2012 christos

add MKRUMP by popular demand.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.274 29-Feb-2012 tron

Move "libexpat" from X11 into base which fixes PR lib/40346.
This change was approved by the Core Group.


# 1.273 21-Feb-2012 matt

Remove another ${SIZE}


# 1.272 20-Feb-2012 matt

Remove ${SIZE}


# 1.271 19-Feb-2012 matt

Add support for --combine with gcc.


Revision tags: netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2
# 1.270 05-Nov-2011 christos

branches: 1.270.2;
Add libtre


Revision tags: yamt-pagecache-base
# 1.269 16-Oct-2011 christos

branches: 1.269.2;
- no need to special-case libraries with weird characters.
- add a note about adding new libraries.


# 1.268 16-Oct-2011 christos

fix list of libraries to reflect reality.


# 1.267 10-Sep-2011 apb

Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.


# 1.266 27-Aug-2011 joerg

Add new "analyze" command to run clang's static analyzer in a directory
on all C/C++ files.


Revision tags: cherry-xenmp-base
# 1.265 26-Apr-2011 he

The new Heimdal adds -lwind and -lheimbase to the set of libraries,
so define the corresponding LIB* variables.
These are also needed in the PAM_STATIC_* variables, so add them there too.


# 1.264 11-Apr-2011 joerg

Adjust --sysroot related usage:
-Wl,-rpath does not expand =, so just drop it.

Drop -Wl,-rpath-link entries that duplicate the -Wl,-rpath entries, this
is done implicitly now that ld is built with sysroot support.

Use ${DESTDIR} explicitly for the remaining -Wl,-rpath-link entries.


# 1.263 10-Apr-2011 joerg

For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.


# 1.262 08-Mar-2011 jmmv

Revert previous (revision 1.261): it broke the build because PROG_CXX is
defined in terms of PROG, so later on we would end up with target duplicates
because both PROG_CXX and PROG were being converted to PROGS_CXX and PROGS.

Did not catch this earlier because the test build I did was not clean and
thus the duplicate targets did not have nasty effects.


# 1.261 07-Mar-2011 jmmv

Always convert PROG to its plural form independently of whether PROG_CXX
is defined or not. From Garrett Cooper in private mail.


Revision tags: bouyer-quota2-nbase
# 1.260 20-Feb-2011 jmmv

Define LIBATF_C and LIBATF_CXX to point to their corresponding .a files and
use these to properly set DPADD for test programs.


Revision tags: bouyer-quota2-base
# 1.259 13-Feb-2011 christos

add saslc


# 1.258 06-Feb-2011 joerg

Don't use -nostdinc or -nostdinc++ if this is included in a HOSTLIB.


# 1.257 17-Jan-2011 pooka

branches: 1.257.2;
Add rump bits to DPSRCS so that update builds work correctly.


Revision tags: matt-mips64-premerge-20101231
# 1.256 13-Dec-2010 pooka

befriend RUMPPRG with CRUNCHEDPRG


# 1.255 13-Dec-2010 pooka

Define RUMPPRG, which is just like PROG, except it additionally
builds a rump client with the name rump.${PROG}. The rump client
is not installed suid/sgid by default even if BINMODE is defined.


# 1.254 10-Dec-2010 joerg

Revert last, gcc(1) checks explicitly for -r on some platforms to disable
passing down --relax as well.


# 1.253 08-Dec-2010 joerg

gcc passes down -r directly to ld, so make it explicitly a linker option.


# 1.252 08-Dec-2010 joerg

Don't depend on ${CC} passing down -R to ld, use -Wl,-rpath explicitly.


# 1.251 08-Nov-2010 lukem

Preserve date on original shared library or program when stripping
the debug symbols and adding the debug-link to .debug.
Use '(rm -f file; false)' in the failure path to force failure.
Based on solution proposed by Nicolas Joly on tech-toolchain in July 2010.
Should fix PR toolchain/44046 from Andreas Gustafsson.


# 1.250 31-Oct-2010 mbalmer

Link Lua to the build and add the resulting files to the distribution sets.
Document the addition of Lua and the change we made to the default settings.


# 1.249 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.248 24-Apr-2010 lukem

When extracting separate debug symbols with MKDEBUG, there's no need
to leave the original file unstripped...


# 1.247 02-Mar-2010 darran

DTrace: Add CTF generation to the make framework. Only enabled when
MKDTRACE=yes.


# 1.246 14-Dec-2009 mrg

use "${CC} -r" not "${CC} -Wl,-r" as the latter fools GCC on some targets
and it ends up passing "-r -relax" to ld, which causes ld to barf.


# 1.245 14-Dec-2009 matt

Merge from matt-nb5-mips64


Revision tags: matt-premerge-20091211
# 1.244 08-Dec-2009 uebayasi

When PROGS / LIBS are used, you can pass each PROG / LIB specific parameters
to ${LD} via:

${LDADD.${PROG}}
${LDFLAGS.${PROG}}
${LDSTATIC.${PROG}}
${LDADD.${LIB}}
${LDFLAGS.${LIB}}

OTOH you can't pass parameters to ${CC}, because in suffix rules make(1) only
knows the name of ${.IMPSRC} and ${.TARGET}; it's users' responsivility to
define ${CC} parameters to all the sources of a given ${PROG} / ${LIB}.

Should address bin/42381.

(Bug in this commit log was pointed out by mrg@.)


# 1.243 27-Nov-2009 tsutsui

If CPPFLAGS or CXXFLAGS already contains -nostdinc or -nostdinc++,
don't add ${CPPFLAGS_ISYSTEM} or ${CPPFLAGS_ISYSTEMXX} to refer
${DESTDIR}/usr/include or ${DESTDIR}/usr/include/g++.

This change might cause errors on some MD stand dir, but in that case
each Makefile should be fixed to search proper system include paths
by -Ipath option in own CPPFLAGS.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.242 12-May-2009 plunky

remove libsdp as improved functionality has been enabled in libbluetooth.


# 1.241 10-Apr-2009 apb

Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links. They have no effect except when using a
metalog, in which case the information is added to the metalog. In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg. This should fix PR 24457 and PR 41155.


# 1.240 24-Nov-2008 cube

branches: 1.240.2;
Move cleanextra to the very ends in case another included file wants to add
to it even if it was initially empty.


Revision tags: netbsd-5-base matt-mips64-base2
# 1.239 19-Oct-2008 christos

branches: 1.239.2;
handle assembly files for MKPIE


# 1.238 16-Oct-2008 christos

Provide a way for a program to override the PIE flags.


# 1.237 15-Oct-2008 christos

don't compile/link libraries with pie


Revision tags: mjf-devfs2-base
# 1.236 02-Oct-2008 joerg

Hook up libfetch and pkg_install update.


Revision tags: wrstuden-revivesa-base-3
# 1.235 09-Sep-2008 joerg

Add MKSTRIPIDENT to remove the RCS IDs from binary programs and shared
libraries for space-constraint systems. The description is based on the
feedback of hubertf@, the logic on input from lukem@

This obsoletes the removal of LIBC_SCCS and SYSLIBC_SCCS for libc builds.


Revision tags: wrstuden-revivesa-base-2
# 1.234 28-Aug-2008 mrg

update a comment example


# 1.233 27-Aug-2008 rtr

use ${X11USRLIBDIR} instead of hard-coded /usr/X11R6/lib when building
${LIB.foo} vars


# 1.232 27-Aug-2008 lukem

Fix problem I introduced in rev 1.231 on 2008/08/25 where ${_PROGLDOPTS}
and -L${_GCC_LIBGCCDIR} were appearing in the link line before ${LDADD},
so -L${DESTDIR}/lib and -L${DESTDIR}/usr/lib were being used before
local -L library paths.
Fixes ntpd/ntpdate failure noticed by Valeriy E. Ushakov <uwe@NetBSD.org>


# 1.231 25-Aug-2008 lukem

Always link with: -Wl,-rpath-link,${DESTDIR}/usr/lib -L${DESTDIR}/usr/lib
Fixes problem with MKDYNAMICROOT=no triggered by libraries that depend
on other libraries.
Related to PR 33503.

Clean up setting of _CCLINK to always add the appropriate -B options.

Simplify the link rule for a program.


# 1.230 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.229 28-May-2008 lukem

add LIBLDAR_R (for completeness)


# 1.228 22-May-2008 lukem

Add MKLDAP, USE_LDAP, LIBLBER, LIBLDAP


Revision tags: hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-pf42-base
# 1.227 10-Apr-2008 tsutsui

branches: 1.227.2; 1.227.4;
Add libhx509 to PAM_STATIC_LDADD which is required by libkrb5.


# 1.226 22-Mar-2008 mlelstv

branches: 1.226.2;
Import Heimdal-1.1


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase matt-armv6-base hpcarm-cleanup-base
# 1.225 26-Dec-2007 jmmv

Make the clean target work when OBJS is set but PROG is not, as happens
for example in gnu/lib/crtstuff4. Reported by drochner@.


Revision tags: cube-autoconf-base
# 1.224 13-Nov-2007 jmmv

Fix typo that prevented MKDEBUG builds to work. Found by drochner@.


# 1.223 12-Nov-2007 jmmv

Add the ability to build multiple programs from a single directory

This adds support for a new set of variables, PROGS and PROGS_CXX, that
allow the developer to build multiple different programs from a single
source directory.


# 1.222 04-Nov-2007 tls

Remove MKPRIVATELIB from BIND libraries; move library reachover
directories and Makefiles from src/usr.sbin/bind to src/lib; make
BIND libraries build shared. Saves about 1MB-1.5MB per installed
executable, about 5MB for a base+etc minimal installation of NetBSD.


Revision tags: matt-mips64-base
# 1.221 29-Jul-2007 joerg

branches: 1.221.4; 1.221.6;
Add build glue for libarchive and update the various sets.


# 1.220 25-Jan-2007 perry

Before I completely forget the issue, convert "PROG_PAX" to the
better-named "PAXCTL_FLAGS".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.219 11-Nov-2006 christos

don't run paxctl if other commands were specified for that target.


# 1.218 10-Nov-2006 christos

if ${PROG_PAX} is defined, run paxctl on the binary after linking with
the value of the variable. This way, if you set:

PROG_PAX=+M

in /etc/mk.conf, you get what you deserve.


# 1.217 22-Oct-2006 pooka

libpuffs


# 1.216 09-Oct-2006 mrg

- clean up some comments to reality.
- retire LIBDCK, LIBG2C and (long broken) USE_LIBSTDCXX
- in bsd.hostprog.mk's LIBSTDCPP -> LIBSTDCC
- add LIBSUPCXX
- don't default USE_LIBSTDCXX or USE_GCC4 since they are
not used in the tree any where
- same with USE_XF86_4; retire it
- remove _SUPCXX handling in bsd.prog.mk

inspired by PR#26714.


Revision tags: abandoned-netbsd-4-base
# 1.215 23-Jul-2006 lukem

Implement MKDEBUG:
If "no", don't build and install separate debugging symbols
into /usr/libdata/debug.
Default: no


# 1.214 19-Jun-2006 gdamore

Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.


# 1.213 09-Jun-2006 christos

PR/33681: Scott Ellis: Building 'bc' with SHAREDSTRINGS=yes fails
We need CPPFLAGS too now.


# 1.212 11-May-2006 mrg

add support for ${OBJCOPTS} and ${OBJCOPTS}.<lib|prog|fn>.


# 1.211 20-Mar-2006 christos

There is always one more KRB4 thing to remove. (from Jukka Salmi)


# 1.210 20-Mar-2006 christos

Remove krb4 variables and libraries (Jukka Salmi)


# 1.209 16-Mar-2006 jwise

Now that we have real build system support for syspkgs, remove someone's
half-implemented idea of building `syspkgs' (really a few giant blobs of the
same granularity of the old sets) using install(1).


# 1.208 20-Jan-2006 christos

Add the world of libraries to the static pam build. Now static pam binaries
work.


# 1.207 09-Apr-2005 dsl

Report when we link a program into xxx.ro (before being crunched)


Revision tags: netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.206 04-Mar-2005 he

branches: 1.206.2; 1.206.4;
Introduce PAM_STATIC_LDADD and PAM_STATIC_DPADD. When compiling
with MKPIC=no, possibly because the target does not support shared
libraries, these include libraries required to resolve all symbols
which end up referenced from PAM-using applications. The libraries
presently required are -lcrypt, -lrpcsvc and -lutil.

Add use of these variables which are currently set up to use PAM,
so that they compile when MKPIC=no.

Also, in the telnetd case, reorder the order of the libraries, so
that libtelnet.a comes before -ltermcap and -lutil, again to fix
link error when MKPIC=no.

Discussed with thorpej and christos.


# 1.205 20-Feb-2005 christos

Add libradius


# 1.204 12-Jan-2005 lukem

If RESCUEDIR is defined, automatically add that to CPPFLAGS


# 1.203 08-Jan-2005 lukem

Implement <bsd.prog.mk> vars:
LIBASN1 LIBBSDMALLOC LIBG2C LIBPAM LIBSSH


# 1.202 04-Aug-2004 lukem

Revert most of previous, and move the LIB<libname>?= assignments
back to bsd.prog.mk from bsd.own.mk.

pkgsrc uses <bsd.own.mk>, and setting LIB<libname> in it causes
problems with various package builds.
This should fix PR #26542 submitted by Jim Bernard.

(I'll be implementing the DPADD for shared libraries in a different
manner that generally won't depend upon ${LIB<libname>}.)


# 1.201 30-Jul-2004 lukem

Move the LIB<libname>?= assignments from bsd.prog.mk to bsd.own.mk so
that they may be used by non PROGs (e.g., LIBs).

Improve some comments.


# 1.200 10-Jun-2004 lukem

Be consistent in handling YHEADER, similar to Christos' fix in bsd.lib.mk 1.253


# 1.199 21-May-2004 ross

If you add a library, you need to define its DPADD symbol here.

Add LIBMAGIC.


Revision tags: netbsd-2-0-base
# 1.198 15-Feb-2004 skrll

branches: 1.198.2;
Be more gcc like in the way we deal with libgcc so that sh3/hppa millicode
and exception handling have a chance of working properly.

- creates libgcc, libgcc_eh and libgcc_s

- updates LIBGCC_SPEC to use them appropriately.

There's a hack in here at the moment with respect to libgcc_so in that it
is preferable to link against libgcc_so will only when -shared-libgcc is
specified (the c++ frontend does this automatically.) Configurations where
LINK_EH_SPEC is defined already do this. The gcc configuration for
NetBSD/alpha and another NetBSD platform (I forget which) actually define
LINK_EH_SPEC probably by accident rather than design.

- updates share/mk to use the compiler's knowledge of what needs linking into
libraries and executables. This removes an hppa hack.

- updates the sets for the newly created libgcc* files.

- support for linking against the _pg version of libgcc has been removed.


# 1.197 29-Jan-2004 lukem

Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.


# 1.196 27-Jan-2004 lukem

Replace
:M-[IDU]*
with
:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)


# 1.195 23-Jan-2004 simonb

crt0.o lives in /usr/lib even on a.out.


# 1.194 16-Nov-2003 lukem

simplify with _MKTARGET_LINK


# 1.193 11-Nov-2003 dsl

Set MKDEP_SUFFIXES to get additional targets in .depend instead of using
sed in .afterdepend. I don't think .afterdepend is used anywhere any more.


# 1.192 21-Oct-2003 lukem

Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.


# 1.191 19-Oct-2003 lukem

Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} " ... {$.TARGET}" and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO


# 1.190 18-Oct-2003 lukem

Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command ("verbose")
This is the default, and is equivalent to the previous behaviour.


# 1.189 29-Sep-2003 lukem

Add LIBSTDCXX (for usr/lib/libstdc++.a).
Sync LIB* documentation with reality.


# 1.188 19-Sep-2003 martin

Drop explicit medlow model and default to -O2 for sparc64.


# 1.187 14-Sep-2003 lukem

Check ${SHLIBDIR} against "/usr/lib" instead of ${LIBDIR} when determining
if we need to add stuff (usually "/lib") to the rpath-link path before
"/usr/lib". Otherwise, this barfs if LIBDIR != /usr/lib or /lib, and
we're cross-building (e.g., in src/x11)


# 1.186 13-Sep-2003 erh

Also support per-program LDFLAGS and LDSTATIC.


# 1.185 13-Sep-2003 erh

Create a way to add additional flags to COPTS, CPPFLAGS, CXXFLAGS and LDADD
for particular libraries or programs by specifying the additions in mk.conf
instead of needing to go edit individual Makefiles.


# 1.184 12-Sep-2003 lukem

add infrastructure to support reach-over builds of xsrc


# 1.183 22-Aug-2003 dsl

Add a ${PROG}.ro target that does an 'ld -r' of the program object files.
Allows a much simplified build of 'crunched' binaries since crunchgen can
build prog.ro instead of having to deretmine the names of all the .o files.


# 1.182 01-Aug-2003 lukem

Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".


# 1.181 01-Aug-2003 lukem

simplify the ${PROG}: target to reduce duplication between the DESTDIR
and !DESTDIR cases...


# 1.180 31-Jul-2003 lukem

bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.


# 1.179 31-Jul-2003 lukem

Don't need -R/usr/lib; it will be searched at the end by ld.elf_so anyway.
Noted by matt green <mrg@>


# 1.178 28-Jul-2003 lukem

be consistent when adding *.y and *.l to DPSRCS


# 1.177 28-Jul-2003 lukem

replace MKCXXSUPCXX(!=no) with USE_LIBSTDCXX(==no)


# 1.176 28-Jul-2003 lukem

Change defined(CXX_SUPCXX) to MKCXXSUPCXX != "no".

Clarify that command-line overrides of the MKxxx variables should be
done via the environment rather than make(1) command-line variable
assignment, since the latter doesn't actually work as intended.


# 1.175 27-Jul-2003 mrg

introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes. for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)


# 1.174 26-Jul-2003 mrg

add a new bsd.own.mk variable: CXX_SUPCXX. from bsd.README:
+ CXX_SUPCXX If defined, the support libraries needed for this C++ program
+ are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.


# 1.173 20-Jul-2003 lukem

Consistently support the different C++ file extensions: .cc .cpp .cxx .C
Noted by Andrew White in PR toolchain/18246


# 1.172 18-Jul-2003 lukem

Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was defined.
Replace defined(UNPRIVED) tests with ${MKUNPRIVED} != "no"

Add MKUPDATE; if not no has the same semantics as if UPDATE was defined.
Replace defined(UPDATE) tests with ${MKUPDATE} != "no"

Improve documentation for these and other make flags.


# 1.171 16-Jul-2003 itojun

stop installing install libtelnet. build under lib/libtelnet and reference
it from usr.bin/telnet and libexec/telnetd.
(reason for separate build: compiler flags)


# 1.170 27-Jun-2003 drochner

For consistency, use "-R" instead of "-Wl,-rpath" to pass
a runtime search path to the linker.


# 1.169 13-Jun-2003 itojun

define LIBEVENT


# 1.168 11-Jun-2003 msaitoh

catch signal 1,2,3,13 and 15 to clean /tmp/_dependXXX


# 1.167 31-May-2003 thorpej

If EXTERNAL_TOOLCHAIN is defined, allow the compiler to define the
location of crt{begin,end}{,S}.o and libgcc.a. Encapsulate all of
this logic into the new bsd.gcc.mk, and use it in bsd.prog.mk and
bsd.lib.mk.


# 1.166 18-May-2003 lukem

make this a no-op if HOSTPROG is defined


# 1.165 30-Mar-2003 thorpej

If MACHINE_ARCH is powerpc and we HAVE_GCC3, add crtsaveres.o to the
endfile spec.


# 1.164 22-Feb-2003 uwe

Typo in comment.


# 1.163 24-Jan-2003 thorpej

Add LIBPTHREAD, LIBPTHREAD_DB, and LIBRT.


Revision tags: fvdl_fs64_base
# 1.162 22-Nov-2002 thorpej

Split crtbegin/crtend into crti/crtbegin/crtend/crtn. NetBSD-specific
things like the .note.netbsd.ident section are provided by crti/crtn.
crti/crtn also provide the _init() and _fini() routines.

crtbegin/crtend now only provide support for ctors/dtors. This paves
the way to using the "crtstuff" provided with GCC (when we upgrade to
GCC 3.3), which provides, among other things, much better C++/Java
exception handling.


# 1.161 12-Nov-2002 itohy

MKDYNAMICROOT for a.out


# 1.160 22-Oct-2002 perry

Pass 1 of SYSPKG changes to automatically add tags=pkgname_pkg to METALOG.
Not quite ready for prime time yet.


# 1.159 27-Sep-2002 thorpej

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.


# 1.158 26-Sep-2002 itojun

MDC2 is a patented algorithm; don't ship it in default libcrypto.
MKCRYPTO_MDC2 will build a separate library, libcrypto_mdc2.


# 1.157 08-Sep-2002 thorpej

Build a .gdbinit in the objdir when building a program. The .gdbinit
file sets the shared library prefix to ${DESTDIR}, and adds "sources"
directives for each file listed in the GDBINIT Makefile variable.


# 1.156 09-Aug-2002 thorpej

Add LIBPMC.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.155 27-Mar-2002 eeh

branches: 1.155.2;
Use the medium low model for sparc64 programs that don't 2GB of data segment.


# 1.154 11-Feb-2002 mycroft

Don't use .PHONY for targets that are actually installed. Instead use force
dependencies. (Among other things, `make -t install' does something vaguely
sensible now.)


# 1.153 07-Feb-2002 pk

Mark installed system libraries as .MADE only if we're actually establishing
their default variable values here.


# 1.152 04-Feb-2002 christos

s/.NOSUFF/.MADE/


# 1.151 03-Feb-2002 christos

Apply a .NOSUFF: directive to targets we don't want to have processed by
the suffix rules engine.


# 1.150 02-Feb-2002 veego

Ups, it is LIBUSBHID and not LIBUSBHIB.


# 1.149 02-Feb-2002 veego

Change LIBUSB to LIBUSBHIB, reflecting the library name change.


# 1.148 29-Jan-2002 enami

Mark the targets clean{extra,objs} as PHONY.


# 1.147 04-Jan-2002 thorpej

For PROG_CXX DESTDIR builds, pull in -lstdc++ and -lm regardless
of GCC version.


# 1.146 01-Jan-2002 thorpej

Per a suggestion from matthew green, PROG_CXX takes the place of
PROG for C++ programs.


# 1.145 01-Jan-2002 thorpej

* If PROG_CXX is set by the program's Makefile, use ${CXX} to link
the program rather than ${CC}.
* If HAVE_GCC3 is defined, pull in "-lstdc++ -lm" as additional C++
support libraries for DESTDIR builds.


# 1.144 28-Dec-2001 lukem

* 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


# 1.143 28-Nov-2001 tv

If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.


# 1.142 19-Nov-2001 thorpej

Use a little transitional hack to determine if we use -isystem
or -idirafter. Use the former only of USE_NEW_TOOLCHAIN, since
-isystem causes the old toolchain to bomb out when building
libstdc++.


# 1.141 14-Nov-2001 tv

C/..$/.c/ -> C/\..$/.c/


# 1.140 14-Nov-2001 tv

Move the DESTDIR-based nostdinc logic to bsd.lib.mk and bsd.prog.mk where
it belongs (with the native target compile rules).


# 1.139 02-Nov-2001 tv

Use INSTALL_FILE/INSTALL_DIR as appropriate.


# 1.138 02-Nov-2001 tv

Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.


# 1.137 19-Oct-2001 tv

Add .NOPATH for all files generated from .l or .y files in SRCS. Fixes PRs
bin/14187 and lib/14239.

Also simplify the handling of these transforms to .c and .h files a bit by
leveraging make's builtin macro operators.


# 1.136 25-Sep-2001 tv

Set .NOPATH on program to build to make sure it goes in .OBJDIR.
Problem noted by <seebs@plethora.net>.


# 1.135 24-Sep-2001 lukem

fix previous (hi thor!) - $OBJS and $CLEANFILES might be empty, and
rm needs some files to delete...


# 1.134 24-Sep-2001 tls

Split "cleanprog" target apart: now you can zap only object files or
CLEANFILES (needed to fix crunchgen lossage).


# 1.133 13-Sep-2001 thorpej

Add LIBPCI.


# 1.132 14-Aug-2001 tv

Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").


# 1.131 01-Jun-2001 tv

Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).


# 1.130 08-May-2001 sommerfeld

Suppress duplicate entries in ALLFILES, FILES, INCS, DEPINCS, INFOFILES,
NLSALL, CATPAGES, MANPAGES, HTMLPAGES, and SCRIPTS.


# 1.129 19-Feb-2001 jmc

Wrap target() checks around afterdepend rule as some Makefiles override this


# 1.128 26-Jan-2001 itojun

fix typo in LIBSSL decl. it made programs with DPADD+=${LIBSSL} to build
every time we type "make". From: bernd


# 1.127 14-Jan-2001 christos

use the new .if commands(<target>) directive so that we don't have to
change Makefiles.


# 1.126 14-Jan-2001 christos

fix thinko: test for the existance of the target before we define it...


# 1.125 14-Jan-2001 christos

Alter previous redefined target protection. If the ${PROG} target is defined,
add the dependencies as usual, but don't add the commands. This avoids
having to change all the Makefiles that redefine the PROG target.


# 1.124 14-Jan-2001 christos

allow programs to override the program target.


# 1.123 08-Jan-2001 mrg

add missing $LIBCRYPTO_RC5 and $LIBCRYPTO_IDEA


# 1.122 08-Jan-2001 mrg

add missing $LIBSSL


# 1.121 04-Jan-2001 garbled

Add LIBCDK and LIBFORM definitions


# 1.120 31-Oct-2000 itojun

add ${LIBINTL} for use with DPADD.


# 1.119 07-Oct-2000 deberg

fix typos, PR 11159


# 1.118 25-Jun-2000 erh

For the case when DESTDIR is set: move the -L${DESTDIR}/usr/lib after ${LDADD} so any -L directories set in LDADD are searched first to avoid possibly linking against old versions of libraries.


Revision tags: netbsd-1-5-base
# 1.117 19-Jun-2000 thorpej

branches: 1.117.2;
Sync up the LIB* list.


# 1.116 10-Jun-2000 mycroft

Use ${.ALLSRC:T} when doing the generated variable name lookups, so that it
DTRT for generated files in and obj directory (or accessed via .PATH).


# 1.115 06-Jun-2000 mycroft

Abuse .USE some more.


# 1.114 06-Jun-2000 mycroft

Minor rearrangement.


# 1.113 06-Jun-2000 mycroft

Use ODE make(1) features to eliminate extra variables and move several things
outside of .for loops. (Needs more work to completely eliminate .for.)

XXX Don't look at this stuff. It will make your head hurt.


Revision tags: minoura-xpg4dl-base
# 1.112 14-Apr-2000 mrg

branches: 1.112.2;
use -rpath-link rather than -R when linking objects using a DESTDIR.
this replaces the previous change as that ended up adding
$DESTDIR/usr/lib to the runtime path of every binary created, which
is bogus and dangerous.


# 1.111 25-Mar-2000 mycroft

When linking with $DESTDIR, use an explicit -R to get library dependencies
correct.


# 1.110 07-Mar-2000 veego

Remove unused libahdi.
It will be replaced in the future with a more generic libdisklabel.


# 1.109 05-Feb-2000 jdc

Add libahdi entries.


# 1.108 23-Jan-2000 eeh

Add some support for FCode binaries.


# 1.107 22-Jan-2000 mycroft

Make `dependall' play nicely with SUBDIR, using a hack similar to `realinstall'
for both `depend' and `all'.
Also, remove the old hack that invokes an extra shell for .depend, now that
make(1) has been fixed.


# 1.106 16-Jan-2000 assar

all: depend on ${SCRIPTS} so that they get generated if they need to


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.105 23-Nov-1999 blymn

Added libmenu library.


Revision tags: comdex-fall-1999-base
# 1.104 14-Sep-1999 perry

branches: 1.104.4;
Add a "dependall" target, which does a "make depend" and then "make all"
in a single directory. This is useful in "make build" because by doing
the build immediately after the depend, all sources will typically
still be in the buffer cache, thus saving significant time over doing
a "make depend" on all the directories and then a "make all".


# 1.103 04-Sep-1999 fredb

Permit "make all install", as well as "make foo install" (where foo would be
installed by "make install") without setting of BUILD. All cases where BUILD
is already set are unchanged from the old behavior.

"make all install" is now practically equivalent to "make BUILD= all install",
but without actually setting build.

Fixes pr's 8313, 3894.


# 1.102 21-Aug-1999 simonb

Add ${INSTPRIV} to ${INSTALL} commands.


# 1.101 01-Jul-1999 itojun

branches: 1.101.2;
add LIBIPSEC for use from DPADD.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.100 12-Feb-1999 lukem

branches: 1.100.2;
* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.99 10-Feb-1999 tv

libbfd_pic.a is no longer installed; remove ${LIBBFD} define.


# 1.98 04-Feb-1999 christos

PR/2936: Brian C. Grayson: Avoid truncating precious files when installing
and the filesystem is full. Added ${RENAME} flag to install, which when set
to -r installs on a temporary file and then renames to the final destination.
${RENAME} is currently set to nothing in bsd.own.mk, but one can turn it
on in /etc/mk.conf.


# 1.97 07-Nov-1998 jonathan

Do DESTDIR support for crtbegin/crtend on all ELF ports (adds mips).


# 1.96 28-Sep-1998 christos

Use preserve flag in install.


# 1.95 10-Sep-1998 ross

Define a LIBBZ2?=... for use in DPADD=... lines.


# 1.94 09-Aug-1998 lukem

add distclean as a synonym for cleandir


# 1.93 09-Apr-1998 tv

.y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.


# 1.92 01-Apr-1998 tv

Revert. This broke too much in the build tree, and a better solution
needs to be created. (The existing situation breaks a lot too.)


# 1.91 01-Apr-1998 tv

Fix .y rules to DTRT with possibly generated .h files. See mail on
tech-toolchain for a very detailed explanation of this. In short, add
a .y.h rule identical to the .y.c rule and make the .y.c rule rename
the .h file; also, clean the .h file in CLEANFILES.


# 1.90 03-Nov-1997 cgd

echo the lint command line when making 'lint'.


# 1.89 28-Oct-1997 lukem

add ${LIBOBJC}


Revision tags: netbsd-1-3-base
# 1.88 11-Oct-1997 mycroft

branches: 1.88.2;
Several changes:
* Allow bsd.man.mk to be included separately.
* Always include bsd.own.mk and bsd.obj.mk.
* Include bsd.man.mk and bsd.nls.mk even if NOMAN or NONLS; just turn off
building of the affected files instead.
* Require bsd.subdir.mk to be included explicitly.
(Will make appropriate changes to Makefiles shortly.)


# 1.87 29-Sep-1997 gwr

Add $LIBBFD


# 1.86 31-May-1997 cjs

Back out BUILDDIR and NOINSTALL changes.


# 1.85 26-May-1997 cjs

branches: 1.85.2;
These updates to the build allow building against include files
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.


# 1.84 18-May-1997 kleink

Add libposix.


# 1.83 17-May-1997 mycroft

Do LINKS and SYMLINKS after FILES and INCS.


# 1.82 17-May-1997 mycroft

Remove unneeded .SUFFIXES lines, and move .s and .S closer to .o to give the
right preferences.


# 1.81 09-May-1997 mycroft

Fix typo in previous.


# 1.80 09-May-1997 mycroft

Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.79 09-May-1997 mycroft

Remove cruft.


# 1.78 09-May-1997 mycroft

Oops; rearrange dependencies to get things built early enough.


# 1.77 09-May-1997 mycroft

Make sure INCS and SRCS are built if necessary.


# 1.76 08-May-1997 gwr

Set the .NOPATH flag for ${OBJS} (from Christos).


# 1.75 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.74 07-May-1997 mycroft

Various simplifications.


# 1.73 07-May-1997 mycroft

Shuffle some .PHONYs around, to work better with `-t'.


# 1.72 06-May-1997 mycroft

Make most of the install targets .PRECIOUS.


# 1.71 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.70 18-Apr-1997 christos

Add ${LIBNTP}


# 1.69 17-Apr-1997 thorpej

- Properly depend on crtbegin.o and crtend.o for platforms that use
them (currently Alpha and PowerPC)
- STRIP -> STRIPFLAG


# 1.68 03-Apr-1997 mikel

don't allow override of all: target


# 1.67 29-Mar-1997 mikel

merge lite-2 changes (mostly SCCSids)


# 1.66 27-Mar-1997 christos

Put the FILES generated rules in a separate .mk file since both bsd.prog.mk
and bsd.lib.mk use them.


# 1.65 27-Mar-1997 mycroft

Make the SCRIPTS case mimic the FILES case more closely, so we can override
the destination direectory, etc.


# 1.64 27-Mar-1997 mycroft

Remove knowledge of HIDEGAME from here.


# 1.63 24-Mar-1997 christos

make rules update:
- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation


# 1.62 22-Mar-1997 perry

Fix SYMLINKS not to include DESTDIR in the link itself


# 1.61 13-Mar-1997 perry

add SYMLINKS, by analogy to LINKS. Vetted by Christos.


# 1.60 22-Jan-1997 cgd

if 'clean' is not already defined, rather than simply defining it with
a bunch of rules, define a clean{kmod,lib,prog} target with the rules,
and have both clean and cleandir depend on that. That eliminates a bug
where 'cleandir' in a directory which included e.g. bsd.prog.mk but which
also had subdirs would 'make clean' all the subdirs and then 'make cleandir'
all ofthe subdirs. It also allows Makefiles to add more dependencies
to 'clean' after inclusion of the make template.

If 'clean' is already defined, the behaviour is the same as it used to be.


# 1.59 20-Dec-1996 cgd

add an afterdepend target (a la the one in bsd.lib.mk) that processes
the .depend file to add <filename>.ln for each <filename>.o as an
object file which has the given dependencies (in addition to
<filename>.po and <filename>.so, which were already there).


# 1.58 13-Dec-1996 mikel

add missing LIBPCAP definition.


# 1.57 26-Nov-1996 mrg

add libz and libwrap


# 1.56 18-Oct-1996 thorpej

Use ${INSTALL} rather than "install".
From Simon J. Gerraty <sjg@zen.void.oz.au>, PR #1458.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.55 08-Apr-1996 jtc

Sort LIBFOO definitions and add LIBY; Reported by Mike Long <mike.long@analog.com> in PR #2301.


# 1.54 22-Oct-1995 christos

Added include file <bsd.sys.mk> that contains lex and yacc "parallel aware"
rules. These rules are not turned on by default; they are enabled by setting
the PARALLEL variable.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.53 25-Jun-1995 cgd

oops; fix an rm that might be empty


# 1.52 24-Jun-1995 cgd

update lint rules, but keep linting disabled


# 1.51 10-Jun-1995 mycroft

Define LIBEDIT.


# 1.50 21-Apr-1995 jtc

.include <bsd.nls.mk> unless NONLS is defined.


# 1.49 22-Dec-1994 cgd

specify man pages differently, and document how.


# 1.48 24-Aug-1994 mycroft

Include bsd.own.mk earlier.


# 1.47 20-Jul-1994 cgd

fix from christos, for progs w/o objects


Revision tags: netbsd-1-0-base
# 1.46 06-Jul-1994 mycroft

branches: 1.46.2;
Pull libraries from ${DESTDIR} if set. Kill LDONLY, which is unused and
probably not useful anyway.


# 1.45 30-Jun-1994 cgd

fix modify-info-nothingness-then-substitute probelm that broke genclass build


# 1.44 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.43 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.42 28-Jun-1994 jtc

Strip *.sh when constructing OBJS from SRCS.
This will allow us to clean up makefiles that build a script by munging
a template (uusched, genclass, neqn, etc.).


# 1.41 18-Jun-1994 cgd

don't chown the symlink, when HIDEGAME causes a symlink to be made to dm.
4.4-based FS code _follows_ the symlinks on a chown(2) call.


# 1.40 24-May-1994 cgd

fix the last to do the right thing for dependencies


# 1.39 24-May-1994 deraadt

LIBSKEY


# 1.38 22-May-1994 jtc

Single source file programs are now compiled into object files before they
are linked. This change halves the time it takes to rebuild all of the
NetBSD sources when only the C library is "touched"; but only takes about
one percent more disk space.


# 1.37 06-Apr-1994 chopps

relink (recompile) single source programs when crt0.o is updated.


# 1.36 24-Mar-1994 mycroft

Remove *.core on clean.


# 1.35 09-Feb-1994 cgd

kill install -d's.


# 1.34 28-Jan-1994 cgd

add LIBKVM


# 1.33 10-Nov-1993 cgd

librpc doesn't exist anymore


# 1.32 08-Nov-1993 cgd

ad LDSTATIC flag, so static linking can be made one-stop shopping.
use "setenv LDSTATIC" to make *everything* dynamically linked,
setenv LDSTATIC -static for everything statically linked, or unset
it for default behavior.


# 1.31 07-Oct-1993 cgd

LIBTERM pointed at nothing, but was meant to point to libtermcap.a...


# 1.30 07-Oct-1993 cgd

always define LIBCRYPT


# 1.29 17-Aug-1993 mycroft

Make sure we don't recurse into subdirectories if Makefile specified `install'
target. (It's usually blank and is specifically to avoid doing this...)


# 1.28 15-Aug-1993 mycroft

Automatically include bsd.subdir.mk for backward compatibility.


# 1.27 15-Aug-1993 mycroft

Don't automatically include bsd.subdir.mk in bsd.prog.mk and bsd.lib.mk.
Put back .MAIN in bsd.man.mk, and be careful not to include ../Makefile.inc
a second time.


# 1.26 15-Aug-1993 mycroft

Move man rules to sys.mk.
Use bsd.subdir.mk for building subdirectories.
Don't forget to remove x.cc and x.C when using SHAREDSTRINGS.
Make ${PROG} always depend on ${LIBCRT0}.
Don't duplicate code between cleandir and clean.
Move tags target to bsd.dep.mk.
Move STRIP to bsd.own.mk.
Remove redundant definitions of {BIN,MAN}{DIR,GRP,OWN,MODE}.
Move {LIB,DOC}{DIR,GRP,OWN,MODE} defaults to bsd.own.mk.


# 1.25 15-Aug-1993 mycroft

Abstract out dependency stuff, and add RCS identifiers.


# 1.24 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


# 1.23 10-Aug-1993 mycroft

Put LINKS handling in `install' target, so it's the last thing executed, and
happens even if `realinstall' is user-defined.


# 1.22 30-Jul-1993 mycroft

When generating a default OBJS, ignore .h files.


# 1.21 29-Jul-1993 mycroft

Don't print the `making ...' message if an obj dir already exists.
Also, a minor cleanup.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.20 17-Jul-1993 mycroft

Fix C++ dependencies for good. `make depend' is now done in two passes--one
of C files and one for C++ files. No need to specify `-+' in your Makefile,
as it is now done automatically.


# 1.19 17-Jul-1993 cgd

do c++ dependencies the right way...


# 1.18 17-Jul-1993 mycroft

Add suffix rules for C++ files.


# 1.17 04-Jun-1993 brezak

Add LIBRPCSVC variable.


# 1.16 02-Jun-1993 cgd

add ability to specify c++ dependencies, by setting CFLAGS+=-+ for
the dependency make.


# 1.15 26-Apr-1993 cgd

added definition for DPADD library variable LIBCRYPT.


# 1.14 26-Apr-1993 mycroft

Don't redefine `realinstall' target if already defined.


# 1.13 25-Apr-1993 mycroft

Link with LDFLAGS even if one source module.


# 1.12 25-Apr-1993 mycroft

Don't lose if we include bsd.prog.mk only to build man pages.


# 1.11 25-Apr-1993 mycroft

Fix error in last change. (Oops.)


# 1.10 25-Apr-1993 mycroft

Don't build man pages if NOMAN set.


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.9 09-Apr-1993 cgd

various changes to default make rules. from patch 101.
note that only the "sensible" changes in patch 101 are implemented.


# 1.8 08-Apr-1993 cgd

try to do the right thing, in terms making directories before we
install into them, and get the manpage cleans _OUT_ of "clean".
they don't belong there, only in cleandir, WFJ be damned.


# 1.7 08-Apr-1993 cgd

fixed typos...


# 1.6 08-Apr-1993 cgd

(silently) make sure we have directories before installing


# 1.5 04-Apr-1993 cgd

make LIBRPC point to the right place


# 1.4 27-Mar-1993 nate

Fixed the doc macros to call troff, eqn,and tbl instead of ditroff,
deqn, and dtbl.
Fixed make clean to remove the man pages (Bill fixed this in the distribution,
but not in the original source)
Changed install to leave the original file around, by using 'cp' instead of
'mv'. "install -c ..."


# 1.3 23-Mar-1993 cgd

made .CURDIR be absolute, not relative, thereby eliminating
the need for some of the makefile trickery when making objects,
and fixing a few .PATH bugs


# 1.2 22-Mar-1993 cgd

fixed "make obj" for cases when sources not in /usr/src/...
if sources not there, it now mkdirs obj, but some trickery
is necessary, to avoid deleting cwd.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.323 27-Aug-2019 kamil

Enhance the support of LLVM sanitizers

Define _REENTRANT for MKSANITIZER build. This is needed for at least stdio
code. This caused new build issued with duplicated symbols in few places
and rump kernel code picking different code paths borrowed from libc.
Handle all this in one go.

Add bsd.sanitizer.mk to share common code used by programs and libraries.

Switch from realall to beforeinstall target in .syms files. This is more
reliable in MKSANITIZER.


# 1.322 17-Aug-2019 kamil

Add PAXCTL_FLAG rules for MKSANITIZER

Add per-program rules to disable ASLR for ASan, TSan and MSan in all
sanitized programs. This flag is not needed for other supported sanitizers.

Without this change, sanitized init(8) dies early on startup.

Approach originally suggested by <joerg>


# 1.321 15-Aug-2019 kamil

Add SANITIZER_RENAME_CLASSES in bsd.prog.mk

This adds a more flexible version of SANITIZER_RENAME_SYMBOL.

New symbol allows to specify MKSANITIZER specific renames on per-file and
per-symbol basis.


# 1.320 10-Aug-2019 christos

Make the X11 library lists consistent again.


Revision tags: netbsd-9-base phil-wifi-20190609 pgoyette-compat-20190127
# 1.319 21-Jan-2019 christos

branches: 1.319.2;
Most of the mv operations are to move temporary files to their final place.
Some use -f, others don't. This can lead to spurious build failures when
the user performing the build changes. Centralize, and always use -f.


Revision tags: pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.318 12-Aug-2018 christos

fix broken library variable definitions (inconsistencies between
bsd.README and bsd.prog.mk)


Revision tags: pgoyette-compat-0728
# 1.317 25-Jul-2018 kamil

Introduce MKLIBCSANITIZER in the share/mk rules

Add flags that are required to build a program and a dynamically loaded
library.

Propagade LIBCSANITIZERFLAGS to CFLAGS and CXXFLAGS.

LDFLAGS is not changed on purpose, as a libcsanitizer is inside libc
and no external dependencies are needed.

Register NOLIBCSANITIZER, as certain distribution parts will need to be
skipped.


# 1.316 12-Jul-2018 maxv

Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.


Revision tags: phil-wifi-base
# 1.315 25-Jun-2018 kamil

branches: 1.315.2;
Add a framework for renaming symbols in libc&co for MKSANITIZER

A new keyword SANITIZER_RENAME_SYMBOL. It's a variable that has specified
a list of symbols to be renamed in a processor in order to remove naming
conflicts with public symbols in libc/m/pthread/rt.

This renaming will occur for libraries and programs.
A symbol with a conflicting 'name', will be renamed to '__mksanitizer_name'.

Based on an idea by <christos>


Revision tags: pgoyette-compat-0625
# 1.314 21-Jun-2018 kamil

Refactor MKSANITIZER flags in mk rules

Introduce a new variable SANITIZERFLAGS that contains all the sanitizer
specific flags. These flags are designed to be passed to CFLAGS, CXXFLAGS
and LDFLAGS.

Pass SANITIZERFLAGS in bsd.prog.mk rules to CFLAGS, CXXFLAGS and LDFLAGS.

Pass SANITIZERFLAGS in bsd.lib.mk rules to *_pic.a build flags. The *_pic.a
libraries are designed to construct .so libraries. All .so libraries with
few exceptions are expected to be prebuilt with a sanitizer. Another
purpuse of *_pic.a files can be constructing static PIE programs, however
they are not supported as of now and there is no sanitization of static
programs either.

Once MKSTATICPIE will be supported, it will be initially incompatible with
MKSANITIZER.

This change also makes it easier to build other targets like kernel and
kernel modules without userland sanitizers.

No functional change intended for MKSANITIZER=no users.


# 1.313 02-Jun-2018 christos

Sanitizers don't support static linking.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315
# 1.312 11-Mar-2018 mrg

define LIBXFONT2.


Revision tags: pgoyette-compat-base
# 1.311 25-Feb-2018 mrg

branches: 1.311.2;
add LIBKRB5_LDADD/LIBKRB5_DPADD and their static counterparts
to bsd.prog.mk. use them instead of hard coding various lists
of libraries for krb5.

this fixes static builds.


# 1.310 11-Dec-2017 christos

Instead of checking for obj existance which can be empty for shuttle-rule
programs, check for .sh sources.


# 1.309 10-Dec-2017 christos

don't try to build .debug files for shell scripts.


# 1.308 10-Oct-2017 christos

Add general {DP,LD}ADD.rump variables


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base
# 1.307 21-May-2017 riastradh

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.


# 1.306 21-May-2017 riastradh

Remove some vestiges of MKCRYPTO_IDEA/MKCRYPTO_MDC2.


# 1.305 21-May-2017 riastradh

Remove MKCRYPTO_RC5. Unconditionally include RC5 in libcrypto.so.

This option existed only because RC5 is covered by patents that, twenty
years ago, we had reason to suspect the patent holder, RSA, Inc., might
litigate. The two US patents in question are 5,724,428 and 5,835,600.

According to the USPTO Patent Term Calculator web site at
<https://www.uspto.gov/patent/laws-and-regulations/patent-term-calculator#heading-5>
(retrieved 2017-05-21), patents filed after 1995-06-07 expire twenty
years after the filing date.

number filing date
5,724,428 1995-11-01
5,835,600 1997-04-21

Thus, these patents appear to be expired.

As proposed on tech-crypto and tech-security:

https://mail-index.netbsd.org/tech-crypto/2017/05/05/msg000718.html
https://mail-index.netbsd.org/tech-security/2017/05/05/msg000927.html


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.304 19-Apr-2017 joerg

Add netpgpverify to the library list.


Revision tags: pgoyette-localcount-20170320
# 1.303 20-Feb-2017 rin

add missing LIBCXX


# 1.302 08-Feb-2017 kamil

libpthread_dbg(3) deletion from the base distribution

libpthread_dbg(3) is a remnant library from the M:N thread model
(pre-NetBSD-5.0) API to introspect threads within a process and for use
of debuggers.

Currently in the 1:1 model it's not used in GDB neither in LLDB and it's
not either planned to be used. It's current function to read pthread_t
structures is realizable within a regular debugger capable to
instrospect objects within a tracee (GDB, LLDB...).

Remaining users of this API can still use this library from
pkgsrc/devel/libpthread_dbg.

Sponsored by <The NetBSD Foundation>


# 1.301 29-Jan-2017 christos

add sqlite3 to statically linked libraries for pam.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914
# 1.300 20-Aug-2016 christos

branches: 1.300.2;
unbound additions


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.299 04-Apr-2016 joerg

branches: 1.299.2;
If the per-target LDSTATIC flag is set, don't include the PIE linker
flags as we currently don't support static PIE.


# 1.298 30-Mar-2016 martin

Pass -pie to cc, not -Wl,-pie. This way we have a chance to fix specs
for obscure corner cases like -pie -fPIE -static (used for
/usr/tests/lib/csu/h_initfini2 if building with MKPIE=yes).
While there also replace -fPIC with -fPIE for the PIE case, even if
it should be mostly equivalent.


# 1.297 12-Mar-2016 mrg

remove conditionals that are always true with GCC >= 4.8.


# 1.296 21-Feb-2016 christos

Add NODEBUG


# 1.295 31-Jan-2016 christos

Introduce NOPIE and NOCTF so that standalone programs build properly.


# 1.294 23-Jan-2016 christos

Define _KERNTYPES for things that need it.


# 1.293 07-Nov-2015 joerg

LIBEXECINFO


# 1.292 07-Jun-2015 matt

Make LIBCRT* depend on the right files if MLIBDIR from MKCOMPAT is defined.


# 1.291 01-Dec-2014 erh

PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilt
if any of their dependencies (i.e. the files they refer to) are changed.
This allows changes to transitive included headers to be handled properly.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.290 25-Mar-2014 ozaki-r

branches: 1.290.4;
Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.


Revision tags: riastradh-drm2-base3
# 1.289 09-Mar-2014 christos

let's see if the new dwarf library can handle dwarf 4


# 1.288 02-Mar-2014 christos

If we are compiling with -g and using gcc4.8 and dtrace downgrade
dwarf generation to version 2 for now.


# 1.287 15-Jan-2014 joerg

-Wl,-pie and -r don't agree with each other, so filter the former out.


# 1.286 11-Nov-2013 joerg

Relink binaries if crti.o changes.


# 1.285 29-Sep-2013 christos

Add libxcb


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.284 31-May-2013 mrg

add LIBX11_XCB; unfortunately since the library is named with a -
in it, we have to use an ugly hard coded assignment for now.
(could be cleaned up with more make variable magic i'm sure.)


# 1.283 04-Apr-2013 christos

ldopts should be before ldadd like everywhere else.


Revision tags: agc-symver-base
# 1.282 14-Feb-2013 christos

Since the libraries are produced with different MK flags than the programs,
we check for existance of the files instead of the MK flags.


# 1.281 14-Feb-2013 christos

Add PROGDPLIBS


# 1.280 26-Jan-2013 christos

CTFCONVERT me harder.


Revision tags: yamt-pagecache-base8
# 1.279 17-Jan-2013 christos

Now that we have separate debug sets, add -g if ${MKDEBUG} is set for
program builds since we don't need to install that symbol files.


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.278 24-Aug-2012 jmmv

branches: 1.278.2;
Allow DPADD to be specified on a per-program basis.


# 1.277 23-Aug-2012 joerg

Revert last, it breaks the tricks xsrc uses.


# 1.276 23-Aug-2012 joerg

Remove SHLIBINSTALLDIR and SHLINKINSTALLLIBDIR. Add rpath entries, if
SHLIBDIR differs from /usr/lib.


# 1.275 08-Aug-2012 christos

add MKRUMP by popular demand.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.274 29-Feb-2012 tron

Move "libexpat" from X11 into base which fixes PR lib/40346.
This change was approved by the Core Group.


# 1.273 21-Feb-2012 matt

Remove another ${SIZE}


# 1.272 20-Feb-2012 matt

Remove ${SIZE}


# 1.271 19-Feb-2012 matt

Add support for --combine with gcc.


Revision tags: netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2
# 1.270 05-Nov-2011 christos

branches: 1.270.2;
Add libtre


Revision tags: yamt-pagecache-base
# 1.269 16-Oct-2011 christos

branches: 1.269.2;
- no need to special-case libraries with weird characters.
- add a note about adding new libraries.


# 1.268 16-Oct-2011 christos

fix list of libraries to reflect reality.


# 1.267 10-Sep-2011 apb

Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.


# 1.266 27-Aug-2011 joerg

Add new "analyze" command to run clang's static analyzer in a directory
on all C/C++ files.


Revision tags: cherry-xenmp-base
# 1.265 26-Apr-2011 he

The new Heimdal adds -lwind and -lheimbase to the set of libraries,
so define the corresponding LIB* variables.
These are also needed in the PAM_STATIC_* variables, so add them there too.


# 1.264 11-Apr-2011 joerg

Adjust --sysroot related usage:
-Wl,-rpath does not expand =, so just drop it.

Drop -Wl,-rpath-link entries that duplicate the -Wl,-rpath entries, this
is done implicitly now that ld is built with sysroot support.

Use ${DESTDIR} explicitly for the remaining -Wl,-rpath-link entries.


# 1.263 10-Apr-2011 joerg

For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.


# 1.262 08-Mar-2011 jmmv

Revert previous (revision 1.261): it broke the build because PROG_CXX is
defined in terms of PROG, so later on we would end up with target duplicates
because both PROG_CXX and PROG were being converted to PROGS_CXX and PROGS.

Did not catch this earlier because the test build I did was not clean and
thus the duplicate targets did not have nasty effects.


# 1.261 07-Mar-2011 jmmv

Always convert PROG to its plural form independently of whether PROG_CXX
is defined or not. From Garrett Cooper in private mail.


Revision tags: bouyer-quota2-nbase
# 1.260 20-Feb-2011 jmmv

Define LIBATF_C and LIBATF_CXX to point to their corresponding .a files and
use these to properly set DPADD for test programs.


Revision tags: bouyer-quota2-base
# 1.259 13-Feb-2011 christos

add saslc


# 1.258 06-Feb-2011 joerg

Don't use -nostdinc or -nostdinc++ if this is included in a HOSTLIB.


# 1.257 17-Jan-2011 pooka

branches: 1.257.2;
Add rump bits to DPSRCS so that update builds work correctly.


Revision tags: matt-mips64-premerge-20101231
# 1.256 13-Dec-2010 pooka

befriend RUMPPRG with CRUNCHEDPRG


# 1.255 13-Dec-2010 pooka

Define RUMPPRG, which is just like PROG, except it additionally
builds a rump client with the name rump.${PROG}. The rump client
is not installed suid/sgid by default even if BINMODE is defined.


# 1.254 10-Dec-2010 joerg

Revert last, gcc(1) checks explicitly for -r on some platforms to disable
passing down --relax as well.


# 1.253 08-Dec-2010 joerg

gcc passes down -r directly to ld, so make it explicitly a linker option.


# 1.252 08-Dec-2010 joerg

Don't depend on ${CC} passing down -R to ld, use -Wl,-rpath explicitly.


# 1.251 08-Nov-2010 lukem

Preserve date on original shared library or program when stripping
the debug symbols and adding the debug-link to .debug.
Use '(rm -f file; false)' in the failure path to force failure.
Based on solution proposed by Nicolas Joly on tech-toolchain in July 2010.
Should fix PR toolchain/44046 from Andreas Gustafsson.


# 1.250 31-Oct-2010 mbalmer

Link Lua to the build and add the resulting files to the distribution sets.
Document the addition of Lua and the change we made to the default settings.


# 1.249 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.248 24-Apr-2010 lukem

When extracting separate debug symbols with MKDEBUG, there's no need
to leave the original file unstripped...


# 1.247 02-Mar-2010 darran

DTrace: Add CTF generation to the make framework. Only enabled when
MKDTRACE=yes.


# 1.246 14-Dec-2009 mrg

use "${CC} -r" not "${CC} -Wl,-r" as the latter fools GCC on some targets
and it ends up passing "-r -relax" to ld, which causes ld to barf.


# 1.245 14-Dec-2009 matt

Merge from matt-nb5-mips64


Revision tags: matt-premerge-20091211
# 1.244 08-Dec-2009 uebayasi

When PROGS / LIBS are used, you can pass each PROG / LIB specific parameters
to ${LD} via:

${LDADD.${PROG}}
${LDFLAGS.${PROG}}
${LDSTATIC.${PROG}}
${LDADD.${LIB}}
${LDFLAGS.${LIB}}

OTOH you can't pass parameters to ${CC}, because in suffix rules make(1) only
knows the name of ${.IMPSRC} and ${.TARGET}; it's users' responsivility to
define ${CC} parameters to all the sources of a given ${PROG} / ${LIB}.

Should address bin/42381.

(Bug in this commit log was pointed out by mrg@.)


# 1.243 27-Nov-2009 tsutsui

If CPPFLAGS or CXXFLAGS already contains -nostdinc or -nostdinc++,
don't add ${CPPFLAGS_ISYSTEM} or ${CPPFLAGS_ISYSTEMXX} to refer
${DESTDIR}/usr/include or ${DESTDIR}/usr/include/g++.

This change might cause errors on some MD stand dir, but in that case
each Makefile should be fixed to search proper system include paths
by -Ipath option in own CPPFLAGS.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.242 12-May-2009 plunky

remove libsdp as improved functionality has been enabled in libbluetooth.


# 1.241 10-Apr-2009 apb

Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links. They have no effect except when using a
metalog, in which case the information is added to the metalog. In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg. This should fix PR 24457 and PR 41155.


# 1.240 24-Nov-2008 cube

branches: 1.240.2;
Move cleanextra to the very ends in case another included file wants to add
to it even if it was initially empty.


Revision tags: netbsd-5-base matt-mips64-base2
# 1.239 19-Oct-2008 christos

branches: 1.239.2;
handle assembly files for MKPIE


# 1.238 16-Oct-2008 christos

Provide a way for a program to override the PIE flags.


# 1.237 15-Oct-2008 christos

don't compile/link libraries with pie


Revision tags: mjf-devfs2-base
# 1.236 02-Oct-2008 joerg

Hook up libfetch and pkg_install update.


Revision tags: wrstuden-revivesa-base-3
# 1.235 09-Sep-2008 joerg

Add MKSTRIPIDENT to remove the RCS IDs from binary programs and shared
libraries for space-constraint systems. The description is based on the
feedback of hubertf@, the logic on input from lukem@

This obsoletes the removal of LIBC_SCCS and SYSLIBC_SCCS for libc builds.


Revision tags: wrstuden-revivesa-base-2
# 1.234 28-Aug-2008 mrg

update a comment example


# 1.233 27-Aug-2008 rtr

use ${X11USRLIBDIR} instead of hard-coded /usr/X11R6/lib when building
${LIB.foo} vars


# 1.232 27-Aug-2008 lukem

Fix problem I introduced in rev 1.231 on 2008/08/25 where ${_PROGLDOPTS}
and -L${_GCC_LIBGCCDIR} were appearing in the link line before ${LDADD},
so -L${DESTDIR}/lib and -L${DESTDIR}/usr/lib were being used before
local -L library paths.
Fixes ntpd/ntpdate failure noticed by Valeriy E. Ushakov <uwe@NetBSD.org>


# 1.231 25-Aug-2008 lukem

Always link with: -Wl,-rpath-link,${DESTDIR}/usr/lib -L${DESTDIR}/usr/lib
Fixes problem with MKDYNAMICROOT=no triggered by libraries that depend
on other libraries.
Related to PR 33503.

Clean up setting of _CCLINK to always add the appropriate -B options.

Simplify the link rule for a program.


# 1.230 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.229 28-May-2008 lukem

add LIBLDAR_R (for completeness)


# 1.228 22-May-2008 lukem

Add MKLDAP, USE_LDAP, LIBLBER, LIBLDAP


Revision tags: hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-pf42-base
# 1.227 10-Apr-2008 tsutsui

branches: 1.227.2; 1.227.4;
Add libhx509 to PAM_STATIC_LDADD which is required by libkrb5.


# 1.226 22-Mar-2008 mlelstv

branches: 1.226.2;
Import Heimdal-1.1


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase matt-armv6-base hpcarm-cleanup-base
# 1.225 26-Dec-2007 jmmv

Make the clean target work when OBJS is set but PROG is not, as happens
for example in gnu/lib/crtstuff4. Reported by drochner@.


Revision tags: cube-autoconf-base
# 1.224 13-Nov-2007 jmmv

Fix typo that prevented MKDEBUG builds to work. Found by drochner@.


# 1.223 12-Nov-2007 jmmv

Add the ability to build multiple programs from a single directory

This adds support for a new set of variables, PROGS and PROGS_CXX, that
allow the developer to build multiple different programs from a single
source directory.


# 1.222 04-Nov-2007 tls

Remove MKPRIVATELIB from BIND libraries; move library reachover
directories and Makefiles from src/usr.sbin/bind to src/lib; make
BIND libraries build shared. Saves about 1MB-1.5MB per installed
executable, about 5MB for a base+etc minimal installation of NetBSD.


Revision tags: matt-mips64-base
# 1.221 29-Jul-2007 joerg

branches: 1.221.4; 1.221.6;
Add build glue for libarchive and update the various sets.


# 1.220 25-Jan-2007 perry

Before I completely forget the issue, convert "PROG_PAX" to the
better-named "PAXCTL_FLAGS".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.219 11-Nov-2006 christos

don't run paxctl if other commands were specified for that target.


# 1.218 10-Nov-2006 christos

if ${PROG_PAX} is defined, run paxctl on the binary after linking with
the value of the variable. This way, if you set:

PROG_PAX=+M

in /etc/mk.conf, you get what you deserve.


# 1.217 22-Oct-2006 pooka

libpuffs


# 1.216 09-Oct-2006 mrg

- clean up some comments to reality.
- retire LIBDCK, LIBG2C and (long broken) USE_LIBSTDCXX
- in bsd.hostprog.mk's LIBSTDCPP -> LIBSTDCC
- add LIBSUPCXX
- don't default USE_LIBSTDCXX or USE_GCC4 since they are
not used in the tree any where
- same with USE_XF86_4; retire it
- remove _SUPCXX handling in bsd.prog.mk

inspired by PR#26714.


Revision tags: abandoned-netbsd-4-base
# 1.215 23-Jul-2006 lukem

Implement MKDEBUG:
If "no", don't build and install separate debugging symbols
into /usr/libdata/debug.
Default: no


# 1.214 19-Jun-2006 gdamore

Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.


# 1.213 09-Jun-2006 christos

PR/33681: Scott Ellis: Building 'bc' with SHAREDSTRINGS=yes fails
We need CPPFLAGS too now.


# 1.212 11-May-2006 mrg

add support for ${OBJCOPTS} and ${OBJCOPTS}.<lib|prog|fn>.


# 1.211 20-Mar-2006 christos

There is always one more KRB4 thing to remove. (from Jukka Salmi)


# 1.210 20-Mar-2006 christos

Remove krb4 variables and libraries (Jukka Salmi)


# 1.209 16-Mar-2006 jwise

Now that we have real build system support for syspkgs, remove someone's
half-implemented idea of building `syspkgs' (really a few giant blobs of the
same granularity of the old sets) using install(1).


# 1.208 20-Jan-2006 christos

Add the world of libraries to the static pam build. Now static pam binaries
work.


# 1.207 09-Apr-2005 dsl

Report when we link a program into xxx.ro (before being crunched)


Revision tags: netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.206 04-Mar-2005 he

branches: 1.206.2; 1.206.4;
Introduce PAM_STATIC_LDADD and PAM_STATIC_DPADD. When compiling
with MKPIC=no, possibly because the target does not support shared
libraries, these include libraries required to resolve all symbols
which end up referenced from PAM-using applications. The libraries
presently required are -lcrypt, -lrpcsvc and -lutil.

Add use of these variables which are currently set up to use PAM,
so that they compile when MKPIC=no.

Also, in the telnetd case, reorder the order of the libraries, so
that libtelnet.a comes before -ltermcap and -lutil, again to fix
link error when MKPIC=no.

Discussed with thorpej and christos.


# 1.205 20-Feb-2005 christos

Add libradius


# 1.204 12-Jan-2005 lukem

If RESCUEDIR is defined, automatically add that to CPPFLAGS


# 1.203 08-Jan-2005 lukem

Implement <bsd.prog.mk> vars:
LIBASN1 LIBBSDMALLOC LIBG2C LIBPAM LIBSSH


# 1.202 04-Aug-2004 lukem

Revert most of previous, and move the LIB<libname>?= assignments
back to bsd.prog.mk from bsd.own.mk.

pkgsrc uses <bsd.own.mk>, and setting LIB<libname> in it causes
problems with various package builds.
This should fix PR #26542 submitted by Jim Bernard.

(I'll be implementing the DPADD for shared libraries in a different
manner that generally won't depend upon ${LIB<libname>}.)


# 1.201 30-Jul-2004 lukem

Move the LIB<libname>?= assignments from bsd.prog.mk to bsd.own.mk so
that they may be used by non PROGs (e.g., LIBs).

Improve some comments.


# 1.200 10-Jun-2004 lukem

Be consistent in handling YHEADER, similar to Christos' fix in bsd.lib.mk 1.253


# 1.199 21-May-2004 ross

If you add a library, you need to define its DPADD symbol here.

Add LIBMAGIC.


Revision tags: netbsd-2-0-base
# 1.198 15-Feb-2004 skrll

branches: 1.198.2;
Be more gcc like in the way we deal with libgcc so that sh3/hppa millicode
and exception handling have a chance of working properly.

- creates libgcc, libgcc_eh and libgcc_s

- updates LIBGCC_SPEC to use them appropriately.

There's a hack in here at the moment with respect to libgcc_so in that it
is preferable to link against libgcc_so will only when -shared-libgcc is
specified (the c++ frontend does this automatically.) Configurations where
LINK_EH_SPEC is defined already do this. The gcc configuration for
NetBSD/alpha and another NetBSD platform (I forget which) actually define
LINK_EH_SPEC probably by accident rather than design.

- updates share/mk to use the compiler's knowledge of what needs linking into
libraries and executables. This removes an hppa hack.

- updates the sets for the newly created libgcc* files.

- support for linking against the _pg version of libgcc has been removed.


# 1.197 29-Jan-2004 lukem

Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.


# 1.196 27-Jan-2004 lukem

Replace
:M-[IDU]*
with
:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)


# 1.195 23-Jan-2004 simonb

crt0.o lives in /usr/lib even on a.out.


# 1.194 16-Nov-2003 lukem

simplify with _MKTARGET_LINK


# 1.193 11-Nov-2003 dsl

Set MKDEP_SUFFIXES to get additional targets in .depend instead of using
sed in .afterdepend. I don't think .afterdepend is used anywhere any more.


# 1.192 21-Oct-2003 lukem

Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.


# 1.191 19-Oct-2003 lukem

Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} " ... {$.TARGET}" and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO


# 1.190 18-Oct-2003 lukem

Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command ("verbose")
This is the default, and is equivalent to the previous behaviour.


# 1.189 29-Sep-2003 lukem

Add LIBSTDCXX (for usr/lib/libstdc++.a).
Sync LIB* documentation with reality.


# 1.188 19-Sep-2003 martin

Drop explicit medlow model and default to -O2 for sparc64.


# 1.187 14-Sep-2003 lukem

Check ${SHLIBDIR} against "/usr/lib" instead of ${LIBDIR} when determining
if we need to add stuff (usually "/lib") to the rpath-link path before
"/usr/lib". Otherwise, this barfs if LIBDIR != /usr/lib or /lib, and
we're cross-building (e.g., in src/x11)


# 1.186 13-Sep-2003 erh

Also support per-program LDFLAGS and LDSTATIC.


# 1.185 13-Sep-2003 erh

Create a way to add additional flags to COPTS, CPPFLAGS, CXXFLAGS and LDADD
for particular libraries or programs by specifying the additions in mk.conf
instead of needing to go edit individual Makefiles.


# 1.184 12-Sep-2003 lukem

add infrastructure to support reach-over builds of xsrc


# 1.183 22-Aug-2003 dsl

Add a ${PROG}.ro target that does an 'ld -r' of the program object files.
Allows a much simplified build of 'crunched' binaries since crunchgen can
build prog.ro instead of having to deretmine the names of all the .o files.


# 1.182 01-Aug-2003 lukem

Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".


# 1.181 01-Aug-2003 lukem

simplify the ${PROG}: target to reduce duplication between the DESTDIR
and !DESTDIR cases...


# 1.180 31-Jul-2003 lukem

bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.


# 1.179 31-Jul-2003 lukem

Don't need -R/usr/lib; it will be searched at the end by ld.elf_so anyway.
Noted by matt green <mrg@>


# 1.178 28-Jul-2003 lukem

be consistent when adding *.y and *.l to DPSRCS


# 1.177 28-Jul-2003 lukem

replace MKCXXSUPCXX(!=no) with USE_LIBSTDCXX(==no)


# 1.176 28-Jul-2003 lukem

Change defined(CXX_SUPCXX) to MKCXXSUPCXX != "no".

Clarify that command-line overrides of the MKxxx variables should be
done via the environment rather than make(1) command-line variable
assignment, since the latter doesn't actually work as intended.


# 1.175 27-Jul-2003 mrg

introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes. for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)


# 1.174 26-Jul-2003 mrg

add a new bsd.own.mk variable: CXX_SUPCXX. from bsd.README:
+ CXX_SUPCXX If defined, the support libraries needed for this C++ program
+ are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.


# 1.173 20-Jul-2003 lukem

Consistently support the different C++ file extensions: .cc .cpp .cxx .C
Noted by Andrew White in PR toolchain/18246


# 1.172 18-Jul-2003 lukem

Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was defined.
Replace defined(UNPRIVED) tests with ${MKUNPRIVED} != "no"

Add MKUPDATE; if not no has the same semantics as if UPDATE was defined.
Replace defined(UPDATE) tests with ${MKUPDATE} != "no"

Improve documentation for these and other make flags.


# 1.171 16-Jul-2003 itojun

stop installing install libtelnet. build under lib/libtelnet and reference
it from usr.bin/telnet and libexec/telnetd.
(reason for separate build: compiler flags)


# 1.170 27-Jun-2003 drochner

For consistency, use "-R" instead of "-Wl,-rpath" to pass
a runtime search path to the linker.


# 1.169 13-Jun-2003 itojun

define LIBEVENT


# 1.168 11-Jun-2003 msaitoh

catch signal 1,2,3,13 and 15 to clean /tmp/_dependXXX


# 1.167 31-May-2003 thorpej

If EXTERNAL_TOOLCHAIN is defined, allow the compiler to define the
location of crt{begin,end}{,S}.o and libgcc.a. Encapsulate all of
this logic into the new bsd.gcc.mk, and use it in bsd.prog.mk and
bsd.lib.mk.


# 1.166 18-May-2003 lukem

make this a no-op if HOSTPROG is defined


# 1.165 30-Mar-2003 thorpej

If MACHINE_ARCH is powerpc and we HAVE_GCC3, add crtsaveres.o to the
endfile spec.


# 1.164 22-Feb-2003 uwe

Typo in comment.


# 1.163 24-Jan-2003 thorpej

Add LIBPTHREAD, LIBPTHREAD_DB, and LIBRT.


Revision tags: fvdl_fs64_base
# 1.162 22-Nov-2002 thorpej

Split crtbegin/crtend into crti/crtbegin/crtend/crtn. NetBSD-specific
things like the .note.netbsd.ident section are provided by crti/crtn.
crti/crtn also provide the _init() and _fini() routines.

crtbegin/crtend now only provide support for ctors/dtors. This paves
the way to using the "crtstuff" provided with GCC (when we upgrade to
GCC 3.3), which provides, among other things, much better C++/Java
exception handling.


# 1.161 12-Nov-2002 itohy

MKDYNAMICROOT for a.out


# 1.160 22-Oct-2002 perry

Pass 1 of SYSPKG changes to automatically add tags=pkgname_pkg to METALOG.
Not quite ready for prime time yet.


# 1.159 27-Sep-2002 thorpej

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.


# 1.158 26-Sep-2002 itojun

MDC2 is a patented algorithm; don't ship it in default libcrypto.
MKCRYPTO_MDC2 will build a separate library, libcrypto_mdc2.


# 1.157 08-Sep-2002 thorpej

Build a .gdbinit in the objdir when building a program. The .gdbinit
file sets the shared library prefix to ${DESTDIR}, and adds "sources"
directives for each file listed in the GDBINIT Makefile variable.


# 1.156 09-Aug-2002 thorpej

Add LIBPMC.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.155 27-Mar-2002 eeh

branches: 1.155.2;
Use the medium low model for sparc64 programs that don't 2GB of data segment.


# 1.154 11-Feb-2002 mycroft

Don't use .PHONY for targets that are actually installed. Instead use force
dependencies. (Among other things, `make -t install' does something vaguely
sensible now.)


# 1.153 07-Feb-2002 pk

Mark installed system libraries as .MADE only if we're actually establishing
their default variable values here.


# 1.152 04-Feb-2002 christos

s/.NOSUFF/.MADE/


# 1.151 03-Feb-2002 christos

Apply a .NOSUFF: directive to targets we don't want to have processed by
the suffix rules engine.


# 1.150 02-Feb-2002 veego

Ups, it is LIBUSBHID and not LIBUSBHIB.


# 1.149 02-Feb-2002 veego

Change LIBUSB to LIBUSBHIB, reflecting the library name change.


# 1.148 29-Jan-2002 enami

Mark the targets clean{extra,objs} as PHONY.


# 1.147 04-Jan-2002 thorpej

For PROG_CXX DESTDIR builds, pull in -lstdc++ and -lm regardless
of GCC version.


# 1.146 01-Jan-2002 thorpej

Per a suggestion from matthew green, PROG_CXX takes the place of
PROG for C++ programs.


# 1.145 01-Jan-2002 thorpej

* If PROG_CXX is set by the program's Makefile, use ${CXX} to link
the program rather than ${CC}.
* If HAVE_GCC3 is defined, pull in "-lstdc++ -lm" as additional C++
support libraries for DESTDIR builds.


# 1.144 28-Dec-2001 lukem

* 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


# 1.143 28-Nov-2001 tv

If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.


# 1.142 19-Nov-2001 thorpej

Use a little transitional hack to determine if we use -isystem
or -idirafter. Use the former only of USE_NEW_TOOLCHAIN, since
-isystem causes the old toolchain to bomb out when building
libstdc++.


# 1.141 14-Nov-2001 tv

C/..$/.c/ -> C/\..$/.c/


# 1.140 14-Nov-2001 tv

Move the DESTDIR-based nostdinc logic to bsd.lib.mk and bsd.prog.mk where
it belongs (with the native target compile rules).


# 1.139 02-Nov-2001 tv

Use INSTALL_FILE/INSTALL_DIR as appropriate.


# 1.138 02-Nov-2001 tv

Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.


# 1.137 19-Oct-2001 tv

Add .NOPATH for all files generated from .l or .y files in SRCS. Fixes PRs
bin/14187 and lib/14239.

Also simplify the handling of these transforms to .c and .h files a bit by
leveraging make's builtin macro operators.


# 1.136 25-Sep-2001 tv

Set .NOPATH on program to build to make sure it goes in .OBJDIR.
Problem noted by <seebs@plethora.net>.


# 1.135 24-Sep-2001 lukem

fix previous (hi thor!) - $OBJS and $CLEANFILES might be empty, and
rm needs some files to delete...


# 1.134 24-Sep-2001 tls

Split "cleanprog" target apart: now you can zap only object files or
CLEANFILES (needed to fix crunchgen lossage).


# 1.133 13-Sep-2001 thorpej

Add LIBPCI.


# 1.132 14-Aug-2001 tv

Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").


# 1.131 01-Jun-2001 tv

Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).


# 1.130 08-May-2001 sommerfeld

Suppress duplicate entries in ALLFILES, FILES, INCS, DEPINCS, INFOFILES,
NLSALL, CATPAGES, MANPAGES, HTMLPAGES, and SCRIPTS.


# 1.129 19-Feb-2001 jmc

Wrap target() checks around afterdepend rule as some Makefiles override this


# 1.128 26-Jan-2001 itojun

fix typo in LIBSSL decl. it made programs with DPADD+=${LIBSSL} to build
every time we type "make". From: bernd


# 1.127 14-Jan-2001 christos

use the new .if commands(<target>) directive so that we don't have to
change Makefiles.


# 1.126 14-Jan-2001 christos

fix thinko: test for the existance of the target before we define it...


# 1.125 14-Jan-2001 christos

Alter previous redefined target protection. If the ${PROG} target is defined,
add the dependencies as usual, but don't add the commands. This avoids
having to change all the Makefiles that redefine the PROG target.


# 1.124 14-Jan-2001 christos

allow programs to override the program target.


# 1.123 08-Jan-2001 mrg

add missing $LIBCRYPTO_RC5 and $LIBCRYPTO_IDEA


# 1.122 08-Jan-2001 mrg

add missing $LIBSSL


# 1.121 04-Jan-2001 garbled

Add LIBCDK and LIBFORM definitions


# 1.120 31-Oct-2000 itojun

add ${LIBINTL} for use with DPADD.


# 1.119 07-Oct-2000 deberg

fix typos, PR 11159


# 1.118 25-Jun-2000 erh

For the case when DESTDIR is set: move the -L${DESTDIR}/usr/lib after ${LDADD} so any -L directories set in LDADD are searched first to avoid possibly linking against old versions of libraries.


Revision tags: netbsd-1-5-base
# 1.117 19-Jun-2000 thorpej

branches: 1.117.2;
Sync up the LIB* list.


# 1.116 10-Jun-2000 mycroft

Use ${.ALLSRC:T} when doing the generated variable name lookups, so that it
DTRT for generated files in and obj directory (or accessed via .PATH).


# 1.115 06-Jun-2000 mycroft

Abuse .USE some more.


# 1.114 06-Jun-2000 mycroft

Minor rearrangement.


# 1.113 06-Jun-2000 mycroft

Use ODE make(1) features to eliminate extra variables and move several things
outside of .for loops. (Needs more work to completely eliminate .for.)

XXX Don't look at this stuff. It will make your head hurt.


Revision tags: minoura-xpg4dl-base
# 1.112 14-Apr-2000 mrg

branches: 1.112.2;
use -rpath-link rather than -R when linking objects using a DESTDIR.
this replaces the previous change as that ended up adding
$DESTDIR/usr/lib to the runtime path of every binary created, which
is bogus and dangerous.


# 1.111 25-Mar-2000 mycroft

When linking with $DESTDIR, use an explicit -R to get library dependencies
correct.


# 1.110 07-Mar-2000 veego

Remove unused libahdi.
It will be replaced in the future with a more generic libdisklabel.


# 1.109 05-Feb-2000 jdc

Add libahdi entries.


# 1.108 23-Jan-2000 eeh

Add some support for FCode binaries.


# 1.107 22-Jan-2000 mycroft

Make `dependall' play nicely with SUBDIR, using a hack similar to `realinstall'
for both `depend' and `all'.
Also, remove the old hack that invokes an extra shell for .depend, now that
make(1) has been fixed.


# 1.106 16-Jan-2000 assar

all: depend on ${SCRIPTS} so that they get generated if they need to


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.105 23-Nov-1999 blymn

Added libmenu library.


Revision tags: comdex-fall-1999-base
# 1.104 14-Sep-1999 perry

branches: 1.104.4;
Add a "dependall" target, which does a "make depend" and then "make all"
in a single directory. This is useful in "make build" because by doing
the build immediately after the depend, all sources will typically
still be in the buffer cache, thus saving significant time over doing
a "make depend" on all the directories and then a "make all".


# 1.103 04-Sep-1999 fredb

Permit "make all install", as well as "make foo install" (where foo would be
installed by "make install") without setting of BUILD. All cases where BUILD
is already set are unchanged from the old behavior.

"make all install" is now practically equivalent to "make BUILD= all install",
but without actually setting build.

Fixes pr's 8313, 3894.


# 1.102 21-Aug-1999 simonb

Add ${INSTPRIV} to ${INSTALL} commands.


# 1.101 01-Jul-1999 itojun

branches: 1.101.2;
add LIBIPSEC for use from DPADD.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.100 12-Feb-1999 lukem

branches: 1.100.2;
* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.99 10-Feb-1999 tv

libbfd_pic.a is no longer installed; remove ${LIBBFD} define.


# 1.98 04-Feb-1999 christos

PR/2936: Brian C. Grayson: Avoid truncating precious files when installing
and the filesystem is full. Added ${RENAME} flag to install, which when set
to -r installs on a temporary file and then renames to the final destination.
${RENAME} is currently set to nothing in bsd.own.mk, but one can turn it
on in /etc/mk.conf.


# 1.97 07-Nov-1998 jonathan

Do DESTDIR support for crtbegin/crtend on all ELF ports (adds mips).


# 1.96 28-Sep-1998 christos

Use preserve flag in install.


# 1.95 10-Sep-1998 ross

Define a LIBBZ2?=... for use in DPADD=... lines.


# 1.94 09-Aug-1998 lukem

add distclean as a synonym for cleandir


# 1.93 09-Apr-1998 tv

.y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.


# 1.92 01-Apr-1998 tv

Revert. This broke too much in the build tree, and a better solution
needs to be created. (The existing situation breaks a lot too.)


# 1.91 01-Apr-1998 tv

Fix .y rules to DTRT with possibly generated .h files. See mail on
tech-toolchain for a very detailed explanation of this. In short, add
a .y.h rule identical to the .y.c rule and make the .y.c rule rename
the .h file; also, clean the .h file in CLEANFILES.


# 1.90 03-Nov-1997 cgd

echo the lint command line when making 'lint'.


# 1.89 28-Oct-1997 lukem

add ${LIBOBJC}


Revision tags: netbsd-1-3-base
# 1.88 11-Oct-1997 mycroft

branches: 1.88.2;
Several changes:
* Allow bsd.man.mk to be included separately.
* Always include bsd.own.mk and bsd.obj.mk.
* Include bsd.man.mk and bsd.nls.mk even if NOMAN or NONLS; just turn off
building of the affected files instead.
* Require bsd.subdir.mk to be included explicitly.
(Will make appropriate changes to Makefiles shortly.)


# 1.87 29-Sep-1997 gwr

Add $LIBBFD


# 1.86 31-May-1997 cjs

Back out BUILDDIR and NOINSTALL changes.


# 1.85 26-May-1997 cjs

branches: 1.85.2;
These updates to the build allow building against include files
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.


# 1.84 18-May-1997 kleink

Add libposix.


# 1.83 17-May-1997 mycroft

Do LINKS and SYMLINKS after FILES and INCS.


# 1.82 17-May-1997 mycroft

Remove unneeded .SUFFIXES lines, and move .s and .S closer to .o to give the
right preferences.


# 1.81 09-May-1997 mycroft

Fix typo in previous.


# 1.80 09-May-1997 mycroft

Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.79 09-May-1997 mycroft

Remove cruft.


# 1.78 09-May-1997 mycroft

Oops; rearrange dependencies to get things built early enough.


# 1.77 09-May-1997 mycroft

Make sure INCS and SRCS are built if necessary.


# 1.76 08-May-1997 gwr

Set the .NOPATH flag for ${OBJS} (from Christos).


# 1.75 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.74 07-May-1997 mycroft

Various simplifications.


# 1.73 07-May-1997 mycroft

Shuffle some .PHONYs around, to work better with `-t'.


# 1.72 06-May-1997 mycroft

Make most of the install targets .PRECIOUS.


# 1.71 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.70 18-Apr-1997 christos

Add ${LIBNTP}


# 1.69 17-Apr-1997 thorpej

- Properly depend on crtbegin.o and crtend.o for platforms that use
them (currently Alpha and PowerPC)
- STRIP -> STRIPFLAG


# 1.68 03-Apr-1997 mikel

don't allow override of all: target


# 1.67 29-Mar-1997 mikel

merge lite-2 changes (mostly SCCSids)


# 1.66 27-Mar-1997 christos

Put the FILES generated rules in a separate .mk file since both bsd.prog.mk
and bsd.lib.mk use them.


# 1.65 27-Mar-1997 mycroft

Make the SCRIPTS case mimic the FILES case more closely, so we can override
the destination direectory, etc.


# 1.64 27-Mar-1997 mycroft

Remove knowledge of HIDEGAME from here.


# 1.63 24-Mar-1997 christos

make rules update:
- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation


# 1.62 22-Mar-1997 perry

Fix SYMLINKS not to include DESTDIR in the link itself


# 1.61 13-Mar-1997 perry

add SYMLINKS, by analogy to LINKS. Vetted by Christos.


# 1.60 22-Jan-1997 cgd

if 'clean' is not already defined, rather than simply defining it with
a bunch of rules, define a clean{kmod,lib,prog} target with the rules,
and have both clean and cleandir depend on that. That eliminates a bug
where 'cleandir' in a directory which included e.g. bsd.prog.mk but which
also had subdirs would 'make clean' all the subdirs and then 'make cleandir'
all ofthe subdirs. It also allows Makefiles to add more dependencies
to 'clean' after inclusion of the make template.

If 'clean' is already defined, the behaviour is the same as it used to be.


# 1.59 20-Dec-1996 cgd

add an afterdepend target (a la the one in bsd.lib.mk) that processes
the .depend file to add <filename>.ln for each <filename>.o as an
object file which has the given dependencies (in addition to
<filename>.po and <filename>.so, which were already there).


# 1.58 13-Dec-1996 mikel

add missing LIBPCAP definition.


# 1.57 26-Nov-1996 mrg

add libz and libwrap


# 1.56 18-Oct-1996 thorpej

Use ${INSTALL} rather than "install".
From Simon J. Gerraty <sjg@zen.void.oz.au>, PR #1458.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.55 08-Apr-1996 jtc

Sort LIBFOO definitions and add LIBY; Reported by Mike Long <mike.long@analog.com> in PR #2301.


# 1.54 22-Oct-1995 christos

Added include file <bsd.sys.mk> that contains lex and yacc "parallel aware"
rules. These rules are not turned on by default; they are enabled by setting
the PARALLEL variable.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.53 25-Jun-1995 cgd

oops; fix an rm that might be empty


# 1.52 24-Jun-1995 cgd

update lint rules, but keep linting disabled


# 1.51 10-Jun-1995 mycroft

Define LIBEDIT.


# 1.50 21-Apr-1995 jtc

.include <bsd.nls.mk> unless NONLS is defined.


# 1.49 22-Dec-1994 cgd

specify man pages differently, and document how.


# 1.48 24-Aug-1994 mycroft

Include bsd.own.mk earlier.


# 1.47 20-Jul-1994 cgd

fix from christos, for progs w/o objects


Revision tags: netbsd-1-0-base
# 1.46 06-Jul-1994 mycroft

branches: 1.46.2;
Pull libraries from ${DESTDIR} if set. Kill LDONLY, which is unused and
probably not useful anyway.


# 1.45 30-Jun-1994 cgd

fix modify-info-nothingness-then-substitute probelm that broke genclass build


# 1.44 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.43 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.42 28-Jun-1994 jtc

Strip *.sh when constructing OBJS from SRCS.
This will allow us to clean up makefiles that build a script by munging
a template (uusched, genclass, neqn, etc.).


# 1.41 18-Jun-1994 cgd

don't chown the symlink, when HIDEGAME causes a symlink to be made to dm.
4.4-based FS code _follows_ the symlinks on a chown(2) call.


# 1.40 24-May-1994 cgd

fix the last to do the right thing for dependencies


# 1.39 24-May-1994 deraadt

LIBSKEY


# 1.38 22-May-1994 jtc

Single source file programs are now compiled into object files before they
are linked. This change halves the time it takes to rebuild all of the
NetBSD sources when only the C library is "touched"; but only takes about
one percent more disk space.


# 1.37 06-Apr-1994 chopps

relink (recompile) single source programs when crt0.o is updated.


# 1.36 24-Mar-1994 mycroft

Remove *.core on clean.


# 1.35 09-Feb-1994 cgd

kill install -d's.


# 1.34 28-Jan-1994 cgd

add LIBKVM


# 1.33 10-Nov-1993 cgd

librpc doesn't exist anymore


# 1.32 08-Nov-1993 cgd

ad LDSTATIC flag, so static linking can be made one-stop shopping.
use "setenv LDSTATIC" to make *everything* dynamically linked,
setenv LDSTATIC -static for everything statically linked, or unset
it for default behavior.


# 1.31 07-Oct-1993 cgd

LIBTERM pointed at nothing, but was meant to point to libtermcap.a...


# 1.30 07-Oct-1993 cgd

always define LIBCRYPT


# 1.29 17-Aug-1993 mycroft

Make sure we don't recurse into subdirectories if Makefile specified `install'
target. (It's usually blank and is specifically to avoid doing this...)


# 1.28 15-Aug-1993 mycroft

Automatically include bsd.subdir.mk for backward compatibility.


# 1.27 15-Aug-1993 mycroft

Don't automatically include bsd.subdir.mk in bsd.prog.mk and bsd.lib.mk.
Put back .MAIN in bsd.man.mk, and be careful not to include ../Makefile.inc
a second time.


# 1.26 15-Aug-1993 mycroft

Move man rules to sys.mk.
Use bsd.subdir.mk for building subdirectories.
Don't forget to remove x.cc and x.C when using SHAREDSTRINGS.
Make ${PROG} always depend on ${LIBCRT0}.
Don't duplicate code between cleandir and clean.
Move tags target to bsd.dep.mk.
Move STRIP to bsd.own.mk.
Remove redundant definitions of {BIN,MAN}{DIR,GRP,OWN,MODE}.
Move {LIB,DOC}{DIR,GRP,OWN,MODE} defaults to bsd.own.mk.


# 1.25 15-Aug-1993 mycroft

Abstract out dependency stuff, and add RCS identifiers.


# 1.24 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


# 1.23 10-Aug-1993 mycroft

Put LINKS handling in `install' target, so it's the last thing executed, and
happens even if `realinstall' is user-defined.


# 1.22 30-Jul-1993 mycroft

When generating a default OBJS, ignore .h files.


# 1.21 29-Jul-1993 mycroft

Don't print the `making ...' message if an obj dir already exists.
Also, a minor cleanup.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.20 17-Jul-1993 mycroft

Fix C++ dependencies for good. `make depend' is now done in two passes--one
of C files and one for C++ files. No need to specify `-+' in your Makefile,
as it is now done automatically.


# 1.19 17-Jul-1993 cgd

do c++ dependencies the right way...


# 1.18 17-Jul-1993 mycroft

Add suffix rules for C++ files.


# 1.17 04-Jun-1993 brezak

Add LIBRPCSVC variable.


# 1.16 02-Jun-1993 cgd

add ability to specify c++ dependencies, by setting CFLAGS+=-+ for
the dependency make.


# 1.15 26-Apr-1993 cgd

added definition for DPADD library variable LIBCRYPT.


# 1.14 26-Apr-1993 mycroft

Don't redefine `realinstall' target if already defined.


# 1.13 25-Apr-1993 mycroft

Link with LDFLAGS even if one source module.


# 1.12 25-Apr-1993 mycroft

Don't lose if we include bsd.prog.mk only to build man pages.


# 1.11 25-Apr-1993 mycroft

Fix error in last change. (Oops.)


# 1.10 25-Apr-1993 mycroft

Don't build man pages if NOMAN set.


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.9 09-Apr-1993 cgd

various changes to default make rules. from patch 101.
note that only the "sensible" changes in patch 101 are implemented.


# 1.8 08-Apr-1993 cgd

try to do the right thing, in terms making directories before we
install into them, and get the manpage cleans _OUT_ of "clean".
they don't belong there, only in cleandir, WFJ be damned.


# 1.7 08-Apr-1993 cgd

fixed typos...


# 1.6 08-Apr-1993 cgd

(silently) make sure we have directories before installing


# 1.5 04-Apr-1993 cgd

make LIBRPC point to the right place


# 1.4 27-Mar-1993 nate

Fixed the doc macros to call troff, eqn,and tbl instead of ditroff,
deqn, and dtbl.
Fixed make clean to remove the man pages (Bill fixed this in the distribution,
but not in the original source)
Changed install to leave the original file around, by using 'cp' instead of
'mv'. "install -c ..."


# 1.3 23-Mar-1993 cgd

made .CURDIR be absolute, not relative, thereby eliminating
the need for some of the makefile trickery when making objects,
and fixing a few .PATH bugs


# 1.2 22-Mar-1993 cgd

fixed "make obj" for cases when sources not in /usr/src/...
if sources not there, it now mkdirs obj, but some trickery
is necessary, to avoid deleting cwd.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.322 17-Aug-2019 kamil

Add PAXCTL_FLAG rules for MKSANITIZER

Add per-program rules to disable ASLR for ASan, TSan and MSan in all
sanitized programs. This flag is not needed for other supported sanitizers.

Without this change, sanitized init(8) dies early on startup.

Approach originally suggested by <joerg>


# 1.321 15-Aug-2019 kamil

Add SANITIZER_RENAME_CLASSES in bsd.prog.mk

This adds a more flexible version of SANITIZER_RENAME_SYMBOL.

New symbol allows to specify MKSANITIZER specific renames on per-file and
per-symbol basis.


# 1.320 10-Aug-2019 christos

Make the X11 library lists consistent again.


Revision tags: netbsd-9-base phil-wifi-20190609 pgoyette-compat-20190127
# 1.319 21-Jan-2019 christos

branches: 1.319.2;
Most of the mv operations are to move temporary files to their final place.
Some use -f, others don't. This can lead to spurious build failures when
the user performing the build changes. Centralize, and always use -f.


Revision tags: pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.318 12-Aug-2018 christos

fix broken library variable definitions (inconsistencies between
bsd.README and bsd.prog.mk)


Revision tags: pgoyette-compat-0728
# 1.317 25-Jul-2018 kamil

Introduce MKLIBCSANITIZER in the share/mk rules

Add flags that are required to build a program and a dynamically loaded
library.

Propagade LIBCSANITIZERFLAGS to CFLAGS and CXXFLAGS.

LDFLAGS is not changed on purpose, as a libcsanitizer is inside libc
and no external dependencies are needed.

Register NOLIBCSANITIZER, as certain distribution parts will need to be
skipped.


# 1.316 12-Jul-2018 maxv

Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.


Revision tags: phil-wifi-base
# 1.315 25-Jun-2018 kamil

branches: 1.315.2;
Add a framework for renaming symbols in libc&co for MKSANITIZER

A new keyword SANITIZER_RENAME_SYMBOL. It's a variable that has specified
a list of symbols to be renamed in a processor in order to remove naming
conflicts with public symbols in libc/m/pthread/rt.

This renaming will occur for libraries and programs.
A symbol with a conflicting 'name', will be renamed to '__mksanitizer_name'.

Based on an idea by <christos>


Revision tags: pgoyette-compat-0625
# 1.314 21-Jun-2018 kamil

Refactor MKSANITIZER flags in mk rules

Introduce a new variable SANITIZERFLAGS that contains all the sanitizer
specific flags. These flags are designed to be passed to CFLAGS, CXXFLAGS
and LDFLAGS.

Pass SANITIZERFLAGS in bsd.prog.mk rules to CFLAGS, CXXFLAGS and LDFLAGS.

Pass SANITIZERFLAGS in bsd.lib.mk rules to *_pic.a build flags. The *_pic.a
libraries are designed to construct .so libraries. All .so libraries with
few exceptions are expected to be prebuilt with a sanitizer. Another
purpuse of *_pic.a files can be constructing static PIE programs, however
they are not supported as of now and there is no sanitization of static
programs either.

Once MKSTATICPIE will be supported, it will be initially incompatible with
MKSANITIZER.

This change also makes it easier to build other targets like kernel and
kernel modules without userland sanitizers.

No functional change intended for MKSANITIZER=no users.


# 1.313 02-Jun-2018 christos

Sanitizers don't support static linking.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315
# 1.312 11-Mar-2018 mrg

define LIBXFONT2.


Revision tags: pgoyette-compat-base
# 1.311 25-Feb-2018 mrg

branches: 1.311.2;
add LIBKRB5_LDADD/LIBKRB5_DPADD and their static counterparts
to bsd.prog.mk. use them instead of hard coding various lists
of libraries for krb5.

this fixes static builds.


# 1.310 11-Dec-2017 christos

Instead of checking for obj existance which can be empty for shuttle-rule
programs, check for .sh sources.


# 1.309 10-Dec-2017 christos

don't try to build .debug files for shell scripts.


# 1.308 10-Oct-2017 christos

Add general {DP,LD}ADD.rump variables


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base
# 1.307 21-May-2017 riastradh

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.


# 1.306 21-May-2017 riastradh

Remove some vestiges of MKCRYPTO_IDEA/MKCRYPTO_MDC2.


# 1.305 21-May-2017 riastradh

Remove MKCRYPTO_RC5. Unconditionally include RC5 in libcrypto.so.

This option existed only because RC5 is covered by patents that, twenty
years ago, we had reason to suspect the patent holder, RSA, Inc., might
litigate. The two US patents in question are 5,724,428 and 5,835,600.

According to the USPTO Patent Term Calculator web site at
<https://www.uspto.gov/patent/laws-and-regulations/patent-term-calculator#heading-5>
(retrieved 2017-05-21), patents filed after 1995-06-07 expire twenty
years after the filing date.

number filing date
5,724,428 1995-11-01
5,835,600 1997-04-21

Thus, these patents appear to be expired.

As proposed on tech-crypto and tech-security:

https://mail-index.netbsd.org/tech-crypto/2017/05/05/msg000718.html
https://mail-index.netbsd.org/tech-security/2017/05/05/msg000927.html


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.304 19-Apr-2017 joerg

Add netpgpverify to the library list.


Revision tags: pgoyette-localcount-20170320
# 1.303 20-Feb-2017 rin

add missing LIBCXX


# 1.302 08-Feb-2017 kamil

libpthread_dbg(3) deletion from the base distribution

libpthread_dbg(3) is a remnant library from the M:N thread model
(pre-NetBSD-5.0) API to introspect threads within a process and for use
of debuggers.

Currently in the 1:1 model it's not used in GDB neither in LLDB and it's
not either planned to be used. It's current function to read pthread_t
structures is realizable within a regular debugger capable to
instrospect objects within a tracee (GDB, LLDB...).

Remaining users of this API can still use this library from
pkgsrc/devel/libpthread_dbg.

Sponsored by <The NetBSD Foundation>


# 1.301 29-Jan-2017 christos

add sqlite3 to statically linked libraries for pam.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914
# 1.300 20-Aug-2016 christos

branches: 1.300.2;
unbound additions


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.299 04-Apr-2016 joerg

branches: 1.299.2;
If the per-target LDSTATIC flag is set, don't include the PIE linker
flags as we currently don't support static PIE.


# 1.298 30-Mar-2016 martin

Pass -pie to cc, not -Wl,-pie. This way we have a chance to fix specs
for obscure corner cases like -pie -fPIE -static (used for
/usr/tests/lib/csu/h_initfini2 if building with MKPIE=yes).
While there also replace -fPIC with -fPIE for the PIE case, even if
it should be mostly equivalent.


# 1.297 12-Mar-2016 mrg

remove conditionals that are always true with GCC >= 4.8.


# 1.296 21-Feb-2016 christos

Add NODEBUG


# 1.295 31-Jan-2016 christos

Introduce NOPIE and NOCTF so that standalone programs build properly.


# 1.294 23-Jan-2016 christos

Define _KERNTYPES for things that need it.


# 1.293 07-Nov-2015 joerg

LIBEXECINFO


# 1.292 07-Jun-2015 matt

Make LIBCRT* depend on the right files if MLIBDIR from MKCOMPAT is defined.


# 1.291 01-Dec-2014 erh

PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilt
if any of their dependencies (i.e. the files they refer to) are changed.
This allows changes to transitive included headers to be handled properly.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.290 25-Mar-2014 ozaki-r

branches: 1.290.4;
Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.


Revision tags: riastradh-drm2-base3
# 1.289 09-Mar-2014 christos

let's see if the new dwarf library can handle dwarf 4


# 1.288 02-Mar-2014 christos

If we are compiling with -g and using gcc4.8 and dtrace downgrade
dwarf generation to version 2 for now.


# 1.287 15-Jan-2014 joerg

-Wl,-pie and -r don't agree with each other, so filter the former out.


# 1.286 11-Nov-2013 joerg

Relink binaries if crti.o changes.


# 1.285 29-Sep-2013 christos

Add libxcb


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.284 31-May-2013 mrg

add LIBX11_XCB; unfortunately since the library is named with a -
in it, we have to use an ugly hard coded assignment for now.
(could be cleaned up with more make variable magic i'm sure.)


# 1.283 04-Apr-2013 christos

ldopts should be before ldadd like everywhere else.


Revision tags: agc-symver-base
# 1.282 14-Feb-2013 christos

Since the libraries are produced with different MK flags than the programs,
we check for existance of the files instead of the MK flags.


# 1.281 14-Feb-2013 christos

Add PROGDPLIBS


# 1.280 26-Jan-2013 christos

CTFCONVERT me harder.


Revision tags: yamt-pagecache-base8
# 1.279 17-Jan-2013 christos

Now that we have separate debug sets, add -g if ${MKDEBUG} is set for
program builds since we don't need to install that symbol files.


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.278 24-Aug-2012 jmmv

branches: 1.278.2;
Allow DPADD to be specified on a per-program basis.


# 1.277 23-Aug-2012 joerg

Revert last, it breaks the tricks xsrc uses.


# 1.276 23-Aug-2012 joerg

Remove SHLIBINSTALLDIR and SHLINKINSTALLLIBDIR. Add rpath entries, if
SHLIBDIR differs from /usr/lib.


# 1.275 08-Aug-2012 christos

add MKRUMP by popular demand.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.274 29-Feb-2012 tron

Move "libexpat" from X11 into base which fixes PR lib/40346.
This change was approved by the Core Group.


# 1.273 21-Feb-2012 matt

Remove another ${SIZE}


# 1.272 20-Feb-2012 matt

Remove ${SIZE}


# 1.271 19-Feb-2012 matt

Add support for --combine with gcc.


Revision tags: netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2
# 1.270 05-Nov-2011 christos

branches: 1.270.2;
Add libtre


Revision tags: yamt-pagecache-base
# 1.269 16-Oct-2011 christos

branches: 1.269.2;
- no need to special-case libraries with weird characters.
- add a note about adding new libraries.


# 1.268 16-Oct-2011 christos

fix list of libraries to reflect reality.


# 1.267 10-Sep-2011 apb

Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.


# 1.266 27-Aug-2011 joerg

Add new "analyze" command to run clang's static analyzer in a directory
on all C/C++ files.


Revision tags: cherry-xenmp-base
# 1.265 26-Apr-2011 he

The new Heimdal adds -lwind and -lheimbase to the set of libraries,
so define the corresponding LIB* variables.
These are also needed in the PAM_STATIC_* variables, so add them there too.


# 1.264 11-Apr-2011 joerg

Adjust --sysroot related usage:
-Wl,-rpath does not expand =, so just drop it.

Drop -Wl,-rpath-link entries that duplicate the -Wl,-rpath entries, this
is done implicitly now that ld is built with sysroot support.

Use ${DESTDIR} explicitly for the remaining -Wl,-rpath-link entries.


# 1.263 10-Apr-2011 joerg

For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.


# 1.262 08-Mar-2011 jmmv

Revert previous (revision 1.261): it broke the build because PROG_CXX is
defined in terms of PROG, so later on we would end up with target duplicates
because both PROG_CXX and PROG were being converted to PROGS_CXX and PROGS.

Did not catch this earlier because the test build I did was not clean and
thus the duplicate targets did not have nasty effects.


# 1.261 07-Mar-2011 jmmv

Always convert PROG to its plural form independently of whether PROG_CXX
is defined or not. From Garrett Cooper in private mail.


Revision tags: bouyer-quota2-nbase
# 1.260 20-Feb-2011 jmmv

Define LIBATF_C and LIBATF_CXX to point to their corresponding .a files and
use these to properly set DPADD for test programs.


Revision tags: bouyer-quota2-base
# 1.259 13-Feb-2011 christos

add saslc


# 1.258 06-Feb-2011 joerg

Don't use -nostdinc or -nostdinc++ if this is included in a HOSTLIB.


# 1.257 17-Jan-2011 pooka

branches: 1.257.2;
Add rump bits to DPSRCS so that update builds work correctly.


Revision tags: matt-mips64-premerge-20101231
# 1.256 13-Dec-2010 pooka

befriend RUMPPRG with CRUNCHEDPRG


# 1.255 13-Dec-2010 pooka

Define RUMPPRG, which is just like PROG, except it additionally
builds a rump client with the name rump.${PROG}. The rump client
is not installed suid/sgid by default even if BINMODE is defined.


# 1.254 10-Dec-2010 joerg

Revert last, gcc(1) checks explicitly for -r on some platforms to disable
passing down --relax as well.


# 1.253 08-Dec-2010 joerg

gcc passes down -r directly to ld, so make it explicitly a linker option.


# 1.252 08-Dec-2010 joerg

Don't depend on ${CC} passing down -R to ld, use -Wl,-rpath explicitly.


# 1.251 08-Nov-2010 lukem

Preserve date on original shared library or program when stripping
the debug symbols and adding the debug-link to .debug.
Use '(rm -f file; false)' in the failure path to force failure.
Based on solution proposed by Nicolas Joly on tech-toolchain in July 2010.
Should fix PR toolchain/44046 from Andreas Gustafsson.


# 1.250 31-Oct-2010 mbalmer

Link Lua to the build and add the resulting files to the distribution sets.
Document the addition of Lua and the change we made to the default settings.


# 1.249 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.248 24-Apr-2010 lukem

When extracting separate debug symbols with MKDEBUG, there's no need
to leave the original file unstripped...


# 1.247 02-Mar-2010 darran

DTrace: Add CTF generation to the make framework. Only enabled when
MKDTRACE=yes.


# 1.246 14-Dec-2009 mrg

use "${CC} -r" not "${CC} -Wl,-r" as the latter fools GCC on some targets
and it ends up passing "-r -relax" to ld, which causes ld to barf.


# 1.245 14-Dec-2009 matt

Merge from matt-nb5-mips64


Revision tags: matt-premerge-20091211
# 1.244 08-Dec-2009 uebayasi

When PROGS / LIBS are used, you can pass each PROG / LIB specific parameters
to ${LD} via:

${LDADD.${PROG}}
${LDFLAGS.${PROG}}
${LDSTATIC.${PROG}}
${LDADD.${LIB}}
${LDFLAGS.${LIB}}

OTOH you can't pass parameters to ${CC}, because in suffix rules make(1) only
knows the name of ${.IMPSRC} and ${.TARGET}; it's users' responsivility to
define ${CC} parameters to all the sources of a given ${PROG} / ${LIB}.

Should address bin/42381.

(Bug in this commit log was pointed out by mrg@.)


# 1.243 27-Nov-2009 tsutsui

If CPPFLAGS or CXXFLAGS already contains -nostdinc or -nostdinc++,
don't add ${CPPFLAGS_ISYSTEM} or ${CPPFLAGS_ISYSTEMXX} to refer
${DESTDIR}/usr/include or ${DESTDIR}/usr/include/g++.

This change might cause errors on some MD stand dir, but in that case
each Makefile should be fixed to search proper system include paths
by -Ipath option in own CPPFLAGS.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.242 12-May-2009 plunky

remove libsdp as improved functionality has been enabled in libbluetooth.


# 1.241 10-Apr-2009 apb

Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links. They have no effect except when using a
metalog, in which case the information is added to the metalog. In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg. This should fix PR 24457 and PR 41155.


# 1.240 24-Nov-2008 cube

branches: 1.240.2;
Move cleanextra to the very ends in case another included file wants to add
to it even if it was initially empty.


Revision tags: netbsd-5-base matt-mips64-base2
# 1.239 19-Oct-2008 christos

branches: 1.239.2;
handle assembly files for MKPIE


# 1.238 16-Oct-2008 christos

Provide a way for a program to override the PIE flags.


# 1.237 15-Oct-2008 christos

don't compile/link libraries with pie


Revision tags: mjf-devfs2-base
# 1.236 02-Oct-2008 joerg

Hook up libfetch and pkg_install update.


Revision tags: wrstuden-revivesa-base-3
# 1.235 09-Sep-2008 joerg

Add MKSTRIPIDENT to remove the RCS IDs from binary programs and shared
libraries for space-constraint systems. The description is based on the
feedback of hubertf@, the logic on input from lukem@

This obsoletes the removal of LIBC_SCCS and SYSLIBC_SCCS for libc builds.


Revision tags: wrstuden-revivesa-base-2
# 1.234 28-Aug-2008 mrg

update a comment example


# 1.233 27-Aug-2008 rtr

use ${X11USRLIBDIR} instead of hard-coded /usr/X11R6/lib when building
${LIB.foo} vars


# 1.232 27-Aug-2008 lukem

Fix problem I introduced in rev 1.231 on 2008/08/25 where ${_PROGLDOPTS}
and -L${_GCC_LIBGCCDIR} were appearing in the link line before ${LDADD},
so -L${DESTDIR}/lib and -L${DESTDIR}/usr/lib were being used before
local -L library paths.
Fixes ntpd/ntpdate failure noticed by Valeriy E. Ushakov <uwe@NetBSD.org>


# 1.231 25-Aug-2008 lukem

Always link with: -Wl,-rpath-link,${DESTDIR}/usr/lib -L${DESTDIR}/usr/lib
Fixes problem with MKDYNAMICROOT=no triggered by libraries that depend
on other libraries.
Related to PR 33503.

Clean up setting of _CCLINK to always add the appropriate -B options.

Simplify the link rule for a program.


# 1.230 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.229 28-May-2008 lukem

add LIBLDAR_R (for completeness)


# 1.228 22-May-2008 lukem

Add MKLDAP, USE_LDAP, LIBLBER, LIBLDAP


Revision tags: hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-pf42-base
# 1.227 10-Apr-2008 tsutsui

branches: 1.227.2; 1.227.4;
Add libhx509 to PAM_STATIC_LDADD which is required by libkrb5.


# 1.226 22-Mar-2008 mlelstv

branches: 1.226.2;
Import Heimdal-1.1


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase matt-armv6-base hpcarm-cleanup-base
# 1.225 26-Dec-2007 jmmv

Make the clean target work when OBJS is set but PROG is not, as happens
for example in gnu/lib/crtstuff4. Reported by drochner@.


Revision tags: cube-autoconf-base
# 1.224 13-Nov-2007 jmmv

Fix typo that prevented MKDEBUG builds to work. Found by drochner@.


# 1.223 12-Nov-2007 jmmv

Add the ability to build multiple programs from a single directory

This adds support for a new set of variables, PROGS and PROGS_CXX, that
allow the developer to build multiple different programs from a single
source directory.


# 1.222 04-Nov-2007 tls

Remove MKPRIVATELIB from BIND libraries; move library reachover
directories and Makefiles from src/usr.sbin/bind to src/lib; make
BIND libraries build shared. Saves about 1MB-1.5MB per installed
executable, about 5MB for a base+etc minimal installation of NetBSD.


Revision tags: matt-mips64-base
# 1.221 29-Jul-2007 joerg

branches: 1.221.4; 1.221.6;
Add build glue for libarchive and update the various sets.


# 1.220 25-Jan-2007 perry

Before I completely forget the issue, convert "PROG_PAX" to the
better-named "PAXCTL_FLAGS".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.219 11-Nov-2006 christos

don't run paxctl if other commands were specified for that target.


# 1.218 10-Nov-2006 christos

if ${PROG_PAX} is defined, run paxctl on the binary after linking with
the value of the variable. This way, if you set:

PROG_PAX=+M

in /etc/mk.conf, you get what you deserve.


# 1.217 22-Oct-2006 pooka

libpuffs


# 1.216 09-Oct-2006 mrg

- clean up some comments to reality.
- retire LIBDCK, LIBG2C and (long broken) USE_LIBSTDCXX
- in bsd.hostprog.mk's LIBSTDCPP -> LIBSTDCC
- add LIBSUPCXX
- don't default USE_LIBSTDCXX or USE_GCC4 since they are
not used in the tree any where
- same with USE_XF86_4; retire it
- remove _SUPCXX handling in bsd.prog.mk

inspired by PR#26714.


Revision tags: abandoned-netbsd-4-base
# 1.215 23-Jul-2006 lukem

Implement MKDEBUG:
If "no", don't build and install separate debugging symbols
into /usr/libdata/debug.
Default: no


# 1.214 19-Jun-2006 gdamore

Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.


# 1.213 09-Jun-2006 christos

PR/33681: Scott Ellis: Building 'bc' with SHAREDSTRINGS=yes fails
We need CPPFLAGS too now.


# 1.212 11-May-2006 mrg

add support for ${OBJCOPTS} and ${OBJCOPTS}.<lib|prog|fn>.


# 1.211 20-Mar-2006 christos

There is always one more KRB4 thing to remove. (from Jukka Salmi)


# 1.210 20-Mar-2006 christos

Remove krb4 variables and libraries (Jukka Salmi)


# 1.209 16-Mar-2006 jwise

Now that we have real build system support for syspkgs, remove someone's
half-implemented idea of building `syspkgs' (really a few giant blobs of the
same granularity of the old sets) using install(1).


# 1.208 20-Jan-2006 christos

Add the world of libraries to the static pam build. Now static pam binaries
work.


# 1.207 09-Apr-2005 dsl

Report when we link a program into xxx.ro (before being crunched)


Revision tags: netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.206 04-Mar-2005 he

branches: 1.206.2; 1.206.4;
Introduce PAM_STATIC_LDADD and PAM_STATIC_DPADD. When compiling
with MKPIC=no, possibly because the target does not support shared
libraries, these include libraries required to resolve all symbols
which end up referenced from PAM-using applications. The libraries
presently required are -lcrypt, -lrpcsvc and -lutil.

Add use of these variables which are currently set up to use PAM,
so that they compile when MKPIC=no.

Also, in the telnetd case, reorder the order of the libraries, so
that libtelnet.a comes before -ltermcap and -lutil, again to fix
link error when MKPIC=no.

Discussed with thorpej and christos.


# 1.205 20-Feb-2005 christos

Add libradius


# 1.204 12-Jan-2005 lukem

If RESCUEDIR is defined, automatically add that to CPPFLAGS


# 1.203 08-Jan-2005 lukem

Implement <bsd.prog.mk> vars:
LIBASN1 LIBBSDMALLOC LIBG2C LIBPAM LIBSSH


# 1.202 04-Aug-2004 lukem

Revert most of previous, and move the LIB<libname>?= assignments
back to bsd.prog.mk from bsd.own.mk.

pkgsrc uses <bsd.own.mk>, and setting LIB<libname> in it causes
problems with various package builds.
This should fix PR #26542 submitted by Jim Bernard.

(I'll be implementing the DPADD for shared libraries in a different
manner that generally won't depend upon ${LIB<libname>}.)


# 1.201 30-Jul-2004 lukem

Move the LIB<libname>?= assignments from bsd.prog.mk to bsd.own.mk so
that they may be used by non PROGs (e.g., LIBs).

Improve some comments.


# 1.200 10-Jun-2004 lukem

Be consistent in handling YHEADER, similar to Christos' fix in bsd.lib.mk 1.253


# 1.199 21-May-2004 ross

If you add a library, you need to define its DPADD symbol here.

Add LIBMAGIC.


Revision tags: netbsd-2-0-base
# 1.198 15-Feb-2004 skrll

branches: 1.198.2;
Be more gcc like in the way we deal with libgcc so that sh3/hppa millicode
and exception handling have a chance of working properly.

- creates libgcc, libgcc_eh and libgcc_s

- updates LIBGCC_SPEC to use them appropriately.

There's a hack in here at the moment with respect to libgcc_so in that it
is preferable to link against libgcc_so will only when -shared-libgcc is
specified (the c++ frontend does this automatically.) Configurations where
LINK_EH_SPEC is defined already do this. The gcc configuration for
NetBSD/alpha and another NetBSD platform (I forget which) actually define
LINK_EH_SPEC probably by accident rather than design.

- updates share/mk to use the compiler's knowledge of what needs linking into
libraries and executables. This removes an hppa hack.

- updates the sets for the newly created libgcc* files.

- support for linking against the _pg version of libgcc has been removed.


# 1.197 29-Jan-2004 lukem

Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.


# 1.196 27-Jan-2004 lukem

Replace
:M-[IDU]*
with
:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)


# 1.195 23-Jan-2004 simonb

crt0.o lives in /usr/lib even on a.out.


# 1.194 16-Nov-2003 lukem

simplify with _MKTARGET_LINK


# 1.193 11-Nov-2003 dsl

Set MKDEP_SUFFIXES to get additional targets in .depend instead of using
sed in .afterdepend. I don't think .afterdepend is used anywhere any more.


# 1.192 21-Oct-2003 lukem

Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.


# 1.191 19-Oct-2003 lukem

Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} " ... {$.TARGET}" and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO


# 1.190 18-Oct-2003 lukem

Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command ("verbose")
This is the default, and is equivalent to the previous behaviour.


# 1.189 29-Sep-2003 lukem

Add LIBSTDCXX (for usr/lib/libstdc++.a).
Sync LIB* documentation with reality.


# 1.188 19-Sep-2003 martin

Drop explicit medlow model and default to -O2 for sparc64.


# 1.187 14-Sep-2003 lukem

Check ${SHLIBDIR} against "/usr/lib" instead of ${LIBDIR} when determining
if we need to add stuff (usually "/lib") to the rpath-link path before
"/usr/lib". Otherwise, this barfs if LIBDIR != /usr/lib or /lib, and
we're cross-building (e.g., in src/x11)


# 1.186 13-Sep-2003 erh

Also support per-program LDFLAGS and LDSTATIC.


# 1.185 13-Sep-2003 erh

Create a way to add additional flags to COPTS, CPPFLAGS, CXXFLAGS and LDADD
for particular libraries or programs by specifying the additions in mk.conf
instead of needing to go edit individual Makefiles.


# 1.184 12-Sep-2003 lukem

add infrastructure to support reach-over builds of xsrc


# 1.183 22-Aug-2003 dsl

Add a ${PROG}.ro target that does an 'ld -r' of the program object files.
Allows a much simplified build of 'crunched' binaries since crunchgen can
build prog.ro instead of having to deretmine the names of all the .o files.


# 1.182 01-Aug-2003 lukem

Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".


# 1.181 01-Aug-2003 lukem

simplify the ${PROG}: target to reduce duplication between the DESTDIR
and !DESTDIR cases...


# 1.180 31-Jul-2003 lukem

bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.


# 1.179 31-Jul-2003 lukem

Don't need -R/usr/lib; it will be searched at the end by ld.elf_so anyway.
Noted by matt green <mrg@>


# 1.178 28-Jul-2003 lukem

be consistent when adding *.y and *.l to DPSRCS


# 1.177 28-Jul-2003 lukem

replace MKCXXSUPCXX(!=no) with USE_LIBSTDCXX(==no)


# 1.176 28-Jul-2003 lukem

Change defined(CXX_SUPCXX) to MKCXXSUPCXX != "no".

Clarify that command-line overrides of the MKxxx variables should be
done via the environment rather than make(1) command-line variable
assignment, since the latter doesn't actually work as intended.


# 1.175 27-Jul-2003 mrg

introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes. for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)


# 1.174 26-Jul-2003 mrg

add a new bsd.own.mk variable: CXX_SUPCXX. from bsd.README:
+ CXX_SUPCXX If defined, the support libraries needed for this C++ program
+ are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.


# 1.173 20-Jul-2003 lukem

Consistently support the different C++ file extensions: .cc .cpp .cxx .C
Noted by Andrew White in PR toolchain/18246


# 1.172 18-Jul-2003 lukem

Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was defined.
Replace defined(UNPRIVED) tests with ${MKUNPRIVED} != "no"

Add MKUPDATE; if not no has the same semantics as if UPDATE was defined.
Replace defined(UPDATE) tests with ${MKUPDATE} != "no"

Improve documentation for these and other make flags.


# 1.171 16-Jul-2003 itojun

stop installing install libtelnet. build under lib/libtelnet and reference
it from usr.bin/telnet and libexec/telnetd.
(reason for separate build: compiler flags)


# 1.170 27-Jun-2003 drochner

For consistency, use "-R" instead of "-Wl,-rpath" to pass
a runtime search path to the linker.


# 1.169 13-Jun-2003 itojun

define LIBEVENT


# 1.168 11-Jun-2003 msaitoh

catch signal 1,2,3,13 and 15 to clean /tmp/_dependXXX


# 1.167 31-May-2003 thorpej

If EXTERNAL_TOOLCHAIN is defined, allow the compiler to define the
location of crt{begin,end}{,S}.o and libgcc.a. Encapsulate all of
this logic into the new bsd.gcc.mk, and use it in bsd.prog.mk and
bsd.lib.mk.


# 1.166 18-May-2003 lukem

make this a no-op if HOSTPROG is defined


# 1.165 30-Mar-2003 thorpej

If MACHINE_ARCH is powerpc and we HAVE_GCC3, add crtsaveres.o to the
endfile spec.


# 1.164 22-Feb-2003 uwe

Typo in comment.


# 1.163 24-Jan-2003 thorpej

Add LIBPTHREAD, LIBPTHREAD_DB, and LIBRT.


Revision tags: fvdl_fs64_base
# 1.162 22-Nov-2002 thorpej

Split crtbegin/crtend into crti/crtbegin/crtend/crtn. NetBSD-specific
things like the .note.netbsd.ident section are provided by crti/crtn.
crti/crtn also provide the _init() and _fini() routines.

crtbegin/crtend now only provide support for ctors/dtors. This paves
the way to using the "crtstuff" provided with GCC (when we upgrade to
GCC 3.3), which provides, among other things, much better C++/Java
exception handling.


# 1.161 12-Nov-2002 itohy

MKDYNAMICROOT for a.out


# 1.160 22-Oct-2002 perry

Pass 1 of SYSPKG changes to automatically add tags=pkgname_pkg to METALOG.
Not quite ready for prime time yet.


# 1.159 27-Sep-2002 thorpej

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.


# 1.158 26-Sep-2002 itojun

MDC2 is a patented algorithm; don't ship it in default libcrypto.
MKCRYPTO_MDC2 will build a separate library, libcrypto_mdc2.


# 1.157 08-Sep-2002 thorpej

Build a .gdbinit in the objdir when building a program. The .gdbinit
file sets the shared library prefix to ${DESTDIR}, and adds "sources"
directives for each file listed in the GDBINIT Makefile variable.


# 1.156 09-Aug-2002 thorpej

Add LIBPMC.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.155 27-Mar-2002 eeh

branches: 1.155.2;
Use the medium low model for sparc64 programs that don't 2GB of data segment.


# 1.154 11-Feb-2002 mycroft

Don't use .PHONY for targets that are actually installed. Instead use force
dependencies. (Among other things, `make -t install' does something vaguely
sensible now.)


# 1.153 07-Feb-2002 pk

Mark installed system libraries as .MADE only if we're actually establishing
their default variable values here.


# 1.152 04-Feb-2002 christos

s/.NOSUFF/.MADE/


# 1.151 03-Feb-2002 christos

Apply a .NOSUFF: directive to targets we don't want to have processed by
the suffix rules engine.


# 1.150 02-Feb-2002 veego

Ups, it is LIBUSBHID and not LIBUSBHIB.


# 1.149 02-Feb-2002 veego

Change LIBUSB to LIBUSBHIB, reflecting the library name change.


# 1.148 29-Jan-2002 enami

Mark the targets clean{extra,objs} as PHONY.


# 1.147 04-Jan-2002 thorpej

For PROG_CXX DESTDIR builds, pull in -lstdc++ and -lm regardless
of GCC version.


# 1.146 01-Jan-2002 thorpej

Per a suggestion from matthew green, PROG_CXX takes the place of
PROG for C++ programs.


# 1.145 01-Jan-2002 thorpej

* If PROG_CXX is set by the program's Makefile, use ${CXX} to link
the program rather than ${CC}.
* If HAVE_GCC3 is defined, pull in "-lstdc++ -lm" as additional C++
support libraries for DESTDIR builds.


# 1.144 28-Dec-2001 lukem

* 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


# 1.143 28-Nov-2001 tv

If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.


# 1.142 19-Nov-2001 thorpej

Use a little transitional hack to determine if we use -isystem
or -idirafter. Use the former only of USE_NEW_TOOLCHAIN, since
-isystem causes the old toolchain to bomb out when building
libstdc++.


# 1.141 14-Nov-2001 tv

C/..$/.c/ -> C/\..$/.c/


# 1.140 14-Nov-2001 tv

Move the DESTDIR-based nostdinc logic to bsd.lib.mk and bsd.prog.mk where
it belongs (with the native target compile rules).


# 1.139 02-Nov-2001 tv

Use INSTALL_FILE/INSTALL_DIR as appropriate.


# 1.138 02-Nov-2001 tv

Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.


# 1.137 19-Oct-2001 tv

Add .NOPATH for all files generated from .l or .y files in SRCS. Fixes PRs
bin/14187 and lib/14239.

Also simplify the handling of these transforms to .c and .h files a bit by
leveraging make's builtin macro operators.


# 1.136 25-Sep-2001 tv

Set .NOPATH on program to build to make sure it goes in .OBJDIR.
Problem noted by <seebs@plethora.net>.


# 1.135 24-Sep-2001 lukem

fix previous (hi thor!) - $OBJS and $CLEANFILES might be empty, and
rm needs some files to delete...


# 1.134 24-Sep-2001 tls

Split "cleanprog" target apart: now you can zap only object files or
CLEANFILES (needed to fix crunchgen lossage).


# 1.133 13-Sep-2001 thorpej

Add LIBPCI.


# 1.132 14-Aug-2001 tv

Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").


# 1.131 01-Jun-2001 tv

Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).


# 1.130 08-May-2001 sommerfeld

Suppress duplicate entries in ALLFILES, FILES, INCS, DEPINCS, INFOFILES,
NLSALL, CATPAGES, MANPAGES, HTMLPAGES, and SCRIPTS.


# 1.129 19-Feb-2001 jmc

Wrap target() checks around afterdepend rule as some Makefiles override this


# 1.128 26-Jan-2001 itojun

fix typo in LIBSSL decl. it made programs with DPADD+=${LIBSSL} to build
every time we type "make". From: bernd


# 1.127 14-Jan-2001 christos

use the new .if commands(<target>) directive so that we don't have to
change Makefiles.


# 1.126 14-Jan-2001 christos

fix thinko: test for the existance of the target before we define it...


# 1.125 14-Jan-2001 christos

Alter previous redefined target protection. If the ${PROG} target is defined,
add the dependencies as usual, but don't add the commands. This avoids
having to change all the Makefiles that redefine the PROG target.


# 1.124 14-Jan-2001 christos

allow programs to override the program target.


# 1.123 08-Jan-2001 mrg

add missing $LIBCRYPTO_RC5 and $LIBCRYPTO_IDEA


# 1.122 08-Jan-2001 mrg

add missing $LIBSSL


# 1.121 04-Jan-2001 garbled

Add LIBCDK and LIBFORM definitions


# 1.120 31-Oct-2000 itojun

add ${LIBINTL} for use with DPADD.


# 1.119 07-Oct-2000 deberg

fix typos, PR 11159


# 1.118 25-Jun-2000 erh

For the case when DESTDIR is set: move the -L${DESTDIR}/usr/lib after ${LDADD} so any -L directories set in LDADD are searched first to avoid possibly linking against old versions of libraries.


Revision tags: netbsd-1-5-base
# 1.117 19-Jun-2000 thorpej

branches: 1.117.2;
Sync up the LIB* list.


# 1.116 10-Jun-2000 mycroft

Use ${.ALLSRC:T} when doing the generated variable name lookups, so that it
DTRT for generated files in and obj directory (or accessed via .PATH).


# 1.115 06-Jun-2000 mycroft

Abuse .USE some more.


# 1.114 06-Jun-2000 mycroft

Minor rearrangement.


# 1.113 06-Jun-2000 mycroft

Use ODE make(1) features to eliminate extra variables and move several things
outside of .for loops. (Needs more work to completely eliminate .for.)

XXX Don't look at this stuff. It will make your head hurt.


Revision tags: minoura-xpg4dl-base
# 1.112 14-Apr-2000 mrg

branches: 1.112.2;
use -rpath-link rather than -R when linking objects using a DESTDIR.
this replaces the previous change as that ended up adding
$DESTDIR/usr/lib to the runtime path of every binary created, which
is bogus and dangerous.


# 1.111 25-Mar-2000 mycroft

When linking with $DESTDIR, use an explicit -R to get library dependencies
correct.


# 1.110 07-Mar-2000 veego

Remove unused libahdi.
It will be replaced in the future with a more generic libdisklabel.


# 1.109 05-Feb-2000 jdc

Add libahdi entries.


# 1.108 23-Jan-2000 eeh

Add some support for FCode binaries.


# 1.107 22-Jan-2000 mycroft

Make `dependall' play nicely with SUBDIR, using a hack similar to `realinstall'
for both `depend' and `all'.
Also, remove the old hack that invokes an extra shell for .depend, now that
make(1) has been fixed.


# 1.106 16-Jan-2000 assar

all: depend on ${SCRIPTS} so that they get generated if they need to


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.105 23-Nov-1999 blymn

Added libmenu library.


Revision tags: comdex-fall-1999-base
# 1.104 14-Sep-1999 perry

branches: 1.104.4;
Add a "dependall" target, which does a "make depend" and then "make all"
in a single directory. This is useful in "make build" because by doing
the build immediately after the depend, all sources will typically
still be in the buffer cache, thus saving significant time over doing
a "make depend" on all the directories and then a "make all".


# 1.103 04-Sep-1999 fredb

Permit "make all install", as well as "make foo install" (where foo would be
installed by "make install") without setting of BUILD. All cases where BUILD
is already set are unchanged from the old behavior.

"make all install" is now practically equivalent to "make BUILD= all install",
but without actually setting build.

Fixes pr's 8313, 3894.


# 1.102 21-Aug-1999 simonb

Add ${INSTPRIV} to ${INSTALL} commands.


# 1.101 01-Jul-1999 itojun

branches: 1.101.2;
add LIBIPSEC for use from DPADD.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.100 12-Feb-1999 lukem

branches: 1.100.2;
* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.99 10-Feb-1999 tv

libbfd_pic.a is no longer installed; remove ${LIBBFD} define.


# 1.98 04-Feb-1999 christos

PR/2936: Brian C. Grayson: Avoid truncating precious files when installing
and the filesystem is full. Added ${RENAME} flag to install, which when set
to -r installs on a temporary file and then renames to the final destination.
${RENAME} is currently set to nothing in bsd.own.mk, but one can turn it
on in /etc/mk.conf.


# 1.97 07-Nov-1998 jonathan

Do DESTDIR support for crtbegin/crtend on all ELF ports (adds mips).


# 1.96 28-Sep-1998 christos

Use preserve flag in install.


# 1.95 10-Sep-1998 ross

Define a LIBBZ2?=... for use in DPADD=... lines.


# 1.94 09-Aug-1998 lukem

add distclean as a synonym for cleandir


# 1.93 09-Apr-1998 tv

.y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.


# 1.92 01-Apr-1998 tv

Revert. This broke too much in the build tree, and a better solution
needs to be created. (The existing situation breaks a lot too.)


# 1.91 01-Apr-1998 tv

Fix .y rules to DTRT with possibly generated .h files. See mail on
tech-toolchain for a very detailed explanation of this. In short, add
a .y.h rule identical to the .y.c rule and make the .y.c rule rename
the .h file; also, clean the .h file in CLEANFILES.


# 1.90 03-Nov-1997 cgd

echo the lint command line when making 'lint'.


# 1.89 28-Oct-1997 lukem

add ${LIBOBJC}


Revision tags: netbsd-1-3-base
# 1.88 11-Oct-1997 mycroft

branches: 1.88.2;
Several changes:
* Allow bsd.man.mk to be included separately.
* Always include bsd.own.mk and bsd.obj.mk.
* Include bsd.man.mk and bsd.nls.mk even if NOMAN or NONLS; just turn off
building of the affected files instead.
* Require bsd.subdir.mk to be included explicitly.
(Will make appropriate changes to Makefiles shortly.)


# 1.87 29-Sep-1997 gwr

Add $LIBBFD


# 1.86 31-May-1997 cjs

Back out BUILDDIR and NOINSTALL changes.


# 1.85 26-May-1997 cjs

branches: 1.85.2;
These updates to the build allow building against include files
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.


# 1.84 18-May-1997 kleink

Add libposix.


# 1.83 17-May-1997 mycroft

Do LINKS and SYMLINKS after FILES and INCS.


# 1.82 17-May-1997 mycroft

Remove unneeded .SUFFIXES lines, and move .s and .S closer to .o to give the
right preferences.


# 1.81 09-May-1997 mycroft

Fix typo in previous.


# 1.80 09-May-1997 mycroft

Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.79 09-May-1997 mycroft

Remove cruft.


# 1.78 09-May-1997 mycroft

Oops; rearrange dependencies to get things built early enough.


# 1.77 09-May-1997 mycroft

Make sure INCS and SRCS are built if necessary.


# 1.76 08-May-1997 gwr

Set the .NOPATH flag for ${OBJS} (from Christos).


# 1.75 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.74 07-May-1997 mycroft

Various simplifications.


# 1.73 07-May-1997 mycroft

Shuffle some .PHONYs around, to work better with `-t'.


# 1.72 06-May-1997 mycroft

Make most of the install targets .PRECIOUS.


# 1.71 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.70 18-Apr-1997 christos

Add ${LIBNTP}


# 1.69 17-Apr-1997 thorpej

- Properly depend on crtbegin.o and crtend.o for platforms that use
them (currently Alpha and PowerPC)
- STRIP -> STRIPFLAG


# 1.68 03-Apr-1997 mikel

don't allow override of all: target


# 1.67 29-Mar-1997 mikel

merge lite-2 changes (mostly SCCSids)


# 1.66 27-Mar-1997 christos

Put the FILES generated rules in a separate .mk file since both bsd.prog.mk
and bsd.lib.mk use them.


# 1.65 27-Mar-1997 mycroft

Make the SCRIPTS case mimic the FILES case more closely, so we can override
the destination direectory, etc.


# 1.64 27-Mar-1997 mycroft

Remove knowledge of HIDEGAME from here.


# 1.63 24-Mar-1997 christos

make rules update:
- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation


# 1.62 22-Mar-1997 perry

Fix SYMLINKS not to include DESTDIR in the link itself


# 1.61 13-Mar-1997 perry

add SYMLINKS, by analogy to LINKS. Vetted by Christos.


# 1.60 22-Jan-1997 cgd

if 'clean' is not already defined, rather than simply defining it with
a bunch of rules, define a clean{kmod,lib,prog} target with the rules,
and have both clean and cleandir depend on that. That eliminates a bug
where 'cleandir' in a directory which included e.g. bsd.prog.mk but which
also had subdirs would 'make clean' all the subdirs and then 'make cleandir'
all ofthe subdirs. It also allows Makefiles to add more dependencies
to 'clean' after inclusion of the make template.

If 'clean' is already defined, the behaviour is the same as it used to be.


# 1.59 20-Dec-1996 cgd

add an afterdepend target (a la the one in bsd.lib.mk) that processes
the .depend file to add <filename>.ln for each <filename>.o as an
object file which has the given dependencies (in addition to
<filename>.po and <filename>.so, which were already there).


# 1.58 13-Dec-1996 mikel

add missing LIBPCAP definition.


# 1.57 26-Nov-1996 mrg

add libz and libwrap


# 1.56 18-Oct-1996 thorpej

Use ${INSTALL} rather than "install".
From Simon J. Gerraty <sjg@zen.void.oz.au>, PR #1458.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.55 08-Apr-1996 jtc

Sort LIBFOO definitions and add LIBY; Reported by Mike Long <mike.long@analog.com> in PR #2301.


# 1.54 22-Oct-1995 christos

Added include file <bsd.sys.mk> that contains lex and yacc "parallel aware"
rules. These rules are not turned on by default; they are enabled by setting
the PARALLEL variable.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.53 25-Jun-1995 cgd

oops; fix an rm that might be empty


# 1.52 24-Jun-1995 cgd

update lint rules, but keep linting disabled


# 1.51 10-Jun-1995 mycroft

Define LIBEDIT.


# 1.50 21-Apr-1995 jtc

.include <bsd.nls.mk> unless NONLS is defined.


# 1.49 22-Dec-1994 cgd

specify man pages differently, and document how.


# 1.48 24-Aug-1994 mycroft

Include bsd.own.mk earlier.


# 1.47 20-Jul-1994 cgd

fix from christos, for progs w/o objects


Revision tags: netbsd-1-0-base
# 1.46 06-Jul-1994 mycroft

branches: 1.46.2;
Pull libraries from ${DESTDIR} if set. Kill LDONLY, which is unused and
probably not useful anyway.


# 1.45 30-Jun-1994 cgd

fix modify-info-nothingness-then-substitute probelm that broke genclass build


# 1.44 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.43 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.42 28-Jun-1994 jtc

Strip *.sh when constructing OBJS from SRCS.
This will allow us to clean up makefiles that build a script by munging
a template (uusched, genclass, neqn, etc.).


# 1.41 18-Jun-1994 cgd

don't chown the symlink, when HIDEGAME causes a symlink to be made to dm.
4.4-based FS code _follows_ the symlinks on a chown(2) call.


# 1.40 24-May-1994 cgd

fix the last to do the right thing for dependencies


# 1.39 24-May-1994 deraadt

LIBSKEY


# 1.38 22-May-1994 jtc

Single source file programs are now compiled into object files before they
are linked. This change halves the time it takes to rebuild all of the
NetBSD sources when only the C library is "touched"; but only takes about
one percent more disk space.


# 1.37 06-Apr-1994 chopps

relink (recompile) single source programs when crt0.o is updated.


# 1.36 24-Mar-1994 mycroft

Remove *.core on clean.


# 1.35 09-Feb-1994 cgd

kill install -d's.


# 1.34 28-Jan-1994 cgd

add LIBKVM


# 1.33 10-Nov-1993 cgd

librpc doesn't exist anymore


# 1.32 08-Nov-1993 cgd

ad LDSTATIC flag, so static linking can be made one-stop shopping.
use "setenv LDSTATIC" to make *everything* dynamically linked,
setenv LDSTATIC -static for everything statically linked, or unset
it for default behavior.


# 1.31 07-Oct-1993 cgd

LIBTERM pointed at nothing, but was meant to point to libtermcap.a...


# 1.30 07-Oct-1993 cgd

always define LIBCRYPT


# 1.29 17-Aug-1993 mycroft

Make sure we don't recurse into subdirectories if Makefile specified `install'
target. (It's usually blank and is specifically to avoid doing this...)


# 1.28 15-Aug-1993 mycroft

Automatically include bsd.subdir.mk for backward compatibility.


# 1.27 15-Aug-1993 mycroft

Don't automatically include bsd.subdir.mk in bsd.prog.mk and bsd.lib.mk.
Put back .MAIN in bsd.man.mk, and be careful not to include ../Makefile.inc
a second time.


# 1.26 15-Aug-1993 mycroft

Move man rules to sys.mk.
Use bsd.subdir.mk for building subdirectories.
Don't forget to remove x.cc and x.C when using SHAREDSTRINGS.
Make ${PROG} always depend on ${LIBCRT0}.
Don't duplicate code between cleandir and clean.
Move tags target to bsd.dep.mk.
Move STRIP to bsd.own.mk.
Remove redundant definitions of {BIN,MAN}{DIR,GRP,OWN,MODE}.
Move {LIB,DOC}{DIR,GRP,OWN,MODE} defaults to bsd.own.mk.


# 1.25 15-Aug-1993 mycroft

Abstract out dependency stuff, and add RCS identifiers.


# 1.24 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


# 1.23 10-Aug-1993 mycroft

Put LINKS handling in `install' target, so it's the last thing executed, and
happens even if `realinstall' is user-defined.


# 1.22 30-Jul-1993 mycroft

When generating a default OBJS, ignore .h files.


# 1.21 29-Jul-1993 mycroft

Don't print the `making ...' message if an obj dir already exists.
Also, a minor cleanup.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.20 17-Jul-1993 mycroft

Fix C++ dependencies for good. `make depend' is now done in two passes--one
of C files and one for C++ files. No need to specify `-+' in your Makefile,
as it is now done automatically.


# 1.19 17-Jul-1993 cgd

do c++ dependencies the right way...


# 1.18 17-Jul-1993 mycroft

Add suffix rules for C++ files.


# 1.17 04-Jun-1993 brezak

Add LIBRPCSVC variable.


# 1.16 02-Jun-1993 cgd

add ability to specify c++ dependencies, by setting CFLAGS+=-+ for
the dependency make.


# 1.15 26-Apr-1993 cgd

added definition for DPADD library variable LIBCRYPT.


# 1.14 26-Apr-1993 mycroft

Don't redefine `realinstall' target if already defined.


# 1.13 25-Apr-1993 mycroft

Link with LDFLAGS even if one source module.


# 1.12 25-Apr-1993 mycroft

Don't lose if we include bsd.prog.mk only to build man pages.


# 1.11 25-Apr-1993 mycroft

Fix error in last change. (Oops.)


# 1.10 25-Apr-1993 mycroft

Don't build man pages if NOMAN set.


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.9 09-Apr-1993 cgd

various changes to default make rules. from patch 101.
note that only the "sensible" changes in patch 101 are implemented.


# 1.8 08-Apr-1993 cgd

try to do the right thing, in terms making directories before we
install into them, and get the manpage cleans _OUT_ of "clean".
they don't belong there, only in cleandir, WFJ be damned.


# 1.7 08-Apr-1993 cgd

fixed typos...


# 1.6 08-Apr-1993 cgd

(silently) make sure we have directories before installing


# 1.5 04-Apr-1993 cgd

make LIBRPC point to the right place


# 1.4 27-Mar-1993 nate

Fixed the doc macros to call troff, eqn,and tbl instead of ditroff,
deqn, and dtbl.
Fixed make clean to remove the man pages (Bill fixed this in the distribution,
but not in the original source)
Changed install to leave the original file around, by using 'cp' instead of
'mv'. "install -c ..."


# 1.3 23-Mar-1993 cgd

made .CURDIR be absolute, not relative, thereby eliminating
the need for some of the makefile trickery when making objects,
and fixing a few .PATH bugs


# 1.2 22-Mar-1993 cgd

fixed "make obj" for cases when sources not in /usr/src/...
if sources not there, it now mkdirs obj, but some trickery
is necessary, to avoid deleting cwd.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.321 15-Aug-2019 kamil

Add SANITIZER_RENAME_CLASSES in bsd.prog.mk

This adds a more flexible version of SANITIZER_RENAME_SYMBOL.

New symbol allows to specify MKSANITIZER specific renames on per-file and
per-symbol basis.


# 1.320 10-Aug-2019 christos

Make the X11 library lists consistent again.


Revision tags: netbsd-9-base phil-wifi-20190609 pgoyette-compat-20190127
# 1.319 21-Jan-2019 christos

Most of the mv operations are to move temporary files to their final place.
Some use -f, others don't. This can lead to spurious build failures when
the user performing the build changes. Centralize, and always use -f.


Revision tags: pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.318 12-Aug-2018 christos

fix broken library variable definitions (inconsistencies between
bsd.README and bsd.prog.mk)


Revision tags: pgoyette-compat-0728
# 1.317 25-Jul-2018 kamil

Introduce MKLIBCSANITIZER in the share/mk rules

Add flags that are required to build a program and a dynamically loaded
library.

Propagade LIBCSANITIZERFLAGS to CFLAGS and CXXFLAGS.

LDFLAGS is not changed on purpose, as a libcsanitizer is inside libc
and no external dependencies are needed.

Register NOLIBCSANITIZER, as certain distribution parts will need to be
skipped.


# 1.316 12-Jul-2018 maxv

Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.


Revision tags: phil-wifi-base
# 1.315 25-Jun-2018 kamil

branches: 1.315.2;
Add a framework for renaming symbols in libc&co for MKSANITIZER

A new keyword SANITIZER_RENAME_SYMBOL. It's a variable that has specified
a list of symbols to be renamed in a processor in order to remove naming
conflicts with public symbols in libc/m/pthread/rt.

This renaming will occur for libraries and programs.
A symbol with a conflicting 'name', will be renamed to '__mksanitizer_name'.

Based on an idea by <christos>


Revision tags: pgoyette-compat-0625
# 1.314 21-Jun-2018 kamil

Refactor MKSANITIZER flags in mk rules

Introduce a new variable SANITIZERFLAGS that contains all the sanitizer
specific flags. These flags are designed to be passed to CFLAGS, CXXFLAGS
and LDFLAGS.

Pass SANITIZERFLAGS in bsd.prog.mk rules to CFLAGS, CXXFLAGS and LDFLAGS.

Pass SANITIZERFLAGS in bsd.lib.mk rules to *_pic.a build flags. The *_pic.a
libraries are designed to construct .so libraries. All .so libraries with
few exceptions are expected to be prebuilt with a sanitizer. Another
purpuse of *_pic.a files can be constructing static PIE programs, however
they are not supported as of now and there is no sanitization of static
programs either.

Once MKSTATICPIE will be supported, it will be initially incompatible with
MKSANITIZER.

This change also makes it easier to build other targets like kernel and
kernel modules without userland sanitizers.

No functional change intended for MKSANITIZER=no users.


# 1.313 02-Jun-2018 christos

Sanitizers don't support static linking.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315
# 1.312 11-Mar-2018 mrg

define LIBXFONT2.


Revision tags: pgoyette-compat-base
# 1.311 25-Feb-2018 mrg

branches: 1.311.2;
add LIBKRB5_LDADD/LIBKRB5_DPADD and their static counterparts
to bsd.prog.mk. use them instead of hard coding various lists
of libraries for krb5.

this fixes static builds.


# 1.310 11-Dec-2017 christos

Instead of checking for obj existance which can be empty for shuttle-rule
programs, check for .sh sources.


# 1.309 10-Dec-2017 christos

don't try to build .debug files for shell scripts.


# 1.308 10-Oct-2017 christos

Add general {DP,LD}ADD.rump variables


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base
# 1.307 21-May-2017 riastradh

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.


# 1.306 21-May-2017 riastradh

Remove some vestiges of MKCRYPTO_IDEA/MKCRYPTO_MDC2.


# 1.305 21-May-2017 riastradh

Remove MKCRYPTO_RC5. Unconditionally include RC5 in libcrypto.so.

This option existed only because RC5 is covered by patents that, twenty
years ago, we had reason to suspect the patent holder, RSA, Inc., might
litigate. The two US patents in question are 5,724,428 and 5,835,600.

According to the USPTO Patent Term Calculator web site at
<https://www.uspto.gov/patent/laws-and-regulations/patent-term-calculator#heading-5>
(retrieved 2017-05-21), patents filed after 1995-06-07 expire twenty
years after the filing date.

number filing date
5,724,428 1995-11-01
5,835,600 1997-04-21

Thus, these patents appear to be expired.

As proposed on tech-crypto and tech-security:

https://mail-index.netbsd.org/tech-crypto/2017/05/05/msg000718.html
https://mail-index.netbsd.org/tech-security/2017/05/05/msg000927.html


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.304 19-Apr-2017 joerg

Add netpgpverify to the library list.


Revision tags: pgoyette-localcount-20170320
# 1.303 20-Feb-2017 rin

add missing LIBCXX


# 1.302 08-Feb-2017 kamil

libpthread_dbg(3) deletion from the base distribution

libpthread_dbg(3) is a remnant library from the M:N thread model
(pre-NetBSD-5.0) API to introspect threads within a process and for use
of debuggers.

Currently in the 1:1 model it's not used in GDB neither in LLDB and it's
not either planned to be used. It's current function to read pthread_t
structures is realizable within a regular debugger capable to
instrospect objects within a tracee (GDB, LLDB...).

Remaining users of this API can still use this library from
pkgsrc/devel/libpthread_dbg.

Sponsored by <The NetBSD Foundation>


# 1.301 29-Jan-2017 christos

add sqlite3 to statically linked libraries for pam.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914
# 1.300 20-Aug-2016 christos

branches: 1.300.2;
unbound additions


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.299 04-Apr-2016 joerg

branches: 1.299.2;
If the per-target LDSTATIC flag is set, don't include the PIE linker
flags as we currently don't support static PIE.


# 1.298 30-Mar-2016 martin

Pass -pie to cc, not -Wl,-pie. This way we have a chance to fix specs
for obscure corner cases like -pie -fPIE -static (used for
/usr/tests/lib/csu/h_initfini2 if building with MKPIE=yes).
While there also replace -fPIC with -fPIE for the PIE case, even if
it should be mostly equivalent.


# 1.297 12-Mar-2016 mrg

remove conditionals that are always true with GCC >= 4.8.


# 1.296 21-Feb-2016 christos

Add NODEBUG


# 1.295 31-Jan-2016 christos

Introduce NOPIE and NOCTF so that standalone programs build properly.


# 1.294 23-Jan-2016 christos

Define _KERNTYPES for things that need it.


# 1.293 07-Nov-2015 joerg

LIBEXECINFO


# 1.292 07-Jun-2015 matt

Make LIBCRT* depend on the right files if MLIBDIR from MKCOMPAT is defined.


# 1.291 01-Dec-2014 erh

PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilt
if any of their dependencies (i.e. the files they refer to) are changed.
This allows changes to transitive included headers to be handled properly.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.290 25-Mar-2014 ozaki-r

branches: 1.290.4;
Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.


Revision tags: riastradh-drm2-base3
# 1.289 09-Mar-2014 christos

let's see if the new dwarf library can handle dwarf 4


# 1.288 02-Mar-2014 christos

If we are compiling with -g and using gcc4.8 and dtrace downgrade
dwarf generation to version 2 for now.


# 1.287 15-Jan-2014 joerg

-Wl,-pie and -r don't agree with each other, so filter the former out.


# 1.286 11-Nov-2013 joerg

Relink binaries if crti.o changes.


# 1.285 29-Sep-2013 christos

Add libxcb


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.284 31-May-2013 mrg

add LIBX11_XCB; unfortunately since the library is named with a -
in it, we have to use an ugly hard coded assignment for now.
(could be cleaned up with more make variable magic i'm sure.)


# 1.283 04-Apr-2013 christos

ldopts should be before ldadd like everywhere else.


Revision tags: agc-symver-base
# 1.282 14-Feb-2013 christos

Since the libraries are produced with different MK flags than the programs,
we check for existance of the files instead of the MK flags.


# 1.281 14-Feb-2013 christos

Add PROGDPLIBS


# 1.280 26-Jan-2013 christos

CTFCONVERT me harder.


Revision tags: yamt-pagecache-base8
# 1.279 17-Jan-2013 christos

Now that we have separate debug sets, add -g if ${MKDEBUG} is set for
program builds since we don't need to install that symbol files.


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.278 24-Aug-2012 jmmv

branches: 1.278.2;
Allow DPADD to be specified on a per-program basis.


# 1.277 23-Aug-2012 joerg

Revert last, it breaks the tricks xsrc uses.


# 1.276 23-Aug-2012 joerg

Remove SHLIBINSTALLDIR and SHLINKINSTALLLIBDIR. Add rpath entries, if
SHLIBDIR differs from /usr/lib.


# 1.275 08-Aug-2012 christos

add MKRUMP by popular demand.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.274 29-Feb-2012 tron

Move "libexpat" from X11 into base which fixes PR lib/40346.
This change was approved by the Core Group.


# 1.273 21-Feb-2012 matt

Remove another ${SIZE}


# 1.272 20-Feb-2012 matt

Remove ${SIZE}


# 1.271 19-Feb-2012 matt

Add support for --combine with gcc.


Revision tags: netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2
# 1.270 05-Nov-2011 christos

branches: 1.270.2;
Add libtre


Revision tags: yamt-pagecache-base
# 1.269 16-Oct-2011 christos

branches: 1.269.2;
- no need to special-case libraries with weird characters.
- add a note about adding new libraries.


# 1.268 16-Oct-2011 christos

fix list of libraries to reflect reality.


# 1.267 10-Sep-2011 apb

Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.


# 1.266 27-Aug-2011 joerg

Add new "analyze" command to run clang's static analyzer in a directory
on all C/C++ files.


Revision tags: cherry-xenmp-base
# 1.265 26-Apr-2011 he

The new Heimdal adds -lwind and -lheimbase to the set of libraries,
so define the corresponding LIB* variables.
These are also needed in the PAM_STATIC_* variables, so add them there too.


# 1.264 11-Apr-2011 joerg

Adjust --sysroot related usage:
-Wl,-rpath does not expand =, so just drop it.

Drop -Wl,-rpath-link entries that duplicate the -Wl,-rpath entries, this
is done implicitly now that ld is built with sysroot support.

Use ${DESTDIR} explicitly for the remaining -Wl,-rpath-link entries.


# 1.263 10-Apr-2011 joerg

For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.


# 1.262 08-Mar-2011 jmmv

Revert previous (revision 1.261): it broke the build because PROG_CXX is
defined in terms of PROG, so later on we would end up with target duplicates
because both PROG_CXX and PROG were being converted to PROGS_CXX and PROGS.

Did not catch this earlier because the test build I did was not clean and
thus the duplicate targets did not have nasty effects.


# 1.261 07-Mar-2011 jmmv

Always convert PROG to its plural form independently of whether PROG_CXX
is defined or not. From Garrett Cooper in private mail.


Revision tags: bouyer-quota2-nbase
# 1.260 20-Feb-2011 jmmv

Define LIBATF_C and LIBATF_CXX to point to their corresponding .a files and
use these to properly set DPADD for test programs.


Revision tags: bouyer-quota2-base
# 1.259 13-Feb-2011 christos

add saslc


# 1.258 06-Feb-2011 joerg

Don't use -nostdinc or -nostdinc++ if this is included in a HOSTLIB.


# 1.257 17-Jan-2011 pooka

branches: 1.257.2;
Add rump bits to DPSRCS so that update builds work correctly.


Revision tags: matt-mips64-premerge-20101231
# 1.256 13-Dec-2010 pooka

befriend RUMPPRG with CRUNCHEDPRG


# 1.255 13-Dec-2010 pooka

Define RUMPPRG, which is just like PROG, except it additionally
builds a rump client with the name rump.${PROG}. The rump client
is not installed suid/sgid by default even if BINMODE is defined.


# 1.254 10-Dec-2010 joerg

Revert last, gcc(1) checks explicitly for -r on some platforms to disable
passing down --relax as well.


# 1.253 08-Dec-2010 joerg

gcc passes down -r directly to ld, so make it explicitly a linker option.


# 1.252 08-Dec-2010 joerg

Don't depend on ${CC} passing down -R to ld, use -Wl,-rpath explicitly.


# 1.251 08-Nov-2010 lukem

Preserve date on original shared library or program when stripping
the debug symbols and adding the debug-link to .debug.
Use '(rm -f file; false)' in the failure path to force failure.
Based on solution proposed by Nicolas Joly on tech-toolchain in July 2010.
Should fix PR toolchain/44046 from Andreas Gustafsson.


# 1.250 31-Oct-2010 mbalmer

Link Lua to the build and add the resulting files to the distribution sets.
Document the addition of Lua and the change we made to the default settings.


# 1.249 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.248 24-Apr-2010 lukem

When extracting separate debug symbols with MKDEBUG, there's no need
to leave the original file unstripped...


# 1.247 02-Mar-2010 darran

DTrace: Add CTF generation to the make framework. Only enabled when
MKDTRACE=yes.


# 1.246 14-Dec-2009 mrg

use "${CC} -r" not "${CC} -Wl,-r" as the latter fools GCC on some targets
and it ends up passing "-r -relax" to ld, which causes ld to barf.


# 1.245 14-Dec-2009 matt

Merge from matt-nb5-mips64


Revision tags: matt-premerge-20091211
# 1.244 08-Dec-2009 uebayasi

When PROGS / LIBS are used, you can pass each PROG / LIB specific parameters
to ${LD} via:

${LDADD.${PROG}}
${LDFLAGS.${PROG}}
${LDSTATIC.${PROG}}
${LDADD.${LIB}}
${LDFLAGS.${LIB}}

OTOH you can't pass parameters to ${CC}, because in suffix rules make(1) only
knows the name of ${.IMPSRC} and ${.TARGET}; it's users' responsivility to
define ${CC} parameters to all the sources of a given ${PROG} / ${LIB}.

Should address bin/42381.

(Bug in this commit log was pointed out by mrg@.)


# 1.243 27-Nov-2009 tsutsui

If CPPFLAGS or CXXFLAGS already contains -nostdinc or -nostdinc++,
don't add ${CPPFLAGS_ISYSTEM} or ${CPPFLAGS_ISYSTEMXX} to refer
${DESTDIR}/usr/include or ${DESTDIR}/usr/include/g++.

This change might cause errors on some MD stand dir, but in that case
each Makefile should be fixed to search proper system include paths
by -Ipath option in own CPPFLAGS.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.242 12-May-2009 plunky

remove libsdp as improved functionality has been enabled in libbluetooth.


# 1.241 10-Apr-2009 apb

Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links. They have no effect except when using a
metalog, in which case the information is added to the metalog. In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg. This should fix PR 24457 and PR 41155.


# 1.240 24-Nov-2008 cube

branches: 1.240.2;
Move cleanextra to the very ends in case another included file wants to add
to it even if it was initially empty.


Revision tags: netbsd-5-base matt-mips64-base2
# 1.239 19-Oct-2008 christos

branches: 1.239.2;
handle assembly files for MKPIE


# 1.238 16-Oct-2008 christos

Provide a way for a program to override the PIE flags.


# 1.237 15-Oct-2008 christos

don't compile/link libraries with pie


Revision tags: mjf-devfs2-base
# 1.236 02-Oct-2008 joerg

Hook up libfetch and pkg_install update.


Revision tags: wrstuden-revivesa-base-3
# 1.235 09-Sep-2008 joerg

Add MKSTRIPIDENT to remove the RCS IDs from binary programs and shared
libraries for space-constraint systems. The description is based on the
feedback of hubertf@, the logic on input from lukem@

This obsoletes the removal of LIBC_SCCS and SYSLIBC_SCCS for libc builds.


Revision tags: wrstuden-revivesa-base-2
# 1.234 28-Aug-2008 mrg

update a comment example


# 1.233 27-Aug-2008 rtr

use ${X11USRLIBDIR} instead of hard-coded /usr/X11R6/lib when building
${LIB.foo} vars


# 1.232 27-Aug-2008 lukem

Fix problem I introduced in rev 1.231 on 2008/08/25 where ${_PROGLDOPTS}
and -L${_GCC_LIBGCCDIR} were appearing in the link line before ${LDADD},
so -L${DESTDIR}/lib and -L${DESTDIR}/usr/lib were being used before
local -L library paths.
Fixes ntpd/ntpdate failure noticed by Valeriy E. Ushakov <uwe@NetBSD.org>


# 1.231 25-Aug-2008 lukem

Always link with: -Wl,-rpath-link,${DESTDIR}/usr/lib -L${DESTDIR}/usr/lib
Fixes problem with MKDYNAMICROOT=no triggered by libraries that depend
on other libraries.
Related to PR 33503.

Clean up setting of _CCLINK to always add the appropriate -B options.

Simplify the link rule for a program.


# 1.230 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.229 28-May-2008 lukem

add LIBLDAR_R (for completeness)


# 1.228 22-May-2008 lukem

Add MKLDAP, USE_LDAP, LIBLBER, LIBLDAP


Revision tags: hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-pf42-base
# 1.227 10-Apr-2008 tsutsui

branches: 1.227.2; 1.227.4;
Add libhx509 to PAM_STATIC_LDADD which is required by libkrb5.


# 1.226 22-Mar-2008 mlelstv

branches: 1.226.2;
Import Heimdal-1.1


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase matt-armv6-base hpcarm-cleanup-base
# 1.225 26-Dec-2007 jmmv

Make the clean target work when OBJS is set but PROG is not, as happens
for example in gnu/lib/crtstuff4. Reported by drochner@.


Revision tags: cube-autoconf-base
# 1.224 13-Nov-2007 jmmv

Fix typo that prevented MKDEBUG builds to work. Found by drochner@.


# 1.223 12-Nov-2007 jmmv

Add the ability to build multiple programs from a single directory

This adds support for a new set of variables, PROGS and PROGS_CXX, that
allow the developer to build multiple different programs from a single
source directory.


# 1.222 04-Nov-2007 tls

Remove MKPRIVATELIB from BIND libraries; move library reachover
directories and Makefiles from src/usr.sbin/bind to src/lib; make
BIND libraries build shared. Saves about 1MB-1.5MB per installed
executable, about 5MB for a base+etc minimal installation of NetBSD.


Revision tags: matt-mips64-base
# 1.221 29-Jul-2007 joerg

branches: 1.221.4; 1.221.6;
Add build glue for libarchive and update the various sets.


# 1.220 25-Jan-2007 perry

Before I completely forget the issue, convert "PROG_PAX" to the
better-named "PAXCTL_FLAGS".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.219 11-Nov-2006 christos

don't run paxctl if other commands were specified for that target.


# 1.218 10-Nov-2006 christos

if ${PROG_PAX} is defined, run paxctl on the binary after linking with
the value of the variable. This way, if you set:

PROG_PAX=+M

in /etc/mk.conf, you get what you deserve.


# 1.217 22-Oct-2006 pooka

libpuffs


# 1.216 09-Oct-2006 mrg

- clean up some comments to reality.
- retire LIBDCK, LIBG2C and (long broken) USE_LIBSTDCXX
- in bsd.hostprog.mk's LIBSTDCPP -> LIBSTDCC
- add LIBSUPCXX
- don't default USE_LIBSTDCXX or USE_GCC4 since they are
not used in the tree any where
- same with USE_XF86_4; retire it
- remove _SUPCXX handling in bsd.prog.mk

inspired by PR#26714.


Revision tags: abandoned-netbsd-4-base
# 1.215 23-Jul-2006 lukem

Implement MKDEBUG:
If "no", don't build and install separate debugging symbols
into /usr/libdata/debug.
Default: no


# 1.214 19-Jun-2006 gdamore

Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.


# 1.213 09-Jun-2006 christos

PR/33681: Scott Ellis: Building 'bc' with SHAREDSTRINGS=yes fails
We need CPPFLAGS too now.


# 1.212 11-May-2006 mrg

add support for ${OBJCOPTS} and ${OBJCOPTS}.<lib|prog|fn>.


# 1.211 20-Mar-2006 christos

There is always one more KRB4 thing to remove. (from Jukka Salmi)


# 1.210 20-Mar-2006 christos

Remove krb4 variables and libraries (Jukka Salmi)


# 1.209 16-Mar-2006 jwise

Now that we have real build system support for syspkgs, remove someone's
half-implemented idea of building `syspkgs' (really a few giant blobs of the
same granularity of the old sets) using install(1).


# 1.208 20-Jan-2006 christos

Add the world of libraries to the static pam build. Now static pam binaries
work.


# 1.207 09-Apr-2005 dsl

Report when we link a program into xxx.ro (before being crunched)


Revision tags: netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.206 04-Mar-2005 he

branches: 1.206.2; 1.206.4;
Introduce PAM_STATIC_LDADD and PAM_STATIC_DPADD. When compiling
with MKPIC=no, possibly because the target does not support shared
libraries, these include libraries required to resolve all symbols
which end up referenced from PAM-using applications. The libraries
presently required are -lcrypt, -lrpcsvc and -lutil.

Add use of these variables which are currently set up to use PAM,
so that they compile when MKPIC=no.

Also, in the telnetd case, reorder the order of the libraries, so
that libtelnet.a comes before -ltermcap and -lutil, again to fix
link error when MKPIC=no.

Discussed with thorpej and christos.


# 1.205 20-Feb-2005 christos

Add libradius


# 1.204 12-Jan-2005 lukem

If RESCUEDIR is defined, automatically add that to CPPFLAGS


# 1.203 08-Jan-2005 lukem

Implement <bsd.prog.mk> vars:
LIBASN1 LIBBSDMALLOC LIBG2C LIBPAM LIBSSH


# 1.202 04-Aug-2004 lukem

Revert most of previous, and move the LIB<libname>?= assignments
back to bsd.prog.mk from bsd.own.mk.

pkgsrc uses <bsd.own.mk>, and setting LIB<libname> in it causes
problems with various package builds.
This should fix PR #26542 submitted by Jim Bernard.

(I'll be implementing the DPADD for shared libraries in a different
manner that generally won't depend upon ${LIB<libname>}.)


# 1.201 30-Jul-2004 lukem

Move the LIB<libname>?= assignments from bsd.prog.mk to bsd.own.mk so
that they may be used by non PROGs (e.g., LIBs).

Improve some comments.


# 1.200 10-Jun-2004 lukem

Be consistent in handling YHEADER, similar to Christos' fix in bsd.lib.mk 1.253


# 1.199 21-May-2004 ross

If you add a library, you need to define its DPADD symbol here.

Add LIBMAGIC.


Revision tags: netbsd-2-0-base
# 1.198 15-Feb-2004 skrll

branches: 1.198.2;
Be more gcc like in the way we deal with libgcc so that sh3/hppa millicode
and exception handling have a chance of working properly.

- creates libgcc, libgcc_eh and libgcc_s

- updates LIBGCC_SPEC to use them appropriately.

There's a hack in here at the moment with respect to libgcc_so in that it
is preferable to link against libgcc_so will only when -shared-libgcc is
specified (the c++ frontend does this automatically.) Configurations where
LINK_EH_SPEC is defined already do this. The gcc configuration for
NetBSD/alpha and another NetBSD platform (I forget which) actually define
LINK_EH_SPEC probably by accident rather than design.

- updates share/mk to use the compiler's knowledge of what needs linking into
libraries and executables. This removes an hppa hack.

- updates the sets for the newly created libgcc* files.

- support for linking against the _pg version of libgcc has been removed.


# 1.197 29-Jan-2004 lukem

Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.


# 1.196 27-Jan-2004 lukem

Replace
:M-[IDU]*
with
:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)


# 1.195 23-Jan-2004 simonb

crt0.o lives in /usr/lib even on a.out.


# 1.194 16-Nov-2003 lukem

simplify with _MKTARGET_LINK


# 1.193 11-Nov-2003 dsl

Set MKDEP_SUFFIXES to get additional targets in .depend instead of using
sed in .afterdepend. I don't think .afterdepend is used anywhere any more.


# 1.192 21-Oct-2003 lukem

Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.


# 1.191 19-Oct-2003 lukem

Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} " ... {$.TARGET}" and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO


# 1.190 18-Oct-2003 lukem

Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command ("verbose")
This is the default, and is equivalent to the previous behaviour.


# 1.189 29-Sep-2003 lukem

Add LIBSTDCXX (for usr/lib/libstdc++.a).
Sync LIB* documentation with reality.


# 1.188 19-Sep-2003 martin

Drop explicit medlow model and default to -O2 for sparc64.


# 1.187 14-Sep-2003 lukem

Check ${SHLIBDIR} against "/usr/lib" instead of ${LIBDIR} when determining
if we need to add stuff (usually "/lib") to the rpath-link path before
"/usr/lib". Otherwise, this barfs if LIBDIR != /usr/lib or /lib, and
we're cross-building (e.g., in src/x11)


# 1.186 13-Sep-2003 erh

Also support per-program LDFLAGS and LDSTATIC.


# 1.185 13-Sep-2003 erh

Create a way to add additional flags to COPTS, CPPFLAGS, CXXFLAGS and LDADD
for particular libraries or programs by specifying the additions in mk.conf
instead of needing to go edit individual Makefiles.


# 1.184 12-Sep-2003 lukem

add infrastructure to support reach-over builds of xsrc


# 1.183 22-Aug-2003 dsl

Add a ${PROG}.ro target that does an 'ld -r' of the program object files.
Allows a much simplified build of 'crunched' binaries since crunchgen can
build prog.ro instead of having to deretmine the names of all the .o files.


# 1.182 01-Aug-2003 lukem

Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".


# 1.181 01-Aug-2003 lukem

simplify the ${PROG}: target to reduce duplication between the DESTDIR
and !DESTDIR cases...


# 1.180 31-Jul-2003 lukem

bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.


# 1.179 31-Jul-2003 lukem

Don't need -R/usr/lib; it will be searched at the end by ld.elf_so anyway.
Noted by matt green <mrg@>


# 1.178 28-Jul-2003 lukem

be consistent when adding *.y and *.l to DPSRCS


# 1.177 28-Jul-2003 lukem

replace MKCXXSUPCXX(!=no) with USE_LIBSTDCXX(==no)


# 1.176 28-Jul-2003 lukem

Change defined(CXX_SUPCXX) to MKCXXSUPCXX != "no".

Clarify that command-line overrides of the MKxxx variables should be
done via the environment rather than make(1) command-line variable
assignment, since the latter doesn't actually work as intended.


# 1.175 27-Jul-2003 mrg

introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes. for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)


# 1.174 26-Jul-2003 mrg

add a new bsd.own.mk variable: CXX_SUPCXX. from bsd.README:
+ CXX_SUPCXX If defined, the support libraries needed for this C++ program
+ are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.


# 1.173 20-Jul-2003 lukem

Consistently support the different C++ file extensions: .cc .cpp .cxx .C
Noted by Andrew White in PR toolchain/18246


# 1.172 18-Jul-2003 lukem

Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was defined.
Replace defined(UNPRIVED) tests with ${MKUNPRIVED} != "no"

Add MKUPDATE; if not no has the same semantics as if UPDATE was defined.
Replace defined(UPDATE) tests with ${MKUPDATE} != "no"

Improve documentation for these and other make flags.


# 1.171 16-Jul-2003 itojun

stop installing install libtelnet. build under lib/libtelnet and reference
it from usr.bin/telnet and libexec/telnetd.
(reason for separate build: compiler flags)


# 1.170 27-Jun-2003 drochner

For consistency, use "-R" instead of "-Wl,-rpath" to pass
a runtime search path to the linker.


# 1.169 13-Jun-2003 itojun

define LIBEVENT


# 1.168 11-Jun-2003 msaitoh

catch signal 1,2,3,13 and 15 to clean /tmp/_dependXXX


# 1.167 31-May-2003 thorpej

If EXTERNAL_TOOLCHAIN is defined, allow the compiler to define the
location of crt{begin,end}{,S}.o and libgcc.a. Encapsulate all of
this logic into the new bsd.gcc.mk, and use it in bsd.prog.mk and
bsd.lib.mk.


# 1.166 18-May-2003 lukem

make this a no-op if HOSTPROG is defined


# 1.165 30-Mar-2003 thorpej

If MACHINE_ARCH is powerpc and we HAVE_GCC3, add crtsaveres.o to the
endfile spec.


# 1.164 22-Feb-2003 uwe

Typo in comment.


# 1.163 24-Jan-2003 thorpej

Add LIBPTHREAD, LIBPTHREAD_DB, and LIBRT.


Revision tags: fvdl_fs64_base
# 1.162 22-Nov-2002 thorpej

Split crtbegin/crtend into crti/crtbegin/crtend/crtn. NetBSD-specific
things like the .note.netbsd.ident section are provided by crti/crtn.
crti/crtn also provide the _init() and _fini() routines.

crtbegin/crtend now only provide support for ctors/dtors. This paves
the way to using the "crtstuff" provided with GCC (when we upgrade to
GCC 3.3), which provides, among other things, much better C++/Java
exception handling.


# 1.161 12-Nov-2002 itohy

MKDYNAMICROOT for a.out


# 1.160 22-Oct-2002 perry

Pass 1 of SYSPKG changes to automatically add tags=pkgname_pkg to METALOG.
Not quite ready for prime time yet.


# 1.159 27-Sep-2002 thorpej

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.


# 1.158 26-Sep-2002 itojun

MDC2 is a patented algorithm; don't ship it in default libcrypto.
MKCRYPTO_MDC2 will build a separate library, libcrypto_mdc2.


# 1.157 08-Sep-2002 thorpej

Build a .gdbinit in the objdir when building a program. The .gdbinit
file sets the shared library prefix to ${DESTDIR}, and adds "sources"
directives for each file listed in the GDBINIT Makefile variable.


# 1.156 09-Aug-2002 thorpej

Add LIBPMC.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.155 27-Mar-2002 eeh

branches: 1.155.2;
Use the medium low model for sparc64 programs that don't 2GB of data segment.


# 1.154 11-Feb-2002 mycroft

Don't use .PHONY for targets that are actually installed. Instead use force
dependencies. (Among other things, `make -t install' does something vaguely
sensible now.)


# 1.153 07-Feb-2002 pk

Mark installed system libraries as .MADE only if we're actually establishing
their default variable values here.


# 1.152 04-Feb-2002 christos

s/.NOSUFF/.MADE/


# 1.151 03-Feb-2002 christos

Apply a .NOSUFF: directive to targets we don't want to have processed by
the suffix rules engine.


# 1.150 02-Feb-2002 veego

Ups, it is LIBUSBHID and not LIBUSBHIB.


# 1.149 02-Feb-2002 veego

Change LIBUSB to LIBUSBHIB, reflecting the library name change.


# 1.148 29-Jan-2002 enami

Mark the targets clean{extra,objs} as PHONY.


# 1.147 04-Jan-2002 thorpej

For PROG_CXX DESTDIR builds, pull in -lstdc++ and -lm regardless
of GCC version.


# 1.146 01-Jan-2002 thorpej

Per a suggestion from matthew green, PROG_CXX takes the place of
PROG for C++ programs.


# 1.145 01-Jan-2002 thorpej

* If PROG_CXX is set by the program's Makefile, use ${CXX} to link
the program rather than ${CC}.
* If HAVE_GCC3 is defined, pull in "-lstdc++ -lm" as additional C++
support libraries for DESTDIR builds.


# 1.144 28-Dec-2001 lukem

* 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


# 1.143 28-Nov-2001 tv

If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.


# 1.142 19-Nov-2001 thorpej

Use a little transitional hack to determine if we use -isystem
or -idirafter. Use the former only of USE_NEW_TOOLCHAIN, since
-isystem causes the old toolchain to bomb out when building
libstdc++.


# 1.141 14-Nov-2001 tv

C/..$/.c/ -> C/\..$/.c/


# 1.140 14-Nov-2001 tv

Move the DESTDIR-based nostdinc logic to bsd.lib.mk and bsd.prog.mk where
it belongs (with the native target compile rules).


# 1.139 02-Nov-2001 tv

Use INSTALL_FILE/INSTALL_DIR as appropriate.


# 1.138 02-Nov-2001 tv

Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.


# 1.137 19-Oct-2001 tv

Add .NOPATH for all files generated from .l or .y files in SRCS. Fixes PRs
bin/14187 and lib/14239.

Also simplify the handling of these transforms to .c and .h files a bit by
leveraging make's builtin macro operators.


# 1.136 25-Sep-2001 tv

Set .NOPATH on program to build to make sure it goes in .OBJDIR.
Problem noted by <seebs@plethora.net>.


# 1.135 24-Sep-2001 lukem

fix previous (hi thor!) - $OBJS and $CLEANFILES might be empty, and
rm needs some files to delete...


# 1.134 24-Sep-2001 tls

Split "cleanprog" target apart: now you can zap only object files or
CLEANFILES (needed to fix crunchgen lossage).


# 1.133 13-Sep-2001 thorpej

Add LIBPCI.


# 1.132 14-Aug-2001 tv

Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").


# 1.131 01-Jun-2001 tv

Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).


# 1.130 08-May-2001 sommerfeld

Suppress duplicate entries in ALLFILES, FILES, INCS, DEPINCS, INFOFILES,
NLSALL, CATPAGES, MANPAGES, HTMLPAGES, and SCRIPTS.


# 1.129 19-Feb-2001 jmc

Wrap target() checks around afterdepend rule as some Makefiles override this


# 1.128 26-Jan-2001 itojun

fix typo in LIBSSL decl. it made programs with DPADD+=${LIBSSL} to build
every time we type "make". From: bernd


# 1.127 14-Jan-2001 christos

use the new .if commands(<target>) directive so that we don't have to
change Makefiles.


# 1.126 14-Jan-2001 christos

fix thinko: test for the existance of the target before we define it...


# 1.125 14-Jan-2001 christos

Alter previous redefined target protection. If the ${PROG} target is defined,
add the dependencies as usual, but don't add the commands. This avoids
having to change all the Makefiles that redefine the PROG target.


# 1.124 14-Jan-2001 christos

allow programs to override the program target.


# 1.123 08-Jan-2001 mrg

add missing $LIBCRYPTO_RC5 and $LIBCRYPTO_IDEA


# 1.122 08-Jan-2001 mrg

add missing $LIBSSL


# 1.121 04-Jan-2001 garbled

Add LIBCDK and LIBFORM definitions


# 1.120 31-Oct-2000 itojun

add ${LIBINTL} for use with DPADD.


# 1.119 07-Oct-2000 deberg

fix typos, PR 11159


# 1.118 25-Jun-2000 erh

For the case when DESTDIR is set: move the -L${DESTDIR}/usr/lib after ${LDADD} so any -L directories set in LDADD are searched first to avoid possibly linking against old versions of libraries.


Revision tags: netbsd-1-5-base
# 1.117 19-Jun-2000 thorpej

branches: 1.117.2;
Sync up the LIB* list.


# 1.116 10-Jun-2000 mycroft

Use ${.ALLSRC:T} when doing the generated variable name lookups, so that it
DTRT for generated files in and obj directory (or accessed via .PATH).


# 1.115 06-Jun-2000 mycroft

Abuse .USE some more.


# 1.114 06-Jun-2000 mycroft

Minor rearrangement.


# 1.113 06-Jun-2000 mycroft

Use ODE make(1) features to eliminate extra variables and move several things
outside of .for loops. (Needs more work to completely eliminate .for.)

XXX Don't look at this stuff. It will make your head hurt.


Revision tags: minoura-xpg4dl-base
# 1.112 14-Apr-2000 mrg

branches: 1.112.2;
use -rpath-link rather than -R when linking objects using a DESTDIR.
this replaces the previous change as that ended up adding
$DESTDIR/usr/lib to the runtime path of every binary created, which
is bogus and dangerous.


# 1.111 25-Mar-2000 mycroft

When linking with $DESTDIR, use an explicit -R to get library dependencies
correct.


# 1.110 07-Mar-2000 veego

Remove unused libahdi.
It will be replaced in the future with a more generic libdisklabel.


# 1.109 05-Feb-2000 jdc

Add libahdi entries.


# 1.108 23-Jan-2000 eeh

Add some support for FCode binaries.


# 1.107 22-Jan-2000 mycroft

Make `dependall' play nicely with SUBDIR, using a hack similar to `realinstall'
for both `depend' and `all'.
Also, remove the old hack that invokes an extra shell for .depend, now that
make(1) has been fixed.


# 1.106 16-Jan-2000 assar

all: depend on ${SCRIPTS} so that they get generated if they need to


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.105 23-Nov-1999 blymn

Added libmenu library.


Revision tags: comdex-fall-1999-base
# 1.104 14-Sep-1999 perry

branches: 1.104.4;
Add a "dependall" target, which does a "make depend" and then "make all"
in a single directory. This is useful in "make build" because by doing
the build immediately after the depend, all sources will typically
still be in the buffer cache, thus saving significant time over doing
a "make depend" on all the directories and then a "make all".


# 1.103 04-Sep-1999 fredb

Permit "make all install", as well as "make foo install" (where foo would be
installed by "make install") without setting of BUILD. All cases where BUILD
is already set are unchanged from the old behavior.

"make all install" is now practically equivalent to "make BUILD= all install",
but without actually setting build.

Fixes pr's 8313, 3894.


# 1.102 21-Aug-1999 simonb

Add ${INSTPRIV} to ${INSTALL} commands.


# 1.101 01-Jul-1999 itojun

branches: 1.101.2;
add LIBIPSEC for use from DPADD.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.100 12-Feb-1999 lukem

branches: 1.100.2;
* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.99 10-Feb-1999 tv

libbfd_pic.a is no longer installed; remove ${LIBBFD} define.


# 1.98 04-Feb-1999 christos

PR/2936: Brian C. Grayson: Avoid truncating precious files when installing
and the filesystem is full. Added ${RENAME} flag to install, which when set
to -r installs on a temporary file and then renames to the final destination.
${RENAME} is currently set to nothing in bsd.own.mk, but one can turn it
on in /etc/mk.conf.


# 1.97 07-Nov-1998 jonathan

Do DESTDIR support for crtbegin/crtend on all ELF ports (adds mips).


# 1.96 28-Sep-1998 christos

Use preserve flag in install.


# 1.95 10-Sep-1998 ross

Define a LIBBZ2?=... for use in DPADD=... lines.


# 1.94 09-Aug-1998 lukem

add distclean as a synonym for cleandir


# 1.93 09-Apr-1998 tv

.y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.


# 1.92 01-Apr-1998 tv

Revert. This broke too much in the build tree, and a better solution
needs to be created. (The existing situation breaks a lot too.)


# 1.91 01-Apr-1998 tv

Fix .y rules to DTRT with possibly generated .h files. See mail on
tech-toolchain for a very detailed explanation of this. In short, add
a .y.h rule identical to the .y.c rule and make the .y.c rule rename
the .h file; also, clean the .h file in CLEANFILES.


# 1.90 03-Nov-1997 cgd

echo the lint command line when making 'lint'.


# 1.89 28-Oct-1997 lukem

add ${LIBOBJC}


Revision tags: netbsd-1-3-base
# 1.88 11-Oct-1997 mycroft

branches: 1.88.2;
Several changes:
* Allow bsd.man.mk to be included separately.
* Always include bsd.own.mk and bsd.obj.mk.
* Include bsd.man.mk and bsd.nls.mk even if NOMAN or NONLS; just turn off
building of the affected files instead.
* Require bsd.subdir.mk to be included explicitly.
(Will make appropriate changes to Makefiles shortly.)


# 1.87 29-Sep-1997 gwr

Add $LIBBFD


# 1.86 31-May-1997 cjs

Back out BUILDDIR and NOINSTALL changes.


# 1.85 26-May-1997 cjs

branches: 1.85.2;
These updates to the build allow building against include files
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.


# 1.84 18-May-1997 kleink

Add libposix.


# 1.83 17-May-1997 mycroft

Do LINKS and SYMLINKS after FILES and INCS.


# 1.82 17-May-1997 mycroft

Remove unneeded .SUFFIXES lines, and move .s and .S closer to .o to give the
right preferences.


# 1.81 09-May-1997 mycroft

Fix typo in previous.


# 1.80 09-May-1997 mycroft

Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.79 09-May-1997 mycroft

Remove cruft.


# 1.78 09-May-1997 mycroft

Oops; rearrange dependencies to get things built early enough.


# 1.77 09-May-1997 mycroft

Make sure INCS and SRCS are built if necessary.


# 1.76 08-May-1997 gwr

Set the .NOPATH flag for ${OBJS} (from Christos).


# 1.75 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.74 07-May-1997 mycroft

Various simplifications.


# 1.73 07-May-1997 mycroft

Shuffle some .PHONYs around, to work better with `-t'.


# 1.72 06-May-1997 mycroft

Make most of the install targets .PRECIOUS.


# 1.71 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.70 18-Apr-1997 christos

Add ${LIBNTP}


# 1.69 17-Apr-1997 thorpej

- Properly depend on crtbegin.o and crtend.o for platforms that use
them (currently Alpha and PowerPC)
- STRIP -> STRIPFLAG


# 1.68 03-Apr-1997 mikel

don't allow override of all: target


# 1.67 29-Mar-1997 mikel

merge lite-2 changes (mostly SCCSids)


# 1.66 27-Mar-1997 christos

Put the FILES generated rules in a separate .mk file since both bsd.prog.mk
and bsd.lib.mk use them.


# 1.65 27-Mar-1997 mycroft

Make the SCRIPTS case mimic the FILES case more closely, so we can override
the destination direectory, etc.


# 1.64 27-Mar-1997 mycroft

Remove knowledge of HIDEGAME from here.


# 1.63 24-Mar-1997 christos

make rules update:
- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation


# 1.62 22-Mar-1997 perry

Fix SYMLINKS not to include DESTDIR in the link itself


# 1.61 13-Mar-1997 perry

add SYMLINKS, by analogy to LINKS. Vetted by Christos.


# 1.60 22-Jan-1997 cgd

if 'clean' is not already defined, rather than simply defining it with
a bunch of rules, define a clean{kmod,lib,prog} target with the rules,
and have both clean and cleandir depend on that. That eliminates a bug
where 'cleandir' in a directory which included e.g. bsd.prog.mk but which
also had subdirs would 'make clean' all the subdirs and then 'make cleandir'
all ofthe subdirs. It also allows Makefiles to add more dependencies
to 'clean' after inclusion of the make template.

If 'clean' is already defined, the behaviour is the same as it used to be.


# 1.59 20-Dec-1996 cgd

add an afterdepend target (a la the one in bsd.lib.mk) that processes
the .depend file to add <filename>.ln for each <filename>.o as an
object file which has the given dependencies (in addition to
<filename>.po and <filename>.so, which were already there).


# 1.58 13-Dec-1996 mikel

add missing LIBPCAP definition.


# 1.57 26-Nov-1996 mrg

add libz and libwrap


# 1.56 18-Oct-1996 thorpej

Use ${INSTALL} rather than "install".
From Simon J. Gerraty <sjg@zen.void.oz.au>, PR #1458.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.55 08-Apr-1996 jtc

Sort LIBFOO definitions and add LIBY; Reported by Mike Long <mike.long@analog.com> in PR #2301.


# 1.54 22-Oct-1995 christos

Added include file <bsd.sys.mk> that contains lex and yacc "parallel aware"
rules. These rules are not turned on by default; they are enabled by setting
the PARALLEL variable.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.53 25-Jun-1995 cgd

oops; fix an rm that might be empty


# 1.52 24-Jun-1995 cgd

update lint rules, but keep linting disabled


# 1.51 10-Jun-1995 mycroft

Define LIBEDIT.


# 1.50 21-Apr-1995 jtc

.include <bsd.nls.mk> unless NONLS is defined.


# 1.49 22-Dec-1994 cgd

specify man pages differently, and document how.


# 1.48 24-Aug-1994 mycroft

Include bsd.own.mk earlier.


# 1.47 20-Jul-1994 cgd

fix from christos, for progs w/o objects


Revision tags: netbsd-1-0-base
# 1.46 06-Jul-1994 mycroft

branches: 1.46.2;
Pull libraries from ${DESTDIR} if set. Kill LDONLY, which is unused and
probably not useful anyway.


# 1.45 30-Jun-1994 cgd

fix modify-info-nothingness-then-substitute probelm that broke genclass build


# 1.44 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.43 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.42 28-Jun-1994 jtc

Strip *.sh when constructing OBJS from SRCS.
This will allow us to clean up makefiles that build a script by munging
a template (uusched, genclass, neqn, etc.).


# 1.41 18-Jun-1994 cgd

don't chown the symlink, when HIDEGAME causes a symlink to be made to dm.
4.4-based FS code _follows_ the symlinks on a chown(2) call.


# 1.40 24-May-1994 cgd

fix the last to do the right thing for dependencies


# 1.39 24-May-1994 deraadt

LIBSKEY


# 1.38 22-May-1994 jtc

Single source file programs are now compiled into object files before they
are linked. This change halves the time it takes to rebuild all of the
NetBSD sources when only the C library is "touched"; but only takes about
one percent more disk space.


# 1.37 06-Apr-1994 chopps

relink (recompile) single source programs when crt0.o is updated.


# 1.36 24-Mar-1994 mycroft

Remove *.core on clean.


# 1.35 09-Feb-1994 cgd

kill install -d's.


# 1.34 28-Jan-1994 cgd

add LIBKVM


# 1.33 10-Nov-1993 cgd

librpc doesn't exist anymore


# 1.32 08-Nov-1993 cgd

ad LDSTATIC flag, so static linking can be made one-stop shopping.
use "setenv LDSTATIC" to make *everything* dynamically linked,
setenv LDSTATIC -static for everything statically linked, or unset
it for default behavior.


# 1.31 07-Oct-1993 cgd

LIBTERM pointed at nothing, but was meant to point to libtermcap.a...


# 1.30 07-Oct-1993 cgd

always define LIBCRYPT


# 1.29 17-Aug-1993 mycroft

Make sure we don't recurse into subdirectories if Makefile specified `install'
target. (It's usually blank and is specifically to avoid doing this...)


# 1.28 15-Aug-1993 mycroft

Automatically include bsd.subdir.mk for backward compatibility.


# 1.27 15-Aug-1993 mycroft

Don't automatically include bsd.subdir.mk in bsd.prog.mk and bsd.lib.mk.
Put back .MAIN in bsd.man.mk, and be careful not to include ../Makefile.inc
a second time.


# 1.26 15-Aug-1993 mycroft

Move man rules to sys.mk.
Use bsd.subdir.mk for building subdirectories.
Don't forget to remove x.cc and x.C when using SHAREDSTRINGS.
Make ${PROG} always depend on ${LIBCRT0}.
Don't duplicate code between cleandir and clean.
Move tags target to bsd.dep.mk.
Move STRIP to bsd.own.mk.
Remove redundant definitions of {BIN,MAN}{DIR,GRP,OWN,MODE}.
Move {LIB,DOC}{DIR,GRP,OWN,MODE} defaults to bsd.own.mk.


# 1.25 15-Aug-1993 mycroft

Abstract out dependency stuff, and add RCS identifiers.


# 1.24 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


# 1.23 10-Aug-1993 mycroft

Put LINKS handling in `install' target, so it's the last thing executed, and
happens even if `realinstall' is user-defined.


# 1.22 30-Jul-1993 mycroft

When generating a default OBJS, ignore .h files.


# 1.21 29-Jul-1993 mycroft

Don't print the `making ...' message if an obj dir already exists.
Also, a minor cleanup.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.20 17-Jul-1993 mycroft

Fix C++ dependencies for good. `make depend' is now done in two passes--one
of C files and one for C++ files. No need to specify `-+' in your Makefile,
as it is now done automatically.


# 1.19 17-Jul-1993 cgd

do c++ dependencies the right way...


# 1.18 17-Jul-1993 mycroft

Add suffix rules for C++ files.


# 1.17 04-Jun-1993 brezak

Add LIBRPCSVC variable.


# 1.16 02-Jun-1993 cgd

add ability to specify c++ dependencies, by setting CFLAGS+=-+ for
the dependency make.


# 1.15 26-Apr-1993 cgd

added definition for DPADD library variable LIBCRYPT.


# 1.14 26-Apr-1993 mycroft

Don't redefine `realinstall' target if already defined.


# 1.13 25-Apr-1993 mycroft

Link with LDFLAGS even if one source module.


# 1.12 25-Apr-1993 mycroft

Don't lose if we include bsd.prog.mk only to build man pages.


# 1.11 25-Apr-1993 mycroft

Fix error in last change. (Oops.)


# 1.10 25-Apr-1993 mycroft

Don't build man pages if NOMAN set.


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.9 09-Apr-1993 cgd

various changes to default make rules. from patch 101.
note that only the "sensible" changes in patch 101 are implemented.


# 1.8 08-Apr-1993 cgd

try to do the right thing, in terms making directories before we
install into them, and get the manpage cleans _OUT_ of "clean".
they don't belong there, only in cleandir, WFJ be damned.


# 1.7 08-Apr-1993 cgd

fixed typos...


# 1.6 08-Apr-1993 cgd

(silently) make sure we have directories before installing


# 1.5 04-Apr-1993 cgd

make LIBRPC point to the right place


# 1.4 27-Mar-1993 nate

Fixed the doc macros to call troff, eqn,and tbl instead of ditroff,
deqn, and dtbl.
Fixed make clean to remove the man pages (Bill fixed this in the distribution,
but not in the original source)
Changed install to leave the original file around, by using 'cp' instead of
'mv'. "install -c ..."


# 1.3 23-Mar-1993 cgd

made .CURDIR be absolute, not relative, thereby eliminating
the need for some of the makefile trickery when making objects,
and fixing a few .PATH bugs


# 1.2 22-Mar-1993 cgd

fixed "make obj" for cases when sources not in /usr/src/...
if sources not there, it now mkdirs obj, but some trickery
is necessary, to avoid deleting cwd.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


Revision tags: pgoyette-compat-20190127
# 1.319 21-Jan-2019 christos

Most of the mv operations are to move temporary files to their final place.
Some use -f, others don't. This can lead to spurious build failures when
the user performing the build changes. Centralize, and always use -f.


Revision tags: pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.318 12-Aug-2018 christos

fix broken library variable definitions (inconsistencies between
bsd.README and bsd.prog.mk)


Revision tags: pgoyette-compat-0728
# 1.317 25-Jul-2018 kamil

Introduce MKLIBCSANITIZER in the share/mk rules

Add flags that are required to build a program and a dynamically loaded
library.

Propagade LIBCSANITIZERFLAGS to CFLAGS and CXXFLAGS.

LDFLAGS is not changed on purpose, as a libcsanitizer is inside libc
and no external dependencies are needed.

Register NOLIBCSANITIZER, as certain distribution parts will need to be
skipped.


# 1.316 12-Jul-2018 maxv

Remove the kernel PMC code. Sent yesterday on tech-kern@.

This change:

* Removes "options PERFCTRS", the associated includes, and the associated
ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
good.

* Removes the PMC code of ARM XSCALE.

* Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

* Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
definitions are put in sysarch.h.

* Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
netbsd32 and rump.

* Removes the pmc_evid_t and pmc_ctr_t types.

* Removes all the associated man pages. The sets are marked as obsolete.


Revision tags: phil-wifi-base
# 1.315 25-Jun-2018 kamil

Add a framework for renaming symbols in libc&co for MKSANITIZER

A new keyword SANITIZER_RENAME_SYMBOL. It's a variable that has specified
a list of symbols to be renamed in a processor in order to remove naming
conflicts with public symbols in libc/m/pthread/rt.

This renaming will occur for libraries and programs.
A symbol with a conflicting 'name', will be renamed to '__mksanitizer_name'.

Based on an idea by <christos>


Revision tags: pgoyette-compat-0625
# 1.314 21-Jun-2018 kamil

Refactor MKSANITIZER flags in mk rules

Introduce a new variable SANITIZERFLAGS that contains all the sanitizer
specific flags. These flags are designed to be passed to CFLAGS, CXXFLAGS
and LDFLAGS.

Pass SANITIZERFLAGS in bsd.prog.mk rules to CFLAGS, CXXFLAGS and LDFLAGS.

Pass SANITIZERFLAGS in bsd.lib.mk rules to *_pic.a build flags. The *_pic.a
libraries are designed to construct .so libraries. All .so libraries with
few exceptions are expected to be prebuilt with a sanitizer. Another
purpuse of *_pic.a files can be constructing static PIE programs, however
they are not supported as of now and there is no sanitization of static
programs either.

Once MKSTATICPIE will be supported, it will be initially incompatible with
MKSANITIZER.

This change also makes it easier to build other targets like kernel and
kernel modules without userland sanitizers.

No functional change intended for MKSANITIZER=no users.


# 1.313 02-Jun-2018 christos

Sanitizers don't support static linking.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315
# 1.312 11-Mar-2018 mrg

define LIBXFONT2.


Revision tags: pgoyette-compat-base
# 1.311 25-Feb-2018 mrg

branches: 1.311.2;
add LIBKRB5_LDADD/LIBKRB5_DPADD and their static counterparts
to bsd.prog.mk. use them instead of hard coding various lists
of libraries for krb5.

this fixes static builds.


# 1.310 11-Dec-2017 christos

Instead of checking for obj existance which can be empty for shuttle-rule
programs, check for .sh sources.


# 1.309 10-Dec-2017 christos

don't try to build .debug files for shell scripts.


# 1.308 10-Oct-2017 christos

Add general {DP,LD}ADD.rump variables


Revision tags: netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base
# 1.307 21-May-2017 riastradh

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.


# 1.306 21-May-2017 riastradh

Remove some vestiges of MKCRYPTO_IDEA/MKCRYPTO_MDC2.


# 1.305 21-May-2017 riastradh

Remove MKCRYPTO_RC5. Unconditionally include RC5 in libcrypto.so.

This option existed only because RC5 is covered by patents that, twenty
years ago, we had reason to suspect the patent holder, RSA, Inc., might
litigate. The two US patents in question are 5,724,428 and 5,835,600.

According to the USPTO Patent Term Calculator web site at
<https://www.uspto.gov/patent/laws-and-regulations/patent-term-calculator#heading-5>
(retrieved 2017-05-21), patents filed after 1995-06-07 expire twenty
years after the filing date.

number filing date
5,724,428 1995-11-01
5,835,600 1997-04-21

Thus, these patents appear to be expired.

As proposed on tech-crypto and tech-security:

https://mail-index.netbsd.org/tech-crypto/2017/05/05/msg000718.html
https://mail-index.netbsd.org/tech-security/2017/05/05/msg000927.html


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.304 19-Apr-2017 joerg

Add netpgpverify to the library list.


Revision tags: pgoyette-localcount-20170320
# 1.303 20-Feb-2017 rin

add missing LIBCXX


# 1.302 08-Feb-2017 kamil

libpthread_dbg(3) deletion from the base distribution

libpthread_dbg(3) is a remnant library from the M:N thread model
(pre-NetBSD-5.0) API to introspect threads within a process and for use
of debuggers.

Currently in the 1:1 model it's not used in GDB neither in LLDB and it's
not either planned to be used. It's current function to read pthread_t
structures is realizable within a regular debugger capable to
instrospect objects within a tracee (GDB, LLDB...).

Remaining users of this API can still use this library from
pkgsrc/devel/libpthread_dbg.

Sponsored by <The NetBSD Foundation>


# 1.301 29-Jan-2017 christos

add sqlite3 to statically linked libraries for pam.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914
# 1.300 20-Aug-2016 christos

branches: 1.300.2;
unbound additions


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.299 04-Apr-2016 joerg

branches: 1.299.2;
If the per-target LDSTATIC flag is set, don't include the PIE linker
flags as we currently don't support static PIE.


# 1.298 30-Mar-2016 martin

Pass -pie to cc, not -Wl,-pie. This way we have a chance to fix specs
for obscure corner cases like -pie -fPIE -static (used for
/usr/tests/lib/csu/h_initfini2 if building with MKPIE=yes).
While there also replace -fPIC with -fPIE for the PIE case, even if
it should be mostly equivalent.


# 1.297 12-Mar-2016 mrg

remove conditionals that are always true with GCC >= 4.8.


# 1.296 21-Feb-2016 christos

Add NODEBUG


# 1.295 31-Jan-2016 christos

Introduce NOPIE and NOCTF so that standalone programs build properly.


# 1.294 23-Jan-2016 christos

Define _KERNTYPES for things that need it.


# 1.293 07-Nov-2015 joerg

LIBEXECINFO


# 1.292 07-Jun-2015 matt

Make LIBCRT* depend on the right files if MLIBDIR from MKCOMPAT is defined.


# 1.291 01-Dec-2014 erh

PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilt
if any of their dependencies (i.e. the files they refer to) are changed.
This allows changes to transitive included headers to be handled properly.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.290 25-Mar-2014 ozaki-r

branches: 1.290.4;
Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.


Revision tags: riastradh-drm2-base3
# 1.289 09-Mar-2014 christos

let's see if the new dwarf library can handle dwarf 4


# 1.288 02-Mar-2014 christos

If we are compiling with -g and using gcc4.8 and dtrace downgrade
dwarf generation to version 2 for now.


# 1.287 15-Jan-2014 joerg

-Wl,-pie and -r don't agree with each other, so filter the former out.


# 1.286 11-Nov-2013 joerg

Relink binaries if crti.o changes.


# 1.285 29-Sep-2013 christos

Add libxcb


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.284 31-May-2013 mrg

add LIBX11_XCB; unfortunately since the library is named with a -
in it, we have to use an ugly hard coded assignment for now.
(could be cleaned up with more make variable magic i'm sure.)


# 1.283 04-Apr-2013 christos

ldopts should be before ldadd like everywhere else.


Revision tags: agc-symver-base
# 1.282 14-Feb-2013 christos

Since the libraries are produced with different MK flags than the programs,
we check for existance of the files instead of the MK flags.


# 1.281 14-Feb-2013 christos

Add PROGDPLIBS


# 1.280 26-Jan-2013 christos

CTFCONVERT me harder.


Revision tags: yamt-pagecache-base8
# 1.279 17-Jan-2013 christos

Now that we have separate debug sets, add -g if ${MKDEBUG} is set for
program builds since we don't need to install that symbol files.


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.278 24-Aug-2012 jmmv

branches: 1.278.2;
Allow DPADD to be specified on a per-program basis.


# 1.277 23-Aug-2012 joerg

Revert last, it breaks the tricks xsrc uses.


# 1.276 23-Aug-2012 joerg

Remove SHLIBINSTALLDIR and SHLINKINSTALLLIBDIR. Add rpath entries, if
SHLIBDIR differs from /usr/lib.


# 1.275 08-Aug-2012 christos

add MKRUMP by popular demand.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.274 29-Feb-2012 tron

Move "libexpat" from X11 into base which fixes PR lib/40346.
This change was approved by the Core Group.


# 1.273 21-Feb-2012 matt

Remove another ${SIZE}


# 1.272 20-Feb-2012 matt

Remove ${SIZE}


# 1.271 19-Feb-2012 matt

Add support for --combine with gcc.


Revision tags: netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2
# 1.270 05-Nov-2011 christos

branches: 1.270.2;
Add libtre


Revision tags: yamt-pagecache-base
# 1.269 16-Oct-2011 christos

branches: 1.269.2;
- no need to special-case libraries with weird characters.
- add a note about adding new libraries.


# 1.268 16-Oct-2011 christos

fix list of libraries to reflect reality.


# 1.267 10-Sep-2011 apb

Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.


# 1.266 27-Aug-2011 joerg

Add new "analyze" command to run clang's static analyzer in a directory
on all C/C++ files.


Revision tags: cherry-xenmp-base
# 1.265 26-Apr-2011 he

The new Heimdal adds -lwind and -lheimbase to the set of libraries,
so define the corresponding LIB* variables.
These are also needed in the PAM_STATIC_* variables, so add them there too.


# 1.264 11-Apr-2011 joerg

Adjust --sysroot related usage:
-Wl,-rpath does not expand =, so just drop it.

Drop -Wl,-rpath-link entries that duplicate the -Wl,-rpath entries, this
is done implicitly now that ld is built with sysroot support.

Use ${DESTDIR} explicitly for the remaining -Wl,-rpath-link entries.


# 1.263 10-Apr-2011 joerg

For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.


# 1.262 08-Mar-2011 jmmv

Revert previous (revision 1.261): it broke the build because PROG_CXX is
defined in terms of PROG, so later on we would end up with target duplicates
because both PROG_CXX and PROG were being converted to PROGS_CXX and PROGS.

Did not catch this earlier because the test build I did was not clean and
thus the duplicate targets did not have nasty effects.


# 1.261 07-Mar-2011 jmmv

Always convert PROG to its plural form independently of whether PROG_CXX
is defined or not. From Garrett Cooper in private mail.


Revision tags: bouyer-quota2-nbase
# 1.260 20-Feb-2011 jmmv

Define LIBATF_C and LIBATF_CXX to point to their corresponding .a files and
use these to properly set DPADD for test programs.


Revision tags: bouyer-quota2-base
# 1.259 13-Feb-2011 christos

add saslc


# 1.258 06-Feb-2011 joerg

Don't use -nostdinc or -nostdinc++ if this is included in a HOSTLIB.


# 1.257 17-Jan-2011 pooka

branches: 1.257.2;
Add rump bits to DPSRCS so that update builds work correctly.


Revision tags: matt-mips64-premerge-20101231
# 1.256 13-Dec-2010 pooka

befriend RUMPPRG with CRUNCHEDPRG


# 1.255 13-Dec-2010 pooka

Define RUMPPRG, which is just like PROG, except it additionally
builds a rump client with the name rump.${PROG}. The rump client
is not installed suid/sgid by default even if BINMODE is defined.


# 1.254 10-Dec-2010 joerg

Revert last, gcc(1) checks explicitly for -r on some platforms to disable
passing down --relax as well.


# 1.253 08-Dec-2010 joerg

gcc passes down -r directly to ld, so make it explicitly a linker option.


# 1.252 08-Dec-2010 joerg

Don't depend on ${CC} passing down -R to ld, use -Wl,-rpath explicitly.


# 1.251 08-Nov-2010 lukem

Preserve date on original shared library or program when stripping
the debug symbols and adding the debug-link to .debug.
Use '(rm -f file; false)' in the failure path to force failure.
Based on solution proposed by Nicolas Joly on tech-toolchain in July 2010.
Should fix PR toolchain/44046 from Andreas Gustafsson.


# 1.250 31-Oct-2010 mbalmer

Link Lua to the build and add the resulting files to the distribution sets.
Document the addition of Lua and the change we made to the default settings.


# 1.249 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.248 24-Apr-2010 lukem

When extracting separate debug symbols with MKDEBUG, there's no need
to leave the original file unstripped...


# 1.247 02-Mar-2010 darran

DTrace: Add CTF generation to the make framework. Only enabled when
MKDTRACE=yes.


# 1.246 14-Dec-2009 mrg

use "${CC} -r" not "${CC} -Wl,-r" as the latter fools GCC on some targets
and it ends up passing "-r -relax" to ld, which causes ld to barf.


# 1.245 14-Dec-2009 matt

Merge from matt-nb5-mips64


Revision tags: matt-premerge-20091211
# 1.244 08-Dec-2009 uebayasi

When PROGS / LIBS are used, you can pass each PROG / LIB specific parameters
to ${LD} via:

${LDADD.${PROG}}
${LDFLAGS.${PROG}}
${LDSTATIC.${PROG}}
${LDADD.${LIB}}
${LDFLAGS.${LIB}}

OTOH you can't pass parameters to ${CC}, because in suffix rules make(1) only
knows the name of ${.IMPSRC} and ${.TARGET}; it's users' responsivility to
define ${CC} parameters to all the sources of a given ${PROG} / ${LIB}.

Should address bin/42381.

(Bug in this commit log was pointed out by mrg@.)


# 1.243 27-Nov-2009 tsutsui

If CPPFLAGS or CXXFLAGS already contains -nostdinc or -nostdinc++,
don't add ${CPPFLAGS_ISYSTEM} or ${CPPFLAGS_ISYSTEMXX} to refer
${DESTDIR}/usr/include or ${DESTDIR}/usr/include/g++.

This change might cause errors on some MD stand dir, but in that case
each Makefile should be fixed to search proper system include paths
by -Ipath option in own CPPFLAGS.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.242 12-May-2009 plunky

remove libsdp as improved functionality has been enabled in libbluetooth.


# 1.241 10-Apr-2009 apb

Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links. They have no effect except when using a
metalog, in which case the information is added to the metalog. In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg. This should fix PR 24457 and PR 41155.


# 1.240 24-Nov-2008 cube

branches: 1.240.2;
Move cleanextra to the very ends in case another included file wants to add
to it even if it was initially empty.


Revision tags: netbsd-5-base matt-mips64-base2
# 1.239 19-Oct-2008 christos

branches: 1.239.2;
handle assembly files for MKPIE


# 1.238 16-Oct-2008 christos

Provide a way for a program to override the PIE flags.


# 1.237 15-Oct-2008 christos

don't compile/link libraries with pie


Revision tags: mjf-devfs2-base
# 1.236 02-Oct-2008 joerg

Hook up libfetch and pkg_install update.


Revision tags: wrstuden-revivesa-base-3
# 1.235 09-Sep-2008 joerg

Add MKSTRIPIDENT to remove the RCS IDs from binary programs and shared
libraries for space-constraint systems. The description is based on the
feedback of hubertf@, the logic on input from lukem@

This obsoletes the removal of LIBC_SCCS and SYSLIBC_SCCS for libc builds.


Revision tags: wrstuden-revivesa-base-2
# 1.234 28-Aug-2008 mrg

update a comment example


# 1.233 27-Aug-2008 rtr

use ${X11USRLIBDIR} instead of hard-coded /usr/X11R6/lib when building
${LIB.foo} vars


# 1.232 27-Aug-2008 lukem

Fix problem I introduced in rev 1.231 on 2008/08/25 where ${_PROGLDOPTS}
and -L${_GCC_LIBGCCDIR} were appearing in the link line before ${LDADD},
so -L${DESTDIR}/lib and -L${DESTDIR}/usr/lib were being used before
local -L library paths.
Fixes ntpd/ntpdate failure noticed by Valeriy E. Ushakov <uwe@NetBSD.org>


# 1.231 25-Aug-2008 lukem

Always link with: -Wl,-rpath-link,${DESTDIR}/usr/lib -L${DESTDIR}/usr/lib
Fixes problem with MKDYNAMICROOT=no triggered by libraries that depend
on other libraries.
Related to PR 33503.

Clean up setting of _CCLINK to always add the appropriate -B options.

Simplify the link rule for a program.


# 1.230 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.229 28-May-2008 lukem

add LIBLDAR_R (for completeness)


# 1.228 22-May-2008 lukem

Add MKLDAP, USE_LDAP, LIBLBER, LIBLDAP


Revision tags: hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-pf42-base
# 1.227 10-Apr-2008 tsutsui

branches: 1.227.2; 1.227.4;
Add libhx509 to PAM_STATIC_LDADD which is required by libkrb5.


# 1.226 22-Mar-2008 mlelstv

branches: 1.226.2;
Import Heimdal-1.1


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase matt-armv6-base hpcarm-cleanup-base
# 1.225 26-Dec-2007 jmmv

Make the clean target work when OBJS is set but PROG is not, as happens
for example in gnu/lib/crtstuff4. Reported by drochner@.


Revision tags: cube-autoconf-base
# 1.224 13-Nov-2007 jmmv

Fix typo that prevented MKDEBUG builds to work. Found by drochner@.


# 1.223 12-Nov-2007 jmmv

Add the ability to build multiple programs from a single directory

This adds support for a new set of variables, PROGS and PROGS_CXX, that
allow the developer to build multiple different programs from a single
source directory.


# 1.222 04-Nov-2007 tls

Remove MKPRIVATELIB from BIND libraries; move library reachover
directories and Makefiles from src/usr.sbin/bind to src/lib; make
BIND libraries build shared. Saves about 1MB-1.5MB per installed
executable, about 5MB for a base+etc minimal installation of NetBSD.


Revision tags: matt-mips64-base
# 1.221 29-Jul-2007 joerg

branches: 1.221.4; 1.221.6;
Add build glue for libarchive and update the various sets.


# 1.220 25-Jan-2007 perry

Before I completely forget the issue, convert "PROG_PAX" to the
better-named "PAXCTL_FLAGS".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.219 11-Nov-2006 christos

don't run paxctl if other commands were specified for that target.


# 1.218 10-Nov-2006 christos

if ${PROG_PAX} is defined, run paxctl on the binary after linking with
the value of the variable. This way, if you set:

PROG_PAX=+M

in /etc/mk.conf, you get what you deserve.


# 1.217 22-Oct-2006 pooka

libpuffs


# 1.216 09-Oct-2006 mrg

- clean up some comments to reality.
- retire LIBDCK, LIBG2C and (long broken) USE_LIBSTDCXX
- in bsd.hostprog.mk's LIBSTDCPP -> LIBSTDCC
- add LIBSUPCXX
- don't default USE_LIBSTDCXX or USE_GCC4 since they are
not used in the tree any where
- same with USE_XF86_4; retire it
- remove _SUPCXX handling in bsd.prog.mk

inspired by PR#26714.


Revision tags: abandoned-netbsd-4-base
# 1.215 23-Jul-2006 lukem

Implement MKDEBUG:
If "no", don't build and install separate debugging symbols
into /usr/libdata/debug.
Default: no


# 1.214 19-Jun-2006 gdamore

Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.


# 1.213 09-Jun-2006 christos

PR/33681: Scott Ellis: Building 'bc' with SHAREDSTRINGS=yes fails
We need CPPFLAGS too now.


# 1.212 11-May-2006 mrg

add support for ${OBJCOPTS} and ${OBJCOPTS}.<lib|prog|fn>.


# 1.211 20-Mar-2006 christos

There is always one more KRB4 thing to remove. (from Jukka Salmi)


# 1.210 20-Mar-2006 christos

Remove krb4 variables and libraries (Jukka Salmi)


# 1.209 16-Mar-2006 jwise

Now that we have real build system support for syspkgs, remove someone's
half-implemented idea of building `syspkgs' (really a few giant blobs of the
same granularity of the old sets) using install(1).


# 1.208 20-Jan-2006 christos

Add the world of libraries to the static pam build. Now static pam binaries
work.


# 1.207 09-Apr-2005 dsl

Report when we link a program into xxx.ro (before being crunched)


Revision tags: netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.206 04-Mar-2005 he

branches: 1.206.2; 1.206.4;
Introduce PAM_STATIC_LDADD and PAM_STATIC_DPADD. When compiling
with MKPIC=no, possibly because the target does not support shared
libraries, these include libraries required to resolve all symbols
which end up referenced from PAM-using applications. The libraries
presently required are -lcrypt, -lrpcsvc and -lutil.

Add use of these variables which are currently set up to use PAM,
so that they compile when MKPIC=no.

Also, in the telnetd case, reorder the order of the libraries, so
that libtelnet.a comes before -ltermcap and -lutil, again to fix
link error when MKPIC=no.

Discussed with thorpej and christos.


# 1.205 20-Feb-2005 christos

Add libradius


# 1.204 12-Jan-2005 lukem

If RESCUEDIR is defined, automatically add that to CPPFLAGS


# 1.203 08-Jan-2005 lukem

Implement <bsd.prog.mk> vars:
LIBASN1 LIBBSDMALLOC LIBG2C LIBPAM LIBSSH


# 1.202 04-Aug-2004 lukem

Revert most of previous, and move the LIB<libname>?= assignments
back to bsd.prog.mk from bsd.own.mk.

pkgsrc uses <bsd.own.mk>, and setting LIB<libname> in it causes
problems with various package builds.
This should fix PR #26542 submitted by Jim Bernard.

(I'll be implementing the DPADD for shared libraries in a different
manner that generally won't depend upon ${LIB<libname>}.)


# 1.201 30-Jul-2004 lukem

Move the LIB<libname>?= assignments from bsd.prog.mk to bsd.own.mk so
that they may be used by non PROGs (e.g., LIBs).

Improve some comments.


# 1.200 10-Jun-2004 lukem

Be consistent in handling YHEADER, similar to Christos' fix in bsd.lib.mk 1.253


# 1.199 21-May-2004 ross

If you add a library, you need to define its DPADD symbol here.

Add LIBMAGIC.


Revision tags: netbsd-2-0-base
# 1.198 15-Feb-2004 skrll

branches: 1.198.2;
Be more gcc like in the way we deal with libgcc so that sh3/hppa millicode
and exception handling have a chance of working properly.

- creates libgcc, libgcc_eh and libgcc_s

- updates LIBGCC_SPEC to use them appropriately.

There's a hack in here at the moment with respect to libgcc_so in that it
is preferable to link against libgcc_so will only when -shared-libgcc is
specified (the c++ frontend does this automatically.) Configurations where
LINK_EH_SPEC is defined already do this. The gcc configuration for
NetBSD/alpha and another NetBSD platform (I forget which) actually define
LINK_EH_SPEC probably by accident rather than design.

- updates share/mk to use the compiler's knowledge of what needs linking into
libraries and executables. This removes an hppa hack.

- updates the sets for the newly created libgcc* files.

- support for linking against the _pg version of libgcc has been removed.


# 1.197 29-Jan-2004 lukem

Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.


# 1.196 27-Jan-2004 lukem

Replace
:M-[IDU]*
with
:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)


# 1.195 23-Jan-2004 simonb

crt0.o lives in /usr/lib even on a.out.


# 1.194 16-Nov-2003 lukem

simplify with _MKTARGET_LINK


# 1.193 11-Nov-2003 dsl

Set MKDEP_SUFFIXES to get additional targets in .depend instead of using
sed in .afterdepend. I don't think .afterdepend is used anywhere any more.


# 1.192 21-Oct-2003 lukem

Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.


# 1.191 19-Oct-2003 lukem

Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} " ... {$.TARGET}" and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO


# 1.190 18-Oct-2003 lukem

Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command ("verbose")
This is the default, and is equivalent to the previous behaviour.


# 1.189 29-Sep-2003 lukem

Add LIBSTDCXX (for usr/lib/libstdc++.a).
Sync LIB* documentation with reality.


# 1.188 19-Sep-2003 martin

Drop explicit medlow model and default to -O2 for sparc64.


# 1.187 14-Sep-2003 lukem

Check ${SHLIBDIR} against "/usr/lib" instead of ${LIBDIR} when determining
if we need to add stuff (usually "/lib") to the rpath-link path before
"/usr/lib". Otherwise, this barfs if LIBDIR != /usr/lib or /lib, and
we're cross-building (e.g., in src/x11)


# 1.186 13-Sep-2003 erh

Also support per-program LDFLAGS and LDSTATIC.


# 1.185 13-Sep-2003 erh

Create a way to add additional flags to COPTS, CPPFLAGS, CXXFLAGS and LDADD
for particular libraries or programs by specifying the additions in mk.conf
instead of needing to go edit individual Makefiles.


# 1.184 12-Sep-2003 lukem

add infrastructure to support reach-over builds of xsrc


# 1.183 22-Aug-2003 dsl

Add a ${PROG}.ro target that does an 'ld -r' of the program object files.
Allows a much simplified build of 'crunched' binaries since crunchgen can
build prog.ro instead of having to deretmine the names of all the .o files.


# 1.182 01-Aug-2003 lukem

Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".


# 1.181 01-Aug-2003 lukem

simplify the ${PROG}: target to reduce duplication between the DESTDIR
and !DESTDIR cases...


# 1.180 31-Jul-2003 lukem

bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.


# 1.179 31-Jul-2003 lukem

Don't need -R/usr/lib; it will be searched at the end by ld.elf_so anyway.
Noted by matt green <mrg@>


# 1.178 28-Jul-2003 lukem

be consistent when adding *.y and *.l to DPSRCS


# 1.177 28-Jul-2003 lukem

replace MKCXXSUPCXX(!=no) with USE_LIBSTDCXX(==no)


# 1.176 28-Jul-2003 lukem

Change defined(CXX_SUPCXX) to MKCXXSUPCXX != "no".

Clarify that command-line overrides of the MKxxx variables should be
done via the environment rather than make(1) command-line variable
assignment, since the latter doesn't actually work as intended.


# 1.175 27-Jul-2003 mrg

introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes. for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)


# 1.174 26-Jul-2003 mrg

add a new bsd.own.mk variable: CXX_SUPCXX. from bsd.README:
+ CXX_SUPCXX If defined, the support libraries needed for this C++ program
+ are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.


# 1.173 20-Jul-2003 lukem

Consistently support the different C++ file extensions: .cc .cpp .cxx .C
Noted by Andrew White in PR toolchain/18246


# 1.172 18-Jul-2003 lukem

Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was defined.
Replace defined(UNPRIVED) tests with ${MKUNPRIVED} != "no"

Add MKUPDATE; if not no has the same semantics as if UPDATE was defined.
Replace defined(UPDATE) tests with ${MKUPDATE} != "no"

Improve documentation for these and other make flags.


# 1.171 16-Jul-2003 itojun

stop installing install libtelnet. build under lib/libtelnet and reference
it from usr.bin/telnet and libexec/telnetd.
(reason for separate build: compiler flags)


# 1.170 27-Jun-2003 drochner

For consistency, use "-R" instead of "-Wl,-rpath" to pass
a runtime search path to the linker.


# 1.169 13-Jun-2003 itojun

define LIBEVENT


# 1.168 11-Jun-2003 msaitoh

catch signal 1,2,3,13 and 15 to clean /tmp/_dependXXX


# 1.167 31-May-2003 thorpej

If EXTERNAL_TOOLCHAIN is defined, allow the compiler to define the
location of crt{begin,end}{,S}.o and libgcc.a. Encapsulate all of
this logic into the new bsd.gcc.mk, and use it in bsd.prog.mk and
bsd.lib.mk.


# 1.166 18-May-2003 lukem

make this a no-op if HOSTPROG is defined


# 1.165 30-Mar-2003 thorpej

If MACHINE_ARCH is powerpc and we HAVE_GCC3, add crtsaveres.o to the
endfile spec.


# 1.164 22-Feb-2003 uwe

Typo in comment.


# 1.163 24-Jan-2003 thorpej

Add LIBPTHREAD, LIBPTHREAD_DB, and LIBRT.


Revision tags: fvdl_fs64_base
# 1.162 22-Nov-2002 thorpej

Split crtbegin/crtend into crti/crtbegin/crtend/crtn. NetBSD-specific
things like the .note.netbsd.ident section are provided by crti/crtn.
crti/crtn also provide the _init() and _fini() routines.

crtbegin/crtend now only provide support for ctors/dtors. This paves
the way to using the "crtstuff" provided with GCC (when we upgrade to
GCC 3.3), which provides, among other things, much better C++/Java
exception handling.


# 1.161 12-Nov-2002 itohy

MKDYNAMICROOT for a.out


# 1.160 22-Oct-2002 perry

Pass 1 of SYSPKG changes to automatically add tags=pkgname_pkg to METALOG.
Not quite ready for prime time yet.


# 1.159 27-Sep-2002 thorpej

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.


# 1.158 26-Sep-2002 itojun

MDC2 is a patented algorithm; don't ship it in default libcrypto.
MKCRYPTO_MDC2 will build a separate library, libcrypto_mdc2.


# 1.157 08-Sep-2002 thorpej

Build a .gdbinit in the objdir when building a program. The .gdbinit
file sets the shared library prefix to ${DESTDIR}, and adds "sources"
directives for each file listed in the GDBINIT Makefile variable.


# 1.156 09-Aug-2002 thorpej

Add LIBPMC.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.155 27-Mar-2002 eeh

branches: 1.155.2;
Use the medium low model for sparc64 programs that don't 2GB of data segment.


# 1.154 11-Feb-2002 mycroft

Don't use .PHONY for targets that are actually installed. Instead use force
dependencies. (Among other things, `make -t install' does something vaguely
sensible now.)


# 1.153 07-Feb-2002 pk

Mark installed system libraries as .MADE only if we're actually establishing
their default variable values here.


# 1.152 04-Feb-2002 christos

s/.NOSUFF/.MADE/


# 1.151 03-Feb-2002 christos

Apply a .NOSUFF: directive to targets we don't want to have processed by
the suffix rules engine.


# 1.150 02-Feb-2002 veego

Ups, it is LIBUSBHID and not LIBUSBHIB.


# 1.149 02-Feb-2002 veego

Change LIBUSB to LIBUSBHIB, reflecting the library name change.


# 1.148 29-Jan-2002 enami

Mark the targets clean{extra,objs} as PHONY.


# 1.147 04-Jan-2002 thorpej

For PROG_CXX DESTDIR builds, pull in -lstdc++ and -lm regardless
of GCC version.


# 1.146 01-Jan-2002 thorpej

Per a suggestion from matthew green, PROG_CXX takes the place of
PROG for C++ programs.


# 1.145 01-Jan-2002 thorpej

* If PROG_CXX is set by the program's Makefile, use ${CXX} to link
the program rather than ${CC}.
* If HAVE_GCC3 is defined, pull in "-lstdc++ -lm" as additional C++
support libraries for DESTDIR builds.


# 1.144 28-Dec-2001 lukem

* 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


# 1.143 28-Nov-2001 tv

If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.


# 1.142 19-Nov-2001 thorpej

Use a little transitional hack to determine if we use -isystem
or -idirafter. Use the former only of USE_NEW_TOOLCHAIN, since
-isystem causes the old toolchain to bomb out when building
libstdc++.


# 1.141 14-Nov-2001 tv

C/..$/.c/ -> C/\..$/.c/


# 1.140 14-Nov-2001 tv

Move the DESTDIR-based nostdinc logic to bsd.lib.mk and bsd.prog.mk where
it belongs (with the native target compile rules).


# 1.139 02-Nov-2001 tv

Use INSTALL_FILE/INSTALL_DIR as appropriate.


# 1.138 02-Nov-2001 tv

Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.


# 1.137 19-Oct-2001 tv

Add .NOPATH for all files generated from .l or .y files in SRCS. Fixes PRs
bin/14187 and lib/14239.

Also simplify the handling of these transforms to .c and .h files a bit by
leveraging make's builtin macro operators.


# 1.136 25-Sep-2001 tv

Set .NOPATH on program to build to make sure it goes in .OBJDIR.
Problem noted by <seebs@plethora.net>.


# 1.135 24-Sep-2001 lukem

fix previous (hi thor!) - $OBJS and $CLEANFILES might be empty, and
rm needs some files to delete...


# 1.134 24-Sep-2001 tls

Split "cleanprog" target apart: now you can zap only object files or
CLEANFILES (needed to fix crunchgen lossage).


# 1.133 13-Sep-2001 thorpej

Add LIBPCI.


# 1.132 14-Aug-2001 tv

Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").


# 1.131 01-Jun-2001 tv

Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).


# 1.130 08-May-2001 sommerfeld

Suppress duplicate entries in ALLFILES, FILES, INCS, DEPINCS, INFOFILES,
NLSALL, CATPAGES, MANPAGES, HTMLPAGES, and SCRIPTS.


# 1.129 19-Feb-2001 jmc

Wrap target() checks around afterdepend rule as some Makefiles override this


# 1.128 26-Jan-2001 itojun

fix typo in LIBSSL decl. it made programs with DPADD+=${LIBSSL} to build
every time we type "make". From: bernd


# 1.127 14-Jan-2001 christos

use the new .if commands(<target>) directive so that we don't have to
change Makefiles.


# 1.126 14-Jan-2001 christos

fix thinko: test for the existance of the target before we define it...


# 1.125 14-Jan-2001 christos

Alter previous redefined target protection. If the ${PROG} target is defined,
add the dependencies as usual, but don't add the commands. This avoids
having to change all the Makefiles that redefine the PROG target.


# 1.124 14-Jan-2001 christos

allow programs to override the program target.


# 1.123 08-Jan-2001 mrg

add missing $LIBCRYPTO_RC5 and $LIBCRYPTO_IDEA


# 1.122 08-Jan-2001 mrg

add missing $LIBSSL


# 1.121 04-Jan-2001 garbled

Add LIBCDK and LIBFORM definitions


# 1.120 31-Oct-2000 itojun

add ${LIBINTL} for use with DPADD.


# 1.119 07-Oct-2000 deberg

fix typos, PR 11159


# 1.118 25-Jun-2000 erh

For the case when DESTDIR is set: move the -L${DESTDIR}/usr/lib after ${LDADD} so any -L directories set in LDADD are searched first to avoid possibly linking against old versions of libraries.


Revision tags: netbsd-1-5-base
# 1.117 19-Jun-2000 thorpej

branches: 1.117.2;
Sync up the LIB* list.


# 1.116 10-Jun-2000 mycroft

Use ${.ALLSRC:T} when doing the generated variable name lookups, so that it
DTRT for generated files in and obj directory (or accessed via .PATH).


# 1.115 06-Jun-2000 mycroft

Abuse .USE some more.


# 1.114 06-Jun-2000 mycroft

Minor rearrangement.


# 1.113 06-Jun-2000 mycroft

Use ODE make(1) features to eliminate extra variables and move several things
outside of .for loops. (Needs more work to completely eliminate .for.)

XXX Don't look at this stuff. It will make your head hurt.


Revision tags: minoura-xpg4dl-base
# 1.112 14-Apr-2000 mrg

branches: 1.112.2;
use -rpath-link rather than -R when linking objects using a DESTDIR.
this replaces the previous change as that ended up adding
$DESTDIR/usr/lib to the runtime path of every binary created, which
is bogus and dangerous.


# 1.111 25-Mar-2000 mycroft

When linking with $DESTDIR, use an explicit -R to get library dependencies
correct.


# 1.110 07-Mar-2000 veego

Remove unused libahdi.
It will be replaced in the future with a more generic libdisklabel.


# 1.109 05-Feb-2000 jdc

Add libahdi entries.


# 1.108 23-Jan-2000 eeh

Add some support for FCode binaries.


# 1.107 22-Jan-2000 mycroft

Make `dependall' play nicely with SUBDIR, using a hack similar to `realinstall'
for both `depend' and `all'.
Also, remove the old hack that invokes an extra shell for .depend, now that
make(1) has been fixed.


# 1.106 16-Jan-2000 assar

all: depend on ${SCRIPTS} so that they get generated if they need to


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.105 23-Nov-1999 blymn

Added libmenu library.


Revision tags: comdex-fall-1999-base
# 1.104 14-Sep-1999 perry

branches: 1.104.4;
Add a "dependall" target, which does a "make depend" and then "make all"
in a single directory. This is useful in "make build" because by doing
the build immediately after the depend, all sources will typically
still be in the buffer cache, thus saving significant time over doing
a "make depend" on all the directories and then a "make all".


# 1.103 04-Sep-1999 fredb

Permit "make all install", as well as "make foo install" (where foo would be
installed by "make install") without setting of BUILD. All cases where BUILD
is already set are unchanged from the old behavior.

"make all install" is now practically equivalent to "make BUILD= all install",
but without actually setting build.

Fixes pr's 8313, 3894.


# 1.102 21-Aug-1999 simonb

Add ${INSTPRIV} to ${INSTALL} commands.


# 1.101 01-Jul-1999 itojun

branches: 1.101.2;
add LIBIPSEC for use from DPADD.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.100 12-Feb-1999 lukem

branches: 1.100.2;
* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.99 10-Feb-1999 tv

libbfd_pic.a is no longer installed; remove ${LIBBFD} define.


# 1.98 04-Feb-1999 christos

PR/2936: Brian C. Grayson: Avoid truncating precious files when installing
and the filesystem is full. Added ${RENAME} flag to install, which when set
to -r installs on a temporary file and then renames to the final destination.
${RENAME} is currently set to nothing in bsd.own.mk, but one can turn it
on in /etc/mk.conf.


# 1.97 07-Nov-1998 jonathan

Do DESTDIR support for crtbegin/crtend on all ELF ports (adds mips).


# 1.96 28-Sep-1998 christos

Use preserve flag in install.


# 1.95 10-Sep-1998 ross

Define a LIBBZ2?=... for use in DPADD=... lines.


# 1.94 09-Aug-1998 lukem

add distclean as a synonym for cleandir


# 1.93 09-Apr-1998 tv

.y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.


# 1.92 01-Apr-1998 tv

Revert. This broke too much in the build tree, and a better solution
needs to be created. (The existing situation breaks a lot too.)


# 1.91 01-Apr-1998 tv

Fix .y rules to DTRT with possibly generated .h files. See mail on
tech-toolchain for a very detailed explanation of this. In short, add
a .y.h rule identical to the .y.c rule and make the .y.c rule rename
the .h file; also, clean the .h file in CLEANFILES.


# 1.90 03-Nov-1997 cgd

echo the lint command line when making 'lint'.


# 1.89 28-Oct-1997 lukem

add ${LIBOBJC}


Revision tags: netbsd-1-3-base
# 1.88 11-Oct-1997 mycroft

branches: 1.88.2;
Several changes:
* Allow bsd.man.mk to be included separately.
* Always include bsd.own.mk and bsd.obj.mk.
* Include bsd.man.mk and bsd.nls.mk even if NOMAN or NONLS; just turn off
building of the affected files instead.
* Require bsd.subdir.mk to be included explicitly.
(Will make appropriate changes to Makefiles shortly.)


# 1.87 29-Sep-1997 gwr

Add $LIBBFD


# 1.86 31-May-1997 cjs

Back out BUILDDIR and NOINSTALL changes.


# 1.85 26-May-1997 cjs

branches: 1.85.2;
These updates to the build allow building against include files
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.


# 1.84 18-May-1997 kleink

Add libposix.


# 1.83 17-May-1997 mycroft

Do LINKS and SYMLINKS after FILES and INCS.


# 1.82 17-May-1997 mycroft

Remove unneeded .SUFFIXES lines, and move .s and .S closer to .o to give the
right preferences.


# 1.81 09-May-1997 mycroft

Fix typo in previous.


# 1.80 09-May-1997 mycroft

Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.79 09-May-1997 mycroft

Remove cruft.


# 1.78 09-May-1997 mycroft

Oops; rearrange dependencies to get things built early enough.


# 1.77 09-May-1997 mycroft

Make sure INCS and SRCS are built if necessary.


# 1.76 08-May-1997 gwr

Set the .NOPATH flag for ${OBJS} (from Christos).


# 1.75 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.74 07-May-1997 mycroft

Various simplifications.


# 1.73 07-May-1997 mycroft

Shuffle some .PHONYs around, to work better with `-t'.


# 1.72 06-May-1997 mycroft

Make most of the install targets .PRECIOUS.


# 1.71 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.70 18-Apr-1997 christos

Add ${LIBNTP}


# 1.69 17-Apr-1997 thorpej

- Properly depend on crtbegin.o and crtend.o for platforms that use
them (currently Alpha and PowerPC)
- STRIP -> STRIPFLAG


# 1.68 03-Apr-1997 mikel

don't allow override of all: target


# 1.67 29-Mar-1997 mikel

merge lite-2 changes (mostly SCCSids)


# 1.66 27-Mar-1997 christos

Put the FILES generated rules in a separate .mk file since both bsd.prog.mk
and bsd.lib.mk use them.


# 1.65 27-Mar-1997 mycroft

Make the SCRIPTS case mimic the FILES case more closely, so we can override
the destination direectory, etc.


# 1.64 27-Mar-1997 mycroft

Remove knowledge of HIDEGAME from here.


# 1.63 24-Mar-1997 christos

make rules update:
- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation


# 1.62 22-Mar-1997 perry

Fix SYMLINKS not to include DESTDIR in the link itself


# 1.61 13-Mar-1997 perry

add SYMLINKS, by analogy to LINKS. Vetted by Christos.


# 1.60 22-Jan-1997 cgd

if 'clean' is not already defined, rather than simply defining it with
a bunch of rules, define a clean{kmod,lib,prog} target with the rules,
and have both clean and cleandir depend on that. That eliminates a bug
where 'cleandir' in a directory which included e.g. bsd.prog.mk but which
also had subdirs would 'make clean' all the subdirs and then 'make cleandir'
all ofthe subdirs. It also allows Makefiles to add more dependencies
to 'clean' after inclusion of the make template.

If 'clean' is already defined, the behaviour is the same as it used to be.


# 1.59 20-Dec-1996 cgd

add an afterdepend target (a la the one in bsd.lib.mk) that processes
the .depend file to add <filename>.ln for each <filename>.o as an
object file which has the given dependencies (in addition to
<filename>.po and <filename>.so, which were already there).


# 1.58 13-Dec-1996 mikel

add missing LIBPCAP definition.


# 1.57 26-Nov-1996 mrg

add libz and libwrap


# 1.56 18-Oct-1996 thorpej

Use ${INSTALL} rather than "install".
From Simon J. Gerraty <sjg@zen.void.oz.au>, PR #1458.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.55 08-Apr-1996 jtc

Sort LIBFOO definitions and add LIBY; Reported by Mike Long <mike.long@analog.com> in PR #2301.


# 1.54 22-Oct-1995 christos

Added include file <bsd.sys.mk> that contains lex and yacc "parallel aware"
rules. These rules are not turned on by default; they are enabled by setting
the PARALLEL variable.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.53 25-Jun-1995 cgd

oops; fix an rm that might be empty


# 1.52 24-Jun-1995 cgd

update lint rules, but keep linting disabled


# 1.51 10-Jun-1995 mycroft

Define LIBEDIT.


# 1.50 21-Apr-1995 jtc

.include <bsd.nls.mk> unless NONLS is defined.


# 1.49 22-Dec-1994 cgd

specify man pages differently, and document how.


# 1.48 24-Aug-1994 mycroft

Include bsd.own.mk earlier.


# 1.47 20-Jul-1994 cgd

fix from christos, for progs w/o objects


Revision tags: netbsd-1-0-base
# 1.46 06-Jul-1994 mycroft

branches: 1.46.2;
Pull libraries from ${DESTDIR} if set. Kill LDONLY, which is unused and
probably not useful anyway.


# 1.45 30-Jun-1994 cgd

fix modify-info-nothingness-then-substitute probelm that broke genclass build


# 1.44 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.43 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.42 28-Jun-1994 jtc

Strip *.sh when constructing OBJS from SRCS.
This will allow us to clean up makefiles that build a script by munging
a template (uusched, genclass, neqn, etc.).


# 1.41 18-Jun-1994 cgd

don't chown the symlink, when HIDEGAME causes a symlink to be made to dm.
4.4-based FS code _follows_ the symlinks on a chown(2) call.


# 1.40 24-May-1994 cgd

fix the last to do the right thing for dependencies


# 1.39 24-May-1994 deraadt

LIBSKEY


# 1.38 22-May-1994 jtc

Single source file programs are now compiled into object files before they
are linked. This change halves the time it takes to rebuild all of the
NetBSD sources when only the C library is "touched"; but only takes about
one percent more disk space.


# 1.37 06-Apr-1994 chopps

relink (recompile) single source programs when crt0.o is updated.


# 1.36 24-Mar-1994 mycroft

Remove *.core on clean.


# 1.35 09-Feb-1994 cgd

kill install -d's.


# 1.34 28-Jan-1994 cgd

add LIBKVM


# 1.33 10-Nov-1993 cgd

librpc doesn't exist anymore


# 1.32 08-Nov-1993 cgd

ad LDSTATIC flag, so static linking can be made one-stop shopping.
use "setenv LDSTATIC" to make *everything* dynamically linked,
setenv LDSTATIC -static for everything statically linked, or unset
it for default behavior.


# 1.31 07-Oct-1993 cgd

LIBTERM pointed at nothing, but was meant to point to libtermcap.a...


# 1.30 07-Oct-1993 cgd

always define LIBCRYPT


# 1.29 17-Aug-1993 mycroft

Make sure we don't recurse into subdirectories if Makefile specified `install'
target. (It's usually blank and is specifically to avoid doing this...)


# 1.28 15-Aug-1993 mycroft

Automatically include bsd.subdir.mk for backward compatibility.


# 1.27 15-Aug-1993 mycroft

Don't automatically include bsd.subdir.mk in bsd.prog.mk and bsd.lib.mk.
Put back .MAIN in bsd.man.mk, and be careful not to include ../Makefile.inc
a second time.


# 1.26 15-Aug-1993 mycroft

Move man rules to sys.mk.
Use bsd.subdir.mk for building subdirectories.
Don't forget to remove x.cc and x.C when using SHAREDSTRINGS.
Make ${PROG} always depend on ${LIBCRT0}.
Don't duplicate code between cleandir and clean.
Move tags target to bsd.dep.mk.
Move STRIP to bsd.own.mk.
Remove redundant definitions of {BIN,MAN}{DIR,GRP,OWN,MODE}.
Move {LIB,DOC}{DIR,GRP,OWN,MODE} defaults to bsd.own.mk.


# 1.25 15-Aug-1993 mycroft

Abstract out dependency stuff, and add RCS identifiers.


# 1.24 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


# 1.23 10-Aug-1993 mycroft

Put LINKS handling in `install' target, so it's the last thing executed, and
happens even if `realinstall' is user-defined.


# 1.22 30-Jul-1993 mycroft

When generating a default OBJS, ignore .h files.


# 1.21 29-Jul-1993 mycroft

Don't print the `making ...' message if an obj dir already exists.
Also, a minor cleanup.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.20 17-Jul-1993 mycroft

Fix C++ dependencies for good. `make depend' is now done in two passes--one
of C files and one for C++ files. No need to specify `-+' in your Makefile,
as it is now done automatically.


# 1.19 17-Jul-1993 cgd

do c++ dependencies the right way...


# 1.18 17-Jul-1993 mycroft

Add suffix rules for C++ files.


# 1.17 04-Jun-1993 brezak

Add LIBRPCSVC variable.


# 1.16 02-Jun-1993 cgd

add ability to specify c++ dependencies, by setting CFLAGS+=-+ for
the dependency make.


# 1.15 26-Apr-1993 cgd

added definition for DPADD library variable LIBCRYPT.


# 1.14 26-Apr-1993 mycroft

Don't redefine `realinstall' target if already defined.


# 1.13 25-Apr-1993 mycroft

Link with LDFLAGS even if one source module.


# 1.12 25-Apr-1993 mycroft

Don't lose if we include bsd.prog.mk only to build man pages.


# 1.11 25-Apr-1993 mycroft

Fix error in last change. (Oops.)


# 1.10 25-Apr-1993 mycroft

Don't build man pages if NOMAN set.


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.9 09-Apr-1993 cgd

various changes to default make rules. from patch 101.
note that only the "sensible" changes in patch 101 are implemented.


# 1.8 08-Apr-1993 cgd

try to do the right thing, in terms making directories before we
install into them, and get the manpage cleans _OUT_ of "clean".
they don't belong there, only in cleandir, WFJ be damned.


# 1.7 08-Apr-1993 cgd

fixed typos...


# 1.6 08-Apr-1993 cgd

(silently) make sure we have directories before installing


# 1.5 04-Apr-1993 cgd

make LIBRPC point to the right place


# 1.4 27-Mar-1993 nate

Fixed the doc macros to call troff, eqn,and tbl instead of ditroff,
deqn, and dtbl.
Fixed make clean to remove the man pages (Bill fixed this in the distribution,
but not in the original source)
Changed install to leave the original file around, by using 'cp' instead of
'mv'. "install -c ..."


# 1.3 23-Mar-1993 cgd

made .CURDIR be absolute, not relative, thereby eliminating
the need for some of the makefile trickery when making objects,
and fixing a few .PATH bugs


# 1.2 22-Mar-1993 cgd

fixed "make obj" for cases when sources not in /usr/src/...
if sources not there, it now mkdirs obj, but some trickery
is necessary, to avoid deleting cwd.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.310 11-Dec-2017 christos

Instead of checking for obj existance which can be empty for shuttle-rule
programs, check for .sh sources.


# 1.309 10-Dec-2017 christos

don't try to build .debug files for shell scripts.


# 1.308 10-Oct-2017 christos

Add general {DP,LD}ADD.rump variables


Revision tags: matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base
# 1.307 21-May-2017 riastradh

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.


# 1.306 21-May-2017 riastradh

Remove some vestiges of MKCRYPTO_IDEA/MKCRYPTO_MDC2.


# 1.305 21-May-2017 riastradh

Remove MKCRYPTO_RC5. Unconditionally include RC5 in libcrypto.so.

This option existed only because RC5 is covered by patents that, twenty
years ago, we had reason to suspect the patent holder, RSA, Inc., might
litigate. The two US patents in question are 5,724,428 and 5,835,600.

According to the USPTO Patent Term Calculator web site at
<https://www.uspto.gov/patent/laws-and-regulations/patent-term-calculator#heading-5>
(retrieved 2017-05-21), patents filed after 1995-06-07 expire twenty
years after the filing date.

number filing date
5,724,428 1995-11-01
5,835,600 1997-04-21

Thus, these patents appear to be expired.

As proposed on tech-crypto and tech-security:

https://mail-index.netbsd.org/tech-crypto/2017/05/05/msg000718.html
https://mail-index.netbsd.org/tech-security/2017/05/05/msg000927.html


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.304 19-Apr-2017 joerg

Add netpgpverify to the library list.


Revision tags: pgoyette-localcount-20170320
# 1.303 20-Feb-2017 rin

add missing LIBCXX


# 1.302 08-Feb-2017 kamil

libpthread_dbg(3) deletion from the base distribution

libpthread_dbg(3) is a remnant library from the M:N thread model
(pre-NetBSD-5.0) API to introspect threads within a process and for use
of debuggers.

Currently in the 1:1 model it's not used in GDB neither in LLDB and it's
not either planned to be used. It's current function to read pthread_t
structures is realizable within a regular debugger capable to
instrospect objects within a tracee (GDB, LLDB...).

Remaining users of this API can still use this library from
pkgsrc/devel/libpthread_dbg.

Sponsored by <The NetBSD Foundation>


# 1.301 29-Jan-2017 christos

add sqlite3 to statically linked libraries for pam.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914
# 1.300 20-Aug-2016 christos

branches: 1.300.2;
unbound additions


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.299 04-Apr-2016 joerg

branches: 1.299.2;
If the per-target LDSTATIC flag is set, don't include the PIE linker
flags as we currently don't support static PIE.


# 1.298 30-Mar-2016 martin

Pass -pie to cc, not -Wl,-pie. This way we have a chance to fix specs
for obscure corner cases like -pie -fPIE -static (used for
/usr/tests/lib/csu/h_initfini2 if building with MKPIE=yes).
While there also replace -fPIC with -fPIE for the PIE case, even if
it should be mostly equivalent.


# 1.297 12-Mar-2016 mrg

remove conditionals that are always true with GCC >= 4.8.


# 1.296 21-Feb-2016 christos

Add NODEBUG


# 1.295 31-Jan-2016 christos

Introduce NOPIE and NOCTF so that standalone programs build properly.


# 1.294 23-Jan-2016 christos

Define _KERNTYPES for things that need it.


# 1.293 07-Nov-2015 joerg

LIBEXECINFO


# 1.292 07-Jun-2015 matt

Make LIBCRT* depend on the right files if MLIBDIR from MKCOMPAT is defined.


# 1.291 01-Dec-2014 erh

PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilt
if any of their dependencies (i.e. the files they refer to) are changed.
This allows changes to transitive included headers to be handled properly.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.290 25-Mar-2014 ozaki-r

branches: 1.290.4;
Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.


Revision tags: riastradh-drm2-base3
# 1.289 09-Mar-2014 christos

let's see if the new dwarf library can handle dwarf 4


# 1.288 02-Mar-2014 christos

If we are compiling with -g and using gcc4.8 and dtrace downgrade
dwarf generation to version 2 for now.


# 1.287 15-Jan-2014 joerg

-Wl,-pie and -r don't agree with each other, so filter the former out.


# 1.286 11-Nov-2013 joerg

Relink binaries if crti.o changes.


# 1.285 29-Sep-2013 christos

Add libxcb


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.284 31-May-2013 mrg

add LIBX11_XCB; unfortunately since the library is named with a -
in it, we have to use an ugly hard coded assignment for now.
(could be cleaned up with more make variable magic i'm sure.)


# 1.283 04-Apr-2013 christos

ldopts should be before ldadd like everywhere else.


Revision tags: agc-symver-base
# 1.282 14-Feb-2013 christos

Since the libraries are produced with different MK flags than the programs,
we check for existance of the files instead of the MK flags.


# 1.281 14-Feb-2013 christos

Add PROGDPLIBS


# 1.280 26-Jan-2013 christos

CTFCONVERT me harder.


Revision tags: yamt-pagecache-base8
# 1.279 17-Jan-2013 christos

Now that we have separate debug sets, add -g if ${MKDEBUG} is set for
program builds since we don't need to install that symbol files.


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.278 24-Aug-2012 jmmv

branches: 1.278.2;
Allow DPADD to be specified on a per-program basis.


# 1.277 23-Aug-2012 joerg

Revert last, it breaks the tricks xsrc uses.


# 1.276 23-Aug-2012 joerg

Remove SHLIBINSTALLDIR and SHLINKINSTALLLIBDIR. Add rpath entries, if
SHLIBDIR differs from /usr/lib.


# 1.275 08-Aug-2012 christos

add MKRUMP by popular demand.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.274 29-Feb-2012 tron

Move "libexpat" from X11 into base which fixes PR lib/40346.
This change was approved by the Core Group.


# 1.273 21-Feb-2012 matt

Remove another ${SIZE}


# 1.272 20-Feb-2012 matt

Remove ${SIZE}


# 1.271 19-Feb-2012 matt

Add support for --combine with gcc.


Revision tags: netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2
# 1.270 05-Nov-2011 christos

branches: 1.270.2;
Add libtre


Revision tags: yamt-pagecache-base
# 1.269 16-Oct-2011 christos

branches: 1.269.2;
- no need to special-case libraries with weird characters.
- add a note about adding new libraries.


# 1.268 16-Oct-2011 christos

fix list of libraries to reflect reality.


# 1.267 10-Sep-2011 apb

Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.


# 1.266 27-Aug-2011 joerg

Add new "analyze" command to run clang's static analyzer in a directory
on all C/C++ files.


Revision tags: cherry-xenmp-base
# 1.265 26-Apr-2011 he

The new Heimdal adds -lwind and -lheimbase to the set of libraries,
so define the corresponding LIB* variables.
These are also needed in the PAM_STATIC_* variables, so add them there too.


# 1.264 11-Apr-2011 joerg

Adjust --sysroot related usage:
-Wl,-rpath does not expand =, so just drop it.

Drop -Wl,-rpath-link entries that duplicate the -Wl,-rpath entries, this
is done implicitly now that ld is built with sysroot support.

Use ${DESTDIR} explicitly for the remaining -Wl,-rpath-link entries.


# 1.263 10-Apr-2011 joerg

For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.


# 1.262 08-Mar-2011 jmmv

Revert previous (revision 1.261): it broke the build because PROG_CXX is
defined in terms of PROG, so later on we would end up with target duplicates
because both PROG_CXX and PROG were being converted to PROGS_CXX and PROGS.

Did not catch this earlier because the test build I did was not clean and
thus the duplicate targets did not have nasty effects.


# 1.261 07-Mar-2011 jmmv

Always convert PROG to its plural form independently of whether PROG_CXX
is defined or not. From Garrett Cooper in private mail.


Revision tags: bouyer-quota2-nbase
# 1.260 20-Feb-2011 jmmv

Define LIBATF_C and LIBATF_CXX to point to their corresponding .a files and
use these to properly set DPADD for test programs.


Revision tags: bouyer-quota2-base
# 1.259 13-Feb-2011 christos

add saslc


# 1.258 06-Feb-2011 joerg

Don't use -nostdinc or -nostdinc++ if this is included in a HOSTLIB.


# 1.257 17-Jan-2011 pooka

branches: 1.257.2;
Add rump bits to DPSRCS so that update builds work correctly.


Revision tags: matt-mips64-premerge-20101231
# 1.256 13-Dec-2010 pooka

befriend RUMPPRG with CRUNCHEDPRG


# 1.255 13-Dec-2010 pooka

Define RUMPPRG, which is just like PROG, except it additionally
builds a rump client with the name rump.${PROG}. The rump client
is not installed suid/sgid by default even if BINMODE is defined.


# 1.254 10-Dec-2010 joerg

Revert last, gcc(1) checks explicitly for -r on some platforms to disable
passing down --relax as well.


# 1.253 08-Dec-2010 joerg

gcc passes down -r directly to ld, so make it explicitly a linker option.


# 1.252 08-Dec-2010 joerg

Don't depend on ${CC} passing down -R to ld, use -Wl,-rpath explicitly.


# 1.251 08-Nov-2010 lukem

Preserve date on original shared library or program when stripping
the debug symbols and adding the debug-link to .debug.
Use '(rm -f file; false)' in the failure path to force failure.
Based on solution proposed by Nicolas Joly on tech-toolchain in July 2010.
Should fix PR toolchain/44046 from Andreas Gustafsson.


# 1.250 31-Oct-2010 mbalmer

Link Lua to the build and add the resulting files to the distribution sets.
Document the addition of Lua and the change we made to the default settings.


# 1.249 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.248 24-Apr-2010 lukem

When extracting separate debug symbols with MKDEBUG, there's no need
to leave the original file unstripped...


# 1.247 02-Mar-2010 darran

DTrace: Add CTF generation to the make framework. Only enabled when
MKDTRACE=yes.


# 1.246 14-Dec-2009 mrg

use "${CC} -r" not "${CC} -Wl,-r" as the latter fools GCC on some targets
and it ends up passing "-r -relax" to ld, which causes ld to barf.


# 1.245 14-Dec-2009 matt

Merge from matt-nb5-mips64


Revision tags: matt-premerge-20091211
# 1.244 08-Dec-2009 uebayasi

When PROGS / LIBS are used, you can pass each PROG / LIB specific parameters
to ${LD} via:

${LDADD.${PROG}}
${LDFLAGS.${PROG}}
${LDSTATIC.${PROG}}
${LDADD.${LIB}}
${LDFLAGS.${LIB}}

OTOH you can't pass parameters to ${CC}, because in suffix rules make(1) only
knows the name of ${.IMPSRC} and ${.TARGET}; it's users' responsivility to
define ${CC} parameters to all the sources of a given ${PROG} / ${LIB}.

Should address bin/42381.

(Bug in this commit log was pointed out by mrg@.)


# 1.243 27-Nov-2009 tsutsui

If CPPFLAGS or CXXFLAGS already contains -nostdinc or -nostdinc++,
don't add ${CPPFLAGS_ISYSTEM} or ${CPPFLAGS_ISYSTEMXX} to refer
${DESTDIR}/usr/include or ${DESTDIR}/usr/include/g++.

This change might cause errors on some MD stand dir, but in that case
each Makefile should be fixed to search proper system include paths
by -Ipath option in own CPPFLAGS.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.242 12-May-2009 plunky

remove libsdp as improved functionality has been enabled in libbluetooth.


# 1.241 10-Apr-2009 apb

Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links. They have no effect except when using a
metalog, in which case the information is added to the metalog. In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg. This should fix PR 24457 and PR 41155.


# 1.240 24-Nov-2008 cube

branches: 1.240.2;
Move cleanextra to the very ends in case another included file wants to add
to it even if it was initially empty.


Revision tags: netbsd-5-base matt-mips64-base2
# 1.239 19-Oct-2008 christos

branches: 1.239.2;
handle assembly files for MKPIE


# 1.238 16-Oct-2008 christos

Provide a way for a program to override the PIE flags.


# 1.237 15-Oct-2008 christos

don't compile/link libraries with pie


Revision tags: mjf-devfs2-base
# 1.236 02-Oct-2008 joerg

Hook up libfetch and pkg_install update.


Revision tags: wrstuden-revivesa-base-3
# 1.235 09-Sep-2008 joerg

Add MKSTRIPIDENT to remove the RCS IDs from binary programs and shared
libraries for space-constraint systems. The description is based on the
feedback of hubertf@, the logic on input from lukem@

This obsoletes the removal of LIBC_SCCS and SYSLIBC_SCCS for libc builds.


Revision tags: wrstuden-revivesa-base-2
# 1.234 28-Aug-2008 mrg

update a comment example


# 1.233 27-Aug-2008 rtr

use ${X11USRLIBDIR} instead of hard-coded /usr/X11R6/lib when building
${LIB.foo} vars


# 1.232 27-Aug-2008 lukem

Fix problem I introduced in rev 1.231 on 2008/08/25 where ${_PROGLDOPTS}
and -L${_GCC_LIBGCCDIR} were appearing in the link line before ${LDADD},
so -L${DESTDIR}/lib and -L${DESTDIR}/usr/lib were being used before
local -L library paths.
Fixes ntpd/ntpdate failure noticed by Valeriy E. Ushakov <uwe@NetBSD.org>


# 1.231 25-Aug-2008 lukem

Always link with: -Wl,-rpath-link,${DESTDIR}/usr/lib -L${DESTDIR}/usr/lib
Fixes problem with MKDYNAMICROOT=no triggered by libraries that depend
on other libraries.
Related to PR 33503.

Clean up setting of _CCLINK to always add the appropriate -B options.

Simplify the link rule for a program.


# 1.230 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.229 28-May-2008 lukem

add LIBLDAR_R (for completeness)


# 1.228 22-May-2008 lukem

Add MKLDAP, USE_LDAP, LIBLBER, LIBLDAP


Revision tags: hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-pf42-base
# 1.227 10-Apr-2008 tsutsui

branches: 1.227.2; 1.227.4;
Add libhx509 to PAM_STATIC_LDADD which is required by libkrb5.


# 1.226 22-Mar-2008 mlelstv

branches: 1.226.2;
Import Heimdal-1.1


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase matt-armv6-base hpcarm-cleanup-base
# 1.225 26-Dec-2007 jmmv

Make the clean target work when OBJS is set but PROG is not, as happens
for example in gnu/lib/crtstuff4. Reported by drochner@.


Revision tags: cube-autoconf-base
# 1.224 13-Nov-2007 jmmv

Fix typo that prevented MKDEBUG builds to work. Found by drochner@.


# 1.223 12-Nov-2007 jmmv

Add the ability to build multiple programs from a single directory

This adds support for a new set of variables, PROGS and PROGS_CXX, that
allow the developer to build multiple different programs from a single
source directory.


# 1.222 04-Nov-2007 tls

Remove MKPRIVATELIB from BIND libraries; move library reachover
directories and Makefiles from src/usr.sbin/bind to src/lib; make
BIND libraries build shared. Saves about 1MB-1.5MB per installed
executable, about 5MB for a base+etc minimal installation of NetBSD.


Revision tags: matt-mips64-base
# 1.221 29-Jul-2007 joerg

branches: 1.221.4; 1.221.6;
Add build glue for libarchive and update the various sets.


# 1.220 25-Jan-2007 perry

Before I completely forget the issue, convert "PROG_PAX" to the
better-named "PAXCTL_FLAGS".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.219 11-Nov-2006 christos

don't run paxctl if other commands were specified for that target.


# 1.218 10-Nov-2006 christos

if ${PROG_PAX} is defined, run paxctl on the binary after linking with
the value of the variable. This way, if you set:

PROG_PAX=+M

in /etc/mk.conf, you get what you deserve.


# 1.217 22-Oct-2006 pooka

libpuffs


# 1.216 09-Oct-2006 mrg

- clean up some comments to reality.
- retire LIBDCK, LIBG2C and (long broken) USE_LIBSTDCXX
- in bsd.hostprog.mk's LIBSTDCPP -> LIBSTDCC
- add LIBSUPCXX
- don't default USE_LIBSTDCXX or USE_GCC4 since they are
not used in the tree any where
- same with USE_XF86_4; retire it
- remove _SUPCXX handling in bsd.prog.mk

inspired by PR#26714.


Revision tags: abandoned-netbsd-4-base
# 1.215 23-Jul-2006 lukem

Implement MKDEBUG:
If "no", don't build and install separate debugging symbols
into /usr/libdata/debug.
Default: no


# 1.214 19-Jun-2006 gdamore

Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.


# 1.213 09-Jun-2006 christos

PR/33681: Scott Ellis: Building 'bc' with SHAREDSTRINGS=yes fails
We need CPPFLAGS too now.


# 1.212 11-May-2006 mrg

add support for ${OBJCOPTS} and ${OBJCOPTS}.<lib|prog|fn>.


# 1.211 20-Mar-2006 christos

There is always one more KRB4 thing to remove. (from Jukka Salmi)


# 1.210 20-Mar-2006 christos

Remove krb4 variables and libraries (Jukka Salmi)


# 1.209 16-Mar-2006 jwise

Now that we have real build system support for syspkgs, remove someone's
half-implemented idea of building `syspkgs' (really a few giant blobs of the
same granularity of the old sets) using install(1).


# 1.208 20-Jan-2006 christos

Add the world of libraries to the static pam build. Now static pam binaries
work.


# 1.207 09-Apr-2005 dsl

Report when we link a program into xxx.ro (before being crunched)


Revision tags: netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.206 04-Mar-2005 he

branches: 1.206.2; 1.206.4;
Introduce PAM_STATIC_LDADD and PAM_STATIC_DPADD. When compiling
with MKPIC=no, possibly because the target does not support shared
libraries, these include libraries required to resolve all symbols
which end up referenced from PAM-using applications. The libraries
presently required are -lcrypt, -lrpcsvc and -lutil.

Add use of these variables which are currently set up to use PAM,
so that they compile when MKPIC=no.

Also, in the telnetd case, reorder the order of the libraries, so
that libtelnet.a comes before -ltermcap and -lutil, again to fix
link error when MKPIC=no.

Discussed with thorpej and christos.


# 1.205 20-Feb-2005 christos

Add libradius


# 1.204 12-Jan-2005 lukem

If RESCUEDIR is defined, automatically add that to CPPFLAGS


# 1.203 08-Jan-2005 lukem

Implement <bsd.prog.mk> vars:
LIBASN1 LIBBSDMALLOC LIBG2C LIBPAM LIBSSH


# 1.202 04-Aug-2004 lukem

Revert most of previous, and move the LIB<libname>?= assignments
back to bsd.prog.mk from bsd.own.mk.

pkgsrc uses <bsd.own.mk>, and setting LIB<libname> in it causes
problems with various package builds.
This should fix PR #26542 submitted by Jim Bernard.

(I'll be implementing the DPADD for shared libraries in a different
manner that generally won't depend upon ${LIB<libname>}.)


# 1.201 30-Jul-2004 lukem

Move the LIB<libname>?= assignments from bsd.prog.mk to bsd.own.mk so
that they may be used by non PROGs (e.g., LIBs).

Improve some comments.


# 1.200 10-Jun-2004 lukem

Be consistent in handling YHEADER, similar to Christos' fix in bsd.lib.mk 1.253


# 1.199 21-May-2004 ross

If you add a library, you need to define its DPADD symbol here.

Add LIBMAGIC.


Revision tags: netbsd-2-0-base
# 1.198 15-Feb-2004 skrll

branches: 1.198.2;
Be more gcc like in the way we deal with libgcc so that sh3/hppa millicode
and exception handling have a chance of working properly.

- creates libgcc, libgcc_eh and libgcc_s

- updates LIBGCC_SPEC to use them appropriately.

There's a hack in here at the moment with respect to libgcc_so in that it
is preferable to link against libgcc_so will only when -shared-libgcc is
specified (the c++ frontend does this automatically.) Configurations where
LINK_EH_SPEC is defined already do this. The gcc configuration for
NetBSD/alpha and another NetBSD platform (I forget which) actually define
LINK_EH_SPEC probably by accident rather than design.

- updates share/mk to use the compiler's knowledge of what needs linking into
libraries and executables. This removes an hppa hack.

- updates the sets for the newly created libgcc* files.

- support for linking against the _pg version of libgcc has been removed.


# 1.197 29-Jan-2004 lukem

Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.


# 1.196 27-Jan-2004 lukem

Replace
:M-[IDU]*
with
:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)


# 1.195 23-Jan-2004 simonb

crt0.o lives in /usr/lib even on a.out.


# 1.194 16-Nov-2003 lukem

simplify with _MKTARGET_LINK


# 1.193 11-Nov-2003 dsl

Set MKDEP_SUFFIXES to get additional targets in .depend instead of using
sed in .afterdepend. I don't think .afterdepend is used anywhere any more.


# 1.192 21-Oct-2003 lukem

Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.


# 1.191 19-Oct-2003 lukem

Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} " ... {$.TARGET}" and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO


# 1.190 18-Oct-2003 lukem

Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command ("verbose")
This is the default, and is equivalent to the previous behaviour.


# 1.189 29-Sep-2003 lukem

Add LIBSTDCXX (for usr/lib/libstdc++.a).
Sync LIB* documentation with reality.


# 1.188 19-Sep-2003 martin

Drop explicit medlow model and default to -O2 for sparc64.


# 1.187 14-Sep-2003 lukem

Check ${SHLIBDIR} against "/usr/lib" instead of ${LIBDIR} when determining
if we need to add stuff (usually "/lib") to the rpath-link path before
"/usr/lib". Otherwise, this barfs if LIBDIR != /usr/lib or /lib, and
we're cross-building (e.g., in src/x11)


# 1.186 13-Sep-2003 erh

Also support per-program LDFLAGS and LDSTATIC.


# 1.185 13-Sep-2003 erh

Create a way to add additional flags to COPTS, CPPFLAGS, CXXFLAGS and LDADD
for particular libraries or programs by specifying the additions in mk.conf
instead of needing to go edit individual Makefiles.


# 1.184 12-Sep-2003 lukem

add infrastructure to support reach-over builds of xsrc


# 1.183 22-Aug-2003 dsl

Add a ${PROG}.ro target that does an 'ld -r' of the program object files.
Allows a much simplified build of 'crunched' binaries since crunchgen can
build prog.ro instead of having to deretmine the names of all the .o files.


# 1.182 01-Aug-2003 lukem

Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".


# 1.181 01-Aug-2003 lukem

simplify the ${PROG}: target to reduce duplication between the DESTDIR
and !DESTDIR cases...


# 1.180 31-Jul-2003 lukem

bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.


# 1.179 31-Jul-2003 lukem

Don't need -R/usr/lib; it will be searched at the end by ld.elf_so anyway.
Noted by matt green <mrg@>


# 1.178 28-Jul-2003 lukem

be consistent when adding *.y and *.l to DPSRCS


# 1.177 28-Jul-2003 lukem

replace MKCXXSUPCXX(!=no) with USE_LIBSTDCXX(==no)


# 1.176 28-Jul-2003 lukem

Change defined(CXX_SUPCXX) to MKCXXSUPCXX != "no".

Clarify that command-line overrides of the MKxxx variables should be
done via the environment rather than make(1) command-line variable
assignment, since the latter doesn't actually work as intended.


# 1.175 27-Jul-2003 mrg

introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes. for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)


# 1.174 26-Jul-2003 mrg

add a new bsd.own.mk variable: CXX_SUPCXX. from bsd.README:
+ CXX_SUPCXX If defined, the support libraries needed for this C++ program
+ are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.


# 1.173 20-Jul-2003 lukem

Consistently support the different C++ file extensions: .cc .cpp .cxx .C
Noted by Andrew White in PR toolchain/18246


# 1.172 18-Jul-2003 lukem

Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was defined.
Replace defined(UNPRIVED) tests with ${MKUNPRIVED} != "no"

Add MKUPDATE; if not no has the same semantics as if UPDATE was defined.
Replace defined(UPDATE) tests with ${MKUPDATE} != "no"

Improve documentation for these and other make flags.


# 1.171 16-Jul-2003 itojun

stop installing install libtelnet. build under lib/libtelnet and reference
it from usr.bin/telnet and libexec/telnetd.
(reason for separate build: compiler flags)


# 1.170 27-Jun-2003 drochner

For consistency, use "-R" instead of "-Wl,-rpath" to pass
a runtime search path to the linker.


# 1.169 13-Jun-2003 itojun

define LIBEVENT


# 1.168 11-Jun-2003 msaitoh

catch signal 1,2,3,13 and 15 to clean /tmp/_dependXXX


# 1.167 31-May-2003 thorpej

If EXTERNAL_TOOLCHAIN is defined, allow the compiler to define the
location of crt{begin,end}{,S}.o and libgcc.a. Encapsulate all of
this logic into the new bsd.gcc.mk, and use it in bsd.prog.mk and
bsd.lib.mk.


# 1.166 18-May-2003 lukem

make this a no-op if HOSTPROG is defined


# 1.165 30-Mar-2003 thorpej

If MACHINE_ARCH is powerpc and we HAVE_GCC3, add crtsaveres.o to the
endfile spec.


# 1.164 22-Feb-2003 uwe

Typo in comment.


# 1.163 24-Jan-2003 thorpej

Add LIBPTHREAD, LIBPTHREAD_DB, and LIBRT.


Revision tags: fvdl_fs64_base
# 1.162 22-Nov-2002 thorpej

Split crtbegin/crtend into crti/crtbegin/crtend/crtn. NetBSD-specific
things like the .note.netbsd.ident section are provided by crti/crtn.
crti/crtn also provide the _init() and _fini() routines.

crtbegin/crtend now only provide support for ctors/dtors. This paves
the way to using the "crtstuff" provided with GCC (when we upgrade to
GCC 3.3), which provides, among other things, much better C++/Java
exception handling.


# 1.161 12-Nov-2002 itohy

MKDYNAMICROOT for a.out


# 1.160 22-Oct-2002 perry

Pass 1 of SYSPKG changes to automatically add tags=pkgname_pkg to METALOG.
Not quite ready for prime time yet.


# 1.159 27-Sep-2002 thorpej

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.


# 1.158 26-Sep-2002 itojun

MDC2 is a patented algorithm; don't ship it in default libcrypto.
MKCRYPTO_MDC2 will build a separate library, libcrypto_mdc2.


# 1.157 08-Sep-2002 thorpej

Build a .gdbinit in the objdir when building a program. The .gdbinit
file sets the shared library prefix to ${DESTDIR}, and adds "sources"
directives for each file listed in the GDBINIT Makefile variable.


# 1.156 09-Aug-2002 thorpej

Add LIBPMC.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.155 27-Mar-2002 eeh

branches: 1.155.2;
Use the medium low model for sparc64 programs that don't 2GB of data segment.


# 1.154 11-Feb-2002 mycroft

Don't use .PHONY for targets that are actually installed. Instead use force
dependencies. (Among other things, `make -t install' does something vaguely
sensible now.)


# 1.153 07-Feb-2002 pk

Mark installed system libraries as .MADE only if we're actually establishing
their default variable values here.


# 1.152 04-Feb-2002 christos

s/.NOSUFF/.MADE/


# 1.151 03-Feb-2002 christos

Apply a .NOSUFF: directive to targets we don't want to have processed by
the suffix rules engine.


# 1.150 02-Feb-2002 veego

Ups, it is LIBUSBHID and not LIBUSBHIB.


# 1.149 02-Feb-2002 veego

Change LIBUSB to LIBUSBHIB, reflecting the library name change.


# 1.148 29-Jan-2002 enami

Mark the targets clean{extra,objs} as PHONY.


# 1.147 04-Jan-2002 thorpej

For PROG_CXX DESTDIR builds, pull in -lstdc++ and -lm regardless
of GCC version.


# 1.146 01-Jan-2002 thorpej

Per a suggestion from matthew green, PROG_CXX takes the place of
PROG for C++ programs.


# 1.145 01-Jan-2002 thorpej

* If PROG_CXX is set by the program's Makefile, use ${CXX} to link
the program rather than ${CC}.
* If HAVE_GCC3 is defined, pull in "-lstdc++ -lm" as additional C++
support libraries for DESTDIR builds.


# 1.144 28-Dec-2001 lukem

* 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


# 1.143 28-Nov-2001 tv

If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.


# 1.142 19-Nov-2001 thorpej

Use a little transitional hack to determine if we use -isystem
or -idirafter. Use the former only of USE_NEW_TOOLCHAIN, since
-isystem causes the old toolchain to bomb out when building
libstdc++.


# 1.141 14-Nov-2001 tv

C/..$/.c/ -> C/\..$/.c/


# 1.140 14-Nov-2001 tv

Move the DESTDIR-based nostdinc logic to bsd.lib.mk and bsd.prog.mk where
it belongs (with the native target compile rules).


# 1.139 02-Nov-2001 tv

Use INSTALL_FILE/INSTALL_DIR as appropriate.


# 1.138 02-Nov-2001 tv

Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.


# 1.137 19-Oct-2001 tv

Add .NOPATH for all files generated from .l or .y files in SRCS. Fixes PRs
bin/14187 and lib/14239.

Also simplify the handling of these transforms to .c and .h files a bit by
leveraging make's builtin macro operators.


# 1.136 25-Sep-2001 tv

Set .NOPATH on program to build to make sure it goes in .OBJDIR.
Problem noted by <seebs@plethora.net>.


# 1.135 24-Sep-2001 lukem

fix previous (hi thor!) - $OBJS and $CLEANFILES might be empty, and
rm needs some files to delete...


# 1.134 24-Sep-2001 tls

Split "cleanprog" target apart: now you can zap only object files or
CLEANFILES (needed to fix crunchgen lossage).


# 1.133 13-Sep-2001 thorpej

Add LIBPCI.


# 1.132 14-Aug-2001 tv

Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").


# 1.131 01-Jun-2001 tv

Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).


# 1.130 08-May-2001 sommerfeld

Suppress duplicate entries in ALLFILES, FILES, INCS, DEPINCS, INFOFILES,
NLSALL, CATPAGES, MANPAGES, HTMLPAGES, and SCRIPTS.


# 1.129 19-Feb-2001 jmc

Wrap target() checks around afterdepend rule as some Makefiles override this


# 1.128 26-Jan-2001 itojun

fix typo in LIBSSL decl. it made programs with DPADD+=${LIBSSL} to build
every time we type "make". From: bernd


# 1.127 14-Jan-2001 christos

use the new .if commands(<target>) directive so that we don't have to
change Makefiles.


# 1.126 14-Jan-2001 christos

fix thinko: test for the existance of the target before we define it...


# 1.125 14-Jan-2001 christos

Alter previous redefined target protection. If the ${PROG} target is defined,
add the dependencies as usual, but don't add the commands. This avoids
having to change all the Makefiles that redefine the PROG target.


# 1.124 14-Jan-2001 christos

allow programs to override the program target.


# 1.123 08-Jan-2001 mrg

add missing $LIBCRYPTO_RC5 and $LIBCRYPTO_IDEA


# 1.122 08-Jan-2001 mrg

add missing $LIBSSL


# 1.121 04-Jan-2001 garbled

Add LIBCDK and LIBFORM definitions


# 1.120 31-Oct-2000 itojun

add ${LIBINTL} for use with DPADD.


# 1.119 07-Oct-2000 deberg

fix typos, PR 11159


# 1.118 25-Jun-2000 erh

For the case when DESTDIR is set: move the -L${DESTDIR}/usr/lib after ${LDADD} so any -L directories set in LDADD are searched first to avoid possibly linking against old versions of libraries.


Revision tags: netbsd-1-5-base
# 1.117 19-Jun-2000 thorpej

branches: 1.117.2;
Sync up the LIB* list.


# 1.116 10-Jun-2000 mycroft

Use ${.ALLSRC:T} when doing the generated variable name lookups, so that it
DTRT for generated files in and obj directory (or accessed via .PATH).


# 1.115 06-Jun-2000 mycroft

Abuse .USE some more.


# 1.114 06-Jun-2000 mycroft

Minor rearrangement.


# 1.113 06-Jun-2000 mycroft

Use ODE make(1) features to eliminate extra variables and move several things
outside of .for loops. (Needs more work to completely eliminate .for.)

XXX Don't look at this stuff. It will make your head hurt.


Revision tags: minoura-xpg4dl-base
# 1.112 14-Apr-2000 mrg

branches: 1.112.2;
use -rpath-link rather than -R when linking objects using a DESTDIR.
this replaces the previous change as that ended up adding
$DESTDIR/usr/lib to the runtime path of every binary created, which
is bogus and dangerous.


# 1.111 25-Mar-2000 mycroft

When linking with $DESTDIR, use an explicit -R to get library dependencies
correct.


# 1.110 07-Mar-2000 veego

Remove unused libahdi.
It will be replaced in the future with a more generic libdisklabel.


# 1.109 05-Feb-2000 jdc

Add libahdi entries.


# 1.108 23-Jan-2000 eeh

Add some support for FCode binaries.


# 1.107 22-Jan-2000 mycroft

Make `dependall' play nicely with SUBDIR, using a hack similar to `realinstall'
for both `depend' and `all'.
Also, remove the old hack that invokes an extra shell for .depend, now that
make(1) has been fixed.


# 1.106 16-Jan-2000 assar

all: depend on ${SCRIPTS} so that they get generated if they need to


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.105 23-Nov-1999 blymn

Added libmenu library.


Revision tags: comdex-fall-1999-base
# 1.104 14-Sep-1999 perry

branches: 1.104.4;
Add a "dependall" target, which does a "make depend" and then "make all"
in a single directory. This is useful in "make build" because by doing
the build immediately after the depend, all sources will typically
still be in the buffer cache, thus saving significant time over doing
a "make depend" on all the directories and then a "make all".


# 1.103 04-Sep-1999 fredb

Permit "make all install", as well as "make foo install" (where foo would be
installed by "make install") without setting of BUILD. All cases where BUILD
is already set are unchanged from the old behavior.

"make all install" is now practically equivalent to "make BUILD= all install",
but without actually setting build.

Fixes pr's 8313, 3894.


# 1.102 21-Aug-1999 simonb

Add ${INSTPRIV} to ${INSTALL} commands.


# 1.101 01-Jul-1999 itojun

branches: 1.101.2;
add LIBIPSEC for use from DPADD.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.100 12-Feb-1999 lukem

branches: 1.100.2;
* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.99 10-Feb-1999 tv

libbfd_pic.a is no longer installed; remove ${LIBBFD} define.


# 1.98 04-Feb-1999 christos

PR/2936: Brian C. Grayson: Avoid truncating precious files when installing
and the filesystem is full. Added ${RENAME} flag to install, which when set
to -r installs on a temporary file and then renames to the final destination.
${RENAME} is currently set to nothing in bsd.own.mk, but one can turn it
on in /etc/mk.conf.


# 1.97 07-Nov-1998 jonathan

Do DESTDIR support for crtbegin/crtend on all ELF ports (adds mips).


# 1.96 28-Sep-1998 christos

Use preserve flag in install.


# 1.95 10-Sep-1998 ross

Define a LIBBZ2?=... for use in DPADD=... lines.


# 1.94 09-Aug-1998 lukem

add distclean as a synonym for cleandir


# 1.93 09-Apr-1998 tv

.y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.


# 1.92 01-Apr-1998 tv

Revert. This broke too much in the build tree, and a better solution
needs to be created. (The existing situation breaks a lot too.)


# 1.91 01-Apr-1998 tv

Fix .y rules to DTRT with possibly generated .h files. See mail on
tech-toolchain for a very detailed explanation of this. In short, add
a .y.h rule identical to the .y.c rule and make the .y.c rule rename
the .h file; also, clean the .h file in CLEANFILES.


# 1.90 03-Nov-1997 cgd

echo the lint command line when making 'lint'.


# 1.89 28-Oct-1997 lukem

add ${LIBOBJC}


Revision tags: netbsd-1-3-base
# 1.88 11-Oct-1997 mycroft

branches: 1.88.2;
Several changes:
* Allow bsd.man.mk to be included separately.
* Always include bsd.own.mk and bsd.obj.mk.
* Include bsd.man.mk and bsd.nls.mk even if NOMAN or NONLS; just turn off
building of the affected files instead.
* Require bsd.subdir.mk to be included explicitly.
(Will make appropriate changes to Makefiles shortly.)


# 1.87 29-Sep-1997 gwr

Add $LIBBFD


# 1.86 31-May-1997 cjs

Back out BUILDDIR and NOINSTALL changes.


# 1.85 26-May-1997 cjs

branches: 1.85.2;
These updates to the build allow building against include files
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.


# 1.84 18-May-1997 kleink

Add libposix.


# 1.83 17-May-1997 mycroft

Do LINKS and SYMLINKS after FILES and INCS.


# 1.82 17-May-1997 mycroft

Remove unneeded .SUFFIXES lines, and move .s and .S closer to .o to give the
right preferences.


# 1.81 09-May-1997 mycroft

Fix typo in previous.


# 1.80 09-May-1997 mycroft

Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.79 09-May-1997 mycroft

Remove cruft.


# 1.78 09-May-1997 mycroft

Oops; rearrange dependencies to get things built early enough.


# 1.77 09-May-1997 mycroft

Make sure INCS and SRCS are built if necessary.


# 1.76 08-May-1997 gwr

Set the .NOPATH flag for ${OBJS} (from Christos).


# 1.75 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.74 07-May-1997 mycroft

Various simplifications.


# 1.73 07-May-1997 mycroft

Shuffle some .PHONYs around, to work better with `-t'.


# 1.72 06-May-1997 mycroft

Make most of the install targets .PRECIOUS.


# 1.71 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.70 18-Apr-1997 christos

Add ${LIBNTP}


# 1.69 17-Apr-1997 thorpej

- Properly depend on crtbegin.o and crtend.o for platforms that use
them (currently Alpha and PowerPC)
- STRIP -> STRIPFLAG


# 1.68 03-Apr-1997 mikel

don't allow override of all: target


# 1.67 29-Mar-1997 mikel

merge lite-2 changes (mostly SCCSids)


# 1.66 27-Mar-1997 christos

Put the FILES generated rules in a separate .mk file since both bsd.prog.mk
and bsd.lib.mk use them.


# 1.65 27-Mar-1997 mycroft

Make the SCRIPTS case mimic the FILES case more closely, so we can override
the destination direectory, etc.


# 1.64 27-Mar-1997 mycroft

Remove knowledge of HIDEGAME from here.


# 1.63 24-Mar-1997 christos

make rules update:
- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation


# 1.62 22-Mar-1997 perry

Fix SYMLINKS not to include DESTDIR in the link itself


# 1.61 13-Mar-1997 perry

add SYMLINKS, by analogy to LINKS. Vetted by Christos.


# 1.60 22-Jan-1997 cgd

if 'clean' is not already defined, rather than simply defining it with
a bunch of rules, define a clean{kmod,lib,prog} target with the rules,
and have both clean and cleandir depend on that. That eliminates a bug
where 'cleandir' in a directory which included e.g. bsd.prog.mk but which
also had subdirs would 'make clean' all the subdirs and then 'make cleandir'
all ofthe subdirs. It also allows Makefiles to add more dependencies
to 'clean' after inclusion of the make template.

If 'clean' is already defined, the behaviour is the same as it used to be.


# 1.59 20-Dec-1996 cgd

add an afterdepend target (a la the one in bsd.lib.mk) that processes
the .depend file to add <filename>.ln for each <filename>.o as an
object file which has the given dependencies (in addition to
<filename>.po and <filename>.so, which were already there).


# 1.58 13-Dec-1996 mikel

add missing LIBPCAP definition.


# 1.57 26-Nov-1996 mrg

add libz and libwrap


# 1.56 18-Oct-1996 thorpej

Use ${INSTALL} rather than "install".
From Simon J. Gerraty <sjg@zen.void.oz.au>, PR #1458.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.55 08-Apr-1996 jtc

Sort LIBFOO definitions and add LIBY; Reported by Mike Long <mike.long@analog.com> in PR #2301.


# 1.54 22-Oct-1995 christos

Added include file <bsd.sys.mk> that contains lex and yacc "parallel aware"
rules. These rules are not turned on by default; they are enabled by setting
the PARALLEL variable.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.53 25-Jun-1995 cgd

oops; fix an rm that might be empty


# 1.52 24-Jun-1995 cgd

update lint rules, but keep linting disabled


# 1.51 10-Jun-1995 mycroft

Define LIBEDIT.


# 1.50 21-Apr-1995 jtc

.include <bsd.nls.mk> unless NONLS is defined.


# 1.49 22-Dec-1994 cgd

specify man pages differently, and document how.


# 1.48 24-Aug-1994 mycroft

Include bsd.own.mk earlier.


# 1.47 20-Jul-1994 cgd

fix from christos, for progs w/o objects


Revision tags: netbsd-1-0-base
# 1.46 06-Jul-1994 mycroft

branches: 1.46.2;
Pull libraries from ${DESTDIR} if set. Kill LDONLY, which is unused and
probably not useful anyway.


# 1.45 30-Jun-1994 cgd

fix modify-info-nothingness-then-substitute probelm that broke genclass build


# 1.44 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.43 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.42 28-Jun-1994 jtc

Strip *.sh when constructing OBJS from SRCS.
This will allow us to clean up makefiles that build a script by munging
a template (uusched, genclass, neqn, etc.).


# 1.41 18-Jun-1994 cgd

don't chown the symlink, when HIDEGAME causes a symlink to be made to dm.
4.4-based FS code _follows_ the symlinks on a chown(2) call.


# 1.40 24-May-1994 cgd

fix the last to do the right thing for dependencies


# 1.39 24-May-1994 deraadt

LIBSKEY


# 1.38 22-May-1994 jtc

Single source file programs are now compiled into object files before they
are linked. This change halves the time it takes to rebuild all of the
NetBSD sources when only the C library is "touched"; but only takes about
one percent more disk space.


# 1.37 06-Apr-1994 chopps

relink (recompile) single source programs when crt0.o is updated.


# 1.36 24-Mar-1994 mycroft

Remove *.core on clean.


# 1.35 09-Feb-1994 cgd

kill install -d's.


# 1.34 28-Jan-1994 cgd

add LIBKVM


# 1.33 10-Nov-1993 cgd

librpc doesn't exist anymore


# 1.32 08-Nov-1993 cgd

ad LDSTATIC flag, so static linking can be made one-stop shopping.
use "setenv LDSTATIC" to make *everything* dynamically linked,
setenv LDSTATIC -static for everything statically linked, or unset
it for default behavior.


# 1.31 07-Oct-1993 cgd

LIBTERM pointed at nothing, but was meant to point to libtermcap.a...


# 1.30 07-Oct-1993 cgd

always define LIBCRYPT


# 1.29 17-Aug-1993 mycroft

Make sure we don't recurse into subdirectories if Makefile specified `install'
target. (It's usually blank and is specifically to avoid doing this...)


# 1.28 15-Aug-1993 mycroft

Automatically include bsd.subdir.mk for backward compatibility.


# 1.27 15-Aug-1993 mycroft

Don't automatically include bsd.subdir.mk in bsd.prog.mk and bsd.lib.mk.
Put back .MAIN in bsd.man.mk, and be careful not to include ../Makefile.inc
a second time.


# 1.26 15-Aug-1993 mycroft

Move man rules to sys.mk.
Use bsd.subdir.mk for building subdirectories.
Don't forget to remove x.cc and x.C when using SHAREDSTRINGS.
Make ${PROG} always depend on ${LIBCRT0}.
Don't duplicate code between cleandir and clean.
Move tags target to bsd.dep.mk.
Move STRIP to bsd.own.mk.
Remove redundant definitions of {BIN,MAN}{DIR,GRP,OWN,MODE}.
Move {LIB,DOC}{DIR,GRP,OWN,MODE} defaults to bsd.own.mk.


# 1.25 15-Aug-1993 mycroft

Abstract out dependency stuff, and add RCS identifiers.


# 1.24 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


# 1.23 10-Aug-1993 mycroft

Put LINKS handling in `install' target, so it's the last thing executed, and
happens even if `realinstall' is user-defined.


# 1.22 30-Jul-1993 mycroft

When generating a default OBJS, ignore .h files.


# 1.21 29-Jul-1993 mycroft

Don't print the `making ...' message if an obj dir already exists.
Also, a minor cleanup.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.20 17-Jul-1993 mycroft

Fix C++ dependencies for good. `make depend' is now done in two passes--one
of C files and one for C++ files. No need to specify `-+' in your Makefile,
as it is now done automatically.


# 1.19 17-Jul-1993 cgd

do c++ dependencies the right way...


# 1.18 17-Jul-1993 mycroft

Add suffix rules for C++ files.


# 1.17 04-Jun-1993 brezak

Add LIBRPCSVC variable.


# 1.16 02-Jun-1993 cgd

add ability to specify c++ dependencies, by setting CFLAGS+=-+ for
the dependency make.


# 1.15 26-Apr-1993 cgd

added definition for DPADD library variable LIBCRYPT.


# 1.14 26-Apr-1993 mycroft

Don't redefine `realinstall' target if already defined.


# 1.13 25-Apr-1993 mycroft

Link with LDFLAGS even if one source module.


# 1.12 25-Apr-1993 mycroft

Don't lose if we include bsd.prog.mk only to build man pages.


# 1.11 25-Apr-1993 mycroft

Fix error in last change. (Oops.)


# 1.10 25-Apr-1993 mycroft

Don't build man pages if NOMAN set.


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.9 09-Apr-1993 cgd

various changes to default make rules. from patch 101.
note that only the "sensible" changes in patch 101 are implemented.


# 1.8 08-Apr-1993 cgd

try to do the right thing, in terms making directories before we
install into them, and get the manpage cleans _OUT_ of "clean".
they don't belong there, only in cleandir, WFJ be damned.


# 1.7 08-Apr-1993 cgd

fixed typos...


# 1.6 08-Apr-1993 cgd

(silently) make sure we have directories before installing


# 1.5 04-Apr-1993 cgd

make LIBRPC point to the right place


# 1.4 27-Mar-1993 nate

Fixed the doc macros to call troff, eqn,and tbl instead of ditroff,
deqn, and dtbl.
Fixed make clean to remove the man pages (Bill fixed this in the distribution,
but not in the original source)
Changed install to leave the original file around, by using 'cp' instead of
'mv'. "install -c ..."


# 1.3 23-Mar-1993 cgd

made .CURDIR be absolute, not relative, thereby eliminating
the need for some of the makefile trickery when making objects,
and fixing a few .PATH bugs


# 1.2 22-Mar-1993 cgd

fixed "make obj" for cases when sources not in /usr/src/...
if sources not there, it now mkdirs obj, but some trickery
is necessary, to avoid deleting cwd.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.308 10-Oct-2017 christos

Add general {DP,LD}ADD.rump variables


Revision tags: perseant-stdc-iso10646-base netbsd-8-base
# 1.307 21-May-2017 riastradh

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.


# 1.306 21-May-2017 riastradh

Remove some vestiges of MKCRYPTO_IDEA/MKCRYPTO_MDC2.


# 1.305 21-May-2017 riastradh

Remove MKCRYPTO_RC5. Unconditionally include RC5 in libcrypto.so.

This option existed only because RC5 is covered by patents that, twenty
years ago, we had reason to suspect the patent holder, RSA, Inc., might
litigate. The two US patents in question are 5,724,428 and 5,835,600.

According to the USPTO Patent Term Calculator web site at
<https://www.uspto.gov/patent/laws-and-regulations/patent-term-calculator#heading-5>
(retrieved 2017-05-21), patents filed after 1995-06-07 expire twenty
years after the filing date.

number filing date
5,724,428 1995-11-01
5,835,600 1997-04-21

Thus, these patents appear to be expired.

As proposed on tech-crypto and tech-security:

https://mail-index.netbsd.org/tech-crypto/2017/05/05/msg000718.html
https://mail-index.netbsd.org/tech-security/2017/05/05/msg000927.html


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.304 19-Apr-2017 joerg

Add netpgpverify to the library list.


Revision tags: pgoyette-localcount-20170320
# 1.303 20-Feb-2017 rin

add missing LIBCXX


# 1.302 08-Feb-2017 kamil

libpthread_dbg(3) deletion from the base distribution

libpthread_dbg(3) is a remnant library from the M:N thread model
(pre-NetBSD-5.0) API to introspect threads within a process and for use
of debuggers.

Currently in the 1:1 model it's not used in GDB neither in LLDB and it's
not either planned to be used. It's current function to read pthread_t
structures is realizable within a regular debugger capable to
instrospect objects within a tracee (GDB, LLDB...).

Remaining users of this API can still use this library from
pkgsrc/devel/libpthread_dbg.

Sponsored by <The NetBSD Foundation>


# 1.301 29-Jan-2017 christos

add sqlite3 to statically linked libraries for pam.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914
# 1.300 20-Aug-2016 christos

branches: 1.300.2;
unbound additions


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.299 04-Apr-2016 joerg

branches: 1.299.2;
If the per-target LDSTATIC flag is set, don't include the PIE linker
flags as we currently don't support static PIE.


# 1.298 30-Mar-2016 martin

Pass -pie to cc, not -Wl,-pie. This way we have a chance to fix specs
for obscure corner cases like -pie -fPIE -static (used for
/usr/tests/lib/csu/h_initfini2 if building with MKPIE=yes).
While there also replace -fPIC with -fPIE for the PIE case, even if
it should be mostly equivalent.


# 1.297 12-Mar-2016 mrg

remove conditionals that are always true with GCC >= 4.8.


# 1.296 21-Feb-2016 christos

Add NODEBUG


# 1.295 31-Jan-2016 christos

Introduce NOPIE and NOCTF so that standalone programs build properly.


# 1.294 23-Jan-2016 christos

Define _KERNTYPES for things that need it.


# 1.293 07-Nov-2015 joerg

LIBEXECINFO


# 1.292 07-Jun-2015 matt

Make LIBCRT* depend on the right files if MLIBDIR from MKCOMPAT is defined.


# 1.291 01-Dec-2014 erh

PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilt
if any of their dependencies (i.e. the files they refer to) are changed.
This allows changes to transitive included headers to be handled properly.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.290 25-Mar-2014 ozaki-r

branches: 1.290.4;
Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.


Revision tags: riastradh-drm2-base3
# 1.289 09-Mar-2014 christos

let's see if the new dwarf library can handle dwarf 4


# 1.288 02-Mar-2014 christos

If we are compiling with -g and using gcc4.8 and dtrace downgrade
dwarf generation to version 2 for now.


# 1.287 15-Jan-2014 joerg

-Wl,-pie and -r don't agree with each other, so filter the former out.


# 1.286 11-Nov-2013 joerg

Relink binaries if crti.o changes.


# 1.285 29-Sep-2013 christos

Add libxcb


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.284 31-May-2013 mrg

add LIBX11_XCB; unfortunately since the library is named with a -
in it, we have to use an ugly hard coded assignment for now.
(could be cleaned up with more make variable magic i'm sure.)


# 1.283 04-Apr-2013 christos

ldopts should be before ldadd like everywhere else.


Revision tags: agc-symver-base
# 1.282 14-Feb-2013 christos

Since the libraries are produced with different MK flags than the programs,
we check for existance of the files instead of the MK flags.


# 1.281 14-Feb-2013 christos

Add PROGDPLIBS


# 1.280 26-Jan-2013 christos

CTFCONVERT me harder.


Revision tags: yamt-pagecache-base8
# 1.279 17-Jan-2013 christos

Now that we have separate debug sets, add -g if ${MKDEBUG} is set for
program builds since we don't need to install that symbol files.


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.278 24-Aug-2012 jmmv

branches: 1.278.2;
Allow DPADD to be specified on a per-program basis.


# 1.277 23-Aug-2012 joerg

Revert last, it breaks the tricks xsrc uses.


# 1.276 23-Aug-2012 joerg

Remove SHLIBINSTALLDIR and SHLINKINSTALLLIBDIR. Add rpath entries, if
SHLIBDIR differs from /usr/lib.


# 1.275 08-Aug-2012 christos

add MKRUMP by popular demand.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.274 29-Feb-2012 tron

Move "libexpat" from X11 into base which fixes PR lib/40346.
This change was approved by the Core Group.


# 1.273 21-Feb-2012 matt

Remove another ${SIZE}


# 1.272 20-Feb-2012 matt

Remove ${SIZE}


# 1.271 19-Feb-2012 matt

Add support for --combine with gcc.


Revision tags: netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2
# 1.270 05-Nov-2011 christos

branches: 1.270.2;
Add libtre


Revision tags: yamt-pagecache-base
# 1.269 16-Oct-2011 christos

branches: 1.269.2;
- no need to special-case libraries with weird characters.
- add a note about adding new libraries.


# 1.268 16-Oct-2011 christos

fix list of libraries to reflect reality.


# 1.267 10-Sep-2011 apb

Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.


# 1.266 27-Aug-2011 joerg

Add new "analyze" command to run clang's static analyzer in a directory
on all C/C++ files.


Revision tags: cherry-xenmp-base
# 1.265 26-Apr-2011 he

The new Heimdal adds -lwind and -lheimbase to the set of libraries,
so define the corresponding LIB* variables.
These are also needed in the PAM_STATIC_* variables, so add them there too.


# 1.264 11-Apr-2011 joerg

Adjust --sysroot related usage:
-Wl,-rpath does not expand =, so just drop it.

Drop -Wl,-rpath-link entries that duplicate the -Wl,-rpath entries, this
is done implicitly now that ld is built with sysroot support.

Use ${DESTDIR} explicitly for the remaining -Wl,-rpath-link entries.


# 1.263 10-Apr-2011 joerg

For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.


# 1.262 08-Mar-2011 jmmv

Revert previous (revision 1.261): it broke the build because PROG_CXX is
defined in terms of PROG, so later on we would end up with target duplicates
because both PROG_CXX and PROG were being converted to PROGS_CXX and PROGS.

Did not catch this earlier because the test build I did was not clean and
thus the duplicate targets did not have nasty effects.


# 1.261 07-Mar-2011 jmmv

Always convert PROG to its plural form independently of whether PROG_CXX
is defined or not. From Garrett Cooper in private mail.


Revision tags: bouyer-quota2-nbase
# 1.260 20-Feb-2011 jmmv

Define LIBATF_C and LIBATF_CXX to point to their corresponding .a files and
use these to properly set DPADD for test programs.


Revision tags: bouyer-quota2-base
# 1.259 13-Feb-2011 christos

add saslc


# 1.258 06-Feb-2011 joerg

Don't use -nostdinc or -nostdinc++ if this is included in a HOSTLIB.


# 1.257 17-Jan-2011 pooka

branches: 1.257.2;
Add rump bits to DPSRCS so that update builds work correctly.


Revision tags: matt-mips64-premerge-20101231
# 1.256 13-Dec-2010 pooka

befriend RUMPPRG with CRUNCHEDPRG


# 1.255 13-Dec-2010 pooka

Define RUMPPRG, which is just like PROG, except it additionally
builds a rump client with the name rump.${PROG}. The rump client
is not installed suid/sgid by default even if BINMODE is defined.


# 1.254 10-Dec-2010 joerg

Revert last, gcc(1) checks explicitly for -r on some platforms to disable
passing down --relax as well.


# 1.253 08-Dec-2010 joerg

gcc passes down -r directly to ld, so make it explicitly a linker option.


# 1.252 08-Dec-2010 joerg

Don't depend on ${CC} passing down -R to ld, use -Wl,-rpath explicitly.


# 1.251 08-Nov-2010 lukem

Preserve date on original shared library or program when stripping
the debug symbols and adding the debug-link to .debug.
Use '(rm -f file; false)' in the failure path to force failure.
Based on solution proposed by Nicolas Joly on tech-toolchain in July 2010.
Should fix PR toolchain/44046 from Andreas Gustafsson.


# 1.250 31-Oct-2010 mbalmer

Link Lua to the build and add the resulting files to the distribution sets.
Document the addition of Lua and the change we made to the default settings.


# 1.249 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.248 24-Apr-2010 lukem

When extracting separate debug symbols with MKDEBUG, there's no need
to leave the original file unstripped...


# 1.247 02-Mar-2010 darran

DTrace: Add CTF generation to the make framework. Only enabled when
MKDTRACE=yes.


# 1.246 14-Dec-2009 mrg

use "${CC} -r" not "${CC} -Wl,-r" as the latter fools GCC on some targets
and it ends up passing "-r -relax" to ld, which causes ld to barf.


# 1.245 14-Dec-2009 matt

Merge from matt-nb5-mips64


Revision tags: matt-premerge-20091211
# 1.244 08-Dec-2009 uebayasi

When PROGS / LIBS are used, you can pass each PROG / LIB specific parameters
to ${LD} via:

${LDADD.${PROG}}
${LDFLAGS.${PROG}}
${LDSTATIC.${PROG}}
${LDADD.${LIB}}
${LDFLAGS.${LIB}}

OTOH you can't pass parameters to ${CC}, because in suffix rules make(1) only
knows the name of ${.IMPSRC} and ${.TARGET}; it's users' responsivility to
define ${CC} parameters to all the sources of a given ${PROG} / ${LIB}.

Should address bin/42381.

(Bug in this commit log was pointed out by mrg@.)


# 1.243 27-Nov-2009 tsutsui

If CPPFLAGS or CXXFLAGS already contains -nostdinc or -nostdinc++,
don't add ${CPPFLAGS_ISYSTEM} or ${CPPFLAGS_ISYSTEMXX} to refer
${DESTDIR}/usr/include or ${DESTDIR}/usr/include/g++.

This change might cause errors on some MD stand dir, but in that case
each Makefile should be fixed to search proper system include paths
by -Ipath option in own CPPFLAGS.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.242 12-May-2009 plunky

remove libsdp as improved functionality has been enabled in libbluetooth.


# 1.241 10-Apr-2009 apb

Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links. They have no effect except when using a
metalog, in which case the information is added to the metalog. In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg. This should fix PR 24457 and PR 41155.


# 1.240 24-Nov-2008 cube

branches: 1.240.2;
Move cleanextra to the very ends in case another included file wants to add
to it even if it was initially empty.


Revision tags: netbsd-5-base matt-mips64-base2
# 1.239 19-Oct-2008 christos

branches: 1.239.2;
handle assembly files for MKPIE


# 1.238 16-Oct-2008 christos

Provide a way for a program to override the PIE flags.


# 1.237 15-Oct-2008 christos

don't compile/link libraries with pie


Revision tags: mjf-devfs2-base
# 1.236 02-Oct-2008 joerg

Hook up libfetch and pkg_install update.


Revision tags: wrstuden-revivesa-base-3
# 1.235 09-Sep-2008 joerg

Add MKSTRIPIDENT to remove the RCS IDs from binary programs and shared
libraries for space-constraint systems. The description is based on the
feedback of hubertf@, the logic on input from lukem@

This obsoletes the removal of LIBC_SCCS and SYSLIBC_SCCS for libc builds.


Revision tags: wrstuden-revivesa-base-2
# 1.234 28-Aug-2008 mrg

update a comment example


# 1.233 27-Aug-2008 rtr

use ${X11USRLIBDIR} instead of hard-coded /usr/X11R6/lib when building
${LIB.foo} vars


# 1.232 27-Aug-2008 lukem

Fix problem I introduced in rev 1.231 on 2008/08/25 where ${_PROGLDOPTS}
and -L${_GCC_LIBGCCDIR} were appearing in the link line before ${LDADD},
so -L${DESTDIR}/lib and -L${DESTDIR}/usr/lib were being used before
local -L library paths.
Fixes ntpd/ntpdate failure noticed by Valeriy E. Ushakov <uwe@NetBSD.org>


# 1.231 25-Aug-2008 lukem

Always link with: -Wl,-rpath-link,${DESTDIR}/usr/lib -L${DESTDIR}/usr/lib
Fixes problem with MKDYNAMICROOT=no triggered by libraries that depend
on other libraries.
Related to PR 33503.

Clean up setting of _CCLINK to always add the appropriate -B options.

Simplify the link rule for a program.


# 1.230 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.229 28-May-2008 lukem

add LIBLDAR_R (for completeness)


# 1.228 22-May-2008 lukem

Add MKLDAP, USE_LDAP, LIBLBER, LIBLDAP


Revision tags: hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-pf42-base
# 1.227 10-Apr-2008 tsutsui

branches: 1.227.2; 1.227.4;
Add libhx509 to PAM_STATIC_LDADD which is required by libkrb5.


# 1.226 22-Mar-2008 mlelstv

branches: 1.226.2;
Import Heimdal-1.1


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase matt-armv6-base hpcarm-cleanup-base
# 1.225 26-Dec-2007 jmmv

Make the clean target work when OBJS is set but PROG is not, as happens
for example in gnu/lib/crtstuff4. Reported by drochner@.


Revision tags: cube-autoconf-base
# 1.224 13-Nov-2007 jmmv

Fix typo that prevented MKDEBUG builds to work. Found by drochner@.


# 1.223 12-Nov-2007 jmmv

Add the ability to build multiple programs from a single directory

This adds support for a new set of variables, PROGS and PROGS_CXX, that
allow the developer to build multiple different programs from a single
source directory.


# 1.222 04-Nov-2007 tls

Remove MKPRIVATELIB from BIND libraries; move library reachover
directories and Makefiles from src/usr.sbin/bind to src/lib; make
BIND libraries build shared. Saves about 1MB-1.5MB per installed
executable, about 5MB for a base+etc minimal installation of NetBSD.


Revision tags: matt-mips64-base
# 1.221 29-Jul-2007 joerg

branches: 1.221.4; 1.221.6;
Add build glue for libarchive and update the various sets.


# 1.220 25-Jan-2007 perry

Before I completely forget the issue, convert "PROG_PAX" to the
better-named "PAXCTL_FLAGS".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.219 11-Nov-2006 christos

don't run paxctl if other commands were specified for that target.


# 1.218 10-Nov-2006 christos

if ${PROG_PAX} is defined, run paxctl on the binary after linking with
the value of the variable. This way, if you set:

PROG_PAX=+M

in /etc/mk.conf, you get what you deserve.


# 1.217 22-Oct-2006 pooka

libpuffs


# 1.216 09-Oct-2006 mrg

- clean up some comments to reality.
- retire LIBDCK, LIBG2C and (long broken) USE_LIBSTDCXX
- in bsd.hostprog.mk's LIBSTDCPP -> LIBSTDCC
- add LIBSUPCXX
- don't default USE_LIBSTDCXX or USE_GCC4 since they are
not used in the tree any where
- same with USE_XF86_4; retire it
- remove _SUPCXX handling in bsd.prog.mk

inspired by PR#26714.


Revision tags: abandoned-netbsd-4-base
# 1.215 23-Jul-2006 lukem

Implement MKDEBUG:
If "no", don't build and install separate debugging symbols
into /usr/libdata/debug.
Default: no


# 1.214 19-Jun-2006 gdamore

Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.


# 1.213 09-Jun-2006 christos

PR/33681: Scott Ellis: Building 'bc' with SHAREDSTRINGS=yes fails
We need CPPFLAGS too now.


# 1.212 11-May-2006 mrg

add support for ${OBJCOPTS} and ${OBJCOPTS}.<lib|prog|fn>.


# 1.211 20-Mar-2006 christos

There is always one more KRB4 thing to remove. (from Jukka Salmi)


# 1.210 20-Mar-2006 christos

Remove krb4 variables and libraries (Jukka Salmi)


# 1.209 16-Mar-2006 jwise

Now that we have real build system support for syspkgs, remove someone's
half-implemented idea of building `syspkgs' (really a few giant blobs of the
same granularity of the old sets) using install(1).


# 1.208 20-Jan-2006 christos

Add the world of libraries to the static pam build. Now static pam binaries
work.


# 1.207 09-Apr-2005 dsl

Report when we link a program into xxx.ro (before being crunched)


Revision tags: netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.206 04-Mar-2005 he

branches: 1.206.2; 1.206.4;
Introduce PAM_STATIC_LDADD and PAM_STATIC_DPADD. When compiling
with MKPIC=no, possibly because the target does not support shared
libraries, these include libraries required to resolve all symbols
which end up referenced from PAM-using applications. The libraries
presently required are -lcrypt, -lrpcsvc and -lutil.

Add use of these variables which are currently set up to use PAM,
so that they compile when MKPIC=no.

Also, in the telnetd case, reorder the order of the libraries, so
that libtelnet.a comes before -ltermcap and -lutil, again to fix
link error when MKPIC=no.

Discussed with thorpej and christos.


# 1.205 20-Feb-2005 christos

Add libradius


# 1.204 12-Jan-2005 lukem

If RESCUEDIR is defined, automatically add that to CPPFLAGS


# 1.203 08-Jan-2005 lukem

Implement <bsd.prog.mk> vars:
LIBASN1 LIBBSDMALLOC LIBG2C LIBPAM LIBSSH


# 1.202 04-Aug-2004 lukem

Revert most of previous, and move the LIB<libname>?= assignments
back to bsd.prog.mk from bsd.own.mk.

pkgsrc uses <bsd.own.mk>, and setting LIB<libname> in it causes
problems with various package builds.
This should fix PR #26542 submitted by Jim Bernard.

(I'll be implementing the DPADD for shared libraries in a different
manner that generally won't depend upon ${LIB<libname>}.)


# 1.201 30-Jul-2004 lukem

Move the LIB<libname>?= assignments from bsd.prog.mk to bsd.own.mk so
that they may be used by non PROGs (e.g., LIBs).

Improve some comments.


# 1.200 10-Jun-2004 lukem

Be consistent in handling YHEADER, similar to Christos' fix in bsd.lib.mk 1.253


# 1.199 21-May-2004 ross

If you add a library, you need to define its DPADD symbol here.

Add LIBMAGIC.


Revision tags: netbsd-2-0-base
# 1.198 15-Feb-2004 skrll

branches: 1.198.2;
Be more gcc like in the way we deal with libgcc so that sh3/hppa millicode
and exception handling have a chance of working properly.

- creates libgcc, libgcc_eh and libgcc_s

- updates LIBGCC_SPEC to use them appropriately.

There's a hack in here at the moment with respect to libgcc_so in that it
is preferable to link against libgcc_so will only when -shared-libgcc is
specified (the c++ frontend does this automatically.) Configurations where
LINK_EH_SPEC is defined already do this. The gcc configuration for
NetBSD/alpha and another NetBSD platform (I forget which) actually define
LINK_EH_SPEC probably by accident rather than design.

- updates share/mk to use the compiler's knowledge of what needs linking into
libraries and executables. This removes an hppa hack.

- updates the sets for the newly created libgcc* files.

- support for linking against the _pg version of libgcc has been removed.


# 1.197 29-Jan-2004 lukem

Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.


# 1.196 27-Jan-2004 lukem

Replace
:M-[IDU]*
with
:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)


# 1.195 23-Jan-2004 simonb

crt0.o lives in /usr/lib even on a.out.


# 1.194 16-Nov-2003 lukem

simplify with _MKTARGET_LINK


# 1.193 11-Nov-2003 dsl

Set MKDEP_SUFFIXES to get additional targets in .depend instead of using
sed in .afterdepend. I don't think .afterdepend is used anywhere any more.


# 1.192 21-Oct-2003 lukem

Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.


# 1.191 19-Oct-2003 lukem

Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} " ... {$.TARGET}" and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO


# 1.190 18-Oct-2003 lukem

Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command ("verbose")
This is the default, and is equivalent to the previous behaviour.


# 1.189 29-Sep-2003 lukem

Add LIBSTDCXX (for usr/lib/libstdc++.a).
Sync LIB* documentation with reality.


# 1.188 19-Sep-2003 martin

Drop explicit medlow model and default to -O2 for sparc64.


# 1.187 14-Sep-2003 lukem

Check ${SHLIBDIR} against "/usr/lib" instead of ${LIBDIR} when determining
if we need to add stuff (usually "/lib") to the rpath-link path before
"/usr/lib". Otherwise, this barfs if LIBDIR != /usr/lib or /lib, and
we're cross-building (e.g., in src/x11)


# 1.186 13-Sep-2003 erh

Also support per-program LDFLAGS and LDSTATIC.


# 1.185 13-Sep-2003 erh

Create a way to add additional flags to COPTS, CPPFLAGS, CXXFLAGS and LDADD
for particular libraries or programs by specifying the additions in mk.conf
instead of needing to go edit individual Makefiles.


# 1.184 12-Sep-2003 lukem

add infrastructure to support reach-over builds of xsrc


# 1.183 22-Aug-2003 dsl

Add a ${PROG}.ro target that does an 'ld -r' of the program object files.
Allows a much simplified build of 'crunched' binaries since crunchgen can
build prog.ro instead of having to deretmine the names of all the .o files.


# 1.182 01-Aug-2003 lukem

Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".


# 1.181 01-Aug-2003 lukem

simplify the ${PROG}: target to reduce duplication between the DESTDIR
and !DESTDIR cases...


# 1.180 31-Jul-2003 lukem

bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.


# 1.179 31-Jul-2003 lukem

Don't need -R/usr/lib; it will be searched at the end by ld.elf_so anyway.
Noted by matt green <mrg@>


# 1.178 28-Jul-2003 lukem

be consistent when adding *.y and *.l to DPSRCS


# 1.177 28-Jul-2003 lukem

replace MKCXXSUPCXX(!=no) with USE_LIBSTDCXX(==no)


# 1.176 28-Jul-2003 lukem

Change defined(CXX_SUPCXX) to MKCXXSUPCXX != "no".

Clarify that command-line overrides of the MKxxx variables should be
done via the environment rather than make(1) command-line variable
assignment, since the latter doesn't actually work as intended.


# 1.175 27-Jul-2003 mrg

introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes. for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)


# 1.174 26-Jul-2003 mrg

add a new bsd.own.mk variable: CXX_SUPCXX. from bsd.README:
+ CXX_SUPCXX If defined, the support libraries needed for this C++ program
+ are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.


# 1.173 20-Jul-2003 lukem

Consistently support the different C++ file extensions: .cc .cpp .cxx .C
Noted by Andrew White in PR toolchain/18246


# 1.172 18-Jul-2003 lukem

Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was defined.
Replace defined(UNPRIVED) tests with ${MKUNPRIVED} != "no"

Add MKUPDATE; if not no has the same semantics as if UPDATE was defined.
Replace defined(UPDATE) tests with ${MKUPDATE} != "no"

Improve documentation for these and other make flags.


# 1.171 16-Jul-2003 itojun

stop installing install libtelnet. build under lib/libtelnet and reference
it from usr.bin/telnet and libexec/telnetd.
(reason for separate build: compiler flags)


# 1.170 27-Jun-2003 drochner

For consistency, use "-R" instead of "-Wl,-rpath" to pass
a runtime search path to the linker.


# 1.169 13-Jun-2003 itojun

define LIBEVENT


# 1.168 11-Jun-2003 msaitoh

catch signal 1,2,3,13 and 15 to clean /tmp/_dependXXX


# 1.167 31-May-2003 thorpej

If EXTERNAL_TOOLCHAIN is defined, allow the compiler to define the
location of crt{begin,end}{,S}.o and libgcc.a. Encapsulate all of
this logic into the new bsd.gcc.mk, and use it in bsd.prog.mk and
bsd.lib.mk.


# 1.166 18-May-2003 lukem

make this a no-op if HOSTPROG is defined


# 1.165 30-Mar-2003 thorpej

If MACHINE_ARCH is powerpc and we HAVE_GCC3, add crtsaveres.o to the
endfile spec.


# 1.164 22-Feb-2003 uwe

Typo in comment.


# 1.163 24-Jan-2003 thorpej

Add LIBPTHREAD, LIBPTHREAD_DB, and LIBRT.


Revision tags: fvdl_fs64_base
# 1.162 22-Nov-2002 thorpej

Split crtbegin/crtend into crti/crtbegin/crtend/crtn. NetBSD-specific
things like the .note.netbsd.ident section are provided by crti/crtn.
crti/crtn also provide the _init() and _fini() routines.

crtbegin/crtend now only provide support for ctors/dtors. This paves
the way to using the "crtstuff" provided with GCC (when we upgrade to
GCC 3.3), which provides, among other things, much better C++/Java
exception handling.


# 1.161 12-Nov-2002 itohy

MKDYNAMICROOT for a.out


# 1.160 22-Oct-2002 perry

Pass 1 of SYSPKG changes to automatically add tags=pkgname_pkg to METALOG.
Not quite ready for prime time yet.


# 1.159 27-Sep-2002 thorpej

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.


# 1.158 26-Sep-2002 itojun

MDC2 is a patented algorithm; don't ship it in default libcrypto.
MKCRYPTO_MDC2 will build a separate library, libcrypto_mdc2.


# 1.157 08-Sep-2002 thorpej

Build a .gdbinit in the objdir when building a program. The .gdbinit
file sets the shared library prefix to ${DESTDIR}, and adds "sources"
directives for each file listed in the GDBINIT Makefile variable.


# 1.156 09-Aug-2002 thorpej

Add LIBPMC.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.155 27-Mar-2002 eeh

branches: 1.155.2;
Use the medium low model for sparc64 programs that don't 2GB of data segment.


# 1.154 11-Feb-2002 mycroft

Don't use .PHONY for targets that are actually installed. Instead use force
dependencies. (Among other things, `make -t install' does something vaguely
sensible now.)


# 1.153 07-Feb-2002 pk

Mark installed system libraries as .MADE only if we're actually establishing
their default variable values here.


# 1.152 04-Feb-2002 christos

s/.NOSUFF/.MADE/


# 1.151 03-Feb-2002 christos

Apply a .NOSUFF: directive to targets we don't want to have processed by
the suffix rules engine.


# 1.150 02-Feb-2002 veego

Ups, it is LIBUSBHID and not LIBUSBHIB.


# 1.149 02-Feb-2002 veego

Change LIBUSB to LIBUSBHIB, reflecting the library name change.


# 1.148 29-Jan-2002 enami

Mark the targets clean{extra,objs} as PHONY.


# 1.147 04-Jan-2002 thorpej

For PROG_CXX DESTDIR builds, pull in -lstdc++ and -lm regardless
of GCC version.


# 1.146 01-Jan-2002 thorpej

Per a suggestion from matthew green, PROG_CXX takes the place of
PROG for C++ programs.


# 1.145 01-Jan-2002 thorpej

* If PROG_CXX is set by the program's Makefile, use ${CXX} to link
the program rather than ${CC}.
* If HAVE_GCC3 is defined, pull in "-lstdc++ -lm" as additional C++
support libraries for DESTDIR builds.


# 1.144 28-Dec-2001 lukem

* 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


# 1.143 28-Nov-2001 tv

If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.


# 1.142 19-Nov-2001 thorpej

Use a little transitional hack to determine if we use -isystem
or -idirafter. Use the former only of USE_NEW_TOOLCHAIN, since
-isystem causes the old toolchain to bomb out when building
libstdc++.


# 1.141 14-Nov-2001 tv

C/..$/.c/ -> C/\..$/.c/


# 1.140 14-Nov-2001 tv

Move the DESTDIR-based nostdinc logic to bsd.lib.mk and bsd.prog.mk where
it belongs (with the native target compile rules).


# 1.139 02-Nov-2001 tv

Use INSTALL_FILE/INSTALL_DIR as appropriate.


# 1.138 02-Nov-2001 tv

Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.


# 1.137 19-Oct-2001 tv

Add .NOPATH for all files generated from .l or .y files in SRCS. Fixes PRs
bin/14187 and lib/14239.

Also simplify the handling of these transforms to .c and .h files a bit by
leveraging make's builtin macro operators.


# 1.136 25-Sep-2001 tv

Set .NOPATH on program to build to make sure it goes in .OBJDIR.
Problem noted by <seebs@plethora.net>.


# 1.135 24-Sep-2001 lukem

fix previous (hi thor!) - $OBJS and $CLEANFILES might be empty, and
rm needs some files to delete...


# 1.134 24-Sep-2001 tls

Split "cleanprog" target apart: now you can zap only object files or
CLEANFILES (needed to fix crunchgen lossage).


# 1.133 13-Sep-2001 thorpej

Add LIBPCI.


# 1.132 14-Aug-2001 tv

Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").


# 1.131 01-Jun-2001 tv

Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).


# 1.130 08-May-2001 sommerfeld

Suppress duplicate entries in ALLFILES, FILES, INCS, DEPINCS, INFOFILES,
NLSALL, CATPAGES, MANPAGES, HTMLPAGES, and SCRIPTS.


# 1.129 19-Feb-2001 jmc

Wrap target() checks around afterdepend rule as some Makefiles override this


# 1.128 26-Jan-2001 itojun

fix typo in LIBSSL decl. it made programs with DPADD+=${LIBSSL} to build
every time we type "make". From: bernd


# 1.127 14-Jan-2001 christos

use the new .if commands(<target>) directive so that we don't have to
change Makefiles.


# 1.126 14-Jan-2001 christos

fix thinko: test for the existance of the target before we define it...


# 1.125 14-Jan-2001 christos

Alter previous redefined target protection. If the ${PROG} target is defined,
add the dependencies as usual, but don't add the commands. This avoids
having to change all the Makefiles that redefine the PROG target.


# 1.124 14-Jan-2001 christos

allow programs to override the program target.


# 1.123 08-Jan-2001 mrg

add missing $LIBCRYPTO_RC5 and $LIBCRYPTO_IDEA


# 1.122 08-Jan-2001 mrg

add missing $LIBSSL


# 1.121 04-Jan-2001 garbled

Add LIBCDK and LIBFORM definitions


# 1.120 31-Oct-2000 itojun

add ${LIBINTL} for use with DPADD.


# 1.119 07-Oct-2000 deberg

fix typos, PR 11159


# 1.118 25-Jun-2000 erh

For the case when DESTDIR is set: move the -L${DESTDIR}/usr/lib after ${LDADD} so any -L directories set in LDADD are searched first to avoid possibly linking against old versions of libraries.


Revision tags: netbsd-1-5-base
# 1.117 19-Jun-2000 thorpej

branches: 1.117.2;
Sync up the LIB* list.


# 1.116 10-Jun-2000 mycroft

Use ${.ALLSRC:T} when doing the generated variable name lookups, so that it
DTRT for generated files in and obj directory (or accessed via .PATH).


# 1.115 06-Jun-2000 mycroft

Abuse .USE some more.


# 1.114 06-Jun-2000 mycroft

Minor rearrangement.


# 1.113 06-Jun-2000 mycroft

Use ODE make(1) features to eliminate extra variables and move several things
outside of .for loops. (Needs more work to completely eliminate .for.)

XXX Don't look at this stuff. It will make your head hurt.


Revision tags: minoura-xpg4dl-base
# 1.112 14-Apr-2000 mrg

branches: 1.112.2;
use -rpath-link rather than -R when linking objects using a DESTDIR.
this replaces the previous change as that ended up adding
$DESTDIR/usr/lib to the runtime path of every binary created, which
is bogus and dangerous.


# 1.111 25-Mar-2000 mycroft

When linking with $DESTDIR, use an explicit -R to get library dependencies
correct.


# 1.110 07-Mar-2000 veego

Remove unused libahdi.
It will be replaced in the future with a more generic libdisklabel.


# 1.109 05-Feb-2000 jdc

Add libahdi entries.


# 1.108 23-Jan-2000 eeh

Add some support for FCode binaries.


# 1.107 22-Jan-2000 mycroft

Make `dependall' play nicely with SUBDIR, using a hack similar to `realinstall'
for both `depend' and `all'.
Also, remove the old hack that invokes an extra shell for .depend, now that
make(1) has been fixed.


# 1.106 16-Jan-2000 assar

all: depend on ${SCRIPTS} so that they get generated if they need to


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.105 23-Nov-1999 blymn

Added libmenu library.


Revision tags: comdex-fall-1999-base
# 1.104 14-Sep-1999 perry

branches: 1.104.4;
Add a "dependall" target, which does a "make depend" and then "make all"
in a single directory. This is useful in "make build" because by doing
the build immediately after the depend, all sources will typically
still be in the buffer cache, thus saving significant time over doing
a "make depend" on all the directories and then a "make all".


# 1.103 04-Sep-1999 fredb

Permit "make all install", as well as "make foo install" (where foo would be
installed by "make install") without setting of BUILD. All cases where BUILD
is already set are unchanged from the old behavior.

"make all install" is now practically equivalent to "make BUILD= all install",
but without actually setting build.

Fixes pr's 8313, 3894.


# 1.102 21-Aug-1999 simonb

Add ${INSTPRIV} to ${INSTALL} commands.


# 1.101 01-Jul-1999 itojun

branches: 1.101.2;
add LIBIPSEC for use from DPADD.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.100 12-Feb-1999 lukem

branches: 1.100.2;
* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.99 10-Feb-1999 tv

libbfd_pic.a is no longer installed; remove ${LIBBFD} define.


# 1.98 04-Feb-1999 christos

PR/2936: Brian C. Grayson: Avoid truncating precious files when installing
and the filesystem is full. Added ${RENAME} flag to install, which when set
to -r installs on a temporary file and then renames to the final destination.
${RENAME} is currently set to nothing in bsd.own.mk, but one can turn it
on in /etc/mk.conf.


# 1.97 07-Nov-1998 jonathan

Do DESTDIR support for crtbegin/crtend on all ELF ports (adds mips).


# 1.96 28-Sep-1998 christos

Use preserve flag in install.


# 1.95 10-Sep-1998 ross

Define a LIBBZ2?=... for use in DPADD=... lines.


# 1.94 09-Aug-1998 lukem

add distclean as a synonym for cleandir


# 1.93 09-Apr-1998 tv

.y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.


# 1.92 01-Apr-1998 tv

Revert. This broke too much in the build tree, and a better solution
needs to be created. (The existing situation breaks a lot too.)


# 1.91 01-Apr-1998 tv

Fix .y rules to DTRT with possibly generated .h files. See mail on
tech-toolchain for a very detailed explanation of this. In short, add
a .y.h rule identical to the .y.c rule and make the .y.c rule rename
the .h file; also, clean the .h file in CLEANFILES.


# 1.90 03-Nov-1997 cgd

echo the lint command line when making 'lint'.


# 1.89 28-Oct-1997 lukem

add ${LIBOBJC}


Revision tags: netbsd-1-3-base
# 1.88 11-Oct-1997 mycroft

branches: 1.88.2;
Several changes:
* Allow bsd.man.mk to be included separately.
* Always include bsd.own.mk and bsd.obj.mk.
* Include bsd.man.mk and bsd.nls.mk even if NOMAN or NONLS; just turn off
building of the affected files instead.
* Require bsd.subdir.mk to be included explicitly.
(Will make appropriate changes to Makefiles shortly.)


# 1.87 29-Sep-1997 gwr

Add $LIBBFD


# 1.86 31-May-1997 cjs

Back out BUILDDIR and NOINSTALL changes.


# 1.85 26-May-1997 cjs

branches: 1.85.2;
These updates to the build allow building against include files
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.


# 1.84 18-May-1997 kleink

Add libposix.


# 1.83 17-May-1997 mycroft

Do LINKS and SYMLINKS after FILES and INCS.


# 1.82 17-May-1997 mycroft

Remove unneeded .SUFFIXES lines, and move .s and .S closer to .o to give the
right preferences.


# 1.81 09-May-1997 mycroft

Fix typo in previous.


# 1.80 09-May-1997 mycroft

Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.79 09-May-1997 mycroft

Remove cruft.


# 1.78 09-May-1997 mycroft

Oops; rearrange dependencies to get things built early enough.


# 1.77 09-May-1997 mycroft

Make sure INCS and SRCS are built if necessary.


# 1.76 08-May-1997 gwr

Set the .NOPATH flag for ${OBJS} (from Christos).


# 1.75 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.74 07-May-1997 mycroft

Various simplifications.


# 1.73 07-May-1997 mycroft

Shuffle some .PHONYs around, to work better with `-t'.


# 1.72 06-May-1997 mycroft

Make most of the install targets .PRECIOUS.


# 1.71 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.70 18-Apr-1997 christos

Add ${LIBNTP}


# 1.69 17-Apr-1997 thorpej

- Properly depend on crtbegin.o and crtend.o for platforms that use
them (currently Alpha and PowerPC)
- STRIP -> STRIPFLAG


# 1.68 03-Apr-1997 mikel

don't allow override of all: target


# 1.67 29-Mar-1997 mikel

merge lite-2 changes (mostly SCCSids)


# 1.66 27-Mar-1997 christos

Put the FILES generated rules in a separate .mk file since both bsd.prog.mk
and bsd.lib.mk use them.


# 1.65 27-Mar-1997 mycroft

Make the SCRIPTS case mimic the FILES case more closely, so we can override
the destination direectory, etc.


# 1.64 27-Mar-1997 mycroft

Remove knowledge of HIDEGAME from here.


# 1.63 24-Mar-1997 christos

make rules update:
- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation


# 1.62 22-Mar-1997 perry

Fix SYMLINKS not to include DESTDIR in the link itself


# 1.61 13-Mar-1997 perry

add SYMLINKS, by analogy to LINKS. Vetted by Christos.


# 1.60 22-Jan-1997 cgd

if 'clean' is not already defined, rather than simply defining it with
a bunch of rules, define a clean{kmod,lib,prog} target with the rules,
and have both clean and cleandir depend on that. That eliminates a bug
where 'cleandir' in a directory which included e.g. bsd.prog.mk but which
also had subdirs would 'make clean' all the subdirs and then 'make cleandir'
all ofthe subdirs. It also allows Makefiles to add more dependencies
to 'clean' after inclusion of the make template.

If 'clean' is already defined, the behaviour is the same as it used to be.


# 1.59 20-Dec-1996 cgd

add an afterdepend target (a la the one in bsd.lib.mk) that processes
the .depend file to add <filename>.ln for each <filename>.o as an
object file which has the given dependencies (in addition to
<filename>.po and <filename>.so, which were already there).


# 1.58 13-Dec-1996 mikel

add missing LIBPCAP definition.


# 1.57 26-Nov-1996 mrg

add libz and libwrap


# 1.56 18-Oct-1996 thorpej

Use ${INSTALL} rather than "install".
From Simon J. Gerraty <sjg@zen.void.oz.au>, PR #1458.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.55 08-Apr-1996 jtc

Sort LIBFOO definitions and add LIBY; Reported by Mike Long <mike.long@analog.com> in PR #2301.


# 1.54 22-Oct-1995 christos

Added include file <bsd.sys.mk> that contains lex and yacc "parallel aware"
rules. These rules are not turned on by default; they are enabled by setting
the PARALLEL variable.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.53 25-Jun-1995 cgd

oops; fix an rm that might be empty


# 1.52 24-Jun-1995 cgd

update lint rules, but keep linting disabled


# 1.51 10-Jun-1995 mycroft

Define LIBEDIT.


# 1.50 21-Apr-1995 jtc

.include <bsd.nls.mk> unless NONLS is defined.


# 1.49 22-Dec-1994 cgd

specify man pages differently, and document how.


# 1.48 24-Aug-1994 mycroft

Include bsd.own.mk earlier.


# 1.47 20-Jul-1994 cgd

fix from christos, for progs w/o objects


Revision tags: netbsd-1-0-base
# 1.46 06-Jul-1994 mycroft

branches: 1.46.2;
Pull libraries from ${DESTDIR} if set. Kill LDONLY, which is unused and
probably not useful anyway.


# 1.45 30-Jun-1994 cgd

fix modify-info-nothingness-then-substitute probelm that broke genclass build


# 1.44 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.43 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.42 28-Jun-1994 jtc

Strip *.sh when constructing OBJS from SRCS.
This will allow us to clean up makefiles that build a script by munging
a template (uusched, genclass, neqn, etc.).


# 1.41 18-Jun-1994 cgd

don't chown the symlink, when HIDEGAME causes a symlink to be made to dm.
4.4-based FS code _follows_ the symlinks on a chown(2) call.


# 1.40 24-May-1994 cgd

fix the last to do the right thing for dependencies


# 1.39 24-May-1994 deraadt

LIBSKEY


# 1.38 22-May-1994 jtc

Single source file programs are now compiled into object files before they
are linked. This change halves the time it takes to rebuild all of the
NetBSD sources when only the C library is "touched"; but only takes about
one percent more disk space.


# 1.37 06-Apr-1994 chopps

relink (recompile) single source programs when crt0.o is updated.


# 1.36 24-Mar-1994 mycroft

Remove *.core on clean.


# 1.35 09-Feb-1994 cgd

kill install -d's.


# 1.34 28-Jan-1994 cgd

add LIBKVM


# 1.33 10-Nov-1993 cgd

librpc doesn't exist anymore


# 1.32 08-Nov-1993 cgd

ad LDSTATIC flag, so static linking can be made one-stop shopping.
use "setenv LDSTATIC" to make *everything* dynamically linked,
setenv LDSTATIC -static for everything statically linked, or unset
it for default behavior.


# 1.31 07-Oct-1993 cgd

LIBTERM pointed at nothing, but was meant to point to libtermcap.a...


# 1.30 07-Oct-1993 cgd

always define LIBCRYPT


# 1.29 17-Aug-1993 mycroft

Make sure we don't recurse into subdirectories if Makefile specified `install'
target. (It's usually blank and is specifically to avoid doing this...)


# 1.28 15-Aug-1993 mycroft

Automatically include bsd.subdir.mk for backward compatibility.


# 1.27 15-Aug-1993 mycroft

Don't automatically include bsd.subdir.mk in bsd.prog.mk and bsd.lib.mk.
Put back .MAIN in bsd.man.mk, and be careful not to include ../Makefile.inc
a second time.


# 1.26 15-Aug-1993 mycroft

Move man rules to sys.mk.
Use bsd.subdir.mk for building subdirectories.
Don't forget to remove x.cc and x.C when using SHAREDSTRINGS.
Make ${PROG} always depend on ${LIBCRT0}.
Don't duplicate code between cleandir and clean.
Move tags target to bsd.dep.mk.
Move STRIP to bsd.own.mk.
Remove redundant definitions of {BIN,MAN}{DIR,GRP,OWN,MODE}.
Move {LIB,DOC}{DIR,GRP,OWN,MODE} defaults to bsd.own.mk.


# 1.25 15-Aug-1993 mycroft

Abstract out dependency stuff, and add RCS identifiers.


# 1.24 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


# 1.23 10-Aug-1993 mycroft

Put LINKS handling in `install' target, so it's the last thing executed, and
happens even if `realinstall' is user-defined.


# 1.22 30-Jul-1993 mycroft

When generating a default OBJS, ignore .h files.


# 1.21 29-Jul-1993 mycroft

Don't print the `making ...' message if an obj dir already exists.
Also, a minor cleanup.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.20 17-Jul-1993 mycroft

Fix C++ dependencies for good. `make depend' is now done in two passes--one
of C files and one for C++ files. No need to specify `-+' in your Makefile,
as it is now done automatically.


# 1.19 17-Jul-1993 cgd

do c++ dependencies the right way...


# 1.18 17-Jul-1993 mycroft

Add suffix rules for C++ files.


# 1.17 04-Jun-1993 brezak

Add LIBRPCSVC variable.


# 1.16 02-Jun-1993 cgd

add ability to specify c++ dependencies, by setting CFLAGS+=-+ for
the dependency make.


# 1.15 26-Apr-1993 cgd

added definition for DPADD library variable LIBCRYPT.


# 1.14 26-Apr-1993 mycroft

Don't redefine `realinstall' target if already defined.


# 1.13 25-Apr-1993 mycroft

Link with LDFLAGS even if one source module.


# 1.12 25-Apr-1993 mycroft

Don't lose if we include bsd.prog.mk only to build man pages.


# 1.11 25-Apr-1993 mycroft

Fix error in last change. (Oops.)


# 1.10 25-Apr-1993 mycroft

Don't build man pages if NOMAN set.


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.9 09-Apr-1993 cgd

various changes to default make rules. from patch 101.
note that only the "sensible" changes in patch 101 are implemented.


# 1.8 08-Apr-1993 cgd

try to do the right thing, in terms making directories before we
install into them, and get the manpage cleans _OUT_ of "clean".
they don't belong there, only in cleandir, WFJ be damned.


# 1.7 08-Apr-1993 cgd

fixed typos...


# 1.6 08-Apr-1993 cgd

(silently) make sure we have directories before installing


# 1.5 04-Apr-1993 cgd

make LIBRPC point to the right place


# 1.4 27-Mar-1993 nate

Fixed the doc macros to call troff, eqn,and tbl instead of ditroff,
deqn, and dtbl.
Fixed make clean to remove the man pages (Bill fixed this in the distribution,
but not in the original source)
Changed install to leave the original file around, by using 'cp' instead of
'mv'. "install -c ..."


# 1.3 23-Mar-1993 cgd

made .CURDIR be absolute, not relative, thereby eliminating
the need for some of the makefile trickery when making objects,
and fixing a few .PATH bugs


# 1.2 22-Mar-1993 cgd

fixed "make obj" for cases when sources not in /usr/src/...
if sources not there, it now mkdirs obj, but some trickery
is necessary, to avoid deleting cwd.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.307 21-May-2017 riastradh

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.


# 1.306 21-May-2017 riastradh

Remove some vestiges of MKCRYPTO_IDEA/MKCRYPTO_MDC2.


# 1.305 21-May-2017 riastradh

Remove MKCRYPTO_RC5. Unconditionally include RC5 in libcrypto.so.

This option existed only because RC5 is covered by patents that, twenty
years ago, we had reason to suspect the patent holder, RSA, Inc., might
litigate. The two US patents in question are 5,724,428 and 5,835,600.

According to the USPTO Patent Term Calculator web site at
<https://www.uspto.gov/patent/laws-and-regulations/patent-term-calculator#heading-5>
(retrieved 2017-05-21), patents filed after 1995-06-07 expire twenty
years after the filing date.

number filing date
5,724,428 1995-11-01
5,835,600 1997-04-21

Thus, these patents appear to be expired.

As proposed on tech-crypto and tech-security:

https://mail-index.netbsd.org/tech-crypto/2017/05/05/msg000718.html
https://mail-index.netbsd.org/tech-security/2017/05/05/msg000927.html


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.304 19-Apr-2017 joerg

Add netpgpverify to the library list.


Revision tags: pgoyette-localcount-20170320
# 1.303 20-Feb-2017 rin

add missing LIBCXX


# 1.302 08-Feb-2017 kamil

libpthread_dbg(3) deletion from the base distribution

libpthread_dbg(3) is a remnant library from the M:N thread model
(pre-NetBSD-5.0) API to introspect threads within a process and for use
of debuggers.

Currently in the 1:1 model it's not used in GDB neither in LLDB and it's
not either planned to be used. It's current function to read pthread_t
structures is realizable within a regular debugger capable to
instrospect objects within a tracee (GDB, LLDB...).

Remaining users of this API can still use this library from
pkgsrc/devel/libpthread_dbg.

Sponsored by <The NetBSD Foundation>


# 1.301 29-Jan-2017 christos

add sqlite3 to statically linked libraries for pam.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914
# 1.300 20-Aug-2016 christos

branches: 1.300.2;
unbound additions


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.299 04-Apr-2016 joerg

branches: 1.299.2;
If the per-target LDSTATIC flag is set, don't include the PIE linker
flags as we currently don't support static PIE.


# 1.298 30-Mar-2016 martin

Pass -pie to cc, not -Wl,-pie. This way we have a chance to fix specs
for obscure corner cases like -pie -fPIE -static (used for
/usr/tests/lib/csu/h_initfini2 if building with MKPIE=yes).
While there also replace -fPIC with -fPIE for the PIE case, even if
it should be mostly equivalent.


# 1.297 12-Mar-2016 mrg

remove conditionals that are always true with GCC >= 4.8.


# 1.296 21-Feb-2016 christos

Add NODEBUG


# 1.295 31-Jan-2016 christos

Introduce NOPIE and NOCTF so that standalone programs build properly.


# 1.294 23-Jan-2016 christos

Define _KERNTYPES for things that need it.


# 1.293 07-Nov-2015 joerg

LIBEXECINFO


# 1.292 07-Jun-2015 matt

Make LIBCRT* depend on the right files if MLIBDIR from MKCOMPAT is defined.


# 1.291 01-Dec-2014 erh

PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilt
if any of their dependencies (i.e. the files they refer to) are changed.
This allows changes to transitive included headers to be handled properly.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.290 25-Mar-2014 ozaki-r

branches: 1.290.4;
Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.


Revision tags: riastradh-drm2-base3
# 1.289 09-Mar-2014 christos

let's see if the new dwarf library can handle dwarf 4


# 1.288 02-Mar-2014 christos

If we are compiling with -g and using gcc4.8 and dtrace downgrade
dwarf generation to version 2 for now.


# 1.287 15-Jan-2014 joerg

-Wl,-pie and -r don't agree with each other, so filter the former out.


# 1.286 11-Nov-2013 joerg

Relink binaries if crti.o changes.


# 1.285 29-Sep-2013 christos

Add libxcb


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.284 31-May-2013 mrg

add LIBX11_XCB; unfortunately since the library is named with a -
in it, we have to use an ugly hard coded assignment for now.
(could be cleaned up with more make variable magic i'm sure.)


# 1.283 04-Apr-2013 christos

ldopts should be before ldadd like everywhere else.


Revision tags: agc-symver-base
# 1.282 14-Feb-2013 christos

Since the libraries are produced with different MK flags than the programs,
we check for existance of the files instead of the MK flags.


# 1.281 14-Feb-2013 christos

Add PROGDPLIBS


# 1.280 26-Jan-2013 christos

CTFCONVERT me harder.


Revision tags: yamt-pagecache-base8
# 1.279 17-Jan-2013 christos

Now that we have separate debug sets, add -g if ${MKDEBUG} is set for
program builds since we don't need to install that symbol files.


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.278 24-Aug-2012 jmmv

branches: 1.278.2;
Allow DPADD to be specified on a per-program basis.


# 1.277 23-Aug-2012 joerg

Revert last, it breaks the tricks xsrc uses.


# 1.276 23-Aug-2012 joerg

Remove SHLIBINSTALLDIR and SHLINKINSTALLLIBDIR. Add rpath entries, if
SHLIBDIR differs from /usr/lib.


# 1.275 08-Aug-2012 christos

add MKRUMP by popular demand.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.274 29-Feb-2012 tron

Move "libexpat" from X11 into base which fixes PR lib/40346.
This change was approved by the Core Group.


# 1.273 21-Feb-2012 matt

Remove another ${SIZE}


# 1.272 20-Feb-2012 matt

Remove ${SIZE}


# 1.271 19-Feb-2012 matt

Add support for --combine with gcc.


Revision tags: netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2
# 1.270 05-Nov-2011 christos

branches: 1.270.2;
Add libtre


Revision tags: yamt-pagecache-base
# 1.269 16-Oct-2011 christos

branches: 1.269.2;
- no need to special-case libraries with weird characters.
- add a note about adding new libraries.


# 1.268 16-Oct-2011 christos

fix list of libraries to reflect reality.


# 1.267 10-Sep-2011 apb

Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.


# 1.266 27-Aug-2011 joerg

Add new "analyze" command to run clang's static analyzer in a directory
on all C/C++ files.


Revision tags: cherry-xenmp-base
# 1.265 26-Apr-2011 he

The new Heimdal adds -lwind and -lheimbase to the set of libraries,
so define the corresponding LIB* variables.
These are also needed in the PAM_STATIC_* variables, so add them there too.


# 1.264 11-Apr-2011 joerg

Adjust --sysroot related usage:
-Wl,-rpath does not expand =, so just drop it.

Drop -Wl,-rpath-link entries that duplicate the -Wl,-rpath entries, this
is done implicitly now that ld is built with sysroot support.

Use ${DESTDIR} explicitly for the remaining -Wl,-rpath-link entries.


# 1.263 10-Apr-2011 joerg

For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.


# 1.262 08-Mar-2011 jmmv

Revert previous (revision 1.261): it broke the build because PROG_CXX is
defined in terms of PROG, so later on we would end up with target duplicates
because both PROG_CXX and PROG were being converted to PROGS_CXX and PROGS.

Did not catch this earlier because the test build I did was not clean and
thus the duplicate targets did not have nasty effects.


# 1.261 07-Mar-2011 jmmv

Always convert PROG to its plural form independently of whether PROG_CXX
is defined or not. From Garrett Cooper in private mail.


Revision tags: bouyer-quota2-nbase
# 1.260 20-Feb-2011 jmmv

Define LIBATF_C and LIBATF_CXX to point to their corresponding .a files and
use these to properly set DPADD for test programs.


Revision tags: bouyer-quota2-base
# 1.259 13-Feb-2011 christos

add saslc


# 1.258 06-Feb-2011 joerg

Don't use -nostdinc or -nostdinc++ if this is included in a HOSTLIB.


# 1.257 17-Jan-2011 pooka

branches: 1.257.2;
Add rump bits to DPSRCS so that update builds work correctly.


Revision tags: matt-mips64-premerge-20101231
# 1.256 13-Dec-2010 pooka

befriend RUMPPRG with CRUNCHEDPRG


# 1.255 13-Dec-2010 pooka

Define RUMPPRG, which is just like PROG, except it additionally
builds a rump client with the name rump.${PROG}. The rump client
is not installed suid/sgid by default even if BINMODE is defined.


# 1.254 10-Dec-2010 joerg

Revert last, gcc(1) checks explicitly for -r on some platforms to disable
passing down --relax as well.


# 1.253 08-Dec-2010 joerg

gcc passes down -r directly to ld, so make it explicitly a linker option.


# 1.252 08-Dec-2010 joerg

Don't depend on ${CC} passing down -R to ld, use -Wl,-rpath explicitly.


# 1.251 08-Nov-2010 lukem

Preserve date on original shared library or program when stripping
the debug symbols and adding the debug-link to .debug.
Use '(rm -f file; false)' in the failure path to force failure.
Based on solution proposed by Nicolas Joly on tech-toolchain in July 2010.
Should fix PR toolchain/44046 from Andreas Gustafsson.


# 1.250 31-Oct-2010 mbalmer

Link Lua to the build and add the resulting files to the distribution sets.
Document the addition of Lua and the change we made to the default settings.


# 1.249 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.248 24-Apr-2010 lukem

When extracting separate debug symbols with MKDEBUG, there's no need
to leave the original file unstripped...


# 1.247 02-Mar-2010 darran

DTrace: Add CTF generation to the make framework. Only enabled when
MKDTRACE=yes.


# 1.246 14-Dec-2009 mrg

use "${CC} -r" not "${CC} -Wl,-r" as the latter fools GCC on some targets
and it ends up passing "-r -relax" to ld, which causes ld to barf.


# 1.245 14-Dec-2009 matt

Merge from matt-nb5-mips64


Revision tags: matt-premerge-20091211
# 1.244 08-Dec-2009 uebayasi

When PROGS / LIBS are used, you can pass each PROG / LIB specific parameters
to ${LD} via:

${LDADD.${PROG}}
${LDFLAGS.${PROG}}
${LDSTATIC.${PROG}}
${LDADD.${LIB}}
${LDFLAGS.${LIB}}

OTOH you can't pass parameters to ${CC}, because in suffix rules make(1) only
knows the name of ${.IMPSRC} and ${.TARGET}; it's users' responsivility to
define ${CC} parameters to all the sources of a given ${PROG} / ${LIB}.

Should address bin/42381.

(Bug in this commit log was pointed out by mrg@.)


# 1.243 27-Nov-2009 tsutsui

If CPPFLAGS or CXXFLAGS already contains -nostdinc or -nostdinc++,
don't add ${CPPFLAGS_ISYSTEM} or ${CPPFLAGS_ISYSTEMXX} to refer
${DESTDIR}/usr/include or ${DESTDIR}/usr/include/g++.

This change might cause errors on some MD stand dir, but in that case
each Makefile should be fixed to search proper system include paths
by -Ipath option in own CPPFLAGS.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.242 12-May-2009 plunky

remove libsdp as improved functionality has been enabled in libbluetooth.


# 1.241 10-Apr-2009 apb

Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links. They have no effect except when using a
metalog, in which case the information is added to the metalog. In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg. This should fix PR 24457 and PR 41155.


# 1.240 24-Nov-2008 cube

branches: 1.240.2;
Move cleanextra to the very ends in case another included file wants to add
to it even if it was initially empty.


Revision tags: netbsd-5-base matt-mips64-base2
# 1.239 19-Oct-2008 christos

branches: 1.239.2;
handle assembly files for MKPIE


# 1.238 16-Oct-2008 christos

Provide a way for a program to override the PIE flags.


# 1.237 15-Oct-2008 christos

don't compile/link libraries with pie


Revision tags: mjf-devfs2-base
# 1.236 02-Oct-2008 joerg

Hook up libfetch and pkg_install update.


Revision tags: wrstuden-revivesa-base-3
# 1.235 09-Sep-2008 joerg

Add MKSTRIPIDENT to remove the RCS IDs from binary programs and shared
libraries for space-constraint systems. The description is based on the
feedback of hubertf@, the logic on input from lukem@

This obsoletes the removal of LIBC_SCCS and SYSLIBC_SCCS for libc builds.


Revision tags: wrstuden-revivesa-base-2
# 1.234 28-Aug-2008 mrg

update a comment example


# 1.233 27-Aug-2008 rtr

use ${X11USRLIBDIR} instead of hard-coded /usr/X11R6/lib when building
${LIB.foo} vars


# 1.232 27-Aug-2008 lukem

Fix problem I introduced in rev 1.231 on 2008/08/25 where ${_PROGLDOPTS}
and -L${_GCC_LIBGCCDIR} were appearing in the link line before ${LDADD},
so -L${DESTDIR}/lib and -L${DESTDIR}/usr/lib were being used before
local -L library paths.
Fixes ntpd/ntpdate failure noticed by Valeriy E. Ushakov <uwe@NetBSD.org>


# 1.231 25-Aug-2008 lukem

Always link with: -Wl,-rpath-link,${DESTDIR}/usr/lib -L${DESTDIR}/usr/lib
Fixes problem with MKDYNAMICROOT=no triggered by libraries that depend
on other libraries.
Related to PR 33503.

Clean up setting of _CCLINK to always add the appropriate -B options.

Simplify the link rule for a program.


# 1.230 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.229 28-May-2008 lukem

add LIBLDAR_R (for completeness)


# 1.228 22-May-2008 lukem

Add MKLDAP, USE_LDAP, LIBLBER, LIBLDAP


Revision tags: hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-pf42-base
# 1.227 10-Apr-2008 tsutsui

branches: 1.227.2; 1.227.4;
Add libhx509 to PAM_STATIC_LDADD which is required by libkrb5.


# 1.226 22-Mar-2008 mlelstv

branches: 1.226.2;
Import Heimdal-1.1


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase matt-armv6-base hpcarm-cleanup-base
# 1.225 26-Dec-2007 jmmv

Make the clean target work when OBJS is set but PROG is not, as happens
for example in gnu/lib/crtstuff4. Reported by drochner@.


Revision tags: cube-autoconf-base
# 1.224 13-Nov-2007 jmmv

Fix typo that prevented MKDEBUG builds to work. Found by drochner@.


# 1.223 12-Nov-2007 jmmv

Add the ability to build multiple programs from a single directory

This adds support for a new set of variables, PROGS and PROGS_CXX, that
allow the developer to build multiple different programs from a single
source directory.


# 1.222 04-Nov-2007 tls

Remove MKPRIVATELIB from BIND libraries; move library reachover
directories and Makefiles from src/usr.sbin/bind to src/lib; make
BIND libraries build shared. Saves about 1MB-1.5MB per installed
executable, about 5MB for a base+etc minimal installation of NetBSD.


Revision tags: matt-mips64-base
# 1.221 29-Jul-2007 joerg

branches: 1.221.4; 1.221.6;
Add build glue for libarchive and update the various sets.


# 1.220 25-Jan-2007 perry

Before I completely forget the issue, convert "PROG_PAX" to the
better-named "PAXCTL_FLAGS".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.219 11-Nov-2006 christos

don't run paxctl if other commands were specified for that target.


# 1.218 10-Nov-2006 christos

if ${PROG_PAX} is defined, run paxctl on the binary after linking with
the value of the variable. This way, if you set:

PROG_PAX=+M

in /etc/mk.conf, you get what you deserve.


# 1.217 22-Oct-2006 pooka

libpuffs


# 1.216 09-Oct-2006 mrg

- clean up some comments to reality.
- retire LIBDCK, LIBG2C and (long broken) USE_LIBSTDCXX
- in bsd.hostprog.mk's LIBSTDCPP -> LIBSTDCC
- add LIBSUPCXX
- don't default USE_LIBSTDCXX or USE_GCC4 since they are
not used in the tree any where
- same with USE_XF86_4; retire it
- remove _SUPCXX handling in bsd.prog.mk

inspired by PR#26714.


Revision tags: abandoned-netbsd-4-base
# 1.215 23-Jul-2006 lukem

Implement MKDEBUG:
If "no", don't build and install separate debugging symbols
into /usr/libdata/debug.
Default: no


# 1.214 19-Jun-2006 gdamore

Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.


# 1.213 09-Jun-2006 christos

PR/33681: Scott Ellis: Building 'bc' with SHAREDSTRINGS=yes fails
We need CPPFLAGS too now.


# 1.212 11-May-2006 mrg

add support for ${OBJCOPTS} and ${OBJCOPTS}.<lib|prog|fn>.


# 1.211 20-Mar-2006 christos

There is always one more KRB4 thing to remove. (from Jukka Salmi)


# 1.210 20-Mar-2006 christos

Remove krb4 variables and libraries (Jukka Salmi)


# 1.209 16-Mar-2006 jwise

Now that we have real build system support for syspkgs, remove someone's
half-implemented idea of building `syspkgs' (really a few giant blobs of the
same granularity of the old sets) using install(1).


# 1.208 20-Jan-2006 christos

Add the world of libraries to the static pam build. Now static pam binaries
work.


# 1.207 09-Apr-2005 dsl

Report when we link a program into xxx.ro (before being crunched)


Revision tags: netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.206 04-Mar-2005 he

branches: 1.206.2; 1.206.4;
Introduce PAM_STATIC_LDADD and PAM_STATIC_DPADD. When compiling
with MKPIC=no, possibly because the target does not support shared
libraries, these include libraries required to resolve all symbols
which end up referenced from PAM-using applications. The libraries
presently required are -lcrypt, -lrpcsvc and -lutil.

Add use of these variables which are currently set up to use PAM,
so that they compile when MKPIC=no.

Also, in the telnetd case, reorder the order of the libraries, so
that libtelnet.a comes before -ltermcap and -lutil, again to fix
link error when MKPIC=no.

Discussed with thorpej and christos.


# 1.205 20-Feb-2005 christos

Add libradius


# 1.204 12-Jan-2005 lukem

If RESCUEDIR is defined, automatically add that to CPPFLAGS


# 1.203 08-Jan-2005 lukem

Implement <bsd.prog.mk> vars:
LIBASN1 LIBBSDMALLOC LIBG2C LIBPAM LIBSSH


# 1.202 04-Aug-2004 lukem

Revert most of previous, and move the LIB<libname>?= assignments
back to bsd.prog.mk from bsd.own.mk.

pkgsrc uses <bsd.own.mk>, and setting LIB<libname> in it causes
problems with various package builds.
This should fix PR #26542 submitted by Jim Bernard.

(I'll be implementing the DPADD for shared libraries in a different
manner that generally won't depend upon ${LIB<libname>}.)


# 1.201 30-Jul-2004 lukem

Move the LIB<libname>?= assignments from bsd.prog.mk to bsd.own.mk so
that they may be used by non PROGs (e.g., LIBs).

Improve some comments.


# 1.200 10-Jun-2004 lukem

Be consistent in handling YHEADER, similar to Christos' fix in bsd.lib.mk 1.253


# 1.199 21-May-2004 ross

If you add a library, you need to define its DPADD symbol here.

Add LIBMAGIC.


Revision tags: netbsd-2-0-base
# 1.198 15-Feb-2004 skrll

branches: 1.198.2;
Be more gcc like in the way we deal with libgcc so that sh3/hppa millicode
and exception handling have a chance of working properly.

- creates libgcc, libgcc_eh and libgcc_s

- updates LIBGCC_SPEC to use them appropriately.

There's a hack in here at the moment with respect to libgcc_so in that it
is preferable to link against libgcc_so will only when -shared-libgcc is
specified (the c++ frontend does this automatically.) Configurations where
LINK_EH_SPEC is defined already do this. The gcc configuration for
NetBSD/alpha and another NetBSD platform (I forget which) actually define
LINK_EH_SPEC probably by accident rather than design.

- updates share/mk to use the compiler's knowledge of what needs linking into
libraries and executables. This removes an hppa hack.

- updates the sets for the newly created libgcc* files.

- support for linking against the _pg version of libgcc has been removed.


# 1.197 29-Jan-2004 lukem

Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.


# 1.196 27-Jan-2004 lukem

Replace
:M-[IDU]*
with
:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)


# 1.195 23-Jan-2004 simonb

crt0.o lives in /usr/lib even on a.out.


# 1.194 16-Nov-2003 lukem

simplify with _MKTARGET_LINK


# 1.193 11-Nov-2003 dsl

Set MKDEP_SUFFIXES to get additional targets in .depend instead of using
sed in .afterdepend. I don't think .afterdepend is used anywhere any more.


# 1.192 21-Oct-2003 lukem

Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.


# 1.191 19-Oct-2003 lukem

Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} " ... {$.TARGET}" and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO


# 1.190 18-Oct-2003 lukem

Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command ("verbose")
This is the default, and is equivalent to the previous behaviour.


# 1.189 29-Sep-2003 lukem

Add LIBSTDCXX (for usr/lib/libstdc++.a).
Sync LIB* documentation with reality.


# 1.188 19-Sep-2003 martin

Drop explicit medlow model and default to -O2 for sparc64.


# 1.187 14-Sep-2003 lukem

Check ${SHLIBDIR} against "/usr/lib" instead of ${LIBDIR} when determining
if we need to add stuff (usually "/lib") to the rpath-link path before
"/usr/lib". Otherwise, this barfs if LIBDIR != /usr/lib or /lib, and
we're cross-building (e.g., in src/x11)


# 1.186 13-Sep-2003 erh

Also support per-program LDFLAGS and LDSTATIC.


# 1.185 13-Sep-2003 erh

Create a way to add additional flags to COPTS, CPPFLAGS, CXXFLAGS and LDADD
for particular libraries or programs by specifying the additions in mk.conf
instead of needing to go edit individual Makefiles.


# 1.184 12-Sep-2003 lukem

add infrastructure to support reach-over builds of xsrc


# 1.183 22-Aug-2003 dsl

Add a ${PROG}.ro target that does an 'ld -r' of the program object files.
Allows a much simplified build of 'crunched' binaries since crunchgen can
build prog.ro instead of having to deretmine the names of all the .o files.


# 1.182 01-Aug-2003 lukem

Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".


# 1.181 01-Aug-2003 lukem

simplify the ${PROG}: target to reduce duplication between the DESTDIR
and !DESTDIR cases...


# 1.180 31-Jul-2003 lukem

bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.


# 1.179 31-Jul-2003 lukem

Don't need -R/usr/lib; it will be searched at the end by ld.elf_so anyway.
Noted by matt green <mrg@>


# 1.178 28-Jul-2003 lukem

be consistent when adding *.y and *.l to DPSRCS


# 1.177 28-Jul-2003 lukem

replace MKCXXSUPCXX(!=no) with USE_LIBSTDCXX(==no)


# 1.176 28-Jul-2003 lukem

Change defined(CXX_SUPCXX) to MKCXXSUPCXX != "no".

Clarify that command-line overrides of the MKxxx variables should be
done via the environment rather than make(1) command-line variable
assignment, since the latter doesn't actually work as intended.


# 1.175 27-Jul-2003 mrg

introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes. for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)


# 1.174 26-Jul-2003 mrg

add a new bsd.own.mk variable: CXX_SUPCXX. from bsd.README:
+ CXX_SUPCXX If defined, the support libraries needed for this C++ program
+ are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.


# 1.173 20-Jul-2003 lukem

Consistently support the different C++ file extensions: .cc .cpp .cxx .C
Noted by Andrew White in PR toolchain/18246


# 1.172 18-Jul-2003 lukem

Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was defined.
Replace defined(UNPRIVED) tests with ${MKUNPRIVED} != "no"

Add MKUPDATE; if not no has the same semantics as if UPDATE was defined.
Replace defined(UPDATE) tests with ${MKUPDATE} != "no"

Improve documentation for these and other make flags.


# 1.171 16-Jul-2003 itojun

stop installing install libtelnet. build under lib/libtelnet and reference
it from usr.bin/telnet and libexec/telnetd.
(reason for separate build: compiler flags)


# 1.170 27-Jun-2003 drochner

For consistency, use "-R" instead of "-Wl,-rpath" to pass
a runtime search path to the linker.


# 1.169 13-Jun-2003 itojun

define LIBEVENT


# 1.168 11-Jun-2003 msaitoh

catch signal 1,2,3,13 and 15 to clean /tmp/_dependXXX


# 1.167 31-May-2003 thorpej

If EXTERNAL_TOOLCHAIN is defined, allow the compiler to define the
location of crt{begin,end}{,S}.o and libgcc.a. Encapsulate all of
this logic into the new bsd.gcc.mk, and use it in bsd.prog.mk and
bsd.lib.mk.


# 1.166 18-May-2003 lukem

make this a no-op if HOSTPROG is defined


# 1.165 30-Mar-2003 thorpej

If MACHINE_ARCH is powerpc and we HAVE_GCC3, add crtsaveres.o to the
endfile spec.


# 1.164 22-Feb-2003 uwe

Typo in comment.


# 1.163 24-Jan-2003 thorpej

Add LIBPTHREAD, LIBPTHREAD_DB, and LIBRT.


Revision tags: fvdl_fs64_base
# 1.162 22-Nov-2002 thorpej

Split crtbegin/crtend into crti/crtbegin/crtend/crtn. NetBSD-specific
things like the .note.netbsd.ident section are provided by crti/crtn.
crti/crtn also provide the _init() and _fini() routines.

crtbegin/crtend now only provide support for ctors/dtors. This paves
the way to using the "crtstuff" provided with GCC (when we upgrade to
GCC 3.3), which provides, among other things, much better C++/Java
exception handling.


# 1.161 12-Nov-2002 itohy

MKDYNAMICROOT for a.out


# 1.160 22-Oct-2002 perry

Pass 1 of SYSPKG changes to automatically add tags=pkgname_pkg to METALOG.
Not quite ready for prime time yet.


# 1.159 27-Sep-2002 thorpej

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.


# 1.158 26-Sep-2002 itojun

MDC2 is a patented algorithm; don't ship it in default libcrypto.
MKCRYPTO_MDC2 will build a separate library, libcrypto_mdc2.


# 1.157 08-Sep-2002 thorpej

Build a .gdbinit in the objdir when building a program. The .gdbinit
file sets the shared library prefix to ${DESTDIR}, and adds "sources"
directives for each file listed in the GDBINIT Makefile variable.


# 1.156 09-Aug-2002 thorpej

Add LIBPMC.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.155 27-Mar-2002 eeh

branches: 1.155.2;
Use the medium low model for sparc64 programs that don't 2GB of data segment.


# 1.154 11-Feb-2002 mycroft

Don't use .PHONY for targets that are actually installed. Instead use force
dependencies. (Among other things, `make -t install' does something vaguely
sensible now.)


# 1.153 07-Feb-2002 pk

Mark installed system libraries as .MADE only if we're actually establishing
their default variable values here.


# 1.152 04-Feb-2002 christos

s/.NOSUFF/.MADE/


# 1.151 03-Feb-2002 christos

Apply a .NOSUFF: directive to targets we don't want to have processed by
the suffix rules engine.


# 1.150 02-Feb-2002 veego

Ups, it is LIBUSBHID and not LIBUSBHIB.


# 1.149 02-Feb-2002 veego

Change LIBUSB to LIBUSBHIB, reflecting the library name change.


# 1.148 29-Jan-2002 enami

Mark the targets clean{extra,objs} as PHONY.


# 1.147 04-Jan-2002 thorpej

For PROG_CXX DESTDIR builds, pull in -lstdc++ and -lm regardless
of GCC version.


# 1.146 01-Jan-2002 thorpej

Per a suggestion from matthew green, PROG_CXX takes the place of
PROG for C++ programs.


# 1.145 01-Jan-2002 thorpej

* If PROG_CXX is set by the program's Makefile, use ${CXX} to link
the program rather than ${CC}.
* If HAVE_GCC3 is defined, pull in "-lstdc++ -lm" as additional C++
support libraries for DESTDIR builds.


# 1.144 28-Dec-2001 lukem

* 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


# 1.143 28-Nov-2001 tv

If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.


# 1.142 19-Nov-2001 thorpej

Use a little transitional hack to determine if we use -isystem
or -idirafter. Use the former only of USE_NEW_TOOLCHAIN, since
-isystem causes the old toolchain to bomb out when building
libstdc++.


# 1.141 14-Nov-2001 tv

C/..$/.c/ -> C/\..$/.c/


# 1.140 14-Nov-2001 tv

Move the DESTDIR-based nostdinc logic to bsd.lib.mk and bsd.prog.mk where
it belongs (with the native target compile rules).


# 1.139 02-Nov-2001 tv

Use INSTALL_FILE/INSTALL_DIR as appropriate.


# 1.138 02-Nov-2001 tv

Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.


# 1.137 19-Oct-2001 tv

Add .NOPATH for all files generated from .l or .y files in SRCS. Fixes PRs
bin/14187 and lib/14239.

Also simplify the handling of these transforms to .c and .h files a bit by
leveraging make's builtin macro operators.


# 1.136 25-Sep-2001 tv

Set .NOPATH on program to build to make sure it goes in .OBJDIR.
Problem noted by <seebs@plethora.net>.


# 1.135 24-Sep-2001 lukem

fix previous (hi thor!) - $OBJS and $CLEANFILES might be empty, and
rm needs some files to delete...


# 1.134 24-Sep-2001 tls

Split "cleanprog" target apart: now you can zap only object files or
CLEANFILES (needed to fix crunchgen lossage).


# 1.133 13-Sep-2001 thorpej

Add LIBPCI.


# 1.132 14-Aug-2001 tv

Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").


# 1.131 01-Jun-2001 tv

Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).


# 1.130 08-May-2001 sommerfeld

Suppress duplicate entries in ALLFILES, FILES, INCS, DEPINCS, INFOFILES,
NLSALL, CATPAGES, MANPAGES, HTMLPAGES, and SCRIPTS.


# 1.129 19-Feb-2001 jmc

Wrap target() checks around afterdepend rule as some Makefiles override this


# 1.128 26-Jan-2001 itojun

fix typo in LIBSSL decl. it made programs with DPADD+=${LIBSSL} to build
every time we type "make". From: bernd


# 1.127 14-Jan-2001 christos

use the new .if commands(<target>) directive so that we don't have to
change Makefiles.


# 1.126 14-Jan-2001 christos

fix thinko: test for the existance of the target before we define it...


# 1.125 14-Jan-2001 christos

Alter previous redefined target protection. If the ${PROG} target is defined,
add the dependencies as usual, but don't add the commands. This avoids
having to change all the Makefiles that redefine the PROG target.


# 1.124 14-Jan-2001 christos

allow programs to override the program target.


# 1.123 08-Jan-2001 mrg

add missing $LIBCRYPTO_RC5 and $LIBCRYPTO_IDEA


# 1.122 08-Jan-2001 mrg

add missing $LIBSSL


# 1.121 04-Jan-2001 garbled

Add LIBCDK and LIBFORM definitions


# 1.120 31-Oct-2000 itojun

add ${LIBINTL} for use with DPADD.


# 1.119 07-Oct-2000 deberg

fix typos, PR 11159


# 1.118 25-Jun-2000 erh

For the case when DESTDIR is set: move the -L${DESTDIR}/usr/lib after ${LDADD} so any -L directories set in LDADD are searched first to avoid possibly linking against old versions of libraries.


Revision tags: netbsd-1-5-base
# 1.117 19-Jun-2000 thorpej

branches: 1.117.2;
Sync up the LIB* list.


# 1.116 10-Jun-2000 mycroft

Use ${.ALLSRC:T} when doing the generated variable name lookups, so that it
DTRT for generated files in and obj directory (or accessed via .PATH).


# 1.115 06-Jun-2000 mycroft

Abuse .USE some more.


# 1.114 06-Jun-2000 mycroft

Minor rearrangement.


# 1.113 06-Jun-2000 mycroft

Use ODE make(1) features to eliminate extra variables and move several things
outside of .for loops. (Needs more work to completely eliminate .for.)

XXX Don't look at this stuff. It will make your head hurt.


Revision tags: minoura-xpg4dl-base
# 1.112 14-Apr-2000 mrg

branches: 1.112.2;
use -rpath-link rather than -R when linking objects using a DESTDIR.
this replaces the previous change as that ended up adding
$DESTDIR/usr/lib to the runtime path of every binary created, which
is bogus and dangerous.


# 1.111 25-Mar-2000 mycroft

When linking with $DESTDIR, use an explicit -R to get library dependencies
correct.


# 1.110 07-Mar-2000 veego

Remove unused libahdi.
It will be replaced in the future with a more generic libdisklabel.


# 1.109 05-Feb-2000 jdc

Add libahdi entries.


# 1.108 23-Jan-2000 eeh

Add some support for FCode binaries.


# 1.107 22-Jan-2000 mycroft

Make `dependall' play nicely with SUBDIR, using a hack similar to `realinstall'
for both `depend' and `all'.
Also, remove the old hack that invokes an extra shell for .depend, now that
make(1) has been fixed.


# 1.106 16-Jan-2000 assar

all: depend on ${SCRIPTS} so that they get generated if they need to


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.105 23-Nov-1999 blymn

Added libmenu library.


Revision tags: comdex-fall-1999-base
# 1.104 14-Sep-1999 perry

branches: 1.104.4;
Add a "dependall" target, which does a "make depend" and then "make all"
in a single directory. This is useful in "make build" because by doing
the build immediately after the depend, all sources will typically
still be in the buffer cache, thus saving significant time over doing
a "make depend" on all the directories and then a "make all".


# 1.103 04-Sep-1999 fredb

Permit "make all install", as well as "make foo install" (where foo would be
installed by "make install") without setting of BUILD. All cases where BUILD
is already set are unchanged from the old behavior.

"make all install" is now practically equivalent to "make BUILD= all install",
but without actually setting build.

Fixes pr's 8313, 3894.


# 1.102 21-Aug-1999 simonb

Add ${INSTPRIV} to ${INSTALL} commands.


# 1.101 01-Jul-1999 itojun

branches: 1.101.2;
add LIBIPSEC for use from DPADD.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.100 12-Feb-1999 lukem

branches: 1.100.2;
* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.99 10-Feb-1999 tv

libbfd_pic.a is no longer installed; remove ${LIBBFD} define.


# 1.98 04-Feb-1999 christos

PR/2936: Brian C. Grayson: Avoid truncating precious files when installing
and the filesystem is full. Added ${RENAME} flag to install, which when set
to -r installs on a temporary file and then renames to the final destination.
${RENAME} is currently set to nothing in bsd.own.mk, but one can turn it
on in /etc/mk.conf.


# 1.97 07-Nov-1998 jonathan

Do DESTDIR support for crtbegin/crtend on all ELF ports (adds mips).


# 1.96 28-Sep-1998 christos

Use preserve flag in install.


# 1.95 10-Sep-1998 ross

Define a LIBBZ2?=... for use in DPADD=... lines.


# 1.94 09-Aug-1998 lukem

add distclean as a synonym for cleandir


# 1.93 09-Apr-1998 tv

.y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.


# 1.92 01-Apr-1998 tv

Revert. This broke too much in the build tree, and a better solution
needs to be created. (The existing situation breaks a lot too.)


# 1.91 01-Apr-1998 tv

Fix .y rules to DTRT with possibly generated .h files. See mail on
tech-toolchain for a very detailed explanation of this. In short, add
a .y.h rule identical to the .y.c rule and make the .y.c rule rename
the .h file; also, clean the .h file in CLEANFILES.


# 1.90 03-Nov-1997 cgd

echo the lint command line when making 'lint'.


# 1.89 28-Oct-1997 lukem

add ${LIBOBJC}


Revision tags: netbsd-1-3-base
# 1.88 11-Oct-1997 mycroft

branches: 1.88.2;
Several changes:
* Allow bsd.man.mk to be included separately.
* Always include bsd.own.mk and bsd.obj.mk.
* Include bsd.man.mk and bsd.nls.mk even if NOMAN or NONLS; just turn off
building of the affected files instead.
* Require bsd.subdir.mk to be included explicitly.
(Will make appropriate changes to Makefiles shortly.)


# 1.87 29-Sep-1997 gwr

Add $LIBBFD


# 1.86 31-May-1997 cjs

Back out BUILDDIR and NOINSTALL changes.


# 1.85 26-May-1997 cjs

branches: 1.85.2;
These updates to the build allow building against include files
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.


# 1.84 18-May-1997 kleink

Add libposix.


# 1.83 17-May-1997 mycroft

Do LINKS and SYMLINKS after FILES and INCS.


# 1.82 17-May-1997 mycroft

Remove unneeded .SUFFIXES lines, and move .s and .S closer to .o to give the
right preferences.


# 1.81 09-May-1997 mycroft

Fix typo in previous.


# 1.80 09-May-1997 mycroft

Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.79 09-May-1997 mycroft

Remove cruft.


# 1.78 09-May-1997 mycroft

Oops; rearrange dependencies to get things built early enough.


# 1.77 09-May-1997 mycroft

Make sure INCS and SRCS are built if necessary.


# 1.76 08-May-1997 gwr

Set the .NOPATH flag for ${OBJS} (from Christos).


# 1.75 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.74 07-May-1997 mycroft

Various simplifications.


# 1.73 07-May-1997 mycroft

Shuffle some .PHONYs around, to work better with `-t'.


# 1.72 06-May-1997 mycroft

Make most of the install targets .PRECIOUS.


# 1.71 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.70 18-Apr-1997 christos

Add ${LIBNTP}


# 1.69 17-Apr-1997 thorpej

- Properly depend on crtbegin.o and crtend.o for platforms that use
them (currently Alpha and PowerPC)
- STRIP -> STRIPFLAG


# 1.68 03-Apr-1997 mikel

don't allow override of all: target


# 1.67 29-Mar-1997 mikel

merge lite-2 changes (mostly SCCSids)


# 1.66 27-Mar-1997 christos

Put the FILES generated rules in a separate .mk file since both bsd.prog.mk
and bsd.lib.mk use them.


# 1.65 27-Mar-1997 mycroft

Make the SCRIPTS case mimic the FILES case more closely, so we can override
the destination direectory, etc.


# 1.64 27-Mar-1997 mycroft

Remove knowledge of HIDEGAME from here.


# 1.63 24-Mar-1997 christos

make rules update:
- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation


# 1.62 22-Mar-1997 perry

Fix SYMLINKS not to include DESTDIR in the link itself


# 1.61 13-Mar-1997 perry

add SYMLINKS, by analogy to LINKS. Vetted by Christos.


# 1.60 22-Jan-1997 cgd

if 'clean' is not already defined, rather than simply defining it with
a bunch of rules, define a clean{kmod,lib,prog} target with the rules,
and have both clean and cleandir depend on that. That eliminates a bug
where 'cleandir' in a directory which included e.g. bsd.prog.mk but which
also had subdirs would 'make clean' all the subdirs and then 'make cleandir'
all ofthe subdirs. It also allows Makefiles to add more dependencies
to 'clean' after inclusion of the make template.

If 'clean' is already defined, the behaviour is the same as it used to be.


# 1.59 20-Dec-1996 cgd

add an afterdepend target (a la the one in bsd.lib.mk) that processes
the .depend file to add <filename>.ln for each <filename>.o as an
object file which has the given dependencies (in addition to
<filename>.po and <filename>.so, which were already there).


# 1.58 13-Dec-1996 mikel

add missing LIBPCAP definition.


# 1.57 26-Nov-1996 mrg

add libz and libwrap


# 1.56 18-Oct-1996 thorpej

Use ${INSTALL} rather than "install".
From Simon J. Gerraty <sjg@zen.void.oz.au>, PR #1458.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.55 08-Apr-1996 jtc

Sort LIBFOO definitions and add LIBY; Reported by Mike Long <mike.long@analog.com> in PR #2301.


# 1.54 22-Oct-1995 christos

Added include file <bsd.sys.mk> that contains lex and yacc "parallel aware"
rules. These rules are not turned on by default; they are enabled by setting
the PARALLEL variable.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.53 25-Jun-1995 cgd

oops; fix an rm that might be empty


# 1.52 24-Jun-1995 cgd

update lint rules, but keep linting disabled


# 1.51 10-Jun-1995 mycroft

Define LIBEDIT.


# 1.50 21-Apr-1995 jtc

.include <bsd.nls.mk> unless NONLS is defined.


# 1.49 22-Dec-1994 cgd

specify man pages differently, and document how.


# 1.48 24-Aug-1994 mycroft

Include bsd.own.mk earlier.


# 1.47 20-Jul-1994 cgd

fix from christos, for progs w/o objects


Revision tags: netbsd-1-0-base
# 1.46 06-Jul-1994 mycroft

branches: 1.46.2;
Pull libraries from ${DESTDIR} if set. Kill LDONLY, which is unused and
probably not useful anyway.


# 1.45 30-Jun-1994 cgd

fix modify-info-nothingness-then-substitute probelm that broke genclass build


# 1.44 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.43 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.42 28-Jun-1994 jtc

Strip *.sh when constructing OBJS from SRCS.
This will allow us to clean up makefiles that build a script by munging
a template (uusched, genclass, neqn, etc.).


# 1.41 18-Jun-1994 cgd

don't chown the symlink, when HIDEGAME causes a symlink to be made to dm.
4.4-based FS code _follows_ the symlinks on a chown(2) call.


# 1.40 24-May-1994 cgd

fix the last to do the right thing for dependencies


# 1.39 24-May-1994 deraadt

LIBSKEY


# 1.38 22-May-1994 jtc

Single source file programs are now compiled into object files before they
are linked. This change halves the time it takes to rebuild all of the
NetBSD sources when only the C library is "touched"; but only takes about
one percent more disk space.


# 1.37 06-Apr-1994 chopps

relink (recompile) single source programs when crt0.o is updated.


# 1.36 24-Mar-1994 mycroft

Remove *.core on clean.


# 1.35 09-Feb-1994 cgd

kill install -d's.


# 1.34 28-Jan-1994 cgd

add LIBKVM


# 1.33 10-Nov-1993 cgd

librpc doesn't exist anymore


# 1.32 08-Nov-1993 cgd

ad LDSTATIC flag, so static linking can be made one-stop shopping.
use "setenv LDSTATIC" to make *everything* dynamically linked,
setenv LDSTATIC -static for everything statically linked, or unset
it for default behavior.


# 1.31 07-Oct-1993 cgd

LIBTERM pointed at nothing, but was meant to point to libtermcap.a...


# 1.30 07-Oct-1993 cgd

always define LIBCRYPT


# 1.29 17-Aug-1993 mycroft

Make sure we don't recurse into subdirectories if Makefile specified `install'
target. (It's usually blank and is specifically to avoid doing this...)


# 1.28 15-Aug-1993 mycroft

Automatically include bsd.subdir.mk for backward compatibility.


# 1.27 15-Aug-1993 mycroft

Don't automatically include bsd.subdir.mk in bsd.prog.mk and bsd.lib.mk.
Put back .MAIN in bsd.man.mk, and be careful not to include ../Makefile.inc
a second time.


# 1.26 15-Aug-1993 mycroft

Move man rules to sys.mk.
Use bsd.subdir.mk for building subdirectories.
Don't forget to remove x.cc and x.C when using SHAREDSTRINGS.
Make ${PROG} always depend on ${LIBCRT0}.
Don't duplicate code between cleandir and clean.
Move tags target to bsd.dep.mk.
Move STRIP to bsd.own.mk.
Remove redundant definitions of {BIN,MAN}{DIR,GRP,OWN,MODE}.
Move {LIB,DOC}{DIR,GRP,OWN,MODE} defaults to bsd.own.mk.


# 1.25 15-Aug-1993 mycroft

Abstract out dependency stuff, and add RCS identifiers.


# 1.24 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


# 1.23 10-Aug-1993 mycroft

Put LINKS handling in `install' target, so it's the last thing executed, and
happens even if `realinstall' is user-defined.


# 1.22 30-Jul-1993 mycroft

When generating a default OBJS, ignore .h files.


# 1.21 29-Jul-1993 mycroft

Don't print the `making ...' message if an obj dir already exists.
Also, a minor cleanup.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.20 17-Jul-1993 mycroft

Fix C++ dependencies for good. `make depend' is now done in two passes--one
of C files and one for C++ files. No need to specify `-+' in your Makefile,
as it is now done automatically.


# 1.19 17-Jul-1993 cgd

do c++ dependencies the right way...


# 1.18 17-Jul-1993 mycroft

Add suffix rules for C++ files.


# 1.17 04-Jun-1993 brezak

Add LIBRPCSVC variable.


# 1.16 02-Jun-1993 cgd

add ability to specify c++ dependencies, by setting CFLAGS+=-+ for
the dependency make.


# 1.15 26-Apr-1993 cgd

added definition for DPADD library variable LIBCRYPT.


# 1.14 26-Apr-1993 mycroft

Don't redefine `realinstall' target if already defined.


# 1.13 25-Apr-1993 mycroft

Link with LDFLAGS even if one source module.


# 1.12 25-Apr-1993 mycroft

Don't lose if we include bsd.prog.mk only to build man pages.


# 1.11 25-Apr-1993 mycroft

Fix error in last change. (Oops.)


# 1.10 25-Apr-1993 mycroft

Don't build man pages if NOMAN set.


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.9 09-Apr-1993 cgd

various changes to default make rules. from patch 101.
note that only the "sensible" changes in patch 101 are implemented.


# 1.8 08-Apr-1993 cgd

try to do the right thing, in terms making directories before we
install into them, and get the manpage cleans _OUT_ of "clean".
they don't belong there, only in cleandir, WFJ be damned.


# 1.7 08-Apr-1993 cgd

fixed typos...


# 1.6 08-Apr-1993 cgd

(silently) make sure we have directories before installing


# 1.5 04-Apr-1993 cgd

make LIBRPC point to the right place


# 1.4 27-Mar-1993 nate

Fixed the doc macros to call troff, eqn,and tbl instead of ditroff,
deqn, and dtbl.
Fixed make clean to remove the man pages (Bill fixed this in the distribution,
but not in the original source)
Changed install to leave the original file around, by using 'cp' instead of
'mv'. "install -c ..."


# 1.3 23-Mar-1993 cgd

made .CURDIR be absolute, not relative, thereby eliminating
the need for some of the makefile trickery when making objects,
and fixing a few .PATH bugs


# 1.2 22-Mar-1993 cgd

fixed "make obj" for cases when sources not in /usr/src/...
if sources not there, it now mkdirs obj, but some trickery
is necessary, to avoid deleting cwd.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


Revision tags: prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1
# 1.304 19-Apr-2017 joerg

Add netpgpverify to the library list.


Revision tags: pgoyette-localcount-20170320
# 1.303 20-Feb-2017 rin

add missing LIBCXX


# 1.302 08-Feb-2017 kamil

libpthread_dbg(3) deletion from the base distribution

libpthread_dbg(3) is a remnant library from the M:N thread model
(pre-NetBSD-5.0) API to introspect threads within a process and for use
of debuggers.

Currently in the 1:1 model it's not used in GDB neither in LLDB and it's
not either planned to be used. It's current function to read pthread_t
structures is realizable within a regular debugger capable to
instrospect objects within a tracee (GDB, LLDB...).

Remaining users of this API can still use this library from
pkgsrc/devel/libpthread_dbg.

Sponsored by <The NetBSD Foundation>


# 1.301 29-Jan-2017 christos

add sqlite3 to statically linked libraries for pam.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914
# 1.300 20-Aug-2016 christos

branches: 1.300.2;
unbound additions


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.299 04-Apr-2016 joerg

branches: 1.299.2;
If the per-target LDSTATIC flag is set, don't include the PIE linker
flags as we currently don't support static PIE.


# 1.298 30-Mar-2016 martin

Pass -pie to cc, not -Wl,-pie. This way we have a chance to fix specs
for obscure corner cases like -pie -fPIE -static (used for
/usr/tests/lib/csu/h_initfini2 if building with MKPIE=yes).
While there also replace -fPIC with -fPIE for the PIE case, even if
it should be mostly equivalent.


# 1.297 12-Mar-2016 mrg

remove conditionals that are always true with GCC >= 4.8.


# 1.296 21-Feb-2016 christos

Add NODEBUG


# 1.295 31-Jan-2016 christos

Introduce NOPIE and NOCTF so that standalone programs build properly.


# 1.294 23-Jan-2016 christos

Define _KERNTYPES for things that need it.


# 1.293 07-Nov-2015 joerg

LIBEXECINFO


# 1.292 07-Jun-2015 matt

Make LIBCRT* depend on the right files if MLIBDIR from MKCOMPAT is defined.


# 1.291 01-Dec-2014 erh

PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilt
if any of their dependencies (i.e. the files they refer to) are changed.
This allows changes to transitive included headers to be handled properly.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.290 25-Mar-2014 ozaki-r

branches: 1.290.4;
Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.


Revision tags: riastradh-drm2-base3
# 1.289 09-Mar-2014 christos

let's see if the new dwarf library can handle dwarf 4


# 1.288 02-Mar-2014 christos

If we are compiling with -g and using gcc4.8 and dtrace downgrade
dwarf generation to version 2 for now.


# 1.287 15-Jan-2014 joerg

-Wl,-pie and -r don't agree with each other, so filter the former out.


# 1.286 11-Nov-2013 joerg

Relink binaries if crti.o changes.


# 1.285 29-Sep-2013 christos

Add libxcb


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.284 31-May-2013 mrg

add LIBX11_XCB; unfortunately since the library is named with a -
in it, we have to use an ugly hard coded assignment for now.
(could be cleaned up with more make variable magic i'm sure.)


# 1.283 04-Apr-2013 christos

ldopts should be before ldadd like everywhere else.


Revision tags: agc-symver-base
# 1.282 14-Feb-2013 christos

Since the libraries are produced with different MK flags than the programs,
we check for existance of the files instead of the MK flags.


# 1.281 14-Feb-2013 christos

Add PROGDPLIBS


# 1.280 26-Jan-2013 christos

CTFCONVERT me harder.


Revision tags: yamt-pagecache-base8
# 1.279 17-Jan-2013 christos

Now that we have separate debug sets, add -g if ${MKDEBUG} is set for
program builds since we don't need to install that symbol files.


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.278 24-Aug-2012 jmmv

branches: 1.278.2;
Allow DPADD to be specified on a per-program basis.


# 1.277 23-Aug-2012 joerg

Revert last, it breaks the tricks xsrc uses.


# 1.276 23-Aug-2012 joerg

Remove SHLIBINSTALLDIR and SHLINKINSTALLLIBDIR. Add rpath entries, if
SHLIBDIR differs from /usr/lib.


# 1.275 08-Aug-2012 christos

add MKRUMP by popular demand.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.274 29-Feb-2012 tron

Move "libexpat" from X11 into base which fixes PR lib/40346.
This change was approved by the Core Group.


# 1.273 21-Feb-2012 matt

Remove another ${SIZE}


# 1.272 20-Feb-2012 matt

Remove ${SIZE}


# 1.271 19-Feb-2012 matt

Add support for --combine with gcc.


Revision tags: netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2
# 1.270 05-Nov-2011 christos

branches: 1.270.2;
Add libtre


Revision tags: yamt-pagecache-base
# 1.269 16-Oct-2011 christos

branches: 1.269.2;
- no need to special-case libraries with weird characters.
- add a note about adding new libraries.


# 1.268 16-Oct-2011 christos

fix list of libraries to reflect reality.


# 1.267 10-Sep-2011 apb

Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.


# 1.266 27-Aug-2011 joerg

Add new "analyze" command to run clang's static analyzer in a directory
on all C/C++ files.


Revision tags: cherry-xenmp-base
# 1.265 26-Apr-2011 he

The new Heimdal adds -lwind and -lheimbase to the set of libraries,
so define the corresponding LIB* variables.
These are also needed in the PAM_STATIC_* variables, so add them there too.


# 1.264 11-Apr-2011 joerg

Adjust --sysroot related usage:
-Wl,-rpath does not expand =, so just drop it.

Drop -Wl,-rpath-link entries that duplicate the -Wl,-rpath entries, this
is done implicitly now that ld is built with sysroot support.

Use ${DESTDIR} explicitly for the remaining -Wl,-rpath-link entries.


# 1.263 10-Apr-2011 joerg

For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.


# 1.262 08-Mar-2011 jmmv

Revert previous (revision 1.261): it broke the build because PROG_CXX is
defined in terms of PROG, so later on we would end up with target duplicates
because both PROG_CXX and PROG were being converted to PROGS_CXX and PROGS.

Did not catch this earlier because the test build I did was not clean and
thus the duplicate targets did not have nasty effects.


# 1.261 07-Mar-2011 jmmv

Always convert PROG to its plural form independently of whether PROG_CXX
is defined or not. From Garrett Cooper in private mail.


Revision tags: bouyer-quota2-nbase
# 1.260 20-Feb-2011 jmmv

Define LIBATF_C and LIBATF_CXX to point to their corresponding .a files and
use these to properly set DPADD for test programs.


Revision tags: bouyer-quota2-base
# 1.259 13-Feb-2011 christos

add saslc


# 1.258 06-Feb-2011 joerg

Don't use -nostdinc or -nostdinc++ if this is included in a HOSTLIB.


# 1.257 17-Jan-2011 pooka

branches: 1.257.2;
Add rump bits to DPSRCS so that update builds work correctly.


Revision tags: matt-mips64-premerge-20101231
# 1.256 13-Dec-2010 pooka

befriend RUMPPRG with CRUNCHEDPRG


# 1.255 13-Dec-2010 pooka

Define RUMPPRG, which is just like PROG, except it additionally
builds a rump client with the name rump.${PROG}. The rump client
is not installed suid/sgid by default even if BINMODE is defined.


# 1.254 10-Dec-2010 joerg

Revert last, gcc(1) checks explicitly for -r on some platforms to disable
passing down --relax as well.


# 1.253 08-Dec-2010 joerg

gcc passes down -r directly to ld, so make it explicitly a linker option.


# 1.252 08-Dec-2010 joerg

Don't depend on ${CC} passing down -R to ld, use -Wl,-rpath explicitly.


# 1.251 08-Nov-2010 lukem

Preserve date on original shared library or program when stripping
the debug symbols and adding the debug-link to .debug.
Use '(rm -f file; false)' in the failure path to force failure.
Based on solution proposed by Nicolas Joly on tech-toolchain in July 2010.
Should fix PR toolchain/44046 from Andreas Gustafsson.


# 1.250 31-Oct-2010 mbalmer

Link Lua to the build and add the resulting files to the distribution sets.
Document the addition of Lua and the change we made to the default settings.


# 1.249 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.248 24-Apr-2010 lukem

When extracting separate debug symbols with MKDEBUG, there's no need
to leave the original file unstripped...


# 1.247 02-Mar-2010 darran

DTrace: Add CTF generation to the make framework. Only enabled when
MKDTRACE=yes.


# 1.246 14-Dec-2009 mrg

use "${CC} -r" not "${CC} -Wl,-r" as the latter fools GCC on some targets
and it ends up passing "-r -relax" to ld, which causes ld to barf.


# 1.245 14-Dec-2009 matt

Merge from matt-nb5-mips64


Revision tags: matt-premerge-20091211
# 1.244 08-Dec-2009 uebayasi

When PROGS / LIBS are used, you can pass each PROG / LIB specific parameters
to ${LD} via:

${LDADD.${PROG}}
${LDFLAGS.${PROG}}
${LDSTATIC.${PROG}}
${LDADD.${LIB}}
${LDFLAGS.${LIB}}

OTOH you can't pass parameters to ${CC}, because in suffix rules make(1) only
knows the name of ${.IMPSRC} and ${.TARGET}; it's users' responsivility to
define ${CC} parameters to all the sources of a given ${PROG} / ${LIB}.

Should address bin/42381.

(Bug in this commit log was pointed out by mrg@.)


# 1.243 27-Nov-2009 tsutsui

If CPPFLAGS or CXXFLAGS already contains -nostdinc or -nostdinc++,
don't add ${CPPFLAGS_ISYSTEM} or ${CPPFLAGS_ISYSTEMXX} to refer
${DESTDIR}/usr/include or ${DESTDIR}/usr/include/g++.

This change might cause errors on some MD stand dir, but in that case
each Makefile should be fixed to search proper system include paths
by -Ipath option in own CPPFLAGS.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.242 12-May-2009 plunky

remove libsdp as improved functionality has been enabled in libbluetooth.


# 1.241 10-Apr-2009 apb

Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links. They have no effect except when using a
metalog, in which case the information is added to the metalog. In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg. This should fix PR 24457 and PR 41155.


# 1.240 24-Nov-2008 cube

branches: 1.240.2;
Move cleanextra to the very ends in case another included file wants to add
to it even if it was initially empty.


Revision tags: netbsd-5-base matt-mips64-base2
# 1.239 19-Oct-2008 christos

branches: 1.239.2;
handle assembly files for MKPIE


# 1.238 16-Oct-2008 christos

Provide a way for a program to override the PIE flags.


# 1.237 15-Oct-2008 christos

don't compile/link libraries with pie


Revision tags: mjf-devfs2-base
# 1.236 02-Oct-2008 joerg

Hook up libfetch and pkg_install update.


Revision tags: wrstuden-revivesa-base-3
# 1.235 09-Sep-2008 joerg

Add MKSTRIPIDENT to remove the RCS IDs from binary programs and shared
libraries for space-constraint systems. The description is based on the
feedback of hubertf@, the logic on input from lukem@

This obsoletes the removal of LIBC_SCCS and SYSLIBC_SCCS for libc builds.


Revision tags: wrstuden-revivesa-base-2
# 1.234 28-Aug-2008 mrg

update a comment example


# 1.233 27-Aug-2008 rtr

use ${X11USRLIBDIR} instead of hard-coded /usr/X11R6/lib when building
${LIB.foo} vars


# 1.232 27-Aug-2008 lukem

Fix problem I introduced in rev 1.231 on 2008/08/25 where ${_PROGLDOPTS}
and -L${_GCC_LIBGCCDIR} were appearing in the link line before ${LDADD},
so -L${DESTDIR}/lib and -L${DESTDIR}/usr/lib were being used before
local -L library paths.
Fixes ntpd/ntpdate failure noticed by Valeriy E. Ushakov <uwe@NetBSD.org>


# 1.231 25-Aug-2008 lukem

Always link with: -Wl,-rpath-link,${DESTDIR}/usr/lib -L${DESTDIR}/usr/lib
Fixes problem with MKDYNAMICROOT=no triggered by libraries that depend
on other libraries.
Related to PR 33503.

Clean up setting of _CCLINK to always add the appropriate -B options.

Simplify the link rule for a program.


# 1.230 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.229 28-May-2008 lukem

add LIBLDAR_R (for completeness)


# 1.228 22-May-2008 lukem

Add MKLDAP, USE_LDAP, LIBLBER, LIBLDAP


Revision tags: hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-pf42-base
# 1.227 10-Apr-2008 tsutsui

branches: 1.227.2; 1.227.4;
Add libhx509 to PAM_STATIC_LDADD which is required by libkrb5.


# 1.226 22-Mar-2008 mlelstv

branches: 1.226.2;
Import Heimdal-1.1


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase matt-armv6-base hpcarm-cleanup-base
# 1.225 26-Dec-2007 jmmv

Make the clean target work when OBJS is set but PROG is not, as happens
for example in gnu/lib/crtstuff4. Reported by drochner@.


Revision tags: cube-autoconf-base
# 1.224 13-Nov-2007 jmmv

Fix typo that prevented MKDEBUG builds to work. Found by drochner@.


# 1.223 12-Nov-2007 jmmv

Add the ability to build multiple programs from a single directory

This adds support for a new set of variables, PROGS and PROGS_CXX, that
allow the developer to build multiple different programs from a single
source directory.


# 1.222 04-Nov-2007 tls

Remove MKPRIVATELIB from BIND libraries; move library reachover
directories and Makefiles from src/usr.sbin/bind to src/lib; make
BIND libraries build shared. Saves about 1MB-1.5MB per installed
executable, about 5MB for a base+etc minimal installation of NetBSD.


Revision tags: matt-mips64-base
# 1.221 29-Jul-2007 joerg

branches: 1.221.4; 1.221.6;
Add build glue for libarchive and update the various sets.


# 1.220 25-Jan-2007 perry

Before I completely forget the issue, convert "PROG_PAX" to the
better-named "PAXCTL_FLAGS".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.219 11-Nov-2006 christos

don't run paxctl if other commands were specified for that target.


# 1.218 10-Nov-2006 christos

if ${PROG_PAX} is defined, run paxctl on the binary after linking with
the value of the variable. This way, if you set:

PROG_PAX=+M

in /etc/mk.conf, you get what you deserve.


# 1.217 22-Oct-2006 pooka

libpuffs


# 1.216 09-Oct-2006 mrg

- clean up some comments to reality.
- retire LIBDCK, LIBG2C and (long broken) USE_LIBSTDCXX
- in bsd.hostprog.mk's LIBSTDCPP -> LIBSTDCC
- add LIBSUPCXX
- don't default USE_LIBSTDCXX or USE_GCC4 since they are
not used in the tree any where
- same with USE_XF86_4; retire it
- remove _SUPCXX handling in bsd.prog.mk

inspired by PR#26714.


Revision tags: abandoned-netbsd-4-base
# 1.215 23-Jul-2006 lukem

Implement MKDEBUG:
If "no", don't build and install separate debugging symbols
into /usr/libdata/debug.
Default: no


# 1.214 19-Jun-2006 gdamore

Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.


# 1.213 09-Jun-2006 christos

PR/33681: Scott Ellis: Building 'bc' with SHAREDSTRINGS=yes fails
We need CPPFLAGS too now.


# 1.212 11-May-2006 mrg

add support for ${OBJCOPTS} and ${OBJCOPTS}.<lib|prog|fn>.


# 1.211 20-Mar-2006 christos

There is always one more KRB4 thing to remove. (from Jukka Salmi)


# 1.210 20-Mar-2006 christos

Remove krb4 variables and libraries (Jukka Salmi)


# 1.209 16-Mar-2006 jwise

Now that we have real build system support for syspkgs, remove someone's
half-implemented idea of building `syspkgs' (really a few giant blobs of the
same granularity of the old sets) using install(1).


# 1.208 20-Jan-2006 christos

Add the world of libraries to the static pam build. Now static pam binaries
work.


# 1.207 09-Apr-2005 dsl

Report when we link a program into xxx.ro (before being crunched)


Revision tags: netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.206 04-Mar-2005 he

branches: 1.206.2; 1.206.4;
Introduce PAM_STATIC_LDADD and PAM_STATIC_DPADD. When compiling
with MKPIC=no, possibly because the target does not support shared
libraries, these include libraries required to resolve all symbols
which end up referenced from PAM-using applications. The libraries
presently required are -lcrypt, -lrpcsvc and -lutil.

Add use of these variables which are currently set up to use PAM,
so that they compile when MKPIC=no.

Also, in the telnetd case, reorder the order of the libraries, so
that libtelnet.a comes before -ltermcap and -lutil, again to fix
link error when MKPIC=no.

Discussed with thorpej and christos.


# 1.205 20-Feb-2005 christos

Add libradius


# 1.204 12-Jan-2005 lukem

If RESCUEDIR is defined, automatically add that to CPPFLAGS


# 1.203 08-Jan-2005 lukem

Implement <bsd.prog.mk> vars:
LIBASN1 LIBBSDMALLOC LIBG2C LIBPAM LIBSSH


# 1.202 04-Aug-2004 lukem

Revert most of previous, and move the LIB<libname>?= assignments
back to bsd.prog.mk from bsd.own.mk.

pkgsrc uses <bsd.own.mk>, and setting LIB<libname> in it causes
problems with various package builds.
This should fix PR #26542 submitted by Jim Bernard.

(I'll be implementing the DPADD for shared libraries in a different
manner that generally won't depend upon ${LIB<libname>}.)


# 1.201 30-Jul-2004 lukem

Move the LIB<libname>?= assignments from bsd.prog.mk to bsd.own.mk so
that they may be used by non PROGs (e.g., LIBs).

Improve some comments.


# 1.200 10-Jun-2004 lukem

Be consistent in handling YHEADER, similar to Christos' fix in bsd.lib.mk 1.253


# 1.199 21-May-2004 ross

If you add a library, you need to define its DPADD symbol here.

Add LIBMAGIC.


Revision tags: netbsd-2-0-base
# 1.198 15-Feb-2004 skrll

branches: 1.198.2;
Be more gcc like in the way we deal with libgcc so that sh3/hppa millicode
and exception handling have a chance of working properly.

- creates libgcc, libgcc_eh and libgcc_s

- updates LIBGCC_SPEC to use them appropriately.

There's a hack in here at the moment with respect to libgcc_so in that it
is preferable to link against libgcc_so will only when -shared-libgcc is
specified (the c++ frontend does this automatically.) Configurations where
LINK_EH_SPEC is defined already do this. The gcc configuration for
NetBSD/alpha and another NetBSD platform (I forget which) actually define
LINK_EH_SPEC probably by accident rather than design.

- updates share/mk to use the compiler's knowledge of what needs linking into
libraries and executables. This removes an hppa hack.

- updates the sets for the newly created libgcc* files.

- support for linking against the _pg version of libgcc has been removed.


# 1.197 29-Jan-2004 lukem

Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.


# 1.196 27-Jan-2004 lukem

Replace
:M-[IDU]*
with
:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)


# 1.195 23-Jan-2004 simonb

crt0.o lives in /usr/lib even on a.out.


# 1.194 16-Nov-2003 lukem

simplify with _MKTARGET_LINK


# 1.193 11-Nov-2003 dsl

Set MKDEP_SUFFIXES to get additional targets in .depend instead of using
sed in .afterdepend. I don't think .afterdepend is used anywhere any more.


# 1.192 21-Oct-2003 lukem

Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.


# 1.191 19-Oct-2003 lukem

Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} " ... {$.TARGET}" and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO


# 1.190 18-Oct-2003 lukem

Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command ("verbose")
This is the default, and is equivalent to the previous behaviour.


# 1.189 29-Sep-2003 lukem

Add LIBSTDCXX (for usr/lib/libstdc++.a).
Sync LIB* documentation with reality.


# 1.188 19-Sep-2003 martin

Drop explicit medlow model and default to -O2 for sparc64.


# 1.187 14-Sep-2003 lukem

Check ${SHLIBDIR} against "/usr/lib" instead of ${LIBDIR} when determining
if we need to add stuff (usually "/lib") to the rpath-link path before
"/usr/lib". Otherwise, this barfs if LIBDIR != /usr/lib or /lib, and
we're cross-building (e.g., in src/x11)


# 1.186 13-Sep-2003 erh

Also support per-program LDFLAGS and LDSTATIC.


# 1.185 13-Sep-2003 erh

Create a way to add additional flags to COPTS, CPPFLAGS, CXXFLAGS and LDADD
for particular libraries or programs by specifying the additions in mk.conf
instead of needing to go edit individual Makefiles.


# 1.184 12-Sep-2003 lukem

add infrastructure to support reach-over builds of xsrc


# 1.183 22-Aug-2003 dsl

Add a ${PROG}.ro target that does an 'ld -r' of the program object files.
Allows a much simplified build of 'crunched' binaries since crunchgen can
build prog.ro instead of having to deretmine the names of all the .o files.


# 1.182 01-Aug-2003 lukem

Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".


# 1.181 01-Aug-2003 lukem

simplify the ${PROG}: target to reduce duplication between the DESTDIR
and !DESTDIR cases...


# 1.180 31-Jul-2003 lukem

bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.


# 1.179 31-Jul-2003 lukem

Don't need -R/usr/lib; it will be searched at the end by ld.elf_so anyway.
Noted by matt green <mrg@>


# 1.178 28-Jul-2003 lukem

be consistent when adding *.y and *.l to DPSRCS


# 1.177 28-Jul-2003 lukem

replace MKCXXSUPCXX(!=no) with USE_LIBSTDCXX(==no)


# 1.176 28-Jul-2003 lukem

Change defined(CXX_SUPCXX) to MKCXXSUPCXX != "no".

Clarify that command-line overrides of the MKxxx variables should be
done via the environment rather than make(1) command-line variable
assignment, since the latter doesn't actually work as intended.


# 1.175 27-Jul-2003 mrg

introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes. for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)


# 1.174 26-Jul-2003 mrg

add a new bsd.own.mk variable: CXX_SUPCXX. from bsd.README:
+ CXX_SUPCXX If defined, the support libraries needed for this C++ program
+ are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.


# 1.173 20-Jul-2003 lukem

Consistently support the different C++ file extensions: .cc .cpp .cxx .C
Noted by Andrew White in PR toolchain/18246


# 1.172 18-Jul-2003 lukem

Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was defined.
Replace defined(UNPRIVED) tests with ${MKUNPRIVED} != "no"

Add MKUPDATE; if not no has the same semantics as if UPDATE was defined.
Replace defined(UPDATE) tests with ${MKUPDATE} != "no"

Improve documentation for these and other make flags.


# 1.171 16-Jul-2003 itojun

stop installing install libtelnet. build under lib/libtelnet and reference
it from usr.bin/telnet and libexec/telnetd.
(reason for separate build: compiler flags)


# 1.170 27-Jun-2003 drochner

For consistency, use "-R" instead of "-Wl,-rpath" to pass
a runtime search path to the linker.


# 1.169 13-Jun-2003 itojun

define LIBEVENT


# 1.168 11-Jun-2003 msaitoh

catch signal 1,2,3,13 and 15 to clean /tmp/_dependXXX


# 1.167 31-May-2003 thorpej

If EXTERNAL_TOOLCHAIN is defined, allow the compiler to define the
location of crt{begin,end}{,S}.o and libgcc.a. Encapsulate all of
this logic into the new bsd.gcc.mk, and use it in bsd.prog.mk and
bsd.lib.mk.


# 1.166 18-May-2003 lukem

make this a no-op if HOSTPROG is defined


# 1.165 30-Mar-2003 thorpej

If MACHINE_ARCH is powerpc and we HAVE_GCC3, add crtsaveres.o to the
endfile spec.


# 1.164 22-Feb-2003 uwe

Typo in comment.


# 1.163 24-Jan-2003 thorpej

Add LIBPTHREAD, LIBPTHREAD_DB, and LIBRT.


Revision tags: fvdl_fs64_base
# 1.162 22-Nov-2002 thorpej

Split crtbegin/crtend into crti/crtbegin/crtend/crtn. NetBSD-specific
things like the .note.netbsd.ident section are provided by crti/crtn.
crti/crtn also provide the _init() and _fini() routines.

crtbegin/crtend now only provide support for ctors/dtors. This paves
the way to using the "crtstuff" provided with GCC (when we upgrade to
GCC 3.3), which provides, among other things, much better C++/Java
exception handling.


# 1.161 12-Nov-2002 itohy

MKDYNAMICROOT for a.out


# 1.160 22-Oct-2002 perry

Pass 1 of SYSPKG changes to automatically add tags=pkgname_pkg to METALOG.
Not quite ready for prime time yet.


# 1.159 27-Sep-2002 thorpej

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.


# 1.158 26-Sep-2002 itojun

MDC2 is a patented algorithm; don't ship it in default libcrypto.
MKCRYPTO_MDC2 will build a separate library, libcrypto_mdc2.


# 1.157 08-Sep-2002 thorpej

Build a .gdbinit in the objdir when building a program. The .gdbinit
file sets the shared library prefix to ${DESTDIR}, and adds "sources"
directives for each file listed in the GDBINIT Makefile variable.


# 1.156 09-Aug-2002 thorpej

Add LIBPMC.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.155 27-Mar-2002 eeh

branches: 1.155.2;
Use the medium low model for sparc64 programs that don't 2GB of data segment.


# 1.154 11-Feb-2002 mycroft

Don't use .PHONY for targets that are actually installed. Instead use force
dependencies. (Among other things, `make -t install' does something vaguely
sensible now.)


# 1.153 07-Feb-2002 pk

Mark installed system libraries as .MADE only if we're actually establishing
their default variable values here.


# 1.152 04-Feb-2002 christos

s/.NOSUFF/.MADE/


# 1.151 03-Feb-2002 christos

Apply a .NOSUFF: directive to targets we don't want to have processed by
the suffix rules engine.


# 1.150 02-Feb-2002 veego

Ups, it is LIBUSBHID and not LIBUSBHIB.


# 1.149 02-Feb-2002 veego

Change LIBUSB to LIBUSBHIB, reflecting the library name change.


# 1.148 29-Jan-2002 enami

Mark the targets clean{extra,objs} as PHONY.


# 1.147 04-Jan-2002 thorpej

For PROG_CXX DESTDIR builds, pull in -lstdc++ and -lm regardless
of GCC version.


# 1.146 01-Jan-2002 thorpej

Per a suggestion from matthew green, PROG_CXX takes the place of
PROG for C++ programs.


# 1.145 01-Jan-2002 thorpej

* If PROG_CXX is set by the program's Makefile, use ${CXX} to link
the program rather than ${CC}.
* If HAVE_GCC3 is defined, pull in "-lstdc++ -lm" as additional C++
support libraries for DESTDIR builds.


# 1.144 28-Dec-2001 lukem

* 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


# 1.143 28-Nov-2001 tv

If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.


# 1.142 19-Nov-2001 thorpej

Use a little transitional hack to determine if we use -isystem
or -idirafter. Use the former only of USE_NEW_TOOLCHAIN, since
-isystem causes the old toolchain to bomb out when building
libstdc++.


# 1.141 14-Nov-2001 tv

C/..$/.c/ -> C/\..$/.c/


# 1.140 14-Nov-2001 tv

Move the DESTDIR-based nostdinc logic to bsd.lib.mk and bsd.prog.mk where
it belongs (with the native target compile rules).


# 1.139 02-Nov-2001 tv

Use INSTALL_FILE/INSTALL_DIR as appropriate.


# 1.138 02-Nov-2001 tv

Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.


# 1.137 19-Oct-2001 tv

Add .NOPATH for all files generated from .l or .y files in SRCS. Fixes PRs
bin/14187 and lib/14239.

Also simplify the handling of these transforms to .c and .h files a bit by
leveraging make's builtin macro operators.


# 1.136 25-Sep-2001 tv

Set .NOPATH on program to build to make sure it goes in .OBJDIR.
Problem noted by <seebs@plethora.net>.


# 1.135 24-Sep-2001 lukem

fix previous (hi thor!) - $OBJS and $CLEANFILES might be empty, and
rm needs some files to delete...


# 1.134 24-Sep-2001 tls

Split "cleanprog" target apart: now you can zap only object files or
CLEANFILES (needed to fix crunchgen lossage).


# 1.133 13-Sep-2001 thorpej

Add LIBPCI.


# 1.132 14-Aug-2001 tv

Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").


# 1.131 01-Jun-2001 tv

Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).


# 1.130 08-May-2001 sommerfeld

Suppress duplicate entries in ALLFILES, FILES, INCS, DEPINCS, INFOFILES,
NLSALL, CATPAGES, MANPAGES, HTMLPAGES, and SCRIPTS.


# 1.129 19-Feb-2001 jmc

Wrap target() checks around afterdepend rule as some Makefiles override this


# 1.128 26-Jan-2001 itojun

fix typo in LIBSSL decl. it made programs with DPADD+=${LIBSSL} to build
every time we type "make". From: bernd


# 1.127 14-Jan-2001 christos

use the new .if commands(<target>) directive so that we don't have to
change Makefiles.


# 1.126 14-Jan-2001 christos

fix thinko: test for the existance of the target before we define it...


# 1.125 14-Jan-2001 christos

Alter previous redefined target protection. If the ${PROG} target is defined,
add the dependencies as usual, but don't add the commands. This avoids
having to change all the Makefiles that redefine the PROG target.


# 1.124 14-Jan-2001 christos

allow programs to override the program target.


# 1.123 08-Jan-2001 mrg

add missing $LIBCRYPTO_RC5 and $LIBCRYPTO_IDEA


# 1.122 08-Jan-2001 mrg

add missing $LIBSSL


# 1.121 04-Jan-2001 garbled

Add LIBCDK and LIBFORM definitions


# 1.120 31-Oct-2000 itojun

add ${LIBINTL} for use with DPADD.


# 1.119 07-Oct-2000 deberg

fix typos, PR 11159


# 1.118 25-Jun-2000 erh

For the case when DESTDIR is set: move the -L${DESTDIR}/usr/lib after ${LDADD} so any -L directories set in LDADD are searched first to avoid possibly linking against old versions of libraries.


Revision tags: netbsd-1-5-base
# 1.117 19-Jun-2000 thorpej

branches: 1.117.2;
Sync up the LIB* list.


# 1.116 10-Jun-2000 mycroft

Use ${.ALLSRC:T} when doing the generated variable name lookups, so that it
DTRT for generated files in and obj directory (or accessed via .PATH).


# 1.115 06-Jun-2000 mycroft

Abuse .USE some more.


# 1.114 06-Jun-2000 mycroft

Minor rearrangement.


# 1.113 06-Jun-2000 mycroft

Use ODE make(1) features to eliminate extra variables and move several things
outside of .for loops. (Needs more work to completely eliminate .for.)

XXX Don't look at this stuff. It will make your head hurt.


Revision tags: minoura-xpg4dl-base
# 1.112 14-Apr-2000 mrg

branches: 1.112.2;
use -rpath-link rather than -R when linking objects using a DESTDIR.
this replaces the previous change as that ended up adding
$DESTDIR/usr/lib to the runtime path of every binary created, which
is bogus and dangerous.


# 1.111 25-Mar-2000 mycroft

When linking with $DESTDIR, use an explicit -R to get library dependencies
correct.


# 1.110 07-Mar-2000 veego

Remove unused libahdi.
It will be replaced in the future with a more generic libdisklabel.


# 1.109 05-Feb-2000 jdc

Add libahdi entries.


# 1.108 23-Jan-2000 eeh

Add some support for FCode binaries.


# 1.107 22-Jan-2000 mycroft

Make `dependall' play nicely with SUBDIR, using a hack similar to `realinstall'
for both `depend' and `all'.
Also, remove the old hack that invokes an extra shell for .depend, now that
make(1) has been fixed.


# 1.106 16-Jan-2000 assar

all: depend on ${SCRIPTS} so that they get generated if they need to


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.105 23-Nov-1999 blymn

Added libmenu library.


Revision tags: comdex-fall-1999-base
# 1.104 14-Sep-1999 perry

branches: 1.104.4;
Add a "dependall" target, which does a "make depend" and then "make all"
in a single directory. This is useful in "make build" because by doing
the build immediately after the depend, all sources will typically
still be in the buffer cache, thus saving significant time over doing
a "make depend" on all the directories and then a "make all".


# 1.103 04-Sep-1999 fredb

Permit "make all install", as well as "make foo install" (where foo would be
installed by "make install") without setting of BUILD. All cases where BUILD
is already set are unchanged from the old behavior.

"make all install" is now practically equivalent to "make BUILD= all install",
but without actually setting build.

Fixes pr's 8313, 3894.


# 1.102 21-Aug-1999 simonb

Add ${INSTPRIV} to ${INSTALL} commands.


# 1.101 01-Jul-1999 itojun

branches: 1.101.2;
add LIBIPSEC for use from DPADD.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.100 12-Feb-1999 lukem

branches: 1.100.2;
* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.99 10-Feb-1999 tv

libbfd_pic.a is no longer installed; remove ${LIBBFD} define.


# 1.98 04-Feb-1999 christos

PR/2936: Brian C. Grayson: Avoid truncating precious files when installing
and the filesystem is full. Added ${RENAME} flag to install, which when set
to -r installs on a temporary file and then renames to the final destination.
${RENAME} is currently set to nothing in bsd.own.mk, but one can turn it
on in /etc/mk.conf.


# 1.97 07-Nov-1998 jonathan

Do DESTDIR support for crtbegin/crtend on all ELF ports (adds mips).


# 1.96 28-Sep-1998 christos

Use preserve flag in install.


# 1.95 10-Sep-1998 ross

Define a LIBBZ2?=... for use in DPADD=... lines.


# 1.94 09-Aug-1998 lukem

add distclean as a synonym for cleandir


# 1.93 09-Apr-1998 tv

.y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.


# 1.92 01-Apr-1998 tv

Revert. This broke too much in the build tree, and a better solution
needs to be created. (The existing situation breaks a lot too.)


# 1.91 01-Apr-1998 tv

Fix .y rules to DTRT with possibly generated .h files. See mail on
tech-toolchain for a very detailed explanation of this. In short, add
a .y.h rule identical to the .y.c rule and make the .y.c rule rename
the .h file; also, clean the .h file in CLEANFILES.


# 1.90 03-Nov-1997 cgd

echo the lint command line when making 'lint'.


# 1.89 28-Oct-1997 lukem

add ${LIBOBJC}


Revision tags: netbsd-1-3-base
# 1.88 11-Oct-1997 mycroft

branches: 1.88.2;
Several changes:
* Allow bsd.man.mk to be included separately.
* Always include bsd.own.mk and bsd.obj.mk.
* Include bsd.man.mk and bsd.nls.mk even if NOMAN or NONLS; just turn off
building of the affected files instead.
* Require bsd.subdir.mk to be included explicitly.
(Will make appropriate changes to Makefiles shortly.)


# 1.87 29-Sep-1997 gwr

Add $LIBBFD


# 1.86 31-May-1997 cjs

Back out BUILDDIR and NOINSTALL changes.


# 1.85 26-May-1997 cjs

branches: 1.85.2;
These updates to the build allow building against include files
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.


# 1.84 18-May-1997 kleink

Add libposix.


# 1.83 17-May-1997 mycroft

Do LINKS and SYMLINKS after FILES and INCS.


# 1.82 17-May-1997 mycroft

Remove unneeded .SUFFIXES lines, and move .s and .S closer to .o to give the
right preferences.


# 1.81 09-May-1997 mycroft

Fix typo in previous.


# 1.80 09-May-1997 mycroft

Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.79 09-May-1997 mycroft

Remove cruft.


# 1.78 09-May-1997 mycroft

Oops; rearrange dependencies to get things built early enough.


# 1.77 09-May-1997 mycroft

Make sure INCS and SRCS are built if necessary.


# 1.76 08-May-1997 gwr

Set the .NOPATH flag for ${OBJS} (from Christos).


# 1.75 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.74 07-May-1997 mycroft

Various simplifications.


# 1.73 07-May-1997 mycroft

Shuffle some .PHONYs around, to work better with `-t'.


# 1.72 06-May-1997 mycroft

Make most of the install targets .PRECIOUS.


# 1.71 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.70 18-Apr-1997 christos

Add ${LIBNTP}


# 1.69 17-Apr-1997 thorpej

- Properly depend on crtbegin.o and crtend.o for platforms that use
them (currently Alpha and PowerPC)
- STRIP -> STRIPFLAG


# 1.68 03-Apr-1997 mikel

don't allow override of all: target


# 1.67 29-Mar-1997 mikel

merge lite-2 changes (mostly SCCSids)


# 1.66 27-Mar-1997 christos

Put the FILES generated rules in a separate .mk file since both bsd.prog.mk
and bsd.lib.mk use them.


# 1.65 27-Mar-1997 mycroft

Make the SCRIPTS case mimic the FILES case more closely, so we can override
the destination direectory, etc.


# 1.64 27-Mar-1997 mycroft

Remove knowledge of HIDEGAME from here.


# 1.63 24-Mar-1997 christos

make rules update:
- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation


# 1.62 22-Mar-1997 perry

Fix SYMLINKS not to include DESTDIR in the link itself


# 1.61 13-Mar-1997 perry

add SYMLINKS, by analogy to LINKS. Vetted by Christos.


# 1.60 22-Jan-1997 cgd

if 'clean' is not already defined, rather than simply defining it with
a bunch of rules, define a clean{kmod,lib,prog} target with the rules,
and have both clean and cleandir depend on that. That eliminates a bug
where 'cleandir' in a directory which included e.g. bsd.prog.mk but which
also had subdirs would 'make clean' all the subdirs and then 'make cleandir'
all ofthe subdirs. It also allows Makefiles to add more dependencies
to 'clean' after inclusion of the make template.

If 'clean' is already defined, the behaviour is the same as it used to be.


# 1.59 20-Dec-1996 cgd

add an afterdepend target (a la the one in bsd.lib.mk) that processes
the .depend file to add <filename>.ln for each <filename>.o as an
object file which has the given dependencies (in addition to
<filename>.po and <filename>.so, which were already there).


# 1.58 13-Dec-1996 mikel

add missing LIBPCAP definition.


# 1.57 26-Nov-1996 mrg

add libz and libwrap


# 1.56 18-Oct-1996 thorpej

Use ${INSTALL} rather than "install".
From Simon J. Gerraty <sjg@zen.void.oz.au>, PR #1458.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.55 08-Apr-1996 jtc

Sort LIBFOO definitions and add LIBY; Reported by Mike Long <mike.long@analog.com> in PR #2301.


# 1.54 22-Oct-1995 christos

Added include file <bsd.sys.mk> that contains lex and yacc "parallel aware"
rules. These rules are not turned on by default; they are enabled by setting
the PARALLEL variable.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.53 25-Jun-1995 cgd

oops; fix an rm that might be empty


# 1.52 24-Jun-1995 cgd

update lint rules, but keep linting disabled


# 1.51 10-Jun-1995 mycroft

Define LIBEDIT.


# 1.50 21-Apr-1995 jtc

.include <bsd.nls.mk> unless NONLS is defined.


# 1.49 22-Dec-1994 cgd

specify man pages differently, and document how.


# 1.48 24-Aug-1994 mycroft

Include bsd.own.mk earlier.


# 1.47 20-Jul-1994 cgd

fix from christos, for progs w/o objects


Revision tags: netbsd-1-0-base
# 1.46 06-Jul-1994 mycroft

branches: 1.46.2;
Pull libraries from ${DESTDIR} if set. Kill LDONLY, which is unused and
probably not useful anyway.


# 1.45 30-Jun-1994 cgd

fix modify-info-nothingness-then-substitute probelm that broke genclass build


# 1.44 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.43 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.42 28-Jun-1994 jtc

Strip *.sh when constructing OBJS from SRCS.
This will allow us to clean up makefiles that build a script by munging
a template (uusched, genclass, neqn, etc.).


# 1.41 18-Jun-1994 cgd

don't chown the symlink, when HIDEGAME causes a symlink to be made to dm.
4.4-based FS code _follows_ the symlinks on a chown(2) call.


# 1.40 24-May-1994 cgd

fix the last to do the right thing for dependencies


# 1.39 24-May-1994 deraadt

LIBSKEY


# 1.38 22-May-1994 jtc

Single source file programs are now compiled into object files before they
are linked. This change halves the time it takes to rebuild all of the
NetBSD sources when only the C library is "touched"; but only takes about
one percent more disk space.


# 1.37 06-Apr-1994 chopps

relink (recompile) single source programs when crt0.o is updated.


# 1.36 24-Mar-1994 mycroft

Remove *.core on clean.


# 1.35 09-Feb-1994 cgd

kill install -d's.


# 1.34 28-Jan-1994 cgd

add LIBKVM


# 1.33 10-Nov-1993 cgd

librpc doesn't exist anymore


# 1.32 08-Nov-1993 cgd

ad LDSTATIC flag, so static linking can be made one-stop shopping.
use "setenv LDSTATIC" to make *everything* dynamically linked,
setenv LDSTATIC -static for everything statically linked, or unset
it for default behavior.


# 1.31 07-Oct-1993 cgd

LIBTERM pointed at nothing, but was meant to point to libtermcap.a...


# 1.30 07-Oct-1993 cgd

always define LIBCRYPT


# 1.29 17-Aug-1993 mycroft

Make sure we don't recurse into subdirectories if Makefile specified `install'
target. (It's usually blank and is specifically to avoid doing this...)


# 1.28 15-Aug-1993 mycroft

Automatically include bsd.subdir.mk for backward compatibility.


# 1.27 15-Aug-1993 mycroft

Don't automatically include bsd.subdir.mk in bsd.prog.mk and bsd.lib.mk.
Put back .MAIN in bsd.man.mk, and be careful not to include ../Makefile.inc
a second time.


# 1.26 15-Aug-1993 mycroft

Move man rules to sys.mk.
Use bsd.subdir.mk for building subdirectories.
Don't forget to remove x.cc and x.C when using SHAREDSTRINGS.
Make ${PROG} always depend on ${LIBCRT0}.
Don't duplicate code between cleandir and clean.
Move tags target to bsd.dep.mk.
Move STRIP to bsd.own.mk.
Remove redundant definitions of {BIN,MAN}{DIR,GRP,OWN,MODE}.
Move {LIB,DOC}{DIR,GRP,OWN,MODE} defaults to bsd.own.mk.


# 1.25 15-Aug-1993 mycroft

Abstract out dependency stuff, and add RCS identifiers.


# 1.24 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


# 1.23 10-Aug-1993 mycroft

Put LINKS handling in `install' target, so it's the last thing executed, and
happens even if `realinstall' is user-defined.


# 1.22 30-Jul-1993 mycroft

When generating a default OBJS, ignore .h files.


# 1.21 29-Jul-1993 mycroft

Don't print the `making ...' message if an obj dir already exists.
Also, a minor cleanup.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.20 17-Jul-1993 mycroft

Fix C++ dependencies for good. `make depend' is now done in two passes--one
of C files and one for C++ files. No need to specify `-+' in your Makefile,
as it is now done automatically.


# 1.19 17-Jul-1993 cgd

do c++ dependencies the right way...


# 1.18 17-Jul-1993 mycroft

Add suffix rules for C++ files.


# 1.17 04-Jun-1993 brezak

Add LIBRPCSVC variable.


# 1.16 02-Jun-1993 cgd

add ability to specify c++ dependencies, by setting CFLAGS+=-+ for
the dependency make.


# 1.15 26-Apr-1993 cgd

added definition for DPADD library variable LIBCRYPT.


# 1.14 26-Apr-1993 mycroft

Don't redefine `realinstall' target if already defined.


# 1.13 25-Apr-1993 mycroft

Link with LDFLAGS even if one source module.


# 1.12 25-Apr-1993 mycroft

Don't lose if we include bsd.prog.mk only to build man pages.


# 1.11 25-Apr-1993 mycroft

Fix error in last change. (Oops.)


# 1.10 25-Apr-1993 mycroft

Don't build man pages if NOMAN set.


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.9 09-Apr-1993 cgd

various changes to default make rules. from patch 101.
note that only the "sensible" changes in patch 101 are implemented.


# 1.8 08-Apr-1993 cgd

try to do the right thing, in terms making directories before we
install into them, and get the manpage cleans _OUT_ of "clean".
they don't belong there, only in cleandir, WFJ be damned.


# 1.7 08-Apr-1993 cgd

fixed typos...


# 1.6 08-Apr-1993 cgd

(silently) make sure we have directories before installing


# 1.5 04-Apr-1993 cgd

make LIBRPC point to the right place


# 1.4 27-Mar-1993 nate

Fixed the doc macros to call troff, eqn,and tbl instead of ditroff,
deqn, and dtbl.
Fixed make clean to remove the man pages (Bill fixed this in the distribution,
but not in the original source)
Changed install to leave the original file around, by using 'cp' instead of
'mv'. "install -c ..."


# 1.3 23-Mar-1993 cgd

made .CURDIR be absolute, not relative, thereby eliminating
the need for some of the makefile trickery when making objects,
and fixing a few .PATH bugs


# 1.2 22-Mar-1993 cgd

fixed "make obj" for cases when sources not in /usr/src/...
if sources not there, it now mkdirs obj, but some trickery
is necessary, to avoid deleting cwd.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.303 20-Feb-2017 rin

add missing LIBCXX


# 1.302 08-Feb-2017 kamil

libpthread_dbg(3) deletion from the base distribution

libpthread_dbg(3) is a remnant library from the M:N thread model
(pre-NetBSD-5.0) API to introspect threads within a process and for use
of debuggers.

Currently in the 1:1 model it's not used in GDB neither in LLDB and it's
not either planned to be used. It's current function to read pthread_t
structures is realizable within a regular debugger capable to
instrospect objects within a tracee (GDB, LLDB...).

Remaining users of this API can still use this library from
pkgsrc/devel/libpthread_dbg.

Sponsored by <The NetBSD Foundation>


# 1.301 29-Jan-2017 christos

add sqlite3 to statically linked libraries for pam.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914
# 1.300 20-Aug-2016 christos

unbound additions


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.299 04-Apr-2016 joerg

If the per-target LDSTATIC flag is set, don't include the PIE linker
flags as we currently don't support static PIE.


# 1.298 30-Mar-2016 martin

Pass -pie to cc, not -Wl,-pie. This way we have a chance to fix specs
for obscure corner cases like -pie -fPIE -static (used for
/usr/tests/lib/csu/h_initfini2 if building with MKPIE=yes).
While there also replace -fPIC with -fPIE for the PIE case, even if
it should be mostly equivalent.


# 1.297 12-Mar-2016 mrg

remove conditionals that are always true with GCC >= 4.8.


# 1.296 21-Feb-2016 christos

Add NODEBUG


# 1.295 31-Jan-2016 christos

Introduce NOPIE and NOCTF so that standalone programs build properly.


# 1.294 23-Jan-2016 christos

Define _KERNTYPES for things that need it.


# 1.293 07-Nov-2015 joerg

LIBEXECINFO


# 1.292 07-Jun-2015 matt

Make LIBCRT* depend on the right files if MLIBDIR from MKCOMPAT is defined.


# 1.291 01-Dec-2014 erh

PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilt
if any of their dependencies (i.e. the files they refer to) are changed.
This allows changes to transitive included headers to be handled properly.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.290 25-Mar-2014 ozaki-r

branches: 1.290.4;
Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.


Revision tags: riastradh-drm2-base3
# 1.289 09-Mar-2014 christos

let's see if the new dwarf library can handle dwarf 4


# 1.288 02-Mar-2014 christos

If we are compiling with -g and using gcc4.8 and dtrace downgrade
dwarf generation to version 2 for now.


# 1.287 15-Jan-2014 joerg

-Wl,-pie and -r don't agree with each other, so filter the former out.


# 1.286 11-Nov-2013 joerg

Relink binaries if crti.o changes.


# 1.285 29-Sep-2013 christos

Add libxcb


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.284 31-May-2013 mrg

add LIBX11_XCB; unfortunately since the library is named with a -
in it, we have to use an ugly hard coded assignment for now.
(could be cleaned up with more make variable magic i'm sure.)


# 1.283 04-Apr-2013 christos

ldopts should be before ldadd like everywhere else.


Revision tags: agc-symver-base
# 1.282 14-Feb-2013 christos

Since the libraries are produced with different MK flags than the programs,
we check for existance of the files instead of the MK flags.


# 1.281 14-Feb-2013 christos

Add PROGDPLIBS


# 1.280 26-Jan-2013 christos

CTFCONVERT me harder.


Revision tags: yamt-pagecache-base8
# 1.279 17-Jan-2013 christos

Now that we have separate debug sets, add -g if ${MKDEBUG} is set for
program builds since we don't need to install that symbol files.


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.278 24-Aug-2012 jmmv

branches: 1.278.2;
Allow DPADD to be specified on a per-program basis.


# 1.277 23-Aug-2012 joerg

Revert last, it breaks the tricks xsrc uses.


# 1.276 23-Aug-2012 joerg

Remove SHLIBINSTALLDIR and SHLINKINSTALLLIBDIR. Add rpath entries, if
SHLIBDIR differs from /usr/lib.


# 1.275 08-Aug-2012 christos

add MKRUMP by popular demand.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.274 29-Feb-2012 tron

Move "libexpat" from X11 into base which fixes PR lib/40346.
This change was approved by the Core Group.


# 1.273 21-Feb-2012 matt

Remove another ${SIZE}


# 1.272 20-Feb-2012 matt

Remove ${SIZE}


# 1.271 19-Feb-2012 matt

Add support for --combine with gcc.


Revision tags: netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2
# 1.270 05-Nov-2011 christos

branches: 1.270.2;
Add libtre


Revision tags: yamt-pagecache-base
# 1.269 16-Oct-2011 christos

branches: 1.269.2;
- no need to special-case libraries with weird characters.
- add a note about adding new libraries.


# 1.268 16-Oct-2011 christos

fix list of libraries to reflect reality.


# 1.267 10-Sep-2011 apb

Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.


# 1.266 27-Aug-2011 joerg

Add new "analyze" command to run clang's static analyzer in a directory
on all C/C++ files.


Revision tags: cherry-xenmp-base
# 1.265 26-Apr-2011 he

The new Heimdal adds -lwind and -lheimbase to the set of libraries,
so define the corresponding LIB* variables.
These are also needed in the PAM_STATIC_* variables, so add them there too.


# 1.264 11-Apr-2011 joerg

Adjust --sysroot related usage:
-Wl,-rpath does not expand =, so just drop it.

Drop -Wl,-rpath-link entries that duplicate the -Wl,-rpath entries, this
is done implicitly now that ld is built with sysroot support.

Use ${DESTDIR} explicitly for the remaining -Wl,-rpath-link entries.


# 1.263 10-Apr-2011 joerg

For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.


# 1.262 08-Mar-2011 jmmv

Revert previous (revision 1.261): it broke the build because PROG_CXX is
defined in terms of PROG, so later on we would end up with target duplicates
because both PROG_CXX and PROG were being converted to PROGS_CXX and PROGS.

Did not catch this earlier because the test build I did was not clean and
thus the duplicate targets did not have nasty effects.


# 1.261 07-Mar-2011 jmmv

Always convert PROG to its plural form independently of whether PROG_CXX
is defined or not. From Garrett Cooper in private mail.


Revision tags: bouyer-quota2-nbase
# 1.260 20-Feb-2011 jmmv

Define LIBATF_C and LIBATF_CXX to point to their corresponding .a files and
use these to properly set DPADD for test programs.


Revision tags: bouyer-quota2-base
# 1.259 13-Feb-2011 christos

add saslc


# 1.258 06-Feb-2011 joerg

Don't use -nostdinc or -nostdinc++ if this is included in a HOSTLIB.


# 1.257 17-Jan-2011 pooka

branches: 1.257.2;
Add rump bits to DPSRCS so that update builds work correctly.


Revision tags: matt-mips64-premerge-20101231
# 1.256 13-Dec-2010 pooka

befriend RUMPPRG with CRUNCHEDPRG


# 1.255 13-Dec-2010 pooka

Define RUMPPRG, which is just like PROG, except it additionally
builds a rump client with the name rump.${PROG}. The rump client
is not installed suid/sgid by default even if BINMODE is defined.


# 1.254 10-Dec-2010 joerg

Revert last, gcc(1) checks explicitly for -r on some platforms to disable
passing down --relax as well.


# 1.253 08-Dec-2010 joerg

gcc passes down -r directly to ld, so make it explicitly a linker option.


# 1.252 08-Dec-2010 joerg

Don't depend on ${CC} passing down -R to ld, use -Wl,-rpath explicitly.


# 1.251 08-Nov-2010 lukem

Preserve date on original shared library or program when stripping
the debug symbols and adding the debug-link to .debug.
Use '(rm -f file; false)' in the failure path to force failure.
Based on solution proposed by Nicolas Joly on tech-toolchain in July 2010.
Should fix PR toolchain/44046 from Andreas Gustafsson.


# 1.250 31-Oct-2010 mbalmer

Link Lua to the build and add the resulting files to the distribution sets.
Document the addition of Lua and the change we made to the default settings.


# 1.249 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.248 24-Apr-2010 lukem

When extracting separate debug symbols with MKDEBUG, there's no need
to leave the original file unstripped...


# 1.247 02-Mar-2010 darran

DTrace: Add CTF generation to the make framework. Only enabled when
MKDTRACE=yes.


# 1.246 14-Dec-2009 mrg

use "${CC} -r" not "${CC} -Wl,-r" as the latter fools GCC on some targets
and it ends up passing "-r -relax" to ld, which causes ld to barf.


# 1.245 14-Dec-2009 matt

Merge from matt-nb5-mips64


Revision tags: matt-premerge-20091211
# 1.244 08-Dec-2009 uebayasi

When PROGS / LIBS are used, you can pass each PROG / LIB specific parameters
to ${LD} via:

${LDADD.${PROG}}
${LDFLAGS.${PROG}}
${LDSTATIC.${PROG}}
${LDADD.${LIB}}
${LDFLAGS.${LIB}}

OTOH you can't pass parameters to ${CC}, because in suffix rules make(1) only
knows the name of ${.IMPSRC} and ${.TARGET}; it's users' responsivility to
define ${CC} parameters to all the sources of a given ${PROG} / ${LIB}.

Should address bin/42381.

(Bug in this commit log was pointed out by mrg@.)


# 1.243 27-Nov-2009 tsutsui

If CPPFLAGS or CXXFLAGS already contains -nostdinc or -nostdinc++,
don't add ${CPPFLAGS_ISYSTEM} or ${CPPFLAGS_ISYSTEMXX} to refer
${DESTDIR}/usr/include or ${DESTDIR}/usr/include/g++.

This change might cause errors on some MD stand dir, but in that case
each Makefile should be fixed to search proper system include paths
by -Ipath option in own CPPFLAGS.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.242 12-May-2009 plunky

remove libsdp as improved functionality has been enabled in libbluetooth.


# 1.241 10-Apr-2009 apb

Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links. They have no effect except when using a
metalog, in which case the information is added to the metalog. In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg. This should fix PR 24457 and PR 41155.


# 1.240 24-Nov-2008 cube

branches: 1.240.2;
Move cleanextra to the very ends in case another included file wants to add
to it even if it was initially empty.


Revision tags: netbsd-5-base matt-mips64-base2
# 1.239 19-Oct-2008 christos

branches: 1.239.2;
handle assembly files for MKPIE


# 1.238 16-Oct-2008 christos

Provide a way for a program to override the PIE flags.


# 1.237 15-Oct-2008 christos

don't compile/link libraries with pie


Revision tags: mjf-devfs2-base
# 1.236 02-Oct-2008 joerg

Hook up libfetch and pkg_install update.


Revision tags: wrstuden-revivesa-base-3
# 1.235 09-Sep-2008 joerg

Add MKSTRIPIDENT to remove the RCS IDs from binary programs and shared
libraries for space-constraint systems. The description is based on the
feedback of hubertf@, the logic on input from lukem@

This obsoletes the removal of LIBC_SCCS and SYSLIBC_SCCS for libc builds.


Revision tags: wrstuden-revivesa-base-2
# 1.234 28-Aug-2008 mrg

update a comment example


# 1.233 27-Aug-2008 rtr

use ${X11USRLIBDIR} instead of hard-coded /usr/X11R6/lib when building
${LIB.foo} vars


# 1.232 27-Aug-2008 lukem

Fix problem I introduced in rev 1.231 on 2008/08/25 where ${_PROGLDOPTS}
and -L${_GCC_LIBGCCDIR} were appearing in the link line before ${LDADD},
so -L${DESTDIR}/lib and -L${DESTDIR}/usr/lib were being used before
local -L library paths.
Fixes ntpd/ntpdate failure noticed by Valeriy E. Ushakov <uwe@NetBSD.org>


# 1.231 25-Aug-2008 lukem

Always link with: -Wl,-rpath-link,${DESTDIR}/usr/lib -L${DESTDIR}/usr/lib
Fixes problem with MKDYNAMICROOT=no triggered by libraries that depend
on other libraries.
Related to PR 33503.

Clean up setting of _CCLINK to always add the appropriate -B options.

Simplify the link rule for a program.


# 1.230 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.229 28-May-2008 lukem

add LIBLDAR_R (for completeness)


# 1.228 22-May-2008 lukem

Add MKLDAP, USE_LDAP, LIBLBER, LIBLDAP


Revision tags: hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-pf42-base
# 1.227 10-Apr-2008 tsutsui

branches: 1.227.2; 1.227.4;
Add libhx509 to PAM_STATIC_LDADD which is required by libkrb5.


# 1.226 22-Mar-2008 mlelstv

branches: 1.226.2;
Import Heimdal-1.1


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase matt-armv6-base hpcarm-cleanup-base
# 1.225 26-Dec-2007 jmmv

Make the clean target work when OBJS is set but PROG is not, as happens
for example in gnu/lib/crtstuff4. Reported by drochner@.


Revision tags: cube-autoconf-base
# 1.224 13-Nov-2007 jmmv

Fix typo that prevented MKDEBUG builds to work. Found by drochner@.


# 1.223 12-Nov-2007 jmmv

Add the ability to build multiple programs from a single directory

This adds support for a new set of variables, PROGS and PROGS_CXX, that
allow the developer to build multiple different programs from a single
source directory.


# 1.222 04-Nov-2007 tls

Remove MKPRIVATELIB from BIND libraries; move library reachover
directories and Makefiles from src/usr.sbin/bind to src/lib; make
BIND libraries build shared. Saves about 1MB-1.5MB per installed
executable, about 5MB for a base+etc minimal installation of NetBSD.


Revision tags: matt-mips64-base
# 1.221 29-Jul-2007 joerg

branches: 1.221.4; 1.221.6;
Add build glue for libarchive and update the various sets.


# 1.220 25-Jan-2007 perry

Before I completely forget the issue, convert "PROG_PAX" to the
better-named "PAXCTL_FLAGS".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.219 11-Nov-2006 christos

don't run paxctl if other commands were specified for that target.


# 1.218 10-Nov-2006 christos

if ${PROG_PAX} is defined, run paxctl on the binary after linking with
the value of the variable. This way, if you set:

PROG_PAX=+M

in /etc/mk.conf, you get what you deserve.


# 1.217 22-Oct-2006 pooka

libpuffs


# 1.216 09-Oct-2006 mrg

- clean up some comments to reality.
- retire LIBDCK, LIBG2C and (long broken) USE_LIBSTDCXX
- in bsd.hostprog.mk's LIBSTDCPP -> LIBSTDCC
- add LIBSUPCXX
- don't default USE_LIBSTDCXX or USE_GCC4 since they are
not used in the tree any where
- same with USE_XF86_4; retire it
- remove _SUPCXX handling in bsd.prog.mk

inspired by PR#26714.


Revision tags: abandoned-netbsd-4-base
# 1.215 23-Jul-2006 lukem

Implement MKDEBUG:
If "no", don't build and install separate debugging symbols
into /usr/libdata/debug.
Default: no


# 1.214 19-Jun-2006 gdamore

Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.


# 1.213 09-Jun-2006 christos

PR/33681: Scott Ellis: Building 'bc' with SHAREDSTRINGS=yes fails
We need CPPFLAGS too now.


# 1.212 11-May-2006 mrg

add support for ${OBJCOPTS} and ${OBJCOPTS}.<lib|prog|fn>.


# 1.211 20-Mar-2006 christos

There is always one more KRB4 thing to remove. (from Jukka Salmi)


# 1.210 20-Mar-2006 christos

Remove krb4 variables and libraries (Jukka Salmi)


# 1.209 16-Mar-2006 jwise

Now that we have real build system support for syspkgs, remove someone's
half-implemented idea of building `syspkgs' (really a few giant blobs of the
same granularity of the old sets) using install(1).


# 1.208 20-Jan-2006 christos

Add the world of libraries to the static pam build. Now static pam binaries
work.


# 1.207 09-Apr-2005 dsl

Report when we link a program into xxx.ro (before being crunched)


Revision tags: netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.206 04-Mar-2005 he

branches: 1.206.2; 1.206.4;
Introduce PAM_STATIC_LDADD and PAM_STATIC_DPADD. When compiling
with MKPIC=no, possibly because the target does not support shared
libraries, these include libraries required to resolve all symbols
which end up referenced from PAM-using applications. The libraries
presently required are -lcrypt, -lrpcsvc and -lutil.

Add use of these variables which are currently set up to use PAM,
so that they compile when MKPIC=no.

Also, in the telnetd case, reorder the order of the libraries, so
that libtelnet.a comes before -ltermcap and -lutil, again to fix
link error when MKPIC=no.

Discussed with thorpej and christos.


# 1.205 20-Feb-2005 christos

Add libradius


# 1.204 12-Jan-2005 lukem

If RESCUEDIR is defined, automatically add that to CPPFLAGS


# 1.203 08-Jan-2005 lukem

Implement <bsd.prog.mk> vars:
LIBASN1 LIBBSDMALLOC LIBG2C LIBPAM LIBSSH


# 1.202 04-Aug-2004 lukem

Revert most of previous, and move the LIB<libname>?= assignments
back to bsd.prog.mk from bsd.own.mk.

pkgsrc uses <bsd.own.mk>, and setting LIB<libname> in it causes
problems with various package builds.
This should fix PR #26542 submitted by Jim Bernard.

(I'll be implementing the DPADD for shared libraries in a different
manner that generally won't depend upon ${LIB<libname>}.)


# 1.201 30-Jul-2004 lukem

Move the LIB<libname>?= assignments from bsd.prog.mk to bsd.own.mk so
that they may be used by non PROGs (e.g., LIBs).

Improve some comments.


# 1.200 10-Jun-2004 lukem

Be consistent in handling YHEADER, similar to Christos' fix in bsd.lib.mk 1.253


# 1.199 21-May-2004 ross

If you add a library, you need to define its DPADD symbol here.

Add LIBMAGIC.


Revision tags: netbsd-2-0-base
# 1.198 15-Feb-2004 skrll

branches: 1.198.2;
Be more gcc like in the way we deal with libgcc so that sh3/hppa millicode
and exception handling have a chance of working properly.

- creates libgcc, libgcc_eh and libgcc_s

- updates LIBGCC_SPEC to use them appropriately.

There's a hack in here at the moment with respect to libgcc_so in that it
is preferable to link against libgcc_so will only when -shared-libgcc is
specified (the c++ frontend does this automatically.) Configurations where
LINK_EH_SPEC is defined already do this. The gcc configuration for
NetBSD/alpha and another NetBSD platform (I forget which) actually define
LINK_EH_SPEC probably by accident rather than design.

- updates share/mk to use the compiler's knowledge of what needs linking into
libraries and executables. This removes an hppa hack.

- updates the sets for the newly created libgcc* files.

- support for linking against the _pg version of libgcc has been removed.


# 1.197 29-Jan-2004 lukem

Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.


# 1.196 27-Jan-2004 lukem

Replace
:M-[IDU]*
with
:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)


# 1.195 23-Jan-2004 simonb

crt0.o lives in /usr/lib even on a.out.


# 1.194 16-Nov-2003 lukem

simplify with _MKTARGET_LINK


# 1.193 11-Nov-2003 dsl

Set MKDEP_SUFFIXES to get additional targets in .depend instead of using
sed in .afterdepend. I don't think .afterdepend is used anywhere any more.


# 1.192 21-Oct-2003 lukem

Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.


# 1.191 19-Oct-2003 lukem

Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} " ... {$.TARGET}" and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO


# 1.190 18-Oct-2003 lukem

Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command ("verbose")
This is the default, and is equivalent to the previous behaviour.


# 1.189 29-Sep-2003 lukem

Add LIBSTDCXX (for usr/lib/libstdc++.a).
Sync LIB* documentation with reality.


# 1.188 19-Sep-2003 martin

Drop explicit medlow model and default to -O2 for sparc64.


# 1.187 14-Sep-2003 lukem

Check ${SHLIBDIR} against "/usr/lib" instead of ${LIBDIR} when determining
if we need to add stuff (usually "/lib") to the rpath-link path before
"/usr/lib". Otherwise, this barfs if LIBDIR != /usr/lib or /lib, and
we're cross-building (e.g., in src/x11)


# 1.186 13-Sep-2003 erh

Also support per-program LDFLAGS and LDSTATIC.


# 1.185 13-Sep-2003 erh

Create a way to add additional flags to COPTS, CPPFLAGS, CXXFLAGS and LDADD
for particular libraries or programs by specifying the additions in mk.conf
instead of needing to go edit individual Makefiles.


# 1.184 12-Sep-2003 lukem

add infrastructure to support reach-over builds of xsrc


# 1.183 22-Aug-2003 dsl

Add a ${PROG}.ro target that does an 'ld -r' of the program object files.
Allows a much simplified build of 'crunched' binaries since crunchgen can
build prog.ro instead of having to deretmine the names of all the .o files.


# 1.182 01-Aug-2003 lukem

Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".


# 1.181 01-Aug-2003 lukem

simplify the ${PROG}: target to reduce duplication between the DESTDIR
and !DESTDIR cases...


# 1.180 31-Jul-2003 lukem

bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.


# 1.179 31-Jul-2003 lukem

Don't need -R/usr/lib; it will be searched at the end by ld.elf_so anyway.
Noted by matt green <mrg@>


# 1.178 28-Jul-2003 lukem

be consistent when adding *.y and *.l to DPSRCS


# 1.177 28-Jul-2003 lukem

replace MKCXXSUPCXX(!=no) with USE_LIBSTDCXX(==no)


# 1.176 28-Jul-2003 lukem

Change defined(CXX_SUPCXX) to MKCXXSUPCXX != "no".

Clarify that command-line overrides of the MKxxx variables should be
done via the environment rather than make(1) command-line variable
assignment, since the latter doesn't actually work as intended.


# 1.175 27-Jul-2003 mrg

introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes. for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)


# 1.174 26-Jul-2003 mrg

add a new bsd.own.mk variable: CXX_SUPCXX. from bsd.README:
+ CXX_SUPCXX If defined, the support libraries needed for this C++ program
+ are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.


# 1.173 20-Jul-2003 lukem

Consistently support the different C++ file extensions: .cc .cpp .cxx .C
Noted by Andrew White in PR toolchain/18246


# 1.172 18-Jul-2003 lukem

Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was defined.
Replace defined(UNPRIVED) tests with ${MKUNPRIVED} != "no"

Add MKUPDATE; if not no has the same semantics as if UPDATE was defined.
Replace defined(UPDATE) tests with ${MKUPDATE} != "no"

Improve documentation for these and other make flags.


# 1.171 16-Jul-2003 itojun

stop installing install libtelnet. build under lib/libtelnet and reference
it from usr.bin/telnet and libexec/telnetd.
(reason for separate build: compiler flags)


# 1.170 27-Jun-2003 drochner

For consistency, use "-R" instead of "-Wl,-rpath" to pass
a runtime search path to the linker.


# 1.169 13-Jun-2003 itojun

define LIBEVENT


# 1.168 11-Jun-2003 msaitoh

catch signal 1,2,3,13 and 15 to clean /tmp/_dependXXX


# 1.167 31-May-2003 thorpej

If EXTERNAL_TOOLCHAIN is defined, allow the compiler to define the
location of crt{begin,end}{,S}.o and libgcc.a. Encapsulate all of
this logic into the new bsd.gcc.mk, and use it in bsd.prog.mk and
bsd.lib.mk.


# 1.166 18-May-2003 lukem

make this a no-op if HOSTPROG is defined


# 1.165 30-Mar-2003 thorpej

If MACHINE_ARCH is powerpc and we HAVE_GCC3, add crtsaveres.o to the
endfile spec.


# 1.164 22-Feb-2003 uwe

Typo in comment.


# 1.163 24-Jan-2003 thorpej

Add LIBPTHREAD, LIBPTHREAD_DB, and LIBRT.


Revision tags: fvdl_fs64_base
# 1.162 22-Nov-2002 thorpej

Split crtbegin/crtend into crti/crtbegin/crtend/crtn. NetBSD-specific
things like the .note.netbsd.ident section are provided by crti/crtn.
crti/crtn also provide the _init() and _fini() routines.

crtbegin/crtend now only provide support for ctors/dtors. This paves
the way to using the "crtstuff" provided with GCC (when we upgrade to
GCC 3.3), which provides, among other things, much better C++/Java
exception handling.


# 1.161 12-Nov-2002 itohy

MKDYNAMICROOT for a.out


# 1.160 22-Oct-2002 perry

Pass 1 of SYSPKG changes to automatically add tags=pkgname_pkg to METALOG.
Not quite ready for prime time yet.


# 1.159 27-Sep-2002 thorpej

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.


# 1.158 26-Sep-2002 itojun

MDC2 is a patented algorithm; don't ship it in default libcrypto.
MKCRYPTO_MDC2 will build a separate library, libcrypto_mdc2.


# 1.157 08-Sep-2002 thorpej

Build a .gdbinit in the objdir when building a program. The .gdbinit
file sets the shared library prefix to ${DESTDIR}, and adds "sources"
directives for each file listed in the GDBINIT Makefile variable.


# 1.156 09-Aug-2002 thorpej

Add LIBPMC.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.155 27-Mar-2002 eeh

branches: 1.155.2;
Use the medium low model for sparc64 programs that don't 2GB of data segment.


# 1.154 11-Feb-2002 mycroft

Don't use .PHONY for targets that are actually installed. Instead use force
dependencies. (Among other things, `make -t install' does something vaguely
sensible now.)


# 1.153 07-Feb-2002 pk

Mark installed system libraries as .MADE only if we're actually establishing
their default variable values here.


# 1.152 04-Feb-2002 christos

s/.NOSUFF/.MADE/


# 1.151 03-Feb-2002 christos

Apply a .NOSUFF: directive to targets we don't want to have processed by
the suffix rules engine.


# 1.150 02-Feb-2002 veego

Ups, it is LIBUSBHID and not LIBUSBHIB.


# 1.149 02-Feb-2002 veego

Change LIBUSB to LIBUSBHIB, reflecting the library name change.


# 1.148 29-Jan-2002 enami

Mark the targets clean{extra,objs} as PHONY.


# 1.147 04-Jan-2002 thorpej

For PROG_CXX DESTDIR builds, pull in -lstdc++ and -lm regardless
of GCC version.


# 1.146 01-Jan-2002 thorpej

Per a suggestion from matthew green, PROG_CXX takes the place of
PROG for C++ programs.


# 1.145 01-Jan-2002 thorpej

* If PROG_CXX is set by the program's Makefile, use ${CXX} to link
the program rather than ${CC}.
* If HAVE_GCC3 is defined, pull in "-lstdc++ -lm" as additional C++
support libraries for DESTDIR builds.


# 1.144 28-Dec-2001 lukem

* 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


# 1.143 28-Nov-2001 tv

If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.


# 1.142 19-Nov-2001 thorpej

Use a little transitional hack to determine if we use -isystem
or -idirafter. Use the former only of USE_NEW_TOOLCHAIN, since
-isystem causes the old toolchain to bomb out when building
libstdc++.


# 1.141 14-Nov-2001 tv

C/..$/.c/ -> C/\..$/.c/


# 1.140 14-Nov-2001 tv

Move the DESTDIR-based nostdinc logic to bsd.lib.mk and bsd.prog.mk where
it belongs (with the native target compile rules).


# 1.139 02-Nov-2001 tv

Use INSTALL_FILE/INSTALL_DIR as appropriate.


# 1.138 02-Nov-2001 tv

Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.


# 1.137 19-Oct-2001 tv

Add .NOPATH for all files generated from .l or .y files in SRCS. Fixes PRs
bin/14187 and lib/14239.

Also simplify the handling of these transforms to .c and .h files a bit by
leveraging make's builtin macro operators.


# 1.136 25-Sep-2001 tv

Set .NOPATH on program to build to make sure it goes in .OBJDIR.
Problem noted by <seebs@plethora.net>.


# 1.135 24-Sep-2001 lukem

fix previous (hi thor!) - $OBJS and $CLEANFILES might be empty, and
rm needs some files to delete...


# 1.134 24-Sep-2001 tls

Split "cleanprog" target apart: now you can zap only object files or
CLEANFILES (needed to fix crunchgen lossage).


# 1.133 13-Sep-2001 thorpej

Add LIBPCI.


# 1.132 14-Aug-2001 tv

Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").


# 1.131 01-Jun-2001 tv

Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).


# 1.130 08-May-2001 sommerfeld

Suppress duplicate entries in ALLFILES, FILES, INCS, DEPINCS, INFOFILES,
NLSALL, CATPAGES, MANPAGES, HTMLPAGES, and SCRIPTS.


# 1.129 19-Feb-2001 jmc

Wrap target() checks around afterdepend rule as some Makefiles override this


# 1.128 26-Jan-2001 itojun

fix typo in LIBSSL decl. it made programs with DPADD+=${LIBSSL} to build
every time we type "make". From: bernd


# 1.127 14-Jan-2001 christos

use the new .if commands(<target>) directive so that we don't have to
change Makefiles.


# 1.126 14-Jan-2001 christos

fix thinko: test for the existance of the target before we define it...


# 1.125 14-Jan-2001 christos

Alter previous redefined target protection. If the ${PROG} target is defined,
add the dependencies as usual, but don't add the commands. This avoids
having to change all the Makefiles that redefine the PROG target.


# 1.124 14-Jan-2001 christos

allow programs to override the program target.


# 1.123 08-Jan-2001 mrg

add missing $LIBCRYPTO_RC5 and $LIBCRYPTO_IDEA


# 1.122 08-Jan-2001 mrg

add missing $LIBSSL


# 1.121 04-Jan-2001 garbled

Add LIBCDK and LIBFORM definitions


# 1.120 31-Oct-2000 itojun

add ${LIBINTL} for use with DPADD.


# 1.119 07-Oct-2000 deberg

fix typos, PR 11159


# 1.118 25-Jun-2000 erh

For the case when DESTDIR is set: move the -L${DESTDIR}/usr/lib after ${LDADD} so any -L directories set in LDADD are searched first to avoid possibly linking against old versions of libraries.


Revision tags: netbsd-1-5-base
# 1.117 19-Jun-2000 thorpej

branches: 1.117.2;
Sync up the LIB* list.


# 1.116 10-Jun-2000 mycroft

Use ${.ALLSRC:T} when doing the generated variable name lookups, so that it
DTRT for generated files in and obj directory (or accessed via .PATH).


# 1.115 06-Jun-2000 mycroft

Abuse .USE some more.


# 1.114 06-Jun-2000 mycroft

Minor rearrangement.


# 1.113 06-Jun-2000 mycroft

Use ODE make(1) features to eliminate extra variables and move several things
outside of .for loops. (Needs more work to completely eliminate .for.)

XXX Don't look at this stuff. It will make your head hurt.


Revision tags: minoura-xpg4dl-base
# 1.112 14-Apr-2000 mrg

branches: 1.112.2;
use -rpath-link rather than -R when linking objects using a DESTDIR.
this replaces the previous change as that ended up adding
$DESTDIR/usr/lib to the runtime path of every binary created, which
is bogus and dangerous.


# 1.111 25-Mar-2000 mycroft

When linking with $DESTDIR, use an explicit -R to get library dependencies
correct.


# 1.110 07-Mar-2000 veego

Remove unused libahdi.
It will be replaced in the future with a more generic libdisklabel.


# 1.109 05-Feb-2000 jdc

Add libahdi entries.


# 1.108 23-Jan-2000 eeh

Add some support for FCode binaries.


# 1.107 22-Jan-2000 mycroft

Make `dependall' play nicely with SUBDIR, using a hack similar to `realinstall'
for both `depend' and `all'.
Also, remove the old hack that invokes an extra shell for .depend, now that
make(1) has been fixed.


# 1.106 16-Jan-2000 assar

all: depend on ${SCRIPTS} so that they get generated if they need to


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.105 23-Nov-1999 blymn

Added libmenu library.


Revision tags: comdex-fall-1999-base
# 1.104 14-Sep-1999 perry

branches: 1.104.4;
Add a "dependall" target, which does a "make depend" and then "make all"
in a single directory. This is useful in "make build" because by doing
the build immediately after the depend, all sources will typically
still be in the buffer cache, thus saving significant time over doing
a "make depend" on all the directories and then a "make all".


# 1.103 04-Sep-1999 fredb

Permit "make all install", as well as "make foo install" (where foo would be
installed by "make install") without setting of BUILD. All cases where BUILD
is already set are unchanged from the old behavior.

"make all install" is now practically equivalent to "make BUILD= all install",
but without actually setting build.

Fixes pr's 8313, 3894.


# 1.102 21-Aug-1999 simonb

Add ${INSTPRIV} to ${INSTALL} commands.


# 1.101 01-Jul-1999 itojun

branches: 1.101.2;
add LIBIPSEC for use from DPADD.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.100 12-Feb-1999 lukem

branches: 1.100.2;
* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.99 10-Feb-1999 tv

libbfd_pic.a is no longer installed; remove ${LIBBFD} define.


# 1.98 04-Feb-1999 christos

PR/2936: Brian C. Grayson: Avoid truncating precious files when installing
and the filesystem is full. Added ${RENAME} flag to install, which when set
to -r installs on a temporary file and then renames to the final destination.
${RENAME} is currently set to nothing in bsd.own.mk, but one can turn it
on in /etc/mk.conf.


# 1.97 07-Nov-1998 jonathan

Do DESTDIR support for crtbegin/crtend on all ELF ports (adds mips).


# 1.96 28-Sep-1998 christos

Use preserve flag in install.


# 1.95 10-Sep-1998 ross

Define a LIBBZ2?=... for use in DPADD=... lines.


# 1.94 09-Aug-1998 lukem

add distclean as a synonym for cleandir


# 1.93 09-Apr-1998 tv

.y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.


# 1.92 01-Apr-1998 tv

Revert. This broke too much in the build tree, and a better solution
needs to be created. (The existing situation breaks a lot too.)


# 1.91 01-Apr-1998 tv

Fix .y rules to DTRT with possibly generated .h files. See mail on
tech-toolchain for a very detailed explanation of this. In short, add
a .y.h rule identical to the .y.c rule and make the .y.c rule rename
the .h file; also, clean the .h file in CLEANFILES.


# 1.90 03-Nov-1997 cgd

echo the lint command line when making 'lint'.


# 1.89 28-Oct-1997 lukem

add ${LIBOBJC}


Revision tags: netbsd-1-3-base
# 1.88 11-Oct-1997 mycroft

branches: 1.88.2;
Several changes:
* Allow bsd.man.mk to be included separately.
* Always include bsd.own.mk and bsd.obj.mk.
* Include bsd.man.mk and bsd.nls.mk even if NOMAN or NONLS; just turn off
building of the affected files instead.
* Require bsd.subdir.mk to be included explicitly.
(Will make appropriate changes to Makefiles shortly.)


# 1.87 29-Sep-1997 gwr

Add $LIBBFD


# 1.86 31-May-1997 cjs

Back out BUILDDIR and NOINSTALL changes.


# 1.85 26-May-1997 cjs

branches: 1.85.2;
These updates to the build allow building against include files
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.


# 1.84 18-May-1997 kleink

Add libposix.


# 1.83 17-May-1997 mycroft

Do LINKS and SYMLINKS after FILES and INCS.


# 1.82 17-May-1997 mycroft

Remove unneeded .SUFFIXES lines, and move .s and .S closer to .o to give the
right preferences.


# 1.81 09-May-1997 mycroft

Fix typo in previous.


# 1.80 09-May-1997 mycroft

Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.79 09-May-1997 mycroft

Remove cruft.


# 1.78 09-May-1997 mycroft

Oops; rearrange dependencies to get things built early enough.


# 1.77 09-May-1997 mycroft

Make sure INCS and SRCS are built if necessary.


# 1.76 08-May-1997 gwr

Set the .NOPATH flag for ${OBJS} (from Christos).


# 1.75 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.74 07-May-1997 mycroft

Various simplifications.


# 1.73 07-May-1997 mycroft

Shuffle some .PHONYs around, to work better with `-t'.


# 1.72 06-May-1997 mycroft

Make most of the install targets .PRECIOUS.


# 1.71 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.70 18-Apr-1997 christos

Add ${LIBNTP}


# 1.69 17-Apr-1997 thorpej

- Properly depend on crtbegin.o and crtend.o for platforms that use
them (currently Alpha and PowerPC)
- STRIP -> STRIPFLAG


# 1.68 03-Apr-1997 mikel

don't allow override of all: target


# 1.67 29-Mar-1997 mikel

merge lite-2 changes (mostly SCCSids)


# 1.66 27-Mar-1997 christos

Put the FILES generated rules in a separate .mk file since both bsd.prog.mk
and bsd.lib.mk use them.


# 1.65 27-Mar-1997 mycroft

Make the SCRIPTS case mimic the FILES case more closely, so we can override
the destination direectory, etc.


# 1.64 27-Mar-1997 mycroft

Remove knowledge of HIDEGAME from here.


# 1.63 24-Mar-1997 christos

make rules update:
- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation


# 1.62 22-Mar-1997 perry

Fix SYMLINKS not to include DESTDIR in the link itself


# 1.61 13-Mar-1997 perry

add SYMLINKS, by analogy to LINKS. Vetted by Christos.


# 1.60 22-Jan-1997 cgd

if 'clean' is not already defined, rather than simply defining it with
a bunch of rules, define a clean{kmod,lib,prog} target with the rules,
and have both clean and cleandir depend on that. That eliminates a bug
where 'cleandir' in a directory which included e.g. bsd.prog.mk but which
also had subdirs would 'make clean' all the subdirs and then 'make cleandir'
all ofthe subdirs. It also allows Makefiles to add more dependencies
to 'clean' after inclusion of the make template.

If 'clean' is already defined, the behaviour is the same as it used to be.


# 1.59 20-Dec-1996 cgd

add an afterdepend target (a la the one in bsd.lib.mk) that processes
the .depend file to add <filename>.ln for each <filename>.o as an
object file which has the given dependencies (in addition to
<filename>.po and <filename>.so, which were already there).


# 1.58 13-Dec-1996 mikel

add missing LIBPCAP definition.


# 1.57 26-Nov-1996 mrg

add libz and libwrap


# 1.56 18-Oct-1996 thorpej

Use ${INSTALL} rather than "install".
From Simon J. Gerraty <sjg@zen.void.oz.au>, PR #1458.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.55 08-Apr-1996 jtc

Sort LIBFOO definitions and add LIBY; Reported by Mike Long <mike.long@analog.com> in PR #2301.


# 1.54 22-Oct-1995 christos

Added include file <bsd.sys.mk> that contains lex and yacc "parallel aware"
rules. These rules are not turned on by default; they are enabled by setting
the PARALLEL variable.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.53 25-Jun-1995 cgd

oops; fix an rm that might be empty


# 1.52 24-Jun-1995 cgd

update lint rules, but keep linting disabled


# 1.51 10-Jun-1995 mycroft

Define LIBEDIT.


# 1.50 21-Apr-1995 jtc

.include <bsd.nls.mk> unless NONLS is defined.


# 1.49 22-Dec-1994 cgd

specify man pages differently, and document how.


# 1.48 24-Aug-1994 mycroft

Include bsd.own.mk earlier.


# 1.47 20-Jul-1994 cgd

fix from christos, for progs w/o objects


Revision tags: netbsd-1-0-base
# 1.46 06-Jul-1994 mycroft

branches: 1.46.2;
Pull libraries from ${DESTDIR} if set. Kill LDONLY, which is unused and
probably not useful anyway.


# 1.45 30-Jun-1994 cgd

fix modify-info-nothingness-then-substitute probelm that broke genclass build


# 1.44 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.43 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.42 28-Jun-1994 jtc

Strip *.sh when constructing OBJS from SRCS.
This will allow us to clean up makefiles that build a script by munging
a template (uusched, genclass, neqn, etc.).


# 1.41 18-Jun-1994 cgd

don't chown the symlink, when HIDEGAME causes a symlink to be made to dm.
4.4-based FS code _follows_ the symlinks on a chown(2) call.


# 1.40 24-May-1994 cgd

fix the last to do the right thing for dependencies


# 1.39 24-May-1994 deraadt

LIBSKEY


# 1.38 22-May-1994 jtc

Single source file programs are now compiled into object files before they
are linked. This change halves the time it takes to rebuild all of the
NetBSD sources when only the C library is "touched"; but only takes about
one percent more disk space.


# 1.37 06-Apr-1994 chopps

relink (recompile) single source programs when crt0.o is updated.


# 1.36 24-Mar-1994 mycroft

Remove *.core on clean.


# 1.35 09-Feb-1994 cgd

kill install -d's.


# 1.34 28-Jan-1994 cgd

add LIBKVM


# 1.33 10-Nov-1993 cgd

librpc doesn't exist anymore


# 1.32 08-Nov-1993 cgd

ad LDSTATIC flag, so static linking can be made one-stop shopping.
use "setenv LDSTATIC" to make *everything* dynamically linked,
setenv LDSTATIC -static for everything statically linked, or unset
it for default behavior.


# 1.31 07-Oct-1993 cgd

LIBTERM pointed at nothing, but was meant to point to libtermcap.a...


# 1.30 07-Oct-1993 cgd

always define LIBCRYPT


# 1.29 17-Aug-1993 mycroft

Make sure we don't recurse into subdirectories if Makefile specified `install'
target. (It's usually blank and is specifically to avoid doing this...)


# 1.28 15-Aug-1993 mycroft

Automatically include bsd.subdir.mk for backward compatibility.


# 1.27 15-Aug-1993 mycroft

Don't automatically include bsd.subdir.mk in bsd.prog.mk and bsd.lib.mk.
Put back .MAIN in bsd.man.mk, and be careful not to include ../Makefile.inc
a second time.


# 1.26 15-Aug-1993 mycroft

Move man rules to sys.mk.
Use bsd.subdir.mk for building subdirectories.
Don't forget to remove x.cc and x.C when using SHAREDSTRINGS.
Make ${PROG} always depend on ${LIBCRT0}.
Don't duplicate code between cleandir and clean.
Move tags target to bsd.dep.mk.
Move STRIP to bsd.own.mk.
Remove redundant definitions of {BIN,MAN}{DIR,GRP,OWN,MODE}.
Move {LIB,DOC}{DIR,GRP,OWN,MODE} defaults to bsd.own.mk.


# 1.25 15-Aug-1993 mycroft

Abstract out dependency stuff, and add RCS identifiers.


# 1.24 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


# 1.23 10-Aug-1993 mycroft

Put LINKS handling in `install' target, so it's the last thing executed, and
happens even if `realinstall' is user-defined.


# 1.22 30-Jul-1993 mycroft

When generating a default OBJS, ignore .h files.


# 1.21 29-Jul-1993 mycroft

Don't print the `making ...' message if an obj dir already exists.
Also, a minor cleanup.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.20 17-Jul-1993 mycroft

Fix C++ dependencies for good. `make depend' is now done in two passes--one
of C files and one for C++ files. No need to specify `-+' in your Makefile,
as it is now done automatically.


# 1.19 17-Jul-1993 cgd

do c++ dependencies the right way...


# 1.18 17-Jul-1993 mycroft

Add suffix rules for C++ files.


# 1.17 04-Jun-1993 brezak

Add LIBRPCSVC variable.


# 1.16 02-Jun-1993 cgd

add ability to specify c++ dependencies, by setting CFLAGS+=-+ for
the dependency make.


# 1.15 26-Apr-1993 cgd

added definition for DPADD library variable LIBCRYPT.


# 1.14 26-Apr-1993 mycroft

Don't redefine `realinstall' target if already defined.


# 1.13 25-Apr-1993 mycroft

Link with LDFLAGS even if one source module.


# 1.12 25-Apr-1993 mycroft

Don't lose if we include bsd.prog.mk only to build man pages.


# 1.11 25-Apr-1993 mycroft

Fix error in last change. (Oops.)


# 1.10 25-Apr-1993 mycroft

Don't build man pages if NOMAN set.


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.9 09-Apr-1993 cgd

various changes to default make rules. from patch 101.
note that only the "sensible" changes in patch 101 are implemented.


# 1.8 08-Apr-1993 cgd

try to do the right thing, in terms making directories before we
install into them, and get the manpage cleans _OUT_ of "clean".
they don't belong there, only in cleandir, WFJ be damned.


# 1.7 08-Apr-1993 cgd

fixed typos...


# 1.6 08-Apr-1993 cgd

(silently) make sure we have directories before installing


# 1.5 04-Apr-1993 cgd

make LIBRPC point to the right place


# 1.4 27-Mar-1993 nate

Fixed the doc macros to call troff, eqn,and tbl instead of ditroff,
deqn, and dtbl.
Fixed make clean to remove the man pages (Bill fixed this in the distribution,
but not in the original source)
Changed install to leave the original file around, by using 'cp' instead of
'mv'. "install -c ..."


# 1.3 23-Mar-1993 cgd

made .CURDIR be absolute, not relative, thereby eliminating
the need for some of the makefile trickery when making objects,
and fixing a few .PATH bugs


# 1.2 22-Mar-1993 cgd

fixed "make obj" for cases when sources not in /usr/src/...
if sources not there, it now mkdirs obj, but some trickery
is necessary, to avoid deleting cwd.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.302 08-Feb-2017 kamil

libpthread_dbg(3) deletion from the base distribution

libpthread_dbg(3) is a remnant library from the M:N thread model
(pre-NetBSD-5.0) API to introspect threads within a process and for use
of debuggers.

Currently in the 1:1 model it's not used in GDB neither in LLDB and it's
not either planned to be used. It's current function to read pthread_t
structures is realizable within a regular debugger capable to
instrospect objects within a tracee (GDB, LLDB...).

Remaining users of this API can still use this library from
pkgsrc/devel/libpthread_dbg.

Sponsored by <The NetBSD Foundation>


# 1.301 29-Jan-2017 christos

add sqlite3 to statically linked libraries for pam.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914
# 1.300 20-Aug-2016 christos

unbound additions


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.299 04-Apr-2016 joerg

If the per-target LDSTATIC flag is set, don't include the PIE linker
flags as we currently don't support static PIE.


# 1.298 30-Mar-2016 martin

Pass -pie to cc, not -Wl,-pie. This way we have a chance to fix specs
for obscure corner cases like -pie -fPIE -static (used for
/usr/tests/lib/csu/h_initfini2 if building with MKPIE=yes).
While there also replace -fPIC with -fPIE for the PIE case, even if
it should be mostly equivalent.


# 1.297 12-Mar-2016 mrg

remove conditionals that are always true with GCC >= 4.8.


# 1.296 21-Feb-2016 christos

Add NODEBUG


# 1.295 31-Jan-2016 christos

Introduce NOPIE and NOCTF so that standalone programs build properly.


# 1.294 23-Jan-2016 christos

Define _KERNTYPES for things that need it.


# 1.293 07-Nov-2015 joerg

LIBEXECINFO


# 1.292 07-Jun-2015 matt

Make LIBCRT* depend on the right files if MLIBDIR from MKCOMPAT is defined.


# 1.291 01-Dec-2014 erh

PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilt
if any of their dependencies (i.e. the files they refer to) are changed.
This allows changes to transitive included headers to be handled properly.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.290 25-Mar-2014 ozaki-r

branches: 1.290.4;
Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.


Revision tags: riastradh-drm2-base3
# 1.289 09-Mar-2014 christos

let's see if the new dwarf library can handle dwarf 4


# 1.288 02-Mar-2014 christos

If we are compiling with -g and using gcc4.8 and dtrace downgrade
dwarf generation to version 2 for now.


# 1.287 15-Jan-2014 joerg

-Wl,-pie and -r don't agree with each other, so filter the former out.


# 1.286 11-Nov-2013 joerg

Relink binaries if crti.o changes.


# 1.285 29-Sep-2013 christos

Add libxcb


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.284 31-May-2013 mrg

add LIBX11_XCB; unfortunately since the library is named with a -
in it, we have to use an ugly hard coded assignment for now.
(could be cleaned up with more make variable magic i'm sure.)


# 1.283 04-Apr-2013 christos

ldopts should be before ldadd like everywhere else.


Revision tags: agc-symver-base
# 1.282 14-Feb-2013 christos

Since the libraries are produced with different MK flags than the programs,
we check for existance of the files instead of the MK flags.


# 1.281 14-Feb-2013 christos

Add PROGDPLIBS


# 1.280 26-Jan-2013 christos

CTFCONVERT me harder.


Revision tags: yamt-pagecache-base8
# 1.279 17-Jan-2013 christos

Now that we have separate debug sets, add -g if ${MKDEBUG} is set for
program builds since we don't need to install that symbol files.


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.278 24-Aug-2012 jmmv

branches: 1.278.2;
Allow DPADD to be specified on a per-program basis.


# 1.277 23-Aug-2012 joerg

Revert last, it breaks the tricks xsrc uses.


# 1.276 23-Aug-2012 joerg

Remove SHLIBINSTALLDIR and SHLINKINSTALLLIBDIR. Add rpath entries, if
SHLIBDIR differs from /usr/lib.


# 1.275 08-Aug-2012 christos

add MKRUMP by popular demand.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.274 29-Feb-2012 tron

Move "libexpat" from X11 into base which fixes PR lib/40346.
This change was approved by the Core Group.


# 1.273 21-Feb-2012 matt

Remove another ${SIZE}


# 1.272 20-Feb-2012 matt

Remove ${SIZE}


# 1.271 19-Feb-2012 matt

Add support for --combine with gcc.


Revision tags: netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2
# 1.270 05-Nov-2011 christos

branches: 1.270.2;
Add libtre


Revision tags: yamt-pagecache-base
# 1.269 16-Oct-2011 christos

branches: 1.269.2;
- no need to special-case libraries with weird characters.
- add a note about adding new libraries.


# 1.268 16-Oct-2011 christos

fix list of libraries to reflect reality.


# 1.267 10-Sep-2011 apb

Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.


# 1.266 27-Aug-2011 joerg

Add new "analyze" command to run clang's static analyzer in a directory
on all C/C++ files.


Revision tags: cherry-xenmp-base
# 1.265 26-Apr-2011 he

The new Heimdal adds -lwind and -lheimbase to the set of libraries,
so define the corresponding LIB* variables.
These are also needed in the PAM_STATIC_* variables, so add them there too.


# 1.264 11-Apr-2011 joerg

Adjust --sysroot related usage:
-Wl,-rpath does not expand =, so just drop it.

Drop -Wl,-rpath-link entries that duplicate the -Wl,-rpath entries, this
is done implicitly now that ld is built with sysroot support.

Use ${DESTDIR} explicitly for the remaining -Wl,-rpath-link entries.


# 1.263 10-Apr-2011 joerg

For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.


# 1.262 08-Mar-2011 jmmv

Revert previous (revision 1.261): it broke the build because PROG_CXX is
defined in terms of PROG, so later on we would end up with target duplicates
because both PROG_CXX and PROG were being converted to PROGS_CXX and PROGS.

Did not catch this earlier because the test build I did was not clean and
thus the duplicate targets did not have nasty effects.


# 1.261 07-Mar-2011 jmmv

Always convert PROG to its plural form independently of whether PROG_CXX
is defined or not. From Garrett Cooper in private mail.


Revision tags: bouyer-quota2-nbase
# 1.260 20-Feb-2011 jmmv

Define LIBATF_C and LIBATF_CXX to point to their corresponding .a files and
use these to properly set DPADD for test programs.


Revision tags: bouyer-quota2-base
# 1.259 13-Feb-2011 christos

add saslc


# 1.258 06-Feb-2011 joerg

Don't use -nostdinc or -nostdinc++ if this is included in a HOSTLIB.


# 1.257 17-Jan-2011 pooka

branches: 1.257.2;
Add rump bits to DPSRCS so that update builds work correctly.


Revision tags: matt-mips64-premerge-20101231
# 1.256 13-Dec-2010 pooka

befriend RUMPPRG with CRUNCHEDPRG


# 1.255 13-Dec-2010 pooka

Define RUMPPRG, which is just like PROG, except it additionally
builds a rump client with the name rump.${PROG}. The rump client
is not installed suid/sgid by default even if BINMODE is defined.


# 1.254 10-Dec-2010 joerg

Revert last, gcc(1) checks explicitly for -r on some platforms to disable
passing down --relax as well.


# 1.253 08-Dec-2010 joerg

gcc passes down -r directly to ld, so make it explicitly a linker option.


# 1.252 08-Dec-2010 joerg

Don't depend on ${CC} passing down -R to ld, use -Wl,-rpath explicitly.


# 1.251 08-Nov-2010 lukem

Preserve date on original shared library or program when stripping
the debug symbols and adding the debug-link to .debug.
Use '(rm -f file; false)' in the failure path to force failure.
Based on solution proposed by Nicolas Joly on tech-toolchain in July 2010.
Should fix PR toolchain/44046 from Andreas Gustafsson.


# 1.250 31-Oct-2010 mbalmer

Link Lua to the build and add the resulting files to the distribution sets.
Document the addition of Lua and the change we made to the default settings.


# 1.249 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.248 24-Apr-2010 lukem

When extracting separate debug symbols with MKDEBUG, there's no need
to leave the original file unstripped...


# 1.247 02-Mar-2010 darran

DTrace: Add CTF generation to the make framework. Only enabled when
MKDTRACE=yes.


# 1.246 14-Dec-2009 mrg

use "${CC} -r" not "${CC} -Wl,-r" as the latter fools GCC on some targets
and it ends up passing "-r -relax" to ld, which causes ld to barf.


# 1.245 14-Dec-2009 matt

Merge from matt-nb5-mips64


Revision tags: matt-premerge-20091211
# 1.244 08-Dec-2009 uebayasi

When PROGS / LIBS are used, you can pass each PROG / LIB specific parameters
to ${LD} via:

${LDADD.${PROG}}
${LDFLAGS.${PROG}}
${LDSTATIC.${PROG}}
${LDADD.${LIB}}
${LDFLAGS.${LIB}}

OTOH you can't pass parameters to ${CC}, because in suffix rules make(1) only
knows the name of ${.IMPSRC} and ${.TARGET}; it's users' responsivility to
define ${CC} parameters to all the sources of a given ${PROG} / ${LIB}.

Should address bin/42381.

(Bug in this commit log was pointed out by mrg@.)


# 1.243 27-Nov-2009 tsutsui

If CPPFLAGS or CXXFLAGS already contains -nostdinc or -nostdinc++,
don't add ${CPPFLAGS_ISYSTEM} or ${CPPFLAGS_ISYSTEMXX} to refer
${DESTDIR}/usr/include or ${DESTDIR}/usr/include/g++.

This change might cause errors on some MD stand dir, but in that case
each Makefile should be fixed to search proper system include paths
by -Ipath option in own CPPFLAGS.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.242 12-May-2009 plunky

remove libsdp as improved functionality has been enabled in libbluetooth.


# 1.241 10-Apr-2009 apb

Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links. They have no effect except when using a
metalog, in which case the information is added to the metalog. In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg. This should fix PR 24457 and PR 41155.


# 1.240 24-Nov-2008 cube

branches: 1.240.2;
Move cleanextra to the very ends in case another included file wants to add
to it even if it was initially empty.


Revision tags: netbsd-5-base matt-mips64-base2
# 1.239 19-Oct-2008 christos

branches: 1.239.2;
handle assembly files for MKPIE


# 1.238 16-Oct-2008 christos

Provide a way for a program to override the PIE flags.


# 1.237 15-Oct-2008 christos

don't compile/link libraries with pie


Revision tags: mjf-devfs2-base
# 1.236 02-Oct-2008 joerg

Hook up libfetch and pkg_install update.


Revision tags: wrstuden-revivesa-base-3
# 1.235 09-Sep-2008 joerg

Add MKSTRIPIDENT to remove the RCS IDs from binary programs and shared
libraries for space-constraint systems. The description is based on the
feedback of hubertf@, the logic on input from lukem@

This obsoletes the removal of LIBC_SCCS and SYSLIBC_SCCS for libc builds.


Revision tags: wrstuden-revivesa-base-2
# 1.234 28-Aug-2008 mrg

update a comment example


# 1.233 27-Aug-2008 rtr

use ${X11USRLIBDIR} instead of hard-coded /usr/X11R6/lib when building
${LIB.foo} vars


# 1.232 27-Aug-2008 lukem

Fix problem I introduced in rev 1.231 on 2008/08/25 where ${_PROGLDOPTS}
and -L${_GCC_LIBGCCDIR} were appearing in the link line before ${LDADD},
so -L${DESTDIR}/lib and -L${DESTDIR}/usr/lib were being used before
local -L library paths.
Fixes ntpd/ntpdate failure noticed by Valeriy E. Ushakov <uwe@NetBSD.org>


# 1.231 25-Aug-2008 lukem

Always link with: -Wl,-rpath-link,${DESTDIR}/usr/lib -L${DESTDIR}/usr/lib
Fixes problem with MKDYNAMICROOT=no triggered by libraries that depend
on other libraries.
Related to PR 33503.

Clean up setting of _CCLINK to always add the appropriate -B options.

Simplify the link rule for a program.


# 1.230 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.229 28-May-2008 lukem

add LIBLDAR_R (for completeness)


# 1.228 22-May-2008 lukem

Add MKLDAP, USE_LDAP, LIBLBER, LIBLDAP


Revision tags: hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-pf42-base
# 1.227 10-Apr-2008 tsutsui

branches: 1.227.2; 1.227.4;
Add libhx509 to PAM_STATIC_LDADD which is required by libkrb5.


# 1.226 22-Mar-2008 mlelstv

branches: 1.226.2;
Import Heimdal-1.1


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase matt-armv6-base hpcarm-cleanup-base
# 1.225 26-Dec-2007 jmmv

Make the clean target work when OBJS is set but PROG is not, as happens
for example in gnu/lib/crtstuff4. Reported by drochner@.


Revision tags: cube-autoconf-base
# 1.224 13-Nov-2007 jmmv

Fix typo that prevented MKDEBUG builds to work. Found by drochner@.


# 1.223 12-Nov-2007 jmmv

Add the ability to build multiple programs from a single directory

This adds support for a new set of variables, PROGS and PROGS_CXX, that
allow the developer to build multiple different programs from a single
source directory.


# 1.222 04-Nov-2007 tls

Remove MKPRIVATELIB from BIND libraries; move library reachover
directories and Makefiles from src/usr.sbin/bind to src/lib; make
BIND libraries build shared. Saves about 1MB-1.5MB per installed
executable, about 5MB for a base+etc minimal installation of NetBSD.


Revision tags: matt-mips64-base
# 1.221 29-Jul-2007 joerg

branches: 1.221.4; 1.221.6;
Add build glue for libarchive and update the various sets.


# 1.220 25-Jan-2007 perry

Before I completely forget the issue, convert "PROG_PAX" to the
better-named "PAXCTL_FLAGS".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.219 11-Nov-2006 christos

don't run paxctl if other commands were specified for that target.


# 1.218 10-Nov-2006 christos

if ${PROG_PAX} is defined, run paxctl on the binary after linking with
the value of the variable. This way, if you set:

PROG_PAX=+M

in /etc/mk.conf, you get what you deserve.


# 1.217 22-Oct-2006 pooka

libpuffs


# 1.216 09-Oct-2006 mrg

- clean up some comments to reality.
- retire LIBDCK, LIBG2C and (long broken) USE_LIBSTDCXX
- in bsd.hostprog.mk's LIBSTDCPP -> LIBSTDCC
- add LIBSUPCXX
- don't default USE_LIBSTDCXX or USE_GCC4 since they are
not used in the tree any where
- same with USE_XF86_4; retire it
- remove _SUPCXX handling in bsd.prog.mk

inspired by PR#26714.


Revision tags: abandoned-netbsd-4-base
# 1.215 23-Jul-2006 lukem

Implement MKDEBUG:
If "no", don't build and install separate debugging symbols
into /usr/libdata/debug.
Default: no


# 1.214 19-Jun-2006 gdamore

Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.


# 1.213 09-Jun-2006 christos

PR/33681: Scott Ellis: Building 'bc' with SHAREDSTRINGS=yes fails
We need CPPFLAGS too now.


# 1.212 11-May-2006 mrg

add support for ${OBJCOPTS} and ${OBJCOPTS}.<lib|prog|fn>.


# 1.211 20-Mar-2006 christos

There is always one more KRB4 thing to remove. (from Jukka Salmi)


# 1.210 20-Mar-2006 christos

Remove krb4 variables and libraries (Jukka Salmi)


# 1.209 16-Mar-2006 jwise

Now that we have real build system support for syspkgs, remove someone's
half-implemented idea of building `syspkgs' (really a few giant blobs of the
same granularity of the old sets) using install(1).


# 1.208 20-Jan-2006 christos

Add the world of libraries to the static pam build. Now static pam binaries
work.


# 1.207 09-Apr-2005 dsl

Report when we link a program into xxx.ro (before being crunched)


Revision tags: netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.206 04-Mar-2005 he

branches: 1.206.2; 1.206.4;
Introduce PAM_STATIC_LDADD and PAM_STATIC_DPADD. When compiling
with MKPIC=no, possibly because the target does not support shared
libraries, these include libraries required to resolve all symbols
which end up referenced from PAM-using applications. The libraries
presently required are -lcrypt, -lrpcsvc and -lutil.

Add use of these variables which are currently set up to use PAM,
so that they compile when MKPIC=no.

Also, in the telnetd case, reorder the order of the libraries, so
that libtelnet.a comes before -ltermcap and -lutil, again to fix
link error when MKPIC=no.

Discussed with thorpej and christos.


# 1.205 20-Feb-2005 christos

Add libradius


# 1.204 12-Jan-2005 lukem

If RESCUEDIR is defined, automatically add that to CPPFLAGS


# 1.203 08-Jan-2005 lukem

Implement <bsd.prog.mk> vars:
LIBASN1 LIBBSDMALLOC LIBG2C LIBPAM LIBSSH


# 1.202 04-Aug-2004 lukem

Revert most of previous, and move the LIB<libname>?= assignments
back to bsd.prog.mk from bsd.own.mk.

pkgsrc uses <bsd.own.mk>, and setting LIB<libname> in it causes
problems with various package builds.
This should fix PR #26542 submitted by Jim Bernard.

(I'll be implementing the DPADD for shared libraries in a different
manner that generally won't depend upon ${LIB<libname>}.)


# 1.201 30-Jul-2004 lukem

Move the LIB<libname>?= assignments from bsd.prog.mk to bsd.own.mk so
that they may be used by non PROGs (e.g., LIBs).

Improve some comments.


# 1.200 10-Jun-2004 lukem

Be consistent in handling YHEADER, similar to Christos' fix in bsd.lib.mk 1.253


# 1.199 21-May-2004 ross

If you add a library, you need to define its DPADD symbol here.

Add LIBMAGIC.


Revision tags: netbsd-2-0-base
# 1.198 15-Feb-2004 skrll

branches: 1.198.2;
Be more gcc like in the way we deal with libgcc so that sh3/hppa millicode
and exception handling have a chance of working properly.

- creates libgcc, libgcc_eh and libgcc_s

- updates LIBGCC_SPEC to use them appropriately.

There's a hack in here at the moment with respect to libgcc_so in that it
is preferable to link against libgcc_so will only when -shared-libgcc is
specified (the c++ frontend does this automatically.) Configurations where
LINK_EH_SPEC is defined already do this. The gcc configuration for
NetBSD/alpha and another NetBSD platform (I forget which) actually define
LINK_EH_SPEC probably by accident rather than design.

- updates share/mk to use the compiler's knowledge of what needs linking into
libraries and executables. This removes an hppa hack.

- updates the sets for the newly created libgcc* files.

- support for linking against the _pg version of libgcc has been removed.


# 1.197 29-Jan-2004 lukem

Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.


# 1.196 27-Jan-2004 lukem

Replace
:M-[IDU]*
with
:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)


# 1.195 23-Jan-2004 simonb

crt0.o lives in /usr/lib even on a.out.


# 1.194 16-Nov-2003 lukem

simplify with _MKTARGET_LINK


# 1.193 11-Nov-2003 dsl

Set MKDEP_SUFFIXES to get additional targets in .depend instead of using
sed in .afterdepend. I don't think .afterdepend is used anywhere any more.


# 1.192 21-Oct-2003 lukem

Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.


# 1.191 19-Oct-2003 lukem

Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} " ... {$.TARGET}" and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO


# 1.190 18-Oct-2003 lukem

Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command ("verbose")
This is the default, and is equivalent to the previous behaviour.


# 1.189 29-Sep-2003 lukem

Add LIBSTDCXX (for usr/lib/libstdc++.a).
Sync LIB* documentation with reality.


# 1.188 19-Sep-2003 martin

Drop explicit medlow model and default to -O2 for sparc64.


# 1.187 14-Sep-2003 lukem

Check ${SHLIBDIR} against "/usr/lib" instead of ${LIBDIR} when determining
if we need to add stuff (usually "/lib") to the rpath-link path before
"/usr/lib". Otherwise, this barfs if LIBDIR != /usr/lib or /lib, and
we're cross-building (e.g., in src/x11)


# 1.186 13-Sep-2003 erh

Also support per-program LDFLAGS and LDSTATIC.


# 1.185 13-Sep-2003 erh

Create a way to add additional flags to COPTS, CPPFLAGS, CXXFLAGS and LDADD
for particular libraries or programs by specifying the additions in mk.conf
instead of needing to go edit individual Makefiles.


# 1.184 12-Sep-2003 lukem

add infrastructure to support reach-over builds of xsrc


# 1.183 22-Aug-2003 dsl

Add a ${PROG}.ro target that does an 'ld -r' of the program object files.
Allows a much simplified build of 'crunched' binaries since crunchgen can
build prog.ro instead of having to deretmine the names of all the .o files.


# 1.182 01-Aug-2003 lukem

Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".


# 1.181 01-Aug-2003 lukem

simplify the ${PROG}: target to reduce duplication between the DESTDIR
and !DESTDIR cases...


# 1.180 31-Jul-2003 lukem

bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.


# 1.179 31-Jul-2003 lukem

Don't need -R/usr/lib; it will be searched at the end by ld.elf_so anyway.
Noted by matt green <mrg@>


# 1.178 28-Jul-2003 lukem

be consistent when adding *.y and *.l to DPSRCS


# 1.177 28-Jul-2003 lukem

replace MKCXXSUPCXX(!=no) with USE_LIBSTDCXX(==no)


# 1.176 28-Jul-2003 lukem

Change defined(CXX_SUPCXX) to MKCXXSUPCXX != "no".

Clarify that command-line overrides of the MKxxx variables should be
done via the environment rather than make(1) command-line variable
assignment, since the latter doesn't actually work as intended.


# 1.175 27-Jul-2003 mrg

introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes. for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)


# 1.174 26-Jul-2003 mrg

add a new bsd.own.mk variable: CXX_SUPCXX. from bsd.README:
+ CXX_SUPCXX If defined, the support libraries needed for this C++ program
+ are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.


# 1.173 20-Jul-2003 lukem

Consistently support the different C++ file extensions: .cc .cpp .cxx .C
Noted by Andrew White in PR toolchain/18246


# 1.172 18-Jul-2003 lukem

Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was defined.
Replace defined(UNPRIVED) tests with ${MKUNPRIVED} != "no"

Add MKUPDATE; if not no has the same semantics as if UPDATE was defined.
Replace defined(UPDATE) tests with ${MKUPDATE} != "no"

Improve documentation for these and other make flags.


# 1.171 16-Jul-2003 itojun

stop installing install libtelnet. build under lib/libtelnet and reference
it from usr.bin/telnet and libexec/telnetd.
(reason for separate build: compiler flags)


# 1.170 27-Jun-2003 drochner

For consistency, use "-R" instead of "-Wl,-rpath" to pass
a runtime search path to the linker.


# 1.169 13-Jun-2003 itojun

define LIBEVENT


# 1.168 11-Jun-2003 msaitoh

catch signal 1,2,3,13 and 15 to clean /tmp/_dependXXX


# 1.167 31-May-2003 thorpej

If EXTERNAL_TOOLCHAIN is defined, allow the compiler to define the
location of crt{begin,end}{,S}.o and libgcc.a. Encapsulate all of
this logic into the new bsd.gcc.mk, and use it in bsd.prog.mk and
bsd.lib.mk.


# 1.166 18-May-2003 lukem

make this a no-op if HOSTPROG is defined


# 1.165 30-Mar-2003 thorpej

If MACHINE_ARCH is powerpc and we HAVE_GCC3, add crtsaveres.o to the
endfile spec.


# 1.164 22-Feb-2003 uwe

Typo in comment.


# 1.163 24-Jan-2003 thorpej

Add LIBPTHREAD, LIBPTHREAD_DB, and LIBRT.


Revision tags: fvdl_fs64_base
# 1.162 22-Nov-2002 thorpej

Split crtbegin/crtend into crti/crtbegin/crtend/crtn. NetBSD-specific
things like the .note.netbsd.ident section are provided by crti/crtn.
crti/crtn also provide the _init() and _fini() routines.

crtbegin/crtend now only provide support for ctors/dtors. This paves
the way to using the "crtstuff" provided with GCC (when we upgrade to
GCC 3.3), which provides, among other things, much better C++/Java
exception handling.


# 1.161 12-Nov-2002 itohy

MKDYNAMICROOT for a.out


# 1.160 22-Oct-2002 perry

Pass 1 of SYSPKG changes to automatically add tags=pkgname_pkg to METALOG.
Not quite ready for prime time yet.


# 1.159 27-Sep-2002 thorpej

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.


# 1.158 26-Sep-2002 itojun

MDC2 is a patented algorithm; don't ship it in default libcrypto.
MKCRYPTO_MDC2 will build a separate library, libcrypto_mdc2.


# 1.157 08-Sep-2002 thorpej

Build a .gdbinit in the objdir when building a program. The .gdbinit
file sets the shared library prefix to ${DESTDIR}, and adds "sources"
directives for each file listed in the GDBINIT Makefile variable.


# 1.156 09-Aug-2002 thorpej

Add LIBPMC.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.155 27-Mar-2002 eeh

branches: 1.155.2;
Use the medium low model for sparc64 programs that don't 2GB of data segment.


# 1.154 11-Feb-2002 mycroft

Don't use .PHONY for targets that are actually installed. Instead use force
dependencies. (Among other things, `make -t install' does something vaguely
sensible now.)


# 1.153 07-Feb-2002 pk

Mark installed system libraries as .MADE only if we're actually establishing
their default variable values here.


# 1.152 04-Feb-2002 christos

s/.NOSUFF/.MADE/


# 1.151 03-Feb-2002 christos

Apply a .NOSUFF: directive to targets we don't want to have processed by
the suffix rules engine.


# 1.150 02-Feb-2002 veego

Ups, it is LIBUSBHID and not LIBUSBHIB.


# 1.149 02-Feb-2002 veego

Change LIBUSB to LIBUSBHIB, reflecting the library name change.


# 1.148 29-Jan-2002 enami

Mark the targets clean{extra,objs} as PHONY.


# 1.147 04-Jan-2002 thorpej

For PROG_CXX DESTDIR builds, pull in -lstdc++ and -lm regardless
of GCC version.


# 1.146 01-Jan-2002 thorpej

Per a suggestion from matthew green, PROG_CXX takes the place of
PROG for C++ programs.


# 1.145 01-Jan-2002 thorpej

* If PROG_CXX is set by the program's Makefile, use ${CXX} to link
the program rather than ${CC}.
* If HAVE_GCC3 is defined, pull in "-lstdc++ -lm" as additional C++
support libraries for DESTDIR builds.


# 1.144 28-Dec-2001 lukem

* 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


# 1.143 28-Nov-2001 tv

If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.


# 1.142 19-Nov-2001 thorpej

Use a little transitional hack to determine if we use -isystem
or -idirafter. Use the former only of USE_NEW_TOOLCHAIN, since
-isystem causes the old toolchain to bomb out when building
libstdc++.


# 1.141 14-Nov-2001 tv

C/..$/.c/ -> C/\..$/.c/


# 1.140 14-Nov-2001 tv

Move the DESTDIR-based nostdinc logic to bsd.lib.mk and bsd.prog.mk where
it belongs (with the native target compile rules).


# 1.139 02-Nov-2001 tv

Use INSTALL_FILE/INSTALL_DIR as appropriate.


# 1.138 02-Nov-2001 tv

Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.


# 1.137 19-Oct-2001 tv

Add .NOPATH for all files generated from .l or .y files in SRCS. Fixes PRs
bin/14187 and lib/14239.

Also simplify the handling of these transforms to .c and .h files a bit by
leveraging make's builtin macro operators.


# 1.136 25-Sep-2001 tv

Set .NOPATH on program to build to make sure it goes in .OBJDIR.
Problem noted by <seebs@plethora.net>.


# 1.135 24-Sep-2001 lukem

fix previous (hi thor!) - $OBJS and $CLEANFILES might be empty, and
rm needs some files to delete...


# 1.134 24-Sep-2001 tls

Split "cleanprog" target apart: now you can zap only object files or
CLEANFILES (needed to fix crunchgen lossage).


# 1.133 13-Sep-2001 thorpej

Add LIBPCI.


# 1.132 14-Aug-2001 tv

Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").


# 1.131 01-Jun-2001 tv

Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).


# 1.130 08-May-2001 sommerfeld

Suppress duplicate entries in ALLFILES, FILES, INCS, DEPINCS, INFOFILES,
NLSALL, CATPAGES, MANPAGES, HTMLPAGES, and SCRIPTS.


# 1.129 19-Feb-2001 jmc

Wrap target() checks around afterdepend rule as some Makefiles override this


# 1.128 26-Jan-2001 itojun

fix typo in LIBSSL decl. it made programs with DPADD+=${LIBSSL} to build
every time we type "make". From: bernd


# 1.127 14-Jan-2001 christos

use the new .if commands(<target>) directive so that we don't have to
change Makefiles.


# 1.126 14-Jan-2001 christos

fix thinko: test for the existance of the target before we define it...


# 1.125 14-Jan-2001 christos

Alter previous redefined target protection. If the ${PROG} target is defined,
add the dependencies as usual, but don't add the commands. This avoids
having to change all the Makefiles that redefine the PROG target.


# 1.124 14-Jan-2001 christos

allow programs to override the program target.


# 1.123 08-Jan-2001 mrg

add missing $LIBCRYPTO_RC5 and $LIBCRYPTO_IDEA


# 1.122 08-Jan-2001 mrg

add missing $LIBSSL


# 1.121 04-Jan-2001 garbled

Add LIBCDK and LIBFORM definitions


# 1.120 31-Oct-2000 itojun

add ${LIBINTL} for use with DPADD.


# 1.119 07-Oct-2000 deberg

fix typos, PR 11159


# 1.118 25-Jun-2000 erh

For the case when DESTDIR is set: move the -L${DESTDIR}/usr/lib after ${LDADD} so any -L directories set in LDADD are searched first to avoid possibly linking against old versions of libraries.


Revision tags: netbsd-1-5-base
# 1.117 19-Jun-2000 thorpej

branches: 1.117.2;
Sync up the LIB* list.


# 1.116 10-Jun-2000 mycroft

Use ${.ALLSRC:T} when doing the generated variable name lookups, so that it
DTRT for generated files in and obj directory (or accessed via .PATH).


# 1.115 06-Jun-2000 mycroft

Abuse .USE some more.


# 1.114 06-Jun-2000 mycroft

Minor rearrangement.


# 1.113 06-Jun-2000 mycroft

Use ODE make(1) features to eliminate extra variables and move several things
outside of .for loops. (Needs more work to completely eliminate .for.)

XXX Don't look at this stuff. It will make your head hurt.


Revision tags: minoura-xpg4dl-base
# 1.112 14-Apr-2000 mrg

branches: 1.112.2;
use -rpath-link rather than -R when linking objects using a DESTDIR.
this replaces the previous change as that ended up adding
$DESTDIR/usr/lib to the runtime path of every binary created, which
is bogus and dangerous.


# 1.111 25-Mar-2000 mycroft

When linking with $DESTDIR, use an explicit -R to get library dependencies
correct.


# 1.110 07-Mar-2000 veego

Remove unused libahdi.
It will be replaced in the future with a more generic libdisklabel.


# 1.109 05-Feb-2000 jdc

Add libahdi entries.


# 1.108 23-Jan-2000 eeh

Add some support for FCode binaries.


# 1.107 22-Jan-2000 mycroft

Make `dependall' play nicely with SUBDIR, using a hack similar to `realinstall'
for both `depend' and `all'.
Also, remove the old hack that invokes an extra shell for .depend, now that
make(1) has been fixed.


# 1.106 16-Jan-2000 assar

all: depend on ${SCRIPTS} so that they get generated if they need to


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.105 23-Nov-1999 blymn

Added libmenu library.


Revision tags: comdex-fall-1999-base
# 1.104 14-Sep-1999 perry

branches: 1.104.4;
Add a "dependall" target, which does a "make depend" and then "make all"
in a single directory. This is useful in "make build" because by doing
the build immediately after the depend, all sources will typically
still be in the buffer cache, thus saving significant time over doing
a "make depend" on all the directories and then a "make all".


# 1.103 04-Sep-1999 fredb

Permit "make all install", as well as "make foo install" (where foo would be
installed by "make install") without setting of BUILD. All cases where BUILD
is already set are unchanged from the old behavior.

"make all install" is now practically equivalent to "make BUILD= all install",
but without actually setting build.

Fixes pr's 8313, 3894.


# 1.102 21-Aug-1999 simonb

Add ${INSTPRIV} to ${INSTALL} commands.


# 1.101 01-Jul-1999 itojun

branches: 1.101.2;
add LIBIPSEC for use from DPADD.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.100 12-Feb-1999 lukem

branches: 1.100.2;
* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.99 10-Feb-1999 tv

libbfd_pic.a is no longer installed; remove ${LIBBFD} define.


# 1.98 04-Feb-1999 christos

PR/2936: Brian C. Grayson: Avoid truncating precious files when installing
and the filesystem is full. Added ${RENAME} flag to install, which when set
to -r installs on a temporary file and then renames to the final destination.
${RENAME} is currently set to nothing in bsd.own.mk, but one can turn it
on in /etc/mk.conf.


# 1.97 07-Nov-1998 jonathan

Do DESTDIR support for crtbegin/crtend on all ELF ports (adds mips).


# 1.96 28-Sep-1998 christos

Use preserve flag in install.


# 1.95 10-Sep-1998 ross

Define a LIBBZ2?=... for use in DPADD=... lines.


# 1.94 09-Aug-1998 lukem

add distclean as a synonym for cleandir


# 1.93 09-Apr-1998 tv

.y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.


# 1.92 01-Apr-1998 tv

Revert. This broke too much in the build tree, and a better solution
needs to be created. (The existing situation breaks a lot too.)


# 1.91 01-Apr-1998 tv

Fix .y rules to DTRT with possibly generated .h files. See mail on
tech-toolchain for a very detailed explanation of this. In short, add
a .y.h rule identical to the .y.c rule and make the .y.c rule rename
the .h file; also, clean the .h file in CLEANFILES.


# 1.90 03-Nov-1997 cgd

echo the lint command line when making 'lint'.


# 1.89 28-Oct-1997 lukem

add ${LIBOBJC}


Revision tags: netbsd-1-3-base
# 1.88 11-Oct-1997 mycroft

branches: 1.88.2;
Several changes:
* Allow bsd.man.mk to be included separately.
* Always include bsd.own.mk and bsd.obj.mk.
* Include bsd.man.mk and bsd.nls.mk even if NOMAN or NONLS; just turn off
building of the affected files instead.
* Require bsd.subdir.mk to be included explicitly.
(Will make appropriate changes to Makefiles shortly.)


# 1.87 29-Sep-1997 gwr

Add $LIBBFD


# 1.86 31-May-1997 cjs

Back out BUILDDIR and NOINSTALL changes.


# 1.85 26-May-1997 cjs

branches: 1.85.2;
These updates to the build allow building against include files
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.


# 1.84 18-May-1997 kleink

Add libposix.


# 1.83 17-May-1997 mycroft

Do LINKS and SYMLINKS after FILES and INCS.


# 1.82 17-May-1997 mycroft

Remove unneeded .SUFFIXES lines, and move .s and .S closer to .o to give the
right preferences.


# 1.81 09-May-1997 mycroft

Fix typo in previous.


# 1.80 09-May-1997 mycroft

Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.79 09-May-1997 mycroft

Remove cruft.


# 1.78 09-May-1997 mycroft

Oops; rearrange dependencies to get things built early enough.


# 1.77 09-May-1997 mycroft

Make sure INCS and SRCS are built if necessary.


# 1.76 08-May-1997 gwr

Set the .NOPATH flag for ${OBJS} (from Christos).


# 1.75 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.74 07-May-1997 mycroft

Various simplifications.


# 1.73 07-May-1997 mycroft

Shuffle some .PHONYs around, to work better with `-t'.


# 1.72 06-May-1997 mycroft

Make most of the install targets .PRECIOUS.


# 1.71 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.70 18-Apr-1997 christos

Add ${LIBNTP}


# 1.69 17-Apr-1997 thorpej

- Properly depend on crtbegin.o and crtend.o for platforms that use
them (currently Alpha and PowerPC)
- STRIP -> STRIPFLAG


# 1.68 03-Apr-1997 mikel

don't allow override of all: target


# 1.67 29-Mar-1997 mikel

merge lite-2 changes (mostly SCCSids)


# 1.66 27-Mar-1997 christos

Put the FILES generated rules in a separate .mk file since both bsd.prog.mk
and bsd.lib.mk use them.


# 1.65 27-Mar-1997 mycroft

Make the SCRIPTS case mimic the FILES case more closely, so we can override
the destination direectory, etc.


# 1.64 27-Mar-1997 mycroft

Remove knowledge of HIDEGAME from here.


# 1.63 24-Mar-1997 christos

make rules update:
- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation


# 1.62 22-Mar-1997 perry

Fix SYMLINKS not to include DESTDIR in the link itself


# 1.61 13-Mar-1997 perry

add SYMLINKS, by analogy to LINKS. Vetted by Christos.


# 1.60 22-Jan-1997 cgd

if 'clean' is not already defined, rather than simply defining it with
a bunch of rules, define a clean{kmod,lib,prog} target with the rules,
and have both clean and cleandir depend on that. That eliminates a bug
where 'cleandir' in a directory which included e.g. bsd.prog.mk but which
also had subdirs would 'make clean' all the subdirs and then 'make cleandir'
all ofthe subdirs. It also allows Makefiles to add more dependencies
to 'clean' after inclusion of the make template.

If 'clean' is already defined, the behaviour is the same as it used to be.


# 1.59 20-Dec-1996 cgd

add an afterdepend target (a la the one in bsd.lib.mk) that processes
the .depend file to add <filename>.ln for each <filename>.o as an
object file which has the given dependencies (in addition to
<filename>.po and <filename>.so, which were already there).


# 1.58 13-Dec-1996 mikel

add missing LIBPCAP definition.


# 1.57 26-Nov-1996 mrg

add libz and libwrap


# 1.56 18-Oct-1996 thorpej

Use ${INSTALL} rather than "install".
From Simon J. Gerraty <sjg@zen.void.oz.au>, PR #1458.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.55 08-Apr-1996 jtc

Sort LIBFOO definitions and add LIBY; Reported by Mike Long <mike.long@analog.com> in PR #2301.


# 1.54 22-Oct-1995 christos

Added include file <bsd.sys.mk> that contains lex and yacc "parallel aware"
rules. These rules are not turned on by default; they are enabled by setting
the PARALLEL variable.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.53 25-Jun-1995 cgd

oops; fix an rm that might be empty


# 1.52 24-Jun-1995 cgd

update lint rules, but keep linting disabled


# 1.51 10-Jun-1995 mycroft

Define LIBEDIT.


# 1.50 21-Apr-1995 jtc

.include <bsd.nls.mk> unless NONLS is defined.


# 1.49 22-Dec-1994 cgd

specify man pages differently, and document how.


# 1.48 24-Aug-1994 mycroft

Include bsd.own.mk earlier.


# 1.47 20-Jul-1994 cgd

fix from christos, for progs w/o objects


Revision tags: netbsd-1-0-base
# 1.46 06-Jul-1994 mycroft

branches: 1.46.2;
Pull libraries from ${DESTDIR} if set. Kill LDONLY, which is unused and
probably not useful anyway.


# 1.45 30-Jun-1994 cgd

fix modify-info-nothingness-then-substitute probelm that broke genclass build


# 1.44 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.43 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.42 28-Jun-1994 jtc

Strip *.sh when constructing OBJS from SRCS.
This will allow us to clean up makefiles that build a script by munging
a template (uusched, genclass, neqn, etc.).


# 1.41 18-Jun-1994 cgd

don't chown the symlink, when HIDEGAME causes a symlink to be made to dm.
4.4-based FS code _follows_ the symlinks on a chown(2) call.


# 1.40 24-May-1994 cgd

fix the last to do the right thing for dependencies


# 1.39 24-May-1994 deraadt

LIBSKEY


# 1.38 22-May-1994 jtc

Single source file programs are now compiled into object files before they
are linked. This change halves the time it takes to rebuild all of the
NetBSD sources when only the C library is "touched"; but only takes about
one percent more disk space.


# 1.37 06-Apr-1994 chopps

relink (recompile) single source programs when crt0.o is updated.


# 1.36 24-Mar-1994 mycroft

Remove *.core on clean.


# 1.35 09-Feb-1994 cgd

kill install -d's.


# 1.34 28-Jan-1994 cgd

add LIBKVM


# 1.33 10-Nov-1993 cgd

librpc doesn't exist anymore


# 1.32 08-Nov-1993 cgd

ad LDSTATIC flag, so static linking can be made one-stop shopping.
use "setenv LDSTATIC" to make *everything* dynamically linked,
setenv LDSTATIC -static for everything statically linked, or unset
it for default behavior.


# 1.31 07-Oct-1993 cgd

LIBTERM pointed at nothing, but was meant to point to libtermcap.a...


# 1.30 07-Oct-1993 cgd

always define LIBCRYPT


# 1.29 17-Aug-1993 mycroft

Make sure we don't recurse into subdirectories if Makefile specified `install'
target. (It's usually blank and is specifically to avoid doing this...)


# 1.28 15-Aug-1993 mycroft

Automatically include bsd.subdir.mk for backward compatibility.


# 1.27 15-Aug-1993 mycroft

Don't automatically include bsd.subdir.mk in bsd.prog.mk and bsd.lib.mk.
Put back .MAIN in bsd.man.mk, and be careful not to include ../Makefile.inc
a second time.


# 1.26 15-Aug-1993 mycroft

Move man rules to sys.mk.
Use bsd.subdir.mk for building subdirectories.
Don't forget to remove x.cc and x.C when using SHAREDSTRINGS.
Make ${PROG} always depend on ${LIBCRT0}.
Don't duplicate code between cleandir and clean.
Move tags target to bsd.dep.mk.
Move STRIP to bsd.own.mk.
Remove redundant definitions of {BIN,MAN}{DIR,GRP,OWN,MODE}.
Move {LIB,DOC}{DIR,GRP,OWN,MODE} defaults to bsd.own.mk.


# 1.25 15-Aug-1993 mycroft

Abstract out dependency stuff, and add RCS identifiers.


# 1.24 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


# 1.23 10-Aug-1993 mycroft

Put LINKS handling in `install' target, so it's the last thing executed, and
happens even if `realinstall' is user-defined.


# 1.22 30-Jul-1993 mycroft

When generating a default OBJS, ignore .h files.


# 1.21 29-Jul-1993 mycroft

Don't print the `making ...' message if an obj dir already exists.
Also, a minor cleanup.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.20 17-Jul-1993 mycroft

Fix C++ dependencies for good. `make depend' is now done in two passes--one
of C files and one for C++ files. No need to specify `-+' in your Makefile,
as it is now done automatically.


# 1.19 17-Jul-1993 cgd

do c++ dependencies the right way...


# 1.18 17-Jul-1993 mycroft

Add suffix rules for C++ files.


# 1.17 04-Jun-1993 brezak

Add LIBRPCSVC variable.


# 1.16 02-Jun-1993 cgd

add ability to specify c++ dependencies, by setting CFLAGS+=-+ for
the dependency make.


# 1.15 26-Apr-1993 cgd

added definition for DPADD library variable LIBCRYPT.


# 1.14 26-Apr-1993 mycroft

Don't redefine `realinstall' target if already defined.


# 1.13 25-Apr-1993 mycroft

Link with LDFLAGS even if one source module.


# 1.12 25-Apr-1993 mycroft

Don't lose if we include bsd.prog.mk only to build man pages.


# 1.11 25-Apr-1993 mycroft

Fix error in last change. (Oops.)


# 1.10 25-Apr-1993 mycroft

Don't build man pages if NOMAN set.


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.9 09-Apr-1993 cgd

various changes to default make rules. from patch 101.
note that only the "sensible" changes in patch 101 are implemented.


# 1.8 08-Apr-1993 cgd

try to do the right thing, in terms making directories before we
install into them, and get the manpage cleans _OUT_ of "clean".
they don't belong there, only in cleandir, WFJ be damned.


# 1.7 08-Apr-1993 cgd

fixed typos...


# 1.6 08-Apr-1993 cgd

(silently) make sure we have directories before installing


# 1.5 04-Apr-1993 cgd

make LIBRPC point to the right place


# 1.4 27-Mar-1993 nate

Fixed the doc macros to call troff, eqn,and tbl instead of ditroff,
deqn, and dtbl.
Fixed make clean to remove the man pages (Bill fixed this in the distribution,
but not in the original source)
Changed install to leave the original file around, by using 'cp' instead of
'mv'. "install -c ..."


# 1.3 23-Mar-1993 cgd

made .CURDIR be absolute, not relative, thereby eliminating
the need for some of the makefile trickery when making objects,
and fixing a few .PATH bugs


# 1.2 22-Mar-1993 cgd

fixed "make obj" for cases when sources not in /usr/src/...
if sources not there, it now mkdirs obj, but some trickery
is necessary, to avoid deleting cwd.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.301 29-Jan-2017 christos

add sqlite3 to statically linked libraries for pam.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914
# 1.300 20-Aug-2016 christos

unbound additions


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.299 04-Apr-2016 joerg

If the per-target LDSTATIC flag is set, don't include the PIE linker
flags as we currently don't support static PIE.


# 1.298 30-Mar-2016 martin

Pass -pie to cc, not -Wl,-pie. This way we have a chance to fix specs
for obscure corner cases like -pie -fPIE -static (used for
/usr/tests/lib/csu/h_initfini2 if building with MKPIE=yes).
While there also replace -fPIC with -fPIE for the PIE case, even if
it should be mostly equivalent.


# 1.297 12-Mar-2016 mrg

remove conditionals that are always true with GCC >= 4.8.


# 1.296 21-Feb-2016 christos

Add NODEBUG


# 1.295 31-Jan-2016 christos

Introduce NOPIE and NOCTF so that standalone programs build properly.


# 1.294 23-Jan-2016 christos

Define _KERNTYPES for things that need it.


# 1.293 07-Nov-2015 joerg

LIBEXECINFO


# 1.292 07-Jun-2015 matt

Make LIBCRT* depend on the right files if MLIBDIR from MKCOMPAT is defined.


# 1.291 01-Dec-2014 erh

PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilt
if any of their dependencies (i.e. the files they refer to) are changed.
This allows changes to transitive included headers to be handled properly.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.290 25-Mar-2014 ozaki-r

branches: 1.290.4;
Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.


Revision tags: riastradh-drm2-base3
# 1.289 09-Mar-2014 christos

let's see if the new dwarf library can handle dwarf 4


# 1.288 02-Mar-2014 christos

If we are compiling with -g and using gcc4.8 and dtrace downgrade
dwarf generation to version 2 for now.


# 1.287 15-Jan-2014 joerg

-Wl,-pie and -r don't agree with each other, so filter the former out.


# 1.286 11-Nov-2013 joerg

Relink binaries if crti.o changes.


# 1.285 29-Sep-2013 christos

Add libxcb


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.284 31-May-2013 mrg

add LIBX11_XCB; unfortunately since the library is named with a -
in it, we have to use an ugly hard coded assignment for now.
(could be cleaned up with more make variable magic i'm sure.)


# 1.283 04-Apr-2013 christos

ldopts should be before ldadd like everywhere else.


Revision tags: agc-symver-base
# 1.282 14-Feb-2013 christos

Since the libraries are produced with different MK flags than the programs,
we check for existance of the files instead of the MK flags.


# 1.281 14-Feb-2013 christos

Add PROGDPLIBS


# 1.280 26-Jan-2013 christos

CTFCONVERT me harder.


Revision tags: yamt-pagecache-base8
# 1.279 17-Jan-2013 christos

Now that we have separate debug sets, add -g if ${MKDEBUG} is set for
program builds since we don't need to install that symbol files.


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.278 24-Aug-2012 jmmv

branches: 1.278.2;
Allow DPADD to be specified on a per-program basis.


# 1.277 23-Aug-2012 joerg

Revert last, it breaks the tricks xsrc uses.


# 1.276 23-Aug-2012 joerg

Remove SHLIBINSTALLDIR and SHLINKINSTALLLIBDIR. Add rpath entries, if
SHLIBDIR differs from /usr/lib.


# 1.275 08-Aug-2012 christos

add MKRUMP by popular demand.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.274 29-Feb-2012 tron

Move "libexpat" from X11 into base which fixes PR lib/40346.
This change was approved by the Core Group.


# 1.273 21-Feb-2012 matt

Remove another ${SIZE}


# 1.272 20-Feb-2012 matt

Remove ${SIZE}


# 1.271 19-Feb-2012 matt

Add support for --combine with gcc.


Revision tags: netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2
# 1.270 05-Nov-2011 christos

branches: 1.270.2;
Add libtre


Revision tags: yamt-pagecache-base
# 1.269 16-Oct-2011 christos

branches: 1.269.2;
- no need to special-case libraries with weird characters.
- add a note about adding new libraries.


# 1.268 16-Oct-2011 christos

fix list of libraries to reflect reality.


# 1.267 10-Sep-2011 apb

Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.


# 1.266 27-Aug-2011 joerg

Add new "analyze" command to run clang's static analyzer in a directory
on all C/C++ files.


Revision tags: cherry-xenmp-base
# 1.265 26-Apr-2011 he

The new Heimdal adds -lwind and -lheimbase to the set of libraries,
so define the corresponding LIB* variables.
These are also needed in the PAM_STATIC_* variables, so add them there too.


# 1.264 11-Apr-2011 joerg

Adjust --sysroot related usage:
-Wl,-rpath does not expand =, so just drop it.

Drop -Wl,-rpath-link entries that duplicate the -Wl,-rpath entries, this
is done implicitly now that ld is built with sysroot support.

Use ${DESTDIR} explicitly for the remaining -Wl,-rpath-link entries.


# 1.263 10-Apr-2011 joerg

For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.


# 1.262 08-Mar-2011 jmmv

Revert previous (revision 1.261): it broke the build because PROG_CXX is
defined in terms of PROG, so later on we would end up with target duplicates
because both PROG_CXX and PROG were being converted to PROGS_CXX and PROGS.

Did not catch this earlier because the test build I did was not clean and
thus the duplicate targets did not have nasty effects.


# 1.261 07-Mar-2011 jmmv

Always convert PROG to its plural form independently of whether PROG_CXX
is defined or not. From Garrett Cooper in private mail.


Revision tags: bouyer-quota2-nbase
# 1.260 20-Feb-2011 jmmv

Define LIBATF_C and LIBATF_CXX to point to their corresponding .a files and
use these to properly set DPADD for test programs.


Revision tags: bouyer-quota2-base
# 1.259 13-Feb-2011 christos

add saslc


# 1.258 06-Feb-2011 joerg

Don't use -nostdinc or -nostdinc++ if this is included in a HOSTLIB.


# 1.257 17-Jan-2011 pooka

branches: 1.257.2;
Add rump bits to DPSRCS so that update builds work correctly.


Revision tags: matt-mips64-premerge-20101231
# 1.256 13-Dec-2010 pooka

befriend RUMPPRG with CRUNCHEDPRG


# 1.255 13-Dec-2010 pooka

Define RUMPPRG, which is just like PROG, except it additionally
builds a rump client with the name rump.${PROG}. The rump client
is not installed suid/sgid by default even if BINMODE is defined.


# 1.254 10-Dec-2010 joerg

Revert last, gcc(1) checks explicitly for -r on some platforms to disable
passing down --relax as well.


# 1.253 08-Dec-2010 joerg

gcc passes down -r directly to ld, so make it explicitly a linker option.


# 1.252 08-Dec-2010 joerg

Don't depend on ${CC} passing down -R to ld, use -Wl,-rpath explicitly.


# 1.251 08-Nov-2010 lukem

Preserve date on original shared library or program when stripping
the debug symbols and adding the debug-link to .debug.
Use '(rm -f file; false)' in the failure path to force failure.
Based on solution proposed by Nicolas Joly on tech-toolchain in July 2010.
Should fix PR toolchain/44046 from Andreas Gustafsson.


# 1.250 31-Oct-2010 mbalmer

Link Lua to the build and add the resulting files to the distribution sets.
Document the addition of Lua and the change we made to the default settings.


# 1.249 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.248 24-Apr-2010 lukem

When extracting separate debug symbols with MKDEBUG, there's no need
to leave the original file unstripped...


# 1.247 02-Mar-2010 darran

DTrace: Add CTF generation to the make framework. Only enabled when
MKDTRACE=yes.


# 1.246 14-Dec-2009 mrg

use "${CC} -r" not "${CC} -Wl,-r" as the latter fools GCC on some targets
and it ends up passing "-r -relax" to ld, which causes ld to barf.


# 1.245 14-Dec-2009 matt

Merge from matt-nb5-mips64


Revision tags: matt-premerge-20091211
# 1.244 08-Dec-2009 uebayasi

When PROGS / LIBS are used, you can pass each PROG / LIB specific parameters
to ${LD} via:

${LDADD.${PROG}}
${LDFLAGS.${PROG}}
${LDSTATIC.${PROG}}
${LDADD.${LIB}}
${LDFLAGS.${LIB}}

OTOH you can't pass parameters to ${CC}, because in suffix rules make(1) only
knows the name of ${.IMPSRC} and ${.TARGET}; it's users' responsivility to
define ${CC} parameters to all the sources of a given ${PROG} / ${LIB}.

Should address bin/42381.

(Bug in this commit log was pointed out by mrg@.)


# 1.243 27-Nov-2009 tsutsui

If CPPFLAGS or CXXFLAGS already contains -nostdinc or -nostdinc++,
don't add ${CPPFLAGS_ISYSTEM} or ${CPPFLAGS_ISYSTEMXX} to refer
${DESTDIR}/usr/include or ${DESTDIR}/usr/include/g++.

This change might cause errors on some MD stand dir, but in that case
each Makefile should be fixed to search proper system include paths
by -Ipath option in own CPPFLAGS.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.242 12-May-2009 plunky

remove libsdp as improved functionality has been enabled in libbluetooth.


# 1.241 10-Apr-2009 apb

Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links. They have no effect except when using a
metalog, in which case the information is added to the metalog. In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg. This should fix PR 24457 and PR 41155.


# 1.240 24-Nov-2008 cube

branches: 1.240.2;
Move cleanextra to the very ends in case another included file wants to add
to it even if it was initially empty.


Revision tags: netbsd-5-base matt-mips64-base2
# 1.239 19-Oct-2008 christos

branches: 1.239.2;
handle assembly files for MKPIE


# 1.238 16-Oct-2008 christos

Provide a way for a program to override the PIE flags.


# 1.237 15-Oct-2008 christos

don't compile/link libraries with pie


Revision tags: mjf-devfs2-base
# 1.236 02-Oct-2008 joerg

Hook up libfetch and pkg_install update.


Revision tags: wrstuden-revivesa-base-3
# 1.235 09-Sep-2008 joerg

Add MKSTRIPIDENT to remove the RCS IDs from binary programs and shared
libraries for space-constraint systems. The description is based on the
feedback of hubertf@, the logic on input from lukem@

This obsoletes the removal of LIBC_SCCS and SYSLIBC_SCCS for libc builds.


Revision tags: wrstuden-revivesa-base-2
# 1.234 28-Aug-2008 mrg

update a comment example


# 1.233 27-Aug-2008 rtr

use ${X11USRLIBDIR} instead of hard-coded /usr/X11R6/lib when building
${LIB.foo} vars


# 1.232 27-Aug-2008 lukem

Fix problem I introduced in rev 1.231 on 2008/08/25 where ${_PROGLDOPTS}
and -L${_GCC_LIBGCCDIR} were appearing in the link line before ${LDADD},
so -L${DESTDIR}/lib and -L${DESTDIR}/usr/lib were being used before
local -L library paths.
Fixes ntpd/ntpdate failure noticed by Valeriy E. Ushakov <uwe@NetBSD.org>


# 1.231 25-Aug-2008 lukem

Always link with: -Wl,-rpath-link,${DESTDIR}/usr/lib -L${DESTDIR}/usr/lib
Fixes problem with MKDYNAMICROOT=no triggered by libraries that depend
on other libraries.
Related to PR 33503.

Clean up setting of _CCLINK to always add the appropriate -B options.

Simplify the link rule for a program.


# 1.230 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.229 28-May-2008 lukem

add LIBLDAR_R (for completeness)


# 1.228 22-May-2008 lukem

Add MKLDAP, USE_LDAP, LIBLBER, LIBLDAP


Revision tags: hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-pf42-base
# 1.227 10-Apr-2008 tsutsui

branches: 1.227.2; 1.227.4;
Add libhx509 to PAM_STATIC_LDADD which is required by libkrb5.


# 1.226 22-Mar-2008 mlelstv

branches: 1.226.2;
Import Heimdal-1.1


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase matt-armv6-base hpcarm-cleanup-base
# 1.225 26-Dec-2007 jmmv

Make the clean target work when OBJS is set but PROG is not, as happens
for example in gnu/lib/crtstuff4. Reported by drochner@.


Revision tags: cube-autoconf-base
# 1.224 13-Nov-2007 jmmv

Fix typo that prevented MKDEBUG builds to work. Found by drochner@.


# 1.223 12-Nov-2007 jmmv

Add the ability to build multiple programs from a single directory

This adds support for a new set of variables, PROGS and PROGS_CXX, that
allow the developer to build multiple different programs from a single
source directory.


# 1.222 04-Nov-2007 tls

Remove MKPRIVATELIB from BIND libraries; move library reachover
directories and Makefiles from src/usr.sbin/bind to src/lib; make
BIND libraries build shared. Saves about 1MB-1.5MB per installed
executable, about 5MB for a base+etc minimal installation of NetBSD.


Revision tags: matt-mips64-base
# 1.221 29-Jul-2007 joerg

branches: 1.221.4; 1.221.6;
Add build glue for libarchive and update the various sets.


# 1.220 25-Jan-2007 perry

Before I completely forget the issue, convert "PROG_PAX" to the
better-named "PAXCTL_FLAGS".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.219 11-Nov-2006 christos

don't run paxctl if other commands were specified for that target.


# 1.218 10-Nov-2006 christos

if ${PROG_PAX} is defined, run paxctl on the binary after linking with
the value of the variable. This way, if you set:

PROG_PAX=+M

in /etc/mk.conf, you get what you deserve.


# 1.217 22-Oct-2006 pooka

libpuffs


# 1.216 09-Oct-2006 mrg

- clean up some comments to reality.
- retire LIBDCK, LIBG2C and (long broken) USE_LIBSTDCXX
- in bsd.hostprog.mk's LIBSTDCPP -> LIBSTDCC
- add LIBSUPCXX
- don't default USE_LIBSTDCXX or USE_GCC4 since they are
not used in the tree any where
- same with USE_XF86_4; retire it
- remove _SUPCXX handling in bsd.prog.mk

inspired by PR#26714.


Revision tags: abandoned-netbsd-4-base
# 1.215 23-Jul-2006 lukem

Implement MKDEBUG:
If "no", don't build and install separate debugging symbols
into /usr/libdata/debug.
Default: no


# 1.214 19-Jun-2006 gdamore

Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.


# 1.213 09-Jun-2006 christos

PR/33681: Scott Ellis: Building 'bc' with SHAREDSTRINGS=yes fails
We need CPPFLAGS too now.


# 1.212 11-May-2006 mrg

add support for ${OBJCOPTS} and ${OBJCOPTS}.<lib|prog|fn>.


# 1.211 20-Mar-2006 christos

There is always one more KRB4 thing to remove. (from Jukka Salmi)


# 1.210 20-Mar-2006 christos

Remove krb4 variables and libraries (Jukka Salmi)


# 1.209 16-Mar-2006 jwise

Now that we have real build system support for syspkgs, remove someone's
half-implemented idea of building `syspkgs' (really a few giant blobs of the
same granularity of the old sets) using install(1).


# 1.208 20-Jan-2006 christos

Add the world of libraries to the static pam build. Now static pam binaries
work.


# 1.207 09-Apr-2005 dsl

Report when we link a program into xxx.ro (before being crunched)


Revision tags: netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.206 04-Mar-2005 he

branches: 1.206.2; 1.206.4;
Introduce PAM_STATIC_LDADD and PAM_STATIC_DPADD. When compiling
with MKPIC=no, possibly because the target does not support shared
libraries, these include libraries required to resolve all symbols
which end up referenced from PAM-using applications. The libraries
presently required are -lcrypt, -lrpcsvc and -lutil.

Add use of these variables which are currently set up to use PAM,
so that they compile when MKPIC=no.

Also, in the telnetd case, reorder the order of the libraries, so
that libtelnet.a comes before -ltermcap and -lutil, again to fix
link error when MKPIC=no.

Discussed with thorpej and christos.


# 1.205 20-Feb-2005 christos

Add libradius


# 1.204 12-Jan-2005 lukem

If RESCUEDIR is defined, automatically add that to CPPFLAGS


# 1.203 08-Jan-2005 lukem

Implement <bsd.prog.mk> vars:
LIBASN1 LIBBSDMALLOC LIBG2C LIBPAM LIBSSH


# 1.202 04-Aug-2004 lukem

Revert most of previous, and move the LIB<libname>?= assignments
back to bsd.prog.mk from bsd.own.mk.

pkgsrc uses <bsd.own.mk>, and setting LIB<libname> in it causes
problems with various package builds.
This should fix PR #26542 submitted by Jim Bernard.

(I'll be implementing the DPADD for shared libraries in a different
manner that generally won't depend upon ${LIB<libname>}.)


# 1.201 30-Jul-2004 lukem

Move the LIB<libname>?= assignments from bsd.prog.mk to bsd.own.mk so
that they may be used by non PROGs (e.g., LIBs).

Improve some comments.


# 1.200 10-Jun-2004 lukem

Be consistent in handling YHEADER, similar to Christos' fix in bsd.lib.mk 1.253


# 1.199 21-May-2004 ross

If you add a library, you need to define its DPADD symbol here.

Add LIBMAGIC.


Revision tags: netbsd-2-0-base
# 1.198 15-Feb-2004 skrll

branches: 1.198.2;
Be more gcc like in the way we deal with libgcc so that sh3/hppa millicode
and exception handling have a chance of working properly.

- creates libgcc, libgcc_eh and libgcc_s

- updates LIBGCC_SPEC to use them appropriately.

There's a hack in here at the moment with respect to libgcc_so in that it
is preferable to link against libgcc_so will only when -shared-libgcc is
specified (the c++ frontend does this automatically.) Configurations where
LINK_EH_SPEC is defined already do this. The gcc configuration for
NetBSD/alpha and another NetBSD platform (I forget which) actually define
LINK_EH_SPEC probably by accident rather than design.

- updates share/mk to use the compiler's knowledge of what needs linking into
libraries and executables. This removes an hppa hack.

- updates the sets for the newly created libgcc* files.

- support for linking against the _pg version of libgcc has been removed.


# 1.197 29-Jan-2004 lukem

Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.


# 1.196 27-Jan-2004 lukem

Replace
:M-[IDU]*
with
:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)


# 1.195 23-Jan-2004 simonb

crt0.o lives in /usr/lib even on a.out.


# 1.194 16-Nov-2003 lukem

simplify with _MKTARGET_LINK


# 1.193 11-Nov-2003 dsl

Set MKDEP_SUFFIXES to get additional targets in .depend instead of using
sed in .afterdepend. I don't think .afterdepend is used anywhere any more.


# 1.192 21-Oct-2003 lukem

Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.


# 1.191 19-Oct-2003 lukem

Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} " ... {$.TARGET}" and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO


# 1.190 18-Oct-2003 lukem

Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command ("verbose")
This is the default, and is equivalent to the previous behaviour.


# 1.189 29-Sep-2003 lukem

Add LIBSTDCXX (for usr/lib/libstdc++.a).
Sync LIB* documentation with reality.


# 1.188 19-Sep-2003 martin

Drop explicit medlow model and default to -O2 for sparc64.


# 1.187 14-Sep-2003 lukem

Check ${SHLIBDIR} against "/usr/lib" instead of ${LIBDIR} when determining
if we need to add stuff (usually "/lib") to the rpath-link path before
"/usr/lib". Otherwise, this barfs if LIBDIR != /usr/lib or /lib, and
we're cross-building (e.g., in src/x11)


# 1.186 13-Sep-2003 erh

Also support per-program LDFLAGS and LDSTATIC.


# 1.185 13-Sep-2003 erh

Create a way to add additional flags to COPTS, CPPFLAGS, CXXFLAGS and LDADD
for particular libraries or programs by specifying the additions in mk.conf
instead of needing to go edit individual Makefiles.


# 1.184 12-Sep-2003 lukem

add infrastructure to support reach-over builds of xsrc


# 1.183 22-Aug-2003 dsl

Add a ${PROG}.ro target that does an 'ld -r' of the program object files.
Allows a much simplified build of 'crunched' binaries since crunchgen can
build prog.ro instead of having to deretmine the names of all the .o files.


# 1.182 01-Aug-2003 lukem

Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".


# 1.181 01-Aug-2003 lukem

simplify the ${PROG}: target to reduce duplication between the DESTDIR
and !DESTDIR cases...


# 1.180 31-Jul-2003 lukem

bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.


# 1.179 31-Jul-2003 lukem

Don't need -R/usr/lib; it will be searched at the end by ld.elf_so anyway.
Noted by matt green <mrg@>


# 1.178 28-Jul-2003 lukem

be consistent when adding *.y and *.l to DPSRCS


# 1.177 28-Jul-2003 lukem

replace MKCXXSUPCXX(!=no) with USE_LIBSTDCXX(==no)


# 1.176 28-Jul-2003 lukem

Change defined(CXX_SUPCXX) to MKCXXSUPCXX != "no".

Clarify that command-line overrides of the MKxxx variables should be
done via the environment rather than make(1) command-line variable
assignment, since the latter doesn't actually work as intended.


# 1.175 27-Jul-2003 mrg

introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes. for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)


# 1.174 26-Jul-2003 mrg

add a new bsd.own.mk variable: CXX_SUPCXX. from bsd.README:
+ CXX_SUPCXX If defined, the support libraries needed for this C++ program
+ are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.


# 1.173 20-Jul-2003 lukem

Consistently support the different C++ file extensions: .cc .cpp .cxx .C
Noted by Andrew White in PR toolchain/18246


# 1.172 18-Jul-2003 lukem

Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was defined.
Replace defined(UNPRIVED) tests with ${MKUNPRIVED} != "no"

Add MKUPDATE; if not no has the same semantics as if UPDATE was defined.
Replace defined(UPDATE) tests with ${MKUPDATE} != "no"

Improve documentation for these and other make flags.


# 1.171 16-Jul-2003 itojun

stop installing install libtelnet. build under lib/libtelnet and reference
it from usr.bin/telnet and libexec/telnetd.
(reason for separate build: compiler flags)


# 1.170 27-Jun-2003 drochner

For consistency, use "-R" instead of "-Wl,-rpath" to pass
a runtime search path to the linker.


# 1.169 13-Jun-2003 itojun

define LIBEVENT


# 1.168 11-Jun-2003 msaitoh

catch signal 1,2,3,13 and 15 to clean /tmp/_dependXXX


# 1.167 31-May-2003 thorpej

If EXTERNAL_TOOLCHAIN is defined, allow the compiler to define the
location of crt{begin,end}{,S}.o and libgcc.a. Encapsulate all of
this logic into the new bsd.gcc.mk, and use it in bsd.prog.mk and
bsd.lib.mk.


# 1.166 18-May-2003 lukem

make this a no-op if HOSTPROG is defined


# 1.165 30-Mar-2003 thorpej

If MACHINE_ARCH is powerpc and we HAVE_GCC3, add crtsaveres.o to the
endfile spec.


# 1.164 22-Feb-2003 uwe

Typo in comment.


# 1.163 24-Jan-2003 thorpej

Add LIBPTHREAD, LIBPTHREAD_DB, and LIBRT.


Revision tags: fvdl_fs64_base
# 1.162 22-Nov-2002 thorpej

Split crtbegin/crtend into crti/crtbegin/crtend/crtn. NetBSD-specific
things like the .note.netbsd.ident section are provided by crti/crtn.
crti/crtn also provide the _init() and _fini() routines.

crtbegin/crtend now only provide support for ctors/dtors. This paves
the way to using the "crtstuff" provided with GCC (when we upgrade to
GCC 3.3), which provides, among other things, much better C++/Java
exception handling.


# 1.161 12-Nov-2002 itohy

MKDYNAMICROOT for a.out


# 1.160 22-Oct-2002 perry

Pass 1 of SYSPKG changes to automatically add tags=pkgname_pkg to METALOG.
Not quite ready for prime time yet.


# 1.159 27-Sep-2002 thorpej

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.


# 1.158 26-Sep-2002 itojun

MDC2 is a patented algorithm; don't ship it in default libcrypto.
MKCRYPTO_MDC2 will build a separate library, libcrypto_mdc2.


# 1.157 08-Sep-2002 thorpej

Build a .gdbinit in the objdir when building a program. The .gdbinit
file sets the shared library prefix to ${DESTDIR}, and adds "sources"
directives for each file listed in the GDBINIT Makefile variable.


# 1.156 09-Aug-2002 thorpej

Add LIBPMC.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.155 27-Mar-2002 eeh

branches: 1.155.2;
Use the medium low model for sparc64 programs that don't 2GB of data segment.


# 1.154 11-Feb-2002 mycroft

Don't use .PHONY for targets that are actually installed. Instead use force
dependencies. (Among other things, `make -t install' does something vaguely
sensible now.)


# 1.153 07-Feb-2002 pk

Mark installed system libraries as .MADE only if we're actually establishing
their default variable values here.


# 1.152 04-Feb-2002 christos

s/.NOSUFF/.MADE/


# 1.151 03-Feb-2002 christos

Apply a .NOSUFF: directive to targets we don't want to have processed by
the suffix rules engine.


# 1.150 02-Feb-2002 veego

Ups, it is LIBUSBHID and not LIBUSBHIB.


# 1.149 02-Feb-2002 veego

Change LIBUSB to LIBUSBHIB, reflecting the library name change.


# 1.148 29-Jan-2002 enami

Mark the targets clean{extra,objs} as PHONY.


# 1.147 04-Jan-2002 thorpej

For PROG_CXX DESTDIR builds, pull in -lstdc++ and -lm regardless
of GCC version.


# 1.146 01-Jan-2002 thorpej

Per a suggestion from matthew green, PROG_CXX takes the place of
PROG for C++ programs.


# 1.145 01-Jan-2002 thorpej

* If PROG_CXX is set by the program's Makefile, use ${CXX} to link
the program rather than ${CC}.
* If HAVE_GCC3 is defined, pull in "-lstdc++ -lm" as additional C++
support libraries for DESTDIR builds.


# 1.144 28-Dec-2001 lukem

* 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


# 1.143 28-Nov-2001 tv

If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.


# 1.142 19-Nov-2001 thorpej

Use a little transitional hack to determine if we use -isystem
or -idirafter. Use the former only of USE_NEW_TOOLCHAIN, since
-isystem causes the old toolchain to bomb out when building
libstdc++.


# 1.141 14-Nov-2001 tv

C/..$/.c/ -> C/\..$/.c/


# 1.140 14-Nov-2001 tv

Move the DESTDIR-based nostdinc logic to bsd.lib.mk and bsd.prog.mk where
it belongs (with the native target compile rules).


# 1.139 02-Nov-2001 tv

Use INSTALL_FILE/INSTALL_DIR as appropriate.


# 1.138 02-Nov-2001 tv

Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.


# 1.137 19-Oct-2001 tv

Add .NOPATH for all files generated from .l or .y files in SRCS. Fixes PRs
bin/14187 and lib/14239.

Also simplify the handling of these transforms to .c and .h files a bit by
leveraging make's builtin macro operators.


# 1.136 25-Sep-2001 tv

Set .NOPATH on program to build to make sure it goes in .OBJDIR.
Problem noted by <seebs@plethora.net>.


# 1.135 24-Sep-2001 lukem

fix previous (hi thor!) - $OBJS and $CLEANFILES might be empty, and
rm needs some files to delete...


# 1.134 24-Sep-2001 tls

Split "cleanprog" target apart: now you can zap only object files or
CLEANFILES (needed to fix crunchgen lossage).


# 1.133 13-Sep-2001 thorpej

Add LIBPCI.


# 1.132 14-Aug-2001 tv

Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").


# 1.131 01-Jun-2001 tv

Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).


# 1.130 08-May-2001 sommerfeld

Suppress duplicate entries in ALLFILES, FILES, INCS, DEPINCS, INFOFILES,
NLSALL, CATPAGES, MANPAGES, HTMLPAGES, and SCRIPTS.


# 1.129 19-Feb-2001 jmc

Wrap target() checks around afterdepend rule as some Makefiles override this


# 1.128 26-Jan-2001 itojun

fix typo in LIBSSL decl. it made programs with DPADD+=${LIBSSL} to build
every time we type "make". From: bernd


# 1.127 14-Jan-2001 christos

use the new .if commands(<target>) directive so that we don't have to
change Makefiles.


# 1.126 14-Jan-2001 christos

fix thinko: test for the existance of the target before we define it...


# 1.125 14-Jan-2001 christos

Alter previous redefined target protection. If the ${PROG} target is defined,
add the dependencies as usual, but don't add the commands. This avoids
having to change all the Makefiles that redefine the PROG target.


# 1.124 14-Jan-2001 christos

allow programs to override the program target.


# 1.123 08-Jan-2001 mrg

add missing $LIBCRYPTO_RC5 and $LIBCRYPTO_IDEA


# 1.122 08-Jan-2001 mrg

add missing $LIBSSL


# 1.121 04-Jan-2001 garbled

Add LIBCDK and LIBFORM definitions


# 1.120 31-Oct-2000 itojun

add ${LIBINTL} for use with DPADD.


# 1.119 07-Oct-2000 deberg

fix typos, PR 11159


# 1.118 25-Jun-2000 erh

For the case when DESTDIR is set: move the -L${DESTDIR}/usr/lib after ${LDADD} so any -L directories set in LDADD are searched first to avoid possibly linking against old versions of libraries.


Revision tags: netbsd-1-5-base
# 1.117 19-Jun-2000 thorpej

branches: 1.117.2;
Sync up the LIB* list.


# 1.116 10-Jun-2000 mycroft

Use ${.ALLSRC:T} when doing the generated variable name lookups, so that it
DTRT for generated files in and obj directory (or accessed via .PATH).


# 1.115 06-Jun-2000 mycroft

Abuse .USE some more.


# 1.114 06-Jun-2000 mycroft

Minor rearrangement.


# 1.113 06-Jun-2000 mycroft

Use ODE make(1) features to eliminate extra variables and move several things
outside of .for loops. (Needs more work to completely eliminate .for.)

XXX Don't look at this stuff. It will make your head hurt.


Revision tags: minoura-xpg4dl-base
# 1.112 14-Apr-2000 mrg

branches: 1.112.2;
use -rpath-link rather than -R when linking objects using a DESTDIR.
this replaces the previous change as that ended up adding
$DESTDIR/usr/lib to the runtime path of every binary created, which
is bogus and dangerous.


# 1.111 25-Mar-2000 mycroft

When linking with $DESTDIR, use an explicit -R to get library dependencies
correct.


# 1.110 07-Mar-2000 veego

Remove unused libahdi.
It will be replaced in the future with a more generic libdisklabel.


# 1.109 05-Feb-2000 jdc

Add libahdi entries.


# 1.108 23-Jan-2000 eeh

Add some support for FCode binaries.


# 1.107 22-Jan-2000 mycroft

Make `dependall' play nicely with SUBDIR, using a hack similar to `realinstall'
for both `depend' and `all'.
Also, remove the old hack that invokes an extra shell for .depend, now that
make(1) has been fixed.


# 1.106 16-Jan-2000 assar

all: depend on ${SCRIPTS} so that they get generated if they need to


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.105 23-Nov-1999 blymn

Added libmenu library.


Revision tags: comdex-fall-1999-base
# 1.104 14-Sep-1999 perry

branches: 1.104.4;
Add a "dependall" target, which does a "make depend" and then "make all"
in a single directory. This is useful in "make build" because by doing
the build immediately after the depend, all sources will typically
still be in the buffer cache, thus saving significant time over doing
a "make depend" on all the directories and then a "make all".


# 1.103 04-Sep-1999 fredb

Permit "make all install", as well as "make foo install" (where foo would be
installed by "make install") without setting of BUILD. All cases where BUILD
is already set are unchanged from the old behavior.

"make all install" is now practically equivalent to "make BUILD= all install",
but without actually setting build.

Fixes pr's 8313, 3894.


# 1.102 21-Aug-1999 simonb

Add ${INSTPRIV} to ${INSTALL} commands.


# 1.101 01-Jul-1999 itojun

branches: 1.101.2;
add LIBIPSEC for use from DPADD.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.100 12-Feb-1999 lukem

branches: 1.100.2;
* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.99 10-Feb-1999 tv

libbfd_pic.a is no longer installed; remove ${LIBBFD} define.


# 1.98 04-Feb-1999 christos

PR/2936: Brian C. Grayson: Avoid truncating precious files when installing
and the filesystem is full. Added ${RENAME} flag to install, which when set
to -r installs on a temporary file and then renames to the final destination.
${RENAME} is currently set to nothing in bsd.own.mk, but one can turn it
on in /etc/mk.conf.


# 1.97 07-Nov-1998 jonathan

Do DESTDIR support for crtbegin/crtend on all ELF ports (adds mips).


# 1.96 28-Sep-1998 christos

Use preserve flag in install.


# 1.95 10-Sep-1998 ross

Define a LIBBZ2?=... for use in DPADD=... lines.


# 1.94 09-Aug-1998 lukem

add distclean as a synonym for cleandir


# 1.93 09-Apr-1998 tv

.y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.


# 1.92 01-Apr-1998 tv

Revert. This broke too much in the build tree, and a better solution
needs to be created. (The existing situation breaks a lot too.)


# 1.91 01-Apr-1998 tv

Fix .y rules to DTRT with possibly generated .h files. See mail on
tech-toolchain for a very detailed explanation of this. In short, add
a .y.h rule identical to the .y.c rule and make the .y.c rule rename
the .h file; also, clean the .h file in CLEANFILES.


# 1.90 03-Nov-1997 cgd

echo the lint command line when making 'lint'.


# 1.89 28-Oct-1997 lukem

add ${LIBOBJC}


Revision tags: netbsd-1-3-base
# 1.88 11-Oct-1997 mycroft

branches: 1.88.2;
Several changes:
* Allow bsd.man.mk to be included separately.
* Always include bsd.own.mk and bsd.obj.mk.
* Include bsd.man.mk and bsd.nls.mk even if NOMAN or NONLS; just turn off
building of the affected files instead.
* Require bsd.subdir.mk to be included explicitly.
(Will make appropriate changes to Makefiles shortly.)


# 1.87 29-Sep-1997 gwr

Add $LIBBFD


# 1.86 31-May-1997 cjs

Back out BUILDDIR and NOINSTALL changes.


# 1.85 26-May-1997 cjs

branches: 1.85.2;
These updates to the build allow building against include files
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.


# 1.84 18-May-1997 kleink

Add libposix.


# 1.83 17-May-1997 mycroft

Do LINKS and SYMLINKS after FILES and INCS.


# 1.82 17-May-1997 mycroft

Remove unneeded .SUFFIXES lines, and move .s and .S closer to .o to give the
right preferences.


# 1.81 09-May-1997 mycroft

Fix typo in previous.


# 1.80 09-May-1997 mycroft

Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.79 09-May-1997 mycroft

Remove cruft.


# 1.78 09-May-1997 mycroft

Oops; rearrange dependencies to get things built early enough.


# 1.77 09-May-1997 mycroft

Make sure INCS and SRCS are built if necessary.


# 1.76 08-May-1997 gwr

Set the .NOPATH flag for ${OBJS} (from Christos).


# 1.75 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.74 07-May-1997 mycroft

Various simplifications.


# 1.73 07-May-1997 mycroft

Shuffle some .PHONYs around, to work better with `-t'.


# 1.72 06-May-1997 mycroft

Make most of the install targets .PRECIOUS.


# 1.71 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.70 18-Apr-1997 christos

Add ${LIBNTP}


# 1.69 17-Apr-1997 thorpej

- Properly depend on crtbegin.o and crtend.o for platforms that use
them (currently Alpha and PowerPC)
- STRIP -> STRIPFLAG


# 1.68 03-Apr-1997 mikel

don't allow override of all: target


# 1.67 29-Mar-1997 mikel

merge lite-2 changes (mostly SCCSids)


# 1.66 27-Mar-1997 christos

Put the FILES generated rules in a separate .mk file since both bsd.prog.mk
and bsd.lib.mk use them.


# 1.65 27-Mar-1997 mycroft

Make the SCRIPTS case mimic the FILES case more closely, so we can override
the destination direectory, etc.


# 1.64 27-Mar-1997 mycroft

Remove knowledge of HIDEGAME from here.


# 1.63 24-Mar-1997 christos

make rules update:
- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation


# 1.62 22-Mar-1997 perry

Fix SYMLINKS not to include DESTDIR in the link itself


# 1.61 13-Mar-1997 perry

add SYMLINKS, by analogy to LINKS. Vetted by Christos.


# 1.60 22-Jan-1997 cgd

if 'clean' is not already defined, rather than simply defining it with
a bunch of rules, define a clean{kmod,lib,prog} target with the rules,
and have both clean and cleandir depend on that. That eliminates a bug
where 'cleandir' in a directory which included e.g. bsd.prog.mk but which
also had subdirs would 'make clean' all the subdirs and then 'make cleandir'
all ofthe subdirs. It also allows Makefiles to add more dependencies
to 'clean' after inclusion of the make template.

If 'clean' is already defined, the behaviour is the same as it used to be.


# 1.59 20-Dec-1996 cgd

add an afterdepend target (a la the one in bsd.lib.mk) that processes
the .depend file to add <filename>.ln for each <filename>.o as an
object file which has the given dependencies (in addition to
<filename>.po and <filename>.so, which were already there).


# 1.58 13-Dec-1996 mikel

add missing LIBPCAP definition.


# 1.57 26-Nov-1996 mrg

add libz and libwrap


# 1.56 18-Oct-1996 thorpej

Use ${INSTALL} rather than "install".
From Simon J. Gerraty <sjg@zen.void.oz.au>, PR #1458.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.55 08-Apr-1996 jtc

Sort LIBFOO definitions and add LIBY; Reported by Mike Long <mike.long@analog.com> in PR #2301.


# 1.54 22-Oct-1995 christos

Added include file <bsd.sys.mk> that contains lex and yacc "parallel aware"
rules. These rules are not turned on by default; they are enabled by setting
the PARALLEL variable.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.53 25-Jun-1995 cgd

oops; fix an rm that might be empty


# 1.52 24-Jun-1995 cgd

update lint rules, but keep linting disabled


# 1.51 10-Jun-1995 mycroft

Define LIBEDIT.


# 1.50 21-Apr-1995 jtc

.include <bsd.nls.mk> unless NONLS is defined.


# 1.49 22-Dec-1994 cgd

specify man pages differently, and document how.


# 1.48 24-Aug-1994 mycroft

Include bsd.own.mk earlier.


# 1.47 20-Jul-1994 cgd

fix from christos, for progs w/o objects


Revision tags: netbsd-1-0-base
# 1.46 06-Jul-1994 mycroft

branches: 1.46.2;
Pull libraries from ${DESTDIR} if set. Kill LDONLY, which is unused and
probably not useful anyway.


# 1.45 30-Jun-1994 cgd

fix modify-info-nothingness-then-substitute probelm that broke genclass build


# 1.44 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.43 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.42 28-Jun-1994 jtc

Strip *.sh when constructing OBJS from SRCS.
This will allow us to clean up makefiles that build a script by munging
a template (uusched, genclass, neqn, etc.).


# 1.41 18-Jun-1994 cgd

don't chown the symlink, when HIDEGAME causes a symlink to be made to dm.
4.4-based FS code _follows_ the symlinks on a chown(2) call.


# 1.40 24-May-1994 cgd

fix the last to do the right thing for dependencies


# 1.39 24-May-1994 deraadt

LIBSKEY


# 1.38 22-May-1994 jtc

Single source file programs are now compiled into object files before they
are linked. This change halves the time it takes to rebuild all of the
NetBSD sources when only the C library is "touched"; but only takes about
one percent more disk space.


# 1.37 06-Apr-1994 chopps

relink (recompile) single source programs when crt0.o is updated.


# 1.36 24-Mar-1994 mycroft

Remove *.core on clean.


# 1.35 09-Feb-1994 cgd

kill install -d's.


# 1.34 28-Jan-1994 cgd

add LIBKVM


# 1.33 10-Nov-1993 cgd

librpc doesn't exist anymore


# 1.32 08-Nov-1993 cgd

ad LDSTATIC flag, so static linking can be made one-stop shopping.
use "setenv LDSTATIC" to make *everything* dynamically linked,
setenv LDSTATIC -static for everything statically linked, or unset
it for default behavior.


# 1.31 07-Oct-1993 cgd

LIBTERM pointed at nothing, but was meant to point to libtermcap.a...


# 1.30 07-Oct-1993 cgd

always define LIBCRYPT


# 1.29 17-Aug-1993 mycroft

Make sure we don't recurse into subdirectories if Makefile specified `install'
target. (It's usually blank and is specifically to avoid doing this...)


# 1.28 15-Aug-1993 mycroft

Automatically include bsd.subdir.mk for backward compatibility.


# 1.27 15-Aug-1993 mycroft

Don't automatically include bsd.subdir.mk in bsd.prog.mk and bsd.lib.mk.
Put back .MAIN in bsd.man.mk, and be careful not to include ../Makefile.inc
a second time.


# 1.26 15-Aug-1993 mycroft

Move man rules to sys.mk.
Use bsd.subdir.mk for building subdirectories.
Don't forget to remove x.cc and x.C when using SHAREDSTRINGS.
Make ${PROG} always depend on ${LIBCRT0}.
Don't duplicate code between cleandir and clean.
Move tags target to bsd.dep.mk.
Move STRIP to bsd.own.mk.
Remove redundant definitions of {BIN,MAN}{DIR,GRP,OWN,MODE}.
Move {LIB,DOC}{DIR,GRP,OWN,MODE} defaults to bsd.own.mk.


# 1.25 15-Aug-1993 mycroft

Abstract out dependency stuff, and add RCS identifiers.


# 1.24 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


# 1.23 10-Aug-1993 mycroft

Put LINKS handling in `install' target, so it's the last thing executed, and
happens even if `realinstall' is user-defined.


# 1.22 30-Jul-1993 mycroft

When generating a default OBJS, ignore .h files.


# 1.21 29-Jul-1993 mycroft

Don't print the `making ...' message if an obj dir already exists.
Also, a minor cleanup.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.20 17-Jul-1993 mycroft

Fix C++ dependencies for good. `make depend' is now done in two passes--one
of C files and one for C++ files. No need to specify `-+' in your Makefile,
as it is now done automatically.


# 1.19 17-Jul-1993 cgd

do c++ dependencies the right way...


# 1.18 17-Jul-1993 mycroft

Add suffix rules for C++ files.


# 1.17 04-Jun-1993 brezak

Add LIBRPCSVC variable.


# 1.16 02-Jun-1993 cgd

add ability to specify c++ dependencies, by setting CFLAGS+=-+ for
the dependency make.


# 1.15 26-Apr-1993 cgd

added definition for DPADD library variable LIBCRYPT.


# 1.14 26-Apr-1993 mycroft

Don't redefine `realinstall' target if already defined.


# 1.13 25-Apr-1993 mycroft

Link with LDFLAGS even if one source module.


# 1.12 25-Apr-1993 mycroft

Don't lose if we include bsd.prog.mk only to build man pages.


# 1.11 25-Apr-1993 mycroft

Fix error in last change. (Oops.)


# 1.10 25-Apr-1993 mycroft

Don't build man pages if NOMAN set.


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.9 09-Apr-1993 cgd

various changes to default make rules. from patch 101.
note that only the "sensible" changes in patch 101 are implemented.


# 1.8 08-Apr-1993 cgd

try to do the right thing, in terms making directories before we
install into them, and get the manpage cleans _OUT_ of "clean".
they don't belong there, only in cleandir, WFJ be damned.


# 1.7 08-Apr-1993 cgd

fixed typos...


# 1.6 08-Apr-1993 cgd

(silently) make sure we have directories before installing


# 1.5 04-Apr-1993 cgd

make LIBRPC point to the right place


# 1.4 27-Mar-1993 nate

Fixed the doc macros to call troff, eqn,and tbl instead of ditroff,
deqn, and dtbl.
Fixed make clean to remove the man pages (Bill fixed this in the distribution,
but not in the original source)
Changed install to leave the original file around, by using 'cp' instead of
'mv'. "install -c ..."


# 1.3 23-Mar-1993 cgd

made .CURDIR be absolute, not relative, thereby eliminating
the need for some of the makefile trickery when making objects,
and fixing a few .PATH bugs


# 1.2 22-Mar-1993 cgd

fixed "make obj" for cases when sources not in /usr/src/...
if sources not there, it now mkdirs obj, but some trickery
is necessary, to avoid deleting cwd.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


Revision tags: pgoyette-localcount-20161104 localcount-20160914
# 1.300 20-Aug-2016 christos

unbound additions


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.299 04-Apr-2016 joerg

If the per-target LDSTATIC flag is set, don't include the PIE linker
flags as we currently don't support static PIE.


# 1.298 30-Mar-2016 martin

Pass -pie to cc, not -Wl,-pie. This way we have a chance to fix specs
for obscure corner cases like -pie -fPIE -static (used for
/usr/tests/lib/csu/h_initfini2 if building with MKPIE=yes).
While there also replace -fPIC with -fPIE for the PIE case, even if
it should be mostly equivalent.


# 1.297 12-Mar-2016 mrg

remove conditionals that are always true with GCC >= 4.8.


# 1.296 21-Feb-2016 christos

Add NODEBUG


# 1.295 31-Jan-2016 christos

Introduce NOPIE and NOCTF so that standalone programs build properly.


# 1.294 23-Jan-2016 christos

Define _KERNTYPES for things that need it.


# 1.293 07-Nov-2015 joerg

LIBEXECINFO


# 1.292 07-Jun-2015 matt

Make LIBCRT* depend on the right files if MLIBDIR from MKCOMPAT is defined.


# 1.291 01-Dec-2014 erh

PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilt
if any of their dependencies (i.e. the files they refer to) are changed.
This allows changes to transitive included headers to be handled properly.


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.290 25-Mar-2014 ozaki-r

branches: 1.290.4;
Add MKCTF

This variable separates CTF stuffs from MKDTRACE; we can build DTrace
solely without building and using them. This allows us to use DTrace
even if CTF stuffs have problems (actually they have now).

This variable would be merged into MKDTRACE eventually, once CTF stuffs
work correctly again.


Revision tags: riastradh-drm2-base3
# 1.289 09-Mar-2014 christos

let's see if the new dwarf library can handle dwarf 4


# 1.288 02-Mar-2014 christos

If we are compiling with -g and using gcc4.8 and dtrace downgrade
dwarf generation to version 2 for now.


# 1.287 15-Jan-2014 joerg

-Wl,-pie and -r don't agree with each other, so filter the former out.


# 1.286 11-Nov-2013 joerg

Relink binaries if crti.o changes.


# 1.285 29-Sep-2013 christos

Add libxcb


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.284 31-May-2013 mrg

add LIBX11_XCB; unfortunately since the library is named with a -
in it, we have to use an ugly hard coded assignment for now.
(could be cleaned up with more make variable magic i'm sure.)


# 1.283 04-Apr-2013 christos

ldopts should be before ldadd like everywhere else.


Revision tags: agc-symver-base
# 1.282 14-Feb-2013 christos

Since the libraries are produced with different MK flags than the programs,
we check for existance of the files instead of the MK flags.


# 1.281 14-Feb-2013 christos

Add PROGDPLIBS


# 1.280 26-Jan-2013 christos

CTFCONVERT me harder.


Revision tags: yamt-pagecache-base8
# 1.279 17-Jan-2013 christos

Now that we have separate debug sets, add -g if ${MKDEBUG} is set for
program builds since we don't need to install that symbol files.


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.278 24-Aug-2012 jmmv

branches: 1.278.2;
Allow DPADD to be specified on a per-program basis.


# 1.277 23-Aug-2012 joerg

Revert last, it breaks the tricks xsrc uses.


# 1.276 23-Aug-2012 joerg

Remove SHLIBINSTALLDIR and SHLINKINSTALLLIBDIR. Add rpath entries, if
SHLIBDIR differs from /usr/lib.


# 1.275 08-Aug-2012 christos

add MKRUMP by popular demand.


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4
# 1.274 29-Feb-2012 tron

Move "libexpat" from X11 into base which fixes PR lib/40346.
This change was approved by the Core Group.


# 1.273 21-Feb-2012 matt

Remove another ${SIZE}


# 1.272 20-Feb-2012 matt

Remove ${SIZE}


# 1.271 19-Feb-2012 matt

Add support for --combine with gcc.


Revision tags: netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2
# 1.270 05-Nov-2011 christos

branches: 1.270.2;
Add libtre


Revision tags: yamt-pagecache-base
# 1.269 16-Oct-2011 christos

branches: 1.269.2;
- no need to special-case libraries with weird characters.
- add a note about adding new libraries.


# 1.268 16-Oct-2011 christos

fix list of libraries to reflect reality.


# 1.267 10-Sep-2011 apb

Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.


# 1.266 27-Aug-2011 joerg

Add new "analyze" command to run clang's static analyzer in a directory
on all C/C++ files.


Revision tags: cherry-xenmp-base
# 1.265 26-Apr-2011 he

The new Heimdal adds -lwind and -lheimbase to the set of libraries,
so define the corresponding LIB* variables.
These are also needed in the PAM_STATIC_* variables, so add them there too.


# 1.264 11-Apr-2011 joerg

Adjust --sysroot related usage:
-Wl,-rpath does not expand =, so just drop it.

Drop -Wl,-rpath-link entries that duplicate the -Wl,-rpath entries, this
is done implicitly now that ld is built with sysroot support.

Use ${DESTDIR} explicitly for the remaining -Wl,-rpath-link entries.


# 1.263 10-Apr-2011 joerg

For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.


# 1.262 08-Mar-2011 jmmv

Revert previous (revision 1.261): it broke the build because PROG_CXX is
defined in terms of PROG, so later on we would end up with target duplicates
because both PROG_CXX and PROG were being converted to PROGS_CXX and PROGS.

Did not catch this earlier because the test build I did was not clean and
thus the duplicate targets did not have nasty effects.


# 1.261 07-Mar-2011 jmmv

Always convert PROG to its plural form independently of whether PROG_CXX
is defined or not. From Garrett Cooper in private mail.


Revision tags: bouyer-quota2-nbase
# 1.260 20-Feb-2011 jmmv

Define LIBATF_C and LIBATF_CXX to point to their corresponding .a files and
use these to properly set DPADD for test programs.


Revision tags: bouyer-quota2-base
# 1.259 13-Feb-2011 christos

add saslc


# 1.258 06-Feb-2011 joerg

Don't use -nostdinc or -nostdinc++ if this is included in a HOSTLIB.


# 1.257 17-Jan-2011 pooka

branches: 1.257.2;
Add rump bits to DPSRCS so that update builds work correctly.


Revision tags: matt-mips64-premerge-20101231
# 1.256 13-Dec-2010 pooka

befriend RUMPPRG with CRUNCHEDPRG


# 1.255 13-Dec-2010 pooka

Define RUMPPRG, which is just like PROG, except it additionally
builds a rump client with the name rump.${PROG}. The rump client
is not installed suid/sgid by default even if BINMODE is defined.


# 1.254 10-Dec-2010 joerg

Revert last, gcc(1) checks explicitly for -r on some platforms to disable
passing down --relax as well.


# 1.253 08-Dec-2010 joerg

gcc passes down -r directly to ld, so make it explicitly a linker option.


# 1.252 08-Dec-2010 joerg

Don't depend on ${CC} passing down -R to ld, use -Wl,-rpath explicitly.


# 1.251 08-Nov-2010 lukem

Preserve date on original shared library or program when stripping
the debug symbols and adding the debug-link to .debug.
Use '(rm -f file; false)' in the failure path to force failure.
Based on solution proposed by Nicolas Joly on tech-toolchain in July 2010.
Should fix PR toolchain/44046 from Andreas Gustafsson.


# 1.250 31-Oct-2010 mbalmer

Link Lua to the build and add the resulting files to the distribution sets.
Document the addition of Lua and the change we made to the default settings.


# 1.249 06-Jul-2010 mrg

remove almost all the ability to build netbsd with an a.out target.
we're ELF now, and there are many missing checks against OBJECT_FMT.
if we ever consider switching, the we can figure out what new ones
we need but for now it's just clutter.

this doesn't remove any of the support for exec_aout or any actually
required-for-boot a.out support, only the ability to build a netbsd
release in a.out format. ie, most of this code has been dead for
over a decade.

i've tested builds on vax, amd64, i386, mac68k, macppc, sparc, atari,
amiga, shark, cats, dreamcast, landisk, mmeye and x68k. this covers
the 5 MACHINE_ARCH's affected, and all the other arch code touched.
it also includes some actual run-time testing of sparc, i386 and
shark, and i performed binary comparison upon amiga and x68k as well.


some minor details relevant:
- move shlib.[ch] from ld.aout_so into ldconfig proper, and cut them
down to only the parts ldconfig needs
- remove various unused source files
- switch amiga bootblocks to using elf2bb.h instead of aout2bb.h


# 1.248 24-Apr-2010 lukem

When extracting separate debug symbols with MKDEBUG, there's no need
to leave the original file unstripped...


# 1.247 02-Mar-2010 darran

DTrace: Add CTF generation to the make framework. Only enabled when
MKDTRACE=yes.


# 1.246 14-Dec-2009 mrg

use "${CC} -r" not "${CC} -Wl,-r" as the latter fools GCC on some targets
and it ends up passing "-r -relax" to ld, which causes ld to barf.


# 1.245 14-Dec-2009 matt

Merge from matt-nb5-mips64


Revision tags: matt-premerge-20091211
# 1.244 08-Dec-2009 uebayasi

When PROGS / LIBS are used, you can pass each PROG / LIB specific parameters
to ${LD} via:

${LDADD.${PROG}}
${LDFLAGS.${PROG}}
${LDSTATIC.${PROG}}
${LDADD.${LIB}}
${LDFLAGS.${LIB}}

OTOH you can't pass parameters to ${CC}, because in suffix rules make(1) only
knows the name of ${.IMPSRC} and ${.TARGET}; it's users' responsivility to
define ${CC} parameters to all the sources of a given ${PROG} / ${LIB}.

Should address bin/42381.

(Bug in this commit log was pointed out by mrg@.)


# 1.243 27-Nov-2009 tsutsui

If CPPFLAGS or CXXFLAGS already contains -nostdinc or -nostdinc++,
don't add ${CPPFLAGS_ISYSTEM} or ${CPPFLAGS_ISYSTEMXX} to refer
${DESTDIR}/usr/include or ${DESTDIR}/usr/include/g++.

This change might cause errors on some MD stand dir, but in that case
each Makefile should be fixed to search proper system include paths
by -Ipath option in own CPPFLAGS.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.242 12-May-2009 plunky

remove libsdp as improved functionality has been enabled in libbluetooth.


# 1.241 10-Apr-2009 apb

Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links. They have no effect except when using a
metalog, in which case the information is added to the metalog. In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.

Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.

Reviewed by perry and joerg. This should fix PR 24457 and PR 41155.


# 1.240 24-Nov-2008 cube

branches: 1.240.2;
Move cleanextra to the very ends in case another included file wants to add
to it even if it was initially empty.


Revision tags: netbsd-5-base matt-mips64-base2
# 1.239 19-Oct-2008 christos

branches: 1.239.2;
handle assembly files for MKPIE


# 1.238 16-Oct-2008 christos

Provide a way for a program to override the PIE flags.


# 1.237 15-Oct-2008 christos

don't compile/link libraries with pie


Revision tags: mjf-devfs2-base
# 1.236 02-Oct-2008 joerg

Hook up libfetch and pkg_install update.


Revision tags: wrstuden-revivesa-base-3
# 1.235 09-Sep-2008 joerg

Add MKSTRIPIDENT to remove the RCS IDs from binary programs and shared
libraries for space-constraint systems. The description is based on the
feedback of hubertf@, the logic on input from lukem@

This obsoletes the removal of LIBC_SCCS and SYSLIBC_SCCS for libc builds.


Revision tags: wrstuden-revivesa-base-2
# 1.234 28-Aug-2008 mrg

update a comment example


# 1.233 27-Aug-2008 rtr

use ${X11USRLIBDIR} instead of hard-coded /usr/X11R6/lib when building
${LIB.foo} vars


# 1.232 27-Aug-2008 lukem

Fix problem I introduced in rev 1.231 on 2008/08/25 where ${_PROGLDOPTS}
and -L${_GCC_LIBGCCDIR} were appearing in the link line before ${LDADD},
so -L${DESTDIR}/lib and -L${DESTDIR}/usr/lib were being used before
local -L library paths.
Fixes ntpd/ntpdate failure noticed by Valeriy E. Ushakov <uwe@NetBSD.org>


# 1.231 25-Aug-2008 lukem

Always link with: -Wl,-rpath-link,${DESTDIR}/usr/lib -L${DESTDIR}/usr/lib
Fixes problem with MKDYNAMICROOT=no triggered by libraries that depend
on other libraries.
Related to PR 33503.

Clean up setting of _CCLINK to always add the appropriate -B options.

Simplify the link rule for a program.


# 1.230 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.229 28-May-2008 lukem

add LIBLDAR_R (for completeness)


# 1.228 22-May-2008 lukem

Add MKLDAP, USE_LDAP, LIBLBER, LIBLDAP


Revision tags: hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 yamt-pf42-base
# 1.227 10-Apr-2008 tsutsui

branches: 1.227.2; 1.227.4;
Add libhx509 to PAM_STATIC_LDADD which is required by libkrb5.


# 1.226 22-Mar-2008 mlelstv

branches: 1.226.2;
Import Heimdal-1.1


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base pc532-eol-2008 matt-armv6-nbase matt-armv6-base hpcarm-cleanup-base
# 1.225 26-Dec-2007 jmmv

Make the clean target work when OBJS is set but PROG is not, as happens
for example in gnu/lib/crtstuff4. Reported by drochner@.


Revision tags: cube-autoconf-base
# 1.224 13-Nov-2007 jmmv

Fix typo that prevented MKDEBUG builds to work. Found by drochner@.


# 1.223 12-Nov-2007 jmmv

Add the ability to build multiple programs from a single directory

This adds support for a new set of variables, PROGS and PROGS_CXX, that
allow the developer to build multiple different programs from a single
source directory.


# 1.222 04-Nov-2007 tls

Remove MKPRIVATELIB from BIND libraries; move library reachover
directories and Makefiles from src/usr.sbin/bind to src/lib; make
BIND libraries build shared. Saves about 1MB-1.5MB per installed
executable, about 5MB for a base+etc minimal installation of NetBSD.


Revision tags: matt-mips64-base
# 1.221 29-Jul-2007 joerg

branches: 1.221.4; 1.221.6;
Add build glue for libarchive and update the various sets.


# 1.220 25-Jan-2007 perry

Before I completely forget the issue, convert "PROG_PAX" to the
better-named "PAXCTL_FLAGS".


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.219 11-Nov-2006 christos

don't run paxctl if other commands were specified for that target.


# 1.218 10-Nov-2006 christos

if ${PROG_PAX} is defined, run paxctl on the binary after linking with
the value of the variable. This way, if you set:

PROG_PAX=+M

in /etc/mk.conf, you get what you deserve.


# 1.217 22-Oct-2006 pooka

libpuffs


# 1.216 09-Oct-2006 mrg

- clean up some comments to reality.
- retire LIBDCK, LIBG2C and (long broken) USE_LIBSTDCXX
- in bsd.hostprog.mk's LIBSTDCPP -> LIBSTDCC
- add LIBSUPCXX
- don't default USE_LIBSTDCXX or USE_GCC4 since they are
not used in the tree any where
- same with USE_XF86_4; retire it
- remove _SUPCXX handling in bsd.prog.mk

inspired by PR#26714.


Revision tags: abandoned-netbsd-4-base
# 1.215 23-Jul-2006 lukem

Implement MKDEBUG:
If "no", don't build and install separate debugging symbols
into /usr/libdata/debug.
Default: no


# 1.214 19-Jun-2006 gdamore

Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.


# 1.213 09-Jun-2006 christos

PR/33681: Scott Ellis: Building 'bc' with SHAREDSTRINGS=yes fails
We need CPPFLAGS too now.


# 1.212 11-May-2006 mrg

add support for ${OBJCOPTS} and ${OBJCOPTS}.<lib|prog|fn>.


# 1.211 20-Mar-2006 christos

There is always one more KRB4 thing to remove. (from Jukka Salmi)


# 1.210 20-Mar-2006 christos

Remove krb4 variables and libraries (Jukka Salmi)


# 1.209 16-Mar-2006 jwise

Now that we have real build system support for syspkgs, remove someone's
half-implemented idea of building `syspkgs' (really a few giant blobs of the
same granularity of the old sets) using install(1).


# 1.208 20-Jan-2006 christos

Add the world of libraries to the static pam build. Now static pam binaries
work.


# 1.207 09-Apr-2005 dsl

Report when we link a program into xxx.ro (before being crunched)


Revision tags: netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.206 04-Mar-2005 he

branches: 1.206.2; 1.206.4;
Introduce PAM_STATIC_LDADD and PAM_STATIC_DPADD. When compiling
with MKPIC=no, possibly because the target does not support shared
libraries, these include libraries required to resolve all symbols
which end up referenced from PAM-using applications. The libraries
presently required are -lcrypt, -lrpcsvc and -lutil.

Add use of these variables which are currently set up to use PAM,
so that they compile when MKPIC=no.

Also, in the telnetd case, reorder the order of the libraries, so
that libtelnet.a comes before -ltermcap and -lutil, again to fix
link error when MKPIC=no.

Discussed with thorpej and christos.


# 1.205 20-Feb-2005 christos

Add libradius


# 1.204 12-Jan-2005 lukem

If RESCUEDIR is defined, automatically add that to CPPFLAGS


# 1.203 08-Jan-2005 lukem

Implement <bsd.prog.mk> vars:
LIBASN1 LIBBSDMALLOC LIBG2C LIBPAM LIBSSH


# 1.202 04-Aug-2004 lukem

Revert most of previous, and move the LIB<libname>?= assignments
back to bsd.prog.mk from bsd.own.mk.

pkgsrc uses <bsd.own.mk>, and setting LIB<libname> in it causes
problems with various package builds.
This should fix PR #26542 submitted by Jim Bernard.

(I'll be implementing the DPADD for shared libraries in a different
manner that generally won't depend upon ${LIB<libname>}.)


# 1.201 30-Jul-2004 lukem

Move the LIB<libname>?= assignments from bsd.prog.mk to bsd.own.mk so
that they may be used by non PROGs (e.g., LIBs).

Improve some comments.


# 1.200 10-Jun-2004 lukem

Be consistent in handling YHEADER, similar to Christos' fix in bsd.lib.mk 1.253


# 1.199 21-May-2004 ross

If you add a library, you need to define its DPADD symbol here.

Add LIBMAGIC.


Revision tags: netbsd-2-0-base
# 1.198 15-Feb-2004 skrll

branches: 1.198.2;
Be more gcc like in the way we deal with libgcc so that sh3/hppa millicode
and exception handling have a chance of working properly.

- creates libgcc, libgcc_eh and libgcc_s

- updates LIBGCC_SPEC to use them appropriately.

There's a hack in here at the moment with respect to libgcc_so in that it
is preferable to link against libgcc_so will only when -shared-libgcc is
specified (the c++ frontend does this automatically.) Configurations where
LINK_EH_SPEC is defined already do this. The gcc configuration for
NetBSD/alpha and another NetBSD platform (I forget which) actually define
LINK_EH_SPEC probably by accident rather than design.

- updates share/mk to use the compiler's knowledge of what needs linking into
libraries and executables. This removes an hppa hack.

- updates the sets for the newly created libgcc* files.

- support for linking against the _pg version of libgcc has been removed.


# 1.197 29-Jan-2004 lukem

Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.


# 1.196 27-Jan-2004 lukem

Replace
:M-[IDU]*
with
:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)


# 1.195 23-Jan-2004 simonb

crt0.o lives in /usr/lib even on a.out.


# 1.194 16-Nov-2003 lukem

simplify with _MKTARGET_LINK


# 1.193 11-Nov-2003 dsl

Set MKDEP_SUFFIXES to get additional targets in .depend instead of using
sed in .afterdepend. I don't think .afterdepend is used anywhere any more.


# 1.192 21-Oct-2003 lukem

Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.


# 1.191 19-Oct-2003 lukem

Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} " ... {$.TARGET}" and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO


# 1.190 18-Oct-2003 lukem

Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command ("verbose")
This is the default, and is equivalent to the previous behaviour.


# 1.189 29-Sep-2003 lukem

Add LIBSTDCXX (for usr/lib/libstdc++.a).
Sync LIB* documentation with reality.


# 1.188 19-Sep-2003 martin

Drop explicit medlow model and default to -O2 for sparc64.


# 1.187 14-Sep-2003 lukem

Check ${SHLIBDIR} against "/usr/lib" instead of ${LIBDIR} when determining
if we need to add stuff (usually "/lib") to the rpath-link path before
"/usr/lib". Otherwise, this barfs if LIBDIR != /usr/lib or /lib, and
we're cross-building (e.g., in src/x11)


# 1.186 13-Sep-2003 erh

Also support per-program LDFLAGS and LDSTATIC.


# 1.185 13-Sep-2003 erh

Create a way to add additional flags to COPTS, CPPFLAGS, CXXFLAGS and LDADD
for particular libraries or programs by specifying the additions in mk.conf
instead of needing to go edit individual Makefiles.


# 1.184 12-Sep-2003 lukem

add infrastructure to support reach-over builds of xsrc


# 1.183 22-Aug-2003 dsl

Add a ${PROG}.ro target that does an 'ld -r' of the program object files.
Allows a much simplified build of 'crunched' binaries since crunchgen can
build prog.ro instead of having to deretmine the names of all the .o files.


# 1.182 01-Aug-2003 lukem

Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".


# 1.181 01-Aug-2003 lukem

simplify the ${PROG}: target to reduce duplication between the DESTDIR
and !DESTDIR cases...


# 1.180 31-Jul-2003 lukem

bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.


# 1.179 31-Jul-2003 lukem

Don't need -R/usr/lib; it will be searched at the end by ld.elf_so anyway.
Noted by matt green <mrg@>


# 1.178 28-Jul-2003 lukem

be consistent when adding *.y and *.l to DPSRCS


# 1.177 28-Jul-2003 lukem

replace MKCXXSUPCXX(!=no) with USE_LIBSTDCXX(==no)


# 1.176 28-Jul-2003 lukem

Change defined(CXX_SUPCXX) to MKCXXSUPCXX != "no".

Clarify that command-line overrides of the MKxxx variables should be
done via the environment rather than make(1) command-line variable
assignment, since the latter doesn't actually work as intended.


# 1.175 27-Jul-2003 mrg

introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes. for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)


# 1.174 26-Jul-2003 mrg

add a new bsd.own.mk variable: CXX_SUPCXX. from bsd.README:
+ CXX_SUPCXX If defined, the support libraries needed for this C++ program
+ are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.


# 1.173 20-Jul-2003 lukem

Consistently support the different C++ file extensions: .cc .cpp .cxx .C
Noted by Andrew White in PR toolchain/18246


# 1.172 18-Jul-2003 lukem

Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was defined.
Replace defined(UNPRIVED) tests with ${MKUNPRIVED} != "no"

Add MKUPDATE; if not no has the same semantics as if UPDATE was defined.
Replace defined(UPDATE) tests with ${MKUPDATE} != "no"

Improve documentation for these and other make flags.


# 1.171 16-Jul-2003 itojun

stop installing install libtelnet. build under lib/libtelnet and reference
it from usr.bin/telnet and libexec/telnetd.
(reason for separate build: compiler flags)


# 1.170 27-Jun-2003 drochner

For consistency, use "-R" instead of "-Wl,-rpath" to pass
a runtime search path to the linker.


# 1.169 13-Jun-2003 itojun

define LIBEVENT


# 1.168 11-Jun-2003 msaitoh

catch signal 1,2,3,13 and 15 to clean /tmp/_dependXXX


# 1.167 31-May-2003 thorpej

If EXTERNAL_TOOLCHAIN is defined, allow the compiler to define the
location of crt{begin,end}{,S}.o and libgcc.a. Encapsulate all of
this logic into the new bsd.gcc.mk, and use it in bsd.prog.mk and
bsd.lib.mk.


# 1.166 18-May-2003 lukem

make this a no-op if HOSTPROG is defined


# 1.165 30-Mar-2003 thorpej

If MACHINE_ARCH is powerpc and we HAVE_GCC3, add crtsaveres.o to the
endfile spec.


# 1.164 22-Feb-2003 uwe

Typo in comment.


# 1.163 24-Jan-2003 thorpej

Add LIBPTHREAD, LIBPTHREAD_DB, and LIBRT.


Revision tags: fvdl_fs64_base
# 1.162 22-Nov-2002 thorpej

Split crtbegin/crtend into crti/crtbegin/crtend/crtn. NetBSD-specific
things like the .note.netbsd.ident section are provided by crti/crtn.
crti/crtn also provide the _init() and _fini() routines.

crtbegin/crtend now only provide support for ctors/dtors. This paves
the way to using the "crtstuff" provided with GCC (when we upgrade to
GCC 3.3), which provides, among other things, much better C++/Java
exception handling.


# 1.161 12-Nov-2002 itohy

MKDYNAMICROOT for a.out


# 1.160 22-Oct-2002 perry

Pass 1 of SYSPKG changes to automatically add tags=pkgname_pkg to METALOG.
Not quite ready for prime time yet.


# 1.159 27-Sep-2002 thorpej

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.


# 1.158 26-Sep-2002 itojun

MDC2 is a patented algorithm; don't ship it in default libcrypto.
MKCRYPTO_MDC2 will build a separate library, libcrypto_mdc2.


# 1.157 08-Sep-2002 thorpej

Build a .gdbinit in the objdir when building a program. The .gdbinit
file sets the shared library prefix to ${DESTDIR}, and adds "sources"
directives for each file listed in the GDBINIT Makefile variable.


# 1.156 09-Aug-2002 thorpej

Add LIBPMC.


Revision tags: netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.155 27-Mar-2002 eeh

branches: 1.155.2;
Use the medium low model for sparc64 programs that don't 2GB of data segment.


# 1.154 11-Feb-2002 mycroft

Don't use .PHONY for targets that are actually installed. Instead use force
dependencies. (Among other things, `make -t install' does something vaguely
sensible now.)


# 1.153 07-Feb-2002 pk

Mark installed system libraries as .MADE only if we're actually establishing
their default variable values here.


# 1.152 04-Feb-2002 christos

s/.NOSUFF/.MADE/


# 1.151 03-Feb-2002 christos

Apply a .NOSUFF: directive to targets we don't want to have processed by
the suffix rules engine.


# 1.150 02-Feb-2002 veego

Ups, it is LIBUSBHID and not LIBUSBHIB.


# 1.149 02-Feb-2002 veego

Change LIBUSB to LIBUSBHIB, reflecting the library name change.


# 1.148 29-Jan-2002 enami

Mark the targets clean{extra,objs} as PHONY.


# 1.147 04-Jan-2002 thorpej

For PROG_CXX DESTDIR builds, pull in -lstdc++ and -lm regardless
of GCC version.


# 1.146 01-Jan-2002 thorpej

Per a suggestion from matthew green, PROG_CXX takes the place of
PROG for C++ programs.


# 1.145 01-Jan-2002 thorpej

* If PROG_CXX is set by the program's Makefile, use ${CXX} to link
the program rather than ${CC}.
* If HAVE_GCC3 is defined, pull in "-lstdc++ -lm" as additional C++
support libraries for DESTDIR builds.


# 1.144 28-Dec-2001 lukem

* 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


# 1.143 28-Nov-2001 tv

If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.


# 1.142 19-Nov-2001 thorpej

Use a little transitional hack to determine if we use -isystem
or -idirafter. Use the former only of USE_NEW_TOOLCHAIN, since
-isystem causes the old toolchain to bomb out when building
libstdc++.


# 1.141 14-Nov-2001 tv

C/..$/.c/ -> C/\..$/.c/


# 1.140 14-Nov-2001 tv

Move the DESTDIR-based nostdinc logic to bsd.lib.mk and bsd.prog.mk where
it belongs (with the native target compile rules).


# 1.139 02-Nov-2001 tv

Use INSTALL_FILE/INSTALL_DIR as appropriate.


# 1.138 02-Nov-2001 tv

Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.


# 1.137 19-Oct-2001 tv

Add .NOPATH for all files generated from .l or .y files in SRCS. Fixes PRs
bin/14187 and lib/14239.

Also simplify the handling of these transforms to .c and .h files a bit by
leveraging make's builtin macro operators.


# 1.136 25-Sep-2001 tv

Set .NOPATH on program to build to make sure it goes in .OBJDIR.
Problem noted by <seebs@plethora.net>.


# 1.135 24-Sep-2001 lukem

fix previous (hi thor!) - $OBJS and $CLEANFILES might be empty, and
rm needs some files to delete...


# 1.134 24-Sep-2001 tls

Split "cleanprog" target apart: now you can zap only object files or
CLEANFILES (needed to fix crunchgen lossage).


# 1.133 13-Sep-2001 thorpej

Add LIBPCI.


# 1.132 14-Aug-2001 tv

Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").


# 1.131 01-Jun-2001 tv

Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).


# 1.130 08-May-2001 sommerfeld

Suppress duplicate entries in ALLFILES, FILES, INCS, DEPINCS, INFOFILES,
NLSALL, CATPAGES, MANPAGES, HTMLPAGES, and SCRIPTS.


# 1.129 19-Feb-2001 jmc

Wrap target() checks around afterdepend rule as some Makefiles override this


# 1.128 26-Jan-2001 itojun

fix typo in LIBSSL decl. it made programs with DPADD+=${LIBSSL} to build
every time we type "make". From: bernd


# 1.127 14-Jan-2001 christos

use the new .if commands(<target>) directive so that we don't have to
change Makefiles.


# 1.126 14-Jan-2001 christos

fix thinko: test for the existance of the target before we define it...


# 1.125 14-Jan-2001 christos

Alter previous redefined target protection. If the ${PROG} target is defined,
add the dependencies as usual, but don't add the commands. This avoids
having to change all the Makefiles that redefine the PROG target.


# 1.124 14-Jan-2001 christos

allow programs to override the program target.


# 1.123 08-Jan-2001 mrg

add missing $LIBCRYPTO_RC5 and $LIBCRYPTO_IDEA


# 1.122 08-Jan-2001 mrg

add missing $LIBSSL


# 1.121 04-Jan-2001 garbled

Add LIBCDK and LIBFORM definitions


# 1.120 31-Oct-2000 itojun

add ${LIBINTL} for use with DPADD.


# 1.119 07-Oct-2000 deberg

fix typos, PR 11159


# 1.118 25-Jun-2000 erh

For the case when DESTDIR is set: move the -L${DESTDIR}/usr/lib after ${LDADD} so any -L directories set in LDADD are searched first to avoid possibly linking against old versions of libraries.


Revision tags: netbsd-1-5-base
# 1.117 19-Jun-2000 thorpej

branches: 1.117.2;
Sync up the LIB* list.


# 1.116 10-Jun-2000 mycroft

Use ${.ALLSRC:T} when doing the generated variable name lookups, so that it
DTRT for generated files in and obj directory (or accessed via .PATH).


# 1.115 06-Jun-2000 mycroft

Abuse .USE some more.


# 1.114 06-Jun-2000 mycroft

Minor rearrangement.


# 1.113 06-Jun-2000 mycroft

Use ODE make(1) features to eliminate extra variables and move several things
outside of .for loops. (Needs more work to completely eliminate .for.)

XXX Don't look at this stuff. It will make your head hurt.


Revision tags: minoura-xpg4dl-base
# 1.112 14-Apr-2000 mrg

branches: 1.112.2;
use -rpath-link rather than -R when linking objects using a DESTDIR.
this replaces the previous change as that ended up adding
$DESTDIR/usr/lib to the runtime path of every binary created, which
is bogus and dangerous.


# 1.111 25-Mar-2000 mycroft

When linking with $DESTDIR, use an explicit -R to get library dependencies
correct.


# 1.110 07-Mar-2000 veego

Remove unused libahdi.
It will be replaced in the future with a more generic libdisklabel.


# 1.109 05-Feb-2000 jdc

Add libahdi entries.


# 1.108 23-Jan-2000 eeh

Add some support for FCode binaries.


# 1.107 22-Jan-2000 mycroft

Make `dependall' play nicely with SUBDIR, using a hack similar to `realinstall'
for both `depend' and `all'.
Also, remove the old hack that invokes an extra shell for .depend, now that
make(1) has been fixed.


# 1.106 16-Jan-2000 assar

all: depend on ${SCRIPTS} so that they get generated if they need to


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.105 23-Nov-1999 blymn

Added libmenu library.


Revision tags: comdex-fall-1999-base
# 1.104 14-Sep-1999 perry

branches: 1.104.4;
Add a "dependall" target, which does a "make depend" and then "make all"
in a single directory. This is useful in "make build" because by doing
the build immediately after the depend, all sources will typically
still be in the buffer cache, thus saving significant time over doing
a "make depend" on all the directories and then a "make all".


# 1.103 04-Sep-1999 fredb

Permit "make all install", as well as "make foo install" (where foo would be
installed by "make install") without setting of BUILD. All cases where BUILD
is already set are unchanged from the old behavior.

"make all install" is now practically equivalent to "make BUILD= all install",
but without actually setting build.

Fixes pr's 8313, 3894.


# 1.102 21-Aug-1999 simonb

Add ${INSTPRIV} to ${INSTALL} commands.


# 1.101 01-Jul-1999 itojun

branches: 1.101.2;
add LIBIPSEC for use from DPADD.


Revision tags: netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.100 12-Feb-1999 lukem

branches: 1.100.2;
* Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).


# 1.99 10-Feb-1999 tv

libbfd_pic.a is no longer installed; remove ${LIBBFD} define.


# 1.98 04-Feb-1999 christos

PR/2936: Brian C. Grayson: Avoid truncating precious files when installing
and the filesystem is full. Added ${RENAME} flag to install, which when set
to -r installs on a temporary file and then renames to the final destination.
${RENAME} is currently set to nothing in bsd.own.mk, but one can turn it
on in /etc/mk.conf.


# 1.97 07-Nov-1998 jonathan

Do DESTDIR support for crtbegin/crtend on all ELF ports (adds mips).


# 1.96 28-Sep-1998 christos

Use preserve flag in install.


# 1.95 10-Sep-1998 ross

Define a LIBBZ2?=... for use in DPADD=... lines.


# 1.94 09-Aug-1998 lukem

add distclean as a synonym for cleandir


# 1.93 09-Apr-1998 tv

.y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.


# 1.92 01-Apr-1998 tv

Revert. This broke too much in the build tree, and a better solution
needs to be created. (The existing situation breaks a lot too.)


# 1.91 01-Apr-1998 tv

Fix .y rules to DTRT with possibly generated .h files. See mail on
tech-toolchain for a very detailed explanation of this. In short, add
a .y.h rule identical to the .y.c rule and make the .y.c rule rename
the .h file; also, clean the .h file in CLEANFILES.


# 1.90 03-Nov-1997 cgd

echo the lint command line when making 'lint'.


# 1.89 28-Oct-1997 lukem

add ${LIBOBJC}


Revision tags: netbsd-1-3-base
# 1.88 11-Oct-1997 mycroft

branches: 1.88.2;
Several changes:
* Allow bsd.man.mk to be included separately.
* Always include bsd.own.mk and bsd.obj.mk.
* Include bsd.man.mk and bsd.nls.mk even if NOMAN or NONLS; just turn off
building of the affected files instead.
* Require bsd.subdir.mk to be included explicitly.
(Will make appropriate changes to Makefiles shortly.)


# 1.87 29-Sep-1997 gwr

Add $LIBBFD


# 1.86 31-May-1997 cjs

Back out BUILDDIR and NOINSTALL changes.


# 1.85 26-May-1997 cjs

branches: 1.85.2;
These updates to the build allow building against include files
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.


# 1.84 18-May-1997 kleink

Add libposix.


# 1.83 17-May-1997 mycroft

Do LINKS and SYMLINKS after FILES and INCS.


# 1.82 17-May-1997 mycroft

Remove unneeded .SUFFIXES lines, and move .s and .S closer to .o to give the
right preferences.


# 1.81 09-May-1997 mycroft

Fix typo in previous.


# 1.80 09-May-1997 mycroft

Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.


# 1.79 09-May-1997 mycroft

Remove cruft.


# 1.78 09-May-1997 mycroft

Oops; rearrange dependencies to get things built early enough.


# 1.77 09-May-1997 mycroft

Make sure INCS and SRCS are built if necessary.


# 1.76 08-May-1997 gwr

Set the .NOPATH flag for ${OBJS} (from Christos).


# 1.75 07-May-1997 mycroft

Don't use _SUBDIRUSE outside of bsd.subdir.mk.


# 1.74 07-May-1997 mycroft

Various simplifications.


# 1.73 07-May-1997 mycroft

Shuffle some .PHONYs around, to work better with `-t'.


# 1.72 06-May-1997 mycroft

Make most of the install targets .PRECIOUS.


# 1.71 06-May-1997 mycroft

Add a pile of missing .PHONYs.


# 1.70 18-Apr-1997 christos

Add ${LIBNTP}


# 1.69 17-Apr-1997 thorpej

- Properly depend on crtbegin.o and crtend.o for platforms that use
them (currently Alpha and PowerPC)
- STRIP -> STRIPFLAG


# 1.68 03-Apr-1997 mikel

don't allow override of all: target


# 1.67 29-Mar-1997 mikel

merge lite-2 changes (mostly SCCSids)


# 1.66 27-Mar-1997 christos

Put the FILES generated rules in a separate .mk file since both bsd.prog.mk
and bsd.lib.mk use them.


# 1.65 27-Mar-1997 mycroft

Make the SCRIPTS case mimic the FILES case more closely, so we can override
the destination direectory, etc.


# 1.64 27-Mar-1997 mycroft

Remove knowledge of HIDEGAME from here.


# 1.63 24-Mar-1997 christos

make rules update:
- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation


# 1.62 22-Mar-1997 perry

Fix SYMLINKS not to include DESTDIR in the link itself


# 1.61 13-Mar-1997 perry

add SYMLINKS, by analogy to LINKS. Vetted by Christos.


# 1.60 22-Jan-1997 cgd

if 'clean' is not already defined, rather than simply defining it with
a bunch of rules, define a clean{kmod,lib,prog} target with the rules,
and have both clean and cleandir depend on that. That eliminates a bug
where 'cleandir' in a directory which included e.g. bsd.prog.mk but which
also had subdirs would 'make clean' all the subdirs and then 'make cleandir'
all ofthe subdirs. It also allows Makefiles to add more dependencies
to 'clean' after inclusion of the make template.

If 'clean' is already defined, the behaviour is the same as it used to be.


# 1.59 20-Dec-1996 cgd

add an afterdepend target (a la the one in bsd.lib.mk) that processes
the .depend file to add <filename>.ln for each <filename>.o as an
object file which has the given dependencies (in addition to
<filename>.po and <filename>.so, which were already there).


# 1.58 13-Dec-1996 mikel

add missing LIBPCAP definition.


# 1.57 26-Nov-1996 mrg

add libz and libwrap


# 1.56 18-Oct-1996 thorpej

Use ${INSTALL} rather than "install".
From Simon J. Gerraty <sjg@zen.void.oz.au>, PR #1458.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.55 08-Apr-1996 jtc

Sort LIBFOO definitions and add LIBY; Reported by Mike Long <mike.long@analog.com> in PR #2301.


# 1.54 22-Oct-1995 christos

Added include file <bsd.sys.mk> that contains lex and yacc "parallel aware"
rules. These rules are not turned on by default; they are enabled by setting
the PARALLEL variable.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.53 25-Jun-1995 cgd

oops; fix an rm that might be empty


# 1.52 24-Jun-1995 cgd

update lint rules, but keep linting disabled


# 1.51 10-Jun-1995 mycroft

Define LIBEDIT.


# 1.50 21-Apr-1995 jtc

.include <bsd.nls.mk> unless NONLS is defined.


# 1.49 22-Dec-1994 cgd

specify man pages differently, and document how.


# 1.48 24-Aug-1994 mycroft

Include bsd.own.mk earlier.


# 1.47 20-Jul-1994 cgd

fix from christos, for progs w/o objects


Revision tags: netbsd-1-0-base
# 1.46 06-Jul-1994 mycroft

branches: 1.46.2;
Pull libraries from ${DESTDIR} if set. Kill LDONLY, which is unused and
probably not useful anyway.


# 1.45 30-Jun-1994 cgd

fix modify-info-nothingness-then-substitute probelm that broke genclass build


# 1.44 30-Jun-1994 cgd

RCSID frobbing, and minor sanity adjustments.


# 1.43 30-Jun-1994 cgd

don't be careless with _SUBDIRUSE


# 1.42 28-Jun-1994 jtc

Strip *.sh when constructing OBJS from SRCS.
This will allow us to clean up makefiles that build a script by munging
a template (uusched, genclass, neqn, etc.).


# 1.41 18-Jun-1994 cgd

don't chown the symlink, when HIDEGAME causes a symlink to be made to dm.
4.4-based FS code _follows_ the symlinks on a chown(2) call.


# 1.40 24-May-1994 cgd

fix the last to do the right thing for dependencies


# 1.39 24-May-1994 deraadt

LIBSKEY


# 1.38 22-May-1994 jtc

Single source file programs are now compiled into object files before they
are linked. This change halves the time it takes to rebuild all of the
NetBSD sources when only the C library is "touched"; but only takes about
one percent more disk space.


# 1.37 06-Apr-1994 chopps

relink (recompile) single source programs when crt0.o is updated.


# 1.36 24-Mar-1994 mycroft

Remove *.core on clean.


# 1.35 09-Feb-1994 cgd

kill install -d's.


# 1.34 28-Jan-1994 cgd

add LIBKVM


# 1.33 10-Nov-1993 cgd

librpc doesn't exist anymore


# 1.32 08-Nov-1993 cgd

ad LDSTATIC flag, so static linking can be made one-stop shopping.
use "setenv LDSTATIC" to make *everything* dynamically linked,
setenv LDSTATIC -static for everything statically linked, or unset
it for default behavior.


# 1.31 07-Oct-1993 cgd

LIBTERM pointed at nothing, but was meant to point to libtermcap.a...


# 1.30 07-Oct-1993 cgd

always define LIBCRYPT


# 1.29 17-Aug-1993 mycroft

Make sure we don't recurse into subdirectories if Makefile specified `install'
target. (It's usually blank and is specifically to avoid doing this...)


# 1.28 15-Aug-1993 mycroft

Automatically include bsd.subdir.mk for backward compatibility.


# 1.27 15-Aug-1993 mycroft

Don't automatically include bsd.subdir.mk in bsd.prog.mk and bsd.lib.mk.
Put back .MAIN in bsd.man.mk, and be careful not to include ../Makefile.inc
a second time.


# 1.26 15-Aug-1993 mycroft

Move man rules to sys.mk.
Use bsd.subdir.mk for building subdirectories.
Don't forget to remove x.cc and x.C when using SHAREDSTRINGS.
Make ${PROG} always depend on ${LIBCRT0}.
Don't duplicate code between cleandir and clean.
Move tags target to bsd.dep.mk.
Move STRIP to bsd.own.mk.
Remove redundant definitions of {BIN,MAN}{DIR,GRP,OWN,MODE}.
Move {LIB,DOC}{DIR,GRP,OWN,MODE} defaults to bsd.own.mk.


# 1.25 15-Aug-1993 mycroft

Abstract out dependency stuff, and add RCS identifiers.


# 1.24 15-Aug-1993 mycroft

Create target directories with `install -d', and move `obj' targets into one
file.


# 1.23 10-Aug-1993 mycroft

Put LINKS handling in `install' target, so it's the last thing executed, and
happens even if `realinstall' is user-defined.


# 1.22 30-Jul-1993 mycroft

When generating a default OBJS, ignore .h files.


# 1.21 29-Jul-1993 mycroft

Don't print the `making ...' message if an obj dir already exists.
Also, a minor cleanup.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base
# 1.20 17-Jul-1993 mycroft

Fix C++ dependencies for good. `make depend' is now done in two passes--one
of C files and one for C++ files. No need to specify `-+' in your Makefile,
as it is now done automatically.


# 1.19 17-Jul-1993 cgd

do c++ dependencies the right way...


# 1.18 17-Jul-1993 mycroft

Add suffix rules for C++ files.


# 1.17 04-Jun-1993 brezak

Add LIBRPCSVC variable.


# 1.16 02-Jun-1993 cgd

add ability to specify c++ dependencies, by setting CFLAGS+=-+ for
the dependency make.


# 1.15 26-Apr-1993 cgd

added definition for DPADD library variable LIBCRYPT.


# 1.14 26-Apr-1993 mycroft

Don't redefine `realinstall' target if already defined.


# 1.13 25-Apr-1993 mycroft

Link with LDFLAGS even if one source module.


# 1.12 25-Apr-1993 mycroft

Don't lose if we include bsd.prog.mk only to build man pages.


# 1.11 25-Apr-1993 mycroft

Fix error in last change. (Oops.)


# 1.10 25-Apr-1993 mycroft

Don't build man pages if NOMAN set.


Revision tags: netbsd-0-8 netbsd-alpha-1
# 1.9 09-Apr-1993 cgd

various changes to default make rules. from patch 101.
note that only the "sensible" changes in patch 101 are implemented.


# 1.8 08-Apr-1993 cgd

try to do the right thing, in terms making directories before we
install into them, and get the manpage cleans _OUT_ of "clean".
they don't belong there, only in cleandir, WFJ be damned.


# 1.7 08-Apr-1993 cgd

fixed typos...


# 1.6 08-Apr-1993 cgd

(silently) make sure we have directories before installing


# 1.5 04-Apr-1993 cgd

make LIBRPC point to the right place


# 1.4 27-Mar-1993 nate

Fixed the doc macros to call troff, eqn,and tbl instead of ditroff,
deqn, and dtbl.
Fixed make clean to remove the man pages (Bill fixed this in the distribution,
but not in the original source)
Changed install to leave the original file around, by using 'cp' instead of
'mv'. "install -c ..."


# 1.3 23-Mar-1993 cgd

made .CURDIR be absolute, not relative, thereby eliminating
the need for some of the makefile trickery when making objects,
and fixing a few .PATH bugs


# 1.2 22-Mar-1993 cgd

fixed "make obj" for cases when sources not in /usr/src/...
if sources not there, it now mkdirs obj, but some trickery
is necessary, to avoid deleting cwd.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision