File: ax_ruby.m4

package info (click to toggle)
quickfix 1.15.1%2Bdfsg-4
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye
  • size: 42,080 kB
  • sloc: cpp: 631,686; python: 129,549; ruby: 106,716; xml: 43,737; ansic: 7,668; java: 1,826; cs: 816; makefile: 544; sh: 462; sql: 313
file content (29 lines) | stat: -rw-r--r-- 688 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
AC_DEFUN([AX_RUBY],
[
RUBY=${RUBY:-"ruby"}

RUBY_PREFIX=[`$RUBY -e 'require "rbconfig"; print Config::CONFIG["archdir"], "\n"'`]
AC_SUBST(RUBY_PREFIX)

has_ruby=false
AC_ARG_WITH(ruby,
    [  --with-ruby             will use $RUBY to find ruby], 
    [if test $withval == "no"
     then
       has_ruby=false
     else
       has_ruby=true
     fi],
    has_ruby=false
)

if test $has_ruby = true
then
    RUBY_CFLAGS="-I${RUBY_PREFIX}" 
    AC_SUBST(RUBY_CFLAGS)
    RUBY_SITE_PACKAGES=[`ruby -e 'require "rbconfig"; print Config::CONFIG["sitedir"], "\n"'`]
    AC_SUBST(RUBY_SITE_PACKAGES)
    AC_DEFINE(HAVE_RUBY, 1, Define if you have ruby)
fi
AM_CONDITIONAL(HAVE_RUBY, $has_ruby)
])