]> arthur.ath.cx Git - bup.git/commitdiff
helpers: adjust macos linkage
authorRob Browning <rlb@defaultvalue.org>
Sun, 11 Apr 2021 19:53:21 +0000 (14:53 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sun, 11 Apr 2021 19:53:21 +0000 (14:53 -0500)
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>
GNUmakefile
config/configure

index fd4931b7dd881350ad0df8cab1c251b471b23bb4..3e288d3f627bb844aa34d10af630c985f78b1653 100644 (file)
@@ -190,7 +190,7 @@ lib/cmd/bup: lib/cmd/bup.c src/bup/compat.c src/bup/io.c
 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:
index 8b9263d3d6d2f13b1aa123619c15a8c1c36e6ad4..2223c7eb3e2ac78b86e3fdc92dd3f6f832bb787c 100755 (executable)
@@ -103,6 +103,17 @@ else  # Earlier versions didn't support --embed
     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"