home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / Divers / lzop-1.00.tar.gz / lzop-1.00.tar / lzop-1.00 / acconfig / m4 / byteorder.m4 next >
Text File  |  1998-04-20  |  819b  |  26 lines

  1. ## --------------------------------------------------------- ##
  2. ## Check the byte order.                                     ##
  3. ## Adapted from AC_C_BIGENDIAN.                              ##
  4. ## --------------------------------------------------------- ##
  5.  
  6. # serial 1
  7.  
  8. AC_DEFUN(mfx_C_BYTE_ORDER,
  9. [AC_CACHE_CHECK(the byte order, mfx_cv_c_byte_order,
  10. [mfx_cv_c_byte_order=unknown
  11. AC_TRY_RUN([main() {
  12.   /* Are we little or big endian?  From Harbison&Steele.  */
  13.   union { long l; char c[sizeof(long)]; } u;
  14.   u.l = 1; exit (u.c[sizeof(long) - 1] == 1);
  15. }],
  16. mfx_cv_c_byte_order=1234,
  17. mfx_cv_c_byte_order=4321,
  18. mfx_cv_c_byte_order=unknown)])
  19. if test "$mfx_cv_c_byte_order" = 1234; then
  20.   AC_DEFINE_UNQUOTED(MFX_BYTE_ORDER,1234)
  21. fi
  22. if test "$mfx_cv_c_byte_order" = 4321; then
  23.   AC_DEFINE_UNQUOTED(MFX_BYTE_ORDER,4321)
  24. fi
  25. ])
  26.