From: Ari Johnson Date: Wed, 12 Jan 2011 21:17:44 +0000 (+0000) Subject: Automatically locate lua.h header X-Git-Url: https://git.theari.com/?a=commitdiff_plain;h=dfd69217bb3c537b6f1d676bbeb4980aaea3d250;p=cobramush.git Automatically locate lua.h header --- 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" +