apenwarr-redo/docs/cookbook/c/rc/posix.rc.od
Avery Pennarun 328d4ead7a Fix some build problems on MacOS X.
- Linking shared libraries needs slightly different options.

- We were trying to detect mach_time.h but needed to detect
  mach/mach_time.h instead.

While we're here, add a --disable-shared option to ./configure, which
is different from --enable-static.  --disable-shared does not build
*new* share libraries, but doesn't pass -static to the linker
(apparently there is no static linking posible on MacOS).
2019-02-24 22:29:19 -05:00

20 lines
297 B
Text

. ./redoconf.rc
rc_include rc/CC.rc
prog='
#include <time.h>
struct timespec x;
'
x=
rc_replaceln HAVE_POSIX 1
if ! rc_compile cc link "$prog"; then
x="-D_XOPEN_SOURCE=500"
rc_appendln CPPFLAGS "$x"
if ! rc_compile cc link "$prog"; then
rc_undo
rc_replaceln HAVE_POSIX ""
fi
fi
rc_save