--- src/manpath.c.orig 2005-08-20 16:26:06.000000000 -0700 +++ src/manpath.c 2012-10-17 13:05:56.000000000 -0700 @@ -26,6 +26,10 @@ #include #include #include +#ifdef __APPLE__ +#include +#include +#endif /* __APPLE__ */ /* not always in */ extern char *index(const char *, int); @@ -372,6 +376,25 @@ for (dlp = cfdirlist.nxt; dlp; dlp = dlp->nxt) if (dlp->mandatory) add_to_mandirlist (dlp->mandir, perrs); + +#ifdef __APPLE__ + xcselect_manpaths *xcp; + const char *path; + unsigned i, count; + + // TODO: pass something for sdkname + xcp = xcselect_get_manpaths(NULL); + if (xcp != NULL) { + count = xcselect_manpaths_get_num_paths(xcp); + for (i = 0; i < count; i++) { + path = xcselect_manpaths_get_path(xcp, i); + if (path != NULL) { + add_to_mandirlist((char *)path, perrs); + } + } + xcselect_manpaths_free(xcp); + } +#endif /* __APPLE__ */ } static void