FreeBSD specific hack -- prefer OSREL from the environment over what

uname(3) says.  This is necessary for cross-version chroot builds.

Requested by:	PW
Submitted by:	maintainer
This commit is contained in:
Satoshi Asami 2000-09-29 00:21:49 +00:00
parent 4f7519b08e
commit e9af94f3e7
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=33237
2 changed files with 44 additions and 0 deletions

View file

@ -0,0 +1,22 @@
--- imake/imake.c~ Thu Jun 15 04:36:17 2000
+++ imake/imake.c Thu Sep 28 13:58:02 2000
@@ -1184,6 +1184,19 @@
if (uname(&name) < 0)
LogFatal("Cannot invoke uname", "");
+# ifdef __FreeBSD__
+ /* Hack for FreeBSD ports "Cross Version" compiling system. */
+ {
+ char *e;
+ if ((e = getenv("OSREL")) != NULL &&
+ strlen(name.sysname) + strlen(e) + 1 < SYS_NMLN) {
+ strcpy(name.release, e);
+ strcpy(name.version, name.sysname);
+ strcat(name.version, " ");
+ strcat(name.version, e);
+ }
+ }
+# endif
# ifdef DEFAULT_OS_NAME
parse_utsname(&name, DEFAULT_OS_NAME, buf,
"Bad DEFAULT_OS_NAME syntax %s");

View file

@ -0,0 +1,22 @@
--- config/imake/imake.c~ Thu Jun 15 04:36:17 2000
+++ config/imake/imake.c Thu Sep 28 13:58:02 2000
@@ -1184,6 +1184,19 @@
if (uname(&name) < 0)
LogFatal("Cannot invoke uname", "");
+# ifdef __FreeBSD__
+ /* Hack for FreeBSD ports "Cross Version" compiling system. */
+ {
+ char *e;
+ if ((e = getenv("OSREL")) != NULL &&
+ strlen(name.sysname) + strlen(e) + 1 < SYS_NMLN) {
+ strcpy(name.release, e);
+ strcpy(name.version, name.sysname);
+ strcat(name.version, " ");
+ strcat(name.version, e);
+ }
+ }
+# endif
# ifdef DEFAULT_OS_NAME
parse_utsname(&name, DEFAULT_OS_NAME, buf,
"Bad DEFAULT_OS_NAME syntax %s");