Gem does not build under JRuby on OS X 10.7.3 with Xcode 4.3.1 and updated CLI tools

Issue #115 invalid
Ryan Payne created an issue

It appears that the gem does not want to build correctly using JRuby 1.6.7 on OS X 10.7.3 with the latest Xcode 4.3.1 and command line tools installed.

Looking at the output in mkmf.log, there appears to be a few things going on here.

  1. Clang is now the default compiler

  2. The clang compiler is throwing out an error because PQconnectdb is defined as having one argument, however the call in conftest.c is calling a no argument method:

conftest.c:5:23: error: too few arguments to function call, expected 1, have 0
int t() { PQconnectdb(); return 0; }
~~~ ^
/usr/include/libpq-fe.h:234:1: note: 'PQconnectdb' declared here
extern PGconn PQconnectdb(const char conninfo);

  1. It appears that clang is having issues with finding the JavaVM framework (however I think is an issue to be filed with JRuby, and not a pg gem issue).

I was able to compile and install the gem by setting the CC environment variable to "gcc" and the installing the gem.

Comments (1)

  1. Michael Granger repo owner

    So what are you reporting as the error?

    JRuby isn't an officially-supported platform; I don't test on it, or even have it installed. I'd gladly accept patches that makes pg compile or work better under any alternative interpreter (provided of course that it doesn't cause breakage under the MRI), but I don't have time to maintain or test it under anything else.

    I don't think clang is an issue -- it compiles and installs fine under Clang-compiled MRI 1.8.7 and 1.9.3 on my MacOS X box.

    Errors in the extconf output aren't necessarily indicative of a problem; mkmf doesn't know what the method signature is when you say have_func, so it has to check for it using several strategies, and some of those error under different compiler/linker combinations.

  2. Log in to comment