Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Apr 2013 12:12:22 -0500
From:      Scot Hetzel <swhetzel@gmail.com>
To:        FreeBSD Ports <freebsd-ports@freebsd.org>
Subject:   Using OSVERSION in Templates/config.site
Message-ID:  <CACdU%2Bf_VST821x_SZt7SntmqEh9Bo5OR7iWXRKXgUs4K95Mf9g@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Recently a new variable was added to config.site that broke the build on
older systems as it said that we have that function (it was fixed by
commenting out that variable).  In order to allow this new variable to
still be used, I propose that we add the following (taken from bsd.ports.mk)
to the top of config.site:

AWK=/usr/bin/awk
SYSCTL=/sbin/sysctl

if [ "${SRC_BASE}x" = "x" ] ; then
    SRC_BASE=/usr/src
fi

# Get __FreeBSD_version
if [ "${OSVERSION}x" = "x" ] ; then
    if [ -e /usr/include/sys/param.h ] ; then
        OSVERSION=`${AWK} '/^\#define[[:blank:]]__FreeBSD_version/ {print
$$3}' < /usr/include/sys/param.h`
    else if [ -e ${SRC_BASE}/sys/sys/param.h ] ; then
        OSVERSION=`${AWK} '/^\#define[[:blank:]]__FreeBSD_version/ {print
$$3}' < ${SRC_BASE}/sys/sys/param.h`
    else
        OSVERSION=`${SYSCTL} -n kern.osreldate`
    fi
fi

NOTE: OSVERSION and SRC_BASE can be overridden in the CONFIGURE_ENV if
needed.

Then we can change all the commented out variables to:

# Has appeared in FreeBSD 10-CURRENT and FreeBSD 9.1-STABLE
if [ (${OSVERSION} -ge 901503 -a ${OSVERSION} -lt 10000000) -o ${OSVERSION}
-ge 1000025 ]; then
    ac_cv_func_waitid=${ac_cv_func_waitid=yes}
else
    ac_cv_func_waitid=${ac_cv_func_waitid=no}
fi

Unfortunately, my system is down so I won't be able to provide a patch for
this.

-- 
DISCLAIMER:

No electrons were maimed while sending this message. Only slightly bruised.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACdU%2Bf_VST821x_SZt7SntmqEh9Bo5OR7iWXRKXgUs4K95Mf9g>