--SUOF0GtieIMvvwua
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
* saiph said:
are there any ruby bindings for autoconf?
Here's something I wrote, based on Vim's configure.in, that checks for a
ruby interpreter. It's usable (hopefully) when wanting to embedd ruby.
Otherwise, you simple use an extconf.rb and perhaps setup.rb,
nikolai
--
::: name: Nikolai Weibull :: aliases: pcp / lone-star / aka :::
::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden :::
::: page:
www.pcppopper.org :: fun atm: gf,lps,ruby,lisp,war3 :::
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
--SUOF0GtieIMvvwua
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="ruby.m4"
define(arch-tag)
# arch-tag: 1d925bca-9669-4b16-93da-c88de10bca59
dnl contents: Ruby related macros.
dnl
dnl Copyright (C) 2004 Nikolai Weibull <
[email protected]>
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
AC_DEFUN([CHECK_LIB_RUBY],
[
AC_PATH_PROG([cv_path_ruby], [ruby])
if test "x$cv_path_ruby" != x; then
AC_MSG_CHECKING([for ruby version >= $1])
if $cv_path_ruby -e 'VERSION >= "$1" or exit 1' >/dev/null 2>/dev/null;then
cv_ruby_version=`$cv_path_ruby -e 'print VERSION'`
AC_MSG_RESULT([$cv_ruby_version])
rubyhdrdir=`$cv_path_ruby -r mkmf -e 'print Config::CONFIG[["archdir"]]'\
|| echo $hdrdir`
RUBY_CFLAGS="-I$rubyhdrdir"
rubylibs=`$cv_path_ruby -r rbconfig -e 'print Config::CONFIG[["LIBS"]]'`
if test "x$rubylibs" != x; then
RUBY_LIBS="$rubylibs"
fi
librubyarg=`$cv_path_ruby -r rbconfig -e 'print \
Config.expand(Config::CONFIG[["LIBRUBYARG"]])'`
if test -f "$rubyhdrdir/$librubyarg"; then
librubyarg="$rubyhdrdir/$librubyarg"
else
librubyarg=`$cv_path_ruby -r rbconfig -e "print \
'$librubyarg'.gsub(/-L\./, %'-L#{ \
Config.expand(Config::CONFIG[[\"libdir\"]])}')"`
fi
if test "x$librubyarg" != x; then
RUBY_LIBS="$librubyarg $RUBY_LIBS"
fi
rubyldflags=`$cv_path_ruby -r rbconfig -e 'print \
Config::CONFIG[["LDFLAGS"]]'`
if test "x$rubyldflags" != x; then
LDFLAGS="$rubyldflags $LDFLAGS"
fi
else
AC_MSG_RESULT([too old; need Ruby version $1 or newer])
fi
fi
AC_SUBST([RUBY_CFLAGS])
AC_SUBST([RUBY_LIBS])
])
dnl vim: set sts=2 sw=2:
--SUOF0GtieIMvvwua--