Ticket #62779: patch-hints-darwin_sh.diff

File patch-hints-darwin_sh.diff, 2.0 KB (added by ghosthound, 3 years ago)

files/5.28 version of patch-hints-darwin_sh.diff

  • hints/darwin.sh

    old new  
    301301   # We now use MACOSX_DEPLOYMENT_TARGET, if set, as an override by
    302302   # capturing its value and adding it to the flags.
    303303    case "$MACOSX_DEPLOYMENT_TARGET" in
    304     10.*)
     304    [1-9][0-9].*)
    305305      add_macosx_version_min ccflags $MACOSX_DEPLOYMENT_TARGET
    306306      add_macosx_version_min ldflags $MACOSX_DEPLOYMENT_TARGET
    307307      ;;
     
    313313
    314314*** Unexpected MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET
    315315***
    316 *** Please either set it to 10.something, or to empty.
     316*** Please either set it to a valid macOS version number (e.g., 10.15) or to empty.
    317317
    318318EOM
    319319      exit 1
     
    327327    # "ProductVersion:    10.11"     "10.11"
    328328        prodvers=`sw_vers|awk '/^ProductVersion:/{print $2}'|awk -F. '{print $1"."$2}'`
    329329    case "$prodvers" in
    330     10.*)
     330    [1-9][0-9].*)
    331331      add_macosx_version_min ccflags $prodvers
    332332      add_macosx_version_min ldflags $prodvers
    333333      ;;
     
    344344
    345345    # The X in 10.X
    346346    prodvers_minor=$(echo $prodvers|awk -F. '{print $2}')
     347    darwin_major=$(echo $osvers|awk -F. '{print $1}')
    347348
    348     # macOS (10.12) deprecated syscall().
    349     # but it's still available on both macOS 10.12 and 10.13
    350     # for compatibility with perl5.24 allow syscall() configuration on Sierra and later
    351     # will auto-configure without syscall() if and when it's actually removed
    352     # if [ "$prodvers_minor" -ge 12 ]; then
    353     #     d_syscall='undef'
    354     # fi
     349    # macOS 10.12 (darwin 16.0.0) deprecated syscall().
     350    if [ "$darwin_major" -ge 16 ]; then
     351        d_syscall='undef'
     352        # If deploying to pre-10.12, suppress Time::HiRes's detection of the system clock_gettime()
     353        case "$MACOSX_DEPLOYMENT_TARGET" in
     354          10.[6-9]|10.10|10.11)
     355          ccflags="$ccflags -Werror=partial-availability -D_DARWIN_FEATURE_CLOCK_GETTIME=0"
     356          ;;
     357        *)
     358          ;;
     359        esac
     360    fi
    355361
    356362   lddlflags="${ldflags} -bundle -undefined dynamic_lookup"
    357363   ;;