Always link with macOS frameworks but don't use -flat_namespace. https://sourceforge.net/p/net-snmp/bugs/2634/ --- configure.orig 2023-08-15 15:32:24.000000000 -0500 +++ configure 2023-08-28 22:52:19.000000000 -0500 @@ -18348,38 +18348,9 @@ ;; darwin*) - # Flat Namespace linking (Mac OS/X) + # Add frameworks (macOS) # - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether darwin ld might need -flat_namespace" >&5 -printf %s "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 (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - LDFLAGS="$saved_LDFLAGS"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - fi + LDFLAGS="-framework CoreFoundation -framework CoreServices -framework DiskArbitration -framework IOKit $LDFLAGS" ;; *)