summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--Makefile.in2
-rw-r--r--ext/extmk.rb.in7
-rw-r--r--io.c4
-rw-r--r--lib/mkmf.rb6
5 files changed, 18 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 601ff6e56f..958bca6974 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Tue Apr 2 15:17:54 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * Makefile.in (CPPFLAGS): remove @includedir@.
+
+ * lib/mkmf.rb (create_makefile): ditto.
+
+ * ext/extmk.rb.in (create_makefile): ditto.
+
Tue Apr 2 15:09:05 2002 WATANABE Hirofumi <eban@ruby-lang.org>
* ext/socket/socket.c (sock_addrinfo): should clear addrinfo hints.
diff --git a/Makefile.in b/Makefile.in
index 5fad5c3a47..4663a65b2a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -13,7 +13,7 @@ AUTOCONF = autoconf
prefix = @prefix@
CFLAGS = @CFLAGS@
-CPPFLAGS = -I. -I$(srcdir) -I@includedir@
+CPPFLAGS = -I. -I$(srcdir)
LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@
XLDFLAGS = @XLDFLAGS@
EXTLIBS =
diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in
index f191af7678..3588385877 100644
--- a/ext/extmk.rb.in
+++ b/ext/extmk.rb.in
@@ -25,7 +25,6 @@ end
SRC_EXT = ["c", "cc", "m", "cxx", "cpp", "C"]
$extlist = []
-$includedir = "@includedir@"
$libdir = "@libdir@"
$top_srcdir = "@top_srcdir@"
@@ -76,8 +75,8 @@ if /mswin32/ =~ RUBY_PLATFORM
else
OUTFLAG = '-o '
end
-LINK = "@CC@ #{OUTFLAG}conftest -I#$topdir -I#$top_srcdir #{CFLAGS} -I#$includedir @LDFLAGS@ %s %s %s conftest.c %s %s @LIBS@"
-CPP = "@CPP@ @CPPFLAGS@ -I#$topdir -I#$top_srcdir #{CFLAGS} -I#$includedir %s %s %s conftest.c"
+LINK = "@CC@ #{OUTFLAG}conftest -I#$topdir -I#$top_srcdir #{CFLAGS} @LDFLAGS@ %s %s %s conftest.c %s %s @LIBS@"
+CPP = "@CPP@ @CPPFLAGS@ -I#$topdir -I#$top_srcdir #{CFLAGS} %s %s %s conftest.c"
$log = open('extmk.log', 'w')
@@ -415,7 +414,7 @@ hdrdir = #{$top_srcdir}
CC = @CC@
CFLAGS = %s #{CFLAGS} #$CFLAGS
-CPPFLAGS = -I$(topdir) -I$(hdrdir) -I@includedir@ %s #$CPPFLAGS
+CPPFLAGS = -I$(topdir) -I$(hdrdir) %s #$CPPFLAGS
DLDFLAGS = #$DLDFLAGS #$LDFLAGS
LDSHARED = @LDSHARED@ #{defflag}
", if $static then "" else "@CCDLFLAGS@" end, $defs.join(" ")
diff --git a/io.c b/io.c
index 6520ce4925..8057542f92 100644
--- a/io.c
+++ b/io.c
@@ -1195,7 +1195,9 @@ rb_io_fptr_cleanup(fptr, fin)
int fin;
{
if (fptr->mode & FMODE_FDOPEN) {
- io_fflush(GetWriteFile(fptr), fptr);
+ if (fptr->mode & FMODE_WRITABLE) {
+ io_fflush(GetWriteFile(fptr), fptr);
+ }
return;
}
if (fptr->finalize) {
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 9f4066edea..a1706e0dbf 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -81,8 +81,8 @@ if /mswin32/ =~ RUBY_PLATFORM
else
OUTFLAG = '-o '
end
-LINK = "#{CONFIG['CC']} #{OUTFLAG}conftest -I#{$hdrdir} #{CFLAGS} -I#{CONFIG['includedir']} %s %s #{CONFIG['LDFLAGS']} %s conftest.c %s %s #{CONFIG['LIBS']}"
-CPP = "#{CONFIG['CPP']} -E %s -I#{$hdrdir} #{CFLAGS} -I#{CONFIG['includedir']} %s %s conftest.c"
+LINK = "#{CONFIG['CC']} #{OUTFLAG}conftest -I#{$hdrdir} #{CFLAGS} %s %s #{CONFIG['LDFLAGS']} %s conftest.c %s %s #{CONFIG['LIBS']}"
+CPP = "#{CONFIG['CPP']} -E %s -I#{$hdrdir} #{CFLAGS} %s %s conftest.c"
def rm_f(*files)
targets = []
@@ -485,7 +485,7 @@ VPATH = $(srcdir)
CC = #{CONFIG["CC"]}
CFLAGS = #{CONFIG["CCDLFLAGS"]} #{CFLAGS} #{$CFLAGS}
-CPPFLAGS = -I. -I$(hdrdir) -I$(srcdir) -I#{CONFIG["includedir"]} #{$defs.join(" ")} #{CONFIG["CPPFLAGS"]} #{$CPPFLAGS}
+CPPFLAGS = -I. -I$(hdrdir) -I$(srcdir) #{$defs.join(" ")} #{CONFIG["CPPFLAGS"]} #{$CPPFLAGS}
CXXFLAGS = $(CFLAGS)
DLDFLAGS = #{$DLDFLAGS} #{$LDFLAGS}
LDSHARED = #{CONFIG["LDSHARED"]} #{defflag}