[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

mkmf can't find lib then gives target pattern contains no %

Lucas L.

9/26/2008 12:36:00 AM

Hello,
I am trying to build a STAF extension for ruby (not made by me). It
comes with a very simple extconf.rb file:

require 'mkmf'

dir_config('staf')
have_library('STAF', 'STAFRegister')
create_makefile("STAFHandle")

However, no matter how I specify the directory (I've tried
-with-staf-dir=c:\STAF, -with-staf-lib=c:\STAF\lib, etc) it gives:

checking for STAFRegister() in STAF.lib... no
creating Makefile

I tried to make anyway, but unsuprisingly, it fails. It gives
"Makefile:126: *** target pattern contains no `%'. Stop." The offending
line:
{$(topdir)}.cc{}.obj:
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)

I'm running ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32],
whatever version of mkmf that comes with the windows one-click installer
and GNU make 3.79.1.

Thanks!
--
Posted via http://www.ruby-....

11 Answers

Tim Hunter

9/26/2008 12:55:00 AM

0

Lucas L. wrote:
> Hello,
> I am trying to build a STAF extension for ruby (not made by me). It
> comes with a very simple extconf.rb file:
>
> require 'mkmf'
>
> dir_config('staf')
> have_library('STAF', 'STAFRegister')
> create_makefile("STAFHandle")
>
> However, no matter how I specify the directory (I've tried
> -with-staf-dir=c:\STAF, -with-staf-lib=c:\STAF\lib, etc) it gives:
>
> checking for STAFRegister() in STAF.lib... no
> creating Makefile

Check the mkmf.log file. It should give you some indication as to why it
couldn't checking for STAFRegister in STAF.lib failed.

--
RMagick: http://rmagick.ruby...

Lucas L.

9/26/2008 12:59:00 AM

0

Tim Hunter wrote:
> Check the mkmf.log file. It should give you some indication as to why it
> checking for STAFRegister in STAF.lib failed.

Whoops, I knew I'd forget something.
I did try, but I couldn't make any sense of it. Here it is:

have_library: checking for STAFRegister() in STAF.lib...
-------------------- no

"cl -nologo -Feconftest -I. -Ic:/ruby/lib/ruby/1.8/i386-mswin32 -I.
-Ic:/ruby/lib/ruby/1.8/i386-mswin32 -MD -Zi -O2b2xg- -G6 conftest.c
msvcrt-ruby18-static.lib STAF.lib oldnames.lib user32.lib advapi32.lib
ws2_32.lib -link -libpath:"." -libpath:"c:/ruby/lib"
-stack:0x2000000"
checked program was:
/* begin */
1: #define WIN32_LEAN_AND_MEAN
2: #include <winsock2.h>
3: #include <windows.h>
4:
5: /*top*/
6: int main() { return 0; }
7: int t() { void ((*volatile p)()); p = (void ((*)()))STAFRegister;
return 0; }
/* end */

"cl -nologo -Feconftest -I. -Ic:/ruby/lib/ruby/1.8/i386-mswin32 -I.
-Ic:/ruby/lib/ruby/1.8/i386-mswin32 -MD -Zi -O2b2xg- -G6 conftest.c
msvcrt-ruby18-static.lib STAF.lib oldnames.lib user32.lib advapi32.lib
ws2_32.lib -link -libpath:"." -libpath:"c:/ruby/lib"
-stack:0x2000000"
checked program was:
/* begin */
1: /*top*/
2: int main() { return 0; }
3: int t() { STAFRegister(); return 0; }
/* end */

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

That doesn't really tell me anything except it couldn't find
STAFRegister. Not quite sure what those programs are.
--
Posted via http://www.ruby-....

Tim Hunter

9/26/2008 1:00:00 AM

0

Tim Hunter wrote:
>
> Check the mkmf.log file. It should give you some indication as to why it
> couldn't checking for STAFRegister in STAF.lib failed.
>

Er, I mean "as to why checking for STAFRegister in STAF.lib failed."

--
RMagick: http://rmagick.ruby...

Lucas L.

9/26/2008 1:05:00 AM

0

Tim Hunter wrote:
> Tim Hunter wrote:
>>
>> Check the mkmf.log file. It should give you some indication as to why it
>> couldn't checking for STAFRegister in STAF.lib failed.
>>
>
> Er, I mean "as to why checking for STAFRegister in STAF.lib failed."

I posted it above, but I don't get it. I have no idea why there seems to
be two C files there. Are they what mkmf compiled to check for
STAFRegister??
--
Posted via http://www.ruby-....

