Do not check for existence of ${_dir}/kern/ , because for modules that set
.PATH to ${.CURDIR}/[...]/kern , the "exists" expression will fail for the form exists(${.CURDIR}/[...]/kern/). This appears to be happening because make is searching for the argument to "exists" by using .PATH rather than a relative search, because .PATH and the argument match at the beginning. Additionally, make appears to consider a path that starts with ${.CURDIR} as relative, even though it expands to an absolute path. The reason that most people aren't seeing this problem is that the absolute paths of /usr/src/sys and /sys are also searched, so as long as the kernel source can be found in at least one of those places, no problems surface. This problem was inadvertently introduced on 1 December 2000, with the addition of the sysvipc modules.
This commit is contained in:
parent
959b7375ed
commit
aabafca098
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=69775
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
# Search for kernel source tree in standard places.
|
# Search for kernel source tree in standard places.
|
||||||
.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. /sys /usr/src/sys
|
.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. /sys /usr/src/sys
|
||||||
.if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/)
|
.if !defined(SYSDIR) && exists(${_dir}/conf/kmod.mk)
|
||||||
SYSDIR= ${_dir}
|
SYSDIR= ${_dir}
|
||||||
.endif
|
.endif
|
||||||
.endfor
|
.endfor
|
||||||
.if !defined(SYSDIR) || !exists(${SYSDIR}/kern/) || !exists(${SYSDIR}/conf/)
|
.if !defined(SYSDIR) || !exists(${SYSDIR}/kern) || !exists(${SYSDIR}/conf/)
|
||||||
.error "can't find kernel source tree"
|
.error "can't find kernel source tree"
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
@ -166,7 +166,7 @@ beforedepend ${OBJS}: ${_ILINKS}
|
|||||||
SYSDIR= ${_dir}
|
SYSDIR= ${_dir}
|
||||||
.endif
|
.endif
|
||||||
.endfor
|
.endfor
|
||||||
.if !defined(SYSDIR) || !exists(${SYSDIR}/kern/)
|
.if !defined(SYSDIR) || !exists(${SYSDIR}/kern)
|
||||||
.error "can't find kernel source tree"
|
.error "can't find kernel source tree"
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user