From: Zack Weinberg Date: Tue, 27 Jan 2026 21:17:43 +0000 (-0500) Subject: autoreconf: don’t fail if gtkdocize is unavailable (#110503) X-Git-Tag: v2.72.90~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b56e8c2;p=thirdparty%2Fautoconf.git autoreconf: don’t fail if gtkdocize is unavailable (#110503) Since 2.70, autoreconf has run gtkdocize when it detects a use of the macro GTK_DOC_CHECK in the configure.ac. Some projects (e.g. per the bug report, gnutls and harfbuzz) were using a clever hack with m4_ifdef to allow people to build the project without having gtkdocize installed, if they didn’t care about building the documentation; the change to autoreconf broke this hack. Attempt to make the hack work again, by only running gtkdocize if that command is actually installed; autoreconf will not error out if the macro is detected but the command is unavailable, similar to the existing treatment of autopoint. Problem reported by Marvin Scholz. * bin/autoreconf.in (autoreconf_current_directory): Do not error out if gtkdocize is wanted but unavailable. --- diff --git a/bin/autoreconf.in b/bin/autoreconf.in index 4d08e5301..6289d553f 100644 --- a/bin/autoreconf.in +++ b/bin/autoreconf.in @@ -812,14 +812,27 @@ sub autoreconf_current_directory ($) { verb "$configure_ac: not using Gtkdoc"; } - elsif ($install) + elsif (!$install) { - xsystem_hint ("gtkdocize is needed because this package uses Gtkdoc", - $gtkdocize); + verb "$configure_ac: not running gtkdocize: --install not given"; } else { - verb "$configure_ac: not running gtkdocize: --install not given"; + my $gtkdoc_available = eval + { + no warnings 'exec'; + my $output = qx/gtkdocize --version/; + !$! && $? == 0; + }; + if (!$gtkdoc_available) + { + verb "$configure_ac: not running gtkdocize because it is unavailable"; + } + else + { + xsystem_hint ("gtkdocize is needed because this package uses Gtkdoc", + $gtkdocize); + } }