integrate with autoconf; bugfix & improvement