diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2012-02-16 14:20:25 +0000 |
---|---|---|
committer | Daniel P. Berrange <berrange@redhat.com> | 2012-02-16 14:20:25 +0000 |
commit | 8b18ea0ea5354940b1c29a437280603a9e415cac (patch) | |
tree | 3e8751099183308847cb3483f682d2503dd1a053 | |
parent | 08f746be69a02f8b9f6af7b8e27b47ff77f974ac (diff) |
Remove use of a libtool convenience library
The use of a libtool convenience library causes some platforms to
loose the ability to use the GNU_RELRO security feature in the
resulting binary. Refactor the makefile to simply compile the
common files twice, once for virt-viewer & once for remote-viewer
-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 |