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