]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
Fix cross compilation problem in parse-types.sh
authorChen Qi <Qi.Chen@windriver.com>
Tue, 6 May 2014 01:08:42 +0000 (21:08 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 7 May 2014 14:51:50 +0000 (10:51 -0400)
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>
config/parse-types.sh
configure
configure.in

index 5076f6ca8d55ef11e9a4eec4d0f5345be47d500e..24d2a990edb90def984b38c9edd14becc59f0abc 100755 (executable)
@@ -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
 
index 6fe33f5afc1e68ffffb4d8b1cdfe1bb7f5a92400..1b0ee6206fae0742b8f1be92b07fcd39055c2ffe 100755 (executable)
--- 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 */" \
index 781b6f5a36716f02552eb2a4db5d280a78d19f7c..6592e707512eda8e3325e8bf49a83a8e6454611c 100644 (file)
@@ -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