FreeBSD requires __BSD_VISIBLE to be set to expose M_PI and mkstemp() in the
system includes. This is normally set when _ANSI_SOURCE, _C99_SOURCE, or
_C11_SOURCE are undefined. I don't want to dig into what the compiler is
setting, so I'm just setting it in the configure script.
/bin/sh ./libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -fPIC -fvisibility=hidden -pedantic -fno-exceptions -D PATH_ESPEAK_DATA=\"/usr/local/share/espeak-ng-data\" -DLIBESPEAK_NG_EXPORT -Isrc/include -Isrc/include/compat -I src/ucd-tools/src/include -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200112L -Wno-endif-labels -g -O2 -std=c99 -MT src/libespeak-ng/src_libespeak_ng_la-wavegen.lo -MD -MP -MF src/libespeak-ng/.deps/src_libespeak_ng_la-wavegen.Tpo -c -o src/libespeak-ng/src_libespeak_ng_la-wavegen.lo `test -f 'src/libespeak-ng/wavegen.c' || echo './'`src/libespeak-ng/wavegen.c
libtool: compile: cc -DHAVE_CONFIG_H -I. -fPIC -fvisibility=hidden -pedantic -fno-exceptions -D PATH_ESPEAK_DATA=\"/usr/local/share/espeak-ng-data\" -DLIBESPEAK_NG_EXPORT -Isrc/include -Isrc/include/compat -I src/ucd-tools/src/include -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200112L -Wno-endif-labels -g -O2 -std=c99 -MT src/libespeak-ng/src_libespeak_ng_la-wavegen.lo -MD -MP -MF src/libespeak-ng/.deps/src_libespeak_ng_la-wavegen.Tpo -c src/libespeak-ng/wavegen.c -fPIC -DPIC -o src/libespeak-ng/.libs/src_libespeak_ng_la-wavegen.o
src/libespeak-ng/wavegen.c:355:24: error: use of undeclared identifier 'M_PI'
x = 127*(1.0 - cos((M_PI*2)*ix/wavemult_max));
^
src/libespeak-ng/wavegen.c:623:16: error: use of undeclared identifier 'M_PI'
minus_pi_t = -M_PI / samplerate;
^
2 errors generated.
gmake[1]: *** [Makefile:1690: src/libespeak-ng/src_libespeak_ng_la-wavegen.lo] Error 1
Fix running 'make clean' when gradle is not present. Gradle is used for the Android build and is not needed when just building eSpeak NG on Linux/BSD systems.