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