summaryrefslogtreecommitdiff
path: root/pkgtools/bootstrap-mk-files
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2006-07-14 23:13:00 +0000
committerjlam <jlam@pkgsrc.org>2006-07-14 23:13:00 +0000
commitc71e325c0831ad52dd61638cb629f1a6e981b2e4 (patch)
treecb2a5752ca9c59c207af95b74e0862b27a809316 /pkgtools/bootstrap-mk-files
parentcd740aac0111c9497f7e6f0bbd0fb9cfbd7ef3b3 (diff)
downloadpkgsrc-c71e325c0831ad52dd61638cb629f1a6e981b2e4.tar.gz
Import pkgtools/bootstrap-mk-files, which is the collection of bmake *.mk
files from the bootstrap kit. This package is used during bootstrap to properly register the installed *.mk files. The bootstrap bmake(1) utility uses some customised .mk files in order to pre-define certain definitions and targets, which guide the build process. This package provides those *.mk files for the bmake(1) utility.
Diffstat (limited to 'pkgtools/bootstrap-mk-files')
-rw-r--r--pkgtools/bootstrap-mk-files/DESCR4
-rw-r--r--pkgtools/bootstrap-mk-files/Makefile50
-rw-r--r--pkgtools/bootstrap-mk-files/PLIST22
-rw-r--r--pkgtools/bootstrap-mk-files/files/bsd.README683
-rw-r--r--pkgtools/bootstrap-mk-files/files/bsd.dep.mk62
-rw-r--r--pkgtools/bootstrap-mk-files/files/bsd.depall.mk5
-rw-r--r--pkgtools/bootstrap-mk-files/files/bsd.doc.mk84
-rw-r--r--pkgtools/bootstrap-mk-files/files/bsd.files.mk40
-rw-r--r--pkgtools/bootstrap-mk-files/files/bsd.hostprog.mk137
-rw-r--r--pkgtools/bootstrap-mk-files/files/bsd.inc.mk29
-rw-r--r--pkgtools/bootstrap-mk-files/files/bsd.info.mk64
-rw-r--r--pkgtools/bootstrap-mk-files/files/bsd.kernobj.mk33
-rw-r--r--pkgtools/bootstrap-mk-files/files/bsd.kinc.mk145
-rw-r--r--pkgtools/bootstrap-mk-files/files/bsd.kmod.mk98
-rw-r--r--pkgtools/bootstrap-mk-files/files/bsd.lib.mk524
-rw-r--r--pkgtools/bootstrap-mk-files/files/bsd.links.mk44
-rw-r--r--pkgtools/bootstrap-mk-files/files/bsd.man.mk201
-rw-r--r--pkgtools/bootstrap-mk-files/files/bsd.nls.mk65
-rw-r--r--pkgtools/bootstrap-mk-files/files/bsd.obj.mk91
-rw-r--r--pkgtools/bootstrap-mk-files/files/bsd.prog.mk174
-rw-r--r--pkgtools/bootstrap-mk-files/files/bsd.subdir.mk62
-rw-r--r--pkgtools/bootstrap-mk-files/files/bsd.sys.mk134
-rw-r--r--pkgtools/bootstrap-mk-files/files/mods/Darwin.bsd.lib.mk524
-rw-r--r--pkgtools/bootstrap-mk-files/files/mods/Darwin.bsd.man.mk205
-rw-r--r--pkgtools/bootstrap-mk-files/files/mods/Darwin.bsd.sys.mk65
-rw-r--r--pkgtools/bootstrap-mk-files/files/mods/Darwin.sys.mk210
-rw-r--r--pkgtools/bootstrap-mk-files/files/mods/FreeBSD.bsd.man.mk137
-rw-r--r--pkgtools/bootstrap-mk-files/files/mods/IRIX.bsd.lib.mk522
-rw-r--r--pkgtools/bootstrap-mk-files/files/mods/IRIX.bsd.own.mk.in246
-rw-r--r--pkgtools/bootstrap-mk-files/files/mods/IRIX.sys.mk193
-rw-r--r--pkgtools/bootstrap-mk-files/files/mods/Interix.bsd.lib.mk472
-rw-r--r--pkgtools/bootstrap-mk-files/files/mods/Interix.sys.mk194
-rw-r--r--pkgtools/bootstrap-mk-files/files/mods/Linux.bsd.lib.mk524
-rw-r--r--pkgtools/bootstrap-mk-files/files/mods/Linux.bsd.man.mk203
-rw-r--r--pkgtools/bootstrap-mk-files/files/mods/Linux.sys.mk194
-rw-r--r--pkgtools/bootstrap-mk-files/files/mods/NetBSD.bsd.man.mk206
-rw-r--r--pkgtools/bootstrap-mk-files/files/mods/NetBSD.sys.mk207
-rw-r--r--pkgtools/bootstrap-mk-files/files/mods/OSF1.sys.mk193
-rw-r--r--pkgtools/bootstrap-mk-files/files/mods/OpenBSD.bsd.man.mk137
-rw-r--r--pkgtools/bootstrap-mk-files/files/mods/OpenBSD.bsd.own.mk.in308
-rw-r--r--pkgtools/bootstrap-mk-files/files/mods/OpenBSD.sys.mk202
-rw-r--r--pkgtools/bootstrap-mk-files/files/mods/SunOS.bsd.sys.mk141
-rw-r--r--pkgtools/bootstrap-mk-files/files/mods/SunOS.sys.mk211
-rw-r--r--pkgtools/bootstrap-mk-files/files/mods/UnixWare.sys.mk195
-rw-r--r--pkgtools/bootstrap-mk-files/files/mods/bsd.own.mk.in326
-rw-r--r--pkgtools/bootstrap-mk-files/files/sys.mk208
46 files changed, 8774 insertions, 0 deletions
diff --git a/pkgtools/bootstrap-mk-files/DESCR b/pkgtools/bootstrap-mk-files/DESCR
new file mode 100644
index 00000000000..66092a5d38d
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/DESCR
@@ -0,0 +1,4 @@
+The bootstrap bmake(1) utility uses some customised .mk files in order
+to pre-define certain definitions and targets, which guide the build
+process. This package provides those *.mk files for the bmake(1)
+utility.
diff --git a/pkgtools/bootstrap-mk-files/Makefile b/pkgtools/bootstrap-mk-files/Makefile
new file mode 100644
index 00000000000..7221e91d990
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/Makefile
@@ -0,0 +1,50 @@
+# $NetBSD: Makefile,v 1.1.1.1 2006/07/14 23:13:00 jlam Exp $
+
+DISTNAME= bootstrap-mk-files-20060714
+CATEGORIES= pkgtools
+MASTER_SITES= # empty
+DISTFILES= # empty
+
+CONFLICTS+= mk-files-[0-9]*
+
+MAINTAINER= pkgsrc-users@NetBSD.org
+HOMEPAGE= http://www.pkgsrc.org/
+COMMENT= *.mk files for the bootstrap bmake utility
+
+NO_PKGTOOLS_REQD_CHECK= # defined
+PKG_PRESERVE= # defined
+
+NO_CHECKSUM= yes
+NO_MTREE= yes
+NO_BUILD= yes
+
+USE_TOOLS+= sed
+
+INSTALLTION_DIRS= share/mk
+
+do-extract:
+ @${CP} -R ${FILESDIR} ${WRKSRC}
+
+do-configure:
+ cd ${WRKSRC}; for file in bsd.* sys.mk; do \
+ ${TEST} ! -f mods/${OPSYS}.$$file || \
+ ${CP} -f mods/${OPSYS}.$$file ${WRKSRC}/$$file; \
+ done
+ cd ${WRKSRC}; \
+ if ${TEST} -f mods/${OPSYS}.bsd.own.mk.in; then \
+ own_mk=mods/${OPSYS}.bsd.own.mk.in; \
+ else \
+ own_mk=mods/bsd.own.mk.in; \
+ fi; \
+ ${SED} -e 's|@ROOT_GROUP@|'${ROOT_GROUP}'|g' \
+ -e 's|@ROOT_USER@|'${ROOT_USER}'|g' \
+ -e 's|@SYSCONFDIR@|'${PKG_SYSCONFDIR}'|g' \
+ $$own_mk > bsd.own.mk
+
+do-install:
+ ${INSTALL_DATA_DIR} ${PREFIX}/share/mk
+ cd ${WRKSRC} && for file in bsd.* sys.mk; do \
+ ${INSTALL_DATA} $$file ${PREFIX}/share/mk/$$file; \
+ done
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/pkgtools/bootstrap-mk-files/PLIST b/pkgtools/bootstrap-mk-files/PLIST
new file mode 100644
index 00000000000..3bbc66b018b
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/PLIST
@@ -0,0 +1,22 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2006/07/14 23:13:00 jlam Exp $
+share/mk/bsd.dep.mk
+share/mk/bsd.depall.mk
+share/mk/bsd.doc.mk
+share/mk/bsd.files.mk
+share/mk/bsd.hostprog.mk
+share/mk/bsd.inc.mk
+share/mk/bsd.info.mk
+share/mk/bsd.kernobj.mk
+share/mk/bsd.kinc.mk
+share/mk/bsd.kmod.mk
+share/mk/bsd.lib.mk
+share/mk/bsd.links.mk
+share/mk/bsd.man.mk
+share/mk/bsd.nls.mk
+share/mk/bsd.obj.mk
+share/mk/bsd.own.mk
+share/mk/bsd.prog.mk
+share/mk/bsd.subdir.mk
+share/mk/bsd.sys.mk
+share/mk/sys.mk
+@dirrm share/mk
diff --git a/pkgtools/bootstrap-mk-files/files/bsd.README b/pkgtools/bootstrap-mk-files/files/bsd.README
new file mode 100644
index 00000000000..bd4694a1165
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/bsd.README
@@ -0,0 +1,683 @@
+# $NetBSD: bsd.README,v 1.1.1.1 2006/07/14 23:13:00 jlam Exp $
+# @(#)bsd.README 8.2 (Berkeley) 4/2/94
+
+This is the README file for the new make "include" files for the BSD
+source tree. The files are installed in /usr/share/mk, and are, by
+convention, named with the suffix ".mk".
+
+Note, this file is not intended to replace reading through the .mk
+files for anything tricky.
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+RANDOM THINGS WORTH KNOWING:
+
+The files are simply C-style #include files, and pretty much behave like
+you'd expect. The syntax is slightly different in that a single '.' is
+used instead of the hash mark, i.e. ".include <bsd.prog.mk>".
+
+One difference that will save you lots of debugging time is that inclusion
+of the file is normally done at the *end* of the Makefile. The reason for
+this is because .mk files often modify variables and behavior based on the
+values of variables set in the Makefile. To make this work, remember that
+the FIRST target found is the target that is used, i.e. if the Makefile has:
+
+ a:
+ echo a
+ a:
+ echo a number two
+
+the command "make a" will echo "a". To make things confusing, the SECOND
+variable assignment is the overriding one, i.e. if the Makefile has:
+
+ a= foo
+ a= bar
+
+ b:
+ echo ${a}
+
+the command "make b" will echo "bar". This is for compatibility with the
+way the V7 make behaved.
+
+It's fairly difficult to make the BSD .mk files work when you're building
+multiple programs in a single directory. It's a lot easier to split up the
+programs than to deal with the problem. Most of the agony comes from making
+the "obj" directory stuff work right, not because we switched to a new version
+of make. So, don't get mad at us, figure out a better way to handle multiple
+architectures so we can quit using the symbolic link stuff. (Imake doesn't
+count.)
+
+The file .depend in the source directory is expected to contain dependencies
+for the source files. This file is read automatically by make after reading
+the Makefile.
+
+The variable DESTDIR works as before. It's not set anywhere but will change
+the tree where the file gets installed.
+
+The profiled libraries are no longer built in a different directory than
+the regular libraries. A new suffix, ".po", is used to denote a profiled
+object, and ".so" denotes a shared (position-independent) object.
+
+The following variables that control how things are made/installed that
+are not set by default. These should not be set by Makefiles; they're for
+the user to define in MAKECONF (see bsd.own.mk, below) or on the make(1)
+command line:
+
+BUILD If defined, 'make install' checks that the targets in the
+ source directories are up-to-date and remakes them if they
+ are out of date, instead of blindly trying to install
+ out of date or non-existent targets.
+
+UPDATE If defined, 'make install' only installs targets that are
+ more recently modified in the source directories that their
+ installed counterparts.
+
+UNPRIVILEGED If defined, don't set the owner/group/mode when installing
+ files or directories. This allows a non-root "make install".
+
+MKCATPAGES If "no", don't build or install the catman pages.
+
+MKDOC If "no", don't build or install the documentation.
+
+MKINFO If "no", don't build or install Info documentation from
+ Texinfo source files.
+
+MKLINT If "no", don't build or install the lint libraries.
+
+MKMAN If "no", don't build or install the man or catman pages.
+ Also acts as "MKCATPAGES=no"
+
+MKNLS If "no", don't build or install the NLS files and locale
+ definition files.
+
+MKOBJ If "no", don't enable the rule which creates objdirs.
+ "yes" by default.
+
+MKOBJDIRS If "no", don't create objdirs during a "make build".
+ "no" by default.
+
+MKPIC If "no", don't build or install shared libraries.
+
+MKPICINSTALL If "no", don't install the *_pic.a libraries.
+
+MKPROFILE If "no", don't build or install the profiling libraries.
+
+MKSHARE If "no", act as "MKCATPAGES=no MKDOC=no MKINFO=no MKMAN=no
+ MKNLS=no". I.e, don't build catman pages, documentation,
+ Info documentation, man pages, NLS files, ...
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+The include file <sys.mk> has the default rules for all makes, in the BSD
+environment or otherwise. You probably don't want to touch this file.
+If you intend to run a cross build, you will need to supply the following
+host tools, and configure the following variables properly:
+
+OBJCOPY objcopy - copy and translate object files
+
+STRIP strip - Discard symbols from object files
+
+CONFIG config - build kernel compilation directories
+
+RPCGEN rpcgen - Remote Procedure Call (RPC) protocol compiler
+
+MKLOCALE mklocale - make LC_CTYPE locale files
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+The include file <bsd.man.mk> handles installing manual pages and their
+links.
+
+It has a two targets:
+
+ maninstall:
+ Install the manual page sources and their links.
+ catinstall:
+ Install the preformatted manual pages and their links.
+
+It sets/uses the following variables:
+
+MANDIR Base path for manual installation.
+
+MANGRP Manual group.
+
+MANOWN Manual owner.
+
+MANMODE Manual mode.
+
+MANSUBDIR Subdirectory under the manual page section, i.e. "/vax"
+ or "/tahoe" for machine specific manual pages.
+
+MAN The manual pages to be installed (use a .1 - .9 suffix).
+
+MLINKS List of manual page links (using a .1 - .9 suffix). The
+ linked-to file must come first, the linked file second,
+ and there may be multiple pairs. The files are soft-linked.
+
+The include file <bsd.man.mk> includes a file named "../Makefile.inc" if
+it exists.
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+The include file <bsd.own.mk> contains source tree configuration parameters,
+such as the owners, groups, etc. for both manual pages and binaries, and
+a few global "feature configuration" parameters.
+
+It has no targets.
+
+To get system-specific configuration parameters, bsd.own.mk will try to
+include the file specified by the "MAKECONF" variable. If MAKECONF is not
+set, or no such file exists, the system make configuration file, /etc/mk.conf
+is included. These files may define any of the variables described below.
+
+bsd.own.mk sets the following variables, if they are not already defined
+(defaults are in brackets):
+
+BSDSRCDIR The real path to the system sources, so that 'make obj'
+ will work correctly. [/usr/src]
+
+BSDOBJDIR The real path to the system 'obj' tree, so that 'make obj'
+ will work correctly. [/usr/obj]
+
+BINGRP Binary group. [wheel]
+
+BINOWN Binary owner. [root]
+
+BINMODE Binary mode. [555]
+
+NONBINMODE Mode for non-executable files. [444]
+
+MANDIR Base path for manual installation. [/usr/share/man/cat]
+
+MANGRP Manual group. [wheel]
+
+MANOWN Manual owner. [root]
+
+MANMODE Manual mode. [${NONBINMODE}]
+
+MANINSTALL Manual installation type: maninstall, catinstall, or both
+
+LDSTATIC Control program linking; if set blank, link everything
+ dynamically. If set to "-static", link everything statically.
+ If not set, programs link according to their makefile.
+
+LIBDIR Base path for library installation. [/usr/lib]
+
+LINTLIBDIR Base path for lint(1) library installation. [/usr/libdata/lint]
+
+LIBGRP Library group. [${BINGRP}]
+
+LIBOWN Library owner. [${BINOWN}]
+
+LIBMODE Library mode. [${NONBINMODE}]
+
+DOCDIR Base path for system documentation (e.g. PSD, USD, etc.)
+ installation. [/usr/share/doc]
+
+HTMLDOCDIR Base path for html system documentation installation.
+ [/usr/share/doc/html]
+
+DOCGRP Documentation group. [wheel]
+
+DOCOWN Documentation owner. [root]
+
+DOCMODE Documentation mode. [${NONBINMODE}]
+
+NLSDIR Base path for National Language Support files installation.
+ [/usr/share/nls]
+
+NLSGRP National Language Support files group. [wheel]
+
+NLSOWN National Language Support files owner. [root]
+
+NLSMODE National Language Support files mode. [${NONBINMODE}]
+
+STRIPFLAG The flag passed to the install program to cause the binary
+ to be stripped. This is to be used when building your
+ own install script so that the entire system can be made
+ stripped/not-stripped using a single knob. [-s]
+
+COPY The flag passed to the install program to cause the binary
+ to be copied rather than moved. This is to be used when
+ building our own install script so that the entire system
+ can either be installed with copies, or with moves using
+ a single knob. [-c]
+
+Additionally, the following variables may be set by bsd.own.mk or in a
+make configuration file to modify the behaviour of the system build
+process (default values are in brackets along with comments, if set by
+bsd.own.mk):
+
+MKCRYPTO If set to "no", no cryptography support will be built
+ into the system. Defaults to "yes".
+
+NOCRYPTO If set, it is equivalent to setting MKCRYPTO to "no".
+
+MKCRYPTO_IDEA If set to "yes", IDEA support will be built into
+ libcrypto_idea.a. Defaults to "no".
+
+MKCRYPTO_RC5 If set to "yes", RC5 support will be built into
+ libcrypto_rc5.a. Defaults to "no".
+
+MKKERBEROS If set to "no", disables building Kerberos (v4 or v5)
+ support into various system utilities that support it.
+ Defaults to "yes". NOTE: This does not affect the
+ building of the Kerberos libraries or infrastructure
+ programs themselves. To completely disable Kerberos,
+ set MKCRYPTO to "no".
+
+NOKERBEROS If set, it is equivalent to setting MKKERBEROS to "no".
+
+SKEY Compile in support for S/key authentication. [yes, set
+ unconditionally]
+
+MANZ Compress manual pages at installation time.
+
+SYS_INCLUDE Copy or symlink kernel include files into /usr/include.
+ Possible values are "symlinks" or "copies" (which is
+ the same as the variable being unset).
+
+NOPROFILE Do not build profiled versions of system libraries
+
+NOPIC Do not build PIC versions of system libraries, and
+ do not build shared libraries. [set if ${MACHINE_ARCH}
+ is "sh3" and ${OBJECT_FMT} is "COFF", unset otherwise.]
+
+NOLINT Do not build lint libraries.
+
+OBJECT_FMT Object file format. [set to "ELF" on architectures that
+ use ELF -- currently if ${MACHINE_ARCH} is "alpha",
+ "mipsel", "mipseb", "powerpc", "sparc", "sparc64",
+ "i386" and some m68k machines, or set to "a.out" on
+ other architectures].
+
+MKSOFTFLOAT If "yes", build with options to enable the compiler to
+ generate output containing library calls for floating
+ point and possibly soft-float library support. Defaults
+ to "no".
+
+bsd.own.mk is generally useful when building your own Makefiles so that
+they use the same default owners etc. as the rest of the tree.
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+The include file <bsd.prog.mk> handles building programs from one or
+more source files, along with their manual pages. It has a limited number
+of suffixes, consistent with the current needs of the BSD tree.
+
+It has eight targets:
+
+ all:
+ build the program and its manual page
+ clean:
+ remove the program, any object files and the files a.out,
+ Errs, errs, mklog, and ${PROG}.core.
+ cleandir:
+ remove all of the files removed by the target clean, as
+ well as .depend, tags, and any manual pages.
+ `distclean' is a synonym for `cleandir'.
+ depend:
+ make the dependencies for the source files, and store
+ them in the file .depend.
+ includes:
+ install any header files.
+ install:
+ install the program and its manual pages; if the Makefile
+ does not itself define the target install, the targets
+ beforeinstall and afterinstall may also be used to cause
+ actions immediately before and after the install target
+ is executed.
+ lint:
+ run lint on the source files
+ tags:
+ create a tags file for the source files.
+
+It sets/uses the following variables:
+
+BINGRP Binary group.
+
+BINOWN Binary owner.
+
+BINMODE Binary mode.
+
+CLEANFILES Additional files to remove for the clean and cleandir targets.
+
+COPTS Additional flags to the compiler when creating C objects.
+
+CPPFLAGS Additional flags to the C pre-processor
+
+LDADD Additional loader objects. Usually used for libraries.
+ For example, to load with the compatibility and utility
+ libraries, use:
+
+ LDADD+=-lutil -lcompat
+
+LDFLAGS Additional loader flags.
+
+LINKS The list of binary links; should be full pathnames, the
+ linked-to file coming first, followed by the linked
+ file. The files are hard-linked. For example, to link
+ /bin/test and /bin/[, use:
+
+ LINKS= ${DESTDIR}/bin/test ${DESTDIR}/bin/[
+
+SYMLINKS The list of symbolic links; should be full pathnames.
+ Syntax is identical to LINKS. Note that DESTDIR is not
+ automatically included in the link.
+
+MAN Manual pages (should end in .1 - .9). If no MAN variable is
+ defined, "MAN=${PROG}.1" is assumed.
+
+PROG The name of the program to build. If not supplied, nothing
+ is built.
+
+PROGNAME The name that the above program will be installed as, if
+ different from ${PROG}.
+
+SRCS List of source files to build the program. If SRCS is not
+ defined, it's assumed to be ${PROG}.c.
+
+DPADD Additional dependencies for the program. Usually used for
+ libraries. For example, to depend on the compatibility and
+ utility libraries use:
+
+ DPADD+=${LIBCOMPAT} ${LIBUTIL}
+
+ The following libraries are predefined for DPADD:
+
+ LIBCRT0?= ${DESTDIR}/usr/lib/crt0.o
+ LIBC?= ${DESTDIR}/usr/lib/libc.a
+ LIBC_PIC?= ${DESTDIR}/usr/lib/libc_pic.a
+ LIBCOMPAT?= ${DESTDIR}/usr/lib/libcompat.a
+ LIBCRYPT?= ${DESTDIR}/usr/lib/libcrypt.a
+ LIBCURSES?= ${DESTDIR}/usr/lib/libcurses.a
+ LIBDBM?= ${DESTDIR}/usr/lib/libdbm.a
+ LIBDES?= ${DESTDIR}/usr/lib/libdes.a
+ LIBEDIT?= ${DESTDIR}/usr/lib/libedit.a
+ LIBFORM?= ${DESTDIR}/usr/lib/libform.a
+ LIBGCC?= ${DESTDIR}/usr/lib/libgcc.a
+ LIBGNUMALLOC?= ${DESTDIR}/usr/lib/libgnumalloc.a
+ LIBINTL?= ${DESTDIR}/usr/lib/libintl.a
+ LIBIPSEC?= ${DESTDIR}/usr/lib/libipsec.a
+ LIBKDB?= ${DESTDIR}/usr/lib/libkdb.a
+ LIBKRB?= ${DESTDIR}/usr/lib/libkrb.a
+ LIBKVM?= ${DESTDIR}/usr/lib/libkvm.a
+ LIBL?= ${DESTDIR}/usr/lib/libl.a
+ LIBM?= ${DESTDIR}/usr/lib/libm.a
+ LIBMENU?= ${DESTDIR}/usr/lib/libmenu.a
+ LIBMP?= ${DESTDIR}/usr/lib/libmp.a
+ LIBNTP?= ${DESTDIR}/usr/lib/libntp.a
+ LIBPC?= ${DESTDIR}/usr/lib/libpc.a
+ LIBPCAP?= ${DESTDIR}/usr/lib/libpcap.a
+ LIBPLOT?= ${DESTDIR}/usr/lib/libplot.a
+ LIBPOSIX?= ${DESTDIR}/usr/lib/libposix.a
+ LIBRESOLV?= ${DESTDIR}/usr/lib/libresolv.a
+ LIBRPCSVC?= ${DESTDIR}/usr/lib/librpcsvc.a
+ LIBSKEY?= ${DESTDIR}/usr/lib/libskey.a
+ LIBTERMCAP?= ${DESTDIR}/usr/lib/libtermcap.a
+ LIBTELNET?= ${DESTDIR}/usr/lib/libtelnet.a
+ LIBUTIL?= ${DESTDIR}/usr/lib/libutil.a
+ LIBWRAP?= ${DESTDIR}/usr/lib/libwrap.a
+ LIBY?= ${DESTDIR}/usr/lib/liby.a
+ LIBZ?= ${DESTDIR}/usr/lib/libz.a
+
+
+SHAREDSTRINGS If defined, a new .c.o rule is used that results in shared
+ strings, using xstr(1). Note that this will not work with
+ parallel makes.
+
+STRIPFLAG The flag passed to the install program to cause the binary
+ to be stripped.
+
+SUBDIR A list of subdirectories that should be built as well.
+ Each of the targets will execute the same target in the
+ subdirectories.
+
+SCRIPTS A list of interpreter scripts [file.{sh,csh,pl,awk,...}].
+ These are installed exactly like programs.
+
+SCRIPTSNAME The name that the above program will be installed as, if
+ different from ${SCRIPTS}. These can be further specialized
+ by setting SCRIPTSNAME_<script>.
+
+FILES A list of files to install. The installation is controlled
+ by the FILESNAME, FILESOWN, FILESGRP, FILESMODE, FILESDIR
+ variables that can be further specialized by FILES<VAR>_<file>
+
+The include file <bsd.prog.mk> includes the file named "../Makefile.inc"
+if it exists, as well as the include file <bsd.man.mk>.
+
+Some simple examples:
+
+To build foo from foo.c with a manual page foo.1, use:
+
+ PROG= foo
+
+ .include <bsd.prog.mk>
+
+To build foo from foo.c with a manual page foo.2, add the line:
+
+ MAN= foo.2
+
+If foo does not have a manual page at all, add the line:
+
+ MKMAN= no
+
+If foo has multiple source files, add the line:
+
+ SRCS= a.c b.c c.c d.c
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+The include file <bsd.subdir.mk> contains the default targets for building
+subdirectories. It has the same eight targets as <bsd.prog.mk>: all,
+clean, cleandir, depend, includes, install, lint, and tags. For all of
+the directories listed in the variable SUBDIR, the specified directory
+will be visited and the target made. There is also a default target which
+allows the command "make subdir" where subdir is any directory listed in
+the variable SUBDIR.
+
+As a special case, the use of a token .WAIT as an entry in SUBDIR acts
+as a synchronization barrier when multiple make jobs are run; subdirs
+before the .WAIT must complete before any subdirs after .WAIT are
+started. See make(1) for some caveats on use of .WAIT and other
+special sources.
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+The include file <bsd.links.mk> handles the LINKS and SYMLINKS variables
+and is included from from bsd.lib.mk and bsd.prog.mk.
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+The include file <bsd.files.mk> handles the FILES variables and is included
+from bsd.lib.mk and bsd.prog.mk.
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+The include file <bsd.inc.mk> defines the includes target and uses two
+variables:
+
+INCS The list of include files
+
+INCSDIR The location to install the include files.
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+The include file <bsd.kinc.mk> defines the many targets (includes,
+subdirectories, etc.), and is used by kernel makefiles to handle
+include file installation. It is intended to be included alone, by
+kernel Makefiles. Please see bsd.kinc.mk for more details, and keep
+the documentation in that file up to date.
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+The include file <bsd.info.mk> is used to generate and install GNU Info
+documentation from respective Texinfo source files. It defines three
+implicit targets (.txi.info, .texi.info, and .texinfo.info), and uses the
+following variables:
+
+TEXINFO List of Texinfo source files. Info documentation will
+ consist of single files with the extension replaced by
+ .info.
+
+INFOFLAGS Flags to pass to makeinfo. []
+
+INSTALL_INFO Name of install-info program. [install-info]
+
+MAKEINFO Name of makeinfo program. [makeinfo]
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+The include file <bsd.sys.mk> is used by <bsd.prog.mk> and
+<bsd.lib.mk>. It contains overrides that are used when building
+the NetBSD source tree. For instance, if "PARALLEL" is defined by
+the program/library Makefile, it includes a set of rules for lex and
+yacc that allow multiple lex and yacc targets to be built in parallel.
+
+Other variables of note (incomplete list):
+
+WARNS Crank up gcc warning options; WARNS=1 and WARNS=2 are the two
+ distinct levels.
+
+FORMAT_AUDIT If FORMAT_AUDIT is set, and WFORMAT is set and > 1, turn on
+WFORMAT -Wnetbsd-format-audit for extra-stringent format checking.
+ WFORMAT belongs in individual makefiles and/or
+ Makefile.inc files. (set WFORMAT=1 in individual
+ makefiles if a program is not security critical and is
+ doing bizarre things with format strings which would
+ be even uglier if rewritten) FORMAT_AUDIT should go in
+ mk.conf if you're doing format-string auditing.
+ FORMAT_AUDIT may go away in time.
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+The include file <bsd.lib.mk> has support for building libraries. It has
+the same eight targets as <bsd.prog.mk>: all, clean, cleandir, depend,
+includes, install, lint, and tags. Additionally, it has a checkver target
+which checks for installed shared object libraries whose version is greater
+that the version of the source. It has a limited number of suffixes,
+consistent with the current needs of the BSD tree.
+
+It sets/uses the following variables:
+
+LIB The name of the library to build.
+
+LIBDIR Target directory for libraries.
+
+LINTLIBDIR Target directory for lint libraries.
+
+LIBGRP Library group.
+
+LIBOWN Library owner.
+
+LIBMODE Library mode.
+
+LDADD Additional loader objects.
+
+MAN The manual pages to be installed (use a .1 - .9 suffix).
+
+MKLINKLIB If "no", act as "MKPICINSTALL=no MKPROFILE=no".
+ Also:
+ - don't install the .a libraries
+ - don't install _pic.a libraries on PIC systems
+ - don't build .a libraries on PIC systems
+ - don't install the .so symlink on ELF systems
+ I.e, only install the shared library (and the .so.major
+ symlink on ELF).
+
+MKPICLIB If "no", don't build _pic.a libraries, and build the
+ shared object libraries from the .a libraries. A
+ symlink is installed in ${DESTDIR}/usr/lib for the
+ _pic.a library pointing to the .a library.
+
+NOCHECKVER_<library>
+NOCHECKVER If set, disables checking for installed shared object
+ libraries with versions greater than the source. A
+ particular library name, without the "lib" prefix, may
+ be appended to the variable name to disable the check for
+ only that library.
+
+SRCS List of source files to build the library. Suffix types
+ .s, .c, and .f are supported. Note, .s files are preferred
+ to .c files of the same name. (This is not the default for
+ versions of make.)
+
+The include file <bsd.lib.mk> includes the file named "../Makefile.inc"
+if it exists, as well as the include file <bsd.man.mk>.
+
+It has rules for building profiled objects; profiled libraries are
+built by default.
+
+Libraries are ranlib'd when made.
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+The include file <bsd.obj.mk> defines targets related to the creation
+and use of separated object and source directories.
+
+If an environment variable named MAKEOBJDIRPREFIX is set, make(1) uses
+${MAKEOBJDIRPREFIX}${.CURDIR} as the name of the object directory if
+it exists. Otherwise make(1) looks for the existence of a
+subdirectory (or a symlink to a directory) of the source directory
+into which built targets should be placed. If an environment variable
+named MAKEOBJDIR is set, make(1) uses its value as the name of the
+object directory; failing that, make first looks for a subdirectory
+named "obj.${MACHINE}", and if that doesn't exist, it looks for "obj".
+
+Object directories are not created automatically by make(1) if they
+don't exist; you need to run a separate "make obj". (This will happen
+during a top-level build if "MKOBJDIRS" is set to a value other than
+"no"). When the source directory is a subdirectory of ${BSDSRCDIR} --
+and this is determined by a simple string prefix comparison -- object
+directories are created in a separate object directory tree, and a
+symlink to the object directory in that tree is created in the source
+directory; otherwise, "make obj" assumes that you're not in the main
+source tree and that it's not safe to use a separate object tree.
+
+Several variables used by <bsd.obj.mk> control exactly what
+directories and links get created during a "make obj":
+
+MAKEOBJDIR If set, this is the component name of the object
+ directory.
+
+OBJMACHINE If this is set but MAKEOBJDIR is not set, creates
+ object directories or links named "obj.${MACHINE}";
+ otherwise, just creates ones named "obj".
+
+USR_OBJMACHINE If set, and the current directory is a subdirectory of
+ ${BSDSRCDIR}, create object directory in the
+ corresponding subdirectory of ${BSDOBJDIR}.${MACHINE};
+ otherwise, create it in the corresponding subdirectory
+ of ${BSDOBJDIR}
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+The include file <bsd.kernobj.mk> defines variables related to the
+location of kernel sources and object directories.
+
+KERNSRCDIR Is the location of the top of the kernel src.
+ It defaults to ${BSDSRCDIR}/sys, but the top-level
+ Makefile.inc sets it to ${ABSTOP}/sys (ABSTOP is the
+ absolute path to the directory where the top-level
+ Makefile.inc was found.
+
+KERNARCHDIR Is the location of the machine dependent kernel
+ sources. It defaults to arch/${MACHINE}
+
+KERNCONFDIR Is where the configuration files for kernels are
+ found; default is ${KERNSRCDIR}/${KERNARCHDIR}/conf.
+
+KERNOBJDIR Is the kernel build directory. The kernel GENERIC for
+ instance will be compiled in ${KERNOBJDIR}/GENERIC.
+ The default value is
+ ${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile
+ if it exists or the target 'obj' is being made.
+ Otherwise the default is
+ ${KERNSRCDIR}/${KERNARCHDIR}/compile.
+
+It is important that Makefiles (such as those under src/distrib) that
+wish to find compiled kernels use bsd.kernobj.mk and ${KERNOBJDIR}
+rather than make assumptions about the location of the compiled kernel.
+
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
diff --git a/pkgtools/bootstrap-mk-files/files/bsd.dep.mk b/pkgtools/bootstrap-mk-files/files/bsd.dep.mk
new file mode 100644
index 00000000000..a42a2420349
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/bsd.dep.mk
@@ -0,0 +1,62 @@
+# $NetBSD: bsd.dep.mk,v 1.1.1.1 2006/07/14 23:13:00 jlam Exp $
+
+.PHONY: cleandepend
+cleandir: cleandepend
+
+MKDEP?= mkdep
+
+# some of the rules involve .h sources, so remove them from mkdep line
+realdepend: beforedepend
+.if defined(SRCS)
+realdepend: .depend
+.NOPATH: .depend
+.depend: ${SRCS} ${DPSRCS}
+ @rm -f .depend
+ @files="${.ALLSRC:M*.s} ${.ALLSRC:M*.S}"; \
+ if [ "$$files" != " " ]; then \
+ echo ${MKDEP} -a ${MKDEPFLAGS} \
+ ${AFLAGS:M-[ID]*:Q} ${CPPFLAGS:Q} -traditional-cpp ${AINC:Q} \
+ $$files; \
+ ${MKDEP} -a ${MKDEPFLAGS} \
+ ${AFLAGS:M-[ID]*} ${CPPFLAGS} -traditional-cpp ${AINC} $$files; \
+ fi
+ @files="${.ALLSRC:M*.c}"; \
+ if [ "$$files" != "" ]; then \
+ echo ${MKDEP} -a ${MKDEPFLAGS} \
+ ${CFLAGS:M-[ID]*:Q} ${CPPFLAGS:Q} $$files; \
+ ${MKDEP} -a ${MKDEPFLAGS} \
+ ${CFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \
+ fi
+ @files="${.ALLSRC:M*.m}"; \
+ if [ "$$files" != "" ]; then \
+ echo ${MKDEP} -a ${MKDEPFLAGS} \
+ ${OBJCFLAGS:M-[ID]*:Q} ${CPPFLAGS:Q} $$files; \
+ ${MKDEP} -a ${MKDEPFLAGS} \
+ ${OBJCFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \
+ fi
+ @files="${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cxx}"; \
+ if [ "$$files" != " " ]; then \
+ echo ${MKDEP} -a ${MKDEPFLAGS} \
+ ${CXXFLAGS:M-[ID]*:Q} ${CPPFLAGS:Q} $$files; \
+ ${MKDEP} -a ${MKDEPFLAGS} \
+ ${CXXFLAGS:M-[ID]*} ${CPPFLAGS} $$files; \
+ fi
+cleandepend:
+ rm -f .depend ${.CURDIR}/tags ${CLEANDEPEND}
+.else
+cleandepend:
+.endif
+realdepend: afterdepend
+
+beforedepend:
+afterdepend:
+
+.if !target(tags)
+.if defined(SRCS)
+tags: ${SRCS}
+ -cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC:N*.h} | \
+ sed "s;\${.CURDIR}/;;" > tags
+.else
+tags:
+.endif
+.endif
diff --git a/pkgtools/bootstrap-mk-files/files/bsd.depall.mk b/pkgtools/bootstrap-mk-files/files/bsd.depall.mk
new file mode 100644
index 00000000000..2bab28b043a
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/bsd.depall.mk
@@ -0,0 +1,5 @@
+# $NetBSD: bsd.depall.mk,v 1.1.1.1 2006/07/14 23:13:00 jlam Exp $
+
+dependall: realdepend .MAKE
+ @cd ${.CURDIR}; \
+ ${MAKE} realall
diff --git a/pkgtools/bootstrap-mk-files/files/bsd.doc.mk b/pkgtools/bootstrap-mk-files/files/bsd.doc.mk
new file mode 100644
index 00000000000..80a58d544c6
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/bsd.doc.mk
@@ -0,0 +1,84 @@
+# $NetBSD: bsd.doc.mk,v 1.1.1.1 2006/07/14 23:13:00 jlam Exp $
+# @(#)bsd.doc.mk 8.1 (Berkeley) 8/14/93
+
+.if !target(__initialized__)
+__initialized__:
+.if exists(${.CURDIR}/../Makefile.inc)
+.include "${.CURDIR}/../Makefile.inc"
+.endif
+.include <bsd.own.mk>
+.MAIN: all
+.endif
+
+.PHONY: cleandoc docinstall print spell
+.if ${MKSHARE} != "no"
+realinstall: docinstall
+.endif
+clean cleandir: cleandoc
+
+BIB?= bib
+EQN?= eqn
+GREMLIN?= grn
+GRIND?= vgrind -f
+INDXBIB?= indxbib
+PIC?= pic
+REFER?= refer
+ROFF?= groff -M/usr/share/tmac ${MACROS} ${PAGES}
+SOELIM?= soelim
+TBL?= tbl
+
+.if !target(all)
+.if ${MKSHARE} != "no"
+realall: paper.ps
+.else
+realall:
+.endif
+.endif
+
+.if !target(paper.ps)
+paper.ps: ${SRCS}
+ ${ROFF} ${.ALLSRC} > ${.TARGET}
+.endif
+
+.if !target(print)
+print: paper.ps
+ lpr -P${PRINTER} ${.ALLSRC}
+.endif
+
+cleandoc:
+ rm -f paper.* [eE]rrs mklog ${CLEANFILES}
+
+.if ${MKDOC} != "no"
+FILES?=${SRCS}
+ALLFILES=Makefile ${FILES} ${EXTRA}
+
+docinstall:: ${ALLFILES:@F@${DESTDIR}${DOCDIR}/${DIR}/${F}@}
+.PRECIOUS: ${ALLFILES:@F@${DESTDIR}${DOCDIR}/${DIR}/${F}@}
+.if !defined(UPDATE)
+.PHONY: ${ALLFILES:@F@${DESTDIR}${DOCDIR}/${DIR}/${F}@}
+.endif
+
+__docinstall: .USE
+ ${INSTALL} ${RENAME} ${PRESERVE} ${INSTPRIV} -c -o ${DOCOWN} \
+ -g ${DOCGRP} -m ${DOCMODE} ${.ALLSRC} ${.TARGET}
+
+.for F in ${ALLFILES:O:u}
+.if !defined(BUILD) && !make(all) && !make(${F})
+${DESTDIR}${DOCDIR}/${DIR}/${F}: .MADE
+.endif
+${DESTDIR}${DOCDIR}/${DIR}/${F}: ${F} __docinstall
+.endfor
+.endif
+
+.if !target(docinstall)
+docinstall::
+.endif
+
+spell: ${SRCS}
+ spell ${.ALLSRC} | sort | comm -23 - spell.ok > paper.spell
+
+depend includes lint obj tags:
+
+dependall: all
+
+.include <bsd.obj.mk>
diff --git a/pkgtools/bootstrap-mk-files/files/bsd.files.mk b/pkgtools/bootstrap-mk-files/files/bsd.files.mk
new file mode 100644
index 00000000000..7bb266dc7d3
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/bsd.files.mk
@@ -0,0 +1,40 @@
+# $NetBSD: bsd.files.mk,v 1.1.1.1 2006/07/14 23:13:00 jlam Exp $
+
+# This file can be included multiple times. It clears the definition of
+# FILES at the end so that this is possible.
+
+.PHONY: filesinstall
+realinstall: filesinstall
+
+.if defined(FILES) && !empty(FILES)
+FILESDIR?=${BINDIR}
+FILESOWN?=${BINOWN}
+FILESGRP?=${BINGRP}
+FILESMODE?=${NONBINMODE}
+
+filesinstall:: ${FILES:@F@${DESTDIR}${FILESDIR_${F}:U${FILESDIR}}/${FILESNAME_${F}:U${FILESNAME:U${F:T}}}@}
+.PRECIOUS: ${FILES:@F@${DESTDIR}${FILESDIR_${F}:U${FILESDIR}}/${FILESNAME_${F}:U${FILESNAME:U${F:T}}}@}
+.if !defined(UPDATE)
+.PHONY: ${FILES:@F@${DESTDIR}${FILESDIR_${F}:U${FILESDIR}}/${FILESNAME_${F}:U${FILESNAME:U${F:T}}}@}
+.endif
+
+__fileinstall: .USE
+ ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} \
+ -o ${FILESOWN_${.ALLSRC:T}:U${FILESOWN}} \
+ -g ${FILESGRP_${.ALLSRC:T}:U${FILESGRP}} \
+ -m ${FILESMODE_${.ALLSRC:T}:U${FILESMODE}} \
+ ${.ALLSRC} ${.TARGET}
+
+.for F in ${FILES:O:u}
+.if !defined(BUILD) && !make(all) && !make(${F})
+${DESTDIR}${FILESDIR_${F}:U${FILESDIR}}/${FILESNAME_${F}:U${FILESNAME:U${F:T}}}: .MADE
+.endif
+${DESTDIR}${FILESDIR_${F}:U${FILESDIR}}/${FILESNAME_${F}:U${FILESNAME:U${F:T}}}: ${F} __fileinstall
+.endfor
+.endif
+
+.if !target(filesinstall)
+filesinstall::
+.endif
+
+FILES:=
diff --git a/pkgtools/bootstrap-mk-files/files/bsd.hostprog.mk b/pkgtools/bootstrap-mk-files/files/bsd.hostprog.mk
new file mode 100644
index 00000000000..1ab1eceb2cd
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/bsd.hostprog.mk
@@ -0,0 +1,137 @@
+# $NetBSD: bsd.hostprog.mk,v 1.1.1.1 2006/07/14 23:13:00 jlam Exp $
+# @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94
+
+.if !target(__initialized__)
+__initialized__:
+.if exists(${.CURDIR}/../Makefile.inc)
+.include "${.CURDIR}/../Makefile.inc"
+.endif
+.include <bsd.own.mk>
+.include <bsd.obj.mk>
+.include <bsd.depall.mk>
+.MAIN: all
+.endif
+
+.PHONY: cleanprog
+clean cleandir: cleanprog
+
+CFLAGS+= ${COPTS}
+
+LIBBZ2?= /usr/lib/libbz2.a
+LIBC?= /usr/lib/libc.a
+LIBC_PIC?= /usr/lib/libc_pic.a
+LIBCDK?= /usr/lib/libcdk.a
+LIBCOMPAT?= /usr/lib/libcompat.a
+LIBCRYPT?= /usr/lib/libcrypt.a
+LIBCURSES?= /usr/lib/libcurses.a
+LIBDBM?= /usr/lib/libdbm.a
+LIBDES?= /usr/lib/libdes.a
+LIBEDIT?= /usr/lib/libedit.a
+LIBFORM?= /usr/lib/libform.a
+LIBGCC?= /usr/lib/libgcc.a
+LIBGNUMALLOC?= /usr/lib/libgnumalloc.a
+LIBINTL?= /usr/lib/libintl.a
+LIBIPSEC?= /usr/lib/libipsec.a
+LIBKDB?= /usr/lib/libkdb.a
+LIBKRB?= /usr/lib/libkrb.a
+LIBKVM?= /usr/lib/libkvm.a
+LIBL?= /usr/lib/libl.a
+LIBM?= /usr/lib/libm.a
+LIBMENU?= /usr/lib/libmenu.a
+LIBMP?= /usr/lib/libmp.a
+LIBNTP?= /usr/lib/libntp.a
+LIBOBJC?= /usr/lib/libobjc.a
+LIBPC?= /usr/lib/libpc.a
+LIBPCAP?= /usr/lib/libpcap.a
+LIBPLOT?= /usr/lib/libplot.a
+LIBPOSIX?= /usr/lib/libposix.a
+LIBRESOLV?= /usr/lib/libresolv.a
+LIBRPCSVC?= /usr/lib/librpcsvc.a
+LIBSKEY?= /usr/lib/libskey.a
+LIBTERMCAP?= /usr/lib/libtermcap.a
+LIBTELNET?= /usr/lib/libtelnet.a
+LIBUTIL?= /usr/lib/libutil.a
+LIBWRAP?= /usr/lib/libwrap.a
+LIBY?= /usr/lib/liby.a
+LIBZ?= /usr/lib/libz.a
+
+.if defined(SHAREDSTRINGS)
+CLEANFILES+=strings
+.c.lo:
+ ${HOST_CC} -E ${CFLAGS} ${.IMPSRC} | xstr -c -
+ @${HOST_CC} ${CFLAGS} -c x.c -o ${.TARGET}
+ @rm -f x.c
+
+.cc.lo:
+ ${HOST_CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c -
+ @mv -f x.c x.cc
+ @${HOST_CXX} ${CXXFLAGS} -c x.cc -o ${.TARGET}
+ @rm -f x.cc
+
+.C.lo:
+ ${HOST_CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c -
+ @mv -f x.c x.C
+ @${HOST_CXX} ${CXXFLAGS} -c x.C -o ${.TARGET}
+ @rm -f x.C
+.endif
+
+
+.if defined(HOSTPROG)
+SRCS?= ${HOSTPROG}.c
+
+DPSRCS+= ${SRCS:M*.l:.l=.c} ${SRCS:M*.y:.y=.c}
+CLEANFILES+= ${DPSRCS}
+.if defined(YHEADER)
+CLEANFILES+= ${SRCS:M*.y:.y=.h}
+.endif
+
+.if !empty(SRCS:N*.h:N*.sh)
+OBJS+= ${SRCS:N*.h:N*.sh:R:S/$/.lo/g}
+LOBJS+= ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
+.endif
+
+.if defined(OBJS) && !empty(OBJS)
+.NOPATH: ${OBJS}
+
+${HOSTPROG}: ${DPSRCS} ${OBJS} ${LIBC} ${DPADD}
+ ${HOST_LINK.c} ${HOST_LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD}
+
+.endif # defined(OBJS) && !empty(OBJS)
+
+.if !defined(MAN)
+MAN= ${HOSTPROG}.1
+.endif # !defined(MAN)
+.endif # defined(HOSTPROG)
+
+realall: ${HOSTPROG}
+
+cleanprog:
+ rm -f a.out [Ee]rrs mklog core *.core \
+ ${HOSTPROG} ${OBJS} ${LOBJS} ${CLEANFILES}
+
+beforedepend:
+CPPFLAGS= ${HOST_CPPFLAGS}
+
+.if defined(SRCS)
+afterdepend: .depend
+ @(TMP=/tmp/_depend$$$$; \
+ sed -e 's/^\([^\.]*\).o[ ]*:/\1.lo \1.ln:/' \
+ < .depend > $$TMP; \
+ mv $$TMP .depend)
+.endif
+
+lint: ${LOBJS}
+.if defined(LOBJS) && !empty(LOBJS)
+ ${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} ${LOBJS} ${LDADD}
+.endif
+
+.include <bsd.man.mk>
+.include <bsd.nls.mk>
+.include <bsd.files.mk>
+.include <bsd.inc.mk>
+.include <bsd.links.mk>
+.include <bsd.dep.mk>
+.include <bsd.sys.mk>
+
+# Make sure all of the standard targets are defined, even if they do nothing.
+regress:
diff --git a/pkgtools/bootstrap-mk-files/files/bsd.inc.mk b/pkgtools/bootstrap-mk-files/files/bsd.inc.mk
new file mode 100644
index 00000000000..5f1d0078c44
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/bsd.inc.mk
@@ -0,0 +1,29 @@
+# $NetBSD: bsd.inc.mk,v 1.1.1.1 2006/07/14 23:13:00 jlam Exp $
+
+.PHONY: incinstall
+includes: ${INCS} incinstall
+
+.if defined(INCS)
+incinstall:: ${INCS:@I@${DESTDIR}${INCSDIR}/$I@}
+.PRECIOUS: ${INCS:@I@${DESTDIR}${INCSDIR}/$I@}
+.if !defined(UPDATE)
+.PHONY: ${INCS:@I@${DESTDIR}${INCSDIR}/$I@}
+.endif
+
+__incinstall: .USE
+ @cmp -s ${.ALLSRC} ${.TARGET} > /dev/null 2>&1 || \
+ (echo "${INSTALL} ${RENAME} ${PRESERVE} ${INSTPRIV} -c \
+ -o ${BINOWN} -g ${BINGRP} -m ${NONBINMODE} \
+ ${.ALLSRC} ${.TARGET}" && \
+ ${INSTALL} ${RENAME} ${PRESERVE} ${INSTPRIV} -c \
+ -o ${BINOWN} \
+ -g ${BINGRP} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET})
+
+.for I in ${INCS:O:u}
+${DESTDIR}${INCSDIR}/$I: $I __incinstall
+.endfor
+.endif
+
+.if !target(incinstall)
+incinstall::
+.endif
diff --git a/pkgtools/bootstrap-mk-files/files/bsd.info.mk b/pkgtools/bootstrap-mk-files/files/bsd.info.mk
new file mode 100644
index 00000000000..31b3e594843
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/bsd.info.mk
@@ -0,0 +1,64 @@
+# $NetBSD: bsd.info.mk,v 1.1.1.1 2006/07/14 23:13:00 jlam Exp $
+
+.if !target(__initialized__)
+__initialized__:
+.if exists(${.CURDIR}/../Makefile.inc)
+.include "${.CURDIR}/../Makefile.inc"
+.endif
+.include <bsd.own.mk>
+.include <bsd.obj.mk>
+.include <bsd.depall.mk>
+.MAIN: all
+.endif
+
+MAKEINFO?= makeinfo
+INFOFLAGS?=
+INSTALL_INFO?= install-info
+
+.PHONY: infoinstall cleaninfo
+cleandir: cleaninfo
+
+.SUFFIXES: .txi .texi .texinfo .info
+
+.txi.info .texi.info .texinfo.info:
+ ${MAKEINFO} ${INFOFLAGS} --no-split -o $@ $<
+
+.if defined(TEXINFO) && !empty(TEXINFO)
+INFOFILES= ${TEXINFO:C/\.te?xi(nfo)?$/.info/}
+.NOPATH: ${INFOFILES}
+
+.if ${MKINFO} != "no"
+realinstall: infoinstall
+realall: ${INFOFILES}
+.endif
+
+cleaninfo:
+ rm -f ${INFOFILES}
+
+infoinstall:: ${INFOFILES:@F@${DESTDIR}${INFODIR_${F}:U${INFODIR}}/${INFONAME_${F}:U${INFONAME:U${F:T}}}@}
+.PRECIOUS: ${INFOFILES:@F@${DESTDIR}${INFODIR_${F}:U${INFODIR}}/${INFONAME_${F}:U${INFONAME:U${F:T}}}@}
+.if !defined(UPDATE)
+.PHONY: ${INFOFILES:@F@${DESTDIR}${INFODIR_${F}:U${INFODIR}}/${INFONAME_${F}:U${INFONAME:U${F:T}}}@}
+.endif
+
+__infoinstall: .USE
+ ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} \
+ -o ${INFOOWN_${.ALLSRC:T}:U${INFOOWN}} \
+ -g ${INFOGRP_${.ALLSRC:T}:U${INFOGRP}} \
+ -m ${INFOMODE_${.ALLSRC:T}:U${INFOMODE}} \
+ ${.ALLSRC} ${.TARGET}
+ @${INSTALL_INFO} --remove --info-dir=${DESTDIR}${INFODIR} ${.TARGET}
+ ${INSTALL_INFO} --info-dir=${DESTDIR}${INFODIR} ${.TARGET}
+
+.for F in ${INFOFILES:O:u}
+.if !defined(BUILD) && !make(all) && !make(${F})
+${DESTDIR}${INFODIR_${F}:U${INFODIR}}/${INFONAME_${F}:U${INFONAME:U${F:T}}}: .MADE
+.endif
+${DESTDIR}${INFODIR_${F}:U${INFODIR}}/${INFONAME_${F}:U${INFONAME:U${F:T}}}: ${F} __infoinstall
+.endfor
+.else
+cleaninfo:
+.endif
+
+# Make sure all of the standard targets are defined, even if they do nothing.
+clean depend includes lint regress tags:
diff --git a/pkgtools/bootstrap-mk-files/files/bsd.kernobj.mk b/pkgtools/bootstrap-mk-files/files/bsd.kernobj.mk
new file mode 100644
index 00000000000..e2f91e5e870
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/bsd.kernobj.mk
@@ -0,0 +1,33 @@
+# $NetBSD: bsd.kernobj.mk,v 1.1.1.1 2006/07/14 23:13:00 jlam Exp $
+
+# KERNSRCDIR Is the location of the top of the kernel src.
+# It defaults to ${BSDSRCDIR}/sys, but the top-level
+# Makefile.inc sets it to ${ABSTOP}/sys (ABSTOP is the
+# absolute path to the directory where the top-level
+# Makefile.inc was found.
+#
+# KERNARCHDIR Is the location of the machine dependent kernel
+# sources. It defaults to arch/${MACHINE}
+#
+# KERNCONFDIR Is where the configuration files for kernels are
+# found; default is ${KERNSRCDIR}/${KERNARCHDIR}/conf.
+#
+# KERNOBJDIR Is the kernel build directory. The kernel GENERIC for
+# instance will be compiled in ${KERNOBJDIR}/GENERIC.
+# The default value is
+# ${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile
+# if it exists or the target 'obj' is being made.
+# Otherwise the default is
+# ${KERNSRCDIR}/${KERNARCHDIR}/compile.
+#
+
+KERNSRCDIR?= ${BSDSRCDIR}/sys
+# just incase ${MACHINE} is not always correct
+KERNARCHDIR?= arch/${MACHINE}
+
+.if make(obj) || exists(${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile)
+KERNOBJDIR?= ${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile
+.else
+KERNOBJDIR?= ${KERNSRCDIR}/${KERNARCHDIR}/compile
+.endif
+KERNCONFDIR?= ${KERNSRCDIR}/${KERNARCHDIR}/conf
diff --git a/pkgtools/bootstrap-mk-files/files/bsd.kinc.mk b/pkgtools/bootstrap-mk-files/files/bsd.kinc.mk
new file mode 100644
index 00000000000..5b0e2fd71f4
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/bsd.kinc.mk
@@ -0,0 +1,145 @@
+# $NetBSD: bsd.kinc.mk,v 1.1.1.1 2006/07/14 23:13:00 jlam Exp $
+
+# System configuration variables:
+#
+# SYS_INCLUDE "symlinks": symlinks to include directories are created.
+# This may not work 100% properly for all headers.
+#
+# "copies": directories are made, if necessary, and headers
+# are installed into them.
+#
+# Variables:
+#
+# INCSDIR Directory to install includes into (and/or make, and/or
+# symlink, depending on what's going on).
+#
+# KDIR Kernel directory to symlink to, if SYS_INCLUDE is symlinks.
+# If unspecified, no action will be taken when making include
+# for the directory if SYS_INCLUDE is symlinks.
+#
+# INCS Headers to install, if SYS_INCLUDE is copies.
+#
+# DEPINCS Headers to install which are built dynamically.
+#
+# SUBDIR Subdirectories to enter
+#
+# SYMLINKS Symlinks to make (unconditionally), a la bsd.links.mk.
+# Note that the original bits will be 'rm -rf'd rather than
+# just 'rm -f'd, to make the right thing happen with include
+# directories.
+#
+
+.if !target(__initialized__)
+__initialized__:
+.if exists(${.CURDIR}/../Makefile.inc)
+.include "${.CURDIR}/../Makefile.inc"
+.endif
+.include <bsd.own.mk>
+.MAIN: all
+.endif
+
+# Change SYS_INCLUDE in bsd.own.mk or /etc/mk.conf to "symlinks" if you
+# don't want copies
+SYS_INCLUDE?= copies
+
+# If DESTDIR is set, we're probably building a release, so force "copies".
+.if defined(DESTDIR) && (${DESTDIR} != "/" && !empty(DESTDIR))
+SYS_INCLUDE= copies
+.endif
+
+
+.PHONY: incinstall
+includes: ${INCS} incinstall
+
+
+.if ${SYS_INCLUDE} == "symlinks"
+
+# don't install includes, just make symlinks.
+
+.if defined(KDIR)
+SYMLINKS+= ${KDIR} ${INCSDIR}
+.endif
+
+.else # not symlinks
+
+# make sure the directory is OK, and install includes.
+
+incinstall:: ${DESTDIR}${INCSDIR}
+.PRECIOUS: ${DESTDIR}${INCSDIR}
+.PHONY: ${DESTDIR}${INCSDIR}
+
+${DESTDIR}${INCSDIR}:
+ @if [ ! -d ${.TARGET} ] || [ -h ${.TARGET} ] ; then \
+ echo creating ${.TARGET}; \
+ /bin/rm -rf ${.TARGET}; \
+ ${INSTALL} ${INSTPRIV} -d -o ${BINOWN} \
+ -g ${BINGRP} -m 755 ${.TARGET}; \
+ fi
+
+.if defined(INCS)
+incinstall:: ${INCS:@I@${DESTDIR}${INCSDIR}/$I@}
+.PRECIOUS: ${INCS:@I@${DESTDIR}${INCSDIR}/$I@}
+.if !defined(UPDATE)
+.PHONY: ${INCS:@I@${DESTDIR}${INCSDIR}/$I@}
+.endif
+
+__incinstall: .USE
+ @cmp -s ${.ALLSRC} ${.TARGET} > /dev/null 2>&1 || \
+ (echo "${INSTALL} ${RENAME} ${PRESERVE} ${INSTPRIV} -c \
+ -o ${BINOWN} -g ${BINGRP} -m ${NONBINMODE} \
+ ${.ALLSRC} ${.TARGET}" && \
+ ${INSTALL} ${RENAME} ${PRESERVE} ${INSTPRIV} -c \
+ -o ${BINOWN} \
+ -g ${BINGRP} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET})
+
+.for I in ${INCS:O:u}
+${DESTDIR}${INCSDIR}/$I: $I __incinstall
+.endfor
+.endif
+
+.if defined(DEPINCS)
+incinstall:: ${DEPINCS:@I@${DESTDIR}${INCSDIR}/$I@}
+.PRECIOUS: ${DEPINCS:@I@${DESTDIR}${INCSDIR}/$I@}
+.if !defined(UPDATE)
+.PHONY: ${DEPINCS:@I@${DESTDIR}${INCSDIR}/$I@}
+.endif
+
+__depincinstall: .USE
+ @cmp -s ${.ALLSRC} ${.TARGET} > /dev/null 2>&1 || \
+ (echo "${INSTALL} ${RENAME} ${PRESERVE} -c \
+ -o ${BINOWN} \
+ -g ${BINGRP} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET}" && \
+ ${INSTALL} ${RENAME} ${PRESERVE} -c -o ${BINOWN} \
+ -g ${BINGRP} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET})
+
+.for I in ${DEPINCS:O:u}
+${DESTDIR}${INCSDIR}/$I: $I __depincinstall
+.endfor
+.endif
+
+.endif # not symlinks
+
+.if defined(SYMLINKS) && !empty(SYMLINKS)
+incinstall::
+ @(set ${SYMLINKS}; \
+ while test $$# -ge 2; do \
+ l=$$1; \
+ shift; \
+ t=${DESTDIR}$$1; \
+ shift; \
+ if [ -h $$t ]; then \
+ cur=`ls -ld $$t | awk '{print $$NF}'` ; \
+ if [ "$$cur" = "$$l" ]; then \
+ continue ; \
+ fi; \
+ fi; \
+ echo "$$t -> $$l"; \
+ rm -rf $$t; ln -s $$l $$t; \
+ done; )
+.endif
+
+.if !target(incinstall)
+incinstall::
+.endif
+
+.include <bsd.subdir.mk>
diff --git a/pkgtools/bootstrap-mk-files/files/bsd.kmod.mk b/pkgtools/bootstrap-mk-files/files/bsd.kmod.mk
new file mode 100644
index 00000000000..ab5adb4b0ea
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/bsd.kmod.mk
@@ -0,0 +1,98 @@
+# $NetBSD: bsd.kmod.mk,v 1.1.1.1 2006/07/14 23:13:00 jlam Exp $
+
+.if !target(__initialized__)
+__initialized__:
+.if exists(${.CURDIR}/../Makefile.inc)
+.include "${.CURDIR}/../Makefile.inc"
+.endif
+.include <bsd.own.mk>
+.include <bsd.obj.mk>
+.include <bsd.depall.mk>
+.MAIN: all
+.endif
+
+.PHONY: cleankmod kmodinstall load unload
+realinstall: kmodinstall
+clean cleandir: cleankmod
+
+S?= /sys
+KERN= $S/kern
+
+CFLAGS+= ${COPTS} -D_KERNEL -D_LKM -I. -I${.CURDIR} -I$S -I$S/arch
+
+DPSRCS+= ${SRCS:M*.l:.l=.c} ${SRCS:M*.y:.y=.c}
+CLEANFILES+= ${DPSRCS}
+.if defined(YHEADER)
+CLEANFILES+= ${SRCS:M*.y:.y=.h}
+.endif
+
+OBJS+= ${SRCS:N*.h:N*.sh:R:S/$/.o/g}
+
+.if !defined(PROG)
+PROG= ${KMOD}.o
+.endif
+
+${PROG}: ${DPSRCS} ${OBJS} ${DPADD}
+ ${LD} -r ${LDFLAGS} -o tmp.o ${OBJS}
+ mv tmp.o ${.TARGET}
+
+.if !defined(MAN)
+MAN= ${KMOD}.4
+.endif
+
+realall: machine-links ${PROG}
+
+.PHONY: machine-links
+beforedepend: machine-links
+machine-links:
+ -rm -f machine && \
+ ln -s $S/arch/${MACHINE}/include machine
+ -rm -f ${MACHINE_ARCH} && \
+ ln -s $S/arch/${MACHINE_ARCH}/include ${MACHINE_ARCH}
+CLEANFILES+=machine ${MACHINE_ARCH}
+
+cleankmod:
+ rm -f a.out [Ee]rrs mklog core *.core \
+ ${PROG} ${OBJS} ${LOBJS} ${CLEANFILES}
+
+#
+# define various install targets
+#
+.if !target(kmodinstall)
+kmodinstall:: ${DESTDIR}${KMODDIR}/${PROG}
+.PRECIOUS: ${DESTDIR}${KMODDIR}/${PROG}
+.if !defined(UPDATE)
+.PHONY: ${DESTDIR}${KMODDIR}/${PROG}
+.endif
+
+__kmodinstall: .USE
+ ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${KMODOWN} \
+ -g ${KMODGRP} -m ${KMODMODE} ${.ALLSRC} ${.TARGET}
+
+.if !defined(BUILD) && !make(all) && !make(${PROG})
+${DESTDIR}${KMODDIR}/${PROG}: .MADE
+.endif
+${DESTDIR}${KMODDIR}/${PROG}: ${PROG} __kmodinstall
+.endif
+
+lint: ${LOBJS}
+.if defined(LOBJS) && !empty(LOBJS)
+ ${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} ${LOBJS} ${LDADD}
+.endif
+
+.if !target(load)
+load: ${PROG}
+ /sbin/modload ${KMOD_LOADFLAGS} -o ${KMOD} -e${KMOD}_lkmentry ${PROG}
+.endif
+
+.if !target(unload)
+unload:
+ /sbin/modunload -n ${KMOD}
+.endif
+
+.include <bsd.man.mk>
+.include <bsd.links.mk>
+.include <bsd.dep.mk>
+.include <bsd.sys.mk>
+
+.-include "machine/Makefile.inc"
diff --git a/pkgtools/bootstrap-mk-files/files/bsd.lib.mk b/pkgtools/bootstrap-mk-files/files/bsd.lib.mk
new file mode 100644
index 00000000000..73564817c7e
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/bsd.lib.mk
@@ -0,0 +1,524 @@
+# $NetBSD: bsd.lib.mk,v 1.1.1.1 2006/07/14 23:13:00 jlam Exp $
+# @(#)bsd.lib.mk 8.3 (Berkeley) 4/22/94
+
+.if !target(__initialized__)
+__initialized__:
+.if exists(${.CURDIR}/../Makefile.inc)
+.include "${.CURDIR}/../Makefile.inc"
+.endif
+.include <bsd.own.mk>
+.include <bsd.obj.mk>
+.include <bsd.depall.mk>
+.MAIN: all
+.endif
+
+.PHONY: checkver cleanlib libinstall
+realinstall: checkver libinstall
+clean cleandir: cleanlib
+
+.if exists(${SHLIB_VERSION_FILE})
+SHLIB_MAJOR != . ${SHLIB_VERSION_FILE} ; echo $$major
+SHLIB_MINOR != . ${SHLIB_VERSION_FILE} ; echo $$minor
+SHLIB_TEENY != . ${SHLIB_VERSION_FILE} ; echo $$teeny
+
+# Check for higher installed library versions.
+.if !defined(NOCHECKVER) && !defined(NOCHECKVER_${LIB}) && \
+ exists(${BSDSRCDIR}/lib/checkver)
+checkver:
+ @(cd ${.CURDIR} && \
+ sh ${BSDSRCDIR}/lib/checkver -v ${SHLIB_VERSION_FILE} \
+ -d ${DESTDIR}${LIBDIR} ${LIB})
+.endif
+.endif
+
+.if !target(checkver)
+checkver:
+.endif
+
+print-shlib-major:
+.if defined(SHLIB_MAJOR)
+ @echo ${SHLIB_MAJOR}
+.else
+ @false
+.endif
+
+print-shlib-minor:
+.if defined(SHLIB_MINOR)
+ @echo ${SHLIB_MINOR}
+.else
+ @false
+.endif
+
+print-shlib-teeny:
+.if defined(SHLIB_TEENY)
+ @echo ${SHLIB_TEENY}
+.else
+ @false
+.endif
+
+.if defined(SHLIB_MAJOR) && !empty(SHLIB_MAJOR)
+.if defined(SHLIB_MINOR) && !empty(SHLIB_MINOR)
+.if defined(SHLIB_TEENY) && !empty(SHLIB_TEENY)
+SHLIB_FULLVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR}.${SHLIB_TEENY}
+.else
+SHLIB_FULLVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR}
+.endif
+.else
+SHLIB_FULLVERSION=${SHLIB_MAJOR}
+.endif
+.endif
+
+# add additional suffixes not exported.
+# .po is used for profiling object files.
+# .so is used for PIC object files.
+.SUFFIXES: .out .a .ln .so .po .o .s .S .c .cc .C .m .F .f .r .y .l .cl .p .h
+.SUFFIXES: .sh .m4 .m
+
+
+# Set PICFLAGS to cc flags for producing position-independent code,
+# if not already set. Includes -DPIC, if required.
+
+# Data-driven table using make variables to control how shared libraries
+# are built for different platforms and object formats.
+# OBJECT_FMT: currently either "ELF" or "a.out", from <bsd.own.mk>
+# SHLIB_SOVERSION: version number to be compiled into a shared library
+# via -soname. Usualy ${SHLIB_MAJOR} on ELF.
+# NetBSD/pmax used to use ${SHLIB_MAJOR}[.${SHLIB_MINOR}
+# [.${SHLIB_TEENY}]]
+# SHLIB_SHFLAGS: Flags to tell ${LD} to emit shared library.
+# with ELF, also set shared-lib version for ld.so.
+# SHLIB_LDSTARTFILE: support .o file, call C++ file-level constructors
+# SHLIB_LDENDFILE: support .o file, call C++ file-level destructors
+# FPICFLAGS: flags for ${FC} to compile .[fF] files to .so objects.
+# CPPICFLAGS: flags for ${CPP} to preprocess .[sS] files for ${AS}
+# CPICFLAGS: flags for ${CC} to compile .[cC] files to .so objects.
+# CAPICFLAGS flags for {$CC} to compiling .[Ss] files
+# (usually just ${CPPPICFLAGS} ${CPICFLAGS})
+# APICFLAGS: flags for ${AS} to assemble .[sS] to .so objects.
+
+.if ${MACHINE_ARCH} == "alpha"
+ # Alpha-specific shared library flags
+FPICFLAGS ?= -fPIC
+CPICFLAGS ?= -fPIC -DPIC
+CPPPICFLAGS?= -DPIC
+CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
+APICFLAGS ?=
+.elif ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"
+ # mips-specific shared library flags
+
+# On mips, all libs are compiled with ABIcalls, not just sharedlibs.
+MKPICLIB= no
+
+# so turn shlib PIC flags on for ${AS}.
+AINC+=-DABICALLS
+AFLAGS+= -fPIC
+AS+= -KPIC
+
+.elif ${MACHINE_ARCH} == "vax" && ${OBJECT_FMT} == "ELF"
+# On the VAX, all object are PIC by default, not just sharedlibs.
+MKPICLIB= no
+
+.elif (${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64") && \
+ ${OBJECT_FMT} == "ELF"
+
+FPICFLAGS ?= -fPIC
+CPICFLAGS ?= -fPIC -DPIC
+CPPPICFLAGS?= -DPIC
+CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
+APICFLAGS ?= -KPIC
+
+.else
+
+# Platform-independent flags for NetBSD a.out shared libraries (and PowerPC)
+SHLIB_LDSTARTFILE=
+SHLIB_LDENDFILE=
+SHLIB_SOVERSION=${SHLIB_FULLVERSION}
+SHLIB_SHFLAGS=
+FPICFLAGS ?= -fPIC
+CPICFLAGS?= -fPIC -DPIC
+CPPPICFLAGS?= -DPIC
+CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
+APICFLAGS?= -k
+
+.endif
+
+MKPICLIB?= yes
+
+# Platform-independent linker flags for ELF shared libraries
+.if ${OBJECT_FMT} == "ELF"
+SHLIB_SOVERSION= ${SHLIB_MAJOR}
+SHLIB_SHFLAGS= -soname lib${LIB}.so.${SHLIB_SOVERSION}
+SHLIB_LDSTARTFILE?= ${DESTDIR}/usr/lib/crtbeginS.o
+SHLIB_LDENDFILE?= ${DESTDIR}/usr/lib/crtendS.o
+.endif
+
+CFLAGS+= ${COPTS}
+FFLAGS+= ${FOPTS}
+
+.c.o:
+.if defined(COPTS) && !empty(COPTS:M*-g*)
+ ${COMPILE.c} ${.IMPSRC}
+.else
+ @echo ${COMPILE.c:Q} ${.IMPSRC}
+ @${COMPILE.c} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.c.po:
+.if defined(COPTS) && !empty(COPTS:M*-g*)
+ ${COMPILE.c} -pg ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.c:Q} -pg ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.c} -pg ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.c.so:
+.if defined(COPTS) && !empty(COPTS:M*-g*)
+ ${COMPILE.c} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.c:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.c} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.c.ln:
+ ${LINT} ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i ${.IMPSRC}
+
+.cc.o .C.o:
+.if defined(COPTS) && !empty(COPTS:M*-g*)
+ ${COMPILE.cc} ${.IMPSRC}
+.else
+ @echo ${COMPILE.cc:Q} ${.IMPSRC}
+ @${COMPILE.cc} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.cc.po .C.po:
+.if defined(COPTS) && !empty(COPTS:M*-g*)
+ ${COMPILE.cc} -pg ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.cc:Q} -pg ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.cc} -pg ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.cc.so .C.so:
+.if defined(COPTS) && !empty(COPTS:M*-g*)
+ ${COMPILE.cc} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.cc:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.cc} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.f.o:
+.if defined(FOPTS) && !empty(FOPTS:M*-g*)
+ ${COMPILE.f} ${.IMPSRC}
+.else
+ @echo ${COMPILE.f:Q} ${.IMPSRC}
+ @${COMPILE.f} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.f.po:
+.if defined(FOPTS) && !empty(FOPTS:M*-g*)
+ ${COMPILE.f} -pg ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.f:Q} -pg ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.f} -pg ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.f.so:
+.if defined(FOPTS) && !empty(FOPTS:M*-g*)
+ ${COMPILE.f} ${FPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.f:Q} ${FPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.f} ${FPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.f.ln:
+ ${ECHO} Skipping lint for Fortran libraries.
+
+.m.o:
+.if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
+ ${COMPILE.m} ${.IMPSRC}
+.else
+ @echo ${COMPILE.m:Q} ${.IMPSRC}
+ @${COMPILE.m} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.m.po:
+.if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
+ ${COMPILE.m} -pg ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.m:Q} -pg ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.m} -pg ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.m.so:
+.if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
+ ${COMPILE.m} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.m:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.m} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.S.o .s.o:
+ @echo ${COMPILE.S:Q} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC}
+ @${COMPILE.S} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+
+.S.po .s.po:
+ @echo ${COMPILE.S:Q} -DGPROF -DPROF ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.S} -DGPROF -DPROF ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+
+.S.so .s.so:
+ @echo ${COMPILE.S:Q} ${CAPICFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.S} ${CAPICFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+
+.if ${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
+ || ${MKLINKLIB} != "no"
+_LIBS=lib${LIB}.a
+.else
+_LIBS=
+.endif
+
+OBJS+=${SRCS:N*.h:N*.sh:R:S/$/.o/g}
+
+.if ${MKPROFILE} != "no"
+_LIBS+=lib${LIB}_p.a
+POBJS+=${OBJS:.o=.po}
+.endif
+
+.if ${MKPIC} != "no"
+.if ${MKPICLIB} == "no"
+SOLIB=lib${LIB}.a
+.else
+SOLIB=lib${LIB}_pic.a
+_LIBS+=${SOLIB}
+SOBJS+=${OBJS:.o=.so}
+.endif
+.if defined(SHLIB_FULLVERSION)
+_LIBS+=lib${LIB}.so.${SHLIB_FULLVERSION}
+.endif
+.endif
+
+LOBJS+=${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
+.if ${MKLINT} != "no" && ${MKLINKLIB} != "no" && !empty(LOBJS)
+_LIBS+=llib-l${LIB}.ln
+.endif
+
+.if ${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
+ || ${MKLINKLIB} != "no"
+ALLOBJS=${OBJS} ${POBJS} ${SOBJS}
+.else
+ALLOBJS=${POBJS} ${SOBJS}
+.endif
+.if ${MKLINT} != "no" && ${MKLINKLIB} != "no" && !empty(LOBJS)
+ALLOBJS+=${LOBJS}
+.endif
+.NOPATH: ${ALLOBJS} ${_LIBS}
+
+realall: ${SRCS} ${ALLOBJS:O} ${_LIBS}
+
+__archivebuild: .USE
+ @rm -f ${.TARGET}
+ ${AR} cq ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}`
+ ${RANLIB} ${.TARGET}
+
+__archiveinstall: .USE
+ ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
+ -g ${LIBGRP} -m 600 ${.ALLSRC} ${.TARGET}
+ ${RANLIB} -t ${.TARGET}
+ chmod ${LIBMODE} ${.TARGET}
+
+DPSRCS+= ${SRCS:M*.l:.l=.c} ${SRCS:M*.y:.y=.c}
+CLEANFILES+= ${DPSRCS}
+.if defined(YHEADER)
+CLEANFILES+= ${SRCS:M*.y:.y=.h}
+.endif
+
+lib${LIB}.a:: ${OBJS} __archivebuild
+ @echo building standard ${LIB} library
+
+lib${LIB}_p.a:: ${POBJS} __archivebuild
+ @echo building profiled ${LIB} library
+
+lib${LIB}_pic.a:: ${SOBJS} __archivebuild
+ @echo building shared object ${LIB} library
+
+lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOLIB} ${DPADD} \
+ ${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}
+ @echo building shared ${LIB} library \(version ${SHLIB_FULLVERSION}\)
+ @rm -f lib${LIB}.so.${SHLIB_FULLVERSION}
+.if defined(DESTDIR)
+ $(LD) -nostdlib -x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
+ ${SHLIB_LDSTARTFILE} \
+ --whole-archive ${SOLIB} \
+ --no-whole-archive ${LDADD} \
+ -L${DESTDIR}${LIBDIR} ${RPATH_FLAG}${LIBDIR} \
+ ${SHLIB_LDENDFILE}
+.else
+ $(LD) -x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
+ ${SHLIB_LDSTARTFILE} \
+ --whole-archive ${SOLIB} --no-whole-archive ${LDADD} \
+ ${SHLIB_LDENDFILE}
+.endif
+.if ${OBJECT_FMT} == "ELF"
+ ln -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.${SHLIB_MAJOR}.tmp
+ mv -f lib${LIB}.so.${SHLIB_MAJOR}.tmp lib${LIB}.so.${SHLIB_MAJOR}
+ ln -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.tmp
+ mv -f lib${LIB}.so.tmp lib${LIB}.so
+.endif
+
+.if !empty(LOBJS)
+LLIBS?= -lc
+llib-l${LIB}.ln: ${LOBJS}
+ @echo building llib-l${LIB}.ln
+ @rm -f llib-l${LIB}.ln
+ @${LINT} -C${LIB} ${.ALLSRC} ${LLIBS}
+.endif
+
+cleanlib:
+ rm -f a.out [Ee]rrs mklog core *.core ${CLEANFILES}
+ rm -f lib${LIB}.a ${OBJS}
+ rm -f lib${LIB}_p.a ${POBJS}
+ rm -f lib${LIB}_pic.a lib${LIB}.so.* lib${LIB}.so ${SOBJS}
+ rm -f llib-l${LIB}.ln ${LOBJS}
+
+.if defined(SRCS)
+afterdepend: .depend
+ @(TMP=/tmp/_depend$$$$; \
+ sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po \1.so \1.ln:/' \
+ < .depend > $$TMP; \
+ mv $$TMP .depend)
+.endif
+
+.if !target(libinstall)
+# Make sure it gets defined, in case MKPIC==no && MKLINKLIB==no
+libinstall::
+
+.if ${MKLINKLIB} != "no"
+libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.a
+.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.a
+.if !defined(UPDATE)
+.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}.a
+.endif
+
+.if !defined(BUILD) && !make(all) && !make(lib${LIB}.a)
+${DESTDIR}${LIBDIR}/lib${LIB}.a: .MADE
+.endif
+${DESTDIR}${LIBDIR}/lib${LIB}.a: lib${LIB}.a __archiveinstall
+.endif
+
+.if ${MKPROFILE} != "no"
+libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
+.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
+.if !defined(UPDATE)
+.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
+.endif
+
+.if !defined(BUILD) && !make(all) && !make(lib${LIB}_p.a)
+${DESTDIR}${LIBDIR}/lib${LIB}_p.a: .MADE
+.endif
+${DESTDIR}${LIBDIR}/lib${LIB}_p.a: lib${LIB}_p.a __archiveinstall
+.endif
+
+.if ${MKPIC} != "no" && ${MKPICINSTALL} != "no"
+libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
+.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
+.if !defined(UPDATE)
+.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
+.endif
+
+.if !defined(BUILD) && !make(all) && !make(lib${LIB}_pic.a)
+${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: .MADE
+.endif
+.if ${MKPICLIB} == "no"
+${DESTDIR}${LIBDIR}/lib${LIB}_pic.a:
+ rm -f ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
+ ln -s lib${LIB}.a ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
+.else
+${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: lib${LIB}_pic.a __archiveinstall
+.endif
+.endif
+
+.if ${MKPIC} != "no" && defined(SHLIB_FULLVERSION)
+libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
+.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
+.if !defined(UPDATE)
+.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
+.endif
+
+.if !defined(BUILD) && !make(all) && !make(lib${LIB}.so.${SHLIB_FULLVERSION})
+${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: .MADE
+.endif
+${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: lib${LIB}.so.${SHLIB_FULLVERSION}
+ ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
+ -g ${LIBGRP} -m ${LIBMODE} ${.ALLSRC} ${.TARGET}
+.if ${OBJECT_FMT} == "a.out" && !defined(DESTDIR)
+ /sbin/ldconfig -m ${LIBDIR}
+.endif
+.if ${OBJECT_FMT} == "ELF"
+ ln -sf lib${LIB}.so.${SHLIB_FULLVERSION}\
+ ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.tmp
+ mv -f ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.tmp\
+ ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}
+.if ${MKLINKLIB} != "no"
+ ln -sf lib${LIB}.so.${SHLIB_FULLVERSION}\
+ ${DESTDIR}${LIBDIR}/lib${LIB}.so.tmp
+ mv -f ${DESTDIR}${LIBDIR}/lib${LIB}.so.tmp\
+ ${DESTDIR}${LIBDIR}/lib${LIB}.so
+.endif
+.endif
+.endif
+
+.if ${MKLINT} != "no" && ${MKLINKLIB} != "no" && !empty(LOBJS)
+libinstall:: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
+.PRECIOUS: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
+.if !defined(UPDATE)
+.PHONY: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
+.endif
+
+.if !defined(BUILD) && !make(all) && !make(llib-l${LIB}.ln)
+${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: .MADE
+.endif
+${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: llib-l${LIB}.ln
+ ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
+ -g ${LIBGRP} -m ${LIBMODE} ${.ALLSRC} ${DESTDIR}${LINTLIBDIR}
+.endif
+.endif
+
+.include <bsd.man.mk>
+.include <bsd.nls.mk>
+.include <bsd.files.mk>
+.include <bsd.inc.mk>
+.include <bsd.links.mk>
+.include <bsd.dep.mk>
+.include <bsd.sys.mk>
+
+# Make sure all of the standard targets are defined, even if they do nothing.
+lint regress:
diff --git a/pkgtools/bootstrap-mk-files/files/bsd.links.mk b/pkgtools/bootstrap-mk-files/files/bsd.links.mk
new file mode 100644
index 00000000000..fcb54fa46b5
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/bsd.links.mk
@@ -0,0 +1,44 @@
+# $NetBSD: bsd.links.mk,v 1.1.1.1 2006/07/14 23:13:00 jlam Exp $
+
+.PHONY: linksinstall
+realinstall: linksinstall
+
+.if defined(SYMLINKS) && !empty(SYMLINKS)
+linksinstall::
+ @(set ${SYMLINKS}; \
+ while test $$# -ge 2; do \
+ l=$$1; \
+ shift; \
+ t=${DESTDIR}$$1; \
+ shift; \
+ if [ -h $$t ]; then \
+ cur=`ls -ld $$t | awk '{print $$NF}'` ; \
+ if [ "$$cur" = "$$l" ]; then \
+ continue ; \
+ fi; \
+ fi; \
+ echo "$$t -> $$l"; \
+ rm -rf $$t; ln -s $$l $$t; \
+ done; )
+.endif
+.if defined(LINKS) && !empty(LINKS)
+linksinstall::
+ @(set ${LINKS}; \
+ echo ".include <bsd.own.mk>"; \
+ while test $$# -ge 2; do \
+ l=${DESTDIR}$$1; \
+ shift; \
+ t=${DESTDIR}$$1; \
+ shift; \
+ echo "realall: $$t"; \
+ echo ".PHONY: $$t"; \
+ echo "$$t:"; \
+ echo " @echo \"$$t -> $$l\""; \
+ echo " @rm -f $$t; ln $$l $$t"; \
+ done; \
+ ) | ${MAKE} -f- all
+.endif
+
+.if !target(linksinstall)
+linksinstall:
+.endif
diff --git a/pkgtools/bootstrap-mk-files/files/bsd.man.mk b/pkgtools/bootstrap-mk-files/files/bsd.man.mk
new file mode 100644
index 00000000000..cb28ef8a44b
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/bsd.man.mk
@@ -0,0 +1,201 @@
+# $NetBSD: bsd.man.mk,v 1.1.1.1 2006/07/14 23:13:00 jlam Exp $
+# @(#)bsd.man.mk 8.1 (Berkeley) 6/8/93
+
+.if !target(__initialized__)
+__initialized__:
+.if exists(${.CURDIR}/../Makefile.inc)
+.include "${.CURDIR}/../Makefile.inc"
+.endif
+.include <bsd.own.mk>
+.include <bsd.obj.mk>
+.include <bsd.depall.mk>
+.MAIN: all
+.endif
+
+.PHONY: catinstall maninstall catpages manpages catlinks manlinks cleanman html installhtml cleanhtml
+.if ${MKMAN} != "no"
+realinstall: ${MANINSTALL}
+.endif
+cleandir: cleanman
+
+TMACDIR?= ${DESTDIR}/usr/share/groff/tmac
+HTMLDIR?= ${DESTDIR}/usr/share/man
+.if exists(${TMACDIR}/tmac.andoc) && exists(${TMACDIR}/tmac.doc)
+CATDEPS?= ${TMACDIR}/tmac.andoc \
+ ${TMACDIR}/tmac.doc
+.endif
+MANTARGET?= cat
+NROFF?= nroff -Tascii
+GROFF?= groff -Tascii
+TBL?= tbl
+
+
+.SUFFIXES: .1 .2 .3 .4 .5 .6 .7 .8 .9 \
+ .cat1 .cat2 .cat3 .cat4 .cat5 .cat6 .cat7 .cat8 .cat9 \
+ .html1 .html2 .html3 .html4 .html5 .html6 .html7 .html8 .html9
+
+.9.cat9 .8.cat8 .7.cat7 .6.cat6 .5.cat5 .4.cat4 .3.cat3 .2.cat2 .1.cat1: \
+ ${CATDEPS}
+.if !defined(USETBL)
+ @echo "${NROFF} -mandoc ${.IMPSRC} > ${.TARGET}"
+ @${NROFF} -mandoc ${.IMPSRC} > ${.TARGET} || \
+ (rm -f ${.TARGET}; false)
+.else
+ @echo "${TBL} ${.IMPSRC} | ${NROFF} -mandoc > ${.TARGET}"
+ @${TBL} ${.IMPSRC} | ${NROFF} -mandoc > ${.TARGET} || \
+ (rm -f ${.TARGET}; false)
+.endif
+
+.9.html9 .8.html8 .7.html7 .6.html6 .5.html5 .4.html4 .3.html3 .2.html2 .1.html1: \
+ ${CATDEPS}
+.if !defined(USETBL)
+ @echo "${GROFF} -mdoc2html -P-b -P-u -P-o ${.IMPSRC} > ${.TARGET}"
+ @${GROFF} -mdoc2html -P-b -P-u -P-o ${.IMPSRC} > ${.TARGET} || \
+ (rm -f ${.TARGET}; false)
+.else
+ @echo "${TBL} ${.IMPSRC} | ${GROFF} -mdoc2html -P-b -P-u -P-o > ${.TARGET}"
+ @cat ${.IMPSRC} | ${GROFF} -mdoc2html -P-b -P-u -P-o > ${.TARGET} || \
+ (rm -f ${.TARGET}; false)
+.endif
+
+.if defined(MAN) && !empty(MAN)
+MANPAGES= ${MAN}
+CATPAGES= ${MANPAGES:C/(.*).([1-9])/\1.cat\2/}
+.NOPATH: ${CATPAGES}
+.if !defined(NOHTML)
+HTMLPAGES= ${MANPAGES:C/(.*).([1-9])/\1.html\2/}
+.endif
+.endif
+
+MINSTALL= ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} \
+ -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
+
+.if defined(MANZ)
+# chown and chmod are done afterward automatically
+MCOMPRESS= gzip -cf
+MCOMPRESSSUFFIX= .gz
+.endif
+
+catinstall: catlinks
+maninstall: manlinks
+
+__installpage: .USE
+.if defined(MCOMPRESS) && !empty(MCOMPRESS)
+ @rm -f ${.TARGET}
+ ${MCOMPRESS} ${.ALLSRC} > ${.TARGET}
+ @chown ${MANOWN}:${MANGRP} ${.TARGET}
+ @chmod ${MANMODE} ${.TARGET}
+.else
+ @cmp -s ${.ALLSRC} ${.TARGET} > /dev/null 2>&1 || \
+ (echo "${MINSTALL} ${.ALLSRC} ${.TARGET}" && \
+ ${MINSTALL} ${.ALLSRC} ${.TARGET})
+.endif
+
+
+# Rules for cat'ed man page installation
+.if defined(CATPAGES) && !empty(CATPAGES) && ${MKCATPAGES} != "no"
+catpages:: ${CATPAGES:@P@${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}@}
+.PRECIOUS: ${CATPAGES:@P@${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}@}
+.if !defined(UPDATE)
+.PHONY: ${CATPAGES:@P@${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}@}
+.endif
+
+. for P in ${CATPAGES:O:u}
+. if !defined(BUILD) && !make(all) && !make(${P})
+${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}: .MADE
+. endif
+${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}: ${P} __installpage
+. endfor
+.else
+catpages::
+.endif
+
+# Rules for source page installation
+.if defined(MANPAGES) && !empty(MANPAGES)
+manpages:: ${MANPAGES:@P@${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P}${MCOMPRESSSUFFIX}@}
+.PRECIOUS: ${MANPAGES:@P@${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P}${MCOMPRESSSUFFIX}@}
+.if !defined(UPDATE)
+.PHONY: ${MANPAGES:@P@${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P}${MCOMPRESSSUFFIX}@}
+.endif
+
+. for P in ${MANPAGES:O:u}
+${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P}${MCOMPRESSSUFFIX}: ${P} __installpage
+. endfor
+.else
+manpages::
+.endif
+
+.if ${MKCATPAGES} != "no"
+catlinks: catpages
+.if defined(MLINKS) && !empty(MLINKS)
+ @set ${MLINKS}; \
+ while test $$# -ge 2; do \
+ name=$$1; \
+ shift; \
+ dir=${DESTDIR}${MANDIR}/cat$${name##*.}; \
+ l=$${dir}${MANSUBDIR}/$${name%.*}.0${MCOMPRESSSUFFIX}; \
+ name=$$1; \
+ shift; \
+ dir=${DESTDIR}${MANDIR}/cat$${name##*.}; \
+ t=$${dir}${MANSUBDIR}/$${name%.*}.0${MCOMPRESSSUFFIX}; \
+ if test $$l -nt $$t -o ! -f $$t; then \
+ echo $$t -\> $$l; \
+ ln -f $$l $$t; \
+ fi; \
+ done
+.endif
+.else
+catlinks:
+.endif
+
+manlinks: manpages
+.if defined(MLINKS) && !empty(MLINKS)
+ @set ${MLINKS}; \
+ while test $$# -ge 2; do \
+ name=$$1; \
+ shift; \
+ dir=${DESTDIR}${MANDIR}/man$${name##*.}; \
+ l=$${dir}${MANSUBDIR}/$${name}${MCOMPRESSSUFFIX}; \
+ name=$$1; \
+ shift; \
+ dir=${DESTDIR}${MANDIR}/man$${name##*.}; \
+ t=$${dir}${MANSUBDIR}/$${name}${MCOMPRESSSUFFIX}; \
+ if test $$l -nt $$t -o ! -f $$t; then \
+ echo $$t -\> $$l; \
+ ln -f $$l $$t; \
+ fi; \
+ done
+.endif
+
+# Html rules
+html: ${HTMLPAGES}
+
+.if defined(HTMLPAGES) && !empty(HTMLPAGES)
+.for P in ${HTMLPAGES:O:u}
+${HTMLDIR}/${P:T:E}/${P:T:R}.html: ${P}
+ ${MINSTALL} ${.ALLSRC} ${.TARGET}
+.endfor
+.endif
+installhtml: ${HTMLPAGES:@P@${HTMLDIR}/${P:T:E}/${P:T:R}.html@}
+
+cleanhtml:
+.if defined(HTMLPAGES) && !empty(HTMLPAGES)
+ rm -f ${HTMLPAGES}
+.endif
+
+
+.if defined(CATPAGES)
+.if ${MKCATPAGES} != "no" && ${MKMAN} != "no"
+realall: ${CATPAGES}
+.else
+realall:
+.endif
+
+cleanman:
+ rm -f ${CATPAGES}
+.else
+cleanman:
+.endif
+
+# Make sure all of the standard targets are defined, even if they do nothing.
+clean depend includes lint regress tags:
diff --git a/pkgtools/bootstrap-mk-files/files/bsd.nls.mk b/pkgtools/bootstrap-mk-files/files/bsd.nls.mk
new file mode 100644
index 00000000000..9f1ee6d685a
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/bsd.nls.mk
@@ -0,0 +1,65 @@
+# $NetBSD: bsd.nls.mk,v 1.1.1.1 2006/07/14 23:13:00 jlam Exp $
+
+.if !target(__initialized__)
+__initialized__:
+.if exists(${.CURDIR}/../Makefile.inc)
+.include "${.CURDIR}/../Makefile.inc"
+.endif
+.MAIN: all
+.endif
+
+.PHONY: cleannls nlsinstall
+cleandir: cleannls
+
+.SUFFIXES: .cat .msg
+
+.msg.cat:
+ @rm -f ${.TARGET}
+ gencat ${.TARGET} ${.IMPSRC}
+
+.if defined(NLS) && !empty(NLS)
+NLSALL= ${NLS:.msg=.cat}
+.NOPATH: ${NLSALL}
+
+NLSNAME?=${PROG:Ulib${LIB}}
+
+.if ${MKNLS} != "no"
+realinstall: nlsinstall
+realall: ${NLSALL}
+.endif
+
+cleannls:
+ rm -f ${NLSALL}
+
+nlsinstall:: ${DESTDIR}${NLSDIR}
+.PRECIOUS:: ${DESTDIR}${NLSDIR}
+.PHONY:: ${DESTDIR}${NLSDIR}
+
+${DESTDIR}${NLSDIR}:
+ @if [ ! -d ${.TARGET} ] || [ -h ${.TARGET} ] ; then \
+ echo creating ${.TARGET}; \
+ /bin/rm -rf ${.TARGET}; \
+ ${INSTALL} ${INSTPRIV} -d -o ${NLSOWN} -g ${NLSGRP} -m 755 \
+ ${.TARGET}; \
+ fi
+
+nlsinstall:: ${NLSALL:@F@${DESTDIR}${NLSDIR}/${F:T:R}/${NLSNAME}.cat@}
+.PRECIOUS: ${NLSALL:@F@${DESTDIR}${NLSDIR}/${F:T:R}/${NLSNAME}.cat@}
+.if !defined(UPDATE)
+.PHONY: ${NLSALL:@F@${DESTDIR}${NLSDIR}/${F:T:R}/${NLSNAME}.cat@}
+.endif
+
+__nlsinstall: .USE
+ ${INSTALL} ${INSTPRIV} -d -o ${NLSOWN} -g ${NLSGRP} ${.TARGET:H}
+ ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${NLSOWN} \
+ -g ${NLSGRP} -m ${NLSMODE} ${.ALLSRC} ${.TARGET}
+
+.for F in ${NLSALL:O:u}
+.if !defined(BUILD) && !make(all) && !make(${F})
+${DESTDIR}${NLSDIR}/${F:T:R}/${NLSNAME}.cat: .MADE
+.endif
+${DESTDIR}${NLSDIR}/${F:T:R}/${NLSNAME}.cat: ${F} __nlsinstall
+.endfor
+.else
+cleannls:
+.endif
diff --git a/pkgtools/bootstrap-mk-files/files/bsd.obj.mk b/pkgtools/bootstrap-mk-files/files/bsd.obj.mk
new file mode 100644
index 00000000000..d58baf2073d
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/bsd.obj.mk
@@ -0,0 +1,91 @@
+# $NetBSD: bsd.obj.mk,v 1.1.1.1 2006/07/14 23:13:01 jlam Exp $
+
+.if !target(__initialized_obj__)
+__initialized_obj__:
+.include <bsd.own.mk>
+.endif
+
+.if ${MKOBJ} == "no"
+obj:
+.else
+.if defined(MAKEOBJDIRPREFIX) || defined(MAKEOBJDIR)
+.if defined(MAKEOBJDIRPREFIX)
+__objdir:= ${MAKEOBJDIRPREFIX}${.CURDIR}
+.else
+__objdir:= ${MAKEOBJDIR}
+.endif
+# MAKEOBJDIR and MAKEOBJDIRPREFIX are env variables supported
+# by make(1). We simply mkdir -p the specified path.
+# If that fails - we do a mkdir to get the appropriate error message
+# before bailing out.
+obj:
+ @if test ! -d ${__objdir}; then \
+ mkdir -p ${__objdir}; \
+ if test ! -d ${__objdir}; then \
+ mkdir ${__objdir}; exit 1; \
+ fi; \
+ echo "${.CURDIR} -> ${__objdir}"; \
+ fi
+.else
+.if defined(OBJMACHINE)
+__objdir= obj.${MACHINE}
+.else
+__objdir= obj
+.endif
+
+.if defined(USR_OBJMACHINE)
+__usrobjdir= ${BSDOBJDIR}.${MACHINE}
+__usrobjdirpf=
+.else
+__usrobjdir= ${BSDOBJDIR}
+.if defined(OBJMACHINE)
+__usrobjdirpf= .${MACHINE}
+.else
+__usrobjdirpf=
+.endif
+.endif
+
+PAWD?= /bin/pwd
+
+obj:
+ @cd ${.CURDIR}; \
+ here=`${PAWD}`; subdir=$${here#${BSDSRCDIR}/}; \
+ if test $$here != $$subdir ; then \
+ if test ! -d ${__usrobjdir}; then \
+ echo "BSDOBJDIR ${__usrobjdir} does not exist, bailing..."; \
+ exit 1; \
+ fi; \
+ dest=${__usrobjdir}/$$subdir${__usrobjdirpf} ; \
+ if [ -h $$here/${__objdir} ]; then \
+ curtarg=`ls -ld $$here/${__objdir} | awk '{print $$NF}'` ; \
+ if [ "$$curtarg" = "$$dest" ]; then \
+ : ; \
+ else \
+ echo "$$here/${__objdir} -> $$dest"; \
+ rm -rf ${__objdir}; \
+ ln -s $$dest ${__objdir}; \
+ fi; \
+ else \
+ echo "$$here/${__objdir} -> $$dest"; \
+ rm -rf ${__objdir}; \
+ ln -s $$dest ${__objdir}; \
+ fi; \
+ if test ! -d $$dest; then \
+ mkdir -p $$dest; \
+ else \
+ true; \
+ fi; \
+ else \
+ true ; \
+ dest=$$here/${__objdir} ; \
+ if test ! -d ${__objdir} || test -h ${__objdir}; then \
+ echo "making $$dest" ; \
+ rm -f ${__objdir}; \
+ mkdir $$dest; \
+ fi ; \
+ fi;
+.endif
+.endif
+
+print-objdir:
+ @echo ${.OBJDIR}
diff --git a/pkgtools/bootstrap-mk-files/files/bsd.prog.mk b/pkgtools/bootstrap-mk-files/files/bsd.prog.mk
new file mode 100644
index 00000000000..04e6ccf4aaf
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/bsd.prog.mk
@@ -0,0 +1,174 @@
+# $NetBSD: bsd.prog.mk,v 1.1.1.1 2006/07/14 23:13:01 jlam Exp $
+# @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94
+
+.if !target(__initialized__)
+__initialized__:
+.if exists(${.CURDIR}/../Makefile.inc)
+.include "${.CURDIR}/../Makefile.inc"
+.endif
+.include <bsd.own.mk>
+.include <bsd.obj.mk>
+.include <bsd.depall.mk>
+.MAIN: all
+.endif
+
+.PHONY: cleanprog proginstall scriptsinstall
+realinstall: proginstall scriptsinstall
+clean cleandir: cleanprog
+
+CFLAGS+= ${COPTS}
+
+# ELF platforms depend on crtbegin.o and crtend.o
+.if ${OBJECT_FMT} == "ELF" && ${MACHINE:Mirix} != ""
+LIBCRTBEGIN?= ${DESTDIR}/usr/lib/crtbegin.o
+LIBCRTEND?= ${DESTDIR}/usr/lib/crtend.o
+.else
+LIBCRTBEGIN?=
+LIBCRTEND?=
+.endif
+
+# here is where you can define what LIB* are
+.-include <libnames.mk>
+
+.if defined(SHAREDSTRINGS)
+CLEANFILES+=strings
+.c.o:
+ ${CC} -E ${CFLAGS} ${.IMPSRC} | xstr -c -
+ @${CC} ${CFLAGS} -c x.c -o ${.TARGET}
+ @rm -f x.c
+
+.cc.o:
+ ${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c -
+ @mv -f x.c x.cc
+ @${CXX} ${CXXFLAGS} -c x.cc -o ${.TARGET}
+ @rm -f x.cc
+
+.C.o:
+ ${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c -
+ @mv -f x.c x.C
+ @${CXX} ${CXXFLAGS} -c x.C -o ${.TARGET}
+ @rm -f x.C
+.endif
+
+
+.if defined(PROG)
+SRCS?= ${PROG}.c
+
+DPSRCS+= ${SRCS:M*.l:.l=.c} ${SRCS:M*.y:.y=.c}
+CLEANFILES+= ${DPSRCS}
+.if defined(YHEADER)
+CLEANFILES+= ${SRCS:M*.y:.y=.h}
+.endif
+
+.if !empty(SRCS:N*.h:N*.sh:N*.fth)
+OBJS+= ${SRCS:N*.h:N*.sh:N*.fth:R:S/$/.o/g}
+LOBJS+= ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
+.endif
+
+.if defined(OBJS) && !empty(OBJS)
+.NOPATH: ${OBJS}
+.if defined(DESTDIR)
+
+${PROG}: ${LIBCRT0} ${DPSRCS} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
+.if !commands(${PROG})
+ ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -nostdlib -Wl,-rpath-link,${DESTDIR}/usr/lib ${LIBCRT0} ${LIBCRTBEGIN} ${OBJS} ${LDADD} -L${DESTDIR}/usr/lib -lgcc -lc -lgcc ${LIBCRTEND}
+.endif
+
+.else
+
+${PROG}: ${LIBCRT0} ${DPSRCS} ${OBJS} ${LIBC} ${LIBCRTBEGIN} ${LIBCRTEND} ${DPADD}
+.if !commands(${PROG})
+ ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD}
+.endif
+
+.endif # defined(DESTDIR)
+.endif # defined(OBJS) && !empty(OBJS)
+
+.if !defined(MAN)
+MAN= ${PROG}.1
+.endif # !defined(MAN)
+.endif # defined(PROG)
+
+realall: ${PROG} ${SCRIPTS}
+
+cleanprog:
+ rm -f a.out [Ee]rrs mklog core *.core \
+ ${PROG} ${OBJS} ${LOBJS} ${CLEANFILES}
+
+.if defined(SRCS) && !target(afterdepend)
+afterdepend: .depend
+ @(TMP=/tmp/_depend$$$$; \
+ sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.ln:/' \
+ < .depend > $$TMP; \
+ mv $$TMP .depend)
+.endif
+
+.if defined(PROG) && !target(proginstall)
+PROGNAME?=${PROG}
+
+proginstall:: ${DESTDIR}${BINDIR}/${PROGNAME}
+.PRECIOUS: ${DESTDIR}${BINDIR}/${PROGNAME}
+.if !defined(UPDATE)
+.PHONY: ${DESTDIR}${BINDIR}/${PROGNAME}
+.endif
+
+__proginstall: .USE
+ ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${STRIPFLAG} ${INSTPRIV} \
+ -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} ${.ALLSRC} ${.TARGET}
+
+.if !defined(BUILD) && !make(all) && !make(${PROG})
+${DESTDIR}${BINDIR}/${PROGNAME}: .MADE
+.endif
+${DESTDIR}${BINDIR}/${PROGNAME}: ${PROG} __proginstall
+.endif
+
+.if !target(proginstall)
+proginstall::
+.endif
+
+.if defined(SCRIPTS) && !target(scriptsinstall)
+SCRIPTSDIR?=${BINDIR}
+SCRIPTSOWN?=${BINOWN}
+SCRIPTSGRP?=${BINGRP}
+SCRIPTSMODE?=${BINMODE}
+
+scriptsinstall:: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
+.PRECIOUS: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
+.if !defined(UPDATE)
+.PHONY: ${SCRIPTS:@S@${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}@}
+.endif
+
+__scriptinstall: .USE
+ ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} \
+ -o ${SCRIPTSOWN_${.ALLSRC:T}:U${SCRIPTSOWN}} \
+ -g ${SCRIPTSGRP_${.ALLSRC:T}:U${SCRIPTSGRP}} \
+ -m ${SCRIPTSMODE_${.ALLSRC:T}:U${SCRIPTSMODE}} \
+ ${.ALLSRC} ${.TARGET}
+
+.for S in ${SCRIPTS:O:u}
+.if !defined(BUILD) && !make(all) && !make(${S})
+${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: .MADE
+.endif
+${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U${S:T:R}}}: ${S} __scriptinstall
+.endfor
+.endif
+
+.if !target(scriptsinstall)
+scriptsinstall::
+.endif
+
+lint: ${LOBJS}
+.if defined(LOBJS) && !empty(LOBJS)
+ ${LINT} ${LINTFLAGS} ${LDFLAGS:M-L*} ${LOBJS} ${LDADD}
+.endif
+
+.include <bsd.man.mk>
+.include <bsd.nls.mk>
+.include <bsd.files.mk>
+.include <bsd.inc.mk>
+.include <bsd.links.mk>
+.include <bsd.dep.mk>
+.include <bsd.sys.mk>
+
+# Make sure all of the standard targets are defined, even if they do nothing.
+regress:
diff --git a/pkgtools/bootstrap-mk-files/files/bsd.subdir.mk b/pkgtools/bootstrap-mk-files/files/bsd.subdir.mk
new file mode 100644
index 00000000000..31d1effa7eb
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/bsd.subdir.mk
@@ -0,0 +1,62 @@
+# $NetBSD: bsd.subdir.mk,v 1.1.1.1 2006/07/14 23:13:01 jlam Exp $
+# @(#)bsd.subdir.mk 8.1 (Berkeley) 6/8/93
+
+.if !target(__initialized__)
+__initialized__:
+.if exists(${.CURDIR}/../Makefile.inc)
+.include "${.CURDIR}/../Makefile.inc"
+.endif
+.include <bsd.own.mk>
+.MAIN: all
+.endif
+
+.for dir in ${SUBDIR}
+.if exists(${dir}.${MACHINE})
+__REALSUBDIR+=${dir}.${MACHINE}
+.else
+__REALSUBDIR+=${dir}
+.endif
+.endfor
+
+.if defined(DESTDIR) && exists(${DESTDIR}/usr/share/mk/sys.mk)
+_M=-m ${DESTDIR}/usr/share/mk
+.else
+_M=
+.endif
+
+__recurse: .USE
+ @targ=${.TARGET:C/-.*$//};dir=${.TARGET:C/^[^-]*-//}; \
+ case "$$dir" in /*) \
+ echo "$$targ ===> $$dir"; \
+ cd "$$dir"; \
+ ${MAKE} ${_M} "_THISDIR_=$$dir/" $$targ; \
+ ;; \
+ *) \
+ echo "$$targ ===> ${_THISDIR_}$$dir"; \
+ cd "${.CURDIR}/$$dir"; \
+ ${MAKE} ${_M} "_THISDIR_=${_THISDIR_}$$dir/" $$targ; \
+ ;; \
+ esac
+
+# for obscure reasons, we can't do a simple .if ${dir} == ".WAIT"
+# but have to assign to __TARGDIR first.
+.for targ in ${TARGETS}
+.for dir in ${__REALSUBDIR}
+__TARGDIR := ${dir}
+.if ${__TARGDIR} == ".WAIT"
+SUBDIR_${targ} += .WAIT
+.else
+.PHONY: ${targ}-${dir}
+${targ}-${dir}: .MAKE __recurse
+SUBDIR_${targ} += ${targ}-${dir}
+.endif
+.endfor
+.if defined(__REALSUBDIR)
+.PHONY: subdir-${targ}
+subdir-${targ}: ${SUBDIR_${targ}}
+${targ}: subdir-${targ}
+.endif
+.endfor
+
+# Make sure all of the standard targets are defined, even if they do nothing.
+${TARGETS}:
diff --git a/pkgtools/bootstrap-mk-files/files/bsd.sys.mk b/pkgtools/bootstrap-mk-files/files/bsd.sys.mk
new file mode 100644
index 00000000000..8ba7d174a80
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/bsd.sys.mk
@@ -0,0 +1,134 @@
+# $NetBSD: bsd.sys.mk,v 1.1.1.1 2006/07/14 23:13:01 jlam Exp $
+#
+# Overrides used for NetBSD source tree builds.
+
+.if defined(WARNS)
+.if ${WARNS} > 0
+CFLAGS+= -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
+# XXX Delete -Wuninitialized by default for now -- the compiler doesn't
+# XXX always get it right.
+CFLAGS+= -Wno-uninitialized
+.endif
+.if ${WARNS} > 1
+CFLAGS+=-Wreturn-type -Wcast-qual -Wpointer-arith -Wwrite-strings
+CFLAGS+=-Wswitch -Wshadow
+.endif
+.endif
+
+.if defined(WFORMAT) && defined(FORMAT_AUDIT)
+.if ${WFORMAT} > 1
+CFLAGS+=-Wnetbsd-format-audit -Wno-format-extra-args
+.endif
+.endif
+
+.if !defined(NOGCCERROR)
+CFLAGS+= -Werror
+.endif
+CFLAGS+= ${CWARNFLAGS}
+
+.if defined(DESTDIR)
+CPPFLAGS+= -nostdinc -idirafter ${DESTDIR}/usr/include
+LINTFLAGS+= -d ${DESTDIR}/usr/include
+.endif
+
+.if defined(AUDIT)
+CPPFLAGS+= -D__AUDIT__
+.endif
+
+.if defined(MKSOFTFLOAT) && (${MKSOFTFLOAT} != "no")
+COPTS+= -msoft-float
+FOPTS+= -msoft-float
+.endif
+
+# Helpers for cross-compiling
+HOST_CC?= cc
+HOST_CFLAGS?= -O
+HOST_COMPILE.c?=${HOST_CC} ${HOST_CFLAGS} ${HOST_CPPFLAGS} -c
+HOST_LINK.c?= ${HOST_CC} ${HOST_CFLAGS} ${HOST_CPPFLAGS} ${HOST_LDFLAGS}
+
+HOST_CPP?= cpp
+HOST_CPPFLAGS?=
+
+HOST_LD?= ld
+HOST_LDFLAGS?=
+
+OBJCOPY?= objcopy
+STRIP?= strip
+CONFIG?= config
+RPCGEN?= rpcgen
+MKLOCALE?= mklocale
+
+.SUFFIXES: .m .o .ln .lo
+
+# Objective C
+# (Defined here rather than in <sys.mk> because `.m' is not just
+# used for Objective C source)
+.m:
+ ${LINK.m} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.m.o:
+ ${COMPILE.m} ${.IMPSRC}
+
+# Host-compiled C objects
+.c.lo:
+ ${HOST_COMPILE.c} -o ${.TARGET} ${.IMPSRC}
+
+
+.if defined(PARALLEL) || defined(LPREFIX)
+LPREFIX?=yy
+LFLAGS+=-P${LPREFIX}
+# Lex
+.l:
+ ${LEX.l} -o${.TARGET:R}.${LPREFIX}.c ${.IMPSRC}
+ ${LINK.c} -o ${.TARGET} ${.TARGET:R}.${LPREFIX}.c ${LDLIBS} -ll
+ rm -f ${.TARGET:R}.${LPREFIX}.c
+.l.c:
+ ${LEX.l} -o${.TARGET} ${.IMPSRC}
+.l.o:
+ ${LEX.l} -o${.TARGET:R}.${LPREFIX}.c ${.IMPSRC}
+ ${COMPILE.c} -o ${.TARGET} ${.TARGET:R}.${LPREFIX}.c
+ rm -f ${.TARGET:R}.${LPREFIX}.c
+.l.lo:
+ ${LEX.l} -o${.TARGET:R}.${LPREFIX}.c ${.IMPSRC}
+ ${HOST_COMPILE.c} -o ${.TARGET} ${.TARGET:R}.${LPREFIX}.c
+ rm -f ${.TARGET:R}.${LPREFIX}.c
+.endif
+
+# Yacc
+.if defined(YHEADER) || defined(YPREFIX)
+.if defined(YPREFIX)
+YFLAGS+=-p${YPREFIX}
+.endif
+.if defined(YHEADER)
+YFLAGS+=-d
+.endif
+.y:
+ ${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
+ ${LINK.c} -o ${.TARGET} ${.TARGET:R}.tab.c ${LDLIBS}
+ rm -f ${.TARGET:R}.tab.c ${.TARGET:R}.tab.h
+.y.h: ${.TARGET:R}.c
+.y.c:
+ ${YACC.y} -o ${.TARGET} ${.IMPSRC}
+.y.o:
+ ${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
+ ${COMPILE.c} -o ${.TARGET} ${.TARGET:R}.tab.c
+ rm -f ${.TARGET:R}.tab.c ${TARGET:R}.tab.h
+.y.lo:
+ ${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
+ ${HOST_COMPILE.c} -o ${.TARGET} ${.TARGET:R}.tab.c
+ rm -f ${.TARGET:R}.tab.c ${TARGET:R}.tab.h
+.elif defined(PARALLEL)
+.y:
+ ${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
+ ${LINK.c} -o ${.TARGET} ${.TARGET:R}.tab.c ${LDLIBS}
+ rm -f ${.TARGET:R}.tab.c
+.y.c:
+ ${YACC.y} -o ${.TARGET} ${.IMPSRC}
+.y.o:
+ ${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
+ ${COMPILE.c} -o ${.TARGET} ${.TARGET:R}.tab.c
+ rm -f ${.TARGET:R}.tab.c
+.y.lo:
+ ${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
+ ${HOST_COMPILE.c} -o ${.TARGET} ${.TARGET:R}.tab.c
+ rm -f ${.TARGET:R}.tab.c
+.endif
diff --git a/pkgtools/bootstrap-mk-files/files/mods/Darwin.bsd.lib.mk b/pkgtools/bootstrap-mk-files/files/mods/Darwin.bsd.lib.mk
new file mode 100644
index 00000000000..089e9515b9a
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/mods/Darwin.bsd.lib.mk
@@ -0,0 +1,524 @@
+# $NetBSD: Darwin.bsd.lib.mk,v 1.1.1.1 2006/07/14 23:13:01 jlam Exp $
+# @(#)bsd.lib.mk 8.3 (Berkeley) 4/22/94
+
+.if !target(__initialized__)
+__initialized__:
+.if exists(${.CURDIR}/../Makefile.inc)
+.include "${.CURDIR}/../Makefile.inc"
+.endif
+.include <bsd.own.mk>
+.include <bsd.obj.mk>
+.include <bsd.depall.mk>
+.MAIN: all
+.endif
+
+.PHONY: checkver cleanlib libinstall
+realinstall: checkver libinstall
+clean cleandir: cleanlib
+
+.if exists(${SHLIB_VERSION_FILE})
+SHLIB_MAJOR != . ${SHLIB_VERSION_FILE} ; echo $$major
+SHLIB_MINOR != . ${SHLIB_VERSION_FILE} ; echo $$minor
+SHLIB_TEENY != . ${SHLIB_VERSION_FILE} ; echo $$teeny
+
+# Check for higher installed library versions.
+.if !defined(NOCHECKVER) && !defined(NOCHECKVER_${LIB}) && \
+ exists(${BSDSRCDIR}/lib/checkver)
+checkver:
+ @(cd ${.CURDIR} && \
+ sh ${BSDSRCDIR}/lib/checkver -v ${SHLIB_VERSION_FILE} \
+ -d ${DESTDIR}${LIBDIR} ${LIB})
+.endif
+.endif
+
+.if !target(checkver)
+checkver:
+.endif
+
+print-shlib-major:
+.if defined(SHLIB_MAJOR)
+ @echo ${SHLIB_MAJOR}
+.else
+ @false
+.endif
+
+print-shlib-minor:
+.if defined(SHLIB_MINOR)
+ @echo ${SHLIB_MINOR}
+.else
+ @false
+.endif
+
+print-shlib-teeny:
+.if defined(SHLIB_TEENY)
+ @echo ${SHLIB_TEENY}
+.else
+ @false
+.endif
+
+.if defined(SHLIB_MAJOR) && !empty(SHLIB_MAJOR)
+.if defined(SHLIB_MINOR) && !empty(SHLIB_MINOR)
+.if defined(SHLIB_TEENY) && !empty(SHLIB_TEENY)
+SHLIB_FULLVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR}.${SHLIB_TEENY}
+.else
+SHLIB_FULLVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR}
+.endif
+.else
+SHLIB_FULLVERSION=${SHLIB_MAJOR}
+.endif
+.endif
+
+# add additional suffixes not exported.
+# .po is used for profiling object files.
+# .so is used for PIC object files.
+.SUFFIXES: .out .a .ln .so .po .o .s .S .c .cc .C .m .F .f .r .y .l .cl .p .h
+.SUFFIXES: .sh .m4 .m
+
+
+# Set PICFLAGS to cc flags for producing position-independent code,
+# if not already set. Includes -DPIC, if required.
+
+# Data-driven table using make variables to control how shared libraries
+# are built for different platforms and object formats.
+# OBJECT_FMT: currently either "ELF" or "a.out", from <bsd.own.mk>
+# SHLIB_SOVERSION: version number to be compiled into a shared library
+# via -soname. Usualy ${SHLIB_MAJOR} on ELF.
+# NetBSD/pmax used to use ${SHLIB_MAJOR}[.${SHLIB_MINOR}
+# [.${SHLIB_TEENY}]]
+# SHLIB_SHFLAGS: Flags to tell ${LD} to emit shared library.
+# with ELF, also set shared-lib version for ld.so.
+# SHLIB_LDSTARTFILE: support .o file, call C++ file-level constructors
+# SHLIB_LDENDFILE: support .o file, call C++ file-level destructors
+# FPICFLAGS: flags for ${FC} to compile .[fF] files to .so objects.
+# CPPICFLAGS: flags for ${CPP} to preprocess .[sS] files for ${AS}
+# CPICFLAGS: flags for ${CC} to compile .[cC] files to .so objects.
+# CAPICFLAGS flags for {$CC} to compiling .[Ss] files
+# (usually just ${CPPPICFLAGS} ${CPICFLAGS})
+# APICFLAGS: flags for ${AS} to assemble .[sS] to .so objects.
+
+.if ${MACHINE_ARCH} == "alpha"
+ # Alpha-specific shared library flags
+FPICFLAGS ?= -fPIC
+CPICFLAGS ?= -fPIC -DPIC
+CPPPICFLAGS?= -DPIC
+CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
+APICFLAGS ?=
+.elif ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"
+ # mips-specific shared library flags
+
+# On mips, all libs are compiled with ABIcalls, not just sharedlibs.
+MKPICLIB= no
+
+# so turn shlib PIC flags on for ${AS}.
+AINC+=-DABICALLS
+AFLAGS+= -fPIC
+AS+= -KPIC
+
+.elif ${MACHINE_ARCH} == "vax" && ${OBJECT_FMT} == "ELF"
+# On the VAX, all object are PIC by default, not just sharedlibs.
+MKPICLIB= no
+
+.elif (${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64") && \
+ ${OBJECT_FMT} == "ELF"
+
+FPICFLAGS ?= -fPIC
+CPICFLAGS ?= -fPIC -DPIC
+CPPPICFLAGS?= -DPIC
+CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
+APICFLAGS ?= -KPIC
+
+.else
+
+# Platform-independent flags for NetBSD a.out shared libraries (and PowerPC)
+SHLIB_LDSTARTFILE=
+SHLIB_LDENDFILE=
+SHLIB_SOVERSION=${SHLIB_FULLVERSION}
+SHLIB_SHFLAGS=
+FPICFLAGS ?= -fPIC
+CPICFLAGS?= -fPIC -DPIC
+CPPPICFLAGS?= -DPIC
+CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
+APICFLAGS?= -k
+
+.endif
+
+MKPICLIB?= yes
+
+# Platform-independent linker flags for ELF shared libraries
+.if ${OBJECT_FMT} == "ELF"
+SHLIB_SOVERSION= ${SHLIB_MAJOR}
+SHLIB_SHFLAGS= -soname lib${LIB}.so.${SHLIB_SOVERSION}
+SHLIB_LDSTARTFILE?= ${DESTDIR}/usr/lib/crtbeginS.o
+SHLIB_LDENDFILE?= ${DESTDIR}/usr/lib/crtendS.o
+.endif
+
+CFLAGS+= ${COPTS}
+FFLAGS+= ${FOPTS}
+
+.c.o:
+.if defined(COPTS) && !empty(COPTS:M*-g*)
+ ${COMPILE.c} ${.IMPSRC}
+.else
+ @echo ${COMPILE.c:Q} ${.IMPSRC}
+ @${COMPILE.c} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.c.po:
+.if defined(COPTS) && !empty(COPTS:M*-g*)
+ ${COMPILE.c} -pg ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.c:Q} -pg ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.c} -pg ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.c.so:
+.if defined(COPTS) && !empty(COPTS:M*-g*)
+ ${COMPILE.c} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.c:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.c} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.c.ln:
+ ${LINT} ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i ${.IMPSRC}
+
+.cc.o .C.o:
+.if defined(COPTS) && !empty(COPTS:M*-g*)
+ ${COMPILE.cc} ${.IMPSRC}
+.else
+ @echo ${COMPILE.cc:Q} ${.IMPSRC}
+ @${COMPILE.cc} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.cc.po .C.po:
+.if defined(COPTS) && !empty(COPTS:M*-g*)
+ ${COMPILE.cc} -pg ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.cc:Q} -pg ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.cc} -pg ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.cc.so .C.so:
+.if defined(COPTS) && !empty(COPTS:M*-g*)
+ ${COMPILE.cc} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.cc:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.cc} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.f.o:
+.if defined(FOPTS) && !empty(FOPTS:M*-g*)
+ ${COMPILE.f} ${.IMPSRC}
+.else
+ @echo ${COMPILE.f:Q} ${.IMPSRC}
+ @${COMPILE.f} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.f.po:
+.if defined(FOPTS) && !empty(FOPTS:M*-g*)
+ ${COMPILE.f} -pg ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.f:Q} -pg ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.f} -pg ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.f.so:
+.if defined(FOPTS) && !empty(FOPTS:M*-g*)
+ ${COMPILE.f} ${FPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.f:Q} ${FPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.f} ${FPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.f.ln:
+ ${ECHO} Skipping lint for Fortran libraries.
+
+.m.o:
+.if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
+ ${COMPILE.m} ${.IMPSRC}
+.else
+ @echo ${COMPILE.m:Q} ${.IMPSRC}
+ @${COMPILE.m} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.m.po:
+.if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
+ ${COMPILE.m} -pg ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.m:Q} -pg ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.m} -pg ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.m.so:
+.if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
+ ${COMPILE.m} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.m:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.m} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.S.o .s.o:
+ @echo ${COMPILE.S:Q} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC}
+ @${COMPILE.S} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+
+.S.po .s.po:
+ @echo ${COMPILE.S:Q} -DGPROF -DPROF ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.S} -DGPROF -DPROF ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+
+.S.so .s.so:
+ @echo ${COMPILE.S:Q} ${CAPICFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.S} ${CAPICFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+
+.if ${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
+ || ${MKLINKLIB} != "no"
+_LIBS=lib${LIB}.a
+.else
+_LIBS=
+.endif
+
+OBJS+=${SRCS:N*.h:N*.sh:R:S/$/.o/g}
+
+.if ${MKPROFILE} != "no"
+_LIBS+=lib${LIB}_p.a
+POBJS+=${OBJS:.o=.po}
+.endif
+
+.if ${MKPIC} != "no"
+.if ${MKPICLIB} == "no"
+SOLIB=lib${LIB}.a
+.else
+SOLIB=lib${LIB}_pic.a
+_LIBS+=${SOLIB}
+SOBJS+=${OBJS:.o=.so}
+.endif
+.if defined(SHLIB_FULLVERSION)
+_LIBS+=lib${LIB}.so.${SHLIB_FULLVERSION}
+.endif
+.endif
+
+LOBJS+=${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
+.if ${MKLINT} != "no" && ${MKLINKLIB} != "no" && !empty(LOBJS)
+_LIBS+=llib-l${LIB}.ln
+.endif
+
+.if ${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
+ || ${MKLINKLIB} != "no"
+ALLOBJS=${OBJS} ${POBJS} ${SOBJS}
+.else
+ALLOBJS=${POBJS} ${SOBJS}
+.endif
+.if ${MKLINT} != "no" && ${MKLINKLIB} != "no" && !empty(LOBJS)
+ALLOBJS+=${LOBJS}
+.endif
+.NOPATH: ${ALLOBJS} ${_LIBS}
+
+realall: ${SRCS} ${ALLOBJS:O} ${_LIBS}
+
+__archivebuild: .USE
+ @rm -f ${.TARGET}
+ ${AR} -c -q ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}`
+ ${RANLIB} ${.TARGET}
+
+__archiveinstall: .USE
+ ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
+ -g ${LIBGRP} -m 600 ${.ALLSRC} ${.TARGET}
+ ${RANLIB} -t ${.TARGET}
+ chmod ${LIBMODE} ${.TARGET}
+
+DPSRCS+= ${SRCS:M*.l:.l=.c} ${SRCS:M*.y:.y=.c}
+CLEANFILES+= ${DPSRCS}
+.if defined(YHEADER)
+CLEANFILES+= ${SRCS:M*.y:.y=.h}
+.endif
+
+lib${LIB}.a:: ${OBJS} __archivebuild
+ @echo building standard ${LIB} library
+
+lib${LIB}_p.a:: ${POBJS} __archivebuild
+ @echo building profiled ${LIB} library
+
+lib${LIB}_pic.a:: ${SOBJS} __archivebuild
+ @echo building shared object ${LIB} library
+
+lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOLIB} ${DPADD} \
+ ${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}
+ @echo building shared ${LIB} library \(version ${SHLIB_FULLVERSION}\)
+ @rm -f lib${LIB}.so.${SHLIB_FULLVERSION}
+.if defined(DESTDIR)
+ $(LD) -nostdlib -x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
+ ${SHLIB_LDSTARTFILE} \
+ --whole-archive ${SOLIB} \
+ --no-whole-archive ${LDADD} \
+ -L${DESTDIR}${LIBDIR} -R${LIBDIR} \
+ ${SHLIB_LDENDFILE}
+.else
+ $(LD) -x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
+ ${SHLIB_LDSTARTFILE} \
+ --whole-archive ${SOLIB} --no-whole-archive ${LDADD} \
+ ${SHLIB_LDENDFILE}
+.endif
+.if ${OBJECT_FMT} == "ELF"
+ ln -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.${SHLIB_MAJOR}.tmp
+ mv -f lib${LIB}.so.${SHLIB_MAJOR}.tmp lib${LIB}.so.${SHLIB_MAJOR}
+ ln -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.tmp
+ mv -f lib${LIB}.so.tmp lib${LIB}.so
+.endif
+
+.if !empty(LOBJS)
+LLIBS?= -lc
+llib-l${LIB}.ln: ${LOBJS}
+ @echo building llib-l${LIB}.ln
+ @rm -f llib-l${LIB}.ln
+ @${LINT} -C${LIB} ${.ALLSRC} ${LLIBS}
+.endif
+
+cleanlib:
+ rm -f a.out [Ee]rrs mklog core *.core ${CLEANFILES}
+ rm -f lib${LIB}.a ${OBJS}
+ rm -f lib${LIB}_p.a ${POBJS}
+ rm -f lib${LIB}_pic.a lib${LIB}.so.* lib${LIB}.so ${SOBJS}
+ rm -f llib-l${LIB}.ln ${LOBJS}
+
+.if defined(SRCS)
+afterdepend: .depend
+ @(TMP=/tmp/_depend$$$$; \
+ sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po \1.so \1.ln:/' \
+ < .depend > $$TMP; \
+ mv $$TMP .depend)
+.endif
+
+.if !target(libinstall)
+# Make sure it gets defined, in case MKPIC==no && MKLINKLIB==no
+libinstall::
+
+.if ${MKLINKLIB} != "no"
+libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.a
+.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.a
+.if !defined(UPDATE)
+.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}.a
+.endif
+
+.if !defined(BUILD) && !make(all) && !make(lib${LIB}.a)
+${DESTDIR}${LIBDIR}/lib${LIB}.a: .MADE
+.endif
+${DESTDIR}${LIBDIR}/lib${LIB}.a: lib${LIB}.a __archiveinstall
+.endif
+
+.if ${MKPROFILE} != "no"
+libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
+.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
+.if !defined(UPDATE)
+.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
+.endif
+
+.if !defined(BUILD) && !make(all) && !make(lib${LIB}_p.a)
+${DESTDIR}${LIBDIR}/lib${LIB}_p.a: .MADE
+.endif
+${DESTDIR}${LIBDIR}/lib${LIB}_p.a: lib${LIB}_p.a __archiveinstall
+.endif
+
+.if ${MKPIC} != "no" && ${MKPICINSTALL} != "no"
+libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
+.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
+.if !defined(UPDATE)
+.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
+.endif
+
+.if !defined(BUILD) && !make(all) && !make(lib${LIB}_pic.a)
+${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: .MADE
+.endif
+.if ${MKPICLIB} == "no"
+${DESTDIR}${LIBDIR}/lib${LIB}_pic.a:
+ rm -f ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
+ ln -s lib${LIB}.a ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
+.else
+${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: lib${LIB}_pic.a __archiveinstall
+.endif
+.endif
+
+.if ${MKPIC} != "no" && defined(SHLIB_FULLVERSION)
+libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
+.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
+.if !defined(UPDATE)
+.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
+.endif
+
+.if !defined(BUILD) && !make(all) && !make(lib${LIB}.so.${SHLIB_FULLVERSION})
+${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: .MADE
+.endif
+${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: lib${LIB}.so.${SHLIB_FULLVERSION}
+ ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
+ -g ${LIBGRP} -m ${LIBMODE} ${.ALLSRC} ${.TARGET}
+.if ${OBJECT_FMT} == "a.out" && !defined(DESTDIR)
+ /sbin/ldconfig -m ${LIBDIR}
+.endif
+.if ${OBJECT_FMT} == "ELF"
+ ln -sf lib${LIB}.so.${SHLIB_FULLVERSION}\
+ ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.tmp
+ mv -f ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.tmp\
+ ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}
+.if ${MKLINKLIB} != "no"
+ ln -sf lib${LIB}.so.${SHLIB_FULLVERSION}\
+ ${DESTDIR}${LIBDIR}/lib${LIB}.so.tmp
+ mv -f ${DESTDIR}${LIBDIR}/lib${LIB}.so.tmp\
+ ${DESTDIR}${LIBDIR}/lib${LIB}.so
+.endif
+.endif
+.endif
+
+.if ${MKLINT} != "no" && ${MKLINKLIB} != "no" && !empty(LOBJS)
+libinstall:: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
+.PRECIOUS: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
+.if !defined(UPDATE)
+.PHONY: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
+.endif
+
+.if !defined(BUILD) && !make(all) && !make(llib-l${LIB}.ln)
+${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: .MADE
+.endif
+${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: llib-l${LIB}.ln
+ ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
+ -g ${LIBGRP} -m ${LIBMODE} ${.ALLSRC} ${DESTDIR}${LINTLIBDIR}
+.endif
+.endif
+
+.include <bsd.man.mk>
+.include <bsd.nls.mk>
+.include <bsd.files.mk>
+.include <bsd.inc.mk>
+.include <bsd.links.mk>
+.include <bsd.dep.mk>
+.include <bsd.sys.mk>
+
+# Make sure all of the standard targets are defined, even if they do nothing.
+lint regress:
diff --git a/pkgtools/bootstrap-mk-files/files/mods/Darwin.bsd.man.mk b/pkgtools/bootstrap-mk-files/files/mods/Darwin.bsd.man.mk
new file mode 100644
index 00000000000..c922245b8ad
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/mods/Darwin.bsd.man.mk
@@ -0,0 +1,205 @@
+# $NetBSD: Darwin.bsd.man.mk,v 1.1.1.1 2006/07/14 23:13:01 jlam Exp $
+# @(#)bsd.man.mk 8.1 (Berkeley) 6/8/93
+
+.if !target(__initialized__)
+__initialized__:
+.if exists(${.CURDIR}/../Makefile.inc)
+.include "${.CURDIR}/../Makefile.inc"
+.endif
+.include <bsd.own.mk>
+.include <bsd.obj.mk>
+.include <bsd.depall.mk>
+.MAIN: all
+.endif
+
+.PHONY: catinstall maninstall catpages manpages catlinks manlinks cleanman html installhtml cleanhtml
+.if ${MKMAN} != "no"
+realinstall: ${MANINSTALL}
+.endif
+cleandir: cleanman
+
+.if exists(${DESTDIR}/usr/share/groff/1.19.1/tmac)
+TMACDIR?= ${DESTDIR}/usr/share/groff/1.19.1/tmac
+.elif exists(${DESTDIR}/usr/share/groff/1.18.1/tmac)
+TMACDIR?= ${DESTDIR}/usr/share/groff/1.18.1/tmac
+.else
+TMACDIR?= ${DESTDIR}/usr/share/groff/tmac
+.endif
+HTMLDIR?= ${DESTDIR}/usr/share/man
+CATDEPS?= ${TMACDIR}/mandoc.tmac \
+ ${TMACDIR}/doc.tmac
+MANTARGET?= cat
+NROFF?= nroff -Tascii
+GROFF?= groff -Tascii
+TBL?= tbl
+
+
+.SUFFIXES: .1 .2 .3 .4 .5 .6 .7 .8 .9 \
+ .cat1 .cat2 .cat3 .cat4 .cat5 .cat6 .cat7 .cat8 .cat9 \
+ .html1 .html2 .html3 .html4 .html5 .html6 .html7 .html8 .html9
+
+.9.cat9 .8.cat8 .7.cat7 .6.cat6 .5.cat5 .4.cat4 .3.cat3 .2.cat2 .1.cat1: \
+ ${CATDEPS}
+.if !defined(USETBL)
+ @echo "${NROFF} -mandoc ${.IMPSRC} > ${.TARGET}"
+ @${NROFF} -mandoc ${.IMPSRC} > ${.TARGET} || \
+ (rm -f ${.TARGET}; false)
+.else
+ @echo "${TBL} ${.IMPSRC} | ${NROFF} -mandoc > ${.TARGET}"
+ @${TBL} ${.IMPSRC} | ${NROFF} -mandoc > ${.TARGET} || \
+ (rm -f ${.TARGET}; false)
+.endif
+
+.9.html9 .8.html8 .7.html7 .6.html6 .5.html5 .4.html4 .3.html3 .2.html2 .1.html1: \
+ ${CATDEPS}
+.if !defined(USETBL)
+ @echo "${GROFF} -mdoc2html -P-b -P-u -P-o ${.IMPSRC} > ${.TARGET}"
+ @${GROFF} -mdoc2html -P-b -P-u -P-o ${.IMPSRC} > ${.TARGET} || \
+ (rm -f ${.TARGET}; false)
+.else
+ @echo "${TBL} ${.IMPSRC} | ${GROFF} -mdoc2html -P-b -P-u -P-o > ${.TARGET}"
+ @cat ${.IMPSRC} | ${GROFF} -mdoc2html -P-b -P-u -P-o > ${.TARGET} || \
+ (rm -f ${.TARGET}; false)
+.endif
+
+.if defined(MAN) && !empty(MAN)
+MANPAGES= ${MAN}
+CATPAGES= ${MANPAGES:C/(.*).([1-9])/\1.cat\2/}
+.NOPATH: ${CATPAGES}
+.if !defined(NOHTML)
+HTMLPAGES= ${MANPAGES:C/(.*).([1-9])/\1.html\2/}
+.endif
+.endif
+
+MINSTALL= ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} \
+ -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
+
+.if defined(MANZ)
+# chown and chmod are done afterward automatically
+MCOMPRESS= gzip -cf
+MCOMPRESSSUFFIX= .gz
+.endif
+
+catinstall: catlinks
+maninstall: manlinks
+
+__installpage: .USE
+.if defined(MCOMPRESS) && !empty(MCOMPRESS)
+ @rm -f ${.TARGET}
+ ${MCOMPRESS} ${.ALLSRC} > ${.TARGET}
+ @chown ${MANOWN}:${MANGRP} ${.TARGET}
+ @chmod ${MANMODE} ${.TARGET}
+.else
+ @cmp -s ${.ALLSRC} ${.TARGET} > /dev/null 2>&1 || \
+ (echo "${MINSTALL} ${.ALLSRC} ${.TARGET}" && \
+ ${MINSTALL} ${.ALLSRC} ${.TARGET})
+.endif
+
+
+# Rules for cat'ed man page installation
+.if defined(CATPAGES) && !empty(CATPAGES) && ${MKCATPAGES} != "no"
+catpages:: ${CATPAGES:@P@${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}@}
+.PRECIOUS: ${CATPAGES:@P@${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}@}
+.if !defined(UPDATE)
+.PHONY: ${CATPAGES:@P@${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}@}
+.endif
+
+. for P in ${CATPAGES:O:u}
+. if !defined(BUILD) && !make(all) && !make(${P})
+${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}: .MADE
+. endif
+${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}: ${P} __installpage
+. endfor
+.else
+catpages::
+.endif
+
+# Rules for source page installation
+.if defined(MANPAGES) && !empty(MANPAGES)
+manpages:: ${MANPAGES:@P@${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P}${MCOMPRESSSUFFIX}@}
+.PRECIOUS: ${MANPAGES:@P@${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P}${MCOMPRESSSUFFIX}@}
+.if !defined(UPDATE)
+.PHONY: ${MANPAGES:@P@${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P}${MCOMPRESSSUFFIX}@}
+.endif
+
+. for P in ${MANPAGES:O:u}
+${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P}${MCOMPRESSSUFFIX}: ${P} __installpage
+. endfor
+.else
+manpages::
+.endif
+
+.if ${MKCATPAGES} != "no"
+catlinks: catpages
+.if defined(MLINKS) && !empty(MLINKS)
+ @set ${MLINKS}; \
+ while test $$# -ge 2; do \
+ name=$$1; \
+ shift; \
+ dir=${DESTDIR}${MANDIR}/cat$${name##*.}; \
+ l=$${dir}${MANSUBDIR}/$${name%.*}.0${MCOMPRESSSUFFIX}; \
+ name=$$1; \
+ shift; \
+ dir=${DESTDIR}${MANDIR}/cat$${name##*.}; \
+ t=$${dir}${MANSUBDIR}/$${name%.*}.0${MCOMPRESSSUFFIX}; \
+ if test $$l -nt $$t -o ! -f $$t; then \
+ echo $$t -\> $$l; \
+ ln -f $$l $$t; \
+ fi; \
+ done
+.endif
+.else
+catlinks:
+.endif
+
+manlinks: manpages
+.if defined(MLINKS) && !empty(MLINKS)
+ @set ${MLINKS}; \
+ while test $$# -ge 2; do \
+ name=$$1; \
+ shift; \
+ dir=${DESTDIR}${MANDIR}/man$${name##*.}; \
+ l=$${dir}${MANSUBDIR}/$${name}${MCOMPRESSSUFFIX}; \
+ name=$$1; \
+ shift; \
+ dir=${DESTDIR}${MANDIR}/man$${name##*.}; \
+ t=$${dir}${MANSUBDIR}/$${name}${MCOMPRESSSUFFIX}; \
+ if test $$l -nt $$t -o ! -f $$t; then \
+ echo $$t -\> $$l; \
+ ln -f $$l $$t; \
+ fi; \
+ done
+.endif
+
+# Html rules
+html: ${HTMLPAGES}
+
+.if defined(HTMLPAGES) && !empty(HTMLPAGES)
+.for P in ${HTMLPAGES:O:u}
+${HTMLDIR}/${P:T:E}/${P:T:R}.html: ${P}
+ ${MINSTALL} ${.ALLSRC} ${.TARGET}
+.endfor
+.endif
+installhtml: ${HTMLPAGES:@P@${HTMLDIR}/${P:T:E}/${P:T:R}.html@}
+
+cleanhtml:
+.if defined(HTMLPAGES) && !empty(HTMLPAGES)
+ rm -f ${HTMLPAGES}
+.endif
+
+
+.if defined(CATPAGES)
+.if ${MKCATPAGES} != "no" && ${MKMAN} != "no"
+realall: ${CATPAGES}
+.else
+realall:
+.endif
+
+cleanman:
+ rm -f ${CATPAGES}
+.else
+cleanman:
+.endif
+
+# Make sure all of the standard targets are defined, even if they do nothing.
+clean depend includes lint regress tags:
diff --git a/pkgtools/bootstrap-mk-files/files/mods/Darwin.bsd.sys.mk b/pkgtools/bootstrap-mk-files/files/mods/Darwin.bsd.sys.mk
new file mode 100644
index 00000000000..49e2f5729e3
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/mods/Darwin.bsd.sys.mk
@@ -0,0 +1,65 @@
+# $NetBSD: Darwin.bsd.sys.mk,v 1.1.1.1 2006/07/14 23:13:01 jlam Exp $
+
+#OBJCOPY?= objcopy
+STRIP?= strip
+CONFIG?= config
+RPCGEN?= rpcgen
+MKLOCALE?= mklocale
+
+.SUFFIXES: .m .o .ln .lo
+
+# Objective C
+# (Defined here rather than in <sys.mk> because `.m' is not just
+# used for Objective C source)
+.m:
+ ${LINK.m} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.m.o:
+ ${COMPILE.m} ${.IMPSRC}
+
+.if defined(PARALLEL) || defined(LPREFIX)
+LPREFIX?=yy
+LFLAGS+=-P${LPREFIX}
+# Lex
+.l:
+ ${LEX.l} -o${.TARGET:R}.${LPREFIX}.c ${.IMPSRC}
+ ${LINK.c} -o ${.TARGET} ${.TARGET:R}.${LPREFIX}.c ${LDLIBS} -ll
+ rm -f ${.TARGET:R}.${LPREFIX}.c
+.l.c:
+ ${LEX.l} -o${.TARGET} ${.IMPSRC}
+.l.o:
+ ${LEX.l} -o${.TARGET:R}.${LPREFIX}.c ${.IMPSRC}
+ ${COMPILE.c} -o ${.TARGET} ${.TARGET:R}.${LPREFIX}.c
+ rm -f ${.TARGET:R}.${LPREFIX}.c
+.endif
+
+# Yacc
+.if defined(YHEADER) || defined(YPREFIX)
+.if defined(YPREFIX)
+YFLAGS+=-p${YPREFIX}
+.endif
+.if defined(YHEADER)
+YFLAGS+=-d
+.endif
+.y:
+ ${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
+ ${LINK.c} -o ${.TARGET} ${.TARGET:R}.tab.c ${LDLIBS}
+ rm -f ${.TARGET:R}.tab.c ${.TARGET:R}.tab.h
+.y.h: ${.TARGET:R}.c
+.y.c:
+ ${YACC.y} -o ${.TARGET} ${.IMPSRC}
+.y.o:
+ ${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
+ ${COMPILE.c} -o ${.TARGET} ${.TARGET:R}.tab.c
+ rm -f ${.TARGET:R}.tab.c ${TARGET:R}.tab.h
+.elif defined(PARALLEL)
+.y:
+ ${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
+ ${LINK.c} -o ${.TARGET} ${.TARGET:R}.tab.c ${LDLIBS}
+ rm -f ${.TARGET:R}.tab.c
+.y.c:
+ ${YACC.y} -o ${.TARGET} ${.IMPSRC}
+.y.o:
+ ${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
+ ${COMPILE.c} -o ${.TARGET} ${.TARGET:R}.tab.c
+ rm -f ${.TARGET:R}.tab.c
+.endif
diff --git a/pkgtools/bootstrap-mk-files/files/mods/Darwin.sys.mk b/pkgtools/bootstrap-mk-files/files/mods/Darwin.sys.mk
new file mode 100644
index 00000000000..959f9bc2797
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/mods/Darwin.sys.mk
@@ -0,0 +1,210 @@
+# $NetBSD: Darwin.sys.mk,v 1.1.1.1 2006/07/14 23:13:01 jlam Exp $
+# @(#)sys.mk 8.2 (Berkeley) 3/21/94
+
+unix= We run UNIX.
+OS!= uname -s
+
+.SUFFIXES: .out .a .ln .o .s .S .c .cc .cpp .cxx .C .F .f .r .y .l .cl .p .h
+.SUFFIXES: .sh .m4
+
+.LIBS: .a
+
+AR?= ar
+ARFLAGS?= rl
+RANLIB?= ranlib
+
+AS?= as
+AFLAGS?=
+COMPILE.s?= ${AS} ${AFLAGS}
+LINK.s?= ${CC} ${AFLAGS} ${LDFLAGS}
+COMPILE.S?= ${CC} ${AFLAGS} ${CPPFLAGS} -c
+LINK.S?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+.if exists(/usr/bin/gcc)
+CC?= gcc -pipe
+.else
+CC?= cc -pipe
+.endif
+DBG?= -O2
+CFLAGS?= ${DBG}
+COMPILE.c?= ${CC} ${CFLAGS} ${CPPFLAGS} -c
+LINK.c?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+.if exists(/usr/bin/g++)
+CXX?= g++
+.else
+CXX?= c++
+.endif
+CXXFLAGS?= ${CFLAGS}
+COMPILE.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
+LINK.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+OBJC?= ${CC}
+OBJCFLAGS?= ${CFLAGS}
+COMPILE.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c
+LINK.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+CPP?= cpp
+NOLINT= 1
+CPPFLAGS?=
+
+MK_DEP?= mkdeps.sh -N
+
+FC?= f77
+FFLAGS?= -O
+RFLAGS?=
+COMPILE.f?= ${FC} ${FFLAGS} -c
+LINK.f?= ${FC} ${FFLAGS} ${LDFLAGS}
+COMPILE.F?= ${FC} ${FFLAGS} ${CPPFLAGS} -c
+LINK.F?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.r?= ${FC} ${FFLAGS} ${RFLAGS} -c
+LINK.r?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
+
+INSTALL?= install
+
+LEX?= lex
+LFLAGS?=
+LEX.l?= ${LEX} ${LFLAGS}
+
+LD?= ld
+LDFLAGS?=
+
+LINT?= lint
+LINTFLAGS?= -chapbx
+
+LORDER?= lorder
+
+MAKE?= bmake
+
+NM?= nm
+
+PC?= pc
+PFLAGS?=
+COMPILE.p?= ${PC} ${PFLAGS} ${CPPFLAGS} -c
+LINK.p?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+SHELL?= sh
+
+SIZE?= size
+
+TSORT?= tsort -q
+
+YACC?= yacc
+YFLAGS?= -d
+YACC.y?= ${YACC} ${YFLAGS}
+
+# C
+.c:
+ ${LINK.c} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.c.o:
+ ${COMPILE.c} ${.IMPSRC}
+.c.a:
+ ${COMPILE.c} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# C++
+.cc:
+ ${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.cc.o:
+ ${COMPILE.cc} ${.IMPSRC}
+.cc.a:
+ ${COMPILE.cc} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+.C:
+ ${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.C.o:
+ ${COMPILE.cc} ${.IMPSRC}
+.C.a:
+ ${COMPILE.cc} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Fortran/Ratfor
+.f:
+ ${LINK.f} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.f.o:
+ ${COMPILE.f} ${.IMPSRC}
+.f.a:
+ ${COMPILE.f} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+.F:
+ ${LINK.F} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.F.o:
+ ${COMPILE.F} ${.IMPSRC}
+.F.a:
+ ${COMPILE.F} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+.r:
+ ${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.r.o:
+ ${COMPILE.r} ${.IMPSRC}
+.r.a:
+ ${COMPILE.r} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Pascal
+.p:
+ ${LINK.p} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.p.o:
+ ${COMPILE.p} ${.IMPSRC}
+.p.a:
+ ${COMPILE.p} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Assembly
+.s:
+ ${LINK.s} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.s.o:
+ ${COMPILE.s} -o ${.TARGET} ${.IMPSRC}
+.s.a:
+ ${COMPILE.s} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+.S:
+ ${LINK.S} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.S.o:
+ ${COMPILE.S} ${.IMPSRC}
+.S.a:
+ ${COMPILE.S} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Lex
+.l:
+ ${LEX.l} ${.IMPSRC}
+ ${LINK.c} -o ${.TARGET} lex.yy.c ${LDLIBS} -ll
+ rm -f lex.yy.c
+.l.c:
+ ${LEX.l} ${.IMPSRC}
+ mv lex.yy.c ${.TARGET}
+.l.o:
+ ${LEX.l} ${.IMPSRC}
+ ${COMPILE.c} -o ${.TARGET} lex.yy.c
+ rm -f lex.yy.c
+
+# Yacc
+.y:
+ ${YACC.y} ${.IMPSRC}
+ ${LINK.c} -o ${.TARGET} y.tab.c ${LDLIBS}
+ rm -f y.tab.c
+.y.c:
+ ${YACC.y} ${.IMPSRC}
+ mv y.tab.c ${.TARGET}
+.y.o:
+ ${YACC.y} ${.IMPSRC}
+ ${COMPILE.c} -o ${.TARGET} y.tab.c
+ rm -f y.tab.c
+
+# Shell
+.sh:
+ rm -f ${.TARGET}
+ cp ${.IMPSRC} ${.TARGET}
diff --git a/pkgtools/bootstrap-mk-files/files/mods/FreeBSD.bsd.man.mk b/pkgtools/bootstrap-mk-files/files/mods/FreeBSD.bsd.man.mk
new file mode 100644
index 00000000000..4aff313d54e
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/mods/FreeBSD.bsd.man.mk
@@ -0,0 +1,137 @@
+# $NetBSD: FreeBSD.bsd.man.mk,v 1.1.1.1 2006/07/14 23:13:01 jlam Exp $
+# From:
+# OpenBSD: bsd.man.mk,v 1.23 2001/07/20 23:02:21 espie Exp
+# NetBSD: bsd.man.mk,v 1.23 1996/02/10 07:49:33 jtc Exp
+# @(#)bsd.man.mk 5.2 (Berkeley) 5/11/90
+
+MANTARGET?= cat
+NROFF?= nroff -Tascii
+TBL?= tbl
+
+.if !target(.MAIN)
+.if exists(${.CURDIR}/../Makefile.inc)
+.include "${.CURDIR}/../Makefile.inc"
+.endif
+
+.MAIN: all
+.endif
+
+.SUFFIXES: .1 .2 .3 .3p .4 .5 .6 .7 .8 .9 .1tbl .2tbl .3tbl .4tbl .5tbl .6tbl \
+ .7tbl .8tbl .9tbl .cat1 .cat2 .cat3 .cat4 .cat5 .cat6 .cat7 .cat8 .cat9 \
+ .ps1 .ps2 .ps3 .ps4 .ps5 .ps6 .ps7 .ps8 .ps9
+
+.9.cat9 .8.cat8 .7.cat7 .6.cat6 .5.cat5 .4.cat4 .3p.cat3p .3.cat3 .2.cat2 .1.cat1:
+ @echo "${NROFF} -mandoc ${.IMPSRC} > ${.TARGET}"
+ @${NROFF} -mandoc ${.IMPSRC} > ${.TARGET} || (rm -f ${.TARGET}; false)
+
+.9tbl.cat9 .8tbl.cat8 .7tbl.cat7 .6tbl.cat6 .5tbl.cat5 .4tbl.cat4 .3tbl.cat3 \
+.2tbl.cat2 .1tbl.cat1:
+ @echo "${TBL} ${.IMPSRC} | ${NROFF} -mandoc > ${.TARGET}"
+ @${TBL} ${.IMPSRC} | ${NROFF} -mandoc > ${.TARGET} || \
+ (rm -f ${.TARGET}; false)
+
+.9.ps9 .8.ps8 .7.ps7 .6.ps6 .5.ps5 .4.ps4 .3p.ps3p .3.ps3 .2.ps2 .1.ps1:
+ @echo "nroff -Tps -mandoc ${.IMPSRC} > ${.TARGET}"
+ @nroff -Tps -mandoc ${.IMPSRC} > ${.TARGET} || (rm -f ${.TARGET}; false)
+
+.9tbl.ps9 .8tbl.ps8 .7tbl.ps7 .6tbl.ps6 .5tbl.ps5 .4tbl.ps4 .3tbl.ps3 \
+.2tbl.ps2 .1tbl.ps1:
+ @echo "${TBL} ${.IMPSRC} | nroff -Tps -mandoc > ${.TARGET}"
+ @${TBL} ${.IMPSRC} | nroff -Tps -mandoc > ${.TARGET} || (rm -f ${.TARGET}; false)
+
+.if defined(MAN) && !empty(MAN) && !defined(MANALL)
+
+MANALL= ${MAN:S/.1$/.cat1/g:S/.2$/.cat2/g:S/.3$/.cat3/g:S/.3p$/.cat3p/g:S/.4$/.cat4/g:S/.5$/.cat5/g:S/.6$/.cat6/g:S/.7$/.cat7/g:S/.8$/.cat8/g:S/.9$/.cat9/g:S/.1tbl$/.cat1/g:S/.2tbl$/.cat2/g:S/.3tbl$/.cat3/g:S/.4tbl$/.cat4/g:S/.5tbl$/.cat5/g:S/.6tbl$/.cat6/g:S/.7tbl$/.cat7/g:S/.8tbl$/.cat8/g:S/.9tbl$/.cat9/g}
+
+.if defined(MANPS)
+
+PSALL= ${MAN:S/.1$/.ps1/g:S/.2$/.ps2/g:S/.3$/.ps3/g:S/.3p$/.ps3p/g:S/.4$/.ps4/g:S/.5$/.ps5/g:S/.6$/.ps6/g:S/.7$/.ps7/g:S/.8$/.ps8/g:S/.9$/.ps9/g:S/.1tbl$/.ps1/g:S/.2tbl$/.ps2/g:S/.3tbl$/.ps3/g:S/.4tbl$/.ps4/g:S/.5tbl$/.ps5/g:S/.6tbl$/.ps6/g:S/.7tbl$/.ps7/g:S/.8tbl$/.ps8/g:S/.9tbl$/.ps9/g}
+
+.endif
+
+.endif
+
+MINSTALL= ${INSTALL} ${INSTALL_COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
+.if defined(MANZ)
+# chown and chmod are done afterward automatically
+MCOMPRESS= gzip -cf
+MCOMPRESSSUFFIX= .gz
+.endif
+
+.if defined(MANSUBDIR)
+# Add / so that we don't have to specify it. Better arch -> MANSUBDIR mapping
+MANSUBDIR:=${MANSUBDIR:S,^,/,}
+.else
+# XXX MANSUBDIR must be non empty for the mlink loops to work
+MANSUBDIR=''
+.endif
+
+maninstall:
+.if defined(MANALL)
+ @for page in ${MANALL}; do \
+ set -- ${MANSUBDIR}; \
+ subdir=$$1; \
+ dir=${DESTDIR}${MANDIR}$${page##*.cat}; \
+ base=$${page##*/}; \
+ instpage=$${dir}$${subdir}/$${base%.*}.0${MCOMPRESSSUFFIX}; \
+ if [ X"${MCOMPRESS}" = X ]; then \
+ echo ${MINSTALL} $$page $$instpage; \
+ ${MINSTALL} $$page $$instpage; \
+ else \
+ rm -f $$instpage; \
+ echo ${MCOMPRESS} $$page \> $$instpage; \
+ ${MCOMPRESS} $$page > $$instpage; \
+ chown ${MANOWN}:${MANGRP} $$instpage; \
+ chmod ${MANMODE} $$instpage; \
+ fi; \
+ while test $$# -ge 2; do \
+ shift; \
+ extra=$${dir}$$1/$${base%.*}.0${MCOMPRESSSUFFIX}; \
+ echo $$extra -\> $$instpage; \
+ ln -f $$instpage $$extra; \
+ done; \
+ done
+.endif
+.if defined(PSALL)
+ @for page in ${PSALL}; do \
+ set -- ${MANSUBDIR}; \
+ subdir=$$1; \
+ dir=${DESTDIR}${PSDIR}$${page##*.ps}; \
+ base=$${page##*/}; \
+ instpage=$${dir}$${subdir}/$${base%.*}.ps${MCOMPRESSSUFFIX}; \
+ if [ X"${MCOMPRESS}" = X ]; then \
+ echo ${MINSTALL} $$page $$instpage; \
+ ${MINSTALL} $$page $$instpage; \
+ else \
+ rm -f $$instpage; \
+ echo ${MCOMPRESS} $$page \> $$instpage; \
+ ${MCOMPRESS} $$page > $$instpage; \
+ chown ${PSOWN}:${PSGRP} $$instpage; \
+ chmod ${PSMODE} $$instpage; \
+ fi; \
+ while test $$# -ge 2; do \
+ shift; \
+ extra=$${dir}$$1/$${base%.*}.ps${MCOMPRESSSUFFIX}; \
+ echo $$extra -\> $$instpage; \
+ ln -f $$instpage $$extra; \
+ done; \
+ done
+.endif
+.if defined(MLINKS) && !empty(MLINKS)
+. for sub in ${MANSUBDIR}
+. for lnk file in ${MLINKS}
+ @l=${DESTDIR}${MANDIR}${lnk:E}${sub}/${lnk:R}.0${MCOMPRESSSUFFIX}; \
+ t=${DESTDIR}${MANDIR}${file:E}${sub}/${file:R}.0${MCOMPRESSSUFFIX}; \
+ echo $$t -\> $$l; \
+ rm -f $$t; ln $$l $$t;
+. endfor
+. endfor
+.endif
+
+.if (defined(MANALL) || defined(PSALL)) && !defined(MANLOCALBUILD)
+all: ${MANALL} ${PSALL}
+
+cleandir: cleanman
+cleanman:
+ rm -f ${MANALL} ${PSALL}
+.endif
diff --git a/pkgtools/bootstrap-mk-files/files/mods/IRIX.bsd.lib.mk b/pkgtools/bootstrap-mk-files/files/mods/IRIX.bsd.lib.mk
new file mode 100644
index 00000000000..02e9d96920a
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/mods/IRIX.bsd.lib.mk
@@ -0,0 +1,522 @@
+# $NetBSD: IRIX.bsd.lib.mk,v 1.1.1.1 2006/07/14 23:13:01 jlam Exp $
+# @(#)bsd.lib.mk 8.3 (Berkeley) 4/22/94
+
+.if !target(__initialized__)
+__initialized__:
+.if exists(${.CURDIR}/../Makefile.inc)
+.include "${.CURDIR}/../Makefile.inc"
+.endif
+.include <bsd.own.mk>
+.include <bsd.obj.mk>
+.include <bsd.depall.mk>
+.MAIN: all
+.endif
+
+.PHONY: checkver cleanlib libinstall
+realinstall: checkver libinstall
+clean cleandir: cleanlib
+
+.if exists(${SHLIB_VERSION_FILE})
+SHLIB_MAJOR != . ${SHLIB_VERSION_FILE} ; echo $$major
+SHLIB_MINOR != . ${SHLIB_VERSION_FILE} ; echo $$minor
+SHLIB_TEENY != . ${SHLIB_VERSION_FILE} ; echo $$teeny
+
+# Check for higher installed library versions.
+.if !defined(NOCHECKVER) && !defined(NOCHECKVER_${LIB}) && \
+ exists(${BSDSRCDIR}/lib/checkver)
+checkver:
+ @(cd ${.CURDIR} && \
+ sh ${BSDSRCDIR}/lib/checkver -v ${SHLIB_VERSION_FILE} \
+ -d ${DESTDIR}${LIBDIR} ${LIB})
+.endif
+.endif
+
+.if !target(checkver)
+checkver:
+.endif
+
+print-shlib-major:
+.if defined(SHLIB_MAJOR)
+ @echo ${SHLIB_MAJOR}
+.else
+ @false
+.endif
+
+print-shlib-minor:
+.if defined(SHLIB_MINOR)
+ @echo ${SHLIB_MINOR}
+.else
+ @false
+.endif
+
+print-shlib-teeny:
+.if defined(SHLIB_TEENY)
+ @echo ${SHLIB_TEENY}
+.else
+ @false
+.endif
+
+.if defined(SHLIB_MAJOR) && !empty(SHLIB_MAJOR)
+.if defined(SHLIB_MINOR) && !empty(SHLIB_MINOR)
+.if defined(SHLIB_TEENY) && !empty(SHLIB_TEENY)
+SHLIB_FULLVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR}.${SHLIB_TEENY}
+.else
+SHLIB_FULLVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR}
+.endif
+.else
+SHLIB_FULLVERSION=${SHLIB_MAJOR}
+.endif
+.endif
+
+# add additional suffixes not exported.
+# .po is used for profiling object files.
+# .so is used for PIC object files.
+.SUFFIXES: .out .a .ln .so .po .o .s .S .c .cc .C .m .F .f .r .y .l .cl .p .h
+.SUFFIXES: .sh .m4 .m
+
+
+# Set PICFLAGS to cc flags for producing position-independent code,
+# if not already set. Includes -DPIC, if required.
+
+# Data-driven table using make variables to control how shared libraries
+# are built for different platforms and object formats.
+# OBJECT_FMT: currently either "ELF" or "a.out", from <bsd.own.mk>
+# SHLIB_SOVERSION: version number to be compiled into a shared library
+# via -soname. Usualy ${SHLIB_MAJOR} on ELF.
+# NetBSD/pmax used to use ${SHLIB_MAJOR}[.${SHLIB_MINOR}
+# [.${SHLIB_TEENY}]]
+# SHLIB_SHFLAGS: Flags to tell ${LD} to emit shared library.
+# with ELF, also set shared-lib version for ld.so.
+# SHLIB_LDSTARTFILE: support .o file, call C++ file-level constructors
+# SHLIB_LDENDFILE: support .o file, call C++ file-level destructors
+# FPICFLAGS: flags for ${FC} to compile .[fF] files to .so objects.
+# CPPICFLAGS: flags for ${CPP} to preprocess .[sS] files for ${AS}
+# CPICFLAGS: flags for ${CC} to compile .[cC] files to .so objects.
+# CAPICFLAGS flags for {$CC} to compiling .[Ss] files
+# (usually just ${CPPPICFLAGS} ${CPICFLAGS})
+# APICFLAGS: flags for ${AS} to assemble .[sS] to .so objects.
+
+.if ${MACHINE_ARCH} == "alpha"
+ # Alpha-specific shared library flags
+FPICFLAGS ?= -fPIC
+CPICFLAGS ?= -fPIC -DPIC
+CPPPICFLAGS?= -DPIC
+CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
+APICFLAGS ?=
+.elif ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"
+ # mips-specific shared library flags
+
+# On mips, all libs are compiled with ABIcalls, not just sharedlibs.
+MKPICLIB= no
+
+# so turn shlib PIC flags on for ${AS}.
+AINC+=-DABICALLS
+AFLAGS+= -fPIC
+AS+= -KPIC
+
+.elif ${MACHINE_ARCH} == "vax" && ${OBJECT_FMT} == "ELF"
+# On the VAX, all object are PIC by default, not just sharedlibs.
+MKPICLIB= no
+
+.elif (${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64") && \
+ ${OBJECT_FMT} == "ELF"
+
+FPICFLAGS ?= -fPIC
+CPICFLAGS ?= -fPIC -DPIC
+CPPPICFLAGS?= -DPIC
+CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
+APICFLAGS ?= -KPIC
+
+.else
+
+# Platform-independent flags for NetBSD a.out shared libraries (and PowerPC)
+SHLIB_LDSTARTFILE=
+SHLIB_LDENDFILE=
+SHLIB_SOVERSION=${SHLIB_FULLVERSION}
+SHLIB_SHFLAGS=
+FPICFLAGS ?= -fPIC
+CPICFLAGS?= -fPIC -DPIC
+CPPPICFLAGS?= -DPIC
+CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
+APICFLAGS?= -k
+
+.endif
+
+MKPICLIB?= yes
+
+# Platform-independent linker flags for ELF shared libraries
+.if ${OBJECT_FMT} == "ELF"
+SHLIB_SOVERSION= ${SHLIB_MAJOR}
+SHLIB_SHFLAGS= -soname lib${LIB}.so.${SHLIB_SOVERSION}
+SHLIB_LDSTARTFILE?= ${DESTDIR}/usr/lib/crtbeginS.o
+SHLIB_LDENDFILE?= ${DESTDIR}/usr/lib/crtendS.o
+.endif
+
+CFLAGS+= ${COPTS}
+FFLAGS+= ${FOPTS}
+
+.c.o:
+.if defined(COPTS) && !empty(COPTS:M*-g*)
+ ${COMPILE.c} ${.IMPSRC}
+.else
+ @echo ${COMPILE.c:Q} ${.IMPSRC}
+ @${COMPILE.c} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.c.po:
+.if defined(COPTS) && !empty(COPTS:M*-g*)
+ ${COMPILE.c} -pg ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.c:Q} -pg ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.c} -pg ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.c.so:
+.if defined(COPTS) && !empty(COPTS:M*-g*)
+ ${COMPILE.c} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.c:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.c} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.c.ln:
+ ${LINT} ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i ${.IMPSRC}
+
+.cc.o .C.o:
+.if defined(COPTS) && !empty(COPTS:M*-g*)
+ ${COMPILE.cc} ${.IMPSRC}
+.else
+ @echo ${COMPILE.cc:Q} ${.IMPSRC}
+ @${COMPILE.cc} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.cc.po .C.po:
+.if defined(COPTS) && !empty(COPTS:M*-g*)
+ ${COMPILE.cc} -pg ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.cc:Q} -pg ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.cc} -pg ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.cc.so .C.so:
+.if defined(COPTS) && !empty(COPTS:M*-g*)
+ ${COMPILE.cc} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.cc:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.cc} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.f.o:
+.if defined(FOPTS) && !empty(FOPTS:M*-g*)
+ ${COMPILE.f} ${.IMPSRC}
+.else
+ @echo ${COMPILE.f:Q} ${.IMPSRC}
+ @${COMPILE.f} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.f.po:
+.if defined(FOPTS) && !empty(FOPTS:M*-g*)
+ ${COMPILE.f} -pg ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.f:Q} -pg ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.f} -pg ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.f.so:
+.if defined(FOPTS) && !empty(FOPTS:M*-g*)
+ ${COMPILE.f} ${FPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.f:Q} ${FPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.f} ${FPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.f.ln:
+ ${ECHO} Skipping lint for Fortran libraries.
+
+.m.o:
+.if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
+ ${COMPILE.m} ${.IMPSRC}
+.else
+ @echo ${COMPILE.m:Q} ${.IMPSRC}
+ @${COMPILE.m} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.m.po:
+.if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
+ ${COMPILE.m} -pg ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.m:Q} -pg ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.m} -pg ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.m.so:
+.if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
+ ${COMPILE.m} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.m:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.m} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.S.o .s.o:
+ @echo ${COMPILE.S:Q} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC}
+ @${COMPILE.S} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+
+.S.po .s.po:
+ @echo ${COMPILE.S:Q} -DGPROF -DPROF ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.S} -DGPROF -DPROF ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+
+.S.so .s.so:
+ @echo ${COMPILE.S:Q} ${CAPICFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.S} ${CAPICFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+
+.if ${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
+ || ${MKLINKLIB} != "no"
+_LIBS=lib${LIB}.a
+.else
+_LIBS=
+.endif
+
+OBJS+=${SRCS:N*.h:N*.sh:R:S/$/.o/g}
+
+.if ${MKPROFILE} != "no"
+_LIBS+=lib${LIB}_p.a
+POBJS+=${OBJS:.o=.po}
+.endif
+
+.if ${MKPIC} != "no"
+.if ${MKPICLIB} == "no"
+SOLIB=lib${LIB}.a
+.else
+SOLIB=lib${LIB}_pic.a
+_LIBS+=${SOLIB}
+SOBJS+=${OBJS:.o=.so}
+.endif
+.if defined(SHLIB_FULLVERSION)
+_LIBS+=lib${LIB}.so.${SHLIB_FULLVERSION}
+.endif
+.endif
+
+LOBJS+=${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
+.if ${MKLINT} != "no" && ${MKLINKLIB} != "no" && !empty(LOBJS)
+_LIBS+=llib-l${LIB}.ln
+.endif
+
+.if ${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
+ || ${MKLINKLIB} != "no"
+ALLOBJS=${OBJS} ${POBJS} ${SOBJS}
+.else
+ALLOBJS=${POBJS} ${SOBJS}
+.endif
+.if ${MKLINT} != "no" && ${MKLINKLIB} != "no" && !empty(LOBJS)
+ALLOBJS+=${LOBJS}
+.endif
+.NOPATH: ${ALLOBJS} ${_LIBS}
+
+realall: ${SRCS} ${ALLOBJS:O} ${_LIBS}
+
+__archivebuild: .USE
+ @rm -f ${.TARGET}
+ ${AR} cq ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}`
+
+__archiveinstall: .USE
+ ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
+ -g ${LIBGRP} -m 600 ${.ALLSRC} ${.TARGET}
+ chmod ${LIBMODE} ${.TARGET}
+
+DPSRCS+= ${SRCS:M*.l:.l=.c} ${SRCS:M*.y:.y=.c}
+CLEANFILES+= ${DPSRCS}
+.if defined(YHEADER)
+CLEANFILES+= ${SRCS:M*.y:.y=.h}
+.endif
+
+lib${LIB}.a:: ${OBJS} __archivebuild
+ @echo building standard ${LIB} library
+
+lib${LIB}_p.a:: ${POBJS} __archivebuild
+ @echo building profiled ${LIB} library
+
+lib${LIB}_pic.a:: ${SOBJS} __archivebuild
+ @echo building shared object ${LIB} library
+
+lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOLIB} ${DPADD} \
+ ${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}
+ @echo building shared ${LIB} library \(version ${SHLIB_FULLVERSION}\)
+ @rm -f lib${LIB}.so.${SHLIB_FULLVERSION}
+.if defined(DESTDIR)
+ $(LD) -nostdlib -x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
+ ${SHLIB_LDSTARTFILE} \
+ -all archive ${SOLIB} \
+ -none ${LDADD} \
+ -L${DESTDIR}${LIBDIR} -rpath ${LIBDIR} \
+ ${SHLIB_LDENDFILE}
+.else
+ $(LD) -x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
+ ${SHLIB_LDSTARTFILE} \
+ -all ${SOLIB} -none ${LDADD} \
+ ${SHLIB_LDENDFILE}
+.endif
+.if ${OBJECT_FMT} == "ELF"
+ ln -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.${SHLIB_MAJOR}.tmp
+ mv -f lib${LIB}.so.${SHLIB_MAJOR}.tmp lib${LIB}.so.${SHLIB_MAJOR}
+ ln -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.tmp
+ mv -f lib${LIB}.so.tmp lib${LIB}.so
+.endif
+
+.if !empty(LOBJS)
+LLIBS?= -lc
+llib-l${LIB}.ln: ${LOBJS}
+ @echo building llib-l${LIB}.ln
+ @rm -f llib-l${LIB}.ln
+ @${LINT} -C${LIB} ${.ALLSRC} ${LLIBS}
+.endif
+
+cleanlib:
+ rm -f a.out [Ee]rrs mklog core *.core ${CLEANFILES}
+ rm -f lib${LIB}.a ${OBJS}
+ rm -f lib${LIB}_p.a ${POBJS}
+ rm -f lib${LIB}_pic.a lib${LIB}.so.* lib${LIB}.so ${SOBJS}
+ rm -f llib-l${LIB}.ln ${LOBJS}
+
+.if defined(SRCS)
+afterdepend: .depend
+ @(TMP=/tmp/_depend$$$$; \
+ sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po \1.so \1.ln:/' \
+ < .depend > $$TMP; \
+ mv $$TMP .depend)
+.endif
+
+.if !target(libinstall)
+# Make sure it gets defined, in case MKPIC==no && MKLINKLIB==no
+libinstall::
+
+.if ${MKLINKLIB} != "no"
+libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.a
+.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.a
+.if !defined(UPDATE)
+.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}.a
+.endif
+
+.if !defined(BUILD) && !make(all) && !make(lib${LIB}.a)
+${DESTDIR}${LIBDIR}/lib${LIB}.a: .MADE
+.endif
+${DESTDIR}${LIBDIR}/lib${LIB}.a: lib${LIB}.a __archiveinstall
+.endif
+
+.if ${MKPROFILE} != "no"
+libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
+.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
+.if !defined(UPDATE)
+.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
+.endif
+
+.if !defined(BUILD) && !make(all) && !make(lib${LIB}_p.a)
+${DESTDIR}${LIBDIR}/lib${LIB}_p.a: .MADE
+.endif
+${DESTDIR}${LIBDIR}/lib${LIB}_p.a: lib${LIB}_p.a __archiveinstall
+.endif
+
+.if ${MKPIC} != "no" && ${MKPICINSTALL} != "no"
+libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
+.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
+.if !defined(UPDATE)
+.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
+.endif
+
+.if !defined(BUILD) && !make(all) && !make(lib${LIB}_pic.a)
+${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: .MADE
+.endif
+.if ${MKPICLIB} == "no"
+${DESTDIR}${LIBDIR}/lib${LIB}_pic.a:
+ rm -f ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
+ ln -s lib${LIB}.a ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
+.else
+${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: lib${LIB}_pic.a __archiveinstall
+.endif
+.endif
+
+.if ${MKPIC} != "no" && defined(SHLIB_FULLVERSION)
+libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
+.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
+.if !defined(UPDATE)
+.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
+.endif
+
+.if !defined(BUILD) && !make(all) && !make(lib${LIB}.so.${SHLIB_FULLVERSION})
+${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: .MADE
+.endif
+${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: lib${LIB}.so.${SHLIB_FULLVERSION}
+ ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
+ -g ${LIBGRP} -m ${LIBMODE} ${.ALLSRC} ${.TARGET}
+.if ${OBJECT_FMT} == "a.out" && !defined(DESTDIR)
+ /sbin/ldconfig -m ${LIBDIR}
+.endif
+.if ${OBJECT_FMT} == "ELF"
+ ln -sf lib${LIB}.so.${SHLIB_FULLVERSION}\
+ ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.tmp
+ mv -f ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.tmp\
+ ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}
+.if ${MKLINKLIB} != "no"
+ ln -sf lib${LIB}.so.${SHLIB_FULLVERSION}\
+ ${DESTDIR}${LIBDIR}/lib${LIB}.so.tmp
+ mv -f ${DESTDIR}${LIBDIR}/lib${LIB}.so.tmp\
+ ${DESTDIR}${LIBDIR}/lib${LIB}.so
+.endif
+.endif
+.endif
+
+.if ${MKLINT} != "no" && ${MKLINKLIB} != "no" && !empty(LOBJS)
+libinstall:: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
+.PRECIOUS: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
+.if !defined(UPDATE)
+.PHONY: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
+.endif
+
+.if !defined(BUILD) && !make(all) && !make(llib-l${LIB}.ln)
+${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: .MADE
+.endif
+${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: llib-l${LIB}.ln
+ ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
+ -g ${LIBGRP} -m ${LIBMODE} ${.ALLSRC} ${DESTDIR}${LINTLIBDIR}
+.endif
+.endif
+
+.include <bsd.man.mk>
+.include <bsd.nls.mk>
+.include <bsd.files.mk>
+.include <bsd.inc.mk>
+.include <bsd.links.mk>
+.include <bsd.dep.mk>
+.include <bsd.sys.mk>
+
+# Make sure all of the standard targets are defined, even if they do nothing.
+lint regress:
diff --git a/pkgtools/bootstrap-mk-files/files/mods/IRIX.bsd.own.mk.in b/pkgtools/bootstrap-mk-files/files/mods/IRIX.bsd.own.mk.in
new file mode 100644
index 00000000000..db177c8f54a
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/mods/IRIX.bsd.own.mk.in
@@ -0,0 +1,246 @@
+# $NetBSD: IRIX.bsd.own.mk.in,v 1.1.1.1 2006/07/14 23:13:01 jlam Exp $
+
+.if !defined(_IRIX_OWN_MK_)
+_IRIX_OWN_MK_=1
+
+.if defined(MAKECONF) && exists(${MAKECONF})
+.include "${MAKECONF}"
+.elif exists(@SYSCONFDIR@/mk.conf)
+.include "@SYSCONFDIR@/mk.conf"
+.elif exists(/etc/mk.conf)
+.include "/etc/mk.conf"
+.endif
+
+# Defining `SKEY' causes support for S/key authentication to be compiled in.
+SKEY= yes
+
+# where the system object and source trees are kept; can be configurable
+# by the user in case they want them in ~/foosrc and ~/fooobj, for example
+BSDSRCDIR?= /opt/bsd/src
+BSDOBJDIR?= /opt/bsd/obj
+
+BINGRP?= @ROOT_GROUP@
+BINOWN?= root
+BINMODE?= 555
+NONBINMODE?= 444
+
+# Define MANZ to have the man pages compressed (gzip)
+#MANZ= 1
+
+MANDIR?= /usr/share/man
+MANGRP?= @ROOT_GROUP@
+MANOWN?= ${BINOWN}
+MANMODE?= ${NONBINMODE}
+MANINSTALL?= maninstall catinstall
+
+INFODIR?= /usr/share/info
+INFOGRP?= @ROOT_GROUP@
+INFOOWN?= ${BINOWN}
+INFOMODE?= ${NONBINMODE}
+
+LIBDIR?= /usr/lib
+LINTLIBDIR?= ${LIBDIR}/lint
+LIBGRP?= ${BINGRP}
+LIBOWN?= ${BINOWN}
+LIBMODE?= ${NONBINMODE}
+
+DOCDIR?= /usr/share/doc
+HTMLDOCDIR?= /usr/share/doc/html
+DOCGRP?= @ROOT_GROUP@
+DOCOWN?= ${BINOWN}
+DOCMODE?= ${NONBINMODE}
+
+NLSDIR?= /usr/share/nls
+NLSGRP?= @ROOT_GROUP@
+NLSOWN?= ${BINOWN}
+NLSMODE?= ${NONBINMODE}
+
+LOCALEDIR?= /usr/lib/locale
+LOCALEGRP?= @ROOT_GROUP@
+LOCALEOWN?= ${BINOWN}
+LOCALEMODE?= ${NONBINMODE}
+
+COPY?= -c
+.if defined(UPDATE)
+PRESERVE?= -p
+.else
+PRESERVE?=
+.endif
+.if defined(UNPRIVILEGED)
+INSTPRIV?= -U
+.endif
+STRIPFLAG?= -s
+
+# Define SYS_INCLUDE to indicate whether you want symbolic links to the system
+# source (``symlinks''), or a separate copy (``copies''); (latter useful
+# in environments where it's not possible to keep /sys publicly readable)
+#SYS_INCLUDE= symlinks
+
+OBJECT_FMT?=ELF
+
+# GNU sources and packages sometimes see architecture names differently.
+# This table maps an architecture name to its GNU counterpart.
+# Use as so: ${GNU_ARCH.${TARGET_ARCH}} or ${MACHINE_GNU_ARCH}
+.ifndef MACHINE_GNU_ARCH
+GNU_ARCH.alpha=alpha
+GNU_ARCH.arm26=arm
+GNU_ARCH.arm32=arm
+GNU_ARCH.arm=arm
+GNU_ARCH.i386=i386
+GNU_ARCH.m68k=m68k
+GNU_ARCH.mipseb=mipseb
+GNU_ARCH.mipsel=mipsel
+GNU_ARCH.ns32k=ns32k
+GNU_ARCH.powerpc=powerpc
+GNU_ARCH.sh3eb=sh
+GNU_ARCH.sh3el=sh
+GNU_ARCH.sparc=sparc
+GNU_ARCH.sparc64=sparc64
+GNU_ARCH.vax=vax
+MACHINE_GNU_ARCH=${GNU_ARCH.${MACHINE_ARCH}}
+.endif
+
+# CPU model, derived from MACHINE_ARCH
+MACHINE_CPU= ${MACHINE_ARCH:C/mipse[bl]/mips/:S/arm26/arm/:S/arm32/arm/:C/sh3e[bl]/sh3/:S/m68000/m68k/}
+
+TARGETS+= all clean cleandir depend dependall includes \
+ install lint obj regress tags html installhtml cleanhtml
+.PHONY: all clean cleandir depend dependall distclean includes \
+ install lint obj regress tags beforedepend afterdepend \
+ beforeinstall afterinstall realinstall realdepend realall \
+ html installhtml cheanhtml
+
+# set NEED_OWN_INSTALL_TARGET, if it's not already set, to yes
+# this is used by bsd.pkg.mk to stop "install" being defined
+NEED_OWN_INSTALL_TARGET?= yes
+
+.if ${NEED_OWN_INSTALL_TARGET} == "yes"
+.if !target(install)
+install: .NOTMAIN beforeinstall subdir-install realinstall afterinstall
+beforeinstall: .NOTMAIN
+subdir-install: .NOTMAIN beforeinstall
+realinstall: .NOTMAIN beforeinstall
+afterinstall: .NOTMAIN subdir-install realinstall
+.endif
+all: .NOTMAIN realall subdir-all
+subdir-all: .NOTMAIN
+realall: .NOTMAIN
+depend: .NOTMAIN realdepend subdir-depend
+subdir-depend: .NOTMAIN
+realdepend: .NOTMAIN
+distclean: .NOTMAIN cleandir
+.endif
+
+PRINTOBJDIR= printf "xxx: .MAKE\n\t@echo \$${.OBJDIR}\n" | ${MAKE} -B -s -f-
+
+# Define MKxxx variables (which are either yes or no) for users
+# to set in /etc/mk.conf and override on the make commandline.
+# These should be tested with `== "no"' or `!= "no"'.
+# The NOxxx variables should only be used by Makefiles.
+#
+
+MKCATPAGES?=yes
+
+.if defined(NODOC)
+MKDOC=no
+#.elif !defined(MKDOC)
+#MKDOC=yes
+.else
+MKDOC?=yes
+.endif
+
+MKINFO?=yes
+
+.if defined(NOLINKLIB)
+MKLINKLIB=no
+.else
+MKLINKLIB?=yes
+.endif
+.if ${MKLINKLIB} == "no"
+MKPICINSTALL=no
+MKPROFILE=no
+.endif
+
+.if defined(NOLINT)
+MKLINT=no
+.else
+MKLINT?=yes
+.endif
+
+.if defined(NOMAN)
+MKMAN=no
+.else
+MKMAN?=yes
+.endif
+.if ${MKMAN} == "no"
+MKCATPAGES=no
+.endif
+
+.if defined(NONLS)
+MKNLS=no
+.else
+MKNLS?=yes
+.endif
+
+#
+# MKOBJDIRS controls whether object dirs are created during "make build".
+# MKOBJ controls whether the "make obj" rule does anything.
+#
+.if defined(NOOBJ)
+MKOBJ=no
+MKOBJDIRS=no
+.else
+MKOBJ?=yes
+MKOBJDIRS?=no
+.endif
+
+.if defined(NOPIC)
+MKPIC=no
+.else
+MKPIC?=yes
+.endif
+
+.if defined(NOPICINSTALL)
+MKPICINSTALL=no
+.else
+MKPICINSTALL?=yes
+.endif
+
+.if defined(NOPROFILE)
+MKPROFILE=no
+.else
+MKPROFILE?=yes
+.endif
+
+.if defined(NOSHARE)
+MKSHARE=no
+.else
+MKSHARE?=yes
+.endif
+.if ${MKSHARE} == "no"
+MKCATPAGES=no
+MKDOC=no
+MKINFO=no
+MKMAN=no
+MKNLS=no
+.endif
+
+.if defined(NOCRYPTO)
+MKCRYPTO=no
+.else
+MKCRYPTO?=yes
+.endif
+
+MKCRYPTO_IDEA?=no
+
+MKCRYPTO_RC5?=no
+
+.if defined(NOKERBEROS) || (${MKCRYPTO} == "no")
+MKKERBEROS=no
+.else
+MKKERBEROS?=yes
+.endif
+
+MKSOFTFLOAT?=no
+
+.endif # _IRIX_OWN_MK_
diff --git a/pkgtools/bootstrap-mk-files/files/mods/IRIX.sys.mk b/pkgtools/bootstrap-mk-files/files/mods/IRIX.sys.mk
new file mode 100644
index 00000000000..65bb989eb94
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/mods/IRIX.sys.mk
@@ -0,0 +1,193 @@
+# $NetBSD: IRIX.sys.mk,v 1.1.1.1 2006/07/14 23:13:01 jlam Exp $
+# @(#)sys.mk 8.2 (Berkeley) 3/21/94
+
+unix?= We run Unix
+OS!= uname -s
+
+.SUFFIXES: .out .a .ln .o .s .S .c .cc .cpp .cxx .C .F .f .r .y .l .cl .p .h
+.SUFFIXES: .sh .m4
+
+.LIBS: .a
+
+AR?= ar
+ARFLAGS?= rl
+RANLIB?= true
+
+AS?= as
+AFLAGS?=
+COMPILE.s?= ${CC} ${AFLAGS} -c
+LINK.s?= ${CC} ${AFLAGS} ${LDFLAGS}
+COMPILE.S?= ${CC} ${AFLAGS} ${CPPFLAGS} -c -traditional-cpp
+LINK.S?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+CC?= cc
+NOGCCERROR?= # defined
+DBG?= -O2
+CFLAGS?= ${DBG}
+COMPILE.c?= ${CC} ${CFLAGS} ${CPPFLAGS} -c
+LINK.c?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+CXX?= CC
+CXXFLAGS?= ${CFLAGS}
+COMPILE.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
+LINK.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+OBJC?= ${CC}
+OBJCFLAGS?= ${CFLAGS}
+COMPILE.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c
+LINK.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+CPP?= CC -E
+CPPFLAGS?=
+
+FC?= f77
+FFLAGS?= -O
+RFLAGS?=
+COMPILE.f?= ${FC} ${FFLAGS} -c
+LINK.f?= ${FC} ${FFLAGS} ${LDFLAGS}
+COMPILE.F?= ${FC} ${FFLAGS} ${CPPFLAGS} -c
+LINK.F?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.r?= ${FC} ${FFLAGS} ${RFLAGS} -c
+LINK.r?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
+
+INSTALL?= ${PREFIX}/bin/install-sh
+
+LEX?= lex
+LFLAGS?=
+LEX.l?= ${LEX} ${LFLAGS}
+
+LD?= ld
+LDFLAGS?=
+
+LINT?= lint
+LINTFLAGS?= -chapbxzF
+
+LORDER?= lorder
+
+MAKE?= make
+
+NM?= nm
+
+PC?= pc
+PFLAGS?=
+COMPILE.p?= ${PC} ${PFLAGS} ${CPPFLAGS} -c
+LINK.p?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+SHELL?= sh
+
+SIZE?= size
+
+TSORT?= tsort
+
+YACC?= yacc
+YFLAGS?=
+YACC.y?= ${YACC} ${YFLAGS}
+
+# C
+.c:
+ ${LINK.c} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.c.o:
+ ${COMPILE.c} ${.IMPSRC}
+.c.a:
+ ${COMPILE.c} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+.c.ln:
+ ${LINT} ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i ${.IMPSRC}
+
+# C++
+.cc .cpp .cxx .C:
+ ${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.cc.o .cpp.o .cxx.o .C.o:
+ ${COMPILE.cc} ${.IMPSRC}
+.cc.a .cpp.a .cxx.a .C.a:
+ ${COMPILE.cc} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Fortran/Ratfor
+.f:
+ ${LINK.f} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.f.o:
+ ${COMPILE.f} ${.IMPSRC}
+.f.a:
+ ${COMPILE.f} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+.F:
+ ${LINK.F} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.F.o:
+ ${COMPILE.F} ${.IMPSRC}
+.F.a:
+ ${COMPILE.F} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+.r:
+ ${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.r.o:
+ ${COMPILE.r} ${.IMPSRC}
+.r.a:
+ ${COMPILE.r} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Pascal
+.p:
+ ${LINK.p} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.p.o:
+ ${COMPILE.p} ${.IMPSRC}
+.p.a:
+ ${COMPILE.p} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Assembly
+.s:
+ ${LINK.s} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.s.o:
+ ${COMPILE.s} ${.IMPSRC}
+.s.a:
+ ${COMPILE.s} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+.S:
+ ${LINK.S} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.S.o:
+ ${COMPILE.S} ${.IMPSRC}
+.S.a:
+ ${COMPILE.S} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Lex
+.l:
+ ${LEX.l} ${.IMPSRC}
+ ${LINK.c} -o ${.TARGET} lex.yy.c ${LDLIBS} -ll
+ rm -f lex.yy.c
+.l.c:
+ ${LEX.l} ${.IMPSRC}
+ mv lex.yy.c ${.TARGET}
+.l.o:
+ ${LEX.l} ${.IMPSRC}
+ ${COMPILE.c} -o ${.TARGET} lex.yy.c
+ rm -f lex.yy.c
+
+# Yacc
+.y:
+ ${YACC.y} ${.IMPSRC}
+ ${LINK.c} -o ${.TARGET} y.tab.c ${LDLIBS}
+ rm -f y.tab.c
+.y.c:
+ ${YACC.y} ${.IMPSRC}
+ mv y.tab.c ${.TARGET}
+.y.o:
+ ${YACC.y} ${.IMPSRC}
+ ${COMPILE.c} -o ${.TARGET} y.tab.c
+ rm -f y.tab.c
+
+# Shell
+.sh:
+ rm -f ${.TARGET}
+ cp ${.IMPSRC} ${.TARGET}
diff --git a/pkgtools/bootstrap-mk-files/files/mods/Interix.bsd.lib.mk b/pkgtools/bootstrap-mk-files/files/mods/Interix.bsd.lib.mk
new file mode 100644
index 00000000000..089a6c3014c
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/mods/Interix.bsd.lib.mk
@@ -0,0 +1,472 @@
+# $NetBSD: Interix.bsd.lib.mk,v 1.1.1.1 2006/07/14 23:13:01 jlam Exp $
+# @(#)bsd.lib.mk 8.3 (Berkeley) 4/22/94
+
+.if !target(__initialized__)
+__initialized__:
+.if exists(${.CURDIR}/../Makefile.inc)
+.include "${.CURDIR}/../Makefile.inc"
+.endif
+.include <bsd.own.mk>
+.include <bsd.obj.mk>
+.include <bsd.depall.mk>
+.MAIN: all
+.endif
+
+.PHONY: checkver cleanlib libinstall
+realinstall: checkver libinstall
+clean cleandir: cleanlib
+
+.if exists(${SHLIB_VERSION_FILE})
+SHLIB_MAJOR != . ${SHLIB_VERSION_FILE} ; echo $$major
+SHLIB_MINOR != . ${SHLIB_VERSION_FILE} ; echo $$minor
+SHLIB_TEENY != . ${SHLIB_VERSION_FILE} ; echo $$teeny
+
+# Check for higher installed library versions.
+.if !defined(NOCHECKVER) && !defined(NOCHECKVER_${LIB}) && \
+ exists(${BSDSRCDIR}/lib/checkver)
+checkver:
+ @(cd ${.CURDIR} && \
+ sh ${BSDSRCDIR}/lib/checkver -v ${SHLIB_VERSION_FILE} \
+ -d ${DESTDIR}${LIBDIR} ${LIB})
+.endif
+.endif
+
+.if !target(checkver)
+checkver:
+.endif
+
+print-shlib-major:
+.if defined(SHLIB_MAJOR)
+ @echo ${SHLIB_MAJOR}
+.else
+ @false
+.endif
+
+print-shlib-minor:
+.if defined(SHLIB_MINOR)
+ @echo ${SHLIB_MINOR}
+.else
+ @false
+.endif
+
+print-shlib-teeny:
+.if defined(SHLIB_TEENY)
+ @echo ${SHLIB_TEENY}
+.else
+ @false
+.endif
+
+.if defined(SHLIB_MAJOR) && !empty(SHLIB_MAJOR)
+.if defined(SHLIB_MINOR) && !empty(SHLIB_MINOR)
+.if defined(SHLIB_TEENY) && !empty(SHLIB_TEENY)
+SHLIB_FULLVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR}.${SHLIB_TEENY}
+.else
+SHLIB_FULLVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR}
+.endif
+.else
+SHLIB_FULLVERSION=${SHLIB_MAJOR}
+.endif
+.endif
+
+# add additional suffixes not exported.
+# .po is used for profiling object files.
+# .so is used for PIC object files.
+.SUFFIXES: .out .a .ln .so .po .o .s .S .c .cc .C .m .F .f .r .y .l .cl .p .h
+.SUFFIXES: .sh .m4 .m
+
+
+# Set PICFLAGS to cc flags for producing position-independent code,
+# if not already set. Includes -DPIC, if required.
+
+# Data-driven table using make variables to control how shared libraries
+# are built for different platforms and object formats.
+# OBJECT_FMT: currently either "ELF" or "a.out", from <bsd.own.mk>
+# SHLIB_SOVERSION: version number to be compiled into a shared library
+# via -soname. Usualy ${SHLIB_MAJOR} on ELF.
+# NetBSD/pmax used to use ${SHLIB_MAJOR}[.${SHLIB_MINOR}
+# [.${SHLIB_TEENY}]]
+# SHLIB_SHFLAGS: Flags to tell ${LD} to emit shared library.
+# with ELF, also set shared-lib version for ld.so.
+# SHLIB_LDSTARTFILE: support .o file, call C++ file-level constructors
+# SHLIB_LDENDFILE: support .o file, call C++ file-level destructors
+# FPICFLAGS: flags for ${FC} to compile .[fF] files to .so objects.
+# CPPICFLAGS: flags for ${CPP} to preprocess .[sS] files for ${AS}
+# CPICFLAGS: flags for ${CC} to compile .[cC] files to .so objects.
+# CAPICFLAGS flags for {$CC} to compiling .[Ss] files
+# (usually just ${CPPPICFLAGS} ${CPICFLAGS})
+# APICFLAGS: flags for ${AS} to assemble .[sS] to .so objects.
+
+SHLIB_LDSTARTFILE=
+SHLIB_LDENDFILE=
+SHLIB_SOVERSION= ${SHLIB_MAJOR}
+SHLIB_SHFLAGS= -Wl,-h,lib${LIB}.so.${SHLIB_SOVERSION}
+FPICFLAGS?=
+CPICFLAGS?= -DPIC
+CPPPICFLAGS?= -DPIC
+CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
+APICFLAGS?=
+
+MKPICLIB?= yes
+
+CFLAGS+= ${COPTS}
+FFLAGS+= ${FOPTS}
+
+.c.o:
+.if defined(COPTS) && !empty(COPTS:M*-g*)
+ ${COMPILE.c} ${.IMPSRC}
+.else
+ @echo ${COMPILE.c:Q} ${.IMPSRC}
+ @${COMPILE.c} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.c.po:
+.if defined(COPTS) && !empty(COPTS:M*-g*)
+ ${COMPILE.c} -pg ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.c:Q} -pg ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.c} -pg ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.c.so:
+.if defined(COPTS) && !empty(COPTS:M*-g*)
+ ${COMPILE.c} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.c:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.c} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.c.ln:
+ ${LINT} ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i ${.IMPSRC}
+
+.cc.o .C.o:
+.if defined(COPTS) && !empty(COPTS:M*-g*)
+ ${COMPILE.cc} ${.IMPSRC}
+.else
+ @echo ${COMPILE.cc:Q} ${.IMPSRC}
+ @${COMPILE.cc} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.cc.po .C.po:
+.if defined(COPTS) && !empty(COPTS:M*-g*)
+ ${COMPILE.cc} -pg ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.cc:Q} -pg ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.cc} -pg ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.cc.so .C.so:
+.if defined(COPTS) && !empty(COPTS:M*-g*)
+ ${COMPILE.cc} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.cc:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.cc} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.f.o:
+.if defined(FOPTS) && !empty(FOPTS:M*-g*)
+ ${COMPILE.f} ${.IMPSRC}
+.else
+ @echo ${COMPILE.f:Q} ${.IMPSRC}
+ @${COMPILE.f} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.f.po:
+.if defined(FOPTS) && !empty(FOPTS:M*-g*)
+ ${COMPILE.f} -pg ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.f:Q} -pg ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.f} -pg ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.f.so:
+.if defined(FOPTS) && !empty(FOPTS:M*-g*)
+ ${COMPILE.f} ${FPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.f:Q} ${FPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.f} ${FPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.f.ln:
+ ${ECHO} Skipping lint for Fortran libraries.
+
+.m.o:
+.if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
+ ${COMPILE.m} ${.IMPSRC}
+.else
+ @echo ${COMPILE.m:Q} ${.IMPSRC}
+ @${COMPILE.m} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.m.po:
+.if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
+ ${COMPILE.m} -pg ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.m:Q} -pg ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.m} -pg ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.m.so:
+.if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
+ ${COMPILE.m} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.m:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.m} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.S.o .s.o:
+ @echo ${COMPILE.S:Q} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC}
+ @${COMPILE.S} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+
+.S.po .s.po:
+ @echo ${COMPILE.S:Q} -DGPROF -DPROF ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.S} -DGPROF -DPROF ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+
+.S.so .s.so:
+ @echo ${COMPILE.S:Q} ${CAPICFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.S} ${CAPICFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+
+.if ${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
+ || ${MKLINKLIB} != "no"
+_LIBS=lib${LIB}.a
+.else
+_LIBS=
+.endif
+
+OBJS+=${SRCS:N*.h:N*.sh:R:S/$/.o/g}
+
+.if ${MKPROFILE} != "no"
+_LIBS+=lib${LIB}_p.a
+POBJS+=${OBJS:.o=.po}
+.endif
+
+.if ${MKPIC} != "no"
+.if ${MKPICLIB} == "no"
+SOLIB=lib${LIB}.a
+.else
+SOLIB=lib${LIB}_pic.a
+_LIBS+=${SOLIB}
+SOBJS+=${OBJS:.o=.so}
+.endif
+.if defined(SHLIB_FULLVERSION)
+_LIBS+=lib${LIB}.so.${SHLIB_FULLVERSION}
+.endif
+.endif
+
+LOBJS+=${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
+.if ${MKLINT} != "no" && ${MKLINKLIB} != "no" && !empty(LOBJS)
+_LIBS+=llib-l${LIB}.ln
+.endif
+
+.if ${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
+ || ${MKLINKLIB} != "no"
+ALLOBJS=${OBJS} ${POBJS} ${SOBJS}
+.else
+ALLOBJS=${POBJS} ${SOBJS}
+.endif
+.if ${MKLINT} != "no" && ${MKLINKLIB} != "no" && !empty(LOBJS)
+ALLOBJS+=${LOBJS}
+.endif
+.NOPATH: ${ALLOBJS} ${_LIBS}
+
+realall: ${SRCS} ${ALLOBJS:O} ${_LIBS}
+
+__archivebuild: .USE
+ @rm -f ${.TARGET}
+ ${AR} cq ${.TARGET} ${.ALLSRC:M*o}
+ ${RANLIB} ${.TARGET}
+
+__archiveinstall: .USE
+ ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
+ -g ${LIBGRP} -m 600 ${.ALLSRC} ${.TARGET}
+ ${RANLIB} -t ${.TARGET}
+ chmod ${LIBMODE} ${.TARGET}
+
+DPSRCS+= ${SRCS:M*.l:.l=.c} ${SRCS:M*.y:.y=.c}
+CLEANFILES+= ${DPSRCS}
+.if defined(YHEADER)
+CLEANFILES+= ${SRCS:M*.y:.y=.h}
+.endif
+
+lib${LIB}.a:: ${OBJS} __archivebuild
+ @echo building standard ${LIB} library
+
+lib${LIB}_p.a:: ${POBJS} __archivebuild
+ @echo building profiled ${LIB} library
+
+lib${LIB}_pic.a:: ${SOBJS} __archivebuild
+ @echo building shared object ${LIB} library
+
+lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOLIB} ${DPADD} \
+ ${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}
+ @echo building shared ${LIB} library \(version ${SHLIB_FULLVERSION}\)
+ @rm -f lib${LIB}.so.${SHLIB_FULLVERSION}
+ $(CC) -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
+ ${SHLIB_LDSTARTFILE} \
+ -Wl,--image-base,$$(($$RANDOM %4096/2*262144+1342177280)) \
+ -Wl,--whole-archive ${SOLIB} -Wl,--no-whole-archive ${LDADD} \
+ ${SHLIB_LDENDFILE}
+.if ${OBJECT_FMT} == "ELF"
+ ln -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.${SHLIB_MAJOR}.tmp
+ mv -f lib${LIB}.so.${SHLIB_MAJOR}.tmp lib${LIB}.so.${SHLIB_MAJOR}
+ ln -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.tmp
+ mv -f lib${LIB}.so.tmp lib${LIB}.so
+.endif
+
+.if !empty(LOBJS)
+LLIBS?= -lc
+llib-l${LIB}.ln: ${LOBJS}
+ @echo building llib-l${LIB}.ln
+ @rm -f llib-l${LIB}.ln
+ @${LINT} -C${LIB} ${.ALLSRC} ${LLIBS}
+.endif
+
+cleanlib:
+ rm -f a.out [Ee]rrs mklog core *.core ${CLEANFILES}
+ rm -f lib${LIB}.a ${OBJS}
+ rm -f lib${LIB}_p.a ${POBJS}
+ rm -f lib${LIB}_pic.a lib${LIB}.so.* lib${LIB}.so ${SOBJS}
+ rm -f llib-l${LIB}.ln ${LOBJS}
+
+.if defined(SRCS)
+afterdepend: .depend
+ @(TMP=/tmp/_depend$$$$; \
+ sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po \1.so \1.ln:/' \
+ < .depend > $$TMP; \
+ mv $$TMP .depend)
+.endif
+
+.if !target(libinstall)
+# Make sure it gets defined, in case MKPIC==no && MKLINKLIB==no
+libinstall::
+
+.if ${MKLINKLIB} != "no"
+libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.a
+.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.a
+.if !defined(UPDATE)
+.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}.a
+.endif
+
+.if !defined(BUILD) && !make(all) && !make(lib${LIB}.a)
+${DESTDIR}${LIBDIR}/lib${LIB}.a: .MADE
+.endif
+${DESTDIR}${LIBDIR}/lib${LIB}.a: lib${LIB}.a __archiveinstall
+.endif
+
+.if ${MKPROFILE} != "no"
+libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
+.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
+.if !defined(UPDATE)
+.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
+.endif
+
+.if !defined(BUILD) && !make(all) && !make(lib${LIB}_p.a)
+${DESTDIR}${LIBDIR}/lib${LIB}_p.a: .MADE
+.endif
+${DESTDIR}${LIBDIR}/lib${LIB}_p.a: lib${LIB}_p.a __archiveinstall
+.endif
+
+.if ${MKPIC} != "no" && ${MKPICINSTALL} != "no"
+libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
+.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
+.if !defined(UPDATE)
+.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
+.endif
+
+.if !defined(BUILD) && !make(all) && !make(lib${LIB}_pic.a)
+${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: .MADE
+.endif
+.if ${MKPICLIB} == "no"
+${DESTDIR}${LIBDIR}/lib${LIB}_pic.a:
+ rm -f ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
+ ln -s lib${LIB}.a ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
+.else
+${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: lib${LIB}_pic.a __archiveinstall
+.endif
+.endif
+
+.if ${MKPIC} != "no" && defined(SHLIB_FULLVERSION)
+libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
+.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
+.if !defined(UPDATE)
+.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
+.endif
+
+.if !defined(BUILD) && !make(all) && !make(lib${LIB}.so.${SHLIB_FULLVERSION})
+${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: .MADE
+.endif
+${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: lib${LIB}.so.${SHLIB_FULLVERSION}
+ ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
+ -g ${LIBGRP} -m ${LIBMODE} ${.ALLSRC} ${.TARGET}
+.if ${OBJECT_FMT} == "a.out" && !defined(DESTDIR)
+ /sbin/ldconfig -m ${LIBDIR}
+.endif
+.if ${OBJECT_FMT} == "ELF"
+ ln -sf lib${LIB}.so.${SHLIB_FULLVERSION}\
+ ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.tmp
+ mv -f ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.tmp\
+ ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}
+.if ${MKLINKLIB} != "no"
+ ln -sf lib${LIB}.so.${SHLIB_FULLVERSION}\
+ ${DESTDIR}${LIBDIR}/lib${LIB}.so.tmp
+ mv -f ${DESTDIR}${LIBDIR}/lib${LIB}.so.tmp\
+ ${DESTDIR}${LIBDIR}/lib${LIB}.so
+.endif
+.endif
+.endif
+
+.if ${MKLINT} != "no" && ${MKLINKLIB} != "no" && !empty(LOBJS)
+libinstall:: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
+.PRECIOUS: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
+.if !defined(UPDATE)
+.PHONY: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
+.endif
+
+.if !defined(BUILD) && !make(all) && !make(llib-l${LIB}.ln)
+${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: .MADE
+.endif
+${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: llib-l${LIB}.ln
+ ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
+ -g ${LIBGRP} -m ${LIBMODE} ${.ALLSRC} ${DESTDIR}${LINTLIBDIR}
+.endif
+.endif
+
+.include <bsd.man.mk>
+.include <bsd.nls.mk>
+.include <bsd.files.mk>
+.include <bsd.inc.mk>
+.include <bsd.links.mk>
+.include <bsd.dep.mk>
+.include <bsd.sys.mk>
+
+# Make sure all of the standard targets are defined, even if they do nothing.
+lint regress:
diff --git a/pkgtools/bootstrap-mk-files/files/mods/Interix.sys.mk b/pkgtools/bootstrap-mk-files/files/mods/Interix.sys.mk
new file mode 100644
index 00000000000..d62fbdc617d
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/mods/Interix.sys.mk
@@ -0,0 +1,194 @@
+# $NetBSD: Interix.sys.mk,v 1.1.1.1 2006/07/14 23:13:01 jlam Exp $
+
+unix?= We run Unix
+OS!= uname -s
+
+.SUFFIXES: .out .a .ln .o .s .S .c .cc .cpp .cxx .C .F .f .r .y .l .cl .p .h
+.SUFFIXES: .sh .m4
+
+.LIBS: .a
+
+AR?= ar
+ARFLAGS?= rl
+RANLIB?= ranlib
+
+AS?= as
+AFLAGS?=
+COMPILE.s?= ${CC} ${AFLAGS} -c
+LINK.s?= ${CC} ${AFLAGS} ${LDFLAGS}
+COMPILE.S?= ${CC} ${AFLAGS} ${CPPFLAGS} -c -traditional-cpp
+LINK.S?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+# Unless told otherwise, assume GNU CC
+CC?= gcc -D_ALL_SOURCE
+
+DBG?= -O
+
+CFLAGS?= ${DBG}
+COMPILE.c?= ${CC} ${CFLAGS} ${CPPFLAGS} -c
+LINK.c?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+CXX?= c++
+CXXFLAGS?= ${CFLAGS}
+COMPILE.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
+LINK.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+OBJC?= ${CC}
+OBJCFLAGS?= ${CFLAGS}
+COMPILE.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c
+LINK.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+CPP?= cpp
+CPPFLAGS?=
+
+FC?= f77
+FFLAGS?= -O
+RFLAGS?=
+COMPILE.f?= ${FC} ${FFLAGS} -c
+LINK.f?= ${FC} ${FFLAGS} ${LDFLAGS}
+COMPILE.F?= ${FC} ${FFLAGS} ${CPPFLAGS} -c
+LINK.F?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.r?= ${FC} ${FFLAGS} ${RFLAGS} -c
+LINK.r?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
+
+INSTALL?= ${LOCALBASE}/bin/install-sh
+
+LEX?= lex
+LFLAGS?=
+LEX.l?= ${LEX} ${LFLAGS}
+
+LD?= ld
+LDFLAGS?=
+
+LINT?= lint
+LINTFLAGS?= -chapbxzF
+
+LORDER?= lorder
+
+MAKE?= make
+
+NM?= nm
+
+PC?= pc
+PFLAGS?=
+COMPILE.p?= ${PC} ${PFLAGS} ${CPPFLAGS} -c
+LINK.p?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+SHELL?= sh
+
+SIZE?= size
+
+TSORT?= tsort -q
+
+YACC?= yacc
+YFLAGS?=
+YACC.y?= ${YACC} ${YFLAGS}
+
+# C
+.c:
+ ${LINK.c} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.c.o:
+ ${COMPILE.c} ${.IMPSRC}
+.c.a:
+ ${COMPILE.c} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+.c.ln:
+ ${LINT} ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i ${.IMPSRC}
+
+# C++
+.cc .cpp .cxx .C:
+ ${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.cc.o .cpp.o .cxx.o .C.o:
+ ${COMPILE.cc} ${.IMPSRC}
+.cc.a .cpp.a .cxx.a .C.a:
+ ${COMPILE.cc} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Fortran/Ratfor
+.f:
+ ${LINK.f} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.f.o:
+ ${COMPILE.f} ${.IMPSRC}
+.f.a:
+ ${COMPILE.f} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+.F:
+ ${LINK.F} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.F.o:
+ ${COMPILE.F} ${.IMPSRC}
+.F.a:
+ ${COMPILE.F} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+.r:
+ ${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.r.o:
+ ${COMPILE.r} ${.IMPSRC}
+.r.a:
+ ${COMPILE.r} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Pascal
+.p:
+ ${LINK.p} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.p.o:
+ ${COMPILE.p} ${.IMPSRC}
+.p.a:
+ ${COMPILE.p} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Assembly
+.s:
+ ${LINK.s} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.s.o:
+ ${COMPILE.s} ${.IMPSRC}
+.s.a:
+ ${COMPILE.s} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+.S:
+ ${LINK.S} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.S.o:
+ ${COMPILE.S} ${.IMPSRC}
+.S.a:
+ ${COMPILE.S} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Lex
+.l:
+ ${LEX.l} ${.IMPSRC}
+ ${LINK.c} -o ${.TARGET} lex.yy.c ${LDLIBS} -ll
+ rm -f lex.yy.c
+.l.c:
+ ${LEX.l} ${.IMPSRC}
+ mv lex.yy.c ${.TARGET}
+.l.o:
+ ${LEX.l} ${.IMPSRC}
+ ${COMPILE.c} -o ${.TARGET} lex.yy.c
+ rm -f lex.yy.c
+
+# Yacc
+.y:
+ ${YACC.y} ${.IMPSRC}
+ ${LINK.c} -o ${.TARGET} y.tab.c ${LDLIBS}
+ rm -f y.tab.c
+.y.c:
+ ${YACC.y} ${.IMPSRC}
+ mv y.tab.c ${.TARGET}
+.y.o:
+ ${YACC.y} ${.IMPSRC}
+ ${COMPILE.c} -o ${.TARGET} y.tab.c
+ rm -f y.tab.c
+
+# Shell
+.sh:
+ rm -f ${.TARGET}
+ cp ${.IMPSRC} ${.TARGET}
diff --git a/pkgtools/bootstrap-mk-files/files/mods/Linux.bsd.lib.mk b/pkgtools/bootstrap-mk-files/files/mods/Linux.bsd.lib.mk
new file mode 100644
index 00000000000..773b62d621d
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/mods/Linux.bsd.lib.mk
@@ -0,0 +1,524 @@
+# $NetBSD: Linux.bsd.lib.mk,v 1.1.1.1 2006/07/14 23:13:01 jlam Exp $
+# @(#)bsd.lib.mk 8.3 (Berkeley) 4/22/94
+
+.if !target(__initialized__)
+__initialized__:
+.if exists(${.CURDIR}/../Makefile.inc)
+.include "${.CURDIR}/../Makefile.inc"
+.endif
+.include <bsd.own.mk>
+.include <bsd.obj.mk>
+.include <bsd.depall.mk>
+.MAIN: all
+.endif
+
+.PHONY: checkver cleanlib libinstall
+realinstall: checkver libinstall
+clean cleandir: cleanlib
+
+.if exists(${SHLIB_VERSION_FILE})
+SHLIB_MAJOR != . ${SHLIB_VERSION_FILE} ; echo $$major
+SHLIB_MINOR != . ${SHLIB_VERSION_FILE} ; echo $$minor
+SHLIB_TEENY != . ${SHLIB_VERSION_FILE} ; echo $$teeny
+
+# Check for higher installed library versions.
+.if !defined(NOCHECKVER) && !defined(NOCHECKVER_${LIB}) && \
+ exists(${BSDSRCDIR}/lib/checkver)
+checkver:
+ @(cd ${.CURDIR} && \
+ sh ${BSDSRCDIR}/lib/checkver -v ${SHLIB_VERSION_FILE} \
+ -d ${DESTDIR}${LIBDIR} ${LIB})
+.endif
+.endif
+
+.if !target(checkver)
+checkver:
+.endif
+
+print-shlib-major:
+.if defined(SHLIB_MAJOR)
+ @echo ${SHLIB_MAJOR}
+.else
+ @false
+.endif
+
+print-shlib-minor:
+.if defined(SHLIB_MINOR)
+ @echo ${SHLIB_MINOR}
+.else
+ @false
+.endif
+
+print-shlib-teeny:
+.if defined(SHLIB_TEENY)
+ @echo ${SHLIB_TEENY}
+.else
+ @false
+.endif
+
+.if defined(SHLIB_MAJOR) && !empty(SHLIB_MAJOR)
+.if defined(SHLIB_MINOR) && !empty(SHLIB_MINOR)
+.if defined(SHLIB_TEENY) && !empty(SHLIB_TEENY)
+SHLIB_FULLVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR}.${SHLIB_TEENY}
+.else
+SHLIB_FULLVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR}
+.endif
+.else
+SHLIB_FULLVERSION=${SHLIB_MAJOR}
+.endif
+.endif
+
+# add additional suffixes not exported.
+# .po is used for profiling object files.
+# .so is used for PIC object files.
+.SUFFIXES: .out .a .ln .so .po .o .s .S .c .cc .C .m .F .f .r .y .l .cl .p .h
+.SUFFIXES: .sh .m4 .m
+
+
+# Set PICFLAGS to cc flags for producing position-independent code,
+# if not already set. Includes -DPIC, if required.
+
+# Data-driven table using make variables to control how shared libraries
+# are built for different platforms and object formats.
+# OBJECT_FMT: currently either "ELF" or "a.out", from <bsd.own.mk>
+# SHLIB_SOVERSION: version number to be compiled into a shared library
+# via -soname. Usualy ${SHLIB_MAJOR} on ELF.
+# NetBSD/pmax used to use ${SHLIB_MAJOR}[.${SHLIB_MINOR}
+# [.${SHLIB_TEENY}]]
+# SHLIB_SHFLAGS: Flags to tell ${LD} to emit shared library.
+# with ELF, also set shared-lib version for ld.so.
+# SHLIB_LDSTARTFILE: support .o file, call C++ file-level constructors
+# SHLIB_LDENDFILE: support .o file, call C++ file-level destructors
+# FPICFLAGS: flags for ${FC} to compile .[fF] files to .so objects.
+# CPPICFLAGS: flags for ${CPP} to preprocess .[sS] files for ${AS}
+# CPICFLAGS: flags for ${CC} to compile .[cC] files to .so objects.
+# CAPICFLAGS flags for {$CC} to compiling .[Ss] files
+# (usually just ${CPPPICFLAGS} ${CPICFLAGS})
+# APICFLAGS: flags for ${AS} to assemble .[sS] to .so objects.
+
+.if ${MACHINE_ARCH} == "alpha"
+ # Alpha-specific shared library flags
+FPICFLAGS ?= -fPIC
+CPICFLAGS ?= -fPIC -DPIC
+CPPPICFLAGS?= -DPIC
+CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
+APICFLAGS ?=
+.elif ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"
+ # mips-specific shared library flags
+
+# On mips, all libs are compiled with ABIcalls, not just sharedlibs.
+MKPICLIB= no
+
+# so turn shlib PIC flags on for ${AS}.
+AINC+=-DABICALLS
+AFLAGS+= -fPIC
+AS+= -KPIC
+
+.elif ${MACHINE_ARCH} == "vax" && ${OBJECT_FMT} == "ELF"
+# On the VAX, all object are PIC by default, not just sharedlibs.
+MKPICLIB= no
+
+.elif (${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64") && \
+ ${OBJECT_FMT} == "ELF"
+
+FPICFLAGS ?= -fPIC
+CPICFLAGS ?= -fPIC -DPIC
+CPPPICFLAGS?= -DPIC
+CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
+APICFLAGS ?= -KPIC
+
+.else
+
+# Platform-independent flags for NetBSD a.out shared libraries (and PowerPC)
+SHLIB_LDSTARTFILE=
+SHLIB_LDENDFILE=
+SHLIB_SOVERSION=${SHLIB_FULLVERSION}
+SHLIB_SHFLAGS=
+FPICFLAGS ?= -fPIC
+CPICFLAGS?= -fPIC -DPIC
+CPPPICFLAGS?= -DPIC
+CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
+APICFLAGS?= -k
+
+.endif
+
+MKPICLIB?= yes
+
+# Platform-independent linker flags for ELF shared libraries
+.if ${OBJECT_FMT} == "ELF"
+SHLIB_SOVERSION= ${SHLIB_MAJOR}
+SHLIB_SHFLAGS= -soname lib${LIB}.so.${SHLIB_SOVERSION}
+SHLIB_LDSTARTFILE?= ${DESTDIR}/usr/lib/crtbeginS.o
+SHLIB_LDENDFILE?= ${DESTDIR}/usr/lib/crtendS.o
+.endif
+
+CFLAGS+= ${COPTS}
+FFLAGS+= ${FOPTS}
+
+.c.o:
+.if defined(COPTS) && !empty(COPTS:M*-g*)
+ ${COMPILE.c} ${.IMPSRC}
+.else
+ @echo ${COMPILE.c:Q} ${.IMPSRC}
+ @${COMPILE.c} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.c.po:
+.if defined(COPTS) && !empty(COPTS:M*-g*)
+ ${COMPILE.c} -pg ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.c:Q} -pg ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.c} -pg ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.c.so:
+.if defined(COPTS) && !empty(COPTS:M*-g*)
+ ${COMPILE.c} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.c:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.c} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.c.ln:
+ ${LINT} ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i ${.IMPSRC}
+
+.cc.o .C.o:
+.if defined(COPTS) && !empty(COPTS:M*-g*)
+ ${COMPILE.cc} ${.IMPSRC}
+.else
+ @echo ${COMPILE.cc:Q} ${.IMPSRC}
+ @${COMPILE.cc} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.cc.po .C.po:
+.if defined(COPTS) && !empty(COPTS:M*-g*)
+ ${COMPILE.cc} -pg ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.cc:Q} -pg ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.cc} -pg ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.cc.so .C.so:
+.if defined(COPTS) && !empty(COPTS:M*-g*)
+ ${COMPILE.cc} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.cc:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.cc} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.f.o:
+.if defined(FOPTS) && !empty(FOPTS:M*-g*)
+ ${COMPILE.f} ${.IMPSRC}
+.else
+ @echo ${COMPILE.f:Q} ${.IMPSRC}
+ @${COMPILE.f} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.f.po:
+.if defined(FOPTS) && !empty(FOPTS:M*-g*)
+ ${COMPILE.f} -pg ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.f:Q} -pg ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.f} -pg ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.f.so:
+.if defined(FOPTS) && !empty(FOPTS:M*-g*)
+ ${COMPILE.f} ${FPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.f:Q} ${FPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.f} ${FPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.f.ln:
+ ${ECHO} Skipping lint for Fortran libraries.
+
+.m.o:
+.if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
+ ${COMPILE.m} ${.IMPSRC}
+.else
+ @echo ${COMPILE.m:Q} ${.IMPSRC}
+ @${COMPILE.m} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.m.po:
+.if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
+ ${COMPILE.m} -pg ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.m:Q} -pg ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.m} -pg ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.m.so:
+.if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
+ ${COMPILE.m} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+.else
+ @echo ${COMPILE.m:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.m} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+.endif
+
+.S.o .s.o:
+ @echo ${COMPILE.S:Q} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC}
+ @${COMPILE.S} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+
+.S.po .s.po:
+ @echo ${COMPILE.S:Q} -DGPROF -DPROF ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.S} -DGPROF -DPROF ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+
+.S.so .s.so:
+ @echo ${COMPILE.S:Q} ${CAPICFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}
+ @${COMPILE.S} ${CAPICFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
+ @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+
+.if ${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
+ || ${MKLINKLIB} != "no"
+_LIBS=lib${LIB}.a
+.else
+_LIBS=
+.endif
+
+OBJS+=${SRCS:N*.h:N*.sh:R:S/$/.o/g}
+
+.if ${MKPROFILE} != "no"
+_LIBS+=lib${LIB}_p.a
+POBJS+=${OBJS:.o=.po}
+.endif
+
+.if ${MKPIC} != "no"
+.if ${MKPICLIB} == "no"
+SOLIB=lib${LIB}.a
+.else
+SOLIB=lib${LIB}_pic.a
+_LIBS+=${SOLIB}
+SOBJS+=${OBJS:.o=.so}
+.endif
+.if defined(SHLIB_FULLVERSION)
+_LIBS+=lib${LIB}.so.${SHLIB_FULLVERSION}
+.endif
+.endif
+
+LOBJS+=${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
+.if ${MKLINT} != "no" && ${MKLINKLIB} != "no" && !empty(LOBJS)
+_LIBS+=llib-l${LIB}.ln
+.endif
+
+.if ${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
+ || ${MKLINKLIB} != "no"
+ALLOBJS=${OBJS} ${POBJS} ${SOBJS}
+.else
+ALLOBJS=${POBJS} ${SOBJS}
+.endif
+.if ${MKLINT} != "no" && ${MKLINKLIB} != "no" && !empty(LOBJS)
+ALLOBJS+=${LOBJS}
+.endif
+.NOPATH: ${ALLOBJS} ${_LIBS}
+
+realall: ${SRCS} ${ALLOBJS:O} ${_LIBS}
+
+__archivebuild: .USE
+ @rm -f ${.TARGET}
+ ${AR} cq ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}`
+ ${RANLIB} ${.TARGET}
+
+__archiveinstall: .USE
+ ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
+ -g ${LIBGRP} -m 600 ${.ALLSRC} ${.TARGET}
+ ${RANLIB} -t ${.TARGET}
+ chmod ${LIBMODE} ${.TARGET}
+
+DPSRCS+= ${SRCS:M*.l:.l=.c} ${SRCS:M*.y:.y=.c}
+CLEANFILES+= ${DPSRCS}
+.if defined(YHEADER)
+CLEANFILES+= ${SRCS:M*.y:.y=.h}
+.endif
+
+lib${LIB}.a:: ${OBJS} __archivebuild
+ @echo building standard ${LIB} library
+
+lib${LIB}_p.a:: ${POBJS} __archivebuild
+ @echo building profiled ${LIB} library
+
+lib${LIB}_pic.a:: ${SOBJS} __archivebuild
+ @echo building shared object ${LIB} library
+
+lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOLIB} ${DPADD} \
+ ${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}
+ @echo building shared ${LIB} library \(version ${SHLIB_FULLVERSION}\)
+ @rm -f lib${LIB}.so.${SHLIB_FULLVERSION}
+.if defined(DESTDIR)
+ $(LD) -nostdlib -x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
+ ${SHLIB_LDSTARTFILE} \
+ --whole-archive ${SOLIB} \
+ --no-whole-archive ${LDADD} \
+ -L${DESTDIR}${LIBDIR} -R${LIBDIR} \
+ ${SHLIB_LDENDFILE}
+.else
+ $(LD) -x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
+ ${SHLIB_LDSTARTFILE} \
+ --whole-archive ${SOLIB} --no-whole-archive ${LDADD} \
+ ${SHLIB_LDENDFILE}
+.endif
+.if ${OBJECT_FMT} == "ELF"
+ ln -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.${SHLIB_MAJOR}.tmp
+ mv -f lib${LIB}.so.${SHLIB_MAJOR}.tmp lib${LIB}.so.${SHLIB_MAJOR}
+ ln -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.tmp
+ mv -f lib${LIB}.so.tmp lib${LIB}.so
+.endif
+
+.if !empty(LOBJS)
+LLIBS?= -lc
+llib-l${LIB}.ln: ${LOBJS}
+ @echo building llib-l${LIB}.ln
+ @rm -f llib-l${LIB}.ln
+ @${LINT} -C${LIB} ${.ALLSRC} ${LLIBS}
+.endif
+
+cleanlib:
+ rm -f a.out [Ee]rrs mklog core *.core ${CLEANFILES}
+ rm -f lib${LIB}.a ${OBJS}
+ rm -f lib${LIB}_p.a ${POBJS}
+ rm -f lib${LIB}_pic.a lib${LIB}.so.* lib${LIB}.so ${SOBJS}
+ rm -f llib-l${LIB}.ln ${LOBJS}
+
+.if defined(SRCS)
+afterdepend: .depend
+ @(TMP=/tmp/_depend$$$$; \
+ sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po \1.so \1.ln:/' \
+ < .depend > $$TMP; \
+ mv $$TMP .depend)
+.endif
+
+.if !target(libinstall)
+# Make sure it gets defined, in case MKPIC==no && MKLINKLIB==no
+libinstall::
+
+.if ${MKLINKLIB} != "no"
+libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.a
+.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.a
+.if !defined(UPDATE)
+.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}.a
+.endif
+
+.if !defined(BUILD) && !make(all) && !make(lib${LIB}.a)
+${DESTDIR}${LIBDIR}/lib${LIB}.a: .MADE
+.endif
+${DESTDIR}${LIBDIR}/lib${LIB}.a: lib${LIB}.a __archiveinstall
+.endif
+
+.if ${MKPROFILE} != "no"
+libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
+.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
+.if !defined(UPDATE)
+.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
+.endif
+
+.if !defined(BUILD) && !make(all) && !make(lib${LIB}_p.a)
+${DESTDIR}${LIBDIR}/lib${LIB}_p.a: .MADE
+.endif
+${DESTDIR}${LIBDIR}/lib${LIB}_p.a: lib${LIB}_p.a __archiveinstall
+.endif
+
+.if ${MKPIC} != "no" && ${MKPICINSTALL} != "no"
+libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
+.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
+.if !defined(UPDATE)
+.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
+.endif
+
+.if !defined(BUILD) && !make(all) && !make(lib${LIB}_pic.a)
+${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: .MADE
+.endif
+.if ${MKPICLIB} == "no"
+${DESTDIR}${LIBDIR}/lib${LIB}_pic.a:
+ rm -f ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
+ ln -s lib${LIB}.a ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
+.else
+${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: lib${LIB}_pic.a __archiveinstall
+.endif
+.endif
+
+.if ${MKPIC} != "no" && defined(SHLIB_FULLVERSION)
+libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
+.PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
+.if !defined(UPDATE)
+.PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
+.endif
+
+.if !defined(BUILD) && !make(all) && !make(lib${LIB}.so.${SHLIB_FULLVERSION})
+${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: .MADE
+.endif
+${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: lib${LIB}.so.${SHLIB_FULLVERSION}
+ ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
+ -g ${LIBGRP} -m ${LIBMODE} ${.ALLSRC} ${.TARGET}
+.if ${OBJECT_FMT} == "a.out" && !defined(DESTDIR)
+ /sbin/ldconfig -m ${LIBDIR}
+.endif
+.if ${OBJECT_FMT} == "ELF"
+ ln -sf lib${LIB}.so.${SHLIB_FULLVERSION}\
+ ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.tmp
+ mv -f ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.tmp\
+ ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}
+.if ${MKLINKLIB} != "no"
+ ln -sf lib${LIB}.so.${SHLIB_FULLVERSION}\
+ ${DESTDIR}${LIBDIR}/lib${LIB}.so.tmp
+ mv -f ${DESTDIR}${LIBDIR}/lib${LIB}.so.tmp\
+ ${DESTDIR}${LIBDIR}/lib${LIB}.so
+.endif
+.endif
+.endif
+
+.if ${MKLINT} != "no" && ${MKLINKLIB} != "no" && !empty(LOBJS)
+libinstall:: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
+.PRECIOUS: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
+.if !defined(UPDATE)
+.PHONY: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
+.endif
+
+.if !defined(BUILD) && !make(all) && !make(llib-l${LIB}.ln)
+${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: .MADE
+.endif
+${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: llib-l${LIB}.ln
+ ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
+ -g ${LIBGRP} -m ${LIBMODE} ${.ALLSRC} ${DESTDIR}${LINTLIBDIR}
+.endif
+.endif
+
+.include <bsd.man.mk>
+.include <bsd.nls.mk>
+.include <bsd.files.mk>
+.include <bsd.inc.mk>
+.include <bsd.links.mk>
+.include <bsd.dep.mk>
+.include <bsd.sys.mk>
+
+# Make sure all of the standard targets are defined, even if they do nothing.
+lint regress:
diff --git a/pkgtools/bootstrap-mk-files/files/mods/Linux.bsd.man.mk b/pkgtools/bootstrap-mk-files/files/mods/Linux.bsd.man.mk
new file mode 100644
index 00000000000..6d6a456ce9d
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/mods/Linux.bsd.man.mk
@@ -0,0 +1,203 @@
+# $NetBSD: Linux.bsd.man.mk,v 1.1.1.1 2006/07/14 23:13:01 jlam Exp $
+# @(#)bsd.man.mk 8.1 (Berkeley) 6/8/93
+
+.if !target(__initialized__)
+__initialized__:
+.if exists(${.CURDIR}/../Makefile.inc)
+.include "${.CURDIR}/../Makefile.inc"
+.endif
+.include <bsd.own.mk>
+.include <bsd.obj.mk>
+.include <bsd.depall.mk>
+.MAIN: all
+.endif
+
+.PHONY: catinstall maninstall catpages manpages catlinks manlinks cleanman html installhtml cleanhtml
+.if ${MKMAN} != "no"
+realinstall: ${MANINSTALL}
+.endif
+cleandir: cleanman
+
+.if exists(${DESTDIR}/usr/share/groff/1.18.1/tmac)
+TMACDIR?= ${DESTDIR}/usr/share/groff/1.18.1/tmac
+.else
+TMACDIR?= ${DESTDIR}/usr/share/groff/tmac
+.endif
+HTMLDIR?= ${DESTDIR}/usr/share/man
+CATDEPS?= ${TMACDIR}/mandoc.tmac \
+ ${TMACDIR}/doc.tmac
+MANTARGET?= cat
+NROFF?= nroff -Tascii
+GROFF?= groff -Tascii
+TBL?= tbl
+
+
+.SUFFIXES: .1 .2 .3 .4 .5 .6 .7 .8 .9 \
+ .cat1 .cat2 .cat3 .cat4 .cat5 .cat6 .cat7 .cat8 .cat9 \
+ .html1 .html2 .html3 .html4 .html5 .html6 .html7 .html8 .html9
+
+.9.cat9 .8.cat8 .7.cat7 .6.cat6 .5.cat5 .4.cat4 .3.cat3 .2.cat2 .1.cat1: \
+ ${CATDEPS}
+.if !defined(USETBL)
+ @echo "${NROFF} -mandoc ${.IMPSRC} > ${.TARGET}"
+ @${NROFF} -mandoc ${.IMPSRC} > ${.TARGET} || \
+ (rm -f ${.TARGET}; false)
+.else
+ @echo "${TBL} ${.IMPSRC} | ${NROFF} -mandoc > ${.TARGET}"
+ @${TBL} ${.IMPSRC} | ${NROFF} -mandoc > ${.TARGET} || \
+ (rm -f ${.TARGET}; false)
+.endif
+
+.9.html9 .8.html8 .7.html7 .6.html6 .5.html5 .4.html4 .3.html3 .2.html2 .1.html1: \
+ ${CATDEPS}
+.if !defined(USETBL)
+ @echo "${GROFF} -mdoc2html -P-b -P-u -P-o ${.IMPSRC} > ${.TARGET}"
+ @${GROFF} -mdoc2html -P-b -P-u -P-o ${.IMPSRC} > ${.TARGET} || \
+ (rm -f ${.TARGET}; false)
+.else
+ @echo "${TBL} ${.IMPSRC} | ${GROFF} -mdoc2html -P-b -P-u -P-o > ${.TARGET}"
+ @cat ${.IMPSRC} | ${GROFF} -mdoc2html -P-b -P-u -P-o > ${.TARGET} || \
+ (rm -f ${.TARGET}; false)
+.endif
+
+.if defined(MAN) && !empty(MAN)
+MANPAGES= ${MAN}
+CATPAGES= ${MANPAGES:C/(.*).([1-9])/\1.cat\2/}
+.NOPATH: ${CATPAGES}
+.if !defined(NOHTML)
+HTMLPAGES= ${MANPAGES:C/(.*).([1-9])/\1.html\2/}
+.endif
+.endif
+
+MINSTALL= ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} \
+ -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
+
+.if defined(MANZ)
+# chown and chmod are done afterward automatically
+MCOMPRESS= gzip -cf
+MCOMPRESSSUFFIX= .gz
+.endif
+
+catinstall: catlinks
+maninstall: manlinks
+
+__installpage: .USE
+.if defined(MCOMPRESS) && !empty(MCOMPRESS)
+ @rm -f ${.TARGET}
+ ${MCOMPRESS} ${.ALLSRC} > ${.TARGET}
+ @chown ${MANOWN}:${MANGRP} ${.TARGET}
+ @chmod ${MANMODE} ${.TARGET}
+.else
+ @cmp -s ${.ALLSRC} ${.TARGET} > /dev/null 2>&1 || \
+ (echo "${MINSTALL} ${.ALLSRC} ${.TARGET}" && \
+ ${MINSTALL} ${.ALLSRC} ${.TARGET})
+.endif
+
+
+# Rules for cat'ed man page installation
+.if defined(CATPAGES) && !empty(CATPAGES) && ${MKCATPAGES} != "no"
+catpages:: ${CATPAGES:@P@${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}@}
+.PRECIOUS: ${CATPAGES:@P@${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}@}
+.if !defined(UPDATE)
+.PHONY: ${CATPAGES:@P@${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}@}
+.endif
+
+. for P in ${CATPAGES:O:u}
+. if !defined(BUILD) && !make(all) && !make(${P})
+${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}: .MADE
+. endif
+${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}: ${P} __installpage
+. endfor
+.else
+catpages::
+.endif
+
+# Rules for source page installation
+.if defined(MANPAGES) && !empty(MANPAGES)
+manpages:: ${MANPAGES:@P@${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P}${MCOMPRESSSUFFIX}@}
+.PRECIOUS: ${MANPAGES:@P@${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P}${MCOMPRESSSUFFIX}@}
+.if !defined(UPDATE)
+.PHONY: ${MANPAGES:@P@${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P}${MCOMPRESSSUFFIX}@}
+.endif
+
+. for P in ${MANPAGES:O:u}
+${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P}${MCOMPRESSSUFFIX}: ${P} __installpage
+. endfor
+.else
+manpages::
+.endif
+
+.if ${MKCATPAGES} != "no"
+catlinks: catpages
+.if defined(MLINKS) && !empty(MLINKS)
+ @set ${MLINKS}; \
+ while test $$# -ge 2; do \
+ name=$$1; \
+ shift; \
+ dir=${DESTDIR}${MANDIR}/cat$${name##*.}; \
+ l=$${dir}${MANSUBDIR}/$${name%.*}.0${MCOMPRESSSUFFIX}; \
+ name=$$1; \
+ shift; \
+ dir=${DESTDIR}${MANDIR}/cat$${name##*.}; \
+ t=$${dir}${MANSUBDIR}/$${name%.*}.0${MCOMPRESSSUFFIX}; \
+ if test $$l -nt $$t -o ! -f $$t; then \
+ echo $$t -\> $$l; \
+ ln -f $$l $$t; \
+ fi; \
+ done
+.endif
+.else
+catlinks:
+.endif
+
+manlinks: manpages
+.if defined(MLINKS) && !empty(MLINKS)
+ @set ${MLINKS}; \
+ while test $$# -ge 2; do \
+ name=$$1; \
+ shift; \
+ dir=${DESTDIR}${MANDIR}/man$${name##*.}; \
+ l=$${dir}${MANSUBDIR}/$${name}${MCOMPRESSSUFFIX}; \
+ name=$$1; \
+ shift; \
+ dir=${DESTDIR}${MANDIR}/man$${name##*.}; \
+ t=$${dir}${MANSUBDIR}/$${name}${MCOMPRESSSUFFIX}; \
+ if test $$l -nt $$t -o ! -f $$t; then \
+ echo $$t -\> $$l; \
+ ln -f $$l $$t; \
+ fi; \
+ done
+.endif
+
+# Html rules
+html: ${HTMLPAGES}
+
+.if defined(HTMLPAGES) && !empty(HTMLPAGES)
+.for P in ${HTMLPAGES:O:u}
+${HTMLDIR}/${P:T:E}/${P:T:R}.html: ${P}
+ ${MINSTALL} ${.ALLSRC} ${.TARGET}
+.endfor
+.endif
+installhtml: ${HTMLPAGES:@P@${HTMLDIR}/${P:T:E}/${P:T:R}.html@}
+
+cleanhtml:
+.if defined(HTMLPAGES) && !empty(HTMLPAGES)
+ rm -f ${HTMLPAGES}
+.endif
+
+
+.if defined(CATPAGES)
+.if ${MKCATPAGES} != "no" && ${MKMAN} != "no"
+realall: ${CATPAGES}
+.else
+realall:
+.endif
+
+cleanman:
+ rm -f ${CATPAGES}
+.else
+cleanman:
+.endif
+
+# Make sure all of the standard targets are defined, even if they do nothing.
+clean depend includes lint regress tags:
diff --git a/pkgtools/bootstrap-mk-files/files/mods/Linux.sys.mk b/pkgtools/bootstrap-mk-files/files/mods/Linux.sys.mk
new file mode 100644
index 00000000000..1079052fb31
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/mods/Linux.sys.mk
@@ -0,0 +1,194 @@
+# $NetBSD: Linux.sys.mk,v 1.1.1.1 2006/07/14 23:13:01 jlam Exp $
+# NetBSD: sys.mk,v 1.58 2000/08/22 17:38:49 bjh21 Exp
+# @(#)sys.mk 8.2 (Berkeley) 3/21/94
+
+unix?= We run Unix.
+OS?= Linux
+
+.SUFFIXES: .out .a .ln .o .s .S .c .cc .cpp .cxx .C .F .f .r .y .l .cl .p .h
+.SUFFIXES: .sh .m4
+
+.LIBS: .a
+
+AR?= ar
+ARFLAGS?= rl
+RANLIB?= ranlib
+
+AS?= as
+AFLAGS?=
+COMPILE.s?= ${CC} ${AFLAGS} -c
+LINK.s?= ${CC} ${AFLAGS} ${LDFLAGS}
+COMPILE.S?= ${CC} ${AFLAGS} ${CPPFLAGS} -c -traditional-cpp
+LINK.S?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+CC?= gcc
+DBG?= -O2
+CFLAGS?= ${DBG}
+COMPILE.c?= ${CC} ${CFLAGS} ${CPPFLAGS} -c
+LINK.c?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+CXX?= g++
+CXXFLAGS?= ${CFLAGS}
+COMPILE.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
+LINK.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+OBJC?= ${CC}
+OBJCFLAGS?= ${CFLAGS}
+COMPILE.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c
+LINK.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+CPP?= cpp
+NOLINT= 1
+CPPFLAGS?=
+
+FC?= f77
+FFLAGS?= -O
+RFLAGS?=
+COMPILE.f?= ${FC} ${FFLAGS} -c
+LINK.f?= ${FC} ${FFLAGS} ${LDFLAGS}
+COMPILE.F?= ${FC} ${FFLAGS} ${CPPFLAGS} -c
+LINK.F?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.r?= ${FC} ${FFLAGS} ${RFLAGS} -c
+LINK.r?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
+
+INSTALL?= install
+
+LEX?= lex
+LFLAGS?=
+LEX.l?= ${LEX} ${LFLAGS}
+
+LD?= ld
+LDFLAGS?=
+
+LINT?= lint
+LINTFLAGS?= -chapbxzF
+
+LORDER?= echo
+
+MAKE?= make
+
+NM?= nm
+
+PC?= pc
+PFLAGS?=
+COMPILE.p?= ${PC} ${PFLAGS} ${CPPFLAGS} -c
+LINK.p?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+SHELL?= sh
+
+SIZE?= size
+
+TSORT?= tsort
+
+YACC?= yacc
+YFLAGS?=
+YACC.y?= ${YACC} ${YFLAGS}
+
+# C
+.c:
+ ${LINK.c} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.c.o:
+ ${COMPILE.c} ${.IMPSRC}
+.c.a:
+ ${COMPILE.c} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+.c.ln:
+ ${LINT} ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i ${.IMPSRC}
+
+# C++
+.cc .cpp .cxx .C:
+ ${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.cc.o .cpp.o .cxx.o .C.o:
+ ${COMPILE.cc} ${.IMPSRC}
+.cc.a .cpp.a .cxx.a .C.a:
+ ${COMPILE.cc} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Fortran/Ratfor
+.f:
+ ${LINK.f} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.f.o:
+ ${COMPILE.f} ${.IMPSRC}
+.f.a:
+ ${COMPILE.f} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+.F:
+ ${LINK.F} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.F.o:
+ ${COMPILE.F} ${.IMPSRC}
+.F.a:
+ ${COMPILE.F} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+.r:
+ ${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.r.o:
+ ${COMPILE.r} ${.IMPSRC}
+.r.a:
+ ${COMPILE.r} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Pascal
+.p:
+ ${LINK.p} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.p.o:
+ ${COMPILE.p} ${.IMPSRC}
+.p.a:
+ ${COMPILE.p} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Assembly
+.s:
+ ${LINK.s} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.s.o:
+ ${COMPILE.s} ${.IMPSRC}
+.s.a:
+ ${COMPILE.s} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+.S:
+ ${LINK.S} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.S.o:
+ ${COMPILE.S} ${.IMPSRC}
+.S.a:
+ ${COMPILE.S} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Lex
+.l:
+ ${LEX.l} ${.IMPSRC}
+ ${LINK.c} -o ${.TARGET} lex.yy.c ${LDLIBS} -ll
+ rm -f lex.yy.c
+.l.c:
+ ${LEX.l} ${.IMPSRC}
+ mv lex.yy.c ${.TARGET}
+.l.o:
+ ${LEX.l} ${.IMPSRC}
+ ${COMPILE.c} -o ${.TARGET} lex.yy.c
+ rm -f lex.yy.c
+
+# Yacc
+.y:
+ ${YACC.y} ${.IMPSRC}
+ ${LINK.c} -o ${.TARGET} y.tab.c ${LDLIBS}
+ rm -f y.tab.c
+.y.c:
+ ${YACC.y} ${.IMPSRC}
+ mv y.tab.c ${.TARGET}
+.y.o:
+ ${YACC.y} ${.IMPSRC}
+ ${COMPILE.c} -o ${.TARGET} y.tab.c
+ rm -f y.tab.c
+
+# Shell
+.sh:
+ rm -f ${.TARGET}
+ cp ${.IMPSRC} ${.TARGET}
diff --git a/pkgtools/bootstrap-mk-files/files/mods/NetBSD.bsd.man.mk b/pkgtools/bootstrap-mk-files/files/mods/NetBSD.bsd.man.mk
new file mode 100644
index 00000000000..b2b464f9d6b
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/mods/NetBSD.bsd.man.mk
@@ -0,0 +1,206 @@
+# $NetBSD: NetBSD.bsd.man.mk,v 1.1.1.1 2006/07/14 23:13:01 jlam Exp $
+# @(#)bsd.man.mk 8.1 (Berkeley) 6/8/93
+
+.if !target(__initialized__)
+__initialized__:
+.if exists(${.CURDIR}/../Makefile.inc)
+.include "${.CURDIR}/../Makefile.inc"
+.endif
+.include <bsd.own.mk>
+.include <bsd.obj.mk>
+.include <bsd.depall.mk>
+.MAIN: all
+.endif
+
+.PHONY: catinstall maninstall catpages manpages catlinks manlinks cleanman html installhtml cleanhtml
+.if ${MKMAN} != "no"
+realinstall: ${MANINSTALL}
+.endif
+cleandir: cleanman
+
+TMACDIR?= ${DESTDIR}/usr/share/tmac
+HTMLDIR?= ${DESTDIR}/usr/share/man
+
+# tmac.andoc and tmac.doc were renamed in the update to groff-1.19 in
+# NetBSD-current 20030630.
+.if exists(${TMACDIR}/tmac.andoc)
+CATDEPS?= ${TMACDIR}/tmac.andoc ${TMACDIR}/tmac.doc
+.elif exists(${TMACDIR}/andoc.tmac)
+CATDEPS?= ${TMACDIR}/andoc.tmac ${TMACDIR}/doc.tmac
+.endif
+
+MANTARGET?= cat
+NROFF?= nroff -Tascii
+GROFF?= groff -Tascii
+TBL?= tbl
+
+
+.SUFFIXES: .1 .2 .3 .4 .5 .6 .7 .8 .9 \
+ .cat1 .cat2 .cat3 .cat4 .cat5 .cat6 .cat7 .cat8 .cat9 \
+ .html1 .html2 .html3 .html4 .html5 .html6 .html7 .html8 .html9
+
+.9.cat9 .8.cat8 .7.cat7 .6.cat6 .5.cat5 .4.cat4 .3.cat3 .2.cat2 .1.cat1: \
+ ${CATDEPS}
+.if !defined(USETBL)
+ @echo "${NROFF} -mandoc ${.IMPSRC} > ${.TARGET}"
+ @${NROFF} -mandoc ${.IMPSRC} > ${.TARGET} || \
+ (rm -f ${.TARGET}; false)
+.else
+ @echo "${TBL} ${.IMPSRC} | ${NROFF} -mandoc > ${.TARGET}"
+ @${TBL} ${.IMPSRC} | ${NROFF} -mandoc > ${.TARGET} || \
+ (rm -f ${.TARGET}; false)
+.endif
+
+.9.html9 .8.html8 .7.html7 .6.html6 .5.html5 .4.html4 .3.html3 .2.html2 .1.html1: \
+ ${CATDEPS}
+.if !defined(USETBL)
+ @echo "${GROFF} -mdoc2html -P-b -P-u -P-o ${.IMPSRC} > ${.TARGET}"
+ @${GROFF} -mdoc2html -P-b -P-u -P-o ${.IMPSRC} > ${.TARGET} || \
+ (rm -f ${.TARGET}; false)
+.else
+ @echo "${TBL} ${.IMPSRC} | ${GROFF} -mdoc2html -P-b -P-u -P-o > ${.TARGET}"
+ @cat ${.IMPSRC} | ${GROFF} -mdoc2html -P-b -P-u -P-o > ${.TARGET} || \
+ (rm -f ${.TARGET}; false)
+.endif
+
+.if defined(MAN) && !empty(MAN)
+MANPAGES= ${MAN}
+CATPAGES= ${MANPAGES:C/(.*).([1-9])/\1.cat\2/}
+.NOPATH: ${CATPAGES}
+.if !defined(NOHTML)
+HTMLPAGES= ${MANPAGES:C/(.*).([1-9])/\1.html\2/}
+.endif
+.endif
+
+MINSTALL= ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} \
+ -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
+
+.if defined(MANZ)
+# chown and chmod are done afterward automatically
+MCOMPRESS= gzip -cf
+MCOMPRESSSUFFIX= .gz
+.endif
+
+catinstall: catlinks
+maninstall: manlinks
+
+__installpage: .USE
+.if defined(MCOMPRESS) && !empty(MCOMPRESS)
+ @rm -f ${.TARGET}
+ ${MCOMPRESS} ${.ALLSRC} > ${.TARGET}
+ @chown ${MANOWN}:${MANGRP} ${.TARGET}
+ @chmod ${MANMODE} ${.TARGET}
+.else
+ @cmp -s ${.ALLSRC} ${.TARGET} > /dev/null 2>&1 || \
+ (echo "${MINSTALL} ${.ALLSRC} ${.TARGET}" && \
+ ${MINSTALL} ${.ALLSRC} ${.TARGET})
+.endif
+
+
+# Rules for cat'ed man page installation
+.if defined(CATPAGES) && !empty(CATPAGES) && ${MKCATPAGES} != "no"
+catpages:: ${CATPAGES:@P@${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}@}
+.PRECIOUS: ${CATPAGES:@P@${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}@}
+.if !defined(UPDATE)
+.PHONY: ${CATPAGES:@P@${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}@}
+.endif
+
+. for P in ${CATPAGES:O:u}
+. if !defined(BUILD) && !make(all) && !make(${P})
+${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}: .MADE
+. endif
+${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}: ${P} __installpage
+. endfor
+.else
+catpages::
+.endif
+
+# Rules for source page installation
+.if defined(MANPAGES) && !empty(MANPAGES)
+manpages:: ${MANPAGES:@P@${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P}${MCOMPRESSSUFFIX}@}
+.PRECIOUS: ${MANPAGES:@P@${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P}${MCOMPRESSSUFFIX}@}
+.if !defined(UPDATE)
+.PHONY: ${MANPAGES:@P@${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P}${MCOMPRESSSUFFIX}@}
+.endif
+
+. for P in ${MANPAGES:O:u}
+${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P}${MCOMPRESSSUFFIX}: ${P} __installpage
+. endfor
+.else
+manpages::
+.endif
+
+.if ${MKCATPAGES} != "no"
+catlinks: catpages
+.if defined(MLINKS) && !empty(MLINKS)
+ @set ${MLINKS}; \
+ while test $$# -ge 2; do \
+ name=$$1; \
+ shift; \
+ dir=${DESTDIR}${MANDIR}/cat$${name##*.}; \
+ l=$${dir}${MANSUBDIR}/$${name%.*}.0${MCOMPRESSSUFFIX}; \
+ name=$$1; \
+ shift; \
+ dir=${DESTDIR}${MANDIR}/cat$${name##*.}; \
+ t=$${dir}${MANSUBDIR}/$${name%.*}.0${MCOMPRESSSUFFIX}; \
+ if test $$l -nt $$t -o ! -f $$t; then \
+ echo $$t -\> $$l; \
+ ln -f $$l $$t; \
+ fi; \
+ done
+.endif
+.else
+catlinks:
+.endif
+
+manlinks: manpages
+.if defined(MLINKS) && !empty(MLINKS)
+ @set ${MLINKS}; \
+ while test $$# -ge 2; do \
+ name=$$1; \
+ shift; \
+ dir=${DESTDIR}${MANDIR}/man$${name##*.}; \
+ l=$${dir}${MANSUBDIR}/$${name}${MCOMPRESSSUFFIX}; \
+ name=$$1; \
+ shift; \
+ dir=${DESTDIR}${MANDIR}/man$${name##*.}; \
+ t=$${dir}${MANSUBDIR}/$${name}${MCOMPRESSSUFFIX}; \
+ if test $$l -nt $$t -o ! -f $$t; then \
+ echo $$t -\> $$l; \
+ ln -f $$l $$t; \
+ fi; \
+ done
+.endif
+
+# Html rules
+html: ${HTMLPAGES}
+
+.if defined(HTMLPAGES) && !empty(HTMLPAGES)
+.for P in ${HTMLPAGES:O:u}
+${HTMLDIR}/${P:T:E}/${P:T:R}.html: ${P}
+ ${MINSTALL} ${.ALLSRC} ${.TARGET}
+.endfor
+.endif
+installhtml: ${HTMLPAGES:@P@${HTMLDIR}/${P:T:E}/${P:T:R}.html@}
+
+cleanhtml:
+.if defined(HTMLPAGES) && !empty(HTMLPAGES)
+ rm -f ${HTMLPAGES}
+.endif
+
+
+.if defined(CATPAGES)
+.if ${MKCATPAGES} != "no" && ${MKMAN} != "no"
+realall: ${CATPAGES}
+.else
+realall:
+.endif
+
+cleanman:
+ rm -f ${CATPAGES}
+.else
+cleanman:
+.endif
+
+# Make sure all of the standard targets are defined, even if they do nothing.
+clean depend includes lint regress tags:
diff --git a/pkgtools/bootstrap-mk-files/files/mods/NetBSD.sys.mk b/pkgtools/bootstrap-mk-files/files/mods/NetBSD.sys.mk
new file mode 100644
index 00000000000..92341c14b96
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/mods/NetBSD.sys.mk
@@ -0,0 +1,207 @@
+# $NetBSD: NetBSD.sys.mk,v 1.1.1.1 2006/07/14 23:13:01 jlam Exp $
+# @(#)sys.mk 8.2 (Berkeley) 3/21/94
+
+unix?= We run NetBSD.
+
+.SUFFIXES: .out .a .ln .o .s .S .c .cc .cpp .cxx .C .F .f .r .y .l .cl .p .h
+.SUFFIXES: .sh .m4
+
+.LIBS: .a
+
+AR?= ar
+ARFLAGS?= rl
+RANLIB?= ranlib
+
+AS?= as
+AFLAGS?=
+.if ${MACHINE_ARCH} == "sparc64"
+AFLAGS+= -Wa,-Av9a
+.endif
+COMPILE.s?= ${CC} ${AFLAGS} -c
+LINK.s?= ${CC} ${AFLAGS} ${LDFLAGS}
+COMPILE.S?= ${CC} ${AFLAGS} ${CPPFLAGS} -c -traditional-cpp
+LINK.S?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+CC?= cc
+.if ${MACHINE_ARCH} == "alpha" || \
+ ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "arm26" || \
+ ${MACHINE_ARCH} == "arm32" || \
+ ${MACHINE_ARCH} == "i386" || \
+ ${MACHINE_ARCH} == "m68k" || \
+ ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb" || \
+ ${MACHINE_ARCH} == "sparc" || \
+ ${MACHINE_ARCH} == "vax"
+DBG?= -O2
+.elif ${MACHINE_ARCH} == "x86_64"
+DBG?=
+.else
+DBG?= -O
+.endif
+CFLAGS?= ${DBG}
+COMPILE.c?= ${CC} ${CFLAGS} ${CPPFLAGS} -c
+LINK.c?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+CXX?= c++
+CXXFLAGS?= ${CFLAGS}
+COMPILE.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
+LINK.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+OBJC?= ${CC}
+OBJCFLAGS?= ${CFLAGS}
+COMPILE.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c
+LINK.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+CPP?= cpp
+CPPFLAGS?=
+
+FC?= f77
+FFLAGS?= -O
+RFLAGS?=
+COMPILE.f?= ${FC} ${FFLAGS} -c
+LINK.f?= ${FC} ${FFLAGS} ${LDFLAGS}
+COMPILE.F?= ${FC} ${FFLAGS} ${CPPFLAGS} -c
+LINK.F?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.r?= ${FC} ${FFLAGS} ${RFLAGS} -c
+LINK.r?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
+
+INSTALL?= install
+
+LEX?= lex
+LFLAGS?=
+LEX.l?= ${LEX} ${LFLAGS}
+
+LD?= ld
+LDFLAGS?=
+
+LINT?= lint
+LINTFLAGS?= -chapbxzF
+
+LORDER?= lorder
+
+MAKE?= make
+
+NM?= nm
+
+PC?= pc
+PFLAGS?=
+COMPILE.p?= ${PC} ${PFLAGS} ${CPPFLAGS} -c
+LINK.p?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+SHELL?= sh
+
+SIZE?= size
+
+TSORT?= tsort -q
+
+YACC?= yacc
+YFLAGS?=
+YACC.y?= ${YACC} ${YFLAGS}
+
+# C
+.c:
+ ${LINK.c} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.c.o:
+ ${COMPILE.c} ${.IMPSRC}
+.c.a:
+ ${COMPILE.c} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+.c.ln:
+ ${LINT} ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i ${.IMPSRC}
+
+# C++
+.cc .cpp .cxx .C:
+ ${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.cc.o .cpp.o .cxx.o .C.o:
+ ${COMPILE.cc} ${.IMPSRC}
+.cc.a .cpp.a .cxx.a .C.a:
+ ${COMPILE.cc} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Fortran/Ratfor
+.f:
+ ${LINK.f} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.f.o:
+ ${COMPILE.f} ${.IMPSRC}
+.f.a:
+ ${COMPILE.f} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+.F:
+ ${LINK.F} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.F.o:
+ ${COMPILE.F} ${.IMPSRC}
+.F.a:
+ ${COMPILE.F} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+.r:
+ ${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.r.o:
+ ${COMPILE.r} ${.IMPSRC}
+.r.a:
+ ${COMPILE.r} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Pascal
+.p:
+ ${LINK.p} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.p.o:
+ ${COMPILE.p} ${.IMPSRC}
+.p.a:
+ ${COMPILE.p} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Assembly
+.s:
+ ${LINK.s} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.s.o:
+ ${COMPILE.s} ${.IMPSRC}
+.s.a:
+ ${COMPILE.s} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+.S:
+ ${LINK.S} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.S.o:
+ ${COMPILE.S} ${.IMPSRC}
+.S.a:
+ ${COMPILE.S} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Lex
+.l:
+ ${LEX.l} ${.IMPSRC}
+ ${LINK.c} -o ${.TARGET} lex.yy.c ${LDLIBS} -ll
+ rm -f lex.yy.c
+.l.c:
+ ${LEX.l} ${.IMPSRC}
+ mv lex.yy.c ${.TARGET}
+.l.o:
+ ${LEX.l} ${.IMPSRC}
+ ${COMPILE.c} -o ${.TARGET} lex.yy.c
+ rm -f lex.yy.c
+
+# Yacc
+.y:
+ ${YACC.y} ${.IMPSRC}
+ ${LINK.c} -o ${.TARGET} y.tab.c ${LDLIBS}
+ rm -f y.tab.c
+.y.c:
+ ${YACC.y} ${.IMPSRC}
+ mv y.tab.c ${.TARGET}
+.y.o:
+ ${YACC.y} ${.IMPSRC}
+ ${COMPILE.c} -o ${.TARGET} y.tab.c
+ rm -f y.tab.c
+
+# Shell
+.sh:
+ rm -f ${.TARGET}
+ cp ${.IMPSRC} ${.TARGET}
diff --git a/pkgtools/bootstrap-mk-files/files/mods/OSF1.sys.mk b/pkgtools/bootstrap-mk-files/files/mods/OSF1.sys.mk
new file mode 100644
index 00000000000..bed4eb074fb
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/mods/OSF1.sys.mk
@@ -0,0 +1,193 @@
+# $NetBSD: OSF1.sys.mk,v 1.1.1.1 2006/07/14 23:13:01 jlam Exp $
+# @(#)sys.mk 8.2 (Berkeley) 3/21/94
+
+unix?= We run Unix
+OS!= uname -s
+
+.SUFFIXES: .out .a .ln .o .s .S .c .cc .cpp .cxx .C .F .f .r .y .l .cl .p .h
+.SUFFIXES: .sh .m4
+
+.LIBS: .a
+
+AR?= ar
+ARFLAGS?= rl
+RANLIB?= ranlib
+
+AS?= as
+AFLAGS?=
+COMPILE.s?= ${CC} ${AFLAGS} -c
+LINK.s?= ${CC} ${AFLAGS} ${LDFLAGS}
+COMPILE.S?= ${CC} ${AFLAGS} ${CPPFLAGS} -c -traditional-cpp
+LINK.S?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+CC?= cc
+NOGCCERROR?= # defined
+DBG?= -O2
+CFLAGS?= ${DBG}
+COMPILE.c?= ${CC} ${CFLAGS} ${CPPFLAGS} -c
+LINK.c?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+CXX?= cxx
+CXXFLAGS?= ${CFLAGS}
+COMPILE.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
+LINK.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+OBJC?= ${CC}
+OBJCFLAGS?= ${CFLAGS}
+COMPILE.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c
+LINK.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+CPP?= CC -E
+CPPFLAGS?=
+
+FC?= f77
+FFLAGS?= -O
+RFLAGS?=
+COMPILE.f?= ${FC} ${FFLAGS} -c
+LINK.f?= ${FC} ${FFLAGS} ${LDFLAGS}
+COMPILE.F?= ${FC} ${FFLAGS} ${CPPFLAGS} -c
+LINK.F?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.r?= ${FC} ${FFLAGS} ${RFLAGS} -c
+LINK.r?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
+
+INSTALL?= ${PREFIX}/bin/install-sh
+
+LEX?= lex
+LFLAGS?=
+LEX.l?= ${LEX} ${LFLAGS}
+
+LD?= ld
+LDFLAGS?=
+
+LINT?= lint
+LINTFLAGS?= -chapbxzF
+
+LORDER?= lorder
+
+MAKE?= make
+
+NM?= nm
+
+PC?= pc
+PFLAGS?=
+COMPILE.p?= ${PC} ${PFLAGS} ${CPPFLAGS} -c
+LINK.p?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+SHELL?= sh
+
+SIZE?= size
+
+TSORT?= tsort
+
+YACC?= yacc
+YFLAGS?=
+YACC.y?= ${YACC} ${YFLAGS}
+
+# C
+.c:
+ ${LINK.c} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.c.o:
+ ${COMPILE.c} ${.IMPSRC}
+.c.a:
+ ${COMPILE.c} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+.c.ln:
+ ${LINT} ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i ${.IMPSRC}
+
+# C++
+.cc .cpp .cxx .C:
+ ${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.cc.o .cpp.o .cxx.o .C.o:
+ ${COMPILE.cc} ${.IMPSRC}
+.cc.a .cpp.a .cxx.a .C.a:
+ ${COMPILE.cc} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Fortran/Ratfor
+.f:
+ ${LINK.f} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.f.o:
+ ${COMPILE.f} ${.IMPSRC}
+.f.a:
+ ${COMPILE.f} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+.F:
+ ${LINK.F} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.F.o:
+ ${COMPILE.F} ${.IMPSRC}
+.F.a:
+ ${COMPILE.F} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+.r:
+ ${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.r.o:
+ ${COMPILE.r} ${.IMPSRC}
+.r.a:
+ ${COMPILE.r} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Pascal
+.p:
+ ${LINK.p} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.p.o:
+ ${COMPILE.p} ${.IMPSRC}
+.p.a:
+ ${COMPILE.p} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Assembly
+.s:
+ ${LINK.s} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.s.o:
+ ${COMPILE.s} ${.IMPSRC}
+.s.a:
+ ${COMPILE.s} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+.S:
+ ${LINK.S} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.S.o:
+ ${COMPILE.S} ${.IMPSRC}
+.S.a:
+ ${COMPILE.S} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Lex
+.l:
+ ${LEX.l} ${.IMPSRC}
+ ${LINK.c} -o ${.TARGET} lex.yy.c ${LDLIBS} -ll
+ rm -f lex.yy.c
+.l.c:
+ ${LEX.l} ${.IMPSRC}
+ mv lex.yy.c ${.TARGET}
+.l.o:
+ ${LEX.l} ${.IMPSRC}
+ ${COMPILE.c} -o ${.TARGET} lex.yy.c
+ rm -f lex.yy.c
+
+# Yacc
+.y:
+ ${YACC.y} ${.IMPSRC}
+ ${LINK.c} -o ${.TARGET} y.tab.c ${LDLIBS}
+ rm -f y.tab.c
+.y.c:
+ ${YACC.y} ${.IMPSRC}
+ mv y.tab.c ${.TARGET}
+.y.o:
+ ${YACC.y} ${.IMPSRC}
+ ${COMPILE.c} -o ${.TARGET} y.tab.c
+ rm -f y.tab.c
+
+# Shell
+.sh:
+ rm -f ${.TARGET}
+ cp ${.IMPSRC} ${.TARGET}
diff --git a/pkgtools/bootstrap-mk-files/files/mods/OpenBSD.bsd.man.mk b/pkgtools/bootstrap-mk-files/files/mods/OpenBSD.bsd.man.mk
new file mode 100644
index 00000000000..bc367109075
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/mods/OpenBSD.bsd.man.mk
@@ -0,0 +1,137 @@
+# $NetBSD: OpenBSD.bsd.man.mk,v 1.1.1.1 2006/07/14 23:13:01 jlam Exp $
+# From:
+# OpenBSD: bsd.man.mk,v 1.23 2001/07/20 23:02:21 espie Exp
+# NetBSD: bsd.man.mk,v 1.23 1996/02/10 07:49:33 jtc Exp
+# @(#)bsd.man.mk 5.2 (Berkeley) 5/11/90
+
+MANTARGET?= cat
+NROFF?= nroff -Tascii
+TBL?= tbl
+
+.if !target(.MAIN)
+.if exists(${.CURDIR}/../Makefile.inc)
+.include "${.CURDIR}/../Makefile.inc"
+.endif
+
+.MAIN: all
+.endif
+
+.SUFFIXES: .1 .2 .3 .3p .4 .5 .6 .7 .8 .9 .1tbl .2tbl .3tbl .4tbl .5tbl .6tbl \
+ .7tbl .8tbl .9tbl .cat1 .cat2 .cat3 .cat4 .cat5 .cat6 .cat7 .cat8 .cat9 \
+ .ps1 .ps2 .ps3 .ps4 .ps5 .ps6 .ps7 .ps8 .ps9
+
+.9.cat9 .8.cat8 .7.cat7 .6.cat6 .5.cat5 .4.cat4 .3p.cat3p .3.cat3 .2.cat2 .1.cat1:
+ @echo "${NROFF} -mandoc ${.IMPSRC} > ${.TARGET}"
+ @${NROFF} -mandoc ${.IMPSRC} > ${.TARGET} || (rm -f ${.TARGET}; false)
+
+.9tbl.cat9 .8tbl.cat8 .7tbl.cat7 .6tbl.cat6 .5tbl.cat5 .4tbl.cat4 .3tbl.cat3 \
+.2tbl.cat2 .1tbl.cat1:
+ @echo "${TBL} ${.IMPSRC} | ${NROFF} -mandoc > ${.TARGET}"
+ @${TBL} ${.IMPSRC} | ${NROFF} -mandoc > ${.TARGET} || \
+ (rm -f ${.TARGET}; false)
+
+.9.ps9 .8.ps8 .7.ps7 .6.ps6 .5.ps5 .4.ps4 .3p.ps3p .3.ps3 .2.ps2 .1.ps1:
+ @echo "nroff -Tps -mandoc ${.IMPSRC} > ${.TARGET}"
+ @nroff -Tps -mandoc ${.IMPSRC} > ${.TARGET} || (rm -f ${.TARGET}; false)
+
+.9tbl.ps9 .8tbl.ps8 .7tbl.ps7 .6tbl.ps6 .5tbl.ps5 .4tbl.ps4 .3tbl.ps3 \
+.2tbl.ps2 .1tbl.ps1:
+ @echo "${TBL} ${.IMPSRC} | nroff -Tps -mandoc > ${.TARGET}"
+ @${TBL} ${.IMPSRC} | nroff -Tps -mandoc > ${.TARGET} || (rm -f ${.TARGET}; false)
+
+.if defined(MAN) && !empty(MAN) && !defined(MANALL)
+
+MANALL= ${MAN:S/.1$/.cat1/g:S/.2$/.cat2/g:S/.3$/.cat3/g:S/.3p$/.cat3p/g:S/.4$/.cat4/g:S/.5$/.cat5/g:S/.6$/.cat6/g:S/.7$/.cat7/g:S/.8$/.cat8/g:S/.9$/.cat9/g:S/.1tbl$/.cat1/g:S/.2tbl$/.cat2/g:S/.3tbl$/.cat3/g:S/.4tbl$/.cat4/g:S/.5tbl$/.cat5/g:S/.6tbl$/.cat6/g:S/.7tbl$/.cat7/g:S/.8tbl$/.cat8/g:S/.9tbl$/.cat9/g}
+
+.if defined(MANPS)
+
+PSALL= ${MAN:S/.1$/.ps1/g:S/.2$/.ps2/g:S/.3$/.ps3/g:S/.3p$/.ps3p/g:S/.4$/.ps4/g:S/.5$/.ps5/g:S/.6$/.ps6/g:S/.7$/.ps7/g:S/.8$/.ps8/g:S/.9$/.ps9/g:S/.1tbl$/.ps1/g:S/.2tbl$/.ps2/g:S/.3tbl$/.ps3/g:S/.4tbl$/.ps4/g:S/.5tbl$/.ps5/g:S/.6tbl$/.ps6/g:S/.7tbl$/.ps7/g:S/.8tbl$/.ps8/g:S/.9tbl$/.ps9/g}
+
+.endif
+
+.endif
+
+MINSTALL= ${INSTALL} ${INSTALL_COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
+.if defined(MANZ)
+# chown and chmod are done afterward automatically
+MCOMPRESS= gzip -cf
+MCOMPRESSSUFFIX= .gz
+.endif
+
+.if defined(MANSUBDIR)
+# Add / so that we don't have to specify it. Better arch -> MANSUBDIR mapping
+MANSUBDIR:=${MANSUBDIR:S,^,/,}
+.else
+# XXX MANSUBDIR must be non empty for the mlink loops to work
+MANSUBDIR=''
+.endif
+
+maninstall:
+.if defined(MANALL)
+ @for page in ${MANALL}; do \
+ set -- ${MANSUBDIR}; \
+ subdir=$$1; \
+ dir=${DESTDIR}${MANDIR}$${page##*.cat}; \
+ base=$${page##*/}; \
+ instpage=$${dir}$${subdir}/$${base%.*}.0${MCOMPRESSSUFFIX}; \
+ if [ X"${MCOMPRESS}" = X ]; then \
+ echo ${MINSTALL} $$page $$instpage; \
+ ${MINSTALL} $$page $$instpage; \
+ else \
+ rm -f $$instpage; \
+ echo ${MCOMPRESS} $$page \> $$instpage; \
+ ${MCOMPRESS} $$page > $$instpage; \
+ chown ${MANOWN}:${MANGRP} $$instpage; \
+ chmod ${MANMODE} $$instpage; \
+ fi; \
+ while test $$# -ge 2; do \
+ shift; \
+ extra=$${dir}$$1/$${base%.*}.0${MCOMPRESSSUFFIX}; \
+ echo $$extra -\> $$instpage; \
+ ln -f $$instpage $$extra; \
+ done; \
+ done
+.endif
+.if defined(PSALL)
+ @for page in ${PSALL}; do \
+ set -- ${MANSUBDIR}; \
+ subdir=$$1; \
+ dir=${DESTDIR}${PSDIR}$${page##*.ps}; \
+ base=$${page##*/}; \
+ instpage=$${dir}$${subdir}/$${base%.*}.ps${MCOMPRESSSUFFIX}; \
+ if [ X"${MCOMPRESS}" = X ]; then \
+ echo ${MINSTALL} $$page $$instpage; \
+ ${MINSTALL} $$page $$instpage; \
+ else \
+ rm -f $$instpage; \
+ echo ${MCOMPRESS} $$page \> $$instpage; \
+ ${MCOMPRESS} $$page > $$instpage; \
+ chown ${PSOWN}:${PSGRP} $$instpage; \
+ chmod ${PSMODE} $$instpage; \
+ fi; \
+ while test $$# -ge 2; do \
+ shift; \
+ extra=$${dir}$$1/$${base%.*}.ps${MCOMPRESSSUFFIX}; \
+ echo $$extra -\> $$instpage; \
+ ln -f $$instpage $$extra; \
+ done; \
+ done
+.endif
+.if defined(MLINKS) && !empty(MLINKS)
+. for sub in ${MANSUBDIR}
+. for lnk file in ${MLINKS}
+ @l=${DESTDIR}${MANDIR}${lnk:E}${sub}/${lnk:R}.0${MCOMPRESSSUFFIX}; \
+ t=${DESTDIR}${MANDIR}${file:E}${sub}/${file:R}.0${MCOMPRESSSUFFIX}; \
+ echo $$t -\> $$l; \
+ rm -f $$t; ln $$l $$t;
+. endfor
+. endfor
+.endif
+
+.if (defined(MANALL) || defined(PSALL)) && !defined(MANLOCALBUILD)
+all: ${MANALL} ${PSALL}
+
+cleandir: cleanman
+cleanman:
+ rm -f ${MANALL} ${PSALL}
+.endif
diff --git a/pkgtools/bootstrap-mk-files/files/mods/OpenBSD.bsd.own.mk.in b/pkgtools/bootstrap-mk-files/files/mods/OpenBSD.bsd.own.mk.in
new file mode 100644
index 00000000000..5842c2f4966
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/mods/OpenBSD.bsd.own.mk.in
@@ -0,0 +1,308 @@
+# $NetBSD: OpenBSD.bsd.own.mk.in,v 1.1.1.1 2006/07/14 23:13:01 jlam Exp $
+
+.if !defined(_BSD_OWN_MK_)
+_BSD_OWN_MK_=1
+
+# XXX On systems with a Berkeley-style make, perhaps we ought to check
+# XXX for and source a file other than /etc/mk.conf
+
+.if defined(MAKECONF) && exists(${MAKECONF})
+.include "${MAKECONF}"
+.elif exists(@SYSCONFDIR@/mk.conf)
+.include "@SYSCONFDIR@/mk.conf"
+.elif exists(/etc/mk.conf)
+.include "/etc/mk.conf"
+.endif
+
+# Defining `SKEY' causes support for S/key authentication to be compiled in.
+SKEY= yes
+
+# where the system object and source trees are kept; can be configurable
+# by the user in case they want them in ~/foosrc and ~/fooobj, for example
+BSDSRCDIR?= /usr/src
+BSDOBJDIR?= /usr/obj
+
+BINGRP?= wheel
+BINOWN?= root
+BINMODE?= 555
+NONBINMODE?= 444
+
+# Define MANZ to have the man pages compressed (gzip)
+#MANZ= 1
+
+MANDIR?= /usr/share/man
+MANGRP?= wheel
+MANOWN?= root
+MANMODE?= ${NONBINMODE}
+MANINSTALL?= maninstall catinstall
+
+INFODIR?= /usr/share/info
+INFOGRP?= wheel
+INFOOWN?= root
+INFOMODE?= ${NONBINMODE}
+
+LIBDIR?= /usr/lib
+LINTLIBDIR?= /usr/libdata/lint
+LIBGRP?= ${BINGRP}
+LIBOWN?= ${BINOWN}
+LIBMODE?= ${NONBINMODE}
+
+DOCDIR?= /usr/share/doc
+HTMLDOCDIR?= /usr/share/doc/html
+DOCGRP?= wheel
+DOCOWN?= root
+DOCMODE?= ${NONBINMODE}
+
+NLSDIR?= /usr/share/nls
+NLSGRP?= wheel
+NLSOWN?= root
+NLSMODE?= ${NONBINMODE}
+
+KMODDIR?= /usr/lkm
+KMODGRP?= wheel
+KMODOWN?= root
+KMODMODE?= ${NONBINMODE}
+
+LOCALEDIR?= /usr/share/locale
+LOCALEGRP?= wheel
+LOCALEOWN?= root
+LOCALEMODE?= ${NONBINMODE}
+
+COPY?= -c
+.if defined(UPDATE)
+PRESERVE?= -p
+.else
+PRESERVE?=
+.endif
+.if defined(UNPRIVILEGED)
+INSTPRIV?= -U
+.endif
+STRIPFLAG?= -s
+
+# Define SYS_INCLUDE to indicate whether you want symbolic links to the system
+# source (``symlinks''), or a separate copy (``copies''); (latter useful
+# in environments where it's not possible to keep /sys publicly readable)
+#SYS_INCLUDE= symlinks
+
+# Profiling and linting is also off on the x86_64 port at the moment.
+.if ${MACHINE_ARCH} == "sparc64"
+NOPROFILE=1
+NOLINT=1
+.endif
+
+# The m68000 port is incomplete.
+.if ${MACHINE_ARCH} == "m68000"
+NOLINT=1
+NOPROFILE=1
+NOPIC?=1
+.endif
+
+# Data-driven table using make variables to control how
+# toolchain-dependent targets and shared libraries are built
+# for different platforms and object formats.
+# OBJECT_FMT: currently either "ELF" or "a.out".
+# SHLIB_TYPE: "ELF" or "a.out" or "" to force static libraries.
+#
+.if ${MACHINE_ARCH} == "alpha" || \
+ ${MACHINE_ARCH} == "powerpc" || \
+ ${MACHINE_ARCH} == "sparc"
+OBJECT_FMT?=ELF
+.else
+OBJECT_FMT?=a.out
+.endif
+
+# Location of the file that contains the major and minor numbers of the
+# version of a shared library. If this file exists a shared library
+# will be built by <bsd.lib.mk>.
+SHLIB_VERSION_FILE?= ${.CURDIR}/shlib_version
+
+# GNU sources and packages sometimes see architecture names differently.
+# This table maps an architecture name to its GNU counterpart.
+# Use as so: ${GNU_ARCH.${TARGET_ARCH}} or ${MACHINE_GNU_ARCH}
+.ifndef MACHINE_GNU_ARCH
+GNU_ARCH.alpha=alpha
+GNU_ARCH.arm26=arm
+GNU_ARCH.arm32=arm
+GNU_ARCH.arm=arm
+GNU_ARCH.i386=i386
+GNU_ARCH.m68k=m68k
+GNU_ARCH.mipseb=mipseb
+GNU_ARCH.mipsel=mipsel
+GNU_ARCH.ns32k=ns32k
+GNU_ARCH.powerpc=powerpc
+GNU_ARCH.sh3eb=sh
+GNU_ARCH.sh3el=sh
+GNU_ARCH.sparc=sparc
+GNU_ARCH.sparc64=sparc64
+GNU_ARCH.vax=vax
+MACHINE_GNU_ARCH=${GNU_ARCH.${MACHINE_ARCH}}
+.endif
+
+# In order to identify NetBSD to GNU packages, we sometimes need
+# an "elf" tag for historically a.out platforms.
+.if ${OBJECT_FMT} == "ELF" && \
+ (${MACHINE_ARCH} == "arm" || \
+ ${MACHINE_ARCH} == "i386" || \
+ ${MACHINE_ARCH} == "m68k" || \
+ ${MACHINE_ARCH} == "sparc" || \
+ ${MACHINE_ARCH} == "vax")
+MACHINE_GNU_PLATFORM?= netbsdelf
+.else
+MACHINE_GNU_PLATFORM?= netbsd
+.endif
+
+# CPU model, derived from MACHINE_ARCH
+MACHINE_CPU= ${MACHINE_ARCH:C/mipse[bl]/mips/:S/arm26/arm/:S/arm32/arm/:C/sh3e[bl]/sh3/:S/m68000/m68k/}
+
+.if ${MACHINE_ARCH} == "mips"
+.BEGIN:
+ @echo Must set MACHINE_ARCH to one of mipseb or mipsel
+ @false
+.endif
+.if ${MACHINE_ARCH} == "sh3"
+.BEGIN:
+ @echo Must set MACHINE_ARCH to one of sh3eb or sh3el
+ @false
+.endif
+
+TARGETS+= all clean cleandir depend dependall includes \
+ install lint obj regress tags html installhtml cleanhtml
+.PHONY: all clean cleandir depend dependall distclean includes \
+ install lint obj regress tags beforedepend afterdepend \
+ beforeinstall afterinstall realinstall realdepend realall \
+ html installhtml cheanhtml
+
+# set NEED_OWN_INSTALL_TARGET, if it's not already set, to yes
+# this is used by bsd.pkg.mk to stop "install" being defined
+NEED_OWN_INSTALL_TARGET?= yes
+
+.if ${NEED_OWN_INSTALL_TARGET} == "yes"
+.if !target(install)
+install: .NOTMAIN beforeinstall subdir-install realinstall afterinstall
+beforeinstall: .NOTMAIN
+subdir-install: .NOTMAIN beforeinstall
+realinstall: .NOTMAIN beforeinstall
+afterinstall: .NOTMAIN subdir-install realinstall
+.endif
+all: .NOTMAIN realall subdir-all
+subdir-all: .NOTMAIN
+realall: .NOTMAIN
+depend: .NOTMAIN realdepend subdir-depend
+subdir-depend: .NOTMAIN
+realdepend: .NOTMAIN
+distclean: .NOTMAIN cleandir
+.endif
+
+PRINTOBJDIR= printf "xxx: .MAKE\n\t@echo \$${.OBJDIR}\n" | ${MAKE} -B -s -f-
+
+# Define MKxxx variables (which are either yes or no) for users
+# to set in /etc/mk.conf and override on the make commandline.
+# These should be tested with `== "no"' or `!= "no"'.
+# The NOxxx variables should only be used by Makefiles.
+#
+
+MKCATPAGES?=yes
+
+.if defined(NODOC)
+MKDOC=no
+#.elif !defined(MKDOC)
+#MKDOC=yes
+.else
+MKDOC?=yes
+.endif
+
+MKINFO?=yes
+
+.if defined(NOLINKLIB)
+MKLINKLIB=no
+.else
+MKLINKLIB?=yes
+.endif
+.if ${MKLINKLIB} == "no"
+MKPICINSTALL=no
+MKPROFILE=no
+.endif
+
+.if defined(NOLINT)
+MKLINT=no
+.else
+MKLINT?=yes
+.endif
+
+.if defined(NOMAN)
+MKMAN=no
+.else
+MKMAN?=yes
+.endif
+.if ${MKMAN} == "no"
+MKCATPAGES=no
+.endif
+
+.if defined(NONLS)
+MKNLS=no
+.else
+MKNLS?=yes
+.endif
+
+#
+# MKOBJDIRS controls whether object dirs are created during "make build".
+# MKOBJ controls whether the "make obj" rule does anything.
+#
+.if defined(NOOBJ)
+MKOBJ=no
+MKOBJDIRS=no
+.else
+MKOBJ?=yes
+MKOBJDIRS?=no
+.endif
+
+.if defined(NOPIC)
+MKPIC=no
+.else
+MKPIC?=yes
+.endif
+
+.if defined(NOPICINSTALL)
+MKPICINSTALL=no
+.else
+MKPICINSTALL?=yes
+.endif
+
+.if defined(NOPROFILE)
+MKPROFILE=no
+.else
+MKPROFILE?=yes
+.endif
+
+.if defined(NOSHARE)
+MKSHARE=no
+.else
+MKSHARE?=yes
+.endif
+.if ${MKSHARE} == "no"
+MKCATPAGES=no
+MKDOC=no
+MKINFO=no
+MKMAN=no
+MKNLS=no
+.endif
+
+.if defined(NOCRYPTO)
+MKCRYPTO=no
+.else
+MKCRYPTO?=yes
+.endif
+
+MKCRYPTO_IDEA?=no
+
+MKCRYPTO_RC5?=no
+
+.if defined(NOKERBEROS) || (${MKCRYPTO} == "no")
+MKKERBEROS=no
+.else
+MKKERBEROS?=yes
+.endif
+
+MKSOFTFLOAT?=no
+
+.endif # _BSD_OWN_MK_
diff --git a/pkgtools/bootstrap-mk-files/files/mods/OpenBSD.sys.mk b/pkgtools/bootstrap-mk-files/files/mods/OpenBSD.sys.mk
new file mode 100644
index 00000000000..2ef8389731e
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/mods/OpenBSD.sys.mk
@@ -0,0 +1,202 @@
+# $NetBSD: OpenBSD.sys.mk,v 1.1.1.1 2006/07/14 23:13:01 jlam Exp $
+# @(#)sys.mk 8.2 (Berkeley) 3/21/94
+
+unix?= We run OpenBSD.
+
+.SUFFIXES: .out .a .ln .o .s .S .c .cc .cpp .cxx .C .F .f .r .y .l .cl .p .h
+.SUFFIXES: .sh .m4
+
+.LIBS: .a
+
+AR?= ar
+ARFLAGS?= rl
+RANLIB?= ranlib
+
+AS?= as
+AFLAGS?=
+.if ${MACHINE_ARCH} == "sparc64"
+AFLAGS+= -Wa,-Av9a
+.endif
+COMPILE.s?= ${CC} ${AFLAGS} -c
+LINK.s?= ${CC} ${AFLAGS} ${LDFLAGS}
+COMPILE.S?= ${CC} ${AFLAGS} ${CPPFLAGS} -c -traditional-cpp
+LINK.S?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+CC?= cc
+.if ${MACHINE_ARCH} == "alpha" || \
+ ${MACHINE_ARCH} == "i386" || \
+ ${MACHINE_ARCH} == "m68k" || \
+ ${MACHINE_ARCH} == "sparc" || \
+ ${MACHINE_ARCH} == "vax"
+DBG?= -O2
+.else
+DBG?= -O
+.endif
+CFLAGS?= ${DBG}
+COMPILE.c?= ${CC} ${CFLAGS} ${CPPFLAGS} -c
+LINK.c?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+CXX?= c++
+CXXFLAGS?= ${CFLAGS}
+COMPILE.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
+LINK.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+OBJC?= ${CC}
+OBJCFLAGS?= ${CFLAGS}
+COMPILE.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c
+LINK.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+CPP?= cpp
+CPPFLAGS?=
+
+FC?= f77
+FFLAGS?= -O
+RFLAGS?=
+COMPILE.f?= ${FC} ${FFLAGS} -c
+LINK.f?= ${FC} ${FFLAGS} ${LDFLAGS}
+COMPILE.F?= ${FC} ${FFLAGS} ${CPPFLAGS} -c
+LINK.F?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.r?= ${FC} ${FFLAGS} ${RFLAGS} -c
+LINK.r?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
+
+INSTALL?= install
+
+LEX?= lex
+LFLAGS?=
+LEX.l?= ${LEX} ${LFLAGS}
+
+LD?= ld
+LDFLAGS?=
+
+LINT?= lint
+LINTFLAGS?= -chapbxzF
+
+LORDER?= lorder
+
+MAKE?= make
+
+NM?= nm
+
+PC?= pc
+PFLAGS?=
+COMPILE.p?= ${PC} ${PFLAGS} ${CPPFLAGS} -c
+LINK.p?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+SHELL?= sh
+
+SIZE?= size
+
+TSORT?= tsort -q
+
+YACC?= yacc
+YFLAGS?=
+YACC.y?= ${YACC} ${YFLAGS}
+
+# C
+.c:
+ ${LINK.c} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.c.o:
+ ${COMPILE.c} ${.IMPSRC}
+.c.a:
+ ${COMPILE.c} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+.c.ln:
+ ${LINT} ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i ${.IMPSRC}
+
+# C++
+.cc .cpp .cxx .C:
+ ${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.cc.o .cpp.o .cxx.o .C.o:
+ ${COMPILE.cc} ${.IMPSRC}
+.cc.a .cpp.a .cxx.a .C.a:
+ ${COMPILE.cc} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Fortran/Ratfor
+.f:
+ ${LINK.f} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.f.o:
+ ${COMPILE.f} ${.IMPSRC}
+.f.a:
+ ${COMPILE.f} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+.F:
+ ${LINK.F} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.F.o:
+ ${COMPILE.F} ${.IMPSRC}
+.F.a:
+ ${COMPILE.F} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+.r:
+ ${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.r.o:
+ ${COMPILE.r} ${.IMPSRC}
+.r.a:
+ ${COMPILE.r} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Pascal
+.p:
+ ${LINK.p} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.p.o:
+ ${COMPILE.p} ${.IMPSRC}
+.p.a:
+ ${COMPILE.p} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Assembly
+.s:
+ ${LINK.s} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.s.o:
+ ${COMPILE.s} ${.IMPSRC}
+.s.a:
+ ${COMPILE.s} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+.S:
+ ${LINK.S} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.S.o:
+ ${COMPILE.S} ${.IMPSRC}
+.S.a:
+ ${COMPILE.S} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Lex
+.l:
+ ${LEX.l} ${.IMPSRC}
+ ${LINK.c} -o ${.TARGET} lex.yy.c ${LDLIBS} -ll
+ rm -f lex.yy.c
+.l.c:
+ ${LEX.l} ${.IMPSRC}
+ mv lex.yy.c ${.TARGET}
+.l.o:
+ ${LEX.l} ${.IMPSRC}
+ ${COMPILE.c} -o ${.TARGET} lex.yy.c
+ rm -f lex.yy.c
+
+# Yacc
+.y:
+ ${YACC.y} ${.IMPSRC}
+ ${LINK.c} -o ${.TARGET} y.tab.c ${LDLIBS}
+ rm -f y.tab.c
+.y.c:
+ ${YACC.y} ${.IMPSRC}
+ mv y.tab.c ${.TARGET}
+.y.o:
+ ${YACC.y} ${.IMPSRC}
+ ${COMPILE.c} -o ${.TARGET} y.tab.c
+ rm -f y.tab.c
+
+# Shell
+.sh:
+ rm -f ${.TARGET}
+ cp ${.IMPSRC} ${.TARGET}
diff --git a/pkgtools/bootstrap-mk-files/files/mods/SunOS.bsd.sys.mk b/pkgtools/bootstrap-mk-files/files/mods/SunOS.bsd.sys.mk
new file mode 100644
index 00000000000..f335afcae73
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/mods/SunOS.bsd.sys.mk
@@ -0,0 +1,141 @@
+# $NetBSD: SunOS.bsd.sys.mk,v 1.1.1.1 2006/07/14 23:13:01 jlam Exp $
+#
+# Overrides used for NetBSD source tree builds.
+
+.if ${CC:M*gcc*} != ""
+
+.if defined(WARNS)
+.if ${WARNS} > 0
+CFLAGS+= -Wall -Wstrict-prototypes -Wmissing-prototypes
+# XXX Delete -Wuninitialized by default for now -- the compiler doesn't
+# XXX always get it right.
+CFLAGS+= -Wno-uninitialized
+.endif
+.if ${WARNS} > 1
+CFLAGS+= -Wreturn-type -Wpointer-arith
+.endif
+.if ${WARNS} > 2
+CFLAGS+= -Wcast-qual -Wwrite-strings
+.endif
+CFLAGS+= -Wswitch -Wshadow
+.endif
+
+.if defined(WFORMAT) && defined(FORMAT_AUDIT)
+.if ${WFORMAT} > 1
+CFLAGS+= -Wnetbsd-format-audit -Wno-format-extra-args
+.endif
+.endif
+
+.if !defined(NOGCCERROR)
+CFLAGS+= -Werror
+.endif
+CFLAGS+= ${CWARNFLAGS}
+
+.if defined(DESTDIR)
+CPPFLAGS+= -nostdinc -idirafter ${DESTDIR}/usr/include
+LINTFLAGS+= -d ${DESTDIR}/usr/include
+.endif
+
+.if defined(MKSOFTFLOAT) && (${MKSOFTFLOAT} != "no")
+COPTS+= -msoft-float
+FOPTS+= -msoft-float
+.endif
+
+.endif # gcc
+
+.if defined(AUDIT)
+CPPFLAGS+= -D__AUDIT__
+.endif
+
+# Helpers for cross-compiling
+HOST_CC?= cc
+HOST_CFLAGS?= -O
+HOST_COMPILE.c?=${HOST_CC} ${HOST_CFLAGS} ${HOST_CPPFLAGS} -c
+HOST_LINK.c?= ${HOST_CC} ${HOST_CFLAGS} ${HOST_CPPFLAGS} ${HOST_LDFLAGS}
+
+HOST_CPP?= cpp
+HOST_CPPFLAGS?=
+
+HOST_LD?= ld
+HOST_LDFLAGS?=
+
+OBJCOPY?= objcopy
+STRIP?= strip
+CONFIG?= config
+RPCGEN?= rpcgen
+MKLOCALE?= mklocale
+
+.SUFFIXES: .m .o .ln .lo
+
+# Objective C
+# (Defined here rather than in <sys.mk> because `.m' is not just
+# used for Objective C source)
+.m:
+ ${LINK.m} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.m.o:
+ ${COMPILE.m} ${.IMPSRC}
+
+# Host-compiled C objects
+.c.lo:
+ ${HOST_COMPILE.c} -o ${.TARGET} ${.IMPSRC}
+
+
+.if defined(PARALLEL) || defined(LPREFIX)
+LPREFIX?=yy
+LFLAGS+=-P${LPREFIX}
+# Lex
+.l:
+ ${LEX.l} -o${.TARGET:R}.${LPREFIX}.c ${.IMPSRC}
+ ${LINK.c} -o ${.TARGET} ${.TARGET:R}.${LPREFIX}.c ${LDLIBS} -ll
+ rm -f ${.TARGET:R}.${LPREFIX}.c
+.l.c:
+ ${LEX.l} -o${.TARGET} ${.IMPSRC}
+.l.o:
+ ${LEX.l} -o${.TARGET:R}.${LPREFIX}.c ${.IMPSRC}
+ ${COMPILE.c} -o ${.TARGET} ${.TARGET:R}.${LPREFIX}.c
+ rm -f ${.TARGET:R}.${LPREFIX}.c
+.l.lo:
+ ${LEX.l} -o${.TARGET:R}.${LPREFIX}.c ${.IMPSRC}
+ ${HOST_COMPILE.c} -o ${.TARGET} ${.TARGET:R}.${LPREFIX}.c
+ rm -f ${.TARGET:R}.${LPREFIX}.c
+.endif
+
+# Yacc
+.if defined(YHEADER) || defined(YPREFIX)
+.if defined(YPREFIX)
+YFLAGS+=-p${YPREFIX}
+.endif
+.if defined(YHEADER)
+YFLAGS+=-d
+.endif
+.y:
+ ${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
+ ${LINK.c} -o ${.TARGET} ${.TARGET:R}.tab.c ${LDLIBS}
+ rm -f ${.TARGET:R}.tab.c ${.TARGET:R}.tab.h
+.y.h: ${.TARGET:R}.c
+.y.c:
+ ${YACC.y} -o ${.TARGET} ${.IMPSRC}
+.y.o:
+ ${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
+ ${COMPILE.c} -o ${.TARGET} ${.TARGET:R}.tab.c
+ rm -f ${.TARGET:R}.tab.c ${TARGET:R}.tab.h
+.y.lo:
+ ${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
+ ${HOST_COMPILE.c} -o ${.TARGET} ${.TARGET:R}.tab.c
+ rm -f ${.TARGET:R}.tab.c ${TARGET:R}.tab.h
+.elif defined(PARALLEL)
+.y:
+ ${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
+ ${LINK.c} -o ${.TARGET} ${.TARGET:R}.tab.c ${LDLIBS}
+ rm -f ${.TARGET:R}.tab.c
+.y.c:
+ ${YACC.y} -o ${.TARGET} ${.IMPSRC}
+.y.o:
+ ${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
+ ${COMPILE.c} -o ${.TARGET} ${.TARGET:R}.tab.c
+ rm -f ${.TARGET:R}.tab.c
+.y.lo:
+ ${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
+ ${HOST_COMPILE.c} -o ${.TARGET} ${.TARGET:R}.tab.c
+ rm -f ${.TARGET:R}.tab.c
+.endif
diff --git a/pkgtools/bootstrap-mk-files/files/mods/SunOS.sys.mk b/pkgtools/bootstrap-mk-files/files/mods/SunOS.sys.mk
new file mode 100644
index 00000000000..db5765b78db
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/mods/SunOS.sys.mk
@@ -0,0 +1,211 @@
+# $NetBSD: SunOS.sys.mk,v 1.1.1.1 2006/07/14 23:13:01 jlam Exp $
+# NetBSD: sys.mk,v 1.58 2000/08/22 17:38:49 bjh21 Exp
+# @(#)sys.mk 8.2 (Berkeley) 3/21/94
+
+unix?= We run Unix.
+OS?= SunOS.5
+
+.SUFFIXES: .out .a .ln .o .s .S .c .cc .cpp .cxx .C .F .f .r .y .l .cl .p .h
+.SUFFIXES: .sh .m4
+
+.LIBS: .a
+
+AR?= ar
+ARFLAGS?= rl
+RANLIB?= ranlib
+
+AS?= as
+AFLAGS?=
+COMPILE.s?= ${CC} ${AFLAGS} -c
+LINK.s?= ${CC} ${AFLAGS} ${LDFLAGS}
+COMPILE.S?= ${AS} ${AFLAGS} ${CPPFLAGS} -P
+LINK.S?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+# Unless told otherwise, assume GNU CC
+CC?= gcc
+
+DBG?= -O
+
+CFLAGS?= ${DBG}
+COMPILE.c?= ${CC} ${CFLAGS} ${CPPFLAGS} -c
+LINK.c?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+CXX?= g++
+CXXFLAGS?= ${CFLAGS}
+COMPILE.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
+LINK.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+OBJC?= ${CC}
+OBJCFLAGS?= ${CFLAGS}
+COMPILE.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c
+LINK.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+CPP?= cpp
+.if defined(NETBSD_COMPATIBLE)
+CPPFLAGS?= -I${BSDDIR}/include -D__EXTENSIONS__ -D_XPG4_2 -DSUNOS_5
+HOST_CPPFLAGS?= ${CPPFLAGS}
+NOLINT=1
+.else
+CPPFLAGS?=
+.endif
+
+FC?= f77
+FFLAGS?= -O
+RFLAGS?=
+COMPILE.f?= ${FC} ${FFLAGS} -c
+LINK.f?= ${FC} ${FFLAGS} ${LDFLAGS}
+COMPILE.F?= ${FC} ${FFLAGS} ${CPPFLAGS} -c
+LINK.F?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.r?= ${FC} ${FFLAGS} ${RFLAGS} -c
+LINK.r?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
+
+INSTALL?= /usr/ucb/install
+
+LEX?= lex
+LFLAGS?=
+LEX.l?= ${LEX} ${LFLAGS}
+
+LD?= ld
+LDFLAGS?=
+
+LINT?= lint
+LINTFLAGS?= -chapbxzF
+
+LORDER?= lorder
+
+MAKE?= make
+
+NM?= nm
+
+PC?= pc
+PFLAGS?=
+COMPILE.p?= ${PC} ${PFLAGS} ${CPPFLAGS} -c
+LINK.p?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+SHELL?= sh
+
+SIZE?= size
+
+TSORT?= tsort
+
+YACC?= yacc
+YFLAGS?=
+YACC.y?= ${YACC} ${YFLAGS}
+
+# C
+.c:
+ ${LINK.c} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.c.o:
+ ${COMPILE.c} ${.IMPSRC}
+.c.a:
+ ${COMPILE.c} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+.c.ln:
+ ${LINT} ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i ${.IMPSRC}
+
+# C++
+.cc .cpp .cxx .C:
+ ${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.cc.o .cpp.o .cxx.o .C.o:
+ ${COMPILE.cc} ${.IMPSRC}
+.cc.a .cpp.a .cxx.a .C.a:
+ ${COMPILE.cc} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Fortran/Ratfor
+.f:
+ ${LINK.f} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.f.o:
+ ${COMPILE.f} ${.IMPSRC}
+.f.a:
+ ${COMPILE.f} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+.F:
+ ${LINK.F} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.F.o:
+ ${COMPILE.F} ${.IMPSRC}
+.F.a:
+ ${COMPILE.F} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+.r:
+ ${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.r.o:
+ ${COMPILE.r} ${.IMPSRC}
+.r.a:
+ ${COMPILE.r} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Pascal
+.p:
+ ${LINK.p} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.p.o:
+ ${COMPILE.p} ${.IMPSRC}
+.p.a:
+ ${COMPILE.p} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Assembly
+.s:
+ ${LINK.s} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.s.o:
+ ${COMPILE.s} ${.IMPSRC}
+.s.a:
+ ${COMPILE.s} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+.S:
+ ${LINK.S} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.S.o:
+ ${COMPILE.S} ${.IMPSRC}
+.S.a:
+ ${COMPILE.S} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Lex
+.l:
+ ${LEX.l} ${.IMPSRC}
+ ${LINK.c} -o ${.TARGET} lex.yy.c ${LDLIBS} -ll
+ rm -f lex.yy.c
+.l.c:
+ ${LEX.l} ${.IMPSRC}
+ mv lex.yy.c ${.TARGET}
+.l.o:
+ ${LEX.l} ${.IMPSRC}
+ ${COMPILE.c} -o ${.TARGET} lex.yy.c
+ rm -f lex.yy.c
+
+# Yacc
+.y:
+ ${YACC.y} ${.IMPSRC}
+ ${LINK.c} -o ${.TARGET} y.tab.c ${LDLIBS}
+ rm -f y.tab.c
+.y.c:
+ ${YACC.y} ${.IMPSRC}
+ mv y.tab.c ${.TARGET}
+.y.o:
+ ${YACC.y} ${.IMPSRC}
+ ${COMPILE.c} -o ${.TARGET} y.tab.c
+ rm -f y.tab.c
+
+# Shell
+.sh:
+ rm -f ${.TARGET}
+ cp ${.IMPSRC} ${.TARGET}
+
+# override the definitions in bsd.own.mk for Solaris
+BINGRP?= root
+MANGRP?= root
+INFOGRP?= root
+DOCGRP?= root
+NLSGRP?= root
+KMODGRP?= root
+LOCALEGRP?= root
diff --git a/pkgtools/bootstrap-mk-files/files/mods/UnixWare.sys.mk b/pkgtools/bootstrap-mk-files/files/mods/UnixWare.sys.mk
new file mode 100644
index 00000000000..308b306b479
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/mods/UnixWare.sys.mk
@@ -0,0 +1,195 @@
+# $NetBSD: UnixWare.sys.mk,v 1.1.1.1 2006/07/14 23:13:01 jlam Exp $
+# NetBSD: SunOS.sys.mk,v 1.1.1.1 2004/03/11 13:04:00 grant Exp
+# NetBSD: sys.mk,v 1.58 2000/08/22 17:38:49 bjh21 Exp
+# @(#)sys.mk 8.2 (Berkeley) 3/21/94
+
+unix?= We run Unix.
+OS= UnixWare
+
+.SUFFIXES: .out .a .ln .o .s .S .c .cc .cpp .cxx .C .F .f .r .y .l .cl .p .h
+.SUFFIXES: .sh .m4
+
+.LIBS: .a
+
+AR?= ar
+ARFLAGS?= rl
+RANLIB?= ranlib
+
+AS?= as
+AFLAGS?=
+COMPILE.s?= ${CC} ${AFLAGS} -c
+LINK.s?= ${CC} ${AFLAGS} ${LDFLAGS}
+COMPILE.S?= ${CC} ${AFLAGS} ${CPPFLAGS} -c -traditional-cpp
+LINK.S?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+# gcc on Unixware has no internal macro to identify the system
+CC?= gcc -DUNIXWARE
+DBG?= -O2
+CFLAGS?= ${DBG}
+COMPILE.c?= ${CC} ${CFLAGS} ${CPPFLAGS} -c
+LINK.c?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+CXX?= g++ -DUNIXWARE
+CXXFLAGS?= ${CFLAGS}
+COMPILE.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
+LINK.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+OBJC?= ${CC}
+OBJCFLAGS?= ${CFLAGS}
+COMPILE.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c
+LINK.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+CPP?= cpp
+CPPFLAGS?= -DUNIXWARE
+
+FC?= g77
+FFLAGS?= -O
+RFLAGS?=
+COMPILE.f?= ${FC} ${FFLAGS} -c
+LINK.f?= ${FC} ${FFLAGS} ${LDFLAGS}
+COMPILE.F?= ${FC} ${FFLAGS} ${CPPFLAGS} -c
+LINK.F?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.r?= ${FC} ${FFLAGS} ${RFLAGS} -c
+LINK.r?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
+
+INSTALL?= /usr/ucb/install
+
+LEX?= lex
+LFLAGS?=
+LEX.l?= ${LEX} ${LFLAGS}
+
+LD?= ld
+LDFLAGS?=
+
+LINT?= lint
+LINTFLAGS?= -chapbxzF
+
+LORDER?= lorder
+
+MAKE?= bmake
+
+NM?= nm
+
+PC?= pc
+PFLAGS?=
+COMPILE.p?= ${PC} ${PFLAGS} ${CPPFLAGS} -c
+LINK.p?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+SHELL?= sh
+
+SIZE?= size
+
+TSORT?= tsort
+
+YACC?= yacc
+YFLAGS?=
+YACC.y?= ${YACC} ${YFLAGS}
+
+# C
+.c:
+ ${LINK.c} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.c.o:
+ ${COMPILE.c} ${.IMPSRC}
+.c.a:
+ ${COMPILE.c} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+.c.ln:
+ ${LINT} ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i ${.IMPSRC}
+
+# C++
+.cc .cpp .cxx .C:
+ ${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.cc.o .cpp.o .cxx.o .C.o:
+ ${COMPILE.cc} ${.IMPSRC}
+.cc.a .cpp.a .cxx.a .C.a:
+ ${COMPILE.cc} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Fortran/Ratfor
+.f:
+ ${LINK.f} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.f.o:
+ ${COMPILE.f} ${.IMPSRC}
+.f.a:
+ ${COMPILE.f} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+.F:
+ ${LINK.F} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.F.o:
+ ${COMPILE.F} ${.IMPSRC}
+.F.a:
+ ${COMPILE.F} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+.r:
+ ${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.r.o:
+ ${COMPILE.r} ${.IMPSRC}
+.r.a:
+ ${COMPILE.r} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Pascal
+.p:
+ ${LINK.p} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.p.o:
+ ${COMPILE.p} ${.IMPSRC}
+.p.a:
+ ${COMPILE.p} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Assembly
+.s:
+ ${LINK.s} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.s.o:
+ ${COMPILE.s} ${.IMPSRC}
+.s.a:
+ ${COMPILE.s} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+.S:
+ ${LINK.S} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.S.o:
+ ${COMPILE.S} ${.IMPSRC}
+.S.a:
+ ${COMPILE.S} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Lex
+.l:
+ ${LEX.l} ${.IMPSRC}
+ ${LINK.c} -o ${.TARGET} lex.yy.c ${LDLIBS} -ll
+ rm -f lex.yy.c
+.l.c:
+ ${LEX.l} ${.IMPSRC}
+ mv lex.yy.c ${.TARGET}
+.l.o:
+ ${LEX.l} ${.IMPSRC}
+ ${COMPILE.c} -o ${.TARGET} lex.yy.c
+ rm -f lex.yy.c
+
+# Yacc
+.y:
+ ${YACC.y} ${.IMPSRC}
+ ${LINK.c} -o ${.TARGET} y.tab.c ${LDLIBS}
+ rm -f y.tab.c
+.y.c:
+ ${YACC.y} ${.IMPSRC}
+ mv y.tab.c ${.TARGET}
+.y.o:
+ ${YACC.y} ${.IMPSRC}
+ ${COMPILE.c} -o ${.TARGET} y.tab.c
+ rm -f y.tab.c
+
+# Shell
+.sh:
+ rm -f ${.TARGET}
+ cp ${.IMPSRC} ${.TARGET}
diff --git a/pkgtools/bootstrap-mk-files/files/mods/bsd.own.mk.in b/pkgtools/bootstrap-mk-files/files/mods/bsd.own.mk.in
new file mode 100644
index 00000000000..6efb36be106
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/mods/bsd.own.mk.in
@@ -0,0 +1,326 @@
+# $NetBSD: bsd.own.mk.in,v 1.1.1.1 2006/07/14 23:13:01 jlam Exp $
+
+.if !defined(_BSD_OWN_MK_)
+_BSD_OWN_MK_=1
+
+.if defined(MAKECONF) && exists(${MAKECONF})
+.include "${MAKECONF}"
+.elif exists(@SYSCONFDIR@/mk.conf)
+.include "@SYSCONFDIR@/mk.conf"
+.elif exists(/etc/mk.conf)
+.include "/etc/mk.conf"
+.endif
+
+# Defining `SKEY' causes support for S/key authentication to be compiled in.
+SKEY= yes
+
+# where the system object and source trees are kept; can be configurable
+# by the user in case they want them in ~/foosrc and ~/fooobj, for example
+BSDSRCDIR?= /usr/src
+BSDOBJDIR?= /usr/obj
+
+BINGRP?= @ROOT_GROUP@
+BINOWN?= @ROOT_USER@
+BINMODE?= 555
+NONBINMODE?= 444
+
+# Define MANZ to have the man pages compressed (gzip)
+#MANZ= 1
+
+MANDIR?= /usr/share/man
+MANGRP?= @ROOT_GROUP@
+MANOWN?= @ROOT_USER@
+MANMODE?= ${NONBINMODE}
+MANINSTALL?= maninstall catinstall
+
+INFODIR?= /usr/share/info
+INFOGRP?= @ROOT_GROUP@
+INFOOWN?= @ROOT_USER@
+INFOMODE?= ${NONBINMODE}
+
+LIBDIR?= /usr/lib
+LINTLIBDIR?= /usr/libdata/lint
+LIBGRP?= ${BINGRP}
+LIBOWN?= ${BINOWN}
+LIBMODE?= ${NONBINMODE}
+
+DOCDIR?= /usr/share/doc
+HTMLDOCDIR?= /usr/share/doc/html
+DOCGRP?= @ROOT_GROUP@
+DOCOWN?= @ROOT_USER@
+DOCMODE?= ${NONBINMODE}
+
+NLSDIR?= /usr/share/nls
+NLSGRP?= @ROOT_GROUP@
+NLSOWN?= @ROOT_USER@
+NLSMODE?= ${NONBINMODE}
+
+KMODDIR?= /usr/lkm
+KMODGRP?= @ROOT_GROUP@
+KMODOWN?= @ROOT_USER@
+KMODMODE?= ${NONBINMODE}
+
+LOCALEDIR?= /usr/share/locale
+LOCALEGRP?= @ROOT_GROUP@
+LOCALEOWN?= @ROOT_USER@
+LOCALEMODE?= ${NONBINMODE}
+
+COPY?= -c
+.if defined(UPDATE)
+PRESERVE?= -p
+.else
+PRESERVE?=
+.endif
+.if defined(UNPRIVILEGED)
+INSTPRIV?= -U
+.endif
+STRIPFLAG?= -s
+
+# Define SYS_INCLUDE to indicate whether you want symbolic links to the system
+# source (``symlinks''), or a separate copy (``copies''); (latter useful
+# in environments where it's not possible to keep /sys publicly readable)
+#SYS_INCLUDE= symlinks
+
+# The sh3 port is incomplete.
+.if ${MACHINE_ARCH} == "sh3eb" || ${MACHINE_ARCH} == "sh3el"
+NOLINT=1
+NOPROFILE=1
+OBJECT_FMT?=COFF
+NOPIC?=1
+.endif
+
+# The sparc64 port is incomplete.
+# Profiling and linting is also off on the x86_64 port at the moment.
+.if ${MACHINE_ARCH} == "sparc64" || ${MACHINE_ARCH} == "x86_64"
+NOPROFILE=1
+NOLINT=1
+.endif
+
+# The m68000 port is incomplete.
+.if ${MACHINE_ARCH} == "m68000"
+NOLINT=1
+NOPROFILE=1
+NOPIC?=1
+.endif
+
+# Data-driven table using make variables to control how
+# toolchain-dependent targets and shared libraries are built
+# for different platforms and object formats.
+# OBJECT_FMT: currently either "ELF" or "a.out".
+# SHLIB_TYPE: "ELF" or "a.out" or "" to force static libraries.
+#
+.if ${MACHINE_ARCH} == "alpha" || \
+ ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb" || \
+ ${MACHINE_ARCH} == "powerpc" || \
+ ${MACHINE_ARCH} == "sparc" || \
+ ${MACHINE_ARCH} == "sparc64" || \
+ ${MACHINE_ARCH} == "x86_64" || \
+ ${MACHINE_ARCH} == "i386" || \
+ ${MACHINE_ARCH} == "m68000" || \
+ ${MACHINE_ARCH} == "arm" || \
+ ${MACHINE} == "next68k" || \
+ ${MACHINE} == "sun3" || \
+ ${MACHINE} == "mvme68k" || \
+ ${MACHINE} == "hp300" || \
+ ${MACHINE} == "news68k" || \
+ ${MACHINE} == "arm26"
+OBJECT_FMT?=ELF
+.else
+OBJECT_FMT?=a.out
+.endif
+
+.if ${MACHINE_ARCH} == "x86_64"
+CFLAGS+=-Wno-format -fno-builtin
+.endif
+
+# Location of the file that contains the major and minor numbers of the
+# version of a shared library. If this file exists a shared library
+# will be built by <bsd.lib.mk>.
+SHLIB_VERSION_FILE?= ${.CURDIR}/shlib_version
+
+# GNU sources and packages sometimes see architecture names differently.
+# This table maps an architecture name to its GNU counterpart.
+# Use as so: ${GNU_ARCH.${TARGET_ARCH}} or ${MACHINE_GNU_ARCH}
+.ifndef MACHINE_GNU_ARCH
+GNU_ARCH.alpha=alpha
+GNU_ARCH.arm26=arm
+GNU_ARCH.arm32=arm
+GNU_ARCH.arm=arm
+GNU_ARCH.i386=i386
+GNU_ARCH.m68k=m68k
+GNU_ARCH.mipseb=mipseb
+GNU_ARCH.mipsel=mipsel
+GNU_ARCH.ns32k=ns32k
+GNU_ARCH.powerpc=powerpc
+GNU_ARCH.sh3eb=sh
+GNU_ARCH.sh3el=sh
+GNU_ARCH.sparc=sparc
+GNU_ARCH.sparc64=sparc64
+GNU_ARCH.vax=vax
+MACHINE_GNU_ARCH=${GNU_ARCH.${MACHINE_ARCH}}
+.endif
+
+# In order to identify NetBSD to GNU packages, we sometimes need
+# an "elf" tag for historically a.out platforms.
+.if ${OBJECT_FMT} == "ELF" && \
+ (${MACHINE_ARCH} == "arm" || \
+ ${MACHINE_ARCH} == "i386" || \
+ ${MACHINE_ARCH} == "m68k" || \
+ ${MACHINE_ARCH} == "sparc" || \
+ ${MACHINE_ARCH} == "vax")
+MACHINE_GNU_PLATFORM?= netbsdelf
+.else
+MACHINE_GNU_PLATFORM?= netbsd
+.endif
+
+# CPU model, derived from MACHINE_ARCH
+MACHINE_CPU= ${MACHINE_ARCH:C/mipse[bl]/mips/:S/arm26/arm/:S/arm32/arm/:C/sh3e[bl]/sh3/:S/m68000/m68k/}
+
+.if ${MACHINE_ARCH} == "mips"
+.BEGIN:
+ @echo Must set MACHINE_ARCH to one of mipseb or mipsel
+ @false
+.endif
+.if ${MACHINE_ARCH} == "sh3"
+.BEGIN:
+ @echo Must set MACHINE_ARCH to one of sh3eb or sh3el
+ @false
+.endif
+
+TARGETS+= all clean cleandir depend dependall includes \
+ install lint obj regress tags html installhtml cleanhtml
+.PHONY: all clean cleandir depend dependall distclean includes \
+ install lint obj regress tags beforedepend afterdepend \
+ beforeinstall afterinstall realinstall realdepend realall \
+ html installhtml cheanhtml
+
+# set NEED_OWN_INSTALL_TARGET, if it's not already set, to yes
+# this is used by bsd.pkg.mk to stop "install" being defined
+NEED_OWN_INSTALL_TARGET?= yes
+
+.if ${NEED_OWN_INSTALL_TARGET} == "yes"
+.if !target(install)
+install: .NOTMAIN beforeinstall subdir-install realinstall afterinstall
+beforeinstall: .NOTMAIN
+subdir-install: .NOTMAIN beforeinstall
+realinstall: .NOTMAIN beforeinstall
+afterinstall: .NOTMAIN subdir-install realinstall
+.endif
+all: .NOTMAIN realall subdir-all
+subdir-all: .NOTMAIN
+realall: .NOTMAIN
+depend: .NOTMAIN realdepend subdir-depend
+subdir-depend: .NOTMAIN
+realdepend: .NOTMAIN
+distclean: .NOTMAIN cleandir
+.endif
+
+PRINTOBJDIR= printf "xxx: .MAKE\n\t@echo \$${.OBJDIR}\n" | ${MAKE} -B -s -f-
+
+# Define MKxxx variables (which are either yes or no) for users
+# to set in /etc/mk.conf and override on the make commandline.
+# These should be tested with `== "no"' or `!= "no"'.
+# The NOxxx variables should only be used by Makefiles.
+#
+
+MKCATPAGES?=yes
+
+.if defined(NODOC)
+MKDOC=no
+#.elif !defined(MKDOC)
+#MKDOC=yes
+.else
+MKDOC?=yes
+.endif
+
+MKINFO?=yes
+
+.if defined(NOLINKLIB)
+MKLINKLIB=no
+.else
+MKLINKLIB?=yes
+.endif
+.if ${MKLINKLIB} == "no"
+MKPICINSTALL=no
+MKPROFILE=no
+.endif
+
+MKLINT?=no
+
+.if defined(NOMAN)
+MKMAN=no
+.else
+MKMAN?=yes
+.endif
+.if ${MKMAN} == "no"
+MKCATPAGES=no
+.endif
+
+.if defined(NONLS)
+MKNLS=no
+.else
+MKNLS?=yes
+.endif
+
+#
+# MKOBJDIRS controls whether object dirs are created during "make build".
+# MKOBJ controls whether the "make obj" rule does anything.
+#
+.if defined(NOOBJ)
+MKOBJ=no
+MKOBJDIRS=no
+.else
+MKOBJ?=yes
+MKOBJDIRS?=no
+.endif
+
+.if defined(NOPIC)
+MKPIC=no
+.else
+MKPIC?=yes
+.endif
+
+.if defined(NOPICINSTALL)
+MKPICINSTALL=no
+.else
+MKPICINSTALL?=yes
+.endif
+
+.if defined(NOPROFILE)
+MKPROFILE=no
+.else
+MKPROFILE?=yes
+.endif
+
+.if defined(NOSHARE)
+MKSHARE=no
+.else
+MKSHARE?=yes
+.endif
+.if ${MKSHARE} == "no"
+MKCATPAGES=no
+MKDOC=no
+MKINFO=no
+MKMAN=no
+MKNLS=no
+.endif
+
+.if defined(NOCRYPTO)
+MKCRYPTO=no
+.else
+MKCRYPTO?=yes
+.endif
+
+MKCRYPTO_IDEA?=no
+
+MKCRYPTO_RC5?=no
+
+.if defined(NOKERBEROS) || (${MKCRYPTO} == "no")
+MKKERBEROS=no
+.else
+MKKERBEROS?=yes
+.endif
+
+MKSOFTFLOAT?=no
+
+.endif # _BSD_OWN_MK_
diff --git a/pkgtools/bootstrap-mk-files/files/sys.mk b/pkgtools/bootstrap-mk-files/files/sys.mk
new file mode 100644
index 00000000000..db022616536
--- /dev/null
+++ b/pkgtools/bootstrap-mk-files/files/sys.mk
@@ -0,0 +1,208 @@
+# $NetBSD: sys.mk,v 1.1.1.1 2006/07/14 23:13:01 jlam Exp $
+# @(#)sys.mk 8.2 (Berkeley) 3/21/94
+
+unix?= We run Unix
+OS!= uname -s
+
+.SUFFIXES: .out .a .ln .o .s .S .c .cc .cpp .cxx .C .F .f .r .y .l .cl .p .h
+.SUFFIXES: .sh .m4
+
+.LIBS: .a
+
+AR?= ar
+ARFLAGS?= rl
+RANLIB?= ranlib
+
+AS?= as
+AFLAGS?=
+.if ${MACHINE_ARCH} == "sparc64"
+AFLAGS+= -Wa,-Av9a
+.endif
+COMPILE.s?= ${CC} ${AFLAGS} -c
+LINK.s?= ${CC} ${AFLAGS} ${LDFLAGS}
+COMPILE.S?= ${CC} ${AFLAGS} ${CPPFLAGS} -c -traditional-cpp
+LINK.S?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+CC?= cc
+.if ${MACHINE_ARCH} == "alpha" || \
+ ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "arm26" || \
+ ${MACHINE_ARCH} == "arm32" || \
+ ${MACHINE_ARCH} == "i386" || \
+ ${MACHINE_ARCH} == "m68k" || \
+ ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb" || \
+ ${MACHINE_ARCH} == "sparc" || \
+ ${MACHINE_ARCH} == "vax"
+DBG?= -O2
+.elif ${MACHINE_ARCH} == "x86_64"
+DBG?=
+.else
+DBG?= -O
+.endif
+CFLAGS?= ${DBG}
+COMPILE.c?= ${CC} ${CFLAGS} ${CPPFLAGS} -c
+LINK.c?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+CXX?= c++
+CXXFLAGS?= ${CFLAGS}
+COMPILE.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
+LINK.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+OBJC?= ${CC}
+OBJCFLAGS?= ${CFLAGS}
+COMPILE.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c
+LINK.m?= ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+CPP?= cpp
+CPPFLAGS?=
+
+FC?= f77
+FFLAGS?= -O
+RFLAGS?=
+COMPILE.f?= ${FC} ${FFLAGS} -c
+LINK.f?= ${FC} ${FFLAGS} ${LDFLAGS}
+COMPILE.F?= ${FC} ${FFLAGS} ${CPPFLAGS} -c
+LINK.F?= ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.r?= ${FC} ${FFLAGS} ${RFLAGS} -c
+LINK.r?= ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
+
+INSTALL?= install
+
+LEX?= lex
+LFLAGS?=
+LEX.l?= ${LEX} ${LFLAGS}
+
+LD?= ld
+LDFLAGS?=
+
+LINT?= lint
+LINTFLAGS?= -chapbxzF
+
+LORDER?= lorder
+
+MAKE?= make
+
+NM?= nm
+
+PC?= pc
+PFLAGS?=
+COMPILE.p?= ${PC} ${PFLAGS} ${CPPFLAGS} -c
+LINK.p?= ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+SHELL?= sh
+
+SIZE?= size
+
+TSORT?= tsort -q
+
+YACC?= yacc
+YFLAGS?=
+YACC.y?= ${YACC} ${YFLAGS}
+
+# C
+.c:
+ ${LINK.c} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.c.o:
+ ${COMPILE.c} ${.IMPSRC}
+.c.a:
+ ${COMPILE.c} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+.c.ln:
+ ${LINT} ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i ${.IMPSRC}
+
+# C++
+.cc .cpp .cxx .C:
+ ${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.cc.o .cpp.o .cxx.o .C.o:
+ ${COMPILE.cc} ${.IMPSRC}
+.cc.a .cpp.a .cxx.a .C.a:
+ ${COMPILE.cc} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Fortran/Ratfor
+.f:
+ ${LINK.f} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.f.o:
+ ${COMPILE.f} ${.IMPSRC}
+.f.a:
+ ${COMPILE.f} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+.F:
+ ${LINK.F} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.F.o:
+ ${COMPILE.F} ${.IMPSRC}
+.F.a:
+ ${COMPILE.F} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+.r:
+ ${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.r.o:
+ ${COMPILE.r} ${.IMPSRC}
+.r.a:
+ ${COMPILE.r} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Pascal
+.p:
+ ${LINK.p} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.p.o:
+ ${COMPILE.p} ${.IMPSRC}
+.p.a:
+ ${COMPILE.p} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Assembly
+.s:
+ ${LINK.s} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.s.o:
+ ${COMPILE.s} ${.IMPSRC}
+.s.a:
+ ${COMPILE.s} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+.S:
+ ${LINK.S} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.S.o:
+ ${COMPILE.S} ${.IMPSRC}
+.S.a:
+ ${COMPILE.S} ${.IMPSRC}
+ ${AR} ${ARFLAGS} $@ $*.o
+ rm -f $*.o
+
+# Lex
+.l:
+ ${LEX.l} ${.IMPSRC}
+ ${LINK.c} -o ${.TARGET} lex.yy.c ${LDLIBS} -ll
+ rm -f lex.yy.c
+.l.c:
+ ${LEX.l} ${.IMPSRC}
+ mv lex.yy.c ${.TARGET}
+.l.o:
+ ${LEX.l} ${.IMPSRC}
+ ${COMPILE.c} -o ${.TARGET} lex.yy.c
+ rm -f lex.yy.c
+
+# Yacc
+.y:
+ ${YACC.y} ${.IMPSRC}
+ ${LINK.c} -o ${.TARGET} y.tab.c ${LDLIBS}
+ rm -f y.tab.c
+.y.c:
+ ${YACC.y} ${.IMPSRC}
+ mv y.tab.c ${.TARGET}
+.y.o:
+ ${YACC.y} ${.IMPSRC}
+ ${COMPILE.c} -o ${.TARGET} y.tab.c
+ rm -f y.tab.c
+
+# Shell
+.sh:
+ rm -f ${.TARGET}
+ cp ${.IMPSRC} ${.TARGET}