The solution to get libgccjit properly working, and embedded in
Emacs.app included:
- The contents of GCC's lib folder (`/usr/local/opt/gcc/lib`) is copied
into the `Contents/MacOS/lib-<arch>-<os_version>` folder.
- Setting `LIBRARY_PATH` environment variable to correct GCC lib
folders within Emacs.app. This is done through a bash launcher script
which replaces the regular `Contents/MacOS/Emacs` executable. The main
Emacs executable itself is named `Emacs-bin` now instead, so anything
that depends on the exact process name will need updating.
- The launcher script also adds `Content/MacOS/bin` and
`Content/MacOS/libexec` folders to the PATH environment variable, to
so ensure binary tools packaged into Emacs itself are available. This
is done even when not doing a native-comp build. The launcher script
skips setting LIBRARY_PATH if it's not a native-comp build.
This should hopefully resolve both #5 and #7.
An attempt at resolving #8 by getting the GCC compilation step to have
GNU-based `sed` and other commands available. At the very least, I'm
assuming this won't break things. Fingers crossed.
The `feature/native-comp-macos-fixes` has seemingly been updated about
once a week with latest changes from `feature/native-comp`.
As the fix in the branch is desired, a custom function that applies the
same kind of fix has been added. This should be more reliable than just
downloading the git diff as a patch.
As detailed in Update 11 (https://akrl.sdf.org/gccemacs.html#org4b11ea1)
the `*.eln` cache location has been changed, which initially broke
builds.
This fixes those issues, and also simplifies usage of the build-script
by:
- Auto-detecting native-comp support if not explicitly enabled/disabled
with CLI flags.
- Auto-detecting number of logical CPU cores on your machine, and
defaulting the `-j` option to said number to ensure fast builds.
- Enable XWidgets by default, only skip if `configure` script doesn't
support it (Emacs 26.x and earlier).
Instead of just installing a pre-patched gcc formula, copy the local
formula from Homebrew and apply a patch to it, before then installing
it. This should be a lot more future-proof.
Notes:
- The sRGB patch is now a simple text-replacement, as diff/patch files
seem to just fail. Even Homebrew's emacs formula does it this way.
- Removed fullscreen patch, as Emacs 24.4 includes fullscreen support on
OS X, both native and pre-Lion style fullscreen. More details here:
http://www.emacswiki.org/emacs/FullScreen#toc23