Compiling on NEXTSPACE (CentOS 7)
2 min readApr 18, 2020
Source: is the Cocoa version of Emacs. It is most often used on macOS, but is also used on the libre Cocoa implementation of GNUstep.

When I first tried to compile on NEXTSPACE, I ran into a number of issues. The fix involved patching the OS (CentOS 7) and patching Emacs. My Emacs patch was just committed to master so I’ll explain how to compile from the latest master branch against the latest NEXTSPACE.

First off, this article assumes that you have successfully compiled and installed the latest version of NEXTSPACE locally, and can compile regular Emacs successfully from source. Compiling regular Emacs successfully from source on CentOS 7 just requires you to keep hitting ./configure until you can determine and install all the missing packages that you need for compilation.

Patch the operating system

First, after backing it up, modify src/include/unistd.h and replace __block on line 1147 with __libc_block . Clang (required by NEXTSPACE) handles __block differently than GCC, hence why this change is required. That’s the only OS patch needed.

Per the NEWS file, this shouldn’t be a problem in glibc 2.19 and up:

The public headers no longer use __unused nor __block. This change is to support compiling programs that are derived from BSD sources and use __unused internally, and to support compiling with Clang’s -fblock extension which uses __block.

Compile Emacs

Now, run this in the emacs source directory:

source /Developer/Makefiles/
CC=/usr/bin/clang ./configure --with-ns --with-gnustep-conf=/Library/Preferences/GNUstep.conf --with-mailutils

The first couple commands just sets up our environment correctly, and the configure step is the canonical way to setup with mailutils.

The compilation should work and you will have nextstep/ waiting for you. has some stability and visual issues, but I’ve been successfully using it for days for serious work. Hopefully the NEXTSPACE team and I can return to its former glory.



Learning content for the GNU operating system and Lisp user space, developed through my eponymous charity (