diff options
author | Tudor Florea <tudor.florea@enea.com> | 2015-10-08 22:51:41 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2015-10-08 22:51:41 +0200 |
commit | 1219bf8a90a7bf8cd3a5363551ef635d51e8fc8e (patch) | |
tree | a21a5fc103bb3bd65ecd85ed22be5228fc54e447 /meta-oe/recipes-support/mongodb | |
download | meta-openembedded-1219bf8a90a7bf8cd3a5363551ef635d51e8fc8e.tar.gz |
initial commit for Enea Linux 5.0 arm
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta-oe/recipes-support/mongodb')
6 files changed, 355 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/mongodb/mongodb/0001-Make-it-possible-to-disable-the-use-of-v8.patch b/meta-oe/recipes-support/mongodb/mongodb/0001-Make-it-possible-to-disable-the-use-of-v8.patch new file mode 100644 index 000000000..650389e16 --- /dev/null +++ b/meta-oe/recipes-support/mongodb/mongodb/0001-Make-it-possible-to-disable-the-use-of-v8.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | From f1bd00e7f54aad6479bc809c27d5cd3c2fb993eb Mon Sep 17 00:00:00 2001 | ||
2 | From: Michael Hudson-Doyle <michael.hudson@linaro.org> | ||
3 | Date: Fri, 20 Dec 2013 11:10:43 +1300 | ||
4 | Subject: [PATCH 1/5] Make it possible to disable the use of v8. | ||
5 | |||
6 | Currently v8 is always built in, no matter what you pass to scons. | ||
7 | |||
8 | This removes the (useless) --usev8 flag for scons and replaces it with a | ||
9 | --disable-scripting option instead. | ||
10 | --- | ||
11 | SConstruct | 9 ++++++--- | ||
12 | 1 file changed, 6 insertions(+), 3 deletions(-) | ||
13 | |||
14 | diff --git a/SConstruct b/SConstruct | ||
15 | index 3886d1b..6e0ef3b 100644 | ||
16 | --- a/SConstruct | ||
17 | +++ b/SConstruct | ||
18 | @@ -225,7 +225,7 @@ add_option( "asio" , "Use Asynchronous IO (NOT READY YET)" , 0 , True ) | ||
19 | add_option( "ssl" , "Enable SSL" , 0 , True ) | ||
20 | |||
21 | # library choices | ||
22 | -add_option( "usev8" , "use v8 for javascript" , 0 , True ) | ||
23 | +add_option( "disable-scripting" , "do not build support for javascript" , 0 , True ) | ||
24 | add_option( "libc++", "use libc++ (experimental, requires clang)", 0, True ) | ||
25 | |||
26 | # mongo feature options | ||
27 | @@ -442,7 +442,7 @@ static = has_option( "static" ) | ||
28 | |||
29 | noshell = has_option( "noshell" ) | ||
30 | |||
31 | -usev8 = has_option( "usev8" ) | ||
32 | +disable_scripting = has_option( "disable-scripting" ) | ||
33 | |||
34 | asio = has_option( "asio" ) | ||
35 | |||
36 | @@ -600,7 +600,10 @@ if has_option( "durableDefaultOn" ): | ||
37 | if has_option( "durableDefaultOff" ): | ||
38 | env.Append( CPPDEFINES=[ "_DURABLEDEFAULTOFF" ] ) | ||
39 | |||
40 | -usev8 = True | ||
41 | +if disable_scripting or justClientLib: | ||
42 | + usev8 = False | ||
43 | +else: | ||
44 | + usev8 = True | ||
45 | |||
46 | extraLibPlaces = [] | ||
47 | |||
48 | -- | ||
49 | 1.9.0 | ||
50 | |||
diff --git a/meta-oe/recipes-support/mongodb/mongodb/0002-Fix-linking-when-scripting-is-disabled.patch b/meta-oe/recipes-support/mongodb/mongodb/0002-Fix-linking-when-scripting-is-disabled.patch new file mode 100644 index 000000000..b4388d8f0 --- /dev/null +++ b/meta-oe/recipes-support/mongodb/mongodb/0002-Fix-linking-when-scripting-is-disabled.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | From 5b22f64a2e2237082d2733698b07147d27b09ad2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Michael Hudson-Doyle <michael.hudson@linaro.org> | ||
3 | Date: Fri, 20 Dec 2013 12:28:27 +1300 | ||
4 | Subject: [PATCH 2/5] Fix linking when scripting is disabled. | ||
5 | |||
6 | --- | ||
7 | src/mongo/scripting/engine_none.cpp | 4 ++++ | ||
8 | 1 file changed, 4 insertions(+) | ||
9 | |||
10 | diff --git a/src/mongo/scripting/engine_none.cpp b/src/mongo/scripting/engine_none.cpp | ||
11 | index f5c7109..9ae9d57 100644 | ||
12 | --- a/src/mongo/scripting/engine_none.cpp | ||
13 | +++ b/src/mongo/scripting/engine_none.cpp | ||
14 | @@ -33,4 +33,8 @@ namespace mongo { | ||
15 | void ScriptEngine::setup() { | ||
16 | // noop | ||
17 | } | ||
18 | + | ||
19 | + std::string ScriptEngine::getInterpreterVersionString() { | ||
20 | + return "none"; | ||
21 | + } | ||
22 | } | ||
23 | -- | ||
24 | 1.9.0 | ||
25 | |||
diff --git a/meta-oe/recipes-support/mongodb/mongodb/0003-Do-not-build-mongo-binary-when-scripting-is-disabled.patch b/meta-oe/recipes-support/mongodb/mongodb/0003-Do-not-build-mongo-binary-when-scripting-is-disabled.patch new file mode 100644 index 000000000..016ac3584 --- /dev/null +++ b/meta-oe/recipes-support/mongodb/mongodb/0003-Do-not-build-mongo-binary-when-scripting-is-disabled.patch | |||
@@ -0,0 +1,64 @@ | |||
1 | From eab4316597a8e9e7bbf845a054564c6daa4a95b7 Mon Sep 17 00:00:00 2001 | ||
2 | From: Michael Hudson-Doyle <michael.hudson@linaro.org> | ||
3 | Date: Wed, 22 Jan 2014 13:53:10 +1300 | ||
4 | Subject: [PATCH 3/5] * Do not build 'mongo' binary when scripting is disabled | ||
5 | * Do not build the jstests when scripting is disabled | ||
6 | |||
7 | --- | ||
8 | SConstruct | 8 ++++++-- | ||
9 | src/mongo/SConscript | 4 +++- | ||
10 | 2 files changed, 9 insertions(+), 3 deletions(-) | ||
11 | |||
12 | diff --git a/SConstruct b/SConstruct | ||
13 | index 6e0ef3b..c84a669 100644 | ||
14 | --- a/SConstruct | ||
15 | +++ b/SConstruct | ||
16 | @@ -440,10 +440,13 @@ else: | ||
17 | |||
18 | static = has_option( "static" ) | ||
19 | |||
20 | -noshell = has_option( "noshell" ) | ||
21 | - | ||
22 | disable_scripting = has_option( "disable-scripting" ) | ||
23 | |||
24 | +if not disable_scripting: | ||
25 | + noshell = has_option( "noshell" ) | ||
26 | +else: | ||
27 | + noshell = True | ||
28 | + | ||
29 | asio = has_option( "asio" ) | ||
30 | |||
31 | usePCH = has_option( "usePCH" ) | ||
32 | @@ -1662,6 +1665,7 @@ Export("get_option") | ||
33 | Export("has_option use_system_version_of_library") | ||
34 | Export("mongoCodeVersion") | ||
35 | Export("usev8") | ||
36 | +Export("disable_scripting") | ||
37 | Export("darwin windows solaris linux freebsd nix") | ||
38 | Export('module_sconscripts') | ||
39 | Export("debugBuild optBuild") | ||
40 | diff --git a/src/mongo/SConscript b/src/mongo/SConscript | ||
41 | index 58f8406..b4379e7 100644 | ||
42 | --- a/src/mongo/SConscript | ||
43 | +++ b/src/mongo/SConscript | ||
44 | @@ -6,6 +6,7 @@ import os | ||
45 | import itertools | ||
46 | from buildscripts import utils | ||
47 | |||
48 | +Import("disable_scripting") | ||
49 | Import("env") | ||
50 | Import("shellEnv") | ||
51 | Import("testEnv") | ||
52 | @@ -1043,7 +1044,8 @@ test = testEnv.Install( | ||
53 | [ f for f in Glob("dbtests/*.cpp") | ||
54 | if not str(f).endswith('framework.cpp') and | ||
55 | not str(f).endswith('framework_options.cpp') and | ||
56 | - not str(f).endswith('framework_options_init.cpp') ], | ||
57 | + not str(f).endswith('framework_options_init.cpp') and | ||
58 | + not (str(f).endswith('jstests.cpp') and disable_scripting)], | ||
59 | LIBDEPS = [ | ||
60 | "mutable_bson_test_utils", | ||
61 | "mongocommon", | ||
62 | -- | ||
63 | 1.9.0 | ||
64 | |||
diff --git a/meta-oe/recipes-support/mongodb/mongodb/0004-replace-os.uname-with-os.getenv-OE_TARGET_ARCH.patch b/meta-oe/recipes-support/mongodb/mongodb/0004-replace-os.uname-with-os.getenv-OE_TARGET_ARCH.patch new file mode 100644 index 000000000..ade7ec02a --- /dev/null +++ b/meta-oe/recipes-support/mongodb/mongodb/0004-replace-os.uname-with-os.getenv-OE_TARGET_ARCH.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | From d02f33d860f2d11f71e9056782a2e75603d6ec25 Mon Sep 17 00:00:00 2001 | ||
2 | From: Koen Kooi <koen.kooi@linaro.org> | ||
3 | Date: Tue, 4 Feb 2014 10:56:35 +0100 | ||
4 | Subject: [PATCH 4/5] replace os.uname with os.getenv(OE_TARGET_ARCH) | ||
5 | |||
6 | This fixes crosscompilation | ||
7 | |||
8 | Signed-off-by: Koen Kooi <koen.kooi@linaro.org> | ||
9 | Upstream-Status: Inappropiate [OE specific] | ||
10 | --- | ||
11 | SConstruct | 8 ++++---- | ||
12 | 1 file changed, 4 insertions(+), 4 deletions(-) | ||
13 | |||
14 | diff --git a/SConstruct b/SConstruct | ||
15 | index c84a669..05e2ea0 100644 | ||
16 | --- a/SConstruct | ||
17 | +++ b/SConstruct | ||
18 | @@ -257,9 +257,9 @@ add_option( "pch" , "use precompiled headers to speed up the build (experimental | ||
19 | add_option( "distcc" , "use distcc for distributing builds" , 0 , False ) | ||
20 | |||
21 | # debugging/profiling help | ||
22 | -if os.sys.platform.startswith("linux") and (os.uname()[-1] == 'x86_64'): | ||
23 | +if os.sys.platform.startswith("linux") and (os.getenv("OE_TARGET_ARCH") == 'x86_64'): | ||
24 | defaultAllocator = 'tcmalloc' | ||
25 | -elif (os.sys.platform == "darwin") and (os.uname()[-1] == 'x86_64'): | ||
26 | +elif (os.sys.platform == "darwin") and (os.getenv("OE_TARGET_ARCH") == 'x86_64'): | ||
27 | defaultAllocator = 'tcmalloc' | ||
28 | else: | ||
29 | defaultAllocator = 'system' | ||
30 | @@ -633,7 +633,7 @@ if has_option( "extralib" ): | ||
31 | # ---- other build setup ----- | ||
32 | |||
33 | if "uname" in dir(os): | ||
34 | - processor = os.uname()[4] | ||
35 | + processor = os.getenv("OE_TARGET_ARCH") | ||
36 | else: | ||
37 | processor = "i386" | ||
38 | |||
39 | @@ -662,7 +662,7 @@ elif linux: | ||
40 | |||
41 | env.Append( LIBS=['m'] ) | ||
42 | |||
43 | - if os.uname()[4] == "x86_64" and not force32: | ||
44 | + if os.getenv("OE_TARGET_ARCH") == "x86_64" and not force32: | ||
45 | linux64 = True | ||
46 | nixLibPrefix = "lib64" | ||
47 | env.Append( EXTRALIBPATH=["/usr/lib64" , "/lib64" ] ) | ||
48 | -- | ||
49 | 1.9.0 | ||
50 | |||
diff --git a/meta-oe/recipes-support/mongodb/mongodb/0005-GCC-4.7-supports-atomic-ops-for-armv5-and-up-but-onl.patch b/meta-oe/recipes-support/mongodb/mongodb/0005-GCC-4.7-supports-atomic-ops-for-armv5-and-up-but-onl.patch new file mode 100644 index 000000000..490d56485 --- /dev/null +++ b/meta-oe/recipes-support/mongodb/mongodb/0005-GCC-4.7-supports-atomic-ops-for-armv5-and-up-but-onl.patch | |||
@@ -0,0 +1,127 @@ | |||
1 | From e31f85e6915d4bf6ed76c5da71c235525fa4ecc3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Koen Kooi <koen.kooi@linaro.org> | ||
3 | Date: Mon, 14 Apr 2014 10:29:42 +0200 | ||
4 | Subject: [PATCH 5/5] GCC 4.7+ supports atomic ops for armv5 and up, but only | ||
5 | exports the functions for armv6 and up. This patch works around the linker | ||
6 | problems associated with that. | ||
7 | |||
8 | Forward ported from http://pkgs.fedoraproject.org/cgit/mongodb.git/tree/mongodb-2.4.5-atomics.patch | ||
9 | |||
10 | Upstream-status: pending | ||
11 | --- | ||
12 | src/mongo/bson/util/atomic_int.h | 26 ++++++++++++ | ||
13 | src/mongo/platform/atomic_intrinsics_gcc_generic.h | 47 ++++++++++++++++++++++ | ||
14 | 2 files changed, 73 insertions(+) | ||
15 | |||
16 | diff --git a/src/mongo/bson/util/atomic_int.h b/src/mongo/bson/util/atomic_int.h | ||
17 | index 0b85363..ed02c23 100644 | ||
18 | --- a/src/mongo/bson/util/atomic_int.h | ||
19 | +++ b/src/mongo/bson/util/atomic_int.h | ||
20 | @@ -24,6 +24,10 @@ | ||
21 | |||
22 | #include "mongo/platform/compiler.h" | ||
23 | |||
24 | +#define GCC_VERSION (__GNUC__ * 10000 \ | ||
25 | + + __GNUC_MINOR__ * 100 \ | ||
26 | + + __GNUC_PATCHLEVEL__) | ||
27 | + | ||
28 | namespace mongo { | ||
29 | |||
30 | /** | ||
31 | @@ -72,6 +76,28 @@ namespace mongo { | ||
32 | InterlockedAdd((volatile long *)&x,by); | ||
33 | } | ||
34 | # endif | ||
35 | +#elif defined(GCC_VERSION) && GCC_VERSION >= 40700 | ||
36 | +// in GCC version >= 4.7.0 we can use the built-in atomic operations | ||
37 | + | ||
38 | + inline void AtomicUInt::set(unsigned newX) { | ||
39 | + __atomic_store_n (&x, newX, __ATOMIC_SEQ_CST); | ||
40 | + } | ||
41 | + AtomicUInt AtomicUInt::operator++() { // ++prefix | ||
42 | + return __atomic_add_fetch(&x, 1, __ATOMIC_SEQ_CST); | ||
43 | + } | ||
44 | + AtomicUInt AtomicUInt::operator++(int) { // postfix++ | ||
45 | + return __atomic_fetch_add(&x, 1, __ATOMIC_SEQ_CST); | ||
46 | + } | ||
47 | + AtomicUInt AtomicUInt::operator--() { // --prefix | ||
48 | + return __atomic_add_fetch(&x, -1, __ATOMIC_SEQ_CST); | ||
49 | + } | ||
50 | + AtomicUInt AtomicUInt::operator--(int) { // postfix-- | ||
51 | + return __atomic_fetch_add(&x, -1, __ATOMIC_SEQ_CST); | ||
52 | + } | ||
53 | + void AtomicUInt::signedAdd(int by) { | ||
54 | + __atomic_fetch_add(&x, by, __ATOMIC_SEQ_CST); | ||
55 | + } | ||
56 | + | ||
57 | #elif defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) | ||
58 | // this is in GCC >= 4.1 | ||
59 | inline void AtomicUInt::set(unsigned newX) { __sync_synchronize(); x = newX; } | ||
60 | diff --git a/src/mongo/platform/atomic_intrinsics_gcc_generic.h b/src/mongo/platform/atomic_intrinsics_gcc_generic.h | ||
61 | index 64a2499..b7cc176 100644 | ||
62 | --- a/src/mongo/platform/atomic_intrinsics_gcc_generic.h | ||
63 | +++ b/src/mongo/platform/atomic_intrinsics_gcc_generic.h | ||
64 | @@ -22,8 +22,53 @@ | ||
65 | |||
66 | #include <boost/utility.hpp> | ||
67 | |||
68 | +#define GCC_VERSION (__GNUC__ * 10000 \ | ||
69 | + + __GNUC_MINOR__ * 100 \ | ||
70 | + + __GNUC_PATCHLEVEL__) | ||
71 | + | ||
72 | namespace mongo { | ||
73 | |||
74 | +// If GCC version >= 4.7.0, we can use the built-in atomic operations | ||
75 | +#if defined(GCC_VERSION) && GCC_VERSION >= 40700 | ||
76 | + | ||
77 | + /** | ||
78 | + * Instantiation of AtomicIntrinsics<>. | ||
79 | + */ | ||
80 | + template <typename T> | ||
81 | + class AtomicIntrinsics { | ||
82 | + public: | ||
83 | + | ||
84 | + static T compareAndSwap(volatile T* dest, T expected, T newValue) { | ||
85 | + return __atomic_compare_exchange_n (dest, &expected, newValue, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); | ||
86 | + } | ||
87 | + | ||
88 | + static T swap(volatile T* dest, T newValue) { | ||
89 | + return __atomic_exchange_n (dest, newValue, __ATOMIC_SEQ_CST); | ||
90 | + } | ||
91 | + | ||
92 | + static T load(volatile const T* value) { | ||
93 | + return __atomic_load_n (value, __ATOMIC_SEQ_CST); | ||
94 | + } | ||
95 | + | ||
96 | + static T loadRelaxed(volatile const T* value) { | ||
97 | + return *value; | ||
98 | + } | ||
99 | + | ||
100 | + static void store(volatile T* dest, T newValue) { | ||
101 | + __atomic_store_n (dest, newValue, __ATOMIC_SEQ_CST); | ||
102 | + } | ||
103 | + | ||
104 | + static T fetchAndAdd(volatile T* dest, T increment) { | ||
105 | + return __atomic_fetch_add (dest, increment, __ATOMIC_SEQ_CST); | ||
106 | + } | ||
107 | + | ||
108 | + private: | ||
109 | + AtomicIntrinsics(); | ||
110 | + ~AtomicIntrinsics(); | ||
111 | + }; | ||
112 | + | ||
113 | +#else // GCC version < 4.7, so we must use legacy (platform-specific) atomic operations | ||
114 | + | ||
115 | /** | ||
116 | * Instantiation of AtomicIntrinsics<> for all word types T. | ||
117 | */ | ||
118 | @@ -67,4 +112,6 @@ namespace mongo { | ||
119 | ~AtomicIntrinsics(); | ||
120 | }; | ||
121 | |||
122 | +#endif // GCC_VERSION >= 40700 | ||
123 | + | ||
124 | } // namespace mongo | ||
125 | -- | ||
126 | 1.9.0 | ||
127 | |||
diff --git a/meta-oe/recipes-support/mongodb/mongodb_git.bb b/meta-oe/recipes-support/mongodb/mongodb_git.bb new file mode 100644 index 000000000..2701c4cfc --- /dev/null +++ b/meta-oe/recipes-support/mongodb/mongodb_git.bb | |||
@@ -0,0 +1,39 @@ | |||
1 | SUMMARY = "mongodb" | ||
2 | LICENSE = "AGPL-3.0 & Apache-2.0" | ||
3 | LIC_FILES_CHKSUM = "file://GNU-AGPL-3.0.txt;md5=73f1eb20517c55bf9493b7dd6e480788 \ | ||
4 | file://APACHE-2.0.txt;md5=3b83ef96387f14655fc854ddc3c6bd57" | ||
5 | |||
6 | DEPENDS = "openssl libpcre boost libpcap" | ||
7 | # Mongo uses tcmalloc on x86_64, which is provided by gperftools | ||
8 | DEPENDS_append_x86-64 = " gperftools" | ||
9 | |||
10 | inherit scons | ||
11 | |||
12 | PV = "2.6.0+git${SRCPV}" | ||
13 | SRCREV = "be1905c24c7e5ea258e537fbf0d2c502c4fc6de2" | ||
14 | SRC_URI = "git://github.com/mongodb/mongo.git;branch=v2.6 \ | ||
15 | file://0001-Make-it-possible-to-disable-the-use-of-v8.patch \ | ||
16 | file://0002-Fix-linking-when-scripting-is-disabled.patch \ | ||
17 | file://0003-Do-not-build-mongo-binary-when-scripting-is-disabled.patch \ | ||
18 | file://0004-replace-os.uname-with-os.getenv-OE_TARGET_ARCH.patch \ | ||
19 | file://0005-GCC-4.7-supports-atomic-ops-for-armv5-and-up-but-onl.patch \ | ||
20 | " | ||
21 | |||
22 | S = "${WORKDIR}/git" | ||
23 | |||
24 | export OE_TARGET_ARCH="${TARGET_ARCH}" | ||
25 | |||
26 | EXTRA_OESCONS = "--prefix=${D}${prefix} \ | ||
27 | --propagate-shell-environment \ | ||
28 | --cc-use-shell-environment \ | ||
29 | --cxx-use-shell-environment \ | ||
30 | --ld='${TARGET_PREFIX}g++' \ | ||
31 | --ssl \ | ||
32 | --use-system-pcre \ | ||
33 | --use-system-boost \ | ||
34 | --use-system-tcmalloc \ | ||
35 | --disable-scripting \ | ||
36 | --nostrip \ | ||
37 | mongod mongos" | ||
38 | |||
39 | |||