ref: 24f8f2138a3c9f087808e86a4259d75465c3452e
parent: 473f2e3d422ae80756cd32ee5a43e3671c07b28e
author: Martin Storsjö <[email protected]>
date: Mon Apr 20 07:47:41 EDT 2015
Use ARCH instead of ENABLE64BIT for distinguishing between x86 and x86_64 Keep support for the ENABLE64BIT flag (as a flag for choosing between 32 and 64 bit, if the current arch happens to be x86) but avoid using it in code that wants to know the exact architecture used. This makes the platform build files more straightforward and consistent.
--- a/build/msvc-common.mk
+++ b/build/msvc-common.mk
@@ -1,6 +1,6 @@
include $(SRC_PATH)build/arch.mk
ifeq ($(ASM_ARCH), x86)
-ifeq ($(ENABLE64BIT), Yes)
+ifeq ($(ARCH), x86_64)
ASMFLAGS += -f win64
ASMFLAGS_PLATFORM = -DWIN64
else
--- a/build/platform-darwin.mk
+++ b/build/platform-darwin.mk
@@ -10,7 +10,7 @@
LDFLAGS += -lpthread
ifeq ($(ASM_ARCH), x86)
ASMFLAGS += -DPREFIX
-ifeq ($(ENABLE64BIT), Yes)
+ifeq ($(ARCH), x86_64)
ASMFLAGS += -f macho64
else
ASMFLAGS += -f macho
--- a/build/platform-freebsd.mk
+++ b/build/platform-freebsd.mk
@@ -5,7 +5,7 @@
CFLAGS += -fPIC
LDFLAGS += -lpthread
ifeq ($(ASM_ARCH), x86)
-ifeq ($(ENABLE64BIT), Yes)
+ifeq ($(ARCH), x86_64)
ASMFLAGS += -f elf64
else
ASMFLAGS += -f elf
--- a/build/platform-linux.mk
+++ b/build/platform-linux.mk
@@ -5,7 +5,7 @@
CFLAGS += -Wall -fno-strict-aliasing -fPIC -MMD -MP
LDFLAGS += -lpthread
ifeq ($(ASM_ARCH), x86)
-ifeq ($(ENABLE64BIT), Yes)
+ifeq ($(ARCH), x86_64)
ASMFLAGS += -f elf64
else
ASMFLAGS += -f elf
--- a/build/platform-mingw_nt.mk
+++ b/build/platform-mingw_nt.mk
@@ -6,7 +6,7 @@
SHLDFLAGS = -Wl,--out-implib,$(EXTRA_LIBRARY)
CFLAGS += -MMD -MP
LDFLAGS +=
-ifeq ($(ENABLE64BIT), Yes)
+ifeq ($(ARCH), x86_64)
ASMFLAGS += -f win64
ASMFLAGS_PLATFORM = -DWIN64
CC = x86_64-w64-mingw32-gcc
--- a/build/x86-common.mk
+++ b/build/x86-common.mk
@@ -1,12 +1,14 @@
CFLAGS_M32=-m32
CFLAGS_M64=-m64
ASM_INCLUDES = -I$(SRC_PATH)codec/common/x86/
-ifeq (, $(ENABLE64BIT))
-ifeq ($(ARCH), x86_64)
-ENABLE64BIT=Yes
+ifneq ($(ENABLE64BIT),)
+ifeq ($(ENABLE64BIT), Yes)
+ARCH = x86_64
+else
+ARCH = x86
endif
endif
-ifeq ($(ENABLE64BIT), Yes)
+ifeq ($(ARCH), x86_64)
CFLAGS += $(CFLAGS_M64)
LDFLAGS += $(CFLAGS_M64)
ASMFLAGS_PLATFORM = -DUNIX64
@@ -17,7 +19,7 @@
endif
ifeq ($(USE_ASM),Yes)
CFLAGS += -DX86_ASM
-ifneq ($(ENABLE64BIT), Yes)
+ifneq ($(ARCH), x86_64)
CFLAGS += -DX86_32_ASM
endif
ASM_ARCH = x86