public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix building on Solaris (and don't break Cygwin)
@ 2004-07-09 21:00 Tom Rini
  2004-07-09 21:16 ` Christoph Hellwig
  0 siblings, 1 reply; 7+ messages in thread
From: Tom Rini @ 2004-07-09 21:00 UTC (permalink / raw)
  To: Andrew Morton, Sam Ravnborg; +Cc: Kernel Mailing List

The following is from Jean-Christophe Dubois <jdubois@mc.com>.  On
Solaris 2.8, <stdint.h> does not exist, but <inttypes.h> does.  However,
on cygwin (the other odd place that the kernel is compiled on)
<inttypes.h> doesn't exist.  So we end up with something like the
following.
Signed-off-by: Tom Rini <trini@kernel.crashing.org>

--- linux-2.6.7/scripts/sumversion.c    Wed Jun 16 01:19:43 2004
+++ 2.6/scripts/sumversion.c    Fri Jul  9 04:10:27 2004
@@ -1,5 +1,9 @@
 #include <netinet/in.h>
+#ifdef __sun__
+#include <inttypes.h>
+#else // __sun__
 #include <stdint.h>
+#endif // __sun__
 #include <ctype.h>
 #include <errno.h>
 #include <string.h>
--- linux-2.6.7/scripts/genksyms/genksyms.c     Wed Jun 16 01:19:23 2004
+++ 2.6/scripts/genksyms/genksyms.c     Thu Jul  8 11:04:04 2004
@@ -27,7 +27,9 @@
 #include <unistd.h>
 #include <assert.h>
 #include <stdarg.h>
+#ifdef __GNU_LIBRARY__
 #include <getopt.h>
+#endif /* __GNU_LIBRARY__ */
 
 #include "genksyms.h"
 
@@ -502,12 +504,21 @@
        fputs("Usage:\n"
              "genksyms [-dDwqhV] > /path/to/.tmp_obj.ver\n"
              "\n"
+#ifdef __GNU_LIBRARY__
              "  -d, --debug           Increment the debug level
(repeatable)\n"
              "  -D, --dump            Dump expanded symbol defs (for
debugging only)\n"
              "  -w, --warnings        Enable warnings\n"
              "  -q, --quiet           Disable warnings (default)\n"
              "  -h, --help            Print this message\n"
              "  -V, --version         Print the release version\n"
+#else  /* __GNU_LIBRARY__ */
+             "  -d                    Increment the debug level
(repeatable)\n"
+             "  -D                    Dump expanded symbol defs (for
debugging only)\n"
+             "  -w                    Enable warnings\n"
+             "  -q                    Disable warnings (default)\n"
+             "  -h                    Print this message\n"
+             "  -V                    Print the release version\n"
+#endif /* __GNU_LIBRARY__ */
              , stderr);
 }
 
@@ -516,6 +527,7 @@
 {
   int o;
 
+#ifdef __GNU_LIBRARY__
   struct option long_opts[] = {
     {"debug", 0, 0, 'd'},
     {"warnings", 0, 0, 'w'},
@@ -528,6 +540,9 @@
 
   while ((o = getopt_long(argc, argv, "dwqVDk:p:",
                          &long_opts[0], NULL)) != EOF)
+#else  /* __GNU_LIBRARY__ */
+  while ((o = getopt(argc, argv, "dwqVDk:p:")) != EOF)
+#endif /* __GNU_LIBRARY__ */
     switch (o)
       {
       case 'd':
--- linux-2.6.7/arch/ppc/boot/utils/mkbugboot.c Wed Jun 16 01:19:36 2004
+++ 2.6/arch/ppc/boot/utils/mkbugboot.c Fri Jul  9 04:11:43 2004
@@ -21,6 +21,11 @@
 #include <stdlib.h>
 #include <errno.h>
 #include <fcntl.h>
+#ifdef __sun__
+#include <inttypes.h>
+#else // __sun__
+#include <stdint.h>
+#endif // __sun__
 
 #ifdef __i386__
 #define cpu_to_be32(x) le32_to_cpu(x)
@@ -48,11 +53,6 @@
 
 /* size of read buffer */
 #define SIZE 0x1000
-
-/* typedef long int32_t; */
-typedef unsigned long uint32_t;
-typedef unsigned short uint16_t;
-typedef unsigned char uint8_t;
 
 /* PPCBUG ROM boot header */
 typedef struct bug_boot_header {

-- 
Tom Rini
http://gate.crashing.org/~trini/

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

* Re: [PATCH] Fix building on Solaris (and don't break Cygwin)
  2004-07-09 21:00 [PATCH] Fix building on Solaris (and don't break Cygwin) Tom Rini
@ 2004-07-09 21:16 ` Christoph Hellwig
  2004-07-09 21:18   ` Tom Rini
  2004-07-11 20:19   ` H. Peter Anvin
  0 siblings, 2 replies; 7+ messages in thread
From: Christoph Hellwig @ 2004-07-09 21:16 UTC (permalink / raw)
  To: Tom Rini; +Cc: Andrew Morton, Sam Ravnborg, Kernel Mailing List

On Fri, Jul 09, 2004 at 02:00:11PM -0700, Tom Rini wrote:
> The following is from Jean-Christophe Dubois <jdubois@mc.com>.  On
> Solaris 2.8, <stdint.h> does not exist, but <inttypes.h> does.  However,
> on cygwin (the other odd place that the kernel is compiled on)
> <inttypes.h> doesn't exist.  So we end up with something like the
> following.
> Signed-off-by: Tom Rini <trini@kernel.crashing.org>

Yikes.  <stdint.h> is mandated by C99, please complain to sun instead or
write up the header yourself - it's not that difficult anyway.


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

* Re: [PATCH] Fix building on Solaris (and don't break Cygwin)
  2004-07-09 21:16 ` Christoph Hellwig
@ 2004-07-09 21:18   ` Tom Rini
  2004-07-09 21:20     ` Christoph Hellwig
  2004-07-11 20:19   ` H. Peter Anvin
  1 sibling, 1 reply; 7+ messages in thread
From: Tom Rini @ 2004-07-09 21:18 UTC (permalink / raw)
  To: Christoph Hellwig, Andrew Morton, Sam Ravnborg,
	Kernel Mailing List
  Cc: Jean-Christophe Dubois

On Fri, Jul 09, 2004 at 10:16:05PM +0100, Christoph Hellwig wrote:

> On Fri, Jul 09, 2004 at 02:00:11PM -0700, Tom Rini wrote:
> > The following is from Jean-Christophe Dubois <jdubois@mc.com>.  On
> > Solaris 2.8, <stdint.h> does not exist, but <inttypes.h> does.  However,
> > on cygwin (the other odd place that the kernel is compiled on)
> > <inttypes.h> doesn't exist.  So we end up with something like the
> > following.
> > Signed-off-by: Tom Rini <trini@kernel.crashing.org>
> 
> Yikes.  <stdint.h> is mandated by C99, please complain to sun instead or
> write up the header yourself - it's not that difficult anyway.

I forgot to CC Jean on this, but that's not exactly a nice option.  In
fact, it'd be fine to just switch to <inttypes.h>, afaics, except that
cygwin doesn't have that.

-- 
Tom Rini
http://gate.crashing.org/~trini/

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

* Re: [PATCH] Fix building on Solaris (and don't break Cygwin)
  2004-07-09 21:18   ` Tom Rini
@ 2004-07-09 21:20     ` Christoph Hellwig
  2004-07-10 20:12       ` Jean-Christophe Dubois
  0 siblings, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2004-07-09 21:20 UTC (permalink / raw)
  To: Tom Rini
  Cc: Christoph Hellwig, Andrew Morton, Sam Ravnborg,
	Kernel Mailing List, Jean-Christophe Dubois

On Fri, Jul 09, 2004 at 02:18:53PM -0700, Tom Rini wrote:
> I forgot to CC Jean on this, but that's not exactly a nice option.  In
> fact, it'd be fine to just switch to <inttypes.h>, afaics, except that
> cygwin doesn't have that.

Tell him to build on Linux, we don't support legacy OSes ;-)

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

* Re: [PATCH] Fix building on Solaris (and don't break Cygwin)
  2004-07-09 21:20     ` Christoph Hellwig
@ 2004-07-10 20:12       ` Jean-Christophe Dubois
  0 siblings, 0 replies; 7+ messages in thread
From: Jean-Christophe Dubois @ 2004-07-10 20:12 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Tom Rini, Andrew Morton, Sam Ravnborg, Kernel Mailing List,
	Jean-Christophe Dubois

Hello Christoph,

On Fri, 2004-07-09 at 23:20, Christoph Hellwig wrote:
> On Fri, Jul 09, 2004 at 02:18:53PM -0700, Tom Rini wrote:
> > I forgot to CC Jean on this, but that's not exactly a nice option.  In
> > fact, it'd be fine to just switch to <inttypes.h>, afaics, except that
> > cygwin doesn't have that.
> 
> Tell him to build on Linux, we don't support legacy OSes ;-)

Although I am certainly hopeful I will be able to use Linux end to end
in a not too distant future :), I have to work with what I am given
today. And maybe I am not the only one in this situation ...

Please be a bit compassionate with the poor souls out there that have to
cope with Legacy OSes as build systems and/or configuration management
systems :(

Also please note that 2.4 uses to build OK on Solaris. The actual 2.6
situation is a little step-back in this matter.

JC


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

* Re: [PATCH] Fix building on Solaris (and don't break Cygwin)
  2004-07-09 21:16 ` Christoph Hellwig
  2004-07-09 21:18   ` Tom Rini
@ 2004-07-11 20:19   ` H. Peter Anvin
  2004-07-12 17:44     ` Tom Rini
  1 sibling, 1 reply; 7+ messages in thread
From: H. Peter Anvin @ 2004-07-11 20:19 UTC (permalink / raw)
  To: linux-kernel

Followup to:  <20040709211605.GA6126@infradead.org>
By author:    Christoph Hellwig <hch@infradead.org>
In newsgroup: linux.dev.kernel
>
> On Fri, Jul 09, 2004 at 02:00:11PM -0700, Tom Rini wrote:
> > The following is from Jean-Christophe Dubois <jdubois@mc.com>.  On
> > Solaris 2.8, <stdint.h> does not exist, but <inttypes.h> does.  However,
> > on cygwin (the other odd place that the kernel is compiled on)
> > <inttypes.h> doesn't exist.  So we end up with something like the
> > following.
> > Signed-off-by: Tom Rini <trini@kernel.crashing.org>
> 
> Yikes.  <stdint.h> is mandated by C99, please complain to sun instead or
> write up the header yourself - it's not that difficult anyway.
> 

<inttypes.h> is also mandated by C99, and is a more complete header
(it includes stdint.h).

	-hpa

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

* Re: [PATCH] Fix building on Solaris (and don't break Cygwin)
  2004-07-11 20:19   ` H. Peter Anvin
@ 2004-07-12 17:44     ` Tom Rini
  0 siblings, 0 replies; 7+ messages in thread
From: Tom Rini @ 2004-07-12 17:44 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: linux-kernel

On Sun, Jul 11, 2004 at 08:19:14PM +0000, H. Peter Anvin wrote:
> Followup to:  <20040709211605.GA6126@infradead.org>
> By author:    Christoph Hellwig <hch@infradead.org>
> In newsgroup: linux.dev.kernel
> >
> > On Fri, Jul 09, 2004 at 02:00:11PM -0700, Tom Rini wrote:
> > > The following is from Jean-Christophe Dubois <jdubois@mc.com>.  On
> > > Solaris 2.8, <stdint.h> does not exist, but <inttypes.h> does.  However,
> > > on cygwin (the other odd place that the kernel is compiled on)
> > > <inttypes.h> doesn't exist.  So we end up with something like the
> > > following.
> > > Signed-off-by: Tom Rini <trini@kernel.crashing.org>
> > 
> > Yikes.  <stdint.h> is mandated by C99, please complain to sun instead or
> > write up the header yourself - it's not that difficult anyway.
> > 
> 
> <inttypes.h> is also mandated by C99, and is a more complete header
> (it includes stdint.h).

Which makes it quite annoying that Cygwin lacks it.

-- 
Tom Rini
http://gate.crashing.org/~trini/

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

end of thread, other threads:[~2004-07-12 17:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-09 21:00 [PATCH] Fix building on Solaris (and don't break Cygwin) Tom Rini
2004-07-09 21:16 ` Christoph Hellwig
2004-07-09 21:18   ` Tom Rini
2004-07-09 21:20     ` Christoph Hellwig
2004-07-10 20:12       ` Jean-Christophe Dubois
2004-07-11 20:19   ` H. Peter Anvin
2004-07-12 17:44     ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox