packages/perl: fix target system endianness detection (closes #6900)

git-svn-id: svn://svn.openwrt.org/openwrt/packages@21465 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
juhosg 2010-05-16 06:58:53 +00:00
parent 82d12ea595
commit b97a563121
2 changed files with 23 additions and 1 deletions

View 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 \

View File

@ -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.
*/