]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
autoreconf: don’t fail if gtkdocize is unavailable (#110503)
authorZack Weinberg <zack@owlfolio.org>
Tue, 27 Jan 2026 21:17:43 +0000 (16:17 -0500)
committerZack Weinberg <zack@owlfolio.org>
Tue, 27 Jan 2026 21:25:54 +0000 (16:25 -0500)
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.

bin/autoreconf.in

index 4d08e5301131fda75085eb5f45ec809a87d5e8cb..6289d553f808e185fef5d713648d2fb0f4c131bf 100644 (file)
@@ -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);
+       }
     }