configure & build: Rework legacy GCC detection to parse versions outside of Jam.
Jam comparison logic is string-based, and so was detecting GCC >= 10 as being < 2. This rectifies that by removing the GCC version parsing from Jam logic entirely, and setting various BuildConfig variables instead. Change-Id: I0c0ae3b9002fb5e77f9ca7a78600c91871657f03 Reviewed-on: https://review.haiku-os.org/c/haiku/+/3293 Reviewed-by: Adrien Destugues <[email protected]> Reviewed-by: Jérôme Duval <[email protected]> Reviewed-by: Alex von Gluck IV <[email protected]>
This commit is contained in:
committed by
Alex von Gluck IV
parent
a3f0a36a79
commit
47320dd0ab
@@ -239,12 +239,9 @@ HOST_ARCH ?= $(HOST_CPU) ;
|
||||
HOST_ARCHS = $(HOST_ARCH) ;
|
||||
HOST_KERNEL_ARCH = host ;
|
||||
|
||||
# analyze GCC version
|
||||
HOST_GCC_VERSION = [ FAnalyzeGCCVersion HOST_GCC_RAW_VERSION ] ;
|
||||
|
||||
# set packaging architecture
|
||||
HOST_PACKAGING_ARCH ?= $(HOST_CPU) ;
|
||||
if $(HOST_PACKAGING_ARCH) = x86 && $(HOST_GCC_VERSION[1]) = 2 {
|
||||
if $(HOST_PACKAGING_ARCH) = x86 && $(HOST_CC_IS_LEGACY_GCC) = 1 {
|
||||
HOST_PACKAGING_ARCH = x86_gcc2 ;
|
||||
}
|
||||
HOST_PACKAGING_ARCHS = $(HOST_PACKAGING_ARCH) ;
|
||||
@@ -276,7 +273,7 @@ HOST_C++FLAGS += -Wno-multichar ;
|
||||
HOST_PIC_CCFLAGS += -fPIC ;
|
||||
HOST_PIC_C++FLAGS += -fPIC ;
|
||||
|
||||
if $(HOST_GCC_VERSION[1]) >= 3 {
|
||||
if $(HOST_CC_IS_LEGACY_GCC) != 1 {
|
||||
HOST_GCC_BASE_FLAGS += -fno-strict-aliasing -fno-delete-null-pointer-checks ;
|
||||
}
|
||||
|
||||
@@ -306,7 +303,7 @@ if $(HOST_ARCH) = m68k {
|
||||
if $(HOST_PLATFORM) != darwin {
|
||||
# fix for new changes to DSO linking policies
|
||||
HOST_LINKFLAGS += -Xlinker --no-as-needed ;
|
||||
if $(HOST_GCC_VERSION[1]) >= 3 {
|
||||
if $(HOST_CC_IS_LEGACY_GCC) != 1 {
|
||||
HOST_LINKFLAGS += -Wl,--copy-dt-needed-entries ;
|
||||
}
|
||||
}
|
||||
@@ -382,7 +379,7 @@ HOST_LIBBE = libbe_build.so ;
|
||||
|
||||
if $(HOST_PLATFORM_HAIKU_COMPATIBLE) {
|
||||
# the C++ standard and support libraries
|
||||
if $(HOST_GCC_VERSION[1]) < 3 {
|
||||
if $(HOST_CC_IS_LEGACY_GCC) = 1 {
|
||||
HOST_LIBSTDC++ = stdc++.r4 ;
|
||||
HOST_LIBSUPC++ = ;
|
||||
} else {
|
||||
@@ -418,7 +415,7 @@ if $(HOST_PLATFORM_HAIKU_COMPATIBLE) {
|
||||
HOST_PTHREAD_LINKFLAGS = -pthread ;
|
||||
|
||||
# the C++ support library
|
||||
if $(HOST_GCC_VERSION[1]) < 3 {
|
||||
if $(HOST_CC_IS_LEGACY_GCC) = 1 {
|
||||
HOST_LIBSUPC++ = ;
|
||||
} else {
|
||||
HOST_LIBSUPC++ = supc++ ;
|
||||
@@ -586,10 +583,12 @@ local buildVars =
|
||||
;
|
||||
|
||||
local archDependentBuildVars =
|
||||
ARCH CPU GCC_VERSION
|
||||
ARCH CPU
|
||||
|
||||
AR CC C++ ELFEDIT LD OBJCOPY RANLIB STRIP
|
||||
|
||||
CC_IS_LEGACY_GCC CC_IS_CLANG
|
||||
|
||||
ARFLAGS ASFLAGS UNARFLAGS CPPFLAGS CCFLAGS C++FLAGS HDRS LDFLAGS
|
||||
LINK LINKFLAGS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user