uterm: vt: add uterm_vt_get_num() helper
[platform/upstream/kmscon.git] / Makefile.am
index 263372e..7019290 100644 (file)
@@ -1,11 +1,41 @@
 #
 # Kmscon - Global Makefile
-# Copyright (c) 2012 David Herrmann <dh.herrmann@googlemail.com>
+# Copyright (c) 2012-2013 David Herrmann <dh.herrmann@googlemail.com>
 #
 
-ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = \
-       .
+#
+# Library Version Numbers
+#
+
+LIBELOOP_CURRENT = 1
+LIBELOOP_REVISION = 0
+LIBELOOP_AGE = 0
+
+LIBTSM_CURRENT = 1
+LIBTSM_REVISION = 0
+LIBTSM_AGE = 0
+
+LIBUVT_CURRENT = 1
+LIBUVT_REVISION = 0
+LIBUVT_AGE = 0
+
+LIBUTERM_CURRENT = 1
+LIBUTERM_REVISION = 0
+LIBUTERM_AGE = 0
+
+#
+# Global Configurations and Initializations
+#
+
+ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
+AM_MAKEFLAGS = --no-print-directory
+AUTOMAKE_OPTIONS = color-tests
+AM_DISTCHECK_CONFIGURE_FLAGS = --enable-all
+
+SUBDIRS = .
+
+.DELETE_ON_ERROR:
+
 include_HEADERS =
 EXTRA_DIST = \
        README \
@@ -13,7 +43,14 @@ EXTRA_DIST = \
        NEWS \
        docs/kmscon.service \
        docs/kmsconvt@.service \
-       docs/getty@.service
+       docs/pc/libeloop.pc.in \
+       docs/pc/libtsm.pc.in \
+       docs/pc/libuvt.pc.in \
+       docs/pc/libuterm.pc.in \
+       docs/sym/libeloop.sym \
+       docs/sym/libtsm.sym \
+       docs/sym/libuvt.sym \
+       docs/sym/libuterm.sym
 CLEANFILES =
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA =
@@ -23,13 +60,11 @@ TPHONY =
 
 bin_PROGRAMS =
 check_PROGRAMS =
-noinst_PROGRAMS = \
-       genshader \
-       genunifont
-noinst_LTLIBRARIES =
+noinst_PROGRAMS =
 lib_LTLIBRARIES =
+noinst_LTLIBRARIES =
 
-moduledir = @libdir@/kmscon
+moduledir = $(libdir)/kmscon
 module_LTLIBRARIES =
 
 #
@@ -45,13 +80,25 @@ module_LTLIBRARIES =
 #
 
 AM_CFLAGS = \
-       -Wall
+       -Wall \
+       -pipe \
+       -fno-common \
+       -ffast-math \
+       -fdiagnostics-show-option \
+       -fno-strict-aliasing \
+       -fvisibility=hidden \
+       -ffunction-sections \
+       -fdata-sections \
+       -fstack-protector
 AM_CPPFLAGS = \
        -DBUILD_MODULE_DIR='"$(moduledir)"' \
        -include $(top_builddir)/config.h \
        -I $(srcdir)/src
 AM_LDFLAGS = \
-       -Wl,--as-needed
+       -Wl,--as-needed \
+       -Wl,--gc-sections \
+       -Wl,-z,relro \
+       -Wl,-z,now
 
 if BUILD_ENABLE_DEBUG
 AM_CFLAGS += -g
@@ -64,46 +111,14 @@ AM_CFLAGS += -O0
 endif
 
 #
-# SHL - Static Helper Library
-# The SHL subsystem contains several small code pieces used all over kmscon and
-# other applications.
-#
-# Simply include $(SHL_*) in your source-file list.
-# SHL_MISC needs xkbcommon
-# SHL_REGISTER needs pthread
-#
-
-SHL_DLIST = \
-       src/shl_dlist.h
-SHL_ARRAY = \
-       src/shl_array.h
-SHL_HASHTABLE = \
-       src/shl_hashtable.h \
-       external/htable.h \
-       external/htable.c
-SHL_RING = \
-       src/shl_ring.h
-SHL_TIMER = \
-       src/shl_timer.h
-SHL_LLOG = \
-       src/shl_llog.h
-SHL_HOOK = \
-       src/shl_hook.h \
-       $(SHL_DLIST)
-SHL_MISC = \
-       src/shl_misc.h
-SHL_REGISTER = \
-       src/shl_register.h \
-       $(SHL_DLIST)
-
-#
 # GIT-HEAD helper
