Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Feb 2017 17:50:53 -0600
From:      Mark Linimon <linimon@lonesome.com>
To:        Gleb Smirnoff <glebius@FreeBSD.org>
Cc:        Benjamin Kaduk <bjkfbsd@gmail.com>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, Ravi Pokala <rpokala@mac.com>, "src-committers@freebsd.org" <src-committers@freebsd.org>, John Baldwin <jhb@freebsd.org>
Subject:   Re: svn commit: r314373 - in head: . etc/defaults etc/rc.d lib/libc/regex share/man/man4/man4.i386 share/man/man5 sys/amd64/conf sys/boot/forth sys/compat/svr4 sys/conf sys/dev/streams sys/i386/conf sy...
Message-ID:  <20170228235053.GB10976@lonesome.com>
In-Reply-To: <20170228213044.GK1044@FreeBSD.org>
References:  <201702280514.v1S5EhPq060885@repo.freebsd.org> <1969312.3TTRqhLH9r@ralph.baldwin.cx> <A783EF14-114B-4547-9737-3BB13FCE5DC4@panasas.com> <20170228193605.GJ1044@FreeBSD.org> <CAJ5_RoDzO_1OkyJ=aZAHUDBXib882%2Ba0fB0GvdQqnjUxkL6Arg@mail.gmail.com> <20170228213044.GK1044@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Feb 28, 2017 at 01:30:44PM -0800, Gleb Smirnoff wrote:
> How can I check the __FreeBSD_version in a port Makefile? My understanding
> is that there is no standard way for such thing.

There are hundreds of examples in port Makefiles.  I suppose the PH will need
to be updated to include some of them.  It is hinted at under "INCLUDE" in
https://www.freebsd.org/doc/en/books/porters-handbook/dads-noinstall.html
but not made specific.

Some quick examples:

  devel/cloudabi-toolchain/Makefile:.if ${OSVERSION} >= 1100100

  devel/cvs-syncmail/Makefile:.if ${OPSYS} == FreeBSD && ${OSVERSION} > 1000000

  devel/trio/Makefile.orig:# NB: OSVERSION was not incremented for r308559, so we use the earlier
  devel/trio/Makefile.orig:# 1200014 as a surrogate for now.
  devel/trio/Makefile.orig:.if ${OSVERSION} < 1100506 || ( ${OSVERSION} >= 1200000 && ${OSVERSION} < 1200014 )
  devel/trio/Makefile.orig:BROKEN_aarch64=         needs fixes from r308375, r308487, and/or r308559
  devel/trio/Makefile.orig:.endif

  emulators/i386-wine/Makefile.inc:.if ${OPSYS} != FreeBSD || (!(${OSVERSION} < 1000000) && !(${OSVERSION} >= 1003000 && ${OSVERSION} < 1100000) && !(${OSVERSION} >= 1100121 && ${OSVERSION} < 1200000) && !(${OSVERSION} >= 1200019 && ${OSVERSION} < 1300000))

  lang/ruby22/Makefile:.if exists(/usr/sbin/dtrace) && (${OSVERSION} > 1100032) && (${ARCH} == "amd64" || ${ARCH} == "i386")

  lang/tcc/Makefile:.if ${CC:T:M*clang*} || ${OSVERSION} >= 1000024

  sysutils/e2fsprogs/Makefile:.if !empty(PORT_OPTIONS:MNOTESTS) && (${OPSYS} == FreeBSD) && (${OSVERSION} >= 1100000 || ((${ARCH} != i386) && (${ARCH} != amd64)))

However, I am kind of shocked that this is not well understood --
especially after I have tried so many times to convince src committers
to update FreeBSD_version in case of src changes that affect (e.g. break)
ports.

These are the kinds of things that ports committers have to use to work
around changes in the src tree.  Skipping OSVERSION updates makes this
work more complicated.

mcl



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170228235053.GB10976>