Include statically linked binaries in the binary distribution.
[libguestfs.git] / fish / Makefile.am
index f6b3e7d..4060f1f 100644 (file)
@@ -44,6 +44,7 @@ guestfish_SOURCES = \
        fish.c \
        fish.h \
        glob.c \
+       inspect.c \
        lcd.c \
        man.c \
        more.c \
@@ -52,7 +53,8 @@ guestfish_SOURCES = \
        reopen.c \
        supported.c \
        tilde.c \
-       time.c
+       time.c \
+       virt.c
 
 # This convenience library is solely to avoid compiler warnings
 # in its generated sources.
@@ -65,9 +67,12 @@ guestfish_CFLAGS = \
        -DGUESTFS_DEFAULT_PATH='"$(libdir)/guestfs"' \
        -DLOCALEBASEDIR=\""$(datadir)/locale"\" \
        -I$(srcdir)/../gnulib/lib -I../gnulib/lib \
+       $(LIBVIRT_CFLAGS) $(LIBXML2_CFLAGS) \
        $(WARN_CFLAGS) $(WERROR_CFLAGS)
 
-guestfish_LDADD = $(top_builddir)/src/libguestfs.la $(LIBREADLINE)
+guestfish_LDADD = \
+       $(LIBVIRT_LIBS) $(LIBXML2_LIBS) \
+       $(top_builddir)/src/libguestfs.la $(LIBREADLINE)
 
 # Make libguestfs use the convenience library.
 noinst_LTLIBRARIES = librc_protocol.la
@@ -87,6 +92,12 @@ rc_protocol.h: rc_protocol.x
        mv $@-t $@
 endif
 
+# Build a partly-static library (for the binary distribution).
+
+guestfish.static$(EXEEXT): $(guestfish_OBJECTS) $(guestfish_DEPENDENCIES)
+       $(top_srcdir)/relink-static.sh \
+       $(guestfish_LINK) $(guestfish_OBJECTS) -static $(guestfish_LDADD) $(guestfish_LIBS) -lpcre -lhivex -lmagic -lz -lm
+
 # Manual page.
 # guestfish-actions.pod is autogenerated.  There is no include
 # mechanism for POD, so we have to do it by hand.