Fall back to using the kernel version for the OSRELDATE when

/usr/include/osreldate.h doesn't exist on the system.  While this
could be worked around by saying something like 'make includes
OSLRELDATE=0' when this file doesn't exist, it is just as easy to
provide a fallback when the file we know we depend on doesn't exist.
While this doesn't make all targets work w/o a
/usr/include/osreldate.h, because some of the FreeBSD bootstrap tools
use this file.  'make includes' however does work.

Noticed by: peter, obrien (and likely others)
Pointy hat to: imp (for suggesting a method that depended on /usr/include)
This commit is contained in:
Warner Losh 2003-08-25 17:48:25 +00:00
parent 3a83be8e3b
commit b21d83f121

View File

@ -123,8 +123,12 @@ SUPFLAGS+= -h ${SUPHOST}
MAKEOBJDIRPREFIX?= /usr/obj
.if !defined(OSRELDATE)
.if exists(/usr/include/osreldate.h)
OSRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \
/usr/include/osreldate.h
.else
OSRELDATE!= sysctl -n kern.osreldate
.endif
.endif
TARGET_ARCH?= ${MACHINE_ARCH}
.if ${TARGET_ARCH} == ${MACHINE_ARCH}