From 94d17c1f1fbacf7dffcdbbe508b37c7719ba6778 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 6 Aug 2003 03:11:14 +0000 Subject: * ext/extmk.rb (extmake): pass LIBPATH to make ruby. [ruby-dev:21137] * ext/extmk.rb (extmake): set library name as source file name in Init_ext(). [ruby-dev:21137] * lib/mkmf.rb (Logging::postpone): postpone logging messages after heading message as the result of the block. * lib/mkmf.rb (macro_defined?): append newline to src unless ended with it. * lib/mkmf.rb (have_library): allow nil function name to just append a library. (ruby-bugs:PR#1083) * lib/mkmf.rb (pkg_config): should append additional libraries to $libs but not $LIBS. [ruby-dev:21137] * ext/io/wait/extconf.rb: check DOSISH macro instead of platform. * ext/digest/sha1/extconf.rb: have_library already appends library name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/extmk.rb | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'ext/extmk.rb') diff --git a/ext/extmk.rb b/ext/extmk.rb index 68274efde6..eb2a277600 100644 --- a/ext/extmk.rb +++ b/ext/extmk.rb @@ -101,10 +101,12 @@ def extmake(target) if $static $extflags ||= "" $extlibs ||= "" - $extflags += " " + $DLDFLAGS if $DLDFLAGS - $extflags += " " + $LDFLAGS unless $LDFLAGS == "" - $extlibs += " " + $libs unless $libs == "" - $extlibs += " " + $LOCAL_LIBS unless $LOCAL_LIBS == "" + $extpath ||= [] + $extflags += " " + $DLDFLAGS unless $DLDFLAGS.empty? + $extflags += " " + $LDFLAGS unless $LDFLAGS.empty? + libs = ($libs.split+$LOCAL_LIBS.split).uniq + $extlibs = [$extlibs, *libs].join(" ") unless libs.empty? + $extpath |= $LIBPATH end ensure Dir.chdir dir @@ -212,7 +214,7 @@ File::makedirs('ext') Dir::chdir('ext') ext_prefix = "#{$top_srcdir}/ext" -Dir.glob("#{ext_prefix}/**/MANIFEST") do |d| +Dir.glob("#{ext_prefix}/*/**/MANIFEST") do |d| d = File.dirname(d) d.slice!(0, ext_prefix.length + 1) extmake(d) or exit(1) @@ -229,12 +231,16 @@ if $extlist.size > 0 for s,t,i in $extlist f = format("%s/%s.%s", s, i, $LIBEXT) if File.exist?(f) - $extinit += "\tInit_#{i}();\n\trb_provide(\"#{t}.so\");\n" + $extinit += "\tinit(Init_#{i}, \"#{t}.so\");\n" $extobjs += "ext/#{f} " end end - src = "void Init_ext() {\n#$extinit}\n" + src = < 0 if RUBY_PLATFORM =~ /m68k-human|beos/ $extlibs.gsub!("-L/usr/local/lib", "") if $extlibs end + $extpath.delete("$(topdir)") + $extflags = libpathflag($extpath) << " " << $extflags.strip conf = [ ['SETUP', $setup], ['EXTOBJS', $extobjs], ['EXTLIBS', $extlibs], ['EXTLDFLAGS', $extflags] -- cgit v1.2.1