autoconf-2.64 compat: Don't use $(builddir) or $(abs_top_builddir)

$(builddir) is not a standard automake variable. With autoconf < 2.64
it ends up getting set in every Makefile.in to '.' (because autoconf
defines it), but that is no longer the case for 2.64.

Since $(builddir) was always '.', just use that instead.

The $(abs_top_srcdir) $(abs_top_builddir) variables are also artifacts
of old autoconf rather than something intentional in automake. To
stop using those:

 - Set the paths in TESTS_ENVIRONMENT to just be relative to
   the top build directory - we never change from there when
   running tests.
 - Make gjs-unit determine the paths to various directories by
   determining them relative to the binary.

http://bugzilla.gnome.org/show_bug.cgi?id=591897
Fix the determination of top_builddir

g_path_get_basename() was used not g_path_get_dirname(); not sure how
this passed my earlier testing.
Fix gjs_crash_after_timeout() problems

Fix two major issues with gjs_crash_after_timeout():

 * It didn't notice the parent exiting normally so the forked off
   child would keep running until the timeout. This is fixed by
   using a pipe between the parent and child and watching for the
   pipe to get immediate notification of parent exit.

 * The forked off child process would return to the caller of
   gjs_crash_after_timeout() after the timeout completed and it
   killed the parent this would typically fail horribly. Call exit()
   instead.

http://bugzilla.gnome.org/show_bug.cgi?id=592962
Post-release version bump to 0.5
when dbus_connection_send_with_reply() fails, print connection and pending call status

Otherwise the exception is a little bit opaque. Well, it is
a little bit opaque anyway, but maybe this helps somewhat.
kill "Loading tweener" log messages

https://bugzilla.gnome.org/show_bug.cgi?id=595946
Add Lang.seal() to make an object read-only.

This is useful for defining scoped constant enumerations, for example:

const Color = Lang.seal({ RED: 0, GREEN: 1, BLUE: 2 })

https://bugzilla.gnome.org/show_bug.cgi?id=593320
Generate full stack trace in gjs_move_exception.

This ensures that import errors get reasonable stack traces, since they are
usually generated originally in the (empty) loading_context, and then moved
to the context which triggered the import.

https://bugzilla.gnome.org/show_bug.cgi?id=596670
Remove more debugging log() statements

https://bugzilla.gnome.org/show_bug.cgi?id=599930
Support for callback functions

https://bugzilla.gnome.org/show_bug.cgi?id=563025
Just add a comment instead of a warning
Add a few comments explaining the tricky parts
Fix a bunch of compiler warnings

Also use prepend instead of append and use GSList in
all places as we never need a double linked list.
Rename the ffi closure function names
Allow null/undefined to be passed in to callbacks

Some functions do not require a callback to be passed in,
instead NULL is accepted, the same should be supported in gjs
by allowing null/undefined.

https://bugzilla.gnome.org/show_bug.cgi?id=603735
Make things build with glib 2.16
Enable JIT if we can, by default

Setting the GJS_DISABLE_JIT environemnt variable will disable JIT always
Allow any basic type to be used as the key in a dbus dict

https://bugzilla.gnome.org/show_bug.cgi?id=604023
Enable threading by default

There's no simple way to enable threading in a gjs application,
apart from creating an external module which does it for you.
As most applications require threads these days it makes sense
to enable it by default. g_type_init() will soon enable thread
initializating per default as well.

https://bugzilla.gnome.org/show_bug.cgi?id=604162
Bug 584558 – Need print() function

Add print() and printerr() functions.

Signed-off-by: David Zeuthen <davidz@redhat.com>
Reviewed-by: Colin Walters <walters@verbum.org>