All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix building kernel under Solaris
@ 2007-03-06 18:09 Deepak Saxena
  2007-03-06 18:22 ` Deepak Saxena
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Deepak Saxena @ 2007-03-06 18:09 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel


Fix varous build breakages that occur when building on a Solaris system
(SunOS 4.8 to be exact)

- No asm/types.h

- lpptest doesn't make sense on a Solaris host (this should really be
  cross-built..)

- Need to define __s32 and __s16

- Need to define Elf32_Section and Elf64_Section

- Solaris does not provide strsep

Signed-off-by: Deepak Saxena <dsaxena@mvista.com>


diff -uNr -X /home/src/dontdiff /home/src/mvista/kernel/PRO5-CLEAN/linux-2.6.18/include/linux/input.h linux-2.6.18_pro500/include/linux/input.h
--- /home/src/mvista/kernel/PRO5-CLEAN/linux-2.6.18/include/linux/input.h	2007-03-05 21:54:45.000000000 -0800
+++ linux-2.6.18_pro500/include/linux/input.h	2007-03-05 19:19:01.000000000 -0800
@@ -16,8 +16,10 @@
 #include <sys/time.h>
 #include <sys/ioctl.h>
 #include <sys/types.h>
+#ifndef __sun__
 #include <asm/types.h>
 #endif
+#endif
 
 /*
  * The event structure itself
diff -uNr -X /home/src/dontdiff /home/src/mvista/kernel/PRO5-CLEAN/linux-2.6.18/scripts/Makefile linux-2.6.18_pro500/scripts/Makefile
--- /home/src/mvista/kernel/PRO5-CLEAN/linux-2.6.18/scripts/Makefile	2007-03-05 21:54:43.000000000 -0800
+++ linux-2.6.18_pro500/scripts/Makefile	2007-03-05 19:54:52.000000000 -0800
@@ -12,10 +12,12 @@
 hostprogs-$(CONFIG_VT)           += conmakehash
 hostprogs-$(CONFIG_PROM_CONSOLE) += conmakehash
 hostprogs-$(CONFIG_IKCONFIG)     += bin2c
+HOST_OS := $(shell uname)
+ifneq ($(HOST_OS),SunOS)
 ifdef CONFIG_LPPTEST
 hostprogs-y      += testlpp
 endif
-
+endif
 always		:= $(hostprogs-y)
 
 subdir-$(CONFIG_MODVERSIONS) += genksyms
diff -uNr -X /home/src/dontdiff /home/src/mvista/kernel/PRO5-CLEAN/linux-2.6.18/scripts/mod/file2alias.c linux-2.6.18_pro500/scripts/mod/file2alias.c
--- /home/src/mvista/kernel/PRO5-CLEAN/linux-2.6.18/scripts/mod/file2alias.c	2007-03-05 21:54:42.000000000 -0800
+++ linux-2.6.18_pro500/scripts/mod/file2alias.c	2007-03-05 19:19:26.000000000 -0800
@@ -29,6 +29,11 @@
 
 #include <ctype.h>
 
+#if defined(__sun__)
+typedef int32_t	__s32;
+typedef int16_t	__s16;
+#endif
+
 #if defined(__CYGWIN__)
 typedef __uint32_t	__u32;
 #else
diff -uNr -X /home/src/dontdiff /home/src/mvista/kernel/PRO5-CLEAN/linux-2.6.18/scripts/mod/modpost.h linux-2.6.18_pro500/scripts/mod/modpost.h
--- /home/src/mvista/kernel/PRO5-CLEAN/linux-2.6.18/scripts/mod/modpost.h	2007-03-05 21:54:42.000000000 -0800
+++ linux-2.6.18_pro500/scripts/mod/modpost.h	2007-03-05 19:13:16.000000000 -0800
@@ -15,6 +15,11 @@
 
 #include "elfconfig.h"
 
+#if defined(__sun__)
+typedef uint16_t Elf32_Section;
+typedef uint16_t Elf64_Section;
+#endif
+
 #if KERNEL_ELFCLASS == ELFCLASS32
 
 #define Elf_Ehdr    Elf32_Ehdr
diff -uNr -X /home/src/dontdiff /home/src/mvista/kernel/PRO5-CLEAN/linux-2.6.18/scripts/mod/sumversion.c linux-2.6.18_pro500/scripts/mod/sumversion.c
--- /home/src/mvista/kernel/PRO5-CLEAN/linux-2.6.18/scripts/mod/sumversion.c	2007-03-05 21:54:42.000000000 -0800
+++ linux-2.6.18_pro500/scripts/mod/sumversion.c	2007-03-05 19:33:55.000000000 -0800
@@ -1,6 +1,7 @@
 #if defined(__sun__)
 #include <netinet/in.h>
 #include <inttypes.h>
+#include <limits.h>
 #elif defined(__CYGWIN__)
 #include <asm/byteorder.h>	/* For ntohl/htonl */
 #include <limits.h>
@@ -421,9 +422,16 @@
 	*end = '\0';
 
 	md4_init(&md);
+/*
+ * Solaris does not strsep
+ */
+#ifndef __sun__
 	while ((fname = strsep(&sources, " ")) != NULL) {
 		if (!*fname)
 			continue;
+#else
+	for (fname = strtok(sources, " "); fname; fname = strtok(NULL, " ")) {
+#endif
 		if (!parse_source_files(fname, &md))
 			goto release;
 	}


-- 
Deepak Saxena - dsaxena@plexity.net - http://www.plexity.net

In the end, they will not say, "those were dark times,"  they will ask
"why were their poets silent?" - Bertolt Brecht

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2007-03-10  9:37 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-06 18:09 [PATCH] Fix building kernel under Solaris Deepak Saxena
2007-03-06 18:22 ` Deepak Saxena
2007-03-06 19:23 ` Sam Ravnborg
2007-03-07  9:42 ` Christoph Hellwig
2007-03-07 22:45   ` Jan Engelhardt
2007-03-08  8:35     ` Christoph Hellwig
2007-03-08 20:43       ` Jan Engelhardt
2007-03-08 21:25         ` Sam Ravnborg
2007-03-08 22:01           ` [PATCH] Fix building kernel under Solaris 11_snv Jan Engelhardt
2007-03-09 19:00             ` Sam Ravnborg
2007-03-09 20:16               ` Jan Engelhardt
2007-03-09 22:23                 ` Sam Ravnborg
2007-03-09 22:55                   ` Jan Engelhardt
2007-03-10  9:37                   ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.