From e3bc65fa6d34f343edd70d2804a3912ec160e596 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 7 Feb 2013 22:25:18 +0100 Subject: [PATCH] Try to detect if we have GCC 4.2 or higher for enabling -march=native --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 913767f..5e124d2 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,13 @@ TARGET = sparsebundlefs PKG_CONFIG = pkg-config -CFLAGS = -Wall -O2 -march=native +CFLAGS = -Wall -O2 + +GCC_4_2_OR_HIGHER := $(shell expr `$(CXX) -dumpversion | sed 's/\.//g'` \>= 420) +ifeq "$(GCC_4_2_OR_HIGHER)" "1" + CFLAGS += -march=native +endif + DEFINES = -DFUSE_USE_VERSION=26 ifeq ($(shell uname), Darwin)