Xcode Error – How to Fix ‘configure: error: could not make ./config.status’

command lineerrorterminalxcode

Facing a strange build error on OSX 10.12. Unable to build any software at the command line. For example none of the packages Opus, PJSIP, and LibreSSL will build. (Dependencies for Telephone: https://github.com/eofster/Telephone) All the configure steps exit with the same error.

configure: creating ./config.status
configure: error: could not make ./config.status

Xcode 8.1 is installed with command line tools.

$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.1.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

I reinstalled command line tools once already.

A few days ago I was trying to build Jekyll and that too failed with the same error. I gave up at the time thinking it was some Jekyll related error.

Any pointers will help.

Best Answer

So finally it works, but I can't say it's solved because I don't have the exact cause of the problem. It turns out that this could be a PATH related issue. I came across this post that mentions the possibility of a PATH causing problems. Though I could see nothing related to ruby or java or python on my PATH, I had previously played around with rbenv, jenv, and pyenv. The only thing I currently had was npm-packages on my PATH. So I just commented out everything related to PATH on my ~/.bash_profile and tried the configure again, and voila!, it works! The config.status file is created, configure --help also displays the help info, etc. I've yet to figure out what was the offending segment on my PATH. But for the moment, I'm happy that I'm able to start building at the command line again! Hope this helps someone facing similar problems in the future.