Re: [greenstone-users] Compiling 2.40 on MacOSX?

From John R. McPherson
DateMon, 14 Jul 2003 12:21:13 +1200
Subject Re: [greenstone-users] Compiling 2.40 on MacOSX?
In-Reply-To (7364B391-AD1C-11D7-AE1B-000393824E52-mit-edu)
Carl Jones wrote:
> Hi,
> Has anyone successfully compiled the latest release on MacOSX 10.2.*?
> I'm getting the following error:
> ../../packages/mg/lib/getopt.h:105: declaration of C function `int
> getopt()'
> conflicts with
> /usr/include/unistd.h:142: previous declaration `int getopt(int, char*
> const*,
> const char*)' here
> make[1]: *** [phindaction.o] Error 1

I can't figure out where the headers have changed between gsdl 2.39
and gsdl 2.40, but I get this as well. The solution is to edit
the file gsdl/src/gsdl/packages/mg/sysfuncs.h and at about line 283
or so, remove the line that says
#include <getopt.h>
The problem is that mg was written quite a while ago and does a lot
of portability stuff itself, but since it was written a lot of the
stuff it does is now in all the main c libraries anyway, so its own
stuff is conflicting with system libraries and headers.

That was the only change I needed to compile on os x 10.2.4.

Anyway, after finding out from the other developers what's in
gsdl 2.40 that isn't in gsdl 2.39, I'll see about updating the Mac
binary in the next few days.

John McPherson