link-warning: make usage consistent
authorEric Blake <ebb9@byu.net>
Thu, 24 Dec 2009 14:19:23 +0000 (07:19 -0700)
committerEric Blake <ebb9@byu.net>
Wed, 30 Dec 2009 05:06:57 +0000 (22:06 -0700)
Ensure GL_LINK_WARNING is defined before use.

* modules/ctype (Depends-on): Add link-warning.
(Makefile.am): Update rules accordingly.
* modules/langinfo (Depends-on, Makefile.am): Likewise.
* modules/locale (Depends-on, Makefile.am): Likewise.
* modules/sys_file (Makefile.am): Likewise.
* modules/getopt-posix (Makefile.am): Delete unused link warning
efforts.
* lib/ctype.in.h (GL_LINK_WARNING): Ensure definition before use.
* lib/langinfo.in.h (GL_LINK_WARNING): Likewise.
* lib/locale.in.h (GL_LINK_WARNING): Likewise.
* lib/sys_file.in.h (GL_LINK_WARNING): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
lib/ctype.in.h
lib/langinfo.in.h
lib/locale.in.h
lib/sys_file.in.h
modules/ctype
modules/getopt-posix
modules/langinfo
modules/locale
modules/sys_file

index fb766c3..79ffe48 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
 2009-12-29  Eric Blake  <ebb9@byu.net>
 
+       link-warning: make usage consistent
+       * modules/ctype (Depends-on): Add link-warning.
+       (Makefile.am): Update rules accordingly.
+       * modules/langinfo (Depends-on, Makefile.am): Likewise.
+       * modules/locale (Depends-on, Makefile.am): Likewise.
+       * modules/sys_file (Makefile.am): Likewise.
+       * modules/getopt-posix (Makefile.am): Delete unused link warning
+       efforts.
+       * lib/ctype.in.h (GL_LINK_WARNING): Ensure definition before use.
+       * lib/langinfo.in.h (GL_LINK_WARNING): Likewise.
+       * lib/locale.in.h (GL_LINK_WARNING): Likewise.
+       * lib/sys_file.in.h (GL_LINK_WARNING): Likewise.
+
        stdio: remove unused variables
        * m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Remove unused variables.
        * m4/fseeko.m4 (gl_FUNC_FSEEKO): Likewise.
index d1a3c5b..ba90077 100644 (file)
@@ -36,6 +36,8 @@
 #ifndef _GL_CTYPE_H
 #define _GL_CTYPE_H
 
+/* The definition of GL_LINK_WARNING is copied here.  */
+
 /* Return non-zero if c is a blank, i.e. a space or tab character.  */
 #if @GNULIB_ISBLANK@
 # if !@HAVE_ISBLANK@
index fc27826..26678cc 100644 (file)
@@ -123,6 +123,7 @@ typedef int nl_item;
 
 #endif
 
+/* The definition of GL_LINK_WARNING is copied here.  */
 
 /* Declare overridden functions.  */
 
index 478795a..3a79c53 100644 (file)
@@ -34,6 +34,8 @@
 # include <xlocale.h>
 #endif
 
+/* The definition of GL_LINK_WARNING is copied here.  */
+
 /* The definition of _GL_ARG_NONNULL is copied here.  */
 
 /* The LC_MESSAGES locale category is specified in POSIX, but not in ISO C.
index 4462664..2dff58c 100644 (file)
@@ -41,6 +41,8 @@
 # define LOCK_NB 4       /* Don't block when locking.  */
 #endif
 
+/* The definition of GL_LINK_WARNING is copied here.  */
+
 #if @GNULIB_FLOCK@
 /* Apply or remove advisory locks on an open file.
    Return 0 if successful, otherwise -1 and errno set.  */
index b0ebf1b..e896814 100644 (file)
@@ -7,6 +7,7 @@ m4/ctype.m4
 
 Depends-on:
 include_next
+link-warning
 
 configure.ac:
 gl_CTYPE_H
@@ -16,7 +17,7 @@ BUILT_SOURCES += $(CTYPE_H)
 
 # We need the following in order to create <ctype.h> when the system
 # doesn't have one that works with the given compiler.
