From 5efb0a9a33edba18c9b215cb4c2cee15174918c5 Mon Sep 17 00:00:00 2001 From: Varun B Patil Date: Tue, 28 Jan 2014 12:35:36 +0530 Subject: [PATCH] Attempt to detect OS arch(32/64 bit) on most platforms Attempt to automatically detect 32bit or 64bit OS architecture in Makefile, unless user has specified preference on the command line. --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 690fa322..a5bd524d 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ UNAME=$(shell uname | tr A-Z a-z | tr -d \\-[:digit:].) +ARCH=$(shell uname -m) LIBPREFIX=lib LIBSUFFIX=a CXX_O=-o $@ @@ -11,7 +12,11 @@ CFLAGS_M32=-m32 CFLAGS_M64=-m64 BUILDTYPE=Release - +ifeq (, $(ENABLE64BIT)) +ifeq ($(ARCH), x86_64) +ENABLE64BIT=Yes +endif +endif ifeq (,$(wildcard ./gtest)) HAVE_GTEST=No