Lines 4654-4729
Link Here
|
4654 |
dnl ======================================================== |
4654 |
dnl ======================================================== |
4655 |
MOZ_ARG_HEADER(Individual module options) |
4655 |
MOZ_ARG_HEADER(Individual module options) |
4656 |
|
4656 |
|
4657 |
dnl Setup default CPU arch for arm target |
4657 |
dnl Defaults |
4658 |
case "$target_cpu" in |
4658 |
case "${CPU_ARCH}-${OS_TARGET}" in |
4659 |
arm*) |
4659 |
arm-Android) |
|
|
4660 |
MOZ_THUMB=yes |
4661 |
MOZ_ARCH=armv7-a |
4660 |
MOZ_ARM_ARCH=armv7 |
4662 |
MOZ_ARM_ARCH=armv7 |
4661 |
;; |
4663 |
MOZ_FPU=vfp |
|
|
4664 |
MOZ_FLOAT_ABI=softfp |
4665 |
;; |
4666 |
arm-Darwin) |
4667 |
MOZ_THUMB=yes |
4668 |
;; |
4669 |
arm-*) |
4670 |
if test -n "$MOZ_PLATFORM_MAEMO"; then |
4671 |
MOZ_THUMB=no |
4672 |
MOZ_ARCH=armv7-a |
4673 |
MOZ_ARM_ARCH=armv7 |
4674 |
MOZ_FLOAT_ABI=softfp |
4675 |
fi |
4676 |
if test "$MOZ_PLATFORM_MAEMO" = 6; then |
4677 |
MOZ_THUMB=yes |
4678 |
fi |
4679 |
;; |
4662 |
esac |
4680 |
esac |
4663 |
dnl ======================================================== |
4681 |
|
4664 |
dnl = Enable building the Thumb2 instruction set |
4682 |
dnl Kept for compatibility with some buildbot mozconfig |
4665 |
dnl ======================================================== |
4683 |
MOZ_ARG_DISABLE_BOOL(thumb2, [], MOZ_THUMB=no, MOZ_THUMB=yes) |
4666 |
MOZ_ARG_ENABLE_BOOL(thumb2, |
4684 |
|
4667 |
[ --enable-thumb2 Enable Thumb2 instruction set (implies ARMv7)], |
4685 |
MOZ_ARG_WITH_STRING(thumb, |
4668 |
MOZ_THUMB2=1, |
4686 |
[ --with-thumb[[=yes|no|toolchain-default]]] |
4669 |
MOZ_THUMB2=) |
4687 |
[ Use Thumb instruction set (-mthumb)], |
4670 |
if test -n "$MOZ_THUMB2"; then |
4688 |
if test -z "$GNU_CC"; then |
4671 |
MOZ_ARM_ARCH=armv7 |
4689 |
AC_MSG_ERROR([--with-thumb is not supported on non-GNU toolchain-defaults]) |
|
|
4690 |
fi |
4691 |
MOZ_THUMB=$withval) |
4692 |
|
4693 |
MOZ_ARG_WITH_STRING(thumb-interwork, |
4694 |
[ --with-thumb-interwork[[=yes|no|toolchain-default]] |
4695 |
Use Thumb/ARM instuctions interwork (-mthumb-interwork)], |
4696 |
if test -z "$GNU_CC"; then |
4697 |
AC_MSG_ERROR([--with-thumb-interwork is not supported on non-GNU toolchain-defaults]) |
4698 |
fi |
4699 |
MOZ_THUMB_INTERWORK=$withval) |
4700 |
|
4701 |
MOZ_ARG_WITH_STRING(arch, |
4702 |
[ --with-cpu-arch=[[type|toolchain-default]] |
4703 |
Use specific CPU features (-march=type)], |
4704 |
if test -z "$GNU_CC"; then |
4705 |
AC_MSG_ERROR([--with-arch is not supported on non-GNU toolchain-defaults]) |
4706 |
fi |
4707 |
MOZ_ARCH=$withval) |
4708 |
|
4709 |
MOZ_ARG_WITH_STRING(fpu, |
4710 |
[ --with-fpu=[[type|toolchain-default]] |
4711 |
Use specific FPU type (-mfpu=type)], |
4712 |
if test -z "$GNU_CC"; then |
4713 |
AC_MSG_ERROR([--with-fpu is not supported on non-GNU toolchain-defaults]) |
4714 |
fi |
4715 |
MOZ_FPU=$withval) |
4716 |
|
4717 |
MOZ_ARG_WITH_STRING(float-abi, |
4718 |
[ --with-float-abi=[[type|toolchain-default]] |
4719 |
Use specific arm float ABI (-mfloat-abi=type)], |
4720 |
if test -z "$GNU_CC"; then |
4721 |
AC_MSG_ERROR([--with-float-abi is not supported on non-GNU toolchain-defaults]) |
4722 |
fi |
4723 |
MOZ_FLOAT_ABI=$withval) |
4724 |
|
4725 |
MOZ_ARG_WITH_STRING(soft-float, |
4726 |
[ --with-soft-float[[=yes|no|toolchain-default]] |
4727 |
Use soft float library (-msoft-float)], |
4728 |
if test -z "$GNU_CC"; then |
4729 |
AC_MSG_ERROR([--with-soft-float is not supported on non-GNU toolchain-defaults]) |
4730 |
fi |
4731 |
MOZ_SOFT_FLOAT=$withval) |
4732 |
|
4733 |
case "$MOZ_ARCH" in |
4734 |
toolchain-default|"") |
4735 |
arch_flag="" |
4736 |
;; |
4737 |
armv7*) |
4738 |
MOZ_ARM_ARCH="armv7" |
4739 |
arch_flag="-march=$MOZ_ARCH" |
4740 |
;; |
4741 |
*) |
4742 |
arch_flag="-march=$MOZ_ARCH" |
4743 |
;; |
4744 |
esac |
4745 |
|
4746 |
case "$MOZ_THUMB" in |
4747 |
yes) |
4748 |
MOZ_THUMB2=1 |
4749 |
thumb_flag="-mthumb" |
4750 |
;; |
4751 |
no) |
4752 |
MOZ_THUMB2= |
4753 |
thumb_flag="-marm" |
4754 |
;; |
4755 |
*) |
4756 |
_SAVE_CFLAGS="$CFLAGS" |
4757 |
CFLAGS="$arch_flag" |
4758 |
AC_TRY_COMPILE([],[return sizeof(__thumb2__);], |
4759 |
MOZ_THUMB2=1, |
4760 |
MOZ_THUMB2=) |
4761 |
CFLAGS="$_SAVE_CFLAGS" |
4762 |
thumb_flag="" |
4763 |
;; |
4764 |
esac |
4765 |
|
4766 |
if test "$MOZ_THUMB2" = 1; then |
4767 |
AC_DEFINE(MOZ_THUMB2) |
4672 |
fi |
4768 |
fi |
4673 |
|
4769 |
|
4674 |
dnl ======================================================== |
4770 |
case "$MOZ_THUMB_INTERWORK" in |
4675 |
dnl = Enable building for ARM specific CPU features |
4771 |
yes) |
4676 |
dnl ======================================================== |
4772 |
thumb_interwork_flag="-mthumb-interwork" |
4677 |
MOZ_ARG_WITH_STRING(cpu-arch, |
4773 |
;; |
4678 |
[ --with-cpu-arch=arch Use specific arm architecture CPU features, default armv7], |
4774 |
no) |
4679 |
MOZ_ARM_ARCH=$withval) |
4775 |
thumb_interwork_flag="-mno-thumb-interwork" |
4680 |
|
4776 |
;; |
4681 |
if test -n "$MOZ_THUMB2"; then |
4777 |
*) # toolchain-default |
4682 |
case "$target_cpu" in |
4778 |
thumb_interwork_flag="" |
4683 |
arm*) |
4779 |
;; |
4684 |
if test "$MOZ_ARM_ARCH" != "armv7"; then |
4780 |
esac |
4685 |
AC_MSG_ERROR([--enable-thumb2 is not compatible with cpu-arch=$MOZ_ARM_ARCH]) |
4781 |
|
4686 |
fi |
4782 |
case "$MOZ_FPU" in |
4687 |
if test "$GNU_CC"; then |
4783 |
toolchain-default|"") |
4688 |
AC_DEFINE(MOZ_THUMB2) |
4784 |
fpu_flag="" |
4689 |
AC_DEFINE(MOZ_ARM_ARCH) |
4785 |
;; |
4690 |
CFLAGS="$CFLAGS -march=armv7-a -mthumb $MOZ_ARM_VFP_FLAGS" |
4786 |
*) |
4691 |
CXXFLAGS="$CXXFLAGS -march=armv7-a -mthumb $MOZ_ARM_VFP_FLAGS" |
4787 |
fpu_flag="-mfpu=$MOZ_FPU" |
4692 |
ASFLAGS="$ASFLAGS -march=armv7-a -mthumb $MOZ_ARM_VFP_FLAGS" |
4788 |
;; |
4693 |
else |
4789 |
esac |
4694 |
AC_MSG_ERROR([--enable-thumb2 is not supported for non-GNU toolchains]) |
4790 |
|
4695 |
fi |
4791 |
case "$MOZ_FLOAT_ABI" in |
4696 |
;; |
4792 |
toolchain-default|"") |
4697 |
*) |
4793 |
float_abi_flag="" |
4698 |
AC_MSG_ERROR([--enable-thumb2 is not supported for non-ARM CPU architectures]) |
4794 |
;; |
4699 |
;; |
4795 |
*) |
4700 |
esac |
4796 |
float_abi_flag="-mfloat-abi=$MOZ_FLOAT_ABI" |
4701 |
elif test "$MOZ_ARM_ARCH" = "armv7"; then |
4797 |
;; |
4702 |
case "$target_cpu" in |
4798 |
esac |
4703 |
arm*) |
4799 |
|
4704 |
if test "$GNU_CC"; then |
4800 |
case "$MOZ_SOFT_FLOAT" in |
4705 |
AC_DEFINE(MOZ_ARM_ARCH) |
4801 |
yes) |
4706 |
CFLAGS="$CFLAGS -march=armv7-a -marm $MOZ_ARM_VFP_FLAGS" |
4802 |
soft_float_flag="-msoft-float" |
4707 |
CXXFLAGS="$CXXFLAGS -march=armv7-a -marm $MOZ_ARM_VFP_FLAGS" |
4803 |
;; |
4708 |
ASFLAGS="$ASFLAGS -march=armv7-a -marm $MOZ_ARM_VFP_FLAGS" |
4804 |
no) |
4709 |
else |
4805 |
soft_float_flag="-mno-soft-float" |
4710 |
AC_MSG_ERROR([--with-cpu-arch=armv7 is not supported for non-GNU toolchains]) |
4806 |
;; |
4711 |
fi |
4807 |
*) # toolchain-default |
4712 |
;; |
4808 |
soft_float_flag="" |
4713 |
*) |
4809 |
;; |
4714 |
AC_MSG_ERROR([--with-cpu-arch=armv7 is not supported for non-ARM CPU architectures]) |
4810 |
esac |
4715 |
;; |
4811 |
|
4716 |
esac |
4812 |
dnl Use echo to avoid accumulating space characters |
4717 |
else |
4813 |
all_flags=`echo $arch_flag $thumb_flag $thumb_interwork_flag $fpu_flag $float_abi_flag $soft_float_flag` |
4718 |
case "$target_cpu" in |
4814 |
if test -n "$all_flags"; then |
4719 |
arm*) |
4815 |
_SAVE_CFLAGS="$CFLAGS" |
4720 |
if test "$GNU_CC"; then |
4816 |
CFLAGS="$all_flags" |
4721 |
CFLAGS="$CFLAGS -march=armv5te -mthumb-interwork -msoft-float" |
4817 |
AC_MSG_CHECKING(whether the chosen combination of compiler flags ($all_flags) works) |
4722 |
CXXFLAGS="$CXXFLAGS -march=armv5te -mthumb-interwork -msoft-float" |
4818 |
AC_TRY_COMPILE([],[return 0;], |
4723 |
ASFLAGS="$ASFLAGS -march=armv5te -mthumb-interwork -msoft-float" |
4819 |
AC_MSG_RESULT([yes]), |
4724 |
fi |
4820 |
AC_MSG_ERROR([no])) |
4725 |
;; |
4821 |
|
4726 |
esac |
4822 |
CFLAGS="$_SAVE_CFLAGS $all_flags" |
|
|
4823 |
CXXFLAGS="$CXXFLAGS $all_flags" |
4824 |
ASFLAGS="$ASFLAGS $all_flags" |
4825 |
if test -n "$thumb_flag"; then |
4826 |
LDFLAGS="$LDFLAGS $thumb_flag" |
4827 |
fi |
4727 |
fi |
4828 |
fi |
4728 |
|
4829 |
|
4729 |
AC_SUBST(MOZ_THUMB2) |
4830 |
AC_SUBST(MOZ_THUMB2) |