I did an emerge --pretend postgresql and it listed that it needed to emerge blackdown, and ant, then postgresql I ran emerge postgresql, and walked away for a bit. When I came back, it was waiting at the checking to see if ant works stage. I switched to a different console, and ran /usr/bin/ant I reported an error about java not being setup right, but it didnt drop me back to my prompt, I needed to hit ctrl-c to get back. This is the stage that was hanging in the ./configure for postgresql. To Fix it I needed to properly set my java-config --set-system-vm to blackdown, then re emerge ant. After I did that it worked fine. It looks to me that the compile of ant may be returning a 0 instead of a error code if it's compile doesnt work because since my java was not set properly, it should have errored out at that stage.
This is a known issue. Fix will be implemented shortly. Hang in there.
I have fixed this for blackdown-jdk-1.3.1-r7 and kaffe-1.0.7_rc1, by creating an eclass that fixes most of the trivial details. If you have the time to handle blackdown-jre, sun-{jdk,jre}, ibm-{jdk,jre}, that'd be grand!
FYI - If you take java out of your use statement it should work. You only need to set up java first if you requested java support, or use "-java".
i think this has already been fixed.