GIMP for Mac

Building a static version of a plugin

Installation and Mac OS specific issues.

Building a static version of a plugin

Postby Dominus » Mon Dec 07, 2009 11:25 pm

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
Members don't see the above ad. Register now - it's free!
Dominus
Newbie
 
Posts: 5
Joined: Mon Dec 07, 2009 11:03 pm

Re: Building a static version of a plugin

Postby lisanet » Tue Dec 08, 2009 10:15 pm

AFAIK, for statically linking a library, you need to add the '-static' option to your linking command.

Code: Select all
gcc foo.c -o foo -lbar


should link libbar.dylib dynamically to the foo executable, whereas

Code: Select all
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
Enjoy GIMP on your Mac ...

... GIMP on OS X - http://gimp.lisanet.de
lisanet
Full Member
 
Posts: 221
Joined: Mon Sep 15, 2008 10:56 am

Re: Building a static version of a plugin

Postby Dominus » Wed Dec 09, 2009 10:15 am

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 :)
Dominus
Newbie
 
Posts: 5
Joined: Mon Dec 07, 2009 11:03 pm


Return to GIMP for Mac

cron

Who is online

Users browsing this forum: No registered users and 5 guests