-# The file ./src/githead.h contains a constant BUILD_GIT_HEAD which is defined
-# to the string returned by "git describe". We need to adjust this string for
-# every build and correctly rebuild any sources that depend on it. Therefore,
-# you should use this file rarely as it causes rebuilds on every git-commit.
+# The file ./src/shl_githead.c contains a constant "shl_git_head" which is
+# defined to the string returned by "git describe". We need to adjust this
+# string for every build and correctly rebuild any sources that depend on it.
+# Therefore, you should use this file rarely as it causes rebuilds on every
+# git-commit.
 #
-# We have a helper-script ./src/genversion.sh that takes as argument the header
+# We have a helper-script ./src/genversion.sh that takes as argument the source
 # file and creates it if necessary. It updates it only if the new git-describe
 # string is different to the old one. So the file is only modified on changes.
 # Hence, we can use it as normal dependency in this Makefile.
@@ -112,17 +127,17 @@ SHL_REGISTER = \
 # "simply expanded" variable (:=) so the shell command is executed on
 # variable-declaration and not during expansion.
 #
-# Note that we must not clean ./src/githead.h ever! If we would, a distribution
-# tarball might delete that file and have no way to recreate it.
+# Note that we must not clean ./src/shl_githead.c ever! If we would, a
+# distribution tarball might delete that file and have no way to recreate it.
 # We could delete it on something like "make maintainerclean", but then again,
 # it seems unnecessary so lets simply not clean it at all.
 #
 # If the helper-script is executed in a directory that is not a git-repository
-# (like a distribution tarball) and githead.h exists, then it does nothing as it
-# expects githead.h to be correctly written by "make dist".
-# However, if githead.h does not exist, it will print a warning and write
-# "<unknown>" as git-revision.
-# This guarantees, that githead.h is always present and has the most correct
+# (like a distribution tarball) and shl_githead.c exists, then it does nothing
+# as it expects shl_githead.c to be correctly written by "make dist".
+# However, if shl_githead.c does not exist, it will print a warning and write
+# an unknown random git-revision.
+# This guarantees, that shl_githead.c is always present and has the most correct
 # value that we can get under any conditions.
 #
 # The $(emptyvariable) expansion below is used for broken $(shell ...)
@@ -130,7 +145,68 @@ SHL_REGISTER = \
 #
 
 EXTRA_DIST += src/genversion.sh
