[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: canonicalize-lgpl-tests on cygwin
From: |
Eric Blake |
Subject: |
Re: canonicalize-lgpl-tests on cygwin |
Date: |
Thu, 05 Jul 2007 10:08:02 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.12) Gecko/20070509 Thunderbird/1.5.0.12 Mnenhy/0.7.5.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Eric Blake on 7/5/2007 6:34 AM:
> So it is the mix with xalloc-die that changes the behavior of
> test-canonicalize-lgpl to pull in a gettext function. But what is
> stranger is that findutils only wants to use 'canonicalize', not
> 'canonicalize-lgpl'. Somehow, the --with-tests option of gnulib-tool is
> pulling in canonicalize-lgpl-tests in spite of the fact that findutils
> intends to use the gpl version (in particular, with xalloc, which needs
> @LIBINTL@).
In fact, this can be demonstrated simply by reverting my gnulib patch of
2007-06-19, then trying:
./gnulib-tool --with-tests --test canonicalize-lgpl canonicalize
gcc -g -O2 -o test-canonicalize-lgpl.exe test-canonicalize-lgpl.o
../gllib/libgnu.a
../gllib/libgnu.a(error.o): In function `error':
/home/eblake/gnulib1/testdir864/build/gllib/../../gllib/error.c:250:
undefined reference to `_program_name'
../gllib/libgnu.a(error.o): In function `error_at_line':
/home/eblake/gnulib1/testdir864/build/gllib/../../gllib/error.c:309:
undefined reference to `_program_name'
collect2: ld returned 1 exit status
And further investigation shows:
$ nm gllib/libgnu.a |grep canon
canonicalize.o:
00000530 T _canonicalize_file_name
00000000 T _canonicalize_filename_mode
canonicalize-lgpl.o:
000004f0 T _canonicalize_file_name
ie. test-canonicalize-lgpl.c is linking against the wrong copy of
canonicalize_file_name. [Hmm, I also wonder if attempting this as a
shared library would result in a duplicate symbol error on cygwin, whereas
the above static compilation merely picked the first instance.]
The canonicalize-lgpl module is being pulled into findutils by virtue of
the fchdir module. Perhaps we need fchdir and fchdir-lgpl? Or maybe the
solution is just for findutils to use --avoid=canonicalize-lgpl when using
gnulib-tool? Or conditionalize test-canonicalize-lgpl.c to be a no-op
when it is detected that the canonicalize module is also in use?
This patch goes with the latter approach. I tested that with it, plus
bumping findutils to use this instead of 2007-06-20 as the gnulib source,
findutils makes it through building. OK to apply? Should I also create a
module canonicalize-tests that gets run instead when both modules are in use?
2007-07-05 Eric Blake <address@hidden>
Fix testing canonicalize-lgpl on cygwin.
* modules/canonicalize-lgpl-tests (test_canonicalize_lgpl_LDADD):
Revert patch from 2007-06-19.
* tests/test-canonicalize-lgpl.c (main): Instead, skip test when
canonicalize module is also in use.
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGjRdh84KuGfSFAYARAl96AKCLbuAc+WQTOryhcolJyRgppVrdcQCg1y8q
LwZPta/bbTJP8Dv1FsLDHDA=
=HJJP
-----END PGP SIGNATURE-----
Index: modules/canonicalize-lgpl-tests
===================================================================
RCS file: /sources/gnulib/gnulib/modules/canonicalize-lgpl-tests,v
retrieving revision 1.4
diff -u -p -r1.4 canonicalize-lgpl-tests
--- modules/canonicalize-lgpl-tests 19 Jun 2007 13:00:19 -0000 1.4
+++ modules/canonicalize-lgpl-tests 5 Jul 2007 16:04:16 -0000
@@ -11,4 +11,4 @@ TESTS += test-canonicalize-lgpl.sh
TESTS_ENVIRONMENT += EXEEXT='@EXEEXT@'
check_PROGRAMS += test-canonicalize-lgpl
EXTRA_DIST += test-canonicalize-lgpl.sh
-test_canonicalize_lgpl_LDADD = $(LDADD) @LIBINTL@
+test_canonicalize_lgpl_LDADD = $(LDADD)
Index: tests/test-canonicalize-lgpl.c
===================================================================
RCS file: /sources/gnulib/gnulib/tests/test-canonicalize-lgpl.c,v
retrieving revision 1.3
diff -u -p -r1.3 test-canonicalize-lgpl.c
--- tests/test-canonicalize-lgpl.c 28 May 2007 16:49:42 -0000 1.3
+++ tests/test-canonicalize-lgpl.c 5 Jul 2007 16:04:16 -0000
@@ -39,6 +39,12 @@
int
main ()
{
+#ifdef GNULIB_CANONICALIZE
+ /* No need to test canonicalize-lgpl module if canonicalize is also
+ in use. */
+ return 0;
+#endif
+
/* Check that the symbolic link to a file can be resolved. */
{
char *result1 = canonicalize_file_name ("t-can-lgpl.tmp/huk");