Issue #8074 has been reported by nobu (Nobuyoshi Nakada).

----------------------------------------
Bug #8074: Call init_mkmf for main
https://bugs.ruby-lang.org/issues/8074

Author: nobu (Nobuyoshi Nakada)
Status: Assigned
Priority: Normal
Assignee: nobu (Nobuyoshi Nakada)
Category: ext
Target version: current: 2.1.0
ruby -v: 2.0.0


=begin
((<URL:https://github.com/ruby/ruby/pull/257>))

When (({MakeMakefile})) is extended on itself there is a call to (({init_mkmf})).
This method mainly setups various global variables, but it also sets ((|@libdir_basename|)) to default value ((%"lib"%)).

When (({MakeMakefile})) is included in main object there is no call to (({init_mkmf})).
That's why ((|@libdir_basename|)) is not set for main object.

Therefore when we invoke mkmf methods on main object ((|@libdir_basename|)) is nil.
That leads to incorrect lib path when ((%--with-XXX-dir%)) is used.
=end



-- 
http://bugs.ruby-lang.org/