1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

show error message if dependency is missing (fixes #89)

This commit is contained in:
Steffen Vogel 2017-05-05 22:59:38 +00:00
parent cb91a6dc0b
commit 57f8343146
3 changed files with 22 additions and 14 deletions

View file

@ -68,9 +68,6 @@ RUN dnf -y install \
RUN pip install \
gcovr
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig
ENV LD_LIBRARY_PATH /usr/local/lib
# Build & Install libxil
COPY thirdparty/libxil /tmp/libxil
RUN mkdir -p /tmp/libxil/build && cd /tmp/libxil/build && cmake .. && make install
@ -96,4 +93,4 @@ ENTRYPOINT villas
WORKDIR /villas
ENTRYPOINT bash
ENTRYPOINT bash

View file

@ -50,6 +50,13 @@ CFLAGS += -std=c11 -MMD -mcx16
CFLAGS += -Wall -Werror -fdiagnostics-color=auto
LDFLAGS += -L$(BUILDDIR)
# Some environment variables to increase compatability with Fedora and other distros
export PKG_CONFIG_PATH := /usr/local/lib/pkgconfig:/usr/lib/pkgconfig:$(PKG_CONFIG_PATH)
export LD_LIBRARY_PATH := /usr/local/lib:/usr/lib:$(LD_LIBRARY_PATH)
# Some tools
PKGCONFIG := PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config
# We must compile without optimizations for gcov!
ifdef DEBUG
CFLAGS += -O0 -g

View file

@ -37,13 +37,18 @@ LIB_SRCS += $(addprefix lib/nodes/, file.c cbuilder.c shmem.c) \
LIB_LDFLAGS = -shared
LIB_LDLIBS = $(LDLIBS) -ldl -lrt -Wl,-soname,$(LIB_NAME).so.$(LIB_ABI_VERSION)
LIB_PKGS = openssl
LIB_PKGS += libwebsockets openssl
ifneq ($(shell $(PKGCONFIG) --print-errors $(LIB_PKGS); echo $$?),0)
$(error Please install missing dependencies: make install-thirdparty)
endif
######## Node types ########
# Enable Socket node type when libnl3 is available
ifndef WITHOUT_SOCKET
ifeq ($(shell pkg-config libnl-route-3.0; echo $$?),0)
ifeq ($(shell $(PKGCONFIG) libnl-route-3.0; echo $$?),0)
LIB_SRCS += $(addprefix lib/nodes/, socket.c)
LIB_SRCS += $(addprefix lib/kernel/, nl.c tc.c if.c)
LIB_SRCS += $(addprefix lib/, msg.c)
@ -53,7 +58,7 @@ endif
# Enable VILLASfpga support when libxil is available
ifndef WITHOUT_FPGA
ifeq ($(shell pkg-config libxil; echo $$?),0)
ifeq ($(shell $(PKGCONFIG) libxil; echo $$?),0)
LIB_SRCS += $(addprefix lib/nodes/, fpga.c)
LIB_SRCS += $(addprefix lib/kernel/, pci.c vfio.c)
PKGS += libxil
@ -64,29 +69,27 @@ endif
# Enable NGSI support
ifndef WITHOUT_NGSI
ifeq ($(shell pkg-config libcurl jansson; echo $$?),0)
ifeq ($(shell $(PKGCONFIG) libcurl jansson; echo $$?),0)
LIB_SRCS += lib/nodes/ngsi.c
LIB_PKGS += libcurl jansson
endif
endif
# Enable WebSocket support
ifndef WITHOUT_WEBSOCKETS
ifeq ($(shell pkg-config libwebsockets jansson; echo $$?),0)
ifeq ($(shell $(PKGCONFIG) libwebsockets jansson; echo $$?),0)
LIB_SRCS += lib/nodes/websocket.c lib/webmsg.c
LIB_PKGS += libwebsockets jansson
endif
endif
# Enable OPAL-RT Asynchronous Process support (will result in 32bit binary!!!)
ifdef WITH_OPAL
ifneq (,$(wildcard thirdparty/opal/include/AsyncApi.h))
ifneq ($(wildcard thirdparty/opal/include/AsyncApi.h),)
LIB_OBJS += opal.o
LIB_CFLAGS += -I thirdparty/opal/include
LIB_LDFLAGS += -L/lib/i386-linux-gnu/ -L/usr/lib/i386-linux-gnu/ -Lthirdparty/opal/lib/redhawk/
LIB_LDLIBS += -lOpalAsyncApiCore -lOpalCore -lOpalUtils -lirc
# libOpalAsyncApi is a 32bit library. So we need to build everything in 32bit
CFLAGS += -m32
LDFLAGS += -m32
@ -95,7 +98,8 @@ endif
endif
# Add flags by pkg-config
LIB_LDLIBS += $(shell pkg-config --libs ${LIB_PKGS})
LIB_LDLIBS += $(shell $(PKGCONFIG) --libs $(LIB_PKGS))
LIB_CFLAGS += $(shell $(PKGCONFIG) --cflags $(LIB_PKGS))
LIB_OBJS = $(patsubst %.c, $(BUILDDIR)/%.o, $(LIB_SRCS))