summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-04-27 05:11:13 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-04-27 05:11:13 +0000
commit6c840ba8f466d3050bfb4bfcc092c9459481fdb1 (patch)
treeaf08481f8b534cc56f0b2fe9cbe974224efa509a /ext
parente5ce6155af93a5cdaaef02ad44dfc143d0bafd9c (diff)
--with-xxx=yyy
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/extmk.rb.in23
-rw-r--r--ext/readline/extconf.rb16
2 files changed, 39 insertions, 0 deletions
diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in
index 57d7a4a455..743ec16b34 100644
--- a/ext/extmk.rb.in
+++ b/ext/extmk.rb.in
@@ -242,6 +242,29 @@ def have_header(header)
return TRUE
end
+def arg_config(config, default=nil)
+ unless defined? $configure_args
+ $configure_args = {}
+ for arg in CONFIG["configure_args"].split
+ next unless /^--/ =~ arg
+ if /=/ =~ arg
+ $configure_args[$`] = $'
+ else
+ $configure_args[arg] = default
+ end
+ end
+ end
+ p [$configure_args, config]
+ $configure_args.fetch(config, default)
+end
+
+def with_config(config, default=nil)
+ unless /^--with-/ =~ config
+ config = '--with-' + config
+ end
+ arg_config(config, default)
+end
+
def create_header()
if $defs.length > 0
hfile = open("extconf.h", "w")
diff --git a/ext/readline/extconf.rb b/ext/readline/extconf.rb
index e55233eb20..1cf55bb4d9 100644
--- a/ext/readline/extconf.rb
+++ b/ext/readline/extconf.rb
@@ -1,5 +1,21 @@
require "mkmf"
+readline_dir = with_config("readline-dir")
+if readline_dir
+ $CFLAGS = "-I#{readline_dir}/include"
+ $LDFLAGS = "-L#{readline_dir}/lib"
+end
+
+readline_dir = with_config("readline-include-dir")
+if readline_dir
+ $CFLAGS = "-I#{readline_dir}"
+end
+
+readline_dir = with_config("readline-lib-dir")
+if readline_dir
+ $LDFLAGS = "-L#{readline_dir}"
+end
+
have_library("termcap", "tgetnum")
if have_header("readline/readline.h") and
have_header("readline/history.h") and