Compile does not need WeeChat sources, only file "weechat-plugin.h".
weechat-plugin.h
To compile a plugin which has one file "toto.c" (under GNU/Linux):
$ gcc -fPIC -Wall -c toto.c $ gcc -shared -fPIC -o libtoto.so toto.o
$
gcc -fPIC -Wall -c toto.c
gcc -shared -fPIC -o libtoto.so toto.o