summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2011-04-20 11:09:55 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2011-05-03 14:44:10 +0200
commitd53bbea0c83d65e601055ec6955ba37a590380c8 (patch)
treef58db12d1dbacf57eb06a3b2e594c20f3af17026 /Makefile.am
parent9e8df89d01569a61033d21f56225d61133ac9290 (diff)
autotools: refactor the whole build machinery
spice Makefile.am setup is a bit confusing, with source file names being listed several times in different Makefile.am (generally, once in EXTRA_DIST and another time in another Makefile.am in _SOURCES). The client binaries are built by client/x11/Makefile.am, which means recursing into client, then into x11 to finally build spicec. This Makefile.am is also referencing files from common/ and client/, which is a bit unusual with autotools. This patch attempts to simplify the build process to get something more usual from an autotools point of view. The source from common/ are compiled into a libtool convenience library, which the server and the client links against which avoids referencing source files from common/ when building the server and the client. The client is built in client/Makefile.am and directly builds files from x11/ windows/ and gui/ if needed (without recursing in these subdirectories). This makes the build simpler to understand, and also makes it possible to list source files once, which avoids potential make distcheck breakage when adding new files. There is a regression in this patch with respect to sw_canvas/gl_canvas/gdi_canvas. They should be built with different preprocessor #defines resulting in different behaviour of the canvas for the client and the server. However, this is not currently the case, both the client and the server will use the same code for now (which probably means one of them is broken). This will be fixed in a subsequent commit. make distcheck passes, but compilation on windows using the autotools build system hasn't been tested, which means it's likely to be broken. It shouldn't be too hard ot fix it though, just let me know of any issues with this.
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am87
1 files changed, 56 insertions, 31 deletions
diff --git a/Makefile.am b/Makefile.am
index 407de1d..0a2f9c1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,53 +1,78 @@
+if OS_WIN32
SUBDIRS = win
+endif
NULL =
-COMMON_SRCS = \
- sw_canvas.h \
- sw_canvas.c \
- pixman_utils.h \
- pixman_utils.c \
+noinst_LTLIBRARIES = libspice-common.la
+libspice_common_la_SOURCES = \
canvas_base.h \
- canvas_base.c \
- canvas_utils.h \
canvas_utils.c \
+ canvas_utils.h \
draw.h \
- gdi_canvas.h \
- gdi_canvas.c \
- gl_canvas.h \
- gl_canvas.c \
- glc.h \
- glc.c \
- gl_utils.h \
+ lines.c \
+ lines.h \
+ lz.c \
+ lz.h \
lz_common.h \
+ lz_config.h \
+ marshaller.c \
+ marshaller.h \
+ mem.c \
+ mem.h \
+ messages.h \
mutex.h \
- ogl_ctx.h \
- ogl_ctx.c \
- quic.h \
+ pixman_utils.c \
+ pixman_utils.h \
quic.c \
+ quic.h \
quic_config.h \
rect.h \
- region.h \
region.c \
+ region.h \
ring.h \
- rop3.h \
rop3.c \
- lines.h \
- lines.c \
- lz.c \
+ rop3.h \
+ spice_common.h \
+ sw_canvas.c \
+ sw_canvas.h \
+ $(NULL)
+
+if OS_WIN32
+libspice_common_la_SOURCES += \
+ gdi_canvas.h \
+ gdi_canvas.c \
+ $(NULL)
+endif
+
+if SUPPORT_GL
+libspice_common_la_SOURCES += \
+ gl_canvas.h \
+ gl_canvas.c \
+ gl_utils.h \
+ glc.h \
+ glc.c \
+ ogl_ctx.h \
+ ogl_ctx.c \
+ $(NULL)
+endif
+
+INCLUDES = \
+ -DSW_CANVAS_IMAGE_CACHE \
+ $(GL_CFLAGS) \
+ $(PIXMAN_CFLAGS) \
+ $(PROTOCOL_CFLAGS) \
+ $(VISIBILITY_HIDDEN_CFLAGS) \
+ $(WARN_CFLAGS) \
+ -std=gnu99 \
+ $(NULL)
+
+EXTRA_DIST = \
+ canvas_base.c \
lz_compress_tmpl.c \
- lz_config.h \
lz_decompress_tmpl.c \
- lz.h \
- marshaller.h \
- marshaller.c \
- messages.h \
- mem.h \
- mem.c \
quic_family_tmpl.c \
quic_rgb_tmpl.c \
quic_tmpl.c \
$(NULL)
-EXTRA_DIST = $(COMMON_SRCS)
-