The readline egg does not install on OS X 10.6 (Snow Leopard) due to a
mismatch between the readline library that ships with the base OS X
system (under /usr) and what the egg's expecting.  I suspect, but have
not verified, that OS X is shipping a much older version of readline.

Fortunately, the readline in MacPorts works with the readline egg; it's
just a matter of getting chicken-install to compile and link against
/opt/local.  To do that, I hacked readline.setup.  Here's what I did:

First, fetch a local copy of the egg:

  % chicken-install -r readline

THen apply this patch to readline/readline.setup:

  % diff readline/readline.setup readline-hack/

  22c22
  <      (and (condition-case (compile -s -o rlu-test rl-usable-test.scm libs 
...)
  ---
  >      (and (condition-case (compile -s -v -I/opt/local/include 
-L/opt/local/lib -o rlu-test rl-usable-test.scm libs ...)
  43c43
  < (compile -s -O2 readline.scm ,@rl-extralib)
  ---
  > (compile -s -O2 -I/opt/local/include -L -Z -L/opt/local/lib readline.scm 
,@rl-extralib)
  45c45
  < (compile -c -O2 -d0 -j readline readline.scm
  ---
  > (compile -c -O2 -d0 -I/opt/local/include -j readline readline.scm
  48c48
  < (compile -s -O2 -d0 readline.import.scm)
  ---
  > (compile -s -O2 -L -Z -L/opt/local/lib -d0 readline.import.scm)

...and then install from the readline subdirectory:

  % cd readline
  % chicken-install

Though it builds and installs cleanly, saved history doesn't seem to be
working; I haven't bothered to figure out why.  For reference, the
relevant portion of my .csirc looks like this:

  (require-extension readline)
  (current-input-port (make-gnu-readline-port))
  (gnu-history-install-file-manager 
    (string-append (or (getenv "HOME") ".") "/.csi.history"))

I've attempted to attach transcripts of before and after to this post,
along with the above patch.  If they don't come out, I'll add them as
follow-on replies.  I recently switched back to gnus and haven't had an
opportunity before now to try out this new-fangled MIME support...

Derrell

fluffy671% chicken-install
retrieving ...
checking dependencies for `readline' ...
install order:
("readline")
installing readline: ...
changing current directory to .
  /usr/local/bin/csi -bnq -setup-mode -e "(require-library setup-api)" -e 
"(import setup-api)" -e "(extension-name-and-version '(\"readline\" \"\"))" 
readline.setup
  /usr/local/bin/csc -feature compiling-extension -setup-mode   -s -o rlu-test 
rl-usable-test.scm -lreadline -lhistory -ltermcap
ld: library not found for -lhistory
collect2: ld returned 1 exit status

Error: shell command terminated with non-zero exit status 256: gcc rlu-test.o 
-o rlu-test -m64 -bundle -lreadline -lhistory -ltermcap -L/usr/local/lib 
-lchicken -lm
  /usr/local/bin/csc -feature compiling-extension -setup-mode   -s -o rlu-test 
rl-usable-test.scm -lreadline -lhistory -lcurses
ld: library not found for -lhistory
collect2: ld returned 1 exit status

Error: shell command terminated with non-zero exit status 256: gcc rlu-test.o 
-o rlu-test -m64 -bundle -lreadline -lhistory -lcurses -L/usr/local/lib 
-lchicken -lm
  /usr/local/bin/csc -feature compiling-extension -setup-mode   -s -o rlu-test 
rl-usable-test.scm -lreadline -lhistory -lncurses
ld: library not found for -lhistory
collect2: ld returned 1 exit status

Error: shell command terminated with non-zero exit status 256: gcc rlu-test.o 
-o rlu-test -m64 -bundle -lreadline -lhistory -lncurses -L/usr/local/lib 
-lchicken -lm
  /usr/local/bin/csc -feature compiling-extension -setup-mode   -s -o rlu-test 
rl-usable-test.scm -lreadline -ltermcap
Undefined symbols:
  "_rl_refresh_line", referenced from:
      _main in rlu-test.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

Error: shell command terminated with non-zero exit status 256: gcc rlu-test.o 
-o rlu-test -m64 -bundle -lreadline -ltermcap -L/usr/local/lib -lchicken -lm
  /usr/local/bin/csc -feature compiling-extension -setup-mode   -s -o rlu-test 
rl-usable-test.scm -lreadline -lcurses
Undefined symbols:
  "_rl_refresh_line", referenced from:
      _main in rlu-test.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

Error: shell command terminated with non-zero exit status 256: gcc rlu-test.o 
-o rlu-test -m64 -bundle -lreadline -lcurses -L/usr/local/lib -lchicken -lm
  /usr/local/bin/csc -feature compiling-extension -setup-mode   -s -o rlu-test 
rl-usable-test.scm -lreadline -lncurses
Undefined symbols:
  "_rl_refresh_line", referenced from:
      _main in rlu-test.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

Error: shell command terminated with non-zero exit status 256: gcc rlu-test.o 
-o rlu-test -m64 -bundle -lreadline -lncurses -L/usr/local/lib -lchicken -lm
  /usr/local/bin/csc -feature compiling-extension -setup-mode   -s -o rlu-test 
rl-usable-test.scm -lreadline -lhistory
ld: library not found for -lhistory
collect2: ld returned 1 exit status

Error: shell command terminated with non-zero exit status 256: gcc rlu-test.o 
-o rlu-test -m64 -bundle -lreadline -lhistory -L/usr/local/lib -lchicken -lm
  /usr/local/bin/csc -feature compiling-extension -setup-mode   -s -o rlu-test 
rl-usable-test.scm -lreadline
Undefined symbols:
  "_rl_refresh_line", referenced from:
      _main in rlu-test.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

Error: shell command terminated with non-zero exit status 256: gcc rlu-test.o 
-o rlu-test -m64 -bundle -lreadline -L/usr/local/lib -lchicken -lm

Error: This extension requires GNU readline.  GNU readline may be found at 
ftp://ftp.gnu.org/pub/gnu/readline
For more information, please consult 
http://chicken.wiki.br/readline#Installation%20problems.

        Call history:

        setup-api.scm: 245  run-verbose         
        display         
        display         
        write-char/port         
        ##sys#flush-output              
        setup-api.scm: 246  $system             
        setup-api.scm: 776  system              
        setup-api.scm: 781  error                       <--

Error: shell command terminated with nonzero exit code
17920
"/usr/local/bin/csi -bnq -setup-mode -e \"(require-library setup-api)\" -e 
\"(im...
fluffy673% chicken-install
retrieving ...
checking dependencies for `readline' ...
install order:
("readline")
installing readline: ...
changing current directory to .
  /usr/local/bin/csi -bnq -setup-mode -e "(require-library setup-api)" -e 
"(import setup-api)" -e "(extension-name-and-version '(\"readline\" \"\"))" 
readline.setup
  /usr/local/bin/csc -feature compiling-extension -setup-mode   -s -v 
-I/opt/local/include -L/opt/local/lib -o rlu-test rl-usable-test.scm -lreadline 
-lhistory -ltermcap
/usr/local/bin/chicken rl-usable-test.scm -output-file rlu-test.c -dynamic 
-feature chicken-compile-shared -feature compiling-extension -setup-mode
gcc rlu-test.c -o rlu-test.o -c -no-cpp-precomp -fno-strict-aliasing 
-fno-common -DHAVE_CHICKEN_CONFIG_H -m64 -DC_ENABLE_PTABLES -Os 
-fomit-frame-pointer -fPIC -DPIC -DC_SHARED -I/opt/local/include 
-I/usr/local/include
rm rlu-test.c
gcc rlu-test.o -o rlu-test -m64 -bundle -L/opt/local/lib -lreadline -lhistory 
-ltermcap -L/usr/local/lib -lchicken -lm
install_name_tool -change libchicken.dylib /usr/local/lib/libchicken.dylib 
rlu-test
rm rlu-test.o
  /usr/local/bin/csc -feature compiling-extension -setup-mode   -s -O2 
-I/opt/local/include -L -Z -L/opt/local/lib readline.scm -lreadline -lhistory 
-ltermcap
  /usr/local/bin/csc -feature compiling-extension -setup-mode   -c -O2 -d0 
-I/opt/local/include -j readline readline.scm -o readline-static.o -unit 
readline -lreadline -lhistory -ltermcap
  /usr/local/bin/csc -feature compiling-extension -setup-mode   -s -O2 -L -Z 
-L/opt/local/lib -d0 readline.import.scm
  rm -fr /usr/local/lib/chicken/4/readline.so
  cp -r readline.so /usr/local/lib/chicken/4/readline.so
  chmod a+r /usr/local/lib/chicken/4/readline.so
  rm -fr /usr/local/lib/chicken/4/readline.import.so
  cp -r readline.import.so /usr/local/lib/chicken/4/readline.import.so
  chmod a+r /usr/local/lib/chicken/4/readline.import.so
  cp -r readline-static.o /usr/local/lib/chicken/4/readline-static.o
  chmod a+r /usr/local/lib/chicken/4/readline-static.o
  chmod a+r /usr/local/lib/chicken/4/readline.setup-info
22c22
<      (and (condition-case (compile -s -o rlu-test rl-usable-test.scm libs ...)
---
>      (and (condition-case (compile -s -v -I/opt/local/include -L/opt/local/lib -o rlu-test rl-usable-test.scm libs ...)
43c43
< (compile -s -O2 readline.scm ,@rl-extralib)
---
> (compile -s -O2 -I/opt/local/include -L -Z -L/opt/local/lib readline.scm ,@rl-extralib)
45c45
< (compile -c -O2 -d0 -j readline readline.scm
---
> (compile -c -O2 -d0 -I/opt/local/include -j readline readline.scm
48c48
< (compile -s -O2 -d0 readline.import.scm)
---
> (compile -s -O2 -L -Z -L/opt/local/lib -d0 readline.import.scm)
_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to