Module Name:    src
Committed By:   tls
Date:           Sun Aug 10 06:53:30 UTC 2014

Modified Files:
        src/share/mk [tls-earlyentropy]: bsd.README bsd.dep.mk bsd.doc.mk
            bsd.host.mk bsd.hostlib.mk bsd.hostprog.mk bsd.lib.mk bsd.lua.mk
            bsd.man.mk bsd.own.mk bsd.sys.mk bsd.x11.mk sys.mk

Log Message:
Rebase.


To generate a diff of this commit:
cvs rdiff -u -r1.329 -r1.329.2.1 src/share/mk/bsd.README
cvs rdiff -u -r1.80 -r1.80.2.1 src/share/mk/bsd.dep.mk
cvs rdiff -u -r1.64 -r1.64.60.1 src/share/mk/bsd.doc.mk
cvs rdiff -u -r1.1 -r1.1.2.1 src/share/mk/bsd.host.mk
cvs rdiff -u -r1.17 -r1.17.2.1 src/share/mk/bsd.hostlib.mk
cvs rdiff -u -r1.72 -r1.72.2.1 src/share/mk/bsd.hostprog.mk
cvs rdiff -u -r1.349 -r1.349.2.1 src/share/mk/bsd.lib.mk
cvs rdiff -u -r1.6 -r1.6.2.1 src/share/mk/bsd.lua.mk
cvs rdiff -u -r1.114 -r1.114.2.1 src/share/mk/bsd.man.mk
cvs rdiff -u -r1.796 -r1.796.2.1 src/share/mk/bsd.own.mk
cvs rdiff -u -r1.237 -r1.237.2.1 src/share/mk/bsd.sys.mk
cvs rdiff -u -r1.112 -r1.112.2.1 src/share/mk/bsd.x11.mk
cvs rdiff -u -r1.123 -r1.123.2.1 src/share/mk/sys.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/mk/bsd.README
diff -u src/share/mk/bsd.README:1.329 src/share/mk/bsd.README:1.329.2.1
--- src/share/mk/bsd.README:1.329	Tue Mar 25 09:52:55 2014
+++ src/share/mk/bsd.README	Sun Aug 10 06:53:30 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.README,v 1.329 2014/03/25 09:52:55 ozaki-r Exp $
+#	$NetBSD: bsd.README,v 1.329.2.1 2014/08/10 06:53:30 tls Exp $
 #	@(#)bsd.README	8.2 (Berkeley) 4/2/94
 
 This is the README file for the make "include" files for the NetBSD
@@ -198,6 +198,12 @@ MKGCCCMDS	If "no", don't build gcc(1), b
 MKGDB		If "no", don't build gdb(1).
 		Default: yes
 
+MKGROFFHTMLDOC	If "no", avoid trying to use groff to generate html for
+		miscellaneous articles, as this seems to sometimes want
+		to run software not in base. Does not affect html man
+		pages.
+		Default: no
+
 MKHESIOD	If "no", disables building of Hesiod infrastructure
 		(libraries and support programs).
 		Default: yes
@@ -234,6 +240,10 @@ MKISCSI		If "no", don't build or install
 		(depends on libpthread.)
 		Default: yes
 
+MKKDEBUG	If "yes", force building of kernel symbol info and creation
+		of netbsd.gdb in all kernel builds, independently of the
+		settings for "makeoptions DEBUG" in the kernel config file.
+
 MKKERBEROS	If "no", disables building of Kerberos v5
 		infrastructure (libraries and support programs).
 		Default: yes
@@ -605,15 +615,16 @@ 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}]
 
+GZIP_N_FLAG	Flags to pass to TOOL_GZIP to prevent it from inserting
+		file names or timestamps in the compressed output.
+		[-n, or -nT when TOOL_GZIP is really TOOL_PIGZ]
+
 NLSDIR		Base path for Native Language Support files installation.
 		[/usr/share/nls]
 
@@ -793,6 +804,11 @@ TOOL_GROFF		Front end for groff document
 
 TOOL_GZIP		Compression/decompression tool.  [gzip]
 
+TOOL_GZIP_N		Same as TOOL_GZIP, plus a command line option to
+			prevent it from inserting file names or timestamps
+			into the compressed output.
+			[${TOOL_GZIP} ${GZIP_N_FLAG}]
+
 TOOL_HEXDUMP		Ascii, decimal, hexadecimal, octal dump.  [hexdump]
 
 TOOL_HP300MKBOOT	Make bootable image for hp300.  [hp300-mkboot]
@@ -840,6 +856,8 @@ TOOL_MSGC		Simple message list compiler.
 
 TOOL_MTREE		Map a directory hierarchy.  [mtree]
 
+TOOL_NCDCS		Turn ELF kernel into a NCD firmware image. [ncdcs]
+
 TOOL_PAX		Manipulate file archives and copy directories.  [pax]
 
 TOOL_PIC		Compile pictures for groff.  [pic]
@@ -1889,7 +1907,7 @@ LDFLAGS		Options to ${CC} during the lin
 
 LINT		C program verifier.  [lint]
 
-LINTFLAGS	Options to ${LINT}.  [-chapbxzFS]
+LINTFLAGS	Options to ${LINT}.  [-chapbxzgFS]
 
 LORDER		List dependencies for object files.  [lorder]
 

Index: src/share/mk/bsd.dep.mk
diff -u src/share/mk/bsd.dep.mk:1.80 src/share/mk/bsd.dep.mk:1.80.2.1
--- src/share/mk/bsd.dep.mk:1.80	Thu Dec  5 22:49:33 2013
+++ src/share/mk/bsd.dep.mk	Sun Aug 10 06:53:30 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.dep.mk,v 1.80 2013/12/05 22:49:33 matt Exp $
+#	$NetBSD: bsd.dep.mk,v 1.80.2.1 2014/08/10 06:53:30 tls Exp $
 
 ##### Basic targets
 realdepend:	beforedepend .depend afterdepend
@@ -61,7 +61,7 @@ _MKDEP_FILEFLAGS=
 .c.d:
 	${_MKTARGET_CREATE}
 	${MKDEP} -f ${.TARGET}.tmp ${_MKDEP_FILEFLAGS} -- ${MKDEPFLAGS} \
