./configure can't find C compiler after OS X Lion installation

前端 未结 6 2180
终归单人心
终归单人心 2021-02-05 19:12

While cc and gcc are perfectly in their right path (/Developer/usr/bin in OS X Lion), running ./configure tries to compile it

6条回答
  •  孤街浪徒
    2021-02-05 19:22

    I recently installed OSX Mavericks and wanted to upgrade to php 5.5.5 and faced a similar issue

    [user@host /path/to/php5.5.5_src]$ ./configure
    checking for cc... cc
    checking whether the C compiler works... no
    

    Looking at my include path, I noticed that only de base Xcode path was added (I have Xcode 5)

    [user@host ~]$ cat /etc/paths
    /usr/bin
    /Applications/Xcode.app/Contents/Developer/usr/bin
    /bin
    ...
    

    All I needed to do is add the path to the Toolchains

    [user@host ~]$ sudo vi /etc/paths
    /usr/bin
    /Applications/Xcode.app/Contents/Developer/usr/bin
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
    /bin
    ...
    

    And voilà, it found it.

    [user@host /path/to/php5.5.5_src]$ ./configure
    checking for cc... cc
    checking whether the C compiler works... yes
    

    Hope this helps.

提交回复
热议问题