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

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Carlo Tambuatco
Hi.

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 [hidden email] ##
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’.

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.


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…?

Here’s some more info about my build environment:

xcode-select version 2373

Apple clang version 11.0.3 (clang-1103.0.32.62)
Target: x86_64-apple-darwin19.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

output of xcodebuild -find clang:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang



Reply | Threaded
Open this post in threaded view
|

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

ryandesign2
Administrator


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 [hidden email] ##
> 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.

Reply | Threaded
Open this post in threaded view
|

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

Christopher Jones


> On 3 Jun 2020, at 9:10 pm, Ryan Schmidt <[hidden email]> 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 [hidden email] ##
>> 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.

Also note there is the emacs-app port that builds a native gui version. Sounds like exactly what is being asked for...

Chris

>
>
>> 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.
>

Reply | Threaded
Open this post in threaded view
|

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

Carlo Tambuatco
Yeah I know macports has an emacs app port that builds a gui. That’s fine if I just wanted 
to use emacs. But I want to build emacs-27 from source. More of an exercise and because I 
want to play around with the new features.

On Jun 3, 2020, at 6:07 PM, Chris Jones <[hidden email]> wrote:



On 3 Jun 2020, at 9:10 pm, Ryan Schmidt <[hidden email]> 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 [hidden email] ##
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.

Also note there is the emacs-app port that builds a native gui version. Sounds like exactly what is being asked for...

Chris



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.

Reply | Threaded
Open this post in threaded view
|

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

Carlo Tambuatco
In reply to this post by ryandesign2
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 <[hidden email]> 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 [hidden email] ##
>> 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.
>