Module Name:    src
Committed By:   mrg
Date:           Mon Aug 10 09:23:37 UTC 2020

Modified Files:
        src/external/mit/xorg/server/xorg-server/doc: Makefile
        src/external/mit/xorg/server/xorg-server/hw/xfree86/doc: Makefile
        src/share/mk: bsd.x11.mk

Log Message:
fix various missing transforms for man page, ala PR#55422.

add method to transform both the "__foo__" and "@foo@"
version of various transforms, while upstream are converting
from the former to the latter it seems.  convert all the
common transforms to this method.

expand the grep for .pc files to look for missing @foo@
fixes to the man page genration, and ignore a few things
(thanks uwe@ - .IN lines, and stuff between tab(@) and .TE.)

xorg-server __default_font_path__ -> @default_font_path@,
and xfree86 transform xconfigdir, xkbdir, and modulepath
using new both method.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
    src/external/mit/xorg/server/xorg-server/doc/Makefile
cvs rdiff -u -r1.7 -r1.8 \
    src/external/mit/xorg/server/xorg-server/hw/xfree86/doc/Makefile
cvs rdiff -u -r1.135 -r1.136 src/share/mk/bsd.x11.mk

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

Modified files:

Index: src/external/mit/xorg/server/xorg-server/doc/Makefile
diff -u src/external/mit/xorg/server/xorg-server/doc/Makefile:1.5 src/external/mit/xorg/server/xorg-server/doc/Makefile:1.6
--- src/external/mit/xorg/server/xorg-server/doc/Makefile:1.5	Sun Aug 14 00:03:58 2016
+++ src/external/mit/xorg/server/xorg-server/doc/Makefile	Mon Aug 10 09:23:37 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.5 2016/08/14 00:03:58 mrg Exp $
+#	$NetBSD: Makefile,v 1.6 2020/08/10 09:23:37 mrg Exp $
 
 .include <bsd.own.mk>
 
@@ -7,7 +7,7 @@
 .PATH: ${X11SRCDIR.xorg-server}/doc
 .PATH: ${X11SRCDIR.xorg-server}/man
 MAN=	Xserver.1
-X11EXTRAMANDEFS+=	-e 's%__default_font_path__%${X11DEFAULTFONTPATH:ts,:S/,/, /g}%g'
+X11EXTRAMANDEFS+=	-e 's%@default_font_path@%${X11DEFAULTFONTPATH:ts,:S/,/, /g}%g'
 
 .include <bsd.x11.mk>
 .include <bsd.man.mk>

Index: src/external/mit/xorg/server/xorg-server/hw/xfree86/doc/Makefile
diff -u src/external/mit/xorg/server/xorg-server/hw/xfree86/doc/Makefile:1.7 src/external/mit/xorg/server/xorg-server/hw/xfree86/doc/Makefile:1.8
--- src/external/mit/xorg/server/xorg-server/hw/xfree86/doc/Makefile:1.7	Sun Aug 14 03:43:04 2016
+++ src/external/mit/xorg/server/xorg-server/hw/xfree86/doc/Makefile	Mon Aug 10 09:23:37 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.7 2016/08/14 03:43:04 mrg Exp $
+#	$NetBSD: Makefile,v 1.8 2020/08/10 09:23:37 mrg Exp $
 
 .include <bsd.own.mk>
 
@@ -12,5 +12,10 @@ FILESDIR=	${X11USRLIBDIR}/X11/doc
 MAN=	Xorg.1 xorg.conf.5
 # xorg.conf.d.5?
 
+X11EXTRAMANTRANSFORMS_BOTH+= \
+	xconfigdir		xorg.conf.d \
+	xkbdir			${X11LIBDIR}/xkb \
+	modulepath		${X11ROOTDIR}/modules
+
 .include <bsd.x11.mk>
 .include <bsd.prog.mk>

Index: src/share/mk/bsd.x11.mk
diff -u src/share/mk/bsd.x11.mk:1.135 src/share/mk/bsd.x11.mk:1.136
--- src/share/mk/bsd.x11.mk:1.135	Mon Jul 20 13:55:08 2020
+++ src/share/mk/bsd.x11.mk	Mon Aug 10 09:23:37 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.x11.mk,v 1.135 2020/07/20 13:55:08 tsutsui Exp $
+#	$NetBSD: bsd.x11.mk,v 1.136 2020/08/10 09:23:37 mrg Exp $
 
 .include <bsd.init.mk>
 
@@ -136,7 +136,7 @@ XORG_SERVER_TEENY=	6
 XORG_SERVER_MINOR=	20
 XORG_SERVER_TEENY=	6
 .endif
-  
+
 XVENDORNAMESHORT=	'"X.Org"'
 XVENDORNAME=		'"The X.Org Foundation"'
 XORG_RELEASE=		'"Release ${XORG_SERVER_MAJOR}.${XORG_SERVER_MINOR}.${XORG_SERVER_TEENY}"'
@@ -194,6 +194,15 @@ realall: ${CPPSCRIPTS}
 CLEANFILES+= ${CPPSCRIPTS}
 .endif								# }
 
+# Used by pkg-config and manual handling to ensure we picked up all
+# the necessary changes.
+#
+# Skip any line that starts with .IN (old X11 indexing method),
+# or between a tab(@) and .TE.
+_X11SKIP_FALSE_POSITIVE_GREP_CMD= \
+	${TOOL_SED} -e '/tab(@)/,/^\.TE/d' -e '/^\.IN /d' ${.TARGET}.tmp | \
+	${TOOL_GREP} -E '@([^ 	]+)@'
+
 #
 # X.Org pkgconfig files handling
 #
