osdir.com
mailing list archive

Subject: stamp and subdirectories - msg#00062

List: sysutils.automake.patches

Date: Prev Next Index Thread: Prev Next Index
To me, looks like the stamp cleaning code hasn't been kept
synchronized with the code that create stamp files.

Is it ok to supress the warning about stamp-h in AC_OUTPUT?

2002-04-26 Alexandre Duret-Lutz <duret_g@xxxxxxxx>

Erase stamps from the Makefile that generates them.

* automake.in (handle_configure): Append each used stamp to
@distclean_config. Don't warn about stamp-h in AC_OUTPUT, this
file is not used anymore.
* lib/am/clean.am (distclean-generic): Don't erase stamp-h and
stamp-h[0-9]*.
* tests/subdir6.test: New file.
* tests/Makefile.am (TESTS): Add it.

Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1287.2.5
diff -u -r1.1287.2.5 automake.in
--- automake.in 25 Apr 2002 16:47:28 -0000 1.1287.2.5
+++ automake.in 26 Apr 2002 17:24:36 -0000
@@ -3998,7 +3998,7 @@
'CONFIG_H_PATH' => $config_h_path,
'STAMP' => "$stamp"));

- push @distclean_config, $cn_sans_dir;
+ push @distclean_config, $cn_sans_dir, $stamp;
}
}

@@ -4085,17 +4085,6 @@
{
next;
}
- }
-
- # Some users have been tempted to put `stamp-h' in the
- # AC_OUTPUT line. This won't do the right thing, so we
- # explicitly fail here.
- if ($local eq 'stamp-h')
- {
- # FIXME: allow real filename.
- file_error ($ac_config_files_location,
- 'stamp-h should not appear in AC_OUTPUT');
- next;
}

my @rewritten_inputs = rewrite_inputs_into_dependencies (1, @inputs);
Index: lib/am/clean.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/clean.am,v
retrieving revision 1.40
diff -u -r1.40 clean.am
--- lib/am/clean.am 17 May 2001 03:02:38 -0000 1.40
+++ lib/am/clean.am 26 Apr 2002 17:24:38 -0000
@@ -29,7 +29,7 @@

distclean-am: distclean-generic clean-am
distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
?DISTCLEAN? -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)

maintainer-clean-am: maintainer-clean-generic distclean-am
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.385.2.6
diff -u -r1.385.2.6 Makefile.am
--- tests/Makefile.am 25 Apr 2002 07:55:52 -0000 1.385.2.6
+++ tests/Makefile.am 26 Apr 2002 17:24:38 -0000
@@ -312,6 +312,7 @@
subdir3.test \
subdir4.test \
subdir5.test \
+subdir6.test \
subdirbuiltsources.test \
subdircond.test \
subobj.test \
Index: tests/Makefile.in
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.in,v
retrieving revision 1.499.2.9
diff -u -r1.499.2.9 Makefile.in
--- tests/Makefile.in 25 Apr 2002 07:55:53 -0000 1.499.2.9
+++ tests/Makefile.in 26 Apr 2002 17:24:39 -0000
@@ -388,6 +388,7 @@
subdir3.test \
subdir4.test \
subdir5.test \
+subdir6.test \
subdirbuiltsources.test \
subdircond.test \
subobj.test \
@@ -580,7 +581,7 @@
clean-generic:

distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)

maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
Index: tests/subdir6.test
===================================================================
RCS file: tests/subdir6.test
diff -N tests/subdir6.test
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/subdir6.test 26 Apr 2002 17:24:39 -0000
@@ -0,0 +1,27 @@
+#! /bin/sh
+
+# Test to make sure config headers in subdirectories are cleaned.
+
+. $srcdir/defs || exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AM_CONFIG_HEADER([sub/config.h:sub/config.hin])
+AC_OUTPUT
+END
+
+touch Makefile.am
+mkdir sub
+
+$ACLOCAL
+$AUTOCONF
+touch sub/config.hin
+$AUTOMAKE
+./configure
+test -f sub/stamp-h1
+$MAKE clean
+test -f sub/stamp-h1
+$MAKE distclean
+test -f sub/stamp-h1 && exit 1
+:

