Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
An M4 macro checking for given gems. Example: AX_CHECK_GEMS([rspec simplecov])
AC_DEFUN([AX_CHECK_GEMS],[
AC_MSG_CHECKING([whether we've got all required gems])
result=`$RUBY -e '
ARGV.each { |f| begin; require f; rescue LoadError; puts(f); exit 1; end }
' $1 2>&1`
if test x = "x$result"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_ERROR([cannot find $result])
fi
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment