Hello, nobu.nokada / softhome.net wrote: > You'd better initialize those globals in init_mkmf, or you may > have problems when you put extension libraries use them under > ext/. Thank you for your comments. Here's the new version. Index: lib/mkmf.rb =================================================================== RCS file: /src/ruby/lib/mkmf.rb,v retrieving revision 1.123 diff -u -p -r1.123 mkmf.rb --- lib/mkmf.rb 31 Dec 2002 12:31:12 -0000 1.123 +++ lib/mkmf.rb 16 Jan 2003 12:01:30 -0000 @@ -637,8 +637,6 @@ def create_makefile(target, srcprefix = target = nil if $objs == "" - cleanfiles = [] - distcleanfiles = [] if target and EXPORT_PREFIX origdef = target + '.def' deffile = EXPORT_PREFIX + origdef @@ -663,7 +661,7 @@ def create_makefile(target, srcprefix = end end end - distcleanfiles << deffile unless deffile == origdef + $distcleanfiles << deffile unless deffile == origdef end libpath = libpathflag(libpath) @@ -675,8 +673,8 @@ def create_makefile(target, srcprefix = LIBPATH = #{libpath} DEFFILE = #{deffile} -CLEANFILES = #{cleanfiles.join(' ')} -DISTCLEANFILES = #{distcleanfiles.join(' ')} +CLEANFILES = #{$cleanfiles.join(' ')} +DISTCLEANFILES = #{$distcleanfiles.join(' ')} target_prefix = #{target_prefix} LOCAL_LIBS = #{$LOCAL_LIBS} @@ -807,11 +805,15 @@ def init_mkmf(config = CONFIG) end $LOCAL_LIBS = "" - dir_config("opt") + + $cleanfiles = [] + $distcleanfiles = [] + + dir_config("opt") # Twice??? Here. end init_mkmf -dir_config("opt") +dir_config("opt") # And here? $make = with_config("make-prog", ENV["MAKE"] || "make") $nmake = nil Is this one better? My question is: Why dir_config is called twice? Once in init_mkmf and once just after init_mkmf... Michal