summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--configure.ac4
-rw-r--r--man/Makefile.am76
3 files changed, 85 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 3f0b4ba..bd3ace8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-10-11 Alan Coopersmith <alan.coopersmith@sun.com>
+
+ * man/Makefile.am:
+ * configure.ac
+ Set up cpp pre-processing of man pages
+ Add shadow man pages for man pages that document multiple functions.
+
2005-07-08 Keith Packard <keithp@keithp.com>
* .cvsignore:
diff --git a/configure.ac b/configure.ac
index 6e0d379..b76ad3c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -40,6 +40,10 @@ AC_HEADER_STDC
XORG_RELEASE_VERSION
+# Man page processing requirements
+XORG_PROG_RAWCPP
+XORG_MANPAGE_SECTIONS
+
AC_OUTPUT([Makefile
man/Makefile
src/Makefile
diff --git a/man/Makefile.am b/man/Makefile.am
index dcb661a..d0ddd6e 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -1,4 +1,6 @@
-man3_MANS = \
+libmandir = $(mandir)/man$(LIB_MAN_SUFFIX)
+
+libman_SOURCES = \
DBE.man \
DPMSCapable.man \
DPMSDisable.man \
@@ -25,4 +27,74 @@ man3_MANS = \
Xevi.man \
Xmbuf.man
-EXTRA_DIST=$(man3_MANS)
+XShape_man_aliases = XShapeQueryExtension XShapeQueryVersion XShapeCombineRegion XShapeCombineRectangles XShapeCombineMask XShapeCombineShape XShapeOffsetShape XShapeQueryExtents XShapeSelectInput XShapeInputSelected XShapeGetRectangles
+
+Xmbuf_man_aliases = XmbufQueryExtension XmbufGetVersion XmbufCreateBuffers XmbufDestroyBuffers XmbufDisplayBuffers XmbufGetWindowAttributes XmbufChangeWindowAttributes XmbufGetBufferAttributes XmbufChangeBufferAttributes XmbufGetScreenInfo XmbufCreateStereoWindow
+
+Xevi_man_aliases = XeviQueryVersion XeviGetVisualInfo XeviQueryExtension
+
+all_aliases = $(XShape_man_aliases) $(Xmbuf_man_aliases) $(Xevi_man_aliases)
+
+libman_DATA = $(libman_SOURCES:man=$(LIB_MAN_SUFFIX)) \
+ $(all_aliases:=.$(LIB_MAN_SUFFIX))
+
+EXTRA_DIST = $(libman_SOURCES)
+
+CLEANFILES = $(libman_DATA)
+
+# Generate man page shadow files (Replaces InstallManPageAliases from Imake)
+BUILT_SOURCES = .shadows.DONE
+
+.shadows.DONE:
+ -rm -f $(all_aliases:=.$(LIB_MAN_SUFFIX))
+ (for i in $(XShape_man_aliases:=.$(LIB_MAN_SUFFIX)) ; do \
+ echo .so man$(LIB_MAN_SUFFIX)/XShape.$(LIB_MAN_SUFFIX) > $$i; \
+ done)
+ (for i in $(Xmbuf_man_aliases:=.$(LIB_MAN_SUFFIX)) ; do \
+ echo .so man$(LIB_MAN_SUFFIX)/Xmbuf.$(LIB_MAN_SUFFIX) > $$i; \
+ done)
+ (for i in $(Xevi_man_aliases:=.$(LIB_MAN_SUFFIX)) ; do \
+ echo .so man$(LIB_MAN_SUFFIX)/Xevi.$(LIB_MAN_SUFFIX) > $$i; \
+ done)
+ touch .shadows.DONE
+
+# Rules for generating files using the C pre-processor
+# (Replaces CppFileTarget from Imake)
+
+SED = sed
+
+SUFFIXES = .$(LIB_MAN_SUFFIX) .man
+
+# 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/\@\@$$/\\/'
+
+# Strings to replace in man pages
+XORGRELSTRING = @PACKAGE_STRING@
+ XORGMANNAME = X Version 11
+ XSERVERNAME = Xorg
+
+MANDEFS = \
+ -D__vendorversion__="\"$(XORGRELSTRING)\" \"$(XORGMANNAME)\"" \
+ -D__xorgversion__="\"$(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__projectroot__=$(prefix)
+
+.man.$(LIB_MAN_SUFFIX):
+ $(RAWCPP) $(RAWCPPFLAGS) $(MANDEFS) $(EXTRAMANDEFS) < $< | $(CPP_SED_MAGIC) > $@
+