--- spidermonkey-1.8.5.old/work/js-1.8.5/js/src/configure.in 2012-11-01 12:45:01.000000000 -0400 +++ spidermonkey-1.8.5-r1/work/js-1.8.5/js/src/configure.in 2012-11-01 13:32:39.000000000 -0400 @@ -4654,76 +4654,177 @@ dnl ======================================================== MOZ_ARG_HEADER(Individual module options) -dnl Setup default CPU arch for arm target -case "$target_cpu" in - arm*) +dnl Defaults +case "${CPU_ARCH}-${OS_TARGET}" in +arm-Android) + MOZ_THUMB=yes + MOZ_ARCH=armv7-a MOZ_ARM_ARCH=armv7 - ;; + MOZ_FPU=vfp + MOZ_FLOAT_ABI=softfp + ;; +arm-Darwin) + MOZ_THUMB=yes + ;; +arm-*) + if test -n "$MOZ_PLATFORM_MAEMO"; then + MOZ_THUMB=no + MOZ_ARCH=armv7-a + MOZ_ARM_ARCH=armv7 + MOZ_FLOAT_ABI=softfp + fi + if test "$MOZ_PLATFORM_MAEMO" = 6; then + MOZ_THUMB=yes + fi + ;; esac -dnl ======================================================== -dnl = Enable building the Thumb2 instruction set -dnl ======================================================== -MOZ_ARG_ENABLE_BOOL(thumb2, - [ --enable-thumb2 Enable Thumb2 instruction set (implies ARMv7)], - MOZ_THUMB2=1, - MOZ_THUMB2=) -if test -n "$MOZ_THUMB2"; then - MOZ_ARM_ARCH=armv7 + +dnl Kept for compatibility with some buildbot mozconfig +MOZ_ARG_DISABLE_BOOL(thumb2, [], MOZ_THUMB=no, MOZ_THUMB=yes) + +MOZ_ARG_WITH_STRING(thumb, +[ --with-thumb[[=yes|no|toolchain-default]]] +[ Use Thumb instruction set (-mthumb)], + if test -z "$GNU_CC"; then + AC_MSG_ERROR([--with-thumb is not supported on non-GNU toolchain-defaults]) + fi + MOZ_THUMB=$withval) + +MOZ_ARG_WITH_STRING(thumb-interwork, +[ --with-thumb-interwork[[=yes|no|toolchain-default]] + Use Thumb/ARM instuctions interwork (-mthumb-interwork)], + if test -z "$GNU_CC"; then + AC_MSG_ERROR([--with-thumb-interwork is not supported on non-GNU toolchain-defaults]) + fi + MOZ_THUMB_INTERWORK=$withval) + +MOZ_ARG_WITH_STRING(arch, +[ --with-cpu-arch=[[type|toolchain-default]] + Use specific CPU features (-march=type)], + if test -z "$GNU_CC"; then + AC_MSG_ERROR([--with-arch is not supported on non-GNU toolchain-defaults]) + fi + MOZ_ARCH=$withval) + +MOZ_ARG_WITH_STRING(fpu, +[ --with-fpu=[[type|toolchain-default]] + Use specific FPU type (-mfpu=type)], + if test -z "$GNU_CC"; then + AC_MSG_ERROR([--with-fpu is not supported on non-GNU toolchain-defaults]) + fi + MOZ_FPU=$withval) + +MOZ_ARG_WITH_STRING(float-abi, +[ --with-float-abi=[[type|toolchain-default]] + Use specific arm float ABI (-mfloat-abi=type)], + if test -z "$GNU_CC"; then + AC_MSG_ERROR([--with-float-abi is not supported on non-GNU toolchain-defaults]) + fi + MOZ_FLOAT_ABI=$withval) + +MOZ_ARG_WITH_STRING(soft-float, +[ --with-soft-float[[=yes|no|toolchain-default]] + Use soft float library (-msoft-float)], + if test -z "$GNU_CC"; then + AC_MSG_ERROR([--with-soft-float is not supported on non-GNU toolchain-defaults]) + fi + MOZ_SOFT_FLOAT=$withval) + +case "$MOZ_ARCH" in +toolchain-default|"") + arch_flag="" + ;; +armv7*) + MOZ_ARM_ARCH="armv7" + arch_flag="-march=$MOZ_ARCH" + ;; +*) + arch_flag="-march=$MOZ_ARCH" + ;; +esac + +case "$MOZ_THUMB" in +yes) + MOZ_THUMB2=1 + thumb_flag="-mthumb" + ;; +no) + MOZ_THUMB2= + thumb_flag="-marm" + ;; +*) + _SAVE_CFLAGS="$CFLAGS" + CFLAGS="$arch_flag" + AC_TRY_COMPILE([],[return sizeof(__thumb2__);], + MOZ_THUMB2=1, + MOZ_THUMB2=) + CFLAGS="$_SAVE_CFLAGS" + thumb_flag="" + ;; +esac + +if test "$MOZ_THUMB2" = 1; then + AC_DEFINE(MOZ_THUMB2) fi -dnl ======================================================== -dnl = Enable building for ARM specific CPU features -dnl ======================================================== -MOZ_ARG_WITH_STRING(cpu-arch, -[ --with-cpu-arch=arch Use specific arm architecture CPU features, default armv7], - MOZ_ARM_ARCH=$withval) - -if test -n "$MOZ_THUMB2"; then - case "$target_cpu" in - arm*) - if test "$MOZ_ARM_ARCH" != "armv7"; then - AC_MSG_ERROR([--enable-thumb2 is not compatible with cpu-arch=$MOZ_ARM_ARCH]) - fi - if test "$GNU_CC"; then - AC_DEFINE(MOZ_THUMB2) - AC_DEFINE(MOZ_ARM_ARCH) - CFLAGS="$CFLAGS -march=armv7-a -mthumb $MOZ_ARM_VFP_FLAGS" - CXXFLAGS="$CXXFLAGS -march=armv7-a -mthumb $MOZ_ARM_VFP_FLAGS" - ASFLAGS="$ASFLAGS -march=armv7-a -mthumb $MOZ_ARM_VFP_FLAGS" - else - AC_MSG_ERROR([--enable-thumb2 is not supported for non-GNU toolchains]) - fi - ;; - *) - AC_MSG_ERROR([--enable-thumb2 is not supported for non-ARM CPU architectures]) - ;; - esac -elif test "$MOZ_ARM_ARCH" = "armv7"; then - case "$target_cpu" in - arm*) - if test "$GNU_CC"; then - AC_DEFINE(MOZ_ARM_ARCH) - CFLAGS="$CFLAGS -march=armv7-a -marm $MOZ_ARM_VFP_FLAGS" - CXXFLAGS="$CXXFLAGS -march=armv7-a -marm $MOZ_ARM_VFP_FLAGS" - ASFLAGS="$ASFLAGS -march=armv7-a -marm $MOZ_ARM_VFP_FLAGS" - else - AC_MSG_ERROR([--with-cpu-arch=armv7 is not supported for non-GNU toolchains]) - fi - ;; - *) - AC_MSG_ERROR([--with-cpu-arch=armv7 is not supported for non-ARM CPU architectures]) - ;; - esac -else - case "$target_cpu" in - arm*) - if test "$GNU_CC"; then - CFLAGS="$CFLAGS -march=armv5te -mthumb-interwork -msoft-float" - CXXFLAGS="$CXXFLAGS -march=armv5te -mthumb-interwork -msoft-float" - ASFLAGS="$ASFLAGS -march=armv5te -mthumb-interwork -msoft-float" - fi - ;; - esac +case "$MOZ_THUMB_INTERWORK" in +yes) + thumb_interwork_flag="-mthumb-interwork" + ;; +no) + thumb_interwork_flag="-mno-thumb-interwork" + ;; +*) # toolchain-default + thumb_interwork_flag="" + ;; +esac + +case "$MOZ_FPU" in +toolchain-default|"") + fpu_flag="" + ;; +*) + fpu_flag="-mfpu=$MOZ_FPU" + ;; +esac + +case "$MOZ_FLOAT_ABI" in +toolchain-default|"") + float_abi_flag="" + ;; +*) + float_abi_flag="-mfloat-abi=$MOZ_FLOAT_ABI" + ;; +esac + +case "$MOZ_SOFT_FLOAT" in +yes) + soft_float_flag="-msoft-float" + ;; +no) + soft_float_flag="-mno-soft-float" + ;; +*) # toolchain-default + soft_float_flag="" + ;; +esac + +dnl Use echo to avoid accumulating space characters +all_flags=`echo $arch_flag $thumb_flag $thumb_interwork_flag $fpu_flag $float_abi_flag $soft_float_flag` +if test -n "$all_flags"; then + _SAVE_CFLAGS="$CFLAGS" + CFLAGS="$all_flags" + AC_MSG_CHECKING(whether the chosen combination of compiler flags ($all_flags) works) + AC_TRY_COMPILE([],[return 0;], + AC_MSG_RESULT([yes]), + AC_MSG_ERROR([no])) + + CFLAGS="$_SAVE_CFLAGS $all_flags" + CXXFLAGS="$CXXFLAGS $all_flags" + ASFLAGS="$ASFLAGS $all_flags" + if test -n "$thumb_flag"; then + LDFLAGS="$LDFLAGS $thumb_flag" + fi fi AC_SUBST(MOZ_THUMB2)