diff options
author | Mike Pall <mike> | 2010-11-30 21:56:57 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2010-11-30 21:56:57 +0100 |
commit | 0ffd06aba8de49ce751e5e9bcf7aa71bd42403f1 (patch) | |
tree | 90350904a9e49b5c7ec2757e8d7253ab3b74b8b4 /src | |
parent | 4ed8a1931b4bf2331d9f79bc1f08576eb800c2ee (diff) | |
download | luajit-0ffd06aba8de49ce751e5e9bcf7aa71bd42403f1.tar.gz luajit-0ffd06aba8de49ce751e5e9bcf7aa71bd42403f1.tar.bz2 luajit-0ffd06aba8de49ce751e5e9bcf7aa71bd42403f1.zip |
FFI: Add define to disable the FFI library.
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile | 6 | ||||
-rw-r--r-- | src/lj_arch.h | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/Makefile b/src/Makefile index 87fddbad..3b9d202a 100644 --- a/src/Makefile +++ b/src/Makefile | |||
@@ -88,6 +88,12 @@ BUILDMODE= mixed | |||
88 | # recompile with "make clean", followed by "make". | 88 | # recompile with "make clean", followed by "make". |
89 | XCFLAGS= | 89 | XCFLAGS= |
90 | # | 90 | # |
91 | # Permanently disable the FFI extension to reduce the size of the LuaJIT | ||
92 | # executable. But please consider that the FFI library is compiled-in, | ||
93 | # but NOT loaded by default. It only allocates any memory, if you actually | ||
94 | # make use of it. | ||
95 | #XCFLAGS+= -DLUAJIT_DISABLE_FFI | ||
96 | # | ||
91 | # Enable some upwards-compatible features from Lua 5.2 that are unlikely | 97 | # Enable some upwards-compatible features from Lua 5.2 that are unlikely |
92 | # to break existing code (e.g. __pairs). Note that this does not provide | 98 | # to break existing code (e.g. __pairs). Note that this does not provide |
93 | # full compatibility with Lua 5.2 at this time. | 99 | # full compatibility with Lua 5.2 at this time. |
diff --git a/src/lj_arch.h b/src/lj_arch.h index 4b2bbe76..205f51a6 100644 --- a/src/lj_arch.h +++ b/src/lj_arch.h | |||
@@ -183,6 +183,13 @@ | |||
183 | #define LJ_HASJIT 1 | 183 | #define LJ_HASJIT 1 |
184 | #endif | 184 | #endif |
185 | 185 | ||
186 | /* Disable or enable the FFI extension. */ | ||
187 | #if defined(LUAJIT_DISABLE_FFI) || defined(LJ_ARCH_NOFFI) | ||
188 | #define LJ_HASFFI 0 | ||
189 | #else | ||
190 | #define LJ_HASFFI 1 | ||
191 | #endif | ||
192 | |||
186 | #if LJ_ARCH_ENDIAN == LUAJIT_BE | 193 | #if LJ_ARCH_ENDIAN == LUAJIT_BE |
187 | #define LJ_LE 0 | 194 | #define LJ_LE 0 |
188 | #define LJ_BE 1 | 195 | #define LJ_BE 1 |