Forum
× CodeTyphon MacOS Development, discussions and problems

Question Cannot build FPC or IDE on MacOS Sierra

  • rarnu
  • rarnu's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
3 years 4 months ago #10024 by rarnu
MacOS Sierra moved almost all libs away from /usr/lib
Now they are in "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib"

While compiling, we will meet the error like that in screenshot:


I have tried to set the environment variable:


But it does not work...

What should I do now?
Attachments:

Please Log in or Create an account to join the conversation.

  • rarnu
  • rarnu's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
3 years 4 months ago #10025 by rarnu
Replied by rarnu on topic Cannot build FPC or IDE on MacOS Sierra
Yet still no answer. I solved it myself. Now share my solution.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Step 1. Update your MacPorts
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Step 2. Unpack fpc archives and change fpc.cfg

$ 7z x ./binfpc/i386-darwin.7z
$ 7z x ./binfpc/x86_64-darwin.7z

Find fpc.cfg (twice) and add this line at last:
-Fl/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib

Repack and replace the archives

$ 7z a i386-darwin.7z i386-darwin
$ 7z a x86_64-darwin.7z x86_64-darwin
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Step 3. Make Symlinks

In this step you must remove the Mac's security lock first.
Reboot your Mac and press Command+R when booting up. This will take you to the recovery mode. Then go into Utilities -> Terminal and type the command:

# csrutil disable
# reboot

Now you can make any symlinks in "/usr/lib"

Run this script for make the symlinks:

#!/bin/sh
MACSDK=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
MACSDK_LIB=${MACSDK}/usr/lib
cd /usr/lib
sudo ln -s ${MACSDK_LIB}/crt1.o crt1.o
sudo ln -s ${MACSDK_LIB}/crt1.10.5.o crt1.10.5.o
sudo ln -s ${MACSDK_LIB}/crt1.10.6.o crt1.10.6.o
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Step 4. Build FPC and Typhon IDE by official steps.

Please Log in or Create an account to join the conversation.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
3 years 4 months ago #10026 by Sternas Stefanos
Replied by Sternas Stefanos on topic Cannot build FPC or IDE on MacOS Sierra
Thanks Sir
please, give us time to solve the problem

PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.