summaryrefslogtreecommitdiffstats
path: root/ext/mmap/extconf.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2009-02-28 21:19:37 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2009-02-28 21:19:37 +0100
commit0a8b6ea5dc6a9d56638b985dd67b0c45f167e381 (patch)
tree1932cb877c3e623f9a300c37971bb4e073670aea /ext/mmap/extconf.rb
parent50bb456cf469f73d3a32474dc07bd58c0c64dba1 (diff)
downloadmmap-ruby-0a8b6ea5dc6a9d56638b985dd67b0c45f167e381.zip
mmap-ruby-0a8b6ea5dc6a9d56638b985dd67b0c45f167e381.tar.gz
mmap goes rakeified, build and test OKHEADmaster
Diffstat (limited to 'ext/mmap/extconf.rb')
-rw-r--r--ext/mmap/extconf.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/ext/mmap/extconf.rb b/ext/mmap/extconf.rb
new file mode 100644
index 0000000..87e8088
--- /dev/null
+++ b/ext/mmap/extconf.rb
@@ -0,0 +1,33 @@
+#!/usr/bin/ruby
+ARGV.collect! {|x| x.sub(/^--with-mmap-prefix=/, "--with-mmap-dir=") }
+
+require 'mkmf'
+
+if unknown = enable_config("unknown")
+ libs = if CONFIG.key?("LIBRUBYARG_STATIC")
+ Config::expand(CONFIG["LIBRUBYARG_STATIC"].dup).sub(/^-l/, '')
+ else
+ Config::expand(CONFIG["LIBRUBYARG"].dup).sub(/^lib([^.]*).*/, '\\1')
+ end
+ unknown = find_library(libs, "ruby_init",
+ Config::expand(CONFIG["archdir"].dup))
+end
+
+dir_config("mmap")
+
+["lstrip", "match", "insert", "casecmp"].each do |func|
+ if "aa".respond_to?(func)
+ $CFLAGS += " -DHAVE_RB_STR_#{func.upcase}"
+ end
+end
+
+if enable_config("ipc")
+ unless have_func("semctl") && have_func("shmctl")
+ $stderr.puts "\tIPC will not be available"
+ end
+end
+
+$CFLAGS += " -DRUBYLIBDIR='\"#{CONFIG['rubylibdir']}\"'"
+
+create_makefile "mmap"
+