diff options
author | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-01-02 14:42:01 +0000 |
---|---|---|
committer | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-01-02 14:42:01 +0000 |
commit | bc434d7dcebdf05cdbee5f12050650d3885996a9 (patch) | |
tree | 14bf273313c64901fe3557802e34892ad912f5a7 /lib | |
parent | 882c050be42f528d17cb018232364c2c6c537d70 (diff) |
* lib/mkmf.rb (create_makefile): add -I. to CPPFLAGS.
* lib/mkmf.rb (create_makefile): srcdir support(.def and depend file).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mkmf.rb | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 502a9ab38e..e6aa866450 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -395,12 +395,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/ @@ -442,7 +447,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} @@ -579,8 +584,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}") |