summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2012-06-08 12:30:33 +0200
committerMarc-André Lureau <marcandre.lureau@gmail.com>2012-06-08 13:13:23 +0200
commita095f4806e3b75c717a3b8b728c412443ab6d780 (patch)
tree5dd1f1a879a3466d4dd91b09135c5aa3c198585c
parent0cef8ba42b88132343306d1dca097f5cb61e493b (diff)
build-sys: statically build agent
Fix build by default when using mingw (when more compiler are supported we could do case by case) Since we are statically building, strip resulting binary (we also use lto, whole-program but that doesn't seem to change much..)
-rw-r--r--Makefile.am9
-rw-r--r--configure.ac1
2 files changed, 7 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am
index 5f0c9dc..f954a8c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -6,15 +6,18 @@ INCLUDES = \
-I$(top_srcdir)/spice-protocol \
$(NULL)
-AM_CPPFLAGS = -DUNICODE -D_UNICODE
+AM_CXXFLAGS = -flto -fwhole-program
+AM_CPPFLAGS = -DUNICODE -D_UNICODE -DOLDMSVCRT
+AM_LDFLAGS = -static -s
+
# -lversion is needed for the GetFileVersion* API which is used by vdlog.cpp
LIBS = -lversion
bin_PROGRAMS = vdagent vdservice
vdagent_LDADD = $(CXIMAGE_LIBS) vdagent_rc.$(OBJEXT)
-vdagent_CXXFLAGS = $(CXIMAGE_CFLAGS)
-vdagent_LDFLAGS = -Wl,--subsystem,windows
+vdagent_CXXFLAGS = $(AM_CXXFLAGS) $(CXIMAGE_CFLAGS)
+vdagent_LDFLAGS = $(AM_LDFLAGS) -Wl,--subsystem,windows
vdagent_SOURCES = \
common/vdcommon.h \
common/vdlog.cpp \
diff --git a/configure.ac b/configure.ac
index 597e724..0b5f498 100644
--- a/configure.ac
+++ b/configure.ac
@@ -65,6 +65,7 @@ dnl - Check library dependencies
dnl ---------------------------------------------------------------------------
PKG_CHECK_MODULES(CXIMAGE, [cximage])
+CXIMAGE_LIBS=`$PKG_CONFIG --static --libs cximage`
dnl ---------------------------------------------------------------------------
dnl - Makefiles, etc.