Always link with macOS frameworks but don't use -flat_namespace. https://sourceforge.net/p/net-snmp/bugs/2634/ --- configure.orig 2018-07-16 09:33:50.000000000 -0500 +++ configure 2018-09-12 23:15:49.000000000 -0500 @@ -16607,37 +16607,9 @@ ;; darwin*) - # Flat Namespace linking (Mac OS/X) + # Add frameworks (macOS) # - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether darwin ld might need -flat_namespace" >&5 -$as_echo_n "checking whether darwin ld might need -flat_namespace... " >&6; } - if test -z "$MACOSX_DEPLOYMENT_TARGET"; then - saved_LDFLAGS="$LDFLAGS" - LDFLAGS="-flat_namespace -framework CoreFoundation -framework CoreServices -framework DiskArbitration -framework IOKit $LDFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - LDFLAGS="$saved_LDFLAGS"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi + LDFLAGS="-framework CoreFoundation -framework CoreServices -framework DiskArbitration -framework IOKit $LDFLAGS" ;; *)