build: support darwin targets

Mac OS X now uses the llvm linker, so our --gc-sections logic is not
supported. Furthermore, linker-scripts aren't supported either. Add GNU-ld
and Darwin detection and drop any GNU-ld specific options if not
supported.

Dropping --gc-sections and its related options is fine. We will produce
bigger binaries, but that's just what you get if you don't support that.
On Darwin we try the -dead_stip options instead. They should work
sufficiently well.

Regarding version-scripts, we still set visibility=hidden by default and
require compilers to support __attribute__((__visibility__("public"))). So
symbols are correctly exported, but version-information will be lost.
Again, that's an issue of the target architecture and we don't care
whether they lack useful features.

(extended commit-msg and reorder am-conditionals)
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Restructure source tree

Some simple code-moves:
  shl => src/shared/
  tsm => src/tsm/
..and also move the ./docs/ files into the source tree.

This will make the tree much easier to grasp once we add more tools like
gtktsm.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
build: move shl_xy to shl-xy

Same move as with the other TSM files.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
screen: improve aging for sb-reset

If the sb is already NULL, there's no need to increase the age of the
screen. This avoids redrawing the terminal on each keystroke as terminals
usually have to reset sbs then.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
shared: add macro, pty and ring helpers

Few more shl helpers that we later need for TSM examples. Note that
--gc-sections strips them from normal libtsm builds.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Update libtsm wiki-link

We moved libtsm in the fdo-wiki so it's no longer a sub-kmscon project.
Update the links to reflect that.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
gtktsm: add libtsm example

GtkTsmTerminal is a Gtk+-3.0 widget using libtsm. It provides a generic
terminal-widget that can be easily used to create any kinds of
terminal-emulators.

The GtkTsm program is a small example that shows how to use GtkTsm.

Note that all this is optional and only meant as example. Maybe at some
point we will install GtkTsmTerminal as shared object. However, it will
never be mandatory!

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
drop dependency from vte->write_cb needed just for debug purpose
first event callback added
basic cursor movement added
more csi movement and some exec function added
adding movements