--- imake/imake.c.ORIG	Mon Dec 18 14:54:34 2000
+++ imake/imake.c	Mon Dec 18 14:55:25 2000
@@ -399,7 +399,7 @@
 int
 main(int argc, char *argv[])
 {
-	FILE	*tmpfd;
+	FILE	*tmpfd = (FILE *)NULL;
 	char	makeMacro[ BUFSIZ ];
 	char	makefileMacro[ BUFSIZ ];
 
@@ -1208,6 +1208,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");