-	    ${CFLAGS:C/-([IDU])[  ]*/-\1/Wg:M-[IDU]*} \
+	    ${CFLAGS:M-std=*} ${CFLAGS:C/-([IDU])[  ]*/-\1/Wg:M-[IDU]*} \
 	    ${CPPFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} \
 	    ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} && \
 	    mv ${.TARGET}.tmp ${.TARGET}
@@ -85,7 +85,7 @@ _MKDEP_FILEFLAGS=
 .C.d .cc.d .cpp.d .cxx.d:
 	${_MKTARGET_CREATE}
 	${MKDEPCXX} -f ${.TARGET}.tmp ${_MKDEP_FILEFLAGS} -- ${MKDEPFLAGS} \
-	    ${CXXFLAGS:C/-([IDU])[  ]*/-\1/Wg:M-[IDU]*} \
+	    ${CXXFLAGS:M-std=*} ${CXXFLAGS:C/-([IDU])[  ]*/-\1/Wg:M-[IDU]*} \
 	    ${CPPFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} \
 	    ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} && \
 	    mv ${.TARGET}.tmp ${.TARGET}

Index: src/share/mk/bsd.doc.mk
diff -u src/share/mk/bsd.doc.mk:1.64 src/share/mk/bsd.doc.mk:1.64.60.1
--- src/share/mk/bsd.doc.mk:1.64	Thu Mar 16 18:43:34 2006
+++ src/share/mk/bsd.doc.mk	Sun Aug 10 06:53:30 2014
@@ -1,72 +1,217 @@
-#	$NetBSD: bsd.doc.mk,v 1.64 2006/03/16 18:43:34 jwise Exp $
+#	$NetBSD: bsd.doc.mk,v 1.64.60.1 2014/08/10 06:53:30 tls Exp $
 #	@(#)bsd.doc.mk	8.1 (Berkeley) 8/14/93
 
 .include <bsd.init.mk>
 
-##### Basic targets
-clean:		cleandoc
-realinstall:	docinstall
-
-##### Build rules
-.if !target(paper.ps)
-paper.ps: ${SRCS}
-	${_MKTARGET_FORMAT}
-	${TOOL_ROFF_PS} ${MACROS} ${PAGES} ${.ALLSRC} > ${.TARGET}
-.endif
-
-.if ${MKSHARE} != "no"
-realall:	paper.ps
-.endif
+# The makefile should set these:
+#   SECTION		one of usd, smm, or psd (lower-case)
+#   ARTICLE		name of this document
+#   SRCS		roff source files
+#   DEPSRCS		additional roff source files implicitly included
+#   MACROS		name(s) of roff macro packages, including the -m
+#   ROFF_PIC		set to "yes" to use pic(1)
+#   ROFF_EQN		set to "yes" to use eqn(1)
+#   ROFF_TBL		set to "yes" to use tbl(1)
+#   ROFF_REFER		set to "yes" to use refer(1)
+#   EXTRAHTMLFILES	additional files emitted as part of HTML build
+#
+#   PAGES		unknown (XXX)
+#   EXTRA		extra files to install (XXX)
+#
+# If there are multiple docs to be generated, set these:
+#   SUBARTICLES=	name1 name2 ...
+#   SRCS.name1=		roff source files
+#   SRCS.name2=		more roff source files
+#   SRCS.  :  =		  :
+#   DEPSRCS.name1=	additional included roff source files
+#   DEPSRCS.name2=	more additional included roff source files
+#   DEPSRCS.  :  =	  :
+#
+# I'm hoping that MACROS and ROFF_* can be uniform across all
+# subarticles.
+
+
+# Old bsd.doc.mk files tend to invoke tbl and other preprocessors
+# directly; they should be changed to set ROFF_* instead.
+#
+# Also they set e.g. DIR=usd/72.mydocument; this should be changed
+# to SECTION=usd and ARTICLE=mydocument. The article numbers are
+# no longer present in the file system and do not need to be known
+# at build time.
+#
+
+# 20130908 dholland: Make sure all makefiles have been converted to the
+# new scheme.
+.if !defined(SECTION)
+.error "bsd.doc.mk: SECTION must be defined"
+.endif
+.if target(paper.ps)
+.error "bsd.doc.mk: target(paper.ps) is true -- this is not allowed"
+.endif
+
+# 20130908 dholland: right now we cannot generate pdf from roff sources,
+# so build compressed postscript instead. XXX. (and: yech)
+TOOL_ROFF_PDF?=false "No roff pdf support"
+PRINTABLE=ps.gz
+#PRINTABLE=ps
+#PRINTABLE=pdf
+
+# If there aren't subarticles, we generate one doc that has the same
+# name as the top-level article.
+SUBARTICLES?=${ARTICLE}
+SRCS.${ARTICLE}?=${SRCS}
+DEPSRCS.${ARTICLE}?=${DEPSRCS}
 
-##### Install rules
-docinstall::	# ensure existence
-.PHONY:		docinstall
+##### Build
 
+.for SA in ${SUBARTICLES}
 .if ${MKDOC} != "no"
+realall: ${SA}.txt
+realall: ${SA}.${PRINTABLE}
+.if ${MKHTML} != "no" && ${MKGROFFHTMLDOC} != "no"
+realall: ${SA}.html
+.endif
+.endif
+.endfor # SUBARTICLES
+
+.if defined(ROFF_PIC) && ${ROFF_PIC} != "no"
+ROFFFLAGS+=-p
+.endif
+.if defined(ROFF_EQN) && ${ROFF_EQN} != "no"
+ROFFFLAGS+=-e
+.endif
+.if defined(ROFF_TBL) && ${ROFF_TBL} != "no"
+ROFFFLAGS+=-t
+.endif
+.if defined(ROFF_REFER) && ${ROFF_REFER} != "no"
+ROFFFLAGS+=-R
+.endif
+ROFFFLAGS+=-I${.CURDIR}
+
+.for SA in ${SUBARTICLES}
+
+#
+# Find the sources.
+#
+# We can't use .IMPSRC in the rules because they aren't suffix rules
+# (they could be for some docs, but not others) and we can't use
+# .ALLSRC because that includes DEPSRCS.
+#
+# As far as I know, the only ways to get the path discovered via .PATH
+# are those two magic variables or the P modifier.
+#
+# For some reason the P modifier finds the path to a variable name,
+# not the path to a word in a variable.
+#
 
