summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-08-16 14:58:34 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-08-16 14:58:34 +0000
commit8695612caf8afe1138a7baaa142658dd93c70293 (patch)
treec6d71782b58b573eb26d942682b84acc0a33561c /lib
parent32df87feabb8b2b99fc47e64896b2c922dca6451 (diff)
* marshal.c (w_symbol, w_object): get rid of warnings.
* re.c (rb_memsearch): ditto. * time.c (time_dump): ditto. * ext/extmk.rb (extmake): not continue making when extconf.rb failed. * ext/openssl/extconf.rb: check __VA_ARGS__ macro more precisely. * ext/openssl/ossl.h: remove version.h dependency. * ext/openssl/ruby_missing.h: ditto. * lib/mkmf.rb (pkg_config): use --libs output except with only-L for other options. [ruby-list:38099] * lib/mkmf.rb (create_makefile): separate rule for static library from shared object. * win32/Makefile.sub, bcc32/Makefile.sub, wince/Makefile.sub: define exec_prefix and libdir. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/mkmf.rb20
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index d21fa4f8b6..85cff94da1 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -650,8 +650,9 @@ def pkg_config(pkg)
end
if $PKGCONFIG and system("#{$PKGCONFIG} --exists #{pkg}")
cflags = `#{$PKGCONFIG} --cflags #{pkg}`.chomp
- ldflags = `#{$PKGCONFIG} --libs-only-L #{pkg}`.chomp
+ ldflags = `#{$PKGCONFIG} --libs #{pkg}`.chomp
libs = `#{$PKGCONFIG} --libs-only-l #{pkg}`.chomp
+ ldflags = (Shellwords.shellwords(ldflags) - Shellwords.shellwords(libs)).quote.join(" ")
$CFLAGS += " " << cflags
$LDFLAGS += " " << ldflags
$libs += " " << libs
@@ -805,7 +806,8 @@ def create_makefile(target, srcprefix = nil)
libpath = libpathflag(libpath)
- dllib = target ? "$(TARGET).#{$static ? $LIBEXT : CONFIG['DLEXT']}" : ""
+ dllib = target ? "$(TARGET).#{CONFIG['DLEXT']}" : ""
+ staticlib = target ? "$(TARGET).#$LIBEXT" : ""
mfile = open("Makefile", "wb")
mfile.print configuration(srcdir)
mfile.print %{
@@ -821,6 +823,7 @@ LIBS = #{$LIBRUBYARG} #{$libs} #{$LIBS}
OBJS = #{$objs}
TARGET = #{target}
DLLIB = #{dllib}
+STATIC_LIB = #{staticlib}
}
if $extmk
mfile.print %{
@@ -840,6 +843,7 @@ CLEANLIBS = "$(TARGET).{lib,exp,il?,tds,map}" $(DLLIB)
CLEANOBJS = "*.{#{$OBJEXT},#{$LIBEXT},s[ol],pdb,bak}"
all: #{target ? "$(DLLIB)" : "Makefile"}
+static: $(STATIC_LIB)
}
mfile.print CLEANINGS
dirs = []
@@ -894,13 +898,11 @@ all: #{target ? "$(DLLIB)" : "Makefile"}
mfile.print "$(DLLIB): $(OBJS)\n\t"
mfile.print "@-$(RM) $@\n\t"
mfile.print "@-$(RM) $(TARGET).lib\n\t" if $mswin
- if $static
- mfile.print "$(AR) #{config_string('ARFLAGS') || 'cru '}$(DLLIB) $(OBJS)"
- if ranlib = config_string('RANLIB')
- mfile.print "\n\t@-#{ranlib} $(DLLIB) 2> /dev/null || true"
- end
- else
- mfile.print LINK_SO
+ mfile.print LINK_SO, "\n\n"
+ mfile.print "$(STATIC_LIB): $(OBJS)\n\t"
+ mfile.print "$(AR) #{config_string('ARFLAGS') || 'cru '}$@ $(OBJS)"
+ if ranlib = config_string('RANLIB')
+ mfile.print "\n\t@-#{ranlib} $(DLLIB) 2> /dev/null || true"
end
mfile.print "\n\n"