summaryrefslogtreecommitdiff
path: root/ext/extmk.rb.in
diff options
context:
space:
mode:
Diffstat (limited to 'ext/extmk.rb.in')
-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 1b133b66aa..617753f379 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