Re: Fw: compile problems in mac os x

From John R. McPherson
DateWed, 05 Feb 2003 10:08:17 +1300
Subject Re: Fw: compile problems in mac os x
In-Reply-To (00c401c2cb3a$2c99e4e0$0200a8c0-lomu)
----- Original Message -----
> From: "Philip Sturman"
> To: <greenstone@cs.waikato.ac.nz>
> Sent: Monday, February 03, 2003 1:02 PM
> Subject: compile problems in mac os x

> Hi
>
> I'm having trouble compiling Greenstone under Mac OS X (10.2.3).
>
> I've removed the #prada lines from the pdftohtml packages because of bug
631593.
> 'configure' completes without any problems, but the following error shows
up during 'make':
>
> --------------------------------------------------
>
> c++ -c -g -O2 -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM -DHAVE_CONFIG_H
> -I../../lib -I. -I../colservr -I../../packages/mg -I../../packages/mg/lib
> -I../../packages/mg/src/text -I../mgpp/lib -I../mgpp/text -I../..
> phindaction.cpp
> In file included from ../../packages/mg/sysfuncs.h:282,
> from ../../packages/mg/lib/huffman.h:27,
> from ../mgpp/text/text.h:36,
> from ../mgpp/text/TextGet.h:25,
> from phindaction.h:34,
> from phindaction.cpp:32:
> ../../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
> make: *** [all] Error 1
> -----------------------------------------------------

Hi,
(cc'd to the greenstone list)

we currently only have access to a Mac OS X 10.1 box, so haven't
encountered this before. The problem is that mg is fairly old - when
it was written many systems didn't have complete C standard functions
so mg includes it own versions of these. However, our build process
should detect this...
Greenstone 2.39 (due out soon) will be tested on OS X 10.2.

Anyway, since your system has a perfectly functional getopt() function
installed, you could just try moving the mg one out of the way, by
renaming or deleting the file gsdl/packages/mg/lib/getopt.h.
Hopefully everything should compile smoothly after that.

John McPherson