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).
This commit is contained in:
Avery Pennarun 2019-02-24 22:29:19 -05:00
commit 328d4ead7a
7 changed files with 59 additions and 13 deletions

View file

@ -10,7 +10,7 @@ rc_include \
rc/rt.autolib.rc \
rc/libpng.rc \
rc/clock_gettime.rc \
rc/mach_time.h.rc \
rc/mach__mach_time.h.rc \
rc/windows.h.rc \
rc/posix.rc \
rc/printf_lld.rc \

View file

@ -23,7 +23,7 @@ long long monotime(void) {
return !result ? 1 : result;
}
#elif HAVE_MACH_TIME_H
#elif HAVE_MACH__MACH_TIME_H
#include <mach/mach.h>
#include <mach/mach_time.h>

View file

@ -8,13 +8,13 @@ struct timespec x;
'
x=
rc_replaceln HAS_POSIX 1
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 HAS_POSIX ""
rc_replaceln HAVE_POSIX ""
fi
fi
rc_save