Tim Hunter

9/26/2008 1:14:00 AM

0

Lucas L. wrote:
> Tim Hunter wrote:
>> Tim Hunter wrote:
>>> Check the mkmf.log file. It should give you some indication as to why it
>>> couldn't checking for STAFRegister in STAF.lib failed.
>>>
>> Er, I mean "as to why checking for STAFRegister in STAF.lib failed."
>
> I posted it above, but I don't get it. I have no idea why there seems to
> be two C files there. Are they what mkmf compiled to check for
> STAFRegister??

Yes. This is how mkmf "checks" for things, by compiling and/or linking
very small programs and checking the return code from the compiler or
linker. You have to have some familiarity with the compiler and linker
to be able to understand what's going on and to interpret the results.

Regrettably I don't know anything about the Windows compiler and linker.
Your best bet is to contact whoever is responsible for this extension.

--
RMagick: http://rmagick.ruby...

Nobuyoshi Nakada

9/26/2008 4:35:00 PM

0

Hi,

At Fri, 26 Sep 2008 09:36:27 +0900,
Lucas L. wrote in [ruby-talk:316037]:
> However, no matter how I specify the directory (I've tried
> -with-staf-dir=c:\STAF, -with-staf-lib=c:\STAF\lib, etc) it gives:

--with-staf-dir=...

> {$(topdir)}.cc{}.obj:
> $(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)

This is a makefile for nmake.

> I'm running ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32],
> whatever version of mkmf that comes with the windows one-click installer
> and GNU make 3.79.1.

The one-click installer is compiled with VC6. You have to
compile ruby with gcc and GNU make by yourself. Once you could
compile the extension, the resulted binary is compatible with
the one-click installer.

--
Nobu Nakada

Lucas L.

9/29/2008 12:50:00 AM

0

Nobuyoshi Nakada wrote:
> --with-staf-dir=...
Whoops. I actually meant --, not -. Still doesn't work.

> This is a makefile for nmake.
>
> The one-click installer is compiled with VC6. You have to
> compile ruby with gcc and GNU make by yourself. Once you could
> compile the extension, the resulted binary is compatible with
> the one-click installer.

Surely I can just use nmake? (I have VC2005).
--
Posted via http://www.ruby-....

Lucas L.

9/29/2008 12:52:00 AM

0

Lucas L. wrote:
> Nobuyoshi Nakada wrote:
>> --with-staf-dir=...
> Whoops. I actually meant --, not -. Still doesn't work.
>
>> This is a makefile for nmake.
>>
>> The one-click installer is compiled with VC6. You have to
>> compile ruby with gcc and GNU make by yourself. Once you could
>> compile the extension, the resulted binary is compatible with
>> the one-click installer.
>
> Surely I can just use nmake? (I have VC2005).
(No edit on mailing list, sorry for double post)
Actually, both problems may be caused by VC2005. I haven't used it for a
while and cl throws all these errors, which would make mkmf fail too.
I'll try re-installing it.
--
Posted via http://www.ruby-....

Nobuyoshi Nakada

9/29/2008 3:37:00 AM

0

Hi,

At Mon, 29 Sep 2008 09:50:27 +0900,
Lucas L. wrote in [ruby-talk:316284]:
> > The one-click installer is compiled with VC6. You have to
> > compile ruby with gcc and GNU make by yourself. Once you could
> > compile the extension, the resulted binary is compatible with
> > the one-click installer.
>
> Surely I can just use nmake? (I have VC2005).

Since VC2005 is binary incompatible with VC6, so it's absolutely
impossible.

--
Nobu Nakada

Lucas L.

10/3/2008 5:15:00 AM

0

Nobuyoshi Nakada wrote:
> Hi,
>
> At Mon, 29 Sep 2008 09:50:27 +0900,
> Lucas L. wrote in [ruby-talk:316284]:
>> > The one-click installer is compiled with VC6. You have to
>> > compile ruby with gcc and GNU make by yourself. Once you could
>> > compile the extension, the resulted binary is compatible with
>> > the one-click installer.
>>
>> Surely I can just use nmake? (I have VC2005).
>
> Since VC2005 is binary incompatible with VC6, so it's absolutely
> impossible.

Not according to a blog post I read the other day. It said you can fake
it by changing the manifest and commenting out the line that checks or
something.
Anyway, not wanting to play with Ruby, I managed to get VC6 and it
compiled, but I got segfaults when using the class. Not much I can do
about that...

Thanks anyway!
--
Posted via http://www.ruby-....