On Wed, Sep 08, 2004 at 04:29:41AM +0900, Michal 'hramrach' Suchanek wrote:
> Hello
> 
> It looks like a little bug in mkmf.rb
> DLDFLAGS comes out empty in the Makefile
> 
> There is code that is too complex to for writing just an empty string:
> --- ruby-1.8.2/lib/mkmf.rb      Tue Sep  7 17:30:59 2004
> +++ /sw/src/ruby18-1.8.2-0preview2/ruby-1.8.2/lib/mkmf.rb       Tue Sep  7 21:22:21 2004
> @@ -738,9 +738,9 @@
>  LIBRUBYARG_STATIC = #$LIBRUBYARG_STATIC
>  
>  CFLAGS   = #{CONFIG['CCDLFLAGS'] unless $static} #$CFLAGS #$ARCH_FLAG
> -CPPFLAGS = -I. -I$(topdir) -I$(hdrdir) -I$(srcdir) #{$defs.join(" ")} #{$CPPFLAGS}
> +CPPFLAGS = -I. -I$(topdir) -I$(hdrdir) -I$(srcdir) #{$defs.join(" ")} #{CONFIG['CPPFLAGS']}
>  CXXFLAGS = $(CFLAGS) #{CONFIG['CXXFLAGS']}
> -DLDFLAGS = #$LDFLAGS #$DLDFLAGS #$ARCH_FLAG
> +DLDFLAGS = #{CONFIG['LDFLAGS']} #{CONFIG['DLDFLAGS']} #{CONFIG['ARCH_FLAG']}
>  LDSHARED = #{CONFIG['LDSHARED']}
>  AR = #{CONFIG['AR']}
>  EXEEXT = #{CONFIG['EXEEXT']}
> 
> 

A better fix adding LDFLAGS also for mkmf link tests:

--- ruby-1.8.2/lib/mkmf.rb~     Tue Sep  7 17:30:59 2004
+++ ruby-1.8.2/lib/mkmf.rb      Thu Sep  9 11:08:59 2004
@@ -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

Thanks

Michal Suchanek