[build] MacOS linker compat
@@ -1665,10 +1665,16 @@ AC_ARG_ENABLE([extra-warnings],
if test "$extrawarnings" = true || test "$extrawarnings" = error; then
TRY_CFLAGS([-g -O2 -g2 -Wall -Wmissing-declarations -Wcast-align -Wsign-compare -Wnested-externs -Wpointer-arith -D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security])
- TRY_LDFLAGS([-Wl,--as-needed])
+ case "$host_os" in
+ *darwin* ) ;;
+ * ) TRY_LDFLAGS([-Wl,--as-needed]) ;;
+ esac
if test "$extrawarnings" = error; then
AS_VAR_APPEND([CFLAGS], [" -Werror"])
- AS_VAR_APPEND([LDFLAGS], [" -Wl,--fatal-warnings"])
+ case "$host_os" in
+ *darwin* ) ;;
+ * ) AS_VAR_APPEND([LDFLAGS], [" -Wl,--fatal-warnings"]) ;;
+ esac
fi
fi
