diff --git a/.gitignore b/.gitignore index 666de77..4d529be 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,8 @@ sunos5.386-x/** sunos5.386/** sunos5.sparc-x/** sunos5.sparc/** +linux.x86_64-x/** +linux.x86_64/** init.386/** # core files core diff --git a/bin/machinetype b/bin/machinetype index 2caa90d..4a69495 100755 --- a/bin/machinetype +++ b/bin/machinetype @@ -16,6 +16,7 @@ case "$os" in sparc-*) echo sparc ;; alpha-*) echo alpha ;; i*86-*-*) echo 386 ;; + x86_64-*) echo x86_64 ;; powerpc-*) echo ppc ;; esac diff --git a/bin/makefile-linux.386-x b/bin/makefile-linux.386-x index 3e36ce7..d4ee52f 100755 --- a/bin/makefile-linux.386-x +++ b/bin/makefile-linux.386-x @@ -24,7 +24,7 @@ DISPOPTFLAGS = -O2 -g3 FPFLAGS = DFLAGS = -DFSERROR -DNEW_STORAGE -DLINUX -DAIX -DOLD_CURSOR -DUSETERMIOS \ -DBYTESWAP -DFORKCOMM -DNOFORN -DLOGINT $(XFLAGS) \ - -DRELEASE=351 -D__USE_BSD -DSYSVSIGNALS + -DRELEASE=351 -D__USE_BSD -DSYSVSIGNALS -DSYSVONLY LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm -lcrypt LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm -lcrypt diff --git a/bin/makefile-linux.x86_64-x b/bin/makefile-linux.x86_64-x new file mode 100755 index 0000000..bce1f88 --- /dev/null +++ b/bin/makefile-linux.x86_64-x @@ -0,0 +1,104 @@ +# Options for Linux, Intel x86_64 and X-Window + +#CC = gcc -m64 -std=gnu89 -fno-omit-frame-pointer -Wall -Wextra -fwrapv -fno-aggressive-loop-optimizations -fno-strict-aliasing + +CC = clang -m64 -std=gnu89 +XFILES = $(OBJECTDIR)xmkicon.o \ + $(OBJECTDIR)xbbt.o \ + $(OBJECTDIR)dspif.o \ + $(OBJECTDIR)xinit.o \ + $(OBJECTDIR)xscroll.o \ + $(OBJECTDIR)xcursor.o \ + $(OBJECTDIR)xlspwin.o \ + $(OBJECTDIR)xrdopt.o \ + $(OBJECTDIR)xwinman.o + + +XVERSION = XV11R4 +XFLAGS = -DXWINDOW -DNOPIXRECT -D$(XVERSION) # $(CLXFLAGS) + +# This is to make the %$#@! Apollo cc happy +OEXT = .o +# OPTFLAGS is normally -O2. +OPTFLAGS = -O2 -g3 +DISPOPTFLAGS = -O2 -g3 +FPFLAGS = +DFLAGS = -DFSERROR -DNEW_STORAGE -DLINUX -DAIX -DOLD_CURSOR -DUSETERMIOS \ + -DBYTESWAP -DFORKCOMM -DNOFORN -DLOGINT $(XFLAGS) \ + -DRELEASE=351 -D__USE_BSD -DSYSVSIGNALS -DSYSVONLY + +LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm -lcrypt +LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm -lcrypt + +INLINE = # $(SRCDIR)dspSPARC.il +BITBLTFILE = # $(OBJECTDIR)bbtSPARC.o +BYTESWAPFILES = $(OBJECTDIR)byteswap.o + +OBJECTDIR = ../$(RELEASENAME)/ + +default : ../$(OSARCHNAME)/lde + +# Special rules to create xc.c on Sun4 + +#run cpp to expand macros +#$(OBJECTDIR)xc.i: $(SRCDIR)xc.c $(INCDIR)lispemul.h $(INCDIR)emlglob.h $(INCDIR)address.h \ +# $(INCDIR)adr68k.h $(INCDIR)stack.h $(INCDIR)lspglob.h \ +# $(INCDIR)lsptypes.h $(INCDIR)lispmap.h $(INCDIR)cell.h \ +# $(INCDIR)initatms.h $(INCDIR)gc.h \ +# $(INCDIR)arith.h $(INCDIR)stream.h \ +# $(INCDIR)tos1defs.h $(INCDIR)tosret.h \ +# $(INCDIR)tosfns.h $(INCDIR)inlineC.h \ +# $(INCDIR)inln68k.h +# cc -Qproduce .i $(DFLAGS) -I$(INCDIR) $(SRCDIR)xc.c -o $(OBJECTDIR)xc.i + +#run c compiler to produce first pass assembly +$(OBJECTDIR)xc.s1: $(OBJECTDIR)xc.i + rm -f $(OBJECTDIR)xc.s1 + /lib/ccom - $(FPFLAGS) <$(OBJECTDIR)xc.i >$(OBJECTDIR)xc.s1 + +#generate C program to remove dispatch loop, optimize +$(OBJECTDIR)dsphack.c: $(SRCDIR)dsphack.lex + rm -f $(OBJECTDIR)dsphack.c + lex -t $(SRCDIR)dsphack.lex > $(OBJECTDIR)dsphack.c + +#uses this program to find dispatch +$(OBJECTDIR)find-dsp.c: $(SRCDIR)find-dsp.lex + rm -f $(OBJECTDIR)find-dsp.c + lex -t $(SRCDIR)find-dsp.lex > $(OBJECTDIR)find-dsp.c + +$(OBJECTDIR)find-dsp: $(OBJECTDIR)find-dsp.c + cc -o $(OBJECTDIR)find-dsp $(OBJECTDIR)find-dsp.c -ll + +$(OBJECTDIR)dispatch-label.c: $(OBJECTDIR)find-dsp $(OBJECTDIR)xc.s1 + rm -f $(OBJECTDIR)dispatch-label.c + $(OBJECTDIR)find-dsp < $(OBJECTDIR)xc.s1 >$(OBJECTDIR)dispatch-label.c + +$(OBJECTDIR)dsphack: $(OBJECTDIR)dsphack.c $(OBJECTDIR)dispatch-label.c + cc -o $(OBJECTDIR)dsphack $(OBJECTDIR)dispatch-label.c $(OBJECTDIR)dsphack.c -ll + rm -f $(OBJECTDIR)dispatch-label.o $(OBJECTDIR)dsphack.o + +$(OBJECTDIR)xc.s2: $(OBJECTDIR)xc.s1 $(OBJECTDIR)dsphack + rm -f $(OBJECTDIR)xc.s2 + $(OBJECTDIR)dsphack < $(OBJECTDIR)xc.s1 >$(OBJECTDIR)xc.s2 + +$(OBJECTDIR)xc.s3: $(OBJECTDIR)xc.s2 $(INLINE) + rm -f $(OBJECTDIR)xc.s3 + /usr/lib/inline -i $(INLINE) < $(OBJECTDIR)xc.s2 > $(OBJECTDIR)xc.s3 + +#$(OBJECTDIR)xc.o: $(OBJECTDIR)xc.s3 +# /bin/as -o $(OBJECTDIR)xc.o -O1 $(OBJECTDIR)xc.s3 + +############ +# +# SPECIAL xc.o for debugging +# +############ +$(OBJECTDIR)xc.o: $(SRCDIR)xc.c $(INCDIR)lispemul.h $(INCDIR)emlglob.h \ + $(INCDIR)address.h \ + $(INCDIR)adr68k.h $(INCDIR)stack.h $(INCDIR)lspglob.h \ + $(INCDIR)lsptypes.h $(INCDIR)lispmap.h $(INCDIR)cell.h \ + $(INCDIR)initatms.h $(INCDIR)gc.h \ + $(INCDIR)arith.h $(INCDIR)stream.h \ + $(INCDIR)tos1defs.h $(INCDIR)tosret.h \ + $(INCDIR)tosfns.h $(INCDIR)inlineC.h + $(CC) $(DISPRFLAGS) -UOPDISP $(SRCDIR)xc.c -I$(INCDIR) -o $(OBJECTDIR)xc.o diff --git a/inc/version.h b/inc/version.h index 558e040..b55fc0c 100755 --- a/inc/version.h +++ b/inc/version.h @@ -367,7 +367,6 @@ typedef signed char s_char; /********************************************************/ #ifdef LINUX /* LINUX, the free POSIX-compliant Unix */ -#define SYSVONLY 1 #define NOETHER 1 #define XWINDOWS 1 /* JDS trial 12/22/01 #define USETIMEFN 1 */ diff --git a/src/mkvdate.c b/src/mkvdate.c index d636afe..513e8a2 100644 --- a/src/mkvdate.c +++ b/src/mkvdate.c @@ -33,7 +33,7 @@ static char *id = "$Id: mkvdate.c,v 1.5 2001/12/26 22:17:03 sybalsky Exp $ Copyr /* */ /************************************************************************/ -#ifdef OSF1 +#if defined(OSF1) || defined(LINUX) #include "time.h" #endif diff --git a/src/timer.c b/src/timer.c index 62c1275..26f7eee 100644 --- a/src/timer.c +++ b/src/timer.c @@ -50,7 +50,11 @@ unsigned long tick_count = 0; /* approx 18 ticks per sec */ #include #include #include +#ifdef LINUX +#include +#else #include +#endif #ifdef ISC #include @@ -77,7 +81,6 @@ extern int ether_fd; #endif #ifdef LINUX -#include #include #define _BSD_SOURCE #include @@ -366,7 +369,7 @@ void subr_settime(LispPTR args[]) dosday.dayofweek = uxtime.tm_wday; _dos_setdate(&dosday); -#elif defined(SYSVONLY) && !defined(MACOSX) +#elif defined(SYSVONLY) && !defined(MACOSX) && !defined(LINUX) time_t newTime = (time_t)(*((int *)Addr68k_from_LADDR(args[0])) - UNIX_ALTO_TIME_DIFF); stime(&newTime); #else @@ -686,7 +689,11 @@ void int_io_init() { #ifndef DOS SIGERRCHK(sigset(SIGIO, getsignaldata), "sigset io"); #ifdef XWINDOW +#ifdef LINUX + if (fcntl(ConnectionNumber(currentdsp->display_id), F_SETSIG, 0) < 0) +#else if (ioctl(ConnectionNumber(currentdsp->display_id), I_SETSIG, S_INPUT) < 0) +#endif perror("ioctl on X fd - SETSIG"); #endif /* XWINDOW */ #ifdef USE_DLPI