summaryrefslogtreecommitdiffstats
path: root/extconf.rb
diff options
context:
space:
mode:
authorguy Decoux <ts@moulon.inra.fr>2009-02-28 20:12:15 +0100
committerguy Decoux <ts@moulon.inra.fr>2009-02-28 20:12:15 +0100
commit74b85a22dbbea2dbb74e0e94c996178814eced59 (patch)
treee6bc07cc8363f6acf8ce040f64ac2d0fe2de7e3f /extconf.rb
parentfa598d05504f6dd43e29e0f93a3f25d254ebd7c0 (diff)
downloadmmap-ruby-74b85a22dbbea2dbb74e0e94c996178814eced59.zip
mmap-ruby-74b85a22dbbea2dbb74e0e94c996178814eced59.tar.gz
mmap-0.2.0
Diffstat (limited to 'extconf.rb')
-rw-r--r--extconf.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/extconf.rb b/extconf.rb
index 1e8f37f..78d9bd8 100644
--- a/extconf.rb
+++ b/extconf.rb
@@ -1,5 +1,15 @@
require "mkmf"
+
+$stat_lib = if CONFIG.key?("LIBRUBYARG_STATIC")
+ $LDFLAGS += " -L#{CONFIG['libdir']}"
+ CONFIG["LIBRUBYARG_STATIC"]
+ else
+ "-lruby"
+ end
+$static ||= nil
+
create_makefile "mmap"
+
begin
make = open("Makefile", "a")
make.puts "\ntest: $(DLLIB)"
@@ -12,7 +22,7 @@ begin
unknown: $(DLLIB)
\t@echo "main() {}" > /tmp/a.c
-\t$(CC) -static /tmp/a.c $(OBJS) $(CPPFLAGS) $(DLDFLAGS) -lruby #{CONFIG["LIBS"]} $(LIBS) $(LOCAL_LIBS)
+\t$(CC) -static /tmp/a.c $(OBJS) $(CPPFLAGS) $(DLDFLAGS) #$stat_lib #{CONFIG["LIBS"]} $(LIBS) $(LOCAL_LIBS)
\t@-rm /tmp/a.c a.out
%.html: %.rd