Apparently macos needs -bundle and -undefined dynamic_lookup since
around 2003. cpython does something similar via its own sysconfig
LDSHARED command.
Thanks to Johannes Berg for finding the solution.
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
clean_paths += lib/bup/_helpers$(soext)
generated_dependencies += lib/bup/_helpers.d
lib/bup/_helpers$(soext): lib/bup/_helpers.c lib/bup/bupsplit.c
- $(CC) $(helpers_cflags) $(CFLAGS) -shared -fPIC $^ \
+ $(CC) $(helpers_cflags) $(CFLAGS) $^ \
$(helpers_ldflags) $(LDFLAGS) $(OUTPUT_OPTION)
test/tmp:
bup_python_cflags_embed=$("$bup_python_config" --cflags) || exit $?
bup_python_ldflags_embed=$("$bup_python_config" --ldflags) || exit $?
fi
+
+case "$OSTYPE" in
+ darwin*)
+ # For at least 10.3+ (2003+)
+ bup_python_ldflags="$bup_python_ldflags -bundle -undefined dynamic_lookup"
+ ;;
+ *)
+ bup_python_ldflags="$bup_python_ldflags -shared -fPIC"
+ ;;
+esac
+
AC_SUB bup_python_config "$bup_python_config"
AC_SUB bup_python_cflags "$bup_python_cflags"
AC_SUB bup_python_ldflags "$bup_python_ldflags"