~ubuntu-branches/ubuntu/hoary/libextractor/hoary

« back to all changes in this revision

Viewing changes to acinclude.m4

  • Committer: Bazaar Package Importer
  • Author(s): Glenn McGrath
  • Date: 2004-06-26 12:59:02 UTC
  • Revision ID: james.westby@ubuntu.com-20040626125902-w97jpn43hsk7tcde
Tags: upstream-0.3.3
ImportĀ upstreamĀ versionĀ 0.3.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
define(GNUPG_CHECK_ENDIAN,
 
2
  [ if test "$cross_compiling" = yes; then
 
3
        AC_MSG_WARN(cross compiling; assuming big endianess)
 
4
    fi
 
5
    AC_MSG_CHECKING(endianess)
 
6
    AC_CACHE_VAL(gnupg_cv_c_endian,
 
7
      [ gnupg_cv_c_endian=unknown
 
8
        # See if sys/param.h defines the BYTE_ORDER macro.
 
9
        AC_TRY_COMPILE([#include <sys/types.h>
 
10
        #include <sys/param.h>], [
 
11
        #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
 
12
         bogus endian macros
 
13
        #endif], [# It does; now see whether it defined to BIG_ENDIAN or not.
 
14
        AC_TRY_COMPILE([#include <sys/types.h>
 
15
        #include <sys/param.h>], [
 
16
        #if BYTE_ORDER != BIG_ENDIAN
 
17
         not big endian
 
18
        #endif], gnupg_cv_c_endian=big, gnupg_cv_c_endian=little)])
 
19
        if test "$gnupg_cv_c_endian" = unknown; then
 
20
            AC_TRY_RUN([main () {
 
21
              /* Are we little or big endian?  From Harbison&Steele.  */
 
22
              union
 
23
              {
 
24
                long l;
 
25
                char c[sizeof (long)];
 
26
              } u;
 
27
              u.l = 1;
 
28
              exit (u.c[sizeof (long) - 1] == 1);
 
29
              }],
 
30
              gnupg_cv_c_endian=little,
 
31
              gnupg_cv_c_endian=big,
 
32
              gnupg_cv_c_endian=big
 
33
            )
 
34
        fi
 
35
      ])
 
36
    AC_MSG_RESULT([$gnupg_cv_c_endian])
 
37
    if test "$gnupg_cv_c_endian" = little; then
 
38
      AC_DEFINE(LITTLE_ENDIAN_HOST,1,
 
39
                [Defined if the host has little endian byte ordering])
 
40
    else
 
41
      AC_DEFINE(BIG_ENDIAN_HOST,1,
 
42
                [Defined if the host has big endian byte ordering])
 
43
    fi
 
44
  ])