Fix Sim & checkwps for newer distros
__builtin found fix for rbendian.h
tools/configure defines SIM_USE_BYTESWAP_H if byteswap.h is found in
/usr/include/ maybe there is a better mechanism for this
Change-Id: I4d004e68313e8b32aa5587582be36bc459fdaf6b
diff --git a/firmware/include/rbendian.h b/firmware/include/rbendian.h
index 0e941b8..7b666ec 100644
--- a/firmware/include/rbendian.h
+++ b/firmware/include/rbendian.h
@@ -23,7 +23,7 @@
#include "config.h"
-#ifdef SIM_USE_BYTESWAP_H
+#ifdef OS_USE_BYTESWAP_H
#include <byteswap.h>
#endif
diff --git a/tools/configure b/tools/configure
index 6398c48..a7635a8 100755
--- a/tools/configure
+++ b/tools/configure
@@ -4394,6 +4394,7 @@
;;
[Cc])
uname=`uname`
+ checkwps="yes"
simcc "checkwps"
toolset='';
t_cpu='';
@@ -4474,9 +4475,13 @@
if [ "yes" = "$simulator" ]; then
echo Unsetting APPLICATION define for SIMULATOR build
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 -DSIM_USE_BYTESWAP_H=$BYTESWP"
+ extradefines="$extradefines -DOS_USE_BYTESWAP_H=$BYTESWP"
fi
fi