Building emacs-27 from source with AppKit, X windows, Gtk+ toolkit support...?

Carlo Tambuatco oraclmaster at gmail.com
Thu Jun 4 05:57:09 UTC 2020


I think I found an answer to my own question on Stack Overflow. 

Here are the configure flags I used to build emacs-27 from source:

$ ./configure --with-ns --with-modules --enable-silent-rules \
     PKG_CONFIG_PATH=/opt/local/lib/pkgconfig \
     LDFLAGS="-L/opt/local/lib" CPPFLAGS="-I/opt/local/include" \
     CC=clang OBJC=clang CFLAGS="-g -O2"

These seem to link to the libraries installed by macports for gtk+, and I think it should 
be able to find ImageMagick as well. And now somehow it even is able to find and 
use AppKit for building. 

Did I miss anything?


> On Jun 3, 2020, at 4:10 PM, Ryan Schmidt <ryandesign at macports.org> wrote:
> 
> 
> 
> On Jun 3, 2020, at 05:38, Carlo Tambuatco wrote:
> 
>> I’m attempting to build emacs-27 from source and I would like to have AppKit support for running natively on macOS and Gtk3 support.
>> 
>> These are the gtk3 libraries I’ve got installed:
>> 
>> gtk-osx-application-common-gtk3 @2.0.8_0 (active)
>> gtk-osx-application-gtk3 @2.0.8_0 (active)
>> gtk3 @3.24.20_0+quartz (active)
>> gwenhywfar4-gtk3 @4.20.2_0 (active)
>> 
>> This is the warning I got during the configure step of compilation: 
>> 
>> checking for X... no
>> checking AppKit/AppKit.h usability... no
>> checking AppKit/AppKit.h presence... yes
>> configure: WARNING: AppKit/AppKit.h: present but cannot be compiled
>> configure: WARNING: AppKit/AppKit.h:     check for missing prerequisite headers?
>> configure: WARNING: AppKit/AppKit.h: see the Autoconf documentation
>> configure: WARNING: AppKit/AppKit.h:     section "Present But Cannot Be Compiled"
>> configure: WARNING: AppKit/AppKit.h: proceeding with the compiler's result
>> configure: WARNING:     ## ------------------------------------ ##
>> configure: WARNING:     ## Report this to bug-gnu-emacs at gnu.org ##
>> configure: WARNING:     ## ------------------------------------ ##
>> checking for AppKit/AppKit.h... no
>> configure: error: The include files (AppKit/AppKit.h etc) that
>> are required for a Nextstep build are missing or cannot be compiled.
>> Either fix this, or re-configure with the option '--without-ns’.
> 
> The config.log file is where I would look to understand why this is happening.
> 
> 
>> And configure says I do not have X installed:
>> 
>> checking for X… no
>> 
>> I also have ImageMagick installed, so I would like to link to that during the build also.
> 
> Any reason why you don't want to use the emacs or emacs-devel ports that are already in MacPorts? They do have an +imagemagick variant you can use.
> 
> 
>> So, I would like to know if there are extra devel libraries I need from macports and if I already have the relevant 
>> libraries, how do I link to them when building emacs-27…?
> 
> Just to make sure we're on the same page about terminology, if you're referring to the -devel packages offered in some Linux package management systems, which provide headers and other files needed to build something against a library whereas the actual library files would be in a non-devel package, MacPorts doesn't do it that way. In MacPorts, the headers, libraries and binaries will all be together in a single port.
> 
> We do have some -devel ports, as I mentioned emacs-devel above, but they have a different purpose in MacPorts: The -devel port will offer a (usually more recent) development version of the software while the non-devel port will offer a stable version of the software.
> 
> AppKit, being a part of macOS, won't be in a port; it'll just be there in the OS.
> 



More information about the macports-users mailing list