summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2014-05-05 21:08:42 -0400
committerTheodore Ts'o <tytso@mit.edu>2014-05-07 10:51:50 -0400
commit91f04685bfa86ed4b19a54d11b4093b9d904f3df (patch)
treed96dee507cb099f73b580b89644d94a9ebce7edf
parent2de2628b2d230781cdf25530c22794c707aa77b2 (diff)
downloade2fsprogs-91f04685bfa86ed4b19a54d11b4093b9d904f3df.tar.gz
Fix cross compilation problem in parse-types.sh
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> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rwxr-xr-xconfig/parse-types.sh6
-rwxr-xr-xconfigure6
-rw-r--r--configure.in6
3 files changed, 14 insertions, 4 deletions
diff --git a/config/parse-types.sh b/config/parse-types.sh
index 5076f6ca..24d2a990 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 b/configure
index 6fe33f5a..1b0ee620 100755
--- a/configure
+++ b/configure
@@ -10910,7 +10910,11 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
esac
-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
echo "/* These defines are needed for the public ext2fs.h header file */" \
diff --git a/configure.in b/configure.in
index 781b6f5a..6592e707 100644
--- a/configure.in
+++ b/configure.in
@@ -979,7 +979,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