bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#27810: NS runtime feature detection


From: Alan Third
Subject: bug#27810: NS runtime feature detection
Date: Sat, 12 Aug 2017 16:51:15 +0100
User-agent: Mutt/1.7.2 (2016-11-26)

On Sat, Aug 12, 2017 at 01:13:56PM +0200, Charles A. Roelli wrote:
> Hm, on second thoughts, it seems a bit overwrought to try doing this
> weak linking only for the sake of forward-compatible builds.  It
> should be enough to support only backward-compatible builds, so that
> we might one day distribute Emacs as a .dmg (built on the latest macOS
> and backwards-compatible with the oldest version of macOS that we
> support).

I think this makes sense. Especially given we’re not able to actually
create a stand‐alone .app without implementing something like...

> I also looked at the emacsformacosx.com build scripts, and it seems
> like they're making copies of Emacs' dependent dynamic libraries,
> including them in the application bundle, then using
> install_name_tool(1) to patch the Emacs binary to depend on them (I
> don't understand, though, how those scripts resolve dependencies
> between the dynamic libraries themselves).

I wouldn’t have a problem with putting this capability in, but I don’t
have the knowledge nor the inclination to do it myself.

I was going to write something up in INSTALL about building with
feature detection, but I really don’t know how to put it. I don’t want
to give the impression that if you use
-DMAC_OS_X_VERSION_MIN_ALLOWED=1060 that it will magically build a
portable .app. I began to wonder if it’s worth mentioning at all since
I doubt any more than a handful of people will be interested in
building with this option.

David and David, I hope it’s OK to include you in this. I thought you
might be interested and perhaps have some thoughts on what we’re
doing.

Basically, instead of detecting all macOS features at compile‐time,
we’ve stuck in some code to detect them at run‐time. It causes
compiler warnings, so by default it still limits features to those
available at build‐time, but if you do something like:

    ./configure --with-ns CFLAGS="-DMAC_OS_X_VERSION_MIN_REQUIRED=1060 -O3 -g"

when building on macOS Sierra, you should, in theory, end up with an
executable that will work correctly on every version of macOS back to
10.6, inclusive. We haven’t been able to properly test portability yet
as it requires including dynamic libraries.

The patch is attached to this email.
-- 
Alan Third

Attachment: 0001-Allow-use-of-run-time-OS-version-checks-on-macOS-bug.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]