summaryrefslogtreecommitdiff
path: root/hw/xquartz/bundle/cpprules.in
diff options
context:
space:
mode:
authorroot <root@zombrain.(none)>2011-07-25 08:54:41 (GMT)
committerroot <root@zombrain.(none)>2011-07-25 08:54:41 (GMT)
commitab4fcaad149d4bdccefa8f693c2a8e044b40dd4c (patch)
treec95c280caabc70e7aedbde723e38820047357be7 /hw/xquartz/bundle/cpprules.in
initial state (xorg-server 1.10.2)
Diffstat (limited to 'hw/xquartz/bundle/cpprules.in')
-rw-r--r--hw/xquartz/bundle/cpprules.in19
1 files changed, 19 insertions, 0 deletions
diff --git a/hw/xquartz/bundle/cpprules.in b/hw/xquartz/bundle/cpprules.in
new file mode 100644
index 0000000..92a987d
--- /dev/null
+++ b/hw/xquartz/bundle/cpprules.in
@@ -0,0 +1,19 @@
+# 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 '/XSLASHGLOB/s/XSLASHGLOB/\/\*/' \
+ -e '/\@\@$$/s/\@\@$$/\\/'
+
+SUFFIXES = .cpp
+
+.cpp:
+ $(AM_V_GEN)$(RAWCPP) $(RAWCPPFLAGS) $(CPP_FILES_FLAGS) < $< | $(CPP_SED_MAGIC) > $@
contact: Jan Huwald // Impressum