From dc963f6d676d1735144ff3997c0ab5bf7cc3889f Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 7 Jan 2011 16:06:40 -0800 Subject: Use and _PATH_MAILDIR to find mailboxes if present Use autoconf to check for paths.h on all systems, instead of only including it #ifdef CSRG_BASED Makes _PATH_MAILDIR the preferred mail directory path on all systems if it's defined, falls back to old per-system hardcoded paths if not. Signed-off-by: Alan Coopersmith Reviewed-by: Mark Kettenis Reviewed-by: Dan Nicholson --- MailboxP.h | 26 ++++++++++++++------------ configure.ac | 3 +++ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/MailboxP.h b/MailboxP.h index 937f895..f21d62a 100644 --- a/MailboxP.h +++ b/MailboxP.h @@ -33,24 +33,26 @@ from the X Consortium. #ifndef _XawMailboxP_h #define _XawMailboxP_h +#include "config.h" #include "Mailbox.h" #include -#if defined(SYSV) -#define MAILBOX_DIRECTORY "/usr/mail" -#elif defined(SVR4) -#define MAILBOX_DIRECTORY "/var/mail" -#elif defined(CSRG_BASED) -#include -#ifdef _PATH_MAILDIR -#define MAILBOX_DIRECTORY _PATH_MAILDIR -#endif -#elif defined(__linux__) -#define MAILBOX_DIRECTORY "/var/spool/mail" +#ifdef HAVE_PATHS_H +# include #endif #ifndef MAILBOX_DIRECTORY -#define MAILBOX_DIRECTORY "/usr/spool/mail" +# ifdef _PATH_MAILDIR +# define MAILBOX_DIRECTORY _PATH_MAILDIR +# elif defined(SYSV) +# define MAILBOX_DIRECTORY "/usr/mail" +# elif defined(SVR4) +# define MAILBOX_DIRECTORY "/var/mail" +# elif defined(__linux__) +# define MAILBOX_DIRECTORY "/var/spool/mail" +# else +# define MAILBOX_DIRECTORY "/usr/spool/mail" +# endif #endif typedef struct { /* new fields for mailbox widget */ diff --git a/configure.ac b/configure.ac index 5891c6c..05937be 100644 --- a/configure.ac +++ b/configure.ac @@ -41,4 +41,7 @@ XORG_DEFAULT_OPTIONS # Checks for pkg-config packages PKG_CHECK_MODULES(XBIFF, xaw7 xmu xbitmaps xext x11) +# Checks for headers +AC_CHECK_HEADERS([paths.h]) + AC_OUTPUT([Makefile]) -- cgit v1.2.3