build eclipse prolog for 64-bit mac osx

May 18, 2010 23:28

I will probably not need to ever remember this because I don't ever plan on building eclipse prolog again, but in case I do, here are my notes about how to do it on osx 10.5. Their documentation had some gaps and I filled them in in ways that worked for me.

In a directory parallel to the Eclipse sources named "eclipsethirdparty", create directories for the 3rd-party programs (gmp, graphviz, mysql, tcl/tk). In each, make a directory "i386_macosx" and a symlink named "x86_64_macosx" pointing into i386_macosx. Then create subdirectories for bin, etc, include, lib, libexec, share, or whatever that program's going to need (for example, gmp only needs header files in include and dylibs in lib, but graphviz has binaries stuff in share, and mysql has stuff everywhere. Then, either symlink or copy the files from the 3rd-parties into the tree (gross). At this point we're ready to build eclipse itself.

Build it for i386_macosx first; it should build without too many problems. Then start cheating to build it as 64-bit so you can use it with 64-bit Java. Use the following flags with the i386_macosx makefile:
CFLAGS=" -arch x86_64" CXXFLAGS=" -arch x86_64" LDFLAGS=" -arch x86_64" make -f Makefile.i386_macosx

When the make fails in make_kernel because ../../sys_lib/i386_macosx/libshm.a is the wrong arch (duh, of course it is...we're cheating), specify the correct arch manually:
cd Kernel/i386_macosx && gcc -arch x86_64 -02 -fomit-frame-pointer -s main.o libeclipse.a whereami.o -L../../sys_lib/i386_macosx -L. libdummies.a -lshm -L. -ldl -lm -o sepia

After that, my notes say that the make will fail again; they also say to just patch the makefile to add " -arch x86_64" to the LDFLAGS and it will work.
Now you have eclipse prolog built for 64-bit mac os x. If you want, you can play with lipo to make universal binaries, but I was way too lazy. I did this months ago and haven't checked it in a long time so who knows if there is a better way.

code, work

Previous post
Up