Why does WD ship the source for samba-4.0.0 in the packages folder. But when you do the ./build-arm-packages.sh giving samba-4.0.0. the script actually does a apt install the samba source? The source is in the packages folder. Now that wheezy is no longer supported it has been moved to the archive site. Unless I have the wrong sources.list entries samba-4.0.0 can no longer be downloaded using apt.
PS WD moved up to samba-4.3.11 in one of the latest firmware updates. But they still ship samba-4.0.0 in the source for that firmware release.