0

After reinstalling Lion, port install produces:

Warning: xcodebuild exists but failed to execute
Error: Unable to open port: can't read "build.pre_args": 
can't read "build.cmd": Failed to locate 'gnumake' in path:     
'/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin' 
or at its MacPorts configuration time location, did you move it?

and yet Xcode is just where it was:

> which gnumake
/Developer4/usr/bin/gnumake

How can I avoid wiping out /opt and instead point MacPorts to build.pre_args, build.cmd, and gnumake?

  • 2
    Did you reinstall Xcode or is this the remnant installation from before? The installation process is what adds it to the system path. This is necessary for 'port' to find the toolchain. – EmmEff Feb 20 '12 at 13:42
  • I was settling for the remnant installation of all applications, including Xcode. But you're right. After rerunning "Install Xcode.app" gnumake reappeared in /usr/bin, and now port install runs as expected. – Calaf Feb 20 '12 at 15:48
  • 1
    @EmmEff: Your comment is the right answer. Could you make it an answer so I can mark it as such to help those using this forum as a reference? – Calaf Mar 9 '12 at 17:07
2

Did you reinstall Xcode or is this the remnant installation from before? The installation process is what adds it to the system path. This is necessary for 'port' to find the toolchain.

0

Funny; I have gnumake in /usr/bin. You could add /Developer4/usr/bin to your path, for example by running

echo /Developer4/usr/bin > /etc/paths.d/developer

(the change will take effect in your next terminal session, I believe).

Beware, though, that the latest Xcode (4.3) requires an extra step to get command-line tools.

  • Looking for gnumake in /usr/bin is a nice suggestion, though I don't understand why Lion+Xcode (and not MacPorts) keep two copies of gnumake. In any case, reinstalling Xcode (as I mention in the comment above) solves the problem. – Calaf Feb 20 '12 at 15:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .