automake-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-commit] [SCM] GNU Automake branch, maint, updated. v1.11-650-g


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, maint, updated. v1.11-650-g12dc0ec
Date: Mon, 16 Jan 2012 15:53:17 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=12dc0ec5e3c7e1a12569d5cfdbb8ceaa5a5f5f58

The branch, maint has been updated
       via  12dc0ec5e3c7e1a12569d5cfdbb8ceaa5a5f5f58 (commit)
       via  3da9c4c757ff0b6b1df0daf36a8a12274292a9e1 (commit)
      from  068b2f53579c55365b67619dce4685066cd70a60 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 12dc0ec5e3c7e1a12569d5cfdbb8ceaa5a5f5f58
Author: Stefano Lattarini <address@hidden>
Date:   Mon Jan 16 16:42:25 2012 +0100

    vala: avoid potential useless remakes (minor bugfix)
    
    * automake.in (lang_vala_finish_target): Ensure the timestamp file
    from which the C files generated from Vala sources depend on gets
    created with a modification time that is truly older than those of
    said generated C files.  This prevents make from attempting useless
    rebuilds (which were bound to happen deterministically on systems
    with sub-second timestamp resolutions).  It is worth noting that,
    luckily, those useless rebuild ended up being a no-op, since the
    Vala compiler is careful not to update the timestamp of an output
    file if its content has not changed from the previous version.
    Still, the useless rebuilds messed up "make -q" and "make -n"
    invocations, and were technically incorrect (despite being, as
    noted, inoffensive in practice).
    
    Problem revealed by failure of tests vala-mix.test and vala5.test
    on a fast Solaris 10 system whose filesystem had a sub-second
    timestamp resolution.

commit 3da9c4c757ff0b6b1df0daf36a8a12274292a9e1
Author: Stefano Lattarini <address@hidden>
Date:   Mon Jan 16 15:38:56 2012 +0100

    vala: enhance tests
    
    * tests/vala.test: Extend test.  Throw in some cosmetic and
    consistency changes since we are at it.
    * tests/vala5.test: Avoid uselessly requiring libtool.  Ensure a
    failure happens in case VALAFLAGS are not supported as expected.
    Extend test in some ways.  Throw in some cosmetic and consistency
    changes since we are at it.
    * tests/vala-mix.test: New test.
    * tests/list-of-tests.mk: Add it.

-----------------------------------------------------------------------

Summary of changes:
 automake.in            |    9 +++-
 tests/list-of-tests.mk |    1 +
 tests/vala-mix.test    |  116 ++++++++++++++++++++++++++++++++++++++++++++++++
 tests/vala.test        |   54 +++++++++++++++++-----
 tests/vala5.test       |   48 +++++++++++++-------
 5 files changed, 198 insertions(+), 30 deletions(-)
 create mode 100755 tests/vala-mix.test

diff --git a/automake.in b/automake.in
index eb859e2..50a9d87 100644
--- a/automake.in
+++ b/automake.in
@@ -6077,8 +6077,15 @@ sub lang_vala_finish_target ($$)
 
   $output_rules .=
     "\$(srcdir)/${derived}_vala.stamp: \$(${derived}_SOURCES)\n".
+# Since the C files generated from the vala sources depend on the
+# ${derived}_vala.stamp file, we must ensure its timestamp is older than
+# those of the C files generated by the valac invocation below (this is
+# especially important on systems with sub-second timestamp resolution).
+# Thus we need to create the stamp file *before* invoking valac, and to
+# move it to its final location only after valac has been invoked.
+    "\t${silent}rm -f \$@ && echo stamp > address@hidden".
     "\t${verbose}\$(am__cd) \$(srcdir) && ${compile} \$(${derived}_SOURCES)\n".
-    "\t${silent}touch address@hidden";
+    "\t${silent}mv -f address@hidden address@hidden";
 
   push_dist_common ("${derived}_vala.stamp");
 
diff --git a/tests/list-of-tests.mk b/tests/list-of-tests.mk
index 9d95e18..fd095b3 100644
--- a/tests/list-of-tests.mk
+++ b/tests/list-of-tests.mk
@@ -873,6 +873,7 @@ vala3.test \
 vala4.test \
 vala5.test \
 vala-vpath.test \
+vala-mix.test \
 vars.test \
 vars3.test \
 vartar.test \
