summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-08-30 14:21:18 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-08-30 14:21:18 +0000
commit624842f6a080d3292f66809936c8344b79c50be2 (patch)
treeb13242650727a3550a76bc85ed7939ea7bde08a4 /lib
parentaae7040cd0c8cdfd0b12b5d0b7a2fc402fc3e452 (diff)
* lib/mkmf.rb (xsystem, xpopen): no longer expand by Config.
* lib/mkmf.rb (link_command, cc_command, cpp_command): expand variables at once, and quote hdrdir. fixed: [ruby-core:05680] * lib/mkmf.rb (libpathflag): quote paths. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/mkmf.rb36
1 files changed, 18 insertions, 18 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 097be403e1..309ab47b4c 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -215,7 +215,6 @@ module Logging
end
def xsystem command
- Config.expand(command)
Logging::open do
puts command.quote
system(command)
@@ -223,7 +222,6 @@ def xsystem command
end
def xpopen command, *mode, &block
- Config.expand(command)
Logging::open do
case mode[0]
when nil, /^r/
@@ -262,31 +260,33 @@ end
def link_command(ldflags, opt="", libpath=$LIBPATH)
Config::expand(TRY_LINK.dup,
- 'hdrdir' => $hdrdir,
- 'src' => CONFTEST_C,
- 'INCFLAGS' => $INCFLAGS,
- 'CPPFLAGS' => $CPPFLAGS,
- 'CFLAGS' => "#$CFLAGS",
- 'ARCH_FLAG' => "#$ARCH_FLAG",
- 'LDFLAGS' => "#$LDFLAGS #{ldflags}",
- 'LIBPATH' => libpathflag(libpath),
- 'LOCAL_LIBS' => "#$LOCAL_LIBS #$libs",
- 'LIBS' => "#$LIBRUBYARG_STATIC #{opt} #$LIBS")
+ CONFIG.merge('hdrdir' => $hdrdir.quote,
+ 'src' => CONFTEST_C,
+ 'INCFLAGS' => $INCFLAGS,
+ 'CPPFLAGS' => $CPPFLAGS,
+ 'CFLAGS' => "#$CFLAGS",
+ 'ARCH_FLAG' => "#$ARCH_FLAG",
+ 'LDFLAGS' => "#$LDFLAGS #{ldflags}",
+ 'LIBPATH' => libpathflag(libpath),
+ 'LOCAL_LIBS' => "#$LOCAL_LIBS #$libs",
+ 'LIBS' => "#$LIBRUBYARG_STATIC #{opt} #$LIBS"))
end
def cc_command(opt="")
- "$(CC) -c #$INCFLAGS -I#{$hdrdir} " \
- "#$CPPFLAGS #$CFLAGS #$ARCH_FLAG #{opt} #{CONFTEST_C}"
+ Config::expand("$(CC) -c #$INCFLAGS -I$(hdrdir) " \
+ "#$CPPFLAGS #$CFLAGS #$ARCH_FLAG #{opt} #{CONFTEST_C}",
+ CONFIG.merge('hdrdir' => $hdrdir.quote))
end
def cpp_command(outfile, opt="")
- "$(CPP) #$INCFLAGS -I#{$hdrdir} " \
- "#$CPPFLAGS #$CFLAGS #{opt} #{CONFTEST_C} #{outfile}"
+ Config::expand("$(CPP) #$INCFLAGS -I$(hdrdir) " \
+ "#$CPPFLAGS #$CFLAGS #{opt} #{CONFTEST_C} #{outfile}",
+ CONFIG.merge('hdrdir' => $hdrdir.quote))
end
def libpathflag(libpath=$LIBPATH)
libpath.map{|x|
- (x == "$(topdir)" ? LIBPATHFLAG : LIBPATHFLAG+RPATHFLAG) % x
+ (x == "$(topdir)" ? LIBPATHFLAG : LIBPATHFLAG+RPATHFLAG) % x.quote
}.join
end
@@ -849,7 +849,7 @@ SHELL = /bin/sh
#### Start of system configuration section. ####
-srcdir = #{srcdir.gsub(/\$\((srcdir)\)|\$\{(srcdir)\}/) {CONFIG[$1||$2]}}
+srcdir = #{srcdir.gsub(/\$\((srcdir)\)|\$\{(srcdir)\}/) {CONFIG[$1||$2]}.quote}
topdir = #{($extmk ? CONFIG["topdir"] : $topdir).quote}
hdrdir = #{$extmk ? CONFIG["hdrdir"].quote : '$(topdir)'}
VPATH = #{vpath.join(CONFIG['PATH_SEPARATOR'])}