summaryrefslogtreecommitdiffstats
path: root/patches/libnet-1.1.4/libnet-1.1.3-endianess.diff
blob: be4575411806e4d6c39cc70713d7c9a2e075657b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Subject: fix endianess check for cross-compiling
From: Michael Olbrich <m.olbrich@pengutronix.de>

The original check tries to run a program to check the endianess.
This fails when cross-compiling. Use autoconf stuff instead.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>

---
# 20091229 rsc: there's already a similar patch in the libnet git, so we
# wait for a new release

 autogen.sh   |    8 ++++++++
 configure.in |   12 +++++++++++-
 2 files changed, 19 insertions(+), 1 deletion(-)

Index: b/autogen.sh
===================================================================
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,8 @@
+rm -fr autom4te.cache
+libtoolize --copy --force
+aclocal -I .
+#autoheader
+automake -a -c --foreign
+autoconf
+rm -fr autom4te.cache
+
Index: b/configure.in
===================================================================
--- a/configure.in
+++ b/configure.in
@@ -6,6 +6,7 @@ dnl All rights reserved.
 dnl
 dnl Process this file with autoconf to produce a configure script.
 
+AC_PREREQ(2.52)
 AC_INIT(libnet, 1.1.4)
 AC_MSG_RESULT(beginning autoconfiguration process for libnet-${PACKAGE_VERSION} ...)
 AC_CANONICAL_SYSTEM
@@ -29,7 +30,16 @@ dnl
 dnl And some custom things
 dnl
 
-AC_LIBNET_ENDIAN_CHECK
+AC_C_BIGENDIAN([
+    AC_DEFINE([LIBNET_BIG_ENDIAN], [1], [big endian])
+    ENDIANESS="LIBNET_BIG_ENDIAN"
+    LIBNET_CONFIG_DEFINES="$LIBNET_CONFIG_DEFINES -DLIBNET_BIG_ENDIAN"
+],[
+    AC_DEFINE([LIBNET_LIL_ENDIAN], [1], [little endian])
+    ENDIANESS="LIBNET_LIL_ENDIAN"
+    LIBNET_CONFIG_DEFINES="$LIBNET_CONFIG_DEFINES -DLIBNET_LIL_ENDIAN"
+], AC_MSG_WARN(cannot detect endianess. try setting ac_cv_c_bigendian to yes or no))
+
 AC_LBL_UNALIGNED_ACCESS
 dnl AC_LBL_LIBRARY_NET