in GNU configure and configure.in - the prefix is given to the configure script by the pkgsrc infrastructure, and buildlink will DTRT.