diff options
author | wollman <wollman@FreeBSD.org> | 1994-08-10 06:25:07 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1994-08-10 06:25:07 +0000 |
commit | f0e3ec0f969773ab477b4ad957e73fd26d41bc8a (patch) | |
tree | 13d577b69718b7ebec0b718a2f0cb456791e77d7 /include | |
parent | 723735466d0c88ab1e89fa509d02a427c69d822a (diff) | |
download | FreeBSD-src-f0e3ec0f969773ab477b4ad957e73fd26d41bc8a.zip FreeBSD-src-f0e3ec0f969773ab477b4ad957e73fd26d41bc8a.tar.gz |
Make it easier for programs to figure out what revision of FreeBSD they
are running under. Here's how to bootstrap (order is important):
1) Re-compile gcc (just the driver is all you need).
2) Re-compile libc.
3) Re-compile your kernel. Reboot.
4) cd /usr/src/include; make install
You can now detect the compilation environment with the following code:
#if !defined(__FreeBSD__)
#define __FreeBSD_version 199401
#elif __FreeBSD__ == 1
#define __FreeBSD_version 199405
#else
#include <osreldate.h>
#endif
You can determine the run-time environment by calling the new C library
function getosreldate(), or by examining the MIB variable kern.osreldate.
For the time being, the release date is defined as 199409, which we have
already established as our target.
Diffstat (limited to 'include')
-rw-r--r-- | include/Makefile | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/Makefile b/include/Makefile index d8fd2d2..1fc8979 100644 --- a/include/Makefile +++ b/include/Makefile @@ -1,5 +1,5 @@ # From: @(#)Makefile 8.2 (Berkeley) 1/4/94 -# $Id: Makefile,v 1.7 1994/08/04 20:49:28 wollman Exp $ +# $Id: Makefile,v 1.8 1994/08/07 22:29:20 wollman Exp $ # # Doing a make install builds /usr/include # @@ -43,6 +43,11 @@ beforeinstall: ${SHARED} install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$i \ ${DESTDIR}/usr/include/$$i; \ done + @echo creating osreldate.h + @rm -f ${DESTDIR}/usr/include/osreldate.h + @echo \#'undef __FreeBSD_version' > ${DESTDIR}/usr/include/osreldate.h + @echo \#'define __FreeBSD_version '`sysctl -n kern.osreldate` \ + >> ${DESTDIR}/usr/include/osreldate.h @echo installing ${DIRS} @-for i in ${DIRS}; do \ if [ ! -d ${DESTDIR}/usr/include/$$i ]; \ |