Enable gcc's link time optimization
[SXSI/libcds.git] / src / Makefile
index aaec1e9..033d2db 100644 (file)
@@ -1,6 +1,14 @@
 CPP=g++
+POPCOUNT=$(shell grep -q popcnt /proc/cpuinfo && echo 1)
 
-CPPFLAGS=-O3 -Wall -DNDEBUG -fno-PIC
+ifeq ($(POPCOUNT), 1)
+       POPCOUNT_FLAG=-DHAS_NATIVE_POPCOUNT
+else
+#POPCOUNT_FLAG=-DHAS_POPCOUNT_TABLE
+       POPCOUNT_FLAG=
+endif
+
+CPPFLAGS=-O3 -Wall -DNDEBUG -fno-PIC $(POPCOUNT_FLAG) -flto
 
 INCL=-I../includes/