From: Alexandre Oliva Date: Sun, 25 Apr 1999 15:13:01 +0000 (+0000) Subject: * libtool.am: Do not emit .c.lo here... X-Git-Tag: user-dep-gen-merge-branchpoint~15 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=64615b9cd4693dc494f1a911edf765f0a63230f1;p=thirdparty%2Fautomake.git * libtool.am: Do not emit .c.lo here... * depend2.am: ... emit .*.lo here, only when using libtool. * automake.in (get_object_extension): No more @MINUSO@ here. (handle_single_transform_list): Set $depfile from $object. (handle_dependencies): Emit depend2.am for all used languages, regardless of $use_dependencies; the setting of depcomp makes the difference. (lang_cxx_finish): Do not emit compilation rules. (lang_objc_finish): Likewise. (lang_java_finish): Likewise. --- diff --git a/ChangeLog b/ChangeLog index 7bbbb89dd..9d41dbbdd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +1999-04-25 Alexandre Oliva + + * libtool.am: Do not emit .c.lo here... + * depend2.am: ... emit .*.lo here, only when using libtool. + * automake.in (get_object_extension): No more @MINUSO@ here. + (handle_single_transform_list): Set $depfile from $object. + (handle_dependencies): Emit depend2.am for all used languages, + regardless of $use_dependencies; the setting of depcomp makes the + difference. + (lang_cxx_finish): Do not emit compilation rules. + (lang_objc_finish): Likewise. + (lang_java_finish): Likewise. + 1999-04-21 Tom Tromey * m4/depout.m4 (AM_OUTPUT_DEPENDENCY_COMMANDS): Correctly diff --git a/automake.in b/automake.in index b2387c236..8745b4952 100755 --- a/automake.in +++ b/automake.in @@ -753,10 +753,7 @@ sub get_object_extension # Note that order of transforms is important here. We collude # with compile.am to get the right result. - $xform = (($seen_objext ? 's/^OBJEXT//;' : 's/^OBJEXT.*$//;') - . 's/\@MINUSO\@/' - . (defined $options{'subdir-objects'} ? '-o \$\@' : '') - . '/;'); + $xform = ($seen_objext ? 's/^OBJEXT//;' : 's/^OBJEXT.*$//;'); $output_rules .= &file_contents_with_transform ($xform, 'compile'); &push_phony_cleaners ('compile'); @@ -1149,7 +1146,7 @@ sub handle_single_transform_list # Transform .o or $o file into .P file (for automatic # dependency code). - local ($depfile) = $xbase; + local ($depfile) = $object; $depfile =~ s/\.([^.]*)$/.P\1/; $dep_files{'$(DEPDIR)/' . $depfile} = 1; } @@ -2653,34 +2650,40 @@ sub handle_dependencies $output_rules .= &file_contents ('depend'); push (@clean, 'depend'); &push_phony_cleaners ('depend'); - - local ($key, $lang, $ext, $xform); - foreach $key (sort keys %language_map) - { - next unless $key =~ /^(.*)-autodep$/; - next if $language_map{$key} eq 'no'; - $lang = $1; - - local ($pfx, $fpfx) = ($language_map{$key}, 'CC'); - $fpfx = $pfx if ($pfx ne ''); - - $xform = ('s/\@PFX\@/' . $pfx . '/g;' - . 's/\@FPFX\@/' . $fpfx . '/g;'); - foreach $ext (&lang_extensions ($lang)) - { - $output_rules .= - &file_contents_with_transform ('s/\@EXT\@/' - . $ext . '/g;' - . $xform, - 'depend2'); - } - } } } else { &define_variable ('depcomp', ''); } + + local ($key, $lang, $ext, $xform); + foreach $key (sort keys %language_map) + { + next unless $key =~ /^(.*)-autodep$/; + next if $language_map{$key} eq 'no'; + $lang = $1; + + local ($pfx, $fpfx) = ($language_map{$key}, 'CC'); + $fpfx = $pfx if ($pfx ne ''); + + $xform = ('s/\@PFX\@/' . $pfx . '/g;' + . 's/\@FPFX\@/' . $fpfx . '/g;'); + foreach $ext (&lang_extensions ($lang)) + { + $output_rules .= + &file_contents_with_transform + (($seen_objext ? 's/^OBJEXT//;' : 's/^OBJEXT.*$//;') + . ($seen_libtool ? 's/^LIBTOOL//;' : 's/^LIBTOOL.*$//;') + . 's/\@MINUSO\@/' + . (defined $options{'subdir-objects'} ? ' -o \$\@' : '') + . '/;' + . 's/\@EXT\@/' + . $ext . '/g;' + . $xform, + 'depend2'); + } + } } # Handle subdirectories. @@ -4646,21 +4649,6 @@ sub lang_cxx_finish &define_variable ('CXXLD', '$(CXX)'); &define_variable ('CXXLINK', $ltlink . '$(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@'); - local ($ext); - foreach $ext (@cxx_list) - { - # Every known C++ compiler supports both -c and -o. - $output_rules .= ("$ext.o:\n" - . "\t\$(CXXCOMPILE) -c -o \$\@ \$<\n"); - # FIXME: Using cygpath should be somehow conditional. - $output_rules .= ("$ext.obj:\n" - . "\t\$(CXXCOMPILE) -c -o \$\@ `cygpath -w \$<`\n") - if ($seen_objext); - $output_rules .= ("$ext.lo:\n" - . "\t\$(LTCXXCOMPILE) -c -o \$\@ \$<\n") - if ($seen_libtool); - } - if (! defined $configure_vars{'CXX'}) { &am_error ("C++ source seen but \`CXX' not defined in \`configure.in'"); @@ -4975,17 +4963,6 @@ sub lang_objc_finish &define_variable ('OBJCLD', '$(OBJC)'); &define_variable ('OBJCLINK', $ltlink . '$(OBJCLD) $(AM_OBJCFLAGS) $(OBJCFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@'); - # All known ObjC compilers support -c and -o together. - $output_rules .= (".m.o:\n" - . "\t\$(OBJCCOMPILE) -c -o \$\@ \$<\n"); - # FIXME: Using cygpath should be somehow conditional. - $output_rules .= (".m.obj:\n" - . "\t\$(OBJCCOMPILE) -c -o \$\@ `cygpath -w \$<`\n") - if ($seen_objext); - $output_rules .= (".m.lo:\n" - . "\t\$(LTOBJCCOMPILE) -c -o \$\@ \$<\n") - if ($seen_libtool); - if (! defined $configure_vars{'OBJC'}) { &am_error ("Objective C source seen but \`OBJC' not defined in \`configure.in'"); @@ -5005,17 +4982,6 @@ sub lang_java_finish &define_variable ('GCJLD', '$(GCJ)'); &define_variable ('GCJLINK', $ltlink . '$(GCJLD) $(AM_GCJFLAGS) $(GCJFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@'); - # All known Java compilers support -c and -o together. - $output_rules .= (".java.o:\n" - . "\t\$(GCJCOMPILE) -c -o \$\@ \$<\n"); - # FIXME: Using cygpath should be somehow conditional. - $output_rules .= (".java.obj:\n" - . "\t\$(GCJCOMPILE) -c -o \$\@ `cygpath -w \$<`\n") - if ($seen_objext); - $output_rules .= (".java.lo:\n" - . "\t\$(LTGCJCOMPILE) -c -o \$\@ \$<\n") - if ($seen_libtool); - if (! defined $configure_vars{'GCJ'}) { &am_error ("Java source seen but \`GCJ' not defined in \`configure.in'"); diff --git a/depend2.am b/depend2.am index 07fd5b49a..cb61894a3 100644 --- a/depend2.am +++ b/depend2.am @@ -27,10 +27,11 @@ source='$<' object='$@' depfile='$(DEPDIR)/$*.Po' $(@FPFX@DEPMODE) \ $(depcomp) $(@PFX@COMPILE) -c@MINUSO@ $< -@EXT@.lo: - source='$<' object='$@' depfile='$(DEPDIR)/$*.Plo' $(@FPFX@DEPMODE) \ - $(depcomp) $(LT@PFX@COMPILE) -c@MINUSO@ $< +LIBTOOL@EXT@.lo: +LIBTOOL source='$<' object='$@' depfile='$(DEPDIR)/$*.Plo' $(@FPFX@DEPMODE) \ +LIBTOOL $(depcomp) $(LT@PFX@COMPILE) -c@MINUSO@ $< OBJEXT@EXT@.obj: OBJEXT source='$<' object='$@' depfile='$(DEPDIR)/$*.Pobj' $(@FPFX@DEPMODE) \ OBJEXT $(depcomp) $(@PFX@COMPILE) -c@MINUSO@ `cygpath -w $<` + diff --git a/libtool.am b/libtool.am index 299c1a954..505422509 100644 --- a/libtool.am +++ b/libtool.am @@ -15,11 +15,6 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -.c.lo: -## Note that we explicitly set the libtool mode. This avoids any lossage -## if the program doesn't have a name that libtool expects. - source=$< object=$@ depfile=$(DEPDIR)/$*.Plo $(CCDEPMODE) \ - $(depcomp) $(LIBTOOL) --mode=compile $(COMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo