summaryrefslogtreecommitdiff
path: root/mk/platform
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2004-10-06 20:51:47 +0000
committerjlam <jlam@pkgsrc.org>2004-10-06 20:51:47 +0000
commitdffc19378a3500a7dcfff207ba9dff3a66264901 (patch)
treeffe32abb58592bdfb0f01b3938e405c22c89890d /mk/platform
parentfe9f6ce2c3042d931f6a0bf44123788ecaa9f516 (diff)
downloadpkgsrc-dffc19378a3500a7dcfff207ba9dff3a66264901.tar.gz
Reorganize some of the files under pkgsrc/mk:
(1) defs.${OPSYS}.mk --> platform/${OPSYS}.mk. The "platform" subdirectory is where all of the ${OPSYS}-specific infrastructure logic should reside. (2) bsd.pkg.defaults.mk --> defaults/mk.conf bsd.pkg.obsolete.mk --> defaults/obsolete.mk Renaming bsd.pkg.defaults.mk to defaults/mk.conf is to mimic the way that NetBSD has /etc/rc.conf as well as /etc/defaults/rc.conf, where the latter is a full list of user-settable variables, and the two files share the same name to reinforce the fact /etc/defaults/rc.conf can be directly copied in place as /etc/rc.conf. This is the same relationship shared by defaults/mk.conf and /etc/mk.conf.
Diffstat (limited to 'mk/platform')
-rw-r--r--mk/platform/AIX.mk202
-rw-r--r--mk/platform/BSDOS.mk182
-rw-r--r--mk/platform/Darwin.mk172
-rw-r--r--mk/platform/FreeBSD.mk184
-rw-r--r--mk/platform/IRIX.mk184
-rw-r--r--mk/platform/Interix.mk187
-rw-r--r--mk/platform/Linux.mk212
-rw-r--r--mk/platform/NetBSD.mk218
-rw-r--r--mk/platform/OpenBSD.mk190
-rw-r--r--mk/platform/SunOS.mk208
-rw-r--r--mk/platform/UnixWare.mk177
11 files changed, 2116 insertions, 0 deletions
diff --git a/mk/platform/AIX.mk b/mk/platform/AIX.mk
new file mode 100644
index 00000000000..72370486f59
--- /dev/null
+++ b/mk/platform/AIX.mk
@@ -0,0 +1,202 @@
+# $NetBSD: AIX.mk,v 1.1 2004/10/06 20:51:47 jlam Exp $
+#
+# Variable definitions for the AIX operating system.
+
+AWK?= /usr/bin/awk
+BASENAME?= /usr/bin/basename
+CAT?= /bin/cat
+CHMOD?= /bin/chmod
+CHOWN?= /usr/sbin/chown
+CHGRP?= /usr/bin/chgrp
+CMP?= /usr/bin/cmp
+CP?= /bin/cp
+CPP?= ${LOCALBASE}/bin/cpp
+CUT?= /usr/bin/cut
+DATE?= /bin/date
+DC?= /usr/bin/dc
+DIRNAME?= /usr/bin/dirname
+ECHO?= echo # Shell builtin
+ECHO_N?= ${ECHO} -n
+.if exists(${LOCALBASE}/bin/egrep)
+EGREP?= ${LOCALBASE}/bin/egrep
+.else
+EGREP?= /usr/bin/grep -E
+.endif
+EXPR?= /bin/expr
+FALSE?= false # Shell builtin
+FETCH_CMD?= ${LOCALBASE}/bin/ftp
+.if exists(${LOCALBASE}/bin/fgrep)
+FGREP?= ${LOCALBASE}/bin/fgrep
+.else
+FGREP?= /usr/bin/grep -F
+.endif
+FILE_CMD?= /usr/bin/file
+FIND?= /usr/bin/find
+GMAKE?= ${LOCALBASE}/bin/gmake
+.if exists(${LOCALBASE}/bin/grep)
+GREP?= ${LOCALBASE}/bin/grep
+.else
+GREP?= /usr/bin/grep
+.endif
+.if exists(/bin/tar)
+GTAR?= /bin/tar
+.else
+GTAR?= /usr/bin/tar
+.endif
+GUNZIP_CMD?= ${LOCALBASE}/bin/gunzip -f
+GZCAT?= ${LOCALBASE}/bin/zcat
+GZIP?= -9
+GZIP_CMD?= ${LOCALBASE}/bin/gzip -nf ${GZIP}
+HEAD?= /usr/bin/head
+HOSTNAME_CMD?= /bin/hostname
+ID?= /usr/bin/id
+#.if ${INSTALL} == "install"
+INSTALL= ${LOCALBASE}/bin/install-sh
+#.endif
+LDCONFIG?= /sbin/ldconfig
+LN?= /bin/ln
+LS?= /bin/ls
+M4?= /usr/bin/m4
+MAIL_CMD?= /usr/bin/mailx
+MKDIR?= /bin/mkdir -p
+MTREE?= ${LOCALBASE}/sbin/mtree
+MV?= /bin/mv
+NICE?= /usr/bin/nice
+PATCH?= ${LOCALBASE}/bin/gpatch
+.if exists(${LOCALBASE}/bin/pax)
+PAX?= ${LOCALBASE}/bin/pax
+.else
+PAX?= /bin/pax
+.endif
+PERL5?= ${LOCALBASE}/bin/perl
+PKGLOCALEDIR?= share
+PS?= /bin/ps
+PWD_CMD?= /bin/pwd # needs to print physical path
+RM?= /bin/rm
+RMDIR?= /bin/rmdir
+# XXX: default from bsd.pkg.defaults.mk. Verify/corerct for this platform
+# and remove this comment.
+RSH?= /usr/bin/rsh
+.if exists(${LOCALBASE}/bin/nbsed)
+SED?= ${LOCALBASE}/bin/nbsed
+.else
+SED?= /usr/bin/sed
+.endif
+SETENV?= /usr/bin/env
+SH?= /bin/sh
+SHLOCK= /usr/bin/shlock
+SORT?= /usr/bin/sort
+# AIX strip fails too easily. Use a wrapper script instead
+.if exists(${LOCALBASE}/bin/strip)
+STRIP?= ${LOCALBASE}/bin/strip
+.endif
+SU?= /usr/bin/su
+TAIL?= /usr/bin/tail
+.if exists(${LOCALBASE}/bin/tar)
+TAR?= ${LOCALBASE}/bin/tar
+.else
+TAR?= /usr/bin/tar
+.endif
+TEE?= /usr/bin/tee
+TEST?= test # Shell builtin
+TOUCH?= /usr/bin/touch
+TR?= /usr/bin/tr
+TRUE?= true # Shell builtin
+TSORT?= /usr/bin/tsort
+TYPE?= type # Shell builtin
+WC?= /usr/bin/wc
+XARGS?= /usr/bin/xargs
+
+.if exists(/usr/sbin/user)
+USERADD?= /usr/sbin/useradd
+GROUPADD?= /usr/sbin/groupadd
+.else
+USERADD?= ${LOCALBASE}/sbin/useradd
+GROUPADD?= ${LOCALBASE}/sbin/groupadd
+_USER_DEPENDS= user>=20000313:../../sysutils/user
+DEPENDS+= ${USE_USERADD:D${_USER_DEPENDS}}
+DEPENDS+= ${USE_GROUPADD:D${_USER_DEPENDS}}
+.endif
+
+CPP_PRECOMP_FLAGS?= # unset
+DEF_UMASK?= 0022
+EXPORT_SYMBOLS_LDFLAGS?=-Wl,-E # add symbols to the dynamic symbol table
+MOTIF_TYPE_DEFAULT?= openmotif # default 2.0 compatible libs type
+NOLOGIN?= /sbin/nologin
+PKG_TOOLS_BIN?= ${LOCALBASE}/sbin
+ROOT_CMD?= ${SU} - root -c
+ROOT_USER?= root
+ROOT_GROUP?= system
+ULIMIT_CMD_datasize?= ulimit -d `ulimit -H -d`
+ULIMIT_CMD_stacksize?= ulimit -s `ulimit -H -s`
+ULIMIT_CMD_memorysize?= ulimit -m `ulimit -H -m`
+
+# imake installs manpages in weird places
+# these values from /usr/X11R6/lib/X11/config/NetBSD.cf
+IMAKE_MAN_SOURCE_PATH= man/cat
+IMAKE_MAN_SUFFIX= 1
+IMAKE_LIBMAN_SUFFIX= 3
+IMAKE_FILEMAN_SUFFIX= 5
+IMAKE_MAN_DIR= ${IMAKE_MAN_SOURCE_PATH}1
+IMAKE_LIBMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}3
+IMAKE_FILEMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}5
+IMAKE_MANNEWSUFFIX= 0
+
+_DO_SHLIB_CHECKS= no # fixup PLIST for shared libs/run ldconfig
+ # doesn't work on AIX b/c no ldd.
+_IMAKE_MAKE= ${MAKE} # program which gets invoked by imake
+.if exists(/usr/include/netinet6)
+_OPSYS_HAS_INET6= yes # IPv6 is standard
+.else
+_OPSYS_HAS_INET6= no # IPv6 is not standard
+.endif
+_OPSYS_HAS_JAVA= no # Java is not standard
+_OPSYS_HAS_MANZ= yes # MANZ controls gzipping of man pages
+_OPSYS_HAS_OSSAUDIO= no # libossaudio is available
+_OPSYS_PERL_REQD= # no base version of perl required
+_OPSYS_PTHREAD_AUTO= no # -lpthread needed for pthreads
+_OPSYS_SHLIB_TYPE= aixlib # type of shared lib
+_PATCH_CAN_BACKUP= yes # native patch(1) can make backups
+_PATCH_BACKUP_ARG?= -b -V simple -z # switch to patch(1) for backup suffix
+_PREFORMATTED_MAN_DIR= cat # directory where catman pages are
+_USE_GNU_GETTEXT= no # Don't use GNU gettext
+_USE_RPATH= yes # add rpath to LDFLAGS
+
+# flags passed to the linker to extract all symbols from static archives.
+# this is GNU ld.
+_OPSYS_WHOLE_ARCHIVE_FLAG= -Wl,--whole-archive
+_OPSYS_NO_WHOLE_ARCHIVE_FLAG= -Wl,--no-whole-archive
+
+# for programs which use dlopen()
+# not necessary since 1.6 (shared libs are linked against libgcc_pic)
+.if !empty(OS_VERSION:M1.5*)
+LINK_ALL_LIBGCC_HACK= -Wl,--whole-archive -lgcc -Wl,--no-whole-archive
+.endif
+
+.if !defined(DEBUG_FLAGS)
+_STRIPFLAG_CC?= -s # cc(1) option to strip
+_STRIPFLAG_INSTALL?= -s # install(1) option to strip
+.endif
+
+DEFAULT_SERIAL_DEVICE?= /dev/tty0
+SERIAL_DEVICES?= /dev/tty0 \
+ /dev/tty
+
+# check for maximum command line length and set it in configure's environment,
+# to avoid a test required by the libtool script that takes forever.
+# FIXME: Adjust to work on this system and enable the lines below.
+#.if defined(GNU_CONFIGURE) && defined(USE_LIBTOOL)
+#_OPSYS_MAX_CMDLEN!= /sbin/sysctl -n kern.argmax
+#CONFIGURE_ENV+= lt_cv_sys_max_cmd_len=${_OPSYS_MAX_CMDLEN}
+#.endif
+
+# If games are to be installed setgid, then SETGIDGAME is set to 'yes'
+# (it defaults to 'no' as per bsd.pkg.defaults.mk).
+# Set the group and mode to meaningful values in that case (defaults to
+# BINOWN, BINGRP and BINMODE as per bsd.pkg.defaults.mk).
+# FIXME: Adjust to work on this system and enable the lines below.
+#.if !(empty(SETGIDGAME:M[yY][eE][sS]))
+#GAMEOWN= games
+#GAMEGRP= games
+#GAMEMODE= 2555
+#.endif
diff --git a/mk/platform/BSDOS.mk b/mk/platform/BSDOS.mk
new file mode 100644
index 00000000000..00bd7356165
--- /dev/null
+++ b/mk/platform/BSDOS.mk
@@ -0,0 +1,182 @@
+# $NetBSD: BSDOS.mk,v 1.1 2004/10/06 20:51:47 jlam Exp $
+#
+# Variable definitions for the BSD/OS operating system.
+
+AWK?= /usr/bin/awk
+BASENAME?= /usr/bin/basename
+CAT?= /bin/cat
+CHMOD?= /bin/chmod
+CHOWN?= /usr/sbin/chown
+CHGRP?= /usr/bin/chgrp
+CMP?= /usr/bin/cmp
+CP?= /bin/cp
+#CPP= /usr/bin/cpp
+# BSD/OS doesn't have c++ command
+.if !exists(${CXX})
+CXX= /usr/bin/g++
+.endif
+CUT?= /usr/bin/cut
+DATE?= /bin/date
+DC?= /usr/bin/dc
+DIRNAME?= /usr/bin/dirname
+ECHO?= echo # Shell builtin
+ECHO_N?= ${ECHO} -n
+EGREP?= /bin/egrep
+EXPR?= /bin/expr
+FALSE?= false # Shell builtin
+FGREP?= /bin/fgrep
+FILE_CMD?= /usr/bin/file
+FIND?= /usr/bin/find
+.if exists(${LOCALBASE}/bin/gmake)
+GMAKE?= ${LOCALBASE}/bin/gmake
+.else
+GMAKE?= /usr/contrib/bin/gmake
+.endif
+GREP?= /bin/grep
+.if exists(${LOCALBASE}/bin/gtar)
+GTAR?= ${LOCALBASE}/bin/gtar
+.else
+GTAR?= /bin/tar
+.endif
+GUNZIP_CMD?= /usr/contrib/bin/gunzip -f
+GZCAT?= /usr/contrib/bin/gzcat
+GZIP?= -9
+GZIP_CMD?= /usr/contrib/bin/gzip -nf ${GZIP}
+HEAD?= /usr/bin/head
+HOSTNAME_CMD?= /bin/hostname
+ID?= /usr/bin/id
+LDCONFIG?= /sbin/ldconfig
+LN?= /bin/ln
+LS?= /bin/ls
+M4?= /usr/bin/m4
+MAIL_CMD?= /usr/bin/mail
+MKDIR?= /bin/mkdir -p
+.if exists(${LOCALBASE}/sbin/mtree)
+MTREE?= ${LOCALBASE}/sbin/mtree
+.else
+MTREE?= /usr/sbin/mtree
+.endif
+MV?= /bin/mv
+NICE?= /usr/bin/nice
+PATCH?= /usr/contrib/bin/patch
+# native /bin/pax doesn't support -O
+PAX?= ${LOCALBASE}/bin/pax
+PERL5?= ${LOCALBASE}/bin/perl
+PKGLOCALEDIR?= share
+PS?= /bin/ps
+PWD_CMD?= /bin/pwd # needs to print physical path
+RM?= /bin/rm
+RMDIR?= /bin/rmdir
+# XXX: default from bsd.pkg.defaults.mk. Verify/corerct for this platform
+# and remove this comment.
+RSH?= /usr/bin/rsh
+SED?= /usr/bin/sed
+SETENV?= /usr/bin/env
+# native sh and ksh both have problems under BSD/OS 4.3.1
+# /usr/contrib/bin/bash is a symlink to /bin/bash
+SH?= /bin/bash
+SHLOCK= ${LOCALBASE}/bin/shlock
+SORT?= /usr/bin/sort
+SU?= /usr/bin/su
+TAIL?= /usr/bin/tail
+.if exists(/bin/tar)
+TAR?= /bin/tar
+.else
+TAR?= /usr/bin/tar
+.endif
+TEE?= /usr/bin/tee
+TEST?= test # Shell builtin
+TOUCH?= /usr/bin/touch
+TR?= /usr/bin/tr
+TRUE?= true # Shell builtin
+TSORT?= /usr/bin/tsort
+# sh doesn't have built-in type
+TYPE?= which
+WC?= /usr/bin/wc
+XARGS?= /usr/bin/xargs
+
+USERADD?= /usr/sbin/adduser
+GROUPADD?= /usr/sbin/addgroup
+
+CPP_PRECOMP_FLAGS?= # unset
+DEF_UMASK?= 0022
+.if ${OBJECT_FMT} == "ELF"
+EXPORT_SYMBOLS_LDFLAGS?=-Wl,-E # add symbols to the dynamic symbol table
+.else
+EXPORT_SYMBOLS_LDFLAGS?=-Wl,--export-dynamic
+.endif
+MOTIF_TYPE_DEFAULT?= openmotif # default 2.0 compatible libs type
+NOLOGIN?= /sbin/nologin
+PKG_TOOLS_BIN?= ${LOCALBASE}/sbin
+ROOT_CMD?= ${SU} - root -c
+ROOT_USER?= root
+ROOT_GROUP?= wheel
+ULIMIT_CMD_datasize?= ulimit -d `ulimit -H -d`
+ULIMIT_CMD_stacksize?= ulimit -s `ulimit -H -s`
+ULIMIT_CMD_memorysize?= ulimit -m `ulimit -H -m`
+
+# imake installs manpages in weird places
+# XXX: assume NetBSD defaults until somebody determines correct values
+IMAKE_MAN_SOURCE_PATH= man/cat
+IMAKE_MAN_SUFFIX= 1
+IMAKE_LIBMAN_SUFFIX= 3
+IMAKE_FILEMAN_SUFFIX= 5
+IMAKE_MAN_DIR= ${IMAKE_MAN_SOURCE_PATH}1
+IMAKE_LIBMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}3
+IMAKE_FILEMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}5
+IMAKE_MANNEWSUFFIX= 0
+
+_DO_SHLIB_CHECKS= yes # fixup PLIST for shared libs/run ldconfig
+_IMAKE_MAKE= ${MAKE} # program which gets invoked by imake
+.if exists(/usr/include/netinet6)
+_OPSYS_HAS_INET6= yes # IPv6 is standard
+.else
+_OPSYS_HAS_INET6= no # IPv6 is not standard
+.endif
+# XXX need to check this for Java
+_OPSYS_HAS_JAVA= no # Java is not standard
+_OPSYS_HAS_MANZ= yes # MANZ controls gzipping of man pages
+# XXX need to check this for libossaudio
+_OPSYS_HAS_OSSAUDIO= yes # libossaudio is available
+_OPSYS_PERL_REQD= # no base version of perl required
+_OPSYS_PTHREAD_AUTO= no # -lpthread needed for pthreads
+_OPSYS_SHLIB_TYPE= ELF/a.out # shared lib type
+_PATCH_CAN_BACKUP= yes # native patch(1) can make backups
+_PATCH_BACKUP_ARG?= -V simple -b -z # switch to patch(1) for backup suffix
+_PREFORMATTED_MAN_DIR= cat # directory where catman pages are
+_USE_GNU_GETTEXT= no # Don't use GNU gettext
+_USE_RPATH= yes # add rpath to LDFLAGS
+
+# flags passed to the linker to extract all symbols from static archives.
+# this is GNU ld.
+_OPSYS_WHOLE_ARCHIVE_FLAG= -Wl,--whole-archive
+_OPSYS_NO_WHOLE_ARCHIVE_FLAG= -Wl,--no-whole-archive
+
+.if !defined(DEBUG_FLAGS)
+_STRIPFLAG_CC?= -s # cc(1) option to strip
+_STRIPFLAG_INSTALL?= -s # install(1) option to strip
+.endif
+
+DEFAULT_SERIAL_DEVICE?= /dev/null
+SERIAL_DEVICES?= /dev/null
+
+PKG_CREATE_USERGROUP= NO # until it works
+
+# check for maximum command line length and set it in configure's environment,
+# to avoid a test required by the libtool script that takes forever.
+# FIXME: Adjust to work on this system and enable the lines below.
+#.if defined(GNU_CONFIGURE) && defined(USE_LIBTOOL)
+#_OPSYS_MAX_CMDLEN!= /sbin/sysctl -n kern.argmax
+#CONFIGURE_ENV+= lt_cv_sys_max_cmd_len=${_OPSYS_MAX_CMDLEN}
+#.endif
+
+# If games are to be installed setgid, then SETGIDGAME is set to 'yes'
+# (it defaults to 'no' as per bsd.pkg.defaults.mk).
+# Set the group and mode to meaningful values in that case (defaults to
+# BINOWN, BINGRP and BINMODE as per bsd.pkg.defaults.mk).
+# FIXME: Adjust to work on this system and enable the lines below.
+#.if !(empty(SETGIDGAME:M[yY][eE][sS]))
+#GAMEOWN= games
+#GAMEGRP= games
+#GAMEMODE= 2555
+#.endif
diff --git a/mk/platform/Darwin.mk b/mk/platform/Darwin.mk
new file mode 100644
index 00000000000..74ef0223bed
--- /dev/null
+++ b/mk/platform/Darwin.mk
@@ -0,0 +1,172 @@
+# $NetBSD: Darwin.mk,v 1.1 2004/10/06 20:51:47 jlam Exp $
+#
+# Variable definitions for the Darwin operating system.
+
+AWK?= /usr/bin/awk
+BASENAME?= /usr/bin/basename
+CAT?= /bin/cat
+CHMOD?= /bin/chmod
+CHOWN?= /usr/sbin/chown
+CHGRP?= /usr/bin/chgrp
+CMP?= /usr/bin/cmp
+CP?= /bin/cp
+.if !defined(CPP) || ${CPP} == "cpp"
+CPP= ${CC} -E ${CPP_PRECOMP_FLAGS}
+.endif
+CUT?= /usr/bin/cut
+DATE?= /bin/date
+DC?= /usr/bin/dc
+DIRNAME?= /usr/bin/dirname
+ECHO?= echo # Shell builtin
+ECHO_N?= ${ECHO} -n
+EGREP?= /usr/bin/egrep
+EXPR?= /bin/expr
+FALSE?= false # Shell builtin
+FILE_CMD?= /usr/bin/file
+FIND?= /usr/bin/find
+FGREP?= /usr/bin/fgrep
+GMAKE?= /usr/bin/gnumake
+GREP?= /usr/bin/grep
+GTAR?= /usr/bin/gnutar
+GUNZIP_CMD?= /usr/bin/gunzip -f
+GZCAT?= /usr/bin/gzcat
+GZIP?= -9
+GZIP_CMD?= /usr/bin/gzip -nf ${GZIP}
+HEAD?= /usr/bin/head
+HOSTNAME_CMD?= /bin/hostname
+ID?= /usr/bin/id
+IMAKE?= ${X11BASE}/bin/imake ${IMAKEOPTS}
+IMAKEOPTS+= -DBuildHtmlManPages=NO
+LDCONFIG?= /sbin/ldconfig
+LDD?= /usr/bin/otool -L
+LN?= /bin/ln
+LS?= /bin/ls
+M4?= /usr/bin/m4
+MAIL_CMD?= /usr/bin/mail
+MKDIR?= /bin/mkdir -p
+MTREE?= /usr/sbin/mtree
+MV?= /bin/mv
+NICE?= /usr/bin/nice
+PATCH?= /usr/bin/patch
+.if exists(${LOCALBASE}/bin/pax)
+PAX?= ${LOCALBASE}/bin/pax
+.else
+PAX?= /bin/pax
+.endif
+PERL5?= ${LOCALBASE}/bin/perl
+PKGLOCALEDIR?= share
+PS?= /bin/ps
+PWD_CMD?= /bin/pwd # needs to print physical path
+RM?= /bin/rm
+RMDIR?= /bin/rmdir
+# XXX: default from bsd.pkg.defaults.mk. Verify/corerct for this platform
+# and remove this comment.
+RSH?= /usr/bin/rsh
+SED?= /usr/bin/sed
+SETENV?= /usr/bin/env
+SH?= /bin/sh
+SHLOCK= /usr/bin/shlock
+SORT?= /usr/bin/sort
+SU?= /usr/bin/su
+TAIL?= /usr/bin/tail
+.if exists(${LOCALBASE}/bin/tar)
+TAR?= ${LOCALBASE}/bin/tar
+.else
+TAR?= /usr/bin/tar
+.endif
+TEE?= /usr/bin/tee
+TEST?= test # Shell builtin
+TOUCH?= /usr/bin/touch
+TR?= /usr/bin/tr
+TRUE?= true # Shell builtin
+TSORT?= /usr/bin/tsort
+TYPE?= type # Shell builtin
+WC?= /usr/bin/wc
+XARGS?= /usr/bin/xargs
+
+.if !defined(PKGSRC_COMPILER) || !empty(PKGSRC_COMPILER:Mgcc)
+CPP_PRECOMP_FLAGS?= -no-cpp-precomp # use the GNU cpp, not the OS X cpp
+.endif
+DEF_UMASK?= 0022
+DEFAULT_SERIAL_DEVICE?= /dev/null
+EXPORT_SYMBOLS_LDFLAGS?= # Don't add symbols to the dynamic symbol table
+MOTIF_TYPE_DEFAULT?= openmotif # default 2.0 compatible libs type
+NOLOGIN?= ${FALSE}
+PKG_TOOLS_BIN?= ${LOCALBASE}/sbin
+ROOT_CMD?= /usr/bin/sudo ${SH} -c
+ROOT_GROUP?= wheel
+ROOT_USER?= root
+SERIAL_DEVICES?= /dev/null
+ULIMIT_CMD_datasize?= ulimit -d `ulimit -H -d`
+ULIMIT_CMD_stacksize?= ulimit -s `ulimit -H -s`
+ULIMIT_CMD_memorysize?= ulimit -m `ulimit -H -m`
+
+GROUPADD?= ${LOCALBASE}/sbin/groupadd
+USERADD?= ${LOCALBASE}/sbin/useradd
+_PKG_USER_HOME?= /var/empty # to match other system accounts
+_PKG_USER_SHELL?= /usr/bin/false # to match other system accounts
+_USER_DEPENDS= user>=20040801:../../sysutils/user_darwin
+DEPENDS+= ${USE_USERADD:D${_USER_DEPENDS}}
+DEPENDS+= ${USE_GROUPADD:D${_USER_DEPENDS}}
+
+# imake installs manpages in weird places
+# these values from /usr/X11R6/lib/X11/config/Imake.tmpl
+IMAKE_MAN_SOURCE_PATH= man/man
+IMAKE_MAN_SUFFIX= 1
+IMAKE_LIBMAN_SUFFIX= 3
+IMAKE_FILEMAN_SUFFIX= 5
+IMAKE_MAN_DIR= ${IMAKE_MAN_SOURCE_PATH}1
+IMAKE_LIBMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}3
+IMAKE_FILEMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}5
+IMAKE_MANNEWSUFFIX= ${IMAKE_MAN_SUFFIX}
+
+_DO_SHLIB_CHECKS= yes # on installation, fixup PLIST for shared libs
+_IMAKE_MAKE= ${MAKE} # program which gets invoked by imake
+.if ${OS_VERSION:R} >= 6
+_OPSYS_HAS_INET6= yes # IPv6 is standard
+.else
+_OPSYS_HAS_INET6= no # IPv6 is not standard
+.endif
+_OPSYS_HAS_JAVA= yes # Java is standard
+_OPSYS_HAS_MANZ= yes # MANZ controls gzipping of man pages
+_OPSYS_HAS_OSSAUDIO= no # libossaudio is available
+_OPSYS_PERL_REQD= 5.8.0 # base version of perl required
+_OPSYS_PTHREAD_AUTO= yes # -lpthread not needed for pthreads
+_OPSYS_LINKER_RPATH_FLAG= -L # darwin has no rpath, use -L instead
+_OPSYS_COMPILER_RPATH_FLAG= -L # compiler flag to pass rpaths to linker
+_OPSYS_SHLIB_TYPE= dylib # shared lib type
+_PATCH_CAN_BACKUP= yes # native patch(1) can make backups
+_PATCH_BACKUP_ARG?= -V simple -b -z # switch to patch(1) for backup suffix
+_PREFORMATTED_MAN_DIR= cat # directory where catman pages are
+_USE_GNU_GETTEXT= no # Don't use GNU gettext
+_USE_RPATH= no # don't add rpath to LDFLAGS
+
+# flags passed to the linker to extract all symbols from static archives.
+# this is GNU ld.
+_OPSYS_WHOLE_ARCHIVE_FLAG= -Wl,--whole-archive
+_OPSYS_NO_WHOLE_ARCHIVE_FLAG= -Wl,--no-whole-archive
+
+.if !defined(DEBUG_FLAGS)
+_STRIPFLAG_CC?= -Wl,-x # cc(1) option to strip
+_STRIPFLAG_INSTALL?= -s # install(1) option to strip
+.endif
+
+LOCALBASE?= ${DESTDIR}/usr/pkg
+
+# check for maximum command line length and set it in configure's environment,
+# to avoid a test required by the libtool script that takes forever.
+.if defined(GNU_CONFIGURE) && defined(USE_LIBTOOL)
+_OPSYS_MAX_CMDLEN!= /usr/sbin/sysctl -n kern.argmax
+CONFIGURE_ENV+= lt_cv_sys_max_cmd_len=${_OPSYS_MAX_CMDLEN}
+.endif
+
+# If games are to be installed setgid, then SETGIDGAME is set to 'yes'
+# (it defaults to 'no' as per bsd.pkg.defaults.mk).
+# Set the group and mode to meaningful values in that case (defaults to
+# BINOWN, BINGRP and BINMODE as per bsd.pkg.defaults.mk).
+# FIXME: Adjust to work on this system and enable the lines below.
+#.if !(empty(SETGIDGAME:M[yY][eE][sS]))
+#GAMEOWN= games
+#GAMEGRP= games
+#GAMEMODE= 2555
+#.endif
diff --git a/mk/platform/FreeBSD.mk b/mk/platform/FreeBSD.mk
new file mode 100644
index 00000000000..f529a3861a4
--- /dev/null
+++ b/mk/platform/FreeBSD.mk
@@ -0,0 +1,184 @@
+# $NetBSD: FreeBSD.mk,v 1.1 2004/10/06 20:51:47 jlam Exp $
+#
+# Variable definitions for the FreeBSD operating system.
+
+AWK?= /usr/bin/awk
+BASENAME?= /usr/bin/basename
+BRANDELF?= /usr/bin/brandelf # used by linux compat layer
+CAT?= /bin/cat
+CHMOD?= /bin/chmod
+CHOWN?= /usr/sbin/chown
+CHGRP?= /usr/bin/chgrp
+CMP?= /usr/bin/cmp
+CP?= /bin/cp
+CUT?= /usr/bin/cut
+DATE?= /bin/date
+DC?= /usr/bin/dc
+DIRNAME?= /usr/bin/dirname
+ECHO?= echo # Shell builtin
+ECHO_N?= ${ECHO} -n
+EGREP?= /usr/bin/egrep
+EXPR?= /bin/expr
+FALSE?= false # Shell builtin
+FGREP?= /usr/bin/fgrep
+FILE_CMD?= /usr/bin/file
+FIND?= /usr/bin/find
+GMAKE?= ${LOCALBASE}/bin/gmake
+GREP?= /usr/bin/grep
+.if exists(${LOCALBASE}/bin/tar)
+GTAR?= ${LOCALBASE}/bin/tar
+.else
+GTAR?= /usr/bin/tar
+.endif
+GUNZIP_CMD?= /usr/bin/gunzip -f
+GZCAT?= /usr/bin/gzcat
+GZIP?= -9
+GZIP_CMD?= /usr/bin/gzip -nf ${GZIP}
+HEAD?= /usr/bin/head
+HOSTNAME_CMD?= /bin/hostname
+ID?= /usr/bin/id
+IMAKE?= ${X11BASE}/bin/imake ${IMAKEOPTS}
+IMAKEOPTS+= -DBuildHtmlManPages=NO
+LDCONFIG?= /sbin/ldconfig
+LN?= /bin/ln
+LS?= /bin/ls
+M4?= /usr/bin/m4
+MAIL_CMD?= /usr/bin/mail
+MKDIR?= /bin/mkdir -p
+.if exists(${LOCALBASE}/sbin/mtree)
+MTREE?= ${LOCALBASE}/sbin/mtree
+.else
+MTREE?= /usr/sbin/mtree
+.endif
+MV?= /bin/mv
+NICE?= /usr/bin/nice
+PATCH?= /usr/bin/patch
+.if exists(${LOCALBASE}/bin/pax)
+PAX?= ${LOCALBASE}/bin/pax
+.else
+PAX?= /bin/pax
+.endif
+PERL5?= ${LOCALBASE}/bin/perl
+PKGLOCALEDIR?= share
+PS?= /bin/ps
+PWD_CMD?= /bin/pwd # needs to print physical path
+RM?= /bin/rm
+RMDIR?= /bin/rmdir
+RSH?= /usr/bin/rsh
+SED?= /usr/bin/sed
+SETENV?= /usr/bin/env
+SH?= /bin/sh
+SHLOCK= /usr/bin/shlock
+SORT?= /usr/bin/sort
+SU?= /usr/bin/su
+TAIL?= /usr/bin/tail
+.if exists(${LOCALBASE}/bin/tar)
+TAR?= ${LOCALBASE}/bin/tar
+.else
+TAR?= /usr/bin/tar
+.endif
+TEE?= /usr/bin/tee
+TEST?= test # Shell builtin
+TOUCH?= /usr/bin/touch
+TR?= /usr/bin/tr
+TRUE?= true # Shell builtin
+TSORT?= /usr/bin/tsort
+TYPE?= type # Shell builtin
+WC?= /usr/bin/wc
+XARGS?= /usr/bin/xargs
+
+.if exists(/usr/sbin/user)
+USERADD?= /usr/sbin/useradd
+GROUPADD?= /usr/sbin/groupadd
+.else
+USERADD?= ${LOCALBASE}/sbin/useradd
+GROUPADD?= ${LOCALBASE}/sbin/groupadd
+_USER_DEPENDS= user>=20000313:../../sysutils/user
+DEPENDS+= ${USE_USERADD:D${_USER_DEPENDS}}
+DEPENDS+= ${USE_GROUPADD:D${_USER_DEPENDS}}
+.endif
+
+CPP_PRECOMP_FLAGS?= # unset
+DEF_UMASK?= 0022
+.if ${OBJECT_FMT} == "ELF"
+EXPORT_SYMBOLS_LDFLAGS?=-Wl,-E # add symbols to the dynamic symbol table
+.else
+EXPORT_SYMBOLS_LDFLAGS?=-Wl,--export-dynamic
+.endif
+MOTIF_TYPE_DEFAULT?= openmotif # default 2.0 compatible libs type
+NOLOGIN?= /sbin/nologin
+PKG_TOOLS_BIN?= ${LOCALBASE}/sbin
+ROOT_CMD?= ${SU} - root -c
+ROOT_USER?= root
+ROOT_GROUP?= wheel
+ULIMIT_CMD_datasize?= ulimit -d `ulimit -H -d`
+ULIMIT_CMD_stacksize?= ulimit -s `ulimit -H -s`
+ULIMIT_CMD_memorysize?= ulimit -m `ulimit -H -m`
+
+# imake installs manpages in weird places
+IMAKE_MAN_SOURCE_PATH= man/man
+IMAKE_MAN_SUFFIX= 1
+IMAKE_LIBMAN_SUFFIX= 3
+IMAKE_KERNMAN_SUFFIX= 4
+IMAKE_FILEMAN_SUFFIX= 5
+IMAKE_MISCMAN_SUFFIX= 7
+IMAKE_MAN_DIR= ${IMAKE_MAN_SOURCE_PATH}1
+IMAKE_LIBMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}3
+IMAKE_KERNMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}4
+IMAKE_FILEMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}5
+IMAKE_MISCMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}7
+IMAKE_MANNEWSUFFIX= ${IMAKE_MAN_SUFFIX}
+
+_DO_SHLIB_CHECKS= yes # fixup PLIST for shared libs/run ldconfig
+_IMAKE_MAKE= ${MAKE} # program which gets invoked by imake
+.if exists(/usr/include/netinet6)
+_OPSYS_HAS_INET6= yes # IPv6 is standard
+.else
+_OPSYS_HAS_INET6= no # IPv6 is not standard
+.endif
+_OPSYS_HAS_JAVA= no # Java is not standard
+_OPSYS_HAS_MANZ= yes # MANZ controls gzipping of man pages
+_OPSYS_HAS_OSSAUDIO= yes # libossaudio is available
+_OPSYS_PERL_REQD= # no base version of perl required
+_OPSYS_PTHREAD_AUTO= no # -lpthread needed for pthreads
+_OPSYS_SHLIB_TYPE= ELF/a.out # shared lib type
+_PATCH_CAN_BACKUP= yes # native patch(1) can make backups
+_PATCH_BACKUP_ARG?= -V simple -b # switch to patch(1) for backup suffix
+_PREFORMATTED_MAN_DIR= cat # directory where catman pages are
+_USE_GNU_GETTEXT= no # Don't use GNU gettext
+_USE_RPATH= yes # add rpath to LDFLAGS
+
+# flags passed to the linker to extract all symbols from static archives.
+# this is GNU ld.
+_OPSYS_WHOLE_ARCHIVE_FLAG= -Wl,--whole-archive
+_OPSYS_NO_WHOLE_ARCHIVE_FLAG= -Wl,--no-whole-archive
+
+.if !defined(DEBUG_FLAGS)
+_STRIPFLAG_CC?= -s # cc(1) option to strip
+_STRIPFLAG_INSTALL?= -s # install(1) option to strip
+.endif
+
+DEFAULT_SERIAL_DEVICE?= /dev/cuaa0
+SERIAL_DEVICES?= /dev/cuaa0
+
+# check for kqueue(2) support
+.if exists(/usr/include/sys/event.h)
+PKG_HAVE_KQUEUE= # defined
+.endif
+
+# check for maximum command line length and set it in configure's environment,
+# to avoid a test required by the libtool script that takes forever.
+.if defined(GNU_CONFIGURE) && defined(USE_LIBTOOL)
+_OPSYS_MAX_CMDLEN!= /sbin/sysctl -n kern.argmax
+CONFIGURE_ENV+= lt_cv_sys_max_cmd_len=${_OPSYS_MAX_CMDLEN}
+.endif
+
+# If games are to be installed setgid, then SETGIDGAME is set to 'yes'
+# (it defaults to 'no' as per bsd.pkg.defaults.mk).
+# Set the group and mode to meaningful values in that case (defaults to
+# BINOWN, BINGRP and BINMODE as per bsd.pkg.defaults.mk).
+.if !(empty(SETGIDGAME:M[yY][eE][sS]))
+GAMEOWN= games
+GAMEGRP= games
+GAMEMODE= 2555
+.endif
diff --git a/mk/platform/IRIX.mk b/mk/platform/IRIX.mk
new file mode 100644
index 00000000000..f6a446b3b57
--- /dev/null
+++ b/mk/platform/IRIX.mk
@@ -0,0 +1,184 @@
+# $NetBSD: IRIX.mk,v 1.1 2004/10/06 20:51:47 jlam Exp $
+#
+# Variable definitions for the IRIX operating system.
+
+AWK?= /usr/bin/nawk
+BASENAME?= /sbin/basename
+CAT?= /sbin/cat
+CHMOD?= /sbin/chmod
+CHOWN?= /sbin/chown
+CHGRP?= /sbin/chgrp
+CMP?= /usr/bin/cmp
+CP?= /sbin/cp
+CUT?= /usr/bin/cut
+DATE?= /sbin/date
+DC?= /usr/bin/dc
+DIRNAME?= /usr/bin/dirname
+ECHO?= echo # Shell builtin
+ECHO_N?= ${ECHO} -n
+EGREP?= /usr/bin/egrep
+EXPR?= /bin/expr
+FALSE?= false # Shell builtin
+FGREP?= /usr/bin/fgrep
+FILE_CMD?= /usr/bin/file
+FIND?= /sbin/find
+.if exists(${LOCALBASE}/bin/gmake)
+GMAKE?= ${LOCALBASE}/bin/gmake
+.endif
+GREP?= /sbin/grep
+.if exists(${LOCALBASE}/bin/tar)
+GTAR?= ${LOCALBASE}/bin/tar
+.else
+GTAR?= /sbin/tar
+.endif
+GUNZIP_CMD?= /usr/sbin/gunzip -f
+.if exists(/usr/sbin/gzcat)
+GZCAT?= /usr/sbin/gzcat
+.else
+GZCAT?= /usr/bsd/zcat
+.endif
+GZIP?= -9
+GZIP_CMD?= /usr/sbin/gzip -nf ${GZIP}
+HEAD?= /usr/bsd/head
+HOSTNAME_CMD?= /usr/bsd/hostname
+ID?= /usr/bin/id
+IMAKE?= /usr/bin/X11/imake ${IMAKEOPTS}
+IMAKEOPTS+= -DMakeCmd=${PREFIX}/bin/bmake -DProjectRoot=${X11BASE}
+IMAKEOPTS+= -DManUsr=${PREFIX}
+LDCONFIG?= /usr/bin/true
+LN?= /sbin/ln
+LS?= /sbin/ls
+M4?= /sbin/m4
+MAIL_CMD?= /usr/sbin/mailx
+MKDIR?= /sbin/mkdir -p
+MTREE?= ${LOCALBASE}/sbin/mtree
+MV?= /sbin/mv
+NICE?= /sbin/nice
+.if exists(${LOCALBASE}/bin/${GNU_PROGRAM_PREFIX}patch)
+PATCH?= ${LOCALBASE}/bin/${GNU_PROGRAM_PREFIX}patch
+_OPSYS_GPATCH_REQD= YES
+.else
+PATCHV!= /usr/sbin/patch -v 2>&1 | ${CUT} -d" " -f3
+. if ${PATCHV} == "2.1"
+_OPSYS_GPATCH_REQD= YES
+PATCH= ${LOCALBASE}/bin/${GNU_PROGRAM_PREFIX}patch
+. else
+PATCH?= /usr/sbin/patch -b
+. endif # PATCHV
+.endif
+PAX?= ${LOCALBASE}/bin/pax
+PERL5?= ${LOCALBASE}/bin/perl
+PKGLOCALEDIR?= share
+PS?= /sbin/ps
+PWD_CMD?= /sbin/pwd # needs to print physical path
+RM?= /sbin/rm
+RMDIR?= /usr/bin/rmdir
+RSH?= /usr/bsd/rsh
+SED?= /sbin/sed
+SETENV?= /sbin/env
+SH?= /bin/ksh
+SHLOCK= ${LOCALBASE}/bin/shlock
+SORT?= /usr/bin/sort
+SU?= /sbin/su
+TAIL?= /usr/bin/tail
+TAR?= ${LOCALBASE}/bin/tar
+TEE?= /usr/bin/tee
+TEST?= test # Shell builtin
+TOUCH?= /usr/bin/touch
+TR?= /usr/bin/tr
+TRUE?= true # Shell builtin
+TSORT?= /usr/bin/tsort
+TYPE?= /sbin/type
+WC?= /sbin/wc
+XARGS?= /sbin/xargs
+
+CPP_PRECOMP_FLAGS?= # unset
+DEF_UMASK?= 022
+DEFAULT_SERIAL_DEVICE?= /dev/null
+EXPORT_SYMBOLS_LDFLAGS?= # Don't add symbols to the dynamic symbol table
+GROUPADD?= ${FALSE}
+MOTIF_TYPE_DEFAULT?= dt # default 2.0 compatible libs type
+NOLOGIN?= ${FALSE}
+ROOT_CMD?= ${SU} - root -c
+ROOT_GROUP?= sys
+ROOT_USER?= root
+SERIAL_DEVICES?= /dev/null
+ULIMIT_CMD_datasize?= ulimit -d `ulimit -H -d`
+ULIMIT_CMD_stacksize?= ulimit -s `ulimit -H -s`
+ULIMIT_CMD_memorysize?= ulimit -v `ulimit -H -v`
+USERADD?= ${FALSE}
+
+# imake installs manpages in weird places
+IMAKE_MAN_SOURCE_PATH= catman/u_man/cat
+IMAKE_MAN_SUFFIX= 1
+IMAKE_LIBMAN_SUFFIX= 3
+IMAKE_FILEMAN_SUFFIX= 5
+IMAKE_MAN_DIR= ${IMAKE_MAN_SOURCE_PATH}1/X11
+IMAKE_LIBMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}3/X11
+IMAKE_FILEMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}5/X11
+IMAKE_MANNEWSUFFIX= z
+
+_DO_SHLIB_CHECKS= yes # fixup PLIST for shared libs
+_IMAKE_MAKE= ${MAKE} # program which gets invoked by imake
+.if exists(/usr/include/netinet6)
+_OPSYS_HAS_INET6= yes # IPv6 is standard
+.else
+_OPSYS_HAS_INET6= no # IPv6 is not standard
+.endif
+_OPSYS_HAS_JAVA= no # Java is not standard
+_OPSYS_HAS_MANZ= no # no MANZ for gzipping of man pages
+_OPSYS_HAS_OSSAUDIO= no # libossaudio is available
+_OPSYS_NEEDS_XPKGWEDGE= yes # xpkgwedge is required for X11
+_OPSYS_PERL_REQD= # no base version of perl required
+_OPSYS_PTHREAD_AUTO= no # -lpthread needed for pthreads
+_OPSYS_SHLIB_TYPE= ELF/a.out # shared lib type
+.if defined(_OPSYS_GPATCH_REQD) && ${_OPSYS_GPATCH_REQD} == "YES"
+_PATCH_CAN_BACKUP= yes # patch(1) can make backups
+_PATCH_BACKUP_ARG?= -b -V simple -z # switch to patch(1) for backup suffix
+.else
+_PATCH_CAN_BACKUP= no # native patch(1) can make backups
+.endif
+_PREFORMATTED_MAN_DIR= man # directory where catman pages are
+_USE_GNU_GETTEXT= no # Don't use GNU gettext
+_USE_RPATH= yes # add rpath to LDFLAGS
+
+# flags passed to the linker to extract all symbols from static archives.
+# XXX:
+# These flags are for the IRIX linker. If GNU ld is used, these would need
+# to be set to --{no-}whole-archive. So, ugh, let's say we only do
+# IRIX tools for the time being.
+_OPSYS_WHOLE_ARCHIVE_FLAG= -Wl,-all
+_OPSYS_NO_WHOLE_ARCHIVE_FLAG= -Wl,-none
+
+# IRIX has /usr/include/iconv.h, but it's not GNU iconv, so mark it
+# incompatible.
+_INCOMPAT_ICONV= IRIX-*-*
+
+.if !defined(DEBUG_FLAGS)
+_STRIPFLAG_CC?= -s # cc(1) option to strip
+_STRIPFLAG_INSTALL?= -s # install(1) option to strip
+.endif
+
+LOCALBASE?= ${DESTDIR}/usr/pkg
+PKG_TOOLS_BIN?= ${LOCALBASE}/sbin
+
+CONFIGURE_ENV+= ABI=${ABI}
+MAKE_ENV+= ABI=${ABI}
+
+# check for maximum command line length and set it in configure's environment,
+# to avoid a test required by the libtool script that takes forever.
+.if defined(GNU_CONFIGURE) && defined(USE_LIBTOOL)
+_OPSYS_MAX_CMDLEN!= /usr/sbin/sysconf ARG_MAX
+CONFIGURE_ENV+= lt_cv_sys_max_cmd_len=${_OPSYS_MAX_CMDLEN}
+.endif
+
+# If games are to be installed setgid, then SETGIDGAME is set to 'yes'
+# (it defaults to 'no' as per bsd.pkg.defaults.mk).
+# Set the group and mode to meaningful values in that case (defaults to
+# BINOWN, BINGRP and BINMODE as per bsd.pkg.defaults.mk).
+# FIXME: Adjust to work on this system and enable the lines below.
+#.if !(empty(SETGIDGAME:M[yY][eE][sS]))
+#GAMEOWN= games
+#GAMEGRP= games
+#GAMEMODE= 2555
+#.endif
diff --git a/mk/platform/Interix.mk b/mk/platform/Interix.mk
new file mode 100644
index 00000000000..587ac960a6b
--- /dev/null
+++ b/mk/platform/Interix.mk
@@ -0,0 +1,187 @@
+# $NetBSD: Interix.mk,v 1.1 2004/10/06 20:51:47 jlam Exp $
+#
+# Variable definitions for the Interix operating system.
+
+AWK?= /usr/contrib/bin/gawk
+BASENAME?= /bin/basename
+CAT?= /bin/cat
+CHMOD?= /bin/chmod
+CHOWN?= /bin/chown
+CHGRP?= /bin/chgrp
+CMP?= /bin/cmp
+CP?= /bin/cp
+CUT?= /bin/cut
+DATE?= /bin/date
+DC?= /bin/dc
+DIRNAME?= /bin/dirname
+ECHO?= echo # Shell builtin
+ECHO_N?= /bin/printf %s # does not support "echo -n"
+EGREP?= /bin/egrep
+EXPR?= /bin/expr
+FALSE?= false # Shell builtin
+FGREP?= /bin/fgrep
+FILE_CMD?= /bin/file
+FIND?= /bin/find
+GMAKE?= ${LOCALBASE}/bin/gmake
+GREP?= /bin/grep
+.if exists(${LOCALBASE}/bin/gtar)
+GTAR?= ${LOCALBASE}/bin/gtar
+.else
+GTAR?= ${LOCALBASE}/bin/tar
+.endif
+GUNZIP_CMD?= /usr/contrib/bin/gunzip -f
+GZCAT?= /usr/contrib/bin/gunzip -c
+GZIP?= -9
+GZIP_CMD?= /usr/contrib/bin/gzip -nf ${GZIP}
+HEAD?= /bin/head
+HOSTNAME_CMD?= /bin/hostname
+ID?= /bin/id
+IMAKE?= ${X11BASE}/bin/imake ${IMAKEOPTS}
+IMAKEOPTS+= -DBuildHtmlManPages=NO
+LDCONFIG?= /bin/true
+LN?= /bin/ln
+LS?= /bin/ls
+M4?= /bin/m4
+MAIL_CMD?= /bin/mail
+MKDIR?= /bin/mkdir -p
+MTREE?= ${LOCALBASE}/sbin/mtree
+MV?= /bin/mv
+NICE?= /bin/nice
+PATCH?= ${LOCALBASE}/bin/gpatch
+.if exists(${LOCALBASE}/bin/pax)
+PAX?= ${LOCALBASE}/bin/pax
+.else
+PAX?= /bin/pax
+.endif
+PERL5?= ${LOCALBASE}/bin/perl
+PKGLOCALEDIR?= share
+PS?= /bin/ps
+PWD_CMD?= /bin/pwd # needs to print physical path
+RM?= /bin/rm
+RMDIR?= /bin/rmdir
+# XXX: default from bsd.pkg.defaults.mk. Verify/corerct for this platform
+# and remove this comment.
+RSH?= /usr/bin/rsh
+SED?= ${LOCALBASE}/bin/nbsed
+SETENV?= /bin/env
+SH?= /bin/sh
+SHLOCK= ${LOCALBASE}/bin/shlock
+SORT?= /bin/sort
+SU?= /bin/su
+TAIL?= /bin/tail
+TAR?= ${LOCALBASE}/bin/tar
+TEE?= /bin/tee
+TEST?= test # Shell builtin
+TOUCH?= /bin/touch
+TR?= /bin/tr
+TRUE?= true # Shell builtin
+TSORT?= /bin/tsort
+TYPE?= type # Shell builtin
+WC?= /bin/wc
+XARGS?= /bin/xargs
+
+# Default to threaded Perl, the same as is shipped with Interix itself.
+PERL5_USE_THREADS?= yes
+
+USERADD?= ${LOCALBASE}/sbin/useradd
+GROUPADD?= ${LOCALBASE}/sbin/groupadd
+_PKG_USER_HOME?= # empty by default
+_USER_DEPENDS= user>=20040426:../../sysutils/user_interix
+DEPENDS+= ${USE_USERADD:D${_USER_DEPENDS}}
+DEPENDS+= ${USE_GROUPADD:D${_USER_DEPENDS}}
+
+CPP_PRECOMP_FLAGS?= # unset
+DEF_UMASK?= 002
+EXPORT_SYMBOLS_LDFLAGS?=-Wl,-E # add symbols to the dynamic symbol table
+
+MOTIF_TYPE_DEFAULT?= openmotif # default 2.0 compatible libs type
+NOLOGIN?= /bin/false
+PKG_TOOLS_BIN?= ${LOCALBASE}/sbin
+PKGDIRMODE?= 775
+ROOT_CMD?= ${SU} - ${ROOT_USER} -c
+ROOT_USER?= ${BINOWN}
+ROOT_GROUP?= 131616 # +Administrators or native language equivalent
+TOUCH_FLAGS?=
+ULIMIT_CMD_datasize?= ulimit -d `ulimit -H -d`
+ULIMIT_CMD_stacksize?= ulimit -s `ulimit -H -s`
+ULIMIT_CMD_memorysize?= ulimit -m `ulimit -H -m`
+
+# imake installs manpages in weird places
+IMAKE_MAN_SOURCE_PATH= man/man
+IMAKE_MAN_SUFFIX= n
+IMAKE_LIBMAN_SUFFIX= 3
+IMAKE_KERNMAN_SUFFIX= 4
+IMAKE_FILEMAN_SUFFIX= 5
+IMAKE_MISCMAN_SUFFIX= 7
+IMAKE_MAN_DIR= ${IMAKE_MAN_SOURCE_PATH}n
+IMAKE_LIBMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}3
+IMAKE_KERNMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}4
+IMAKE_FILEMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}5
+IMAKE_MISCMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}7
+IMAKE_MANNEWSUFFIX= ${IMAKE_MAN_SUFFIX}
+
+_DO_SHLIB_CHECKS= yes # fixup PLIST for shared libs/run ldconfig
+_IMAKE_MAKE= ${MAKE} # program which gets invoked by imake
+.if exists(/usr/include/netinet6)
+_OPSYS_HAS_INET6= yes # IPv6 is standard
+.else
+_OPSYS_HAS_INET6= no # IPv6 is not standard
+.endif
+_OPSYS_HAS_JAVA= no # Java is not standard
+_OPSYS_HAS_MANZ= yes # MANZ controls gzipping of man pages
+_OPSYS_HAS_OSSAUDIO= no # libossaudio is available
+_OPSYS_PERL_REQD= 5.8.3nb1 # base version of perl required
+_OPSYS_PKGTOOLS_REQD= 20040330
+_OPSYS_PTHREAD_AUTO= no # -lpthread needed for pthreads
+_OPSYS_SHLIB_TYPE= ELF # shared lib type - not exactly true, but near enough
+_PATCH_CAN_BACKUP= yes # native patch(1) can make backups
+_PATCH_BACKUP_ARG?= -b -V simple -z # switch to patch(1) for backup suffix
+_PREFORMATTED_MAN_DIR= cat # directory where catman pages are
+_USE_GNU_GETTEXT= yes # gettext not in base system
+_USE_RPATH= yes # add rpath to LDFLAGS
+
+# Ensure that USE_X11BASE programs get an xpkgwedge new enough to work.
+_OPSYS_NEEDS_XPKGWEDGE= yes # xpkgwedge is required for X11
+_XPKGWEDGE_DEPENDS= xpkgwedge>=1.10:../../pkgtools/xpkgwedge
+BUILD_DEPENDS+= ${USE_X11BASE:D${_XPKGWEDGE_DEPENDS}}
+
+# flags passed to the linker to extract all symbols from static archives.
+# this is GNU ld.
+_OPSYS_WHOLE_ARCHIVE_FLAG= -Wl,--whole-archive
+_OPSYS_NO_WHOLE_ARCHIVE_FLAG= -Wl,--no-whole-archive
+
+.if !defined(DEBUG_FLAGS)
+_STRIPFLAG_CC?= -s # cc(1) option to strip
+_STRIPFLAG_INSTALL?= -s # install(1) option to strip
+.endif
+
+DEFAULT_SERIAL_DEVICE?= /dev/tty00
+SERIAL_DEVICES?= /dev/tty00 /dev/tty01 /dev/tty02 /dev/tty03
+
+# Interix needs -D_ALL_SOURCE everywhere; little compiles without it.
+.if ${CPPFLAGS:M-D_ALL_SOURCE} == ""
+CPPFLAGS+= -D_ALL_SOURCE
+.endif
+
+# poll(2) is broken; try to work around it by making autoconf believe
+# it's missing. (Packages without autoconf will need explicit fixing.)
+.ifdef GNU_CONFIGURE
+CONFIGURE_ENV+= ac_cv_header_poll_h=no ac_cv_func_poll=no
+.endif
+
+# check for maximum command line length and set it in configure's environment,
+# to avoid a test required by the libtool script that takes forever.
+.if defined(GNU_CONFIGURE) && defined(USE_LIBTOOL)
+CONFIGURE_ENV+= lt_cv_sys_max_cmd_len=262144
+.endif
+
+# If games are to be installed setgid, then SETGIDGAME is set to 'yes'
+# (it defaults to 'no' as per bsd.pkg.defaults.mk).
+# Set the group and mode to meaningful values in that case (defaults to
+# BINOWN, BINGRP and BINMODE as per bsd.pkg.defaults.mk).
+# FIXME: Adjust to work on this system and enable the lines below.
+#.if !(empty(SETGIDGAME:M[yY][eE][sS]))
+#GAMEOWN= games
+#GAMEGRP= games
+#GAMEMODE= 2555
+#.endif
diff --git a/mk/platform/Linux.mk b/mk/platform/Linux.mk
new file mode 100644
index 00000000000..390ecb6349a
--- /dev/null
+++ b/mk/platform/Linux.mk
@@ -0,0 +1,212 @@
+# $NetBSD: Linux.mk,v 1.1 2004/10/06 20:51:47 jlam Exp $
+#
+# Variable definitions for the Linux operating system.
+
+AWK?= /usr/bin/awk
+.if exists(/bin/basename)
+BASENAME?= /bin/basename
+.elif exists(/usr/bin/basename)
+BASENAME?= /usr/bin/basename
+.endif
+CAT?= /bin/cat
+CHMOD?= /bin/chmod
+CHOWN?= /bin/chown
+CHGRP?= /bin/chgrp
+CMP?= cmp
+CP?= /bin/cp
+.if exists(/bin/cut)
+CUT?= /bin/cut
+.else
+CUT?= /usr/bin/cut
+.endif
+DATE?= /bin/date
+DC?= /usr/bin/dc
+DIRNAME?= /usr/bin/dirname
+ECHO?= echo # Shell builtin
+ECHO_N?= ${ECHO} -n
+.if exists(/bin/egrep)
+EGREP?= /bin/egrep
+.elif exists(/usr/bin/egrep)
+EGREP?= /usr/bin/egrep
+.endif
+EXPR?= /usr/bin/expr
+FALSE?= false # Shell builtin
+.if exists(/bin/fgrep)
+FGREP?= /bin/fgrep
+.elif exists(/usr/bin/fgrep)
+FGREP?= /usr/bin/fgrep
+.endif
+FILE_CMD?= /usr/bin/file
+FIND?= /usr/bin/find
+.if exists(/usr/bin/make)
+GMAKE?= /usr/bin/make
+_TOOLS_OPSYS_HAS_GNU.make+= ${MACHINE_PLATFORM}
+.else
+GMAKE?= ${LOCALBASE}/bin/gmake
+.endif
+.if exists(/bin/grep)
+GREP?= /bin/grep
+.elif exists(/usr/bin/grep)
+GREP?= /usr/bin/grep
+.endif
+GTAR?= /bin/tar
+.if exists(/usr/bin/gunzip)
+GUNZIP_CMD?= /usr/bin/gunzip -f
+.else
+GUNZIP_CMD?= /bin/gunzip -f
+.endif
+.if exists(/usr/bin/gzip)
+GZIP_CMD?= /usr/bin/gzip -nf ${GZIP}
+.else
+GZIP_CMD?= /bin/gzip -nf ${GZIP}
+.endif
+GZCAT?= /bin/zcat
+GZIP?= -9
+.if exists(/bin/head)
+HEAD?= /bin/head
+.else
+HEAD?= /usr/bin/head
+.endif
+HOSTNAME_CMD?= /bin/hostname
+ID?= /usr/bin/id
+IMAKE?= ${X11BASE}/bin/imake ${IMAKEOPTS}
+IMAKEOPTS+= -DBuildHtmlManPages=NO
+LDCONFIG?= /sbin/ldconfig
+LN?= /bin/ln
+LS?= /bin/ls
+M4?= /usr/bin/m4
+.if exists(/bin/mail)
+MAIL_CMD?= /bin/mail # RH, Mandrake
+.else
+MAIL_CMD?= /usr/bin/mail # Debian, Slackware, SuSE
+.endif
+MKDIR?= /bin/mkdir -p
+MTREE?= ${LOCALBASE}/sbin/mtree
+MV?= /bin/mv
+.if exists(/bin/nice)
+NICE?= /bin/nice
+.else
+NICE?= /usr/bin/nice
+.endif
+PATCH?= /usr/bin/patch
+PAX?= ${LOCALBASE}/bin/pax
+PERL5?= ${LOCALBASE}/bin/perl
+PKGLOCALEDIR?= share
+PS?= /bin/ps
+PWD_CMD?= /bin/pwd # needs to print physical path
+RM?= /bin/rm
+RMDIR?= /bin/rmdir
+# XXX: default from bsd.pkg.defaults.mk. Verify/corerct for this platform
+# and remove this comment.
+RSH?= /usr/bin/rsh
+.if exists(/bin/sed)
+SED?= /bin/sed
+.elif exists(/usr/bin/sed)
+SED?= /usr/bin/sed
+.endif
+SETENV?= /usr/bin/env
+SH?= /bin/sh
+SHLOCK= ${LOCALBASE}/bin/shlock
+.if exists(/bin/sort)
+SORT?= /bin/sort
+.else
+SORT?= /usr/bin/sort
+.endif
+SU?= /bin/su
+TAIL?= /usr/bin/tail
+TAR?= ${LOCALBASE}/bin/tar
+TEE?= /usr/bin/tee
+TEST?= test # Shell builtin
+.if exists(/bin/touch)
+TOUCH?= /bin/touch
+.else
+TOUCH?= /usr/bin/touch
+.endif
+TR?= /usr/bin/tr
+TRUE?= true # Shell builtin
+TSORT?= /usr/bin/tsort
+TYPE?= type # Shell builtin
+WC?= /usr/bin/wc
+XARGS?= /usr/bin/xargs -r
+
+CPP_PRECOMP_FLAGS?= # unset
+DEF_UMASK?= 022
+DEFAULT_SERIAL_DEVICE?= /dev/null
+EXPORT_SYMBOLS_LDFLAGS?= # Don't add symbols to the dynamic symbol table
+GROUPADD?= /usr/sbin/groupadd
+MOTIF_TYPE_DEFAULT?= openmotif # default 2.0 compatible libs type
+NOLOGIN?= /bin/false
+PKG_TOOLS_BIN?= ${LOCALBASE}/sbin
+ROOT_CMD?= ${SU} - root -c
+ROOT_GROUP?= root
+ROOT_USER?= root
+SERIAL_DEVICES?= /dev/null
+ULIMIT_CMD_datasize?= ulimit -d `ulimit -H -d`
+ULIMIT_CMD_stacksize?= ulimit -s `ulimit -H -s`
+ULIMIT_CMD_memorysize?= ulimit -m `ulimit -H -m`
+USERADD?= /usr/sbin/useradd
+
+# imake installs manpages in weird places
+# these values from /usr/X11R6/lib/X11/config/linux.cf
+IMAKE_MAN_SOURCE_PATH= man/man
+IMAKE_MAN_SUFFIX= 1x
+IMAKE_LIBMAN_SUFFIX= 3x
+IMAKE_KERNMAN_SUFFIX= 4
+IMAKE_FILEMAN_SUFFIX= 5x
+IMAKE_MISCMAN_SUFFIX= 7
+IMAKE_MAN_DIR= ${IMAKE_MAN_SOURCE_PATH}1
+IMAKE_LIBMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}3
+IMAKE_KERNMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}4
+IMAKE_FILEMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}5
+IMAKE_MISCMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}7
+IMAKE_MANNEWSUFFIX= ${IMAKE_MAN_SUFFIX}
+
+_DO_SHLIB_CHECKS= no # on installation, fixup PLIST for shared libs
+_IMAKE_MAKE= ${MAKE} # program which gets invoked by imake
+.if exists(/usr/include/netinet6) || exists(/usr/include/linux/in6.h)
+_OPSYS_HAS_INET6= yes # IPv6 is standard
+.else
+_OPSYS_HAS_INET6= no # IPv6 is not standard
+.endif
+_OPSYS_HAS_JAVA= no # Java is not standard
+_OPSYS_HAS_MANZ= no # no MANZ for gzipping of man pages
+_OPSYS_HAS_OSSAUDIO= no # libossaudio is available
+_OPSYS_PERL_REQD= # no base version of perl required
+_OPSYS_PTHREAD_AUTO= no # -lpthread needed for pthreads
+_OPSYS_SHLIB_TYPE= ELF/a.out # shared lib type
+_PATCH_CAN_BACKUP= yes # native patch(1) can make backups
+_PATCH_BACKUP_ARG?= -b -V simple -z # switch to patch(1) for backup suffix
+_PREFORMATTED_MAN_DIR= cat # directory where catman pages are
+_USE_GNU_GETTEXT= no # Don't use GNU gettext
+_USE_RPATH= yes # add rpath to LDFLAGS
+
+# flags passed to the linker to extract all symbols from static archives.
+# this is GNU ld.
+_OPSYS_WHOLE_ARCHIVE_FLAG= -Wl,--whole-archive
+_OPSYS_NO_WHOLE_ARCHIVE_FLAG= -Wl,--no-whole-archive
+
+.if !defined(DEBUG_FLAGS)
+_STRIPFLAG_CC?= -s # cc(1) option to strip
+_STRIPFLAG_INSTALL?= -s # install(1) option to strip
+.endif
+
+LOCALBASE?= ${DESTDIR}/usr/pkg
+
+# check for maximum command line length and set it in configure's environment,
+# to avoid a test required by the libtool script that takes forever.
+# FIXME: Adjust to work on this system and enable the lines below.
+#.if defined(GNU_CONFIGURE) && defined(USE_LIBTOOL)
+#_OPSYS_MAX_CMDLEN!= /sbin/sysctl -n kern.argmax
+#CONFIGURE_ENV+= lt_cv_sys_max_cmd_len=${_OPSYS_MAX_CMDLEN}
+#.endif
+
+# If games are to be installed setgid, then SETGIDGAME is set to 'yes'
+# (it defaults to 'no' as per bsd.pkg.defaults.mk).
+# Set the group and mode to meaningful values in that case (defaults to
+# BINOWN, BINGRP and BINMODE as per bsd.pkg.defaults.mk).
+# FIXME: Adjust to work on this system and enable the lines below.
+#.if !(empty(SETGIDGAME:M[yY][eE][sS]))
+#GAMEOWN= games
+#GAMEGRP= games
+#GAMEMODE= 2555
+#.endif
diff --git a/mk/platform/NetBSD.mk b/mk/platform/NetBSD.mk
new file mode 100644
index 00000000000..041d197816b
--- /dev/null
+++ b/mk/platform/NetBSD.mk
@@ -0,0 +1,218 @@
+# $NetBSD: NetBSD.mk,v 1.1 2004/10/06 20:51:47 jlam Exp $
+#
+# Variable definitions for the NetBSD operating system.
+
+AWK?= /usr/bin/awk
+BASENAME?= /usr/bin/basename
+CAT?= /bin/cat
+CHMOD?= /bin/chmod
+CHOWN?= /usr/sbin/chown
+CHGRP?= /usr/bin/chgrp
+CMP?= /usr/bin/cmp
+CP?= /bin/cp
+# Needed for 1.6.1 and earlier due to rpcgen bugs and paths
+.if defined(CPP) && ${CPP} == "cpp"
+CPP= /usr/bin/cpp
+.endif
+CUT?= /usr/bin/cut
+DATE?= /bin/date
+DC?= /usr/bin/dc
+DIRNAME?= /usr/bin/dirname
+ECHO?= echo # Shell builtin
+ECHO_N?= ${ECHO} -n
+EGREP?= /usr/bin/egrep
+EXPR?= /bin/expr
+FALSE?= false # Shell builtin
+FGREP?= /usr/bin/fgrep
+FILE_CMD?= /usr/bin/file
+FIND?= /usr/bin/find
+GMAKE?= ${LOCALBASE}/bin/gmake
+GREP?= /usr/bin/grep
+.if exists(/bin/tar)
+GTAR?= /bin/tar
+.else
+GTAR?= /usr/bin/tar
+.endif
+GUNZIP_CMD?= /usr/bin/gunzip -f
+GZCAT?= /usr/bin/gzcat
+GZIP?= -9
+GZIP_CMD?= /usr/bin/gzip -nf ${GZIP}
+HEAD?= /usr/bin/head
+HOSTNAME_CMD?= /bin/hostname
+ID?= /usr/bin/id
+LDCONFIG?= /sbin/ldconfig
+LN?= /bin/ln
+LS?= /bin/ls
+M4?= /usr/bin/m4
+MAIL_CMD?= /usr/bin/mail
+MKDIR?= /bin/mkdir -p
+MTREE?= /usr/sbin/mtree
+MV?= /bin/mv
+NICE?= /usr/bin/nice
+PATCH?= /usr/bin/patch
+PAX?= /bin/pax
+PERL5?= ${LOCALBASE}/bin/perl
+PKGLOCALEDIR?= share
+PS?= /bin/ps
+PWD_CMD?= /bin/pwd # needs to print physical path
+RM?= /bin/rm
+RMDIR?= /bin/rmdir
+RSH?= /usr/bin/rsh
+SED?= /usr/bin/sed
+SETENV?= /usr/bin/env
+SH?= /bin/sh
+SHLOCK= /usr/bin/shlock
+SORT?= /usr/bin/sort
+SU?= /usr/bin/su
+TAIL?= /usr/bin/tail
+.if exists(/bin/tar)
+TAR?= /bin/tar
+.else
+TAR?= /usr/bin/tar
+.endif
+TEE?= /usr/bin/tee
+TEST?= test # Shell builtin
+TOUCH?= /usr/bin/touch
+TR?= /usr/bin/tr
+TRUE?= true # Shell builtin
+TSORT?= /usr/bin/tsort
+TYPE?= type # Shell builtin
+WC?= /usr/bin/wc
+XARGS?= /usr/bin/xargs
+
+.if exists(/usr/sbin/user)
+USERADD?= /usr/sbin/useradd
+GROUPADD?= /usr/sbin/groupadd
+.else
+USERADD?= ${LOCALBASE}/sbin/useradd
+GROUPADD?= ${LOCALBASE}/sbin/groupadd
+_USER_DEPENDS= user>=20000313:../../sysutils/user
+DEPENDS+= ${USE_USERADD:D${_USER_DEPENDS}}
+DEPENDS+= ${USE_GROUPADD:D${_USER_DEPENDS}}
+.endif
+
+CPP_PRECOMP_FLAGS?= # unset
+DEF_UMASK?= 0022
+.if ${OBJECT_FMT} == "ELF"
+EXPORT_SYMBOLS_LDFLAGS?=-Wl,-E # add symbols to the dynamic symbol table
+.else
+EXPORT_SYMBOLS_LDFLAGS?=-Wl,--export-dynamic
+.endif
+MOTIF_TYPE_DEFAULT?= openmotif # default 2.0 compatible libs type
+NOLOGIN?= /sbin/nologin
+.if exists(${LOCALBASE}/sbin/pkg_info)
+PKG_TOOLS_BIN?= ${LOCALBASE}/sbin
+.else
+PKG_TOOLS_BIN?= /usr/sbin
+.endif
+ROOT_CMD?= ${SU} - root -c
+ROOT_USER?= root
+ROOT_GROUP?= wheel
+ULIMIT_CMD_datasize?= ulimit -d `ulimit -H -d`
+ULIMIT_CMD_stacksize?= ulimit -s `ulimit -H -s`
+ULIMIT_CMD_memorysize?= ulimit -m `ulimit -H -m`
+
+# imake installs manpages in weird places
+# these values from /usr/X11R6/lib/X11/config/NetBSD.cf
+IMAKE_MAN_SOURCE_PATH= man/cat
+IMAKE_MANNEWSUFFIX= 0
+IMAKE_MAN_SUFFIX= 1
+IMAKE_LIBMAN_SUFFIX= 3
+IMAKE_KERNMAN_SUFFIX= ${IMAKE_MANNEWSUFFIX}
+IMAKE_FILEMAN_SUFFIX= 5
+IMAKE_MISCMAN_SUFFIX= ${IMAKE_MANNEWSUFFIX}
+IMAKE_MAN_DIR= ${IMAKE_MAN_SOURCE_PATH}1
+IMAKE_LIBMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}3
+IMAKE_KERNMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}4
+IMAKE_FILEMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}5
+IMAKE_MISCMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}7
+
+_DO_SHLIB_CHECKS= yes # fixup PLIST for shared libs/run ldconfig
+_IMAKE_MAKE= ${MAKE} # program which gets invoked by imake
+.if exists(/usr/include/netinet6)
+_OPSYS_HAS_INET6= yes # IPv6 is standard
+.else
+_OPSYS_HAS_INET6= no # IPv6 is not standard
+.endif
+_OPSYS_HAS_JAVA= no # Java is not standard
+_OPSYS_HAS_MANZ= yes # MANZ controls gzipping of man pages
+_OPSYS_HAS_OSSAUDIO= yes # libossaudio is available
+_OPSYS_PERL_REQD= # no base version of perl required
+_OPSYS_PTHREAD_AUTO= no # -lpthread needed for pthreads
+_OPSYS_SHLIB_TYPE= ELF/a.out # shared lib type
+_PATCH_CAN_BACKUP= yes # native patch(1) can make backups
+_PATCH_BACKUP_ARG?= -V simple -b # switch to patch(1) for backup suffix
+_PREFORMATTED_MAN_DIR= cat # directory where catman pages are
+_USE_GNU_GETTEXT= no # Don't use GNU gettext
+_USE_RPATH= yes # add rpath to LDFLAGS
+
+# flags passed to the linker to extract all symbols from static archives.
+# this is GNU ld.
+_OPSYS_WHOLE_ARCHIVE_FLAG= -Wl,--whole-archive
+_OPSYS_NO_WHOLE_ARCHIVE_FLAG= -Wl,--no-whole-archive
+
+# for programs which use dlopen()
+# not necessary since 1.6 (shared libs are linked against libgcc_pic)
+.if !empty(OS_VERSION:M1.5*)
+LINK_ALL_LIBGCC_HACK= -Wl,--whole-archive -lgcc -Wl,--no-whole-archive
+.endif
+
+.if !defined(DEBUG_FLAGS)
+_STRIPFLAG_CC?= -s # cc(1) option to strip
+_STRIPFLAG_INSTALL?= -s # install(1) option to strip
+.endif
+
+.if (${MACHINE_ARCH} == alpha)
+DEFAULT_SERIAL_DEVICE?= /dev/ttyC0
+SERIAL_DEVICES?= /dev/ttyC0 \
+ /dev/ttyC1
+.elif (${MACHINE_ARCH} == "i386")
+DEFAULT_SERIAL_DEVICE?= /dev/tty00
+SERIAL_DEVICES?= /dev/tty00 \
+ /dev/tty01
+.elif (${MACHINE_ARCH} == m68k)
+DEFAULT_SERIAL_DEVICE?= /dev/tty00
+SERIAL_DEVICES?= /dev/tty00 \
+ /dev/tty01
+.elif (${MACHINE_ARCH} == mipsel)
+DEFAULT_SERIAL_DEVICE?= /dev/ttyC0
+SERIAL_DEVICES?= /dev/ttyC0 \
+ /dev/ttyC1
+.elif (${MACHINE_ARCH} == "sparc")
+DEFAULT_SERIAL_DEVICE?= /dev/ttya
+SERIAL_DEVICES?= /dev/ttya \
+ /dev/ttyb
+.else
+DEFAULT_SERIAL_DEVICE?= /dev/null
+SERIAL_DEVICES?= /dev/null
+.endif
+
+# Add -mieee to CFLAGS and FFLAGS for NetBSD->=1.5V-alpha
+.for __tmp__ in 1.5[V-Z] 1.5[A-Z][A-Z]* 1.[6-9]* [2-9].*
+. if ${MACHINE_PLATFORM:MNetBSD-${__tmp__}-alpha} != ""
+CFLAGS+= -mieee
+FFLAGS+= -mieee
+. endif # MACHINE_PLATFORM
+.endfor # __tmp__
+
+# check for kqueue(2) support, added in NetBSD-1.6J
+.if exists(/usr/include/sys/event.h)
+PKG_HAVE_KQUEUE= # defined
+.endif
+
+# check for maximum command line length and set it in configure's environment,
+# to avoid a test required by the libtool script that takes forever.
+.if defined(GNU_CONFIGURE) && defined(USE_LIBTOOL)
+_OPSYS_MAX_CMDLEN!= /sbin/sysctl -n kern.argmax
+CONFIGURE_ENV+= lt_cv_sys_max_cmd_len=${_OPSYS_MAX_CMDLEN}
+.endif
+
+# If games are to be installed setgid, then SETGIDGAME is set to 'yes'
+# (it defaults to 'no' as per bsd.pkg.defaults.mk).
+# Set the group and mode to meaningful values in that case (defaults to
+# BINOWN, BINGRP and BINMODE as per bsd.pkg.defaults.mk).
+.if !(empty(SETGIDGAME:M[yY][eE][sS]))
+GAMEOWN= games
+GAMEGRP= games
+GAMEMODE= 2555
+.endif
diff --git a/mk/platform/OpenBSD.mk b/mk/platform/OpenBSD.mk
new file mode 100644
index 00000000000..fd8b1915055
--- /dev/null
+++ b/mk/platform/OpenBSD.mk
@@ -0,0 +1,190 @@
+# $NetBSD: OpenBSD.mk,v 1.1 2004/10/06 20:51:47 jlam Exp $
+#
+# Variable definitions for the OpenBSD operating system.
+
+AWK?= /usr/bin/awk
+BASENAME?= /usr/bin/basename
+CAT?= /bin/cat
+CHMOD?= /bin/chmod
+CHOWN?= /usr/sbin/chown
+CHGRP?= /bin/chgrp
+CMP?= /usr/bin/cmp
+CP?= /bin/cp
+CUT?= /usr/bin/cut
+DATE?= /bin/date
+DC?= /usr/bin/dc
+DIRNAME?= /usr/bin/dirname
+ECHO?= echo # Shell builtin
+ECHO_N?= ${ECHO} -n
+EGREP?= /usr/bin/egrep
+EXPR?= /bin/expr
+FGREP?= /usr/bin/fgrep
+FALSE?= false # Shell builtin
+FILE_CMD?= /usr/bin/file
+FIND?= /usr/bin/find
+GMAKE?= ${LOCALBASE}/bin/gmake
+GREP?= /usr/bin/grep
+.if exists(/bin/tar)
+GTAR?= /bin/tar
+.else
+GTAR?= /usr/bin/tar
+.endif
+GUNZIP_CMD?= /usr/bin/gunzip -f
+GZCAT?= /usr/bin/gzcat
+GZIP?= -9
+GZIP_CMD?= /usr/bin/gzip -nf ${GZIP}
+HEAD?= /usr/bin/head
+HOSTNAME_CMD?= /bin/hostname
+ID?= /usr/bin/id
+LDCONFIG?= /sbin/ldconfig
+LN?= /bin/ln
+LS?= /bin/ls
+M4?= /usr/bin/m4
+MAIL_CMD?= /usr/bin/mail
+MKDIR?= /bin/mkdir -p
+MTREE?= /usr/sbin/mtree
+MV?= /bin/mv
+NICE?= /usr/bin/nice
+PATCH?= /usr/bin/patch
+PAX?= /bin/pax
+PERL5?= ${LOCALBASE}/bin/perl
+PKGLOCALEDIR?= share
+PS?= /bin/ps
+PWD_CMD?= /bin/pwd # needs to print physical path
+RM?= /bin/rm
+RMDIR?= /bin/rmdir
+# XXX: default from bsd.pkg.defaults.mk. Verify/corerct for this platform
+# and remove this comment.
+RSH?= /usr/bin/rsh
+SED?= /usr/bin/sed
+SETENV?= /usr/bin/env
+SH?= /bin/sh
+SHLOCK= ${LOCALBASE}/bin/shlock
+SORT?= /usr/bin/sort
+SU?= /usr/bin/su
+TAIL?= /usr/bin/tail
+.if exists(/bin/tar)
+TAR?= /bin/tar
+.else
+TAR?= /usr/bin/tar
+.endif
+TEE?= /usr/bin/tee
+TEST?= test # Shell builtin
+TOUCH?= /usr/bin/touch
+TR?= /usr/bin/tr
+TRUE?= true # Shell builtin
+TSORT?= /usr/bin/tsort
+TYPE?= type # Shell builtin
+WC?= /usr/bin/wc
+XARGS?= /usr/bin/xargs
+
+.if exists(/usr/sbin/user)
+USERADD?= /usr/sbin/useradd
+GROUPADD?= /usr/sbin/groupadd
+.else
+USERADD?= ${LOCALBASE}/sbin/useradd
+GROUPADD?= ${LOCALBASE}/sbin/groupadd
+_USER_DEPENDS= user>=20000313:../../sysutils/user
+DEPENDS+= ${USE_USERADD:D${_USER_DEPENDS}}
+DEPENDS+= ${USE_GROUPADD:D${_USER_DEPENDS}}
+.endif
+
+CPP_PRECOMP_FLAGS?= # unset
+DEF_UMASK?= 0022
+.if ${OBJECT_FMT} == "ELF"
+EXPORT_SYMBOLS_LDFLAGS?=-Wl,-E # add symbols to the dynamic symbol table
+.else
+EXPORT_SYMBOLS_LDFLAGS?=-Wl,--export-dynamic
+.endif
+MOTIF_TYPE_DEFAULT?= openmotif # default 2.0 compatible libs type
+NOLOGIN?= /sbin/nologin
+PKG_TOOLS_BIN?= ${LOCALBASE}/sbin
+ROOT_CMD?= ${SU} - root -c
+ROOT_USER?= root
+ROOT_GROUP?= wheel
+ULIMIT_CMD_datasize?= ulimit -d `ulimit -H -d`
+ULIMIT_CMD_stacksize?= ulimit -s `ulimit -H -s`
+ULIMIT_CMD_memorysize?= ulimit -m `ulimit -H -m`
+
+# imake installs manpages in weird places
+# these values from /usr/X11R6/lib/X11/config/OpenBSD.cf
+IMAKE_MAN_SOURCE_PATH= man/cat
+IMAKE_MAN_SUFFIX= 1
+IMAKE_LIBMAN_SUFFIX= 3
+IMAKE_FILEMAN_SUFFIX= 5
+IMAKE_MAN_DIR= ${IMAKE_MAN_SOURCE_PATH}1
+IMAKE_LIBMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}3
+IMAKE_FILEMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}5
+IMAKE_MANNEWSUFFIX= 0
+
+_DO_SHLIB_CHECKS= yes # fixup PLIST for shared libs/run ldconfig
+_IMAKE_MAKE= ${MAKE} # program which gets invoked by imake
+.if exists(/usr/include/netinet6)
+_OPSYS_HAS_INET6= yes # IPv6 is standard
+.else
+_OPSYS_HAS_INET6= no # IPv6 is not standard
+.endif
+_OPSYS_HAS_JAVA= no # Java is not standard
+_OPSYS_HAS_MANZ= yes # MANZ controls gzipping of man pages
+_OPSYS_HAS_OSSAUDIO= yes # libossaudio is available
+_OPSYS_PERL_REQD= # no base version of perl required
+_OPSYS_PTHREAD_AUTO= no # -lpthread needed for pthreads
+_OPSYS_SHLIB_TYPE= ELF/a.out # shared lib type
+_PATCH_CAN_BACKUP= yes # native patch(1) can make backups
+.if ${OS_VERSION} >= 3.4
+_PATCH_BACKUP_ARG?= -V simple -z # switch to patch(1) for backup suffix
+.else
+_PATCH_BACKUP_ARG?= -V simple -b # switch to patch(1) for backup suffix
+.endif
+_PREFORMATTED_MAN_DIR= cat # directory where catman pages are
+_USE_GNU_GETTEXT= no # Don't use GNU gettext
+_USE_RPATH= yes # add rpath to LDFLAGS
+
+# flags passed to the linker to extract all symbols from static archives.
+# this is GNU ld.
+_OPSYS_WHOLE_ARCHIVE_FLAG= -Wl,--whole-archive
+_OPSYS_NO_WHOLE_ARCHIVE_FLAG= -Wl,--no-whole-archive
+
+.if !defined(DEBUG_FLAGS)
+_STRIPFLAG_CC?= -s # cc(1) option to strip
+_STRIPFLAG_INSTALL?= -s # install(1) option to strip
+.endif
+
+.if (${MACHINE_ARCH} == alpha)
+DEFAULT_SERIAL_DEVICE?= /dev/ttyC0
+SERIAL_DEVICES?= /dev/ttyC0 \
+ /dev/ttyC1
+.elif (${MACHINE_ARCH} == "i386")
+DEFAULT_SERIAL_DEVICE?= /dev/tty00
+SERIAL_DEVICES?= /dev/tty00 \
+ /dev/tty01
+.elif (${MACHINE_ARCH} == m68k)
+DEFAULT_SERIAL_DEVICE?= /dev/tty00
+SERIAL_DEVICES?= /dev/tty00 \
+ /dev/tty01
+.elif (${MACHINE_ARCH} == "sparc")
+DEFAULT_SERIAL_DEVICE?= /dev/ttya
+SERIAL_DEVICES?= /dev/ttya \
+ /dev/ttyb
+.else
+DEFAULT_SERIAL_DEVICE?= /dev/null
+SERIAL_DEVICES?= /dev/null
+.endif
+
+# check for maximum command line length and set it in configure's environment,
+# to avoid a test required by the libtool script that takes forever.
+.if defined(GNU_CONFIGURE) && defined(USE_LIBTOOL)
+_OPSYS_MAX_CMDLEN!= /sbin/sysctl -n kern.argmax
+CONFIGURE_ENV+= lt_cv_sys_max_cmd_len=${_OPSYS_MAX_CMDLEN}
+.endif
+
+# If games are to be installed setgid, then SETGIDGAME is set to 'yes'
+# (it defaults to 'no' as per bsd.pkg.defaults.mk).
+# Set the group and mode to meaningful values in that case (defaults to
+# BINOWN, BINGRP and BINMODE as per bsd.pkg.defaults.mk).
+# FIXME: Adjust to work on this system and enable the lines below.
+#.if !(empty(SETGIDGAME:M[yY][eE][sS]))
+#GAMEOWN= games
+#GAMEGRP= games
+#GAMEMODE= 2555
+#.endif
diff --git a/mk/platform/SunOS.mk b/mk/platform/SunOS.mk
new file mode 100644
index 00000000000..7ec8b9b22cb
--- /dev/null
+++ b/mk/platform/SunOS.mk
@@ -0,0 +1,208 @@
+# $NetBSD: SunOS.mk,v 1.1 2004/10/06 20:51:47 jlam Exp $
+#
+# Variable definitions for the SunOS/Solaris operating system.
+
+AWK?= /usr/bin/nawk
+BASENAME?= /usr/bin/basename
+CAT?= /usr/bin/cat
+CHMOD?= /usr/bin/chmod
+CHOWN?= /usr/bin/chown
+CHGRP?= /usr/bin/chgrp
+CMP?= cmp
+CP?= /usr/bin/cp
+CUT?= /usr/bin/cut
+DATE?= /usr/xpg4/bin/date
+DC?= /usr/bin/dc
+DIRNAME?= /usr/bin/dirname
+ECHO?= /usr/ucb/echo
+ECHO_N?= ${ECHO} -n
+EGREP?= /usr/xpg4/bin/grep -E
+EXPR?= /usr/xpg4/bin/expr
+FALSE?= /usr/bin/false
+FGREP?= /usr/xpg4/bin/fgrep
+FILE_CMD?= /usr/bin/file
+FIND?= /usr/bin/find
+GMAKE?= ${LOCALBASE}/bin/gmake
+GREP?= /usr/xpg4/bin/grep
+.if exists(${LOCALBASE}/bin/gtar)
+GTAR?= ${LOCALBASE}/bin/gtar
+.else
+GTAR?= ${LOCALBASE}/bin/tar
+.endif
+.if exists(${LOCALBASE}/bin/gzip)
+GUNZIP_CMD?= ${LOCALBASE}/bin/gunzip -f
+GZCAT?= ${LOCALBASE}/bin/zcat
+GZIP?= -9
+GZIP_CMD?= ${LOCALBASE}/bin/gzip -nf ${GZIP}
+.elif exists(/usr/bin/gzip)
+GUNZIP_CMD?= /usr/bin/gzip -df
+GZCAT?= /usr/bin/gzip -cd
+GZIP?= -9
+GZIP_CMD?= /usr/bin/gzip -nf ${GZIP}
+.endif
+HEAD?= /usr/bin/head
+HOSTNAME_CMD?= /bin/hostname
+ID?= /usr/xpg4/bin/id
+IMAKE?= ${X11BASE}/bin/imake ${IMAKEOPTS}
+LDCONFIG?= /usr/bin/true
+LN?= /usr/bin/ln
+LS?= /usr/bin/ls
+M4?= /usr/ccs/bin/m4
+MAIL_CMD?= /usr/bin/mailx
+MKDIR?= /usr/bin/mkdir -p
+MTREE?= ${LOCALBASE}/sbin/mtree
+MV?= /usr/bin/mv
+NICE?= /usr/xpg4/bin/nice
+.if exists(/usr/bin/gpatch)
+PATCH?= /usr/bin/gpatch
+.else
+PATCH?= ${LOCALBASE}/bin/${GNU_PROGRAM_PREFIX}patch
+.endif
+PAX?= ${LOCALBASE}/bin/pax
+PERL5?= ${LOCALBASE}/bin/perl
+PKGLOCALEDIR?= lib
+PS?= /bin/ps
+PWD_CMD?= /bin/pwd # needs to print physical path
+RM?= /usr/bin/rm
+RMDIR?= /usr/bin/rmdir
+# XXX: default from bsd.pkg.defaults.mk. Verify/corerct for this platform
+# and remove this comment.
+RSH?= /usr/bin/rsh
+.if exists(${LOCALBASE}/bin/nbsed)
+SED?= ${LOCALBASE}/bin/nbsed
+.else
+SED?= /usr/xpg4/bin/sed
+.endif
+SETENV?= /usr/bin/env
+SH?= /bin/ksh
+SHLOCK= ${LOCALBASE}/bin/shlock
+SORT?= /usr/bin/sort
+SU?= /usr/bin/su
+TAIL?= /usr/xpg4/bin/tail
+TAR?= ${LOCALBASE}/bin/tar
+TEE?= /usr/bin/tee
+TEST?= test
+TOUCH?= /usr/bin/touch
+TR?= /usr/bin/tr
+TRUE?= /usr/bin/true
+TSORT?= /usr/ccs/bin/tsort
+TYPE?= /usr/bin/type
+WC?= /usr/bin/wc
+XARGS?= /usr/bin/xargs
+
+CPP_PRECOMP_FLAGS?= # unset
+DEF_UMASK?= 022
+DEFAULT_SERIAL_DEVICE?= /dev/null
+EXPORT_SYMBOLS_LDFLAGS?= # Don't add symbols to the dynamic symbol table
+GROUPADD?= /usr/sbin/groupadd
+MOTIF_TYPE_DEFAULT?= dt # default 2.0 compatible libs type
+NOLOGIN?= ${FALSE}
+ROOT_CMD?= ${SU} - root -c
+ROOT_GROUP?= root
+ROOT_USER?= root
+SERIAL_DEVICES?= /dev/null
+ULIMIT_CMD_datasize?= ulimit -d `ulimit -H -d`
+ULIMIT_CMD_stacksize?= ulimit -s `ulimit -H -s`
+ULIMIT_CMD_memorysize?= ulimit -v `ulimit -H -v`
+USERADD?= /usr/sbin/useradd
+
+# imake installs manpages in weird places
+IMAKE_MAN_SOURCE_PATH= share/man/man
+IMAKE_MAN_SUFFIX= 1
+IMAKE_LIBMAN_SUFFIX= 3
+IMAKE_FILEMAN_SUFFIX= 5
+IMAKE_MAN_DIR= ${IMAKE_MAN_SOURCE_PATH}1
+IMAKE_LIBMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}3
+IMAKE_FILEMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}5
+IMAKE_MANNEWSUFFIX= ${IMAKE_MAN_SUFFIX}
+
+_DO_SHLIB_CHECKS= yes # fixup PLIST for shared libs
+_IMAKE_MAKE= /usr/ccs/bin/make # program which gets invoked by imake
+.if exists(/usr/include/netinet/ip6.h)
+_OPSYS_HAS_INET6= yes # IPv6 is standard
+.else
+_OPSYS_HAS_INET6= no # IPv6 is not standard
+.endif
+_OPSYS_HAS_JAVA= no # Java is not standard
+_OPSYS_HAS_MANZ= no # no MANZ for gzipping of man pages
+_OPSYS_HAS_OSSAUDIO= no # libossaudio is available
+_OPSYS_PERL_REQD= # no base version of perl required
+_OPSYS_PTHREAD_AUTO= no # -lpthread needed for pthreads
+_OPSYS_SHLIB_TYPE= ELF/a.out # shared lib type
+_PATCH_CAN_BACKUP= yes # native patch(1) can make backups
+_PATCH_BACKUP_ARG?= -b -V simple -z # switch to patch(1) for backup suffix
+_PREFORMATTED_MAN_DIR= man # directory where catman pages are
+_USE_GNU_GETTEXT= yes # Use GNU gettext
+_USE_RPATH= yes # add rpath to LDFLAGS
+
+# flags passed to the linker to extract all symbols from static archives.
+# this is the standard Solaris linker, /usr/ccs/bin/ld. The use of GNU
+# ld is not currently supported.
+_OPSYS_WHOLE_ARCHIVE_FLAG= -z allextract
+_OPSYS_NO_WHOLE_ARCHIVE_FLAG= -z defaultextract
+
+# Solaris has /usr/include/iconv.h, but it's not GNU iconv, so mark it
+# incompatible.
+_INCOMPAT_ICONV= SunOS-*-*
+
+.if !defined(DEBUG_FLAGS)
+_STRIPFLAG_CC?= -s # cc(1) option to strip
+_STRIPFLAG_INSTALL?= -s # install(1) option to strip
+.endif
+
+# Migration aid for old /usr/local LOCALBASE
+.if !defined(LOCALBASE) && exists(${DESTDIR}/usr/local/libexec/cgi-bin) && \
+ !exists(${DESTDIR}/usr/pkg/libexec/cgi-bin)
+.BEGIN:
+ @echo "On Solaris and /usr/local/libexec/cgi-bin found:"
+ @echo "- If you have an existing pkgsrc installation & wish to continue"
+ @echo " using /usr/local, append LOCALBASE=/usr/local to /etc/mk.conf."
+ @echo "- Otherwise set LOCALBASE=/usr/pkg in your environment for the"
+ @echo " first package install."
+ @false
+.endif
+
+.if !exists(${SED}) || ${SED} == "/usr/xpg4/bin/sed"
+.BEGIN:
+ @echo ""
+ @echo "==========================================================================="
+ @echo ""
+ @echo "ERROR: pkgsrc now requires a more functional sed(1) than Solaris provides."
+ @echo "you can satisfy this requirement by running:"
+ @echo ""
+ @echo " cd ${_PKGSRCDIR}/textproc/nbsed; ${MAKE} install"
+ @echo ""
+ @echo "this will install ${LOCALBASE}/bin/nbsed and eliminate this message."
+ @echo "(nbsed is already installed by recent bootstrap-pkgsrc)."
+ @echo ""
+ @echo "==========================================================================="
+ @echo ""
+ @false
+.endif
+
+LOCALBASE?= ${DESTDIR}/usr/pkg
+
+.if exists(${LOCALBASE}/sbin/pkg_info)
+PKG_TOOLS_BIN?= ${LOCALBASE}/sbin
+.else
+PKG_TOOLS_BIN?= ${LOCALBASE}/bin
+.endif
+
+# check for maximum command line length and set it in configure's environment,
+# to avoid a test required by the libtool script that takes forever.
+# FIXME: Adjust to work on this system and enable the lines below.
+#.if defined(GNU_CONFIGURE) && defined(USE_LIBTOOL)
+#_OPSYS_MAX_CMDLEN!= /sbin/sysctl -n kern.argmax
+#CONFIGURE_ENV+= lt_cv_sys_max_cmd_len=${_OPSYS_MAX_CMDLEN}
+#.endif
+
+# If games are to be installed setgid, then SETGIDGAME is set to 'yes'
+# (it defaults to 'no' as per bsd.pkg.defaults.mk).
+# Set the group and mode to meaningful values in that case (defaults to
+# BINOWN, BINGRP and BINMODE as per bsd.pkg.defaults.mk).
+# FIXME: Adjust to work on this system and enable the lines below.
+#.if !(empty(SETGIDGAME:M[yY][eE][sS]))
+#GAMEOWN= games
+#GAMEGRP= games
+#GAMEMODE= 2555
+#.endif
diff --git a/mk/platform/UnixWare.mk b/mk/platform/UnixWare.mk
new file mode 100644
index 00000000000..b28b52d6560
--- /dev/null
+++ b/mk/platform/UnixWare.mk
@@ -0,0 +1,177 @@
+# $NetBSD: UnixWare.mk,v 1.1 2004/10/06 20:51:47 jlam Exp $
+#
+# Variable definitions for the UnixWare 7 operating system.
+
+AWK?= /usr/bin/nawk
+BASENAME?= /usr/bin/basename
+CAT?= /usr/bin/cat
+CHMOD?= /usr/bin/chmod
+CHOWN?= /usr/bin/chown
+CHGRP?= /usr/bin/chgrp
+CMP?= /usr/bin/cmp
+CP?= /usr/bin/cp
+CUT?= /usr/bin/cut
+DATE?= /usr/bin/date
+DC?= /usr/bin/dc
+DIRNAME?= /usr/bin/dirname
+ECHO?= /usr/ucb/echo
+ECHO_N?= ${ECHO} -n
+EGREP?= /usr/bin/grep -E
+EXPR?= /usr/bin/expr
+FALSE?= /usr/bin/false
+FGREP?= /usr/bin/grep -F
+FILE_CMD?= /usr/bin/file
+FIND?= /usr/bin/find
+GMAKE?= ${LOCALBASE}/bin/gmake
+GREP?= /usr/bin/grep
+.if exists(${LOCALBASE}/bin/gtar)
+GTAR?= ${LOCALBASE}/bin/gtar
+.else
+GTAR?= ${LOCALBASE}/bin/tar
+.endif
+.if exists(${LOCALBASE}/bin/gzip)
+GUNZIP_CMD?= ${LOCALBASE}/bin/gunzip -f
+GZCAT?= ${LOCALBASE}/bin/zcat
+GZIP?= -9
+GZIP_CMD?= ${LOCALBASE}/bin/gzip -nf ${GZIP}
+.elif exists(/usr/local/bin/gzip)
+GUNZIP_CMD?= /usr/local/bin/gzip -df
+GZCAT?= /usr/local/bin/gzip -cd
+GZIP?= -9
+GZIP_CMD?= /usr/local/bin/gzip -nf ${GZIP}
+.endif
+HEAD?= /usr/bin/head
+HOSTNAME_CMD?= /usr/bin/hostname
+ID?= /usr/bin/id
+IMAKE?= # XXX only available in the SDK? what about xmkmf?
+LDCONFIG?= /usr/bin/true
+LN?= /usr/bin/ln
+LS?= /usr/bin/ls
+M4?= /usr/ccs/bin/m4
+MAIL_CMD?= /usr/bin/mailx
+MKDIR?= ${LOCALBASE}/sbin/mkdir-sh -p
+MTREE?= ${LOCALBASE}/sbin/mtree
+MV?= /usr/bin/mv
+NICE?= /usr/bin/nice
+PATCH?= ${LOCALBASE}/bin/${GNU_PROGRAM_PREFIX}patch
+PAX?= ${LOCALBASE}/bin/pax
+PERL5?= ${LOCALBASE}/bin/perl
+PKGLOCALEDIR?= lib
+PS?= /usr/bin/ps
+PWD_CMD?= /usr/bin/pwd # needs to print physical path
+RM?= /usr/bin/rm
+RMDIR?= /usr/bin/rmdir
+# XXX: default from bsd.pkg.defaults.mk. Verify/corerct for this platform
+# and remove this comment.
+RSH?= /usr/bin/rsh
+.if exists(${LOCALBASE}/bin/nbsed)
+SED?= ${LOCALBASE}/bin/nbsed
+.else
+SED?= /usr/bin/sed
+.endif
+SETENV?= /usr/bin/env
+SH?= /usr/bin/ksh
+SHLOCK= ${LOCALBASE}/bin/shlock
+SORT?= /usr/bin/sort
+SU?= /usr/bin/su
+TAIL?= /usr/bin/tail
+TAR?= ${LOCALBASE}/bin/tar
+TEE?= /usr/bin/tee
+TEST?= test # Shell builtin
+TOUCH?= /usr/bin/touch
+TR?= /usr/bin/tr
+TRUE?= /usr/bin/true
+TSORT?= /usr/ccs/bin/tsort
+TYPE?= /usr/bin/type
+WC?= /usr/bin/wc
+XARGS?= /usr/bin/xargs
+
+CPP_PRECOMP_FLAGS?= # unset
+DEF_UMASK?= 022
+DEFAULT_SERIAL_DEVICE?= /dev/null
+EXPORT_SYMBOLS_LDFLAGS?= # Don't add symbols to the dynamic symbol table
+GROUPADD?= /usr/sbin/groupadd
+MOTIF_TYPE_DEFAULT?= dt # default 2.0 compatible libs type
+NOLOGIN?= ${FALSE}
+ROOT_CMD?= ${SU} - root -c
+ROOT_GROUP?= root
+ROOT_USER?= root
+SERIAL_DEVICES?= /dev/null
+ULIMIT_CMD_datasize?= ulimit -d `ulimit -H -d`
+ULIMIT_CMD_stacksize?= ulimit -s `ulimit -H -s`
+ULIMIT_CMD_memorysize?= ulimit -v `ulimit -H -v`
+USERADD?= /usr/sbin/useradd
+
+# imake installs manpages in weird places
+IMAKE_MAN_SOURCE_PATH= share/man/man
+IMAKE_MAN_SUFFIX= 1
+IMAKE_LIBMAN_SUFFIX= 3
+IMAKE_FILEMAN_SUFFIX= 5
+IMAKE_MAN_DIR= ${IMAKE_MAN_SOURCE_PATH}1
+IMAKE_LIBMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}3
+IMAKE_FILEMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}5
+IMAKE_MANNEWSUFFIX= ${IMAKE_MAN_SUFFIX}
+
+_DO_SHLIB_CHECKS= yes # fixup PLIST for shared libs
+_IMAKE_MAKE= /usr/ccs/bin/make # program which gets invoked by imake
+.if exists(/usr/include/netinet/in6.h)
+_OPSYS_HAS_INET6= yes # IPv6 is standard
+.else
+_OPSYS_HAS_INET6= no # IPv6 is not standard
+.endif
+_OPSYS_HAS_JAVA= no # Java is not standard
+_OPSYS_HAS_MANZ= no # no MANZ for gzipping of man pages
+_OPSYS_HAS_OSSAUDIO= no # libossaudio is available
+_OPSYS_PERL_REQD= # no base version of perl required
+_OPSYS_PTHREAD_AUTO= no # -lpthread needed for pthreads
+_OPSYS_SHLIB_TYPE= ELF/a.out # shared lib type
+_PATCH_CAN_BACKUP= yes # native patch(1) can make backups
+_PATCH_BACKUP_ARG?= -b -V simple -z # switch to patch(1) for backup suffix
+_PREFORMATTED_MAN_DIR= man # directory where catman pages are
+_USE_GNU_GETTEXT= yes # Use GNU gettext
+#
+# The native linker for UnixWare doesn't really support an option to pass
+# rpath directives, but pretend it does anyway since the wrapper scripts
+# will correctly convert it into the the proper LD_RUN_PATH variable.
+#
+_USE_RPATH= yes # add rpath to LDFLAGS
+
+# flags passed to the linker to extract all symbols from static archives.
+# this is the standard Solaris linker, /usr/ccs/bin/ld. The use of GNU
+# ld is not currently supported.
+# XXX is this needed for UnixWare?
+_OPSYS_WHOLE_ARCHIVE_FLAG=
+_OPSYS_NO_WHOLE_ARCHIVE_FLAG=
+
+# UnixWare has /usr/include/iconv.h, but it's not GNU iconv, so mark it
+# incompatible.
+_INCOMPAT_ICONV= UnixWare-*-*
+
+# XXX Where are those variables used?
+.if !defined(DEBUG_FLAGS)
+_STRIPFLAG_CC?= # cc(1) option to strip
+_STRIPFLAG_INSTALL?= # install(1) option to strip
+.endif
+
+LOCALBASE?= ${DESTDIR}/usr/pkg
+
+PKG_TOOLS_BIN?= ${LOCALBASE}/sbin
+
+# check for maximum command line length and set it in configure's environment,
+# to avoid a test required by the libtool script that takes forever.
+# FIXME: Adjust to work on this system and enable the lines below.
+#.if defined(GNU_CONFIGURE) && defined(USE_LIBTOOL)
+#_OPSYS_MAX_CMDLEN!= /sbin/sysctl -n kern.argmax
+#CONFIGURE_ENV+= lt_cv_sys_max_cmd_len=${_OPSYS_MAX_CMDLEN}
+#.endif
+
+# If games are to be installed setgid, then SETGIDGAME is set to 'yes'
+# (it defaults to 'no' as per bsd.pkg.defaults.mk).
+# Set the group and mode to meaningful values in that case (defaults to
+# BINOWN, BINGRP and BINMODE as per bsd.pkg.defaults.mk).
+# FIXME: Adjust to work on this system and enable the lines below.
+#.if !(empty(SETGIDGAME:M[yY][eE][sS]))
+#GAMEOWN= games
+#GAMEGRP= games
+#GAMEMODE= 2555
+#.endif