Merge lp:~tangent-org/libmemcached/1.0-build/ Build: jenkins-Libmemcached-187
[m6w6/libmemcached] / m4 / ax_endian.m4
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
21 #serial 1
22
23 AC_DEFUN([AX_ENDIAN],[
24 AC_C_BIGENDIAN([
25 AC_DEFINE([WORDS_BIGENDIAN],[1],[machine is big-endian])
26 AC_DEFINE([ENDIAN_BIG],[1],[machine is big-endian])
27 AC_DEFINE([ENDIAN_LITTLE],[0],[machine is little-endian])],[
28 ],[
29 AC_DEFINE([WORDS_BIGENDIAN],[0],[machine is big-endian])
30 AC_DEFINE([ENDIAN_BIG],[0],[machine is big-endian])
31 AC_DEFINE([ENDIAN_LITTLE],[1],[machine is little-endian])
32 ],[
33 AC_MSG_ERROR([unable to determine endian])
34 ])
35 ])