-ctype.h: ctype.in.h
+ctype.h: ctype.in.h $(LINK_WARNING_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -24,6 +25,7 @@ ctype.h: ctype.in.h
              -e 's|@''NEXT_CTYPE_H''@|$(NEXT_CTYPE_H)|g' \
              -e 's/@''GNULIB_ISBLANK''@/$(GNULIB_ISBLANK)/g' \
              -e 's/@''HAVE_ISBLANK''@/$(HAVE_ISBLANK)/g' \
+             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
              < $(srcdir)/ctype.in.h; \
        } > $@-t && \
        mv $@-t $@
index 63bc6c4..a3ae9f1 100644 (file)
@@ -23,14 +23,13 @@ BUILT_SOURCES += $(GETOPT_H)
 
 # We need the following in order to create <getopt.h> when the system
 # doesn't have one that works with the given compiler.
-getopt.h: getopt.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
+getopt.h: getopt.in.h $(ARG_NONNULL_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \
              -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''NEXT_GETOPT_H''@|$(NEXT_GETOPT_H)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              < $(srcdir)/getopt.in.h; \
        } > $@-t && \
index f9b0a2f..fb413d0 100644 (file)
@@ -6,8 +6,9 @@ lib/langinfo.in.h
 m4/langinfo_h.m4
 
 Depends-on:
-include_next
 extensions
+include_next
+link-warning
 
 configure.ac:
 gl_LANGINFO_H
@@ -17,7 +18,7 @@ BUILT_SOURCES += $(LANGINFO_H)
 
 # We need the following in order to create an empty placeholder for
 # <langinfo.h> when the system doesn't have one.
-langinfo.h: langinfo.in.h
+langinfo.h: langinfo.in.h $(LINK_WARNING_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''HAVE_LANGINFO_H''@|$(HAVE_LANGINFO_H)|g' \
@@ -29,6 +30,7 @@ langinfo.h: langinfo.in.h
              -e 's|@''HAVE_LANGINFO_ERA''@|$(HAVE_LANGINFO_ERA)|g' \
              -e 's|@''HAVE_NL_LANGINFO''@|$(HAVE_NL_LANGINFO)|g' \
              -e 's|@''REPLACE_NL_LANGINFO''@|$(REPLACE_NL_LANGINFO)|g' \
+             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
              < $(srcdir)/langinfo.in.h; \
        } > $@-t && \
        mv $@-t $@
index 60d6081..2541300 100644 (file)
@@ -9,6 +9,7 @@ Depends-on:
 include_next
 arg-nonnull
 extensions
+link-warning
 stddef
 
 configure.ac:
@@ -19,7 +20,7 @@ BUILT_SOURCES += $(LOCALE_H)
 
 # We need the following in order to create <locale.h> when the system
 # doesn't have one that provides all definitions.
-locale.h: locale.in.h $(ARG_NONNULL_H)
+locale.h: locale.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -28,6 +29,7 @@ locale.h: locale.in.h $(ARG_NONNULL_H)
              -e 's|@''GNULIB_DUPLOCALE''@|$(GNULIB_DUPLOCALE)|g' \
              -e 's|@''HAVE_XLOCALE_H''@|$(HAVE_XLOCALE_H)|g' \
              -e 's|@''REPLACE_DUPLOCALE''@|$(REPLACE_DUPLOCALE)|g' \
+             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              < $(srcdir)/locale.in.h; \
        } > $@-t && \
index 593604c..61c6202 100644 (file)
@@ -18,7 +18,7 @@ BUILT_SOURCES += $(SYS_FILE_H)
 
 # We need the following in order to create <sys/file.h> when the system
 # has one that is incomplete.
-sys/file.h: sys_file.in.h
+sys/file.h: sys_file.in.h $(LINK_WARNING_H)
        $(AM_V_at)$(MKDIR_P) sys
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
@@ -28,6 +28,7 @@ sys/file.h: sys_file.in.h
              -e 's|@''NEXT_SYS_FILE_H''@|$(NEXT_SYS_FILE_H)|g' \
              -e 's/@''HAVE_FLOCK''@/$(HAVE_FLOCK)/g' \
              -e 's/@''GNULIB_FLOCK''@/$(GNULIB_FLOCK)/g' \
+             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
              < $(srcdir)/sys_file.in.h; \
        } > $@-t && \
        mv $@-t $@