What is the best way to set MACOSX_DEPLOYMENT_TARGET?

The Perl community relied on MACOSX_DEPLOYMENT_TARGET=10.3 for all Perl builds, but for a long time. But now, with the beta version of El Capitan, it no longer works . They seem to need to hit, but why? Is there a way to programmatically install it on what is the earliest version supported by the OS X release that Perl is currently built on? Or is there another way to install it dynamically? Or should it be static and updated periodically? If the latter, how does it affect the construction of older versions of OS X?

+6
source share
2 answers

This should be a fairly simple change to hints/darwin.sh that checks which version of OSX is running and sets MACOSX_DEPLOYMENT_TARGET .

Perl is an open source project, and as such is always a short development time. If you made a patch for this and sent it to p5p, I am sure it will be very useful.

+2
source

Accepted @ Calle-Dybedahl's answer, as it is technically correct. Perl 5 Core Hacker Jarkko Hietaniemi pushed this solution , which turned out to be a bit more complicated than you might expect at first glance. The main recipe that he used was:

For OS X 10.6 or higher, do not use MACOSX_DEPLOYMENT_TARGET , tool chains should work fine. So far, the deployment target has been connected to 10.3. This logic comes from RT # 117433 .

For OS X releases from 10.3 to 10.5, there are no changes still using MACOSX_DEPLOYMENT_TARGET=10.3 for communication.

For OS X releases prior to 10.3, there are no changes that are still not in use MACOSX_DEPLOYMENT_TARGET=10.3 .

New: always add -mmacosx-version-min to ccflags and ldflags from env var $MACOSX_DEPLOYMENT_TARGET , if set. If var is not installed, install min from OS X, from sw_vers (1). Installing var should be convenient for people who build and package Perl for earlier versions of OS X.

0
source

All Articles