Subject: bug#61171: 30.0.50; macos build can't find native lisp folder

From: Eli Zaretskii <[email-masked]>
Date: Mon, 30 Jan 2023 15:36:00 +0200

> Date: Mon, 30 Jan 2023 20:42:50 +0800
> From:  Merrick Luo via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> 
> As show in the "Configued using" section, I compiled emacs with
> ns-self-contained disabled and with aot native compilation, but the
> nextstep/Emacs.app is failing to start unless I do
> 
> ln -s /usr/local/lib/emacs/30.0.50/native-lisp nextstep/Emacs.app/Contents/
> 
> the error message is
> 
> Error using execdir /Users/merrickluo/projs/emacs/nextstep/Emacs.app/Contents/MacOS/:
> emacs: dlopen(/Users/merrickluo/projs/emacs/nextstep/Emacs.app/Contents/MacOS/../native-lisp/30.0.50-7473cdfd/preloaded/window-0d1b8b93-b6aaebba.eln, 0x0001): tried: '/Users/merrickluo/projs/emacs/nextstep/Emacs.app/Contents/MacOS/../native-lisp/30.0.50-7473cdfd/preloaded/window-0d1b8b93-b6aaebba.eln' (no such file)
> 
> is there anything I missed with configuration or the `ln` part is required
> to be done manually for it to work? please advise, thanks.

Why did you build with ns-self-contained disabled?  AFAICT from
reading the top-level Makefile.in, this causes Emacs to install files
according to Posix conventions, which breaks on macOS.  What you get
is the Emacs binary in a place unrelated to the directory where the
*.eln files are installed, and Emacs cannot find them.

You could perhaps set ELN_DESTDIR explicitly when you run "Make", as
in

   make ELN_DESTDIR=/Users/merrickluo/projs/emacs/nextstep/Emacs.app/Contents

Maybe.