[dpdk-dev] [PATCH v2 3/8] mk: Add rule for installing libraries

Panu Matilainen pmatilai at redhat.com
Tue Sep 29 11:28:59 CEST 2015


On 09/29/2015 03:00 AM, Mario Carrillo wrote:
> Add hierarchy-file support to the DPDK libraries,
> when invoking "make install-lib" for this case
> if the architecture is 64 bits libraries will be instaled
> in: $(DESTDIR)/usr/lib64 else it will be $(DESTDIR)/usr/lib
> This hierarchy is based on:
> http://www.freedesktop.org/software/systemd/man/file-hierarchy.html
>
> Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo at intel.com>
> ---
>   mk/rte.sdkinstall.mk | 20 ++++++++++++++++++++
>   mk/rte.sdkroot.mk    |  4 ++--
>   2 files changed, 22 insertions(+), 2 deletions(-)
>
> diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
> index 44e770d..9a54fb6 100644
> --- a/mk/rte.sdkinstall.mk
> +++ b/mk/rte.sdkinstall.mk
> @@ -47,6 +47,14 @@ INCLUDE_DIR := $(DESTDIR)/usr/include/dpdk
>   BIN_DIR := $(DESTDIR)/usr/bin
>   HSLINKS := $(wildcard $(RTE_OUTPUT)/include/*)
>   BINARY_FILES := $(patsubst %.map,,$(wildcard $(RTE_OUTPUT)/app/*))
> +LIBS := $(wildcard $(RTE_OUTPUT)/lib/*)
> +include $(BUILD_DIR)/build/.config
> +RTE_ARCH := $(CONFIG_RTE_ARCH:"%"=%)
> +ifeq ($(RTE_ARCH),x86_64)
> +LIB_DIR := /usr/lib64
> +else
> +LIB_DIR := /usr/lib
> +endif
>   endif
>   endif

Like explained in 
http://dpdk.org/ml/archives/dev/2015-September/023839.html, this 
arch-based heuristics for LIB_DIR will be wrong at least as often as it 
is sort of right. Better IMO just to default to /usr/lib and let people 
override than try to be clever (and fail):

LIB_DIR ?= /usr/lib

>
> @@ -103,6 +111,18 @@ install-bin:
>   	echo installing: $$BIN_FILE; \
>   	done
>   #
> +# if architecture is 64 bits install in /usr/lib64
> +# else /usr/lib
> +#
> +.PHONY: install-lib
> +install-lib:
> +	@echo ================== Installing libraries
> +	@[ -d $(LIB_DIR) ] || mkdir -p $(LIB_DIR)
> +	@for LIB in ${LIBS}; do \
> +	cp -rf $$LIB ${LIB_DIR}; \

This doesn't honor $DESTDIR.

	- Panu -



More information about the dev mailing list