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

2

0

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.

Matias answered 21/1, 2012 at 20:18 Comment(0)
W
0

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.

Woodring answered 22/1, 2012 at 2:35 Comment(1)
Ruby 1.9.3-p125 fixed LLVM/clang support.Knotgrass
W
0

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
Weathercock answered 25/1, 2012 at 10:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.