[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
guile on mac OSX
From: |
Seth Alves |
Subject: |
guile on mac OSX |
Date: |
Mon, 16 Jul 2001 14:55:31 -0700 |
Hi, I've built guile out of CVS on mac OSX Version 10.0.4 (Build 4Q12).
$ libtool --version
ltmain.sh (GNU libtool) 1.4 (1.920 2001/04/24 23:26:18)
$ autoconf --version
autoconf (GNU Autoconf) 2.50
$ cc -v
Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs
Apple Computer, Inc. version gcc-926, based on gcc version 2.95.2 19991024
(release)
$ uname -a
Darwin localhost 1.3.7 Darwin Kernel Version 1.3.7: Sat Jun 9 11:12:48 PDT
2001; root:xnu/xnu-124.13.obj~1/RELEASE_PPC Power Macintosh powerpc
Here are some troubles I ran into. Some of this is not trouble with
guile, but I included it anyway.
The build of ice-9 wants to run guile, so:
$ cvs diff Makefile.am
Index: Makefile.am
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/Makefile.am,v
retrieving revision 1.26
diff -r1.26 Makefile.am
23c23
< SUBDIRS = ice-9 oop qt libltdl libguile guile-config guile-readline \
---
> SUBDIRS = oop qt libltdl libguile ice-9 guile-config guile-readline \
When ice-9 builds, it doesn't find guile, and if it finds guile,
guile doesn't find ice-9, so:
$ cvs diff Makefile.am
Index: Makefile.am
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/ice-9/Makefile.am,v
retrieving revision 1.46
diff -r1.46 Makefile.am
49c49
< cd $(srcdir) && guile -c '(load-from-path "ice-9/syncase")
(define-module (ice-9 syncase)) (psyncomp)'
---
> cd $(srcdir) && GUILE_LOAD_PATH=.. ../libguile/guile -c
> '(load-from-path "ice-9/syncase") (define-module (ice-9 syncase)) (psyncomp)'
"macosx" wasn't defined, so I changed a line in gc_os_dep.c.
This probably isn't right... maybe I don't need the __ppc__ part?
$ cvs diff gc_os_dep.c
Index: gc_os_dep.c
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/libguile/gc_os_dep.c,v
retrieving revision 1.7
diff -r1.7 gc_os_dep.c
251c251
< # if defined(macosx)
---
> # if defined(__APPLE__) && defined (__ppc__)
The compiler doesn't like intptr_t or uintptr_t in
bitwise or arithmetic operations, so
$ cvs diff tags.h
Index: tags.h
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/libguile/tags.h,v
retrieving revision 1.83
diff -r1.83 tags.h
61c61
< #ifdef HAVE_UINTPTR_T
---
> #if defined(HAVE_UINTPTR_T) && ! defined (__APPLE__)
The default cpp does some stuff I didn't expect it to, and
it breaks many of the autoconf tests. It also causes a lot
of spew during guile-snarf. I tried a few things, and then
ended up doing:
CC="cc -traditional-cpp" CPP="cc -E -traditional-cpp" ./configure
--enable-maintainer-mode
This got the build a lot further.
When it was time to make libguile.la, this happened:
$ /bin/sh ../libtool --mode=link cc -traditional-cpp -g -O2 -Wall
-Wmissing-prototypes -o libguile.la -rpath /usr/local/lib -version-info 10:0:0
-export-dynamic alist.lo [many .o's removed for clarity] ../libltdl/libltdlc.la
-lm
rm -fr .libs/libguile.la .libs/libguile.* .libs/libguile.*
cc -traditional-cpp -dynamiclib -undefined suppress -o
.libs/libguile.10.0.0.dylib alist.lo [many .o's removed for clarity] -all_load
../libltdl/.libs/libltdlc.al ../libltdl/.libs/libltdlc.al -lm -lc
-install_name /usr/local/lib/libguile.10.dylib -compatibility_version 11
-current_version 11.0
ld: multiple definitions of symbol _lt_dladderror
../libltdl/.libs/libltdlc.al(ltdl.lo) definition of _lt_dladderror in section
(__TEXT,__text)
../libltdl/.libs/libltdlc.al(ltdl.lo) definition of _lt_dladderror in section (
...
libltdlc.al is linked in twice, and the linker hates it. I didn't figure
out how to solve this one. What I did was create a perl script called
"nodup-cc" which contains
#!/usr/bin/perl
$command = "cc ";
for ($i=0; $i<@ARGV; $i++)
{
next if ($i > 0 && ($ARGV[ $i-1 ] eq $ARGV[ $i ]));
$command .= $ARGV[ $i ] . " ";
}
system ($command);
and then
CC="nodup-cc -traditional-cpp" CPP="nodup-cc -E -traditional-cpp" ./configure
--enable-maintainer-mode
After that, guile built and it started doing the texi snarfing. This
died because zsh (OSX's /bin/sh) is doing a weird thing with this line
exec $program ${1+"$@"}
which is in libtool's wrapper script for guile.
You can see what is happenening by looking at this:
$ ./guile --debug -c "(display \"hi\n\")"
Backtrace:
In unknown file:
?: 0* (begin (eval-string "(display") (quit))
?: 1* [eval-string "(display"]
<unnamed port>: In procedure list in expression (eval-string "(display"):
<unnamed port>: end of file
$ ./guile --debug -c "(display\"hi\n\")"
hi
The difference is a space in the first one. The arguments are being
split by the space characters with no regard to the quotes. I don't
know why zsh is doing it this way, maybe these links contain the
answer, but I don't get it. My powers of shell scripting are weak.
http://www.geocrawler.com/archives/3/405/2001/1/0/4910321/
http://sources.redhat.com/autobook/autobook/autobook_214.html
http://www.faqs.org/faqs/unix-faq/shell/zsh/
question 3.1
I found a couple of ways to avoid this. One is to replace /bin/sh
with bash. Another is to apply this patch to
/usr/local/share/libtool/ltmain.sh
$ diff ltmain.sh-orig ltmain.sh
3678a3679,3689
> # zsh on macosx mangles arguments when it sees ${1+"$@"} ?
> *-apple-darwin*)
> $echo >> $output "\
> # Export the path to the program.
> PATH=\"\$progdir:\$PATH\"
> export PATH
>
> exec \$program \"address@hidden"
> "
> ;;
>
Here are some scary warnings i saw:
In file included from numbers.c:4220:
../libguile/num2integral.i.c: In function `scm_short2num':
../libguile/num2integral.i.c:90: warning: comparison is always true due to
limited range of data type
In file included from numbers.c:4268:
../libguile/num2integral.i.c: In function `scm_num2ptrdiff':
../libguile/num2integral.i.c:24: warning: decimal constant is so large that it
is unsigned
../libguile/num2integral.i.c:43: warning: decimal constant is so large that it
is unsigned
../libguile/num2integral.i.c: In function `scm_i_ptrdiff2big':
../libguile/num2integral.i.c:123: warning: decimal constant is so large that it
is unsigned
regex-posix.c: In function `scm_regexp_exec':
regex-posix.c:281: warning: cast to pointer from integer of different size
regex-posix.c:282: warning: cast to pointer from integer of different size
-seth
- guile on mac OSX,
Seth Alves <=