Skip to content

Instantly share code, notes, and snippets.

@jstepien
Created November 11, 2010 14:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jstepien/672579 to your computer and use it in GitHub Desktop.
Save jstepien/672579 to your computer and use it in GitHub Desktop.
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