Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

PAR pp macOs set -mmacosx-version-min

by IB2017 (Pilgrim)
on Jun 18, 2018 at 10:52 UTC ( [id://1216844]=perlquestion: print w/replies, xml ) Need Help??

IB2017 has asked for the wisdom of the Perl Monks concerning the following question:

Dear monks

I am creating a binary of my script for macOS using PAR pp (latest version). Is there a way to set the value of -mmacosx-version-min? Reason: pp seems to set it automatically to the OS version used to compile the binary. In this way, however, there are problems when running the same binary on older OS versions. The binary created with pp contains the following info (read with  $ otool -l binary):

Load command 9 cmd LC_VERSION_MIN_MACOSX cmdsize 16 version 10.13 sdk 10.13

In some circumstances (for example if the binary is bundled in a .app), macOS will refuse to run the binary if the OS is older than the version indicated here (at least this is what I 've understood with my researches until now). The pp instructions do not seem to mention any option.

Replies are listed 'Best First'.
Re: PAR pp macOs set -mmacosx-version-min
by beech (Parson) on Jun 18, 2018 at 20:43 UTC

    Is there a way to set the value of -mmacosx-version-min?

    Hi

    Yes, reinstall PAR/PAR::Packer, but edit Makefile to modify LD or LDFLAGS variable to add/set  -mmacosx-version-min=

    Afterwards use "pp" as normal

      Thank you, beech. I need a bit of advice, as I never edited a Makefile before. The package has two Makefile, but I guess the one that needs editing is the one at the first level inside the package (the second being in folder "myldr"). How/Where do I add the variable -mmacosx-version-min=? I appreciate your help

Re: PAR pp macOs set -mmacosx-version-min
by IB2017 (Pilgrim) on Jun 23, 2018 at 14:16 UTC

    After 3 days of work I found a solution. Not elegant nor practical, but it works. After setting the variable export MACOSX_DEPLOYMENT_TARGET=10.11 (with the desired OS version), I reinstalled Perl with Perlbrew. In this way the MACOSX_DEPLOYMENT_TARGET was set inside the Perl installation too (visible through perl -V. For all the rest, I proceeded as usual. The final executable created with pp finally had:

    Load command 9 cmd LC_VERSION_MIN_MACOSX cmdsize 16 version 10.11 sdk 10.13

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1216844]
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-04-19 19:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found