Here are the results on Autoconf.
/tmp/ace % for i in **/Makefile
diff -u $i.old $i.in
--- man/Makefile.old Tue Mar 13 00:12:01 2001
+++ man/Makefile.in Tue Mar 13 00:41:10 2001
@@ -93,10 +93,9 @@
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
DIST_SOURCES =
-man1dir = $(mandir)/man1
-MANS = $(man_MANS)
NROFF = nroff
+MANS = $(man_MANS)
DIST_COMMON = Makefile.am Makefile.in
all: all-am
@@ -111,6 +110,8 @@
cd $(top_builddir) && \
CONFIG_HEADERS= CONFIG_LINKS= \
CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
+
+man1dir = $(mandir)/man1
install-man1: $(man1_MANS) $(man_MANS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(man1dir)
Index: ChangeLog
from Akim Demaille <[EMAIL PROTECTED]>
* automake.in (&handle_man_pages): Rely on mans.am to define
man%SECTION%dir and MANS.
* mans.am: Do it.
Index: automake.in
--- automake.in Tue, 13 Mar 2001 00:07:50 +0100 akim (am/f/39_automake.i 1.183 755)
+++ automake.in Tue, 13 Mar 2001 00:41:02 +0100 akim (am/f/39_automake.i 1.183 755)
@@ -2741,12 +2741,12 @@ sub handle_man_pages
# sections used in man_MANS.
my (%sections, %vlist);
# Add more sections as needed.
- foreach my $sect ('0'..'9', 'n', 'l')
+ foreach my $section ('0'..'9', 'n', 'l')
{
- if (&variable_defined ('man' . $sect . '_MANS'))
+ if (&variable_defined ('man' . $section . '_MANS'))
{
- $sections{$sect} = 1;
- $vlist{'$(man' . $sect . '_MANS)'} = 1;
+ $sections{$section} = 1;
+ $vlist{'$(man' . $section . '_MANS)'} = 1;
}
}
@@ -2767,18 +2767,13 @@ sub handle_man_pages
# Now for each section, generate an install and unintall rule.
# Sort sections so output is deterministic.
- foreach my $sect (sort keys %sections)
+ foreach my $section (sort keys %sections)
{
- &define_variable ('man' . $sect . 'dir', '$(mandir)/man' . $sect);
- $output_rules .= &file_contents ('mans',
- ('SECTION', $sect));
+ $output_rules .= &file_contents ('mans', ('SECTION', $section));
}
- # We don't really need this, but we use it in case we ever want to
- # support noinst_MANS.
- &define_variable ("MANS", join (' ', sort keys %vlist));
-
- $output_vars .= &file_contents ('mans-vars');
+ $output_vars .= &file_contents ('mans-vars',
+ ('MANS' => join (' ', sort keys %vlist)));
if (! defined $options{'no-installman'})
{
Index: mans-vars.am
--- mans-vars.am Mon, 05 Mar 2001 22:33:22 +0100 akim (am/g/25_mans-vars. 1.4 644)
+++ mans-vars.am Tue, 13 Mar 2001 00:43:11 +0100 akim (am/g/25_mans-vars. 1.4 644)
@@ -17,11 +17,6 @@
## 02111-1307, USA.
NROFF = nroff
-
-## FIXME: This is not elegant: there is more than simply variables,
-## but we take advantage of the facts that these are factored dependencies,
-## and therefore will be output here, in the variable section.
-
-.PHONY: install-man uninstall-man
-?INSTALL-MAN?install-data-am: install-man
-?INSTALL-MAN?uninstall-am: uninstall-man
+## We don't really need this, but we use it in case we ever want to
+## support noinst_MANS.
+MANS = %MANS%
Index: mans.am
--- mans.am Mon, 05 Mar 2001 22:33:22 +0100 akim (am/g/24_mans.am 1.11 644)
+++ mans.am Tue, 13 Mar 2001 00:33:28 +0100 akim (am/g/24_mans.am 1.11 644)
@@ -16,8 +16,17 @@
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
## 02111-1307, USA.
+man%SECTION%dir = $(mandir)/man%SECTION%
+
+## ------------ ##
+## Installing. ##
+## ------------ ##
+
## MANS primary are always installed in mandir, hence install-data
## is hard coded.
+
+.PHONY: install-man
+?INSTALL-MAN?install-data-am: install-man
?INSTALL-MAN?_am_installdirs += $(DESTDIR)$(man%SECTION%dir)
.PHONY install-man: install-man%SECTION%
install-man%SECTION%: $(man%SECTION%_MANS) $(man_MANS)
@@ -46,7 +55,14 @@
$(INSTALL_DATA) $$file $(DESTDIR)$(man%SECTION%dir)/$$inst; \
done
+
+## -------------- ##
+## Uninstalling. ##
+## -------------- ##
+
## This is just completely gross.
+.PHONY: uninstall-man
+?INSTALL-MAN?uninstall-am: uninstall-man
.PHONY uninstall-man: uninstall-man%SECTION%
uninstall-man%SECTION%:
@$(NORMAL_UNINSTALL)