diff options
| author | Mike Pall <mike> | 2010-08-27 18:17:29 +0200 |
|---|---|---|
| committer | Mike Pall <mike> | 2010-08-27 18:17:29 +0200 |
| commit | b3bd9b55e0e1e7dd8037554a6d5d0f0f261cc60d (patch) | |
| tree | f30a9d366d099a7aae57617a16be4849bb6a60ff | |
| parent | a8d23e84e6e48637adb14295b098eb7800a19b0a (diff) | |
| download | luajit-b3bd9b55e0e1e7dd8037554a6d5d0f0f261cc60d.tar.gz luajit-b3bd9b55e0e1e7dd8037554a6d5d0f0f261cc60d.tar.bz2 luajit-b3bd9b55e0e1e7dd8037554a6d5d0f0f261cc60d.zip | |
Improve target architecture detection in src/Makefile.
| -rw-r--r-- | src/Makefile | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/Makefile b/src/Makefile index 24d32656..ed1be4ba 100644 --- a/src/Makefile +++ b/src/Makefile | |||
| @@ -42,6 +42,7 @@ CCOPT= -O2 -fomit-frame-pointer | |||
| 42 | # binaries to a different machine you could also use: -march=native | 42 | # binaries to a different machine you could also use: -march=native |
| 43 | CCOPT_X86= -march=i686 | 43 | CCOPT_X86= -march=i686 |
| 44 | CCOPT_X64= | 44 | CCOPT_X64= |
| 45 | CCOPT_PPCSPE= | ||
| 45 | # | 46 | # |
| 46 | CCDEBUG= | 47 | CCDEBUG= |
| 47 | # Uncomment the next line to generate debug information: | 48 | # Uncomment the next line to generate debug information: |
| @@ -179,12 +180,22 @@ ifneq (,$(findstring stack-protector,$(shell $(TARGET_CC) -dumpspecs))) | |||
| 179 | TARGET_XCFLAGS+= -fno-stack-protector | 180 | TARGET_XCFLAGS+= -fno-stack-protector |
| 180 | endif | 181 | endif |
| 181 | 182 | ||
| 182 | ifeq (,$(findstring __i386__,$(shell echo __i386__ | $(TARGET_CC) -P -E -))) | 183 | TARGET_TESTARCH=$(shell $(TARGET_CC) $(TARGET_ACFLAGS) -E lj_arch.h -dM) |
| 184 | ifneq (,$(findstring LJ_TARGET_X64 ,$(TARGET_TESTARCH))) | ||
| 185 | TARGET_CCARCH= x64 | ||
| 186 | TARGET_XCFLAGS+= $(CCOPT_X64) | ||
| 187 | else | ||
| 188 | ifneq (,$(findstring LJ_TARGET_X86 ,$(TARGET_TESTARCH))) | ||
| 183 | TARGET_CCARCH= x86 | 189 | TARGET_CCARCH= x86 |
| 184 | TARGET_XCFLAGS+= $(CCOPT_X86) | 190 | TARGET_XCFLAGS+= $(CCOPT_X86) |
| 185 | else | 191 | else |
| 186 | TARGET_CCARCH= x64 | 192 | ifneq (,$(findstring LJ_TARGET_PPCSPE ,$(TARGET_TESTARCH))) |
| 187 | TARGET_XCFLAGS+= $(CCOPT_X64) | 193 | TARGET_CCARCH= ppcspe |
| 194 | TARGET_XCFLAGS+= $(CCOPT_PPCSPE) | ||
| 195 | else | ||
| 196 | $(error Unsupported target architecture) | ||
| 197 | endif | ||
| 198 | endif | ||
| 188 | endif | 199 | endif |
| 189 | 200 | ||
| 190 | ifneq (,$(PREFIX)) | 201 | ifneq (,$(PREFIX)) |
