2012-06-08 10:11:14 +02:00
|
|
|
#!/bin/sh
|
2012-05-15 03:17:06 +02:00
|
|
|
#
|
|
|
|
# Set environment variables so that we can compile leveldb using
|
|
|
|
# fbcode settings. It uses the latest g++ compiler and also
|
|
|
|
# uses jemalloc
|
|
|
|
|
|
|
|
TOOLCHAIN_REV=d28c90311ca14f9f0b2bb720f4e34b285513d4f4
|
|
|
|
TOOLCHAIN_EXECUTABLES="/mnt/gvfs/third-party/$TOOLCHAIN_REV/centos5.2-native"
|
|
|
|
TOOLCHAIN_LIB_BASE="/mnt/gvfs/third-party/$TOOLCHAIN_REV/gcc-4.6.2-glibc-2.13"
|
|
|
|
|
2012-08-16 20:03:07 +02:00
|
|
|
# always build thrift server
|
|
|
|
export USE_THRIFT=1
|
|
|
|
|
2012-08-15 00:20:36 +02:00
|
|
|
if ! test "$NO_SCRIBE"; then
|
|
|
|
export USE_SCRIBE=1
|
|
|
|
fi
|
|
|
|
|
2012-06-08 10:11:14 +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.6.2-glibc-2.13"
|
|
|
|
HDFSLIB=" -Wl,--no-whole-archive hdfs/libhdfs.a -L$JAVA_HOME/jre/lib/amd64 "
|
|
|
|
HDFSLIB+=" -L$JAVA_HOME/jre/lib/amd64/server -L$GLIBC_RUNTIME_PATH/lib "
|
|
|
|
HDFSLIB+=" -ldl -lverify -ljava -ljvm "
|
|
|
|
fi
|
|
|
|
|
2012-06-15 22:48:59 +02:00
|
|
|
# location of snappy headers and libraries
|
|
|
|
SNAPPY_INCLUDE=" -I ./snappy"
|
|
|
|
SNAPPY_LIBS=" -L./snappy/libs"
|
|
|
|
|
2012-07-03 07:45:59 +02:00
|
|
|
# location of boost headers and libraries
|
|
|
|
THRIFT_INCLUDE=" -I $TOOLCHAIN_LIB_BASE/boost/default/eed002c/include -std=gnu++0x"
|
|
|
|
THRIFT_INCLUDE+=" -I./thrift -I./thrift/gen-cpp -I./thrift/lib/cpp"
|
|
|
|
THRIFT_LIBS=" -L $TOOLCHAIN_LIB_BASE/boost/default/eed002c/lib"
|
|
|
|
|
2012-05-15 03:17:06 +02:00
|
|
|
CC="$TOOLCHAIN_EXECUTABLES/gcc/gcc-4.6.2-glibc-2.13/bin/gcc"
|
2012-07-03 07:45:59 +02:00
|
|
|
CXX="$TOOLCHAIN_EXECUTABLES/gcc/gcc-4.6.2-glibc-2.13/bin/g++ $JINCLUDE $SNAPPY_INCLUDE $THRIFT_INCLUDE"
|
2012-05-15 03:17:06 +02:00
|
|
|
AR=$TOOLCHAIN_EXECUTABLES/binutils/binutils-2.21.1/da39a3e/bin/ar
|
|
|
|
RANLIB=$TOOLCHAIN_EXECUTABLES/binutils/binutils-2.21.1/da39a3e/bin/ranlib
|
|
|
|
|
2012-06-21 00:15:25 +02:00
|
|
|
CFLAGS="-B$TOOLCHAIN_EXECUTABLES/binutils/binutils-2.21.1/bin/gold -m64 -mtune=generic -fPIC"
|
2012-05-15 03:17:06 +02:00
|
|
|
CFLAGS+=" -I $TOOLCHAIN_LIB_BASE/jemalloc/jemalloc-2.2.5/96de4f9/include -DHAVE_JEMALLOC"
|
|
|
|
|
|
|
|
EXEC_LDFLAGS=" -Wl,--whole-archive $TOOLCHAIN_LIB_BASE/jemalloc/jemalloc-2.2.4/96de4f9/lib/libjemalloc.a "
|
|
|
|
EXEC_LDFLAGS+="-Wl,--no-whole-archive $TOOLCHAIN_LIB_BASE/libunwind/libunwind-20100810/4bc2c16/lib/libunwind.a"
|
2012-07-03 07:45:59 +02:00
|
|
|
EXEC_LDFLAGS+="$HDFSLIB $SNAPPY_LIBS $THRIFT_LIBS "
|
2012-06-19 09:56:07 +02:00
|
|
|
EXEC_LDFLAGS_SHARED="$SNAPPY_LIBS $TOOLCHAIN_LIB_BASE/jemalloc/jemalloc-2.2.4/96de4f9/lib/libjemalloc.so"
|
2012-05-15 03:17:06 +02:00
|
|
|
|
2012-06-19 09:56:07 +02:00
|
|
|
export CC CXX AR RANLIB CFLAGS EXEC_LDFLAGS EXEC_LDFLAGS_SHARED
|