Skip to content

Commit

Permalink
--with-xxx=yyy
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
matz committed Apr 27, 1999
1 parent e5ce615 commit 6c840ba
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 3 deletions.
9 changes: 9 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
Tue Apr 27 14:11:45 1999 Yukihiro Matsumoto <matz@netlab.co.jp>

* ext/extmk.rb.in: `--with-xxx=yyy' argument configuration.

* misc/ruby-mode.el: forgot to handle $`.

* ext/extmk.rb.in: better AIX link support proposed by
<komatsu@sarion.co.jp>.

Mon Apr 26 16:46:59 1999 Yukihiro Matsumoto <matz@netlab.co.jp>

* ext/extmk.rb.in: AIX shared library support modified.
Expand Down
5 changes: 4 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ echo "configure:624: checking target architecture" >&5
echo -n " $archs"
done
cat >> confdefs.h <<\EOF
#define NEXT_FAT_BINARY 1
#define NEXT_FAT_BINARY 1
EOF

echo "."
Expand Down Expand Up @@ -4527,6 +4527,8 @@ cat >> confdefs.h <<EOF
EOF


configure_args=$ac_configure_args

if test "$fat_binary" = yes ; then
arch="fat-${host_os}"

Expand Down Expand Up @@ -4746,6 +4748,7 @@ s%@LIBRUBY@%$LIBRUBY%g
s%@LIBRUBYARG@%$LIBRUBYARG%g
s%@SOLIBS@%$SOLIBS%g
s%@arch@%$arch%g
s%@configure_args@%$configure_args%g
CEOF
EOF
Expand Down
5 changes: 4 additions & 1 deletion configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ AC_ARG_ENABLE(fat-binary,
ARCH_FLAG="$ARCH_FLAG -arch $archs "
echo -n " $archs"
done
AC_DEFINE( NEXT_FAT_BINARY )
AC_DEFINE(NEXT_FAT_BINARY)
echo "."
fi

Expand Down Expand Up @@ -718,6 +718,9 @@ RUBY_SITE_LIB_PATH="${RUBY_LIB_PATH}/site_ruby"
AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, "${RUBY_SITE_LIB_PATH}")
AC_SUBST(arch)dnl

configure_args=$ac_configure_args
AC_SUBST(configure_args)dnl

if test "$fat_binary" = yes ; then
arch="fat-${host_os}"

Expand Down
23 changes: 23 additions & 0 deletions ext/extmk.rb.in
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
16 changes: 16 additions & 0 deletions ext/readline/extconf.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
30 changes: 30 additions & 0 deletions lib/mkmf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,36 @@ def have_header(header)
return TRUE
end

def arg_config(config, default="yes")
unless defined? $configure_args
$configure_args = {}
for arg in CONFIG["configure_args"].split + ARGV
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="yes")
unless /^--with-/ =~ config
config = '--with-' + config
end
arg_config(config, default)
end

def with_config(config, value="yes")
unless /^-with-/ =~ config
config = '-with-' + config
end
arg_config(config, value)
end

def create_header()
print "creating extconf.h\n"
STDOUT.flush
Expand Down
2 changes: 1 addition & 1 deletion misc/ruby-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ An end of a defun is found by moving forward from the beginning of one."
(lambda ()
(make-local-variable 'font-lock-syntactic-keywords)
(setq font-lock-syntactic-keywords
'(("\\$\\([#\"'$\\]\\)" 1 (1 . nil))
'(("\\$\\([#\"'`$\\]\\)" 1 (1 . nil))
("\\(#\\)[{$@]" 1 (1 . nil))))
(make-local-variable 'font-lock-defaults)
(setq font-lock-defaults '((ruby-font-lock-keywords) nil nil))
Expand Down

0 comments on commit 6c840ba

Please sign in to comment.