changeset 151:ef5959682d03

fix for linux
author kono
date Thu, 17 Jan 2019 16:32:19 +0900
parents da020c491fbb
children 97a597b0afcd
files os9/Makefile os9/level1/Makefile os9/level2/Makefile os9/makerom.c src/Makefile src/makerom.c src/v09.c src/vdisk.c
diffstat 8 files changed, 23 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/os9/Makefile	Thu Jan 17 08:17:11 2019 +0900
+++ b/os9/Makefile	Thu Jan 17 16:32:19 2019 +0900
@@ -1,7 +1,6 @@
 all: os9mod make9rom  os9v2.rom os9v1.rom level1/init level2/init
 
-CC=clang
-CFLAGS = -g
+CFLAGS = -g # -std=c99 -D_POSIX_C_SOURCE=1 -D_XOPEN_SOURCE=1 -D_POSIX_SOURCE=200809L -D_GNU_SOURCE=1
 
 os9mod : crc.c os9.h os9mod.c os9.h
 	$(CC) $(CFLAGS) -o os9mod crc.c  os9mod.c
@@ -16,7 +15,7 @@
 	./make9rom -o os9v1.rom  level1/shell level1/sysgo level1/ioman level1/term level1/pty level1/pdisk level1/d0 level1/d1 level1/vrbf level1/v0 level1/clock level1/scf level1/rbf level1/init level1/os9p2 level1/os9p1
    
 os9v2.rom : make9rom level2/init
-	./make9rom -o os9v2.rom -2  level2/Shell  level2/dir level2/d1 level2/ioman  level2/os9p3_perr level2/os9p4_regdump  level2/pipe level2/piper level2/pipeman  level2/v0 level2/vrbf level2/scf level2/rbf level2/os9p2 level2/sysgo level2/clock level2/pdisk level2/d0 level2/pty level2/term level2/init level2/boot level2/os9p1 
+	./make9rom -o os9v2.rom -2  level2/shell  level2/dir level2/d1 level2/ioman  level2/os9p3_perr level2/os9p4_regdump  level2/pipe level2/piper level2/pipeman  level2/v0 level2/vrbf level2/scf level2/rbf level2/os9p2 level2/sysgo level2/clock level2/pdisk level2/d0 level2/pty level2/term level2/init level2/boot level2/os9p1 
 
 level1/init : nitros9-code
 	cd level1 ; make
--- a/os9/level1/Makefile	Thu Jan 17 08:17:11 2019 +0900
+++ b/os9/level1/Makefile	Thu Jan 17 16:32:19 2019 +0900
@@ -8,7 +8,7 @@
 
 MOD =  pdisk init os9p1 os9p2 ioman pipe piper rbf scf term pty d0 d1 vrbf v0 clock shell dir mdir sysgo shell
 
-all : ${MOD}
+all : ${MOD} TL1
 	cd cmds; make
 
 clean : 
@@ -87,3 +87,6 @@
 scf :
 	$(A09) ${SRCDIR}/scf.asm -o scf $(LST)
 
+TL1 :
+	ln -s ../../TL1 .
+	ln -s ../../mc09 .
--- a/os9/level2/Makefile	Thu Jan 17 08:17:11 2019 +0900
+++ b/os9/level2/Makefile	Thu Jan 17 16:32:19 2019 +0900
@@ -7,7 +7,7 @@
 
 ALL = ioman pdisk init os9p1 os9p2 os9p3_perr os9p4_regdump pipe pipeman pipeman_named piper rbf scf term pty d0 d1 clock vector boot shell dir mdir sysgo v0 vrbf
 
-all : $(ALL)
+all : $(ALL) TL1
 	cd cmds ; make
 
 clean : 
@@ -93,3 +93,7 @@
 scf :
 	$(A09) $(OS9SRC)/level1/modules/scf.asm  -o $@ $(LST)
 
+TL1 :
+	ln -s ../../TL1 .
+	ln -s ../../mc09 .
+
--- a/os9/makerom.c	Thu Jan 17 08:17:11 2019 +0900
+++ b/os9/makerom.c	Thu Jan 17 16:32:19 2019 +0900
@@ -8,6 +8,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <strings.h>
+#include <string.h>
 #include <sys/stat.h>
 
 // #define DEBUG 1
--- a/src/Makefile	Thu Jan 17 08:17:11 2019 +0900
+++ b/src/Makefile	Thu Jan 17 16:32:19 2019 +0900
@@ -10,7 +10,10 @@
 #
 
 # CFLAGS=-O3 -fomit-frame-pointer -DTERM_CONTROL
-CFLAGS=-g  -DTERM_CONTROL
+
+CFLAGS=-g  -DTERM_CONTROL  \
+   -std=c99 -D_POSIX_C_SOURCE=1 -D_XOPEN_SOURCE=1 -D_POSIX_SOURCE=200809L -D_GNU_SOURCE=1 \
+    -Dd_namlen=d_reclen 
 
 V09FLAGS= -DUSE_TERMIOS # -DNOFMEMOPEN -DBIG_ENDIAN
 
--- a/src/makerom.c	Thu Jan 17 08:17:11 2019 +0900
+++ b/src/makerom.c	Thu Jan 17 16:32:19 2019 +0900
@@ -6,6 +6,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <strings.h>
+#include <string.h>
 
 static int sum,charindex;
 unsigned char mem[0x8000];
--- a/src/v09.c	Thu Jan 17 08:17:11 2019 +0900
+++ b/src/v09.c	Thu Jan 17 16:32:19 2019 +0900
@@ -31,6 +31,7 @@
 #include <stdlib.h>
 #include <strings.h>
 #include <sys/stat.h>
+#include <string.h>
 
 #define engine extern
 
--- a/src/vdisk.c	Thu Jan 17 08:17:11 2019 +0900
+++ b/src/vdisk.c	Thu Jan 17 16:32:19 2019 +0900
@@ -17,6 +17,7 @@
 #include <time.h>
 #include <arpa/inet.h>
 #include <fcntl.h>
+#include <sys/types.h>
 
 static int vdiskdebug = 0;  //   bit 1 trace, bit 2 filename
 
@@ -359,10 +360,10 @@
 }
 
 static void 
-os9setdate(Byte *d,struct timespec * unixtime) {
+os9setdate(Byte *d,time_t * unixtime) {
     //   yymmddhhss
     struct tm r;
-    localtime_r(&unixtime->tv_sec,&r);
+    localtime_r(unixtime,&r);
     d[0] = r.tm_year-2048;
     d[1] = r.tm_mon + 1;
     d[2] = r.tm_mday;
@@ -388,13 +389,13 @@
     os9setmode(buf+FD_ATT,st.st_mode);
     buf[FD_OWN]=(st.st_uid&0xff00)>>8;
     buf[FD_OWN+1]=st.st_uid&0xff;
-    os9setdate(buf+ FD_DAT,&st.st_mtimespec);
+    os9setdate(buf+ FD_DAT,&st.st_mtime);
     buf[FD_LNK]=st.st_nlink&0xff;
     buf[FD_SIZ+0]=(st.st_size&0xff000000)>>24;
     buf[FD_SIZ+1]=(st.st_size&0xff0000)>>16;
     buf[FD_SIZ+2]=(st.st_size&0xff00)>>8;
     buf[FD_SIZ+3]=st.st_size&0xff;
-    os9setdate(buf+FD_Creat,&st.st_ctimespec);
+    os9setdate(buf+FD_Creat,&st.st_ctime);
     err = 0;
 err1:
     free(pd.name);