summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-08-09 04:32:24 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-08-09 04:32:24 +0000
commitc1bbe10599dfcc2dca3823dc0784eb1835c1ed74 (patch)
treecf8d2904f1e9ba1a42b0e68e59571e97c3695f2b /ext
parenta3edeb5fec3dfb064a1745881f5c5ec68e2abc92 (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/extmk.rb.in19
1 files changed, 12 insertions, 7 deletions
diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in
index 1b133b6..617753f 100644
--- a/ext/extmk.rb.in
+++ b/ext/extmk.rb.in
@@ -61,8 +61,8 @@ if RUBY_PLATFORM == "m68k-human"
else
CFLAGS = "@CFLAGS@"
end
-LINK = "@CC@ -o conftest -I#$topdir -I#$top_srcdir #{CFLAGS} -I#$includedir @LDFLAGS@ %s %s conftest.c %s %s @LIBS@"
-CPP = "@CPP@ @CPPFLAGS@ -I#$topdir -I#$top_srcdir #{CFLAGS} -I#$includedir %s %s conftest.c"
+LINK = "@CC@ -o 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"
if FileTest.readable? 'nul'
$null = open('nul', 'w')
@@ -91,7 +91,7 @@ def try_link0(src, opt="")
cfile = open("conftest.c", "w")
cfile.print src
cfile.close
- xsystem(format(LINK, $CFLAGS, $LDFLAGS, opt, $LOCAL_LIBS))
+ xsystem(format(LINK, $CFLAGS, $CPPFLAGS, $LDFLAGS, opt, $LOCAL_LIBS))
end
def try_link(src, opt="")
@@ -107,7 +107,7 @@ def try_cpp(src, opt="")
cfile.print src
cfile.close
begin
- xsystem(format(CPP, $CFLAGS, opt))
+ xsystem(format(CPP, $CFLAGS, $CPPFLAGS, opt))
ensure
rm_f "conftest*"
end
@@ -118,7 +118,7 @@ def egrep_cpp(pat, src, opt="")
cfile.print src
cfile.close
begin
- xsystem(format(CPP+"|egrep #{pat}", $CFLAGS, opt))
+ xsystem(format(CPP+"|egrep #{pat}", $CFLAGS, $CPPFLAGS, opt))
ensure
rm_f "conftest*"
end
@@ -326,7 +326,7 @@ def dir_config(target)
ldir = " -L"+dir if dir
end
- $CFLAGS += idir if idir
+ $CPPFLAGS += idir if idir
$LDFLAGS += ldir if ldir
end
@@ -375,7 +375,7 @@ DESTDIR =
CC = @CC@
CFLAGS = %s #{CFLAGS} #$CFLAGS
-CPPFLAGS = -I$(topdir) -I$(hdrdir) -I@includedir@ %s
+CPPFLAGS = -I$(topdir) -I$(hdrdir) -I@includedir@ %s #$CPPFLAGS
DLDFLAGS = #$DLDFLAGS #$LDFLAGS
LDSHARED = @LDSHARED@ #{defflag}
", if $static then "" else "@CCDLFLAGS@" end, $defs.join(" ")
@@ -465,6 +465,11 @@ EOS
$(CC) -I. -I$(<D) $(CFLAGS) $(CPPFLAGS) -c $(<:/=\\)
"
+ else
+ mfile.puts "
+.c.@OBJEXT@:
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $<
+"
end
if $static