Subject: [clisp-list] compiling clisp-2.31 on FreeBSD-5.2

From: Sam Halliday <[email-masked]>
Date: Wed Dec 17 07:23:11 2003

hi there,

i was trying to compile clisp-2.31 on a FreeBSD-5.2-RC1
system, when the compile failed with this error:

######################################################
$make
test -d bindings || mkdir -p bindings
test -d regexp || ../src/lndir ../modules/regexp regexp
if test -f regexp/configure -a '!' -f regexp/config.status ; then cd regexp ; ./configure --cache-file=`echo regexp/ | sed -e 's,[^/][^/]*//*,../,g'`config.cache ; fi
CLISP="`pwd`/lisp.run -M `pwd`/lispinit.mem -B `pwd` -N `pwd`/locale -Efile UTF-8 -Eterminal UTF-8 -norc" ; cd regexp ; dots=`echo regexp/ | sed -e 's,[^/][^/]*//*,../,g'` ; make clisp-module CC="gcc" CFLAGS="-I/opt/sam/include  -W -Wswitch -Wcomment -Wpointer-arith -Wimplicit -Wreturn-type  -fomit-frame-pointer -Wno-sign-compare -O2 -fexpensive-optimizations -DUNICODE -DDYNAMIC_FFI -DDYNAMIC_MODULES -DNO_SIGSEGV -fPIC" INCLUDES="$dots" LISPBIBL_INCLUDES=" ${dots}lispbibl.c ${dots}fsubr.c ${dots}subr.c ${dots}pseudofun.c ${dots}constsym.c ${dots}constobj.c ${dots}unix.c ${dots}xthread.c ${dots}libcharset.h" CLFLAGS="-x none -Wl,-export-dynamic" LIBS="/opt/sam/lib/libintl.so /opt/sam/lib/libiconv.so -Wl,-rpath -Wl,/opt/sam/lib libcharset.a libavcall.a libcallback.a -lreadline -lncurses  /opt/sam/lib/libiconv.so -Wl,-rpath -Wl,/opt/sam/lib " RANLIB="ranlib" CLISP="$CLISP -q"
make[1]: Entering directory `/tmp/root.build/clisp-2.31/mysrc/regexp'
make[1]: Nothing to be done for `clisp-module'.
make[1]: Leaving directory `/tmp/root.build/clisp-2.31/mysrc/regexp'
test -d base || (mkdir base && cd base && for f in lisp.a libnoreadline.a libcharset.a libavcall.a libcallback.a  modules.h modules.o makevars lisp.run lispinit.mem; do ln -s ../$f $f; done) || (rm -rf base ; exit 1)
rm -rf full
CLISP_LINKKIT=. ./clisp-link add-module-sets base full regexp  || (rm -rf full ; exit 1)
make[1]: Entering directory `/tmp/root.build/clisp-2.31/mysrc/regexp'
make[1]: Nothing to be done for `clisp-module'.
make[1]: Leaving directory `/tmp/root.build/clisp-2.31/mysrc/regexp'
gcc -I/opt/sam/include -W -Wswitch -Wcomment -Wpointer-arith -Wimplicit -Wreturn-type -fomit-frame-pointer -Wno-sign-compare -O2 -fexpensive-optimizations -DUNICODE -DDYNAMIC_FFI -DDYNAMIC_MODULES -DNO_SIGSEGV -fPIC -I/tmp/root.build/clisp-2.31/mysrc -c modules.c
gcc -I/opt/sam/include -W -Wswitch -Wcomment -Wpointer-arith -Wimplicit -Wreturn-type -fomit-frame-pointer -Wno-sign-compare -O2 -fexpensive-optimizations -DUNICODE -DDYNAMIC_FFI -DDYNAMIC_MODULES -DNO_SIGSEGV -fPIC -x none -Wl,-export-dynamic modules.o regexi.o lisp.a /opt/sam/lib/libintl.so /opt/sam/lib/libiconv.so -Wl,-rpath -Wl,/opt/sam/lib libcharset.a libavcall.a libcallback.a -lreadline -lncurses /opt/sam/lib/libiconv.so -Wl,-rpath -Wl,/opt/sam/lib -o lisp.run
base/lisp.run -B . -M base/lispinit.mem -norc -q -i regexp/preload.lisp -x (saveinitmem "full/lispinit.mem")
;; Loading file regexp/preload.lisp ...
;; Loaded file regexp/preload.lisp
1091504 ;
545752
full/lisp.run -B . -M full/lispinit.mem -norc -q -i regexp/regexp -x (saveinitmem "full/lispinit.mem")
;; Loading file /tmp/root.build/clisp-2.31/mysrc/regexp/regexp.fas ...
;; Loaded file /tmp/root.build/clisp-2.31/mysrc/regexp/regexp.fas
1099144 ;
549572
sed: -e expression #1, char 88: Unknown option to `s'
make: *** [full] Error 1
######################################################

maybe there is some GNU sed specific code in the makefiles? but
i cannot find it.

i would normally just use the BSD ports and be done with it, but i am
trying to create a tarball of sources which i can compile on any UNIX
system (without root priveledges), so that i can have the same applications
which i use on a daily basis no matter where i go. so far i have only
managed to get clisp compiled and working on GNU/Linux, but SUN is next.

