mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
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
This commit is contained in:
parent
62a5ed49cc
commit
4055f90f08
1 changed files with 5 additions and 12 deletions
17
tools/configure
vendored
17
tools/configure
vendored
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue