Dynamically switch between system and Chromium's libc++ by glibc version. Restore jumbo.

This commit is contained in:
Mikhail Novosyolov 2018-10-17 14:50:41 +03:00
parent b913cc57a1
commit 4a57b79d9d

View file

@ -417,12 +417,24 @@ CFLAGS="$CFLAGS -Wno-error=pointer-to-int-cast -Wno-error=int-to-pointer-cast"
CXXFLAGS="$CXXFLAGS -Wno-error=attributes -Wno-error=comment -Wno-error=unused-variable -Wno-error=strict-overflow -Wno-error=deprecated-declarations" CXXFLAGS="$CXXFLAGS -Wno-error=attributes -Wno-error=comment -Wno-error=unused-variable -Wno-error=strict-overflow -Wno-error=deprecated-declarations"
%endif %endif
echo "DEBUG: Compile flags are: CFLAGS: $CFLAGS , CXXFLAGS: $CXXFLAGS , LDFLAGS: $LDFLAGS" || true # If system glibc is too old, use Chromium's built-in libc++, otherwise use system libc++.
# Shell does not or may not understand not integer values correctly,
# so remove the dot by sed to make the value of the glibc version an integer.
glibc_version="$(rpm -q --queryformat "%{VERSION}" glibc | sed -e 's/\.//g')"
# -lt means 'less than'
# glibc 2.27 is used as a stop point, because today (17.10.2018) Chromium
# is built with system glibc 2.27 in ALT Sisyphus,
# ROSA has glibc 2.25, and chromium 69 is unbuildable with it
if [ "$glibc_version" -lt 227 ]
then use_custom_libcxx='true'
else use_custom_libcxx='false'
fi
echo "DEBUG: use_custom_libcxx = ${use_custom_libcxx}"
# v NO TABS IN HERE! # v NO TABS IN HERE!
%define gn_config use_sysroot=false \ %define gn_config use_sysroot=false \
system_libdir="%{_lib}" \ system_libdir="%{_lib}" \
use_custom_libcxx=false \ use_custom_libcxx="${use_custom_libcxx}" \
icu_use_data_file=true \ icu_use_data_file=true \
enable_nacl=false \ enable_nacl=false \
optimize_webui=true \ optimize_webui=true \
@ -465,12 +477,12 @@ echo "DEBUG: Compile flags are: CFLAGS: $CFLAGS , CXXFLAGS: $CXXFLAGS , LDFLAGS:
v8_use_external_startup_data=false \ v8_use_external_startup_data=false \
google_api_key="%{google_api_key}" \ google_api_key="%{google_api_key}" \
google_default_client_id="%{google_default_client_id}" \ google_default_client_id="%{google_default_client_id}" \
google_default_client_secret="%{google_default_client_secret}" google_default_client_secret="%{google_default_client_secret}" \
use_jumbo_build=true \
jumbo_file_merge_limit = %{is_limit}
#extra_cxxflags="${CXXFLAGS}" \ #extra_cxxflags="${CXXFLAGS}" \
#extra_ldflags="${LDFLAGS}" \ #extra_ldflags="${LDFLAGS}" \
#is_nacl_glibc=false \ #is_nacl_glibc=false \
#use_jumbo_build=true \
#jumbo_file_merge_limit = %{is_limit} \
%define system_gn_list ffmpeg flac libxslt snappy yasm libdrm fontconfig freetype harfbuzz-ng %define system_gn_list ffmpeg flac libxslt snappy yasm libdrm fontconfig freetype harfbuzz-ng
# libpng, libtiff # libpng, libtiff