2012-09-05 09:02:16 +02:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Set environment variables so that we can compile leveldb using
|
|
|
|
# fbcode settings. It uses the latest g++ compiler and also
|
|
|
|
# uses jemalloc
|
|
|
|
|
2013-10-18 23:50:54 +02:00
|
|
|
TOOLCHAIN_REV=fbe3b095a4cc4a3713730050d182b7b4a80c342f
|
2012-09-05 09:02:16 +02:00
|
|
|
TOOLCHAIN_EXECUTABLES="/mnt/gvfs/third-party/$TOOLCHAIN_REV/centos5.2-native"
|
|
|
|
TOOLCHAIN_LIB_BASE="/mnt/gvfs/third-party/$TOOLCHAIN_REV/gcc-4.7.1-glibc-2.14.1"
|
2013-10-18 23:50:54 +02:00
|
|
|
TOOL_JEMALLOC=jemalloc-3.3.1/9202ce3
|
2012-09-05 09:02:16 +02:00
|
|
|
|
|
|
|
# location of libhdfs libraries
|
|
|
|
if test "$USE_HDFS"; then
|
|
|
|
JAVA_HOME="/usr/local/jdk-6u22-64"
|
|
|
|
JINCLUDE="-I$JAVA_HOME/include -I$JAVA_HOME/include/linux"
|
|
|
|
GLIBC_RUNTIME_PATH="/usr/local/fbcode/gcc-4.7.1-glibc-2.14.1"
|
|
|
|
HDFSLIB=" -Wl,--no-whole-archive hdfs/libhdfs.a -L$JAVA_HOME/jre/lib/amd64 "
|
2013-10-24 16:43:14 +02:00
|
|
|
HDFSLIB+=" -L$JAVA_HOME/jre/lib/amd64/server -L$GLIBC_RUNTIME_PATH/lib "
|
2012-09-05 09:02:16 +02:00
|
|
|
HDFSLIB+=" -ldl -lverify -ljava -ljvm "
|
|
|
|
fi
|
|
|
|
|
2013-11-18 22:50:34 +01:00
|
|
|
# location of libgcc
|
|
|
|
LIBGCC_INCLUDE=" -I $TOOLCHAIN_LIB_BASE/libgcc/libgcc-4.7.1/afc21dc/include"
|
|
|
|
LIBGCC_LIBS=" -L $TOOLCHAIN_LIB_BASE/libgcc/libgcc-4.7.1/afc21dc/libs"
|
|
|
|
|
|
|
|
# location of glibc
|
|
|
|
GLIBC_INCLUDE=" -I $TOOLCHAIN_LIB_BASE/glibc/glibc-2.14.1/99df8fc/include"
|
|
|
|
GLIBC_LIBS=" -L $TOOLCHAIN_LIB_BASE/glibc/glibc-2.14.1/99df8fc/lib"
|
|
|
|
|
2012-09-05 09:02:16 +02:00
|
|
|
# location of snappy headers and libraries
|
2012-11-21 01:14:04 +01:00
|
|
|
SNAPPY_INCLUDE=" -I $TOOLCHAIN_LIB_BASE/snappy/snappy-1.0.3/7518bbe/include"
|
|
|
|
SNAPPY_LIBS=" $TOOLCHAIN_LIB_BASE/snappy/snappy-1.0.3/7518bbe/lib/libsnappy.a"
|
2012-09-05 09:02:16 +02:00
|
|
|
|
2013-02-07 02:12:43 +01:00
|
|
|
# location of zlib headers and libraries
|
|
|
|
ZLIB_INCLUDE=" -I $TOOLCHAIN_LIB_BASE/zlib/zlib-1.2.5/91ddd43/include"
|
|
|
|
ZLIB_LIBS=" $TOOLCHAIN_LIB_BASE/zlib/zlib-1.2.5/91ddd43/lib/libz.a"
|
|
|
|
|
2012-12-20 23:30:26 +01:00
|
|
|
# location of libevent
|
|
|
|
LIBEVENT_INCLUDE=" -I $TOOLCHAIN_LIB_BASE/libevent/libevent-1.4.14b/91ddd43/include"
|
|
|
|
LIBEVENT_LIBS=" -L $TOOLCHAIN_LIB_BASE/libevent/libevent-1.4.14b/91ddd43/lib"
|
|
|
|
|
2013-11-18 19:20:32 +01:00
|
|
|
# location of bzip headers and libraries
|
|
|
|
BZIP_INCLUDE=" -I $TOOLCHAIN_LIB_BASE/bzip2/bzip2-1.0.6/91ddd43/include"
|
|
|
|
BZIP_LIBS=" $TOOLCHAIN_LIB_BASE/bzip2/bzip2-1.0.6/91ddd43/lib/libbz2.a"
|
|
|
|
|
2013-10-24 16:43:14 +02:00
|
|
|
# location of gflags headers and libraries
|
|
|
|
GFLAGS_INCLUDE=" -I $TOOLCHAIN_LIB_BASE/gflags/gflags-1.6/91ddd43/include"
|
|
|
|
GFLAGS_LIBS=" $TOOLCHAIN_LIB_BASE/gflags/gflags-1.6/91ddd43/lib/libgflags.a"
|
|
|
|
|
2012-10-17 20:59:44 +02:00
|
|
|
# use Intel SSE support for checksum calculations
|
2012-12-27 23:49:24 +01:00
|
|
|
export USE_SSE=" -msse -msse4.2 "
|
2012-10-17 20:59:44 +02:00
|
|
|
|
2012-11-21 01:14:04 +01:00
|
|
|
CC="$TOOLCHAIN_EXECUTABLES/gcc/gcc-4.7.1-glibc-2.14.1/bin/gcc"
|
2013-11-18 19:20:32 +01:00
|
|
|
CXX="$TOOLCHAIN_EXECUTABLES/gcc/gcc-4.7.1-glibc-2.14.1/bin/g++ $JINCLUDE $SNAPPY_INCLUDE $ZLIB_INCLUDE $BZIP_INCLUDE $LIBEVENT_INCLUDE $GFLAGS_INCLUDE"
|
2012-09-05 09:02:16 +02:00
|
|
|
AR=$TOOLCHAIN_EXECUTABLES/binutils/binutils-2.21.1/da39a3e/bin/ar
|
|
|
|
RANLIB=$TOOLCHAIN_EXECUTABLES/binutils/binutils-2.21.1/da39a3e/bin/ranlib
|
|
|
|
|
2013-11-17 22:52:55 +01:00
|
|
|
CFLAGS="-B$TOOLCHAIN_EXECUTABLES/binutils/binutils-2.21.1/da39a3e/bin/gold -m64 -mtune=generic -fPIC"
|
2012-09-17 23:34:33 +02:00
|
|
|
CFLAGS+=" -I $TOOLCHAIN_LIB_BASE/jemalloc/$TOOL_JEMALLOC/include -DHAVE_JEMALLOC"
|
2013-11-18 22:50:34 +01:00
|
|
|
CFLAGS+=" $LIBGCC_INCLUDE $GLIBC_INCLUDE"
|
2013-11-18 20:40:16 +01:00
|
|
|
CFLAGS+=" -DROCKSDB_PLATFORM_POSIX -DROCKSDB_ATOMIC_PRESENT"
|
2013-11-18 19:20:32 +01:00
|
|
|
CFLAGS+=" -DSNAPPY -DGFLAGS -DZLIB -DBZIP2"
|
2012-09-05 09:02:16 +02:00
|
|
|
|
2012-12-20 23:30:26 +01:00
|
|
|
EXEC_LDFLAGS=" -Wl,--whole-archive $TOOLCHAIN_LIB_BASE/jemalloc/$TOOL_JEMALLOC/lib/libjemalloc.a"
|
2013-10-18 23:50:54 +02:00
|
|
|
EXEC_LDFLAGS+=" -Wl,--no-whole-archive $TOOLCHAIN_LIB_BASE/libunwind/libunwind-1.0.1/350336c/lib/libunwind.a"
|
2013-11-18 19:20:32 +01:00
|
|
|
EXEC_LDFLAGS+=" $HDFSLIB $SNAPPY_LIBS $ZLIB_LIBS $BZIP_LIBS $LIBEVENT_LIBS $GFLAGS_LIBS"
|
2013-01-14 21:39:24 +01:00
|
|
|
|
2013-11-18 22:50:34 +01:00
|
|
|
PLATFORM_LDFLAGS="$LIBGCC_LIBS $GLIBC_LIBS "
|
2013-01-15 03:37:01 +01:00
|
|
|
|
2013-11-18 19:20:32 +01:00
|
|
|
EXEC_LDFLAGS_SHARED="$SNAPPY_LIBS $ZLIB_LIBS $BZIP_LIBS $GFLAGS_LIBS"
|
2012-09-05 09:02:16 +02:00
|
|
|
|
2013-03-07 20:11:30 +01:00
|
|
|
VALGRIND_VER="$TOOLCHAIN_LIB_BASE/valgrind/valgrind-3.8.1/91ddd43/bin/"
|
|
|
|
|
2013-11-18 07:05:00 +01:00
|
|
|
export CC CXX AR RANLIB CFLAGS EXEC_LDFLAGS EXEC_LDFLAGS_SHARED VALGRIND_VER
|