From: <ky...@us...> - 2013-07-28 07:37:24
|
Revision: 648 http://sourceforge.net/p/euslisp/code/648 Author: kyouhei Date: 2013-07-28 07:36:49 +0000 (Sun, 28 Jul 2013) Log Message: ----------- commit patch for compiling on ARM Linux, refere to https://sourceforge.net/p/jskeus/tickets/35/ Modified Paths: -------------- trunk/EusLisp/lisp/Makefile.generic2 trunk/EusLisp/lisp/c/calleus.c trunk/EusLisp/lisp/c/eus.c trunk/EusLisp/lisp/c/eus.h trunk/EusLisp/lisp/c/eusstream.c trunk/EusLisp/lisp/c/printer.c trunk/EusLisp/lisp/c/reader.c trunk/EusLisp/lisp/c/unixcall.c trunk/EusLisp/lisp/comp/comp.l trunk/EusLisp/lisp/comp/trans.l trunk/EusLisp/lisp/tool/compile_comp.l trunk/EusLisp/lisp/tool/compile_geo.l trunk/EusLisp/lisp/tool/compile_gl.l trunk/EusLisp/lisp/tool/compile_image.l trunk/EusLisp/lisp/tool/compile_l.l trunk/EusLisp/lisp/tool/compile_xwindow.l trunk/EusLisp/lisp/xwindow/Xgraphics.l Added Paths: ----------- trunk/EusLisp/lisp/Makefile.LinuxARM Added: trunk/EusLisp/lisp/Makefile.LinuxARM =================================================================== --- trunk/EusLisp/lisp/Makefile.LinuxARM (rev 0) +++ trunk/EusLisp/lisp/Makefile.LinuxARM 2013-07-28 07:36:49 UTC (rev 648) @@ -0,0 +1,109 @@ +# makefile for EusLisp on sun4 with SunOS (Solaris) +# RCSid="@(#)$Id$" +# Copyright (1988) Toshihiro MATSUI, Electrotechnical Laboratory +# 1989/Oct +# 1990/Sep Second Tape Distribution +# KOBJECTS --- eus kernel objects written in C +# NOKOBJECTS-- eus kernel, but cannot be optimized with -O option +# CLIBOBJECTS- functions written in C, not members of kernel +# LOBJECTS --- functions coded in EUSLISP; must be compiled with euscomp +# GEOOBJECTS-- geometric modeling functions and classes +# XOBJECTS---- Xwindow interface +# XTKOBJECTS---- Xwindow interface +# IMGOBJECTS--- image processing +# MTOBJECTS--- multithread functions +# +######################################################################### +# Customizable section begins +######################################################################### +ifneq ($(ARCHDIR),) +ARCH=$(ARCHDIR) +else +ARCH=LinuxARM +endif + +include Makefile.generic1 + +THREAD= -DTHREADED -DPTHREAD +MFLAGS= +XVERSION=X_V11R6_1 + + +# +# Select CFLAGS and XVERSION according to the version of SunOS and Xlib. +# +# for ARM + +MACHINE=armv6 +#MACHINE=armv5te + +GCC_VERSION=$(shell gcc -dumpversion | sed s/\\..\*//) +ifeq ($(GCC_VERSION), 2) + CPU_OPTIMIZE= + ALIGN_FUNCTIONS="-malign-functions=4" +else + CPU_OPTIMIZE=-march=$(MACHINE) + ALIGN_FUNCTIONS=-falign-functions=4 + GCC3=-DGCC3 +endif + +# Pentium's arch returns 'i586', which is ignored by conditionals in c/*.[ch]. +DEBUG= -g +#WFLAGS= -Wall -Wno-unused -Wno-switch -Wno-return-type -Wno-comment + +# If you use libc.so.5, remove -DLIB6 option. +# In order to include thread library, libc.so.6 is preferrable. + +CFLAGS=$(WFLAGS) -D$(MACHINE) -DLinux -DARM -D_REENTRANT -DVERSION=\"$(VERSION)\" \ + -DLIB6 $(ALIGN_FUNCTIONS) \ + $(DEBUG) $(CPU_OPTIMIZE) $(THREAD) -D$(XVERSION) \ + -DGCC $(GCC3) \ + -I/usr/include -I/usr/X11R6/include -I$(EUSDIR)/include + +# Use gcc for C-compiling on SunOS4. Sun's cc is ok on Solaris. +# /usr/ucb/cc cannot compile because of its incapability of recognizing +# prototype declarations. +CC=gcc +LD=gcc + +# +# L I B R A R I E S +# Three kinds of libraries are needed to build eus. +# 1. RAWLIB: unix libraries needed to make eus0-eus2 +# 2. XLIB: X window libraries +# When you use a window toolkit, you may need to override the 'read' +# function in libc.a with a specific window library such as libXview.a. +# 3. EUSLIB: euslisp functions that cannot be linked in eus because of +# 'GLOBAL OFFSET TABLE OVERFLOW', that are xwindow interface functions. +# You may add any optional user-supplied library in EUSLIB. +# On Solaris, XLIB and EUSLIB are combined together into lib/libeusx.so. + +# Linux +RAWLIB=-ldl -lm -lpthread +XLIB= -L/usr/X11R6/lib -lX11 + +# specify directories where euslisp's libraries are located. +EUSLIB= -Xlinker -R$(ADLIBDIR):$(EUSDIR)/lib/ARM -L$(ADLIBDIR) +GLLIB= -L$(ADLIBDIR) -lGLU -lGL -lXext -leusgl + +# POSIX Thread +THREADDEP=mthread_posix.c +#THREADDEP=pthreads.c + +# If you don't like optimization, comment out the next line. +OFLAGS=-O2 + +# link-editor's default flags ?-rdynamic +SOFLAGS= -shared +LDFLAGS= -rdynamic -fno-stack-protector -Wl,-z,execstack +MTCOBJECTS= $(OBJDIR)/mthread.o $(OBJDIR)/mthread_posix.o +#MTCOBJECTS= $(OBJDIR)/mthread.o $(OBJDIR)/pthreads.o +MAPOPTION=$(OBJDIR)/par.o + +################################################################# +# end of the customizable section +################################################################ + +#include Makefile.rgc +include Makefile.generic2 + Modified: trunk/EusLisp/lisp/Makefile.generic2 =================================================================== --- trunk/EusLisp/lisp/Makefile.generic2 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/Makefile.generic2 2013-07-28 07:36:49 UTC (rev 648) @@ -249,7 +249,7 @@ $(BINDIR)/eus: $(NOKOBJECTS) $(KOBJECTS) $(KSOBJECTS) $(LOBJECTS) \ $(LCOBJECTS) $(COMPOBJECTS) \ - $(MTCOBJECTS) $(RGCOBJECTS) $(MTOBJECTS) \ + $(MTCOBJECTS) $(RGCOBJECTS) $(MTOBJECTS) $(MAPOPTION) \ $(ADLIBDIR)/$(LIBEUSGEO) $(ADLIBDIR)/$(LIBEUSX) ($(CC) -o $(BINDIR)/eus $(LDFLAGS) \ $(NOKOBJECTS) $(KOBJECTS) $(KSOBJECTS) \ @@ -270,7 +270,7 @@ $(EUSLIB) $(EUSXLIB) $(GEOLIB) $(IMGLIB) $(EDGELIB) $(XLIB) $(RAWLIB)) $(BINDIR)/eusgl: $(NOKOBJECTS) $(KOBJECTS) $(KSOBJECTS) $(LOBJECTS) \ - $(LCOBJECTS) $(COMPOBJECTS) \ + $(LCOBJECTS) $(COMPOBJECTS) $(MAPOPTION) \ $(ADLIBDIR)/$(LIBEUSGEO) $(ADLIBDIR)/$(LIBEUSX) $(ADLIBDIR)/$(LIBEUSGL) ($(CC) -o $(BINDIR)/eusgl $(LDFLAGS) \ $(NOKOBJECTS) $(KOBJECTS) $(KSOBJECTS) \ @@ -319,7 +319,7 @@ $(CC) -c -o $(OBJDIR)/constants.l.o $(CFLAGS) constants.l.c; \ $(BINDIR)/gccls eusstart.l; \ $(CC) -c $(CFLAGS) -o $(OBJDIR)/eusstart.l.o eusstart.l.c) -$(LOBJECTS): +$(LOBJECTS) $(MAPOPTION): (echo $*; $(BINDIR)/euscomp <$(TOOLDIR)/compile_l.l) $(COMPOBJECTS): $(GCCLS) ($(BINDIR)/euscomp <$(TOOLDIR)/compile_comp.l ; \ Modified: trunk/EusLisp/lisp/c/calleus.c =================================================================== --- trunk/EusLisp/lisp/c/calleus.c 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/c/calleus.c 2013-07-28 07:36:49 UTC (rev 648) @@ -27,7 +27,7 @@ #include "eus.h" struct foreignpod { -#if vax || sun4 || news || mips || i386 || alpha || x86_64 +#if vax || sun4 || news || mips || i386 || alpha || x86_64 || ARM unsigned mark:1; unsigned b:1; unsigned m:1; Modified: trunk/EusLisp/lisp/c/eus.c =================================================================== --- trunk/EusLisp/lisp/c/eus.c 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/c/eus.c 2013-07-28 07:36:49 UTC (rev 648) @@ -911,6 +911,9 @@ #if x86_64 p=cons(ctx,intern(ctx,"X86_64",6,keywordpkg),p); #endif +#if ARM + p=cons(ctx,intern(ctx,"ARM",3,keywordpkg),p); +#endif defvar(ctx,"*FEATURES*",p,lisppkg); Modified: trunk/EusLisp/lisp/c/eus.h =================================================================== --- trunk/EusLisp/lisp/c/eus.h 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/c/eus.h 2013-07-28 07:36:49 UTC (rev 648) @@ -369,7 +369,7 @@ /****************************************************************/ typedef struct cell { -#if vax || sun4 || news || mips || i386 || i486 || i586 || alpha || x86_64 +#if vax || sun4 || news || mips || i386 || i486 || i586 || alpha || x86_64 || ARM unsigned mark:1; unsigned b:1; unsigned m:1; @@ -733,7 +733,7 @@ #define bpointerof(p) ((bpointer)((eusinteger_t)(p)-2)) #endif -#if vax || sun4 || news || mips || i386 || i486 || i586 || alpha || x86_64 +#if vax || sun4 || news || mips || i386 || i486 || i586 || alpha || x86_64 || ARM #define makepointer(bp) ((pointer)((eusinteger_t)(bp))) // #define isint(p) (((eusinteger_t)(p) & 3)==2) // org @@ -792,7 +792,7 @@ #define bixof(p) (bpointerof(p)->h.bix) #endif -#if sun3 || sun4 || system5 || apollo || news || sanyo || vxworks || mips || NEXT || i386 || i486 || i586 || x86_64 +#if sun3 || sun4 || system5 || apollo || news || sanyo || vxworks || mips || NEXT || i386 || i486 || i586 || x86_64 || ARM #if x86_64 #define fltval(p) (nu.ival=((eusinteger_t)(p) & ~3L), nu.fval) #define makeflt(f) (nu.fval=(eusfloat_t)(f), (pointer)((nu.ival & ~3L) | 1L)) Modified: trunk/EusLisp/lisp/c/eusstream.c =================================================================== --- trunk/EusLisp/lisp/c/eusstream.c 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/c/eusstream.c 2013-07-28 07:36:49 UTC (rev 648) @@ -88,7 +88,7 @@ #if system5 || Solaris2 if (c<0) { breakck; goto tryqread;} #endif -#if sun3 || sun4 || vax || apollo || news || sanyo || mips || i386 || alpha || x86_64 +#if sun3 || sun4 || vax || apollo || news || sanyo || mips || i386 || alpha || x86_64 || ARM breakck; #endif s->c.stream.buffer->c.str.length=lsave; Modified: trunk/EusLisp/lisp/c/printer.c =================================================================== --- trunk/EusLisp/lisp/c/printer.c 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/c/printer.c 2013-07-28 07:36:49 UTC (rev 648) @@ -556,7 +556,7 @@ if (isnum(x)) { printnum(ctx,x,f,intval(Spevalof(PRINTBASE)),0,0); return;} else if (x==UNBOUND) { writestr(f,(byte *)"***UNBOUND***",13); return;} /*pointed object*/ -#if vax || sun4 || news || mips || i386 || alpha || x86_64 +#if vax || sun4 || news || mips || i386 || alpha || x86_64 || ARM if ((x<(pointer)(ctx->stack)) && ((pointer)(ctx->stacklimit)<x)){ printint(ctx,(eusinteger_t)x,f,intval(Spevalof(PRINTBASE)),0,0); return;} #endif Modified: trunk/EusLisp/lisp/c/reader.c =================================================================== --- trunk/EusLisp/lisp/c/reader.c 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/c/reader.c 2013-07-28 07:36:49 UTC (rev 648) @@ -188,8 +188,12 @@ #if IRIX || Linux_ppc #define Char int #else +#if ARM +#define Char signed char +#else #define Char char #endif +#endif static Char skip(ctx, f, ch) context *ctx; @@ -264,7 +268,7 @@ #if sun3 ||( !alpha && system5 ) || sanyo labp->c.lab.unsolved=(pointer)addr; #endif -#if sun4 || vax || news || mips || alpha || i386 || x86_64 +#if sun4 || vax || news || mips || alpha || i386 || x86_64 || ARM { eusinteger_t i; i=(((eusinteger_t)addr)>>2); labp->c.lab.unsolved=makeint(i);} Modified: trunk/EusLisp/lisp/c/unixcall.c =================================================================== --- trunk/EusLisp/lisp/c/unixcall.c 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/c/unixcall.c 2013-07-28 07:36:49 UTC (rev 648) @@ -447,7 +447,7 @@ return(makeint(alarm(ckintval(argv[0]))));} -#if sun3 || sun4 || news || sanyo || alpha || i386 || x86_64 +#if sun3 || sun4 || news || sanyo || alpha || i386 || x86_64 || ARM #if !Solaris2 pointer UALARM(ctx,n,argv) register context *ctx; @@ -621,7 +621,7 @@ } #endif -#if sun3 || sun4 || vax || news || sanyo || (mips && !IRIX && !IRIX6) || i386 || alpha || x86_64 +#if sun3 || sun4 || vax || news || sanyo || (mips && !IRIX && !IRIX6) || i386 || alpha || x86_64 || ARM pointer VFORK(ctx,n,argv) register context *ctx; int n; @@ -1341,7 +1341,7 @@ if (envval) return(makestring(envval,strlen(envval))); else return(NIL);} -#if sun3 || sun4 || vax || mips || i386 || alpha || x86_64 +#if sun3 || sun4 || vax || mips || i386 || alpha || x86_64 || ARM pointer PUTENV(ctx,n,argv) register context *ctx; int n; @@ -2040,7 +2040,7 @@ defun(ctx,"GETTIMEOFDAY",mod,GETTIMEOFDAY); defun(ctx,"ALARM",mod,ALARM); -#if sun3 || sun4 || news || sanyo || alpha || x86_64 /* why i386 does not exist? */ +#if sun3 || sun4 || news || sanyo || alpha || x86_64 || ARM /* why i386 does not exist? */ #if !Solaris2 defun(ctx,"UALARM",mod,UALARM); #endif @@ -2115,7 +2115,7 @@ defun(ctx,"NTOHS",mod,N2HS); #endif -#if sun3 || sun4 || vax || news || sanyo || (mips && !IRIX && !IRIX6) || i386 || alpha || x86_64 +#if sun3 || sun4 || vax || news || sanyo || (mips && !IRIX && !IRIX6) || i386 || alpha || x86_64 || ARM defun(ctx,"VFORK",mod,VFORK); #endif defun(ctx,"EXEC",mod,EXEC); @@ -2124,7 +2124,7 @@ defun(ctx,"SETPRIORITY",mod,SETPRIORITY); #endif -#if sun3 || sun4 || vax || mips || i386 || alpha || x86_64 +#if sun3 || sun4 || vax || mips || i386 || alpha || x86_64 || ARM defun(ctx,"PUTENV",mod,PUTENV); #endif #if sun3 || sun4 && !Solaris2 || Linux || alpha || Cygwin Modified: trunk/EusLisp/lisp/comp/comp.l =================================================================== --- trunk/EusLisp/lisp/comp/comp.l 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/comp/comp.l 2013-07-28 07:36:49 UTC (rev 648) @@ -1313,9 +1313,12 @@ " -DDarwin -Dx86_64 -DLinux -w -malign-functions=8 " " -DDarwin -Di386 -DLinux -w -malign-functions=4 ")) ((and (memq :linux *features*) (memq :gcc3 *features*)) - (if (memq :x86_64 *features*) - " -Dx86_64 -DLinux -Wimplicit -falign-functions=8 -DGCC3 " - " -Di386 -DLinux -Wimplicit -falign-functions=4 -DGCC3 ")) + (cond + ((memq :x86_64 *features*) + " -Dx86_64 -DLinux -Wimplicit -falign-functions=8 -DGCC3 ") + ((memq :arm *features*) + " -DARM -DLinux -Wimplicit -falign-functions=4 -DGCC3 ") + (t " -Di386 -DLinux -Wimplicit -falign-functions=4 -DGCC3 "))) ((memq :linux *features*) (if (memq :x86_64 *features) " -Dx86_64 -DLinux -Wimplicit -malign-functions=8 " Modified: trunk/EusLisp/lisp/comp/trans.l =================================================================== --- trunk/EusLisp/lisp/comp/trans.l 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/comp/trans.l 2013-07-28 07:36:49 UTC (rev 648) @@ -454,7 +454,7 @@ (send self :store "w") (when (memq op '(+ -)) (format cfile - "#if sun4 || vax || mips || i386 || alpha || x86_64~% w=(pointer)((eusinteger_t)w-2);~%#endif~%")) + "#if sun4 || vax || mips || i386 || alpha || x86_64 || ARM~% w=(pointer)((eusinteger_t)w-2);~%#endif~%")) (send self :push (format nil "(pointer)((eusinteger_t)~A ~A (eusinteger_t)w)" (send self :pop) Modified: trunk/EusLisp/lisp/tool/compile_comp.l =================================================================== --- trunk/EusLisp/lisp/tool/compile_comp.l 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/tool/compile_comp.l 2013-07-28 07:36:49 UTC (rev 648) @@ -18,8 +18,12 @@ ((member :darwin *features*) "../../Darwin/obj/") ((member :sh4 *features*) "../../LinuxSH4/obj/") ((member :linux *features*) - (if (member :x86_64 *features*) - "../../Linux64/obj/" "../../Linux/obj/")) + (cond + ((member :x86_64 *features*) + "../../Linux64/obj/") + ((member :arm *features*) + "../../LinuxARM/obj/") + (t "../../Linux/obj/"))) ((member :SunOS4.1 *features*) "../../SunOS4/obj/") ((member :Windows *features*) "../../Windows/obj/") ((member :Windows95 *features*) "../../Win95/obj/") Modified: trunk/EusLisp/lisp/tool/compile_geo.l =================================================================== --- trunk/EusLisp/lisp/tool/compile_geo.l 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/tool/compile_geo.l 2013-07-28 07:36:49 UTC (rev 648) @@ -17,8 +17,12 @@ ((member :darwin *features*) "../../Darwin/obj/") ((member :sh4 *features*) "../../LinuxSH4/obj/") ((member :linux *features*) - (if (member :x86_64 *features*) - "../../Linux64/obj/" "../../Linux/obj/")) + (cond + ((member :x86_64 *features*) + "../../Linux64/obj/") + ((member :arm *features*) + "../../LinuxARM/obj/") + (t "../../Linux/obj/"))) ((member :SunOS4.1 *features*) "../../SunOS4/obj/") ((member :Windows *features*) "../../Windows/obj/") ((member :Windows95 *features*) "../../Win95/obj/") Modified: trunk/EusLisp/lisp/tool/compile_gl.l =================================================================== --- trunk/EusLisp/lisp/tool/compile_gl.l 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/tool/compile_gl.l 2013-07-28 07:36:49 UTC (rev 648) @@ -19,8 +19,12 @@ ((member :irix6 *features*) "../../../IRIX6/obj/") ((member :darwin *features*) "../../../Darwin/obj/") ((member :linux *features*) - (if (member :x86_64 *features*) - "../../../Linux64/obj/" "../../../Linux/obj/")) + (cond + ((member :x86_64 *features*) + "../../../Linux64/obj/") + ((member :arm *features*) + "../../../LinuxARM/obj/") + (t "../../../Linux/obj/"))) ((member :SunOS4.1 *features*) "../../../SunOS4/obj/") ((member :Windows *features*) "../../../Windows/obj/") ((member :Windows95 *features*) "../../../Win95/obj/") Modified: trunk/EusLisp/lisp/tool/compile_image.l =================================================================== --- trunk/EusLisp/lisp/tool/compile_image.l 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/tool/compile_image.l 2013-07-28 07:36:49 UTC (rev 648) @@ -22,8 +22,12 @@ ((member :darwin *features*) "../../Darwin/obj/") ((member :sh4 *features*) "../../LinuxSH4/obj/") ((member :linux *features*) - (if (member :x86_64 *features*) - "../../Linux64/obj/" "../../Linux/obj/")) + (cond + ((member :x86_64 *features*) + "../../Linux64/obj/") + ((member :arm *features*) + "../../LinuxARM/obj/") + (t "../../Linux/obj/"))) ((member :SunOS4.1 *features*) "../../SunOS4/obj/") ((member :Windows *features*) "../../Windows/obj/") ((member :Windows95 *features*) "../../Win95/obj/") Modified: trunk/EusLisp/lisp/tool/compile_l.l =================================================================== --- trunk/EusLisp/lisp/tool/compile_l.l 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/tool/compile_l.l 2013-07-28 07:36:49 UTC (rev 648) @@ -17,8 +17,12 @@ ((member :darwin *features*) "../../Darwin/obj/") ((member :sh4 *features*) "../../LinuxSH4/obj/") ((member :linux *features*) - (if (member :x86_64 *features*) - "../../Linux64/obj/" "../../Linux/obj/")) + (cond + ((member :x86_64 *features*) + "../../Linux64/obj/") + ((member :arm *features*) + "../../LinuxARM/obj/") + (t "../../Linux/obj/"))) ((member :SunOS4.1 *features*) "../../SunOS4/obj/") ((member :Windows *features*) "../../Windows/obj/") ((member :Windows95 *features*) "../../Win95/obj/") Modified: trunk/EusLisp/lisp/tool/compile_xwindow.l =================================================================== --- trunk/EusLisp/lisp/tool/compile_xwindow.l 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/tool/compile_xwindow.l 2013-07-28 07:36:49 UTC (rev 648) @@ -16,8 +16,12 @@ ((member :irix6 *features*) "../../IRIX6/obj/") ((member :darwin *features*) "../../Darwin/obj/") ((member :linux *features*) - (if (member :x86_64 *features*) - "../../Linux64/obj/" "../../Linux/obj/")) + (cond + ((member :x86_64 *features*) + "../../Linux64/obj/") + ((member :arm *features*) + "../../LinuxARM/obj/") + (t "../../Linux/obj/"))) ((member :SunOS4.1 *features*) "../../SunOS4/obj/") ((member :Windows *features*) "../../Windows/obj/") ((member :Windows95 *features*) "../../Win95/obj/") Modified: trunk/EusLisp/lisp/xwindow/Xgraphics.l =================================================================== --- trunk/EusLisp/lisp/xwindow/Xgraphics.l 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/xwindow/Xgraphics.l 2013-07-28 07:36:49 UTC (rev 648) @@ -200,9 +200,9 @@ direction font_ascent font_descent overall) (integer-vector (c-int font_ascent) (c-int font_descent) -#-(or :i386 :alpha :x86_64) +#-(or :i386 :alpha :x86_64 :arm) %(overall [ 4 ] * 256 + overall [ 5 ]) -#+(or :i386 :alpha :x86_64) +#+(or :i386 :alpha :x86_64 :arm) %(overall [ 5 ] * 256 + overall [ 4 ]) ))) #| return = (ascent descent width) |# This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ky...@us...> - 2013-07-28 07:37:26
|
Revision: 648 http://sourceforge.net/p/euslisp/code/648 Author: kyouhei Date: 2013-07-28 07:36:49 +0000 (Sun, 28 Jul 2013) Log Message: ----------- commit patch for compiling on ARM Linux, refere to https://sourceforge.net/p/jskeus/tickets/35/ Modified Paths: -------------- trunk/EusLisp/lisp/Makefile.generic2 trunk/EusLisp/lisp/c/calleus.c trunk/EusLisp/lisp/c/eus.c trunk/EusLisp/lisp/c/eus.h trunk/EusLisp/lisp/c/eusstream.c trunk/EusLisp/lisp/c/printer.c trunk/EusLisp/lisp/c/reader.c trunk/EusLisp/lisp/c/unixcall.c trunk/EusLisp/lisp/comp/comp.l trunk/EusLisp/lisp/comp/trans.l trunk/EusLisp/lisp/tool/compile_comp.l trunk/EusLisp/lisp/tool/compile_geo.l trunk/EusLisp/lisp/tool/compile_gl.l trunk/EusLisp/lisp/tool/compile_image.l trunk/EusLisp/lisp/tool/compile_l.l trunk/EusLisp/lisp/tool/compile_xwindow.l trunk/EusLisp/lisp/xwindow/Xgraphics.l Added Paths: ----------- trunk/EusLisp/lisp/Makefile.LinuxARM Added: trunk/EusLisp/lisp/Makefile.LinuxARM =================================================================== --- trunk/EusLisp/lisp/Makefile.LinuxARM (rev 0) +++ trunk/EusLisp/lisp/Makefile.LinuxARM 2013-07-28 07:36:49 UTC (rev 648) @@ -0,0 +1,109 @@ +# makefile for EusLisp on sun4 with SunOS (Solaris) +# RCSid="@(#)$Id$" +# Copyright (1988) Toshihiro MATSUI, Electrotechnical Laboratory +# 1989/Oct +# 1990/Sep Second Tape Distribution +# KOBJECTS --- eus kernel objects written in C +# NOKOBJECTS-- eus kernel, but cannot be optimized with -O option +# CLIBOBJECTS- functions written in C, not members of kernel +# LOBJECTS --- functions coded in EUSLISP; must be compiled with euscomp +# GEOOBJECTS-- geometric modeling functions and classes +# XOBJECTS---- Xwindow interface +# XTKOBJECTS---- Xwindow interface +# IMGOBJECTS--- image processing +# MTOBJECTS--- multithread functions +# +######################################################################### +# Customizable section begins +######################################################################### +ifneq ($(ARCHDIR),) +ARCH=$(ARCHDIR) +else +ARCH=LinuxARM +endif + +include Makefile.generic1 + +THREAD= -DTHREADED -DPTHREAD +MFLAGS= +XVERSION=X_V11R6_1 + + +# +# Select CFLAGS and XVERSION according to the version of SunOS and Xlib. +# +# for ARM + +MACHINE=armv6 +#MACHINE=armv5te + +GCC_VERSION=$(shell gcc -dumpversion | sed s/\\..\*//) +ifeq ($(GCC_VERSION), 2) + CPU_OPTIMIZE= + ALIGN_FUNCTIONS="-malign-functions=4" +else + CPU_OPTIMIZE=-march=$(MACHINE) + ALIGN_FUNCTIONS=-falign-functions=4 + GCC3=-DGCC3 +endif + +# Pentium's arch returns 'i586', which is ignored by conditionals in c/*.[ch]. +DEBUG= -g +#WFLAGS= -Wall -Wno-unused -Wno-switch -Wno-return-type -Wno-comment + +# If you use libc.so.5, remove -DLIB6 option. +# In order to include thread library, libc.so.6 is preferrable. + +CFLAGS=$(WFLAGS) -D$(MACHINE) -DLinux -DARM -D_REENTRANT -DVERSION=\"$(VERSION)\" \ + -DLIB6 $(ALIGN_FUNCTIONS) \ + $(DEBUG) $(CPU_OPTIMIZE) $(THREAD) -D$(XVERSION) \ + -DGCC $(GCC3) \ + -I/usr/include -I/usr/X11R6/include -I$(EUSDIR)/include + +# Use gcc for C-compiling on SunOS4. Sun's cc is ok on Solaris. +# /usr/ucb/cc cannot compile because of its incapability of recognizing +# prototype declarations. +CC=gcc +LD=gcc + +# +# L I B R A R I E S +# Three kinds of libraries are needed to build eus. +# 1. RAWLIB: unix libraries needed to make eus0-eus2 +# 2. XLIB: X window libraries +# When you use a window toolkit, you may need to override the 'read' +# function in libc.a with a specific window library such as libXview.a. +# 3. EUSLIB: euslisp functions that cannot be linked in eus because of +# 'GLOBAL OFFSET TABLE OVERFLOW', that are xwindow interface functions. +# You may add any optional user-supplied library in EUSLIB. +# On Solaris, XLIB and EUSLIB are combined together into lib/libeusx.so. + +# Linux +RAWLIB=-ldl -lm -lpthread +XLIB= -L/usr/X11R6/lib -lX11 + +# specify directories where euslisp's libraries are located. +EUSLIB= -Xlinker -R$(ADLIBDIR):$(EUSDIR)/lib/ARM -L$(ADLIBDIR) +GLLIB= -L$(ADLIBDIR) -lGLU -lGL -lXext -leusgl + +# POSIX Thread +THREADDEP=mthread_posix.c +#THREADDEP=pthreads.c + +# If you don't like optimization, comment out the next line. +OFLAGS=-O2 + +# link-editor's default flags ?-rdynamic +SOFLAGS= -shared +LDFLAGS= -rdynamic -fno-stack-protector -Wl,-z,execstack +MTCOBJECTS= $(OBJDIR)/mthread.o $(OBJDIR)/mthread_posix.o +#MTCOBJECTS= $(OBJDIR)/mthread.o $(OBJDIR)/pthreads.o +MAPOPTION=$(OBJDIR)/par.o + +################################################################# +# end of the customizable section +################################################################ + +#include Makefile.rgc +include Makefile.generic2 + Modified: trunk/EusLisp/lisp/Makefile.generic2 =================================================================== --- trunk/EusLisp/lisp/Makefile.generic2 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/Makefile.generic2 2013-07-28 07:36:49 UTC (rev 648) @@ -249,7 +249,7 @@ $(BINDIR)/eus: $(NOKOBJECTS) $(KOBJECTS) $(KSOBJECTS) $(LOBJECTS) \ $(LCOBJECTS) $(COMPOBJECTS) \ - $(MTCOBJECTS) $(RGCOBJECTS) $(MTOBJECTS) \ + $(MTCOBJECTS) $(RGCOBJECTS) $(MTOBJECTS) $(MAPOPTION) \ $(ADLIBDIR)/$(LIBEUSGEO) $(ADLIBDIR)/$(LIBEUSX) ($(CC) -o $(BINDIR)/eus $(LDFLAGS) \ $(NOKOBJECTS) $(KOBJECTS) $(KSOBJECTS) \ @@ -270,7 +270,7 @@ $(EUSLIB) $(EUSXLIB) $(GEOLIB) $(IMGLIB) $(EDGELIB) $(XLIB) $(RAWLIB)) $(BINDIR)/eusgl: $(NOKOBJECTS) $(KOBJECTS) $(KSOBJECTS) $(LOBJECTS) \ - $(LCOBJECTS) $(COMPOBJECTS) \ + $(LCOBJECTS) $(COMPOBJECTS) $(MAPOPTION) \ $(ADLIBDIR)/$(LIBEUSGEO) $(ADLIBDIR)/$(LIBEUSX) $(ADLIBDIR)/$(LIBEUSGL) ($(CC) -o $(BINDIR)/eusgl $(LDFLAGS) \ $(NOKOBJECTS) $(KOBJECTS) $(KSOBJECTS) \ @@ -319,7 +319,7 @@ $(CC) -c -o $(OBJDIR)/constants.l.o $(CFLAGS) constants.l.c; \ $(BINDIR)/gccls eusstart.l; \ $(CC) -c $(CFLAGS) -o $(OBJDIR)/eusstart.l.o eusstart.l.c) -$(LOBJECTS): +$(LOBJECTS) $(MAPOPTION): (echo $*; $(BINDIR)/euscomp <$(TOOLDIR)/compile_l.l) $(COMPOBJECTS): $(GCCLS) ($(BINDIR)/euscomp <$(TOOLDIR)/compile_comp.l ; \ Modified: trunk/EusLisp/lisp/c/calleus.c =================================================================== --- trunk/EusLisp/lisp/c/calleus.c 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/c/calleus.c 2013-07-28 07:36:49 UTC (rev 648) @@ -27,7 +27,7 @@ #include "eus.h" struct foreignpod { -#if vax || sun4 || news || mips || i386 || alpha || x86_64 +#if vax || sun4 || news || mips || i386 || alpha || x86_64 || ARM unsigned mark:1; unsigned b:1; unsigned m:1; Modified: trunk/EusLisp/lisp/c/eus.c =================================================================== --- trunk/EusLisp/lisp/c/eus.c 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/c/eus.c 2013-07-28 07:36:49 UTC (rev 648) @@ -911,6 +911,9 @@ #if x86_64 p=cons(ctx,intern(ctx,"X86_64",6,keywordpkg),p); #endif +#if ARM + p=cons(ctx,intern(ctx,"ARM",3,keywordpkg),p); +#endif defvar(ctx,"*FEATURES*",p,lisppkg); Modified: trunk/EusLisp/lisp/c/eus.h =================================================================== --- trunk/EusLisp/lisp/c/eus.h 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/c/eus.h 2013-07-28 07:36:49 UTC (rev 648) @@ -369,7 +369,7 @@ /****************************************************************/ typedef struct cell { -#if vax || sun4 || news || mips || i386 || i486 || i586 || alpha || x86_64 +#if vax || sun4 || news || mips || i386 || i486 || i586 || alpha || x86_64 || ARM unsigned mark:1; unsigned b:1; unsigned m:1; @@ -733,7 +733,7 @@ #define bpointerof(p) ((bpointer)((eusinteger_t)(p)-2)) #endif -#if vax || sun4 || news || mips || i386 || i486 || i586 || alpha || x86_64 +#if vax || sun4 || news || mips || i386 || i486 || i586 || alpha || x86_64 || ARM #define makepointer(bp) ((pointer)((eusinteger_t)(bp))) // #define isint(p) (((eusinteger_t)(p) & 3)==2) // org @@ -792,7 +792,7 @@ #define bixof(p) (bpointerof(p)->h.bix) #endif -#if sun3 || sun4 || system5 || apollo || news || sanyo || vxworks || mips || NEXT || i386 || i486 || i586 || x86_64 +#if sun3 || sun4 || system5 || apollo || news || sanyo || vxworks || mips || NEXT || i386 || i486 || i586 || x86_64 || ARM #if x86_64 #define fltval(p) (nu.ival=((eusinteger_t)(p) & ~3L), nu.fval) #define makeflt(f) (nu.fval=(eusfloat_t)(f), (pointer)((nu.ival & ~3L) | 1L)) Modified: trunk/EusLisp/lisp/c/eusstream.c =================================================================== --- trunk/EusLisp/lisp/c/eusstream.c 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/c/eusstream.c 2013-07-28 07:36:49 UTC (rev 648) @@ -88,7 +88,7 @@ #if system5 || Solaris2 if (c<0) { breakck; goto tryqread;} #endif -#if sun3 || sun4 || vax || apollo || news || sanyo || mips || i386 || alpha || x86_64 +#if sun3 || sun4 || vax || apollo || news || sanyo || mips || i386 || alpha || x86_64 || ARM breakck; #endif s->c.stream.buffer->c.str.length=lsave; Modified: trunk/EusLisp/lisp/c/printer.c =================================================================== --- trunk/EusLisp/lisp/c/printer.c 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/c/printer.c 2013-07-28 07:36:49 UTC (rev 648) @@ -556,7 +556,7 @@ if (isnum(x)) { printnum(ctx,x,f,intval(Spevalof(PRINTBASE)),0,0); return;} else if (x==UNBOUND) { writestr(f,(byte *)"***UNBOUND***",13); return;} /*pointed object*/ -#if vax || sun4 || news || mips || i386 || alpha || x86_64 +#if vax || sun4 || news || mips || i386 || alpha || x86_64 || ARM if ((x<(pointer)(ctx->stack)) && ((pointer)(ctx->stacklimit)<x)){ printint(ctx,(eusinteger_t)x,f,intval(Spevalof(PRINTBASE)),0,0); return;} #endif Modified: trunk/EusLisp/lisp/c/reader.c =================================================================== --- trunk/EusLisp/lisp/c/reader.c 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/c/reader.c 2013-07-28 07:36:49 UTC (rev 648) @@ -188,8 +188,12 @@ #if IRIX || Linux_ppc #define Char int #else +#if ARM +#define Char signed char +#else #define Char char #endif +#endif static Char skip(ctx, f, ch) context *ctx; @@ -264,7 +268,7 @@ #if sun3 ||( !alpha && system5 ) || sanyo labp->c.lab.unsolved=(pointer)addr; #endif -#if sun4 || vax || news || mips || alpha || i386 || x86_64 +#if sun4 || vax || news || mips || alpha || i386 || x86_64 || ARM { eusinteger_t i; i=(((eusinteger_t)addr)>>2); labp->c.lab.unsolved=makeint(i);} Modified: trunk/EusLisp/lisp/c/unixcall.c =================================================================== --- trunk/EusLisp/lisp/c/unixcall.c 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/c/unixcall.c 2013-07-28 07:36:49 UTC (rev 648) @@ -447,7 +447,7 @@ return(makeint(alarm(ckintval(argv[0]))));} -#if sun3 || sun4 || news || sanyo || alpha || i386 || x86_64 +#if sun3 || sun4 || news || sanyo || alpha || i386 || x86_64 || ARM #if !Solaris2 pointer UALARM(ctx,n,argv) register context *ctx; @@ -621,7 +621,7 @@ } #endif -#if sun3 || sun4 || vax || news || sanyo || (mips && !IRIX && !IRIX6) || i386 || alpha || x86_64 +#if sun3 || sun4 || vax || news || sanyo || (mips && !IRIX && !IRIX6) || i386 || alpha || x86_64 || ARM pointer VFORK(ctx,n,argv) register context *ctx; int n; @@ -1341,7 +1341,7 @@ if (envval) return(makestring(envval,strlen(envval))); else return(NIL);} -#if sun3 || sun4 || vax || mips || i386 || alpha || x86_64 +#if sun3 || sun4 || vax || mips || i386 || alpha || x86_64 || ARM pointer PUTENV(ctx,n,argv) register context *ctx; int n; @@ -2040,7 +2040,7 @@ defun(ctx,"GETTIMEOFDAY",mod,GETTIMEOFDAY); defun(ctx,"ALARM",mod,ALARM); -#if sun3 || sun4 || news || sanyo || alpha || x86_64 /* why i386 does not exist? */ +#if sun3 || sun4 || news || sanyo || alpha || x86_64 || ARM /* why i386 does not exist? */ #if !Solaris2 defun(ctx,"UALARM",mod,UALARM); #endif @@ -2115,7 +2115,7 @@ defun(ctx,"NTOHS",mod,N2HS); #endif -#if sun3 || sun4 || vax || news || sanyo || (mips && !IRIX && !IRIX6) || i386 || alpha || x86_64 +#if sun3 || sun4 || vax || news || sanyo || (mips && !IRIX && !IRIX6) || i386 || alpha || x86_64 || ARM defun(ctx,"VFORK",mod,VFORK); #endif defun(ctx,"EXEC",mod,EXEC); @@ -2124,7 +2124,7 @@ defun(ctx,"SETPRIORITY",mod,SETPRIORITY); #endif -#if sun3 || sun4 || vax || mips || i386 || alpha || x86_64 +#if sun3 || sun4 || vax || mips || i386 || alpha || x86_64 || ARM defun(ctx,"PUTENV",mod,PUTENV); #endif #if sun3 || sun4 && !Solaris2 || Linux || alpha || Cygwin Modified: trunk/EusLisp/lisp/comp/comp.l =================================================================== --- trunk/EusLisp/lisp/comp/comp.l 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/comp/comp.l 2013-07-28 07:36:49 UTC (rev 648) @@ -1313,9 +1313,12 @@ " -DDarwin -Dx86_64 -DLinux -w -malign-functions=8 " " -DDarwin -Di386 -DLinux -w -malign-functions=4 ")) ((and (memq :linux *features*) (memq :gcc3 *features*)) - (if (memq :x86_64 *features*) - " -Dx86_64 -DLinux -Wimplicit -falign-functions=8 -DGCC3 " - " -Di386 -DLinux -Wimplicit -falign-functions=4 -DGCC3 ")) + (cond + ((memq :x86_64 *features*) + " -Dx86_64 -DLinux -Wimplicit -falign-functions=8 -DGCC3 ") + ((memq :arm *features*) + " -DARM -DLinux -Wimplicit -falign-functions=4 -DGCC3 ") + (t " -Di386 -DLinux -Wimplicit -falign-functions=4 -DGCC3 "))) ((memq :linux *features*) (if (memq :x86_64 *features) " -Dx86_64 -DLinux -Wimplicit -malign-functions=8 " Modified: trunk/EusLisp/lisp/comp/trans.l =================================================================== --- trunk/EusLisp/lisp/comp/trans.l 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/comp/trans.l 2013-07-28 07:36:49 UTC (rev 648) @@ -454,7 +454,7 @@ (send self :store "w") (when (memq op '(+ -)) (format cfile - "#if sun4 || vax || mips || i386 || alpha || x86_64~% w=(pointer)((eusinteger_t)w-2);~%#endif~%")) + "#if sun4 || vax || mips || i386 || alpha || x86_64 || ARM~% w=(pointer)((eusinteger_t)w-2);~%#endif~%")) (send self :push (format nil "(pointer)((eusinteger_t)~A ~A (eusinteger_t)w)" (send self :pop) Modified: trunk/EusLisp/lisp/tool/compile_comp.l =================================================================== --- trunk/EusLisp/lisp/tool/compile_comp.l 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/tool/compile_comp.l 2013-07-28 07:36:49 UTC (rev 648) @@ -18,8 +18,12 @@ ((member :darwin *features*) "../../Darwin/obj/") ((member :sh4 *features*) "../../LinuxSH4/obj/") ((member :linux *features*) - (if (member :x86_64 *features*) - "../../Linux64/obj/" "../../Linux/obj/")) + (cond + ((member :x86_64 *features*) + "../../Linux64/obj/") + ((member :arm *features*) + "../../LinuxARM/obj/") + (t "../../Linux/obj/"))) ((member :SunOS4.1 *features*) "../../SunOS4/obj/") ((member :Windows *features*) "../../Windows/obj/") ((member :Windows95 *features*) "../../Win95/obj/") Modified: trunk/EusLisp/lisp/tool/compile_geo.l =================================================================== --- trunk/EusLisp/lisp/tool/compile_geo.l 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/tool/compile_geo.l 2013-07-28 07:36:49 UTC (rev 648) @@ -17,8 +17,12 @@ ((member :darwin *features*) "../../Darwin/obj/") ((member :sh4 *features*) "../../LinuxSH4/obj/") ((member :linux *features*) - (if (member :x86_64 *features*) - "../../Linux64/obj/" "../../Linux/obj/")) + (cond + ((member :x86_64 *features*) + "../../Linux64/obj/") + ((member :arm *features*) + "../../LinuxARM/obj/") + (t "../../Linux/obj/"))) ((member :SunOS4.1 *features*) "../../SunOS4/obj/") ((member :Windows *features*) "../../Windows/obj/") ((member :Windows95 *features*) "../../Win95/obj/") Modified: trunk/EusLisp/lisp/tool/compile_gl.l =================================================================== --- trunk/EusLisp/lisp/tool/compile_gl.l 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/tool/compile_gl.l 2013-07-28 07:36:49 UTC (rev 648) @@ -19,8 +19,12 @@ ((member :irix6 *features*) "../../../IRIX6/obj/") ((member :darwin *features*) "../../../Darwin/obj/") ((member :linux *features*) - (if (member :x86_64 *features*) - "../../../Linux64/obj/" "../../../Linux/obj/")) + (cond + ((member :x86_64 *features*) + "../../../Linux64/obj/") + ((member :arm *features*) + "../../../LinuxARM/obj/") + (t "../../../Linux/obj/"))) ((member :SunOS4.1 *features*) "../../../SunOS4/obj/") ((member :Windows *features*) "../../../Windows/obj/") ((member :Windows95 *features*) "../../../Win95/obj/") Modified: trunk/EusLisp/lisp/tool/compile_image.l =================================================================== --- trunk/EusLisp/lisp/tool/compile_image.l 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/tool/compile_image.l 2013-07-28 07:36:49 UTC (rev 648) @@ -22,8 +22,12 @@ ((member :darwin *features*) "../../Darwin/obj/") ((member :sh4 *features*) "../../LinuxSH4/obj/") ((member :linux *features*) - (if (member :x86_64 *features*) - "../../Linux64/obj/" "../../Linux/obj/")) + (cond + ((member :x86_64 *features*) + "../../Linux64/obj/") + ((member :arm *features*) + "../../LinuxARM/obj/") + (t "../../Linux/obj/"))) ((member :SunOS4.1 *features*) "../../SunOS4/obj/") ((member :Windows *features*) "../../Windows/obj/") ((member :Windows95 *features*) "../../Win95/obj/") Modified: trunk/EusLisp/lisp/tool/compile_l.l =================================================================== --- trunk/EusLisp/lisp/tool/compile_l.l 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/tool/compile_l.l 2013-07-28 07:36:49 UTC (rev 648) @@ -17,8 +17,12 @@ ((member :darwin *features*) "../../Darwin/obj/") ((member :sh4 *features*) "../../LinuxSH4/obj/") ((member :linux *features*) - (if (member :x86_64 *features*) - "../../Linux64/obj/" "../../Linux/obj/")) + (cond + ((member :x86_64 *features*) + "../../Linux64/obj/") + ((member :arm *features*) + "../../LinuxARM/obj/") + (t "../../Linux/obj/"))) ((member :SunOS4.1 *features*) "../../SunOS4/obj/") ((member :Windows *features*) "../../Windows/obj/") ((member :Windows95 *features*) "../../Win95/obj/") Modified: trunk/EusLisp/lisp/tool/compile_xwindow.l =================================================================== --- trunk/EusLisp/lisp/tool/compile_xwindow.l 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/tool/compile_xwindow.l 2013-07-28 07:36:49 UTC (rev 648) @@ -16,8 +16,12 @@ ((member :irix6 *features*) "../../IRIX6/obj/") ((member :darwin *features*) "../../Darwin/obj/") ((member :linux *features*) - (if (member :x86_64 *features*) - "../../Linux64/obj/" "../../Linux/obj/")) + (cond + ((member :x86_64 *features*) + "../../Linux64/obj/") + ((member :arm *features*) + "../../LinuxARM/obj/") + (t "../../Linux/obj/"))) ((member :SunOS4.1 *features*) "../../SunOS4/obj/") ((member :Windows *features*) "../../Windows/obj/") ((member :Windows95 *features*) "../../Win95/obj/") Modified: trunk/EusLisp/lisp/xwindow/Xgraphics.l =================================================================== --- trunk/EusLisp/lisp/xwindow/Xgraphics.l 2013-07-15 23:59:14 UTC (rev 647) +++ trunk/EusLisp/lisp/xwindow/Xgraphics.l 2013-07-28 07:36:49 UTC (rev 648) @@ -200,9 +200,9 @@ direction font_ascent font_descent overall) (integer-vector (c-int font_ascent) (c-int font_descent) -#-(or :i386 :alpha :x86_64) +#-(or :i386 :alpha :x86_64 :arm) %(overall [ 4 ] * 256 + overall [ 5 ]) -#+(or :i386 :alpha :x86_64) +#+(or :i386 :alpha :x86_64 :arm) %(overall [ 5 ] * 256 + overall [ 4 ]) ))) #| return = (ascent descent width) |# This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ky...@us...> - 2013-07-31 17:45:17
|
Revision: 650 http://sourceforge.net/p/euslisp/code/650 Author: kyouhei Date: 2013-07-31 17:45:06 +0000 (Wed, 31 Jul 2013) Log Message: ----------- gcc on cygwin can't pass option to linker Modified Paths: -------------- trunk/EusLisp/lisp/Makefile.Cygwin trunk/EusLisp/lisp/comp/comp.l Modified: trunk/EusLisp/lisp/Makefile.Cygwin =================================================================== --- trunk/EusLisp/lisp/Makefile.Cygwin 2013-07-30 08:20:57 UTC (rev 649) +++ trunk/EusLisp/lisp/Makefile.Cygwin 2013-07-31 17:45:06 UTC (rev 650) @@ -76,8 +76,7 @@ OFLAGS=-O2 # link-editor's default flags ?-rdynamic -#SOFLAGS= -shared --allow-shlib-undefined --warn-unresolved-symbols --unresolved-symbols=ignore-all --warn-once --enable-extra-pe-debug --enable-auto-import -SOFLAGS= -shared --export-all-symbols --unresolved-symbols=ignore-all --enable-runtime-pseudo-reloc +SOFLAGS= -shared -Wl,--export-all-symbols -Wl,--unresolved-symbols=ignore-all -Wl,--enable-runtime-pseudo-reloc LDFLAGS= -Wl,--out-implib=$(BINDIR)/$(@F).a -Wl,--export-all-symbols -Wl,--enable-auto-import MTCOBJECTS= $(OBJDIR)/mthread.o $(OBJDIR)/mthread_posix.o @@ -141,11 +140,3 @@ $(BINDIR)/eus: @echo ";; Do not compile eus for Cygwin, Just symlink" (cd $(BINDIR); rm -f eus.exe; ln -sf eusgl.exe eus.exe) - - - - - - - - Modified: trunk/EusLisp/lisp/comp/comp.l =================================================================== --- trunk/EusLisp/lisp/comp/comp.l 2013-07-30 08:20:57 UTC (rev 649) +++ trunk/EusLisp/lisp/comp/comp.l 2013-07-31 17:45:06 UTC (rev 650) @@ -1390,7 +1390,7 @@ (if (and (memq :cygwin *features*) (not *kernel*)) (concatenate string - "; gcc -shared -g -falign-functions=4 --export-all-symbols --unresolved-symbols=ignore-all --enable-runtime-pseudo-reloc -o " + "; gcc -shared -g -falign-functions=4 -Wl,--export-all-symbols -Wl,--unresolved-symbols=ignore-all -Wl,--enable-runtime-pseudo-reloc -o " (namestring file.dll) " " (namestring file.o) " " *eusdir* (unix:getenv "ARCHDIR") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ky...@us...> - 2013-07-31 17:45:18
|
Revision: 650 http://sourceforge.net/p/euslisp/code/650 Author: kyouhei Date: 2013-07-31 17:45:06 +0000 (Wed, 31 Jul 2013) Log Message: ----------- gcc on cygwin can't pass option to linker Modified Paths: -------------- trunk/EusLisp/lisp/Makefile.Cygwin trunk/EusLisp/lisp/comp/comp.l Modified: trunk/EusLisp/lisp/Makefile.Cygwin =================================================================== --- trunk/EusLisp/lisp/Makefile.Cygwin 2013-07-30 08:20:57 UTC (rev 649) +++ trunk/EusLisp/lisp/Makefile.Cygwin 2013-07-31 17:45:06 UTC (rev 650) @@ -76,8 +76,7 @@ OFLAGS=-O2 # link-editor's default flags ?-rdynamic -#SOFLAGS= -shared --allow-shlib-undefined --warn-unresolved-symbols --unresolved-symbols=ignore-all --warn-once --enable-extra-pe-debug --enable-auto-import -SOFLAGS= -shared --export-all-symbols --unresolved-symbols=ignore-all --enable-runtime-pseudo-reloc +SOFLAGS= -shared -Wl,--export-all-symbols -Wl,--unresolved-symbols=ignore-all -Wl,--enable-runtime-pseudo-reloc LDFLAGS= -Wl,--out-implib=$(BINDIR)/$(@F).a -Wl,--export-all-symbols -Wl,--enable-auto-import MTCOBJECTS= $(OBJDIR)/mthread.o $(OBJDIR)/mthread_posix.o @@ -141,11 +140,3 @@ $(BINDIR)/eus: @echo ";; Do not compile eus for Cygwin, Just symlink" (cd $(BINDIR); rm -f eus.exe; ln -sf eusgl.exe eus.exe) - - - - - - - - Modified: trunk/EusLisp/lisp/comp/comp.l =================================================================== --- trunk/EusLisp/lisp/comp/comp.l 2013-07-30 08:20:57 UTC (rev 649) +++ trunk/EusLisp/lisp/comp/comp.l 2013-07-31 17:45:06 UTC (rev 650) @@ -1390,7 +1390,7 @@ (if (and (memq :cygwin *features*) (not *kernel*)) (concatenate string - "; gcc -shared -g -falign-functions=4 --export-all-symbols --unresolved-symbols=ignore-all --enable-runtime-pseudo-reloc -o " + "; gcc -shared -g -falign-functions=4 -Wl,--export-all-symbols -Wl,--unresolved-symbols=ignore-all -Wl,--enable-runtime-pseudo-reloc -o " (namestring file.dll) " " (namestring file.o) " " *eusdir* (unix:getenv "ARCHDIR") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <k-...@us...> - 2013-11-29 09:29:14
|
Revision: 658 http://sourceforge.net/p/euslisp/code/658 Author: k-okada Date: 2013-11-29 09:29:09 +0000 (Fri, 29 Nov 2013) Log Message: ----------- fix Darwin support, thanks furushchev, see Issue #45 (https://sourceforge.net/p/jskeus/tickets/45/) Modified Paths: -------------- trunk/EusLisp/lisp/Makefile.Darwin trunk/EusLisp/lisp/xwindow/xforeign.c.c Modified: trunk/EusLisp/lisp/Makefile.Darwin =================================================================== --- trunk/EusLisp/lisp/Makefile.Darwin 2013-11-23 00:00:14 UTC (rev 657) +++ trunk/EusLisp/lisp/Makefile.Darwin 2013-11-29 09:29:09 UTC (rev 658) @@ -53,11 +53,11 @@ # If you use libc.so.5, remove -DLIB6 option. # In order to include thread library, libc.so.6 is preferrable. -CFLAGS=-D$(MACHINE) -DLinux -D_REENTRANT -DVERSION=\"$(VERSION)\" -DDarwin \ +CFLAGS=-D$(MACHINE) -Wno-return-type -DLinux -D_REENTRANT -DVERSION=\"$(VERSION)\" -DDarwin \ -DLIB6 $(ALIGN_FUNCTIONS) \ $(DEBUG) $(CPU_OPTIMIZE) $(THREAD) -D$(XVERSION) \ -DGCC $(GCC3) \ - -I/usr/include -I/opt/local/include -I/usr/X11/include -I$(EUSDIR)/include + -I/usr/include -I/opt/local/include -I/opt/X11/include -I$(EUSDIR)/include # Use gcc for C-compiling on SunOS4. Sun's cc is ok on Solaris. # /usr/ucb/cc cannot compile because of its incapability of recognizing @@ -78,11 +78,11 @@ # On Solaris, XLIB and EUSLIB are combined together into lib/libeusx.so. RAWLIB=-ldl -lm -lpthread -XLIB= -L/opt/local/lib -L/usr/X11/lib -lX11 +XLIB= -L/opt/local/lib -L/opt/X11/lib -lX11 # specify directories where euslisp's libraries are located. EUSLIB= -L$(ADLIBDIR) -GLLIB= -L$(ADLIBDIR) -lGLU -lGL -lXext -leusgl +GLLIB= -L$/opt/X11/lib -lGLU -lGL -lXext -leusgl # POSIX Thread THREADDEP=mthread_posix.c Modified: trunk/EusLisp/lisp/xwindow/xforeign.c.c =================================================================== --- trunk/EusLisp/lisp/xwindow/xforeign.c.c 2013-11-23 00:00:14 UTC (rev 657) +++ trunk/EusLisp/lisp/xwindow/xforeign.c.c 2013-11-29 09:29:09 UTC (rev 658) @@ -426,7 +426,7 @@ entry=(eusinteger_t)dlsym(dlhandle, xentry); #elif Darwin eusinteger_t dlhandle; - dlhandle=(eusinteger_t)dlopen("/opt/local/lib/libX11.dylib", RTLD_LAZY); + dlhandle=(eusinteger_t)dlopen("/opt/X11/lib/libX11.dylib", RTLD_LAZY); if( dlhandle==0 ) dlhandle=(eusinteger_t)dlopen("libX11.dylib", RTLD_LAZY); entry=(eusinteger_t)dlsym(dlhandle, xentry); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <k-...@us...> - 2013-11-29 09:29:16
|
Revision: 658 http://sourceforge.net/p/euslisp/code/658 Author: k-okada Date: 2013-11-29 09:29:09 +0000 (Fri, 29 Nov 2013) Log Message: ----------- fix Darwin support, thanks furushchev, see Issue #45 (https://sourceforge.net/p/jskeus/tickets/45/) Modified Paths: -------------- trunk/EusLisp/lisp/Makefile.Darwin trunk/EusLisp/lisp/xwindow/xforeign.c.c Modified: trunk/EusLisp/lisp/Makefile.Darwin =================================================================== --- trunk/EusLisp/lisp/Makefile.Darwin 2013-11-23 00:00:14 UTC (rev 657) +++ trunk/EusLisp/lisp/Makefile.Darwin 2013-11-29 09:29:09 UTC (rev 658) @@ -53,11 +53,11 @@ # If you use libc.so.5, remove -DLIB6 option. # In order to include thread library, libc.so.6 is preferrable. -CFLAGS=-D$(MACHINE) -DLinux -D_REENTRANT -DVERSION=\"$(VERSION)\" -DDarwin \ +CFLAGS=-D$(MACHINE) -Wno-return-type -DLinux -D_REENTRANT -DVERSION=\"$(VERSION)\" -DDarwin \ -DLIB6 $(ALIGN_FUNCTIONS) \ $(DEBUG) $(CPU_OPTIMIZE) $(THREAD) -D$(XVERSION) \ -DGCC $(GCC3) \ - -I/usr/include -I/opt/local/include -I/usr/X11/include -I$(EUSDIR)/include + -I/usr/include -I/opt/local/include -I/opt/X11/include -I$(EUSDIR)/include # Use gcc for C-compiling on SunOS4. Sun's cc is ok on Solaris. # /usr/ucb/cc cannot compile because of its incapability of recognizing @@ -78,11 +78,11 @@ # On Solaris, XLIB and EUSLIB are combined together into lib/libeusx.so. RAWLIB=-ldl -lm -lpthread -XLIB= -L/opt/local/lib -L/usr/X11/lib -lX11 +XLIB= -L/opt/local/lib -L/opt/X11/lib -lX11 # specify directories where euslisp's libraries are located. EUSLIB= -L$(ADLIBDIR) -GLLIB= -L$(ADLIBDIR) -lGLU -lGL -lXext -leusgl +GLLIB= -L$/opt/X11/lib -lGLU -lGL -lXext -leusgl # POSIX Thread THREADDEP=mthread_posix.c Modified: trunk/EusLisp/lisp/xwindow/xforeign.c.c =================================================================== --- trunk/EusLisp/lisp/xwindow/xforeign.c.c 2013-11-23 00:00:14 UTC (rev 657) +++ trunk/EusLisp/lisp/xwindow/xforeign.c.c 2013-11-29 09:29:09 UTC (rev 658) @@ -426,7 +426,7 @@ entry=(eusinteger_t)dlsym(dlhandle, xentry); #elif Darwin eusinteger_t dlhandle; - dlhandle=(eusinteger_t)dlopen("/opt/local/lib/libX11.dylib", RTLD_LAZY); + dlhandle=(eusinteger_t)dlopen("/opt/X11/lib/libX11.dylib", RTLD_LAZY); if( dlhandle==0 ) dlhandle=(eusinteger_t)dlopen("libX11.dylib", RTLD_LAZY); entry=(eusinteger_t)dlsym(dlhandle, xentry); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ina...@us...> - 2014-05-21 15:09:36
|
Revision: 672 http://sourceforge.net/p/euslisp/code/672 Author: inaba-jsk Date: 2014-05-21 15:09:30 +0000 (Wed, 21 May 2014) Log Message: ----------- add Hendy Baker's contribution on remove-duplicates with hash table Modified Paths: -------------- trunk/EusLisp/lisp/geo/primt.l trunk/EusLisp/lisp/l/common.l Modified: trunk/EusLisp/lisp/geo/primt.l =================================================================== --- trunk/EusLisp/lisp/geo/primt.l 2014-02-26 10:42:09 UTC (rev 671) +++ trunk/EusLisp/lisp/geo/primt.l 2014-05-21 15:09:30 UTC (rev 672) @@ -701,7 +701,7 @@ ;; - +#| (defun make-body-from-vertices (face-vertices &optional (klass *body-class*)) ; face-vertices=(list #f(x1 y1 z1) #f(x2 y2 z2) ...) ... #|(setq a @@ -728,6 +728,29 @@ (setq bod (instance *body-class* :init :faces (nreverse faces))) (send bod :csg (list (cons :body-from-vertices face-vertices))) bod) ) +|# +;; 2014.5.21 add Henry Baker's contribution of 2013.8.31 +(defun make-body-from-vertices (face-vertices &optional (klass *body-class*)) + ; face-vertices=(list #f(x1 y1 z1) #f(x2 y2 z2) ...) ... + (let* ((vlist (mapcar #'list + (remove-duplicates + (apply #'append face-vertices) + :test #'equal))) + (vhash (make-hash-table :size (* 2 (length vlist)) :test #'equal)) + faces bod) + (dolist (vlist-entry vlist) ; Populate hash table. + (or (gethash (car vlist-entry) vhash) + (setf (gethash (car vlist-entry) vhash) vlist-entry))) + (dolist (fverts face-vertices) + (let ((fvlist)) + (dolist (fv fverts) + ;; (push (assoc fv vlist) fvlist) + ;; (push (assoc fv vlist :test #'equal) fvlist) ; *** Too slow !!! *** + (push (gethash fv vhash) fvlist)) + (push (make-face-from-vertices (nreverse fvlist)) faces)) ) + (setq bod (instance *body-class* :init :faces (nreverse faces))) + (send bod :csg (list (cons :body-from-vertices face-vertices))) + bod) ) Modified: trunk/EusLisp/lisp/l/common.l =================================================================== --- trunk/EusLisp/lisp/l/common.l 2014-02-26 10:42:09 UTC (rev 671) +++ trunk/EusLisp/lisp/l/common.l 2014-05-21 15:09:30 UTC (rev 672) @@ -620,10 +620,30 @@ ((memq (car l) (cdr l)) (unique (cdr l))) (t (cons (car l) (unique (cdr l)))))) +#| (defun remove-duplicates (seq &key (test #'eq) (test-not) (key #'identity) (start 0) (end 1000000)) (system::raw-remove-duplicates seq test test-not key start end)) +|# +;; 2014.5.21 add Henry Baker's contribution of 2013.7.22, 2013.8.31 +(defun remove-duplicates (seq &key (key #'identity) + (test #'eq) (test-not) + (start 0) (end (length seq))) + (if (and (or (eq test #'eq) (eq test #'eql) (eq test #'equal)) + (> end 100)) + (let* ((htab (make-hash-table :size (* 2 (length seq)) :test test))) + (let* ((res + (remove-if + #'(lambda (k) + (let* ((v (gethash k htab))) + (unless v (setf (gethash k htab) t)) + v)) + seq + :start start :end end :key key))) + res)) + (system::raw-remove-duplicates seq test test-not key start end))) + (defun extream (seq test &optional (key #'identity)) (if (null seq) nil This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ina...@us...> - 2014-05-21 15:09:38
|
Revision: 672 http://sourceforge.net/p/euslisp/code/672 Author: inaba-jsk Date: 2014-05-21 15:09:30 +0000 (Wed, 21 May 2014) Log Message: ----------- add Hendy Baker's contribution on remove-duplicates with hash table Modified Paths: -------------- trunk/EusLisp/lisp/geo/primt.l trunk/EusLisp/lisp/l/common.l Modified: trunk/EusLisp/lisp/geo/primt.l =================================================================== --- trunk/EusLisp/lisp/geo/primt.l 2014-02-26 10:42:09 UTC (rev 671) +++ trunk/EusLisp/lisp/geo/primt.l 2014-05-21 15:09:30 UTC (rev 672) @@ -701,7 +701,7 @@ ;; - +#| (defun make-body-from-vertices (face-vertices &optional (klass *body-class*)) ; face-vertices=(list #f(x1 y1 z1) #f(x2 y2 z2) ...) ... #|(setq a @@ -728,6 +728,29 @@ (setq bod (instance *body-class* :init :faces (nreverse faces))) (send bod :csg (list (cons :body-from-vertices face-vertices))) bod) ) +|# +;; 2014.5.21 add Henry Baker's contribution of 2013.8.31 +(defun make-body-from-vertices (face-vertices &optional (klass *body-class*)) + ; face-vertices=(list #f(x1 y1 z1) #f(x2 y2 z2) ...) ... + (let* ((vlist (mapcar #'list + (remove-duplicates + (apply #'append face-vertices) + :test #'equal))) + (vhash (make-hash-table :size (* 2 (length vlist)) :test #'equal)) + faces bod) + (dolist (vlist-entry vlist) ; Populate hash table. + (or (gethash (car vlist-entry) vhash) + (setf (gethash (car vlist-entry) vhash) vlist-entry))) + (dolist (fverts face-vertices) + (let ((fvlist)) + (dolist (fv fverts) + ;; (push (assoc fv vlist) fvlist) + ;; (push (assoc fv vlist :test #'equal) fvlist) ; *** Too slow !!! *** + (push (gethash fv vhash) fvlist)) + (push (make-face-from-vertices (nreverse fvlist)) faces)) ) + (setq bod (instance *body-class* :init :faces (nreverse faces))) + (send bod :csg (list (cons :body-from-vertices face-vertices))) + bod) ) Modified: trunk/EusLisp/lisp/l/common.l =================================================================== --- trunk/EusLisp/lisp/l/common.l 2014-02-26 10:42:09 UTC (rev 671) +++ trunk/EusLisp/lisp/l/common.l 2014-05-21 15:09:30 UTC (rev 672) @@ -620,10 +620,30 @@ ((memq (car l) (cdr l)) (unique (cdr l))) (t (cons (car l) (unique (cdr l)))))) +#| (defun remove-duplicates (seq &key (test #'eq) (test-not) (key #'identity) (start 0) (end 1000000)) (system::raw-remove-duplicates seq test test-not key start end)) +|# +;; 2014.5.21 add Henry Baker's contribution of 2013.7.22, 2013.8.31 +(defun remove-duplicates (seq &key (key #'identity) + (test #'eq) (test-not) + (start 0) (end (length seq))) + (if (and (or (eq test #'eq) (eq test #'eql) (eq test #'equal)) + (> end 100)) + (let* ((htab (make-hash-table :size (* 2 (length seq)) :test test))) + (let* ((res + (remove-if + #'(lambda (k) + (let* ((v (gethash k htab))) + (unless v (setf (gethash k htab) t)) + v)) + seq + :start start :end end :key key))) + res)) + (system::raw-remove-duplicates seq test test-not key start end))) + (defun extream (seq test &optional (key #'identity)) (if (null seq) nil This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |