Ben Walton wrote: > + ASSERT(gethostname (origname, sizeof (origname)) == 0);
On mingw, I'm seeing a warning and link error: test-sethostname.c: In function `main': test-sethostname.c:62: warning: implicit declaration of function `gethostname' ... test-sethostname.o: In function `main': /home/bruno/multibuild-1547/mingw2009/testdir1/gltests/test-sethostname.c:62: undefined reference to `_gethostname' /home/bruno/multibuild-1547/mingw2009/testdir1/gltests/test-sethostname.c:85: undefined reference to `_gethostname' collect2: ld returned 1 exit status The trivial change would be to simply require the 'gethostname' module and link with $(GETHOSTNAME_LIB). But then the test suite would not verify any more that sethostname can be used without any -l options. The best way to continue verifying this is through two test programs, one linked without options and one linked with $(GETHOSTNAME_LIB). 2011-12-03 Bruno Haible <br...@clisp.org> sethostname tests: Fix link error on mingw. * tests/test-sethostname1.c: New file, extracted from tests/test-sethostname.c. * tests/test-sethostname2.c: New file, extracted from tests/test-sethostname.c. * tests/test-sethostname.c: Remove file. * modules/sethostname-tests (Files): Add tests/test-sethostname1.c, tests/test-sethostname2.c. Remove tests/test-sethostname.c. (Depends-on): Add gethostname. (Makefile.am): Compile both test-sethostname1 and test-sethostname2. Link the latter with $(GETHOSTNAME_LIB). --- modules/sethostname-tests.orig Sat Dec 3 15:52:10 2011 +++ modules/sethostname-tests Sat Dec 3 15:42:48 2011 @@ -1,13 +1,16 @@ Files: -tests/test-sethostname.c +tests/test-sethostname1.c +tests/test-sethostname2.c tests/signature.h tests/macros.h Depends-on: +gethostname configure.ac: AC_CHECK_FUNCS_ONCE([geteuid]) Makefile.am: -TESTS += test-sethostname -check_PROGRAMS += test-sethostname +TESTS += test-sethostname1 test-sethostname2 +check_PROGRAMS += test-sethostname1 test-sethostname2 +test_sethostname2_LDADD = $(LDADD) @GETHOSTNAME_LIB@ -- In memoriam Rudolf Slánský <http://en.wikipedia.org/wiki/Rudolf_Slánský>