diff --git a/lib/mkmf.rb b/lib/mkmf.rb index c2b6c90..20f179b 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -468,7 +468,7 @@ MSG end end - def link_command(ldflags, opt="", libpath=$LIBPATH|$DEFLIBPATH) + def link_command(ldflags, opt="", libpath=[$libdir]|$LIBPATH|$DEFLIBPATH) librubyarg = $extmk ? $LIBRUBYARG_STATIC : "$(LIBRUBYARG)" conf = RbConfig::CONFIG.merge('hdrdir' => $hdrdir.quote, 'src' => "#{CONFTEST_C}", @@ -504,7 +504,7 @@ MSG conf) end - def libpathflag(libpath=$LIBPATH|$DEFLIBPATH) + def libpathflag(libpath=[$libdir]|$LIBPATH|$DEFLIBPATH) libpath.map{|x| case x when "$(topdir)", /\A\./ @@ -2180,7 +2180,7 @@ RULES # def create_makefile(target, srcprefix = nil) $target = target - libpath = $LIBPATH|$DEFLIBPATH + libpath = [$libdir]|$LIBPATH|$DEFLIBPATH message "creating Makefile\n" MakeMakefile.rm_f "#{CONFTEST}*" if CONFIG["DLEXT"] == $OBJEXT @@ -2261,7 +2261,7 @@ RULES conf = yield(conf) if block_given? mfile.puts(conf) mfile.print " -libpath = #{($LIBPATH|$DEFLIBPATH).join(" ")} +libpath = #{([$libdir]|$LIBPATH|$DEFLIBPATH).join(" ")} LIBPATH = #{libpath} DEFFILE = #{deffile}