summarylogtreecommitdiffstats
path: root/fix_rpc_flags.patch
blob: 94e84039474741b38a88f8b200815348008e2a13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
diff --git a/Makefile b/Makefile
index 6fb6976..f252494 100644
--- a/Makefile
+++ b/Makefile
@@ -24,7 +24,7 @@ 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
@@ -144,7 +144,8 @@ CFLAGS   := -std=gnu11 -O2 -g -fdata-sections -ffunction-sections -fplan9-extens
             -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)
 
@@ -153,7 +154,7 @@ LIB_CPPFLAGS       = -DNV_LINUX -isystem $(DEPS_DIR)$(includedir) -include $(BUI
 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_SHARED  = -ldl -lcap -ltirpc
 ifeq ($(WITH_NVCGO), yes)
 LIB_CPPFLAGS       += -DWITH_NVCGO
 LIB_LDLIBS_SHARED  += -lpthread
@@ -186,6 +187,10 @@ 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)
 
+ifeq ($(WITH_TIRPC), yes)
+BIN_CPPFLAGS       += -isystem $(DEPS_DIR)$(includedir)/tirpc -DWITH_TIRPC
+endif
+
 $(word 1,$(LIB_RPC_SRCS)): RPCGENFLAGS=-h
 $(word 2,$(LIB_RPC_SRCS)): RPCGENFLAGS=-c
 $(word 3,$(LIB_RPC_SRCS)): RPCGENFLAGS=-m