From d2b0158dcc2b91122089072feccaaaa34dd9bf61 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Mon, 3 Dec 2018 19:38:19 +0000 Subject: configure: Also look for lua.h in a directory with the same suffix as the interpreter (FreeBSD-friendly) --- configure | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) (limited to 'configure') diff --git a/configure b/configure index c484a280..4a816364 100755 --- a/configure +++ b/configure @@ -469,24 +469,37 @@ if [ -f "$lua_h" ] then echo "lua.h found in $lua_h" else - v_dir="$LUA_INCDIR/lua/$LUA_VERSION" - lua_h="$v_dir/lua.h" - if [ -f "$lua_h" ] - then + for postfix in "$LUA_VERSION" "$LUA_SUFFIX"; do + if ! [ "$postfix" = "" ]; then + v_dir="$LUA_INCDIR/lua/$postfix"; + else + v_dir="$LUA_INCDIR/lua"; + fi + lua_h="$v_dir/lua.h" + if [ -f "$lua_h" ] + then echo "lua.h found in $lua_h" LUA_INCDIR="$v_dir" - else - d_dir="$LUA_INCDIR/lua$LUA_VERSION" + break; + else + d_dir="$LUA_INCDIR/lua$postfix" lua_h="$d_dir/lua.h" if [ -f "$lua_h" ] then - echo "lua.h found in $lua_h (Debian/Ubuntu)" - LUA_INCDIR="$d_dir" + echo "lua.h found in $lua_h" + LUA_INCDIR="$d_dir" + break; else - echo "lua.h not found (looked in $LUA_INCDIR, $v_dir, $d_dir)" - die "You may want to use the flag --with-lua or --with-lua-include. See --help." + lua_h_search="$lua_h_search\n $v_dir/lua.h\n $d_dir/lua.h" fi - fi + fi + done + if [ ! -f "$lua_h" ]; then + echo "lua.h not found. Looked for:" + echo "$lua_h_search" | uniq + echo + die "You may want to use the flag --with-lua or --with-lua-include. See --help." + fi fi if [ "$lua_interp_found" = "yes" ] -- cgit v1.2.3