-GITHEAD:=$(shell $(emptyvariable)"$(srcdir)/src/genversion.sh" "$(srcdir)/src/githead.h")
+GITHEAD:=$(shell $(emptyvariable)"$(srcdir)/src/genversion.sh" "$(srcdir)/src/shl_githead.c")
+
+#
+# Binary File Compiler
+# This target gets as input a binary file *.bin and produces an ELF/etc. output
+# object file *.bin.o and the corresponding libtool file *.bin.lo.
+# Note that we fake the libtool object files as there is no way to make libtool
+# create it. The comments in the .lo file are mandatory so don't remove them!
+#
+
+CLEANFILES += src/*.bin.lo src/*.bin.o
+
+src/%.bin.lo: src/%.bin
+       $(AM_V_GEN)$(LD) -r -o "src/$*.bin.o" -z noexecstack --format=binary "$<"
+       $(AM_V_at)echo "# $@ - a libtool object file" >"$@"
+       $(AM_V_at)echo "# Generated by $(shell $(LIBTOOL) --version | head -n 1)" >>"$@"
+       $(AM_V_at)echo "#" >>"$@"
+       $(AM_V_at)echo "# Please DO NOT delete this file!" >>"$@"
+       $(AM_V_at)echo "# It is necessary for linking the library." >>"$@"
+       $(AM_V_at)echo >>"$@"
+       $(AM_V_at)echo "# Name of the PIC object." >>"$@"
+       $(AM_V_at)echo "pic_object='$*.bin.o'" >>"$@"
+       $(AM_V_at)echo >>"$@"
+       $(AM_V_at)echo "# Name of the non-PIC object" >>"$@"
+       $(AM_V_at)echo "non_pic_object='$*.bin.o'" >>"$@"
+       $(AM_V_at)echo >>"$@"
+
+#
+# SHL - Static Helper Library
+# The SHL subsystem contains several small code pieces used all over kmscon and
+# other applications.
+#
+
+noinst_LTLIBRARIES += libshl.la
+
+libshl_la_SOURCES = \
+       src/shl_githead.h \
+       src/shl_githead.c \
+       src/shl_dlist.h \
+       src/shl_array.h \
+       src/shl_hashtable.h \
+       external/htable.h \
+       external/htable.c \
+       src/shl_ring.h \
+       src/shl_timer.h \
+       src/shl_llog.h \
+       src/shl_log.h \
+       src/shl_log.c \
+       src/shl_hook.h \
+       src/shl_misc.h \
+       src/shl_register.h \
+       src/shl_flagset.h
+libshl_la_CPPFLAGS = \
+       $(AM_CPPFLAGS) \
+       $(XKBCOMMON_CFLAGS) \
+       -pthread
+libshl_la_LDFLAGS = \
+       $(AM_LDFLAGS) \
+       -pthread
+libshl_la_LIBADD = \
+       $(AM_LIBADD) \
+       $(XKBCOMMON_LIBS)
 
 #
 # libeloop
@@ -145,17 +221,16 @@ pkgconfig_DATA += docs/pc/libeloop.pc
 endif
 
 libeloop_la_SOURCES = \
-       $(SHL_DLIST) \
-       $(SHL_LLOG) \
-       $(SHL_HOOK) \
        src/eloop.h \
        src/eloop.c
 
-libeloop_la_CPPFLAGS = \
-       $(AM_CPPFLAGS)
-libeloop_la_LIBADD =
+libeloop_la_LIBADD = libshl.la
+libeloop_la_CPPFLAGS = $(AM_CPPFLAGS)
+EXTRA_libeloop_la_DEPENDENCIES = ${top_srcdir}/docs/sym/libeloop.sym
 libeloop_la_LDFLAGS = \
-       -version-info 1:0:0
+       $(AM_LDFLAGS) \
+       -version-info $(LIBELOOP_CURRENT):$(LIBELOOP_REVISION):$(LIBELOOP_AGE) \
+       -Wl,--version-script=$(top_srcdir)/docs/sym/libeloop.sym
 
 
 if BUILD_ENABLE_ELOOP_DBUS
@@ -163,10 +238,8 @@ libeloop_la_SOURCES += \
        external/dbus-common.h \
        external/dbus-loop.h \
        external/dbus-loop.c
-libeloop_la_CPPFLAGS += \
-       $(DBUS_CFLAGS)
-libeloop_la_LIBADD += \
-       $(DBUS_LIBS)
+libeloop_la_CPPFLAGS += $(DBUS_CFLAGS)
+libeloop_la_LIBADD += $(DBUS_LIBS)
 endif
 
 #
@@ -177,21 +250,15 @@ endif
 #
 
 if BUILD_ENABLE_TSM
-lib_LTLIBRARIES += \
-       libtsm.la
+lib_LTLIBRARIES += libtsm.la
 include_HEADERS += \
        src/tsm_screen.h \
        src/tsm_unicode.h \
        src/tsm_vte.h
-pkgconfig_DATA += \
-       docs/pc/libtsm.pc
+pkgconfig_DATA += docs/pc/libtsm.pc
 endif
 
 libtsm_la_SOURCES = \
-       $(SHL_LLOG) \
-       $(SHL_TIMER) \
-       $(SHL_ARRAY) \
-       $(SHL_HASHTABLE) \
        src/tsm_screen.h \
        src/tsm_screen.c \
        src/tsm_unicode.h \
@@ -205,9 +272,47 @@ libtsm_la_SOURCES = \
 libtsm_la_CPPFLAGS = \
        $(AM_CPPFLAGS) \
        $(XKBCOMMON_CFLAGS)
-libtsm_la_LDFLAGS = \
+libtsm_la_LIBADD = \
        $(XKBCOMMON_LIBS) \
-       -version-info 1:0:0
+       libshl.la
+EXTRA_libtsm_la_DEPENDENCIES = ${top_srcdir}/docs/sym/libtsm.sym
+libtsm_la_LDFLAGS = \
+       $(AM_LDFLAGS) \
+       -version-info $(LIBTSM_CURRENT):$(LIBTSM_REVISION):$(LIBTSM_AGE) \
+       -Wl,--version-script="$(top_srcdir)/docs/sym/libtsm.sym"
+
+#
+# libuvt
+# Implementation of Virtual Terminals in user-space with the help of CUSE/FUSE
+# so we can provide character-device drivers in user-space. Aims to be 100%
+# compatible but also provides many other use-cases.
+#
+
+if BUILD_ENABLE_UVT
+lib_LTLIBRARIES += libuvt.la
+include_HEADERS += src/uvt.h
+pkgconfig_DATA += docs/pc/libuvt.pc
+endif
+
+libuvt_la_SOURCES = \
+       src/uvt.h \
+       src/uvt_internal.h \
+       src/uvt_ctx.c \
+       src/uvt_cdev.c \
+       src/uvt_client.c \
+       src/uvt_tty_null.c
+libuvt_la_CPPFLAGS = \
+       $(AM_CPPFLAGS) \
+       $(FUSE_CFLAGS) \
+       -DFUSE_USE_VERSION=29
+libuvt_la_LIBADD = \
+       $(FUSE_LIBS) \
+       libshl.la
+EXTRA_libuvt_la_DEPENDENCIES = ${top_srcdir}/docs/sym/libuvt.sym
+libuvt_la_LDFLAGS = \
+       $(AM_LDFLAGS) \
+       -version-info $(LIBUVT_CURRENT):$(LIBUVT_REVISION):$(LIBUVT_AGE) \
+       -Wl,--version-script="$(top_srcdir)/docs/sym/libuvt.sym"
 
 #
 # libuterm
@@ -219,19 +324,22 @@ libtsm_la_LDFLAGS = \
 
 if BUILD_ENABLE_UTERM
 lib_LTLIBRARIES += libuterm.la
-include_HEADERS += src/uterm.h
+include_HEADERS += \
+       src/uterm_input.h \
+       src/uterm_monitor.h \
+       src/uterm_video.h \
+       src/uterm_vt.h
 pkgconfig_DATA += docs/pc/libuterm.pc
 endif
 
 libuterm_la_SOURCES = \
-       $(SHL_DLIST) \
-       $(SHL_HOOK) \
-       $(SHL_MISC) \
-       src/uterm.h \
        src/uterm_input.h \
+       src/uterm_monitor.h \
        src/uterm_video.h \
-       src/uterm_pci.h \
-       src/uterm_systemd.h \
+       src/uterm_vt.h \
+       src/uterm_input_internal.h \
+       src/uterm_video_internal.h \
+       src/uterm_systemd_internal.h \
        src/uterm_video.c \
        src/uterm_monitor.c \
        src/uterm_vt.c \
@@ -245,9 +353,13 @@ libuterm_la_CPPFLAGS = \
        $(XKBCOMMON_CFLAGS)
 libuterm_la_LIBADD = \
        $(XKBCOMMON_LIBS) \
-       libeloop.la
+       libeloop.la \
+       libshl.la
+EXTRA_libuterm_la_DEPENDENCIES = ${top_srcdir}/docs/sym/libuterm.sym
 libuterm_la_LDFLAGS = \
-       -version-info 1:0:0
+       $(AM_LDFLAGS) \
+       -version-info $(LIBUTERM_CURRENT):$(LIBUTERM_REVISION):$(LIBUTERM_AGE) \
+       -Wl,--version-script="$(top_srcdir)/docs/sym/libuterm.sym"
 
 if BUILD_ENABLE_MULTI_SEAT
 libuterm_la_SOURCES += src/uterm_systemd.c
@@ -260,30 +372,32 @@ libuterm_la_CPPFLAGS += $(UDEV_CFLAGS)
 libuterm_la_LIBADD += $(UDEV_LIBS)
 endif
 
-if BUILD_ENABLE_PCIACCESS
-libuterm_la_CPPFLAGS += $(PCIACCESS_CFLAGS)
-libuterm_la_LIBADD += $(PCIACCESS_LIBS)
-libuterm_la_SOURCES += src/uterm_pci.c
-endif
-
 if BUILD_ENABLE_VIDEO_FBDEV
-libuterm_la_SOURCES += src/uterm_video_fbdev.c
+libuterm_la_SOURCES += \
+       src/uterm_fbdev_internal.h \
+       src/uterm_fbdev_video.c \
+       src/uterm_fbdev_render.c
 endif
 
-if BUILD_ENABLE_VIDEO_DUMB
-libuterm_la_SOURCES += src/uterm_video_dumb.c
+if BUILD_ENABLE_VIDEO_DRM2D
+libuterm_la_SOURCES += \
+       src/uterm_drm2d_internal.h \
+       src/uterm_drm2d_video.c \
+       src/uterm_drm2d_render.c
 libuterm_la_CPPFLAGS += $(DRM_CFLAGS)
 libuterm_la_LIBADD += $(DRM_LIBS)
 endif
 
-if BUILD_ENABLE_VIDEO_DRM
+if BUILD_ENABLE_VIDEO_DRM3D
+noinst_PROGRAMS += genshader
 libuterm_la_SOURCES += \
-       src/uterm_video_drm.c \
+       src/uterm_drm3d_internal.h \
+       src/uterm_drm3d_video.c \
+       src/uterm_drm3d_render.c \
        src/static_gl.h \
        src/static_gl_math.c \
        src/static_gl_shader.c
-nodist_libuterm_la_SOURCES += \
-       src/static_shaders.c
+nodist_libuterm_la_SOURCES += src/static_shaders.c
 libuterm_la_CPPFLAGS += \
        $(DRM_CFLAGS) \
        $(EGL_CFLAGS) \
@@ -296,6 +410,18 @@ libuterm_la_LIBADD += \
        $(GLES2_LIBS)
 endif
 
+# add shared sources only once
+UTERM_DRM_SHARED_SRC = \
+       src/uterm_drm_shared_internal.h \
+       src/uterm_drm_shared.c
+if BUILD_ENABLE_VIDEO_DRM2D
+libuterm_la_SOURCES += $(UTERM_DRM_SHARED_SRC)
+else
+if BUILD_ENABLE_VIDEO_DRM3D
+libuterm_la_SOURCES += $(UTERM_DRM_SHARED_SRC)
+endif
+endif
+
 #
 # Shaders
 # As there is no need to modify shaders at run-time, we statically compile them
@@ -327,35 +453,16 @@ src/static_shaders.c: $(SHADERS) genshader$(EXEEXT)
 # This generates the unifont sources from raw hex-encoded font data.
 #
 
-UNIFONT = src/font_unifont_data.hex
+UNIFONT = $(top_srcdir)/src/font_unifont_data.hex
+UNIFONT_BIN = src/font_unifont_data.bin
+UNIFONT_LT = src/font_unifont_data.bin.lo
 
 EXTRA_DIST += $(UNIFONT)
-CLEANFILES += src/font_unifont_data.c
+CLEANFILES += $(UNIFONT_BIN)
 genunifont_SOURCES = src/genunifont.c
 
-src/font_unifont_data.c: $(UNIFONT) genunifont$(EXEEXT)
-       $(AM_V_GEN)./genunifont$(EXEEXT) src/font_unifont_data.c $(UNIFONT)
-
-#
-# Font library
-# The font library is used by kmscon _and_ wlterm but is currently linked
-# statically as it hasn't been cleaned up entirely.
-# It has a build-time dependency to UTERM and runtime dependencies to TSM.
-#
-
-if BUILD_ENABLE_KMSCON
-noinst_LTLIBRARIES += libfont.la
-endif
-
-libfont_la_SOURCES = \
-       $(SHL_REGISTER) \
-       src/font.h \
-       src/font.c \
-       src/font_8x16.c
-libfont_la_LIBADD = \
-       -lpthread
-libfont_la_LDFLAGS = \
-       -rdynamic
+$(UNIFONT_BIN): $(UNIFONT) genunifont$(EXEEXT)
+       $(AM_V_GEN)./genunifont$(EXEEXT) $(UNIFONT_BIN) $(UNIFONT)
 
 #
 # Kmscon Modules
@@ -363,16 +470,18 @@ libfont_la_LDFLAGS = \
 
 if BUILD_ENABLE_FONT_UNIFONT
 module_LTLIBRARIES += mod-unifont.la
+noinst_PROGRAMS += genunifont
 endif
 
 mod_unifont_la_SOURCES = \
        src/kmscon_module_interface.h \
-       src/githead.h \
        src/font_unifont.c \
        src/kmscon_mod_unifont.c
-nodist_mod_unifont_la_SOURCES = \
-       src/font_unifont_data.c
+mod_unifont_la_LIBADD = \
+       $(UNIFONT_LT) \
+       libshl.la
 mod_unifont_la_LDFLAGS = \
+       $(AM_LDFLAGS) \
        -module \
        -avoid-version
 
@@ -381,10 +490,7 @@ module_LTLIBRARIES += mod-freetype2.la
 endif
 
 mod_freetype2_la_SOURCES = \
-       $(SHL_DLIST) \
-       $(SHL_HASHTABLE) \
        src/kmscon_module_interface.h \
-       src/githead.h \
        src/font_freetype2.c \
        src/kmscon_mod_freetype2.c
 mod_freetype2_la_CPPFLAGS = \
@@ -393,8 +499,10 @@ mod_freetype2_la_CPPFLAGS = \
 mod_freetype2_la_LIBADD = \
        $(FREETYPE2_LIBS) \
        -lpthread \
-       libtsm.la
+       libtsm.la \
+       libshl.la
 mod_freetype2_la_LDFLAGS = \
+       $(AM_LDFLAGS) \
        -module \
        -avoid-version
 
@@ -403,10 +511,7 @@ module_LTLIBRARIES += mod-pango.la
 endif
 
 mod_pango_la_SOURCES = \
-       $(SHL_DLIST) \
-       $(SHL_HASHTABLE) \
        src/kmscon_module_interface.h \
-       src/githead.h \
        src/font_pango.c \
        src/kmscon_mod_pango.c
 mod_pango_la_CPPFLAGS = \
@@ -415,8 +520,87 @@ mod_pango_la_CPPFLAGS = \
 mod_pango_la_LIBADD = \
        $(PANGO_LIBS) \
        -lpthread \
-       libtsm.la
+       libtsm.la \
+       libshl.la
 mod_pango_la_LDFLAGS = \
+       $(AM_LDFLAGS) \
+       -module \
+       -avoid-version
+
+if BUILD_ENABLE_RENDERER_BBULK
+module_LTLIBRARIES += mod-bbulk.la
+endif
+
+mod_bbulk_la_SOURCES = \
+       src/kmscon_module_interface.h \
+       src/text_bbulk.c \
+       src/kmscon_mod_bbulk.c
+mod_bbulk_la_LIBADD = libshl.la
+mod_bbulk_la_LDFLAGS = \
+       $(AM_LDFLAGS) \
+       -module \
+       -avoid-version
+
+if BUILD_ENABLE_RENDERER_GLTEX
+module_LTLIBRARIES += mod-gltex.la
+noinst_PROGRAMS += genshader
+endif
+
+mod_gltex_la_SOURCES = \
+       src/kmscon_module_interface.h \
+       src/text_gltex.c \
+       src/static_gl.h \
+       src/static_gl_math.c \
+       src/static_gl_shader.c \
+       src/kmscon_mod_gltex.c
+nodist_mod_gltex_la_SOURCES = \
+       src/static_shaders.c
+mod_gltex_la_CPPFLAGS = \
+       $(AM_CPPFLAGS) \
+       $(GLES2_CFLAGS)
+mod_gltex_la_LIBADD = \
+       $(GLES2_LIBS) \
+       libshl.la
+mod_gltex_la_LDFLAGS = \
+       $(AM_LDFLAGS) \
+       -module \
+       -avoid-version
+
+if BUILD_ENABLE_RENDERER_CAIRO
+module_LTLIBRARIES += mod-cairo.la
+endif
+
+mod_cairo_la_SOURCES = \
+       src/kmscon_module_interface.h \
+       src/text_cairo.c \
+       src/kmscon_mod_cairo.c
+mod_cairo_la_CPPFLAGS = \
+       $(AM_CPPFLAGS) \
+       $(CAIRO_CFLAGS)
+mod_cairo_la_LIBADD = \
+       $(CAIRO_LIBS) \
+       libshl.la
+mod_cairo_la_LDFLAGS = \
+       $(AM_LDFLAGS) \
+       -module \
+       -avoid-version
+
+if BUILD_ENABLE_RENDERER_PIXMAN
+module_LTLIBRARIES += mod-pixman.la
+endif
+
+mod_pixman_la_SOURCES = \
+       src/kmscon_module_interface.h \
+       src/text_pixman.c \
+       src/kmscon_mod_pixman.c
+mod_pixman_la_CPPFLAGS = \
+       $(AM_CPPFLAGS) \
+       $(PIXMAN_CFLAGS)
+mod_pixman_la_LIBADD = \
+       $(PIXMAN_LIBS) \
+       libshl.la
+mod_pixman_la_LDFLAGS = \
+       $(AM_LDFLAGS) \
        -module \
        -avoid-version
 
@@ -438,23 +622,16 @@ MANPAGES += docs/man/kmscon.1
 endif
 
 kmscon_SOURCES = \
-       $(SHL_DLIST) \
-       $(SHL_MISC) \
-       $(SHL_ARRAY) \
-       $(SHL_HASHTABLE) \
-       $(SHL_RING) \
-       $(SHL_TIMER) \
-       $(SHL_HOOK) \
-       $(SHL_REGISTER) \
-       src/githead.h \
        src/conf.h \
        src/conf.c \
-       src/log.h \
-       src/log.c \
        src/pty.h \
        src/pty.c \
+       src/font.h \
+       src/font.c \
+       src/font_8x16.c \
        src/text.h \
        src/text.c \
+       src/text_bblit.c \
        src/kmscon_module_interface.h \
        src/kmscon_module.h \
        src/kmscon_module.c \
@@ -475,9 +652,11 @@ kmscon_LDADD = \
        $(XKBCOMMON_LIBS) \
        libeloop.la \
        libuterm.la \
-       libfont.la \
-       -lpthread
+       libshl.la \
+       -lpthread \
+       -ldl
 kmscon_LDFLAGS = \
+       $(AM_LDFLAGS) \
        -rdynamic
 
 if BUILD_ENABLE_SESSION_DUMMY
@@ -495,25 +674,6 @@ kmscon_CPPFLAGS += $(FUSE_CFLAGS)
 kmscon_LDADD += $(FUSE_LIBS)
 endif
 
-if BUILD_ENABLE_RENDERER_BBLIT
-kmscon_SOURCES += src/text_bblit.c
-endif
-
-if BUILD_ENABLE_RENDERER_BBULK
-kmscon_SOURCES += src/text_bbulk.c
-endif
-
-if BUILD_ENABLE_RENDERER_GLTEX
-kmscon_SOURCES += \
-       src/text_gltex.c \
-       src/static_gl.h \
-       src/static_gl_math.c \
-       src/static_gl_shader.c
-nodist_kmscon_SOURCES += src/static_shaders.c
-kmscon_CPPFLAGS += $(GLES2_CFLAGS)
-kmscon_LDADD += $(GLES2_LIBS)
-endif
-
 #
 # Wayland Terminal
 #
@@ -523,10 +683,6 @@ bin_PROGRAMS += wlterm
 endif
 
 wlterm_SOURCES = \
-       $(SHL_MISC) \
-       $(SHL_ARRAY) \
-       $(SHL_DLIST) \
-       $(SHL_HOOK) \
        src/wlt_main.h \
        src/wlt_main.c \
        src/wlt_toolkit.h \
@@ -535,45 +691,74 @@ wlterm_SOURCES = \
        src/wlt_theme.c \
        src/wlt_terminal.h \
        src/wlt_terminal.c \
-       src/log.h \
-       src/log.c \
        src/conf.h \
        src/conf.c \
        src/pty.h \
-       src/pty.c
+       src/pty.c \
+       src/font.h \
+       src/font.c \
+       src/font_8x16.c \
+       src/font_pango.c
 wlterm_CPPFLAGS = \
        $(AM_CPPFLAGS) \
        $(WAYLAND_CFLAGS) \
+       $(PANGO_CFLAGS) \
        $(XKBCOMMON_CFLAGS)
 wlterm_LDADD = \
        $(WAYLAND_LIBS) \
+       $(PANGO_LIBS) \
        $(XKBCOMMON_LIBS) \
        libeloop.la \
        libtsm.la \
+       libshl.la \
        -lpthread
 
 #
+# uvtd
+#
+
+if BUILD_ENABLE_UVTD
+bin_PROGRAMS += uvtd
+endif
+
+uvtd_SOURCES = \
+       src/uvtd_main.c \
+       src/uvtd_ctx.h \
+       src/uvtd_ctx.c \
+       src/uvtd_vt.h \
+       src/uvtd_vt.c \
+       src/uvtd_seat.h \
+       src/uvtd_seat.c
+uvtd_CPPFLAGS = \
+       $(AM_CPPFLAGS) \
+       $(XKBCOMMON_CFLAGS)
+uvtd_LDADD = \
+       $(XKBCOMMON_LIBS) \
+       libeloop.la \
+       libshl.la \
+       libuterm.la \
+       libuvt.la
+
+#
 # Tests
 #
 
 test_sources = \
-       src/log.h \
-       src/log.c \
        src/conf.h \
        src/conf.c \
        tests/test_include.h
 test_cflags = \
+       $(AM_CPPFLAGS) \
        $(XKBCOMMON_CFLAGS)
 test_libs = \
        $(XKBCOMMON_LIBS) \
-       libeloop.la
+       libeloop.la \
+       libshl.la
 
 test_output_SOURCES = \
        $(test_sources) \
        tests/test_output.c
-test_output_CPPFLAGS = \
-       $(AM_CPPFLAGS) \
-       $(test_cflags)
+test_output_CPPFLAGS = $(test_cflags)
 test_output_LDADD = \
        $(test_libs) \
        libuterm.la
@@ -581,9 +766,7 @@ test_output_LDADD = \
 test_vt_SOURCES = \
        $(test_sources) \
        tests/test_vt.c
-test_vt_CPPFLAGS = \
-       $(AM_CPPFLAGS) \
-       $(test_cflags)
+test_vt_CPPFLAGS = $(test_cflags)
 test_vt_LDADD = \
        $(test_libs) \
        libuterm.la
@@ -591,9 +774,7 @@ test_vt_LDADD = \
 test_input_SOURCES = \
        $(test_sources) \
        tests/test_input.c
-test_input_CPPFLAGS = \
-       $(AM_CPPFLAGS) \
-       $(test_cflags)
+test_input_CPPFLAGS = $(test_cflags)
 test_input_LDADD = \
        $(test_libs) \
        libuterm.la
@@ -601,11 +782,8 @@ test_input_LDADD = \
 test_key_SOURCES = \
        $(test_sources) \
        tests/test_key.c
-test_key_CPPFLAGS = \
-       $(AM_CPPFLAGS) \
-       $(test_cflags)
-test_key_LDADD = \
-       $(test_libs)
+test_key_CPPFLAGS = $(test_cflags)
+test_key_LDADD = $(test_libs)
 
 #
 # Manpages