diff --git a/tests/vala-mix.test b/tests/vala-mix.test
new file mode 100755
index 0000000..f597a7f
--- /dev/null
+++ b/tests/vala-mix.test
@@ -0,0 +1,116 @@
+#! /bin/sh
+# Copyright (C) 2012 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
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Vala sources and C sources in the same program.  Functional test.
+
+required='cc GNUmake'
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in <<'END'
+AC_PROG_CC
+AM_PROG_CC_C_O
+AM_PROG_VALAC
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+bin_PROGRAMS = zardoz mu
+AM_VALAFLAGS = --profile=posix
+zardoz_SOURCES = foo.vala bar.c
+mu_SOURCES = 1.vala 2.c
+mu_VALAFLAGS = $(AM_VALAFLAGS) --main=run
+mu_CFLAGS = -DHAVE_MU
+END
+
+if cross_compiling; then :; else
+  unindent >> Makefile.am <<'END'
+    check-local:
+       ./zardoz
+       ./mu
+       ./zardoz | grep "foo is alive"
+       ./mu | grep "Howdy, World!"
+END
+fi
+
+cat > foo.vala <<'END'
+int main ()
+{
+  stdout.printf ("foo is alive\n");
+  return 0;
+}
+END
+
+echo 'extern int i = 0;' > bar.c
+
+cat > 1.vala <<'END'
+int run ()
+{
+  stdout.printf ("Howdy, World!\n");
+  return 0;
+}
+END
+
+cat > 2.c <<'END'
+#ifdef HAVE_MU
+int all_is_ok = 1;
+#else
+#error "HAVE_MU no defined"
+chocke me
+#endif
+END
+
+$ACLOCAL
+$AUTOMAKE -a
+$AUTOCONF
+
+./configure
+
+$MAKE all
+ls -l # For debugging.
+$MAKE check
+
+have_generated_files ()
+{
+  test -f mu_vala.stamp
+  test -f zardoz_vala.stamp
+  test -f foo.c
+  test -f 1.c
+}
+
+# Our vala-related rules must create stamp files and intermediate
+# C files.
+have_generated_files
+
+$MAKE -q
+$MAKE -n | grep stamp && Exit 1
+
+# Check the distribution.
+$MAKE distcheck
+
+# Stamp files and intermediate C files should *not* be removed
+# by "make clean".
+$MAKE clean
+have_generated_files
+
+# But stamp files should be removed by "maintainer-clean" (the
+# behaviour w.r.t. intermediate C files is still unclear, and
+# better left undefined for the moment).
+$MAKE maintainer-clean
+ls *vala*.stamp | grep . && Exit 1
+
+:
diff --git a/tests/vala.test b/tests/vala.test
index 3e9ae36..442661d 100755
--- a/tests/vala.test
+++ b/tests/vala.test
@@ -1,6 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1996, 2001, 2002, 2006, 2008, 2009
-# Free Software Foundation, Inc.
+# Copyright (C) 1996, 2001, 2002, 2006, 2008, 2009, 2012 Free Software
+# Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -19,21 +19,30 @@
 # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 # Boston, MA 02110-1301, USA.
 
-# Test to make sure intermediate .c files are built from vala source.
+# Basic "grepping" test on vala support.
 
-required="libtool"
 . ./defs || Exit 1
 
 set -e
 
-cat >> 'configure.in' << 'END'
+# So that we won't require libtool macros.
+cat > acinclude.m4 <<'END'
+AC_DEFUN([AC_PROG_LIBTOOL],
+         [AC_SUBST([LIBTOOL], [:])])
+END
+
+cat >> configure.in <<'END'
 AC_PROG_CC
+AC_PROG_CXX
 AC_PROG_LIBTOOL
 AM_PROG_VALAC
+AC_CONFIG_FILES([sub/Makefile])
 AC_OUTPUT
 END
 
-cat > 'Makefile.am' <<'END'
+cat > Makefile.am <<'END'
+SUBDIRS = sub
+
 bin_PROGRAMS = zardoz
 zardoz_SOURCES = zardoz.vala
 zardoz_VALAFLAGS = --debug
@@ -42,6 +51,13 @@ lib_LTLIBRARIES = libzardoz.la
 libzardoz_la_SOURCES = zardoz-foo.vala zardoz-bar.vala
 END
 
+mkdir sub
+
+cat > sub/Makefile.am <<'END'
+bin_PROGRAMS = foo
+foo_SOURCES = bar.vala baz.vala mu.c zap.cxx
+END
+
 : > ltmain.sh
 : > config.sub
 : > config.guess
@@ -49,11 +65,23 @@ END
 $ACLOCAL
 $AUTOMAKE -a
 
