OSX Build/Fink
From K-3D
Build Overview
- K-3D version: 0.4
- Build environment: Fink
- Runtime environment: Mac OS X
- Pros
- Cons
- Known Issues
- multiple def errors when linking
- module loading fails after loading the first module?
Challenges
The main challenges for this build are
- Obtaining the correct tools and environment.
Build Instructions
Get cvs or update from cvs (0.4 tree).
On mac, libtool is an Apple-provided tool so GNU's libtool scripts are renamed as glibtool and glibtoolize. So first you have to edit ./bootstrap and change the line that says
libtoolize --force --automake
by
glibtoolize --force --automake
Then run ./bootstrap, make sure you don't get any errors. then run ./configure, this is what i put in my configure:
./configure --prefix=/sw/k3d CPPFLAGS=-I/sw/include LDFLAGS=-L/sw/lib --without-docbook
and so on (known to work with libtool version 1.5).
as long as configure finds everything make should proceed without any problems.
Multiple definition errors usually occur when linking with k3dsdk. If you get errors edit the makefile. Remove this from libk3dsdk_la_LDADD,"$(top_builddir)/boost/libs/filesystem/src/libfilesystempp.la". Re-make k3dsdk. If make doesn't rebuild the lib, remove libk3dsdk.la from its directory.Then make should continue.
Getting modules to load
(Temporary solution)
In order to get modules to load they have to be relinked with the -bundle command instead of -dynamiclib.To do this we have to edit libtool in the k3d folder. Open libtool in your text editor of choice(preferably one that doesn't change the line encodings, like bbedit). Search for "dynamiclib", we want to go the third one we find, you'll see a line like this:
archive_cmds="\$CC -dynamiclib -single_module \$allow_undefined_flag -o \$lib...
A couple of lines down you'll see "module_cmds=" which is what we have to use on the modules. Go ahead and comment out the "archive_cmds" by adding a "#" at the beginning of it and hit return to add a space. Type in "archive_cmds=" and copy the commands from "module_cmds" to this new line. This way we have two "archive_cmds" and we can switch between them if needed. Then go ahead and save. Now in terminal, cd to the modules directory and make install( assuming you have already installed k3d), if not just type make. If the modules don't relink, then remove the .la files from the folders, except the surface_polygonizer_library folder, this one has to remain linked with -dynamiclib. And that should be it for now. This works for both 0.4/0.5.
TODO
- Create a binary installer.
Links
- The GTK-OSX project.

