]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
autoreconf: integrate gtkdocize into the standard reconfiguration tools
authorEli Schwartz <eschwartz@archlinux.org>
Sun, 17 Mar 2019 19:01:21 +0000 (15:01 -0400)
committerZack Weinberg <zackw@panix.com>
Tue, 18 Aug 2020 12:44:13 +0000 (08:44 -0400)
When the GTK_DOC_CHECK macro is in use, this flags a given configure.ac
as belonging the the common class of gtk-related software that requires
the gtkdocize tool to be run before autoreconf, in order to install the
gtk-doc macro and Makefile fragment. Make this easier to accomplish via
teaching autoreconf how to detect and run this tool automatically; this
gets us one step closer to a world in which `autoreconf -fi` on its own
is enough to bootstrap any autotools project into a configurable state.

NEWS
bin/autoreconf.in
doc/autoconf.texi
lib/autom4te.in

diff --git a/NEWS b/NEWS
index ccf0f40acaf6d1948f2f72fd3c226e29cd131060..b467d85e731d67bb4c80c62cf69f7ac9f2a1e37a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,8 @@ GNU Autoconf NEWS - User visible changes.
 ** autoconf will now issue warnings (in the ‘syntax’ category) if the
    input file is missing a call to AC_INIT and/or AC_OUTPUT.
 
+** autoreconf will now run gtkdocize when appropriate.
+
 ** Older version of automake and aclocal (< 1.8) are no longer supported
    by autoreconf.
 
index 1ca11f284a0ba02cc92e4b96ce13be2b69769691..14e12895e2a2d98729dc19f38e442626f1d72444 100644 (file)
@@ -112,6 +112,7 @@ my $autom4te   = $ENV{'AUTOM4TE'}   || '@bindir@/@autom4te-name@';
 my $automake   = $ENV{'AUTOMAKE'}   || 'automake';
 my $aclocal    = $ENV{'ACLOCAL'}    || 'aclocal';
 my $libtoolize = $ENV{'LIBTOOLIZE'} || 'libtoolize';
+my $gtkdocize  = $ENV{'GTKDOCIZE'}  || 'gtkdocize';
 my $autopoint  = $ENV{'AUTOPOINT'}  || 'autopoint';
 my $make       = $ENV{'MAKE'}       || 'make';
 
@@ -174,7 +175,8 @@ sub parse_args ()
       for my $prog ($autoconf, $autoheader,
                    $automake, $aclocal,
                    $autopoint,
-                   $libtoolize)
+                   $libtoolize,
+                   $gtkdocize)
        {
          xsystem ("$prog --version | sed 1q >&2");
          print STDERR "\n";
@@ -200,6 +202,7 @@ sub parse_args ()
       $automake   .= ' --add-missing';
       $automake   .= ' --copy' unless $symlink;
       $libtoolize .= ' --copy' unless $symlink;
+      $gtkdocize  .= ' --copy' unless $symlink;
     }
   # --force;
   if ($force)
@@ -388,6 +391,7 @@ sub autoreconf_current_directory ($)
   my $aux_dir;
   my $uses_gettext_via_traces;
   my $uses_libtool;
+  my $uses_gtkdoc;
   my $uses_libltdl;
   my $uses_autoheader;
   my $uses_automake;
@@ -409,6 +413,7 @@ sub autoreconf_current_directory ($)
             'LT_CONFIG_LTDL_DIR',
             'AM_GNU_GETTEXT',
             'AM_INIT_AUTOMAKE',
+            'GTK_DOC_CHECK',
            )
      . ' |');
   while ($_ = $traces->getline)
@@ -424,6 +429,7 @@ sub autoreconf_current_directory ($)
       $uses_libltdl = 1             if $macro eq "LT_CONFIG_LTDL_DIR";
       $uses_autoheader = 1          if $macro eq "AC_CONFIG_HEADERS";
       $uses_automake = 1            if $macro eq "AM_INIT_AUTOMAKE";
+      $uses_gtkdoc = 1              if $macro eq "GTK_DOC_CHECK";
       push @subdir, split (' ', $args[0])
                                     if $macro eq "AC_CONFIG_SUBDIRS" && $recursive;
     }
@@ -481,7 +487,8 @@ sub autoreconf_current_directory ($)
        {
          $libtoolize .= " --ltdl";
        }
-      xsystem_hint ("libtoolize is needed because this package uses Libtool", $libtoolize);
+      xsystem_hint ("libtoolize is needed because this package uses Libtool",
+                   $libtoolize);
       $rerun_aclocal = 1;
     }
   else
@@ -490,6 +497,25 @@ sub autoreconf_current_directory ($)
     }
 
 
+  # ------------------- #
+  # Running gtkdocize.  #
+  # ------------------- #
+
+  if (!$uses_gtkdoc)
+    {
+      verb "$configure_ac: not using Gtkdoc";
+    }
+  elsif ($install)
+    {
+      xsystem_hint ("gtkdocize is needed because this package uses Gtkdoc",
+                   $gtkdocize);
+      xsystem ($gtkdocize)
+    }
+  else
+    {
+      verb "$configure_ac: not running gtkdocize: --install not given";
+    }
+
 
   # ------------------- #
   # Rerunning aclocal.  #
index 4b90debbfe6a6183952b0a191cc3cda3c556a684..76a4d7fe4d8740d6070e21beddae8b6bcf94a545 100644 (file)
@@ -1689,14 +1689,14 @@ been updated, or finally, simply in order to install the GNU Build
 System in a fresh tree.
 
 @command{autoreconf} runs @command{autoconf}, @command{autoheader},
-@command{aclocal}, @command{automake}, @command{libtoolize}, and
-@command{autopoint} (when appropriate) repeatedly to update the
-GNU Build System in the specified directories and their
+@command{aclocal}, @command{automake}, @command{libtoolize},
+@command{gtkdocize}, and @command{autopoint} (when appropriate) repeatedly
+to update the GNU Build System in the specified directories and their
 subdirectories (@pxref{Subdirectories}).  By default, it only remakes
 those files that are older than their sources.  The environment variables
 @env{AUTOM4TE}, @env{AUTOCONF}, @env{AUTOHEADER}, @env{AUTOMAKE},
-@env{ACLOCAL}, @env{AUTOPOINT}, @env{LIBTOOLIZE}, @env{M4}, and @env{MAKE}
-may be used to override the invocation of the respective tools.
+@env{ACLOCAL}, @env{AUTOPOINT}, @env{LIBTOOLIZE}, @env{GTKDOCIZE}, @env{M4},
+and @env{MAKE} may be used to override the invocation of the respective tools.
 
 If you install a new version of some tool, you can make
 @command{autoreconf} remake @emph{all} of the files by giving it the
index 65d42ebd86f0854d575df94cbc95ffea0ee0091a..7488d2f0e12abe0bacb00790028cac718c4c5a7d 100644 (file)
@@ -99,6 +99,7 @@ args: --preselect AC_CONFIG_SUBDIRS
 args: --preselect AC_INIT
 args: --preselect AC_PROG_LIBTOOL
 args: --preselect AM_PROG_LIBTOOL
+args: --preselect GTK_DOC_CHECK
 args: --preselect LT_INIT
 args: --preselect LT_CONFIG_LTDL_DIR
 args: --preselect AM_GNU_GETTEXT