build: Conditionally builds single and separate shared libs

Adds option to configure script (default is disabled)
to build SPDK shared libraries, and enhances build
correspondingly to do so.  This includes the single, combined
shared library encompassing all of the SPDK static libs,
as well as production of individual SPDK shared libraries
corresponding to each of the static ones.  Although the
SPDK shared libs conform with shared lib naming conventions
complete with version numbering suffixes, this does not
confer any ABI compatibility claims whatsoever at this time.
It's merely conformance with the naming conventions.
Finally, there are no built-in dependencies between SPDK
shared libs, thus requiring one to specify all needed SPDK
shared libs to resolve all symbols in the final link of an
executable wishing to use said SPDK shared libs.

Change-Id: Ia375c0e3fb6d150d45a39e84e3b226fbaea48545
Signed-off-by: Lance Hartmann <lance.hartmann@oracle.com>
Reviewed-on: https://review.gerrithub.io/422307
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
Lance Hartmann 2018-08-14 13:56:26 -04:00 committed by Jim Harris
parent a6c89adf09
commit 0923734c9f
4 changed files with 29 additions and 3 deletions

View File

@ -8,6 +8,16 @@ spdk_nvme_ns_get_extended_sector_size() was added. This function includes
the metadata size per sector (if any). spdk_nvme_ns_get_sector_size() still
returns only the data size per sector, not including metadata.
### Build System
New `configure` options, `--with-shared` and `--without-shared`
[default], provide the capability to build, or not, SPDK shared libraries.
This includes the single SPDK shared lib encompassing all of the SPDK
static libs as well as individual SPDK shared libs corresponding to
each of the SPDK static ones. Although the production of the shared
libs conforms with conventional version naming practices, such naming
does not at this time confer any SPDK ABI compatibility claims.
## v18.07:
### bdev

3
CONFIG
View File

@ -107,3 +107,6 @@ CONFIG_RAID?=n
# Enable the dependencies for building the crypto vbdev
CONFIG_CRYPTO?=n
# Build spdk shared libraries in addition to the static ones.
CONFIG_SHARED?=n

View File

@ -36,7 +36,9 @@ S :=
SPDK_ROOT_DIR := $(CURDIR)
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
DIRS-y += lib shared_lib examples app include
DIRS-y += lib
DIRS-$(CONFIG_SHARED) += shared_lib
DIRS-y += examples app include
DIRS-$(CONFIG_TESTS) += test
.PHONY: all clean $(DIRS-y) config.h CONFIG.local mk/cc.mk cc_version cxx_version

15
configure vendored
View File

@ -51,6 +51,8 @@ function usage()
echo " No path required."
echo " rdma [disabled]"
echo " No path required."
echo " shared Required to build spdk shared libraries."
echo " No path required."
echo " iscsi-initiator [disabled]"
echo " No path required."
echo " raid [disabled]"
@ -158,6 +160,12 @@ for i in "$@"; do
--without-rdma)
CONFIG_RDMA=n
;;
--with-shared)
CONFIG_SHARED=y
;;
--without-shared)
CONFIG_SHARED=n
;;
--with-iscsi-initiator)
CONFIG_ISCSI_INITIATOR=y
;;
@ -291,7 +299,7 @@ if [ "$CONFIG_ASAN" = "y" -a "$CONFIG_TSAN" = "y" ]; then
exit 1
fi
if [[ "$OSTYPE" == "FreeBSD"* ]]; then
if [[ "$OSTYPE" == "freebsd"* ]]; then
# FreeBSD doesn't support all configurations
if [[ "$CONFIG_COVERAGE" == "y" ]]; then
echo "ERROR: CONFIG_COVERAGE not available on FreeBSD"
@ -369,6 +377,9 @@ fi
if [ -n "$CONFIG_RDMA" ]; then
echo "CONFIG_RDMA?=$CONFIG_RDMA" >> CONFIG.local
fi
if [ -n "$CONFIG_SHARED" ]; then
echo "CONFIG_SHARED?=$CONFIG_SHARED" >> CONFIG.local
fi
if [ -n "$CONFIG_ISCSI_INITIATOR" ]; then
echo "CONFIG_ISCSI_INITIATOR?=$CONFIG_ISCSI_INITIATOR" >> CONFIG.local
fi
@ -415,7 +426,7 @@ echo $python_command > PYTHON_COMMAND
$python_command scripts/genconfig.py > config.h
echo "done."
if [[ "$OSTYPE" == "FreeBSD"* ]]; then
if [[ "$OSTYPE" == "freebsd"* ]]; then
echo "Type 'gmake' to build."
else
echo "Type 'make' to build."