Building Ruby 1.9.3 on Lion with Xcode 4.2 using ./configure --with-gcc=clang

元气小坏坏 提交于 2019-12-23 05:19:08

问题


My environment: Mac OS X v10.7.2 with Xcode 4.2.1

I am trying to build ruby 1.9.3 on Lion with Xcode 4.2.1. I understand there's an issue with the llvm-based gcc compiler that comes with Xcode 4.2.1. But I'm trying to work around it by following these instructions, http://goo.gl/Sc39g. I was able to get a little farther along, but then ran into these 2 problems:

  1. #error Please add -D_FILE_OFFSET_BITS=64 to your compile flags!
  2. fatal error: 'sys/statfs.h' file not found

The complete configure output is here: http://cl.ly/2q2G3p3r3S133i0U1i1e (the errors are all the way in the bottom)

Please advise. Thanks in advance.

P.S. I've read the list of similar/related questions, but none seem to address these 2 particular errors, or I missed them as my eyes are starting to glaze over from all the things I've tried to get this build to work. If this question has already been answered, please point me to the answer, and accept my apologies for the duplication.


回答1:


Have you tried to add the flag?

$ make clean
$ ./configure --with-gcc=clang --prefix=$HOME/.rbenv/versions/1.9.2-p290 CFLAGS=-D_FILE_OFFSET_BITS=64

Did you install macfuse? If yes is this thread useful?

Or if you don't mind installing gcc and brew, you should have more luck compiling ruby with rbenv or rvm. This article show you how to install 1.9.3 with gcc and rbenv.




回答2:


clang will probably break your gems down the line. Try with gcc like so:

$ CC=/usr/bin/gcc-4.2 rbenv install 1.9.3-p0


来源:https://stackoverflow.com/questions/8956320/building-ruby-1-9-3-on-lion-with-xcode-4-2-using-configure-with-gcc-clang

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!