Commit 210fa55690d448bbdd89081c1c53840e795d4a8d
1 parent
3a11702b
Compiler check for byteswap.h instead of hardcoded path.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2456 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
8 additions
and
2 deletions
configure
| @@ -706,8 +706,14 @@ echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h | @@ -706,8 +706,14 @@ echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h | ||
| 706 | if test "$mingw32" = "yes" ; then | 706 | if test "$mingw32" = "yes" ; then |
| 707 | echo "CONFIG_WIN32=yes" >> $config_mak | 707 | echo "CONFIG_WIN32=yes" >> $config_mak |
| 708 | echo "#define CONFIG_WIN32 1" >> $config_h | 708 | echo "#define CONFIG_WIN32 1" >> $config_h |
| 709 | -elif test -f "/usr/include/byteswap.h" ; then | ||
| 710 | - echo "#define HAVE_BYTESWAP_H 1" >> $config_h | 709 | +else |
| 710 | + cat > $TMPC << EOF | ||
| 711 | +#include <byteswap.h> | ||
| 712 | +int main(void) { return bswap_32(0); } | ||
| 713 | +EOF | ||
| 714 | + if $cc -o $TMPE $TMPC 2> /dev/null ; then | ||
| 715 | + echo "#define HAVE_BYTESWAP_H 1" >> $config_h | ||
| 716 | + fi | ||
| 711 | fi | 717 | fi |
| 712 | if test "$darwin" = "yes" ; then | 718 | if test "$darwin" = "yes" ; then |
| 713 | echo "CONFIG_DARWIN=yes" >> $config_mak | 719 | echo "CONFIG_DARWIN=yes" >> $config_mak |