diff options
-rw-r--r-- | src/Makefile.am | 110 |
1 files changed, 64 insertions, 46 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index a459622..0128070 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,4 @@ NULL = -# we are forced to use a shared library, -# because libtool reordred .a after .la libs, and it fails to link -noinst_LTLIBRARIES = libvirt-viewer.la bin_PROGRAMS = builderxmldir = $(pkgdatadir)/ui @@ -13,32 +10,7 @@ builderxml_DATA = \ EXTRA_DIST = $(builderxml_DATA) -if HAVE_LIBVIRT -bin_PROGRAMS += virt-viewer -virt_viewer_SOURCES = \ - virt-viewer-events.h virt-viewer-events.c \ - virt-viewer.h virt-viewer.c \ - virt-viewer-main.c \ - $(NULL) -virt_viewer_LDADD = libvirt-viewer.la -virt_viewer_LDFLAGS = \ - $(LIBVIRT_LIBS) \ - $(GMODULE2_LIBS) \ - $(NULL) -virt_viewer_CFLAGS = $(AM_CFLAGS) $(LIBVIRT_CFLAGS) -endif - -bin_PROGRAMS += remote-viewer -remote_viewer_SOURCES = \ - remote-viewer.h remote-viewer.c \ - remote-viewer-main.c \ - $(NULL) -remote_viewer_LDADD = libvirt-viewer.la -remote_viewer_LDFLAGS = \ - $(GMODULE2_LIBS) \ - $(NULL) - -libvirt_viewer_la_SOURCES = \ +COMMON_SOURCES = \ virt-viewer-util.h virt-viewer-util.c \ virt-viewer-auth.h virt-viewer-auth.c \ virt-viewer-app.h virt-viewer-app.c \ @@ -53,34 +25,80 @@ libvirt_viewer_la_SOURCES = \ view/ovBox.c \ view/ovBox.h \ $(NULL) -libvirt_viewer_la_LIBADD = \ - $(GMODULE2_LIBS) \ - $(GTK_LIBS) \ - $(LIBXML2_LIBS) \ - $(NULL) if HAVE_GTK_VNC -libvirt_viewer_la_SOURCES += \ +COMMON_SOURCES += \ virt-viewer-session-vnc.h virt-viewer-session-vnc.c \ virt-viewer-display-vnc.h virt-viewer-display-vnc.c \ $(NULL) -libvirt_viewer_la_LIBADD += $(GTK_VNC_LIBS) endif if HAVE_SPICE_GTK -libvirt_viewer_la_SOURCES += \ +COMMON_SOURCES += \ virt-viewer-session-spice.h virt-viewer-session-spice.c \ virt-viewer-display-spice.h virt-viewer-display-spice.c \ $(NULL) -libvirt_viewer_la_LIBADD += $(SPICE_GTK_LIBS) endif -AM_CFLAGS = \ - $(GMODULE2_CFLAGS) \ - $(GTK_CFLAGS) \ - $(GTK_VNC_CFLAGS) \ - $(LIBXML2_CFLAGS) \ - $(SPICE_GTK_CFLAGS) \ - $(WARN_CFLAGS) \ - -DLOCALE_DIR=\""$(datadir)/locale"\" \ + +if HAVE_LIBVIRT +bin_PROGRAMS += virt-viewer +virt_viewer_SOURCES = \ + $(COMMON_SOURCES) \ + virt-viewer-events.h virt-viewer-events.c \ + virt-viewer.h virt-viewer.c \ + virt-viewer-main.c \ + $(NULL) +virt_viewer_LDFLAGS = \ + $(GMODULE2_LIBS) \ + $(GTK_LIBS) \ + $(LIBXML2_LIBS) \ + $(LIBVIRT_LIBS) \ + $(NULL) +virt_viewer_CFLAGS = \ + -DLOCALE_DIR=\""$(datadir)/locale"\" \ + $(GMODULE2_CFLAGS) \ + $(GTK_CFLAGS) \ + $(LIBXML2_CFLAGS) \ + $(LIBVIRT_CFLAGS) \ + $(WARN_CFLAGS) \ + $(NULL) + +if HAVE_GTK_VNC +virt_viewer_LDFLAGS += $(GTK_VNC_LIBS) +virt_viewer_CFLAGS += $(GTK_VNC_CFLAGS) +endif +if HAVE_SPICE_GTK +virt_viewer_LDFLAGS += $(SPICE_GTK_LIBS) +virt_viewer_CFLAGS += $(SPICE_GTK_CFLAGS) +endif +endif + + +bin_PROGRAMS += remote-viewer +remote_viewer_SOURCES = \ + $(COMMON_SOURCES) \ + remote-viewer.h remote-viewer.c \ + remote-viewer-main.c \ + $(NULL) +remote_viewer_LDFLAGS = \ + $(GMODULE2_LIBS) \ + $(GTK_LIBS) \ + $(LIBXML2_LIBS) \ $(NULL) +remote_viewer_CFLAGS = \ + -DLOCALE_DIR=\""$(datadir)/locale"\" \ + $(GMODULE2_CFLAGS) \ + $(GTK_CFLAGS) \ + $(LIBXML2_CFLAGS) \ + $(WARN_CFLAGS) \ + $(NULL) + +if HAVE_GTK_VNC +remote_viewer_LDFLAGS += $(GTK_VNC_LIBS) +remote_viewer_CFLAGS += $(GTK_VNC_CFLAGS) +endif +if HAVE_SPICE_GTK +remote_viewer_LDFLAGS += $(SPICE_GTK_LIBS) +remote_viewer_CFLAGS += $(SPICE_GTK_CFLAGS) +endif |