[MacPorts] #54446: nghttp2 @1.24.0 does not build on PPC Leopard, Mac OS X 10.5.8, with configure.cxx_stdlib = macports-libstdc++ and macports-gcc-6 because "'AI_NUMERICSERV' was not declared in this scope"
MacPorts
noreply at macports.org
Thu Feb 29 16:49:40 UTC 2024
#54446: nghttp2 @1.24.0 does not build on PPC Leopard, Mac OS X 10.5.8, with
configure.cxx_stdlib = macports-libstdc++ and macports-gcc-6 because
"'AI_NUMERICSERV' was not declared in this scope"
------------------------+-------------------------
Reporter: ballapete | Owner: Schamschula
Type: defect | Status: closed
Priority: Normal | Milestone:
Component: ports | Version: 2.4.1
Resolution: fixed | Keywords: leopard
Port: nghttp2 |
------------------------+-------------------------
Comment (by ballapete):
Replying to [comment:11 barracuda156]:
> Replying to [comment:8 ballapete]:
> […]
>
> This is wrong, there should be no leading underscore here: `# if
__MAC_OS_X_VERSION_MIN_REQUIRED < 1060`.
> Because `AvailabilityMacros.h`, which is used for Tiger here, does not
have those: https://github.com/alexey-lysiuk/macos-
sdk/blob/a79de83d781f7fb76d329aee456bab9f72f935d1/MacOSX10.4u.sdk/usr/include/AvailabilityMacros.h#L83-L93
> This perhaps still works as-is, but simply because
`__MAC_OS_X_VERSION_MIN_REQUIRED` is undefined and defaults to 0, which is
still < 1060, so condition is evaluated as true.
> I do not see any reason to use conditioning on OS versions, however.
There are some more "faulty" patches out there! Just try
{{{
find
/opt/local/var/macports/sources/*/macports/release/tarballs/ports/*/*/files
-type f -exec grep -n __MAC_OS_X_VERSION_MIN_REQUIRED {} /dev/null \;
}}}
or
{{{
ggrep -Rn __MAC_OS_X_VERSION_MIN_REQUIRED
/opt/local/var/macports/sources/*/macports/release/tarballs/ports/*/*/files
}}}
and you'll some more such examples (134 of usage, in 58 patch files). I
think I just copied from others…
I had some `conftest.c` source file from some `configure run`. Into its
`main()` function I put the lines you don't like and pre-compiled it. I
got:
{{{
leopard pete 267 /\ grep -n MAC_OS conftest.*
conftest.c:16:#ifndef __MAC_OS_X_VERSION_MIN_REQUIRED
// are AvailabilityMacros.h or Availability.h not yet included?
conftest.c:17:# if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050
// then for Leopard and later…
conftest.c:23:#if __MAC_OS_X_VERSION_MIN_REQUIRED < 1060
// and for some OS versions do this…
conftest.cpp:114:#define __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
1058
conftest.cpp:168:#define __MAC_OS_X_VERSION_MIN_REQUIRED
__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
conftest.cpp:171:#define __MAC_OS_X_VERSION_MAX_ALLOWED 1058
}}}
or, to cite a bit more from the pre-compiled output file `conftest.cpp`:
{{{
167 # 60 "/usr/include/AvailabilityInternal.h" 3 4
168 #define __MAC_OS_X_VERSION_MIN_REQUIRED
__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
169
170
171 #define __MAC_OS_X_VERSION_MAX_ALLOWED 1058
172
173
174
175
176 #define __AVAILABILITY_INTERNAL__MAC_10_6
__AVAILABILITY_INTERNAL_UNAVAILABLE
177 # 79 "/usr/include/AvailabilityInternal.h" 3 4
}}}
On `PPC Leopard`. On `PPC Tiger` I can check later that the additional
guard makes some sense… From "theory" it looks as if
`__MAC_OS_X_VERSION_MIN_REQUIRED` is not `#define`d on `Tiger`, so
`AvailabilityMacros.h` gets `#include`d. Which looks like correct
behaviour, because afterwards we can be perfectly sure that
`__MAC_OS_X_VERSION_MIN_REQUIRED` is definitely `#define`d and we can
proceed with `AI_NUMERICSERV`.
--
Ticket URL: <https://trac.macports.org/ticket/54446#comment:16>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list