We had a contributor to libguestfs who is trying to get it to compile on Mac OS X.
One problem is that gnulib's error module requires program_name to be defined on Mac OS X, although not on Linux. The reason is that gnulib doesn't know how to access argv[0] on that platform, so instead it relies on every gnulib-using program to define that symbol. This is a problem for libguestfs since the main program is only an indirect user of gnulib. After some experimentation she came up with the attached patch, which she has tested, and which allows argv[0] to be found by calling a function `_NSGetArgv' (which of course only exists on OS X). I hope this patch, or something similar, can be considered for inclusion in gnulib to help us with the port to OS X. Rich.