requesting help with Variable OSREL in port Makefile

Kurt Jaeger pi at opsec.eu
Sun Aug 14 06:46:53 UTC 2016


Hi!

>  >> .if ${OPSYS} == FreeBSD && ${OSVERSION} < 1000000
>  >> IGNORE= builds only on 10 or greater than 10
>  >> .endif
>  >
>  > That's OSVERSION. The OP asked about OSREL.
>  >
>  > (however, OSVERSION is more useful as one can test it numerically; it
>  > is documented in Chapter 16 of the Porter's Handbook, if the OP wants
>  > to know more)
> 
> I read Chapter 16 of the Porter's Handbook before posting. It doesn't 
> say how you got to a "1000000" value for OSVERSION. Why so many zeros?

We read os-versions like 10.3 or 2.2.1 or something.

make does not support version comparisons like that. To allow
comparisions, we need a way to map 10.3.x to some numeric
value. To allow increments of sub-versions while the major
version already progressed, 0's are added.

Sometimes, the version has to increment to differentiate
that the ABI or API changed.

See for example 1000000 and 1000001, where the 1 notes the
addition of the posix_fadvise(2) system call.

> A 10.0 value is what I interpret to be the value for OSREL. Is that 
> correct?

I think so, yes.

> The IGNORE= keyword is confusing also. The port will build/install on 
> all versions. Its just that some things in 10.0 changed that caused the 
> port source to be modified to work on 10.0 and newer systems. It will 
> not work correctly on 9.3 and older systems. So I want the port/pkg to 
> check the host version and refuse to install if installing on 9.3 or 
> older systems. This has no impact on the auto building of pkgs.

Then use BROKEN or IGNORE.

> The Porter's Handbook section containing the OSREL Variable talks about 
> the placement of the OSREL Variable is critical and based on where 
> bsd.port.pre.mk statement is located in the Makefile. I don't have a 
> existing bsd.port.pre.mk statement in the Makefile. Do I need to add one?

If you refer to OSREL, yes. It is defined in bsd.port.pre.mk.

-- 
pi at opsec.eu            +49 171 3101372                         4 years to go !


More information about the freebsd-ports mailing list