Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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?

share|improve this question
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 Answers 2

up vote 2 down vote accepted

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.

share|improve this answer

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.

share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.