Gem install failure

I'm the package maintainer on Fedora for two projects that include Ruby
gems as part of their output. Previously I would package the Ruby gems
separate from the main project. But recently I've decided to consolidate
everything into a single package to make new releases and updates easier
to create.

However, there's a problem.

The main project produces a set of libraries (libqpidclient.so,
libqpidmessaging.so, etc.) that the gem requires in order to build (it's
a Ruby binding created by Swig with some Ruby code on top of that). The
problem is that, during the packaging process, those libraries and
headers aren't in their system locations. Instead they're in a temporary
directory to be bundled into the RPM file.

I updated the commandline to install the gem as follows:

$ gem install -- --with-qpid-lib=[path to the library files] \
                 --with-include-include=[path to headers]

But this fails, with the output:

...
checking for main() in -lqpidclient... no
Missing required library: qpidclient
*** extconf.rb failed ***

I've verified that libqpidclient.so *does* exist in the directory
specified. When I look into mkmf.log I see this:

"gcc -o conftest -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I. -I/home/mcpierce/Packaging/rpms/BUILDROOT/qpid-cpp-0.32-1.fc23.x86_64/usr/include -fPIC -fno-inline conftest.c -L. -L/usr/lib64 -L/home/mcpierce/Packaging/rpms/BUILDROOT/qpid-cpp-0.32-1.fc23.x86_64/usr/lib64 -L. -Wl,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -m64 -lstdc++ -lstdc++ -lruby -lqpidclient -lstdc++ -lstdc++ -lpthread -ldl -lcrypt -lm -lc"
conftest.c: In function ‘t’:
conftest.c:13:15: error: too few arguments to function ‘main’
int t(void) { main(); return 0; }

The error seems to be that mkmf is created a bad piece of code to test
for the existing of libqpidclient.so; i.e., it's added a line that calls
main(int, char**) by invoking main() and *that* fails to compile.

Is there a way to work around this problem? It's a block for me to
update my packages properly.

···

--
Darryl L. Pierce <mcpierce@gmail.com>
http://mcpierce.blogspot.com/
Famous last words:
   "I wonder what happens if we do it this way?"