After running a patched Emacs build or a couple of days, I've submitted the patch below to the editors/emacs and editors/emacs-devel packages of FreeBSD. Since it's a good idea to keep the "local patches" as small and few as possible, does anyone from the list feel like pushing this to the bzr branch for the next pretest too? Regards, Giorgos On Mon, 18 Jan 2010 22:16:27 +0200, Giorgos Keramidas wrote: > Hi all, > > utmp.h has been removed from FreeBSD 9.0-CURRENT. This means Emacs from > trunk can no longer build on FreeBSD 9.X or newer because src/filelock.c > tries to include . > > The filelock.c code uses the sysctl interface in FreeBSD, so we don't > really need utmp.h to have a working Emacs version. So I patched > configure.in to check for availability of utmp.h and then filelock.c to > use HAVE_UTMP_H around the include statement. > > This seems to work fine, but before updating the packages of Emacs on > FreeBSD I thought I'd ask: does this seem like a reasonable fix? Should > we patch the Emacs trunk too? > > The following patch should apply cleanly on the bzr-trunk of Emacs at > revision lekktu@gmail.com-20100118044436-c8dozy11mbqky3qh > > Then 'configure' has to be regenerated too, and we should be set :-) > > %%% > === modified file 'ChangeLog' > --- ChangeLog 2010-01-13 08:35:10 +0000 > +++ ChangeLog 2010-01-18 20:12:39 +0000 > @@ -1,3 +1,8 @@ > +2010-01-18 Giorgos Keramidas (tiny change) > + > + * configure.in: Check for utmp.h availability, since some > + systems don't have one (e.g. FreeBSD 9.X and later versions). > + > 2010-01-12 Juanma Barranquero > > * .bzrignore: Ignore all .exe, instead of individual files. > > === modified file 'configure.in' > --- configure.in 2010-01-13 08:35:10 +0000 > +++ configure.in 2010-01-18 18:10:31 +0000 > @@ -1106,7 +1106,7 @@ > linux/version.h sys/systeminfo.h termios.h limits.h string.h stdlib.h \ > termcap.h stdio_ext.h fcntl.h strings.h coff.h pty.h sys/mman.h \ > sys/param.h sys/vlimit.h sys/resource.h locale.h sys/_mbstate_t.h \ > - sys/utsname.h pwd.h) > + sys/utsname.h pwd.h utmp.h) > > AC_MSG_CHECKING(if personality LINUX32 can be set) > AC_TRY_COMPILE([#include ], [personality (PER_LINUX32)], > > === modified file 'src/ChangeLog' > --- src/ChangeLog 2010-01-16 20:20:32 +0000 > +++ src/ChangeLog 2010-01-18 20:11:39 +0000 > @@ -1,3 +1,9 @@ > +2010-01-18 Giorgos Keramidas (tiny change) > + > + * filelock.c: Include utmp.h only when HAVE_UTMP_H is true, > + since some systems don't have one (e.g. FreeBSD 9.X and later > + versions). > + > 2010-01-16 Stefan Monnier > > * xterm.c (event_handler_gdk): Block input (Bug#5037). > > === modified file 'src/filelock.c' > --- src/filelock.c 2010-01-13 08:35:10 +0000 > +++ src/filelock.c 2010-01-18 20:09:52 +0000 > @@ -63,7 +63,9 @@ > > #ifdef CLASH_DETECTION > > +#ifdef HAVE_UTMP_H > #include > +#endif > > #if !defined (S_ISLNK) && defined (S_IFLNK) > #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) > > %%%