Setting environment and support of older OS/arch

Ken Cunningham ken.cunningham.webuse at gmail.com
Fri Mar 17 13:07:27 UTC 2023


If you are doing your own compilation using the compilers and libraries from MacPorts, you need to direct your build to use the specified tools, headers, and libraries.

You can look at what MacPorts sets up itself for each build for a clue, for example this is setup for a generic build of something on an arm64 system running Ventura. 

You'd tweak this for a system running some other system like Leopard or Tiger, of course -- you can't just use this one.

you need to export all these environment variables in the shell before you start running your configure or make steps, so perhaps you might preface each one with "export " and make a shell script of this, to make it easier.

------
CC='/usr/bin/clang'
CFLAGS='-pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -arch arm64'
CPATH='/opt/local/include'
CPPFLAGS='-I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk'
CXX='/usr/bin/clang++'
CXXFLAGS='-pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -arch arm64'
DEVELOPER_DIR='/Library/Developer/CommandLineTools'
F90FLAGS='-pipe -Os -m64'
FCFLAGS='-pipe -Os -m64'
FFLAGS='-pipe -Os -m64'
INSTALL='/usr/bin/install -c'
LDFLAGS='-L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -arch arm64'
LIBRARY_PATH='/opt/local/lib'
MACOSX_DEPLOYMENT_TARGET='13.0'
OBJC='/usr/bin/clang'
OBJCFLAGS='-pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -arch arm64'
OBJCXX='/usr/bin/clang++'
OBJCXXFLAGS='-pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -arch arm64'
SDKROOT='/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk'
----------



Now you might rightly say this is harder than putting everything in /usr/local, and why did MacPorts put everything in /opt/local and make it so hard to use?

And there you would see the primary reason that homebrew came to exist, 10 or 15 years ago.

But putting everything in /opt/local is actually defendable better in a number of ways, although does require a deeper level of understanding about what is doing on to make it work.

And don't even get me started about how to make MacPorts work with Xcode -- :>

Good luck, ask questions when you get stuck.

Ken
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20230317/c49cbb15/attachment.htm>


More information about the macports-users mailing list