Remove unused/obsolete macros.
Remove unused includes.
Fix file stream leak.
Minor fix.
Abandon incorrect usage of AM_CPPFLAGS.
Remove unneded AC_SUBSTs.
Don't payload dependencies onto CFLAGS/LIBS.
Add check for sed.
Don't build documentation by default.
Don't overwrite CFLAGS.
Fix compiler optimization logic.
Simplify debug logic.
Simplify trace logic.
Don't use CFLAGS for debug/trace defines.
Fix missing types and prototypes.

Also check for getline() and fileno().
Fix non-comformant forward declaration.
Fix "rest arguments to be used" C99 warning.
Fix "rest arguments to be used" C99 warning.
Fix a few cast warnings.
Fix C99 function to pointer conversion warning.

Let's use this method until glib's g_signal_handlers_disconnect*()
compliance with C99 is fixed.