summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2019-03-17 15:01:21 -0400
committerZack Weinberg <zackw@panix.com>2020-08-18 08:44:13 -0400
commitdd880a0a6de5602cdd40b770ed6b083b34aa0768 (patch)
treee490348f3860f71467b58640c2f919ae8824c7b1
parentaba75f6d4a9c875a9d5d90a07c6b3678db66a4bf (diff)
downloadautoconf-dd880a0a6de5602cdd40b770ed6b083b34aa0768.tar.gz
autoreconf: integrate gtkdocize into the standard reconfiguration tools
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.
-rw-r--r--NEWS2
-rw-r--r--bin/autoreconf.in30
-rw-r--r--doc/autoconf.texi10
-rw-r--r--lib/autom4te.in1
4 files changed, 36 insertions, 7 deletions
diff --git a/NEWS b/NEWS
index ccf0f40a..b467d85e 100644
--- 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.
diff --git a/bin/autoreconf.in b/bin/autoreconf.in
index 1ca11f28..14e12895 100644
--- a/bin/autoreconf.in
+++ b/bin/autoreconf.in
@@ -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. #
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 4b90debb..76a4d7fe 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -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
diff --git a/lib/autom4te.in b/lib/autom4te.in
index 65d42ebd..7488d2f0 100644
--- a/lib/autom4te.in
+++ b/lib/autom4te.in
@@ -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