Browse code

Makefile.defs: detect gcc version 5.0+

- reported by Anthony Messina, GH #230

(cherry picked from commit 35e5da141569b8ace7c0a8fd743d02de6c0df525)

Daniel-Constantin Mierla authored on 14/07/2015 14:15:43
Showing 1 changed files
... ...
@@ -237,8 +237,10 @@ ifneq (,$(findstring gcc, $(CC_LONGVER)))
237 237
 					-e 's/4\.[2-4]\..*/4.2+/' \
238 238
 					-e 's/4\.[2-4]$$/4.2+/' \
239 239
 					-e 's/4\.[5-9]\..*/4.5+/' \
240
-					-e 's/4\.[5-9]$$/4.5+/')
241
-ifeq (,$(strip $(filter-out 3.0 3.4 4.x 4.2+ 4.5+,$(CC_SHORTVER))))
240
+					-e 's/4\.[5-9]$$/4.5+/' \
241
+					-e 's/5\.[0-9]\..*/5.0+/' \
242
+					-e 's/5\.[0-9]$$/5.0+/')
243
+ifeq (,$(strip $(filter-out 3.0 3.4 4.x 4.2+ 4.5+ 5.0+,$(CC_SHORTVER))))
242 244
 	# dependencies can be generated on-the-fly while compiling *.c
243 245
 	CC_MKDEP_OPTS=-MMD -MP
244 246
 endif # 3.0 <= $(CC_SHORTVER) <= 4.x
... ...
@@ -840,8 +842,8 @@ ifeq		($(CC_NAME), gcc)
840 842
 				C_DEFS+=-DCC_GCC_LIKE_ASM
841 843
 				#common stuff
842 844
 				CFLAGS=-g $(CC_OPT) -funroll-loops  -Wcast-align $(PROFILE)
843
-			#if gcc 4.5+ or 4.2+
844
-ifeq (,$(strip $(filter-out 4.2+ 4.5+,$(CC_SHORTVER))))
845
+			#if gcc 5.0+, 4.5+ or 4.2+
846
+ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+,$(CC_SHORTVER))))
845 847
 $(call				set_if_empty,CPU,athlon64)
846 848
 					CFLAGS+=-m32 -minline-all-stringops \
847 849
 							-falign-loops \
... ...
@@ -890,7 +892,7 @@ endif			# CC_SHORTVER, 2.9x
890 892
 endif			# CC_SHORTVER, 3.0
891 893
 endif			# CC_SHORTVER, 3.4
892 894
 endif			# CC_SHORTVER, 4.x
893
-endif			# CC_SHORTVER, 4.5+ or 4.2+
895
+endif			# CC_SHORTVER, 5.0+, 4.5+ or 4.2+
894 896
 
895 897
 else		# CC_NAME, gcc
896 898
 ifeq		($(CC_NAME), clang)
... ...
@@ -924,7 +926,7 @@ ifeq		($(CC_NAME), gcc)
924 926
 				CFLAGS=-g $(CC_OPT) -funroll-loops  -Wcast-align $(PROFILE)
925 927
 			#if gcc 4.5+
926 928
 			# don't add '-mtune=$(CPU)' - gcc failure
927
-ifeq			($(CC_SHORTVER), 4.5+)
929
+ifeq			($(CC_SHORTVER),$(filter $(CC_SHORTVER),4.5+ 5.0+))
928 930
 $(call				set_if_empty,CPU,opteron)
929 931
 					CFLAGS+=-m64 -minline-all-stringops \
930 932
 							-falign-loops \
... ...
@@ -983,7 +985,7 @@ endif			# CC_SHORTVER, 3.0
983 985
 endif			# CC_SHORTVER, 3.4
984 986
 endif			# CC_SHORTVER, 4.x
985 987
 endif			# CC_SHORTVER, 4.2+
986
-endif			# CC_SHORTVER, 4.5+
988
+endif			# CC_SHORTVER, 5.0+, 4.5+
987 989
 
988 990
 else		# CC_NAME, gcc
989 991
 ifeq            ($(CC_NAME), clang)
... ...
@@ -1018,8 +1020,8 @@ ifeq		($(CC_NAME), gcc)
1018 1020
 				CFLAGS=-g $(CC_OPT) -funroll-loops  $(PROFILE) \
1019 1021
 					#-Wcast-align \
1020 1022
 					#-Wmissing-prototypes 
1021
-				#if gcc 4.5+ or 4.2+
1022
-ifeq (,$(strip $(filter-out 4.2+ 4.5+,$(CC_SHORTVER))))
1023
+				#if gcc 5.0+, 4.5+ or 4.2+
1024
+ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+,$(CC_SHORTVER))))
1023 1025
 $(call				set_if_empty,CPU,ultrasparc)
1024 1026
 					#use 32bit for now
1025 1027
 					CFLAGS+=-m64 -mcpu=ultrasparc  \
... ...
@@ -1085,7 +1087,7 @@ endif			#CC_SHORTVER, 2.9x
1085 1087
 endif			#CC_SHORTVER, 3.0
1086 1088
 endif			#CC_SHORTVER, 3.4
1087 1089
 endif			#CC_SHORTVER, 4.x
1088
-endif			#CC_SHORTVER, 4.5+ or 4.2+
1090
+endif			#CC_SHORTVER, 5.0+, 4.5+ or 4.2+
1089 1091
 	
1090 1092
 else		#CC_NAME, gcc
1091 1093
 ifeq		($(CC_NAME), suncc)
... ...
@@ -1109,8 +1111,8 @@ ifeq		($(CC_NAME), gcc)
1109 1111
 				CFLAGS=-g $(CC_OPT) -funroll-loops  $(PROFILE) \
1110 1112
 					#-Wcast-align \
1111 1113
 					#-Wmissing-prototypes 
1112
-				#if gcc 4.5+ or 4.2+
1113
-ifeq (,$(strip $(filter-out 4.2+ 4.5+,$(CC_SHORTVER))))
1114
+				#if gcc 5.0+, 4.5+ or 4.2+
1115
+ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+,$(CC_SHORTVER))))
1114 1116
 $(call				set_if_empty,CPU,v8)
1115 1117
 					#use 32bit for now
1116 1118
 					CFLAGS+= -mtune=$(CPU) \
... ...
@@ -1151,7 +1153,7 @@ endif			#CC_SHORTVER, 2.9x
1151 1153
 endif			#CC_SHORTVER, 3.0
1152 1154
 endif			#CC_SHORTVER, 3.4
1153 1155
 endif			#CC_SHORTVER, 4.x
1154
-endif			#CC_SHORTVER, 4.5+ or 4.2+
1156
+endif			#CC_SHORTVER, 5.0+, 4.5+ or 4.2+
1155 1157
 	
1156 1158
 else		#CC_NAME, gcc
1157 1159
 ifeq		($(CC_NAME), suncc)
... ...
@@ -1173,7 +1175,7 @@ ifeq		($(CC_NAME), gcc)
1173 1175
 				#common stuff
1174 1176
 				CFLAGS=-marm -march=armv5t $(CC_OPT) -funroll-loops -fsigned-char $(PROFILE)
1175 1177
 			#if gcc 4.5+ or 4.2+
1176
-ifeq (,$(strip $(filter-out 4.2+ 4.5+,$(CC_SHORTVER))))
1178
+ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+,$(CC_SHORTVER))))
1177 1179
 					CFLAGS+= -ftree-vectorize -fno-strict-overflow
1178 1180
 					# not supported on arm: -minline-all-stringops 
1179 1181
 else
... ...
@@ -1205,7 +1207,7 @@ endif			# CC_SHORTVER, 2.9x
1205 1207
 endif			# CC_SHORTVER, 3.0
1206 1208
 endif			# CC_SHORTVER, 3.4
1207 1209
 endif			# CC_SHORTVER, 4.x
1208
-endif			# CC_SHORTVER, 4.5+ or 4.2+
1210
+endif			# CC_SHORTVER, 5.0+, 4.5+ or 4.2+
1209 1211
 	
1210 1212
 else		# CC_NAME, gcc
1211 1213
 				#other compilers
... ...
@@ -1221,8 +1223,8 @@ ifeq		($(CC_NAME), gcc)
1221 1223
 				#common stuff
1222 1224
 				CFLAGS=-march=armv6 $(CC_OPT) -funroll-loops -fsigned-char \
1223 1225
 						$(PROFILE)
1224
-			#if gcc 4.5+ or 4.2+
1225
-ifeq (,$(strip $(filter-out 4.2+ 4.5+,$(CC_SHORTVER))))
1226
+			#if gcc 5.0+, 4.5+ or 4.2+
1227
+ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+,$(CC_SHORTVER))))
1226 1228
 					CFLAGS+= -ftree-vectorize -fno-strict-overflow
1227 1229
 else
1228 1230
 			#if gcc 4.x+
... ...
@@ -1252,7 +1254,7 @@ endif			# CC_SHORTVER, 2.9x
1252 1254
 endif			# CC_SHORTVER, 3.0
1253 1255
 endif			# CC_SHORTVER, 3.4
1254 1256
 endif			# CC_SHORTVER, 4.x
1255
-endif			# CC_SHORTVER, 4.5+ or 4.2+
1257
+endif			# CC_SHORTVER, 5.0+, 4.5+ or 4.2+
1256 1258
 	
1257 1259
 else		# CC_NAME, gcc
1258 1260
 				#other compilers
... ...
@@ -1267,8 +1269,8 @@ ifeq		($(CC_NAME), gcc)
1267 1269
 				C_DEFS+=-DCC_GCC_LIKE_ASM
1268 1270
 				#common stuff
1269 1271
 				CFLAGS=$(CC_OPT) -funroll-loops  $(PROFILE)
1270
-			#if gcc 4.5+ or 4.2+
1271
-ifeq (,$(strip $(filter-out 4.2+ 4.5+,$(CC_SHORTVER))))
1272
+			#if gcc 5.0+, 4.5+ or 4.2+
1273
+ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+,$(CC_SHORTVER))))
1272 1274
 					CFLAGS+=-march=r3000 -minline-all-stringops \
1273 1275
 							-ftree-vectorize -fno-strict-overflow
1274 1276
 else
... ...
@@ -1299,7 +1301,7 @@ endif			# CC_SHORTVER, 2.9x
1299 1301
 endif			# CC_SHORTVER, 3.0
1300 1302
 endif			# CC_SHORTVER, 3.4
1301 1303
 endif			# CC_SHORTVER, 4.x
1302
-endif			# CC_SHORTVER, 4.5+ or 4.2+
1304
+endif			# CC_SHORTVER, 5.0+, 4.5+ or 4.2+
1303 1305
 	
1304 1306
 else		# CC_NAME, gcc
1305 1307
 				#other compilers
... ...
@@ -1314,8 +1316,8 @@ ifeq		($(CC_NAME), gcc)
1314 1316
 				C_DEFS+=-DCC_GCC_LIKE_ASM
1315 1317
 				#common stuff
1316 1318
 				CFLAGS= -mips2 $(CC_OPT) -funroll-loops $(PROFILE)
1317
-			#if gcc 4.5+ or 4.2+
1318
-ifeq (,$(strip $(filter-out 4.2+ 4.5+,$(CC_SHORTVER))))
1319
+			#if gcc 5.0+, 4.5+ or 4.2+
1320
+ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+,$(CC_SHORTVER))))
1319 1321
 					CFLAGS+=-minline-all-stringops -ftree-vectorize \
1320 1322
 							-fno-strict-overflow
1321 1323
 else
... ...
@@ -1344,7 +1346,7 @@ endif			# CC_SHORTVER, 2.9x
1344 1346
 endif			# CC_SHORTVER, 3.0
1345 1347
 endif			# CC_SHORTVER, 3.4
1346 1348
 endif			# CC_SHORTVER, 4.x
1347
-endif			# CC_SHORTVER, 4.5+ or 4.2+
1349
+endif			# CC_SHORTVER, 5.0+, 4.5+ or 4.2+
1348 1350
 	
1349 1351
 else		# CC_NAME, gcc
1350 1352
 				#other compilers
... ...
@@ -1359,8 +1361,8 @@ ifeq		($(CC_NAME), gcc)
1359 1361
 				C_DEFS+=-DCC_GCC_LIKE_ASM
1360 1362
 				#common stuff
1361 1363
 				CFLAGS= -mips64 $(CC_OPT) -funroll-loops $(PROFILE)
1362
-			#if gcc 4.5+ or 4.2+
1363
-ifeq (,$(strip $(filter-out 4.2+ 4.5+,$(CC_SHORTVER))))
1364
+			#if gcc 5.0+, 4.5+ or 4.2+
1365
+ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+,$(CC_SHORTVER))))
1364 1366
 					CFLAGS+=-minline-all-stringops -ftree-vectorize \
1365 1367
 							-fno-strict-overflow
1366 1368
 else
... ...
@@ -1389,7 +1391,7 @@ endif			# CC_SHORTVER, 2.9x
1389 1391
 endif			# CC_SHORTVER, 3.0
1390 1392
 endif			# CC_SHORTVER, 3.4
1391 1393
 endif			# CC_SHORTVER, 4.x
