From 4055f90f083736f966a5424ec18caea917c04d8d Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Mon, 10 Dec 2018 01:36:33 -0600 Subject: [PATCH] Fix host build for newer linux distros I realized there was a better way to do this.. Instead of specifying a path just have gcc run the preprocessor (-E) on an input file consisting of only '#include ' if it succeeds then we can use it if not then don't define OS_USE_BYTESWAP_H Change-Id: I0de8e469445221bc1b5ad8cc032de5b89a85ab66 --- tools/configure | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/tools/configure b/tools/configure index a7635a8460..fa7a830959 100755 --- a/tools/configure +++ b/tools/configure @@ -10,9 +10,6 @@ # global CC options for all platforms CCOPTS="-W -Wall -Wundef -O -nostdlib -ffreestanding -Wstrict-prototypes -pipe -std=gnu99" -#newer versions GLIBC use byteswap.h -BYTESWP="/usr/include/byteswap.h" - # LD options for the core LDOPTS="" # LD options for the core + plugins @@ -349,6 +346,11 @@ simcc () { sigaltstack=`check_sigaltstack` echo "Linux host detected" LDOPTS="$LDOPTS -ldl" + # newer glibc implementations use byteswap.h + if echo "#include " | gcc -E - > /dev/null 2>&1; then + echo "Using byteswap.h" + extradefines="$extradefines -DOS_USE_BYTESWAP_H" + fi ;; FreeBSD) @@ -4394,7 +4396,6 @@ fi ;; [Cc]) uname=`uname` - checkwps="yes" simcc "checkwps" toolset=''; t_cpu=''; @@ -4477,14 +4478,6 @@ if [ "yes" = "$simulator" ]; then unset application fi -# newer glibc implementations use byteswap.h -if [ "$simulator" = "yes" ] || [ "$checkwps" = "yes" ]; then - if test -f "$BYTESWP"; then - echo Using "$BYTESWP" - extradefines="$extradefines -DOS_USE_BYTESWAP_H=$BYTESWP" - fi -fi - if [ "yes" = "$application" ]; then echo Building Rockbox as an Application extradefines="$extradefines -DAPPLICATION"