[PATCH] Convert sisusb.man from XORG_RAWCPP to using sed like other drivers

Alan Coopersmith alan.coopersmith at oracle.com
Sat Jun 4 21:07:36 PDT 2011


Upgrade to util-macros 1.8 for additional man page support

Use MAN_SUBST now supplied in XORG_MANPAGE_SECTIONS
The value of MAN_SUBST is the same for all X.Org packages.

Use AC_PROG_SED now supplied by XORG_DEFAULT_OPTIONS
The existing statement can now be removed from the configuration file.

Use automake provided $(AM_V_GEN) and XORG_DEFAULT_OPTIONS provided $(SED)
Enables silent rule and use platform appropriate version of sed.

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 configure.ac    |    7 +++----
 man/Makefile.am |   34 ++--------------------------------
 man/sisusb.man  |   18 ++----------------
 3 files changed, 7 insertions(+), 52 deletions(-)

diff --git a/configure.ac b/configure.ac
index 3c7f3fb..1a426b1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -34,16 +34,15 @@ AC_CONFIG_AUX_DIR(.)
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE
 
-# Require xorg-macros: XORG_DEFAULT_OPTIONS
+# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
 m4_ifndef([XORG_MACROS_VERSION],
-          [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
-XORG_MACROS_VERSION(1.3)
+          [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.8)
 XORG_DEFAULT_OPTIONS
 
 # Initialize libtool
 AC_DISABLE_STATIC
 AC_PROG_LIBTOOL
-XORG_PROG_RAWCPP
 
 AH_TOP([#include "xorg-server.h"])
 
diff --git a/man/Makefile.am b/man/Makefile.am
index 1b26ac2..9ceb36f 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -31,39 +31,9 @@ EXTRA_DIST = @DRIVER_NAME at .man
 
 CLEANFILES = $(driverman_DATA)
 
-SED = sed
-
-# Strings to replace in man pages
-XORGRELSTRING = @PACKAGE_STRING@
-  XORGMANNAME = X Version 11
-
-MANDEFS =  \
-	-D__vendorversion__="\"$(XORGRELSTRING)\" \"$(XORGMANNAME)\"" \
-	-D__appmansuffix__=$(APP_MAN_SUFFIX) \
-	-D__filemansuffix__=$(FILE_MAN_SUFFIX) \
-	-D__libmansuffix__=$(LIB_MAN_SUFFIX) \
-	-D__miscmansuffix__=$(MISC_MAN_SUFFIX) \
-	-D__drivermansuffix__=$(DRIVER_MAN_SUFFIX) \
-	-D__adminmansuffix__=$(ADMIN_MAN_SUFFIX) \
-	-D__xconfigfile__=xorg.conf \
-	-D__xservername__=Xorg
-
-# Translate XCOMM into pound sign with sed, rather than passing -DXCOMM=XCOMM
-# to cpp, because that trick does not work on all ANSI C preprocessors.
-# Delete line numbers from the cpp output (-P is not portable, I guess).
-# Allow XCOMM to be preceded by whitespace and provide a means of generating
-# output lines with trailing backslashes.
-# Allow XHASH to always be substituted, even in cases where XCOMM isn't.
-
-CPP_SED_MAGIC = $(SED) -e '/^\#  *[0-9][0-9]*  *.*$$/d' \
-                       -e '/^\#line  *[0-9][0-9]*  *.*$$/d' \
-                       -e '/^[         ]*XCOMM$$/s/XCOMM/\#/' \
-                       -e '/^[         ]*XCOMM[^a-zA-Z0-9_]/s/XCOMM/\#/' \
-                       -e '/^[         ]*XHASH/s/XHASH/\#/' \
-                       -e '/\@\@$$/s/\@\@$$/\\/'
-
 SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man
 
+# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
 .man.$(DRIVER_MAN_SUFFIX):
-	$(RAWCPP) $(RAWCPPFLAGS) $(MANDEFS) $(EXTRAMANDEFS) < $< | $(CPP_SED_MAGIC) > $@
+	$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
 
diff --git a/man/sisusb.man b/man/sisusb.man
index 606c2de..6eafb8e 100644
--- a/man/sisusb.man
+++ b/man/sisusb.man
@@ -1,15 +1,5 @@
 .\" shorthand for double quote that works everywhere.
 .ds q \N'34'
-#ifdef __xservername__
-#define __myservername__ __xservername__
-#else
-#define __myservername__ XFree86
-#endif
-#ifdef __xconfigfile__
-#define __myxconfigfile__ __xconfigfile__
-#else
-#define __myxconfigfile__ XF86Config
-#endif
 .TH SISUSB __drivermansuffix__ __vendorversion__
 .SH NAME
 sisusb \- SiS USB video driver
@@ -23,7 +13,7 @@ sisusb \- SiS USB video driver
 .fi
 .SH DESCRIPTION
 .B sisusb
-is an __myservername__ driver for SiS (Silicon Integrated Systems) video chips that
+is an __xservername__ driver for SiS (Silicon Integrated Systems) video chips that
 are connected via a Net2280-based USB dongle. The driver is not accelerated, but
 provides support for colordepths of 8, 16 and 24 bpp as well as Render and other
 extensions.
@@ -37,7 +27,7 @@ driver supports USB video cards based on the following chipsets:
 The SiS315E/PRO features two CRT controllers. However, in its USB version, only
 the first output, referred to as "CRT1", is being used.
 .SH CONFIGURATION DETAILS
-Please refer to __myxconfigfile__(__filemansuffix__) for general configuration
+Please refer to __xconfigfile__(__filemansuffix__) for general configuration
 details and to sis(__drivermansuffix__) for more information. This manpage only
 covers a subset of the supported options.
 .PP
@@ -79,11 +69,7 @@ for device reconnection).
 .SH "KNOWN BUGS"
 none.
 .SH "SEE ALSO"
-#ifdef __xservername__
 __xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__), sis(__drivermansuffix__)
-#else
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__), sis(__drivermansuffix__)
-#endif
 .PP
 .B "http://www.winischhofer.at/linuxsisvga.shtml"
 for more information and updates
-- 
1.7.3.2



More information about the xorg-devel mailing list