|
@@ -27,6 +27,7 @@ CFLAGS=""
|
|
TOOLCHAIN="."
|
|
TOOLCHAIN="."
|
|
|
|
|
|
LIBC_TYPE=""
|
|
LIBC_TYPE=""
|
|
|
|
+GCC_VERSION=""
|
|
|
|
|
|
|
|
|
|
# Library specs
|
|
# Library specs
|
|
@@ -199,6 +200,19 @@ find_bins() {
|
|
return 1
|
|
return 1
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+find_gcc_version() {
|
|
|
|
+ if [ -f $TOOLCHAIN/info.mk ]; then
|
|
|
|
+ GCC_VERSION=$(grep GCC_VERSION $TOOLCHAIN/info.mk | sed 's/GCC_VERSION=//')
|
|
|
|
+ return 0
|
|
|
|
+ fi
|
|
|
|
+
|
|
|
|
+ echo "Warning! Can't find info.mk, trying to detect with alternative way."
|
|
|
|
+
|
|
|
|
+ # Very fragile detection
|
|
|
|
+ GCC_VERSION=$(find $TOOLCHAIN/bin | grep -oE "gcc-[0-9]+\.[0-9]+\.[0-9]+$" | \
|
|
|
|
+ head -1 | sed 's/gcc-//')
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
|
|
wrap_bin_cc() {
|
|
wrap_bin_cc() {
|
|
local out="$1"
|
|
local out="$1"
|
|
@@ -383,6 +397,13 @@ print_config() {
|
|
return 1
|
|
return 1
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
+ if [ -n "$GCC_VERSION" ]; then
|
|
|
|
+ echo "CONFIG_EXTERNAL_GCC_VERSION=\"$GCC_VERSION\"" >> "$config"
|
|
|
|
+ else
|
|
|
|
+ echo "Can't detect GCC version. Aborting!" >&2
|
|
|
|
+ return 1
|
|
|
|
+ fi
|
|
|
|
+
|
|
local lib
|
|
local lib
|
|
for lib in C RT PTHREAD GCC STDCPP SSP GFORTRAN GOMP; do
|
|
for lib in C RT PTHREAD GCC STDCPP SSP GFORTRAN GOMP; do
|
|
local file
|
|
local file
|
|
@@ -564,6 +585,7 @@ while [ -n "$1" ]; do
|
|
--config)
|
|
--config)
|
|
if probe_cc; then
|
|
if probe_cc; then
|
|
probe_libc
|
|
probe_libc
|
|
|
|
+ find_gcc_version
|
|
print_config "$1"
|
|
print_config "$1"
|
|
exit $?
|
|
exit $?
|
|
fi
|
|
fi
|