[En-Nut-Discussion] PATCH: build fixes for MacOSX native

Bernardo Innocenti bernie at develer.com
Thu Mar 17 05:32:19 CET 2005


Hello,

these are a few fixes to build NutOS in UNIX emulation
mode on MacOSX.

A few notes:

 - in my opinion, all the pattern rules in Makerules.*
   should be written as "%.o : %.c" rather than "%o : %c",
   otherwise they don't replace the builtin pattern rules
   of GNU make;

 - the file include/unistd.h shadows the system header
   with the same name.  Build fails because of missing
   declarations such as STDIN_FILENO.  As a workaround,
   I removed the Nut version, but of course a cleaner
   solution is needed.


Thank you for providing such a great piece of software!


Index: Makerules.unix-gcc
===================================================================
RCS file: /cvs/bakeoven/bakeoven/Makerules.unix-gcc,v
retrieving revision 1.1.1.1
diff -u -p -u -p -r1.1.1.1 Makerules.unix-gcc
--- Makerules.unix-gcc	17 Mar 2005 04:00:25 -0000	1.1.1.1
+++ Makerules.unix-gcc	16 Mar 2005 18:49:22 -0000
@@ -56,6 +56,9 @@
 %o : %c
 	$(CC) -c $(CPFLAGS) -I$(MODINC) -I$(INCDIR) $< -o $@
 
+%.o : %.cc
+	$(CXX) -c $(CPFLAGS) -I$(MODINC) -I$(INCDIR) $< -o $@
+
 %s : %c
 	$(CC) -S $(CPFLAGS) -I$(MODINC) -I$(INCDIR) $< -o $@
 
Index: fs/pnutfs.c
===================================================================
RCS file: /cvs/bakeoven/bakeoven/fs/pnutfs.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- fs/pnutfs.c	17 Mar 2005 04:00:26 -0000	1.1
+++ fs/pnutfs.c	17 Mar 2005 04:05:50 -0000	1.2
@@ -1253,7 +1253,7 @@ static int PnutInit(NUTDEVICE * dev)
     }
 
     /* Initialize the root directory. */
-    if ((root = PnutNodeAlloc(NODETYPE_DIR)) == -1) {
+    if ((root = PnutNodeAlloc(NODETYPE_DIR)) == (u_short)-1) {
         rc = ENOSPC;
     } else {
         if ((rc = PnutDirAddEntry(root, ".", root)) == 0) {
Index: app/tcps/tcps.c
===================================================================
RCS file: /cvs/bakeoven/bakeoven/app/tcps/tcps.c,v
retrieving revision 1.1.1.1
diff -u -p -u -p -r1.1.1.1 tcps.c
--- app/tcps/tcps.c	17 Mar 2005 04:00:26 -0000	1.1.1.1
+++ app/tcps/tcps.c	16 Mar 2005 18:53:40 -0000
@@ -191,7 +191,7 @@ void ProcessRequests(FILE * stream)
                     fputs("\tSleep\t", stream);
                     break;
                 }
-                fprintf(stream, "%u\t%u", tdp->td_priority, (u_short) tdp->td_sp - (u_short) tdp->td_memory);
+                fprintf(stream, "%u\t%u", tdp->td_priority, (unsigned int) tdp->td_sp - (unsigned int) tdp->td_memory);
                 if (*((u_long *) tdp->td_memory) != DEADBEEF)
                     fputs("\tCorrupted\t", stream);
                 else

-- 
  // Bernardo Innocenti - Develer S.r.l., R&D dept.
\X/  http://www.develer.com/




More information about the En-Nut-Discussion mailing list