[tlbuild] Checking if biber binary can run on a given platform?

Karl Berry karl at freefriends.org
Tue Mar 29 01:06:46 CEST 2011

Resending this msg from Nikola with the technical details to this list
so it'll be in the archives.  I've implemented the test in

Date: Tue, 22 Mar 2011 19:11:47 +0100
From: Nikola Leœô ­iœô § <nikola.lecic at anthesphoria.net>
To: karl at freefriends.org (Karl Berry)

[...]  The FreeBSD Ports Collection (the official way to compile
sources) uses only param.h-grepping method. All other methods are

IMHO, the best way would be to adapt the following code extracted
from /usr/ports/Mk/bsd.port.mk, the main building infrastructure
Makefile. Biber should be installed with ${OSVERSION}>=701000.

--------------------------------- >8 ----------------------------------
AWK?=		/usr/bin/awk
SYSCTL?=	/sbin/sysctl

# Get __FreeBSD_version
.if !defined(OSVERSION)
.if exists(/usr/include/sys/param.h)
OSVERSION!=	${AWK} '/^\#define[[:blank:]]__FreeBSD_version/ {print $$3}' < /usr/include/sys/param.h
.elif exists(/usr/src/sys/sys/param.h)
OSVERSION!=	${AWK} '/^\#define[[:blank:]]__FreeBSD_version/ {print $$3}' < /usr/src/sys/sys/param.h
OSVERSION!=	${SYSCTL} -n kern.osreldate
--------------------------------- >8 ----------------------------------

The above method is used in hundreds of ports, especially when ports
system makes sensitive choices on whether to install binaries or not
(for example closed-source nvidia drivers and other such things), which
is similar to what we are trying to do.

${OSREL}, which is defined as

.if !defined(OSREL)
OSREL!= ${UNAME} -r | ${SED} -e 's/[-(].*//'

is never used to determine whether to install/compile or not to
install/compile something on FreeBSD.

More information about the tlbuild mailing list