From: Tom Tromey Date: Mon, 23 Feb 1998 23:49:39 +0000 (+0000) Subject: dependency fixes from alexandre oliva X-Git-Tag: Release-1-2g~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cb1f004a855c4ed1ec8b41d16eb07d4096acd454;p=thirdparty%2Fautomake.git dependency fixes from alexandre oliva --- diff --git a/ChangeLog b/ChangeLog index 3f3a2a881..cb698488c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ Mon Feb 23 13:38:56 1998 Tom Tromey + * automake.in (get_object_extension): Remove .c.lo rule from + libtool when dependencies turned on. + * libtool.am (.c.lo): Disable when dependency checking turned on. + + Dependency fixes from Alexandre Oliva: + * automake.in (handle_dependencies): Fixed quoting when + substituting @PFX@ and @EXT@. Don't look for the `.P' file. + * depend2.am (%.o): Use @PFX@ and @EXT@. + (%.lo): New rule. + * texinfos.am (.txi.info, .txi.dvi, .txi): New rules. * automake.in (handle_texinfo): Recognize .txi files. From Karl Berry. diff --git a/automake.in b/automake.in index 47ef8167e..0a557d79a 100755 --- a/automake.in +++ b/automake.in @@ -774,7 +774,11 @@ sub get_object_extension if ($seen_libtool && ! $included_libtool_compile) { # Output the libtool compilation rules. - $output_rules .= &file_contents ('libtool'); + $output_rules .= + &file_contents_with_transform + ($use_dependencies ? 's/^NOTDEPEND.*$//;' : 's/^NOTDEPEND//;', + 'libtool'); + &push_phony_cleaners ('libtool'); push (@suffixes, '.lo'); @@ -2770,21 +2774,17 @@ sub handle_dependencies $output_rules .= &file_contents ('depend'); push (@clean, 'depend'); &push_phony_cleaners ('depend'); - # FIXME: should use @EXT@ and @PFX@. I don't know why it - # didn't work. $output_rules .= - &file_contents_with_transform ('s/EXT/.c/g;' - . 's/PFX//g;', + &file_contents_with_transform ('s/\@EXT\@/.c/g;' + . 's/\@PFX\@//g;', 'depend2'); local ($ext); local ($need_cxx) = 0; foreach $ext (sort keys %cxx_extensions) { - # FIXME: should use @EXT@ and @PFX@. I don't know why - # it didn't work. $output_rules .= - &file_contents_with_transform ('s/EXT/' . $ext .'/g;' - . 's/PFX/CXX/g;', + &file_contents_with_transform ('s/\@EXT\@/' . $ext .'/g;' + . 's/\@PFX\@/CXX/g;', 'depend2'); $need_cxx = 1; } @@ -2798,8 +2798,7 @@ sub handle_dependencies { # Include any auto-generated deps that are present. Note that # $build_directory ends in a "/". - if (-d ($build_directory . $relative_dir . "/.deps") - && -f ($build_directory . $relative_dir . "/.deps/.P")) + if (-d ($build_directory . $relative_dir . "/.deps")) { local ($depfile); diff --git a/depend2.am b/depend2.am index 48cdd18e4..4048f26f2 100644 --- a/depend2.am +++ b/depend2.am @@ -15,14 +15,24 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## FIXME: should use @EXT@, but that didn't work. -%.o: %EXT -## FIXME: should use @PFX@, but that didn't work. - @echo '$(PFXCOMPILE) -c $<'; \ +%.o: %@EXT@ + @echo '$(@PFX@COMPILE) -c $<'; \ DEPENDENCIES_OUTPUT='.deps/$(*F).P'; \ export DEPENDENCIES_OUTPUT; \ ## Note that using DEPENDENCIES_OUTPUT causes gcc to append to the ## named file. So we truncate it explicitly. : > .deps/$(*F).P; \ -## FIXME: should use @PFX@, but that didn't work. - $(PFXCOMPILE) -c $< + $(@PFX@COMPILE) -c $< + +%.lo: %@EXT@ + @echo '$(LT@PFX@COMPILE) -c $<'; \ + DEPENDENCIES_OUTPUT='.deps/$(*F).p'; \ + export DEPENDENCIES_OUTPUT; \ +## Note that using DEPENDENCIES_OUTPUT causes gcc to append to the +## named file. So we truncate it explicitly. + : > .deps/$(*F).p; \ + $(LT@PFX@COMPILE) -c $< + @-sed -e 's/^\([^:]*\)\.o:/\1.lo \1.o:/' < .deps/$(*F).p | \ + $(AWK) '/:/ { ignore = ++ignoring[$$1]; } ignore == 1 { print }' \ + > .deps/$(*F).P + @-rm -f .deps/$(*F).p diff --git a/lib/am/depend2.am b/lib/am/depend2.am index 48cdd18e4..4048f26f2 100644 --- a/lib/am/depend2.am +++ b/lib/am/depend2.am @@ -15,14 +15,24 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## FIXME: should use @EXT@, but that didn't work. -%.o: %EXT -## FIXME: should use @PFX@, but that didn't work. - @echo '$(PFXCOMPILE) -c $<'; \ +%.o: %@EXT@ + @echo '$(@PFX@COMPILE) -c $<'; \ DEPENDENCIES_OUTPUT='.deps/$(*F).P'; \ export DEPENDENCIES_OUTPUT; \ ## Note that using DEPENDENCIES_OUTPUT causes gcc to append to the ## named file. So we truncate it explicitly. : > .deps/$(*F).P; \ -## FIXME: should use @PFX@, but that didn't work. - $(PFXCOMPILE) -c $< + $(@PFX@COMPILE) -c $< + +%.lo: %@EXT@ + @echo '$(LT@PFX@COMPILE) -c $<'; \ + DEPENDENCIES_OUTPUT='.deps/$(*F).p'; \ + export DEPENDENCIES_OUTPUT; \ +## Note that using DEPENDENCIES_OUTPUT causes gcc to append to the +## named file. So we truncate it explicitly. + : > .deps/$(*F).p; \ + $(LT@PFX@COMPILE) -c $< + @-sed -e 's/^\([^:]*\)\.o:/\1.lo \1.o:/' < .deps/$(*F).p | \ + $(AWK) '/:/ { ignore = ++ignoring[$$1]; } ignore == 1 { print }' \ + > .deps/$(*F).P + @-rm -f .deps/$(*F).p diff --git a/lib/am/libtool.am b/lib/am/libtool.am index c4a3b159c..e748cc733 100644 --- a/lib/am/libtool.am +++ b/lib/am/libtool.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. +## Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -15,10 +15,10 @@ ## 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: +NOTDEPEND.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. - $(LIBTOOL) --mode=compile $(COMPILE) -c $< +NOTDEPEND $(LIBTOOL) --mode=compile $(COMPILE) -c $< ## These are just copies of the above rule. .s.lo: diff --git a/libtool.am b/libtool.am index c4a3b159c..e748cc733 100644 --- a/libtool.am +++ b/libtool.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. +## Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -15,10 +15,10 @@ ## 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: +NOTDEPEND.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. - $(LIBTOOL) --mode=compile $(COMPILE) -c $< +NOTDEPEND $(LIBTOOL) --mode=compile $(COMPILE) -c $< ## These are just copies of the above rule. .s.lo: