diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-08-30 14:21:18 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-08-30 14:21:18 +0000 |
commit | 3357cdb543c928929e74326c519533999b2accf8 (patch) | |
tree | b13242650727a3550a76bc85ed7939ea7bde08a4 /lib | |
parent | 4110fb95fe06fb2af6c149f35372091cd5b1b1d2 (diff) | |
download | ruby-3357cdb543c928929e74326c519533999b2accf8.tar.gz ruby-3357cdb543c928929e74326c519533999b2accf8.tar.xz ruby-3357cdb543c928929e74326c519533999b2accf8.zip |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@9051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mkmf.rb | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 097be403e..309ab47b4 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'])} |