Jan 2004

Porting UNIX Programs to Mac OS X

This is a short list of problems that I frequently encountered when porting applications to Mac OS X. As any veteran Linux hacker will predict, most of them involve libtool :-)

libtool problems

  • Can’t dlopen/dlsym a file properly? Make sure that you have -module parameter in the plugin’s plugin_LDFLAGS entry in its Makefile.am.
  • libtool doesn’t write the proper information to its .la files if you compile a library as --enable-static --disable-shared. You’ll have to edit the .la file and change the library_names parameter there to be libname.a.

C++ problems

  • g++’s support for templates is pretty good now, but if you’re having problems, have a look at GCC’s documentation on templates. In particular, note the -frepo flag: using that solved a few template problems for me.
Comments