@@ -356,14 +365,13 @@ ${_pkg}.pc: ${PKGDIST.${_pkg}}/configure
 		s,@FREETYPE_CFLAGS@,-I${X11ROOTDIR}/include/freetype2 -I${X11ROOTDIR}/include,;" \
 		-e '/^Libs:/ s%-L\([^ 	]*\)%-Wl,-rpath,\1 &%g' \
 		< ${.IMPSRC} > ${.TARGET}.tmp
-	if ${TOOL_GREP} '@.*@' ${.TARGET}.tmp; then \
-		echo "${.TARGET} matches @.*@, probably missing updates" 1>&2; \
+	if ${_X11SKIP_FALSE_POSITIVE_GREP_CMD}; then \
+		echo "pkg-config ${.TARGET} matches @.*@, probably missing updates" 1>&2; \
 		false; \
 	else \
 		${MV} ${.TARGET}.tmp ${.TARGET}; \
 	fi
 
-
 CLEANFILES+= ${_PKGCONFIG_FILES} ${_PKGCONFIG_FILES:C/$/.tmp/}
 .endif
 
@@ -396,40 +404,53 @@ CLEANDIRFILES+= ${MAN:U${PROG:D${PROG.1}
 
 .SUFFIXES:	.man .man.pre .1 .3 .4 .5 .7
 
-_X11MANTRANSFORM= \
-	${X11EXTRAMANTRANSFORMS} \
-	__adminmansuffix__	8 \
-	__apploaddir__		${X11ROOTDIR}/lib/X11/app-defaults \
-	__appmansuffix__ 	1 \
-	__bindir__		${X11BINDIR} \
-	__datadir__		${X11LIBDIR} \
-	__libdir__		${X11ROOTDIR}/lib \
-	__xkbconfigroot__	${X11LIBDIR}/xkb \
-	__sysconfdir__		/etc \
-	__drivermansuffix__	4 \
-	__filemansuffix__	5 \
-	__LIB_MAN_SUFFIX__	3 \
-	__libmansuffix__	3 \
-	__logdir__		/var/log \
-	__mandir__		${X11MANDIR} \
-	__miscmansuffix__	7 \
-	__oslibmansuffix__	3 \
-	__projectroot__		${X11ROOTDIR}
-
 # Note the escaping trick for _X11MANTRANSFORM using % to replace spaces
 XORGVERSION=	'"X Version 11"'
-X11MANCPP?=	no
+
+_X11MANTRANSFORM= \
+	${X11EXTRAMANTRANSFORMS}
+
+# These ones used to appear as __foo__ but may be now @foo@.
+_X11MANTRANSFORMS_BOTH=\
+	${X11EXTRAMANTRANSFORMS_BOTH} \
+	appmansuffix		1 \
+	LIB_MAN_SUFFIX		3 \
+	libmansuffix		3 \
+	oslibmansuffix		3 \
+	drivermansuffix		4 \
+	filemansuffix		5 \
+	miscmansuffix		7 \
+	adminmansuffix		8 \
+	logdir			/var/log \
+	sysconfdir		/etc \
+	apploaddir		${X11ROOTDIR}/lib/X11/app-defaults \
+	bindir			${X11BINDIR} \
+	datadir			${X11LIBDIR} \
+	libdir			${X11ROOTDIR}/lib \
+	mandir			${X11MANDIR} \
+	projectroot		${X11ROOTDIR} \
+	xkbconfigroot		${X11LIBDIR}/xkb \
+	vendorversion		${XORGVERSION:C/ /%/gW} \
+	XCONFIGFILE		xorg.conf \
+	xconfigfile		xorg.conf \
+	XCONFIGFILEMAN		'xorg.conf(5)' \
+	xorgversion		${XORGVERSION:C/ /%/gW} \
+	XSERVERNAME		Xorg \
+	xservername		Xorg
+
+.for __def__ __value__ in ${_X11MANTRANSFORMS_BOTH}
+_X11MANTRANSFORM+= \
+	__${__def__}__		${__value__} \
+	@${__def__}@		${__value__}
+.endfor
+
 _X11MANTRANSFORM+= \
-	__vendorversion__	${XORGVERSION:C/ /%/gW} \
-	__XCONFIGFILE__		xorg.conf \
-	__xconfigfile__		xorg.conf \
-	__XCONFIGFILEMAN__	'xorg.conf(5)' \
-	__xorgversion__		${XORGVERSION:C/ /%/gW} \
-	__XSERVERNAME__		Xorg \
-	__xservername__		Xorg
 
 _X11MANTRANSFORMCMD=	${TOOL_SED} -e 's/\\$$/\\ /' ${.IMPSRC}
 
+# XXX document me.
+X11MANCPP?=	no
+
 .if ${X11MANCPP} != "no"
 _X11MANTRANSFORMCMD+=	| ${CC} -E -undef -traditional -
 . for __def__ __value__ in ${_X11MANTRANSFORM}
@@ -446,7 +467,13 @@ _X11MANTRANSFORMCMD+=	${X11EXTRAMANDEFS}
 .man.1 .man.3 .man.4 .man.5 .man.7 .man.pre.1 .man.pre.4 .man.pre.5:
 	${_MKTARGET_CREATE}
 	rm -f ${.TARGET}
-	${_X11MANTRANSFORMCMD} | ${X11TOOL_UNXCOMM} > ${.TARGET}
+	${_X11MANTRANSFORMCMD} | ${X11TOOL_UNXCOMM} > ${.TARGET}.tmp
+	if ${_X11SKIP_FALSE_POSITIVE_GREP_CMD}; then \
+		echo "manual ${.TARGET} matches @.*@, probably missing updates" 1>&2; \
+		false; \
+	else \
+		${MV} ${.TARGET}.tmp ${.TARGET}; \
+	fi
 
 ##### Pull in related .mk logic
 .include <bsd.clean.mk>

Reply via email to