[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

ruby and LDFLAGS

Michal Suchanek

10/29/2004 10:34:00 PM

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


3 Answers

nobu.nokada

10/31/2004 5:25:00 PM

0

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


Michal Suchanek

11/1/2004 10:13:00 AM

0

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


nobu.nokada

11/10/2004 5:00:00 AM

0

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