ports/155566: [bsd.port.mk] [patch] use SYSDIR instead of a hardcoded path

Eitan Adler lists at eitanadler.com
Tue Mar 15 01:20:11 UTC 2011


>Number:         155566
>Category:       ports
>Synopsis:       [bsd.port.mk] [patch] use SYSDIR instead of a hardcoded path
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 15 01:20:11 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Eitan Adler
>Release:        
>Organization:
>Environment:
>Description:
A number of ports use SYSDIR to find kernel sources. I'd like to make this variable official. This patch is part one of a series of patches I will produce.
This patch documents the variable and initializes it to a sane first choice.
If this change is approved then my next patch will change the few ports which don't use this variable as well as documenting this variable in the porters handbook.


>How-To-Repeat:
./emulators/kqemu-kmod-devel/Makefile:SYSDIR?=	${SRC_BASE}/sys
./emulators/kqemu-kmod-devel/Makefile:MAKE_ENV+=	SYSDIR="${SYSDIR}"
./emulators/kqemu-kmod-devel/Makefile:.if !exists(${SYSDIR}/Makefile)
./emulators/virtualbox-ose-additions/Makefile:	cd ${VBOX_BIN}/src && make SYSDIR=${SRC_BASE}/sys
./emulators/virtualbox-ose-kmod/Makefile:KMK_CONFIG=	VBOX_LIBPATH_X11=${LOCALBASE} VBOX_FREEBSD_SRC=${SYSDIR}
./emulators/virtualbox-ose-kmod/Makefile:.if !exists(${SYSDIR}/kern/bus_if.m)
./emulators/virtualbox-ose-kmod/Makefile:	cd ${VBOX_BIN} && make SYSDIR=${SYSDIR}
./graphics/kix-kmod/Makefile:SYSDIR?=	${SRC_BASE}/sys
./graphics/kix-kmod/Makefile:.if !exists(${SYSDIR}/dev/syscons/syscons.h)
./graphics/kix-kmod/Makefile:IGNORE=		requires kernel source (in ${SYSDIR}) to build
./net/ng_daphne/Makefile:SYSDIR?=	${SRC_BASE}/sys
./net/ng_daphne/Makefile:.if !exists(${SYSDIR}/netgraph/netgraph.h)
./net/iet/Makefile:MAKE_ENV+=	KMODDIR=${KMODDIR} DATADIR=${DATADIR} SYSDIR="${SRC_BASE}/sys"
./net/skyfish/Makefile:SYSDIR?=	${SRC_BASE}/sys
./net/skyfish/Makefile:.if !exists(${SYSDIR}/Makefile)
./net/skystar2/Makefile:SYSDIR?=	${SRC_BASE}/sys
./net/skystar2/Makefile:.if !exists(${SYSDIR}/Makefile)
./net/ttbudget/Makefile:SYSDIR?=	${SRC_BASE}/sys
./net/ttbudget/Makefile:.if !exists(${SYSDIR}/Makefile)
./sysutils/fusefs-kmod/Makefile:		KMODDIR="${KMODDIR}" SYSDIR="${SRC_BASE}/sys" \
./sysutils/uhidd/Makefile:MAKE_ENV+=	SYSDIR=${SYSDIR}
./sysutils/uhidd/Makefile:SYSDIR?=	${SRC_BASE}/sys
./sysutils/uhidd/Makefile:.if !(exists(${SYSDIR}/Makefile) || exists(${SRC_BASE}/sys/Makefile))

>Fix:
Index: bsd.port.mk
===================================================================
RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.674
diff -u -r1.674 bsd.port.mk
--- bsd.port.mk	7 Mar 2011 07:32:05 -0000	1.674
+++ bsd.port.mk	15 Mar 2011 00:58:26 -0000
@@ -568,6 +568,7 @@
 # PREFIX		- Where *this* port installs its files.
 #				  Default: ${LINUXBASE} if USE_LINUX_PREFIX is set,
 #				  otherwise ${LOCALBASE}
+# SYSDIR		- The location of the kernel sources
 #
 # IGNORE_PATH_CHECKS
 #				- There are some sanity checks against PREFIX.
@@ -1216,12 +1217,14 @@
 OSREL!=	${UNAME} -r | ${SED} -e 's/[-(].*//'
 .endif
 
+SYSDIR?=		/usr/src/sys
+
 # 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
+.elif exists(${SYSDIR}/sys/param.h)
+OSVERSION!=	${AWK} '/^\#define[[:blank:]]__FreeBSD_version/ {print $$3}' < ${SYSDIR}/sys/param.h
 .else
 OSVERSION!=	${SYSCTL} -n kern.osreldate
 .endif
Index: bsd.port.subdir.mk
===================================================================
RCS file: /home/ncvs/ports/Mk/bsd.port.subdir.mk,v
retrieving revision 1.77
diff -u -r1.77 bsd.port.subdir.mk
--- bsd.port.subdir.mk	20 Dec 2010 12:23:52 -0000	1.77
+++ bsd.port.subdir.mk	15 Mar 2011 00:58:26 -0000
@@ -75,8 +75,8 @@
 .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
+.elif exists(${SYSDIR}/sys/param.h)
+OSVERSION!=	${AWK} '/^\#define[[:blank:]]__FreeBSD_version/ {print $$3}' < ${SYSDIR}/sys/param.h
 .else
 OSVERSION!=	${SYSCTL} -n kern.osreldate
 .endif


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list