diff --git a/x11/xsel/Portfile b/x11/xsel/Portfile index 72d1a51788b07..c01bacfd1e756 100644 --- a/x11/xsel/Portfile +++ b/x11/xsel/Portfile @@ -28,6 +28,15 @@ depends_build port:xorg-libXt depends_lib port:xorg-libX11 +# cache autoconf vfork check to yes on darwin 21+ (macOS Monterey) disabling +# the autoconf vfork macro "#define vfork fork" that will result in a build +# failure due to vfork deprecation warning in macOS Monterey and -Werror +# https://trac.macports.org/ticket/63748 +# https://github.com/kfish/xsel/issues/42 +if {${os.platform} eq "darwin" && ${os.major} >= 21} { + configure.args-append ac_cv_func_vfork=yes +} + post-destroot { set docdir ${destroot}${prefix}/share/doc/${subport} xinstall -d ${docdir}