Apparently dlopen() path searching doesn't work or is unreliable on
MacOS; it appears to not search LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, or
DYLD_FALLBACK_LIBRARY_PATH as documented by the dlopen(3) man page.
Furthmore setting any of these variables to include /opt/local/lib,
which is where MacPort drops libarchive.13.dylib, can cause all manner
of warnings when running other dynamically linked programs, such as
"grep". What a mess. It appears dlopen(2) support in MacOS is a
disaster, and it's not really needed since we don't care about the
size of mke2fs on installation media on non-Linux systems. So default
to using --with-libarchive=direct for MacOS.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fi
else $as_nop
- try_libarchive="yes"
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Try testing for libarchive support (with dlopen) by default" >&5
+
+case "$host_os" in
+ darwin*)
+ try_libarchive="direct"
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Try testing for libarchive support (with static linking) by default" >&5
+printf "%s\n" "Try testing for libarchive support (with static linking) by default" >&6; }
+ ;;
+ *)
+ try_libarchive="yes"
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Try testing for libarchive support (with dlopen) by default" >&5
printf "%s\n" "Try testing for libarchive support (with dlopen) by default" >&6; }
+ ;;
+esac
fi
AC_MSG_RESULT([Testing for libarchive support (with dlopen)])
fi]
,
-try_libarchive="yes"
-AC_MSG_RESULT([Try testing for libarchive support (with dlopen) by default])
-)
+[
+case "$host_os" in
+ darwin*)
+ try_libarchive="direct"
+ AC_MSG_RESULT([Try testing for libarchive support (with static linking) by default])
+ ;;
+ *)
+ try_libarchive="yes"
+ AC_MSG_RESULT([Try testing for libarchive support (with dlopen) by default])
+ ;;
+esac
+])
ARCHIVE_LIBS=
if test -n "$try_libarchive"
then