libextractor

GNU libextractor
Log | Files | Refs | Submodules | README | LICENSE

acinclude.m4 (1823B)


      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   ])
     45 
     46 dnl Checks for all prerequisites of the intl subdirectory,
     47 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
     48 dnl            USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
     49     AC_DEFUN([AM_INTL_SUBDIR], [])