Permalink
Browse files

Make Readline library configurable.

  • Loading branch information...
1 parent d3d550e commit 0c3ccfd34f24215b257b869c28f3bd4147e772bb Brian Ford committed Nov 5, 2010
Showing with 17 additions and 4 deletions.
  1. +1 −0 .gitignore
  2. +16 −4 configure
  3. 0 lib/{readline.rb → c-readline.rb}
View
@@ -76,6 +76,7 @@ tmtags
/lib/zlib.rb
/lib/fcntl.rb
/lib/syslog.rb
+/lib/readline.rb
/lib/ext/melbourne/Makefile
View
@@ -67,6 +67,9 @@ class Configure
@program_name = "rbx"
+ # Library configuration
+ @rb_readline = false
+
# Essential settings (modify these for creating releases)
@libversion = "1.1"
@version = "#{@libversion}.1dev"
@@ -646,14 +649,14 @@ int main() { return tgetnum(""); }
@defines << "HAS_EXECINFO"
end
- if @features["ruby-readline"]
- @defines << "USE_RB_READLINE"
- end
-
if @features["C-readline"] and
has_function("readline", ["stdio.h", "stdlib.h", "readline/readline.h"])
@defines << "HAS_READLINE"
end
+
+ if @features["ruby-readline"] or !@defines.include?("HAS_READLINE")
+ @rb_readline = true
+ end
end
def process
@@ -787,6 +790,15 @@ end
f.puts "#define RBX_HAVE_TR1_HASH 1"
end
end
+
+ # Write a require file depending on which Readline library we use.
+ File.open "lib/readline.rb", "w" do |f|
+ if @rb_readline
+ f.puts "require 'rb-readline/readline'"
+ else
+ f.puts "require 'c-readline'"
+ end
+ end
end
def print_debug
File renamed without changes.

0 comments on commit 0c3ccfd

Please sign in to comment.