Any ideas on how to get readline support in OS X 10.3?

I just got this working for ruby1.8 on OS X 10.2... then upgraded.

The old hack involved installing the headers for a library that was
actually there, but with 10.3 and recent devel tools the headers ARE
there, but I still can't get it working.

Any ideas, this is quite painful!

Sam

I'm building 1.8 from cvs, heres the problem:

--- mkmf.log --

have_library: checking for tgetnum() in -lncurses... -------------------- yes

"gcc -o conftest -I/Users/sam/p/ruby/ruby/ext/readline -I/usr/local/lib/ruby/1.8/powerpc-darwin6.8 -g -O2 -pipe -fno-common conftest.c -L"/usr/local/lib" -lruby18-static -lncurses -ldl -lobjc "
checked program was:
/* begin */

/*top*/
int main() { return 0; }
int t() { tgetnum(); return 0; }
/* end */

···

--------------------

have_header: checking for readline/readline.h... -------------------- yes

"gcc -E -I/Users/sam/p/ruby/ruby/ext/readline -I/usr/local/lib/ruby/1.8/powerpc-darwin6.8 -g -O2 -pipe -fno-common conftest.c -o conftest.i"
checked program was:
/* begin */
#include <readline/readline.h>
/* end */

--------------------

have_header: checking for readline/history.h... -------------------- yes

"gcc -E -I/Users/sam/p/ruby/ruby/ext/readline -I/usr/local/lib/ruby/1.8/powerpc-darwin6.8 -g -O2 -pipe -fno-common conftest.c -o conftest.i"
checked program was:
/* begin */
#include <readline/history.h>
/* end */

--------------------

have_library: checking for readline() in -lreadline... -------------------- no

"gcc -o conftest -I/Users/sam/p/ruby/ruby/ext/readline -I/usr/local/lib/ruby/1.8/powerpc-darwin6.8 -g -O2 -pipe -fno-common conftest.c -L"/usr/local/lib" -lncurses -lruby18-static -lreadline -lncurses -ldl -lobjc "
ld: can't locate file for: -lreadline
checked program was:
/* begin */

/*top*/
int main() { return 0; }
int t() { readline(); return 0; }
/* end */

"gcc -o conftest -I/Users/sam/p/ruby/ruby/ext/readline -I/usr/local/lib/ruby/1.8/powerpc-darwin6.8 -g -O2 -pipe -fno-common conftest.c -L"/usr/local/lib" -lncurses -lruby18-static -lreadline -lncurses -ldl -lobjc "
conftest.c: In function `t':
conftest.c:5: error: `readline' undeclared (first use in this function)
conftest.c:5: error: (Each undeclared identifier is reported only once
conftest.c:5: error: for each function it appears in.)
checked program was:
/* begin */

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

--------------------

I just re-installed everything on a brand new machine. I forgot about readline at first, but then I simply downloaded the gnu version of readline, compiled and installed it, and rebuilt ruby. No Fink, no Apple libraries. It just worked.

···

On Feb 21, 2005, at 7:50 PM, Sam Roberts wrote:

I just got this working for ruby1.8 on OS X 10.2... then upgraded.

The old hack involved installing the headers for a library that was
actually there, but with 10.3 and recent devel tools the headers ARE
there, but I still can't get it working.

Thanks, I know I can install my own copies of things that the OS already
has, but a ruby build that doesn't manage to use what's already there
isn't "just working", and this is a consistent problem when people try
to package ruby up - there package has links to local libs not in the
package.

Anybody got ruby building against the system's readline?

Cheers,
Sam

Quoting gavin@refinery.com, on Tue, Feb 22, 2005 at 10:54:30PM +0900:

···

On Feb 21, 2005, at 7:50 PM, Sam Roberts wrote:
>I just got this working for ruby1.8 on OS X 10.2... then upgraded.
>
>The old hack involved installing the headers for a library that was
>actually there, but with 10.3 and recent devel tools the headers ARE
>there, but I still can't get it working.

I just re-installed everything on a brand new machine. I forgot about
readline at first, but then I simply downloaded the gnu version of
readline, compiled and installed it, and rebuilt ruby. No Fink, no
Apple libraries. It just worked.

Thanks, I know I can install my own copies of things that the OS
already has, but a ruby build that doesn't manage to use what's
already there isn't "just working", and this is a consistent problem
when people try to package ruby up - there package has links to local
libs not in the package.

Anybody got ruby building against the system's readline?

hmm, can you even build against the system's readline? there's a
readline framework under /System/Library/PrivateFrameworks, but there
doesn't seem to be any files in there. i guess the readline symbols are
squirreled away somewhere else? i did a global find on my machine as
root, and that location was the only readline-related file i noticed.

assuming that we can't build against a readline bundled with the OS,
what is the best way to handle this? it seems a little weird to have a
unix-based OS without a readline you can easily access. i just end up
compiling my own readline and using that when building ruby, but there
should be an easier solution!

doug

···

On Wed, Feb 23, 2005 at 08:09:01AM +0900, Sam Roberts wrote:

Quoting gavin@refinery.com, on Tue, Feb 22, 2005 at 10:54:30PM +0900:
> On Feb 21, 2005, at 7:50 PM, Sam Roberts wrote:
> >I just got this working for ruby1.8 on OS X 10.2... then upgraded.
> >
> >The old hack involved installing the headers for a library that was
> >actually there, but with 10.3 and recent devel tools the headers ARE
> >there, but I still can't get it working.
>
> I just re-installed everything on a brand new machine. I forgot about
> readline at first, but then I simply downloaded the gnu version of
> readline, compiled and installed it, and rebuilt ruby. No Fink, no
> Apple libraries. It just worked.
>
>

--
"Contrary to what most people say, the most dangerous animal in the
world is not the lion or the tiger or even the elephant. It's a shark
riding on an elephant's back, just trampling and eating everything they
see." -- Jack Handey

Quoting doug@beaver.net, on Wed, Feb 23, 2005 at 12:22:56PM +0900:

> Thanks, I know I can install my own copies of things that the OS
> already has, but a ruby build that doesn't manage to use what's
> already there isn't "just working", and this is a consistent problem
> when people try to package ruby up - there package has links to local
> libs not in the package.
>
> Anybody got ruby building against the system's readline?

hmm, can you even build against the system's readline? there's a
readline framework under /System/Library/PrivateFrameworks, but there
doesn't seem to be any files in there. i guess the readline symbols are
squirreled away somewhere else? i did a global find on my machine as
root, and that location was the only readline-related file i noticed.

Did a little more digging, and I now see my error!

I saw a /usr/include/readline/ full of headers, and a
/usr/lib/libreadline.dylib symlinked into private frameworks, and
thought that must mean that readline is there, but it ain't.

assuming that we can't build against a readline bundled with the OS,
what is the best way to handle this? it seems a little weird to have a
unix-based OS without a readline you can easily access. i just end up
compiling my own readline and using that when building ruby, but there
should be an easier solution!

I think the solution is for ruby to come bundled with a readline
implementation. But, I guess I'm back to a local build.

Cheers,
Sam

···

On Wed, Feb 23, 2005 at 08:09:01AM +0900, Sam Roberts wrote: