Recently attempted to compile dpdk-2.2.0 on OpenSUSE tumbleweed,mk/toolchain/gcc/rte.toolchain-compat.mk error, said GCC version is less than 4.X; look, gcc. Version is 5.X. And the upstream version does not have this problem
Compare upstream changes and learn how to use gcc micros directly in Makefile to get version number information :
Commit A5c5b9f76767badb3f198326bd5cbbebba803e36
Author:markos Chandras <[email protected]>
Date:tue Mar A -: -: $ . +0000
Mk:fixGCC-5version on Suse
In OpenSUSE tumbleweed ( andinchAny other SUSE distributionwhich
uses (or would use)GCC>=5), GCC-dumpversionreturns'5'. on
Purpose as discussedinchhttps://bugzilla.opensuse.org/show_bug.cgi?id=941428
As a result ofwhich, theGCC-4. x comparison ( +against5) does not
Work leading to tons of warnings and failures during build.
ThisPatchaims to change theGCCversion is obtained by U
Sing
the GCC macros directly.
This is similar's being used in the Linux kernel. Querying the
GCC macros directly gives Moreaccurate results compared to-dumpversion
whichcould vary across distributions.
Signed-off-by:markos Chandras <[email protected]>
acked-by:thomas Monjalon <[email protected]>
diff--git a/mk/toolchain/GCC/rte.toolchain-compat.mk b/mk/toolchain/GCC/rte.toolchain-compat.mk
Index e144216: 6eed20c100644
---a/mk/toolchain/GCC/rte.toolchain-compat.mk
+ + b/mk/toolchain/GCC/rte.toolchain-compat.mk
@@ - -,7 + -,9 @@
#FindOut GCC version
-gcc_version = $ (subst.,, $ (Shell $ (CC)-dumpversion |Cut-f1-2-D.))
+gcc_major = $ (ShellEcho __gnuc__| $ (CC)-e-x C-|Tail- N1)
+gcc_minor = $ (ShellEcho __gnuc_minor__| $ (CC)-e-x C-|Tail- N1)
+gcc_version = $ (gcc_major) $ (gcc_minor)
Get version number using GCC Micros