[PATCH] Add support for CYGWIN.

"Carlo B." <[email protected]>
Newsgroups gmane.comp.lang.lua.general
Message-ID <[email protected]>
Hello,
I would like to share my patch for supporting CYGWIN into LUA.
The patch just needs few simple fixes to luaconf.h.
Attached patch provides those fixes.
The patch has been created by using the latest sources available from the 
repository at the time of writing.
I hope that you will find them useful.

Sincerely,

Carlo Bramini.

-- 
You received this message because you are subscribed to the Google Groups "lua-l" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/lua-l/20f9c4cf-5857-45a2-8bdf-14e714f5f4aen%40googlegroups.com.
add-support-for-cygwin.patch (text/x-diff, 1.2 KB)
diff --git a/luaconf.h b/luaconf.h
index 1b72e33..2a30e14 100644
--- a/luaconf.h
+++ b/luaconf.h
@@ -58,6 +58,11 @@
 #endif
 
 
+#if defined(__CYGWIN__)
+#define LUA_USE_CYGWIN  /* enable support for hybrid POSIX/Windows */
+#endif
+
+
 /*
 ** When POSIX DLL ('LUA_USE_DLOPEN') is enabled, the Lua stand-alone
 ** application will try to dynamically link a 'readline' facility
@@ -91,6 +96,15 @@
 #endif
 
 
+#if defined(LUA_USE_CYGWIN)
+#define LUA_USE_POSIX
+#define LUA_USE_DLOPEN		/* needs an extra library: -ldl */
+#if !defined(LUA_READLINELIB)
+#define LUA_READLINELIB		"cygreadline.dll"
+#endif
+#endif
+
+
 #if defined(LUA_USE_C89) && defined(LUA_USE_POSIX)
 #error "POSIX is not compatible with C89"
 #endif
@@ -241,6 +255,19 @@
 		LUA_CDIR"loadall.dll;" ".\\?.dll"
 #endif
 
+
+#elif defined(LUA_USE_CYGWIN)	/* }{ */
+
+#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  \
+		LUA_LDIR"?.lua;"  LUA_LDIR"?/init.lua;" \
+		LUA_CDIR"?.lua;"  LUA_CDIR"?/init.lua;" \
+		"./?.lua;" "./?/init.lua"
+#define LUA_CPATH_DEFAULT \
+		LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll;" "./?.dll"
+
 #else			/* }{ */
 
 #define LUA_ROOT	"/usr/local/"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.