From cd21604b6b669f77ded87ec08371b83b422006e3 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 28 Mar 2010 00:31:39 +0100 Subject: [PATCH] Distinguish two kinds of module indicators. --- ChangeLog | 34 ++++++++++++++++++++++++++++++++++ m4/dirent_h.m4 | 2 +- m4/fcntl_h.m4 | 2 +- m4/gnulib-common.m4 | 34 ++++++++++++++++++++++++++++++++-- m4/langinfo_h.m4 | 2 +- m4/locale_h.m4 | 2 +- m4/math_h.m4 | 2 +- m4/pty_h.m4 | 2 +- m4/search_h.m4 | 2 +- m4/signal_h.m4 | 2 +- m4/spawn_h.m4 | 2 +- m4/stdio_h.m4 | 2 +- m4/stdlib_h.m4 | 2 +- m4/string_h.m4 | 2 +- m4/sys_ioctl_h.m4 | 2 +- m4/sys_select_h.m4 | 2 +- m4/sys_socket_h.m4 | 2 +- m4/sys_stat_h.m4 | 2 +- m4/sys_time_h.m4 | 2 +- m4/time_h.m4 | 2 +- m4/unistd_h.m4 | 2 +- m4/wchar_h.m4 | 2 +- modules/cloexec | 2 +- modules/fdopendir | 1 + modules/getopt-gnu | 2 +- modules/uninorm/u16-normalize | 2 +- modules/uninorm/u32-normalize | 2 +- modules/uninorm/u8-normalize | 2 +- 28 files changed, 92 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0d65edb9b4..6b29776051 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,37 @@ +2010-03-27 Bruno Haible + + Distinguish two kinds of module indicators. + * m4/gnulib-common.m4 (gl_MODULE_INDICATOR_FOR_TESTS): Renamed from + gl_MODULE_INDICATOR. + (gl_MODULE_INDICATOR): New macro. + * m4/dirent_h.m4 (gl_DIRENT_MODULE_INDICATOR): Invoke + gl_MODULE_INDICATOR_FOR_TESTS instead of gl_MODULE_INDICATOR. + * m4/fcntl_h.m4 (gl_FCNTL_MODULE_INDICATOR): Likewise. + * m4/langinfo_h.m4 (gl_LANGINFO_MODULE_INDICATOR): Likewise. + * m4/locale_h.m4 (gl_LOCALE_MODULE_INDICATOR): Likewise. + * m4/math_h.m4 (gl_MATH_MODULE_INDICATOR): Likewise. + * m4/pty_h.m4 (gl_PTY_MODULE_INDICATOR): Likewise. + * m4/search_h.m4 (gl_SEARCH_MODULE_INDICATOR): Likewise. + * m4/signal_h.m4 (gl_SIGNAL_MODULE_INDICATOR): Likewise. + * m4/spawn_h.m4 (gl_SPAWN_MODULE_INDICATOR): Likewise. + * m4/stdio_h.m4 (gl_STDIO_MODULE_INDICATOR): Likewise. + * m4/stdlib_h.m4 (gl_STDLIB_MODULE_INDICATOR): Likewise. + * m4/string_h.m4 (gl_STRING_MODULE_INDICATOR): Likewise. + * m4/sys_ioctl_h.m4 (gl_SYS_IOCTL_MODULE_INDICATOR): Likewise. + * m4/sys_select_h.m4 (gl_SYS_SELECT_MODULE_INDICATOR): Likewise. + * m4/sys_socket_h.m4 (gl_SYS_SOCKET_MODULE_INDICATOR): Likewise. + * m4/sys_stat_h.m4 (gl_SYS_STAT_MODULE_INDICATOR): Likewise. + * m4/sys_time_h.m4 (gl_SYS_TIME_MODULE_INDICATOR): Likewise. + * m4/time_h.m4 (gl_TIME_MODULE_INDICATOR): Likewise. + * m4/unistd_h.m4 (gl_UNISTD_MODULE_INDICATOR): Likewise. + * m4/wchar_h.m4 (gl_WCHAR_MODULE_INDICATOR): Likewise. + * modules/cloexec (configure.ac): Likewise. + * modules/getopt-gnu (configure.ac): Likewise. + * modules/uninorm/u8-normalize (configure.ac): Likewise. + * modules/uninorm/u16-normalize (configure.ac): Likewise. + * modules/uninorm/u32-normalize (configure.ac): Likewise. + * modules/fdopendir (configure.ac): Invoke gl_MODULE_INDICATOR. + 2010-03-27 Bruno Haible New module description field 'Comment'. diff --git a/m4/dirent_h.m4 b/m4/dirent_h.m4 index 387f2c8273..5f88a27b15 100644 --- a/m4/dirent_h.m4 +++ b/m4/dirent_h.m4 @@ -34,7 +34,7 @@ AC_DEFUN([gl_DIRENT_MODULE_INDICATOR], AC_REQUIRE([gl_DIRENT_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. - gl_MODULE_INDICATOR([$1]) + gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_DIRENT_H_DEFAULTS], diff --git a/m4/fcntl_h.m4 b/m4/fcntl_h.m4 index a496deb700..e41915c326 100644 --- a/m4/fcntl_h.m4 +++ b/m4/fcntl_h.m4 @@ -26,7 +26,7 @@ AC_DEFUN([gl_FCNTL_MODULE_INDICATOR], AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. - gl_MODULE_INDICATOR([$1]) + gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_FCNTL_H_DEFAULTS], diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index b578f0785d..09ea950e26 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 @@ -1,4 +1,4 @@ -# gnulib-common.m4 serial 15 +# gnulib-common.m4 serial 16 dnl Copyright (C) 2007-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -52,8 +52,38 @@ AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE], ]) # gl_MODULE_INDICATOR([modulename]) -# defines a C macro indicating the presence of the given module. +# defines a C macro indicating the presence of the given module +# in a location where it can be used. +# | Value | Value | +# | in lib/ | in tests/ | +# --------------------------------------------+---------+-----------+ +# Module present among main modules: | 1 | 1 | +# --------------------------------------------+---------+-----------+ +# Module present among tests-related modules: | 0 | 1 | +# --------------------------------------------+---------+-----------+ +# Module not present at all: | 0 | 0 | +# --------------------------------------------+---------+-----------+ AC_DEFUN([gl_MODULE_INDICATOR], +[ + AC_DEFINE_UNQUOTED([GNULIB_]translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___]), + [gl_MODULE_INDICATOR_CONDITION], + [Define to a C preprocessor expression that evaluates to 1 or 0, depending whether the gnulib module ]$1[ shall be considered present.]) +]) + +# gl_MODULE_INDICATOR_FOR_TESTS([modulename]) +# defines a C macro indicating the presence of the given module +# in lib or tests. This is useful to determine whether the module +# should be tested. +# | Value | Value | +# | in lib/ | in tests/ | +# --------------------------------------------+---------+-----------+ +# Module present among main modules: | 1 | 1 | +# --------------------------------------------+---------+-----------+ +# Module present among tests-related modules: | 1 | 1 | +# --------------------------------------------+---------+-----------+ +# Module not present at all: | 0 | 0 | +# --------------------------------------------+---------+-----------+ +AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS], [ AC_DEFINE([GNULIB_]translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___]), [1], [Define to 1 when using the gnulib module ]$1[.]) diff --git a/m4/langinfo_h.m4 b/m4/langinfo_h.m4 index 4d87632bb8..11a56980f7 100644 --- a/m4/langinfo_h.m4 +++ b/m4/langinfo_h.m4 @@ -65,7 +65,7 @@ AC_DEFUN([gl_LANGINFO_MODULE_INDICATOR], AC_REQUIRE([gl_LANGINFO_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. - gl_MODULE_INDICATOR([$1]) + gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_LANGINFO_H_DEFAULTS], diff --git a/m4/locale_h.m4 b/m4/locale_h.m4 index 65dd5d880c..18a119b8ec 100644 --- a/m4/locale_h.m4 +++ b/m4/locale_h.m4 @@ -80,7 +80,7 @@ AC_DEFUN([gl_LOCALE_MODULE_INDICATOR], AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. - gl_MODULE_INDICATOR([$1]) + gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_LOCALE_H_DEFAULTS], diff --git a/m4/math_h.m4 b/m4/math_h.m4 index 758df687d7..cced740273 100644 --- a/m4/math_h.m4 +++ b/m4/math_h.m4 @@ -49,7 +49,7 @@ AC_DEFUN([gl_MATH_MODULE_INDICATOR], AC_REQUIRE([gl_MATH_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. - gl_MODULE_INDICATOR([$1]) + gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_MATH_H_DEFAULTS], diff --git a/m4/pty_h.m4 b/m4/pty_h.m4 index 0f464b23ab..4b196f786b 100644 --- a/m4/pty_h.m4 +++ b/m4/pty_h.m4 @@ -50,7 +50,7 @@ AC_DEFUN([gl_PTY_MODULE_INDICATOR], AC_REQUIRE([gl_PTY_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. - gl_MODULE_INDICATOR([$1]) + gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_PTY_H_DEFAULTS], diff --git a/m4/search_h.m4 b/m4/search_h.m4 index 1797948914..498231218c 100644 --- a/m4/search_h.m4 +++ b/m4/search_h.m4 @@ -28,7 +28,7 @@ AC_DEFUN([gl_SEARCH_MODULE_INDICATOR], AC_REQUIRE([gl_SEARCH_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. - gl_MODULE_INDICATOR([$1]) + gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_SEARCH_H_DEFAULTS], diff --git a/m4/signal_h.m4 b/m4/signal_h.m4 index a636a27c18..56e5746c0b 100644 --- a/m4/signal_h.m4 +++ b/m4/signal_h.m4 @@ -29,7 +29,7 @@ AC_DEFUN([gl_SIGNAL_MODULE_INDICATOR], AC_REQUIRE([gl_SIGNAL_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. - gl_MODULE_INDICATOR([$1]) + gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_SIGNAL_H_DEFAULTS], diff --git a/m4/spawn_h.m4 b/m4/spawn_h.m4 index 44166a5954..371d00c481 100644 --- a/m4/spawn_h.m4 +++ b/m4/spawn_h.m4 @@ -79,7 +79,7 @@ AC_DEFUN([gl_SPAWN_MODULE_INDICATOR], AC_REQUIRE([gl_SPAWN_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. - gl_MODULE_INDICATOR([$1]) + gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_SPAWN_H_DEFAULTS], diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4 index e6a27adb93..af56b1f9da 100644 --- a/m4/stdio_h.m4 +++ b/m4/stdio_h.m4 @@ -46,7 +46,7 @@ AC_DEFUN([gl_STDIO_MODULE_INDICATOR], AC_REQUIRE([gl_STDIO_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. - gl_MODULE_INDICATOR([$1]) + gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_STDIO_H_DEFAULTS], diff --git a/m4/stdlib_h.m4 b/m4/stdlib_h.m4 index 4fa6cfcfc7..4c5cca89ab 100644 --- a/m4/stdlib_h.m4 +++ b/m4/stdlib_h.m4 @@ -45,7 +45,7 @@ AC_DEFUN([gl_STDLIB_MODULE_INDICATOR], AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. - gl_MODULE_INDICATOR([$1]) + gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_STDLIB_H_DEFAULTS], diff --git a/m4/string_h.m4 b/m4/string_h.m4 index 9238491f85..9ceeea986a 100644 --- a/m4/string_h.m4 +++ b/m4/string_h.m4 @@ -36,7 +36,7 @@ AC_DEFUN([gl_STRING_MODULE_INDICATOR], AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. - gl_MODULE_INDICATOR([$1]) + gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], diff --git a/m4/sys_ioctl_h.m4 b/m4/sys_ioctl_h.m4 index 5f01d61155..08745076cb 100644 --- a/m4/sys_ioctl_h.m4 +++ b/m4/sys_ioctl_h.m4 @@ -57,7 +57,7 @@ AC_DEFUN([gl_SYS_IOCTL_MODULE_INDICATOR], AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. - gl_MODULE_INDICATOR([$1]) + gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_SYS_IOCTL_H_DEFAULTS], diff --git a/m4/sys_select_h.m4 b/m4/sys_select_h.m4 index e085eb8be2..95e7818fd8 100644 --- a/m4/sys_select_h.m4 +++ b/m4/sys_select_h.m4 @@ -74,7 +74,7 @@ AC_DEFUN([gl_SYS_SELECT_MODULE_INDICATOR], AC_REQUIRE([gl_SYS_SELECT_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. - gl_MODULE_INDICATOR([$1]) + gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_SYS_SELECT_H_DEFAULTS], diff --git a/m4/sys_socket_h.m4 b/m4/sys_socket_h.m4 index 9eeaa27d7e..9f4db56230 100644 --- a/m4/sys_socket_h.m4 +++ b/m4/sys_socket_h.m4 @@ -127,7 +127,7 @@ AC_DEFUN([gl_SYS_SOCKET_MODULE_INDICATOR], AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. - gl_MODULE_INDICATOR([$1]) + gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS], diff --git a/m4/sys_stat_h.m4 b/m4/sys_stat_h.m4 index 5af200e7e3..7181c253b9 100644 --- a/m4/sys_stat_h.m4 +++ b/m4/sys_stat_h.m4 @@ -40,7 +40,7 @@ AC_DEFUN([gl_SYS_STAT_MODULE_INDICATOR], AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. - gl_MODULE_INDICATOR([$1]) + gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_SYS_STAT_H_DEFAULTS], diff --git a/m4/sys_time_h.m4 b/m4/sys_time_h.m4 index 470fc41116..da57527163 100644 --- a/m4/sys_time_h.m4 +++ b/m4/sys_time_h.m4 @@ -58,7 +58,7 @@ AC_DEFUN([gl_SYS_TIME_MODULE_INDICATOR], AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. - gl_MODULE_INDICATOR([$1]) + gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_HEADER_SYS_TIME_H_DEFAULTS], diff --git a/m4/time_h.m4 b/m4/time_h.m4 index b80e6910d1..f2e54f2a94 100644 --- a/m4/time_h.m4 +++ b/m4/time_h.m4 @@ -67,7 +67,7 @@ AC_DEFUN([gl_TIME_MODULE_INDICATOR], AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. - gl_MODULE_INDICATOR([$1]) + gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS], diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4 index d206efb9a7..789739dffa 100644 --- a/m4/unistd_h.m4 +++ b/m4/unistd_h.m4 @@ -48,7 +48,7 @@ AC_DEFUN([gl_UNISTD_MODULE_INDICATOR], AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. - gl_MODULE_INDICATOR([$1]) + gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_UNISTD_H_DEFAULTS], diff --git a/m4/wchar_h.m4 b/m4/wchar_h.m4 index f68011f243..8cae82dd0b 100644 --- a/m4/wchar_h.m4 +++ b/m4/wchar_h.m4 @@ -109,7 +109,7 @@ AC_DEFUN([gl_WCHAR_MODULE_INDICATOR], AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. - gl_MODULE_INDICATOR([$1]) + gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_WCHAR_H_DEFAULTS], diff --git a/modules/cloexec b/modules/cloexec index d590d1e6b4..7fb7eeb504 100644 --- a/modules/cloexec +++ b/modules/cloexec @@ -13,7 +13,7 @@ stdbool configure.ac: gl_CLOEXEC -gl_MODULE_INDICATOR([cloexec]) +gl_MODULE_INDICATOR_FOR_TESTS([cloexec]) Makefile.am: diff --git a/modules/fdopendir b/modules/fdopendir index 83c2af7d32..203f6c72d1 100644 --- a/modules/fdopendir +++ b/modules/fdopendir @@ -18,6 +18,7 @@ save-cwd configure.ac: gl_FUNC_FDOPENDIR gl_DIRENT_MODULE_INDICATOR([fdopendir]) +gl_MODULE_INDICATOR([fdopendir]) Makefile.am: diff --git a/modules/getopt-gnu b/modules/getopt-gnu index 34aea2df85..54bbe428d7 100644 --- a/modules/getopt-gnu +++ b/modules/getopt-gnu @@ -9,7 +9,7 @@ getopt-posix configure.ac: gl_FUNC_GETOPT_GNU -gl_MODULE_INDICATOR([getopt-gnu]) +gl_MODULE_INDICATOR_FOR_TESTS([getopt-gnu]) Makefile.am: diff --git a/modules/uninorm/u16-normalize b/modules/uninorm/u16-normalize index 076a7054ae..5338e5ef50 100644 --- a/modules/uninorm/u16-normalize +++ b/modules/uninorm/u16-normalize @@ -15,7 +15,7 @@ unictype/combining-class uninorm/decompose-internal configure.ac: -gl_MODULE_INDICATOR([uninorm/u16-normalize]) +gl_MODULE_INDICATOR_FOR_TESTS([uninorm/u16-normalize]) Makefile.am: lib_SOURCES += uninorm/u16-normalize.c diff --git a/modules/uninorm/u32-normalize b/modules/uninorm/u32-normalize index 9eb31f3d77..91b54b9bb3 100644 --- a/modules/uninorm/u32-normalize +++ b/modules/uninorm/u32-normalize @@ -15,7 +15,7 @@ unictype/combining-class uninorm/decompose-internal configure.ac: -gl_MODULE_INDICATOR([uninorm/u32-normalize]) +gl_MODULE_INDICATOR_FOR_TESTS([uninorm/u32-normalize]) Makefile.am: lib_SOURCES += uninorm/u32-normalize.c diff --git a/modules/uninorm/u8-normalize b/modules/uninorm/u8-normalize index 698f12dafe..75670afe91 100644 --- a/modules/uninorm/u8-normalize +++ b/modules/uninorm/u8-normalize @@ -15,7 +15,7 @@ unictype/combining-class uninorm/decompose-internal configure.ac: -gl_MODULE_INDICATOR([uninorm/u8-normalize]) +gl_MODULE_INDICATOR_FOR_TESTS([uninorm/u8-normalize]) Makefile.am: lib_SOURCES += uninorm/u8-normalize.c -- 2.30.2