Define TCC_ARM_EABI if using hardfloat ABI
authorThomas Preud'homme <robotux@celest.fr>
Mon, 19 Nov 2012 11:04:25 +0000 (19 12:04 +0100)
committerThomas Preud'homme <robotux@celest.fr>
Tue, 20 Nov 2012 10:36:13 +0000 (20 11:36 +0100)
TCC_ARM_EABI should be defined when compiling with hardfloat calling
convention. This commit rework the Makefile to distinguish between
calling convention and multiarch and define TCC_ARM_EABI when hardfloat
calling convention is used. The result is to first guess the calling
convention and then add the multiarch triplet if necessary.

Makefile

index 406695b..48ce697 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -69,11 +69,14 @@ endif
 ifeq ($(ARCH),arm)
 NATIVE_DEFINES=-DTCC_TARGET_ARM
 NATIVE_DEFINES+=-DWITHOUT_LIBTCC
-NATIVE_DEFINES+=$(if $(wildcard /lib/ld-linux.so.3),-DTCC_ARM_EABI)
-ifneq (,$(wildcard /lib/arm-linux-gnueabi))
-NATIVE_DEFINES+=-DCONFIG_MULTIARCHDIR=\"arm-linux-gnueabi\"
+ifneq (,$(wildcard /lib/ld-linux.so.3))
+NATIVE_DEFINES+=-DTCC_ARM_EABI
+NATIVE_DEFINES+=$(if $(wildcard /lib/arm-linux-gnueabi), -DCONFIG_MULTIARCHDIR=\"arm-linux-gnueabi\")
 else
-NATIVE_DEFINES+=$(if $(wildcard /lib/arm-linux-gnueabihf),-DCONFIG_MULTIARCHDIR=\"arm-linux-gnueabihf\" -DTCC_ARM_HARDFLOAT)
+ifneq (,$(wildcard /lib/ld-linux-armhf.so.3 /lib/arm-linux-gnueabihf/ld-linux.so.3))
+NATIVE_DEFINES+=-DTCC_ARM_EABI -DTCC_ARM_HARDFLOAT
+NATIVE_DEFINES+=$(if $(wildcard /lib/arm-linux-gnueabihf),-DCONFIG_MULTIARCHDIR=\"arm-linux-gnueabihf\")
+endif
 endif
 NATIVE_DEFINES+=$(if $(shell grep -l "^Features.* \(vfp\|iwmmxt\) " /proc/cpuinfo),-DTCC_ARM_VFP)
 endif