build: move doc build check to build/autotools/m4/