Handle the case where an element of SRCDIRS or DEPDIRS is a symlink.