File: ruby_modular_gc.m4

package info (click to toggle)
ruby3.4 3.4.5-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 154,784 kB
  • sloc: ruby: 1,259,653; ansic: 829,955; yacc: 28,233; pascal: 7,359; sh: 3,864; python: 1,799; cpp: 1,158; asm: 808; makefile: 801; javascript: 414; lisp: 109; perl: 62; awk: 36; sed: 4; xml: 4
file content (41 lines) | stat: -rw-r--r-- 1,173 bytes parent folder | download
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
30
31
32
33
34
35
36
37
38
39
40
41
dnl -*- Autoconf -*-
AC_DEFUN([RUBY_MODULAR_GC],[
AC_ARG_WITH(modular-gc,
    AS_HELP_STRING([--with-modular-gc=DIR],
    [Enable replacement of Ruby's GC from a modular library in the specified directory.]),
    [modular_gc_dir=$withval], [unset modular_gc_dir]
)

AS_IF([test "$modular_gc_dir" = yes], [
    AC_MSG_ERROR(you must specify a directory when using --with-modular-gc)
])

AC_MSG_CHECKING([if building with modular GC support])
AS_IF([test x"$modular_gc_dir" != x], [
    AC_MSG_RESULT([yes])

    # Ensure that modular_gc_dir is always an absolute path so that Ruby
    # never loads a modular GC from a relative path
    AS_CASE(["$modular_gc_dir"],
        [/*], [],
        [test "$load_relative" = yes || modular_gc_dir="$prefix/$modular_gc_dir"]
    )

    # Ensure that modular_gc_dir always terminates with a /
    AS_CASE(["$modular_gc_dir"],
        [*/], [],
        [modular_gc_dir="$modular_gc_dir/"]
    )

    AC_DEFINE([USE_MODULAR_GC], [1])

    modular_gc_summary="yes (in $modular_gc_dir)"
], [
    AC_MSG_RESULT([no])
    AC_DEFINE([USE_MODULAR_GC], [0])

    modular_gc_summary="no"
])

AC_SUBST(modular_gc_dir, "${modular_gc_dir}")
])dnl