-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(build): Overhaul LuaRocks depnedncy checking in preparation for…
… upstreaming
- Loading branch information
Showing
3 changed files
with
92 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,38 +21,34 @@ | |
# | ||
# LICENSE | ||
# | ||
# Copyright (c) 2024 Caleb Maclennan <[email protected]> | ||
# Copyright (c) 2016 Reuben Thomas <[email protected]> | ||
# | ||
# 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 2 | ||
#serial 3 | ||
|
||
AC_DEFUN([AX_LUAROCKS_ROCK], [ | ||
# Make sure we have luarocks | ||
if test -z "$LUAROCKS"; then | ||
AC_PATH_PROG(LUAROCKS, luarocks) | ||
if test -z "$LUAROCKS"; then | ||
AC_MSG_ERROR([can't find luarocks]) | ||
fi | ||
fi | ||
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]) | ||
AC_PREREQ([2.61]) | ||
pushdef([ROCK],$1) | ||
AC_MSG_CHECKING(whether LuaRock ROCK is installed) | ||
AS_IF(["$LUAROCKS" --lua-version 5.1 show ROCK > /dev/null],[ | ||
AC_MSG_RESULT(yes) | ||
], [ | ||
AX_PROG_LUA([5.1], [], [], [], always) | ||
AS_IF(["$LUA" -v -l ROCK > /dev/null],[ | ||
AC_MSG_RESULT(yes) | ||
], [ | ||
AC_MSG_FAILURE([LuaRock ROCK not found]) | ||
]) | ||
]) | ||
pushdef([ROCK],$1) | ||
AC_MSG_CHECKING(whether LuaRock ROCK is installed) | ||
AS_IF(["$LUAROCKS"${LUA_VERSION+ --lua-version $LUA_VERSION} show ROCK > /dev/null],[ | ||
AC_MSG_RESULT(yes) | ||
],[ | ||
AC_MSG_FAILURE([LuaRock ROCK not found]) | ||
]) | ||
popdef([ROCK]) | ||
popdef([ROCK]) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# =========================================================================== | ||
# https://www.gnu.org/software/autoconf-archive/ax_with_prog.html | ||
# =========================================================================== | ||
# | ||
# SYNOPSIS | ||
# | ||
# AX_WITH_PROG([VARIABLE],[program],[VALUE-IF-NOT-FOUND],[PATH]) | ||
# | ||
# DESCRIPTION | ||
# | ||
# Locates an installed program binary, placing the result in the precious | ||
# variable VARIABLE. Accepts a present VARIABLE, then --with-program, and | ||
# failing that searches for program in the given path (which defaults to | ||
# the system path). If program is found, VARIABLE is set to the full path | ||
# of the binary; if it is not found VARIABLE is set to VALUE-IF-NOT-FOUND | ||
# if provided, unchanged otherwise. | ||
# | ||
# A typical example could be the following one: | ||
# | ||
# AX_WITH_PROG(PERL,perl) | ||
# | ||
# NOTE: This macro is based upon the original AX_WITH_PYTHON macro from | ||
# Dustin J. Mitchell <[email protected]>. | ||
# | ||
# LICENSE | ||
# | ||
# Copyright (c) 2008 Francesco Salvestrini <[email protected]> | ||
# Copyright (c) 2008 Dustin J. Mitchell <[email protected]> | ||
# | ||
# 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 17 | ||
|
||
AC_DEFUN([AX_WITH_PROG],[ | ||
AC_PREREQ([2.61]) | ||
pushdef([VARIABLE],$1) | ||
pushdef([EXECUTABLE],$2) | ||
pushdef([VALUE_IF_NOT_FOUND],$3) | ||
pushdef([PATH_PROG],$4) | ||
AC_ARG_VAR(VARIABLE,Absolute path to EXECUTABLE executable) | ||
AS_IF(test -z "$VARIABLE",[ | ||
AC_MSG_CHECKING(whether EXECUTABLE executable path has been provided) | ||
AC_ARG_WITH(EXECUTABLE,AS_HELP_STRING([--with-EXECUTABLE=[[[PATH]]]],absolute path to EXECUTABLE executable), [ | ||
AS_IF([test "$withval" != yes && test "$withval" != no],[ | ||
VARIABLE="$withval" | ||
AC_MSG_RESULT($VARIABLE) | ||
],[ | ||
VARIABLE="" | ||
AC_MSG_RESULT([no]) | ||
AS_IF([test "$withval" != no], [ | ||
AC_PATH_PROG([]VARIABLE[],[]EXECUTABLE[],[]VALUE_IF_NOT_FOUND[],[]PATH_PROG[]) | ||
]) | ||
]) | ||
],[ | ||
AC_MSG_RESULT([no]) | ||
AC_PATH_PROG([]VARIABLE[],[]EXECUTABLE[],[]VALUE_IF_NOT_FOUND[],[]PATH_PROG[]) | ||
]) | ||
]) | ||
popdef([PATH_PROG]) | ||
popdef([VALUE_IF_NOT_FOUND]) | ||
popdef([EXECUTABLE]) | ||
popdef([VARIABLE]) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters