mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
git-svn-id: svn://coreboot.org/openbios/openbios-devel@120 f158a5a8-5612-0410-a976-696ce0be7e32
57 lines
1.4 KiB
Bash
57 lines
1.4 KiB
Bash
#!/bin/sh
|
|
|
|
host=$1
|
|
target=$2
|
|
|
|
if test "$host" = "powerpc" -o "$host" = "mips" -o "$host" = "s390" \
|
|
-o "$host" = "sparc32" -o "$host" = "sparc64" \
|
|
-o "$host" = "m68k" -o "$host" = "armv4b"; then
|
|
hostbigendian="yes"
|
|
else
|
|
hostbigendian="no"
|
|
fi
|
|
|
|
# host long bits test
|
|
if test "$host" = "sparc64" -o "$host" = "ia64" \
|
|
-o "$host" = "amd64" -o "$host" = "alpha"; then
|
|
hostlongbits="64"
|
|
else
|
|
hostlongbits="32"
|
|
fi
|
|
|
|
if test "$target" = "powerpc" -o "$target" = "mips" -o "$target" = "s390" \
|
|
-o "$target" = "sparc32" -o "$target" = "sparc64" \
|
|
-o "$target" = "m68k" -o "$target" = "armv4b"; then
|
|
targetbigendian="yes"
|
|
else
|
|
targetbigendian="no"
|
|
fi
|
|
|
|
# target long bits test
|
|
if test "$target" = "sparc64" -o "$target" = "ia64" \
|
|
-o "$target" = "amd64" -o "$target" = "alpha"; then
|
|
targetlongbits="64"
|
|
else
|
|
targetlongbits="32"
|
|
fi
|
|
|
|
if test "$targetbigendian" = "$hostbigendian"; then
|
|
cflags="-USWAP_ENDIANNESS"
|
|
else
|
|
cflags="-DSWAP_ENDIANNESS"
|
|
fi
|
|
|
|
if test "$targetlongbits" = "$hostlongbits"; then
|
|
cflags="$cflags -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH"
|
|
elif test "$targetlongbits" -lt "$hostlongbits"; then
|
|
cflags="$cflags -DNATIVE_BITWIDTH_SMALLER_THAN_HOST_BITWIDTH"
|
|
else
|
|
cflags="$cflags -DNATIVE_BITWIDTH_LARGER_THAN_HOST_BITWIDTH"
|
|
fi
|
|
|
|
if test "$host" = "x86" -a "$targetlongbits" = "64"; then
|
|
cflags="$cflags -DNEED_FAKE_INT128_T"
|
|
fi
|
|
|
|
echo "$cflags"
|