diff options
author | Mike Pall <mike> | 2010-03-04 16:23:28 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2010-03-04 16:23:28 +0100 |
commit | 3d2abf3148c2280b0fd018cd179acd30099c5ed7 (patch) | |
tree | d192c2f420692133768a143a4bfc34073e4c9c05 /src | |
parent | 15c3bd7725e97e450f4cb5be7888bbea2133f90d (diff) | |
download | luajit-3d2abf3148c2280b0fd018cd179acd30099c5ed7.tar.gz luajit-3d2abf3148c2280b0fd018cd179acd30099c5ed7.tar.bz2 luajit-3d2abf3148c2280b0fd018cd179acd30099c5ed7.zip |
Build as a native 32 or 64 bit binary by default.
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/src/Makefile b/src/Makefile index 261e2049..a9ad8eb9 100644 --- a/src/Makefile +++ b/src/Makefile | |||
@@ -20,16 +20,11 @@ NODOTABIVER= 51 | |||
20 | # Turn any of the optional settings on by removing the '#' in front of them. | 20 | # Turn any of the optional settings on by removing the '#' in front of them. |
21 | # You need to 'make clean' and 'make' again, if you change any options. | 21 | # You need to 'make clean' and 'make' again, if you change any options. |
22 | # | 22 | # |
23 | # It's recommended to compile at least for i686. By default the assembler part | 23 | # LuaJIT builds as a native 32 or 64 bit binary by default. |
24 | # of the interpreter makes use of CMOV/FCOMI*/FUCOMI* instructions, anyway. | 24 | CC= gcc |
25 | CC= gcc -m32 -march=i686 | ||
26 | # Use this for GCC 4.2 or higher if you don't intend to distribute the | ||
27 | # binaries to a different machine: | ||
28 | #CC= gcc -m32 -march=native | ||
29 | # | 25 | # |
30 | # Currently LuaJIT builds by default as a 32 bit binary. Use this to force | 26 | # Use this if you want to force a 32 bit build on a 64 bit multilib OS. |
31 | # a native x64 build on Linux/x64: | 27 | #CC= gcc -m32 |
32 | #CC= gcc -m64 | ||
33 | # | 28 | # |
34 | # Since the assembler part does NOT maintain a frame pointer, it's pointless | 29 | # Since the assembler part does NOT maintain a frame pointer, it's pointless |
35 | # to slow down the C part by not omitting it. Debugging, tracebacks and | 30 | # to slow down the C part by not omitting it. Debugging, tracebacks and |
@@ -41,6 +36,13 @@ CCOPT= -O2 -fomit-frame-pointer | |||
41 | # Note: it's no longer recommended to use -O3 with GCC 4.x. | 36 | # Note: it's no longer recommended to use -O3 with GCC 4.x. |
42 | # The I-Cache bloat usually outweighs the benefits from aggressive inlining. | 37 | # The I-Cache bloat usually outweighs the benefits from aggressive inlining. |
43 | # | 38 | # |
39 | # It's recommended to compile at least for i686. By default the assembler part | ||
40 | # of the interpreter makes use of CMOV/FCOMI*/FUCOMI* instructions, anyway. | ||
41 | # For GCC 4.2 or higher and if you don't intend to distribute the | ||
42 | # binaries to a different machine you could also use: -march=native | ||
43 | CCOPT_X86= -march=i686 | ||
44 | CCOPT_X64= | ||
45 | # | ||
44 | CCDEBUG= | 46 | CCDEBUG= |
45 | # Uncomment the next line to generate debug information: | 47 | # Uncomment the next line to generate debug information: |
46 | #CCDEBUG= -g | 48 | #CCDEBUG= -g |
@@ -127,7 +129,8 @@ BUILDMODE= mixed | |||
127 | # LIBS HOST_LIBS TARGET_LIBS | 129 | # LIBS HOST_LIBS TARGET_LIBS |
128 | # CROSS HOST_SYS TARGET_SYS | 130 | # CROSS HOST_SYS TARGET_SYS |
129 | # | 131 | # |
130 | # Cross-compilation example: make CROSS=i586-mingw32msvc- TARGET_SYS=Windows | 132 | # Cross-compilation example: |
133 | # make CC="gcc -m32" CROSS=i586-mingw32msvc- TARGET_SYS=Windows | ||
131 | 134 | ||
132 | CCOPTIONS= $(CCDEBUG) $(CCOPT) $(CCWARN) $(XCFLAGS) $(CFLAGS) | 135 | CCOPTIONS= $(CCDEBUG) $(CCOPT) $(CCWARN) $(XCFLAGS) $(CFLAGS) |
133 | LDOPTIONS= $(CCDEBUG) $(LDFLAGS) | 136 | LDOPTIONS= $(CCDEBUG) $(LDFLAGS) |
@@ -176,6 +179,14 @@ ifneq (,$(findstring stack-protector,$(shell $(TARGET_CC) -dumpspecs))) | |||
176 | TARGET_XCFLAGS+= -fno-stack-protector | 179 | TARGET_XCFLAGS+= -fno-stack-protector |
177 | endif | 180 | endif |
178 | 181 | ||
182 | ifeq (,$(findstring __i386__,$(shell echo __i386__ | $(TARGET_CC) -P -E -))) | ||
183 | TARGET_CCARCH= x86 | ||
184 | TARGET_XCFLAGS+= $(CCOPT_X86) | ||
185 | else | ||
186 | TARGET_CCARCH= x64 | ||
187 | TARGET_XCFLAGS+= $(CCOPT_X64) | ||
188 | endif | ||
189 | |||
179 | ifneq (,$(PREFIX)) | 190 | ifneq (,$(PREFIX)) |
180 | ifneq (/usr/local,$(PREFIX)) | 191 | ifneq (/usr/local,$(PREFIX)) |
181 | TARGET_XCFLAGS+= -DLUA_XROOT=\"$(PREFIX)/\" | 192 | TARGET_XCFLAGS+= -DLUA_XROOT=\"$(PREFIX)/\" |