joyent/node — pull request #3752 by adammw (2012-07-22 13:43:40+00:00)
Title: Auto-detect hardfloat eabi and armv7 variables on ARM based on compiler

This patch sets the `armv7` variable for v8 GYP files depending on the compiler defined macros, as well as `v8_use_arm_eabi_hardfloat` depending on both the GCC version and macros present.

The code from `host_arch_cc` function has been moved into a `cc_macros` function to prevent code-duplication as the same logic is used by the new `arm_arch_arm7` and `arm_hard_float_abi` which return True if the build system is armv7 or hardfloat abi respectively.

Hardfloat detection code is based on [OS::ArmUsingHardFloat](http://v8.googlecode.com/svn/trunk/src/platform-linux.cc), but is not fool-proof on GCC version 4.5, and can be overridden with an added `--with-float-abi` option to the configure script to manually specify which float abi to use.

Tested that it sets the build correct options with latest version of arm-bcm2708 cross compilers from raspberrypi/tools@ea20f345ee and Ubuntu's gcc-arm-linux-gnueabi package (actual compiled binaries not tested) and has no effect on other non-ARM architectures.

Should help clear up some issues with people attempting to compile node.js directly on a raspberry pi, such as issue #3614, #3732 and others.