Re: [Tack-devel] ACK compiles on NetBSD-macppc, sort of...
Moved to https://github.com/davidgiven/ack
Brought to you by:
dtrg
From: Gregory T. (t. K. <gt...@di...> - 2006-07-17 13:08:39
|
I've made some progress identifying issues with ACK on *BSD. While the= first pass did create executables, there was limited functionality since= almost all of the supporting lib.bin files failed to compiler. Using the= test.c example posted by David Given (http://sourceforge.net/mailarchive/fo= rum.php?thread_id=3D7938530&forum_id=3D45107) I got > ../bin/bin/acc -mem44 -I$ACKDIR/include/tail_ac -ansi -O -o test test.c =2E./bin/bin/acc: Cannot execute /home/lapd/ack/bin/lib.bin/em_opt em_opt had not compiled. I traced this down to a problem in util/opt/pop_pu= sh.awk. I believe this to be a matter of different implementations of awk,= rather than an actual bug in the file. As I mentioned before, I'm using= NetBSD-3.99.3 (macppc), which gives > awk -V awk version 20030729 In pop_push.awk, the "'\000'" wasn't creating a null string termination= character but instead was null'ing everything after the '\000'. I fixed= this by explicitly crafting a '\0' string output. em_opt now compiles= successfully. =20 Index: pop_push.awk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/tack/Ack/util/opt/pop_push.awk,v retrieving revision 1.5 diff -r1.5 pop_push.awk 18c18 < print "'\000'," --- > print "'\\""0""'," 25,26c25,26 < else f_out =3D f_out "'\000'" < print f_out"," --- > else f_out =3D f_out "'\\""0""'," > print f_out "," Now I get to: > ../bin/bin/acc -mem44 -I$ACKDIR/include/tail_ac -ansi -O -o test test.c asld: file /home/lapd/ack/bin/lib/em44/head_ac: line 0: can't open /home/lap= d/ack/bin/lib/em44/head_ac asld: file /home/lapd/ack/bin/lib/em44/tail_ac: line 21: can't open /home/la= pd/ack/bin/lib/em44/tail_ac asld: file /home/lapd/ack/bin/lib/em44/tail_mon: line 21: can't open /home/l= apd/ack/bin/lib/em44/tail_mon asld: file /home/lapd/ack/bin/lib/em44/end_em: line 21: can't open /home/lap= d/ack/bin/lib/em44/end_em Unresolved references Procedures: printf exit Data: The em44 libs haven't compiled. The updated INSTALL.out is at http://www.dialectronics.com/ack/INSTALL.out It shows a lot of failures, and the largest problem overall is with lseek. = In the ACK source files, it is listed both as extern long lseek and long= lseek (no extern). On NetBSD, it is declared off_t. I have been able to= successfully compile one of the other utils (astrip) that chokes on this by= adding some code to declare lseek extern off_t: Index: util/amisc/astrip.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/tack/Ack/util/amisc/astrip.c,v retrieving revision 1.10 diff -r1.10 astrip.c 41a42,44 > #ifdef __OFF_T_SYSCALLS_DECLARED > extern off_t lseek(); > #else 42a46 > #endif However, I see that in one of the types.h files off_t is declared to be a= long. Here is an example of the build fail report: > more ../obj/util/arch/Out=20 cc -I/home/lapd/ack/bin/h -DDISTRIBUTION -O -D_EM_WSIZE=3D4 -D_EM_PSIZE=3D4 = -D__XXX_ _ -c /home/lapd/ack/ack-5.6/util/arch/archiver.c /home/lapd/ack/ack-5.6/util/arch/archiver.c:47: error: conflicting types for= `lseek' /usr/include/sys/types.h:233: error: previous declaration of `lseek' *** Error code 1 Stop. make: stopped in /home/lapd/ack/obj/util/arch I'm thinking there is a central place I can get the off_t declaration to be= set, and have it propagate from there. Any suggestions are appreciated. thanks in advance, tim Gregory T. (tim) Kelly Owner Dialectronics.com P.O. Box 606 Newberry, SC 29108 "Anything war can do, peace can do better." -- Bishop Desmond Tutu |