[PATCH:xbiff] Convert checks for mailbox directory from ifdefs to autoconf tests

Alan Coopersmith alan.coopersmith at oracle.com
Mon Nov 1 10:45:00 PDT 2010


Mark Kettenis wrote:
>> From: Alan Coopersmith <alan.coopersmith at oracle.com>
>> Date: Sun, 31 Oct 2010 13:45:15 -0700
> 
> I'm not quite sure this is a good idea.  The outcome of the autoconf
> checks you're introducing depends on particularities of the build
> system.  I have seen setups where sysadmins have created /var/mail by
> hand where the system default was /var/spool/mail.  An xbiff binary
> compiled on such a system would not work on an unmodified system.
> 
> Not sure this really matters.  Most modern systems provide a BSD-style
> <paths.h> and on Solaris /var/mail seems to be the preferred mail
> directory and that's the one you check first.
> 
> The check defenitely won't work for cross-compilation though.

There are three intertwined changes here:

 1. If <paths.h> exists include it, and if _PATH_MAILDIR is defined
    use it - regardless of #ifdef CSRG_BASED

 2. Allow the builder to override the directory manually

 3. If neither of those work, then check the common directories on
    build systems, in approximate order of newest to oldest.

1 seems like a clear win - I hadn't noticed Linux also provides it,
but now that you mentioned it, I checked the window running Fedora 14
in a VirtualBox and see it, so that makes even more sense to me.

The concept of 2 also seems like a win - though I accept Dan's comment
that a --with flag might be nicer interface than a variable.

For 3, the question is then which is a more reliable fallback - running
test -d on the build system or maintaining a list of OS -> directory
mappings, either in the *.h or configure.ac.

Of course, this is all just for the default case, which can be overridden
at runtime with either the -file option or the MAIL environment variable.

Not that xbiff is very useful in the world where most users get mail via
IMAP, POP or http instead of a local mail spool, but there it is.  [Hmm,
xbiff -feed http://something/foo.rss ?   Not that I have the time or
desire to write that code, but patches may be accepted from anyone who
thinks that would be useful.  Bonus points if it flashes red when the
URL is a tinderbox that just detected build failure. 8-) ]

-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System



More information about the xorg-devel mailing list