-__docinstall: .USE
-	${_MKTARGET_INSTALL}
-	${INSTALL_FILE} -o ${DOCOWN} -g ${DOCGRP} -m ${DOCMODE} \
-		${.ALLSRC} ${.TARGET}
+.for S in ${SRCS.${SA}}
+SRCS2.${SA}+=${${S}:P}
+.endfor
+.for S in ${DEPSRCS.${SA}}
+DEPSRCS2.${SA}+=${${S}:P}
+.endfor
 
-FILES?=		${SRCS}
+#
+# Note: we use TOOL_ROFF_DOCASCII because TOOL_ROFF_ASCII invokes
+# the nroff wrapper instead of groff directly, and that doesn't
+# understand -I.
+#
+# We use TOOL_ROFF_DOCHTML because TOOL_ROFF_HTML uses -mdoc2html,
+# which is great if it works but doesn't work with at least some of
+# the non-mdoc docs. (e.g. the curses one) TOOL_ROFF_DOCHTML uses
+# groff -Thtml, which produces fairly blah output but works with these
+# docs. It might end up being necessary to choose one or the other on
+# a per-document basis... sigh.
+#
 
-.for F in Makefile ${FILES:O:u} ${EXTRA}
-_F:=		${DESTDIR}${DOCDIR}/${DIR}/${F}		# installed path
+${SA}.txt: ${SRCS2.${SA}} ${DEPSRCS2.${SA}}
+	${_MKTARGET_FORMAT}
+	${TOOL_ROFF_DOCASCII} ${ROFFFLAGS} ${MACROS} ${PAGES} ${SRCS2.${SA}} \
+		> ${.TARGET}
+
+${SA}.ps: ${SRCS2.${SA}} ${DEPSRCS2.${SA}}
+	${_MKTARGET_FORMAT}
+	${TOOL_ROFF_PS} ${ROFFFLAGS} ${MACROS} ${PAGES} ${SRCS2.${SA}} \
+		> ${.TARGET}
 
-.if ${MKUPDATE} == "no"
-${_F}!		${F} __docinstall			# install rule
-.if !defined(BUILD) && !make(all) && !make(${F})
-${_F}!		.MADE					# no build at install
+${SA}.pdf: ${SRCS2.${SA}} ${DEPSRCS2.${SA}}
+	${_MKTARGET_FORMAT}
+	${TOOL_ROFF_PDF} ${ROFFFLAGS} ${MACROS} ${PAGES} ${SRCS2.${SA}} \
+		> ${.TARGET}
+
+${SA}.html: ${SRCS2.${SA}} ${DEPSRCS2.${SA}}
+	${_MKTARGET_FORMAT}
+	${TOOL_ROFF_DOCHTML} ${ROFFFLAGS} ${MACROS} ${PAGES} ${SRCS2.${SA}} \
+		-P -I -P ${SA} \
+		> ${.TARGET}
+
+${SA}.ps.gz: ${SA}.ps
+	${TOOL_GZIP} -9 -c ${.ALLSRC} > ${.TARGET}
+
+.endfor # SUBARTICLES
+
+##### Install
+
+DOCINST:=
+.for SA in ${SUBARTICLES}
+DOCINST+=${SA}.txt ${SA}.${PRINTABLE}
+.if ${MKHTML} != "no" && ${MKGROFFHTMLDOC} != "no"
+DOCINST+=${SA}.html
 .endif
-.else
-${_F}:		${F} __docinstall			# install rule
-.if !defined(BUILD) && !make(all) && !make(${F})
-${_F}:		.MADE					# no build at install
+.endfor
+.if ${MKHTML} != "no" && ${MKGROFFHTMLDOC} != "no"
+DOCINST+=${EXTRAHTMLFILES}
 .endif
+
+.if ${MKDOC} != "no"
+docinstall:
+.for D in ${DOCINST}
+	${_MKTARGET_INSTALL}
+	${INSTALL_FILE} -o ${DOCOWN} -g ${DOCGRP} -m ${DOCMODE} ${D} \
+		${DESTDIR}${DOCDIR}/${SECTION}/${ARTICLE}/${D}
+.endfor
+.else
+docinstall: ;
 .endif
 
-docinstall::	${_F}
-.PRECIOUS:	${_F}					# keep if install fails
+.PHONY: docinstall
+realinstall: docinstall
+
+##### Clean
+
+cleandoc:
+.for SA in ${SUBARTICLES}
+	rm -f ${SA}.txt ${SA}.ps ${SA}.ps.gz ${SA}.html
 .endfor
+	rm -f ${EXTRAHTMLFILES} [eE]rrs mklog ${CLEANFILES}
 
-.undef _F
-.endif # ${MKDOC} != "no"
+.PHONY: cleandoc
+clean: cleandoc
 
-##### Clean rules
-cleandoc: .PHONY
-	rm -f paper.* [eE]rrs mklog ${CLEANFILES}
+##### Extra custom rules
 
-##### Custom rules
 .if !target(print)
-print: .PHONY paper.ps
+print: ;
+.PHONY: print
+.for SA in ${SUBARTICLES}
+print: print.${SA}
+.PHONY: print.{SA}
+print.${SA}: ${SA}.ps
 	lpr -P${PRINTER} ${.ALLSRC}
+.endfor
 .endif
 
-spell: .PHONY ${SRCS}
-	spell ${.ALLSRC} | sort | comm -23 - spell.ok > paper.spell
+spell: ;
+.PHONY: spell
+.for SA in ${SUBARTICLES}
+spell: spell.${SA}
+.PHONY: spell.{SA}
+spell.${SA}: ${SRCS2} ${DEPSRCS2}
+	spell ${SRCS2} | sort | comm -23 - spell.ok > paper.spell
+.endfor
 
 ##### Pull in related .mk logic
+
 .include <bsd.obj.mk>
 .include <bsd.sys.mk>
 

Index: src/share/mk/bsd.host.mk
diff -u src/share/mk/bsd.host.mk:1.1 src/share/mk/bsd.host.mk:1.1.2.1
--- src/share/mk/bsd.host.mk:1.1	Thu Jan 16 01:19:46 2014
+++ src/share/mk/bsd.host.mk	Sun Aug 10 06:53:30 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.host.mk,v 1.1 2014/01/16 01:19:46 christos Exp $
+#	$NetBSD: bsd.host.mk,v 1.1.2.1 2014/08/10 06:53:30 tls Exp $
 
 .if !defined(_BSD_HOST_MK_)
 _BSD_HOST_MK_=1
