We were building psqlodbc-09.03.0300 on OS X with configure options as "--disable-dependency-tracking --with-iodbc --with-libpq=<PG_INSTALL_PATH> --prefix=<INSTALL_PATH>
" and found that libpq was being linked from /usr/lib and not from the $PG_INSTALL_PATH.. May be because the system iodbc-config returns:
$ iodbc-config --libs
-L/usr/lib -liodbc -liodbcinst"
To make sure it picks the libpq from the Server installation that we built, I had to patch configure script: