Overlay/sys-libs/libnvidia-container/files/libnvidia-container-1.8.0-f...

110 lines
4.3 KiB
Diff

diff --git a/Makefile b/Makefile
index 0070ada..8643de0 100644
--- a/Makefile
+++ b/Makefile
@@ -14,22 +14,22 @@
.PHONY: all tools shared static deps install uninstall dist depsclean mostlyclean clean distclean
.DEFAULT_GOAL := all
-
+STRIP := @echo skipping: strip
##### Global variables #####
-WITH_NVCGO ?= yes
-WITH_LIBELF ?= no
-WITH_TIRPC ?= no
+WITH_NVCGO ?= yes
+WITH_LIBELF ?= yes
+WITH_TIRPC ?= yes
WITH_SECCOMP ?= yes
##### Global definitions #####
-export prefix = /usr/local
+export prefix = /usr
export exec_prefix = $(prefix)
export bindir = $(exec_prefix)/bin
-export libdir = $(exec_prefix)/lib
+export libdir = $(exec_prefix)/lib64
export docdir = $(prefix)/share/doc
-export libdbgdir = $(prefix)/lib/debug$(libdir)
+export libdbgdir = $(prefix)/lib64/debug$(libdir)
export includedir = $(prefix)/include
export pkgconfdir = $(libdir)/pkgconfig
@@ -62,6 +62,8 @@
$(SRCS_DIR)/error_generic.c \
$(SRCS_DIR)/error.c \
$(SRCS_DIR)/ldcache.c \
+ $(SRCS_DIR)/pci-sysfs.c \
+ $(SRCS_DIR)/nvidia-modprobe-utils.c \
$(SRCS_DIR)/nvc.c \
$(SRCS_DIR)/nvc_ldcache.c \
$(SRCS_DIR)/nvc_info.c \
@@ -144,7 +146,7 @@
-Wall -Wextra -Wcast-align -Wpointer-arith -Wmissing-prototypes -Wnonnull \
-Wwrite-strings -Wlogical-op -Wformat=2 -Wmissing-format-attribute -Winit-self -Wshadow \
-Wstrict-prototypes -Wunreachable-code -Wconversion -Wsign-conversion \
- -Wno-unknown-warning-option -Wno-format-extra-args -Wno-gnu-alignof-expression $(CFLAGS)
+ -Wno-unknown-warning-option -Wno-format-extra-args -Wno-gnu-alignof-expression -I/usr/include/tirpc $(CFLAGS)
LDFLAGS := -Wl,-zrelro -Wl,-znow -Wl,-zdefs -Wl,--gc-sections $(LDFLAGS)
LDLIBS := $(LDLIBS)
@@ -152,8 +154,8 @@
LIB_CPPFLAGS = -DNV_LINUX -isystem $(DEPS_DIR)$(includedir) -include $(BUILD_DEFS)
LIB_CFLAGS = -fPIC
LIB_LDFLAGS = -L$(DEPS_DIR)$(libdir) -shared -Wl,-soname=$(LIB_SONAME)
-LIB_LDLIBS_STATIC = -l:libnvidia-modprobe-utils.a
-LIB_LDLIBS_SHARED = -ldl -lcap
+# LIB_LDLIBS_STATIC = -l:libnvidia-modprobe-utils.a
+LIB_LDLIBS_SHARED = -ldl -lcap -ltirpc
ifeq ($(WITH_NVCGO), yes)
LIB_CPPFLAGS += -DWITH_NVCGO
LIB_LDLIBS_SHARED += -lpthread
@@ -166,7 +168,7 @@
endif
ifeq ($(WITH_TIRPC), yes)
LIB_CPPFLAGS += -isystem $(DEPS_DIR)$(includedir)/tirpc -DWITH_TIRPC
-LIB_LDLIBS_STATIC += -l:libtirpc.a
+# LIB_LDLIBS_STATIC += -l:libtirpc.a
LIB_LDLIBS_SHARED += -lpthread
endif
ifeq ($(WITH_SECCOMP), yes)
@@ -181,7 +183,7 @@
LIB_LDLIBS = $(LIB_LDLIBS_STATIC) $(LIB_LDLIBS_SHARED)
# Binary flags (recursively expanded to handle target-specific flags)
-BIN_CPPFLAGS = -include $(BUILD_DEFS) $(CPPFLAGS)
+BIN_CPPFLAGS = -include $(BUILD_DEFS) $(CPPFLAGS) -DWITH_TIRPC
BIN_CFLAGS = -I$(SRCS_DIR) -fPIE -flto $(CFLAGS)
BIN_LDFLAGS = -L. -pie $(LDFLAGS) -Wl,-rpath='$$ORIGIN/../$$LIB'
BIN_LDLIBS = -l:$(LIB_SHARED) -ldl -lcap $(LDLIBS)
@@ -258,15 +260,15 @@
deps: $(LIB_RPC_SRCS) $(BUILD_DEFS)
$(MKDIR) -p $(DEPS_DIR)
- $(MAKE) -f $(MAKE_DIR)/nvidia-modprobe.mk DESTDIR=$(DEPS_DIR) install
+ # $(MAKE) -f $(MAKE_DIR)/nvidia-modprobe.mk DESTDIR=$(DEPS_DIR) install
ifeq ($(WITH_NVCGO), yes)
$(MAKE) -f $(MAKE_DIR)/nvcgo.mk DESTDIR=$(DEPS_DIR) MAJOR=$(MAJOR) VERSION=$(VERSION) LIB_NAME=$(LIBGO_NAME) install
endif
ifeq ($(WITH_LIBELF), no)
- $(MAKE) -f $(MAKE_DIR)/elftoolchain.mk DESTDIR=$(DEPS_DIR) install
+ # $(MAKE) -f $(MAKE_DIR)/elftoolchain.mk DESTDIR=$(DEPS_DIR) install
endif
ifeq ($(WITH_TIRPC), yes)
- $(MAKE) -f $(MAKE_DIR)/libtirpc.mk DESTDIR=$(DEPS_DIR) install
+ # $(MAKE) -f $(MAKE_DIR)/libtirpc.mk DESTDIR=$(DEPS_DIR) install
endif
install: all
@@ -283,7 +285,7 @@
endif
$(LDCONFIG) -n $(DESTDIR)$(libdir)
# Install debugging symbols
- $(INSTALL) -m 644 $(DEBUG_DIR)/$(LIB_SONAME) $(DESTDIR)$(libdbgdir)
+ # $(INSTALL) -m 644 $(DEBUG_DIR)/$(LIB_SONAME) $(DESTDIR)$(libdbgdir)
# Install configuration files
$(MAKE_DIR)/$(LIB_PKGCFG).in "$(strip $(VERSION))" "$(strip $(LIB_LDLIBS_SHARED))" > $(DESTDIR)$(pkgconfdir)/$(LIB_PKGCFG)
# Install binary files