1392
-endif			# CC_SHORTVER, 4.5+ or 4.2+
1394
+endif			# CC_SHORTVER, 5.0+, 4.5+ or 4.2+
1393 1395
 	
1394 1396
 else		# CC_NAME, gcc
1395 1397
 				#other compilers
... ...
@@ -1404,8 +1406,8 @@ ifeq		($(CC_NAME), gcc)
1404 1406
 				C_DEFS+=-DCC_GCC_LIKE_ASM
1405 1407
 				#common stuff
1406 1408
 				CFLAGS= $(CC_OPT) -funroll-loops $(PROFILE)
1407
-			#if gcc 4.5 or 4.2+
1408
-ifeq (,$(strip $(filter-out 4.2+ 4.5+,$(CC_SHORTVER))))
1409
+			#if gcc 5.0+, 4.5 or 4.2+
1410
+ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+,$(CC_SHORTVER))))
1409 1411
 					CFLAGS+= -fno-strict-overflow
1410 1412
 					# not supported: -minline-all-stringops
1411 1413
 else
... ...
@@ -1435,7 +1437,7 @@ endif			# CC_SHORTVER, 2.9x
1435 1437
 endif			# CC_SHORTVER, 3.0
1436 1438
 endif			# CC_SHORTVER, 3.4
1437 1439
 endif			# CC_SHORTVER, 4.x
1438
-endif			# CC_SHORTVER, 4.5+ or 4.2+
1440
+endif			# CC_SHORTVER, 5.0+, 4.5+ or 4.2+
1439 1441
 	
1440 1442
 else		# CC_NAME, gcc
1441 1443
 				#other compilers
... ...
@@ -1450,8 +1452,8 @@ ifeq		($(CC_NAME), gcc)
1450 1452
 				C_DEFS+=-DCC_GCC_LIKE_ASM
1451 1453
 				#common stuff
1452 1454
 				CFLAGS=
1453
-			#if gcc 4.5+ or 4.2+
1454
-ifeq (,$(strip $(filter-out 4.2+ 4.5+,$(CC_SHORTVER))))
1455
+			#if gcc 5.0+, 4.5+ or 4.2+
1456
+ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+,$(CC_SHORTVER))))
1455 1457
 $(call				set_if_empty,CPU,powerpc)
1456 1458
 ifeq 				($(NOALTIVEC),)
1457 1459
 						CFLAGS += $(CC_OPT) -funroll-loops -fsigned-char $(PROFILE)
... ...
@@ -1492,7 +1494,7 @@ endif			# CC_SHORTVER, 2.9x
1492 1494
 endif			# CC_SHORTVER, 3.0
1493 1495
 endif			# CC_SHORTVER, 3.4
1494 1496
 endif			# CC_SHORTVER, 4.x
1495
-endif			# CC_SHORTVER, 4.5+ or 4.2+
1497
+endif			# CC_SHORTVER, 5.0+, 4.5+ or 4.2+
1496 1498
 	
1497 1499
 else		# CC_NAME, gcc
1498 1500
 				#other compilers
... ...
@@ -1507,8 +1509,8 @@ ifeq		($(CC_NAME), gcc)
1507 1509
 				C_DEFS+=-DCC_GCC_LIKE_ASM
1508 1510
 				#common stuff
1509 1511
 				CFLAGS= $(CC_OPT) -funroll-loops -fsigned-char $(PROFILE)
1510
-			#if gcc 4.5+ or 4.2+
1511
-ifeq (,$(strip $(filter-out 4.2+ 4.5+,$(CC_SHORTVER))))
1512
+			#if gcc 5.0+, 4.5+ or 4.2+
1513
+ifeq (,$(strip $(filter-out 4.2+ 4.5+ 5.0+,$(CC_SHORTVER))))
1512 1514
 $(call				set_if_empty,CPU,powerpc64)
1513 1515
 					CFLAGS+=-ftree-vectorize \
1514 1516
 							-fno-strict-overflow \
... ...
@@ -1541,7 +1543,7 @@ endif			# CC_SHORTVER, 2.9x
1541 1543
 endif			# CC_SHORTVER, 3.0
1542 1544
 endif			# CC_SHORTVER, 3.4
1543 1545
 endif			# CC_SHORTVER, 4.x
1544
-endif			# CC_SHORTVER, 4.5+ or 4.2+
1546
+endif			# CC_SHORTVER, 5.0+, 4.5+ or 4.2+
1545 1547
 	
1546 1548
 else		# CC_NAME, gcc
1547 1549
 				#other compilers