From 92444940f3ff80975e64e07e4a4861454101a529 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 13 Nov 2010 08:13:18 +0000 Subject: [PATCH] static: Use correct libraries for static binaries. Also add virt-cat.static target. --- .gitignore | 1 + Makefile.am | 2 ++ cat/Makefile.am | 6 ++++++ fish/Makefile.am | 2 +- fuse/Makefile.am | 2 +- test-tool/Makefile.am | 2 +- 6 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index d69dd3c..be792c9 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,7 @@ capitests/tests.c capitests/test*.tmp cat/virt-cat cat/virt-cat.1 +cat/virt-cat.static ChangeLog *.class *.cma diff --git a/Makefile.am b/Makefile.am index 5aa1a54..6f17146 100644 --- a/Makefile.am +++ b/Makefile.am @@ -253,5 +253,7 @@ bindist: cp fuse/guestmount.static $(BINTMPDIR)$(bindir)/guestmount $(MAKE) -C test-tool libguestfs-test-tool.static cp test-tool/libguestfs-test-tool.static $(BINTMPDIR)$(bindir)/libguestfs-test-tool + $(MAKE) -C cat virt-cat.static + cp cat/virt-cat.static $(BINTMPDIR)$(bindir)/virt-cat (cd $(BINTMPDIR) && tar cf - .) | \ gzip -c -9 > libguestfs-$(VERSION)-$(host_cpu).tar.gz diff --git a/cat/Makefile.am b/cat/Makefile.am index a8e9b31..63064e6 100644 --- a/cat/Makefile.am +++ b/cat/Makefile.am @@ -76,3 +76,9 @@ TESTS_ENVIRONMENT = \ LIBGUESTFS_PATH=$(top_builddir)/appliance TESTS = test-virt-cat.sh + +# Build a partly-static library (for the binary distribution). + +virt-cat.static$(EXEEXT): $(virt_cat_OBJECTS) $(virt_cat_DEPENDENCIES) + $(top_srcdir)/relink-static.sh \ + $(virt_cat_LINK) $(virt_cat_OBJECTS) -static $(virt_cat_LDADD) $(virt_cat_LIBS) $(LIBVIRT_LIBS) $(LIBXML2_LIBS) -lpcre -lhivex -lmagic -lz -lm diff --git a/fish/Makefile.am b/fish/Makefile.am index 6debdce..2d8c16b 100644 --- a/fish/Makefile.am +++ b/fish/Makefile.am @@ -130,7 +130,7 @@ endif guestfish.static$(EXEEXT): $(guestfish_OBJECTS) $(guestfish_DEPENDENCIES) $(top_srcdir)/relink-static.sh \ - $(guestfish_LINK) $(guestfish_OBJECTS) -static $(guestfish_LDADD) $(guestfish_LIBS) -ltinfo -lpcre -lhivex -lmagic -lz -lm + $(guestfish_LINK) $(guestfish_OBJECTS) -static $(guestfish_LDADD) $(guestfish_LIBS) $(LIBVIRT_LIBS) $(LIBXML2_LIBS) -ltinfo -lpcre -lhivex -lmagic -lz -lm # Manual page. # guestfish-actions.pod and guestfish-commands.pod are autogenerated. diff --git a/fuse/Makefile.am b/fuse/Makefile.am index 0a1d9da..5fe57bb 100644 --- a/fuse/Makefile.am +++ b/fuse/Makefile.am @@ -57,7 +57,7 @@ guestmount_LDADD = \ guestmount.static$(EXEEXT): $(guestmount_OBJECTS) $(guestmount_DEPENDENCIES) $(top_srcdir)/relink-static.sh \ - $(guestmount_LINK) $(guestmount_OBJECTS) -static $(guestmount_LDADD) $(guestmount_LIBS) -lpcre -lhivex -lmagic -lz -lm + $(guestmount_LINK) $(guestmount_OBJECTS) -static $(guestmount_LDADD) $(guestmount_LIBS) $(LIBVIRT_LIBS) $(LIBXML2_LIBS) -lpcre -lhivex -lmagic -lz -lm # Documentation. diff --git a/test-tool/Makefile.am b/test-tool/Makefile.am index ee2f2ff..c28d131 100644 --- a/test-tool/Makefile.am +++ b/test-tool/Makefile.am @@ -43,7 +43,7 @@ libguestfs_test_tool_helper_LDFLAGS = -all-static libguestfs-test-tool.static$(EXEEXT): $(libguestfs_test_tool_OBJECTS) $(libguestfs_test_tool_DEPENDENCIES) $(top_srcdir)/relink-static.sh \ - $(libguestfs_test_tool_LINK) $(libguestfs_test_tool_OBJECTS) -static $(libguestfs_test_tool_LDADD) $(libguestfs_test_tool_LIBS) -lpcre -lhivex -lmagic -lz + $(libguestfs_test_tool_LINK) $(libguestfs_test_tool_OBJECTS) -static $(libguestfs_test_tool_LDADD) $(libguestfs_test_tool_LIBS) $(LIBVIRT_LIBS) $(LIBXML2_LIBS) -lpcre -lhivex -lmagic -lz -lm libguestfs-test-tool.1: libguestfs-test-tool.pod $(POD2MAN) \ -- 1.8.3.1