Problems with compiling apache2 on Mac OS X Mountain Lion

后端 未结 10 1814
借酒劲吻你
借酒劲吻你 2020-12-23 21:34

While trying to compile the latest version of the apache web server(2.4.3) on my Mac (10.8) I run into a problem. When I run the ./configure command I got the following outp

相关标签:
10条回答
  • 2020-12-23 22:31

    I just recently updated to Mavericks and was re-creating my web development environment (including installing port). I had this problem when I was upgrading port:

    checking whether the C compiler works... no
    

    I thought I had everything setup, including installing XCode from the App Store. But kept having issues. I was able to fix it by actually running XCode once, accepting the license agreement, and letting XCode startup fully. The next time I tried to upgrade port I did not get the error above.

    0 讨论(0)
  • 2020-12-23 22:32

    I was just struggling with a similar issue in this post I created and answered so I thought I would share my findings. Simply create the symlink by doing this:

    # Create a symlink to default Xcode toolchain for OS X lion
    sudo ln -s \
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain \
    /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain
    
    # Create a symlink to default Xcode toolchain for OS X maverick
    sudo ln -s \
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain \
    /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain
    

    and you should at least get to the next step.

    0 讨论(0)
  • 2020-12-23 22:34

    I'm on OSX Mavericks and was trying to compile Apache 2.2.24 and ran into this error. I saw from other answers that the problem was with apxr and thus APR returning the wrong location for gcc. Apple supplies this and the Apache config was using the Apple supplied one.

    On a whim, I looked and saw that the configure script has an option to ignore the system supplied APRs and use its own.

    So I did this:

    ./configure --with-included-apr
    

    And it got past the configure step and compiled without errors.

    0 讨论(0)
  • 2020-12-23 22:35

    @AlphaZygma this worked great for me. I'm on 10.8.5 and had to add the following to /etc/paths:

    /Applications/Xcode.app/Contents/Developer/usr/bin
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
    

    instead of yours.

    0 讨论(0)
提交回复
热议问题