On Tuesday June 03 2025 21:26:18 Fred Wright wrote: Thanks!
>2a) Set SDKROOT to point to the target SDK. I of course ended up trying my hand at this, and actually succeeding for 10.7. I used this addition in the legacy-support port: # set host_os_version ${macosx_deployment_target} # variant sdk10.7 description {build as if on OS X 10.7} {} # if {[variant_isset sdk10.7]} { # set macosx_deployment_target 10.7 # configure.sdk_version ${macosx_deployment_target} # set extraflags -D__MPLS_TARGET_OSVER=1070 # } # if {${host_os_version} ne ${macosx_deployment_target}} { # ui_warn "Building for ${configure.sdk_version}!" # configure.sdkroot [portconfigure::configure_get_sdkroot ${configure.sdk_version}] # # somehow we need to invoke this twice?! # configure.sdkroot [portconfigure::configure_get_sdkroot ${configure.sdk_version}] # set extraflags "${extraflags} \ # -mmacosx-version-min=${macosx_deployment_target} \ # -isysroot${configure.sdkroot}" # configure.cflags-append {*}${extraflags} # configure.cxxflags-append {*}${extraflags} # configure.ldflags-append {*}${extraflags} # } then manually installed the static archive with a version suffix to its name. I wasn't really motivated to risk breaking my entire install by installing the corresponding shared libraries though they'd probably work and just make me use the "backported" versions of a handful of functions that my host 10.9.5 has over 10.7 . Then, in the port this all started for, I added # platform darwin { # set host_os_version ${macosx_deployment_target} # variant sdk10.7 description {build as if on OS X 10.7} {} # if {[variant_isset sdk10.7]} { # set macosx_deployment_target 10.7 # configure.sdk_version ${macosx_deployment_target} # legacysupport.use_mp_libcxx yes # # very important: tell the legacysupport headers which OS version we're targetting! # set extraflags -D__MPLS_TARGET_OSVER=1070 # } # if {${host_os_version} ne ${macosx_deployment_target}} { # ui_warn "Building for ${configure.sdk_version}!" # configure.sdkroot [portconfigure::configure_get_sdkroot ${configure.sdk_version}] # # somehow we need to invoke this twice?! # configure.sdkroot [portconfigure::configure_get_sdkroot ${configure.sdk_version}] # set extraflags "${extraflags} -mmacosx-version-min=${macosx_deployment_target} \ # -isysroot${configure.sdkroot}" # configure.cflags-append {*}${extraflags} # configure.cxxflags-append {*}${extraflags} # configure.ldflags-append {*}${extraflags} # # proc legacysupport::get_library_name {} { # global prefix macosx_deployment_target # return ${prefix}/lib/libMacportsLegacySupport-${macosx_deployment_target}.a # } # } # } # and got a proper 10.7 binary. (Full disclosure: I use a hotpatched official rust toolchain, which always sets the min os version to 10.12 so I need vtool to fix that - and had to enable building vtool in port:cctools first). That binary works ... on 10.9 . I don't think I have yet heard back if it also does on 10.7 but in theory it should esp. since I haven't found any indication that it actually calls any of those functions 10.7 doesn't have. If ever I were to pursue this more seriously I'd probably add legacy-support supports for a select number of older SDKs, which install just that versioned static archive, and maybe add a convenience procedure to the legacy-support PG to add the appropriate TARGET_OSVER macro definition to CPPFLAGS. Re 10.6 : I tried that first. Turns out that this would add a backported function that calls a function (chk_fail or something like that) which is itself unavailable on 10.9 . R.