Do not use relative paths in build system

Summary: Previously, RocksDB's build scripts used relative pathnames like ./build_detect_platform. This can cause problems if the user uses CDPATH. Also, it just doesn't seem right to me.

Test Plan:
make clean
make -j32 check

Reviewers: MarkCallaghan, dhruba, kailiu

Reviewed By: kailiu

CC: leveldb

Differential Revision: https://reviews.facebook.net/D12459
main
Jim Paton 12 years ago
parent cb703c9d03
commit bc8eed12d9
  1. 2
      Makefile
  2. 8
      build_tools/build_detect_platform

@ -14,7 +14,7 @@ OPT += -O2 -fno-omit-frame-pointer -momit-leaf-frame-pointer
#----------------------------------------------- #-----------------------------------------------
# detect what platform we're building on # detect what platform we're building on
$(shell (cd build_tools/; ROCKSDB_ROOT=.. ./build_detect_platform ../build_config.mk)) $(shell (export ROCKSDB_ROOT=$(CURDIR); $(CURDIR)/build_tools/build_detect_platform $(CURDIR)/build_config.mk))
# this file is generated by the previous line to set build flags and sources # this file is generated by the previous line to set build flags and sources
include build_config.mk include build_config.mk

@ -31,9 +31,9 @@ fi
# Default to fbcode gcc on internal fb machines # Default to fbcode gcc on internal fb machines
if [ -d /mnt/gvfs/third-party -a -z "$CXX" ]; then if [ -d /mnt/gvfs/third-party -a -z "$CXX" ]; then
if [ -z "$USE_CLANG" ]; then if [ -z "$USE_CLANG" ]; then
source ./fbcode.gcc471.sh source $PWD/build_tools/fbcode.gcc471.sh
else else
source ./fbcode.clang31.sh source $PWD/build_tools/fbcode.clang31.sh
fi fi
fi fi
@ -65,7 +65,7 @@ PLATFORM_SHARED_CFLAGS="-fPIC"
PLATFORM_SHARED_VERSIONED=true PLATFORM_SHARED_VERSIONED=true
# generic port files (working on all platform by #ifdef) go directly in /port # generic port files (working on all platform by #ifdef) go directly in /port
GENERIC_PORT_FILES=`cd $ROCKSDB_ROOT; find port -name '*.cc' | tr "\n" " "` GENERIC_PORT_FILES=`find $ROCKSDB_ROOT/port -name '*.cc' | tr "\n" " "`
# On GCC, we pick libc's memcmp over GCC's memcmp via -fno-builtin-memcmp # On GCC, we pick libc's memcmp over GCC's memcmp via -fno-builtin-memcmp
case "$TARGET_OS" in case "$TARGET_OS" in
@ -127,7 +127,7 @@ case "$TARGET_OS" in
exit 1 exit 1
esac esac
./build_detect_version $PWD/build_tools/build_detect_version
# We want to make a list of all cc files within util, db, table, and helpers # We want to make a list of all cc files within util, db, table, and helpers
# except for the test and benchmark files. By default, find will output a list # except for the test and benchmark files. By default, find will output a list

Loading…
Cancel
Save