[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: link-warning usage improvements
From: |
Bruno Haible |
Subject: |
Re: link-warning usage improvements |
Date: |
Thu, 31 Dec 2009 21:31:54 +0100 |
User-agent: |
KMail/1.9.9 |
Eric Blake wrote:
> 2009-12-31 Eric Blake <address@hidden>
>
> + sys_times, sys_utsname: use include_next
> + * m4/sys_times_h.m4 (gl_SYS_TIMES_H): Support wrapping an existing
> + header.
> + (gl_SYS_TIMES_H_DEFAULTS): Add another variable.
> + * m4/sys_utsname_h.m4 (gl_SYS_UTSNAME_H)
> + (gl_SYS_UTSNAME_H_DEFAULTS): Likewise.
> + * modules/sys_times (Depends-on): Add include_next.
> + (Makefile.am): Substitute additional values.
> + * modules/sys_utsname (Depends-on, Makefile.am): Likewise.
> + * lib/sys_times.in.h (includes): Include native header, if
> + available.
> + * lib/sys_utsname.in.h (includes): Likewise.
> + * tests/test-sys_times.c (main): Enhance test.
The sys_utsname part looks correct.
The sys_times part (btw, it would be easier to read if it were two separate
commits) introduces a regression: a compilation failure on mingw:
$ ./gnulib-tool --create-testdir --dir=... --with-tests times
then on mingw:
$ make
...
test-times.c:24: error: `times' undeclared here (not in a function)
test-times.c: In function `main':
test-times.c:52: warning: implicit declaration of function `times'
make[4]: *** [test-times.o] Error 1
The reason is that HAVE_TIMES is set to 1 on all platforms, even mingw.
This fixes it:
2009-12-31 Bruno Haible <address@hidden>
times: Update after sys_times changed.
* m4/times.m4: New file, extracted from modules/times. Set HAVE_TIMES.
* modules/times (Files): Add it.
(configure.ac): Invoke gl_FUNC_TIMES.
Changing permissions from . to 100644
--- m4/times.m4.orig Tue Apr 14 12:31:40 2009
+++ m4/times.m4 Thu Dec 31 21:25:43 2009
@@ -0,0 +1,15 @@
+# times.m4 serial 1
+dnl Copyright (C) 2009 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_TIMES],
+[
+ AC_REQUIRE([gl_SYS_TIMES_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([times])
+ if test $ac_cv_func_times = no; then
+ HAVE_TIMES=0
+ AC_LIBOBJ([times])
+ fi
+])
--- modules/times.orig Thu Dec 31 21:30:09 2009
+++ modules/times Thu Dec 31 21:25:29 2009
@@ -3,15 +3,13 @@
Files:
lib/times.c
+m4/times.m4
Depends-on:
sys_times
configure.ac:
-AC_CHECK_FUNCS_ONCE([times])
-if test $ac_cv_func_times = no; then
- AC_LIBOBJ([times])
-fi
+gl_FUNC_TIMES
gl_SYS_TIMES_MODULE_INDICATOR([times])
Makefile.am:
- link-warning usage improvements, Eric Blake, 2009/12/24
- Re: link-warning usage improvements, Bruno Haible, 2009/12/31
- Re: link-warning usage improvements, Bruno Haible, 2009/12/31
- Re: link-warning usage improvements, Eric Blake, 2009/12/31
- Re: link-warning usage improvements, Eric Blake, 2009/12/31
- Re: link-warning usage improvements, Bruno Haible, 2009/12/31