Use faster check
Keep function checks together
Lowercase shell variables
Cleanup sqlite3 check a bit
Remove redundant AC_SUBST

PKG_CHECK_MODULE already sets those
Move define to the right place
Clarify error message
Always check for libsqlite3

It can still be overridden by setting SQLITE3_LIBS
and SQLITE3_CFLAGS
(Finally) move sqlite3 to separate checks
Merge pull request #1989 from rubenk/more-autoconf-stuff

More autoconf stuff