@@ -46,8 +46,13 @@ HOST_OSTYPE:=	${_HOST_OSNAME}-${_HOST_OS
 .MAKEOVERRIDES+= HOST_OSTYPE
 .endif # !defined(HOST_OSTYPE)
 
+.if ${USETOOLS} == "yes"
 HOST_MKDEP?=	${TOOLDIR}/bin/${_TOOL_PREFIX}host-mkdep
 HOST_MKDEPCXX?=	${TOOLDIR}/bin/${_TOOL_PREFIX}host-mkdep
+.else
+HOST_MKDEP?=	CC=${HOST_CC:Q} mkdep
+HOST_MKDEPCXX?=	CC=${HOST_CXX:Q} mkdep
+.endif
 
 .if ${NEED_OWN_INSTALL_TARGET} != "no"
 HOST_INSTALL_FILE?=	${INSTALL} ${COPY} ${PRESERVE} ${RENAME}

Index: src/share/mk/bsd.hostlib.mk
diff -u src/share/mk/bsd.hostlib.mk:1.17 src/share/mk/bsd.hostlib.mk:1.17.2.1
--- src/share/mk/bsd.hostlib.mk:1.17	Tue Oct 29 16:11:46 2013
+++ src/share/mk/bsd.hostlib.mk	Sun Aug 10 06:53:30 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.hostlib.mk,v 1.17 2013/10/29 16:11:46 joerg Exp $
+#	$NetBSD: bsd.hostlib.mk,v 1.17.2.1 2014/08/10 06:53:30 tls Exp $
 
 .include <bsd.init.mk>
 .include <bsd.sys.mk>
@@ -7,8 +7,6 @@
 
 ##### Default values
 CFLAGS+=	${COPTS}
-HOST_MKDEP?=	CC=${HOST_CC:Q} mkdep
-HOST_MKDEPCXX?=	CC=${HOST_CXX:Q} mkdep
 MKDEP_SUFFIXES?=	.o .lo
 
 # Override these:

Index: src/share/mk/bsd.hostprog.mk
diff -u src/share/mk/bsd.hostprog.mk:1.72 src/share/mk/bsd.hostprog.mk:1.72.2.1
--- src/share/mk/bsd.hostprog.mk:1.72	Tue Oct 29 16:11:46 2013
+++ src/share/mk/bsd.hostprog.mk	Sun Aug 10 06:53:30 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.hostprog.mk,v 1.72 2013/10/29 16:11:46 joerg Exp $
+#	$NetBSD: bsd.hostprog.mk,v 1.72.2.1 2014/08/10 06:53:30 tls Exp $
 #	@(#)bsd.prog.mk	8.2 (Berkeley) 4/2/94
 
 .include <bsd.init.mk>
@@ -81,8 +81,6 @@ LIBRUMPFS_TMPFS?=	/usr/lib/librumpfs_tmp
 LIBRUMPFS_UDF?=		/usr/lib/librumpfs_udf.a
 LIBRUMPFS_UFS?=		/usr/lib/librumpfs_ufs.a
 
-HOST_MKDEP?=	CC=${HOST_CC:Q} mkdep
-HOST_MKDEPCXX?=	CC=${HOST_CXX:Q} mkdep
 MKDEP_SUFFIXES?=	.lo .ln
 
 # Override these:

Index: src/share/mk/bsd.lib.mk
diff -u src/share/mk/bsd.lib.mk:1.349 src/share/mk/bsd.lib.mk:1.349.2.1
--- src/share/mk/bsd.lib.mk:1.349	Fri Apr  4 05:10:15 2014
+++ src/share/mk/bsd.lib.mk	Sun Aug 10 06:53:30 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.lib.mk,v 1.349 2014/04/04 05:10:15 matt Exp $
+#	$NetBSD: bsd.lib.mk,v 1.349.2.1 2014/08/10 06:53:30 tls Exp $
 #	@(#)bsd.lib.mk	8.3 (Berkeley) 4/22/94
 
 .include <bsd.init.mk>
@@ -169,7 +169,9 @@ CFLAGS+=	-g
 # Platform-independent linker flags for ELF shared libraries
 SHLIB_SOVERSION=	${SHLIB_MAJOR}
 SHLIB_SHFLAGS=		-Wl,-soname,${_LIB}.so.${SHLIB_SOVERSION}
+.if !defined(SHLIB_WARNTEXTREL) || ${SHLIB_WARNTEXTREL} != "no"
 SHLIB_SHFLAGS+=		-Wl,--warn-shared-textrel
+.endif
 .if !defined(SHLIB_MKMAP) || ${SHLIB_MKMAP} != "no"
 SHLIB_SHFLAGS+=		-Wl,-Map=${_LIB}.so.${SHLIB_SOVERSION}.map
 .endif
@@ -602,8 +604,6 @@ LDADD+= -lgcc
 LIBCC:=	${CXX}
 . if ${MKLIBCXX} == "yes"
 LIBDPLIBS+=     c++	${.CURDIR}/../../../../../external/bsd/libc++/lib
-. elif defined(HAVE_GCC) && ${HAVE_GCC} == 4
-LIBDPLIBS+=     stdc++	${.CURDIR}/../../../../../gnu/lib/libstdc++-v3_4
 . else
 LIBDPLIBS+=     stdc++	${.CURDIR}/../../../../../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libstdc++-v3
 . endif
@@ -618,11 +618,10 @@ ${_LIB.so.full}: ${SOLIB} ${DPADD} ${DPL
     ${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}
 	${_MKTARGET_BUILD}
 	rm -f ${.TARGET}
-	${LIBCC} ${LDLIBC} -shared ${SHLIB_SHFLAGS} \
+	${LIBCC} ${LDLIBC} -Wl,-x -shared ${SHLIB_SHFLAGS} \
 	    ${_LDFLAGS.${_LIB}} -o ${.TARGET} ${_LIBLDOPTS} \
 	    -Wl,--whole-archive ${SOLIB} \
 	    -Wl,--no-whole-archive ${_LDADD.${_LIB}}
-	${OBJCOPY} -x ${.TARGET}
 #  We don't use INSTALL_SYMLINK here because this is just
 #  happening inside the build directory/objdir. XXX Why does
 #  this spend so much effort on libraries that aren't live??? XXX

Index: src/share/mk/bsd.lua.mk
diff -u src/share/mk/bsd.lua.mk:1.6 src/share/mk/bsd.lua.mk:1.6.2.1
--- src/share/mk/bsd.lua.mk:1.6	Thu Sep 12 15:36:16 2013
+++ src/share/mk/bsd.lua.mk	Sun Aug 10 06:53:30 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.lua.mk,v 1.6 2013/09/12 15:36:16 joerg Exp $
+#	$NetBSD: bsd.lua.mk,v 1.6.2.1 2014/08/10 06:53:30 tls Exp $
 #
 # Build rules and definitions for Lua modules
 
@@ -64,7 +64,7 @@ CLEANFILES+= a.out [Ee]rrs mklog core *.
 
 ##
 ##### Global variables
-LUA_VERSION?=	5.1
+LUA_VERSION?=	5.3
 LUA_LIBDIR?=	${LIBDIR}/lua/${LUA_VERSION}
 LUAC?=		/usr/bin/luac
 

Index: src/share/mk/bsd.man.mk
diff -u src/share/mk/bsd.man.mk:1.114 src/share/mk/bsd.man.mk:1.114.2.1
--- src/share/mk/bsd.man.mk:1.114	Fri Oct 25 22:16:29 2013
+++ src/share/mk/bsd.man.mk	Sun Aug 10 06:53:30 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.man.mk,v 1.114 2013/10/25 22:16:29 apb Exp $
+#	$NetBSD: bsd.man.mk,v 1.114.2.1 2014/08/10 06:53:30 tls Exp $
 #	@(#)bsd.man.mk	8.1 (Berkeley) 6/8/93
 
 .include <bsd.init.mk>
@@ -40,7 +40,7 @@ _MSECTIONREGEX=	${_MSECTIONS:ts|} # e.g.
 MANCOMPRESS?=
 MANSUFFIX?=
 .else
-MANCOMPRESS?=	${TOOL_GZIP} -ncf
+MANCOMPRESS?=	${TOOL_GZIP_N} -cf
 MANSUFFIX?=	.gz
 .endif
 

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.796 src/share/mk/bsd.own.mk:1.796.2.1
--- src/share/mk/bsd.own.mk:1.796	Sat Apr  5 02:22:56 2014
+++ src/share/mk/bsd.own.mk	Sun Aug 10 06:53:30 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.796 2014/04/05 02:22:56 christos Exp $
+#	$NetBSD: bsd.own.mk,v 1.796.2.1 2014/08/10 06:53:30 tls Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -44,6 +44,10 @@ NEED_OWN_INSTALL_TARGET?=	yes
 # If some future port is not supported by the in-tree toolchain, this should
 # be set to "yes" for that port only.
 #
+.if ${MACHINE} == "playstation2"
+TOOLCHAIN_MISSING?=	yes
+.endif
+
 TOOLCHAIN_MISSING?=	no
 
 #
@@ -51,26 +55,18 @@ TOOLCHAIN_MISSING?=	no
 #
 .if ${MKGCC:Uyes} != "no"
 
-#
-# Platforms still using GCC 4.1
-#
-.if ${MACHINE_CPU}  == "vax"
-HAVE_GCC?=    4
-
-# Platforms switched to GCC 4.8
-.elif \
-      ${MACHINE_CPU} == "alpha" || \
-      ${MACHINE_CPU} == "arm" || \
-      ${MACHINE_CPU} == "hppa" || \
-      ${MACHINE_CPU} == "sparc" || \
-      ${MACHINE_CPU} == "sparc64" || \
-      ${MACHINE_CPU} == "x86_64" || \
-      ${MACHINE_CPU} == "i386"
-HAVE_GCC?=    48
+# Platforms still using GCC 4.5
+.if \
+      ${MACHINE_CPU} == "m68k" || \
+      ${MACHINE_ARCH} == "powerpc" || \
+      ${MACHINE_ARCH} == "powerpc64"
+HAVE_GCC?=    45
 
+.elif ${MACHINE} == "playstation2"
+HAVE_GCC?=    0
 .else
-# Otherwise, default to GCC4.5
-HAVE_GCC?=    45
+# Otherwise, default to GCC4.8
+HAVE_GCC?=    48
 .endif
 
 #
@@ -87,26 +83,21 @@ EXTERNAL_GCC_SUBDIR=	/does/not/exist
 
 .endif
 
-.if ${MACHINE_ARCH} == "ia64"
-USE_COMPILERCRTSTUFF?=	yes
-.else
-USE_COMPILERCRTSTUFF?=	no
+.if !empty(MACHINE_ARCH:Mearm*)
+_LIBC_COMPILER_RT.${MACHINE_ARCH}=	yes
 .endif
 
-.if ${MKLLVM:Uno} == "yes" && (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64")
+_LIBC_COMPILER_RT.i386=		yes
+_LIBC_COMPILER_RT.x86_64=	yes
+
+.if ${MKLLVM:Uno} == "yes" && ${_LIBC_COMPILER_RT.${MACHINE_ARCH}:Uno} == "yes"
 HAVE_LIBGCC?=	no
 .else
 HAVE_LIBGCC?=	yes
 .endif
 
-_LIBC_UNWIND_SUPPORT.i386=	yes
-_LIBC_UNWIND_SUPPORT.m68k=	yes
-_LIBC_UNWIND_SUPPORT.powerpc=	yes
-_LIBC_UNWIND_SUPPORT.sh3el=	yes
-_LIBC_UNWIND_SUPPORT.sh3eb=	yes
-_LIBC_UNWIND_SUPPORT.vax=	yes
-_LIBC_UNWIND_SUPPORT.x86_64=	yes
-.if ${MKLLVM:Uno} == "yes" && ${_LIBC_UNWIND_SUPPORT.${MACHINE_ARCH}:Uno} == "yes"
+# ia64 is not support
+.if ${MKLLVM:Uno} == "yes" || !empty(MACHINE_ARCH:Mearm*)
 HAVE_LIBGCC_EH?=	no
 .else
 HAVE_LIBGCC_EH?=	yes
@@ -271,6 +262,7 @@ TOOL_OBJC.clang=	${TOOLDIR}/bin/${MACHIN
 # PCC supports C and Fortran
 TOOL_CC.pcc=		${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-pcc
 TOOL_CPP.pcc=		${TOOLDIR}/libexec/${MACHINE_GNU_PLATFORM}-cpp
+TOOL_CXX.pcc=		${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-p++
 
 #
 # Make sure DESTDIR is set, so that builds with these tools always
@@ -359,6 +351,7 @@ TOOL_ELFTOSB=		${TOOLDIR}/bin/${_TOOL_PR
 TOOL_MSGC=		MSGDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}msgc
 TOOL_MTREE=		${TOOLDIR}/bin/${_TOOL_PREFIX}mtree
 TOOL_NBPERF=		${TOOLDIR}/bin/${_TOOL_PREFIX}perf
+TOOL_NCDCS=		${TOOLDIR}/bin/${_TOOL_PREFIX}ibmnws-ncdcs
 TOOL_PAX=		${TOOLDIR}/bin/${_TOOL_PREFIX}pax
 TOOL_PIC=		${TOOLDIR}/bin/${_TOOL_PREFIX}pic
 TOOL_PIGZ=		${TOOLDIR}/bin/${_TOOL_PREFIX}pigz
@@ -367,6 +360,8 @@ TOOL_POWERPCMKBOOTIMAGE=${TOOLDIR}/bin/$
 TOOL_PWD_MKDB=		${TOOLDIR}/bin/${_TOOL_PREFIX}pwd_mkdb
 TOOL_REFER=		${TOOLDIR}/bin/${_TOOL_PREFIX}refer
 TOOL_ROFF_ASCII=	PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}nroff
+TOOL_ROFF_DOCASCII=	${TOOL_GROFF} -Tascii
+TOOL_ROFF_DOCHTML=	${TOOL_GROFF} -Thtml
 TOOL_ROFF_DVI=		${TOOL_GROFF} -Tdvi
 TOOL_ROFF_HTML=		${TOOL_GROFF} -Tlatin1 -mdoc2html
 TOOL_ROFF_PS=		${TOOL_GROFF} -Tps
@@ -383,6 +378,7 @@ TOOL_TBL=		${TOOLDIR}/bin/${_TOOL_PREFIX
 TOOL_TIC=		${TOOLDIR}/bin/${_TOOL_PREFIX}tic
 TOOL_UUDECODE=		${TOOLDIR}/bin/${_TOOL_PREFIX}uudecode
 TOOL_VGRIND=		${TOOLDIR}/bin/${_TOOL_PREFIX}vgrind -f
+TOOL_VFONTEDPR=		${TOOLDIR}/libexec/${_TOOL_PREFIX}vfontedpr
 TOOL_ZIC=		${TOOLDIR}/bin/${_TOOL_PREFIX}zic
 
 .else	# USETOOLS != yes						# } {
@@ -403,6 +399,7 @@ TOOL_OBJC.gcc=	gcc
 # PCC supports C and Fortran
 TOOL_CC.pcc=		pcc
 TOOL_CPP.pcc=		/usr/libexec/pcpp
+TOOL_CXX.pcc=		p++
 
 TOOL_AMIGAAOUT2BB=	amiga-aout2bb
 TOOL_AMIGAELF2BB=	amiga-elf2bb
@@ -460,6 +457,7 @@ TOOL_ELFTOSB=		elftosb
 TOOL_MSGC=		msgc
 TOOL_MTREE=		mtree
 TOOL_NBPERF=		nbperf
+TOOL_NCDCS=		ncdcs
 TOOL_PAX=		pax
 TOOL_PIC=		pic
 TOOL_PIGZ=		pigz
@@ -468,6 +466,8 @@ TOOL_POWERPCMKBOOTIMAGE=	powerpc-mkbooti
 TOOL_PWD_MKDB=		pwd_mkdb
 TOOL_REFER=		refer
 TOOL_ROFF_ASCII=	nroff
+TOOL_ROFF_DOCASCII=	${TOOL_GROFF} -Tascii
+TOOL_ROFF_DOCHTML=	${TOOL_GROFF} -Thtml
 TOOL_ROFF_DVI=		${TOOL_GROFF} -Tdvi
 TOOL_ROFF_HTML=		${TOOL_GROFF} -Tlatin1 -mdoc2html
 TOOL_ROFF_PS=		${TOOL_GROFF} -Tps
@@ -483,6 +483,7 @@ TOOL_TBL=		tbl
 TOOL_TIC=		tic
 TOOL_UUDECODE=		uudecode
 TOOL_VGRIND=		vgrind -f
+TOOL_VFONTEDPR=		/usr/libexec/vfontedpr
 TOOL_ZIC=		zic
 
 .endif	# USETOOLS != yes						# }
@@ -494,7 +495,7 @@ TOOL_CXX.false=		false
 TOOL_FC.false=		false
 TOOL_OBJC.false=	false
 
-AVAILABLE_COMPILER?=	${HAVE_PCC:Dpcc} ${HAVE_LLVM:Dclang} ${HAVE_GCC:Dgcc} false
+AVAILABLE_COMPILER?=	${HAVE_PCC:Dpcc} ${HAVE_LLVM:Dclang} ${HAVE_GCC:Dgcc} ${EXTERNAL_TOOLCHAIN:Dgcc} false
 
 .for _t in CC CPP CXX FC OBJC
 ACTIVE_${_t}=	${AVAILABLE_COMPILER:@.c.@ ${ !defined(UNSUPPORTED_COMPILER.${.c.}) && defined(TOOL_${_t}.${.c.}) :? ${.c.} : }@:[1]}
@@ -641,7 +642,6 @@ LIBOWN?=	${BINOWN}
 LIBMODE?=	${NONBINMODE}
 
 DOCDIR?=	/usr/share/doc
-HTMLDOCDIR?=	/usr/share/doc/html
 DOCGRP?=	wheel
 DOCOWN?=	root
 DOCMODE?=	${NONBINMODE}
@@ -976,7 +976,7 @@ MKGCCCMDS?=	${MKGCC}
 _MKVARS.no= \
 	MKBSDGREP MKBSDTAR \
 	MKCATPAGES MKCRYPTO_RC5 MKCTF MKDEBUG \
-	MKDEBUGLIB MKDTRACE MKEXTSRC \
+	MKDEBUGLIB MKDTRACE MKEXTSRC MKGROFFHTMLDOC \
 	MKKYUA MKLLD MKLLDB MKLINT \
 	MKMANZ MKMCLINKER MKOBJDIRS \
 	MKLIBCXX MKLLVM MKPCC \
@@ -1089,6 +1089,16 @@ MKMAN:=		no
 MKNLS:=		no
 .endif
 
+.if !empty(MACHINE_ARCH:Mearm*)
+_NEEDS_LIBCXX.${MACHINE_ARCH}=	yes
+.endif
+_NEEDS_LIBCXX.i386=	yes
+_NEEDS_LIBCXX.x86_64=	yes
+
+.if ${MKLLVM} == "yes" && ${_NEEDS_LIBCXX.${MACHINE_ARCH}:Uno} == "yes"
+MKLIBCXX:=	yes
+.endif
+
 #
 # install(1) parameters.
 #
@@ -1164,11 +1174,17 @@ ${var}?= yes
 ${var}?= no
 .endfor
 
+#
+# TOOL_GZIP and friends.  These might refer to TOOL_PIGZ or to the host gzip.
+#
 .if ${USE_PIGZGZIP} != "no"
 TOOL_GZIP=		${TOOL_PIGZ}
+GZIP_N_FLAG?=		-nT
 .else
 TOOL_GZIP=		gzip
+GZIP_N_FLAG?=		-n
 .endif
+TOOL_GZIP_N=		${TOOL_GZIP} ${GZIP_N_FLAG}
 
 #
 # Where X11 sources are and where it is installed to.

Index: src/share/mk/bsd.sys.mk
diff -u src/share/mk/bsd.sys.mk:1.237 src/share/mk/bsd.sys.mk:1.237.2.1
--- src/share/mk/bsd.sys.mk:1.237	Tue Jan 28 19:41:52 2014
+++ src/share/mk/bsd.sys.mk	Sun Aug 10 06:53:30 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.sys.mk,v 1.237 2014/01/28 19:41:52 martin Exp $
+#	$NetBSD: bsd.sys.mk,v 1.237.2.1 2014/08/10 06:53:30 tls Exp $
 #
 # Build definitions used for NetBSD source tree builds.
 
@@ -20,12 +20,10 @@ CPPFLAGS+=	-Wp,-iremap,${DESTDIR}/:/
 CPPFLAGS+=	-Wp,-iremap,${X11SRCDIR}:/usr/xsrc
 .endif
 
-# Enable c99 mode by default.
-# This has the side effect of complaining for missing prototypes
-# implicit type declarations and missing return statements.
-.if defined(HAVE_GCC) || defined(HAVE_LLVM)
-CFLAGS+=	-std=gnu99
-.endif
+# NetBSD sources use C99 style, with some GCC extensions.
+CFLAGS+=	${${ACTIVE_CC} == "clang":? -std=gnu99 :}
+CFLAGS+=	${${ACTIVE_CC} == "gcc":? -std=gnu99 :}
+CFLAGS+=	${${ACTIVE_CC} == "pcc":? -std=gnu99 :}
 
 .if defined(WARNS)
 CFLAGS+=	${${ACTIVE_CC} == "clang":? -Wno-sign-compare -Wno-pointer-sign :}
@@ -39,7 +37,7 @@ CFLAGS+=	-Wall -Wstrict-prototypes -Wmis
 # differently in traditional and ansi environments' which is the warning
 # we wanted, and now we don't get anymore.
 CFLAGS+=	-Wno-sign-compare
-CFLAGS+=	${${ACTIVE_CC} != "clang":? -Wno-traditional :}
+CFLAGS+=	${${ACTIVE_CC} == "gcc" :? -Wno-traditional :}
 .if !defined(NOGCCERROR)
 # Set assembler warnings to be fatal
 CFLAGS+=	-Wa,--fatal-warnings
@@ -82,7 +80,7 @@ CFLAGS+=	${${ACTIVE_CC} == "gcc":? -Wno-
 .if ${WARNS} > 3 && defined(HAVE_LLVM)
 CFLAGS+=	${${ACTIVE_CC} == "clang":? -Wpointer-sign -Wmissing-noreturn :}
 .endif
-.if (defined(HAVE_GCC) && ${HAVE_GCC} >= 45 \
+.if (defined(HAVE_GCC) \
      && (${MACHINE_ARCH} == "coldfire" || \
 	 ${MACHINE_ARCH} == "sh3eb" || \
 	 ${MACHINE_ARCH} == "sh3el" || \

Index: src/share/mk/bsd.x11.mk
diff -u src/share/mk/bsd.x11.mk:1.112 src/share/mk/bsd.x11.mk:1.112.2.1
--- src/share/mk/bsd.x11.mk:1.112	Mon Mar 31 01:59:36 2014
+++ src/share/mk/bsd.x11.mk	Sun Aug 10 06:53:30 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.x11.mk,v 1.112 2014/03/31 01:59:36 mrg Exp $
+#	$NetBSD: bsd.x11.mk,v 1.112.2.1 2014/08/10 06:53:30 tls Exp $
 
 .include <bsd.init.mk>
 
@@ -322,7 +322,8 @@ ${_pkg}.pc: ${PKGDIST.${_pkg}}/configure
 		s,@GL_LIB@,GL,; \
 		s,@GL_PC_REQ_PRIV@,x11 xext,; \
 		s,@GL_PC_LIB_PRIV@,-lm -lpthread,; \
-		s,@GL_PC_CFLAGS@,," \
+		s,@GL_PC_CFLAGS@,,; \
+		s,@GLX_TLS@,no," \
 		-e "s,@GLU_LIB@,GLU,; \
 		s,@GLU_PC_REQ@,gl,; \
 		s,@GLU_PC_REQ_PRIV@,,; \

Index: src/share/mk/sys.mk
diff -u src/share/mk/sys.mk:1.123 src/share/mk/sys.mk:1.123.2.1
--- src/share/mk/sys.mk:1.123	Thu Apr  3 18:27:37 2014
+++ src/share/mk/sys.mk	Sun Aug 10 06:53:30 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: sys.mk,v 1.123 2014/04/03 18:27:37 riastradh Exp $
+#	$NetBSD: sys.mk,v 1.123.2.1 2014/08/10 06:53:30 tls Exp $
 #	@(#)sys.mk	8.2 (Berkeley) 3/21/94
 #
 # This file contains the basic rules for make(1) and is read first
@@ -28,8 +28,8 @@ CC?=		cc
 # -O2 is too -falign-* zealous for low-memory sh3 machines
 DBG?=	-Os -freorder-blocks
 .elif ${MACHINE_ARCH} == "m68k" || ${MACHINE_ARCH} == "m68000"
-# see src/doc/HACKS for details
-DBG?=	-Os
+# -freorder-blocks (enabled by -O2) produces much bigger code
+DBG?=	-O2 -fno-reorder-blocks
 .elif ${MACHINE_ARCH} == "coldfire"
 DBG?=	-O1
 .elif ${MACHINE_ARCH} == "vax"
@@ -47,11 +47,6 @@ CTFFLAGS	?=	-g -L VERSION
 # Use only one thread for now.
 CTFMFLAGS	?=	-S 1 -g -t -L VERSION
 
-# We have to define these here, because if we don't the rules below will
-# not work
-CTFCONVERT	?=	: ctfconvert
-CTFMERGE	?=	: ctfmerge
-
 CXX?=		c++
 CXXFLAGS?=	${CFLAGS:N-Wno-traditional:N-Wstrict-prototypes:N-Wmissing-prototypes:N-Wno-pointer-sign:N-ffreestanding:N-std=gnu[0-9][0-9]:N-Wold-style-definition:N-Wno-format-zero-length}
 
@@ -91,7 +86,7 @@ LFLAGS?=
 LEX.l?=		${LEX} ${LFLAGS}
 
 LINT?=		lint
-LINTFLAGS?=	-chapbxzFS
+LINTFLAGS?=	-chapbxzgFS
 
 LORDER?=	lorder
 
@@ -118,10 +113,10 @@ YACC.y?=	${YACC} ${YFLAGS}
 .c:
 	${LINK.c} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
 # XXX: disable for now
-#	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+#	${defined(CTFCONVERT):?${CTFCONVERT} ${CTFFLAGS} ${.TARGET}:}
 .c.o:
 	${COMPILE.c} ${.IMPSRC}
-	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+	${defined(CTFCONVERT):?${CTFCONVERT} ${CTFFLAGS} ${.TARGET}:}
 .c.a:
 	${COMPILE.c} ${.IMPSRC}
 	${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
@@ -146,7 +141,7 @@ YACC.y?=	${YACC} ${YFLAGS}
 	${LINK.f} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
 .f.o:
 	${COMPILE.f} ${.IMPSRC}
-	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+	${defined(CTFCONVERT):?${CTFCONVERT} ${CTFFLAGS} ${.TARGET}:}
 .f.a:
 	${COMPILE.f} ${.IMPSRC}
 	${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
@@ -154,10 +149,10 @@ YACC.y?=	${YACC} ${YFLAGS}
 
 .F:
 	${LINK.F} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
-	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+	${defined(CTFCONVERT):?${CTFCONVERT} ${CTFFLAGS} ${.TARGET}:}
 .F.o:
 	${COMPILE.F} ${.IMPSRC}
-	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+	${defined(CTFCONVERT):?${CTFCONVERT} ${CTFFLAGS} ${.TARGET}:}
 .F.a:
 	${COMPILE.F} ${.IMPSRC}
 	${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
@@ -167,7 +162,7 @@ YACC.y?=	${YACC} ${YFLAGS}
 	${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
 .r.o:
 	${COMPILE.r} ${.IMPSRC}
-	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+	${defined(CTFCONVERT):?${CTFCONVERT} ${CTFFLAGS} ${.TARGET}:}
 .r.a:
 	${COMPILE.r} ${.IMPSRC}
 	${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
@@ -176,10 +171,10 @@ YACC.y?=	${YACC} ${YFLAGS}
 # Pascal
 .p:
 	${LINK.p} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
-	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+	${defined(CTFCONVERT):?${CTFCONVERT} ${CTFFLAGS} ${.TARGET}:}
 .p.o:
 	${COMPILE.p} ${.IMPSRC}
-	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+	${defined(CTFCONVERT):?${CTFCONVERT} ${CTFFLAGS} ${.TARGET}:}
 .p.a:
 	${COMPILE.p} ${.IMPSRC}
 	${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
@@ -188,20 +183,20 @@ YACC.y?=	${YACC} ${YFLAGS}
 # Assembly
 .s:
 	${LINK.s} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
-	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+	${defined(CTFCONVERT):?${CTFCONVERT} ${CTFFLAGS} ${.TARGET}:}
 .s.o:
 	${COMPILE.s} ${.IMPSRC}
-	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+	${defined(CTFCONVERT):?${CTFCONVERT} ${CTFFLAGS} ${.TARGET}:}
 .s.a:
 	${COMPILE.s} ${.IMPSRC}
 	${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
 	rm -f ${.PREFIX}.o
 .S:
 	${LINK.S} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
-	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+	${defined(CTFCONVERT):?${CTFCONVERT} ${CTFFLAGS} ${.TARGET}:}
 .S.o:
 	${COMPILE.S} ${.IMPSRC}
-	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+	${defined(CTFCONVERT):?${CTFCONVERT} ${CTFFLAGS} ${.TARGET}:}
 .S.a:
 	${COMPILE.S} ${.IMPSRC}
 	${AR} ${ARFLAGS} ${.TARGET} ${.PREFIX}.o
@@ -218,7 +213,7 @@ YACC.y?=	${YACC} ${YFLAGS}
 .l.o:
 	${LEX.l} ${.IMPSRC}
 	${COMPILE.c} -o ${.TARGET} lex.yy.c
-	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+	${defined(CTFCONVERT):?${CTFCONVERT} ${CTFFLAGS} ${.TARGET}:}
 	rm -f lex.yy.c
 
 # Yacc
@@ -232,7 +227,7 @@ YACC.y?=	${YACC} ${YFLAGS}
 .y.o:
 	${YACC.y} ${.IMPSRC}
 	${COMPILE.c} -o ${.TARGET} y.tab.c
-	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+	${defined(CTFCONVERT):?${CTFCONVERT} ${CTFFLAGS} ${.TARGET}:}
 	rm -f y.tab.c
 
 # Shell

Reply via email to