Index: bsd.port.mk =================================================================== RCS file: /home/amdmi3/projects/freebsd/FreeBSD.cvs/ports/Mk/bsd.port.mk,v retrieving revision 1.654 diff -u -r1.654 bsd.port.mk --- bsd.port.mk 8 Nov 2010 16:07:03 -0000 1.654 +++ bsd.port.mk 9 Nov 2010 20:33:22 -0000 @@ -323,6 +323,14 @@ # 'yes' as a library dependency # 'run' as a run-time dependency ## +# USE_SRC - If set, this port requires system sources installed +# SRC_BASE - Set to path to system sources. +# Default: /usr/src +# DISABLE_SRC_VERSION_CHECK +# - Set by user to disable check for that sources and +# system version match (use on your own risk). +# Default: not set +## # USE_PERL5 - If set, this port uses perl5 in one or more of the extract, # patch, build, install or run phases. # USE_PERL5_BUILD @@ -1216,12 +1224,14 @@ OSREL!= ${UNAME} -r | ${SED} -e 's/[-(].*//' .endif +SRC_BASE?= /usr/src + # 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!= ${AWK} '/^\#define[[:blank:]]__FreeBSD_version/ {print $$3}' < /usr/src/sys/sys/param.h .else OSVERSION!= ${SYSCTL} -n kern.osreldate .endif @@ -2311,6 +2321,16 @@ PTHREAD_CFLAGS?= PTHREAD_LIBS?= -pthread +.if defined(USE_SRC) +. if !exists(${SRC_BASE}/sys/sys/param.h) +IGNORE= requires system sources installed +. endif +SRCVERSION!= ${AWK} '/^\#define[[:blank:]]__FreeBSD_version/ {print $$3}' < ${SRC_BASE}/sys/sys/param.h +. if !defined(DISABLE_SRC_VERSION_CHECK) && ${SRCVERSION} != ${OSVERSION} +IGNORE= the version of system sources at ${SRC_BASE} doesn't match with your system version +. endif +.endif + .if exists(/usr/bin/fetch) FETCH_BINARY?= /usr/bin/fetch FETCH_ARGS?= -ApRr