Patch to src/luaconf.h is to adjust lua's default path for where it 
looks for .lua and lua related .so's
OI-specific: If GCC hides symbols luac and lua binary can't be compiled.

--- src/lua.h.~1~	Fri Apr 20 06:18:26 2012
+++ src/lua.h	Tue Oct 16 16:37:24 2012
@@ -9,6 +9,10 @@
 #ifndef lua_h
 #define lua_h
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <stdarg.h>
 #include <stddef.h>
 
@@ -435,5 +439,8 @@
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 ******************************************************************************/
 
+#ifdef __cplusplus
+}
+#endif
 
 #endif

--- src/lualib.h.~1~	Thu Dec  8 04:11:37 2011
+++ src/lualib.h	Tue Oct 16 16:34:40 2012
@@ -8,6 +8,10 @@
 #ifndef lualib_h
 #define lualib_h
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "lua.h"
 
 
@@ -51,5 +55,8 @@
 #define lua_assert(x)	((void)0)
 #endif
 
+#ifdef __cplusplus
+}
+#endif
 
 #endif
--- src/lauxlib.h.~1~	Tue Nov 29 07:55:08 2011
+++ src/lauxlib.h	Tue Oct 16 16:34:40 2012
@@ -8,6 +8,9 @@
 #ifndef lauxlib_h
 #define lauxlib_h
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 #include <stddef.h>
 #include <stdio.h>
@@ -206,7 +209,9 @@
 
 #endif
 
-
+#ifdef __cplusplus
+}
 #endif
 
+#endif


--- src/luaconf.h.~1~	2013-03-17 01:10:18.000000000 +0400
+++ src/luaconf.h	2014-07-10 09:54:41.072127770 +0400
@@ -100,7 +100,7 @@
 #else			/* }{ */
 
 #define LUA_VDIR	LUA_VERSION_MAJOR "." LUA_VERSION_MINOR "/"
-#define LUA_ROOT	"/usr/local/"
+#define LUA_ROOT	"/usr/"
 #define LUA_LDIR	LUA_ROOT "share/lua/" LUA_VDIR
 #define LUA_CDIR	LUA_ROOT "lib/lua/" LUA_VDIR
 #define LUA_PATH_DEFAULT  \
@@ -176,7 +176,7 @@
 */
 #if defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \
     defined(__ELF__)		/* { */
-#define LUAI_FUNC	__attribute__((visibility("hidden"))) extern
+#define LUAI_FUNC	extern
 #define LUAI_DDEC	LUAI_FUNC
 #define LUAI_DDEF	/* empty */