Commit 41a5c921 authored by ager@chromium.org's avatar ager@chromium.org

Apply patch from Alexander Botero-Lowry that adds FreeBSD platform

support.
Review URL: http://codereview.chromium.org/11347

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@815 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent ced1493d
......@@ -11,3 +11,4 @@ Jay Freeman <saurik@saurik.com>
Daniel James <dnljms@gmail.com>
Paolo Giarrusso <p.giarrusso@gmail.com>
Daniel Andersson <kodandersson@gmail.com>
Alexander Botero-Lowry <alexbl@FreeBSD.org>
......@@ -54,6 +54,9 @@ LIBRARY_FLAGS = {
'mode:release': {
'CCFLAGS': ['-O3', '-fomit-frame-pointer']
},
'os:freebsd': {
'LIBS': ['execinfo']
},
'wordsize:64': {
'CCFLAGS': ['-m32'],
'LINKFLAGS': ['-m32']
......@@ -186,6 +189,9 @@ SAMPLE_FLAGS = {
'LIBS': ['pthread'],
'LIBPATH': ['.']
},
'os:freebsd': {
'LIBS': ['execinfo']
},
'wordsize:64': {
'CCFLAGS': ['-m32'],
'LINKFLAGS': ['-m32']
......@@ -264,7 +270,7 @@ SIMPLE_OPTIONS = {
'help': 'the toolchain to use'
},
'os': {
'values': ['linux', 'macos', 'win32'],
'values': ['freebsd', 'linux', 'macos', 'win32'],
'default': OS_GUESS,
'help': 'the os to build for'
},
......@@ -541,7 +547,7 @@ def Build():
env.Alias('cctests', cctests)
env.Alias('sample', samples)
env.Alias('d8', d8s)
if env['sample']:
env.Default('sample')
else:
......
......@@ -55,10 +55,11 @@ SOURCES = {
'cpu-ia32.cc', 'disasm-ia32.cc', 'frames-ia32.cc', 'ic-ia32.cc',
'macro-assembler-ia32.cc', 'stub-cache-ia32.cc'],
'simulator:arm': ['simulator-arm.cc'],
'os:linux': ['platform-linux.cc'],
'os:macos': ['platform-macos.cc'],
'os:nullos': ['platform-nullos.cc'],
'os:win32': ['platform-win32.cc'],
'os:freebsd': ['platform-freebsd.cc'],
'os:linux': ['platform-linux.cc'],
'os:macos': ['platform-macos.cc'],
'os:nullos': ['platform-nullos.cc'],
'os:win32': ['platform-win32.cc'],
'mode:release': [],
'mode:debug': ['objects-debug.cc', 'prettyprinter.cc']
}
......
......@@ -37,7 +37,8 @@
* subtly wrong.
*/
#if !(defined(__APPLE__) && defined(__MACH__)) && !defined(WIN32)
#if !(defined(__APPLE__) && defined(__MACH__)) && \
!defined(WIN32) && !defined(__FreeBSD__)
#include <endian.h>
#endif
#include <math.h>
......@@ -46,17 +47,18 @@
/* The floating point word order on ARM is big endian when floating point
* emulation is used, even if the byte order is little endian */
#if !(defined(__APPLE__) && defined(__MACH__)) && !defined(WIN32) && \
__FLOAT_WORD_ORDER == __BIG_ENDIAN
!defined(__FreeBSD__) && __FLOAT_WORD_ORDER == __BIG_ENDIAN
#define IEEE_MC68k
#else
#define IEEE_8087
#endif
#define __MATH_H__
#if defined(__APPLE__) && defined(__MACH__)
/* stdlib.h on Apple's 10.5 and later SDKs will mangle the name of strtod.
* If it's included after strtod is redefined as gay_strtod, it will mangle
* the name of gay_strtod, which is unwanted. */
#if defined(__APPLE__) && defined(__MACH__) || defined(__FreeBSD__)
/* stdlib.h on FreeBSD and Apple's 10.5 and later SDKs will mangle the
* name of strtod. If it's included after strtod is redefined as
* gay_strtod, it will mangle the name of gay_strtod, which is
* unwanted. */
#include <stdlib.h>
#endif
/* Make sure we use the David M. Gay version of strtod(). On Linux, we
......
This diff is collapsed.
......@@ -42,7 +42,7 @@ def ReadLinesFrom(name):
list.append(line)
return list
def GuessOS():
id = platform.system()
if id == 'Linux':
......@@ -53,6 +53,8 @@ def GuessOS():
# On Windows Vista platform.system() can return 'Microsoft' with some
# versions of Python, see http://bugs.python.org/issue1082
return 'win32'
elif id == 'FreeBSD':
return 'freebsd'
else:
return None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment