早坂@北陸先端です. こんばんは.

In message <200210231851.g9NIpTf13064 / sharui.nakada.kanuma.tochigi.jp>,
nobu.nakada / nifty.ne.jp wrote:

> > $&.chop とかしないと, エスケープのままになっちゃいますね.
> Config::expandのほうで$$を$にしてます。つまり、config.status中
> の$$はConfig::MAKEFILE_CONFIGでも$$のまま、Config::CONFIGや
> mkmf.rbで作られたMakefileでの展開結果は$、というつもりです。

make すると

...
compiling curses
/home/ryoh/work/ruby/lib/mkmf.rb:223:in `%': malformed format string - %$ (ArgumentError)
        from /home/ryoh/work/ruby/lib/mkmf.rb:223:in `libpathflag'
        from /home/ryoh/work/ruby/lib/mkmf.rb:223:in `map'
        from /home/ryoh/work/ruby/lib/mkmf.rb:223:in `libpathflag'
        from /home/ryoh/work/ruby/lib/mkmf.rb:207:in `link_command'
        from /home/ryoh/work/ruby/lib/mkmf.rb:227:in `try_link0'
        from /home/ryoh/work/ruby/lib/mkmf.rb:231:in `try_link'
        from /home/ryoh/work/ruby/lib/mkmf.rb:259:in `try_func'
        from /home/ryoh/work/ruby/lib/mkmf.rb:377:in `have_library'
        from /home/ryoh/work/ruby/lib/mkmf.rb:374:in `checking_for'
        from /home/ryoh/work/ruby/lib/mkmf.rb:373:in `have_library'
        from /home/ryoh/work/ruby/ext/curses/extconf.rb:9
        from ./ext/extmk.rb:61:in `load'
        from ./ext/extmk.rb:61:in `extmake'
        from ./ext/extmk.rb:175
        from ./ext/extmk.rb:172:in `glob'
        from ./ext/extmk.rb:172
gmake: *** [all] Error 1

と言われてしまうんです.

きちんと追っていませんが, 以下のようにするとちゃんと動くみたいです.

Index: lib/mkmf.rb
===================================================================
RCS file: /src/ruby/lib/mkmf.rb,v
retrieving revision 1.110
diff -d -p -u -r1.110 mkmf.rb
--- lib/mkmf.rb 23 Oct 2002 18:52:29 -0000      1.110
+++ lib/mkmf.rb 24 Oct 2002 09:47:43 -0000
@@ -821,7 +821,7 @@ $configure_args["--topdir"] ||= $curdir
 $ruby = arg_config("--ruby", CONFIG["ruby_install_name"])
 
 def config_string(key)
-  return unless s = CONFIG[key] and !s.empty?
+  return unless s = Config::CONFIG[key] and !s.empty?
   return s unless block_given?
   yield s
 end

--
Ryo HAYASAKA (早坂 良)  <ryoh / jaist.ac.jp>
http://www.jaist.ac.jp/%7Eryoh/
Japan Advanced Institute of Science and Technology (JAIST)