could anyone please help?

cheers,
Sam

---

From: Pascal J.Bourguignon <[email-masked]>
Date: Wed Dec 17 07:45:10 2003

Sam Halliday writes:
> [...]

A generic  trick in these cases is  to write a small  script named sed
and put  it in a directory at  the beginning of the  PATH. This little
script would log  all its arguments (and perhaps  its stdin), and then
exec the real command.

Then an  easy solution would  be to modify  this script to  handle the
unknown options and to keep it (but of course, for free software, it's
better to report the bug and have it corrected in the sources).

Otherwise, an intense grepping session on the sources should help:

      find clisp -type f -exec grep -n sed {} /dev/null \;

-- 
__Pascal_Bourguignon__                              .  *   * . * .* .
http://www.informatimago.com/                        .   *   .   .*
There is no worse tyranny than to force             * .  . /\  ()  . *
a man to pay for what he does not                    . .  / .\   . * .
want merely because you think it                    .*.  / *  \  . .
would be good for him. -- Robert Heinlein             . /*   o \     .
http://www.theadvocates.org/                        *   '''||'''   .
SCO Spam-magnet: [email-masked]                 ******************

---

From: Sam Steingold <[email-masked]>
Date: Wed Dec 17 08:07:07 2003

> * Sam Halliday <[email-masked]> [2003-12-17 15:27:25 +0000]:
>

I suspect that this is the same as
<http://sourceforge.net/tracker/?group_id=1355&atid=101355&func=detail&aid=648079>
could you please investigate?

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
Life is like a diaper -- short and loaded.

---

From: Sam Steingold <[email-masked]>
Date: Wed Dec 17 09:05:16 2003

> * Sam Halliday <[email-masked]> [2003-12-17 16:48:42 +0000]:
>
> Sam Steingold wrote:
> yes, i belive it is the same bug. the attached patch (using #s instead
> of ,s for delimiters) seems to fix the compilation problems.

this is not a solution. '#' might be rare, but it is just as legal as ','.
moreover, you kept the line quoting commas:

-      LIBS=`echo $LIBS | sed s/','/'\\,'/g`
+      LIBS=`echo $LIBS | sed 's#','#'\\,'#g'`

this does not make any sense - why quote commas if they will not have
any special meaning?

however, please try either of the following two patches, in turn - i.e.,
apply first, try, _remove_ it, apply second, try again, and tell me if
either helps.
thanks.

> however, the following test seems to fail:
>
> Form: (LET ((H (MAKE-HASH-TABLE :TEST `(,(LAMBDA (A B) (LIST (LIST '= A B)) (= A
> B)) . ,(LAMBDA (X) (LET ((Z (SXHASH (COERCE X 'DOUBLE-FLOAT)))) (LIST `((HASH
> ,X) => ,Z)) Z)))))) (LOOP :FOR I :FROM 0 :TO 1000 :DO (SETF (GETHASH I H)
> (FORMAT NIL "~r" I))) (LOOP :FOR I :FROM 0 :TO 1000 :UNLESS (STRING= (GETHASH
> (FLOAT I 1.0d0) H) (GETHASH (FLOAT I 1.0s0) H)) :COLLECT I))
> CORRECT: NIL
> CLISP  : (892)

I think this has been fixed in the CVS.
could you please check that?

> FreeBSD-5.3-RC1 uses a prerelease of gcc-3.3.3

you might want to remove -fomit-frame-pointer from the CFLAGS
if the CVS still exhibits this bug.

PS. please keep the discussion on the list.  thanks.

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
Beauty is only a light switch away.

--- clisp-link.in.~1.15.~	2003-07-31 19:42:07.823688600 -0400
+++ clisp-link.in	2003-12-17 12:00:56.242352000 -0500
@@ -282,7 +282,7 @@
     verbose "$destinationdir"/${LISPRUN} -B "$installbasedir" -M "$lispinitdir"/lispinit.mem -norc -q -i $to_load -x "(saveinitmem \"$destinationdir/lispinit.mem\")"
     # Generate new makevars
     echo "LIBS: before: "$LIBS
-    LIBS=`echo $LIBS | sed s/','/'\\\\,'/g`
+    LIBS=`echo $LIBS | sed s/','/'\\,'/g`
     echo "LIBS: after: "$LIBS
     sed -e "s,^LIBS=.*\$,LIBS='${LIBS}'," -e "s,^FILES=.*\$,FILES='${FILES}'," < "$sourcedir"/makevars > "$destinationdir"/makevars
     # Done.

--- clisp-link.in.~1.15.~	2003-07-31 19:42:07.823688600 -0400
+++ clisp-link.in	2003-12-17 12:01:25.604572800 -0500
@@ -422,7 +422,7 @@
         verbose "$destinationdir"/${LISPRUN} -B "$installbasedir" -M "$sourcedir"/lispinit.mem -norc -q -i ${LOAD} -x "(saveinitmem \"$destinationdir/lispinit.mem\")"
       fi
       # Generate new makevars
-      LIBS=`echo $LIBS | sed s/','/'\\,'/g`
+      LIBS=`echo $LIBS | sed s/','/'\\\\,'/g`
       sed -e "s,^LIBS=.*\$,LIBS='${LIBS}'," -e "s,^FILES=.*\$,FILES='${FILES}'," < "$sourcedir"/makevars > "$destinationdir"/makevars
     fi
     # Done.

---

From: zera holladay <[email-masked]>
Date: Wed Dec 17 09:15:13 2003

Hi,

I had a similar problem with sed on FreeBSD 5.2 while
building with clx but not regex -- specifically on
line 426 of a script called clisp-link.sh (or some
very similar name).  I managed to get around it by
replacing all of the "|" with "," in the defective sed
call.

Let me know if that works, otherwise I will rebuild
Clisp tonight so that I can be a little more specific.

-zh

> could you please investigate?
-------------------------------------------------------
> This SF.net email is sponsored by: IBM Linux
> Tutorials.
> Become an expert in LINUX or just sharpen your
> skills.  Sign up for IBM's
> Free Linux Tutorials.  Learn everything from the
> bash shell to sys admin.
> Click now!
>
http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
> _______________________________________________
> clisp-list mailing list
> [email-masked]
>
https://lists.sourceforge.net/lists/listinfo/clisp-list

__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

---

From: Sam Halliday <[email-masked]>
Date: Wed Dec 17 09:35:03 2003

Sam Steingold wrote:
> ><http://sourceforge.net/tracker/?group_id=1355&atid=101355&func=detail&aid=6
> >48079> > could you please investigate?
> >

oops sorry, wasnt thinking straight... i was worried about the #s commenting out
the rest of the line so i wanted them quoted at all times...

> apply first, try, _remove_ it, apply second, try again, and tell me if

i tried the first one... and it seemed to fix both the compile fail and the test
which failed previously.

thanks for the rapid response fix!

cheers,
Sam

---

From: Sam Halliday <[email-masked]>
Date: Wed Dec 17 09:50:02 2003

CORRECTION:

> apply first, try, _remove_ it, apply second, try again, and tell me if

sorry... the first patch didnt make a difference at all; i had compiled using a
different environment than normal and this must have effected the build more
than the patch, as i just had it fail.

testing the 2nd one now...

---

From: Sam Halliday <[email-masked]>
Date: Wed Dec 17 09:57:05 2003

Sam Halliday wrote:
> sorry... the first patch didnt make a difference at all; i had compiled using
> a different environment than normal and this must have effected the build more

it doesnt make a difference either, sorry

---

From: Sam Steingold <[email-masked]>
Date: Wed Dec 17 12:27:05 2003

> * Sam Halliday <[email-masked]> [2003-12-17 18:02:29 +0000]:
>> sorry... the first patch didnt make a difference at all

please clean-up your CLISP installation,
apply the appended patch, and do

./configure --with-module=regexp build build-dir

please tell us what is printed for "LIBS before & after".

(you might want to add
sed(){ echo "sed: "$* >&2; /bin/sed $*; }
as Pascal suggested)

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
Ernqvat guvf ivbyngrf QZPN.

--- clisp-link.in.~1.15.~	2003-07-31 19:42:07.823688600 -0400
+++ clisp-link.in	2003-12-17 14:59:00.804896000 -0500
@@ -422,7 +422,9 @@
         verbose "$destinationdir"/${LISPRUN} -B "$installbasedir" -M "$sourcedir"/lispinit.mem -norc -q -i ${LOAD} -x "(saveinitmem \"$destinationdir/lispinit.mem\")"
       fi
       # Generate new makevars
-      LIBS=`echo $LIBS | sed s/','/'\\,'/g`
+      echo "LIBS: before: "$LIBS
+      LIBS=`echo $LIBS | sed s/','/'\\\\,'/g`
+      echo "LIBS: after:  "$LIBS
       sed -e "s,^LIBS=.*\$,LIBS='${LIBS}'," -e "s,^FILES=.*\$,FILES='${FILES}'," < "$sourcedir"/makevars > "$destinationdir"/makevars
     fi
     # Done.

---

From: Sam Halliday <[email-masked]>
Date: Sat Dec 20 10:33:00 2003

> please tell us what is printed for "LIBS before & after".

all seemed to compile fine! but, i still got the failed test:

###########################
###########################

the LIBS you asked for are

LIBS: before: regexi.o lisp.a /opt/sam/lib/libintl.so /opt/sam/lib/libiconv.so
-Wl,-rpath -Wl,/opt/sam/lib libcharset.a libavcall.a libcallback.a -lreadline
-lncurses /opt/sam/lib/libiconv.so -Wl,-rpath -Wl,/opt/sam/lib
LIBS: after:  regexi.o lisp.a /opt/sam/lib/libintl.so /opt/sam/lib/libiconv.so
-Wl\,-rpath -Wl\,/opt/sam/lib libcharset.a libavcall.a libcallback.a -lreadline
-lncurses /opt/sam/lib/libiconv.so -Wl\,-rpath -Wl\,/opt/sam/lib

i will now see if i can get CVS and check if the test passes.

cheers,
Sam