Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > ruby and LDFLAGS

Reply
Thread Tools

ruby and LDFLAGS

 
 
Michal 'hramrach' Suchanek
Guest
Posts: n/a
 
      10-29-2004
Hello

Does anybody know why ruby does not support LDFLAGS?
I am again installing in an environment where libraries are mostly in a
non-standard location - BSD.
I found I can pass arguments to configure, one for each extension that
requires a library from /usr/pkg/lib. But that means I have to name all
the extensions and if one is later added I have to find the argument
name for it.

I think that LDFLAGS are much easier to use in this situation. Also
later extensions that are built separately from ruby can use the preset
LDFLAGS automatically, without the need the specify special extconf
flags again.

--- ruby-1.8.2.org/lib/mkmf.rb 2004-07-13 14:41:15.000000000 +0200
+++ ruby-1.8.2/lib/mkmf.rb 2004-10-29 23:40:28.000000000 +0200
@@ -960,7 +960,7 @@
$CFLAGS = with_config("cflags", arg_config("CFLAGS", config["CFLAGS"])).dup
$ARCH_FLAG = with_config("arch_flag", arg_config("ARCH_FLAG", config["ARCH_FLAG"])).dup
$CPPFLAGS = with_config("cppflags", arg_config("CPPFLAGS", config["CPPFLAGS"])).dup
- $LDFLAGS = (with_config("ldflags") || "").dup
+ $LDFLAGS = with_config("ldflags", arg_config("LDFLAGS", config["LDFLAGS"])).dup
$INCFLAGS = "-I$(topdir)"
$DLDFLAGS = with_config("dldflags", arg_config("DLDFLAGS", config["DLDFLAGS"])).dup
$LIBEXT = config['LIBEXT'].dup
@@ -1033,7 +1033,7 @@
if CONFIG["DLEXT"] == $OBJEXT
"ld $(DLDFLAGS) -r -o $(DLLIB) $(OBJS)\n"
else
- "$(LDSHARED) $(DLDFLAGS) $(LIBPATH) #{OUTFLAG}$(DLLIB) " \
+ "$(LDSHARED) $(LIBPATH) $(DLDFLAGS) #{OUTFLAG}$(DLLIB) " \
"$(OBJS) $(LOCAL_LIBS) $(LIBS)"
end
LIBPATHFLAG = config_string('LIBPATHFLAG') || ' -L"%s"'

Thanks

Michal Suchanek


 
Reply With Quote
 
 
 
 
Nobuyoshi Nakada
Guest
Posts: n/a
 
      10-31-2004
Hi,

At Sat, 30 Oct 2004 07:34:27 +0900,
Michal 'hramrach' Suchanek wrote in [ruby-talk:118328]:
> Does anybody know why ruby does not support LDFLAGS?
> I am again installing in an environment where libraries are mostly in a
> non-standard location - BSD.
> I found I can pass arguments to configure, one for each extension that
> requires a library from /usr/pkg/lib. But that means I have to name all
> the extensions and if one is later added I have to find the argument
> name for it.


Use DLDFLAGS for extensions instead of LDFLAGS. The latter is
for executable files, and some platforms require different
flags to link shared objects.

--
Nobu Nakada


 
Reply With Quote
 
 
 
 
Michal 'hramrach' Suchanek
Guest
Posts: n/a
 
      11-01-2004
On Mon, Nov 01, 2004 at 02:24:30AM +0900, Nobuyoshi Nakada wrote:
> Hi,
>
> At Sat, 30 Oct 2004 07:34:27 +0900,
> Michal 'hramrach' Suchanek wrote in [ruby-talk:118328]:
> > Does anybody know why ruby does not support LDFLAGS?
> > I am again installing in an environment where libraries are mostly in a
> > non-standard location - BSD.
> > I found I can pass arguments to configure, one for each extension that
> > requires a library from /usr/pkg/lib. But that means I have to name all
> > the extensions and if one is later added I have to find the argument
> > name for it.

>
> Use DLDFLAGS for extensions instead of LDFLAGS. The latter is
> for executable files, and some platforms require different
> flags to link shared objects.


And what flags do I use to propagate my favourite library paths into
mkmf link tests?

You know, there is no point having the library path added to the final
link if that never happens because extconf does not find the library in
the first place.

Thanks

Michal Suchanek


 
Reply With Quote
 
nobu.nokada@softhome.net
Guest
Posts: n/a
 
      11-10-2004
Hi,

At Mon, 1 Nov 2004 19:12:33 +0900,
Michal 'hramrach' Suchanek wrote in [ruby-talk:118550]:
> > > Does anybody know why ruby does not support LDFLAGS?
> > > I am again installing in an environment where libraries are mostly in a
> > > non-standard location - BSD.
> > > I found I can pass arguments to configure, one for each extension that
> > > requires a library from /usr/pkg/lib. But that means I have to name all
> > > the extensions and if one is later added I have to find the argument
> > > name for it.

> >
> > Use DLDFLAGS for extensions instead of LDFLAGS. The latter is
> > for executable files, and some platforms require different
> > flags to link shared objects.

>
> And what flags do I use to propagate my favourite library paths into
> mkmf link tests?


What you want is --with-opt-dir / --with-opt-include /
--with-opt-lib ?

--
Nobu Nakada


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LDFLAGS problem Robin Becker Python 0 02-21-2011 05:56 PM
Ruby extension (C++) on OS X [ruby 1.8.2] and Google-Sketchup [ruby 1.8.5] Nicholas Ruby 3 01-28-2007 01:48 AM
The Ruby Edge - Digg for Ruby and Ruby On Rails roschler Ruby 0 10-15-2006 11:35 PM
#!/usr/bin/ruby , #!/usr/bin/ruby -w , #!/usr/bin/ruby -T?, #!/usr/bin/ruby -T1... anne001 Ruby 1 04-23-2006 03:02 PM
1.8.2preview2 does not use LDFLAGS Michal 'hramrach' Suchanek Ruby 8 09-13-2004 09:48 AM



Advertisments