From dfd69217bb3c537b6f1d676bbeb4980aaea3d250 Mon Sep 17 00:00:00 2001 From: Ari Johnson Date: Wed, 12 Jan 2011 21:17:44 +0000 Subject: [PATCH] Automatically locate lua.h header --- U/d_lua.U | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/U/d_lua.U b/U/d_lua.U index 0efc9e4..b4a91b5 100644 --- a/U/d_lua.U +++ b/U/d_lua.U @@ -14,3 +14,25 @@ case $libs in exit 1; ;; esac + +myincs="/usr/include $locincpth" +otherincs="" +for thisincl in $myincs; do + otherincs="$otherincs $thisincl/lua5.1" +done + +lua_h_path="" +for thisincl in $myincs $otherincs; do + if [ -r "$thisincl/lua.h" ]; then + lua_h_path="$thisincl" + fi +done + +if [ x"$lua_h_path" == "x" ]; then + echo "Unable to find lua.h header. Check your LUA installation." >&4 + echo "Looked in $myincs $otherincs for it" >&4 + exit 1 +fi + +ccflags="$ccflags -I$lua_h_path" + -- 2.30.2