bug-gnulib
[Top][All Lists]
Advanced

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

dirent-tests: fix link error


From: Bruno Haible
Subject: dirent-tests: fix link error
Date: Sun, 7 Mar 2010 23:26:45 +0100
User-agent: KMail/1.9.9

On Cygwin, the dirent test fails to link for me:

gcc -std=gnu99  -g -O2  -L/usr/local/cygwin/lib -Wl,--as-needed -o 
test-dirent-safer.exe test-dirent-safer.o ../gllib/libgnu.a 
../gllib/libgnu.a(openat-die.o): In function `openat_save_fail':
/home/bruno/testdir4/gllib/openat-die.c:33: undefined reference to 
`_libintl_gettext'
../gllib/libgnu.a(openat-die.o): In function `openat_restore_fail':
/home/bruno/testdir4/gllib/openat-die.c:51: undefined reference to 
`_libintl_gettext'
../gllib/libgnu.a(error.o): In function `error_tail':
/home/bruno/testdir4/gllib/error.c:153: undefined reference to 
`_libintl_gettext'
../gllib/libgnu.a(xalloc-die.o): In function `xalloc_die':
/home/bruno/testdir4/gllib/xalloc-die.c:34: undefined reference to 
`_libintl_gettext'
collect2: ld returned 1 exit status
make[4]: *** [test-dirent-safer.exe] Error 1

The reason is an optional dependency
  dirent-safer -> fdopendir
and a sequence of dependencies
  fdopendir -> save_cwd -> xgetcwd -> xalloc-die -> gettext-h

I'm applying this fix:


2010-03-07  Bruno Haible  <address@hidden>

        Fix test-dirent-safer link error.
        * modules/dirent-safer-tests (Makefile.am): Define
        test_dirent_safer_LDADD.

--- modules/dirent-safer-tests.orig     Sun Mar  7 23:24:59 2010
+++ modules/dirent-safer-tests  Sun Mar  7 23:23:47 2010
@@ -10,3 +10,6 @@
 Makefile.am:
 TESTS += test-dirent-safer
 check_PROGRAMS += test-dirent-safer
+# Link with libintl when needed. dirent-safer uses fdopendir if it is present,
+# and fdopendir indirectly depends on xgetcwd -> xalloc-die -> gettext-h.
+test_dirent_safer_LDADD = $(LDADD) $(LIBINTL)




reply via email to

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