[PATCH xserver 06/15] XWin: build XWin man pages using XORG_MANPAGE_SECTIONS

Gaetan Nadon memsize at videotron.ca
Sun Jan 9 17:27:50 PST 2011


Nothing requires the use of a C preprocessor
Using standard file extensions (.man) means no need for .gitignore
Use standard directory and makefile
Now can be built easily on any platform in the man directory

Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
Reviewed-by: Rémi Cardona <remi at gentoo.org>
Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
---
 configure.ac                               |    1 +
 hw/xwin/.gitignore                         |    3 ---
 hw/xwin/Makefile.am                        |   27 +++------------------------
 hw/xwin/man/Makefile.am                    |   21 +++++++++++++++++++++
 hw/xwin/{XWin.man.pre => man/XWin.man}     |    0
 hw/xwin/{XWinrc.man.pre => man/XWinrc.man} |    0
 6 files changed, 25 insertions(+), 27 deletions(-)
 create mode 100644 hw/xwin/man/Makefile.am
 rename hw/xwin/{XWin.man.pre => man/XWin.man} (100%)
 rename hw/xwin/{XWinrc.man.pre => man/XWinrc.man} (100%)

diff --git a/configure.ac b/configure.ac
index cab7fa7..81e5a8e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2246,6 +2246,7 @@ hw/xnest/Makefile
 hw/xnest/man/Makefile
 hw/xwin/Makefile
 hw/xwin/glx/Makefile
+hw/xwin/man/Makefile
 hw/xquartz/Makefile
 hw/xquartz/GL/Makefile
 hw/xquartz/bundle/Makefile
diff --git a/hw/xwin/.gitignore b/hw/xwin/.gitignore
index a8c3a28..bc4986c 100644
--- a/hw/xwin/.gitignore
+++ b/hw/xwin/.gitignore
@@ -1,6 +1,3 @@
-#		Add & Override for this directory and it's subdirectories
 winprefslex.c
 winprefsyacc.c
 winprefsyacc.h
-XWin.man
-XWinrc.man
diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am
index 232d65e..f6a75df 100644
--- a/hw/xwin/Makefile.am
+++ b/hw/xwin/Makefile.am
@@ -156,7 +156,7 @@ winprefsyacc.h: winprefsyacc.c
 winprefslex.c: winprefslex.l winprefsyacc.c winprefsyacc.h
 
 BUILT_SOURCES = winprefsyacc.h winprefsyacc.c winprefslex.c
-CLEANFILES = $(BUILT_SOURCES) $(appman_DATA) $(fileman_DATA) XWin.man XWinrc.man
+CLEANFILES = $(BUILT_SOURCES)
 
 AM_YFLAGS = -d
 AM_LFLAGS = -i
@@ -165,34 +165,13 @@ AM_CFLAGS = -DHAVE_XWIN_CONFIG_H $(DIX_CFLAGS) \
             -I$(top_srcdir) \
             -Wno-bad-function-cast
 
-MAN_SRCS = XWin.man.pre XWinrc.man.pre
-
-appmandir = $(APP_MAN_DIR)
-appman_DATA = XWin.$(APP_MAN_SUFFIX)
-
-filemandir = $(FILE_MAN_DIR)
-fileman_DATA = XWinrc.$(FILE_MAN_SUFFIX)
-
-XWin.$(APP_MAN_SUFFIX): XWin.man
-	-$(AM_V_at)rm -f XWin.$(APP_MAN_SUFFIX)
-	$(AM_V_at)$(LN_S) XWin.man XWin.$(APP_MAN_SUFFIX)
-
-XWinrc.$(FILE_MAN_SUFFIX): XWinrc.man
-	-$(AM_V_at)rm -f XWinrc.$(FILE_MAN_SUFFIX)
-	$(AM_V_at)$(LN_S) XWinrc.man XWinrc.$(FILE_MAN_SUFFIX)
-
-EXTRAMANDEFS = -D__logdir__=$(logdir) -D__sysconfdir__=$(sysconfdir) -D__datadir__=$(datadir)
-
 xwinconfigdir = $(sysconfdir)/X11
 xwinconfig_DATA = system.XWinrc
 
-include $(top_srcdir)/cpprules.in
-
 install-exec-hook:
 	(cd $(DESTDIR)$(bindir) && rm -f X && $(LN_S) XWin$(EXEEXT) X)
 
 EXTRA_DIST = \
-	$(MAN_SRCS) \
 	$(xwinconfig_DATA) \
 	X.ico \
 	XWin.rc \
@@ -220,5 +199,5 @@ EXTRA_DIST = \
 relink:
 	$(AM_V_at)rm -f XWin$(EXEEXT) && $(MAKE) XWin$(EXEEXT)
 
-SUBDIRS = $(GLX_DIR) .
-DIST_SUBDIRS = glx .
+SUBDIRS = man $(GLX_DIR) .
+DIST_SUBDIRS = man glx .
diff --git a/hw/xwin/man/Makefile.am b/hw/xwin/man/Makefile.am
new file mode 100644
index 0000000..98a89a5
--- /dev/null
+++ b/hw/xwin/man/Makefile.am
@@ -0,0 +1,21 @@
+appmandir = $(APP_MAN_DIR)
+appman_PRE = XWin.man
+appman_DATA = $(appman_PRE:man=$(APP_MAN_SUFFIX))
+
+filemandir = $(FILE_MAN_DIR)
+fileman_PRE = XWinrc.man
+fileman_DATA = $(fileman_PRE:man=$(FILE_MAN_SUFFIX))
+
+EXTRA_DIST = $(appman_PRE) $(fileman_PRE)
+CLEANFILES = $(appman_DATA) $(fileman_DATA)
+SUFFIXES = .$(APP_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man
+
+# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
+MAN_SUBSTS += 	-e 's|__logdir__|$(logdir)|g' \
+		-e 's|__datadir__|$(datadir)|g' \
+		-e 's|__sysconfdir__|$(sysconfdir)|g'
+
+.man.$(APP_MAN_SUFFIX):
+	$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
+.man.$(FILE_MAN_SUFFIX):
+	$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
diff --git a/hw/xwin/XWin.man.pre b/hw/xwin/man/XWin.man
similarity index 100%
rename from hw/xwin/XWin.man.pre
rename to hw/xwin/man/XWin.man
diff --git a/hw/xwin/XWinrc.man.pre b/hw/xwin/man/XWinrc.man
similarity index 100%
rename from hw/xwin/XWinrc.man.pre
rename to hw/xwin/man/XWinrc.man
-- 
1.6.0.4



More information about the xorg-devel mailing list