Migrating away from using cpp for startx and xinitrc in xinit

Matthieu Herrb matthieu at herrb.eu
Tue Feb 10 05:01:52 PST 2015

On Tue, Feb 10, 2015 at 12:40:32AM -0800, Jeremy Huddleston Sequoia wrote:
> > On Feb 10, 2015, at 00:35, Hans de Goede <hdegoede at redhat.com> wrote:
> > 
> > Hi,
> > 
> > On 10-02-15 08:39, Jeremy Huddleston Sequoia wrote:
> >> It seems that using cpp for startx and xinitrc in the xinit port is coming back to bite us now as different C preprocessors don't exactly process non-C files in ways that we might want.
> >> 
> >> https://trac.macports.org/ticket/46811#comment:4
> >> 
> >> Does anyone have any strong opinions about this state of affairs and how we should address it?  If not, I'll mull it over for a while and try to figure something out.
> > 
> > startx is quite fragile, I think it may be best to just fix things
> > so that they do work with the cpp from llvm, e.g. replace the #
> > comments with /* ... */ comments might be all that is necessary.
> My experience (failing) to get xmkmf/imake working with llvm's cpp
> makes me see this as a weak link that should be more properly dealt
> with rather than just patched up with more duct tape. 

In the case of startx / xinitrc I think it is possible to get rid of
cpp without too much difficulty. It's doing static substitutions at
build time only.

The case of xrdb is more problematic. There the use of cpp to
preprocess resources files at run time is a feature (and it depends on
a "traditional" pre-processour). For this case using tradcpp (pointed
out by Thomas Klausner further down this thread) is indeed the way to

Matthieu Herrb

More information about the xorg-devel mailing list