1 ## ------------------------
4 ## ------------------------
5 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
6 # Free Software Foundation, Inc.
8 # This file is free software; the Free Software Foundation
9 # gives unlimited permission to copy and/or distribute it,
10 # with or without modifications, as long as this notice is preserved.
13 AC_DEFUN([AC_RUBY_DEVEL],
15 dnl Find a Ruby interpreter
16 AC_PATH_PROG([RUBY],[ruby])
18 if test -z "$RUBY" ; then
19 AC_MSG_ERROR([Could not find ruby interpreter.])
22 dnl Get Ruby version number
23 RUBY_VERSION=`$RUBY -e "puts RUBY_VERSION"`
25 dnl Get Ruby bin directory
26 RUBY_BIN_DIR=`$RUBY -rrbconfig -e 'puts Config::CONFIG[["bindir"]]'`
28 dnl Get Ruby site arch
29 RUBY_SITE_ARCH=`$RUBY -rrbconfig -e 'puts Config::CONFIG[["sitearch"]]'`
31 dnl Get Ruby include directory
32 RUBY_INCLUDE_DIR=`$RUBY -rrbconfig -e 'puts Config::CONFIG[["rubyhdrdir"]] || Config::CONFIG[["archdir"]]'`
34 dnl Get Ruby lib directory
35 RUBY_LIB_DIR=`$RUBY -rrbconfig -e 'puts Config::CONFIG[["libdir"]]'`
37 dnl Get Ruby extensions directory
38 RUBY_EXTENSION_DIR=`$RUBY -rrbconfig -e 'puts Config::CONFIG[["sitearchdir"]]'`
40 dnl Get Ruby shared library name, this does not include the lib prefix or extension name
41 RUBY_SO_NAME=`$RUBY -rrbconfig -e 'puts Config::CONFIG[["RUBY_SO_NAME"]]'`
43 dnl Get Ruby shared libary name
44 RUBY_SHARED_LIB=`$RUBY -rrbconfig -e 'puts Config::CONFIG[["LIBRUBY"]]'`
46 AC_MSG_NOTICE([Ruby executable is '$RUBY'])
47 AC_MSG_NOTICE([Ruby version is '$RUBY_VERSION'])
48 AC_MSG_NOTICE([Ruby bin directory is '$RUBY_BIN_DIR'])
49 AC_MSG_NOTICE([Ruby site arch is '$RUBY_SITE_ARCH'])
50 AC_MSG_NOTICE([Ruby include directory is '$RUBY_INCLUDE_DIR'])
51 AC_MSG_NOTICE([Ruby library directory is '$RUBY_LIB_DIR'])
52 AC_MSG_NOTICE([Ruby extension directory is '$RUBY_EXTENSION_DIR'])
53 AC_MSG_NOTICE([Ruby library is '$RUBY_SO_NAME'])
54 AC_MSG_NOTICE([Ruby import library is '$RUBY_SHARED_LIB'])
56 AC_SUBST([RUBY_VERSION])
57 AC_SUBST([RUBY_BIN_DIR])
58 AC_SUBST([RUBY_SITE_ARCH])
59 AC_SUBST([RUBY_INCLUDE_DIR])
60 AC_SUBST([RUBY_LIB_DIR])
61 AC_SUBST([RUBY_EXTENSION_DIR])
62 AC_SUBST([RUBY_SO_NAME])
63 AC_SUBST([RUBY_SHARED_LIB])