[oe-commits] Khem Raj : v8: Add recipes for v8/google's opensource JavaScript Engine

git version control git at git.openembedded.org
Mon Jan 24 02:36:25 UTC 2011


Module: openembedded.git
Branch: master
Commit: ffc1260a51cc6e08d1d6fe90d233a400808fe39a
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=ffc1260a51cc6e08d1d6fe90d233a400808fe39a

Author: Khem Raj <raj.khem at gmail.com>
Date:   Sun Jan 23 18:34:46 2011 -0800

v8: Add recipes for v8/google's opensource JavaScript Engine

* Fixed Bugzilla/5486

Signed-off-by: Khem Raj <raj.khem at gmail.com>

---

 recipes/v8/v8/0001-enable_soname.patch          |   13 +++++
 recipes/v8/v8/0004-add-the-install-target.patch |   39 ++++++++++++++++
 recipes/v8/v8/SConstruct.patch                  |   17 +++++++
 recipes/v8/v8_svn.bb                            |   55 +++++++++++++++++++++++
 4 files changed, 124 insertions(+), 0 deletions(-)

diff --git a/recipes/v8/v8/0001-enable_soname.patch b/recipes/v8/v8/0001-enable_soname.patch
new file mode 100644
index 0000000..565b036
--- /dev/null
+++ b/recipes/v8/v8/0001-enable_soname.patch
@@ -0,0 +1,13 @@
+patch to enable the soname that is not automatically shipped with SConstruct
+
+--- a/src/version.cc
++++ b/src/version.cc
+@@ -41,7 +41,7 @@
+ // Define SONAME to have the SCons build the put a specific SONAME into the
+ // shared library instead the generic SONAME generated from the V8 version
+ // number. This define is mainly used by the SCons build script.
+-#define SONAME            ""
++#define SONAME            "libv8.so.2.2.24"
+ 
+ namespace v8 {
+ namespace internal {
diff --git a/recipes/v8/v8/0004-add-the-install-target.patch b/recipes/v8/v8/0004-add-the-install-target.patch
new file mode 100644
index 0000000..e50a35c
--- /dev/null
+++ b/recipes/v8/v8/0004-add-the-install-target.patch
@@ -0,0 +1,39 @@
+--- trunk/SConstruct.orig	2010-11-20 21:41:59.000000000 +0000
++++ trunk/SConstruct	2010-11-20 21:45:56.000000000 +0000
+@@ -665,6 +665,7 @@
+   result.Add('mode', 'compilation mode (debug, release)', 'release')
+   result.Add('sample', 'build sample (shell, process)', '')
+   result.Add('env', 'override environment settings (NAME0:value0,NAME1:value1,...)', '')
++  result.Add('install', 'install result files', '')
+   result.Add('importenv', 'import environment settings (NAME0,NAME1,...)', '')
+   for (name, option) in SIMPLE_OPTIONS.iteritems():
+     help = '%s (%s)' % (name, ", ".join(option['values']))
+@@ -997,8 +998,28 @@
+   env.Alias('sample', samples)
+   env.Alias('d8', d8s)
+ 
++  install_dirs = []
++  destdir = ARGUMENTS.get('DESTDIR', '')
++  prefix = ARGUMENTS.get('PREFIX', '/usr')
++  libdir = [ destdir + prefix + '/lib/' ]
++  incdir = [ destdir + prefix + '/include/' ]
++  for lib in libraries:
++    env.Install(libdir, lib[0])
++    if dir not in install_dirs:
++      install_dirs += libdir
++  for include in [ 'include/v8.h', 'include/v8-debug.h' ]:
++    env.Install(incdir, include);
++  install_dirs += incdir
++  env.Alias('install', install_dirs)
++
++  # Always build at least the library
++  env.Default('library')
++
+   if env['sample']:
+     env.Default('sample')
++  elif env['install']:
++    env.Default('install')
++
+   else:
+     env.Default('library')
+ 
diff --git a/recipes/v8/v8/SConstruct.patch b/recipes/v8/v8/SConstruct.patch
new file mode 100644
index 0000000..61caa67
--- /dev/null
+++ b/recipes/v8/v8/SConstruct.patch
@@ -0,0 +1,17 @@
+--- trunk/SConstruct.orig	2010-11-20 19:18:33.000000000 +0000
++++ trunk/SConstruct	2010-11-20 19:18:25.000000000 +0000
+@@ -963,6 +963,14 @@
+ def Build():
+   opts = GetOptions()
+   env = Environment(options=opts)
++  env['CC'] = os.environ['CC']
++  env['CXX'] = os.environ['CXX']
++  env['CPP'] = os.environ['CPP']
++  env['AR'] = os.environ['AR']
++  env['LD'] = os.environ['LD']
++  env['CCLD'] = os.environ['CCLD']
++  env['ENV']['PATH'] = os.environ['PATH']
++  env['LINKFLAGS'] = os.environ['TARGET_LINK_HASH_STYLE'] + " " + env['LINKFLAGS']
+   Help(opts.GenerateHelpText(env))
+   VerifyOptions(env)
+   env_overrides = ParseEnvOverrides(env['env'], env['importenv'])
diff --git a/recipes/v8/v8_svn.bb b/recipes/v8/v8_svn.bb
new file mode 100644
index 0000000..aab0fc2
--- /dev/null
+++ b/recipes/v8/v8_svn.bb
@@ -0,0 +1,55 @@
+# v8 OE build file
+# Copyright (C) 2005, Advanced Micro Devices, Inc.  All Rights Reserved
+# Released under the MIT license (see packages/COPYING)
+DESCRIPTION = "V8 is Google's open source JavaScript engine."
+HOMEPAGE = "http://code.google.com/p/v8/"
+SECTION = "libs"
+PRIORITY = "optional"
+LICENSE = "BSD"
+PR = "r0"
+
+PV = "0.0+svnr${SRCPV}"
+SRCREV = "3431"
+
+SRC_URI = "svn://v8.googlecode.com/svn/;module=trunk;proto=http;rev=${SRCREV} \
+        file://SConstruct.patch \
+        file://0004-add-the-install-target.patch \
+	 "
+
+S = "${WORKDIR}/trunk"
+
+export V8_TARGET_ARCH_ARM = "\
+                 -msoft-float \
+                 -fpic \
+                 -funwind-tables \
+                 -fstack-protector \
+                 -fno-short-enums \
+                 -fmessage-length=0 \
+                 -finline-functions \
+                 -fno-inline-functions-called-once \
+                 -fgcse-after-reload \
+                 -frerun-cse-after-loop \
+                 -frename-registers \
+                 -fomit-frame-pointer \
+                 -fno-strict-aliasing \
+                 -finline-limit=64 \
+                 -MD \
+                 -D__ARM_ARCH_5__ \
+                 -D__ARM_ARCH_5T__ \
+                 -D__ARM_ARCH_5TE__ \
+            "
+
+export LINKFLAGS = "${LDFLAGS}"
+
+SCONS_EXTRA_COMPILE_ARGS = "\
+                arch=${TARGET_ARCH} \
+                importenv=PATH,LINKFLAGS,V8_TARGET_ARCH_ARM \
+                library=shared \
+                soname=on \
+                shlibtype=hidden \
+        "
+
+SCONS_EXTRA_INSTALL_ARGS = "${SCONS_EXTRA_COMPILE_ARGS}"
+
+inherit scons
+





More information about the Openembedded-commits mailing list