Need to link against dep/lib to check for function in it. Also misc fixes to surrounding xi-related checks.