--
Alexandre Duret-Lutz





Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

Re: FYI: depout.m4 adjustment for post-processed Makefile.ins

>>>>> "adl" == Alexandre Duret-Lutz <duret_g@xxxxxxxxxxxxx> writes: adl> - Debian Bug#144221: dejagnu.am build site.exp and site.bak, and never adl> erase these files. Hence `make distcheck' always fails. I wrote a patch. I don't have a test case though. What do you think? I was undecided whether I should start using the new naming scheme ("am--distclean-dejagnu") or whether to keep using the old scheme and just plan a big rename in the future. Tom Index: ChangeLog from Tom Tromey <tromey@xxxxxxxxxx> * lib/am/dejagnu.am (distclean-DEJAGNU): New target. Index: lib/am/dejagnu.am =================================================================== RCS file: /cvs/automake/automake/lib/am/dejagnu.am,v retrieving revision 1.16 diff -u -r1.16 dejagnu.am --- lib/am/dejagnu.am 2 Oct 2001 16:00:03 -0000 1.16 +++ lib/am/dejagnu.am 26 Apr 2002 17:16:27 -0000 @@ -94,3 +94,15 @@ @-rm -f site.bak @test ! -f site.exp || mv site.exp site.bak @mv site.tmp site.exp + +## ---------- ## +## Cleaning. ## +## ---------- ## + +.PHONY distclean-am: distclean-DEJAGNU + +distclean-DEJAGNU: +## Any other cleaning must be done by the user or by the test suite +## itself. We can't predict what dejagnu or the test suite might +## generate. + -rm -f site.exp site.bak

Next Message by Date: click to view message preview

Re: FYI: depout.m4 adjustment for post-processed Makefile.ins

>>> "Tom" == Tom Tromey <tromey@xxxxxxxxxx> writes: [...] Tom> I was undecided whether I should start using the new Tom> naming scheme ("am--distclean-dejagnu") or whether to keep Tom> using the old scheme and just plan a big rename in the Tom> future. I'm all for doing a "big rename party" in the future, once the activity on branch-1-6 has lessened. [...] -- Alexandre Duret-Lutz

Previous Message by Thread: click to view message preview

FYI: man2.test portability tweak

2002-04-26 Alexandre Duret-Lutz <duret_g@xxxxxxxx> * tests/man2.test: Use `pwd`, not $PWD. Use $MAKE -e. Index: tests/man2.test =================================================================== RCS file: /cvs/automake/automake/tests/man2.test,v retrieving revision 1.1.2.1 diff -u -r1.1.2.1 man2.test --- tests/man2.test 13 Apr 2002 21:52:18 -0000 1.1.2.1 +++ tests/man2.test 26 Apr 2002 15:54:37 -0000 @@ -24,7 +24,7 @@ # Let's play with $DESTDIR too, it shouldn't hurt. ./configure --prefix='' -$MAKE DESTDIR=$PWD/=inst install +DESTDIR="`pwd`/=inst" $MAKE -e SHELL=/bin/sh install test -f ./=inst/man/man2/foo.2 test -f ./=inst/man/man4/foo.4 -- Alexandre Duret-Lutz

Next Message by Thread: click to view message preview

[ryants@xxxxxxx: msvisualcpp-cpp: New depmode]

