diff --git a/ChangeLog b/ChangeLog index fe2def7b43..b631743731 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Wed Jan 2 23:34:25 2002 WATANABE Hirofumi + + * lib/mkmf.rb (create_makefile): add -I. to CPPFLAGS. + + * lib/mkmf.rb (create_makefile): srcdir support(.def and depend file). + Tue Jan 1 02:16:48 2002 WATANABE Hirofumi * ext/curses/extconf.rb: add dir_config. diff --git a/lib/mkmf.rb b/lib/mkmf.rb index be37e1bfe8..f6ebe27f4f 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -399,12 +399,17 @@ def create_makefile(target, srcdir = File.dirname($0)) defflag = '' if RUBY_PLATFORM =~ /cygwin|mingw/ - if not File.exist? target + '.def' - open(target + '.def', 'wb') do |f| - f.print "EXPORTS\n", "Init_", target, "\n" + deffile = target + '.def' + if not File.exist? deffile + if File.exist? File.join srcdir, deffile + deffile = File.join srcdir, deffile + else + open(deffile, 'wb') do |f| + f.print "EXPORTS\n", "Init_", target, "\n" + end end end - defflag = "--def=" + target + ".def" + defflag = "--def=" + deffile end if RUBY_PLATFORM =~ /mswin32/ @@ -446,7 +451,7 @@ VPATH = $(srcdir) CC = #{CONFIG["CC"]} CFLAGS = #{CONFIG["CCDLFLAGS"]} #{CFLAGS} #{$CFLAGS} -CPPFLAGS = -I$(hdrdir) -I$(srcdir) -I#{CONFIG["includedir"]} #{$defs.join(" ")} #{CONFIG["CPPFLAGS"]} #{$CPPFLAGS} +CPPFLAGS = -I. -I$(hdrdir) -I$(srcdir) -I#{CONFIG["includedir"]} #{$defs.join(" ")} #{CONFIG["CPPFLAGS"]} #{$CPPFLAGS} CXXFLAGS = $(CFLAGS) DLDFLAGS = #{$DLDFLAGS} #{$LDFLAGS} LDSHARED = #{CONFIG["LDSHARED"]} #{defflag} @@ -583,8 +588,9 @@ EOMF end end - if File.exist?("depend") - dfile = open("depend", "r") + depend = File.join(srcdir, "depend") + if File.exist?(depend) + dfile = open(depend, "r") mfile.printf "###\n" while line = dfile.gets() mfile.printf "%s", line.gsub(/\.o\b/, ".#{$OBJEXT}")