From: Tom Tromey Date: Thu, 5 Sep 1996 16:19:38 +0000 (+0000) Subject: More cleanups for dependency handling X-Git-Tag: Release-1-1d~12 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=771349c4cf555a48f2d595f04bcee2cd9031d2b7;p=thirdparty%2Fautomake.git More cleanups for dependency handling --- diff --git a/ChangeLog b/ChangeLog index 096f09c6b..8ba0c53dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Thu Sep 5 09:06:23 1996 Tom Tromey + + * automake.in (usage): Include bug-reporting information. + + * aclocal.in ($acdir): Use @datadir@/aclocal. + (usage): Include bug-reporting information. + Wed Sep 4 11:36:06 1996 Tom Tromey * automake.in (handle_source_transform): .deps no longer in diff --git a/Makefile.in b/Makefile.in index f8a169f4b..ceee986de 100644 --- a/Makefile.in +++ b/Makefile.in @@ -118,6 +118,7 @@ aclocal: $(top_builddir)/config.status aclocal.in cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status install-binSCRIPTS: $(bin_SCRIPTS) + $(NORMAL_INSTALL) $(mkinstalldirs) $(bindir) list="$(bin_SCRIPTS)"; for p in $$list; do \ if test -f $$p; then \ @@ -134,6 +135,7 @@ uninstall-binSCRIPTS: done install-pkgdataSCRIPTS: $(pkgdata_SCRIPTS) + $(NORMAL_INSTALL) $(mkinstalldirs) $(pkgdatadir) list="$(pkgdata_SCRIPTS)"; for p in $$list; do \ if test -f $$p; then \ @@ -192,6 +194,7 @@ automake.dvi: automake.texi version.texi TEXINPUTS=$(srcdir):$$TEXINPUTS $(TEXI2DVI) $< install-info: $(INFO_DEPS) + $(NORMAL_INSTALL) $(mkinstalldirs) $(infodir) for file in $(INFO_DEPS); do \ for ifile in `cd $(srcdir) && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \ @@ -219,6 +222,7 @@ maintainer-clean-info: rm -f $(INFOS) install-pkgdataDATA: $(pkgdata_DATA) + $(NORMAL_INSTALL) $(mkinstalldirs) $(pkgdatadir) list="$(pkgdata_DATA)"; for p in $$list; do \ if test -f $(srcdir)/$$p; then \ @@ -315,9 +319,9 @@ distdir: $(DEP_DISTFILES) rm -rf $(distdir) mkdir $(distdir) -chmod 755 $(distdir) - distdir=`cd $(distdir) && pwd` \ + here=`pwd`; distdir=`cd $(distdir) && pwd` \ && cd $(srcdir) \ - && automake --include-deps --output-dir=$$distdir --strictness=gnits + && automake --include-deps --build-dir=$$here --srcdir-name=$(srcdir) --output-dir=$$distdir --strictness=gnits @for file in `cd $(srcdir) && echo $(DISTFILES)`; do \ test -f $(distdir)/$$file \ || ln $(srcdir)/$$file $(distdir)/$$file 2> /dev/null \ @@ -348,8 +352,10 @@ install-data-am: install-info install-pkgdataSCRIPTS install-pkgdataDATA uninstall-am: uninstall-binSCRIPTS uninstall-pkgdataSCRIPTS uninstall-info uninstall-pkgdataDATA install-exec: install-exec-recursive install-exec-am + $(NORMAL_INSTALL) install-data: install-data-recursive install-data-am + $(NORMAL_INSTALL) install: install-recursive install-exec-am install-data-am @: diff --git a/aclocal.in b/aclocal.in index bcee14809..3ce839cb3 100644 --- a/aclocal.in +++ b/aclocal.in @@ -11,7 +11,8 @@ eval 'exec @PERL@ -S $0 ${1+"$@"}' $VERSION = "@VERSION@"; $PACKAGE = "@PACKAGE@"; $prefix = "@prefix@"; -$acdir = "@datadir@/@PACKAGE@"; +# Note that this isn't pkgdatadir, but a separate directory. +$acdir = "@datadir@/aclocal"; # Some globals. @@ -82,7 +83,9 @@ sub usage --help print this help, then exit --output=FILE put output in FILE (default aclocal.m4) --verbose don't be silent - --version print version number, then exit\n"; + --version print version number, then exit + +Report bugs to \n"; exit $status; } diff --git a/automake.in b/automake.in index cafbf65d8..29ad2f514 100755 --- a/automake.in +++ b/automake.in @@ -106,9 +106,6 @@ $build_directory = ''; # dependencies only. $srcdir_name = ''; -# Regular expression derived from srcdir_name. -$srcdir_rx = ''; - # List of Makefile.am's to process. @input_files = (); @@ -286,14 +283,12 @@ sub parse_arguments elsif ($arglist[0] =~ /^--srcdir-name=(.+)$/) { $srcdir_name = $1; - ($srcdir_rx = $srcdir_name) =~ s/(\W)/\\$1/g; } elsif ($arglist[0] eq '--srcdir-name') { &require_argument (@arglist); shift (@arglist); $srcdir_name = $arglist[0]; - ($srcdir_rx = $srcdir_name) =~ s/(\W)/\\$1/g; } elsif ($arglist[0] =~ /^--strictness=(.+)$/) { @@ -1677,19 +1672,42 @@ sub scan_dependency_file print "automake: reading $depfile\n" if $verbose; local ($first_line) = 1; + local ($last_line) = 0; local ($target, @dependencies); local ($one_dep, $xform); + local ($srcdir_rx, $fixup_rx, $fixup2_rx); + ($srcdir_rx = $srcdir_name) =~ s/(\W)/\\$1/g; + + # If the top srcdir is absolute, then the current directory is + # just relative_dir. + ($fixup_rx = $srcdir_name . '/' . $relative_dir . '/') =~ s/(\W)/\\$1/g; + + # But if the top srcdir is relative, then we need some dots first. + ($fixup2_rx = ($srcdir_name . '/' . $top_builddir . '/' + . $relative_dir . '/')) =~ s/(\W)/\\$1/g; + while () { + if ($last_line) + { + # If LAST_LINE set then we've already seen what we thought + # was the last line. + goto bad_format; + } next if (/$WHITE_PATTERN/o); chop; - s/\\$//; + if (! s/\\$//) + { + # No trailing "\" means this should be the last line. + $last_line = 1; + } if ($first_line) { - if (! /([^:]+):(.+)$/) + if (! /^([^:]+:)(.+)$/) { + bad_format: &am_error ("\`$depfile' has incorrect format"); close (DEP_FILE); return; @@ -1703,9 +1721,24 @@ sub scan_dependency_file foreach $one_dep (split (' ', $_)) { - if ($one_dep =~ /^$srcdir_rx\//o) + if ($one_dep =~ /^$fixup_rx/) { - ($xform = $one_dep) =~ s/^$srcdir_rx/\$(top_srcdir)/o; + # The dependency points to the current directory in + # some way. + ($xform = $one_dep) =~ s/^$fixup_rx//; + push (@dependencies, $xform); + } + elsif ($one_dep =~ /^$fixup2_rx/) + { + # The dependency points to the current directory in + # some way. + ($xform = $one_dep) =~ s/^$fixup2_rx//; + push (@dependencies, $xform); + } + elsif ($one_dep =~ /^$srcdir_rx\//) + { + # The dependency is in some other directory in the package. + ($xform = $one_dep) =~ s/^$srcdir_rx/$top_builddir/; push (@dependencies, $xform); } elsif ($one_dep =~ /^\//) @@ -1720,7 +1753,7 @@ sub scan_dependency_file } } - &pretty_print_rule ($target . ':', "\t", @dependencies); + &pretty_print_rule ($target, "\t", @dependencies); close (DEP_FILE); } @@ -3853,6 +3886,8 @@ sub usage write; } + print "\nReport bugs to \n"; + exit 0; } diff --git a/m4/Makefile.in b/m4/Makefile.in index 3868a7b52..7ec9d5ba7 100644 --- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -76,6 +76,7 @@ Makefile: $(top_builddir)/config.status Makefile.in cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status install-m4dataDATA: $(m4data_DATA) + $(NORMAL_INSTALL) $(mkinstalldirs) $(m4datadir) list="$(m4data_DATA)"; for p in $$list; do \ if test -f $(srcdir)/$$p; then \ @@ -111,8 +112,10 @@ check: all installcheck: install-exec: + $(NORMAL_INSTALL) install-data: install-m4dataDATA + $(NORMAL_INSTALL) install: install-exec install-data all @: diff --git a/tests/Makefile.in b/tests/Makefile.in index 58980aab6..23adbd705 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -119,8 +119,10 @@ check: all check-TESTS installcheck: install-exec: + $(NORMAL_INSTALL) install-data: + $(NORMAL_INSTALL) install: install-exec install-data all @: