[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: trouble compiling JoCaml under Linux



Hi,

I've fixed the problem (at least for the Suse 7.3 i386 platform).
The real problem had indeed nothing to do with the pervasives.ml file, I'v missed
an earlier compiler message :

gcc -g -I../../camlrun -O -fno-defer-pop -Wall   -c -o accept.o accept.c
In file included from /usr/include/sys/un.h:24,
                 from socketaddr.h:18,
                 from accept.c:22:
/usr/include/string.h:243: parse error before `('
/usr/include/string.h:243: conflicting types for `memmove'
/usr/include/string.h:42: previous declaration of `memmove'
/usr/include/string.h:243: parse error before `__const'
make[1]: *** [accept.o] Error 1

This is a config problem.
- the configure generated config/s.h file contains the two following directives :
#define HAS_BCOPY,
    and #define HAS_MEMMOVE

- the header file camlrun/config.h contains
#ifdef HAS_MEMMOVE
#undef bcopy
#define bcopy(src,dst,len) memmove((dst), (src), (len))
#else
#ifdef HAS_BCOPY
/* Nothing to do */
#else
#undef bcopy
#define bcopy(src,dst,len) memmov((dst), (src), (len))
#define USING_MEMMOV
#endif
#endif

And that is not compatible with using both GNU and BSD functions delcarations from
my string.h header file (as part of a standard GNU C Library).
The way I solved the problem is very simple : just remove the #define HAS_MEMMOVE
from the config/s.h file.

This trick worked also on the second platform (Mandrake 8.2 PPC), but a second
problem have appeared :
I could not compile all the files from the tools repository. But fortunately it is
sufficicent to run mobile ambients.

Franck