bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] uniname/uniname-tests: skip if system's libunistring is used


From: Daiki Ueno
Subject: Re: [PATCH] uniname/uniname-tests: skip if system's libunistring is used
Date: Sun, 08 Feb 2015 17:49:04 +0900
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Daiki Ueno <address@hidden> writes:

> When trying to compile an older gettext tarball with libunistring
> 0.9.5-alpha3 (with an update to Unicode 7.0.0), I encountered a test
> failure caused by a data mismatch:

Now I got a problem with an opposite situation.  If an older
libunistring is installed (as a package), the test fails.

In module/uniname/uniname-tests:

  Makefile.am:
  if LIBUNISTRING_COMPILE_UNINAME_UNINAME
  TESTS += uniname/test-uninames.sh
  check_PROGRAMS += test-uninames
  test_uninames_SOURCES = uniname/test-uninames.c
  test_uninames_LDADD = $(LDADD) $(LIBUNISTRING) @LIBINTL@
  endif

LIBUNISTRING will be expanded to:

  LIBUNISTRING = /usr/lib64/libunistring.so -Wl,-rpath -Wl,/usr/lib64

and the following libtool link command reorders the input files:

  /bin/bash ./libtool --tag=CC --mode=link gcc -g -O2 -o test-uninames \
    uniname/test-uninames.o ../gllib/libgnu.la /usr/lib64/libunistring.so \
    -Wl,-rpath -Wl,/usr/lib64

as:

  libtool: link: gcc -g -O2 -o test-uninames uniname/test-uninames.o \
    /usr/lib64/libunistring.so -Wl,-rpath -Wl,/usr/lib64 \
    ../gllib/.libs/libgnu.a -L/usr/lib64 -lunistring

where libunistring.so is placed before libgnu.a.

I guess the reordering here is deliberate and maybe it could be avoided
if libunistring.la file were installed on the system.  However, the
uniname test itself tends to fail if a different version of
uniname/uniname.c is used, I've removed $(LIBUNISTRING) from
test_uninames_LDADD, like the attached patch.

Regards,
--
Daiki Ueno
>From ffe64673c36168b0e62224429a4870427f2c68c4 Mon Sep 17 00:00:00 2001
From: Daiki Ueno <address@hidden>
Date: Sun, 8 Feb 2015 17:38:03 +0900
Subject: [PATCH] uniname/unimame-tests: don't link with -lunistring

* modules/uniname/uniname-tests (Makefile.am): Don't link against
$(LIBUNISTRING).  Document the rationale why we need to
conditionalize the test.
---
 ChangeLog                     | 7 +++++++
 modules/uniname/uniname-tests | 4 +++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index cd73197..4b5092d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2015-02-08  Daiki Ueno  <address@hidden>
+
+       uniname/unimame-tests: don't link with -lunistring
+       * modules/uniname/uniname-tests (Makefile.am): Don't link against
+       $(LIBUNISTRING).  Document the rationale why we need to
+       conditionalize the test.
+
 2015-02-07  Paul Eggert  <address@hidden>
 
        fstrcmp: don't assume strlen < INT_MAX
diff --git a/modules/uniname/uniname-tests b/modules/uniname/uniname-tests
index 305e6a1..475a4b1 100644
--- a/modules/uniname/uniname-tests
+++ b/modules/uniname/uniname-tests
@@ -10,10 +10,12 @@ progname
 configure.ac:
 
 Makefile.am:
+# Unlike other libunistring modules, this test passes only when the
+# same version of uniname/uniname.c is used (even if it is newer).
 if LIBUNISTRING_COMPILE_UNINAME_UNINAME
 TESTS += uniname/test-uninames.sh
 check_PROGRAMS += test-uninames
 test_uninames_SOURCES = uniname/test-uninames.c
-test_uninames_LDADD = $(LDADD) $(LIBUNISTRING) @LIBINTL@
+test_uninames_LDADD = $(LDADD) @LIBINTL@
 endif
 
-- 
2.1.3


reply via email to

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