dynamically alloc internal buffers
fix newlines
autotoolized