[Rubygems-developers] Passing LDFLAGS?

Austin Ziegler halostatue at gmail.com
Wed Jan 23 08:39:23 EST 2008

I'm trying to install the FXRuby RubyGem while using Fox installed in
/opt/local via MacPorts and the Leopard-default Ruby. I'm passing the

sudo env CPPFLAGS="-I/opt/local/include" ARCHFLAGS="-arch i386" \
         LDFLAGS="-L/opt/local/lib" gem install fxruby

CPPFLAGS is sent across just fine:

g++ -I. -I. \
        -I/System/Library/Frameworks/Ruby.framework/[...] -I. \
        -I/usr/local/include/fxscintilla -I/usr/local/include/fox-1.6 \
        -I/opt/local/include/fox-1.6 -I/opt/local/include/fxscintilla \
        -fno-common -arch i386 -Os -pipe -fno-common -O0 -Iinclude \
        -DWITH_FXSCINTILLA -DHAVE_FOX_1_6   -c \

But LDFLAGS isn't being respected at all:

cc -arch i386 -pipe -bundle -o fox16.bundle librb.o core_wrap.o \
       dc_wrap.o dialogs_wrap.o frames_wrap.o fx3d_wrap.o FXRbApp.o \
       FXRbDataTarget.o FXRbGLViewer.o FXRuby.o iconlist_wrap.o \
       icons_wrap.o image_wrap.o impl.o label_wrap.o layout_wrap.o \
       list_wrap.o markfuncs.o mdi_wrap.o menu_wrap.o scintilla_wrap.o \
       table_wrap.o text_wrap.o treelist_wrap.o ui_wrap.o \
       unregisterOwnedObjects.o -L"." \
       -L"/System/Library/Frameworks/Ruby.framework/[...]" \
       -L"/usr/local/lib" -L"/usr/X11R6/lib" -L. -arch i386    -lruby \
       -lfxscintilla -lFOX-1.6 -lGLU -lX11 -lXext -lz -lstdc++ \
       -lpthread -ldl -lm

which results in:

    ld: library not found for -lfxscintilla
    collect2: ld returned 1 exit status
    make: *** [fox16.bundle] Error 1

(I have to do "-arch i386" because at least one of the dep libraries in
MacPorts won't build universal, which means that Fox won't build
universal. As soon as I have time, I'll be taking that up with them,
hopefully with a fix.)

Why isn't LDFLAGS being passed along to make in the Gem?

Austin Ziegler * halostatue at gmail.com * http://www.halostatue.ca/
               * austin at halostatue.ca * http://www.halostatue.ca/feed/
               * austin at zieglers.ca

More information about the Rubygems-developers mailing list