1 |
# This file is part of Autoconf. -*- Autoconf -*- |
# This file is part of Autoconf. -*- Autoconf -*- |
2 |
# Programming languages support. |
# Programming languages support. |
3 |
# Copyright 2001 |
# Copyright (C) 2001, 2002 Free Software Foundation, Inc. |
|
# Free Software Foundation, Inc. |
|
4 |
# |
# |
5 |
# This program is free software; you can redistribute it and/or modify |
# This program is free software; you can redistribute it and/or modify |
6 |
# it under the terms of the GNU General Public License as published by |
# it under the terms of the GNU General Public License as published by |
877 |
u.l = 1; |
u.l = 1; |
878 |
exit (u.c[sizeof (long) - 1] == 1); |
exit (u.c[sizeof (long) - 1] == 1); |
879 |
}], [ac_cv_c_bigendian=no], [ac_cv_c_bigendian=yes], |
}], [ac_cv_c_bigendian=no], [ac_cv_c_bigendian=yes], |
880 |
[# try to guess the endianess by grep'ing values into an object file |
[# try to guess the endianness by grepping values into an object file |
881 |
ac_cv_c_bigendian=unknown |
ac_cv_c_bigendian=unknown |
882 |
AC_COMPILE_IFELSE([AC_LANG_PROGRAM( |
AC_COMPILE_IFELSE([AC_LANG_PROGRAM( |
883 |
[[short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; |
[[short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; |
908 |
$2 ;; |
$2 ;; |
909 |
*) |
*) |
910 |
m4_default([$3], |
m4_default([$3], |
911 |
[AC_MSG_ERROR([unknown endianess |
[AC_MSG_ERROR([unknown endianness |
912 |
presetting ac_cv_c_bigendian=no (or yes) will help])]) ;; |
presetting ac_cv_c_bigendian=no (or yes) will help])]) ;; |
913 |
esac |
esac |
914 |
])# AC_C_BIGENDIAN |
])# AC_C_BIGENDIAN |