linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* e2fsprogs: fix cross compilation problem
@ 2014-03-13  2:01 Chen Qi
  2014-04-29  7:14 ` ChenQi
  2014-05-06  1:15 ` Theodore Ts'o
  0 siblings, 2 replies; 3+ messages in thread
From: Chen Qi @ 2014-03-13  2:01 UTC (permalink / raw)
  To: linux-ext4

The checking of types in parse-types.sh doesn't make much sense in a
cross-compilation environment, because the generated binary is executed
on build machine.

So even if asm_types.h has got correct statements for types, it's possible
that the generated binary will report an error. Because these types are for
the target machine.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 config/parse-types.sh |    6 ++++--
 configure.in          |    6 +++++-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/config/parse-types.sh b/config/parse-types.sh
index 5076f6c..24d2a99 100755
--- a/config/parse-types.sh
+++ b/config/parse-types.sh
@@ -118,8 +118,10 @@ if ./asm_types
 then
     true
 else
-    echo "Problem detected with asm_types.h"
-    echo "" > asm_types.h
+    if [ "${CROSS_COMPILE}" != "1" ]; then
+	echo "Problem detected with asm_types.h"
+	echo "" > asm_types.h
+    fi
 fi
 rm asm_types.c asm_types
 
diff --git a/configure.in b/configure.in
index 68adf0d..ed1697b 100644
--- a/configure.in
+++ b/configure.in
@@ -953,7 +953,11 @@ AC_SUBST(SIZEOF_LONG)
 AC_SUBST(SIZEOF_LONG_LONG)
 AC_SUBST(SIZEOF_OFF_T)
 AC_C_BIGENDIAN
-BUILD_CC="$BUILD_CC" CPP="$CPP" /bin/sh $ac_aux_dir/parse-types.sh
+if test $cross_compiling = no; then
+  BUILD_CC="$BUILD_CC" CPP="$CPP" /bin/sh $ac_aux_dir/parse-types.sh
+else
+  CROSS_COMPILE="1" BUILD_CC="$BUILD_CC" CPP="$CPP" /bin/sh $ac_aux_dir/parse-types.sh
+fi
 ASM_TYPES_HEADER=./asm_types.h
 AC_SUBST_FILE(ASM_TYPES_HEADER)
 dnl
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-05-06  1:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-13  2:01 e2fsprogs: fix cross compilation problem Chen Qi
2014-04-29  7:14 ` ChenQi
2014-05-06  1:15 ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).