First Commit
[librecmc/package-feed.git] / lang / perl / patches / 100-fix-cross-compile-endianness-detection.patch
1 --- a/config_h.SH
2 +++ b/config_h.SH
3 @@ -52,6 +52,19 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#und
4  #ifndef _config_h_
5  #define _config_h_
6  
7 +#if defined(USE_CROSS_COMPILE) && !defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)
8 +#  include <endian.h>
9 +#  if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && defined(__BIG_ENDIAN)
10 +#    if (__BYTE_ORDER == __LITTLE_ENDIAN)
11 +#      define __LITTLE_ENDIAN__
12 +#    elif (__BYTE_ORDER == __BIG_ENDIAN)
13 +#      define __BIG_ENDIAN__
14 +#    else
15 +#      error Unknown endianness
16 +#    endif
17 +#  endif
18 +#endif
19 +
20  /* LOC_SED:
21   *     This symbol holds the complete pathname to the sed program.
22   */