From: Tom Tromey Date: Sat, 10 Apr 1999 22:08:12 +0000 (+0000) Subject: * automake.in (handle_single_transform_list): Handle dependency X-Git-Tag: last-merge-into-user-dep-gen-branch~17 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=b4ab83deb202da63f0255b99af5b72fcf3908b60;p=automake.git * automake.in (handle_single_transform_list): Handle dependency tracking when files are created in subdirs. Error if object in subdir has `..' component. --- diff --git a/ChangeLog b/ChangeLog index bc6149f4..2da6e3c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 1999-04-10 Tom Tromey + * automake.in (handle_single_transform_list): Handle dependency + tracking when files are created in subdirs. Error if object in + subdir has `..' component. + * automake.in (initialize_global_constants): Use $(TAR), not tar. * automake.in (handle_ltlibraries): Allow check_LTLIBRARIES. diff --git a/TODO b/TODO index a62a7c50..55ddd130 100644 --- a/TODO +++ b/TODO @@ -13,9 +13,6 @@ * If we see `foo.o' in LIBOBJS, and we've seen AC_OBJEXT, then complain. -* subdir warning for source files is bogus. I removed it at Cygnus; - probably should remove it from net release - * using "include" inside a conditional doesn't currently work properly. diff --git a/automake.in b/automake.in index e4895438..23a24b24 100755 --- a/automake.in +++ b/automake.in @@ -1086,6 +1086,8 @@ sub handle_single_transform_list $base = $3; $extension = $4; + local ($xbase) = $base; + local ($lang) = $extension_map{$extension}; if ($lang) { @@ -1093,6 +1095,7 @@ sub handle_single_transform_list # Found the language, so see what it says. local ($subr) = 'lang_' . $lang . '_rewrite'; # Note: computed subr call. + # FIXME: should pass directory to this function. local ($r) = & $subr ($base, $extension); # Skip this entry if we were asked not to process it. next if $r == $LANG_IGNORE; @@ -1114,11 +1117,13 @@ sub handle_single_transform_list if ($r == $LANG_SUBDIR && $directory ne '') { $object = $directory . '/' . $object; + $xbase = $directory . '/' . $base; } } elsif ($extension =~ /^$source_suffix_pattern$/) { # We just rewrite it. Maybe we should do more. + # FIXME: what about subdir handling here? $object = $base . '.' . $suffix_rules{$extension}; $linker = ''; } @@ -1156,19 +1161,36 @@ sub handle_single_transform_list # sure the subdir exists at build time. if ($object =~ /\//) { + if ($object =~ /(\/|^)\.\.\//) + { + &am_error ("\`$full' contains \`..' component but should not"); + } + push (@dep_list, $directory . '/.dirstamp'); $output_rules .= ($directory . "/.dirstamp:\n" . "\t\@\$(mkinstalldirs) $directory\n" . "\t\@: > $directory/.dirstamp\n"); + + # If we're generating dependencies, we also want + # to make sure that the appropriate subdir of the + # .deps directory is created. + if ($use_dependencies) + { + push (@dep_list, '.deps/' . $directory . '/.dirstamp'); + $output_rules .= ('.deps/' . $directory + . "/.dirstamp:\n" + . "\t\@\$(mkinstalldirs) .deps/$directory\n" + . "\t\@: > .deps/$directory/.dirstamp\n"); + } } + # FIXME: this fails with parallel builds! &pretty_print_rule ($object . ':', "\t", @dep_list); } # Transform .o or $o file into .P file (for automatic # dependency code). - # FIXME: LANG_SUBDIR. - $dep_files{'.deps/' . $base . '.P'} = 1; + $dep_files{'.deps/' . $xbase . '.P'} = 1; } } diff --git a/tests/ChangeLog b/tests/ChangeLog index a6d125ec..2f67f225 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,8 @@ +1999-04-10 Tom Tromey + + * gcj2.test: New file. + * Makefile.am (TESTS): Added gcj2.test. + 1999-04-10 Alexandre Oliva * suffix.test: New file. diff --git a/tests/Makefile.am b/tests/Makefile.am index 1751d050..55510541 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -21,30 +21,30 @@ depend.test depend2.test depend3.test discover.test distdir.test \ dup.test dup2.test else.test empty.test error.test exdir.test \ exdir2.test exsource.test ext.test extra.test extra3.test extra4.test \ flibs.test fnoc.test fo.test fonly.test fpinst2.test fpinstall.test \ -gcj.test gnits.test implicit.test include.test info.test insh.test \ -insh2.test install.test installsh.test instdata.test instexec.test \ -insthook.test instman.test interp.test interp2.test java.test \ -javaprim.test javasubst.test ldadd.test lex.test lex2.test lex3.test \ -libobj.test libobj2.test libobj3.test libobj4.test libobj5.test \ -libobj6.test libobj7.test libobj8.test libobj9.test library.test \ -link_c_cxx.test link_f_c.test link_f_c_cxx.test link_f_cxx.test \ -link_f_only.test lisp.test mclean.test mdate.test mdate2.test \ -mdate3.test mkinst2.test mkinstall.test nodep.test nodist.test \ -noinst.test number.test objc.test obsolete.test obsolete2.test \ -order.test outdir.test output.test output2.test output3.test \ -output4.test output5.test package.test parse.test pluseq.test \ -pluseq2.test pluseq3.test pluseq4.test pluseq5.test pluseq6.test \ -pluseq7.test ppf77.test prefix.test primary.test primary2.test \ -proginst.test ranlib.test recurs.test recurs2.test remake.test \ -remake2.test req.test rulepat.test scripts.test seenc.test \ +gcj.test gcj2.test gnits.test implicit.test include.test info.test \ +insh.test insh2.test install.test installsh.test instdata.test \ +instexec.test insthook.test instman.test interp.test interp2.test \ +java.test javaprim.test javasubst.test ldadd.test lex.test lex2.test \ +lex3.test libobj.test libobj2.test libobj3.test libobj4.test \ +libobj5.test libobj6.test libobj7.test libobj8.test libobj9.test \ +library.test link_c_cxx.test link_f_c.test link_f_c_cxx.test \ +link_f_cxx.test link_f_only.test lisp.test mclean.test mdate.test \ +mdate2.test mdate3.test mkinst2.test mkinstall.test nodep.test \ +nodist.test noinst.test number.test objc.test obsolete.test \ +obsolete2.test order.test outdir.test output.test output2.test \ +output3.test output4.test output5.test package.test parse.test \ +pluseq.test pluseq2.test pluseq3.test pluseq4.test pluseq5.test \ +pluseq6.test pluseq7.test ppf77.test prefix.test primary.test \ +primary2.test proginst.test ranlib.test recurs.test recurs2.test \ +remake.test remake2.test req.test rulepat.test scripts.test seenc.test \ sinclude.test spell.test spell2.test spell3.test spelling.test \ stamph.test stdlib.test subdir.test subdir2.test subdir3.test \ -subst.test suffix.test symlink.test syntax.test tags.test \ -tagsub.test target.test texinfo.test texinfo2.test texinfo3.test \ -texinfo4.test texinfo5.test texinfo6.test texinfo7.test \ -texinfo8.test unused.test version.test version2.test version3.test \ -vpath.test vtexi.test vtexi2.test whoami.test xsource.test yacc.test \ -yacc2.test yacc3.test yaccpp.test +subst.test suffix.test symlink.test syntax.test tags.test tagsub.test \ +target.test texinfo.test texinfo2.test texinfo3.test texinfo4.test \ +texinfo5.test texinfo6.test texinfo7.test texinfo8.test unused.test \ +version.test version2.test version3.test vpath.test vtexi.test \ +vtexi2.test whoami.test xsource.test yacc.test yacc2.test yacc3.test \ +yaccpp.test EXTRA_DIST = defs $(TESTS) diff --git a/tests/Makefile.in b/tests/Makefile.in index a9da9d2f..9a782ef9 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -86,40 +86,39 @@ depend.test depend2.test depend3.test discover.test distdir.test \ dup.test dup2.test else.test empty.test error.test exdir.test \ exdir2.test exsource.test ext.test extra.test extra3.test extra4.test \ flibs.test fnoc.test fo.test fonly.test fpinst2.test fpinstall.test \ -gcj.test gnits.test implicit.test include.test info.test insh.test \ -insh2.test install.test installsh.test instdata.test instexec.test \ -insthook.test instman.test interp.test interp2.test java.test \ -javaprim.test javasubst.test ldadd.test lex.test lex2.test lex3.test \ -libobj.test libobj2.test libobj3.test libobj4.test libobj5.test \ -libobj6.test libobj7.test libobj8.test libobj9.test library.test \ -link_c_cxx.test link_f_c.test link_f_c_cxx.test link_f_cxx.test \ -link_f_only.test lisp.test mclean.test mdate.test mdate2.test \ -mdate3.test mkinst2.test mkinstall.test nodep.test nodist.test \ -noinst.test number.test objc.test obsolete.test obsolete2.test \ -order.test outdir.test output.test output2.test output3.test \ -output4.test output5.test package.test parse.test pluseq.test \ -pluseq2.test pluseq3.test pluseq4.test pluseq5.test pluseq6.test \ -pluseq7.test ppf77.test prefix.test primary.test primary2.test \ -proginst.test ranlib.test recurs.test recurs2.test remake.test \ -remake2.test req.test rulepat.test scripts.test seenc.test \ +gcj.test gcj2.test gnits.test implicit.test include.test info.test \ +insh.test insh2.test install.test installsh.test instdata.test \ +instexec.test insthook.test instman.test interp.test interp2.test \ +java.test javaprim.test javasubst.test ldadd.test lex.test lex2.test \ +lex3.test libobj.test libobj2.test libobj3.test libobj4.test \ +libobj5.test libobj6.test libobj7.test libobj8.test libobj9.test \ +library.test link_c_cxx.test link_f_c.test link_f_c_cxx.test \ +link_f_cxx.test link_f_only.test lisp.test mclean.test mdate.test \ +mdate2.test mdate3.test mkinst2.test mkinstall.test nodep.test \ +nodist.test noinst.test number.test objc.test obsolete.test \ +obsolete2.test order.test outdir.test output.test output2.test \ +output3.test output4.test output5.test package.test parse.test \ +pluseq.test pluseq2.test pluseq3.test pluseq4.test pluseq5.test \ +pluseq6.test pluseq7.test ppf77.test prefix.test primary.test \ +primary2.test proginst.test ranlib.test recurs.test recurs2.test \ +remake.test remake2.test req.test rulepat.test scripts.test seenc.test \ sinclude.test spell.test spell2.test spell3.test spelling.test \ stamph.test stdlib.test subdir.test subdir2.test subdir3.test \ -subst.test suffix.test symlink.test syntax.test tags.test \ -tagsub.test target.test texinfo.test texinfo2.test texinfo3.test \ -texinfo4.test texinfo5.test texinfo6.test texinfo7.test \ -texinfo8.test unused.test version.test version2.test version3.test \ -vpath.test vtexi.test vtexi2.test whoami.test xsource.test yacc.test \ -yacc2.test yacc3.test yaccpp.test +subst.test suffix.test symlink.test syntax.test tags.test tagsub.test \ +target.test texinfo.test texinfo2.test texinfo3.test texinfo4.test \ +texinfo5.test texinfo6.test texinfo7.test texinfo8.test unused.test \ +version.test version2.test version3.test vpath.test vtexi.test \ +vtexi2.test whoami.test xsource.test yacc.test yacc2.test yacc3.test \ +yaccpp.test EXTRA_DIST = defs $(TESTS) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = -DIST_SOURCES = DIST_COMMON = ChangeLog Makefile.am Makefile.in -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +DISTFILES = $(DIST_COMMON) $(SOURCES) $(TEXINFOS) $(EXTRA_DIST) GZIP_ENV = --best all: all-redirect diff --git a/tests/gcj2.test b/tests/gcj2.test new file mode 100755 index 00000000..8bf022b3 --- /dev/null +++ b/tests/gcj2.test @@ -0,0 +1,15 @@ +#! /bin/sh + +# Make sure `..' invalid in subdir .o's. + +. $srcdir/defs || exit 1 + +echo 'AC_SUBST(GCJ)' >> configure.in + +cat > Makefile.am << 'END' +bin_PROGRAMS = convert +convert_SOURCES = x/../convert.java +END + +$AUTOMAKE && exit 1 +exit 0