-
Notifications
You must be signed in to change notification settings - Fork 3
/
configure.ac
48 lines (43 loc) · 1.97 KB
/
configure.ac
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
42
43
44
45
46
47
48
AC_INIT([mrbcc],[0.1])
AC_CONFIG_AUX_DIR([build-aux])
dnl Needed to compile mruby.
AC_PROG_CC()
AC_PROG_YACC()
dnl Ensure ruby (at least 1.9).
AC_PROG_SED()
AC_PROG_GREP()
AC_ARG_WITH(ruby,
AC_HELP_STRING([--with-ruby=[[[RUBY]]]],[absolute path to ruby executable]),
[RUBY="$withval"])
AC_CHECK_PROG(RUBY, ruby, ruby)
test -z "$RUBY" && AC_MSG_FAILURE([no acceptable ruby interpreter found in \$PATH])
changequote(<<,>>)
ruby_version=`$RUBY --version 2>&1 | $GREP "^ruby " | $SED 's/^ruby \([^ ]*\)\ .*$/\1/'`
ruby_major_version=`echo $ruby_version | sed 's/^\([0-9]*\)\.[0-9]*.*/\1/'`
ruby_minor_version=`echo $ruby_version | sed 's/^[0-9]*\.\([0-9]*\).*/\1/'`
changequote([,])
test -z "$ruby_major_version" && AC_MSG_FAILURE([ruby in \$PATH does not work])
test -z "$ruby_minor_version" && AC_MSG_FAILURE([ruby in \$PATH does not work])
test "$ruby_major_version" -lt 1 && AC_MSG_FAILURE([ruby version in \$PATH is $ruby_version; must be at least 1.9])
if test "$ruby_major_version" -eq 1 ; then
test "$ruby_minor_version" -lt 9 && AC_MSG_FAILURE([ruby version in \$PATH is
$ruby_version; must be at least 1.9])
fi
dnl Ensure ruby gems: activesupport i18n.
AC_MSG_CHECKING([for ruby gem activesupport])
echo 'gem = Gem::Specification.find_by_name("activesupport")' | $RUBY 2>/dev/null ; gem_activesupport=$?
if test "$gem_activesupport" -eq 0 ; then AC_MSG_RESULT([ok]) ;
else AC_MSG_RESULT([no]) ; AC_MSG_FAILURE([ruby gem activesupport not found]) ; fi
AC_MSG_CHECKING([for ruby gem i18n])
echo 'gem = Gem::Specification.find_by_name("i18n")' | $RUBY 2>/dev/null ; gem_i18n=$?
if test "$gem_i18n" -eq 0 ; then AC_MSG_RESULT([ok]) ;
else AC_MSG_RESULT([no]) ; AC_MSG_FAILURE([ruby gem i18n not found]) ; fi
dnl Ensure git.
AC_ARG_WITH(git,
AC_HELP_STRING([--with-git=[[[GIT]]]],[absolute path to git executable]),
[GIT="$withval"])
AC_CHECK_PROG(GIT, git, git)
test -z "$GIT" && AC_MSG_WARN([git not found; mruby source must be provided manually])
AC_PROG_INSTALL
AC_CONFIG_FILES([Makefile])
AC_OUTPUT