diff options
author | William Wilgus <me.theuser@yahoo.com> | 2018-12-10 01:36:33 -0600 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2018-12-10 01:36:33 -0600 |
commit | 4055f90f083736f966a5424ec18caea917c04d8d (patch) | |
tree | 309521c3b5adf8ffb0def612a9c0a4b844a47862 /tools/configure | |
parent | 62a5ed49cc187120793ea50e0eec4e18c8bc0441 (diff) |
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 <byteswap.h>' if it succeeds
then we can use it if not then don't define OS_USE_BYTESWAP_H
Change-Id: I0de8e469445221bc1b5ad8cc032de5b89a85ab66
Diffstat (limited to 'tools/configure')
-rwxr-xr-x | tools/configure | 17 |
1 files 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 <byteswap.h>" | 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" |