From fd2f47dbe590d0987447a323f0b693b32eae33d8 Mon Sep 17 00:00:00 2001 From: Kai Liu Date: Thu, 15 Aug 2013 20:53:21 -0700 Subject: [PATCH] Improve the build files to simplify the 3rd party release process Summary: * Added LIBNAME to enable configurable library name. * remove/check fPIC in linux platform from build_detect_platform Test Plan: make Reviewers: emayanke Differential Revision: https://reviews.facebook.net/D12321 --- Makefile | 9 ++++++--- build_tools/build_detect_platform | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index a757d04621..9d5924bb13 100644 --- a/Makefile +++ b/Makefile @@ -75,7 +75,10 @@ TOOLS = \ PROGRAMS = db_bench signal_test $(TESTS) $(TOOLS) BENCHMARKS = db_bench_sqlite3 db_bench_tree_db -LIBRARY = librocksdb.a +# The library name is configurable since we are maintaining libraries of both +# debug/release mode. +LIBNAME = librocksdb +LIBRARY = ${LIBNAME}.a MEMENVLIBRARY = libmemenv.a default: all @@ -84,7 +87,7 @@ default: all ifneq ($(PLATFORM_SHARED_EXT),) ifneq ($(PLATFORM_SHARED_VERSIONED),true) -SHARED1 = librocksdb.$(PLATFORM_SHARED_EXT) +SHARED1 = ${LIBNAME}.$(PLATFORM_SHARED_EXT) SHARED2 = $(SHARED1) SHARED3 = $(SHARED1) SHARED = $(SHARED1) @@ -92,7 +95,7 @@ else # Update db.h if you change these. SHARED_MAJOR = 2 SHARED_MINOR = 0 -SHARED1 = librocksdb.$(PLATFORM_SHARED_EXT) +SHARED1 = ${LIBNAME}.$(PLATFORM_SHARED_EXT) SHARED2 = $(SHARED1).$(SHARED_MAJOR) SHARED3 = $(SHARED1).$(SHARED_MAJOR).$(SHARED_MINOR) SHARED = $(SHARED1) $(SHARED2) $(SHARED3) diff --git a/build_tools/build_detect_platform b/build_tools/build_detect_platform index bde280b8ea..d0d1e61ca4 100755 --- a/build_tools/build_detect_platform +++ b/build_tools/build_detect_platform @@ -78,7 +78,7 @@ case "$TARGET_OS" in ;; Linux) PLATFORM=OS_LINUX - COMMON_FLAGS="$COMMON_FLAGS -DOS_LINUX -fPIC" + COMMON_FLAGS="$COMMON_FLAGS -DOS_LINUX" if [ -z "$USE_CLANG" ]; then COMMON_FLAGS="$COMMON_FLAGS -fno-builtin-memcmp" fi