]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
FFI: Add define to disable the FFI library.
authorMike Pall <mike>
Tue, 30 Nov 2010 20:56:57 +0000 (21:56 +0100)
committerMike Pall <mike>
Tue, 30 Nov 2010 20:56:57 +0000 (21:56 +0100)
src/Makefile
src/lj_arch.h

index 87fddbad19a7d74d3041a5c81cd99452ab6f9ee9..3b9d202a9bfb578fc89f23f053fdf4ab2a6fbf03 100644 (file)
@@ -88,6 +88,12 @@ BUILDMODE= mixed
 # recompile with "make clean", followed by "make".
 XCFLAGS=
 #
+# Permanently disable the FFI extension to reduce the size of the LuaJIT
+# executable. But please consider that the FFI library is compiled-in,
+# but NOT loaded by default. It only allocates any memory, if you actually
+# make use of it.
+#XCFLAGS+= -DLUAJIT_DISABLE_FFI
+#
 # Enable some upwards-compatible features from Lua 5.2 that are unlikely
 # to break existing code (e.g. __pairs). Note that this does not provide
 # full compatibility with Lua 5.2 at this time.
index 4b2bbe76860a94318cc2f736099f62e0c94a8b0b..205f51a6466be8542f0f445f35307fe8ced2ffb4 100644 (file)
 #define LJ_HASJIT              1
 #endif
 
+/* Disable or enable the FFI extension. */
+#if defined(LUAJIT_DISABLE_FFI) || defined(LJ_ARCH_NOFFI)
+#define LJ_HASFFI              0
+#else
+#define LJ_HASFFI              1
+#endif
+
 #if LJ_ARCH_ENDIAN == LUAJIT_BE
 #define LJ_LE                  0
 #define LJ_BE                  1