It's been over a month since I sent this and I haven't heard anything back. Resubmitting for your consideration. ----- Forwarded message from "Ryan T. Sammartino" <ryants@xxxxxxx> ----- From: "Ryan T. Sammartino" <ryants@xxxxxxx> Subject: msvisualcpp-cpp: New depmode Date: Sat, 23 Mar 2002 20:09:42 -0800 Message-ID: <20020324040942.GA4293@localhost> User-Agent: Mutt/1.3.27i X-Mailer: Mutt http://www.mutt.org/ To: automake-patches@xxxxxxx Mail-Followup-To: "Ryan T. Sammartino" <ryants@xxxxxxx>, automake-patches@xxxxxxx This patch adds a new depmode called "msvisualcpp-cpp". This depmode uses Cygwin/GNU's /usr/bin/cpp to compute dependencies while cl.exe does the compiling. This is way faster than running cygpath -u on cl.exe -E's output, and avoids the problems outlined in http://sources.redhat.com/ml/automake/2001-12/msg00012.html. However, I'm doing a few things that perhaps aren't so cool... some input is requested. As you can see, I test to see if cpp fails by checking if $tmpdepfile actually got created; if not, I dump the output from cpp's stderr. Is the 2>cppstderr ok? Is there a better way to do this? You will also note that I pass -w -D_WIN32 -D_M_IX86 to cpp. Is there anything else I need to pass? I thought I might have needed to set _MSC_VER, but in my (limited) testing it didn't seem to make a difference. Is -w (inhibit warnings) a good idea? MS Visual Studio header files produce so many preprocessor warnings that it is impossible to wade through them all to find the errors, so I just turn off the warnings. Another thing to note is that I create the "missing header file" section a little differently than the gcc) depmod does. The "tr ' ' ' '" thing does not work correctly for lines that look like (e.g.): c:/Program\ Files/Microsoft\ Visual\ Studio/.... \ so instead I use a sed script to break on spaces that aren't followed by \. Anyways, look it over and let me know what you think. CC:'s on replies appreciated. 23-03-2002 Ryan T. Sammartino <ryants@xxxxxxx> * lib/depcomp (msvisualcpp-cpp): new depmode that uses Cygwin cpp to compute dependencies instead of cl.exe -E Index: lib/depcomp =================================================================== RCS file: /cvs/automake/automake/lib/depcomp,v retrieving revision 1.31 diff -u -3 -b -r1.31 depcomp --- depcomp 2002/02/19 19:11:50 1.31 +++ depcomp 2002/03/24 04:02:11 @@ -422,6 +422,71 @@ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; + +msvisualcpp-cpp) + # Use Cygwin cpp to compute dependencies, cl.exe to compile. + ( + shift + cleared=no + for arg in "$@" ; do + case $cleared in no) + set ""; shift + cleared=yes + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg" ; shift ;; + /D*|/I*) + # Change /D and /I to -D and -I + foo=$(echo $arg | sed 's/\/\([DI]\)/-\1/') + set fnord "$@" "$foo" ; shift ;; + -*|/*|"$object"|"$source") + # Delete these from list of arguments + ;; + *) + set fnord "$@" "$arg" ; shift ;; + esac + done + rm -f "$tmpdepfile" + ${CPP-cpp} "$@" "-w" "-D_WIN32" "-D_M_IX86" "-Wp,-MD,$tmpdepfile" "$source" 2>cppstderr >/dev/null + if test -e "$tmpdepfile" ; then + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz + ## The second -e expression handles DOS-style file names with + ## drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" + ## This next piece of magic avoids the `deleted header file' problem. + ## The problem is that when a header file which appears in a .P file + ## is deleted, the dependency causes make to die (because there is + ## typically no way to rebuild the header). We avoid this by adding + ## dummy dependencies for each header file. Too bad cpp doesn't do + ## this for us directly. + sed -e 's/\([^\\] \)/\1\ +/' -e 's/^ \+//' -e 's/\\$//' < "$tmpdepfile" | + ## Some versions of gcc put a space before the `:'. On the theory + ## that the space means something, we add a space to the output as + ## well. + ## Some versions of the HPUX 10.20 sed can't process this invocation + ## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/: *$/d' -e 's/ \+$//' | sed -e 's/$/:/' >> "$depfile" + rm -f "$tmpdepfile" + else + rm -f "$depfile" + echo "$object : $source" > "$depfile" + echo "${CPP-cpp}: warning: failed to compute dependencies for $object" + echo "${CPP-cpp}: $(cat cppstderr)" + fi + rm -f cppstderr + ) & + proc=$! + "$@" + stat=$? + wait "$proc" + if test "$stat" != 0 ; then exit $stat; fi + ;; + none) exec "$@" -- Ryan T. Sammartino http://members.shaw.ca/ryants/ The human brain is a wonderful thing. It starts working the moment you are born, and never stops until you stand up to speak in public. -- Sir George Jessel ----- End forwarded message ----- -- Ryan T. Sammartino http://members.shaw.ca/ryants/ Murphy's Law is recursive. Washing your car to make it rain doesn't work.
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by