ax_endian.m4 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. # https://github.com/BrianAker/ddm4
  2. # ===========================================================================
  3. #
  4. # SYNOPSIS
  5. #
  6. # AX_ENDIAN()
  7. #
  8. # DESCRIPTION
  9. #
  10. # Generate to defines describing endian.
  11. #
  12. # LICENSE
  13. #
  14. # Copyright (c) 2012 Brian Aker <brian@tangent.org>
  15. #
  16. # Copying and distribution of this file, with or without modification, are
  17. # permitted in any medium without royalty provided the copyright notice
  18. # and this notice are preserved. This file is offered as-is, without any
  19. # warranty.
  20. #serial 1
  21. AC_DEFUN([AX_ENDIAN],[
  22. AC_C_BIGENDIAN([
  23. AC_DEFINE([WORDS_BIGENDIAN],[1],[machine is big-endian])
  24. AC_DEFINE([ENDIAN_BIG],[1],[machine is big-endian])
  25. AC_DEFINE([ENDIAN_LITTLE],[0],[machine is little-endian])],[
  26. ],[
  27. AC_DEFINE([WORDS_BIGENDIAN],[0],[machine is big-endian])
  28. AC_DEFINE([ENDIAN_BIG],[0],[machine is big-endian])
  29. AC_DEFINE([ENDIAN_LITTLE],[1],[machine is little-endian])
  30. ],[
  31. AC_MSG_ERROR([unable to determine endian])
  32. ])
  33. ])