-grep 'VALAC' Makefile.in
-grep 'am_zardoz_OBJECTS' Makefile.in
-grep 'am_libzardoz_la_OBJECTS' Makefile.in
-grep 'zardoz_vala.stamp' Makefile.in
-grep 'libzardoz_la_vala.stamp' Makefile.in
-grep 'zardoz\.c' Makefile.in
-grep 'zardoz-foo\.c' Makefile.in
+grep '\$(VALAC).* \$(AM_VALAFLAGS) \$(VALAFLAGS) ' Makefile.in
+grep '\$(VALAC).* \$(zardoz_VALAFLAGS) \$(VALAFLAGS) ' Makefile.in
+$FGREP 'am_zardoz_OBJECTS' Makefile.in
+$FGREP 'am_libzardoz_la_OBJECTS' Makefile.in
+$FGREP 'zardoz_vala.stamp:' Makefile.in
+$FGREP 'libzardoz_la_vala.stamp:' Makefile.in
+test `$FGREP -c '.stamp:' Makefile.in` -eq 2
+$FGREP 'zardoz.c' Makefile.in
+$FGREP 'zardoz-foo.c' Makefile.in
+$FGREP 'zardoz-bar.c' Makefile.in
+
+grep '\$(VALAC).* \$(AM_VALAFLAGS) \$(VALAFLAGS) ' sub/Makefile.in
+$FGREP 'foo_VALAFLAGS' sub/Makefile.in && Exit 1
+$FGREP 'am_foo_OBJECTS' sub/Makefile.in
+$FGREP 'bar.c' sub/Makefile.in
+$FGREP 'baz.c' sub/Makefile.in
+$FGREP 'foo_vala.stamp:' sub/Makefile.in
+test `$FGREP -c '.stamp:' sub/Makefile.in` -eq 1
 
+:
diff --git a/tests/vala5.test b/tests/vala5.test
index 8fc703c..2206b25 100755
--- a/tests/vala5.test
+++ b/tests/vala5.test
@@ -1,6 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1996, 2001, 2002, 2006, 2008, 2009
-# Free Software Foundation, Inc.
+# Copyright (C) 1996, 2001, 2002, 2006, 2008, 2009, 2012 Free Software
+# Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -21,54 +21,70 @@
 
 # Test per-target flags.
 
-required="libtool libtoolize pkg-config valac gcc GNUmake"
+required="pkg-config valac gcc GNUmake"
 . ./defs || Exit 1
 
 set -e
 
 mkdir src
 
-cat >> 'configure.in' << 'END'
+cat >> configure.in <<'END'
 AC_PROG_CC
 AM_PROG_CC_C_O
-AC_PROG_LIBTOOL
 AM_PROG_VALAC([0.7.0])
-PKG_CHECK_MODULES([GOBJECT],[gobject-2.0 >= 2.10])
+PKG_CHECK_MODULES([GOBJECT], [gobject-2.0 >= 2.10])
 AC_CONFIG_FILES([src/Makefile])
 AC_OUTPUT
 END
 
-cat > 'Makefile.am' <<'END'
+cat > Makefile.am <<'END'
 SUBDIRS = src
 END
 
-cat > 'src/Makefile.am' <<'END'
+cat > src/Makefile.am <<'END'
 bin_PROGRAMS = foo bar
 foo_CFLAGS = $(GOBJECT_CFLAGS)
 foo_LDADD = $(GOBJECT_LIBS)
-foo_SOURCES = baz.vala
-bar_SOURCES = baz.vala
+foo_SOURCES = xfoo.vala
+bar_SOURCES = xbar.vala
 bar_VALAFLAGS = -D BAR
 bar_CFLAGS = $(GOBJECT_CFLAGS)
 bar_LDADD = $(GOBJECT_LIBS)
 END
 
-cat > 'src/baz.vala' <<'END'
-void main () {
+cat > src/xfoo.vala <<'END'
+int main ()
+{
+  stdout.printf ("foo\n");
+  return 0;
+}
+END
+
+cat > src/xbar.vala <<'END'
+void main ()
+{
 #if BAR
   stdout.printf ("bar\n");
 #else
-  stdout.printf ("foo\n");
+  stdout.oops_an_invalid_method ();
 #endif
 }
 END
 
-libtoolize
-
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 
-./configure || Exit 77
+grep PKG_CHECK_MODULES configure && skip_ "pkg-config m4 macros not found"
+
+./configure
 $MAKE
 
+if cross_compiling; then :; else
+  ./src/foo
+  ./src/bar
+  test `./src/foo` = foo
+  test `./src/bar` = bar
+fi
+
+:


hooks/post-receive
-- 
GNU Automake



reply via email to

[Prev in Thread] Current Thread [Next in Thread]