Building a static version of a plugin

Discussion in 'GIMP for Mac' started by Dominus, Dec 7, 2009.

  1. Dominus

    Dominus New Member

    Joined:
    Dec 7, 2009
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Hi,
    first off, thanks for the instructions in here on how to build/install a plugin. With those I was able to successfully build our plugin:

    I'm part of the Exult team (http://exult.sf.net) and we have a little plugin that loads and saves the Ultima 7 graphics file format shp. Our code is at http://exult.svn.sourceforge.net/viewvc ... it/u7shp.c
    When enabling building the plugin in ./configure of Exult, it gets built without a problem on make and it works in The Gimp.
    I found that I didn't even need the makefile after all, just a "gimptool-2.0 --build u7shp.c" worked fine as well.

    Now that I managed to build the plugin, I wonder if I can build the plugin statically so I can get rid of all the stuff that got installed by MacPorts to install The Gimp. Right now I see in the compiled plugin that it points to various gimp dynamic libs in /opt/local/libs, for example opt/local/lib/libgimpui-2.0.0.dylib
  2. lisanet

    lisanet Member

    Joined:
    Sep 15, 2008
    Messages:
    221
    Likes Received:
    0
    Trophy Points:
    16
    AFAIK, for statically linking a library, you need to add the '-static' option to your linking command.

    Code:
    gcc foo.c -o foo -lbar
    should link libbar.dylib dynamically to the foo executable, whereas

    Code:
    gcc -static foo.c -o foo -lbar
    should use libbar.a and link that statically to the foo executable. AFAIK, gimptool-2.0 doesn't recognize the '-static' option. You need to write a Makefile.

    -skl
  3. Dominus

    Dominus New Member

    Joined:
    Dec 7, 2009
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Ok, thanks. I'll try to see with what I can come up. Unfortunately our makefile seems to be just using gimptool itself :(
    I'll post again if I get somewhere :)

Share This Page