Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mostly SDK-related changes, including __DARWIN_C_LEVEL stuff #92

Merged
merged 13 commits into from
Jul 21, 2024

Commits on Jul 11, 2024

  1. sdkversion.h: Make ...MIN_REQUIRED hack optional.

    This makes the hack to handle "earlier" SDKs conditional on providing
    MACPORTS_LEGACY_MIN_EARLY_SDK_ALLOWED to specify the earliest such
    SDK supported.  See the comments for more details.
    
    Also adds code to ensure that the required version macros are defined
    in 11.x+ SDKs, even with _POSIX_C_SOURCE defined.  See the comments
    for more details.
    
    Also adds another if/elif entry for the upcoming OS/SDK version.
    
    TESTED:
    Builds and passes tests on all platforms, including allowable "later"
    mismatched SDK cases.  The checksdkversion test passes in both
    "earlier" and "later" cases, with "earlier" only being recognized when
    allowed by the new option.
    fhgwright committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    c320f92 View commit details
    Browse the repository at this point in the history
  2. Availability*.h: Adjust "recursion" handling.

    This makes the sdkversion.h->AvailabilityMacros.h->Availability.h path
    behave more like some programs might expect.  Because it now allows
    the include, AvailabilityInternal.h also needs the fix for the
    "recursion" case.
    
    TESTED:
    Builds and passes tests on all platforms, including with mismatched
    SDK cases where allowed.
    fhgwright committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    dddb058 View commit details
    Browse the repository at this point in the history
  3. Add sys/cdefs.h wrapper, and tests.

    This is needed to ensure that the __DARWIN_C_* definitions are
    available with SDKs prior to 10.7.
    
    Also adds a test for the effects of __DARWIN_C_LEVEL, initially just
    as a test that the three macros are defined.
    
    Also adds a new manual test, which simply reports the values of the
    relevant macros.
    
    Re: https://trac.macports.org/ticket/69688
    
    TESTED:
    Test fails without the new sys/cdefs.h, and passes with it.
    Manual test reports as expected.
    fhgwright committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    3f99059 View commit details
    Browse the repository at this point in the history
  4. Convert some feature flags to the new scheme.

    This reworks the flags that interact with __DARWIN_C_LEVEL
    conditionals, to allow proper testing with different SDKs.
    
    Re: https://trac.macports.org/ticket/69867
    
    Also fixes a warning and cleans up some whitespace in sys/stat.h.
    
    TESTED:
    Builds and passes tests on all platforms, including with allowable
    mismatched SDK cases.
    fhgwright committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    4408fdc View commit details
    Browse the repository at this point in the history
  5. Remove superfluous ifndefs from some headers.

    Some constant definitions were wrapped in #ifndef/#endif to defend
    against the possibility of building with a later SDK that provided
    those definitions.  But in cases where a proper SDK version
    conditional is used, this is redundant.
    
    TESTED:
    Builds and passes tests on all platforms, including with allowable
    mismatched SDK cases.
    fhgwright committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    6631cf7 View commit details
    Browse the repository at this point in the history
  6. checksdkversion: Fix bug with assumed (default) SDK.

    The assumed SDK version derived from the OS version may include
    the minor component, which wasn't being handled correctly.
    
    Also fixes a couple of warnings.
    
    TESTED:
    No longer gives false errors with nonzero minor versions.
    No longer generates warnings in -Weverything mode.
    fhgwright committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    ed4655e View commit details
    Browse the repository at this point in the history
  7. Convert most remaining feature flags to new scheme.

    Also corrects misnamed feature flag for lchmod().
    
    Also removes unnecessary feature flags for AI_NUMERICSERV and
    PTHREAD_RWLOCK_*.
    
    Also removes unnecessary #includes where not needed for unnecessary
    feature flags.
    
    Also renames guard macro in dirfuncs_compat.h to avoid confusion with
    feature flags.
    
    Re: https://trac.macports.org/ticket/69867
    
    TESTED:
    Builds and passes tests on all platforms, including with allowable
    mismatched SDK cases.
    fhgwright committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    43cec76 View commit details
    Browse the repository at this point in the history
  8. time.h: Make clockid_t an enum, as in SDK.

    TESTED:
    Builds and passes tests on all platforms.
    fhgwright committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    f3fe481 View commit details
    Browse the repository at this point in the history
  9. Rework sysconf flags to fit new scheme.

    The old method of deriving sysconf wrapper needs from ifndefs was
    incompatible with SDK flexibility.  This sets up the usual SDK/lib
    flags, referenced to the appropriate OS versions (and the i386 fix).
    
    See: https://trac.macports.org/ticket/69867
    
    TESTED:
    Builds and passes tests on all platforms.
    fhgwright committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    c203c67 View commit details
    Browse the repository at this point in the history
  10. sdkversion.h: Respect SDK 11.x+ version non-definitions.

    Also adds a tool to extract the macro list from an SDK.
    
    Closes: https://trac.macports.org/ticket/69867
    
    TESTED:
    Builds and passes tests on all platforms.
    Version macros are absent where appropriate in the darwin_c tests.
    fhgwright committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    d10a1ab View commit details
    Browse the repository at this point in the history
  11. st?cpy_chk: Make normal output more concise.

    This reduces the output in the success case to a single line, unless
    the -v option is given.
    fhgwright committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    b976b65 View commit details
    Browse the repository at this point in the history
  12. Add __DARWIN_C_LEVEL conditionals.

    This adds conditionals on __DARWIN_C_LEVEL matching the ones in the
    SDK headers that provide the relevant functions.  These conditionals
    exist to allow building against an older version of the standard,
    without risk of collisions between recently added functions and
    same-named functions in the project.  This change extends that
    behavior to the functions provided by legacy-support.
    
    Since sys/stdio.h is unavailable prior to 10.7, our sys/stdio.h
    includes sys/cdefs.h in that case to get the __DARWIN_C_* defs.
    
    Closes: https://trac.macports.org/ticket/69688
    
    Also makes a couple of cosmetic cleanups to affected headers.
    
    TESTED:
    Builds and passes tests on all platforms, including the new tests for
    the various __DARWIN_C_LEVEL cases.
    fhgwright committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    5e6c7d9 View commit details
    Browse the repository at this point in the history
  13. Implement __DARWIN_C_LEVEL test cases.

    See: https://trac.macports.org/ticket/69688
    
    TESTED:
    Without the fixes, all tests get expected errors with the given SDK
    selection.  With the fixes, all tests pass in all cases.
    fhgwright committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    696ba9d View commit details
    Browse the repository at this point in the history