[build] MacOS linker compat

personal/stbuehler/tests-path
Glenn Strauss 2021-05-24 22:02:50 -04:00
parent bb1d35dc17
commit fbefda3524
1 changed files with 8 additions and 2 deletions

View File

@ -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