According to the output of './configure --help |grep -i post' in the php 4.0.5 directory:
--with-pgsql[=DIR] Include PostgreSQL support. DIR is the PostgreSQL
So, I'm not sure where =shared came from, but it's never been an option I know of for postgresql under php.