[#1094] Re: [ruby-cvs] ruby, ruby/lib: * eval.c (ev_const_defined, ev_const_get), variable.c — Dave Thomas <dave@...>

> * eval.c (rb_mod_autoload, rb_mod_autoload_p): new method;

12 messages 2003/05/29
[#1095] Re: [ruby-cvs] ruby, ruby/lib: * eval.c (ev_const_defined, ev_const_get), variable.c — nobu.nokada@... 2003/05/29

Hi,

Possible problem with mkmf under Darwin

From: Dave Thomas <dave@...>
Date: 2003-05-26 14:41:56 UTC
List: ruby-core #1082
I've been having fun getting readline support to work on OSX. My latest 
problem is that ext/readline/extconf.rb is complaining:

   checking for readline/readline.h... yes
   checking for readline/history.h... yes
   checking for readline() in -lreadline... no

Looking at the logfile, I see

   gcc -o conftest -I/usr/local/lib/ruby/1.8/powerpc-darwin6.6 
-I/usr/local/lib/ruby/
   1.8/powerpc-darwin6.6 -g -O2 -pipe conftest.c -L/usr/local/lib 
-lruby-static -lreadline -lobjc
   conftest.c: In function `t':
   conftest.c:4: `readline' undeclared (first use in this function)
   conftest.c:4: (Each undeclared identifier is reported only once
   conftest.c:4: for each function it appears in.)
   checked program was:
   /* begin */


   int main() { return 0; }
   int t() { void ((*volatile p)()); p = (void ((*)()))readline; return 0; }
   /* end */


It's failing during the compile, not during the link. The problem is 
that the test source file doesn't include readline/readline.h (it also 
needs stdio.h). If I manually add these two lines, the conftest program 
compiles and links without error.

The compiler says:

   dave[ext/readline 9:39:16] gcc -v
   Reading specs from /usr/libexec/gcc/darwin/ppc/3.1/specs
   Thread model: posix
   Apple Computer, Inc. GCC version 1175, based on gcc version 3.1 
20020420 (prerelease)


Is this a generic problem with gcc 3.1, or is it something Apple have 
done? And does anyone have any ideas of how to fix this?



Cheers



Dave


In This Thread

Prev Next