Opened 18 years ago

Last modified 18 years ago

#1528 new defect

Issue with Mapscript for Ruby install

Reported by: allan@… Owned by: sdlime
Priority: high Milestone:
Component: MapScript-SWIG Version: 4.6
Severity: normal Keywords:
Cc: mike@…

Description

When executing ruby/extconf.rb the generated Makefile is setup incorrectly for
me while running 4.6 and 4.8beta1 on FC3 X86_64. I have attached my extconf.rb
that i  used to get the Makefile working correctly, however, i still had to
manipulate the resulting Makefile as i am unsure how to configure this correctly
in extconf.rb.

I changed line 34 of mapscript/ruby/extconf.rb to read ;

 make_file << "mapscript_wrap.c: ../mapscript.i\n\tswig -ruby -o
mapscript_wrap.c ../mapscript.i"

The bit i am unsure how to configure is i needed to make the references to
ruby.h and defines.h absolute in the Makefile. The references are in the second
to bottom line beginning with $(OPTS). I assume the path should be setup with
the mapscriptvars???

Regards
Allan Blackwell

Change History (8)

comment:1 by sgillies@…, 18 years ago

Component: MapScriptMapScript-SWIG
Status: newassigned

comment:2 by sgillies@…, 18 years ago

Owner: changed from sdlime to sgillies@…
Status: assignednew

comment:3 by sgillies@…, 18 years ago

Status: newassigned
Commited that change to extconf.rb, but I'm not sure how to resolve the problem
with the includes. IMO, mapscript is crying out for a Rakefile.

Can you check out the CVS HEAD and test?

comment:4 by mike@…, 18 years ago

I solved the problem with the includes by commenting out the $topdir = "." line.
 Here's a diff: 
19c19
< $topdir = "."
---
> #$topdir = "."

I also had to remove the Fedora Core 3 ruby package and then download and build
the ruby source for myself.

It seems the ruby 'mkmf' module from the FC3 install was outputting the
incorrect location of the ruby includes directory.  Once I built ruby from
source I had no problems.  Hope this helps.

comment:5 by mike@…, 18 years ago

Cc: mike@… added

comment:6 by sgillies@…, 18 years ago

Ruby mapscript really needs a go-to person ... either of you interested? I don't
use Ruby mapscript at all, and am not familiar enough with the language to know
how to write a setup script that works well for Linux and Windows. I suggested a
Rakefile before, only because everything I know about Ruby comes from Rails :)

comment:7 by takubo@…, 18 years ago

When I tryed to build Ruby Mapscript, I had same trouble with this bug.
As Michael Gaffney said, it needn't to be overwrite $topdir and $hdrdir
in the extconf.rb. If these variable are not set in extconf.rb, 
mkmf searchs automatically from Ruby's installtion information, I think.

At least, I could build Ruby Mapscript with commenting out these two variable in
extconf.rb on my Debian environment.

Ruby reference manual[1] said as below,

$hdrdir
 The directory where ruby.h is installed. 
 Generally it is /usr/local/lib/ruby/<version>/<arch> .

$topdir
 The directory where headers and libraries to make ruby extension are installed.
 Generally it is /usr/local/lib/ruby/<version>/<arch> .

[1]http://www.ruby-lang.org/ja/man/?cmd=view;name=mkmf
(only japanese, so I couldn't find English ver)

comment:8 by sgillies@…, 18 years ago

Owner: changed from sgillies@… to sdlime
Status: assignednew
reassigning.
Note: See TracTickets for help on using tickets.