leveldb 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 39f09bcd9ed833797306c673c09e81482afedfe8
4
- data.tar.gz: 08c71c65dcf4ac2ec68c62bf6173467ed3e07301
3
+ metadata.gz: 1ecf89eb508fbc6e5120013fad1c1bb7353746a4
4
+ data.tar.gz: 36746040ca375ab9cd2aab9f36d6aafce0171edd
5
5
  SHA512:
6
- metadata.gz: affebf16615c3dcba550d756c44254641b1efc1f21c0f035754079b4ae5e4e5a7fd5ec496c1bb5b36199bedac54ee9dff0388ce0a5fd34140897e50949842359
7
- data.tar.gz: 333c4c2eaf9e834c65849e5d46f10126d1b74944a24a799b4c0038ecf45e77d9c1b55c31f9506bc898fe887a02d56067510ff0fa749b321850f9166d5a45c0e4
6
+ metadata.gz: 82eb25d402810f64ea20a40d11bcbe2c800cd119e0e216126a2161b684e78df76c763a84dad8697bb2e70530c2f71def811f6dadd3e05e7e13c87d5da11ee28d
7
+ data.tar.gz: 7d73621c51902dba62fb34145d6cc5785933bf354b8ef6c1f6bb78db5a788de03e86fab0021ca80bdfaab83e2ebabdc4fc7919d396a2b0c317bb9e7aa11f7bb9
@@ -0,0 +1,211 @@
1
+ #!/bin/sh
2
+ #
3
+ # Detects OS we're compiling on and outputs a file specified by the first
4
+ # argument, which in turn gets read while processing Makefile.
5
+ #
6
+ # The output will set the following variables:
7
+ # CC C Compiler path
8
+ # CXX C++ Compiler path
9
+ # PLATFORM_LDFLAGS Linker flags
10
+ # PLATFORM_LIBS Libraries flags
11
+ # PLATFORM_SHARED_EXT Extension for shared libraries
12
+ # PLATFORM_SHARED_LDFLAGS Flags for building shared library
13
+ # This flag is embedded just before the name
14
+ # of the shared library without intervening spaces
15
+ # PLATFORM_SHARED_CFLAGS Flags for compiling objects for shared library
16
+ # PLATFORM_CCFLAGS C compiler flags
17
+ # PLATFORM_CXXFLAGS C++ compiler flags. Will contain:
18
+ # PLATFORM_SHARED_VERSIONED Set to 'true' if platform supports versioned
19
+ # shared libraries, empty otherwise.
20
+ #
21
+ # The PLATFORM_CCFLAGS and PLATFORM_CXXFLAGS might include the following:
22
+ #
23
+ # -DLEVELDB_CSTDATOMIC_PRESENT if <cstdatomic> is present
24
+ # -DLEVELDB_PLATFORM_POSIX for Posix-based platforms
25
+ # -DSNAPPY if the Snappy library is present
26
+ #
27
+
28
+ OUTPUT=$1
29
+ PREFIX=$2
30
+ if test -z "$OUTPUT" || test -z "$PREFIX"; then
31
+ echo "usage: $0 <output-filename> <directory_prefix>" >&2
32
+ exit 1
33
+ fi
34
+
35
+ # Delete existing output, if it exists
36
+ rm -f $OUTPUT
37
+ touch $OUTPUT
38
+
39
+ if test -z "$CC"; then
40
+ CC=cc
41
+ fi
42
+
43
+ if test -z "$CXX"; then
44
+ CXX=g++
45
+ fi
46
+
47
+ if test -z "$TMPDIR"; then
48
+ TMPDIR=/tmp
49
+ fi
50
+
51
+ # Detect OS
52
+ if test -z "$TARGET_OS"; then
53
+ TARGET_OS=`uname -s`
54
+ fi
55
+
56
+ COMMON_FLAGS=
57
+ CROSS_COMPILE=
58
+ PLATFORM_CCFLAGS=
59
+ PLATFORM_CXXFLAGS=
60
+ PLATFORM_LDFLAGS=
61
+ PLATFORM_LIBS=
62
+ PLATFORM_SHARED_EXT="so"
63
+ PLATFORM_SHARED_LDFLAGS="-shared -Wl,-soname -Wl,"
64
+ PLATFORM_SHARED_CFLAGS="-fPIC"
65
+ PLATFORM_SHARED_VERSIONED=true
66
+
67
+ MEMCMP_FLAG=
68
+ if [ "$CXX" = "g++" ]; then
69
+ # Use libc's memcmp instead of GCC's memcmp. This results in ~40%
70
+ # performance improvement on readrandom under gcc 4.4.3 on Linux/x86.
71
+ MEMCMP_FLAG="-fno-builtin-memcmp"
72
+ fi
73
+
74
+ case "$TARGET_OS" in
75
+ Darwin)
76
+ PLATFORM=OS_MACOSX
77
+ COMMON_FLAGS="$MEMCMP_FLAG -DOS_MACOSX"
78
+ PLATFORM_SHARED_EXT=dylib
79
+ [ -z "$INSTALL_PATH" ] && INSTALL_PATH=`pwd`
80
+ PLATFORM_SHARED_LDFLAGS="-dynamiclib -install_name $INSTALL_PATH/"
81
+ PORT_FILE=port/port_posix.cc
82
+ ;;
83
+ Linux)
84
+ PLATFORM=OS_LINUX
85
+ COMMON_FLAGS="$MEMCMP_FLAG -pthread -DOS_LINUX"
86
+ PLATFORM_LDFLAGS="-pthread"
87
+ PORT_FILE=port/port_posix.cc
88
+ ;;
89
+ SunOS)
90
+ PLATFORM=OS_SOLARIS
91
+ COMMON_FLAGS="$MEMCMP_FLAG -D_REENTRANT -DOS_SOLARIS"
92
+ PLATFORM_LIBS="-lpthread -lrt"
93
+ PORT_FILE=port/port_posix.cc
94
+ ;;
95
+ FreeBSD)
96
+ PLATFORM=OS_FREEBSD
97
+ COMMON_FLAGS="$MEMCMP_FLAG -D_REENTRANT -DOS_FREEBSD"
98
+ PLATFORM_LIBS="-lpthread"
99
+ PORT_FILE=port/port_posix.cc
100
+ ;;
101
+ NetBSD)
102
+ PLATFORM=OS_NETBSD
103
+ COMMON_FLAGS="$MEMCMP_FLAG -D_REENTRANT -DOS_NETBSD"
104
+ PLATFORM_LIBS="-lpthread -lgcc_s"
105
+ PORT_FILE=port/port_posix.cc
106
+ ;;
107
+ OpenBSD)
108
+ PLATFORM=OS_OPENBSD
109
+ COMMON_FLAGS="$MEMCMP_FLAG -D_REENTRANT -DOS_OPENBSD"
110
+ PLATFORM_LDFLAGS="-pthread"
111
+ PORT_FILE=port/port_posix.cc
112
+ ;;
113
+ DragonFly)
114
+ PLATFORM=OS_DRAGONFLYBSD
115
+ COMMON_FLAGS="$MEMCMP_FLAG -D_REENTRANT -DOS_DRAGONFLYBSD"
116
+ PLATFORM_LIBS="-lpthread"
117
+ PORT_FILE=port/port_posix.cc
118
+ ;;
119
+ OS_ANDROID_CROSSCOMPILE)
120
+ PLATFORM=OS_ANDROID
121
+ COMMON_FLAGS="$MEMCMP_FLAG -D_REENTRANT -DOS_ANDROID -DLEVELDB_PLATFORM_POSIX"
122
+ PLATFORM_LDFLAGS="" # All pthread features are in the Android C library
123
+ PORT_FILE=port/port_posix.cc
124
+ CROSS_COMPILE=true
125
+ ;;
126
+ HP-UX)
127
+ PLATFORM=OS_HPUX
128
+ COMMON_FLAGS="$MEMCMP_FLAG -D_REENTRANT -DOS_HPUX"
129
+ PLATFORM_LDFLAGS="-pthread"
130
+ PORT_FILE=port/port_posix.cc
131
+ # man ld: +h internal_name
132
+ PLATFORM_SHARED_LDFLAGS="-shared -Wl,+h -Wl,"
133
+ ;;
134
+ *)
135
+ echo "Unknown platform!" >&2
136
+ exit 1
137
+ esac
138
+
139
+ # We want to make a list of all cc files within util, db, table, and helpers
140
+ # except for the test and benchmark files. By default, find will output a list
141
+ # of all files matching either rule, so we need to append -print to make the
142
+ # prune take effect.
143
+ DIRS="$PREFIX/db $PREFIX/util $PREFIX/table"
144
+
145
+ set -f # temporarily disable globbing so that our patterns aren't expanded
146
+ PRUNE_TEST="-name *test*.cc -prune"
147
+ PRUNE_BENCH="-name *_bench.cc -prune"
148
+ PRUNE_TOOL="-name leveldb_main.cc -prune"
149
+ PORTABLE_FILES=`find $DIRS $PRUNE_TEST -o $PRUNE_BENCH -o $PRUNE_TOOL -o -name '*.cc' -print | sort | sed "s,^$PREFIX/,," | tr "\n" " "`
150
+
151
+ set +f # re-enable globbing
152
+
153
+ # The sources consist of the portable files, plus the platform-specific port
154
+ # file.
155
+ echo "SOURCES=$PORTABLE_FILES $PORT_FILE" >> $OUTPUT
156
+ echo "MEMENV_SOURCES=helpers/memenv/memenv.cc" >> $OUTPUT
157
+
158
+ if [ "$CROSS_COMPILE" = "true" ]; then
159
+ # Cross-compiling; do not try any compilation tests.
160
+ true
161
+ else
162
+ CXXOUTPUT="${TMPDIR}/leveldb_build_detect_platform-cxx.$$"
163
+
164
+ # If -std=c++0x works, use <cstdatomic>. Otherwise use port_posix.h.
165
+ $CXX $CXXFLAGS -std=c++0x -x c++ - -o $CXXOUTPUT 2>/dev/null <<EOF
166
+ #include <cstdatomic>
167
+ int main() {}
168
+ EOF
169
+ if [ "$?" = 0 ]; then
170
+ COMMON_FLAGS="$COMMON_FLAGS -DLEVELDB_PLATFORM_POSIX -DLEVELDB_CSTDATOMIC_PRESENT"
171
+ PLATFORM_CXXFLAGS="-std=c++0x"
172
+ else
173
+ COMMON_FLAGS="$COMMON_FLAGS -DLEVELDB_PLATFORM_POSIX"
174
+ fi
175
+
176
+ # Test whether Snappy library is installed
177
+ # http://code.google.com/p/snappy/
178
+ $CXX $CXXFLAGS -x c++ - -o $CXXOUTPUT 2>/dev/null <<EOF
179
+ #include <snappy.h>
180
+ int main() {}
181
+ EOF
182
+ if [ "$?" = 0 ]; then
183
+ COMMON_FLAGS="$COMMON_FLAGS -DSNAPPY"
184
+ PLATFORM_LIBS="$PLATFORM_LIBS -lsnappy"
185
+ fi
186
+
187
+ # Test whether tcmalloc is available
188
+ $CXX $CXXFLAGS -x c++ - -o $CXXOUTPUT -ltcmalloc 2>/dev/null <<EOF
189
+ int main() {}
190
+ EOF
191
+ if [ "$?" = 0 ]; then
192
+ PLATFORM_LIBS="$PLATFORM_LIBS -ltcmalloc"
193
+ fi
194
+
195
+ rm -f $CXXOUTPUT 2>/dev/null
196
+ fi
197
+
198
+ PLATFORM_CCFLAGS="$PLATFORM_CCFLAGS $COMMON_FLAGS"
199
+ PLATFORM_CXXFLAGS="$PLATFORM_CXXFLAGS $COMMON_FLAGS"
200
+
201
+ echo "CC=$CC" >> $OUTPUT
202
+ echo "CXX=$CXX" >> $OUTPUT
203
+ echo "PLATFORM=$PLATFORM" >> $OUTPUT
204
+ echo "PLATFORM_LDFLAGS=$PLATFORM_LDFLAGS" >> $OUTPUT
205
+ echo "PLATFORM_LIBS=$PLATFORM_LIBS" >> $OUTPUT
206
+ echo "PLATFORM_CCFLAGS=$PLATFORM_CCFLAGS" >> $OUTPUT
207
+ echo "PLATFORM_CXXFLAGS=$PLATFORM_CXXFLAGS" >> $OUTPUT
208
+ echo "PLATFORM_SHARED_CFLAGS=$PLATFORM_SHARED_CFLAGS" >> $OUTPUT
209
+ echo "PLATFORM_SHARED_EXT=$PLATFORM_SHARED_EXT" >> $OUTPUT
210
+ echo "PLATFORM_SHARED_LDFLAGS=$PLATFORM_SHARED_LDFLAGS" >> $OUTPUT
211
+ echo "PLATFORM_SHARED_VERSIONED=$PLATFORM_SHARED_VERSIONED" >> $OUTPUT
@@ -1,3 +1,3 @@
1
1
  module LevelDB
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leveldb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - DAddYE
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-20 00:00:00.000000000 Z
11
+ date: 2013-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fiddler-rb
@@ -211,6 +211,7 @@ files:
211
211
  - ext/leveldb/util/testutil.h
212
212
  - ext/leveldb/LICENSE
213
213
  - ext/leveldb/Makefile
214
+ - ext/leveldb/build_detect_platform
214
215
  - lib/leveldb/batch.rb
215
216
  - lib/leveldb/db.rb
216
217
  - lib/leveldb/iterator.rb