[MacPorts] #54068: mozjs17 @17.0.0_5 won't build (on PPC Tiger, Mac OS X 10.4.11) because sys/sysctl.h does not provide _SC_NPROCESSORS_ONLN but HW_NCPU
MacPorts
noreply at macports.org
Mon May 1 08:32:35 UTC 2017
#54068: mozjs17 @17.0.0_5 won't build (on PPC Tiger, Mac OS X 10.4.11) because
sys/sysctl.h does not provide _SC_NPROCESSORS_ONLN but HW_NCPU
------------------------+-------------------
Reporter: ballapete | Owner:
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.4.1
Resolution: | Keywords:
Port: mozjs17 |
------------------------+-------------------
Comment (by ballapete):
Replying to [comment:3 kencu]:
> Good work .. see also
> <https://github.com/macports/macports-
ports/commit/4678a5ef46617d3d8ba1ab4f82c7fe1182f9f9df>
OK! So your recommendation is to first include `AvailabilityMacros.h` (or
`Availability.h`) in order to have a means to determine the macOS or Mac
OS X version which is independently defined of the C compiler used?
(Because some C compilers might not define that macro?) Of course a
"globally" valid patch should start with `#ifdef __APPLE__`.
So a good patch should look like this?
{{{
#ifdef __APPLE__ #
this block only for Macs
# ifndef __MAC_OS_X_VERSION_MIN_REQUIRED #
are AvailabilityMacros.h or Availability.h not yet included?
# if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050 #
then for Leopard and later…
# include <Availability.h> #
…either include this…
# else
# include <AvailabilityMacros.h> #
…or include that
# endif
# endif
# if __MAC_OS_X_VERSION_MIN_REQUIRED < 1050 #
and for some OS versions do this…
/* whatever */
# else #
…for others do that
/* whatever else*/
# endif #
finish OS version discrimination
#endif #
finish Apple case
}}}
It would mean some effort if someone else would need to perform the
quality control *I* put into my work…
--
Ticket URL: <https://trac.macports.org/ticket/54068#comment:4>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list