Update to upstream r7706

Also updates the syntax of autotools files and fix CMake compilation.