[CRIU] [PATCH 1/3] makefile: add ldflags-so and rpc.pb-c.o

Ruslan Kuprieiev kupruser at gmail.com
Fri Dec 6 14:48:09 PST 2013


We need ldflags-so to link libcriu with -lprotobuf-c flag
and rpc.pb-c.o to use RPC.

Signed-off-by: Ruslan Kuprieiev <kupruser at gmail.com>
---
 lib/Makefile           | 4 +++-
 scripts/Makefile.build | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/Makefile b/lib/Makefile
index b008d9c..e9beace 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -1,9 +1,11 @@
 lib-so			+= libcriu
 obj-y			+= criu.o
+obj-ext-src-y		+= protobuf/rpc.pb-c.o
 
-includes		+= -iquote $(obj)/../arch/$(ARCH)/include -iquote $(obj)/../include -iquote $(obj)/..
+includes		+= -iquote $(obj)/../arch/$(ARCH)/include -iquote $(obj)/../include -iquote $(obj)/.. -iquote $(obj)/../protobuf
 cflags-y		+= $(includes) -fPIC -Wa,--noexecstack -fno-stack-protector
 cflags-so		+= -rdynamic
+ldflags-so		+= -lprotobuf-c
 
 .SECONDARY:
 
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index afee94b..1c633d9 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -184,7 +184,7 @@ endif
 ifneq ($(lib-so),)
 $(obj)/$(lib-so).so: $(all-objs) $(libs-e)
 	$(E) "  LINK    " $@
-	$(Q) $(CC) -shared $(cflags-so) -o $@ $^
+	$(Q) $(CC) -shared $(cflags-so) -o $@ $^ $(ldflags-so)
 
 _all += $(obj)/$(lib-so).so
 cleanup-y += $(obj)/$(lib-so).so
-- 
1.8.1.2



More information about the CRIU mailing list