On Apr 8, 2010, at 5:02 PM, ext Bruno Haible wrote: > Trying to reproduce Jarno's errors, I added into some package that is > using "gnulib-tool --with-tests" > 1. vasnprintf but not vasnprintf-posix, > 2. round (any one of ceilf, floorf, roundf, round, truncf, trunc), > and got this error after running > $ gnulib-tool --import round vasnprintf > $ autoreconf > missing file gnulib/tests/vasnprintf.c > configure.ac:32: error: expected source file, required through > AC_LIBSOURCES, not found > gnulib/m4/gnulib-comp.m4:160: gl_INIT is expanded from... > configure.ac:32: the top level > autom4te: /arch/x86-linux/gnu/bin/m4 failed with exit status: 1 > aclocal: /arch/x86-linux/gnu/bin/autom4te failed with exit status: 1 > autoreconf: aclocal failed with exit status: 1 >
I completely forgot to mention that I had the same problem, when invoking gnulib --with-tests. I guess your call above also implicitly included --with-tests? it complains about missing file in tests, while the file exists in the (gnu)lib directory. After this error I was not able to even make distclean. To be able to do that I copied all sources from the libgnu directory to the tests directory... which probably was not the right thing to do. Does your fix adderess this? Regards, Jarno > I'm applying this fix. > > > 2010-04-08 Bruno Haible <br...@clisp.org> > > Fix side effects from tests-related modules. > * modules/dprintf-posix (Comment): New section. > * modules/fprintf-posix (Comment): Likewise. > * modules/obstack-printf-posix (Comment): Likewise. > * modules/printf-posix (Comment): Likewise. > * modules/snprintf-posix (Comment): Likewise. > * modules/sprintf-posix (Comment): Likewise. > * modules/vasnprintf-posix (Comment): Likewise. > * modules/vasprintf-posix (Comment): Likewise. > * modules/vdprintf-posix (Comment): Likewise. > * modules/vfprintf-posix (Comment): Likewise. > * modules/vprintf-posix (Comment): Likewise. > * modules/vsnprintf-posix (Comment): Likewise. > * modules/vsprintf-posix (Comment): Likewise. > * modules/xprintf-posix (Comment): Likewise. > * modules/xvasprintf-posix (Comment): Likewise. > * modules/ceilf-tests (Depends-on): Remove fprintf-posix. > * modules/floorf-tests (Depends-on): Likewise. > * modules/round-tests (Depends-on): Likewise. > * modules/roundf-tests (Depends-on): Likewise. > * modules/trunc-tests (Depends-on): Likewise. > * modules/truncf-tests (Depends-on): Likewise. > * tests/test-ceilf2.c (check): Don't invoke fprintf if the > 'fprintf-posix' module is not present. > * tests/test-floorf2.c (check): Likewise. > * tests/test-trunc2.c (check): Likewise. > * tests/test-truncf2.c (check): Likewise. > * tests/test-round2.c (equal): Likewise. > > --- modules/ceilf-tests.orig Fri Apr 9 01:52:45 2010 > +++ modules/ceilf-tests Fri Apr 9 00:58:09 2010 > @@ -10,7 +10,6 @@ > isnanf-nolibm > stdbool > stdint > -fprintf-posix > > configure.ac: > > --- modules/dprintf-posix.orig Fri Apr 9 01:52:45 2010 > +++ modules/dprintf-posix Fri Apr 9 01:52:01 2010 > @@ -2,6 +2,12 @@ > POSIX compatible dprintf() function: print formatted output to a file > descriptor > > +Comment: > +This module should not be used as a dependency from a test module, > +otherwise when this module occurs as a tests-related module, it will > +have side effects on the compilation of the 'vasnprintf' module, if > +that module occurs among the main modules in lib/. > + > Files: > m4/dprintf-posix.m4 > m4/printf.m4 > --- modules/floorf-tests.orig Fri Apr 9 01:52:46 2010 > +++ modules/floorf-tests Fri Apr 9 00:58:10 2010 > @@ -10,7 +10,6 @@ > isnanf-nolibm > stdbool > stdint > -fprintf-posix > > configure.ac: > > --- modules/fprintf-posix.orig Fri Apr 9 01:52:46 2010 > +++ modules/fprintf-posix Fri Apr 9 01:52:02 2010 > @@ -1,6 +1,12 @@ > Description: > POSIX compatible fprintf() function: print formatted output to a stream > > +Comment: > +This module should not be used as a dependency from a test module, > +otherwise when this module occurs as a tests-related module, it will > +have side effects on the compilation of the 'vasnprintf' module, if > +that module occurs among the main modules in lib/. > + > Files: > lib/fprintf.c > m4/fprintf-posix.m4 > --- modules/obstack-printf-posix.orig Fri Apr 9 01:52:46 2010 > +++ modules/obstack-printf-posix Fri Apr 9 01:52:02 2010 > @@ -1,6 +1,12 @@ > Description: > POSIX formatted printing into an obstack. > > +Comment: > +This module should not be used as a dependency from a test module, > +otherwise when this module occurs as a tests-related module, it will > +have side effects on the compilation of the 'vasnprintf' module, if > +that module occurs among the main modules in lib/. > + > Files: > m4/obstack-printf.m4 > m4/obstack-printf-posix.m4 > --- modules/printf-posix.orig Fri Apr 9 01:52:46 2010 > +++ modules/printf-posix Fri Apr 9 01:52:02 2010 > @@ -1,6 +1,12 @@ > Description: > POSIX compatible printf() function: print formatted output to standard output > > +Comment: > +This module should not be used as a dependency from a test module, > +otherwise when this module occurs as a tests-related module, it will > +have side effects on the compilation of the 'vasnprintf' module, if > +that module occurs among the main modules in lib/. > + > Files: > lib/printf.c > m4/printf-posix-rpl.m4 > --- modules/round-tests.orig Fri Apr 9 01:52:46 2010 > +++ modules/round-tests Fri Apr 9 00:58:10 2010 > @@ -9,7 +9,6 @@ > isnand-nolibm > stdbool > stdint > -fprintf-posix > verify > > configure.ac: > --- modules/roundf-tests.orig Fri Apr 9 01:52:46 2010 > +++ modules/roundf-tests Fri Apr 9 00:58:10 2010 > @@ -12,7 +12,6 @@ > isnanf-nolibm > stdbool > stdint > -fprintf-posix > verify > > configure.ac: > --- modules/snprintf-posix.orig Fri Apr 9 01:52:46 2010 > +++ modules/snprintf-posix Fri Apr 9 01:52:02 2010 > @@ -2,6 +2,12 @@ > POSIX compatible snprintf() function: print formatted output to a fixed length > string > > +Comment: > +This module should not be used as a dependency from a test module, > +otherwise when this module occurs as a tests-related module, it will > +have side effects on the compilation of the 'vasnprintf' module, if > +that module occurs among the main modules in lib/. > + > Files: > m4/snprintf-posix.m4 > m4/printf.m4 > --- modules/sprintf-posix.orig Fri Apr 9 01:52:46 2010 > +++ modules/sprintf-posix Fri Apr 9 01:52:03 2010 > @@ -1,6 +1,12 @@ > Description: > POSIX compatible sprintf() function: print formatted output to a string > > +Comment: > +This module should not be used as a dependency from a test module, > +otherwise when this module occurs as a tests-related module, it will > +have side effects on the compilation of the 'vasnprintf' module, if > +that module occurs among the main modules in lib/. > + > Files: > lib/sprintf.c > m4/sprintf-posix.m4 > --- modules/trunc-tests.orig Fri Apr 9 01:52:46 2010 > +++ modules/trunc-tests Fri Apr 9 00:58:11 2010 > @@ -10,7 +10,6 @@ > isnand-nolibm > stdbool > stdint > -fprintf-posix > > configure.ac: > > --- modules/truncf-tests.orig Fri Apr 9 01:52:46 2010 > +++ modules/truncf-tests Fri Apr 9 00:58:10 2010 > @@ -10,7 +10,6 @@ > isnanf-nolibm > stdbool > stdint > -fprintf-posix > > configure.ac: > > --- modules/vasnprintf-posix.orig Fri Apr 9 01:52:46 2010 > +++ modules/vasnprintf-posix Fri Apr 9 01:52:03 2010 > @@ -2,6 +2,12 @@ > POSIX compatible vsprintf with automatic memory allocation and bounded output > size. > > +Comment: > +This module should not be used as a dependency from a test module, > +otherwise when this module occurs as a tests-related module, it will > +have side effects on the compilation of the 'vasnprintf' module, if > +that module occurs among the main modules in lib/. > + > Files: > m4/vasnprintf-posix.m4 > m4/printf.m4 > --- modules/vasprintf-posix.orig Fri Apr 9 01:52:46 2010 > +++ modules/vasprintf-posix Fri Apr 9 01:52:03 2010 > @@ -1,6 +1,12 @@ > Description: > POSIX compatible vsprintf with automatic memory allocation. > > +Comment: > +This module should not be used as a dependency from a test module, > +otherwise when this module occurs as a tests-related module, it will > +have side effects on the compilation of the 'vasnprintf' module, if > +that module occurs among the main modules in lib/. > + > Files: > m4/vasprintf-posix.m4 > m4/printf.m4 > --- modules/vdprintf-posix.orig Fri Apr 9 01:52:46 2010 > +++ modules/vdprintf-posix Fri Apr 9 01:52:03 2010 > @@ -2,6 +2,12 @@ > POSIX compatible vdprintf() function: print formatted output to a file > descriptor > > +Comment: > +This module should not be used as a dependency from a test module, > +otherwise when this module occurs as a tests-related module, it will > +have side effects on the compilation of the 'vasnprintf' module, if > +that module occurs among the main modules in lib/. > + > Files: > m4/vdprintf-posix.m4 > m4/printf.m4 > --- modules/vfprintf-posix.orig Fri Apr 9 01:52:46 2010 > +++ modules/vfprintf-posix Fri Apr 9 01:52:03 2010 > @@ -1,6 +1,12 @@ > Description: > POSIX compatible vfprintf() function: print formatted output to a stream > > +Comment: > +This module should not be used as a dependency from a test module, > +otherwise when this module occurs as a tests-related module, it will > +have side effects on the compilation of the 'vasnprintf' module, if > +that module occurs among the main modules in lib/. > + > Files: > lib/vfprintf.c > m4/vfprintf-posix.m4 > --- modules/vprintf-posix.orig Fri Apr 9 01:52:46 2010 > +++ modules/vprintf-posix Fri Apr 9 01:52:03 2010 > @@ -1,6 +1,12 @@ > Description: > POSIX compatible vprintf() function: print formatted output to standard output > > +Comment: > +This module should not be used as a dependency from a test module, > +otherwise when this module occurs as a tests-related module, it will > +have side effects on the compilation of the 'vasnprintf' module, if > +that module occurs among the main modules in lib/. > + > Files: > lib/vprintf.c > m4/vprintf-posix.m4 > --- modules/vsnprintf-posix.orig Fri Apr 9 01:52:46 2010 > +++ modules/vsnprintf-posix Fri Apr 9 01:52:03 2010 > @@ -2,6 +2,12 @@ > POSIX compatible vsnprintf() function: print formatted output to a fixed > length > string > > +Comment: > +This module should not be used as a dependency from a test module, > +otherwise when this module occurs as a tests-related module, it will > +have side effects on the compilation of the 'vasnprintf' module, if > +that module occurs among the main modules in lib/. > + > Files: > m4/vsnprintf-posix.m4 > m4/printf.m4 > --- modules/vsprintf-posix.orig Fri Apr 9 01:52:46 2010 > +++ modules/vsprintf-posix Fri Apr 9 01:52:03 2010 > @@ -1,6 +1,12 @@ > Description: > POSIX compatible vsprintf() function: print formatted output to a string > > +Comment: > +This module should not be used as a dependency from a test module, > +otherwise when this module occurs as a tests-related module, it will > +have side effects on the compilation of the 'vasnprintf' module, if > +that module occurs among the main modules in lib/. > + > Files: > lib/vsprintf.c > m4/vsprintf-posix.m4 > --- modules/xprintf-posix.orig Fri Apr 9 01:52:46 2010 > +++ modules/xprintf-posix Fri Apr 9 01:52:04 2010 > @@ -2,6 +2,12 @@ > A wrapper around printf with POSIX compatible format string interpretation, > that calls error upon ENOMEM or EILSEQ errors. > > +Comment: > +This module should not be used as a dependency from a test module, > +otherwise when this module occurs as a tests-related module, it will > +have side effects on the compilation of the 'vasnprintf' module, if > +that module occurs among the main modules in lib/. > + > Files: > > Depends-on: > --- modules/xvasprintf-posix.orig Fri Apr 9 01:52:46 2010 > +++ modules/xvasprintf-posix Fri Apr 9 01:52:04 2010 > @@ -2,6 +2,12 @@ > vasprintf and asprintf with POSIX compatible format string interpretation and > with out-of-memory checking. Also see xalloc-die. > > +Comment: > +This module should not be used as a dependency from a test module, > +otherwise when this module occurs as a tests-related module, it will > +have side effects on the compilation of the 'vasnprintf' module, if > +that module occurs among the main modules in lib/. > + > Files: > > Depends-on: > --- tests/test-ceilf2.c.orig Fri Apr 9 01:52:46 2010 > +++ tests/test-ceilf2.c Fri Apr 9 00:57:47 2010 > @@ -16,6 +16,9 @@ > > /* Written by Bruno Haible <br...@clisp.org>, 2007. */ > > +/* When this test fails on some platform, build it together with the gnulib > + module 'fprintf-posix' for optimal debugging output. */ > + > #include <config.h> > > #include <math.h> > @@ -119,8 +122,10 @@ > return 0; > else > { > +#if GNULIB_TEST_FPRINTF_POSIX > fprintf (stderr, "ceilf %g(%a) = %g(%a) or %g(%a)?\n", > x, x, reference, reference, result, result); > +#endif > return 1; > } > } > --- tests/test-floorf2.c.orig Fri Apr 9 01:52:46 2010 > +++ tests/test-floorf2.c Fri Apr 9 00:57:47 2010 > @@ -16,6 +16,9 @@ > > /* Written by Bruno Haible <br...@clisp.org>, 2007. */ > > +/* When this test fails on some platform, build it together with the gnulib > + module 'fprintf-posix' for optimal debugging output. */ > + > #include <config.h> > > #include <math.h> > @@ -119,8 +122,10 @@ > return 0; > else > { > +#if GNULIB_TEST_FPRINTF_POSIX > fprintf (stderr, "floorf %g(%a) = %g(%a) or %g(%a)?\n", > x, x, reference, reference, result, result); > +#endif > return 1; > } > } > --- tests/test-round2.c.orig Fri Apr 9 01:52:46 2010 > +++ tests/test-round2.c Fri Apr 9 00:57:47 2010 > @@ -17,6 +17,9 @@ > /* Written by Ben Pfaff <b...@gnu.org>, 2007. > Heavily based on code by Bruno Haible. */ > > +/* When this test fails on some platform, build it together with the gnulib > + module 'fprintf-posix' for optimal debugging output. */ > + > /* Get the two reference implementations of round under the names > round_reference1 and round_reference2. > > @@ -62,8 +65,10 @@ > return true; > else > { > +#if GNULIB_TEST_FPRINTF_POSIX > fprintf (stderr, "%s: "FUNCTION"(%g(%a)) = %g(%a) or %g(%a)?\n", > message, x, x, y0, y0, y1, y1); > +#endif > return false; > } > } > --- tests/test-trunc2.c.orig Fri Apr 9 01:52:46 2010 > +++ tests/test-trunc2.c Fri Apr 9 00:57:47 2010 > @@ -16,6 +16,9 @@ > > /* Written by Bruno Haible <br...@clisp.org>, 2007. */ > > +/* When this test fails on some platform, build it together with the gnulib > + module 'fprintf-posix' for optimal debugging output. */ > + > #include <config.h> > > #include <math.h> > @@ -123,8 +126,10 @@ > return 0; > else > { > +#if GNULIB_TEST_FPRINTF_POSIX > fprintf (stderr, "trunc %g(%a) = %g(%a) or %g(%a)?\n", > x, x, reference, reference, result, result); > +#endif > return 1; > } > } > --- tests/test-truncf2.c.orig Fri Apr 9 01:52:46 2010 > +++ tests/test-truncf2.c Fri Apr 9 00:57:48 2010 > @@ -16,6 +16,9 @@ > > /* Written by Bruno Haible <br...@clisp.org>, 2007. */ > > +/* When this test fails on some platform, build it together with the gnulib > + module 'fprintf-posix' for optimal debugging output. */ > + > #include <config.h> > > #include <math.h> > @@ -123,8 +126,10 @@ > return 0; > else > { > +#if GNULIB_TEST_FPRINTF_POSIX > fprintf (stderr, "truncf %g(%a) = %g(%a) or %g(%a)?\n", > x, x, reference, reference, result, result); > +#endif > return 1; > } > }