PERFORCE change 99805 for review
Gabor Kovesdan
gabor at FreeBSD.org
Thu Jun 22 13:06:08 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=99805
Change 99805 by gabor at spitfire on 2006/06/22 13:05:50
Try to get OSVERSION from userland if possible, since userland
has more impact on the ports as kernel does and this approach also
fixes issues when we have a kernel and a jail with different
OSVERSIONs and issues with DESTDIR. If getting OSVERSION from
userland is impossible it is still got from the kernel.
Affected files ...
.. //depot/projects/soc2006/gabor_ports/Mk/bsd.port.mk#4 edit
Differences ...
==== //depot/projects/soc2006/gabor_ports/Mk/bsd.port.mk#4 (text+ko) ====
@@ -1137,13 +1137,18 @@
OSREL!= ${UNAME} -r | ${SED} -e 's/[-(].*//'
.endif
-### FIXME: OSVERSION in DESTDIR and in jail
-
# Get __FreeBSD_version
.if !defined(OSVERSION)
-OSVERSION!= ${SYSCTL} -n kern.osreldate
+.if exists(${DESTDIR}/usr/include/sys/param.h)
+OSVERSION!= ${AWK} '/^\#define __FreeBSD_version/ {print $$3}' < ${DESTDIR}/usr/include/sys/param.h
+.elif exists(${DESTDIR}/usr/src/sys/sys/param.h)
+OSVERSION!= ${AWK} '/^\#define __FreeBSD_version/ {print $$3}' < ${DESTDIR}/usr/src/sys/sys/param.h
+.else
+OSVERSION!= /sbin/sysctl -n kern.osreldate
+.endif
.endif
+
# Get the object format.
.if !defined(PORTOBJFORMAT)
PORTOBJFORMAT!= ${TEST} -x /usr/bin/objformat && /usr/bin/objformat || ${ECHO_CMD} aout
More information about the p4-projects
mailing list