@@ -18747,8 +18747,9 @@ fi
1874718747
1874818748done
1874918749
18750- # We need to force a flat namespace to make libc
18751- # symbol hooking work like it does on ELF.
18750+ # We need to force a flat namespace on macOS to make libc
18751+ # symbol hooking work like it does on ELF. Newer versions of
18752+ # macOS treat -force_flat_namespace as -flat_namespace.
1875218753 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,-force_flat_namespace" >&5
1875318754printf %s "checking whether the linker accepts -Wl,-force_flat_namespace... " >&6; }
1875418755if test ${ax_cv_check_ldflags___Wl__force_flat_namespace+y}
@@ -18786,6 +18787,7 @@ printf "%s\n" "$ax_cv_check_ldflags___Wl__force_flat_namespace" >&6; }
1878618787if test x"$ax_cv_check_ldflags___Wl__force_flat_namespace" = xyes
1878718788then :
1878818789
18790+
1878918791if test ${SUDO_LDFLAGS+y}
1879018792then :
1879118793
@@ -18819,11 +18821,90 @@ else case e in #(
1881918821esac
1882018822fi
1882118823
18824+
18825+ else case e in #(
18826+ e)
18827+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,-flat_namespace" >&5
18828+ printf %s "checking whether the linker accepts -Wl,-flat_namespace... " >&6; }
18829+ if test ${ax_cv_check_ldflags___Wl__flat_namespace+y}
18830+ then :
18831+ printf %s "(cached) " >&6
18832+ else case e in #(
18833+ e)
18834+ ax_check_save_flags=$LDFLAGS
18835+ LDFLAGS="$LDFLAGS -Wl,-flat_namespace"
18836+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18837+ /* end confdefs.h. */
18838+
18839+ int
18840+ main (void)
18841+ {
18842+
18843+ ;
18844+ return 0;
18845+ }
18846+ _ACEOF
18847+ if ac_fn_c_try_link "$LINENO"
18848+ then :
18849+ ax_cv_check_ldflags___Wl__flat_namespace=yes
18850+ else case e in #(
18851+ e) ax_cv_check_ldflags___Wl__flat_namespace=no ;;
18852+ esac
18853+ fi
18854+ rm -f core conftest.err conftest.$ac_objext conftest.beam \
18855+ conftest$ac_exeext conftest.$ac_ext
18856+ LDFLAGS=$ax_check_save_flags ;;
18857+ esac
18858+ fi
18859+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___Wl__flat_namespace" >&5
18860+ printf "%s\n" "$ax_cv_check_ldflags___Wl__flat_namespace" >&6; }
18861+ if test x"$ax_cv_check_ldflags___Wl__flat_namespace" = xyes
18862+ then :
18863+
18864+
18865+ if test ${SUDO_LDFLAGS+y}
18866+ then :
18867+
18868+ case " $SUDO_LDFLAGS " in #(
18869+ *" -Wl,-flat_namespace "*) :
18870+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : SUDO_LDFLAGS already contains -Wl,-flat_namespace"; } >&5
18871+ (: SUDO_LDFLAGS already contains -Wl,-flat_namespace) 2>&5
18872+ ac_status=$?
18873+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
18874+ test $ac_status = 0; } ;; #(
18875+ *) :
18876+
18877+ as_fn_append SUDO_LDFLAGS " -Wl,-flat_namespace"
18878+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : SUDO_LDFLAGS=\"\$SUDO_LDFLAGS\""; } >&5
18879+ (: SUDO_LDFLAGS="$SUDO_LDFLAGS") 2>&5
18880+ ac_status=$?
18881+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
18882+ test $ac_status = 0; }
18883+ ;;
18884+ esac
18885+
18886+ else case e in #(
18887+ e)
18888+ SUDO_LDFLAGS=-Wl,-flat_namespace
18889+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : SUDO_LDFLAGS=\"\$SUDO_LDFLAGS\""; } >&5
18890+ (: SUDO_LDFLAGS="$SUDO_LDFLAGS") 2>&5
18891+ ac_status=$?
18892+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
18893+ test $ac_status = 0; }
18894+ ;;
18895+ esac
18896+ fi
18897+
18898+
1882218899else case e in #(
1882318900 e) : ;;
1882418901esac
1882518902fi
1882618903
18904+ ;;
18905+ esac
18906+ fi
18907+
1882718908
1882818909 # Examples go in share/examples/sudo
1882918910 if test X"$with_exampledir" = X""
0 commit comments