From 7490175bc38099aa093715116b8d96e7319e7ca4 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 9 May 2010 17:07:47 -0700 Subject: [PATCH] Move MAIL_USE_FLOCK, MAIL_USE_LOCKF, BLESSMAIL_TARGET from cpp to configure. * configure.in (MAIL_USE_FLOCK, MAIL_USE_LOCKF): New AC_DEFINEs. (BLESSMAIL_TARGET): New output variable. * lib-src/Makefile.in (BLESSMAIL_TARGET): Set with configure, not cpp. * src/s/aix4-2.h (MAIL_USE_LOCKF): * src/s/bsd-common.h (MAIL_USE_FLOCK): * src/s/darwin.h (MAIL_USE_FLOCK): * src/s/gnu-linux.h (MAIL_USE_FLOCK): * src/s/irix6-5.h (MAIL_USE_FLOCK): * src/s/template.h (MAIL_USE_FLOCK): Move to configure. * src/s/ms-w32.h: Comment. * msdos/sed3v2.inp (BLESSMAIL_TARGET): Edit to need-blessmail. --- ChangeLog | 5 +++++ configure.in | 42 ++++++++++++++++++++++++++++++++++++++++++ lib-src/ChangeLog | 4 ++++ lib-src/Makefile.in | 10 ++-------- msdos/ChangeLog | 4 ++++ msdos/sed3v2.inp | 1 + src/ChangeLog | 10 ++++++++++ src/s/aix4-2.h | 1 - src/s/bsd-common.h | 33 ++++++--------------------------- src/s/darwin.h | 30 +++++------------------------- src/s/gnu-linux.h | 26 -------------------------- src/s/irix6-5.h | 14 +++----------- src/s/ms-w32.h | 11 +++-------- src/s/template.h | 12 +++--------- 14 files changed, 88 insertions(+), 115 deletions(-) diff --git a/ChangeLog b/ChangeLog index cd3952204e..355f21fb21 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-05-10 Glenn Morris + + * configure.in (MAIL_USE_FLOCK, MAIL_USE_LOCKF): New AC_DEFINEs. + (BLESSMAIL_TARGET): New output variable. + 2010-05-08 Štěpán Němec (tiny change) * INSTALL: Fix typos. diff --git a/configure.in b/configure.in index 8a7d9bedde..383e80ba1a 100644 --- a/configure.in +++ b/configure.in @@ -2482,6 +2482,48 @@ AC_CHECK_FUNCS(touchlock) AC_CHECK_HEADERS(maillock.h) AC_SUBST(LIBS_MAIL) +## Define MAIL_USE_FLOCK (or LOCKF) if the mailer uses flock (or lockf) to +## interlock access to the mail spool. The alternative is a lock file named +## /usr/spool/mail/$USER.lock. +mail_lock=no +case "$opsys" in + aix4-2) mail_lock="lockf" ;; + + gnu|freebsd|netbsd|openbsd|darwin|irix6-5) mail_lock="flock" ;; + + ## On GNU/Linux systems, both methods are used by various mail programs. + ## I assume most people are using newer mailers that have heard of flock. + ## Change this if you need to. + ## Debian contains a patch which says: ``On Debian/GNU/Linux systems, + ## configure gets the right answers, and that means *NOT* using flock. + ## Using flock is guaranteed to be the wrong thing. See Debian Policy + ## for details.'' and then uses `#ifdef DEBIAN'. Unfortunately the + ## Debian maintainer hasn't provided a clean fix for Emacs. + ## movemail.c will use `maillock' when MAILDIR, HAVE_LIBMAIL and + ## HAVE_MAILLOCK_H are defined, so the following appears to be the + ## correct logic. -- fx + ## We must check for HAVE_LIBLOCKFILE too, as movemail does. + ## liblockfile is a Free Software replacement for libmail, used on + ## Debian systems and elsewhere. -rfr. + gnu-*) + mail_lock="flock" + if test $have_mail = yes || test $have_lockfile = yes; then + test $ac_cv_header_maillock_h = yes && mail_lock=no + fi + ;; +esac + +BLESSMAIL_TARGET= +case "$mail_lock" in + flock) AC_DEFINE(MAIL_USE_FLOCK, 1, [Define if the mailer uses flock to interlock the mail spool.]) ;; + + lockf) AC_DEFINE(MAIL_USE_LOCKF, 1, [Define if the mailer uses lockf to interlock the mail spool.]) ;; + + *) BLESSMAIL_TARGET="need-blessmail" ;; +esac +AC_SUBST(BLESSMAIL_TARGET) + + AC_CHECK_FUNCS(gethostname getdomainname dup2 \ rename closedir mkdir rmdir sysinfo getrusage get_current_dir_name \ random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime setsid \ diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 9de0512472..c2a7b6f9ce 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,7 @@ +2010-05-10 Glenn Morris + + * Makefile.in (BLESSMAIL_TARGET): Set with configure, not cpp. + 2010-05-08 Christoph (tiny change) * makefile.w32-in (OTHER_PLATFORM_SUPPORT): Use parenthesis diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in index 73953211cd..cde26a5411 100644 --- a/lib-src/Makefile.in +++ b/lib-src/Makefile.in @@ -131,8 +131,8 @@ EXECUTABLES= ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS} # If neither flag is set, blessmail is used. MOVE_FLAGS= -## May be reset below by cpp. -BLESSMAIL_TARGET= +## Empty if either MAIL_USE_FLOCK or MAIL_USE_LOCKF, else need-blessmail. +BLESSMAIL_TARGET=@BLESSMAIL_TARGET@ ## -lkrb if HAVE_LIBKRB or -lkrb4 if HAVE_LIBKRB4 KRB4LIB=@KRB4LIB@ @@ -173,12 +173,6 @@ CPP_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) -DHAVE_CONFIG_H -I. -I../src #endif LOADLIBES=LIBS_SYSTEM -#ifndef MAIL_USE_FLOCK -#ifndef MAIL_USE_LOCKF -BLESSMAIL_TARGET = need-blessmail -#endif -#endif - .SUFFIXES: .m diff --git a/msdos/ChangeLog b/msdos/ChangeLog index 8f9d642e86..996b9c0d02 100644 --- a/msdos/ChangeLog +++ b/msdos/ChangeLog @@ -1,3 +1,7 @@ +2010-05-10 Glenn Morris + + * sed3v2.inp (BLESSMAIL_TARGET): Edit to need-blessmail. + 2010-05-07 Chong Yidong * Version 23.2 released. diff --git a/msdos/sed3v2.inp b/msdos/sed3v2.inp index 0f489d8dac..b0182a72fd 100644 --- a/msdos/sed3v2.inp +++ b/msdos/sed3v2.inp @@ -26,6 +26,7 @@ /^libdir *=/s!=.*$!=/emacs/bin! /^srcdir=/s!srcdir=@srcdir@!srcdir := $(subst \\,/,$(shell command.com /c cd))! /^VPATH *=/s!=.*$!=.! +/^BLESSMAIL_TARGET *=/s!@BLESSMAIL_TARGET@!need-blessmail! /^KRB4LIB *=/s/@[^@\n]*@//g /^DESLIB *=/s/@[^@\n]*@//g /^KRB5LIB *=/s/@[^@\n]*@//g diff --git a/src/ChangeLog b/src/ChangeLog index 422939fce0..c0a264d46c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2010-05-10 Glenn Morris + + * s/aix4-2.h (MAIL_USE_LOCKF): + * s/bsd-common.h (MAIL_USE_FLOCK): + * s/darwin.h (MAIL_USE_FLOCK): + * s/gnu-linux.h (MAIL_USE_FLOCK): + * s/irix6-5.h (MAIL_USE_FLOCK): + * s/template.h (MAIL_USE_FLOCK): + Move to configure. + 2010-05-08 Chong Yidong * Version 23.2 released. diff --git a/src/s/aix4-2.h b/src/s/aix4-2.h index eb2003d948..dc6ba71ab6 100644 --- a/src/s/aix4-2.h +++ b/src/s/aix4-2.h @@ -110,7 +110,6 @@ along with GNU Emacs. If not, see . */ /* Perry Smith says these are correct. */ #define SIGNALS_VIA_CHARACTERS -#define MAIL_USE_LOCKF #define CLASH_DETECTION /* Perry Smith says these are correct. */ diff --git a/src/s/bsd-common.h b/src/s/bsd-common.h index e44757f19a..ef79d71e3c 100644 --- a/src/s/bsd-common.h +++ b/src/s/bsd-common.h @@ -1,6 +1,7 @@ /* Definitions file for GNU Emacs running on bsd 4.3 - Copyright (C) 1985, 1986, 2001, 2002, 2003, 2004, 2005, 2006, - 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + +Copyright (C) 1985, 1986, 2001, 2002, 2003, 2004, 2005, 2006, 2007, + 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -18,10 +19,8 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ -/* - * Define symbols to identify the version of Unix this is. - * Define all the symbols that apply correctly. - */ +/* Define symbols to identify the version of Unix this is. + * Define all the symbols that apply correctly. */ /* We give these symbols the numeric values found in to avoid warnings about redefined macros. */ @@ -55,61 +54,41 @@ along with GNU Emacs. If not, see . */ generated in the Makefile generated by `xmkmf'. If we don't define NARROWPROTO, we will see the wrong function prototypes for X functions taking float or double parameters. */ - #define NARROWPROTO 1 /* SYSTEM_TYPE should indicate the kind of system you are using. It sets the Lisp variable system-type. */ - #define SYSTEM_TYPE "berkeley-unix" /* Do not use interrupt_input = 1 by default, because in 4.3 we can make noninterrupt input work properly. */ - #undef INTERRUPT_INPUT /* First pty name is /dev/ptyp0. */ - #define FIRST_PTY_LETTER 'p' -/* - * Define HAVE_PTYS if the system supports pty devices. - */ - +/* Define HAVE_PTYS if the system supports pty devices. */ #define HAVE_PTYS /* Define HAVE_SOCKETS if system supports 4.2-compatible sockets. */ - #define HAVE_SOCKETS /* Define this symbol if your system has the functions bcopy, etc. */ - #define BSTRING -/* define MAIL_USE_FLOCK if the mailer uses flock - to interlock access to /usr/spool/mail/$USER. - The alternative is that a lock file named - /usr/spool/mail/$USER.lock. */ - -#define MAIL_USE_FLOCK - /* Define CLASH_DETECTION if you want lock files to be written so that Emacs can tell instantly when you try to modify a file that someone else has modified in his Emacs. */ - #define CLASH_DETECTION /* The file containing the kernel's symbol table is called /vmunix. */ - #define KERNEL_FILE "/vmunix" /* The symbol in the kernel where the load average is found is named _avenrun. */ - #define LDAV_SYMBOL "_avenrun" /* Send signals to subprocesses by "typing" special chars at them. */ - #define SIGNALS_VIA_CHARACTERS /* arch-tag: 0c367245-bde3-492e-9029-3ff6898beb95 diff --git a/src/s/darwin.h b/src/s/darwin.h index a3dfe06e83..01544631aa 100644 --- a/src/s/darwin.h +++ b/src/s/darwin.h @@ -1,6 +1,7 @@ /* System description header file for Darwin (Mac OS X). - Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, - 2008, 2009, 2010 Free Software Foundation, Inc. + +Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, + 2010 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -18,10 +19,8 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ -/* - * Define symbols to identify the version of Unix this is. - * Define all the symbols that apply correctly. - */ +/* Define symbols to identify the version of Unix this is. + * Define all the symbols that apply correctly. */ #define BSD4_2 /* BSD4_3 and BSD4_4 are already defined in sys/param.h */ @@ -31,13 +30,11 @@ along with GNU Emacs. If not, see . */ may not be defined on non-OSX Darwin, and we cannot define DARWIN here because Panther and lower CoreFoundation.h uses DARWIN to distinguish OS X from pure Darwin. */ - #define DARWIN_OS /* SYSTEM_TYPE should indicate the kind of system you are using. It sets the Lisp variable system-type. */ - #define SYSTEM_TYPE "darwin" /* Emacs can read input using SIGIO and buffering characters itself, @@ -61,12 +58,10 @@ along with GNU Emacs. If not, see . */ It would have Emacs fork off a separate process to read the input and send it to the true Emacs process through a pipe. */ - #define INTERRUPT_INPUT /* Letter to use in finding device name of first pty, if system supports pty's. 'a' means it is /dev/ptya0 */ - #define FIRST_PTY_LETTER 'p' /* @@ -79,16 +74,13 @@ along with GNU Emacs. If not, see . */ * Do not define both. HAVE_TERMIOS is preferred, if it is * supported on your system. */ - #define HAVE_TERMIOS - #define NO_TERMIO /* * Define HAVE_PTYS if the system supports pty devices. * Note: PTYs are broken on darwin <6. Use at your own risk. */ - #define HAVE_PTYS /* Run only once. We need a `for'-loop because the code uses `continue'. */ @@ -117,20 +109,11 @@ along with GNU Emacs. If not, see . */ #define MIN_PTY_KERNEL_VERSION '7' /* Define this symbol if your system has the functions bcopy, etc. */ - #define BSTRING -/* define MAIL_USE_FLOCK if the mailer uses flock - to interlock access to /usr/spool/mail/$USER. - The alternative is that a lock file named - /usr/spool/mail/$USER.lock. */ - -#define MAIL_USE_FLOCK - /* Define CLASH_DETECTION if you want lock files to be written so that Emacs can tell instantly when you try to modify a file that someone else has modified in his Emacs. */ - #define CLASH_DETECTION /* Avoid the use of the name init_process (process.c) because it is @@ -152,21 +135,18 @@ along with GNU Emacs. If not, see . */ #define HAVE_SOCKETS /* Definitions for how to dump. Copied from nextstep.h. */ - #define UNEXEC unexmacosx.o /* start_of_text isn't actually used, so make it compile without error. */ #define TEXT_START (0) /* Definitions for how to compile & link. */ - #ifdef HAVE_NS #define SYSTEM_PURESIZE_EXTRA 200000 #endif /* On Darwin, res_init appears not to be useful: see bug#562 and http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01467.html */ - #undef HAVE_RES_INIT #undef HAVE_LIBRESOLV diff --git a/src/s/gnu-linux.h b/src/s/gnu-linux.h index d010fc7261..5c94a4369c 100644 --- a/src/s/gnu-linux.h +++ b/src/s/gnu-linux.h @@ -103,41 +103,15 @@ along with GNU Emacs. If not, see . */ #define HAVE_SOCKETS /* Define this symbol if your system has the functions bcopy, etc. */ - #define BSTRING /* This is used in list_system_processes. */ #define HAVE_PROCFS 1 -/* define MAIL_USE_FLOCK if the mailer uses flock - to interlock access to /usr/spool/mail/$USER. - The alternative is that a lock file named - /usr/spool/mail/$USER.lock. */ - -/* On GNU/Linux systems, both methods are used by various mail - programs. I assume that most people are using newer mailers that - have heard of flock. Change this if you need to. */ -/* Debian contains a patch which says: ``On Debian/GNU/Linux systems, - configure gets the right answers, and that means *NOT* using flock. - Using flock is guaranteed to be the wrong thing. See Debian Policy - for details.'' and then uses `#ifdef DEBIAN'. Unfortunately the - Debian maintainer hasn't provided a clean fix for Emacs. - movemail.c will use `maillock' when MAILDIR, HAVE_LIBMAIL and - HAVE_MAILLOCK_H are defined, so the following appears to be the - correct logic. -- fx */ -/* We must check for HAVE_LIBLOCKFILE too, as movemail does. - liblockfile is a Free Software replacement for libmail, used on - Debian systems and elsewhere. -rfr */ - -#if !((defined (HAVE_LIBMAIL) || defined (HAVE_LIBLOCKFILE)) && \ - defined (HAVE_MAILLOCK_H)) -#define MAIL_USE_FLOCK -#endif /* Define CLASH_DETECTION if you want lock files to be written so that Emacs can tell instantly when you try to modify a file that someone else has modified in his Emacs. */ - #define CLASH_DETECTION /* Here, on a separate page, add any special hacks needed diff --git a/src/s/irix6-5.h b/src/s/irix6-5.h index 3614eab5a6..7016e6bc44 100644 --- a/src/s/irix6-5.h +++ b/src/s/irix6-5.h @@ -85,21 +85,10 @@ char *_getpty(); #define UNEXEC unexelf.o -/* define MAIL_USE_FLOCK if the mailer uses flock - to interlock access to /usr/spool/mail/$USER. - The alternative is that a lock file named - /usr/spool/mail/$USER.lock. */ - -#define MAIL_USE_FLOCK - #define NARROWPROTO 1 #define USE_MMAP_FOR_BUFFERS 1 -/* arch-tag: ad0660e0-acf8-46ae-b866-4f3df5b1101b - (do not change this comment) */ - - #if _MIPS_SZLONG == 64 /* -mabi=64 (gcc) or -64 (MIPSpro) */ #define _LP64 /* lisp.h takes care of the rest */ #endif /* _MIPS_SZLONG */ @@ -112,5 +101,8 @@ char *_getpty(); #define GC_SETJMP_WORKS 1 #define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS +/* arch-tag: ad0660e0-acf8-46ae-b866-4f3df5b1101b + (do not change this comment) */ + /* arch-tag: d7ad9ec2-54ad-4b2f-adf2-0070c5c63e83 (do not change this comment) */ diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h index deb23322d9..f5065507e5 100644 --- a/src/s/ms-w32.h +++ b/src/s/ms-w32.h @@ -1,6 +1,7 @@ /* System description file for Windows NT. - Copyright (C) 1993, 1994, 1995, 2001, 2002, 2003, 2004, 2005, 2006, - 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + +Copyright (C) 1993, 1994, 1995, 2001, 2002, 2003, 2004, 2005, 2006, + 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -89,12 +90,6 @@ along with GNU Emacs. If not, see . */ #define COFF 1 -/* define MAIL_USE_FLOCK if the mailer uses flock - to interlock access to /usr/spool/mail/$USER. - The alternative is that a lock file named - /usr/spool/mail/$USER.lock. */ - -/* #define MAIL_USE_FLOCK */ #define MAIL_USE_POP 1 #define MAIL_USE_SYSTEM_LOCK 1 diff --git a/src/s/template.h b/src/s/template.h index a20aa26655..b3a88c0b28 100644 --- a/src/s/template.h +++ b/src/s/template.h @@ -1,8 +1,9 @@ /* Template for system description header files. This file describes the parameters that system description files should define or not. - Copyright (C) 1985, 1986, 1992, 1999, 2001, 2002, 2003, 2004, 2005, - 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + +Copyright (C) 1985, 1986, 1992, 1999, 2001, 2002, 2003, 2004, 2005, + 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -102,13 +103,6 @@ along with GNU Emacs. If not, see . */ /* #define COFF */ -/* define MAIL_USE_FLOCK if the mailer uses flock - to interlock access to /usr/spool/mail/$USER. - The alternative is that a lock file named - /usr/spool/mail/$USER.lock. */ - -#define MAIL_USE_FLOCK - /* Define CLASH_DETECTION if you want lock files to be written so that Emacs can tell instantly when you try to modify a file that someone else has modified in his Emacs. */ -- 2.20.1