aboutsummaryrefslogtreecommitdiffstats
path: root/bs/deftypes-cross.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bs/deftypes-cross.sh')
-rw-r--r--bs/deftypes-cross.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/bs/deftypes-cross.sh b/bs/deftypes-cross.sh
new file mode 100644
index 000000000..a5f78a816
--- /dev/null
+++ b/bs/deftypes-cross.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+cat <<EOF
+/*
+ * Manually set type sizes for cross compile
+ * build-target: $TARGET
+ * build-host: $HOST
+ */
+
+/* If your target is big-endian, define the below: */
+EOF
+
+be='/* #undef WORDS_BIGENDIAN */'
+
+# add more targets here
+case "$TARGET" in
+*-ppc* | *-sparc*)
+ be='#define WORDS_BIGENDIAN'
+ ;;
+esac
+echo "$bs"
+
+sizeof_int=0
+sizeof_long=0
+sizeof_long_long=0
+sizeof_short=0
+
+cat <<EOF
+#define SIZEOF_INT $sizeof_int
+#define SIZEOF_LONG $sizeof_long
+#define SIZEOF_LONG_LONG $sizeof_long_long
+#define SIZEOF_SHORT $sizeof_short
+EOF
+