Well, to sum it up… this has been a “pain in the ass” for me. The last few days I have had some trouble running OS X 10.8 (Mountain Lion) preview… which is not that weird since it is a developers preview. The main problem was that MacPorts didn’t work since 10.8 uses Darwin 12 and Lion (with MacPorts 2 installation) uses Darwin 11.
So, I managed to screw things up so badly that I spend whole yesterday evening copying files manually to a USB drive using the “Install Disk” for Lion. Now I formatted my MacBook Air and Mac Mini and installed Lion once again.
However, now I got other problems. The problem I got is “error: C compiler cannot create executables” meaning that the C compiler is not valid (as I understand it). After searching and searching I noticed that this is due to the fact that XCode 4.3 doesn’t install the comand line tools anymore by default. So to solve this, I went to the preferences of Xcode and chose the “Downloads” tab. There I chose to install “Command line tools”, and after installing it MacPorts worked like a charm.
So, if you have any problems using MacPorts on Lion with XCode 4.3(+?) than make sure to install Command Line Tools! Also described in section 18.104.22.168 in the manual http://guide.macports.org/chunked/installing.xcode.html