Strscan, mkmf and MacOS X

Hi
I have been debugging a problem trying to install strscan on MacOS
10.2 which is failing with the msg “can’t find header files for ruby”.

In the course of tracing through the problem I have become completely
mystified by the mkmf.rb file. When it calls Config, that loads up the
CONFIG hash with reasonable keys such as “archdir” of which the values
are [what looks like] shell vars (i.e. “$(libdir)/$(arch)”
(It looks like it is writing a shell script)

The problem appears to be that the values for vars (such as archdir)
contain these unresolved variables ("$(arch)" for example) as opposed
to the path which has been assigned to $arch.

So I have two questions:
1 - Does anyone know what to do to get strscan built on MacOS 10.2?

2- Is there a good explanation for how mkmf works? (i.e. the above)

Thanks In Advance
—Raymond

So I have two questions:
1 - Does anyone know what to do to get strscan built on MacOS 10.2?

I took the cowards way out: “fink install ruby.” If you haven’t used
fink, you’re in for a treat. Fink is at
Fink - Home Look for the Jag install
directions. One great thing is you can totally disable it by simply
commenting out a line in your .tcshrc.

I still had one problem. Somehow the Makefile gets a “-L. -ruby”
appended to the gcc call. I just edited it out, reran make, and then
went back to the strscan directory and did the “sudo ruby install.rb
install”

2- Is there a good explanation for how mkmf works? (i.e. the above)

It’s weird an wonderful when it works. The only way I found to get a
handle on it was to step through it with the Pickaxe book in front of
me. Of course it has to be working first. Hence fink.

···

On Tuesday, October 29, 2002, at 12:21 PM, Raymond Blum wrote:


There are two kinds of fool. One says, “This is old, and therefore
good.”
And one says, “This is new, and therefore better.”
-John Brunner, science fiction writer (1934-1995)

Hi,

I have been debugging a problem trying to install strscan on MacOS
10.2 which is failing with the msg “can’t find header files for
ruby”.

It means you have not installed ruby development package (I
don’t know what it is called in MacOS X).

In the course of tracing through the problem I have become completely
mystified by the mkmf.rb file. When it calls Config, that loads up
the CONFIG hash with reasonable keys such as “archdir” of which the
values are [what looks like] shell vars (i.e. “$(libdir)/$(arch)”
(It looks like it is writing a shell script)

It comes from Makefile macro rather than shell. $() is command
substitution in POSIX shells.

The problem appears to be that the values for vars (such as archdir)
contain these unresolved variables (“$(arch)” for example) as opposed
to the path which has been assigned to $arch.

$(arch) will be expanded to CONFIG[“arch”] recursively. You
can examine how CONFIG[“archdir”] will be expanded to:

$ ruby -rmkmf -e ‘p Config::CONFIG[“archdir”]’

2- Is there a good explanation for how mkmf works? (i.e. the above)

AFAIK, just an explanation to use mkmf in README.EXT.

···

At Wed, 30 Oct 2002 04:21:08 +0900, Raymond Blum wrote:


Nobu Nakada

Thanks, I’ll use fink. I tried installing the ruby 1.6.7 package but
the installer figured that it was already installed and did nothing.

—Raymond

···

On Tuesday, October 29, 2002, at 09:40 PM, Chris Gehlker wrote:

On Tuesday, October 29, 2002, at 12:21 PM, Raymond Blum wrote:

So I have two questions:
1 - Does anyone know what to do to get strscan built on MacOS 10.2?

I took the cowards way out: “fink install ruby.” If you haven’t used
fink, you’re in for a treat. Fink is at
Fink - Home Look for the Jag install
directions. One great thing is you can totally disable it by simply
commenting out a line in your .tcshrc.

I still had one problem. Somehow the Makefile gets a “-L. -ruby”
appended to the gcc call. I just edited it out, reran make, and then
went back to the strscan directory and did the “sudo ruby install.rb
install”

2- Is there a good explanation for how mkmf works? (i.e. the above)

It’s weird an wonderful when it works. The only way I found to get a
handle on it was to step through it with the Pickaxe book in front of
me. Of course it has to be working first. Hence fink.


There are two kinds of fool. One says, “This is old, and therefore
good.”
And one says, “This is new, and therefore better.”
-John Brunner, science fiction writer (1934-1995)