summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReuben Thomas <rrt@sc3d.org>2016-07-27 00:14:53 +0100
committerReuben Thomas <rrt@sc3d.org>2016-07-27 00:14:53 +0100
commit1388ade8cd9e43936d0d634a0f00d77121d70368 (patch)
treeedec4890965ed3f523449ef9e0e8e266b0fb438f
parentd3820ccc171ea396299716e059f04c3839b604ff (diff)
downloadautoconf-archive-1388ade8cd9e43936d0d634a0f00d77121d70368.tar.gz
Add AX_LUAROCKS_ROCK
-rw-r--r--m4/ax_luarocks_rock.m453
1 files changed, 53 insertions, 0 deletions
diff --git a/m4/ax_luarocks_rock.m4 b/m4/ax_luarocks_rock.m4
new file mode 100644
index 0000000..d9fc0c6
--- /dev/null
+++ b/m4/ax_luarocks_rock.m4
@@ -0,0 +1,53 @@
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_luarocks_rock.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_LUAROCKS_ROCK([ROCK])
+#
+# DESCRIPTION
+#
+# Checks for a rock, and fails if it is not installed.
+#
+# Example usage:
+#
+# AX_LUAROCKS_ROCK(stdlib)
+#
+# Note: use of this macro is not normally recommended. Normally, LuaRocks
+# should be used to drive the build system, and it takes care of rock
+# dependencies. Use this macro only if LuaRocks cannot be used at the top
+# level, for example, in a build system that uses Lua only incidentally.
+#
+# LICENSE
+#
+# Copyright (c) 2016 Reuben Thomas <rrt@sc3d.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 1
+
+AC_DEFUN([AX_LUAROCKS_ROCK],[
+ # Make sure we have luarocks
+ if test -z "$LUAROCKS"; then
+ AX_WITH_PROG(LUAROCKS,luarocks)
+ if test -z "$LUAROCKS"; then
+ AC_MSG_ERROR([can't find luarocks])
+ fi
+ fi
+
+ AC_PREREQ([2.61])
+
+ pushdef([ROCK],$1)
+ AC_MSG_CHECKING(whether LuaRock ROCK is installed)
+ AS_IF(["$LUAROCKS" show ROCK > /dev/null],[
+ AC_MSG_RESULT(yes)
+ ],[
+ AC_MSG_FAILURE([LuaRock ROCK not found])
+ ])
+
+ popdef([ROCK])
+])