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

Alan Coopersmith alan.coopersmith at oracle.com
Sat Jun 4 21:03:09 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/sis.man     |   18 ++----------------
 3 files changed, 7 insertions(+), 52 deletions(-)

diff --git a/configure.ac b/configure.ac
index a4db907..8920c6f 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/sis.man b/man/sis.man
index 9167545..578bb68 100644
--- a/man/sis.man
+++ b/man/sis.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 SIS __drivermansuffix__ __vendorversion__
 .SH NAME
 sis \- SiS and XGI video driver
@@ -23,7 +13,7 @@ sis \- SiS and XGI video driver
 .fi
 .SH DESCRIPTION
 .B sis
-is an __myservername__ driver for SiS (Silicon Integrated Systems) and XGI video
+is an __xservername__ driver for SiS (Silicon Integrated Systems) and XGI video
 chips. The driver is accelerated and provides support for colordepths of 8, 16
 and 24 bpp. XVideo, Render and other extensions are supported as well.
 .SH SUPPORTED HARDWARE
@@ -58,7 +48,7 @@ for SiS315, 55x, 330, 661/741/76x (plus M, FX, MX, GX variants thereof), 340
 and all XGI chips.
 .PP
 .SH CONFIGURATION DETAILS
-Please refer to __myxconfigfile__(__filemansuffix__) for general configuration
+Please refer to __xconfigfile__(__filemansuffix__) for general configuration
 details.  This section only covers configuration details specific to this
 driver.
 .PP
@@ -426,11 +416,7 @@ The amount is to be specified in megabyte, the default is 8.
 .SH "KNOWN BUGS"
 none.
 .SH "SEE ALSO"
-#ifdef __xservername__
 __xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__)
-#else
-XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__)
-#endif
 .PP
 .B "http://www.winischhofer.eu/linuxsisvga.shtml"
 for more information and updates
-- 
1.7.3.2



More information about the xorg-devel mailing list