OpenWRT errors with 10.6.2

Started by kanen, March 10, 2015, 07:11:53 PM

Previous topic - Next topic

kanen

I'm porting 10.6.2 to OpenWRT (both Intel x86 and MIPS) and I keep getting the error below with the makefile_openwrt below.



Any suggestions?


nl-filesys.c: In function 'p_spawn':
nl-filesys.c:1498:42: error: 'MAP_ANON' undeclared (first use in this function)
     PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0)) == (void*)-1)
                                          ^
nl-filesys.c:1498:42: note: each undeclared identifier is reported only once for each function it appears in
nl-filesys.c: In function 'p_share':
nl-filesys.c:2152:55: error: 'MAP_ANON' undeclared (first use in this function)
     0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0)) == (void*)-1)
                                                       ^
make[5]: *** [nl-filesys.o] Error 1
make[4]: *** [default] Error 2
make[3]: *** [/Volumes/OpenPipe/build_dir/target-i386_i486_uClibc-0.9.33.2/newlisp-10.6.2/.configured_] Error 2
make[3]: Leaving directory `/Volumes/OpenPipe/package/devel/newlisp'
make[2]: *** [package/devel/newlisp/compile] Error 2
make[2]: Leaving directory `/Volumes/OpenPipe'
make[1]: *** [/Volumes/OpenPipe/staging_dir/target-i386_i486_uClibc-0.9.33.2/stamp/.package_compile] Error 2
make[1]: Leaving directory `/Volumes/OpenPipe'
make: *** [world] Error 2


I'm using this makefile:
# makefile for newLISP v.10.x.x on Openwrt LINUX without readline support
# I use upx to compress as hell as I can on newlisp
# Note, that readline support may require different libraries on different OSs
#

OBJS = newlisp.o         nl-liststr.o      nl-symbol.o       pcre.o  
nl-debug.o        nl-math.o         nl-utf8.o         unix-lib.o  
nl-filesys.o      nl-matrix.o       nl-web.o          win32-path.o
nl-import.o       nl-sock.o         nl-xml-json.o     win32-util.o
nl-list.o         nl-string.o       pcre-chartables.o win32dll.o

#CFLAGS = -Wall -pedantic -Wno-uninitialized -c -O2 -g -DLINUX
CFLAGS = -Wall -Wl,--gc-sections  -ffunction-sections -fdata-sections
 -c -Os  -fno-threadsafe-statics  -DLINUX -I$(TARGET_DIR)/usr/include/
 -std=gnu99
LDFLAGS = -L$(TARGET_DIR)/usr/lib/  -W1,--gc-sections -lm -ldl
CC = openwrt-linux-gcc
LD = openwrt-linux-ld


default: $(OBJS)
        $(CC) $(OBJS)  -o newlisp $(LDFLAGS)   #for openwrt
#    $(CC) $(OBJS) -g -lm -ldl -lreadline -ltermcap -o newlisp # slackware
#    $(CC) $(OBJS) -g -lm -ldl -lreadline -lncurses -o newlisp # other Linux Dist
#    $(CC) $(OBJS) -g -lm -ldl -o newlisp # without readline support
        $(STRIP) newlisp
        upx --best -o newlisp_s newlisp
        rm newlisp
        mv newlisp_s newlisp

.c.o:
        $(CC) $(CFLAGS) $<

$(OBJS): primes.h protos.h pcre.h pcre-config.h
. Kanen Flowers http://kanen.me[/url] .

kanen

#1
I may have figured it out. If so, I'll post my OpenWRT Makefile and the upstream .tgz needed to get newLisp 10.6.2 to compile on the latest OpenWRT (14.07 or even trunk).



The OpenWRT build system is just complicated.
. Kanen Flowers http://kanen.me[/url] .

kanen

#2
It works. The newLisp sources are on our servers, but...


cd openwrt/devel
mkdir newlisp
cd newlisp
wget http://dev.kanen.me/trusted/Makefile

Then... change back to your openwrt directory and enable newLisp...
cd ../..
make menu_config

Under Base System, find newLisp and hit "y" to enable it.



then, run make V=99
and you'll have a system with newLisp 10.6.2 installed.
. Kanen Flowers http://kanen.me[/url] .

Lutz

#3
Thanks Kanen, there are links to this on this page: http://www.newlisp.org/index.cgi?Downloads">http://www.newlisp.org/index.cgi?Downloads