mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-07 05:35:02 -05:00
configure: minor ux improvements when compiling macos sim
- Show a warning when Apple's clang is detected, because compilation would fail with it. Then check for a (e.g.) Homebrew-installed version of GCC (14) and use it instead. - Don't display multiple meaningless numbers when (incorrectly) parsing Apple's current LD version info. Set to 0 on Darwin, unless cross-compiling, since it only matters in the latter case. Change-Id: I52236e1d1c349e30850c7786736d820c25b6d2d8
This commit is contained in:
parent
87452d775e
commit
c754bc5870
1 changed files with 17 additions and 11 deletions
28
tools/configure
vendored
28
tools/configure
vendored
|
|
@ -16,6 +16,9 @@ LDOPTS=""
|
||||||
GLOBAL_LDOPTS=""
|
GLOBAL_LDOPTS=""
|
||||||
LDMAP_OPT="-Map"
|
LDMAP_OPT="-Map"
|
||||||
|
|
||||||
|
HOSTCC=gcc
|
||||||
|
HOSTAR=ar
|
||||||
|
|
||||||
extradefines=""
|
extradefines=""
|
||||||
use_logf="#undef ROCKBOX_HAS_LOGF"
|
use_logf="#undef ROCKBOX_HAS_LOGF"
|
||||||
use_bootchart="#undef DO_BOOTCHART"
|
use_bootchart="#undef DO_BOOTCHART"
|
||||||
|
|
@ -392,6 +395,14 @@ simcc () {
|
||||||
Darwin)
|
Darwin)
|
||||||
sigaltstack=`check_sigaltstack`
|
sigaltstack=`check_sigaltstack`
|
||||||
echo "Darwin host detected"
|
echo "Darwin host detected"
|
||||||
|
if $CC --version | grep -q "clang"; then
|
||||||
|
echo "[Warning] Clang compiler ($CC) in your path is unsupported. Trying gcc-14."
|
||||||
|
CC=gcc-14
|
||||||
|
HOSTCC=gcc-14
|
||||||
|
AR=gcc-ar-14
|
||||||
|
HOSTAR=gcc-ar-14
|
||||||
|
CPP=cpp-14
|
||||||
|
fi
|
||||||
LDOPTS="$LDOPTS -ldl"
|
LDOPTS="$LDOPTS -ldl"
|
||||||
SHARED_LDFLAGS="-dynamiclib -Wl,-no_warn_duplicate_libraries"
|
SHARED_LDFLAGS="-dynamiclib -Wl,-no_warn_duplicate_libraries"
|
||||||
LDMAP_OPT="-map"
|
LDMAP_OPT="-map"
|
||||||
|
|
@ -4499,14 +4510,9 @@ fi
|
||||||
# Now, figure out version number of the (gcc) compiler we are about to use
|
# Now, figure out version number of the (gcc) compiler we are about to use
|
||||||
gccver=`$CC -dumpversion`;
|
gccver=`$CC -dumpversion`;
|
||||||
|
|
||||||
# figure out the binutil version too and display it, mostly for the build
|
# figure out the binutil version too
|
||||||
# system etc to be able to see it easier
|
if [ "yes" = "$simulator" ] || [ "yes" = "$application" ] && [ $uname = "Darwin" ]; then
|
||||||
if [ $uname = "Darwin" ]; then
|
ldnum=0
|
||||||
ldver=`$LD -v 2>&1 | sed -e 's/[^0-9.-]//g'`
|
|
||||||
# Convert LD version to a number major*100 + minor
|
|
||||||
ldnum1=`echo $ldver | cut -d . -f1`
|
|
||||||
ldnum2=`echo $ldver | cut -d . -f2`
|
|
||||||
ldnum=`(expr $ldnum1 "*" 100 + $ldnum2) 2>/dev/null`
|
|
||||||
else
|
else
|
||||||
ldnum=`$LD --version | sed -n '1p' | sed -e 's/.* \([0-9]*\)\.\([0-9]*\).*/\1\2/'`
|
ldnum=`$LD --version | sed -n '1p' | sed -e 's/.* \([0-9]*\)\.\([0-9]*\).*/\1\2/'`
|
||||||
fi
|
fi
|
||||||
|
|
@ -4584,7 +4590,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
echo "Using $LD $ldver"
|
echo "Using $LD"
|
||||||
|
|
||||||
makever=`make --version | head -1`
|
makever=`make --version | head -1`
|
||||||
echo "Detected make $makever"
|
echo "Detected make $makever"
|
||||||
|
|
@ -4602,8 +4608,8 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# figure out the full path to the various commands if possible
|
# figure out the full path to the various commands if possible
|
||||||
HOSTCC=`findtool gcc --lit`
|
HOSTCC=`findtool ${HOSTCC} --lit`
|
||||||
HOSTAR=`findtool ar --lit`
|
HOSTAR=`findtool ${HOSTAR} --lit`
|
||||||
CC=`findtool ${CC} --lit`
|
CC=`findtool ${CC} --lit`
|
||||||
CPP=`findtool ${CPP} --lit`
|
CPP=`findtool ${CPP} --lit`
|
||||||
LD=`findtool ${LD} --lit`
|
LD=`findtool ${LD} --lit`
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue