shl: add new register helper

The shl-register module is used to create registries of named-objects. The
main purpose for it will be for module-systems were we have different
backends implementing an interface. The registry can then be used to find
a specific module (or the default module).

No sophisticated filter/search mechanism is used as this cannot be done
efficiently in a generic way.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
text: font: use new shl-registry objects

Instead of implementing a thread-safe backend-system we can now use the
new shl-registry storage module.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
text: use new shl-registry objects

Instead of implementing our own thread-safe backend-storage, we now use
the generic shl-registry object.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
shl: misc: add shl_dirent() helper

"struct dirent" has always been a mess. As its size may differ between
systems, we need to dynamically allocate it. This helper does that for us.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
shl: misc: add shl_ends_with() helper

This helper checks whether a string has the given suffix.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
build: mark man_fixup_aliases as PHONY target

We need to mark it as PHONY target as it has no corresponding source file.
It's unlikely that it causes problems, but lets be safe.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
build: fix libuterm dependency typo

We didn't set the dependencies correctly for uterm libraries as a
backslash was missing. Fix this typo.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
build: provide git-head revision via githead.h

We need the git-revision for module-version checks so provide the
infrastructure now and print it in log_init().

Note that the git-describe string is distributed with the tarballs so
end-users will not have to generate it themself. But when building from
git, the revision will be automatically updated whenever something
changes.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
build: fix man-page compilation

The man_fixup_aliases thingy was a horrible hack. Replace it with a
temporary .man_fixup file that saves compilation timestamps so we have
post-recipies for man-fixups.

Also fix some minor out-of-tree build problems.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
build: include kmsconvt@.service in EXTRA_DIST

We need the new kmsconvt@.service file instead of the old kmscon@.service.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
docs: remove getty@.service

This is no longer used and was replaced by kmsconvt@.service some time
ago.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
build: link each text-font backend separately

We want to modularize the text-font library, so we need each backend as a
different library. This step links each of them into a different static
library so we can now link them either into the binary or into modules.

This step also makes 8x16 always compiled into the text-font backend so we
always have a working implementation even though no modules might be
loaded.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
text: remove load/unload helpers for text-font backends

With modules we no longer need to conditionally load backends. Instead
each module will register the backend with the main application on load.

This will temporarily break pango, freetype2 and unifont backends as they
are not registered until we introduce full module support.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
shl: register: add destroy callback

The new destroy callback is called whenever an entries last reference is
dropped. This will allow modules to keep reference of its code users.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
text: font: add .finalize callback

Each font-backend now also gets a .finalize callback that is called when
the last font-user drops its font. This will allow modules to destroy
themself when the last reference is dropped.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
build: disable wlterm by default

wlterm hasn't been updated for long and it will take some more time to get
it to work with recent Wayland protocol. Hence, disable it so it doesn't
matter if it breaks for now.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
kmscon: add module support

Several parts of kmscon have huge external dependencies. However, we allow
them to be disabled during build-time. But this is not enough as it
requires distributions to choose which options to use. Therefore, we now
allow dynamicly loadable modules that can optionally be installed and
kmscon automatically picks them up.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
text: font: add owner field to font_ops

The owner fields specifies the module that provides the code for the given
backend. The font-core is responsible of ref/unref'ing the module so its
code is always available as long as the module exists.

We cannot push this into the modules as modules _must_ never call
kmscon_module_unref(KMSCON_THIS_MODULE)! Because this might drop the last
reference and hence the function might disallocate the module. However,
this means that it cannot return because the caller is _part_ of the
module and so no longer valid.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
kmscon: add pango module

The pango module registers the pango font-backend with kmscon.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
text: move font layer into top-level font_* namespace

The font layer does not longer depend on the text layer so move it into
its own namespace.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>