packages/perl: fix target system endianness detection (closes #6900)
authorGabor Juhos <juhosg@openwrt.org>
Sun, 16 May 2010 06:58:53 +0000 (06:58 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Sun, 16 May 2010 06:58:53 +0000 (06:58 +0000)
SVN-Revision: 21465

lang/perl/Makefile
lang/perl/patches/101-fix-cross-compile-endianness-detection.patch [new file with mode: 0644]

index d3465c5..6195500 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=perl
 PKG_VERSION:=5.10.0
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 PKG_MD5SUM:=d2c39b002ebfd2c3c5dba589365c5a71
 
 PKG_SOURCE_URL:=ftp://ftp.cpan.org/pub/CPAN/src/5.0 \
diff --git a/lang/perl/patches/101-fix-cross-compile-endianness-detection.patch b/lang/perl/patches/101-fix-cross-compile-endianness-detection.patch
new file mode 100644 (file)
index 0000000..8fea9c0
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/config_h.SH
++++ b/config_h.SH
+@@ -53,6 +53,19 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#und
+ #ifndef _config_h_
+ #define _config_h_
++#if defined(USE_CROSS_COMPILE) && !defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)
++#  include <endian.h>
++#  if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && defined(__BIG_ENDIAN)
++#    if (__BYTE_ORDER == __LITTLE_ENDIAN)
++#      define __LITTLE_ENDIAN__
++#    elif (__BYTE_ORDER == __BIG_ENDIAN)
++#      define __BIG_ENDIAN__
++#    else
++#      error Unknown endianness
++#    endif
++#  endif
++#endif
++
+ /* LOC_SED:
+  *    This symbol holds the complete pathname to the sed program.
+  */