Crafty build bug on Mac OS X

Discussion of chess software programming and technical issues.

Moderator: Ras

micron
Posts: 155
Joined: Mon Feb 15, 2010 9:33 am
Location: New Zealand

Crafty build bug on Mac OS X

Post by micron »

Out of the box, crafty-23.4 won't compile on OS X.

$ make darwin
make target=FreeBSD \
CC=gcc CXX=g++ \
CFLAGS='-Wall -pipe -O3' \
CXFLAGS='-Wall -pipe -O3' \
LDFLAGS= \
LIBS='-lstdc++' \
opt='' \
crafty-make
gcc -Wall -pipe -O3 -DFreeBSD -c crafty.c
In file included from search.c:1,
from crafty.c:13:
chess.h:28:22: error: malloc.h: No such file or directory

The offending code in chess.h is:

Code: Select all

#if !defined(IPHONE)
#  include <malloc.h>
#endif
The IPHONE macro is used in several other places in the source, but is undocumented and hence of obscure meaning. An iPhone is a kind of Mac, but a desktop Mac is not an iPhone.

This fix allows the build to succeed whether or not IPHONE is defined.

Code: Select all

#if !defined(__APPLE__)
#  include <malloc.h>
#endif
Robert P.